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_head ds 2
write_q_tail ds 2 write_q_tail ds 2
master_id ds 2
do *>256 do *>256
err "too big" err "too big"
fin fin

View File

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

View File

@ -4,6 +4,8 @@
xc xc
xc xc
tbx on ; qasm
mx %11 mx %11
use vt.equ use vt.equ
use apple2gs.equ use apple2gs.equ
@ -62,6 +64,9 @@ init
sta SETALTCHAR sta SETALTCHAR
rep #$30 rep #$30
jsr init_mem
ldx #254 ldx #254
:zloop stz 0,x :zloop stz 0,x
dex dex
@ -120,6 +125,60 @@ init
jsr init_cda jsr init_cda
rts 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 reset ent
mx %11 mx %11
php php