Merge remote-tracking branch 'origin/main' into feature/extract-repro-save-prog

This commit is contained in:
Philippe Symons 2024-10-10 12:37:20 +02:00
commit 8b946673fb
3 changed files with 35 additions and 5 deletions

View File

@ -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]);
}
}

View File

@ -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);

View File

@ -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);