|
|
SCHG:Sonic CD (PC)From Sonic RetroThis is the Sonic Community Hacking Guide for the DirectX PC Version of Sonic CD.
Level EditingNote that the current version of SonED2 modifies some level data during the extraction process. This page documents the original formats, which SonLVL can open. Object PlacementThis data is located in the DLL???.dll file in each level's folder. See below for locations. There are eight bytes in one object definition. The first two bytes are the X position of the object. The next two bytes, broken down in bits, have the format AB00 YYYY YYYY YYYY, where A is the vertical flip flag, B is the horizontal flip flag and YYYY YYYY YYYY is the Y position of the object. The 5th byte is the reference number on the object pointer list, with the most significant bit if set indicating that the object should be assigned an entry on the object respawn table, 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. The last two bytes, broken down in bits, are ABC0 0000 0000 0000, where A indicates the object should appear in the past time period, B indicates the object should appear in the present time period, and C indicates the object should appear in the future time period. Level LayoutThis data is located in the DLL???.dll file in each level's folder. See below for locations. 8x8 TilesThis data is located in the TCMP???.cm_ file in each level's folder, and is a SCRL file. The tiles will always have a width and height of 8x8. 16x16 Block MappingsThis data is located in the T???.map file in each level's folder.
Each 8x8 tile is represented by one word, which like all SEGA Genesis VDP pattern indices, 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. 256x256 Chunk MappingsThis data is located in the Map???.bin file in each level's folder.
Each 16x16 tile has a two-byte value with the format 0SSY X0II IIII IIII. SS is the solidity of the tile - 00 means not solid, 01 means top solid, 10 means left/right/bottom solid, and 11 means all solid. Y is the Y-flip flag, X is the X-flip flag, and II IIII IIII is the index of the 16x16 tile to use. PalettesThis data is located in the DLL???.dll file in each level's folder. See below for locations. DLL BreakdownDLL11A.DLL
Sound EffectsSound effects are stored in the PCM8.CMP file, in 8-bit unsigned Mono at 11kHz. The file begins with a header that begins like this:
After this, there is a 4 byte value for each sound effect describing its length in bytes, then the sound data as raw PCM. SCDPCsnd can edit this file by importing and exporting WAV files. SpritesThis data is located in SCMP*.cm_ files, and is SZDD compressed. Windows comes with an expand.exe program that can decompress these, or you can use EXPAND.EXE and COMPRESS.EXE from SonED2's Sonic CD PC folder. The file begins with a header that begins like this:
After that, there are 0xC bytes of data for each sprite:
Following that is the sprite data, in 4bpp. Each sprite takes height * (width / 2) bytes, and the next sprite follows immediately. If a sprite's width is not divisible by eight, it is padded to be divisible by eight. TilesThis data is located in the TCMP*.cm_ files, and is SZDD compressed. Windows comes with an expand.exe program that can decompress these, or you can use EXPAND.EXE and COMPRESS.EXE from SonED2's Sonic CD PC folder. The file begins with a header that begins like this:
Following that is four sets of 2 byte values, counting the number of tiles that use each palette line. Then there are two 2 byte values for each tile indicating its width and height. Following that is the tile data, in 4bpp. Each tile takes height * (width / 2) bytes, and the next tile follows immediately. |
