If you are still using the old URL (datacrystal.romhacking.net), please update your bookmarks! The old URL may stop working at any time.
The current URL is datacrystal.tcrf.net.
The current URL is datacrystal.tcrf.net.
Super C (NES)/RAM map
Jump to navigation
Jump to search
The following article is a RAM map for Super C (NES).
Address Size Description
------- ---- -----------
$10 1 Specifies the current enemy slot index that is being executed
$18 1 Which part of the game routine to execute
* #$00 - intro screen
* #$01 - demo
* #$02 - player mode selected, initialize level 1
* #$03 - set level_routine_00, advance routine
* #$04 - play the level
* #$05 - hidden sound menu
$19 1 Introduction screen state
* #$01 - scrolling or in demo
* #$02 - showing player select
* #$03 - made intro player selection
$1b 1 The frame counter. It loops from #$00 to #$ff incrementing
once per frame. Identical in function to $5b, except $1b
continues to count when the game is paused. $5b does not
$1c 1 Tracks if NMI occurred during game loop. It is set to #$01 at
the start of NMI and #$00 at end of game logic. If during next
NMI $1c is still #$01, then the game knows there was lag and
the previous frame didn't execute fully. Bit 7 is used as a
check if NMI was interrupted when setting sound variables
$1d 1 Used to ensure the PPU is ready. It is set to #$00 when at
least 5 executions of NMI have happened since last time the PPU
was configured
$1e 1 The write offset into the CPU memory buffer for graphics
updates into the PPU.
$1f 1 Whether or not in demo
* #$00 = not in demo
* #$01 = in demo
$20 1 1 less than number of players playing, see $22
* #$00 - 1 player game
* #$01 - 2 player game
$21 1 Used to keep track of player index when calculating player
score, and foreground collisions
$22 1 1 less than number of players playing, see $20
* #$00 - 1 player game
* #$01 - 2 player game
$23 1 Random number used for game logic randomness
$24 1 OAM DMA CPU buffer offset
$25 1 Sometimes the last MMC3 bank select command is saved to this
address. It is used after a scanline interrupt to set the
command with the CPU.
$26 1 Nametable mirroring mode
* #$00 - vertical mirroring
A B
A B
* #$01 - horizontal mirroring
A A
B B
$27 1 Which set of routines to run during a scanline interrupt. It
indexes into irq_handler_ptr_tbl
$28 1 Th specific irq handler routine offset. It indexes into
irq_handler_xx_ptr_tbl
$29 2 The two byte address to the specific interrupt handler, for
example irq_handler_xx_yy
$2b 1 Whether or not to set the IRQ to the noop IRQ routine during NMI
$2c 1 On the game over screen, whether "CONTINUE" or "END" is
selected
* #$00 - "CONTINUE" is selected
* #$01 - "END" is selected
$2d 2 An address to the pointer table containing routines used during
an scanline interrupt. It points to specific
irq_handler_xx_ptr_tbl table
$2f 1 Whether or not to enable override of supertile palette colors.
It is enabled when a door (enemy type #$0d) has been destroyed.
This enemy determines whether or not overwrite_attribute_byte
is called as part of palette loading.
The door appears on level 2 and level 6, but this only affects
level 2
$30 2 Pointer to the level-specific level_x_screen_layout_tbl.
That table stores the structure of the level in terms of how
the nametable screens are laid out horizontally and vertically.
Then after the width and height bytes, each entry represents a
screen and is a pointer to level_x_supertiles_screen_xx, which
specifies the supretiles for the screen
$32 2 2-byte address containing which supertiles to use for each
screen of the level (level_x_supertiles_screen_ptr_table)
$34 2 2-byte pointer to supertile data, which defines pattern table
tiles of the supertiles that are used to make level blocks
see level_x_supertile_data
$36 2 2-byte pointer address to the palettes used for each supertile,
each byte describes the 4 palettes for a single supertile
see level_x_palette_data
$38 1 The index into the specific level routine to run. Indexes into
level_routine_ptr_tbl
$39 1 Whether or not the game is paused
* #$00 - not paused
* #$01 - paused
$3a 1 Unused. Only ever read, never written to so always #$00. Read
as part of pause routine to see if should pause.
$3b 1 Whether or not demo (attract mode) for the level is complete
and new demo level should play
$3c 2 2-byte delay timer used in the intro screens for timing
$3e 1 A generic variable for use within a level routine, e.g.
level_routine_02
$3f 1 A delay value used in some level routines, namely
level_routine_01, level_routine_04, and level_routine_06
$40 1 End of level routine index, used for end of level logic
$41 2 Used during attract (demo) to determing how many even-numbered
frames to continue pressing the controller input button that is
specified in $4c
$43 2 When in demo, stores the offset into specific
demo_input_lvl_xx_px table
$45 1 The scanline where the 1st irq interrupt triggers. The
scanline starts at 0 at the top and goes to #$ff at the bottom.
#$ff means no scanline irq
$46 1 The number of scanlines after the value in $45 to run a 2nd
scanline irq. #$ff means no 2nd scanline irq
$47 1 The number of scanlines after the value in $46 to run a 3rd
scanline irq. #$ff means no 3rd scanline irq
$48 1 The actual scanline number where the 2nd irq occurs. #$ff
means no 2nd scanline irq
$49 1 The actual scanline number where the 3rd irq occurs. #$ff
means no 3rd scanline irq
$4a 2 PPU address to set during a scanline interrupt. Used only by
some scanline interrupt handlers. The value is copied into
$07fb for use by the interrupt handler
$4c 2 The controller input pressed during a demo. One byte for each
player
$4e 1 The number of frames since beginning of demo for level. Used
to delay #$e0 frames before firing
$50 1 Used in 3 different situations
1. The current level, i.e. #$00-#$07. It is set to #$08 after
defeating final boss, then reset to #$00 before credits.
2. The current routine used when initializing the sound menu
UI
3. 10 extra lives cheat check during intro
$51 1 Whether or not the game has previously been completed
* 0 - not previously completed
* 1 - previously completed
$52 1 A value to adjust game difficulty. Values are #$00, #$01, or
#$02. It is based on number of players who have the S weapon
* adjusts ENEMY_HP
* adjusts how quickly enemies are generated by subtracting
#$04 times this value from the initial generation
delay
$53 1 Used in 2 different situations
1. The player number of lives, #$00 is last life
* on game over stays #$00, but $ca becomes #$01
* the maximum number of lives that can be properly
displayed in level screen ("REST") is #$63 (99 in
decimal)
can be thought of as the number of medals shown in the
player HUD
2. in the sound menu, used to keep track of selected sound to
play
$54 1 Used in 2 different situations
1. player 2 number of lives, #$00 is last life
2. hidden sound menu scroll value
$55 2 A binary-coded decimal value of the 10,000s and 1,000s place of
the score to achieve to get an extra life. For example, 42
would be xx42xx0. $55 is for player 2
$57 2 A binary-coded decimal value of the 1,000,000s and 100,000s
place of the score to achieve to get an extra life. For
example, 42 would be 42xxxx0. $58 is for player 2
$59 1 Used in 2 different situations
1. The number of continues available until game restarts from
beginning
2. A hidden sound menu flag indicating that the MEDOLEY
(medley) is playing from the sound menu
$5a 1 A duration timer for playing sound medley in hidden sound menu
$5b 1 The frame counter. It loops from #$00 to #$ff increments once
per frame. It is identical to $1b, except $5b stops counting
when the game is paused
$5c 1 2 bits of byte are used as boss is defeated
* bit 7 is set when level boss is removed
* bit 6 is set when playing end of level tune
(sound_33/sound_34)
* bit 0 is set when boss is defeated
$5d 1 Set when the level is an overhead level (Level 2 and Level 6)
* #$00 side view
* #$01 overhead view
$5e 2 Unused flag only written to in hidden sound menu
$60 1 The index into the horizontal draw routine
x_supertile_draw_routine_tbl table
* #$00 - do nothing
* #$01 - advance to #$02
* #$02 - start new column of supertiles
* #$03 - draw more supertiles to current column
$61 1 Used in 2 different situations
1. The screen scroll type, e.g. level 1 is horizontal scroll
* #$00 - horizontal (level 1, 3, 4, and 8)
* #$01 - vertical or overhead (level 2, 5, 6, 7)
* #$01 - various boss screens (helicopter, robot spider,
fortress wall, crypto-crustacean boss)
* #$02 - final level mid level change
* #$02 - tank boss, chandelier boss, jagger froid, final
boss
2. Used during the end game credits to control which logic for
scrolling credits (see scroll_credits_routine_ptr_tbl)
$62 1 How many pixels to scroll the screen in the current frame
horizontally. It is usually based on player velocity, but is
set during auto-scroll moments. Note that this is not the
scroll distance within the screen
$63 1 The number of horizontal nametable screens scrolled for level.
Starts at 0
$64 1 Represents the current column offset into the current nametable
when writing nametable data to the graphics buffer.
$65 1 The screen number of the current level currently drawing (how
many screens into the level). Starts at 1
$66 2 2-byte PPU address used when drawing supertiles based on scroll
$68 1 Used when drawing supertiles based on scroll
$69 1 Used when drawing supertiles based on scroll
$6a 1 The number of supertiles remaining to draw, starts at #$07 an
decrements down to #$00. This is one entire column of the
nametable. Unused and hard-coded to #$ff for level 2, but level
4 uses it
$6b 1 When $fd is greater than this number, the next column of
supertiles is drawn
$6c 1 The number of screens drawn for the level (0 indexed)
$6d 1 The supertile base offset to load. It increments up to #$40.
Set when scrolling horizontally.
$6e 1 The vertical draw screen. Set from - set from $74
$6f 1 The horizontal auto-scroll mode. There are 3 modes
* #$00 (mode 0): no auto-scroll (disabled)
* #$01 (mode 1): scroll horizontally to the right until PPU
is scrolled to show the next nametable, which means
revealed entire screen to right, e.g. level 4 when
revealing the base of elevator
* #$02 (mode 2): scroll horizontally while any player on
rightmost 37.5% of screen (side-levels only). For example,
this is used in level 1, 4, and 5 for the ending animation
$70 1 Used in 2 different situations
1. The y_scroll_draw_routine routine index
2. For the ending credits, used to delay before advancing to
the next credits routine ($61)
$71 1 Used in 2 different situations
1. The initial value for level (see level_y_scroll_flags_tbl)
It can be changed like after falling from helicopter in
level 1
* bit 7
* 0 = can scroll up if ELEVATOR_ENABLED is disabled (0)
* 1 = cannot scroll up
* bit 6
* 0 = can scroll down if ELEVATOR_ENABLED is disabled (0)
* 1 = cannot scroll down
2. When showing end credits, used to keep track of next credit
line to draw
$72 1 How many pixels to scroll the screen this frame (vertically) in
the current frame based on player velocity. Can be negative.
Note that this is not the scroll distance within the screen.
Negative values scroll up, positive values scroll down.
$73 1 Used in 2 different situations
1. the nametable row number of the top of the visible screen
Used for drawing, compare to $fc, which stores PPU vertical
scroll. When it wraps, $74 is updated. On level 2, it
starts at #$00, after first scroll initialized to #$1c and
decrements by 2 as scroll up
2. The scroll value used during credits for the bottom of the
cloud
$74 1 Used in 2 different situations
1. The vertical screen index for the level, similar to y axis
on a 2-d cardinal plane similar to $82
2. The scroll value used during credits for the mountain
$75 1 Used to time horizontal scroll of the cloud tops in the end
credits
$76 1 The scroll value used to delay scroll of the bottom of the
clouds
$77 1 Used in 2 different situations
1. The vertical scrolling direction
* 0 when vertically scrolling up
* 1 when vertically scrolling down
2. Used to time horizontal scroll of the mountains in the end
credits
$78 1 Used when drawing supertiles based on horizontal scroll
$79 1 Index into level_x_screen_layout_tbl for vertical draw routines
$7a 1 A backup of the horizontal scroll ($fd), used by the stomping
ceiling in level 8
$7b 1 A backup of the vertial scroll ($fc), used by the stomping
ceiling in level 8
$7c 1 A backup of the PPUCTRL_SETTINGS, used by the stomping ceiling
$7d 1 Related to the level's vertical scroll flags ($71)
(see level_y_scroll_flags_tbl)
$7e 1 Whether or not the elevator autoscroll is enabled
* bit 7 - 1 = enabled, 0 = disabled/stopped
* Note: it seems there may have been logic for bit 6 and
bit 0. Bit 0 would have enabled a variable speed depending
on p1 and p2 game over and jump status. When this
functionality is enabled, the elevator goes way too fast
$7f 1 The elevator scroll fractional Y speed. Scrolls Y when elevator
enabled. Used with the elevator's fast Y velocity ($80) to set
the elevator vertical speed to -0.25
$80 1 Used for 2 different situations
1. The elevator scroll fast Y speed. Scrolls Y when elevator
enabled. Used with the elevator's fractional Y velocity ($7f)
to set the elevator speed to -0.25
2. For intro, used as an index into intro_animation_ptr_tbl
$81 1 Used for 2 different situations
1. The elevator fractional velocity accumulator
2. An intro animation delay timer
$82 1 Used for 2 different situations
1. The vertical screen index, similar to y axis on a 2-d
cardinal plane
changes as the nametable scroll wraps vertically
* level 1 - decrements from #$02 to #$00 as player climbs
the hills
* level 2 - starts at #$0c and decrements down as player
traverses up
* level 3 - stays at #$00 the entire time
* level 4 - starts at #$0c and decrements down as player
climbs up
* level 5 - starts at #$06 decrements to #$00 as you climb
the floating platforms then increments from #$00 to #$02
* level 6 starts at #$0c and decrements down (#$01 for
final screen)
* level 7 starts at #$0c and increments as player goes
down
* level 8 starts at #$03, decrements to #$00 as you move
through level upward, increments back to #$02 as you go
downward similar to LEVEL_Y_SCREEN
2. The intro screen intro_palette_tbl offset for animation
reveal of logo
$83 1 Used for 2 different situations
1. Stores PPU CTRL settings ($ff) for vertical scroll
(see y_scroll_draw_routine_01)
2. intro animation horizontal scroll value
$84 1 Vertical auto-scroll mode. Used in conjunction with $9c and $98
to auto-scroll to a position on a specific screen.
* #$00 (mode 0): vertical auto-scroll (up or down) until
checkpoint
* #$01 (mode 1): vertically auto-scroll up to checkpoint
while player(s) in top 37.5% of screen. As used in the
game, this is only for level 2 overhead ending animation.
$85 1 Used for 2 different situations
1. Intro animation PPUCTRL for use in flashing SUPER while
scrolling
2. Used to correctly animate the stomping ceiling on level 8
prevents pre-irq X scroll and nametable change to show
correct bg tiles
* #$00 - allow X scroll and allow moving to next
horizontal nametable
* #$01 - prevent scrolling into next nametable
* #$80 - prevent X scroll
$86 1 Controls whether or not to write the palette to the graphics
buffer, by allowing/preventing copying palette bytes from
palette CPU buffer ($03e0) to CPU graphics buffer ($0300)
* 0 - enable
* 1 - disable
$87 1 Controls whether do display HUD
* 0 - no hud
* 1 - display hud
$88 1 The number of screens high the level has. All levels are
defined as a rectangle of screens $89 * $88
$89 1 The number of horizontal screens the level has. All levels are
defined as a rectangle of screens $89 * $88
$8a 1 Used to determine when to generate level enemies based on
horizontal scroll ($fd)
$8b 1 Used to determine when to generate level enemies based on
vertical scroll ($fc)
$8c 1 Index into level-specific tile routine based on horizontal
location within level. Used to control when updating tiles
banks and palettes as well as any auto-scroll
$8d 1 Index into level-specific tile routine based on vertical
location within level. Used to control when updating tiles
banks and palettes as well as any auto-scroll
$8e 1 Used when calculating if an enemy is off screen vertically
* #$ff - scrolling up
* #$00 - not scrolling (or scrolling down)
$8f 1 Whether or not a background collision with an incline is
counted as a collision. Set to #$00 on Level 5 (The Cliff) and
Level 8 (The Final Stage). When disabled, bullets pass through
inclines and players can jump up through inclines.
* #$00 - skip bullet background collision check for inclines
* #$01 - test bullet background collisions with inclines,
e.g. bullets stop when collide with incline
$90 1 The number of randomly generated enemies for the current
screen. If the player doesn't move to the next screen for a
while, eventually the game will start generating enemies even
when the player is close to the edge. Used to make it harder
for a player to stay in one screen and rack up points
$91 1 Used as a routine index for generating a random soldiers or
ladybugs. Index into enemy_gen_routine_ptr_tbl
$92 1 The amount of horizontal or vertical nametable screens scrolled
X screen ($63) or Y screen ($82) depending on level
$93 1 The delay timer for generating random soldiers or ladybugs
$94 1 Controls various aspects of random enemy generation
(see level_enemy_gen_ctrl_tbl)
* bit 7: 1 = overhead level, 0 = not overhead level
* bit 6: 1 = pause random enemy generation
* bit 1: 0 = create random overhead soldiers, 1 = create
random alien ladybugs
* bit 0: 1 = vertical scroll level (levels 2, 5, 6, and 7)
* vertical scrolling influences enemy generation timer on
odd frames
* when 1, control byte is controlled by X screen ($63)
* when 0, control byte is controlled by Y screen ($82)
$95 1 The number of frames between subsequent fading of end of level
when fading to black
$96 1 Player active and game over statuses in a single byte
* #$00 - player 1 not in game over, player 2 in game over (or
1 player game)
* #$01 - player 1 in game over, player 2 not in game over
* #$02 - 2 player game and neither player in game over
* #$ff - both players in game over
$97 1 Y point at level in which to cause scroll
$98 1 Specifies vertical position on screen to stop any vertical
auto-scroll. It also specifies vertical scroll direction in
vertical auto-scroll mode 0. Compared against Y scroll ($fc).
Used by krytpo-crustacean and laser chandelier
* bits 1-7: Y scroll ($fc) to compare against
* bit 0: 0 = up, 1 = down
$99 1 Used when creating multiple random enemies to set the number of
enemies to generate in quick succession
$9a 1 Used to adjust Y velocity when player collides with the
stomping ceiling
$9b 1 Timer used to delay auto-move at the end of the level
$9c 1 When Y auto-scroll is enabled, can be used to specify which
screen of the level to stop on. Compared against Y screen
($82) when non-negative.
* when positive, the screen where the stop checkpoint exist
* when negative, always scroll in the determined direction
until current screen's stop position
$9d 2 Unused
$9f 1 Used in 2 different situations
1. In Level 2, it is the number of tanks on screen. Used to
prevent scroll until all on-screen tanks are destroyed
2. In Level 4, it is used to time changing pattern table tiles
for elevator so that the rack-mounted turret (enemy type
#$25) is hidden 'behind' elevator set near start of second
elevator moving
$a0 2 The player's state (see player_state_routine_ptr_tbl). $a1 is
for p2. If p2 not playing, then $a1 is set to #$00
* #$00
* #$01 - used for brief time between state #$05 and #$02
* #$02 - normal alive state
* #$03 - hit by enemy
* #$04 - falling back after hit
* #$05 - dead on ground
* #$06 - level 1 helicopter delay drop animation
* #$07 - level 1 dropping into level
* #$08 - end of level auto movement complete
$a2 2 Variable to keep track of the player's fractional Y velocity.
Player Y fractional velocity ($a6) is added to this value every
frame. Whenever this value wraps past #$ff, the carry flag is
set which then adds 1 additional Y unit when adding to the
player's Y fractional velocity ($a6) to the player position.
$a3 is for player 2
$a4 2 Variable to keep track of the player's fractional X velocity.
Player X fractional velocity ($aa) is added to this value every
frame. Whenever this value wraps past #$ff, the carry flag is
set which then adds 1 additional X unit when adding to the
player's X fractional velocity ($aa) to the player position.
$a5 is for player 2
$a6 2 Player's Y fractional velocity, e.g. #$80 is .5 since it's
half-way between #$00 and #$ff. $a7 is for player 2
$a8 2 Player's Y velocity integer portion. Positive goes down,
negative goes up. $a9 is for player 2
$aa 2 Player's fractional X velocity. $ab is for player 2
$ac 2 Player X velocity integer portion. Positive goes right,
negative goes left. $ad is for player 2
$ae 2 Player's jump status. $af is for player 2
* #$00 = not jumping
* #$40 = fall off edge
* #$80 = player jump, or player hit and falling back
$b0 2 Player's input while jumping. Read for left and right d-pad
data for determining X velocity. Also used when falling off
ledge to keep track of controller input when walked off ledge.
Not sure why $f3 wasn't used. $b1 is for player 2.
$b2 2 What kind of surface the player is on (not used in overhead
levels). $b3 is for player 2
* #$01 - player on floating platform that can be dropped down
from
* #$02 - player on land / solid wall collision
* #$03 - collapsible ground on level 7 (eggshells)
* #$04 - player in water
* #$05
* #$06 - player on positive incline (start)
* #$07 - player on positive incline (second)
* #$08 - player on positive incline (most of incline)
* #$09 - negative incline (second)
* #$0a - negative incline (most of the time)
* #$0b - negative incline (start)
$b4 2 The current frame of the player animation. Depends on player
state. For example, if player is running on side-view levels,
this cycles from #$00 to #$05 (inclusively). On overhead
levels, this cycles from #$00 to #$03 (inclusively). $b5 is
for player 2
$b6 2 A value that is incremented every frame when player is walking.
Used to wait time animations before incrementing the player
animation frame index ($b4). $b7 is for player 2.
$b8 2 Player's current weapon. Bit 7 is set for rapid fire (R weapon
item). $b9 is for player 2.
* #$00 - Regular
* #$01 - Machine
* #$02 - Spray
* #$03 - Laser
* #$04 - Flame
$ba 2 Which direction the player is aiming. There are 2 up and 2
down values depending on facing direction. See
player_aim_dir_tbl for reference. $bb is for player 2
* #$00 up facing right
* #$01 up-right
* #$02 right
* #$03 right-down
* #$05 crouching facing right
* #$06 jumping aiming down
* etc.
$bc 2 How many frames to be pushed back/down from recoil. #$05
frames when stationary, #$11 when walking or in water. $bd is
for player 2
$be 2 Timer for delay between machine gun firing when holding down b.
6 frames between bullets. $bf is for player 2.
$c0 2 A timer used within a player state. $c1 is for player 2
* in player_state_routine_06 used to delay animation before
player drops from helicopter in level 1
* in player_state_routine_07 used to time velocity
adjustments when dropping from helicopter in level 1
* set to 1 when player dies, then to #$60 as a countdown for
how long to lay on ground before re-spawning
$c2 2 Whether or not to skip testing player sprite collision. $c3 is
for player 2.
* #$01 - player in water aiming down, or after player death
and temporarily invincible while lying on ground
* #$00 - otherwise
$c4 2 Timer for invincibility after dying. While the player is
invincible, he does not kill enemies when colliding (unlike
invincibility timer ($d4). $c5 is for player 2
$c6 2 Player action state. $c7 is for player 2
* #$00 = p2 when not active
* #$1f = jumping
* #$3f = crouching
* #$5f = crouching on incline
* #$7f = in water
* #$bf = overhead level
* #$ff = normal
$c8 2 Times how long b button is pressed for F weapon, charges up to
#$20. $c9 is for player 2.
$ca 2 The player's game over status. When in 1 player, p2 will be in
game over. $cb is for player 2
* #$00 - not game over
* #$01 - game over
$cc 2 Calculated player X position. Not used to place player sprite.
For that, see ($054c). $cd is for player 2.
$ce 2 Calculated player Y position. Not used to place player sprite.
For that, see ($0532). $cf is for player 2.
$d0 2 Player overhead facing direction. #$00 up to #$07 inclusive.
$d1 is for player 2.
* #$00 - up
* #$01 - up-right
* #$02 - right
* #$03 - down-right
* #$04 - down
* #$05 - down-left
* #$06 - left
* #$07 - up-left
$d2 2 End of level auto movement first of 2 checkpoints. $d3 is for
player 2.
* #$00 - not reached
* #$01 = reached
$d4 2 Timer for player invincibility (b (barrier) weapon). Decreases
every 8 frames. $d5 is for player 2.
$d6 2 Keeps track of which sound to play for player auto-move
animation after defeating the level boss. $d7 is for player 2.
* #$00 - no sound
* #$07 - sound_07 (footstep)
$d8 2 When calculating X and Y scroll, used to know if should apply
scroll or apply velocity to player position when player past
center of screen. Set twice per frame (for X and Y logic).
$d9 is for player 2.
* 0 = should scroll when player is past the center of the
screen instead of applying velocity.
* 1 = 2 player game and player cannot be the cause of scroll.
For X scroll this means the player is on the left of the
other player. The player can be the cause of blocking
scroll, e.g. the are too far to the left preventing a right
scroll
$db 6 Unused
$e0 2 [SOUND] 2-byte sound address used when processing a particular
sound slot. loaded from sound command address ($0128) when
processing
$e2 2 [SOUND] A temporary variable used for sound processing
* sometimes single byte sound variable used when processing
* sometimes 2-byte address to sound_cmd_routine_xx
* sometimes sound code read offset
$e4 1 [SOUND] A temporary variable used for sound processing
* used when bringing down pitch by an octave
$e5 1 [SOUND] A temporary variable used for sound processing
* used when calculating pulse channel volume decrescendo
$e6 2 [SOUND] 2-byte memory address to sound part, e.g.
sound_xx_slot_xx
$e8 2 [SOUND] 2-byte memory address to start of sound code, e.g.
sound_xx
$ea 1 [SOUND] 1 less than the number of sound parts in the sound
code, i.e. how many slots the sound code has
$eb 1 Unused
$ec 1 [SOUND] controls channel period/timer (pitch/frequency)
* pulse channel registers $4002 and $4006 - period/timer low
bits
* triangle channel register $400a - period/timer low bits
* noise channel register $400e - noise period (noise mode bit
7 always 0)
$ed 1 [SOUND] controls high bits of period/timer
* pulse channel registers $4003 and $4007 - period/timer 3
high bits
length counter load is always 1 (bit 3 set)
* triangle channel register $400a - period/timer low bits
* noise channel register $400e - noise period (noise mode bit
7 always 0)
$ee 2 Unused
$f0 1 The current level being demonstrated during the demo (attract)
$f1 2 Stores the difference between the controller input between
reads. Useful for events that should only trigger on first
button press . $f2 is for player 2.
$f3 2 Stores the currently-pressed buttons for the controller input.
$f4 is for player 2.
* bit 7 - A
* bit 6 - B
* bit 5 - select
* bit 4 - start
* bit 3 - up
* bit 2 - down
* bit 1 - left
* bit 0 - right
$f5 2 Stores the difference between the controller input between
reads. Same as $f1, not sure why it's duplicated. $f6 is for
player 2.
$f7 2 Used in input-reading code to know the last known valid read of
controller input (similar to $f3). $f8 is for player 2.
$f9 1 Vertical scroll for use after 1st IRQ, but before 3rd IRQ.
Supports having different vertical scroll values for different
IRQs. There are 2 vertical scrolls
* before 1st IRQ Y scroll $fc
* after 1st IRQ, but before 3rd IRQ Y scroll ($f9)
$fa 1 Horizontal scroll to use after the 1st IRQ, but before the 3rd
IRQ. Used to have different horizontal scroll before IRQ
($fd) and after IRQ ($fa)
$fb 1 PPUCTRL for after the 1st IRQ, but before the 3rd IRQ. Used to
have different PPU settings before IRQ ($ff) and after IRQ
($fb)
$fc 1 The number of pixels scrolled vertically on the nametables
(vertical part of PPUSCROLL). #$00-#$ef, where #$00 is top of
nametables and #$ef is showing bottom nametable (max vertical
scroll before wrapping). super c doesn't wrap vertically for
nametables, instead it sets scroll to #$00 when reach bottom
$fd 1 The number of pixels scrolled horizontally on the nametables
(horizontal part of PPUSCROLL). Goes from #$00-#$ff for each
screen (256 pixels) for horizontal levels, this is how many
pixels scrolled to the right
$fe 1 Used to store value of PPUMASK before writing to PPU
$ff 1 Used to set PPUCTRL value for next frame
$0104 6 [SOUND] how many video frames the sound command should last
for, i.e. the time to wait before reading next sound commands
6 bytes, one for each sound slot
$010a 6 [SOUND] the sound code for the sound slot a sound code is the
number representing a logical sound to play, either a sound
effect or background music. A single sound code can be
composed of multiple slots playing simultaneously. 6 bytes,
one for each sound slot
$0110 6 [SOUND] value used when determining how many video frames to
wait before reading next sound command. 6 bytes, one for each
sound slot
$0116 6 [SOUND] various flags encoded in the bits used when processing
sound. 6 bytes, one for each sound slot
* bit 0
* 1 - sound effect command
* 0 - background music (bgm) command
$011c 6 [SOUND] the number of times to repeat the processing sound
command. 6 bytes, one for each sound slot
$0122 6 Unused
$0128 6 [SOUND] low byte of address pointing to sound command. 6
bytes, one for each sound slot
$012e 6 [SOUND] high byte of address pointing to sound command. 6
bytes, one for each sound slot
$0134 6 [SOUND] parent sound command low byte. 6 bytes, one for each
sound slot
$013a 6 [SOUND] parent sound command high byte. 6 bytes, one for each
sound slot
$0140 12 Unused
$014c 6 [SOUND] parent sound command low byte
$0152 6 [SOUND] parent sound command high byte
$0158 3 [SOUND] stores the length counter load bits (l)
* slots 4 and 5 are stored in $015c and $105d
* slot 3 does not use this variable
* see also $0197, and $ed
$015b 1 [SOUND] the current sound slot [0-5], slots are in priority
order (highest priority to lowest priority)
* #$00 = pulse 1 channel
* #$01 = pulse 2 channel
* #$02 = triangle channel
* #$03 = noise and dmc channel
* #$04 = pulse 1
* #$05 = noise channel
$015c 2 [SOUND] length of sound for slots 4 and slot 5
$015e 2 [SOUND] the pulse channel volume before modified. 2 bytes, one
for each pulse channel
$0160 1 [SOUND] APU sound channel configuration register offset
* #$00 for first pulse channel
* #$04 for second
* #$08 for triangle
* #$0c for noise
$0161 3 [SOUND] the sound code to load, e.g. #$12 = sound_12 (HARETSU).
Sound codes greater than #$37 are dmc sounds
$0164 2 [SOUND] constant volume for pulse and noise channels
Not used for noise channel. Slots 4 and 5 are stored in
$0167, $1068, and $0169
$0166 1 [SOUND] used when calculating triangle config
$0167 3 [SOUND] volume for slots 3, 4, and 5
$016a 2 [SOUND] the value to merge with the high nibble before storing
in APU channel config register, compare to $01bc, which config
is used is based on $0175 flag bit 5. 6 bytes, one for each
sound slot
$016c 1 [SOUND] whether or not the game is paused, used for sound logic
$016d 1 [SOUND] specify number of frames before skipping processing
sound for a single frame. Used only by sound_32. See $0173
$016e 2 [SOUND] continuation of $016a
$0170 3 [SOUND] used on pulse or triangle channel
$0173 1 [SOUND] current counter value for use with $016d. When counted
up to the value in $016d, sound processing will skip a single
frame.
$0174 1 [SOUND] continuation of $0170
$0175 5 [SOUND] various sound flags that adjust pitch and tone
* bit 0
* bit 4 - when non-zero uses $01b0 (see check_pitch_adjust)
* bit 5 - 0 = $016a, 1 = use $01bc
* bit 7
$017a 13 [SOUND] Unused. Only ever written to for $017d (for slot 4)
(e.g. sound_06)
$0187 1 [SOUND] used to know which sound sample code to play
$0188 1 Unused
$0189 5 [SOUND] Used on pulse or triangle channel
* triangle linear counter reload value (fine grain duration
before silencing)
* SOUND_TIMER_ADJ+3 is for noise channel (linear counter
reload value)
$018e 3 [SOUND] how many octaves to shift the sound pitch
$0191 3 [SOUND] pulse 1, pulse 2, or triangle note period offset
$0194 3 [SOUND] stores sound channel period byte
$0197 3 [SOUND] loaded into $ed for the current slot
$019a 2 [SOUND] sound_envelope_ptr_tbl offset
$019c 2 [SOUND] used to time pulse volume delay
$019e 2 [SOUND] sound_envelope_xx read offset
$01a0 2 [SOUND] pulse length to restart envelope reading. Effectively
not used with the audio in game
$01a2 2 [SOUND] parent pulse envelope read offset
$01a4 2 [SOUND] number of video frames before end of sound command in
which the pulse decrescendo will resume
$01a6 2 [SOUND] used when calculating $01a4 for pulse slots
$01a8 2 [SOUND] used with $01aa
$01aa 2 [SOUND] when decremented to 0, volume is lowered
$01ac 2 [SOUND] backup of $ec stored between frames. Ultimately
written to $4002
$01ae 2 [SOUND] used when setting $01b0 when $0175 bit 4 set
$01b0 2 [SOUND] used for pulse 1 or pulse 2 for calculating pulse
length and period
$01b2 2 [SOUND] used when calculating period in calc_period_adjust
$01b4 2 [SOUND] used when reading sound_pitch_ctrl_ptr_tbl
$01b6 2 [SOUND] sound_pitch_ctrl_xx offset
$01b8 2 [SOUND] sound_pitch_ctrl_xx offset to go after reading $01ba
$01ba 2 [SOUND] the amount of bytes to read in sound_pitch_ctrl_xx
$01bc 2 [SOUND] the value to merge with the high nibble before storing
in APU channel config register, compare to $016a. Which config
is used is based on $0175 flag bit 5
$01be 2 [SOUND] used for pulse 1 or pulse 2
* bit 4 - double SOUND_VAR_1
* bit 6 - whether or not to overwrite other channel's pitches
see overwrite_pitches
* bit 7
$01c0 2 [SOUND] references sound slots to overwrite the pitch of stores
values 0, 1, 2, or 3
$01c2 2 [SOUND] amount to lower volume by, maximum value of #$0f
$01c4 8 [SOUND] 8 timer bytes (low bits), for use in changing pitch
quickly
* low 4 bytes are for pulse 1
* high 4 bytes are for pulse 2
$01cc 8 8 timer bytes (high bits), for use in changing pitch quickly
* low 4 bytes are for pulse 1
* high 4 bytes are for pulse 2
$01d4 44 reserved for stack. Technically stack is $01ff down to $0100
but Super C assumes stack will never underflow into the memory
used for sound processing
$0200 256 OAMDMA (sprite) read data for direct memory access (DMA) writes
to the PPU. Read once per frame. Populated by
load_sprites_to_oam_buffer
$0300 192 CPU memory graphics buffer. Used to store data that will be
then moved to the PPU later on.
* byte 0 - specifies PPUCTRL and format of following bytes
* ppuctrl_tbl-1 offset, specifies PPUCTRL (including VRAM
increment)
* when byte 0 is #$00 (exit), then then done writing
graphics buffer to PPU, do nothing
* when byte 0 is #$03 (repeat mode), then byte 3 is
repetition count and byte 4 is the byte to repeatedly
write to PPU
* when byte 0 is #$06 or #$07 (block mode), then byte 3 is
length, and bytes 4 to (byte 4 + length) are written to
PPU when that data is written to the PPU, then the next
two bytes are a new PPU address, and the process loops
until #$ff is met
* when byte 0 is any other number (flush mode), then bytes 3
onward are written to PPU until #$ff is met
* byte 1 and byte 2 are PPU addresses high byte then low byte
respectively
* this entire structure is looped until the first byte is #$00
$03c0 8 Some sort of backup for pattern tiles, copied from $0300 and
put back
$03c8 1 High nibble set when $6a is non-zero
$03c9 1 Unused
$03ca 1 The starting scroll from which the enemy Y position is
subtracted. For example, when krypto-crustacean is at the top
of the screen, the Y scroll is #$8c, which is this value. As
the boss swoops down (enemy X position increases), the Y scroll
will be scrolled up in general used for enemies built from bg
tiles so that the X and Y pos can be simulated with scrolling.
Used by krypto-crustacean, helicopter core, fortress wall core,
and stomping ceiling
$03cb 1 The starting scroll from which the enemy X position is
subtracted. As Enemy X position increases, the scroll
decreases. In general used for enemies built from bg tiles so
that the X and Y pos can be simulated with scrolling. Used by
krypto-crustacean, helicopter core, fortress wall core, and
stomping ceiling
$03cc 1 Backgroudn boss nametable bits (bits 0 and 1 of PPUCTRL)
$03cd 1 Palette cycle index. It is a timer used when cycling palette
colors in a background palette
* level 3 - boss screen flashing red (background palette 0
for level 3)
* level 4 - (background palette 3 color 3)
* level 5 - cliff clouds color cycling
* level 6 - cycle floor color form blue to red for boss
reveal
* level 8 - cycle the background palette
$03ce 1 Unused
$03cf 1 A second control for additional palette color cycling
* level 5
* bit 6 clear - controls flashing red of pill box sensor
(enemy type #$04) and rotating guns (enemy type #$04)
* bit 7 set - boss screen for krypto-crustacean
* level 6 - red color cycle for side skull eyes
$03d0 16 Each entry is an index into the pattern table tiles, specifies
collision codes for the level, e.g. $03d2 is one more than the
maximum tile index for collision code 2
$03e0 32 The CPU memory address of the palettes eventually loaded into
the PPU $3f00 to $3f1f. First loaded into graphics the CPU
graphics buffer ($0300), but then loaded into PPU
$0400 128 Map of collision types for each of the supertiles for both
nametables. Each nibble is 16 pixels wide (2 nametable tiles,
1/4 of a super-tile). Each byte is 32 pixels wide (4 nametable
tiles, 1/2 of a super-tile). Every 8 bytes moves
back/forward 2 nametable rows. Every 16 bytes moves up/down
one super-tile
$0480 128 Collision table used for the "B" nametables. Used when
nametable vertical mirroring for the right nametables (AB|AB).
Used when nametable horizontal mirroring for the bottom
nametables (AA|BB)
$0500 8 Sprite codes for player bullets (and intro screen cursor/logo
sprite)
$0508 14 Enemy's sprite code. One byte for each enemy
$0516 2 Unused
$0518 2 Player sprite, references player_sprite_ptr_tbl. $0519 is for
player 2.
$051a 8 Y position on screen of general sprites
$0522 14 Y position on screen of each enemy sprite. Starts at #$00 for
top of screen goes down as value increases
$0530 2 Unused
$0532 2 Player Y position. Starts at #$00 for top of screen goes down
as value increases. $0533 is for player 2.
$0534 8 General sprite X position
$053c 14 X position on screen of each enemy sprite
$054a 2 Unused
$054c 2 Player X position used for drawing sprite. It is a copy of
$cc. $054d is for player 2.
$054e 8 Sprite attribute for general sprites. Specifies palette,
vertical flip, horizontal flip and whether to adjust Y position
* bit 0 and 1 - sprite palette
* bit 2 - whether to add #$01 to sprite Y position, used for
recoil effect firing weapon
* bit 5 - bg priority
* bit 6 - whether to flip the sprite horizontally
* bit 7 - whether to flip the sprite vertically
$0556 14 Enemy sprite attributes. See specification above for $054e
$0564 2 Unused
$0566 2 Player sprite attribute, specifies palette, vertical flip,
horizontal flip and whether to adjust Y position
* bit 0 and 1 - sprite palette
* bit 2 - whether to add #$01 to sprite Y position, used for
recoil effect firing weapon
* bit 5 - bg priority
* bit 6 - whether to flip the sprite horizontally
* bit 7 - whether to flip the sprite vertically
Examples: player being electrocuted or invincible (flashes
various colors)
$0568 16 The sprite codes to load for the bullet, eventually copied into
the CPU sprite buffer ($0500). The first 8 bytes are for
player 1, second 8 bytes for player 2
$0578 16 The bullet's sprite Y position. The first 8 bytes are for
player 1, second 8 bytes for player 2
$0588 16 The bullet's sprite X position. The first 8 bytes are for
player 1, second 8 bytes for player 2
$0598 16 The sprite attributes for the bullet (see $054e for details)
Used for L bullets for flipping the angled sprites depending on
direction. The first 8 bytes are for player 1, second 8 bytes
for player 2
$05a8 16 The state of the player bullet. The first 8 bytes are for
player 1, second 8 bytes for player 2
* 0 - unused
* 1 - normal
* 2 - destroyed
* 3 - just created laser
$05b8 16 The type of weapon and the player that created the bullet. The
low nibble is weapon type. The first 8 bytes are for player 1,
second 8 bytes for player 2
* bit 7 - rapid fire flag
* bit 6 - set for player 2, clear for player 1
* #$00 - Regular
* #$01 - Machine (M)
* #$02 - Spray (S)
* #$03 - Laser (L)
* #$04 - Flame (F)
* #$05 - charged Flame (F)
* #$06 - charged child Flame (F)
$05c8 16 An accumulator to keep track of bullet Y fractional velocity
($05e8) being added to itself have elapsed before adding 1 to
palyer bullet Y position ($0578). The first 8 bytes are for
player 1, second 8 bytes for player 2
$05d8 16 An accumulator to keep track of bullet X fractional velocity
($0608) being added to itself have elapsed before adding 1 to
player bullet X position ($0588). The first 8 bytes are for
player 1, second 8 bytes for player 2
$05e8 16 The fractional Y velocity of the player bullets. The first 8
bytes are for player 1, second 8 bytes for player 2
$05f8 16 One less than how much to affect enemy's HP on collision. For
example, 0 takes 1 HP per hit, 4 takes 5 HP per hit. All
weapons are 0, except 5 which is charged F weapon (flame). The
first 8 bytes are for player 1, second 8 bytes for player 2
$0608 16 Player bullet fractional X velocity. The first 8 bytes are for
player 1, second 8 bytes for player 2
$0618 16 Player bullet X velocity integer portion. The first 8 bytes
are for player 1, second 8 bytes for player 2
$0628 16 Player bullet timer. It counts up as bullet travels, used for
timing and controlling max distance traveled. The first 8
bytes are for player 1, second 8 bytes for player 2.
* for S outdoor bullets, used to determine the size (scale)
of the bullet
* for L when just created, counts down as a delay for spacing
out lasers, then is used like other bullets for distance
* for destroyed player bullets, becomes a timer initialized to
6 controlling how long before the circular explosion sprite
is removed
$0638 16 Player bullet base collision offset into collision_box_tbl.
Always #$9f, or #$00 (no bullet). The first 8 bytes are for
player 1, second 8 bytes for player 2.
$0648 16 Player bullet aim direction. Only used by L weapon sprite
index, indexes into laser_bullet_sprite_tbl. The first 8 bytes
are for player 1, second 8 bytes for player 2
* #$00 - right
* #$01 - down right
* #$02 - down
* #$03 - down left
* #$04 - left
* #$05 - up left
* #$06 - up
* #$07 - up right
$0658 16 Player bullet Y velocity integer portion. The first 8 bytes
are for player 1, second 8 bytes for player 2
$0668 14 Enemy routine index. Subtract 1 to get real routine, since all
offsets are off by 1 (...routine_ptr_tbl - 2). For example,
for flying capsule, setting ENEMY_ROUTINE to #$01 causes
flying_capsule_routine_00 to run the next frame
$0676 14 Enemy HP
$0684 14 An accumulator to keep track of enemy Y fractional velocity
($06a0) being added to itself before adding additional 1 to
enemy Y position ($0522). Can be thought of as a variable to
hold the accumulated fractional velocity until an overflow
occurs
$0692 14 An accumulator to keep track of enemy X fractional velocity
($06bc) being added to itself before adding additional 1 to
enemy X position ($053c). Can be thought of as a variable to
hold the accumulated fractional velocity until an overflow
occurs
$06a0 14 Enemy fractional Y velocity
$06ae 14 Enemy Y velocity integer portion
$06bc 14 Enemy fractional X velocity
$06ca 14 Enemy X velocity integer portion
$06d8 14 Enemy type. For example 3 is soldier, 9 is sniper.
$06e6 14 Used differently by different enemies for various delay logic
$06f4 14 Used by enemies to time firing projectiles
$0702 14 Used by enemies to delay various animation routines
$0710 14 Typically stores index into enemy animation frame. Many, but
not all, enemies used shared method to set sprite based on a
frame index ($0710) (see set_enemy_animation_sprite)
$071e 14 Enemy type-specific attributes that define how an enemy behaves
and/or looks
$072c 14 Enemy attributes for when destroyed. Loaded from
enemy_prop_ptr_tbl
* bit 0
* 0 - test player-enemy collision
* 1 - disable player-enemy collision test
* bit 1
* 0 - spike explosion animation (4 frames)
* 1 - circular explosion animation (3 frames)
* bits 2345 specify sound code to play when destroyed, index
into enemy_destroyed_sound_tbl
* bit 6 - when set, set delay of #$01 when destroyed
(see set_destroyed_enemy_routine)
* bit 7
* 0 - enable bullet collision
* 1 - allow bullets to travel through enemy, e.g. weapon item
$073a 14 Used along with player state $a0 to determine offset into
collision_box_tbl (always multiple of #$04)
$0748 14 Generic enemy variable for use by enemies for any use
$0756 14 Generic enemy variable for use by enemies for any use
$0764 14 Generic enemy variable for use by enemies for any use
$0772 14 Generic enemy variable for use by enemies for any use
$0780 14 Generic enemy variable for use by enemies for any use
$078e 14 Generic enemy variable for use by enemies for any use
$079c 14 Generic enemy variable for use by enemies for any use
$7aa 38 Unused
07d0 10 Post door destroyed attribute bytes overrides. Each of the
10 bytes are specific to an single supertile index to overwrite
(see attribute_overrides_tbl).
$07da 6 Unused
$07e0 3 Binary-coded decimal of high score, e.g. 0047580 = #$58 #$47 #$00
$07e3 3 Binary-coded decimal of p1 score, e.g. 0066080 = #$08 #$66 #$00
$07e6 3 Binary-coded decimal of p2 score, e.g. 0047580 = #$58 #$47 #$00
$07e9 1 [SOUND] The sound code to load when loading a sound. Sound
codes greater than or equal to 55 are dmc sounds
$07ea 2 2-byte signature that is checked during console reset to keep
hi score. If these 2 bytes are set to #$e3 and #$b1, then a
reset will not overwrite the hi score with 0020000. If they
are not #$e3 and #$b1, then initialize the hi score. This
allows soft resets (reset button) to keep hi score.
$07ec 1 Cheat code status
* 0 - cheat code not entered
* 1 - 10 extra lives cheat code entered successfully
$07ed 1 Backup of x register when changing PRG banks
$07ee 1 Bank number of PRG ROM bank at $8000-$9fff
$07ef 1 Bank number of PRG ROM bank at $a000-$bfff
$07f0 1 Bank number of 2 KiB CHR bank at PPU $0000-$07ff (top half of
left pattern table)
$07f1 1 Bank number of 2 KiB CHR bank at PPU $0800-$0fff (bottom half
of left pattern table)
$07f2 1 Bank number of 1 KiB CHR bank at PPU $1000-$13ff (first quarter
of right pattern table)
$07f3 1 Bank number of 1 KiB CHR bank at PPU $1400-$17ff (second
quarter of right pattern table)
$07f4 1 Bank number of 1 KiB CHR bank at PPU $1800-$1bff (third quarter
of right pattern table)
$07f5 1 Bank number of 1 KiB CHR bank at PPU $1c00-$1fff (last quarter
of right pattern table)
$07f6 1 The PPU horizontal scroll to use after an interrupt
$07f7 1 The PPUCTRL to use after an interrupt
$07f8 1 Unused
$07f9 1 Used after first scanline interrupt to set the 2nd scanline
interrupt. It is the number of scanlines until next IRQ
$07fa 1 Another scanline IRQ that can be set during an IRQ
$07fb 2 The PPU address to use after a scanline interrupt
Internal Data for Super C (NES)
| |
|---|---|