From 2152d1df2d38f71f3693d73a764c981e54031924 Mon Sep 17 00:00:00 2001 From: cadmic Date: Tue, 3 Sep 2024 12:30:14 -0700 Subject: [ntsc-1.2] Import libleo from Decompollaborate/n64dd (#2104) * Create stack.h for STACK/STACK_TOP * Import libleo from Decompollaborate/n64dd Co-authored-by: Anghelo Carvajal Co-authored-by: Elliptic Ellipsis * Use (unsigned) int when in mdebug * Apply suggestions from code review Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * Use && in leocmdex.c * Use proper names for character tables, revert sNonKanjiIndices * Fix incorrect OSMesg casts * Use LEO_ERROR_GOOD even where docs say 0 Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * Remove "Presumably" comment * Whitespace * Remove redundant (debug-only) returns --------- Co-authored-by: Anghelo Carvajal Co-authored-by: Elliptic Ellipsis Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> --- src/code/fault_gc.c | 8 ++++---- src/code/fault_n64.c | 1 + src/code/kanread.s | 2 +- src/code/main.c | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/code') diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c index f78bc152d..b7907e61a 100644 --- a/src/code/fault_gc.c +++ b/src/code/fault_gc.c @@ -40,6 +40,8 @@ * DPad-Up may be pressed to enable sending fault pages over osSyncPrintf as well as displaying them on-screen. * DPad-Down disables sending fault pages over osSyncPrintf. */ +#pragma increment_block_number "gc-eu:240 gc-eu-mq:240 gc-eu-mq-dbg:224 gc-jp:240 gc-jp-ce:240 gc-jp-mq:240 gc-us:240" \ + "gc-us-mq:240" // Include versions.h first and redefine FAULT_VERSION // This allows this file to compile even when versions.h uses FAULT_N64 @@ -48,12 +50,10 @@ #define FAULT_VERSION FAULT_GC #include "global.h" +#include "alloca.h" #include "fault.h" +#include "stack.h" #include "terminal.h" -#include "alloca.h" - -#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-eu-mq-dbg:222 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64" \ - "gc-us-mq:64" void FaultDrawer_Init(void); void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled); diff --git a/src/code/fault_n64.c b/src/code/fault_n64.c index 69ead6441..da9d7bf6f 100644 --- a/src/code/fault_n64.c +++ b/src/code/fault_n64.c @@ -6,6 +6,7 @@ #include "global.h" #include "fault.h" +#include "stack.h" #include "terminal.h" typedef struct FaultMgr { diff --git a/src/code/kanread.s b/src/code/kanread.s index 8f35b713b..a163f9ead 100644 --- a/src/code/kanread.s +++ b/src/code/kanread.s @@ -23,7 +23,7 @@ * @param sjis Shift-JIS Codepoint of glyph. * @return s32 offset into `kanji` file. * - * @remark Original name: "LeoGetKadr" + * @remark Almost identical to "LeoGetKadr" from libleo. */ LEAF(Kanji_OffsetFromShiftJIS) // Characters with codepoints >= 0x8800 are kanji. Arrangement is regular, diff --git a/src/code/main.c b/src/code/main.c index fa6b5f672..ce1739a5c 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -1,5 +1,6 @@ #include "global.h" #include "fault.h" +#include "stack.h" #include "terminal.h" #include "versions.h" #if PLATFORM_N64 -- cgit v1.2.3