From 6a80e6f083125118b431b622045a7df434e6419d Mon Sep 17 00:00:00 2001 From: 4am Date: Wed, 12 Jun 2024 16:26:32 -0400 Subject: [PATCH] set main zp/stack on launch because some games use aux zp and some emulators don't reset it --- src/4cade.init.machine.a | 1 + src/constants.a | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/4cade.init.machine.a b/src/4cade.init.machine.a index d45ab0fb6..b95f9c920 100644 --- a/src/4cade.init.machine.a +++ b/src/4cade.init.machine.a @@ -13,3 +13,4 @@ sta STOREOFF sta READMAINMEM sta WRITEMAINMEM + sta SETSTDZP diff --git a/src/constants.a b/src/constants.a index 6eb53a6da..a1435c3b4 100644 --- a/src/constants.a +++ b/src/constants.a @@ -77,16 +77,19 @@ ; soft switches KBD = $C000 ; last key pressed (if any) CLEARKBD = $C010 ; clear last key pressed -STOREOFF = $C000 ; STA then use the following 4 flags: -READMAINMEM = $C002 ; STA to read from main mem -READAUXMEM = $C003 ; STA to read from aux mem -WRITEMAINMEM = $C004 ; STA to write to main mem -WRITEAUXMEM = $C005 ; STA to write to aux mem + +STOREOFF = $C000 ; STA then use the following flags: +READMAINMEM = $C002 ; STA to read from main mem ($0200..$BFFF) +READAUXMEM = $C003 ; STA to read from aux mem ($0200..$BFFF) +WRITEMAINMEM = $C004 ; STA to write to main mem ($0200..$BFFF) +WRITEAUXMEM = $C005 ; STA to write to aux mem ($0200..$BFFF) + +SETSTDZP = $C008 ; STA to r/w from main mem stack and zero page ($0000..$01FF) CLRC3ROM = $C00A ; STA to use internal Slot 3 ROM (required to use 128K and DHGR) SETC3ROM = $C00B ; STA to use external Slot 3 ROM (required to detect VidHD in slot 3) -CLR80VID = $C00C ; 40 columns (also used to get out of DHGR mode) -SET80VID = $C00D ; 80 columns (also used to get into DHGR mode) -PRIMARYCHARSET= $C00E ; no mousetext for you +CLR80VID = $C00C ; STA to use 40 columns (also used to get out of DHGR mode) +SET80VID = $C00D ; STA to use 80 columns (also used to get into DHGR mode) +PRIMARYCHARSET= $C00E ; STA to use no-mousetext character set SLOT3STATUS = $C017 ; bit 7 only MONOCOLOR = $C021 ; IIgs bit 7 switches composite mono/color modes TBCOLOR = $C022 ; IIgs text foreground and background colors (also VidHD but write-only) @@ -162,7 +165,7 @@ gVal = $1F81 ; "" UILine1 = $1FB0 ; used by DrawUI UILine2 = $1FD8 ; "" UI_ToPlay = $1FF7 ; "" -ProBootEntry = $2025 ; used by ProBoot +ProBootEntry = $2028 ; used by ProBoot gSearchIndex = $6000 gSearchCache = $A000 gPathname = $BFD0 ; used by SetPath/AddToPath