From 8fd3100fb491c22bb90d1a86f2f1b0fd3b090ac4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Dec 2017 17:31:27 -0500 Subject: Through sub_8101A28 --- include/ewram.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/ewram.h b/include/ewram.h index eacc02cab..9d3002615 100755 --- a/include/ewram.h +++ b/include/ewram.h @@ -24,7 +24,7 @@ extern u8 gSharedMem[]; #define ewram0arr ((u8 (*)[32])gSharedMem) #define eVoidSharedArr (void *)(ewram_addr + 0x0) #define eVoidSharedArr2 (u32)(ewram_addr) // ew(ram) -#define ewram0_8 ((struct UnkStruct2000000 *)(gSharedMem + 0x0)) +#define eSlotMachine ((struct SlotMachineEwramStruct *)(gSharedMem + 0x0)) #define ewram0_9(i) (u8 *)(ewram_addr + (i * 0x20)) #define ewram0_10 (*(struct UnknownPokenav0*)(gSharedMem + 0)) #define ewram0_11 (*(struct UnknownPokenav0_1*)(gSharedMem + 0)) -- cgit v1.2.3 From f0957176bc96aef3bac673ac520ba55832957ba8 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Dec 2017 17:51:17 -0500 Subject: through sub_8101AE0 --- include/gba/macro.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/gba/macro.h b/include/gba/macro.h index a0edf2a49..945ba4885 100644 --- a/include/gba/macro.h +++ b/include/gba/macro.h @@ -104,25 +104,29 @@ } #define DmaClearLarge(dmaNum, dest, size, block, bit) \ -{ \ - u32 _size = size; \ - while (1) \ - { \ - DmaFill##bit(dmaNum, 0, dest, (block)); \ - dest += (block); \ - _size -= (block); \ - if (_size <= (block)) \ - { \ - DmaFill##bit(dmaNum, 0, dest, _size); \ - break; \ - } \ - } \ +{ \ + void *_dest = dest; \ + u32 _size = size; \ + while (1) \ + { \ + DmaFill##bit(dmaNum, 0, _dest, (block)); \ + _dest += (block); \ + _size -= (block); \ + if (_size <= (block)) \ + { \ + DmaFill##bit(dmaNum, 0, _dest, _size); \ + break; \ + } \ + } \ } #define DmaCopyLarge16(dmaNum, src, dest, size, block) DmaCopyLarge(dmaNum, src, dest, size, block, 16) #define DmaCopyLarge32(dmaNum, src, dest, size, block) DmaCopyLarge(dmaNum, src, dest, size, block, 32) +# define DmaClearLarge16(dmaNum, dest, size, block) DmaClearLarge(dmaNum, dest, size, block, 16) +# define DmaClearLarge32(dmaNum, dest, size, block) DmaClearLarge(dmaNum, dest, size, block, 32) + #define DmaCopyDefvars(dmaNum, src, dest, size, bit) \ { \ const void *_src = src; \ -- cgit v1.2.3 From 9c9c31b1e15014d7cfeb3856717d9b29715d46a5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 20 Dec 2017 20:09:48 -0500 Subject: through sub_8101D8C --- include/slot_machine.h | 31 +++++++++++++++++++++++++++++++ include/sprite.h | 2 ++ 2 files changed, 33 insertions(+) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index c39aa7ca8..60b1f177a 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -1,6 +1,37 @@ #ifndef GUARD_SLOT_MACHINE_H #define GUARD_SLOT_MACHINE_H +struct SlotMachineEwramStruct { + /*0x00*/ u8 unk00; + /*0x01*/ u8 unk01; + /*0x02*/ u8 unk02; + /*0x03*/ u8 unk03; + /*0x04*/ u8 unk04; + /*0x05*/ u8 filler05[3]; + /*0x08*/ u16 unk08; + /*0x0A*/ u8 unk0A; + /*0x0B*/ u8 unk0B; + /*0x0C*/ u16 coins; + /*0x0E*/ u16 unk0E; + /*0x10*/ u16 unk10; + /*0x12*/ u16 unk12; + /*0x14*/ u8 filler14[4]; + /*0x18*/ u16 unk18; + /*0x1A*/ u16 unk1A; + /*0x1C*/ s16 unk1C[3]; + /*0x22*/ u16 unk22[3]; + /*0x28*/ s16 unk28[3]; + /*0x2E*/ u8 filler2E[15]; + /*0x3D*/ u8 unk3D; + /*0x3E*/ u8 filler3E[26]; + /*0x58*/ u16 win0h; + /*0x5a*/ u16 win0v; + /*0x5c*/ u16 winIn; + /*0x5e*/ u16 winOut; + /*0x60*/ u16 backupMapMusic; + /*0x64*/ void *unk64; +}; + void PlaySlotMachine(u8, void *); void sub_8104DA4(void); u8 sub_8105BB4(u8, u8, s16); diff --git a/include/sprite.h b/include/sprite.h index a87260ec0..7b6dd2bef 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -229,6 +229,8 @@ extern const union AffineAnimCmd *const gDummySpriteAffineAnimTable[]; extern s16 gSpriteCoordOffsetX; extern s16 gSpriteCoordOffsetY; +extern u8 gOamLimit; + extern struct Sprite gSprites[]; void ResetSpriteData(void); -- cgit v1.2.3 From 3f6124709ae7843bcc82183c387ce03290c28c36 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 21 Dec 2017 08:42:29 -0500 Subject: through sub_8101E3C --- include/slot_machine.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 60b1f177a..421946103 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -2,7 +2,7 @@ #define GUARD_SLOT_MACHINE_H struct SlotMachineEwramStruct { - /*0x00*/ u8 unk00; + /*0x00*/ u8 state; /*0x01*/ u8 unk01; /*0x02*/ u8 unk02; /*0x03*/ u8 unk03; @@ -11,10 +11,10 @@ struct SlotMachineEwramStruct { /*0x08*/ u16 unk08; /*0x0A*/ u8 unk0A; /*0x0B*/ u8 unk0B; - /*0x0C*/ u16 coins; + /*0x0C*/ s16 coins; /*0x0E*/ u16 unk0E; /*0x10*/ u16 unk10; - /*0x12*/ u16 unk12; + /*0x12*/ s16 bet; /*0x14*/ u8 filler14[4]; /*0x18*/ u16 unk18; /*0x1A*/ u16 unk1A; -- cgit v1.2.3 From 2fe7a0e1542fa24731d233ed3b9e97ce4efa9c31 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 21 Dec 2017 16:32:23 -0500 Subject: through sub_8102090 --- include/slot_machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 421946103..057713a1b 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -16,7 +16,7 @@ struct SlotMachineEwramStruct { /*0x10*/ u16 unk10; /*0x12*/ s16 bet; /*0x14*/ u8 filler14[4]; - /*0x18*/ u16 unk18; + /*0x18*/ s16 unk18; /*0x1A*/ u16 unk1A; /*0x1C*/ s16 unk1C[3]; /*0x22*/ u16 unk22[3]; -- cgit v1.2.3 From 6369dca42b4a0cab379b5ecfdc5b8235e64f79cc Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 21 Dec 2017 18:34:43 -0500 Subject: sub_81020C8 --- include/slot_machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 057713a1b..880fe6f1f 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -13,7 +13,7 @@ struct SlotMachineEwramStruct { /*0x0B*/ u8 unk0B; /*0x0C*/ s16 coins; /*0x0E*/ u16 unk0E; - /*0x10*/ u16 unk10; + /*0x10*/ s16 unk10; /*0x12*/ s16 bet; /*0x14*/ u8 filler14[4]; /*0x18*/ s16 unk18; -- cgit v1.2.3 From e432ffd18d6a1cd5bf1147a42979df3541ea0807 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 21 Dec 2017 19:08:24 -0500 Subject: through sub_8102460 --- include/slot_machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 880fe6f1f..4dde64aa7 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -29,7 +29,7 @@ struct SlotMachineEwramStruct { /*0x5c*/ u16 winIn; /*0x5e*/ u16 winOut; /*0x60*/ u16 backupMapMusic; - /*0x64*/ void *unk64; + /*0x64*/ MainCallback prevMainCb; }; void PlaySlotMachine(u8, void *); -- cgit v1.2.3 From 388a4cc729c84e334819db165eb5aab99233ee9c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 21 Dec 2017 22:35:46 -0500 Subject: sub_8102540 --- include/slot_machine.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 4dde64aa7..0e7efaf29 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -7,7 +7,9 @@ struct SlotMachineEwramStruct { /*0x02*/ u8 unk02; /*0x03*/ u8 unk03; /*0x04*/ u8 unk04; - /*0x05*/ u8 filler05[3]; + /*0x05*/ u8 unk05; + /*0x06*/ u8 unk06; + /*0x07*/ u8 unk07; /*0x08*/ u16 unk08; /*0x0A*/ u8 unk0A; /*0x0B*/ u8 unk0B; -- cgit v1.2.3 From 7d311d0f747dc5c7c194f436d1b90181bee3cc66 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 24 Dec 2017 21:42:08 -0500 Subject: through sub_8102BA4 --- include/slot_machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 0e7efaf29..738866318 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -14,7 +14,7 @@ struct SlotMachineEwramStruct { /*0x0A*/ u8 unk0A; /*0x0B*/ u8 unk0B; /*0x0C*/ s16 coins; - /*0x0E*/ u16 unk0E; + /*0x0E*/ s16 unk0E; /*0x10*/ s16 unk10; /*0x12*/ s16 bet; /*0x14*/ u8 filler14[4]; -- cgit v1.2.3 From a3b25543b3d85a5f88284752367abd6ed713f82b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 26 Dec 2017 20:37:55 -0500 Subject: through sub_8102DEC --- include/slot_machine.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 738866318..c5e14f719 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -17,13 +17,15 @@ struct SlotMachineEwramStruct { /*0x0E*/ s16 unk0E; /*0x10*/ s16 unk10; /*0x12*/ s16 bet; - /*0x14*/ u8 filler14[4]; + /*0x14*/ s16 unk14; + /*0x16*/ s16 unk16; /*0x18*/ s16 unk18; /*0x1A*/ u16 unk1A; /*0x1C*/ s16 unk1C[3]; /*0x22*/ u16 unk22[3]; /*0x28*/ s16 unk28[3]; - /*0x2E*/ u8 filler2E[15]; + /*0x2E*/ u8 filler2E[12]; + /*0x3A*/ u8 unk3A[3]; /*0x3D*/ u8 unk3D; /*0x3E*/ u8 filler3E[26]; /*0x58*/ u16 win0h; -- cgit v1.2.3 From da62907ec54f400646416f38ef02bd7f03d5dbc4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 26 Dec 2017 21:25:47 -0500 Subject: through sub_8103008 --- include/slot_machine.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index c5e14f719..7fc47bb12 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -24,7 +24,8 @@ struct SlotMachineEwramStruct { /*0x1C*/ s16 unk1C[3]; /*0x22*/ u16 unk22[3]; /*0x28*/ s16 unk28[3]; - /*0x2E*/ u8 filler2E[12]; + /*0x2E*/ s16 unk2E[3]; + /*0x34*/ u16 unk34[3]; /*0x3A*/ u8 unk3A[3]; /*0x3D*/ u8 unk3D; /*0x3E*/ u8 filler3E[26]; -- cgit v1.2.3 From 4bd55a4f027410a7caf50933d9b7e1da14ce73da Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 27 Dec 2017 22:01:52 -0500 Subject: through sub_81032E8 --- include/slot_machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 7fc47bb12..203f3bbfc 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -25,7 +25,7 @@ struct SlotMachineEwramStruct { /*0x22*/ u16 unk22[3]; /*0x28*/ s16 unk28[3]; /*0x2E*/ s16 unk2E[3]; - /*0x34*/ u16 unk34[3]; + /*0x34*/ s16 unk34[3]; /*0x3A*/ u8 unk3A[3]; /*0x3D*/ u8 unk3D; /*0x3E*/ u8 filler3E[26]; -- cgit v1.2.3 From d05e72b6b269defef8d9b1bbce42adaf48f4ed8f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 29 Dec 2017 19:35:05 -0500 Subject: through sub_8103E7C --- include/slot_machine.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 203f3bbfc..b04ee6377 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -28,7 +28,9 @@ struct SlotMachineEwramStruct { /*0x34*/ s16 unk34[3]; /*0x3A*/ u8 unk3A[3]; /*0x3D*/ u8 unk3D; - /*0x3E*/ u8 filler3E[26]; + /*0x3E*/ u8 filler3E[6]; + /*0x44*/ u8 unk44[5]; + /*0x49*/ u8 filler49[15]; /*0x58*/ u16 win0h; /*0x5a*/ u16 win0v; /*0x5c*/ u16 winIn; -- cgit v1.2.3 From 17745475ccc35c99ac9b586a03bc39de0936bb2e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 29 Dec 2017 20:03:05 -0500 Subject: through sub_8103FA0 --- include/field_effect.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/field_effect.h b/include/field_effect.h index 9f71efba1..bb859074f 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -252,6 +252,7 @@ void FreeResourcesAndDestroySprite(struct Sprite *sprite); void MultiplyInvertedPaletteRGBComponents(u16, u8, u8, u8); void sub_80878A8(void); void sub_8087BA8(void); +void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b); extern s32 gFieldEffectArguments[8]; -- cgit v1.2.3 From 8eb7f3db6ee630fd801391ac3a3b574abfa7a08d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 29 Dec 2017 21:14:09 -0500 Subject: through sub_8104144 --- include/slot_machine.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index b04ee6377..81263e97e 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -28,7 +28,8 @@ struct SlotMachineEwramStruct { /*0x34*/ s16 unk34[3]; /*0x3A*/ u8 unk3A[3]; /*0x3D*/ u8 unk3D; - /*0x3E*/ u8 filler3E[6]; + /*0x3E*/ u8 unk3E; + /*0x3F*/ u8 filler3F[5]; /*0x44*/ u8 unk44[5]; /*0x49*/ u8 filler49[15]; /*0x58*/ u16 win0h; -- cgit v1.2.3 From 13b2657c49b60dcf5d851a63346801232f9ee832 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 30 Dec 2017 13:31:22 -0500 Subject: through sub_8104498; decompile some data --- include/global.h | 2 +- include/slot_machine.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index a4e71852c..2ea69a1e1 100644 --- a/include/global.h +++ b/include/global.h @@ -5,7 +5,7 @@ #include "config.h" // IDE support -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__CYGWIN__) #define _(x) x #define __(x) x #define INCBIN_U8 {0} diff --git a/include/slot_machine.h b/include/slot_machine.h index 81263e97e..a7a1fed44 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -29,7 +29,8 @@ struct SlotMachineEwramStruct { /*0x3A*/ u8 unk3A[3]; /*0x3D*/ u8 unk3D; /*0x3E*/ u8 unk3E; - /*0x3F*/ u8 filler3F[5]; + /*0x3F*/ u8 unk3F; + /*0x40*/ u8 filler40[4]; /*0x44*/ u8 unk44[5]; /*0x49*/ u8 filler49[15]; /*0x58*/ u16 win0h; -- cgit v1.2.3 From b628d68bae049d3798142acbf4182b121e51a232 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 30 Dec 2017 16:09:07 -0500 Subject: through sub_81049F8 --- include/slot_machine.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index a7a1fed44..004538b14 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -20,7 +20,7 @@ struct SlotMachineEwramStruct { /*0x14*/ s16 unk14; /*0x16*/ s16 unk16; /*0x18*/ s16 unk18; - /*0x1A*/ u16 unk1A; + /*0x1A*/ s16 unk1A; /*0x1C*/ s16 unk1C[3]; /*0x22*/ u16 unk22[3]; /*0x28*/ s16 unk28[3]; @@ -32,7 +32,9 @@ struct SlotMachineEwramStruct { /*0x3F*/ u8 unk3F; /*0x40*/ u8 filler40[4]; /*0x44*/ u8 unk44[5]; - /*0x49*/ u8 filler49[15]; + /*0x49*/ u8 filler49[5]; + /*0x4E*/ u8 unk4E; + /*0x4F*/ u8 filler4F[9]; /*0x58*/ u16 win0h; /*0x5a*/ u16 win0v; /*0x5c*/ u16 winIn; -- cgit v1.2.3 From 26d22691dc88b3c9e61fa3612c46d3b24167d0eb Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 30 Dec 2017 23:20:35 -0500 Subject: through sub_810535C --- include/slot_machine.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 004538b14..78744d0e4 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -30,9 +30,13 @@ struct SlotMachineEwramStruct { /*0x3D*/ u8 unk3D; /*0x3E*/ u8 unk3E; /*0x3F*/ u8 unk3F; - /*0x40*/ u8 filler40[4]; + /*0x40*/ u8 filler40[2]; + /*0x42*/ u8 unk42; + /*0x43*/ u8 unk43; /*0x44*/ u8 unk44[5]; - /*0x49*/ u8 filler49[5]; + /*0x49*/ u8 unk49; + /*0x4A*/ u8 unk4A; + /*0x49*/ u8 unk4B[3]; /*0x4E*/ u8 unk4E; /*0x4F*/ u8 filler4F[9]; /*0x58*/ u16 win0h; -- cgit v1.2.3 From a357c07d83a3b90adf0353501cbc0f84f6eeeddc Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Dec 2017 19:58:37 -0500 Subject: through sub_8105554 --- include/slot_machine.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 78744d0e4..882ec6d52 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -30,15 +30,15 @@ struct SlotMachineEwramStruct { /*0x3D*/ u8 unk3D; /*0x3E*/ u8 unk3E; /*0x3F*/ u8 unk3F; - /*0x40*/ u8 filler40[2]; + /*0x40*/ u8 unk40; + /*0x41*/ u8 unk41; /*0x42*/ u8 unk42; /*0x43*/ u8 unk43; /*0x44*/ u8 unk44[5]; - /*0x49*/ u8 unk49; - /*0x4A*/ u8 unk4A; + /*0x49*/ u8 unk49[2]; /*0x49*/ u8 unk4B[3]; - /*0x4E*/ u8 unk4E; - /*0x4F*/ u8 filler4F[9]; + /*0x4E*/ u8 unk4E[2]; + /*0x50*/ u8 filler50[8]; /*0x58*/ u16 win0h; /*0x5a*/ u16 win0v; /*0x5c*/ u16 winIn; -- cgit v1.2.3 From 39d2d1f37c62ffc458c82943fbfceb86959ef1a3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Dec 2017 20:18:22 -0500 Subject: through sub_81056C0 --- include/slot_machine.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 882ec6d52..7d7d8a24d 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -38,7 +38,8 @@ struct SlotMachineEwramStruct { /*0x49*/ u8 unk49[2]; /*0x49*/ u8 unk4B[3]; /*0x4E*/ u8 unk4E[2]; - /*0x50*/ u8 filler50[8]; + /*0x50*/ u8 unk50[2]; + /*0x52*/ u8 filler52[6]; /*0x58*/ u16 win0h; /*0x5a*/ u16 win0v; /*0x5c*/ u16 winIn; -- cgit v1.2.3 From 99c897b71582e942e47765837c936b5fd79bf569 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Dec 2017 21:11:48 -0500 Subject: through sub_81059B8 --- include/slot_machine.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 7d7d8a24d..34431a8ef 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -39,7 +39,8 @@ struct SlotMachineEwramStruct { /*0x49*/ u8 unk4B[3]; /*0x4E*/ u8 unk4E[2]; /*0x50*/ u8 unk50[2]; - /*0x52*/ u8 filler52[6]; + /*0x52*/ u8 unk52[2]; + /*0x54*/ u8 unk54[4]; /*0x58*/ u16 win0h; /*0x5a*/ u16 win0v; /*0x5c*/ u16 winIn; -- cgit v1.2.3 From f35549349e3c51003c124c74a8917b84a3f8e704 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 31 Dec 2017 21:45:59 -0500 Subject: through sub_8105BF8 --- include/sprite.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sprite.h b/include/sprite.h index 1e989b6d5..37a318206 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -172,6 +172,8 @@ struct SpriteTemplate void (*callback)(struct Sprite *); }; +typedef void (*SpriteCallback)(struct Sprite *); + struct Sprite { /*0x00*/ struct OamData oam; @@ -180,7 +182,7 @@ struct Sprite /*0x10*/ const union AffineAnimCmd *const *affineAnims; /*0x14*/ const struct SpriteTemplate *template; /*0x18*/ const struct SubspriteTable *subspriteTables; - /*0x1C*/ void (*callback)(struct Sprite *); + /*0x1C*/ SpriteCallback callback; /*0x20*/ struct Coords16 pos1; /*0x24*/ struct Coords16 pos2; -- cgit v1.2.3 From fb99fe5aa6d8f7a257ba5613b32f285bba7afabd Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 2 Jan 2018 12:05:43 -0500 Subject: data through gSpriteImageTable_83ED228 --- include/ewram.h | 1 + include/graphics.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'include') diff --git a/include/ewram.h b/include/ewram.h index 9d3002615..7b480a0e8 100755 --- a/include/ewram.h +++ b/include/ewram.h @@ -78,6 +78,7 @@ extern u8 gSharedMem[]; #define ewram12000 (&gSharedMem[0x12000]) #define ewram12800 (&gSharedMem[0x12800]) #define ewram13000 (&gSharedMem[0x13000]) +#define ewram13200 (&gSharedMem[0x13200]) #define ewram13800 (&gSharedMem[0x13800]) #define EWRAM_14000 ((u8 *)(gSharedMem + 0x14000)) #define ewram14000 (&gSharedMem[0x14000]) diff --git a/include/graphics.h b/include/graphics.h index 488de07c0..9db35862c 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2656,4 +2656,21 @@ extern const u8 gNamingScreenRightPointingTriangleTiles[]; extern const u8 gNamingScreenUnderscoreTiles[]; extern const u16 gNamingScreenPalettes[][16]; +extern const u8 gSpriteImage_8E988E8[]; +extern const u8 gSpriteImage_8E98968[]; +extern const u8 gSpriteImage_8E989E8[]; +extern const u8 gSpriteImage_8E98A68[]; +extern const u8 gSpriteImage_8E98AE8[]; +extern const u8 gSpriteImage_8E98B68[]; +extern const u8 gSpriteImage_8E991E8[]; +extern const u8 gSpriteImage_8E99808[]; +extern const u8 gSpriteImage_8E98BE8[]; +extern const u8 gSpriteImage_8E98CE8[]; +extern const u8 gSpriteImage_8E993E8[]; +extern const u8 gSpriteImage_8E98DE8[]; +extern const u8 gSpriteImage_8E98FE8[]; +extern const u8 gSpriteImage_8E98848[]; +extern const u8 gSpriteImage_8E98868[]; +extern const u8 gSpriteImage_8E98828[]; + #endif // GUARD_GRAPHICS_H -- cgit v1.2.3 From aee62a5b2487845921a1e6c3c3f08475cc7ae2ea Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 2 Jan 2018 15:08:57 -0500 Subject: data through gUnknown_083EDD08 --- include/graphics.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 9db35862c..5f19b09cb 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2672,5 +2672,23 @@ extern const u8 gSpriteImage_8E98FE8[]; extern const u8 gSpriteImage_8E98848[]; extern const u8 gSpriteImage_8E98868[]; extern const u8 gSpriteImage_8E98828[]; +extern const u8 gSlotMachineReelSymbol1Tiles[]; +extern const u8 gSlotMachineReelSymbol2Tiles[]; +extern const u8 gSlotMachineReelSymbol3Tiles[]; +extern const u8 gSlotMachineReelSymbol4Tiles[]; +extern const u8 gSlotMachineReelSymbol5Tiles[]; +extern const u8 gSlotMachineReelSymbol6Tiles[]; +extern const u8 gSlotMachineReelSymbol7Tiles[]; +extern const u8 gSlotMachineNumber0Tiles[]; +extern const u8 gSlotMachineNumber1Tiles[]; +extern const u8 gSlotMachineNumber2Tiles[]; +extern const u8 gSlotMachineNumber3Tiles[]; +extern const u8 gSlotMachineNumber4Tiles[]; +extern const u8 gSlotMachineNumber5Tiles[]; +extern const u8 gSlotMachineNumber6Tiles[]; +extern const u8 gSlotMachineNumber7Tiles[]; +extern const u8 gSlotMachineNumber8Tiles[]; +extern const u8 gSlotMachineNumber9Tiles[]; +extern const u8 gUnknownPalette_08E997E8[]; #endif // GUARD_GRAPHICS_H -- cgit v1.2.3 From 9b2ebe671fe77298d0b1adcb5d87cbb2bd01cd3e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 2 Jan 2018 21:35:41 -0500 Subject: Remaining slot machine data --- include/graphics.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 5f19b09cb..1d66172ca 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2690,5 +2690,12 @@ extern const u8 gSlotMachineNumber7Tiles[]; extern const u8 gSlotMachineNumber8Tiles[]; extern const u8 gSlotMachineNumber9Tiles[]; extern const u8 gUnknownPalette_08E997E8[]; +extern const u16 gSlotMachineSpritePalette0[]; +extern const u16 gSlotMachineSpritePalette1[]; +extern const u16 gSlotMachineSpritePalette2[]; +extern const u16 gSlotMachineSpritePalette3[]; +extern const u16 gSlotMachineSpritePalette4[]; +extern const u16 gSlotMachineSpritePalette5[]; +extern const u16 gSlotMachineSpritePalette6[]; #endif // GUARD_GRAPHICS_H -- cgit v1.2.3 From 3c709ef2ede275d6eeaa319a603c199a3906226b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 3 Jan 2018 23:55:30 -0500 Subject: A little tidying --- include/global.h | 8 -------- include/sprite.h | 4 ---- 2 files changed, 12 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 17dd0a88d..76300d36d 100644 --- a/include/global.h +++ b/include/global.h @@ -27,14 +27,6 @@ int strcmp (const char *, const char *); #define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided\n") -#define nonmatching(fndec, x) {\ -__attribute__((naked))\ -fndec\ -{\ - asm_unified(x);\ -}\ -} - #define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) #define POKEMON_SLOTS_NUMBER 412 diff --git a/include/sprite.h b/include/sprite.h index 2b7960f6f..b72c09989 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -120,10 +120,6 @@ union AffineAnimCmd {.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}} #define AFFINEANIMCMD_END \ {.type = AFFINEANIMCMDTYPE_END} -#define AFFINEANIMCMD_LOOP(_count) \ - {.loop = {.type = AFFINEANIMCMDTYPE_LOOP, .count = _count}} -#define AFFINEANIMCMD_JUMP(_target) \ - {.jump = {.type = AFFINEANIMCMDTYPE_JUMP, .target = _target}} struct AffineAnimState { -- cgit v1.2.3 From 86e1d1098e2554f21c42784115e9f69fb81b2925 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 4 Jan 2018 00:09:07 -0500 Subject: Declare as static what can be so declared --- include/graphics.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/graphics.h b/include/graphics.h index 1d66172ca..17abb840e 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2697,5 +2697,10 @@ extern const u16 gSlotMachineSpritePalette3[]; extern const u16 gSlotMachineSpritePalette4[]; extern const u16 gSlotMachineSpritePalette5[]; extern const u16 gSlotMachineSpritePalette6[]; +extern const u8 gSlotMachine_Gfx[]; +extern const u8 gSlotMachineReelTimeLights_Gfx[]; +extern const u16 gUnknown_08E95A18[]; +extern const u16 gUnknown_08E95AB8[]; +extern const u16 gUnknown_08E95FB8[]; #endif // GUARD_GRAPHICS_H -- cgit v1.2.3 From 0a70c2c6938c260bd8d1d036660891beb26c5820 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 4 Jan 2018 17:17:42 -0500 Subject: Get sub_8103668 matching --- include/ewram.h | 4 ++-- include/slot_machine.h | 33 ++++++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/ewram.h b/include/ewram.h index 7b480a0e8..5a350840a 100755 --- a/include/ewram.h +++ b/include/ewram.h @@ -70,7 +70,7 @@ extern u8 gSharedMem[]; #define ewramF800 (&gSharedMem[0xF800]) #define ewram_2010000 (*(struct TradeEwramStruct *)(gSharedMem + 0x10000)) #define ewram10000 (&gSharedMem[0x10000]) -#define ewram10000_2 (void *)(gSharedMem + 0x10000) // slot machine +#define eSlotMachineGfxBuffer (void *)(gSharedMem + 0x10000) // slot machine #define ePokedexPalAddr3 (void *)(gSharedMem + 0x10000) #define ewram10800 (&gSharedMem[0x10800]) #define ewram11000 (&gSharedMem[0x11000]) @@ -78,7 +78,7 @@ extern u8 gSharedMem[]; #define ewram12000 (&gSharedMem[0x12000]) #define ewram12800 (&gSharedMem[0x12800]) #define ewram13000 (&gSharedMem[0x13000]) -#define ewram13200 (&gSharedMem[0x13200]) +#define eSlotMachineReelTimeGfxBuffer (&gSharedMem[0x13200]) #define ewram13800 (&gSharedMem[0x13800]) #define EWRAM_14000 ((u8 *)(gSharedMem + 0x14000)) #define ewram14000 (&gSharedMem[0x14000]) diff --git a/include/slot_machine.h b/include/slot_machine.h index 34431a8ef..5588d2bac 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -1,6 +1,29 @@ #ifndef GUARD_SLOT_MACHINE_H #define GUARD_SLOT_MACHINE_H +enum { + SLOT_MACHINE_SYM_7_RED, + SLOT_MACHINE_SYM_7_BLUE, + SLOT_MACHINE_SYM_AZURILL, + SLOT_MACHINE_SYM_LOTAD, + SLOT_MACHINE_SYM_CHERRY, + SLOT_MACHINE_SYM_POWER, + SLOT_MACHINE_SYM_REPLAY +}; + +enum { + SLOT_MACHINE_MATCHED_1CHERRY, + SLOT_MACHINE_MATCHED_2CHERRY, + SLOT_MACHINE_MATCHED_REPLAY, + SLOT_MACHINE_MATCHED_LOTAD, + SLOT_MACHINE_MATCHED_AZURILL, + SLOT_MACHINE_MATCHED_POWER, + SLOT_MACHINE_MATCHED_777_MIXED, + SLOT_MACHINE_MATCHED_777_RED, + SLOT_MACHINE_MATCHED_777_BLUE, + SLOT_MACHINE_MATCHED_NONE +}; + struct SlotMachineEwramStruct { /*0x00*/ u8 state; /*0x01*/ u8 unk01; @@ -10,11 +33,11 @@ struct SlotMachineEwramStruct { /*0x05*/ u8 unk05; /*0x06*/ u8 unk06; /*0x07*/ u8 unk07; - /*0x08*/ u16 unk08; + /*0x08*/ u16 matchedSymbols; /*0x0A*/ u8 unk0A; /*0x0B*/ u8 unk0B; /*0x0C*/ s16 coins; - /*0x0E*/ s16 unk0E; + /*0x0E*/ s16 payout; /*0x10*/ s16 unk10; /*0x12*/ s16 bet; /*0x14*/ s16 unk14; @@ -26,7 +49,7 @@ struct SlotMachineEwramStruct { /*0x28*/ s16 unk28[3]; /*0x2E*/ s16 unk2E[3]; /*0x34*/ s16 unk34[3]; - /*0x3A*/ u8 unk3A[3]; + /*0x3A*/ u8 reelTasks[3]; /*0x3D*/ u8 unk3D; /*0x3E*/ u8 unk3E; /*0x3F*/ u8 unk3F; @@ -49,8 +72,8 @@ struct SlotMachineEwramStruct { /*0x64*/ MainCallback prevMainCb; }; -void PlaySlotMachine(u8, void *); +void PlaySlotMachine(u8 arg0, MainCallback cb); void sub_8104DA4(void); -u8 sub_8105BB4(u8, u8, s16); +u8 sub_8105BB4(u8 templateIdx, u8 cbAndCoordsIdx, s16 a2); #endif // GUARD_SLOT_MACHINE_H -- cgit v1.2.3 From 59c99b2d65af9ea1d53d457c71dc7f0915d815c5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 4 Jan 2018 17:35:13 -0500 Subject: some renaming --- include/slot_machine.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index 5588d2bac..d932edff0 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -2,13 +2,13 @@ #define GUARD_SLOT_MACHINE_H enum { - SLOT_MACHINE_SYM_7_RED, - SLOT_MACHINE_SYM_7_BLUE, - SLOT_MACHINE_SYM_AZURILL, - SLOT_MACHINE_SYM_LOTAD, - SLOT_MACHINE_SYM_CHERRY, - SLOT_MACHINE_SYM_POWER, - SLOT_MACHINE_SYM_REPLAY + SLOT_MACHINE_TAG_7_RED, + SLOT_MACHINE_TAG_7_BLUE, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_CHERRY, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_REPLAY }; enum { @@ -46,7 +46,7 @@ struct SlotMachineEwramStruct { /*0x1A*/ s16 unk1A; /*0x1C*/ s16 unk1C[3]; /*0x22*/ u16 unk22[3]; - /*0x28*/ s16 unk28[3]; + /*0x28*/ s16 reelPositions[3]; /*0x2E*/ s16 unk2E[3]; /*0x34*/ s16 unk34[3]; /*0x3A*/ u8 reelTasks[3]; -- cgit v1.2.3 From 25bf57596507492210c36cffb1dfb6b9bf626df7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 4 Jan 2018 18:03:10 -0500 Subject: propagate SLOT_MACHINE_MATCHED enums --- include/slot_machine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/slot_machine.h b/include/slot_machine.h index d932edff0..f886d9239 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -27,7 +27,7 @@ enum { struct SlotMachineEwramStruct { /*0x00*/ u8 state; /*0x01*/ u8 unk01; - /*0x02*/ u8 unk02; + /*0x02*/ u8 pikaPower; /*0x03*/ u8 unk03; /*0x04*/ u8 unk04; /*0x05*/ u8 unk05; -- cgit v1.2.3