; code: language=asm-collection tabSize=8

IOW_CASSOUT		equ	$FF
BIT_CASSOUT_LEVEL	equ	0

IOR_MODIN		equ	$FF
BIT_MODIN_MOTOR		equ	1
BIT_MODIN_MODSEL	equ	2
BIT_MODIN_ENALTSET	equ	3
BIT_MODIN_ENEXTIO	equ	4
BIN_MODIN_FAST		equ	6

IOW_LPOUT		equ	$F8
IOR_LPIN		equ	$F8
BIT_LPIN_FAULT		equ	4
BIT_LPIN_UNITSELECT	equ	5
BIT_LPIN_OUTPAPER	equ	6
BIT_LPIN_BUSY		equ	7

IOW_FDCDRVSEL		equ	$F4
BIT_FDCDRVSEL_DS0	equ	0
BIT_FDCDRVSEL_DS1	equ	1
BIT_FDCDRVSEL_SIDE	equ	4
FDCDRVSEL_SIDE0		equ	0<<BIT_FDCDRVSEL_SIDE
FDCDRVSEL_SIDE1		equ	1<<BIT_FDCDRVSEL_SIDE
BIT_FDCDRVSEL_PRECOMP	equ	5
FDCDRVSEL_PRECOMP_ON	equ	1<<BIT_FDCDRVSEL_PRECOMP
BIT_FDCDRVSEL_WSGEN	equ	6
FDCDRVSEL_WSGEN_ON	equ	1<<BIT_FDCDRVSEL_WSGEN
BIT_FDCDRVSEL_DDEN	equ	7
FDCDRVSEL_DD		equ	1<<BIT_FDCDRVSEL_DDEN

IOW_FDC_COMMAND		equ	$F0
IOR_FDC_STATUS		equ	$F0
IO_FDC_TRACK		equ	$F1
IO_FDC_SECTOR		equ	$F2
IO_FDC_DATA		equ	$F3

IOW_MODOUT		equ	$EC
BIT_MODOUT_CASSMOTOR	equ	1
MODOUT_CASSMOTOR_ON	equ	1<<BIT_MODOUT_CASSMOTOR
BIT_MODOUT_MODSEL	equ	2
MODOUT_MODSEL_64_80	equ	1<<BIT_MODOUT_MODSEL
BIT_MODOUT_ENALTSET	equ	3
MODOUT_ENALTSET		equ	1<<BIT_MODOUT_ENALTSET
BIT_MODOUT_ENEXTIO	equ	4
MODOUT_ENEXTIO		equ	1<<BIT_MODOUT_ENEXTIO
BIT_MODOUT_FAST		equ	5
MODOUT_FAST		equ	1<<BIT_MODOUT_FAST

IOR_RTCINT_CLEAR	equ	$EC

IOW_SIO_MASTER_RESET	equ	$E8
IOW_SIO_BAUDRATE	equ	$E9
IOW_SIO_MODEMCTL	equ	$EA
IOW_SIO_TXHOLDING	equ	$EB

IOR_SIO_MODEMSTAT	equ	$E8
IOR_SIO_UARTSTAT	equ	$EA
IOR_SIO_RXHOLDING	equ	$EB

IOW_NMIMASK		equ	$E4
BIT_NMIMASK_MOTOR	equ	6
NMIMASK_MOTOR		equ	1<<BIT_NMIMASK_MOTOR
BIT_NMIMASK_INTRQ	equ	7
NMIMASK_INTRQ		equ	1<<BIT_NMIMASK_INTRQ

IOR_NMISTATUS		equ	$E4
BIT_NMISTATUS_RESET	equ	5
BIT_NMISTATUS_MOTOR	equ	6
BIT_NMISTATUS_INTRQ	equ	7

IOW_INTMASK		equ	$E0
IOR_INTSTATUS		equ	$E0

IOW_BOOTROM		equ	$9C
BIT_IOW_BOOTROM		equ	0
IOW_BOOTROM_EN		equ	1<<BIT_IOW_BOOTROM

IOW_SOUND		equ	$90
BIT_IOW_SOUND		equ	0
SOUND_ON		equ	1<<BIT_IOW_SOUND

IOW_OPREG		equ	$84
BIT_OPREG_SEL0		equ	0				; controls whether lower 16K of RAM is writable(1)
BIT_OPREG_SEL1		equ	1				; controls whether KB/VRAM is in low(0) or high(1) space
BIT_OPREG_8064		equ	2
OPREG_64		equ	0<<BIT_OPREG_8064
OPREG_80		equ	1<<BIT_OPREG_8064
BIT_OPREG_INVERSE	equ	3
OPREG_INVERSE		equ	1<<BIT_OPREG_INVERSE
BIT_OPREG_SRCPAGE	equ	4
OPREG_SRCPAGE_LOWER	equ	0<<BIT_OPREG_SRCPAGE
OPREG_SRCPAGE_UPPER	equ	1<<BIT_OPREG_SRCPAGE
BIT_OPREG_ENPAGE	equ	5
OPREG_ENPAGE		equ	1<<BIT_OPREG_ENPAGE
BIT_OPREG_DESPAGE	equ	6
OPREG_DESPAGE_UPPER	equ	0<<BIT_OPREG_DESPAGE
OPREG_DESPAGE_LOWER	equ	1<<BIT_OPREG_DESPAGE
BIT_OPREG_VIDPAGE	equ	7
OPREG_VIDPAGE_0		equ	0<<BIT_OPREG_VIDPAGE
OPREG_VIDPAGE_1		equ	1<<BIT_OPREG_VIDPAGE