diff options
| author | Roman971 <32455037+Roman971@users.noreply.github.com> | 2020-04-16 23:36:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-16 17:36:12 -0400 |
| commit | 262f6c507ca59c75df52e23f93c701705ee22798 (patch) | |
| tree | 179e55b3d59e02d624615b0d4d88867600cca9ed /src/code | |
| parent | 9ac1f8130ddbfdf394e11710021150f6c192fdcd (diff) | |
Decompile z_play.c and Match/Document some of z_view.c (#74)
* Decompile z_play.c and Match/Document some of z_view.c
Also fix the last non matching in z_sample.c and update some game state functions.
* Suggestions from PR #74
* Fix undefined reference to Gameplay_DrawOverlay
* Suggestion from PR #74 (2)
* Fix a fake argument in func_800BC450
Diffstat (limited to 'src/code')
36 files changed, 4136 insertions, 2154 deletions
diff --git a/src/code/code_80097A00.c b/src/code/code_80097A00.c index d709fd8c9..cdf78e9d5 100644 --- a/src/code/code_80097A00.c +++ b/src/code/code_80097A00.c @@ -93,8 +93,8 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) { } if (equipment == EQUIP_SWORD) { - gSaveContext.equips.button_items[0] = ITEM_NONE; - gSaveContext.inf_table[29] = 1; + gSaveContext.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.infTable[29] = 1; } func_8008ECAC(globalCtx, player); diff --git a/src/code/code_800ACE70.c b/src/code/code_800ACE70.c index 31e93ad63..f62d54335 100644 --- a/src/code/code_800ACE70.c +++ b/src/code/code_800ACE70.c @@ -3,10 +3,7 @@ typedef struct { /* 0x00 */ u32 type; /* 0x04 */ u32 setScissor; - /* 0x08 */ union { - Color_RGBA8 c; - u32 rgba; - } color; + /* 0x08 */ Color_RGBA8 color; /* 0x0C */ u32 unk_0C; } struct_801664F0; @@ -60,10 +57,10 @@ Gfx D_8012AC58[] = { void func_800ACE70(struct_801664F0* this) { this->type = 0; this->setScissor = false; - this->color.c.r = 0xFF; - this->color.c.g = 0xFF; - this->color.c.b = 0xFF; - this->color.c.a = 0xFF; + this->color.r = 0xFF; + this->color.g = 0xFF; + this->color.b = 0xFF; + this->color.a = 0xFF; } // Destroy func diff --git a/src/code/code_800FC620.c b/src/code/code_800FC620.c index b0b16b8b7..c75135cd7 100644 --- a/src/code/code_800FC620.c +++ b/src/code/code_800FC620.c @@ -13,7 +13,7 @@ typedef struct InitFunc { // .data void* sInitFuncs = NULL; -char sNew[4] = { 'n', 'e', 'w' }; +char sNew[] = { 'n', 'e', 'w' }; char D_80134488[0x18] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00, diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c index 789e382af..69a4d9362 100644 --- a/src/code/debug_malloc.c +++ b/src/code/debug_malloc.c @@ -10,13 +10,13 @@ Arena sDebugArena; void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { if (!ptr) { if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) { - //"%s: %u bytes %s failed\n" + // "%s: %u bytes %s failed\n" osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action); __osDisplayArena(&sDebugArena); return; } } else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { - //"%s: %u bytes %s succeeded\n" + // "%s: %u bytes %s succeeded\n" osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action); } } diff --git a/src/code/gfxprint.c b/src/code/gfxprint.c index 0555e1cec..57414bc2c 100644 --- a/src/code/gfxprint.c +++ b/src/code/gfxprint.c @@ -174,7 +174,7 @@ void GfxPrint_InitDlist(GfxPrint* this) { gDPSetTileSize(this->dlist++, i * 2, 0, 0, 60, 1020); } - gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color); + gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba); gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, sGfxPrintUnkData); gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 3, @@ -204,7 +204,7 @@ void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a) { this->color.b = b; this->color.a = a; gDPPipeSync(this->dlist++); - gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color); + gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba); } void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y) { @@ -252,7 +252,7 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) { c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024); } - gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color); + gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba); } if (this->flag & GFXPRINT_FLAG64) { @@ -350,7 +350,7 @@ void GfxPrint_Ctor(GfxPrint* this) { this->posY = 0; this->baseX = 0; this->baseY = 0; - *(u32*)&this->color = 0; + this->color.rgba = 0; this->flag &= ~GFXPRINT_FLAG1; this->flag &= ~GFXPRINT_USE_RGBA16; diff --git a/src/code/graph.c b/src/code/graph.c index 600c2287f..68fccaca6 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -119,7 +119,7 @@ GameStateOverlay* Graph_GetNextGameState() { if (gameStateInitFunc == Title_Init) { return &gGameStateOverlayTable[2]; } - if (gameStateInitFunc == func_800BCA64) { + if (gameStateInitFunc == Gameplay_Init) { return &gGameStateOverlayTable[3]; } if (gameStateInitFunc == Opening_Init) { @@ -389,7 +389,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { if (D_8012DBC0 && (!~(gameState->input[0].press.in.button | ~Z_TRIG)) && (!~(gameState->input[0].cur.in.button | ~(L_TRIG | R_TRIG)))) { - gSaveContext.game_mode = 0; + gSaveContext.gameMode = 0; SET_NEXT_GAMESTATE(gameState, func_80801E44, char[0x240]); // TODO : SelectContext gameState->running = false; } @@ -438,8 +438,7 @@ void Graph_ThreadEntry(void* arg0) { } func_800C5080(gameState, ovl->init, &gfxCtx); // Game_Ct - while (func_800C547C(gameState)) // Game_IsGameStateRunning - { + while (func_800C547C(gameState)) { // Game_IsGameStateRunning Graph_Update(&gfxCtx, gameState); } diff --git a/src/code/main.c b/src/code/main.c index 8b797bbf9..38949d73c 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -2,8 +2,8 @@ #include <vt.h> #include <sched.h> -u32 gScreenWidth = SCREEN_WIDTH; -u32 gScreenHeight = SCREEN_HEIGHT; +s32 gScreenWidth = SCREEN_WIDTH; +s32 gScreenHeight = SCREEN_HEIGHT; u32 gSystemHeapSize = 0; PreNmiBuff* gAppNmiBufferPtr; diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index c320a3286..814b8fa2c 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -898,8 +898,11 @@ MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line) { for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f)) { - osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| " - "%12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n", + osSyncPrintf("%s %d: [%s] =\n" + "/ %12.6f %12.6f %12.6f %12.6f \\\n" + "| %12.6f %12.6f %12.6f %12.6f |\n" + "| %12.6f %12.6f %12.6f %12.6f |\n" + "\\ %12.6f %12.6f %12.6f %12.6f /\n", file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz, mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww); Fault_AddHungupAndCrash(file, line); diff --git a/src/code/system_malloc.c b/src/code/system_malloc.c index 3c75b6065..a9141043d 100644 --- a/src/code/system_malloc.c +++ b/src/code/system_malloc.c @@ -10,13 +10,13 @@ Arena gSystemArena; void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { if (!ptr) { if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) { - //"%s: %u bytes %s failed\n" + // "%s: %u bytes %s failed\n" osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action); __osDisplayArena(&gSystemArena); return; } } else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { - //"%s: %u bytes %s succeeded\n" + // "%s: %u bytes %s succeeded\n" osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action); } } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index c6ca91721..02e5b4efb 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -699,10 +699,10 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7) { Scene* loadedScene = globalCtx->loadedScene; - u32 size = loadedScene->titleVromEnd - loadedScene->titleVromStart; + u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart; if ((size != 0) && (size <= 0x3000)) { - DmaMgr_SendRequest1(texture, loadedScene->titleVromStart, size, "../z_actor.c", 2765); + DmaMgr_SendRequest1(texture, loadedScene->titleFile.vromStart, size, "../z_actor.c", 2765); } titleCtx->texture = texture; @@ -1042,7 +1042,7 @@ void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) { void func_8002DE74(GlobalContext* globalCtx, Player* player) { if ((globalCtx->roomCtx.curRoom.unk_03 != 4) && func_800C0CB8(globalCtx)) { - func_8005A77C(func_800C04A4(globalCtx, 0), 6); + func_8005A77C(Gameplay_GetCamera(globalCtx, 0), 6); } } @@ -1056,8 +1056,8 @@ s32 func_8002DEEC(Player* player) { return (player->stateFlags1 & 0x20000080) || player->action; } -void func_8002DF18(GlobalContext* globalCtx, ActorContext* actorCtx) { - func_8006DC68(globalCtx, actorCtx); +void func_8002DF18(GlobalContext* globalCtx, Player* player) { + func_8006DC68(globalCtx, player); } u32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 newAction) { @@ -1359,9 +1359,9 @@ void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) { GraphicsContext* gfxCtx; Gfx* dispRefs[4]; - lightDir.x = globalCtx->unk_10A4E; - lightDir.y = globalCtx->unk_10A4F; - lightDir.z = globalCtx->unk_10A50; + lightDir.x = globalCtx->envCtx.unk_2A; + lightDir.y = globalCtx->envCtx.unk_2B; + lightDir.z = globalCtx->envCtx.unk_2C; if (HREG(80) == 6) { osSyncPrintf("z_actor.c 3637 game_play->view.eye=[%f(%f) %f %f]\n", (f64)globalCtx->view.eye.x, @@ -1393,9 +1393,9 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) { GraphicsContext* gfxCtx; Gfx* dispRefs[4]; - lightDir.x = globalCtx->unk_10A4E; - lightDir.y = globalCtx->unk_10A4F; - lightDir.z = globalCtx->unk_10A50; + lightDir.x = globalCtx->envCtx.unk_2A; + lightDir.y = globalCtx->envCtx.unk_2B; + lightDir.z = globalCtx->envCtx.unk_2C; hilite = func_8002EB44(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); @@ -1770,15 +1770,15 @@ void func_8002FA60(GlobalContext* globalCtx) { if (gSaveContext.fw.set) { gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0x28; - gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = gSaveContext.fw.pos_x; - gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = gSaveContext.fw.pos_y; - gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z = gSaveContext.fw.pos_z; + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = gSaveContext.fw.pos.x; + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = gSaveContext.fw.pos.y; + gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z = gSaveContext.fw.pos.z; gSaveContext.respawn[RESPAWN_MODE_TOP].yaw = gSaveContext.fw.yaw; - gSaveContext.respawn[RESPAWN_MODE_TOP].player_params = gSaveContext.fw.player_params; - gSaveContext.respawn[RESPAWN_MODE_TOP].entrance_index = gSaveContext.fw.entrance_index; - gSaveContext.respawn[RESPAWN_MODE_TOP].room_index = gSaveContext.fw.room_index; - gSaveContext.respawn[RESPAWN_MODE_TOP].temp_swch_flags = gSaveContext.fw.temp_swch_flags; - gSaveContext.respawn[RESPAWN_MODE_TOP].temp_collect_flags = gSaveContext.fw.temp_collect_flags; + gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams = gSaveContext.fw.playerParams; + gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex = gSaveContext.fw.entranceIndex; + gSaveContext.respawn[RESPAWN_MODE_TOP].roomIndex = gSaveContext.fw.roomIndex; + gSaveContext.respawn[RESPAWN_MODE_TOP].tempSwchFlags = gSaveContext.fw.tempSwchFlags; + gSaveContext.respawn[RESPAWN_MODE_TOP].tempCollectFlags = gSaveContext.fw.tempCollectFlags; } else { gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0; gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = 0.0f; @@ -1887,7 +1887,7 @@ void func_8002FBAC(GlobalContext* globalCtx) { if (D_8015BC18 == 0.0f) { gSaveContext.respawn[RESPAWN_MODE_TOP] = gSaveContext.respawn[RESPAWN_MODE_DOWN]; - gSaveContext.respawn[RESPAWN_MODE_TOP].player_params = 0x06FF; + gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams = 0x06FF; gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0x28; } @@ -1924,8 +1924,8 @@ void func_8002FBAC(GlobalContext* globalCtx) { } if ((globalCtx->csCtx.state == 0) && - (gSaveContext.respawn[RESPAWN_MODE_TOP].entrance_index == gSaveContext.entrance_index) && - (globalCtx->roomCtx.curRoom.num == gSaveContext.respawn[RESPAWN_MODE_TOP].room_index)) { + (gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex == gSaveContext.entranceIndex) && + (globalCtx->roomCtx.curRoom.num == gSaveContext.respawn[RESPAWN_MODE_TOP].roomIndex)) { gfxCtx->polyXlu.p = Gfx_CallSetupDL(gfxCtx->polyXlu.p, 0x19); Matrix_Translate(gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x, @@ -1980,12 +1980,13 @@ void func_800304B0(GlobalContext* globalCtx) { } } +// Actor_InitContext void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorEntry) { ActorOverlay* overlayEntry; SaveSceneFlags* saveSceneFlags; s32 i; - saveSceneFlags = &gSaveContext.scene_flags[globalCtx->sceneNum]; + saveSceneFlags = &gSaveContext.sceneFlags[globalCtx->sceneNum]; bzero(actorCtx, sizeof(*actorCtx)); @@ -2206,7 +2207,7 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { func_80079EFC(lightMapper, globalCtx->state.gfxCtx); if (actor->flags & 0x1000) { - camera = &globalCtx->cameraCtx.activeCameras[0]; + camera = &globalCtx->cameras[0]; func_800D1694(actor->posRot.pos.x + camera->unk_80.x, actor->posRot.pos.y + (f32)((actor->shape.unk_08 * actor->scale.y) + camera->unk_80.y), actor->posRot.pos.z + camera->unk_80.z, &actor->shape.rot); @@ -2546,6 +2547,7 @@ void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) { globalCtx->msgCtx.unk_E3F4 = 0; } +// Actor_CleanupContext void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) { Actor* actor; s32 i; @@ -2568,7 +2570,7 @@ void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) { actorCtx->absoluteSpace = NULL; } - func_800C0A44(globalCtx); + Gameplay_SaveSceneFlags(globalCtx); func_80030488(globalCtx); ActorOverlayTable_Cleanup(); } @@ -2891,7 +2893,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC if ((player != NULL) && (actor == player->unk_664)) { func_8008EDF0(player); - func_8005A444(func_800C04A4(globalCtx, func_800C030C(globalCtx)), 0); + func_8005A444(Gameplay_GetCamera(globalCtx, Gameplay_GetActiveCamId(globalCtx)), 0); } if (actor == actorCtx->targetCtx.arrowPointedActor) { @@ -3516,14 +3518,14 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx) } void func_80033DB8(GlobalContext* globalCtx, s16 arg1, s16 arg2) { - s16 var = Quake_Add(&globalCtx->cameraCtx.activeCameras[0], 3); + s16 var = Quake_Add(&globalCtx->cameras[0], 3); Quake_SetSpeed(var, 20000); Quake_SetQuakeValues(var, arg1, 0, 0, 0); Quake_SetCountdown(var, arg2); } void func_80033E1C(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3) { - s16 var = Quake_Add(&globalCtx->cameraCtx.activeCameras[0], 3); + s16 var = Quake_Add(&globalCtx->cameras[0], 3); Quake_SetSpeed(var, arg3); Quake_SetQuakeValues(var, arg1, 0, 0, 0); Quake_SetCountdown(var, arg2); @@ -3557,7 +3559,7 @@ typedef struct { /* 0x18 */ u32 unk_18; } struct_801160DC; // size = 0x1C -struct_801160DC D_801160DC[3] = { +struct_801160DC D_801160DC[] = { { 0.54f, 6000.0f, 5000.0f, 1.0f, 0.0f, 0x050011F0, 0x05001100 }, { 0.644f, 12000.0f, 8000.0f, 1.0f, 0.0f, 0x06001530, 0x06001400 }, { 0.64000005f, 8500.0f, 8000.0f, 1.75f, 0.1f, 0x050011F0, 0x05001100 }, @@ -3634,9 +3636,9 @@ void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) { Vec3f lightDir; - lightDir.x = globalCtx->unk_10A4E; - lightDir.y = globalCtx->unk_10A4F; - lightDir.z = globalCtx->unk_10A50; + lightDir.x = globalCtx->envCtx.unk_2A; + lightDir.y = globalCtx->envCtx.unk_2B; + lightDir.z = globalCtx->envCtx.unk_2C; return func_8002EABC(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); } @@ -3644,9 +3646,9 @@ Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) { Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx) { Vec3f lightDir; - lightDir.x = globalCtx->unk_10A4E; - lightDir.y = globalCtx->unk_10A4F; - lightDir.z = globalCtx->unk_10A50; + lightDir.x = globalCtx->envCtx.unk_2A; + lightDir.y = globalCtx->envCtx.unk_2B; + lightDir.z = globalCtx->envCtx.unk_2C; return func_8002EB44(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); } @@ -3712,7 +3714,7 @@ typedef struct { /* 0x14 */ s16 unk_14; } struct_80116130; // size = 0x18 -struct_80116130 D_80116130[13] = { +struct_80116130 D_80116130[] = { { { 0x2AA8, 0xF1C8, 0x18E2, 0x1554, 0x0000, 0x0000, 1 }, 170.0f, 0x3FFC }, { { 0x2AA8, 0xEAAC, 0x1554, 0x1554, 0xF8E4, 0x0E38, 1 }, 170.0f, 0x3FFC }, { { 0x31C4, 0xE390, 0x0E38, 0x0E38, 0xF1C8, 0x071C, 1 }, 170.0f, 0x3FFC }, @@ -4233,28 +4235,28 @@ void func_80035B18(GlobalContext* globalCtx, Actor* actor, u16 textId) { * Tests if event_chk_inf flag is set. */ s32 Flags_GetEventChkInf(s32 flag) { - return gSaveContext.event_chk_inf[flag >> 4] & (1 << (flag & 0xF)); + return gSaveContext.eventChkInf[flag >> 4] & (1 << (flag & 0xF)); } /** * Sets event_chk_inf flag. */ void Flags_SetEventChkInf(s32 flag) { - gSaveContext.event_chk_inf[flag >> 4] |= (1 << (flag & 0xF)); + gSaveContext.eventChkInf[flag >> 4] |= (1 << (flag & 0xF)); } /** - * Tests if inf_table flag is set. + * Tests if "inf_table flag is set. */ s32 Flags_GetInfTable(s32 flag) { - return gSaveContext.inf_table[flag >> 4] & (1 << (flag & 0xF)); + return gSaveContext.infTable[flag >> 4] & (1 << (flag & 0xF)); } /** - * Sets inf_table flag. + * Sets "inf_table" flag. */ void Flags_SetInfTable(s32 flag) { - gSaveContext.inf_table[flag >> 4] |= (1 << (flag & 0xF)); + gSaveContext.infTable[flag >> 4] |= (1 << (flag & 0xF)); } u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { @@ -4551,7 +4553,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { retTextId = 0x7002; } else if (Flags_GetInfTable(0x6A)) { retTextId = 0x7004; - } else if ((gSaveContext.day_time >= 0x4000) && (gSaveContext.day_time < 0xC556)) { + } else if ((gSaveContext.dayTime >= 0x4000) && (gSaveContext.dayTime < 0xC556)) { retTextId = 0x7002; } else { retTextId = 0x7003; @@ -4956,7 +4958,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } } else { if (!Flags_GetEventChkInf(0x18)) { - if (gSaveContext.night_flag) { + if (gSaveContext.nightFlag) { retTextId = 0x204E; } else if (Flags_GetInfTable(0x9A)) { retTextId = 0x2031; @@ -5569,7 +5571,7 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar actor->posRot2.pos = actor->posRot.pos; actor->posRot2.pos.y += arg4; - if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) { + if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entranceIndex == 0x00EE))) { var = actor->rotTowardsLinkY - actor->shape.rot.y; abs_var = ABS(var); if (abs_var >= 0x4300) { @@ -5578,7 +5580,7 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar } } - if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) { + if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entranceIndex == 0x00EE)) { sp2C = globalCtx->view.eye; } else { sp2C = player->actor.posRot2.pos; @@ -5598,7 +5600,7 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar actor->posRot2.pos = arg4; - if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) { + if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entranceIndex == 0x00EE))) { var = actor->rotTowardsLinkY - actor->shape.rot.y; abs_var = ABS(var); if (abs_var >= 0x4300) { @@ -5607,7 +5609,7 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar } } - if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) { + if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entranceIndex == 0x00EE)) { sp24 = globalCtx->view.eye; } else { sp24 = player->actor.posRot2.pos; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index b48b58321..6c8fa5ade 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -234,7 +234,6 @@ s32 func_800443A0(Camera* camera, Vec3f* b, Vec3f* c) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800443A0.s") #endif -f32 func_8003C940(CollisionContext*, CollisionPoly**, s32*, Vec3f*); f32 func_80044434(Camera* camera, Vec3f* b, Vec3f* c, s32* d) { s32 sp2C; // unused CollisionPoly* sp28; @@ -739,7 +738,7 @@ s16 func_80046CB4(Camera* camera, s16 b, s16 c, f32 d, f32 e) { if (camera->unk_D8 > 0.001f) { temp = b - 0x7fff; // this is probably some kind of cast that I'm too stupid to know sp1C = c - temp; - phi_f14 = (s16)(sp1C - 0x7fff) * 0.00003051851f; + phi_f14 = (s16)(sp1C - 0x7fff) * (1.0f / 32767.0f); } else { temp = b - 0x7fff; sp1C = c - temp; @@ -804,7 +803,7 @@ void Camera_Vec3fCopy(Vec3f* src, Vec3f* dst) { s32 func_8005AD40(Camera* camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f); void func_80057FC4(Camera* camera) { - if (camera != &camera->globalCtx->cameraCtx.activeCameras[0]) { + if (camera != &camera->globalCtx->cameras[0]) { camera->unk_154 = camera->unk_142 = 33; camera->unk_14C &= ~0x4; } else if (camera->globalCtx->roomCtx.curRoom.mesh->polygon.type != 1) { @@ -839,7 +838,7 @@ void Camera_Stub80058140(Camera* camera) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80058148.s") // 109 lines (unknown arrays) -#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80058354.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeStatus.s") // 261 lines #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800584E8.s") @@ -867,11 +866,11 @@ s32 func_80058CF8(Camera* camera) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800591EC.s") void func_80059EC8(Camera* camera) { - Camera* sp24 = camera->globalCtx->cameraCtx.activeCameraPtrs[0]; + Camera* sp24 = camera->globalCtx->cameraPtrs[0]; Player* player = (Player*)camera->globalCtx->actorCtx.actorList[2].first; if (camera->unk_160 == 0) { - func_800C0314(camera->globalCtx, camera->unk_162, 7); + Gameplay_ChangeCameraStatus(camera->globalCtx, camera->unk_162, 7); if ((camera->unk_162 == 0) && (camera->unk_168 != 0)) { player->actor.freeze = 0; @@ -885,24 +884,24 @@ void func_80059EC8(Camera* camera) { sp24->unk_14C |= 8; } - if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 == camera->unk_164) { - camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 = camera->unk_162; + if (camera->globalCtx->cameraPtrs[camera->unk_14E]->unk_162 == camera->unk_164) { + camera->globalCtx->cameraPtrs[camera->unk_14E]->unk_162 = camera->unk_162; } - if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E == camera->unk_164) { - camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E = camera->unk_14E; + if (camera->globalCtx->cameraPtrs[camera->unk_162]->unk_14E == camera->unk_164) { + camera->globalCtx->cameraPtrs[camera->unk_162]->unk_14E = camera->unk_14E; } - if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_164 == 0) { - camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_15E = 0; + if (camera->globalCtx->cameraPtrs[camera->unk_162]->unk_164 == 0) { + camera->globalCtx->cameraPtrs[camera->unk_162]->unk_15E = 0; } camera->unk_162 = 0; camera->unk_14E = camera->unk_162; camera->unk_160 = -1; - camera->globalCtx->unk_10B05 = 0; + camera->globalCtx->envCtx.unk_E1 = 0; - func_800C0384(camera->globalCtx, camera->unk_164); + Gameplay_ClearCamera(camera->globalCtx, camera->unk_164); } } @@ -1128,9 +1127,9 @@ s32 func_8005B198() { s16 func_8005B1A4(Camera* camera) { camera->unk_14C |= 0x8; - if ((camera->unk_164 == 0) && (camera->globalCtx->cameraCtx.unk_5C0 != 0)) { - camera->globalCtx->cameraCtx.activeCameraPtrs[camera->globalCtx->cameraCtx.unk_5C0]->unk_14C |= 0x8; - return camera->globalCtx->cameraCtx.unk_5C0; + if ((camera->unk_164 == 0) && (camera->globalCtx->activeCamera != 0)) { + camera->globalCtx->cameraPtrs[camera->globalCtx->activeCamera]->unk_14C |= 0x8; + return camera->globalCtx->activeCamera; } return camera->unk_164; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index b8a70550d..5b6561232 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -298,7 +298,7 @@ s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D3BC.s") -void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1) { +void func_8005D400(GlobalContext* globalCtx, SubGlobalContext11E60* sub_11E60) { } #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D40C.s") diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index cb5739477..798f95d8e 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -5,15 +5,15 @@ void SaveContext_Init(void) { bzero(&gSaveContext, sizeof(gSaveContext)); D_8015FA88 = 0; D_8015FA8C = 0; - gSaveContext.seq_index = 0xFF; - gSaveContext.night_sfx = 0xFF; + gSaveContext.seqIndex = 0xFF; + gSaveContext.nightSeqIndex = 0xFF; gSaveContext.unk_140E = 0; - gSaveContext.next_cutscene_index = 0xFFEF; - gSaveContext.cutscene_trigger = 0; - gSaveContext.chamber_cutscene_num = 0; - gSaveContext.next_day_time = 0xFFFF; - gSaveContext.environment_time = 0; - gSaveContext.dogIsLost = 1; - gSaveContext.transition_type = 0xFF; + gSaveContext.nextCutsceneIndex = 0xFFEF; + gSaveContext.cutsceneTrigger = 0; + gSaveContext.chamberCutsceneNum = 0; + gSaveContext.nextDayTime = 0xFFFF; + gSaveContext.environmentTime = 0; + gSaveContext.dogIsLost = true; + gSaveContext.nextTransition = 0xFF; gSaveContext.unk_13EE = 50; } diff --git a/src/code/z_construct.c b/src/code/z_construct.c index d14e6ef8c..75ac3d50a 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -19,7 +19,7 @@ void func_801109B0(GlobalContext* globalCtx) { gSaveContext.unk_13EA = 0; gSaveContext.unk_13E8 = 0; - func_800AA278(&interfaceCtx->view, globalCtx->state.gfxCtx); + View_Init(&interfaceCtx->view, globalCtx->state.gfxCtx); interfaceCtx->unk_1EC = interfaceCtx->unk_1EE = 0; interfaceCtx->unk_1FA = interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0; @@ -94,71 +94,71 @@ void func_801109B0(GlobalContext* globalCtx) { __assert("parameter->icon_itemSegment != NULL", "../z_construct.c", 193); } - osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.button_items[0], - gSaveContext.equips.button_items[1], gSaveContext.equips.button_items[2], - gSaveContext.equips.button_items[3]); + osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[0], + gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2], + gSaveContext.equips.buttonItems[3]); - if (gSaveContext.equips.button_items[0] < 0xF0) { + if (gSaveContext.equips.buttonItems[0] < 0xF0) { DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment, - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000, + _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x80, 0x1000, "../z_construct.c", 198); - } else if (gSaveContext.equips.button_items[0] != 0xFF) { + } else if (gSaveContext.equips.buttonItems[0] != 0xFF) { DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment, - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000, + _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x80, 0x1000, "../z_construct.c", 203); } - if (gSaveContext.equips.button_items[1] < 0xF0) { + if (gSaveContext.equips.buttonItems[1] < 0xF0) { DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x1000), - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80, 0x1000, + _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[1] * 0x80, 0x1000, "../z_construct.c", 209); } - if (gSaveContext.equips.button_items[2] < 0xF0) { + if (gSaveContext.equips.buttonItems[2] < 0xF0) { DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x2000), - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80, 0x1000, + _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[2] * 0x80, 0x1000, "../z_construct.c", 214); } - if (gSaveContext.equips.button_items[3] < 0xF0) { + if (gSaveContext.equips.buttonItems[3] < 0xF0) { DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x3000), - _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80, 0x1000, + _icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[3] * 0x80, 0x1000, "../z_construct.c", 219); } - osSyncPrintf("EVENT=%d\n", gSaveContext.timer_1_state); + osSyncPrintf("EVENT=%d\n", gSaveContext.timer1State); - if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) || (gSaveContext.timer_2_state == 4) || - (gSaveContext.timer_2_state == 10)) { - osSyncPrintf("restart_flag=%d\n", gSaveContext.respawn_flag); + if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8) || (gSaveContext.timer2State == 4) || + (gSaveContext.timer2State == 10)) { + osSyncPrintf("restart_flag=%d\n", gSaveContext.respawnFlag); - if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1)) { - if (gSaveContext.timer_1_state == 4) { - gSaveContext.timer_1_state = 1; - gSaveContext.timer_x[0] = 140; - gSaveContext.timer_y[0] = 80; + if ((gSaveContext.respawnFlag == -1) || (gSaveContext.respawnFlag == 1)) { + if (gSaveContext.timer1State == 4) { + gSaveContext.timer1State = 1; + gSaveContext.timerX[0] = 140; + gSaveContext.timerY[0] = 80; } } - if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8)) { + if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8)) { temp = 0; } else { temp = 1; } - gSaveContext.timer_x[temp] = 26; + gSaveContext.timerX[temp] = 26; - if (gSaveContext.health_capacity > 0xA0) { - gSaveContext.timer_y[temp] = 54; + if (gSaveContext.healthCapacity > 0xA0) { + gSaveContext.timerY[temp] = 54; } else { - gSaveContext.timer_y[temp] = 46; + gSaveContext.timerY[temp] = 46; } } - if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16)) { - gSaveContext.timer_1_state = 0; + if ((gSaveContext.timer1State >= 11) && (gSaveContext.timer1State < 16)) { + gSaveContext.timer1State = 0; // Translates to: "Timer Stop!!!!!!!!!!!!!!!!!!!!!!" - osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer_1_state); + osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer1State); } // Translates to: "Parameter Area = %x" @@ -199,7 +199,7 @@ void func_80110F68(GlobalContext* globalCtx) { msgCtx->unk_E2F8 = msgCtx->unk_E3E4 = msgCtx->choiceIndex = msgCtx->unk_E3F0 = msgCtx->unk_E3D6 = 0; msgCtx->unk_E3E2 = 0xFF; - func_800AA278(&msgCtx->view, globalCtx->state.gfxCtx); + View_Init(&msgCtx->view, globalCtx->state.gfxCtx); msgCtx->textboxSegment = Game_Alloc(&globalCtx->state, 0x2200, "../z_construct.c", 349); @@ -532,7 +532,7 @@ void func_80111070(void) { WREG(94) = 3; WREG(95) = 6; - if (gSaveContext.game_mode == 0) { + if (gSaveContext.gameMode == 0) { VREG(0) = 0x34; VREG(1) = 0x24; VREG(2) = 0xD6; diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c index 914d70c89..29630f441 100644 --- a/src/code/z_debug_display.c +++ b/src/code/z_debug_display.c @@ -8,8 +8,8 @@ typedef struct { typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, u32, GlobalContext*); -static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx); -static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx); +void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx); +void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx); static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = { DebugDisplay_DrawSpriteI8, @@ -70,7 +70,7 @@ void DebugDisplay_DrawObjects(GlobalContext* globalCtx) { } } -static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx) { +void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; @@ -95,7 +95,7 @@ static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, Glo Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_debug_display.c", 192); } -static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx) { +void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 32939bf77..2a39229ac 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -49,9 +49,9 @@ u16 D_8015FCC4; s16 D_8015FCC6; u8 D_8015FCC8; s16 D_8015FCCA; -u16 D_8015FCCC; // only written to, never read -s8 D_8015FCD0[20]; // unreferenced -u8 D_8015FCE4; // only written to, never read +u16 D_8015FCCC; // only written to, never read +char D_8015FCD0[20]; // unreferenced +u8 D_8015FCE4; // only written to, never read void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx); @@ -91,7 +91,7 @@ void func_80064534(GlobalContext* globalCtx, CutsceneContext* csCtx) { } void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx) { - if (gSaveContext.cutscene_index < 0xFFF0) { + if (gSaveContext.cutsceneIndex < 0xFFF0) { sCsStateHandlers1[csCtx->state](globalCtx, csCtx); } } @@ -99,32 +99,31 @@ void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx) { void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) { Input* pad1 = &globalCtx->state.input[0]; - if (!~(pad1->press.in.button | ~L_JPAD) && (csCtx->state == CS_STATE_IDLE) && - (gSaveContext.scene_setup_index >= 4)) { + if (!~(pad1->press.in.button | ~L_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4)) { D_8015FCC8 = 0; - gSaveContext.cutscene_index = 0xFFFD; - gSaveContext.cutscene_trigger = 1; + gSaveContext.cutsceneIndex = 0xFFFD; + gSaveContext.cutsceneTrigger = 1; } - if (!~(pad1->press.in.button | ~U_JPAD) && (csCtx->state == CS_STATE_IDLE) && - (gSaveContext.scene_setup_index >= 4) && (D_8011D394 == 0)) { + if (!~(pad1->press.in.button | ~U_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.sceneSetupIndex >= 4) && + (D_8011D394 == 0)) { D_8015FCC8 = 1; - gSaveContext.cutscene_index = 0xFFFD; - gSaveContext.cutscene_trigger = 1; + gSaveContext.cutsceneIndex = 0xFFFD; + gSaveContext.cutsceneTrigger = 1; } - if ((gSaveContext.cutscene_trigger != 0) && (globalCtx->sceneLoadFlag == 0x14)) { - gSaveContext.cutscene_trigger = 0; + if ((gSaveContext.cutsceneTrigger != 0) && (globalCtx->sceneLoadFlag == 0x14)) { + gSaveContext.cutsceneTrigger = 0; } - if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE)) { + if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE)) { // Translates to: "CUTSCENE START REQUEST ANNOUNCEMENT!" osSyncPrintf("\nデモ開始要求 発令!"); - gSaveContext.cutscene_index = 0xFFFD; - gSaveContext.cutscene_trigger = 1; + gSaveContext.cutsceneIndex = 0xFFFD; + gSaveContext.cutsceneTrigger = 1; } - if (gSaveContext.cutscene_index >= 0xFFF0) { + if (gSaveContext.cutsceneIndex >= 0xFFF0) { func_80068ECC(globalCtx, csCtx); sCsStateHandlers2[csCtx->state](globalCtx, csCtx); } @@ -181,7 +180,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* if (sp3F != 0) { func_800F6D58(0xE, 4, 0x3F); func_800F6D58(0xE, 1, 1); - globalCtx->unk_10B12[0] = 0x14; + globalCtx->envCtx.unk_EE[0] = 0x14; } break; case 2: @@ -195,26 +194,26 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* case 3: if (sp3F != 0) { func_8006C3D0(globalCtx, 0); - if (gSaveContext.entrance_index == 0x0053) { + if (gSaveContext.entranceIndex == 0x0053) { func_8006C3D0(globalCtx, 2); } } break; case 6: - if (globalCtx->unk_10AC4 < 0x3200) { - globalCtx->unk_10AC4 += 0x23; + if (globalCtx->envCtx.unk_A0 < 0x3200) { + globalCtx->envCtx.unk_A0 += 0x23; } break; case 7: if (sp3F != 0) { - globalCtx->unk_10A3D = 1; - globalCtx->gloomySky = 1; - globalCtx->unk_10A3C = 0; - globalCtx->unk_10A3E = 0x3C; - globalCtx->unk_10A45 = 1; - globalCtx->unk_10A43 = 0; - globalCtx->unk_10A44 = 1; - globalCtx->unk_10A46 = globalCtx->unk_10A48 = 0x3C; + globalCtx->envCtx.unk_19 = 1; + globalCtx->envCtx.gloomySky = 1; + globalCtx->envCtx.unk_18 = 0; + globalCtx->envCtx.unk_1A = 0x3C; + globalCtx->envCtx.unk_21 = 1; + globalCtx->envCtx.unk_1F = 0; + globalCtx->envCtx.unk_20 = 1; + globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24 = 0x3C; } break; case 8: @@ -223,7 +222,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* } break; case 9: - globalCtx->unk_10B12[3] = 0x10; + globalCtx->envCtx.unk_EE[3] = 0x10; break; case 10: func_8006C3D0(globalCtx, 1); @@ -266,7 +265,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* break; case 16: if (sp3F != 0) { - D_8015FCCA = Quake_Add(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 6); + D_8015FCCA = Quake_Add(globalCtx->cameraPtrs[globalCtx->activeCamera], 6); Quake_SetSpeed(D_8015FCCA, 0x7FFF); Quake_SetQuakeValues(D_8015FCCA, 4, 0, 1000, 0); Quake_SetCountdown(D_8015FCCA, 800); @@ -278,24 +277,24 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* } break; case 18: - globalCtx->unk_10B12[0] = 0; - globalCtx->gloomySkyEvent = 2; - if (gSaveContext.day_time < 0x4AAB) { - gSaveContext.day_time += 30; + globalCtx->envCtx.unk_EE[0] = 0; + globalCtx->envCtx.gloomySkyEvent = 2; + if (gSaveContext.dayTime < 0x4AAB) { + gSaveContext.dayTime += 30; } - if (globalCtx->unk_10B12[1] == 0) { + if (globalCtx->envCtx.unk_EE[1] == 0) { D_8011FB30 = 0; func_800F6D58(14, 1, 0); } break; case 19: - gSaveContext.event_chk_inf[6] |= 0x0020; + gSaveContext.eventChkInf[6] |= 0x0020; break; case 20: - gSaveContext.event_chk_inf[6] |= 0x0080; + gSaveContext.eventChkInf[6] |= 0x0080; break; case 21: - gSaveContext.event_chk_inf[6] |= 0x0200; + gSaveContext.eventChkInf[6] |= 0x0200; break; case 22: D_801614B0.r = 0xFF; @@ -313,34 +312,34 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* globalCtx->roomCtx.curRoom.segment = NULL; break; case 25: - gSaveContext.day_time += 30; - if ((gSaveContext.day_time) > 0xCAAA) { - gSaveContext.day_time = 0xCAAA; + gSaveContext.dayTime += 30; + if ((gSaveContext.dayTime) > 0xCAAA) { + gSaveContext.dayTime = 0xCAAA; } break; case 26: - if ((gSaveContext.day_time < 0x3000) || (gSaveContext.day_time >= 0x4555)) { - if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time < 0xAAAB)) { - globalCtx->unk_10AE3 = 1; - } else if ((gSaveContext.day_time >= 0xAAAB) && (gSaveContext.day_time < 0xC556)) { - globalCtx->unk_10AE3 = 2; + if ((gSaveContext.dayTime < 0x3000) || (gSaveContext.dayTime >= 0x4555)) { + if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xAAAB)) { + globalCtx->envCtx.unk_BF = 1; + } else if ((gSaveContext.dayTime >= 0xAAAB) && (gSaveContext.dayTime < 0xC556)) { + globalCtx->envCtx.unk_BF = 2; } else { - globalCtx->unk_10AE3 = 3; + globalCtx->envCtx.unk_BF = 3; } } break; case 27: if (globalCtx->state.frames & 8) { - if (globalCtx->unk_10AB0[0] < 40) { - globalCtx->unk_10AB0[0] += 2; - globalCtx->unk_10AB0[4] -= 3; - globalCtx->unk_10AB0[5] -= 3; + if (globalCtx->envCtx.unk_8C[0] < 40) { + globalCtx->envCtx.unk_8C[0] += 2; + globalCtx->envCtx.unk_8C[4] -= 3; + globalCtx->envCtx.unk_8C[5] -= 3; } } else { - if (globalCtx->unk_10AB0[0] > 2) { - globalCtx->unk_10AB0[0] -= 2; - globalCtx->unk_10AB0[4] += 3; - globalCtx->unk_10AB0[5] += 3; + if (globalCtx->envCtx.unk_8C[0] > 2) { + globalCtx->envCtx.unk_8C[0] -= 2; + globalCtx->envCtx.unk_8C[4] += 3; + globalCtx->envCtx.unk_8C[5] += 3; } } break; @@ -358,7 +357,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* break; case 32: if (sp3F != 0) { - globalCtx->unk_10B0A = 1; + globalCtx->envCtx.unk_E6 = 1; } func_800788CC(0x20C0); break; @@ -366,10 +365,10 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* gSaveContext.unk_1422 = 1; break; case 34: - if (!gSaveContext.night_flag) { - gSaveContext.day_time -= D_8011FB40; + if (!gSaveContext.nightFlag) { + gSaveContext.dayTime -= D_8011FB40; } else { - gSaveContext.day_time -= D_8011FB40 * 2; + gSaveContext.dayTime -= D_8011FB40 * 2; } break; case 35: @@ -382,8 +381,8 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* // Command 4: Set Environment Lighting void Cutscene_Command_SetLighting(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) { if (csCtx->frames == cmd->startFrame) { - globalCtx->unk_10AE3 = cmd->setting - 1; - globalCtx->unk_10AFC = 1.0f; + globalCtx->envCtx.unk_BF = cmd->setting - 1; + globalCtx->envCtx.unk_D8 = 1.0f; } } @@ -432,8 +431,8 @@ void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTim temp1 = (cmd->hour * 60.0f) / 0.021972656f; temp2 = (cmd->minute + 1) / 0.021972656f; - gSaveContext.day_time = temp1 + temp2; - gSaveContext.environment_time = temp1 + temp2; + gSaveContext.dayTime = temp1 + temp2; + gSaveContext.environmentTime = temp1 + temp2; } } @@ -442,19 +441,19 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt Player* player = PLAYER; s32 temp = 0; - if ((gSaveContext.game_mode != 0) && (gSaveContext.game_mode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) && + if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) && (csCtx->frames > 20) && (!~(globalCtx->state.input[0].press.in.button | ~A_BUTTON) || !~(globalCtx->state.input[0].press.in.button | ~B_BUTTON) || !~(globalCtx->state.input[0].press.in.button | ~START_BUTTON)) && - (gSaveContext.file_num != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) { + (gSaveContext.fileNum != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) { Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); temp = 1; } if ((csCtx->frames == cmd->startFrame) || (temp != 0) || ((csCtx->frames > 20) && (!~(globalCtx->state.input[0].press.in.button | ~START_BUTTON)) && - (gSaveContext.file_num != 0xFEDC))) { + (gSaveContext.fileNum != 0xFEDC))) { csCtx->state = CS_STATE_UNSKIPPABLE_EXEC; func_800F68BC(0); gSaveContext.unk_1410 = 1; @@ -462,66 +461,66 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt // Translates to: "FUTURE FORK DESIGNATION=No. [%d]" osSyncPrintf("\n分岐先指定!!=[%d]番", cmd->base); - if ((gSaveContext.game_mode != 0) && (csCtx->frames != cmd->startFrame)) { + if ((gSaveContext.gameMode != 0) && (csCtx->frames != cmd->startFrame)) { gSaveContext.unk_13E7 = 1; } - gSaveContext.cutscene_index = 0; + gSaveContext.cutsceneIndex = 0; switch (cmd->base) { case 1: globalCtx->nextEntranceIndex = 0x00A0; - gSaveContext.cutscene_index = 0xFFF1; + gSaveContext.cutsceneIndex = 0xFFF1; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 2: globalCtx->nextEntranceIndex = 0x00A0; - gSaveContext.cutscene_index = 0xFFF0; + gSaveContext.cutsceneIndex = 0xFFF0; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xA; + globalCtx->fadeTransition = 10; break; case 3: globalCtx->nextEntranceIndex = 0x0117; - gSaveContext.cutscene_index = 0xFFF1; + gSaveContext.cutsceneIndex = 0xFFF1; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xA; + globalCtx->fadeTransition = 10; break; case 4: globalCtx->nextEntranceIndex = 0x013D; - gSaveContext.cutscene_index = 0xFFF0; + gSaveContext.cutsceneIndex = 0xFFF0; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xA; + globalCtx->fadeTransition = 10; break; case 5: globalCtx->nextEntranceIndex = 0x00EE; - gSaveContext.cutscene_index = 0xFFF0; + gSaveContext.cutsceneIndex = 0xFFF0; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xA; + globalCtx->fadeTransition = 10; break; case 6: globalCtx->nextEntranceIndex = 0x00A0; - gSaveContext.cutscene_index = 0xFFF2; + gSaveContext.cutsceneIndex = 0xFFF2; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xA; + globalCtx->fadeTransition = 10; break; case 7: globalCtx->nextEntranceIndex = 0x00EE; - gSaveContext.cutscene_index = 0xFFF2; + gSaveContext.cutsceneIndex = 0xFFF2; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xB; + globalCtx->fadeTransition = 11; break; case 8: gSaveContext.fw.set = 0; gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0; - if (!(gSaveContext.event_chk_inf[4] & 0x20)) { - gSaveContext.event_chk_inf[4] |= 0x20; + if (!(gSaveContext.eventChkInf[4] & 0x20)) { + gSaveContext.eventChkInf[4] |= 0x20; globalCtx->nextEntranceIndex = 0x00A0; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF3; - globalCtx->fadeOutTransition = 0xB; + gSaveContext.cutsceneIndex = 0xFFF3; + globalCtx->fadeTransition = 11; } else { - if (gSaveContext.scene_setup_index < 4) { + if (gSaveContext.sceneSetupIndex < 4) { if (LINK_IS_CHILD) { globalCtx->linkAgeOnLoad = 0; } else { @@ -530,358 +529,358 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt } globalCtx->nextEntranceIndex = 0x02CA; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; - gSaveContext.transition_type = 3; + globalCtx->fadeTransition = 3; + gSaveContext.nextTransition = 3; } break; case 9: globalCtx->nextEntranceIndex = 0x0117; - gSaveContext.cutscene_index = 0xFFF0; + gSaveContext.cutsceneIndex = 0xFFF0; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xc; + globalCtx->fadeTransition = 12; break; case 10: globalCtx->nextEntranceIndex = 0x00BB; - gSaveContext.cutscene_index = 0xFFF0; + gSaveContext.cutsceneIndex = 0xFFF0; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 11: globalCtx->nextEntranceIndex = 0x00EE; - gSaveContext.cutscene_index = 0xFFF3; + gSaveContext.cutsceneIndex = 0xFFF3; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; + globalCtx->fadeTransition = 3; break; case 12: globalCtx->nextEntranceIndex = 0x047A; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 13: globalCtx->nextEntranceIndex = 0x010E; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; - gSaveContext.transition_type = 2; + globalCtx->fadeTransition = 2; + gSaveContext.nextTransition = 2; break; case 14: globalCtx->nextEntranceIndex = 0x0457; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 15: globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF4; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF4; + globalCtx->fadeTransition = 3; break; case 16: globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF5; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF5; + globalCtx->fadeTransition = 3; break; case 17: globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF6; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF6; + globalCtx->fadeTransition = 3; break; case 18: - gSaveContext.event_chk_inf[4] |= 0x8000; + gSaveContext.eventChkInf[4] |= 0x8000; globalCtx->nextEntranceIndex = 0x0324; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; - gSaveContext.transition_type = 2; + globalCtx->fadeTransition = 2; + gSaveContext.nextTransition = 2; break; case 19: globalCtx->nextEntranceIndex = 0x013D; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 4; - gSaveContext.cutscene_index = 0x8000; + globalCtx->fadeTransition = 4; + gSaveContext.cutsceneIndex = 0x8000; break; case 21: globalCtx->nextEntranceIndex = 0x0102; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF0; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF0; + globalCtx->fadeTransition = 3; break; case 22: Item_Give(globalCtx, ITEM_SONG_REQUIEM); globalCtx->nextEntranceIndex = 0x0123; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF0; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF0; + globalCtx->fadeTransition = 3; break; case 23: globalCtx->nextEntranceIndex = 0x00A0; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF8; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF8; + globalCtx->fadeTransition = 3; break; case 24: globalCtx->nextEntranceIndex = 0x0028; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 25: globalCtx->linkAgeOnLoad = 0; globalCtx->nextEntranceIndex = 0x006B; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF0; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF0; + globalCtx->fadeTransition = 3; break; case 26: globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF4; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF4; + globalCtx->fadeTransition = 3; break; case 27: globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF5; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF5; + globalCtx->fadeTransition = 3; break; case 28: globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF6; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF6; + globalCtx->fadeTransition = 3; break; case 29: globalCtx->nextEntranceIndex = 0x006B; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.chamber_cutscene_num = 0; - globalCtx->fadeOutTransition = 3; + gSaveContext.chamberCutsceneNum = 0; + globalCtx->fadeTransition = 3; break; case 30: globalCtx->nextEntranceIndex = 0x006B; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; + globalCtx->fadeTransition = 3; Item_Give(globalCtx, ITEM_MEDALLION_FIRE); - gSaveContext.chamber_cutscene_num = 1; + gSaveContext.chamberCutsceneNum = 1; break; case 31: globalCtx->nextEntranceIndex = 0x006B; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; - gSaveContext.chamber_cutscene_num = 2; + globalCtx->fadeTransition = 3; + gSaveContext.chamberCutsceneNum = 2; break; case 32: globalCtx->linkAgeOnLoad = 1; globalCtx->nextEntranceIndex = 0x00CD; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF2; - globalCtx->fadeOutTransition = 0xb; + gSaveContext.cutsceneIndex = 0xFFF2; + globalCtx->fadeTransition = 11; break; case 33: globalCtx->nextEntranceIndex = 0x00CD; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; + globalCtx->fadeTransition = 3; break; case 34: globalCtx->nextEntranceIndex = 0x00A0; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF3; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF3; + globalCtx->fadeTransition = 3; break; case 35: globalCtx->nextEntranceIndex = 0x00CD; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF0; - globalCtx->fadeOutTransition = 4; + gSaveContext.cutsceneIndex = 0xFFF0; + globalCtx->fadeTransition = 4; break; case 38: globalCtx->nextEntranceIndex = 0x00A0; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF4; - globalCtx->fadeOutTransition = 4; + gSaveContext.cutsceneIndex = 0xFFF4; + globalCtx->fadeTransition = 4; break; case 39: globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF9; - globalCtx->fadeOutTransition = 4; + gSaveContext.cutsceneIndex = 0xFFF9; + globalCtx->fadeTransition = 4; break; case 40: globalCtx->linkAgeOnLoad = 0; globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFFA; - globalCtx->fadeOutTransition = 4; + gSaveContext.cutsceneIndex = 0xFFFA; + globalCtx->fadeTransition = 4; break; case 41: globalCtx->nextEntranceIndex = 0x04E6; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 42: globalCtx->nextEntranceIndex = 0x00DB; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF2; - globalCtx->fadeOutTransition = 4; + gSaveContext.cutsceneIndex = 0xFFF2; + globalCtx->fadeTransition = 4; break; case 43: globalCtx->nextEntranceIndex = 0x0503; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 4; + globalCtx->fadeTransition = 4; break; case 44: globalCtx->nextEntranceIndex = 0x0320; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0x11; + globalCtx->fadeTransition = 17; break; case 46: - gSaveContext.event_chk_inf[4] |= 0x8000; + gSaveContext.eventChkInf[4] |= 0x8000; globalCtx->nextEntranceIndex = 0x0324; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 4; + globalCtx->fadeTransition = 4; break; case 47: Item_Give(globalCtx, ITEM_SONG_NOCTURNE); - gSaveContext.event_chk_inf[5] |= 0x10; + gSaveContext.eventChkInf[5] |= 0x10; globalCtx->nextEntranceIndex = 0x00DB; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF1; - globalCtx->fadeOutTransition = 4; + gSaveContext.cutsceneIndex = 0xFFF1; + globalCtx->fadeTransition = 4; break; case 48: globalCtx->nextEntranceIndex = 0x01ED; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xF; - gSaveContext.transition_type = 0xF; + globalCtx->fadeTransition = 15; + gSaveContext.nextTransition = 15; break; case 49: globalCtx->nextEntranceIndex = 0x058C; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 4; + globalCtx->fadeTransition = 4; break; case 50: globalCtx->nextEntranceIndex = 0x0513; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0x11; + globalCtx->fadeTransition = 17; break; case 51: globalCtx->nextEntranceIndex = 0x00CD; - gSaveContext.cutscene_index = 0xFFF8; + gSaveContext.cutsceneIndex = 0xFFF8; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0x29; + globalCtx->fadeTransition = 41; break; case 52: globalCtx->nextEntranceIndex = 0x0053; - gSaveContext.cutscene_index = 0xFFF7; + gSaveContext.cutsceneIndex = 0xFFF7; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xb; + globalCtx->fadeTransition = 11; break; case 53: globalCtx->nextEntranceIndex = 0x050F; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; + globalCtx->fadeTransition = 3; break; case 54: - gSaveContext.game_mode = 3; + gSaveContext.gameMode = 3; func_800F7260(0x6F); globalCtx->linkAgeOnLoad = 1; globalCtx->nextEntranceIndex = 0x0117; - gSaveContext.cutscene_index = 0xFFF2; + gSaveContext.cutsceneIndex = 0xFFF2; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 55: globalCtx->nextEntranceIndex = 0x0129; - gSaveContext.cutscene_index = 0xFFF1; + gSaveContext.cutsceneIndex = 0xFFF1; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 56: globalCtx->nextEntranceIndex = 0x00DB; - gSaveContext.cutscene_index = 0xFFF4; + gSaveContext.cutsceneIndex = 0xFFF4; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 57: globalCtx->nextEntranceIndex = 0x013D; - gSaveContext.cutscene_index = 0xFFF3; + gSaveContext.cutsceneIndex = 0xFFF3; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 58: globalCtx->nextEntranceIndex = 0x014D; - gSaveContext.cutscene_index = 0xFFF1; + gSaveContext.cutsceneIndex = 0xFFF1; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 59: globalCtx->nextEntranceIndex = 0x0102; - gSaveContext.cutscene_index = 0xFFF1; + gSaveContext.cutsceneIndex = 0xFFF1; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 60: globalCtx->nextEntranceIndex = 0x010E; - gSaveContext.cutscene_index = 0xFFF2; + gSaveContext.cutsceneIndex = 0xFFF2; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 61: globalCtx->nextEntranceIndex = 0x0108; - gSaveContext.cutscene_index = 0xFFF0; + gSaveContext.cutsceneIndex = 0xFFF0; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 62: globalCtx->linkAgeOnLoad = 0; globalCtx->nextEntranceIndex = 0x00EE; - gSaveContext.cutscene_index = 0xFFF6; + gSaveContext.cutsceneIndex = 0xFFF6; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 63: globalCtx->nextEntranceIndex = 0x00EE; - gSaveContext.cutscene_index = 0xFFF7; + gSaveContext.cutsceneIndex = 0xFFF7; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 64: globalCtx->nextEntranceIndex = 0x00CD; - gSaveContext.cutscene_index = 0xFFF5; + gSaveContext.cutsceneIndex = 0xFFF5; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 65: globalCtx->linkAgeOnLoad = 1; globalCtx->nextEntranceIndex = 0x0157; - gSaveContext.cutscene_index = 0xFFF2; + gSaveContext.cutsceneIndex = 0xFFF2; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 66: globalCtx->nextEntranceIndex = 0x0554; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 67: globalCtx->nextEntranceIndex = 0x027E; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 68: globalCtx->nextEntranceIndex = 0x00A0; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF5; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF5; + globalCtx->fadeTransition = 2; break; case 69: globalCtx->nextEntranceIndex = 0x05E8; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 70: globalCtx->nextEntranceIndex = 0x013D; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF4; - globalCtx->fadeOutTransition = 2; - gSaveContext.transition_type = 2; + gSaveContext.cutsceneIndex = 0xFFF4; + globalCtx->fadeTransition = 2; + gSaveContext.nextTransition = 2; break; case 71: gSaveContext.equips.equipment |= 0x0100; @@ -891,56 +890,56 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt globalCtx->linkAgeOnLoad = 1; globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF1; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF1; + globalCtx->fadeTransition = 2; break; case 72: globalCtx->nextEntranceIndex = 0x0400; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF0; - globalCtx->fadeOutTransition = 2; - gSaveContext.transition_type = 2; + gSaveContext.cutsceneIndex = 0xFFF0; + globalCtx->fadeTransition = 2; + gSaveContext.nextTransition = 2; break; case 73: globalCtx->linkAgeOnLoad = 1; globalCtx->nextEntranceIndex = 0x0157; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF2; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF2; + globalCtx->fadeTransition = 2; break; case 74: globalCtx->nextEntranceIndex = 0x0157; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF3; - globalCtx->fadeOutTransition = 3; - gSaveContext.transition_type = 3; + gSaveContext.cutsceneIndex = 0xFFF3; + globalCtx->fadeTransition = 3; + gSaveContext.nextTransition = 3; break; case 75: globalCtx->linkAgeOnLoad = 1; globalCtx->nextEntranceIndex = 0x0157; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF4; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF4; + globalCtx->fadeTransition = 2; break; case 76: globalCtx->linkAgeOnLoad = 0; globalCtx->nextEntranceIndex = 0x0157; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF5; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF5; + globalCtx->fadeTransition = 2; break; case 77: globalCtx->linkAgeOnLoad = 1; globalCtx->nextEntranceIndex = 0x0157; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF6; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF6; + globalCtx->fadeTransition = 2; break; case 78: globalCtx->nextEntranceIndex = 0x0157; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF7; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF7; + globalCtx->fadeTransition = 2; break; case 79: case 80: @@ -959,124 +958,124 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt case 93: globalCtx->nextEntranceIndex = 0x0157; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 94: globalCtx->nextEntranceIndex = 0x02AE; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; + globalCtx->fadeTransition = 3; break; case 95: - if ((gSaveContext.event_chk_inf[4] & 0x100) && (gSaveContext.event_chk_inf[4] & 0x200) && - (gSaveContext.event_chk_inf[4] & 0x400)) { + if ((gSaveContext.eventChkInf[4] & 0x100) && (gSaveContext.eventChkInf[4] & 0x200) && + (gSaveContext.eventChkInf[4] & 0x400)) { globalCtx->nextEntranceIndex = 0x0053; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF3; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF3; + globalCtx->fadeTransition = 2; } else { - switch (gSaveContext.scene_setup_index) { + switch (gSaveContext.sceneSetupIndex) { case 8: globalCtx->nextEntranceIndex = 0x00FC; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 9: globalCtx->nextEntranceIndex = 0x0147; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 10: globalCtx->nextEntranceIndex = 0x0102; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF0; - globalCtx->fadeOutTransition = 3; + gSaveContext.cutsceneIndex = 0xFFF0; + globalCtx->fadeTransition = 3; break; } } break; case 96: - if (gBitFlags[4] & gSaveContext.quest_items) { + if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) { globalCtx->nextEntranceIndex = 0x006B; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF1; - globalCtx->fadeOutTransition = 5; + gSaveContext.cutsceneIndex = 0xFFF1; + globalCtx->fadeTransition = 5; } else { - gSaveContext.event_chk_inf[12] |= 0x100; + gSaveContext.eventChkInf[12] |= 0x100; globalCtx->nextEntranceIndex = 0x0610; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; - gSaveContext.transition_type = 3; + globalCtx->fadeTransition = 3; + gSaveContext.nextTransition = 3; } break; case 97: - if (gBitFlags[3] & gSaveContext.quest_items) { + if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { globalCtx->nextEntranceIndex = 0x006B; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF1; - globalCtx->fadeOutTransition = 5; + gSaveContext.cutsceneIndex = 0xFFF1; + globalCtx->fadeTransition = 5; } else { globalCtx->nextEntranceIndex = 0x0580; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; - gSaveContext.transition_type = 3; + globalCtx->fadeTransition = 3; + gSaveContext.nextTransition = 3; } break; case 98: globalCtx->nextEntranceIndex = 0x0564; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; - gSaveContext.transition_type = 3; + globalCtx->fadeTransition = 3; + gSaveContext.nextTransition = 3; break; case 99: globalCtx->nextEntranceIndex = 0x0608; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; - gSaveContext.transition_type = 2; + globalCtx->fadeTransition = 2; + gSaveContext.nextTransition = 2; break; case 100: globalCtx->nextEntranceIndex = 0x00EE; - gSaveContext.cutscene_index = 0xFFF8; + gSaveContext.cutsceneIndex = 0xFFF8; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; - gSaveContext.transition_type = 3; + globalCtx->fadeTransition = 3; + gSaveContext.nextTransition = 3; break; case 101: globalCtx->nextEntranceIndex = 0x01F5; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 0xF; + globalCtx->fadeTransition = 15; break; case 102: globalCtx->nextEntranceIndex = 0x0590; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 103: globalCtx->nextEntranceIndex = 0x00CD; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF3; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF3; + globalCtx->fadeTransition = 2; break; case 104: switch (sTitleCsState) { case 0: globalCtx->nextEntranceIndex = 0x008D; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF2; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF2; + globalCtx->fadeTransition = 2; sTitleCsState++; break; case 1: globalCtx->nextEntranceIndex = 0x0147; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF1; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF1; + globalCtx->fadeTransition = 2; sTitleCsState++; break; case 2: globalCtx->nextEntranceIndex = 0x00A0; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF6; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF6; + globalCtx->fadeTransition = 2; sTitleCsState = 0; break; } @@ -1084,101 +1083,101 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt case 105: globalCtx->nextEntranceIndex = 0x00E4; globalCtx->sceneLoadFlag = 0x14; - gSaveContext.cutscene_index = 0xFFF1; - globalCtx->fadeOutTransition = 2; + gSaveContext.cutsceneIndex = 0xFFF1; + globalCtx->fadeTransition = 2; break; case 106: globalCtx->nextEntranceIndex = 0x0574; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 107: globalCtx->nextEntranceIndex = 0x0538; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 108: globalCtx->nextEntranceIndex = 0x053C; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 109: globalCtx->nextEntranceIndex = 0x0540; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 110: globalCtx->nextEntranceIndex = 0x0544; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 111: globalCtx->nextEntranceIndex = 0x0548; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 112: globalCtx->nextEntranceIndex = 0x054C; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 113: if (Flags_GetEventChkInf(0xBB) && Flags_GetEventChkInf(0xBC) && Flags_GetEventChkInf(0xBD) && Flags_GetEventChkInf(0xBE) && Flags_GetEventChkInf(0xBF) && Flags_GetEventChkInf(0xAD)) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&D_0201DA50); globalCtx->csCtx.frames = 0; - gSaveContext.cutscene_trigger = 1; - gSaveContext.cutscene_index = 0xFFFF; + gSaveContext.cutsceneTrigger = 1; + gSaveContext.cutsceneIndex = 0xFFFF; csCtx->state = CS_STATE_UNSKIPPABLE_INIT; } else { - gSaveContext.cutscene_index = 0xFFFF; + gSaveContext.cutsceneIndex = 0xFFFF; csCtx->state = CS_STATE_UNSKIPPABLE_INIT; } break; case 114: globalCtx->nextEntranceIndex = 0x0185; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; break; case 115: globalCtx->nextEntranceIndex = 0x0594; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 2; - gSaveContext.transition_type = 2; + globalCtx->fadeTransition = 2; + gSaveContext.nextTransition = 2; break; case 116: - if (gSaveContext.event_chk_inf[12] & 0x100) { + if (gSaveContext.eventChkInf[12] & 0x100) { globalCtx->nextEntranceIndex = 0x0580; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; + globalCtx->fadeTransition = 3; } else { globalCtx->nextEntranceIndex = 0x0610; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; + globalCtx->fadeTransition = 3; } - gSaveContext.transition_type = 3; + gSaveContext.nextTransition = 3; break; case 117: - gSaveContext.game_mode = 3; + gSaveContext.gameMode = 3; func_800F7260(0x6F); globalCtx->linkAgeOnLoad = 0; globalCtx->nextEntranceIndex = 0x00CD; - gSaveContext.cutscene_index = 0xFFF7; + gSaveContext.cutsceneIndex = 0xFFF7; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; + globalCtx->fadeTransition = 3; break; case 118: - gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance_index = 0x0517; - func_800C0B60(globalCtx); - gSaveContext.respawn_flag = -2; - gSaveContext.transition_type = 2; + gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = 0x0517; + Gameplay_TriggerVoidOut(globalCtx); + gSaveContext.respawnFlag = -2; + gSaveContext.nextTransition = 2; break; case 119: - gSaveContext.day_time = 0x8000; - gSaveContext.environment_time = 0x8000; + gSaveContext.dayTime = 0x8000; + gSaveContext.environmentTime = 0x8000; globalCtx->nextEntranceIndex = 0x05F0; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; + globalCtx->fadeTransition = 3; break; } } @@ -1189,63 +1188,63 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs f32 temp; if ((csCtx->frames >= cmd->startFrame) && (csCtx->frames <= cmd->endFrame)) { - globalCtx->unk_10B05 = 1; + globalCtx->envCtx.unk_E1 = 1; temp = func_8006F93C(cmd->endFrame, cmd->startFrame, csCtx->frames); switch (cmd->base) { case 1: case 5: - globalCtx->unk_10B06[0] = 0xA0; - globalCtx->unk_10B06[1] = 0xA0; - globalCtx->unk_10B06[2] = 0xA0; + globalCtx->envCtx.unk_E2[0] = 0xA0; + globalCtx->envCtx.unk_E2[1] = 0xA0; + globalCtx->envCtx.unk_E2[2] = 0xA0; if (cmd->base == 1) { - globalCtx->unk_10B06[3] = 255.0f * temp; - if ((temp == 0.0f) && (gSaveContext.entrance_index == 0x006B)) { + globalCtx->envCtx.unk_E2[3] = 255.0f * temp; + if ((temp == 0.0f) && (gSaveContext.entranceIndex == 0x006B)) { Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else if ((temp == 0.0f) && - ((gSaveContext.entrance_index == 0x0053) || (gSaveContext.entrance_index == 0x0138) || - (gSaveContext.entrance_index == 0x0371))) { + ((gSaveContext.entranceIndex == 0x0053) || (gSaveContext.entranceIndex == 0x0138) || + (gSaveContext.entranceIndex == 0x0371))) { Audio_PlaySoundGeneral(NA_SE_EV_WHITE_OUT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else if ((temp == 0.0f) && (globalCtx->sceneNum == SCENE_GANONTIKA)) { func_800788CC(NA_SE_EV_WHITE_OUT); } } else { - globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; + globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f; } break; case 2: case 6: - globalCtx->unk_10B06[0] = 0; - globalCtx->unk_10B06[1] = 0; - globalCtx->unk_10B06[2] = 0xFF; + globalCtx->envCtx.unk_E2[0] = 0; + globalCtx->envCtx.unk_E2[1] = 0; + globalCtx->envCtx.unk_E2[2] = 0xFF; if (cmd->base == 2) { - globalCtx->unk_10B06[3] = 255.0f * temp; + globalCtx->envCtx.unk_E2[3] = 255.0f * temp; } else { - globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; + globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f; } break; case 3: case 7: - globalCtx->unk_10B06[0] = 0xFF; - globalCtx->unk_10B06[1] = 0; - globalCtx->unk_10B06[2] = 0; + globalCtx->envCtx.unk_E2[0] = 0xFF; + globalCtx->envCtx.unk_E2[1] = 0; + globalCtx->envCtx.unk_E2[2] = 0; if (cmd->base == 3) { - globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; + globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f; } else { - globalCtx->unk_10B06[3] = 255.0f * temp; + globalCtx->envCtx.unk_E2[3] = 255.0f * temp; } break; case 4: case 8: - globalCtx->unk_10B06[0] = 0; - globalCtx->unk_10B06[1] = 0xFF; - globalCtx->unk_10B06[2] = 0; + globalCtx->envCtx.unk_E2[0] = 0; + globalCtx->envCtx.unk_E2[1] = 0xFF; + globalCtx->envCtx.unk_E2[2] = 0; if (cmd->base == 4) { - globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; + globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f; } else { - globalCtx->unk_10B06[3] = 255.0f * temp; + globalCtx->envCtx.unk_E2[3] = 255.0f * temp; } break; case 9: @@ -1253,23 +1252,23 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs break; case 10: case 11: - globalCtx->unk_10B06[0] = 0; - globalCtx->unk_10B06[1] = 0; - globalCtx->unk_10B06[2] = 0; + globalCtx->envCtx.unk_E2[0] = 0; + globalCtx->envCtx.unk_E2[1] = 0; + globalCtx->envCtx.unk_E2[2] = 0; if (cmd->base == 10) { - globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f; + globalCtx->envCtx.unk_E2[3] = (1.0f - temp) * 255.0f; } else { - globalCtx->unk_10B06[3] = 255.0f * temp; + globalCtx->envCtx.unk_E2[3] = 255.0f * temp; } break; case 12: gSaveContext.unk_1410 = 255.0f - (155.0f * temp); break; case 13: - globalCtx->unk_10B06[0] = 0; - globalCtx->unk_10B06[1] = 0; - globalCtx->unk_10B06[2] = 0; - globalCtx->unk_10B06[3] = 255.0f - ((1.0f - temp) * 155.0f); + globalCtx->envCtx.unk_E2[0] = 0; + globalCtx->envCtx.unk_E2[1] = 0; + globalCtx->envCtx.unk_E2[2] = 0; + globalCtx->envCtx.unk_E2[3] = 255.0f - ((1.0f - temp) * 155.0f); break; } } @@ -1291,11 +1290,11 @@ s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext* if (csCtx->unk_1A != 0) { csCtx->unk_18 = cmdBase->startFrame; if (D_8015FCC8 != 0) { - func_800C0874(globalCtx, csCtx->unk_16, 0x25); - func_800C0314(globalCtx, D_8015FCC6, 1); - func_800C0314(globalCtx, csCtx->unk_16, 7); - func_8005AC60(func_800C04A4(globalCtx, csCtx->unk_16)); - func_8005AC6C(func_800C04A4(globalCtx, csCtx->unk_16), csCtx->cameraFocus, csCtx->cameraPosition, + func_800C0874(globalCtx, csCtx->unk_14, 0x25); + Gameplay_ChangeCameraStatus(globalCtx, D_8015FCC6, 1); + Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, 7); + func_8005AC60(Gameplay_GetCamera(globalCtx, csCtx->unk_14)); + func_8005AC6C(Gameplay_GetCamera(globalCtx, csCtx->unk_14), csCtx->cameraFocus, csCtx->cameraPosition, PLAYER, relativeToLink); } } @@ -1328,11 +1327,11 @@ s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCt if (csCtx->unk_1B != 0) { D_8015FCC0 = cmdBase->startFrame; if (D_8015FCC8 != 0) { - func_800C0874(globalCtx, csCtx->unk_16, 0x25); - func_800C0314(globalCtx, D_8015FCC6, 1); - func_800C0314(globalCtx, csCtx->unk_16, 7); - func_8005AC60(func_800C04A4(globalCtx, csCtx->unk_16)); - func_8005AC6C(func_800C04A4(globalCtx, csCtx->unk_16), csCtx->cameraFocus, csCtx->cameraPosition, + func_800C0874(globalCtx, csCtx->unk_14, 0x25); + Gameplay_ChangeCameraStatus(globalCtx, D_8015FCC6, 1); + Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, 7); + func_8005AC60(Gameplay_GetCamera(globalCtx, csCtx->unk_14)); + func_8005AC6C(Gameplay_GetCamera(globalCtx, csCtx->unk_14), csCtx->cameraFocus, csCtx->cameraPosition, PLAYER, relativeToLink); } } @@ -1368,11 +1367,11 @@ s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm if (csCtx->unk_1A != 0) { D_8015FCC2 = cmdBase->startFrame; if (D_8015FCC8 != 0) { - sp2C = func_800C04A4(globalCtx, csCtx->unk_16); + sp2C = Gameplay_GetCamera(globalCtx, csCtx->unk_14); sp2C->player = NULL; - func_800C0314(globalCtx, 0, 1); - func_800C0314(globalCtx, csCtx->unk_16, 7); - func_800C0874(globalCtx, csCtx->unk_16, 0x21); + Gameplay_ChangeCameraStatus(globalCtx, 0, 1); + Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, 7); + func_800C0874(globalCtx, csCtx->unk_14, 0x21); sp28 = csCtx->cameraFocus->cameraRoll * 1.40625f; func_8005AA90(sp2C, 64, &sp28); sp3C.x = csCtx->cameraFocus->pos.x; @@ -1381,8 +1380,8 @@ s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm sp30.x = csCtx->cameraPosition->pos.x; sp30.y = csCtx->cameraPosition->pos.y; sp30.z = csCtx->cameraPosition->pos.z; - func_800C04D8(globalCtx, csCtx->unk_16, &sp3C, &sp30); - func_800C0704(globalCtx, csCtx->unk_16, csCtx->cameraPosition->viewAngle); + func_800C04D8(globalCtx, csCtx->unk_14, &sp3C, &sp30); + func_800C0704(globalCtx, csCtx->unk_14, csCtx->cameraPosition->viewAngle); } } } @@ -1411,19 +1410,19 @@ s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm if (csCtx->unk_1B != 0) { D_8015FCC4 = cmdBase->startFrame; if (D_8015FCC8 != 0) { - sp2C = func_800C04A4(globalCtx, csCtx->unk_16); + sp2C = Gameplay_GetCamera(globalCtx, csCtx->unk_14); sp2C->player = NULL; - func_800C0314(globalCtx, 0, 1); - func_800C0314(globalCtx, csCtx->unk_16, 7); - func_800C0874(globalCtx, csCtx->unk_16, 0x21); + Gameplay_ChangeCameraStatus(globalCtx, 0, 1); + Gameplay_ChangeCameraStatus(globalCtx, csCtx->unk_14, 7); + func_800C0874(globalCtx, csCtx->unk_14, 0x21); sp3C.x = csCtx->cameraFocus->pos.x; sp3C.y = csCtx->cameraFocus->pos.y; sp3C.z = csCtx->cameraFocus->pos.z; sp30.x = csCtx->cameraPosition->pos.x; sp30.y = csCtx->cameraPosition->pos.y; sp30.z = csCtx->cameraPosition->pos.z; - func_800C04D8(globalCtx, csCtx->unk_16, &sp3C, &sp30); - func_800C0704(globalCtx, csCtx->unk_16, csCtx->cameraPosition->viewAngle); + func_800C04D8(globalCtx, csCtx->unk_14, &sp3C, &sp30); + func_800C0704(globalCtx, csCtx->unk_14, csCtx->cameraPosition->viewAngle); } } } @@ -1442,9 +1441,9 @@ void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx, if (cmd->type != 2) { if (D_8011E1C0 != cmd->base) { D_8011E1C0 = cmd->base; - if ((cmd->type == 3) && (gBitFlags[20] & gSaveContext.quest_items)) { + if ((cmd->type == 3) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { func_8010B680(globalCtx, cmd->textId1, 0); - } else if ((cmd->type == 4) && (gBitFlags[19] & gSaveContext.quest_items)) { + } else if ((cmd->type == 4) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { func_8010B680(globalCtx, cmd->textId1, 0); } else { func_8010B680(globalCtx, cmd->base, 0); @@ -1860,7 +1859,7 @@ void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx) { if (0) {} // Necessary to match - if (gSaveContext.cutscene_index >= 0xFFF0) { + if (gSaveContext.cutsceneIndex >= 0xFFF0) { if (0) {} // Also necessary to match if (BREG(0) != 0) { @@ -1906,21 +1905,21 @@ void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) { // Translates to: "RIGHT HERE, HUH" osSyncPrintf("\n\n\n\n\nやっぱりここかいな"); - gSaveContext.cutscene_index = 0; - gSaveContext.game_mode = 0; + gSaveContext.cutsceneIndex = 0; + gSaveContext.gameMode = 0; if (D_8015FCC8 != 0) { - switch (gSaveContext.entrance_index) { + switch (gSaveContext.entranceIndex) { case 0x028A: case 0x028E: case 0x0292: case 0x0476: - func_800C078C(globalCtx, D_8015FCC6, csCtx->unk_16); + func_800C078C(globalCtx, D_8015FCC6, csCtx->unk_14); } - func_800C0314(globalCtx, D_8015FCC6, 7); - func_800C0384(globalCtx, csCtx->unk_16); - func_8005B1A4(globalCtx->cameraCtx.activeCameraPtrs[D_8015FCC6]); + Gameplay_ChangeCameraStatus(globalCtx, D_8015FCC6, 7); + Gameplay_ClearCamera(globalCtx, csCtx->unk_14); + func_8005B1A4(globalCtx->cameraPtrs[D_8015FCC6]); } func_800F68BC(0); @@ -1931,11 +1930,11 @@ void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) { void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) { u8 i; - if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE) && !func_8008E988(globalCtx)) { - gSaveContext.cutscene_index = 0xFFFD; + if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE) && !func_8008E988(globalCtx)) { + gSaveContext.cutsceneIndex = 0xFFFD; } - if ((gSaveContext.cutscene_index >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) { + if ((gSaveContext.cutsceneIndex >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) { func_8006C438(globalCtx, 0); D_8011E1C0 = 0; @@ -1959,13 +1958,13 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) { D_8015FCC4 = 0xFFFF; csCtx->unk_1A = 0; csCtx->unk_1B = 0; - D_8015FCC6 = globalCtx->cameraCtx.unk_5C0; + D_8015FCC6 = globalCtx->activeCamera; if (D_8015FCC8 != 0) { - csCtx->unk_14_all = func_800C0230(globalCtx); + csCtx->unk_14 = Gameplay_CreateSubCamera(globalCtx); } - if (gSaveContext.cutscene_trigger == 0) { + if (gSaveContext.cutsceneTrigger == 0) { Interface_ChangeAlpha(1); func_800B3840(0x20); func_800B38A4(0x20); @@ -1975,7 +1974,7 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) { func_80068C3C(globalCtx, csCtx); } - gSaveContext.cutscene_trigger = 0; + gSaveContext.cutsceneTrigger = 0; } } @@ -2005,16 +2004,16 @@ void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx) { requiredAge = entranceCutscene->ageRestriction; if (requiredAge == 2) { - requiredAge = gSaveContext.link_age; + requiredAge = gSaveContext.linkAge; } - if ((gSaveContext.entrance_index == entranceCutscene->entrance) && + if ((gSaveContext.entranceIndex == entranceCutscene->entrance) && (!Flags_GetEventChkInf(entranceCutscene->flag) || (entranceCutscene->flag == 0x18)) && - (gSaveContext.cutscene_index < 0xFFF0) && ((u8)gSaveContext.link_age == requiredAge) && - (gSaveContext.respawn_flag <= 0)) { + (gSaveContext.cutsceneIndex < 0xFFF0) && ((u8)gSaveContext.linkAge == requiredAge) && + (gSaveContext.respawnFlag <= 0)) { Flags_SetEventChkInf(entranceCutscene->flag); Cutscene_SetSegment(globalCtx, entranceCutscene->segAddr); - gSaveContext.cutscene_trigger = 2; + gSaveContext.cutsceneTrigger = 2; gSaveContext.unk_13C7 = 0; break; } @@ -2024,33 +2023,34 @@ void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx) { #ifdef NON_MATCHING // regalloc differences void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) { - osSyncPrintf("\ngame_info.mode=[%d] restart_flag", gSaveContext.respawn_flag); + osSyncPrintf("\ngame_info.mode=[%d] restart_flag", gSaveContext.respawnFlag); - if ((gSaveContext.game_mode == 0) && (gSaveContext.respawn_flag <= 0) && (gSaveContext.cutscene_index < 0xFFF0)) { - if ((gSaveContext.entrance_index == 0x01E1) && !Flags_GetEventChkInf(0xAC)) { + if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) { + if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC)) { Flags_SetEventChkInf(0xAC); - gSaveContext.entrance_index = 0x0123; - gSaveContext.cutscene_index = 0xFFF0; - } else if ((gSaveContext.entrance_index == 0x00DB) && LINK_IS_ADULT && - (gSaveContext.event_chk_inf[4] & 0x0100) && (gSaveContext.event_chk_inf[4] & 0x0200) && - (gSaveContext.event_chk_inf[4] & 0x0400) && !Flags_GetEventChkInf(0xAA)) { + gSaveContext.entranceIndex = 0x0123; + gSaveContext.cutsceneIndex = 0xFFF0; + } else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (gSaveContext.eventChkInf[4] & 0x0100) && + (gSaveContext.eventChkInf[4] & 0x0200) && (gSaveContext.eventChkInf[4] & 0x0400) && + !Flags_GetEventChkInf(0xAA)) { Flags_SetEventChkInf(0xAA); - gSaveContext.cutscene_index = 0xFFF0; - } else if ((gSaveContext.entrance_index == 0x05E0) && !Flags_GetEventChkInf(0xC1)) { + gSaveContext.cutsceneIndex = 0xFFF0; + } else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(0xC1)) { Flags_SetEventChkInf(0xC1); Item_Give(globalCtx, ITEM_OCARINA_FAIRY); - gSaveContext.entrance_index = 0x011E; - gSaveContext.cutscene_index = 0xFFF0; - } else if ((gBitFlags[3] & gSaveContext.quest_items) && (gBitFlags[4] & gSaveContext.quest_items) && + gSaveContext.entranceIndex = 0x011E; + gSaveContext.cutsceneIndex = 0xFFF0; + } else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) && - (gEntranceTable[gSaveContext.entrance_index].scene == 67)) { + (gEntranceTable[gSaveContext.entranceIndex].scene == SCENE_TOKINOMA)) { Flags_SetEventChkInf(0xC4); - gSaveContext.entrance_index = 0x0053; - gSaveContext.cutscene_index = 0xFFF8; - } else if (!Flags_GetEventChkInf(0xC7) && (gEntranceTable[gSaveContext.entrance_index].scene == 79)) { + gSaveContext.entranceIndex = 0x0053; + gSaveContext.cutsceneIndex = 0xFFF8; + } else if (!Flags_GetEventChkInf(0xC7) && + (gEntranceTable[gSaveContext.entranceIndex].scene == SCENE_GANON_DEMO)) { Flags_SetEventChkInf(0xC7); - gSaveContext.entrance_index = 0x0517; - gSaveContext.cutscene_index = 0xFFF0; + gSaveContext.entranceIndex = 0x0517; + gSaveContext.cutsceneIndex = 0xFFF0; } } } diff --git a/src/code/z_draw.c b/src/code/z_draw.c index ce07d2b36..fc23c0f91 100644 --- a/src/code/z_draw.c +++ b/src/code/z_draw.c @@ -2,32 +2,32 @@ #include <global.h> // "Get Item" Model Draw Functions -static void func_800694E4(GlobalContext* globalCtx, s16 drawId); -static void func_800695C0(GlobalContext* globalCtx, s16 drawId); -static void func_8006969C(GlobalContext* globalCtx, s16 drawId); -static void func_80069880(GlobalContext* globalCtx, s16 drawId); -static void func_80069AC8(GlobalContext* globalCtx, s16 drawId); -static void func_80069CF0(GlobalContext* globalCtx, s16 drawId); -static void func_80069EB0(GlobalContext* globalCtx, s16 drawId); -static void func_8006A060(GlobalContext* globalCtx, s16 drawId); -static void func_8006A158(GlobalContext* globalCtx, s16 drawId); -static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId); -static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId); -static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId); -static void func_8006A73C(GlobalContext* globalCtx, s16 drawId); -static void func_8006A88C(GlobalContext* globalCtx, s16 drawId); -static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId); -static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId); -static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId); -static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId); -static void func_8006AE40(GlobalContext* globalCtx, s16 drawId); -static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId); -static void func_8006B124(GlobalContext* globalCtx, s16 drawId); -static void func_8006B24C(GlobalContext* globalCtx, s16 drawId); -static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId); -static void func_8006B54C(GlobalContext* globalCtx, s16 drawId); -static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId); -static void func_8006B870(GlobalContext* globalCtx, s16 drawId); +void func_800694E4(GlobalContext* globalCtx, s16 drawId); +void func_800695C0(GlobalContext* globalCtx, s16 drawId); +void func_8006969C(GlobalContext* globalCtx, s16 drawId); +void func_80069880(GlobalContext* globalCtx, s16 drawId); +void func_80069AC8(GlobalContext* globalCtx, s16 drawId); +void func_80069CF0(GlobalContext* globalCtx, s16 drawId); +void func_80069EB0(GlobalContext* globalCtx, s16 drawId); +void func_8006A060(GlobalContext* globalCtx, s16 drawId); +void func_8006A158(GlobalContext* globalCtx, s16 drawId); +void func_8006A2A0(GlobalContext* globalCtx, s16 drawId); +void func_8006A4B0(GlobalContext* globalCtx, s16 drawId); +void func_8006A5F0(GlobalContext* globalCtx, s16 drawId); +void func_8006A73C(GlobalContext* globalCtx, s16 drawId); +void func_8006A88C(GlobalContext* globalCtx, s16 drawId); +void func_8006A9CC(GlobalContext* globalCtx, s16 drawId); +void func_8006AAA8(GlobalContext* globalCtx, s16 drawId); +void func_8006ABEC(GlobalContext* globalCtx, s16 drawId); +void func_8006ACE4(GlobalContext* globalCtx, s16 drawId); +void func_8006AE40(GlobalContext* globalCtx, s16 drawId); +void func_8006AF9C(GlobalContext* globalCtx, s16 drawId); +void func_8006B124(GlobalContext* globalCtx, s16 drawId); +void func_8006B24C(GlobalContext* globalCtx, s16 drawId); +void func_8006B3C0(GlobalContext* globalCtx, s16 drawId); +void func_8006B54C(GlobalContext* globalCtx, s16 drawId); +void func_8006B6E4(GlobalContext* globalCtx, s16 drawId); +void func_8006B870(GlobalContext* globalCtx, s16 drawId); typedef struct { /* 0x00 */ void (*drawFunc)(GlobalContext*, s16); @@ -35,7 +35,7 @@ typedef struct { } DrawItemTableEntry; // size = 0x24 // TODO: use symbols for these dlists once objects are in C -static DrawItemTableEntry sDrawItemTable[] = { +DrawItemTableEntry sDrawItemTable[] = { { func_8006AAA8, { 0x06000670, 0x06000750 } }, { func_8006A9CC, { 0x06000800 } }, { func_8006ABEC, { 0x06000A80, 0x06000AE0 } }, @@ -167,7 +167,7 @@ void func_800694A0(GlobalContext* globalCtx, s16 drawId) { // All remaining functions in this file are draw functions referenced in the table and called by the function above -static void func_800694E4(GlobalContext* globalCtx, s16 drawId) { +void func_800694E4(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -181,7 +181,7 @@ static void func_800694E4(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 565); } -static void func_800695C0(GlobalContext* globalCtx, s16 drawId) { +void func_800695C0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -195,7 +195,7 @@ static void func_800695C0(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 581); } -static void func_8006969C(GlobalContext* globalCtx, s16 drawId) { +void func_8006969C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -222,7 +222,7 @@ static void func_8006969C(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 621); } -static void func_80069880(GlobalContext* globalCtx, s16 drawId) { +void func_80069880(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -252,7 +252,7 @@ static void func_80069880(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 663); } -static void func_80069AC8(GlobalContext* globalCtx, s16 drawId) { +void func_80069AC8(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -281,7 +281,7 @@ static void func_80069AC8(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 704); } -static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) { +void func_80069CF0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -305,7 +305,7 @@ static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 735); } -static void func_80069EB0(GlobalContext* globalCtx, s16 drawId) { +void func_80069EB0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -328,7 +328,7 @@ static void func_80069EB0(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 765); } -static void func_8006A060(GlobalContext* globalCtx, s16 drawId) { +void func_8006A060(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -343,7 +343,7 @@ static void func_8006A060(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 783); } -static void func_8006A158(GlobalContext* globalCtx, s16 drawId) { +void func_8006A158(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -362,7 +362,7 @@ static void func_8006A158(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 827); } -static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) { +void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -389,7 +389,7 @@ static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 861); } -static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) { +void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -407,7 +407,7 @@ static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 883); } -static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) { +void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -425,7 +425,7 @@ static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 906); } -static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) { +void func_8006A73C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -443,7 +443,7 @@ static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 929); } -static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) { +void func_8006A88C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -461,7 +461,7 @@ static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 952); } -static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) { +void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -475,7 +475,7 @@ static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 968); } -static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) { +void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -494,7 +494,7 @@ static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 991); } -static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) { +void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -507,7 +507,7 @@ static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1008); } -static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) { +void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -527,7 +527,7 @@ static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1032); } -static void func_8006AE40(GlobalContext* globalCtx, s16 drawId) { +void func_8006AE40(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -547,7 +547,7 @@ static void func_8006AE40(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1056); } -static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) { +void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -567,7 +567,7 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1081); } -static void func_8006B124(GlobalContext* globalCtx, s16 drawId) { +void func_8006B124(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -584,7 +584,7 @@ static void func_8006B124(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1100); } -static void func_8006B24C(GlobalContext* globalCtx, s16 drawId) { +void func_8006B24C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -605,7 +605,7 @@ static void func_8006B24C(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1126); } -static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) { +void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -628,7 +628,7 @@ static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1154); } -static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) { +void func_8006B54C(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -649,7 +649,7 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1181); } -static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) { +void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -671,7 +671,7 @@ static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1207); } -static void func_8006B870(GlobalContext* globalCtx, s16 drawId) { +void func_8006B870(GlobalContext* globalCtx, s16 drawId) { u32 pad; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index ad7ae66c6..e37756c6d 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -22,10 +22,10 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) { switch (msg->byte0 & 0x1E) { case 0: temp = 1 << (msg->byte1 & 0x0F); - return ((msg->byte0 & 1) == 1) == !!(gSaveContext.event_chk_inf[(msg->byte1 & 0xF0) >> 4] & temp); + return ((msg->byte0 & 1) == 1) == !!(gSaveContext.eventChkInf[(msg->byte1 & 0xF0) >> 4] & temp); case 2: return ((msg->byte0 & 1) == 1) == - !!(gBitFlags[msg->byte1 - ITEM_KEY_BOSS] & gSaveContext.dungeon_items[gSaveContext.dungeon_index]); + !!(gBitFlags[msg->byte1 - ITEM_KEY_BOSS] & gSaveContext.dungeonItems[gSaveContext.dungeonIndex]); case 4: return ((msg->byte0 & 1) == 1) == (msg->byte3 == INV_CONTENT(msg->byte1)); case 6: @@ -38,12 +38,12 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) { gSaveContext.equipment); case 0x20: return ((msg->byte0 & 1) == 1) == - !!(gBitFlags[msg->byte3 - ITEM_SONG_MINUET + 6] & gSaveContext.quest_items); + !!(CHECK_QUEST_ITEM(msg->byte3 - ITEM_SONG_MINUET + QUEST_SONG_MINUET)); case 0x30: return ((msg->byte0 & 1) == 1) == - !!(gBitFlags[msg->byte3 - ITEM_MEDALLION_FOREST] & gSaveContext.quest_items); + !!(CHECK_QUEST_ITEM(msg->byte3 - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST)); case 0x40: - return ((msg->byte0 & 1) == 1) == !!gSaveContext.magic_acquired; + return ((msg->byte0 & 1) == 1) == !!gSaveContext.magicAcquired; } } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 7d71802bb..dde4f6535 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -886,13 +886,13 @@ s16 func_8001F404(s16 dropId) { // clang-format off if (((dropId == DROP_BOMBS_A || dropId == DROP_BOMBS_SPECIAL || dropId == DROP_BOMBS_B) && INV_CONTENT(ITEM_BOMB) == ITEM_NONE) || ((dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) && INV_CONTENT(ITEM_BOW) == ITEM_NONE) || - ((dropId == DROP_MAGIC_LARGE || dropId == DROP_MAGIC_SMALL) && gSaveContext.magic_level == 0) || + ((dropId == DROP_MAGIC_LARGE || dropId == DROP_MAGIC_SMALL) && gSaveContext.magicLevel == 0) || ((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE)) { return -1; } // clang-format on - if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health) { + if (dropId == DROP_HEART && gSaveContext.healthCapacity == gSaveContext.health) { return DROP_RUPEE_GREEN; } @@ -1038,12 +1038,12 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3 params = 0xA * 0x10; dropTableIndex = 0x0; dropId = DROP_HEART; - } else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) { // Empty magic meter + } else if ((gSaveContext.magicLevel != 0) && (gSaveContext.magic == 0)) { // Empty magic meter params = 0xA * 0x10; dropTableIndex = 0x0; dropId = DROP_MAGIC_LARGE; - } else if ((gSaveContext.magic_level != 0) && - (gSaveContext.magic <= (gSaveContext.magic_level >> 1))) { // Half magic or less + } else if ((gSaveContext.magicLevel != 0) && + (gSaveContext.magic <= (gSaveContext.magicLevel >> 1))) { // Half magic or less params = 0xA * 0x10; dropTableIndex = 0x0; dropId = DROP_MAGIC_SMALL; diff --git a/src/code/z_face_reaction.c b/src/code/z_face_reaction.c index 1bfe18b7c..906835e33 100644 --- a/src/code/z_face_reaction.c +++ b/src/code/z_face_reaction.c @@ -1,7 +1,7 @@ #include <ultra64.h> #include <global.h> -u16 sReactionTextIds[60][9] = { +u16 sReactionTextIds[][9] = { { 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 }, { 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B }, { 0x0000, 0x7128, 0x712B, 0x7128, 0x7128, 0x7129, 0x7128, 0x712B, 0x7128 }, diff --git a/src/code/z_game_dlftbls.c b/src/code/z_game_dlftbls.c index 025cdda6d..03241b33f 100644 --- a/src/code/z_game_dlftbls.c +++ b/src/code/z_game_dlftbls.c @@ -12,7 +12,7 @@ GameStateOverlay gGameStateOverlayTable[] = { GAMESTATE_OVERLAY_INTERNAL(TitleSetup_Init, TitleSetup_Destroy, sizeof(GameState)), GAMESTATE_OVERLAY(select, func_80801E44, func_80801E0C, 0x240), // TODO : sizeof(SelectContext) GAMESTATE_OVERLAY(title, Title_Init, Title_Destroy, sizeof(TitleContext)), - GAMESTATE_OVERLAY_INTERNAL(func_800BCA64, func_800BC8EC, sizeof(GlobalContext)), + GAMESTATE_OVERLAY_INTERNAL(Gameplay_Init, Gameplay_Destroy, sizeof(GlobalContext)), GAMESTATE_OVERLAY(opening, Opening_Init, Opening_Destroy, sizeof(OpeningContext)), GAMESTATE_OVERLAY(file_choose, func_80811A20, func_80811A18, 0x1CAE0), }; diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 44612269b..4f6b8d5fa 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -16,20 +16,20 @@ s32 func_8006CFC0(s32 scene) { } void func_8006D074(GlobalContext* globalCtx) { - gSaveContext.horse_data.scene = SCENE_SPOT00; - gSaveContext.horse_data.pos.x = -1840; - gSaveContext.horse_data.pos.y = 72; - gSaveContext.horse_data.pos.z = 5497; - gSaveContext.horse_data.angle = -27353; + gSaveContext.horseData.scene = SCENE_SPOT00; + gSaveContext.horseData.pos.x = -1840; + gSaveContext.horseData.pos.y = 72; + gSaveContext.horseData.pos.z = 5497; + gSaveContext.horseData.angle = -27353; } void func_8006D0AC(GlobalContext* globalCtx) { - if (gSaveContext.horse_data.scene == SCENE_SPOT06) { - gSaveContext.horse_data.scene = SCENE_SPOT06; - gSaveContext.horse_data.pos.x = -2065; - gSaveContext.horse_data.pos.y = -863; - gSaveContext.horse_data.pos.z = 1839; - gSaveContext.horse_data.angle = 0; + if (gSaveContext.horseData.scene == SCENE_SPOT06) { + gSaveContext.horseData.scene = SCENE_SPOT06; + gSaveContext.horseData.pos.x = -2065; + gSaveContext.horseData.pos.y = -863; + gSaveContext.horseData.pos.z = 1839; + gSaveContext.horseData.angle = 0; } } @@ -59,35 +59,35 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) { func_8002DECC(globalCtx, player, player->rideActor); func_8002DE74(globalCtx, player); - gSaveContext.horse_data.scene = globalCtx->sceneNum; + gSaveContext.horseData.scene = globalCtx->sceneNum; if (globalCtx->sceneNum == SCENE_SPOT12) { player->rideActor->room = -1; } - } else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3)) { + } else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigameState == 3)) { Actor* horseActor; - gSaveContext.minigame_state = 0; + gSaveContext.minigameState = 0; horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1); horseActor->room = -1; - } else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100)) { + } else if ((gSaveContext.entranceIndex == 1230) && (gSaveContext.eventChkInf[1] & 0x100)) { Actor* horseActor; horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1); if (horseActor == NULL) { __assert("horse_actor != NULL", "../z_horse.c", 389); } - } else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) && + } else if ((globalCtx->sceneNum == gSaveContext.horseData.scene) && (Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) { // Translates to: "SET BY EXISTENCE OF HORSE %d %d %d" - osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18), + osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(0x18), DREG(1)); - if (func_8006CFC0(gSaveContext.horse_data.scene)) { + if (func_8006CFC0(gSaveContext.horseData.scene)) { Actor* horseActor; - horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, gSaveContext.horse_data.pos.x, - gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z, 0, - gSaveContext.horse_data.angle, 0, 1); + horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, gSaveContext.horseData.pos.x, + gSaveContext.horseData.pos.y, gSaveContext.horseData.pos.z, 0, + gSaveContext.horseData.angle, 0, 1); if (horseActor == NULL) { __assert("horse_actor != NULL", "../z_horse.c", 414); } @@ -98,7 +98,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) { } else { osSyncPrintf(VT_COL(RED, WHITE)); // Translates to: "Horse_SetNormal():%d SET SPOT IS NO GOOD." - osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene); + osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horseData.scene); osSyncPrintf(VT_RST); func_8006D074(globalCtx); } @@ -128,7 +128,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) { } } } else if (!Flags_GetEventChkInf(0x18)) { - if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.night_flag != 0)) { + if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.nightFlag != 0)) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1); } } @@ -149,9 +149,9 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { s32 i; Vec3s spawnPos; - if ((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E || - gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) && - (gSaveContext.respawn_flag == 0)) { + if ((gSaveContext.entranceIndex == 0x028A || gSaveContext.entranceIndex == 0x028E || + gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) && + (gSaveContext.respawnFlag == 0)) { Vec3s spawnPositions[] = { { 0xF46F, 0x0139, 0x1E14 }, { 0xF894, 0x0139, 0x1B67 }, @@ -159,11 +159,11 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { { 0xF6F7, 0x0139, 0x1766 }, }; - if (gSaveContext.entrance_index == 0x028A) { + if (gSaveContext.entranceIndex == 0x028A) { spawnPos = spawnPositions[0]; - } else if (gSaveContext.entrance_index == 0x028E) { + } else if (gSaveContext.entranceIndex == 0x028E) { spawnPos = spawnPositions[1]; - } else if (gSaveContext.entrance_index == 0x0292) { + } else if (gSaveContext.entranceIndex == 0x0292) { spawnPos = spawnPositions[2]; } else { spawnPos = spawnPositions[3]; @@ -177,8 +177,8 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { func_8002DECC(globalCtx, player, player->rideActor); func_8002DE74(globalCtx, player); - gSaveContext.horse_data.scene = globalCtx->sceneNum; - } else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) && + gSaveContext.horseData.scene = globalCtx->sceneNum; + } else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) && (Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) { player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5); @@ -188,7 +188,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { func_8002DECC(globalCtx, player, player->rideActor); func_8002DE74(globalCtx, player); - gSaveContext.horse_data.scene = globalCtx->sceneNum; + gSaveContext.horseData.scene = globalCtx->sceneNum; if (globalCtx->sceneNum == SCENE_SPOT12) { player->rideActor->room = -1; @@ -203,9 +203,9 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) { if ((globalCtx->sceneNum == D_8011F9B8[i].scene) && - (gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex)) { + (gSaveContext.cutsceneIndex == D_8011F9B8[i].cutsceneIndex)) { if (D_8011F9B8[i].type == 7) { - if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1)) { + if ((globalCtx->sceneNum == 99) && (gSaveContext.cutsceneIndex == 0xFFF1)) { D_8011F9B8[i].pos.x = player->actor.posRot.pos.x; D_8011F9B8[i].pos.y = player->actor.posRot.pos.y; D_8011F9B8[i].pos.z = player->actor.posRot.pos.z; @@ -226,7 +226,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { s32 pad2; temp = 0; - if (((gSaveContext.event_inf[0] & 0x10) >> 4) && D_8011F9B8[i].type == 6) { + if (((gSaveContext.eventInf[0] & 0x10) >> 4) && D_8011F9B8[i].type == 6) { temp = 0x8000; } @@ -250,7 +250,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { sp54.y = player->actor.posRot.pos.y + 100.0f; sp54.z = player->actor.posRot.pos.z; - func_800C04D8(globalCtx, globalCtx->cameraCtx.unk_5C0, &player->actor.posRot, &sp54); + func_800C04D8(globalCtx, globalCtx->activeCamera, &player->actor.posRot.pos, &sp54); } else { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0, @@ -279,20 +279,20 @@ struct_8011F9B8 D_8011F9B8[] = { void func_8006DC68(GlobalContext* globalCtx, Player* player) { if (LINK_IS_ADULT) { - if (!func_8006CFC0(gSaveContext.horse_data.scene)) { + if (!func_8006CFC0(gSaveContext.horseData.scene)) { osSyncPrintf(VT_COL(RED, WHITE)); // Translates to: "Horse_Set_Check():%d SET SPOT IS NO GOOD." - osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene); + osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horseData.scene); osSyncPrintf(VT_RST); func_8006D074(globalCtx); } if (func_8006CFC0(globalCtx->sceneNum)) { - if ((gSaveContext.scene_setup_index > 3) || - ((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E || - gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) && - (gSaveContext.respawn_flag == 0)) || - ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) && + if ((gSaveContext.sceneSetupIndex > 3) || + ((gSaveContext.entranceIndex == 0x028A || gSaveContext.entranceIndex == 0x028E || + gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) && + (gSaveContext.respawnFlag == 0)) || + ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) { func_8006D684(globalCtx, player); } else { diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c index cd430e55a..9cc05db1c 100644 --- a/src/code/z_lifemeter.c +++ b/src/code/z_lifemeter.c @@ -199,13 +199,13 @@ void Interface_DrawHealth(GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Vtx* sp154 = interfaceCtx->vtx_12C; s32 curHeartFraction = gSaveContext.health % 0x10; - s16 totalHeartCount = gSaveContext.health_capacity / 0x10; + s16 totalHeartCount = gSaveContext.healthCapacity / 0x10; s16 fullHeartCount = gSaveContext.health / 0x10; s32 pad2; f32 sp144 = interfaceCtx->unk_22A * 0.1f; s32 curCombineModeSet = 0; u8* curBgImgLoaded = NULL; - s32 ddHeartCountMinusOne = gSaveContext.defense_hearts - 1; + s32 ddHeartCountMinusOne = gSaveContext.defenseHearts - 1; Gfx* dispRefs[5]; Graph_OpenDisps(dispRefs, gfxCtx, "../z_lifemeter.c", 353); @@ -393,7 +393,7 @@ void Health_HandleCriticalAlarm(GlobalContext* globalCtx) { interfaceCtx->unk_22A = 0; interfaceCtx->unk_22C = 0; if (!func_8008E988(globalCtx) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && - Health_IsCritical() && !func_800BFC84(globalCtx)) { + Health_IsCritical() && !Gameplay_InCsMode(globalCtx)) { func_80078884(NA_SE_SY_HITPOINT_ALARM); } } @@ -409,11 +409,11 @@ void Health_HandleCriticalAlarm(GlobalContext* globalCtx) { u32 Health_IsCritical(void) { s32 var; - if (gSaveContext.health_capacity <= 0x50) { + if (gSaveContext.healthCapacity <= 0x50) { var = 0x10; - } else if (gSaveContext.health_capacity <= 0xA0) { + } else if (gSaveContext.healthCapacity <= 0xA0) { var = 0x18; - } else if (gSaveContext.health_capacity <= 0xF0) { + } else if (gSaveContext.healthCapacity <= 0xF0) { var = 0x20; } else { var = 0x2C; diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c index fd82cca8f..ce9b1a599 100644 --- a/src/code/z_malloc.c +++ b/src/code/z_malloc.c @@ -10,13 +10,13 @@ Arena sZeldaArena; void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { if (!ptr) { if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) { - //"%s: %u bytes %s failed\n" + // "%s: %u bytes %s failed\n" osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action); __osDisplayArena(&sZeldaArena); return; } } else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { - //"%s: %u bytes %s succeeded\n" + // "%s: %u bytes %s succeeded\n" osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action); } } diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index 698715ffe..8fdef5d0c 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -88,7 +88,7 @@ void MapMark_Draw(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* dispRefs[4]; - dungeonId = gSaveContext.dungeon_index; + dungeonId = gSaveContext.dungeonIndex; interfaceCtx = &globalCtx->interfaceCtx; if ((D_8015FFD0 != NULL) && (globalCtx->interfaceCtx.roomNum >= D_8015FFD0[7][dungeonId])) { diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 10e285b8b..6b51e685c 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -158,7 +158,7 @@ void Interface_ChangeAlpha(u16 alphaType) { void func_80082644(GlobalContext* globalCtx, s16 alpha) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; - if (gSaveContext.button_status[0] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[0] == BTN_DISABLED) { if (interfaceCtx->bAlpha != 0x46) { interfaceCtx->bAlpha = 0x46; } @@ -168,7 +168,7 @@ void func_80082644(GlobalContext* globalCtx, s16 alpha) { } } - if (gSaveContext.button_status[1] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[1] == BTN_DISABLED) { if (interfaceCtx->cLeftAlpha != 0x46) { interfaceCtx->cLeftAlpha = 0x46; } @@ -178,7 +178,7 @@ void func_80082644(GlobalContext* globalCtx, s16 alpha) { } } - if (gSaveContext.button_status[2] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[2] == BTN_DISABLED) { if (interfaceCtx->cDownAlpha != 0x46) { interfaceCtx->cDownAlpha = 0x46; } @@ -188,7 +188,7 @@ void func_80082644(GlobalContext* globalCtx, s16 alpha) { } } - if (gSaveContext.button_status[3] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[3] == BTN_DISABLED) { if (interfaceCtx->cRightAlpha != 0x46) { interfaceCtx->cRightAlpha = 0x46; } @@ -198,7 +198,7 @@ void func_80082644(GlobalContext* globalCtx, s16 alpha) { } } - if (gSaveContext.button_status[4] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[4] == BTN_DISABLED) { if (interfaceCtx->aAlpha != 0x46) { interfaceCtx->aAlpha = 0x46; } @@ -606,54 +606,54 @@ void func_80083108(GlobalContext* globalCtx) { sp28 = 0; - if ((gSaveContext.cutscene_index < 0xFFF0) || - ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.cutscene_index == 0xFFF0))) { + if ((gSaveContext.cutsceneIndex < 0xFFF0) || + ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.cutsceneIndex == 0xFFF0))) { gSaveContext.unk_13E7 = 0; if ((player->stateFlags1 & 0x00800000) || (globalCtx->unk_11E5C >= 2) || ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { - if (gSaveContext.equips.button_items[0] != ITEM_NONE) { + if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { gSaveContext.unk_13E7 = 1; - if (gSaveContext.button_status[0] == BTN_DISABLED) { - gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = - gSaveContext.button_status[3] = BTN_ENABLED; + if (gSaveContext.buttonStatus[0] == BTN_DISABLED) { + gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = + gSaveContext.buttonStatus[3] = BTN_ENABLED; } - if ((gSaveContext.equips.button_items[0] != ITEM_SLINGSHOT) && - (gSaveContext.equips.button_items[0] != ITEM_BOW) && - (gSaveContext.equips.button_items[0] != ITEM_BOMBCHU) && - (gSaveContext.equips.button_items[0] != ITEM_NONE)) { - gSaveContext.button_status[0] = gSaveContext.equips.button_items[0]; + if ((gSaveContext.equips.buttonItems[0] != ITEM_SLINGSHOT) && + (gSaveContext.equips.buttonItems[0] != ITEM_BOW) && + (gSaveContext.equips.buttonItems[0] != ITEM_BOMBCHU) && + (gSaveContext.equips.buttonItems[0] != ITEM_NONE)) { + gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0]; if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) { - gSaveContext.equips.button_items[0] = ITEM_BOMBCHU; + gSaveContext.equips.buttonItems[0] = ITEM_BOMBCHU; Interface_LoadItemIcon1(globalCtx, 0); } else { - gSaveContext.equips.button_items[0] = ITEM_BOW; + gSaveContext.equips.buttonItems[0] = ITEM_BOW; if (globalCtx->unk_11E5C >= 2) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - gSaveContext.equips.button_items[0] = ITEM_SLINGSHOT; + gSaveContext.equips.buttonItems[0] = ITEM_SLINGSHOT; } Interface_LoadItemIcon1(globalCtx, 0); } else { if (gSaveContext.items[SLOT_BOW] == ITEM_NONE) { - gSaveContext.equips.button_items[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[0] = ITEM_NONE; } else { Interface_LoadItemIcon1(globalCtx, 0); } } } - gSaveContext.button_status[1] = gSaveContext.button_status[2] = gSaveContext.button_status[3] = + gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = BTN_DISABLED; Interface_ChangeAlpha(6); } if (globalCtx->unk_1241B != 0) { Interface_ChangeAlpha(1); - } else if (gSaveContext.minigame_state == 1) { + } else if (gSaveContext.minigameState == 1) { Interface_ChangeAlpha(8); } else if (globalCtx->unk_11E5C >= 2) { Interface_ChangeAlpha(8); @@ -672,9 +672,9 @@ void func_80083108(GlobalContext* globalCtx) { } else if (globalCtx->sceneNum == SCENE_TURIBORI) { gSaveContext.unk_13E7 = 2; if (globalCtx->interfaceCtx.unk_260 != 0) { - if (gSaveContext.equips.button_items[0] != ITEM_FISHING_POLE) { - gSaveContext.button_status[0] = gSaveContext.equips.button_items[0]; - gSaveContext.equips.button_items[0] = ITEM_FISHING_POLE; + if (gSaveContext.equips.buttonItems[0] != ITEM_FISHING_POLE) { + gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0]; + gSaveContext.equips.buttonItems[0] = ITEM_FISHING_POLE; gSaveContext.unk_13EA = 0; Interface_LoadItemIcon1(globalCtx, 0); Interface_ChangeAlpha(12); @@ -683,56 +683,56 @@ void func_80083108(GlobalContext* globalCtx) { if (gSaveContext.unk_13EA != 12) { Interface_ChangeAlpha(12); } - } else if (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE) { - gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; + } else if (gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE) { + gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; gSaveContext.unk_13EA = 0; - if (gSaveContext.equips.button_items[0] != ITEM_NONE) { + if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { Interface_LoadItemIcon1(globalCtx, 0); } - gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = - gSaveContext.button_status[3] = BTN_DISABLED; + gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = + gSaveContext.buttonStatus[3] = BTN_DISABLED; Interface_ChangeAlpha(50); } else { - if (gSaveContext.button_status[0] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[0] == BTN_ENABLED) { gSaveContext.unk_13EA = 0; } - gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = - gSaveContext.button_status[3] = BTN_DISABLED; + gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = + gSaveContext.buttonStatus[3] = BTN_DISABLED; Interface_ChangeAlpha(50); } } else if (msgCtx->msgMode == 0) { if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) { - if (gSaveContext.button_status[0] != BTN_DISABLED) { + if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[0] = BTN_DISABLED; + gSaveContext.buttonStatus[0] = BTN_DISABLED; for (i = 1; i < 4; i++) { if (func_8008F2F8(globalCtx) == 2) { - if ((gSaveContext.equips.button_items[i] != ITEM_HOOKSHOT) && - (gSaveContext.equips.button_items[i] != ITEM_LONGSHOT)) { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) && + (gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; } else { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } else { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; } } @@ -742,22 +742,22 @@ void func_80083108(GlobalContext* globalCtx) { Interface_ChangeAlpha(50); } else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & 0x00040000)) { - if (gSaveContext.button_status[0] != BTN_DISABLED) { - gSaveContext.button_status[0] = BTN_DISABLED; - gSaveContext.button_status[1] = BTN_DISABLED; - gSaveContext.button_status[2] = BTN_DISABLED; - gSaveContext.button_status[3] = BTN_DISABLED; + if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { + gSaveContext.buttonStatus[0] = BTN_DISABLED; + gSaveContext.buttonStatus[1] = BTN_DISABLED; + gSaveContext.buttonStatus[2] = BTN_DISABLED; + gSaveContext.buttonStatus[3] = BTN_DISABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); } - } else if ((gSaveContext.event_inf[0] & 0xF) == 1) { + } else if ((gSaveContext.eventInf[0] & 0xF) == 1) { if (player->stateFlags1 & 0x00800000) { - if ((gSaveContext.equips.button_items[0] != ITEM_NONE) && - (gSaveContext.equips.button_items[0] != ITEM_BOW)) { + if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) && + (gSaveContext.equips.buttonItems[0] != ITEM_BOW)) { if (gSaveContext.items[SLOT_BOW] == ITEM_NONE) { - gSaveContext.equips.button_items[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[0] = ITEM_NONE; } else { - gSaveContext.equips.button_items[0] = ITEM_BOW; + gSaveContext.equips.buttonItems[0] = ITEM_BOW; sp28 = 1; } } @@ -765,16 +765,16 @@ void func_80083108(GlobalContext* globalCtx) { do { sp28 = 1; - if ((gSaveContext.equips.button_items[0] == ITEM_NONE) || - (gSaveContext.equips.button_items[0] == ITEM_BOW)) { + if ((gSaveContext.equips.buttonItems[0] == ITEM_NONE) || + (gSaveContext.equips.buttonItems[0] == ITEM_BOW)) { - if ((gSaveContext.equips.button_items[0] != ITEM_SWORD_KOKIRI) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_MASTER) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_BGS) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE)) { - gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; + if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && + (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) && + (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_BGS) && + (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KNIFE)) { + gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; } else { - gSaveContext.button_status[0] = gSaveContext.equips.button_items[0]; + gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0]; } } } while (0); // Necessary to match @@ -786,19 +786,19 @@ void func_80083108(GlobalContext* globalCtx) { } for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] != ITEM_OCARINA_FAIRY) && - (gSaveContext.equips.button_items[i] != ITEM_OCARINA_TIME)) { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + if ((gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_FAIRY) && + (gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_TIME)) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; } else { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } @@ -809,235 +809,235 @@ void func_80083108(GlobalContext* globalCtx) { Interface_ChangeAlpha(50); } else { if (interfaceCtx->restrictions.bButton == 0) { - if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) || - (gSaveContext.equips.button_items[0] == ITEM_BOW) || - (gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.button_items[0] == ITEM_NONE)) { - if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) { - gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; + if ((gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT) || + (gSaveContext.equips.buttonItems[0] == ITEM_BOW) || + (gSaveContext.equips.buttonItems[0] == ITEM_BOMBCHU) || + (gSaveContext.equips.buttonItems[0] == ITEM_NONE)) { + if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) || (gSaveContext.infTable[29] == 0)) { + gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; sp28 = 1; - if (gSaveContext.equips.button_items[0] != ITEM_NONE) { + if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { Interface_LoadItemIcon1(globalCtx, 0); } } - } else if ((gSaveContext.button_status[0] & 0xFF) == BTN_DISABLED) { + } else if ((gSaveContext.buttonStatus[0] & 0xFF) == BTN_DISABLED) { sp28 = 1; - if (((gSaveContext.button_status[0] & 0xFF) == BTN_DISABLED) || - ((gSaveContext.button_status[0] & 0xFF) == BTN_ENABLED)) { - gSaveContext.button_status[0] = BTN_ENABLED; + if (((gSaveContext.buttonStatus[0] & 0xFF) == BTN_DISABLED) || + ((gSaveContext.buttonStatus[0] & 0xFF) == BTN_ENABLED)) { + gSaveContext.buttonStatus[0] = BTN_ENABLED; } else { - gSaveContext.equips.button_items[0] = gSaveContext.button_status[0] & 0xFF; + gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0] & 0xFF; } } } else if (interfaceCtx->restrictions.bButton == 1) { - if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) || - (gSaveContext.equips.button_items[0] == ITEM_BOW) || - (gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.button_items[0] == ITEM_NONE)) { - if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) { - gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; + if ((gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT) || + (gSaveContext.equips.buttonItems[0] == ITEM_BOW) || + (gSaveContext.equips.buttonItems[0] == ITEM_BOMBCHU) || + (gSaveContext.equips.buttonItems[0] == ITEM_NONE)) { + if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) || (gSaveContext.infTable[29] == 0)) { + gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; sp28 = 1; - if (gSaveContext.equips.button_items[0] != ITEM_NONE) { + if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { Interface_LoadItemIcon1(globalCtx, 0); } } } else { - if (gSaveContext.button_status[0] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[0] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[0] = BTN_DISABLED; + gSaveContext.buttonStatus[0] = BTN_DISABLED; } } if (interfaceCtx->restrictions.bottles != 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && - (gSaveContext.equips.button_items[i] <= ITEM_POE)) { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + if ((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && + (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.bottles == 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && - (gSaveContext.equips.button_items[i] <= ITEM_POE)) { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if ((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && + (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.tradeItems != 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)) { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && + (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.tradeItems == 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)) { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && + (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.hookshot != 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) || - (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT)) { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + if ((gSaveContext.equips.buttonItems[i] == ITEM_HOOKSHOT) || + (gSaveContext.equips.buttonItems[i] == ITEM_LONGSHOT)) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.hookshot == 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) || - (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT)) { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if ((gSaveContext.equips.buttonItems[i] == ITEM_HOOKSHOT) || + (gSaveContext.equips.buttonItems[i] == ITEM_LONGSHOT)) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.ocarina != 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) || - (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME)) { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + if ((gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) || + (gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_TIME)) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.ocarina == 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) || - (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME)) { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if ((gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) || + (gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_TIME)) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.farores != 0) { for (i = 1; i < 4; i++) { - if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND) { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + if (gSaveContext.equips.buttonItems[i] == ITEM_FARORES_WIND) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; osSyncPrintf("***(i=%d)*** ", i); } } } else if (interfaceCtx->restrictions.farores == 0) { for (i = 1; i < 4; i++) { - if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND) { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if (gSaveContext.equips.buttonItems[i] == ITEM_FARORES_WIND) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.dinsNayrus != 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] == ITEM_DINS_FIRE) || - (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE)) { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + if ((gSaveContext.equips.buttonItems[i] == ITEM_DINS_FIRE) || + (gSaveContext.equips.buttonItems[i] == ITEM_NAYRUS_LOVE)) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.dinsNayrus == 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] == ITEM_DINS_FIRE) || - (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE)) { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if ((gSaveContext.equips.buttonItems[i] == ITEM_DINS_FIRE) || + (gSaveContext.equips.buttonItems[i] == ITEM_NAYRUS_LOVE)) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.all != 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] != ITEM_OCARINA_FAIRY) && - (gSaveContext.equips.button_items[i] != ITEM_OCARINA_TIME) && - !((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && - (gSaveContext.equips.button_items[i] <= ITEM_POE)) && - !((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) { + if ((gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_FAIRY) && + (gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_TIME) && + !((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && + (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) && + !((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && + (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { if ((globalCtx->sceneNum != SCENE_TAKARAYA) || - (gSaveContext.equips.button_items[i] != ITEM_LENS)) { - if (gSaveContext.button_status[i] == BTN_ENABLED) { + (gSaveContext.equips.buttonItems[i] != ITEM_LENS)) { + if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_DISABLED; + gSaveContext.buttonStatus[i] = BTN_DISABLED; } else { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } } } else if (interfaceCtx->restrictions.all == 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.button_items[i] != ITEM_DINS_FIRE) && - (gSaveContext.equips.button_items[i] != ITEM_HOOKSHOT) && - (gSaveContext.equips.button_items[i] != ITEM_LONGSHOT) && - (gSaveContext.equips.button_items[i] != ITEM_FARORES_WIND) && - (gSaveContext.equips.button_items[i] != ITEM_NAYRUS_LOVE) && - (gSaveContext.equips.button_items[i] != ITEM_OCARINA_FAIRY) && - (gSaveContext.equips.button_items[i] != ITEM_OCARINA_TIME) && - !((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && - (gSaveContext.equips.button_items[i] <= ITEM_POE)) && - !((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) { - if (gSaveContext.button_status[i] == BTN_DISABLED) { + if ((gSaveContext.equips.buttonItems[i] != ITEM_DINS_FIRE) && + (gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) && + (gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT) && + (gSaveContext.equips.buttonItems[i] != ITEM_FARORES_WIND) && + (gSaveContext.equips.buttonItems[i] != ITEM_NAYRUS_LOVE) && + (gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_FAIRY) && + (gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_TIME) && + !((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && + (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) && + !((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && + (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { + if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { sp28 = 1; } - gSaveContext.button_status[i] = BTN_ENABLED; + gSaveContext.buttonStatus[i] = BTN_ENABLED; } } } @@ -1143,82 +1143,82 @@ void Inventory_SwapAgeEquipment(void) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { for (i = 0; i < 4; i++) { if (i != 0) { - gSaveContext.child_equips.button_items[i] = gSaveContext.equips.button_items[i]; + gSaveContext.childEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; } else { - gSaveContext.child_equips.button_items[i] = ITEM_SWORD_KOKIRI; + gSaveContext.childEquips.buttonItems[i] = ITEM_SWORD_KOKIRI; } if (i != 0) { - gSaveContext.child_equips.c_button_slots[i - 1] = gSaveContext.equips.c_button_slots[i - 1]; + gSaveContext.childEquips.cButtonSlots[i - 1] = gSaveContext.equips.cButtonSlots[i - 1]; } } - gSaveContext.child_equips.equipment = gSaveContext.equips.equipment; + gSaveContext.childEquips.equipment = gSaveContext.equips.equipment; - if (gSaveContext.adult_equips.button_items[0] == ITEM_NONE) { - gSaveContext.equips.button_items[0] = ITEM_SWORD_MASTER; + if (gSaveContext.adultEquips.buttonItems[0] == ITEM_NONE) { + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; if (gSaveContext.items[SLOT_NUT] != ITEM_NONE) { - gSaveContext.equips.button_items[1] = ITEM_NUT; - gSaveContext.equips.c_button_slots[0] = SLOT_NUT; + gSaveContext.equips.buttonItems[1] = ITEM_NUT; + gSaveContext.equips.cButtonSlots[0] = SLOT_NUT; } else { - gSaveContext.equips.c_button_slots[0] = SLOT_NONE; - gSaveContext.equips.button_items[1] = ITEM_NONE; + gSaveContext.equips.cButtonSlots[0] = SLOT_NONE; + gSaveContext.equips.buttonItems[1] = ITEM_NONE; } - gSaveContext.equips.button_items[2] = ITEM_BOMB; - gSaveContext.equips.c_button_slots[1] = SLOT_BOMB; - gSaveContext.equips.c_button_slots[2] = SLOT_OCARINA; + gSaveContext.equips.buttonItems[2] = ITEM_BOMB; + gSaveContext.equips.cButtonSlots[1] = SLOT_BOMB; + gSaveContext.equips.cButtonSlots[2] = SLOT_OCARINA; gSaveContext.equips.equipment = 0x1122; - gSaveContext.equips.button_items[3] = gSaveContext.items[SLOT_OCARINA]; + gSaveContext.equips.buttonItems[3] = gSaveContext.items[SLOT_OCARINA]; } else { for (i = 0; i < 4; i++) { - gSaveContext.equips.button_items[i] = gSaveContext.adult_equips.button_items[i]; + gSaveContext.equips.buttonItems[i] = gSaveContext.adultEquips.buttonItems[i]; if (i != 0) { - gSaveContext.equips.c_button_slots[i - 1] = gSaveContext.adult_equips.c_button_slots[i - 1]; + gSaveContext.equips.cButtonSlots[i - 1] = gSaveContext.adultEquips.cButtonSlots[i - 1]; } - if (((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && - (gSaveContext.equips.button_items[i] <= ITEM_POE)) || - ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) { - osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i - 1]); - gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i - 1]]; + if (((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && + (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) || + ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && + (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { + osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.cButtonSlots[i - 1]); + gSaveContext.equips.buttonItems[i] = gSaveContext.items[gSaveContext.equips.cButtonSlots[i - 1]]; } } - gSaveContext.equips.equipment = gSaveContext.adult_equips.equipment; + gSaveContext.equips.equipment = gSaveContext.adultEquips.equipment; } } else { for (i = 0; i < 4; i++) { - gSaveContext.adult_equips.button_items[i] = gSaveContext.equips.button_items[i]; + gSaveContext.adultEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; if (i != 0) { - gSaveContext.adult_equips.c_button_slots[i - 1] = gSaveContext.equips.c_button_slots[i - 1]; + gSaveContext.adultEquips.cButtonSlots[i - 1] = gSaveContext.equips.cButtonSlots[i - 1]; } } - gSaveContext.adult_equips.equipment = gSaveContext.equips.equipment; + gSaveContext.adultEquips.equipment = gSaveContext.equips.equipment; - if (gSaveContext.child_equips.button_items[0] != ITEM_NONE) { + if (gSaveContext.childEquips.buttonItems[0] != ITEM_NONE) { for (i = 0; i < 4; i++) { - gSaveContext.equips.button_items[i] = gSaveContext.child_equips.button_items[i]; + gSaveContext.equips.buttonItems[i] = gSaveContext.childEquips.buttonItems[i]; if (i != 0) { - gSaveContext.equips.c_button_slots[i - 1] = gSaveContext.child_equips.c_button_slots[i - 1]; + gSaveContext.equips.cButtonSlots[i - 1] = gSaveContext.childEquips.cButtonSlots[i - 1]; } - if (((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) && - (gSaveContext.equips.button_items[i] <= ITEM_POE)) || - ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) && - (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) { - osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i - 1]); - gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i - 1]]; + if (((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && + (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) || + ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && + (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { + osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.cButtonSlots[i - 1]); + gSaveContext.equips.buttonItems[i] = gSaveContext.items[gSaveContext.equips.cButtonSlots[i - 1]]; } } - gSaveContext.equips.equipment = gSaveContext.child_equips.equipment; + gSaveContext.equips.equipment = gSaveContext.childEquips.equipment; gSaveContext.equips.equipment &= 0xFFF0; gSaveContext.equips.equipment |= 0x0001; } @@ -1239,9 +1239,9 @@ void Inventory_SwapAgeEquipment(void) { void Interface_InitHorsebackArchery(GlobalContext* globalCtx) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; - gSaveContext.minigame_state = 1; + gSaveContext.minigameState = 1; interfaceCtx->unk_23C = interfaceCtx->unk_240 = interfaceCtx->unk_242 = 0; - gSaveContext.minigame_score = sHBAScoreTier = 0; + gSaveContext.minigameScore = sHBAScoreTier = 0; interfaceCtx->hbaAmmo = 20; } @@ -1250,9 +1250,9 @@ void func_800849EC(GlobalContext* globalCtx) { gSaveContext.equipment ^= 8 << gEquipShifts[0]; if (gBitFlags[3] & gSaveContext.equipment) { - gSaveContext.equips.button_items[0] = ITEM_SWORD_KNIFE; + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE; } else { - gSaveContext.equips.button_items[0] = ITEM_SWORD_BGS; + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; } Interface_LoadItemIcon1(globalCtx, 0); @@ -1263,7 +1263,7 @@ void Interface_LoadItemIcon1(GlobalContext* globalCtx, u16 button) { osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK); DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, (u32)interfaceCtx->icon_itemSegment + button * 0x1000, - (u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.button_items[button] * 0x1000), + (u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.buttonItems[button] * 0x1000), 0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1171); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); } @@ -1273,38 +1273,37 @@ void Interface_LoadItemIcon2(GlobalContext* globalCtx, u16 button) { osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK); DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_180, (u32)interfaceCtx->icon_itemSegment + button * 0x1000, - (u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.button_items[button] * 0x1000), + (u32)_icon_item_staticSegmentRomStart + (gSaveContext.equips.buttonItems[button] * 0x1000), 0x1000, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 1193); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); } void func_80084BF4(GlobalContext* globalCtx, u16 flag) { if (flag) { - if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) || - (gSaveContext.equips.button_items[0] == ITEM_BOW) || - (gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE) || - (gSaveContext.button_status[0] == BTN_DISABLED)) { - if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) || - (gSaveContext.equips.button_items[0] == ITEM_BOW) || - (gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE)) { - gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; + if ((gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT) || + (gSaveContext.equips.buttonItems[0] == ITEM_BOW) || (gSaveContext.equips.buttonItems[0] == ITEM_BOMBCHU) || + (gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE) || + (gSaveContext.buttonStatus[0] == BTN_DISABLED)) { + if ((gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT) || + (gSaveContext.equips.buttonItems[0] == ITEM_BOW) || + (gSaveContext.equips.buttonItems[0] == ITEM_BOMBCHU) || + (gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE)) { + gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; Interface_LoadItemIcon1(globalCtx, 0); } - } else if (gSaveContext.equips.button_items[0] == ITEM_NONE) { - if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) { - gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; + } else if (gSaveContext.equips.buttonItems[0] == ITEM_NONE) { + if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) || (gSaveContext.infTable[29] == 0)) { + gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; Interface_LoadItemIcon1(globalCtx, 0); } } - gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = - gSaveContext.button_status[3] = BTN_ENABLED; + gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = + gSaveContext.buttonStatus[3] = BTN_ENABLED; Interface_ChangeAlpha(7); } else { - gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] = - gSaveContext.button_status[3] = BTN_ENABLED; + gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = + gSaveContext.buttonStatus[3] = BTN_ENABLED; func_80083108(globalCtx); } } @@ -1331,11 +1330,11 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { osSyncPrintf(VT_RST); if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) { - gSaveContext.quest_items |= gBitFlags[item - ITEM_MEDALLION_FOREST]; + gSaveContext.questItems |= gBitFlags[item - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST]; osSyncPrintf(VT_FGCOL(YELLOW)); // Translates to: "Seals = %x" - osSyncPrintf("封印 = %x\n", gSaveContext.quest_items); + osSyncPrintf("封印 = %x\n", gSaveContext.questItems); osSyncPrintf(VT_RST); if (item == ITEM_MEDALLION_WATER) { @@ -1344,42 +1343,42 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { return ITEM_NONE; } else if ((item >= ITEM_SONG_MINUET) && (item <= ITEM_SONG_STORMS)) { - gSaveContext.quest_items |= gBitFlags[item - ITEM_SONG_MINUET + 6]; + gSaveContext.questItems |= gBitFlags[item - ITEM_SONG_MINUET + QUEST_SONG_MINUET]; osSyncPrintf(VT_FGCOL(YELLOW)); // Translates to: "Musical scores = %x" - osSyncPrintf("楽譜 = %x\n", gSaveContext.quest_items); + osSyncPrintf("楽譜 = %x\n", gSaveContext.questItems); // Translates to: "Musical scores = %x (%x) (%x)" - osSyncPrintf("楽譜 = %x (%x) (%x)\n", gSaveContext.quest_items, gBitFlags[item - ITEM_SONG_MINUET + 6], - gBitFlags[item - ITEM_SONG_MINUET]); + osSyncPrintf("楽譜 = %x (%x) (%x)\n", gSaveContext.questItems, + gBitFlags[item - ITEM_SONG_MINUET + QUEST_SONG_MINUET], gBitFlags[item - ITEM_SONG_MINUET]); osSyncPrintf(VT_RST); return ITEM_NONE; } else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_ZORA_SAPPHIRE)) { - gSaveContext.quest_items |= gBitFlags[item - ITEM_KOKIRI_EMERALD + 18]; + gSaveContext.questItems |= gBitFlags[item - ITEM_KOKIRI_EMERALD + QUEST_KOKIRI_EMERALD]; osSyncPrintf(VT_FGCOL(YELLOW)); // Translates to: "Spiritual Stones = %x" - osSyncPrintf("精霊石 = %x\n", gSaveContext.quest_items); + osSyncPrintf("精霊石 = %x\n", gSaveContext.questItems); osSyncPrintf(VT_RST); return ITEM_NONE; } else if ((item == ITEM_STONE_OF_AGONY) || (item == ITEM_GERUDO_CARD)) { - gSaveContext.quest_items |= gBitFlags[item - ITEM_STONE_OF_AGONY + 21]; + gSaveContext.questItems |= gBitFlags[item - ITEM_STONE_OF_AGONY + QUEST_STONE_OF_AGONY]; osSyncPrintf(VT_FGCOL(YELLOW)); // Translates to: "Items = %x" - osSyncPrintf("アイテム = %x\n", gSaveContext.quest_items); + osSyncPrintf("アイテム = %x\n", gSaveContext.questItems); osSyncPrintf(VT_RST); return ITEM_NONE; } else if (item == ITEM_SKULL_TOKEN) { - gSaveContext.quest_items |= gBitFlags[item - ITEM_SKULL_TOKEN + 23]; - gSaveContext.gs_tokens++; + gSaveContext.questItems |= gBitFlags[item - ITEM_SKULL_TOKEN + QUEST_SKULL_TOKEN]; + gSaveContext.gsTokens++; osSyncPrintf(VT_FGCOL(YELLOW)); // Translates to: "N Coins = %x(%d)" - osSyncPrintf("Nコイン = %x(%d)\n", gSaveContext.quest_items, gSaveContext.gs_tokens); + osSyncPrintf("Nコイン = %x(%d)\n", gSaveContext.questItems, gSaveContext.gsTokens); osSyncPrintf(VT_RST); return ITEM_NONE; @@ -1387,17 +1386,17 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { gSaveContext.equipment |= gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD]; if (item == ITEM_SWORD_BGS) { - gSaveContext.bgs_hits_left = 8; + gSaveContext.bgsHitsLeft = 8; if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) { gSaveContext.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; - if (gSaveContext.equips.button_items[0] == ITEM_SWORD_KNIFE) { - gSaveContext.equips.button_items[0] = ITEM_SWORD_BGS; + if (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) { + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; Interface_LoadItemIcon1(globalCtx, 0); } } } else if (item == ITEM_SWORD_MASTER) { - gSaveContext.equips.button_items[0] = ITEM_SWORD_MASTER; + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; gSaveContext.equips.equipment &= 0xFFF0; gSaveContext.equips.equipment |= 0x0002; Interface_LoadItemIcon1(globalCtx, 0); @@ -1414,14 +1413,14 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { gSaveContext.equipment |= (gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]); return ITEM_NONE; } else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) { - gSaveContext.dungeon_items[gSaveContext.dungeon_index] |= gBitFlags[item - ITEM_KEY_BOSS]; + gSaveContext.dungeonItems[gSaveContext.dungeonIndex] |= gBitFlags[item - ITEM_KEY_BOSS]; return ITEM_NONE; } else if (item == ITEM_KEY_SMALL) { - if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] < 0) { - gSaveContext.dungeon_keys[gSaveContext.dungeon_index] = 1; + if (gSaveContext.dungeonKeys[gSaveContext.dungeonIndex] < 0) { + gSaveContext.dungeonKeys[gSaveContext.dungeonIndex] = 1; return ITEM_NONE; } else { - gSaveContext.dungeon_keys[gSaveContext.dungeon_index]++; + gSaveContext.dungeonKeys[gSaveContext.dungeonIndex]++; return ITEM_NONE; } } else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) { @@ -1524,8 +1523,8 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { } else if (item == ITEM_LONGSHOT) { INV_CONTENT(item) = item; for (i = 1; i < 4; i++) { - if (gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) { - gSaveContext.equips.button_items[i] = ITEM_LONGSHOT; + if (gSaveContext.equips.buttonItems[i] == ITEM_HOOKSHOT) { + gSaveContext.equips.buttonItems[i] = ITEM_LONGSHOT; Interface_LoadItemIcon1(globalCtx, i); } } @@ -1637,8 +1636,8 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG); } - if (!(gSaveContext.item_get_inf[1] & 8)) { - gSaveContext.item_get_inf[1] |= 8; + if (!(gSaveContext.itemGetInf[1] & 8)) { + gSaveContext.itemGetInf[1] |= 8; return ITEM_NONE; } @@ -1650,8 +1649,8 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG); } - if (!(gSaveContext.item_get_inf[1] & 8)) { - gSaveContext.item_get_inf[1] |= 8; + if (!(gSaveContext.itemGetInf[1] & 8)) { + gSaveContext.itemGetInf[1] |= 8; return ITEM_NONE; } @@ -1662,8 +1661,8 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { } else if (item == ITEM_OCARINA_TIME) { INV_CONTENT(ITEM_OCARINA_TIME) = ITEM_OCARINA_TIME; for (i = 1; i < 4; i++) { - if (gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) { - gSaveContext.equips.button_items[i] = ITEM_OCARINA_TIME; + if (gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) { + gSaveContext.equips.buttonItems[i] = ITEM_OCARINA_TIME; Interface_LoadItemIcon1(globalCtx, i); } } @@ -1679,10 +1678,10 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { } return ITEM_NONE; } else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) { - gSaveContext.quest_items += 0x10000000; + gSaveContext.questItems += (1 << QUEST_HEART_PIECE); return ITEM_NONE; } else if (item == ITEM_HEART_CONTAINER) { - gSaveContext.health_capacity += 0x10; + gSaveContext.healthCapacity += 0x10; gSaveContext.health += 0x10; return ITEM_NONE; } else if (item == ITEM_HEART) { @@ -1697,8 +1696,8 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { func_80087708(globalCtx, 12, 5); - if (!(gSaveContext.inf_table[25] & 0x100)) { - gSaveContext.inf_table[25] |= 0x100; + if (!(gSaveContext.infTable[25] & 0x100)) { + gSaveContext.infTable[25] |= 0x100; return ITEM_NONE; } @@ -1710,8 +1709,8 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { func_80087708(globalCtx, 24, 5); - if (!(gSaveContext.inf_table[25] & 0x100)) { - gSaveContext.inf_table[25] |= 0x100; + if (!(gSaveContext.infTable[25] & 0x100)) { + gSaveContext.infTable[25] |= 0x100; return ITEM_NONE; } @@ -1739,21 +1738,21 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { if (gSaveContext.items[bottleSlot + i] == ITEM_BOTTLE) { // Translates to: "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d" osSyncPrintf("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n", - gSaveContext.equips.c_button_slots[0], gSaveContext.equips.c_button_slots[1], - gSaveContext.equips.c_button_slots[2], bottleSlot + i, item); + gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1], + gSaveContext.equips.cButtonSlots[2], bottleSlot + i, item); - if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[0]) { - gSaveContext.equips.button_items[1] = item; + if ((bottleSlot + i) == gSaveContext.equips.cButtonSlots[0]) { + gSaveContext.equips.buttonItems[1] = item; Interface_LoadItemIcon2(globalCtx, 1); - gSaveContext.button_status[1] = BTN_ENABLED; - } else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[1]) { - gSaveContext.equips.button_items[2] = item; + gSaveContext.buttonStatus[1] = BTN_ENABLED; + } else if ((bottleSlot + i) == gSaveContext.equips.cButtonSlots[1]) { + gSaveContext.equips.buttonItems[2] = item; Interface_LoadItemIcon2(globalCtx, 2); - gSaveContext.button_status[2] = BTN_ENABLED; - } else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[2]) { - gSaveContext.equips.button_items[3] = item; + gSaveContext.buttonStatus[2] = BTN_ENABLED; + } else if ((bottleSlot + i) == gSaveContext.equips.cButtonSlots[2]) { + gSaveContext.equips.buttonItems[3] = item; Interface_LoadItemIcon1(globalCtx, 3); - gSaveContext.button_status[3] = BTN_ENABLED; + gSaveContext.buttonStatus[3] = BTN_ENABLED; } gSaveContext.items[bottleSlot + i] = item; @@ -1770,7 +1769,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { } } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { if (item == ITEM_SAW) { - gSaveContext.item_get_inf[1] |= 0x8000; + gSaveContext.itemGetInf[1] |= 0x8000; } prevTradeItem = INV_CONTENT(item); @@ -1778,12 +1777,12 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { if (prevTradeItem != ITEM_NONE) { for (i = 1; i < 4; i++) { - if (prevTradeItem == gSaveContext.equips.button_items[i]) { + if (prevTradeItem == gSaveContext.equips.buttonItems[i]) { if (item != ITEM_SOLD_OUT) { - gSaveContext.equips.button_items[i] = item; + gSaveContext.equips.buttonItems[i] = item; Interface_LoadItemIcon1(globalCtx, i); } else { - gSaveContext.equips.button_items[i] = ITEM_NONE; + gSaveContext.equips.buttonItems[i] = ITEM_NONE; } return ITEM_NONE; } @@ -1878,7 +1877,7 @@ u8 Item_CheckObtainability(u8 item) { } else if (item == ITEM_LONGSHOT) { return ITEM_NONE; } else if ((item == ITEM_SEEDS) || (item == ITEM_SEEDS_30)) { - if (!(gSaveContext.item_get_inf[1] & 0x8)) { + if (!(gSaveContext.itemGetInf[1] & 0x8)) { return ITEM_NONE; } else { return ITEM_SEEDS; @@ -1893,8 +1892,8 @@ u8 Item_CheckObtainability(u8 item) { return ITEM_HEART; } else if ((item == ITEM_MAGIC_SMALL) || (item == ITEM_MAGIC_LARGE)) { // Translates to: "Magic Pot Get_Inf_Table( 25, 0x0100)=%d" - osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", gSaveContext.inf_table[25] & 0x100); - if (!(gSaveContext.inf_table[25] & 0x100)) { + osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", gSaveContext.infTable[25] & 0x100); + if (!(gSaveContext.infTable[25] & 0x100)) { return ITEM_NONE; } else { return item; @@ -1935,7 +1934,7 @@ void Inventory_DeleteItem(u16 item, u16 invSlot) { s16 i; if (item == ITEM_BEAN) { - BEANS_BOUGHT = 0; // Beans bought + BEANS_BOUGHT = 0; } gSaveContext.items[invSlot] = ITEM_NONE; @@ -1943,9 +1942,9 @@ void Inventory_DeleteItem(u16 item, u16 invSlot) { osSyncPrintf("\nItem_Register(%d)\n", invSlot, gSaveContext.items[invSlot]); for (i = 1; i < 4; i++) { - if (gSaveContext.equips.button_items[i] == item) { - gSaveContext.equips.button_items[i] = ITEM_NONE; - gSaveContext.equips.c_button_slots[i - 1] = SLOT_NONE; + if (gSaveContext.equips.buttonItems[i] == item) { + gSaveContext.equips.buttonItems[i] = ITEM_NONE; + gSaveContext.equips.cButtonSlots[i - 1] = SLOT_NONE; } } } @@ -1962,8 +1961,8 @@ s32 Inventory_ReplaceItem(GlobalContext* globalCtx, u16 oldItem, u16 newItem) { // Translates to: "Item Purge (%d)" osSyncPrintf("アイテム消去(%d)", i); for (j = 1; j < 4; j++) { - if (gSaveContext.equips.button_items[j] == oldItem) { - gSaveContext.equips.button_items[j] = newItem; + if (gSaveContext.equips.buttonItems[j] == oldItem) { + gSaveContext.equips.buttonItems[j] = newItem; Interface_LoadItemIcon1(globalCtx, j); break; } @@ -2014,24 +2013,24 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) { // save context pointer isn't reused after Interface_LoadItemIcon1 when it should be void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 cButton) { osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, cButton, - gSaveContext.equips.c_button_slots[cButton - 1], - gSaveContext.items[gSaveContext.equips.c_button_slots[cButton - 1]]); + gSaveContext.equips.cButtonSlots[cButton - 1], + gSaveContext.items[gSaveContext.equips.cButtonSlots[cButton - 1]]); // Special case to only empty half of a Lon Lon Milk Bottle - if ((gSaveContext.items[gSaveContext.equips.c_button_slots[cButton - 1]] == ITEM_MILK_BOTTLE) && + if ((gSaveContext.items[gSaveContext.equips.cButtonSlots[cButton - 1]] == ITEM_MILK_BOTTLE) && (item == ITEM_BOTTLE)) { item = ITEM_MILK_HALF; } - gSaveContext.items[gSaveContext.equips.c_button_slots[cButton - 1]] = item; - gSaveContext.equips.button_items[cButton] = item; + gSaveContext.items[gSaveContext.equips.cButtonSlots[cButton - 1]] = item; + gSaveContext.equips.buttonItems[cButton] = item; if (1) {} // Improves codegen but may not be necessary Interface_LoadItemIcon1(globalCtx, cButton); globalCtx->pauseCtx.unk_23E = item; - gSaveContext.button_status[0] = BTN_ENABLED; + gSaveContext.buttonStatus[0] = BTN_ENABLED; } #else #pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Inventory_UpdateBottleItem.s") @@ -2049,10 +2048,10 @@ s32 Inventory_ConsumeFairy(GlobalContext* globalCtx) { for (i = 0; i < 4; i++) { if (gSaveContext.items[bottleSlot + i] == ITEM_FAIRY) { for (j = 1; j < 4; j++) { - if (gSaveContext.equips.button_items[j] == ITEM_FAIRY) { - gSaveContext.equips.button_items[j] = ITEM_BOTTLE; + if (gSaveContext.equips.buttonItems[j] == ITEM_FAIRY) { + gSaveContext.equips.buttonItems[j] = ITEM_BOTTLE; Interface_LoadItemIcon1(globalCtx, j); - bottleSlot = gSaveContext.equips.c_button_slots[j - 1]; + bottleSlot = gSaveContext.equips.cButtonSlots[j - 1]; break; } } @@ -2176,13 +2175,13 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) { // Translates to: "***** Fluctuation=%d (now=%d, max=%d) ***" osSyncPrintf("***** 増減=%d (now=%d, max=%d) ***", healthChange, gSaveContext.health, - gSaveContext.health_capacity); + gSaveContext.healthCapacity); // clang-format off // NOLINTNEXTLINE if (healthChange > 0) Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - else if ((gSaveContext.double_defense != 0) && (healthChange < 0)) { + else if ((gSaveContext.doubleDefense != 0) && (healthChange < 0)) { healthChange >>= 1; // Translates to: "Heart decrease halved!!=%d" osSyncPrintf("ハート減少半分!!=%d\n", healthChange); @@ -2191,8 +2190,8 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) { gSaveContext.health += healthChange; - if (gSaveContext.health > gSaveContext.health_capacity) { - gSaveContext.health = gSaveContext.health_capacity; + if (gSaveContext.health > gSaveContext.healthCapacity) { + gSaveContext.health = gSaveContext.healthCapacity; } heartCount = gSaveContext.health % 0x10; @@ -2220,11 +2219,11 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) { } void Health_GiveHearts(s16 hearts) { - gSaveContext.health_capacity += hearts * 0x10; + gSaveContext.healthCapacity += hearts * 0x10; } void Rupees_ChangeBy(s16 rupeeChange) { - gSaveContext.rupee_accumulator += rupeeChange; + gSaveContext.rupeeAccumulator += rupeeChange; } void Inventory_ChangeAmmo(s16 item, s16 ammoChange) { @@ -2288,9 +2287,9 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) { } void func_80087680(GlobalContext* globalCtx) { - if (gSaveContext.magic_acquired) { + if (gSaveContext.magicAcquired) { gSaveContext.unk_13F2 = gSaveContext.unk_13F0; - gSaveContext.unk_13F6 = (gSaveContext.double_magic * 0x30) + 0x30; + gSaveContext.unk_13F6 = (gSaveContext.doubleMagic * 0x30) + 0x30; gSaveContext.unk_13F0 = 9; } } @@ -2305,7 +2304,7 @@ void func_800876C8(GlobalContext* globalCtx) { } s32 func_80087708(GlobalContext* globalCtx, s16 arg1, s16 arg2) { - if (!gSaveContext.magic_acquired) { + if (!gSaveContext.magicAcquired) { return 0; } @@ -2404,7 +2403,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { switch (gSaveContext.unk_13F0) { case 8: - maxMagic = gSaveContext.magic_level * 0x30; + maxMagic = gSaveContext.magicLevel * 0x30; if (gSaveContext.unk_13F4 != maxMagic) { if (gSaveContext.unk_13F4 < maxMagic) { gSaveContext.unk_13F4 += 8; @@ -2424,7 +2423,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { case 9: gSaveContext.magic += 4; - if (gSaveContext.game_mode == 0 && gSaveContext.scene_setup_index < 4) { + if (gSaveContext.gameMode == 0 && gSaveContext.sceneSetupIndex < 4) { Audio_PlaySoundGeneral(0x401F, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -2498,11 +2497,11 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) { case 7: if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (globalCtx->msgCtx.msgMode == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->sceneLoadFlag == 0) && - (globalCtx->unk_1241B == 0) && (func_800BFC84(globalCtx) == 0)) { + (globalCtx->unk_1241B == 0) && !Gameplay_InCsMode(globalCtx)) { if ((gSaveContext.magic == 0) || ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) || - ((gSaveContext.equips.button_items[1] != ITEM_LENS) && - (gSaveContext.equips.button_items[2] != ITEM_LENS) && - (gSaveContext.equips.button_items[3] != ITEM_LENS)) || + ((gSaveContext.equips.buttonItems[1] != ITEM_LENS) && + (gSaveContext.equips.buttonItems[2] != ITEM_LENS) && + (gSaveContext.equips.buttonItems[3] != ITEM_LENS)) || (globalCtx->actorCtx.unk_03 == 0)) { globalCtx->actorCtx.unk_03 = 0; Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0, @@ -2588,8 +2587,8 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_parameter.c", 2650); - if (gSaveContext.magic_level != 0) { - if (gSaveContext.health_capacity > 0xA0) { + if (gSaveContext.magicLevel != 0) { + if (gSaveContext.healthCapacity > 0xA0) { magicBarY = R_MAGIC_BAR_LARGE_Y; } else { magicBarY = R_MAGIC_BAR_SMALL_Y; @@ -2665,38 +2664,38 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) { } void func_80088AA0(s16 arg0) { - gSaveContext.timer_x[1] = 140; - gSaveContext.timer_y[1] = 80; + gSaveContext.timerX[1] = 140; + gSaveContext.timerY[1] = 80; D_80125A5C = 0; - gSaveContext.timer_2_value = arg0; + gSaveContext.timer2Value = arg0; if (arg0 != 0) { - gSaveContext.timer_2_state = 1; + gSaveContext.timer2State = 1; } else { - gSaveContext.timer_2_state = 7; + gSaveContext.timer2State = 7; } } void func_80088AF0(GlobalContext* globalCtx) { - if (gSaveContext.timer_2_state != 0) { - if (gSaveContext.event_inf[1] & 1) { - gSaveContext.timer_2_value = 239; + if (gSaveContext.timer2State != 0) { + if (gSaveContext.eventInf[1] & 1) { + gSaveContext.timer2Value = 239; } else { - gSaveContext.timer_2_value = 1; + gSaveContext.timer2Value = 1; } } } void func_80088B34(s16 arg0) { - gSaveContext.timer_x[0] = 140; - gSaveContext.timer_y[0] = 80; + gSaveContext.timerX[0] = 140; + gSaveContext.timerY[0] = 80; D_80125A5C = 0; - gSaveContext.timer_1_value = arg0; + gSaveContext.timer1Value = arg0; if (arg0 != 0) { - gSaveContext.timer_1_state = 5; + gSaveContext.timer1State = 5; } else { - gSaveContext.timer_1_state = 11; + gSaveContext.timer1State = 11; } } @@ -2862,7 +2861,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { // Empty C Button Arrows for (i = 1; i < 4; i++) { - if (gSaveContext.equips.button_items[i] > 0xF0) { + if (gSaveContext.equips.buttonItems[i] > 0xF0) { if (i == 1) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); @@ -2915,7 +2914,7 @@ void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_parameter.c", 3105); - item = gSaveContext.equips.button_items[button]; + item = gSaveContext.equips.buttonItems[button]; if ((item == ITEM_STICK) || (item == ITEM_NUT) || (item == ITEM_BOMB) || (item == ITEM_BOW) || ((item >= ITEM_BOW_ARROW_FIRE) && (item <= ITEM_BOW_ARROW_LIGHT)) || (item == ITEM_SLINGSHOT) || @@ -2928,7 +2927,7 @@ void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) { gDPPipeSync(gfxCtx->overlay.p++); - if ((button == 0) && (gSaveContext.minigame_state == 1)) { + if ((button == 0) && (gSaveContext.minigameState == 1)) { ammo = globalCtx->interfaceCtx.hbaAmmo; } else if ((button == 0) && (globalCtx->unk_11E5C >= 2)) { ammo = globalCtx->unk_11E5C - 1; @@ -3075,7 +3074,7 @@ void Interface_InitVertices(GlobalContext* globalCtx) { // clang-format on } -void func_8008A8B8(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { +void func_8008A8B8(GlobalContext* globalCtx, s32 topY, s32 bottomY, s32 leftX, s32 rightX) { InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; Vec3f sp40; Vec3f sp34; @@ -3087,24 +3086,24 @@ void func_8008A8B8(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3, s32 a sp28.x = sp28.z = 0.0f; sp28.y = 1.0f; func_800AA358(&interfaceCtx->view, &sp40, &sp34, &sp28); - interfaceCtx->unk_1DC[0] = arg1; - interfaceCtx->unk_1DC[1] = arg2; - interfaceCtx->unk_1DC[2] = arg3; - interfaceCtx->unk_1DC[3] = arg4; - func_800AA4FC(&interfaceCtx->view, interfaceCtx->unk_1DC); + interfaceCtx->viewport.topY = topY; + interfaceCtx->viewport.bottomY = bottomY; + interfaceCtx->viewport.leftX = leftX; + interfaceCtx->viewport.rightX = rightX; + View_SetViewport(&interfaceCtx->view, &interfaceCtx->viewport); func_800AA460(&interfaceCtx->view, 60.0f, 10.0f, 60.0f); func_800AB560(&interfaceCtx->view); } void func_8008A994(InterfaceContext* interfaceCtx) { - s32 sp18[4]; + Viewport viewport; // clang-format off - sp18[1] = SCREEN_HEIGHT; sp18[3] = SCREEN_WIDTH; - sp18[0] = 0; sp18[2] = 0; + viewport.bottomY = SCREEN_HEIGHT; viewport.rightX = SCREEN_WIDTH; + viewport.topY = 0; viewport.leftX = 0; // clang-format on - func_800AA4FC(&interfaceCtx->view, sp18); + View_SetViewport(&interfaceCtx->view, &viewport); func_800AB2C4(&interfaceCtx->view); } @@ -3186,7 +3185,7 @@ void Interface_Draw(GlobalContext* globalCtx) { case SCENE_GANON_SONOGO: case SCENE_GANONTIKA_SONOGO: case SCENE_TAKARAYA: - if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] >= 0) { + if (gSaveContext.dungeonKeys[gSaveContext.dungeonIndex] >= 0) { // Small Key Icon gDPPipeSync(gfxCtx->overlay.p++); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xC8, 0xE6, 0xFF, interfaceCtx->magicAlpha); @@ -3201,7 +3200,7 @@ void Interface_Draw(GlobalContext* globalCtx) { PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); interfaceCtx->counterDigits[2] = 0; - interfaceCtx->counterDigits[3] = gSaveContext.dungeon_keys[gSaveContext.dungeon_index]; + interfaceCtx->counterDigits[3] = gSaveContext.dungeonKeys[gSaveContext.dungeonIndex]; while (interfaceCtx->counterDigits[3] >= 10) { interfaceCtx->counterDigits[2]++; @@ -3285,7 +3284,7 @@ void Interface_Draw(GlobalContext* globalCtx) { if (interfaceCtx->unk_1FA == 0) { // B Button Icon & possibly Ammo Count - if (gSaveContext.equips.button_items[0] != ITEM_NONE) { + if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { Interface_DrawItemIconTexture(globalCtx, (void*)(u32)interfaceCtx->icon_itemSegment, 0); if ((player->stateFlags1 & 0x00800000) || (globalCtx->unk_11E5C >= 2) || @@ -3327,7 +3326,7 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPPipeSync(gfxCtx->overlay.p++); // C-Left Button Icon & Ammo Count - if (gSaveContext.equips.button_items[1] < 0xF0) { + if (gSaveContext.equips.buttonItems[1] < 0xF0) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->cLeftAlpha); gDPSetCombineMode(gfxCtx->overlay.p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x1000), 1); @@ -3340,7 +3339,7 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPPipeSync(gfxCtx->overlay.p++); // C-Down Button Icon & Ammo Count - if (gSaveContext.equips.button_items[2] < 0xF0) { + if (gSaveContext.equips.buttonItems[2] < 0xF0) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->cDownAlpha); gDPSetCombineMode(gfxCtx->overlay.p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x2000), 2); @@ -3353,7 +3352,7 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPPipeSync(gfxCtx->overlay.p++); // C-Right Button Icon & Ammo Count - if (gSaveContext.equips.button_items[3] < 0xF0) { + if (gSaveContext.equips.buttonItems[3] < 0xF0) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->cRightAlpha); gDPSetCombineMode(gfxCtx->overlay.p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x3000), 3); @@ -3463,7 +3462,7 @@ void Interface_Draw(GlobalContext* globalCtx) { func_80094520(globalCtx->state.gfxCtx); if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) { - if (gSaveContext.minigame_state != 1) { + if (gSaveContext.minigameState != 1) { // Carrots rendering if the action corresponds to riding a horse if (interfaceCtx->unk_1EE == 8) { // Load Carrot Icon @@ -3536,36 +3535,36 @@ void Interface_Draw(GlobalContext* globalCtx) { } } - if ((gSaveContext.timer_2_state == 5) && (func_8010BDBC(&globalCtx->msgCtx) == 5)) { + if ((gSaveContext.timer2State == 5) && (func_8010BDBC(&globalCtx->msgCtx) == 5)) { // Trade quest timer reached 0 - gSaveContext.cutscene_index = 0; + gSaveContext.cutsceneIndex = 0; globalCtx->sceneLoadFlag = 0x14; - globalCtx->fadeOutTransition = 3; - gSaveContext.timer_2_state = 0; + globalCtx->fadeTransition = 3; + gSaveContext.timer2State = 0; D_8015FFE6 = 40; - if ((gSaveContext.equips.button_items[0] != ITEM_SWORD_KOKIRI) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_MASTER) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_BGS) && - (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE)) { - if (gSaveContext.button_status[0] != BTN_ENABLED) { - gSaveContext.equips.button_items[0] = gSaveContext.button_status[0]; + if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && + (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) && + (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_BGS) && + (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KNIFE)) { + if (gSaveContext.buttonStatus[0] != BTN_ENABLED) { + gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; } else { - gSaveContext.equips.button_items[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[0] = ITEM_NONE; } } // Revert any spoiling trade quest items for (phi_s3 = 0; phi_s3 < ARRAY_COUNT(gSpoilingItems); phi_s3++) { if (INV_CONTENT(ITEM_POCKET_EGG) == gSpoilingItems[phi_s3]) { - gSaveContext.event_inf[0] &= 0x7F80; - osSyncPrintf("EVENT_INF=%x\n", gSaveContext.event_inf[0]); + gSaveContext.eventInf[0] &= 0x7F80; + osSyncPrintf("EVENT_INF=%x\n", gSaveContext.eventInf[0]); globalCtx->nextEntranceIndex = sSpoilingItemEntrances[phi_s3]; INV_CONTENT(gSpoilingItemReverts[phi_s3]) = gSpoilingItemReverts[phi_s3]; for (phi_s0 = 1; phi_s0 < 4; phi_s0++) { - if (gSaveContext.equips.button_items[phi_s0] == gSpoilingItems[phi_s3]) { - gSaveContext.equips.button_items[phi_s0] = gSpoilingItemReverts[phi_s3]; + if (gSaveContext.equips.buttonItems[phi_s0] == gSpoilingItems[phi_s3]) { + gSaveContext.equips.buttonItems[phi_s0] = gSpoilingItemReverts[phi_s3]; Interface_LoadItemIcon1(globalCtx, phi_s0); } } @@ -3575,30 +3574,30 @@ void Interface_Draw(GlobalContext* globalCtx) { if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (globalCtx->unk_10A20 == 0) && (msgCtx->msgMode == 0) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) && - (globalCtx->unk_1241B == 0) && (func_800BFC84(globalCtx) == 0) && (gSaveContext.minigame_state != 1) && + (globalCtx->unk_1241B == 0) && !Gameplay_InCsMode(globalCtx) && (gSaveContext.minigameState != 1) && (globalCtx->unk_11E5C < 2) && !((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { sp274 = 0; - switch (gSaveContext.timer_1_state) { + switch (gSaveContext.timer1State) { case 1: - gSaveContext.timer_1_state = 2; - gSaveContext.timer_1_value = gSaveContext.health >> 1; + gSaveContext.timer1State = 2; + gSaveContext.timer1Value = gSaveContext.health >> 1; D_8015FFE0 = D_8015FFE2 = 20; break; case 2: D_8015FFE2--; if (D_8015FFE2 == 0) { - gSaveContext.timer_1_state = 3; + gSaveContext.timer1State = 3; D_8015FFE2 = 20; } break; case 5: case 11: D_8015FFE0 = D_8015FFE2 = 20; - if (gSaveContext.timer_1_state == 5) { - gSaveContext.timer_1_state = 6; + if (gSaveContext.timer1State == 5) { + gSaveContext.timer1State = 6; } else { - gSaveContext.timer_1_state = 12; + gSaveContext.timer1State = 12; } break; case 6: @@ -3606,74 +3605,74 @@ void Interface_Draw(GlobalContext* globalCtx) { D_8015FFE2--; if (D_8015FFE2 == 0) { D_8015FFE2 = 20; - if (gSaveContext.timer_1_state == 6) { - gSaveContext.timer_1_state = 7; + if (gSaveContext.timer1State == 6) { + gSaveContext.timer1State = 7; } else { - gSaveContext.timer_1_state = 13; + gSaveContext.timer1State = 13; } } break; case 3: case 7: - phi_s3 = (gSaveContext.timer_x[0] - 26) / D_8015FFE2; - gSaveContext.timer_x[0] -= phi_s3; + phi_s3 = (gSaveContext.timerX[0] - 26) / D_8015FFE2; + gSaveContext.timerX[0] -= phi_s3; - if (gSaveContext.health_capacity > 0xA0) { - phi_s3 = (gSaveContext.timer_y[0] - 54) / D_8015FFE2; + if (gSaveContext.healthCapacity > 0xA0) { + phi_s3 = (gSaveContext.timerY[0] - 54) / D_8015FFE2; } else { - phi_s3 = (gSaveContext.timer_y[0] - 46) / D_8015FFE2; + phi_s3 = (gSaveContext.timerY[0] - 46) / D_8015FFE2; } - gSaveContext.timer_y[0] -= phi_s3; + gSaveContext.timerY[0] -= phi_s3; D_8015FFE2--; if (D_8015FFE2 == 0) { - gSaveContext.timer_x[0] = 26; + gSaveContext.timerX[0] = 26; D_8015FFE2 = 20; - if (gSaveContext.health_capacity > 0xA0) { - gSaveContext.timer_y[0] = 54; + if (gSaveContext.healthCapacity > 0xA0) { + gSaveContext.timerY[0] = 54; } else { - gSaveContext.timer_y[0] = 46; + gSaveContext.timerY[0] = 46; } - if (gSaveContext.timer_1_state == 3) { - gSaveContext.timer_1_state = 4; + if (gSaveContext.timer1State == 3) { + gSaveContext.timer1State = 4; } else { - gSaveContext.timer_1_state = 8; + gSaveContext.timer1State = 8; } } case 4: case 8: - if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8)) { - if (gSaveContext.health_capacity > 0xA0) { - gSaveContext.timer_y[0] = 54; + if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8)) { + if (gSaveContext.healthCapacity > 0xA0) { + gSaveContext.timerY[0] = 54; } else { - gSaveContext.timer_y[0] = 46; + gSaveContext.timerY[0] = 46; } } - if ((gSaveContext.timer_1_state >= 3) && (msgCtx->unk_E300 == 0)) { + if ((gSaveContext.timer1State >= 3) && (msgCtx->unk_E300 == 0)) { D_8015FFE0--; if (D_8015FFE0 == 0) { - if (gSaveContext.timer_1_value != 0) { - gSaveContext.timer_1_value--; + if (gSaveContext.timer1Value != 0) { + gSaveContext.timer1Value--; } D_8015FFE0 = 20; - if (gSaveContext.timer_1_value == 0) { - gSaveContext.timer_1_state = 10; + if (gSaveContext.timer1Value == 0) { + gSaveContext.timer1State = 10; if (D_80125A5C != 0) { gSaveContext.health = 0; globalCtx->unk_11D58(globalCtx, -(gSaveContext.health + 2)); } D_80125A5C = 0; - } else if (gSaveContext.timer_1_value > 60) { + } else if (gSaveContext.timer1Value > 60) { if (sTimerDigits[4] == 1) { Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - } else if (gSaveContext.timer_1_value >= 11) { + } else if (gSaveContext.timer1Value >= 11) { if (sTimerDigits[4] & 1) { Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -3686,46 +3685,46 @@ void Interface_Draw(GlobalContext* globalCtx) { } break; case 13: - phi_s3 = (gSaveContext.timer_x[0] - 26) / D_8015FFE2; - gSaveContext.timer_x[0] -= phi_s3; + phi_s3 = (gSaveContext.timerX[0] - 26) / D_8015FFE2; + gSaveContext.timerX[0] -= phi_s3; - if (gSaveContext.health_capacity > 0xA0) { - phi_s3 = (gSaveContext.timer_y[0] - 54) / D_8015FFE2; + if (gSaveContext.healthCapacity > 0xA0) { + phi_s3 = (gSaveContext.timerY[0] - 54) / D_8015FFE2; } else { - phi_s3 = (gSaveContext.timer_y[0] - 46) / D_8015FFE2; + phi_s3 = (gSaveContext.timerY[0] - 46) / D_8015FFE2; } - gSaveContext.timer_y[0] -= phi_s3; + gSaveContext.timerY[0] -= phi_s3; D_8015FFE2--; if (D_8015FFE2 == 0) { - gSaveContext.timer_x[0] = 26; + gSaveContext.timerX[0] = 26; D_8015FFE2 = 20; - if (gSaveContext.health_capacity > 0xA0) { - gSaveContext.timer_y[0] = 54; + if (gSaveContext.healthCapacity > 0xA0) { + gSaveContext.timerY[0] = 54; } else { - gSaveContext.timer_y[0] = 46; + gSaveContext.timerY[0] = 46; } - gSaveContext.timer_1_state = 14; + gSaveContext.timer1State = 14; } case 14: - if (gSaveContext.timer_1_state == 14) { - if (gSaveContext.health_capacity > 0xA0) { - gSaveContext.timer_y[0] = 54; + if (gSaveContext.timer1State == 14) { + if (gSaveContext.healthCapacity > 0xA0) { + gSaveContext.timerY[0] = 54; } else { - gSaveContext.timer_y[0] = 46; + gSaveContext.timerY[0] = 46; } } - if (gSaveContext.timer_1_state >= 3) { + if (gSaveContext.timer1State >= 3) { D_8015FFE0--; if (D_8015FFE0 == 0) { - gSaveContext.timer_1_value++; + gSaveContext.timer1Value++; D_8015FFE0 = 20; - if (gSaveContext.timer_1_value == 3599) { - gSaveContext.timer_1_state = 15; + if (gSaveContext.timer1Value == 3599) { + gSaveContext.timer1State = 15; D_8015FFE2 = 40; } else { Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, @@ -3735,36 +3734,36 @@ void Interface_Draw(GlobalContext* globalCtx) { } break; case 10: - if (gSaveContext.timer_2_state != 0) { - gSaveContext.timer_x[1] = 140; - gSaveContext.timer_y[1] = 80; + if (gSaveContext.timer2State != 0) { + gSaveContext.timerX[1] = 140; + gSaveContext.timerY[1] = 80; D_8015FFE4 = D_8015FFE6 = 20; - if (gSaveContext.timer_2_state < 7) { - gSaveContext.timer_2_state = 2; + if (gSaveContext.timer2State < 7) { + gSaveContext.timer2State = 2; } else { - gSaveContext.timer_2_state = 8; + gSaveContext.timer2State = 8; } - gSaveContext.timer_1_state = 0; + gSaveContext.timer1State = 0; } else { - gSaveContext.timer_1_state = 0; + gSaveContext.timer1State = 0; } break; case 15: break; default: sp274 = 1; - switch (gSaveContext.timer_2_state) { + switch (gSaveContext.timer2State) { case 1: case 7: - gSaveContext.timer_x[1] = 140; - gSaveContext.timer_y[1] = 80; + gSaveContext.timerX[1] = 140; + gSaveContext.timerY[1] = 80; D_8015FFE4 = D_8015FFE6 = 20; - if (gSaveContext.timer_2_state == 1) { - gSaveContext.timer_2_state = 2; + if (gSaveContext.timer2State == 1) { + gSaveContext.timer2State = 2; } else { - gSaveContext.timer_2_state = 8; + gSaveContext.timer2State = 8; } break; case 2: @@ -3772,85 +3771,85 @@ void Interface_Draw(GlobalContext* globalCtx) { D_8015FFE6--; if (D_8015FFE6 == 0) { D_8015FFE6 = 20; - if (gSaveContext.timer_2_state == 2) { - gSaveContext.timer_2_state = 3; + if (gSaveContext.timer2State == 2) { + gSaveContext.timer2State = 3; } else { - gSaveContext.timer_2_state = 9; + gSaveContext.timer2State = 9; } } break; case 3: case 9: - osSyncPrintf("event_xp[1]=%d, event_yp[1]=%d TOTAL_EVENT_TM=%d\n", - gSaveContext.timer_x[1], gSaveContext.timer_y[1], gSaveContext.timer_2_value); + osSyncPrintf("event_xp[1]=%d, event_yp[1]=%d TOTAL_EVENT_TM=%d\n", gSaveContext.timerX[1], + gSaveContext.timerY[1], gSaveContext.timer2Value); - phi_s3 = (gSaveContext.timer_x[1] - 26) / D_8015FFE2; - gSaveContext.timer_x[1] -= phi_s3; + phi_s3 = (gSaveContext.timerX[1] - 26) / D_8015FFE2; + gSaveContext.timerX[1] -= phi_s3; - if (gSaveContext.health_capacity > 0xA0) { - phi_s3 = (gSaveContext.timer_y[1] - 54) / D_8015FFE6; + if (gSaveContext.healthCapacity > 0xA0) { + phi_s3 = (gSaveContext.timerY[1] - 54) / D_8015FFE6; } else { - phi_s3 = (gSaveContext.timer_y[1] - 46) / D_8015FFE6; + phi_s3 = (gSaveContext.timerY[1] - 46) / D_8015FFE6; } - gSaveContext.timer_y[1] -= phi_s3; + gSaveContext.timerY[1] -= phi_s3; D_8015FFE6--; if (D_8015FFE6 == 0) { - gSaveContext.timer_x[1] = 26; + gSaveContext.timerX[1] = 26; D_8015FFE6 = 20; - if (gSaveContext.health_capacity > 0xA0) { - gSaveContext.timer_y[1] = 54; + if (gSaveContext.healthCapacity > 0xA0) { + gSaveContext.timerY[1] = 54; } else { - gSaveContext.timer_y[1] = 46; + gSaveContext.timerY[1] = 46; } - if (gSaveContext.timer_2_state == 3) { - gSaveContext.timer_2_state = 4; + if (gSaveContext.timer2State == 3) { + gSaveContext.timer2State = 4; } else { - gSaveContext.timer_2_state = 10; + gSaveContext.timer2State = 10; } } case 4: case 10: - if ((gSaveContext.timer_2_state == 4) || (gSaveContext.timer_2_state == 10)) { - if (gSaveContext.health_capacity > 0xA0) { - gSaveContext.timer_y[1] = 54; + if ((gSaveContext.timer2State == 4) || (gSaveContext.timer2State == 10)) { + if (gSaveContext.healthCapacity > 0xA0) { + gSaveContext.timerY[1] = 54; } else { - gSaveContext.timer_y[1] = 46; + gSaveContext.timerY[1] = 46; } } - if (gSaveContext.timer_2_state >= 3) { + if (gSaveContext.timer2State >= 3) { D_8015FFE4--; if (D_8015FFE4 == 0) { D_8015FFE4 = 20; - if (gSaveContext.timer_2_state == 4) { - gSaveContext.timer_2_value--; - osSyncPrintf("TOTAL_EVENT_TM=%d\n", gSaveContext.timer_2_value); + if (gSaveContext.timer2State == 4) { + gSaveContext.timer2Value--; + osSyncPrintf("TOTAL_EVENT_TM=%d\n", gSaveContext.timer2Value); - if (gSaveContext.timer_2_value <= 0) { + if (gSaveContext.timer2Value <= 0) { if (!Flags_GetSwitch(globalCtx, 0x37) || ((globalCtx->sceneNum != SCENE_GANON_DEMO) && (globalCtx->sceneNum != SCENE_GANON_FINAL) && (globalCtx->sceneNum != SCENE_GANON_SONOGO) && (globalCtx->sceneNum != SCENE_GANONTIKA_SONOGO))) { - gSaveContext.timer_2_state = 5; - gSaveContext.cutscene_index = 0; + gSaveContext.timer2State = 5; + gSaveContext.cutsceneIndex = 0; D_8015FFE6 = 40; func_8010B680(globalCtx, 0x71B0, 0); func_8002DF54(globalCtx, 0, 8); } else { - gSaveContext.timer_2_state = 6; + gSaveContext.timer2State = 6; D_8015FFE6 = 40; } } else { - if (gSaveContext.timer_2_value > 60) { + if (gSaveContext.timer2Value > 60) { if (sTimerDigits[4] == 1) { Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - } else if (gSaveContext.timer_2_value > 10) { + } else if (gSaveContext.timer2Value > 10) { if (sTimerDigits[4] & 1) { Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -3861,17 +3860,17 @@ void Interface_Draw(GlobalContext* globalCtx) { } } } else { - gSaveContext.timer_2_value++; - if (gSaveContext.event_inf[1] & 1) { - if (gSaveContext.timer_2_value == 240) { + gSaveContext.timer2Value++; + if (gSaveContext.eventInf[1] & 1) { + if (gSaveContext.timer2Value == 240) { func_8010B680(globalCtx, 0x6083, 0); - gSaveContext.timer_2_state = 0; - gSaveContext.event_inf[1] &= ~1; + gSaveContext.timer2State = 0; + gSaveContext.eventInf[1] &= ~1; } } } - if ((gSaveContext.timer_2_value % 60) == 0) { + if ((gSaveContext.timer2Value % 60) == 0) { Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -3881,21 +3880,21 @@ void Interface_Draw(GlobalContext* globalCtx) { case 6: D_8015FFE6--; if (D_8015FFE6 == 0) { - gSaveContext.timer_2_state = 0; + gSaveContext.timer2State = 0; } break; } } - if (((gSaveContext.timer_1_state != 0) && (gSaveContext.timer_1_state != 10)) || - (gSaveContext.timer_2_state != 0)) { + if (((gSaveContext.timer1State != 0) && (gSaveContext.timer1State != 10)) || + (gSaveContext.timer2State != 0)) { sTimerDigits[0] = sTimerDigits[1] = sTimerDigits[3] = 0; sTimerDigits[2] = 10; // digit 10 is used as ':' (colon) - if (gSaveContext.timer_1_state != 0) { - sTimerDigits[4] = gSaveContext.timer_1_value; + if (gSaveContext.timer1State != 0) { + sTimerDigits[4] = gSaveContext.timer1Value; } else { - sTimerDigits[4] = gSaveContext.timer_2_value; + sTimerDigits[4] = gSaveContext.timer2Value; } while (sTimerDigits[4] >= 60) { @@ -3916,21 +3915,21 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPPipeSync(gfxCtx->overlay.p++); gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0x00); - gfxCtx->overlay.p = Gfx_TextureIA8(gfxCtx->overlay.p, D_02002000, 16, 16, gSaveContext.timer_x[sp274], - gSaveContext.timer_y[sp274] + 2, 16, 16, 1024, 1024); + gfxCtx->overlay.p = Gfx_TextureIA8(gfxCtx->overlay.p, D_02002000, 16, 16, gSaveContext.timerX[sp274], + gSaveContext.timerY[sp274] + 2, 16, 16, 1024, 1024); // Timer Counter gDPPipeSync(gfxCtx->overlay.p++); gDPSetCombineMode(gfxCtx->overlay.p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - if (gSaveContext.timer_1_state != 0) { - if ((gSaveContext.timer_1_value < 10) && (gSaveContext.timer_1_state < 11)) { + if (gSaveContext.timer1State != 0) { + if ((gSaveContext.timer1Value < 10) && (gSaveContext.timer1State < 11)) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0x32, 0x00, 0xFF); } else { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); } } else { - if ((gSaveContext.timer_2_value < 10) && (gSaveContext.timer_2_state < 6)) { + if ((gSaveContext.timer2Value < 10) && (gSaveContext.timer2State < 6)) { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0x32, 0x00, 0xFF); } else { gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0x00, 0xFF); @@ -3939,8 +3938,8 @@ void Interface_Draw(GlobalContext* globalCtx) { for (phi_s3 = 0; phi_s3 < 5; phi_s3++) { gfxCtx->overlay.p = Gfx_TextureI8(gfxCtx->overlay.p, &D_02003040[sTimerDigits[phi_s3]], 8, 16, - gSaveContext.timer_x[sp274] + sTimerDigitLeftPos[phi_s3], - gSaveContext.timer_y[sp274], sDigitWidth[phi_s3], VREG(42), + gSaveContext.timerX[sp274] + sTimerDigitLeftPos[phi_s3], + gSaveContext.timerY[sp274], sDigitWidth[phi_s3], VREG(42), VREG(43) * 2, VREG(43) * 2); } } @@ -3994,8 +3993,8 @@ void Interface_Update(GlobalContext* globalCtx) { } if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) { - if ((gSaveContext.minigame_state == 1) || (gSaveContext.scene_setup_index < 4) || - ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.scene_setup_index == 4))) { + if ((gSaveContext.minigameState == 1) || (gSaveContext.sceneSetupIndex < 4) || + ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.sceneSetupIndex == 4))) { if ((msgCtx->msgMode == 0) || ((msgCtx->msgMode != 0) && (globalCtx->sceneNum == SCENE_BOWLING))) { if (globalCtx->unk_10A20 == 0) { func_80083108(globalCtx); @@ -4102,21 +4101,21 @@ void Interface_Update(GlobalContext* globalCtx) { func_8008226C(globalCtx); - if (gSaveContext.health_accumulator != 0) { - gSaveContext.health_accumulator -= 4; + if (gSaveContext.healthAccumulator != 0) { + gSaveContext.healthAccumulator -= 4; gSaveContext.health += 4; if ((gSaveContext.health & 0xF) < 4) { Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - osSyncPrintf("now_life=%d max_life=%d\n", gSaveContext.health, gSaveContext.health_capacity); + osSyncPrintf("now_life=%d max_life=%d\n", gSaveContext.health, gSaveContext.healthCapacity); - if (gSaveContext.health >= gSaveContext.health_capacity) { - gSaveContext.health = gSaveContext.health_capacity; + if (gSaveContext.health >= gSaveContext.healthCapacity) { + gSaveContext.health = gSaveContext.healthCapacity; osSyncPrintf("S_Private.now_life=%d S_Private.max_life=%d\n", gSaveContext.health, - gSaveContext.health_capacity); - gSaveContext.health_accumulator = 0; + gSaveContext.healthCapacity); + gSaveContext.healthAccumulator = 0; } } @@ -4135,25 +4134,25 @@ void Interface_Update(GlobalContext* globalCtx) { Health_UpdateData(globalCtx); - if ((gSaveContext.timer_1_state >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && + if ((gSaveContext.timer1State >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (msgCtx->msgMode == 0) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) && - (globalCtx->unk_1241B == 0) && (func_800BFC84(globalCtx) == 0)) {} + (globalCtx->unk_1241B == 0) && !Gameplay_InCsMode(globalCtx)) {} - if (gSaveContext.rupee_accumulator != 0) { - if (gSaveContext.rupee_accumulator > 0) { + if (gSaveContext.rupeeAccumulator != 0) { + if (gSaveContext.rupeeAccumulator > 0) { if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET)) { - gSaveContext.rupee_accumulator--; + gSaveContext.rupeeAccumulator--; gSaveContext.rupees++; Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else { // Translates to: "Rupee Amount MAX = %d" osSyncPrintf("ルピー数MAX = %d\n", CUR_CAPACITY(UPG_WALLET)); gSaveContext.rupees = CUR_CAPACITY(UPG_WALLET); - gSaveContext.rupee_accumulator = 0; + gSaveContext.rupeeAccumulator = 0; } } else if (gSaveContext.rupees != 0) { - if (gSaveContext.rupee_accumulator <= -50) { - gSaveContext.rupee_accumulator += 10; + if (gSaveContext.rupeeAccumulator <= -50) { + gSaveContext.rupeeAccumulator += 10; gSaveContext.rupees -= 10; if (gSaveContext.rupees < 0) { @@ -4162,12 +4161,12 @@ void Interface_Update(GlobalContext* globalCtx) { Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else { - gSaveContext.rupee_accumulator++; + gSaveContext.rupeeAccumulator++; gSaveContext.rupees--; Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } else { - gSaveContext.rupee_accumulator = 0; + gSaveContext.rupeeAccumulator = 0; } } @@ -4218,14 +4217,14 @@ void Interface_Update(GlobalContext* globalCtx) { if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (msgCtx->msgMode == 0) && (globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->unk_1241B == 0) && - ((globalCtx->csCtx.state == 0) || (func_8008E988(globalCtx) == 0))) { - if ((gSaveContext.magic_acquired != 0) && (gSaveContext.magic_level == 0)) { - gSaveContext.magic_level = gSaveContext.double_magic + 1; + ((globalCtx->csCtx.state == 0) || !func_8008E988(globalCtx))) { + if ((gSaveContext.magicAcquired != 0) && (gSaveContext.magicLevel == 0)) { + gSaveContext.magicLevel = gSaveContext.doubleMagic + 1; gSaveContext.unk_13F0 = 8; osSyncPrintf(VT_FGCOL(YELLOW)); // Translates to: "Magic Start!!!!!!!!!" osSyncPrintf("魔法スター─────ト!!!!!!!!!\n"); - osSyncPrintf("MAGIC_MAX=%d\n", gSaveContext.magic_level); + osSyncPrintf("MAGIC_MAX=%d\n", gSaveContext.magicLevel); osSyncPrintf("MAGIC_NOW=%d\n", gSaveContext.magic); osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.unk_13F6); osSyncPrintf("Z_MAGIC_NOW_MAX=%d\n", gSaveContext.unk_13F4); @@ -4235,29 +4234,29 @@ void Interface_Update(GlobalContext* globalCtx) { Interface_UpdateMagicBar(globalCtx); } - if (gSaveContext.timer_1_state == 0) { + if (gSaveContext.timer1State == 0) { if (((D_80125A58 == 1) || (D_80125A58 == 2) || (D_80125A58 == 4)) && ((gSaveContext.health >> 1) != 0)) { - gSaveContext.timer_1_state = 1; - gSaveContext.timer_x[0] = 140; - gSaveContext.timer_y[0] = 80; + gSaveContext.timer1State = 1; + gSaveContext.timerX[0] = 140; + gSaveContext.timerY[0] = 80; D_80125A5C = 1; } } else { - if (((D_80125A58 == 0) || (D_80125A58 == 3)) && (gSaveContext.timer_1_state < 5)) { - gSaveContext.timer_1_state = 0; + if (((D_80125A58 == 0) || (D_80125A58 == 3)) && (gSaveContext.timer1State < 5)) { + gSaveContext.timer1State = 0; } } - if (gSaveContext.minigame_state == 1) { - gSaveContext.minigame_score += interfaceCtx->unk_23C; + if (gSaveContext.minigameState == 1) { + gSaveContext.minigameScore += interfaceCtx->unk_23C; interfaceCtx->unk_23C = 0; if (sHBAScoreTier == 0) { - if (gSaveContext.minigame_score >= 1000) { + if (gSaveContext.minigameScore >= 1000) { sHBAScoreTier++; } } else if (sHBAScoreTier == 1) { - if (gSaveContext.minigame_score >= 1500) { + if (gSaveContext.minigameScore >= 1500) { sHBAScoreTier++; } } @@ -4265,7 +4264,7 @@ void Interface_Update(GlobalContext* globalCtx) { sHBAScoreDigits[1] = 0; sHBAScoreDigits[0] = 0; sHBAScoreDigits[2] = 0; - sHBAScoreDigits[3] = gSaveContext.minigame_score; + sHBAScoreDigits[3] = gSaveContext.minigameScore; while (sHBAScoreDigits[3] >= 1000) { sHBAScoreDigits[0]++; @@ -4288,50 +4287,50 @@ void Interface_Update(GlobalContext* globalCtx) { globalCtx->msgCtx.unk_E3EE = 4; } - if (globalCtx->unk_10A26 != 0) { + if (globalCtx->envCtx.unk_02 != 0) { if (gSaveContext.unk_1422 != 2) { D_80125B60 = 0; - if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time <= 0xC001)) { + if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) { D_80125B60 = 1; } gSaveContext.unk_1422 = 2; D_80125B64 = D_8011FB40; D_8011FB40 = 400; - } else if ((D_80125B60 == 0) && (gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time <= 0xC001)) { + } else if ((D_80125B60 == 0) && (gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) { gSaveContext.unk_1422 = 0; D_8011FB40 = D_80125B64; globalCtx->msgCtx.unk_E3EE = 4; - } else if (gSaveContext.day_time > 0xC001) { + } else if (gSaveContext.dayTime > 0xC001) { gSaveContext.unk_1422 = 0; D_8011FB40 = D_80125B64; globalCtx->msgCtx.unk_E3EE = 4; } } else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3)) { - if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time < 0xC001)) { - gSaveContext.next_day_time = 0; - globalCtx->fadeOutTransition = 4; - gSaveContext.transition_type = 2; + if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xC001)) { + gSaveContext.nextDayTime = 0; + globalCtx->fadeTransition = 4; + gSaveContext.nextTransition = 2; globalCtx->unk_11DE9 = 1; } else { - gSaveContext.next_day_time = 0x8001; - globalCtx->fadeOutTransition = 5; - gSaveContext.transition_type = 3; + gSaveContext.nextDayTime = 0x8001; + globalCtx->fadeTransition = 5; + gSaveContext.nextTransition = 3; globalCtx->unk_11DE9 = 1; } if (globalCtx->sceneNum == SCENE_SPOT13) { - globalCtx->fadeOutTransition = 0xE; - gSaveContext.transition_type = 0xE; + globalCtx->fadeTransition = 14; + gSaveContext.nextTransition = 14; } - gSaveContext.respawn_flag = -2; - globalCtx->nextEntranceIndex = gSaveContext.entrance_index; + gSaveContext.respawnFlag = -2; + globalCtx->nextEntranceIndex = gSaveContext.entranceIndex; globalCtx->sceneLoadFlag = 0x14; gSaveContext.unk_1422 = 0; func_800F6964(30); - gSaveContext.seq_index = 0xFF; - gSaveContext.night_sfx = 0xFF; + gSaveContext.seqIndex = 0xFF; + gSaveContext.nightSeqIndex = 0xFF; } else { gSaveContext.unk_1422 = 3; } diff --git a/src/code/z_play.c b/src/code/z_play.c index 99d454e6f..647a310d2 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1,59 +1,1464 @@ #include <ultra64.h> #include <global.h> +#include <vt.h> + +void* D_8012D1F0 = NULL; +UNK_TYPE D_8012D1F4 = 0; // unused +Input* D_8012D1F8 = NULL; + +TransitionStruct D_801613B0; +s32 D_80161490; +VisMonoStruct D_80161498; +Color_RGBA8 D_801614B0; +FaultClient D_801614B8; +s16 D_801614C8; +u64 D_801614D0[0xA00]; void func_800BC450(GlobalContext* globalCtx) { - func_8005A7A8(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], globalCtx->unk_1242B - 1, - globalCtx); + func_8005A7A8(globalCtx->cameraPtrs[globalCtx->activeCamera], globalCtx->unk_1242B - 1); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC490.s") +void func_800BC490(GlobalContext* globalCtx, s16 point) { + if (!(point == 1 || point == 2)) { + __assert("point == 1 || point == 2", "../z_play.c", 2160); + } + + globalCtx->unk_1242B = point; + + if ((YREG(15) != 0x10) && (gSaveContext.cutsceneIndex < 0xFFF0)) { + Audio_PlaySoundGeneral((point == 1) ? NA_SE_SY_CAMERA_ZOOM_DOWN : NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, + &D_801333E0, &D_801333E0, &D_801333E8); + } + + func_800BC450(globalCtx); +} s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1) { - return arg1 == globalCtx->unk_1242B; + return (arg1 == globalCtx->unk_1242B); } +// original name: "Game_play_shop_pr_vr_switch_set" void func_800BC590(GlobalContext* globalCtx) { osSyncPrintf("Game_play_shop_pr_vr_switch_set()\n"); + if (YREG(15) == 0x10) { globalCtx->unk_1242B = 2; } } +#ifdef NON_MATCHING +// single minor ordering difference +void func_800BC5E0(GlobalContext* globalCtx, s32 arg1) { + TransitionContext* transitionCtx = &globalCtx->transitionCtx; + + bzero(transitionCtx, sizeof(TransitionContext)); + + transitionCtx->unk_228 = arg1; + + if ((transitionCtx->unk_228 >> 5) == 1) { + transitionCtx->unk_22C = func_800B301C; + transitionCtx->unk_230 = func_800B3044; + transitionCtx->unk_23C = func_800B2E30; + transitionCtx->unk_24C = func_800B346C; + transitionCtx->unk_238 = func_800B31D0; + transitionCtx->unk_234 = func_800B304C; + transitionCtx->unk_240 = func_800B3474; + transitionCtx->unk_244 = func_800B34CC; + transitionCtx->unk_248 = func_800B34D4; + return; + } + + switch (transitionCtx->unk_228) { + case 1: + transitionCtx->unk_22C = func_800B2438; + transitionCtx->unk_230 = func_800B24D0; + transitionCtx->unk_23C = func_800B2400; + transitionCtx->unk_24C = func_800B2944; + transitionCtx->unk_238 = func_800B2604; + transitionCtx->unk_234 = func_800B24D8; + transitionCtx->unk_240 = func_800B25F4; + transitionCtx->unk_244 = func_800B25EC; + transitionCtx->unk_248 = NULL; + return; + case 0: + case 8: + transitionCtx->unk_22C = func_800B2A88; + transitionCtx->unk_230 = func_800B2AB0; + transitionCtx->unk_23C = func_800B29D0; + transitionCtx->unk_24C = func_800B2DD4; + transitionCtx->unk_238 = func_800B2B98; + transitionCtx->unk_234 = func_800B2AB8; + transitionCtx->unk_240 = func_800B2DDC; + transitionCtx->unk_244 = func_800B2E1C; + transitionCtx->unk_248 = NULL; + return; + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 17: + case 18: + case 19: + transitionCtx->unk_22C = func_800B3538; + transitionCtx->unk_230 = func_800B3560; + transitionCtx->unk_23C = func_800B34E0; + transitionCtx->unk_24C = func_800B37DC; + transitionCtx->unk_238 = func_800B3718; + transitionCtx->unk_234 = func_800B3568; + transitionCtx->unk_240 = func_800B37EC; + transitionCtx->unk_244 = func_800B37E4; + transitionCtx->unk_248 = NULL; + return; + case 9: + case 10: + globalCtx->unk_1241B = 4; + return; + case 11: + globalCtx->unk_1241B = 10; + return; + case 12: + globalCtx->unk_1241B = 7; + return; + case 14: + globalCtx->unk_1241B = 12; + return; + case 15: + globalCtx->unk_1241B = 14; + return; + case 16: + globalCtx->unk_1241B = 16; + return; + } + + Fault_AddHungupAndCrash("../z_play.c", 2290); +} +#else #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC5E0.s") +#endif void func_800BC88C(GlobalContext* globalCtx) { - globalCtx->unk_123F0 = -1; + globalCtx->transitionCtx.unk_228 = -1; } -Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1) { - Gfx_SetFog2(a1, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08, globalCtx->lightCtx.unk_09, 0, +Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* gfx) { + Gfx_SetFog2(gfx, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08, globalCtx->lightCtx.unk_09, 0, globalCtx->lightCtx.unk_0A, 1000); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC8EC.s") +void Gameplay_Destroy(GlobalContext* globalCtx) { + s32 pad; + Player* player = PLAYER; + + globalCtx->state.gfxCtx->callback = NULL; + globalCtx->state.gfxCtx->callbackParam = 0; + SREG(91) = 0; + R_PAUSE_MENU_MODE = 0; + + func_800C0F08(&globalCtx->preRenderCtx); + func_800271A8(globalCtx); + Effect_SS_Clear(globalCtx); + func_8005D400(globalCtx, &globalCtx->sub_11E60); + + if (D_80161490 == 3) { + func_800B1DBC(&D_801613B0); + D_80161490 = 0; + } + + if (globalCtx->unk_1241B == 3) { + globalCtx->transitionCtx.unk_230(&globalCtx->transitionCtx); + func_800BC88C(globalCtx); + globalCtx->unk_1241B = 0; + } + + func_800B3968(); + func_800B3560(&globalCtx->sub_1241C); + func_800AD054(&D_80161498); + + if (gSaveContext.linkAge != globalCtx->linkAgeOnLoad) { + Inventory_SwapAgeEquipment(); + func_8008ECAC(globalCtx, player); + } + + func_80031C3C(&globalCtx->actorCtx, globalCtx); + func_80110990(globalCtx); + KaleidoScopeCall_Destroy(globalCtx); + KaleidoManager_Destroy(); + ZeldaArena_Cleanup(); + Fault_RemoveClient(&D_801614B8); +} + +#ifdef NON_MATCHING +// regalloc and stack usage differences +// also missing some extra duplicated instructions +void Gameplay_Init(GlobalContext* globalCtx) { + GraphicsContext* gfxCtx; + void* zAlloc; // 0x84 + void* zAllocAligned; + u32 zAllocSize; // 0x7C + Player* player; // 0x78 + EntranceInfo* spawnEntrance; + s32 playerStartCamId; + u8 tempSetupIndex; // 0x6F + s32 i; + + gfxCtx = globalCtx->state.gfxCtx; + + if (gSaveContext.entranceIndex == -1) { + gSaveContext.entranceIndex = 0; + globalCtx->state.running = false; + SET_NEXT_GAMESTATE(&globalCtx->state, Opening_Init, OpeningContext); + return; + } + + SystemArena_Display(); + func_800C4F20(globalCtx, 0x1D4790); + KaleidoManager_Init(globalCtx); + View_Init(&globalCtx->view, gfxCtx); + func_800F6828(0); + Quake_Init(); + + for (i = 0; i < 4; i++) { + globalCtx->cameraPtrs[i] = NULL; + } + + func_80057C6C(&globalCtx->cameras[0], &globalCtx->view, &globalCtx->colCtx, globalCtx); + Camera_ChangeStatus(&globalCtx->cameras[0], 7); + + for (i = 0; i < 3; i++) { + func_80057C6C(&globalCtx->cameras[i + 1], &globalCtx->view, &globalCtx->colCtx, globalCtx); + Camera_ChangeStatus(&globalCtx->cameras[i + 1], 0x100); + } + + globalCtx->cameraPtrs[0] = &globalCtx->cameras[0]; + globalCtx->cameraPtrs[0]->unk_130 = 0; + globalCtx->activeCamera = 0; + func_8005AC48(&globalCtx->cameras[0], 0xFF); + func_800A9D28(globalCtx, &globalCtx->sub_1F74); + func_80112098(globalCtx); + func_80110F68(globalCtx); + func_80110450(globalCtx); + func_8006BA00(globalCtx); + func_80026C2C(globalCtx); + func_800272B0(globalCtx, 0x55); + func_8005D3BC(globalCtx, &globalCtx->sub_11E60); + SkelAnime_AnimationCtxReset(&globalCtx->animationCtx); + func_8006450C(globalCtx, &globalCtx->csCtx); + + if (gSaveContext.nextCutsceneIndex != 0xFFEF) { + gSaveContext.cutsceneIndex = gSaveContext.nextCutsceneIndex; + gSaveContext.nextCutsceneIndex = 0xFFEF; + } + + if (gSaveContext.cutsceneIndex == 0xFFFD) { + gSaveContext.cutsceneIndex = 0; + } + + if (gSaveContext.nextDayTime != 0xFFFFU) { + gSaveContext.dayTime = gSaveContext.nextDayTime; + gSaveContext.environmentTime = gSaveContext.nextDayTime; + } + + if ((gSaveContext.dayTime >= 0xC001) || (gSaveContext.dayTime < 0x4555)) { + gSaveContext.nightFlag = 1; + } else { + gSaveContext.nightFlag = 0; + } + + Cutscene_HandleConditionalTriggers(globalCtx); + + if ((gSaveContext.gameMode != 0) || (gSaveContext.cutsceneIndex >= 0xFFF0)) { + gSaveContext.nayrusLoveTimer = 0; + func_800876C8(globalCtx); + gSaveContext.sceneSetupIndex = (gSaveContext.cutsceneIndex & 0xF) + 4; + } else if (LINK_IS_CHILD && (gSaveContext.nightFlag == 0)) { + gSaveContext.sceneSetupIndex = 0; + } else if (LINK_IS_CHILD && (gSaveContext.nightFlag != 0)) { + gSaveContext.sceneSetupIndex = 1; + } else if (LINK_IS_ADULT && (gSaveContext.nightFlag == 0)) { + gSaveContext.sceneSetupIndex = 2; + } else { + gSaveContext.sceneSetupIndex = 3; + } + + tempSetupIndex = gSaveContext.sceneSetupIndex; + if ((gEntranceTable[gSaveContext.entranceIndex].scene == SCENE_SPOT00) && LINK_IS_CHILD && + (gSaveContext.sceneSetupIndex < 4)) { + if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && + CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { + gSaveContext.sceneSetupIndex = 1; + } else { + gSaveContext.sceneSetupIndex = 0; + } + } else if ((gEntranceTable[gSaveContext.entranceIndex].scene == SCENE_SPOT04) && LINK_IS_ADULT && + (gSaveContext.sceneSetupIndex < 4)) { + if (gSaveContext.eventChkInf[4] & 0x100) { + gSaveContext.sceneSetupIndex = 3; + } else { + gSaveContext.sceneSetupIndex = 2; + } + } + + spawnEntrance = &gEntranceTable[gSaveContext.entranceIndex + gSaveContext.sceneSetupIndex]; + Gameplay_SpawnScene(globalCtx, spawnEntrance->scene, spawnEntrance->spawn); + osSyncPrintf("\nSCENE_NO=%d COUNTER=%d\n", gSaveContext.entranceIndex, gSaveContext.sceneSetupIndex); + + // When entering Gerudo Valley in the right setup, 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. + if ((gEntranceTable[gSaveContext.entranceIndex].scene == SCENE_SPOT09) && (gSaveContext.sceneSetupIndex == 6)) { + osSyncPrintf("エンディングはじまるよー\n"); // "The ending starts" + ((void (*)())0x81000000)(); + osSyncPrintf("出戻り?\n"); // "Return?" + } + + Cutscene_HandleEntranceTriggers(globalCtx); + KaleidoScopeCall_Init(globalCtx); + func_801109B0(globalCtx); + + if (gSaveContext.nextDayTime != 0xFFFF) { + if (gSaveContext.nextDayTime == 0x8001) { + gSaveContext.unk_14++; + gSaveContext.unk_18++; + gSaveContext.dogIsLost = true; + if (Inventory_ReplaceItem(globalCtx, ITEM_WEIRD_EGG, ITEM_CHICKEN) || + Inventory_ReplaceItem(globalCtx, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO)) { + func_8010B680(globalCtx, 0x3066, 0); + } + gSaveContext.nextDayTime = 0xFFFE; + } else { + gSaveContext.nextDayTime = 0xFFFD; + } + } + + SREG(91) = -1; + R_PAUSE_MENU_MODE = 0; + func_800C0EA8(&globalCtx->preRenderCtx); + func_800C0E70(&globalCtx->preRenderCtx, 0x140, 0xF0, 0, 0, 0); + func_800C0ED8(&globalCtx->preRenderCtx, 0x140, 0xF0, 0, 0); + D_80161490 = 0; + globalCtx->unk_1241B = 0; + func_8008E6A0(&globalCtx->sub_7B8); + func_800FD9A0((u32)osGetTime()); + Matrix_Init(&globalCtx->state); + globalCtx->state.main = Gameplay_Main; + globalCtx->state.destroy = Gameplay_Destroy; + globalCtx->sceneLoadFlag = -0x14; + globalCtx->unk_11E16 = 0xFF; + globalCtx->unk_11E18 = 0; + globalCtx->unk_11DE9 = 0; + + if (gSaveContext.gameMode != 1) { + if (gSaveContext.nextTransition == 0xFF) { + globalCtx->fadeTransition = + (gEntranceTable[gSaveContext.entranceIndex + tempSetupIndex].field >> 7) & 0x7F; // Fade In + } else { + globalCtx->fadeTransition = gSaveContext.nextTransition; + gSaveContext.nextTransition = 0xFF; + } + } else { + globalCtx->fadeTransition = 6; + } + + func_800B3908(); + func_800B3538(&globalCtx->sub_1241C); + func_800B37EC(&globalCtx->sub_1241C, 3); + func_800B37E4(&globalCtx->sub_1241C, RGBA8(0xA0, 0xA0, 0xA0, 0xFF)); + func_800B34E0(&globalCtx->sub_1241C); + func_800AD000(&D_80161498); + D_801614B0.a = 0x00; + func_8006C3A0(globalCtx); + + osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetSize(&globalCtx->state.tha)); + zAllocSize = THA_GetSize(&globalCtx->state.tha); + zAlloc = Game_Alloc(&globalCtx->state, zAllocSize, "../z_play.c", 2918); + zAllocAligned = (void*)(((u32)zAlloc + 8) & ~0xF); + ZeldaArena_Init(zAllocAligned, zAllocSize - (u32)zAllocAligned + (u32)zAlloc); + osSyncPrintf("ゼルダヒープ %08x-%08x\n", zAllocAligned, + (s32)((u32)zAllocAligned + zAllocSize) - (s32)((u32)zAllocAligned - (u32)zAlloc)); // "Zelda Heap" + + Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL); + func_800304DC(globalCtx, &globalCtx->actorCtx, globalCtx->linkActorEntry); + + while (!func_800973FC(globalCtx, &globalCtx->roomCtx)) { + ; // Empty Loop + } + + player = PLAYER; + func_80058148(&globalCtx->cameras[0], player); + func_8005A444(&globalCtx->cameras[0], 0); + + playerStartCamId = player->actor.params & 0xFF; + if (playerStartCamId != 0xFF) { + osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartCamId); + func_8005A7A8(&globalCtx->cameras[0], playerStartCamId); + } + + if (YREG(15) == 0x20) { + globalCtx->unk_1242B = 2; + } else if (YREG(15) == 0x10) { + globalCtx->unk_1242B = 1; + } else { + globalCtx->unk_1242B = 0; + } + + Interface_SetSceneRestrictions(globalCtx); + func_800758AC(globalCtx); + gSaveContext.seqIndex = globalCtx->soundCtx.musicSeq; + gSaveContext.nightSeqIndex = globalCtx->soundCtx.nighttimeSFX; + func_8002DF18(globalCtx, PLAYER); + func_800A390C(globalCtx, &globalCtx->animationCtx); + gSaveContext.respawnFlag = 0; + + if (dREG(95) != 0) { + D_8012D1F0 = D_801614D0; + osSyncPrintf("\nkawauso_data=[%x]", D_8012D1F0); + DmaMgr_DMARomToRam(0x03FEB000, (u32)D_8012D1F0, 0x5000); + } +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Gameplay_Init.s") +#endif + +#ifdef NON_MATCHING +// regalloc and stack usage differences +// also missing an extra move instruction +void Gameplay_Update(GlobalContext* globalCtx) { + s32 sp80; + Input* input; + u32 i; // 0x78 + s32 temp; + + input = globalCtx->state.input; + + if ((SREG(1) < 0) || (DREG(0) != 0)) { + SREG(1) = 0; + ZeldaArena_Display(); + } + + if ((HREG(80) == 18) && (HREG(81) < 0)) { + HREG(81) = 0; + osSyncPrintf("object_exchange_rom_address %u\n", gObjectTableSize); + osSyncPrintf("RomStart RomEnd Size\n"); + for (i = 0; i < gObjectTableSize; i++) { + s32 size = gObjectTable[i].vromEnd - gObjectTable[i].vromStart; + osSyncPrintf("%08x-%08x %08x(%8.3fKB)\n", gObjectTable[i].vromStart, gObjectTable[i].vromEnd, size, + size * 0.0009765625f); + } + osSyncPrintf("\n"); + } + + if ((HREG(81) == 18) && (HREG(82) < 0)) { + HREG(82) = 0; + ActorOverlayTable_LogPrint(); + } + + gSegments[4] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); + gSegments[5] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); + gSegments[2] = PHYSICAL_TO_VIRTUAL(globalCtx->sceneSegment); + + if (func_8008E6AC(&globalCtx->sub_7B8, &input[1]) != 0) { + if ((globalCtx->unk_1241B == 0) && (globalCtx->sceneLoadFlag != 0)) { + globalCtx->unk_1241B = 1; + } + + if (D_80161490 != 0) { + switch (D_80161490) { + case 2: + if (func_800B1E84(&D_801613B0, 10, 7) == 0) { + osSyncPrintf("fbdemo_init呼出し失敗!\n"); // "fbdemo_init call failed!" + D_80161490 = 0; + } else { + D_801613B0.unk_DC = gZBuffer; + D_80161490 = 3; + R_UPDATE_RATE = 1; + } + break; + case 3: + func_800B23E8(&D_801613B0); + break; + } + } + + if (globalCtx->unk_1241B != 0) { + switch (globalCtx->unk_1241B) { + case 1: + if (globalCtx->sceneLoadFlag != -0x14) { + s16 sp6E = 0; + Interface_ChangeAlpha(1); + + if (gSaveContext.cutsceneIndex >= 0xFFF0) { + sp6E = (gSaveContext.cutsceneIndex & 0xF) + 4; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BCA64.s") + if (!(gEntranceTable[globalCtx->nextEntranceIndex + sp6E].field & 0x8000)) { // Continue BGM Off + osSyncPrintf("\n\n\nサウンドイニシャル来ました。111"); // "Sound initalized. 111" + if ((globalCtx->fadeTransition < 56) && (func_80077600() == 0)) { + osSyncPrintf("\n\n\nサウンドイニシャル来ました。222"); // "Sound initalized. 222" + func_800F6964(0x14); + gSaveContext.seqIndex = 0xFF; + gSaveContext.nightSeqIndex = 0xFF; + } + } + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BD314.s") + if (CREG(11) == 0) { + func_800BC5E0(globalCtx, globalCtx->fadeTransition); + } else { + func_800BC5E0(globalCtx, CREG(12)); + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BED40.s") + if (globalCtx->unk_1241B >= 4) { + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BEDD8.s") + case 2: + globalCtx->transitionCtx.unk_22C(&globalCtx->transitionCtx); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFAE4.s") + if ((globalCtx->transitionCtx.unk_228 >> 5) == 1) { + globalCtx->transitionCtx.unk_240(&globalCtx->transitionCtx, + globalCtx->transitionCtx.unk_228 | 0x80); + } -s32 func_800BFC84(GlobalContext* globalCtx) { - return globalCtx->csCtx.state != 0 || func_8008E988(globalCtx) != 0; + gSaveContext.unk_1419 = 14; + if ((globalCtx->transitionCtx.unk_228 == 8) || (globalCtx->transitionCtx.unk_228 == 9)) { + gSaveContext.unk_1419 = 28; + } + + gSaveContext.fadeDuration = 60; + if ((globalCtx->transitionCtx.unk_228 == 4) || (globalCtx->transitionCtx.unk_228 == 5)) { + gSaveContext.fadeDuration = 20; + } else if ((globalCtx->transitionCtx.unk_228 == 6) || (globalCtx->transitionCtx.unk_228 == 7)) { + gSaveContext.fadeDuration = 150; + } else if (globalCtx->transitionCtx.unk_228 == 17) { + gSaveContext.fadeDuration = 2; + } + + if ((globalCtx->transitionCtx.unk_228 == 3) || (globalCtx->transitionCtx.unk_228 == 5) || + (globalCtx->transitionCtx.unk_228 == 7) || (globalCtx->transitionCtx.unk_228 == 13) || + (globalCtx->transitionCtx.unk_228 == 17)) { + globalCtx->transitionCtx.unk_244(&globalCtx->transitionCtx, RGBA8(0xA0, 0xA0, 0xA0, 0xFF)); + if (globalCtx->transitionCtx.unk_248 != NULL) { + globalCtx->transitionCtx.unk_248(&globalCtx->transitionCtx, RGBA8(0xA0, 0xA0, 0xA0, 0xFF)); + } + } else if (globalCtx->transitionCtx.unk_228 == 18) { + globalCtx->transitionCtx.unk_244(&globalCtx->transitionCtx, RGBA8(0x8C, 0x8C, 0x64, 0xFF)); + if (globalCtx->transitionCtx.unk_248 != NULL) { + globalCtx->transitionCtx.unk_248(&globalCtx->transitionCtx, RGBA8(0x8C, 0x8C, 0x64, 0xFF)); + } + } else if (globalCtx->transitionCtx.unk_228 == 19) { + globalCtx->transitionCtx.unk_244(&globalCtx->transitionCtx, RGBA8(0x46, 0x64, 0x6E, 0xFF)); + if (globalCtx->transitionCtx.unk_248 != NULL) { + globalCtx->transitionCtx.unk_248(&globalCtx->transitionCtx, RGBA8(0x46, 0x64, 0x6E, 0xFF)); + } + } else { + globalCtx->transitionCtx.unk_244(&globalCtx->transitionCtx, RGBA8(0x00, 0x00, 0x00, 0x00)); + if (globalCtx->transitionCtx.unk_248 != NULL) { + globalCtx->transitionCtx.unk_248(&globalCtx->transitionCtx, RGBA8(0x00, 0x00, 0x00, 0x00)); + } + } + + if (globalCtx->sceneLoadFlag == -0x14) { + globalCtx->transitionCtx.unk_240(&globalCtx->transitionCtx, 1); + } else { + globalCtx->transitionCtx.unk_240(&globalCtx->transitionCtx, 2); + } + + globalCtx->transitionCtx.unk_23C(&globalCtx->transitionCtx); + + if (globalCtx->transitionCtx.unk_228 == 13) { + globalCtx->unk_1241B = 11; + } else { + globalCtx->unk_1241B = 3; + } + break; + + case 3: + if (globalCtx->transitionCtx.unk_24C(&globalCtx->transitionCtx) != 0) { + if (globalCtx->transitionCtx.unk_228 >= 56) { + if (globalCtx->sceneLoadFlag == -0x14) { + globalCtx->transitionCtx.unk_230(&globalCtx->transitionCtx); + func_800BC88C(globalCtx); + globalCtx->unk_1241B = 0; + } + } else if (globalCtx->sceneLoadFlag != -0x14) { + globalCtx->state.running = 0; + if (gSaveContext.gameMode != 2) { + SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext); + gSaveContext.entranceIndex = globalCtx->nextEntranceIndex; + if (gSaveContext.minigameState == 1) { + gSaveContext.minigameState = 3; + } + } else { + SET_NEXT_GAMESTATE(&globalCtx->state, func_80811A20, char[0x1CAE0]); + } + } else { + globalCtx->transitionCtx.unk_230(&globalCtx->transitionCtx); + func_800BC88C(globalCtx); + globalCtx->unk_1241B = 0; + if (D_80161490 == 3) { + func_800B1DBC(&D_801613B0); + D_80161490 = 0; + R_UPDATE_RATE = 3; + } + } + globalCtx->sceneLoadFlag = 0; + } else { + globalCtx->transitionCtx.unk_234(&globalCtx->transitionCtx, R_UPDATE_RATE); + } + break; + } + + switch (globalCtx->unk_1241B) { + case 4: + D_801614C8 = 0; + globalCtx->envCtx.unk_E1 = 1; + globalCtx->envCtx.unk_E2[0] = 0xA0; + globalCtx->envCtx.unk_E2[1] = 0xA0; + globalCtx->envCtx.unk_E2[2] = 0xA0; + if (globalCtx->sceneLoadFlag != -0x14) { + globalCtx->envCtx.unk_E2[3] = 0; + globalCtx->unk_1241B = 5; + } else { + globalCtx->envCtx.unk_E2[3] = 0xFF; + globalCtx->unk_1241B = 6; + } + break; + + case 5: + globalCtx->envCtx.unk_E2[3] = (D_801614C8 / 20.0f) * 255.0f; + if (D_801614C8 >= 20 && 1) { + globalCtx->state.running = 0; + SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext); + gSaveContext.entranceIndex = globalCtx->nextEntranceIndex; + globalCtx->sceneLoadFlag = 0; + globalCtx->unk_1241B = 0; + } else { + D_801614C8++; + } + break; + + case 6: + globalCtx->envCtx.unk_E2[3] = (1 - D_801614C8 / 20.0f) * 255.0f; + if (D_801614C8 >= 20 && 1) { + D_80161490 = 0; + R_UPDATE_RATE = 3; + globalCtx->sceneLoadFlag = 0; + globalCtx->unk_1241B = 0; + globalCtx->envCtx.unk_E1 = 0; + } else { + D_801614C8++; + } + break; + + case 7: + D_801614C8 = 0; + globalCtx->envCtx.unk_E1 = 1; + globalCtx->envCtx.unk_E2[0] = 0xAA; + globalCtx->envCtx.unk_E2[1] = 0xA0; + globalCtx->envCtx.unk_E2[2] = 0x96; + if (globalCtx->sceneLoadFlag != -0x14) { + globalCtx->envCtx.unk_E2[3] = 0; + globalCtx->unk_1241B = 5; + } else { + globalCtx->envCtx.unk_E2[3] = 0xFF; + globalCtx->unk_1241B = 6; + } + break; + + case 10: + if (0) {} // Improves codegen + if (globalCtx->sceneLoadFlag != -0x14) { + globalCtx->state.running = 0; + SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext); + gSaveContext.entranceIndex = globalCtx->nextEntranceIndex; + globalCtx->sceneLoadFlag = 0; + globalCtx->unk_1241B = 0; + } else { + D_80161490 = 0; + R_UPDATE_RATE = 3; + globalCtx->sceneLoadFlag = 0; + globalCtx->unk_1241B = 0; + } + break; + + case 11: + if (gSaveContext.unk_1410 != 0) { + globalCtx->unk_1241B = 3; + } + break; + + case 12: + if (globalCtx->sceneLoadFlag != -0x14) { + globalCtx->envCtx.unk_E6 = 1; + globalCtx->unk_1241B = 13; + } else { + globalCtx->envCtx.unk_E6 = 2; + globalCtx->envCtx.unk_E7 = 0xFF; + globalCtx->envCtx.unk_E8 = 0xFF; + globalCtx->unk_1241B = 13; + } + break; + + case 13: + Audio_PlaySoundGeneral(0x20C0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + if (globalCtx->sceneLoadFlag == -0x14) { + if (globalCtx->envCtx.unk_E7 < 0x6E) { + D_80161490 = 0; + R_UPDATE_RATE = 3; + globalCtx->sceneLoadFlag = 0; + globalCtx->unk_1241B = 0; + } + } else { + if (globalCtx->envCtx.unk_E8 == 0xFF) { + if (0) {} // Improves codegen + globalCtx->state.running = 0; + SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext); + gSaveContext.entranceIndex = globalCtx->nextEntranceIndex; + globalCtx->sceneLoadFlag = 0; + globalCtx->unk_1241B = 0; + } + } + break; + + case 14: + if (globalCtx->sceneLoadFlag == -0x14) { + globalCtx->envCtx.unk_E6 = 4; + globalCtx->envCtx.unk_E7 = 0xFF; + globalCtx->envCtx.unk_E8 = 0xFF; + LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!", "../z_play.c", 3471); // "It's here!!!!!!!!!" + globalCtx->unk_1241B = 15; + } else { + globalCtx->unk_1241B = 12; + } + break; + + case 15: + Audio_PlaySoundGeneral(0x20C0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + if (globalCtx->sceneLoadFlag == -0x14) { + if (globalCtx->envCtx.unk_E7 <= 0) { + D_80161490 = 0; + R_UPDATE_RATE = 3; + globalCtx->sceneLoadFlag = 0; + globalCtx->unk_1241B = 0; + } + } + break; + + case 16: + D_801614C8 = 0; + globalCtx->envCtx.unk_E1 = 1; + globalCtx->envCtx.unk_E2[0] = 0; + globalCtx->envCtx.unk_E2[1] = 0; + globalCtx->envCtx.unk_E2[2] = 0; + globalCtx->envCtx.unk_E2[3] = 0xFF; + globalCtx->unk_1241B = 17; + break; + + case 17: + if (gSaveContext.unk_1410 != 0) { + globalCtx->envCtx.unk_E2[3] = gSaveContext.unk_1410; + if (gSaveContext.unk_1410 < 0x65) { + D_80161490 = 0; + R_UPDATE_RATE = 3; + globalCtx->sceneLoadFlag = 0; + globalCtx->unk_1241B = 0; + } + } + break; + } + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3533); + } + + temp = HREG(63); + if (1 && (D_80161490 != 3)) { + if (1 && temp) { + LOG_NUM("1", 1, "../z_play.c", 3542); + } + + if ((gSaveContext.gameMode == 0) && (globalCtx->msgCtx.msgMode == 0) && (globalCtx->unk_10A20 == 0)) { + func_8006EA30(globalCtx); + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3551); + } + + sp80 = (globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3555); + } + + SkelAnime_AnimationCtxReset(&globalCtx->animationCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3561); + } + + Object_UpdateBank(&globalCtx->objectCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3577); + } + + if ((sp80 == 0) && (IREG(72) == 0)) { + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3580); + } + + globalCtx->gameplayFrames++; + + func_800AA178(1); + + if ((globalCtx->actorCtx.unk_00 != 0) && (globalCtx->actorCtx.unk_00-- < 5)) { + osSyncPrintf("FINISH=%d\n", globalCtx->actorCtx.unk_00); + if ((globalCtx->actorCtx.unk_00 > 0) && ((globalCtx->actorCtx.unk_00 % 2) != 0)) { + globalCtx->envCtx.unk_E1 = 1; + globalCtx->envCtx.unk_E2[0] = globalCtx->envCtx.unk_E2[1] = globalCtx->envCtx.unk_E2[2] = 0x96; + globalCtx->envCtx.unk_E2[3] = 0x50; + } else { + globalCtx->envCtx.unk_E1 = 0; + } + } else { + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3606); + } + + func_800973FC(globalCtx, &globalCtx->roomCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3612); + } + + func_8006139C(globalCtx, &globalCtx->sub_11E60); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3618); + } + + func_80061C98(globalCtx, &globalCtx->sub_11E60); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3624); + } + + func_800622E4(globalCtx, &globalCtx->sub_11E60); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3631); + } + + func_8005D40C(globalCtx, &globalCtx->sub_11E60); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3637); + } + + if (globalCtx->unk_11DE9 == 0) { + Actor_UpdateAll(globalCtx, &globalCtx->actorCtx); + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3643); + } + + func_80064558(globalCtx, &globalCtx->csCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3648); + } + + func_800645A0(globalCtx, &globalCtx->csCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3651); + } + + func_80026F70(globalCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3657); + } + + Effect_SS_UpdateAllParticles(globalCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3662); + } + } + } else { + func_800AA178(0); + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3672); + } + + func_80095AA0(globalCtx, &globalCtx->roomCtx.curRoom, &input[1], 0); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3675); + } + + func_80095AA0(globalCtx, &globalCtx->roomCtx.prevRoom, &input[1], 1); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3677); + } + + if (globalCtx->unk_1242B != 0) { + if (!~(input[0].press.in.button | ~8)) { + if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) { + // Translates to: "Changing viewpoint is prohibited due to the kaleidoscope" + osSyncPrintf(VT_FGCOL(CYAN) "カレイドスコープ中につき視点変更を禁止しております\n" VT_RST); + } else if (func_8008E988(globalCtx)) { + // Translates to: "Changing viewpoint is prohibited during the cutscene" + osSyncPrintf(VT_FGCOL(CYAN) "デモ中につき視点変更を禁止しております\n" VT_RST); + } else if (YREG(15) == 0x10) { + Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + } else { + func_800BC490(globalCtx, globalCtx->unk_1242B ^ 3); + } + } + func_800BC450(globalCtx); + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3708); + } + + func_800B1744(&globalCtx->skyboxCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3716); + } + + if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) { + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3721); + } + + KaleidoScopeCall_Update(globalCtx); + } else if (globalCtx->unk_10A20 != 0) { + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3727); + } + + func_801104C8(globalCtx); + } else { + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3733); + } + + func_8010F6F0(globalCtx); + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3737); + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3742); + } + + Interface_Update(globalCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3765); + } + + func_800A390C(globalCtx, &globalCtx->animationCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3771); + } + + func_8006BA30(globalCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3777); + } + + func_800B39B8(R_UPDATE_RATE); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3783); + } + + func_800B3568(&globalCtx->sub_1241C, R_UPDATE_RATE); + } + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3799); + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3801); + } + + if ((sp80 == 0) || (D_8011D394 != 0)) { + s32 i; // 0x54 + s32 camIdx; + Vec3s sp48; + + globalCtx->nextCamera = globalCtx->activeCamera; + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3806); + } + + for (i = 0, camIdx = globalCtx->nextCamera; i < 4; i++) { + if ((i != camIdx) && (globalCtx->cameraPtrs[i] != NULL)) { + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3809); + } + + func_800591EC(&sp48, globalCtx->cameraPtrs[i]); + camIdx = globalCtx->nextCamera; + } + } + + func_800591EC(&sp48, globalCtx->cameraPtrs[camIdx]); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3814); + } + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 3816); + } + + func_80070C24(globalCtx, &globalCtx->envCtx, &globalCtx->lightCtx, &globalCtx->pauseCtx, &globalCtx->msgCtx, + &globalCtx->unk_10A20, globalCtx->state.gfxCtx); } +#else +#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Gameplay_Update.s") +#endif +void Gameplay_DrawOverlayElements(GlobalContext* globalCtx) { + if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) { + KaleidoScopeCall_Draw(globalCtx); + } + + if (gSaveContext.gameMode == 0) { + Interface_Draw(globalCtx); + } + + func_8010F58C(globalCtx); + + if (globalCtx->unk_10A20 != 0) { + func_80110460(globalCtx); + } +} + +#ifdef NON_MATCHING +// regalloc, stakc usage and minor ordering differences +void Gameplay_Draw(GlobalContext* globalCtx) { + LightMapper* sp228; + Vec3f sp21C; + GraphicsContext* gfxCtx; + Gfx* dispRefs[4]; // 0x208 + + gfxCtx = globalCtx->state.gfxCtx; + Graph_OpenDisps(dispRefs, gfxCtx, "../z_play.c", 3907); + + gSegments[4] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); + gSegments[5] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); + gSegments[2] = PHYSICAL_TO_VIRTUAL(globalCtx->sceneSegment); + + gSPSegment(gfxCtx->polyOpa.p++, 0x00, NULL); + gSPSegment(gfxCtx->polyXlu.p++, 0x00, NULL); + gSPSegment(gfxCtx->overlay.p++, 0x00, NULL); + + gSPSegment(gfxCtx->polyOpa.p++, 0x04, globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); + gSPSegment(gfxCtx->polyXlu.p++, 0x04, globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); + gSPSegment(gfxCtx->overlay.p++, 0x04, globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment); + + gSPSegment(gfxCtx->polyOpa.p++, 0x05, globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); + gSPSegment(gfxCtx->polyXlu.p++, 0x05, globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); + gSPSegment(gfxCtx->overlay.p++, 0x05, globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); + + gSPSegment(gfxCtx->polyOpa.p++, 0x02, globalCtx->sceneSegment); + gSPSegment(gfxCtx->polyXlu.p++, 0x02, globalCtx->sceneSegment); + gSPSegment(gfxCtx->overlay.p++, 0x02, globalCtx->sceneSegment); + + func_80095248(gfxCtx, 0, 0, 0); + + if ((HREG(80) != 10) || (HREG(82) != 0)) { + gfxCtx->polyOpa.p = func_800BC8A0(globalCtx, gfxCtx->polyOpa.p); + gfxCtx->polyXlu.p = func_800BC8A0(globalCtx, gfxCtx->polyXlu.p); + + func_800AA460(&globalCtx->view, globalCtx->view.fovy, globalCtx->view.near, globalCtx->lightCtx.unk_0C); + func_800AAA50(&globalCtx->view, 15); + + Matrix_MtxToMtxF(&globalCtx->view.viewing, &globalCtx->mf_11DA0); + Matrix_MtxToMtxF(&globalCtx->view.projection, &globalCtx->mf_11D60); + Matrix_Mult(&globalCtx->mf_11D60, MTXMODE_NEW); + Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY); + Matrix_Get(&globalCtx->mf_11D60); + globalCtx->mf_11DA0.mf[3][2] = 0.0f; + globalCtx->mf_11DA0.mf[3][1] = 0.0f; + globalCtx->mf_11DA0.mf[3][0] = 0.0f; + globalCtx->mf_11DA0.mf[2][3] = 0.0f; + globalCtx->mf_11DA0.mf[1][3] = 0.0f; + globalCtx->mf_11DA0.mf[0][3] = 0.0f; + Matrix_Reverse(&globalCtx->mf_11DA0); + globalCtx->unk_11DE0 = Matrix_MtxFToMtx(Matrix_CheckFloats(&globalCtx->mf_11DA0, "../z_play.c", 4005), + Graph_Alloc(gfxCtx, sizeof(Mtx))); + + gSPSegment(gfxCtx->polyOpa.p++, 0x01, globalCtx->unk_11DE0); + + if ((HREG(80) != 10) || (HREG(92) != 0)) { + Gfx* sp1CC = gfxCtx->polyOpa.p; + Gfx* sp1D0 = Graph_GfxPlusOne(gfxCtx->polyOpa.p); + gSPDisplayList(gfxCtx->overlay.p++, sp1D0); + + if ((globalCtx->unk_1241B == 3) || (globalCtx->unk_1241B == 11) || + (globalCtx->transitionCtx.unk_228 >= 56)) { + View view; // 0xA0 + Viewport viewport; // 0x90 + + View_Init(&view, gfxCtx); + view.flags = 2 | 8; + + // clang-format off + viewport.bottomY = SCREEN_HEIGHT; viewport.rightX = SCREEN_WIDTH; + viewport.topY = 0; viewport.leftX = 0; + // clang-format on + + View_SetViewport(&view, &viewport); + func_800AB9EC(&view, 15, &sp1D0); + globalCtx->transitionCtx.unk_238(&globalCtx->transitionCtx, &sp1D0); + } + + func_800B3718(&globalCtx->sub_1241C, &sp1D0); + + if (D_801614B0.a > 0x00) { + D_80161498.color.rgba = D_801614B0.rgba; + func_800AD5C0(&D_80161498, &sp1D0); + } + + gSPEndDisplayList(sp1D0++); + Graph_BranchDlist(sp1CC, sp1D0); + gfxCtx->polyOpa.p = sp1D0; + } + + if (D_80161490 == 3) { + Gfx* sp88 = gfxCtx->polyOpa.p; + func_800B2188(&D_801613B0, &sp88); + gfxCtx->polyOpa.p = sp88; + goto Gameplay_Draw_DrawOverlayElements; + } else { + func_800C0ED8(&globalCtx->preRenderCtx, 0x140, 0xF0, gfxCtx->curFrameBuffer, gZBuffer); + + if (R_PAUSE_MENU_MODE == 2) { + MsgEvent_SendNullTask(); + func_800C3770(&globalCtx->preRenderCtx); + R_PAUSE_MENU_MODE = 3; + } else if (R_PAUSE_MENU_MODE >= 4) { + R_PAUSE_MENU_MODE = 0; + } + + if (R_PAUSE_MENU_MODE == 3) { + Gfx* sp84 = gfxCtx->polyOpa.p; + func_800C24BC(&globalCtx->preRenderCtx, &sp84); + gfxCtx->polyOpa.p = sp84; + goto Gameplay_Draw_DrawOverlayElements; + } else { + s32 sp80; + if ((HREG(80) != 10) || (HREG(83) != 0)) { + if (globalCtx->skyboxId != 0) { + s32 skyboxId = globalCtx->skyboxId; + if ((globalCtx->skyboxId != 0x1D) && !globalCtx->envCtx.skyDisabled) { + if ((globalCtx->skyboxId == 1) || (skyboxId == 5)) { + func_8006FC88(globalCtx->skyboxId, &globalCtx->envCtx, &globalCtx->skyboxCtx); + func_800B10C4(&globalCtx->skyboxCtx, gfxCtx, globalCtx->skyboxId, + globalCtx->envCtx.unk_13, globalCtx->view.eye.x, globalCtx->view.eye.y, + globalCtx->view.eye.z); + } else if (globalCtx->skyboxCtx.unk_140 == 0) { + func_800B10C4(&globalCtx->skyboxCtx, gfxCtx, skyboxId, 0, globalCtx->view.eye.x, + globalCtx->view.eye.y, globalCtx->view.eye.z); + } + } + } + } + + if ((HREG(80) != 10) || (HREG(90) & 2)) { + if (!globalCtx->envCtx.sunMoonDisabled) { + func_800730DC(globalCtx); + } + } + + if ((HREG(80) != 10) || (HREG(90) & 1)) { + func_80074D6C(globalCtx); + } + + if ((HREG(80) != 10) || (HREG(90) & 4)) { + func_800750C0(globalCtx); + func_8007542C(globalCtx, 0); + } + + if ((HREG(80) != 10) || (HREG(90) & 8)) { + sp228 = Lights_CreateMapper(&globalCtx->lightCtx, gfxCtx); + func_8007A474(sp228, globalCtx->lightCtx.lightsHead, 0); + func_80079EFC(sp228, gfxCtx); + } + + if ((HREG(80) != 10) || (HREG(84) != 0)) { + if (VREG(94) == 0) { + if (HREG(80) != 10) { + sp80 = 3; + } else { + sp80 = HREG(84); + } + Scene_Draw(globalCtx); + Room_Draw(globalCtx, &globalCtx->roomCtx.curRoom, sp80 & 3); + Room_Draw(globalCtx, &globalCtx->roomCtx.prevRoom, sp80 & 3); + } + } + + if ((HREG(80) != 10) || (HREG(83) != 0)) { + if (globalCtx->skyboxCtx.unk_140 != 0) { + if (globalCtx->cameraPtrs[globalCtx->activeCamera]->unk_142 != 0x19) { + Vec3f sp74; + func_8005AFB4(&sp74, globalCtx->cameraPtrs[globalCtx->activeCamera]); + func_800B10C4(&globalCtx->skyboxCtx, gfxCtx, globalCtx->skyboxId, 0, + globalCtx->view.eye.x + sp74.x, globalCtx->view.eye.y + sp74.y, + globalCtx->view.eye.z + sp74.z); + } + } + } + + if (globalCtx->envCtx.unk_EE[1] != 0) { + func_80074704(globalCtx, &globalCtx->view, gfxCtx); + } + + if ((HREG(80) != 10) || (HREG(84) != 0)) { + func_8007672C(gfxCtx, 0, 0, 0, globalCtx->unk_11E18, 1); + } + + if ((HREG(80) != 10) || (HREG(85) != 0)) { + func_800315AC(globalCtx, &globalCtx->actorCtx); + } + + if ((HREG(80) != 10) || (HREG(86) != 0)) { + if (!globalCtx->envCtx.sunMoonDisabled) { + sp21C.x = globalCtx->view.eye.x + globalCtx->envCtx.unk_04.x; + sp21C.y = globalCtx->view.eye.y + globalCtx->envCtx.unk_04.y; + sp21C.z = globalCtx->view.eye.z + globalCtx->envCtx.unk_04.z; + func_80073988(globalCtx, &globalCtx->envCtx, &globalCtx->view, gfxCtx, sp21C, 0); + } + func_80075E68(globalCtx); + } + + if ((HREG(80) != 10) || (HREG(87) != 0)) { + if (MREG(64) != 0) { + func_8007672C(gfxCtx, MREG(65), MREG(66), MREG(67), MREG(68), 3); + } + + if (globalCtx->envCtx.unk_E1) {} // Necessary to match + + if (globalCtx->envCtx.unk_E1 == 1) { + func_8007672C(gfxCtx, globalCtx->envCtx.unk_E2[0], globalCtx->envCtx.unk_E2[1], + globalCtx->envCtx.unk_E2[2], globalCtx->envCtx.unk_E2[3], 3); + } else { + // Also necessary to match + } + } + + if ((HREG(80) != 10) || (HREG(88) != 0)) { + if (globalCtx->envCtx.unk_E6 != 0) { + func_80076934(globalCtx); + } + } + + if ((HREG(80) != 10) || (HREG(93) != 0)) { + DebugDisplay_DrawObjects(globalCtx); + } + + if ((R_PAUSE_MENU_MODE == 1) || (D_80161490 == 1)) { + Gfx* sp70 = gfxCtx->overlay.p; + globalCtx->preRenderCtx.unk_10 = gfxCtx->curFrameBuffer; + globalCtx->preRenderCtx.unk_14 = gZBuffer; + func_800C1F20(&globalCtx->preRenderCtx, &sp70); + if (R_PAUSE_MENU_MODE == 1) { + globalCtx->preRenderCtx.unk_18 = gfxCtx->curFrameBuffer; + func_800C20B4(&globalCtx->preRenderCtx, &sp70); + R_PAUSE_MENU_MODE = 2; + } else { + D_80161490 = 2; + } + gfxCtx->overlay.p = sp70; + globalCtx->preRenderCtx.unk_A3 = 2; + SREG(33) |= 1; + } else { + Gameplay_Draw_DrawOverlayElements: + if ((HREG(80) != 10) || (HREG(89) != 0)) { + Gameplay_DrawOverlayElements(globalCtx); + } + } + } + } + } + + if (globalCtx->view.unk_124 != 0) { + Vec3s sp50; + func_800591EC(&sp50, globalCtx->cameraPtrs[globalCtx->activeCamera]); + func_800AB944(&globalCtx->view); + globalCtx->view.unk_124 = 0; + if ((globalCtx->skyboxId != 0) && (globalCtx->skyboxId != 0x1D) && !globalCtx->envCtx.skyDisabled) { + func_800B1030(&globalCtx->skyboxCtx, globalCtx->view.eye.x, globalCtx->view.eye.y, globalCtx->view.eye.z); + } + } + + func_80059EC8(globalCtx->cameraPtrs[globalCtx->activeCamera]); + + Graph_CloseDisps(dispRefs, gfxCtx, "../z_play.c", 4508); +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Gameplay_Draw.s") +#endif + +void Gameplay_Main(GlobalContext* globalCtx) { + D_8012D1F8 = &globalCtx->state.input[0]; + + DebugDisplay_Init(); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 4556); + } + + if ((HREG(80) == 10) && (HREG(94) != 10)) { + HREG(81) = 1; + HREG(82) = 1; + HREG(83) = 1; + HREG(84) = 3; + HREG(85) = 1; + HREG(86) = 1; + HREG(87) = 1; + HREG(88) = 1; + HREG(89) = 1; + HREG(90) = 15; + HREG(91) = 1; + HREG(92) = 1; + HREG(93) = 1; + HREG(94) = 10; + } + + if ((HREG(80) != 10) || (HREG(81) != 0)) { + Gameplay_Update(globalCtx); + } + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 4583) + } + + Gameplay_Draw(globalCtx); + + if (1 && HREG(63)) { + LOG_NUM("1", 1, "../z_play.c", 4587); + } +} + +// original name: "Game_play_demo_mode_check" +s32 Gameplay_InCsMode(GlobalContext* globalCtx) { + return (globalCtx->csCtx.state != 0) || func_8008E988(globalCtx); +} + +#ifdef NON_MATCHING +// saved register usage differences and possibly stack usage or regalloc differences +f32 func_800BFCB8(GlobalContext* globalCtx, MtxF* mf, Vec3f* vec) { + PosRot sp50; + f32 temp_f0; + f32 phi_f12; + f32 phi_f16; + f32 sp40; + f32 sp3C; + f32 sp38; + f32 sp34; + + sp40 = func_8003CB30(globalCtx, &globalCtx->colCtx, &sp50, mf); + + if (sp40 > -32000.0f) { + sp3C = sp50.rot.x * (1.0f / 32767.0f); + sp38 = sp50.rot.y * (1.0f / 32767.0f); + sp34 = sp50.rot.z * (1.0f / 32767.0f); + + temp_f0 = sqrtf(1.0f - SQ(sp3C)); + + if (temp_f0 != 0.0f) { + phi_f12 = sp38 * temp_f0; + phi_f16 = -sp34 * temp_f0; + } else { + phi_f12 = 0.0f; + phi_f16 = 0.0f; + } + + mf->xx = temp_f0; + mf->xy = -sp3C * phi_f12; + mf->xz = sp3C * phi_f16; + mf->yx = sp3C; + mf->yy = sp38; + mf->zy = phi_f16; + mf->zz = phi_f12; + mf->xw = 0.0f; + mf->yw = 0.0f; + mf->zx = 0.0f; + mf->zw = 0.0f; + mf->yz = sp34; + mf->wx = vec->x; + mf->wy = sp40; + mf->wz = vec->z; + mf->ww = 1.0f; + } else { + mf->yx = 0.0f; + mf->xz = 0.0f; + mf->xy = 0.0f; + mf->xx = 0.0f; + mf->zw = 0.0f; + mf->zx = 0.0f; + mf->yw = 0.0f; + mf->xw = 0.0f; + mf->zz = 0.0f; + mf->zy = 0.0f; + mf->yz = 0.0f; + mf->yy = 1.0f; + mf->wx = vec->x; + mf->wy = vec->y; + mf->wz = vec->z; + mf->ww = 1.0f; + } + + return sp40; +} +#else #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFCB8.s") +#endif + +void* Gameplay_LoadFile(GlobalContext* globalCtx, RomFile* file) { + u32 size; + void* allocp; + + size = file->vromEnd - file->vromStart; + allocp = Game_Alloc(&globalCtx->state, size, "../z_play.c", 4692); + DmaMgr_SendRequest1(allocp, file->vromStart, size, "../z_play.c", 4694); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFE5C.s") + return allocp; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFEC4.s") +void Gameplay_InitSkybox(GlobalContext* globalCtx, s16 skyboxId) { + func_800B0E50(globalCtx, &globalCtx->skyboxCtx, skyboxId); + func_8006F140(globalCtx, &globalCtx->envCtx, 0); +} -void func_800BFF0C(GlobalContext* globalCtx, s32 a1) { - globalCtx->curSpawn = a1; +void Gameplay_InitScene(GlobalContext* globalCtx, s32 spawn) { + globalCtx->curSpawn = spawn; globalCtx->linkActorEntry = NULL; globalCtx->unk_11DFC = NULL; globalCtx->setupEntranceList = NULL; @@ -64,91 +1469,386 @@ void func_800BFF0C(GlobalContext* globalCtx, s32 a1) { Object_InitBank(globalCtx, &globalCtx->objectCtx); func_8007A614(globalCtx, &globalCtx->lightCtx); func_80098CBC(globalCtx, &globalCtx->nbTransitionActors); - func_80096FD4(globalCtx, &globalCtx->roomCtx); + func_80096FD4(globalCtx, &globalCtx->roomCtx.curRoom); YREG(15) = 0; - gSaveContext.world_map_area = 0; - Scene_ExecuteCommands(globalCtx, globalCtx->unk_B0); - func_800BFEC4(globalCtx, globalCtx->skyboxId); + gSaveContext.worldMapArea = 0; + Scene_ExecuteCommands(globalCtx, globalCtx->sceneSegment); + Gameplay_InitSkybox(globalCtx, globalCtx->skyboxId); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Area_Spawn.s") +void Gameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s32 spawn) { + Scene* scene = &gSceneTable[sceneNum]; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C016C.s") + scene->unk_13 = 0; + globalCtx->loadedScene = scene; + globalCtx->sceneNum = sceneNum; + globalCtx->sceneConfig = scene->config; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0230.s") + osSyncPrintf("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) * 0.0009765625f); -s16 func_800C030C(GlobalContext* globalCtx) { - return globalCtx->cameraCtx.unk_5C0; + globalCtx->sceneSegment = Gameplay_LoadFile(globalCtx, &scene->sceneFile); + scene->unk_13 = 0; + if (globalCtx->sceneSegment == NULL) { + __assert("this->sceneSegment != NULL", "../z_play.c", 4960); + } + gSegments[2] = PHYSICAL_TO_VIRTUAL(globalCtx->sceneSegment); + + Gameplay_InitScene(globalCtx, spawn); + + osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(globalCtx, &globalCtx->roomCtx) * 0.0009765625f); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0314.s") +void func_800C016C(GlobalContext* globalCtx, Vec3f* src, Vec3f* dest) { + f32 temp; + + Matrix_Mult(&globalCtx->mf_11D60, MTXMODE_NEW); + Matrix_MultVec3f(src, dest); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0384.s") + temp = globalCtx->mf_11D60.ww + + (globalCtx->mf_11D60.xw * src->x + globalCtx->mf_11D60.yw * src->y + globalCtx->mf_11D60.zw * src->z); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0438.s") + dest->x = 160.0f + ((dest->x / temp) * 160.0f); + dest->y = 120.0f - ((dest->y / temp) * 120.0f); +} + +s16 Gameplay_CreateSubCamera(GlobalContext* globalCtx) { + s16 i; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C04A4.s") + for (i = 1; i < 4; i++) { + if (globalCtx->cameraPtrs[i] == NULL) { + break; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C04D8.s") + if (i == 4) { + osSyncPrintf(VT_COL(RED, WHITE) "camera control: error: fulled sub camera system area\n" VT_RST); + return -1; + } + + osSyncPrintf("camera control: " VT_BGCOL(CYAN) " " VT_COL(WHITE, BLUE) " create new sub camera [%d] " VT_BGCOL( + CYAN) " " VT_RST "\n", + i); + + globalCtx->cameraPtrs[i] = &globalCtx->cameras[i]; + func_80057C6C(globalCtx->cameraPtrs[i], &globalCtx->view, &globalCtx->colCtx, globalCtx); + globalCtx->cameraPtrs[i]->unk_164 = i; + + return i; +} +s16 Gameplay_GetActiveCamId(GlobalContext* globalCtx) { + return globalCtx->activeCamera; +} + +void Gameplay_ChangeCameraStatus(GlobalContext* globalCtx, s16 camId, s16 status) { + s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId; + + if (status == 7) { + globalCtx->activeCamera = camIdx; + } + + Camera_ChangeStatus(globalCtx->cameraPtrs[camIdx], status); +} + +void Gameplay_ClearCamera(GlobalContext* globalCtx, s16 camId) { + s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId; + + if (camIdx == 0) { + osSyncPrintf(VT_COL(RED, WHITE) "camera control: error: never clear camera !!\n" VT_RST); + } + + if (globalCtx->cameraPtrs[camIdx] != NULL) { + Camera_ChangeStatus(globalCtx->cameraPtrs[camIdx], 0x100); + globalCtx->cameraPtrs[camIdx] = NULL; + osSyncPrintf("camera control: " VT_BGCOL(CYAN) " " VT_COL(WHITE, BLUE) " clear sub camera [%d] " VT_BGCOL( + CYAN) " " VT_RST "\n", + camIdx); + } else { + osSyncPrintf(VT_COL(RED, WHITE) "camera control: error: camera No.%d already cleared\n" VT_RST, camIdx); + } +} + +void Gameplay_ClearAllSubCameras(GlobalContext* globalCtx) { + s16 i; + + for (i = 1; i < 4; i++) { + if (globalCtx->cameraPtrs[i] != NULL) { + Gameplay_ClearCamera(globalCtx, i); + } + } + + globalCtx->activeCamera = 0; +} + +Camera* Gameplay_GetCamera(GlobalContext* globalCtx, s16 camId) { + s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId; + + return globalCtx->cameraPtrs[camIdx]; +} + +s32 func_800C04D8(GlobalContext* globalCtx, s16 camId, Vec3f* arg2, Vec3f* arg3) { + u32 ret; + s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId; + Camera* camera; + Player* player; + + camera = globalCtx->cameraPtrs[camIdx]; + + ret = func_8005AA90(camera, 1, arg2); + ret *= 2; + ret |= func_8005AA90(camera, 2, arg3); + + if (1) {} // Necessary to match + + camera->unk_DC = func_800CB678(arg2, arg3); + + player = camera->player; + if (player != NULL) { + camera->unk_E4.x = arg2->x - player->actor.posRot.pos.x; + camera->unk_E4.y = arg2->y - player->actor.posRot.pos.y; + camera->unk_E4.z = arg2->z - player->actor.posRot.pos.z; + } else { + camera->unk_E4.x = camera->unk_E4.y = camera->unk_E4.z = 0.0f; + } + + camera->unk_100 = 0.01f; + + return ret; +} + +#ifdef NON_MATCHING +// missing an extra stack store/load instruction pair +s32 func_800C05E4(GlobalContext* globalCtx, s16 camId, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4) { + u32 ret; + s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId; + Camera* camera; + Player* player; + + camera = globalCtx->cameraPtrs[camIdx]; + + if (1) {} // Probably necessary to match + + ret = func_8005AA90(camera, 1, arg2); + ret *= 2; + ret |= func_8005AA90(camera, 2, arg3); + ret *= 2; + ret |= func_8005AA90(camera, 4, arg4); + + camera->unk_DC = func_800CB678(arg2, arg3); + + player = camera->player; + if (player != NULL) { + camera->unk_E4.x = arg2->x - player->actor.posRot.pos.x; + camera->unk_E4.y = arg2->y - player->actor.posRot.pos.y; + camera->unk_E4.z = arg2->z - player->actor.posRot.pos.z; + } else { + camera->unk_E4.x = camera->unk_E4.y = camera->unk_E4.z = 0.0f; + } + + camera->unk_100 = 0.01f; + + return ret; +} +#else #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C05E4.s") +#endif +#ifdef NON_MATCHING +// missing an extra move instruction +s32 func_800C0704(GlobalContext* globalCtx, s16 camId, f32 arg2) { + return (func_8005AA90(globalCtx->cameraPtrs[camId], 32, &arg2) & 1); +} +#else #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0704.s") +#endif + +s32 func_800C0744(GlobalContext* globalCtx, s16 camId, s16 arg2) { + s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId; + Camera* camera; + + camera = globalCtx->cameraPtrs[camIdx]; + camera->unk_15A = arg2; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0744.s") + return 1; +} + +void func_800C078C(GlobalContext* globalCtx, s16 camId1, s16 camId2) { + s16 camIdx2 = (camId2 == -1) ? globalCtx->activeCamera : camId2; + s16 camIdx1 = (camId1 == -1) ? globalCtx->activeCamera : camId1; + + func_8005AE64(globalCtx->cameraPtrs[camIdx1], globalCtx->cameraPtrs[camIdx2]); +} + +void func_800C0808(GlobalContext* globalCtx, s16 camId, s32 arg2, s16 arg3) { + Camera* camera; + s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId; + + camera = globalCtx->cameraPtrs[camIdx]; + func_80058148(camera, arg2); + func_8005A77C(camera, arg3); +} + +void func_800C0874(GlobalContext* globalCtx, s16 camId, s16 arg2) { + func_8005A77C(Gameplay_GetCamera(globalCtx, camId), arg2); +} + +void func_800C08AC(GlobalContext* globalCtx, s16 camId, s16 arg2) { + s16 camIdx = (camId == -1) ? globalCtx->activeCamera : camId; + s16 i; + + Gameplay_ClearCamera(globalCtx, camIdx); + + for (i = 1; i < 4; i++) { + if (globalCtx->cameraPtrs[i] != NULL) { + osSyncPrintf( + VT_COL(RED, WHITE) "camera control: error: return to main, other camera left. %d cleared!!\n" VT_RST, + i); + Gameplay_ClearCamera(globalCtx, i); + } + } + + if (arg2 <= 0) { + Gameplay_ChangeCameraStatus(globalCtx, 0, 7); + globalCtx->cameraPtrs[0]->unk_14E = globalCtx->cameraPtrs[0]->unk_162 = 0; + } else { + func_800800F8(globalCtx, 1020, arg2, NULL, 0); + } +} + +s16 func_800C09A4(GlobalContext* globalCtx, s16 camId) { + Camera* camera = globalCtx->cameraPtrs[camId]; + + if (camera != NULL) { + return camera->unk_130; + } else { + return -1; + } +} + +s16 func_800C09D8(GlobalContext* globalCtx, s16 camId, s16 arg2) { + Camera* camera = globalCtx->cameraPtrs[camId]; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C078C.s") + if (camera != NULL) { + return 0; + } else if (camera->unk_130 != arg2) { + return 0; + } else if (camera->unk_140 != 7) { + return 2; + } else { + return 1; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0808.s") +void Gameplay_SaveSceneFlags(GlobalContext* globalCtx) { + SaveSceneFlags* sceneFlags = &gSaveContext.sceneFlags[globalCtx->sceneNum]; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0874.s") + sceneFlags->chest = globalCtx->actorCtx.flags.chest; + sceneFlags->swch = globalCtx->actorCtx.flags.swch; + sceneFlags->clear = globalCtx->actorCtx.flags.clear; + sceneFlags->collect = globalCtx->actorCtx.flags.collect; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C08AC.s") +void Gameplay_SetRespawnData(GlobalContext* globalCtx, s32 respawnMode, s16 entranceIndex, s32 roomIndex, + s32 playerParams, Vec3f* pos, s16 yaw) { + RespawnData* respawnData = &gSaveContext.respawn[respawnMode]; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0A44.s") + respawnData->entranceIndex = entranceIndex; + respawnData->roomIndex = roomIndex; + respawnData->pos = *pos; + respawnData->yaw = yaw; + respawnData->playerParams = playerParams; + respawnData->tempSwchFlags = globalCtx->actorCtx.flags.tempSwch; + respawnData->tempCollectFlags = globalCtx->actorCtx.flags.tempCollect; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0A88.s") +void Gameplay_SetupRespawnPoint(GlobalContext* globalCtx, s32 respawnMode, s32 playerParams) { + Player* player = PLAYER; + s32 entranceIndex; + s8 roomIndex; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0AF4.s") + if ((globalCtx->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (globalCtx->sceneNum != SCENE_KAKUSIANA)) { + roomIndex = globalCtx->roomCtx.curRoom.num; + entranceIndex = gSaveContext.entranceIndex; + Gameplay_SetRespawnData(globalCtx, respawnMode, entranceIndex, roomIndex, playerParams, + &player->actor.posRot.pos, player->actor.shape.rot.y); + } +} -void func_800C0B60(GlobalContext* globalCtx) { - gSaveContext.respawn[RESPAWN_MODE_DOWN].temp_swch_flags = globalCtx->actorCtx.flags.tempSwch; - gSaveContext.respawn[RESPAWN_MODE_DOWN].temp_collect_flags = globalCtx->actorCtx.flags.tempCollect; - gSaveContext.respawn_flag = 1; +void Gameplay_TriggerVoidOut(GlobalContext* globalCtx) { + gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = globalCtx->actorCtx.flags.tempSwch; + gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = globalCtx->actorCtx.flags.tempCollect; + gSaveContext.respawnFlag = 1; globalCtx->sceneLoadFlag = 0x14; - globalCtx->nextEntranceIndex = gSaveContext.respawn[0].entrance_index; - globalCtx->fadeOutTransition = 2; + globalCtx->nextEntranceIndex = gSaveContext.respawn[0].entranceIndex; + globalCtx->fadeTransition = 2; } -void func_800C0BB4(GlobalContext* globalCtx) { - gSaveContext.respawn_flag = -1; +void Gameplay_LoadToLastEntrance(GlobalContext* globalCtx) { + gSaveContext.respawnFlag = -1; globalCtx->sceneLoadFlag = 0x14; - if (globalCtx->sceneNum == SCENE_GANON_SONOGO || globalCtx->sceneNum == SCENE_GANON_FINAL || - globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO || globalCtx->sceneNum == SCENE_GANON_DEMO) { + if ((globalCtx->sceneNum == SCENE_GANON_SONOGO) || (globalCtx->sceneNum == SCENE_GANON_FINAL) || + (globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO) || (globalCtx->sceneNum == SCENE_GANON_DEMO)) { globalCtx->nextEntranceIndex = 0x043F; Item_Give(globalCtx, ITEM_SWORD_MASTER); - } else if (gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E || - gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) { + } else if ((gSaveContext.entranceIndex == 0x028A) || (gSaveContext.entranceIndex == 0x028E) || + (gSaveContext.entranceIndex == 0x0292) || (gSaveContext.entranceIndex == 0x0476)) { globalCtx->nextEntranceIndex = 0x01F9; } else { - globalCtx->nextEntranceIndex = gSaveContext.entrance_index; + globalCtx->nextEntranceIndex = gSaveContext.entranceIndex; } - globalCtx->fadeOutTransition = 2; + globalCtx->fadeTransition = 2; } -void func_800C0C88(GlobalContext* globalCtx) { - func_800C0AF4(globalCtx, 0, 0xDFF); - func_800C0BB4(globalCtx); +void Gameplay_TriggerRespawn(GlobalContext* globalCtx) { + Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_DOWN, 0xDFF); + Gameplay_LoadToLastEntrance(globalCtx); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0CB8.s") +s32 func_800C0CB8(GlobalContext* globalCtx) { + return (globalCtx->roomCtx.curRoom.mesh->polygon.type != 1) && (YREG(15) != 0x20) && (YREG(15) != 0x30) && + (YREG(15) != 0x40) && (globalCtx->sceneNum != SCENE_HAIRAL_NIWA); +} s32 func_800C0D28(GlobalContext* globalCtx) { - return globalCtx->unk_7B8 != 0; + return (globalCtx->sub_7B8.unk_0 != 0); } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0D34.s") +s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) { + TransitionActorEntry* transitionActor; + + if (actor->type != ACTORTYPE_DOOR) { + return 0; + } + + transitionActor = &globalCtx->transitionActorList[(u16)actor->params >> 10]; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0DB4.s") + if (transitionActor->backRoom == transitionActor->frontRoom) { + return 0; + } + + if (actor->room == transitionActor->frontRoom) { + *yaw = actor->shape.rot.y; + } else { + *yaw = actor->shape.rot.y + 0x8000; + } + + return 1; +} + +s32 func_800C0DB4(GlobalContext* globalCtx, Vec3f* arg1) { + UNK_TYPE sp3C; + CollisionPoly* sp38; + Vec3f sp2C; + s32 sp28; + + sp2C = *arg1; + + if ((func_8004213C(globalCtx, &globalCtx->colCtx, sp2C.x, sp2C.z, &sp2C.y, &sp3C) == 1) && (arg1->y < sp2C.y) && + (func_8003C940(&globalCtx->colCtx, &sp38, &sp28, &sp2C) != -32000.0f)) { + return 1; + } else { + return 0; + } +} diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 4ddb530fe..dc2aef74e 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -3,22 +3,22 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008E750.s") -UNK_TYPE func_8008E8DC(GlobalContext* globalCtx, Player* player) { +s32 func_8008E8DC(GlobalContext* globalCtx, Player* player) { return (player->stateFlags1 & 0x20000080 || player->action || globalCtx->sceneLoadFlag == 0x14 || player->stateFlags1 & 1 || player->unk_692 & 0x80 || - gSaveContext.unk_13F0 && func_8008F0D8(player, player->unk_154) >= 0); + (gSaveContext.unk_13F0 && func_8008F0D8(player, player->unk_154) >= 0)); } -UNK_TYPE func_8008E988(GlobalContext* globalCtx) { +s32 func_8008E988(GlobalContext* globalCtx) { Player* player = PLAYER; return func_8008E8DC(globalCtx, player) || player->unk_6AD == 4; } -UNK_TYPE func_8008E9C4(Player* player) { +s32 func_8008E9C4(Player* player) { return player->stateFlags1 & 0x10; } -UNK_TYPE func_8008E9D0(Player* player) { +s32 func_8008E9D0(Player* player) { return LINK_IS_CHILD && player->currentShield == 2; } @@ -38,7 +38,7 @@ void func_8008EC70(Player* player) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008ECAC.s") -void func_8008ED9C(GlobalContext* globalCtx, Player* player, UNK_TYPE item, UNK_TYPE arg2) { +void func_8008ED9C(GlobalContext* globalCtx, Player* player, s32 item, s32 arg2) { Inventory_UpdateBottleItem(globalCtx, item, player->unk_150); if (item != ITEM_BOTTLE) { player->unk_152 = item; @@ -56,7 +56,7 @@ void func_8008EDF0(Player* player) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008EEAC.s") -UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1) { +s32 func_8008EF44(GlobalContext* globalCtx, s32 arg1) { globalCtx->unk_11E5C = (arg1 + 1); return 1; } @@ -75,17 +75,17 @@ void func_8008F08C(GlobalContext* globalCtx) { player->currentMask = 0; } -UNK_TYPE func_8008F098(GlobalContext* globalCtx) { +s32 func_8008F098(GlobalContext* globalCtx) { Player* player = PLAYER; return player->currentShield == 3; } -UNK_TYPE func_8008F0AC(GlobalContext* globalCtx) { +s32 func_8008F0AC(GlobalContext* globalCtx) { Player* player = PLAYER; return player->unk_15D == 0xa && player->currentShield == 3; } -s32 func_8008F0D8(Player* player, UNK_TYPE arg1) { +s32 func_8008F0D8(Player* player, s32 arg1) { s32 temp_v0 = arg1 - 0x15; if (temp_v0 >= 0 && temp_v0 < 6) { return temp_v0; @@ -93,15 +93,15 @@ s32 func_8008F0D8(Player* player, UNK_TYPE arg1) { return -1; } -UNK_TYPE func_8008F104(Player* player) { +s32 func_8008F104(Player* player) { return player->unk_151 == 0x10 || player->unk_151 == 0x11; } -UNK_TYPE func_8008F128(Player* player) { +s32 func_8008F128(Player* player) { return func_8008F104(player) && player->heldActor == NULL; } -s32 func_8008F158(UNK_TYPE arg0) { +s32 func_8008F158(s32 arg0) { s32 temp_v0 = arg0 - 2; if (temp_v0 > 0 && temp_v0 < 6) { return temp_v0; @@ -113,7 +113,7 @@ void func_8008F180(Player* player) { func_8008F158(player->unk_151); } -UNK_TYPE func_8008F1A0(Player* player) { +s32 func_8008F1A0(Player* player) { if (player->unk_151 >= 5 && player->unk_151 < 8) { return 1; } @@ -122,7 +122,7 @@ UNK_TYPE func_8008F1A0(Player* player) { #pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008F1CC.s") -s32 func_8008F224(Player* player, UNK_TYPE arg1) { +s32 func_8008F224(Player* player, s32 arg1) { s32 temp_v0 = arg1 - 0x1E; if (temp_v0 >= 0 && temp_v0 < 0xD) { return temp_v0; @@ -134,7 +134,7 @@ void func_8008F250(Player* player) { func_8008F224(player, player->unk_151); } -s32 func_8008F270(Player* player, UNK_TYPE arg1) { +s32 func_8008F270(Player* player, s32 arg1) { s32 temp_v0 = arg1 - 0x12; if (temp_v0 >= 0 && temp_v0 < 2) { return temp_v0; diff --git a/src/code/z_quake.c b/src/code/z_quake.c index 78c05be34..da0cf92a2 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -144,7 +144,7 @@ s16 Quake_GetFreeIndex() { QuakeRequest* Quake_AddImpl(Camera* cam, u32 callbackIdx) { s16 idx = Quake_GetFreeIndex(); - QuakeRequest* req = sQuakeRequest + idx; + QuakeRequest* req = &sQuakeRequest[idx]; func_80106860(req, 0, sizeof(QuakeRequest)); // memset req->cam = cam; @@ -164,7 +164,8 @@ void Quake_Remove(QuakeRequest* req) { } QuakeRequest* Quake_GetRequest(s16 idx) { - QuakeRequest* req = sQuakeRequest + (idx & 3); + QuakeRequest* req = &sQuakeRequest[idx & 3]; + if (req->callbackIdx == 0) { return NULL; } @@ -329,7 +330,7 @@ s16 Quake_Calc(Camera* camera, UnkQuakeCalcStruct* camData) { for (idx = 0; idx < ARRAY_COUNT(sQuakeRequest); idx++) { req = &sQuakeRequest[idx]; if (req->callbackIdx != 0) { - if (globalCtx->cameraCtx.activeCameraPtrs[req->camPtrIdx] == 0) { + if (globalCtx->cameraPtrs[req->camPtrIdx] == 0) { osSyncPrintf(VT_COL(YELLOW, BLACK) "quake: stopped! 'coz camera [%d] killed!!\n" VT_RST, req->camPtrIdx); Quake_Remove(req); diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index 754405655..11ae43221 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -1460,12 +1460,10 @@ void func_80095248(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) { gSPDisplayList(gfxCtx->polyOpa.p++, sFillSetupDL); gSPDisplayList(gfxCtx->polyXlu.p++, sFillSetupDL); gSPDisplayList(gfxCtx->overlay.p++, sFillSetupDL); - gDPSetScissorFrac(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, 0, 0, (s32)gScreenWidth * 4.0f, - (s32)gScreenHeight * 4.0f); - gDPSetScissorFrac(gfxCtx->polyXlu.p++, G_SC_NON_INTERLACE, 0, 0, (s32)gScreenWidth * 4.0f, - (s32)gScreenHeight * 4.0f); - gDPSetScissorFrac(gfxCtx->overlay.p++, G_SC_NON_INTERLACE, 0, 0, (s32)gScreenWidth * 4.0f, - (s32)gScreenHeight * 4.0f); + + gDPSetScissorFrac(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, 0, 0, gScreenWidth * 4.0f, gScreenHeight * 4.0f); + gDPSetScissorFrac(gfxCtx->polyXlu.p++, G_SC_NON_INTERLACE, 0, 0, gScreenWidth * 4.0f, gScreenHeight * 4.0f); + gDPSetScissorFrac(gfxCtx->overlay.p++, G_SC_NON_INTERLACE, 0, 0, gScreenWidth * 4.0f, gScreenHeight * 4.0f); gDPSetColorImage(gfxCtx->polyOpa.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gScreenWidth, gfxCtx->curFrameBuffer); gDPSetColorImage(gfxCtx->polyOpa.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gScreenWidth, gfxCtx->curFrameBuffer); @@ -1554,8 +1552,7 @@ void func_80095974(GraphicsContext* gfxCtx) { Graph_OpenDisps(dispRefs, gfxCtx, "../z_rcp.c", 2503); gSPDisplayList(gfxCtx->polyOpa.p++, sFillSetupDL); - gDPSetScissorFrac(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, 0, 0, (s32)gScreenWidth * 4.0f, - (s32)gScreenHeight * 4.0f); + gDPSetScissorFrac(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, 0, 0, gScreenWidth * 4.0f, gScreenHeight * 4.0f); gDPSetDepthImage(gfxCtx->polyOpa.p++, gZBuffer); gDPSetColorImage(gfxCtx->polyOpa.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gScreenWidth, gfxCtx->curFrameBuffer); diff --git a/src/code/z_room.c b/src/code/z_room.c index 442dee0ac..600f4e014 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -29,7 +29,7 @@ void (*sRoomDrawHandlers[])(GlobalContext* globalCtx, Room* room, u32 flags) = { func_80095D04, }; -void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3) { +void func_80095AA0(GlobalContext* globalCtx, Room* room, Input* arg2, UNK_TYPE arg3) { } // Room Draw Polygon Type 0 @@ -343,7 +343,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_room.c", 628); - camera = globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]; + camera = globalCtx->cameraPtrs[globalCtx->activeCamera]; polygon1 = &room->mesh->polygon1; sp9C = (camera->unk_142 ^ 25) == 0; polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist); @@ -405,7 +405,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) { BgImage* bgImage; s32 i; - camera = globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]; + camera = globalCtx->cameraPtrs[globalCtx->activeCamera]; camId = camera->unk_148; camId2 = func_80041C10(&globalCtx->colCtx, camId, 50)->unk_0E; if (camId2 >= 0) { @@ -449,7 +449,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_room.c", 752); - camera = globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]; + camera = globalCtx->cameraPtrs[globalCtx->activeCamera]; sp98 = (camera->unk_142 ^ 25) == 0; polygon1 = &room->mesh->polygon1; polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist); @@ -576,8 +576,8 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) { roomCtx->unk_30 = 0; roomCtx->status = 0; - if (gSaveContext.respawn_flag > 0) { - nextRoomNum = gSaveContext.respawn[gSaveContext.respawn_flag - 1].room_index; + if (gSaveContext.respawnFlag > 0) { + nextRoomNum = gSaveContext.respawn[gSaveContext.respawnFlag - 1].roomIndex; } else { nextRoomNum = globalCtx->setupEntranceList[globalCtx->curSpawn].room; } diff --git a/src/code/z_sample.c b/src/code/z_sample.c index 38add9d42..73d502a06 100644 --- a/src/code/z_sample.c +++ b/src/code/z_sample.c @@ -2,21 +2,17 @@ #include <global.h> #include <PR/os_cont.h> -void Sample_Calc(SampleContext* this) { +void Sample_HandleStateChange(SampleContext* this) { if (!~(this->state.input[0].press.in.button | ~START_BUTTON)) { - SET_NEXT_GAMESTATE(&this->state, func_800BCA64, GlobalContext); + SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext); this->state.running = false; } } -// very close from matching, the only difference is the place of "mtx" in the stack -#ifdef NON_MATCHING void Sample_Draw(SampleContext* this) { - u32 pad; GraphicsContext* gfxCtx = this->state.gfxCtx; View* view = &this->view; - Gfx* dispRefs[4]; - Mtx* mtx; + Gfx* dispRefs[5]; Graph_OpenDisps(dispRefs, gfxCtx, "../z_sample.c", 62); @@ -25,12 +21,14 @@ void Sample_Draw(SampleContext* this) { func_80095248(gfxCtx, 0, 0, 0); - view->unk_120 = 7; + view->flags = 1 | 2 | 4; func_800AAA50(view, 15); - mtx = Graph_Alloc(gfxCtx, sizeof(Mtx)); - func_80103D58(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42)); - gSPMatrix(gfxCtx->polyOpa.p++, mtx, G_MTX_LOAD); + if (1) { + Mtx* mtx = Graph_Alloc(gfxCtx, sizeof(Mtx)); + func_80103D58(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42)); + gSPMatrix(gfxCtx->polyOpa.p++, mtx, G_MTX_LOAD); + } gfxCtx->polyOpa.p = Gfx_SetFog2(gfxCtx->polyOpa.p, 0xFF, 0xFF, 0xFF, 0, 0, 0); func_80093D18(gfxCtx); @@ -42,13 +40,10 @@ void Sample_Draw(SampleContext* this) { Graph_CloseDisps(dispRefs, gfxCtx, "../z_sample.c", 111); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/Sample_Draw.s") -#endif -void Sample_Update(SampleContext* this) { +void Sample_Main(SampleContext* this) { Sample_Draw(this); - Sample_Calc(this); + Sample_HandleStateChange(this); } void Sample_Destroy(SampleContext* this) { @@ -57,21 +52,21 @@ void Sample_Destroy(SampleContext* this) { void Sample_SetupView(SampleContext* this) { View* view; GraphicsContext* gfxCtx; - u32 v0[4]; + Viewport viewport; Vec3f v1; Vec3f v2; Vec3f v3; view = &this->view; gfxCtx = this->state.gfxCtx; - func_800AA278(view, gfxCtx); + View_Init(view, gfxCtx); // clang-format off - v0[1] = SCREEN_HEIGHT; v0[3] = SCREEN_WIDTH; - v0[0] = 0; v0[2] = 0; + viewport.bottomY = SCREEN_HEIGHT; viewport.rightX = SCREEN_WIDTH; + viewport.topY = 0; viewport.leftX = 0; // clang-format on - func_800AA4FC(view, &v0); + View_SetViewport(view, &viewport); func_800AA460(view, 60, 10, 12800); v1.x = 0; @@ -95,7 +90,7 @@ void Sample_LoadTitleStatic(SampleContext* this) { } void Sample_Init(SampleContext* this) { - this->state.main = Sample_Update; + this->state.main = Sample_Main; this->state.destroy = Sample_Destroy; R_UPDATE_RATE = 1; Sample_SetupView(this); diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 6ad51d2ee..3bf7e0dec 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -44,7 +44,7 @@ void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) { if (globalCtx2->sceneNum == SCENE_SPOT00) { spaceSize = 1024000; } else if (globalCtx2->sceneNum == SCENE_GANON_DEMO) { - if (gSaveContext.scene_setup_index != 4) { + if (gSaveContext.sceneSetupIndex != 4) { spaceSize = 1177600; } else { spaceSize = 1024000; @@ -203,9 +203,9 @@ void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd) { s32 linkAge; globalCtx->linkActorEntry = linkEntry; - globalCtx->linkAgeOnLoad = gSaveContext.link_age; + globalCtx->linkAgeOnLoad = gSaveContext.linkAge; - linkAge = gSaveContext.link_age; + linkAge = gSaveContext.linkAge; linkObjectId = gLinkObjectIds[linkAge]; gActorOverlayTable[linkEntry->id].initInfo->objectId = linkObjectId; @@ -261,7 +261,7 @@ void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd) { } if (cmd->specialFiles.cUpElfMsgNum != 0) { - globalCtx->cUpElfMsgs = func_800BFE5C(globalCtx, &sNaviMsgFiles[cmd->specialFiles.cUpElfMsgNum - 1]); + globalCtx->cUpElfMsgs = Gameplay_LoadFile(globalCtx, &sNaviMsgFiles[cmd->specialFiles.cUpElfMsgNum - 1]); } } @@ -362,21 +362,21 @@ void func_80098CBC(GlobalContext* globalCtx, u8* nbTransitionActors) { // Scene Command 0x0F: Light Setting List void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd) { - globalCtx->nbLightSettings = cmd->lightSettingList.num; - globalCtx->lightSettingsList = SEGMENTED_TO_VIRTUAL(cmd->lightSettingList.segment); + globalCtx->envCtx.nbLightSettings = cmd->lightSettingList.num; + globalCtx->envCtx.lightSettingsList = SEGMENTED_TO_VIRTUAL(cmd->lightSettingList.segment); } // Scene Command 0x11: Skybox Settings void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->skyboxId = cmd->skyboxSettings.skyboxId; - globalCtx->gloomySky = globalCtx->unk_10A3C = cmd->skyboxSettings.unk_05; - globalCtx->unk_10A42 = cmd->skyboxSettings.unk_06; + globalCtx->envCtx.gloomySky = globalCtx->envCtx.unk_18 = cmd->skyboxSettings.unk_05; + globalCtx->envCtx.unk_1E = cmd->skyboxSettings.unk_06; } // Scene Command 0x12: Skybox Disables void func_80098D5C(GlobalContext* globalCtx, SceneCmd* cmd) { - globalCtx->skyDisabled = cmd->skyboxDisables.unk_04; - globalCtx->sunMoonDisabled = cmd->skyboxDisables.unk_05; + globalCtx->envCtx.skyDisabled = cmd->skyboxDisables.unk_04; + globalCtx->envCtx.sunMoonDisabled = cmd->skyboxDisables.unk_05; } // Scene Command 0x10: Time Settings @@ -384,38 +384,38 @@ void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd) { u32 dayTime; if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) { - gSaveContext.environment_time = gSaveContext.day_time = + gSaveContext.environmentTime = gSaveContext.dayTime = ((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f; } if (cmd->timeSettings.unk_06 != 0xFF) { - globalCtx->unk_10A26 = cmd->timeSettings.unk_06; + globalCtx->envCtx.unk_02 = cmd->timeSettings.unk_06; } else { - globalCtx->unk_10A26 = 0; + globalCtx->envCtx.unk_02 = 0; } if (gSaveContext.unk_1422 == 0) { - D_8011FB40 = globalCtx->unk_10A26; + D_8011FB40 = globalCtx->envCtx.unk_02; } - dayTime = gSaveContext.day_time; - globalCtx->unk_10A28 = -(Math_Sins(dayTime - 0x8000) * 120.0f) * 25.0f; - dayTime = gSaveContext.day_time; - globalCtx->unk_10A2C = (Math_Coss(dayTime - 0x8000) * 120.0f) * 25.0f; - dayTime = gSaveContext.day_time; - globalCtx->unk_10A30 = (Math_Coss(dayTime - 0x8000) * 20.0f) * 25.0f; - - if (((globalCtx->unk_10A26 == 0) && (gSaveContext.cutscene_index < 0xFFF0)) || - (gSaveContext.entrance_index == 0x0604)) { - gSaveContext.environment_time = gSaveContext.day_time; - if ((gSaveContext.environment_time >= 0x2AAC) && (gSaveContext.environment_time < 0x4555)) { - gSaveContext.environment_time = 0x3556; - } else if ((gSaveContext.environment_time >= 0x4555) && (gSaveContext.environment_time < 0x5556)) { - gSaveContext.environment_time = 0x5556; - } else if ((gSaveContext.environment_time >= 0xAAAB) && (gSaveContext.environment_time < 0xB556)) { - gSaveContext.environment_time = 0xB556; - } else if ((gSaveContext.environment_time >= 0xC001) && (gSaveContext.environment_time < 0xCAAC)) { - gSaveContext.environment_time = 0xCAAC; + dayTime = gSaveContext.dayTime; + globalCtx->envCtx.unk_04.x = -(Math_Sins(dayTime - 0x8000) * 120.0f) * 25.0f; + dayTime = gSaveContext.dayTime; + globalCtx->envCtx.unk_04.y = (Math_Coss(dayTime - 0x8000) * 120.0f) * 25.0f; + dayTime = gSaveContext.dayTime; + globalCtx->envCtx.unk_04.z = (Math_Coss(dayTime - 0x8000) * 20.0f) * 25.0f; + + if (((globalCtx->envCtx.unk_02 == 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) || + (gSaveContext.entranceIndex == 0x0604)) { + gSaveContext.environmentTime = gSaveContext.dayTime; + if ((gSaveContext.environmentTime >= 0x2AAC) && (gSaveContext.environmentTime < 0x4555)) { + gSaveContext.environmentTime = 0x3556; + } else if ((gSaveContext.environmentTime >= 0x4555) && (gSaveContext.environmentTime < 0x5556)) { + gSaveContext.environmentTime = 0x5556; + } else if ((gSaveContext.environmentTime >= 0xAAAB) && (gSaveContext.environmentTime < 0xB556)) { + gSaveContext.environmentTime = 0xB556; + } else if ((gSaveContext.environmentTime >= 0xC001) && (gSaveContext.environmentTime < 0xCAAC)) { + gSaveContext.environmentTime = 0xCAAC; } } } @@ -426,10 +426,10 @@ void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd) { s8 temp2 = cmd->windSettings.unk_05; s8 temp3 = cmd->windSettings.unk_06; - globalCtx->unk_10ACC = temp1; - globalCtx->unk_10ACE = temp2; - globalCtx->unk_10AD0 = temp3; - globalCtx->unk_10AD4 = cmd->windSettings.unk_07; + globalCtx->envCtx.unk_A8 = temp1; + globalCtx->envCtx.unk_AA = temp2; + globalCtx->envCtx.unk_AC = temp3; + globalCtx->envCtx.unk_B0 = cmd->windSettings.unk_07; } // Scene Command 0x13: Exit List @@ -446,7 +446,7 @@ void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd) { globalCtx->soundCtx.musicSeq = cmd->soundSettings.musicSeq; globalCtx->soundCtx.nighttimeSFX = cmd->soundSettings.nighttimeSFX; - if (gSaveContext.seq_index == 0xFF) { + if (gSaveContext.seqIndex == 0xFF) { Audio_SetBGM(cmd->soundSettings.bgmId | 0xF0000000); } } @@ -463,13 +463,13 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) { SceneCmd** altHeaders; SceneCmd* altHeader; - osSyncPrintf("\n[ZU]sceneset age =[%X]", gSaveContext.link_age); - osSyncPrintf("\n[ZU]sceneset time =[%X]", gSaveContext.cutscene_index); - osSyncPrintf("\n[ZU]sceneset counter=[%X]", gSaveContext.scene_setup_index); + osSyncPrintf("\n[ZU]sceneset age =[%X]", gSaveContext.linkAge); + osSyncPrintf("\n[ZU]sceneset time =[%X]", gSaveContext.cutsceneIndex); + osSyncPrintf("\n[ZU]sceneset counter=[%X]", gSaveContext.sceneSetupIndex); - if (gSaveContext.scene_setup_index != 0) { + if (gSaveContext.sceneSetupIndex != 0) { altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment); - altHeader = altHeaders[gSaveContext.scene_setup_index - 1]; + altHeader = altHeaders[gSaveContext.sceneSetupIndex - 1]; if (altHeader != NULL) { Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader)); @@ -478,9 +478,9 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) { // Translates to: "COUGHH! THERE IS NO SPECIFIED DATAAAAA!" osSyncPrintf("\nげぼはっ! 指定されたデータがないでええっす!"); - if (gSaveContext.scene_setup_index == 3) { + if (gSaveContext.sceneSetupIndex == 3) { altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment); - altHeader = altHeaders[gSaveContext.scene_setup_index - 2]; + altHeader = altHeaders[gSaveContext.sceneSetupIndex - 2]; // Translates to: "USING ADULT DAY DATA THERE!" osSyncPrintf("\nそこで、大人の昼データを使用するでええっす!!"); @@ -507,20 +507,20 @@ void func_8009934C(GlobalContext* globalCtx, SceneCmd* cmd) { // Scene Command 0x19: Misc. Settings (Camera & World Map Area) void func_800993C0(GlobalContext* globalCtx, SceneCmd* cmd) { YREG(15) = cmd->miscSettings.cameraMovement; - gSaveContext.world_map_area = cmd->miscSettings.area; + gSaveContext.worldMapArea = cmd->miscSettings.area; if ((globalCtx->sceneNum == SCENE_SHOP1) || (globalCtx->sceneNum == SCENE_SYATEKIJYOU)) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) { - gSaveContext.world_map_area = 1; + gSaveContext.worldMapArea = 1; } } if (((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_GANON_TOU)) || ((globalCtx->sceneNum >= SCENE_ENTRA) && (globalCtx->sceneNum <= SCENE_SHRINE_R))) { - if (gSaveContext.cutscene_index < 0xFFF0) { - gSaveContext.world_map_area_data |= gBitFlags[gSaveContext.world_map_area]; - osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.world_map_area_data, - gSaveContext.world_map_area); + if (gSaveContext.cutsceneIndex < 0xFFF0) { + gSaveContext.worldMapAreaData |= gBitFlags[gSaveContext.worldMapArea]; + osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.worldMapAreaData, + gSaveContext.worldMapArea); } } } diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index f4893ac56..381c167a0 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -1,526 +1,791 @@ #include <ultra64.h> #include <global.h> +#define ENTRANCE(scene, spawn, continueBgm, displayTitleCard, fadeIn, fadeOut) \ + { \ + scene, spawn, \ + ((continueBgm & 1) << 15) | ((displayTitleCard & 1) << 14) | ((fadeIn & 0x7F) << 7) | (fadeOut & 0x7F) \ + } + EntranceInfo gEntranceTable[] = { - { 0x00, 0x00, 0, 1, 0x02, 0x02 }, { 0x00, 0x00, 0, 1, 0x02, 0x02 }, { 0x00, 0x00, 0, 1, 0x02, 0x02 }, - { 0x00, 0x00, 0, 1, 0x02, 0x02 }, { 0x01, 0x00, 0, 1, 0x02, 0x02 }, { 0x01, 0x00, 0, 1, 0x02, 0x02 }, - { 0x01, 0x00, 0, 1, 0x02, 0x02 }, { 0x01, 0x00, 0, 1, 0x02, 0x02 }, { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x14, 0x00, 1, 1, 0x02, 0x02 }, { 0x14, 0x00, 1, 1, 0x02, 0x02 }, { 0x14, 0x00, 1, 1, 0x02, 0x02 }, - { 0x14, 0x00, 1, 1, 0x02, 0x02 }, { 0x05, 0x00, 0, 1, 0x02, 0x02 }, { 0x05, 0x00, 0, 1, 0x02, 0x02 }, - { 0x05, 0x00, 0, 1, 0x02, 0x02 }, { 0x05, 0x00, 0, 1, 0x02, 0x02 }, { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, { 0x68, 0x00, 0, 1, 0x02, 0x02 }, { 0x68, 0x00, 0, 1, 0x02, 0x02 }, - { 0x68, 0x00, 0, 1, 0x02, 0x02 }, { 0x68, 0x00, 0, 1, 0x02, 0x02 }, { 0x69, 0x00, 0, 1, 0x02, 0x02 }, - { 0x69, 0x00, 0, 1, 0x02, 0x02 }, { 0x69, 0x00, 0, 1, 0x02, 0x02 }, { 0x69, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, - { 0x02, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, - { 0x41, 0x00, 0, 1, 0x02, 0x26 }, { 0x41, 0x00, 0, 1, 0x02, 0x26 }, { 0x41, 0x00, 0, 1, 0x02, 0x26 }, - { 0x41, 0x00, 0, 1, 0x02, 0x26 }, { 0x41, 0x00, 0, 1, 0x02, 0x02 }, { 0x41, 0x00, 0, 1, 0x02, 0x02 }, - { 0x1B, 0x00, 1, 1, 0x03, 0x03 }, { 0x1C, 0x00, 1, 1, 0x02, 0x02 }, { 0x1D, 0x00, 1, 1, 0x03, 0x03 }, - { 0x1D, 0x00, 1, 1, 0x02, 0x02 }, { 0x07, 0x00, 0, 1, 0x02, 0x02 }, { 0x07, 0x00, 0, 1, 0x02, 0x02 }, - { 0x07, 0x00, 0, 1, 0x02, 0x02 }, { 0x07, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x04, 0x20 }, - { 0x42, 0x00, 0, 1, 0x04, 0x20 }, { 0x42, 0x00, 0, 1, 0x04, 0x20 }, { 0x42, 0x00, 0, 1, 0x04, 0x20 }, - { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, { 0x38, 0x00, 0, 1, 0x04, 0x20 }, { 0x38, 0x00, 0, 1, 0x04, 0x20 }, - { 0x38, 0x00, 0, 1, 0x04, 0x20 }, { 0x38, 0x00, 0, 1, 0x04, 0x20 }, { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x40, 0x00, 0, 1, 0x02, 0x26 }, { 0x40, 0x00, 0, 1, 0x02, 0x26 }, { 0x40, 0x00, 0, 1, 0x02, 0x26 }, - { 0x40, 0x00, 0, 1, 0x02, 0x26 }, { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x0B, 0x0B }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, - { 0x10, 0x00, 0, 1, 0x04, 0x20 }, { 0x10, 0x00, 0, 1, 0x04, 0x20 }, { 0x10, 0x00, 0, 1, 0x04, 0x20 }, - { 0x10, 0x00, 0, 1, 0x04, 0x20 }, { 0x1E, 0x03, 1, 1, 0x03, 0x03 }, { 0x1F, 0x03, 1, 1, 0x02, 0x02 }, - { 0x1E, 0x03, 1, 1, 0x02, 0x02 }, { 0x1F, 0x03, 1, 1, 0x02, 0x02 }, { 0x44, 0x00, 0, 1, 0x07, 0x07 }, - { 0x44, 0x00, 0, 1, 0x07, 0x07 }, { 0x44, 0x00, 0, 1, 0x07, 0x07 }, { 0x44, 0x00, 0, 1, 0x07, 0x07 }, - { 0x44, 0x00, 0, 1, 0x0D, 0x02 }, { 0x44, 0x00, 0, 1, 0x0D, 0x02 }, { 0x44, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, - { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, { 0x45, 0x00, 0, 1, 0x22, 0x04 }, - { 0x46, 0x00, 0, 1, 0x22, 0x04 }, { 0x45, 0x00, 0, 1, 0x22, 0x04 }, { 0x46, 0x00, 0, 1, 0x22, 0x04 }, - { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, - { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, - { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, - { 0x09, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, - { 0x17, 0x00, 1, 1, 0x02, 0x02 }, { 0x17, 0x00, 1, 1, 0x02, 0x02 }, { 0x17, 0x00, 1, 1, 0x02, 0x02 }, - { 0x17, 0x00, 1, 1, 0x02, 0x02 }, { 0x17, 0x00, 0, 1, 0x02, 0x02 }, { 0x17, 0x00, 0, 1, 0x02, 0x02 }, - { 0x17, 0x00, 0, 1, 0x02, 0x02 }, { 0x65, 0x00, 0, 1, 0x02, 0x02 }, { 0x65, 0x00, 0, 1, 0x02, 0x02 }, - { 0x65, 0x00, 0, 1, 0x02, 0x02 }, { 0x65, 0x00, 0, 1, 0x02, 0x02 }, { 0x08, 0x00, 0, 1, 0x04, 0x04 }, - { 0x08, 0x00, 0, 1, 0x04, 0x04 }, { 0x08, 0x00, 0, 1, 0x04, 0x04 }, { 0x08, 0x00, 0, 1, 0x04, 0x04 }, - { 0x27, 0x00, 0, 1, 0x04, 0x04 }, { 0x27, 0x00, 0, 1, 0x04, 0x04 }, { 0x27, 0x00, 0, 1, 0x04, 0x04 }, - { 0x27, 0x00, 0, 1, 0x04, 0x04 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x0A, 0x0A }, - { 0x47, 0x00, 0, 1, 0x02, 0x0A }, { 0x47, 0x00, 1, 1, 0x0A, 0x0A }, { 0x47, 0x00, 0, 1, 0x0B, 0x0B }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x02, 0x02 }, { 0x47, 0x00, 0, 1, 0x02, 0x02 }, - { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x1E, 0x00, 1, 1, 0x03, 0x03 }, - { 0x1F, 0x00, 1, 1, 0x02, 0x02 }, { 0x1E, 0x00, 1, 1, 0x02, 0x02 }, { 0x1F, 0x00, 1, 1, 0x02, 0x02 }, - { 0x20, 0x00, 1, 1, 0x03, 0x03 }, { 0x21, 0x00, 1, 1, 0x02, 0x02 }, { 0x22, 0x00, 1, 1, 0x02, 0x02 }, - { 0x22, 0x00, 1, 1, 0x02, 0x02 }, { 0x20, 0x00, 0, 1, 0x08, 0x08 }, { 0x67, 0x00, 0, 1, 0x02, 0x02 }, - { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, { 0x34, 0x00, 0, 1, 0x04, 0x04 }, { 0x34, 0x00, 0, 1, 0x04, 0x04 }, - { 0x34, 0x00, 0, 1, 0x04, 0x04 }, { 0x34, 0x00, 0, 1, 0x04, 0x04 }, { 0x34, 0x00, 0, 1, 0x04, 0x02 }, - { 0x34, 0x00, 0, 1, 0x10, 0x10 }, { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, { 0x01, 0x01, 1, 0, 0x02, 0x02 }, - { 0x01, 0x01, 1, 0, 0x02, 0x02 }, { 0x01, 0x01, 1, 0, 0x02, 0x02 }, { 0x01, 0x01, 1, 0, 0x02, 0x02 }, - { 0x26, 0x00, 0, 1, 0x04, 0x04 }, { 0x26, 0x00, 0, 1, 0x04, 0x04 }, { 0x26, 0x00, 0, 1, 0x04, 0x04 }, - { 0x26, 0x00, 0, 1, 0x04, 0x04 }, { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 0, 1, 0x02, 0x02 }, - { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 0, 1, 0x02, 0x02 }, { 0x51, 0x00, 0, 1, 0x04, 0x02 }, - { 0x51, 0x00, 0, 1, 0x21, 0x21 }, { 0x51, 0x00, 0, 1, 0x21, 0x21 }, { 0x51, 0x00, 0, 1, 0x23, 0x23 }, - { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 1, 1, 0x02, 0x02 }, { 0x51, 0x00, 0, 1, 0x23, 0x23 }, - { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 0, 1, 0x29, 0x29 }, { 0x51, 0x00, 1, 1, 0x03, 0x03 }, - { 0x52, 0x00, 0, 1, 0x03, 0x03 }, { 0x52, 0x00, 0, 1, 0x02, 0x02 }, { 0x52, 0x00, 0, 1, 0x03, 0x03 }, - { 0x52, 0x00, 0, 1, 0x02, 0x02 }, { 0x52, 0x00, 0, 1, 0x26, 0x26 }, { 0x52, 0x00, 0, 1, 0x21, 0x21 }, - { 0x52, 0x00, 1, 1, 0x21, 0x21 }, { 0x52, 0x00, 0, 1, 0x21, 0x21 }, { 0x52, 0x00, 1, 1, 0x02, 0x02 }, - { 0x53, 0x00, 0, 1, 0x03, 0x03 }, { 0x53, 0x00, 0, 1, 0x02, 0x02 }, { 0x53, 0x00, 0, 1, 0x03, 0x03 }, - { 0x53, 0x00, 0, 1, 0x02, 0x02 }, { 0x53, 0x00, 0, 1, 0x04, 0x02 }, { 0x53, 0x00, 1, 1, 0x02, 0x02 }, - { 0x54, 0x00, 1, 1, 0x03, 0x03 }, { 0x54, 0x00, 1, 1, 0x02, 0x02 }, { 0x54, 0x00, 1, 1, 0x03, 0x03 }, - { 0x54, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x00, 0, 1, 0x03, 0x03 }, { 0x55, 0x00, 0, 1, 0x02, 0x02 }, - { 0x55, 0x00, 0, 1, 0x03, 0x03 }, { 0x55, 0x00, 0, 1, 0x02, 0x02 }, { 0x55, 0x00, 1, 1, 0x0A, 0x0A }, - { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, { 0x55, 0x00, 1, 1, 0x0A, 0x0A }, { 0x55, 0x00, 0, 1, 0x0D, 0x0A }, - { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, { 0x55, 0x00, 1, 1, 0x02, 0x02 }, - { 0x55, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x00, 1, 1, 0x02, 0x02 }, - { 0x56, 0x00, 1, 1, 0x02, 0x02 }, { 0x56, 0x00, 1, 1, 0x02, 0x02 }, { 0x56, 0x00, 1, 1, 0x02, 0x02 }, - { 0x56, 0x00, 1, 1, 0x02, 0x02 }, { 0x56, 0x00, 0, 1, 0x03, 0x03 }, { 0x56, 0x00, 0, 1, 0x00, 0x00 }, - { 0x57, 0x00, 1, 1, 0x03, 0x03 }, { 0x57, 0x00, 1, 1, 0x02, 0x02 }, { 0x57, 0x00, 1, 1, 0x03, 0x03 }, - { 0x57, 0x00, 1, 1, 0x02, 0x02 }, { 0x57, 0x00, 0, 1, 0x03, 0x03 }, { 0x57, 0x00, 1, 1, 0x02, 0x02 }, - { 0x58, 0x00, 0, 1, 0x02, 0x02 }, { 0x58, 0x00, 0, 1, 0x02, 0x02 }, { 0x58, 0x00, 0, 1, 0x02, 0x02 }, - { 0x58, 0x00, 0, 1, 0x02, 0x02 }, { 0x58, 0x00, 1, 1, 0x02, 0x02 }, { 0x58, 0x00, 1, 1, 0x02, 0x02 }, - { 0x59, 0x00, 0, 1, 0x03, 0x03 }, { 0x59, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x00, 0, 1, 0x03, 0x03 }, - { 0x59, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x00, 0, 1, 0x0D, 0x00 }, { 0x59, 0x00, 0, 1, 0x02, 0x02 }, - { 0x59, 0x00, 1, 1, 0x02, 0x02 }, { 0x59, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x00, 1, 1, 0x02, 0x02 }, - { 0x5A, 0x00, 0, 1, 0x03, 0x03 }, { 0x5A, 0x00, 0, 1, 0x02, 0x02 }, { 0x5A, 0x00, 0, 1, 0x03, 0x03 }, - { 0x5A, 0x00, 0, 1, 0x02, 0x02 }, { 0x5A, 0x00, 1, 1, 0x0C, 0x0A }, { 0x5A, 0x00, 1, 1, 0x0A, 0x0A }, - { 0x5A, 0x00, 1, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, - { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, { 0x5C, 0x00, 1, 1, 0x02, 0x02 }, { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, - { 0x5D, 0x00, 1, 1, 0x03, 0x03 }, { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, { 0x5D, 0x00, 1, 1, 0x03, 0x03 }, - { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, { 0x5D, 0x00, 1, 1, 0x21, 0x21 }, { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, - { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, - { 0x5F, 0x00, 0, 1, 0x03, 0x03 }, { 0x5F, 0x00, 0, 1, 0x02, 0x02 }, { 0x64, 0x00, 0, 1, 0x02, 0x02 }, - { 0x64, 0x00, 0, 1, 0x02, 0x02 }, { 0x64, 0x00, 0, 1, 0x04, 0x02 }, { 0x60, 0x00, 0, 1, 0x03, 0x03 }, - { 0x60, 0x00, 0, 1, 0x02, 0x02 }, { 0x60, 0x00, 0, 1, 0x03, 0x03 }, { 0x60, 0x00, 0, 1, 0x02, 0x02 }, - { 0x60, 0x00, 1, 1, 0x0A, 0x0A }, { 0x60, 0x00, 0, 1, 0x03, 0x03 }, { 0x60, 0x00, 0, 1, 0x02, 0x02 }, - { 0x60, 0x00, 1, 1, 0x02, 0x02 }, { 0x60, 0x00, 1, 1, 0x03, 0x03 }, { 0x60, 0x00, 1, 1, 0x03, 0x03 }, - { 0x61, 0x00, 0, 1, 0x02, 0x02 }, { 0x61, 0x00, 0, 1, 0x02, 0x02 }, { 0x61, 0x00, 0, 1, 0x02, 0x02 }, - { 0x61, 0x00, 0, 1, 0x02, 0x02 }, { 0x61, 0x00, 0, 1, 0x03, 0x03 }, { 0x61, 0x00, 0, 1, 0x02, 0x02 }, - { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 0, 1, 0x02, 0x02 }, - { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 1, 1, 0x02, 0x02 }, - { 0x58, 0x03, 0, 1, 0x00, 0x00 }, { 0x58, 0x03, 0, 1, 0x00, 0x00 }, { 0x58, 0x03, 0, 1, 0x00, 0x00 }, - { 0x58, 0x03, 0, 1, 0x00, 0x00 }, { 0x63, 0x00, 0, 1, 0x03, 0x03 }, { 0x63, 0x00, 0, 1, 0x02, 0x02 }, - { 0x63, 0x00, 0, 1, 0x03, 0x03 }, { 0x63, 0x00, 0, 1, 0x02, 0x02 }, { 0x63, 0x00, 0, 1, 0x20, 0x20 }, - { 0x63, 0x00, 0, 1, 0x2A, 0x2A }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, - { 0x04, 0x00, 0, 1, 0x02, 0x02 }, { 0x04, 0x00, 0, 1, 0x02, 0x02 }, { 0x04, 0x00, 0, 1, 0x02, 0x02 }, - { 0x04, 0x00, 0, 1, 0x02, 0x02 }, { 0x03, 0x00, 0, 1, 0x02, 0x02 }, { 0x03, 0x00, 0, 1, 0x02, 0x02 }, - { 0x03, 0x00, 0, 1, 0x02, 0x02 }, { 0x03, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x01, 0, 1, 0x04, 0x20 }, - { 0x42, 0x01, 0, 1, 0x04, 0x20 }, { 0x42, 0x01, 0, 1, 0x04, 0x20 }, { 0x42, 0x01, 0, 1, 0x04, 0x20 }, - { 0x23, 0x00, 0, 1, 0x03, 0x03 }, { 0x24, 0x00, 0, 1, 0x02, 0x02 }, { 0x25, 0x00, 0, 1, 0x02, 0x02 }, - { 0x25, 0x00, 0, 1, 0x02, 0x02 }, { 0x04, 0x01, 1, 1, 0x02, 0x02 }, { 0x04, 0x01, 1, 1, 0x02, 0x02 }, - { 0x04, 0x01, 1, 1, 0x02, 0x02 }, { 0x04, 0x01, 1, 1, 0x02, 0x02 }, { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, - { 0x51, 0x01, 0, 1, 0x03, 0x03 }, { 0x51, 0x01, 0, 1, 0x02, 0x02 }, { 0x51, 0x01, 0, 1, 0x03, 0x03 }, - { 0x51, 0x01, 0, 1, 0x02, 0x02 }, { 0x51, 0x02, 1, 1, 0x03, 0x03 }, { 0x51, 0x02, 1, 1, 0x02, 0x02 }, - { 0x51, 0x02, 1, 1, 0x03, 0x03 }, { 0x51, 0x02, 1, 1, 0x02, 0x02 }, { 0x51, 0x03, 0, 1, 0x02, 0x02 }, - { 0x51, 0x03, 0, 1, 0x02, 0x02 }, { 0x51, 0x03, 0, 1, 0x02, 0x02 }, { 0x51, 0x03, 0, 1, 0x02, 0x02 }, - { 0x51, 0x04, 1, 1, 0x03, 0x03 }, { 0x51, 0x04, 1, 1, 0x02, 0x02 }, { 0x51, 0x04, 1, 1, 0x03, 0x03 }, - { 0x51, 0x04, 1, 1, 0x02, 0x02 }, { 0x51, 0x05, 0, 1, 0x03, 0x03 }, { 0x51, 0x05, 0, 1, 0x02, 0x02 }, - { 0x51, 0x05, 0, 1, 0x03, 0x03 }, { 0x51, 0x05, 0, 1, 0x02, 0x02 }, { 0x52, 0x01, 0, 1, 0x03, 0x03 }, - { 0x52, 0x01, 0, 1, 0x02, 0x02 }, { 0x52, 0x01, 0, 1, 0x03, 0x03 }, { 0x52, 0x01, 0, 1, 0x02, 0x02 }, - { 0x52, 0x02, 0, 1, 0x03, 0x03 }, { 0x52, 0x02, 0, 1, 0x02, 0x02 }, { 0x52, 0x02, 0, 1, 0x03, 0x03 }, - { 0x52, 0x02, 0, 1, 0x02, 0x02 }, { 0x54, 0x01, 1, 1, 0x03, 0x03 }, { 0x54, 0x01, 1, 1, 0x03, 0x03 }, - { 0x54, 0x01, 1, 1, 0x03, 0x03 }, { 0x54, 0x01, 1, 1, 0x03, 0x03 }, { 0x54, 0x02, 0, 1, 0x03, 0x03 }, - { 0x54, 0x02, 0, 1, 0x02, 0x02 }, { 0x54, 0x02, 0, 1, 0x03, 0x03 }, { 0x54, 0x02, 0, 1, 0x02, 0x02 }, - { 0x58, 0x01, 0, 1, 0x02, 0x02 }, { 0x58, 0x01, 0, 1, 0x02, 0x02 }, { 0x58, 0x01, 0, 1, 0x02, 0x02 }, - { 0x58, 0x01, 0, 1, 0x02, 0x02 }, { 0x5A, 0x01, 0, 1, 0x03, 0x03 }, { 0x5A, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5A, 0x01, 0, 1, 0x03, 0x03 }, { 0x5A, 0x01, 0, 1, 0x02, 0x02 }, { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, - { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, - { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, - { 0x60, 0x01, 0, 1, 0x03, 0x03 }, { 0x60, 0x01, 0, 1, 0x02, 0x02 }, { 0x60, 0x01, 0, 1, 0x03, 0x03 }, - { 0x60, 0x01, 0, 1, 0x02, 0x02 }, { 0x60, 0x02, 0, 1, 0x03, 0x03 }, { 0x60, 0x02, 0, 1, 0x02, 0x02 }, - { 0x60, 0x02, 0, 1, 0x03, 0x03 }, { 0x60, 0x02, 0, 1, 0x02, 0x02 }, { 0x62, 0x01, 0, 1, 0x02, 0x02 }, - { 0x62, 0x01, 0, 1, 0x02, 0x02 }, { 0x62, 0x01, 0, 1, 0x02, 0x02 }, { 0x62, 0x01, 0, 1, 0x02, 0x02 }, - { 0x38, 0x01, 0, 1, 0x04, 0x20 }, { 0x38, 0x01, 0, 1, 0x04, 0x20 }, { 0x38, 0x01, 0, 1, 0x04, 0x20 }, - { 0x38, 0x01, 0, 1, 0x04, 0x20 }, { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, { 0x20, 0x08, 0, 1, 0x04, 0x02 }, - { 0x21, 0x08, 0, 1, 0x04, 0x02 }, { 0x22, 0x08, 0, 1, 0x04, 0x02 }, { 0x22, 0x08, 0, 1, 0x04, 0x02 }, - { 0x20, 0x09, 0, 1, 0x04, 0x02 }, { 0x21, 0x09, 0, 1, 0x04, 0x02 }, { 0x22, 0x09, 0, 1, 0x04, 0x02 }, - { 0x22, 0x09, 0, 1, 0x04, 0x02 }, { 0x20, 0x0A, 0, 1, 0x04, 0x02 }, { 0x21, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x22, 0x0A, 0, 1, 0x04, 0x02 }, { 0x22, 0x0A, 0, 1, 0x04, 0x02 }, { 0x54, 0x03, 1, 1, 0x03, 0x03 }, - { 0x54, 0x03, 1, 1, 0x02, 0x02 }, { 0x54, 0x03, 1, 1, 0x03, 0x03 }, { 0x54, 0x03, 1, 1, 0x02, 0x02 }, - { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, { 0x5C, 0x01, 0, 1, 0x03, 0x03 }, { 0x5C, 0x01, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x01, 0, 1, 0x03, 0x03 }, { 0x5C, 0x01, 0, 1, 0x02, 0x02 }, { 0x5C, 0x02, 0, 0, 0x03, 0x03 }, - { 0x5C, 0x02, 0, 0, 0x02, 0x02 }, { 0x5C, 0x02, 0, 0, 0x03, 0x03 }, { 0x5C, 0x02, 0, 0, 0x02, 0x02 }, - { 0x5C, 0x03, 0, 0, 0x03, 0x03 }, { 0x5C, 0x03, 0, 0, 0x02, 0x02 }, { 0x5C, 0x03, 0, 0, 0x03, 0x03 }, - { 0x5C, 0x03, 0, 0, 0x02, 0x02 }, { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, { 0x5C, 0x05, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x05, 0, 1, 0x02, 0x02 }, { 0x5C, 0x05, 0, 1, 0x03, 0x03 }, { 0x5C, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, - { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, { 0x51, 0x06, 0, 1, 0x03, 0x03 }, { 0x51, 0x06, 0, 1, 0x02, 0x02 }, - { 0x51, 0x06, 0, 1, 0x03, 0x03 }, { 0x51, 0x06, 0, 1, 0x02, 0x02 }, { 0x51, 0x07, 0, 1, 0x03, 0x03 }, - { 0x51, 0x07, 0, 1, 0x02, 0x02 }, { 0x51, 0x07, 0, 1, 0x03, 0x03 }, { 0x51, 0x07, 0, 1, 0x02, 0x02 }, - { 0x52, 0x03, 0, 1, 0x04, 0x02 }, { 0x52, 0x03, 0, 1, 0x04, 0x02 }, { 0x52, 0x03, 0, 1, 0x04, 0x02 }, - { 0x52, 0x03, 0, 1, 0x04, 0x02 }, { 0x53, 0x01, 0, 1, 0x02, 0x02 }, { 0x53, 0x01, 0, 1, 0x02, 0x02 }, - { 0x53, 0x01, 0, 1, 0x02, 0x02 }, { 0x53, 0x01, 0, 1, 0x02, 0x02 }, { 0x55, 0x01, 0, 1, 0x03, 0x03 }, - { 0x55, 0x01, 0, 1, 0x02, 0x02 }, { 0x55, 0x01, 0, 1, 0x03, 0x03 }, { 0x55, 0x01, 0, 1, 0x02, 0x02 }, - { 0x55, 0x02, 0, 1, 0x02, 0x02 }, { 0x55, 0x02, 0, 1, 0x02, 0x02 }, { 0x55, 0x02, 0, 1, 0x02, 0x02 }, - { 0x55, 0x02, 0, 1, 0x02, 0x02 }, { 0x55, 0x03, 0, 1, 0x04, 0x04 }, { 0x55, 0x03, 0, 1, 0x04, 0x04 }, - { 0x55, 0x03, 0, 1, 0x04, 0x04 }, { 0x55, 0x03, 0, 1, 0x04, 0x04 }, { 0x56, 0x01, 0, 1, 0x12, 0x12 }, - { 0x56, 0x01, 0, 1, 0x02, 0x02 }, { 0x56, 0x01, 0, 1, 0x12, 0x12 }, { 0x56, 0x01, 0, 1, 0x02, 0x02 }, - { 0x57, 0x01, 0, 1, 0x03, 0x03 }, { 0x57, 0x01, 0, 1, 0x02, 0x02 }, { 0x57, 0x01, 0, 1, 0x03, 0x03 }, - { 0x57, 0x01, 0, 1, 0x02, 0x02 }, { 0x57, 0x02, 0, 1, 0x13, 0x13 }, { 0x57, 0x02, 0, 1, 0x02, 0x02 }, - { 0x57, 0x02, 0, 1, 0x13, 0x13 }, { 0x57, 0x02, 0, 1, 0x02, 0x02 }, { 0x59, 0x01, 0, 1, 0x02, 0x02 }, - { 0x59, 0x01, 0, 1, 0x02, 0x02 }, { 0x59, 0x01, 0, 1, 0x02, 0x02 }, { 0x59, 0x01, 0, 1, 0x02, 0x02 }, - { 0x59, 0x02, 0, 1, 0x03, 0x03 }, { 0x59, 0x02, 0, 1, 0x02, 0x02 }, { 0x59, 0x02, 0, 1, 0x03, 0x03 }, - { 0x59, 0x02, 0, 1, 0x02, 0x02 }, { 0x5A, 0x02, 1, 1, 0x03, 0x03 }, { 0x5A, 0x02, 1, 1, 0x02, 0x02 }, - { 0x5A, 0x02, 1, 1, 0x03, 0x03 }, { 0x5A, 0x02, 1, 1, 0x02, 0x02 }, { 0x5A, 0x03, 1, 1, 0x03, 0x03 }, - { 0x5A, 0x03, 1, 1, 0x02, 0x02 }, { 0x5A, 0x03, 1, 1, 0x03, 0x03 }, { 0x5A, 0x03, 1, 1, 0x02, 0x02 }, - { 0x5D, 0x01, 0, 1, 0x03, 0x03 }, { 0x5D, 0x01, 0, 1, 0x02, 0x02 }, { 0x5D, 0x01, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x01, 0, 1, 0x02, 0x02 }, { 0x5D, 0x02, 0, 1, 0x03, 0x03 }, { 0x5D, 0x02, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x02, 0, 1, 0x03, 0x03 }, { 0x5D, 0x02, 0, 1, 0x02, 0x02 }, { 0x5D, 0x03, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x03, 0, 1, 0x02, 0x02 }, { 0x5D, 0x03, 0, 1, 0x03, 0x03 }, { 0x5D, 0x03, 0, 1, 0x02, 0x02 }, - { 0x5F, 0x01, 0, 1, 0x03, 0x03 }, { 0x5F, 0x01, 0, 1, 0x02, 0x02 }, { 0x64, 0x01, 0, 1, 0x05, 0x05 }, - { 0x64, 0x01, 0, 1, 0x05, 0x05 }, { 0x5F, 0x01, 0, 1, 0x00, 0x00 }, { 0x60, 0x03, 0, 1, 0x03, 0x03 }, - { 0x60, 0x03, 0, 1, 0x02, 0x02 }, { 0x60, 0x03, 0, 1, 0x03, 0x03 }, { 0x60, 0x03, 0, 1, 0x02, 0x02 }, - { 0x61, 0x01, 0, 1, 0x02, 0x02 }, { 0x61, 0x01, 0, 1, 0x02, 0x02 }, { 0x61, 0x01, 0, 1, 0x02, 0x02 }, - { 0x61, 0x01, 0, 1, 0x02, 0x02 }, { 0x61, 0x02, 0, 1, 0x02, 0x02 }, { 0x61, 0x02, 0, 1, 0x02, 0x02 }, - { 0x61, 0x02, 0, 1, 0x02, 0x02 }, { 0x61, 0x02, 0, 1, 0x02, 0x02 }, { 0x03, 0x01, 1, 1, 0x02, 0x02 }, - { 0x03, 0x01, 1, 1, 0x02, 0x02 }, { 0x03, 0x01, 1, 1, 0x02, 0x02 }, { 0x03, 0x01, 1, 1, 0x02, 0x02 }, - { 0x00, 0x01, 1, 0, 0x02, 0x02 }, { 0x00, 0x01, 1, 0, 0x02, 0x02 }, { 0x00, 0x01, 1, 0, 0x02, 0x02 }, - { 0x00, 0x01, 1, 0, 0x02, 0x02 }, { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, { 0x20, 0x01, 0, 1, 0x03, 0x03 }, - { 0x21, 0x01, 0, 1, 0x02, 0x02 }, { 0x22, 0x01, 0, 1, 0x02, 0x02 }, { 0x22, 0x01, 0, 1, 0x02, 0x02 }, - { 0x20, 0x02, 0, 1, 0x03, 0x03 }, { 0x21, 0x02, 0, 1, 0x02, 0x02 }, { 0x22, 0x02, 0, 1, 0x02, 0x02 }, - { 0x22, 0x02, 0, 1, 0x02, 0x02 }, { 0x20, 0x03, 1, 1, 0x03, 0x03 }, { 0x21, 0x03, 1, 1, 0x02, 0x02 }, - { 0x22, 0x03, 1, 1, 0x02, 0x02 }, { 0x22, 0x03, 1, 1, 0x02, 0x02 }, { 0x55, 0x04, 0, 0, 0x04, 0x04 }, - { 0x55, 0x04, 0, 0, 0x04, 0x04 }, { 0x55, 0x04, 0, 0, 0x04, 0x04 }, { 0x55, 0x04, 0, 0, 0x04, 0x04 }, - { 0x55, 0x05, 0, 0, 0x04, 0x04 }, { 0x55, 0x05, 0, 0, 0x04, 0x04 }, { 0x55, 0x05, 0, 0, 0x04, 0x04 }, - { 0x55, 0x05, 0, 0, 0x04, 0x04 }, { 0x1B, 0x02, 0, 0, 0x02, 0x02 }, { 0x1C, 0x02, 0, 0, 0x02, 0x02 }, - { 0x1D, 0x02, 0, 0, 0x02, 0x02 }, { 0x1D, 0x02, 0, 0, 0x02, 0x02 }, { 0x34, 0x01, 0, 1, 0x04, 0x04 }, - { 0x34, 0x01, 0, 1, 0x04, 0x04 }, { 0x34, 0x01, 0, 1, 0x04, 0x04 }, { 0x34, 0x01, 0, 1, 0x04, 0x04 }, - { 0x1B, 0x01, 0, 1, 0x03, 0x03 }, { 0x1C, 0x01, 0, 1, 0x02, 0x02 }, { 0x1D, 0x01, 0, 1, 0x02, 0x02 }, - { 0x1D, 0x01, 0, 1, 0x02, 0x02 }, { 0x51, 0x08, 1, 1, 0x03, 0x03 }, { 0x51, 0x08, 1, 1, 0x02, 0x02 }, - { 0x51, 0x08, 1, 1, 0x03, 0x03 }, { 0x51, 0x08, 1, 1, 0x02, 0x02 }, { 0x51, 0x09, 0, 1, 0x03, 0x03 }, - { 0x51, 0x09, 0, 1, 0x03, 0x03 }, { 0x51, 0x09, 0, 1, 0x03, 0x03 }, { 0x51, 0x09, 0, 1, 0x03, 0x03 }, - { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, - { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, { 0x55, 0x06, 0, 1, 0x02, 0x02 }, { 0x55, 0x06, 0, 1, 0x02, 0x02 }, - { 0x55, 0x06, 0, 1, 0x02, 0x02 }, { 0x55, 0x06, 0, 1, 0x02, 0x02 }, { 0x51, 0x0B, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0B, 0, 1, 0x04, 0x02 }, { 0x51, 0x0B, 0, 1, 0x05, 0x05 }, { 0x51, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x51, 0x0C, 0, 1, 0x05, 0x05 }, { 0x51, 0x0C, 0, 1, 0x04, 0x02 }, { 0x51, 0x0C, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0C, 0, 1, 0x04, 0x02 }, { 0x51, 0x0D, 0, 1, 0x05, 0x05 }, { 0x51, 0x0D, 0, 1, 0x04, 0x02 }, - { 0x51, 0x0D, 0, 1, 0x05, 0x05 }, { 0x51, 0x0D, 0, 1, 0x04, 0x02 }, { 0x45, 0x01, 0, 1, 0x03, 0x03 }, - { 0x46, 0x01, 0, 1, 0x02, 0x02 }, { 0x45, 0x01, 0, 1, 0x03, 0x03 }, { 0x46, 0x01, 0, 1, 0x02, 0x02 }, - { 0x1E, 0x01, 1, 1, 0x03, 0x03 }, { 0x1F, 0x01, 1, 1, 0x02, 0x02 }, { 0x1E, 0x01, 1, 1, 0x02, 0x02 }, - { 0x1F, 0x01, 1, 1, 0x02, 0x02 }, { 0x20, 0x04, 1, 1, 0x03, 0x03 }, { 0x21, 0x04, 1, 1, 0x02, 0x02 }, - { 0x22, 0x04, 1, 1, 0x02, 0x02 }, { 0x22, 0x04, 1, 1, 0x02, 0x02 }, { 0x20, 0x05, 0, 1, 0x04, 0x02 }, - { 0x21, 0x05, 0, 1, 0x04, 0x02 }, { 0x22, 0x05, 0, 1, 0x04, 0x02 }, { 0x22, 0x05, 0, 1, 0x04, 0x02 }, - { 0x52, 0x04, 0, 1, 0x02, 0x02 }, { 0x52, 0x04, 0, 1, 0x02, 0x02 }, { 0x52, 0x04, 0, 1, 0x02, 0x02 }, - { 0x52, 0x04, 0, 1, 0x02, 0x02 }, { 0x5D, 0x04, 0, 1, 0x03, 0x03 }, { 0x5D, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x04, 0, 1, 0x03, 0x03 }, { 0x5D, 0x04, 0, 1, 0x02, 0x02 }, { 0x63, 0x01, 0, 0, 0x03, 0x03 }, - { 0x63, 0x01, 0, 0, 0x02, 0x02 }, { 0x63, 0x01, 0, 0, 0x03, 0x03 }, { 0x63, 0x01, 0, 0, 0x02, 0x02 }, - { 0x07, 0x01, 0, 1, 0x02, 0x02 }, { 0x07, 0x01, 0, 1, 0x02, 0x02 }, { 0x07, 0x01, 0, 1, 0x02, 0x02 }, - { 0x07, 0x01, 0, 1, 0x02, 0x02 }, { 0x07, 0x02, 1, 1, 0x02, 0x02 }, { 0x07, 0x02, 1, 1, 0x02, 0x02 }, - { 0x07, 0x02, 1, 1, 0x02, 0x02 }, { 0x07, 0x02, 1, 1, 0x02, 0x02 }, { 0x5D, 0x05, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x05, 0, 1, 0x02, 0x02 }, { 0x5D, 0x05, 0, 1, 0x03, 0x03 }, { 0x5D, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x06, 0, 1, 0x03, 0x03 }, { 0x5D, 0x06, 0, 1, 0x02, 0x02 }, { 0x5D, 0x06, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x06, 0, 1, 0x02, 0x02 }, { 0x5D, 0x07, 0, 1, 0x03, 0x03 }, { 0x5D, 0x07, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x07, 0, 1, 0x03, 0x03 }, { 0x5D, 0x07, 0, 1, 0x02, 0x02 }, { 0x5D, 0x08, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x08, 0, 1, 0x02, 0x02 }, { 0x5D, 0x08, 0, 1, 0x03, 0x03 }, { 0x5D, 0x08, 0, 1, 0x02, 0x02 }, - { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, - { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, { 0x44, 0x01, 0, 1, 0x02, 0x02 }, { 0x44, 0x01, 0, 1, 0x02, 0x02 }, - { 0x44, 0x01, 0, 1, 0x02, 0x02 }, { 0x44, 0x01, 0, 1, 0x02, 0x02 }, { 0x5D, 0x09, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x09, 0, 1, 0x02, 0x02 }, { 0x5D, 0x09, 0, 1, 0x03, 0x03 }, { 0x5D, 0x09, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0A, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0A, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0A, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0A, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0B, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0B, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0B, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0C, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0C, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0C, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x63, 0x02, 0, 1, 0x03, 0x03 }, { 0x63, 0x02, 0, 1, 0x02, 0x02 }, { 0x63, 0x02, 0, 1, 0x03, 0x03 }, - { 0x63, 0x02, 0, 1, 0x02, 0x02 }, { 0x63, 0x03, 0, 1, 0x03, 0x03 }, { 0x63, 0x03, 0, 1, 0x02, 0x02 }, - { 0x63, 0x03, 0, 1, 0x03, 0x03 }, { 0x63, 0x03, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x56, 0x00, 0, 1, 0x02, 0x02 }, { 0x47, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, - { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x01, 1, 1, 0x02, 0x02 }, { 0x06, 0x01, 1, 1, 0x02, 0x02 }, - { 0x06, 0x01, 1, 1, 0x02, 0x02 }, { 0x06, 0x01, 1, 1, 0x02, 0x02 }, { 0x36, 0x00, 0, 1, 0x04, 0x20 }, - { 0x36, 0x00, 0, 1, 0x04, 0x20 }, { 0x36, 0x00, 0, 1, 0x04, 0x20 }, { 0x36, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, { 0x13, 0x00, 1, 1, 0x02, 0x02 }, { 0x13, 0x00, 1, 1, 0x02, 0x02 }, - { 0x13, 0x00, 1, 1, 0x02, 0x02 }, { 0x13, 0x00, 1, 1, 0x02, 0x02 }, { 0x15, 0x00, 1, 1, 0x02, 0x02 }, - { 0x15, 0x00, 1, 1, 0x02, 0x02 }, { 0x15, 0x00, 1, 1, 0x02, 0x02 }, { 0x15, 0x00, 1, 1, 0x02, 0x02 }, - { 0x57, 0x06, 0, 1, 0x04, 0x02 }, { 0x57, 0x06, 0, 1, 0x04, 0x02 }, { 0x57, 0x06, 0, 1, 0x04, 0x02 }, - { 0x57, 0x06, 0, 1, 0x04, 0x02 }, { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, - { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, - { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, - { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, { 0x43, 0x03, 0, 1, 0x02, 0x02 }, - { 0x43, 0x03, 0, 1, 0x02, 0x02 }, { 0x43, 0x03, 0, 1, 0x02, 0x02 }, { 0x43, 0x03, 0, 1, 0x02, 0x02 }, - { 0x43, 0x04, 0, 1, 0x02, 0x02 }, { 0x43, 0x04, 0, 1, 0x02, 0x02 }, { 0x43, 0x04, 0, 1, 0x02, 0x02 }, - { 0x43, 0x04, 0, 1, 0x02, 0x02 }, { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, - { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, { 0x55, 0x07, 0, 0, 0x04, 0x04 }, - { 0x55, 0x07, 0, 0, 0x04, 0x04 }, { 0x55, 0x07, 0, 0, 0x04, 0x04 }, { 0x55, 0x07, 0, 0, 0x04, 0x04 }, - { 0x55, 0x08, 0, 0, 0x04, 0x04 }, { 0x55, 0x08, 0, 0, 0x04, 0x04 }, { 0x55, 0x08, 0, 0, 0x04, 0x04 }, - { 0x55, 0x08, 0, 0, 0x04, 0x04 }, { 0x5F, 0x02, 0, 1, 0x02, 0x02 }, { 0x5F, 0x02, 0, 1, 0x02, 0x02 }, - { 0x64, 0x02, 0, 1, 0x02, 0x02 }, { 0x64, 0x02, 0, 1, 0x02, 0x02 }, { 0x5F, 0x02, 0, 1, 0x00, 0x00 }, - { 0x52, 0x05, 0, 1, 0x04, 0x02 }, { 0x52, 0x05, 0, 1, 0x04, 0x02 }, { 0x52, 0x05, 0, 1, 0x04, 0x02 }, - { 0x52, 0x05, 0, 1, 0x04, 0x02 }, { 0x52, 0x06, 0, 1, 0x04, 0x02 }, { 0x52, 0x06, 0, 1, 0x04, 0x02 }, - { 0x52, 0x06, 0, 1, 0x04, 0x02 }, { 0x52, 0x06, 0, 1, 0x04, 0x02 }, { 0x52, 0x07, 0, 1, 0x04, 0x02 }, - { 0x52, 0x07, 0, 1, 0x04, 0x02 }, { 0x52, 0x07, 0, 1, 0x04, 0x02 }, { 0x52, 0x07, 0, 1, 0x04, 0x02 }, - { 0x52, 0x08, 0, 1, 0x04, 0x02 }, { 0x52, 0x08, 0, 1, 0x04, 0x02 }, { 0x52, 0x08, 0, 1, 0x04, 0x02 }, - { 0x52, 0x08, 0, 1, 0x04, 0x02 }, { 0x53, 0x02, 0, 1, 0x04, 0x02 }, { 0x53, 0x02, 0, 1, 0x04, 0x02 }, - { 0x53, 0x02, 0, 1, 0x04, 0x02 }, { 0x53, 0x02, 0, 1, 0x04, 0x02 }, { 0x53, 0x03, 0, 1, 0x03, 0x03 }, - { 0x53, 0x03, 0, 1, 0x03, 0x03 }, { 0x53, 0x03, 0, 1, 0x03, 0x03 }, { 0x53, 0x03, 0, 1, 0x03, 0x03 }, - { 0x53, 0x04, 0, 1, 0x03, 0x03 }, { 0x53, 0x04, 0, 1, 0x03, 0x03 }, { 0x53, 0x04, 0, 1, 0x03, 0x03 }, - { 0x53, 0x04, 0, 1, 0x03, 0x03 }, { 0x53, 0x05, 0, 1, 0x03, 0x03 }, { 0x53, 0x05, 0, 1, 0x03, 0x03 }, - { 0x53, 0x05, 0, 1, 0x03, 0x03 }, { 0x53, 0x05, 0, 1, 0x03, 0x03 }, { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, - { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, - { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, - { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, - { 0x63, 0x04, 0, 1, 0x04, 0x02 }, { 0x63, 0x04, 0, 1, 0x04, 0x02 }, { 0x63, 0x04, 0, 1, 0x04, 0x02 }, - { 0x63, 0x04, 0, 1, 0x04, 0x02 }, { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, - { 0x30, 0x00, 0, 0, 0x04, 0x20 }, { 0x30, 0x00, 0, 0, 0x04, 0x20 }, { 0x30, 0x00, 0, 1, 0x04, 0x20 }, - { 0x30, 0x00, 0, 1, 0x04, 0x20 }, { 0x31, 0x00, 0, 1, 0x04, 0x20 }, { 0x31, 0x00, 0, 1, 0x04, 0x20 }, - { 0x31, 0x00, 0, 1, 0x04, 0x20 }, { 0x31, 0x00, 0, 1, 0x04, 0x20 }, { 0x1E, 0x04, 0, 1, 0x04, 0x02 }, - { 0x1F, 0x04, 0, 1, 0x04, 0x02 }, { 0x1E, 0x04, 0, 1, 0x04, 0x02 }, { 0x1F, 0x04, 0, 1, 0x04, 0x02 }, - { 0x32, 0x00, 0, 1, 0x02, 0x02 }, { 0x32, 0x00, 0, 1, 0x02, 0x02 }, { 0x32, 0x00, 0, 1, 0x02, 0x02 }, - { 0x32, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x05, 0, 1, 0x03, 0x03 }, { 0x59, 0x05, 0, 1, 0x03, 0x03 }, - { 0x59, 0x05, 0, 1, 0x03, 0x03 }, { 0x59, 0x05, 0, 1, 0x03, 0x03 }, { 0x35, 0x00, 0, 1, 0x04, 0x02 }, - { 0x35, 0x00, 0, 1, 0x04, 0x02 }, { 0x35, 0x00, 0, 1, 0x04, 0x02 }, { 0x35, 0x00, 0, 1, 0x04, 0x02 }, - { 0x37, 0x00, 0, 1, 0x04, 0x20 }, { 0x37, 0x00, 0, 1, 0x04, 0x20 }, { 0x37, 0x00, 0, 1, 0x04, 0x20 }, - { 0x37, 0x00, 0, 1, 0x04, 0x20 }, { 0x39, 0x00, 0, 1, 0x04, 0x04 }, { 0x39, 0x00, 0, 1, 0x04, 0x04 }, - { 0x39, 0x00, 0, 1, 0x04, 0x04 }, { 0x39, 0x00, 0, 1, 0x04, 0x04 }, { 0x5D, 0x0D, 0, 1, 0x03, 0x03 }, - { 0x5D, 0x0D, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0D, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x0E, 0, 1, 0x03, 0x05 }, { 0x5D, 0x0E, 0, 1, 0x02, 0x04 }, { 0x5D, 0x0E, 0, 1, 0x03, 0x05 }, - { 0x5D, 0x0E, 0, 1, 0x02, 0x04 }, { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, - { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, { 0x20, 0x06, 0, 1, 0x04, 0x02 }, { 0x21, 0x06, 0, 1, 0x04, 0x02 }, - { 0x22, 0x06, 0, 1, 0x04, 0x02 }, { 0x22, 0x06, 0, 1, 0x04, 0x02 }, { 0x20, 0x07, 0, 1, 0x04, 0x02 }, - { 0x21, 0x07, 0, 1, 0x04, 0x02 }, { 0x22, 0x07, 0, 1, 0x04, 0x02 }, { 0x22, 0x07, 0, 1, 0x04, 0x02 }, - { 0x1E, 0x02, 0, 1, 0x04, 0x02 }, { 0x1F, 0x02, 0, 1, 0x04, 0x02 }, { 0x1E, 0x02, 0, 1, 0x03, 0x03 }, - { 0x1F, 0x02, 0, 1, 0x02, 0x02 }, { 0x58, 0x02, 0, 1, 0x02, 0x02 }, { 0x58, 0x02, 0, 1, 0x02, 0x02 }, - { 0x58, 0x02, 0, 1, 0x02, 0x02 }, { 0x58, 0x02, 0, 1, 0x02, 0x02 }, { 0x57, 0x03, 0, 1, 0x03, 0x03 }, - { 0x57, 0x03, 0, 1, 0x03, 0x03 }, { 0x57, 0x03, 0, 1, 0x03, 0x03 }, { 0x57, 0x03, 0, 1, 0x03, 0x03 }, - { 0x57, 0x04, 0, 1, 0x04, 0x02 }, { 0x57, 0x04, 0, 1, 0x04, 0x02 }, { 0x57, 0x04, 0, 1, 0x04, 0x02 }, - { 0x57, 0x04, 0, 1, 0x04, 0x02 }, { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, - { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, { 0x59, 0x03, 0, 1, 0x03, 0x03 }, - { 0x59, 0x03, 0, 1, 0x02, 0x02 }, { 0x59, 0x03, 0, 1, 0x03, 0x03 }, { 0x59, 0x03, 0, 1, 0x02, 0x02 }, - { 0x59, 0x04, 0, 1, 0x02, 0x02 }, { 0x59, 0x04, 0, 1, 0x02, 0x02 }, { 0x59, 0x04, 0, 1, 0x02, 0x02 }, - { 0x59, 0x04, 0, 1, 0x02, 0x02 }, { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, { 0x30, 0x01, 0, 0, 0x04, 0x20 }, { 0x30, 0x01, 0, 0, 0x04, 0x20 }, - { 0x30, 0x01, 0, 1, 0x04, 0x20 }, { 0x30, 0x01, 0, 1, 0x04, 0x20 }, { 0x30, 0x02, 0, 0, 0x04, 0x20 }, - { 0x30, 0x02, 0, 0, 0x04, 0x20 }, { 0x30, 0x02, 0, 1, 0x04, 0x20 }, { 0x30, 0x02, 0, 1, 0x04, 0x20 }, - { 0x06, 0x02, 0, 0, 0x02, 0x02 }, { 0x06, 0x02, 0, 0, 0x02, 0x02 }, { 0x06, 0x02, 0, 0, 0x02, 0x02 }, - { 0x06, 0x02, 0, 0, 0x02, 0x02 }, { 0x06, 0x03, 0, 0, 0x02, 0x02 }, { 0x06, 0x03, 0, 0, 0x02, 0x02 }, - { 0x06, 0x03, 0, 0, 0x02, 0x02 }, { 0x06, 0x03, 0, 0, 0x02, 0x02 }, { 0x06, 0x04, 0, 1, 0x02, 0x02 }, - { 0x06, 0x04, 0, 1, 0x02, 0x02 }, { 0x06, 0x04, 0, 1, 0x02, 0x02 }, { 0x06, 0x04, 0, 1, 0x02, 0x02 }, - { 0x62, 0x02, 0, 1, 0x04, 0x02 }, { 0x62, 0x02, 0, 1, 0x04, 0x02 }, { 0x62, 0x02, 0, 1, 0x04, 0x02 }, - { 0x62, 0x02, 0, 1, 0x04, 0x02 }, { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x4A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x4A, 0x00, 0, 1, 0x02, 0x02 }, { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x02, 0x01, 1, 1, 0x02, 0x02 }, - { 0x02, 0x01, 1, 1, 0x02, 0x02 }, { 0x02, 0x01, 1, 1, 0x02, 0x02 }, { 0x02, 0x01, 1, 1, 0x02, 0x02 }, - { 0x12, 0x00, 1, 0, 0x02, 0x02 }, { 0x12, 0x00, 1, 0, 0x02, 0x02 }, { 0x12, 0x00, 1, 0, 0x02, 0x02 }, - { 0x12, 0x00, 1, 0, 0x02, 0x02 }, { 0x11, 0x00, 1, 0, 0x02, 0x02 }, { 0x11, 0x00, 1, 0, 0x02, 0x02 }, - { 0x11, 0x00, 1, 0, 0x02, 0x02 }, { 0x11, 0x00, 1, 0, 0x02, 0x02 }, { 0x18, 0x00, 1, 1, 0x02, 0x02 }, - { 0x18, 0x00, 1, 1, 0x02, 0x02 }, { 0x18, 0x00, 1, 1, 0x02, 0x02 }, { 0x18, 0x00, 1, 1, 0x02, 0x02 }, - { 0x16, 0x00, 1, 1, 0x02, 0x02 }, { 0x16, 0x00, 1, 1, 0x02, 0x02 }, { 0x16, 0x00, 1, 1, 0x02, 0x02 }, - { 0x16, 0x00, 1, 1, 0x02, 0x02 }, { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, { 0x19, 0x00, 1, 1, 0x02, 0x02 }, - { 0x19, 0x00, 1, 1, 0x02, 0x02 }, { 0x19, 0x00, 1, 1, 0x02, 0x02 }, { 0x19, 0x00, 1, 1, 0x02, 0x02 }, - { 0x05, 0x01, 1, 1, 0x03, 0x02 }, { 0x05, 0x01, 1, 1, 0x02, 0x02 }, { 0x05, 0x01, 1, 1, 0x03, 0x02 }, - { 0x05, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, - { 0x63, 0x05, 0, 1, 0x04, 0x02 }, { 0x63, 0x05, 0, 1, 0x04, 0x02 }, { 0x63, 0x05, 0, 1, 0x04, 0x02 }, - { 0x63, 0x05, 0, 1, 0x04, 0x02 }, { 0x28, 0x00, 0, 1, 0x04, 0x04 }, { 0x28, 0x00, 0, 1, 0x04, 0x04 }, - { 0x28, 0x00, 0, 1, 0x04, 0x04 }, { 0x28, 0x00, 0, 1, 0x04, 0x04 }, { 0x29, 0x00, 0, 1, 0x04, 0x04 }, - { 0x29, 0x00, 0, 1, 0x04, 0x04 }, { 0x29, 0x00, 0, 1, 0x04, 0x04 }, { 0x29, 0x00, 0, 1, 0x04, 0x04 }, - { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x09, 0, 0, 0x04, 0x04 }, - { 0x55, 0x09, 0, 0, 0x04, 0x04 }, { 0x55, 0x09, 0, 0, 0x04, 0x04 }, { 0x55, 0x09, 0, 0, 0x04, 0x04 }, - { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, - { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, { 0x52, 0x09, 0, 1, 0x04, 0x04 }, { 0x52, 0x09, 0, 1, 0x04, 0x04 }, - { 0x52, 0x09, 0, 1, 0x04, 0x04 }, { 0x52, 0x09, 0, 1, 0x04, 0x04 }, { 0x48, 0x00, 0, 1, 0x02, 0x26 }, - { 0x48, 0x00, 0, 1, 0x02, 0x26 }, { 0x48, 0x00, 0, 1, 0x02, 0x26 }, { 0x48, 0x00, 0, 1, 0x02, 0x26 }, - { 0x48, 0x01, 0, 1, 0x04, 0x20 }, { 0x48, 0x01, 0, 1, 0x04, 0x20 }, { 0x48, 0x01, 0, 1, 0x04, 0x20 }, - { 0x48, 0x01, 0, 1, 0x04, 0x20 }, { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, { 0x60, 0x04, 0, 1, 0x02, 0x02 }, - { 0x60, 0x04, 0, 1, 0x02, 0x02 }, { 0x60, 0x04, 0, 1, 0x02, 0x02 }, { 0x60, 0x04, 0, 1, 0x02, 0x02 }, - { 0x49, 0x00, 0, 1, 0x02, 0x20 }, { 0x49, 0x00, 0, 1, 0x02, 0x20 }, { 0x49, 0x00, 0, 1, 0x02, 0x20 }, - { 0x49, 0x00, 0, 1, 0x02, 0x20 }, { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x23, 0x01, 0, 1, 0x04, 0x02 }, { 0x24, 0x01, 0, 1, 0x04, 0x02 }, - { 0x25, 0x01, 0, 1, 0x04, 0x02 }, { 0x25, 0x01, 0, 1, 0x04, 0x02 }, { 0x51, 0x0F, 0, 1, 0x05, 0x05 }, - { 0x51, 0x0F, 0, 1, 0x04, 0x02 }, { 0x51, 0x0F, 0, 1, 0x05, 0x05 }, { 0x51, 0x0F, 0, 1, 0x04, 0x02 }, - { 0x60, 0x05, 0, 1, 0x04, 0x02 }, { 0x60, 0x05, 0, 1, 0x04, 0x02 }, { 0x60, 0x05, 0, 1, 0x04, 0x02 }, - { 0x60, 0x05, 0, 1, 0x04, 0x02 }, { 0x5F, 0x04, 0, 1, 0x03, 0x03 }, { 0x5F, 0x04, 0, 1, 0x02, 0x02 }, - { 0x64, 0x04, 0, 1, 0x02, 0x02 }, { 0x64, 0x04, 0, 1, 0x02, 0x02 }, { 0x61, 0x03, 0, 1, 0x02, 0x02 }, - { 0x61, 0x03, 0, 1, 0x02, 0x02 }, { 0x61, 0x03, 0, 1, 0x02, 0x02 }, { 0x61, 0x03, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, - { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, { 0x63, 0x06, 0, 0, 0x02, 0x26 }, - { 0x63, 0x06, 0, 0, 0x02, 0x26 }, { 0x63, 0x06, 0, 0, 0x02, 0x26 }, { 0x63, 0x06, 0, 0, 0x02, 0x26 }, - { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, - { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, - { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, - { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, - { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, - { 0x57, 0x05, 0, 1, 0x02, 0x02 }, { 0x57, 0x05, 0, 1, 0x02, 0x02 }, { 0x57, 0x05, 0, 1, 0x02, 0x02 }, - { 0x57, 0x05, 0, 1, 0x02, 0x02 }, { 0x07, 0x03, 0, 1, 0x02, 0x02 }, { 0x07, 0x03, 0, 1, 0x02, 0x02 }, - { 0x07, 0x03, 0, 1, 0x02, 0x02 }, { 0x07, 0x03, 0, 1, 0x02, 0x02 }, { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, - { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, - { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, { 0x61, 0x04, 0, 1, 0x02, 0x02 }, { 0x61, 0x04, 0, 1, 0x02, 0x02 }, - { 0x61, 0x04, 0, 1, 0x02, 0x02 }, { 0x61, 0x04, 0, 1, 0x02, 0x02 }, { 0x5F, 0x03, 0, 1, 0x03, 0x03 }, - { 0x5F, 0x03, 0, 1, 0x02, 0x02 }, { 0x64, 0x03, 0, 1, 0x02, 0x02 }, { 0x64, 0x03, 0, 1, 0x02, 0x02 }, - { 0x5F, 0x03, 0, 1, 0x00, 0x00 }, { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, { 0x48, 0x02, 1, 1, 0x04, 0x20 }, - { 0x48, 0x02, 1, 1, 0x04, 0x20 }, { 0x48, 0x02, 1, 1, 0x04, 0x20 }, { 0x48, 0x02, 1, 1, 0x04, 0x20 }, - { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, - { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, { 0x53, 0x06, 0, 1, 0x03, 0x03 }, { 0x53, 0x06, 0, 1, 0x03, 0x03 }, - { 0x53, 0x06, 0, 1, 0x03, 0x03 }, { 0x53, 0x06, 0, 1, 0x03, 0x03 }, { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, - { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, - { 0x52, 0x0D, 0, 1, 0x03, 0x03 }, { 0x52, 0x0D, 0, 1, 0x02, 0x02 }, { 0x52, 0x0D, 0, 1, 0x03, 0x03 }, - { 0x52, 0x0D, 0, 1, 0x02, 0x02 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, - { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, - { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, { 0x66, 0x00, 0, 1, 0x02, 0x02 }, { 0x66, 0x00, 0, 1, 0x02, 0x02 }, - { 0x66, 0x00, 0, 1, 0x02, 0x02 }, { 0x66, 0x00, 0, 1, 0x02, 0x02 }, { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, - { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, - { 0x32, 0x01, 0, 1, 0x02, 0x02 }, { 0x32, 0x01, 0, 1, 0x02, 0x02 }, { 0x32, 0x01, 0, 1, 0x02, 0x02 }, - { 0x32, 0x01, 0, 1, 0x02, 0x02 }, { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, { 0x33, 0x00, 0, 1, 0x04, 0x20 }, - { 0x33, 0x00, 0, 1, 0x04, 0x20 }, { 0x33, 0x00, 0, 1, 0x04, 0x20 }, { 0x33, 0x00, 0, 1, 0x04, 0x20 }, - { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, - { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, - { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, { 0x50, 0x00, 0, 1, 0x04, 0x20 }, { 0x50, 0x00, 0, 1, 0x04, 0x20 }, - { 0x50, 0x00, 0, 1, 0x04, 0x20 }, { 0x50, 0x00, 0, 1, 0x04, 0x20 }, { 0x52, 0x0E, 0, 1, 0x03, 0x03 }, - { 0x52, 0x0E, 0, 1, 0x02, 0x02 }, { 0x52, 0x0E, 0, 1, 0x03, 0x03 }, { 0x52, 0x0E, 0, 1, 0x02, 0x02 }, - { 0x63, 0x08, 0, 0, 0x20, 0x20 }, { 0x63, 0x08, 0, 0, 0x20, 0x20 }, { 0x63, 0x08, 0, 0, 0x20, 0x20 }, - { 0x63, 0x08, 0, 0, 0x20, 0x20 }, { 0x63, 0x09, 0, 0, 0x02, 0x02 }, { 0x63, 0x09, 0, 0, 0x02, 0x02 }, - { 0x63, 0x09, 0, 0, 0x02, 0x02 }, { 0x63, 0x09, 0, 0, 0x02, 0x02 }, { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, - { 0x61, 0x05, 0, 1, 0x02, 0x02 }, { 0x61, 0x05, 0, 1, 0x02, 0x02 }, { 0x61, 0x05, 0, 1, 0x02, 0x02 }, - { 0x61, 0x05, 0, 1, 0x02, 0x02 }, { 0x53, 0x07, 0, 1, 0x03, 0x03 }, { 0x53, 0x07, 0, 1, 0x03, 0x03 }, - { 0x53, 0x07, 0, 1, 0x03, 0x03 }, { 0x53, 0x07, 0, 1, 0x03, 0x03 }, { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, - { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, { 0x41, 0x01, 0, 1, 0x02, 0x02 }, { 0x41, 0x01, 0, 1, 0x02, 0x02 }, - { 0x41, 0x01, 0, 1, 0x02, 0x02 }, { 0x41, 0x01, 0, 1, 0x02, 0x02 }, { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, - { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, - { 0x5C, 0x07, 0, 1, 0x03, 0x03 }, { 0x5C, 0x07, 0, 1, 0x02, 0x02 }, { 0x5C, 0x07, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x07, 0, 1, 0x02, 0x02 }, { 0x53, 0x08, 0, 1, 0x03, 0x03 }, { 0x53, 0x08, 0, 1, 0x03, 0x03 }, - { 0x53, 0x08, 0, 1, 0x03, 0x03 }, { 0x53, 0x08, 0, 1, 0x03, 0x03 }, { 0x03, 0x02, 0, 1, 0x02, 0x02 }, - { 0x03, 0x02, 0, 1, 0x02, 0x02 }, { 0x03, 0x02, 0, 1, 0x02, 0x02 }, { 0x03, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, { 0x43, 0x05, 0, 1, 0x02, 0x02 }, { 0x43, 0x05, 0, 1, 0x02, 0x02 }, - { 0x43, 0x05, 0, 1, 0x02, 0x02 }, { 0x43, 0x05, 0, 1, 0x02, 0x02 }, { 0x43, 0x06, 0, 1, 0x02, 0x02 }, - { 0x43, 0x06, 0, 1, 0x02, 0x02 }, { 0x43, 0x06, 0, 1, 0x02, 0x02 }, { 0x43, 0x06, 0, 1, 0x02, 0x02 }, - { 0x51, 0x11, 0, 1, 0x03, 0x03 }, { 0x51, 0x11, 0, 1, 0x02, 0x02 }, { 0x51, 0x11, 0, 1, 0x03, 0x03 }, - { 0x51, 0x11, 0, 1, 0x02, 0x02 }, { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, - { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, - { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, { 0x37, 0x01, 0, 1, 0x04, 0x20 }, { 0x37, 0x01, 0, 1, 0x04, 0x20 }, - { 0x37, 0x01, 0, 1, 0x04, 0x20 }, { 0x37, 0x01, 0, 1, 0x04, 0x20 }, { 0x08, 0x01, 0, 1, 0x04, 0x04 }, - { 0x08, 0x01, 0, 1, 0x04, 0x04 }, { 0x08, 0x01, 0, 1, 0x04, 0x04 }, { 0x08, 0x01, 0, 1, 0x04, 0x04 }, - { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, - { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, { 0x09, 0x01, 0, 1, 0x02, 0x02 }, - { 0x09, 0x01, 0, 1, 0x02, 0x02 }, { 0x09, 0x01, 0, 1, 0x02, 0x02 }, { 0x09, 0x01, 0, 1, 0x02, 0x02 }, - { 0x52, 0x0F, 0, 1, 0x03, 0x03 }, { 0x52, 0x0F, 0, 1, 0x02, 0x02 }, { 0x52, 0x0F, 0, 1, 0x03, 0x03 }, - { 0x52, 0x0F, 0, 1, 0x02, 0x02 }, { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, - { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, - { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, - { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, - { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, { 0x17, 0x02, 1, 1, 0x02, 0x02 }, { 0x17, 0x02, 1, 1, 0x02, 0x02 }, - { 0x17, 0x02, 1, 1, 0x02, 0x02 }, { 0x17, 0x02, 1, 1, 0x02, 0x02 }, { 0x4A, 0x01, 0, 0, 0x03, 0x03 }, - { 0x4A, 0x01, 0, 0, 0x02, 0x02 }, { 0x4A, 0x01, 0, 0, 0x03, 0x03 }, { 0x4A, 0x01, 0, 0, 0x02, 0x02 }, - { 0x43, 0x07, 0, 1, 0x02, 0x02 }, { 0x43, 0x07, 0, 1, 0x02, 0x02 }, { 0x43, 0x07, 0, 1, 0x02, 0x02 }, - { 0x43, 0x07, 0, 1, 0x02, 0x02 }, { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, - { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, - { 0x56, 0x02, 0, 1, 0x12, 0x12 }, { 0x56, 0x02, 0, 1, 0x02, 0x02 }, { 0x56, 0x02, 0, 1, 0x12, 0x12 }, - { 0x56, 0x02, 0, 1, 0x02, 0x02 }, { 0x57, 0x08, 0, 1, 0x02, 0x02 }, { 0x57, 0x08, 0, 1, 0x02, 0x02 }, - { 0x57, 0x08, 0, 1, 0x02, 0x02 }, { 0x57, 0x08, 0, 1, 0x02, 0x02 }, { 0x56, 0x03, 0, 1, 0x03, 0x03 }, - { 0x56, 0x03, 0, 1, 0x03, 0x03 }, { 0x56, 0x03, 0, 1, 0x03, 0x03 }, { 0x56, 0x03, 0, 1, 0x03, 0x03 }, - { 0x57, 0x09, 0, 1, 0x03, 0x03 }, { 0x57, 0x09, 0, 1, 0x03, 0x03 }, { 0x57, 0x09, 0, 1, 0x03, 0x03 }, - { 0x57, 0x09, 0, 1, 0x03, 0x03 }, { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, - { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, + ENTRANCE(0x00, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x00, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x00, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x00, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x01, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x01, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x01, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x01, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x0B, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x0B, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x0B, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x0B, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x14, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x14, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x14, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x14, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x05, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x05, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x05, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x05, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x6E, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x6E, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x6E, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x6E, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x6C, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x6C, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x6C, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x6C, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x68, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x68, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x68, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x68, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x69, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x69, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x69, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x69, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x6D, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x6D, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x6D, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x6D, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x02, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x02, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x02, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x02, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x02, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x41, 0x00, 0, 1, 0x02, 0x26), + ENTRANCE(0x41, 0x00, 0, 1, 0x02, 0x26), ENTRANCE(0x41, 0x00, 0, 1, 0x02, 0x26), + ENTRANCE(0x41, 0x00, 0, 1, 0x02, 0x26), ENTRANCE(0x41, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x41, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x1B, 0x00, 1, 1, 0x03, 0x03), + ENTRANCE(0x1C, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x1D, 0x00, 1, 1, 0x03, 0x03), + ENTRANCE(0x1D, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x07, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x07, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x07, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x07, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x42, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x42, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x42, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x42, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x3E, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x38, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x38, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x38, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x38, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x6A, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x6A, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x6A, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x6A, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x40, 0x00, 0, 1, 0x02, 0x26), + ENTRANCE(0x40, 0x00, 0, 1, 0x02, 0x26), ENTRANCE(0x40, 0x00, 0, 1, 0x02, 0x26), + ENTRANCE(0x40, 0x00, 0, 1, 0x02, 0x26), ENTRANCE(0x4C, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x4C, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x4C, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x4C, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x00, 0, 1, 0x0B, 0x0B), ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x10, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x10, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x10, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x10, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x1E, 0x03, 1, 1, 0x03, 0x03), + ENTRANCE(0x1F, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x1E, 0x03, 1, 1, 0x02, 0x02), + ENTRANCE(0x1F, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x44, 0x00, 0, 1, 0x07, 0x07), + ENTRANCE(0x44, 0x00, 0, 1, 0x07, 0x07), ENTRANCE(0x44, 0x00, 0, 1, 0x07, 0x07), + ENTRANCE(0x44, 0x00, 0, 1, 0x07, 0x07), ENTRANCE(0x44, 0x00, 0, 1, 0x0D, 0x02), + ENTRANCE(0x44, 0x00, 0, 1, 0x0D, 0x02), ENTRANCE(0x44, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x4E, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x4E, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x4E, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x4E, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x6B, 0x00, 0, 1, 0x22, 0x22), ENTRANCE(0x6B, 0x00, 0, 1, 0x22, 0x22), + ENTRANCE(0x6B, 0x00, 0, 1, 0x22, 0x22), ENTRANCE(0x6B, 0x00, 0, 1, 0x22, 0x22), + ENTRANCE(0x45, 0x00, 0, 1, 0x22, 0x04), ENTRANCE(0x46, 0x00, 0, 1, 0x22, 0x04), + ENTRANCE(0x45, 0x00, 0, 1, 0x22, 0x04), ENTRANCE(0x46, 0x00, 0, 1, 0x22, 0x04), + ENTRANCE(0x4D, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x4D, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x4D, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x4D, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x06, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x06, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x06, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x06, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x06, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x06, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x09, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x09, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x09, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x09, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x09, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x17, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x17, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x17, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x17, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x17, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x17, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x17, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x65, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x65, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x65, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x65, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x08, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x08, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x08, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x08, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x27, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x27, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x27, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x27, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x47, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x47, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x47, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x47, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x47, 0x00, 0, 1, 0x0A, 0x0A), ENTRANCE(0x47, 0x00, 0, 1, 0x02, 0x0A), + ENTRANCE(0x47, 0x00, 1, 1, 0x0A, 0x0A), ENTRANCE(0x47, 0x00, 0, 1, 0x0B, 0x0B), + ENTRANCE(0x47, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x47, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x47, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x47, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x47, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x1E, 0x00, 1, 1, 0x03, 0x03), + ENTRANCE(0x1F, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x1E, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x1F, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x20, 0x00, 1, 1, 0x03, 0x03), + ENTRANCE(0x21, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x22, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x22, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x20, 0x00, 0, 1, 0x08, 0x08), + ENTRANCE(0x67, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x2C, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x2C, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x2C, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x2C, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x34, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x34, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x34, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x34, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x34, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x34, 0x00, 0, 1, 0x10, 0x10), ENTRANCE(0x2D, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x2D, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x2D, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x2D, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x01, 0x01, 1, 0, 0x02, 0x02), + ENTRANCE(0x01, 0x01, 1, 0, 0x02, 0x02), ENTRANCE(0x01, 0x01, 1, 0, 0x02, 0x02), + ENTRANCE(0x01, 0x01, 1, 0, 0x02, 0x02), ENTRANCE(0x26, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x26, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x26, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x26, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x51, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x51, 0x00, 0, 1, 0x21, 0x21), ENTRANCE(0x51, 0x00, 0, 1, 0x21, 0x21), + ENTRANCE(0x51, 0x00, 0, 1, 0x23, 0x23), ENTRANCE(0x51, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x51, 0x00, 0, 1, 0x23, 0x23), + ENTRANCE(0x51, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x51, 0x00, 0, 1, 0x29, 0x29), + ENTRANCE(0x51, 0x00, 1, 1, 0x03, 0x03), ENTRANCE(0x52, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x52, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x52, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x00, 0, 1, 0x26, 0x26), + ENTRANCE(0x52, 0x00, 0, 1, 0x21, 0x21), ENTRANCE(0x52, 0x00, 1, 1, 0x21, 0x21), + ENTRANCE(0x52, 0x00, 0, 1, 0x21, 0x21), ENTRANCE(0x52, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x53, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x53, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x53, 0x00, 0, 1, 0x04, 0x02), ENTRANCE(0x53, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x54, 0x00, 1, 1, 0x03, 0x03), ENTRANCE(0x54, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x54, 0x00, 1, 1, 0x03, 0x03), ENTRANCE(0x54, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x55, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x55, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x55, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x55, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x55, 0x00, 1, 1, 0x0A, 0x0A), ENTRANCE(0x55, 0x00, 0, 1, 0x0A, 0x0A), + ENTRANCE(0x55, 0x00, 1, 1, 0x0A, 0x0A), ENTRANCE(0x55, 0x00, 0, 1, 0x0D, 0x0A), + ENTRANCE(0x55, 0x00, 0, 1, 0x0A, 0x0A), ENTRANCE(0x55, 0x00, 0, 1, 0x0A, 0x0A), + ENTRANCE(0x55, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x55, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x55, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x55, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x56, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x56, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x56, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x56, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x56, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x56, 0x00, 0, 1, 0x00, 0x00), + ENTRANCE(0x57, 0x00, 1, 1, 0x03, 0x03), ENTRANCE(0x57, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x57, 0x00, 1, 1, 0x03, 0x03), ENTRANCE(0x57, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x57, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x57, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x58, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x58, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x58, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x58, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x58, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x58, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x59, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x59, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x00, 0, 1, 0x0D, 0x00), ENTRANCE(0x59, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x59, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x5A, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x5A, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x5A, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x5A, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x5A, 0x00, 1, 1, 0x0C, 0x0A), + ENTRANCE(0x5A, 0x00, 1, 1, 0x0A, 0x0A), ENTRANCE(0x5A, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x5C, 0x00, 1, 1, 0x0F, 0x0F), + ENTRANCE(0x5C, 0x00, 1, 1, 0x0F, 0x0F), ENTRANCE(0x5C, 0x00, 1, 1, 0x0F, 0x0F), + ENTRANCE(0x5C, 0x00, 1, 1, 0x0F, 0x0F), ENTRANCE(0x5C, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x5C, 0x00, 1, 1, 0x0F, 0x0F), ENTRANCE(0x5D, 0x00, 1, 1, 0x03, 0x03), + ENTRANCE(0x5D, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x00, 1, 1, 0x03, 0x03), + ENTRANCE(0x5D, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x00, 1, 1, 0x21, 0x21), + ENTRANCE(0x5D, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x5E, 0x00, 1, 1, 0x0E, 0x0E), ENTRANCE(0x5E, 0x00, 1, 1, 0x0E, 0x0E), + ENTRANCE(0x5E, 0x00, 1, 1, 0x0E, 0x0E), ENTRANCE(0x5E, 0x00, 1, 1, 0x0E, 0x0E), + ENTRANCE(0x0E, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x5F, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x5F, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x64, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x64, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x64, 0x00, 0, 1, 0x04, 0x02), ENTRANCE(0x60, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x60, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x60, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x60, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x60, 0x00, 1, 1, 0x0A, 0x0A), + ENTRANCE(0x60, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x60, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x60, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x60, 0x00, 1, 1, 0x03, 0x03), + ENTRANCE(0x60, 0x00, 1, 1, 0x03, 0x03), ENTRANCE(0x61, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x61, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x62, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x62, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x62, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x62, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x62, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x62, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x58, 0x03, 0, 1, 0x00, 0x00), + ENTRANCE(0x58, 0x03, 0, 1, 0x00, 0x00), ENTRANCE(0x58, 0x03, 0, 1, 0x00, 0x00), + ENTRANCE(0x58, 0x03, 0, 1, 0x00, 0x00), ENTRANCE(0x63, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x63, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x63, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x63, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x63, 0x00, 0, 1, 0x20, 0x20), + ENTRANCE(0x63, 0x00, 0, 1, 0x2A, 0x2A), ENTRANCE(0x63, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x63, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x63, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x63, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x04, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x04, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x04, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x04, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x03, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x03, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x03, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x03, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x42, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x42, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x42, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x42, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x23, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x24, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x25, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x25, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x04, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x04, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x04, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x04, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x51, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x02, 1, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x51, 0x02, 1, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x51, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x51, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x51, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x04, 1, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x04, 1, 1, 0x02, 0x02), ENTRANCE(0x51, 0x04, 1, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x04, 1, 1, 0x02, 0x02), ENTRANCE(0x51, 0x05, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x05, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x52, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x52, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x52, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x52, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x54, 0x01, 1, 1, 0x03, 0x03), + ENTRANCE(0x54, 0x01, 1, 1, 0x03, 0x03), ENTRANCE(0x54, 0x01, 1, 1, 0x03, 0x03), + ENTRANCE(0x54, 0x01, 1, 1, 0x03, 0x03), ENTRANCE(0x54, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x54, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x54, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x54, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x58, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x58, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x58, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x58, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x5A, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x5A, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x5A, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x5A, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x02, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x02, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x60, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x60, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x60, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x60, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x60, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x60, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x60, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x60, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x62, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x62, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x62, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x62, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x38, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x38, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x38, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x38, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x1A, 0x05, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x05, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x05, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x05, 1, 1, 0x02, 0x02), ENTRANCE(0x20, 0x08, 0, 1, 0x04, 0x02), + ENTRANCE(0x21, 0x08, 0, 1, 0x04, 0x02), ENTRANCE(0x22, 0x08, 0, 1, 0x04, 0x02), + ENTRANCE(0x22, 0x08, 0, 1, 0x04, 0x02), ENTRANCE(0x20, 0x09, 0, 1, 0x04, 0x02), + ENTRANCE(0x21, 0x09, 0, 1, 0x04, 0x02), ENTRANCE(0x22, 0x09, 0, 1, 0x04, 0x02), + ENTRANCE(0x22, 0x09, 0, 1, 0x04, 0x02), ENTRANCE(0x20, 0x0A, 0, 1, 0x04, 0x02), + ENTRANCE(0x21, 0x0A, 0, 1, 0x04, 0x02), ENTRANCE(0x22, 0x0A, 0, 1, 0x04, 0x02), + ENTRANCE(0x22, 0x0A, 0, 1, 0x04, 0x02), ENTRANCE(0x54, 0x03, 1, 1, 0x03, 0x03), + ENTRANCE(0x54, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x54, 0x03, 1, 1, 0x03, 0x03), + ENTRANCE(0x54, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x54, 0x04, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x54, 0x04, 0, 1, 0x2C, 0x2C), ENTRANCE(0x54, 0x04, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x54, 0x04, 0, 1, 0x2C, 0x2C), ENTRANCE(0x5C, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x5C, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x5C, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x5C, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x5C, 0x02, 0, 0, 0x03, 0x03), + ENTRANCE(0x5C, 0x02, 0, 0, 0x02, 0x02), ENTRANCE(0x5C, 0x02, 0, 0, 0x03, 0x03), + ENTRANCE(0x5C, 0x02, 0, 0, 0x02, 0x02), ENTRANCE(0x5C, 0x03, 0, 0, 0x03, 0x03), + ENTRANCE(0x5C, 0x03, 0, 0, 0x02, 0x02), ENTRANCE(0x5C, 0x03, 0, 0, 0x03, 0x03), + ENTRANCE(0x5C, 0x03, 0, 0, 0x02, 0x02), ENTRANCE(0x5C, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x5C, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x5C, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x5C, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x5C, 0x05, 0, 1, 0x03, 0x03), + ENTRANCE(0x5C, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x5C, 0x05, 0, 1, 0x03, 0x03), + ENTRANCE(0x5C, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x5C, 0x06, 1, 0, 0x0F, 0x0F), + ENTRANCE(0x5C, 0x06, 1, 0, 0x0F, 0x0F), ENTRANCE(0x5C, 0x06, 1, 0, 0x0F, 0x0F), + ENTRANCE(0x5C, 0x06, 1, 0, 0x0F, 0x0F), ENTRANCE(0x51, 0x06, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x06, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x07, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x07, 0, 1, 0x02, 0x02), ENTRANCE(0x51, 0x07, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x07, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x03, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x03, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x03, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x03, 0, 1, 0x04, 0x02), ENTRANCE(0x53, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x53, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x53, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x53, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x55, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x55, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x55, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x55, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x55, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x55, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x55, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x55, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x55, 0x03, 0, 1, 0x04, 0x04), + ENTRANCE(0x55, 0x03, 0, 1, 0x04, 0x04), ENTRANCE(0x55, 0x03, 0, 1, 0x04, 0x04), + ENTRANCE(0x55, 0x03, 0, 1, 0x04, 0x04), ENTRANCE(0x56, 0x01, 0, 1, 0x12, 0x12), + ENTRANCE(0x56, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x56, 0x01, 0, 1, 0x12, 0x12), + ENTRANCE(0x56, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x57, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x57, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x57, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x57, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x57, 0x02, 0, 1, 0x13, 0x13), + ENTRANCE(0x57, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x57, 0x02, 0, 1, 0x13, 0x13), + ENTRANCE(0x57, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x59, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x59, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x59, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x59, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x59, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x59, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x5A, 0x02, 1, 1, 0x03, 0x03), + ENTRANCE(0x5A, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x5A, 0x02, 1, 1, 0x03, 0x03), + ENTRANCE(0x5A, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x5A, 0x03, 1, 1, 0x03, 0x03), + ENTRANCE(0x5A, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x5A, 0x03, 1, 1, 0x03, 0x03), + ENTRANCE(0x5A, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x5D, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x5D, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x5D, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x02, 0, 1, 0x03, 0x03), + ENTRANCE(0x5D, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x03, 0, 1, 0x03, 0x03), + ENTRANCE(0x5D, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x03, 0, 1, 0x03, 0x03), + ENTRANCE(0x5D, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x5F, 0x01, 0, 1, 0x03, 0x03), + ENTRANCE(0x5F, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x64, 0x01, 0, 1, 0x05, 0x05), + ENTRANCE(0x64, 0x01, 0, 1, 0x05, 0x05), ENTRANCE(0x5F, 0x01, 0, 1, 0x00, 0x00), + ENTRANCE(0x60, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x60, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x60, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x60, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x03, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x03, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x03, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x03, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x00, 0x01, 1, 0, 0x02, 0x02), ENTRANCE(0x00, 0x01, 1, 0, 0x02, 0x02), + ENTRANCE(0x00, 0x01, 1, 0, 0x02, 0x02), ENTRANCE(0x00, 0x01, 1, 0, 0x02, 0x02), + ENTRANCE(0x0E, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x03, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x03, 1, 1, 0x02, 0x02), + ENTRANCE(0x20, 0x01, 0, 1, 0x03, 0x03), ENTRANCE(0x21, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x22, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x22, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x20, 0x02, 0, 1, 0x03, 0x03), ENTRANCE(0x21, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x22, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x22, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x20, 0x03, 1, 1, 0x03, 0x03), ENTRANCE(0x21, 0x03, 1, 1, 0x02, 0x02), + ENTRANCE(0x22, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x22, 0x03, 1, 1, 0x02, 0x02), + ENTRANCE(0x55, 0x04, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x04, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x04, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x04, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x05, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x05, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x05, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x05, 0, 0, 0x04, 0x04), + ENTRANCE(0x1B, 0x02, 0, 0, 0x02, 0x02), ENTRANCE(0x1C, 0x02, 0, 0, 0x02, 0x02), + ENTRANCE(0x1D, 0x02, 0, 0, 0x02, 0x02), ENTRANCE(0x1D, 0x02, 0, 0, 0x02, 0x02), + ENTRANCE(0x34, 0x01, 0, 1, 0x04, 0x04), ENTRANCE(0x34, 0x01, 0, 1, 0x04, 0x04), + ENTRANCE(0x34, 0x01, 0, 1, 0x04, 0x04), ENTRANCE(0x34, 0x01, 0, 1, 0x04, 0x04), + ENTRANCE(0x1B, 0x01, 0, 1, 0x03, 0x03), ENTRANCE(0x1C, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x1D, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x1D, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x51, 0x08, 1, 1, 0x03, 0x03), ENTRANCE(0x51, 0x08, 1, 1, 0x02, 0x02), + ENTRANCE(0x51, 0x08, 1, 1, 0x03, 0x03), ENTRANCE(0x51, 0x08, 1, 1, 0x02, 0x02), + ENTRANCE(0x51, 0x09, 0, 1, 0x03, 0x03), ENTRANCE(0x51, 0x09, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x09, 0, 1, 0x03, 0x03), ENTRANCE(0x51, 0x09, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x0A, 0, 1, 0x03, 0x03), ENTRANCE(0x51, 0x0A, 0, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x0A, 0, 1, 0x03, 0x03), ENTRANCE(0x51, 0x0A, 0, 1, 0x03, 0x03), + ENTRANCE(0x55, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x55, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x55, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x55, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x51, 0x0B, 0, 1, 0x05, 0x05), ENTRANCE(0x51, 0x0B, 0, 1, 0x04, 0x02), + ENTRANCE(0x51, 0x0B, 0, 1, 0x05, 0x05), ENTRANCE(0x51, 0x0B, 0, 1, 0x04, 0x02), + ENTRANCE(0x51, 0x0C, 0, 1, 0x05, 0x05), ENTRANCE(0x51, 0x0C, 0, 1, 0x04, 0x02), + ENTRANCE(0x51, 0x0C, 0, 1, 0x05, 0x05), ENTRANCE(0x51, 0x0C, 0, 1, 0x04, 0x02), + ENTRANCE(0x51, 0x0D, 0, 1, 0x05, 0x05), ENTRANCE(0x51, 0x0D, 0, 1, 0x04, 0x02), + ENTRANCE(0x51, 0x0D, 0, 1, 0x05, 0x05), ENTRANCE(0x51, 0x0D, 0, 1, 0x04, 0x02), + ENTRANCE(0x45, 0x01, 0, 1, 0x03, 0x03), ENTRANCE(0x46, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x45, 0x01, 0, 1, 0x03, 0x03), ENTRANCE(0x46, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x1E, 0x01, 1, 1, 0x03, 0x03), ENTRANCE(0x1F, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x1E, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x1F, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x20, 0x04, 1, 1, 0x03, 0x03), ENTRANCE(0x21, 0x04, 1, 1, 0x02, 0x02), + ENTRANCE(0x22, 0x04, 1, 1, 0x02, 0x02), ENTRANCE(0x22, 0x04, 1, 1, 0x02, 0x02), + ENTRANCE(0x20, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x21, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x22, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x22, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x52, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x04, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x04, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x01, 0, 0, 0x03, 0x03), ENTRANCE(0x63, 0x01, 0, 0, 0x02, 0x02), + ENTRANCE(0x63, 0x01, 0, 0, 0x03, 0x03), ENTRANCE(0x63, 0x01, 0, 0, 0x02, 0x02), + ENTRANCE(0x07, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x07, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x07, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x07, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x07, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x07, 0x02, 1, 1, 0x02, 0x02), + ENTRANCE(0x07, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x07, 0x02, 1, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x05, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x05, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x06, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x06, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x07, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x07, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x08, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x08, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x08, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x08, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x02, 0, 1, 0x0A, 0x0A), ENTRANCE(0x43, 0x02, 0, 1, 0x0A, 0x0A), + ENTRANCE(0x43, 0x02, 0, 1, 0x0A, 0x0A), ENTRANCE(0x43, 0x02, 0, 1, 0x0A, 0x0A), + ENTRANCE(0x44, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x44, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x44, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x44, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x09, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x09, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x09, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x09, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x0A, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x0A, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x0A, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x0A, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x0B, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x0B, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x0B, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x0B, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x0C, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x0C, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x0C, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x0C, 0, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x02, 0, 1, 0x03, 0x03), ENTRANCE(0x63, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x02, 0, 1, 0x03, 0x03), ENTRANCE(0x63, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x63, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x63, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x42, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x42, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x42, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x42, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x56, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x47, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x42, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x42, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x42, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x42, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x42, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x06, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x06, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x06, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x06, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x36, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x36, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x36, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x36, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x2A, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x2A, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x2A, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x2A, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x13, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x13, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x13, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x13, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x15, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x15, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x15, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x15, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x57, 0x06, 0, 1, 0x04, 0x02), + ENTRANCE(0x57, 0x06, 0, 1, 0x04, 0x02), ENTRANCE(0x57, 0x06, 0, 1, 0x04, 0x02), + ENTRANCE(0x57, 0x06, 0, 1, 0x04, 0x02), ENTRANCE(0x3A, 0x00, 0, 1, 0x02, 0x20), + ENTRANCE(0x3A, 0x00, 0, 1, 0x02, 0x20), ENTRANCE(0x3A, 0x00, 0, 1, 0x02, 0x20), + ENTRANCE(0x3A, 0x00, 0, 1, 0x02, 0x20), ENTRANCE(0x51, 0x0E, 1, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x0E, 1, 1, 0x03, 0x03), ENTRANCE(0x51, 0x0E, 1, 1, 0x03, 0x03), + ENTRANCE(0x51, 0x0E, 1, 1, 0x03, 0x03), ENTRANCE(0x3B, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x3B, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x3B, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x3B, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x3B, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x3B, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x3B, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x3F, 0x00, 0, 1, 0x02, 0x26), ENTRANCE(0x3F, 0x00, 0, 1, 0x02, 0x26), + ENTRANCE(0x3F, 0x00, 0, 1, 0x02, 0x26), ENTRANCE(0x3F, 0x00, 0, 1, 0x02, 0x26), + ENTRANCE(0x43, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x58, 0x04, 0, 1, 0x2C, 0x2C), ENTRANCE(0x58, 0x04, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x58, 0x04, 0, 1, 0x2C, 0x2C), ENTRANCE(0x58, 0x04, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x1A, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x02, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x02, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x03, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x03, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x03, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x04, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x04, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x04, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x04, 1, 1, 0x02, 0x02), + ENTRANCE(0x55, 0x07, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x07, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x07, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x07, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x08, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x08, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x08, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x08, 0, 0, 0x04, 0x04), + ENTRANCE(0x5F, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x5F, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x64, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x64, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x5F, 0x02, 0, 1, 0x00, 0x00), ENTRANCE(0x52, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x06, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x06, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x06, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x06, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x07, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x07, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x07, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x07, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x08, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x08, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x08, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x08, 0, 1, 0x04, 0x02), ENTRANCE(0x53, 0x02, 0, 1, 0x04, 0x02), + ENTRANCE(0x53, 0x02, 0, 1, 0x04, 0x02), ENTRANCE(0x53, 0x02, 0, 1, 0x04, 0x02), + ENTRANCE(0x53, 0x02, 0, 1, 0x04, 0x02), ENTRANCE(0x53, 0x03, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x03, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x04, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x04, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x04, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x04, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x05, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x05, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x05, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x05, 0, 1, 0x03, 0x03), ENTRANCE(0x5E, 0x01, 1, 1, 0x0E, 0x0E), + ENTRANCE(0x5E, 0x01, 1, 1, 0x0E, 0x0E), ENTRANCE(0x5E, 0x01, 1, 1, 0x0E, 0x0E), + ENTRANCE(0x5E, 0x01, 1, 1, 0x0E, 0x0E), ENTRANCE(0x5E, 0x02, 0, 1, 0x0E, 0x0E), + ENTRANCE(0x5E, 0x02, 0, 1, 0x0E, 0x0E), ENTRANCE(0x5E, 0x02, 0, 1, 0x0E, 0x0E), + ENTRANCE(0x5E, 0x02, 0, 1, 0x0E, 0x0E), ENTRANCE(0x3C, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x3C, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x3C, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x3C, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x3D, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x3D, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x3D, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x3D, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x3D, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x3D, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x3D, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x63, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x63, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x63, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x2E, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x2E, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x2E, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x2E, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x2F, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x2F, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x2F, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x2F, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x30, 0x00, 0, 0, 0x04, 0x20), ENTRANCE(0x30, 0x00, 0, 0, 0x04, 0x20), + ENTRANCE(0x30, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x30, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x31, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x31, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x31, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x31, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x1E, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x1F, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x1E, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x1F, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x32, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x32, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x32, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x32, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x05, 0, 1, 0x03, 0x03), ENTRANCE(0x59, 0x05, 0, 1, 0x03, 0x03), + ENTRANCE(0x59, 0x05, 0, 1, 0x03, 0x03), ENTRANCE(0x59, 0x05, 0, 1, 0x03, 0x03), + ENTRANCE(0x35, 0x00, 0, 1, 0x04, 0x02), ENTRANCE(0x35, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x35, 0x00, 0, 1, 0x04, 0x02), ENTRANCE(0x35, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x37, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x37, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x37, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x37, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x39, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x39, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x39, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x39, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x5D, 0x0D, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x0D, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x0D, 0, 1, 0x03, 0x03), ENTRANCE(0x5D, 0x0D, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x0E, 0, 1, 0x03, 0x05), ENTRANCE(0x5D, 0x0E, 0, 1, 0x02, 0x04), + ENTRANCE(0x5D, 0x0E, 0, 1, 0x03, 0x05), ENTRANCE(0x5D, 0x0E, 0, 1, 0x02, 0x04), + ENTRANCE(0x5D, 0x0F, 1, 1, 0x0F, 0x0F), ENTRANCE(0x5D, 0x0F, 1, 1, 0x0F, 0x0F), + ENTRANCE(0x5D, 0x0F, 1, 1, 0x0F, 0x0F), ENTRANCE(0x5D, 0x0F, 1, 1, 0x0F, 0x0F), + ENTRANCE(0x5D, 0x10, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x10, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x10, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x10, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x11, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x11, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x11, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x11, 0, 1, 0x02, 0x02), + ENTRANCE(0x20, 0x06, 0, 1, 0x04, 0x02), ENTRANCE(0x21, 0x06, 0, 1, 0x04, 0x02), + ENTRANCE(0x22, 0x06, 0, 1, 0x04, 0x02), ENTRANCE(0x22, 0x06, 0, 1, 0x04, 0x02), + ENTRANCE(0x20, 0x07, 0, 1, 0x04, 0x02), ENTRANCE(0x21, 0x07, 0, 1, 0x04, 0x02), + ENTRANCE(0x22, 0x07, 0, 1, 0x04, 0x02), ENTRANCE(0x22, 0x07, 0, 1, 0x04, 0x02), + ENTRANCE(0x1E, 0x02, 0, 1, 0x04, 0x02), ENTRANCE(0x1F, 0x02, 0, 1, 0x04, 0x02), + ENTRANCE(0x1E, 0x02, 0, 1, 0x03, 0x03), ENTRANCE(0x1F, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x58, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x58, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x58, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x58, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x57, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x57, 0x03, 0, 1, 0x03, 0x03), + ENTRANCE(0x57, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x57, 0x03, 0, 1, 0x03, 0x03), + ENTRANCE(0x57, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x57, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x57, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x57, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x5A, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x5A, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x5A, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x5A, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x59, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x59, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x59, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x59, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x59, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x59, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x04, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x04, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x04, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x04, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x05, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x05, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x05, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x05, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x06, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x06, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x06, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x06, 1, 1, 0x02, 0x02), + ENTRANCE(0x30, 0x01, 0, 0, 0x04, 0x20), ENTRANCE(0x30, 0x01, 0, 0, 0x04, 0x20), + ENTRANCE(0x30, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x30, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x30, 0x02, 0, 0, 0x04, 0x20), ENTRANCE(0x30, 0x02, 0, 0, 0x04, 0x20), + ENTRANCE(0x30, 0x02, 0, 1, 0x04, 0x20), ENTRANCE(0x30, 0x02, 0, 1, 0x04, 0x20), + ENTRANCE(0x06, 0x02, 0, 0, 0x02, 0x02), ENTRANCE(0x06, 0x02, 0, 0, 0x02, 0x02), + ENTRANCE(0x06, 0x02, 0, 0, 0x02, 0x02), ENTRANCE(0x06, 0x02, 0, 0, 0x02, 0x02), + ENTRANCE(0x06, 0x03, 0, 0, 0x02, 0x02), ENTRANCE(0x06, 0x03, 0, 0, 0x02, 0x02), + ENTRANCE(0x06, 0x03, 0, 0, 0x02, 0x02), ENTRANCE(0x06, 0x03, 0, 0, 0x02, 0x02), + ENTRANCE(0x06, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x06, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x06, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x06, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x62, 0x02, 0, 1, 0x04, 0x02), ENTRANCE(0x62, 0x02, 0, 1, 0x04, 0x02), + ENTRANCE(0x62, 0x02, 0, 1, 0x04, 0x02), ENTRANCE(0x62, 0x02, 0, 1, 0x04, 0x02), + ENTRANCE(0x4A, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x4A, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x4A, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x4A, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x4A, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x4A, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x4A, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x02, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x02, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x02, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x02, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x12, 0x00, 1, 0, 0x02, 0x02), + ENTRANCE(0x12, 0x00, 1, 0, 0x02, 0x02), ENTRANCE(0x12, 0x00, 1, 0, 0x02, 0x02), + ENTRANCE(0x12, 0x00, 1, 0, 0x02, 0x02), ENTRANCE(0x11, 0x00, 1, 0, 0x02, 0x02), + ENTRANCE(0x11, 0x00, 1, 0, 0x02, 0x02), ENTRANCE(0x11, 0x00, 1, 0, 0x02, 0x02), + ENTRANCE(0x11, 0x00, 1, 0, 0x02, 0x02), ENTRANCE(0x18, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x18, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x18, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x18, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x16, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x16, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x16, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x16, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x0A, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x0A, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x0A, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x0A, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x19, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x19, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x19, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x19, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x05, 0x01, 1, 1, 0x03, 0x02), + ENTRANCE(0x05, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x05, 0x01, 1, 1, 0x03, 0x02), + ENTRANCE(0x05, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x0A, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x0A, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x0A, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x0A, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x0A, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x0A, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x0A, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x0A, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x63, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x63, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x63, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x63, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x28, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x28, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x28, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x28, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x29, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x29, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x29, 0x00, 0, 1, 0x04, 0x04), + ENTRANCE(0x29, 0x00, 0, 1, 0x04, 0x04), ENTRANCE(0x2B, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x2B, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x2B, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x2B, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x1A, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x55, 0x09, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x09, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x09, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x09, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x0A, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x0A, 0, 0, 0x04, 0x04), ENTRANCE(0x55, 0x0A, 0, 0, 0x04, 0x04), + ENTRANCE(0x55, 0x0A, 0, 0, 0x04, 0x04), ENTRANCE(0x52, 0x09, 0, 1, 0x04, 0x04), + ENTRANCE(0x52, 0x09, 0, 1, 0x04, 0x04), ENTRANCE(0x52, 0x09, 0, 1, 0x04, 0x04), + ENTRANCE(0x52, 0x09, 0, 1, 0x04, 0x04), ENTRANCE(0x48, 0x00, 0, 1, 0x02, 0x26), + ENTRANCE(0x48, 0x00, 0, 1, 0x02, 0x26), ENTRANCE(0x48, 0x00, 0, 1, 0x02, 0x26), + ENTRANCE(0x48, 0x00, 0, 1, 0x02, 0x26), ENTRANCE(0x48, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x48, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x48, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x48, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x55, 0x0B, 0, 1, 0x04, 0x02), + ENTRANCE(0x55, 0x0B, 0, 1, 0x04, 0x02), ENTRANCE(0x55, 0x0B, 0, 1, 0x04, 0x02), + ENTRANCE(0x55, 0x0B, 0, 1, 0x04, 0x02), ENTRANCE(0x60, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x60, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x60, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x60, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x49, 0x00, 0, 1, 0x02, 0x20), + ENTRANCE(0x49, 0x00, 0, 1, 0x02, 0x20), ENTRANCE(0x49, 0x00, 0, 1, 0x02, 0x20), + ENTRANCE(0x49, 0x00, 0, 1, 0x02, 0x20), ENTRANCE(0x52, 0x0A, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x0A, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x0A, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x0A, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x00, 0, 1, 0x04, 0x02), + ENTRANCE(0x23, 0x01, 0, 1, 0x04, 0x02), ENTRANCE(0x24, 0x01, 0, 1, 0x04, 0x02), + ENTRANCE(0x25, 0x01, 0, 1, 0x04, 0x02), ENTRANCE(0x25, 0x01, 0, 1, 0x04, 0x02), + ENTRANCE(0x51, 0x0F, 0, 1, 0x05, 0x05), ENTRANCE(0x51, 0x0F, 0, 1, 0x04, 0x02), + ENTRANCE(0x51, 0x0F, 0, 1, 0x05, 0x05), ENTRANCE(0x51, 0x0F, 0, 1, 0x04, 0x02), + ENTRANCE(0x60, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x60, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x60, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x60, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x5F, 0x04, 0, 1, 0x03, 0x03), ENTRANCE(0x5F, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x64, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x64, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x07, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x07, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x08, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x08, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x08, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x08, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x09, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x09, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x09, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x09, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x0A, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x0A, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x0A, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x0A, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x0B, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x0B, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x0B, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x0B, 0, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x07, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x07, 1, 1, 0x02, 0x02), + ENTRANCE(0x0E, 0x07, 1, 1, 0x02, 0x02), ENTRANCE(0x0E, 0x07, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x01, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x01, 1, 1, 0x02, 0x02), + ENTRANCE(0x3B, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x3B, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x3B, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x3B, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x3B, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x3B, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x3B, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x3B, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x06, 0, 0, 0x02, 0x26), ENTRANCE(0x63, 0x06, 0, 0, 0x02, 0x26), + ENTRANCE(0x63, 0x06, 0, 0, 0x02, 0x26), ENTRANCE(0x63, 0x06, 0, 0, 0x02, 0x26), + ENTRANCE(0x63, 0x07, 0, 0, 0x2E, 0x2E), ENTRANCE(0x63, 0x07, 0, 0, 0x2E, 0x2E), + ENTRANCE(0x63, 0x07, 0, 0, 0x2E, 0x2E), ENTRANCE(0x63, 0x07, 0, 0, 0x2E, 0x2E), + ENTRANCE(0x5B, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x5B, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x06, 0, 1, 0x2C, 0x2C), ENTRANCE(0x5B, 0x06, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x5B, 0x06, 0, 1, 0x2C, 0x2C), ENTRANCE(0x5B, 0x06, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x5B, 0x07, 0, 1, 0x2C, 0x2C), ENTRANCE(0x5B, 0x07, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x5B, 0x07, 0, 1, 0x2C, 0x2C), ENTRANCE(0x5B, 0x07, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x5B, 0x08, 0, 0, 0x02, 0x02), ENTRANCE(0x5B, 0x08, 0, 0, 0x02, 0x02), + ENTRANCE(0x5B, 0x08, 0, 0, 0x02, 0x02), ENTRANCE(0x5B, 0x08, 0, 0, 0x02, 0x02), + ENTRANCE(0x62, 0x03, 0, 1, 0x2C, 0x2C), ENTRANCE(0x62, 0x03, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x62, 0x03, 0, 1, 0x2C, 0x2C), ENTRANCE(0x62, 0x03, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x57, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x57, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x57, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x57, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x07, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x07, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x07, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x07, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x52, 0x0B, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x0B, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x0B, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x0B, 0, 1, 0x04, 0x02), + ENTRANCE(0x3B, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x3B, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x3B, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x3B, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x5F, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x5F, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x64, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x64, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x5F, 0x03, 0, 1, 0x00, 0x00), ENTRANCE(0x52, 0x0C, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x0C, 0, 1, 0x04, 0x02), ENTRANCE(0x52, 0x0C, 0, 1, 0x04, 0x02), + ENTRANCE(0x52, 0x0C, 0, 1, 0x04, 0x02), ENTRANCE(0x48, 0x02, 1, 1, 0x04, 0x20), + ENTRANCE(0x48, 0x02, 1, 1, 0x04, 0x20), ENTRANCE(0x48, 0x02, 1, 1, 0x04, 0x20), + ENTRANCE(0x48, 0x02, 1, 1, 0x04, 0x20), ENTRANCE(0x4B, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x4B, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x4B, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x4B, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x53, 0x06, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x06, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x06, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x06, 0, 1, 0x03, 0x03), ENTRANCE(0x51, 0x10, 0, 1, 0x0B, 0x0B), + ENTRANCE(0x51, 0x10, 0, 1, 0x0B, 0x0B), ENTRANCE(0x51, 0x10, 0, 1, 0x0B, 0x0B), + ENTRANCE(0x51, 0x10, 0, 1, 0x0B, 0x0B), ENTRANCE(0x52, 0x0D, 0, 1, 0x03, 0x03), + ENTRANCE(0x52, 0x0D, 0, 1, 0x02, 0x02), ENTRANCE(0x52, 0x0D, 0, 1, 0x03, 0x03), + ENTRANCE(0x52, 0x0D, 0, 1, 0x02, 0x02), ENTRANCE(0x4F, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x4F, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x4F, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x4F, 0x00, 0, 1, 0x03, 0x03), ENTRANCE(0x4F, 0x00, 0, 1, 0x03, 0x03), + ENTRANCE(0x1A, 0x06, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x06, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x06, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x06, 1, 1, 0x02, 0x02), + ENTRANCE(0x66, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x66, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x66, 0x00, 0, 1, 0x02, 0x02), ENTRANCE(0x66, 0x00, 0, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x07, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x07, 1, 1, 0x02, 0x02), + ENTRANCE(0x1A, 0x07, 1, 1, 0x02, 0x02), ENTRANCE(0x1A, 0x07, 1, 1, 0x02, 0x02), + ENTRANCE(0x32, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x32, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x32, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x32, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x2C, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x2C, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x2C, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x2C, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x33, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x33, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x33, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x33, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x0D, 0x01, 0, 0, 0x04, 0x02), ENTRANCE(0x0D, 0x01, 0, 0, 0x04, 0x02), + ENTRANCE(0x0D, 0x01, 0, 0, 0x04, 0x02), ENTRANCE(0x0D, 0x01, 0, 0, 0x04, 0x02), + ENTRANCE(0x0D, 0x02, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x02, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x02, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x02, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x03, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x03, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x03, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x03, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x04, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x04, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x05, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x05, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x06, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x06, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x06, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x06, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x07, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x07, 0, 1, 0x04, 0x02), + ENTRANCE(0x0D, 0x07, 0, 1, 0x04, 0x02), ENTRANCE(0x0D, 0x07, 0, 1, 0x04, 0x02), + ENTRANCE(0x50, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x50, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x50, 0x00, 0, 1, 0x04, 0x20), ENTRANCE(0x50, 0x00, 0, 1, 0x04, 0x20), + ENTRANCE(0x52, 0x0E, 0, 1, 0x03, 0x03), ENTRANCE(0x52, 0x0E, 0, 1, 0x02, 0x02), + ENTRANCE(0x52, 0x0E, 0, 1, 0x03, 0x03), ENTRANCE(0x52, 0x0E, 0, 1, 0x02, 0x02), + ENTRANCE(0x63, 0x08, 0, 0, 0x20, 0x20), ENTRANCE(0x63, 0x08, 0, 0, 0x20, 0x20), + ENTRANCE(0x63, 0x08, 0, 0, 0x20, 0x20), ENTRANCE(0x63, 0x08, 0, 0, 0x20, 0x20), + ENTRANCE(0x63, 0x09, 0, 0, 0x02, 0x02), ENTRANCE(0x63, 0x09, 0, 0, 0x02, 0x02), + ENTRANCE(0x63, 0x09, 0, 0, 0x02, 0x02), ENTRANCE(0x63, 0x09, 0, 0, 0x02, 0x02), + ENTRANCE(0x57, 0x07, 0, 1, 0x2C, 0x2C), ENTRANCE(0x57, 0x07, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x57, 0x07, 0, 1, 0x2C, 0x2C), ENTRANCE(0x57, 0x07, 0, 1, 0x2C, 0x2C), + ENTRANCE(0x61, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x61, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x61, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x53, 0x07, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x07, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x07, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x07, 0, 1, 0x03, 0x03), + ENTRANCE(0x0F, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x0F, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x0F, 0x00, 1, 1, 0x02, 0x02), ENTRANCE(0x0F, 0x00, 1, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x0C, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x0C, 0, 1, 0x02, 0x02), + ENTRANCE(0x0C, 0x0C, 0, 1, 0x02, 0x02), ENTRANCE(0x0C, 0x0C, 0, 1, 0x02, 0x02), + ENTRANCE(0x41, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x41, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x41, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x41, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x3D, 0x01, 0, 1, 0x04, 0x04), ENTRANCE(0x3D, 0x01, 0, 1, 0x04, 0x04), + ENTRANCE(0x3D, 0x01, 0, 1, 0x04, 0x04), ENTRANCE(0x3D, 0x01, 0, 1, 0x04, 0x04), + ENTRANCE(0x5C, 0x07, 0, 1, 0x03, 0x03), ENTRANCE(0x5C, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x5C, 0x07, 0, 1, 0x03, 0x03), ENTRANCE(0x5C, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x53, 0x08, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x08, 0, 1, 0x03, 0x03), + ENTRANCE(0x53, 0x08, 0, 1, 0x03, 0x03), ENTRANCE(0x53, 0x08, 0, 1, 0x03, 0x03), + ENTRANCE(0x03, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x03, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x03, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x03, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x3D, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x3D, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x3D, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x3D, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x05, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x05, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x51, 0x11, 0, 1, 0x03, 0x03), ENTRANCE(0x51, 0x11, 0, 1, 0x02, 0x02), + ENTRANCE(0x51, 0x11, 0, 1, 0x03, 0x03), ENTRANCE(0x51, 0x11, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x02, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x03, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x03, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x04, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x04, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x05, 0, 1, 0x02, 0x03), ENTRANCE(0x3E, 0x05, 0, 1, 0x02, 0x03), + ENTRANCE(0x3E, 0x05, 0, 1, 0x02, 0x03), ENTRANCE(0x3E, 0x05, 0, 1, 0x02, 0x03), + ENTRANCE(0x3E, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x06, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x06, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x07, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x07, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x08, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x08, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x08, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x08, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x09, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x09, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x09, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x09, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x0A, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x0A, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x0A, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x0A, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x0B, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x0B, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x0B, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x0B, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x0C, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x0C, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x0C, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x0C, 0, 1, 0x02, 0x02), + ENTRANCE(0x37, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x37, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x37, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x37, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x08, 0x01, 0, 1, 0x04, 0x04), ENTRANCE(0x08, 0x01, 0, 1, 0x04, 0x04), + ENTRANCE(0x08, 0x01, 0, 1, 0x04, 0x04), ENTRANCE(0x08, 0x01, 0, 1, 0x04, 0x04), + ENTRANCE(0x4C, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x4C, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x4C, 0x01, 0, 1, 0x04, 0x20), ENTRANCE(0x4C, 0x01, 0, 1, 0x04, 0x20), + ENTRANCE(0x63, 0x0A, 0, 1, 0x04, 0x02), ENTRANCE(0x63, 0x0A, 0, 1, 0x04, 0x02), + ENTRANCE(0x63, 0x0A, 0, 1, 0x04, 0x02), ENTRANCE(0x63, 0x0A, 0, 1, 0x04, 0x02), + ENTRANCE(0x09, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x09, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x09, 0x01, 0, 1, 0x02, 0x02), ENTRANCE(0x09, 0x01, 0, 1, 0x02, 0x02), + ENTRANCE(0x52, 0x0F, 0, 1, 0x03, 0x03), ENTRANCE(0x52, 0x0F, 0, 1, 0x02, 0x02), + ENTRANCE(0x52, 0x0F, 0, 1, 0x03, 0x03), ENTRANCE(0x52, 0x0F, 0, 1, 0x02, 0x02), + ENTRANCE(0x5B, 0x09, 0, 0, 0x02, 0x02), ENTRANCE(0x5B, 0x09, 0, 0, 0x02, 0x02), + ENTRANCE(0x5B, 0x09, 0, 0, 0x02, 0x02), ENTRANCE(0x5B, 0x09, 0, 0, 0x02, 0x02), + ENTRANCE(0x4C, 0x02, 0, 1, 0x04, 0x20), ENTRANCE(0x4C, 0x02, 0, 1, 0x04, 0x20), + ENTRANCE(0x4C, 0x02, 0, 1, 0x04, 0x20), ENTRANCE(0x4C, 0x02, 0, 1, 0x04, 0x20), + ENTRANCE(0x55, 0x0C, 0, 1, 0x04, 0x02), ENTRANCE(0x55, 0x0C, 0, 1, 0x04, 0x02), + ENTRANCE(0x55, 0x0C, 0, 1, 0x04, 0x02), ENTRANCE(0x55, 0x0C, 0, 1, 0x04, 0x02), + ENTRANCE(0x17, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x17, 0x02, 1, 1, 0x02, 0x02), + ENTRANCE(0x17, 0x02, 1, 1, 0x02, 0x02), ENTRANCE(0x17, 0x02, 1, 1, 0x02, 0x02), + ENTRANCE(0x4A, 0x01, 0, 0, 0x03, 0x03), ENTRANCE(0x4A, 0x01, 0, 0, 0x02, 0x02), + ENTRANCE(0x4A, 0x01, 0, 0, 0x03, 0x03), ENTRANCE(0x4A, 0x01, 0, 0, 0x02, 0x02), + ENTRANCE(0x43, 0x07, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x43, 0x07, 0, 1, 0x02, 0x02), ENTRANCE(0x43, 0x07, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x12, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x12, 0, 1, 0x02, 0x02), + ENTRANCE(0x5D, 0x12, 0, 1, 0x02, 0x02), ENTRANCE(0x5D, 0x12, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x0D, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x0D, 0, 1, 0x02, 0x02), + ENTRANCE(0x3E, 0x0D, 0, 1, 0x02, 0x02), ENTRANCE(0x3E, 0x0D, 0, 1, 0x02, 0x02), + ENTRANCE(0x56, 0x02, 0, 1, 0x12, 0x12), ENTRANCE(0x56, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x56, 0x02, 0, 1, 0x12, 0x12), ENTRANCE(0x56, 0x02, 0, 1, 0x02, 0x02), + ENTRANCE(0x57, 0x08, 0, 1, 0x02, 0x02), ENTRANCE(0x57, 0x08, 0, 1, 0x02, 0x02), + ENTRANCE(0x57, 0x08, 0, 1, 0x02, 0x02), ENTRANCE(0x57, 0x08, 0, 1, 0x02, 0x02), + ENTRANCE(0x56, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x56, 0x03, 0, 1, 0x03, 0x03), + ENTRANCE(0x56, 0x03, 0, 1, 0x03, 0x03), ENTRANCE(0x56, 0x03, 0, 1, 0x03, 0x03), + ENTRANCE(0x57, 0x09, 0, 1, 0x03, 0x03), ENTRANCE(0x57, 0x09, 0, 1, 0x03, 0x03), + ENTRANCE(0x57, 0x09, 0, 1, 0x03, 0x03), ENTRANCE(0x57, 0x09, 0, 1, 0x03, 0x03), + ENTRANCE(0x5C, 0x08, 0, 1, 0x03, 0x03), ENTRANCE(0x5C, 0x08, 0, 1, 0x03, 0x03), + ENTRANCE(0x5C, 0x08, 0, 1, 0x03, 0x03), ENTRANCE(0x5C, 0x08, 0, 1, 0x03, 0x03), }; #define TITLED_SCENE(name, title, unk_10, config, unk_12) \ @@ -662,7 +927,7 @@ Gfx sDefaultDisplayList[] = { void func_800994A0(GlobalContext* globalCtx) { s16 computedEntranceIndex; - if (gSaveContext.night_flag) { + if (gSaveContext.nightFlag) { if (LINK_IS_CHILD) { computedEntranceIndex = globalCtx->nextEntranceIndex + 1; } else { @@ -676,7 +941,7 @@ void func_800994A0(GlobalContext* globalCtx) { } } - globalCtx->fadeOutTransition = gEntranceTable[computedEntranceIndex].fadeOutTransition; + globalCtx->fadeTransition = gEntranceTable[computedEntranceIndex].field & 0x7F; // Fade out } // Scene Draw Config 0 @@ -714,7 +979,7 @@ void func_800995DC(GlobalContext* globalCtx) { { s32 pad; } // Necessary to match stack usage - gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A2F8[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A2F8[gSaveContext.nightFlag])); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 4783); } @@ -756,7 +1021,7 @@ void func_80099878(GlobalContext* globalCtx) { Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 4905); gameplayFrames = globalCtx->gameplayFrames; - gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A300[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A300[gSaveContext.nightFlag])); gSPSegment(gfxCtx->polyOpa.p++, 0x09, SEGMENTED_TO_VIRTUAL(D_8012A308[(s32)(gameplayFrames & 14) >> 1])); gSPSegment(gfxCtx->polyXlu.p++, 0x09, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 256, 0, 64, 32, 1, 0, @@ -841,7 +1106,7 @@ void func_80099BD8(GlobalContext* globalCtx) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 5145); - if (gSaveContext.scene_setup_index == 5) { + if (gSaveContext.sceneSetupIndex == 5) { D_8015FCF0 = 1; D_8015FCF8.x = -20.0f; D_8015FCF8.y = 1220.0f; @@ -1037,7 +1302,7 @@ void func_8009AFE0(GlobalContext* globalCtx) { { s32 pad[2]; } // Necessary to match stack usage - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A328[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A328[gSaveContext.nightFlag])); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 5507); } @@ -1061,7 +1326,7 @@ void func_8009B0FC(GlobalContext* globalCtx) { spAC = globalCtx->unk_11D30[1] & 0xFF; gameplayFrames = globalCtx->gameplayFrames; - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A330[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A330[gSaveContext.nightFlag])); if (spB0 == 1) { gSPSegment(gfxCtx->polyOpa.p++, 0x08, @@ -1236,14 +1501,14 @@ void func_8009BEEC(GlobalContext* globalCtx) { s32 var; if (globalCtx->gameplayFrames % 128 == 13) { - var = Quake_Add(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 2); + var = Quake_Add(globalCtx->cameraPtrs[globalCtx->activeCamera], 2); Quake_SetSpeed(var, 10000); Quake_SetQuakeValues(var, 4, 0, 0, 0); Quake_SetCountdown(var, 127); } if ((globalCtx->gameplayFrames % 64 == 0) && (Math_Rand_ZeroOne() > 0.6f)) { - var = Quake_Add(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 3); + var = Quake_Add(globalCtx->cameraPtrs[globalCtx->activeCamera], 3); Quake_SetSpeed(var, 32000.0f + (Math_Rand_ZeroOne() * 3000.0f)); Quake_SetQuakeValues(var, 10.0f - (Math_Rand_ZeroOne() * 9.0f), 0, 0, 0); Quake_SetCountdown(var, 48.0f - (Math_Rand_ZeroOne() * 15.0f)); @@ -1313,7 +1578,7 @@ void func_8009C3EC(GlobalContext* globalCtx) { Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 6042); gameplayFrames = globalCtx->gameplayFrames; - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A338[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A338[gSaveContext.nightFlag])); gSPSegment(gfxCtx->polyOpa.p++, 0x09, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); @@ -1427,7 +1692,7 @@ void func_8009CC00(GlobalContext* globalCtx) { Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 6290); gameplayFrames = globalCtx->gameplayFrames; - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A340[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A340[gSaveContext.nightFlag])); gSPSegment(gfxCtx->polyOpa.p++, 0x09, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); @@ -1529,7 +1794,7 @@ void func_8009D31C(GlobalContext* globalCtx) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 6515); - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A348[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A348[gSaveContext.nightFlag])); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -1555,7 +1820,7 @@ void func_8009D438(GlobalContext* globalCtx) { if (LINK_IS_ADULT) { var = 1; } else { - var = gSaveContext.night_flag; + var = gSaveContext.nightFlag; } gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A358[var])); @@ -1609,7 +1874,7 @@ void func_8009D758(GlobalContext* globalCtx) { Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 6640); gameplayFrames = globalCtx->gameplayFrames; - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A360[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A360[gSaveContext.nightFlag])); gSPSegment(gfxCtx->polyXlu.p++, 0x09, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32)); @@ -1639,7 +1904,7 @@ void func_8009D974(GlobalContext* globalCtx) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 6752); - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A368[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A368[gSaveContext.nightFlag])); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 6762); } @@ -1672,14 +1937,14 @@ void func_8009DA30(GlobalContext* globalCtx) { gSPSegment(gfxCtx->polyXlu.p++, 0x0A, displayListHead); - if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC555)) { + if ((gSaveContext.dayTime >= 0x4AAC) && (gSaveContext.dayTime <= 0xC555)) { gSPEndDisplayList(displayListHead); } else { - if (gSaveContext.day_time > 0xC555) { + if (gSaveContext.dayTime > 0xC555) { if (globalCtx->unk_11D30[0] != 255) { Math_ApproxS(&globalCtx->unk_11D30[0], 255, 5); } - } else if (gSaveContext.day_time >= 0x4000) { + } else if (gSaveContext.dayTime >= 0x4000) { if (globalCtx->unk_11D30[0] != 0) { Math_ApproxS(&globalCtx->unk_11D30[0], 0, 10); } @@ -1704,7 +1969,7 @@ void func_8009DD5C(GlobalContext* globalCtx) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 6890); - gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A370[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A370[gSaveContext.nightFlag])); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -1775,11 +2040,11 @@ void func_8009E0B8(GlobalContext* globalCtx) { gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80); - if (gSaveContext.scene_setup_index == 4) { + if (gSaveContext.sceneSetupIndex == 4) { spA3 = 255 - (u8)globalCtx->unk_11D30[0]; - } else if (gSaveContext.scene_setup_index == 6) { + } else if (gSaveContext.sceneSetupIndex == 6) { spA0 = globalCtx->unk_11D30[0] + 500; - } else if (((gSaveContext.scene_setup_index < 4) || LINK_IS_ADULT) && (gSaveContext.event_chk_inf[0] & 0x80)) { + } else if (((gSaveContext.sceneSetupIndex < 4) || LINK_IS_ADULT) && (gSaveContext.eventChkInf[0] & 0x80)) { spA0 = 2150; } @@ -1810,7 +2075,7 @@ void func_8009E54C(GlobalContext* globalCtx) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 7058); - if ((gSaveContext.scene_setup_index > 3) || (LINK_IS_ADULT && !(gSaveContext.event_chk_inf[6] & 0x200))) { + if ((gSaveContext.sceneSetupIndex > 3) || (LINK_IS_ADULT && !(gSaveContext.eventChkInf[6] & 0x200))) { globalCtx->unk_11D30[0] = 87; } @@ -1851,7 +2116,7 @@ void func_8009E730(GlobalContext* globalCtx) { gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A378[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A378[gSaveContext.nightFlag])); { s32 pad[2]; } // Necessary to match stack usage @@ -1993,7 +2258,7 @@ void func_8009F1B4(GlobalContext* globalCtx) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 7363); - gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A380[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A380[gSaveContext.nightFlag])); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 7371); } @@ -2063,14 +2328,14 @@ void func_8009F5D4(GlobalContext* globalCtx) { gSPSegment(gfxCtx->polyXlu.p++, 0x08, displayListHead); - if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC000)) { + if ((gSaveContext.dayTime >= 0x4AAC) && (gSaveContext.dayTime <= 0xC000)) { gSPEndDisplayList(displayListHead); } else { - if (gSaveContext.day_time > 0xC000) { + if (gSaveContext.dayTime > 0xC000) { if (globalCtx->unk_11D30[0] != 255) { Math_ApproxS(&globalCtx->unk_11D30[0], 255, 5); } - } else if (gSaveContext.day_time >= 0x4000) { + } else if (gSaveContext.dayTime >= 0x4000) { if (globalCtx->unk_11D30[0] != 0) { Math_ApproxS(&globalCtx->unk_11D30[0], 0, 10); } @@ -2143,7 +2408,7 @@ void func_8009F9D0(GlobalContext* globalCtx) { gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80); - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A388[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A388[gSaveContext.nightFlag])); { s32 pad[2]; } // Necessary to match stack usage @@ -2161,7 +2426,7 @@ void func_8009FB74(GlobalContext* globalCtx) { gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_scene_table.c", 7602); - gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A390[gSaveContext.night_flag])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A390[gSaveContext.nightFlag])); gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80); @@ -2365,9 +2630,9 @@ void Scene_Draw(GlobalContext* globalCtx) { GraphicsContext* gfxCtx; Gfx* dispRefs[4]; - if (HREG(80) == 0x11) { - if (HREG(95) != 0x11) { - HREG(95) = 0x11; + if (HREG(80) == 17) { + if (HREG(95) != 17) { + HREG(95) = 17; HREG(81) = 1; HREG(82) = 1; HREG(83) = 0; diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 099fa122e..36a5c8a85 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -15,14 +15,14 @@ void SkelAnime_AnimationType3Loaded(GlobalContext* globalCtx, AnimationEntryType void SkelAnime_AnimationType4Loaded(GlobalContext* globalCtx, AnimationEntryType4* entry); void SkelAnime_AnimationType5Loaded(GlobalContext* globalCtx, AnimationEntryType5* entry); -//.data +// .data u32 D_8012A480 = 0; static AnimationEntryCallback sAnimationLoadDone[] = { &SkelAnime_LinkAnimetionLoaded, &SkelAnime_AnimationType1Loaded, &SkelAnime_AnimationType2Loaded, &SkelAnime_AnimationType3Loaded, &SkelAnime_AnimationType4Loaded, &SkelAnime_AnimationType5Loaded, }; -//.bss +// .bss u32 D_801600B0; /* diff --git a/src/code/z_view.c b/src/code/z_view.c index 18336b98a..83147cceb 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -2,154 +2,165 @@ #include <global.h> #include <vt.h> -volatile u32 D_8012ABF0 = 1; - -// TODO replace UnkViewStruct with Viewport and match with that instead -void func_800AA190(UnkViewStruct* arg0, Viewport* viewport) { - s32 xLen; - s32 yLen; - - xLen = viewport->rightX - viewport->leftX; - yLen = viewport->bottomY - viewport->topY; - arg0->unk_0 = (xLen * 2); - arg0->unk_2 = (yLen * 2); - arg0->unk_4 = 0x01FF; - arg0->unk_6 = 0; - arg0->unk_8 = (((viewport->leftX * 2) + xLen) * 2); - arg0->unk_A = (((viewport->topY * 2) + yLen) * 2); - arg0->unk_C = 0x01FF; - arg0->unk_E = 0; +volatile u32 D_8012ABF0 = true; + +void View_ViewportToVp(Vp* dest, Viewport* src) { + s32 width = src->rightX - src->leftX; + s32 height = src->bottomY - src->topY; + + dest->vp.vscale[0] = width * 2; + dest->vp.vscale[1] = height * 2; + dest->vp.vscale[2] = 0x01FF; + dest->vp.vscale[3] = 0; + dest->vp.vtrans[0] = ((src->leftX * 2) + width) * 2; + dest->vp.vtrans[1] = ((src->topY * 2) + height) * 2; + dest->vp.vtrans[2] = 0x01FF; + dest->vp.vtrans[3] = 0; } -View* func_800AA1F8(GraphicsContext* gfxCtx) { +View* View_New(GraphicsContext* gfxCtx) { View* view = SystemArena_MallocDebug(sizeof(View), "../z_view.c", 285); + if (view != NULL) { - func_80106860(view, 0, sizeof(View)); // TODO prototype this - func_800AA278(view, gfxCtx); + func_80106860(view, 0, sizeof(View)); // memset + View_Init(view, gfxCtx); } + return view; } -void func_800AA250(View* view) { +void View_Free(View* view) { SystemArena_FreeDebug(view, "../z_view.c", 297); } -void func_800AA278(View* view, GraphicsContext* gfxCtx) { +void View_Init(View* view, GraphicsContext* gfxCtx) { view->gfxCtx = gfxCtx; view->viewport.topY = 0; - view->viewport.bottomY = 240; + view->viewport.bottomY = SCREEN_HEIGHT; view->viewport.leftX = 0; - view->viewport.rightX = 320; - view->magic = 0x56494557; //"VIEW" + view->viewport.rightX = SCREEN_WIDTH; + view->magic = 0x56494557; // "VIEW" view->eye.x = 0.0f; view->eye.y = 0.0f; - view->unk_24 = 1.0f; - view->fieldOfView = 60.0f; - view->fogDistance = 10.0f; - view->zDepth = 12800.0f; + view->scale = 1.0f; + view->fovy = 60.0f; + view->near = 10.0f; + view->far = 12800.0f; view->unk_34.x = 0.0f; view->unk_40.x = 0.0f; view->unk_40.y = 1.0f; view->unk_40.z = 0.0f; view->eye.z = -1.0f; - if (D_8012ABF0 != 0) { + if (D_8012ABF0) { if (&D_8012ABF0) {} - osSyncPrintf("\nview: initialize ---\n", gfxCtx, view); - D_8012ABF0 = 0; + osSyncPrintf("\nview: initialize ---\n"); + D_8012ABF0 = false; } + view->unk_124 = 0; - view->unk_120 = 7; + view->flags = 1 | 2 | 4; func_800AA7B8(view); } -void func_800AA358(View* view, Vec3f* vec1, Vec3f* vec2, Vec3f* vec3) { - if (vec1->x == vec2->x && vec1->z == vec2->z) { - vec1->x += 0.1f; +void func_800AA358(View* view, Vec3f* eye, Vec3f* vec2, Vec3f* vec3) { + if (eye->x == vec2->x && eye->z == vec2->z) { + eye->x += 0.1f; } - view->eye = *vec1; + + view->eye = *eye; view->unk_34 = *vec2; view->unk_40 = *vec3; - view->unk_120 |= 1; + view->flags |= 1; } -void func_800AA3F0(View* view, Vec3f* vec1, Vec3f* vec2, Vec3f* vec3) { - view->eye = *vec1; +void func_800AA3F0(View* view, Vec3f* eye, Vec3f* vec2, Vec3f* vec3) { + view->eye = *eye; view->unk_34 = *vec2; view->unk_40 = *vec3; } -void func_800AA43C(View* view, f32 arg1) { - view->unk_120 |= 4; - view->unk_24 = arg1; +void View_SetScale(View* view, f32 scale) { + view->flags |= 4; + view->scale = scale; } -void func_800AA454(View* view, f32* arg1) { - *arg1 = view->unk_24; +void View_GetScale(View* view, f32* scale) { + *scale = view->scale; } -void func_800AA460(View* view, f32 fieldOfView, f32 fogDistance, f32 zDepth) { - view->fieldOfView = fieldOfView; - view->fogDistance = fogDistance; - view->zDepth = zDepth; - view->unk_120 |= 4; +void func_800AA460(View* view, f32 fovy, f32 near, f32 far) { + view->fovy = fovy; + view->near = near; + view->far = far; + view->flags |= 4; } -void func_800AA48C(View* view, f32* fieldOfView, f32* fogDistance, f32* zDepth) { - *fieldOfView = view->fieldOfView; - *fogDistance = view->fogDistance; - *zDepth = view->zDepth; +void func_800AA48C(View* view, f32* fovy, f32* near, f32* far) { + *fovy = view->fovy; + *near = view->near; + *far = view->far; } -void func_800AA4A8(View* view, f32 fieldOfView, f32 fogDistance, f32 zDepth) { - view->fieldOfView = fieldOfView; - view->fogDistance = fogDistance; - view->zDepth = zDepth; - view->unk_120 |= 8; - view->unk_24 = 1.0f; +void func_800AA4A8(View* view, f32 fovy, f32 near, f32 far) { + view->fovy = fovy; + view->near = near; + view->far = far; + view->flags |= 8; + view->scale = 1.0f; } -void func_800AA4E0(View* view, f32* fieldOfView, f32* fogDistance, f32* zDepth) { - *fieldOfView = view->fieldOfView; - *fogDistance = view->fogDistance; - *zDepth = view->zDepth; +void func_800AA4E0(View* view, f32* fovy, f32* near, f32* far) { + *fovy = view->fovy; + *near = view->near; + *far = view->far; } -void func_800AA4FC(View* view, Viewport* viewport) { +void View_SetViewport(View* view, Viewport* viewport) { view->viewport = *viewport; - view->unk_120 |= 2; + view->flags |= 2; } -void func_800AA52C(View* view, Viewport* viewport) { +void View_GetViewport(View* view, Viewport* viewport) { *viewport = view->viewport; } -#ifdef NON_MATCHING -// regalloc, zeros optimised out void func_800AA550(View* view) { - s32 phi_v1; - s32 phi_v1_2; + s32 varY; + s32 varX; s32 pad; s32 ulx; s32 uly; s32 lrx; s32 lry; GraphicsContext* gfxCtx; - s32 temp_a0; - Gfx* dispRefs[4]; + Gfx* dispRefs[5]; gfxCtx = view->gfxCtx; - phi_v1 = func_800B38FC(); - if (phi_v1 < 0) { - phi_v1 = 0; + + varY = func_800B38FC(); + + varX = -1; // The following is optimized to varX = 0 but affects codegen + + if (varX < 0) { + varX = 0; + } + if (varX > SCREEN_WIDTH / 2) { + varX = SCREEN_WIDTH / 2; + } + + if (varY < 0) { + varY = 0; } - if (phi_v1 >= 0x79) { - phi_v1 = 0x78; + if (varY > SCREEN_HEIGHT / 2) { + varY = SCREEN_HEIGHT / 2; } - ulx = view->viewport.leftX + 0; - uly = view->viewport.topY + phi_v1; - lrx = view->viewport.rightX - 0; - lry = view->viewport.bottomY - phi_v1; + + ulx = view->viewport.leftX + varX; + uly = view->viewport.topY + varY; + lrx = view->viewport.rightX - varX; + lry = view->viewport.bottomY - varY; + if (ulx < 0) { __assert("ulx >= 0", "../z_view.c", 454); } @@ -162,27 +173,27 @@ void func_800AA550(View* view) { if (lry > SCREEN_HEIGHT) { __assert("lry <= SCREEN_HT", "../z_view.c", 457); } + Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 459); + gDPPipeSync(gfxCtx->polyOpa.p++); gDPSetScissor(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, ulx, uly, lrx, lry); gDPPipeSync(gfxCtx->polyXlu.p++); gDPSetScissor(gfxCtx->polyXlu.p++, G_SC_NON_INTERLACE, ulx, uly, lrx, lry); + Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 472); } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AA550.s") -#endif -void func_800AA76C(View* view, f32 arg1, f32 arg2, f32 arg3) { - view->unk_E8.x = arg1; - view->unk_E8.y = arg2; - view->unk_E8.z = arg3; +void func_800AA76C(View* view, f32 x, f32 y, f32 z) { + view->unk_E8.x = x; + view->unk_E8.y = y; + view->unk_E8.z = z; } -void func_800AA78C(View* view, f32 arg1, f32 arg2, f32 arg3) { - view->unk_F4.x = arg1; - view->unk_F4.y = arg2; - view->unk_F4.z = arg3; +void func_800AA78C(View* view, f32 x, f32 y, f32 z) { + view->unk_F4.x = x; + view->unk_F4.y = y; + view->unk_F4.z = z; } void func_800AA7AC(View* view, f32 arg1) { @@ -218,7 +229,7 @@ void func_800AA840(View* view, Vec3f vec1, Vec3f vec2, f32 arg3) { } s32 func_800AA890(View* view, Mtx* mtx) { - MtxF mtxF; + MtxF mf; if (view->unk_100 == 0.0f) { return 0; @@ -235,21 +246,24 @@ s32 func_800AA890(View* view, Mtx* mtx) { view->unk_110.y += ((view->unk_F4.y - view->unk_110.y) * view->unk_100); view->unk_110.z += ((view->unk_F4.z - view->unk_110.z) * view->unk_100); } - Matrix_MtxToMtxF(mtx, &mtxF); - Matrix_Put(&mtxF); - Matrix_RotateX(view->unk_104.x, 1); - Matrix_RotateY(view->unk_104.y, 1); - Matrix_RotateZ(view->unk_104.z, 1); + + Matrix_MtxToMtxF(mtx, &mf); + Matrix_Put(&mf); + Matrix_RotateX(view->unk_104.x, MTXMODE_APPLY); + Matrix_RotateY(view->unk_104.y, MTXMODE_APPLY); + Matrix_RotateZ(view->unk_104.z, MTXMODE_APPLY); Matrix_Scale(view->unk_110.x, view->unk_110.y, view->unk_110.z, MTXMODE_APPLY); - Matrix_RotateZ(-view->unk_104.z, 1); - Matrix_RotateY(-view->unk_104.y, 1); - Matrix_RotateX(-view->unk_104.x, 1); + Matrix_RotateZ(-view->unk_104.z, MTXMODE_APPLY); + Matrix_RotateY(-view->unk_104.y, MTXMODE_APPLY); + Matrix_RotateX(-view->unk_104.x, MTXMODE_APPLY); Matrix_ToMtx(mtx, "../z_view.c", 566); + return 1; } void func_800AAA50(View* view, s32 arg1) { - arg1 = (view->unk_120 & arg1) | arg1 >> 4; + arg1 = (view->flags & arg1) | arg1 >> 4; + if (arg1 & 8) { func_800AB0A8(view); } else { @@ -257,91 +271,99 @@ void func_800AAA50(View* view, s32 arg1) { } } -#ifdef NON_MATCHING -// Just one stack var s32 func_800AAA9C(View* view) { - s32 pad; - s32 pad1; - s32 ylen; - Viewport* viewport; + f32 aspect; + s32 width; + s32 height; + Vp* vp; Mtx* projection; - MtxF* viewing; - Gfx* dispRefs[6]; - s32 xlen; + Mtx* viewing; GraphicsContext* gfxCtx; - s32 i; - MtxF mtxF; - MtxF mtxFv; + Gfx* dispRefs[5]; gfxCtx = view->gfxCtx; Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 596); - viewport = Graph_Alloc(gfxCtx, sizeof(Viewport)); - LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 601); - func_800AA190(viewport, &view->viewport); - view->unk_50 = *viewport; + + vp = Graph_Alloc(gfxCtx, sizeof(Vp)); + LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 601); + View_ViewportToVp(vp, &view->viewport); + view->vp = *vp; + func_800AA550(view); - gSPViewport(gfxCtx->polyOpa.p++, viewport); - gSPViewport(gfxCtx->polyXlu.p++, viewport); + gSPViewport(gfxCtx->polyOpa.p++, vp); + gSPViewport(gfxCtx->polyXlu.p++, vp); projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 616); - view->unk_E0 = projection; - xlen = view->viewport.rightX - view->viewport.leftX; - ylen = view->viewport.bottomY - view->viewport.topY; - if (HREG(80) == 0xB) { - if (HREG(94) != 0xB) { - HREG(94) = 0xB; - HREG(83) = 0x3C; - HREG(84) = 0x3415; - HREG(85) = 0xA; - HREG(86) = 0x3200; - HREG(87) = 0x64; + view->projectionPtr = projection; + + width = view->viewport.rightX - view->viewport.leftX; + height = view->viewport.bottomY - view->viewport.topY; + aspect = (f32)width / (f32)height; + + if (HREG(80) == 11) { + if (HREG(94) != 11) { + HREG(94) = 11; + HREG(83) = 60; + HREG(84) = 13333; + HREG(85) = 10; + HREG(86) = 12800; + HREG(87) = 100; } - guPerspective(projection, &view->unk_11C, HREG(83), HREG(84) / 10000.0f, HREG(85), HREG(86), HREG(87) / 100.0f); + guPerspective(projection, &view->normal, HREG(83), HREG(84) / 10000.0f, HREG(85), HREG(86), HREG(87) / 100.0f); } else { - guPerspective(projection, &view->unk_11C, view->fieldOfView, (f32)xlen / (f32)ylen, view->fogDistance, - view->zDepth, view->unk_24); + guPerspective(projection, &view->normal, view->fovy, aspect, view->near, view->far, view->scale); } + if (QREG(88) & 1) { - osSyncPrintf("fovy %f near %f far %f scale %f aspect %f normal %08x\n", view->fieldOfView, view->fogDistance, - view->zDepth, view->unk_24, (f32)xlen / (f32)ylen, view->unk_11C); - Matrix_MtxToMtxF(projection, &mtxF); + s32 i; + MtxF mf; + + osSyncPrintf("fovy %f near %f far %f scale %f aspect %f normal %08x\n", view->fovy, view->near, view->far, + view->scale, aspect, view->normal); + + Matrix_MtxToMtxF(projection, &mf); osSyncPrintf("projection\n"); for (i = 0; i < 4; i++) { - osSyncPrintf(" %f %f %f %f\n", mtxF.mf[i][0], mtxF.mf[i][1], mtxF.mf[i][2], - mtxF.mf[i][3]); + osSyncPrintf(" %f %f %f %f\n", mf.mf[i][0], mf.mf[i][1], mf.mf[i][2], mf.mf[i][3]); } osSyncPrintf("\n"); } - view->unk_60 = *projection; + + view->projection = *projection; func_800AA890(view, projection); - gSPPerspNormalize(gfxCtx->polyOpa.p++, view->unk_11C); + gSPPerspNormalize(gfxCtx->polyOpa.p++, view->normal); gSPMatrix(gfxCtx->polyOpa.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - gSPPerspNormalize(gfxCtx->polyXlu.p++, view->unk_11C); + gSPPerspNormalize(gfxCtx->polyXlu.p++, view->normal); gSPMatrix(gfxCtx->polyXlu.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - viewing = Graph_Alloc(gfxCtx, sizeof(MtxF)); + viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 667); - view->unk_E4 = viewing; + view->viewingPtr = viewing; + if (view->eye.x == view->unk_34.x && view->eye.y == view->unk_34.y && view->eye.z == view->unk_34.z) { view->eye.x += 1.0f; view->eye.y += 1.0f; view->eye.z += 1.0f; } + func_800ABE74(view->eye.x, view->eye.y, view->eye.z); func_80101E34(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, view->unk_40.x, view->unk_40.y, view->unk_40.z); - view->unk_A0 = *viewing; + + view->viewing = *viewing; if (QREG(88) & 2) { - Matrix_MtxToMtxF(view->unk_E4, &mtxFv); + s32 i; + MtxF mf; + + Matrix_MtxToMtxF(view->viewingPtr, &mf); osSyncPrintf("viewing\n"); for (i = 0; i < 4; i++) { - osSyncPrintf(" %f %f %f %f\n", mtxFv.mf[i][0], mtxFv.mf[i][1], mtxFv.mf[i][2], - mtxFv.mf[i][3]); + osSyncPrintf(" %f %f %f %f\n", mf.mf[i][0], mf.mf[i][1], mf.mf[i][2], mf.mf[i][3]); } osSyncPrintf("\n"); } @@ -350,224 +372,227 @@ s32 func_800AAA9C(View* view) { gSPMatrix(gfxCtx->polyXlu.p++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 711); + return 1; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AAA9C.s") -#endif s32 func_800AB0A8(View* view) { - Viewport* viewport; + Vp* vp; Mtx* projection; - s32 pad; - s32 pad1; GraphicsContext* gfxCtx; - Gfx* dispRefs[3]; + Gfx* dispRefs[5]; gfxCtx = view->gfxCtx; Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 726); - viewport = Graph_Alloc(gfxCtx, sizeof(Viewport)); - LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 730); - func_800AA190(viewport, &view->viewport); - view->unk_50 = *viewport; + + vp = Graph_Alloc(gfxCtx, sizeof(Vp)); + LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 730); + View_ViewportToVp(vp, &view->viewport); + view->vp = *vp; + func_800AA550(view); - gSPViewport(gfxCtx->polyOpa.p++, viewport); - gSPViewport(gfxCtx->polyXlu.p++, viewport); - gSPViewport(gfxCtx->overlay.p++, viewport); + gSPViewport(gfxCtx->polyOpa.p++, vp); + gSPViewport(gfxCtx->polyXlu.p++, vp); + gSPViewport(gfxCtx->overlay.p++, vp); projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 744); - view->unk_E0 = projection; - func_801045A4(projection, -(f32)(s32)gScreenWidth * 0.5f, (f32)(s32)gScreenWidth * 0.5f, - -(f32)(s32)gScreenHeight * 0.5f, (f32)(s32)gScreenHeight * 0.5f, view->fogDistance, view->zDepth, - view->unk_24); + view->projectionPtr = projection; + + func_801045A4(projection, -(f32)gScreenWidth * 0.5f, (f32)gScreenWidth * 0.5f, -(f32)gScreenHeight * 0.5f, + (f32)gScreenHeight * 0.5f, view->near, view->far, view->scale); - view->unk_60 = *projection; + view->projection = *projection; gSPMatrix(gfxCtx->polyOpa.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); gSPMatrix(gfxCtx->polyXlu.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 762); + return 1; } -#ifdef NON_MATCHING -// saved registers allocated differently, everything else is OK s32 func_800AB2C4(View* view) { + Vp* vp; Mtx* projection; - f32 pad; - f32 pad1; - Viewport* viewport; - Gfx* dispRefs[4]; GraphicsContext* gfxCtx; + Gfx* dispRefs[5]; + + if (1) {} // Necessary to match gfxCtx = view->gfxCtx; Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 777); - viewport = Graph_Alloc(gfxCtx, sizeof(Viewport)); - LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 781); - func_800AA190(viewport, &view->viewport); - view->unk_50 = *viewport; + + vp = Graph_Alloc(gfxCtx, sizeof(Vp)); + LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 781); + View_ViewportToVp(vp, &view->viewport); + view->vp = *vp; gDPPipeSync(gfxCtx->overlay.p++); gDPSetScissor(gfxCtx->overlay.p++, G_SC_NON_INTERLACE, view->viewport.leftX, view->viewport.topY, view->viewport.rightX, view->viewport.bottomY); - gSPViewport(gfxCtx->overlay.p++, viewport); + gSPViewport(gfxCtx->overlay.p++, vp); projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 791); - view->unk_E0 = projection; - func_801045A4(projection, -(f32)(s32)gScreenWidth * 0.5f, (f32)(s32)gScreenWidth * 0.5f, - -(f32)(s32)gScreenHeight * 0.5f, (f32)(s32)gScreenHeight * 0.5f, view->fogDistance, view->zDepth, - view->unk_24); - view->unk_60 = *projection; + view->projectionPtr = projection; + + func_801045A4(projection, -(f32)gScreenWidth * 0.5f, (f32)gScreenWidth * 0.5f, -(f32)gScreenHeight * 0.5f, + (f32)gScreenHeight * 0.5f, view->near, view->far, view->scale); + + view->projection = *projection; gSPMatrix(gfxCtx->overlay.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 801); + return 1; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AB2C4.s") -#endif -#ifdef NON_MATCHING -// regalloc s32 func_800AB560(View* view) { - s32 pad; - s32 pad1; - s32 pad2; - s32 pad3; - GraphicsContext* gfxCtx; - Viewport* viewport; - Mtx* projection; - MtxF* viewing; - Gfx* dispRefs[6]; + s32 pad[2]; f32 aspect; + s32 width; + s32 height; + Vp* vp; + Mtx* projection; + Mtx* viewing; + GraphicsContext* gfxCtx; + Gfx* dispRefs[5]; gfxCtx = view->gfxCtx; Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 816); - viewport = Graph_Alloc(gfxCtx, sizeof(Viewport)); - LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 821); + vp = Graph_Alloc(gfxCtx, sizeof(Vp)); + LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 821); + View_ViewportToVp(vp, &view->viewport); + view->vp = *vp; - func_800AA190(viewport, &view->viewport); - view->unk_50 = *viewport; gDPPipeSync(gfxCtx->overlay.p++); gDPSetScissor(gfxCtx->overlay.p++, G_SC_NON_INTERLACE, view->viewport.leftX, view->viewport.topY, view->viewport.rightX, view->viewport.bottomY); - gSPViewport(gfxCtx->overlay.p++, viewport); + gSPViewport(gfxCtx->overlay.p++, vp); projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 833); + view->projectionPtr = projection; + + width = view->viewport.rightX - view->viewport.leftX; + height = view->viewport.bottomY - view->viewport.topY; + + aspect = (f32)width / (f32)height; + guPerspective(projection, &view->normal, view->fovy, aspect, view->near, view->far, view->scale); + + view->projection = *projection; - view->unk_E0 = projection; - guPerspective(projection, &view->unk_11C, view->fieldOfView, - (f32)(view->viewport.rightX - view->viewport.leftX) / - (f32)(view->viewport.bottomY - view->viewport.topY), - view->fogDistance, view->zDepth, view->unk_24); - view->unk_60 = *projection; - gSPPerspNormalize(gfxCtx->overlay.p++, view->unk_11C); + gSPPerspNormalize(gfxCtx->overlay.p++, view->normal); gSPMatrix(gfxCtx->overlay.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - viewing = Graph_Alloc(gfxCtx, sizeof(MtxF)); + viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 848); + view->viewingPtr = viewing; - view->unk_E4 = viewing; if (view->eye.x == view->unk_34.x && view->eye.y == view->unk_34.y && view->eye.z == view->unk_34.z) { view->eye.x += 1.0f; view->eye.y += 1.0f; view->eye.z += 1.0f; } + func_800ABE74(view->eye.x, view->eye.y, view->eye.z); func_80101E34(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, view->unk_40.x, view->unk_40.y, view->unk_40.z); - view->unk_A0 = *viewing; + + view->viewing = *viewing; + gSPMatrix(gfxCtx->overlay.p++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 871); + return 1; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AB560.s") -#endif s32 func_800AB944(View* view) { Gfx* dispRefs[5]; Graph_OpenDisps(dispRefs, view->gfxCtx, "../z_view.c", 878); + func_800ABE74(view->eye.x, view->eye.y, view->eye.z); - func_80101E34(view->unk_E4, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, - view->unk_40.x, view->unk_40.y, view->unk_40.z); + func_80101E34(view->viewingPtr, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, + view->unk_34.z, view->unk_40.x, view->unk_40.y, view->unk_40.z); Graph_CloseDisps(dispRefs, view->gfxCtx, "../z_view.c", 886); + return 1; } #ifdef NON_MATCHING // saved register usage is wrong, relatively minor reorderings, regalloc -s32 func_800AB9EC(View* view, s32 arg1, Gfx** p) { - Viewport* viewport; - Mtx* projection; - Mtx* projection2; - MtxF* viewing; - GraphicsContext* gfxCtx; - Gfx* pLocal; +s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) { + GraphicsContext* gfxCtx = view->gfxCtx; + Gfx* gfx = *gfxp; - gfxCtx = view->gfxCtx; - pLocal = *p; - arg1 = (view->unk_120 & arg1) | arg1 >> 4; - if (arg1 & 2) { - viewport = Graph_Alloc(view->gfxCtx, sizeof(Viewport)); - LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 910); - func_800AA190(viewport, &view->viewport); + arg1 = (view->flags & arg1) | arg1 >> 4; - view->unk_50 = *viewport; + if (arg1 & 2) { + Vp* vp = Graph_Alloc(view->gfxCtx, sizeof(Vp)); + LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 910); + View_ViewportToVp(vp, &view->viewport); + view->vp = *vp; - gDPPipeSync(pLocal++); - gDPSetScissor(pLocal++, G_SC_NON_INTERLACE, view->viewport.leftX, view->viewport.topY, view->viewport.rightX, + gDPPipeSync(gfx++); + gDPSetScissor(gfx++, G_SC_NON_INTERLACE, view->viewport.leftX, view->viewport.topY, view->viewport.rightX, view->viewport.bottomY); - gSPViewport(pLocal++, viewport); + gSPViewport(gfx++, vp); } + if (arg1 & 8) { - projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); + Mtx* projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 921); - view->unk_E0 = projection; - func_801045A4(projection, -(f32)(s32)gScreenWidth * 0.5f, (f32)(s32)gScreenWidth * 0.5f, - -(f32)(s32)gScreenHeight * 0.5f, (f32)(s32)gScreenHeight * 0.5f, view->fogDistance, view->zDepth, - view->unk_24); + view->projectionPtr = projection; + + func_801045A4(projection, -(f32)gScreenWidth * 0.5f, (f32)gScreenWidth * 0.5f, -(f32)gScreenHeight * 0.5f, + (f32)gScreenHeight * 0.5f, view->near, view->far, view->scale); - view->unk_60 = *projection; + view->projection = *projection; - gSPMatrix(pLocal++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); } else if (arg1 & 6) { - projection2 = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("projection", projection2, "../z_view.c", 932); - view->unk_E0 = projection2; - guPerspective(projection2, &view->unk_11C, view->fieldOfView, - (f32)(view->viewport.rightX - view->viewport.leftX) / - (f32)(view->viewport.bottomY - view->viewport.topY), - view->fogDistance, view->zDepth, view->unk_24); - - view->unk_60 = *projection2; - - gSPPerspNormalize(pLocal++, view->unk_11C); - gSPMatrix(pLocal++, projection2, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + s32 width; + s32 height; + Mtx* projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); + LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 932); + view->projectionPtr = projection; + + width = view->viewport.rightX - view->viewport.leftX; + height = view->viewport.bottomY - view->viewport.topY; + + guPerspective(projection, &view->normal, view->fovy, (f32)width / (f32)height, view->near, view->far, + view->scale); + + view->projection = *projection; + + gSPPerspNormalize(gfx++, view->normal); + gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); } + if (arg1 & 1) { - viewing = Graph_Alloc(gfxCtx, sizeof(MtxF)); + Mtx* viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 948); - view->unk_E4 = viewing; + view->viewingPtr = viewing; + func_800ABE74(view->eye.x, view->eye.y, view->eye.z); func_80101E34(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z, view->unk_40.x, view->unk_40.y, view->unk_40.z); - view->unk_A0 = *viewing; + view->viewing = *viewing; - gSPMatrix(pLocal++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + gSPMatrix(gfx++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); } - view->unk_120 = 0; - *p = pLocal; + + view->flags = 0; + *gfxp = gfx; + return 1; } #else @@ -575,28 +600,28 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** p) { #endif s32 func_800ABE74(f32 eyeX, f32 eyeY, f32 eyeZ) { - s32 errorCode = 0; + s32 error = 0; - if ((eyeX * eyeX) + (eyeY * eyeY) + (eyeZ * eyeZ) > 1073676288.0f) { - errorCode = 3; + if (SQ(eyeX) + SQ(eyeY) + SQ(eyeZ) > SQ(32767.0f)) { + error = 3; } else { - f32 absEyeX; - f32 absEyeY; - f32 absEyeZ; - absEyeX = ABS(eyeX); - absEyeY = ABS(eyeY); - absEyeZ = ABS(eyeZ); + f32 absEyeX = ABS(eyeX); + f32 absEyeY = ABS(eyeY); + f32 absEyeZ = ABS(eyeZ); + if (((18900.0f < absEyeX) || (18900.0f < absEyeY)) || (18900.0f < absEyeZ)) { - errorCode = 2; + error = 2; } else if (((16000.0f < absEyeX) || (16000.0f < absEyeY)) || (16000.0f < absEyeZ)) { - errorCode = 1; + error = 1; } } - if (errorCode != 0) { + + if (error != 0) { osSyncPrintf(VT_FGCOL(RED)); - // Is too large - osSyncPrintf("eye が大きすぎます eye=[%8.3f %8.3f %8.3f] error=%d\n", eyeX, eyeY, eyeZ, errorCode); + // "Is too large" + osSyncPrintf("eye が大きすぎます eye=[%8.3f %8.3f %8.3f] error=%d\n", eyeX, eyeY, eyeZ, error); osSyncPrintf(VT_RST); } - return errorCode; + + return error; } |
