mirror of
https://github.com/zeldaret/tmc
synced 2026-08-18 21:48:21 -04:00
fileScreen.c OK
This commit is contained in:
+14
-14
@@ -19,7 +19,7 @@ typedef struct {
|
||||
u8 unk;
|
||||
} ScreenTransition;
|
||||
|
||||
extern SaveFile gUnk_02002A40;
|
||||
extern SaveFile gSave;
|
||||
extern struct_080FD5B4 gUnk_080FD5B4[];
|
||||
extern ScreenTransition gScreenTransition;
|
||||
|
||||
@@ -33,9 +33,9 @@ extern void (*const gUnk_080FE2A0[])();
|
||||
u32 IsItemEquipped(u32 itemID) {
|
||||
u32 ret;
|
||||
|
||||
if (itemID == gUnk_02002A40.stats.itemOnA)
|
||||
if (itemID == gSave.stats.itemOnA)
|
||||
ret = 0;
|
||||
else if (itemID == gUnk_02002A40.stats.itemOnB)
|
||||
else if (itemID == gSave.stats.itemOnB)
|
||||
ret = 1;
|
||||
else
|
||||
ret = 2;
|
||||
@@ -50,17 +50,17 @@ void PutItemOnSlot(u32 itemID) {
|
||||
}
|
||||
if (itemID - 1 < 0x1f) {
|
||||
itemSlot = 2;
|
||||
if (gUnk_02002A40.stats.itemOnA == 0) {
|
||||
if (gSave.stats.itemOnA == 0) {
|
||||
itemSlot = 0;
|
||||
} else if (gUnk_02002A40.stats.itemOnB == 0) {
|
||||
} else if (gSave.stats.itemOnB == 0) {
|
||||
itemSlot = 1;
|
||||
}
|
||||
if (itemSlot == 2) {
|
||||
u8 temp = gUnk_080FD5B4[itemID].unk;
|
||||
if (temp == gUnk_080FD5B4[gUnk_02002A40.stats.itemOnA].unk) {
|
||||
if (temp == gUnk_080FD5B4[gSave.stats.itemOnA].unk) {
|
||||
itemSlot = 0;
|
||||
} else {
|
||||
if (temp == gUnk_080FD5B4[gUnk_02002A40.stats.itemOnB].unk) {
|
||||
if (temp == gUnk_080FD5B4[gSave.stats.itemOnB].unk) {
|
||||
itemSlot = 1;
|
||||
}
|
||||
}
|
||||
@@ -82,19 +82,19 @@ u32 SetBottleContents(u32 itemID, u32 bottleIndex) {
|
||||
|
||||
if (bottleIndex > 3) {
|
||||
bottleIndex = 0;
|
||||
if (gUnk_02002A40.stats.filler2[0] != 0x20) {
|
||||
if (gSave.stats.filler2[0] != 0x20) {
|
||||
do {
|
||||
bottleIndex++;
|
||||
if (bottleIndex > 3) {
|
||||
return bottleIndex;
|
||||
}
|
||||
} while (gUnk_02002A40.stats.filler2[bottleIndex] != 0x20);
|
||||
} while (gSave.stats.filler2[bottleIndex] != 0x20);
|
||||
}
|
||||
if (bottleIndex > 3) {
|
||||
return bottleIndex;
|
||||
}
|
||||
}
|
||||
gUnk_02002A40.stats.filler2[bottleIndex] = itemID;
|
||||
gSave.stats.filler2[bottleIndex] = itemID;
|
||||
return bottleIndex;
|
||||
}
|
||||
|
||||
@@ -134,13 +134,13 @@ u32 sub_080544C8(u32 arg0) {
|
||||
}
|
||||
|
||||
u32 sub_080544DC(u32 arg0) {
|
||||
if (arg0 == gUnk_02002A40.stats.filler2[0]) {
|
||||
if (arg0 == gSave.stats.filler2[0]) {
|
||||
return 1;
|
||||
} else if (arg0 == gUnk_02002A40.stats.filler2[1]) {
|
||||
} else if (arg0 == gSave.stats.filler2[1]) {
|
||||
return 2;
|
||||
} else if (arg0 == gUnk_02002A40.stats.filler2[2]) {
|
||||
} else if (arg0 == gSave.stats.filler2[2]) {
|
||||
return 3;
|
||||
} else if (arg0 == gUnk_02002A40.stats.filler2[3]) {
|
||||
} else if (arg0 == gSave.stats.filler2[3]) {
|
||||
return 4;
|
||||
} else {
|
||||
return 0;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "textbox.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void sub_0801D040(Entity*, u32);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
@@ -243,7 +244,7 @@ void sub_08028CE8(Entity* this) {
|
||||
u32 subtype;
|
||||
|
||||
if ((gTextBox.doTextBox & 0x7f) == 0 && sub_0802915C(this) && !sub_08056338()) {
|
||||
if (offer->price <= gUnk_02002A40.stats.rupees) {
|
||||
if (offer->price <= gSave.stats.rupees) {
|
||||
if (sub_080291DC(this)) {
|
||||
/* Bag full. */
|
||||
TextboxNoOverlapFollow(0x2904);
|
||||
@@ -508,11 +509,11 @@ bool32 sub_080291DC(Entity* this) {
|
||||
|
||||
switch (offer->field_0x8) {
|
||||
case 0x6c:
|
||||
if (gBombBagSizes[gUnk_02002A40.stats.bombBagType] <= gUnk_02002A40.stats.bombCount)
|
||||
if (gBombBagSizes[gSave.stats.bombBagType] <= gSave.stats.bombCount)
|
||||
return TRUE;
|
||||
break;
|
||||
case 0x6f:
|
||||
if (gQuiverSizes[gUnk_02002A40.stats.quiverType] <= gUnk_02002A40.stats.arrowCount)
|
||||
if (gQuiverSizes[gSave.stats.quiverType] <= gSave.stats.arrowCount)
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "trig.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
#include "fileScreen.h"
|
||||
|
||||
void (* const gUnk_080D1AFC[8])(Entity*);
|
||||
void (* const gUnk_080D1B1C[7])(Entity*);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "textbox.h"
|
||||
#include "save.h"
|
||||
|
||||
extern bool32 sub_080544B4(u32);
|
||||
extern void sub_0807CAA0(u32, u32);
|
||||
@@ -180,7 +181,7 @@ void sub_0802805C(Entity* this) {
|
||||
this->field_0xf = tmp3;
|
||||
}
|
||||
|
||||
if (this->field_0xf >= 0x19 || gUnk_02002A40.stats.health == 0) {
|
||||
if (this->field_0xf >= 0x19 || gSave.stats.health == 0) {
|
||||
sub_0802810C(this);
|
||||
} else {
|
||||
ResetPlayer();
|
||||
@@ -245,12 +246,12 @@ void sub_080281A0(Entity* this) {
|
||||
bool32 sub_080281E0(u32 param_1) {
|
||||
bool32 ret = FALSE;
|
||||
if (GetInventoryValue(param_1) == 1) {
|
||||
if (sub_080544B4(gUnk_02002A40.stats.itemOnA)) {
|
||||
gUnk_02002A40.stats.itemOnA = 0;
|
||||
if (sub_080544B4(gSave.stats.itemOnA)) {
|
||||
gSave.stats.itemOnA = 0;
|
||||
}
|
||||
|
||||
if (sub_080544B4(gUnk_02002A40.stats.itemOnB)) {
|
||||
gUnk_02002A40.stats.itemOnB = 0;
|
||||
if (sub_080544B4(gSave.stats.itemOnB)) {
|
||||
gSave.stats.itemOnB = 0;
|
||||
}
|
||||
|
||||
sub_0807CAA0(param_1, 0);
|
||||
|
||||
+1
-1
@@ -804,7 +804,7 @@ void sub_08024E4C(Entity* this) {
|
||||
this->cutsceneBeh.HALF.LO += 1 + (Random() & 1);
|
||||
}
|
||||
|
||||
if (gUnk_02002A40.stats.health == 0 || this->field_0x86.HALF.HI == 4) {
|
||||
if (gSave.stats.health == 0 || this->field_0x86.HALF.HI == 4) {
|
||||
this->cutsceneBeh.HALF.LO = 0x30;
|
||||
this->field_0x86.HALF.HI = 0;
|
||||
sub_08024F50(this);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "npc.h"
|
||||
#include "structures.h"
|
||||
#include "player.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void sub_080293DC(Entity*);
|
||||
extern void sub_080296D8(Entity*);
|
||||
@@ -158,7 +159,7 @@ void sub_0802953C(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
}
|
||||
if (((this->field_0xf > 0x2d) || (gUnk_02002A40.stats.rupees == 0)) && (this->actionDelay == 0)) {
|
||||
if (((this->field_0xf > 0x2d) || (gSave.stats.rupees == 0)) && (this->actionDelay == 0)) {
|
||||
sub_080296D8(this);
|
||||
} else {
|
||||
ResetPlayer();
|
||||
@@ -170,7 +171,7 @@ void sub_0802953C(Entity* this) {
|
||||
gPlayerEntity.spritePriority.b1 = 0;
|
||||
if (--this->field_0x82.HALF.HI == 0) {
|
||||
this->field_0x82.HALF.HI = 0x41;
|
||||
if (gUnk_02002A40.stats.rupees != 0) {
|
||||
if (gSave.stats.rupees != 0) {
|
||||
ModRupees(gUnk_080CCC44[this->entityType.form]);
|
||||
this->cutsceneBeh.HALF.LO = 1;
|
||||
}
|
||||
|
||||
+3
-2
@@ -4,6 +4,7 @@
|
||||
#include "structures.h"
|
||||
#include "player.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void (*const gUnk_080CEB74[])(Entity*);
|
||||
extern void (*const gUnk_080CEB8C[])(Entity*);
|
||||
@@ -35,8 +36,8 @@ void sub_08033564(Entity* this) {
|
||||
this->flags &= 0x7f;
|
||||
this->field_0x7c.HALF.LO = 0x27c;
|
||||
gPlayerState.flags.all |= 0x4000;
|
||||
gUnk_02002A40.stats.filler2[4] = this->entityType.form + 1;
|
||||
gUnk_02002A40.stats.field_0x20 = 600;
|
||||
gSave.stats.filler2[4] = this->entityType.form + 1;
|
||||
gSave.stats.field_0x20 = 600;
|
||||
if (this->entityType.form == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "structures.h"
|
||||
#include "textbox.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
void nullsub_507 (Entity*, ScriptExecutionContext*);
|
||||
void sub_0807E004(Entity*, ScriptExecutionContext*);
|
||||
@@ -496,12 +497,12 @@ void sub_0807E30C(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
|
||||
void sub_0807E390(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
unk2->unk_14 = (unk2->unk_00[1] <= gUnk_02002A40.stats.rupees);
|
||||
unk2->unk_14 = (unk2->unk_00[1] <= gSave.stats.rupees);
|
||||
gUnk_02033280.unk_07 |= 1;
|
||||
}
|
||||
|
||||
void sub_0807E3BC(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
unk2->unk_14 = (unk2->unk_00[1] <= gUnk_02002A40.stats.field_0x1a);
|
||||
unk2->unk_14 = (unk2->unk_00[1] <= gSave.stats.field_0x1a);
|
||||
gUnk_02033280.unk_07 |= 1;
|
||||
}
|
||||
|
||||
@@ -525,7 +526,7 @@ void sub_0807E42C(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
tmp2 = gRoomVars.field_0x7;
|
||||
}
|
||||
tmp3 = sub_08053FE0(tmp);
|
||||
unk2->unk_14 = (tmp3 <= gUnk_02002A40.stats.rupees);
|
||||
unk2->unk_14 = (tmp3 <= gSave.stats.rupees);
|
||||
if (unk2->unk_14) {
|
||||
ModRupees(-tmp3);
|
||||
sub_080A7C18(tmp, tmp2, 0);
|
||||
@@ -1145,8 +1146,8 @@ void sub_0807F004(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
}
|
||||
|
||||
void sub_0807F010(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
gUnk_02002A40.stats.maxHealth = min(gUnk_02002A40.stats.maxHealth + 8, 0xA0);
|
||||
gUnk_02002A40.stats.health = gUnk_02002A40.stats.maxHealth;
|
||||
gSave.stats.maxHealth = min(gSave.stats.maxHealth + 8, 0xA0);
|
||||
gSave.stats.health = gSave.stats.maxHealth;
|
||||
}
|
||||
|
||||
void sub_0807F034(Entity* unk1, ScriptExecutionContext* unk2) {
|
||||
|
||||
+552
-37
@@ -3,13 +3,6 @@
|
||||
// copy, erase, start
|
||||
#define NUM_FILE_OPERATIONS 3
|
||||
|
||||
// todo: does this belong with gUnk_02019EE0?
|
||||
typedef enum {
|
||||
SAVE_EMPTY = 0,
|
||||
SAVE_VALID = 1,
|
||||
SAVE_DELETED = 0xFFFFFFFF,
|
||||
} SaveStatus;
|
||||
|
||||
typedef enum {
|
||||
STATE_NONE,
|
||||
STATE_NEW,
|
||||
@@ -21,10 +14,21 @@ typedef enum {
|
||||
STATE_START,
|
||||
} FileSelectState;
|
||||
|
||||
// todo: does this belong with gUnk_02019EE0?
|
||||
typedef enum {
|
||||
SAVE_EMPTY = 0,
|
||||
SAVE_VALID = 1,
|
||||
SAVE_DELETED = 0xFFFFFFFF,
|
||||
} SaveStatus;
|
||||
|
||||
typedef enum {
|
||||
RESULT_INVALID = 0,
|
||||
RESULT_ASCII = 1,
|
||||
} CharResult;
|
||||
|
||||
static void HandleFileScreenEnter(void);
|
||||
static void HandleFileScreenActive(void);
|
||||
static void HandleFileScreenExit(void);
|
||||
|
||||
static void (*const sScreenHandlers[])(void) = {
|
||||
HandleFileScreenEnter,
|
||||
HandleFileScreenActive,
|
||||
@@ -39,31 +43,51 @@ static void HandleFileView(void);
|
||||
extern void HandleFileCopy(void);
|
||||
extern void HandleFileDelete(void);
|
||||
extern void HandleFileStart(void);
|
||||
|
||||
static void (*const sFileScreenSubHandlers[])(void) = {
|
||||
HandleFileSelect, HandleFileNew, HandleFileLanguageSelect, HandleFileOptions,
|
||||
HandleFileView, HandleFileCopy, HandleFileDelete, HandleFileStart,
|
||||
};
|
||||
|
||||
extern KeyButtonLayout gUnk_080FC8D0;
|
||||
// static const KeyButtonLayout gUnk_080FC8D0 = {
|
||||
// 0xFF, 0xD8, 0x0, 0xFF, 0xD8, 0x0, 0xE0, 0x10, 0xF, {{0x5, 0x0}, { 0x2, 0x0 }}, 0xFF
|
||||
// };
|
||||
static const KeyButtonLayout gUnk_080FC8D0 = {
|
||||
.aButtonX = 0xFF,
|
||||
.aButtonY = 0xD8,
|
||||
.aButtonText = 0x0,
|
||||
.bButtonX = 0xFF,
|
||||
.bButtonY = 0xD8,
|
||||
.bButtonText = 0x0,
|
||||
.rButtonX = 0xE0,
|
||||
.rButtonY = 0x10,
|
||||
.rButtonText = 0xF,
|
||||
.settingDict = { 0x5, 0x0, 0x2, 0x0, 0xFF },
|
||||
};
|
||||
|
||||
// main "file selection" screen
|
||||
extern void (*const sFileSelectDefaultHandlers[])(void);
|
||||
static const u16 gUnk_080FC8DE[] = {
|
||||
0x01, 0x00, 0x20, 0x40, 0x60, 0x80, 0xa0, 0xc0, 0xe0, 0xc0, 0xa0, 0x80, 0x60, 0x40, 0x20,
|
||||
};
|
||||
|
||||
// handles submenus
|
||||
extern void (*const sFileScreenSubHandlers[])(void);
|
||||
static void sub_08050848(void);
|
||||
static void sub_0805086C(void);
|
||||
static void sub_08050940(void);
|
||||
static void (*const sFileSelectDefaultHandlers[])(void) = {
|
||||
sub_08050848,
|
||||
sub_0805086C,
|
||||
sub_08050940,
|
||||
};
|
||||
|
||||
extern void (*const gUnk_080FC944[])(void);
|
||||
extern void (*const gUnk_080FC950[])(void);
|
||||
extern void (*const gUnk_080FC960[])(void);
|
||||
extern void (*const gUnk_080FC9B0[])(void);
|
||||
extern void (*const gUnk_080FC9BC[])(void);
|
||||
extern void (*const gUnk_080FC9C8[])(void);
|
||||
|
||||
static void sub_08050624(u32);
|
||||
static void sub_0805066C(void);
|
||||
static void HideButtonR(void);
|
||||
static void ShowButtonR(void);
|
||||
void sub_08051458();
|
||||
|
||||
void sub_08050318(u32 arg0, u32 arg1) {
|
||||
void CreateDialogBox(u32 arg0, u32 arg1) {
|
||||
u32 sfx;
|
||||
struct_080FC844 var0;
|
||||
|
||||
@@ -106,7 +130,7 @@ void LoadOptionsFromSave(u32 idx) {
|
||||
messageSpeed = 1;
|
||||
brightnessPref = 1;
|
||||
} else {
|
||||
SaveFile* saveFile = &gSaveFiles[idx];
|
||||
SaveFile* saveFile = &gUnk_02019EE0.saves[idx];
|
||||
messageSpeed = saveFile->messageSpeed;
|
||||
brightnessPref = saveFile->brightnessPref;
|
||||
}
|
||||
@@ -119,7 +143,7 @@ void LoadOptionsFromSave(u32 idx) {
|
||||
void SetActiveSave(u32 idx) {
|
||||
if (idx < NUM_SAVE_SLOTS) {
|
||||
gUnk_02000000->saveFileId = idx;
|
||||
_DmaCopy(&gSaveFiles[idx], &gUnk_02002A40, sizeof(gSaveFiles[idx]));
|
||||
_DmaCopy(&gUnk_02019EE0.saves[idx], &gSave, sizeof(gUnk_02019EE0.saves[idx]));
|
||||
}
|
||||
LoadOptionsFromSave(idx);
|
||||
}
|
||||
@@ -206,7 +230,7 @@ static void HandleFileScreenExit(void) {
|
||||
}
|
||||
|
||||
static void sub_08050624(u32 idx) {
|
||||
SaveFile* saveFile = &gSaveFiles[idx];
|
||||
SaveFile* saveFile = &gUnk_02019EE0.saves[idx];
|
||||
int status = sub_0807CF28(idx, saveFile);
|
||||
switch (status) {
|
||||
case SAVE_DELETED:
|
||||
@@ -249,7 +273,7 @@ void sub_0805070C(void) {
|
||||
u32 i;
|
||||
int j;
|
||||
struct_02036540* var0;
|
||||
u8* playerName;
|
||||
char* playerName;
|
||||
|
||||
var0 = sub_0805F2C8();
|
||||
if (var0) {
|
||||
@@ -258,11 +282,11 @@ void sub_0805070C(void) {
|
||||
var0->unk1 = 1;
|
||||
var0->unk4 = 0x30;
|
||||
var0->unk8 = gUnk_02000D00;
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (i = 0; i < NUM_SAVE_SLOTS; i++) {
|
||||
var0->unk6 = 0;
|
||||
_DmaZero(var0->unk8, 0x200);
|
||||
playerName = gSaveFiles[i].playerName;
|
||||
for (j = 0; j < 6; j++) {
|
||||
playerName = &gUnk_02019EE0.saves[i].playerName[0];
|
||||
for (j = 0; j < FILENAME_LENGTH; j++) {
|
||||
sub_0805F7DC(playerName[j], var0);
|
||||
}
|
||||
// i is a struct of size 0x200
|
||||
@@ -337,7 +361,7 @@ void sub_08050888(void) {
|
||||
break;
|
||||
default:
|
||||
sub_0805194C(gUnk_02019EE0.unk7);
|
||||
sub_08050318(0, gUnk_02019EE0.unk7 + 1);
|
||||
CreateDialogBox(0, gUnk_02019EE0.unk7 + 1);
|
||||
gChooseFileState.timer = 30;
|
||||
gChooseFileState.subState = 1;
|
||||
break;
|
||||
@@ -347,7 +371,7 @@ void sub_08050888(void) {
|
||||
|
||||
void sub_080508E4(void) {
|
||||
if (gChooseFileState.timer == 0) {
|
||||
if (gUnk_03000FF0.newKeys & (A_BUTTON | START_BUTTON)) {
|
||||
if (gInput.newKeys & (A_BUTTON | START_BUTTON)) {
|
||||
gChooseFileState.subState = 2;
|
||||
}
|
||||
} else {
|
||||
@@ -375,8 +399,8 @@ void sub_08050940(void) {
|
||||
}
|
||||
|
||||
row_idx = gUnk_02019EE0.unk6;
|
||||
keys = gUnk_03000FF0.newKeys;
|
||||
if ((gUnk_03000FF0.heldKeys & L_BUTTON) && gUnk_02019EE0.saveStatus[row_idx] == SAVE_VALID) {
|
||||
keys = gInput.newKeys;
|
||||
if ((gInput.heldKeys & L_BUTTON) && gUnk_02019EE0.saveStatus[row_idx] == SAVE_VALID) {
|
||||
keys &= ~(DPAD_UP | DPAD_DOWN);
|
||||
}
|
||||
|
||||
@@ -493,12 +517,12 @@ NONMATCH("asm/non_matching/save/sub_08050B3C.inc", void sub_08050B3C(u16* arg0))
|
||||
u16* var8;
|
||||
|
||||
sp.unk0 = arg0;
|
||||
var0 = gUnk_02002A40.stats.health / 2;
|
||||
var0 = gSave.stats.health / 2;
|
||||
if (var0 == 0) {
|
||||
var0 = 1;
|
||||
}
|
||||
|
||||
var1 = gUnk_02002A40.stats.maxHealth / 2;
|
||||
var1 = gSave.stats.maxHealth / 2;
|
||||
if (var1 == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -554,8 +578,6 @@ void HandleFileView(void) {
|
||||
sub_08050A64(gUnk_02019EE0.unk6);
|
||||
}
|
||||
|
||||
extern Input gUnk_03000FF0;
|
||||
|
||||
void sub_08050C54(void) {
|
||||
s32 column_idx;
|
||||
|
||||
@@ -563,7 +585,7 @@ void sub_08050C54(void) {
|
||||
return;
|
||||
|
||||
column_idx = gMenu.column_idx;
|
||||
switch (gUnk_03000FF0.newKeys) {
|
||||
switch (gInput.newKeys) {
|
||||
case A_BUTTON:
|
||||
case START_BUTTON:
|
||||
if (column_idx == 0) {
|
||||
@@ -636,7 +658,7 @@ void sub_08050DE4(void) {
|
||||
return;
|
||||
|
||||
row_idx = gUnk_02000000->gameLanguage;
|
||||
switch (gUnk_03000FF0.newKeys) {
|
||||
switch (gInput.newKeys) {
|
||||
case DPAD_UP:
|
||||
row_idx--;
|
||||
break;
|
||||
@@ -648,7 +670,7 @@ void sub_08050DE4(void) {
|
||||
PlaySFX(0x6a);
|
||||
if (gMenu.field_0x4 != row_idx) {
|
||||
sub_080A7114(2);
|
||||
sub_08050318(8, 0);
|
||||
CreateDialogBox(8, 0);
|
||||
} else {
|
||||
SetFileSelectState(STATE_NONE);
|
||||
}
|
||||
@@ -675,6 +697,499 @@ void sub_08050DE4(void) {
|
||||
}
|
||||
|
||||
void sub_08050E88(void) {
|
||||
if (sub_0807CDA4(SAVE_DONE))
|
||||
if (sub_0807CDA4(2))
|
||||
SetFileSelectState(0);
|
||||
}
|
||||
|
||||
void HandleFileOptions(void) {
|
||||
gUnk_080FC950[gMenu.menuType]();
|
||||
}
|
||||
|
||||
void sub_08050EB8(void) {
|
||||
SaveFile* save;
|
||||
sub_080503A8(0xe);
|
||||
save = &gUnk_02019EE0.saves[gUnk_02019EE0.unk6];
|
||||
gUnk_02019EE0.unk4 = save->messageSpeed;
|
||||
gUnk_02019EE0.unk5 = save->brightnessPref;
|
||||
gMenu.column_idx = 0;
|
||||
gMenu.transitionTimer = 0xff;
|
||||
sub_080A7114(1);
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/fileScreen/sub_08050EF4.inc", void sub_08050EF4(void)) {
|
||||
u8* p_option;
|
||||
u32 option;
|
||||
char column_idx;
|
||||
int mode;
|
||||
|
||||
if (gUnk_02019EE0.isTransitioning)
|
||||
return;
|
||||
|
||||
p_option = &gUnk_02019EE0.saves[gUnk_02019EE0.unk6].brightnessPref;
|
||||
if (gMenu.column_idx == 0) {
|
||||
p_option = &gUnk_02019EE0.saves[gUnk_02019EE0.unk6].messageSpeed;
|
||||
}
|
||||
|
||||
mode = 0;
|
||||
option = *p_option;
|
||||
column_idx = gMenu.column_idx;
|
||||
switch (gInput.newKeys) {
|
||||
case DPAD_RIGHT:
|
||||
if (*p_option < 2) {
|
||||
option = *p_option + 1;
|
||||
}
|
||||
break;
|
||||
case DPAD_LEFT:
|
||||
if (*p_option != 0) {
|
||||
option = *p_option - 1;
|
||||
}
|
||||
break;
|
||||
case DPAD_UP:
|
||||
column_idx = 0;
|
||||
break;
|
||||
case DPAD_DOWN:
|
||||
column_idx = 1;
|
||||
break;
|
||||
case A_BUTTON:
|
||||
case START_BUTTON:
|
||||
mode = 2;
|
||||
if (*(u16*)&gUnk_02019EE0.unk4 != *(u16*)&gUnk_02019EE0.saves[gUnk_02019EE0.unk6].messageSpeed)
|
||||
mode = 3;
|
||||
break;
|
||||
case B_BUTTON:
|
||||
mode = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case 3:
|
||||
gUnk_02019EE0.saves[gUnk_02019EE0.unk6].messageSpeed = gUnk_02019EE0.unk4;
|
||||
gUnk_02019EE0.saves[gUnk_02019EE0.unk6].brightnessPref = gUnk_02019EE0.unk5;
|
||||
PlaySFX(0x6c);
|
||||
sub_080A7114(mode);
|
||||
SetActiveSave(gUnk_02019EE0.unk6);
|
||||
break;
|
||||
case 2:
|
||||
CreateDialogBox(8, 0);
|
||||
PlaySFX(0x6a);
|
||||
default:
|
||||
case 1:
|
||||
sub_080A7114(mode);
|
||||
SetActiveSave(gUnk_02019EE0.unk6);
|
||||
break;
|
||||
case 0:
|
||||
if (gMenu.column_idx != column_idx) {
|
||||
gMenu.column_idx = column_idx;
|
||||
PlaySFX(0x69);
|
||||
} else if (option != *p_option) {
|
||||
*p_option = option;
|
||||
LoadOptionsFromSave(gUnk_02019EE0.unk6);
|
||||
PlaySFX(0x69);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08050FFC(void) {
|
||||
switch (sub_0807CDA4(0)) {
|
||||
case SAVE_ERROR:
|
||||
gMenu.transitionTimer = 0x1e;
|
||||
sub_0805194C(gUnk_02019EE0.unk6);
|
||||
CreateDialogBox(9, 0);
|
||||
case SAVE_OK:
|
||||
sub_080A7114(3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805103C(void) {
|
||||
// this gets optimized as a ldrb
|
||||
switch (gMenu.transitionTimer % 256) {
|
||||
case 0:
|
||||
if (!(gInput.newKeys & (A_BUTTON | START_BUTTON)))
|
||||
return;
|
||||
default:
|
||||
gMenu.transitionTimer--;
|
||||
break;
|
||||
case 255:
|
||||
SetFileSelectState(STATE_NONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleFileNew(void) {
|
||||
gUnk_080FC960[gMenu.menuType]();
|
||||
}
|
||||
|
||||
void sub_08051090(void) {
|
||||
sub_080503A8(8);
|
||||
sub_08050790();
|
||||
sub_0805070C();
|
||||
sub_08051458();
|
||||
gScreen.bg.bg2xOffset = 0xff;
|
||||
gScreen.affine.bg2yOffset = 0xff;
|
||||
sub_080A7114(1);
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/fileScreen/sub_080610B8.inc", void sub_080610B8(void)) {
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08051358(void) {
|
||||
gMenu.field_0x12 = gUnk_02000000->gameLanguage == 0 ? 4 : 3;
|
||||
|
||||
if (gMenu.focusCoords[0] != 0x0b || gMenu.focusCoords[1] != 0x5) {
|
||||
gMenu.focusCoords[1] = 0x5;
|
||||
gMenu.focusCoords[0] = 0xb;
|
||||
PlaySFX(0x67);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805138C(void) {
|
||||
gUnk_080FC9B0[gMenu.overlayType]();
|
||||
}
|
||||
|
||||
void sub_080513A8(void) {
|
||||
CreateDialogBox(5, 0);
|
||||
gMenu.overlayType = 1;
|
||||
}
|
||||
|
||||
void sub_080513C0(void) {
|
||||
switch (sub_0807CDA4(0)) {
|
||||
case 1:
|
||||
gUnk_02019EE0.saveStatus[gUnk_02019EE0.unk6] = 1;
|
||||
sub_080A7114(3);
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
case -1:
|
||||
sub_0805194C(gUnk_02019EE0.unk6);
|
||||
CreateDialogBox(6, 0);
|
||||
gMenu.transitionTimer = 0x1e;
|
||||
gMenu.overlayType = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805141C(void) {
|
||||
switch (gMenu.transitionTimer) {
|
||||
case 0:
|
||||
if (gInput.newKeys & (A_BUTTON | START_BUTTON)) {
|
||||
sub_080A7114(3);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gMenu.transitionTimer--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805144C(void) {
|
||||
SetFileSelectState(STATE_NONE);
|
||||
}
|
||||
|
||||
void sub_08051458(void) {
|
||||
sub_080503A8(gMenu.column_idx + 9);
|
||||
_DmaCopy(&gUnk_02001B40, &gUnk_02022030, 0x400);
|
||||
}
|
||||
|
||||
u32 sub_080514BC(u32);
|
||||
void sub_08051574(u32);
|
||||
|
||||
void sub_08051480(u32 c) {
|
||||
CharResult result;
|
||||
u32 idx;
|
||||
|
||||
result = sub_080514BC(c);
|
||||
idx = gMenu.unk13;
|
||||
|
||||
if (result == RESULT_INVALID) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (result != RESULT_ASCII) {
|
||||
c = result;
|
||||
idx--;
|
||||
}
|
||||
|
||||
if (idx > FILENAME_LENGTH - 1) {
|
||||
idx = FILENAME_LENGTH - 1;
|
||||
}
|
||||
|
||||
gMenu.unk13 = idx + 1;
|
||||
gSave.playerName[idx] = c;
|
||||
sub_08051574(0x6b);
|
||||
}
|
||||
|
||||
u32 sub_080514BC(u32 a1) {
|
||||
u32 c;
|
||||
u32 idx;
|
||||
|
||||
if (gUnk_02000000->gameLanguage != 0)
|
||||
return 1;
|
||||
|
||||
switch (a1) {
|
||||
case 0x0:
|
||||
case 0xe:
|
||||
case 0xf:
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
idx = gMenu.unk13;
|
||||
if (idx == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
c = gSave.playerName[idx - 1];
|
||||
if (c - 0xa4 < 0x29) {
|
||||
switch (a1) {
|
||||
case 0x0:
|
||||
if (c < 0xc3) {
|
||||
return c + 0x33;
|
||||
} else {
|
||||
return c + 10;
|
||||
}
|
||||
case 0xE:
|
||||
return c;
|
||||
case 0xF:
|
||||
if (c < 0xc3) {
|
||||
return 0;
|
||||
} else {
|
||||
return c + 10;
|
||||
}
|
||||
default:
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
if (c - 0xcd < 10) {
|
||||
switch (a1) {
|
||||
case 0xf:
|
||||
return c;
|
||||
case 0x0:
|
||||
return c + 0x29;
|
||||
case 0xe:
|
||||
return c - 10;
|
||||
}
|
||||
}
|
||||
|
||||
if (c - 0xd7 < 0x29) {
|
||||
switch (a1) {
|
||||
default:
|
||||
case 0x0:
|
||||
return c - 0x33;
|
||||
case 0xe:
|
||||
return c - 0x33;
|
||||
case 0xf:
|
||||
if (c > 0xf5) {
|
||||
return c - 0x29;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_08051574(u32 sfx) {
|
||||
PlaySFX(sfx);
|
||||
_DmaCopy(&gSave, &gUnk_02019EE0.saves[gUnk_02019EE0.unk6], sizeof(gUnk_02019EE0.saves[gUnk_02019EE0.unk6]));
|
||||
sub_0805070C();
|
||||
}
|
||||
|
||||
void HandleFileDelete(void) {
|
||||
gUnk_080FC9BC[gMenu.menuType]();
|
||||
sub_08050A64(gUnk_02019EE0.unk6);
|
||||
}
|
||||
|
||||
void FUN_080515c8(void) {
|
||||
sub_080A7114(1);
|
||||
}
|
||||
|
||||
void sub_080515D4(void) {
|
||||
u32 column_idx;
|
||||
|
||||
if (gUnk_02019EE0.isTransitioning)
|
||||
return;
|
||||
|
||||
gMenu.transitionTimer = 4;
|
||||
column_idx = gMenu.column_idx;
|
||||
switch (gInput.newKeys) {
|
||||
case B_BUTTON:
|
||||
gMenu.column_idx = 0; // ??
|
||||
column_idx = 0;
|
||||
case A_BUTTON:
|
||||
case START_BUTTON:
|
||||
if (column_idx == 1) {
|
||||
CreateDialogBox(4, 0);
|
||||
sub_080A7114(2);
|
||||
PlaySFX(0x6a);
|
||||
} else {
|
||||
SetFileSelectState(0);
|
||||
PlaySFX(0x6c);
|
||||
}
|
||||
break;
|
||||
case DPAD_LEFT:
|
||||
column_idx = 0;
|
||||
break;
|
||||
case DPAD_RIGHT:
|
||||
column_idx = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gMenu.column_idx != column_idx) {
|
||||
gMenu.column_idx = column_idx;
|
||||
PlaySFX(0x69);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080516E0(void) {
|
||||
if (sub_0807CDA4(1)) {
|
||||
sub_0805194C(gUnk_02019EE0.unk6);
|
||||
sub_08050AFC(gUnk_02019EE0.unk6);
|
||||
gMenu.transitionTimer = 2;
|
||||
SetFileSelectState(0);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleFileCopy(void) {
|
||||
gUnk_080FC9C8[gMenu.menuType]();
|
||||
sub_08050A64(gUnk_02019EE0.unk6);
|
||||
}
|
||||
|
||||
// regalloc
|
||||
NONMATCH("asm/non_matching/fileScreen/sub_08051738.inc", void sub_08051738(void)) {
|
||||
s32 temp;
|
||||
u32 i;
|
||||
s32 uVar3;
|
||||
|
||||
gUnk_02019EE0.unk7 = 4;
|
||||
uVar3 = 0;
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (gUnk_02019EE0.saveStatus[i] == 1) {
|
||||
temp = gUnk_02019EE0.unk6 ^ i;
|
||||
uVar3 = BOOLCAST(temp) & 4;
|
||||
} else {
|
||||
uVar3++;
|
||||
}
|
||||
(&gMenu.selectMtx)[i] = uVar3;
|
||||
}
|
||||
if (uVar3 == 0) {
|
||||
gMenu.transitionTimer = 0x3c;
|
||||
CreateDialogBox(1, 0);
|
||||
sub_080A7114(3);
|
||||
} else {
|
||||
sub_080A7114(1);
|
||||
}
|
||||
uVar3++;
|
||||
gMenu.unk16 = uVar3;
|
||||
gMenu.unk13 = 4;
|
||||
gMenu.unk14 = uVar3;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
NONMATCH("asm/non_matching/fileScreen/sub_080517B4.inc", s32 sub_080517B4(s32 a1)) {
|
||||
u32 i = gUnk_02019EE0.unk7;
|
||||
if (a1 != 0) {
|
||||
for (; i < 5; i += a1) {
|
||||
if ((&gMenu.selectMtx)[i] != 0 && (&gMenu.selectMtx)[i] != 4)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080517EC(void) {
|
||||
u32 temp;
|
||||
s32 delta;
|
||||
|
||||
if (gUnk_02019EE0.isTransitioning)
|
||||
return;
|
||||
|
||||
delta = 0;
|
||||
switch (gInput.newKeys) {
|
||||
case DPAD_UP:
|
||||
delta = -1;
|
||||
break;
|
||||
case DPAD_DOWN:
|
||||
delta = 1;
|
||||
break;
|
||||
case A_BUTTON:
|
||||
case START_BUTTON:
|
||||
if (gUnk_02019EE0.unk7 < 3) {
|
||||
CreateDialogBox(2, 0);
|
||||
sub_080A7114(2);
|
||||
PlaySFX(0x6a);
|
||||
break;
|
||||
}
|
||||
// fallthrough
|
||||
case B_BUTTON:
|
||||
gUnk_02019EE0.unk7 = 4;
|
||||
PlaySFX(0x6c);
|
||||
SetFileSelectState(0);
|
||||
break;
|
||||
}
|
||||
temp = sub_080517B4(delta);
|
||||
if (temp != gUnk_02019EE0.unk7) {
|
||||
gUnk_02019EE0.unk7 = temp;
|
||||
PlaySFX(0x69);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08051874(void) {
|
||||
s32 temp;
|
||||
gUnk_02000000->saveFileId = gUnk_02019EE0.unk7;
|
||||
temp = sub_0807CDA4(0);
|
||||
gUnk_02019EE0.saveStatus[gUnk_02019EE0.unk7] = temp;
|
||||
switch (temp) {
|
||||
case 1:
|
||||
_DmaCopy(&gSave, &gUnk_02019EE0.saves[gUnk_02019EE0.unk7],
|
||||
sizeof(gUnk_02019EE0.saves[gUnk_02019EE0.unk7]));
|
||||
SetFileSelectState(0);
|
||||
break;
|
||||
case -1:
|
||||
sub_0805194C(gUnk_02019EE0.unk7);
|
||||
CreateDialogBox(3, 0);
|
||||
gMenu.transitionTimer = 0x1e;
|
||||
sub_080A7114(3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080518E4(void) {
|
||||
switch (gMenu.transitionTimer) {
|
||||
case 0:
|
||||
if (gInput.newKeys & (A_BUTTON | START_BUTTON)) {
|
||||
SetFileSelectState(0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gMenu.transitionTimer--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleFileStart(void) {
|
||||
if (gMenu.menuType == 0) {
|
||||
gMenu.menuType = 1;
|
||||
gUnk_02000000->messageSpeed = gSave.messageSpeed;
|
||||
gUnk_02000000->brightnessPref = gSave.brightnessPref;
|
||||
gUnk_03001000.funcIndex = 2;
|
||||
DoFade(5, 8);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0805194C(u32 save_idx) {
|
||||
SaveFile* save;
|
||||
|
||||
gUnk_02019EE0.saveStatus[save_idx] = 0;
|
||||
save = &gUnk_02019EE0.saves[save_idx];
|
||||
_DmaZero(save, sizeof(*save));
|
||||
save->messageSpeed = 1;
|
||||
save->brightnessPref = 1;
|
||||
save->stats.health = 24;
|
||||
save->stats.maxHealth = 24;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
#include "flags.h"
|
||||
#include "save.h"
|
||||
|
||||
extern u32 gUnk_03000B80;
|
||||
extern u32 gUnk_03003FC0;
|
||||
@@ -56,7 +57,7 @@ void InitializePlayer(void) {
|
||||
pl->entityType.type = 1;
|
||||
pl->flags |= 0xa0;
|
||||
pl->spritePriority.b0 = 4;
|
||||
pl->currentHealth = gUnk_02002A40.stats.health;
|
||||
pl->currentHealth = gSave.stats.health;
|
||||
pl->x.HALF.HI = gScreenTransition.playerStartPos.HALF.x;
|
||||
pl->y.HALF.HI = gScreenTransition.playerStartPos.HALF.y;
|
||||
pl->animationState = gScreenTransition.playerState;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ static void StoreKeyInput(Input*, u32);
|
||||
|
||||
void ReadKeyInput(void) {
|
||||
u32 keyInput = ~REG_KEYINPUT & KEYS_MASK;
|
||||
StoreKeyInput(&gUnk_03000FF0, keyInput);
|
||||
StoreKeyInput(&gInput, keyInput);
|
||||
}
|
||||
|
||||
static void StoreKeyInput(Input* input, u32 keyInput) {
|
||||
|
||||
+1
-1
@@ -321,7 +321,7 @@ static u32 GetAdvanceState(void) {
|
||||
if (!gUnk_02000010.listenForKeyPresses) {
|
||||
newKeys = 0;
|
||||
} else {
|
||||
newKeys = gUnk_03000FF0.newKeys & (A_BUTTON | START_BUTTON);
|
||||
newKeys = gInput.newKeys & (A_BUTTON | START_BUTTON);
|
||||
}
|
||||
|
||||
if (--gIntroState.timer == 0) {
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@
|
||||
#include "screen.h"
|
||||
#include "random.h"
|
||||
#include "readKeyInput.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void HandleIntroScreen(void);
|
||||
extern void HandleChooseFileScreen(void);
|
||||
@@ -110,7 +111,7 @@ static void sub_08055F70(void) {
|
||||
#define SOFT_RESET_KEYS (A_BUTTON | B_BUTTON | SELECT_BUTTON | START_BUTTON)
|
||||
|
||||
static bool32 SoftResetKeysPressed(void) {
|
||||
return (gUnk_03000FF0.heldKeys & SOFT_RESET_KEYS) == SOFT_RESET_KEYS;
|
||||
return (gInput.heldKeys & SOFT_RESET_KEYS) == SOFT_RESET_KEYS;
|
||||
}
|
||||
|
||||
void InitScreen(u32 screen) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "screen.h"
|
||||
#include "trig.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
@@ -243,7 +244,7 @@ void sub_08058B5C(ManagerC* this, u32 unk1) {
|
||||
gScreenTransition.playerState = unk1 & 1 ? 4 : 0;
|
||||
gScreenTransition.playerStartPos.HALF.x = gUnk_081082E8[unk1*3];
|
||||
gScreenTransition.playerStartPos.HALF.y = gUnk_081082E8[unk1*3+1];
|
||||
gUnk_02002A40.unk7 = gUnk_081082E8[unk1*3+2];
|
||||
gSave.unk7 = gUnk_081082E8[unk1*3+2];
|
||||
PlaySFX(0x121);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "textbox.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void (*gUnk_081115C0[])(Entity*);
|
||||
extern void (*gUnk_081115D0[])(Entity*);
|
||||
@@ -146,10 +147,10 @@ void sub_08068B84(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08068BB4(Entity* this) {
|
||||
u32 item = gUnk_02002A40.stats.itemOnA;
|
||||
u32 item = gSave.stats.itemOnA;
|
||||
|
||||
this->field_0x68.HALF.HI = item;
|
||||
item = gUnk_02002A40.stats.itemOnB;
|
||||
item = gSave.stats.itemOnB;
|
||||
*(&this->field_0x68.HALF.HI + 1) = item;
|
||||
}
|
||||
|
||||
@@ -261,7 +262,7 @@ void sub_08068CFC(Entity* param_1, Entity* param_2, u32 param_3, u32 param_4)
|
||||
goto LABEL1;
|
||||
break;
|
||||
case 6:
|
||||
if (gUnk_02002A40.stats.maxHealth < 0x50)
|
||||
if (gSave.stats.maxHealth < 0x50)
|
||||
return;
|
||||
goto switchD_08068d12_caseD_0;
|
||||
case 7:
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "player.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void sub_0807DD50(Entity*);
|
||||
extern void sub_0806F118(Entity*);
|
||||
@@ -214,7 +215,7 @@ void sub_080602BC(Entity* this) {
|
||||
if (GetInventoryValue(0x48) != 0) {
|
||||
index = (Random() & 1) + 2;
|
||||
} else {
|
||||
if (gUnk_02002A40.stats.bombCount < gBombBagSizes[gUnk_02002A40.stats.bombBagType]) {
|
||||
if (gSave.stats.bombCount < gBombBagSizes[gSave.stats.bombBagType]) {
|
||||
index = 1;
|
||||
} else {
|
||||
index = 0;
|
||||
@@ -241,14 +242,14 @@ void sub_08060318(void) {
|
||||
}
|
||||
|
||||
void sub_08060340(void) {
|
||||
gUnk_02002A40.unk490 = gUnk_02002A40.unk50;
|
||||
gSave.unk490 = gSave.unk50;
|
||||
}
|
||||
|
||||
u32 sub_08060354(void) {
|
||||
u32 iVar1;
|
||||
s32 iVar2;
|
||||
|
||||
iVar2 = gUnk_02002A40.unk50 - gUnk_02002A40.unk490;
|
||||
iVar2 = gSave.unk50 - gSave.unk490;
|
||||
if (CheckGlobalFlag(DRUG_1) == 0) {
|
||||
if (4 < iVar2) {
|
||||
return 0x8444;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "npc.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void sub_0807DD50(Entity*);
|
||||
extern u32 sub_0806F5A4(u32);
|
||||
@@ -62,7 +63,7 @@ void sub_0806CE5C(Entity* this) {
|
||||
void sub_0806CE80(Entity* this) {
|
||||
u32 v;
|
||||
u32 v2;
|
||||
v = gUnk_02002A40.unk8;
|
||||
v = gSave.unk8;
|
||||
if (v == 5) {
|
||||
// flippers
|
||||
if (GetInventoryValue(0x46) == 0) {
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
#include "npc.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void sub_0807DD50(Entity*);
|
||||
extern u32 GetFacingDirection(Entity*, Entity*);
|
||||
@@ -72,7 +73,7 @@ void sub_080670B4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080670E4(Entity* this) {
|
||||
ShowNPCDialogue(this, &gUnk_08110C10[gUnk_02002A40.unk8]);
|
||||
ShowNPCDialogue(this, &gUnk_08110C10[gSave.unk8]);
|
||||
}
|
||||
|
||||
void sub_08067100(Entity* this) {
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "structures.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void sub_08060528(Entity*);
|
||||
extern void* GetCurrentRoomProperty(u32);
|
||||
@@ -194,7 +195,7 @@ void sub_080606C0(Entity* this) {
|
||||
void sub_080606D8(Entity* this) {
|
||||
s32 index;
|
||||
|
||||
index = gUnk_02002A40.unk8 - 2;
|
||||
index = gSave.unk8 - 2;
|
||||
if (index < 0) {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
+3
-2
@@ -2,6 +2,7 @@
|
||||
#include "entity.h"
|
||||
#include "textbox.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern u32 GetFacingDirection(Entity*, Entity*);
|
||||
extern u32 sub_0806F5A4(u32);
|
||||
@@ -149,10 +150,10 @@ void sub_08066218(Entity* this) {
|
||||
void sub_0806622C(Entity* this) {
|
||||
u32 index;
|
||||
|
||||
if (gUnk_02002A40.unk8 - 2 < 0) {
|
||||
if (gSave.unk8 - 2 < 0) {
|
||||
index = 0;
|
||||
} else {
|
||||
index = gUnk_02002A40.unk8 - 2;
|
||||
index = gSave.unk8 - 2;
|
||||
}
|
||||
ShowNPCDialogue(this, &gUnk_08110390[index]);
|
||||
}
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern SpriteLoadData gUnk_08113910[];
|
||||
extern void sub_0807DD50(Entity*);
|
||||
@@ -78,7 +79,7 @@ void Teachers_Head(Entity* this) {
|
||||
void sub_0806C70C(Entity* this) {
|
||||
int offset;
|
||||
|
||||
offset = gUnk_02002A40.unk8 - 2;
|
||||
offset = gSave.unk8 - 2;
|
||||
if (offset < 0)
|
||||
offset = 0;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "functions.h"
|
||||
#include "textbox.h"
|
||||
#include "flags.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void InitializeAnimation(Entity*, u32);
|
||||
extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*);
|
||||
@@ -244,7 +245,7 @@ void sub_0806AFA0(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0806AFBC(Entity* this) {
|
||||
int idx = gUnk_02002A40.unk8 - 2;
|
||||
int idx = gSave.unk8 - 2;
|
||||
if (idx < 0)
|
||||
idx = 0;
|
||||
|
||||
@@ -329,7 +330,7 @@ void sub_0806B134(Entity* this) {
|
||||
idx = 0;
|
||||
SetGlobalFlag(0x4a);
|
||||
}
|
||||
if (5 < gUnk_02002A40.unk8) {
|
||||
if (5 < gSave.unk8) {
|
||||
idx = 3;
|
||||
}
|
||||
TextboxNoOverlap(gUnk_08112C60[idx], this);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "flags.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
typedef struct {
|
||||
u8 frame1;
|
||||
@@ -296,7 +297,7 @@ void sub_08062048(Entity* this) {
|
||||
int iVar1;
|
||||
|
||||
if ((this->entityType).subtype == 6) {
|
||||
iVar1 = gUnk_02002A40.unk8 - 2;
|
||||
iVar1 = gSave.unk8 - 2;
|
||||
if (iVar1 < 0) {
|
||||
iVar1 = 0;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "flags.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*);
|
||||
extern void sub_0807DD50(Entity*);
|
||||
@@ -118,7 +119,7 @@ void sub_0806C90C(Entity* param_1, Entity* param_2) {
|
||||
}
|
||||
|
||||
void sub_0806C928(Entity* this) {
|
||||
ShowNPCDialogue(this, &gUnk_08113ABC[gUnk_02002A40.unk8]);
|
||||
ShowNPCDialogue(this, &gUnk_08113ABC[gSave.unk8]);
|
||||
}
|
||||
|
||||
void sub_0806C944(Entity* this) {
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void (*const gUnk_08123EC0[])(Entity*);
|
||||
extern void (*const gUnk_08123EEC[])(Entity*);
|
||||
@@ -118,7 +119,7 @@ void sub_0809D130(Entity* this) {
|
||||
sub_0800445C(this);
|
||||
} else if (sub_08017850(this) != 0) {
|
||||
CreateItemEntity(0x17, 0, 0);
|
||||
gUnk_02002A40.windcrests |= 0x10000000;
|
||||
gSave.windcrests |= 0x10000000;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include "menu.h"
|
||||
#include "npc.h"
|
||||
#include "position.h"
|
||||
#include "readKeyInput.h"
|
||||
#include "structures.h"
|
||||
#include "fileScreen.h"
|
||||
|
||||
extern int sub_0807A094(int);
|
||||
extern void LoadPalettes(const u8*, int, int);
|
||||
@@ -92,8 +92,8 @@ void sub_0808E818(Entity* this) {
|
||||
}
|
||||
|
||||
if (gUnk_02032EC0.lastState == 0) {
|
||||
if (gUnk_03000FF0.heldKeys & L_BUTTON) {
|
||||
switch (gUnk_03000FF0.newKeys) {
|
||||
if (gInput.heldKeys & L_BUTTON) {
|
||||
switch (gInput.newKeys) {
|
||||
case DPAD_UP:
|
||||
this->animationState = 0;
|
||||
break;
|
||||
@@ -167,7 +167,7 @@ void sub_0808E988(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0808E9F4(Entity* this) {
|
||||
if (sub_0808E950() && gUnk_02002A40.unk6) {
|
||||
if (sub_0808E950() && gSave.unk6) {
|
||||
this->spriteSettings.b.draw = 2;
|
||||
} else {
|
||||
this->spriteSettings.b.draw = 0;
|
||||
@@ -323,7 +323,7 @@ void sub_0808EBB8(Entity* this) {
|
||||
}
|
||||
|
||||
static Entity* sub_0808EC80(int form) {
|
||||
Entity* entityA = (Entity*) &gUnk_03003DA0;
|
||||
Entity* entityA = (Entity*)&gUnk_03003DA0;
|
||||
Entity* entityB = entityA->next;
|
||||
while (entityB != entityA) {
|
||||
if ((entityB->entityType.type == 0x6 && entityB->entityType.subtype == 0x48) &&
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "structures.h"
|
||||
#include "greatFairy.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
enum {
|
||||
BEHAVIORS,
|
||||
@@ -540,10 +541,10 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) {
|
||||
|
||||
switch (arg1->unk4) {
|
||||
case 0:
|
||||
gUnk_02002A40.stats.arrowCount = arg1->unk4;
|
||||
gSave.stats.arrowCount = arg1->unk4;
|
||||
break;
|
||||
case 1:
|
||||
gUnk_02002A40.stats.bombCount = 0;
|
||||
gSave.stats.bombCount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern void sub_0807DD64(Entity*);
|
||||
extern void sub_0807DDAC(Entity*, u32);
|
||||
@@ -27,6 +28,6 @@ void sub_080A2124(Entity* this) {
|
||||
|
||||
void Windcrest_Unlock(Entity* this) {
|
||||
PlaySFX(0x72);
|
||||
gUnk_02002A40.windcrests = gUnk_02002A40.windcrests | 1 << (this->entityType.parameter + 0x18);
|
||||
gSave.windcrests = gSave.windcrests | 1 << (this->entityType.parameter + 0x18);
|
||||
CreateFx(this, 0x46, 0);
|
||||
}
|
||||
|
||||
+3
-2
@@ -5,6 +5,7 @@
|
||||
#include "functions.h"
|
||||
#include "readKeyInput.h"
|
||||
#include "area.h"
|
||||
#include "save.h"
|
||||
|
||||
extern const void (*const gUnk_0811B9E0[])(Entity*);
|
||||
extern const void (*const gUnk_0811BA60[])(Entity*);
|
||||
@@ -122,7 +123,7 @@ void sub_08070C3C(Entity* this) {
|
||||
void sub_08070CB4(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if ((gUnk_02002A40.stats.health != 0) && ((gPlayerState.flags.all & 0x8000) != 0)) {
|
||||
if ((gSave.stats.health != 0) && ((gPlayerState.flags.all & 0x8000) != 0)) {
|
||||
gPlayerState.flags.all &= ~(0x1 | 0x4);
|
||||
this->spriteSettings.b.draw = 0;
|
||||
} else {
|
||||
@@ -496,7 +497,7 @@ void sub_08071380(Entity *this) {
|
||||
if ((gPlayerState.flags.all & 0x20) == 0)
|
||||
return;
|
||||
|
||||
if ((gUnk_03000FF0.newKeys & 0x102) == 0)
|
||||
if ((gInput.newKeys & 0x102) == 0)
|
||||
return;
|
||||
|
||||
if (CheckIsDungeon() || gArea.field_0x17 == 3) {
|
||||
|
||||
+42
-41
@@ -9,6 +9,7 @@
|
||||
#include "screen.h"
|
||||
#include "main.h"
|
||||
#include "structures.h"
|
||||
#include "save.h"
|
||||
|
||||
void sub_0804B3C4(void* arg0) {
|
||||
sub_0804B29C(arg0);
|
||||
@@ -346,7 +347,7 @@ extern EntityData gUnk_080D6734;
|
||||
extern EntityData gUnk_080D66F4;
|
||||
|
||||
void sub_0804B738(void) {
|
||||
if (gUnk_02002A40.unk8 > 4) {
|
||||
if (gSave.unk8 > 4) {
|
||||
LoadRoomEntityList(&gUnk_080D6714);
|
||||
}
|
||||
// flippers
|
||||
@@ -364,7 +365,7 @@ u32 sub_0804B788() {
|
||||
extern EntityData gUnk_080D6924;
|
||||
|
||||
void sub_0804B78C(void) {
|
||||
if (gUnk_02002A40.unk8 > 7) {
|
||||
if (gSave.unk8 > 7) {
|
||||
LoadRoomEntityList(&gUnk_080D6924);
|
||||
}
|
||||
}
|
||||
@@ -466,7 +467,7 @@ extern EntityData UpperInn_Din;
|
||||
void sub_0804B938(void) {
|
||||
int iVar1;
|
||||
|
||||
if (gUnk_02002A40.unk8 < 4)
|
||||
if (gSave.unk8 < 4)
|
||||
return;
|
||||
|
||||
if (CheckGlobalFlag(RENTED_HOUSE_DIN)) {
|
||||
@@ -516,7 +517,7 @@ u32 sub_0804BA08() {
|
||||
extern EntityData gUnk_080D7038;
|
||||
|
||||
void sub_0804BA0C(void) {
|
||||
if (gUnk_02002A40.unk8 < 8) {
|
||||
if (gSave.unk8 < 8) {
|
||||
LoadRoomEntityList(&gUnk_080D7038);
|
||||
}
|
||||
if (gRoomVars.filler[0] == 0) {
|
||||
@@ -536,13 +537,13 @@ extern EntityData gUnk_080D71F0;
|
||||
|
||||
void sub_0804BA44(void) {
|
||||
|
||||
if (gUnk_02002A40.unk8 == 6)
|
||||
if (gSave.unk8 == 6)
|
||||
LoadRoomEntityList(&gUnk_080D7140);
|
||||
|
||||
if (gUnk_02002A40.unk8 == 7)
|
||||
if (gSave.unk8 == 7)
|
||||
LoadRoomEntityList(&gUnk_080D7170);
|
||||
|
||||
if ((gUnk_02002A40.unk8 < 8) || (LoadRoomEntityList(&gUnk_080D71A0), gUnk_02002A40.unk8 < 8))
|
||||
if ((gSave.unk8 < 8) || (LoadRoomEntityList(&gUnk_080D71A0), gSave.unk8 < 8))
|
||||
LoadRoomEntityList(&gUnk_080D71D0);
|
||||
else
|
||||
LoadRoomEntityList(&gUnk_080D71F0);
|
||||
@@ -1125,7 +1126,7 @@ void sub_0804C334(void) {
|
||||
if (CheckKinstoneFused(0x5b))
|
||||
LoadRoomEntityList(&gUnk_080D9CC8);
|
||||
|
||||
if ((gUnk_02002A40.windcrests & 0x20000000) == 0)
|
||||
if ((gSave.windcrests & 0x20000000) == 0)
|
||||
LoadRoomEntityList(&gUnk_080D9CE8);
|
||||
|
||||
// pegasus boots
|
||||
@@ -1134,7 +1135,7 @@ void sub_0804C334(void) {
|
||||
}
|
||||
|
||||
void sub_0804C384(void) {
|
||||
if ((gUnk_02002A40.windcrests & 0x20000000) == 0)
|
||||
if ((gSave.windcrests & 0x20000000) == 0)
|
||||
LoadRoomEntityList(&gUnk_080D9CE8);
|
||||
}
|
||||
|
||||
@@ -1450,7 +1451,7 @@ extern EntityData gUnk_080DB238;
|
||||
|
||||
void sub_0804C664(void) {
|
||||
|
||||
if (gUnk_02002A40.unk8 > 8)
|
||||
if (gSave.unk8 > 8)
|
||||
LoadRoomEntityList(&gUnk_080DB238);
|
||||
|
||||
sub_0801AFE4();
|
||||
@@ -1932,13 +1933,13 @@ u32 sub_0804CA50() {
|
||||
extern EntityData gUnk_080DD364;
|
||||
|
||||
void sub_0804CA54(void) {
|
||||
if (!(gUnk_02002A40.windcrests & 0x4000000)) {
|
||||
if (!(gSave.windcrests & 0x4000000)) {
|
||||
LoadRoomEntityList(&gUnk_080DD364);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0804CA74(void) {
|
||||
if (!(gUnk_02002A40.windcrests & 0x4000000)) {
|
||||
if (!(gSave.windcrests & 0x4000000)) {
|
||||
LoadRoomEntityList(&gUnk_080DD364);
|
||||
}
|
||||
}
|
||||
@@ -2121,10 +2122,10 @@ u32 sub_0804CC6C() {
|
||||
}
|
||||
|
||||
void sub_0804CC70(void) {
|
||||
if (gUnk_02002A40.unk7 == 0) {
|
||||
if (gSave.unk7 == 0) {
|
||||
goto a;
|
||||
}
|
||||
if (gUnk_02002A40.unk7 != 2) {
|
||||
if (gSave.unk7 != 2) {
|
||||
a:
|
||||
SetTileType(0x90, 0x20b, 1);
|
||||
SetTileType(0x90, 0x411, 1);
|
||||
@@ -4233,7 +4234,7 @@ void LoadHyruleTown(void) {
|
||||
sub_08054570();
|
||||
TryLoadPrologueHyruleTown();
|
||||
SetTileType(0x176, 0x66b, 1);
|
||||
if (gUnk_02002A40.unk8 == 1) {
|
||||
if (gSave.unk8 == 1) {
|
||||
sub_0801D000(0);
|
||||
} else {
|
||||
sub_08018C58(0xdb4);
|
||||
@@ -4258,7 +4259,7 @@ void LoadHyruleTown(void) {
|
||||
} else {
|
||||
LoadRoomEntityList(&gUnk_080EECBC);
|
||||
}
|
||||
if (CheckKinstoneFused(0x1b) && (gUnk_02002A40.unk8 > 3)) {
|
||||
if (CheckKinstoneFused(0x1b) && (gSave.unk8 > 3)) {
|
||||
if (!CheckGlobalFlag(NEW_HOUSE_DIN) && !CheckGlobalFlag(NEW_HOUSE_NAYRU) &&
|
||||
!CheckGlobalFlag(NEW_HOUSE_FARORE)) {
|
||||
if (!CheckGlobalFlag(RENTED_HOUSE_DIN) && !CheckGlobalFlag(RENTED_HOUSE_NAYRU) &&
|
||||
@@ -4284,7 +4285,7 @@ void LoadHyruleTown(void) {
|
||||
} else {
|
||||
LoadRoomEntityList(&gUnk_080EE9DC);
|
||||
}
|
||||
if ((gUnk_02002A40.unk8 > 4) && !CheckKinstoneFused(0xb) &&
|
||||
if ((gSave.unk8 > 4) && !CheckKinstoneFused(0xb) &&
|
||||
(CheckGlobalFlag(RENTED_HOUSE_DIN) || CheckGlobalFlag(RENTED_HOUSE_NAYRU) ||
|
||||
CheckGlobalFlag(RENTED_HOUSE_FARORE))) {
|
||||
LoadRoomEntityList(&gUnk_080EEA5C);
|
||||
@@ -4293,13 +4294,13 @@ void LoadHyruleTown(void) {
|
||||
if (!CheckLocalFlag(0xd0) && GetInventoryValue(0x14)) {
|
||||
LoadRoomEntityList(&gUnk_080EEABC);
|
||||
}
|
||||
if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(INLOCK)) {
|
||||
if ((gSave.unk8 > 3) && CheckGlobalFlag(INLOCK)) {
|
||||
LoadRoomEntityList(&gUnk_080EEA7C);
|
||||
}
|
||||
if ((gUnk_02002A40.unk8 < 6) && !CheckGlobalFlag(MIZUKAKI_START)) {
|
||||
if ((gSave.unk8 < 6) && !CheckGlobalFlag(MIZUKAKI_START)) {
|
||||
LoadRoomEntityList(&gUnk_080EEA9C);
|
||||
}
|
||||
if ((gUnk_02002A40.windcrests & 0x8000000) == 0) {
|
||||
if ((gSave.windcrests & 0x8000000) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080EEBAC);
|
||||
}
|
||||
sub_0804E150();
|
||||
@@ -4309,7 +4310,7 @@ void LoadHyruleTown(void) {
|
||||
extern EntityData gUnk_080EEBAC;
|
||||
|
||||
void sub_0804E130(void) {
|
||||
if ((gUnk_02002A40.windcrests & 0x8000000) == 0) {
|
||||
if ((gSave.windcrests & 0x8000000) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080EEBAC);
|
||||
}
|
||||
}
|
||||
@@ -4587,7 +4588,7 @@ extern EntityData gUnk_080F236C;
|
||||
|
||||
void sub_0804E52C(void) {
|
||||
|
||||
if (gUnk_02002A40.unk8 > 7) {
|
||||
if (gSave.unk8 > 7) {
|
||||
LoadRoomEntityList(&gUnk_080F23BC);
|
||||
}
|
||||
// flippers
|
||||
@@ -4608,7 +4609,7 @@ extern EntityData gUnk_080F25C0;
|
||||
extern EntityData gUnk_080F2600;
|
||||
|
||||
void sub_0804E574(void) {
|
||||
switch (gUnk_02002A40.unk8) {
|
||||
switch (gSave.unk8) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
@@ -4836,7 +4837,7 @@ extern EntityData gUnk_080F3604;
|
||||
void sub_0804E8FC(void) {
|
||||
if (!CheckGlobalFlag(INLOCK)) {
|
||||
LoadRoomEntityList(&gUnk_080F36FC);
|
||||
} else if (gUnk_02002A40.unk8 < 4) {
|
||||
} else if (gSave.unk8 < 4) {
|
||||
LoadRoomEntityList(&gUnk_080F3604);
|
||||
}
|
||||
}
|
||||
@@ -4898,7 +4899,7 @@ void sub_0804E9D0(void) {
|
||||
if (CheckKinstoneFused(0x12)) {
|
||||
LoadRoomEntityList(&gUnk_080F3C94);
|
||||
}
|
||||
if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
|
||||
if ((gSave.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
|
||||
LoadRoomEntityList(&gUnk_080F3C44);
|
||||
}
|
||||
SetTile(0x4091, 0x590, 1);
|
||||
@@ -5066,7 +5067,7 @@ void sub_0804EC00(void) {
|
||||
if (CheckKinstoneFused(0x4e)) {
|
||||
LoadRoomEntityList(&gUnk_080F4F10);
|
||||
}
|
||||
if ((s32)gUnk_02002A40.windcrests > -1) {
|
||||
if ((s32)gSave.windcrests > -1) {
|
||||
LoadRoomEntityList(&gUnk_080F4E10);
|
||||
}
|
||||
}
|
||||
@@ -5074,7 +5075,7 @@ void sub_0804EC00(void) {
|
||||
extern EntityData gUnk_080F4E10;
|
||||
|
||||
void sub_0804EC98(void) {
|
||||
if ((s32)gUnk_02002A40.windcrests > -1) {
|
||||
if ((s32)gSave.windcrests > -1) {
|
||||
LoadRoomEntityList(&gUnk_080F4E10);
|
||||
}
|
||||
}
|
||||
@@ -5216,7 +5217,7 @@ void sub_0804EEBC(void) {
|
||||
if (!CheckLocalFlag(0x55)) {
|
||||
LoadRoomEntityList(&gUnk_080F57A8);
|
||||
} else {
|
||||
if (gBombBagSizes[gUnk_02002A40.stats.bombBagType] > 0x1d) {
|
||||
if (gBombBagSizes[gSave.stats.bombBagType] > 0x1d) {
|
||||
LoadRoomEntityList(&gUnk_080F57C8);
|
||||
}
|
||||
if (!GetInventoryValue(0xb) && !GetInventoryValue(0xc)) {
|
||||
@@ -5235,7 +5236,7 @@ void sub_0804EEBC(void) {
|
||||
LoadRoomEntityList(&gUnk_080F5848);
|
||||
}
|
||||
}
|
||||
if (gUnk_02002A40.stats.filler2[5] == 0) {
|
||||
if (gSave.stats.filler2[5] == 0) {
|
||||
LoadRoomEntityList(&gUnk_080F5788);
|
||||
}
|
||||
}
|
||||
@@ -5276,7 +5277,7 @@ extern EntityData gUnk_080F5DD0;
|
||||
extern u32 gUnk_08011C50;
|
||||
|
||||
void sub_0804EFF8(void) {
|
||||
if (gUnk_02002A40.unk8 > 7) {
|
||||
if (gSave.unk8 > 7) {
|
||||
LoadRoomEntityList(&gUnk_080F5DD0);
|
||||
}
|
||||
if (CheckGlobalFlag(MAROYA_WAKEUP)) {
|
||||
@@ -5306,7 +5307,7 @@ extern EntityData gUnk_080F5F78;
|
||||
|
||||
void sub_0804F050(void) {
|
||||
|
||||
if (gUnk_02002A40.unk8 > 4) {
|
||||
if (gSave.unk8 > 4) {
|
||||
LoadRoomEntityList(&gUnk_080F5F38);
|
||||
}
|
||||
if (!CheckLocalFlag(0x92)) {
|
||||
@@ -5507,10 +5508,10 @@ void sub_0804F25C(void) {
|
||||
if (!CheckGlobalFlag(TABIDACHI)) {
|
||||
gArea.pMusicIndex = 0x10;
|
||||
}
|
||||
if ((gUnk_02002A40.windcrests & 0x40000000) == 0) {
|
||||
if ((gSave.windcrests & 0x40000000) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080F70D8);
|
||||
}
|
||||
if (gUnk_02002A40.unk8 > 3) {
|
||||
if (gSave.unk8 > 3) {
|
||||
LoadRoomEntityList(&gUnk_080F7088);
|
||||
}
|
||||
}
|
||||
@@ -5518,7 +5519,7 @@ void sub_0804F25C(void) {
|
||||
extern EntityData gUnk_080F70D8;
|
||||
|
||||
void sub_0804F2C8(void) {
|
||||
if ((gUnk_02002A40.windcrests & 0x40000000) == 0) {
|
||||
if ((gSave.windcrests & 0x40000000) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080F70D8);
|
||||
}
|
||||
}
|
||||
@@ -5553,7 +5554,7 @@ extern EntityData gUnk_080F7550;
|
||||
|
||||
void sub_0804F330(void) {
|
||||
sub_0805ADD8(0);
|
||||
if (gUnk_02002A40.unk8 > 3) {
|
||||
if (gSave.unk8 > 3) {
|
||||
LoadRoomEntityList(&gUnk_080F7500);
|
||||
}
|
||||
if (GetInventoryValue(0x11) && !GetInventoryValue(0x12)) {
|
||||
@@ -5593,7 +5594,7 @@ void sub_0804F3B0(void) {
|
||||
SetTile(0x4072, 0xd88, 1);
|
||||
SetTile(0x4096, 0xdc8, 1);
|
||||
}
|
||||
if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
|
||||
if ((gSave.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
|
||||
LoadRoomEntityList(&gUnk_080F78A0);
|
||||
}
|
||||
}
|
||||
@@ -5798,7 +5799,7 @@ extern EntityData gUnk_080F806C;
|
||||
void sub_0804FA00(void) {
|
||||
|
||||
sub_0805ADD8(0);
|
||||
if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
|
||||
if ((gSave.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
|
||||
LoadRoomEntityList(&gUnk_080F806C);
|
||||
}
|
||||
}
|
||||
@@ -6025,7 +6026,7 @@ u32 sub_0804FBB8() {
|
||||
extern EntityData gUnk_080F9304;
|
||||
|
||||
void sub_0804FBBC(void) {
|
||||
if ((gUnk_02002A40.windcrests & 0x2000000) == 0) {
|
||||
if ((gSave.windcrests & 0x2000000) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080F9304);
|
||||
}
|
||||
}
|
||||
@@ -6033,7 +6034,7 @@ void sub_0804FBBC(void) {
|
||||
extern EntityData gUnk_080F9304;
|
||||
|
||||
void sub_0804FBDC(void) {
|
||||
if ((gUnk_02002A40.windcrests & 0x2000000) == 0) {
|
||||
if ((gSave.windcrests & 0x2000000) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080F9304);
|
||||
}
|
||||
}
|
||||
@@ -6440,7 +6441,7 @@ void sub_0804FE58(void) {
|
||||
if (CheckGlobalFlag(LV2_CLEAR) && !CheckLocalFlag(LV1_CLEAR)) {
|
||||
LoadRoomEntityList(&gUnk_080FAFE4);
|
||||
}
|
||||
if ((gUnk_02002A40.windcrests & 0x1000000) == 0) {
|
||||
if ((gSave.windcrests & 0x1000000) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080FB004);
|
||||
}
|
||||
if (GetInventoryValue(0x2)) {
|
||||
@@ -6451,7 +6452,7 @@ void sub_0804FE58(void) {
|
||||
extern EntityData gUnk_080FB004;
|
||||
|
||||
void sub_0804FEAC(void) {
|
||||
if ((gUnk_02002A40.windcrests & 0x1000000) == 0) {
|
||||
if ((gSave.windcrests & 0x1000000) == 0) {
|
||||
LoadRoomEntityList(&gUnk_080FB004);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -29,8 +29,8 @@ void sub_0807CD9C() {
|
||||
sub_080530C8();
|
||||
}
|
||||
|
||||
SaveResult sub_0807CDA4(SaveState state) {
|
||||
return sSaveHandlers[gMenu.storyPanelIndex](state);
|
||||
SaveResult sub_0807CDA4(u32 arg0) {
|
||||
return sSaveHandlers[gMenu.storyPanelIndex](arg0);
|
||||
}
|
||||
|
||||
SaveResult HandleSaveInit(u32 arg0) {
|
||||
@@ -49,7 +49,7 @@ SaveResult HandleSaveInProgress(u32 arg0) {
|
||||
InitDMA();
|
||||
switch (arg0) {
|
||||
case 0:
|
||||
temp = sub_0807CF08(gUnk_02000000->saveFileId, gUnk_02002A40.filler0);
|
||||
temp = sub_0807CF08(gUnk_02000000->saveFileId, gSave.filler0);
|
||||
break;
|
||||
case 1:
|
||||
sub_0807CF48(gUnk_02000000->saveFileId);
|
||||
@@ -126,7 +126,7 @@ u32 sub_0807CF1C(u8* arg0) {
|
||||
return sub_0807CF88(5, arg0);
|
||||
}
|
||||
|
||||
int sub_0807CF28(u32 arg0, SaveFile* arg1) {
|
||||
s32 sub_0807CF28(u32 arg0, SaveFile* arg1) {
|
||||
return sub_0807D008(arg0, arg1);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@ typedef struct {
|
||||
u16 unk4;
|
||||
} VStruct;
|
||||
|
||||
extern VStruct gUnk_03000FF0;
|
||||
extern VStruct gInput;
|
||||
extern u8 gBG3Buffer[];
|
||||
|
||||
extern void (*const gUnk_08109A30[])();
|
||||
@@ -46,7 +46,7 @@ void sub_0805FA04(void) {
|
||||
void sub_0805FA98(void) {
|
||||
int iVar1;
|
||||
|
||||
switch (gUnk_03000FF0.unk2) {
|
||||
switch (gInput.unk2) {
|
||||
case 0x40:
|
||||
gMenu.focusCoords[1] -= 1;
|
||||
break;
|
||||
@@ -71,7 +71,7 @@ void sub_0805FA98(void) {
|
||||
sub_08056418();
|
||||
break;
|
||||
default:
|
||||
switch (gUnk_03000FF0.unk4) {
|
||||
switch (gInput.unk4) {
|
||||
case 0x20:
|
||||
iVar1 = -1;
|
||||
break;
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@
|
||||
#include "functions.h"
|
||||
#include "textbox.h"
|
||||
#include "structures.h"
|
||||
#include "save.h"
|
||||
|
||||
u32 sub_080564DC(void);
|
||||
u32 sub_080564EC(void);
|
||||
@@ -154,7 +155,7 @@ NONMATCH("asm/non_matching/textbox/sub_080564EC.inc", u32 sub_080564EC(void)) {
|
||||
dest = gUnk_02022780._5e;
|
||||
|
||||
for (i = 0; i < 6; ++i) {
|
||||
c = gUnk_02002A40.playerName[i];
|
||||
c = gSave.playerName[i];
|
||||
if (c == '\0')
|
||||
break;
|
||||
dest[i] = c;
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
"main.h": "c",
|
||||
"object.h": "c",
|
||||
"filescreen.h": "c",
|
||||
"screen.h": "c"
|
||||
"screen.h": "c",
|
||||
"global.h": "c",
|
||||
"player.h": "c"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user