Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Flashback/RAM map: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Page creation from Sonic RAM map.)
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{rammap|game=Flashback}}
{{rammap|game=Flashback (Sega Genesis)}}


==Main System Memory Locations==
==Main System Memory Locations==
Line 7: Line 7:
!RAM offset||Description
!RAM offset||Description
|-
|-
| width="100" | $FF0000 - $FFA3FF
| width="100" | $FF0000- $FFD3DB
| Chunk mappings
| Unknown
|-
|-
| $FFA400 - $FFA7FF
| $FFD3DC - $FFD3DC
| Level layout (1 byte per chunk, $40 bytes per line, lines for planes A and B interlaced)
| Current item
|-
|-
| $FFA800 - $FFA9FF
| $FFD3DD- $FFFFFF
| Something to do with background scrolling in Star Light Zone
| Unknown
|}
|}


== Object Table Format ==
== Inventory Items ==
The Object Status Table is located at RAM address $FFD000. Each entry is $40 bytes long. Here is a list of all the values for one entry in the OST:


{|class="prettytable"
The items available for your inventory are controlled on a per level basis. This means it is not possible to use the teleporter from the later levels in the earlier ones without considerable modification.
!Offset||Size||Description
 
|-
'''Level 1'''
| $00 || byte || Object type
{| class="prettytable"
|-
! Value || Description
| $01 || byte|| Render flags. The bitfield looks like this:
*Bit 0 is the horizontal mirror flag. If set, the object will be flipped on its horizontal axis.
*Bit 1 is the vertical mirror flag.
*Bits 2 and 3 are the coordinate system. If 0, the object will be positioned by absolute screen coordinates. This is used for things like the HUD and menu options. If 1, the object will be positioned by the playfield coordinates, i.e. where it is in a level. If 2 or 3, the object will be aligned to the background somehow (perhaps this was used for those MZ UFOs).
*Bit 4 is a flag indicating whether to check the y-position of the object. If clear, it will be drawn even if it isn't inside the screen.
*Bit 5 is the raw mappings flag. If set, just 5 bytes will be read from the object's mappings offset when the BuildSprites routine draws the object, and these will be interpreted in the normal manner to display a single Genesis sprite. This format is used for objects such as breakable wall fragments.
*Bit 6 is Sonic's "Ride B" flag
*Bit 7 is the draw object flag. It will be set if the object was onscreen when it came time to draw things. Otherwise, it is clear. There should be no reason to edit this flag, but it's good to know what it does.
|-
| $02 || word || Starting art block.
*First nybble: Palette line the sprite will use.
*Latter 3 nybbles: Starting art block in VRAM for which the object reads from. Multiply by $20 to get VRAM address; divide VRAM address by $20 to get this value.
|-
| $04 || long || Mappings offset
|-
| $08 || word ||
*If in playfield positioning mode, it is the X playfield coordinate.
*If in screen positioning mode, it is the X screen coordinate.
|-
| $0A || word ||
*If the object is in playfield positioning mode, this is the X subpixel coordinate.
*If in screen positioning mode, it's the Y screen coordinate.
|-
| $0C || word ||
*If in playfield positioning mode, it is the Y playfield coordinate.
*If in screen positioning mode, it is unused.
|-
| $0E || word ||
*If the object is in playfield positioning mode, this is the Y subpixel coordinate.
*If in screen positioning mode, it is unused.
|-
| $10 || word || Horizontal (X) velocity
|-
| $12 || word || Vertical (Y) velocity
|-
|$14 || word ||Ground velocity (inertia).
|-
|$16 || byte ||Height/2
|-
|$17 || byte ||Width/2
|-
|$18 || byte ||Sprite priority (00 = front).
|-
|$19 || byte ||Width of the object, in pixels
|-
|$1A || byte ||Current animation frame to display. i.e, the frame currently being displayed on-screen, according to the animation script (currently parsed mappings frame, in other words).
|-
|$1B || byte ||Current frame in animation script. i.e, the frame entry IN the animation script being currently processed.
|-
|$1C || byte ||Animation number. When an animation ID is moved here, it's processed and displayed.
|-
|$1D || byte ||Restart animation flag (when $1D is not equal to $1C, animation restarts)
|-
|$1E || byte ||Animation frame duration (time until next frame).
|-
|$20 || byte ||Collision response bitfield. Tells what the object will do if hit by the character. The bitfield is in the format TTSS SSSS. TT is the type of collision - 00 is enemy, 01 increments the routine counter, 10 is harm, and 11 seems to be a special thing for the starpole. SSSSSS is the size, lifted from a lookup table in the collision response routine.
|-
|$21 || byte ||Custom collision property, for special interaction with Sonic. This is used by bosses, badniks, bumpers and other objects. The way in which this byte is used is different for each object. Bosses use this byte as a hit counter.
|-
|$22 || byte ||Status bitfield.
Counting from the least significant bit:
{|class="prettytable"
!Bit||Hex||Description
|-
|0||$01||X Orientation. Clear is left and set is right.
|-
|1||$02||Y Orientation. Clear is right-side up, and set is upside-down
|-
|2||$04||Unknown or unused.
|-
|3||$08||Set if Sonic is standing on this object.
|-
|-
|4||$10||Unknown or unused.
| $01 || Gun
|-
|-
|5||$20||Set if Sonic is pushing on this object.
| $02 || Holocube
|-
|-
|6||$40||Unknown or unused.
| $0A || Cartridge 0
|-
|-
|7||$80||Unknown or unused.
| $1C || Stone
|} Note that these bits have different meanings for Sonic (see below).
|-
|-
|$23 || byte ||Respawn index reference number, used by badniks, rings and monitors. Each destroyable object is assigned an index number (01, 02, 03 etc.) which refers to a list at $FC00 in the RAM.
| $1D || Teleporter
|-
|-
|$24 || byte ||Routine counter.
| $21 || Key
|-
|-
|$25 || byte ||Second routine counter. This is used for some of the more complicated objects.
| $2A || Stone
|-
|-
|$26 || word ||Angle.
| $30 || Shield
|-
|-
|$28 || byte ||Object subtype. For example, the current monitor selected. See the Object List above for values. Has a different meaning for Sonic.
| $3A || Stone
|-
|-
| $29-$3F || || Object's scratch RAM
| $41 || Credits 0
|-
|-
!colspan="3" | Sonic-specific variables
| $42 || Credits 10
|-
|-
!Offset||Size||Description
| $43 || Credits 50
|-
|-
|$22 || byte ||Special bitfield. Counting from the least significant bit:
| $44 || Credits 500
{|class="prettytable"
!Bit||Hex||Description
|-
|-
|0||$01||Orientation. Clear is left and set is right.
| $45 || Credits 100
|-
|-
|1||$02||Set if Sonic is in the air (jump counts).
| $48 || ID Card
|-
|-
|2||$04||Set if jumping or rolling.
| $49 || Save (Not normally collectable)
|-
|-
|3||$08||Set if Sonic isn't on the ground but shouldn't fall. (Usually when he is on a object that should stop him falling, like a platform or a bridge.)
| $4A || Old Man (Not normally collectable)
|-
|-
|4||$10||Set if jumping after rolling.
| $4B || Anti G Belt
|-
|-
|5||$20||Set if pushing something.
| $4C || Wounded Man (Not normally collectable)
|-
|6||$40||Set if underwater.
|-
|7||$80||Unused.
|}
You can add the hex values together to use multiple settings at once. Also notice that the first 3 bits (0-2) are used in the character object as a second routine counter.
|-
| $28 || byte
| Seconds of air left. Usually $1E; it decrements every second while the player is underwater. Beeps on $18, $13, and $0E. Countdown starts on $0B.
|-
|$2B || byte
| Unused
|-
| $30-$31 || word
| Remaining invulnerability time. Starts at $0078 after Sonic is hit, and seems to decrement every frame until it reaches $0000.
|-
|$32-$33 || word ||Remaining time of invincibility.
|-
|$34-$35 || word ||Remaining time of Speed Shoes.
|-
|$36 || byte ||Angle of ground at Sonic's front collision hot spot ($03 is "edge of ground")
|-
|$37 || byte ||Angle of ground at Sonic's rear collision hot spot
|-
|$39 || byte ||Unused.
|-
|$3A-$3B || word
|Unused.
|-
|$3C || byte ||Set if jumping.
|-
|$3D || byte ||OST index of object currently being stood on. (multiply by $40 and add $D000 to get the object's address).
|-
!colspan="3" | Boss Variables
|-
!Offset||Size||Description
|-
| $21 || byte || Hit counter. Number of hits it takes to defeat a boss.
|-
| $30 || word || X position
|-
| $38 || word || Y position
|-
| $3E || byte || Number of times to flash when hit
|}
|}


[[Category:RAM maps]]


[[Category:RAM maps]]
{{Internal Data}}

Latest revision as of 14:31, 24 January 2024

Chip tiny.png The following article is a RAM map for Flashback.

Main System Memory Locations

This is a map of 68k memory as used by the main gameplay engine.

RAM offset Description
$FF0000- $FFD3DB Unknown
$FFD3DC - $FFD3DC Current item
$FFD3DD- $FFFFFF Unknown

Inventory Items

The items available for your inventory are controlled on a per level basis. This means it is not possible to use the teleporter from the later levels in the earlier ones without considerable modification.

Level 1

Value Description
$01 Gun
$02 Holocube
$0A Cartridge 0
$1C Stone
$1D Teleporter
$21 Key
$2A Stone
$30 Shield
$3A Stone
$41 Credits 0
$42 Credits 10
$43 Credits 50
$44 Credits 500
$45 Credits 100
$48 ID Card
$49 Save (Not normally collectable)
$4A Old Man (Not normally collectable)
$4B Anti G Belt
$4C Wounded Man (Not normally collectable)