diff options
| author | Kevin Alexis Contreras <36680385+KiritoDv@users.noreply.github.com> | 2022-05-31 00:29:14 -0500 |
|---|---|---|
| committer | Kevin Alexis Contreras <36680385+KiritoDv@users.noreply.github.com> | 2022-05-31 00:29:14 -0500 |
| commit | 22a305028fb4cc85b1a2651c3f598bded6e7b3ff (patch) | |
| tree | 3ad36890930ea3519d10cd1ef22454a64b01b515 /soh/src/code | |
| parent | fa21734a98f5f3f7b69911e1e1b2d3d209deedca (diff) | |
Fixed oob crashes on 64 bit
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_kanfont.c | 2 | ||||
| -rw-r--r-- | soh/src/code/z_message_PAL.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/soh/src/code/z_kanfont.c b/soh/src/code/z_kanfont.c index 7ba2b6d00..c774ac07f 100644 --- a/soh/src/code/z_kanfont.c +++ b/soh/src/code/z_kanfont.c @@ -183,7 +183,7 @@ void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) { * The different icons are given in the MessageBoxIcon enum. */ void Font_LoadMessageBoxIcon(Font* font, u16 icon) { - memcpy(font->iconBuf, msgStaticTbl[4 + icon], FONT_CHAR_TEX_SIZE); + memcpy(font->iconBuf, ResourceMgr_LoadTexByName(msgStaticTbl[4 + icon]), FONT_CHAR_TEX_SIZE); } /** diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index ffb0581c7..5a515e5f1 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1106,16 +1106,18 @@ void Message_LoadItemIcon(GlobalContext* globalCtx, u16 itemId, s16 y) { R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem32XOffsets[gSaveContext.language]; R_TEXTBOX_ICON_YPOS = y + 6; R_TEXTBOX_ICON_SIZE = 32; - memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, gItemIcons[itemId], 0x1000); + memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, + ResourceMgr_LoadTexByName(gItemIcons[itemId]), 0x1000); // "Item 32-0" osSyncPrintf("アイテム32-0\n"); } else { R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem24XOffsets[gSaveContext.language]; R_TEXTBOX_ICON_YPOS = y + 10; R_TEXTBOX_ICON_SIZE = 24; - memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, gItemIcons[itemId], 0x900); + memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, + ResourceMgr_LoadTexByName(gItemIcons[itemId]), 0x900); // "Item 24" - osSyncPrintf("アイテム24=%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84); + // osSyncPrintf("アイテム24=%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84); } msgCtx->msgBufPos++; msgCtx->choiceNum = 1; |
