mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-13 17:07:44 +00:00
Match NTSC z_parameter.c and z_construct.c (#1987)
* Match NTSC z_parameter.c and z_construct.c * Comment which REG collide * Use new REGs everywhere * Use new REGs everywhere for real
This commit is contained in:
parent
4fbb48177f
commit
c83b93aae4
7 changed files with 88 additions and 14 deletions
|
@ -173,7 +173,7 @@
|
|||
<Texture Name="gNamePanelRightTex" OutName="name_panel_right" Format="ia8" Width="72" Height="24" Offset="0x86E80"/>
|
||||
<Texture Name="gLButtonTex" OutName="l_button" Format="ia8" Width="24" Height="32" Offset="0x87540"/>
|
||||
<Texture Name="gRButtonTex" OutName="r_button" Format="ia8" Width="24" Height="32" Offset="0x87840"/>
|
||||
<Texture Name="gUnknownJPTex" OutName="unknown_JP" Format="ia8" Width="80" Height="16" Offset="0x87B40"/>
|
||||
<Texture Name="gUnknownJPNTex" OutName="unknown_jpn" Format="ia8" Width="80" Height="16" Offset="0x87B40"/>
|
||||
<Texture Name="gSongNoteTex" OutName="song_note" Format="ia8" Width="16" Height="24" Offset="0x88040"/>
|
||||
<Texture Name="gMagicArrowEquipEffectTex" OutName="magic_arrow_equip_effect" Format="ia8" Width="32" Height="32" Offset="0x881C0"/>
|
||||
<DList Name="gItemNamePanelDL" Offset="0x885C0"/>
|
||||
|
|
|
@ -175,7 +175,7 @@
|
|||
<Texture Name="gNamePanelRightTex" OutName="name_panel_right" Format="ia8" Width="72" Height="24" Offset="0x88280"/>
|
||||
<Texture Name="gLButtonTex" OutName="l_button" Format="ia8" Width="24" Height="32" Offset="0x88940"/>
|
||||
<Texture Name="gRButtonTex" OutName="r_button" Format="ia8" Width="24" Height="32" Offset="0x88C40"/>
|
||||
<Texture Name="gUnknownJPTex" OutName="unknown_JP" Format="ia8" Width="80" Height="16" Offset="0x88F40"/>
|
||||
<Texture Name="gUnknownJPNTex" OutName="unknown_jpn" Format="ia8" Width="80" Height="16" Offset="0x88F40"/>
|
||||
<Texture Name="gSongNoteTex" OutName="song_note" Format="ia8" Width="16" Height="24" Offset="0x89440"/>
|
||||
<Texture Name="gMagicArrowEquipEffectTex" OutName="magic_arrow_equip_effect" Format="ia8" Width="32" Height="32" Offset="0x895C0"/>
|
||||
<DList Name="gItemNamePanelDL" Offset="0x899C0"/>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<Texture Name="gOcarinaBtnIconCLeftTex" OutName="ocarina_c_left" Format="ia8" Width="16" Height="16" Offset="0x2C40"/>
|
||||
<Texture Name="gOcarinaBtnIconCUpTex" OutName="ocarina_c_up" Format="ia8" Width="16" Height="16" Offset="0x2D40"/>
|
||||
<Texture Name="gOcarinaTrebleClefTex" OutName="ocarina_treble_clef" Format="i4" Width="16" Height="32" Offset="0x2E40"/>
|
||||
<Texture Name="gNaviCUpJPTex" OutName="navi_c_up_jp" Format="ia4" Width="32" Height="8" Offset="0x2F40"/>
|
||||
<Texture Name="gNaviCUpJPNTex" OutName="navi_c_up_jpn" Format="ia4" Width="32" Height="8" Offset="0x2F40"/>
|
||||
<Texture Name="gNaviCUpENGTex" OutName="navi_c_up_eng" Format="ia4" Width="32" Height="8" Offset="0x2FC0"/>
|
||||
<Texture Name="gCounterDigit0Tex" OutName="counter_digit_0" Format="i8" Width="8" Height="16" Offset="0x3040"/>
|
||||
<Texture Name="gCounterDigit1Tex" OutName="counter_digit_1" Format="i8" Width="8" Height="16" Offset="0x30C0"/>
|
||||
|
|
|
@ -112,9 +112,18 @@
|
|||
#define R_PAUSE_PAGE_SWITCH_FRAME_ADVANCE_ON ZREG(13)
|
||||
#define R_C_BTN_COLOR(i) ZREG(39 + (i))
|
||||
#define R_B_BTN_COLOR(i) ZREG(43 + (i))
|
||||
#if OOT_NTSC
|
||||
#define R_START_LABEL_SCALE ZREG(48)
|
||||
#define R_START_LABEL_DD(i) ZREG(49 + (i))
|
||||
#define R_START_LABEL_WIDTH ZREG(51)
|
||||
#define R_START_LABEL_HEIGHT ZREG(52)
|
||||
#define R_START_LABEL_Y(i) ZREG(53 + (i))
|
||||
#define R_START_LABEL_X(i) ZREG(55 + (i))
|
||||
#else
|
||||
#define R_START_LABEL_DD(i) ZREG(48 + (i))
|
||||
#define R_START_LABEL_Y(i) ZREG(51 + (i))
|
||||
#define R_START_LABEL_X(i) ZREG(54 + (i))
|
||||
#endif
|
||||
#define R_C_UP_BTN_X ZREG(62)
|
||||
#define R_C_UP_BTN_Y ZREG(63)
|
||||
#define R_START_BTN_X ZREG(68)
|
||||
|
@ -164,11 +173,21 @@
|
|||
#define R_ROOM_CULL_USED_ENTRIES iREG(88)
|
||||
#define R_ROOM_CULL_DEBUG_TARGET iREG(89)
|
||||
#define R_B_LABEL_DD WREG(0)
|
||||
#if OOT_NTSC
|
||||
#define R_B_LABEL_SCALE(i) WREG(8 + (i))
|
||||
#define R_B_LABEL_X(i) WREG(10 + (i))
|
||||
#define R_B_LABEL_Y(i) WREG(12 + (i))
|
||||
#define R_A_LABEL_Z(i) WREG(14 + (i))
|
||||
#endif
|
||||
#define R_OW_MINIMAP_X WREG(29)
|
||||
#define R_OW_MINIMAP_Y WREG(30)
|
||||
#define R_MINIMAP_DISABLED WREG(31)
|
||||
#if OOT_PAL
|
||||
#define R_B_LABEL_SCALE(i) WREG(37 + (i))
|
||||
#define R_B_LABEL_X(i) WREG(40 + (i))
|
||||
#define R_B_LABEL_Y(i) WREG(43 + (i))
|
||||
#define R_A_LABEL_Z(i) WREG(46 + (i))
|
||||
#endif
|
||||
#define R_DGN_MINIMAP_X WREG(68)
|
||||
#define R_DGN_MINIMAP_Y WREG(69)
|
||||
#define R_TEXTBOX_X VREG(0)
|
||||
|
|
|
@ -328,6 +328,17 @@ void Regs_InitDataImpl(void) {
|
|||
R_C_BTN_COLOR(2) = 0;
|
||||
ZREG(46) = 1;
|
||||
ZREG(47) = 1;
|
||||
|
||||
#if OOT_NTSC
|
||||
R_START_LABEL_DD(0) = 86;
|
||||
R_START_LABEL_DD(1) = 100;
|
||||
R_START_LABEL_WIDTH = 0;
|
||||
R_START_LABEL_HEIGHT = 0;
|
||||
R_START_LABEL_Y(0) = 21;
|
||||
R_START_LABEL_Y(1) = 20;
|
||||
R_START_LABEL_X(0) = 122;
|
||||
R_START_LABEL_X(1) = 120;
|
||||
#else
|
||||
R_START_LABEL_DD(0) = 100;
|
||||
R_START_LABEL_DD(1) = 89;
|
||||
R_START_LABEL_DD(2) = 92;
|
||||
|
@ -337,6 +348,8 @@ void Regs_InitDataImpl(void) {
|
|||
R_START_LABEL_X(0) = 120;
|
||||
R_START_LABEL_X(1) = 119;
|
||||
R_START_LABEL_X(2) = 119;
|
||||
#endif
|
||||
|
||||
ZREG(61) = 1;
|
||||
R_C_UP_BTN_X = C_UP_BUTTON_X;
|
||||
R_C_UP_BTN_Y = C_UP_BUTTON_Y;
|
||||
|
@ -464,6 +477,18 @@ void Regs_InitDataImpl(void) {
|
|||
WREG(5) = 3;
|
||||
WREG(6) = 8;
|
||||
WREG(7) = 0;
|
||||
|
||||
#if OOT_NTSC
|
||||
R_B_LABEL_SCALE(0) = 100;
|
||||
R_B_LABEL_SCALE(1) = 109;
|
||||
R_B_LABEL_X(0) = 151;
|
||||
R_B_LABEL_X(1) = 148;
|
||||
R_B_LABEL_Y(0) = 23;
|
||||
R_B_LABEL_Y(1) = 22;
|
||||
R_A_LABEL_Z(0) = -380;
|
||||
R_A_LABEL_Z(1) = -350;
|
||||
#else
|
||||
// Same as above, although these regs are now unused in PAL versions
|
||||
WREG(8) = 100;
|
||||
WREG(9) = 109;
|
||||
WREG(10) = 151;
|
||||
|
@ -472,6 +497,8 @@ void Regs_InitDataImpl(void) {
|
|||
WREG(13) = 22;
|
||||
WREG(14) = -380;
|
||||
WREG(15) = -350;
|
||||
#endif
|
||||
|
||||
WREG(16) = -175;
|
||||
WREG(17) = 155;
|
||||
WREG(18) = 10;
|
||||
|
@ -492,18 +519,20 @@ void Regs_InitDataImpl(void) {
|
|||
WREG(33) = 60;
|
||||
WREG(35) = 0;
|
||||
WREG(36) = 0;
|
||||
WREG(37) = 100;
|
||||
WREG(38) = 99;
|
||||
WREG(39) = 109;
|
||||
|
||||
#if OOT_PAL
|
||||
R_B_LABEL_SCALE(0) = 100;
|
||||
R_B_LABEL_SCALE(1) = 99;
|
||||
R_B_LABEL_SCALE(2) = 109;
|
||||
R_B_LABEL_X(0) = B_BUTTON_X - 9;
|
||||
R_B_LABEL_X(1) = B_BUTTON_X - 11;
|
||||
R_B_LABEL_X(2) = B_BUTTON_X - 12;
|
||||
R_B_LABEL_Y(0) = B_BUTTON_Y + 6;
|
||||
R_B_LABEL_Y(1) = B_BUTTON_Y + 5;
|
||||
R_B_LABEL_Y(2) = B_BUTTON_Y + 5;
|
||||
WREG(46) = -380;
|
||||
WREG(47) = -360;
|
||||
WREG(48) = -350;
|
||||
R_A_LABEL_Z(0) = -380;
|
||||
R_A_LABEL_Z(1) = -360;
|
||||
R_A_LABEL_Z(2) = -350;
|
||||
WREG(49) = -48;
|
||||
WREG(50) = 16;
|
||||
WREG(51) = -62;
|
||||
|
@ -522,6 +551,8 @@ void Regs_InitDataImpl(void) {
|
|||
WREG(64) = -37;
|
||||
WREG(65) = 30;
|
||||
WREG(66) = -50;
|
||||
#endif
|
||||
|
||||
R_DGN_MINIMAP_X = 204;
|
||||
R_DGN_MINIMAP_Y = 140;
|
||||
WREG(87) = 80;
|
||||
|
|
|
@ -83,8 +83,8 @@ void KaleidoSetup_Update(PlayState* play) {
|
|||
// mainState is also overwritten later before being used.
|
||||
pauseCtx->mainState = PAUSE_MAIN_STATE_SWITCHING_PAGE;
|
||||
|
||||
//! @bug REG collision
|
||||
if (R_START_LABEL_DD(0) == 0) {
|
||||
//! @bug REG collision, ZREG(48) is also R_START_LABEL_SCALE for NTSC and R_START_LABEL_DD(0) for PAL
|
||||
if (ZREG(48) == 0) {
|
||||
// Never reached, unused, and the data would be wrong anyway
|
||||
// (scrolling left from this would not bring to the initial page)
|
||||
pauseCtx->eye.x = sKaleidoSetupUnusedEyeX[pauseCtx->pageIndex];
|
||||
|
|
|
@ -2097,7 +2097,11 @@ void func_80086D5C(s32* buf, u16 size) {
|
|||
}
|
||||
|
||||
void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 loadOffset) {
|
||||
#if OOT_NTSC
|
||||
static void* sDoActionTextures[] = { gAttackDoActionJPNTex, gCheckDoActionJPNTex };
|
||||
#else
|
||||
static void* sDoActionTextures[] = { gAttackDoActionENGTex, gCheckDoActionENGTex };
|
||||
#endif
|
||||
|
||||
if (action >= DO_ACTION_MAX) {
|
||||
action = DO_ACTION_NONE;
|
||||
|
@ -2762,15 +2766,17 @@ void Interface_DrawActionLabel(GraphicsContext* gfxCtx, void* texture) {
|
|||
}
|
||||
|
||||
void Interface_DrawItemButtons(PlayState* play) {
|
||||
static void* cUpLabelTextures[] = { gNaviCUpENGTex, gNaviCUpENGTex, gNaviCUpENGTex };
|
||||
static void* cUpLabelTextures[] = LANGUAGE_ARRAY(gNaviCUpJPNTex, gNaviCUpENGTex, gNaviCUpENGTex, gNaviCUpENGTex);
|
||||
static s16 startButtonLeftPos[] = { 132, 130, 130 };
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
Player* player = GET_PLAYER(play);
|
||||
PauseContext* pauseCtx = &play->pauseCtx;
|
||||
s16 temp; // Used as both an alpha value and a button index
|
||||
#if OOT_PAL
|
||||
s16 texCoordScale;
|
||||
s16 width;
|
||||
s16 height;
|
||||
#endif
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_parameter.c", 2900);
|
||||
|
||||
|
@ -2811,9 +2817,16 @@ void Interface_DrawItemButtons(PlayState* play) {
|
|||
// Start Button Texture, Color & Label
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 120, 120, interfaceCtx->startAlpha);
|
||||
|
||||
#if OOT_NTSC
|
||||
gSPTextureRectangle(OVERLAY_DISP++, 132 << 2, 17 << 2, (132 + 22) << 2, 39 << 2, G_TX_RENDERTILE, 0, 0,
|
||||
(s32)(1.4277344 * (1 << 10)), (s32)(1.4277344 * (1 << 10)));
|
||||
#else
|
||||
gSPTextureRectangle(OVERLAY_DISP++, startButtonLeftPos[gSaveContext.language] << 2, 17 << 2,
|
||||
(startButtonLeftPos[gSaveContext.language] + 22) << 2, 39 << 2, G_TX_RENDERTILE, 0, 0,
|
||||
(s32)(1.4277344 * (1 << 10)), (s32)(1.4277344 * (1 << 10)));
|
||||
#endif
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->startAlpha);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
|
||||
|
@ -2824,6 +2837,16 @@ void Interface_DrawItemButtons(PlayState* play) {
|
|||
DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
#if OOT_NTSC
|
||||
R_START_LABEL_SCALE = (1 << 10) / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
R_START_LABEL_WIDTH = DO_ACTION_TEX_WIDTH / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
R_START_LABEL_HEIGHT = DO_ACTION_TEX_HEIGHT / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
gSPTextureRectangle(OVERLAY_DISP++, R_START_LABEL_X(gSaveContext.language) << 2,
|
||||
R_START_LABEL_Y(gSaveContext.language) << 2,
|
||||
(R_START_LABEL_X(gSaveContext.language) + R_START_LABEL_WIDTH) << 2,
|
||||
(R_START_LABEL_Y(gSaveContext.language) + R_START_LABEL_HEIGHT) << 2, G_TX_RENDERTILE,
|
||||
0, 0, R_START_LABEL_SCALE, R_START_LABEL_SCALE);
|
||||
#else
|
||||
texCoordScale = (1 << 10) / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
width = DO_ACTION_TEX_WIDTH / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
height = DO_ACTION_TEX_HEIGHT / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
|
||||
|
@ -2832,6 +2855,7 @@ void Interface_DrawItemButtons(PlayState* play) {
|
|||
(R_START_LABEL_X(gSaveContext.language) + width) << 2,
|
||||
(R_START_LABEL_Y(gSaveContext.language) + height) << 2, G_TX_RENDERTILE, 0, 0,
|
||||
texCoordScale, texCoordScale);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3285,7 +3309,7 @@ void Interface_Draw(PlayState* play) {
|
|||
DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
R_B_LABEL_DD = (1 << 10) / (WREG(37 + gSaveContext.language) / 100.0f);
|
||||
R_B_LABEL_DD = (1 << 10) / (R_B_LABEL_SCALE(gSaveContext.language) / 100.0f);
|
||||
gSPTextureRectangle(OVERLAY_DISP++, R_B_LABEL_X(gSaveContext.language) << 2,
|
||||
R_B_LABEL_Y(gSaveContext.language) << 2,
|
||||
(R_B_LABEL_X(gSaveContext.language) + DO_ACTION_TEX_WIDTH) << 2,
|
||||
|
@ -3347,7 +3371,7 @@ void Interface_Draw(PlayState* play) {
|
|||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
|
||||
Matrix_Translate(0.0f, 0.0f, WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW);
|
||||
Matrix_Translate(0.0f, 0.0f, R_A_LABEL_Z(gSaveContext.language) / 10.0f, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_parameter.c", 3701),
|
||||
|
|
Loading…
Add table
Reference in a new issue