Fixed oob crashes on 64 bit
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user