mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-22 06:52:03 +00:00
Match remaining GC retail versions (#2019)
* Match the remaining GC retail versions
* Fix BSS ordering for existing versions
* Disable clang-format for #pragma increment_block_number
* sramResetCode -> sSramResetCode
* Replace 0xFF3F with or-ing all buttons together
* Revert "Disable clang-format for #pragma increment_block_number"
This reverts commit 406b6d26c9
.
---------
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
parent
cd2264f018
commit
d495436190
59 changed files with 11405 additions and 49 deletions
|
@ -28,6 +28,34 @@ ActorProfile En_Mag_Profile = {
|
|||
|
||||
static s16 sDelayTimer = 0;
|
||||
|
||||
#if OOT_VERSION < OOT_GC_US
|
||||
void EnMag_ResetSram(void) {
|
||||
static u8 buffer[0x2000];
|
||||
|
||||
bzero(buffer, 0x800);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000000), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8000800), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8001000), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8001800), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8002000), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8002800), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8003000), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8003800), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8004000), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8004800), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8005000), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8005800), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8006000), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8006800), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8007000), buffer, 0x800, 1);
|
||||
SsSram_ReadWrite(OS_K1_TO_PHYSICAL(0xA8007800), buffer, 0x800, 1);
|
||||
|
||||
gSaveContext.audioSetting = 0;
|
||||
gSaveContext.zTargetSetting = 0;
|
||||
func_800F6700(gSaveContext.audioSetting);
|
||||
}
|
||||
#endif
|
||||
|
||||
void EnMag_Init(Actor* thisx, PlayState* play) {
|
||||
EnMag* this = (EnMag*)thisx;
|
||||
|
||||
|
@ -109,10 +137,58 @@ void EnMag_Init(Actor* thisx, PlayState* play) {
|
|||
void EnMag_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
#if OOT_VERSION < OOT_GC_US
|
||||
void EnMag_CheckSramResetCode(PlayState* play, EnMag* this) {
|
||||
static s32 sSramResetCode[] = {
|
||||
BTN_DUP, BTN_DDOWN, BTN_DLEFT, BTN_DRIGHT, BTN_START, BTN_B, BTN_CDOWN,
|
||||
BTN_L, BTN_CRIGHT, BTN_CLEFT, BTN_A, BTN_CUP, BTN_R, BTN_Z,
|
||||
};
|
||||
s32 var_v1;
|
||||
|
||||
var_v1 =
|
||||
play->state.input[2].cur.button & (BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP | BTN_R | BTN_L | BTN_DRIGHT |
|
||||
BTN_DLEFT | BTN_DDOWN | BTN_DUP | BTN_START | BTN_Z | BTN_B | BTN_A);
|
||||
if (this->unk_E31C == var_v1) {
|
||||
this->unk_E320--;
|
||||
if (this->unk_E320 < 0) {
|
||||
this->unk_E320 = 1;
|
||||
} else {
|
||||
var_v1 ^= this->unk_E31C;
|
||||
}
|
||||
} else {
|
||||
this->unk_E320 = 16;
|
||||
this->unk_E31C = var_v1;
|
||||
}
|
||||
|
||||
if (this->unk_E316 < 4) {
|
||||
if (sSramResetCode[this->unk_E316] & var_v1) {
|
||||
this->unk_E316++;
|
||||
} else if (var_v1 != 0) {
|
||||
this->unk_E316 = 0;
|
||||
}
|
||||
} else {
|
||||
if (CHECK_BTN_ALL(play->state.input[2].press.button, sSramResetCode[this->unk_E316])) {
|
||||
this->unk_E316++;
|
||||
} else if (var_v1 != 0) {
|
||||
this->unk_E316 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->unk_E316 == ARRAY_COUNT(sSramResetCode)) {
|
||||
EnMag_ResetSram();
|
||||
this->unk_E316 = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void EnMag_Update(Actor* thisx, PlayState* play) {
|
||||
s32 pad[2];
|
||||
EnMag* this = (EnMag*)thisx;
|
||||
|
||||
#if OOT_VERSION < OOT_GC_US
|
||||
EnMag_CheckSramResetCode(play, this);
|
||||
#endif
|
||||
|
||||
if (gSaveContext.fileNum != 0xFEDC) {
|
||||
if (this->globalState < MAG_STATE_DISPLAY) {
|
||||
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START) ||
|
||||
|
@ -400,8 +476,10 @@ void EnMag_DrawCharTexture(Gfx** gfxP, u8* texture, s32 rectLeft, s32 rectTop) {
|
|||
// Title logo is shifted to the left in Master Quest
|
||||
#if !OOT_MQ
|
||||
#define LOGO_X_SHIFT 0
|
||||
#define JPN_SUBTITLE_X_SHIFT 0
|
||||
#else
|
||||
#define LOGO_X_SHIFT (-8)
|
||||
#define JPN_SUBTITLE_X_SHIFT (-32)
|
||||
#endif
|
||||
|
||||
void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) {
|
||||
|
@ -503,8 +581,17 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) {
|
|||
#if OOT_MQ
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, (s16)this->subAlpha);
|
||||
|
||||
#if OOT_VERSION == OOT_GC_JP_MQ
|
||||
EnMag_DrawImageRGBA32(&gfx, 235, 149, (u8*)gTitleUraLogoTex, 40, 40);
|
||||
#elif OOT_VERSION == OOT_GC_US_MQ
|
||||
if (gSaveContext.language == LANGUAGE_JPN) {
|
||||
EnMag_DrawImageRGBA32(&gfx, 235, 149, (u8*)gTitleUraLogoTex, 40, 40);
|
||||
} else {
|
||||
EnMag_DrawImageRGBA32(&gfx, 174, 145, (u8*)gTitleMasterQuestSubtitleTex, 128, 32);
|
||||
}
|
||||
#else
|
||||
EnMag_DrawImageRGBA32(&gfx, 174, 145, (u8*)gTitleMasterQuestSubtitleTex, 128, 32);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -520,8 +607,15 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) {
|
|||
}
|
||||
gDPSetCombineLERP(gfx++, TEXEL1, PRIMITIVE, PRIM_LOD_FRAC, TEXEL0, 0, 0, 0, TEXEL0, PRIMITIVE, ENVIRONMENT,
|
||||
COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0);
|
||||
|
||||
#if !OOT_MQ
|
||||
gDPSetPrimColor(gfx++, 0, 0x80, 255, 255, 170, (s16)this->subAlpha);
|
||||
gDPSetEnvColor(gfx++, 255, 150, 0, 255);
|
||||
#else
|
||||
gDPSetPrimColor(gfx++, 0, 0x80, 170, 255, 255, (s16)this->subAlpha);
|
||||
gDPSetEnvColor(gfx++, ZREG(34), 100 + ZREG(35), 255 + ZREG(36), 255);
|
||||
#endif
|
||||
|
||||
if ((s16)this->subAlpha != 0) {
|
||||
gDPLoadTextureBlock(gfx++, gTitleTitleJPNTex, G_IM_FMT_I, G_IM_SIZ_8b, 128, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
|
@ -530,7 +624,8 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) {
|
|||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, 2, 1);
|
||||
gDPSetTileSize(gfx++, 1, this->unk_E30C & 0x7F, this->effectScroll & 0x7F,
|
||||
(this->unk_E30C & 0x7F) + ((32 - 1) << 2), (this->effectScroll & 0x7F) + ((32 - 1) << 2));
|
||||
gSPTextureRectangle(gfx++, 424, 576, 424 + 512, 576 + 64, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
gSPTextureRectangle(gfx++, 424 + JPN_SUBTITLE_X_SHIFT, 576, 424 + JPN_SUBTITLE_X_SHIFT + 512, 576 + 64,
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -544,7 +639,11 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxP) {
|
|||
(s16)this->copyrightAlpha);
|
||||
|
||||
if ((s16)this->copyrightAlpha != 0) {
|
||||
#if OOT_NTSC
|
||||
#if OOT_VERSION < OOT_GC_US
|
||||
gDPLoadTextureBlock(gfx++, gTitleCopyright19982002Tex, G_IM_FMT_IA, G_IM_SIZ_8b, 160, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
#elif OOT_NTSC
|
||||
if (gSaveContext.language == LANGUAGE_JPN) {
|
||||
gDPLoadTextureBlock(gfx++, gTitleCopyright19982002Tex, G_IM_FMT_IA, G_IM_SIZ_8b, 160, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue