RAM map

Describes the data in the WRAM area used by Donkey Kong Country 2 and Diddy’s Kong Quest.

Legend

Sizes are in bytes. A size of “-” means the size is not known.
Entries whose contents are “(unknown)” are areas known to be used but whose purpose is not known.
For flags and structures that take multiple values, the Contents column lists the meaning of each value or offset.

Low RAM ($7E:0000 - $7E:1FFF; 8192 bytes)

SDK2

AddressSizeContents
$001C2Current BGM
$001E2Stereo/mono switch
$00202Function pointer of the current NMI handler function
$0022-(unknown)
$00242Address of the game loop
$0026-(unknown)
$0028-(unknown)
$002A2Active frame counter
$002C2Global frame counter
$002E1Pseudo-random number
$002F3Pseudo-random number work area
$003230Scratch RAM
$005E2Currently selected sprite palette slot
$00602Kong 1P/2P color selection
0: 1P
3C: 2P
$0062-(unknown)
$00642Sprite currently being processed
$00662Address of the player control structure
$00682Sprite currently being processed (sub; mainly for child sprites)
$006A2Sprite in contact with the sprite currently being processed
$006C2Sprite being ridden. 0 if not riding anything
$006E2Control code of the Animal Buddy currently being ridden or transformed into
0190: Squitter
0194: Rattly
0198: Squawks
019C: Rambi
01A0: Enguarde
$00702Next available OAM mirror slot
$0072-(unknown)
$0074-(unknown)
$0076-(unknown)
$0078-(unknown)
$007A2Mode 7 vertical scaling (8.8 fixed-point)
$007C2Mode 7 horizontal scaling (8.8 fixed-point)
$007E2Mode 7 scaling/rotation matrix D (8.8 fixed-point)
$00802Mode 7 scaling/rotation matrix C (8.8 fixed-point)
$00822Mode 7 scaling/rotation matrix B (8.8 fixed-point)
$00842Mode 7 rotation angle
$00862Mode 7 scaling/rotation matrix A (8.8 fixed-point)
$00882Slope tolerance threshold
$008A-(unknown)
$008C-(unknown)
$008E-(unknown)
$0090-(unknown)
$00921Current action of the player character
$00942Index into the NMI table
$00962Index of the game logic
$00983Tilemap address (from the tilemap settings)
$009B1Bank address of the map chips
$009C3Terrain collision address (from the tilemap settings)
$009F1(unknown)
$00A02Number of collision definitions (from the tilemap settings)
$00A2-(unknown)
$00C83Address of the buffer for building text tilemaps
$00CE3Text read address
$00D32Current level number
$00D5432-bit frame counter (in-game time)
$00F12Index into the palette ring buffer (00-0F)
$00F32Parameter of the sprite currently being spawned
$00F52Placement X position of the sprite currently being spawned
$00F72Placement Y position of the sprite currently being spawned
$00F92Type of the sprite currently being spawned
$00FB2Serial number of the sprite currently being spawned
$00FD-(unknown)
$0100256Stack
$0200512Mirror of the OAM low table
$040032Mirror of the OAM high table
$050221P controller input (BYsS^v<>AXLR3210)
$050422P controller input
$050621P controller input (newly pressed)
$050822P controller input (newly pressed)
$050A21P controller input (released)
$050C22P controller input (released)
$050E2Active player controller input
$05102Active player controller input (newly pressed)
$05121Screen brightness (mirror of INIDISP)
$05131Screen fade speed
$05141Screen fade timer
$05152Level type (from the level settings)
$05172DMA control settings (from the ISD)
$05192HDMA control settings (from the ISD)
$051B2BGM number (from the ISD)
$051D2Entry settings (from the ISD)
$051F2Slope threshold setting (from the ISD)
$05212Flag allowing animals to be brought in (from the level settings)
$05232Tilemap ID (from the ISD)
$05252Submap ID (from the level settings)
$05272NMI control settings (from the ISD)
$05292Map control settings (from the ISD)
$052B2Level special effects (from the ISD)
$052D2Bonus level type (from the level settings)
$052F2(unknown)
$05312Address of the entrance table
$05332Entrance X position
$05352Entrance Y position
$05372PPU control settings (from the ISD)
$05392Tileset (from the ISD)
$053B2ID of the entrance actually used
$053D16Destination level table (2 bytes per element, up to 8 elements; from the level settings)
$054D1Camera angle (from the level settings)
$054E1Camera angle while riding an animal (from the level settings)
$054F1Camera control settings (from the level settings)
$05501Entrance type
$05512Address of the world map connection settings (from the level settings)
$055362Same as $0515-0552. A sub expansion area for temporarily loading other settings.
$05932Sprite memory address of the character currently being controlled
$05A72$0DE2: Diddy
$0E40: Dixie
$05F72Address of a palette that could not be transferred because there was no free sprite palette
$060D2Game mode
0: 1 Player
1: 2 Player Team
2: 2 Player Contest
$060F2ID of the currently active pad
0: 1P
1: 2P
$06172Language selection
$064A2(unknown)
$064C-(unknown)
$064E2Remaining message display time (F)
$06502Tile index resolved from the character code
$06522Number of menu items
$06542Currently selected menu item
$06582Size of the tilemap reserved by the menu text
$065A2Number of menu items - 2
$065E2(unknown)
$06602Paid flag mask
$06622Menu text VRAM transfer address
$06642Hint text VRAM transfer address
$06662Temporary variable for calculating the hint data address
$06722Paid flags of the current menu
$067F2Event handler
$06812Number of lines of text to display
$06832(unknown)
$06852Number of characters still writable on the line currently being written
$06892Facility currently in
0: Cranky’s Cabin
2: Funky’s Flights
4: Swanky’s Bonus Bonanza
6: Wrinkly’s Kong Kollege
8: Klubba’s Kiosk
$069B2World map camera X position
$069D2World map camera Y position
$06A12Message display control / world map control flags
0:
1: advanced to the next segment of the path
2: moving backward along the path
3: message scrolling
4:
5:
6: drawing the node name
7:
8: node name update requested
9: message transfer complete
10:
11:
12: message being displayed
13:
14:
15:
$06A32World map control flags (known ones only)
5: switching between the first and second half maps of Krazy Kremland
6: set by $B4:B2CE (related to path opening; meaning not confirmed)
15: set by $B4:BE61 and cleared by $B4:BEA0
$06A52(unknown)
$06A72(unknown)
$06A92Node to go to when returning to the overall map
$06AB2Current world map node ID
$06AD2Destination node while moving. 0 when stopped
$06AF2Address (bank $B4) of the current segment of the path data being traveled. +/-4 for each segment advanced. 0 when stopped
$06B12Current world map ID
$06B52Kong X position on the world map
$06B72Kong Y position on the world map
$06B92X direction of path movement (+1/-1)
$06BB2Y direction of path movement (+1/-1)
$06BD2Bresenham error of path movement
$06BF2Bresenham minor-axis increment of path movement
$06C12|dx| of the path segment
$06C32|dy| of the path segment
$06C52Number of remaining path segments
$06C72World map camera X lower limit
$06C92World map camera X upper limit
$06CB2World map camera Y lower limit
$06CD2World map camera Y upper limit
$06CF-(unknown)
$06D72Number of entries in the world map path-opening queue (pushed when a level is cleared, consumed by $B4:B12B)
$06D9-World map path-opening queue (4 bytes per element: destination level number, source level number). Capacity unconfirmed
$06DC1Scanline counter for the HDMA used by the text wipe (not used, since the feature itself is disabled)
$07871(unknown)
$07902OAM attributes applied to the Kong while moving along a path (priority taken from path data +$03-04)
$07922Number of the path most recently opened
$079C2Write-only dead variable. Bank $B4 writes code addresses (16 kinds) to it in 19 places, but no reader exists in any bank
$07A51Ones digit of money held
$07A61Tens digit of money held
$07A71Hundreds digit of money held
$07B02(unknown)
$08A42Character currently being controlled
0: Diddy
1: Dixie
$08A62Entrance ID
$08A82Number of the parent level
$08AA2Checkpoint passed flag
$08AC2Level number when the last checkpoint was passed
$08AE2Control code of the Animal Buddy obtained or transformed into when the last checkpoint was passed
0190: Squitter
0194: Rattly
0198: Squawks
019C: Rambi
01A0: Enguarde
$08CA2Current number of Banana Coins held
$08CC2Current number of Kremcoins held
$08CE2Current number of DK Coins held
$08D02Number of DK Coins needed to rise to the next rank in Video Game Heroes
$08D214Cranky’s Cabin paid flags (1 byte per world)
$08E07Wrinkly’s Kong Kollege paid flags (1 byte per world)
$08E79Funky’s Flights paid flags (1 byte per world)
$08F09Swanky’s Bonus Bonanza paid flags (1 byte per world)
$08F91Number of cleared levels in The Lost World
$08FA1Klubba’s Kiosk paid flags (1 bit per world)
$08FB1Kong Family visited flags
0: Cranky
1: Funky
2: Swanky
3: Wrinkly
4: Klubba
6: Video Game Heroes
$08FC1Flags related to map events
$08FD-(unknown)
$08FE2World map event work area
$09002World map to move to when leaving The Lost World
$09022KONG letter collected flags
0: K
1: O
2: N
3: G
4: Extra Life Balloon in K. Rool’s letter room collected
$09042Completion percentage
$09061(unknown)
$09078String indicating the result of the boot check
Pass: Rareware
Fail: A thief!
$090F2(unknown)
$0911-(unknown)
$091A1Invincibility palette selection
0: normal palette
80: invincibility palette
$091C1Selection of K. Rool’s gas shot effect
0: none
1: stop gas
2: slow gas
3: confusion gas
$09A324Player collision (3 entries)
0-1: left edge
2-3: top edge
4-5: right edge
6-7: bottom edge
$09BB24Collision of the standby character (3 entries)
$09D324Collision of general sprites (3 entries)
$09EB8Animal collision (1 entry)
$09F3-(unknown)
$09F52Result of the sprite collision check
$09F72Collision interpretation flags between sprites
$09F93Address of the sprite collision checker to use
$09FC2Next available platform sprite slot
$09FE40Platform sprite table (5 bytes x 8 entries)
0-2: address of the special handling routine for the platform sprite
3-4: instance address of the platform sprite
$0A262Left edge of the platform sprite currently stood on
$0A282Right edge of the platform sprite currently stood on
$0A2A2Last recorded X position of the standby Kong
$0A2C2Last recorded Y position of the standby Kong
$0A2E2Last recorded animation of the standby Kong
$0A302Last recorded X velocity of the standby Kong
$0A322Last recorded maximum X velocity of the standby Kong
$0A342Last recorded height above the ground of the standby Kong
$0A362Sprite execution stop flags
2: stop processing of everything except the Kongs
3: stop processing of the player character
4: stop processing of the standby character
7: stop all processing
$0A382Sprite execution stop timer
$0A3A-(unknown)
$0A3C-(unknown)
$0A3E-(unknown)
$0A40-(unknown)
$0A4264Instance address table of the sprite group management sprites (32 slots)
Nonzero slot IDs correspond to the IDs of groups that are currently instantiated
$0A822ID of the interaction type between the player and a sprite
$0A842Index of the sprite currently interacting
$0A868Interaction work area
$0A8E2Palette override (from the ISD)
$0A982Sprite instance tracked by the camera
$0AA22Horizontal screen number
$0AA4-(unknown)
$0AA62Vertical screen number
$0AB22Memory for calculating the checksum of the anti-piracy verification code
$0AD72Camera X position
$0B0432VRAM slot allocation table for sprites (32 slots)
Each entry holds the address of the sprite instance occupying that slot
$0B2464Ring buffer for palette transfers (16 entries)
0-2: source address
3: destination CGRAM address
$0B6416Addresses of the palettes transferred to each sprite palette (8 slots)
0: free slot
nonzero: in use
$0B7416Reference counter of each sprite palette (8 slots)
$0B842Address of the submap list (from the tilemap settings)
$0B862Tilemap flags (from the tilemap settings)
$0BA02Index of the rope sprite currently being held
$0BA42Slope threshold setting (from the ISD)
$0BA6384(unknown)
$0D26-(unknown)
$0D4A2Current water level rise speed
$0D4C2Current water level (subpixel)
$0D4E2Current water level
$0D502Target water level rise speed
$0D522Target water level change
$0D542Current elevator height
$0D562(unknown)
$0D582(unknown)
$0D5A2Instance address of the currently active Kackle
$0D5C2(unknown)
$0D5E2Instance address of the coaster being ridden
$0D6028 times the X distance between the two Kongs (for tagging underwater)
$0D6228 times the Y distance between the two Kongs (for tagging underwater)
$0D642Remaining time of the tag animation
$0D662X position of the player character during a tag
$0D682X position of the standby character during a tag
$0D6A2Y position of the player character during a tag
$0D6C2Y position of the standby character during a tag
$0D6E2(unknown)
$0D702ID of the PPU control setting currently being decoded
$0D722Relative X position of the Kong while riding an animal (base value)
$0D742Relative Y position of the Kong while riding an animal (base value)
$0D762Relative X position of the Kong while riding an animal (adjusted value)
$0D782Relative Y position of the Kong while riding an animal (adjusted value)
$0D7A2Instance address of the sprite currently being held
$0D7C2Relative X position of the sprite currently being held
$0D7E2Relative Y position of the sprite currently being held
$0D802(unknown)
$0D822Instance address of the hook currently being hung from
$0D8494Sprite state data (used only on the overall map; elsewhere various global variables are allocated here)
$0D842Control code
Outside the overall map, 0 must always be written here to make it explicit that this area is not a sprite instance.
$0DE294State data of sprite #0 (mainly Diddy)
$0E4094State data of sprite #1 (mainly Dixie)
$0E9E94State data of sprite #2
$0EFC94State data of sprite #3
$0F5A94State data of sprite #4
$0FB894State data of sprite #5
$101694State data of sprite #6
$107494State data of sprite #7
$10D294State data of sprite #8
$113094State data of sprite #9
$118E94State data of sprite #10
$11EC94State data of sprite #11
$124A94State data of sprite #12
$12A894State data of sprite #13
$130694State data of sprite #14
$136494State data of sprite #15
$13C294State data of sprite #16
$142094State data of sprite #17
$147E94State data of sprite #18
$14DC94State data of sprite #19
$153A94State data of sprite #20
$159894State data of sprite #21
$15F694State data of sprite #22
$165494State data of sprite #23
$16B238Diddy’s control variables
0: animation ID
2: copy of $983
4: copy of $981
6: flag holding the D-pad state during a roll
8: gravitational acceleration
A: terminal falling velocity
C:
E: roll X velocity
10: frame the most recent roll started
12: frame the most recent jump started
14:
16: invincibility time
18: copy of the input state when the Y button was pressed
1A:
1C:
1E:
20:
22: frame the B button was most recently pressed
24:
$16D838Dixie’s control variables
$16FE50OAM write order table for sprites
$17302Next available DMA slot for sprite graphics transfer
$1732128Sprite DMA settings buffer (16 entries)
0-1: DMA transfer size
2-3: VRAM address
4-6: DMA source address
7: end-of-table flag
$17B22Collision update code (from the tilemap settings)
$17B42Map chip address (from the tilemap settings)
$17B62VRAM transfer address of the terrain tilemap (from the tilemap settings)
$17BA2Camera X position
$17C02Camera Y position
$195A64Tilemap buffer for transferring the terrain tilemap (32 tiles)
Whether it is interpreted as a row or a column depends on the tilemap type
$199A8Tilemap building auxiliary area
$19A22Frame an attack web was last fired
$19A42Frame a platform web was last fired
$19A62Number of Squitter attack webs currently existing
$19A82Instance address of the most recently broken Invincibility Barrel
$19AA6Six communication ports that signal that a sustained sound effect is active (the corresponding port keeps being incremented while the sound effect continues)
0: Zinger
1: Flitter
2: wind
3:
4: invincibility
5: rolling barrel
$19B0-(unknown)
$19B46VRAM addresses of the graphics data for each of the 3 animation frames of the giant tire
Bit 15 is the VRAM uploaded flag (if 0, the transfer is performed again)
$19BA2Quota counter for “Destroy Them All!”. It always runs, even outside bonus levels, but it is not checked unless the corresponding timer sprite is placed.
$19BC-(unknown)
$19BE2Work memory for level special effects
- In coaster levels: wait time until the next firework is launched
- In windy levels: BG3 scroll speed
$19C02Work memory for level special effects
- In coaster levels: number of fireworks currently launched
- In windy levels: wind direction
$19C62X position where an object was put down or thrown
$19C82Y position where an object was put down or thrown
$19CA-(unknown)
$19CE2Address of the invincibility management sprite. Zero when not invincible.
$19D02Cutscene ID
$19D22Cutscene script execution address
$19D42Cutscene command timer
$19D62Matching data for the level exit command input
Incremented by 4 each time a correct command is entered, and reset to 0 if a mistake is made partway.
$19D82Save area for the banana counter during “Collect the Stars!” (binary-coded decimal)
$19DA1574Free area

