mirror of
https://github.com/risingPhil/libpokemegb.git
synced 2026-03-21 17:44:24 -05:00
Bugfix/pm64 10 sprites error pokemon silver (#1)
Fix PokeMe64 bug #10 - Sprites error Pokemon Silver Turns out that Pokemon Silver has the IconPointers list at a different rom offset for some reason. This was an oversight during my testing because I don't personally own Pokemon Silver. Fix: Use the right rom offset
This commit is contained in:
parent
feff0c5327
commit
095b15227e
|
|
@ -12,7 +12,7 @@ Gen2IconDecoder::Gen2IconDecoder(IRomReader& romReader, Gen2GameType gameType)
|
|||
|
||||
uint8_t* Gen2IconDecoder::decode(Gen2PokemonIconType iconType, bool firstFrame)
|
||||
{
|
||||
const uint32_t romOffset = (gameType_ == Gen2GameType::CRYSTAL) ? 0x8EBBF : 0x8EA70;
|
||||
uint32_t romOffset;
|
||||
const uint8_t MAX_NUM_TILES = 4;
|
||||
const uint8_t TILE_WIDTH = 8;
|
||||
const uint8_t TILE_HEIGHT = 8;
|
||||
|
|
@ -24,6 +24,21 @@ uint8_t* Gen2IconDecoder::decode(Gen2PokemonIconType iconType, bool firstFrame)
|
|||
const uint8_t bankIndex = 0x23;
|
||||
uint16_t pointer;
|
||||
|
||||
switch(gameType_)
|
||||
{
|
||||
case Gen2GameType::GOLD:
|
||||
romOffset = 0x8EA70;
|
||||
break;
|
||||
case Gen2GameType::SILVER:
|
||||
romOffset = 0x8EA56;
|
||||
break;
|
||||
case Gen2GameType::CRYSTAL:
|
||||
romOffset = 0x8EBBF;
|
||||
break;
|
||||
default:
|
||||
return buffer_;
|
||||
}
|
||||
|
||||
// read IconPointers table entry
|
||||
romReader_.seek(romOffset);
|
||||
romReader_.advance(((uint32_t)iconType) * ENTRY_SIZE);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user