mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-23 07:21:19 +00:00
Use intptr types in overlays and dmadata (#1325)
This commit is contained in:
parent
3122143f96
commit
7254adec9f
9 changed files with 73 additions and 67 deletions
|
@ -1348,8 +1348,8 @@ void KaleidoScope_UpdateNamePanel(PlayState* play) {
|
|||
sp2A += 12;
|
||||
}
|
||||
|
||||
DmaMgr_SendRequest1(pauseCtx->nameSegment, (u32)_map_name_staticSegmentRomStart + (sp2A * 0x400), 0x400,
|
||||
"../z_kaleido_scope_PAL.c", 2093);
|
||||
DmaMgr_SendRequest1(pauseCtx->nameSegment, (uintptr_t)_map_name_staticSegmentRomStart + (sp2A * 0x400),
|
||||
0x400, "../z_kaleido_scope_PAL.c", 2093);
|
||||
} else {
|
||||
osSyncPrintf("zoom_name=%d\n", pauseCtx->namedItem);
|
||||
|
||||
|
@ -1362,7 +1362,7 @@ void KaleidoScope_UpdateNamePanel(PlayState* play) {
|
|||
|
||||
osSyncPrintf("J_N=%d point=%d\n", gSaveContext.language, sp2A);
|
||||
|
||||
DmaMgr_SendRequest1(pauseCtx->nameSegment, (u32)_item_name_staticSegmentRomStart + (sp2A * 0x400),
|
||||
DmaMgr_SendRequest1(pauseCtx->nameSegment, (uintptr_t)_item_name_staticSegmentRomStart + (sp2A * 0x400),
|
||||
0x400, "../z_kaleido_scope_PAL.c", 2120);
|
||||
}
|
||||
|
||||
|
@ -2437,11 +2437,12 @@ void KaleidoScope_LoadDungeonMap(PlayState* play) {
|
|||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s32 pad;
|
||||
|
||||
DmaMgr_SendRequest1(interfaceCtx->mapSegment, (u32)_map_48x85_staticSegmentRomStart + (R_MAP_TEX_INDEX * 2040),
|
||||
2040, "../z_kaleido_scope_PAL.c", 3467);
|
||||
DmaMgr_SendRequest1(interfaceCtx->mapSegment,
|
||||
(uintptr_t)_map_48x85_staticSegmentRomStart + (R_MAP_TEX_INDEX * 2040), 2040,
|
||||
"../z_kaleido_scope_PAL.c", 3467);
|
||||
|
||||
DmaMgr_SendRequest1(interfaceCtx->mapSegment + 0x800,
|
||||
(u32)_map_48x85_staticSegmentRomStart + ((R_MAP_TEX_INDEX + 1) * 2040), 2040,
|
||||
(uintptr_t)_map_48x85_staticSegmentRomStart + ((R_MAP_TEX_INDEX + 1) * 2040), 2040,
|
||||
"../z_kaleido_scope_PAL.c", 3471);
|
||||
}
|
||||
|
||||
|
@ -2522,16 +2523,16 @@ void KaleidoScope_Update(PlayState* play) {
|
|||
pauseCtx->unk_204 = -314.0f;
|
||||
|
||||
//! @bug messed up alignment, should match `ALIGN64`
|
||||
pauseCtx->playerSegment = (void*)(((u32)play->objectCtx.spaceStart + 0x30) & ~0x3F);
|
||||
pauseCtx->playerSegment = (void*)(((uintptr_t)play->objectCtx.spaceStart + 0x30) & ~0x3F);
|
||||
|
||||
size1 = func_80091738(play, pauseCtx->playerSegment, &pauseCtx->playerSkelAnime);
|
||||
osSyncPrintf("プレイヤー size1=%x\n", size1);
|
||||
|
||||
pauseCtx->iconItemSegment = (void*)ALIGN16((u32)pauseCtx->playerSegment + size1);
|
||||
pauseCtx->iconItemSegment = (void*)ALIGN16((uintptr_t)pauseCtx->playerSegment + size1);
|
||||
|
||||
size0 = (u32)_icon_item_staticSegmentRomEnd - (u32)_icon_item_staticSegmentRomStart;
|
||||
size0 = (uintptr_t)_icon_item_staticSegmentRomEnd - (uintptr_t)_icon_item_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item size0=%x\n", size0);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemSegment, (u32)_icon_item_staticSegmentRomStart, size0,
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemSegment, (uintptr_t)_icon_item_staticSegmentRomStart, size0,
|
||||
"../z_kaleido_scope_PAL.c", 3662);
|
||||
|
||||
gSegments[8] = VIRTUAL_TO_PHYSICAL(pauseCtx->iconItemSegment);
|
||||
|
@ -2542,14 +2543,14 @@ void KaleidoScope_Update(PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
pauseCtx->iconItem24Segment = (void*)ALIGN16((u32)pauseCtx->iconItemSegment + size0);
|
||||
pauseCtx->iconItem24Segment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemSegment + size0);
|
||||
|
||||
size = (u32)_icon_item_24_staticSegmentRomEnd - (u32)_icon_item_24_staticSegmentRomStart;
|
||||
size = (uintptr_t)_icon_item_24_staticSegmentRomEnd - (uintptr_t)_icon_item_24_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item24 size=%x\n", size);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItem24Segment, (u32)_icon_item_24_staticSegmentRomStart, size,
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItem24Segment, (uintptr_t)_icon_item_24_staticSegmentRomStart, size,
|
||||
"../z_kaleido_scope_PAL.c", 3675);
|
||||
|
||||
pauseCtx->iconItemAltSegment = (void*)ALIGN16((u32)pauseCtx->iconItem24Segment + size);
|
||||
pauseCtx->iconItemAltSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItem24Segment + size);
|
||||
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
|
@ -2571,10 +2572,12 @@ void KaleidoScope_Update(PlayState* play) {
|
|||
case SCENE_JYASINBOSS:
|
||||
case SCENE_HAKADAN_BS:
|
||||
sInDungeonScene = true;
|
||||
size2 = (u32)_icon_item_dungeon_staticSegmentRomEnd - (u32)_icon_item_dungeon_staticSegmentRomStart;
|
||||
size2 = (uintptr_t)_icon_item_dungeon_staticSegmentRomEnd -
|
||||
(uintptr_t)_icon_item_dungeon_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item_dungeon dungeon-size2=%x\n", size2);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemAltSegment, (u32)_icon_item_dungeon_staticSegmentRomStart,
|
||||
size2, "../z_kaleido_scope_PAL.c", 3712);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemAltSegment,
|
||||
(uintptr_t)_icon_item_dungeon_staticSegmentRomStart, size2,
|
||||
"../z_kaleido_scope_PAL.c", 3712);
|
||||
|
||||
interfaceCtx->mapPalette[28] = 6;
|
||||
interfaceCtx->mapPalette[29] = 99;
|
||||
|
@ -2583,33 +2586,34 @@ void KaleidoScope_Update(PlayState* play) {
|
|||
|
||||
default:
|
||||
sInDungeonScene = false;
|
||||
size2 = (u32)_icon_item_field_staticSegmentRomEnd - (u32)_icon_item_field_staticSegmentRomStart;
|
||||
size2 = (uintptr_t)_icon_item_field_staticSegmentRomEnd -
|
||||
(uintptr_t)_icon_item_field_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item_field field-size2=%x\n", size2);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemAltSegment, (u32)_icon_item_field_staticSegmentRomStart,
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemAltSegment, (uintptr_t)_icon_item_field_staticSegmentRomStart,
|
||||
size2, "../z_kaleido_scope_PAL.c", 3726);
|
||||
break;
|
||||
}
|
||||
|
||||
pauseCtx->iconItemLangSegment = (void*)ALIGN16((u32)pauseCtx->iconItemAltSegment + size2);
|
||||
pauseCtx->iconItemLangSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemAltSegment + size2);
|
||||
|
||||
if (gSaveContext.language == LANGUAGE_ENG) {
|
||||
size = (u32)_icon_item_nes_staticSegmentRomEnd - (u32)_icon_item_nes_staticSegmentRomStart;
|
||||
size = (uintptr_t)_icon_item_nes_staticSegmentRomEnd - (uintptr_t)_icon_item_nes_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item_dungeon dungeon-size=%x\n", size);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (u32)_icon_item_nes_staticSegmentRomStart, size,
|
||||
"../z_kaleido_scope_PAL.c", 3739);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (uintptr_t)_icon_item_nes_staticSegmentRomStart,
|
||||
size, "../z_kaleido_scope_PAL.c", 3739);
|
||||
} else if (gSaveContext.language == LANGUAGE_GER) {
|
||||
size = (u32)_icon_item_ger_staticSegmentRomEnd - (u32)_icon_item_ger_staticSegmentRomStart;
|
||||
size = (uintptr_t)_icon_item_ger_staticSegmentRomEnd - (uintptr_t)_icon_item_ger_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item_dungeon dungeon-size=%x\n", size);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (u32)_icon_item_ger_staticSegmentRomStart, size,
|
||||
"../z_kaleido_scope_PAL.c", 3746);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (uintptr_t)_icon_item_ger_staticSegmentRomStart,
|
||||
size, "../z_kaleido_scope_PAL.c", 3746);
|
||||
} else {
|
||||
size = (u32)_icon_item_fra_staticSegmentRomEnd - (u32)_icon_item_fra_staticSegmentRomStart;
|
||||
size = (uintptr_t)_icon_item_fra_staticSegmentRomEnd - (uintptr_t)_icon_item_fra_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item_dungeon dungeon-size=%x\n", size);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (u32)_icon_item_fra_staticSegmentRomStart, size,
|
||||
"../z_kaleido_scope_PAL.c", 3753);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (uintptr_t)_icon_item_fra_staticSegmentRomStart,
|
||||
size, "../z_kaleido_scope_PAL.c", 3753);
|
||||
}
|
||||
|
||||
pauseCtx->nameSegment = (void*)ALIGN16((u32)pauseCtx->iconItemLangSegment + size);
|
||||
pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size);
|
||||
|
||||
osSyncPrintf("サイズ=%x\n", size2 + size1 + size0 + size);
|
||||
osSyncPrintf("item_name I_N_PT=%x\n", 0x800);
|
||||
|
@ -2619,23 +2623,23 @@ void KaleidoScope_Update(PlayState* play) {
|
|||
if (((void)0, gSaveContext.worldMapArea) < 22) {
|
||||
if (gSaveContext.language == LANGUAGE_ENG) {
|
||||
DmaMgr_SendRequest1(pauseCtx->nameSegment + 0x400,
|
||||
(u32)_map_name_staticSegmentRomStart +
|
||||
(uintptr_t)_map_name_staticSegmentRomStart +
|
||||
(((void)0, gSaveContext.worldMapArea) * 0xA00) + 0x9000,
|
||||
0xA00, "../z_kaleido_scope_PAL.c", 3776);
|
||||
} else if (gSaveContext.language == LANGUAGE_GER) {
|
||||
DmaMgr_SendRequest1(pauseCtx->nameSegment + 0x400,
|
||||
(u32)_map_name_staticSegmentRomStart +
|
||||
(uintptr_t)_map_name_staticSegmentRomStart +
|
||||
(((void)0, gSaveContext.worldMapArea) * 0xA00) + 0x16C00,
|
||||
0xA00, "../z_kaleido_scope_PAL.c", 3780);
|
||||
} else {
|
||||
DmaMgr_SendRequest1(pauseCtx->nameSegment + 0x400,
|
||||
(u32)_map_name_staticSegmentRomStart +
|
||||
(uintptr_t)_map_name_staticSegmentRomStart +
|
||||
(((void)0, gSaveContext.worldMapArea) * 0xA00) + 0x24800,
|
||||
0xA00, "../z_kaleido_scope_PAL.c", 3784);
|
||||
}
|
||||
}
|
||||
|
||||
sPreRenderCvg = (void*)ALIGN16((u32)pauseCtx->nameSegment + 0x400 + 0xA00);
|
||||
sPreRenderCvg = (void*)ALIGN16((uintptr_t)pauseCtx->nameSegment + 0x400 + 0xA00);
|
||||
|
||||
PreRender_Init(&sPlayerPreRender);
|
||||
PreRender_SetValuesSave(&sPlayerPreRender, PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT,
|
||||
|
@ -3139,41 +3143,42 @@ void KaleidoScope_Update(PlayState* play) {
|
|||
Interface_ChangeAlpha(1);
|
||||
|
||||
//! @bug messed up alignment, should match `ALIGN64`
|
||||
pauseCtx->iconItemSegment = (void*)(((u32)play->objectCtx.spaceStart + 0x30) & ~0x3F);
|
||||
size0 = (u32)_icon_item_staticSegmentRomEnd - (u32)_icon_item_staticSegmentRomStart;
|
||||
pauseCtx->iconItemSegment = (void*)(((uintptr_t)play->objectCtx.spaceStart + 0x30) & ~0x3F);
|
||||
size0 = (uintptr_t)_icon_item_staticSegmentRomEnd - (uintptr_t)_icon_item_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item size0=%x\n", size0);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemSegment, (u32)_icon_item_staticSegmentRomStart, size0,
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemSegment, (uintptr_t)_icon_item_staticSegmentRomStart, size0,
|
||||
"../z_kaleido_scope_PAL.c", 4356);
|
||||
|
||||
pauseCtx->iconItem24Segment = (void*)ALIGN16((u32)pauseCtx->iconItemSegment + size0);
|
||||
size = (u32)_icon_item_24_staticSegmentRomEnd - (u32)_icon_item_24_staticSegmentRomStart;
|
||||
pauseCtx->iconItem24Segment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemSegment + size0);
|
||||
size = (uintptr_t)_icon_item_24_staticSegmentRomEnd - (uintptr_t)_icon_item_24_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item24 size=%x\n", size);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItem24Segment, (u32)_icon_item_24_staticSegmentRomStart, size,
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItem24Segment, (uintptr_t)_icon_item_24_staticSegmentRomStart, size,
|
||||
"../z_kaleido_scope_PAL.c", 4363);
|
||||
|
||||
pauseCtx->iconItemAltSegment = (void*)ALIGN16((u32)pauseCtx->iconItem24Segment + size);
|
||||
size2 = (u32)_icon_item_gameover_staticSegmentRomEnd - (u32)_icon_item_gameover_staticSegmentRomStart;
|
||||
pauseCtx->iconItemAltSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItem24Segment + size);
|
||||
size2 = (uintptr_t)_icon_item_gameover_staticSegmentRomEnd -
|
||||
(uintptr_t)_icon_item_gameover_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item_dungeon gameover-size2=%x\n", size2);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemAltSegment, (u32)_icon_item_gameover_staticSegmentRomStart, size2,
|
||||
"../z_kaleido_scope_PAL.c", 4370);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemAltSegment, (uintptr_t)_icon_item_gameover_staticSegmentRomStart,
|
||||
size2, "../z_kaleido_scope_PAL.c", 4370);
|
||||
|
||||
pauseCtx->iconItemLangSegment = (void*)ALIGN16((u32)pauseCtx->iconItemAltSegment + size2);
|
||||
pauseCtx->iconItemLangSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemAltSegment + size2);
|
||||
|
||||
if (gSaveContext.language == LANGUAGE_ENG) {
|
||||
size = (u32)_icon_item_nes_staticSegmentRomEnd - (u32)_icon_item_nes_staticSegmentRomStart;
|
||||
size = (uintptr_t)_icon_item_nes_staticSegmentRomEnd - (uintptr_t)_icon_item_nes_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item_dungeon dungeon-size=%x\n", size);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (u32)_icon_item_nes_staticSegmentRomStart, size,
|
||||
"../z_kaleido_scope_PAL.c", 4379);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (uintptr_t)_icon_item_nes_staticSegmentRomStart,
|
||||
size, "../z_kaleido_scope_PAL.c", 4379);
|
||||
} else if (gSaveContext.language == LANGUAGE_GER) {
|
||||
size = (u32)_icon_item_ger_staticSegmentRomEnd - (u32)_icon_item_ger_staticSegmentRomStart;
|
||||
size = (uintptr_t)_icon_item_ger_staticSegmentRomEnd - (uintptr_t)_icon_item_ger_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item_dungeon dungeon-size=%x\n", size);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (u32)_icon_item_ger_staticSegmentRomStart, size,
|
||||
"../z_kaleido_scope_PAL.c", 4386);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (uintptr_t)_icon_item_ger_staticSegmentRomStart,
|
||||
size, "../z_kaleido_scope_PAL.c", 4386);
|
||||
} else {
|
||||
size = (u32)_icon_item_fra_staticSegmentRomEnd - (u32)_icon_item_fra_staticSegmentRomStart;
|
||||
size = (uintptr_t)_icon_item_fra_staticSegmentRomEnd - (uintptr_t)_icon_item_fra_staticSegmentRomStart;
|
||||
osSyncPrintf("icon_item_dungeon dungeon-size=%x\n", size);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (u32)_icon_item_fra_staticSegmentRomStart, size,
|
||||
"../z_kaleido_scope_PAL.c", 4393);
|
||||
DmaMgr_SendRequest1(pauseCtx->iconItemLangSegment, (uintptr_t)_icon_item_fra_staticSegmentRomStart,
|
||||
size, "../z_kaleido_scope_PAL.c", 4393);
|
||||
}
|
||||
|
||||
D_8082AB8C = 255;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue