From 93cf397134ce35b05cf75e4a0075330998ed0c76 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 18 Mar 2020 19:53:50 -0700 Subject: [PATCH] make VBL addresses permanent --- src/4cade.a | 13 +++++++------ src/constants.a | 8 ++++---- src/hw.vbl.a | 1 - src/hw.vbl.init.a | 18 +++++++++--------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/4cade.a b/src/4cade.a index dce4880b8..fa6cdb457 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -137,6 +137,13 @@ SwitchToBank2 rts !source "src/prodos.path.a" ; paths end up on the same page +; WaitForVBL + jmp WaitForVBL_iie ; SMC to RTS on a II+ + +; UnwaitForVBL + rts ; SMC to JMP on a IIc + !word iUnwaitForVBL + ; MockingboardStuff (label is in constants.a so prelaunchers can use it) ; slot number where Mockingboard was detected and type of board ; #$00 if no Mockingboard detected @@ -190,10 +197,4 @@ EvenLasterMover !warn "LCRAM2 ends at ", LCRAM2_END - 1 !warn "RELBASE = ", $10000 - (LastMover - FirstMover) } -} else { - !if (iWaitForVBL != WaitForVBL) or (iUnwaitForVBL != UnwaitForVBL) { - !warn "constants.a needs updating" - !error "WaitForVBL is at ", iWaitForVBL - !error "UnwaitForVBL is at ", iUnwaitForVBL - } } diff --git a/src/constants.a b/src/constants.a index 579416ccb..577bf2f36 100644 --- a/src/constants.a +++ b/src/constants.a @@ -8,7 +8,7 @@ ; LC RAM BANK 1 ; D000..E297 - persistent data structures (gGlobalPrefsStore, gGamesListStore) ; ...unused... -; EAA7..FFF9 - main program code +; EAA7..FFF8 - main program code ; FFFA..FFFF - NMI, reset, IRQ vectors ; ; LC RAM BANK 2 @@ -108,6 +108,9 @@ gValLen = $1F80 gVal = $1F81 ; LC RAM 1 +WaitForVBL = $FFF2 +UnwaitForVBL = $FFF5 + MockingboardStuff = $FFF8 ; bit 7 = 1 if speech chip present (Mockingboard "C") ; bit 6 = 1 if Mockingboard "B" (stereo) found (else Mockingboard "A") ; bit 4-5 unused @@ -134,6 +137,3 @@ HAS_VIDHD = %00010000 SUPPORTS_SHR = %00110000 CHEATS_ENABLED = %00001000 -; VBL functions -WaitForVBL = $FCB0 -UnwaitForVBL = $FCC5 diff --git a/src/hw.vbl.a b/src/hw.vbl.a index 0a461fc74..da6bd8994 100644 --- a/src/hw.vbl.a +++ b/src/hw.vbl.a @@ -25,7 +25,6 @@ WaitForVBL_nop ; II/II+ have no easy VBL rts iUnwaitForVBL - rts ; SMC on IIc - bit $C019 bpl - lda $C070 ; $c019 bit 7 is sticky, reset it diff --git a/src/hw.vbl.init.a b/src/hw.vbl.init.a index 79c2d73ec..d42b011ad 100644 --- a/src/hw.vbl.init.a +++ b/src/hw.vbl.init.a @@ -13,7 +13,6 @@ romid_ec = $FBC0 idroutine = $FE1F ; SEC, JSR $FE1F, BCS notgs BuildVBLFunction - lda #$60 ldx romid cpx #ROMID_IIECOMPAT bne @build_none ; not a //e @@ -27,19 +26,20 @@ BuildVBLFunction lda #$10 sta patch_VBL_iigs2 @NotGS - lda #WaitForVBL_iie - sta WaitForVBL+2 - lda #$4C -@build_none - sta WaitForVBL rts @build_iic lda #$70 sta patch_VBL_iic1+1 lda #$60 sta patch_VBL_iic2 - lda #$EA + lda #iWaitForVBL + sta WaitForVBL+2 + lda #$4C sta UnwaitForVBL rts +@build_none + lda #$60 + sta WaitForVBL + rts