document slot machine

This commit is contained in:
hondew 2019-02-07 11:24:09 -05:00 committed by huderlem
parent baf95a8e7a
commit 5c8cc5225f
8 changed files with 1576 additions and 1470 deletions

View File

@ -771,12 +771,12 @@ gUnknown_083EDD1C:: @ 85A841C
gUnknown_083EDD30:: @ 85A8430 gUnknown_083EDD30:: @ 85A8430
.byte 0x4A, 0x4B, 0x4C, 0x4E, 0x4D .byte 0x4A, 0x4B, 0x4C, 0x4E, 0x4D
gUnknown_083EDD35:: @ 85A8435 gBettingTilesId:: @ 85A8435
.byte 0, 0 .byte 0, 0
.byte 1, 2 .byte 1, 2
.byte 3, 4 .byte 3, 4
gUnknown_083EDD3B:: @ 85A843B gNumberBettingTiles:: @ 85A843B
.byte 1, 2, 2 .byte 1, 2, 2
gUnknown_085A843E:: @ 85A843E gUnknown_085A843E:: @ 85A843E

View File

@ -1,6 +1,9 @@
#ifndef GUARD_SLOT_MACHINE_H #ifndef GUARD_SLOT_MACHINE_H
#define GUARD_SLOT_MACHINE_H #define GUARD_SLOT_MACHINE_H
#define REEL_NUM_TAGS 21
void PlaySlotMachine(u8, void (callback)(void)); void PlaySlotMachine(u8, void (callback)(void));
#endif // GUARD_SLOT_MACHINE_H #endif // GUARD_SLOT_MACHINE_H

View File

@ -1,6 +1,9 @@
#ifndef GUARD_TASK_H #ifndef GUARD_TASK_H
#define GUARD_TASK_H #define GUARD_TASK_H
#define HEAD_SENTINEL 0xFE
#define TAIL_SENTINEL 0xFF
#define NUM_TASKS 16 #define NUM_TASKS 16
typedef void (*TaskFunc)(u8 taskId); typedef void (*TaskFunc)(u8 taskId);

View File

@ -1,6 +1,9 @@
#ifndef GUARD_TV_H #ifndef GUARD_TV_H
#define GUARD_TV_H #define GUARD_TV_H
#define SLOT_MACHINE 0
#define ROULETTE 1
extern u8 *const gTVStringVarPtrs[3]; extern u8 *const gTVStringVarPtrs[3];
void ClearTVShowData(void); void ClearTVShowData(void);
@ -23,9 +26,9 @@ bool8 GetPriceReduction(u8 newsKind);
void sub_80F14F8(TVShow *shows); void sub_80F14F8(TVShow *shows);
size_t CountDigits(int value); size_t CountDigits(int value);
u8 GetRibbonCount(struct Pokemon *pokemon); u8 GetRibbonCount(struct Pokemon *pokemon);
void sub_80EDE70(u16 nCoinsSpent); void reportPlayedSlotMachine(u16 nCoinsSpent);
void sub_80EDE84(u16 nCoinsSpent); void reportPlayedRoulette(u16 nCoinsSpent);
void sub_80EDD78(u16 nCoinsPaidOut); void reportNewCoinTotal(u16 nCoinsPaidOut);
void sub_80EEA70(void); void sub_80EEA70(void);
void sub_80EDB44(void); void sub_80EDB44(void);
void sub_80EDC60(const u16 *words); void sub_80EDC60(const u16 *words);

View File