DKC2

currently not available.

High RAM ($7E:2000 - $7E:7FFF; 24576 bytes)

SDK2

AddressSizeContents
$7E:2000256Lookup table for speeding up decompression (high nibble conversion table)
$7E:2100256Lookup table for speeding up decompression (low nibble conversion table)
$7E:22002048World map path entity array (in 4-byte units)
0-1: opened flag
2-3: address
$7E:2A002048World map path entity array (4 bytes x 108 = 432 bytes used)
0-1: opened flag (0/1)
2-3: address of the path data (bank $B4)
$7E:32002048World map node entity array (4 bytes x 120 = 480 bytes used)
0: state 0: not opened 1: opened 2/3: current Kong location (Diddy/Dixie in front)
1: icon type (value from the node table; in state 2/3 overwritten with $00/$02 = Diddy/Dixie)
2-3: address of the node data (bank $B4)
$7E:3A001024?(unknown)
$7E:3E003072Buffer for building text tilemaps
$7E:4A00384Buffer for building text tilemaps (sub)
$7E:5000869Buffer for saving the 1P game state (from $064A-0906)
$7E:5365869Buffer for saving the 2P game state (from $064A-0906)
$7E:56CA680Copy of the currently open save data (from SRAM)
$7E:597232Bit array of map icons. 2 bits per element.
$7E:599232Bit array of world map path opening status. 1 bit per element.
$7E:59B232Bit array of bonus level clear status. 1 bit per element, in level-number order from the low bit.
$7E:59D232Bit array of DK Coin collection status. 1 bit per element, in level-number order from the low bit.
$7E:59F232Bit array of level clear status. 1 bit per element, in level-number order from the low bit.
$7E:5A128192(unknown)
$7E:7E12512Sprite group configuration area (8 entries x 32 groups)

