Actions

SCHG

Difference between revisions of "SCHG:Sonic the Hedgehog 3 & Knuckles"

From Sonic Retro

(RAM Hacking)
m (Text replacement - "{{SCHGuides}}" to "==References== <references /> {{SCHGuides}}")
 
(108 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{stub}}
+
__NOTOC__
Note: As S3&K is a "lock-on" game, all offsets below $200000 are in the base S&K ROM, and all offsets above $200000 are in the connected S3 ROM.
+
{{SCHG S3K}}
==ROM Hacking==
+
This is the '''[[Sonic Community Hacking Guide]] for ''[[Sonic 3 & Knuckles]]'''''. As ''Sonic 3 & Knuckles'' is a "[[Lock-On Technology|lock-on]]" game, all offsets below $200000 are in the base ''[[Sonic & Knuckles]]'' ROM, and all offsets above $200000 are in the connected ''[[Sonic the Hedgehog 3]]'' ROM. Since ''Sonic 3 & Knuckles'' runs on ''Sonic & Knuckles''<nowiki>'</nowiki> engine, all the information on this page also applies to ''Sonic & Knuckles'' alone, with the exception of any pointers above $200000 (which are part of the locked-on ''Sonic 3'' ROM).
===Art Editing===
 
====Uncompressed Art Locations====
 
  
====[[Nemesis compression|Nemesis Compressed]] Art Locations====
 
  
====[[Kosinski compression|Kosinski Compressed]] Art Locations====
+
==References==
 
+
<references />
====Palette Editing====
 
Insert table of palette locs here
 