@ -996,7 +996,7 @@ static void sub_81405CC(void)
taskId = gUnknown_0203AB88->varA4 = CreateTask(sub_81408A8, 0); taskId = gUnknown_0203AB88->varA4 = CreateTask(sub_81408A8, 0);
gTasks[taskId].data[6] = 6; gTasks[taskId].data[6] = 6;
gTasks[taskId].data[13] = GetCoins(); gTasks[taskId].data[13] = GetCoins();
sub_80EDE84(GetCoins()); reportPlayedRoulette(GetCoins());
gUnknown_0203AB88->varA5 = CreateTask(sub_8140814, 1); gUnknown_0203AB88->varA5 = CreateTask(sub_8140814, 1);
SetMainCallback2(sub_8140238); SetMainCallback2(sub_8140238);
return; return;
@ -1964,7 +1964,7 @@ static void sub_8141DE4(u8 taskId)
gSpecialVar_0x8004 = TRUE; gSpecialVar_0x8004 = TRUE;
else else
gSpecialVar_0x8004 = FALSE; gSpecialVar_0x8004 = FALSE;
sub_80EDD78(GetCoins()); reportNewCoinTotal(GetCoins());
BeginHardwarePaletteFade(0xFF, 0, 0, 16, 0); BeginHardwarePaletteFade(0xFF, 0, 0, 16, 0);
gTasks[taskId].func = sub_8141E7C; gTasks[taskId].func = sub_8141E7C;
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,6 @@
#include "global.h" #include "global.h"
#include "task.h" #include "task.h"
#define HEAD_SENTINEL 0xFE
#define TAIL_SENTINEL 0xFF
struct Task gTasks[NUM_TASKS]; struct Task gTasks[NUM_TASKS];
static void InsertTask(u8 newTaskId); static void InsertTask(u8 newTaskId);

View File

@ -62,7 +62,7 @@ IWRAM_DATA s8 sTVShowMixingCurSlot;
EWRAM_DATA u16 sPokemonAnglerSpecies = 0; EWRAM_DATA u16 sPokemonAnglerSpecies = 0;
EWRAM_DATA u16 sPokemonAnglerAttemptCounters = 0; EWRAM_DATA u16 sPokemonAnglerAttemptCounters = 0;
EWRAM_DATA u16 sFindThatGamerCoinsSpent = 0; EWRAM_DATA u16 sFindThatGamerCoinsSpent = 0;
EWRAM_DATA bool8 sFindThatGamerWhichGame = FALSE; EWRAM_DATA bool8 sFindThatGamerWhichGame = SLOT_MACHINE;
EWRAM_DATA ALIGNED(4) u8 sRecordMixingPartnersWithoutShowsToShare = 0; EWRAM_DATA ALIGNED(4) u8 sRecordMixingPartnersWithoutShowsToShare = 0;
EWRAM_DATA ALIGNED(4) u8 sTVShowState = 0; EWRAM_DATA ALIGNED(4) u8 sTVShowState = 0;
EWRAM_DATA u8 sTVSecretBaseSecretsRandomValues[3] = {}; EWRAM_DATA u8 sTVSecretBaseSecretsRandomValues[3] = {};
@ -2019,7 +2019,7 @@ void sub_80EDCE8(void)
} }
} }
void sub_80EDD78(u16 nCoinsPaidOut) void reportNewCoinTotal(u16 nCoinsPaidOut)
{ {
TVShow *show; TVShow *show;
bool8 flag; bool8 flag;
@ -2031,7 +2031,7 @@ void sub_80EDD78(u16 nCoinsPaidOut)
flag = FALSE; flag = FALSE;
switch (sFindThatGamerWhichGame) switch (sFindThatGamerWhichGame)
{ {
case FALSE: case SLOT_MACHINE:
if (nCoinsPaidOut >= sFindThatGamerCoinsSpent + 200) if (nCoinsPaidOut >= sFindThatGamerCoinsSpent + 200)
{ {
flag = TRUE; flag = TRUE;
@ -2044,7 +2044,7 @@ void sub_80EDD78(u16 nCoinsPaidOut)
break; break;
} }
return; return;
case TRUE: case ROULETTE:
if (nCoinsPaidOut >= sFindThatGamerCoinsSpent + 50) if (nCoinsPaidOut >= sFindThatGamerCoinsSpent + 50)
{ {
flag = TRUE; flag = TRUE;
@ -2072,15 +2072,15 @@ void sub_80EDD78(u16 nCoinsPaidOut)
} }
} }
void sub_80EDE70(u16 nCoinsSpent) void reportPlayedSlotMachine(u16 nCoinsSpent)
{ {
sFindThatGamerWhichGame = FALSE; sFindThatGamerWhichGame = SLOT_MACHINE;
sFindThatGamerCoinsSpent = nCoinsSpent; sFindThatGamerCoinsSpent = nCoinsSpent;
} }
void sub_80EDE84(u16 nCoinsSpent) void reportPlayedRoulette(u16 nCoinsSpent)
{ {
sFindThatGamerWhichGame = TRUE; sFindThatGamerWhichGame = ROULETTE;
sFindThatGamerCoinsSpent = nCoinsSpent; sFindThatGamerCoinsSpent = nCoinsSpent;
} }