DKC2

AddressSizeContents
$7E:2000256Lookup table for speeding up decompression (high nibble conversion table)
$7E:2100256Lookup table for speeding up decompression (low nibble conversion table)
$7E:22002048World map path entity array (in 4-byte units)
0-1: opened flag
2-3: address
$7E:2A002048World map path entity array (4 bytes x 108 = 432 bytes used)
0-1: opened flag (0/1)
2-3: address of the path data (bank $B4)
$7E:32002048World map node entity array (4 bytes x 120 = 480 bytes used)
0: state 0: not opened 1: opened 2/3: current Kong location (Diddy/Dixie in front)
1: icon type (value from the node table; in state 2/3 overwritten with $00/$02 = Diddy/Dixie)
2-3: address of the node data (bank $B4)
$7E:3A001024?(unknown)
$7E:3E003072Buffer for building text tilemaps
$7E:4A00384Buffer for building text tilemaps (sub)
$7E:5000869Buffer for saving the 1P game state (from $064A-0906)
$7E:5365869Buffer for saving the 2P game state (from $064A-0906)
$7E:56CA680Copy of the currently open save data (from SRAM)
$7E:597232Bit array of map icons. 2 bits per element.
$7E:599232Bit array of world map path opening status. 1 bit per element.
$7E:59B232Bit array of bonus level clear status. 1 bit per element, in level-number order from the low bit.
$7E:59D232Bit array of DK Coin collection status. 1 bit per element, in level-number order from the low bit.
$7E:59F232Bit array of level clear status. 1 bit per element, in level-number order from the low bit.
$7E:5A128192(unknown)
$7E:7E12512Sprite group configuration area (8 entries x 32 groups)

