インスマウスの館 WRAM map

All addresses are in hexadecimal.

AddressC definitionDescription
298Related to Random, also incremented on every VIP interrupt (halfword)
2A8Related to Random (word)
2ACLast read controller status (halfword)
2AERelated to controller; accessed by function 84D2
2B0Related to controller; accessed by function 84D2
2B2Related to controller; accessed by function 84D2
2B4Related to controller; accessed by function 84D2
2B6Related to controller; accessed by function 84D2
2B8Related to controller; accessed by function 84D2
2BCAccessed at interrupts, related to OAM?
292Related to intermission? (halfword)
294s16 gGameStateGlobal game state; see main function
296Set to 0 by function 1218A
29ARelated to VIP? Accessed by function 8EBE (halfword)
23D85600-byte space zeroed at credits roll
2448112-byte space zeroed by code at 118C8
39B8gAutoPauseTimerTime until next automatic pause (in frames times 2?)
39BCgAutoPauseOnAutomatic pause setting
39C0char gPassword[4]Password of last finished level; set to four spaces in main
39C40 if the player deserves to get ending A (halfword)
39C8tyMonster gMonster[6]Monsters; see below
3CF0s16 gAmmoAmmo
3CF2s16 gStockStock
3CF4s16 gHealthHealth
3CF6Password index of starting level; set at 19C82 and in main function but never read? (halfword)
3CF8s16 gCurPasswordIndexPassword index of current level
3CFAs8 gPlayerX, s8 gPlayerYPlayer coordinates (halfword - lower 8 bits X, upper 8 bits Y)
3CFCDuplicate of player coordinates (investigation needed)
3CFEs16 gPlayerDirectionPlayer direction (1 up, 2 down, 3 right, 4 left)
3D00Array of 32 halfwords; accessed by functions 12EE8, 12F7C, A15A
3D40Array of pairs of halfwords; see 12214
466Cs16 gLayout[24][24]The current layout; see below
4AF6Incremented by function 12EE8, set to 0 by function 12F7C, accessed by function 17526 (halfword)
4AFCDynamically generated BGMap for automap?
6AFCs16 gKeyNonzero if player has key
6AFEs16 gWhiteOrbNonzero if player has white orb
6B00s16 gBlackOrbNonzero if player has black orb
6B02Set to 0 at start of gameplay
6B04Accessed on VIP interrupts
6B0ARelated to time? (set to 0 by function 121E2)
6B0CRelated to time? (set to 0 by function 121E2)
6B0EAccessed on VIP interrupts
6B10Accessed on VIP interrupts
6B14u32 gFrameTimerVideo frames before timer goes off (times 2? see CalcLevelFrames)
6B18gSecondTimerSeconds until end of level
6B1Cs16* gVIPRegsAlways points to 0x5F800
6B20Accessed by function 17526 (halfword)
6B40s16 gIntermissionDots[45]State of dots on intermission map (45 halfwords)

Structures

Monsters

Note: names of unknown fields end with their hexadecimal offsets.

The whole structure is 56 bytes long.


typedef struct
{
  s16 h0;  // Affects visibility (but not existence) of monster
  s16 Small;  // Nonzero if small
  s16 Bright;  // Nonzero if bright
  s16 h6;  // Initialized to -1 at start of level
  s16 h8;  // Checked by function 11D22, ORed with 1 by function F3C4
  s16 hA;  // Initialized to -1 at start of level
  s16 hC;  // Explicitly initialized to 0 at start of level (after ZeroMem call)
  s16 hE;  // Changes _very_ often
  s16 h10;  // Direction? (initialized to second byte of tyROMMonster)
  s16 h12;
  s16 h14;  // Set to -1 _very_ often
  s16 X;  // X coordinate shifted left by 16 bits
  s16 Y;  // Y coordinate shifted left by 16 bits
  s16 Health;
  s16 h1A;  // Starting health used for respawning?
  s16 h1E;  // Gets changed at F39E
  s16 h20;  // A counter of some sort
  s16 h22;
  s16 AttackTimer;  // When this is 0, the monster attacks if next to player
  s16 h26;
  u8 Unknown[16];  // Datatypes of other fields are not known
} tyMonster;

The layout

Each tile is a halfword. Bit values:

Bit numberBit valueMeaning
0 to 2Same as in ROM
30x0008Contains a heart
40x0010Contains ammo
50x0020Contains a white orb
60x0040Contains a black orb
70x0080Contains a key
8 to 13Unused?
140x4000Tile was visited by player
150x8000Contains a lamp

First published on .
Last updated on .

Table of contents

Contact me