2018-08-23 20:02:48 +00:00
|
|
|
;license:MIT
|
2019-06-20 01:50:48 +00:00
|
|
|
;(c) 2018-9 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
|
2019-09-10 02:48:54 +00:00
|
|
|
; D000..E4E9 - persistent data structures (gGlobalPrefsStore, gGamesListStore)
|
2019-06-27 14:55:07 +00:00
|
|
|
; ...end of data and start of code are approximate, in between is unused...
|
|
|
|
; ...if they ever overlap, things will go boom...
|
2019-09-10 04:04:16 +00:00
|
|
|
; E9C4..FFF9 - main program code
|
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
|
|
|
|
; D400..D5FF - ProRWTS code
|
|
|
|
; D600..D9FF - HGR font data
|
2019-09-10 02:48:54 +00:00
|
|
|
; DA00..DD5C - ProRWTS glue code
|
|
|
|
; DD5D..DEFF - unused
|
2019-06-27 14:55:07 +00:00
|
|
|
; DF00..DFFF - backup of stack (during gameplay and self-running demos)
|
2019-06-20 01:50:48 +00:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
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)
|
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
|
2019-06-27 14:55:07 +00:00
|
|
|
ROM_TEXT = $FB2F
|
|
|
|
ROM_MACHINEID =$FBB3
|
|
|
|
ROM_HOME = $FC58
|
|
|
|
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
|
|
|
|
2018-08-23 20:02:48 +00:00
|
|
|
; zero page
|
2018-08-26 19:33:32 +00:00
|
|
|
PARAM = $00 ; used by PARAMS_ON_STACK macro, so basically everywhere
|
|
|
|
PTR = $02
|
|
|
|
SRC = $04
|
|
|
|
DEST = $06
|
|
|
|
SAVE = $08
|
2018-12-23 16:13:47 +00:00
|
|
|
HTAB = $24
|
|
|
|
VTAB = $25
|
2019-06-27 14:55:07 +00:00
|
|
|
RNDSEED = $4E ; word
|
2019-06-23 18:40:07 +00:00
|
|
|
Timeout = $ED ; 3 bytes (used by SearchMode)
|
2019-06-27 13:51:17 +00:00
|
|
|
zpMachineStatus= $F0 ; bit 7 = 1 if machine has joystick
|
2018-08-29 19:27:30 +00:00
|
|
|
; bit 6 = 1 if machine has 128K
|
2019-01-13 23:55:40 +00:00
|
|
|
; bit 5 = 1 if machine has a VidHD card
|
|
|
|
; bit 4 = 1 if machine is a IIgs
|
2019-06-27 13:51:17 +00:00
|
|
|
; only used during init, then copied to MachineStatus in LC RAM
|
2019-08-27 17:55:54 +00:00
|
|
|
zpCharMask = $F1 ; only uesd during init, then clobbered
|
2018-08-31 04:31:54 +00:00
|
|
|
; $FE ; used by ParseGamesList
|
|
|
|
; $FF ; used by ParseGamesList
|
|
|
|
|
|
|
|
; main memory
|
2019-06-20 17:56:31 +00:00
|
|
|
gPathname = $1F00 ; used by SetPath/AddToPath
|
2018-08-31 04:31:54 +00:00
|
|
|
gKeyLen = $1F00 ; used by ParseGamesList
|
|
|
|
gKey = $1F01
|
|
|
|
gValLen = $1F80
|
|
|
|
gVal = $1F81
|
2019-01-15 00:06:58 +00:00
|
|
|
|
|
|
|
; actual constants
|
|
|
|
SUPPORTS_SHR = %00110000 ; AND mask for MachineStatus
|