diff options
| author | cadmic <cadmic24@gmail.com> | 2024-08-09 17:58:46 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-09 20:58:46 -0400 |
| commit | d495436190f246c1e79ed6879206d59b2fab6fd4 (patch) | |
| tree | 34073dc1f3e4d79ade6fc73852c9b2f1ddab3d84 /src/code | |
| parent | cd2264f0180268c2c42351a96090769187ac5b18 (diff) | |
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 406b6d26c92911c676a7ea9f07a1612211760e11.
---------
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/fault.c | 3 | ||||
| -rw-r--r-- | src/code/main.c | 2 | ||||
| -rw-r--r-- | src/code/sys_math3d.c | 2 | ||||
| -rw-r--r-- | src/code/z_actor.c | 4 | ||||
| -rw-r--r-- | src/code/z_camera.c | 4 | ||||
| -rw-r--r-- | src/code/z_collision_check.c | 4 | ||||
| -rw-r--r-- | src/code/z_common_data.c | 14 | ||||
| -rw-r--r-- | src/code/z_demo.c | 2 | ||||
| -rw-r--r-- | src/code/z_kaleido_scope_call.c | 2 | ||||
| -rw-r--r-- | src/code/z_kankyo.c | 4 | ||||
| -rw-r--r-- | src/code/z_message.c | 10 | ||||
| -rw-r--r-- | src/code/z_play.c | 6 |
12 files changed, 39 insertions, 18 deletions
diff --git a/src/code/fault.c b/src/code/fault.c index edd08f934..17d7a214d 100644 --- a/src/code/fault.c +++ b/src/code/fault.c @@ -44,7 +44,8 @@ #include "terminal.h" #include "alloca.h" -#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-eu-mq-dbg:0 gc-us:64" +#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-eu-mq-dbg:0 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64" \ + "gc-us-mq:64" void FaultDrawer_Init(void); void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled); diff --git a/src/code/main.c b/src/code/main.c index f0da0bd75..3dada1102 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -7,7 +7,7 @@ s32 gScreenWidth = SCREEN_WIDTH; s32 gScreenHeight = SCREEN_HEIGHT; u32 gSystemHeapSize = 0; -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-us:0" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" PreNmiBuff* gAppNmiBufferPtr; Scheduler gScheduler; diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 1904f90d1..6ac7482da 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -5,7 +5,7 @@ #include "macros.h" #include "sys_math3d.h" -#pragma increment_block_number "gc-eu:108 gc-eu-mq:108 gc-us:108" +#pragma increment_block_number "gc-eu:108 gc-eu-mq:108 gc-jp:108 gc-jp-ce:108 gc-jp-mq:108 gc-us:108 gc-us-mq:108" s32 Math3D_LineVsLineClosestTwoPoints(Vec3f* lineAPointA, Vec3f* lineAPointB, Vec3f* lineBPointA, Vec3f* lineBPointB, Vec3f* lineAClosestToB, Vec3f* lineBClosestToA); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 3703f069f..f41c55790 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -8,7 +8,7 @@ #include "assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "assets/objects/object_bdoor/object_bdoor.h" -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-us:0" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" static CollisionPoly* sCurCeilingPoly; static s32 sCurCeilingBgId; @@ -1905,7 +1905,7 @@ s32 func_8002F9EC(PlayState* play, Actor* actor, CollisionPoly* poly, s32 bgId, return false; } -#pragma increment_block_number "gc-eu:22 gc-eu-mq:22 gc-us:22" +#pragma increment_block_number "gc-eu:22 gc-eu-mq:22 gc-jp:22 gc-jp-ce:22 gc-jp-mq:22 gc-us:22 gc-us-mq:22" // Local data used for Farore's Wind light (stored in BSS) LightInfo D_8015BC00; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 14127cac9..ae9a744c5 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -4,7 +4,7 @@ #include "terminal.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-us:0" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" s16 Camera_RequestSettingImpl(Camera* camera, s16 requestedSetting, s16 flags); s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange); @@ -3630,7 +3630,7 @@ s32 Camera_KeepOn3(Camera* camera) { return 1; } -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-us:128" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" s32 Camera_KeepOn4(Camera* camera) { static Vec3f D_8015BD50; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 187409524..4303b0577 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -12,7 +12,7 @@ typedef s32 (*ColChkLineFunc)(PlayState*, CollisionCheckContext*, Collider*, Vec #define SAC_ENABLE (1 << 0) -#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-us:64" +#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64" #if OOT_DEBUG /** @@ -2693,7 +2693,7 @@ typedef enum { /* 2 */ MASSTYPE_NORMAL } ColChkMassType; -#pragma increment_block_number "gc-eu:252 gc-eu-mq:252 gc-us:252" +#pragma increment_block_number "gc-eu:252 gc-eu-mq:252 gc-jp:252 gc-jp-ce:252 gc-jp-mq:252 gc-us:252 gc-us-mq:252" /** * Get mass type. Immovable colliders cannot be pushed, while heavy colliders can only be pushed by heavy and immovable diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index 727aab214..08e018495 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -1,6 +1,7 @@ #include "global.h" +#include "region.h" -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-us:128" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" ALIGNED(16) SaveContext gSaveContext; u32 D_8015FA88; @@ -21,7 +22,16 @@ void SaveContext_Init(void) { gSaveContext.dogIsLost = true; gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT; gSaveContext.prevHudVisibilityMode = HUD_VISIBILITY_ALL; -#if OOT_NTSC +#if OOT_NTSC && OOT_VERSION < OOT_GC_US + if (gCurrentRegion == REGION_JP) { + gSaveContext.language = LANGUAGE_JPN; + } + if (gCurrentRegion == REGION_US) { + gSaveContext.language = LANGUAGE_ENG; + } +#elif OOT_VERSION == OOT_GC_US || OOT_VERSION == OOT_GC_US_MQ gSaveContext.language = LANGUAGE_ENG; +#elif OOT_VERSION == OOT_GC_JP_CE + gSaveContext.language = LANGUAGE_JPN; #endif } diff --git a/src/code/z_demo.c b/src/code/z_demo.c index ada81163d..efecba8de 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -120,7 +120,7 @@ u16 gCamAtSplinePointsAppliedFrame; u16 gCamEyePointAppliedFrame; u16 gCamAtPointAppliedFrame; -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-us:0" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0" // Cam ID to return to when a scripted cutscene is finished s16 sReturnToCamId; diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index f34d82fca..70932408f 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -1,7 +1,7 @@ #include "global.h" #include "terminal.h" -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-us:128" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" void (*sKaleidoScopeUpdateFunc)(PlayState* play); void (*sKaleidoScopeDrawFunc)(PlayState* play); diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index e7486d855..aeef9228c 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -7,7 +7,7 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-us:128" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" typedef enum { /* 0x00 */ LIGHTNING_BOLT_START, @@ -212,7 +212,7 @@ s16 sLightningFlashAlpha; s16 sSunDepthTestX; s16 sSunDepthTestY; -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-us:128" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" LightNode* sNGameOverLightNode; LightInfo sNGameOverLightInfo; diff --git a/src/code/z_message.c b/src/code/z_message.c index a4fede2ca..2aa9a3ff8 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -3850,7 +3850,9 @@ void Message_DrawDebugText(PlayState* play, Gfx** p) { void Message_Draw(PlayState* play) { Gfx* plusOne; Gfx* polyOpaP; - +#if OOT_VERSION < OOT_GC_US + s32 pad; +#endif #if OOT_DEBUG s16 watchVar; #endif @@ -3901,6 +3903,9 @@ void Message_Update(PlayState* play) { 0x0400, 0x0400, 0x0200, 0x0000, 0x1038, 0x0008, 0x200A, 0x088B, 0x0007, 0x0009, 0x000A, 0x107E, 0x2008, 0x2007, 0x0015, 0x0016, 0x0017, 0x0003, 0x0000, 0x270B, 0x00C8, 0x012C, 0x012D, 0xFFDA, 0x0014, 0x0016, 0x0014, 0x0016, }; +#if OOT_VERSION < OOT_GC_US + static s32 sUnknown = 0; +#endif static u8 D_80153D74 = 0; MessageContext* msgCtx = &play->msgCtx; InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -3911,6 +3916,9 @@ void Message_Update(PlayState* play) { s16 averageY; s16 playerFocusScreenPosY; s16 actorFocusScreenPosY; +#if OOT_VERSION < OOT_GC_US + s32 pad[2]; +#endif #if OOT_DEBUG if (BREG(0) != 0) { diff --git a/src/code/z_play.c b/src/code/z_play.c index 4f536524f..e211862d6 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -168,10 +168,12 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) { break; default: -#if OOT_NTSC +#if OOT_VERSION < OOT_GC_EU_MQ_DBG HUNGUP_AND_CRASH("../z_play.c", 2287); -#else +#elif OOT_VERSION < OOT_GC_JP_CE HUNGUP_AND_CRASH("../z_play.c", 2290); +#else + HUNGUP_AND_CRASH("../z_play.c", 2293); #endif break; } |
