Sonic the Hedgehog 2 (16-bit)/Object Editing
From Sonic Retro
Revision as of 03:44, 25 March 2020 by Black Squirrel (talk | contribs) (Text replacement - "Genesis" to "Mega Drive")
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
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 Mega Drive 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.
References