Extended RAM ($7E:8000 - $7F:FFFF; 98304 bytes)

SDK2

AddressSizeContents
$7E:8012-(unknown)
$7E:8928512General palette staging area
$7E:8B28-(unknown)
$7E:8D28256Camera data expansion area (left edge)
$7E:8E28256Camera data expansion area (right edge)
$7E:8F28256Camera data expansion area (top edge)
$7E:9028256Camera data expansion area (bottom edge)
$7E:9128256Camera data expansion area
$7E:9228256Camera data expansion area
$7E:9328256Camera data expansion area
$7E:9428256Camera data expansion area
$7E:9528-(unknown)
$7F:0000-Decompression buffer for compressed data
$7F:960016Bubble sprite OAM table (8 slots)
$7F:961016Bubble sprite X position table
$7F:962016Bubble sprite Y position table
$7F:963016Bubble sprite X velocity table
$7F:964016Bubble sprite Y velocity table
$7F:96503752Work area for sprite palette inversion
$7F:A4F8-(unknown)
$7F:A53264Ring buffer of checkpoint X positions for the standby Kong to follow
$7F:A57264Ring buffer of checkpoint Y positions for the standby Kong to follow
$7F:A5B264Ring buffer of checkpoint passing directions for the standby Kong to follow (Kong facing)
$7F:A5F264Ring buffer of animations at checkpoint passing for the standby Kong to follow
$7F:A6323072Banana placement data expansion area (16-byte units, 192 entries)
0-1: X position
2-3: Y position
4-5: number of columns in the banana set
6-7: number of columns in the banana set x4 (if too small, the set is not displayed when partly off-screen)
8-9: banana display layer selection
10-11: address of the banana set
12-13:
14-15:
$7F:B2329216Banana set area
Sliced by column, and each column is represented as a bit array. Higher bits are bananas higher up in the set.

