mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-14 21:40:03 +00:00
[ntsc-1.2] Match game.c, z_play.c, z_room.c (#2117)
* Match z_room.c * Match game.c and z_play.c * Add undefined syms * Rewrite condition based on other file matches
This commit is contained in:
parent
87914c6cc6
commit
e7cf2fceac
8 changed files with 174 additions and 25 deletions
|
@ -214,7 +214,6 @@ extern struct GraphicsContext* __gfxCtx;
|
||||||
#define ZELDA_ARENA_FREE(size, file, line) ZeldaArena_FreeDebug(size, file, line)
|
#define ZELDA_ARENA_FREE(size, file, line) ZeldaArena_FreeDebug(size, file, line)
|
||||||
#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, file, line) LogUtils_CheckNullPointer(exp, ptr, file, line)
|
#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, file, line) LogUtils_CheckNullPointer(exp, ptr, file, line)
|
||||||
#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, file, line) LogUtils_CheckValidPointer(exp, ptr, file, line)
|
#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, file, line) LogUtils_CheckValidPointer(exp, ptr, file, line)
|
||||||
#define HUNGUP_AND_CRASH(file, line) Fault_AddHungupAndCrash(file, line)
|
|
||||||
#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_MallocDebug(alloc, size, file, line)
|
#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_MallocDebug(alloc, size, file, line)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -247,10 +246,15 @@ extern struct GraphicsContext* __gfxCtx;
|
||||||
#define ZELDA_ARENA_FREE(size, file, line) ZeldaArena_Free(size)
|
#define ZELDA_ARENA_FREE(size, file, line) ZeldaArena_Free(size)
|
||||||
#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, file, line) (void)0
|
#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, file, line) (void)0
|
||||||
#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, file, line) (void)0
|
#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, file, line) (void)0
|
||||||
#define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line)
|
|
||||||
#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_Malloc(alloc, size)
|
#define GAME_ALLOC_MALLOC(alloc, size, file, line) GameAlloc_Malloc(alloc, size)
|
||||||
|
|
||||||
#endif /* OOT_DEBUG */
|
#endif
|
||||||
|
|
||||||
|
#if PLATFORM_N64 || OOT_DEBUG
|
||||||
|
#define HUNGUP_AND_CRASH(file, line) Fault_AddHungupAndCrash(file, line)
|
||||||
|
#else
|
||||||
|
#define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OOT_NTSC
|
#if OOT_NTSC
|
||||||
#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { jpn, eng }
|
#define LANGUAGE_ARRAY(jpn, eng, ger, fra) { jpn, eng }
|
||||||
|
|
|
@ -2,12 +2,16 @@
|
||||||
#define N64DD_H
|
#define N64DD_H
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
#include "z64dma.h"
|
|
||||||
#include "z64pause.h"
|
|
||||||
#include "z64scene.h"
|
#include "z64scene.h"
|
||||||
|
|
||||||
|
struct GameState;
|
||||||
|
union Gfx;
|
||||||
|
struct PlayState;
|
||||||
|
struct PauseMapMarksData;
|
||||||
struct RegEditor;
|
struct RegEditor;
|
||||||
|
struct RoomContext;
|
||||||
struct SaveContext;
|
struct SaveContext;
|
||||||
|
struct Scene;
|
||||||
|
|
||||||
// TODO Use the specific pointer types instead of void*
|
// TODO Use the specific pointer types instead of void*
|
||||||
typedef struct n64ddStruct_800FF4B0_pointers {
|
typedef struct n64ddStruct_800FF4B0_pointers {
|
||||||
|
@ -20,21 +24,27 @@ typedef struct n64ddStruct_800FF4B0_pointers {
|
||||||
} n64ddStruct_800FF4B0_pointers; // size = 0xB0
|
} n64ddStruct_800FF4B0_pointers; // size = 0xB0
|
||||||
|
|
||||||
struct n64ddStruct_80121AF0;
|
struct n64ddStruct_80121AF0;
|
||||||
struct PlayState;
|
|
||||||
|
|
||||||
typedef struct n64ddStruct_80121AF0 {
|
typedef struct n64ddStruct_80121AF0 {
|
||||||
void (*unk_00)(n64ddStruct_800FF4B0_pointers*, struct n64ddStruct_80121AF0*);
|
void (*unk_00)(n64ddStruct_800FF4B0_pointers*, struct n64ddStruct_80121AF0*);
|
||||||
void (*unk_04)(void);
|
void (*unk_04)(void);
|
||||||
char unk_08[0x2C];
|
void (*unk_08)(struct PlayState* play, struct RoomContext* roomCtx, s32 roomNum);
|
||||||
void (*unk_34)(PauseMapMarksData**);
|
void (*unk_0C)(struct PlayState* play);
|
||||||
void (*unk_38)(PauseMapMarksData**);
|
void (*unk_10)(struct PlayState* play);
|
||||||
|
void (*unk_14)(struct PlayState* play);
|
||||||
|
char unk_18[0x1C];
|
||||||
|
void (*unk_34)(struct PauseMapMarksData**);
|
||||||
|
void (*unk_38)(struct PauseMapMarksData**);
|
||||||
void (*unk_3C)(void);
|
void (*unk_3C)(void);
|
||||||
void (*unk_40)(void);
|
void (*unk_40)(void);
|
||||||
s32 (*unk_44)(struct PlayState*);
|
s32 (*unk_44)(struct PlayState*);
|
||||||
char unk_48[0x24];
|
struct SceneTableEntry* (*unk_48)(s32 sceneId, struct SceneTableEntry* sceneTable);
|
||||||
|
char unk_4C[0x08];
|
||||||
|
s32 (*unk_54)(struct PlayState*);
|
||||||
|
char unk_58[0x14];
|
||||||
void (*unk_6C)(struct PlayState*, SceneDrawConfigFunc*);
|
void (*unk_6C)(struct PlayState*, SceneDrawConfigFunc*);
|
||||||
s32 (*unk_70)(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, OSMesg msg);
|
s32 (*unk_70)(struct DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, OSMesg msg);
|
||||||
char unk_74[4];
|
void (*unk_74)(struct GameState*);
|
||||||
s32 (*unk_78)(struct PlayState*, void*, void*);
|
s32 (*unk_78)(struct PlayState*, void*, void*);
|
||||||
} n64ddStruct_80121AF0; // size = ?
|
} n64ddStruct_80121AF0; // size = ?
|
||||||
|
|
||||||
|
@ -46,6 +56,10 @@ n64ddStruct_800FF4B0_pointers* func_800ADBD0(void);
|
||||||
void func_800ADC00(void);
|
void func_800ADC00(void);
|
||||||
void func_800ADC08(s32 arg0, s32 arg1, s32 arg2);
|
void func_800ADC08(s32 arg0, s32 arg1, s32 arg2);
|
||||||
|
|
||||||
|
void func_801C8510_unknown(void* dest, s32 offset, s32 size);
|
||||||
|
void func_801C86F0_unknown(void);
|
||||||
|
void func_801C7760_unknown(union Gfx** gfx);
|
||||||
|
|
||||||
extern n64ddStruct_800FF4B0_pointers D_800FF4B0;
|
extern n64ddStruct_800FF4B0_pointers D_800FF4B0;
|
||||||
extern n64ddStruct_80121AF0* B_80121AF0;
|
extern n64ddStruct_80121AF0* B_80121AF0;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#include "n64dd.h"
|
#include "n64dd.h"
|
||||||
|
|
||||||
// TODO functions of unknown prototype
|
// TODO functions of unknown prototype
|
||||||
extern char func_801C8510_unknown[];
|
|
||||||
extern char osGetIntMask[];
|
extern char osGetIntMask[];
|
||||||
extern char osSetTime[];
|
extern char osSetTime[];
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#if OOT_DEBUG
|
|
||||||
#include "fault.h"
|
#include "fault.h"
|
||||||
#endif
|
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
#if PLATFORM_N64
|
||||||
|
#include "n64dd.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#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"
|
#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"
|
||||||
|
|
||||||
|
@ -70,7 +71,11 @@ void GameState_SetFBFilter(Gfx** gfxP) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_800C4344(GameState* gameState) {
|
void func_800C4344(GameState* gameState) {
|
||||||
#if OOT_DEBUG
|
#if PLATFORM_N64
|
||||||
|
if (B_80121AE2 != 0) {
|
||||||
|
func_801C86F0_unknown();
|
||||||
|
}
|
||||||
|
#elif OOT_DEBUG
|
||||||
Input* selectedInput;
|
Input* selectedInput;
|
||||||
s32 hexDumpSize;
|
s32 hexDumpSize;
|
||||||
u16 inputCompareValue;
|
u16 inputCompareValue;
|
||||||
|
@ -238,6 +243,12 @@ void func_800C49F4(GraphicsContext* gfxCtx) {
|
||||||
newDlist = Gfx_Open(polyOpaP = POLY_OPA_DISP);
|
newDlist = Gfx_Open(polyOpaP = POLY_OPA_DISP);
|
||||||
gSPDisplayList(OVERLAY_DISP++, newDlist);
|
gSPDisplayList(OVERLAY_DISP++, newDlist);
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if (B_80121AE2 != 0) {
|
||||||
|
func_801C7760_unknown(&newDlist);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gSPEndDisplayList(newDlist++);
|
gSPEndDisplayList(newDlist++);
|
||||||
Gfx_Close(polyOpaP, newDlist);
|
Gfx_Close(polyOpaP, newDlist);
|
||||||
POLY_OPA_DISP = newDlist;
|
POLY_OPA_DISP = newDlist;
|
||||||
|
@ -258,6 +269,15 @@ void GameState_Update(GameState* gameState) {
|
||||||
|
|
||||||
gameState->main(gameState);
|
gameState->main(gameState);
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if (B_80121AE2 != 0) {
|
||||||
|
func_801C86F0_unknown();
|
||||||
|
}
|
||||||
|
if ((B_80121AF0 != NULL) && (B_80121AF0->unk_74 != NULL)) {
|
||||||
|
B_80121AF0->unk_74(gameState);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
func_800C4344(gameState);
|
func_800C4344(gameState);
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
|
@ -356,7 +376,11 @@ void GameState_InitArena(GameState* gameState, size_t size) {
|
||||||
} else {
|
} else {
|
||||||
THA_Init(&gameState->tha, NULL, 0);
|
THA_Init(&gameState->tha, NULL, 0);
|
||||||
PRINTF(T("ハイラル確保失敗\n", "Failure to secure Hyrule\n"));
|
PRINTF(T("ハイラル確保失敗\n", "Failure to secure Hyrule\n"));
|
||||||
|
#if PLATFORM_N64
|
||||||
|
HUNGUP_AND_CRASH("../game.c", 985);
|
||||||
|
#else
|
||||||
HUNGUP_AND_CRASH("../game.c", 999);
|
HUNGUP_AND_CRASH("../game.c", 999);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,7 +420,12 @@ void GameState_Realloc(GameState* gameState, size_t size) {
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
SystemArena_Display();
|
SystemArena_Display();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
HUNGUP_AND_CRASH("../game.c", 1030);
|
||||||
|
#else
|
||||||
HUNGUP_AND_CRASH("../game.c", 1044);
|
HUNGUP_AND_CRASH("../game.c", 1044);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#if OOT_DEBUG
|
|
||||||
#include "fault.h"
|
#include "fault.h"
|
||||||
#endif
|
|
||||||
#include "quake.h"
|
#include "quake.h"
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
#include "versions.h"
|
#include "versions.h"
|
||||||
|
#if PLATFORM_N64
|
||||||
|
#include "n64dd.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "z64frame_advance.h"
|
#include "z64frame_advance.h"
|
||||||
|
|
||||||
|
@ -175,7 +176,9 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
#if OOT_VERSION < GC_EU_MQ_DBG
|
#if PLATFORM_N64
|
||||||
|
HUNGUP_AND_CRASH("../z_play.c", 2269);
|
||||||
|
#elif OOT_VERSION < GC_EU_MQ_DBG
|
||||||
HUNGUP_AND_CRASH("../z_play.c", 2287);
|
HUNGUP_AND_CRASH("../z_play.c", 2287);
|
||||||
#elif OOT_VERSION < GC_JP_CE
|
#elif OOT_VERSION < GC_JP_CE
|
||||||
HUNGUP_AND_CRASH("../z_play.c", 2290);
|
HUNGUP_AND_CRASH("../z_play.c", 2290);
|
||||||
|
@ -239,6 +242,12 @@ void Play_Destroy(GameState* thisx) {
|
||||||
KaleidoManager_Destroy();
|
KaleidoManager_Destroy();
|
||||||
ZeldaArena_Cleanup();
|
ZeldaArena_Cleanup();
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if ((B_80121AF0 != NULL) && (B_80121AF0->unk_14 != NULL)) {
|
||||||
|
B_80121AF0->unk_14(this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OOT_DEBUG
|
#if OOT_DEBUG
|
||||||
Fault_RemoveClient(&D_801614B8);
|
Fault_RemoveClient(&D_801614B8);
|
||||||
#endif
|
#endif
|
||||||
|
@ -268,6 +277,13 @@ void Play_Init(GameState* thisx) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GameState_Realloc(&this->state, 0x1D4790);
|
GameState_Realloc(&this->state, 0x1D4790);
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if ((B_80121AF0 != NULL) && (B_80121AF0->unk_10 != NULL)) {
|
||||||
|
B_80121AF0->unk_10(this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
KaleidoManager_Init(this);
|
KaleidoManager_Init(this);
|
||||||
View_Init(&this->view, gfxCtx);
|
View_Init(&this->view, gfxCtx);
|
||||||
Audio_SetExtraFilter(0);
|
Audio_SetExtraFilter(0);
|
||||||
|
@ -360,6 +376,7 @@ void Play_Init(GameState* thisx) {
|
||||||
|
|
||||||
PRINTF("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.save.entranceIndex), gSaveContext.sceneLayer);
|
PRINTF("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.save.entranceIndex), gSaveContext.sceneLayer);
|
||||||
|
|
||||||
|
#if PLATFORM_GC
|
||||||
// When entering Gerudo Valley in the credits, trigger the GC emulator to play the ending movie.
|
// When entering Gerudo Valley in the credits, trigger the GC emulator to play the ending movie.
|
||||||
// The emulator constantly checks whether PC is 0x81000000, so this works even though it's not a valid address.
|
// The emulator constantly checks whether PC is 0x81000000, so this works even though it's not a valid address.
|
||||||
if ((gEntranceTable[((void)0, gSaveContext.save.entranceIndex)].sceneId == SCENE_GERUDO_VALLEY) &&
|
if ((gEntranceTable[((void)0, gSaveContext.save.entranceIndex)].sceneId == SCENE_GERUDO_VALLEY) &&
|
||||||
|
@ -368,8 +385,17 @@ void Play_Init(GameState* thisx) {
|
||||||
((void (*)(void))0x81000000)();
|
((void (*)(void))0x81000000)();
|
||||||
PRINTF(T("出戻り?\n", "Return?\n"));
|
PRINTF(T("出戻り?\n", "Return?\n"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if ((B_80121AF0 != NULL && B_80121AF0->unk_54 != NULL && B_80121AF0->unk_54(this))) {
|
||||||
|
} else {
|
||||||
|
Cutscene_HandleEntranceTriggers(this);
|
||||||
|
}
|
||||||
|
#else
|
||||||
Cutscene_HandleEntranceTriggers(this);
|
Cutscene_HandleEntranceTriggers(this);
|
||||||
|
#endif
|
||||||
|
|
||||||
KaleidoScopeCall_Init(this);
|
KaleidoScopeCall_Init(this);
|
||||||
Interface_Init(this);
|
Interface_Init(this);
|
||||||
|
|
||||||
|
@ -1058,6 +1084,10 @@ skip:
|
||||||
}
|
}
|
||||||
|
|
||||||
void Play_DrawOverlayElements(PlayState* this) {
|
void Play_DrawOverlayElements(PlayState* this) {
|
||||||
|
#if PLATFORM_N64
|
||||||
|
s32 pad;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (IS_PAUSED(&this->pauseCtx)) {
|
if (IS_PAUSED(&this->pauseCtx)) {
|
||||||
KaleidoScopeCall_Draw(this);
|
KaleidoScopeCall_Draw(this);
|
||||||
}
|
}
|
||||||
|
@ -1147,7 +1177,12 @@ void Play_Draw(PlayState* this) {
|
||||||
|
|
||||||
TransitionFade_Draw(&this->transitionFadeFlash, &gfxP);
|
TransitionFade_Draw(&this->transitionFadeFlash, &gfxP);
|
||||||
|
|
||||||
if (gVisMonoColor.a > 0) {
|
#if PLATFORM_N64
|
||||||
|
if (gVisMonoColor.a != 0)
|
||||||
|
#else
|
||||||
|
if (gVisMonoColor.a > 0)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
gPlayVisMono.vis.primColor.rgba = gVisMonoColor.rgba;
|
gPlayVisMono.vis.primColor.rgba = gVisMonoColor.rgba;
|
||||||
VisMono_Draw(&gPlayVisMono, &gfxP);
|
VisMono_Draw(&gPlayVisMono, &gfxP);
|
||||||
}
|
}
|
||||||
|
@ -1457,6 +1492,19 @@ void* Play_LoadFile(PlayState* this, RomFile* file) {
|
||||||
return allocp;
|
return allocp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
void* Play_LoadFileFromDiskDrive(PlayState* this, RomFile* file) {
|
||||||
|
u32 size;
|
||||||
|
void* allocp;
|
||||||
|
|
||||||
|
size = file->vromEnd - file->vromStart;
|
||||||
|
allocp = THA_AllocTailAlign16(&this->state.tha, size);
|
||||||
|
func_801C8510_unknown(allocp, file->vromStart, size);
|
||||||
|
|
||||||
|
return allocp;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void Play_InitEnvironment(PlayState* this, s16 skyboxId) {
|
void Play_InitEnvironment(PlayState* this, s16 skyboxId) {
|
||||||
Skybox_Init(&this->state, &this->skyboxCtx, skyboxId);
|
Skybox_Init(&this->state, &this->skyboxCtx, skyboxId);
|
||||||
Environment_Init(this, &this->envCtx, 0);
|
Environment_Init(this, &this->envCtx, 0);
|
||||||
|
@ -1485,24 +1533,52 @@ void Play_InitScene(PlayState* this, s32 spawn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
|
void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) {
|
||||||
SceneTableEntry* scene = &gSceneTable[sceneId];
|
SceneTableEntry* scene;
|
||||||
u32 size;
|
u32 size;
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if ((B_80121AF0 != NULL) && (B_80121AF0->unk_48 != NULL)) {
|
||||||
|
scene = B_80121AF0->unk_48(sceneId, gSceneTable);
|
||||||
|
} else {
|
||||||
|
scene = &gSceneTable[sceneId];
|
||||||
|
scene->unk_13 = 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
scene = &gSceneTable[sceneId];
|
||||||
scene->unk_13 = 0;
|
scene->unk_13 = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
this->loadedScene = scene;
|
this->loadedScene = scene;
|
||||||
this->sceneId = sceneId;
|
this->sceneId = sceneId;
|
||||||
this->sceneDrawConfig = scene->drawConfig;
|
this->sceneDrawConfig = scene->drawConfig;
|
||||||
|
|
||||||
PRINTF("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f);
|
PRINTF("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f);
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if ((B_80121AF0 != NULL) && (scene->unk_12 > 0)) {
|
||||||
|
this->sceneSegment = Play_LoadFileFromDiskDrive(this, &scene->sceneFile);
|
||||||
|
scene->unk_13 = 1;
|
||||||
|
} else {
|
||||||
|
this->sceneSegment = Play_LoadFile(this, &scene->sceneFile);
|
||||||
|
scene->unk_13 = 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
this->sceneSegment = Play_LoadFile(this, &scene->sceneFile);
|
this->sceneSegment = Play_LoadFile(this, &scene->sceneFile);
|
||||||
scene->unk_13 = 0;
|
scene->unk_13 = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
ASSERT(this->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960);
|
ASSERT(this->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960);
|
||||||
|
|
||||||
gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment);
|
gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment);
|
||||||
|
|
||||||
Play_InitScene(this, spawn);
|
Play_InitScene(this, spawn);
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if ((B_80121AF0 != NULL) && (B_80121AF0->unk_0C != NULL)) {
|
||||||
|
B_80121AF0->unk_0C(this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
size = func_80096FE8(this, &this->roomCtx);
|
size = func_80096FE8(this, &this->roomCtx);
|
||||||
|
|
||||||
PRINTF("ROOM SIZE=%fK\n", size / 1024.0f);
|
PRINTF("ROOM SIZE=%fK\n", size / 1024.0f);
|
||||||
|
@ -1798,11 +1874,13 @@ void Play_LoadToLastEntrance(PlayState* this) {
|
||||||
(this->sceneId == SCENE_INSIDE_GANONS_CASTLE_COLLAPSE) || (this->sceneId == SCENE_GANON_BOSS)) {
|
(this->sceneId == SCENE_INSIDE_GANONS_CASTLE_COLLAPSE) || (this->sceneId == SCENE_GANON_BOSS)) {
|
||||||
this->nextEntranceIndex = ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0;
|
this->nextEntranceIndex = ENTR_GANONS_TOWER_COLLAPSE_EXTERIOR_0;
|
||||||
Item_Give(this, ITEM_SWORD_MASTER);
|
Item_Give(this, ITEM_SWORD_MASTER);
|
||||||
|
#if OOT_VERSION >= PAL_1_1
|
||||||
} else if ((gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_11) ||
|
} else if ((gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_11) ||
|
||||||
(gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_12) ||
|
(gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_12) ||
|
||||||
(gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_13) ||
|
(gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_13) ||
|
||||||
(gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_15)) {
|
(gSaveContext.save.entranceIndex == ENTR_HYRULE_FIELD_15)) {
|
||||||
this->nextEntranceIndex = ENTR_HYRULE_FIELD_6;
|
this->nextEntranceIndex = ENTR_HYRULE_FIELD_6;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
this->nextEntranceIndex = gSaveContext.save.entranceIndex;
|
this->nextEntranceIndex = gSaveContext.save.entranceIndex;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
#include "fault.h"
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
#if PLATFORM_N64
|
||||||
|
#include "n64dd.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f };
|
Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f };
|
||||||
|
|
||||||
|
@ -295,6 +299,7 @@ void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 hei
|
||||||
|
|
||||||
bg = (uObjBg*)(gfx + 1);
|
bg = (uObjBg*)(gfx + 1);
|
||||||
gSPBranchList(gfx, (Gfx*)(bg + 1));
|
gSPBranchList(gfx, (Gfx*)(bg + 1));
|
||||||
|
gfx = (Gfx*)(bg + 1);
|
||||||
|
|
||||||
bg->b.imageX = 0;
|
bg->b.imageX = 0;
|
||||||
bg->b.imageW = width * (1 << 2);
|
bg->b.imageW = width * (1 << 2);
|
||||||
|
@ -309,8 +314,6 @@ void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 hei
|
||||||
bg->b.imagePal = 0;
|
bg->b.imagePal = 0;
|
||||||
bg->b.imageFlip = 0;
|
bg->b.imageFlip = 0;
|
||||||
|
|
||||||
gfx = (Gfx*)(bg + 1);
|
|
||||||
|
|
||||||
if (fmt == G_IM_FMT_CI) {
|
if (fmt == G_IM_FMT_CI) {
|
||||||
gDPLoadTLUT(gfx++, tlutCount, 256, tlut);
|
gDPLoadTLUT(gfx++, tlutCount, 256, tlut);
|
||||||
} else {
|
} else {
|
||||||
|
@ -441,7 +444,11 @@ RoomShapeImageMultiBgEntry* Room_GetImageMultiBgEntry(RoomShapeImageMulti* roomS
|
||||||
PRINTF(VT_COL(RED, WHITE) T("z_room.c:カメラIDに一致するデータが存在しません camid=%d\n",
|
PRINTF(VT_COL(RED, WHITE) T("z_room.c:カメラIDに一致するデータが存在しません camid=%d\n",
|
||||||
"z_room.c: Data consistent with camera id does not exist camid=%d\n") VT_RST,
|
"z_room.c: Data consistent with camera id does not exist camid=%d\n") VT_RST,
|
||||||
bgCamIndex);
|
bgCamIndex);
|
||||||
|
#if PLATFORM_N64
|
||||||
|
Fault_AddHungupAndCrash("../z_room.c", 721);
|
||||||
|
#else
|
||||||
LogUtils_HungupThread("../z_room.c", 726);
|
LogUtils_HungupThread("../z_room.c", 726);
|
||||||
|
#endif
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -521,7 +528,11 @@ void Room_DrawImage(PlayState* play, Room* room, u32 flags) {
|
||||||
} else if (roomShape->amountType == ROOM_SHAPE_IMAGE_AMOUNT_MULTI) {
|
} else if (roomShape->amountType == ROOM_SHAPE_IMAGE_AMOUNT_MULTI) {
|
||||||
Room_DrawImageMulti(play, room, flags);
|
Room_DrawImageMulti(play, room, flags);
|
||||||
} else {
|
} else {
|
||||||
|
#if PLATFORM_N64
|
||||||
|
Fault_AddHungupAndCrash("../z_room.c", 836);
|
||||||
|
#else
|
||||||
LogUtils_HungupThread("../z_room.c", 841);
|
LogUtils_HungupThread("../z_room.c", 841);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,10 +621,20 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) {
|
||||||
(void*)ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
|
(void*)ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
|
||||||
|
|
||||||
osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1);
|
osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1);
|
||||||
|
|
||||||
|
#if PLATFORM_N64
|
||||||
|
if ((B_80121AF0 != NULL) && (B_80121AF0->unk_08 != NULL)) {
|
||||||
|
B_80121AF0->unk_08(play, roomCtx, roomNum);
|
||||||
|
} else {
|
||||||
|
DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0,
|
||||||
|
&roomCtx->loadQueue, NULL, "../z_room.c", 1036);
|
||||||
|
}
|
||||||
|
#else
|
||||||
DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0,
|
DMA_REQUEST_ASYNC(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0,
|
||||||
&roomCtx->loadQueue, NULL, "../z_room.c", 1036);
|
&roomCtx->loadQueue, NULL, "../z_room.c", 1036);
|
||||||
roomCtx->unk_30 ^= 1;
|
#endif
|
||||||
|
|
||||||
|
roomCtx->unk_30 ^= 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1990,7 +1990,7 @@ Play_Main = 0x8009D1B8; // type:func
|
||||||
Play_InCsMode = 0x8009D1F8; // type:func
|
Play_InCsMode = 0x8009D1F8; // type:func
|
||||||
func_800BFCB8 = 0x8009D22C; // type:func
|
func_800BFCB8 = 0x8009D22C; // type:func
|
||||||
Play_LoadFile = 0x8009D3D8; // type:func
|
Play_LoadFile = 0x8009D3D8; // type:func
|
||||||
func_8009D434_unknown = 0x8009D434; // type:func
|
Play_LoadFileFromDiskDrive = 0x8009D434; // type:func
|
||||||
Play_InitEnvironment = 0x8009D490; // type:func
|
Play_InitEnvironment = 0x8009D490; // type:func
|
||||||
Play_InitScene = 0x8009D4D8; // type:func
|
Play_InitScene = 0x8009D4D8; // type:func
|
||||||
Play_SpawnScene = 0x8009D5DC; // type:func
|
Play_SpawnScene = 0x8009D5DC; // type:func
|
||||||
|
|
|
@ -26,6 +26,10 @@ func_801C8510_unknown = 0x801C8510;
|
||||||
D_801DA410 = 0x801DA410;
|
D_801DA410 = 0x801DA410;
|
||||||
D_801E8090 = 0x801E8090;
|
D_801E8090 = 0x801E8090;
|
||||||
|
|
||||||
|
// game.c
|
||||||
|
func_801C86F0_unknown = 0x801C86F0;
|
||||||
|
func_801C7760_unknown = 0x801C7760;
|
||||||
|
|
||||||
// z_en_mag.c
|
// z_en_mag.c
|
||||||
func_801C79BC_unknown = 0x801C79BC;
|
func_801C79BC_unknown = 0x801C79BC;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue