;license:MIT ;(c) 2018-9 by 4am ; ;------------------------------------------------------------------------------ ; YE OLDE GRAND UNIFIED MEMORY MAP ; ; LC RAM BANK 1 ; D000..E180 - persistent data structures (gGlobalPrefsStore, gGamesListStore) ; ...end of data and start of code are approximate, in between is unused... ; ...if they ever overlap, things will go boom... ; E900..FFFB - main program code ; FFFC..FFFF - reset and other vectors ; ; LC RAM BANK 2 ; D000..D3FF - ProRWTS data ; D400..D5FF - ProRWTS code ; D600..D9FF - HGR font data ; DA00..DEFF - unused ; DF00..DFFF - backup of stack (during gameplay and self-running demos) ;------------------------------------------------------------------------------ ; 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 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 NEWVIDEO = $C029 ; IIgs graphics modes SPEAKER = $C030 ; chirp chirp SHADOW = $C035 ; IIgs auxmem-to-bank-E1 shadowing 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_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 ; zero page PARAM = $00 ; used by PARAMS_ON_STACK macro, so basically everywhere PTR = $02 SRC = $04 DEST = $06 SAVE = $08 HTAB = $24 VTAB = $25 RNDSEED = $4E ; word Timeout = $ED ; 3 bytes (used by SearchMode) 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 ; $FE ; used by ParseGamesList ; $FF ; used by ParseGamesList ; main memory gPathname = $1F00 ; used by SetPath/AddToPath gKeyLen = $1F00 ; used by ParseGamesList gKey = $1F01 gValLen = $1F80 gVal = $1F81 ; actual constants SUPPORTS_SHR = %00110000 ; AND mask for MachineStatus