libpokemegb/examples/encodeText_gen2/main.cpp
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

27 lines
614 B
C++

#include "gen2/Gen2Common.h"
#include <cstdio>
#include <cstring>
static void print_hex(const unsigned char* buffer, size_t length)
{
for (size_t i = 0; i < length; i++)
{
printf("%02X ", buffer[i]);
}
printf("\n");
}
int main(int argc, char** argv)
{
if(argc < 2)
{
fprintf(stderr, "Usage: encodeText_gen2 <textToEncode>\n");
return 1;
}
uint8_t outputBuffer[4096];
const uint16_t size = gen2_encodePokeText(argv[1], strlen(argv[1]), outputBuffer, sizeof(outputBuffer), 0x50, Gen2LocalizationLanguage::ENGLISH);
print_hex(outputBuffer, size);
}