diff --git a/assets/xml/code/z_moji_data.xml b/assets/xml/code/z_moji_data.xml new file mode 100644 index 00000000000..b799e378368 --- /dev/null +++ b/assets/xml/code/z_moji_data.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/baseroms/gc-eu-dbg-2/config.yml b/baseroms/gc-eu-dbg-2/config.yml index 5b42c312b3d..5a65c07ab78 100644 --- a/baseroms/gc-eu-dbg-2/config.yml +++ b/baseroms/gc-eu-dbg-2/config.yml @@ -21,14 +21,6 @@ incbins: segment: code vram: 0x80114950 size: 0xAF0 - - name: gMojiFontTLUTs - segment: code - vram: 0x8012A760 - size: 0x80 - - name: gMojiFontTex - segment: code - vram: 0x8012A7E0 - size: 0x400 - name: aspMainData segment: code vram: 0x80155C90 @@ -73,6 +65,10 @@ assets: xml_path: assets/xml/code/fbdemo_wipe1.xml start_offset: 0x10E2C0 end_offset: 0x10ED48 +- name: code/z_moji_data + xml_path: assets/xml/code/z_moji_data.xml + start_offset: 0x10D900 + end_offset: 0x10DD80 - name: misc/link_animetion xml_path: assets/xml/misc/link_animetion.xml - name: misc/z_select_static diff --git a/baseroms/gc-eu-dbg/config.yml b/baseroms/gc-eu-dbg/config.yml index 5b42c312b3d..5a65c07ab78 100644 --- a/baseroms/gc-eu-dbg/config.yml +++ b/baseroms/gc-eu-dbg/config.yml @@ -21,14 +21,6 @@ incbins: segment: code vram: 0x80114950 size: 0xAF0 - - name: gMojiFontTLUTs - segment: code - vram: 0x8012A760 - size: 0x80 - - name: gMojiFontTex - segment: code - vram: 0x8012A7E0 - size: 0x400 - name: aspMainData segment: code vram: 0x80155C90 @@ -73,6 +65,10 @@ assets: xml_path: assets/xml/code/fbdemo_wipe1.xml start_offset: 0x10E2C0 end_offset: 0x10ED48 +- name: code/z_moji_data + xml_path: assets/xml/code/z_moji_data.xml + start_offset: 0x10D900 + end_offset: 0x10DD80 - name: misc/link_animetion xml_path: assets/xml/misc/link_animetion.xml - name: misc/z_select_static diff --git a/baseroms/gc-eu-mq-dbg/config.yml b/baseroms/gc-eu-mq-dbg/config.yml index e5928c7d8e7..fa62d56973a 100644 --- a/baseroms/gc-eu-mq-dbg/config.yml +++ b/baseroms/gc-eu-mq-dbg/config.yml @@ -21,14 +21,6 @@ incbins: segment: code vram: 0x80114930 size: 0xAF0 - - name: gMojiFontTLUTs - segment: code - vram: 0x8012A740 - size: 0x80 - - name: gMojiFontTex - segment: code - vram: 0x8012A7C0 - size: 0x400 - name: aspMainData segment: code vram: 0x80155C70 @@ -73,6 +65,10 @@ assets: xml_path: assets/xml/code/fbdemo_wipe1.xml start_offset: 0x10E2A0 end_offset: 0x10ED28 +- name: code/z_moji_data + xml_path: assets/xml/code/z_moji_data.xml + start_offset: 0x10D8E0 + end_offset: 0x10DD60 - name: misc/link_animetion xml_path: assets/xml/misc/link_animetion.xml - name: misc/z_select_static diff --git a/data/unk_8012ABC0.data.s b/data/unk_8012ABC0.data.s deleted file mode 100644 index 7f99d09e0d5..00000000000 --- a/data/unk_8012ABC0.data.s +++ /dev/null @@ -1,25 +0,0 @@ -.include "macro.inc" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .data - -.balign 16 - -/* Unused */ -glabel D_8012ABC0 - .word fmodf - .word guScale - .word guRotate - .word guTranslate - .word GfxPrint_SetPos - .word GfxPrint_SetColor - .word GfxPrint_Printf - .word GfxPrint_SetPosPx - .word GfxPrint_Init - .word GfxPrint_Open - .word GfxPrint_Close - .word GfxPrint_Destroy diff --git a/data/z_text.data.s b/data/z_text.data.s deleted file mode 100644 index 6efaf072050..00000000000 --- a/data/z_text.data.s +++ /dev/null @@ -1,21 +0,0 @@ -.include "macro.inc" -#include "versions.h" - -/* assembler directives */ -.set noat /* allow manual use of $at */ -.set noreorder /* don't insert nops after branches */ -.set gp=64 /* allow use of 64-bit general purpose registers */ - -.section .data - -.balign 16 - -/* temporary file name, rename to something more appropriate when decompiled */ - -#if DEBUG_ASSETS -glabel gMojiFontTLUTs - .incbin "incbin/gMojiFontTLUTs" - -glabel gMojiFontTex - .incbin "incbin/gMojiFontTex" -#endif diff --git a/include/libc/math.h b/include/libc/math.h index 4389b576ef9..19eca478914 100644 --- a/include/libc/math.h +++ b/include/libc/math.h @@ -34,6 +34,8 @@ double round(double); long lroundf(float); long lround(double); +f32 fmodf(f32 x, f32 y); + f32 fabsf(f32 f); #ifdef __sgi #pragma intrinsic(fabsf) diff --git a/spec/spec b/spec/spec index 54ddc26d6d2..e991001fd87 100644 --- a/spec/spec +++ b/spec/spec @@ -587,9 +587,9 @@ beginseg include "$(BUILD_DIR)/src/code/z_ss_sram.o" include "$(BUILD_DIR)/src/code/z_rumble.o" #if DEBUG_ASSETS - include "$(BUILD_DIR)/data/z_text.data.o" + include "$(BUILD_DIR)/src/code/z_moji_data.o" #endif - include "$(BUILD_DIR)/data/unk_8012ABC0.data.o" + include "$(BUILD_DIR)/src/code/code_unk_8012ABC0.o" include "$(BUILD_DIR)/src/code/z_view.o" include "$(BUILD_DIR)/src/code/z_vimode.o" include "$(BUILD_DIR)/src/code/z_viscvg.o" diff --git a/src/code/code_unk_8012ABC0.c b/src/code/code_unk_8012ABC0.c new file mode 100644 index 00000000000..6ac05f9bb4f --- /dev/null +++ b/src/code/code_unk_8012ABC0.c @@ -0,0 +1,8 @@ +#include "math.h" +#include "ultra64.h" +#include "libu64/gfxprint.h" + +static void* sUnkFunctionPointers[] = { + fmodf, guScale, guRotate, guTranslate, GfxPrint_SetPos, GfxPrint_SetColor, + GfxPrint_Printf, GfxPrint_SetPosPx, GfxPrint_Init, GfxPrint_Open, GfxPrint_Close, GfxPrint_Destroy, +}; diff --git a/src/code/z_moji_data.c b/src/code/z_moji_data.c new file mode 100644 index 00000000000..bb450a695da --- /dev/null +++ b/src/code/z_moji_data.c @@ -0,0 +1,21 @@ +#include "ultra64.h" +#include "gfx.h" + +u64 gMojiFontTLUTs[4][4] = { + { +#include "assets/code/z_moji_data/gMojiFontTLUT0.rgba16.inc.c" + }, + { +#include "assets/code/z_moji_data/gMojiFontTLUT1.rgba16.inc.c" + }, + { +#include "assets/code/z_moji_data/gMojiFontTLUT2.rgba16.inc.c" + }, + { +#include "assets/code/z_moji_data/gMojiFontTLUT3.rgba16.inc.c" + }, +}; + +u64 gMojiFontTex[] = { +#include "assets/code/z_moji_data/gMojiFontTex.i4.inc.c" +};