diff --git a/src/gen2/Gen2DistributionPokemon.cpp b/src/gen2/Gen2DistributionPokemon.cpp index f89ada3..675c762 100644 --- a/src/gen2/Gen2DistributionPokemon.cpp +++ b/src/gen2/Gen2DistributionPokemon.cpp @@ -2639,7 +2639,7 @@ const Gen2DistributionPokemon g2_pcny_biteLapras = { }; const Gen2DistributionPokemon g2_pcny_futureSightLapras = { - .name = "Bite Lapras", + .name = "Future Sight Lapras", .originalTrainer = "", .originalTrainerID = 0, .setPlayerAsOriginalTrainer = true, @@ -6330,7 +6330,7 @@ const Gen2DistributionPokemon g2_pcny_shinyHoOh = { .iv_data = {0, 0}, .randomizeIVs = true, .poke = { - .poke_index = 249, + .poke_index = 250, .held_item_index = 0, .index_move1 = 221, // Sacred Fire .index_move2 = 219, // Safeguard @@ -6558,4 +6558,4 @@ void gen2_getPokemonCenterNewYorkDistributionPokemonList(const Gen2DistributionP { outList = pcnyList; outSize = sizeof(pcnyList) / sizeof(pcnyList[0]); -} \ No newline at end of file +} diff --git a/src/gen2/Gen2GameReader.cpp b/src/gen2/Gen2GameReader.cpp index 47f2b5b..b928f1a 100644 --- a/src/gen2/Gen2GameReader.cpp +++ b/src/gen2/Gen2GameReader.cpp @@ -310,9 +310,24 @@ const char *Gen2GameReader::getPokemonName(uint8_t index) const Gen2PokemonIconType Gen2GameReader::getPokemonIconType(uint8_t index) const { - const uint32_t romOffset = (isGameCrystal()) ? 0x8EAC4 : 0x8E975; + uint32_t romOffset; uint8_t byteVal; + switch(gameType_) + { + case Gen2GameType::GOLD: + romOffset = 0x8E975; + break; + case Gen2GameType::SILVER: + romOffset = 0x8E95B; + break; + case Gen2GameType::CRYSTAL: + romOffset = 0x8EAC4; + break; + default: + return Gen2PokemonIconType::GEN2_ICONTYPE_MAX; + } + romReader_.seek(romOffset); romReader_.advance((index - 1)); romReader_.readByte(byteVal); diff --git a/src/gen2/Gen2IconDecoder.cpp b/src/gen2/Gen2IconDecoder.cpp index 77b3b8b..d9800a5 100644 --- a/src/gen2/Gen2IconDecoder.cpp +++ b/src/gen2/Gen2IconDecoder.cpp @@ -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);