partially finish code_0x8012EC80, document all of gSaveContext (#138)

* not ok, why?

* OK!

* fix data

* finish data etc

* work on save context

* save finished

* first func done

* roomInf

* done for now

* add missing file

* add most og names for struct members

* fix accidental change

* Update z_en_ginko_man.c

* Update z_scene.c

* maybe fix stuff hopefully

* proto

* sasa

* Update include/z64save.h

Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>

* Update z64save.h

Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>
This commit is contained in:
Zelllll 2021-05-25 17:49:11 -05:00 committed by GitHub
parent cf3eb3b2e1
commit 6c86016603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 797 additions and 483 deletions

View File

@ -2423,16 +2423,16 @@ s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtxt, s3
s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtxt);
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags);
void func_8012EBF8(GlobalContext* globalCtx, RoomContext* roomCtxt);
u32 func_8012EC80(GlobalContext* globalCtx);
void func_8012ED34(s16 param_1);
// void func_8012ED78(void);
// void func_8012EDE8(void);
// void func_8012EE34(void);
// void func_8012EF0C(void);
// void func_8012F0EC(void);
// void func_8012F1BC(void);
// void func_8012F22C(void);
// void func_8012F278(void);
s32 func_8012EC80(GlobalContext* globalCtx);
void func_8012ED34(s16 equipment);
u8 func_8012ED78(GlobalContext* globalCtx, s16 equipment);
void func_8012EDE8(s16 arg0, u32 arg1);
s32 func_8012EE34(s16 arg0);
void func_8012EF0C(s16 arg0);
void func_8012F0EC(s16 arg0);
void func_8012F1BC(s16 sceneIndex);
s16 func_8012F22C(s16 sceneIndex);
void func_8012F278(GlobalContext* globalCtx);
s32 Object_Spawn(ObjectContext* objectCtx, s16 id);
void Object_InitBank(GameState* state, ObjectContext* objectCtx);
void Object_UpdateBank(ObjectContext* objectCtx);

View File

@ -26,10 +26,10 @@
// linkAge still exists in MM, but is always set to 0 (always adult)
// There are remnants of these macros from OOT, but they are essentially useless
//#define LINK_IS_CHILD (gSaveContext.perm.linkAge != 0)
#define LINK_IS_ADULT (gSaveContext.perm.linkAge == 0)
//#define LINK_IS_CHILD (gSaveContext.linkAge != 0)
#define LINK_IS_ADULT (gSaveContext.linkAge == 0)
#define CURRENT_DAY (gSaveContext.perm.day % 5)
#define CURRENT_DAY (gSaveContext.day % 5)
#define SQ(x) ((x)*(x))
#define DECR(x) ((x) == 0 ? 0 : ((x) -= 1))

View File

@ -1402,105 +1402,20 @@ extern Gfx gEmptyDL[1];
extern Vec3f D_801C1D10;
extern room_draw_func roomDrawFuncs[4];
extern u32 gBitFlags[32];
// extern UNK_TYPE2 D_801C1DB0;
// extern UNK_TYPE2 D_801C1DB2;
// extern UNK_TYPE2 D_801C1DB4;
// extern UNK_TYPE2 D_801C1DB8;
// extern UNK_TYPE2 D_801C1DBA;
// extern UNK_TYPE4 D_801C1DC0;
// extern UNK_TYPE4 D_801C1DC4;
// extern UNK_TYPE4 D_801C1DD0;
// extern UNK_TYPE4 D_801C1DD8;
// extern UNK_TYPE4 D_801C1DDC;
// extern UNK_TYPE1 D_801C1DE0;
// extern UNK_TYPE1 D_801C1E00;
// extern UNK_TYPE1 D_801C1E01;
// extern UNK_TYPE1 D_801C1E02;
// extern UNK_TYPE1 D_801C1E04;
// extern UNK_TYPE1 D_801C1E05;
// extern UNK_TYPE1 D_801C1E08;
// extern UNK_TYPE1 D_801C1E0A;
// extern UNK_TYPE1 D_801C1E0B;
// extern UNK_TYPE1 D_801C1E0C;
// extern UNK_TYPE2 D_801C1E0E;
// extern UNK_TYPE2 D_801C1E10;
// extern UNK_TYPE2 D_801C1E12;
// extern UNK_TYPE1 D_801C1E14;
// extern UNK_TYPE2 D_801C1E16;
// extern UNK_TYPE2 D_801C1E18;
// extern UNK_TYPE2 D_801C1E1A;
// extern UNK_TYPE1 D_801C1E2C;
// extern UNK_TYPE1 D_801C1E3C;
// extern UNK_TYPE2 D_801C1E40;
// extern UNK_TYPE2 D_801C1E42;
// extern UNK_TYPE1 D_801C1E44;
// extern UNK_TYPE2 D_801C1E48;
// extern UNK_TYPE2 D_801C1E4A;
extern UNK_PTR D_801C1E6C;
// extern UNK_TYPE1 D_801C1F9C;
// extern UNK_TYPE1 D_801C1FAC;
// extern UNK_TYPE4 D_801C1FE0;
// extern UNK_TYPE1 D_801C2054;
extern u8 D_801C2078[1]; // TODO This array is larger than this. How large is it?
extern u8 D_801C2079;
// extern UNK_TYPE1 D_801C207A;
extern u8 D_801C207E;
// extern UNK_TYPE1 D_801C207F;
// extern UNK_TYPE1 D_801C2080;
// extern UNK_TYPE1 D_801C2081;
// extern UNK_TYPE1 D_801C2082;
// extern UNK_TYPE1 D_801C2084;
// extern UNK_TYPE1 D_801C2085;
// extern UNK_TYPE1 D_801C2088;
// extern UNK_TYPE1 D_801C208A;
// extern UNK_TYPE1 D_801C208E;
// extern UNK_TYPE1 D_801C2090;
// extern UNK_TYPE1 D_801C209A;
// extern UNK_TYPE1 D_801C209C;
// extern UNK_TYPE1 D_801C209D;
// extern UNK_TYPE1 D_801C209E;
// extern UNK_TYPE1 D_801C20A0;
// extern UNK_TYPE1 D_801C20A1;
// extern UNK_TYPE1 D_801C20A2;
// extern UNK_TYPE1 D_801C20A3;
// extern UNK_TYPE1 D_801C20A4;
// extern UNK_TYPE1 D_801C20A5;
// extern UNK_TYPE1 D_801C20A6;
// extern UNK_TYPE1 D_801C20A7;
// extern UNK_TYPE1 D_801C20A8;
// extern UNK_TYPE1 D_801C20AA;
// extern UNK_TYPE1 D_801C20AB;
// extern UNK_TYPE1 D_801C20AC;
// extern UNK_TYPE1 D_801C20AD;
// extern UNK_TYPE1 D_801C20AE;
// extern UNK_TYPE1 D_801C20AF;
// extern UNK_TYPE1 D_801C20B0;
// extern UNK_TYPE1 D_801C20B1;
// extern UNK_TYPE1 D_801C20B2;
// extern UNK_TYPE1 D_801C20B3;
// extern UNK_TYPE1 D_801C20B4;
// extern UNK_TYPE1 D_801C20B5;
// extern UNK_TYPE1 D_801C20B6;
// extern UNK_TYPE1 D_801C20B7;
// extern UNK_TYPE1 D_801C20B8;
// extern UNK_TYPE1 D_801C20B9;
// extern UNK_TYPE1 D_801C20BA;
// extern UNK_TYPE1 D_801C20BB;
// extern UNK_TYPE1 D_801C20BC;
// extern UNK_TYPE1 D_801C20BD;
// extern UNK_TYPE1 D_801C20BE;
// extern UNK_TYPE1 D_801C20BF;
// extern UNK_TYPE1 D_801C20C0;
// extern UNK_TYPE1 D_801C20C1;
// extern UNK_TYPE1 D_801C20C8;
extern SceneIdList scenesPerMapArea[11];
// extern UNK_TYPE2 D_801C2380;
// extern UNK_TYPE1 D_801C2398;
// extern UNK_TYPE1 D_801C23B0;
// extern UNK_TYPE1 D_801C23C8;
// extern UNK_TYPE1 D_801C23E0;
// extern UNK_TYPE1 D_801C23F8;
// extern UNK_TYPE1 D_801C2410;
extern u16 gEquipMasks[];
extern u16 gEquipNegMasks[];
extern u32 gUpgradeMasks[];
extern u32 gUpgradeNegMasks[];
extern u8 gEquipShifts[];
extern u8 gUpgradeShifts[];
extern u16 gUpgradeCapacities[][4];
extern u32 gGsFlagsMask[];
extern u32 gGsFlagsShift[];
extern void* gItemIcons[];
extern u8 gItemSlots[];
extern u16 gItemPrices[];
extern u16 gScenesPerRegion[11][27];
extern u32 D_801C2410[];
extern s16 gLinkFormObjectIndexes[8];
extern RomFile objectFileTable[643];
extern SceneTableEntry gSceneTable[];
@ -1543,13 +1458,13 @@ extern struct_801C5F44 D_801C5F44[]; // D_801C5F44
// extern UNK_TYPE1 D_801C6850;
// extern UNK_TYPE1 D_801C6870;
// extern UNK_TYPE1 D_801C6890;
extern SaveContext_struct1 D_801C6898;
extern SaveContext_struct2 D_801C68C0;
extern SaveContextInventory gSaveDefaultInventory;
// extern UNK_TYPE1 D_801C6898;
// extern UNK_TYPE1 D_801C68C0;
extern Inventory gSaveDefaultInventory;
extern u16 gSaveDefaultChecksum;
extern SaveContext_struct1 D_801C6970;
extern SaveContext_struct2 D_801C6998;
extern SaveContextInventory D_801C69BC;
// extern UNK_TYPE1 D_801C6970;
// extern UNK_TYPE1 D_801C6998;
extern Inventory D_801C69BC;
extern u16 D_801C6A44;
// extern UNK_TYPE1 D_801C6A48;
// extern UNK_TYPE1 D_801C6A50;

View File

