From 00707b6c0bbd1299617b83fc431da145849f4282 Mon Sep 17 00:00:00 2001 From: frankmilliron <34376619+frankmilliron@users.noreply.github.com> Date: Tue, 29 Nov 2022 07:54:52 -0800 Subject: [PATCH] Clear //gs Shadow Page 2 (#532) * Fix Alternate Display Mode on ROM0 and ROM1 //gs fixes attract hanging on ROM0 and ROM1 machines * Clear //gs Shadow Page 2 We now control the horizontal. We now control the vertical. We now control the shadow bank of //gs video memory. Improves The Goonies and Pacman demos on ROM0/1. --- src/4cade.init.a | 18 +++++++++++++++++- src/demo/gamma.goblins.a | 1 - src/macros.a | 16 ++++++++-------- src/prelaunch/gamma.goblins.a | 1 - 4 files changed, 25 insertions(+), 11 deletions(-) mode change 100644 => 100755 src/4cade.init.a diff --git a/src/4cade.init.a b/src/4cade.init.a old mode 100644 new mode 100755 index 1b6f951d9..8a1034a64 --- a/src/4cade.init.a +++ b/src/4cade.init.a @@ -75,7 +75,7 @@ ; bit 7 = 1 if joystick ; and all other bits are 0 (we'll set bit 3 after copying it to LC RAM) - ; accommodate uppercase-only machines (64K ][+ is supported) + ; accommodate uppercase-only machines (64K ][ and ][+ are supported) lda ROM_MACHINEID cmp #$A0 beq + ; Spectrum ED @@ -86,6 +86,22 @@ + lda #$FF sta zpCharMask + ; IIgs fix for Alternate Display Mode (clear shadow page 2) + lda zpMachineStatus + and #IS_IIGS + beq + + ldx #0 + txa +!cpu 65816 +- sta $E00800,x ; when Alternate Display Mode is turned off, the "2"s + sta $E00900,x ; displayed on the screen live at $E00800 + sta $E00A00,x ; (page "2"/$0800 of IIgs bank $E0) + sta $E00B00,x ; They are initialized by the IIgs boot ROM + inx + bne - +!cpu 6502 ++ + ; increase text window width so we can print to the edge of the screen without scrolling inc $21 ; print version or build number in lower right corner diff --git a/src/demo/gamma.goblins.a b/src/demo/gamma.goblins.a index 5cf81405b..d4ddb6739 100644 --- a/src/demo/gamma.goblins.a +++ b/src/demo/gamma.goblins.a @@ -9,7 +9,6 @@ !source "src/macros.a" +GAME_REQUIRES_JOYSTICK - +TEST_TEXT_PAGE_2 +ENABLE_ACCEL_LC +LOAD_XSINGLE title diff --git a/src/macros.a b/src/macros.a index af8880c7b..b772e994f 100755 --- a/src/macros.a +++ b/src/macros.a @@ -352,9 +352,9 @@ +READ_ROM_NO_WRITE } -!macro USES_TEXT_PAGE_2 { - lda ROM_MACHINEID - cmp #$06 +!macro USES_TEXT_PAGE_2 { ; If we know we are going into a game one-time + lda ROM_MACHINEID ; only we can just blindly turn on TEXT2COPY, as + cmp #$06 ; Alternate Display Mode turns off on reset or reboot. bne + sec jsr $FE1F ; check for IIgs @@ -364,10 +364,10 @@ + } -!macro TEST_TEXT_PAGE_2 { - lda ROM_MACHINEID - cmp #$06 - bne ++ +!macro TEST_TEXT_PAGE_2 { ; On a ROM3 IIgs we can test if Alternate Display Mode + lda ROM_MACHINEID ; is already on. ROM0 and ROM1 versions of ADM use + cmp #$06 ; interrupts and can cause hangs, so safer to just + bne ++ ; leave it turned off, especially in ATTRACT/DEMO mode. sec jsr $FE1F ; check for IIgs bcs ++ @@ -434,7 +434,7 @@ sta $3F4 } ; for games that clobber $100-$105, the prelaunch code constructs a new reset vector -; somewhere else and sets its +; somewhere else and sets the reset vector to point at it. !macro NEW_RESET_VECTOR .addr { ldx #5 - lda $100,x diff --git a/src/prelaunch/gamma.goblins.a b/src/prelaunch/gamma.goblins.a index 235091191..5298f9e22 100755 --- a/src/prelaunch/gamma.goblins.a +++ b/src/prelaunch/gamma.goblins.a @@ -7,7 +7,6 @@ !source "src/prelaunch/common.a" - +USES_TEXT_PAGE_2 +ENABLE_ACCEL lda #$60 sta $2034