Actions

SCHG

Difference between revisions of "Sonic the Hedgehog 2 (16-bit)/Object Editing"

From Sonic Retro

m (Text replacement - "Category:Sonic Community Hacking Guide" to "")
m (Text replacement - "SCHG:Sonic 2" to "SCHG:Sonic the Hedgehog 2 (16-bit)")
Line 93: Line 93:
  
 
== Object Pointer List ==
 
== Object Pointer List ==
See [[SCHG:Sonic 2/Object Editing/Pointers]].
+
See [[SCHG:Sonic the Hedgehog 2 (16-bit)/Object Editing/Pointers]].
  
 
== Sprite Mappings ==
 
== Sprite Mappings ==

Revision as of 12:44, 25 April 2018


Sonic Community Hacking Guide
Sonic the Hedgehog 2 (16-bit)
Art
Objects
Levels
Text
Music
RAM
Miscellaneous

Sounds

If you change the "ring" sound effect, all objects using that sound will have the new sound. This may not be desired, however - you may have only wanted the Super Ring powerup to play the new sound. With this list, you can edit the sound effect that an object plays. If you change the sound for the Super Ring power-up, only the Super Ring will have the new sound. Note that you are not changing any sound effects - you are only changing which effect will play.

These notes are for those who don't want see the programming stuff of the objects to change its sounds.

To change the sound, first, take a value from the sound test (Ex: 1-up sound is $18) , add $80 to it and you get $98. This is the way you have to replace sounds (take a value from sound test, add $80 to it, and after that, insert the byte in the offset where you wish change the sound.)

Offset List

The following list is the offset where you will place the new sound. I not will make a list with the values and its respective sounds. Use the trick (explained above) and Sound Test. Of course you can place the objects in any level you want (see Object Placement below), I'm just saying the level the object is used in for a better description.

Level Description Offset
ALL Invincibility power-up $12A81
ALL Shield power-up $12A37
ALL Super Ring $129CD
ALL Lamp Post: $1F191
Casino Night Bumper $1F7F5
ALL Red and Yellow Springs Facing Up $18A69
ALL Red and Yellow Springs Facing Right $18BBF
ALL Red Spring Facing Down $18D63
Chemical Plant Speed booster $223DB
Chemical Plant Blue worm (The sound is repeated 3 Times.) $224EA
Aquatic Ruin Arrow launcher $257B7
Casino Night Slot machine cage $2BE1F
Casino Night Point cage $2BE6B
Hill Top Zip line $21E75
Casino Night Blue Bumper $2C577
Casino Night Green flipper $2B30B
Casino Night Orange flipper $2B3BF
Casino Night Impulse spring facing up $2AE4F
Wing Fortress Propellor (repeat infinitely) $3B3A3

Object Pointer List

See SCHG:Sonic the Hedgehog 2 (16-bit)/Object Editing/Pointers.

Sprite Mappings

Reference

Each sprite mapping consists of four words. A contiguous list of sprite mappings preceded with a word-length number of mappings defines one frame for an object. The four words have the following purposes:

  • First word:
    • High byte is the relative signed top edge position of the sprite from the center of the object.
    • Low byte is the size of the sprite, in tiles minus one. The upper four bits are ignored, the next two bits control the width and the lowest two bits control the height. Thus sprites can be of any size from 1x1 tile to 4x4 tiles. For example, $01 is a 1x2 sprite, $02 is a 1x3 sprite, $04 is a 2x1 sprite, and so on.
  • Second and third words:
    • The second word applies to one-player mode; the third applies to two-player mode.
    • The relevant word will be added to the object's VRAM offset and then used as the pattern index for that sprite. Like all SEGA Genesis VDP pattern indices, it is a bitmask of the form PCCY XAAA AAAA AAAA. P is the priority flag, CC is the palette line to use, X and Y indicate that the sprite should be flipped horizontally and vertically respectively and AAA AAAA AAAA is the actual tile index, i.e. the VRAM offset of the pattern divided by $20 (or bit-shifted right by 5).
  • Fourth word: This is the relative signed left edge position of the sprite from the center of the object.

Dynamic PLCs

Dynamic PLCs (pattern load cues) were hard-coded and for the most part unnoticed in Sonic the Hedgehog. In Sonic 2, they are more flexible and used for many more objects. The format of DPLCs is simple: the first word is the number of DPLC requests to make, and each successive word (up to the value of the first word) is split up so that the first nybble is the number of tiles to load minus one, and the last three nybbles are the offset (in tiles, i.e. multiples of $20 bytes) of the art to load from the beginning of the object's specified art offset in ROM. Therefore, in order to request x tiles to be loaded, you need 1+floor(x/16) words in the DPLC.


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