@ -32,6 +32,7 @@
#include <z64math.h>
#include <z64object.h>
#include <z64scene.h>
#include <z64save.h>
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
@ -145,13 +146,6 @@ typedef struct {
/* 0x28 */ CsCmdActorAction* actorActions[10];
} CutsceneContext; // size = 0x50
typedef struct {
/* 0x00 */ u32 chestFlags;
/* 0x04 */ u32 switchFlags[2];
/* 0x0C */ u32 clearedRooms;
/* 0x10 */ u32 collectibleFlags;
} CycleSceneFlags; // size = 0x14
typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
@ -302,10 +296,6 @@ typedef struct {
/* 0x10 */ u32 nRelocations;
} OverlayRelocationSection; // size = 0x14
typedef struct {
/* 0x00 */ UNK_TYPE1 pad0[0x1C];
} PermanentSceneFlags; // size = 0x1C
typedef struct {
/* 0x0 */ s16 unk0;
/* 0x2 */ s16 unk2;
@ -317,74 +307,6 @@ typedef struct {
/* 0x20 */ u16 fracPart[16];
} RSPMatrix; // size = 0x40
// Extra information in the save context that is not saved
typedef struct {
/* 0x000 */ UNK_TYPE1 pad0[0x4];
/* 0x004 */ s16 unk04;
/* 0x006 */ UNK_TYPE1 pad06[0x6];
/* 0x00C */ s32 sceneSetupIndex;
/* 0x010 */ s32 unk10;
/* 0x014 */ UNK_TYPE1 pad14[0x10];
/* 0x024 */ s16 unk24;
/* 0x040 */ UNK_TYPE1 pad22[0x1C];
/* 0x042 */ s16 unk42;
/* 0x044 */ UNK_TYPE1 pad44[0x34];
/* 0x078 */ f32 unk78;
/* 0x07C */ UNK_TYPE1 pad7C[0x4];
/* 0x080 */ s16 unk80;
/* 0x082 */ UNK_TYPE1 pad82[0x5];
/* 0x087 */ s8 unk87;
/* 0x088 */ UNK_TYPE1 pad88[0x1EE];
/* 0x276 */ u8 unk276;
/* 0x277 */ UNK_TYPE1 pad277[0x9];
/* 0x280 */ u16 unk280;
/* 0x282 */ u16 unk282;
/* 0x284 */ UNK_TYPE1 pad284[0x28];
/* 0x2AC */ u8 cutsceneTrigger;
/* 0x2AD */ UNK_TYPE1 pad2AD[0x5];
/* 0x2B2 */ u16 environmentTime;
/* 0x2B4 */ UNK_TYPE1 pad2B4[0x4];
/* 0x2B8 */ s16 unk2b8;
/* 0x2BA */ UNK_TYPE1 pad2BA[0xA];
/* 0x2C4 */ f32 unk2C4;
/* 0x2C8 */ CycleSceneFlags cycleSceneFlags[120];
} SaveContextExtra; // size = 0xC28
typedef struct {
/* 0x00 */ u8 items[24];
/* 0x18 */ u8 masks[24];
/* 0x30 */ u8 quantities[24];
/* 0x48 */ s32 unk48; // some bits are wallet upgrades
/* 0x4C */ UNK_TYPE1 pad4C[0x3C];
} SaveContextInventory; // size = 0x88
// Save Context that is only stored in an owl save
typedef struct {
/* 0x0000 */ UNK_TYPE1 pad0[0x1];
/* 0x0001 */ u8 unk1;
/* 0x0002 */ u8 unk2;
/* 0x0003 */ u8 unk3;
/* 0x0004 */ u8 unk4;
/* 0x0005 */ u8 unk5;
/* 0x0006 */ UNK_TYPE1 pad6[0x2C8C];
/* 0x0006 */ s16 unk_A00;
} SaveContextOwl; // size = 0x2C94
typedef struct {
/* 0x00 */ u8 zelda[6]; // Will always be "ZELDA3" for a valid save
/* 0x06 */ UNK_TYPE1 pad6[0xA];
/* 0x10 */ s16 maxLife;
/* 0x12 */ s16 currentLife;
/* 0x14 */ s8 unk14;
/* 0x15 */ s8 currentMagic;
/* 0x16 */ s16 currentRupees;
/* 0x18 */ UNK_TYPE1 pad18[0x10];
} SaveContext_struct1; // size = 0x28
typedef struct {
/* 0x00 */ UNK_TYPE1 pad0[0x22];
} SaveContext_struct2; // size = 0x22
typedef struct {
/* 0x0 */ s8 letterboxTarget;
/* 0x1 */ s8 letterboxMagnitude;
@ -636,42 +558,6 @@ typedef struct {
/* 0x12 */ OSContPad rel; // X/Y store adjusted
} Input; // size = 0x18
// Permanent save context, kept in regular save files
typedef struct {
/* 0x0000 */ u32 entranceIndex; // bits 0-3 : offset; 4-8: spawn index; 9-15: scene index
/* 0x0004 */ UNK_TYPE1 pad4[0x3];
/* 0x0007 */ u8 linkAge;
/* 0x0008 */ s32 cutscene;
/* 0x000C */ u16 time;
/* 0x000E */ UNK_TYPE1 padE[0x2];
/* 0x0010 */ s32 isNight;
/* 0x0014 */ u32 unk14;
/* 0x0018 */ s32 day;
/* 0x001C */ u32 daysElapsed;
/* 0x0020 */ u8 unk20;
/* 0x0021 */ UNK_TYPE1 pad21[0x2];
/* 0x0023 */ u8 owlSave;
/* 0x0024 */ SaveContext_struct1 unk24;
/* 0x004C */ SaveContext_struct2 unk4C;
/* 0x006E */ UNK_TYPE1 pad6E[0x2];
/* 0x0070 */ SaveContextInventory inv;
/* 0x00F8 */ PermanentSceneFlags sceneFlags[120];
/* 0x0E18 */ UNK_TYPE1 padE18[0x60];
/* 0x0E78 */ u32 pictoFlags0;
/* 0x0E7C */ u32 pictoFlags1;
/* 0x0E80 */ UNK_TYPE1 padE80[0x5C];
/* 0x0EDC */ u32 bankRupees;
/* 0x0EE0 */ UNK_TYPE1 padEE0[0x18];
/* 0x0EF8 */ u8 weekEventReg[100];
/* 0x0F5C */ u32 mapsVisited;
/* 0x0F60 */ UNK_TYPE1 padF60[0x8C];
/* 0x0FEC */ u8 lotteryCodes[9];
/* 0x0FF5 */ u8 spiderHouseMaskOrder[6];
/* 0x0FFB */ u8 bomberCode[5];
/* 0x1000 */ UNK_TYPE1 pad1000[0xA];
/* 0x100A */ u16 checksum;
} SaveContextPerm; // size = 0x100C
typedef struct {
/* 0x00 */ Vec3f focalPointChange;
/* 0x0C */ Vec3f eyeChange;
@ -742,7 +628,10 @@ typedef struct {
typedef struct {
/* 0x000 */ View view;
/* 0x168 */ UNK_TYPE1 pad168[0xBE];
/* 0x168 */ char unk_168[0xB4];
/* 0x21C */ s16 unk_21C;
/* 0x21E */ s16 unk_21E;
/* 0x220 */ char unk_220[6];
/* 0x226 */ s16 lifeColorChange;
/* 0x228 */ s16 lifeColorChangeDirection;
/* 0x22A */ s16 unk22A;
@ -767,13 +656,12 @@ typedef struct {
/* 0x250 */ s16 unk250;
/* 0x252 */ s16 lifeSizeChange;
/* 0x254 */ s16 lifeSizeChangeDirection; // 1 means shrinking, 0 growing
/* 0x256 */ UNK_TYPE1 pad256[0x06];
/* 0x256 */ char unk_256[0x06];
/* 0x25C */ u16 unk25C;
/* 0x25E */ UNK_TYPE1 pad25E[0x12];
/* 0x25E */ char unk_25E[0x12];
/* 0x270 */ s16 lifeAlpha;
/* 0x272 */ UNK_TYPE1 pad272[0xD6];
}
InterfaceContext; // size = 0x348
/* 0x272 */ char unk_272[0xD6];
} InterfaceContext; // size = 0x348
typedef struct {
/* 0x00 */ UNK_TYPE1 unk0;
@ -1041,13 +929,6 @@ typedef struct {
/* 0x12080 */ UNK_TYPE1 pad12080[0x58];
} MessageContext; // size = 0x120D8
// Full save context
typedef struct {
/* 0x0000 */ SaveContextPerm perm;
/* 0x100C */ SaveContextOwl owl;
/* 0x3CA0 */ SaveContextExtra extra;
} SaveContext; // size = 0x48C8
typedef struct ActorBgMbarChair ActorBgMbarChair;
typedef struct ActorEnBji01 ActorEnBji01;

199
include/z64save.h Normal file
View File

@ -0,0 +1,199 @@
#ifndef _Z64SAVE_H_
#define _Z64SAVE_H_
#include "ultra64.h"
#include "z64math.h"
#include <os.h>
typedef struct {
/* 0x00 */ u8 buttonItems[4][4];
/* 0x10 */ u8 cButtonSlots[4][4];
/* 0x20 */ u16 equipment;
} ItemEquips; // size = 0x0A
typedef struct {
/* 0x00 */ u8 items[24];
/* 0x18 */ u8 masks[24];
/* 0x30 */ s8 ammo[24];
/* 0x48 */ u32 upgrades; // some bits are wallet upgrades
/* 0x4C */ u32 questItems;
/* 0x50 */ u8 dungeonItems[10];
/* 0x5A */ s8 dungeonKeys[10];
/* 0x64 */ s8 strayFairies[10]; // "orange_fairy"
/* 0x6E */ u8 unk_6E[8][3]; // "degnuts_memory_name"
} Inventory; // size = 0x88
typedef struct {
/* 0x00 */ s16 scene;
/* 0x02 */ Vec3s pos;
/* 0x08 */ s16 angle;
} HorseData; // size = 0x0A
typedef struct {
/* 0x0 */ Vec3f pos;
/* 0xC */ s16 yaw;
/* 0xE */ s16 playerParams;
/* 0x10 */ u16 entranceIndex;
/* 0x12 */ u8 roomIndex;
/* 0x13 */ s8 data;
/* 0x14 */ u32 tempSwchFlags;
/* 0x18 */ u32 unk_18;
/* 0x1C */ u32 tempCollectFlags;
} RespawnData; // size = 0x20
typedef struct {
/* 0x0000 */ u32 entranceIndex; // "scene_no"
/* 0x0004 */ u8 equippedMask; // "player_mask"
/* 0x0005 */ u8 unk_05; // "opening_flag"
/* 0x0006 */ u8 unk_06;
/* 0x0007 */ u8 linkAge; // "link_age"
/* 0x0008 */ s32 cutscene; // "day_time"
/* 0x000C */ u16 time; // "zelda_time"
/* 0x000E */ u16 owlSaveLocation;
/* 0x0010 */ s32 isNight; // "asahiru_fg"
/* 0x0014 */ u32 unk_14; // "change_zelda_time"
/* 0x0018 */ s32 day; // "totalday"
/* 0x001C */ u32 daysElapsed; // "eventday"
/* 0x0020 */ u8 playerForm; // "player_character"
/* 0x0021 */ u8 snowheadCleared; // "spring_flag"
/* 0x0022 */ u8 hasTatl; // "bell_flag"
/* 0x0023 */ u8 isOwlSave;
/* 0x0024 */ char newf[6]; // Will always be "ZELDA3" for a valid save
/* 0x002B */ u16 deaths; // "savect"
/* 0x002C */ char playerName[8]; // "player_name"
/* 0x0034 */ s16 healthCapacity; // "max_life"
/* 0x0036 */ s16 health; // "now_life"
/* 0x0038 */ s8 magicLevel; // "magic_max"
/* 0x0039 */ s8 magic; // "magic_now"
/* 0x003A */ s16 rupees; // "lupy_count"
/* 0x003C */ u16 swordHealth; // "long_sword_hp"
/* 0x003E */ u16 naviTimer; // "navi_timer"
/* 0x0040 */ u8 magicAcquired; // "magic_mode"
/* 0x0041 */ u8 doubleMagic; // "magic_ability"
/* 0x0042 */ u8 doubleDefense; // "life_ability"
/* 0x0043 */ u8 unk_43; // "ocarina_round"
/* 0x0044 */ u8 unk_44; // "first_memory"
/* 0x0046 */ u16 unk_46; // "memory_warp_point"
/* 0x0048 */ u8 unk_48; // "last_warp_pt"
/* 0x004A */ s16 savedSceneNum; // "scene_data_ID"
/* 0x004C */ ItemEquips equips;
/* 0x0070 */ Inventory inventory;
/* 0x00F8 */ u32 roomInf[128][7];
/* 0x0EF8 */ u8 weekEventReg[100]; // "week_event_reg"
/* 0x0F5C */ u32 mapsVisited; // "area_arrival"
/* 0x0F60 */ u32 unk_F60; // "cloud_clear"
/* 0x0F64 */ u8 unk_F64; // "oca_rec_flag"
/* 0x0F65 */ u8 unk_F65; // "oca_rec_flag8"
/* 0x0F66 */ u8 unk_F66[128]; // "oca_rec_buff8"
/* 0x0FE6 */ s8 unk_FE6; // "aikotoba_index"
/* 0x0FE7 */ s8 unk_FE7[5]; // "aikotoba_table"
/* 0x0FEC */ s8 lotteryCodes[3][3]; // "numbers_table"
/* 0x0FF5 */ s8 spiderHouseMaskOrder[6]; // "kinsta_color_table"
/* 0x0FFB */ s8 bomberCode[5]; // "bombers_aikotoba_table"
/* 0x1000 */ HorseData horseData;
/* 0x100A */ u16 checksum; // "check_sum"
/* 0x100C */ u8 eventInf[8];
/* 0x1014 */ u8 unk_1014; // "stone_set_flag"
/* 0x1015 */ u8 unk_1015;
/* 0x1016 */ u16 unk_1016;
/* 0x1018 */ s16 rupeeAccumulator; // "lupy_udct"
/* 0x101A */ u8 unk_101A[6]; // "bottle_status", one entry for each bottle
/* 0x1020 */ OSTime unk_1020[6]; // "bottle_ostime", one entry for each bottle
/* 0x1050 */ OSTime unk_1050[6]; // "bottle_sub", one entry for each bottle
/* 0x1080 */ OSTime unk_1080[6]; // "bottle_time", one entry for each bottle
/* 0x10B0 */ OSTime unk_10B0[6]; // "bottle_stop_time", one entry for each bottle
/* 0x10E0 */ u64 pictoPhoto[1400]; // buffer containing the pictograph photo
/* 0x3CA0 */ s32 fileNum; // "file_no"
/* 0x3CA4 */ s16 powderKegTimer; // "big_bom_timer"
/* 0x3CA6 */ u8 unk_3CA6;
/* 0x3CA7 */ u8 unk_3CA7; // "day_night_flag"
/* 0x3CA8 */ s32 gameMode; // "mode"
/* 0x3CAC */ s32 sceneSetupIndex; // "counter"
/* 0x3CB0 */ s32 respawnFlag; // "restart_flag"
/* 0x3CB4 */ RespawnData respawn[8]; // "restart_data"
/* 0x3DB4 */ f32 entranceSpeed; // "player_wipe_speedF"
/* 0x3DB8 */ u16 entranceSound; // "player_wipe_door_SE"
/* 0x3DBA */ u8 unk_3DBA; // "player_wipe_item"
/* 0x3DBB */ u8 unk_3DBB; // "next_walk"
/* 0x3DBC */ u16 dogParams; // "dog_flag"
/* 0x3DBE */ u8 textTriggerFlags; // "guide_status"
/* 0x3DBF */ u8 showTitleCard; // "name_display"
/* 0x3DC0 */ s16 unk_3DC0; // "shield_magic_timer"
/* 0x3DC2 */ u8 unk_3DC2; // "pad1"
/* 0x3DC8 */ OSTime unk_3DC8; // "get_time"
/* 0x3DD0 */ u8 unk_3DD0[7]; // "event_fg"
/* 0x3DD7 */ u8 unk_3DD7[7]; // "calc_flag"
/* 0x3DE0 */ OSTime unk_3DE0[7]; // "event_ostime"
/* 0x3E18 */ OSTime unk_3E18[7]; // "event_sub"
/* 0x3E50 */ OSTime unk_3E50[7]; // "func_time"
/* 0x3E88 */ OSTime unk_3E88[7]; // "func_end_time"
/* 0x3EC0 */ OSTime unk_3EC0[7]; // "func_stop_time"
/* 0x3EF8 */ s16 timerX[7]; // "event_xp"
/* 0x3F06 */ s16 timerY[7]; // "event_yp"
/* 0x3F14 */ s16 unk_3F14; // "character_change"
/* 0x3F16 */ u8 seqIndex; // "old_bgm"
/* 0x3F17 */ u8 nightSeqIndex; // "old_env"
/* 0x3F18 */ u8 buttonStatus[6]; // "button_item"
/* 0x3F1E */ u8 unk_3F1E; // "ck_fg"
/* 0x3F20 */ u16 unk_3F20; // "alpha_type"
/* 0x3F22 */ u16 unk_3F22; // "prev_alpha_type"
/* 0x3F24 */ u16 unk_3F24; // "alpha_count"
/* 0x3F26 */ u16 unk_3F26; // "last_time_type"
/* 0x3F28 */ s16 unk_3F28; // "magic_flag"
/* 0x3F2A */ s16 unk_3F2A; // "recovery_magic_flag"
/* 0x3F2C */ s16 unk_3F2C; // "keep_magic_flag"
/* 0x3F2E */ s16 unk_3F2E; // "magic_now_max"
/* 0x3F30 */ s16 unk_3F30; // "magic_now_now"
/* 0x3F32 */ s16 unk_3F32; // "magic_used"
/* 0x3F34 */ s16 unk_3F34; // "magic_recovery"
/* 0x3F36 */ u16 mapIndex; // "scene_ID"
/* 0x3F38 */ u16 minigameState; // "yabusame_mode"
/* 0x3F3A */ u16 minigameScore; // "yabusame_total"
/* 0x3F3C */ u16 unk_3F3C; // "yabusame_out_ct"
/* 0x3F3E */ u8 unk_3F3E; // "no_save"
/* 0x3F3F */ u8 unk_3F3F; // "flash_flag"
/* 0x3F40 */ u16 option_id; // "option_id"
/* 0x3F42 */ u8 language; // "j_n"
/* 0x3F43 */ u8 audioSetting; // "s_sound"
/* 0x3F44 */ u8 unk_3F44; // "language"
/* 0x3F45 */ u8 zTargetSetting; // 0: Switch; 1: Hold
/* 0x3F46 */ u16 unk_3F46; // "NottoriBgm"
/* 0x3F48 */ u8 unk_3F48; // "fade_go"
/* 0x3F4A */ u16 unk_3F4A; // "next_daytime"
/* 0x3F4C */ u8 cutsceneTrigger; // "doukidemo"
/* 0x3F4D */ u8 unk_3F4D; // "Kenjya_no"
/* 0x3F4E */ u16 nextDayTime; // "next_zelda_time"
/* 0x3F50 */ u8 fadeDuration; // "fade_speed"
/* 0x3F51 */ u8 unk_3F51; // "wipe_speed"
/* 0x3F52 */ u16 environmentTime; // "kankyo_time"
/* 0x3F54 */ u8 dogIsLost; // "dog_event_flag"
/* 0x3F55 */ u8 nextTransition; // "next_wipe"
/* 0x3F56 */ s16 worldMapArea; // "area_type"
/* 0x3F58 */ s16 unk_3F58; // "sunmoon_flag"
/* 0x3F5A */ s16 healthAccumulator; // "life_mode"
/* 0x3F5C */ s32 unk_3F5C; // "bet_rupees"
/* 0x3F60 */ u8 unk_3F60; // "framescale_flag"
/* 0x3F64 */ f32 unk_3F64; // "framescale_scale"
/* 0x3F68 */ u32 unk_3F68[5][120];
/* 0x48C8 */ u16 unk_48C8; // "scene_id_mix"
/* 0x48CA */ u8 unk_48CA[27];
} SaveContext; // size = 0x48C8
typedef enum {
/* 0x00 */ RESPAWN_MODE_VOID_OUT,
/* 0x01 */ RESPAWN_MODE_GROTTO, // Exiting a grotto
/* 0x02 */ RESPAWN_MODE_FARORES_WIND, // Unused in MM
/* 0x03 */ RESPAWN_MODE_GORON,
/* 0x04 */ RESPAWN_MODE_ZORA,
/* 0x05 */ RESPAWN_MODE_DEKU,
/* 0x06 */ RESPAWN_MODE_CHILD_LINK,
/* 0x07 */ RESPAWN_MODE_UNK_7,
/* 0x07 */ RESPAWN_MODE_UNK_8,
} RespawnMode;
typedef enum {
/* 0x00 */ BTN_ENABLED,
/* 0xFF */ BTN_DISABLED = 0xFF
} ButtonStatus;
#endif

View File

@ -329,15 +329,11 @@ typedef struct {
} EntranceTableEntry; // size = 0x4
typedef struct {
/* 0x0 */ u32 tableCount : 8;
/* 0x0 */ u32 tableCount : 8; // unused
/* 0x4 */ EntranceTableEntry** table;
/* 0x8 */ char* name;
/* 0x8 */ char* name; // unused
} SceneEntranceTableEntry; // size = 0xC
typedef struct {
/* 0x00 */ u16 scenes[27];
} SceneIdList; // size = 0x36
typedef struct {
/* 0x00 */ s16 id; // Negative ids mean that the object is unloaded
/* 0x02 */ UNK_TYPE1 pad2[0x2];

View File

@ -407,7 +407,7 @@ SECTIONS
build/src/code/z_rcp.o(.text)
. += 0x10;
build/src/code/z_room.o(.text)
build/asm/code/code_0x8012EC80.o(.text)
build/src/code/code_0x8012EC80.o(.text)
build/src/code/z_scene.o(.text)
build/src/code/z_scene_proc.o(.text)
build/src/code/z_scene_table.o(.text)
@ -527,7 +527,7 @@ SECTIONS
build/asm/code/code_data_0x8012A080.o(.data)
build/src/code/z_rcp.o(.data)
build/asm/code/code_data_z_room.o(.data)
build/asm/code/code_data_0x801C1D30.o(.data)
build/src/code/code_0x8012EC80.o(.data)
build/src/code/z_scene.o(.data)
build/asm/code/code_data_0x801C2730.o(.data)
build/src/code/z_scene_proc.o(.data)
@ -601,6 +601,7 @@ SECTIONS
build/asm/code/code_rodata_z_player_lib.o(.rodata)
build/asm/code/code_rodata_0x8012A080.o(.rodata)
build/asm/code/code_rodata_z_room.o(.rodata)
build/src/code/code_0x8012EC80.o(.rodata)
build/src/code/z_scene_proc.o(.rodata)
build/src/code/z_scene_table.o(.rodata)
build/asm/code/code_rodata_z_skin.o(.rodata)

406
src/code/code_0x8012EC80.c Normal file
View File

@ -0,0 +1,406 @@
#include <ultra64.h>
#include <global.h>
// Bit Flag array in which gBitFlags[n] is literally (1 << n)
u32 gBitFlags[] = {
(1 << 0), (1 << 1), (1 << 2), (1 << 3), (1 << 4), (1 << 5), (1 << 6), (1 << 7),
(1 << 8), (1 << 9), (1 << 10), (1 << 11), (1 << 12), (1 << 13), (1 << 14), (1 << 15),
(1 << 16), (1 << 17), (1 << 18), (1 << 19), (1 << 20), (1 << 21), (1 << 22), (1 << 23),
(1 << 24), (1 << 25), (1 << 26), (1 << 27), (1 << 28), (1 << 29), (1 << 30), (1 << 31),
};
u16 gEquipMasks[] = { 0x000F, 0x00F0, 0x0F00, 0xF000 };
u16 gEquipNegMasks[] = { 0xFFF0, 0xFF0F, 0xF0FF, 0x0FFF };
u32 gUpgradeMasks[] = {
0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000,
};
u32 gUpgradeNegMasks[] = {
0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF,
};
u8 gEquipShifts[] = { 0, 4, 8, 12 };
u8 gUpgradeShifts[] = { 0, 3, 6, 9, 12, 14, 17, 20, 0, 0, 0, 30, 0, 40, 0, 50 };
u16 gUpgradeCapacities[][4] = {
{ 0, 20, 30, 40 }, // Bomb Bags
{ 0, 0, 0, 0 }, // Unused (Scale)
{ 0, 0, 0, 0 }, // Unused (Strength)
{ 99, 200, 500, 500 }, // Wallets
{ 0, 30, 40, 50 }, // Quivers
{ 0, 10, 20, 30 }, // Unused (Deku Stick)
{ 0, 20, 30, 40 }, // Unused (Deku Nut)
};
u32 gGsFlagsMask[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 };
u32 gGsFlagsShift[] = { 0, 8, 16, 24 };
// TODO: use symbols for these icon textures once textures are properly in C
void* gItemIcons[] = {
0x08000000, 0x08001000, 0x08002000, 0x08003000, 0x08004000, 0x08005000, 0x08006000, 0x08007000, 0x08008000,
0x08009000, 0x0800A000, 0x0800B000, 0x0800C000, 0x0800D000, 0x0800E000, 0x0800F000, 0x08010000, 0x08011000,
0x08012000, 0x08013000, 0x08014000, 0x08015000, 0x08016000, 0x08017000, 0x08018000, 0x08019000, 0x0801A000,
0x0801B000, 0x0801C000, 0x0801D000, 0x0801E000, 0x0801F000, 0x08020000, 0x08021000, 0x08022000, 0x08023000,
0x08024000, 0x08025000, 0x08026000, 0x08027000, 0x08028000, 0x08029000, 0x0802A000, 0x0802B000, 0x0802C000,
0x0802D000, 0x0802E000, 0x0802F000, 0x08030000, 0x08031000, 0x08032000, 0x08033000, 0x08034000, 0x08035000,
0x08036000, 0x08037000, 0x08038000, 0x08039000, 0x0803A000, 0x0803B000, 0x0803C000, 0x0803D000, 0x0803E000,
0x0803F000, 0x08040000, 0x08041000, 0x08042000, 0x08043000, 0x08044000, 0x08045000, 0x08046000, 0x08047000,
0x08048000, 0x08049000, 0x0804A000, 0x0804B000, 0x0804C000, 0x0804D000, 0x0804E000, 0x0804F000, 0x08050000,
0x08051000, 0x08052000, 0x08053000, 0x08054000, 0x08055000, 0x08056000, 0x08057000, 0x08058000, 0x08059000,
0x0805A000, 0x0805B000, 0x0805C000, 0x0805D000, 0x0805E000, 0x0805F000, 0x08060000, 0x08062000, 0x08062000,
0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000, 0x08062000,
0x08062000, 0x08061000, 0x09000000, 0x09000900, 0x09001200, 0x08062000, 0x08062000, 0x08062000, 0x09003600,
0x09004800, 0x09003F00, 0x09005100, 0x09005A00, 0x09006300, 0x09006C00, 0x08062180, 0x08062A80, 0x08063380,
0x020028A0, 0x020025A0, 0x020027A0, 0x020026A0, 0x020024A0,
};
// Used to map item IDs to inventory slots
u8 gItemSlots[] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x05, 0x05, 0x05, 0x05, 0x05, 0x0B, 0x0B, 0x11,
0x11, 0x11, 0x1D, 0x23, 0x29, 0x2F, 0x28, 0x26, 0x19, 0x20, 0x1E, 0x2C, 0x24, 0x25, 0x18, 0x27,
0x1C, 0x2B, 0x21, 0x2A, 0x2D, 0x1B, 0x1F, 0x1A, 0x22, 0x2E, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
};
u16 gItemPrices[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 20, 20, 0, 20,
5, 20, 20, 50, 50, 200, 20, 20, 20, 200, 5, 0, 200, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
// Used to map scene indexes to their region in Termina
u16 gScenesPerRegion[11][27] = {
// Great Bay
{
SCENE_30GYOSON,
SCENE_LABO,
SCENE_FISHERMAN,
SCENE_SINKAI,
SCENE_31MISAKI,
SCENE_TORIDE,
SCENE_KAIZOKU,
SCENE_PIRATE,
SCENE_35TAKI,
SCENE_KINDAN2,
-1,
},
// Zora Hall
{
SCENE_33ZORACITY,
SCENE_BANDROOM,
-1,
},
// Romani Ranch
{
SCENE_F01,
SCENE_ROMANYMAE,
SCENE_OMOYA,
SCENE_F01C,
SCENE_F01_B,
SCENE_KOEPONARACE,
-1,
},
// Deku Palace
{
SCENE_22DEKUCITY,
SCENE_DEKU_KING,
SCENE_26SARUNOMORI,
SCENE_DANPEI,
-1,
},
// Southern Swamp
{
SCENE_20SICHITAI,
SCENE_20SICHITAI2,
SCENE_MAP_SHOP,
SCENE_WITCH_SHOP,
SCENE_21MITURINMAE,
SCENE_KINSTA1,
-1,
},
// Clock Town
{
SCENE_00KEIKOKU, SCENE_TENMON_DAI, SCENE_13HUBUKINOMITI,
SCENE_24KEMONOMITI, SCENE_SYATEKI_MORI, SCENE_IKANAMAE,
SCENE_TOWN, SCENE_SYATEKI_MIZU, SCENE_BOWLING,
SCENE_TAKARAYA, SCENE_YADOYA, SCENE_SONCHONOIE,
SCENE_MILK_BAR, SCENE_ICHIBA, SCENE_BOMYA,
SCENE_AYASHIISHOP, SCENE_8ITEMSHOP, SCENE_DOUJOU,
SCENE_POSTHOUSE, SCENE_TAKARAKUJI, SCENE_BACKTOWN,
SCENE_CLOCKTOWER, SCENE_INSIDETOWER, SCENE_OKUJOU,
SCENE_ALLEY, SCENE_DEKUTES, -1,
},
// Snowhead
{
SCENE_10YUKIYAMANOMURA,
SCENE_10YUKIYAMANOMURA2,
SCENE_KAJIYA,
SCENE_12HAKUGINMAE,
SCENE_14YUKIDAMANOMITI,
SCENE_GORONRACE,
SCENE_GORON_HAKA,
SCENE_17SETUGEN,
SCENE_17SETUGEN2,
-1,
},
// Ikana Graveyard
{
SCENE_BOTI,
SCENE_DANPEI2TEST,
-1,
},
// Ikana Canyon
{
SCENE_CASTLE,
SCENE_IKNINSIDE,
SCENE_IKANA,
SCENE_SECOM,
SCENE_MUSICHOUSE,
SCENE_RANDOM,
SCENE_REDEAD,
SCENE_TOUGITES,
SCENE_HAKASHITA,
-1,
},
// Goron Village
{
SCENE_11GORONNOSATO,
SCENE_11GORONNOSATO2,
SCENE_16GORON_HOUSE,
SCENE_GORONSHOP,
-1,
},
// Stone Tower
{
SCENE_F40,
SCENE_F41,
-1,
},
};
s32 func_8012EC80(GlobalContext* globalCtx) {
if (gSaveContext.buttonStatus[0] == BTN_DISABLED) {
return 0xFF;
} else if (gSaveContext.unk_1015 == 0xFF) {
return 0xFF;
} else if (gSaveContext.equips.buttonItems[((gSaveContext.playerForm == 4) ? 0 : gSaveContext.playerForm)][0] ==
0xFF) {
if (globalCtx->interfaceCtx.unk_21C != 0) {
if (globalCtx->interfaceCtx.unk_21E != 0) {
return globalCtx->interfaceCtx.unk_21E;
}
}
return 0xFF;
} else {
return gSaveContext.equips.buttonItems[((gSaveContext.playerForm == 4) ? 0 : gSaveContext.playerForm)][0];
}
}
void func_8012ED34(s16 equipment);
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012ED34.asm")
u8 func_8012ED78(GlobalContext* globalCtx, s16 equipment);
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012ED78.asm")
void func_8012EDE8(s16 arg0, u32 arg1);
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012EDE8.asm")
s32 func_8012EE34(s16 arg0) {
s16 num = 0;
if (arg0 >= 0x20) {
if (arg0 < 0x40) {
num = 1;
} else if (arg0 < 0x60) {
num = 2;
} else if (arg0 < 0x80) {
num = 3;
} else if (arg0 < 0xA0) {
num = 4;
} else if (arg0 < 0xC0) {
num = 5;
} else if (arg0 < 0xE0) {
num = 6;
}
}
if (gSaveContext.roomInf[125][num] & gBitFlags[arg0 - (num << 5)]) {
return 1;
}
return 0;
}
/* static */ u16 D_801C2380[12][6] = {
{
SCENE_00KEIKOKU,
SCENE_BOTI,
SCENE_13HUBUKINOMITI,
SCENE_24KEMONOMITI,
SCENE_IKANAMAE,
SCENE_TOWN,
},
{
SCENE_ICHIBA,
SCENE_BACKTOWN,
SCENE_CLOCKTOWER,
SCENE_ALLEY,
-1,
},
{
SCENE_20SICHITAI,
SCENE_20SICHITAI2,
SCENE_21MITURINMAE,
SCENE_22DEKUCITY,
SCENE_DEKU_KING,
SCENE_KINSTA1,
},
{ -1 },
{
SCENE_10YUKIYAMANOMURA,
SCENE_10YUKIYAMANOMURA2,
SCENE_11GORONNOSATO,
SCENE_11GORONNOSATO2,
SCENE_16GORON_HOUSE,
SCENE_12HAKUGINMAE,
},
{
SCENE_14YUKIDAMANOMITI,
SCENE_GORONRACE,
SCENE_17SETUGEN,
SCENE_17SETUGEN2,
-1,
},
{
SCENE_F01,
SCENE_ROMANYMAE,
SCENE_OMOYA,
SCENE_F01C,
SCENE_F01_B,
SCENE_KOEPONARACE,
},
{ -1 },
{
SCENE_30GYOSON,
SCENE_SINKAI,
SCENE_31MISAKI,
SCENE_TORIDE,
SCENE_KAIZOKU,
SCENE_33ZORACITY,
},
{
SCENE_35TAKI,
-1,
},
{
SCENE_F40,
SCENE_F41,
SCENE_CASTLE,
SCENE_IKANA,
SCENE_REDEAD,
-1,
},
};
#ifdef NON_EQUIVALENT
// loop seems wrong?
void func_8012EF0C(s16 arg0) {
s16 i;
s16 num;
s16 sceneIndex;
if ((arg0 >= 0) && (arg0 < ARRAY_COUNT(D_801C2380))) {
i = 0;
num = 0;
sceneIndex = D_801C2380[arg0][i];
while (sceneIndex != 0xFFFF) {
sceneIndex = D_801C2380[arg0][i];
if (sceneIndex < 0x20) {
num = 0;
} else if (sceneIndex < 0x40) {
num = 1;
} else if (sceneIndex < 0x60) {
num = 2;
} else if (sceneIndex < 0x80) {
num = 3;
} else if (sceneIndex < 0xA0) {
num = 4;
} else if (sceneIndex < 0xC0) {
num = 5;
} else if (sceneIndex < 0xE0) {
num = 6;
}
gSaveContext.roomInf[125][sceneIndex] |= gBitFlags[(-(num << 7)) + num];
i++;
}
if (i == 0) {
gSaveContext.unk_F60 |= 3;
} else if (i == 1) {
gSaveContext.unk_F60 |= 0x1C;
} else if (i == 2) {
gSaveContext.unk_F60 |= 0xE0;
} else if (i == 3) {
gSaveContext.unk_F60 |= 0x100;
} else if (i == 4) {
gSaveContext.unk_F60 |= 0x1E00;
} else if (i == 5) {
gSaveContext.unk_F60 |= 0x6000;
}
}
dREG(82) = 0;
}
#else
void func_8012EF0C(s16 arg0);
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012EF0C.asm")
#endif
void func_8012F0EC(s16 arg0);
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012F0EC.asm")
#ifdef NON_MATCHING
// regalloc
void func_8012F1BC(s16 sceneIndex) {
if (sceneIndex == SCENE_KINSTA1) {
gSaveContext.roomInf[126][0] = ((((gSaveContext.roomInf[126][0] & 0xFFFF0000) >> 0x10) + 1) << 0x10) |
(gSaveContext.roomInf[126][0] & 0xFFFF);
} else {
gSaveContext.roomInf[126][0] =
((gSaveContext.roomInf[126][0] + 1) & 0xFFFF) | (gSaveContext.roomInf[126][0] & 0xFFFF0000);
}
}
#else
void func_8012F1BC(s16 arg0);
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012F1BC.asm")
#endif
s16 func_8012F22C(s16 sceneIndex) {
if (sceneIndex == SCENE_KINSTA1) {
return (gSaveContext.roomInf[126][0] & 0xFFFF0000) >> 0x10;
} else {
return gSaveContext.roomInf[126][0] & 0xFFFF;
}
}
void func_8012F278(GlobalContext* globalCtx);
#pragma GLOBAL_ASM("./asm/non_matchings/code/code_0x8012EC80/func_8012F278.asm")
u32 D_801C2410[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000101, 0x01010101, 0x01010101, 0x01010101, 0x01010101,
0x01010101, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000100, 0x00000000, 0x00000000, 0x00000101, 0x01000000, 0x01010101, 0x01010101, 0x01010101,
0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x01000000, 0x00000000, 0x00000000, 0x00010100, 0x00000101, 0x01010101,
0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0x00000000, 0x00000001, 0x00000001, 0x01000000,
0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01010101, 0x01010101, 0x01010101,
0x00010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101,
0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01010101, 0x01000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
};

View File

@ -813,22 +813,22 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
}
s16 func_800A7650(s16 dropId) {
s16 maxLife;
s16 healthCapacity;
if ((((dropId == ITEM00_BOMBS_A) || (dropId == ITEM00_BOMBS_0) || (dropId == ITEM00_BOMBS_B)) &&
(gSaveContext.perm.inv.items[D_801C207E] == 0xFF)) ||
(gSaveContext.inventory.items[gItemSlots[6]] == 0xFF)) ||
(((dropId == ITEM00_ARROWS_10) || (dropId == ITEM00_ARROWS_30) || (dropId == ITEM00_ARROWS_40) ||
(dropId == ITEM00_ARROWS_50)) &&
(gSaveContext.perm.inv.items[D_801C2079] == 0xFF)) ||
(((dropId == ITEM00_MAGIC_LARGE) || (dropId == ITEM00_MAGIC_SMALL)) && (gSaveContext.perm.unk24.unk14 == 0))) {
(gSaveContext.inventory.items[gItemSlots[1]] == 0xFF)) ||
(((dropId == ITEM00_MAGIC_LARGE) || (dropId == ITEM00_MAGIC_SMALL)) && (gSaveContext.magicLevel == 0))) {
return ITEM00_NO_DROP;
}
;
if (dropId == ITEM00_HEART) {
maxLife = gSaveContext.perm.unk24.maxLife;
if (maxLife == gSaveContext.perm.unk24.currentLife) {
healthCapacity = gSaveContext.healthCapacity;
if (healthCapacity == gSaveContext.health) {
return ITEM00_RUPEE_GREEN;
}
}
@ -1071,9 +1071,9 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
if (dropId == ITEM00_MASK) {
dropQuantity = 1;
if (gSaveContext.perm.unk20 != 1) {
if (gSaveContext.perm.unk20 != 2) {
if (gSaveContext.perm.unk20 != 4) {
if (gSaveContext.playerForm != 1) {
if (gSaveContext.playerForm != 2) {
if (gSaveContext.playerForm != 4) {
dropId = ITEM00_RUPEE_GREEN;
} else {
dropId = ITEM00_ARROWS_10;
@ -1102,39 +1102,39 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
}
if (dropId == ITEM00_FLEXIBLE) {
if (gSaveContext.perm.unk24.currentLife < 0x11) {
if (gSaveContext.health < 0x11) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
spawnPos->z, 0, 0, 0, 2);
func_800F0568(globalCtx, spawnPos, 0x28, 0x28E7);
return;
}
if (gSaveContext.perm.unk24.currentLife < 0x31) {
if (gSaveContext.health < 0x31) {
params = 0x10;
dropId = ITEM00_HEART;
dropQuantity = 3;
} else if (gSaveContext.perm.unk24.currentLife < 0x51) {
} else if (gSaveContext.health < 0x51) {
params = 0x10;
dropId = ITEM00_HEART;
dropQuantity = 1;
} else if ((gSaveContext.perm.unk24.unk14 != 0) && (gSaveContext.perm.unk24.currentMagic == 0)) {
} else if ((gSaveContext.magicLevel != 0) && (gSaveContext.magic == 0)) {
params = 0xD0;
dropId = ITEM00_MAGIC_LARGE;
dropQuantity = 1;
} else if ((gSaveContext.perm.unk24.unk14 != 0) &&
((gSaveContext.perm.unk24.unk14 >> 1) >= gSaveContext.perm.unk24.currentMagic)) {
} else if ((gSaveContext.magicLevel != 0) &&
((gSaveContext.magicLevel >> 1) >= gSaveContext.magic)) {
params = 0xD0;
dropId = ITEM00_MAGIC_LARGE;
dropQuantity = 1;
} else if (gSaveContext.perm.inv.quantities[D_801C2078[1]] < 6) {
} else if (gSaveContext.inventory.ammo[gItemSlots[1]] < 6) {
params = 0xA0;
dropId = ITEM00_ARROWS_30;
dropQuantity = 1;
} else if (gSaveContext.perm.inv.quantities[D_801C2078[6]] < 6) {
} else if (gSaveContext.inventory.ammo[gItemSlots[6]] < 6) {
params = 0xB0;
dropId = ITEM00_BOMBS_A;
dropQuantity = 1;
} else if (gSaveContext.perm.unk24.unk14 < 11) {
} else if (gSaveContext.rupees < 11) {
params = 0xA0;
dropId = ITEM00_RUPEE_RED;
dropQuantity = 1;

View File

@ -148,12 +148,12 @@ void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
s32 loadedCount;
void* nextObject;
s16 playerObjectId;
u8 unk20;
u8 playerForm;
globalCtx->linkActorEntry = (ActorEntry*)Lib_SegmentedToVirtual(cmd->spawnList.segment) +
globalCtx->setupEntranceList[globalCtx->curSpawn].spawn;
if ((globalCtx->linkActorEntry->params & 0x0F00) >> 8 == 0x0C ||
(gSaveContext.extra.unk10 == 0x02 && gSaveContext.extra.unk42 == 0x0CFF)) {
(gSaveContext.respawnFlag == 0x02 && gSaveContext.respawn[1].playerParams == 0x0CFF)) {
// Skull Kid Object
Object_Spawn(&globalCtx->objectCtx, OBJECT_STK);
return;
@ -163,8 +163,8 @@ void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
nextObject = globalCtx2->objectCtx.status[globalCtx2->objectCtx.num].segment;
globalCtx->objectCtx.num = loadedCount;
globalCtx->objectCtx.spawnedObjectCount = loadedCount;
unk20 = gSaveContext.perm.unk20;
playerObjectId = gLinkFormObjectIndexes[unk20];
playerForm = gSaveContext.playerForm;
playerObjectId = gLinkFormObjectIndexes[playerForm];
gActorOverlayTable[0].initInfo->objectId = playerObjectId;
Object_Spawn(&globalCtx->objectCtx, playerObjectId);
@ -384,7 +384,7 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
u32 dayTime;
if (cmd->timeSettings.hour != 0xFF && cmd->timeSettings.min != 0xFF) {
gSaveContext.extra.environmentTime = gSaveContext.perm.time =
gSaveContext.environmentTime = gSaveContext.time =
(u16)(((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f);
}
@ -394,32 +394,32 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->kankyoContext.unk2 = 0;
}
if ((gSaveContext.perm.inv.items[0] == 0xFF) && (globalCtx->kankyoContext.unk2 != 0)) {
if ((gSaveContext.inventory.items[0] == 0xFF) && (globalCtx->kankyoContext.unk2 != 0)) {
globalCtx->kankyoContext.unk2 = 5;
}
if (gSaveContext.extra.unk2b8 == 0) {
if (gSaveContext.unk_3F58 == 0) {
REG(15) = globalCtx->kankyoContext.unk2;
}
dayTime = gSaveContext.perm.time;
dayTime = gSaveContext.time;
globalCtx->kankyoContext.unk4 = -(Math_SinS(dayTime - 0x8000) * 120.0f) * 25.0f;
dayTime = gSaveContext.perm.time;
dayTime = gSaveContext.time;
globalCtx->kankyoContext.unk8 = (Math_CosS(dayTime - 0x8000) * 120.0f) * 25.0f;
dayTime = gSaveContext.perm.time;
dayTime = gSaveContext.time;
globalCtx->kankyoContext.unkC = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
if (globalCtx->kankyoContext.unk2 == 0 && gSaveContext.perm.cutscene < 0xFFF0) {
gSaveContext.extra.environmentTime = gSaveContext.perm.time;
if (globalCtx->kankyoContext.unk2 == 0 && gSaveContext.cutscene < 0xFFF0) {
gSaveContext.environmentTime = gSaveContext.time;
if (gSaveContext.extra.environmentTime >= 0x2AAA && gSaveContext.extra.environmentTime < 0x4555) {
gSaveContext.extra.environmentTime = 0x3555;
} else if (gSaveContext.extra.environmentTime >= 0x4555 && gSaveContext.extra.environmentTime < 0x5555) {
gSaveContext.extra.environmentTime = 0x5555;
} else if (gSaveContext.extra.environmentTime >= 0xAAAA && gSaveContext.extra.environmentTime < 0xB555) {
gSaveContext.extra.environmentTime = 0xB555;
} else if (gSaveContext.extra.environmentTime >= 0xC000 && gSaveContext.extra.environmentTime < 0xCAAA) {
gSaveContext.extra.environmentTime = 0xCAAA;
if (gSaveContext.environmentTime >= 0x2AAA && gSaveContext.environmentTime < 0x4555) {
gSaveContext.environmentTime = 0x3555;
} else if (gSaveContext.environmentTime >= 0x4555 && gSaveContext.environmentTime < 0x5555) {
gSaveContext.environmentTime = 0x5555;
} else if (gSaveContext.environmentTime >= 0xAAAA && gSaveContext.environmentTime < 0xB555) {
gSaveContext.environmentTime = 0xB555;
} else if (gSaveContext.environmentTime >= 0xC000 && gSaveContext.environmentTime < 0xCAAA) {
gSaveContext.environmentTime = 0xCAAA;
}
}
}
@ -450,7 +450,7 @@ void Scene_HeaderCmdSoundSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->unk814 = cmd->soundSettings.musicSeq;
globalCtx->unk815 = cmd->soundSettings.nighttimeSFX;
if (gSaveContext.extra.unk276 == 0xFF || func_801A8A50(0) == 0x57) {
if (gSaveContext.seqIndex == 0xFF || func_801A8A50(0) == 0x57) {
audio_setBGM(cmd->soundSettings.bgmId);
}
}
@ -465,9 +465,9 @@ void Scene_HeaderCmdAltHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
SceneCmd** altHeaderList;
SceneCmd* altHeader;
if (gSaveContext.extra.sceneSetupIndex) {
if (gSaveContext.sceneSetupIndex) {
altHeaderList = (SceneCmd**)Lib_SegmentedToVirtual(cmd->altHeaders.segment);
altHeader = altHeaderList[gSaveContext.extra.sceneSetupIndex - 1];
altHeader = altHeaderList[gSaveContext.sceneSetupIndex - 1];
if (altHeader != NULL) {
Scene_ProcessHeader(globalCtx, (SceneCmd*)Lib_SegmentedToVirtual(altHeader));
@ -509,24 +509,24 @@ void Scene_HeaderCmdSetAreaVisitedFlag(GlobalContext* globalCtx, SceneCmd* cmd)
s16 i = 0;
while (true) {
if (scenesPerMapArea[i].scenes[j] == 0xFFFF) {
if (gScenesPerRegion[i][j] == 0xFFFF) {
i++;
j = 0;
if (i == (s32)(sizeof(scenesPerMapArea) / sizeof(SceneIdList))) {
if (i == ARRAY_COUNT(gScenesPerRegion)) {
break;
}
}
if (globalCtx->sceneNum == scenesPerMapArea[i].scenes[j]) {
if (globalCtx->sceneNum == gScenesPerRegion[i][j]) {
break;
}
j++;
}
if (i < (s32)(sizeof(scenesPerMapArea) / sizeof(SceneIdList))) {
gSaveContext.perm.mapsVisited = (gBitFlags[i] | gSaveContext.perm.mapsVisited) | gSaveContext.perm.mapsVisited;
if (i < ARRAY_COUNT(gScenesPerRegion)) {
gSaveContext.mapsVisited = (gBitFlags[i] | gSaveContext.mapsVisited) | gSaveContext.mapsVisited;
}
}
@ -609,5 +609,5 @@ u16 Entrance_CreateIndex(s32 sceneIndex, s32 spawnIndex, s32 sceneSetup) {
* Creates an entrance index from the current entrance index with the given spawn index.
*/
u16 Entrance_CreateIndexFromSpawn(s32 spawnIndex) {
return Entrance_CreateIndex(gSaveContext.perm.entranceIndex >> 9, spawnIndex, 0);
return Entrance_CreateIndex(gSaveContext.entranceIndex >> 9, spawnIndex, 0);
}

View File

@ -2657,7 +2657,7 @@ static EntranceTableEntry* sCutsceneEntranceTable[] = {
#define SCENE_ENTRANCE_NONE() \
{ 0, NULL, NULL }
/*static*/ SceneEntranceTableEntry sSceneEntranceTable[] = {
static SceneEntranceTableEntry sSceneEntranceTable[] = {
SCENE_ENTRANCE(sMayorsResidenceEntranceTable, "Z2_SONCHONOIE"),
SCENE_ENTRANCE(sMajorasLairEntranceTable, "Z2_LAST_BS"),
SCENE_ENTRANCE(sMagicHagsPotionShopEntranceTable, "Z2_WITCH_SHOP"),

View File

@ -13,8 +13,8 @@ s32 func_8013A240(GlobalContext* globalCtx) {
s32 seen;
s32 count = 0;
gSaveContext.perm.pictoFlags0 = 0;
gSaveContext.perm.pictoFlags1 = 0;
gSaveContext.roomInf[123][3] = 0;
gSaveContext.roomInf[123][4] = 0;
if (globalCtx->sceneNum == SCENE_20SICHITAI) {
func_8013A41C(1);
@ -77,29 +77,30 @@ s32 func_8013A240(GlobalContext* globalCtx) {
void func_8013A41C(s32 flag) {
if (flag < 0x20) {
gSaveContext.perm.pictoFlags0 |= (1 << flag);
gSaveContext.roomInf[123][3] |= (1 << flag);
} else {
flag &= 0x1F;
gSaveContext.perm.pictoFlags1 |= (1 << flag);
gSaveContext.roomInf[123][4] |= (1 << flag);
}
}
void func_8013A46C(s32 flag) {
if (flag < 0x20) {
gSaveContext.perm.pictoFlags0 &= ~(1 << flag);
gSaveContext.roomInf[123][3] &= ~(1 << flag);
} else {
flag &= 0x1F;
gSaveContext.perm.pictoFlags1 &= ~(1 << flag);
gSaveContext.roomInf[123][4] &= ~(1 << flag);
}
}
u32 func_8013A4C4(s32 flag) {
SaveContextPerm* save = &gSaveContext.perm;
SaveContext* saveCtx = &gSaveContext;
if (flag < 0x20) {
return save->pictoFlags0 & (1 << flag);
return saveCtx->roomInf[123][3] & (1 << flag);
} else {
flag &= 0x1F;
return save->pictoFlags1 & (1 << flag);
return saveCtx->roomInf[123][4] & (1 << flag);
}
}

View File

@ -188,7 +188,7 @@ void BgKin2Fence_HandleMaskCode(BgKin2Fence* this, GlobalContext* globalCtx) {
if (this->collider.base.acFlags & 2) {
hitMask = BgKin2Fence_CheckHitMask(this);
if (hitMask >= 0) {
nextMask = (s8)gSaveContext.perm.spiderHouseMaskOrder[this->masksHit];
nextMask = (s8)gSaveContext.spiderHouseMaskOrder[this->masksHit];
if (hitMask == nextMask) {
play_sound(0x4807);
this->masksHit += 1;

View File

@ -99,7 +99,7 @@ void BgLotus_Wait(BgLotus* this, GlobalContext* globalCtx) {
EffectSsGRipple_Spawn(globalCtx, &this->dyna.actor.world.pos, 1000, 1400, 8);
this->timer = 40;
}
if (gSaveContext.perm.unk20 != 3) {
if (gSaveContext.playerForm != 3) {
this->timer = 40;
this->dyna.actor.flags |= 0x10;
this->actionFunc = BgLotus_Sink;

View File

@ -30,7 +30,7 @@ const ActorInit Dm_Ravine_InitVars = {
void DmRavine_Init(Actor* thisx, GlobalContext* globalCtx) {
DmRavine* this = THIS;
u8 flag = gSaveContext.perm.weekEventReg[0];
u8 flag = gSaveContext.weekEventReg[0];
if (((flag & 0x10) | cREG(0)) != 0) {
Actor_MarkForDeath(&this->actor);
return;

View File

@ -142,11 +142,11 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) {
func_80169E6C(globalCtx, 3, 0x4FF);
gSaveContext.extra.unk78 = this->actor.world.pos.y;
gSaveContext.extra.unk80 = this->actor.home.rot.y;
gSaveContext.respawn[3].pos.y = this->actor.world.pos.y;
gSaveContext.respawn[3].yaw = this->actor.home.rot.y;
// save the params lower byte for En_Torch to decide what item to use in the grotto chest
gSaveContext.extra.unk87 = GET_DOORANA_ITEMFLAGS(this);
gSaveContext.respawn[3].data = GET_DOORANA_ITEMFLAGS(this);
// most grottos in the game use their zrotation as their entrance index, not params
if (DOORANA_TYPE_ROTATION_ENTRANCE(entranceIndex)) {

View File

@ -63,7 +63,7 @@ void EnCha_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.home.rot.z = 0;
this->actionFunc = EnCha_Idle;
this->actor.home.rot.x = this->actor.home.rot.z;
gSaveContext.perm.weekEventReg[60] &= 0xFB;
gSaveContext.weekEventReg[60] &= 0xFB;
}
void EnCha_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@ -85,16 +85,16 @@ void EnCha_Ring(EnCha* this, GlobalContext* globalCtx) {
}
void EnCha_Idle(EnCha* this, GlobalContext* globalCtx) {
if (gSaveContext.perm.weekEventReg[60] & 4) {
if (gSaveContext.weekEventReg[60] & 4) {
Audio_PlayActorSound2(&this->actor, 0x289E);
gSaveContext.perm.weekEventReg[60] &= 0xFB;
gSaveContext.weekEventReg[60] &= 0xFB;
this->actor.home.rot.z = 0x7D0;
}
if (this->collider.base.acFlags & AC_HIT) {
Audio_PlayActorSound2(&this->actor, 0x289E);
this->actor.home.rot.z = 0x7D0;
if (!(gSaveContext.perm.weekEventReg[51] & 4)) {
gSaveContext.perm.weekEventReg[51] |= 4;
if (!(gSaveContext.weekEventReg[51] & 4)) {
gSaveContext.weekEventReg[51] |= 4;
this->actionFunc = EnCha_Ring;
}
}

View File

@ -111,13 +111,13 @@ void EnGinkoMan_Idle(EnGinkoMan* this, GlobalContext* globalCtx) {
dYaw = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
EnGinkoMan_SwitchAnimation(this, globalCtx);
if (func_800B84D0(&this->actor, globalCtx)) { // Listen for dialogue start?
if ((gSaveContext.perm.bankRupees & 0xFFFF) == 0) {
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING);
func_801518B0(globalCtx, 0x44C, &this->actor);
this->curTextId = 0x44C; // would you like to make an account
} else {
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
if ((CURRENT_DAY == 3) && (gSaveContext.perm.isNight == 1)) {
if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
func_801518B0(globalCtx, 0x467, &this->actor);
this->curTextId = 0x467; // "What's this? You need somethin' on a day like this?
} else {
@ -151,7 +151,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
case 0: // "Hey there, little guy! Won't you deposit some Rupees? (first dialogue)
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
if ((gSaveContext.perm.weekEventReg[10] & 8) != 0) {
if ((gSaveContext.weekEventReg[10] & 8) != 0) {
func_801518B0(globalCtx, 0x44E, &this->actor);
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
} else {
@ -185,7 +185,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
if (this->curTextId == 0x453) { // "That's it? That ain't nothing at all, big spender!
func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING);
}
globalCtx->msgCtx.bankRupees = gSaveContext.perm.bankRupees & 0xFFFF;
globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF;
func_801518B0(globalCtx, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
}
@ -200,11 +200,11 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
/***** WARNING: this case is non-equivelent ****/
tempEDC = gSaveContext.perm.bankRupees & 0xFFFF;
tempEDC = gSaveContext.roomInf[127][0] & 0xFFFF;
if ((tempEDC >= 200) && (this->previousBankValue < 200) &&
((gSaveContext.perm.weekEventReg[0x3B] & 0x40) == 0)) {
((gSaveContext.weekEventReg[0x3B] & 0x40) == 0)) {
// block_20:
gSaveContext.perm.weekEventReg[0x3B] = gSaveContext.perm.weekEventReg[0x3B] | 0x40;
gSaveContext.weekEventReg[0x3B] = gSaveContext.weekEventReg[0x3B] | 0x40;
func_801518B0(globalCtx, 0x45B, &this->actor);
this->curTextId = 0x45B; // "What's this? You've already saved up 200 Rupees!?!
return;
@ -212,24 +212,24 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
// "branch likely" when shouldn't be
if ((tempEDC >= 1000) && ((this->previousBankValue) < 1000) &&
(gSaveContext.perm.weekEventReg[0x3B] & 0x80) == 0) {
(gSaveContext.weekEventReg[0x3B] & 0x80) == 0) {
// block_24:
gSaveContext.perm.weekEventReg[0x3B] |= 0x80;
gSaveContext.weekEventReg[0x3B] |= 0x80;
func_801518B0(globalCtx, 0x45C, &this->actor);
this->curTextId = 0x45C; // "What's this? You've already saved up 1000 Rupees!?!
return;
} // bright blue arrow
if ((this->previousBankValue) >= 5000) { // added back in because missing
if ((((s16)tempEDC) < 5000) && ((gSaveContext.perm.weekEventReg[0x3B] & 1) == 0)) {
gSaveContext.perm.weekEventReg[0x3B] |= 1;
if ((((s16)tempEDC) < 5000) && ((gSaveContext.weekEventReg[0x3B] & 1) == 0)) {
gSaveContext.weekEventReg[0x3B] |= 1;
func_801518B0(globalCtx, 0x45D, &this->actor);
this->curTextId = 0x45D; // "What's this? You've already saved up 5000 Rupees?!
return;
} else { // olive arrow
// block_28:
if (this->previousBankValue < gSaveContext.perm.bankRupees) {
// if (*previousBankValue < gSaveContext.perm.bankRupees) {
if (this->previousBankValue < gSaveContext.roomInf[127][0]) {
// if (*previousBankValue < gSaveContext.roomInf[127][0]) {
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
func_801518B0(globalCtx, 0x45E, &this->actor);
this->curTextId =
@ -277,7 +277,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
return;
case 25: // "There! Now I'll know you when I see you!"
func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING);
globalCtx->msgCtx.bankRupees = gSaveContext.perm.bankRupees & 0xFFFF;
globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF;
func_801518B0(globalCtx, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
return;
@ -293,10 +293,10 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
case 32: // "Ah, yes...[Link], right? If I remember, you're the little guy who deposited [rupees]."
case 50: // "Your deposits total [rupees]."
if (this->choiceDepositWithdrawl == GINKOMAN_CHOICE_DEPOSIT) {
if ((u32)(gSaveContext.perm.bankRupees & 0xFFFF) >= 0x1388) {
if ((u32)(gSaveContext.roomInf[127][0] & 0xFFFF) >= 0x1388) {
func_801518B0(globalCtx, 0x45F, &this->actor);
this->curTextId = 0x45F; // "Excuuuse me! But I can't take anymore deposits!
} else if (gSaveContext.perm.unk24.currentRupees == 0) {
} else if (gSaveContext.rupees == 0) {
func_801518B0(globalCtx, 0x458, &this->actor);
this->curTextId =
0x458; // "Hmm...You play mean jokes, little guy! You haven't even got a single Rupee!
@ -304,7 +304,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
func_801518B0(globalCtx, 0x479, &this->actor);
this->curTextId = 0x479; // "Well, are you gonna make a deposit?"
}
} else if ((CURRENT_DAY == 3) && (gSaveContext.perm.isNight == 1)) {
} else if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
func_801518B0(globalCtx, 0x46D, &this->actor);
// "Look, little guy, if it's 'cause of the bad rumors going around, forget it! They're just rumors!"
this->curTextId = 0x46D;
@ -342,12 +342,12 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) { //
case 38: // "What's this? It's a waste to take out such a tiny bit! ...But if you say so!"
case 39: // Use it wisely...
case 40: // "Aw, you're taking out all that? If you spend it like that, it'll all be gone before you know it!"
if ((gSaveContext.perm.bankRupees & 0xFFFF) == 0) {
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
func_801518B0(globalCtx, 0x478, &this->actor);
// "Look, little guy, all the Rupees you deposited are gone, so you can't use that stamp anymore."
this->curTextId = 0x478;
} else {
globalCtx->msgCtx.bankRupees = gSaveContext.perm.bankRupees & 0xFFFF;
globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF;
func_801518B0(globalCtx, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
}
@ -386,13 +386,13 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
case 0x44E: // "...So, what'll it be?
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
if ((gSaveContext.perm.bankRupees & 0xFFFF) >= 0x1388) {
if ((gSaveContext.roomInf[127][0] & 0xFFFF) >= 0x1388) {
play_sound(0x4806); // NA_SE_SY_ERROR
func_801518B0(globalCtx, 0x45F, &this->actor);
this->curTextId = 0x45F; // bank full, cannot accept more
return;
} else {
if (gSaveContext.perm.unk24.currentRupees > 0) {
if (gSaveContext.rupees > 0) {
func_8019F208(0x4806);
func_801518B0(globalCtx, 0x44F, &this->actor);
this->curTextId = 0x44F; // "All right! so..."
@ -413,7 +413,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
case 0x452: // Really? are you really depositing rupees?
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
if (gSaveContext.perm.unk24.currentRupees < globalCtx->msgCtx.bankRupeesSelected) {
if (gSaveContext.rupees < globalCtx->msgCtx.bankRupeesSelected) {
play_sound(0x4806); // NA_SE_SY_ERROR
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
func_801518B0(globalCtx, 0x459, &this->actor);
@ -432,20 +432,20 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
func_801518B0(globalCtx, 0x453, &this->actor);
this->curTextId = 0x453; // That's it? That aint nothing at all
}
if ((gSaveContext.perm.bankRupees & 0xFFFF) == 0) {
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
this->newAccountFlag = 1;
}
func_801159EC((s16) - (s32)globalCtx->msgCtx.bankRupeesSelected);
this->previousBankValue = gSaveContext.perm.bankRupees;
this->previousBankValue = gSaveContext.roomInf[127][0];
gSaveContext.perm.bankRupees =
((gSaveContext.perm.bankRupees & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected) |
(gSaveContext.perm.bankRupees & 0xFFFF0000);
gSaveContext.roomInf[127][0] =
((gSaveContext.roomInf[127][0] & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected) |
(gSaveContext.roomInf[127][0] & 0xFFFF0000);
}
} else { // GINKOMAN_CHOICE_NO
func_8019F230();
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
if ((gSaveContext.perm.bankRupees & 0xFFFF) == 0) { // @B74
if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) { // @B74
func_801518B0(globalCtx, 0x456, &this->actor);
this->curTextId = 0x456; // Is that so? think about it
} else {
@ -481,7 +481,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
// 0xEDC: bankRupees
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
// s32 casts required for slt instead of sltu
if ((s32)((gSaveContext.perm.bankRupees & 0xFFFF)) <
if ((s32)((gSaveContext.roomInf[127][0] & 0xFFFF)) <
((s32)(globalCtx->msgCtx.bankRupeesSelected + this->serviceFee))) {
play_sound(0x4806); // NA_SE_SY_ERROR
func_800BDC5C(&this->skelAnime, animations, GINKO_FLOORSMACKING); // @ D30
@ -491,8 +491,8 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
}
// check if wallet is big enough
if ((D_801C1E2C[(gSaveContext.perm.inv.unk48 & D_801C1DD0) >> D_801C1E08]) <
(globalCtx->msgCtx.bankRupeesSelected + gSaveContext.perm.unk24.currentRupees)) {
if ((D_801C1E2C[(gSaveContext.inventory.upgrades & gUpgradeMasks[4]) >> gUpgradeShifts[2]]) <
(globalCtx->msgCtx.bankRupeesSelected + gSaveContext.rupees)) {
play_sound(0x4806); // NA_SE_SY_ERROR
func_801518B0(globalCtx, 0x475, &this->actor);
this->curTextId = 0x475; // You can't hold that many in your wallet
@ -510,11 +510,11 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
func_801518B0(globalCtx, 0x472, &this->actor);
this->curTextId = 0x472; // It's a waste to take out such a tiny bit
}
this->previousBankValue = (s16)gSaveContext.perm.bankRupees;
gSaveContext.perm.bankRupees =
(((gSaveContext.perm.bankRupees & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
this->previousBankValue = (s16)gSaveContext.roomInf[127][0];
gSaveContext.roomInf[127][0] =
(((gSaveContext.roomInf[127][0] & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
this->serviceFee) |
(gSaveContext.perm.bankRupees & 0xFFFF0000);
(gSaveContext.roomInf[127][0] & 0xFFFF0000);
func_801159EC((s16)globalCtx->msgCtx.bankRupeesSelected, &gSaveContext); // cast req
return;
} else {
@ -546,7 +546,7 @@ void EnGinkoMan_WaitForRupeeCount(EnGinkoMan* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.bankRupeesSelected == 0) {
func_801518B0(globalCtx, 0x46F, &this->actor);
this->curTextId = 0x46F; // "Zero Rupees?!? That's a cruel joke!"
} else if (gSaveContext.perm.isNight == 1) {
} else if (gSaveContext.isNight == 1) {
func_801518B0(globalCtx, 0x477, &this->actor);
this->curTextId = 0x477; // "...You know, at this time of day there's a 4 Rupee service charge...
} else {
@ -604,15 +604,16 @@ void EnGinkoMan_BankAward(EnGinkoMan* this, GlobalContext* globalCtx) {
this->actor.parent = NULL;
EnGinkoMan_SetupBankAward2(this);
} else if (this->curTextId == 0x45B) { // "Whats this, you already saved up 200?"
if (((&gSaveContext)->perm.weekEventReg[10] & 8) == 0) {
if (!(gSaveContext.weekEventReg[10] & 8)) {
func_800B8A1C(&this->actor, globalCtx,
((u32)((s32)(&gSaveContext)->perm.inv.unk48 & D_801C1DD0) >> D_801C1E08) + 8, 500.0f, 100.0f);
((u32)(gSaveContext.inventory.upgrades & gUpgradeMasks[4]) >> gUpgradeShifts[4]) + 8, 500.0f,
100.0f);
} else {
func_800B8A1C(&this->actor, globalCtx, 2, 500.0f, 100.0f);
}
} else if (this->curTextId == 0x45C) { // "Whats this, you already saved up 5000?"
func_800B8A1C(&this->actor, globalCtx, 2, 500.0f, 100.0f);
} else if (((&gSaveContext)->perm.weekEventReg[0x3B] & 8) == 0) {
} else if (!(gSaveContext.weekEventReg[0x3B] & 8)) {
func_800B8A1C(&this->actor, globalCtx, 12, 500.0f, 100.0f);
} else {
func_800B8A1C(&this->actor, globalCtx, 2, 500.0f, 100.0f);
@ -631,10 +632,10 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) {
GlobalContext* gCtx; // = globalCtx;
if (func_800B84D0(&this->actor, globalCtx)) {
if (((gSaveContext.perm.weekEventReg[0xA] & 8) == 0) && (this->curTextId == 0x45B)) {
if ((!(gSaveContext.weekEventReg[0xA] & 8)) && (this->curTextId == 0x45B)) {
// "What's this? You've already saved up 200 Rupees!?! Well, little guy, here's your special gift. Take
// it!"
gSaveContext.perm.weekEventReg[0xA] |= 8;
gSaveContext.weekEventReg[0xA] |= 8;
func_801518B0(globalCtx, 0x47A, &this->actor);
if (1) { // might be fake, but it solves almost everything
@ -651,8 +652,8 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) {
} else if (this->curTextId == 0x45D) { // saved up 5000 rupees for HP
gCtx = globalCtx;
if ((func_80152498(&gCtx->msgCtx, globalCtx) == 6) && (func_80147624(globalCtx) != 0)) {
if ((gSaveContext.perm.weekEventReg[0x3B] & 8) == 0) {
gSaveContext.perm.weekEventReg[0x3B] |= 8;
if (!(gSaveContext.weekEventReg[0x3B] & 8)) {
gSaveContext.weekEventReg[0x3B] |= 8;
}
EnGinkoMan_SetupIdle(this);
}
@ -686,8 +687,8 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) {
case 0x469: // "Excuse me, but let me take a look at you..."
func_800BDC5C(&this->skelAnime, animations, GINKO_SITTING);
globalCtx->msgCtx.bankRupees = (gSaveContext.perm.bankRupees & 0xFFFF);
if ((CURRENT_DAY == 3) && (gSaveContext.perm.isNight == 1)) {
globalCtx->msgCtx.bankRupees = (gSaveContext.roomInf[127][0] & 0xFFFF);
if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
func_801518B0(globalCtx, 0x46C, &this->actor);
this->curTextId = 0x46C; // "Ah, yes...[Link], right?
} else {

View File

@ -53,7 +53,5 @@ typedef enum {
// values to get wallet capacity
extern u16 D_801C1E2C[]; // wallet capacities
extern u32 D_801C1DD0; // bit mask for wallet size in savecontext
extern u8 D_801C1E08; // bit shift on index to align
#endif // Z_EN_GINKO_MAN_H

View File

@ -117,7 +117,7 @@ void EnJcMato_Update(Actor* thisx, GlobalContext* globalCtx) {
EnJcMato* this = THIS;
this->actionFunc(this, globalCtx);
if (!(gSaveContext.owl.unk4 & 1)) {
if (!(gSaveContext.eventInf[4] & 1)) {
EnJcMato_CheckForHit(this, globalCtx);
}
}

View File

@ -15,7 +15,7 @@ static u8 sChestContents[] = { 0x02, 0x04, 0x05, 0x06, 0x36, 0x3A, 0x14, 0x14 };
void EnTorch_Init(Actor* thisx, GlobalContext* globalCtx) {
EnTorch* this = THIS;
s8 returnData = gSaveContext.extra.unk87;
s8 returnData = gSaveContext.respawn[3].data;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0,

View File

@ -113,9 +113,9 @@ void func_80A66278(EnWarpUzu* this, GlobalContext* globalCtx) {
void func_80A66384(EnWarpUzu* this, GlobalContext* globalCtx) {
globalCtx->nextEntranceIndex = 0x22A0;
gSaveContext.extra.unk24 = globalCtx->nextEntranceIndex;
gSaveContext.respawn[0].entranceIndex = globalCtx->nextEntranceIndex;
func_80169EFC(globalCtx);
gSaveContext.extra.unk10 = -2;
gSaveContext.respawnFlag = -2;
this->actionFunc = EnWarpUzu_DoNothing;
}

View File

@ -26,7 +26,7 @@ extern Gfx D_060011E0[];
void ObjDinner_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjDinner* this = THIS;
if (gSaveContext.perm.isNight != 1 || (CURRENT_DAY == 3 && gSaveContext.perm.weekEventReg[0x16] & 1)) {
if (gSaveContext.isNight != true || (CURRENT_DAY == 3 && gSaveContext.weekEventReg[0x16] & 1)) {
Actor_MarkForDeath(&this->actor);
}
Actor_SetScale(&this->actor, 0.1f);

View File

@ -53,8 +53,8 @@ void ObjMoonStone_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.flags |= 9;
func_80C0662C(this);
} else {
if ((gSaveContext.perm.weekEventReg[74] & 0x40) == 0) {
if ((gSaveContext.perm.weekEventReg[74] & 0x80)) {
if ((gSaveContext.weekEventReg[74] & 0x40) == 0) {
if ((gSaveContext.weekEventReg[74] & 0x80)) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, 1, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, -1);
}
@ -102,14 +102,14 @@ void func_80C0670C(ObjMoonStone* this, GlobalContext* globalCtx) {
}
void func_80C0673C(ObjMoonStone* this) {
if ((gSaveContext.perm.weekEventReg[74] & 0x80) == 0) {
if ((gSaveContext.weekEventReg[74] & 0x80) == 0) {
this->actor.draw = NULL;
}
this->actionFunc = func_80C06768;
}
void func_80C06768(ObjMoonStone* this, GlobalContext* globalCtx) {
if ((gSaveContext.perm.weekEventReg[74] & 0x80)) {
if ((gSaveContext.weekEventReg[74] & 0x80)) {
if (this->actor.draw == 0) {
this->actor.draw = ObjMoonStone_Draw;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, 1, this->actor.world.pos.x, this->actor.world.pos.y,
@ -133,7 +133,7 @@ void func_80C0685C(ObjMoonStone* this) {
void func_80C06870(ObjMoonStone* this, GlobalContext* globalCtx) {
if (func_80152498(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) {
gSaveContext.perm.weekEventReg[74] |= 0x40;
gSaveContext.weekEventReg[74] |= 0x40;
Actor_MarkForDeath(&this->actor);
}
}

View File

@ -197,11 +197,11 @@ void ObjTokeiStep_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
BcCheck3_BgActorInit(&this->dyna, 0);
if ((globalCtx->sceneNum == 0x6F) && (gSaveContext.extra.sceneSetupIndex == 2) && (globalCtx->csCtx.unk12 == 0)) {
if ((globalCtx->sceneNum == 0x6F) && (gSaveContext.sceneSetupIndex == 2) && (globalCtx->csCtx.unk12 == 0)) {
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000968);
ObjTokeiStep_InitSteps(this);
ObjTokeiStep_SetupBeginOpen(this);
} else if (!((CURRENT_DAY != 3) || (gSaveContext.perm.time >= 0x4000)) || gSaveContext.perm.day >= 4) {
} else if (!((CURRENT_DAY != 3) || (gSaveContext.time >= 0x4000)) || gSaveContext.day >= 4) {
this->dyna.actor.draw = ObjTokeiStep_DrawOpen;
ObjTokeiStep_InitStepsOpen(this);
ObjTokeiStep_SetupDoNothingOpen(this);

View File

@ -1399,104 +1399,20 @@
0x801C1D10:("D_801C1D10","Vec3f","",0xc),
0x801C1D1C:("roomDrawFuncs","room_draw_func","[4]",0x10),
0x801C1D30:("gBitFlags","u32","[32]",0x80),
0x801C1DB0:("D_801C1DB0","UNK_TYPE2","",0x2),
0x801C1DB2:("D_801C1DB2","UNK_TYPE2","",0x2),
0x801C1DB4:("D_801C1DB4","UNK_TYPE2","",0x2),
0x801C1DB8:("D_801C1DB8","UNK_TYPE2","",0x2),
0x801C1DBA:("D_801C1DBA","UNK_TYPE2","",0x2),
0x801C1DC0:("D_801C1DC0","UNK_TYPE4","",0x4),
0x801C1DC4:("D_801C1DC4","UNK_TYPE4","",0x4),
0x801C1DD0:("D_801C1DD0","UNK_TYPE4","",0x4),
0x801C1DD8:("D_801C1DD8","UNK_TYPE4","",0x4),
0x801C1DDC:("D_801C1DDC","UNK_TYPE4","",0x4),
0x801C1DE0:("D_801C1DE0","UNK_TYPE1","",0x1),
0x801C1E00:("D_801C1E00","UNK_TYPE1","",0x1),
0x801C1E01:("D_801C1E01","UNK_TYPE1","",0x1),
0x801C1E02:("D_801C1E02","UNK_TYPE1","",0x1),
0x801C1E04:("D_801C1E04","UNK_TYPE1","",0x1),
0x801C1E05:("D_801C1E05","UNK_TYPE1","",0x1),
0x801C1E08:("D_801C1E08","UNK_TYPE1","",0x1),
0x801C1E0A:("D_801C1E0A","UNK_TYPE1","",0x1),
0x801C1E0B:("D_801C1E0B","UNK_TYPE1","",0x1),
0x801C1E0C:("D_801C1E0C","UNK_TYPE1","",0x1),
0x801C1E0E:("D_801C1E0E","UNK_TYPE2","",0x2),
0x801C1E10:("D_801C1E10","UNK_TYPE2","",0x2),
0x801C1E12:("D_801C1E12","UNK_TYPE2","",0x2),
0x801C1E14:("D_801C1E14","UNK_TYPE1","",0x1),
0x801C1E16:("D_801C1E16","UNK_TYPE2","",0x2),
0x801C1E18:("D_801C1E18","UNK_TYPE2","",0x2),
0x801C1E1A:("D_801C1E1A","UNK_TYPE2","",0x2),
0x801C1E2C:("D_801C1E2C","UNK_TYPE1","",0x1),
0x801C1E3C:("D_801C1E3C","UNK_TYPE1","",0x1),
0x801C1E40:("D_801C1E40","UNK_TYPE2","",0x2),
0x801C1E42:("D_801C1E42","UNK_TYPE2","",0x2),
0x801C1E44:("D_801C1E44","UNK_TYPE1","",0x1),
0x801C1E48:("D_801C1E48","UNK_TYPE2","",0x2),
0x801C1E4A:("D_801C1E4A","UNK_TYPE2","",0x2),
0x801C1E6C:("D_801C1E6C","UNK_PTR","",0x4),
0x801C1F9C:("D_801C1F9C","UNK_TYPE1","",0x1),
0x801C1FAC:("D_801C1FAC","UNK_TYPE1","",0x1),
0x801C1FE0:("D_801C1FE0","UNK_TYPE4","",0x4),
0x801C2054:("D_801C2054","UNK_TYPE1","",0x1),
0x801C2078:("D_801C2078","u8","[1]",0x1),
0x801C2079:("D_801C2079","u8","",0x1),
0x801C207A:("D_801C207A","UNK_TYPE1","",0x1),
0x801C207E:("D_801C207E","u8","",0x1),
0x801C207F:("D_801C207F","UNK_TYPE1","",0x1),
0x801C2080:("D_801C2080","UNK_TYPE1","",0x1),
0x801C2081:("D_801C2081","UNK_TYPE1","",0x1),
0x801C2082:("D_801C2082","UNK_TYPE1","",0x1),
0x801C2084:("D_801C2084","UNK_TYPE1","",0x1),
0x801C2085:("D_801C2085","UNK_TYPE1","",0x1),
0x801C2088:("D_801C2088","UNK_TYPE1","",0x1),
0x801C208A:("D_801C208A","UNK_TYPE1","",0x1),
0x801C208E:("D_801C208E","UNK_TYPE1","",0x1),
0x801C2090:("D_801C2090","UNK_TYPE1","",0x1),
0x801C209A:("D_801C209A","UNK_TYPE1","",0x1),
0x801C209C:("D_801C209C","UNK_TYPE1","",0x1),
0x801C209D:("D_801C209D","UNK_TYPE1","",0x1),
0x801C209E:("D_801C209E","UNK_TYPE1","",0x1),
0x801C20A0:("D_801C20A0","UNK_TYPE1","",0x1),
0x801C20A1:("D_801C20A1","UNK_TYPE1","",0x1),
0x801C20A2:("D_801C20A2","UNK_TYPE1","",0x1),
0x801C20A3:("D_801C20A3","UNK_TYPE1","",0x1),
0x801C20A4:("D_801C20A4","UNK_TYPE1","",0x1),
0x801C20A5:("D_801C20A5","UNK_TYPE1","",0x1),
0x801C20A6:("D_801C20A6","UNK_TYPE1","",0x1),
0x801C20A7:("D_801C20A7","UNK_TYPE1","",0x1),
0x801C20A8:("D_801C20A8","UNK_TYPE1","",0x1),
0x801C20AA:("D_801C20AA","UNK_TYPE1","",0x1),
0x801C20AB:("D_801C20AB","UNK_TYPE1","",0x1),
0x801C20AC:("D_801C20AC","UNK_TYPE1","",0x1),
0x801C20AD:("D_801C20AD","UNK_TYPE1","",0x1),
0x801C20AE:("D_801C20AE","UNK_TYPE1","",0x1),
0x801C20AF:("D_801C20AF","UNK_TYPE1","",0x1),
0x801C20B0:("D_801C20B0","UNK_TYPE1","",0x1),
0x801C20B1:("D_801C20B1","UNK_TYPE1","",0x1),
0x801C20B2:("D_801C20B2","UNK_TYPE1","",0x1),
0x801C20B3:("D_801C20B3","UNK_TYPE1","",0x1),
0x801C20B4:("D_801C20B4","UNK_TYPE1","",0x1),
0x801C20B5:("D_801C20B5","UNK_TYPE1","",0x1),
0x801C20B6:("D_801C20B6","UNK_TYPE1","",0x1),
0x801C20B7:("D_801C20B7","UNK_TYPE1","",0x1),
0x801C20B8:("D_801C20B8","UNK_TYPE1","",0x1),
0x801C20B9:("D_801C20B9","UNK_TYPE1","",0x1),
0x801C20BA:("D_801C20BA","UNK_TYPE1","",0x1),
0x801C20BB:("D_801C20BB","UNK_TYPE1","",0x1),
0x801C20BC:("D_801C20BC","UNK_TYPE1","",0x1),
0x801C20BD:("D_801C20BD","UNK_TYPE1","",0x1),
0x801C20BE:("D_801C20BE","UNK_TYPE1","",0x1),
0x801C20BF:("D_801C20BF","UNK_TYPE1","",0x1),
0x801C20C0:("D_801C20C0","UNK_TYPE1","",0x1),
0x801C20C1:("D_801C20C1","UNK_TYPE1","",0x1),
0x801C20C8:("D_801C20C8","UNK_TYPE1","",0x1),
0x801C212C:("scenesPerMapArea","SceneIdList","[11]",0x252),
0x801C2380:("D_801C2380","UNK_TYPE2","",0x2),
0x801C2398:("D_801C2398","UNK_TYPE1","",0x1),
0x801C23B0:("D_801C23B0","UNK_TYPE1","",0x1),
0x801C23C8:("D_801C23C8","UNK_TYPE1","",0x1),
0x801C23E0:("D_801C23E0","UNK_TYPE1","",0x1),
0x801C23F8:("D_801C23F8","UNK_TYPE1","",0x1),
0x801C1DB0:("gEquipMasks","UNK_TYPE2","",0x2),
0x801C1DB8:("gEquipNegMasks","UNK_TYPE2","",0x2),
0x801C1DC0:("gUpgradeMasks","UNK_TYPE4","",0x4),
0x801C1DE0:("gUpgradeNegMasks","UNK_TYPE1","",0x1),
0x801C1E00:("gEquipShifts","UNK_TYPE1","",0x1),
0x801C1E04:("gUpgradeShifts","UNK_TYPE1","",0x1),
0x801C1E14:("gUpgradeCapacities","UNK_TYPE1","",0x1),
0x801C1E4C:("gGsFlagsMask","UNK_TYPE2","",0x2),
0x801C1E5C:("gGsFlagsShift","UNK_TYPE2","",0x2),
0x801C1E6C:("gItemIcons","UNK_PTR","",0x4),
0x801C2078:("gItemSlots","u8","",0x1),
0x801C20C8:("gItemPrices","UNK_TYPE1","",0x1),
0x801C212C:("gScenesPerRegion","SceneIdList","[11]",0x252),
0x801C2380:("D_801C2380","UNK_TYPE1","",0x1),
0x801C2410:("D_801C2410","UNK_TYPE1","",0x1),
0x801C2650:("tatlMessageFiles","RomFile","[2]",0x10),
0x801C2660:("sceneTextureFiles","RomFile","[9]",0x48),
@ -2111,13 +2027,13 @@
0x801C6850:("D_801C6850","UNK_TYPE1","",0x1),
0x801C6870:("D_801C6870","UNK_TYPE1","",0x1),
0x801C6890:("D_801C6890","UNK_TYPE1","",0x1),
0x801C6898:("D_801C6898","SaveContext_struct1","",0x28),
0x801C6898:("D_801C6898","SaveInfo","",0x28),
0x801C68C0:("D_801C68C0","SaveContext_struct2","",0x22),
0x801C68E4:("gSaveDefaultInventory","SaveContextInventory","",0x88),
0x801C68E4:("gSaveDefaultInventory","Inventory","",0x88),
0x801C696C:("gSaveDefaultChecksum","u16","",0x2),
0x801C6970:("D_801C6970","SaveContext_struct1","",0x28),
0x801C6970:("D_801C6970","SaveInfo","",0x28),
0x801C6998:("D_801C6998","SaveContext_struct2","",0x22),
0x801C69BC:("D_801C69BC","SaveContextInventory","",0x88),
0x801C69BC:("D_801C69BC","Inventory","",0x88),
0x801C6A44:("D_801C6A44","u16","",0x2),
0x801C6A48:("D_801C6A48","UNK_TYPE1","",0x1),
0x801C6A50:("D_801C6A50","UNK_TYPE1","",0x1),