From a631973b73977f33ef98042abca9fca287792439 Mon Sep 17 00:00:00 2001 From: "easyaspi314 (Devin)" Date: Fri, 23 Aug 2019 20:44:01 -0400 Subject: [WIP] English Debug menu translations! (Plus some build system fixes) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I'm back!            す Éß テ-ブ↑& ÒÛªù! (かなテーブルを捨てろよ!/Throw away the kana table!) When compiled in English with DEBUG, instead of óじばÌ (mojibake), you now get actual English translations! No more switching from the game, to the kana chart, and if you don't know Japanese, Google Translate, just to read one sentence. Additionally, the few unknown translations should use proper encoding or Romaji. I decided to use a nicer macro system: static const u8 sStrHello[] = DTR("こんにちは", "Hello"); This prevents ifdef HELL, as the mixed Japanese and English would be messy. Additionally, some special character issues were corrected. Things untranslated/bugs: - Tomomichi's dummy functions. Of course, they don't do much. - The title screen battle menu. This uses a Gen 2 style tile rendering and the way it is rendered is incredibly overcomplicated. - A few phrases which I couldn't get a clear translation for. I don't know much Japanese lol. - Song names. Just tedious with the limited buffer size. - A few layout issues. Some dimensions should be tweaked to avoid text box ovetflows. - Potential buffer overflows, which I want to try to avoid - (ASan for GBA? :morphon:) - While I use the DEBUG_TRANSLATE flag (automatic with ENGLISH && DEBUG) for C code, the asm data only checks for ENGLISH && DEBUG. Additionally, they are ugly. - Haven't tested all builds yet. - Some code formatting issues. I also made it so this will compile with the system preprocessor (including Clang), and my agbcc binutils (which will attempt to be selected automatically if you don't have DKP). Clang needs a few flags (it can't do asm enums with line numbers and it does trigraphs in standard mode), but it is no longer flipping out. I am going to restart my build system project. It was getting way off track, and ucpp was too difficult to maintain (one of the main reasons for the silence). --- src/battle_main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/battle_main.c') diff --git a/src/battle_main.c b/src/battle_main.c index 56eabd515..9a9f954aa 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2475,11 +2475,13 @@ void debug_nullsub_3(void) extern const u32 gUnknown_Debug_821F680[][0x23]; +// Shows a cursor void debug_sub_80125A0(void) { gSharedMem[gUnknown_Debug_821F680[gUnknown_Debug_03004360][gUnknown_Debug_030043A0 + gUnknown_Debug_030043A4 * 5]] = 0x6D; } +// Hides a cursor void debug_sub_80125E4(void) { gSharedMem[gUnknown_Debug_821F680[gUnknown_Debug_03004360][gUnknown_Debug_030043A0 + gUnknown_Debug_030043A4 * 5]] = 0x81; -- cgit v1.2.3 From 265fd20253e34adfc7ca1e9ff3c08a70224d98f6 Mon Sep 17 00:00:00 2001 From: "easyaspi314 (Devin)" Date: Sat, 24 Aug 2019 16:35:52 -0400 Subject: Rename old_charmap and move from graphics-de/unused to graphics/debug. The debug battle text is in English on German ROMs and Japanese on English ROMs. Additionally, old_charmap.bin held the actual text. Weird. I also choose the English when DEBUG_TRANSLATE is on. --- src/battle_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/battle_main.c') diff --git a/src/battle_main.c b/src/battle_main.c index 9a9f954aa..c0147d11d 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -1402,9 +1402,9 @@ extern const u16 gUnknown_Debug_821F424[][5]; extern const u16 gUnknown_Debug_821F56C[][5]; extern const u32 gUnknown_Debug_821F798[][4]; -extern const u8 gUnusedOldCharmap_Gfx_lz[]; -extern const u8 gUnusedOldCharmap_Tilemap_lz[]; -extern const u8 gUnusedOldCharmap_Pal_lz[]; +extern const u8 gDebugBattleCharmap_Gfx_lz[]; +extern const u8 gDebugBattleCharmap_Tilemap_lz[]; +extern const u8 gDebugBattleCharmap_Pal_lz[]; void debug_sub_8010800(void) { @@ -1457,10 +1457,10 @@ void debug_sub_80108B8(void) REG_BG1CNT = 0x4801; REG_BLDCNT = 0; REG_BLDY = 0; - LZDecompressVram(gUnusedOldCharmap_Gfx_lz, (void *)VRAM); - LZDecompressWram(gUnusedOldCharmap_Tilemap_lz, gSharedMem); - LZDecompressVram(gUnusedOldCharmap_Pal_lz, (void *)PLTT); - LZDecompressVram(gUnusedOldCharmap_Pal_lz, (void *)(PLTT + 0x1E0)); + LZDecompressVram(gDebugBattleCharmap_Gfx_lz, (void *)VRAM); + LZDecompressWram(gDebugBattleCharmap_Tilemap_lz, gSharedMem); + LZDecompressVram(gDebugBattleCharmap_Pal_lz, (void *)PLTT); + LZDecompressVram(gDebugBattleCharmap_Pal_lz, (void *)(PLTT + 0x1E0)); m4aSoundVSyncOn(); SetVBlankCallback(debug_sub_8011D40); SetMainCallback2(debug_sub_8010CAC); -- cgit v1.2.3