libpokemegb/include/gen2/Gen2Localization.h
Philippe Symons a61b727023 Add support for the gen II localizations
Note: for Korean games, specifically, I did not implement the Korean character set
(nor do I plan to)

The reason is that it is entirely different and more complex to implement than the other
character sets. I'm not personally invested nor interested enough to go through the hassle.

This affects the pokémon names that will be displayed when using libpokemegb. Instead as
a fallback, it will return "poke-<number>" for these roms.

Feel free to contribute proper Korean character set (and pokémon names) support!
2024-11-20 23:46:27 +01:00

68 lines
2.2 KiB
C++

#ifndef _GEN2LOCALIZATION_H
#define _GEN2LOCALIZATION_H
#include <cstdint>
enum class Gen2GameType;
enum class Gen2LocalizationLanguage
{
ENGLISH,
FRENCH,
ITALIAN,
SPANISH,
GERMAN,
/**
* Warning: pokémon name decoding is not supported for Korean games!
* It has a much more difficult character encoding scheme than the other languages (including Japanese)
* https://bulbapedia.bulbagarden.net/wiki/Korean_character_encoding_(Generation_II)
*
* I'm personally not that interested in supporting that. Sorry. I'd welcome contributions for it though!
*/
KOREAN,
JAPANESE,
/**
* This value indicates that we haven't found a supported localization. It can also be used as a marker to
* indicate that the game has not been identified yet.
*/
MAX
};
/**
* This struct contains the relevant rom offsets for a specific Gen II game localization.
* Because of the localization process, data has shifted to different positions inside the rom
* So we need separate rom offsets for each of these localization+game type variation.
*/
typedef struct Gen2LocalizationRomOffsets
{
/**
* Rom offset of the species structs which define the base stats of a pokémon in the pokedex number order
*/
uint32_t stats;
/**
* Rom offset of the pokémon name definitions in pokedex number order
*/
uint32_t names;
/**
* Rom offset of the list of icon types per pokémon in the pokedex number order
*/
uint32_t iconTypes;
/**
* Rom offset for the icon pointer table for the party mini-sprite icons
*/
uint32_t icons;
/**
* Rom offset for the list of pokémon sprite pointers. (front + back)
*/
uint32_t spritePointers;
/**
* Rom offset for the list of pokémon sprite palettes. Each pokémon has 2 palettes: non-shiny and shiny.
* For each of the palettes, only 2 16-bit colors are defined. The other two of the 4-color gameboy colorpalette
* are always black and white, so they don't need to be stored in this list
*/
uint32_t spritePalettes;
} Gen2LocalizationRomOffsets;
const Gen2LocalizationRomOffsets& gen2_getRomOffsets(Gen2GameType gameType, Gen2LocalizationLanguage language);
#endif