diff --git a/Makefile b/Makefile index efce3bb..8cf1eca 100644 --- a/Makefile +++ b/Makefile @@ -166,7 +166,7 @@ generate_data: @echo "----------------------------------------------------------------" @echo @tools/payload-generator/payload-generator to_compress - @python3 text_helper/main.py + @python text_helper/main.py @echo "Compressing bin files!" @echo -n "[" @find to_compress -name "*.bin" -print0 | xargs -0 -n1 ./compress_lz10.sh diff --git a/building_on_windows.txt b/building_on_windows.txt index c359334..6d5a432 100644 --- a/building_on_windows.txt +++ b/building_on_windows.txt @@ -19,4 +19,4 @@ break-system-packages = true pacman -S openssl-devel export CMAKE_TLS_VERIFY=0 -pip install pandas requests openpyxl \ No newline at end of file +pip install pandas requests openpyxl pypng \ No newline at end of file diff --git a/font_helper/main.py b/font_helper/main.py deleted file mode 100644 index 8265056..0000000 --- a/font_helper/main.py +++ /dev/null @@ -1,160 +0,0 @@ -import os -import math -from PIL import Image -import numpy as np - -# THIS PROGRAM ASSUMES THAT THE FIRST TWO COLORS IN THE PALETTE ARE THE BACKGROUND AND CELL BACKGROUND! - -dir = os.curdir -BACKGROUND_PAL_INDEX = 0 -CELL_PAL_INDEX = 1 - -class Font: - def __init__(self, fileName, numColors, numChars, numCharsX, numCharsY, cellWidth, cellHeight): - self.fileName = fileName - self.numColors = numColors - self.numChars = numChars - self.numCharsX = numCharsX - self.numCharsY = numCharsY - self.cellWidth = cellWidth - self.cellHeight = cellHeight - - self.bpp = int(math.log(numColors, 2)) + 1 - self.numWords = self.numChars * self.cellWidth * self.cellHeight * self.bpp // (8 * 4) - self.numBytes = self.numWords * 4 - - self.charWordTable = [0] * self.numWords - self.charWidthTable = [0] * self.numBytes - - -def build_h(myFont): - with open(dir + "/include/" + myFont.fileName + ".h", 'w') as f: - f.write(f''' -#ifndef __{myFont.fileName.upper()}__ -#define __{myFont.fileName.upper()}__ - -extern const TFont {myFont.fileName}Font; - -#define {myFont.fileName}GlyphsLen {myFont.numBytes} -extern const unsigned int {myFont.fileName}Glyphs[{myFont.numBytes}]; - -#define {myFont.fileName}WidthsLen {myFont.numChars} -extern const unsigned char {myFont.fileName}Widths[{myFont.numChars}]; - -#endif -''') - f.close() - -def build_c(myFont): - with open(dir + "/source/" + myFont.fileName + ".c", 'w') as f: - f.write(f'''typedef struct TFont -{{ - const void *data; //!< Character data. - const unsigned char *widths; //!< Width table for vwf. - const unsigned char *heights; //!< Height table for vhf. - unsigned short charOffset; //!< Character offset. - unsigned short charnumChars; //!< Character numChars. - unsigned char charW; //!< Character width (fwf). - unsigned char charH; //!< Character height. - unsigned char cellW; //!< Glyph cell width. - unsigned char cellH; //!< Glyph cell height. - unsigned short cellSize; //!< Cell-size (bytes). - unsigned char bpp; //!< Font bitdepth; - unsigned char extra; //!< Padding. Free to use. -}} TFont;\n -''') - - f.write(f'const unsigned int {myFont.fileName}Glyphs[{myFont.numWords}] __attribute__((aligned(4)))=\n{{\n\t') - - for i in range(myFont.numWords): - f.write(f'{myFont.charWordTable[i]:#010x},') - if (i == myFont.numWords - 1): - f.write("\n};\n\n") - elif (i % 64 == 63): - f.write("\n\n\t") - elif (i % 8 == 7): - f.write("\n\t") - - f.write(f'const unsigned char {myFont.fileName}Widths[{myFont.numChars}] __attribute__((aligned(4)))=\n{{\n\t') - - for i in range(myFont.numChars): - f.write(f'{myFont.charWidthTable[i]:#04x}, ') - if (i == myFont.numChars - 1): - f.write("\n};\n\n") - elif (i % 128 == 127): - f.write("\n\n\t") - elif (i % 16 == 15): - f.write("\n\t") - - f.write(f'''const TFont {myFont.fileName}Font= -{{ - {myFont.fileName}Glyphs, - {myFont.fileName}Widths, - 0, // All heights are the same - 0, // Character offset, is set to zero - {myFont.numChars}, - {myFont.cellWidth}, {myFont.cellHeight}, - {myFont.cellWidth}, {myFont.cellHeight}, - {myFont.numBytes // myFont.numChars}, - {myFont.bpp}, - 0, // Padding, left blank -}}; - ''') - - f.close() - -def generate_tables(myFont): - img = Image.open(f'{dir}/graphics/{myFont.fileName}.png') - if (img.mode != "P"): - print("Error: Image file does not contain a palette") - exit() - pixels = img.load() - - bitsPerWord = 32 - pixelsPerTileX = 8 - pixelsPerTileY = 8 - tilesPerCharX = myFont.cellWidth // pixelsPerTileX - tilesPerCharY = myFont.cellHeight // pixelsPerTileY - charsPerChartX = myFont.numCharsX - charsPerChartY = myFont.numCharsY - - globalX = 0 - globalY = 0 - bitTotal = 0 - - for charY in range(charsPerChartY): - for charX in range(charsPerChartX): - for tileY in range(tilesPerCharY): - for tileX in range(tilesPerCharX): - for pixelY in range(pixelsPerTileY): - for pixelX in range(pixelsPerTileX): - - arrayIndex = bitTotal // bitsPerWord - bitIndex = bitTotal % bitsPerWord - - globalX = pixelX + (tileX * pixelsPerTileX) + (charX * tilesPerCharX * pixelsPerTileX) - globalY = pixelY + (tileY * pixelsPerTileY) + (charY * tilesPerCharY * pixelsPerTileY) - - val = (pixels[globalX, globalY] - 2) & ((1 << myFont.bpp) - 1) - myFont.charWordTable[arrayIndex] |= val << bitIndex - - #print(f'globalX: {globalX}, globalY: {globalY}, arrayIndex:{arrayIndex}, bitIndex:{bitIndex}, val:{val}') - bitTotal += myFont.bpp - - #print(f'{charX, charY}') - - myFont.charWidthTable[(charY * charsPerChartX) + charX] = (tilesPerCharX * pixelsPerTileX) - for x in range(tilesPerCharX * pixelsPerTileX): - globalX = x + (charX * tilesPerCharX * pixelsPerTileX) - globalY = 0 + (charY * tilesPerCharY * pixelsPerTileY) - #print(f'x: {globalX}, y: {globalY}') - if (pixels[globalX, globalY] == BACKGROUND_PAL_INDEX): - myFont.charWidthTable[(charY * charsPerChartX) + charX] = x - break - -# Main: -latin_normal = Font("latin_normal", 1, 256, 16, 16, 16, 16) -generate_tables(latin_normal) -build_h(latin_normal) -build_c(latin_normal) - diff --git a/graphics/latin_normal.png b/graphics/latin_normal.png deleted file mode 100644 index e3f323b..0000000 Binary files a/graphics/latin_normal.png and /dev/null differ diff --git a/graphics/unused graphics/japanese_normal.png b/graphics/unused graphics/japanese_normal.png deleted file mode 100644 index 07bb453..0000000 Binary files a/graphics/unused graphics/japanese_normal.png and /dev/null differ diff --git a/include/debug_mode.h b/include/debug_mode.h index eedf682..045cb88 100644 --- a/include/debug_mode.h +++ b/include/debug_mode.h @@ -2,7 +2,7 @@ #define DEBUG_MODE_H #define VERSION "v1.2.1" -#define PTGB_BUILD_LANGUAGE 2 +#define PTGB_BUILD_LANGUAGE 1 #define DEBUG_MODE true diff --git a/include/japanese_normal.h b/include/japanese_normal.h new file mode 100644 index 0000000..f621375 --- /dev/null +++ b/include/japanese_normal.h @@ -0,0 +1,19 @@ +#include "debug_mode.h" +#include "pokemon_data.h" + +#if PTGB_BUILD_LANGUAGE == 1 + +#ifndef __JAPANESE_NORMAL__ +#define __JAPANESE_NORMAL__ + +extern const TFont japanese_normalFont; + +#define japanese_normalGlyphsLen 4096 +extern const unsigned int japanese_normalGlyphs[4096]; + +#define japanese_normalWidthsLen 256 +extern const unsigned char japanese_normalWidths[256]; + +#endif + +#endif diff --git a/include/japanese_small.h b/include/japanese_small.h deleted file mode 100644 index 5529479..0000000 --- a/include/japanese_small.h +++ /dev/null @@ -1,21 +0,0 @@ -#include "debug_mode.h" -#include "pokemon_data.h" - -#if PTGB_BUILD_LANGUAGE == JPN_ID - -//{{BLOCK(japanese_small) - -#ifndef __JAPANESE_SMALL__ -#define __JAPANESE_SMALL__ - -extern const TFont japanese_smallFont; - -#define japanese_smallGlyphsLen 4096 -extern const unsigned int japanese_smallGlyphs[1024]; -#define BUILD_FONT &japanese_smallFont - -#endif // __JAPANESE_SMALL__ - -//}}BLOCK(japanese_small) - -#endif \ No newline at end of file diff --git a/include/latin_normal.h b/include/latin_normal.h index c6bdd7a..a9601b4 100644 --- a/include/latin_normal.h +++ b/include/latin_normal.h @@ -1,14 +1,19 @@ +#include "debug_mode.h" +#include "pokemon_data.h" -//{{BLOCK(latin_normal) +#if PTGB_BUILD_LANGUAGE != 1 #ifndef __LATIN_NORMAL__ #define __LATIN_NORMAL__ extern const TFont latin_normalFont; -#define latin_normalGlyphsLen 4096 -extern const unsigned int latin_normalGlyphs[1024]; +#define latin_normalGlyphsLen 8192 +extern const unsigned int latin_normalGlyphs[8192]; -#endif // __LATIN_NORMAL__ +#define latin_normalWidthsLen 256 +extern const unsigned char latin_normalWidths[256]; -//}}BLOCK(latin_normal) +#endif + +#endif diff --git a/source/japanese_normal.c b/source/japanese_normal.c new file mode 100644 index 0000000..4c7bb2e --- /dev/null +++ b/source/japanese_normal.c @@ -0,0 +1,198 @@ +typedef struct TFont +{ + const void *data; //!< Character data. + const unsigned char *widths; //!< Width table for vwf. + const unsigned char *heights; //!< Height table for vhf. + unsigned short charOffset; //!< Character offset. + unsigned short charnumChars; //!< Character numChars. + unsigned char charW; //!< Character width (fwf). + unsigned char charH; //!< Character height. + unsigned char cellW; //!< Glyph cell width. + unsigned char cellH; //!< Glyph cell height. + unsigned short cellSize; //!< Cell-size (bytes). + unsigned char bpp; //!< Font bitdepth; + unsigned char extra; //!< Padding. Free to use. +} TFont; + +const unsigned int japanese_normalGlyphs[1024] __attribute__((aligned(4)))= +{ + 0x00000000,0x00000000,0x00000000,0x00000000,0x04000000,0x3e24043f,0x264d5565,0x00000000, + 0x00000000,0x41412101,0x06094141,0x00000000,0x1c000000,0x40413e00,0x1c204040,0x00000000, + 0x0e000000,0x10103f00,0x61120c08,0x00000000,0x24000000,0x3e04445f,0x36454545,0x00000000, + 0x22000000,0x22225f42,0x18212122,0x00000000,0x08000000,0x207e103e,0x3c020240,0x00000000, + 0x20000000,0x02040810,0x20100804,0x00000000,0x20000000,0x21217d21,0x12212121,0x00000000, + 0x00000000,0x0000201e,0x3c020000,0x00000000,0x10000000,0x20207e10,0x3c020240,0x00000000, + 0x02000000,0x02020202,0x38440202,0x00000000,0x20000000,0x2438207f,0x18203824,0x00000000, + 0x22000000,0x22227f22,0x3c020222,0x00000000,0x3e000000,0x087f0810,0x38040404,0x00000000, + + 0x02000000,0x017a023f,0x79050101,0x00000000,0x02000000,0x3a02023f,0x1c204046,0x00000000, + 0x00000000,0x40201f00,0x1c204040,0x00000000,0x3f000000,0x02040810,0x38040202,0x00000000, + 0x02000000,0x020e3202,0x3e010101,0x00000000,0x02000000,0x2102422f,0x18246439,0x00000000, + 0x00000000,0x01014139,0x72090101,0x00000000,0x12000000,0x4d563e12,0x32555569,0x00000000, + 0x02000000,0x42463a07,0x324a4a73,0x00000000,0x00000000,0x49494a3c,0x26494949,0x00000000, + 0x21000000,0x2121217d,0x19256539,0x00000000,0x07000000,0x21611202,0x0c122121,0x00000000, + 0x1e000000,0x08040808,0x0c515252,0x00000000,0x00000000,0x11120a04,0x40402021,0x00000000, + 0x7d000000,0x21217d21,0x19256539,0x00000000,0x08000000,0x083f083f,0x0629190e,0x00000000, + + 0x0e000000,0x3e282808,0x10262969,0x00000000,0x04000000,0x4624041f,0x38464505,0x00000000, + 0x12000000,0x55563e12,0x264d4d55,0x00000000,0x04000000,0x3e04043e,0x38440404,0x00000000, + 0x12000000,0x42573a12,0x04042442,0x00000000,0x10000000,0x5151533d,0x08103c51,0x00000000, + 0x10000000,0x10107010,0x0e51311e,0x00000000,0x18000000,0x463a0222,0x1c204040,0x00000000, + 0x42000000,0x44424242,0x18204040,0x00000000,0x3e000000,0x221c0810,0x3c524c41,0x00000000, + 0x02000000,0x22261a07,0x42222223,0x00000000,0x3e000000,0x221c0810,0x1c204041,0x00000000, + 0x02000000,0x42463a07,0x32424243,0x00000000,0x08000000,0x196e043f,0x7c020214,0x00000000, + 0x04000000,0x06020204,0x3149494a,0x00000000,0x00000000,0x083e0800,0x2c5a6a3c,0x00000000, + + 0x00000000,0x21110000,0x06012121,0x00000000,0x00000000,0x1c001c00,0x0c102022,0x00000000, + 0x00000000,0x1f000e00,0x310a0408,0x00000000,0x00000000,0x445f2400,0x1625251e,0x00000000, + 0x00000000,0x2a1f1200,0x0212222a,0x00000000,0x00000000,0x2b1d0800,0x04182929,0x00000000, + 0x00000000,0x08380800,0x0629190e,0x00000000,0x52500000,0x22225f22,0x18212122,0x00000000, + 0x54500000,0x107f083f,0x1e010120,0x00000000,0x20000000,0x52540810,0x20100804,0x00000000, + 0x50500000,0x21217d21,0x12212121,0x00000000,0x50500000,0x0000300e,0x3c020000,0x00000000, + 0x58500000,0x10103f08,0x1e010120,0x00000000,0x52000000,0x02020252,0x38440202,0x00000000, + 0x50500000,0x2438207f,0x18203824,0x00000000,0x52500000,0x22227f22,0x3c020222,0x00000000, + + 0x5e500000,0x087f0810,0x38040404,0x00000000,0x52500000,0x017a023f,0x79050101,0x00000000, + 0x52500000,0x3a02023f,0x1c204046,0x00000000,0x50500000,0x40201f00,0x1c204040,0x00000000, + 0x3f000000,0x52540810,0x38040202,0x00000000,0x52500000,0x020e3202,0x3e010101,0x00000000, + 0x51500000,0x21217d21,0x19256539,0x00000000,0x57500000,0x21611202,0x0c122121,0x00000000, + 0x5e500000,0x08040808,0x0c515252,0x00000000,0x50000000,0x11120a54,0x40402021,0x00000000, + 0x51500000,0x217d217d,0x19256539,0x00000000,0x51200000,0x21217d21,0x19256539,0x00000000, + 0xa7400000,0x21611242,0x0c122121,0x00000000,0xae400000,0x08040850,0x0c515252,0x00000000, + 0x40000000,0x11124aa4,0x40402021,0x00000000,0xa1400000,0x217d215d,0x19256539,0x00000000, + + 0x00000000,0x1e000000,0x0c102020,0x00000000,0x00000000,0x4840407f,0x04080828,0x00000000, + 0x20000000,0x17181020,0x10101010,0x00000000,0x08000000,0x41417f08,0x18204040,0x00000000, + 0x00000000,0x0808083e,0x7f080808,0x00000000,0x20000000,0x30307f20,0x20232428,0x00000000, + 0x04000000,0x44447f04,0x30424444,0x00000000,0x08000000,0x08087f08,0x0808087f,0x00000000, + 0x02000000,0x2222223e,0x0c102020,0x00000000,0x02000000,0x21227e02,0x0c102020,0x00000000, + 0x00000000,0x2020203e,0x3e202020,0x00000000,0x22000000,0x22227f22,0x0c102020,0x00000000, + 0x00000000,0x20272007,0x0f102020,0x00000000,0x00000000,0x1020203e,0x43442810,0x00000000, + 0x02000000,0x22223f02,0x3c020212,0x00000000,0x00000000,0x40444242,0x0c102020,0x00000000, + + 0x02000000,0x7946427e,0x1c204040,0x00000000,0x20000000,0x7f10101e,0x0c101010,0x00000000, + 0x00000000,0x40494949,0x1c204040,0x00000000,0x3e000000,0x107f0000,0x04081010,0x00000000, + 0x02000000,0x0e020202,0x02020232,0x00000000,0x10000000,0x10107f10,0x06081010,0x00000000, + 0x00000000,0x0000003e,0x007f0000,0x00000000,0x00000000,0x2620203f,0x47281018,0x00000000, + 0x08000000,0x1820407f,0x0808482f,0x00000000,0x00000000,0x20202020,0x030c1010,0x00000000, + 0x00000000,0x22222202,0x41414242,0x00000000,0x01000000,0x013f0101,0x3e010101,0x00000000, + 0x00000000,0x2020203f,0x06081010,0x00000000,0x00000000,0x11120a04,0x40402021,0x00000000, + 0x08000000,0x2a087f08,0x0849492a,0x00000000,0x00000000,0x2240407f,0x20100814,0x00000000, + + 0x0e000000,0x300e0030,0x38060000,0x00000000,0x08000000,0x24040408,0x7f414222,0x00000000, + 0x20000000,0x30282620,0x07485020,0x00000000,0x00000000,0x3f04043f,0x78040404,0x00000000, + 0x04000000,0x44447f04,0x04040424,0x00000000,0x00000000,0x1010101e,0x7f101010,0x00000000, + 0x00000000,0x3e20203f,0x3f202020,0x00000000,0x1e000000,0x203f0000,0x0c102020,0x00000000, + 0x22000000,0x22222222,0x18202020,0x00000000,0x0a000000,0x0a0a0a0a,0x19294a4a,0x00000000, + 0x02000000,0x02020202,0x0e122202,0x00000000,0x00000000,0x2121213f,0x3f212121,0x00000000, + 0x00000000,0x4041417f,0x18204040,0x00000000,0x00000000,0x3e20203f,0x0e102020,0x00000000, + 0x00000000,0x40404403,0x0f102040,0x00000000,0x00000000,0x203f0000,0x02040414,0x00000000, + + 0x00000000,0x20200000,0x10101618,0x00000000,0x00000000,0x3e080000,0x0c102022,0x00000000, + 0x00000000,0x3e000000,0x3e080808,0x00000000,0x00000000,0x3e100000,0x18121418,0x00000000, + 0x00000000,0x3f040000,0x04041424,0x00000000,0x00000000,0x1c000000,0x3e101010,0x00000000, + 0x00000000,0x3e000000,0x3e203c20,0x00000000,0x54500000,0x44447f04,0x30424444,0x00000000, + 0x58500000,0x08087f08,0x0808087f,0x00000000,0x52500000,0x2222223e,0x0c102020,0x00000000, + 0x52500000,0x21227e02,0x0c102020,0x00000000,0x50500000,0x2020203e,0x3e202020,0x00000000, + 0x52500000,0x22227f22,0x0c102020,0x00000000,0x50500000,0x20270007,0x0f102020,0x00000000, + 0x50500000,0x1020203e,0x43442810,0x00000000,0x2a280000,0x22223f02,0x3c020212,0x00000000, + + 0x50500000,0x20222101,0x06081010,0x00000000,0x52500000,0x7946423e,0x1c204040,0x00000000, + 0x28280000,0x7f10101e,0x0c101010,0x00000000,0x50500000,0x40494909,0x1c204040,0x00000000, + 0x5e500000,0x107f0000,0x04081010,0x00000000,0x52500000,0x0e020202,0x02020232,0x00000000, + 0x50500000,0x22222200,0x41414242,0x00000000,0x51500000,0x013f0101,0x3e010101,0x00000000, + 0x50500000,0x2020203f,0x06081010,0x00000000,0x50000000,0x11120a54,0x40402021,0x00000000, + 0x58500000,0x2a087f08,0x0849492a,0x00000000,0xa0400000,0x22222240,0x41414242,0x00000000, + 0xa1400000,0x013f0141,0x3e010101,0x00000000,0xa0400000,0x2020205f,0x06081010,0x00000000, + 0xa0400000,0x11120a44,0x40402021,0x00000000,0xa8400000,0x2a083f48,0x0849492a,0x00000000, + + 0x00000000,0x0a000000,0x1820202a,0x00000000,0x1c000000,0x22222222,0x1c222222,0x00000000, + 0x08000000,0x0808080c,0x1c080808,0x00000000,0x1c000000,0x10202222,0x3e020408,0x00000000, + 0x1c000000,0x18202222,0x1c222220,0x00000000,0x18000000,0x12121414,0x10103e12,0x00000000, + 0x3e000000,0x1e020202,0x1c222020,0x00000000,0x1c000000,0x1e020222,0x1c222222,0x00000000, + 0x3e000000,0x10202020,0x08080810,0x00000000,0x1c000000,0x1c222222,0x1c222222,0x00000000, + 0x1c000000,0x3c222222,0x1c222020,0x00000000,0x18000000,0x183c3c3c,0x18000018,0x00000000, + 0x3c000000,0x18306666,0x18000018,0x00000000,0x00000000,0x00000000,0x06090906,0x00000000, + 0x00000000,0x3e000000,0x00000000,0x00000000,0x00000000,0x0c000000,0x0000000c,0x00000000, + + 0x00000000,0x22000000,0x00000000,0x00000000,0x427e0000,0x0e0a0a7a,0x00000000,0x00000000, + 0x00000000,0x38000000,0x212f2828,0x0000003f,0x023e0000,0x00020202,0x00000000,0x00000000, + 0x00000000,0x00000000,0x10101010,0x0000001f,0x08000000,0x1c082a1c,0x1c222222,0x00000000, + 0x1c000000,0x1c222222,0x08083e08,0x00000000,0x00000000,0x49497f00,0x6141417f,0x00000000, + 0x00000000,0x00000000,0x06060000,0x00000000,0x00000000,0x22000000,0x22140814,0x00000000, + 0x20200000,0x08081010,0x02020404,0x00000000,0x1c000000,0x22222222,0x2222223e,0x00000000, + 0x1e000000,0x1e222222,0x1e222222,0x00000000,0x1c000000,0x02022222,0x1c222202,0x00000000, + 0x1e000000,0x22222222,0x1e222222,0x00000000,0x3e000000,0x3e020202,0x3e020202,0x00000000, + + 0x3e000000,0x1e020202,0x02020202,0x00000000,0x1c000000,0x02022222,0x1c222232,0x00000000, + 0x22000000,0x3e222222,0x22222222,0x00000000,0x1c000000,0x08080808,0x1c080808,0x00000000, + 0x20000000,0x20202020,0x1c222222,0x00000000,0x22000000,0x060a1222,0x2222120a,0x00000000, + 0x02000000,0x02020202,0x3e020202,0x00000000,0x41000000,0x55636341,0x41494955,0x00000000, + 0x22000000,0x2a262622,0x2232322a,0x00000000,0x1c000000,0x22222222,0x1c222222,0x00000000, + 0x1e000000,0x1e222222,0x02020202,0x00000000,0x1c000000,0x22222222,0x5c263a22,0x00000000, + 0x1e000000,0x1e222222,0x22222212,0x00000000,0x1c000000,0x1c022222,0x1c222220,0x00000000, + 0x3e000000,0x08080808,0x08080808,0x00000000,0x22000000,0x22222222,0x1c222222,0x00000000, + + 0x22000000,0x14222222,0x08081414,0x00000000,0x41000000,0x55554949,0x41416363,0x00000000, + 0x22000000,0x08141422,0x22221414,0x00000000,0x22000000,0x14142222,0x08080808,0x00000000, + 0x3e000000,0x08101020,0x3e020404,0x00000000,0x00000000,0x20201c00,0x3c22223c,0x00000000, + 0x00000000,0x02020202,0x1e22221e,0x00000000,0x00000000,0x02221c00,0x1c220202,0x00000000, + 0x00000000,0x20202020,0x3c22223c,0x00000000,0x00000000,0x221c0000,0x1c22023e,0x00000000, + 0x00000000,0x04040418,0x0404041e,0x00000000,0x00000000,0x22223c00,0x1c22203c,0x00000000, + 0x00000000,0x1e020202,0x22222222,0x00000000,0x00000000,0x00080800,0x08080808,0x00000000, + 0x00000000,0x10001010,0x0c121210,0x00000000,0x02000000,0x0a122202,0x22120a06,0x00000000, + + 0x00000000,0x0808080c,0x08080808,0x00000000,0x00000000,0x49493f00,0x49494949,0x00000000, + 0x00000000,0x22221e00,0x22222222,0x00000000,0x00000000,0x22221c00,0x1c222222,0x00000000, + 0x00000000,0x22221e00,0x0202021e,0x00000000,0x00000000,0x22223c00,0x2020203c,0x00000000, + 0x00000000,0x0c340400,0x04040404,0x00000000,0x00000000,0x02221c00,0x1c22201c,0x00000000, + 0x00000000,0x041e0404,0x18040404,0x00000000,0x00000000,0x22222200,0x3c222222,0x00000000, + 0x00000000,0x22222200,0x08081414,0x00000000,0x00000000,0x49414100,0x22365549,0x00000000, + 0x00000000,0x14224100,0x41221408,0x00000000,0x00000000,0x22222200,0x1c20203c,0x00000000, + 0x00000000,0x20407e00,0x7e040810,0x00000000,0x06000000,0x3e3e1e0e,0x00060e1e,0x00000000, + + 0x00000000,0x00000c0c,0x000c0c00,0x00000000,0x00120000,0x2222221c,0x2222223e,0x00000000, + 0x00120000,0x2222221c,0x1c222222,0x00000000,0x00120000,0x22222222,0x1c222222,0x00000000, + 0x00120000,0x20201c00,0x3c22223c,0x00000000,0x00120000,0x22221c00,0x1c222222,0x00000000, + 0x00120000,0x22222200,0x3c222222,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, + 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, +}; + +const unsigned char japanese_normalWidths[256] __attribute__((aligned(4)))= +{ + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, +}; + +const TFont japanese_normalFont= +{ + japanese_normalGlyphs, + japanese_normalWidths, + 0, // All heights are the same + 0, // Character offset, is set to zero + 256, + 8, 16, + 8, 16, + 16, + 1, + 0, // Padding, left blank +}; + \ No newline at end of file diff --git a/source/text_engine.cpp b/source/text_engine.cpp index 01fd39f..088db00 100644 --- a/source/text_engine.cpp +++ b/source/text_engine.cpp @@ -8,9 +8,8 @@ #include "debug_mode.h" #include "button_menu.h" #include "sprite_data.h" -//#include "latin_short.h" #include "latin_normal.h" -#include "japanese_small.h" +#include "japanese_normal.h" #include "text_data_table.h" #include "background_engine.h" @@ -74,8 +73,7 @@ void init_text_engine() 0, // Paper 0), // Special CLR_WHITE, // White text - //&latin_shortFont, // Custom font - &latin_normalFont, // Custom font + &japanese_normalFont, // Custom font NULL // Use default chr4 renderer ); tte_init_con(); diff --git a/text_helper/fonts/japanese_normal.png b/text_helper/fonts/japanese_normal.png new file mode 100644 index 0000000..68747f3 Binary files /dev/null and b/text_helper/fonts/japanese_normal.png differ diff --git a/text_helper/fonts/latin_normal.png b/text_helper/fonts/latin_normal.png new file mode 100644 index 0000000..bbb0261 Binary files /dev/null and b/text_helper/fonts/latin_normal.png differ diff --git a/text_helper/main.py b/text_helper/main.py index 8d1481f..0fc3613 100755 --- a/text_helper/main.py +++ b/text_helper/main.py @@ -8,8 +8,8 @@ import sys from pathlib import Path import hashlib import math -from PIL import Image import numpy as np +import png class Languages(Enum): Japanese = 0 @@ -31,87 +31,6 @@ new_file_path = BASE_DIR / 'new_text.xlsx' old_file_path = BASE_DIR / 'text.xlsx' json_file_path = BASE_DIR / 'output.json' -mainDict = {} -textSections = [] -charArrays = { - "International": [0] * 0x100, - "Japanese": [0] * 0x100, -} -charArrayOfLanguage = { - Languages.Japanese: charArrays["Japanese"], - Languages.English: charArrays["International"], - Languages.French: charArrays["International"], - Languages.German: charArrays["International"], - Languages.Italian: charArrays["International"], - Languages.SpanishEU: charArrays["International"], - Languages.SpanishLA: charArrays["International"], -} - -jpnCharWidthArray = [ - 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, -0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x28, 0x0, 0x0, ] - -engCharWidthArray = [ - 0x4, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x0, 0x6, 0x6, 0x6, 0x6, 0x6, -0x8, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x0, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x0, -0x6, 0x6, 0x6, 0x6, 0x6, 0x8, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x9, 0x6, 0x6, 0x0, -0x0, 0x0, 0x0, 0x0, 0xA, 0x8, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x6, 0x6, 0x4, 0x8, 0x8, 0x8, 0x7, 0x8, 0x8, 0x4, 0x6, 0x6, 0x4, 0x4, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x7, 0x7, 0x7, 0x2, 0x3, 0x4, -0x5, 0x5, 0x6, 0x7, 0x5, 0x6, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x8, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x4, 0x6, 0x3, 0x6, 0x3, -0x6, 0x6, 0x6, 0x3, 0x3, 0x6, 0x6, 0x6, 0x3, 0x7, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, -0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, -0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x4, 0x5, 0x6, -0x4, 0x6, 0x6, 0x6, 0x6, 0x6, 0x5, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x8, -0x3, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x38, 0x0, 0x0, ] - -charConversionList = [ - # replaces the first char in the list with the latter - ["'", "’"], -] - -jpnEscapeCharConversionList = [ - ["{SCL}", [0xFA]], - ["{CLR}", [0xFB]], - ["{DEF}", [0xFC, 0x06, 0x02]], - ["{FEM}", [0xFC, 0x06, 0x03]], # ??? - ["{MLE}", [0xFC, 0x06, 0x04]], - ["{FPC}", [0xFC, 0x06, 0x05]], - ["{PLR}", [0xFD, 0x01]], - ["{NEW}", [0xFE]], - ["{END}", [0xFF]], -] - -itlEscapeCharConversionList = [ - ["{SCL}", [0xFA]], - ["{CLR}", [0xFB]], - ["{DEF}", [0xFC, 0x01, 0x02]], - ["{FEM}", [0xFC, 0x01, 0x04]], - ["{FPC}", [0xFC, 0x01, 0x06]], - ["{MLE}", [0xFC, 0x01, 0x08]], - ["{PLR}", [0xFD, 0x01]], - ["{NEW}", [0xFE]], - ["{END}", [0xFF]], -] - def split_into_sentences(text: str) -> list[str]: # -*- coding: utf-8 -*- import re @@ -194,13 +113,8 @@ def split_sentence_into_lines(sentence, offset, pixelsPerChar, pixelsInLine, lan # Figure out the length of the word in pixels for char in word: if (pixelsPerChar == "Variable"): - if(lang == Languages.Japanese): - wordLength += jpnCharWidthArray[convert_char_to_byte(ord(char), charArrayOfLanguage[lang], lang)] - spaceLength = jpnCharWidthArray[convert_char_to_byte(ord(' '), charArrayOfLanguage[lang], lang)] - else: - wordLength += engCharWidthArray[convert_char_to_byte(ord(char), charArrayOfLanguage[lang], lang)] - spaceLength = engCharWidthArray[convert_char_to_byte(ord(' '), charArrayOfLanguage[lang], lang)] - + wordLength += charArrayOfLanguage[lang]["font"].charWidthTable[convert_char_to_byte(ord(char), charArrayOfLanguage[lang]["array"], lang)] + spaceLength = charArrayOfLanguage[lang]["font"].charWidthTable[convert_char_to_byte(ord(' '), charArrayOfLanguage[lang]["array"], lang)] elif (pixelsPerChar == "Default"): if (lang == Languages.Japanese): wordLength += 8 @@ -259,6 +173,7 @@ def convert_char_to_byte(incoming, array, lang): log_warning_error(lang, "Warning", f"Character {pair[0]} was used but is not in character table. Replaced with {pair[1]} .") index = 0 + #print(array) for val in array: if str(val) == chr(incoming): return index @@ -290,12 +205,9 @@ def convert_item(ogDict, lang): pixelsInLine = ogDict["pixelsInLine"] include_box_breaks = ogDict["includeBoxBreaks"] - if lang == Languages.Japanese: - arr = charArrayOfLanguage[lang] - list = jpnEscapeCharConversionList - else: - arr = charArrayOfLanguage[lang] - list = itlEscapeCharConversionList + arr = charArrayOfLanguage[lang]["array"] + list = charArrayOfLanguage[lang]["escape"] + for pair in list: if pair[0] in line: escapeString = "" @@ -365,7 +277,7 @@ def convert_item(ogDict, lang): outStr = newStr byteStr = "" - arr = charArrayOfLanguage[lang] + arr = charArrayOfLanguage[lang]["array"] for char in outStr[:-1]: byteStr += f"{convert_char_to_byte(ord(char), arr, lang):02x} " if (len(outStr) > 0 and outStr[-1] != ' '): # Check if the last char is a space @@ -474,7 +386,7 @@ def transfer_xlsx_to_dict(): val = currSheet.iloc[r + 1, c + offset] if pd.isna(val): val = " " - value[r * 0x10 + c] = val + value["array"][r * 0x10 + c] = val # print(charArrays[key]) offset += 16 @@ -578,7 +490,7 @@ def output_json_file(): for item in mainDict[lang.name][section]: string = mainDict[lang.name][section][item]["bytes"].split(" ") outText = "" - arr = charArrayOfLanguage[lang] + arr = charArrayOfLanguage[lang]["array"] for byte in string: byte = arr[int(byte, 16)] outText += str(byte) @@ -594,14 +506,17 @@ BACKGROUND_PAL_INDEX = 0 CELL_PAL_INDEX = 1 class Font: - def __init__(self, fileName, numColors, numChars, numCharsX, numCharsY, cellWidth, cellHeight): + def __init__(self, fileName, conditional, numColors, numChars, numCharsX, numCharsY, cellWidth, cellHeight, charWidth, charHeight): self.fileName = fileName + self.conditional = conditional self.numColors = numColors self.numChars = numChars self.numCharsX = numCharsX self.numCharsY = numCharsY self.cellWidth = cellWidth self.cellHeight = cellHeight + self.charWidth = charWidth + self.charHeight = charHeight self.bpp = int(math.log(numColors, 2)) + 1 self.numWords = self.numChars * self.cellWidth * self.cellHeight * self.bpp // (8 * 4) @@ -612,7 +527,11 @@ class Font: def build_h(myFont): with open(fontDir + "/include/" + myFont.fileName + ".h", 'w') as f: - f.write(f''' + f.write(f'''#include "debug_mode.h" +#include "pokemon_data.h" + +#if {myFont.conditional} + #ifndef __{myFont.fileName.upper()}__ #define __{myFont.fileName.upper()}__ @@ -624,6 +543,8 @@ extern const unsigned int {myFont.fileName}Glyphs[{myFont.numBytes}]; #define {myFont.fileName}WidthsLen {myFont.numChars} extern const unsigned char {myFont.fileName}Widths[{myFont.numChars}]; +#endif + #endif ''') f.close() @@ -676,7 +597,7 @@ def build_c(myFont): 0, // All heights are the same 0, // Character offset, is set to zero {myFont.numChars}, - {myFont.cellWidth}, {myFont.cellHeight}, + {myFont.charWidth}, {myFont.charHeight}, {myFont.cellWidth}, {myFont.cellHeight}, {myFont.numBytes // myFont.numChars}, {myFont.bpp}, @@ -687,11 +608,15 @@ def build_c(myFont): f.close() def generate_tables(myFont): - img = Image.open(f'{fontDir}/graphics/{myFont.fileName}.png') - if (img.mode != "P"): + reader = png.Reader(f'{fontDir}/text_helper/fonts/{myFont.fileName}.png') + png_info = reader.read()[3] + palette = png_info.get('palette') + if (palette is None): print("Error: Image file does not contain a palette") exit() - pixels = img.load() + + width, height, rows, info = reader.read() + pixels = list(rows) bitsPerWord = 32 pixelsPerTileX = 8 @@ -707,8 +632,8 @@ def generate_tables(myFont): for charY in range(charsPerChartY): for charX in range(charsPerChartX): - for tileY in range(tilesPerCharY): - for tileX in range(tilesPerCharX): + for tileX in range(tilesPerCharX): # Tiles go from top to bottom, then left to right + for tileY in range(tilesPerCharY): for pixelY in range(pixelsPerTileY): for pixelX in range(pixelsPerTileX): @@ -718,7 +643,10 @@ def generate_tables(myFont): globalX = pixelX + (tileX * pixelsPerTileX) + (charX * tilesPerCharX * pixelsPerTileX) globalY = pixelY + (tileY * pixelsPerTileY) + (charY * tilesPerCharY * pixelsPerTileY) - val = (pixels[globalX, globalY] - 2) & ((1 << myFont.bpp) - 1) + val = (pixels[globalY][globalX] - 1) + if val < 0: + val = 0 + val &= myFont.bpp myFont.charWordTable[arrayIndex] |= val << bitIndex #print(f'globalX: {globalX}, globalY: {globalY}, arrayIndex:{arrayIndex}, bitIndex:{bitIndex}, val:{val}') @@ -731,17 +659,68 @@ def generate_tables(myFont): globalX = x + (charX * tilesPerCharX * pixelsPerTileX) globalY = 0 + (charY * tilesPerCharY * pixelsPerTileY) #print(f'x: {globalX}, y: {globalY}') - if (pixels[globalX, globalY] == BACKGROUND_PAL_INDEX): + if (pixels[globalY][globalX] == BACKGROUND_PAL_INDEX): myFont.charWidthTable[(charY * charsPerChartX) + charX] = x break def generate_font(): - latin_normal = Font("latin_normal", 1, 256, 16, 16, 16, 16) - generate_tables(latin_normal) - build_h(latin_normal) - build_c(latin_normal) + for font in fonts.values(): + generate_tables(font) + build_h(font) + build_c(font) +mainDict = {} +textSections = [] +fonts = { + "International": Font("latin_normal", "PTGB_BUILD_LANGUAGE != 1", 1, 256, 16, 16, 16, 16, 16, 14), + "Japanese": Font("japanese_normal", "PTGB_BUILD_LANGUAGE == 1", 1, 256, 16, 16, 8, 16, 8, 16), +} +charArrays = { + "International": { + "array": [0] * 0x100, + "font": fonts["International"], + "escape": [ + ["{SCL}", [0xFA]], + ["{CLR}", [0xFB]], + ["{DEF}", [0xFC, 0x01, 0x02]], + ["{FEM}", [0xFC, 0x01, 0x04]], + ["{FPC}", [0xFC, 0x01, 0x06]], + ["{MLE}", [0xFC, 0x01, 0x08]], + ["{PLR}", [0xFD, 0x01]], + ["{NEW}", [0xFE]], + ["{END}", [0xFF]], + ] + }, + "Japanese": { + "array": [0] * 0x100, + "font": fonts["Japanese"], + "escape": [ + ["{SCL}", [0xFA]], + ["{CLR}", [0xFB]], + ["{DEF}", [0xFC, 0x06, 0x02]], + ["{FEM}", [0xFC, 0x06, 0x03]], # ??? + ["{MLE}", [0xFC, 0x06, 0x04]], + ["{FPC}", [0xFC, 0x06, 0x05]], + ["{PLR}", [0xFD, 0x01]], + ["{NEW}", [0xFE]], + ["{END}", [0xFF]], + ] + }, +} +charArrayOfLanguage = { + Languages.Japanese: charArrays["Japanese"], + Languages.English: charArrays["International"], + Languages.French: charArrays["International"], + Languages.German: charArrays["International"], + Languages.Italian: charArrays["International"], + Languages.SpanishEU: charArrays["International"], + Languages.SpanishLA: charArrays["International"], +} +charConversionList = [ + # replaces the first char in the list with the latter + ["'", "’"], +] # Main print("Running text_helper:")