;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
;	D O R A D O   C o n t r o l   P r o g r a m
;
;		I / O   D e v i c e   A d d r e s s e s
;
;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

;	filed on DoradoIO.mdefs
;	E. McCreight
;	last modified April 14, 1981  12:48 PM

	.RDX	16

;	Description of the MCS6532 "combo" Ram/IO/Timer chip

PA = 0
DDR = 1
	IsOutput = 1
	IsInput = 0
	AllOutput = 0ff
	AllInput = 0
PB = 2
Timer = 14
	DoTimerInterrupt = 8
	Div8 = 1
	Div64 = 2
	Div1024 = 3
IntFlags = 5
	TimerFlag = 80
	PA7Flag = 40


;	The various 6532 chips:

DAC = 400+PA
MAByte = DAC
DACDDRValue = AllOutput	; all bits output

Sync = 80
CPIBus = 400+PB
	MASync = Sync	; in CPIBus
	Trap' = 40
	DMD0 = 20	; used for saving the DMD shift register
	CPI = 1e	; CPI[0-3] in bits 4-1
	DMuxData = 1
CPIBusDDRValue = IsOutput*(MASync+Trap')

Comparators = 480+PA
	ISel = 0e0	; in Comparators
		IDelta = 1↑5	; in ISel
		ICalibrateMask = 0*IDelta
		IDDMask = 1*IDelta
		ICCMask = 2*IDelta
		ITTMask = 3*IDelta
		IEEMask = 4*IDelta
		IGndMask = 5*IDelta
		IVEEMask = 6*IDelta
	CI = 10
	CVDD = 8
	CVCC = 4
	CVTT = 2
	CVEE = 1
ComparatorsDDRValue = IsOutput*ISel

MiscByte = 480+PB
	LampOff = 80	; in MiscByte
	Boot' = 40
	TCBTempSense = 20
	TBaseTempSense = 10
	MCManifold = 0f
MiscByteDDRValue = IsOutput*LampOff

CPRegH = 500+PA
	AMSync = Sync	; in CPRegH during PokeMicro
	DoradoSel = 40
	AHasCP = 20
	MWantsA = 10
	HoldMC = 8
	MidasCommand = 7	; bits 0-2
CPRegHDDRValue = AllInput	; all input bits

CPRegL = 500+PB
CPRegLDDRValue = AllInput	; all input bits

MCPBusH = 580+PA
MCPBusHDDRValue = 0ff

MCPBusL = 580+PB
	MCPABus = 70	; in MCPBusL
	SetRunIn = 4
	SkipDiskWait' = 2
	MCPStrobe = 1
MCPBusLDDRValue = IsOutput*(80+MCPABus+MCPStrobe)

Watchdog = 600+PA
	WatchdogIn = 80	; in Watchdog
	WatchdogOut = 40
WatchdogDDRValue = WatchdogOut*IsOutput

;		Memory Addresses

Page0 = 0
Page1 = 100
StackTop = Page1+1	; +S

;	Dorado CP Bus Bits

Control = 0	; goes in MCPBusL[MCPABus]
Clock = 10
ABMux0 = 20
ABMux1 = 30
MIR0 = 40
MIR1 = 50
MIR2 = 60
MIR3 = 70


ClrStop = 40	; in Control
StopAtT1 = 20
Jam = 10
Freeze = 8
ClrMIR = 4
ClrCT = 2
SetRun = 1
SetSS = 80	; in the low-order byte of MCPBus

DAddrBit = 80	; in Clock
ShiftDMD = 40
InhibitCAHolds = 20
GetTLINK = 10
UseCPReg = 8
UseDMD = 4
BaseAttn = 2
ClrReady = 1

B0 = 0	; MCPBusH values for CPI readout
B1 = 20
B2 = 40
B3 = 60
PEIM = 80
PEMem = 0a0
Stopped = 0c0