4sports/src/constants.a

238 lines
9.0 KiB
Plaintext
Raw Normal View History

2021-02-16 06:01:22 +00:00
;license:MIT
2022-08-23 02:04:55 +00:00
;(c) 2018-2022 by 4am
2021-02-16 06:01:22 +00:00
;
;------------------------------------------------------------------------------
; YE OLDE GRAND UNIFIED MEMORY MAP
;
; LC RAM BANK 1
2022-08-23 02:04:55 +00:00
; D000 - reserved
; D001..D06E - gGlobalPrefsStore
; ...unused...
; E000..E3FF - HGR font data
; ...unused...
; E730..FFEB - main program code
; FFEC..FFF9 - API functions and global constants available for main program
2021-02-16 06:01:22 +00:00
; code, prelaunchers, transition effects, &c.
2022-08-23 02:04:55 +00:00
; (LoadFileDirect, Wait/UnwaitForVBL, MockingboardStuff, MachineStatus)
2021-02-16 06:01:22 +00:00
; FFFA..FFFF - NMI, reset, IRQ vectors
;
; LC RAM BANK 2
2022-08-23 02:04:55 +00:00
; D000..D5FF - ProRWTS data
; D600..D8BD - ProRWTS code
; D8BE..DC76 - ProRWTS glue code
; DC77..DC7C - backup of stack (during gameplay and self-running demos)
; DC7D..DC82 - okvs cache (attract state saved across self-running demo)
2021-02-16 06:01:22 +00:00
; ...unused...
2022-08-23 02:04:55 +00:00
; DFB4..DFFF - (de)acceleration function
;
; MAIN MEMORY DURING SEARCH/BROWSE MODE
; 6000..9FFF - search index
; A000..BCFF - search cache
; BD00..BEFF - prefs buffer (used to write PREFS.CONF if cheat mode changes)
; BF00..BFFF - ProRWTS glue (supports LoadIndexedFile)
;
; MAIN MEMORY DURING MEGA-ATTRACT MODE
; 0100..0105 - re-entry code for demos (reloaded before demo)
; 0106..01BF - prelaunch code (reloaded before demo)
; 0400..07FF - text screen (cleared before each module)
; 0800..1EFF - slideshow configuration file (persistent during slideshow module)
; 2000..5FFF - hi-res screens (cleared before each module)
; 4000..5FFF - slideshow index file (loaded before slideshow module)
; 6000.. - mega-attract configuration file (reloaded before each module)
; BD00..BEFF - prefs buffer (clobbered if cheat mode changes)
; BF00..BFFF - ProRWTS glue (reset after demo)
;
; MAIN MEMORY DURING MINI-ATTRACT MODE
; 0100..0105 - re-entry code for demos (reloaded before demo)
; 0106..01BF - prelaunch code (reloaded before demo)
; 0400..07FF - text screen (cleared before each module)
; 0800..1FFF - mini-attract index file (loaded once)
; 2000..5FFF - hi-res screens
; 6000.. - mini-attract configuration file (reloaded before each module)
; 6000.. - transition effect code (reloaded before each screenshot module)
; BF00..BFFF - ProRWTS glue (reset after demo)
;
; MAIN MEMORY DURING GAME LAUNCH
; 0100..0105 - re-entry code
; 0106..01BF - prelaunch code
; 0400..7FFF - text screen cleared
; 2000..5FFF - hi-res screens cleared
; A000.. - prelaunch index file
;
; MAIN MEMORY DURING CREDITS (preserves search index and cache)
; 0800.. - credits text
;
; MAIN MEMORY DURING GLOBAL HELP (preserves search index and cache)
; 0800.. - help text
;
; MAIN MEMORY DURING PER-GAME HELP (clobbers search cache)
; 0800.. - help text
; A000.. - game help index file
;
2021-02-16 06:01:22 +00:00
;------------------------------------------------------------------------------
!ifndef _CONSTANTS_ {
; 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
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
SLOT3STATUS = $C017 ; bit 7 only
2022-12-19 16:16:08 +00:00
MONOCOLOR = $C021 ; IIgs bit 7 switches composite mono/color modes
2022-08-23 02:04:55 +00:00
TBCOLOR = $C022 ; IIgs text foreground and background colors (also VidHD but write-only)
2021-02-16 06:01:22 +00:00
NEWVIDEO = $C029 ; IIgs graphics modes (also VidHD)
SPEAKER = $C030 ; chirp chirp
2022-08-23 02:04:55 +00:00
CLOCKCTL = $C034 ; bits 0-3 are IIgs border color (also VidHD but write-only)
SHADOW = $C035 ; IIgs auxmem-to-bank-E1 shadowing (also VidHD but write-only)
2021-02-16 06:01:22 +00:00
TEXTMODE = $C051
PAGE1 = $C054 ; page 1 (affects text, HGR, DHGR)
PAGE2 = $C055 ; page 2 (affects text, HGR, DHGR)
DHIRESON = $C05E ; double hi-res on switch
DHIRESOFF = $C05F ; double hi-res off switch
; 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)
ROM_TEXT2COPY =$F962 ; turn on alternate display mode on IIgs
ROM_REBOOT = $FAA6
ROM_TEXT = $FB2F
ROM_MACHINEID =$FBB3
2022-08-23 02:04:55 +00:00
ROM_MACHINE2C =$FBC0
2021-02-16 06:01:22 +00:00
ROM_HOME = $FC58
2022-12-19 16:16:08 +00:00
ROM_WAIT = $FCA8
2021-02-16 06:01:22 +00:00
ROM_COUT = $FDED
ROM_NORMAL = $FE84 ; NORMAL text (instead of INVERSE or FLASH)
ROM_IN0 = $FE89 ; SETKBD
ROM_PR0 = $FE93 ; SETVID
; 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
zpCharMask = $F1 ; only used during init, then clobbered
; zero page
PARAM = $00 ; word (used by PARAMS_ON_STACK macro, so basically everywhere)
PTR = $02 ; word
SRC = $04 ; word
DEST = $06 ; word
SAVE = $08 ; word
WINDEX = $0A ; word
WCOUNT = $0C ; word
HTAB = $24 ; byte
VTAB = $25 ; byte
RNDSEED = $4E ; word
; textrank
BestMatchIndex = $E5 ; word
tmpx = $E7 ; byte
remainder = $E8 ; word
num1 = $EA ; word
num2 = $EC ; byte
Timeout = $ED ; 3 bytes (used by SearchMode)
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
; main memory
2022-08-23 02:04:55 +00:00
gStackSize = 6 ; seems like only six are needed
2021-02-16 06:01:22 +00:00
gPathname = $BFD0 ; used by SetPath/AddToPath
2022-08-23 02:04:55 +00:00
gKeyLen = $1F00
2021-02-16 06:01:22 +00:00
gKey = $1F01
UILine1 = $1FB0
UILine2 = $1FD8
UI_ToPlay = $1FF7
gValLen = $1F80
gVal = $1F81
2022-08-23 02:04:55 +00:00
gSearchIndex = $6000
gSearchCache = $A000
; LC RAM 1 & 2
2022-10-13 03:43:44 +00:00
iLoadXSingle = $FFE9
2022-08-23 02:04:55 +00:00
iAddToPath = $FFEC
iLoadFileDirect = $FFEF ; note: you really want LC RAM 2 banked in before calling this
2021-02-16 06:01:22 +00:00
WaitForVBL = $FFF2
UnwaitForVBL = $FFF5
2022-08-23 02:04:55 +00:00
MockingboardStuff = $FFF8 ; bit 7 = 1 if SC-01 speech chip present (Speech I)
; bit 6 = 1 if SSI-263 speech chip present (Mockingboard "B"-"D")
; bit 5 = 1 if two AY-3-8910s present (Sound II / Mockingboard "A"-"D")
; bit 5 = 0 if only AY-3-8910 present (Sound I)
; bit 4 unused
2021-02-16 06:01:22 +00:00
; bits 0-3: slot number
MachineStatus = $FFF9
; LC RAM 2
2022-08-23 02:04:55 +00:00
DisableAccelerator = $DFB4
2021-02-16 06:01:22 +00:00
EnableAccelerator = DisableAccelerator+3
; AND masks for MockingboardStuff
MOCKINGBOARD_SLOT = %00001111
2022-08-23 02:04:55 +00:00
HAS_SPEECH = %11000000
2023-09-08 19:23:42 +00:00
MOCKINGBOARD_NEW = %00100000
2021-02-16 06:01:22 +00:00
2022-08-23 02:04:55 +00:00
; AND masks for game info bitfield (after game display name in gSearchStore)
2021-02-16 06:01:22 +00:00
HAS_DHGR_TITLE = %10000000 ; this one is hard-coded via BMI instead of AND/BNE
2022-10-13 03:43:44 +00:00
IS_SINGLE_LOAD = %01000000
2021-02-16 06:01:22 +00:00
CHEAT_CATEGORY = %00001111
2022-10-13 03:43:44 +00:00
; ^^
; ++-- your bits here!
2021-02-16 06:01:22 +00:00
; AND masks for MachineStatus
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
2022-08-23 02:04:55 +00:00
; AND masks for gMegaAttractModeFilter
ATTRACT_DEMO = %00000001
ATTRACT_HGR_TITLE = %00000010
ATTRACT_HGR_ACTION = %00000100
ATTRACT_DHGR_TITLE = %00001000
ATTRACT_DHGR_ACTION = %00010000
ATTRACT_SHR = %00100000
ATTRACT_GR = %01000000
ATTRACT_DGR = %10000000
PRELAUNCH_STANDARD_SIZE = 61 ; LoadStandardPrelaunch, eventually to be determined at build-time
2021-02-16 06:01:22 +00:00
; shared symbols for prelaunch and effects to call ProRWTS2 functions
2022-08-23 02:04:55 +00:00
iCurBlockLo = $D601 ; constant
iCurBlockHi = $D603 ; constant
launchpatch = $D85C ; glue.launch.a
itraverse = $DB4B ; Roger Rabbit, avoid, use Infiltrator 2 style instead
; also Columns (via file in disk image)
ldrlo = $55 ; constant
2022-06-01 04:33:53 +00:00
ldrhi = $56 ; constant
namlo = $57 ; constant
namhi = $58 ; constant
2022-08-23 02:04:55 +00:00
ldrlo2 = $64 ; constant
ldrhi2 = $65 ; constant
; Columns and Dangerous Dave also call (de)accelerator functions directly
2021-02-16 06:01:22 +00:00
_CONSTANTS_=*
}