2021-09-06 22:28:07 -04:00
|
|
|
* MAINMEM.INIT.S
|
|
|
|
* (c) Bobbi 2021 GPLv3
|
|
|
|
*
|
|
|
|
* Initialization, interrupt handling and reset handling code
|
|
|
|
* that resides in main memory.
|
|
|
|
|
2021-11-14 17:28:48 -05:00
|
|
|
* 14-Nov-2021 If started from CSD, gets prefix to CMDBUF.
|
|
|
|
|
2022-11-21 16:02:46 -05:00
|
|
|
AUDIOCARD DB $00 ; $00 = Mockingboard, $01 = Ensoniq
|
2021-11-14 17:28:48 -05:00
|
|
|
|
2022-12-22 13:39:51 -05:00
|
|
|
|
2021-09-06 22:28:07 -04:00
|
|
|
* Trampoline in main memory used by aux memory IRQ handler
|
|
|
|
* to invoke Apple II / ProDOS IRQs in main memory
|
2021-11-14 18:04:10 -05:00
|
|
|
A2IRQ >>> IENTMAIN ; IENTMAIN does not do CLI
|
2022-12-22 13:39:51 -05:00
|
|
|
LDA #>A2IRQRET
|
|
|
|
PHA
|
|
|
|
LDA #<A2IRQRET
|
|
|
|
PHA
|
|
|
|
PHP ; Fake things to look like IRQ
|
2021-11-14 18:04:10 -05:00
|
|
|
JMP (A2IRQV) ; Call Apple II ProDOS ISR
|
2022-12-22 13:39:51 -05:00
|
|
|
A2IRQRET >>> XF2AUX,IRQBRKRET
|
2021-09-06 22:28:07 -04:00
|
|
|
|
2022-11-04 21:27:20 -04:00
|
|
|
|
2021-09-06 22:28:07 -04:00
|
|
|
* BRK handler in main memory. Used on Apple IIgs only.
|
2021-11-14 18:04:10 -05:00
|
|
|
GSBRK >>> XF2AUX,GSBRKAUX
|
2021-09-06 22:28:07 -04:00
|
|
|
|
2022-11-04 21:02:30 -04:00
|
|
|
|
2021-09-06 22:28:07 -04:00
|
|
|
* Reset handler - invoked on Ctrl-Reset
|
2022-10-11 22:00:36 -06:00
|
|
|
* XFER to AUXMOS ($D000) in aux, AuxZP on, LC on
|
2021-11-14 18:04:10 -05:00
|
|
|
RESET TSX
|
|
|
|
STX $0100
|
2022-10-11 22:00:36 -06:00
|
|
|
LDA AN0OFF ; AN0 off
|
|
|
|
LDA AN1OFF ; AN1 off
|
|
|
|
LDA AN2ON ; AN2 on
|
|
|
|
LDA AN3ON ; AN3 on
|
2022-11-04 21:27:20 -04:00
|
|
|
JSR RESETHW ; Reset hardware
|
2021-11-14 18:04:10 -05:00
|
|
|
>>> XF2AUX,AUXMOS
|
|
|
|
|
|
|
|
|
2022-11-04 21:27:20 -04:00
|
|
|
* Reset hardware
|
|
|
|
RESETHW SEC
|
2022-11-21 16:02:46 -05:00
|
|
|
STZ AUDIOCARD
|
2022-11-04 21:27:20 -04:00
|
|
|
JSR IDROUTINE ; See if this is a GS
|
|
|
|
BCS :NOTGS
|
2022-11-18 23:58:53 -05:00
|
|
|
JSR ENSQINIT ; Initialize Ensoniq
|
2022-11-21 16:02:46 -05:00
|
|
|
INC AUDIOCARD
|
|
|
|
RTS ; AUDIOCARD=1
|
2022-11-18 19:26:20 -05:00
|
|
|
:NOTGS
|
2022-11-27 20:06:58 -05:00
|
|
|
JSR MOCKINIT ; Initialize Mockingboard (sl4)
|
2022-12-22 18:26:50 -05:00
|
|
|
RTSINSTR RTS ; AUDIOCARD=0
|
2021-09-06 22:28:07 -04:00
|
|
|
|