2018-08-23 20:02:48 +00:00
|
|
|
;license:MIT
|
2021-02-17 23:37:09 +00:00
|
|
|
;(c) 2018-2021 by 4am
|
2018-08-23 20:02:48 +00:00
|
|
|
;
|
|
|
|
|
2019-06-20 01:50:48 +00:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; YE OLDE GRAND UNIFIED MEMORY MAP
|
|
|
|
;
|
|
|
|
; LC RAM BANK 1
|
2021-10-23 02:05:50 +00:00
|
|
|
; D000..E7D2 - persistent data structures (gGlobalPrefsStore, gGamesListStore)
|
2021-10-24 05:36:09 +00:00
|
|
|
; E9ED..FFEE - main program code
|
2021-10-18 22:37:40 +00:00
|
|
|
; FFEF..FFF9 - API functions and global constants available for main program
|
2020-03-25 20:56:35 +00:00
|
|
|
; code, prelaunchers, transition effects, &c.
|
2021-10-18 22:37:40 +00:00
|
|
|
; (LoadFileDirect, Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)
|
2019-09-09 21:28:13 +00:00
|
|
|
; FFFA..FFFF - NMI, reset, IRQ vectors
|
2019-06-20 01:50:48 +00:00
|
|
|
;
|
|
|
|
; LC RAM BANK 2
|
|
|
|
; D000..D3FF - ProRWTS data
|
2021-10-24 02:21:43 +00:00
|
|
|
; D400..D6C3 - ProRWTS code
|
|
|
|
; D6C4..DB91 - HGR font code & ProRWTS glue code
|
|
|
|
; DB92..DBA1 - backup of stack (during gameplay and self-running demos)
|
2020-11-09 18:45:03 +00:00
|
|
|
; ...unused...
|
2020-03-29 23:01:23 +00:00
|
|
|
; DBB4..DBFF - (de)acceleration function
|
2019-09-30 18:18:57 +00:00
|
|
|
; DC00..DFFF - HGR font data
|
2019-06-20 01:50:48 +00:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
2020-11-12 22:07:04 +00:00
|
|
|
!ifndef _CONSTANTS_ {
|
|
|
|
|
2018-08-26 19:33:32 +00:00
|
|
|
; soft switches
|
2019-06-27 14:55:07 +00:00
|
|
|
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
|
2019-07-21 02:51:55 +00:00
|
|
|
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)
|
2019-06-27 14:55:07 +00:00
|
|
|
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
|
|
|
|
SLOT3STATUS = $C017 ; bit 7 only
|
2019-06-28 03:42:01 +00:00
|
|
|
TBCOLOR = $C022 ; IIgs text foreground and background colors (also VidHD)
|
|
|
|
NEWVIDEO = $C029 ; IIgs graphics modes (also VidHD)
|
2019-06-27 14:55:07 +00:00
|
|
|
SPEAKER = $C030 ; chirp chirp
|
2019-06-28 03:42:01 +00:00
|
|
|
CLOCKCTL = $C034 ; bits 0-3 are IIgs border color (also VidHD)
|
|
|
|
SHADOW = $C035 ; IIgs auxmem-to-bank-E1 shadowing (also VidHD)
|
2020-03-13 14:34:56 +00:00
|
|
|
TEXTMODE = $C051
|
2019-06-27 15:37:23 +00:00
|
|
|
PAGE1 = $C054 ; page 1 (affects text, HGR, DHGR)
|
|
|
|
PAGE2 = $C055 ; page 2 (affects text, HGR, DHGR)
|
2019-06-27 14:55:07 +00:00
|
|
|
DHIRESON = $C05E ; double hi-res on switch
|
|
|
|
DHIRESOFF = $C05F ; double hi-res off switch
|
2018-08-26 19:33:32 +00:00
|
|
|
|
2019-06-27 14:55:07 +00:00
|
|
|
; ROM routines and addresses
|
|
|
|
; (prefixed because so much of the program runs from LC RAM, so don't call
|
|
|
|
; these without thinking about memory banks first)
|
2019-07-29 16:00:59 +00:00
|
|
|
ROM_TEXT2COPY =$F962 ; turn on alternate display mode on IIgs
|
2020-07-29 16:15:22 +00:00
|
|
|
ROM_REBOOT = $FAA6
|
2019-06-27 14:55:07 +00:00
|
|
|
ROM_TEXT = $FB2F
|
|
|
|
ROM_MACHINEID =$FBB3
|
|
|
|
ROM_HOME = $FC58
|
2020-03-05 17:38:53 +00:00
|
|
|
ROM_COUT = $FDED
|
2019-06-27 14:55:07 +00:00
|
|
|
ROM_NORMAL = $FE84 ; NORMAL text (instead of INVERSE or FLASH)
|
|
|
|
ROM_IN0 = $FE89 ; SETKBD
|
|
|
|
ROM_PR0 = $FE93 ; SETVID
|
2018-08-26 19:33:32 +00:00
|
|
|
|
2019-09-22 02:46:08 +00:00
|
|
|
; zero page during init ONLY
|
|
|
|
zpMachineStatus= $F0 ; bit 7 = 1 if machine has joystick
|
|
|
|
; bit 6 = 1 if machine has 128K
|
|
|
|
; bit 5 = 1 if machine has a VidHD card
|
|
|
|
; bit 4 = 1 if machine is a IIgs
|
|
|
|
; only used during init, then copied to MachineStatus in LC RAM
|
2019-10-08 03:24:13 +00:00
|
|
|
zpCharMask = $F1 ; only used during init, then clobbered
|
2019-09-22 02:46:08 +00:00
|
|
|
|
2018-08-23 20:02:48 +00:00
|
|
|
; zero page
|
2019-09-22 02:18:33 +00:00
|
|
|
PARAM = $00 ; word (used by PARAMS_ON_STACK macro, so basically everywhere)
|
|
|
|
PTR = $02 ; word
|
|
|
|
SRC = $04 ; word
|
|
|
|
DEST = $06 ; word
|
|
|
|
SAVE = $08 ; word
|
2020-03-24 20:30:14 +00:00
|
|
|
WINDEX = $0A ; word
|
|
|
|
WCOUNT = $0C ; word
|
2019-09-22 02:46:08 +00:00
|
|
|
HTAB = $24 ; byte
|
|
|
|
VTAB = $25 ; byte
|
2019-06-27 14:55:07 +00:00
|
|
|
RNDSEED = $4E ; word
|
2019-09-22 02:46:08 +00:00
|
|
|
; textrank
|
2020-03-24 20:30:14 +00:00
|
|
|
BestMatchIndex = $E5 ; word
|
2019-09-22 02:46:08 +00:00
|
|
|
tmpx = $E7 ; byte
|
|
|
|
remainder = $E8 ; word
|
|
|
|
num1 = $EA ; word
|
|
|
|
num2 = $EC ; byte
|
2019-06-23 18:40:07 +00:00
|
|
|
Timeout = $ED ; 3 bytes (used by SearchMode)
|
2019-09-22 02:46:08 +00:00
|
|
|
zpword = $F0 ; word
|
|
|
|
zpstring = $F2 ; word
|
|
|
|
runningscore= $F4 ; word
|
|
|
|
startat = $F6 ; byte
|
|
|
|
i = $F7 ; byte
|
|
|
|
tmp = $F8 ; byte
|
|
|
|
gamelength= $F9 ; byte
|
|
|
|
firstletter= $FA ; byte
|
|
|
|
MatchCount = $FB ; byte
|
|
|
|
BestMatchScore = $FC ; byte
|
|
|
|
|
2018-08-31 04:31:54 +00:00
|
|
|
; $FE ; used by ParseGamesList
|
|
|
|
; $FF ; used by ParseGamesList
|
|
|
|
|
|
|
|
; main memory
|
2019-10-09 04:25:10 +00:00
|
|
|
gPathname = $BFD0 ; used by SetPath/AddToPath
|
2018-08-31 04:31:54 +00:00
|
|
|
gKeyLen = $1F00 ; used by ParseGamesList
|
|
|
|
gKey = $1F01
|
2019-09-21 16:59:56 +00:00
|
|
|
UILine1 = $1FB0
|
|
|
|
UILine2 = $1FD8
|
|
|
|
UI_ToPlay = $1FF7
|
|
|
|
|
2018-08-31 04:31:54 +00:00
|
|
|
gValLen = $1F80
|
|
|
|
gVal = $1F81
|
2019-01-15 00:06:58 +00:00
|
|
|
|
2019-09-15 21:55:16 +00:00
|
|
|
; LC RAM 1
|
2021-10-15 20:00:40 +00:00
|
|
|
iLoadFileDirect = $FFEF
|
2020-03-19 02:53:50 +00:00
|
|
|
WaitForVBL = $FFF2
|
|
|
|
UnwaitForVBL = $FFF5
|
|
|
|
|
2020-02-28 23:33:10 +00:00
|
|
|
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
|
|
|
|
; bits 0-3: slot number
|
2019-10-05 01:34:49 +00:00
|
|
|
MachineStatus = $FFF9
|
2019-09-15 21:55:16 +00:00
|
|
|
|
2019-10-05 01:34:49 +00:00
|
|
|
; LC RAM 2
|
2020-03-29 23:01:23 +00:00
|
|
|
DisableAccelerator = $DBB4
|
2019-10-05 01:34:49 +00:00
|
|
|
EnableAccelerator = DisableAccelerator+3
|
|
|
|
|
2020-03-05 17:38:53 +00:00
|
|
|
; AND masks for MockingboardStuff
|
|
|
|
MOCKINGBOARD_SLOT = %00001111
|
|
|
|
HAS_SPEECH = %10000000
|
|
|
|
|
2020-03-18 16:08:39 +00:00
|
|
|
; AND masks for game info bitfield (after game display name in gGamesListStore)
|
2020-03-13 00:03:37 +00:00
|
|
|
HAS_DHGR_TITLE = %10000000 ; this one is hard-coded via BMI instead of AND/BNE
|
2020-03-09 21:24:30 +00:00
|
|
|
CHEAT_CATEGORY = %00001111
|
|
|
|
|
2019-10-05 01:34:49 +00:00
|
|
|
; AND masks for MachineStatus
|
2020-03-05 17:38:53 +00:00
|
|
|
HAS_JOYSTICK = %10000000
|
|
|
|
HAS_128K = %01000000
|
|
|
|
IS_IIGS = %00100000 ; /!\ do not use this to gate SHR, use SUPPORTS_SHR instead
|
|
|
|
HAS_VIDHD = %00010000
|
|
|
|
SUPPORTS_SHR = %00110000
|
|
|
|
CHEATS_ENABLED = %00001000
|
2020-05-23 22:47:16 +00:00
|
|
|
|
2020-11-11 19:40:34 +00:00
|
|
|
; shared symbols for prelaunch and effects to call ProRWTS2 functions
|
2021-10-15 20:00:40 +00:00
|
|
|
iCurBlockLo = $D401 ; constant
|
|
|
|
iCurBlockHi = $D403 ; constant
|
2021-10-24 02:21:43 +00:00
|
|
|
launchpatch = $D662 ; glue.launch.a
|
2021-10-24 05:14:25 +00:00
|
|
|
iAddToPath = $FE8F ; Roger Rabbit, avoid, use Infiltrator 2 style instead
|
2021-10-24 02:21:43 +00:00
|
|
|
itraverse = $D959 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
|
2021-10-20 19:02:42 +00:00
|
|
|
ldrlo = $55 ; constant
|
2021-10-15 20:00:40 +00:00
|
|
|
ldrhi = $56 ; constant
|
|
|
|
namlo = $57 ; constant
|
|
|
|
namhi = $58 ; constant
|
2021-10-18 22:37:40 +00:00
|
|
|
ldrlo2 = $64 ; constant
|
|
|
|
ldrhi2 = $65 ; constant
|
2020-11-12 22:07:04 +00:00
|
|
|
|
|
|
|
_CONSTANTS_=*
|
|
|
|
}
|