From 2e2d9b3c496b48339c6d00391664f9641416a385 Mon Sep 17 00:00:00 2001 From: Cuyler36 Date: Wed, 18 Jun 2025 05:06:34 -0400 Subject: [PATCH] libjsys/jsyswrapper: link --- configure.py | 2 +- src/static/libjsys/jsyswrapper.cpp | 3 +++ src/static/libjsys/jsyswrapper_main.cpp | 31 ++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index 3bc7f5d5..f9b45987 100644 --- a/configure.py +++ b/configure.py @@ -429,7 +429,7 @@ config.libs = [ "progress_category": "library", "src_dir": "src/static", "objects": [ - Object(NonMatching, "libjsys/jsyswrapper.cpp"), + Object(Matching, "libjsys/jsyswrapper.cpp"), ], }, DolphinLib( diff --git a/src/static/libjsys/jsyswrapper.cpp b/src/static/libjsys/jsyswrapper.cpp index 74f8f874..307f6fe5 100644 --- a/src/static/libjsys/jsyswrapper.cpp +++ b/src/static/libjsys/jsyswrapper.cpp @@ -10,8 +10,11 @@ #include "JSystem/JKernel/JKRDecomp.h" #include "JSystem/JKernel/JKRArchive.h" #include "JSystem/JKernel/JKRDvdRipper.h" +#include "JSystem/JUtility/JUTFont.h" #include "MSL_C/printf.h" +// TODO: there are a ton of unused functions we may want to add to this, check DnM+'s static.map file + #include "../src/static/libjsys/jsyswrapper_ext.cpp" #include "../src/static/libjsys/jsyswrapper_main.cpp" diff --git a/src/static/libjsys/jsyswrapper_main.cpp b/src/static/libjsys/jsyswrapper_main.cpp index be187f98..997b7b60 100644 --- a/src/static/libjsys/jsyswrapper_main.cpp +++ b/src/static/libjsys/jsyswrapper_main.cpp @@ -6,6 +6,34 @@ extern void* JC_JUTFader_new(int ul_x, int ul_y, int br_x, int br_y, u32* color) return new JUTFader(ul_x, ul_y, br_x, br_y, JUtility::TColor(*(GXColor*)color)); } +// @unused (necessary for virtual function emmission) +extern int JC_JKRHeap_dump_sort(void* heap) { + return reinterpret_cast(heap)->dump_sort(); +} + +// @unused +extern int JC_JKRHeap_check(void* heap) { + return reinterpret_cast(heap)->check(); +} + +// @fabricated - necessary for virtuals +extern void JC_JUTResFont_fabricated(void* font) { + reinterpret_cast(font)->getLeading(); + reinterpret_cast(font)->getFontType(); + reinterpret_cast(font)->getResFont(); +} +// @unused +extern int JC_JUTFont_getWidth(void* font) { + return reinterpret_cast(font)->getWidth(); +} + +// @unused -- extra hacked for the right weak func emission order +extern int JC_JUTFont_getHeight(void* font) { + return reinterpret_cast(font)->getHeight(); + return reinterpret_cast(font)->getDescent(); + return reinterpret_cast(font)->getAscent(); +} + extern void* JC_JUTDbPrint_getManager() { return JUTDbPrint::getManager(); } @@ -327,7 +355,6 @@ extern void JC_JKRDecomp_decode(u8* comp_bufp, u8* decomp_bufp, u32 decomp_buf_s extern void* JC__JKRGetResource(const char* resourceName) { return JKRGetResource(resourceName); - } extern void JC__JKRRemoveResource(void* res) { @@ -378,9 +405,11 @@ extern void* JC__JKRAllocFromAram(size_t size) { return JKRAllocFromAram(size, JKRAramHeap::Head); } +#pragma force_active on extern u32 JC_JKRAramBlock_getAddress(void* aramBlock) { return reinterpret_cast(aramBlock)->getAddress(); } +#pragma force_active reset extern u8* JC__JKRAramToMainRam_block(void* aramBlock, u8* ramDst, size_t size) { return JKRAram::aramToMainRam(reinterpret_cast(aramBlock), ramDst, size, 0, EXPAND_SWITCH_DEFAULT, 0, nullptr, -1, nullptr);