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