diff --git a/vt.equ.S b/vt.equ.S index 8fc9caa..fa23add 100644 --- a/vt.equ.S +++ b/vt.equ.S @@ -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 diff --git a/vt100.cda.S b/vt100.cda.S index 281f65c..7cede82 100644 --- a/vt100.cda.S +++ b/vt100.cda.S @@ -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 diff --git a/vt100.main.S b/vt100.main.S index ef514bd..e0de479 100644 --- a/vt100.main.S +++ b/vt100.main.S @@ -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