Rom 1 _InstallCDA call clobbers some direct page locations.

This is fixed in ROM 3 (or via the TS patches if you boot GS/OS).
Workaround it by switching to DPAGE 0.

Also, allocate memory (since I originally thought that might be relevant).
This commit is contained in:
Kelvin Sherlock 2022-01-30 15:50:54 -05:00
parent 1f7e3b3b4c
commit 04113c4725
3 changed files with 73 additions and 0 deletions

View File

@ -93,6 +93,8 @@ read_q_tail ds 2
write_q_head ds 2
write_q_tail ds 2
master_id ds 2
do *>256
err "too big"
fin

View File

@ -37,8 +37,20 @@ ptr ds 2
init_cda ent
php
rep #$30
*
* rom 1 IIgs InstallCDA clobbers $3c-$43 on the direct page
*
phd
pea #0
pld
psl #handle
_InstallCDA
pld
plp
rts

View File

@ -4,6 +4,8 @@
xc
xc
tbx on ; qasm
mx %11
use vt.equ
use apple2gs.equ
@ -62,6 +64,9 @@ init
sta SETALTCHAR
rep #$30
jsr init_mem
ldx #254
:zloop stz 0,x
dex
@ -120,6 +125,60 @@ init
jsr init_cda
rts
init_mem
*
* see prodos technote #27
*
* _InstallCDA uses the memory manager ; otherwise I wouldn't bother
* This is here to prevent MM from stomping on our memory.
*
mx %00
stz master_id
_TLStartUp
pha
_MMStartUp
pla
bcs :p8
rts
:p8
_MTStartUp
pea #0
pea #$1000
_GetNewID
pla
sta master_id
* bank 0
pha
pha
pea #$0000
pea #$b800
pei master_id
pea #$c013
pea #0000
pea #0800
_NewHandle
pla
pla
* bank 1
pha
pha
pea #$0000
pea #$b800
pei master_id
pea #$c013
pea #$0001
pea #$0800
_NewHandle
pla
pla
rts
reset ent
mx %11
php