1
0
mirror of https://github.com/HarbourMasters/Shipwright.git synced 2024-12-20 23:28:51 -05:00

pull in decomp updates for z_play ()

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_Destroy(PlayState* play);
void KaleidoScopeCall_Update(PlayState* play); void KaleidoScopeCall_Update(PlayState* play);
void KaleidoScopeCall_Draw(PlayState* play); void KaleidoScopeCall_Draw(PlayState* play);
void func_800BC490(PlayState* play, s16 point); void Play_SetViewpoint(PlayState* play, s16 viewpoint);
s32 func_800BC56C(PlayState* play, s16 arg1); s32 Play_CheckViewpoint(PlayState* play, s16 viewpoint);
void func_800BC590(PlayState* play); void Play_SetShopBrowsingViewpoint(PlayState* play);
void Gameplay_SetupTransition(PlayState* play, s32 arg1); void Gameplay_SetupTransition(PlayState* play, s32 arg1);
Gfx* Play_SetFog(PlayState* play, Gfx* gfx); Gfx* Play_SetFog(PlayState* play, Gfx* gfx);
void Play_Destroy(GameState* thisx); void Play_Destroy(GameState* thisx);
@ -1552,7 +1552,7 @@ u8 CheckLACSRewardCount();
s32 Play_InCsMode(PlayState* play); s32 Play_InCsMode(PlayState* play);
f32 func_800BFCB8(PlayState* play, MtxF* mf, Vec3f* vec); f32 func_800BFCB8(PlayState* play, MtxF* mf, Vec3f* vec);
void* Play_LoadFile(PlayState* play, RomFile* file); 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); void func_800C016C(PlayState* play, Vec3f* src, Vec3f* dest);
s16 Play_CreateSubCamera(PlayState* play); s16 Play_CreateSubCamera(PlayState* play);
s16 Play_GetActiveCamId(PlayState* play); s16 Play_GetActiveCamId(PlayState* play);

View File

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

View File

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

View File

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

View File

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

View File

@ -307,7 +307,7 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
break; break;
case 14: case 14:
if (sp3F != 0) { if (sp3F != 0) {
func_800BC490(play, 1); Play_SetViewpoint(play, 1);
} }
break; break;
case 15: case 15:
@ -2052,7 +2052,7 @@ void func_80068C3C(PlayState* play, CutsceneContext* csCtx) {
csCtx->frames++; csCtx->frames++;
if (dREG(95) != 0) { if (dREG(95) != 0) {
Cutscene_ProcessCommands(play, csCtx, D_8012D1F0); Cutscene_ProcessCommands(play, csCtx, gDebugCutsceneScript);
} else { } else {
Cutscene_ProcessCommands(play, csCtx, play->csCtx.segment); 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 { } else {
arrowPointedActor = play->actorCtx.targetCtx.arrowPointedActor; 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; temp = 12;
this->unk_2C0 = 100; this->unk_2C0 = 100;
} else if (arrowPointedActor == NULL || arrowPointedActor->category == ACTORCAT_NPC) { } 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.msgMode = MSGMODE_TEXT_CLOSING;
play->msgCtx.stateTimer = 4; play->msgCtx.stateTimer = 4;
player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW; player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW;
func_800BC490(play, 1); Play_SetViewpoint(play, 1);
Interface_ChangeAlpha(50); Interface_ChangeAlpha(50);
this->drawCursor = 0; this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false; this->stickLeftPrompt.isEnabled = false;
@ -763,7 +763,7 @@ void EnOssan_State_Idle(EnOssan* this, PlayState* play, Player* player) {
// "Start conversation!!" // "Start conversation!!"
osSyncPrintf(VT_FGCOL(YELLOW) "★★★ 会話開始!! ★★★" VT_RST "\n"); osSyncPrintf(VT_FGCOL(YELLOW) "★★★ 会話開始!! ★★★" VT_RST "\n");
player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW; player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW;
func_800BC590(play); Play_SetShopBrowsingViewpoint(play);
EnOssan_SetStateStartShopping(play, this, false); EnOssan_SetStateStartShopping(play, this, false);
} else if (this->actor.xzDistToPlayer < 100.0f) { } else if (this->actor.xzDistToPlayer < 100.0f) {
func_8002F2CC(&this->actor, play, 100); 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.msgMode = MSGMODE_TEXT_CLOSING;
play->msgCtx.stateTimer = 4; play->msgCtx.stateTimer = 4;
player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW; player->stateFlags2 &= ~PLAYER_STATE2_DISABLE_DRAW;
func_800BC490(play, 1); Play_SetViewpoint(play, 1);
Interface_ChangeAlpha(50); Interface_ChangeAlpha(50);
this->drawCursor = 0; this->drawCursor = 0;
EnOssan_UpdateCameraDirection(this, play, 0.0f); 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"); osSyncPrintf(VT_FGCOL(YELLOW) "★★★ 続けるよ!! ★★★" VT_RST "\n");
player->actor.shape.rot.y += 0x8000; player->actor.shape.rot.y += 0x8000;
player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW; player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW;
func_800BC490(play, 2); Play_SetViewpoint(play, 2);
Message_StartTextbox(play, this->actor.textId, &this->actor); Message_StartTextbox(play, this->actor.textId, &this->actor);
EnOssan_SetStateStartShopping(play, this, true); EnOssan_SetStateStartShopping(play, this, true);
func_8002F298(&this->actor, play, 100.0f, -1); 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); selectedItem->updateStockedItemFunc(play, selectedItem);
player->actor.shape.rot.y += 0x8000; player->actor.shape.rot.y += 0x8000;
player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW; player->stateFlags2 |= PLAYER_STATE2_DISABLE_DRAW;
func_800BC490(play, 2); Play_SetViewpoint(play, 2);
Message_StartTextbox(play, this->actor.textId, &this->actor); Message_StartTextbox(play, this->actor.textId, &this->actor);
EnOssan_SetStateStartShopping(play, this, true); EnOssan_SetStateStartShopping(play, this, true);
func_8002F298(&this->actor, play, 100.0f, -1); func_8002F298(&this->actor, play, 100.0f, -1);