diff options
Diffstat (limited to 'include')
-rwxr-xr-x | include/ewram.h | 5 | ||||
-rw-r--r-- | include/field_effect.h | 1 | ||||
-rw-r--r-- | include/global.h | 10 | ||||
-rw-r--r-- | include/graphics.h | 47 | ||||
-rw-r--r-- | include/slot_machine.h | 75 | ||||
-rw-r--r-- | include/sprite.h | 10 |
6 files changed, 130 insertions, 18 deletions
diff --git a/include/ewram.h b/include/ewram.h index eacc02cab..5a350840a 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)) @@ -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,6 +78,7 @@ extern u8 gSharedMem[]; #define ewram12000 (&gSharedMem[0x12000]) #define ewram12800 (&gSharedMem[0x12800]) #define ewram13000 (&gSharedMem[0x13000]) +#define eSlotMachineReelTimeGfxBuffer (&gSharedMem[0x13200]) #define ewram13800 (&gSharedMem[0x13800]) #define EWRAM_14000 ((u8 *)(gSharedMem + 0x14000)) #define ewram14000 (&gSharedMem[0x14000]) 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]; diff --git a/include/global.h b/include/global.h index 4ae5de873..76300d36d 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} @@ -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/graphics.h b/include/graphics.h index 488de07c0..17abb840e 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2656,4 +2656,51 @@ 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[]; +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[]; +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[]; +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 diff --git a/include/slot_machine.h b/include/slot_machine.h index c39aa7ca8..f886d9239 100644 --- a/include/slot_machine.h +++ b/include/slot_machine.h @@ -1,8 +1,79 @@ #ifndef GUARD_SLOT_MACHINE_H #define GUARD_SLOT_MACHINE_H -void PlaySlotMachine(u8, void *); +enum { + 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 { + 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; + /*0x02*/ u8 pikaPower; + /*0x03*/ u8 unk03; + /*0x04*/ u8 unk04; + /*0x05*/ u8 unk05; + /*0x06*/ u8 unk06; + /*0x07*/ u8 unk07; + /*0x08*/ u16 matchedSymbols; + /*0x0A*/ u8 unk0A; + /*0x0B*/ u8 unk0B; + /*0x0C*/ s16 coins; + /*0x0E*/ s16 payout; + /*0x10*/ s16 unk10; + /*0x12*/ s16 bet; + /*0x14*/ s16 unk14; + /*0x16*/ s16 unk16; + /*0x18*/ s16 unk18; + /*0x1A*/ s16 unk1A; + /*0x1C*/ s16 unk1C[3]; + /*0x22*/ u16 unk22[3]; + /*0x28*/ s16 reelPositions[3]; + /*0x2E*/ s16 unk2E[3]; + /*0x34*/ s16 unk34[3]; + /*0x3A*/ u8 reelTasks[3]; + /*0x3D*/ u8 unk3D; + /*0x3E*/ u8 unk3E; + /*0x3F*/ u8 unk3F; + /*0x40*/ u8 unk40; + /*0x41*/ u8 unk41; + /*0x42*/ u8 unk42; + /*0x43*/ u8 unk43; + /*0x44*/ u8 unk44[5]; + /*0x49*/ u8 unk49[2]; + /*0x49*/ u8 unk4B[3]; + /*0x4E*/ u8 unk4E[2]; + /*0x50*/ u8 unk50[2]; + /*0x52*/ u8 unk52[2]; + /*0x54*/ u8 unk54[4]; + /*0x58*/ u16 win0h; + /*0x5a*/ u16 win0v; + /*0x5c*/ u16 winIn; + /*0x5e*/ u16 winOut; + /*0x60*/ u16 backupMapMusic; + /*0x64*/ MainCallback prevMainCb; +}; + +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 diff --git a/include/sprite.h b/include/sprite.h index 13c76c84b..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 { @@ -172,6 +168,8 @@ struct SpriteTemplate void (*callback)(struct Sprite *); }; +typedef void (*SpriteCallback)(struct Sprite *); + struct Sprite { /*0x00*/ struct OamData oam; @@ -180,7 +178,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; @@ -238,6 +236,8 @@ extern s16 gSpriteCoordOffsetX; extern s16 gSpriteCoordOffsetY; extern u8 gReservedSpritePaletteCount; +extern u8 gOamLimit; + extern struct Sprite gSprites[]; void ResetSpriteData(void); |