pull in decomp updates for z_play (#4522)

This commit is contained in:
Archez 2024-11-07 11:52:21 -05:00 committed by GitHub
parent 1d9d273a57
commit 4eeb01905d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 492 additions and 496 deletions

12
soh/include/attributes.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef ATTRIBUTES_H
#define ATTRIBUTES_H
#if !defined(__GNUC__) && !defined(__attribute__)
#define __attribute__(x)
#endif
#define UNUSED __attribute__((unused))
#define FALLTHROUGH __attribute__((fallthrough))
#define NORETURN __attribute__((noreturn))
#endif

View File

@ -1536,9 +1536,9 @@ void KaleidoScopeCall_Init(PlayState* play);
void KaleidoScopeCall_Destroy(PlayState* play);
void KaleidoScopeCall_Update(PlayState* play);
void KaleidoScopeCall_Draw(PlayState* play);
void func_800BC490(PlayState* play, s16 point);
s32 func_800BC56C(PlayState* play, s16 arg1);
void func_800BC590(PlayState* play);
void Play_SetViewpoint(PlayState* play, s16 viewpoint);
s32 Play_CheckViewpoint(PlayState* play, s16 viewpoint);
void Play_SetShopBrowsingViewpoint(PlayState* play);
void Gameplay_SetupTransition(PlayState* play, s32 arg1);
Gfx* Play_SetFog(PlayState* play, Gfx* gfx);
void Play_Destroy(GameState* thisx);
@ -1552,7 +1552,7 @@ u8 CheckLACSRewardCount();
s32 Play_InCsMode(PlayState* play);
f32 func_800BFCB8(PlayState* play, MtxF* mf, Vec3f* vec);
void* Play_LoadFile(PlayState* play, RomFile* file);
void Play_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn);
void Play_SpawnScene(PlayState* play, s32 sceneId, s32 spawn);
void func_800C016C(PlayState* play, Vec3f* src, Vec3f* dest);
s16 Play_CreateSubCamera(PlayState* play);
s16 Play_GetActiveCamId(PlayState* play);

View File

@ -120,7 +120,7 @@ extern "C"
extern KaleidoMgrOverlay gKaleidoMgrOverlayTable[KALEIDO_OVL_MAX];
extern KaleidoMgrOverlay* gKaleidoMgrCurOvl;
extern u8 gBossMarkState;
extern void* D_8012D1F0;
extern void* gDebugCutsceneScript;
extern s32 gScreenWidth;
extern s32 gScreenHeight;
extern Mtx gMtxClear;

View File

@ -3,6 +3,7 @@
#include <libultraship/libultra.h>
#include "unk.h" // this used to get pulled in via ultra64.h
#include "attributes.h"
#include "z64save.h"
#include "z64light.h"
#include "z64bgcheck.h"

View File

