;-----------------------------------------------------------------------------
; Mini 6502 BIOS Interface Definitions
; Mike Christle (c) 2014
;-----------------------------------------------------------------------------
;                        TERMS OF USE: MIT License
;-----------------------------------------------------------------------------
; Permission is hereby granted, free of charge, to any person obtaining a
; copy of this software and associated documentation files (the "Software"),
; to deal in the Software without restriction, including without limitation
; the rights to use, copy, modify, merge, publish, distribute, sublicense,
; and/or sell copies of the Software, and to permit persons to whom the
; Software is furnished to do so, subject to the following conditions:
; 
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
; 
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
; DEALINGS IN THE SOFTWARE.
;-----------------------------------------------------------------------------

VIA_PRB         EQU $8010
VIA_PRA         EQU $8011
VIA_DDRB        EQU $8012
VIA_DDRA        EQU $8013
VIA_T1C_L       EQU $8014
VIA_T1C_H       EQU $8015
VIA_T1L_L       EQU $8016
VIA_T1L_H       EQU $8017
VIA_T2C_L       EQU $8018
VIA_T2C_H       EQU $8019
VIA_SR          EQU $801A
VIA_ACR         EQU $801B
VIA_PCR         EQU $801C
VIA_IFR         EQU $801D
VIA_IER         EQU $801E
VIA_PRA_NH      EQU $801F

VIA_INT_VEC_LO  EQU $F0
VIA_INT_VEC_HI  EQU $F1

APP_START       EQU $0500

;---------------------------------------------------------------------
; GetChar
; Output    A = Data Byte
;           Z = 1 if buffer empty
;---------------------------------------------------------------------
#macro          GetChar
                JSR $FF00
#endmacro

;---------------------------------------------------------------------
; PutChar
; Input     A = Data Byte
; Output    Z = 1 if buffer full
;---------------------------------------------------------------------
#macro          PutChar
                JSR $FF03
#endmacro

;---------------------------------------------------------------------
; GetString     Address of Buffer, Max Byte Count
; Terminates on CR
;---------------------------------------------------------------------
#macro          GetString p1, p2
                LDA #<%p1
                LDY #>%p1
                LDX #%p2
                JSR $FF06
#endmacro

;---------------------------------------------------------------------
; PutString     Address of Buffer
; Terminates on NULL char
;---------------------------------------------------------------------
#macro          PutString p1
                LDA #<%p1
                LDY #>%p1
                JSR $FF09
#endmacro

