summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2021-07-04 13:51:56 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2021-07-04 13:51:56 -0400
commit973476412e5049f48983464689238431c3c2cffc (patch)
tree2d9c3457ca8f6cdd7feb46e93d64e5a20ff74f90 /src
parent2a52f21d6f15b745b80202c97b960de6a39f1ab8 (diff)
Move this pointer to its rightful place
Diffstat (limited to 'src')
-rw-r--r--src/decoration.c2
-rw-r--r--src/slot_machine.c1048
2 files changed, 525 insertions, 525 deletions
diff --git a/src/decoration.c b/src/decoration.c
index 35554c82a..da1ee8530 100644
--- a/src/decoration.c
+++ b/src/decoration.c
@@ -2993,8 +2993,6 @@ const struct SpriteTemplate gSpriteTemplate_83ECA88 = {
const struct YesNoFuncTable gUnknown_083ECAA0 = {.yesFunc = sub_8101848, .noFunc = sub_80FED3C};
-u8 *const unref_label_083ECAA8[] = {gSharedMem};
-
void sub_81008BC(struct UnkStruct_02038900 *unk_02038900)
{
u8 i;
diff --git a/src/slot_machine.c b/src/slot_machine.c
index 27965b0c2..41b9c42a5 100644
--- a/src/slot_machine.c
+++ b/src/slot_machine.c
@@ -331,6 +331,8 @@ static u8 unk_debug_bss_1_4;
static u32 unk_debug_bss_1_8;
#endif
+static struct SlotMachineEwramStruct *const sSlotMachine = eSlotMachine;
+
static const struct UnkStruct1 *const gUnknown_083ED048[];
static const u16 gPalette_83EDE24[];
static const u8 gUnknown_083ECD04[][3];
@@ -408,10 +410,10 @@ static void SlotMachine_VBlankCallback(void)
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
- REG_WIN0H = eSlotMachine->win0h;
- REG_WIN0V = eSlotMachine->win0v;
- REG_WININ = eSlotMachine->winIn;
- REG_WINOUT = eSlotMachine->winOut;
+ REG_WIN0H = sSlotMachine->win0h;
+ REG_WIN0V = sSlotMachine->win0v;
+ REG_WININ = sSlotMachine->winIn;
+ REG_WINOUT = sSlotMachine->winOut;
}
static void PlaySlotMachine_Internal(u8 arg0, MainCallback cb)
@@ -424,8 +426,8 @@ static void PlaySlotMachine_Internal(u8 arg0, MainCallback cb)
static void sub_81019EC(void)
{
struct Task *task = gTasks + FindTaskIdByFunc(SlotMachineDummyTask);
- eSlotMachine->unk01 = task->data[0];
- LoadWordFromTwoHalfwords((u16 *)(task->data + 1), (u32 *)&eSlotMachine->prevMainCb);
+ sSlotMachine->unk01 = task->data[0];
+ LoadWordFromTwoHalfwords((u16 *)(task->data + 1), (u32 *)&sSlotMachine->prevMainCb);
}
static void SlotMachineDummyTask(u8 taskId)
@@ -492,35 +494,35 @@ static void SlotMachineSetup_0_1(void)
u8 i;
sub_81019EC();
- eSlotMachine->state = 0;
- eSlotMachine->pikaPower = 0;
- eSlotMachine->unk03 = Random() & 1;
- eSlotMachine->unk04 = 0;
- eSlotMachine->matchedSymbols = 0;
- eSlotMachine->unk0A = 0;
- eSlotMachine->unk0B = 0;
- eSlotMachine->coins = gSaveBlock1.coins;
- eSlotMachine->payout = 0;
- eSlotMachine->unk10 = 0;
- eSlotMachine->bet = 0;
- eSlotMachine->unk18 = 0;
- eSlotMachine->unk1A = 8;
- eSlotMachine->win0h = 0xf0;
- eSlotMachine->win0v = 0xa0;
- eSlotMachine->winIn = 0x3f;
- eSlotMachine->winOut = 0x3f;
- eSlotMachine->backupMapMusic = GetCurrentMapMusic();
+ sSlotMachine->state = 0;
+ sSlotMachine->pikaPower = 0;
+ sSlotMachine->unk03 = Random() & 1;
+ sSlotMachine->unk04 = 0;
+ sSlotMachine->matchedSymbols = 0;
+ sSlotMachine->unk0A = 0;
+ sSlotMachine->unk0B = 0;
+ sSlotMachine->coins = gSaveBlock1.coins;
+ sSlotMachine->payout = 0;
+ sSlotMachine->unk10 = 0;
+ sSlotMachine->bet = 0;
+ sSlotMachine->unk18 = 0;
+ sSlotMachine->unk1A = 8;
+ sSlotMachine->win0h = 0xf0;
+ sSlotMachine->win0v = 0xa0;
+ sSlotMachine->winIn = 0x3f;
+ sSlotMachine->winOut = 0x3f;
+ sSlotMachine->backupMapMusic = GetCurrentMapMusic();
for (i = 0; i < 3; i++)
{
- eSlotMachine->unk22[i] = 0;
- eSlotMachine->reelPositions[i] = gUnknown_083ECCF8[i][eSlotMachine->unk03] % 21;
- eSlotMachine->unk1C[i] = 0x1f8 - eSlotMachine->reelPositions[i] * 24;
- eSlotMachine->unk1C[i] %= 0x1f8;
+ sSlotMachine->unk22[i] = 0;
+ sSlotMachine->reelPositions[i] = gUnknown_083ECCF8[i][sSlotMachine->unk03] % 21;
+ sSlotMachine->unk1C[i] = 0x1f8 - sSlotMachine->reelPositions[i] * 24;
+ sSlotMachine->unk1C[i] %= 0x1f8;
}
#if DEBUG
debug_sub_811B5D0();
if (unk_debug_bss_1_1 != 0)
- eSlotMachine->coins = 1000;
+ sSlotMachine->coins = 1000;
#endif
}
@@ -605,39 +607,39 @@ static bool8 (*const gUnknown_083ECAAC[])(struct Task *task) =
static void sub_8101D24(u8 taskId)
{
- while (gUnknown_083ECAAC[eSlotMachine->state](gTasks + taskId))
+ while (gUnknown_083ECAAC[sSlotMachine->state](gTasks + taskId))
;
}
static bool8 sub_8101D5C(struct Task *task)
{
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0));
- sub_810423C(eSlotMachine->pikaPower);
- eSlotMachine->state++;
+ sub_810423C(sSlotMachine->pikaPower);
+ sSlotMachine->state++;
return FALSE;
}
static bool8 sub_8101D8C(struct Task *task)
{
if (!gPaletteFade.active)
- eSlotMachine->state++;
+ sSlotMachine->state++;
return FALSE;
}
static bool8 sub_8101DB0(struct Task *task)
{
- eSlotMachine->payout = 0;
- eSlotMachine->bet = 0;
- eSlotMachine->unk18 = 0;
- eSlotMachine->unk04 &= 0xc0;
- eSlotMachine->state = 4;
- if (eSlotMachine->coins <= 0)
+ sSlotMachine->payout = 0;
+ sSlotMachine->bet = 0;
+ sSlotMachine->unk18 = 0;
+ sSlotMachine->unk04 &= 0xc0;
+ sSlotMachine->state = 4;
+ if (sSlotMachine->coins <= 0)
{
- eSlotMachine->state = 25;
+ sSlotMachine->state = 25;
}
- else if (eSlotMachine->unk0A)
+ else if (sSlotMachine->unk0A)
{
- eSlotMachine->state = 3;
+ sSlotMachine->state = 3;
sub_8104CAC(4);
}
return TRUE;
@@ -646,20 +648,20 @@ static bool8 sub_8101DB0(struct Task *task)
static bool8 sub_8101DF4(struct Task *task)
{
if (sub_8104E18())
- eSlotMachine->state = 4;
+ sSlotMachine->state = 4;
return FALSE;
}
static bool8 sub_8101E10(struct Task *task)
{
sub_8104CAC(0);
- eSlotMachine->state = 5;
+ sSlotMachine->state = 5;
if (
#if DEBUG
(unk_debug_bss_1_1 == 0 || unk_debug_bss_1_4 == 0) &&
#endif
- eSlotMachine->coins >= 9999)
- eSlotMachine->state = 23;
+ sSlotMachine->coins >= 9999)
+ sSlotMachine->state = 23;
return TRUE;
}
@@ -670,7 +672,7 @@ static bool8 sub_8101E3C(struct Task *task)
#if DEBUG
if (unk_debug_bss_1_1 != 0 && unk_debug_bss_1_4 != 0)
{
- if (eSlotMachine->coins <= 3 || (gMain.heldKeys & B_BUTTON))
+ if (sSlotMachine->coins <= 3 || (gMain.heldKeys & B_BUTTON))
{
unk_debug_bss_1_4 = 0;
}
@@ -679,16 +681,16 @@ static bool8 sub_8101E3C(struct Task *task)
sub_8103D50(0);
sub_8103D50(1);
sub_8103D50(2);
- eSlotMachine->coins -= 3;
- eSlotMachine->bet = 3;
- eSlotMachine->state = 9;
+ sSlotMachine->coins -= 3;
+ sSlotMachine->bet = 3;
+ sSlotMachine->state = 9;
return 0;
}
}
if (unk_debug_bss_1_1 != 0 && (gMain.newKeys & 8))
{
debug_sub_811B620();
- eSlotMachine->state = 29;
+ sSlotMachine->state = 29;
return 0;
}
#endif
@@ -696,37 +698,37 @@ static bool8 sub_8101E3C(struct Task *task)
if (gMain.newKeys & SELECT_BUTTON)
{
sub_8104AB8(0);
- eSlotMachine->state = 8;
+ sSlotMachine->state = 8;
}
else if (gMain.newKeys & R_BUTTON)
{
- if (eSlotMachine->coins - (3 - eSlotMachine->bet) >= 0)
+ if (sSlotMachine->coins - (3 - sSlotMachine->bet) >= 0)
{
- for (i = eSlotMachine->bet; i < 3; i++)
+ for (i = sSlotMachine->bet; i < 3; i++)
sub_8103D50(i);
- eSlotMachine->coins -= (3 - eSlotMachine->bet);
- eSlotMachine->bet = 3;
- eSlotMachine->state = 9;
+ sSlotMachine->coins -= (3 - sSlotMachine->bet);
+ sSlotMachine->bet = 3;
+ sSlotMachine->state = 9;
PlaySE(SE_SHOP);
}
else
{
- eSlotMachine->state = 6;
+ sSlotMachine->state = 6;
}
}
else
{
- if (gMain.newKeys & DPAD_DOWN && eSlotMachine->coins != 0)
+ if (gMain.newKeys & DPAD_DOWN && sSlotMachine->coins != 0)
{
PlaySE(SE_SHOP);
- sub_8103D50(eSlotMachine->bet);
- eSlotMachine->coins--;
- eSlotMachine->bet++;
+ sub_8103D50(sSlotMachine->bet);
+ sSlotMachine->coins--;
+ sSlotMachine->bet++;
}
- if (eSlotMachine->bet >= 3 || (eSlotMachine->bet != 0 && gMain.newKeys & A_BUTTON))
- eSlotMachine->state = 9;
+ if (sSlotMachine->bet >= 3 || (sSlotMachine->bet != 0 && gMain.newKeys & A_BUTTON))
+ sSlotMachine->state = 9;
if (gMain.newKeys & B_BUTTON)
- eSlotMachine->state = 21;
+ sSlotMachine->state = 21;
}
return FALSE;
}
@@ -740,7 +742,7 @@ static void sub_8101F2C(const u8 *str)
static bool8 sub_8101F44(struct Task *task)
{
sub_8101F2C(gOtherText_DontHaveThreeCoins);
- eSlotMachine->state = 7;
+ sSlotMachine->state = 7;
return FALSE;
}
@@ -749,7 +751,7 @@ static bool8 sub_8101F60(struct Task *task)
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
Menu_EraseScreen();
- eSlotMachine->state = 5;
+ sSlotMachine->state = 5;
}
return FALSE;
}
@@ -757,7 +759,7 @@ static bool8 sub_8101F60(struct Task *task)
static bool8 sub_8101F88(struct Task *task)
{
if (sub_8104AEC())
- eSlotMachine->state = 5;
+ sSlotMachine->state = 5;
return FALSE;
}
@@ -769,22 +771,22 @@ static bool8 sub_8101FA4(struct Task *task)
sub_8102DEC(1);
sub_8102DEC(2);
task->data[0] = 0;
- if (eSlotMachine->unk04 & 0x20)
+ if (sSlotMachine->unk04 & 0x20)
{
sub_810430C();
- eSlotMachine->state = 10;
+ sSlotMachine->state = 10;
}
else
{
sub_8104CAC(1);
- eSlotMachine->state = 11;
+ sSlotMachine->state = 11;
}
- eSlotMachine->unk1A = 8;
- if (eSlotMachine->unk0A)
- eSlotMachine->unk1A = dp15_jump_random_unknown();
+ sSlotMachine->unk1A = 8;
+ if (sSlotMachine->unk0A)
+ sSlotMachine->unk1A = dp15_jump_random_unknown();
#if DEBUG
if (unk_debug_bss_1_1 != 0)
- debug_sub_811B5B4(&eSlotMachine->unk68, 1);
+ debug_sub_811B5B4(&sSlotMachine->unk68, 1);
#endif
return FALSE;
}
@@ -794,8 +796,8 @@ static bool8 sub_8102008(struct Task *task)
if (sub_810432C())
{
sub_8104CAC(1);
- eSlotMachine->unk04 &= 0xDF;
- eSlotMachine->state = 11;
+ sSlotMachine->unk04 &= 0xDF;
+ sSlotMachine->state = 11;
}
return FALSE;
}
@@ -809,7 +811,7 @@ static bool8 sub_8102034(struct Task *task)
unk_debug_bss_1_8 = (Random() & 0x1F) + 1;
#endif
sub_81024F0();
- eSlotMachine->state = 12;
+ sSlotMachine->state = 12;
}
return FALSE;
}
@@ -823,10 +825,10 @@ static bool8 sub_8102058(struct Task *task)
if (unk_debug_bss_1_8 == 0)
{
PlaySE(SE_CONTEST_PLACE);
- sub_8102E1C(eSlotMachine->unk18);
- sub_8103C14(eSlotMachine->unk18);
+ sub_8102E1C(sSlotMachine->unk18);
+ sub_8103C14(sSlotMachine->unk18);
unk_debug_bss_1_8 = (Random() & 0x1F) + 1;
- eSlotMachine->state = 13;
+ sSlotMachine->state = 13;
}
return FALSE;
}
@@ -835,59 +837,59 @@ static bool8 sub_8102058(struct Task *task)
if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_CONTEST_PLACE);
- sub_8102E1C(eSlotMachine->unk18);
- sub_8103C14(eSlotMachine->unk18);
- eSlotMachine->state = 13;
+ sub_8102E1C(sSlotMachine->unk18);
+ sub_8103C14(sSlotMachine->unk18);
+ sSlotMachine->state = 13;
}
return FALSE;
}
static bool8 sub_8102090(struct Task *task)
{
- if (!sub_8102E40(eSlotMachine->unk18))
+ if (!sub_8102E40(sSlotMachine->unk18))
{
- eSlotMachine->unk18++;
- eSlotMachine->state = 12;
- if (eSlotMachine->unk18 > 2)
+ sSlotMachine->unk18++;
+ sSlotMachine->state = 12;
+ if (sSlotMachine->unk18 > 2)
{
- eSlotMachine->state = 14;
+ sSlotMachine->state = 14;
#if DEBUG
switch (unk_debug_bss_1_0)
{
case 2:
- eSlotMachine->reelPositions[0] = 20;
- eSlotMachine->reelPositions[1] = 20;
- eSlotMachine->reelPositions[2] = 18;
+ sSlotMachine->reelPositions[0] = 20;
+ sSlotMachine->reelPositions[1] = 20;
+ sSlotMachine->reelPositions[2] = 18;
break;
case 1:
- eSlotMachine->reelPositions[0] = 20;
- eSlotMachine->reelPositions[1] = 20;
- eSlotMachine->reelPositions[2] = 18;
+ sSlotMachine->reelPositions[0] = 20;
+ sSlotMachine->reelPositions[1] = 20;
+ sSlotMachine->reelPositions[2] = 18;
break;
case 4:
- eSlotMachine->reelPositions[0] = 3;
- eSlotMachine->reelPositions[1] = 1;
- eSlotMachine->reelPositions[2] = 2;
+ sSlotMachine->reelPositions[0] = 3;
+ sSlotMachine->reelPositions[1] = 1;
+ sSlotMachine->reelPositions[2] = 2;
break;
case 8:
- eSlotMachine->reelPositions[0] = 0;
- eSlotMachine->reelPositions[1] = 2;
- eSlotMachine->reelPositions[2] = 3;
+ sSlotMachine->reelPositions[0] = 0;
+ sSlotMachine->reelPositions[1] = 2;
+ sSlotMachine->reelPositions[2] = 3;
break;
case 0x10:
- eSlotMachine->reelPositions[0] = 2;
- eSlotMachine->reelPositions[1] = 5;
- eSlotMachine->reelPositions[2] = 20;
+ sSlotMachine->reelPositions[0] = 2;
+ sSlotMachine->reelPositions[1] = 5;
+ sSlotMachine->reelPositions[2] = 20;
break;
case 0x40:
- eSlotMachine->reelPositions[0] = 19;
- eSlotMachine->reelPositions[1] = 19;
- eSlotMachine->reelPositions[2] = 0;
+ sSlotMachine->reelPositions[0] = 19;
+ sSlotMachine->reelPositions[1] = 19;
+ sSlotMachine->reelPositions[2] = 0;
break;
case 0x80:
- eSlotMachine->reelPositions[0] = 19;
- eSlotMachine->reelPositions[1] = 19;
- eSlotMachine->reelPositions[2] = 19;
+ sSlotMachine->reelPositions[0] = 19;
+ sSlotMachine->reelPositions[1] = 19;
+ sSlotMachine->reelPositions[2] = 19;
break;
}
#endif
@@ -899,12 +901,12 @@ static bool8 sub_8102090(struct Task *task)
bool8 sub_81020C8(struct Task *task)
{
- eSlotMachine->unk04 &= 0xc0;
+ sSlotMachine->unk04 &= 0xc0;
CheckMatch();
- if (eSlotMachine->unk0A)
+ if (sSlotMachine->unk0A)
{
- eSlotMachine->unk0A--;
- eSlotMachine->unk0B++;
+ sSlotMachine->unk0A--;
+ sSlotMachine->unk0B++;
}
#if DEBUG
else
@@ -913,24 +915,24 @@ bool8 sub_81020C8(struct Task *task)
}
#endif
- if (eSlotMachine->matchedSymbols)
+ if (sSlotMachine->matchedSymbols)
{
#if DEBUG
- debug_sub_811B5B4(&eSlotMachine->unk6C, eSlotMachine->payout);
+ debug_sub_811B5B4(&sSlotMachine->unk6C, sSlotMachine->payout);
#endif
- eSlotMachine->state = 15;
+ sSlotMachine->state = 15;
sub_8102A24();
sub_8103F70();
- if ((eSlotMachine->unk10 -= eSlotMachine->payout) < 0)
+ if ((sSlotMachine->unk10 -= sSlotMachine->payout) < 0)
{
- eSlotMachine->unk10 = 0;
+ sSlotMachine->unk10 = 0;
}
- if (eSlotMachine->matchedSymbols & ((1 << SLOT_MACHINE_MATCHED_777_BLUE) | (1 << SLOT_MACHINE_MATCHED_777_RED)))
+ if (sSlotMachine->matchedSymbols & ((1 << SLOT_MACHINE_MATCHED_777_BLUE) | (1 << SLOT_MACHINE_MATCHED_777_RED)))
{
PlayFanfare(MUS_SLOTS_JACKPOT);
sub_8104CAC(6);
}
- else if (eSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_777_MIXED))
+ else if (sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_777_MIXED))
{
PlayFanfare(MUS_SLOTS_JACKPOT);
sub_8104CAC(5);
@@ -940,30 +942,30 @@ bool8 sub_81020C8(struct Task *task)
PlayFanfare(MUS_SLOTS_WIN);
sub_8104CAC(2);
}
- if (eSlotMachine->matchedSymbols & ((1 << SLOT_MACHINE_MATCHED_777_MIXED) | (1 << SLOT_MACHINE_MATCHED_777_BLUE) | (1 << SLOT_MACHINE_MATCHED_777_RED)))
+ if (sSlotMachine->matchedSymbols & ((1 << SLOT_MACHINE_MATCHED_777_MIXED) | (1 << SLOT_MACHINE_MATCHED_777_BLUE) | (1 << SLOT_MACHINE_MATCHED_777_RED)))
{
- eSlotMachine->unk04 &= 0x3f;
- if (eSlotMachine->matchedSymbols & ((1 << SLOT_MACHINE_MATCHED_777_BLUE) | (1 << SLOT_MACHINE_MATCHED_777_RED)))
+ sSlotMachine->unk04 &= 0x3f;
+ if (sSlotMachine->matchedSymbols & ((1 << SLOT_MACHINE_MATCHED_777_BLUE) | (1 << SLOT_MACHINE_MATCHED_777_RED)))
{
- eSlotMachine->unk0A = 0;
- eSlotMachine->unk0B = 0;
- eSlotMachine->unk03 = 0;
- if (eSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_777_BLUE))
- eSlotMachine->unk03 = 1;
+ sSlotMachine->unk0A = 0;
+ sSlotMachine->unk0B = 0;
+ sSlotMachine->unk03 = 0;
+ if (sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_777_BLUE))
+ sSlotMachine->unk03 = 1;
}
}
- if (eSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_POWER) && eSlotMachine->pikaPower < 16)
+ if (sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_POWER) && sSlotMachine->pikaPower < 16)
{
- eSlotMachine->pikaPower++;
- sub_8104064(eSlotMachine->pikaPower);
+ sSlotMachine->pikaPower++;
+ sub_8104064(sSlotMachine->pikaPower);
}
}
else
{
sub_8104CAC(3);
- eSlotMachine->state = 20;
- if ((eSlotMachine->unk10 += eSlotMachine->bet) > 9999)
- eSlotMachine->unk10 = 9999;
+ sSlotMachine->state = 20;
+ if ((sSlotMachine->unk10 += sSlotMachine->bet) > 9999)
+ sSlotMachine->unk10 = 9999;
}
return FALSE;
}
@@ -971,7 +973,7 @@ bool8 sub_81020C8(struct Task *task)
static bool8 sub_81021E0(struct Task *task)
{
if (sub_8102A44())
- eSlotMachine->state = 16;
+ sSlotMachine->state = 16;
return FALSE;
}
@@ -979,20 +981,20 @@ static bool8 sub_81021FC(struct Task *task)
{
if (sub_8103FA0())
{
- eSlotMachine->state = 19;
- if (eSlotMachine->matchedSymbols & ((1 << SLOT_MACHINE_MATCHED_777_RED) | (1 << SLOT_MACHINE_MATCHED_777_BLUE)))
+ sSlotMachine->state = 19;
+ if (sSlotMachine->matchedSymbols & ((1 << SLOT_MACHINE_MATCHED_777_RED) | (1 << SLOT_MACHINE_MATCHED_777_BLUE)))
IncrementGameStat(GAME_STAT_SLOT_JACKPOTS);
- if (eSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
+ if (sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
{
- eSlotMachine->unk18 = 0;
- eSlotMachine->state = 9;
+ sSlotMachine->unk18 = 0;
+ sSlotMachine->state = 9;
}
- if (eSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_POWER))
- eSlotMachine->state = 17;
- if (eSlotMachine->unk0A && eSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
+ if (sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_POWER))
+ sSlotMachine->state = 17;
+ if (sSlotMachine->unk0A && sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
{
sub_8104CAC(4);
- eSlotMachine->state = 18;
+ sSlotMachine->state = 18;
}
}
return FALSE;
@@ -1002,14 +1004,14 @@ static bool8 sub_8102264(struct Task *task)
{
if (!sub_81040C8())
{
- eSlotMachine->state = 19;
- if (eSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
+ sSlotMachine->state = 19;
+ if (sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
{
- eSlotMachine->state = 9;
- if (eSlotMachine->unk0A)
+ sSlotMachine->state = 9;
+ if (sSlotMachine->unk0A)
{
sub_8104CAC(4);
- eSlotMachine->state = 18;
+ sSlotMachine->state = 18;
}
}
}
@@ -1020,10 +1022,10 @@ static bool8 sub_81022A0(struct Task *task)
{
if (sub_8104E18())
{
- eSlotMachine->state = 19;
- if (eSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
+ sSlotMachine->state = 19;
+ if (sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
{
- eSlotMachine->state = 9;
+ sSlotMachine->state = 9;
}
}
return FALSE;
@@ -1034,7 +1036,7 @@ static bool8 sub_81022CC(struct Task *task)
sub_8103D8C(0);
sub_8103D8C(1);
sub_8103D8C(2);
- eSlotMachine->state = 2;
+ sSlotMachine->state = 2;
return FALSE;
}
@@ -1043,7 +1045,7 @@ static bool8 sub_81022F0(struct Task *task)
if (++task->data[1] > 64)
{
task->data[1] = 0;
- eSlotMachine->state = 19;
+ sSlotMachine->state = 19;
}
return FALSE;
}
@@ -1053,7 +1055,7 @@ static bool8 sub_8102318(struct Task *task)
sub_8101F2C(gOtherText_QuitGamePrompt);
DisplayYesNoMenu(21, 7, 1);
sub_814AB84();
- eSlotMachine->state = 22;
+ sSlotMachine->state = 22;
return FALSE;
}
@@ -1066,13 +1068,13 @@ static bool8 sub_8102344(struct Task *task)
sub_8103D8C(0);
sub_8103D8C(1);
sub_8103D8C(2);
- eSlotMachine->coins += eSlotMachine->bet;
- eSlotMachine->state = 27;
+ sSlotMachine->coins += sSlotMachine->bet;
+ sSlotMachine->state = 27;
}
else if (input == 1 || input == -1)
{
Menu_EraseScreen();
- eSlotMachine->state = 5;
+ sSlotMachine->state = 5;
}
return FALSE;
}
@@ -1080,7 +1082,7 @@ static bool8 sub_8102344(struct Task *task)
static bool8 sub_810239C(struct Task *task)
{
sub_8101F2C(gOtherText_MaxCoins);
- eSlotMachine->state = 24;
+ sSlotMachine->state = 24;
return FALSE;
}
@@ -1089,7 +1091,7 @@ static bool8 sub_81023B8(struct Task *task)
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
Menu_EraseScreen();
- eSlotMachine->state = 5;
+ sSlotMachine->state = 5;
}
return FALSE;
}
@@ -1097,7 +1099,7 @@ static bool8 sub_81023B8(struct Task *task)
static bool8 sub_81023E0(struct Task *task)
{
sub_8101F2C(gOtherText_OutOfCoins);
- eSlotMachine->state = 26;
+ sSlotMachine->state = 26;
return FALSE;
}
@@ -1106,7 +1108,7 @@ static bool8 sub_81023FC(struct Task *task)
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
Menu_EraseScreen();
- eSlotMachine->state = 27;
+ sSlotMachine->state = 27;
}
return FALSE;
}
@@ -1115,12 +1117,12 @@ static bool8 sub_8102424(struct Task *task)
{
#if DEBUG
if (unk_debug_bss_1_1 == 0)
- gSaveBlock1.coins = eSlotMachine->coins;
+ gSaveBlock1.coins = sSlotMachine->coins;
#else
- gSaveBlock1.coins = eSlotMachine->coins;
+ gSaveBlock1.coins = sSlotMachine->coins;
#endif
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
- eSlotMachine->state++;
+ sSlotMachine->state++;
return FALSE;
}
@@ -1128,7 +1130,7 @@ static bool8 sub_8102460(struct Task *task)
{
if (!gPaletteFade.active)
{
- SetMainCallback2(eSlotMachine->prevMainCb);
+ SetMainCallback2(sSlotMachine->prevMainCb);
}
return FALSE;
}
@@ -1138,7 +1140,7 @@ static bool8 sub_8102460(struct Task *task)
static bool8 debug_sub_8116E74(struct Task *task)
{
if (debug_sub_811B634() != 0)
- eSlotMachine->state = 5;
+ sSlotMachine->state = 5;
return FALSE;
}
@@ -1148,48 +1150,48 @@ static void sub_8102484(void)
{
u8 r3;
- if (eSlotMachine->unk0A == 0)
+ if (sSlotMachine->unk0A == 0)
{
#if DEBUG
if (unk_debug_bss_1_1 != 0 && unk_debug_bss_1_2 != 0)
{
- eSlotMachine->unk04 = unk_debug_bss_1_3;
+ sSlotMachine->unk04 = unk_debug_bss_1_3;
unk_debug_bss_1_2 = 0;
unk_debug_bss_1_3 = 0;
- if (eSlotMachine->unk04 & 0x80)
- debug_sub_811B5B4(&eSlotMachine->unk88, 1);
- if (eSlotMachine->unk04 & 0x40)
- debug_sub_811B5B4(&eSlotMachine->unk84, 1);
- if (eSlotMachine->unk04 & 0x20)
- debug_sub_811B5B4(&eSlotMachine->unk8C, 1);
- if (eSlotMachine->unk04 & 0x10)
- debug_sub_811B5B4(&eSlotMachine->unk80, 1);
- if (eSlotMachine->unk04 & 8)
- debug_sub_811B5B4(&eSlotMachine->unk7C, 1);
- if (eSlotMachine->unk04 & 4)
- debug_sub_811B5B4(&eSlotMachine->unk78, 1);
- if (eSlotMachine->unk04 & 1)
- debug_sub_811B5B4(&eSlotMachine->unk74, 1);
- if (eSlotMachine->unk04 & 2)
- debug_sub_811B5B4(&eSlotMachine->unk70, 1);
+ if (sSlotMachine->unk04 & 0x80)
+ debug_sub_811B5B4(&sSlotMachine->unk88, 1);
+ if (sSlotMachine->unk04 & 0x40)
+ debug_sub_811B5B4(&sSlotMachine->unk84, 1);
+ if (sSlotMachine->unk04 & 0x20)
+ debug_sub_811B5B4(&sSlotMachine->unk8C, 1);
+ if (sSlotMachine->unk04 & 0x10)
+ debug_sub_811B5B4(&sSlotMachine->unk80, 1);
+ if (sSlotMachine->unk04 & 8)
+ debug_sub_811B5B4(&sSlotMachine->unk7C, 1);
+ if (sSlotMachine->unk04 & 4)
+ debug_sub_811B5B4(&sSlotMachine->unk78, 1);
+ if (sSlotMachine->unk04 & 1)
+ debug_sub_811B5B4(&sSlotMachine->unk74, 1);
+ if (sSlotMachine->unk04 & 2)
+ debug_sub_811B5B4(&sSlotMachine->unk70, 1);
return;
}
#endif
- if (!(eSlotMachine->unk04 & 0xc0))
+ if (!(sSlotMachine->unk04 & 0xc0))
{
if (sub_8102540())
{
r3 = sub_8102578();
if (r3 != 3)
{
- eSlotMachine->unk04 |= gUnknown_083ECE42[r3];
+ sSlotMachine->unk04 |= gUnknown_083ECE42[r3];
#if DEBUG
- if (eSlotMachine->unk04 & 0x80)
- debug_sub_811B5B4(&eSlotMachine->unk88, 1);
- if (eSlotMachine->unk04 & 0x40)
- debug_sub_811B5B4(&eSlotMachine->unk84, 1);
- if (eSlotMachine->unk04 & 0x20)
- debug_sub_811B5B4(&eSlotMachine->unk8C, 1);
+ if (sSlotMachine->unk04 & 0x80)
+ debug_sub_811B5B4(&sSlotMachine->unk88, 1);
+ if (sSlotMachine->unk04 & 0x40)
+ debug_sub_811B5B4(&sSlotMachine->unk84, 1);
+ if (sSlotMachine->unk04 & 0x20)
+ debug_sub_811B5B4(&sSlotMachine->unk8C, 1);
#endif
if (r3 != 1)
{
@@ -1200,18 +1202,18 @@ static void sub_8102484(void)
r3 = sub_81025BC();
if (r3 != 5)
{
- eSlotMachine->unk04 |= gUnknown_083ECE48[r3];
+ sSlotMachine->unk04 |= gUnknown_083ECE48[r3];
#if DEBUG
- if (eSlotMachine->unk04 & 0x10)
- debug_sub_811B5B4(&eSlotMachine->unk80, 1);
- if (eSlotMachine->unk04 & 8)
- debug_sub_811B5B4(&eSlotMachine->unk7C, 1);
- if (eSlotMachine->unk04 & 4)
- debug_sub_811B5B4(&eSlotMachine->unk78, 1);
- if (eSlotMachine->unk04 & 1)
- debug_sub_811B5B4(&eSlotMachine->unk74, 1);
- if (eSlotMachine->unk04 & 2)
- debug_sub_811B5B4(&eSlotMachine->unk70, 1);
+ if (sSlotMachine->unk04 & 0x10)
+ debug_sub_811B5B4(&sSlotMachine->unk80, 1);
+ if (sSlotMachine->unk04 & 8)
+ debug_sub_811B5B4(&sSlotMachine->unk7C, 1);
+ if (sSlotMachine->unk04 & 4)
+ debug_sub_811B5B4(&sSlotMachine->unk78, 1);
+ if (sSlotMachine->unk04 & 1)
+ debug_sub_811B5B4(&sSlotMachine->unk74, 1);
+ if (sSlotMachine->unk04 & 2)
+ debug_sub_811B5B4(&sSlotMachine->unk70, 1);
#endif
}
}
@@ -1223,14 +1225,14 @@ static void sub_8102484(void)
{
u8 r3;
- if (eSlotMachine->unk0A == 0 && !(eSlotMachine->unk04 & 0xc0))
+ if (sSlotMachine->unk0A == 0 && !(sSlotMachine->unk04 & 0xc0))
{
if (sub_8102540())
{
r3 = sub_8102578();
if (r3 != 3)
{
- eSlotMachine->unk04 |= gUnknown_083ECE42[r3];
+ sSlotMachine->unk04 |= gUnknown_083ECE42[r3];
if (r3 != 1)
{
return;
@@ -1240,7 +1242,7 @@ static void sub_8102484(void)
r3 = sub_81025BC();
if (r3 != 5)
{
- eSlotMachine->unk04 |= gUnknown_083ECE48[r3];
+ sSlotMachine->unk04 |= gUnknown_083ECE48[r3];
}
}
}
@@ -1248,9 +1250,9 @@ static void sub_8102484(void)
static void sub_81024F0(void)
{
- eSlotMachine->unk06 = 0;
- if (eSlotMachine->unk04)
- eSlotMachine->unk06 = 1;
+ sSlotMachine->unk06 = 0;
+ if (sSlotMachine->unk04)
+ sSlotMachine->unk06 = 1;
}
static u8 sub_810250C(u8 a0)
@@ -1269,7 +1271,7 @@ static u8 sub_810250C(u8 a0)
static bool8 sub_8102540(void)
{
u8 rval = Random();
- if (gUnknown_083ECD04[eSlotMachine->unk01][eSlotMachine->bet - 1] > rval)
+ if (gUnknown_083ECD04[sSlotMachine->unk01][sSlotMachine->bet - 1] > rval)
return TRUE;
return FALSE;
}
@@ -1283,7 +1285,7 @@ static u8 sub_8102578(void)
for (i = 0; i < 3; i++)
{
s16 rval = Random() & 0xff;
- s16 value = gUnknown_083ECD16[i][eSlotMachine->unk01];
+ s16 value = gUnknown_083ECD16[i][sSlotMachine->unk01];
if (value > rval)
break;
}
@@ -1299,14 +1301,14 @@ static u8 sub_81025BC(void)
for (i = 0; i < 5; i++)
{
s16 rval = Random() & 0xff;
- s16 r3 = gUnknown_083ECD28[i][eSlotMachine->unk01];
- if (i == 0 && eSlotMachine->unk03 == 1)
+ s16 r3 = gUnknown_083ECD28[i][sSlotMachine->unk01];
+ if (i == 0 && sSlotMachine->unk03 == 1)
{
r3 += 10;
if (r3 > 0x100)
r3 = 0x100;
}
- else if (i == 4 && eSlotMachine->unk03 == 1)
+ else if (i == 4 && sSlotMachine->unk03 == 1)
{
r3 -= 10;
if (r3 < 0)
@@ -1323,10 +1325,10 @@ static const u8 gUnknown_083ECDAC[][17];
static u8 sub_810264C(u8 a0)
{
- if (eSlotMachine->unk03 == 0)
- return gUnknown_083ECD46[a0][eSlotMachine->pikaPower];
+ if (sSlotMachine->unk03 == 0)
+ return gUnknown_083ECD46[a0][sSlotMachine->pikaPower];
else
- return gUnknown_083ECDAC[a0][eSlotMachine->pikaPower];
+ return gUnknown_083ECDAC[a0][sSlotMachine->pikaPower];
}
static void sub_8102680(void)
@@ -1334,7 +1336,7 @@ static void sub_8102680(void)
u8 rval;
s16 i;
- eSlotMachine->unk05 = 0;
+ sSlotMachine->unk05 = 0;
rval = Random();
if (rval < sub_810264C(0))
return;
@@ -1344,7 +1346,7 @@ static void sub_8102680(void)
if (rval < sub_810264C(i))
break;
}
- eSlotMachine->unk05 = i;
+ sSlotMachine->unk05 = i;
}
static const u16 gUnknown_083ECE12[];
@@ -1366,20 +1368,20 @@ static u16 dp15_jump_random_unknown(void)
u8 r4 = 0;
u8 rval;
u8 value;
- if (eSlotMachine->unk10 >= 300)
+ if (sSlotMachine->unk10 >= 300)
r4 = 4;
- else if (eSlotMachine->unk10 >= 250)
+ else if (sSlotMachine->unk10 >= 250)
r4 = 3;
- else if (eSlotMachine->unk10 >= 200)
+ else if (sSlotMachine->unk10 >= 200)
r4 = 2;
- else if (eSlotMachine->unk10 >= 150)
+ else if (sSlotMachine->unk10 >= 150)
r4 = 1;
rval = Random() % 100;
value = gUnknown_083ECE1C[r4][0];
if (rval < value)
return 4;
rval = Random() % 100;
- value = gUnknown_083ECE1C[r4][1] + gUnknown_083ECE30[eSlotMachine->unk0B];
+ value = gUnknown_083ECE1C[r4][1] + gUnknown_083ECE30[sSlotMachine->unk0B];
if (rval < value)
return 2;
return 8;
@@ -1387,11 +1389,11 @@ static u16 dp15_jump_random_unknown(void)
static void CheckMatch(void)
{
- eSlotMachine->matchedSymbols = 0;
+ sSlotMachine->matchedSymbols = 0;
CheckMatch_CenterRow();
- if (eSlotMachine->bet > 1)
+ if (sSlotMachine->bet > 1)
CheckMatch_TopAndBottom();
- if (eSlotMachine->bet > 2)
+ if (sSlotMachine->bet > 2)
CheckMatch_Diagonals();
}
@@ -1408,8 +1410,8 @@ static void CheckMatch_CenterRow(void)
match = GetMatchFromSymbolsInRow(c1, c2, c3);
if (match != SLOT_MACHINE_MATCHED_NONE)
{
- eSlotMachine->payout += sSlotPayouts[match];
- eSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
+ sSlotMachine->payout += sSlotPayouts[match];
+ sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
sub_8103E04(0);
}
}
@@ -1426,8 +1428,8 @@ static void CheckMatch_TopAndBottom(void)
{
if (match == SLOT_MACHINE_MATCHED_1CHERRY)
match = SLOT_MACHINE_MATCHED_2CHERRY;
- eSlotMachine->payout += sSlotPayouts[match];
- eSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
+ sSlotMachine->payout += sSlotPayouts[match];
+ sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
sub_8103E04(1);
}
c1 = GetTagOfReelSymbolOnScreenAtPos(0, 3);
@@ -1438,8 +1440,8 @@ static void CheckMatch_TopAndBottom(void)
{
if (match == SLOT_MACHINE_MATCHED_1CHERRY)
match = SLOT_MACHINE_MATCHED_2CHERRY;
- eSlotMachine->payout += sSlotPayouts[match];
- eSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
+ sSlotMachine->payout += sSlotPayouts[match];
+ sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
sub_8103E04(2);
}
}
@@ -1456,8 +1458,8 @@ static void CheckMatch_Diagonals(void)
{
if (match != SLOT_MACHINE_MATCHED_1CHERRY)
{
- eSlotMachine->payout += sSlotPayouts[match];
- eSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
+ sSlotMachine->payout += sSlotPayouts[match];
+ sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
}
sub_8103E04(3);
}
@@ -1469,8 +1471,8 @@ static void CheckMatch_Diagonals(void)
{
if (match != SLOT_MACHINE_MATCHED_1CHERRY)
{
- eSlotMachine->payout += sSlotPayouts[match];
- eSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
+ sSlotMachine->payout += sSlotPayouts[match];
+ sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
}
sub_8103E04(4);
}
@@ -1522,7 +1524,7 @@ static bool8 sub_8102A9C(struct Task *task)
if (sub_8103E38())
{
task->data[0]++;
- if (eSlotMachine->payout == 0)
+ if (sSlotMachine->payout == 0)
{
task->data[0] = 2;
return TRUE;
@@ -1537,9 +1539,9 @@ static bool8 sub_8102AD0(struct Task *task)
{
if (IsFanfareTaskInactive())
PlaySE(SE_PIN);
- eSlotMachine->payout--;
- if (eSlotMachine->coins < 9999)
- eSlotMachine->coins++;
+ sSlotMachine->payout--;
+ if (sSlotMachine->coins < 9999)
+ sSlotMachine->coins++;
task->data[1] = 8;
if (gMain.heldKeys & A_BUTTON)
task->data[1] = 4;
@@ -1547,12 +1549,12 @@ static bool8 sub_8102AD0(struct Task *task)
if (IsFanfareTaskInactive() && gMain.newKeys & START_BUTTON)
{
PlaySE(SE_PIN);
- eSlotMachine->coins += eSlotMachine->payout;
- if (eSlotMachine->coins > 9999)
- eSlotMachine->coins = 9999;
- eSlotMachine->payout = 0;
+ sSlotMachine->coins += sSlotMachine->payout;
+ if (sSlotMachine->coins > 9999)
+ sSlotMachine->coins = 9999;
+ sSlotMachine->payout = 0;
}
- if (eSlotMachine->payout == 0)
+ if (sSlotMachine->payout == 0)
task->data[0]++;
return FALSE;
}
@@ -1568,7 +1570,7 @@ static const u8 sReelSymbols[][21];
static u8 GetTagOfReelSymbolOnScreenAtPos(u8 x, s16 y)
{
- s16 offset = (eSlotMachine->reelPositions[x] + y) % 21;
+ s16 offset = (sSlotMachine->reelPositions[x] + y) % 21;
if (offset < 0)
offset += 21;
return sReelSymbols[x][offset];
@@ -1577,7 +1579,7 @@ static u8 GetTagOfReelSymbolOnScreenAtPos(u8 x, s16 y)
static u8 GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(u8 x, s16 y)
{
s16 r6 = 0;
- if ((eSlotMachine->unk1C[x]) % 24)
+ if ((sSlotMachine->unk1C[x]) % 24)
r6 = -1;
return GetTagOfReelSymbolOnScreenAtPos(x, y + r6);
}
@@ -1586,7 +1588,7 @@ static const u8 gUnknown_083ECCF1[];
static u8 sub_8102C48(s16 a0)
{
- s16 r1 = (eSlotMachine->unk16 + a0) % 6;
+ s16 r1 = (sSlotMachine->unk16 + a0) % 6;
if (r1 < 0)
r1 += 6;
return gUnknown_083ECCF1[r1];
@@ -1594,40 +1596,40 @@ static u8 sub_8102C48(s16 a0)
static void sub_8102C84(u8 a0, s16 a1)
{
- eSlotMachine->unk1C[a0] += a1;
- eSlotMachine->unk1C[a0] %= 504;
- eSlotMachine->reelPositions[a0] = 21 - eSlotMachine->unk1C[a0] / 24;
+ sSlotMachine->unk1C[a0] += a1;
+ sSlotMachine->unk1C[a0] %= 504;
+ sSlotMachine->reelPositions[a0] = 21 - sSlotMachine->unk1C[a0] / 24;
}
static s16 sub_8102CCC(u8 a0, s16 a1)
{
- s16 r1 = eSlotMachine->unk1C[a0] % 24;
+ s16 r1 = sSlotMachine->unk1C[a0] % 24;
if (r1 != 0)
{
if (r1 < a1)
a1 = r1;
sub_8102C84(a0, a1);
- r1 = eSlotMachine->unk1C[a0] % 24;
+ r1 = sSlotMachine->unk1C[a0] % 24;
}
return r1;
}
static void sub_8102D28(s16 a0)
{
- eSlotMachine->unk14 += a0;
- eSlotMachine->unk14 %= 120;
- eSlotMachine->unk16 = 6 - eSlotMachine->unk14 / 20;
+ sSlotMachine->unk14 += a0;
+ sSlotMachine->unk14 %= 120;
+ sSlotMachine->unk16 = 6 - sSlotMachine->unk14 / 20;
}
static s16 sub_8102D5C(s16 a0)
{
- s16 r1 = eSlotMachine->unk14 % 20;
+ s16 r1 = sSlotMachine->unk14 % 20;
if (r1 != 0)
{
if (r1 < a0)
a0 = r1;
sub_8102D28(a0);
- r1 = eSlotMachine->unk14 % 20;
+ r1 = sSlotMachine->unk14 % 20;
}
return r1;
}
@@ -1639,25 +1641,25 @@ static void sub_8102DA8(void)
{
u8 taskId = CreateTask(sub_8102E68, 2);
gTasks[taskId].data[15] = i;
- eSlotMachine->reelTasks[i] = taskId;
+ sSlotMachine->reelTasks[i] = taskId;
sub_8102E68(taskId);
}
}
static void sub_8102DEC(u8 a0)
{
- gTasks[eSlotMachine->reelTasks[a0]].data[0] = 1;
- gTasks[eSlotMachine->reelTasks[a0]].data[14] = 1;
+ gTasks[sSlotMachine->reelTasks[a0]].data[0] = 1;
+ gTasks[sSlotMachine->reelTasks[a0]].data[14] = 1;
}
static void sub_8102E1C(u8 a0)
{
- gTasks[eSlotMachine->reelTasks[a0]].data[0] = 2;
+ gTasks[sSlotMachine->reelTasks[a0]].data[0] = 2;
}
static bool8 sub_8102E40(u8 a0)
{
- return gTasks[eSlotMachine->reelTasks[a0]].data[14];
+ return gTasks[sSlotMachine->reelTasks[a0]].data[14];
}
static bool8 (*const gUnknown_083ECB2C[])(struct Task *task) =
@@ -1682,7 +1684,7 @@ static bool8 sub_8102EA0(struct Task *task)
static bool8 sub_8102EA4(struct Task *task)
{
- sub_8102C84(task->data[15], eSlotMachine->unk1A);
+ sub_8102C84(task->data[15], sSlotMachine->unk1A);
return FALSE;
}
@@ -1703,30 +1705,30 @@ static void (*const gUnknown_083ECB4C[])(void) =
static bool8 sub_8102EC0(struct Task *task)
{
task->data[0]++;
- eSlotMachine->unk34[task->data[15]] = 0;
- eSlotMachine->unk2E[task->data[15]] = 0;
- if (eSlotMachine->unk0A == 0 && (eSlotMachine->unk04 == 0 || eSlotMachine->unk06 == 0 || !gUnknown_083ECB40[task->data[15]]()))
+ sSlotMachine->unk34[task->data[15]] = 0;
+ sSlotMachine->unk2E[task->data[15]] = 0;
+ if (sSlotMachine->unk0A == 0 && (sSlotMachine->unk04 == 0 || sSlotMachine->unk06 == 0 || !gUnknown_083ECB40[task->data[15]]()))
{
- eSlotMachine->unk06 = 0;
+ sSlotMachine->unk06 = 0;
gUnknown_083ECB4C[task->data[15]]();
}
- task->data[1] = eSlotMachine->unk2E[task->data[15]];
+ task->data[1] = sSlotMachine->unk2E[task->data[15]];
return TRUE;
}
static bool8 sub_8102F4C(struct Task *task)
{
u16 sp[] = {2, 4, 4, 4, 8};
- s16 r2 = eSlotMachine->unk1C[task->data[15]] % 24;
+ s16 r2 = sSlotMachine->unk1C[task->data[15]] % 24;
if (r2 != 0)
- r2 = sub_8102CCC(task->data[15], eSlotMachine->unk1A);
- else if (eSlotMachine->unk2E[task->data[15]])
+ r2 = sub_8102CCC(task->data[15], sSlotMachine->unk1A);
+ else if (sSlotMachine->unk2E[task->data[15]])
{
- eSlotMachine->unk2E[task->data[15]]--;
- sub_8102C84(task->data[15], eSlotMachine->unk1A);
- r2 = eSlotMachine->unk1C[task->data[15]] % 24;
+ sSlotMachine->unk2E[task->data[15]]--;
+ sub_8102C84(task->data[15], sSlotMachine->unk1A);
+ r2 = sSlotMachine->unk1C[task->data[15]] % 24;
}
- if (r2 == 0 && eSlotMachine->unk2E[task->data[15]] == 0)
+ if (r2 == 0 && sSlotMachine->unk2E[task->data[15]] == 0)
{
task->data[0]++;
task->data[1] = sp[task->data[1]];
@@ -1737,7 +1739,7 @@ static bool8 sub_8102F4C(struct Task *task)
static bool8 sub_8103008(struct Task *task)
{
- eSlotMachine->unk22[task->data[15]] = task->data[1];
+ sSlotMachine->unk22[task->data[15]] = task->data[1];
task->data[1] = -task->data[1];
task->data[2]++;
if ((task->data[2] & 0x3) == 0)
@@ -1746,7 +1748,7 @@ static bool8 sub_8103008(struct Task *task)
{
task->data[0] = 0;
task->data[14] = 0;
- eSlotMachine->unk22[task->data[15]] = 0;
+ sSlotMachine->unk22[task->data[15]] = 0;
}
return FALSE;
}
@@ -1760,14 +1762,14 @@ static bool8 (*const gUnknown_083ECB64[])(u8 a0, u8 a1) =
static bool8 sub_810305C(void)
{
- u8 r3 = sub_810250C(eSlotMachine->unk04);
+ u8 r3 = sub_810250C(sSlotMachine->unk04);
u8 r5 = r3;
- if (eSlotMachine->unk04 & 0xc0)
+ if (sSlotMachine->unk04 & 0xc0)
{
r5 = 0;
r3 = 1;
}
- return gUnknown_083ECB64[eSlotMachine->bet - 1](r5, r3);
+ return gUnknown_083ECB64[sSlotMachine->bet - 1](r5, r3);
}
static bool8 sub_81030A4(s16 y, u8 tag1, u8 tag2)
@@ -1775,7 +1777,7 @@ static bool8 sub_81030A4(s16 y, u8 tag1, u8 tag2)
u8 tag = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, y);
if (tag == tag1 || tag == tag2)
{
- eSlotMachine->unk07 = tag;
+ sSlotMachine->unk07 = tag;
return TRUE;
}
return FALSE;
@@ -1791,7 +1793,7 @@ static bool8 sub_81030E0(s16 y)
static bool8 sub_8103134(void)
{
- if (eSlotMachine->unk04 & 0xc2)
+ if (sSlotMachine->unk04 & 0xc2)
return TRUE;
else
return FALSE;
@@ -1805,8 +1807,8 @@ static bool8 sub_8103154(u8 a0, u8 a1)
{
if (sub_81030A4(2 - i, a0, a1))
{
- eSlotMachine->unk34[0] = 2;
- eSlotMachine->unk2E[0] = i;
+ sSlotMachine->unk34[0] = 2;
+ sSlotMachine->unk2E[0] = i;
return TRUE;
}
}
@@ -1823,8 +1825,8 @@ static bool8 sub_81031B4(u8 tag1, u8 tag2)
{
if (sub_81030A4(i, tag1, tag2))
{
- eSlotMachine->unk34[0] = i;
- eSlotMachine->unk2E[0] = 0;
+ sSlotMachine->unk34[0] = i;
+ sSlotMachine->unk2E[0] = 0;
return TRUE;
}
}
@@ -1838,18 +1840,18 @@ static bool8 sub_81031B4(u8 tag1, u8 tag2)
{
if (i == 1 && (r7 || !sub_81030E0(3)))
{
- eSlotMachine->unk34[0] = 3;
- eSlotMachine->unk2E[0] = 3;
+ sSlotMachine->unk34[0] = 3;
+ sSlotMachine->unk2E[0] = 3;
return TRUE;
}
if (i < 4 && (r7 || !sub_81030E0(i + 1)))
{
- eSlotMachine->unk34[0] = 2;
- eSlotMachine->unk2E[0] = i + 1;
+ sSlotMachine->unk34[0] = 2;
+ sSlotMachine->unk2E[0] = i + 1;
return TRUE;
}
- eSlotMachine->unk34[0] = 1;
- eSlotMachine->unk2E[0] = i;
+ sSlotMachine->unk34[0] = 1;
+ sSlotMachine->unk2E[0] = i;
return TRUE;
}
}
@@ -1866,20 +1868,20 @@ static bool8 (*const gUnknown_083ECB70[])(void) =
static bool8 sub_81032C0(void)
{
- return gUnknown_083ECB70[eSlotMachine->bet - 1]();
+ return gUnknown_083ECB70[sSlotMachine->bet - 1]();
}
static bool8 sub_81032E8(void)
{
s16 i;
- s16 unk34_0 = eSlotMachine->unk34[0];
+ s16 unk34_0 = sSlotMachine->unk34[0];
for (i = 0; i < 5; i++)
{
- if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, unk34_0 - i) == eSlotMachine->unk07)
+ if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, unk34_0 - i) == sSlotMachine->unk07)
{
- eSlotMachine->unk34[1] = unk34_0;
- eSlotMachine->unk2E[1] = i;
+ sSlotMachine->unk34[1] = unk34_0;
+ sSlotMachine->unk2E[1] = i;
return TRUE;
}
}
@@ -1891,28 +1893,28 @@ static bool8 sub_810333C(void)
s16 i;
if (sub_81032E8())
{
- if (eSlotMachine->unk34[0] != 2 && eSlotMachine->unk2E[1] > 1 && eSlotMachine->unk2E[1] != 4)
+ if (sSlotMachine->unk34[0] != 2 && sSlotMachine->unk2E[1] > 1 && sSlotMachine->unk2E[1] != 4)
{
for (i = 0; i < 5; i++)
{
- if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - i) == eSlotMachine->unk07)
+ if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - i) == sSlotMachine->unk07)
{
- eSlotMachine->unk34[1] = 2;
- eSlotMachine->unk2E[1] = i;
+ sSlotMachine->unk34[1] = 2;
+ sSlotMachine->unk2E[1] = i;
break;
}
}
}
return TRUE;
}
- if (eSlotMachine->unk34[0] != 2)
+ if (sSlotMachine->unk34[0] != 2)
{
for (i = 0; i < 5; i++)
{
- if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - i) == eSlotMachine->unk07)
+ if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - i) == sSlotMachine->unk07)
{
- eSlotMachine->unk34[1] = 2;
- eSlotMachine->unk2E[1] = i;
+ sSlotMachine->unk34[1] = 2;
+ sSlotMachine->unk2E[1] = i;
return TRUE;
}
}
@@ -1929,29 +1931,29 @@ static bool8 (*const gUnknown_083ECB7C[])(u8 a0) =
static bool8 sub_81033DC(void)
{
- u8 r3 = eSlotMachine->unk07;
- if (eSlotMachine->unk04 & 0x40)
+ u8 r3 = sSlotMachine->unk07;
+ if (sSlotMachine->unk04 & 0x40)
{
r3 = 0;
- if (eSlotMachine->unk07 == 0)
+ if (sSlotMachine->unk07 == 0)
{
r3 = 1;
}
}
- return gUnknown_083ECB7C[eSlotMachine->bet - 1](r3);
+ return gUnknown_083ECB7C[sSlotMachine->bet - 1](r3);
}
static bool8 sub_810341C(u8 a0)
{
s16 i;
- s16 unk34_1 = eSlotMachine->unk34[1];
+ s16 unk34_1 = sSlotMachine->unk34[1];
for (i = 0; i < 5; i++)
{
if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, unk34_1 - i) == a0)
{
- eSlotMachine->unk34[2] = unk34_1;
- eSlotMachine->unk2E[2] = i;
+ sSlotMachine->unk34[2] = unk34_1;
+ sSlotMachine->unk2E[2] = i;
return TRUE;
}
}
@@ -1962,9 +1964,9 @@ static bool8 sub_810347C(u8 a0)
{
s16 i;
s16 r8;
- if (eSlotMachine->unk34[0] == eSlotMachine->unk34[1])
+ if (sSlotMachine->unk34[0] == sSlotMachine->unk34[1])
return sub_810341C(a0);
- if (eSlotMachine->unk34[0] == 1)
+ if (sSlotMachine->unk34[0] == 1)
r8 = 3;
else
r8 = 1;
@@ -1972,8 +1974,8 @@ static bool8 sub_810347C(u8 a0)
{
if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, r8 - i) == a0)
{
- eSlotMachine->unk2E[2] = i;
- eSlotMachine->unk34[2] = r8;
+ sSlotMachine->unk2E[2] = i;
+ sSlotMachine->unk34[2] = r8;
return TRUE;
}
}
@@ -1986,7 +1988,7 @@ static void sub_81034F4(void)
while (sub_81030E0(i) != 0)
i++;
- eSlotMachine->unk2E[0] = i;
+ sSlotMachine->unk2E[0] = i;
}
static bool8 sub_8103520(u8 *a0)
@@ -2013,14 +2015,14 @@ static void (*const gUnknown_083ECB88[])(void) =
static void sub_8103540(void)
{
- gUnknown_083ECB88[eSlotMachine->bet - 1]();
+ gUnknown_083ECB88[sSlotMachine->bet - 1]();
}
static void sub_8103564(void)
{
- if (eSlotMachine->unk34[0] != 0 && eSlotMachine->unk04 & 0x80)
+ if (sSlotMachine->unk34[0] != 0 && sSlotMachine->unk04 & 0x80)
{
- u8 sp0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 2 - eSlotMachine->unk2E[0]);
+ u8 sp0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 2 - sSlotMachine->unk2E[0]);
if (sub_8103520(&sp0))
{
s16 i;
@@ -2028,8 +2030,8 @@ static void sub_8103564(void)
{
if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - i))
{
- eSlotMachine->unk34[1] = 2;
- eSlotMachine->unk2E[1] = i;
+ sSlotMachine->unk34[1] = 2;
+ sSlotMachine->unk2E[1] = i;
break;
}
}
@@ -2039,18 +2041,18 @@ static void sub_8103564(void)
static void j5_08111E84(void)
{
- if (eSlotMachine->unk34[0] != 0 && eSlotMachine->unk04 & 0x80)
+ if (sSlotMachine->unk34[0] != 0 && sSlotMachine->unk04 & 0x80)
{
- u8 sp0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, eSlotMachine->unk34[0] - eSlotMachine->unk2E[0]);
+ u8 sp0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, sSlotMachine->unk34[0] - sSlotMachine->unk2E[0]);
if (sub_8103520(&sp0))
{
s16 i;
for (i = 0; i < 5; i++)
{
- if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, eSlotMachine->unk34[0] - i))
+ if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, sSlotMachine->unk34[0] - i))
{
- eSlotMachine->unk34[1] = eSlotMachine->unk34[0];
- eSlotMachine->unk2E[1] = i;
+ sSlotMachine->unk34[1] = sSlotMachine->unk34[0];
+ sSlotMachine->unk2E[1] = i;
break;
}
}
@@ -2062,57 +2064,57 @@ static void sub_8103668(void)
{
s16 i;
s16 j;
- if (eSlotMachine->unk34[0] != 0 && eSlotMachine->unk04 & 0x80)
+ if (sSlotMachine->unk34[0] != 0 && sSlotMachine->unk04 & 0x80)
{
- if (eSlotMachine->unk34[0] == 2)
+ if (sSlotMachine->unk34[0] == 2)
{
j5_08111E84();
}
else
{
- u8 sp0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, eSlotMachine->unk34[0] - eSlotMachine->unk2E[0]);
+ u8 sp0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, sSlotMachine->unk34[0] - sSlotMachine->unk2E[0]);
if (sub_8103520(&sp0))
{
j = 2;
- if (eSlotMachine->unk34[0] == 3)
+ if (sSlotMachine->unk34[0] == 3)
j = 3;
for (i = 0; i < 2; i++, j--)
{
if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, j))
{
- eSlotMachine->unk34[1] = j;
- eSlotMachine->unk2E[1] = 0;
+ sSlotMachine->unk34[1] = j;
+ sSlotMachine->unk2E[1] = 0;
return;
}
}
for (j = 1; j < 5; j++)
{
- if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, eSlotMachine->unk34[0] - j))
+ if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, sSlotMachine->unk34[0] - j))
{
- if (eSlotMachine->unk34[0] == 1)
+ if (sSlotMachine->unk34[0] == 1)
{
if (j < 3)
{
- eSlotMachine->unk34[1] = 2;
- eSlotMachine->unk2E[1] = j + 1;
+ sSlotMachine->unk34[1] = 2;
+ sSlotMachine->unk2E[1] = j + 1;
}
else
{
- eSlotMachine->unk34[1] = 1;
- eSlotMachine->unk2E[1] = j;
+ sSlotMachine->unk34[1] = 1;
+ sSlotMachine->unk2E[1] = j;
}
}
else
{
if (j < 3)
{
- eSlotMachine->unk34[1] = 3;
- eSlotMachine->unk2E[1] = j;
+ sSlotMachine->unk34[1] = 3;
+ sSlotMachine->unk2E[1] = j;
}
else
{
- eSlotMachine->unk34[1] = 2;
- eSlotMachine->unk2E[1] = j - 1;
+ sSlotMachine->unk34[1] = 2;
+ sSlotMachine->unk2E[1] = j - 1;
}
}
return;
@@ -2161,14 +2163,14 @@ static void (*const gUnknown_083ECB94[])(void) =
static void sub_810380C(void)
{
- gUnknown_083ECB94[eSlotMachine->bet - 1]();
+ gUnknown_083ECB94[sSlotMachine->bet - 1]();
}
static void sub_8103830(void)
{
s16 i = 0;
- u8 r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 2 - eSlotMachine->unk2E[0]);
- u8 r1 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - eSlotMachine->unk2E[1]);
+ u8 r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 2 - sSlotMachine->unk2E[0]);
+ u8 r1 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - sSlotMachine->unk2E[1]);
if (r5 == r1)
{
while (1)
@@ -2181,13 +2183,13 @@ static void sub_8103830(void)
}
else if (sub_8103764(r5, r1))
{
- if (eSlotMachine->unk04 & 0x80)
+ if (sSlotMachine->unk04 & 0x80)
{
for (i = 0; i < 5; i++)
{
if (r5 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 2 - i))
{
- eSlotMachine->unk2E[2] = i;
+ sSlotMachine->unk2E[2] = i;
return;
}
}
@@ -2200,7 +2202,7 @@ static void sub_8103830(void)
i++;
}
}
- eSlotMachine->unk2E[2] = i;
+ sSlotMachine->unk2E[2] = i;
}
static void sub_8103910(void)
@@ -2211,15 +2213,15 @@ static void sub_8103910(void)
u8 r6;
u8 r4;
- if (eSlotMachine->unk34[1] != 0 && eSlotMachine->unk34[0] == eSlotMachine->unk34[1] && eSlotMachine->unk04 & 0x80)
+ if (sSlotMachine->unk34[1] != 0 && sSlotMachine->unk34[0] == sSlotMachine->unk34[1] && sSlotMachine->unk04 & 0x80)
{
- r7 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, eSlotMachine->unk34[0] - eSlotMachine->unk2E[0]);
- r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, eSlotMachine->unk34[1] - eSlotMachine->unk2E[1]);
+ r7 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, sSlotMachine->unk34[0] - sSlotMachine->unk2E[0]);
+ r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, sSlotMachine->unk34[1] - sSlotMachine->unk2E[1]);
if (sub_8103764(r7, r6))
{
for (i = 0; i < 5; i++)
{
- r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, eSlotMachine->unk34[1] - i);
+ r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, sSlotMachine->unk34[1] - i);
if (r7 == r4)
{
sp0 = i;
@@ -2233,10 +2235,10 @@ static void sub_8103910(void)
s16 r8;
for (i = 1, r8 = 0; i < 4; i++)
{
- r7 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, i - eSlotMachine->unk2E[0]);
- r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, i - eSlotMachine->unk2E[1]);
+ r7 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, i - sSlotMachine->unk2E[0]);
+ r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, i - sSlotMachine->unk2E[1]);
r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, i - sp0);
- if (!sub_81037BC(r7, r6, r4) && (!sub_810378C(r7, r6, r4) || !(eSlotMachine->unk04 & 0x80)))
+ if (!sub_81037BC(r7, r6, r4) && (!sub_810378C(r7, r6, r4) || !(sSlotMachine->unk04 & 0x80)))
{
r8++;
break;
@@ -2246,7 +2248,7 @@ static void sub_8103910(void)
break;
sp0++;
}
- eSlotMachine->unk2E[2] = sp0;
+ sSlotMachine->unk2E[2] = sp0;
}
static void sub_8103A78(void)
@@ -2258,21 +2260,21 @@ static void sub_8103A78(void)
s16 i;
sub_8103910();
- if (eSlotMachine->unk34[1] != 0 && eSlotMachine->unk34[0] != eSlotMachine->unk34[1] && eSlotMachine->unk04 & 0x80)
+ if (sSlotMachine->unk34[1] != 0 && sSlotMachine->unk34[0] != sSlotMachine->unk34[1] && sSlotMachine->unk04 & 0x80)
{
- r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, eSlotMachine->unk34[0] - eSlotMachine->unk2E[0]);
- r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, eSlotMachine->unk34[1] - eSlotMachine->unk2E[1]);
+ r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, sSlotMachine->unk34[0] - sSlotMachine->unk2E[0]);
+ r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, sSlotMachine->unk34[1] - sSlotMachine->unk2E[1]);
if (sub_8103764(r6, r5))
{
r8 = 1;
- if (eSlotMachine->unk34[0] == 1)
+ if (sSlotMachine->unk34[0] == 1)
r8 = 3;
for (i = 0; i < 5; i++)
{
- r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, r8 - (eSlotMachine->unk2E[2] + i));
+ r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, r8 - (sSlotMachine->unk2E[2] + i));
if (r6 == r4)
{
- eSlotMachine->unk2E[2] += i;
+ sSlotMachine->unk2E[2] += i;
break;
}
}
@@ -2280,21 +2282,21 @@ static void sub_8103A78(void)
}
while (1)
{
- r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 1 - eSlotMachine->unk2E[0]);
- r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - eSlotMachine->unk2E[1]);
- r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 3 - eSlotMachine->unk2E[2]);
- if (sub_81037BC(r6, r5, r4) || (sub_810378C(r6, r5, r4) && eSlotMachine->unk04 & 0x80))
+ r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 1 - sSlotMachine->unk2E[0]);
+ r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - sSlotMachine->unk2E[1]);
+ r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 3 - sSlotMachine->unk2E[2]);
+ if (sub_81037BC(r6, r5, r4) || (sub_810378C(r6, r5, r4) && sSlotMachine->unk04 & 0x80))
break;
- eSlotMachine->unk2E[2]++;
+ sSlotMachine->unk2E[2]++;
}
while (1)
{
- r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 3 - eSlotMachine->unk2E[0]);
- r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - eSlotMachine->unk2E[1]);
- r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 1 - eSlotMachine->unk2E[2]);
- if (sub_81037BC(r6, r5, r4) || (sub_810378C(r6, r5, r4) && eSlotMachine->unk04 & 0x80))
+ r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 3 - sSlotMachine->unk2E[0]);
+ r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - sSlotMachine->unk2E[1]);
+ r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 1 - sSlotMachine->unk2E[2]);
+ if (sub_81037BC(r6, r5, r4) || (sub_810378C(r6, r5, r4) && sSlotMachine->unk04 & 0x80))
break;
- eSlotMachine->unk2E[2]++;
+ sSlotMachine->unk2E[2]++;
}
}
@@ -2375,13 +2377,13 @@ static void sub_8103DC8(void)
{
u8 spriteId = CreateInvisibleSprite(sub_8103EE4);
gSprites[spriteId].data[0] = i;
- eSlotMachine->unk44[i] = spriteId;
+ sSlotMachine->unk44[i] = spriteId;
}
}
static void sub_8103E04(u8 a0)
{
- struct Sprite *sprite = gSprites + eSlotMachine->unk44[a0];
+ struct Sprite *sprite = gSprites + sSlotMachine->unk44[a0];
sprite->data[1] = 1;
sprite->data[2] = 4;
sprite->data[3] = 0;
@@ -2395,7 +2397,7 @@ static bool8 sub_8103E38(void)
u8 i;
for (i = 0; i < 5; i++)
{
- struct Sprite *sprite = &gSprites[eSlotMachine->unk44[i]];
+ struct Sprite *sprite = &gSprites[sSlotMachine->unk44[i]];
if (sprite->data[1] && sprite->data[2])
return FALSE;
}
@@ -2407,7 +2409,7 @@ static bool8 sub_8103E7C(void)
u8 i;
for (i = 0; i < 5; i++)
{
- if (!sub_8103EAC(eSlotMachine->unk44[i]))
+ if (!sub_8103EAC(sSlotMachine->unk44[i]))
return FALSE;
}
return TRUE;
@@ -2489,12 +2491,12 @@ static void sub_8103FE8(u8 taskId)
static void sub_8104048(void)
{
- eSlotMachine->unk3E = CreateTask(sub_81040E8, 8);
+ sSlotMachine->unk3E = CreateTask(sub_81040E8, 8);
}
static void sub_8104064(u8 pikaPower)
{
- struct Task *task = gTasks + eSlotMachine->unk3E;
+ struct Task *task = gTasks + sSlotMachine->unk3E;
sub_810421C(task);
task->data[0] = 1;
task->data[1]++;
@@ -2503,7 +2505,7 @@ static void sub_8104064(u8 pikaPower)
static void sub_8104098(void)
{
- struct Task *task = gTasks + eSlotMachine->unk3E;
+ struct Task *task = gTasks + sSlotMachine->unk3E;
sub_810421C(task);
task->data[0] = 3;
task->data[15] = 1;
@@ -2511,7 +2513,7 @@ static void sub_8104098(void)
static bool8 sub_81040C8(void)
{
- return gTasks[eSlotMachine->unk3E].data[15];
+ return gTasks[sSlotMachine->unk3E].data[15];
}
static void (*const gUnknown_083ECBB4[])(struct Task *task) =
@@ -2617,7 +2619,7 @@ static void sub_810423C(u8 pikaPower)
r3 = 2;
vaddr[r2 + 0x40] = gUnknown_083ECBC4[r3][1];
}
- gTasks[eSlotMachine->unk3E].data[1] = pikaPower;
+ gTasks[sSlotMachine->unk3E].data[1] = pikaPower;
}
static void sub_810430C(void)
@@ -2663,9 +2665,9 @@ static void sub_810434C(u8 taskId)
static void sub_810437C(struct Task *task)
{
- eSlotMachine->unk0A = 0;
- eSlotMachine->unk14 = 0;
- eSlotMachine->unk16 = 0;
+ sSlotMachine->unk0A = 0;
+ sSlotMachine->unk14 = 0;
+ sSlotMachine->unk16 = 0;
task->data[0]++;
task->data[1] = 0;
task->data[2] = 30;
@@ -2729,7 +2731,7 @@ static void sub_8104498(struct Task *task)
r5 = 4 - (task->data[4] >> 8);
sub_8105688(sp4[r5]);
sub_81057E8(spC[r5]);
- StartSpriteAnimIfDifferent(gSprites + eSlotMachine->unk3F, sp0[r5]);
+ StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, sp0[r5]);
if (task->data[4] <= 0x100)
{
task->data[0]++;
@@ -2746,7 +2748,7 @@ static void sub_8104548(struct Task *task)
task->data[0]++;
task->data[5] = 0;
sub_81057E8(2);
- StartSpriteAnimIfDifferent(gSprites + eSlotMachine->unk3F, 3);
+ StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, 3);
}
}
@@ -2768,9 +2770,9 @@ static void sub_81045CC(struct Task *task)
if (++task->data[5] >= 40)
{
task->data[5] = 0;
- if (eSlotMachine->unk05)
+ if (sSlotMachine->unk05)
{
- if (eSlotMachine->unk0A <= task->data[6])
+ if (sSlotMachine->unk0A <= task->data[6])
task->data[0]++;
}
else if (task->data[6] > 3)
@@ -2787,19 +2789,19 @@ static void sub_81045CC(struct Task *task)
static void sub_810463C(struct Task *task)
{
- s16 r5 = eSlotMachine->unk14 % 20;
+ s16 r5 = sSlotMachine->unk14 % 20;
if (r5)
{
r5 = sub_8102D5C(task->data[4] >> 8);
task->data[4] = (u8)task->data[4] + 0x40;
}
- else if (sub_8102C48(1) != eSlotMachine->unk05)
+ else if (sub_8102C48(1) != sSlotMachine->unk05)
{
sub_8102D28(task->data[4] >> 8);
- r5 = eSlotMachine->unk14 % 20;
+ r5 = sSlotMachine->unk14 % 20;
task->data[4] = (u8)task->data[4] + 0x40;
}
- if (r5 == 0 && sub_8102C48(1) == eSlotMachine->unk05)
+ if (r5 == 0 && sub_8102C48(1) == sSlotMachine->unk05)
{
task->data[4] = 0;
task->data[0]++;
@@ -2814,21 +2816,21 @@ static void sub_81046C0(struct Task *task)
sub_81056C0();
sub_8105804();
task->data[0]++;
- if(eSlotMachine->unk05 == 0)
+ if(sSlotMachine->unk05 == 0)
{
task->data[4] = 0xa0;
- StartSpriteAnimIfDifferent(gSprites + eSlotMachine->unk3F, 5);
+ StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, 5);
PlayFanfare(MUS_TOO_BAD);
}
else
{
task->data[4] = 0xc0;
- StartSpriteAnimIfDifferent(gSprites + eSlotMachine->unk3F, 4);
- gSprites[eSlotMachine->unk3F].animCmdIndex = 0;
- if (eSlotMachine->pikaPower)
+ StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, 4);
+ gSprites[sSlotMachine->unk3F].animCmdIndex = 0;
+ if (sSlotMachine->pikaPower)
{
sub_8104098();
- eSlotMachine->pikaPower = 0;
+ sSlotMachine->pikaPower = 0;
}
PlayFanfare(MUS_SLOTS_WIN);
}
@@ -2857,16 +2859,16 @@ static void sub_8104794(struct Task *task)
static void sub_81047EC(struct Task *task)
{
- eSlotMachine->unk0B = 0;
- eSlotMachine->unk0A = eSlotMachine->unk05;
+ sSlotMachine->unk0B = 0;
+ sSlotMachine->unk0A = sSlotMachine->unk05;
gSpriteCoordOffsetX = 0;
REG_BG1HOFS = 0;
- eSlotMachine->unk1A = 8;
+ sSlotMachine->unk1A = 8;
sub_810514C();
sub_81054B8();
sub_8105524();
- PlayNewMapMusic(eSlotMachine->backupMapMusic);
- if (eSlotMachine->unk0A == 0)
+ PlayNewMapMusic(sSlotMachine->backupMapMusic);
+ if (sSlotMachine->unk0A == 0)
{
DestroyTask(FindTaskIdByFunc(sub_810434C));
}
@@ -2882,10 +2884,10 @@ static void sub_81047EC(struct Task *task)
static void sub_8104860(struct Task *task)
{
- if (eSlotMachine->unk1A == task->data[1])
+ if (sSlotMachine->unk1A == task->data[1])
task->data[0]++;
- else if (eSlotMachine->unk1C[0] % 24 == 0 && (++task->data[2]& 0x07) == 0)
- eSlotMachine->unk1A >>= 1;
+ else if (sSlotMachine->unk1C[0] % 24 == 0 && (++task->data[2]& 0x07) == 0)
+ sSlotMachine->unk1A >>= 1;
}
static void sub_81048A8(struct Task *task)
@@ -2900,8 +2902,8 @@ static void sub_81048CC(struct Task *task)
sub_81056C0();
sub_8105804();
sub_8105854();
- gSprites[eSlotMachine->unk4E[0]].invisible = TRUE;
- StartSpriteAnimIfDifferent(gSprites + eSlotMachine->unk3F, 5);
+ gSprites[sSlotMachine->unk4E[0]].invisible = TRUE;
+ StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, 5);
task->data[0]++;
task->data[4] = 4;
task->data[5] = 0;
@@ -2924,7 +2926,7 @@ static void sub_8104940(struct Task *task)
sub_81058C4();
sub_8105284();
sub_81059E8();
- gSprites[eSlotMachine->unk4E[0]].invisible = FALSE;
+ gSprites[sSlotMachine->unk4E[0]].invisible = FALSE;
task->data[0]++;
task->data[5] = 0;
}
@@ -2945,7 +2947,7 @@ static void sub_81049F8(struct Task *task)
{
gSpriteCoordOffsetX = 0;
REG_BG1HOFS = 0;
- PlayNewMapMusic(eSlotMachine->backupMapMusic);
+ PlayNewMapMusic(sSlotMachine->backupMapMusic);
sub_810514C();
sub_8105554();
sub_8105524();
@@ -3046,7 +3048,7 @@ static void sub_8104BFC(struct Task *task)
BasicInitMenuWindow(&gWindowTemplate_81E7128);
sub_81064B8();
sub_8104CAC(task->data[1]);
- sub_810423C(eSlotMachine->pikaPower);
+ sub_810423C(sSlotMachine->pikaPower);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0));
task->data[0]++;
}
@@ -3061,7 +3063,7 @@ static void sub_8104C5C(void)
u8 i;
struct Task *task;
i = CreateTask(sub_8104E74, 3);
- eSlotMachine->unk3D = i;
+ sSlotMachine->unk3D = i;
task = gTasks + i;
task->data[1] = -1;
for (i = 4; i < 16; i++)
@@ -3077,7 +3079,7 @@ static void sub_8104CAC(u8 arg0)
sub_8104DA4();
- task = gTasks + eSlotMachine->unk3D;
+ task = gTasks + sSlotMachine->unk3D;
task->data[1] = arg0;
for (i = 0; gUnknown_083ED048[arg0][i].unk00 != 0xFF; i++)
@@ -3100,7 +3102,7 @@ static void sub_8104CAC(u8 arg0)
static void sub_8104D30(u8 a0, SpriteCallback a1, s16 a2, s16 a3, s16 a4)
{
u8 i;
- struct Task *task = gTasks + eSlotMachine->unk3D;
+ struct Task *task = gTasks + sSlotMachine->unk3D;
for (i = 4; i < 16; i++)
{
if (task->data[i] == MAX_SPRITES)
@@ -3116,7 +3118,7 @@ static void (*const gUnknown_083ED064[])(void);
void sub_8104DA4(void)
{
u8 i;
- struct Task *task = gTasks + eSlotMachine->unk3D;
+ struct Task *task = gTasks + sSlotMachine->unk3D;
if ((u16)task->data[1] != 0xFFFF)
gUnknown_083ED064[task->data[1]]();
for (i = 4; i < 16; i++)
@@ -3132,7 +3134,7 @@ void sub_8104DA4(void)
static bool8 sub_8104E18(void)
{
u8 i;
- struct Task *task = gTasks + eSlotMachine->unk3D;
+ struct Task *task = gTasks + sSlotMachine->unk3D;
for (i = 4; i < 16; i++)
{
if (task->data[i] != MAX_SPRITES)
@@ -3180,9 +3182,9 @@ static void sub_8104EA8(void)
static void sub_8104F18(struct Sprite *sprite)
{
- sprite->data[2] = eSlotMachine->unk1C[sprite->data[0]] + sprite->data[1];
+ sprite->data[2] = sSlotMachine->unk1C[sprite->data[0]] + sprite->data[1];
sprite->data[2] %= 120;
- sprite->y = eSlotMachine->unk22[sprite->data[0]] + 28 + sprite->data[2];
+ sprite->y = sSlotMachine->unk22[sprite->data[0]] + 28 + sprite->data[2];
sprite->sheetTileStart = GetSpriteTileStartByTag(GetTagOfReelSymbolOnScreenAtPos(sprite->data[0], sprite->data[2] / 24));
SetSpriteSheetFrameTileNum(sprite);
}
@@ -3212,9 +3214,9 @@ static void sub_8104FF4(s16 x, s16 y, u8 a2, s16 a3)
static void sub_810506C(struct Sprite *sprite)
{
- u16 tag = eSlotMachine->coins;
+ u16 tag = sSlotMachine->coins;
if (sprite->data[0])
- tag = eSlotMachine->payout;
+ tag = sSlotMachine->payout;
if (sprite->data[3] != tag)
{
sprite->data[3] = tag;
@@ -3243,12 +3245,12 @@ static void sub_8105100(void)
u8 spriteId = CreateSprite(&gSpriteTemplate_83ED45C, 0x118, 0x50, 1);
gSprites[spriteId].oam.priority = 1;
gSprites[spriteId].coordOffsetEnabled = TRUE;
- eSlotMachine->unk3F = spriteId;
+ sSlotMachine->unk3F = spriteId;
}
static void sub_810514C(void)
{
- DestroySprite(gSprites + eSlotMachine->unk3F);
+ DestroySprite(gSprites + sSlotMachine->unk3F);
}
static void sub_8105170(struct Sprite *sprite)
@@ -3274,14 +3276,14 @@ static void sub_81051C0(void)
sprite->oam.priority = 1;
sprite->coordOffsetEnabled = TRUE;
SetSubspriteTables(sprite, gSubspriteTables_83ED73C);
- eSlotMachine->unk49[0] = spriteId;
+ sSlotMachine->unk49[0] = spriteId;
spriteId = CreateSprite(&gSpriteTemplate_83ED48C, 0x170, 0x54, 7);
sprite = &gSprites[spriteId];
sprite->oam.priority = 1;
sprite->coordOffsetEnabled = TRUE;
SetSubspriteTables(sprite, gSubspriteTables_83ED75C);
- eSlotMachine->unk49[1] = spriteId;
+ sSlotMachine->unk49[1] = spriteId;
}
static const struct SpriteTemplate gSpriteTemplate_83ED4A4;
@@ -3294,7 +3296,7 @@ static void sub_8105284(void)
sprite->oam.priority = 1;
sprite->coordOffsetEnabled = TRUE;
SetSubspriteTables(sprite, gSubspriteTables_83ED78C);
- eSlotMachine->unk42 = spriteId;
+ sSlotMachine->unk42 = spriteId;
}
static const struct SpriteTemplate gSpriteTemplate_83ED4BC;
@@ -3310,13 +3312,13 @@ static void sub_81052EC(void)
sprite->oam.priority = 1;
sprite->coordOffsetEnabled = TRUE;
sprite->data[7] = r5;
- eSlotMachine->unk4B[i] = spriteId;
+ sSlotMachine->unk4B[i] = spriteId;
}
}
static void sub_810535C(struct Sprite *sprite)
{
- s16 r0 = (u16)(eSlotMachine->unk14 + sprite->data[7]);
+ s16 r0 = (u16)(sSlotMachine->unk14 + sprite->data[7]);
r0 %= 40;
sprite->y = r0 + 59;
StartSpriteAnimIfDifferent(sprite, sub_8102C48(r0 / 20));
@@ -3332,14 +3334,14 @@ static void sub_81053A0(void)
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = 1;
SetSubspriteTables(sprite, gSubspriteTables_83ED7B4);
- eSlotMachine->unk4E[0] = spriteId;
+ sSlotMachine->unk4E[0] = spriteId;
spriteId = CreateSprite(&gSpriteTemplate_83ED4D4, 0x120, 0x68, 4);
sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = 1;
SetSubspriteTables(sprite, gSubspriteTables_83ED7B4);
- eSlotMachine->unk4E[1] = spriteId;
+ sSlotMachine->unk4E[1] = spriteId;
}
static const struct SpriteTemplate gSpriteTemplate_83ED4EC;
@@ -3352,18 +3354,18 @@ static void sub_810545C(void)
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = 1;
SetSubspriteTables(sprite, gSubspriteTables_83ED7D4);
- eSlotMachine->unk40 = spriteId;
+ sSlotMachine->unk40 = spriteId;
}
static void sub_81054B8(void)
{
u8 i;
- DestroySprite(&gSprites[eSlotMachine->unk40]);
+ DestroySprite(&gSprites[sSlotMachine->unk40]);
for (i = 0; i < 2; i++)
- DestroySprite(&gSprites[eSlotMachine->unk49[i]]);
+ DestroySprite(&gSprites[sSlotMachine->unk49[i]]);
for (i = 0; i < 3; i++)
- DestroySprite(&gSprites[eSlotMachine->unk4B[i]]);
+ DestroySprite(&gSprites[sSlotMachine->unk4B[i]]);
}
static void sub_8105524(void)
@@ -3371,12 +3373,12 @@ static void sub_8105524(void)
u8 i;
for (i = 0; i < 2; i++)
- DestroySprite(&gSprites[eSlotMachine->unk4E[i]]);
+ DestroySprite(&gSprites[sSlotMachine->unk4E[i]]);
}
static void sub_8105554(void)
{
- DestroySprite(&gSprites[eSlotMachine->unk42]);
+ DestroySprite(&gSprites[sSlotMachine->unk42]);
}
static const struct SpriteTemplate gSpriteTemplate_83ED504;
@@ -3387,7 +3389,7 @@ static void sub_8105578(void)
struct Sprite *sprite = &gSprites[spriteId];
sprite->oam.priority = 1;
sprite->hFlip = TRUE;
- eSlotMachine->unk50[0] = spriteId;
+ sSlotMachine->unk50[0] = spriteId;
sprite->data[0] = 8;
sprite->data[1] = -1;
sprite->data[2] = -1;
@@ -3396,7 +3398,7 @@ static void sub_8105578(void)
spriteId = CreateSprite(&gSpriteTemplate_83ED504, 0xb8, 0x20, 5);
sprite = &gSprites[spriteId];
sprite->oam.priority = 1;
- eSlotMachine->unk50[1] = spriteId;
+ sSlotMachine->unk50[1] = spriteId;
sprite->data[1] = 1;
sprite->data[2] = -1;
sprite->data[7] = 0x20;
@@ -3426,8 +3428,8 @@ static void sub_810562C(struct Sprite *sprite)
static void sub_8105688(s16 a0)
{
- gSprites[eSlotMachine->unk50[0]].data[7] = a0;
- gSprites[eSlotMachine->unk50[1]].data[7] = a0;
+ gSprites[sSlotMachine->unk50[0]].data[7] = a0;
+ gSprites[sSlotMachine->unk50[1]].data[7] = a0;
}
static void sub_81056C0(void)
@@ -3435,7 +3437,7 @@ static void sub_81056C0(void)
u8 i;
for (i = 0; i < 2; i++)
- DestroySprite(&gSprites[eSlotMachine->unk50[i]]);
+ DestroySprite(&gSprites[sSlotMachine->unk50[i]]);
}
static const struct SpriteTemplate gSpriteTemplate_83ED51C;
@@ -3448,12 +3450,12 @@ static void sub_81056F0(void)
gSprites[spriteId].data[5] = 0;
gSprites[spriteId].data[6] = 16;
gSprites[spriteId].data[7] = 8;
- eSlotMachine->unk52[0] = spriteId;
+ sSlotMachine->unk52[0] = spriteId;
spriteId = CreateSprite(&gSpriteTemplate_83ED51C, 0x68, 0x50, 3);
gSprites[spriteId].oam.priority = 1;
gSprites[spriteId].hFlip = TRUE;
- eSlotMachine->unk52[1] = spriteId;
+ sSlotMachine->unk52[1] = spriteId;
}
static const u8 gUnknown_083ECC58[2]; // don't remove this until decompiled through gUnknown_083ECCF8
@@ -3472,7 +3474,7 @@ static void sub_8105784(struct Sprite *sprite)
static void sub_81057E8(s16 a0)
{
- gSprites[eSlotMachine->unk52[0]].data[7] = a0;
+ gSprites[sSlotMachine->unk52[0]].data[7] = a0;
}
static void sub_8105804(void)
@@ -3480,7 +3482,7 @@ static void sub_8105804(void)
u8 i;
MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(7) << 4) + 0x103, 0, 0, 0);
for (i = 0; i < 2; i++)
- DestroySprite(&gSprites[eSlotMachine->unk52[i]]);
+ DestroySprite(&gSprites[sSlotMachine->unk52[i]]);
}
static const struct SpriteTemplate gSpriteTemplate_83ED534;
@@ -3489,7 +3491,7 @@ static void sub_8105854(void)
{
u8 spriteId = CreateSprite(&gSpriteTemplate_83ED534, 0xa8, 0x50, 6);
gSprites[spriteId].oam.priority = 1;
- eSlotMachine->unk41 = spriteId;
+ sSlotMachine->unk41 = spriteId;
}
static void sub_8105894(struct Sprite *sprite)
@@ -3499,7 +3501,7 @@ static void sub_8105894(struct Sprite *sprite)
static void sub_81058A0(void)
{
- DestroySprite(&gSprites[eSlotMachine->unk41]);
+ DestroySprite(&gSprites[sSlotMachine->unk41]);
}
static const struct SpriteTemplate gSpriteTemplate_83ED54C;
@@ -3515,7 +3517,7 @@ static void sub_81058C4(void)
sprite->oam.priority = 1;
sprite->coordOffsetEnabled = TRUE;
sprite->data[0] = sp[i];
- eSlotMachine->unk54[i] = spriteId;
+ sSlotMachine->unk54[i] = spriteId;
}
}
@@ -3542,7 +3544,7 @@ static void sub_81059B8(void)
u8 i;
for (i = 0; i < 4; i++)
{
- DestroySprite(&gSprites[eSlotMachine->unk54[i]]);
+ DestroySprite(&gSprites[sSlotMachine->unk54[i]]);
}
}
@@ -3555,7 +3557,7 @@ static void sub_81059E8(void)
sprite->oam.priority = 1;
sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE;
InitSpriteAffineAnim(sprite);
- eSlotMachine->unk43 = spriteId;
+ sSlotMachine->unk43 = spriteId;
}
static void sub_8105A38(struct Sprite *sprite)
@@ -3587,12 +3589,12 @@ static void sub_8105A38(struct Sprite *sprite)
u8 sub_8105ACC(void)
{
- return gSprites[eSlotMachine->unk43].data[7];
+ return gSprites[sSlotMachine->unk43].data[7];
}
static void sub_8105AEC(void)
{
- struct Sprite *sprite = &gSprites[eSlotMachine->unk43];
+ struct Sprite *sprite = &gSprites[sSlotMachine->unk43];
FreeOamMatrix(sprite->oam.matrixNum);
DestroySprite(sprite);
}
@@ -3748,7 +3750,7 @@ static void sub_8105E08(struct Sprite *sprite)
switch (sprite->data[0])
{
case 0:
- StartSpriteAnim(sprite, eSlotMachine->unk0A - 1);
+ StartSpriteAnim(sprite, sSlotMachine->unk0A - 1);
sprite->data[0]++;
// fallthrough
case 1:
@@ -3956,9 +3958,9 @@ static void sub_8106230(struct Sprite *sprite)
switch (sprite->data[0])
{
case 0:
- eSlotMachine->winIn = 0x2f;
- eSlotMachine->winOut = 0x3f;
- eSlotMachine->win0v = 0x2088;
+ sSlotMachine->winIn = 0x2f;
+ sSlotMachine->winOut = 0x3f;
+ sSlotMachine->win0v = 0x2088;
sprite->invisible = TRUE;
sprite->data[0]++;
// fallthrough
@@ -3970,20 +3972,20 @@ static void sub_8106230(struct Sprite *sprite)
sprite->data[2] = 0xd0;
if (sprite->data[3] < 0xd0)
sprite->data[3] = 0xd0;
- eSlotMachine->win0h = (sprite->data[2] << 8) | sprite->data[3];
+ sSlotMachine->win0h = (sprite->data[2] << 8) | sprite->data[3];
if (sprite->data[1] > 0x33)
{
sprite->data[0]++;
- eSlotMachine->winIn = 0x3f;
+ sSlotMachine->winIn = 0x3f;
}
break;
case 2:
- if (eSlotMachine->bet == 0)
+ if (sSlotMachine->bet == 0)
break;
sub_8104D30(5, SpriteCallbackDummy, 0xd0, 0x74, 0);
- eSlotMachine->win0h = 0xc0e0;
- eSlotMachine->win0v = 0x6880;
- eSlotMachine->winIn = 0x2f;
+ sSlotMachine->win0h = 0xc0e0;
+ sSlotMachine->win0v = 0x6880;
+ sSlotMachine->winIn = 0x2f;
sprite->data[0]++;
sprite->data[1] = 0;
// fallthrough
@@ -3995,11 +3997,11 @@ static void sub_8106230(struct Sprite *sprite)
sprite->data[2] = 0xd0;
if (sprite->data[3] < 0xd0)
sprite->data[3] = 0xd0;
- eSlotMachine->win0h = (sprite->data[2] << 8) | sprite->data[3];
+ sSlotMachine->win0h = (sprite->data[2] << 8) | sprite->data[3];
if (sprite->data[1] > 0x0f)
{
sprite->data[0]++;
- eSlotMachine->winIn = 0x3f;
+ sSlotMachine->winIn = 0x3f;
}
break;
}
@@ -4023,10 +4025,10 @@ static void sub_8106370(void)
static void sub_810639C(void)
{
- eSlotMachine->win0h = 0xf0;
- eSlotMachine->win0v = 0xa0;
- eSlotMachine->winIn = 0x3f;
- eSlotMachine->winOut = 0x3f;
+ sSlotMachine->win0h = 0xf0;
+ sSlotMachine->win0v = 0xa0;
+ sSlotMachine->winIn = 0x3f;
+ sSlotMachine->winOut = 0x3f;
}
static const u8 sReelTimeGfx[];
@@ -5612,7 +5614,7 @@ static void debug_sub_811B2E8(void)
{
u8 text[2];
- ConvertIntToDecimalStringN(text, eSlotMachine->unk01 + 1, 2, 1);
+ ConvertIntToDecimalStringN(text, sSlotMachine->unk01 + 1, 2, 1);
Menu_PrintText(text, 6, 1);
}
@@ -5664,7 +5666,7 @@ void debug_sub_811B310(void)
Menu_PrintText(Str_841B23B, 15, 13);
Menu_PrintText(Str_841B23F, 15, 15);
Menu_PrintText(Str_841B243, 15, 17);
- if (eSlotMachine->unk03 == 0)
+ if (sSlotMachine->unk03 == 0)
Menu_PrintText(Str_841B246, 10, 9);
else
Menu_PrintText(Str_841B249, 10, 9);
@@ -5673,23 +5675,23 @@ void debug_sub_811B310(void)
ConvertIntToDecimalStringN(text, n, 2, 4); \
Menu_PrintText(text, x, y);
- PRINT_NUMBER(eSlotMachine->unk68, 10, 3);
- PRINT_NUMBER(eSlotMachine->unk6C, 10, 5);
- PRINT_NUMBER(eSlotMachine->unk10, 10, 7);
+ PRINT_NUMBER(sSlotMachine->unk68, 10, 3);
+ PRINT_NUMBER(sSlotMachine->unk6C, 10, 5);
+ PRINT_NUMBER(sSlotMachine->unk10, 10, 7);
#if DEBUG_FIX
#define OFFSET 24 // wider window
#else
#define OFFSET 20
#endif
- PRINT_NUMBER(eSlotMachine->unk70, OFFSET, 3);
- PRINT_NUMBER(eSlotMachine->unk74, OFFSET, 5);
- PRINT_NUMBER(eSlotMachine->unk78, OFFSET, 7);
- PRINT_NUMBER(eSlotMachine->unk7C, OFFSET, 9);
- PRINT_NUMBER(eSlotMachine->unk80, OFFSET, 11);
- PRINT_NUMBER(eSlotMachine->unk84, OFFSET, 13);
- PRINT_NUMBER(eSlotMachine->unk88, OFFSET, 15);
- PRINT_NUMBER(eSlotMachine->unk8C, OFFSET, 17);
+ PRINT_NUMBER(sSlotMachine->unk70, OFFSET, 3);
+ PRINT_NUMBER(sSlotMachine->unk74, OFFSET, 5);
+ PRINT_NUMBER(sSlotMachine->unk78, OFFSET, 7);
+ PRINT_NUMBER(sSlotMachine->unk7C, OFFSET, 9);
+ PRINT_NUMBER(sSlotMachine->unk80, OFFSET, 11);
+ PRINT_NUMBER(sSlotMachine->unk84, OFFSET, 13);
+ PRINT_NUMBER(sSlotMachine->unk88, OFFSET, 15);
+ PRINT_NUMBER(sSlotMachine->unk8C, OFFSET, 17);
#undef OFFSET
#undef PRINT_NUMBER
@@ -5739,17 +5741,17 @@ static void debug_sub_811B5D0(void)
unk_debug_bss_1_2 = 0;
unk_debug_bss_1_3 = 0;
unk_debug_bss_1_4 = 0;
- eSlotMachine->unk68 = 0;
- eSlotMachine->unk6C = 0;
- eSlotMachine->unk70 = 0;
- eSlotMachine->unk74 = 0;
- eSlotMachine->unk78 = 0;
- eSlotMachine->unk7C = 0;
- eSlotMachine->unk80 = 0;
- eSlotMachine->unk84 = 0;
- eSlotMachine->unk88 = 0;
- eSlotMachine->unk8C = 0;
- eSlotMachine->unk90 = 0;
+ sSlotMachine->unk68 = 0;
+ sSlotMachine->unk6C = 0;
+ sSlotMachine->unk70 = 0;
+ sSlotMachine->unk74 = 0;
+ sSlotMachine->unk78 = 0;
+ sSlotMachine->unk7C = 0;
+ sSlotMachine->unk80 = 0;
+ sSlotMachine->unk84 = 0;
+ sSlotMachine->unk88 = 0;
+ sSlotMachine->unk8C = 0;
+ sSlotMachine->unk90 = 0;
}
static void debug_sub_811B620(void)
@@ -5803,17 +5805,17 @@ static void debug_sub_811B654(u8 taskId)
}
if (gMain.newKeys & 0x20)
{
- eSlotMachine->unk01--;
- if ((s8)eSlotMachine->unk01 < 0) // Why? It's unsigned
- eSlotMachine->unk01 = 5;
+ sSlotMachine->unk01--;
+ if ((s8)sSlotMachine->unk01 < 0) // Why? It's unsigned
+ sSlotMachine->unk01 = 5;
debug_sub_811B2E8();
break;
}
if (gMain.newKeys & 0x10)
{
- eSlotMachine->unk01++;
- if (eSlotMachine->unk01 > 5)
- eSlotMachine->unk01 = 0;
+ sSlotMachine->unk01++;
+ if (sSlotMachine->unk01 > 5)
+ sSlotMachine->unk01 = 0;
debug_sub_811B2E8();
break;
}
@@ -5859,30 +5861,30 @@ static void debug_sub_811B654(u8 taskId)
case 3:
if (gMain.newAndRepeatedKeys & 0x80)
{
- eSlotMachine->coins += 100;
- if (eSlotMachine->coins > 9999)
- eSlotMachine->coins = 9999;
+ sSlotMachine->coins += 100;
+ if (sSlotMachine->coins > 9999)
+ sSlotMachine->coins = 9999;
break;
}
if (gMain.newAndRepeatedKeys & 0x40)
{
- eSlotMachine->coins -= 100;
- if (eSlotMachine->coins <= 0)
- eSlotMachine->coins = 9999;
+ sSlotMachine->coins -= 100;
+ if (sSlotMachine->coins <= 0)
+ sSlotMachine->coins = 9999;
break;
}
if (gMain.newAndRepeatedKeys & 0x20)
{
- eSlotMachine->coins -= 1000;
- if (eSlotMachine->coins <= 0)
- eSlotMachine->coins = 9999;
+ sSlotMachine->coins -= 1000;
+ if (sSlotMachine->coins <= 0)
+ sSlotMachine->coins = 9999;
break;
}
if (gMain.newAndRepeatedKeys & 0x10)
{
- eSlotMachine->coins += 1000;
- if (eSlotMachine->coins > 9999)
- eSlotMachine->coins = 9999;
+ sSlotMachine->coins += 1000;
+ if (sSlotMachine->coins > 9999)
+ sSlotMachine->coins = 9999;
break;
}
if (gMain.newKeys & B_BUTTON)
@@ -5901,31 +5903,31 @@ static const u8 Str_841B2E4[] = DTR("·ボーナスこやくの エラーが
static void debug_sub_811B894(void)
{
- if (eSlotMachine->matchedSymbols & 0x180)
+ if (sSlotMachine->matchedSymbols & 0x180)
{
- eSlotMachine->unk90++;
- if (eSlotMachine->unk90 > 9999)
- eSlotMachine->unk90 = 9999;
- if (eSlotMachine->unk90 != eSlotMachine->unk88)
+ sSlotMachine->unk90++;
+ if (sSlotMachine->unk90 > 9999)
+ sSlotMachine->unk90 = 9999;
+ if (sSlotMachine->unk90 != sSlotMachine->unk88)
{
Menu_PrintText(Str_841B2B0, 4, 15);
unk_debug_bss_1_4 = 0;
}
- if (!(eSlotMachine->unk04 & 0x80))
+ if (!(sSlotMachine->unk04 & 0x80))
{
Menu_PrintText(Str_841B2D3, 4, 17);
unk_debug_bss_1_4 = 0;
}
}
- else if (eSlotMachine->matchedSymbols != 0)
+ else if (sSlotMachine->matchedSymbols != 0)
{
- if ((eSlotMachine->unk04 & 0x80) && !(eSlotMachine->matchedSymbols & 3))
+ if ((sSlotMachine->unk04 & 0x80) && !(sSlotMachine->matchedSymbols & 3))
{
Menu_PrintText(Str_841B2E4, 4, 2);
unk_debug_bss_1_4 = 0;
}
}
- if (eSlotMachine->matchedSymbols == 0 && eSlotMachine->bet == 3 && !(eSlotMachine->unk04 & 0x80))
+ if (sSlotMachine->matchedSymbols == 0 && sSlotMachine->bet == 3 && !(sSlotMachine->unk04 & 0x80))
{
u8 sym_0_1 = GetTagOfReelSymbolOnScreenAtPos(0, 1);
u8 sym_0_2 = GetTagOfReelSymbolOnScreenAtPos(0, 2);