DKC2

AddressSizeContents
$7E:8012-(unknown)
$7E:8928512General palette staging area
$7E:8B28-(unknown)
$7E:8D28256Camera data expansion area (left edge)
$7E:8E28256Camera data expansion area (right edge)
$7E:8F28256Camera data expansion area (top edge)
$7E:9028256Camera data expansion area (bottom edge)
$7E:9128256Camera data expansion area
$7E:9228256Camera data expansion area
$7E:9328256Camera data expansion area
$7E:9428256Camera data expansion area
$7E:9528-(unknown)
$7F:0000-Decompression buffer for compressed data
$7F:960016Bubble sprite OAM table (8 slots)
$7F:961016Bubble sprite X position table
$7F:962016Bubble sprite Y position table
$7F:963016Bubble sprite X velocity table
$7F:964016Bubble sprite Y velocity table
$7F:96503752Work area for sprite palette inversion
$7F:A4F8-(unknown)
$7F:A53264Ring buffer of checkpoint X positions for the standby Kong to follow
$7F:A57264Ring buffer of checkpoint Y positions for the standby Kong to follow
$7F:A5B264Ring buffer of checkpoint passing directions for the standby Kong to follow (Kong facing)
$7F:A5F264Ring buffer of animations at checkpoint passing for the standby Kong to follow
$7F:A6323072Banana placement data expansion area (16-byte units, 192 entries)
0-1: X position
2-3: Y position
4-5: number of columns in the banana set
6-7: number of columns in the banana set x4 (if too small, the set is not displayed when partly off-screen)
8-9: banana display layer selection
10-11: address of the banana set
12-13:
14-15:
$7F:B2329216Banana set area
Sliced by column, and each column is represented as a bit array. Higher bits are bananas higher up in the set.