For information about the palette format, see [[Palette#Megadrive_Palette|Megadrive palette]].
 
 
 
====Pattern Load Cues====
 
 
 
===Object Editing===
 
====Object Pointer List====
 
 
 
====Sprite Mappings====
 
 
 
====Object Placement====
 
There are six bites in one object definition. The first two bytes are the X position of the object, and the next two bytes are the Y position. The 5th byte is the reference number on the object pointer list (see above), and the 6th byte is an optional declaration to use for defining that object's behavior and/or animation. This will depend on the object. See the level specific hacking info for the locations of the object lists.
 
 
 
The 6th byte, the object subtype, is loaded in the 28th byte of the SST of that object (see below).
 
 
 
===Ring Placement===
 
There are four bytes for every ring object. The first 2 bytes are X coordinates, after that there is one nibble to determine how many rings, then three nibbles (or one nibble and one byte) for the Y coordinates. After you are done adding all your rings for the level, "FF FF"  will end the ring data. A format would look like this:
 
XX XX TY YY
 
Where X represents X position, Y represents Y position, and T represents type, as per the table below.
 
 
 
'''Example:'''
 
03 46 10 2B
 
 
 
If you see this, then you will get two horizontal rings at X = 0346 Y = 02B. The "1" determines how many rings there are, and what direction they go. (horizontal or vertical) Here is what you get for each value:
 
 
 
{| border="1"
 
!Value||Rings
 
|-
 
|0
 
|1 Horizontal
 
|-
 
|1
 
|2 Horizontal
 
|-
 
|2
 
|3 Horizontal
 
|-
 
|3
 
|4 Horizontal
 
|-
 
|4
 
|5 Horizontal
 
|-
 
|5
 
|6 Horizontal
 
|-
 
|6
 
|7 Horizontal
 
|-
 
|7
 
|8 Horizontal
 
|-
 
|8
 
|1 Vertical
 
|-
 
|9
 
|2 Vertical
 
|-
 
|A
 
|3 Vertical
 
|-
 
|B
 
|4 Vertical
 
|-
 
|C
 
|5 Vertical
 
|-
 
|D
 
|6 Vertical
 
|-
 
|E
 
|7 Vertical
 
|-
 
|F
 
|8 Vertical
 
|-
 
|}
 
 
 
===Level Layout===
 
Level layouts are compressed in Kosinski format, so to edit them you will need to decompress them first. (I recommend using TSDC for this)
 
 
 
Level layouts are pretty simple. There is one bye per 128x128 tile to place on the map. The blocks are put together from left to right, top to bottom. Each horizontal row is 60 bytes long. 60 bytes for the first row of the foreground, then 60 bytes for the first row of the background, then 60 bytes for the second row of the foreground....(it continues like this).
 
 
 
See the level specific hacking info for the locations of level layout data. (Put here for now, will eventually be moved to subpage)
 
{| border = "1"
 
! Offset ||Level Name
 
|-
 
| 2814A8
 
| Angel Island 1
 
|-
 
| 281CF4
 
| Angel Island 2
 
|-
 
| 282A5A
 
| Hydrocity 1
 
|-
 
| 283582
 
| Hydrocity 2
 
|-
 
| 28442A
 
| Marble Garden 1
 
|-
 
| 2850BA
 
| Marble Garden 2
 
|-
 
| 285E6A
 
| Carnival Night 1
 
|-
 
| 286A34
 
| Carnival Night 2
 
|-
 
| 2879C2
 
| Icecap 1
 
|-
 
| 28898A
 
| Icecap 2
 
|-
 
| 2897DA
 
| Launch Base 1
 
|-
 
| 28A786
 
| Launch Base 2
 
|-
 
| 09F43E
 
| Mushroom Hill 1
 
|-
 
| 0A0172
 
| Mushroom Hill 2
 
|-
 
| 09D708
 
| Flying Battery 1
 
|-
 
| 09D708
 
| Flying Battery 2
 
|-
 
| 0A0DE2
 
| Sandopolis 1
 
|-
 
| 0A1C4E
 
| Sandopolis 2
 
|-
 
| 0A2A66
 
| Lava Reef 1
 
|-
 
| 0A388E
 
| Lava Reef 2
 
|-
 
| 0A76F4
 
| Lava Reef 2 (Robotnik)
 
|-
 
| 0A79AC
 
| Hidden Palace
 
|-
 
| 0A4616
 
| Sky Sanctuary 1
 
|-
 
| 0A5286
 
| Sky Sanctuary 2
 
|-
 
| 0A5402
 
| Death Egg 1
 
|-
 
| 0A63D0
 
| Death Egg 2
 
|-
 
| 0A7FD4
 
| Death Egg 2 (Robotnik)
 
|-
 
| 0A725E
 
| Doomsday
 
|}
 
 
 
===16x16 Block Mappings===
 
 
 
===Text Editing===
 
 
 
==RAM Hacking==
 
Main System Memory Locations
 
 
 
These are significant locations in the system memory. Note that any numbers entered (for example, score or number of rings) will have to be converted to hex before putting them in.
 
 
 
{| border="1"
 
!RAM offset||Description
 
|-
 
| width="100" | $FFE439
 
| Number of sphers you have left in special stage.
 
|-
 
| width="100" | $FFE43B
 
| Number of rings you have left in special stage.
 
|-
 
| width="100" | $FFFDBD
 
| Selection on Sonic 3 competition main menu by pressing up and down.
 
|-
 
| width="100" | $FFFE12
 
| Lives.
 
|-
 
| width="100" | $FFFE21
 
| Rings.
 
|-
 
| width="200" | $FFFE23 - $FFFE24
 
| Time.
 
|-
 
| width="100" | $FFFE2C
 
| Level.
 
|-
 
| width="100" | $FFFE2D
 
| Act.
 
|-
 
| width="100" | $FFFF0B
 
| Player option on the level select menu.
 
|-
 
| width="100" | $FFFF86
 
| Selection on Title Screen.
 
|-
 
|}
 
===Variables===
 
 
 
===Object Status Table===
 
  
 
{{SCHGuides}}
 
{{SCHGuides}}
 +
[[Category:Sonic Community Hacking Guide]]

Latest revision as of 15:50, 24 March 2020

SCHG: Sonic the Hedgehog 3 & Knuckles
Main Article
Art Editing
Editing Art
Uncompressed Art
Nemesis Format Art
Kosinski Format Art
Palette Editing
Palette Locations
Pattern Load Requests
Object Editing
Editing Objects
Object Pointers
Object Pointer List #1
Object Pointer List #2
Objects not in either list
Sprite Mappings
Dynamic PLCs
Level Editing
Editing Levels
Object Placement
Ring Placement
Level Layout
16x16 Block Mappings
128x128 Block Mappings
Music Editing
Editing Music
Pointer Format
Header Format
DAC Samples
Universal Voice Bank
Music Pointers (Sonic & Knuckles)
Music Pointers (Sonic 3)
RAM Editing
Editing RAM
Main System Memory Locations
Object Status Table Format
Sonic & Knuckles Collection
Sonic & Knuckles Collection
Music and sound effects

This is the Sonic Community Hacking Guide for Sonic 3 & Knuckles. As Sonic 3 & Knuckles is a "lock-on" game, all offsets below $200000 are in the base Sonic & Knuckles ROM, and all offsets above $200000 are in the connected Sonic the Hedgehog 3 ROM. Since Sonic 3 & Knuckles runs on Sonic & Knuckles' engine, all the information on this page also applies to Sonic & Knuckles alone, with the exception of any pointers above $200000 (which are part of the locked-on Sonic 3 ROM).


References


Sonic Community Hacking Guide
General
SonED2 Manual | Subroutine Equivalency List
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (Master System) | Sonic 3 | Sonic 3 & Knuckles | Chaotix | Sonic Jam | Sonic Jam 6 | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Forces
Technical information
Sonic Eraser | Sonic 2 (Nick Arcade prototype) | Sonic CD (prototype; 1992-12-04) | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Tails Adventures | Sonic Crackers | Sonic 3D: Flickies' Island | Sonic & Knuckles Collection | Sonic R | Sonic Shuffle | Sonic Advance | Sonic Advance 3 | Sonic Battle | Shadow the Hedgehog | Sonic Rush | Sonic Classic Collection | Sonic Free Riders | Sonic Lost World
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | SMPS Music Hacking Guide | Mega Drive technical information