@ -361,7 +361,7 @@ typedef enum {
/* 4 */ SCENE_LAYER_CUTSCENE_FIRST
} SceneLayer;
#define IS_CUTSCENE_LAYER (gSaveContext.sceneLayer >= SCENE_LAYER_CUTSCENE_FIRST)
#define IS_CUTSCENE_LAYER (gSaveContext.sceneSetupIndex >= SCENE_LAYER_CUTSCENE_FIRST)
typedef enum {
/* 0 */ LINK_AGE_ADULT,

View File

@ -19,19 +19,19 @@ Ship::IResource* OTRPlay_LoadFile(PlayState* play, const char* fileName)
return res.get();
}
extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) {
SceneTableEntry* scene = &gSceneTable[sceneNum];
extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) {
SceneTableEntry* scene = &gSceneTable[sceneId];
scene->unk_13 = 0;
play->loadedScene = scene;
play->sceneNum = sceneNum;
play->sceneNum = sceneId;
play->sceneConfig = scene->config;
//osSyncPrintf("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f);
// Scenes considered "dungeon" with a MQ variant
int16_t inNonSharedScene = (sceneNum >= SCENE_DEKU_TREE && sceneNum <= SCENE_ICE_CAVERN) ||
sceneNum == SCENE_GERUDO_TRAINING_GROUND || sceneNum == SCENE_INSIDE_GANONS_CASTLE;
int16_t inNonSharedScene = (sceneId >= SCENE_DEKU_TREE && sceneId <= SCENE_ICE_CAVERN) ||
sceneId == SCENE_GERUDO_TRAINING_GROUND || sceneId == SCENE_INSIDE_GANONS_CASTLE;
std::string sceneVersion = "shared";
if (inNonSharedScene) {

View File

@ -307,7 +307,7 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
break;
case 14:
if (sp3F != 0) {
func_800BC490(play, 1);
Play_SetViewpoint(play, 1);
}
break;
case 15:
@ -2052,7 +2052,7 @@ void func_80068C3C(PlayState* play, CutsceneContext* csCtx) {
csCtx->frames++;
if (dREG(95) != 0) {
Cutscene_ProcessCommands(play, csCtx, D_8012D1F0);
Cutscene_ProcessCommands(play, csCtx, gDebugCutsceneScript);
} else {
Cutscene_ProcessCommands(play, csCtx, play->csCtx.segment);
}

File diff suppressed because it is too large Load Diff

View File

@ -1097,7 +1097,7 @@ void func_80A0461C(EnElf* this, PlayState* play) {
} else {
arrowPointedActor = play->actorCtx.targetCtx.arrowPointedActor;
if ((player->stateFlags1 & PLAYER_STATE1_GETTING_ITEM) || ((YREG(15) & 0x10) && func_800BC56C(play, 2))) {
if ((player->stateFlags1 & PLAYER_STATE1_GETTING_ITEM) || ((YREG(15) & 0x10) && Play_CheckViewpoint(play, 2))) {
temp = 12;
this->unk_2C0 = 100;
} else if (arrowPointedActor == NULL || arrowPointedActor->category == ACTORCAT_NPC) {

View File

@ -679,7 +679,7 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) {
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
play->msgCtx.stateTimer = 4;
player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW;
func_800BC490(play, 1);
Play_SetViewpoint(play, 1);
Interface_ChangeAlpha(50);
this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false;
@ -763,7 +763,7 @@ void EnOssan_State_Idle(EnOssan* this, PlayState* play, Player* player) {
// "Start conversation!!"
osSyncPrintf(VT_FGCOL(YELLOW) "★★★ 会話開始!! ★★★" VT_RST "\n");
player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW;
func_800BC590(play);
Play_SetShopBrowsingViewpoint(play);
EnOssan_SetStateStartShopping(play, this, false);
} else if (this->actor.xzDistToPlayer < 100.0f) {
func_8002F2CC(&this->actor, play, 100);
@ -1392,7 +1392,7 @@ void EnOssan_GiveItemWithFanfare(PlayState* play, EnOssan* this) {
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
play->msgCtx.stateTimer = 4;
player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW;
func_800BC490(play, 1);
Play_SetViewpoint(play, 1);
Interface_ChangeAlpha(50);
this->drawCursor = 0;
EnOssan_UpdateCameraDirection(this, play, 0.0f);
@ -1770,7 +1770,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, PlayState* play, Player
osSyncPrintf(VT_FGCOL(YELLOW) "★★★ 続けるよ!! ★★★" VT_RST "\n");
player->actor.shape.rot.y += 0x8000;
player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW;
func_800BC490(play, 2);
Play_SetViewpoint(play, 2);
Message_StartTextbox(play, this->actor.textId, &this->actor);
EnOssan_SetStateStartShopping(play, this, true);
func_8002F298(&this->actor, play, 100.0f, -1);
@ -1789,7 +1789,7 @@ void EnOssan_State_ContinueShoppingPrompt(EnOssan* this, PlayState* play, Player
selectedItem->updateStockedItemFunc(play, selectedItem);
player->actor.shape.rot.y += 0x8000;
player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW;
func_800BC490(play, 2);
Play_SetViewpoint(play, 2);
Message_StartTextbox(play, this->actor.textId, &this->actor);
EnOssan_SetStateStartShopping(play, this, true);
func_8002F298(&this->actor, play, 100.0f, -1);