Madness and the Minotaur RAM Use

Init clears 00-66 inclusive. The area is in BASIC's memory usage. The code uses some of BASIC's routines, but this first area of memory is for the BASIC interpreter. The code can overwrite this area without interfering with the BASIC calls it uses.

Game Variables

AddressNameDescription
00curRoomcurrent room
01lastRoomlast room
02dirBitsdirection command bit pattern
03inpLenlength of user input
04weightweight of pack
05conditionphysical condition
06bulkbulk of pack
07nounObjNumdecoded object number from noun
08fallOddsAccumulated odds of falling (0, 1/8, 2/8, 3/8 ... with each step in the dark)
09stingCountScorpion sting (0=not, not-zero=number of times)
0AlampOn0 if lamp is off, not 0 is on
0BspacesOnEndCount of spaces at the end of the row in print routine
0CdownFailSet by BetweenRoomACDE if a climb-down failed ... abort the movement
0DpushedBackpushed back flag (nobody reads this)
0EhydraStatusHydraStatus: AA = tied up, 1 = dead, 0 = free
0FhydraPushedHydraPushedUsBack (must be set to TIE HYDRA) 0 = not, 1 = hydra blocked last move (cleared every direction command)
10rocksMoved1 if "pile of rocks" has been moved to us
11rocksExposed1 if "pile of rocks" has been exposed with OKKAN
12drapesOpen1 if south passage in room 9 is open. 0 if closed. (open with drapes)
13auraTimerCount down timer until we can walk through aura and heal again (10 seconds each time)
14lampStripped1 if lamp has been blown from pack by entering room routine or failed jump
15treas0BReleased1 if treasure "$0B" has been released
16NEVER USED
17randPassRandom number for passage-description printing
18:19randPointRolling pointer to BASIC rom for random numbers
1AnumAdviceGivenNumber of times advice has been given 0-13

Oracle advice table. Object number is stored here. Upper bit set if advice has already been given for this protected object.

1B Oracle advice object 0
1COracle advice object 1
1DOracle advice object 2
1EOracle advice object 3
1FOracle advice object 4
20Oracle advice object 5
21Oracle advice object 6
22Oracle advice object 7
23Oracle advice object 8
24Oracle advice object 9
25Oracle advice object 10
26Oracle advice object 11
27Oracle advice object 12

28 scoreCalculated score
29NEVER USED
2AverbNumVerb command number
2BnounNumNoun word number
2CratObjectTrigger object to make packrat drop treasure
2DNEVER USED
2EholderACDEHolder value for BetweenRoomACDE
2FtemporaryGeneral use lots of places
30Used in InPack
31Used in InPack
32enteredFogSet by EnteringRoomAction_q (MYSTERIOUS FOG)
33hydraRoomCurrent room of HYDRA
34ishtarUsesNumber of times more ISHTAR can be used. Random init to 1-4.
35smallPitRoomRoom for small pit in corner of room
36ledgeRoomRoom of LEDGE
37rocksRoomRoom of "pile of rocks" (OKKAN spell)
38:39lampOilOil level of lamp (0 is empty)
3AlampFillsNumber of times lamp can be filled (init to $34 + 4)
3B:3CPointer to start of input on screen
3DUsed in Random-between-0-and-B
3EdrinkTimerTime until we can drink from bottle to heal again (16 seconds)
3FticksTillSecInterrupt divisor count (60 ticks till one seconds)
40secsTillMinInterrupt divisor count (60 ticks till one minute)
41minotaurTimerMinotaur state timer
42trogTimerTroglodyte state timer
43satyrTimerSatyr state timer
44scorpTimerScorpion state timer
45fogClockFog clock runs in room MYSTERIOUS FOG. At 6 seconds we get warned. At 10 we die.
46akhiromMinsMinutes of immunity left (AKHIROM gives 3 minutes)
47enterRcountCount of times entering room with EnteringRoomAction_r. 3 times and treasure drops.
48NEVER USED
49NEVER USED
4A:4BsecondsContinual second counter (nobody uses it)
4C:4DsecsInRoomCounts the time in a room. Once 15, no going BACK
4ENEVER USED
4FNEVER USED
50NEVER USED
51Used in Oracle advice
52Used in killing Hydra
53Used in sound effects
54:55Used in tape-write
56:6516 byte buffer for decode and auto-word wrap
66NEVER USED

This area of BASIC's memory includes tape and cursor information that the ROM calls use.

67:87 BASIC vars
88:89scrCursorScreen cursor
8A:8BzeroWordBASIC always 0

8C:F3 BASIC vars

Blocked Rooms

Shifting buffer of rooms blocked by Shaking Ground. As new rooms are blocked at random, they go on the end of the list. Rooms are pulled off of the front of the list and unblocked completely. This keeps lots of shaking from blocking up the floors over time.

F3:FF Blocked rooms (in BASIC's "unused variables" section)

Random Number Seeds

0186:018D Random-number bytes (in BASIC's extension vectors)

Stack

01FF Stack builds towards 0 (in BASIC's cassette file data buffer)

Screen Memory

0200:03FF Screen 0 (in some buffers used by BASIC)
0400:05FFScreen 1

Game code

0300:3EB7 Game loads from tape

Blocked Passages

3EB8:3FB7 Block passage table

Protected Objects Lists

3FB8:3FFF Protected object lists