Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract Kanji + some adjacent docs #1536

Merged
merged 8 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,984 changes: 3,984 additions & 0 deletions assets/xml/interface/kanji.xml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,6 @@ s32 SysFlashrom_IsBusy(void);
s32 SysFlashrom_AwaitResult(void);
void SysFlashrom_WriteDataSync(void* addr, u32 pageNum, u32 pageCount);

s32 func_80185F90(u32 arg0);

Acmd* AudioSynth_Update(Acmd* abiCmdStart, s32* numAbiCmds, s16* aiBufStart, s32 numSamplesPerFrame);

AudioTask* AudioThread_Update(void);
Expand Down
26 changes: 26 additions & 0 deletions include/kanread.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef KANREAD_H
#define KANREAD_H

#include "PR/ultratypes.h"

/**
* s32 Kanji_OffsetFromShiftJIS(s32 sjis);
*
* Returns the offset of the glyph texture data in the file `kanji` corresponding
* to a given 2-byte Shift-JIS codepoint. No range validity check is carried out.
*
* A nice Shift-JIS codepoint table: https://uic.io/en/charset/show/shift_jis/
* The file `kanji` contains the 'Level 1' kanji (0x889F-0x9872), and a reworked
* version of the non-kanji section that includes extra English and Hylian glyphs.
*
* @note This function assumes that its argument is a valid Shift-JIS codepoint;
* there is no range protection at all.
*
* @param sjis Shift-JIS Codepoint of glyph.
* @return s32 offset into `kanji` file.
*
* @remark Original name: "LeoGetKadr"
*/
s32 Kanji_OffsetFromShiftJIS(s32 sjis);

#endif
2 changes: 0 additions & 2 deletions include/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include "macros.h"

// data
// extern UNK_TYPE1 D_80186028;

extern u8 sDropTable[DROP_TABLE_SIZE * DROP_TABLE_NUMBER];
extern u8 sDropTableAmounts[DROP_TABLE_SIZE * DROP_TABLE_NUMBER];
extern s32 D_801AE194[32];
Expand Down
4 changes: 2 additions & 2 deletions spec
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ endseg

beginseg
name "kanji"
include "build/baserom/kanji.o"
include "build/assets/interface/kanji/kanji.o"
endseg

beginseg
Expand Down Expand Up @@ -580,7 +580,7 @@ beginseg
include "build/src/code/c_keyframe.o"
include "build/src/code/sys_slowly.o"
include "build/src/code/sys_flashrom.o"
include "build/asm/code/code_80185F90.text.o" // handwritten
include "build/asm/code/kanread.text.o" // handwritten
include "build/src/code/osFlash.o"
pad_text
pad_text
Expand Down
2 changes: 1 addition & 1 deletion tools/disasm/files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
0x801830A0 : "c_keyframe",
0x80185660 : "sys_slowly",
0x801857C0 : "sys_flashrom",
0x80185F90 : "", # handwritten
0x80185F90 : "kanread", # handwritten
0x80186A70 : "osFlash",
0x801877A0 : "[PADDING]",
0x801877D0 : "audio_synthesis",
Expand Down
2 changes: 1 addition & 1 deletion tools/disasm/functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3462,7 +3462,7 @@
0x80185EC4:("SysFlashrom_IsBusy",),
0x80185F04:("SysFlashrom_AwaitResult",),
0x80185F64:("SysFlashrom_WriteDataSync",),
0x80185F90:("func_80185F90",),
0x80185F90:("Kanji_OffsetFromShiftJIS",),
0x80186A70:("osFlashGetAddr",),
0x80186AB8:("osFlashReInit",),
0x80186B38:("osFlashChange",),
Expand Down
2 changes: 1 addition & 1 deletion tools/disasm/variables.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
0x8009F888:("viCounterMsg","OSIoMesg","",0x18),
0x8009F8A0:("viRetrace","u16","",0x2),
0x8009F8B0:("dmadata","DmaEntry","[1568]",0x6200),
0x80186028:("D_80186028","s16","[1316]",0xa48),
0x80186028:("sNonKanjiIndices","s16","[1316]",0xa48),
0x801AAAB0:("aspMainTextStart","UNK_TYPE1","",0x1),
0x801ABAB0:("gspS2DEX2_fifoTextStart","UNK_TYPE1","",0x1),
0x801AD370:("njpgdspMainTextStart","UNK_TYPE1","",0x1),
Expand Down
2 changes: 1 addition & 1 deletion tools/sizes/code_functions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2977,7 +2977,7 @@ asm/non_matchings/code/sys_flashrom/SysFlashrom_WriteDataAsync.s,SysFlashrom_Wri
asm/non_matchings/code/sys_flashrom/SysFlashrom_IsBusy.s,SysFlashrom_IsBusy,0x80185EC4,0x10
asm/non_matchings/code/sys_flashrom/SysFlashrom_AwaitResult.s,SysFlashrom_AwaitResult,0x80185F04,0x18
asm/non_matchings/code/sys_flashrom/SysFlashrom_WriteDataSync.s,SysFlashrom_WriteDataSync,0x80185F64,0xB
asm/non_matchings/code/code_80185F90/func_80185F90.s,func_80185F90,0x80185F90,0x26
asm/non_matchings/code/kanread/Kanji_OffsetFromShiftJIS.s,Kanji_OffsetFromShiftJIS,0x80185F90,0x26
asm/non_matchings/code/osFlash/func_80186A70.s,func_80186A70,0x80186A70,0x12
asm/non_matchings/code/osFlash/func_80186AB8.s,func_80186AB8,0x80186AB8,0x1C
asm/non_matchings/code/osFlash/func_80186B28.s,func_80186B28,0x80186B28,0x2
Expand Down