


IntroSince there isn't any information posted about how the C-Gear is planted within the save file, I might as well just explain how one would edit it. PokeStock is capable of editing the skin, but it's a pretty weird standalone program -- people may want to have their own program (in english) that can edit it. Plus it's good to know how it works!Background Information
The C-Gear Skin is stored inside the save file as a .psk file ("poké-skin") after it is downloaded or edited. It's a pretty big portion of the save file, coming in at 9.50 KB of data -- that's around 2% of the entire save file's size. Visualizing it as an actual image is different, the .psk file format is not a .bmp or .jpg, and this is beyond me... PokeStock is able to visualize it and save it as a view-able image, however.Documentation of Save Structure for C-Gear Skins:
Code:0x52000-0x545FF Contains the .psk data. Calculate Checksum of this region, call it checksum(1). 0x54603-0x54604 Contains the checksum of the .psk data. Overwrite the current value with checksum(1). 0x1C024-0x1C025 This is a Checksum Reference to the .psk checksum. Overwrite the current value with checksum(1). 0x1C02E-0x1C02F This is a Region Checksum of the reference checksums, which must be recalculated. Calculate the checksum of the region 0x1C000-0x1C02B, call it checksum(2). Overwrite the current value with checksum(2). 0x23F40-0x23F41 This is a Checksum Reference to the previous reference checksum checksum. Overwrite the current value with checksum(2). 0x23F9A-0x23F9B This is a Region Checksum of the nearby reference checksums. Calculate the checksum of the region 0x23F00-0x23F8B, call it checksum(3). Overwrite the current value with checksum(3). 0x54700-0x54702 This is a Checksum Reference to the previous reference checksum checksum. Overwrite the current value with checksum(3). 0x54712-0x54713 This is a Region Checksum of a dword which comprises of checksum(3) and zeroes. Calculate the checksum of the region 0x54700-0x54703, call it checksum(4). Overwrite the current value with checksum(4).



.psk Structure:
Tile Building Region: 0x0-0x1FDFF
Color Table: 0x1FE0-0x1FFFCode:0x20 per tile, referencing a 16 bit color for each pixel. Each tile makes up a 8x8 block of pixels (64 total). 0xFF (255) tiles total. 0x000 - First Tile 0x020 - Second Tile ... 0x1FB0 - 256th tile 0-F to reference 0-F'th color in the color table, build the 8x8 tile (color pixel by color pixel) left to right, top to bottom. Set up the tiles in a 16x16 array, left to right, top down.
Tile Arrangement: 0x2000-0x25FFCode:Only 16 different colors allowed, 16 bits (1 word) per color.
Code:Choose tile for 8x8 pixel arrangement. Move Left to Right, at the end of each line go to the next. 16 bits to choose a tile from the array via (x,y) coordinates, when reading as bytes you would read as big endian (y x) sets. still not completely sure on the coordinate thing... viewing as 64 bits per line is the way to see it visually under a hex viewer
Last edited by Kaphotics; May 16th, 2012 at 08:42 AM.



other crap not particularly related to savs/structure:
For the C-Gear skin appearing in the memory, at delay 0x94 when booting the ROM the C-Gear skin's .psk is loaded at location 0x0224A444 in my English White version; but only has the tile building region.
The final tile of the .psk appears at 0x02150760 as well. That's all of the psk I can find on that delay. It's probably then encrypted away as it's already loaded by the game.
so, possible to AR a skin in? possible, but not probable. The sheer amount of lines needed to overwrite 9.5KB.. lol
edit: looks like it processes each tile and then stores it away
Bookmarks