mirror of
https://github.com/pret/pokepinballrs.git
synced 2026-03-21 17:24:13 -05:00
Mass naming: Ball/PinballGame Unk variables, function names (#210)
Some checks failed
CI / build (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
* sha1 compliant fingers crossed * oops. You need these too. missing files. * renames * renames 2 * renames 4 * more renames 347 replacements, 31 files. SHA1 verified. ## Ramp Prize (was "rubyPondBumper") - `rubyPondBumperHitFlag` -> `rampPrizeType` -- controls Nuzleaf ramp prize (0=none, 1=1UP, 2-100=powerUp). Not pond-related at all, it's the prize platform at the top of the Ruby ramp. - `rubyPondBumperTimer` -> `rampPrizeRespawnTimer` -- 600-frame cooldown before ramp prize respawns with random type. Files: global.h, board_process3_ruby.c, collision_checks.c, ruby_ramp_entities.c + PC port (26 total) ## Screen Shake - `horizontalShakeOffset` -> `screenShakeX` -- X-axis camera shake (Whiscash + Rayquaza). Shorter, clearer. - `bonusBoardYOffset` -> `screenShakeY` -- Y-axis camera shake (Rayquaza + Groudon, bonus stages only). Pairs with screenShakeX. Files: global.h, board_process2.c, board_process3_rayquaza.c, board_process3_groudon.c, board_process7.c, ruby_board_entities.c + PC port (44 total) ## Gauntlet Flash (drop "Boss") - `gauntletBossFlashTimer` -> `gauntletFlashTimer` -- not a boss fight, it's a projectile launcher board feature. "Boss" was misleading. - `gauntletBossFlashActive` -> `gauntletFlashActive` -- same. The `gauntletProjectile*` fields were already correct and kept as-is. Files: global.h, collision_checks.c, ruby_board_entities.c + PC port (20 total) ## Egg Delivery System (was "TravelMode"/"EvolutionMode") Two delivery paths exist after the hatch cave: Pelipper (rare, Totodile) and egg drop (common, Aerodactyl). The old names "Travel" and "Evolution" referred to the delivery mechanism, not the game modes of the same name. This was confusing. Fields: - `travelSpriteFrame` -> `pelipperDeliveryFrame` - `pikaSaverAnimFrameTimer` -> `pelipperDeliveryTimer` -- "PikaSaver" was a leftover decompilation artifact - `modeSpriteTimer` -> `eggDropTimer` - `modeSpriteX` -> `eggDeliveryX` - `modeSpriteY` -> `eggDeliveryY` - `modeSpriteVelX` -> `eggDeliveryVelX` - `modeSpriteVelY` -> `eggDeliveryVelY` - `eggAnimTravelState` -> `eggDeliveryState` -- dropped misleading "Travel" Functions: - `InitTravelModeSprites` -> `InitPelipperEggDelivery` - `AnimateTravelModeSprite` -> `AnimatePelipperEggDelivery` - `InitEvolutionModeSprites` -> `InitEggDropDelivery` - `AnimateEvolutionModeSprite` -> `AnimateEggDropDelivery` Files: global.h, functions.h, catch_hatch_animations.c, ruby_catch_mode.c + PC port (132 total) ## Catch Hole Animation (was "sharpedo") - `sharpedoOamIndex` -> `catchHoleAnimFrame` -- used by both Sharpedo (Ruby) and Wailmer (Sapphire). Named after the shared mechanic, matches adjacent `catchHolePauseTimer`. - `sharpedoTileVariant` -> `catchHoleTileVariant` -- same, shared between both boards. Files: global.h, ruby_catch_mode.c, board_process3_sapphire.c, ruby_board_entities.c, sapphire_board_entities.c, pinball_game_main.c + PC port (73 total) * more renames 362 replacements across 28 files. GBA ROM SHA1 verified. ## Renames ### gravityFrozen -> ballGrabbed This field is set to 1 when a legendary boss grabs the ball during its attack sequence, and cleared to 0 when the ball is released. The old name described what happens as a side effect (gravity stops updating), but the actual state being tracked is whether the boss is holding the ball. Used by Kyogre, Groudon, and Rayquaza boss fights. ### bossColorState -> kecleonFramesetBase Only used by the Kecleon bonus stage. It stores a base animation frameset index derived from Kecleon's movement direction angle (via `gKecleonVisibleWalkDirectionMap`), then various offsets are added to select specific walk/stand/fall frames. Nothing to do with color. ### bossSubEntityState -> dusclopsWalkFootIndex Only used by the Dusclops bonus stage. Cycles through values 0-4 to track which foot Dusclops is leading with during its walk cycle. The parity (`& 1`) determines animation direction. Other bonus stages initialize it to 0 and never touch it again. ### kecleonHitState -> kecleonBoardHitState Tracks collision with any of the 14 berry zones on the Kecleon board (4 large + 10 small, collision cases 8-12), not just Kecleon's body being hit directly. The broader name better reflects that this covers all scope/berry overlay collisions. ### catchSpinRadius -> trapSpinRadius ### captureAngleQ16 -> trapAngleQ16 These two fields control the ball's spiral orbit during trap captures (boss fights, center hole traps, Jirachi bonus). They are not used by the regular catch system (Sharpedo hole). The old names mixed "catch" and "capture" inconsistently and were ambiguous with the separate catch mode. "trap" distinguishes this mechanic clearly. ### travelPelipperPosX/PosY/VelX/VelY -> travelPainterPosX/PosY/VelX/VelY ### gRubyTravelPelipper_Gfx -> gRubyTravelVolbeat_Gfx ### gSapphireTravelPelipper_Gfx -> gSapphireTravelIllumise_Gfx The travel cutscene entity is Volbeat (Ruby board) and Illumise (Sapphire board), not Pelipper. The actual Pelipper has its own separate fields (`pelipperState`, `pelipperPosX`, `pelipperPosY` at offsets 0x306-0x322) and its own graphics (`gPelipper_Gfx` from `pelipper.4bpp`). The travel sprites at ROM 0x08483D8C / 0x08488A0C are 44-53% different from real Pelipper pixel data, and the Ruby and Sapphire variants differ from each other by 22-37% per frame, consistent with two distinct but related Pokemon. The previous "travelPelipper" labels were a misidentification. ### rouletteSpeciesId -> rouletteAreaIndex This array stores area-based portrait indices (0-12) used to look up graphics sets, not actual species IDs. The lookup table `gAreaToSpeciesTable` is essentially an identity mapping (area N maps to index N). The old name made it sound like the roulette was selecting a specific Pokemon species, when it is selecting an area index for portrait rendering. ## Source File Reverts 17 source files reverted from descriptive names back to their original ROM-offset names. The `ld_script.txt` linker order was updated to match. | Descriptive Name | Reverted To | |------------------|-------------| | `interrupt_handlers.c` | `rom_850.c` | | `text_graphics_util.c` | `rom_1068C.c` | | `banner_camera.c` | `rom_1A0F4.c` | | `ruby_catch_mode.c` | `rom_1A98C.c` | | `ruby_board_entities.c` | `rom_201B8.c` | | `catch_hatch_animations.c` | `rom_27E08.c` | | `catch_roulette_rendering.c` | `rom_27F94.c` | | `sprite_link_init.c` | `rom_2414.c` | | `ruby_ramp_entities.c` | `rom_2C538.c` | | `sapphire_board_entities.c` | `rom_2E67C.c` | | `sapphire_egg_cave.c` | `rom_30480.c` | | `sapphire_visual_effects.c` | `rom_31BE8.c` | | `capture_registry.c` | `rom_31CF8.c` | | `bonus_stage_transitions.c` | `rom_356A0.c` | | `board_layout_init.c` | `rom_467F4.c` | | `ruby_hud_animations.c` | `rom_4F258.c` | | `sapphire_hud_animations.c` | `rom_50AD4.c` | * removal Removed duplicated & unwanted renames * renames ## Changes Made ### Misidentified Pokemon Entities (6 functions + 2 fields) Wrong Pokemon names from initial decompilation. Corrected based on in-game sprite identification. | Old Name | New Name | File | Notes | |----------|----------|------|-------| | `InitPelipperEggDelivery` | `InitTotodileEggDelivery` | rom_27E08.c | Sprite group 82; Totodile carries egg when `rubyPondState == RUBY_POND_STATE_LOTAD` | | `AnimatePelipperEggDelivery` | `AnimateTotodileEggDelivery` | rom_27E08.c | Same entity | | `InitEggDropDelivery` | `InitAerodactylEggDelivery` | rom_27E08.c | Sprite group 12; Aerodactyl flies in with the egg | | `AnimateEggDropDelivery` | `AnimateAerodactylEggDelivery` | rom_27E08.c | Same entity | | `UpdateGauntletBossAnimation` | `UpdateChikoritaAttackAnimation` | rom_201B8.c | Sprite groups 13-14; Chikorita shoots leaf projectiles at bumpers | | `AnimateGauntletBossSprite` | `AnimateChikoritaSprite` | rom_201B8.c | Sprite group 53, flash animation | | `pelipperDeliveryFrame` | `totodileDeliveryFrame` | global.h (0x2C3) | Misattributed to Pelipper | | `pelipperDeliveryTimer` | `totodileDeliveryTimer` | global.h (0x2C4) | Same | ### Chikorita Fields (7 fields, 0x2B0-0x2BC) | Old | New | |-----|-----| | `gauntletFlashTimer` | `chikoritaFlashTimer` | | `gauntletFlashActive` | `chikoritaFlashActive` | | `gauntletProjectileX` | `chikoritaProjectileX` | | `gauntletProjectileY` | `chikoritaProjectileY` | | `gauntletProjectileVelX` | `chikoritaProjectileVelX` | | `gauntletProjectileUnused` | `chikoritaProjectileUnused` | | `gauntletProjectileTimer` | `chikoritaProjectileTimer` | ### Chikorita Data Labels (3) | Old | New | |-----|-----| | `gGauntletExplosionTiles` | `gChikoritaExplosionTiles` | | `gGauntletProjectileTiles` | `gChikoritaProjectileTiles` | | `gGauntletBossFlashFrameIndices` | `gChikoritaFlashFrameIndices` | ### Spheal Stage Entity Disambiguation (3 functions + 1 struct + 1 data label) The Spheal bonus stage has two Pokemon: Spheal (flying enemies) and Sealeo (ground minions that get knocked down). Functions were lumping both under "Spheal." | Old Name | New Name | Notes | |----------|----------|-------| | `UpdateSphealMinionLogic` | `UpdateSealeoEntityLogic` | "Minions" use `minionState`/`minionFramesetIx` - these are Sealeo | | `UpdateSphealFlyingEnemyLogic` | `UpdateSphealEntityLogic` | Flying enemies ARE Spheal; dropped redundant "FlyingEnemy" | | `UpdateSphealKnockdownPhysics` | `UpdateSealeoKnockdownPhysics` | Knockdown targets are Sealeo (operates on `minionState[var0]`) | | `struct FlyingEnemyPath` | `struct SphealFlightPath` | Flight path data for Spheal patterns | | `gSphealFlyingEnemyPathData` | `gSphealFlightPathData` | Matching struct rename | ### Ruby Board Distinction (4 functions) These are Ruby-only but lacked the "Ruby" prefix. Sapphire counterparts already had it. | Old Name | New Name | |----------|----------| | `DispatchCatchModeInit` | `DispatchRubyCatchModeInit` | | `UpdateCatchModeAnimation` | `UpdateRubyCatchModeAnimation` | | `InitEvolutionShopMode` | `InitRubyEvolutionShopMode` | | `AnimateEvolutionShopSequence` | `AnimateRubyEvolutionShopSequence` | ### Improved Descriptiveness (3 functions + 2 data labels + 1 field) | Old Name | New Name | Notes | |----------|----------|-------| | `ProcessMainBoardBallDrain` | `ProcessMainBoardBallDrainAndLaunch` | Also handles plunger charging/launch (lines 421-438) | | `HideCaughtPokemonSprite` | `CleanupCaughtPokemonSprite` | Sets OAM off-screen AND sets `available=0` | | `HideJirachiSprites` | `CleanupJirachiSprites` | Hides sprite group 33 AND deactivates 4 star tag groups (45-48) | | `gMonIconTilesGfx` | `gPikaSaverTilesGfx` | Pikachu saver icon tiles, indexed via `gPikaSaverAnimFrameTable` | | `monIconTileIndex` | `pikaSaverTileIndex` | Indexes into `gPikaSaverTilesGfx` | | `field` (0x10FD) | `savedField` | Adjacent fields are `savedTempField`, `savedIsBonusField`, etc. | ### Comments Added (4) | Location | Comment | |----------|---------| | `progressLevel` (0x70E) | Becomes bonusMultiplier at end-of-ball; displayed on the blue bonus sign | | `ballLaunchTimer` (0x1328) | Countdown to activate secondaryBall (multiball) | | Fields 0x1106-0x110E | Values applied by the pause process (set when pausing) | | Fields 0x1110-0x1118 | Values preserved from before pause (restored when unpausing) |
This commit is contained in:
parent
c555ddb059
commit
69f931d646
672
data/rom_1.s
672
data/rom_1.s
File diff suppressed because it is too large
Load Diff
592
data/rom_2.s
592
data/rom_2.s
File diff suppressed because it is too large
Load Diff
|
|
@ -1841,7 +1841,7 @@ gUnknown_08532808:: @ 0x08532808
|
|||
voice_square_1 60, 0, 0, 2, 0, 0, 15, 0
|
||||
voice_directsound_no_resample 60, 0, gDirectSound_0853854C, 255, 89, 0, 89
|
||||
|
||||
gUnknown_08532D6C:: @ 0x08532D6C
|
||||
gPokemonCryToneBank0:: @ 0x08532D6C
|
||||
voice_square_1 60, 0, 0, 2, 0, 0, 15, 0
|
||||
voice_square_1 60, 0, 0, 2, 0, 0, 15, 0
|
||||
voice_square_1 60, 0, 0, 2, 0, 0, 15, 0
|
||||
|
|
@ -1970,7 +1970,7 @@ gUnknown_08532D6C:: @ 0x08532D6C
|
|||
voice_square_1 60, 0, 0, 2, 0, 0, 15, 0
|
||||
voice_directsound_compressed gDirectSound_085DDBE4
|
||||
|
||||
gUnknown_08533360:: @ 0x08533360
|
||||
gPokemonCryToneBank1:: @ 0x08533360
|
||||
voice_directsound_compressed gDirectSound_085DE840
|
||||
voice_directsound_compressed gDirectSound_085DFB48
|
||||
voice_square_1 60, 0, 0, 2, 0, 0, 15, 0
|
||||
|
|
@ -2100,7 +2100,7 @@ gUnknown_08533360:: @ 0x08533360
|
|||
voice_directsound_compressed gDirectSound_0860173C
|
||||
voice_directsound_compressed gDirectSound_08602398
|
||||
|
||||
gUnknown_08533960:: @ 0x08533960
|
||||
gPokemonCryToneBank2:: @ 0x08533960
|
||||
voice_directsound_compressed gDirectSound_086038A0
|
||||
voice_directsound_compressed gDirectSound_08604338
|
||||
voice_directsound_compressed gDirectSound_08604F68
|
||||
|
|
@ -2230,7 +2230,7 @@ gUnknown_08533960:: @ 0x08533960
|
|||
voice_directsound_compressed gDirectSound_08683470
|
||||
voice_directsound_compressed gDirectSound_08683C94
|
||||
|
||||
gUnknown_08533F60:: @ 0x08533F60
|
||||
gPokemonCryToneBank3:: @ 0x08533F60
|
||||
voice_directsound_compressed gDirectSound_08684D9C
|
||||
voice_directsound_compressed gDirectSound_08686394
|
||||
voice_directsound_compressed gDirectSound_08687118
|
||||
|
|
|
|||
BIN
graphics/stage/sapphire/pelipper.png
Normal file
BIN
graphics/stage/sapphire/pelipper.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
|
|
@ -245,7 +245,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"gfx_filename": "pelliper",
|
||||
"gfx_filename": "pelipper",
|
||||
"oam": true,
|
||||
"mheight": 6,
|
||||
"mwidth": 6
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#define STATE_GAME_IDLE 3
|
||||
#define STATE_OPTIONS 4
|
||||
#define STATE_POKEDEX 5
|
||||
#define STATE_UNKNOWN6 6
|
||||
#define STATE_SAVE_ERASE 6
|
||||
#define STATE_EREADER 7
|
||||
#define STATE_SCORES_MAIN 8
|
||||
#define STATE_SCORES_IDLE 9
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,8 +4,8 @@
|
|||
#include "global.h"
|
||||
|
||||
void InitGameBoyPlayer(void);
|
||||
u32 sub_1668(u32 arg1, u32 arg2);
|
||||
u32 sub_170C(void);
|
||||
u32 sub_17D8(u32 arg1);
|
||||
u32 Sio32EncodePacket(u32 arg1, u32 arg2);
|
||||
u32 Sio32VerifyChecksum(void);
|
||||
u32 EncodeRumbleCommand(u32 arg1);
|
||||
|
||||
#endif // GUARD_GBPLAYER_H
|
||||
|
|
|
|||
1402
include/global.h
1402
include/global.h
File diff suppressed because it is too large
Load Diff
|
|
@ -35,14 +35,14 @@ struct Link
|
|||
u16 handshakeBuffer[4]; // 0x4
|
||||
bool8 receivedNothing; // 0xC
|
||||
u8 serialIntrCounter; // 0xD
|
||||
u8 unkE; // 0xE
|
||||
u8 sendPaused; // 0xE
|
||||
u8 fillerF; // 0xF
|
||||
bool8 handshakeAsMaster; // 0x10
|
||||
u8 unk11;
|
||||
u8 checksumError;
|
||||
u8 hardwareError;
|
||||
u8 unk13;
|
||||
u8 invalidIdError;
|
||||
u8 queueFull; // 0x14
|
||||
u8 unk15;
|
||||
u8 lagError;
|
||||
u16 checksum; // 0x16
|
||||
u8 sendCmdIndex; // 0x18
|
||||
u8 recvCmdIndex; // 0x19
|
||||
|
|
@ -53,7 +53,7 @@ struct Link
|
|||
};
|
||||
|
||||
// extern function declarations
|
||||
extern void sub_19B4(void);
|
||||
extern void InitLinkHardware(void);
|
||||
extern void DisableSerial(void);
|
||||
extern s32 LinkMain1(u8 *shouldAdvanceLinkState, s16 *sendCmd, u16 (*recvCmds)[MAX_LINK_PLAYERS]);
|
||||
extern void Timer3Init(void);
|
||||
|
|
@ -62,7 +62,7 @@ extern void SerialCB(void);
|
|||
// extern IWRAM variable declarations
|
||||
|
||||
// extern EWRAM variable declarations
|
||||
extern u8 gUnknown_0202BEC8;
|
||||
extern u8 gLinkAdvanceState;
|
||||
extern struct Link gLink;
|
||||
|
||||
// extern const definitions
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ struct SaveData
|
|||
/*0x158*/ struct HighScoreEntry highScores[2][NUM_HIGH_SCORES];
|
||||
/*0x2D8*/ s8 signature[10];
|
||||
u16 checksum;
|
||||
u32 unk2E4;
|
||||
u32 saveChangeCounter;
|
||||
};
|
||||
|
||||
struct Main
|
||||
|
|
@ -39,12 +39,12 @@ struct Main
|
|||
/*0x02*/ u8 mainState;
|
||||
/*0x03*/ u8 subState;
|
||||
/*0x04*/ u8 selectedField;
|
||||
/*0x05*/ u8 unk5; // tempField (?)
|
||||
/*0x06*/ u8 unk6; // isBonusField (?)
|
||||
/*0x05*/ u8 tempField;
|
||||
/*0x06*/ u8 isBonusField;
|
||||
/*0x07*/ s8 eReaderBonuses[NUM_EREADER_CARDS];
|
||||
/*0x0C*/ u8 unkC;
|
||||
/*0x0D*/ u8 unkD;
|
||||
/*0x0E*/ u8 unkE;
|
||||
/*0x0C*/ u8 sramError;
|
||||
/*0x0D*/ u8 continueFromSave;
|
||||
/*0x0E*/ u8 gameExitState;
|
||||
|
||||
// UnkF hold a Bitmask for the following:
|
||||
// x1 mode start banner Evo/Catch/Travel,
|
||||
|
|
@ -57,10 +57,10 @@ struct Main
|
|||
// x80 Bonus Score banner
|
||||
// Most cause a board state transition once conditions are met.
|
||||
/*0x0F*/ u8 modeChangeFlags;
|
||||
/*0x10*/ u8 unk10;
|
||||
/*0x11*/ u8 unk11;
|
||||
/*0x12*/ u16 unk12;
|
||||
/*0x14*/ u16 unk14;
|
||||
/*0x10*/ u8 debugMenuCursorIndex;
|
||||
/*0x11*/ u8 pendingModeChangeType;
|
||||
/*0x12*/ u16 animationTimer;
|
||||
/*0x14*/ u16 modeChangeDelayTimer;
|
||||
/*0x16*/ u16 dispcntBackup;
|
||||
/*0x18*/ u16 newKeys;
|
||||
/*0x1A*/ u16 releasedKeys;
|
||||
|
|
@ -69,23 +69,23 @@ struct Main
|
|||
/*0x20*/ u16 unk20;
|
||||
/*0x22*/ u8 filler22[0x4];
|
||||
/*0x26*/ s16 vCount;
|
||||
/*0x28*/ s16 unk28;
|
||||
/*0x2A*/ s16 unk2A;
|
||||
/*0x2C*/ s16 unk2C;
|
||||
/*0x2E*/ s16 unk2E;
|
||||
/*0x30*/ u16 unk30;
|
||||
/*0x28*/ s16 shopPanelActive;
|
||||
/*0x2A*/ s16 shopPanelSlideOffset;
|
||||
/*0x2C*/ s16 scoreOverlayActive;
|
||||
/*0x2E*/ s16 kecleonOverlayHeight;
|
||||
/*0x30*/ u16 idleDemoVariant;
|
||||
/*0x32*/ u8 filler32[0x4];
|
||||
/*0x36*/ u8 unk36;
|
||||
/*0x36*/ u8 blendEnabled;
|
||||
/*0x38*/ volatile u16 blendControl;
|
||||
/*0x3A*/ volatile u16 blendAlpha;
|
||||
/*0x3C*/ volatile u16 blendBrightness;
|
||||
// may be a sub-struct. possibly for saved game?
|
||||
/*0x40*/ int hasSavedGame;
|
||||
/*0x44*/ struct SpriteGroup **unk44;
|
||||
/*0x44*/ struct SpriteGroup **fieldSpriteGroups;
|
||||
/*0x48*/ int rngValue;
|
||||
/*0x4C*/ u32 systemFrameCount;
|
||||
/*0x50*/ u32 fieldFrameCount;
|
||||
/*0x54*/ u32 unk54;
|
||||
/*0x54*/ u32 idleFrameCounter;
|
||||
/*0x58*/ u32 finalScoreLo;
|
||||
/*0x5C*/ u32 finalScoreHi;
|
||||
|
||||
|
|
@ -128,40 +128,40 @@ extern u32 IntrMain_Buffer[0x200];
|
|||
extern u32 IntrMain[];
|
||||
extern IntrFunc *gVBlankIntrFuncPtr;
|
||||
extern IntrFunc *gVCountIntrFuncPtr;
|
||||
extern int gUnknown_02019BE4;
|
||||
extern int gUnknown_02019BE8;
|
||||
extern int gUnknown_02019BEC;
|
||||
extern u32 gUnknown_02019BF0;
|
||||
extern int gUnknown_02019BF4;
|
||||
extern int gUnknown_02019BF8;
|
||||
extern int gUnknown_02019BFC;
|
||||
extern int gUnknown_02019C00;
|
||||
extern int gUnknown_02019C04;
|
||||
extern int gUnknown_02019C08;
|
||||
extern int gRumbleLoopCounter;
|
||||
extern int gRumbleFrameCounter;
|
||||
extern int gRumbleMotorMode;
|
||||
extern u32 gSio32ReconnectTimer;
|
||||
extern int gSio32SerialEnabled;
|
||||
extern int gRumblePatternIndex;
|
||||
extern int gRumblePatternPosition;
|
||||
extern int gRumbleCommand;
|
||||
extern int gRumblePaused;
|
||||
extern int gRumbleSpeedMode;
|
||||
extern int gGameBoyPlayerEnabled;
|
||||
extern u8 gUnknown_02019C10;
|
||||
extern u8 gSio32CommState;
|
||||
extern u8 gGbPlayerTilemapBuffer[];
|
||||
#define INTR_COUNT 14
|
||||
extern IntrFunc gIntrTable[14];
|
||||
extern void (*gMainCallback)(void);
|
||||
extern void (*gUnknown_0200FBA0)(void);
|
||||
extern void (*gUnknown_02017BD0)(void);
|
||||
extern void (*gUnknown_02017BD4)(void);
|
||||
extern void (*gVCountIntrFuncShadow)(void);
|
||||
extern void (*gVBlankIntrFuncShadow)(void);
|
||||
extern void (*gMainCallbackShadow)(void);
|
||||
extern StateFunc gMainFuncs[];
|
||||
extern struct OamData gOamBuffer[128];
|
||||
|
||||
void sub_024C(void);
|
||||
void sub_02B4(void);
|
||||
void FadeInScreen(void);
|
||||
void FadeOutScreen(void);
|
||||
void ClearGraphicsMemory(void);
|
||||
void sub_0518(void);
|
||||
void ClearBgTilemapAndOffsets(void);
|
||||
void ClearSprites(void);
|
||||
u32 Random(void);
|
||||
void VBlankIntr(void);
|
||||
void VCountIntr(void);
|
||||
void SerialIntr(void);
|
||||
void Timer3Intr(void);
|
||||
void sub_0CBC(void);
|
||||
void sub_0D10(void);
|
||||
void EnableVBlankInterrupts(void);
|
||||
void DisableVBlankInterrupts(void);
|
||||
void MainLoopIter(void);
|
||||
void DefaultMainCallback(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,19 +4,19 @@
|
|||
struct TitlescreenStruct
|
||||
{
|
||||
/*0x00*/ s8 menuCursorIndex;
|
||||
/*0x02*/ s16 unk2;
|
||||
/*0x02*/ s16 animPhase;
|
||||
/*0x04*/ s16 animTimer;
|
||||
/*0x06*/ s8 unk6;
|
||||
/*0x07*/ u8 unk7;
|
||||
/*0x08*/ s8 unk8;
|
||||
/*0x06*/ s8 menuAction;
|
||||
/*0x07*/ u8 hasSavedGame;
|
||||
/*0x08*/ s8 pressStartAnimFrame;
|
||||
/*0x09*/ s8 pressStartAndFlippersVisible;
|
||||
/*0x0A*/ s8 unkA; // Menu options sprite ID?
|
||||
/*0x0A*/ s8 menuSpriteGroupId;
|
||||
/*0x0B*/ s8 menuVisible;
|
||||
/*0x0C*/ s8 unkC;
|
||||
/*0x0D*/ s8 unkD;
|
||||
/*0x0E*/ s8 unkE;
|
||||
/*0x0F*/ s8 unkF;
|
||||
/*0x10*/ s8 unk10; // Delete save window sprite ID?
|
||||
/*0x0C*/ s8 cursorSpriteGroupId;
|
||||
/*0x0D*/ s8 cursorArrowVisible;
|
||||
/*0x0E*/ s8 selectorSpriteGroupId;
|
||||
/*0x0F*/ s8 selectorVisible;
|
||||
/*0x10*/ s8 deleteSaveGroupId;
|
||||
/*0x11*/ s8 deleteSaveWindowVisible;
|
||||
/*0x12*/ s16 idleFadeoutCounter;
|
||||
/*0x14*/ s16 idleFramesCounter;
|
||||
|
|
@ -24,15 +24,15 @@ struct TitlescreenStruct
|
|||
|
||||
extern struct TitlescreenStruct gTitlescreen;
|
||||
extern s8 gAutoDisplayTitlescreenMenu;
|
||||
extern u8 gUnknown_202BE24;
|
||||
extern u16 gUnknown_0202C588;
|
||||
extern u8 gTitleReturnedFromMenu;
|
||||
extern u16 gHighScoreEntrySource;
|
||||
extern s8 gEraseSaveDataAccessStep;
|
||||
extern s8 gEraseSaveDataAccessCounter;
|
||||
extern s8 gEReaderAccessStep;
|
||||
extern s8 gEReaderAccessCounter;
|
||||
extern s8 gUnknown_020028A4;
|
||||
extern s8 gUnknown_020028A5;
|
||||
extern const u8 *gUnknown_0201C190[];
|
||||
extern const u8 *gUnknown_0202BE00[];
|
||||
extern s8 gTitleTransitionActive;
|
||||
extern s8 gTitleRestartDebounce;
|
||||
extern const u8 *gTitleNoSaveMenuSpriteSets[];
|
||||
extern const u8 *gTitleSavedMenuSpriteSets[];
|
||||
|
||||
#endif // GUARD_TITLESCREEN_H
|
||||
|
|
|
|||
|
|
@ -72,13 +72,13 @@ struct VectorU32
|
|||
};
|
||||
|
||||
struct PokemonSpecies {
|
||||
/*0x00*/ u16 mainSeriesIndexNumber; // Refers to the generation three internal index number; e.g. Treecko is 0x115 (decimal 227).
|
||||
/*0x00*/ u16 speciesIdRS; // Refers to the generation three internal index number; e.g. Treecko is 0x115 (decimal 227).
|
||||
/*0x02*/ u8 nameJapanese[5];
|
||||
/*0x07*/ u8 name[10]; // Space-padded ASCII
|
||||
/*0x11*/ u8 catchIndex; // Non-zero for all catch pokemon other than Treecko, zero for Treecko and all non-catch pokemon
|
||||
/*0x12*/ u8 eggIndex; // Non-zero for all hatch pokemon other than Wurmple, zero for Wurmple and all non-hatch pokemon
|
||||
/*0x13*/ u8 unk13; // Something egg related; only hatch pokemon have this set to 1, but not all do, and there is no other pattern
|
||||
// unk13 list: Azurill, Skitty, Zubat, Plusle, Minun, Igglybuff, Shuppet, Chimecho, Pichu, Natu
|
||||
/*0x13*/ u8 specialEggFlag; // Something egg related; only hatch pokemon have this set to 1, but not all do, and there is no other pattern
|
||||
// specialEggFlag list: Azurill, Skitty, Zubat, Plusle, Minun, Igglybuff, Shuppet, Chimecho, Pichu, Natu
|
||||
/*0x14*/ s8 evolutionMethod; // Exp, Stone, etc.
|
||||
/*0x15*/ u8 evolutionTarget; // Uses the standard index numbers; e.g. Treecko is 0x00 (SPECIES_TREECKO)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@
|
|||
|
||||
// Place all external variable declarations in this file
|
||||
|
||||
extern struct {u16 unk0[5]; u16 unkA[5];} gUnknown_086A6B14;
|
||||
extern s8 gUnknown_02002850;
|
||||
extern struct ToneData gUnknown_08532D6C[];
|
||||
extern struct ToneData gUnknown_08533360[];
|
||||
extern struct ToneData gUnknown_08533960[];
|
||||
extern struct ToneData gUnknown_08533F60[];
|
||||
extern struct {u16 rubyTransitionFrames[5]; u16 sapphireTransitionFrames[5];} gFieldTransitionAnimData;
|
||||
extern s8 gFieldSelectSoftReset;
|
||||
extern struct ToneData gPokemonCryToneBank0[];
|
||||
extern struct ToneData gPokemonCryToneBank1[];
|
||||
extern struct ToneData gPokemonCryToneBank2[];
|
||||
extern struct ToneData gPokemonCryToneBank3[];
|
||||
extern u16 gOptionsBGMList[];
|
||||
|
||||
/***
|
||||
|
|
@ -47,19 +47,19 @@ extern u16 gOptionsBGMList[];
|
|||
* 2 : unknown
|
||||
* 3 : px wide
|
||||
***/
|
||||
extern u16 gUnknown_086BB910[11][4];
|
||||
extern struct {u8 unk0; s16 unk2;} gUnknown_086BB9B4[];
|
||||
extern u16 gButtonInfoTable[11][4];
|
||||
extern struct {u8 tileId; s16 frameDuration;} gButtonAnimData[];
|
||||
extern u16 gOptionsSEList[];
|
||||
extern u8 gUnknown_02031AF0[][10];
|
||||
extern u8 gCustomButtonConfigs[][10];
|
||||
extern u8 gDefaultButtonConfigs[4][10];
|
||||
extern void (*const gOptionsStateFuncs[])(void);
|
||||
extern u32 gHighScoreNameEntry[HIGH_SCORE_NAME_LENGTH];
|
||||
extern u16 gUnknown_0201A520[3][BG_PLTT_SIZE];
|
||||
extern u16 gUnknown_03000000[];
|
||||
extern u8 gUnknown_03001800[3][0x800];
|
||||
extern u16 gPaletteFadeBuffers[3][BG_PLTT_SIZE];
|
||||
extern u16 gTempGfxBuffer[];
|
||||
extern u8 gEReaderTextTileBuffer[3][0x800];
|
||||
//extern ? gOamBuffer;
|
||||
//extern ? IntrMain_Buffer;
|
||||
extern u16 gUnknown_03005C00[];
|
||||
extern u16 gBG0TilemapBuffer[];
|
||||
//extern ? SoundMainRAM_Buffer;
|
||||
extern u16 sGbPlayerCurKeys;
|
||||
extern u16 sGbPlayerPrevKeys;
|
||||
|
|
@ -72,17 +72,17 @@ struct RfuSIO32Id {
|
|||
u16 lastId;
|
||||
// size 0xC
|
||||
};
|
||||
extern struct RfuSIO32Id gUnknown_02002808;
|
||||
extern u32 gUnknown_02002818;
|
||||
extern u32 gUnknown_0200281C;
|
||||
extern struct RfuSIO32Id gSio32Id;
|
||||
extern u32 gSio32ReceivedData;
|
||||
extern u32 gSio32RemoteDeviceId;
|
||||
//extern ? gTitlescreen;
|
||||
//extern ? gEraseSaveDataAccessStep;
|
||||
//extern ? gEraseSaveDataAccessCounter;
|
||||
//extern ? gEReaderAccessStep;
|
||||
//extern ? gEReaderAccessCounter;
|
||||
//extern ? gUnknown_020028A4;
|
||||
//extern ? gUnknown_020028A5;
|
||||
//extern ? gUnknown_02002958;
|
||||
//extern ? gTitleTransitionActive;
|
||||
//extern ? gTitleRestartDebounce;
|
||||
//extern ? gDpcmSampleBuffer;
|
||||
//extern ? gIntrTable;
|
||||
//extern ? gMain;
|
||||
//extern ? gVBlankIntrFuncPtr;
|
||||
|
|
@ -92,26 +92,26 @@ extern u32 gUnknown_0200281C;
|
|||
//extern ? gUnknown_02017BD4;
|
||||
//extern ? gUnknown_02017BE0;
|
||||
//extern ? gVCountIntrFuncPtr;
|
||||
//extern ? gUnknown_02019BE4;
|
||||
//extern ? gUnknown_02019BE8;
|
||||
//extern ? gUnknown_02019BEC;
|
||||
//extern ? gUnknown_02019BF0;
|
||||
//extern ? gUnknown_02019BF4;
|
||||
//extern ? gUnknown_02019BF8;
|
||||
//extern ? gUnknown_02019BFC;
|
||||
//extern ? gUnknown_02019C00;
|
||||
//extern ? gUnknown_02019C04;
|
||||
//extern ? gUnknown_02019C08;
|
||||
//extern ? gRumbleLoopCounter;
|
||||
//extern ? gRumbleFrameCounter;
|
||||
//extern ? gRumbleMotorMode;
|
||||
//extern ? gSio32ReconnectTimer;
|
||||
//extern ? gSio32SerialEnabled;
|
||||
//extern ? gRumblePatternIndex;
|
||||
//extern ? gRumblePatternPosition;
|
||||
//extern ? gRumbleCommand;
|
||||
//extern ? gRumblePaused;
|
||||
//extern ? gRumbleSpeedMode;
|
||||
//extern ? gGameBoyPlayerEnabled;
|
||||
//extern ? gUnknown_02019C10;
|
||||
//extern ? gSio32CommState;
|
||||
extern s8 gAutoDisplayTitlescreenMenu;
|
||||
//extern ? gUnknown_0201C190;
|
||||
//extern ? gUnknown_0202BE00;
|
||||
//extern ? gUnknown_202BE24;
|
||||
extern s16 gUnknown_0202BEEC;
|
||||
//extern ? gUnknown_0202C588;
|
||||
//extern ? gTitleNoSaveMenuSpriteSets;
|
||||
//extern ? gTitleSavedMenuSpriteSets;
|
||||
//extern ? gTitleReturnedFromMenu;
|
||||
extern s16 gEReaderReceivedCardId;
|
||||
//extern ? gHighScoreEntrySource;
|
||||
//extern ? gCurrentPinballGame;
|
||||
//extern ? gUnknown_02031520;
|
||||
//extern ? gBoardConfig;
|
||||
//extern ? gSoundInfo;
|
||||
//extern ? gPokemonCryMusicPlayers;
|
||||
//extern ? gMPlayJumpTable;
|
||||
|
|
@ -149,22 +149,22 @@ extern const IntrFunc gIntrTableTemplate[14];
|
|||
//extern ? gUnknown_086A4BFC;
|
||||
//extern ? gUnknown_086A4C18;
|
||||
//extern ? gUnknown_086A4C2C;
|
||||
extern const int *gUnknown_086A4C44[];
|
||||
extern const u16 gUnknown_086A4CF8[][3*0x18];
|
||||
extern const s8 gUnknown_086A7FA4[3]; //Sized based on call using gUnknown_02002858.unk1C + data
|
||||
extern const s8 gUnknown_086A7FA8[3]; //Same as above
|
||||
extern const s16 gUnknown_086A964C[11];
|
||||
extern const s8 gUnknown_086A9662[4];
|
||||
extern const s8 gUnknown_086A9666[6][2];
|
||||
extern const s8 gUnknown_086A9672[9][2];
|
||||
extern const u16 gUnknown_086A96A4[4];
|
||||
extern const u16 gUnknown_086A96D4[];
|
||||
extern const struct SpriteSet *const gUnknown_086A96E4[];
|
||||
extern const u8 *const gUnknown_086A96F8[7];
|
||||
extern const u8 *const gUnknown_086A9714[];
|
||||
extern const s8 gUnknown_086A9748[];
|
||||
extern const u8 *const gUnknown_086A975C[7];
|
||||
extern const u8 *const gUnknown_086A9778[];
|
||||
extern const int *gRumblePatterns[];
|
||||
extern const u16 gEReaderTextGlyphTable[][3*0x18];
|
||||
extern const s8 gScorePaletteAnimOffsets[3]; //Sized based on call using gHighScoreScreenState.paletteAnimPhase + data
|
||||
extern const s8 gScorePaletteResetOffsets[3]; //Same as above
|
||||
extern const s16 gTitleMenuStateTable[11];
|
||||
extern const s8 gTitlePressStartAnimDurations[4];
|
||||
extern const s8 gTitleMenuSlideInAnimData[6][2];
|
||||
extern const s8 gTitleMenuSlideOutAnimData[9][2];
|
||||
extern const u16 gTitleNoSaveMenuActions[4];
|
||||
extern const u16 gTitleSavedMenuActions[];
|
||||
extern const struct SpriteSet *const gTitlePressStartSpriteSets[];
|
||||
extern const u8 *const gTitleNoSaveDefaultSprites[7];
|
||||
extern const u8 *const gTitleNoSaveAnimSprites[];
|
||||
extern const s8 gTitleMenuRetractDurations[];
|
||||
extern const u8 *const gTitleSavedDefaultSprites[7];
|
||||
extern const u8 *const gTitleSavedAnimSprites[];
|
||||
extern const s16 gEReaderAccessButtonSequence[];
|
||||
//extern ? gMonPortraitGroupPals;
|
||||
//extern ? gMonPortraitGroupGfx;
|
||||
|
|
@ -174,13 +174,13 @@ extern const s16 gEReaderAccessButtonSequence[];
|
|||
//extern ? gMonHatchSpriteGroup3_Gfx;
|
||||
//extern ? gMonHatchSpriteGroup4_Gfx;
|
||||
extern const u8 gMonHatchSpriteGroup5_Gfx[];
|
||||
extern struct VectorU16 gUnknown_086A6B28[];
|
||||
extern const struct SpriteSet *const gUnknown_086A6AD4[];
|
||||
extern const struct SpriteSet *const gUnknown_086A7DA8[];
|
||||
extern const struct SpriteSet *const gUnknown_086A7DB0[];
|
||||
extern const struct SpriteSet *const gUnknown_086A7DD4[];
|
||||
extern struct VectorU16 gFieldSelectBallSpeedPositions[];
|
||||
extern const struct SpriteSet *const gFieldSelectSpriteSets[];
|
||||
extern const struct SpriteSet *const gNameEntryCursorSpriteSets[];
|
||||
extern const struct SpriteSet *const gHighScoreScreenSpriteSets[];
|
||||
extern const struct SpriteSet *const gCompletionBannerSpriteSets[];
|
||||
extern void (*gFieldSelectStateFuncs[])(void);
|
||||
extern u8 gUnknown_080A2400[];
|
||||
extern u8 gFieldSelectBG0Tilemap[];
|
||||
extern u8 gFieldSelectWindow_Gfx[];
|
||||
//extern ? gUnknown_080A4000;
|
||||
extern u8 gFieldSelectFrameShadowTilemap[];
|
||||
|
|
@ -233,25 +233,25 @@ extern const u16 gTitlescreenSprites_Pals[];
|
|||
//extern ? gMonPortraitsGroup11_Pals;
|
||||
//extern ? gMonPortraitsGroup12_Pals;
|
||||
//extern ? gMonPortraitsGroup13_Pals;
|
||||
extern struct VectorU16 gUnknown_086A9684[4];
|
||||
extern struct VectorU16 gUnknown_086A9694[4];
|
||||
extern struct VectorU16 gUnknown_086A96AC[5];
|
||||
extern struct VectorU16 gUnknown_086A96C0[5];
|
||||
extern const struct VectorU32 gUnknown_080797F0[2][8];
|
||||
extern struct VectorU16 gTitleNoSaveArrowPositions[4];
|
||||
extern struct VectorU16 gTitleNoSaveSelectorPositions[4];
|
||||
extern struct VectorU16 gTitleSavedArrowPositions[5];
|
||||
extern struct VectorU16 gTitleSavedSelectorPositions[5];
|
||||
extern const struct VectorU32 gHighScoreNamePixelPositions[2][8];
|
||||
|
||||
struct Unk086ACD50
|
||||
struct CollisionCorrectionEntry
|
||||
{
|
||||
s8 unk0;
|
||||
s8 unk1;
|
||||
u16 unk2;
|
||||
s8 correctionX;
|
||||
s8 correctionY;
|
||||
u16 angleThreshold;
|
||||
};
|
||||
extern struct Unk086ACD50 gUnknown_086ACD50[8];
|
||||
extern struct Unk086ACD50 gUnknown_086ACD74[3];
|
||||
extern struct CollisionCorrectionEntry gWallCollisionPositionCorrection[8];
|
||||
extern struct CollisionCorrectionEntry gFlipperCollisionAngleCorrection[3];
|
||||
|
||||
extern u16 gUnknown_02019C40[];
|
||||
extern u16 gPokedexVramBuffer[];
|
||||
extern s16 gPokedexNumOwned;
|
||||
extern s16 gPokedexSelectedMon;
|
||||
extern s8 gUnknown_0202ADE4;
|
||||
extern s8 gLinkExchangeResult;
|
||||
extern s16 gPokedexNumSeen;
|
||||
extern s16 gPokedexListPosition;
|
||||
|
||||
|
|
@ -265,27 +265,27 @@ extern u8 gPokedexBackground_Pals[];
|
|||
extern u8 gPokedexSprites_Pals[];
|
||||
extern u8 gPokedexSprites_Gfx[];
|
||||
|
||||
extern s16 gUnknown_0201A448;
|
||||
extern s16 gUnknown_0202BF00;
|
||||
extern s16 gUnknown_0202A57C;
|
||||
extern s16 gUnknown_0201A4F0;
|
||||
extern s16 gUnknown_0202BE20;
|
||||
extern s16 gPokedexAnimatedIconFrame;
|
||||
extern s16 gPokedexAnimatedIconTimer;
|
||||
extern s16 gPokedexCursorOffset;
|
||||
extern s16 gPokedexCursorBlinkOffset;
|
||||
extern s16 gPokedexBlinkTimer;
|
||||
extern s16 gPokedexScrollWaitFrames;
|
||||
extern s8 gUnknown_02019C24;
|
||||
extern s16 gUnknown_0202BF0C;
|
||||
extern s16 gUnknown_0201A440;
|
||||
extern s16 gUnknown_0202BEF4;
|
||||
extern s16 gUnknown_0202A588;
|
||||
extern s16 gUnknown_0202A55C;
|
||||
extern s16 gUnknown_0202A568[2];
|
||||
extern s16 gUnknown_0202C5E8;
|
||||
extern s16 gUnknown_0202A558;
|
||||
extern s8 gUnknown_0202BEE0;
|
||||
extern s8 gUnknown_0202BF04;
|
||||
extern s16 gUnknown_0202BF14;
|
||||
extern s8 gUnknown_0202C590;
|
||||
extern s16 gUnknown_0201B120;
|
||||
extern s8 gUnknown_0202BEC4;
|
||||
extern s8 gPokedexScrollActive;
|
||||
extern s16 gPokedexSpriteAnimFrame;
|
||||
extern s16 gPokedexSpriteAnimTimer;
|
||||
extern s16 gPokedexPageIndicatorTimer;
|
||||
extern s16 gPokedexShowAnimSprite;
|
||||
extern s16 gPokedexShowPortrait;
|
||||
extern s16 gPokedexShowCatchHatch[2];
|
||||
extern s16 gPokedexDetailFrameCount;
|
||||
extern s16 gPokedexInfoWindowSlideStep;
|
||||
extern s8 gPokedexButtonPromptFrame;
|
||||
extern s8 gPokedexShowButtonPrompt;
|
||||
extern s16 gPokedexSpriteCategory;
|
||||
extern s8 gPokedexShowLinkCableIcon;
|
||||
extern s16 gPokedexLinkStateTimer;
|
||||
extern s8 gPokedexShowPopupWindow;
|
||||
|
||||
/****
|
||||
* Yellow confirmation/info window mode
|
||||
|
|
@ -295,135 +295,135 @@ extern s8 gUnknown_0202BEC4;
|
|||
* 3= transfer complete?
|
||||
* 4= delete save data confirmation
|
||||
* ****/
|
||||
extern s8 Pokedex_PopupTypeIx;
|
||||
extern s8 gPokedexPopupTypeIndex;
|
||||
extern s8 gPokedex_EraseSaveDataAccessCounter;
|
||||
extern s8 gPokedex_EraseSaveDataAccessStep;
|
||||
extern s8 gUnknown_0202C794;
|
||||
extern s8 gUnknown_0201C1B4;
|
||||
extern s8 gUnknown_0202C5AC;
|
||||
extern s8 gUnknown_02019C28;
|
||||
extern s8 gPokedexDescriptionPage;
|
||||
extern s8 gPokedexShowPageIndicator;
|
||||
extern s8 gPokedexPageIndicatorBlink;
|
||||
extern s8 gPokedexSpriteIndexBase;
|
||||
extern s16 gPokedexFlags[];
|
||||
extern s16 gPokedexFlagExchangeBuffer[];
|
||||
extern s16 gPokedexListEntryCount;
|
||||
|
||||
extern u32 gUnknown_0201B170;
|
||||
extern u32 gUnknown_0202BED8;
|
||||
extern u32 gMergedSapphireScoreIndex;
|
||||
extern u32 gMergedRubyScoreIndex;
|
||||
|
||||
extern u16 gDexInfoWindowEmptyTextRowTiles[];
|
||||
extern u16 gDexInfoWindowMiddleRowTiles[];
|
||||
extern u16 gDexInfoWindowBottomRowTiles[];
|
||||
extern u16 gDexInfoWindowEmptyRowTiles[];
|
||||
extern u16 gUnknown_0202A590[];
|
||||
extern u16 gUnknown_08086B40[];
|
||||
extern u16 gUnknown_083722E8[0x4000];
|
||||
extern u16 gPokedexInfoWindowBackupTiles[];
|
||||
extern u16 gPokedexInfoWindowTiles[];
|
||||
extern u16 gRayquazaBodyCollisionMap[0x4000];
|
||||
extern s16 gDexAnimationIx[];
|
||||
extern s16 gTitleRevealJingle[][10][2];
|
||||
extern u8 gUnknown_0201B124;
|
||||
extern u8 gLinkExchangeStep;
|
||||
|
||||
extern const struct PokemonSpecies gSpeciesInfo[];
|
||||
extern const struct SpriteSet * const gUnknown_086A54D8[13];
|
||||
extern const struct SpriteSet * const gCatchHatchSpriteSets[13];
|
||||
extern u8 (*gMonHatchSpriteGroupGfx[])[0x10E0];
|
||||
extern u8 (*gMonHatchSpriteGroupPals[])[0x20];
|
||||
|
||||
extern u32 gUnknown_0202ADD0;
|
||||
extern s16 gUnknown_0202C5F0[];
|
||||
extern u16 gUnknown_0201A4D0[][2];
|
||||
extern u32 gUnknown_0202BDF0;
|
||||
extern u8 gUnknown_0201C1AC;
|
||||
extern u8 gUnknown_0202ADDC;
|
||||
extern u16 gUnknown_0201A510;
|
||||
extern s16 gUnknown_0201A444;
|
||||
extern s8 gUnknown_0201B128;
|
||||
extern s8 gUnknown_0202A564;
|
||||
extern s8 gUnknown_02019C20;
|
||||
extern s8 gUnknown_0202ADE8;
|
||||
extern u32 gLinkStatusResult;
|
||||
extern s16 gLinkSendBuffer[];
|
||||
extern u16 gLinkRecvBuffer[][2];
|
||||
extern u32 gLinkConnectionState;
|
||||
extern u8 gLinkPlayerCount;
|
||||
extern u8 gLinkNegotiationFlags;
|
||||
extern u16 gLinkExchangeFrameCounter;
|
||||
extern s16 gLinkTimeoutCounter;
|
||||
extern s8 gPokedexLinkTransferPhase;
|
||||
extern s8 gEReaderLinkHandshakeStarted;
|
||||
extern s8 gEReaderLinkDataReceived;
|
||||
extern s8 gEReaderLinkAckSent;
|
||||
|
||||
extern const u16 gUnknown_086A7FAC[];
|
||||
extern s16 gUnknown_0202C5C0[];
|
||||
extern const u16 gHighScoreCharToTileMap[];
|
||||
extern s16 gScoreDigitBuffer[];
|
||||
|
||||
struct unkStruct_8079730
|
||||
struct HighScoreNamePosition
|
||||
{
|
||||
u32 unk0;
|
||||
u32 unk4;
|
||||
u32 unk8;
|
||||
u32 yBaseOffset;
|
||||
u32 yPixelPosition;
|
||||
u32 fieldWidth;
|
||||
};
|
||||
extern const struct unkStruct_8079730 gUnknown_08079730[][8];
|
||||
extern const struct HighScoreNamePosition gHighScoreNamePositions[][8];
|
||||
|
||||
extern struct Vector16 gUnknown_086A7768[0x8];
|
||||
extern s16 gUnknown_086A7788[0x8];
|
||||
extern s16 gUnknown_0202ADA0[];
|
||||
extern s32 gUnknown_0202BEF0;
|
||||
extern const struct SpriteSet *const gUnknown_086A769C[];
|
||||
extern struct Vector16 gIntroScene1_BGAnimTiming[0x8];
|
||||
extern s16 gIntroScene1_TileOffsets[0x8];
|
||||
extern s16 gIntroBGParams[];
|
||||
extern s32 gIntroPalFadeLevel;
|
||||
extern const struct SpriteSet *const gIntroScene1_SpriteSets[];
|
||||
extern struct SpriteGroup gMain_spriteGroups_40[];
|
||||
extern struct SpriteGroup gMain_spriteGroups_48;
|
||||
extern struct Vector16 gUnknown_086A7798[0x4];
|
||||
extern s32 gUnknown_0201C188;
|
||||
extern struct Vector16 gIntroScene1_ScaleOffsets[0x4];
|
||||
extern s32 gIntroScaleY;
|
||||
|
||||
extern const struct SpriteSet *const gUnknown_086A795C[];
|
||||
extern const struct SpriteSet *const gUnknown_086A79EC[];
|
||||
extern u8 gUnknown_080E1540[];
|
||||
extern u8 gUnknown_080E1740[];
|
||||
extern const struct SpriteSet *const gIntroScene3_SpriteSets[];
|
||||
extern const struct SpriteSet *const gIntroScene5_SpriteSets[];
|
||||
extern u8 gIntroScene4_Pal[];
|
||||
extern u8 gIntroScene4_BG3Tilemap[];
|
||||
extern u8 gIntroScene4Sprites_Gfx[];
|
||||
extern u8 gUnknown_080E5F60[];
|
||||
extern u8 gUnknown_080E7F60[];
|
||||
extern u8 gIntroScene4_BG0Tiles[];
|
||||
extern u8 gIntroScene4_BG1Tiles[];
|
||||
|
||||
extern u16 gUnknown_03002300[];
|
||||
extern u16 gTextTilemapBuffer[];
|
||||
|
||||
extern u8 gUnknown_080E9F60[];
|
||||
extern u8 gUnknown_080EA160[];
|
||||
extern u8 gUnknown_080EB160[];
|
||||
extern u8 gUnknown_080EC160[];
|
||||
extern u8 gIntroScene5_Pal[];
|
||||
extern u8 gIntroScene5_BG2Tilemap[];
|
||||
extern u8 gIntroScene5_BG1Tiles[];
|
||||
extern u8 gIntroScene5_BG3Tilemap[];
|
||||
extern u8 gIntroScene5Text_Gfx[];
|
||||
extern u8 gUnknown_080F1980[];
|
||||
extern u8 gIntroScene5_BG0Tiles[];
|
||||
extern u8 gIntroScene5Sprites_Gfx[];
|
||||
extern s16 gUnknown_086A7A1C[];
|
||||
extern s16 gIntroScene5_TileOffsets[];
|
||||
|
||||
extern s8 gUnknown_0202C548;
|
||||
extern s8 gUnknown_0202BEB4;
|
||||
extern s8 gIntroScene6VelocityIndex;
|
||||
extern s8 gIntroScene6EntitySpawnIndex;
|
||||
|
||||
extern u8 gUnknown_080F61A0[];
|
||||
extern u8 gUnknown_080F63A0[];
|
||||
extern u8 gIntroScene6_Pal[];
|
||||
extern u8 gIntroScene6_BG3Tilemap[];
|
||||
extern u8 gIntroScene6Sprites_Gfx[];
|
||||
extern u8 gUnknown_080FCFC0[];
|
||||
extern u8 gUnknown_080FD7C0[];
|
||||
extern u8 gUnknown_080FDFC0[];
|
||||
extern u8 gIntroScene6_BG2Tilemap[];
|
||||
extern u8 gIntroScene6_BG0Tilemap[];
|
||||
extern u8 gIntroScene6_BG1Tiles[];
|
||||
extern u8 gIntroScene6Stars_Gfx[];
|
||||
|
||||
extern u8 gUnknown_086A7AE4[];
|
||||
extern const struct SpriteSet *const gUnknown_086A7A78[];
|
||||
extern u8 gIntroScene6_BounceFlags[];
|
||||
extern const struct SpriteSet *const gIntroScene6_SpriteSets[];
|
||||
|
||||
extern s16 gUnknown_0202C5E4;
|
||||
extern s16 gUnknown_0202ADD8;
|
||||
extern const struct SpriteSet *const gUnknown_086A7B74[];
|
||||
extern const struct SpriteSetTableEntry gUnknown_086B155C[];
|
||||
extern u8 gUnknown_08100FE0[];
|
||||
extern u8 gUnknown_081011E0[];
|
||||
extern s16 gIntroWailmerScaleX;
|
||||
extern s16 gIntroWailmerScaleY;
|
||||
extern const struct SpriteSet *const gIntroScene7_SpriteSets[];
|
||||
extern const struct SpriteSetTableEntry gFieldSpriteSets[];
|
||||
extern u8 gIntroScene7_Pal[];
|
||||
extern u8 gIntroScene7_BG3Tilemap[];
|
||||
extern u8 gIntroScene7Sprites_Gfx[];
|
||||
extern u8 gUnknown_08106A00[];
|
||||
extern u8 gUnknown_08108A00[];
|
||||
extern u8 gUnknown_0810AA00[];
|
||||
extern u8 gIntroScene7_BG2Tiles[];
|
||||
extern u8 gIntroScene7_BG0Tiles[];
|
||||
extern u8 gIntroScene7_BG1Tiles[];
|
||||
extern u8 gIntroScene7Wailmer_Gfx[];
|
||||
|
||||
extern s8 gUnknown_0201A4BC;
|
||||
extern s8 gLinkExchangeSendPhase;
|
||||
|
||||
extern u8 gUnknown_0810EA20[];
|
||||
extern u8 gUnknown_0810EC20[];
|
||||
extern u8 gIntroScene8a_Pal[];
|
||||
extern u8 gIntroScene8a_BG2Tilemap[];
|
||||
extern u8 gIntroScene7Explosion_Gfx[];
|
||||
extern u8 gIntroScene7WailmerLaunch_Gfx[];
|
||||
|
||||
extern s8 gUnknown_086A7D4C[];
|
||||
extern s8 gUnknown_0202BEDC;
|
||||
extern s8 gUnknown_0202A56C;
|
||||
extern s8 gIntroScene8b_BallDecelTable[];
|
||||
extern s8 gIntroObjWhiteFlash;
|
||||
extern s8 gIntroBGWhiteFlash;
|
||||
|
||||
extern u8 gUnknown_08115860[];
|
||||
extern u8 gUnknown_08115A60[];
|
||||
extern u8 gIntroScene8b_Pal[];
|
||||
extern u8 gIntroScene8b_BG3Tilemap[];
|
||||
extern u8 gIntroScene8Clouds_Gfx[];
|
||||
extern u8 gIntroScene8Ball_Gfx[];
|
||||
|
||||
extern u16 gCommonAndEggWeights[];
|
||||
extern u16 gMain_saveData_pokedexFlags_90[10];
|
||||
extern u16 Sio32ConnectionData[4];
|
||||
extern u32 gUnknown_02002814;
|
||||
extern u32 gSio32SendData;
|
||||
|
||||
/*
|
||||
Note: gMain lives at gUnknown_0200B0C0 in running memory.
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ void RubyBoardProcess_0A_50848(void)
|
|||
gMain.spriteGroups[52].available = 1;
|
||||
gMain.spriteGroups[62].available = 1;
|
||||
LoadSpriteSets(
|
||||
gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
|
|
@ -43,21 +43,21 @@ void RubyBoardProcess_0B_50918(void)
|
|||
for (i = 51; i < 67; i++)
|
||||
gMain.spriteGroups[i].available = 0;
|
||||
|
||||
gCurrentPinballGame->unk1BC = gMain.systemFrameCount % 25;
|
||||
if (gCurrentPinballGame->unk68 < 110)
|
||||
gCurrentPinballGame->randomSpriteVariantSeed = gMain.systemFrameCount % 25;
|
||||
if (gCurrentPinballGame->cameraYViewport < 110)
|
||||
{
|
||||
gMain.spriteGroups[65].available = 1;
|
||||
gMain.spriteGroups[71].available = 1;
|
||||
gMain.spriteGroups[66].available = 1;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk68 < 168)
|
||||
if (gCurrentPinballGame->cameraYViewport < 168)
|
||||
{
|
||||
gMain.spriteGroups[48].available = 1;
|
||||
gMain.spriteGroups[52].available = 1;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk68 < 220)
|
||||
if (gCurrentPinballGame->cameraYViewport < 220)
|
||||
{
|
||||
gMain.spriteGroups[51].available = 1;
|
||||
gMain.spriteGroups[61].available = 1;
|
||||
|
|
@ -68,22 +68,22 @@ void RubyBoardProcess_0B_50918(void)
|
|||
gMain.spriteGroups[62].available = 1;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk68 > 63)
|
||||
if (gCurrentPinballGame->cameraYViewport > 63)
|
||||
{
|
||||
gMain.spriteGroups[53].available = 1;
|
||||
gMain.spriteGroups[57].available = 1;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk68 > 115)
|
||||
if (gCurrentPinballGame->cameraYViewport > 115)
|
||||
gMain.spriteGroups[58].available = 1;
|
||||
|
||||
if (gCurrentPinballGame->unk68 > 130)
|
||||
if (gCurrentPinballGame->cameraYViewport > 130)
|
||||
{
|
||||
gMain.spriteGroups[59].available = 1;
|
||||
gMain.spriteGroups[60].available = 1;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk68 > 216)
|
||||
if (gCurrentPinballGame->cameraYViewport > 216)
|
||||
{
|
||||
gMain.spriteGroups[56].available = 1;
|
||||
gMain.spriteGroups[54].available = 1;
|
||||
|
|
@ -93,8 +93,8 @@ void RubyBoardProcess_0B_50918(void)
|
|||
}
|
||||
|
||||
LoadSpriteSets(
|
||||
gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
|
|
@ -116,8 +116,8 @@ void SapphireBoardProcess_0A_50AD4(void)
|
|||
gMain.spriteGroups[2].available = 1;
|
||||
gMain.spriteGroups[25].available = 1;
|
||||
gMain.spriteGroups[85].available = 1;
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
|
|
@ -136,27 +136,27 @@ void SapphireBoardProcess_0B_50B80(void)
|
|||
gMain.spriteGroups[75].available = 0;
|
||||
gMain.spriteGroups[10].available = 0;
|
||||
gMain.spriteGroups[11].available = 0;
|
||||
gCurrentPinballGame->unk1BC = gMain.systemFrameCount % 25;
|
||||
if (gCurrentPinballGame->unk68 < 90)
|
||||
gCurrentPinballGame->randomSpriteVariantSeed = gMain.systemFrameCount % 25;
|
||||
if (gCurrentPinballGame->cameraYViewport < 90)
|
||||
{
|
||||
gMain.spriteGroups[52].available = 1;
|
||||
gMain.spriteGroups[51].available = 1;
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 < 220)
|
||||
if (gCurrentPinballGame->cameraYViewport < 220)
|
||||
{
|
||||
gMain.spriteGroups[72].available = 1;
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 < 150)
|
||||
if (gCurrentPinballGame->cameraYViewport < 150)
|
||||
{
|
||||
gMain.spriteGroups[60].available = 1;
|
||||
gMain.spriteGroups[69].available = 1;
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 < 196)
|
||||
if (gCurrentPinballGame->cameraYViewport < 196)
|
||||
{
|
||||
gMain.spriteGroups[63].available = 1;
|
||||
gMain.spriteGroups[75].available = 1;
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 < 202)
|
||||
if (gCurrentPinballGame->cameraYViewport < 202)
|
||||
{
|
||||
gMain.spriteGroups[61].available = 1;
|
||||
gMain.spriteGroups[58].available = 1;
|
||||
|
|
@ -164,7 +164,7 @@ void SapphireBoardProcess_0B_50B80(void)
|
|||
gMain.spriteGroups[59].available = 1;
|
||||
gMain.spriteGroups[76].available = 1;
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 > 118)
|
||||
if (gCurrentPinballGame->cameraYViewport > 118)
|
||||
{
|
||||
gMain.spriteGroups[70].available = 1;
|
||||
gMain.spriteGroups[26].available = 1;
|
||||
|
|
@ -174,7 +174,7 @@ void SapphireBoardProcess_0B_50B80(void)
|
|||
gMain.spriteGroups[66].available = 1;
|
||||
gMain.spriteGroups[67].available = 1;
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 > 216)
|
||||
if (gCurrentPinballGame->cameraYViewport > 216)
|
||||
{
|
||||
gMain.spriteGroups[57].available = 1;
|
||||
gMain.spriteGroups[55].available = 1;
|
||||
|
|
@ -183,7 +183,7 @@ void SapphireBoardProcess_0B_50B80(void)
|
|||
gMain.spriteGroups[11].available = 1;
|
||||
}
|
||||
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets, gUnknown_086B155C[gMain.selectedField].numSpriteSets, gMain.spriteGroups);
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets, gFieldSpriteSets[gMain.selectedField].numSpriteSets, gMain.spriteGroups);
|
||||
}
|
||||
|
||||
void DusclopsBoardProcess_0A_50D48(void)
|
||||
|
|
@ -198,17 +198,17 @@ void DusclopsBoardProcess_0A_50D48(void)
|
|||
gMain.spriteGroups[i].available = 0;
|
||||
}
|
||||
|
||||
gMain.unk44[0]->available = 1;
|
||||
gMain.fieldSpriteGroups[0]->available = 1;
|
||||
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
void DusclopsBoardProcess_0B_50DB8(void)
|
||||
{
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ void KecleonBoardProcess_0A_50DE0(void)
|
|||
gMain.spriteGroups[i].available = 0;
|
||||
}
|
||||
|
||||
gMain.unk44[0]->available = 1;
|
||||
gMain.fieldSpriteGroups[0]->available = 1;
|
||||
gMain.spriteGroups[23].available = 1;
|
||||
gMain.spriteGroups[9].available = 1;
|
||||
gMain.spriteGroups[24].available = 1;
|
||||
|
|
@ -251,8 +251,8 @@ void KecleonBoardProcess_0A_50DE0(void)
|
|||
gMain.spriteGroups[30].available = 1;
|
||||
|
||||
LoadSpriteSets(
|
||||
gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups
|
||||
);
|
||||
}
|
||||
|
|
@ -272,7 +272,7 @@ void KyogreBoardProcess_0A_50F04()
|
|||
gMain.spriteGroups[i].available = 0;
|
||||
}
|
||||
|
||||
gMain.unk44[0]->available = 1;
|
||||
gMain.fieldSpriteGroups[0]->available = 1;
|
||||
gMain.spriteGroups[11].available = 1;
|
||||
gMain.spriteGroups[12].available = 1;
|
||||
gMain.spriteGroups[13].available = 1;
|
||||
|
|
@ -282,15 +282,15 @@ void KyogreBoardProcess_0A_50F04()
|
|||
gMain.spriteGroups[23].available = 1;
|
||||
gMain.spriteGroups[15].available = 1;
|
||||
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
void KyogreBoardProcess_0B_50FAC(void)
|
||||
{
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
|
|
@ -307,22 +307,22 @@ void GroudonBoardProcess_0A_50FD4(void)
|
|||
}
|
||||
}
|
||||
|
||||
gMain.unk44[0]->available = 1;
|
||||
gMain.fieldSpriteGroups[0]->available = 1;
|
||||
gMain.spriteGroups[11].available = 1;
|
||||
gMain.spriteGroups[12].available = 1;
|
||||
gMain.spriteGroups[13].available = 1;
|
||||
gMain.spriteGroups[14].available = 1;
|
||||
gMain.spriteGroups[29].available = 1;
|
||||
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
void GroudonBoardProcess_0B_51068(void)
|
||||
{
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
|
|
@ -338,22 +338,22 @@ void RayquazaBoardProcess_0A_51090(void)
|
|||
gMain.spriteGroups[i].available = 0;
|
||||
}
|
||||
|
||||
gMain.unk44[0]->available = 1;
|
||||
gMain.fieldSpriteGroups[0]->available = 1;
|
||||
gMain.spriteGroups[42].available = 1;
|
||||
gMain.spriteGroups[11].available = 1;
|
||||
gMain.spriteGroups[12].available = 1;
|
||||
gMain.spriteGroups[13].available = 1;
|
||||
gMain.spriteGroups[21].available = 1;
|
||||
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
void RayquazaBoardProcess_0B_51128(void)
|
||||
{
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
|
|
@ -369,7 +369,7 @@ void SphealBoardProcess_0A_51150(void)
|
|||
gMain.spriteGroups[i].available = 0;
|
||||
}
|
||||
|
||||
gMain.unk44[0]->available = 1;
|
||||
gMain.fieldSpriteGroups[0]->available = 1;
|
||||
gMain.spriteGroups[18].available = 1;
|
||||
gMain.spriteGroups[21].available = 1;
|
||||
gMain.spriteGroups[22].available = 1;
|
||||
|
|
@ -378,14 +378,14 @@ void SphealBoardProcess_0A_51150(void)
|
|||
gMain.spriteGroups[16].available = 1;
|
||||
gMain.spriteGroups[17].available = 1;
|
||||
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
||||
void SphealBoardProcess_0B_511F8(void)
|
||||
{
|
||||
LoadSpriteSets(gUnknown_086B155C[gMain.selectedField].spriteSets,
|
||||
gUnknown_086B155C[gMain.selectedField].numSpriteSets,
|
||||
LoadSpriteSets(gFieldSpriteSets[gMain.selectedField].spriteSets,
|
||||
gFieldSpriteSets[gMain.selectedField].numSpriteSets,
|
||||
gMain.spriteGroups);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,33 +7,33 @@
|
|||
|
||||
void AllBoardProcess_1A_47100(void)
|
||||
{
|
||||
gCurrentPinballGame->unkFC = 128;
|
||||
gCurrentPinballGame->bonusSummarySlideY = 128;
|
||||
}
|
||||
|
||||
void sub_47110(void)
|
||||
void ClearBG0Tilemap(void)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
for (i = 0; i < 0x800; i++)
|
||||
gUnknown_03005C00[i] = 0x1FF;
|
||||
gBG0TilemapBuffer[i] = 0x1FF;
|
||||
|
||||
DmaCopy16(3, gUnknown_03005C00, (void *)0x06002000, 0x1000);
|
||||
DmaCopy16(3, gBG0TilemapBuffer, (void *)0x06002000, 0x1000);
|
||||
}
|
||||
|
||||
|
||||
void AllBoardProcess_1B_47160(void)
|
||||
{
|
||||
if (JOY_NEW(START_BUTTON) && gMain.mainState != STATE_GAME_IDLE && gCurrentPinballGame->unk1100 == 0)
|
||||
if (JOY_NEW(START_BUTTON) && gMain.mainState != STATE_GAME_IDLE && gCurrentPinballGame->startButtonDisabled == 0)
|
||||
{
|
||||
if (gMain.modeChangeFlags & MODE_CHANGE_PAUSE)
|
||||
{
|
||||
gMain.modeChangeFlags &= ~MODE_CHANGE_PAUSE;
|
||||
sub_497BC();
|
||||
UnpauseGame();
|
||||
}
|
||||
else if ((gMain.modeChangeFlags & MODE_CHANGE_END_OF_GAME) == 0)
|
||||
{
|
||||
gMain.modeChangeFlags |= MODE_CHANGE_PAUSE;
|
||||
sub_495A0();
|
||||
PauseGame();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -42,59 +42,59 @@ void AllBoardProcess_1B_47160(void)
|
|||
{
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gCurrentPinballGame->unk1104 ^= 1;
|
||||
gCurrentPinballGame->pauseMenuCursorIndex ^= 1;
|
||||
m4aSongNumStart(SE_UNKNOWN_0xA3);
|
||||
}
|
||||
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gCurrentPinballGame->unk1104 ^= 1;
|
||||
gCurrentPinballGame->pauseMenuCursorIndex ^= 1;
|
||||
m4aSongNumStart(SE_UNKNOWN_0xA3);
|
||||
}
|
||||
|
||||
if (JOY_NEW(A_BUTTON) && !JOY_HELD(B_BUTTON | SELECT_BUTTON | START_BUTTON))
|
||||
{
|
||||
if (gCurrentPinballGame->unk1104 == 0)
|
||||
if (gCurrentPinballGame->pauseMenuCursorIndex == 0)
|
||||
{
|
||||
gMain.unkE = 2;
|
||||
sub_49850();
|
||||
gMain.gameExitState = 2;
|
||||
PositionPauseMenuSprites();
|
||||
}
|
||||
|
||||
gMain.modeChangeFlags &= ~MODE_CHANGE_PAUSE;
|
||||
sub_497BC();
|
||||
UnpauseGame();
|
||||
gMain.newKeys &= ~A_BUTTON;
|
||||
}
|
||||
|
||||
if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
gMain.modeChangeFlags &= ~MODE_CHANGE_PAUSE;
|
||||
sub_497BC();
|
||||
UnpauseGame();
|
||||
gMain.newKeys &= ~B_BUTTON;
|
||||
}
|
||||
|
||||
if (gMain.modeChangeFlags & MODE_CHANGE_PAUSE)
|
||||
sub_49A34();
|
||||
AnimatePauseMenuOverlay();
|
||||
}
|
||||
|
||||
//Game is not paused
|
||||
if (gMain.modeChangeFlags == MODE_CHANGE_NONE)
|
||||
{
|
||||
gCurrentPinballGame->unk740 = 0;
|
||||
if (gMain.unk14 != 0)
|
||||
gCurrentPinballGame->debugMenuSelection = 0;
|
||||
if (gMain.modeChangeDelayTimer != 0)
|
||||
{
|
||||
gMain.unk14--;
|
||||
if (gMain.unk14 == 1)
|
||||
gMain.modeChangeDelayTimer--;
|
||||
if (gMain.modeChangeDelayTimer == 1)
|
||||
{
|
||||
if (gCurrentPinballGame->unkE4)
|
||||
gMain.unk14 = 10;
|
||||
else if (gMain.unk11 == 0x8)
|
||||
gCurrentPinballGame->unkE4 = 19;
|
||||
if (gCurrentPinballGame->activePortraitType)
|
||||
gMain.modeChangeDelayTimer = 10;
|
||||
else if (gMain.pendingModeChangeType == 0x8)
|
||||
gCurrentPinballGame->activePortraitType = 19;
|
||||
else
|
||||
gCurrentPinballGame->unkE4 = 20;
|
||||
gCurrentPinballGame->activePortraitType = 20;
|
||||
}
|
||||
|
||||
if (gMain.unk14 == 0)
|
||||
gMain.modeChangeFlags = gMain.unk11;
|
||||
if (gMain.modeChangeDelayTimer == 0)
|
||||
gMain.modeChangeFlags = gMain.pendingModeChangeType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,20 +26,20 @@ void AllBoardProcess_2A_4D6C4(void)
|
|||
|
||||
if (gMain.selectedField < MAIN_FIELD_COUNT)
|
||||
{
|
||||
gCurrentPinballGame->unk5FC = var1 - 244;
|
||||
gCurrentPinballGame->unk5FE = 0;
|
||||
gCurrentPinballGame->unk5FB = 0;
|
||||
gCurrentPinballGame->unk4C = gUnknown_02031520.unk14.unk14;
|
||||
gCurrentPinballGame->unk4E = gUnknown_02031520.unk14.unk16;
|
||||
gCurrentPinballGame->unk54 = gUnknown_02031520.unk14.unk16 << 8;
|
||||
gCurrentPinballGame->unk58 = gCurrentPinballGame->unk4C;
|
||||
gCurrentPinballGame->unk5A = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk5FC;
|
||||
gMain.bgOffsets[2].xOffset = gCurrentPinballGame->unk4C + var0;
|
||||
gMain.bgOffsets[2].yOffset = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk5FC;
|
||||
gMain.bgOffsets[3].xOffset = gCurrentPinballGame->unk4C + var0;
|
||||
gMain.bgOffsets[3].yOffset = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk5FC;
|
||||
gMain.bgOffsets[1].xOffset = gCurrentPinballGame->unk4C + var0;
|
||||
gMain.bgOffsets[1].yOffset = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk5FC;
|
||||
gCurrentPinballGame->cameraScrollOffset = var1 - 244;
|
||||
gCurrentPinballGame->cameraScrollTarget = 0;
|
||||
gCurrentPinballGame->cameraScrollEnabled = 0;
|
||||
gCurrentPinballGame->cameraBaseX = gBoardConfig.fieldLayout.cameraStartX;
|
||||
gCurrentPinballGame->cameraBaseY = gBoardConfig.fieldLayout.cameraStartY;
|
||||
gCurrentPinballGame->cameraYQ8 = gBoardConfig.fieldLayout.cameraStartY << 8;
|
||||
gCurrentPinballGame->cameraXOffset = gCurrentPinballGame->cameraBaseX;
|
||||
gCurrentPinballGame->cameraYOffset = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->cameraScrollOffset;
|
||||
gMain.bgOffsets[2].xOffset = gCurrentPinballGame->cameraBaseX + var0;
|
||||
gMain.bgOffsets[2].yOffset = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->cameraScrollOffset;
|
||||
gMain.bgOffsets[3].xOffset = gCurrentPinballGame->cameraBaseX + var0;
|
||||
gMain.bgOffsets[3].yOffset = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->cameraScrollOffset;
|
||||
gMain.bgOffsets[1].xOffset = gCurrentPinballGame->cameraBaseX + var0;
|
||||
gMain.bgOffsets[1].yOffset = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->cameraScrollOffset;
|
||||
if (gMain.selectedField == FIELD_RUBY)
|
||||
{
|
||||
if ((gCurrentPinballGame->numCompletedBonusStages / 5) % 2 == 0)
|
||||
|
|
@ -57,35 +57,35 @@ void AllBoardProcess_2A_4D6C4(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk5FC = 0;
|
||||
gCurrentPinballGame->unk5FE = 0;
|
||||
gCurrentPinballGame->unk5FB = 0;
|
||||
gCurrentPinballGame->cameraScrollOffset = 0;
|
||||
gCurrentPinballGame->cameraScrollTarget = 0;
|
||||
gCurrentPinballGame->cameraScrollEnabled = 0;
|
||||
if (gMain.selectedField <= FIELD_KECLEON)
|
||||
gCurrentPinballGame->unkE6 = -24;
|
||||
gCurrentPinballGame->cameraYAdjust = -24;
|
||||
else if (gMain.selectedField == FIELD_RAYQUAZA)
|
||||
gCurrentPinballGame->unkE6 = -88;
|
||||
gCurrentPinballGame->cameraYAdjust = -88;
|
||||
else
|
||||
gCurrentPinballGame->unkE6 = -64;
|
||||
gCurrentPinballGame->cameraYAdjust = -64;
|
||||
|
||||
gCurrentPinballGame->unk4C = gUnknown_02031520.unk14.unk14;
|
||||
gCurrentPinballGame->unk4E = gUnknown_02031520.unk14.unk16 + gCurrentPinballGame->unkE6;
|
||||
gCurrentPinballGame->unk54 = gUnknown_02031520.unk14.unk16 << 8;
|
||||
gCurrentPinballGame->unk58 = gCurrentPinballGame->unk4C;
|
||||
gCurrentPinballGame->unk5A = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk5FC;
|
||||
gMain.bgOffsets[2].xOffset = gCurrentPinballGame->unk4C + var0;
|
||||
gMain.bgOffsets[2].yOffset = gCurrentPinballGame->unk4E;
|
||||
gMain.bgOffsets[3].xOffset = gCurrentPinballGame->unk4C + var0;
|
||||
gMain.bgOffsets[3].yOffset = gCurrentPinballGame->unk4E;
|
||||
gMain.bgOffsets[1].xOffset = gCurrentPinballGame->unk4C + var0;
|
||||
gMain.bgOffsets[1].yOffset = gCurrentPinballGame->unk4E / 2;
|
||||
gCurrentPinballGame->cameraBaseX = gBoardConfig.fieldLayout.cameraStartX;
|
||||
gCurrentPinballGame->cameraBaseY = gBoardConfig.fieldLayout.cameraStartY + gCurrentPinballGame->cameraYAdjust;
|
||||
gCurrentPinballGame->cameraYQ8 = gBoardConfig.fieldLayout.cameraStartY << 8;
|
||||
gCurrentPinballGame->cameraXOffset = gCurrentPinballGame->cameraBaseX;
|
||||
gCurrentPinballGame->cameraYOffset = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->cameraScrollOffset;
|
||||
gMain.bgOffsets[2].xOffset = gCurrentPinballGame->cameraBaseX + var0;
|
||||
gMain.bgOffsets[2].yOffset = gCurrentPinballGame->cameraBaseY;
|
||||
gMain.bgOffsets[3].xOffset = gCurrentPinballGame->cameraBaseX + var0;
|
||||
gMain.bgOffsets[3].yOffset = gCurrentPinballGame->cameraBaseY;
|
||||
gMain.bgOffsets[1].xOffset = gCurrentPinballGame->cameraBaseX + var0;
|
||||
gMain.bgOffsets[1].yOffset = gCurrentPinballGame->cameraBaseY / 2;
|
||||
if (gMain.selectedField == FIELD_KECLEON)
|
||||
gMain.bgOffsets[3].xOffset = gMain.bgOffsets[2].xOffset + (gCurrentPinballGame->unk290 & 0x7FF) / 8;
|
||||
gMain.bgOffsets[3].xOffset = gMain.bgOffsets[2].xOffset + (gCurrentPinballGame->globalAnimFrameCounter & 0x7FF) / 8;
|
||||
}
|
||||
|
||||
gMain.bgOffsets[0].yOffset = 80;
|
||||
gCurrentPinballGame->unkCC = gMain.bgOffsets[3].yOffset;
|
||||
gCurrentPinballGame->unkCA = gCurrentPinballGame->unkCC;
|
||||
gCurrentPinballGame->unk2C = 0x1000;
|
||||
gCurrentPinballGame->scrollEffectY = gMain.bgOffsets[3].yOffset;
|
||||
gCurrentPinballGame->scrollEffectX = gCurrentPinballGame->scrollEffectY;
|
||||
gCurrentPinballGame->cameraLookAhead = 0x1000;
|
||||
}
|
||||
|
||||
void MainBoardProcess_2B_4D960(void)
|
||||
|
|
@ -98,35 +98,35 @@ void MainBoardProcess_2B_4D960(void)
|
|||
|
||||
var0 = 0x1000;
|
||||
if (gMain.modeChangeFlags == MODE_CHANGE_NONE)
|
||||
sub_4E2F8();
|
||||
ProcessMainBoardBallDrainAndLaunch();
|
||||
|
||||
if (gCurrentPinballGame->unk5FB)
|
||||
if (gCurrentPinballGame->cameraScrollEnabled)
|
||||
{
|
||||
if (gCurrentPinballGame->unk5FC != gCurrentPinballGame->unk5FE)
|
||||
if (gCurrentPinballGame->cameraScrollOffset != gCurrentPinballGame->cameraScrollTarget)
|
||||
{
|
||||
if (gCurrentPinballGame->unk5FC > gCurrentPinballGame->unk5FE)
|
||||
gCurrentPinballGame->unk5FC--;
|
||||
if (gCurrentPinballGame->cameraScrollOffset > gCurrentPinballGame->cameraScrollTarget)
|
||||
gCurrentPinballGame->cameraScrollOffset--;
|
||||
else
|
||||
gCurrentPinballGame->unk5FC++;
|
||||
gCurrentPinballGame->cameraScrollOffset++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk5FB = 0;
|
||||
gCurrentPinballGame->cameraScrollEnabled = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk1F == 0)
|
||||
var0 = (gCurrentPinballGame->unk1330->velocity.y * 40) + 0x1000;
|
||||
if (gCurrentPinballGame->ballFrozenState == 0)
|
||||
var0 = (gCurrentPinballGame->secondaryBall->velocity.y * 40) + 0x1000;
|
||||
|
||||
gCurrentPinballGame->unk2C += (var0 - gCurrentPinballGame->unk2C) / 10;
|
||||
var1 = gCurrentPinballGame->unk1330->positionQ8.y + gCurrentPinballGame->unk2C;
|
||||
if (var1 > gUnknown_02031520.unk14.unk18 << 8)
|
||||
var1 = gUnknown_02031520.unk14.unk18 << 8;
|
||||
else if (var1 < gUnknown_02031520.unk14.unk1A << 8)
|
||||
var1 = gUnknown_02031520.unk14.unk1A << 8;
|
||||
gCurrentPinballGame->cameraLookAhead += (var0 - gCurrentPinballGame->cameraLookAhead) / 10;
|
||||
var1 = gCurrentPinballGame->secondaryBall->positionQ8.y + gCurrentPinballGame->cameraLookAhead;
|
||||
if (var1 > gBoardConfig.fieldLayout.cameraScrollMaxY << 8)
|
||||
var1 = gBoardConfig.fieldLayout.cameraScrollMaxY << 8;
|
||||
else if (var1 < gBoardConfig.fieldLayout.cameraScrollMinY << 8)
|
||||
var1 = gBoardConfig.fieldLayout.cameraScrollMinY << 8;
|
||||
|
||||
var1 -= 0x5000;
|
||||
var4 = gCurrentPinballGame->unk54;
|
||||
var4 = gCurrentPinballGame->cameraYQ8;
|
||||
var2 = (var1 - var4) / 12;
|
||||
if (var2 > 0)
|
||||
{
|
||||
|
|
@ -140,25 +140,25 @@ void MainBoardProcess_2B_4D960(void)
|
|||
}
|
||||
|
||||
var4 += var2;
|
||||
if (gCurrentPinballGame->unk5FA == 0)
|
||||
if (gCurrentPinballGame->boardEntityActive == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk54 = var4;
|
||||
gCurrentPinballGame->unk4E = var4 / 0x100;
|
||||
if (gCurrentPinballGame->unk1330->positionQ0.x >= 230)
|
||||
gCurrentPinballGame->unk4C++;
|
||||
gCurrentPinballGame->cameraYQ8 = var4;
|
||||
gCurrentPinballGame->cameraBaseY = var4 / 0x100;
|
||||
if (gCurrentPinballGame->secondaryBall->positionQ0.x >= 230)
|
||||
gCurrentPinballGame->cameraBaseX++;
|
||||
else
|
||||
gCurrentPinballGame->unk4C--;
|
||||
gCurrentPinballGame->cameraBaseX--;
|
||||
|
||||
if (gCurrentPinballGame->unk4C > 16)
|
||||
gCurrentPinballGame->unk4C = 16;
|
||||
else if (gCurrentPinballGame->unk4C < 0)
|
||||
gCurrentPinballGame->unk4C = 0;
|
||||
if (gCurrentPinballGame->cameraBaseX > 16)
|
||||
gCurrentPinballGame->cameraBaseX = 16;
|
||||
else if (gCurrentPinballGame->cameraBaseX < 0)
|
||||
gCurrentPinballGame->cameraBaseX = 0;
|
||||
}
|
||||
|
||||
sub_4DFA0();
|
||||
gMain.bgOffsets[3].xOffset = gCurrentPinballGame->unk4C + gCurrentPinballGame->unk120 + gCurrentPinballGame->unk2AA;
|
||||
gCurrentPinballGame->unkCC = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk121 + gCurrentPinballGame->unk5FC + gCurrentPinballGame->unkE6;
|
||||
var3 = gMain.bgOffsets[3].yOffset - gCurrentPinballGame->unkCC;
|
||||
ProcessTiltInput();
|
||||
gMain.bgOffsets[3].xOffset = gCurrentPinballGame->cameraBaseX + gCurrentPinballGame->tiltXOffset + gCurrentPinballGame->screenShakeX;
|
||||
gCurrentPinballGame->scrollEffectY = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->tiltYOffset + gCurrentPinballGame->cameraScrollOffset + gCurrentPinballGame->cameraYAdjust;
|
||||
var3 = gMain.bgOffsets[3].yOffset - gCurrentPinballGame->scrollEffectY;
|
||||
if (var3 > 8)
|
||||
var3 = 8;
|
||||
else if (var3 < -8)
|
||||
|
|
@ -171,10 +171,10 @@ void MainBoardProcess_2B_4D960(void)
|
|||
gMain.bgOffsets[2].yOffset = gMain.bgOffsets[3].yOffset;
|
||||
gMain.bgOffsets[1].xOffset = gMain.bgOffsets[3].xOffset;
|
||||
gMain.bgOffsets[1].yOffset = gMain.bgOffsets[3].yOffset;
|
||||
gCurrentPinballGame->unk58 = gCurrentPinballGame->unk4C + gCurrentPinballGame->unk120 + gCurrentPinballGame->unk2AA;
|
||||
gCurrentPinballGame->unk5A = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk121 + gCurrentPinballGame->unk5FC + gCurrentPinballGame->unkE6;
|
||||
gCurrentPinballGame->unk6A = gCurrentPinballGame->unk68;
|
||||
gCurrentPinballGame->unk68 = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk121 + gCurrentPinballGame->unk5FC + gCurrentPinballGame->unkE6;
|
||||
gCurrentPinballGame->cameraXOffset = gCurrentPinballGame->cameraBaseX + gCurrentPinballGame->tiltXOffset + gCurrentPinballGame->screenShakeX;
|
||||
gCurrentPinballGame->cameraYOffset = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->tiltYOffset + gCurrentPinballGame->cameraScrollOffset + gCurrentPinballGame->cameraYAdjust;
|
||||
gCurrentPinballGame->hudSpriteBaseY = gCurrentPinballGame->cameraYViewport;
|
||||
gCurrentPinballGame->cameraYViewport = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->tiltYOffset + gCurrentPinballGame->cameraScrollOffset + gCurrentPinballGame->cameraYAdjust;
|
||||
}
|
||||
|
||||
void BonusBoardProcess_2B_4DBFC(void)
|
||||
|
|
@ -187,35 +187,35 @@ void BonusBoardProcess_2B_4DBFC(void)
|
|||
|
||||
var0 = 0x1000;
|
||||
if ((gMain.modeChangeFlags & ~MODE_CHANGE_EXPIRED_BONUS) == 0)
|
||||
sub_4E468();
|
||||
ProcessBonusBoardBallDrain();
|
||||
|
||||
if (gCurrentPinballGame->unk5FB)
|
||||
if (gCurrentPinballGame->cameraScrollEnabled)
|
||||
{
|
||||
if (gCurrentPinballGame->unk5FC != gCurrentPinballGame->unk5FE)
|
||||
if (gCurrentPinballGame->cameraScrollOffset != gCurrentPinballGame->cameraScrollTarget)
|
||||
{
|
||||
if (gCurrentPinballGame->unk5FC > gCurrentPinballGame->unk5FE)
|
||||
gCurrentPinballGame->unk5FC--;
|
||||
if (gCurrentPinballGame->cameraScrollOffset > gCurrentPinballGame->cameraScrollTarget)
|
||||
gCurrentPinballGame->cameraScrollOffset--;
|
||||
else
|
||||
gCurrentPinballGame->unk5FC++;
|
||||
gCurrentPinballGame->cameraScrollOffset++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk5FB = 0;
|
||||
gCurrentPinballGame->cameraScrollEnabled = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk1F == 0)
|
||||
var0 = gCurrentPinballGame->unk1330->velocity.y * 40 + 0x1000;
|
||||
if (gCurrentPinballGame->ballFrozenState == 0)
|
||||
var0 = gCurrentPinballGame->secondaryBall->velocity.y * 40 + 0x1000;
|
||||
|
||||
gCurrentPinballGame->unk2C += (var0 - gCurrentPinballGame->unk2C) / 10;
|
||||
var1 = gCurrentPinballGame->unk1330->positionQ8.y + gCurrentPinballGame->unk2C;
|
||||
if (var1 > gUnknown_02031520.unk14.unk18 << 8)
|
||||
var1 = gUnknown_02031520.unk14.unk18 << 8;
|
||||
else if (var1 < gUnknown_02031520.unk14.unk1A << 8)
|
||||
var1 = gUnknown_02031520.unk14.unk1A << 8;
|
||||
gCurrentPinballGame->cameraLookAhead += (var0 - gCurrentPinballGame->cameraLookAhead) / 10;
|
||||
var1 = gCurrentPinballGame->secondaryBall->positionQ8.y + gCurrentPinballGame->cameraLookAhead;
|
||||
if (var1 > gBoardConfig.fieldLayout.cameraScrollMaxY << 8)
|
||||
var1 = gBoardConfig.fieldLayout.cameraScrollMaxY << 8;
|
||||
else if (var1 < gBoardConfig.fieldLayout.cameraScrollMinY << 8)
|
||||
var1 = gBoardConfig.fieldLayout.cameraScrollMinY << 8;
|
||||
|
||||
var1 -= 0x5000;
|
||||
var4 = gCurrentPinballGame->unk54;
|
||||
var4 = gCurrentPinballGame->cameraYQ8;
|
||||
var2 = (var1 - var4) / 12;
|
||||
if (var2 > 0)
|
||||
{
|
||||
|
|
@ -229,25 +229,25 @@ void BonusBoardProcess_2B_4DBFC(void)
|
|||
}
|
||||
|
||||
var4 += var2;
|
||||
if (gCurrentPinballGame->unk5FA == 0)
|
||||
if (gCurrentPinballGame->boardEntityActive == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk54 = var4;
|
||||
gCurrentPinballGame->unk4E = var4 / 0x100;
|
||||
gCurrentPinballGame->cameraYQ8 = var4;
|
||||
gCurrentPinballGame->cameraBaseY = var4 / 0x100;
|
||||
}
|
||||
|
||||
sub_4DFA0();
|
||||
gMain.bgOffsets[2].xOffset = gCurrentPinballGame->unk4C + gCurrentPinballGame->unk120 + 8 + gCurrentPinballGame->unk2AA;
|
||||
gCurrentPinballGame->unkCC = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk121 + gCurrentPinballGame->unk5FC + gCurrentPinballGame->unkE6 + gCurrentPinballGame->unk2AC;
|
||||
var3 = gCurrentPinballGame->unkCA - gCurrentPinballGame->unkCC;
|
||||
ProcessTiltInput();
|
||||
gMain.bgOffsets[2].xOffset = gCurrentPinballGame->cameraBaseX + gCurrentPinballGame->tiltXOffset + 8 + gCurrentPinballGame->screenShakeX;
|
||||
gCurrentPinballGame->scrollEffectY = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->tiltYOffset + gCurrentPinballGame->cameraScrollOffset + gCurrentPinballGame->cameraYAdjust + gCurrentPinballGame->screenShakeY;
|
||||
var3 = gCurrentPinballGame->scrollEffectX - gCurrentPinballGame->scrollEffectY;
|
||||
if (var3 > 8)
|
||||
var3 = 8;
|
||||
else if (var3 < -8)
|
||||
var3 = -8;
|
||||
|
||||
if (var3)
|
||||
gCurrentPinballGame->unkCA -= var3;
|
||||
gCurrentPinballGame->scrollEffectX -= var3;
|
||||
|
||||
gMain.bgOffsets[2].yOffset = gCurrentPinballGame->unkCA;
|
||||
gMain.bgOffsets[2].yOffset = gCurrentPinballGame->scrollEffectX;
|
||||
|
||||
switch (gMain.selectedField)
|
||||
{
|
||||
|
|
@ -255,10 +255,10 @@ void BonusBoardProcess_2B_4DBFC(void)
|
|||
gMain.bgOffsets[3].xOffset = gMain.bgOffsets[2].xOffset;
|
||||
gMain.bgOffsets[3].yOffset = gMain.bgOffsets[2].yOffset;
|
||||
gMain.bgOffsets[1].xOffset = gMain.bgOffsets[2].xOffset;
|
||||
gMain.bgOffsets[1].yOffset = gCurrentPinballGame->unkCA / 2;
|
||||
gMain.bgOffsets[1].yOffset = gCurrentPinballGame->scrollEffectX / 2;
|
||||
break;
|
||||
case 3:
|
||||
gMain.bgOffsets[3].xOffset = gMain.bgOffsets[2].xOffset + (gCurrentPinballGame->unk290 & 0x7FF) / 8;
|
||||
gMain.bgOffsets[3].xOffset = gMain.bgOffsets[2].xOffset + (gCurrentPinballGame->globalAnimFrameCounter & 0x7FF) / 8;
|
||||
gMain.bgOffsets[3].yOffset = gMain.bgOffsets[2].yOffset;
|
||||
gMain.bgOffsets[1].xOffset = gMain.bgOffsets[2].xOffset;
|
||||
gMain.bgOffsets[1].yOffset = 0;
|
||||
|
|
@ -282,152 +282,152 @@ void BonusBoardProcess_2B_4DBFC(void)
|
|||
break;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk58 = gCurrentPinballGame->unk4C + gCurrentPinballGame->unk120 + gCurrentPinballGame->unk2AA;
|
||||
gCurrentPinballGame->unk5A = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk121 + gCurrentPinballGame->unk5FC + gCurrentPinballGame->unkE6 + gCurrentPinballGame->unk2AC;
|
||||
gCurrentPinballGame->unk68 = gCurrentPinballGame->unk4E + gCurrentPinballGame->unk121 + gCurrentPinballGame->unk5FC + gCurrentPinballGame->unkE6;
|
||||
gCurrentPinballGame->cameraXOffset = gCurrentPinballGame->cameraBaseX + gCurrentPinballGame->tiltXOffset + gCurrentPinballGame->screenShakeX;
|
||||
gCurrentPinballGame->cameraYOffset = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->tiltYOffset + gCurrentPinballGame->cameraScrollOffset + gCurrentPinballGame->cameraYAdjust + gCurrentPinballGame->screenShakeY;
|
||||
gCurrentPinballGame->cameraYViewport = gCurrentPinballGame->cameraBaseY + gCurrentPinballGame->tiltYOffset + gCurrentPinballGame->cameraScrollOffset + gCurrentPinballGame->cameraYAdjust;
|
||||
}
|
||||
|
||||
void sub_4DFA0(void)
|
||||
void ProcessTiltInput(void)
|
||||
{
|
||||
int i;
|
||||
s16 sp0[4];
|
||||
|
||||
if (gCurrentPinballGame->unk25 == 0 && gCurrentPinballGame->unk5A4 != 2 && gCurrentPinballGame->unk61C == 0)
|
||||
if (gCurrentPinballGame->ballCatchState == 0 && gCurrentPinballGame->captureState != 2 && gCurrentPinballGame->entityOverlayCollisionState == 0)
|
||||
{
|
||||
if (gCurrentPinballGame->newButtonActions[2])
|
||||
{
|
||||
if (gCurrentPinballGame->unk12A == 0)
|
||||
if (gCurrentPinballGame->boardShakeTimer == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk129 = 0;
|
||||
if (gCurrentPinballGame->unk128 == 0)
|
||||
gCurrentPinballGame->boardShakeDirection = 0;
|
||||
if (gCurrentPinballGame->boardShakeIntensity == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk128 = 4;
|
||||
gCurrentPinballGame->boardShakeIntensity = 4;
|
||||
m4aSongNumStart(SE_TILT_TRIGGERED);
|
||||
PlayRumble(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->newButtonActions[3] && gCurrentPinballGame->unk12A == 0)
|
||||
if (gCurrentPinballGame->newButtonActions[3] && gCurrentPinballGame->boardShakeTimer == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk129 = 1;
|
||||
if (gCurrentPinballGame->unk128 == 0)
|
||||
gCurrentPinballGame->boardShakeDirection = 1;
|
||||
if (gCurrentPinballGame->boardShakeIntensity == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk128 = 4;
|
||||
gCurrentPinballGame->boardShakeIntensity = 4;
|
||||
m4aSongNumStart(SE_TILT_TRIGGERED);
|
||||
PlayRumble(8);
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->newButtonActions[4] && gCurrentPinballGame->unk12A == 0)
|
||||
if (gCurrentPinballGame->newButtonActions[4] && gCurrentPinballGame->boardShakeTimer == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk129 = 2;
|
||||
if (gCurrentPinballGame->unk128 == 0)
|
||||
gCurrentPinballGame->boardShakeDirection = 2;
|
||||
if (gCurrentPinballGame->boardShakeIntensity == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk128 = 4;
|
||||
gCurrentPinballGame->boardShakeIntensity = 4;
|
||||
m4aSongNumStart(SE_TILT_TRIGGERED);
|
||||
PlayRumble(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk128)
|
||||
if (gCurrentPinballGame->boardShakeIntensity)
|
||||
{
|
||||
gCurrentPinballGame->unk128--;
|
||||
if (gCurrentPinballGame->unk128 == 0)
|
||||
gCurrentPinballGame->boardShakeIntensity--;
|
||||
if (gCurrentPinballGame->boardShakeIntensity == 0)
|
||||
{
|
||||
switch (gCurrentPinballGame->unk129)
|
||||
switch (gCurrentPinballGame->boardShakeDirection)
|
||||
{
|
||||
case 0:
|
||||
gCurrentPinballGame->unk118[0] = 6;
|
||||
gCurrentPinballGame->unk11C[0] = -1;
|
||||
gCurrentPinballGame->unk118[2] = 6;
|
||||
gCurrentPinballGame->unk11C[2] = 1;
|
||||
gCurrentPinballGame->tiltShakeAmplitude[0] = 6;
|
||||
gCurrentPinballGame->tiltShakeVelocity[0] = -1;
|
||||
gCurrentPinballGame->tiltShakeAmplitude[2] = 6;
|
||||
gCurrentPinballGame->tiltShakeVelocity[2] = 1;
|
||||
break;
|
||||
case 1:
|
||||
gCurrentPinballGame->unk118[1] = 6;
|
||||
gCurrentPinballGame->unk11C[1] = 1;
|
||||
gCurrentPinballGame->unk118[3] = 6;
|
||||
gCurrentPinballGame->unk11C[3] = 1;
|
||||
gCurrentPinballGame->tiltShakeAmplitude[1] = 6;
|
||||
gCurrentPinballGame->tiltShakeVelocity[1] = 1;
|
||||
gCurrentPinballGame->tiltShakeAmplitude[3] = 6;
|
||||
gCurrentPinballGame->tiltShakeVelocity[3] = 1;
|
||||
break;
|
||||
case 2:
|
||||
gCurrentPinballGame->unk118[2] = 6;
|
||||
gCurrentPinballGame->unk11C[2] = 1;
|
||||
gCurrentPinballGame->unk118[3] = 0;
|
||||
gCurrentPinballGame->unk11C[3] = 1;
|
||||
gCurrentPinballGame->tiltShakeAmplitude[2] = 6;
|
||||
gCurrentPinballGame->tiltShakeVelocity[2] = 1;
|
||||
gCurrentPinballGame->tiltShakeAmplitude[3] = 0;
|
||||
gCurrentPinballGame->tiltShakeVelocity[3] = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk12A = 24;
|
||||
gCurrentPinballGame->boardShakeTimer = 24;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk12A)
|
||||
gCurrentPinballGame->unk12A--;
|
||||
if (gCurrentPinballGame->boardShakeTimer)
|
||||
gCurrentPinballGame->boardShakeTimer--;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (gCurrentPinballGame->unk118[i] > 0)
|
||||
gCurrentPinballGame->unk118[i]--;
|
||||
if (gCurrentPinballGame->tiltShakeAmplitude[i] > 0)
|
||||
gCurrentPinballGame->tiltShakeAmplitude[i]--;
|
||||
|
||||
if (gCurrentPinballGame->unk118[i] < 3)
|
||||
sp0[i] = gCurrentPinballGame->unk11C[i] * gCurrentPinballGame->unk118[i];
|
||||
if (gCurrentPinballGame->tiltShakeAmplitude[i] < 3)
|
||||
sp0[i] = gCurrentPinballGame->tiltShakeVelocity[i] * gCurrentPinballGame->tiltShakeAmplitude[i];
|
||||
else
|
||||
sp0[i] = gCurrentPinballGame->unk11C[i] * (6 - gCurrentPinballGame->unk118[i]);
|
||||
sp0[i] = gCurrentPinballGame->tiltShakeVelocity[i] * (6 - gCurrentPinballGame->tiltShakeAmplitude[i]);
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk120 = sp0[0] + sp0[1];
|
||||
gCurrentPinballGame->unk121 = sp0[2] + sp0[3];
|
||||
gCurrentPinballGame->tiltXOffset = sp0[0] + sp0[1];
|
||||
gCurrentPinballGame->tiltYOffset = sp0[2] + sp0[3];
|
||||
|
||||
if (gCurrentPinballGame->unk120 == 0 && gCurrentPinballGame->unk121 == 0)
|
||||
if (gCurrentPinballGame->tiltXOffset == 0 && gCurrentPinballGame->tiltYOffset == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk126 = 0;
|
||||
gCurrentPinballGame->unk127 = 0;
|
||||
gCurrentPinballGame->tiltLockoutTimer = 0;
|
||||
gCurrentPinballGame->tiltLockoutActive = 0;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk120 > 0)
|
||||
if (gCurrentPinballGame->tiltXOffset > 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk120 < gCurrentPinballGame->unk122)
|
||||
gCurrentPinballGame->unk122--;
|
||||
if (gCurrentPinballGame->tiltXOffset < gCurrentPinballGame->tiltTargetXOffset)
|
||||
gCurrentPinballGame->tiltTargetXOffset--;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk120 < 0)
|
||||
else if (gCurrentPinballGame->tiltXOffset < 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk120 > gCurrentPinballGame->unk122)
|
||||
gCurrentPinballGame->unk122++;
|
||||
if (gCurrentPinballGame->tiltXOffset > gCurrentPinballGame->tiltTargetXOffset)
|
||||
gCurrentPinballGame->tiltTargetXOffset++;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk121 > 0)
|
||||
if (gCurrentPinballGame->tiltYOffset > 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk121 < gCurrentPinballGame->unk123)
|
||||
gCurrentPinballGame->unk123--;
|
||||
if (gCurrentPinballGame->tiltYOffset < gCurrentPinballGame->tiltTargetYOffset)
|
||||
gCurrentPinballGame->tiltTargetYOffset--;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk121 < 0)
|
||||
else if (gCurrentPinballGame->tiltYOffset < 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk121 > gCurrentPinballGame->unk123)
|
||||
gCurrentPinballGame->unk123++;
|
||||
if (gCurrentPinballGame->tiltYOffset > gCurrentPinballGame->tiltTargetYOffset)
|
||||
gCurrentPinballGame->tiltTargetYOffset++;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk126 == 0)
|
||||
if (gCurrentPinballGame->tiltLockoutTimer == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk122 = gCurrentPinballGame->unk120;
|
||||
gCurrentPinballGame->unk123 = gCurrentPinballGame->unk121;
|
||||
gCurrentPinballGame->tiltTargetXOffset = gCurrentPinballGame->tiltXOffset;
|
||||
gCurrentPinballGame->tiltTargetYOffset = gCurrentPinballGame->tiltYOffset;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_4E2F8(void)
|
||||
void ProcessMainBoardBallDrainAndLaunch(void)
|
||||
{
|
||||
struct BallState *unk1334;
|
||||
struct BallState *ballStates;
|
||||
|
||||
if (gCurrentPinballGame->unk13 && gCurrentPinballGame->newButtonActions[1] && gCurrentPinballGame->unk20)
|
||||
if (gCurrentPinballGame->boardState && gCurrentPinballGame->newButtonActions[1] && gCurrentPinballGame->ballInLaunchChute)
|
||||
{
|
||||
gCurrentPinballGame->unk21 = 1;
|
||||
gCurrentPinballGame->unk163 = 1;
|
||||
gCurrentPinballGame->launcherCharging = 1;
|
||||
gCurrentPinballGame->sapphirePondFlag = 1;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk21 && gCurrentPinballGame->releasedButtonActions[1])
|
||||
if (gCurrentPinballGame->launcherCharging && gCurrentPinballGame->releasedButtonActions[1])
|
||||
{
|
||||
gCurrentPinballGame->unk163 = 3;
|
||||
if (gCurrentPinballGame->unk20)
|
||||
gCurrentPinballGame->sapphirePondFlag = 3;
|
||||
if (gCurrentPinballGame->ballInLaunchChute)
|
||||
{
|
||||
PlayRumble(7);
|
||||
gCurrentPinballGame->ball->velocity.y = -590;
|
||||
|
|
@ -435,79 +435,79 @@ void sub_4E2F8(void)
|
|||
m4aSongNumStart(SE_UNKNOWN_0xCD);
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk21 = 0;
|
||||
gCurrentPinballGame->launcherCharging = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->ball = &gCurrentPinballGame->unk1334[0];
|
||||
unk1334 = &gCurrentPinballGame->unk1334[0];
|
||||
gCurrentPinballGame->ball = &gCurrentPinballGame->ballStates[0];
|
||||
ballStates = &gCurrentPinballGame->ballStates[0];
|
||||
|
||||
if (unk1334->positionQ0.y >= gUnknown_02031520.unk14.unk2A)
|
||||
if (ballStates->positionQ0.y >= gBoardConfig.fieldLayout.ballDrainY)
|
||||
{
|
||||
unk1334->positionQ0.y = gUnknown_02031520.unk14.unk2A;
|
||||
ballStates->positionQ0.y = gBoardConfig.fieldLayout.ballDrainY;
|
||||
gCurrentPinballGame->ball->positionQ1.x = gCurrentPinballGame->ball->positionQ0.x * 2;
|
||||
gCurrentPinballGame->ball->positionQ1.y = gCurrentPinballGame->ball->positionQ0.y * 2;
|
||||
gCurrentPinballGame->ball->positionQ8.x = gCurrentPinballGame->ball->positionQ0.x << 8;
|
||||
gCurrentPinballGame->ball->positionQ8.y = gCurrentPinballGame->ball->positionQ0.y << 8;
|
||||
gCurrentPinballGame->ball->velocity.x = 0;
|
||||
gCurrentPinballGame->ball->velocity.y = 0;
|
||||
if (gMain.unk14 == 0)
|
||||
if (gMain.modeChangeDelayTimer == 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk724)
|
||||
if (gCurrentPinballGame->modeTimeRemaining)
|
||||
{
|
||||
gMain.unk14 = 4;
|
||||
gMain.unk11 = 8;
|
||||
gMain.unk12 = 204;
|
||||
gMain.modeChangeDelayTimer = 4;
|
||||
gMain.pendingModeChangeType = 8;
|
||||
gMain.animationTimer = 204;
|
||||
}
|
||||
else
|
||||
{
|
||||
gMain.unk14 = 80;
|
||||
gMain.unk11 = 16;
|
||||
gMain.unk12 = 200;
|
||||
gMain.modeChangeDelayTimer = 80;
|
||||
gMain.pendingModeChangeType = 16;
|
||||
gMain.animationTimer = 200;
|
||||
m4aMPlayAllStop();
|
||||
m4aSongNumStart(MUS_END_OF_BALL);
|
||||
sub_4E598();
|
||||
ResetBoardStateOnDeath();
|
||||
if (gCurrentPinballGame->outLanePikaPosition == 2 && gMain.eReaderBonuses[EREADER_DX_MODE_CARD] == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1BE = 2;
|
||||
gCurrentPinballGame->unk1C0 = 800;
|
||||
gCurrentPinballGame->pikaRescuePath = 2;
|
||||
gCurrentPinballGame->pikaSaverTimer = 800;
|
||||
gCurrentPinballGame->outLanePikaPosition = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk20 = 0;
|
||||
gCurrentPinballGame->ballInLaunchChute = 0;
|
||||
}
|
||||
|
||||
void sub_4E468(void)
|
||||
void ProcessBonusBoardBallDrain(void)
|
||||
{
|
||||
struct BallState *unk1334;
|
||||
struct BallState *ballStates;
|
||||
|
||||
gCurrentPinballGame->ball = &gCurrentPinballGame->unk1334[0];
|
||||
unk1334 = &gCurrentPinballGame->unk1334[0];
|
||||
gCurrentPinballGame->ball = &gCurrentPinballGame->ballStates[0];
|
||||
ballStates = &gCurrentPinballGame->ballStates[0];
|
||||
|
||||
if (unk1334->positionQ0.y >= gUnknown_02031520.unk14.unk2A)
|
||||
if (ballStates->positionQ0.y >= gBoardConfig.fieldLayout.ballDrainY)
|
||||
{
|
||||
unk1334->velocity.x = 0;
|
||||
ballStates->velocity.x = 0;
|
||||
gCurrentPinballGame->ball->velocity.y = 0;
|
||||
if (gMain.modeChangeFlags & MODE_CHANGE_EXPIRED_BONUS)
|
||||
{
|
||||
gCurrentPinballGame->returnToMainBoardFlag = 1;
|
||||
gMain.modeChangeFlags = MODE_CHANGE_BONUS_BANNER;
|
||||
gCurrentPinballGame->ball->positionQ0.y = gUnknown_02031520.unk14.unk2A - 10;
|
||||
gCurrentPinballGame->ball->positionQ0.y = gBoardConfig.fieldLayout.ballDrainY - 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->ball->unk0 = 1;
|
||||
gCurrentPinballGame->unk388 = 1;
|
||||
gCurrentPinballGame->unk392 = 0;
|
||||
gCurrentPinballGame->ball->positionQ0.x = gUnknown_02031520.unk14.unk26;
|
||||
gCurrentPinballGame->ball->positionQ0.y = gUnknown_02031520.unk14.unk28;
|
||||
gCurrentPinballGame->ball->ballHidden = 1;
|
||||
gCurrentPinballGame->ballRespawnState = 1;
|
||||
gCurrentPinballGame->ballRespawnTimer = 0;
|
||||
gCurrentPinballGame->ball->positionQ0.x = gBoardConfig.fieldLayout.ballSpawnX;
|
||||
gCurrentPinballGame->ball->positionQ0.y = gBoardConfig.fieldLayout.ballSpawnY;
|
||||
if (gCurrentPinballGame->ballUpgradeType > BALL_UPGRADE_TYPE_POKE_BALL)
|
||||
gCurrentPinballGame->ballUpgradeType--;
|
||||
|
||||
gCurrentPinballGame->ballUpgradeCounter = 3600;
|
||||
DmaCopy16(3, gUnknown_08137E14[gCurrentPinballGame->ballUpgradeType], (void *)0x05000220, 0x20);
|
||||
DmaCopy16(3, gBallPalettes[gCurrentPinballGame->ballUpgradeType], (void *)0x05000220, 0x20);
|
||||
}
|
||||
|
||||
gCurrentPinballGame->ball->positionQ1.x = gCurrentPinballGame->ball->positionQ0.x * 2;
|
||||
|
|
@ -517,41 +517,41 @@ void sub_4E468(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_4E598(void)
|
||||
void ResetBoardStateOnDeath(void)
|
||||
{
|
||||
gCurrentPinballGame->unk18 = 10199;
|
||||
gCurrentPinballGame->stageTimer = 10199;
|
||||
|
||||
if (gCurrentPinballGame->unk13 == 2)
|
||||
gCurrentPinballGame->unk17 = 5;
|
||||
if (gCurrentPinballGame->unk13 == 7)
|
||||
gCurrentPinballGame->unk17 = 6;
|
||||
if (gCurrentPinballGame->unk13 == 4)
|
||||
gCurrentPinballGame->unk17 = 10;
|
||||
if (gCurrentPinballGame->unk13 == 5)
|
||||
gCurrentPinballGame->unk17 = 6;
|
||||
if (gCurrentPinballGame->unk13 == 6)
|
||||
gCurrentPinballGame->unk17 = 8;
|
||||
if (gCurrentPinballGame->boardState == 2)
|
||||
gCurrentPinballGame->boardSubState = 5;
|
||||
if (gCurrentPinballGame->boardState == 7)
|
||||
gCurrentPinballGame->boardSubState = 6;
|
||||
if (gCurrentPinballGame->boardState == 4)
|
||||
gCurrentPinballGame->boardSubState = 10;
|
||||
if (gCurrentPinballGame->boardState == 5)
|
||||
gCurrentPinballGame->boardSubState = 6;
|
||||
if (gCurrentPinballGame->boardState == 6)
|
||||
gCurrentPinballGame->boardSubState = 8;
|
||||
|
||||
gCurrentPinballGame->unk714 = 0;
|
||||
gCurrentPinballGame->allHolesLit = 0;
|
||||
gCurrentPinballGame->holeIndicators[0] = 0;
|
||||
gCurrentPinballGame->holeIndicators[1] = gCurrentPinballGame->holeIndicators[0];
|
||||
gCurrentPinballGame->holeIndicators[2] = gCurrentPinballGame->holeIndicators[0];
|
||||
gCurrentPinballGame->holeIndicators[3] = gCurrentPinballGame->holeIndicators[0];
|
||||
gCurrentPinballGame->unk614 = 0;
|
||||
gCurrentPinballGame->unk208 = 0;
|
||||
gCurrentPinballGame->unk20A = 0;
|
||||
gCurrentPinballGame->pikaSpinMomentum = 0;
|
||||
gCurrentPinballGame->catchOverlayFrameTimer = 0;
|
||||
gCurrentPinballGame->catchOverlayKeyframeIndex = 0;
|
||||
if (gCurrentPinballGame->outLanePikaPosition != 2 || !gMain.eReaderBonuses[EREADER_DX_MODE_CARD])
|
||||
{
|
||||
gCurrentPinballGame->unk1C6 = 0;
|
||||
gCurrentPinballGame->unk1C8 = 0;
|
||||
gCurrentPinballGame->unk1CC = 0;
|
||||
gCurrentPinballGame->unk1CA = 0;
|
||||
gCurrentPinballGame->unk1D4 = 0;
|
||||
gCurrentPinballGame->unk1D6 = -4;
|
||||
gCurrentPinballGame->unk1D8 = 0x100;
|
||||
gCurrentPinballGame->unk1DA = 0x100;
|
||||
gCurrentPinballGame->unk1CE = 0;
|
||||
gCurrentPinballGame->unk1D0 = 0;
|
||||
gCurrentPinballGame->pikaChargeTarget = 0;
|
||||
gCurrentPinballGame->pikaChargeProgress = 0;
|
||||
gCurrentPinballGame->prevCatchCounterValue = 0;
|
||||
gCurrentPinballGame->catchCounterValue = 0;
|
||||
gCurrentPinballGame->catchCounterXShift = 0;
|
||||
gCurrentPinballGame->catchCounterSlideOffsetY = -4;
|
||||
gCurrentPinballGame->catchCounterAnimState = 0x100;
|
||||
gCurrentPinballGame->catchCounterScaleY = 0x100;
|
||||
gCurrentPinballGame->pikachuAnimTimer = 0;
|
||||
gCurrentPinballGame->catchCounterSlideTimer = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->ballPowerUpLight[0] = 0;
|
||||
|
|
@ -562,7 +562,7 @@ void sub_4E598(void)
|
|||
{
|
||||
gCurrentPinballGame->ballUpgradeType = BALL_UPGRADE_TYPE_MASTER_BALL;
|
||||
gCurrentPinballGame->ballUpgradeCounter = 60 * 60;
|
||||
DmaCopy16(3, &gUnknown_08137E14[gCurrentPinballGame->ballUpgradeType], (void *)OBJ_PLTT + 0x20, 0x20);
|
||||
DmaCopy16(3, &gBallPalettes[gCurrentPinballGame->ballUpgradeType], (void *)OBJ_PLTT + 0x20, 0x20);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -570,10 +570,10 @@ void sub_4E598(void)
|
|||
gCurrentPinballGame->ballUpgradeCounter = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk5F7 = 0;
|
||||
DmaCopy16(3, &gUnknown_08137E14[gCurrentPinballGame->ballUpgradeType], (void *)OBJ_PLTT + 0x20, 0x20);
|
||||
gCurrentPinballGame->unk62F = gCurrentPinballGame->unk70E;
|
||||
gCurrentPinballGame->unk70E = 1;
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 0;
|
||||
DmaCopy16(3, &gBallPalettes[gCurrentPinballGame->ballUpgradeType], (void *)OBJ_PLTT + 0x20, 0x20);
|
||||
gCurrentPinballGame->bonusMultiplier = gCurrentPinballGame->progressLevel;
|
||||
gCurrentPinballGame->progressLevel = 1;
|
||||
if (gCurrentPinballGame->whiscashFrameIx == WHISCASH_FRAME_GONE_AFTER_HIT)
|
||||
{
|
||||
gCurrentPinballGame->shouldProcessWhiscash = FALSE;
|
||||
|
|
@ -581,9 +581,9 @@ void sub_4E598(void)
|
|||
gCurrentPinballGame->whiscashStateTimer = 0;
|
||||
gCurrentPinballGame->rubyPondContentsChanging = TRUE;
|
||||
gCurrentPinballGame->rubyPondChangeTimer = 0x40;
|
||||
gCurrentPinballGame->unk2AA = 0;
|
||||
gCurrentPinballGame->screenShakeX = 0;
|
||||
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk300 = 0;
|
||||
gCurrentPinballGame->rampGateState = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,20 +21,20 @@ extern s16 DuskullFramesetData[][3];
|
|||
void DuskullBonus_Setup(void)
|
||||
{
|
||||
s16 i;
|
||||
gCurrentPinballGame->unk18 = 0;
|
||||
gCurrentPinballGame->unk17 = 0;
|
||||
gCurrentPinballGame->unk13 = DUSCLOPS_BOARD_STATE_0_INTRO;
|
||||
gCurrentPinballGame->unk294 = 1;
|
||||
gCurrentPinballGame->stageTimer = 0;
|
||||
gCurrentPinballGame->boardSubState = 0;
|
||||
gCurrentPinballGame->boardState = DUSCLOPS_BOARD_STATE_0_INTRO;
|
||||
gCurrentPinballGame->boardModeType = 1;
|
||||
gCurrentPinballGame->eventTimer = gCurrentPinballGame->timerBonus + BONUS_DUSKULL_TIME;
|
||||
gCurrentPinballGame->timerBonus = 0;
|
||||
gCurrentPinballGame->unk383 = 0;
|
||||
gCurrentPinballGame->unk388 = 3;
|
||||
gCurrentPinballGame->ball->unk0 = 1;
|
||||
gCurrentPinballGame->ballGrabbed = 0;
|
||||
gCurrentPinballGame->ballRespawnState = 3;
|
||||
gCurrentPinballGame->ball->ballHidden = 1;
|
||||
gCurrentPinballGame->bonusModeHitCount = 0;
|
||||
gCurrentPinballGame->returnToMainBoardFlag = 0;
|
||||
gCurrentPinballGame->boardEntityCollisionMode = DUSCLOPS_ENTITY_COLLISION_MODE_NONE;
|
||||
gCurrentPinballGame->unk392 = 0;
|
||||
gCurrentPinballGame->unk394 = 0;
|
||||
gCurrentPinballGame->ballRespawnTimer = 0;
|
||||
gCurrentPinballGame->bannerSlideYOffset = 0;
|
||||
gCurrentPinballGame->minionActiveCount = 0;
|
||||
|
||||
for (i = 0; i < DUSKULL_CONCURRENT_MAX; i++)
|
||||
|
|
@ -56,52 +56,52 @@ void DuskullBonus_Setup(void)
|
|||
gCurrentPinballGame->minionCollisionPosition[i].y = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk3DC = 0;
|
||||
gCurrentPinballGame->unk3DE = 0;
|
||||
gCurrentPinballGame->unk3DF = 0;
|
||||
gCurrentPinballGame->unk3E0 = 0;
|
||||
gCurrentPinballGame->unk3E2 = 0;
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->unk3E6 = 0;
|
||||
gCurrentPinballGame->unk3E8 = 0;
|
||||
gCurrentPinballGame->unk3EA = 0;
|
||||
gCurrentPinballGame->unk3EC = 0;
|
||||
gCurrentPinballGame->unk3EE = 0;
|
||||
gCurrentPinballGame->unk3F0 = 0;
|
||||
gCurrentPinballGame->unk3F2 = 0;
|
||||
gCurrentPinballGame->unk1A = 0;
|
||||
gCurrentPinballGame->bossEntityState = 0;
|
||||
gCurrentPinballGame->kecleonFramesetBase = 0;
|
||||
gCurrentPinballGame->bossVulnerable = 0;
|
||||
gCurrentPinballGame->dusclopsWalkFootIndex = 0;
|
||||
gCurrentPinballGame->bossFramesetIndex = 0;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
gCurrentPinballGame->bossAnimLoopCount = 0;
|
||||
gCurrentPinballGame->bossPositionX = 0;
|
||||
gCurrentPinballGame->bossPositionY = 0;
|
||||
gCurrentPinballGame->bossVelocityX = 0;
|
||||
gCurrentPinballGame->bossVelocityY = 0;
|
||||
gCurrentPinballGame->bossCollisionX = 0;
|
||||
gCurrentPinballGame->bossCollisionY = 0;
|
||||
gCurrentPinballGame->flippersDisabled = 0;
|
||||
|
||||
DuskullPhase_ProcessEntityLogic();
|
||||
DuskullPhase_ProcessGraphics();
|
||||
|
||||
m4aSongNumStart(MUS_BONUS_FIELD_DUSKULL);
|
||||
|
||||
DmaCopy16(3, (void *)gUnknown_081B36A4, (void *)0x05000320, 32);
|
||||
DmaCopy16(3, (void *)gBonusStageObjPal, (void *)0x05000320, 32);
|
||||
}
|
||||
|
||||
void DusclopsBoardProcess_3B_33130(void)
|
||||
{
|
||||
s16 temp;
|
||||
switch (gCurrentPinballGame->unk13)
|
||||
switch (gCurrentPinballGame->boardState)
|
||||
{
|
||||
case DUSCLOPS_BOARD_STATE_0_INTRO:
|
||||
gCurrentPinballGame->unk5F7 = 1;
|
||||
if (gCurrentPinballGame->unk18 < 120)
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 1;
|
||||
if (gCurrentPinballGame->stageTimer < 120)
|
||||
{
|
||||
temp = gCurrentPinballGame->unk18 / 24;
|
||||
DmaCopy16(3, gUnknown_082EE0E0 + temp * 40, 0x05000000, 160);
|
||||
temp = gCurrentPinballGame->stageTimer / 24;
|
||||
DmaCopy16(3, gDusclopsAnimPalettes + temp * 40, 0x05000000, 160);
|
||||
|
||||
gCurrentPinballGame->unkE6 = gCurrentPinballGame->unk18 / 5 + 0xFFE8;
|
||||
gCurrentPinballGame->unk18++;
|
||||
gCurrentPinballGame->cameraYAdjust = gCurrentPinballGame->stageTimer / 5 + 0xFFE8;
|
||||
gCurrentPinballGame->stageTimer++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unkE6 = 0;
|
||||
gCurrentPinballGame->cameraYAdjust = 0;
|
||||
gMain.spriteGroups[7].available = TRUE;
|
||||
gMain.spriteGroups[8].available = TRUE;
|
||||
gMain.spriteGroups[9].available = TRUE;
|
||||
gCurrentPinballGame->unk13 = DUSCLOPS_BOARD_STATE_1_DUSKULL_PHASE;
|
||||
gCurrentPinballGame->unk18 = 0;
|
||||
gCurrentPinballGame->boardState = DUSCLOPS_BOARD_STATE_1_DUSKULL_PHASE;
|
||||
gCurrentPinballGame->stageTimer = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -116,7 +116,7 @@ void DusclopsBoardProcess_3B_33130(void)
|
|||
DuskullPhase_ProcessGraphics();
|
||||
break;
|
||||
case DUSCLOPS_BOARD_STATE_2_INIT_DUSCLOPS_PHASE:
|
||||
gCurrentPinballGame->unk13 = DUSCLOPS_BOARD_STATE_3_DUSCLOPS_PHASE;
|
||||
gCurrentPinballGame->boardState = DUSCLOPS_BOARD_STATE_3_DUSCLOPS_PHASE;
|
||||
gMain.spriteGroups[13].available = TRUE;
|
||||
gMain.spriteGroups[14].available = TRUE;
|
||||
gMain.spriteGroups[12].available = TRUE;
|
||||
|
|
@ -133,56 +133,56 @@ void DusclopsBoardProcess_3B_33130(void)
|
|||
DusclopsPhase_ProcessEntityLogicAndGraphics();
|
||||
break;
|
||||
case DUSCLOPS_BOARD_STATE_4_INIT_SCORE_PHASE:
|
||||
if (gCurrentPinballGame->unk18 < 120)
|
||||
if (gCurrentPinballGame->stageTimer < 120)
|
||||
{
|
||||
gCurrentPinballGame->unk18++;
|
||||
gCurrentPinballGame->stageTimer++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk13 = DUSCLOPS_BOARD_STATE_SCORE_PHASE;
|
||||
gCurrentPinballGame->unk18 = 0;
|
||||
gCurrentPinballGame->boardState = DUSCLOPS_BOARD_STATE_SCORE_PHASE;
|
||||
gCurrentPinballGame->stageTimer = 0;
|
||||
gMain.spriteGroups[6].available = TRUE;
|
||||
gMain.spriteGroups[5].available = TRUE;
|
||||
DmaCopy16(3, gDusclopsBonusClear_Gfx, OBJ_VRAM1+0x1800, 8192);
|
||||
gCurrentPinballGame->unk394 = 136;
|
||||
gCurrentPinballGame->bannerSlideYOffset = 136;
|
||||
}
|
||||
break;
|
||||
case DUSCLOPS_BOARD_STATE_SCORE_PHASE:
|
||||
ProceessBonusBannerAndScoring();
|
||||
ProcessBonusBannerAndScoring();
|
||||
if (gCurrentPinballGame->scoreCounterAnimationEnabled)
|
||||
{
|
||||
gCurrentPinballGame->unk18 = 181;
|
||||
gCurrentPinballGame->stageTimer = 181;
|
||||
}
|
||||
if (gCurrentPinballGame->unk18 == 180)
|
||||
if (gCurrentPinballGame->stageTimer == 180)
|
||||
{
|
||||
gCurrentPinballGame->scoreCounterAnimationEnabled = TRUE;
|
||||
gCurrentPinballGame->scoreAddStepSize = 400000;
|
||||
gCurrentPinballGame->scoreAddedInFrame = BONUS_DUSKULL_COMPLETE_POINTS;
|
||||
}
|
||||
if (gCurrentPinballGame->unk18 < 240)
|
||||
if (gCurrentPinballGame->stageTimer < 240)
|
||||
{
|
||||
if (gCurrentPinballGame->unk18 == 20)
|
||||
if (gCurrentPinballGame->stageTimer == 20)
|
||||
{
|
||||
m4aMPlayAllStop();
|
||||
m4aSongNumStart(MUS_SUCCESS3);
|
||||
}
|
||||
gCurrentPinballGame->unk18++;
|
||||
gCurrentPinballGame->stageTimer++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk18 = 0;
|
||||
gCurrentPinballGame->unk13 = DUSCLOPS_BOARD_STATE_SCORE_COUNTING_FINISHED;
|
||||
gCurrentPinballGame->stageTimer = 0;
|
||||
gCurrentPinballGame->boardState = DUSCLOPS_BOARD_STATE_SCORE_COUNTING_FINISHED;
|
||||
gCurrentPinballGame->numCompletedBonusStages++;
|
||||
}
|
||||
|
||||
break;
|
||||
case DUSCLOPS_BOARD_STATE_SCORE_COUNTING_FINISHED:
|
||||
ProceessBonusBannerAndScoring();
|
||||
ProcessBonusBannerAndScoring();
|
||||
gCurrentPinballGame->returnToMainBoardFlag = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk294)
|
||||
if (gCurrentPinballGame->boardModeType)
|
||||
{
|
||||
if (gCurrentPinballGame->eventTimer < 2)
|
||||
{
|
||||
|
|
@ -272,7 +272,7 @@ void DuskullPhase_ProcessEntityLogic(void) {
|
|||
}
|
||||
if (r4)
|
||||
{
|
||||
gCurrentPinballGame->unk13 = DUSCLOPS_BOARD_STATE_2_INIT_DUSCLOPS_PHASE;
|
||||
gCurrentPinballGame->boardState = DUSCLOPS_BOARD_STATE_2_INIT_DUSCLOPS_PHASE;
|
||||
gMain.spriteGroups[7].available = FALSE;
|
||||
gMain.spriteGroups[8].available = FALSE;
|
||||
gMain.spriteGroups[9].available = FALSE;
|
||||
|
|
@ -572,8 +572,8 @@ void DuskullPhase_ProcessGraphics() {
|
|||
|
||||
if (gCurrentPinballGame->minionDrawInFrame[i]) {
|
||||
s32 x = 0; // Scrub C to get the compiler to add before subtracting
|
||||
spriteGroup->baseX = gCurrentPinballGame->minionLogicPosition[i].x / 10 + 108 + x - gCurrentPinballGame->unk58;
|
||||
spriteGroup->baseY = gCurrentPinballGame->minionLogicPosition[i].y / 10 + 28 + x - gCurrentPinballGame->unk5A;
|
||||
spriteGroup->baseX = gCurrentPinballGame->minionLogicPosition[i].x / 10 + 108 + x - gCurrentPinballGame->cameraXOffset;
|
||||
spriteGroup->baseY = gCurrentPinballGame->minionLogicPosition[i].y / 10 + 28 + x - gCurrentPinballGame->cameraYOffset;
|
||||
} else {
|
||||
// Draw off screen, past lower right bounds of screen
|
||||
spriteGroup->baseX = 240;
|
||||
|
|
@ -640,54 +640,54 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void)
|
|||
|
||||
tileOffset = 0;
|
||||
spriteGroup = &gMain.spriteGroups[14];
|
||||
switch(gCurrentPinballGame->unk3DC)
|
||||
switch(gCurrentPinballGame->bossEntityState)
|
||||
{
|
||||
case DUSCLOPS_ENTITY_STATE_INIT:
|
||||
{
|
||||
gCurrentPinballGame->unk3E8 = 880;
|
||||
gCurrentPinballGame->unk3EA = 300;
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_INTRO_APPEARANCE;
|
||||
gCurrentPinballGame->unk3E6 = 184;
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_INTRO_START;
|
||||
gCurrentPinballGame->bossPositionX = 880;
|
||||
gCurrentPinballGame->bossPositionY = 300;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_INTRO_APPEARANCE;
|
||||
gCurrentPinballGame->bossAnimLoopCount = 184;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_INTRO_START;
|
||||
tileOffset = 0;
|
||||
gCurrentPinballGame->unk294 = 1;
|
||||
gCurrentPinballGame->boardModeType = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case DUSCLOPS_ENTITY_STATE_INTRO_APPEARANCE:
|
||||
{
|
||||
if (DuclopsFramesetData[gCurrentPinballGame->unk3E2][1] > gCurrentPinballGame->unk3E4)
|
||||
gCurrentPinballGame->unk3E4++;
|
||||
if (DuclopsFramesetData[gCurrentPinballGame->bossFramesetIndex][1] > gCurrentPinballGame->bossFrameTimer)
|
||||
gCurrentPinballGame->bossFrameTimer++;
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->unk3E2++;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
gCurrentPinballGame->bossFramesetIndex++;
|
||||
|
||||
if (gCurrentPinballGame->unk3E2 > DUSCLOPS_FRAME_INTRO_END)
|
||||
if (gCurrentPinballGame->bossFramesetIndex > DUSCLOPS_FRAME_INTRO_END)
|
||||
{
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_INTRO_START;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_INTRO_START;
|
||||
|
||||
if (gCurrentPinballGame->unk3E0 <= 0)
|
||||
gCurrentPinballGame->unk3E0++;
|
||||
if (gCurrentPinballGame->dusclopsWalkFootIndex <= 0)
|
||||
gCurrentPinballGame->dusclopsWalkFootIndex++;
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk3E0 = 0;
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->dusclopsWalkFootIndex = 0;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_INTRO_FOOTSTEP_LEFT)
|
||||
if (gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_INTRO_FOOTSTEP_LEFT)
|
||||
{
|
||||
gCurrentPinballGame->unk129 = 0;
|
||||
gCurrentPinballGame->unk128 = 1;
|
||||
gCurrentPinballGame->boardShakeDirection = 0;
|
||||
gCurrentPinballGame->boardShakeIntensity = 1;
|
||||
m4aSongNumStart(SE_DUSCLOPS_MOVE);
|
||||
PlayRumble(8);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_INTRO_FOOTSTEP_RIGHT)
|
||||
if (gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_INTRO_FOOTSTEP_RIGHT)
|
||||
{
|
||||
gCurrentPinballGame->unk129 = 1;
|
||||
gCurrentPinballGame->unk128 = 1;
|
||||
gCurrentPinballGame->boardShakeDirection = 1;
|
||||
gCurrentPinballGame->boardShakeIntensity = 1;
|
||||
m4aSongNumStart(SE_DUSCLOPS_MOVE);
|
||||
PlayRumble(8);
|
||||
|
||||
|
|
@ -699,147 +699,147 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void)
|
|||
}
|
||||
case DUSCLOPS_ENTITY_STATE_GUARD_READY:
|
||||
{
|
||||
if (gCurrentPinballGame->unk3E4 <= 255)
|
||||
if (gCurrentPinballGame->bossFrameTimer <= 255)
|
||||
{
|
||||
tileOffset = gUnknown_08137D40[(gCurrentPinballGame->unk3E4 % 0x40) / 16];
|
||||
gCurrentPinballGame->unk3E4++;
|
||||
tileOffset = gDusclopsBossAnimFrames[(gCurrentPinballGame->bossFrameTimer % 0x40) / 16];
|
||||
gCurrentPinballGame->bossFrameTimer++;
|
||||
|
||||
if (gCurrentPinballGame->unk3E4 == 256)
|
||||
if (gCurrentPinballGame->bossFrameTimer == 256)
|
||||
{
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_WALKING;
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_WALKING;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
|
||||
if (gCurrentPinballGame->unk3E0 > 3)
|
||||
gCurrentPinballGame->unk3E0 = 0;
|
||||
if (gCurrentPinballGame->unk3E0 <= 1)
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
if (gCurrentPinballGame->dusclopsWalkFootIndex > 3)
|
||||
gCurrentPinballGame->dusclopsWalkFootIndex = 0;
|
||||
if (gCurrentPinballGame->dusclopsWalkFootIndex <= 1)
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
else
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_RIGHT_FOOT_FORWARD;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_RIGHT_FOOT_FORWARD;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk3E6 > 0)
|
||||
if (gCurrentPinballGame->bossAnimLoopCount > 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk3E6 > 64)
|
||||
gCurrentPinballGame->unk3E6--;
|
||||
if (gCurrentPinballGame->bossAnimLoopCount > 64)
|
||||
gCurrentPinballGame->bossAnimLoopCount--;
|
||||
else
|
||||
gCurrentPinballGame->unk3E6 -= 2;
|
||||
gCurrentPinballGame->bossAnimLoopCount -= 2;
|
||||
|
||||
if (gCurrentPinballGame->unk3E6 == 154)
|
||||
if (gCurrentPinballGame->bossAnimLoopCount == 154)
|
||||
m4aSongNumStart(SE_DUSCLOPS_APPEAR); //Dusclops Appears
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->boardEntityCollisionMode = DUSCLOPS_ENTITY_COLLISION_MODE_DUSCLOPS;
|
||||
gCurrentPinballGame->unk294 = 2;
|
||||
gCurrentPinballGame->boardModeType = 2;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case DUSCLOPS_ENTITY_STATE_WALKING:
|
||||
{
|
||||
if (DuclopsFramesetData[gCurrentPinballGame->unk3E2][1] > gCurrentPinballGame->unk3E4)
|
||||
if (DuclopsFramesetData[gCurrentPinballGame->bossFramesetIndex][1] > gCurrentPinballGame->bossFrameTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk3E4++;
|
||||
gCurrentPinballGame->bossFrameTimer++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
|
||||
if (gCurrentPinballGame->unk3E0 <= 1)
|
||||
if (gCurrentPinballGame->dusclopsWalkFootIndex <= 1)
|
||||
{
|
||||
gCurrentPinballGame->unk3E2++;
|
||||
gCurrentPinballGame->bossFramesetIndex++;
|
||||
|
||||
if (gCurrentPinballGame->unk3E2 > DUSCLOPS_FRAME_RIGHT_FOOT_FORWARD)
|
||||
if (gCurrentPinballGame->bossFramesetIndex > DUSCLOPS_FRAME_RIGHT_FOOT_FORWARD)
|
||||
{
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->unk3E0++;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->dusclopsWalkFootIndex++;
|
||||
|
||||
if ((gCurrentPinballGame->unk3E0 & 1) == 0)
|
||||
if ((gCurrentPinballGame->dusclopsWalkFootIndex & 1) == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (--gCurrentPinballGame->unk3E2 < 0)
|
||||
else if (--gCurrentPinballGame->bossFramesetIndex < 0)
|
||||
{
|
||||
gCurrentPinballGame->unk3E0++;
|
||||
gCurrentPinballGame->dusclopsWalkFootIndex++;
|
||||
|
||||
if ((gCurrentPinballGame->unk3E0 & 1) == 0)
|
||||
if ((gCurrentPinballGame->dusclopsWalkFootIndex & 1) == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
}
|
||||
else
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_RIGHT_FOOT_FORWARD;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_RIGHT_FOOT_FORWARD;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_LEFT_FOOT_LANDS)
|
||||
if (gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_LEFT_FOOT_LANDS)
|
||||
{
|
||||
gCurrentPinballGame->unk129 = 0;
|
||||
gCurrentPinballGame->unk128 = 1;
|
||||
gCurrentPinballGame->boardShakeDirection = 0;
|
||||
gCurrentPinballGame->boardShakeIntensity = 1;
|
||||
m4aSongNumStart(SE_DUSCLOPS_MOVE);
|
||||
PlayRumble(8);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_RIGHT_FOOT_LANDS)
|
||||
if (gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_RIGHT_FOOT_LANDS)
|
||||
{
|
||||
gCurrentPinballGame->unk129 = 1;
|
||||
gCurrentPinballGame->unk128 = 1;
|
||||
gCurrentPinballGame->boardShakeDirection = 1;
|
||||
gCurrentPinballGame->boardShakeIntensity = 1;
|
||||
m4aSongNumStart(SE_DUSCLOPS_MOVE);
|
||||
PlayRumble(8);
|
||||
}
|
||||
}
|
||||
|
||||
tileOffset = DuclopsFramesetData[gCurrentPinballGame->unk3E2][0];
|
||||
tileOffset = DuclopsFramesetData[gCurrentPinballGame->bossFramesetIndex][0];
|
||||
|
||||
if( gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_WALK_NEUTRAL ||
|
||||
gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_WALK_NEUTRAL_RIGHT_FOOT_FORWARD )
|
||||
if( gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_WALK_NEUTRAL ||
|
||||
gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_WALK_NEUTRAL_RIGHT_FOOT_FORWARD )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk3E0 <= 1)
|
||||
if (gCurrentPinballGame->dusclopsWalkFootIndex <= 1)
|
||||
{
|
||||
if (gCurrentPinballGame->unk3EA <= 583)
|
||||
if (gCurrentPinballGame->bossPositionY <= 583)
|
||||
{
|
||||
gCurrentPinballGame->unk3EA++;
|
||||
gCurrentPinballGame->bossPositionY++;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((gCurrentPinballGame->unk3E2 % 4) != 0)
|
||||
if ((gCurrentPinballGame->bossFramesetIndex % 4) != 0)
|
||||
break;
|
||||
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->unk3E0 = 2;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->dusclopsWalkFootIndex = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk3EA > 300)
|
||||
if (gCurrentPinballGame->bossPositionY > 300)
|
||||
{
|
||||
gCurrentPinballGame->unk3EA--;
|
||||
gCurrentPinballGame->bossPositionY--;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((gCurrentPinballGame->unk3E2 % 4) != 0)
|
||||
if ((gCurrentPinballGame->bossFramesetIndex % 4) != 0)
|
||||
break;
|
||||
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->unk3E0 = 4;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->dusclopsWalkFootIndex = 4;
|
||||
|
||||
break;
|
||||
}
|
||||
case DUSCLOPS_ENTITY_STATE_HIT:
|
||||
{
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_HIT_STUN;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_HIT_STUN;
|
||||
tileOffset = DUSCLOPS_TILE_OFFSET_HIT;
|
||||
|
||||
m4aSongNumStart(SE_DUSCLOPS_HIT); //Dusclops hit
|
||||
|
|
@ -849,24 +849,24 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void)
|
|||
}
|
||||
case DUSCLOPS_ENTITY_STATE_HIT_STUN:
|
||||
{
|
||||
if (gCurrentPinballGame->unk3E4 <= 27)
|
||||
if (gCurrentPinballGame->bossFrameTimer <= 27)
|
||||
{
|
||||
tileOffset = DUSCLOPS_TILE_OFFSET_HIT;
|
||||
gCurrentPinballGame->unk3E4++;
|
||||
gCurrentPinballGame->bossFrameTimer++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->bonusModeHitCount < DUSCLOPS_HITS_NEEDED_TO_SUCCEED -1)
|
||||
{
|
||||
gCurrentPinballGame->unk3E4 = 128;
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->bossFrameTimer = 128;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->boardEntityCollisionMode = DUSCLOPS_ENTITY_COLLISION_MODE_NONE;
|
||||
tileOffset = DUSCLOPS_TILE_OFFSET_HIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_VANISH;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_VANISH;
|
||||
tileOffset = DUSCLOPS_TILE_OFFSET_HIT;
|
||||
}
|
||||
|
||||
|
|
@ -879,117 +879,117 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void)
|
|||
{
|
||||
struct Vector16 tempVector;
|
||||
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_ABSORB_START;
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_ABSORBED_BALL;
|
||||
gCurrentPinballGame->unk5A6 = 0;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_ABSORB_START;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_ABSORBED_BALL;
|
||||
gCurrentPinballGame->captureSequenceFrame = 0;
|
||||
tileOffset = DUSCLOPS_TILE_OFFSET_ABSORB_START;
|
||||
|
||||
m4aSongNumStart(SE_DUSCLOPS_BALL_ABSORB); //Dusclops absorbs ball
|
||||
gCurrentPinballGame->unk288 = (gCurrentPinballGame->unk3E8 / 10) + 32;
|
||||
gCurrentPinballGame->unk28A = (gCurrentPinballGame->unk3EA / 10) + 36;
|
||||
gCurrentPinballGame->catchTargetX = (gCurrentPinballGame->bossPositionX / 10) + 32;
|
||||
gCurrentPinballGame->catchTargetY = (gCurrentPinballGame->bossPositionY / 10) + 36;
|
||||
|
||||
tempVector.x = (gCurrentPinballGame->unk288 << 8) - gCurrentPinballGame->ball->positionQ8.x;
|
||||
tempVector.y = (gCurrentPinballGame->unk28A << 8) - gCurrentPinballGame->ball->positionQ8.y;
|
||||
tempVector.x = (gCurrentPinballGame->catchTargetX << 8) - gCurrentPinballGame->ball->positionQ8.x;
|
||||
tempVector.y = (gCurrentPinballGame->catchTargetY << 8) - gCurrentPinballGame->ball->positionQ8.y;
|
||||
|
||||
gCurrentPinballGame->unk5AC = (tempVector.x * tempVector.x) + (tempVector.y * tempVector.y);
|
||||
gCurrentPinballGame->unk5AC = Sqrt(gCurrentPinballGame->unk5AC * 4) / 2;
|
||||
gCurrentPinballGame->unk5B0 = ArcTan2(-tempVector.x, tempVector.y);
|
||||
gCurrentPinballGame->trapSpinRadius = (tempVector.x * tempVector.x) + (tempVector.y * tempVector.y);
|
||||
gCurrentPinballGame->trapSpinRadius = Sqrt(gCurrentPinballGame->trapSpinRadius * 4) / 2;
|
||||
gCurrentPinballGame->trapAngleQ16 = ArcTan2(-tempVector.x, tempVector.y);
|
||||
|
||||
PlayRumble(13);
|
||||
break;
|
||||
}
|
||||
case DUSCLOPS_ENTITY_STATE_ABSORBED_BALL:
|
||||
{
|
||||
if (DuclopsFramesetData[gCurrentPinballGame->unk3E2][1] > gCurrentPinballGame->unk3E4)
|
||||
gCurrentPinballGame->unk3E4++;
|
||||
if (DuclopsFramesetData[gCurrentPinballGame->bossFramesetIndex][1] > gCurrentPinballGame->bossFrameTimer)
|
||||
gCurrentPinballGame->bossFrameTimer++;
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk3E4 = 0;
|
||||
gCurrentPinballGame->unk3E2++;
|
||||
gCurrentPinballGame->bossFrameTimer = 0;
|
||||
gCurrentPinballGame->bossFramesetIndex++;
|
||||
|
||||
if (gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_ABSORB_LAUNCH_PREP)
|
||||
if (gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_ABSORB_LAUNCH_PREP)
|
||||
{
|
||||
gCurrentPinballGame->ball->velocity.x = (gMain.systemFrameCount % 2 * 300) + 65386;
|
||||
gCurrentPinballGame->ball->velocity.y = 300;
|
||||
gCurrentPinballGame->ball->unk0 = 0;
|
||||
gCurrentPinballGame->ball->ballHidden = 0;
|
||||
m4aSongNumStart(SE_DUSCLOPS_BALL_LAUNCH); //Dusclops launch ball
|
||||
PlayRumble(8);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_ABSOLB_LAUNCH)
|
||||
gCurrentPinballGame->unk1F = 0;
|
||||
if (gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_ABSOLB_LAUNCH)
|
||||
gCurrentPinballGame->ballFrozenState = 0;
|
||||
|
||||
if (gCurrentPinballGame->unk3E2 > DUSCLOPS_FRAME_ABSOLB_LAUNCH)
|
||||
if (gCurrentPinballGame->bossFramesetIndex > DUSCLOPS_FRAME_ABSOLB_LAUNCH)
|
||||
{
|
||||
gCurrentPinballGame->unk3E4 = 128;
|
||||
gCurrentPinballGame->unk3E2 = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->unk3DC = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
gCurrentPinballGame->bossFrameTimer = 128;
|
||||
gCurrentPinballGame->bossFramesetIndex = DUSCLOPS_FRAME_WALK_NEUTRAL;
|
||||
gCurrentPinballGame->bossEntityState = DUSCLOPS_ENTITY_STATE_GUARD_READY;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->ballSpeed != 0)
|
||||
{
|
||||
if ((gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_ABSOLB_LAUNCH) && (gCurrentPinballGame->unk3E4 > 4))
|
||||
if ((gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_ABSOLB_LAUNCH) && (gCurrentPinballGame->bossFrameTimer > 4))
|
||||
gCurrentPinballGame->boardEntityCollisionMode = DUSCLOPS_ENTITY_COLLISION_MODE_DUSCLOPS;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((gCurrentPinballGame->unk3E2 == DUSCLOPS_FRAME_ABSOLB_LAUNCH) && (gCurrentPinballGame->unk3E4 != 0))
|
||||
if ((gCurrentPinballGame->bossFramesetIndex == DUSCLOPS_FRAME_ABSOLB_LAUNCH) && (gCurrentPinballGame->bossFrameTimer != 0))
|
||||
gCurrentPinballGame->boardEntityCollisionMode = DUSCLOPS_ENTITY_COLLISION_MODE_DUSCLOPS;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk5A6 <= 29)
|
||||
if (gCurrentPinballGame->captureSequenceFrame <= 29)
|
||||
{
|
||||
s16 tr4 = 29 - gCurrentPinballGame->unk5A6;
|
||||
s16 tr4 = 29 - gCurrentPinballGame->captureSequenceFrame;
|
||||
s32 sl;
|
||||
|
||||
gCurrentPinballGame->unk5B0 -= ((tr4 * 8192) / 30) - 8192;
|
||||
gCurrentPinballGame->ball->unkA = gCurrentPinballGame->ball->unkA - 8192;
|
||||
gCurrentPinballGame->trapAngleQ16 -= ((tr4 * 8192) / 30) - 8192;
|
||||
gCurrentPinballGame->ball->spinAngle = gCurrentPinballGame->ball->spinAngle - 8192;
|
||||
|
||||
sl = (gCurrentPinballGame->unk5AC * tr4) / 30;
|
||||
sl = (gCurrentPinballGame->trapSpinRadius * tr4) / 30;
|
||||
|
||||
gCurrentPinballGame->ball->positionQ8.x = (gCurrentPinballGame->unk288 * 256) + ((Cos(gCurrentPinballGame->unk5B0) * sl) / 20000);
|
||||
gCurrentPinballGame->ball->positionQ8.x = (gCurrentPinballGame->catchTargetX * 256) + ((Cos(gCurrentPinballGame->trapAngleQ16) * sl) / 20000);
|
||||
|
||||
gCurrentPinballGame->ball->positionQ8.y = (gCurrentPinballGame->unk28A * 256) - ((Sin(gCurrentPinballGame->unk5B0) * sl) / 20000);
|
||||
gCurrentPinballGame->ball->positionQ8.y = (gCurrentPinballGame->catchTargetY * 256) - ((Sin(gCurrentPinballGame->trapAngleQ16) * sl) / 20000);
|
||||
|
||||
gCurrentPinballGame->ball->velocity.x = (gCurrentPinballGame->ball->velocity.x * 4) / 5;
|
||||
gCurrentPinballGame->ball->velocity.y = (gCurrentPinballGame->ball->velocity.y * 4) / 5;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk5A6 == 40)
|
||||
if (gCurrentPinballGame->captureSequenceFrame == 40)
|
||||
{
|
||||
gCurrentPinballGame->ball->unk0 = 1;
|
||||
gCurrentPinballGame->ball->ballHidden = 1;
|
||||
gCurrentPinballGame->ball->velocity.x = 0;
|
||||
gCurrentPinballGame->ball->velocity.y = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk5A6++;
|
||||
tileOffset = DuclopsFramesetData[gCurrentPinballGame->unk3E2][0];
|
||||
gCurrentPinballGame->captureSequenceFrame++;
|
||||
tileOffset = DuclopsFramesetData[gCurrentPinballGame->bossFramesetIndex][0];
|
||||
|
||||
break;
|
||||
}
|
||||
case DUSCLOPS_ENTITY_STATE_VANISH:
|
||||
{
|
||||
gCurrentPinballGame->unk294 = 3;
|
||||
gCurrentPinballGame->boardModeType = 3;
|
||||
gMain.modeChangeFlags = MODE_CHANGE_BONUS_BANNER;
|
||||
|
||||
if (gCurrentPinballGame->unk3E6 == 0)
|
||||
if (gCurrentPinballGame->bossAnimLoopCount == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk388 = 2;
|
||||
gCurrentPinballGame->unk392 = 0;
|
||||
gCurrentPinballGame->ballRespawnState = 2;
|
||||
gCurrentPinballGame->ballRespawnTimer = 0;
|
||||
}
|
||||
|
||||
tileOffset = DUSCLOPS_TILE_OFFSET_VANQUISHED;
|
||||
|
||||
if (gCurrentPinballGame->unk3E6 <= 183)
|
||||
if (gCurrentPinballGame->bossAnimLoopCount <= 183)
|
||||
{
|
||||
if (gCurrentPinballGame->unk3E6 <= 63)
|
||||
gCurrentPinballGame->unk3E6++;
|
||||
if (gCurrentPinballGame->bossAnimLoopCount <= 63)
|
||||
gCurrentPinballGame->bossAnimLoopCount++;
|
||||
else
|
||||
gCurrentPinballGame->unk3E6 += 2;
|
||||
gCurrentPinballGame->bossAnimLoopCount += 2;
|
||||
|
||||
if (gCurrentPinballGame->unk3E6 == 30)
|
||||
if (gCurrentPinballGame->bossAnimLoopCount == 30)
|
||||
{
|
||||
MPlayStart(&gMPlayInfo_SE1, &se_dusclops_appear);
|
||||
}
|
||||
|
|
@ -999,8 +999,8 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void)
|
|||
gMain.spriteGroups[13].available = FALSE;
|
||||
gMain.spriteGroups[14].available = FALSE;
|
||||
gMain.spriteGroups[12].available = FALSE;
|
||||
gCurrentPinballGame->unk13 = DUSCLOPS_BOARD_STATE_4_INIT_SCORE_PHASE;
|
||||
gCurrentPinballGame->unk18 = 0;
|
||||
gCurrentPinballGame->boardState = DUSCLOPS_BOARD_STATE_4_INIT_SCORE_PHASE;
|
||||
gCurrentPinballGame->stageTimer = 0;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
@ -1009,21 +1009,21 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void)
|
|||
|
||||
DmaCopy16(3 , gDusclopsBoardDusclops_Gfx + tileOffset * 1024, (void *)OBJ_VRAM0+0x10a0, BG_SCREEN_SIZE);
|
||||
|
||||
gCurrentPinballGame->unk3F0 = ((gCurrentPinballGame->unk3E8 / 10) * 2) + 16;
|
||||
gCurrentPinballGame->unk3F2 = ((gCurrentPinballGame->unk3EA / 10) * 2) + 16;
|
||||
gCurrentPinballGame->bossCollisionX = ((gCurrentPinballGame->bossPositionX / 10) * 2) + 16;
|
||||
gCurrentPinballGame->bossCollisionY = ((gCurrentPinballGame->bossPositionY / 10) * 2) + 16;
|
||||
|
||||
// Draw dusclops
|
||||
if(spriteGroup->available != 0)
|
||||
{
|
||||
struct OamDataSimple *new_var;
|
||||
spriteGroup->baseX = (-gCurrentPinballGame->unk58) + (gCurrentPinballGame->unk3E8 / 10);
|
||||
spriteGroup->baseY = (-gCurrentPinballGame->unk5A) + (gCurrentPinballGame->unk3EA / 10);
|
||||
spriteGroup->baseX = (-gCurrentPinballGame->cameraXOffset) + (gCurrentPinballGame->bossPositionX / 10);
|
||||
spriteGroup->baseY = (-gCurrentPinballGame->cameraYOffset) + (gCurrentPinballGame->bossPositionY / 10);
|
||||
|
||||
oamSimple = spriteGroup->oam;
|
||||
|
||||
if (tileOffset == DUSCLOPS_TILE_OFFSET_HIT)
|
||||
{
|
||||
if (gCurrentPinballGame->unk3E4 <= 5)
|
||||
if (gCurrentPinballGame->bossFrameTimer <= 5)
|
||||
gOamBuffer[oamSimple->oamId].paletteNum = 4;
|
||||
else
|
||||
gOamBuffer[oamSimple->oamId].paletteNum = 3;
|
||||
|
|
@ -1043,9 +1043,9 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void)
|
|||
{
|
||||
u32 offY = 92;
|
||||
|
||||
spriteGroup->baseX = -gCurrentPinballGame->unk58 + (gCurrentPinballGame->unk3E8 / 10);
|
||||
spriteGroup->baseY = -gCurrentPinballGame->unk5A + (gCurrentPinballGame->unk3EA / 10)
|
||||
+ ((gCurrentPinballGame->unk3E6 / 2) - offY);
|
||||
spriteGroup->baseX = -gCurrentPinballGame->cameraXOffset + (gCurrentPinballGame->bossPositionX / 10);
|
||||
spriteGroup->baseY = -gCurrentPinballGame->cameraYOffset + (gCurrentPinballGame->bossPositionY / 10)
|
||||
+ ((gCurrentPinballGame->bossAnimLoopCount / 2) - offY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1075,13 +1075,13 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void)
|
|||
{
|
||||
s32 offX = 16;
|
||||
s32 offY = 20;
|
||||
spriteGroup->baseX = gCurrentPinballGame->unk3E8 / 10 + offX - gCurrentPinballGame->unk58;
|
||||
if (gCurrentPinballGame->unk3E2 >= DUSCLOPS_FRAME_ABSORB_VORTEX_START &&
|
||||
gCurrentPinballGame->unk3E2 <= DUSCLOPS_FRAME_ABSORB_VORTEX_END )
|
||||
spriteGroup->baseX = gCurrentPinballGame->bossPositionX / 10 + offX - gCurrentPinballGame->cameraXOffset;
|
||||
if (gCurrentPinballGame->bossFramesetIndex >= DUSCLOPS_FRAME_ABSORB_VORTEX_START &&
|
||||
gCurrentPinballGame->bossFramesetIndex <= DUSCLOPS_FRAME_ABSORB_VORTEX_END )
|
||||
{
|
||||
s16 r0;
|
||||
spriteGroup->baseY = ((gCurrentPinballGame->unk3EA / 10) + offY) - gCurrentPinballGame->unk5A;
|
||||
r0 = gCurrentPinballGame->unk5A6 % 24;
|
||||
spriteGroup->baseY = ((gCurrentPinballGame->bossPositionY / 10) + offY) - gCurrentPinballGame->cameraYOffset;
|
||||
r0 = gCurrentPinballGame->captureSequenceFrame % 24;
|
||||
if(r0 <= 10)
|
||||
tileOffset = 0;
|
||||
else if (r0 <= 17)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -5,127 +5,127 @@
|
|||
#include "constants/bg_music.h"
|
||||
#include "constants/ruby_states.h"
|
||||
|
||||
extern const void (*gUnknown_086AD4C4[])(void);
|
||||
extern const void (*gUnknown_086AD4E8[])(void);
|
||||
extern const void (*gBoardStateInitFuncs[])(void);
|
||||
extern const void (*gBoardStateUpdateFuncs[])(void);
|
||||
|
||||
extern void sub_19D04(void);
|
||||
extern void sub_19E10(void);
|
||||
extern void sub_19F70(void);
|
||||
extern void sub_19FA0(void);
|
||||
extern void sub_1D5D8(void);
|
||||
extern void sub_1DA74(void);
|
||||
extern void sub_1DAD8(void);
|
||||
extern void HandleBoardStateTransitionTeardown(void);
|
||||
extern void UpdateRubyBoardEntityRendering(void);
|
||||
extern void UpdateRubyBoardEntityLogic(void);
|
||||
extern void HandleRubyFlipperButtonInput(void);
|
||||
extern void UpdateNuzleafEntity(void);
|
||||
extern void SelectShopDoorState(void);
|
||||
extern void AnimateShopDoor(void);
|
||||
extern void DrawWhiscash(void);
|
||||
extern void RubyPond_EntityLogic(void);
|
||||
extern void RubyPondTriBumperHandleHitAndDraw(void);
|
||||
extern void sub_1F158(void);
|
||||
extern void sub_1F59C(void);
|
||||
extern void sub_1F698(void);
|
||||
extern void sub_1FA48(void);
|
||||
extern void sub_1FBC4(void);
|
||||
extern void sub_1FF0C(void);
|
||||
extern void sub_201B8(void);
|
||||
extern void sub_21D78(void);
|
||||
extern void sub_23954(void);
|
||||
extern void sub_239A4(void);
|
||||
extern void sub_23E18(void);
|
||||
extern void sub_2C538(void);
|
||||
extern void sub_2C9A4(void);
|
||||
extern void sub_4E9F0(s16);
|
||||
extern void AnimateSharpedoEntity(void);
|
||||
extern void DrawPikachuSpinner(void);
|
||||
extern void UpdateChikoritaAttackAnimation(void);
|
||||
extern void AnimateChikoritaSprite(void);
|
||||
extern void UpdateGulpinBossState(void);
|
||||
extern void UpdateSideBumperAnimation(void);
|
||||
extern void DrawSideBumperSprites(void);
|
||||
extern void UpdateEvolutionShopSprite(void);
|
||||
extern void InitEggModeAnimation(void);
|
||||
extern void UpdateEggModeAnimation(void);
|
||||
extern void UpdateEggHatchDisplay(void);
|
||||
extern void UpdateRubyRampPrizeGate(void);
|
||||
extern void DrawRubyNuzleafPlatformSprite(void);
|
||||
extern void LoadShopItemGraphics(s16);
|
||||
|
||||
void RubyBoardProcess_3A_19A20(void)
|
||||
{
|
||||
gCurrentPinballGame->catchModeArrows = 2;
|
||||
sub_1D5D8();
|
||||
sub_4E9F0(0);
|
||||
sub_1DAD8();
|
||||
sub_23954();
|
||||
sub_239A4();
|
||||
UpdateNuzleafEntity();
|
||||
LoadShopItemGraphics(0);
|
||||
AnimateShopDoor();
|
||||
InitEggModeAnimation();
|
||||
UpdateEggModeAnimation();
|
||||
|
||||
gCurrentPinballGame->unk2D4 = 73;
|
||||
gCurrentPinballGame->unk2D6 = 154;
|
||||
gCurrentPinballGame->unk2DA = 0;
|
||||
sub_23E18();
|
||||
gCurrentPinballGame->cyndaquilCaveSpriteX = 73;
|
||||
gCurrentPinballGame->cyndaquilCaveSpriteY = 154;
|
||||
gCurrentPinballGame->eggCaveState = 0;
|
||||
UpdateEggHatchDisplay();
|
||||
RubyPond_EntityLogic();
|
||||
|
||||
gCurrentPinballGame->unk170[0] = 10;
|
||||
gCurrentPinballGame->unk170[1] = 10;
|
||||
gCurrentPinballGame->unk170[2] = 10;
|
||||
gCurrentPinballGame->pondBumperStates[0] = 10;
|
||||
gCurrentPinballGame->pondBumperStates[1] = 10;
|
||||
gCurrentPinballGame->pondBumperStates[2] = 10;
|
||||
gCurrentPinballGame->rubyPondState = RUBY_POND_STATE_CHINCHOU_STAGGERED;
|
||||
RubyPondTriBumperHandleHitAndDraw();
|
||||
sub_1F158();
|
||||
AnimateSharpedoEntity();
|
||||
|
||||
gCurrentPinballGame->unk1E5 = 0;
|
||||
gCurrentPinballGame->unk1E6 = 1;
|
||||
sub_1F2A4();
|
||||
sub_21B0C();
|
||||
sub_1F59C();
|
||||
gCurrentPinballGame->pikachuSpinFrame = 0;
|
||||
gCurrentPinballGame->pikachuSpinPrevFrame = 1;
|
||||
UpdatePikachuChargeCounter();
|
||||
AnimateCatchCounterDisplay();
|
||||
DrawPikachuSpinner();
|
||||
|
||||
gCurrentPinballGame->unk1D8 = 256;
|
||||
gCurrentPinballGame->unk1DA = 256;
|
||||
gCurrentPinballGame->unk29F = 2;
|
||||
sub_2C9A4();
|
||||
gCurrentPinballGame->catchCounterAnimState = 256;
|
||||
gCurrentPinballGame->catchCounterScaleY = 256;
|
||||
gCurrentPinballGame->rampPrizeType = 2;
|
||||
DrawRubyNuzleafPlatformSprite();
|
||||
|
||||
gCurrentPinballGame->unk2EC[0] = 3;
|
||||
gCurrentPinballGame->unk2EC[1] = 3;
|
||||
sub_31B30();
|
||||
gCurrentPinballGame->sideBumperShakeOffset[0] = 3;
|
||||
gCurrentPinballGame->sideBumperShakeOffset[1] = 3;
|
||||
DrawBoardEdgeBanner();
|
||||
}
|
||||
|
||||
void RubyBoardProcess_3B_19B10(void)
|
||||
{
|
||||
sub_19B90();
|
||||
sub_19E10();
|
||||
BoardStateDispatcher();
|
||||
UpdateRubyBoardEntityRendering();
|
||||
|
||||
if (gMain.modeChangeFlags == MODE_CHANGE_NONE)
|
||||
{
|
||||
sub_19F70();
|
||||
UpdateRubyBoardEntityLogic();
|
||||
}
|
||||
|
||||
sub_19FA0();
|
||||
if (gCurrentPinballGame->unk29C != 0)
|
||||
HandleRubyFlipperButtonInput();
|
||||
if (gCurrentPinballGame->bgmFadeTimer != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk29C--;
|
||||
if (gCurrentPinballGame->unk29C == 0)
|
||||
gCurrentPinballGame->bgmFadeTimer--;
|
||||
if (gCurrentPinballGame->bgmFadeTimer == 0)
|
||||
{
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_19B64(u8 arg0)
|
||||
void RequestBoardStateTransition(u8 arg0)
|
||||
{
|
||||
gCurrentPinballGame->unk16 = 2;
|
||||
gCurrentPinballGame->unk14 = arg0;
|
||||
if (gCurrentPinballGame->unk13 == 2)
|
||||
gMain.unk44[13]->available = 0;
|
||||
gCurrentPinballGame->boardTransitionPhase = 2;
|
||||
gCurrentPinballGame->nextBoardState = arg0;
|
||||
if (gCurrentPinballGame->boardState == 2)
|
||||
gMain.fieldSpriteGroups[13]->available = 0;
|
||||
}
|
||||
|
||||
void sub_19B90(void)
|
||||
void BoardStateDispatcher(void)
|
||||
{
|
||||
switch (gCurrentPinballGame->unk16)
|
||||
switch (gCurrentPinballGame->boardTransitionPhase)
|
||||
{
|
||||
case 0:
|
||||
gUnknown_086AD4C4[gCurrentPinballGame->unk13]();
|
||||
gCurrentPinballGame->unk16++;
|
||||
gBoardStateInitFuncs[gCurrentPinballGame->boardState]();
|
||||
gCurrentPinballGame->boardTransitionPhase++;
|
||||
break;
|
||||
case 1:
|
||||
gUnknown_086AD4E8[gCurrentPinballGame->unk13]();
|
||||
gBoardStateUpdateFuncs[gCurrentPinballGame->boardState]();
|
||||
break;
|
||||
case 2:
|
||||
sub_19D04();
|
||||
gCurrentPinballGame->unk15 = gCurrentPinballGame->unk13;
|
||||
gCurrentPinballGame->unk13 = gCurrentPinballGame->unk14;
|
||||
gCurrentPinballGame->unk16 = 0;
|
||||
HandleBoardStateTransitionTeardown();
|
||||
gCurrentPinballGame->prevBoardState = gCurrentPinballGame->boardState;
|
||||
gCurrentPinballGame->boardState = gCurrentPinballGame->nextBoardState;
|
||||
gCurrentPinballGame->boardTransitionPhase = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_19C04(void)
|
||||
void InitFieldIdle(void)
|
||||
{
|
||||
s16 num1;
|
||||
u8 num2;
|
||||
|
||||
if (gCurrentPinballGame->unk15 > 0)
|
||||
if (gCurrentPinballGame->prevBoardState > 0)
|
||||
{
|
||||
if (gMain.selectedField == FIELD_RUBY)
|
||||
{
|
||||
|
|
@ -153,100 +153,100 @@ void sub_19C04(void)
|
|||
}
|
||||
}
|
||||
|
||||
num2 = gCurrentPinballGame->unk15 - 1;
|
||||
num2 = gCurrentPinballGame->prevBoardState - 1;
|
||||
if (num2 > 1)
|
||||
{
|
||||
gCurrentPinballGame->unk72E = gCurrentPinballGame->unk73C;
|
||||
gCurrentPinballGame->unk72F = gCurrentPinballGame->catchModeArrows;
|
||||
gCurrentPinballGame->unk73C = 0;
|
||||
gCurrentPinballGame->evoArrowProgress = gCurrentPinballGame->arrowProgressPreserved;
|
||||
gCurrentPinballGame->catchArrowProgress = gCurrentPinballGame->catchModeArrows;
|
||||
gCurrentPinballGame->arrowProgressPreserved = 0;
|
||||
gCurrentPinballGame->catchModeArrows = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_19CC8(void)
|
||||
void UpdateFieldIdle(void)
|
||||
{
|
||||
if (gCurrentPinballGame->unk714 != 0)
|
||||
if (gCurrentPinballGame->allHolesLit != 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk6EE != 0)
|
||||
if (gCurrentPinballGame->allHolesLitDelayTimer != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk6EE--;
|
||||
gCurrentPinballGame->allHolesLitDelayTimer--;
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_19B64(2);
|
||||
RequestBoardStateTransition(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_19D04(void)
|
||||
void HandleBoardStateTransitionTeardown(void)
|
||||
{
|
||||
if (gCurrentPinballGame->unk13 == 2 && gCurrentPinballGame->unk14 > 2)
|
||||
sub_21238(0);
|
||||
if (gCurrentPinballGame->boardState == 2 && gCurrentPinballGame->nextBoardState > 2)
|
||||
ResetCatchState(0);
|
||||
|
||||
if (gCurrentPinballGame->unk13 > 2)
|
||||
if (gCurrentPinballGame->boardState > 2)
|
||||
return;
|
||||
|
||||
if (gCurrentPinballGame->unk14 == 3)
|
||||
if (gCurrentPinballGame->nextBoardState == 3)
|
||||
{
|
||||
gCurrentPinballGame->unk73C = gCurrentPinballGame->unk72E;
|
||||
gCurrentPinballGame->catchModeArrows = gCurrentPinballGame->unk72F;
|
||||
gCurrentPinballGame->unk72E = 0;
|
||||
gCurrentPinballGame->unk72F = 0;
|
||||
gCurrentPinballGame->arrowProgressPreserved = gCurrentPinballGame->evoArrowProgress;
|
||||
gCurrentPinballGame->catchModeArrows = gCurrentPinballGame->catchArrowProgress;
|
||||
gCurrentPinballGame->evoArrowProgress = 0;
|
||||
gCurrentPinballGame->catchArrowProgress = 0;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk14 == 4)
|
||||
if (gCurrentPinballGame->nextBoardState == 4)
|
||||
{
|
||||
gCurrentPinballGame->unk73C = gCurrentPinballGame->unk72E;
|
||||
gCurrentPinballGame->catchModeArrows = gCurrentPinballGame->unk72F;
|
||||
gCurrentPinballGame->unk72E = 0;
|
||||
gCurrentPinballGame->unk72F = 0;
|
||||
gCurrentPinballGame->arrowProgressPreserved = gCurrentPinballGame->evoArrowProgress;
|
||||
gCurrentPinballGame->catchModeArrows = gCurrentPinballGame->catchArrowProgress;
|
||||
gCurrentPinballGame->evoArrowProgress = 0;
|
||||
gCurrentPinballGame->catchArrowProgress = 0;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk14 == 6)
|
||||
else if (gCurrentPinballGame->nextBoardState == 6)
|
||||
{
|
||||
gCurrentPinballGame->catchModeArrows = gCurrentPinballGame->unk72F;
|
||||
gCurrentPinballGame->unk73C = 0;
|
||||
gCurrentPinballGame->unk72E = 0;
|
||||
gCurrentPinballGame->unk72F = 0;
|
||||
gCurrentPinballGame->catchModeArrows = gCurrentPinballGame->catchArrowProgress;
|
||||
gCurrentPinballGame->arrowProgressPreserved = 0;
|
||||
gCurrentPinballGame->evoArrowProgress = 0;
|
||||
gCurrentPinballGame->catchArrowProgress = 0;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk14 > 3)
|
||||
else if (gCurrentPinballGame->nextBoardState > 3)
|
||||
{
|
||||
gCurrentPinballGame->unk73C = gCurrentPinballGame->unk72E;
|
||||
gCurrentPinballGame->catchModeArrows = gCurrentPinballGame->unk72F;
|
||||
gCurrentPinballGame->unk72E = 0;
|
||||
gCurrentPinballGame->unk72F = 0;
|
||||
gCurrentPinballGame->arrowProgressPreserved = gCurrentPinballGame->evoArrowProgress;
|
||||
gCurrentPinballGame->catchModeArrows = gCurrentPinballGame->catchArrowProgress;
|
||||
gCurrentPinballGame->evoArrowProgress = 0;
|
||||
gCurrentPinballGame->catchArrowProgress = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_19E10(void)
|
||||
void UpdateRubyBoardEntityRendering(void)
|
||||
{
|
||||
int randNum;
|
||||
|
||||
sub_1A0F4();
|
||||
sub_1DA74();
|
||||
if (gCurrentPinballGame->unk2A0 != 0)
|
||||
ProcessBannerCameraTransition();
|
||||
SelectShopDoorState();
|
||||
if (gCurrentPinballGame->rampPrizeRespawnTimer != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk2A0--;
|
||||
if (gCurrentPinballGame->unk2A0 == 0)
|
||||
gCurrentPinballGame->rampPrizeRespawnTimer--;
|
||||
if (gCurrentPinballGame->rampPrizeRespawnTimer == 0)
|
||||
{
|
||||
randNum = Random();
|
||||
gCurrentPinballGame->unk29F = ((randNum + gMain.systemFrameCount) % 100) + 1;
|
||||
gCurrentPinballGame->rampPrizeType = ((randNum + gMain.systemFrameCount) % 100) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk68 < 110)
|
||||
if (gCurrentPinballGame->cameraYViewport < 110)
|
||||
{
|
||||
sub_1D5D8();
|
||||
sub_1DAD8();
|
||||
sub_2C9A4();
|
||||
UpdateNuzleafEntity();
|
||||
AnimateShopDoor();
|
||||
DrawRubyNuzleafPlatformSprite();
|
||||
}
|
||||
sub_2CA9C();
|
||||
if (gCurrentPinballGame->unk68 < 168)
|
||||
AnimateOneUpSprite();
|
||||
if (gCurrentPinballGame->cameraYViewport < 168)
|
||||
{
|
||||
sub_239A4();
|
||||
UpdateEggModeAnimation();
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 < 220)
|
||||
if (gCurrentPinballGame->cameraYViewport < 220)
|
||||
{
|
||||
sub_23E18();
|
||||
UpdateEggHatchDisplay();
|
||||
if (gCurrentPinballGame->shouldProcessWhiscash)
|
||||
{
|
||||
DrawWhiscash();
|
||||
|
|
@ -255,72 +255,72 @@ void sub_19E10(void)
|
|||
{
|
||||
RubyPondTriBumperHandleHitAndDraw();
|
||||
}
|
||||
sub_1F158();
|
||||
sub_1F59C();
|
||||
AnimateSharpedoEntity();
|
||||
DrawPikachuSpinner();
|
||||
}
|
||||
sub_1F698();
|
||||
if (gCurrentPinballGame->unk68 > 63)
|
||||
UpdateChikoritaAttackAnimation();
|
||||
if (gCurrentPinballGame->cameraYViewport > 63)
|
||||
{
|
||||
sub_1FA48();
|
||||
sub_1FBC4();
|
||||
AnimateChikoritaSprite();
|
||||
UpdateGulpinBossState();
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 > 115)
|
||||
if (gCurrentPinballGame->cameraYViewport > 115)
|
||||
{
|
||||
sub_2C538();
|
||||
UpdateRubyRampPrizeGate();
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 > 130)
|
||||
if (gCurrentPinballGame->cameraYViewport > 130)
|
||||
{
|
||||
sub_201B8();
|
||||
DrawSideBumperSprites();
|
||||
}
|
||||
sub_2CE80();
|
||||
if (gCurrentPinballGame->unk68 > 168)
|
||||
UpdateSpoinkAnimation();
|
||||
if (gCurrentPinballGame->cameraYViewport > 168)
|
||||
{
|
||||
sub_2D104();
|
||||
DrawSpoinkSprite();
|
||||
}
|
||||
sub_203CC();
|
||||
sub_21B0C();
|
||||
sub_4E814();
|
||||
sub_1D128();
|
||||
sub_21D78();
|
||||
sub_31B30();
|
||||
UpdateCatchModeLogic();
|
||||
AnimateCatchCounterDisplay();
|
||||
UpdateRubyBoardAnimations();
|
||||
UpdatePortraitSpritePositions();
|
||||
UpdateEvolutionShopSprite();
|
||||
DrawBoardEdgeBanner();
|
||||
|
||||
if (gCurrentPinballGame->unk194 != 0)
|
||||
if (gCurrentPinballGame->coinRewardAmount != 0)
|
||||
{
|
||||
sub_225F0();
|
||||
AnimateCoinReward();
|
||||
}
|
||||
BonusStage_HandleModeChangeFlags();
|
||||
|
||||
if (gCurrentPinballGame->unk1328 != 0)
|
||||
if (gCurrentPinballGame->ballLaunchTimer != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1328--;
|
||||
if (gCurrentPinballGame->unk1328 == 0)
|
||||
gCurrentPinballGame->ballLaunchTimer--;
|
||||
if (gCurrentPinballGame->ballLaunchTimer == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1330 = gCurrentPinballGame->unk1334;
|
||||
gCurrentPinballGame->secondaryBall = gCurrentPinballGame->ballStates;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_19F70(void)
|
||||
void UpdateRubyBoardEntityLogic(void)
|
||||
{
|
||||
RubyPond_EntityLogic();
|
||||
sub_1A9E8();
|
||||
sub_1F2A4();
|
||||
sub_1FF0C();
|
||||
if (gCurrentPinballGame->unk600 != 0)
|
||||
UpdateRubyCatchModeAnimation();
|
||||
UpdatePikachuChargeCounter();
|
||||
UpdateSideBumperAnimation();
|
||||
if (gCurrentPinballGame->mainBoardCountdownTimer != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk600--;
|
||||
gCurrentPinballGame->mainBoardCountdownTimer--;
|
||||
}
|
||||
}
|
||||
|
||||
//Duplicate of sub_32DF8, with "gCurrentPinballGame->unk301 = 1;" added in the final if statement
|
||||
void sub_19FA0(void)
|
||||
//Duplicate of HandleSapphireFlipperButtonInput, with "gCurrentPinballGame->rampGateHitFlag = 1;" added in the final if statement
|
||||
void HandleRubyFlipperButtonInput(void)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
if (gCurrentPinballGame->newButtonActions[0])
|
||||
{
|
||||
if (gCurrentPinballGame->unk1C4 == 0 && gCurrentPinballGame->outLanePikaPosition != 2 &&
|
||||
gCurrentPinballGame->unk1C0 == 0 && gCurrentPinballGame->unk61C == 0)
|
||||
if (gCurrentPinballGame->pikaKickbackTimer == 0 && gCurrentPinballGame->outLanePikaPosition != 2 &&
|
||||
gCurrentPinballGame->pikaSaverTimer == 0 && gCurrentPinballGame->entityOverlayCollisionState == 0)
|
||||
{
|
||||
gCurrentPinballGame->outLanePikaPosition = 0;
|
||||
}
|
||||
|
|
@ -339,8 +339,8 @@ void sub_19FA0(void)
|
|||
|
||||
if (gCurrentPinballGame->newButtonActions[1])
|
||||
{
|
||||
if (gCurrentPinballGame->unk1C4 == 0 && gCurrentPinballGame->outLanePikaPosition != 2 &&
|
||||
gCurrentPinballGame->unk1C0 == 0 && gCurrentPinballGame->unk61C == 0)
|
||||
if (gCurrentPinballGame->pikaKickbackTimer == 0 && gCurrentPinballGame->outLanePikaPosition != 2 &&
|
||||
gCurrentPinballGame->pikaSaverTimer == 0 && gCurrentPinballGame->entityOverlayCollisionState == 0)
|
||||
{
|
||||
gCurrentPinballGame->outLanePikaPosition = 1;
|
||||
}
|
||||
|
|
@ -356,6 +356,6 @@ void sub_19FA0(void)
|
|||
gCurrentPinballGame->ballPowerUpLight[1] = gCurrentPinballGame->ballPowerUpLight[0];
|
||||
gCurrentPinballGame->ballPowerUpLight[0] = tmp;
|
||||
|
||||
gCurrentPinballGame->unk301 = 1;
|
||||
gCurrentPinballGame->rampGateHitFlag = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,198 +5,198 @@
|
|||
#include "constants/bg_music.h"
|
||||
//#include "constants/pinball_game.h"
|
||||
|
||||
extern void sub_32DF8(void);
|
||||
extern void HandleSapphireFlipperButtonInput(void);
|
||||
|
||||
void SapphireBoardProcess_3A_326F4(void)
|
||||
{
|
||||
gCurrentPinballGame->catchModeArrows = 2;
|
||||
gCurrentPinballGame->unk1E5 = 0;
|
||||
gCurrentPinballGame->unk1E6 = 1;
|
||||
gCurrentPinballGame->pikachuSpinFrame = 0;
|
||||
gCurrentPinballGame->pikachuSpinPrevFrame = 1;
|
||||
|
||||
sub_1F2A4();
|
||||
sub_21B0C();
|
||||
sub_1F59C();
|
||||
sub_300D8();
|
||||
sub_30178();
|
||||
UpdatePikachuChargeCounter();
|
||||
AnimateCatchCounterDisplay();
|
||||
DrawPikachuSpinner();
|
||||
CalculateRubyBumperBounce();
|
||||
HandleRubyBumperHit();
|
||||
|
||||
gCurrentPinballGame->unk1D8 = 0x100;
|
||||
gCurrentPinballGame->unk1DA = 0x100;
|
||||
gCurrentPinballGame->catchCounterAnimState = 0x100;
|
||||
gCurrentPinballGame->catchCounterScaleY = 0x100;
|
||||
|
||||
sub_30480();
|
||||
sub_304C8();
|
||||
sub_31144();
|
||||
sub_313A0();
|
||||
sub_2E6AC();
|
||||
sub_31B30();
|
||||
InitSapphireEggCaveState();
|
||||
UpdateSapphireEggCaveAnimation();
|
||||
UpdateSapphireShopSignAnimation();
|
||||
DrawSapphireShopSignSprite();
|
||||
UpdatePelipperPondEntity();
|
||||
DrawBoardEdgeBanner();
|
||||
}
|
||||
|
||||
void SapphireBoardProcess_3B_3276C(void)
|
||||
{
|
||||
sub_19B90();
|
||||
sub_327C0();
|
||||
BoardStateDispatcher();
|
||||
UpdateSapphireBoardEntityRendering();
|
||||
|
||||
if (!gMain.modeChangeFlags)
|
||||
sub_328C8();
|
||||
UpdateSapphireBoardEntityLogic();
|
||||
|
||||
sub_32DF8();
|
||||
HandleSapphireFlipperButtonInput();
|
||||
|
||||
if (gCurrentPinballGame->unk29C)
|
||||
if (gCurrentPinballGame->bgmFadeTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk29C--;
|
||||
if (!gCurrentPinballGame->unk29C)
|
||||
gCurrentPinballGame->bgmFadeTimer--;
|
||||
if (!gCurrentPinballGame->bgmFadeTimer)
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_327C0(void)
|
||||
void UpdateSapphireBoardEntityRendering(void)
|
||||
{
|
||||
s32 temp;
|
||||
|
||||
sub_4F814();
|
||||
sub_1A0F4();
|
||||
sub_2CA9C();
|
||||
UpdateSapphireBoardAnimations();
|
||||
ProcessBannerCameraTransition();
|
||||
AnimateOneUpSprite();
|
||||
|
||||
if (gCurrentPinballGame->unk68 < 0x5a)
|
||||
if (gCurrentPinballGame->cameraYViewport < 0x5a)
|
||||
{
|
||||
sub_304C8();
|
||||
sub_31498();
|
||||
UpdateSapphireEggCaveAnimation();
|
||||
UpdateSapphireHoleLetterSystem();
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk13 < 3)
|
||||
if (gCurrentPinballGame->boardState < 3)
|
||||
{
|
||||
if (gCurrentPinballGame->unk345 == 3 && gCurrentPinballGame->unk346 == 0)
|
||||
if (gCurrentPinballGame->holeLetterCount == 3 && gCurrentPinballGame->holeLetterSystemState == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk728 = 1;
|
||||
gCurrentPinballGame->catchArrowPaletteActive = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk728 = 0;
|
||||
gCurrentPinballGame->catchArrowPaletteActive = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk728 = 0;
|
||||
gCurrentPinballGame->catchArrowPaletteActive = 0;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk68 < 0x96)
|
||||
if (gCurrentPinballGame->cameraYViewport < 0x96)
|
||||
{
|
||||
sub_2E6AC();
|
||||
sub_313A0();
|
||||
UpdatePelipperPondEntity();
|
||||
DrawSapphireShopSignSprite();
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 < 0xC4)
|
||||
if (gCurrentPinballGame->cameraYViewport < 0xC4)
|
||||
{
|
||||
sub_30178();
|
||||
sub_2F140();
|
||||
HandleRubyBumperHit();
|
||||
AnimateWailmerEntity();
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 < 0xCA)
|
||||
if (gCurrentPinballGame->cameraYViewport < 0xCA)
|
||||
{
|
||||
sub_2FCD0();
|
||||
DrawSapphireBumperSprites();
|
||||
}
|
||||
if (gCurrentPinballGame->unk68 < 0xDC)
|
||||
if (gCurrentPinballGame->cameraYViewport < 0xDC)
|
||||
{
|
||||
sub_1F59C();
|
||||
DrawPikachuSpinner();
|
||||
}
|
||||
|
||||
sub_308DC();
|
||||
UpdateSapphireSeedotCollection();
|
||||
|
||||
if (0x76 < gCurrentPinballGame->unk68)
|
||||
if (0x76 < gCurrentPinballGame->cameraYViewport)
|
||||
{
|
||||
sub_2F504();
|
||||
sub_30EB4();
|
||||
DrawZigzagoonAndShockWall();
|
||||
DrawSapphireSeedotAndBasketSprites();
|
||||
}
|
||||
|
||||
sub_2CE80();
|
||||
UpdateSpoinkAnimation();
|
||||
|
||||
if (0xA8 < gCurrentPinballGame->unk68)
|
||||
sub_2D104();
|
||||
if (0xA8 < gCurrentPinballGame->cameraYViewport)
|
||||
DrawSpoinkSprite();
|
||||
|
||||
sub_203CC();
|
||||
sub_21B0C();
|
||||
sub_1D128();
|
||||
sub_31B30();
|
||||
UpdateCatchModeLogic();
|
||||
AnimateCatchCounterDisplay();
|
||||
UpdatePortraitSpritePositions();
|
||||
DrawBoardEdgeBanner();
|
||||
|
||||
if (gCurrentPinballGame->unk194)
|
||||
sub_225F0();
|
||||
if (gCurrentPinballGame->coinRewardAmount)
|
||||
AnimateCoinReward();
|
||||
|
||||
BonusStage_HandleModeChangeFlags();
|
||||
}
|
||||
|
||||
void sub_328C8(void)
|
||||
void UpdateSapphireBoardEntityLogic(void)
|
||||
{
|
||||
sub_300D8();
|
||||
sub_32968();
|
||||
sub_1F2A4();
|
||||
CalculateRubyBumperBounce();
|
||||
UpdateSapphireCatchModeAnimation();
|
||||
UpdatePikachuChargeCounter();
|
||||
|
||||
if (gCurrentPinballGame->unk600)
|
||||
gCurrentPinballGame->unk600--;
|
||||
if (gCurrentPinballGame->mainBoardCountdownTimer)
|
||||
gCurrentPinballGame->mainBoardCountdownTimer--;
|
||||
|
||||
sub_2F26C();
|
||||
sub_2E67C();
|
||||
sub_31144();
|
||||
UpdateZigzagoonEntity();
|
||||
DecrementFieldTimer();
|
||||
UpdateSapphireShopSignAnimation();
|
||||
|
||||
if (!(gMain.modeChangeFlags & MODE_CHANGE_END_OF_GAME))
|
||||
sub_2F79C();
|
||||
UpdateSapphireBumperLogic();
|
||||
}
|
||||
|
||||
void sub_32914(void)
|
||||
void DispatchSapphireCatchModeInit(void)
|
||||
{
|
||||
if (gMain.modeChangeFlags != MODE_CHANGE_NONE)
|
||||
return;
|
||||
|
||||
switch (gCurrentPinballGame->unk25)
|
||||
switch (gCurrentPinballGame->ballCatchState)
|
||||
{
|
||||
case 1:
|
||||
sub_32B74();
|
||||
InitSapphireWailmerCatch();
|
||||
break;
|
||||
case 3:
|
||||
sub_329B0();
|
||||
InitSapphireEvolutionShopCatch();
|
||||
break;
|
||||
case 4:
|
||||
sub_1C560();
|
||||
InitCenterTrapMode();
|
||||
break;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk26 = 60;
|
||||
gCurrentPinballGame->collisionCooldownTimer = 60;
|
||||
}
|
||||
|
||||
void sub_32968(void)
|
||||
void UpdateSapphireCatchModeAnimation(void)
|
||||
{
|
||||
if (gCurrentPinballGame->unk26)
|
||||
gCurrentPinballGame->unk26--;
|
||||
if (gCurrentPinballGame->collisionCooldownTimer)
|
||||
gCurrentPinballGame->collisionCooldownTimer--;
|
||||
|
||||
switch (gCurrentPinballGame->unk25)
|
||||
switch (gCurrentPinballGame->ballCatchState)
|
||||
{
|
||||
case 1:
|
||||
sub_32BE4();
|
||||
UpdateSapphireWailmerCatchSequence();
|
||||
break;
|
||||
case 3:
|
||||
sub_329F4();
|
||||
UpdateSapphireEvolutionShopSequence();
|
||||
break;
|
||||
case 4:
|
||||
sub_1C5AC(); //Center Hole
|
||||
AnimateCenterTrapSequence(); //Center Hole
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_329B0(void)
|
||||
void InitSapphireEvolutionShopCatch(void)
|
||||
{
|
||||
gCurrentPinballGame->unk28 = 0xB4;
|
||||
gCurrentPinballGame->unk1BA = 0xB4;
|
||||
gCurrentPinballGame->modeAnimTimer = 0xB4;
|
||||
gCurrentPinballGame->shopEntryTimer = 0xB4;
|
||||
gCurrentPinballGame->scoreAddedInFrame = 500000;
|
||||
gMain.blendControl = 0xCE;
|
||||
gMain.blendBrightness = 0;
|
||||
gCurrentPinballGame->unk5F7 = 1;
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 1;
|
||||
}
|
||||
|
||||
void sub_329F4(void)
|
||||
void UpdateSapphireEvolutionShopSequence(void)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
if (gCurrentPinballGame->unk28 > 0x18)
|
||||
if (gCurrentPinballGame->modeAnimTimer > 0x18)
|
||||
{
|
||||
gCurrentPinballGame->ball->unk0 = 1;
|
||||
gCurrentPinballGame->unk1F = 1;
|
||||
gCurrentPinballGame->unk28--;
|
||||
gCurrentPinballGame->ball->ballHidden = 1;
|
||||
gCurrentPinballGame->ballFrozenState = 1;
|
||||
gCurrentPinballGame->modeAnimTimer--;
|
||||
gCurrentPinballGame->ball->velocity.x = 0;
|
||||
gCurrentPinballGame->ball->velocity.y = 0;
|
||||
gCurrentPinballGame->ball->positionQ0.x = 58;
|
||||
|
|
@ -206,128 +206,128 @@ void sub_329F4(void)
|
|||
gCurrentPinballGame->ball->positionQ8.x = gCurrentPinballGame->ball->positionQ0.x << 8;
|
||||
gCurrentPinballGame->ball->positionQ8.y = gCurrentPinballGame->ball->positionQ0.y << 8;
|
||||
|
||||
if (gCurrentPinballGame->unk28 <= 0x31)
|
||||
if (gCurrentPinballGame->modeAnimTimer <= 0x31)
|
||||
{
|
||||
gCurrentPinballGame->unk28++;
|
||||
gCurrentPinballGame->modeAnimTimer++;
|
||||
}
|
||||
|
||||
sub_1B140(gCurrentPinballGame->unk1A5);
|
||||
UpdateShopEntryAnimation(gCurrentPinballGame->evolutionShopActive);
|
||||
|
||||
if (gCurrentPinballGame->unk1A5)
|
||||
if (gCurrentPinballGame->evolutionShopActive)
|
||||
{
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
gCurrentPinballGame->unk36C[i] = 10;
|
||||
gCurrentPinballGame->unk36E[i] = 0;
|
||||
gCurrentPinballGame->unk36A[i] = 4;
|
||||
gCurrentPinballGame->sapphireBumperAnimKeyframe[i] = 10;
|
||||
gCurrentPinballGame->sapphireBumperAnimSubTimer[i] = 0;
|
||||
gCurrentPinballGame->sapphireBumperState[i] = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (gCurrentPinballGame->unk28 > 0)
|
||||
else if (gCurrentPinballGame->modeAnimTimer > 0)
|
||||
{
|
||||
gCurrentPinballGame->unk28--;
|
||||
gCurrentPinballGame->modeAnimTimer--;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->ball->unk0 = 0;
|
||||
gCurrentPinballGame->unk1F = 0;
|
||||
gCurrentPinballGame->unk26 = 0x3C;
|
||||
gCurrentPinballGame->ball->ballHidden = 0;
|
||||
gCurrentPinballGame->ballFrozenState = 0;
|
||||
gCurrentPinballGame->collisionCooldownTimer = 0x3C;
|
||||
gCurrentPinballGame->ball->velocity.x = 0x60;
|
||||
gCurrentPinballGame->ball->velocity.y = 0xC0;
|
||||
gCurrentPinballGame->ball->positionQ0.x = 0x3C;
|
||||
gCurrentPinballGame->ball->positionQ0.y = 0xB4;
|
||||
gCurrentPinballGame->ball->unk6 = 0;
|
||||
gCurrentPinballGame->unk5F7 = 0;
|
||||
gCurrentPinballGame->ball->spinSpeed = 0;
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 0;
|
||||
gCurrentPinballGame->ball->positionQ1.x = gCurrentPinballGame->ball->positionQ0.x * 2;
|
||||
gCurrentPinballGame->ball->positionQ1.y = gCurrentPinballGame->ball->positionQ0.y * 2;
|
||||
gCurrentPinballGame->unk25 = 0;
|
||||
gCurrentPinballGame->ballCatchState = 0;
|
||||
|
||||
m4aSongNumStart(SE_UNKNOWN_0xC3);
|
||||
|
||||
if (gCurrentPinballGame->unk72E > 2 && gCurrentPinballGame->evolvablePartySize > 0) {
|
||||
sub_19B64(6);
|
||||
if (gCurrentPinballGame->evoArrowProgress > 2 && gCurrentPinballGame->evolvablePartySize > 0) {
|
||||
RequestBoardStateTransition(6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_32B74(void)
|
||||
void InitSapphireWailmerCatch(void)
|
||||
{
|
||||
if (gCurrentPinballGame->unk72F > 1)
|
||||
sub_19B64(4);
|
||||
if (gCurrentPinballGame->catchArrowProgress > 1)
|
||||
RequestBoardStateTransition(4);
|
||||
|
||||
gCurrentPinballGame->unk28 = 100;
|
||||
gCurrentPinballGame->unk2F4 = 2;
|
||||
gCurrentPinballGame->unk5FC = 0;
|
||||
gCurrentPinballGame->unk5FE = 30;
|
||||
gCurrentPinballGame->unk5FB = 0;
|
||||
gCurrentPinballGame->modeAnimTimer = 100;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 2;
|
||||
gCurrentPinballGame->cameraScrollOffset = 0;
|
||||
gCurrentPinballGame->cameraScrollTarget = 30;
|
||||
gCurrentPinballGame->cameraScrollEnabled = 0;
|
||||
gCurrentPinballGame->scoreAddedInFrame = 50000;
|
||||
|
||||
m4aSongNumStart(SE_WHISCASH_CATCH_BALL);
|
||||
PlayRumble(8);
|
||||
}
|
||||
|
||||
void sub_32BE4(void)
|
||||
void UpdateSapphireWailmerCatchSequence(void)
|
||||
{
|
||||
if (gCurrentPinballGame->unk28)
|
||||
if (gCurrentPinballGame->modeAnimTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk5F7 = 1;
|
||||
gCurrentPinballGame->unk1F = 1;
|
||||
gCurrentPinballGame->unk28--;
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 1;
|
||||
gCurrentPinballGame->ballFrozenState = 1;
|
||||
gCurrentPinballGame->modeAnimTimer--;
|
||||
gCurrentPinballGame->ball->velocity.x = 0;
|
||||
gCurrentPinballGame->ball->velocity.y = 0;
|
||||
gCurrentPinballGame->ball->unk6 = 0;
|
||||
if (gCurrentPinballGame->unk28 > 97)
|
||||
gCurrentPinballGame->ball->spinSpeed = 0;
|
||||
if (gCurrentPinballGame->modeAnimTimer > 97)
|
||||
{
|
||||
gCurrentPinballGame->unk5FA = 1;
|
||||
gCurrentPinballGame->unk2F4 = 2;
|
||||
gCurrentPinballGame->boardEntityActive = 1;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 2;
|
||||
gCurrentPinballGame->ball->positionQ0.x = 0xb5;
|
||||
gCurrentPinballGame->ball->positionQ0.y = 0xc3;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk28 > 94)
|
||||
else if (gCurrentPinballGame->modeAnimTimer > 94)
|
||||
{
|
||||
gCurrentPinballGame->unk2F4 = 3;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 3;
|
||||
gCurrentPinballGame->ball->positionQ0.x = 0xb8;
|
||||
gCurrentPinballGame->ball->positionQ0.y = 0xbb;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk28 > 91)
|
||||
else if (gCurrentPinballGame->modeAnimTimer > 91)
|
||||
{
|
||||
gCurrentPinballGame->ball->unk0 = 1;
|
||||
gCurrentPinballGame->unk2F4 = 4;
|
||||
gCurrentPinballGame->ball->ballHidden = 1;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 4;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk28 > 83)
|
||||
else if (gCurrentPinballGame->modeAnimTimer > 83)
|
||||
{
|
||||
gCurrentPinballGame->unk2F4 = 5;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 5;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk28 > 34)
|
||||
else if (gCurrentPinballGame->modeAnimTimer > 34)
|
||||
{
|
||||
gCurrentPinballGame->unk2F4 = 6;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 6;
|
||||
|
||||
}
|
||||
else if (gCurrentPinballGame->unk28 > 26)
|
||||
else if (gCurrentPinballGame->modeAnimTimer > 26)
|
||||
{
|
||||
gCurrentPinballGame->unk2F4 = 7;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 7;
|
||||
|
||||
}
|
||||
else if (gCurrentPinballGame->unk28 > 18)
|
||||
else if (gCurrentPinballGame->modeAnimTimer > 18)
|
||||
{
|
||||
gCurrentPinballGame->unk2F4 = 8;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 8;
|
||||
|
||||
}
|
||||
else if (gCurrentPinballGame->unk28 > 10)
|
||||
else if (gCurrentPinballGame->modeAnimTimer > 10)
|
||||
{
|
||||
gCurrentPinballGame->unk2F4 = 9;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 9;
|
||||
|
||||
}
|
||||
else if (gCurrentPinballGame->unk28 > 4)
|
||||
else if (gCurrentPinballGame->modeAnimTimer > 4)
|
||||
{
|
||||
gCurrentPinballGame->ball->unk0 = 0;
|
||||
gCurrentPinballGame->unk2F4 = 10;
|
||||
gCurrentPinballGame->ball->ballHidden = 0;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 10;
|
||||
gCurrentPinballGame->ball->positionQ0.x = 0xb5;
|
||||
gCurrentPinballGame->ball->positionQ0.y = 0xc3;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk2F4 = 11;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 11;
|
||||
gCurrentPinballGame->ball->positionQ0.x = 0xb0;
|
||||
gCurrentPinballGame->ball->positionQ0.y = 0xca;
|
||||
}
|
||||
|
|
@ -339,36 +339,36 @@ void sub_32BE4(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk2F4 = 0;
|
||||
gCurrentPinballGame->unk1F = 0;
|
||||
gCurrentPinballGame->unk26 = 60;
|
||||
gCurrentPinballGame->ball->unk6 = 0;
|
||||
gCurrentPinballGame->catchHoleAnimFrame = 0;
|
||||
gCurrentPinballGame->ballFrozenState = 0;
|
||||
gCurrentPinballGame->collisionCooldownTimer = 60;
|
||||
gCurrentPinballGame->ball->spinSpeed = 0;
|
||||
gCurrentPinballGame->ball->velocity.x = -0x66;
|
||||
gCurrentPinballGame->ball->velocity.y = 0xC8;
|
||||
PlayRumble(7);
|
||||
gCurrentPinballGame->ball->unk6 = 0;
|
||||
gCurrentPinballGame->ball->spinSpeed = 0;
|
||||
gCurrentPinballGame->ball->positionQ0.x = 0xAB;
|
||||
gCurrentPinballGame->ball->positionQ0.y = 0xD4;
|
||||
gCurrentPinballGame->ball->positionQ1.x = gCurrentPinballGame->ball->positionQ0.x * 2;
|
||||
gCurrentPinballGame->ball->positionQ1.y = gCurrentPinballGame->ball->positionQ0.y * 2;
|
||||
gCurrentPinballGame->ball->prevPositionQ1 = gCurrentPinballGame->ball->positionQ1;
|
||||
gCurrentPinballGame->unk25 = 0;
|
||||
gCurrentPinballGame->unk5F7 = 0;
|
||||
gCurrentPinballGame->ballCatchState = 0;
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 0;
|
||||
m4aSongNumStart(SE_WHISCASH_SPIT_BALL);
|
||||
gCurrentPinballGame->unk5FE = 0;
|
||||
gCurrentPinballGame->unk5FB = 1;
|
||||
gCurrentPinballGame->unk5FA = 0;
|
||||
gCurrentPinballGame->cameraScrollTarget = 0;
|
||||
gCurrentPinballGame->cameraScrollEnabled = 1;
|
||||
gCurrentPinballGame->boardEntityActive = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_32DF8(void)
|
||||
void HandleSapphireFlipperButtonInput(void)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
if (gCurrentPinballGame->newButtonActions[0])
|
||||
{
|
||||
if (gCurrentPinballGame->unk1C4 == 0 && gCurrentPinballGame->outLanePikaPosition != 2 &&
|
||||
gCurrentPinballGame->unk1C0 == 0 && gCurrentPinballGame->unk61C == 0)
|
||||
if (gCurrentPinballGame->pikaKickbackTimer == 0 && gCurrentPinballGame->outLanePikaPosition != 2 &&
|
||||
gCurrentPinballGame->pikaSaverTimer == 0 && gCurrentPinballGame->entityOverlayCollisionState == 0)
|
||||
{
|
||||
gCurrentPinballGame->outLanePikaPosition = 0;
|
||||
}
|
||||
|
|
@ -387,8 +387,8 @@ void sub_32DF8(void)
|
|||
|
||||
if (gCurrentPinballGame->newButtonActions[1])
|
||||
{
|
||||
if (gCurrentPinballGame->unk1C4 == 0 && gCurrentPinballGame->outLanePikaPosition != 2 &&
|
||||
gCurrentPinballGame->unk1C0 == 0 && gCurrentPinballGame->unk61C == 0)
|
||||
if (gCurrentPinballGame->pikaKickbackTimer == 0 && gCurrentPinballGame->outLanePikaPosition != 2 &&
|
||||
gCurrentPinballGame->pikaSaverTimer == 0 && gCurrentPinballGame->entityOverlayCollisionState == 0)
|
||||
{
|
||||
gCurrentPinballGame->outLanePikaPosition = 1;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -11,40 +11,40 @@ void AllBoardProcess_4A_19304(void)
|
|||
BonusBoardProcess_4B_19734();
|
||||
}
|
||||
|
||||
void sub_1931C(struct Vector16 arg0)
|
||||
void DetermineFlipperBallSide(struct Vector16 arg0)
|
||||
{
|
||||
s16 check;
|
||||
struct Unk086ACE8C *line;
|
||||
struct FlipperLineSegment *line;
|
||||
struct Vector16 point1, point2;
|
||||
|
||||
line = &gUnknown_086ACE8C[gCurrentPinballGame->flipper[0].position];
|
||||
point1.x = line->unk0 + 0x53;
|
||||
point1.y = line->unk2 + gUnknown_02031520.unk14.unk1C;
|
||||
line = &gFlipperLineGeometry[gCurrentPinballGame->flipper[0].position];
|
||||
point1.x = line->x1 + 0x53;
|
||||
point1.y = line->y1 + gBoardConfig.fieldLayout.flipperBaseY;
|
||||
|
||||
point2.x = line->unk4 + 0x53;
|
||||
point2.y = line->unk6 + gUnknown_02031520.unk14.unk1C;
|
||||
point2.x = line->x2 + 0x53;
|
||||
point2.y = line->y2 + gBoardConfig.fieldLayout.flipperBaseY;
|
||||
|
||||
check = (point2.y - point1.y) * (arg0.x - point1.x) * 30 / (point2.x - point1.x) + (point1.y - arg0.y) * 30;
|
||||
|
||||
if (check >= 0)
|
||||
gCurrentPinballGame->flipper[0].unk8 = 1;
|
||||
gCurrentPinballGame->flipper[0].ballSide = 1;
|
||||
else
|
||||
gCurrentPinballGame->flipper[0].unk8 = -1;
|
||||
gCurrentPinballGame->flipper[0].ballSide = -1;
|
||||
|
||||
line = &gUnknown_086ACE8C[gCurrentPinballGame->flipper[1].position];
|
||||
line = &gFlipperLineGeometry[gCurrentPinballGame->flipper[1].position];
|
||||
|
||||
point1.x = 0x9C - line->unk0;
|
||||
point1.y = line->unk2 + gUnknown_02031520.unk14.unk1C;
|
||||
point1.x = 0x9C - line->x1;
|
||||
point1.y = line->y1 + gBoardConfig.fieldLayout.flipperBaseY;
|
||||
|
||||
point2.x = 0x9C - line->unk4;
|
||||
point2.y = line->unk6 + gUnknown_02031520.unk14.unk1C;
|
||||
point2.x = 0x9C - line->x2;
|
||||
point2.y = line->y2 + gBoardConfig.fieldLayout.flipperBaseY;
|
||||
|
||||
check = (point2.y - point1.y) * (arg0.x - point1.x) * 30 / (point2.x - point1.x) + (point1.y - arg0.y) * 30;
|
||||
|
||||
if (check >= 0)
|
||||
gCurrentPinballGame->flipper[1].unk8 = 1;
|
||||
gCurrentPinballGame->flipper[1].ballSide = 1;
|
||||
else
|
||||
gCurrentPinballGame->flipper[1].unk8 = -1;
|
||||
gCurrentPinballGame->flipper[1].ballSide = -1;
|
||||
}
|
||||
|
||||
void MainBoardProcess_4B_19490(void)
|
||||
|
|
@ -52,7 +52,7 @@ void MainBoardProcess_4B_19490(void)
|
|||
s16 i;
|
||||
|
||||
if ((gMain.modeChangeFlags & MODE_CHANGE_BANNER) == 0)
|
||||
sub_195C4();
|
||||
UpdateMainBoardFlipperPhysics();
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
|
|
@ -66,14 +66,14 @@ void MainBoardProcess_4B_19490(void)
|
|||
spriteGroup = &gMain.spriteGroups[10 + i];
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
s8 unk0;
|
||||
s8 flipperTileIndex;
|
||||
struct OamDataSimple *oamData;
|
||||
|
||||
unk0 = gCurrentPinballGame->flipper[i].position / 2;
|
||||
spriteGroup->baseX = gUnknown_086ACEF4[i] - gCurrentPinballGame->unk58;
|
||||
spriteGroup->baseY = gUnknown_02031520.unk14.unk1C - gCurrentPinballGame->unk5A;
|
||||
flipperTileIndex = gCurrentPinballGame->flipper[i].position / 2;
|
||||
spriteGroup->baseX = gFlipperBaseXPositions[i] - gCurrentPinballGame->cameraXOffset;
|
||||
spriteGroup->baseY = gBoardConfig.fieldLayout.flipperBaseY - gCurrentPinballGame->cameraYOffset;
|
||||
|
||||
DmaCopy16(3, gUnknown_083FE44C[unk0], OBJ_VRAM0 + i * 0x200, 0x200);
|
||||
DmaCopy16(3, gFlipperTileGraphics[flipperTileIndex], OBJ_VRAM0 + i * 0x200, 0x200);
|
||||
|
||||
oamData = &spriteGroup->oam[0];
|
||||
gOamBuffer[oamData->oamId].x = oamData->xOffset + spriteGroup->baseX;
|
||||
|
|
@ -82,11 +82,11 @@ void MainBoardProcess_4B_19490(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_195C4(void)
|
||||
void UpdateMainBoardFlipperPhysics(void)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
sub_1931C(gCurrentPinballGame->ball->positionQ0);
|
||||
DetermineFlipperBallSide(gCurrentPinballGame->ball->positionQ0);
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
|
|
@ -95,11 +95,11 @@ void sub_195C4(void)
|
|||
flipper = &gCurrentPinballGame->flipper[i];
|
||||
|
||||
flipper->prevPosition = flipper->position;
|
||||
flipper->unk2 = 0;
|
||||
flipper->collisionFrameIndex = 0;
|
||||
|
||||
if (gCurrentPinballGame->heldButtonActions[i])
|
||||
{
|
||||
if (flipper->active == 0 && gCurrentPinballGame->unk25 == 0)
|
||||
if (flipper->active == 0 && gCurrentPinballGame->ballCatchState == 0)
|
||||
m4aSongNumStart(SE_FLIPPER_PRESSED);
|
||||
|
||||
flipper->active = 1;
|
||||
|
|
@ -122,36 +122,36 @@ void sub_195C4(void)
|
|||
{
|
||||
dir = 1;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk5C != 0)
|
||||
else if (gCurrentPinballGame->flipperLaunchPending != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1334[0].velocity.x = gCurrentPinballGame->unk60.x;
|
||||
gCurrentPinballGame->unk1334[0].velocity.y = gCurrentPinballGame->unk60.y;
|
||||
gCurrentPinballGame->unk5C = 0;
|
||||
gCurrentPinballGame->ballStates[0].velocity.x = gCurrentPinballGame->flipperLaunchVelocity.x;
|
||||
gCurrentPinballGame->ballStates[0].velocity.y = gCurrentPinballGame->flipperLaunchVelocity.y;
|
||||
gCurrentPinballGame->flipperLaunchPending = 0;
|
||||
PlayRumble(7);
|
||||
}
|
||||
flipper->unk2 = flipper->position / 2 + 1;
|
||||
flipper->collisionFrameIndex = flipper->position / 2 + 1;
|
||||
flipper->position += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flipper->position != 0)
|
||||
{
|
||||
flipper->unk2 = flipper->position / 2 + 6;
|
||||
flipper->collisionFrameIndex = flipper->position / 2 + 6;
|
||||
dir = -1;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk5C != 0)
|
||||
else if (gCurrentPinballGame->flipperLaunchPending != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1334[0].velocity.x = gCurrentPinballGame->unk60.x;
|
||||
gCurrentPinballGame->unk1334[0].velocity.y = gCurrentPinballGame->unk60.y;
|
||||
gCurrentPinballGame->unk5C = 0;
|
||||
gCurrentPinballGame->ballStates[0].velocity.x = gCurrentPinballGame->flipperLaunchVelocity.x;
|
||||
gCurrentPinballGame->ballStates[0].velocity.y = gCurrentPinballGame->flipperLaunchVelocity.y;
|
||||
gCurrentPinballGame->flipperLaunchPending = 0;
|
||||
PlayRumble(7);
|
||||
}
|
||||
flipper->position -= 2;
|
||||
}
|
||||
flipper->unk3 = flipper->unk3 * dir;
|
||||
if (flipper->unk3 <= 0)
|
||||
flipper->unk4 = 0;
|
||||
flipper->unk3 = dir;
|
||||
flipper->movementDirection = flipper->movementDirection * dir;
|
||||
if (flipper->movementDirection <= 0)
|
||||
flipper->bounceApplied = 0;
|
||||
flipper->movementDirection = dir;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ void BonusBoardProcess_4B_19734(void)
|
|||
|
||||
if ((gMain.modeChangeFlags & MODE_CHANGE_BANNER) == 0)
|
||||
{
|
||||
sub_19894();
|
||||
UpdateBonusBoardFlipperPhysics();
|
||||
gMain.modeChangeFlags = gMain.modeChangeFlags;
|
||||
}
|
||||
for (i = 0; i < 2; i++)
|
||||
|
|
@ -177,14 +177,14 @@ void BonusBoardProcess_4B_19734(void)
|
|||
spriteGroup = &gMain.spriteGroups[3 + i];
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
s8 unk0;
|
||||
s8 flipperTileIndex;
|
||||
struct OamDataSimple *oamData;
|
||||
|
||||
unk0 = gCurrentPinballGame->flipper[i].position / 2;
|
||||
spriteGroup->baseX = gUnknown_086ACEF4[i] - gCurrentPinballGame->unk58;
|
||||
spriteGroup->baseY = gUnknown_02031520.unk14.unk1C - gCurrentPinballGame->unk5A;
|
||||
flipperTileIndex = gCurrentPinballGame->flipper[i].position / 2;
|
||||
spriteGroup->baseX = gFlipperBaseXPositions[i] - gCurrentPinballGame->cameraXOffset;
|
||||
spriteGroup->baseY = gBoardConfig.fieldLayout.flipperBaseY - gCurrentPinballGame->cameraYOffset;
|
||||
|
||||
DmaCopy16(3, gUnknown_083FE44C[unk0], OBJ_VRAM0 + i * 0x200, 0x200);
|
||||
DmaCopy16(3, gFlipperTileGraphics[flipperTileIndex], OBJ_VRAM0 + i * 0x200, 0x200);
|
||||
|
||||
if (spriteGroup->baseY > 180)
|
||||
spriteGroup->baseY = 180;
|
||||
|
|
@ -197,11 +197,11 @@ void BonusBoardProcess_4B_19734(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_19894(void)
|
||||
void UpdateBonusBoardFlipperPhysics(void)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
sub_1931C(gCurrentPinballGame->ball->positionQ0);
|
||||
DetermineFlipperBallSide(gCurrentPinballGame->ball->positionQ0);
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
|
|
@ -210,11 +210,11 @@ void sub_19894(void)
|
|||
flipper = &gCurrentPinballGame->flipper[i];
|
||||
|
||||
flipper->prevPosition = flipper->position;
|
||||
flipper->unk2 = 0;
|
||||
flipper->collisionFrameIndex = 0;
|
||||
|
||||
if (gCurrentPinballGame->heldButtonActions[i] && gMain.modeChangeFlags == MODE_CHANGE_NONE)
|
||||
{
|
||||
if (flipper->active == 0 && gCurrentPinballGame->unk25 == 0 && gCurrentPinballGame->unk1A == 0)
|
||||
if (flipper->active == 0 && gCurrentPinballGame->ballCatchState == 0 && gCurrentPinballGame->flippersDisabled == 0)
|
||||
{
|
||||
m4aSongNumStart(SE_FLIPPER_PRESSED);
|
||||
}
|
||||
|
|
@ -238,35 +238,35 @@ void sub_19894(void)
|
|||
{
|
||||
dir = 1;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk5C != 0)
|
||||
else if (gCurrentPinballGame->flipperLaunchPending != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1334[0].velocity.x = gCurrentPinballGame->unk60.x;
|
||||
gCurrentPinballGame->unk1334[0].velocity.y = gCurrentPinballGame->unk60.y;
|
||||
gCurrentPinballGame->unk5C = 0;
|
||||
gCurrentPinballGame->ballStates[0].velocity.x = gCurrentPinballGame->flipperLaunchVelocity.x;
|
||||
gCurrentPinballGame->ballStates[0].velocity.y = gCurrentPinballGame->flipperLaunchVelocity.y;
|
||||
gCurrentPinballGame->flipperLaunchPending = 0;
|
||||
PlayRumble(7);
|
||||
}
|
||||
flipper->unk2 = flipper->position / 2 + 1;
|
||||
flipper->collisionFrameIndex = flipper->position / 2 + 1;
|
||||
flipper->position += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flipper->position != 0)
|
||||
{
|
||||
flipper->unk2 = flipper->position / 2 + 6;
|
||||
flipper->collisionFrameIndex = flipper->position / 2 + 6;
|
||||
dir = -1;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk5C != 0)
|
||||
else if (gCurrentPinballGame->flipperLaunchPending != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1334[0].velocity.x = gCurrentPinballGame->unk60.x;
|
||||
gCurrentPinballGame->unk1334[0].velocity.y = gCurrentPinballGame->unk60.y;
|
||||
gCurrentPinballGame->unk5C = 0;
|
||||
gCurrentPinballGame->ballStates[0].velocity.x = gCurrentPinballGame->flipperLaunchVelocity.x;
|
||||
gCurrentPinballGame->ballStates[0].velocity.y = gCurrentPinballGame->flipperLaunchVelocity.y;
|
||||
gCurrentPinballGame->flipperLaunchPending = 0;
|
||||
PlayRumble(7);
|
||||
}
|
||||
flipper->position -= 2;
|
||||
}
|
||||
flipper->unk3 = flipper->unk3 * dir;
|
||||
if (flipper->unk3 <= 0)
|
||||
flipper->unk4 = 0;
|
||||
flipper->unk3 = dir;
|
||||
flipper->movementDirection = flipper->movementDirection * dir;
|
||||
if (flipper->movementDirection <= 0)
|
||||
flipper->bounceApplied = 0;
|
||||
flipper->movementDirection = dir;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,39 +6,39 @@
|
|||
|
||||
extern void MainBoardProcess_7B_12524(void);
|
||||
extern void BonusBoardProcess_7B_12BF8(void);
|
||||
extern void sub_2AADC(void);
|
||||
extern void RunBallCaptureSequence(void);
|
||||
|
||||
extern const u8 gUnknown_08137E14[][0x20];
|
||||
extern const u8 gBallPalettes[][0x20];
|
||||
|
||||
void AllBoardProcess_5A_11B9C(void)
|
||||
{
|
||||
s16 i;
|
||||
if (gMain.unk6 == 0)
|
||||
if (gMain.isBonusField == 0)
|
||||
{
|
||||
gCurrentPinballGame->ball = &gCurrentPinballGame->unk1334[0];
|
||||
sub_11C14(0);
|
||||
gCurrentPinballGame->ball = &gCurrentPinballGame->ballStates[0];
|
||||
InitBallState(0);
|
||||
MainBoardProcess_7B_12524();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
gCurrentPinballGame->ball = &gCurrentPinballGame->unk1334[i];
|
||||
sub_11C14(i);
|
||||
gCurrentPinballGame->ball = &gCurrentPinballGame->ballStates[i];
|
||||
InitBallState(i);
|
||||
}
|
||||
BonusBoardProcess_7B_12BF8();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_11C14(s16 arg0)
|
||||
void InitBallState(s16 arg0)
|
||||
{
|
||||
struct BallState *ball = &gCurrentPinballGame->unk1334[arg0];
|
||||
ball->positionQ0.x = gUnknown_02031520.unk14.unk26;
|
||||
ball->positionQ0.y = gUnknown_02031520.unk14.unk28;
|
||||
struct BallState *ball = &gCurrentPinballGame->ballStates[arg0];
|
||||
ball->positionQ0.x = gBoardConfig.fieldLayout.ballSpawnX;
|
||||
ball->positionQ0.y = gBoardConfig.fieldLayout.ballSpawnY;
|
||||
ball->positionQ8.x = Q_24_8(ball->positionQ0.x);
|
||||
ball->positionQ8.y = Q_24_8(ball->positionQ0.y);
|
||||
ball->positionQ1.x = gUnknown_02031520.unk14.unk26 * 2;
|
||||
ball->positionQ1.y = gUnknown_02031520.unk14.unk28 * 2;
|
||||
ball->positionQ1.x = gBoardConfig.fieldLayout.ballSpawnX * 2;
|
||||
ball->positionQ1.y = gBoardConfig.fieldLayout.ballSpawnY * 2;
|
||||
ball->scale = 0x100;
|
||||
ball->velocity.x = 0;
|
||||
ball->velocity.y = 0;
|
||||
|
|
@ -47,8 +47,8 @@ void sub_11C14(s16 arg0)
|
|||
else
|
||||
ball->oamPriority = 1;
|
||||
|
||||
ball->unk6 = 0;
|
||||
gCurrentPinballGame->unk5B2 = 1;
|
||||
ball->spinSpeed = 0;
|
||||
gCurrentPinballGame->ballInLowerHalf = 1;
|
||||
}
|
||||
|
||||
extern const u16 gGravityDeltas_Strong[4];
|
||||
|
|
@ -68,47 +68,47 @@ extern const u16 gGravityDeltas_Light[4];
|
|||
} \
|
||||
else \
|
||||
{ \
|
||||
velocity.x = unk132c->velocity.x; \
|
||||
velocity.y = unk132c->velocity.y; \
|
||||
velocity.x = currentBall->velocity.x; \
|
||||
velocity.y = currentBall->velocity.y; \
|
||||
} \
|
||||
unk132c->positionQ8.x += velocity.x; \
|
||||
unk132c->positionQ8.y += velocity.y; \
|
||||
currentBall->positionQ8.x += velocity.x; \
|
||||
currentBall->positionQ8.y += velocity.y; \
|
||||
}
|
||||
|
||||
void MainBoardProcess_5B_11C98(void)
|
||||
{
|
||||
struct Vector16 velocity;
|
||||
struct BallState *unk132c;
|
||||
struct BallState *currentBall;
|
||||
int xx, yy;
|
||||
int squaredMagnitude;
|
||||
int maxSpeed;
|
||||
|
||||
unk132c = gCurrentPinballGame->ball;
|
||||
unk132c->prevPositionQ8 = unk132c->positionQ8;
|
||||
if (gCurrentPinballGame->unk5A4 != 2)
|
||||
currentBall = gCurrentPinballGame->ball;
|
||||
currentBall->prevPositionQ8 = currentBall->positionQ8;
|
||||
if (gCurrentPinballGame->captureState != 2)
|
||||
{
|
||||
if (gCurrentPinballGame->ballSpeed != 0)
|
||||
{
|
||||
u16 angle;
|
||||
|
||||
if (!gCurrentPinballGame->unk1F)
|
||||
if (!gCurrentPinballGame->ballFrozenState)
|
||||
{
|
||||
// Gravity is applied at different strengths, depending on fast the ball is
|
||||
// currently moving downwards.
|
||||
if (unk132c->velocity.y > 160)
|
||||
unk132c->velocity.y += gGravityDeltas_Light[gCurrentPinballGame->unk1E];
|
||||
else if (unk132c->velocity.y > 80)
|
||||
unk132c->velocity.y += gGravityDeltas_Medium[gCurrentPinballGame->unk1E];
|
||||
if (currentBall->velocity.y > 160)
|
||||
currentBall->velocity.y += gGravityDeltas_Light[gCurrentPinballGame->gravityStrengthIndex];
|
||||
else if (currentBall->velocity.y > 80)
|
||||
currentBall->velocity.y += gGravityDeltas_Medium[gCurrentPinballGame->gravityStrengthIndex];
|
||||
else
|
||||
unk132c->velocity.y += gGravityDeltas_Strong[gCurrentPinballGame->unk1E];
|
||||
currentBall->velocity.y += gGravityDeltas_Strong[gCurrentPinballGame->gravityStrengthIndex];
|
||||
}
|
||||
|
||||
angle = ArcTan2(unk132c->velocity.x, -unk132c->velocity.y);
|
||||
xx = unk132c->velocity.x * unk132c->velocity.x;
|
||||
yy = unk132c->velocity.y * unk132c->velocity.y;
|
||||
angle = ArcTan2(currentBall->velocity.x, -currentBall->velocity.y);
|
||||
xx = currentBall->velocity.x * currentBall->velocity.x;
|
||||
yy = currentBall->velocity.y * currentBall->velocity.y;
|
||||
squaredMagnitude = xx + yy;
|
||||
|
||||
if (unk132c->positionQ0.y < 380)
|
||||
if (currentBall->positionQ0.y < 380)
|
||||
{
|
||||
UPDATE_BALL_POSITION(272, angle);
|
||||
}
|
||||
|
|
@ -121,24 +121,24 @@ void MainBoardProcess_5B_11C98(void)
|
|||
{
|
||||
u16 angle;
|
||||
|
||||
if (!gCurrentPinballGame->unk1F)
|
||||
if (!gCurrentPinballGame->ballFrozenState)
|
||||
{
|
||||
// Gravity is applied at different strengths, depending on fast the ball is
|
||||
// currently moving downwards.
|
||||
if (unk132c->velocity.y > 200)
|
||||
unk132c->velocity.y += gGravityDeltas_Light[gCurrentPinballGame->unk1E];
|
||||
else if (unk132c->velocity.y > 100)
|
||||
unk132c->velocity.y += gGravityDeltas_Medium[gCurrentPinballGame->unk1E];
|
||||
if (currentBall->velocity.y > 200)
|
||||
currentBall->velocity.y += gGravityDeltas_Light[gCurrentPinballGame->gravityStrengthIndex];
|
||||
else if (currentBall->velocity.y > 100)
|
||||
currentBall->velocity.y += gGravityDeltas_Medium[gCurrentPinballGame->gravityStrengthIndex];
|
||||
else
|
||||
unk132c->velocity.y += gGravityDeltas_Strong[gCurrentPinballGame->unk1E];
|
||||
currentBall->velocity.y += gGravityDeltas_Strong[gCurrentPinballGame->gravityStrengthIndex];
|
||||
}
|
||||
|
||||
angle = ArcTan2(unk132c->velocity.x, -unk132c->velocity.y);
|
||||
xx = unk132c->velocity.x * unk132c->velocity.x;
|
||||
yy = unk132c->velocity.y * unk132c->velocity.y;
|
||||
angle = ArcTan2(currentBall->velocity.x, -currentBall->velocity.y);
|
||||
xx = currentBall->velocity.x * currentBall->velocity.x;
|
||||
yy = currentBall->velocity.y * currentBall->velocity.y;
|
||||
squaredMagnitude = xx + yy;
|
||||
|
||||
if (unk132c->positionQ0.y < 380)
|
||||
if (currentBall->positionQ0.y < 380)
|
||||
{
|
||||
UPDATE_BALL_POSITION(336, angle);
|
||||
}
|
||||
|
|
@ -150,51 +150,51 @@ void MainBoardProcess_5B_11C98(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
sub_2AADC();
|
||||
RunBallCaptureSequence();
|
||||
}
|
||||
|
||||
unk132c->prevPositionQ1 = unk132c->positionQ1;
|
||||
unk132c->positionQ1.x = (unk132c->positionQ8.x + 64) / 128;
|
||||
unk132c->positionQ1.y = (unk132c->positionQ8.y + 64) / 128;
|
||||
unk132c->unk8 = unk132c->unk6;
|
||||
unk132c->unkA += unk132c->unk6;
|
||||
currentBall->prevPositionQ1 = currentBall->positionQ1;
|
||||
currentBall->positionQ1.x = (currentBall->positionQ8.x + 64) / 128;
|
||||
currentBall->positionQ1.y = (currentBall->positionQ8.y + 64) / 128;
|
||||
currentBall->prevSpinSpeed = currentBall->spinSpeed;
|
||||
currentBall->spinAngle += currentBall->spinSpeed;
|
||||
}
|
||||
|
||||
void BonusBoardProcess_5B_11F88(void)
|
||||
{
|
||||
struct Vector16 velocity;
|
||||
struct BallState *unk132c;
|
||||
struct BallState *currentBall;
|
||||
int xx, yy;
|
||||
int squaredMagnitude;
|
||||
int maxSpeed;
|
||||
|
||||
unk132c = gCurrentPinballGame->ball;
|
||||
unk132c->prevPositionQ8 = unk132c->positionQ8;
|
||||
if (gCurrentPinballGame->unk5A4 != 2)
|
||||
currentBall = gCurrentPinballGame->ball;
|
||||
currentBall->prevPositionQ8 = currentBall->positionQ8;
|
||||
if (gCurrentPinballGame->captureState != 2)
|
||||
{
|
||||
if (!gCurrentPinballGame->unk1F && !gCurrentPinballGame->unk383)
|
||||
if (!gCurrentPinballGame->ballFrozenState && !gCurrentPinballGame->ballGrabbed)
|
||||
{
|
||||
// Gravity is applied at different strengths, depending on fast the ball is
|
||||
// currently moving downwards.
|
||||
if (unk132c->velocity.y > 150)
|
||||
unk132c->velocity.y += gGravityDeltas_Light[gCurrentPinballGame->unk1E];
|
||||
else if (unk132c->velocity.y > 75)
|
||||
unk132c->velocity.y += gGravityDeltas_Medium[gCurrentPinballGame->unk1E];
|
||||
if (currentBall->velocity.y > 150)
|
||||
currentBall->velocity.y += gGravityDeltas_Light[gCurrentPinballGame->gravityStrengthIndex];
|
||||
else if (currentBall->velocity.y > 75)
|
||||
currentBall->velocity.y += gGravityDeltas_Medium[gCurrentPinballGame->gravityStrengthIndex];
|
||||
else
|
||||
unk132c->velocity.y += gGravityDeltas_Strong[gCurrentPinballGame->unk1E];
|
||||
currentBall->velocity.y += gGravityDeltas_Strong[gCurrentPinballGame->gravityStrengthIndex];
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->ballSpeed != 0)
|
||||
{
|
||||
u16 angle;
|
||||
angle = ArcTan2(unk132c->velocity.x, -unk132c->velocity.y);
|
||||
xx = unk132c->velocity.x * unk132c->velocity.x;
|
||||
yy = unk132c->velocity.y * unk132c->velocity.y;
|
||||
angle = ArcTan2(currentBall->velocity.x, -currentBall->velocity.y);
|
||||
xx = currentBall->velocity.x * currentBall->velocity.x;
|
||||
yy = currentBall->velocity.y * currentBall->velocity.y;
|
||||
squaredMagnitude = xx + yy;
|
||||
|
||||
if (gMain.selectedField <= FIELD_KECLEON)
|
||||
{
|
||||
if (unk132c->positionQ0.y < 150)
|
||||
if (currentBall->positionQ0.y < 150)
|
||||
{
|
||||
UPDATE_BALL_POSITION(272, angle);
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@ void BonusBoardProcess_5B_11F88(void)
|
|||
}
|
||||
else if (gMain.selectedField == FIELD_SPHEAL)
|
||||
{
|
||||
if (unk132c->positionQ0.y < 218)
|
||||
if (currentBall->positionQ0.y < 218)
|
||||
{
|
||||
UPDATE_BALL_POSITION(272, angle);
|
||||
}
|
||||
|
|
@ -216,7 +216,7 @@ void BonusBoardProcess_5B_11F88(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (unk132c->positionQ0.y < 218)
|
||||
if (currentBall->positionQ0.y < 218)
|
||||
{
|
||||
UPDATE_BALL_POSITION(272, angle);
|
||||
}
|
||||
|
|
@ -229,14 +229,14 @@ void BonusBoardProcess_5B_11F88(void)
|
|||
else
|
||||
{
|
||||
u16 angle;
|
||||
angle = ArcTan2(unk132c->velocity.x, -unk132c->velocity.y);
|
||||
xx = unk132c->velocity.x * unk132c->velocity.x;
|
||||
yy = unk132c->velocity.y * unk132c->velocity.y;
|
||||
angle = ArcTan2(currentBall->velocity.x, -currentBall->velocity.y);
|
||||
xx = currentBall->velocity.x * currentBall->velocity.x;
|
||||
yy = currentBall->velocity.y * currentBall->velocity.y;
|
||||
squaredMagnitude = xx + yy;
|
||||
|
||||
if (gMain.selectedField <= FIELD_KECLEON)
|
||||
{
|
||||
if (unk132c->positionQ0.y < 150)
|
||||
if (currentBall->positionQ0.y < 150)
|
||||
{
|
||||
UPDATE_BALL_POSITION(304, angle);
|
||||
}
|
||||
|
|
@ -247,7 +247,7 @@ void BonusBoardProcess_5B_11F88(void)
|
|||
}
|
||||
else if (gMain.selectedField == FIELD_SPHEAL)
|
||||
{
|
||||
if (unk132c->positionQ0.y < 218)
|
||||
if (currentBall->positionQ0.y < 218)
|
||||
{
|
||||
UPDATE_BALL_POSITION(272, angle);
|
||||
}
|
||||
|
|
@ -258,7 +258,7 @@ void BonusBoardProcess_5B_11F88(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (unk132c->positionQ0.y < 218)
|
||||
if (currentBall->positionQ0.y < 218)
|
||||
{
|
||||
UPDATE_BALL_POSITION(304, angle);
|
||||
}
|
||||
|
|
@ -271,12 +271,12 @@ void BonusBoardProcess_5B_11F88(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
sub_2AADC();
|
||||
RunBallCaptureSequence();
|
||||
}
|
||||
|
||||
unk132c->prevPositionQ1 = unk132c->positionQ1;
|
||||
unk132c->positionQ1.x = (unk132c->positionQ8.x + 64) / 128;
|
||||
unk132c->positionQ1.y = (unk132c->positionQ8.y + 64) / 128;
|
||||
unk132c->unk8 = unk132c->unk6;
|
||||
unk132c->unkA += unk132c->unk6;
|
||||
currentBall->prevPositionQ1 = currentBall->positionQ1;
|
||||
currentBall->positionQ1.x = (currentBall->positionQ8.x + 64) / 128;
|
||||
currentBall->positionQ1.y = (currentBall->positionQ8.y + 64) / 128;
|
||||
currentBall->prevSpinSpeed = currentBall->spinSpeed;
|
||||
currentBall->spinAngle += currentBall->spinSpeed;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,23 +4,23 @@
|
|||
#include "m4a.h"
|
||||
#include "constants/anglemath.h"
|
||||
|
||||
extern u8 gUnknown_0839A28C[];
|
||||
extern u16 gUnknown_086ACD84[][2];
|
||||
extern u16 gUnknown_086ACE2C[][2];
|
||||
extern s8 gUnknown_086ACDB8[];
|
||||
extern u8 gCatchTargetCollisionBitmap[];
|
||||
extern u16 gFlipperCollisionAngles[][2];
|
||||
extern u16 gFlipperLaunchVelocityParams[][2];
|
||||
extern s8 gFlipperCollisionFrameMapping[];
|
||||
|
||||
|
||||
u16 sub_13824(struct Vector16*);
|
||||
void sub_13D24(u16,struct Vector16*, struct Vector16*);
|
||||
void sub_13934(struct Vector16 *arg0, struct Vector16 *arg1, u16 angle);
|
||||
void sub_1493C(void);
|
||||
u16 sub_14488(struct Vector16*, struct Vector16);
|
||||
u16 DetectBallCollision(struct Vector16*);
|
||||
void ComputeWallReflection(u16,struct Vector16*, struct Vector16*);
|
||||
void ApplyTiltEffectOnCollision(struct Vector16 *arg0, struct Vector16 *arg1, u16 angle);
|
||||
void ProcessBonusTrapPhysics(void);
|
||||
u16 PixelWalkCollisionDetection(struct Vector16*, struct Vector16);
|
||||
|
||||
void sub_14B84(s32 arg0, s16 arg1, struct Vector16* arg2, u16 arg3);
|
||||
void ComputeFlipperLaunchVelocity(s32 arg0, s16 arg1, struct Vector16* arg2, u16 arg3);
|
||||
|
||||
void AllBoardProcess_6A_4CEA8()
|
||||
{
|
||||
gCurrentPinballGame->unk26 = 60;
|
||||
gCurrentPinballGame->collisionCooldownTimer = 60;
|
||||
}
|
||||
|
||||
void AllBoardProcess_6B_1333C()
|
||||
|
|
@ -31,22 +31,22 @@ void AllBoardProcess_6B_1333C()
|
|||
s16 i;
|
||||
u16 r7;
|
||||
|
||||
r7 = sub_13824(&var0);
|
||||
switch (gCurrentPinballGame->unk22)
|
||||
r7 = DetectBallCollision(&var0);
|
||||
switch (gCurrentPinballGame->collisionResponseType)
|
||||
{
|
||||
case 7:
|
||||
gCurrentPinballGame->ball->velocity.x = 0;
|
||||
gCurrentPinballGame->ball->velocity.y = 0;
|
||||
break;
|
||||
case 1:
|
||||
sub_13934(&var0, &var1, r7);
|
||||
sub_13D24(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
ApplyTiltEffectOnCollision(&var0, &var1, r7);
|
||||
ComputeWallReflection(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
for (i = 0; i < 9; i++)
|
||||
{
|
||||
if (gUnknown_086ACD50[i].unk2 <= r7)
|
||||
if (gWallCollisionPositionCorrection[i].angleThreshold <= r7)
|
||||
{
|
||||
var0.x += gUnknown_086ACD50[i].unk0;
|
||||
var0.y += gUnknown_086ACD50[i].unk1;
|
||||
var0.x += gWallCollisionPositionCorrection[i].correctionX;
|
||||
var0.y += gWallCollisionPositionCorrection[i].correctionY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -54,20 +54,20 @@ void AllBoardProcess_6B_1333C()
|
|||
gCurrentPinballGame->ball->velocity.y = var2.y + var1.y;
|
||||
break;
|
||||
case 6:
|
||||
sub_13934(&var0, &var1,r7);
|
||||
sub_13D24(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
ApplyTiltEffectOnCollision(&var0, &var1,r7);
|
||||
ComputeWallReflection(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
gCurrentPinballGame->ball->velocity.x = var2.x + var1.x;
|
||||
gCurrentPinballGame->ball->velocity.y = var2.y + var1.y;
|
||||
break;
|
||||
case 2:
|
||||
sub_13934(&var0, &var1, r7);
|
||||
sub_13D24(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
ApplyTiltEffectOnCollision(&var0, &var1, r7);
|
||||
ComputeWallReflection(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
for (i = 0; i < 9; i++)
|
||||
{
|
||||
if (gUnknown_086ACD50[i].unk2 <= r7)
|
||||
if (gWallCollisionPositionCorrection[i].angleThreshold <= r7)
|
||||
{
|
||||
var0.x += gUnknown_086ACD50[i].unk0;
|
||||
var0.y += gUnknown_086ACD50[i].unk1;
|
||||
var0.x += gWallCollisionPositionCorrection[i].correctionX;
|
||||
var0.y += gWallCollisionPositionCorrection[i].correctionY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -75,45 +75,45 @@ void AllBoardProcess_6B_1333C()
|
|||
gCurrentPinballGame->ball->velocity.y = var2.y + var1.y;
|
||||
break;
|
||||
case 3:
|
||||
sub_13934(&var0, &var1, r7);
|
||||
var0.x -= (gUnknown_02031520.unk14.unk22 * 2);
|
||||
var0.y -= (gUnknown_02031520.unk14.unk20 * 2);
|
||||
if (gCurrentPinballGame->flipper[0].unk4 == 0)
|
||||
ApplyTiltEffectOnCollision(&var0, &var1, r7);
|
||||
var0.x -= (gBoardConfig.fieldLayout.leftFlipperOriginX * 2);
|
||||
var0.y -= (gBoardConfig.fieldLayout.flipperOriginY * 2);
|
||||
if (gCurrentPinballGame->flipper[0].bounceApplied == 0)
|
||||
{
|
||||
sub_13D24(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
gCurrentPinballGame->flipper[0].unk4 = 1;
|
||||
ComputeWallReflection(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
gCurrentPinballGame->flipper[0].bounceApplied = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
var2.x = gCurrentPinballGame->ball->velocity.x;
|
||||
var2.y = gCurrentPinballGame->ball->velocity.y;
|
||||
}
|
||||
sub_13B28(&var0, &var2, 0);
|
||||
ComputeFlipperBounce(&var0, &var2, 0);
|
||||
gCurrentPinballGame->ball->velocity.x = var2.x + var1.x;
|
||||
gCurrentPinballGame->ball->velocity.y = var2.y + var1.y;
|
||||
if (gCurrentPinballGame->unk22 == 5)
|
||||
if (gCurrentPinballGame->collisionResponseType == 5)
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (gUnknown_086ACD74[i].unk2 <= r7)
|
||||
if (gFlipperCollisionAngleCorrection[i].angleThreshold <= r7)
|
||||
{
|
||||
var0.x += gUnknown_086ACD74[i].unk0;
|
||||
var0.y += gUnknown_086ACD74[i].unk1;
|
||||
var0.x += gFlipperCollisionAngleCorrection[i].correctionX;
|
||||
var0.y += gFlipperCollisionAngleCorrection[i].correctionY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
var0.x += gUnknown_02031520.unk14.unk22 * 2;
|
||||
var0.y += gUnknown_02031520.unk14.unk20 * 2;
|
||||
var0.x += gBoardConfig.fieldLayout.leftFlipperOriginX * 2;
|
||||
var0.y += gBoardConfig.fieldLayout.flipperOriginY * 2;
|
||||
break;
|
||||
case 4:
|
||||
sub_13934(&var0, &var1, r7);
|
||||
var0.x -= (gUnknown_02031520.unk14.unk24 * 2);
|
||||
var0.y -= (gUnknown_02031520.unk14.unk20 * 2);
|
||||
if (gCurrentPinballGame->flipper[1].unk4 == 0)
|
||||
ApplyTiltEffectOnCollision(&var0, &var1, r7);
|
||||
var0.x -= (gBoardConfig.fieldLayout.rightFlipperOriginX * 2);
|
||||
var0.y -= (gBoardConfig.fieldLayout.flipperOriginY * 2);
|
||||
if (gCurrentPinballGame->flipper[1].bounceApplied == 0)
|
||||
{
|
||||
sub_13D24(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
gCurrentPinballGame->flipper[1].unk4 = 1;
|
||||
ComputeWallReflection(r7, &gCurrentPinballGame->ball->velocity, &var2);
|
||||
gCurrentPinballGame->flipper[1].bounceApplied = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -122,49 +122,49 @@ void AllBoardProcess_6B_1333C()
|
|||
}
|
||||
var0.x = 0x5f - var0.x;
|
||||
var2.x = -var2.x;
|
||||
sub_13B28(&var0, &var2, 1);
|
||||
ComputeFlipperBounce(&var0, &var2, 1);
|
||||
var2.x = -var2.x;
|
||||
gCurrentPinballGame->ball->velocity.x = var2.x + var1.x;
|
||||
gCurrentPinballGame->ball->velocity.y = var2.y + var1.y;
|
||||
if (gCurrentPinballGame->unk22 == 5)
|
||||
if (gCurrentPinballGame->collisionResponseType == 5)
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (gUnknown_086ACD74[i].unk2 <= r7)
|
||||
if (gFlipperCollisionAngleCorrection[i].angleThreshold <= r7)
|
||||
{
|
||||
var0.x -= gUnknown_086ACD74[i].unk0;
|
||||
var0.y += gUnknown_086ACD74[i].unk1;
|
||||
var0.x -= gFlipperCollisionAngleCorrection[i].correctionX;
|
||||
var0.y += gFlipperCollisionAngleCorrection[i].correctionY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
var0.x = 0x5f - var0.x;
|
||||
var0.x += gUnknown_02031520.unk14.unk24 * 2;
|
||||
var0.y += gUnknown_02031520.unk14.unk20 * 2;
|
||||
var0.x += gBoardConfig.fieldLayout.rightFlipperOriginX * 2;
|
||||
var0.y += gBoardConfig.fieldLayout.flipperOriginY * 2;
|
||||
break;
|
||||
default:
|
||||
if (gCurrentPinballGame->unk122 > 0)
|
||||
if (gCurrentPinballGame->tiltTargetXOffset > 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk127 != 1)
|
||||
if (gCurrentPinballGame->tiltLockoutActive != 1)
|
||||
{
|
||||
gCurrentPinballGame->ball->velocity.x -= 4;
|
||||
gCurrentPinballGame->unk127 = 1;
|
||||
gCurrentPinballGame->tiltLockoutActive = 1;
|
||||
}
|
||||
}
|
||||
else if (gCurrentPinballGame->unk122 < 0)
|
||||
else if (gCurrentPinballGame->tiltTargetXOffset < 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk127 != -1)
|
||||
if (gCurrentPinballGame->tiltLockoutActive != -1)
|
||||
{
|
||||
gCurrentPinballGame->ball->velocity.x += 4;
|
||||
gCurrentPinballGame->unk127 = -1;
|
||||
gCurrentPinballGame->tiltLockoutActive = -1;
|
||||
}
|
||||
}
|
||||
if (gCurrentPinballGame->unk5F3)
|
||||
if (gCurrentPinballGame->bonusTrapEnabled)
|
||||
{
|
||||
sub_1493C();
|
||||
ProcessBonusTrapPhysics();
|
||||
}
|
||||
}
|
||||
if (gCurrentPinballGame->unk22 != 0)
|
||||
if (gCurrentPinballGame->collisionResponseType != 0)
|
||||
{
|
||||
gCurrentPinballGame->ball->positionQ1.x = var0.x;
|
||||
gCurrentPinballGame->ball->positionQ1.y = var0.y;
|
||||
|
|
@ -173,7 +173,7 @@ void AllBoardProcess_6B_1333C()
|
|||
}
|
||||
}
|
||||
|
||||
u16 sub_13824(struct Vector16* param)
|
||||
u16 DetectBallCollision(struct Vector16* param)
|
||||
{
|
||||
u16 retVal;
|
||||
struct Vector16 test;
|
||||
|
|
@ -181,66 +181,66 @@ u16 sub_13824(struct Vector16* param)
|
|||
test.y = gCurrentPinballGame->ball->positionQ1.y - gCurrentPinballGame->ball->prevPositionQ1.y;
|
||||
param->x = gCurrentPinballGame->ball->prevPositionQ1.x;
|
||||
param->y = gCurrentPinballGame->ball->prevPositionQ1.y;
|
||||
retVal = sub_14488(param, test);
|
||||
retVal = PixelWalkCollisionDetection(param, test);
|
||||
|
||||
gCurrentPinballGame->unk124 = 0;
|
||||
gCurrentPinballGame->unk125 = 0;
|
||||
gCurrentPinballGame->tiltInputCounterX = 0;
|
||||
gCurrentPinballGame->tiltInputCounterY = 0;
|
||||
|
||||
if (!gCurrentPinballGame->unk22 && (gCurrentPinballGame->unk122 || gCurrentPinballGame->unk123))
|
||||
if (!gCurrentPinballGame->collisionResponseType && (gCurrentPinballGame->tiltTargetXOffset || gCurrentPinballGame->tiltTargetYOffset))
|
||||
{
|
||||
param->x = gCurrentPinballGame->ball->positionQ1.x;
|
||||
param->y = gCurrentPinballGame->ball->positionQ1.y;
|
||||
test.x = gCurrentPinballGame->unk122;
|
||||
test.y = gCurrentPinballGame->unk123;
|
||||
retVal = sub_14488(param, test);
|
||||
gCurrentPinballGame->unk124 = param->x - gCurrentPinballGame->ball->positionQ1.x;
|
||||
gCurrentPinballGame->unk125 = param->y - gCurrentPinballGame->ball->positionQ1.y;
|
||||
test.x = gCurrentPinballGame->tiltTargetXOffset;
|
||||
test.y = gCurrentPinballGame->tiltTargetYOffset;
|
||||
retVal = PixelWalkCollisionDetection(param, test);
|
||||
gCurrentPinballGame->tiltInputCounterX = param->x - gCurrentPinballGame->ball->positionQ1.x;
|
||||
gCurrentPinballGame->tiltInputCounterY = param->y - gCurrentPinballGame->ball->positionQ1.y;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void sub_13934(struct Vector16 *arg0, struct Vector16 *arg1, u16 angle)
|
||||
void ApplyTiltEffectOnCollision(struct Vector16 *arg0, struct Vector16 *arg1, u16 angle)
|
||||
{
|
||||
s16 cos;
|
||||
|
||||
arg1->x = 0;
|
||||
arg1->y = 0;
|
||||
if (gCurrentPinballGame->unk122)
|
||||
if (gCurrentPinballGame->tiltTargetXOffset)
|
||||
{
|
||||
arg0->x -= gCurrentPinballGame->unk124;
|
||||
if (gCurrentPinballGame->unk122 > 0)
|
||||
arg0->x -= gCurrentPinballGame->tiltInputCounterX;
|
||||
if (gCurrentPinballGame->tiltTargetXOffset > 0)
|
||||
{
|
||||
cos = Cos(angle);
|
||||
if (cos < 0)
|
||||
{
|
||||
arg1->x = (Cos(angle) * 70) / 20000;
|
||||
gCurrentPinballGame->unk126 = 1;
|
||||
gCurrentPinballGame->tiltLockoutTimer = 1;
|
||||
}
|
||||
}
|
||||
else if (gCurrentPinballGame->unk122 < 0)
|
||||
else if (gCurrentPinballGame->tiltTargetXOffset < 0)
|
||||
{
|
||||
cos = Cos(angle);
|
||||
if (cos > 0)
|
||||
{
|
||||
arg1->x = (Cos(angle) * 70) / 20000;
|
||||
gCurrentPinballGame->unk126 = 1;
|
||||
gCurrentPinballGame->tiltLockoutTimer = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk123 > 0)
|
||||
if (gCurrentPinballGame->tiltTargetYOffset > 0)
|
||||
{
|
||||
arg0->y -= gCurrentPinballGame->unk125;
|
||||
arg0->y -= gCurrentPinballGame->tiltInputCounterY;
|
||||
if (gCurrentPinballGame->ball->positionQ0.y > 364)
|
||||
{
|
||||
if (gCurrentPinballGame->unk122 == 0)
|
||||
if (gCurrentPinballGame->tiltTargetXOffset == 0)
|
||||
arg1->y = -(Sin(angle) * 130) / 20000;
|
||||
else
|
||||
arg1->y = -(Sin(angle) * 100) / 20000;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk122 == 0)
|
||||
if (gCurrentPinballGame->tiltTargetXOffset == 0)
|
||||
arg1->y = -(Sin(angle) * 100) / 20000;
|
||||
else
|
||||
arg1->y = -(Sin(angle) * 75) / 20000;
|
||||
|
|
@ -251,17 +251,17 @@ void sub_13934(struct Vector16 *arg0, struct Vector16 *arg1, u16 angle)
|
|||
gCurrentPinballGame->ball->velocity.x /= 4;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk126 = 1;
|
||||
gCurrentPinballGame->tiltLockoutTimer = 1;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk126)
|
||||
if (gCurrentPinballGame->tiltLockoutTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk122 = 0;
|
||||
gCurrentPinballGame->unk123 = 0;
|
||||
gCurrentPinballGame->tiltTargetXOffset = 0;
|
||||
gCurrentPinballGame->tiltTargetYOffset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_13B28(struct Vector16* arg0, struct Vector16* arg1, s16 arg2)
|
||||
void ComputeFlipperBounce(struct Vector16* arg0, struct Vector16* arg1, s16 arg2)
|
||||
{
|
||||
struct Vector16 r7;
|
||||
u16 r4;
|
||||
|
|
@ -278,12 +278,12 @@ void sub_13B28(struct Vector16* arg0, struct Vector16* arg1, s16 arg2)
|
|||
{
|
||||
sp12 = gCurrentPinballGame->flipper[arg2].position - gCurrentPinballGame->flipper[arg2].prevPosition;
|
||||
|
||||
if ((sp12 *= gCurrentPinballGame->flipper[arg2].unk8) > 0)
|
||||
if ((sp12 *= gCurrentPinballGame->flipper[arg2].ballSide) > 0)
|
||||
{
|
||||
if (gCurrentPinballGame->flipper[arg2].unk2 < 7)
|
||||
r4 = gUnknown_086ACD84[gCurrentPinballGame->flipper[arg2].unk5 - 1][0] + 0x4000;
|
||||
if (gCurrentPinballGame->flipper[arg2].collisionFrameIndex < 7)
|
||||
r4 = gFlipperCollisionAngles[gCurrentPinballGame->flipper[arg2].collisionMapFrame - 1][0] + 0x4000;
|
||||
else
|
||||
r4 = gUnknown_086ACD84[gCurrentPinballGame->flipper[arg2].unk5 + 1][1] + -0x4000; // This changes compilation, apparently
|
||||
r4 = gFlipperCollisionAngles[gCurrentPinballGame->flipper[arg2].collisionMapFrame + 1][1] + -0x4000; // This changes compilation, apparently
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -297,7 +297,7 @@ void sub_13B28(struct Vector16* arg0, struct Vector16* arg1, s16 arg2)
|
|||
yy = r7.y * r7.y;
|
||||
temp = xx + yy - 0x240000;
|
||||
temp = Sqrt(temp * 4) / 2;
|
||||
sub_14B84(temp, arg2, &sp4, r4);
|
||||
ComputeFlipperLaunchVelocity(temp, arg2, &sp4, r4);
|
||||
|
||||
if (sp4.x > 0x1C2)
|
||||
sp4.x = 0x1C2;
|
||||
|
|
@ -313,9 +313,9 @@ void sub_13B28(struct Vector16* arg0, struct Vector16* arg1, s16 arg2)
|
|||
if (arg0->x < 50)
|
||||
break;
|
||||
|
||||
for (i = gCurrentPinballGame->unk1E; i < 4; i++)
|
||||
for (i = gCurrentPinballGame->gravityStrengthIndex; i < 4; i++)
|
||||
{
|
||||
if (sub_14AF4(*arg0, i + 1, &sp0, arg2))
|
||||
if (LookupFlipperCollisionMap(*arg0, i + 1, &sp0, arg2))
|
||||
{
|
||||
flag = TRUE;
|
||||
break;
|
||||
|
|
@ -328,7 +328,7 @@ void sub_13B28(struct Vector16* arg0, struct Vector16* arg1, s16 arg2)
|
|||
|
||||
if (sp12 <= 0)
|
||||
{
|
||||
gCurrentPinballGame->unk22 = 5;
|
||||
gCurrentPinballGame->collisionResponseType = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -338,7 +338,7 @@ void sub_13B28(struct Vector16* arg0, struct Vector16* arg1, s16 arg2)
|
|||
}
|
||||
|
||||
|
||||
void sub_13D24(u16 arg0, struct Vector16 *arg1, struct Vector16 *arg2)
|
||||
void ComputeWallReflection(u16 arg0, struct Vector16 *arg1, struct Vector16 *arg2)
|
||||
{
|
||||
u16 angleOfFlippedArg1;
|
||||
s32 angleDelta, adjustedAngle;
|
||||
|
|
@ -404,7 +404,7 @@ void sub_13D24(u16 arg0, struct Vector16 *arg1, struct Vector16 *arg2)
|
|||
m4aSongNumStart(SE_WALL_HIT);
|
||||
|
||||
if (forwardMag > 0x118
|
||||
&& gCurrentPinballGame->unk61C == 0
|
||||
&& gCurrentPinballGame->entityOverlayCollisionState == 0
|
||||
&& gMain.selectedField < MAIN_FIELD_COUNT)
|
||||
{
|
||||
PlayRumble(6);
|
||||
|
|
@ -419,13 +419,13 @@ void sub_13D24(u16 arg0, struct Vector16 *arg1, struct Vector16 *arg2)
|
|||
forwardMag = scaledForwardMag / 100;
|
||||
scaledLateralMag = (lateralMag * 8) / 10;
|
||||
|
||||
curveScaleFactor = gCurrentPinballGame->ball->unk6 * 0xEB8 / 0x2BC00;
|
||||
curveScaleFactor = gCurrentPinballGame->ball->spinSpeed * 0xEB8 / 0x2BC00;
|
||||
|
||||
curveDir = -angleSign;
|
||||
curveDirScaledFactor = (curveDir * 25) * 1024;
|
||||
gCurrentPinballGame->ball->unk6 =
|
||||
gCurrentPinballGame->ball->spinSpeed =
|
||||
curveDirScaledFactor * scaledLateralMag / 0xEB8
|
||||
+ gCurrentPinballGame->ball->unk4;
|
||||
+ gCurrentPinballGame->ball->spinAcceleration;
|
||||
|
||||
tempVec.x = forwardMag * Cos(arg0);
|
||||
tempVec.y = -forwardMag * Sin(arg0);
|
||||
|
|
@ -463,7 +463,7 @@ void sub_13D24(u16 arg0, struct Vector16 *arg1, struct Vector16 *arg2)
|
|||
finalAngle = ArcTan2( tempVec.x, -tempVec.y);
|
||||
|
||||
if (gMain.selectedField == FIELD_SAPPHIRE
|
||||
&& gCurrentPinballGame->unk24 > 0
|
||||
&& gCurrentPinballGame->boardLayerDepth > 0
|
||||
&& gCurrentPinballGame->ball->positionQ0.y < 0xD2)
|
||||
{
|
||||
tempVec.x = halfMag * Cos(finalAngle) / 20000;
|
||||
|
|
@ -475,13 +475,13 @@ void sub_13D24(u16 arg0, struct Vector16 *arg1, struct Vector16 *arg2)
|
|||
tempVec.y = -halfMag2 * Sin(finalAngle) / 20000;
|
||||
}
|
||||
|
||||
sub_14074(arg0, &tempVec, angleOfFlippedArg1);
|
||||
ApplyBounceBackForce(arg0, &tempVec, angleOfFlippedArg1);
|
||||
|
||||
arg2->x = tempVec.x;
|
||||
arg2->y = tempVec.y;
|
||||
}
|
||||
|
||||
void sub_14074(u16 arg0, struct Vector32 *arg1, u16 arg2)
|
||||
void ApplyBounceBackForce(u16 arg0, struct Vector32 *arg1, u16 arg2)
|
||||
{
|
||||
const u16 VECTORSCALEDOWN = 20000;
|
||||
s32 vMagSquared;
|
||||
|
|
@ -494,7 +494,7 @@ void sub_14074(u16 arg0, struct Vector32 *arg1, u16 arg2)
|
|||
y = gCurrentPinballGame->ball->velocity.y;
|
||||
vMagSquared = (x * x) + (y * y);
|
||||
|
||||
if (gCurrentPinballGame->unk23 == 2)
|
||||
if (gCurrentPinballGame->collisionSurfaceType == 2)
|
||||
{
|
||||
if (gCurrentPinballGame->ball->positionQ1.x > 0xE0)
|
||||
{
|
||||
|
|
@ -519,7 +519,7 @@ void sub_14074(u16 arg0, struct Vector32 *arg1, u16 arg2)
|
|||
arg1->x = arg1->x / 5;
|
||||
arg1->y = arg1->y / 5;
|
||||
|
||||
gCurrentPinballGame->ball->unk6 = (gCurrentPinballGame->ball->unk6 * 4) / 10;
|
||||
gCurrentPinballGame->ball->spinSpeed = (gCurrentPinballGame->ball->spinSpeed * 4) / 10;
|
||||
|
||||
if ( gCurrentPinballGame->ballSpeed > 0)
|
||||
{
|
||||
|
|
@ -532,16 +532,16 @@ void sub_14074(u16 arg0, struct Vector32 *arg1, u16 arg2)
|
|||
tempVec.y = -285 * Sin(arg0) / VECTORSCALEDOWN;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk716 = 4;
|
||||
gCurrentPinballGame->slingshotHitAnimTimer = 4;
|
||||
if (gCurrentPinballGame->ball->positionQ0.x < 120)
|
||||
gCurrentPinballGame->unk717 = 0;
|
||||
gCurrentPinballGame->slingshotSideIndex = 0;
|
||||
else
|
||||
gCurrentPinballGame->unk717 = 1;
|
||||
gCurrentPinballGame->slingshotSideIndex = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk23 == 1)
|
||||
if (gCurrentPinballGame->collisionSurfaceType == 1)
|
||||
{
|
||||
arg1->x = arg1->x / 5;
|
||||
arg1->y = arg1->y / 5;
|
||||
|
|
@ -564,22 +564,22 @@ void sub_14074(u16 arg0, struct Vector32 *arg1, u16 arg2)
|
|||
}
|
||||
else
|
||||
{
|
||||
tempVec.x = gUnknown_086ACDF4[gCurrentPinballGame->unk23] * Cos(arg0) / VECTORSCALEDOWN;
|
||||
tempVec.y = -gUnknown_086ACDF4[gCurrentPinballGame->unk23] * Sin(arg0) / VECTORSCALEDOWN;
|
||||
tempVec.x = gBounceBackForceMagnitudes[gCurrentPinballGame->collisionSurfaceType] * Cos(arg0) / VECTORSCALEDOWN;
|
||||
tempVec.y = -gBounceBackForceMagnitudes[gCurrentPinballGame->collisionSurfaceType] * Sin(arg0) / VECTORSCALEDOWN;
|
||||
}
|
||||
}
|
||||
|
||||
arg1->x = arg1->x + tempVec.x;
|
||||
arg1->y = arg1->y + tempVec.y;
|
||||
|
||||
if (gCurrentPinballGame->unk5A4 != 0)
|
||||
if (gCurrentPinballGame->captureState != 0)
|
||||
{
|
||||
s16 x2 = arg1->x;
|
||||
s16 xSign = 1;
|
||||
u16 angle;
|
||||
if (gCurrentPinballGame->unk5A4 == 1)
|
||||
if (gCurrentPinballGame->captureState == 1)
|
||||
{
|
||||
gCurrentPinballGame->unk5A4 = 0;
|
||||
gCurrentPinballGame->captureState = 0;
|
||||
vMagSquared = 0x80;
|
||||
}
|
||||
else
|
||||
|
|
@ -596,14 +596,14 @@ void sub_14074(u16 arg0, struct Vector32 *arg1, u16 arg2)
|
|||
if (x2 < 0x100)
|
||||
arg1->x = xSign * 256;
|
||||
|
||||
gCurrentPinballGame->ball->unk6 = 0;
|
||||
gCurrentPinballGame->ball->spinSpeed = 0;
|
||||
angle = ArcTan2(arg1->x, -arg1->y);
|
||||
arg1->x = vMagSquared * Cos(angle) / VECTORSCALEDOWN;
|
||||
arg1->y = -vMagSquared * Sin(angle) / VECTORSCALEDOWN;
|
||||
}
|
||||
}
|
||||
|
||||
u16 sub_14488(struct Vector16* arg0, struct Vector16 arg1) {
|
||||
u16 PixelWalkCollisionDetection(struct Vector16* arg0, struct Vector16 arg1) {
|
||||
struct Vector16 r8;
|
||||
|
||||
u32 toggleShiftMode;
|
||||
|
|
@ -630,8 +630,8 @@ u16 sub_14488(struct Vector16* arg0, struct Vector16 arg1) {
|
|||
else
|
||||
toggleShiftMode = 1;
|
||||
|
||||
gCurrentPinballGame->unk22 = 0;
|
||||
gCurrentPinballGame->unk23 = 0;
|
||||
gCurrentPinballGame->collisionResponseType = 0;
|
||||
gCurrentPinballGame->collisionSurfaceType = 0;
|
||||
|
||||
spC = BoardCollisionFuncts_086ACE0C[gMain.selectedField];
|
||||
|
||||
|
|
@ -639,9 +639,9 @@ u16 sub_14488(struct Vector16* arg0, struct Vector16 arg1) {
|
|||
{
|
||||
if(spC(arg0, &sp0_return) != 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk22 == 1)
|
||||
if (gCurrentPinballGame->collisionResponseType == 1)
|
||||
{
|
||||
if (gCurrentPinballGame->unk23 == 3)
|
||||
if (gCurrentPinballGame->collisionSurfaceType == 3)
|
||||
{
|
||||
u16 j;
|
||||
u16 sp2_testRes;
|
||||
|
|
@ -649,12 +649,12 @@ u16 sub_14488(struct Vector16* arg0, struct Vector16 arg1) {
|
|||
|
||||
for(j=0; j < 4; j++)
|
||||
{
|
||||
sp4_testPos.x = arg0->x + gUnknown_086ACE60[j].x;
|
||||
sp4_testPos.y = arg0->y + gUnknown_086ACE60[j].y;
|
||||
sp4_testPos.x = arg0->x + gWallEscapeOffsets[j].x;
|
||||
sp4_testPos.y = arg0->y + gWallEscapeOffsets[j].y;
|
||||
|
||||
spC(&sp4_testPos, &sp2_testRes);
|
||||
|
||||
if (gCurrentPinballGame->unk22 == 1 && gCurrentPinballGame->unk23 == 0)
|
||||
if (gCurrentPinballGame->collisionResponseType == 1 && gCurrentPinballGame->collisionSurfaceType == 0)
|
||||
{
|
||||
arg0->x = sp4_testPos.x;
|
||||
arg0->y = sp4_testPos.y;
|
||||
|
|
@ -671,10 +671,10 @@ u16 sub_14488(struct Vector16* arg0, struct Vector16 arg1) {
|
|||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk22 = 0;
|
||||
gCurrentPinballGame->collisionResponseType = 0;
|
||||
|
||||
if (sub_1467C(arg0, &sp0_return) != 0 ||
|
||||
(gCurrentPinballGame->unk5F2 != 0 && sub_14740(arg0, &sp0_return) != 0))
|
||||
if (CheckFlipperCollision(arg0, &sp0_return) != 0 ||
|
||||
(gCurrentPinballGame->jirachiCollisionEnabled != 0 && CheckCatchTargetCollision(arg0, &sp0_return) != 0))
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -700,7 +700,7 @@ u16 sub_14488(struct Vector16* arg0, struct Vector16 arg1) {
|
|||
return sp0_return;
|
||||
}
|
||||
|
||||
u16 sub_1467C(struct Vector16* arg0, u16* arg1)
|
||||
u16 CheckFlipperCollision(struct Vector16* arg0, u16* arg1)
|
||||
{
|
||||
u16 res;
|
||||
struct Vector16 vec1;
|
||||
|
|
@ -708,18 +708,18 @@ u16 sub_1467C(struct Vector16* arg0, u16* arg1)
|
|||
|
||||
res = 0;
|
||||
|
||||
vec1.x = arg0->x - gUnknown_02031520.unk14.unk22 * 2;
|
||||
vec2.x = arg0->x - gUnknown_02031520.unk14.unk24 * 2;
|
||||
vec1.y = arg0->y - gUnknown_02031520.unk14.unk20 * 2;
|
||||
vec1.x = arg0->x - gBoardConfig.fieldLayout.leftFlipperOriginX * 2;
|
||||
vec2.x = arg0->x - gBoardConfig.fieldLayout.rightFlipperOriginX * 2;
|
||||
vec1.y = arg0->y - gBoardConfig.fieldLayout.flipperOriginY * 2;
|
||||
vec2.y = vec1.y;
|
||||
|
||||
if (vec1.y <= 95 && vec1.y >= 0)
|
||||
{
|
||||
if (vec1.x <= 95 && vec1.x >= 0)
|
||||
{
|
||||
if(sub_14AF4(vec1, gCurrentPinballGame->unk1E + 1, arg1, 0))
|
||||
if(LookupFlipperCollisionMap(vec1, gCurrentPinballGame->gravityStrengthIndex + 1, arg1, 0))
|
||||
{
|
||||
gCurrentPinballGame->unk22 = 3;
|
||||
gCurrentPinballGame->collisionResponseType = 3;
|
||||
res = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -729,9 +729,9 @@ u16 sub_1467C(struct Vector16* arg0, u16* arg1)
|
|||
if (vec2.x <= 95 && vec2.x >= 0)
|
||||
{
|
||||
vec2.x = 95 - vec2.x;
|
||||
if (sub_14AF4(vec2, gCurrentPinballGame->unk1E + 1, arg1, 1))
|
||||
if (LookupFlipperCollisionMap(vec2, gCurrentPinballGame->gravityStrengthIndex + 1, arg1, 1))
|
||||
{
|
||||
gCurrentPinballGame->unk22 = 4;
|
||||
gCurrentPinballGame->collisionResponseType = 4;
|
||||
res = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -742,7 +742,7 @@ u16 sub_1467C(struct Vector16* arg0, u16* arg1)
|
|||
}
|
||||
|
||||
|
||||
u16 sub_14740(struct Vector16 *arg0, u16 *arg1)
|
||||
u16 CheckCatchTargetCollision(struct Vector16 *arg0, u16 *arg1)
|
||||
{
|
||||
struct Vector16 vec1;
|
||||
u16 x, y;
|
||||
|
|
@ -750,48 +750,48 @@ u16 sub_14740(struct Vector16 *arg0, u16 *arg1)
|
|||
u16 var0;
|
||||
|
||||
res = 0;
|
||||
if (gCurrentPinballGame->unk5A4 != 2)
|
||||
if (gCurrentPinballGame->captureState != 2)
|
||||
{
|
||||
vec1.x = arg0->x / 2 - gCurrentPinballGame->unkC4;
|
||||
vec1.y = arg0->y / 2 - gCurrentPinballGame->unkC6;
|
||||
vec1.x = arg0->x / 2 - gCurrentPinballGame->jirachiCenterX;
|
||||
vec1.y = arg0->y / 2 - gCurrentPinballGame->jirachiCenterY;
|
||||
if ((vec1.y >= 0 && vec1.y < 48) && (vec1.x >= 0 && vec1.x < 48))
|
||||
{
|
||||
s32 ix = vec1.y * 48 + vec1.x;
|
||||
var0 = gUnknown_0839A28C[ix];
|
||||
var0 = gCatchTargetCollisionBitmap[ix];
|
||||
if (var0 & 0x80)
|
||||
{
|
||||
gCurrentPinballGame->unk22 = 2;
|
||||
gCurrentPinballGame->unk23 = 3;
|
||||
gCurrentPinballGame->collisionResponseType = 2;
|
||||
gCurrentPinballGame->collisionSurfaceType = 3;
|
||||
//Todo: fakematch; used to swap register order
|
||||
*arg1 = (var0 & 0x7F & var0) * 512;
|
||||
gCurrentPinballGame->unk5A6 = 20;
|
||||
gCurrentPinballGame->captureSequenceFrame = 20;
|
||||
|
||||
if (gCurrentPinballGame->unk5A9)
|
||||
gCurrentPinballGame->unk5A9 = 24;
|
||||
if (gCurrentPinballGame->captureFlashTimer)
|
||||
gCurrentPinballGame->captureFlashTimer = 24;
|
||||
else
|
||||
gCurrentPinballGame->unk5A9 = 20;
|
||||
gCurrentPinballGame->captureFlashTimer = 20;
|
||||
|
||||
// Only difference between these two branches is the played sound
|
||||
if (gCurrentPinballGame->currentSpecies == SPECIES_JIRACHI)
|
||||
{
|
||||
if (gCurrentPinballGame->unk5AA == 0)
|
||||
if (gCurrentPinballGame->creatureHitCooldown == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk5A5++;
|
||||
if (gCurrentPinballGame->unk5A5 == 3)
|
||||
gCurrentPinballGame->creatureHitCount++;
|
||||
if (gCurrentPinballGame->creatureHitCount == 3)
|
||||
{
|
||||
gCurrentPinballGame->unk71D[gCurrentPinballGame->unk5A5 - 1] = 3;
|
||||
gCurrentPinballGame->unk5A4 = 2;
|
||||
gCurrentPinballGame->unk5A6 = 0;
|
||||
gCurrentPinballGame->catchLights[gCurrentPinballGame->creatureHitCount - 1] = 3;
|
||||
gCurrentPinballGame->captureState = 2;
|
||||
gCurrentPinballGame->captureSequenceFrame = 0;
|
||||
gCurrentPinballGame->scoreAddedInFrame = 10000;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk71D[gCurrentPinballGame->unk5A5 - 1] = 3;
|
||||
gCurrentPinballGame->unk5A4 = 1;
|
||||
gCurrentPinballGame->catchLights[gCurrentPinballGame->creatureHitCount - 1] = 3;
|
||||
gCurrentPinballGame->captureState = 1;
|
||||
gCurrentPinballGame->scoreAddedInFrame = 10000;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk5AA = 4;
|
||||
gCurrentPinballGame->creatureHitCooldown = 4;
|
||||
}
|
||||
|
||||
res = 1;
|
||||
|
|
@ -800,24 +800,24 @@ u16 sub_14740(struct Vector16 *arg0, u16 *arg1)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk5AA == 0)
|
||||
if (gCurrentPinballGame->creatureHitCooldown == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk5A5++;
|
||||
if (gCurrentPinballGame->unk5A5 == 3)
|
||||
gCurrentPinballGame->creatureHitCount++;
|
||||
if (gCurrentPinballGame->creatureHitCount == 3)
|
||||
{
|
||||
gCurrentPinballGame->unk71D[gCurrentPinballGame->unk5A5 - 1] = 3;
|
||||
gCurrentPinballGame->unk5A4 = 2;
|
||||
gCurrentPinballGame->unk5A6 = 0;
|
||||
gCurrentPinballGame->catchLights[gCurrentPinballGame->creatureHitCount - 1] = 3;
|
||||
gCurrentPinballGame->captureState = 2;
|
||||
gCurrentPinballGame->captureSequenceFrame = 0;
|
||||
gCurrentPinballGame->scoreAddedInFrame = 10000;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk71D[gCurrentPinballGame->unk5A5 - 1] = 3;
|
||||
gCurrentPinballGame->unk5A4 = 1;
|
||||
gCurrentPinballGame->catchLights[gCurrentPinballGame->creatureHitCount - 1] = 3;
|
||||
gCurrentPinballGame->captureState = 1;
|
||||
gCurrentPinballGame->scoreAddedInFrame = 10000;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk5AA = 4;
|
||||
gCurrentPinballGame->creatureHitCooldown = 4;
|
||||
}
|
||||
|
||||
res = 1;
|
||||
|
|
@ -832,7 +832,7 @@ u16 sub_14740(struct Vector16 *arg0, u16 *arg1)
|
|||
}
|
||||
|
||||
|
||||
void sub_1493C(void)
|
||||
void ProcessBonusTrapPhysics(void)
|
||||
{
|
||||
struct Vector16 vec1;
|
||||
struct Vector32 vec2;
|
||||
|
|
@ -844,7 +844,7 @@ void sub_1493C(void)
|
|||
vec1.y = gCurrentPinballGame->ball->positionQ1.y - 558;
|
||||
squaredMagnitude = (vec1.x * vec1.x) + (vec1.y * vec1.y);
|
||||
|
||||
if (squaredMagnitude < 1764 && (gCurrentPinballGame->unk1E & 1) == 0)
|
||||
if (squaredMagnitude < 1764 && (gCurrentPinballGame->gravityStrengthIndex & 1) == 0)
|
||||
{
|
||||
angle = ArcTan2(-vec1.x, vec1.y);
|
||||
temp_adjust = 30;
|
||||
|
|
@ -854,48 +854,48 @@ void sub_1493C(void)
|
|||
gCurrentPinballGame->ball->velocity.y = ((vec2.y * 100) + (98 * gCurrentPinballGame->ball->velocity.y)) / 100;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk5F4 < 20)
|
||||
if (gCurrentPinballGame->collisionMapScrollY < 20)
|
||||
{
|
||||
if (squaredMagnitude < 40)
|
||||
{
|
||||
gCurrentPinballGame->unk5F4++;
|
||||
gCurrentPinballGame->collisionMapScrollY++;
|
||||
gCurrentPinballGame->ball->scale = 0x100;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->ball->scale = 0x100;
|
||||
if (squaredMagnitude > 100)
|
||||
gCurrentPinballGame->unk5F4 = 0;
|
||||
gCurrentPinballGame->collisionMapScrollY = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk5F4 < 30)
|
||||
if (gCurrentPinballGame->collisionMapScrollY < 30)
|
||||
{
|
||||
gCurrentPinballGame->unk5F4++;
|
||||
gCurrentPinballGame->ball->scale = ((30 - gCurrentPinballGame->unk5F4) * 0x80) / 10 + 0x80;
|
||||
gCurrentPinballGame->collisionMapScrollY++;
|
||||
gCurrentPinballGame->ball->scale = ((30 - gCurrentPinballGame->collisionMapScrollY) * 0x80) / 10 + 0x80;
|
||||
gCurrentPinballGame->ball->positionQ0.x = 119;
|
||||
gCurrentPinballGame->ball->positionQ0.y = 279;
|
||||
gCurrentPinballGame->ball->unk6 = 0;
|
||||
gCurrentPinballGame->ball->spinSpeed = 0;
|
||||
gCurrentPinballGame->ball->positionQ8.x = gCurrentPinballGame->ball->positionQ0.x << 8;
|
||||
gCurrentPinballGame->ball->positionQ8.y = gCurrentPinballGame->ball->positionQ0.y << 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk5F4 = 0;
|
||||
gCurrentPinballGame->unk25 = 4;
|
||||
gCurrentPinballGame->collisionMapScrollY = 0;
|
||||
gCurrentPinballGame->ballCatchState = 4;
|
||||
if (gMain.selectedField == FIELD_RUBY)
|
||||
sub_1A98C();
|
||||
DispatchRubyCatchModeInit();
|
||||
else
|
||||
sub_32914();
|
||||
DispatchSapphireCatchModeInit();
|
||||
|
||||
gCurrentPinballGame->unk22 = 7;
|
||||
gCurrentPinballGame->collisionResponseType = 7;
|
||||
gCurrentPinballGame->ball->scale = 0x80;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u16 sub_14AF4(struct Vector16 r0, s16 r1, u16 *r2, s16 r3) {
|
||||
u16 LookupFlipperCollisionMap(struct Vector16 r0, s16 r1, u16 *r2, s16 r3) {
|
||||
struct FlipperState* flipper;
|
||||
u16 res;
|
||||
int new_var;
|
||||
|
|
@ -906,11 +906,11 @@ u16 sub_14AF4(struct Vector16 r0, s16 r1, u16 *r2, s16 r3) {
|
|||
ix = (r0.y * 96) + r0.x;
|
||||
flipper = &gCurrentPinballGame->flipper[r3];
|
||||
|
||||
flipper->unk5 = gUnknown_086ACDB8[r1 + (flipper->unk2 * 5)];
|
||||
flipper->collisionMapFrame = gFlipperCollisionFrameMapping[r1 + (flipper->collisionFrameIndex * 5)];
|
||||
|
||||
if (0xF & (&gUnknown_02031520.unk68[flipper->unk5 * 0x2400])[ix])
|
||||
if (0xF & (&gBoardConfig.flipperCollisionData[flipper->collisionMapFrame * 0x2400])[ix])
|
||||
{
|
||||
*r2 = 0xFFF0 & (&gUnknown_02031520.unk68[flipper->unk5 * 0x2400])[ix];
|
||||
*r2 = 0xFFF0 & (&gBoardConfig.flipperCollisionData[flipper->collisionMapFrame * 0x2400])[ix];
|
||||
if (r3 == 1)
|
||||
{
|
||||
new_var = 0x8000;
|
||||
|
|
@ -922,22 +922,22 @@ u16 sub_14AF4(struct Vector16 r0, s16 r1, u16 *r2, s16 r3) {
|
|||
return res;
|
||||
}
|
||||
|
||||
void sub_14B84(s32 arg0, s16 arg1, struct Vector16* arg2, u16 arg3)
|
||||
void ComputeFlipperLaunchVelocity(s32 arg0, s16 arg1, struct Vector16* arg2, u16 arg3)
|
||||
{
|
||||
u16 angle;
|
||||
|
||||
angle = gCurrentPinballGame->flipper[arg1].unk5;
|
||||
angle = gCurrentPinballGame->flipper[arg1].collisionMapFrame;
|
||||
|
||||
if (gCurrentPinballGame->flipper[arg1].unk8 > 0)
|
||||
if (gCurrentPinballGame->flipper[arg1].ballSide > 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk5C == 0)
|
||||
if (gCurrentPinballGame->flipperLaunchPending == 0)
|
||||
{
|
||||
u16 var0;
|
||||
s32 scale;
|
||||
s16 temp_r2;
|
||||
s16 temp_r5;
|
||||
|
||||
temp_r2 = gCurrentPinballGame->flipper[arg1].unk5;
|
||||
temp_r2 = gCurrentPinballGame->flipper[arg1].collisionMapFrame;
|
||||
temp_r5 = (temp_r2 - 2) * 25;
|
||||
arg0 -= temp_r5;
|
||||
|
||||
|
|
@ -949,8 +949,8 @@ void sub_14B84(s32 arg0, s16 arg1, struct Vector16* arg2, u16 arg3)
|
|||
else
|
||||
{
|
||||
var0 =
|
||||
gUnknown_086ACE2C[temp_r2][0] -
|
||||
((gUnknown_086ACE2C[temp_r2][1] * (arg0 -2600)) / 5400);
|
||||
gFlipperLaunchVelocityParams[temp_r2][0] -
|
||||
((gFlipperLaunchVelocityParams[temp_r2][1] * (arg0 -2600)) / 5400);
|
||||
scale = ((arg0 -2600) * 348 / 5400) + 406;
|
||||
}
|
||||
|
||||
|
|
@ -958,20 +958,20 @@ void sub_14B84(s32 arg0, s16 arg1, struct Vector16* arg2, u16 arg3)
|
|||
var0 = 0x8000 - var0;
|
||||
|
||||
angle = (gCurrentPinballGame->ball->velocity.x * -0x600) / 0x80 +
|
||||
(gCurrentPinballGame->ball->unk8 * -0x180) / 0x100 +
|
||||
(gCurrentPinballGame->ball->prevSpinSpeed * -0x180) / 0x100 +
|
||||
var0;
|
||||
gCurrentPinballGame->unk60.x = scale * Cos(angle) / 20000;
|
||||
gCurrentPinballGame->unk60.y = -scale * Sin(angle) / 20000;
|
||||
gCurrentPinballGame->flipperLaunchVelocity.x = scale * Cos(angle) / 20000;
|
||||
gCurrentPinballGame->flipperLaunchVelocity.y = -scale * Sin(angle) / 20000;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk5C = 1;
|
||||
gCurrentPinballGame->flipperLaunchPending = 1;
|
||||
|
||||
if (arg1)
|
||||
arg2->x = -gCurrentPinballGame->unk60.x;
|
||||
arg2->x = -gCurrentPinballGame->flipperLaunchVelocity.x;
|
||||
else
|
||||
arg2->x = gCurrentPinballGame->unk60.x;
|
||||
arg2->x = gCurrentPinballGame->flipperLaunchVelocity.x;
|
||||
|
||||
arg2->y = gCurrentPinballGame->unk60.y;
|
||||
arg2->y = gCurrentPinballGame->flipperLaunchVelocity.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
#include "constants/fields.h"
|
||||
#include "m4a.h"
|
||||
|
||||
extern const u32 gUnknown_083BF16C[][0x80];
|
||||
extern const u32 gUnknown_083BDF6C[][0x80];
|
||||
extern const u32 gBallSpawnGlowTiles_Type1[][0x80];
|
||||
extern const u32 gBallSpawnGlowTiles_Type2[][0x80];
|
||||
|
||||
void MainBoardProcess_7B_12524(void)
|
||||
{
|
||||
|
|
@ -17,14 +17,14 @@ void MainBoardProcess_7B_12524(void)
|
|||
s16 r8;
|
||||
|
||||
currentBallState = gCurrentPinballGame->ball;
|
||||
r8 = currentBallState->unkA >> 12;
|
||||
r8 = currentBallState->spinAngle >> 12;
|
||||
|
||||
if (currentBallState->positionQ0.y == 340 && (currentBallState->positionQ0.x == 90 || currentBallState->positionQ0.x == 149))
|
||||
currentBallState->unkA = currentBallState->unkC;
|
||||
currentBallState->spinAngle = currentBallState->prevSpinAngle;
|
||||
|
||||
currentBallState->unkC = currentBallState->unkA;
|
||||
currentBallState->prevSpinAngle = currentBallState->spinAngle;
|
||||
|
||||
if (!gCurrentPinballGame->unk5F7 && gCurrentPinballGame->ballUpgradeCounter > 0)
|
||||
if (!gCurrentPinballGame->ballUpgradeTimerFrozen && gCurrentPinballGame->ballUpgradeCounter > 0)
|
||||
{
|
||||
if (--gCurrentPinballGame->ballUpgradeCounter == 0)
|
||||
{
|
||||
|
|
@ -36,29 +36,29 @@ void MainBoardProcess_7B_12524(void)
|
|||
gCurrentPinballGame->ballUpgradeCounter = 3600;
|
||||
}
|
||||
|
||||
DmaCopy16(3, gUnknown_08137E14[gCurrentPinballGame->ballUpgradeType], (void *)OBJ_PLTT + 0x20, 0x20);
|
||||
DmaCopy16(3, gBallPalettes[gCurrentPinballGame->ballUpgradeType], (void *)OBJ_PLTT + 0x20, 0x20);
|
||||
}
|
||||
}
|
||||
|
||||
if (currentBallState->positionQ0.y >= 244)
|
||||
{
|
||||
gCurrentPinballGame->unk5B2 = 1;
|
||||
gCurrentPinballGame->unk176 = 0;
|
||||
gCurrentPinballGame->ballInLowerHalf = 1;
|
||||
gCurrentPinballGame->pondEntitySpriteFlag = 0;
|
||||
}
|
||||
else
|
||||
gCurrentPinballGame->unk5B2 = 0;
|
||||
gCurrentPinballGame->ballInLowerHalf = 0;
|
||||
|
||||
currentBallState->positionQ0.x = currentBallState->positionQ1.x / 2;
|
||||
currentBallState->positionQ0.y = currentBallState->positionQ1.y / 2;
|
||||
|
||||
spriteGroup = gMain.unk44[0];
|
||||
spriteGroup = gMain.fieldSpriteGroups[0];
|
||||
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
SetMatrixScale(currentBallState->scale, currentBallState->scale, 0);
|
||||
|
||||
spriteGroup->baseX = -(gCurrentPinballGame->unk4C + 7) + currentBallState->positionQ0.x - gCurrentPinballGame->unk2AA;
|
||||
spriteGroup->baseY = -(gCurrentPinballGame->unk4E + 7) + currentBallState->positionQ0.y - gCurrentPinballGame->unk5FC - gCurrentPinballGame->unkE6 + gCurrentPinballGame->unk166;
|
||||
spriteGroup->baseX = -(gCurrentPinballGame->cameraBaseX + 7) + currentBallState->positionQ0.x - gCurrentPinballGame->screenShakeX;
|
||||
spriteGroup->baseY = -(gCurrentPinballGame->cameraBaseY + 7) + currentBallState->positionQ0.y - gCurrentPinballGame->cameraScrollOffset - gCurrentPinballGame->cameraYAdjust + gCurrentPinballGame->sapphireSpriteTimer;
|
||||
|
||||
currentBallState->screenPosition.x = spriteGroup->baseX;
|
||||
currentBallState->screenPosition.y = spriteGroup->baseY;
|
||||
|
|
@ -77,7 +77,7 @@ void MainBoardProcess_7B_12524(void)
|
|||
oamData->priority = currentBallState->oamPriority;
|
||||
|
||||
r8 = r8; // this fools the compiler into thinking r8 holds something that could need sign extending/truncation
|
||||
DmaCopy16(3, gUnknown_083BB16C[r8 + gCurrentPinballGame->ballUpgradeType * 17], (void *)0x6010400, 0x80);
|
||||
DmaCopy16(3, gBallRotationTileGraphics[r8 + gCurrentPinballGame->ballUpgradeType * 17], (void *)0x6010400, 0x80);
|
||||
|
||||
if (spriteGroup->baseY > 200)
|
||||
spriteGroup->baseY = 200;
|
||||
|
|
@ -87,20 +87,20 @@ void MainBoardProcess_7B_12524(void)
|
|||
|
||||
oamData->x = oam->xOffset + spriteGroup->baseX;
|
||||
|
||||
if (currentBallState->unk0)
|
||||
if (currentBallState->ballHidden)
|
||||
oamData->y = 200;
|
||||
else
|
||||
oamData->y = oam->yOffset + spriteGroup->baseY;
|
||||
}
|
||||
|
||||
spriteGroup = gMain.unk44[49];
|
||||
spriteGroup = gMain.fieldSpriteGroups[49];
|
||||
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
SetMatrixScale(currentBallState->scale, currentBallState->scale, 0);
|
||||
|
||||
spriteGroup->baseX = -(gCurrentPinballGame->unk4C + 7) + currentBallState->positionQ0.x - gCurrentPinballGame->unk2AA;
|
||||
spriteGroup->baseY = -(gCurrentPinballGame->unk4E + 7) + currentBallState->positionQ0.y - gCurrentPinballGame->unk5FC - gCurrentPinballGame->unkE6 + gCurrentPinballGame->unk166;
|
||||
spriteGroup->baseX = -(gCurrentPinballGame->cameraBaseX + 7) + currentBallState->positionQ0.x - gCurrentPinballGame->screenShakeX;
|
||||
spriteGroup->baseY = -(gCurrentPinballGame->cameraBaseY + 7) + currentBallState->positionQ0.y - gCurrentPinballGame->cameraScrollOffset - gCurrentPinballGame->cameraYAdjust + gCurrentPinballGame->sapphireSpriteTimer;
|
||||
|
||||
currentBallState->screenPosition.x = spriteGroup->baseX;
|
||||
currentBallState->screenPosition.y = spriteGroup->baseY;
|
||||
|
|
@ -118,7 +118,7 @@ void MainBoardProcess_7B_12524(void)
|
|||
else
|
||||
oamData->priority = currentBallState->oamPriority;
|
||||
|
||||
DmaCopy16(3, gUnknown_083BB16C[r8 + gCurrentPinballGame->ballUpgradeType * 17], (void *)0x6010400, 0x80);
|
||||
DmaCopy16(3, gBallRotationTileGraphics[r8 + gCurrentPinballGame->ballUpgradeType * 17], (void *)0x6010400, 0x80);
|
||||
|
||||
if (spriteGroup->baseY > 200)
|
||||
spriteGroup->baseY = 200;
|
||||
|
|
@ -128,7 +128,7 @@ void MainBoardProcess_7B_12524(void)
|
|||
|
||||
oamData->x = oam->xOffset + spriteGroup->baseX;
|
||||
|
||||
if (currentBallState->unk0)
|
||||
if (currentBallState->ballHidden)
|
||||
oamData->y = 200;
|
||||
else
|
||||
oamData->y = oam->yOffset + spriteGroup->baseY;
|
||||
|
|
@ -136,18 +136,18 @@ void MainBoardProcess_7B_12524(void)
|
|||
|
||||
for (i = 4; i > 0; i--)
|
||||
{
|
||||
gCurrentPinballGame->unkD0[i].x = gCurrentPinballGame->unkD0[(i - 1)].x;
|
||||
gCurrentPinballGame->unkD0[i].y = gCurrentPinballGame->unkD0[(i - 1)].y;
|
||||
gCurrentPinballGame->ballTrailPosition[i].x = gCurrentPinballGame->ballTrailPosition[(i - 1)].x;
|
||||
gCurrentPinballGame->ballTrailPosition[i].y = gCurrentPinballGame->ballTrailPosition[(i - 1)].y;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unkD0[0].x = currentBallState->positionQ0.x - 7;
|
||||
gCurrentPinballGame->unkD0[0].y = currentBallState->positionQ0.y - 7;
|
||||
gCurrentPinballGame->ballTrailPosition[0].x = currentBallState->positionQ0.x - 7;
|
||||
gCurrentPinballGame->ballTrailPosition[0].y = currentBallState->positionQ0.y - 7;
|
||||
|
||||
if (gCurrentPinballGame->unk71)
|
||||
if (gCurrentPinballGame->ballTrailEnabled)
|
||||
{
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
spriteGroup = gMain.unk44[i + 1];
|
||||
spriteGroup = gMain.fieldSpriteGroups[i + 1];
|
||||
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
|
|
@ -155,30 +155,30 @@ void MainBoardProcess_7B_12524(void)
|
|||
oamData = &gOamBuffer[oam->oamId];
|
||||
|
||||
oamData->priority = currentBallState->oamPriority;
|
||||
oamData->x = oam->xOffset + (gCurrentPinballGame->unkD0[(i + 1) * 2].x - gCurrentPinballGame->unk4C);
|
||||
oamData->x = oam->xOffset + (gCurrentPinballGame->ballTrailPosition[(i + 1) * 2].x - gCurrentPinballGame->cameraBaseX);
|
||||
|
||||
if (i == 0)
|
||||
oamData->y = gCurrentPinballGame->unkD0[2].y - gCurrentPinballGame->unk4E + oam->yOffset;
|
||||
oamData->y = gCurrentPinballGame->ballTrailPosition[2].y - gCurrentPinballGame->cameraBaseY + oam->yOffset;
|
||||
else if (i == 1)
|
||||
{
|
||||
if (gMain.systemFrameCount % 2 == 0)
|
||||
oamData->y = gCurrentPinballGame->unkD0[4].y - gCurrentPinballGame->unk4E + oam->yOffset;
|
||||
oamData->y = gCurrentPinballGame->ballTrailPosition[4].y - gCurrentPinballGame->cameraBaseY + oam->yOffset;
|
||||
else
|
||||
oamData->y = 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gMain.unk44[1]->available = 1;
|
||||
gMain.unk44[2]->available = 1;
|
||||
gMain.unk44[49]->available = 1;
|
||||
gMain.unk44[0]->available = 0;
|
||||
gMain.fieldSpriteGroups[1]->available = 1;
|
||||
gMain.fieldSpriteGroups[2]->available = 1;
|
||||
gMain.fieldSpriteGroups[49]->available = 1;
|
||||
gMain.fieldSpriteGroups[0]->available = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
spriteGroup = gMain.unk44[i + 1];
|
||||
spriteGroup = gMain.fieldSpriteGroups[i + 1];
|
||||
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
|
|
@ -186,26 +186,26 @@ void MainBoardProcess_7B_12524(void)
|
|||
oamData = &gOamBuffer[oam->oamId];
|
||||
|
||||
oamData->priority = currentBallState->oamPriority;
|
||||
oamData->x = oam->xOffset + (gCurrentPinballGame->unkD0[(i + 1) * 2].x - gCurrentPinballGame->unk4C);
|
||||
oamData->x = oam->xOffset + (gCurrentPinballGame->ballTrailPosition[(i + 1) * 2].x - gCurrentPinballGame->cameraBaseX);
|
||||
oamData->y = 200;
|
||||
}
|
||||
}
|
||||
|
||||
gMain.unk44[1]->available = 0;
|
||||
gMain.unk44[2]->available = 0;
|
||||
gMain.unk44[49]->available = 0;
|
||||
gMain.unk44[0]->available = 1;
|
||||
gMain.fieldSpriteGroups[1]->available = 0;
|
||||
gMain.fieldSpriteGroups[2]->available = 0;
|
||||
gMain.fieldSpriteGroups[49]->available = 0;
|
||||
gMain.fieldSpriteGroups[0]->available = 1;
|
||||
}
|
||||
|
||||
spriteGroup = gMain.unk44[43];
|
||||
spriteGroup = gMain.fieldSpriteGroups[43];
|
||||
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
s8 newIx;
|
||||
if (gCurrentPinballGame->unk71C < 59)
|
||||
if (gCurrentPinballGame->ballShadowTimer < 59)
|
||||
{
|
||||
spriteGroup->baseX = gMain.unk44[0]->baseX - 8;
|
||||
spriteGroup->baseY = gMain.unk44[0]->baseY - 8;
|
||||
spriteGroup->baseX = gMain.fieldSpriteGroups[0]->baseX - 8;
|
||||
spriteGroup->baseY = gMain.fieldSpriteGroups[0]->baseY - 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -213,8 +213,8 @@ void MainBoardProcess_7B_12524(void)
|
|||
spriteGroup->baseY = 180;
|
||||
}
|
||||
|
||||
newIx = gCurrentPinballGame->unk6E;
|
||||
DmaCopy16(3, gUnknown_083BD36C[newIx], (void *)0x6011EE0, 0x200);
|
||||
newIx = gCurrentPinballGame->ballShadowTileIndex;
|
||||
DmaCopy16(3, gBallShadowTileGraphics[newIx], (void *)0x6011EE0, 0x200);
|
||||
|
||||
oam = &spriteGroup->oam[0];
|
||||
|
||||
|
|
@ -223,8 +223,8 @@ void MainBoardProcess_7B_12524(void)
|
|||
|
||||
gOamBuffer[oam->oamId].priority = currentBallState->oamPriority;
|
||||
|
||||
if (gCurrentPinballGame->unk71C < 14)
|
||||
gMain.unk44[43]->available = 0;
|
||||
if (gCurrentPinballGame->ballShadowTimer < 14)
|
||||
gMain.fieldSpriteGroups[43]->available = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -235,52 +235,52 @@ void BonusBoardProcess_7B_12BF8()
|
|||
struct SpriteGroup *spriteGroup;
|
||||
struct OamData *oamData;
|
||||
struct OamDataSimple *oam;
|
||||
struct BallState *unk1334_0;
|
||||
struct BallState *primaryBall;
|
||||
|
||||
gCurrentPinballGame->unk1330 = gCurrentPinballGame->unk1334;
|
||||
gCurrentPinballGame->ball = gCurrentPinballGame->unk1334;
|
||||
gCurrentPinballGame->secondaryBall = gCurrentPinballGame->ballStates;
|
||||
gCurrentPinballGame->ball = gCurrentPinballGame->ballStates;
|
||||
|
||||
unk1334_0 = &gCurrentPinballGame->unk1334[0];
|
||||
primaryBall = &gCurrentPinballGame->ballStates[0];
|
||||
|
||||
switch (gMain.selectedField)
|
||||
{
|
||||
case FIELD_KECLEON:
|
||||
unk1334_0->oamPriority = 2;
|
||||
spriteGroup = &gMain_spriteGroups[gUnknown_02031590[22]];
|
||||
primaryBall->oamPriority = 2;
|
||||
spriteGroup = &gMain_spriteGroups[gKecleonSpriteOrderMap[22]];
|
||||
break;
|
||||
case FIELD_KYOGRE:
|
||||
case FIELD_GROUDON:
|
||||
case FIELD_SPHEAL:
|
||||
unk1334_0->oamPriority = 1;
|
||||
spriteGroup = gMain.unk44[0];
|
||||
primaryBall->oamPriority = 1;
|
||||
spriteGroup = gMain.fieldSpriteGroups[0];
|
||||
break;
|
||||
case FIELD_RAYQUAZA:
|
||||
if (unk1334_0->oamPriority > 2)
|
||||
unk1334_0->oamPriority = 2;
|
||||
spriteGroup = gMain.unk44[0];
|
||||
if (primaryBall->oamPriority > 2)
|
||||
primaryBall->oamPriority = 2;
|
||||
spriteGroup = gMain.fieldSpriteGroups[0];
|
||||
break;
|
||||
default:
|
||||
unk1334_0->oamPriority = 3;
|
||||
spriteGroup = gMain.unk44[0];
|
||||
primaryBall->oamPriority = 3;
|
||||
spriteGroup = gMain.fieldSpriteGroups[0];
|
||||
break;
|
||||
}
|
||||
|
||||
r5 = gCurrentPinballGame->ball->unkA >> 12;
|
||||
DmaCopy16(3, &gUnknown_083BB16C[r5 + gCurrentPinballGame->ballUpgradeType * 17], (void *)VRAM + 0x10400, 0x80);
|
||||
r5 = gCurrentPinballGame->ball->spinAngle >> 12;
|
||||
DmaCopy16(3, &gBallRotationTileGraphics[r5 + gCurrentPinballGame->ballUpgradeType * 17], (void *)VRAM + 0x10400, 0x80);
|
||||
|
||||
unk1334_0->positionQ0.x = unk1334_0->positionQ1.x / 2;
|
||||
unk1334_0->positionQ0.y = unk1334_0->positionQ1.y / 2;
|
||||
primaryBall->positionQ0.x = primaryBall->positionQ1.x / 2;
|
||||
primaryBall->positionQ0.y = primaryBall->positionQ1.y / 2;
|
||||
|
||||
spriteGroup->baseX = unk1334_0->positionQ0.x
|
||||
- (gCurrentPinballGame->unk4C + 7)
|
||||
- gCurrentPinballGame->unk2AA;
|
||||
spriteGroup->baseY = unk1334_0->positionQ0.y
|
||||
spriteGroup->baseX = primaryBall->positionQ0.x
|
||||
- (gCurrentPinballGame->cameraBaseX + 7)
|
||||
- gCurrentPinballGame->screenShakeX;
|
||||
spriteGroup->baseY = primaryBall->positionQ0.y
|
||||
- 7
|
||||
- gCurrentPinballGame->unk4E
|
||||
- gCurrentPinballGame->unk5FC
|
||||
- gCurrentPinballGame->unkE6
|
||||
- gCurrentPinballGame->unk2AC
|
||||
- (gCurrentPinballGame->unk38C / 10);
|
||||
- gCurrentPinballGame->cameraBaseY
|
||||
- gCurrentPinballGame->cameraScrollOffset
|
||||
- gCurrentPinballGame->cameraYAdjust
|
||||
- gCurrentPinballGame->screenShakeY
|
||||
- (gCurrentPinballGame->bossRenderOffsetY / 10);
|
||||
|
||||
if (spriteGroup->baseY < -60)
|
||||
spriteGroup->baseY = -60;
|
||||
|
|
@ -288,117 +288,117 @@ void BonusBoardProcess_7B_12BF8()
|
|||
if (spriteGroup->baseY > 180)
|
||||
spriteGroup->baseY = 180;
|
||||
|
||||
unk1334_0->screenPosition.x = spriteGroup->baseX;
|
||||
unk1334_0->screenPosition.y = spriteGroup->baseY;
|
||||
primaryBall->screenPosition.x = spriteGroup->baseX;
|
||||
primaryBall->screenPosition.y = spriteGroup->baseY;
|
||||
|
||||
oam = &spriteGroup->oam[0];
|
||||
oamData = &gOamBuffer[oam->oamId];
|
||||
oamData->priority = unk1334_0->oamPriority;
|
||||
oamData->priority = primaryBall->oamPriority;
|
||||
oamData->x = oam->xOffset + spriteGroup->baseX;
|
||||
|
||||
if (unk1334_0->unk0)
|
||||
if (primaryBall->ballHidden)
|
||||
oamData->y = 200;
|
||||
else
|
||||
oamData->y = oam->yOffset + spriteGroup->baseY;
|
||||
|
||||
if (gCurrentPinballGame->unk388)
|
||||
if (gCurrentPinballGame->ballRespawnState)
|
||||
{
|
||||
spriteGroup = gMain.unk44[1];
|
||||
spriteGroup = gMain.fieldSpriteGroups[1];
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
spriteGroup->baseX = unk1334_0->screenPosition.x - 8;
|
||||
spriteGroup->baseY = unk1334_0->screenPosition.y - 8;
|
||||
spriteGroup->baseX = primaryBall->screenPosition.x - 8;
|
||||
spriteGroup->baseY = primaryBall->screenPosition.y - 8;
|
||||
oam = &spriteGroup->oam[0];
|
||||
gOamBuffer[oam->oamId].x = oam->xOffset + spriteGroup->baseX;
|
||||
gOamBuffer[oam->oamId].y = oam->yOffset + spriteGroup->baseY;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk388 == 1 || gCurrentPinballGame->unk388 == 3)
|
||||
if (gCurrentPinballGame->ballRespawnState == 1 || gCurrentPinballGame->ballRespawnState == 3)
|
||||
{
|
||||
if (gCurrentPinballGame->unk392 == 0)
|
||||
if (gCurrentPinballGame->ballRespawnTimer == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1F = 1;
|
||||
unk1334_0->velocity.x = 0;
|
||||
unk1334_0->velocity.y = 0;
|
||||
unk1334_0->unk6 = 0;
|
||||
gCurrentPinballGame->ballFrozenState = 1;
|
||||
primaryBall->velocity.x = 0;
|
||||
primaryBall->velocity.y = 0;
|
||||
primaryBall->spinSpeed = 0;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk392 == 150)
|
||||
if (gCurrentPinballGame->ballRespawnTimer == 150)
|
||||
spriteGroup->available = TRUE;
|
||||
|
||||
if (gCurrentPinballGame->unk392 == 154)
|
||||
if (gCurrentPinballGame->ballRespawnTimer == 154)
|
||||
m4aSongNumStart(SE_UNKNOWN_0xF9);
|
||||
|
||||
if (gCurrentPinballGame->unk392 > 149)
|
||||
if (gCurrentPinballGame->ballRespawnTimer > 149)
|
||||
{
|
||||
r5 = ((gCurrentPinballGame->unk392 - 150) % 66) / 6;
|
||||
DmaCopy16(3, &gUnknown_083BF16C[r5], (void *)VRAM + 0x10720, 0x200);
|
||||
unk1334_0->unk6 -= 40;
|
||||
r5 = ((gCurrentPinballGame->ballRespawnTimer - 150) % 66) / 6;
|
||||
DmaCopy16(3, &gBallSpawnGlowTiles_Type1[r5], (void *)VRAM + 0x10720, 0x200);
|
||||
primaryBall->spinSpeed -= 40;
|
||||
}
|
||||
|
||||
if ((gMain.modeChangeFlags & ~MODE_CHANGE_EXPIRED_BONUS) == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk392++;
|
||||
gCurrentPinballGame->ballRespawnTimer++;
|
||||
if (r5 >= 7 && r5 <= 10)
|
||||
{
|
||||
DmaCopy16(3, &gUnknown_08137E14[(s16) (gCurrentPinballGame->ballUpgradeType + 4)], (void *)PLTT + 0x220, 0x20);
|
||||
DmaCopy16(3, &gBallPalettes[(s16) (gCurrentPinballGame->ballUpgradeType + 4)], (void *)PLTT + 0x220, 0x20);
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk392 == 186)
|
||||
unk1334_0->unk0 = 0;
|
||||
if (gCurrentPinballGame->ballRespawnTimer == 186)
|
||||
primaryBall->ballHidden = 0;
|
||||
|
||||
if (gCurrentPinballGame->unk392 > 215)
|
||||
if (gCurrentPinballGame->ballRespawnTimer > 215)
|
||||
{
|
||||
if (gCurrentPinballGame->unk388 == 3)
|
||||
gCurrentPinballGame->unk294 = 2;
|
||||
if (gCurrentPinballGame->ballRespawnState == 3)
|
||||
gCurrentPinballGame->boardModeType = 2;
|
||||
|
||||
gCurrentPinballGame->unk388 = 0;
|
||||
gCurrentPinballGame->ballRespawnState = 0;
|
||||
spriteGroup->available = FALSE;
|
||||
gCurrentPinballGame->unk1F = 0;
|
||||
DmaCopy16(3, &gUnknown_08137E14[gCurrentPinballGame->ballUpgradeType], (void *)PLTT + 0x220, 0x20);
|
||||
gCurrentPinballGame->ballFrozenState = 0;
|
||||
DmaCopy16(3, &gBallPalettes[gCurrentPinballGame->ballUpgradeType], (void *)PLTT + 0x220, 0x20);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk392 == 0)
|
||||
if (gCurrentPinballGame->ballRespawnTimer == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1F = 1;
|
||||
unk1334_0->velocity.x = 0;
|
||||
unk1334_0->velocity.y = 0;
|
||||
unk1334_0->unk6 = 0;
|
||||
gCurrentPinballGame->ballFrozenState = 1;
|
||||
primaryBall->velocity.x = 0;
|
||||
primaryBall->velocity.y = 0;
|
||||
primaryBall->spinSpeed = 0;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk392 == 5)
|
||||
if (gCurrentPinballGame->ballRespawnTimer == 5)
|
||||
spriteGroup->available = TRUE;
|
||||
|
||||
if (gCurrentPinballGame->unk392 > 4)
|
||||
if (gCurrentPinballGame->ballRespawnTimer > 4)
|
||||
{
|
||||
r5 = ((gCurrentPinballGame->unk392 - 5) % 63 / 7);
|
||||
DmaCopy16(3, &gUnknown_083BDF6C[r5], (void *)VRAM + 0x10720, 0x200);
|
||||
unk1334_0->unk6 -= 20;
|
||||
r5 = ((gCurrentPinballGame->ballRespawnTimer - 5) % 63 / 7);
|
||||
DmaCopy16(3, &gBallSpawnGlowTiles_Type2[r5], (void *)VRAM + 0x10720, 0x200);
|
||||
primaryBall->spinSpeed -= 20;
|
||||
}
|
||||
|
||||
if ((gMain.modeChangeFlags & ~MODE_CHANGE_BONUS_BANNER) == 0)
|
||||
gCurrentPinballGame->unk392++;
|
||||
gCurrentPinballGame->ballRespawnTimer++;
|
||||
|
||||
if (gCurrentPinballGame->unk392 == 23)
|
||||
if (gCurrentPinballGame->ballRespawnTimer == 23)
|
||||
m4aSongNumStart(SE_UNKNOWN_0xF9);
|
||||
|
||||
if (gCurrentPinballGame->unk392 == 20)
|
||||
unk1334_0->unk0 = 1;
|
||||
if (gCurrentPinballGame->ballRespawnTimer == 20)
|
||||
primaryBall->ballHidden = 1;
|
||||
|
||||
if (gCurrentPinballGame->unk392 > 67)
|
||||
if (gCurrentPinballGame->ballRespawnTimer > 67)
|
||||
{
|
||||
gCurrentPinballGame->unk388 = 0;
|
||||
gCurrentPinballGame->ballRespawnState = 0;
|
||||
spriteGroup->available = FALSE;
|
||||
DmaCopy16(3, &gUnknown_08137E14[gCurrentPinballGame->ballUpgradeType], (void *)PLTT + 0x220, 0x20);
|
||||
DmaCopy16(3, &gBallPalettes[gCurrentPinballGame->ballUpgradeType], (void *)PLTT + 0x220, 0x20);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk5F7 == 0 && gCurrentPinballGame->ballUpgradeCounter != 0)
|
||||
if (gCurrentPinballGame->ballUpgradeTimerFrozen == 0 && gCurrentPinballGame->ballUpgradeCounter != 0)
|
||||
{
|
||||
gCurrentPinballGame->ballUpgradeCounter--;
|
||||
if (gCurrentPinballGame->ballUpgradeCounter == 0)
|
||||
|
|
@ -411,7 +411,7 @@ void BonusBoardProcess_7B_12BF8()
|
|||
gCurrentPinballGame->ballUpgradeCounter = 60 * 60;
|
||||
}
|
||||
}
|
||||
DmaCopy16(3, &gUnknown_08137E14[gCurrentPinballGame->ballUpgradeType], (void *)PLTT + 0x220, 0x20);
|
||||
DmaCopy16(3, &gBallPalettes[gCurrentPinballGame->ballUpgradeType], (void *)PLTT + 0x220, 0x20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -420,43 +420,43 @@ void BonusBoardProcess_7B_12BF8()
|
|||
case FIELD_KYOGRE:
|
||||
case FIELD_GROUDON:
|
||||
case FIELD_RAYQUAZA:
|
||||
if (gCurrentPinballGame->unk71)
|
||||
if (gCurrentPinballGame->ballTrailEnabled)
|
||||
{
|
||||
for (i = 4; i > 0; i--)
|
||||
{
|
||||
gCurrentPinballGame->unkD0[i].x = gCurrentPinballGame->unkD0[i - 1].x;
|
||||
gCurrentPinballGame->unkD0[i].y = gCurrentPinballGame->unkD0[i - 1].y;
|
||||
gCurrentPinballGame->ballTrailPosition[i].x = gCurrentPinballGame->ballTrailPosition[i - 1].x;
|
||||
gCurrentPinballGame->ballTrailPosition[i].y = gCurrentPinballGame->ballTrailPosition[i - 1].y;
|
||||
}
|
||||
gCurrentPinballGame->unkD0[0].x = unk1334_0->positionQ0.x - 7;
|
||||
gCurrentPinballGame->unkD0[0].y = unk1334_0->positionQ0.y - 7;
|
||||
gCurrentPinballGame->ballTrailPosition[0].x = primaryBall->positionQ0.x - 7;
|
||||
gCurrentPinballGame->ballTrailPosition[0].y = primaryBall->positionQ0.y - 7;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
spriteGroup = gMain.unk44[i + 6];
|
||||
spriteGroup = gMain.fieldSpriteGroups[i + 6];
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
oam = &spriteGroup->oam[0];
|
||||
oamData = &gOamBuffer[oam->oamId];
|
||||
oamData->priority = unk1334_0->oamPriority;
|
||||
oamData->priority = primaryBall->oamPriority;
|
||||
oamData->x = oam->xOffset
|
||||
+ (gCurrentPinballGame->unkD0[(i + 1) * 2].x
|
||||
- gCurrentPinballGame->unk4C);
|
||||
+ (gCurrentPinballGame->ballTrailPosition[(i + 1) * 2].x
|
||||
- gCurrentPinballGame->cameraBaseX);
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
oamData->y = oam->yOffset
|
||||
+ (gCurrentPinballGame->unkD0[2].y
|
||||
- gCurrentPinballGame->unk4E
|
||||
- gCurrentPinballGame->unkE6);
|
||||
+ (gCurrentPinballGame->ballTrailPosition[2].y
|
||||
- gCurrentPinballGame->cameraBaseY
|
||||
- gCurrentPinballGame->cameraYAdjust);
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
if ((gMain.systemFrameCount & i) == 0)
|
||||
{
|
||||
oamData->y = oam->yOffset
|
||||
+ (gCurrentPinballGame->unkD0[4].y
|
||||
- gCurrentPinballGame->unk4E
|
||||
- gCurrentPinballGame->unkE6);
|
||||
+ (gCurrentPinballGame->ballTrailPosition[4].y
|
||||
- gCurrentPinballGame->cameraBaseY
|
||||
- gCurrentPinballGame->cameraYAdjust);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -465,26 +465,26 @@ void BonusBoardProcess_7B_12BF8()
|
|||
}
|
||||
}
|
||||
}
|
||||
gMain.unk44[6]->available = TRUE;
|
||||
gMain.unk44[7]->available = TRUE;
|
||||
gMain.fieldSpriteGroups[6]->available = TRUE;
|
||||
gMain.fieldSpriteGroups[7]->available = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
spriteGroup = gMain.unk44[i + 6];
|
||||
spriteGroup = gMain.fieldSpriteGroups[i + 6];
|
||||
if (spriteGroup->available)
|
||||
{
|
||||
oam = &spriteGroup->oam[0];
|
||||
oamData = &gOamBuffer[oam->oamId];
|
||||
oamData->priority = unk1334_0->oamPriority;
|
||||
oamData->priority = primaryBall->oamPriority;
|
||||
oamData->x = oam->xOffset
|
||||
+ (gCurrentPinballGame->unkD0[(i + 1) * 2].x - gCurrentPinballGame->unk4C);
|
||||
+ (gCurrentPinballGame->ballTrailPosition[(i + 1) * 2].x - gCurrentPinballGame->cameraBaseX);
|
||||
oamData->y = 200;
|
||||
}
|
||||
}
|
||||
gMain.unk44[6]->available = FALSE;
|
||||
gMain.unk44[7]->available = FALSE;
|
||||
gMain.fieldSpriteGroups[6]->available = FALSE;
|
||||
gMain.fieldSpriteGroups[7]->available = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
#include "main.h"
|
||||
#include "constants/bg_music.h"
|
||||
|
||||
extern const u8 gUnknown_086B0884[];
|
||||
extern const u8 gUnknown_081C0064[];
|
||||
extern const u8 gUnknown_086B08A4[];
|
||||
extern const u8 gTimerWarningPalette_Fast[];
|
||||
extern const u8 gDefaultBallPalette[];
|
||||
extern const u8 gTimerWarningPalette_Slow[];
|
||||
|
||||
void AllBoardProcess_8A_4CEA8(void)
|
||||
{
|
||||
|
|
@ -18,7 +18,7 @@ void AllBoardProcess_8B_4CEB4(void)
|
|||
s16 sp0[12];
|
||||
u32 value;
|
||||
|
||||
sub_4D3D0();
|
||||
ProcessEventTimer();
|
||||
gCurrentPinballGame->scoreAdditionAccumulator += (gCurrentPinballGame->ballUpgradeType + 1) * gCurrentPinballGame->scoreAddedInFrame;
|
||||
if (gCurrentPinballGame->scoreCounterAnimationEnabled)
|
||||
{
|
||||
|
|
@ -97,8 +97,8 @@ void AllBoardProcess_8B_4CEB4(void)
|
|||
}
|
||||
for (j = i; j < 12; j++)
|
||||
{
|
||||
gUnknown_03005C00[0x7C1 + (j - i)] = sp0[j] * 2 - 0x3EA0;
|
||||
gUnknown_03005C00[0x7E1 + (j - i)] = sp0[j] * 2 - 0x3E9F;
|
||||
gBG0TilemapBuffer[0x7C1 + (j - i)] = sp0[j] * 2 - 0x3EA0;
|
||||
gBG0TilemapBuffer[0x7E1 + (j - i)] = sp0[j] * 2 - 0x3E9F;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->caughtMonCount > 999)
|
||||
|
|
@ -106,71 +106,71 @@ void AllBoardProcess_8B_4CEB4(void)
|
|||
sp0[2] = gCurrentPinballGame->caughtMonCount / 100;
|
||||
sp0[1] = (gCurrentPinballGame->caughtMonCount % 100) / 10;
|
||||
sp0[0] = gCurrentPinballGame->caughtMonCount % 10;
|
||||
gUnknown_03005C00[0x7D1] = 0xC17E;
|
||||
gUnknown_03005C00[0x7F1] = 0xC17F;
|
||||
gUnknown_03005C00[0x7D2] = (sp0[2] + 5) * 2 - 0x3EA0;
|
||||
gUnknown_03005C00[0x7F2] = (sp0[2] + 5) * 2 - 0x3E9F;
|
||||
gUnknown_03005C00[0x7D3] = (sp0[1] + 5) * 2 - 0x3EA0;
|
||||
gUnknown_03005C00[0x7F3] = (sp0[1] + 5) * 2 - 0x3E9F;
|
||||
gUnknown_03005C00[0x7D4] = (sp0[0] + 5) * 2 - 0x3EA0;
|
||||
gUnknown_03005C00[0x7F4] = (sp0[0] + 5) * 2 - 0x3E9F;
|
||||
gBG0TilemapBuffer[0x7D1] = 0xC17E;
|
||||
gBG0TilemapBuffer[0x7F1] = 0xC17F;
|
||||
gBG0TilemapBuffer[0x7D2] = (sp0[2] + 5) * 2 - 0x3EA0;
|
||||
gBG0TilemapBuffer[0x7F2] = (sp0[2] + 5) * 2 - 0x3E9F;
|
||||
gBG0TilemapBuffer[0x7D3] = (sp0[1] + 5) * 2 - 0x3EA0;
|
||||
gBG0TilemapBuffer[0x7F3] = (sp0[1] + 5) * 2 - 0x3E9F;
|
||||
gBG0TilemapBuffer[0x7D4] = (sp0[0] + 5) * 2 - 0x3EA0;
|
||||
gBG0TilemapBuffer[0x7F4] = (sp0[0] + 5) * 2 - 0x3E9F;
|
||||
|
||||
if (gCurrentPinballGame->coins > 99)
|
||||
gCurrentPinballGame->coins = 99;
|
||||
sp0[1] = gCurrentPinballGame->coins / 10;
|
||||
sp0[0] = gCurrentPinballGame->coins % 10;
|
||||
gUnknown_03005C00[0x7D6] = 0xC19C;
|
||||
gUnknown_03005C00[0x7F6] = 0xC19D;
|
||||
gUnknown_03005C00[0x7D7] = (sp0[1] + 5) * 2 - 0x3EA0;
|
||||
gUnknown_03005C00[0x7F7] = (sp0[1] + 5) * 2 - 0x3E9F;
|
||||
gUnknown_03005C00[0x7D8] = (sp0[0] + 5) * 2 - 0x3EA0;
|
||||
gUnknown_03005C00[0x7F8] = (sp0[0] + 5) * 2 - 0x3E9F;
|
||||
gBG0TilemapBuffer[0x7D6] = 0xC19C;
|
||||
gBG0TilemapBuffer[0x7F6] = 0xC19D;
|
||||
gBG0TilemapBuffer[0x7D7] = (sp0[1] + 5) * 2 - 0x3EA0;
|
||||
gBG0TilemapBuffer[0x7F7] = (sp0[1] + 5) * 2 - 0x3E9F;
|
||||
gBG0TilemapBuffer[0x7D8] = (sp0[0] + 5) * 2 - 0x3EA0;
|
||||
gBG0TilemapBuffer[0x7F8] = (sp0[0] + 5) * 2 - 0x3E9F;
|
||||
|
||||
if (gCurrentPinballGame->numLives > 9)
|
||||
gCurrentPinballGame->numLives = 9;
|
||||
gUnknown_03005C00[0x7DA] = 0xC180;
|
||||
gUnknown_03005C00[0x7FA] = 0xC181;
|
||||
gUnknown_03005C00[0x7DB] = (gCurrentPinballGame->numLives + 5) * 2 - 0x3EA0;
|
||||
gUnknown_03005C00[0x7FB] = (gCurrentPinballGame->numLives + 5) * 2 - 0x3E9F;
|
||||
gBG0TilemapBuffer[0x7DA] = 0xC180;
|
||||
gBG0TilemapBuffer[0x7FA] = 0xC181;
|
||||
gBG0TilemapBuffer[0x7DB] = (gCurrentPinballGame->numLives + 5) * 2 - 0x3EA0;
|
||||
gBG0TilemapBuffer[0x7FB] = (gCurrentPinballGame->numLives + 5) * 2 - 0x3E9F;
|
||||
|
||||
if (gCurrentPinballGame->unk1CA == 13)
|
||||
if (gCurrentPinballGame->catchCounterValue == 13)
|
||||
{
|
||||
if (gCurrentPinballGame->unk1DC & 0x8)
|
||||
if (gCurrentPinballGame->catchCounterBlinkTimer & 0x8)
|
||||
{
|
||||
gUnknown_03005C00[0x7DD] = 0xC19A;
|
||||
gUnknown_03005C00[0x7FD] = 0xC19B;
|
||||
gBG0TilemapBuffer[0x7DD] = 0xC19A;
|
||||
gBG0TilemapBuffer[0x7FD] = 0xC19B;
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_03005C00[0x7DD] = 0xC182;
|
||||
gUnknown_03005C00[0x7FD] = 0xC183;
|
||||
gBG0TilemapBuffer[0x7DD] = 0xC182;
|
||||
gBG0TilemapBuffer[0x7FD] = 0xC183;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk1DC)
|
||||
gCurrentPinballGame->unk1DC--;
|
||||
if (gCurrentPinballGame->catchCounterBlinkTimer)
|
||||
gCurrentPinballGame->catchCounterBlinkTimer--;
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_03005C00[0x7DD] = 0xC19E;
|
||||
gUnknown_03005C00[0x7FD] = 0xC19F;
|
||||
gBG0TilemapBuffer[0x7DD] = 0xC19E;
|
||||
gBG0TilemapBuffer[0x7FD] = 0xC19F;
|
||||
}
|
||||
|
||||
DmaCopy16(3, &gUnknown_03005C00[0x7C0], (void *)0x06002F80, 0x80);
|
||||
DmaCopy16(3, &gBG0TilemapBuffer[0x7C0], (void *)0x06002F80, 0x80);
|
||||
}
|
||||
|
||||
void sub_4D3D0(void)
|
||||
void ProcessEventTimer(void)
|
||||
{
|
||||
s16 i;
|
||||
s16 sp0[4];
|
||||
s16 var2;
|
||||
|
||||
if (gCurrentPinballGame->unk294 == 0)
|
||||
if (gCurrentPinballGame->boardModeType == 0)
|
||||
return;
|
||||
|
||||
if (gCurrentPinballGame->eventTimer == 0)
|
||||
return;
|
||||
|
||||
if (gCurrentPinballGame->unk294 == 2 && gMain.modeChangeFlags == MODE_CHANGE_NONE)
|
||||
if (gCurrentPinballGame->boardModeType == 2 && gMain.modeChangeFlags == MODE_CHANGE_NONE)
|
||||
gCurrentPinballGame->eventTimer--;
|
||||
|
||||
sp0[0] = gCurrentPinballGame->eventTimer / 3600;
|
||||
|
|
@ -179,44 +179,44 @@ void sub_4D3D0(void)
|
|||
sp0[2] = var2 / 600;
|
||||
var2 %= 600;
|
||||
sp0[3] = var2 / 60;
|
||||
if (gCurrentPinballGame->unk294 == 3)
|
||||
if (gCurrentPinballGame->boardModeType == 3)
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gUnknown_03005C00[0x179 + i] = 0x1FF;
|
||||
gUnknown_03005C00[0x199 + i] = 0x1FF;
|
||||
gBG0TilemapBuffer[0x179 + i] = 0x1FF;
|
||||
gBG0TilemapBuffer[0x199 + i] = 0x1FF;
|
||||
}
|
||||
|
||||
DmaCopy16(3, &gUnknown_03005C00[0x160], (void *)0x060022C0, 0x80);
|
||||
gCurrentPinballGame->unk294 = 0;
|
||||
DmaCopy16(3, &gBG0TilemapBuffer[0x160], (void *)0x060022C0, 0x80);
|
||||
gCurrentPinballGame->boardModeType = 0;
|
||||
gCurrentPinballGame->eventTimer = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->eventTimer == 0)
|
||||
{
|
||||
sub_4D648();
|
||||
ResetEventState();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gUnknown_03005C00[i + 0x179] = sp0[i] * 2 - 0x3EC0;
|
||||
gUnknown_03005C00[i + 0x199] = sp0[i] * 2 - 0x3EBF;
|
||||
gBG0TilemapBuffer[i + 0x179] = sp0[i] * 2 - 0x3EC0;
|
||||
gBG0TilemapBuffer[i + 0x199] = sp0[i] * 2 - 0x3EBF;
|
||||
}
|
||||
}
|
||||
DmaCopy16(3, &gUnknown_03005C00[0x160], (void *)0x060022C0, 0x80);
|
||||
DmaCopy16(3, &gBG0TilemapBuffer[0x160], (void *)0x060022C0, 0x80);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->eventTimer <= 900)
|
||||
{
|
||||
if (gCurrentPinballGame->eventTimer & 0x8)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_086B0884, (void *)0x05000180, 0x20);
|
||||
DmaCopy16(3, gTimerWarningPalette_Fast, (void *)0x05000180, 0x20);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_081C0064, (void *)0x05000180, 0x20);
|
||||
DmaCopy16(3, gDefaultBallPalette, (void *)0x05000180, 0x20);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->eventTimer == 900)
|
||||
|
|
@ -226,26 +226,26 @@ void sub_4D3D0(void)
|
|||
{
|
||||
if ((gCurrentPinballGame->eventTimer % 22) / 11)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_086B08A4, (void *)0x05000180, 0x20);
|
||||
DmaCopy16(3, gTimerWarningPalette_Slow, (void *)0x05000180, 0x20);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_081C0064, (void *)0x05000180, 0x20);
|
||||
DmaCopy16(3, gDefaultBallPalette, (void *)0x05000180, 0x20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_4D648(void)
|
||||
void ResetEventState(void)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
gCurrentPinballGame->unk294 = 0;
|
||||
gCurrentPinballGame->boardModeType = 0;
|
||||
gCurrentPinballGame->eventTimer = 0;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gUnknown_03005C00[0x179 + i] = 0x1FF;
|
||||
gUnknown_03005C00[0x199 + i] = 0x1FF;
|
||||
gBG0TilemapBuffer[0x179 + i] = 0x1FF;
|
||||
gBG0TilemapBuffer[0x199 + i] = 0x1FF;
|
||||
}
|
||||
|
||||
DmaCopy16(3, &gUnknown_03005C00[0x160], (void *)0x060022C0, 0x80);
|
||||
DmaCopy16(3, &gBG0TilemapBuffer[0x160], (void *)0x060022C0, 0x80);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,21 +22,21 @@ enum BonusFieldSelection
|
|||
FIELD_SELECT_RAYQUAZA,
|
||||
};
|
||||
|
||||
EWRAM_DATA s8 gUnknown_0201A4B0 = 0;
|
||||
EWRAM_DATA u8 gUnknown_0201A4C0 = 0;
|
||||
EWRAM_DATA s16 gUnknown_0201A4F4 = 0;
|
||||
EWRAM_DATA s8 gBallSpeedSubmenuVisible = 0;
|
||||
EWRAM_DATA u8 gSelectedBallSpeed = 0;
|
||||
EWRAM_DATA s16 gBallSpeedDisplayToggle = 0;
|
||||
EWRAM_DATA s8 gSelectedBonusField = 0;
|
||||
EWRAM_DATA s16 gBonusFieldSelectTimer = 0;
|
||||
EWRAM_DATA s16 gUnknown_0202BE1C = 0;
|
||||
EWRAM_DATA s16 gBonusFieldLoadingCounter = 0;
|
||||
EWRAM_DATA s8 gBonusFieldSelectState = BONUS_FIELD_SELECT_STATE_CHOOSE_FIELD;
|
||||
EWRAM_DATA s8 gBonusFieldSelectNextMainState = STATE_INTRO;
|
||||
EWRAM_DATA u8 gUnknown_0202BEE8 = 0;
|
||||
EWRAM_DATA u8 gBonusFieldHighlightPalette = 0;
|
||||
|
||||
extern void (*const gBonusFieldSelectStateFuncs[])(void);
|
||||
|
||||
extern const struct SpriteSet *const gUnknown_086A4C80[16];
|
||||
extern const struct VectorU16 gUnknown_086A4CC0[];
|
||||
extern const struct VectorU16 gUnknown_086A4CD8[];
|
||||
extern const struct SpriteSet *const gBonusFieldSelectSpriteSets[16];
|
||||
extern const struct VectorU16 gBonusFieldStageIconPositions[];
|
||||
extern const struct VectorU16 gBonusFieldSpeedIndicatorPositions[];
|
||||
extern const u8 gBonusFieldMenuSelectionToField[];
|
||||
|
||||
extern const u8 gBonusFieldSelectBg0_Tilemap[];
|
||||
|
|
@ -45,8 +45,8 @@ extern const u8 gBonusFieldSelectBg2_Tilemap[];
|
|||
extern const u16 gBonusFieldSelectStages_Pals[];
|
||||
extern const u8 gBonusFieldSelectStages_Gfx[];
|
||||
|
||||
void sub_2710(void);
|
||||
void sub_29C8(void);
|
||||
void InitBonusFieldSelectState(void);
|
||||
void RenderBonusFieldSelectSprites(void);
|
||||
|
||||
void BonusFieldSelectMain(void)
|
||||
{
|
||||
|
|
@ -55,7 +55,7 @@ void BonusFieldSelectMain(void)
|
|||
|
||||
void LoadBonusFieldSelectGraphics(void)
|
||||
{
|
||||
ResetSomeGraphicsRelatedStuff();
|
||||
ResetDisplayState();
|
||||
|
||||
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_FORCED_BLANK | DISPCNT_OBJ_ON;
|
||||
REG_BG0CNT = BGCNT_CHARBASE(1) | BGCNT_SCREENBASE(0) | BGCNT_PRIORITY(1) | BGCNT_TXT256x256;
|
||||
|
|
@ -76,30 +76,30 @@ void LoadBonusFieldSelectGraphics(void)
|
|||
DmaCopy16(3, gFieldSelectSpritePals, (void *)(PLTT + 0x200), 0x60);
|
||||
DmaCopy16(3, gFieldSelectSpriteGfx, (void *)(VRAM + 0x10000), 0x4020);
|
||||
|
||||
sub_0CBC();
|
||||
sub_2710();
|
||||
sub_FD5C(sub_29C8);
|
||||
EnableVBlankInterrupts();
|
||||
InitBonusFieldSelectState();
|
||||
FadeInFromWhite(RenderBonusFieldSelectSprites);
|
||||
m4aSongNumStart(MUS_TABLE_SELECT);
|
||||
|
||||
gMain.subState++;
|
||||
}
|
||||
|
||||
void sub_2710(void)
|
||||
void InitBonusFieldSelectState(void)
|
||||
{
|
||||
gSelectedBonusField = FIELD_SELECT_DUSCLOPS;
|
||||
gBonusFieldSelectState = BONUS_FIELD_SELECT_STATE_CHOOSE_FIELD;
|
||||
gBonusFieldSelectTimer = 0;
|
||||
gUnknown_0202BE1C = 0;
|
||||
gUnknown_0202BEE8 = 0;
|
||||
gUnknown_0201A4F4 = 0;
|
||||
gUnknown_0201A4B0 = 0;
|
||||
gBonusFieldLoadingCounter = 0;
|
||||
gBonusFieldHighlightPalette = 0;
|
||||
gBallSpeedDisplayToggle = 0;
|
||||
gBallSpeedSubmenuVisible = 0;
|
||||
gBonusFieldSelectNextMainState = STATE_INTRO;
|
||||
gUnknown_0201A4C0 = gMain_saveData.ballSpeed;
|
||||
gSelectedBallSpeed = gMain_saveData.ballSpeed;
|
||||
}
|
||||
|
||||
void BonusFieldSelect_State1_2768(void)
|
||||
{
|
||||
sub_29C8();
|
||||
RenderBonusFieldSelectSprites();
|
||||
switch (gBonusFieldSelectState)
|
||||
{
|
||||
case BONUS_FIELD_SELECT_STATE_CHOOSE_FIELD:
|
||||
|
|
@ -139,7 +139,7 @@ void BonusFieldSelect_State1_2768(void)
|
|||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gBonusFieldSelectState = BONUS_FIELD_SELECT_STATE_BALL_SPEED;
|
||||
gUnknown_0201A4B0 = 1;
|
||||
gBallSpeedSubmenuVisible = 1;
|
||||
gBonusFieldSelectTimer = 0;
|
||||
}
|
||||
if (JOY_NEW(B_BUTTON))
|
||||
|
|
@ -153,28 +153,28 @@ void BonusFieldSelect_State1_2768(void)
|
|||
if (JOY_NEW(DPAD_LEFT | DPAD_RIGHT))
|
||||
{
|
||||
m4aSongNumStart(SE_MENU_MOVE);
|
||||
gUnknown_0201A4C0 = 1 - gUnknown_0201A4C0;
|
||||
gSelectedBallSpeed = 1 - gSelectedBallSpeed;
|
||||
}
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gBonusFieldSelectTimer = 0;
|
||||
gUnknown_0202BE1C = 0;
|
||||
gMain.saveData.ballSpeed = gUnknown_0201A4C0;
|
||||
gBonusFieldLoadingCounter = 0;
|
||||
gMain.saveData.ballSpeed = gSelectedBallSpeed;
|
||||
SaveFile_WriteToSram();
|
||||
gBonusFieldSelectState = BONUS_FIELD_SELECT_STATE_LOAD_FIELD;
|
||||
}
|
||||
if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
m4aSongNumStart(SE_MENU_CANCEL);
|
||||
gUnknown_0201A4B0 = 0;
|
||||
gBallSpeedSubmenuVisible = 0;
|
||||
gBonusFieldSelectState = BONUS_FIELD_SELECT_STATE_CHOOSE_FIELD;
|
||||
}
|
||||
gBonusFieldSelectTimer++;
|
||||
if (gBonusFieldSelectTimer > 4)
|
||||
{
|
||||
gBonusFieldSelectTimer = 0;
|
||||
gUnknown_0201A4F4 = 1 - gUnknown_0201A4F4;
|
||||
gBallSpeedDisplayToggle = 1 - gBallSpeedDisplayToggle;
|
||||
}
|
||||
break;
|
||||
case BONUS_FIELD_SELECT_STATE_LOAD_FIELD:
|
||||
|
|
@ -182,13 +182,13 @@ void BonusFieldSelect_State1_2768(void)
|
|||
if (gBonusFieldSelectTimer > 5)
|
||||
{
|
||||
gBonusFieldSelectTimer = 0;
|
||||
gUnknown_0202BEE8 = 2 - gUnknown_0202BEE8;
|
||||
gUnknown_0202BE1C++;
|
||||
if (gUnknown_0202BE1C > 5)
|
||||
gBonusFieldHighlightPalette = 2 - gBonusFieldHighlightPalette;
|
||||
gBonusFieldLoadingCounter++;
|
||||
if (gBonusFieldLoadingCounter > 5)
|
||||
{
|
||||
gMain.unkD = 0;
|
||||
gMain.unk5 = gMain.selectedField = gBonusFieldMenuSelectionToField[gSelectedBonusField];
|
||||
gMain.unk6 = 1;
|
||||
gMain.continueFromSave = 0;
|
||||
gMain.tempField = gMain.selectedField = gBonusFieldMenuSelectionToField[gSelectedBonusField];
|
||||
gMain.isBonusField = 1;
|
||||
gBonusFieldSelectNextMainState = STATE_GAME_MAIN;
|
||||
gMain.subState++;
|
||||
}
|
||||
|
|
@ -199,14 +199,14 @@ void BonusFieldSelect_State1_2768(void)
|
|||
|
||||
void BonusFieldSelect_State2_2990(void)
|
||||
{
|
||||
sub_FE04(sub_29C8);
|
||||
FadeOutToWhite(RenderBonusFieldSelectSprites);
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
gAutoDisplayTitlescreenMenu = TRUE;
|
||||
SetMainGameState(gBonusFieldSelectNextMainState);
|
||||
}
|
||||
|
||||
void sub_29C8(void)
|
||||
void RenderBonusFieldSelectSprites(void)
|
||||
{
|
||||
struct SpriteGroup * sgptrs[6];
|
||||
struct SpriteGroup * r8;
|
||||
|
|
@ -224,21 +224,21 @@ void sub_29C8(void)
|
|||
sgptrs[i] = &gMain.spriteGroups[i];
|
||||
}
|
||||
r10 = &gMain.spriteGroups[6 + gSelectedBonusField];
|
||||
r8 = &gMain.spriteGroups[12 + gUnknown_0201A4C0 * 2 + gUnknown_0201A4F4];
|
||||
r8 = &gMain.spriteGroups[12 + gSelectedBallSpeed * 2 + gBallSpeedDisplayToggle];
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
sgptrs[j]->available = TRUE;
|
||||
}
|
||||
sgptrs[gSelectedBonusField]->available = FALSE;
|
||||
r10->available = TRUE;
|
||||
r8->available = gUnknown_0201A4B0;
|
||||
LoadSpriteSets(gUnknown_086A4C80, 16, gMain_spriteGroups);
|
||||
r8->available = gBallSpeedSubmenuVisible;
|
||||
LoadSpriteSets(gBonusFieldSelectSpriteSets, 16, gMain_spriteGroups);
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
if (sgptrs[i]->available == 1)
|
||||
{
|
||||
sgptrs[i]->baseX = gUnknown_086A4CC0[i].x;
|
||||
sgptrs[i]->baseY = gUnknown_086A4CC0[i].y;
|
||||
sgptrs[i]->baseX = gBonusFieldStageIconPositions[i].x;
|
||||
sgptrs[i]->baseY = gBonusFieldStageIconPositions[i].y;
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
simple = &sgptrs[i]->oam[j];
|
||||
|
|
@ -254,14 +254,14 @@ void sub_29C8(void)
|
|||
{
|
||||
simple = &r10->oam[j];
|
||||
gOamBuffer[simple->oamId].objMode = ST_OAM_OBJ_NORMAL;
|
||||
gOamBuffer[simple->oamId].paletteNum = gUnknown_0202BEE8;
|
||||
gOamBuffer[simple->oamId].paletteNum = gBonusFieldHighlightPalette;
|
||||
gOamBuffer[simple->oamId].x = simple->xOffset + r10->baseX;
|
||||
gOamBuffer[simple->oamId].y = simple->yOffset + r10->baseY;
|
||||
}
|
||||
if (r8->available == 1)
|
||||
{
|
||||
r8->baseX = gUnknown_086A4CD8[gSelectedBonusField].x;
|
||||
r8->baseY = gUnknown_086A4CD8[gSelectedBonusField].y;
|
||||
r8->baseX = gBonusFieldSpeedIndicatorPositions[gSelectedBonusField].x;
|
||||
r8->baseY = gBonusFieldSpeedIndicatorPositions[gSelectedBonusField].y;
|
||||
for (j = 0; j < 5; j++)
|
||||
{
|
||||
simple = &r8->oam[j];
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ void PickSpeciesForCatchEmMode(void)
|
|||
else
|
||||
rand %= 100;
|
||||
|
||||
if (gUnknown_02031520.unk8 < 100)
|
||||
if (gBoardConfig.caughtSpeciesCount < 100)
|
||||
rand = 1;
|
||||
|
||||
if ((rand == 0 && gCurrentPinballGame->caughtMonCount >= 5) || gCurrentPinballGame->forceSpecialMons)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
566
src/debug_menu.c
566
src/debug_menu.c
File diff suppressed because it is too large
Load Diff
534
src/ereader.c
534
src/ereader.c
|
|
@ -9,42 +9,42 @@
|
|||
#include "variables.h"
|
||||
|
||||
extern StateFunc gEReaderStateFuncs[11];
|
||||
extern s8 gUnknown_0202C604;
|
||||
extern s8 gUnknown_0202A580;
|
||||
extern s8 gUnknown_0202C5A4;
|
||||
extern s8 gUnknown_0202AD90;
|
||||
extern s8 gEReaderTextCharIndex;
|
||||
extern s8 gEReaderTextAnimDelay;
|
||||
extern s8 gEReaderTextBlinkToggle;
|
||||
extern s8 gEReaderTextPageIndex;
|
||||
|
||||
extern s8 gUnknown_0202A58C;
|
||||
extern s8 gUnknown_0202C584;
|
||||
extern s8 gUnknown_0202BEC0;
|
||||
extern s8 gUnknown_0201B174;
|
||||
extern s16 gUnknown_0202C5A0;
|
||||
extern s16 gUnknown_0201A44C;
|
||||
extern u8 gUnknown_0200282C;
|
||||
extern u8 gUnknown_0200282D;
|
||||
extern s8 gUnknown_0202BEF8;
|
||||
extern u8 gUnknown_0201B124;
|
||||
extern u32 gUnknown_0202ADD0;
|
||||
extern s16 gUnknown_0202C5F0[];
|
||||
extern u16 gUnknown_0201A4D0[][2];
|
||||
extern u32 gUnknown_0202BDF0;
|
||||
extern u8 gUnknown_0201C1AC;
|
||||
extern u8 gUnknown_0202ADDC;
|
||||
extern s8 gEReaderStatusSpriteIndex;
|
||||
extern s8 gEReaderStatusSpriteVisible;
|
||||
extern s8 gEReaderHeaderSpriteIndex;
|
||||
extern s8 gEReaderTransitionStep;
|
||||
extern s16 gEReaderTransitionTimer;
|
||||
extern s16 gEReaderGeneralTimer;
|
||||
extern u8 gEReaderUnused1;
|
||||
extern u8 gEReaderUnused2;
|
||||
extern s8 gEReaderExitTargetState;
|
||||
extern u8 gLinkExchangeStep;
|
||||
extern u32 gLinkStatusResult;
|
||||
extern s16 gLinkSendBuffer[];
|
||||
extern u16 gLinkRecvBuffer[][2];
|
||||
extern u32 gLinkConnectionState;
|
||||
extern u8 gLinkPlayerCount;
|
||||
extern u8 gLinkNegotiationFlags;
|
||||
extern s16 gEReaderCardIndex;
|
||||
extern s16 gUnknown_0201A444;
|
||||
extern s16 gLinkTimeoutCounter;
|
||||
|
||||
extern s8 gUnknown_086A551A[10];
|
||||
extern s8 gUnknown_086A5528[10];
|
||||
extern u8 gUnknown_086A5536[NUM_EREADER_CARDS + 1];
|
||||
extern s8 gEReaderTextLengths[10];
|
||||
extern s8 gEReaderTextHasNextPage[10];
|
||||
extern u8 gEReaderCardStartPages[NUM_EREADER_CARDS + 1];
|
||||
extern u8 gPokedexSprites_Gfx[];
|
||||
extern u8 gUnknown_08081D20[];
|
||||
extern u8 gUnknown_0807DD00[];
|
||||
extern u8 gUnknown_0807D000[];
|
||||
extern u8 gEReaderBackground_Pals[];
|
||||
extern u8 gEReaderText_Tilemap[];
|
||||
// extern u8 gUnknown_0807D000[]; // dead declaration, never referenced
|
||||
extern u8 gPokedexSprites_Pals[];
|
||||
extern u16 gUnknown_03000000[];
|
||||
extern u16 gTempGfxBuffer[];
|
||||
extern u8 gEReaderBackground_Gfx[];
|
||||
extern u8 gUnknown_0807FD00[];
|
||||
extern s16 gUnknown_086A550C[];
|
||||
extern u8 gEReaderOverlay_Tilemap[];
|
||||
extern s16 gEReaderTransitionStepDurations[];
|
||||
|
||||
enum EReaderState{
|
||||
EREADER_STATE_0_LOAD_GRAPHICS = 0,
|
||||
|
|
@ -65,7 +65,7 @@ void EReaderMain(void)
|
|||
|
||||
void LoadEReaderGraphics(void)
|
||||
{
|
||||
ResetSomeGraphicsRelatedStuff();
|
||||
ResetDisplayState();
|
||||
REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_FORCED_BLANK;
|
||||
REG_BG0CNT = BGCNT_CHARBASE(1);
|
||||
REG_DISPCNT |= DISPCNT_BG0_ON;
|
||||
|
|
@ -76,109 +76,109 @@ void LoadEReaderGraphics(void)
|
|||
gMain.bgOffsets[0].yOffset = (0xffe8 - 0x48);
|
||||
gMain.dispcntBackup = REG_DISPCNT;
|
||||
|
||||
DmaCopy16(3, gUnknown_08081D20, (void*) PLTT, 0x40);
|
||||
DmaCopy16(3, gEReaderBackground_Pals, (void*) PLTT, 0x40);
|
||||
DmaCopy16(3, gPokedexBackground_Pals + 0x80, (void*) PLTT + 0x40, 0x20);
|
||||
DmaCopy16(3, gEReaderBackground_Gfx, gUnknown_03000000, 0x3000);
|
||||
DmaCopy16(3, gUnknown_0807DD00, (void *)BG_SCREEN_ADDR(0), BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gUnknown_0807FD00, (void *)BG_SCREEN_ADDR(1), BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gEReaderBackground_Gfx, gTempGfxBuffer, 0x3000);
|
||||
DmaCopy16(3, gEReaderText_Tilemap, (void *)BG_SCREEN_ADDR(0), BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gEReaderOverlay_Tilemap, (void *)BG_SCREEN_ADDR(1), BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gPokedexSprites_Pals, (void *)OBJ_PLTT, 0xC0);
|
||||
DmaCopy16(3, gPokedexSprites_Gfx, (void *)OBJ_VRAM0, 0x6C20);
|
||||
|
||||
sub_2DF0();
|
||||
gUnknown_0202C604 = 0;
|
||||
gUnknown_0202A580 = 0;
|
||||
gUnknown_0202C5A4 = 0;
|
||||
gUnknown_0202AD90 = 0;
|
||||
sub_377C();
|
||||
InitEReaderTextState();
|
||||
gEReaderTextCharIndex = 0;
|
||||
gEReaderTextAnimDelay = 0;
|
||||
gEReaderTextBlinkToggle = 0;
|
||||
gEReaderTextPageIndex = 0;
|
||||
ClearEReaderTextRows();
|
||||
|
||||
DmaCopy16(3, gUnknown_03000000, (void *)VRAM + 0x4000, 0x3000);
|
||||
DmaCopy16(3, gTempGfxBuffer, (void *)VRAM + 0x4000, 0x3000);
|
||||
|
||||
sub_394C();
|
||||
UpdateEReaderSprites();
|
||||
m4aSongNumStart(MUS_UNKNOWN_0x5);
|
||||
sub_0CBC();
|
||||
sub_024C();
|
||||
EnableVBlankInterrupts();
|
||||
FadeInScreen();
|
||||
gMain.subState = EREADER_STATE_1;
|
||||
}
|
||||
|
||||
void sub_2DF0(void)
|
||||
void InitEReaderTextState(void)
|
||||
{
|
||||
gUnknown_0202A58C = 0;
|
||||
gUnknown_0202C584 = 0;
|
||||
gUnknown_0202BEC0 = 4;
|
||||
gUnknown_0201B174 = 0;
|
||||
gUnknown_0202C5A0 = 0;
|
||||
gUnknown_0201A44C = 0;
|
||||
gUnknown_0202BEF8 = STATE_INTRO;
|
||||
gUnknown_0200282C = 0;
|
||||
gUnknown_0200282D = 0;
|
||||
gEReaderStatusSpriteIndex = 0;
|
||||
gEReaderStatusSpriteVisible = 0;
|
||||
gEReaderHeaderSpriteIndex = 4;
|
||||
gEReaderTransitionStep = 0;
|
||||
gEReaderTransitionTimer = 0;
|
||||
gEReaderGeneralTimer = 0;
|
||||
gEReaderExitTargetState = STATE_INTRO;
|
||||
gEReaderUnused1 = 0;
|
||||
gEReaderUnused2 = 0;
|
||||
}
|
||||
|
||||
void Ereader_State1_2E40(void)
|
||||
{
|
||||
if (gUnknown_0202C604 <= gUnknown_086A551A[gUnknown_0202AD90]) {
|
||||
gUnknown_0202A580++;
|
||||
if (2 < gUnknown_0202A580) {
|
||||
gUnknown_0202A580 = 0;
|
||||
sub_3828(gUnknown_0202AD90,gUnknown_0202C604);
|
||||
gUnknown_0202C604++;
|
||||
if (gEReaderTextCharIndex <= gEReaderTextLengths[gEReaderTextPageIndex]) {
|
||||
gEReaderTextAnimDelay++;
|
||||
if (2 < gEReaderTextAnimDelay) {
|
||||
gEReaderTextAnimDelay = 0;
|
||||
DrawEReaderTextCharacter(gEReaderTextPageIndex,gEReaderTextCharIndex);
|
||||
gEReaderTextCharIndex++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gUnknown_0202A580++;
|
||||
if (6 < gUnknown_0202A580) {
|
||||
gUnknown_0202A580 = 0;
|
||||
if (gUnknown_0202C5A4 == 0) {
|
||||
sub_38A0(gUnknown_086A551A[gUnknown_0202AD90],0x3a80);
|
||||
gEReaderTextAnimDelay++;
|
||||
if (6 < gEReaderTextAnimDelay) {
|
||||
gEReaderTextAnimDelay = 0;
|
||||
if (gEReaderTextBlinkToggle == 0) {
|
||||
BlinkEReaderTextCursor(gEReaderTextLengths[gEReaderTextPageIndex],0x3a80);
|
||||
}
|
||||
else {
|
||||
sub_38A0(gUnknown_086A551A[gUnknown_0202AD90],0);
|
||||
BlinkEReaderTextCursor(gEReaderTextLengths[gEReaderTextPageIndex],0);
|
||||
}
|
||||
gUnknown_0202C5A4 = 1 - gUnknown_0202C5A4;
|
||||
gEReaderTextBlinkToggle = 1 - gEReaderTextBlinkToggle;
|
||||
}
|
||||
}
|
||||
if (JOY_NEW(A_BUTTON)) {
|
||||
if (gUnknown_0202C604 <= gUnknown_086A551A[gUnknown_0202AD90]) {
|
||||
sub_37B4(gUnknown_0202AD90);
|
||||
gUnknown_0202C604 = gUnknown_086A551A[gUnknown_0202AD90] + 1;
|
||||
if (gEReaderTextCharIndex <= gEReaderTextLengths[gEReaderTextPageIndex]) {
|
||||
DrawEReaderTextPage(gEReaderTextPageIndex);
|
||||
gEReaderTextCharIndex = gEReaderTextLengths[gEReaderTextPageIndex] + 1;
|
||||
}
|
||||
else if (gUnknown_086A5528[gUnknown_0202AD90] == 0) {
|
||||
else if (gEReaderTextHasNextPage[gEReaderTextPageIndex] == 0) {
|
||||
gMain.subState = EREADER_STATE_2;
|
||||
}
|
||||
else {
|
||||
sub_377C();
|
||||
gUnknown_0202C604 = 0;
|
||||
gUnknown_0202A580 = 0;
|
||||
gUnknown_0202C5A4 = 0;
|
||||
gUnknown_0202AD90++;
|
||||
ClearEReaderTextRows();
|
||||
gEReaderTextCharIndex = 0;
|
||||
gEReaderTextAnimDelay = 0;
|
||||
gEReaderTextBlinkToggle = 0;
|
||||
gEReaderTextPageIndex++;
|
||||
}
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON)) {
|
||||
m4aSongNumStart(SE_MENU_CANCEL);
|
||||
gUnknown_0202BEF8 = STATE_TITLE;
|
||||
gEReaderExitTargetState = STATE_TITLE;
|
||||
gMain.subState = EREADER_STATE_8;
|
||||
}
|
||||
sub_394C();
|
||||
DmaCopy16(3, gUnknown_03000000, (void*) VRAM + 0x4000, 0x3000);
|
||||
UpdateEReaderSprites();
|
||||
DmaCopy16(3, gTempGfxBuffer, (void*) VRAM + 0x4000, 0x3000);
|
||||
}
|
||||
|
||||
void Ereader_State2_2FC0(void)
|
||||
{
|
||||
gUnknown_0202C5A0++;
|
||||
if (gUnknown_0202C5A0 > gUnknown_086A550C[gUnknown_0201B174]) {
|
||||
gUnknown_0202C5A0 = 0;
|
||||
gUnknown_0201B174++;
|
||||
if (gUnknown_0201B174 == 6) {
|
||||
sub_19B4();
|
||||
sub_3C1C();
|
||||
gUnknown_0201B124 = 0;
|
||||
gUnknown_0202C584 = 1;
|
||||
gEReaderTransitionTimer++;
|
||||
if (gEReaderTransitionTimer > gEReaderTransitionStepDurations[gEReaderTransitionStep]) {
|
||||
gEReaderTransitionTimer = 0;
|
||||
gEReaderTransitionStep++;
|
||||
if (gEReaderTransitionStep == 6) {
|
||||
InitLinkHardware();
|
||||
InitEReaderLinkBuffers();
|
||||
gLinkExchangeStep = 0;
|
||||
gEReaderStatusSpriteVisible = 1;
|
||||
m4aSongNumStart(SE_TRIGGER_BUTTON_HIT);
|
||||
gMain.subState = EREADER_STATE_3;
|
||||
}
|
||||
}
|
||||
gUnknown_0202A58C = 0;
|
||||
gUnknown_0202BEC0 = gUnknown_0201B174 + 4;
|
||||
sub_3AB4();
|
||||
gEReaderStatusSpriteIndex = 0;
|
||||
gEReaderHeaderSpriteIndex = gEReaderTransitionStep + 4;
|
||||
UpdateEReaderSpritesViaOam();
|
||||
}
|
||||
|
||||
void Ereader_State3_304C(void)
|
||||
|
|
@ -186,22 +186,22 @@ void Ereader_State3_304C(void)
|
|||
s32 index;
|
||||
u16 temp;
|
||||
|
||||
sub_3AB4();
|
||||
UpdateEReaderSpritesViaOam();
|
||||
if (JOY_NEW(B_BUTTON)) {
|
||||
sub_2568();
|
||||
ResetSerialAndInterrupts();
|
||||
DisableSerial();
|
||||
sub_02B4();
|
||||
FadeOutScreen();
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
gMain.subState = 0;
|
||||
}
|
||||
gUnknown_0202ADD0 = LinkMain1(&gUnknown_0202BEC8, gUnknown_0202C5F0, gUnknown_0201A4D0);
|
||||
gUnknown_0202BDF0 = gUnknown_0202ADD0 & 3;
|
||||
gUnknown_0201C1AC = ((gUnknown_0202ADD0 & 0x1c) >> 2);
|
||||
gUnknown_0202ADDC = ((gUnknown_0202ADD0 & 0xe00) >> 9);
|
||||
if (((gUnknown_0202ADD0 & 0x40) != 0) && (gUnknown_0202BDF0 < 2)) {
|
||||
sub_3C78();
|
||||
if (((gUnknown_0202ADD0 & 0x100) == 0) && (sub_3CD8() == -1)) {
|
||||
gLinkStatusResult = LinkMain1(&gLinkAdvanceState, gLinkSendBuffer, gLinkRecvBuffer);
|
||||
gLinkConnectionState = gLinkStatusResult & 3;
|
||||
gLinkPlayerCount = ((gLinkStatusResult & 0x1c) >> 2);
|
||||
gLinkNegotiationFlags = ((gLinkStatusResult & 0xe00) >> 9);
|
||||
if (((gLinkStatusResult & 0x40) != 0) && (gLinkConnectionState < 2)) {
|
||||
PrepareEReaderLinkSendCmd();
|
||||
if (((gLinkStatusResult & 0x100) == 0) && (ProcessEReaderLinkReceive() == -1)) {
|
||||
gEReaderCardIndex = GetEReaderCardIndex();
|
||||
if ((gEReaderCardIndex != -1) && (NUM_EREADER_CARDS > gEReaderCardIndex)) {
|
||||
for(index = 0; index < NUM_EREADER_CARDS; index++)
|
||||
|
|
@ -209,36 +209,36 @@ void Ereader_State3_304C(void)
|
|||
gMain.eReaderBonuses[index] = 0;
|
||||
}
|
||||
gMain.eReaderBonuses[gEReaderCardIndex] = 1;
|
||||
gUnknown_0201A44C = 0;
|
||||
gEReaderGeneralTimer = 0;
|
||||
gMain.subState = EREADER_STATE_5;
|
||||
}
|
||||
else {
|
||||
gUnknown_0201A44C = 0;
|
||||
gUnknown_0202A58C = 2;
|
||||
gUnknown_0202BEC0 = 10;
|
||||
gUnknown_0202C604 = 0;
|
||||
gUnknown_0202C5A4 = 0;
|
||||
gUnknown_0202AD90 = 13;
|
||||
sub_377C();
|
||||
gEReaderGeneralTimer = 0;
|
||||
gEReaderStatusSpriteIndex = 2;
|
||||
gEReaderHeaderSpriteIndex = 10;
|
||||
gEReaderTextCharIndex = 0;
|
||||
gEReaderTextBlinkToggle = 0;
|
||||
gEReaderTextPageIndex = 13;
|
||||
ClearEReaderTextRows();
|
||||
gMain.subState = EREADER_STATE_4;
|
||||
m4aSongNumStart(SE_FAILURE);
|
||||
}
|
||||
}
|
||||
if (gUnknown_0202A58C == 1) {
|
||||
gUnknown_0201A44C++;
|
||||
temp = gUnknown_0201A44C; // TODO: FAKEMATCH
|
||||
if ((gUnknown_0201A44C & 7) == 0) {
|
||||
gUnknown_0202BEC0 = 21 - gUnknown_0202BEC0;
|
||||
if (gEReaderStatusSpriteIndex == 1) {
|
||||
gEReaderGeneralTimer++;
|
||||
temp = gEReaderGeneralTimer; // TODO: FAKEMATCH
|
||||
if ((gEReaderGeneralTimer & 7) == 0) {
|
||||
gEReaderHeaderSpriteIndex = 21 - gEReaderHeaderSpriteIndex;
|
||||
}
|
||||
if (((gUnknown_0202ADD0 & 0x7f0000) != 0) &&
|
||||
(gUnknown_0201A444++, 0xb4 < gUnknown_0201A444)) {
|
||||
gUnknown_0201A44C = 0;
|
||||
gUnknown_0202A58C = 2;
|
||||
gUnknown_0202BEC0 = 10;
|
||||
gUnknown_0202C604 = 0;
|
||||
gUnknown_0202C5A4 = 0;
|
||||
gUnknown_0202AD90 = 13;
|
||||
sub_377C();
|
||||
if (((gLinkStatusResult & 0x7f0000) != 0) &&
|
||||
(gLinkTimeoutCounter++, 0xb4 < gLinkTimeoutCounter)) {
|
||||
gEReaderGeneralTimer = 0;
|
||||
gEReaderStatusSpriteIndex = 2;
|
||||
gEReaderHeaderSpriteIndex = 10;
|
||||
gEReaderTextCharIndex = 0;
|
||||
gEReaderTextBlinkToggle = 0;
|
||||
gEReaderTextPageIndex = 13;
|
||||
ClearEReaderTextRows();
|
||||
gMain.subState = EREADER_STATE_4;
|
||||
m4aSongNumStart(SE_FAILURE);
|
||||
}
|
||||
|
|
@ -248,90 +248,90 @@ void Ereader_State3_304C(void)
|
|||
|
||||
void Ereader_State4_3208(void)
|
||||
{
|
||||
gUnknown_0201A44C++;
|
||||
if (8 < gUnknown_0201A44C) {
|
||||
gUnknown_0201A44C = 0;
|
||||
gUnknown_0202BEC0 = 22 - gUnknown_0202BEC0;
|
||||
gEReaderGeneralTimer++;
|
||||
if (8 < gEReaderGeneralTimer) {
|
||||
gEReaderGeneralTimer = 0;
|
||||
gEReaderHeaderSpriteIndex = 22 - gEReaderHeaderSpriteIndex;
|
||||
}
|
||||
if (gUnknown_0202C604 <= gUnknown_086A551A[gUnknown_0202AD90]) {
|
||||
gUnknown_0202A580++;
|
||||
if (2 < gUnknown_0202A580) {
|
||||
gUnknown_0202A580 = 0;
|
||||
sub_3828(gUnknown_0202AD90,gUnknown_0202C604);
|
||||
gUnknown_0202C604++;
|
||||
if (gEReaderTextCharIndex <= gEReaderTextLengths[gEReaderTextPageIndex]) {
|
||||
gEReaderTextAnimDelay++;
|
||||
if (2 < gEReaderTextAnimDelay) {
|
||||
gEReaderTextAnimDelay = 0;
|
||||
DrawEReaderTextCharacter(gEReaderTextPageIndex,gEReaderTextCharIndex);
|
||||
gEReaderTextCharIndex++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gUnknown_0202A580++;
|
||||
if (6 < gUnknown_0202A580) {
|
||||
gUnknown_0202A580 = 0;
|
||||
if (gUnknown_0202C5A4 == 0) {
|
||||
sub_38A0(gUnknown_086A551A[gUnknown_0202AD90],0x3a80);
|
||||
gEReaderTextAnimDelay++;
|
||||
if (6 < gEReaderTextAnimDelay) {
|
||||
gEReaderTextAnimDelay = 0;
|
||||
if (gEReaderTextBlinkToggle == 0) {
|
||||
BlinkEReaderTextCursor(gEReaderTextLengths[gEReaderTextPageIndex],0x3a80);
|
||||
}
|
||||
else {
|
||||
sub_38A0(gUnknown_086A551A[gUnknown_0202AD90],0);
|
||||
BlinkEReaderTextCursor(gEReaderTextLengths[gEReaderTextPageIndex],0);
|
||||
}
|
||||
gUnknown_0202C5A4 = 1 - gUnknown_0202C5A4;
|
||||
gEReaderTextBlinkToggle = 1 - gEReaderTextBlinkToggle;
|
||||
}
|
||||
}
|
||||
if (JOY_NEW(A_BUTTON)) {
|
||||
if (gUnknown_0202C604 <= gUnknown_086A551A[gUnknown_0202AD90]) {
|
||||
sub_37B4(gUnknown_0202AD90);
|
||||
gUnknown_0202C604 = gUnknown_086A551A[gUnknown_0202AD90] + 1;
|
||||
if (gEReaderTextCharIndex <= gEReaderTextLengths[gEReaderTextPageIndex]) {
|
||||
DrawEReaderTextPage(gEReaderTextPageIndex);
|
||||
gEReaderTextCharIndex = gEReaderTextLengths[gEReaderTextPageIndex] + 1;
|
||||
}
|
||||
else if (gUnknown_086A5528[gUnknown_0202AD90] == 0) {
|
||||
sub_2568();
|
||||
else if (gEReaderTextHasNextPage[gEReaderTextPageIndex] == 0) {
|
||||
ResetSerialAndInterrupts();
|
||||
DisableSerial();
|
||||
sub_02B4();
|
||||
FadeOutScreen();
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
gMain.subState = 0;
|
||||
}
|
||||
else {
|
||||
sub_377C();
|
||||
gUnknown_0202C604 = 0;
|
||||
gUnknown_0202A580 = 0;
|
||||
gUnknown_0202C5A4 = 0;
|
||||
gUnknown_0202AD90++;
|
||||
ClearEReaderTextRows();
|
||||
gEReaderTextCharIndex = 0;
|
||||
gEReaderTextAnimDelay = 0;
|
||||
gEReaderTextBlinkToggle = 0;
|
||||
gEReaderTextPageIndex++;
|
||||
}
|
||||
}
|
||||
sub_394C();
|
||||
DmaCopy16(3, gUnknown_03000000, (void*) VRAM + 0x4000, 0x3000);
|
||||
UpdateEReaderSprites();
|
||||
DmaCopy16(3, gTempGfxBuffer, (void*) VRAM + 0x4000, 0x3000);
|
||||
}
|
||||
|
||||
void Ereader_State5_33A0(void)
|
||||
{
|
||||
u16 temp;
|
||||
sub_3AB4();
|
||||
UpdateEReaderSpritesViaOam();
|
||||
|
||||
switch(gUnknown_0201A44C)
|
||||
switch(gEReaderGeneralTimer)
|
||||
{
|
||||
case 4:
|
||||
sub_2568();
|
||||
ResetSerialAndInterrupts();
|
||||
DisableSerial();
|
||||
break;
|
||||
case 0x96:
|
||||
gUnknown_0202A58C = 3;
|
||||
gEReaderStatusSpriteIndex = 3;
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
break;
|
||||
case 0x10e:
|
||||
gUnknown_0201A44C = 0;
|
||||
sub_02B4();
|
||||
gEReaderGeneralTimer = 0;
|
||||
FadeOutScreen();
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
gMain.subState = EREADER_STATE_6;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((gUnknown_0202A58C == 1) && ((temp = gUnknown_0201A44C, gUnknown_0201A44C & 7) == 0)) {
|
||||
gUnknown_0202BEC0 = 21 - gUnknown_0202BEC0;
|
||||
if ((gEReaderStatusSpriteIndex == 1) && ((temp = gEReaderGeneralTimer, gEReaderGeneralTimer & 7) == 0)) {
|
||||
gEReaderHeaderSpriteIndex = 21 - gEReaderHeaderSpriteIndex;
|
||||
}
|
||||
gUnknown_0201A44C++;
|
||||
gEReaderGeneralTimer++;
|
||||
}
|
||||
|
||||
void Ereader_State6_343C(void)
|
||||
{
|
||||
ResetSomeGraphicsRelatedStuff();
|
||||
ResetDisplayState();
|
||||
REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_FORCED_BLANK;
|
||||
REG_BG0CNT = BGCNT_CHARBASE(1);
|
||||
REG_DISPCNT |= DISPCNT_BG0_ON;
|
||||
|
|
@ -342,89 +342,89 @@ void Ereader_State6_343C(void)
|
|||
gMain.bgOffsets[0].yOffset = (0xffe8 - 0x48);
|
||||
gMain.dispcntBackup = REG_DISPCNT;
|
||||
|
||||
DmaCopy16(3, gUnknown_08081D20, (void*) PLTT, 0x40);
|
||||
DmaCopy16(3, gEReaderBackground_Pals, (void*) PLTT, 0x40);
|
||||
DmaCopy16(3, gPokedexBackground_Pals + 0x80, (void*) PLTT + 0x40, 0x20);
|
||||
DmaCopy16(3, gEReaderBackground_Gfx, gUnknown_03000000, 0x3000);
|
||||
DmaCopy16(3, gUnknown_0807DD00, (void *)BG_SCREEN_ADDR(0), BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gUnknown_0807FD00, (void *)BG_SCREEN_ADDR(1), BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gEReaderBackground_Gfx, gTempGfxBuffer, 0x3000);
|
||||
DmaCopy16(3, gEReaderText_Tilemap, (void *)BG_SCREEN_ADDR(0), BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gEReaderOverlay_Tilemap, (void *)BG_SCREEN_ADDR(1), BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gPokedexSprites_Pals, (void *)OBJ_PLTT, 0xC0);
|
||||
DmaCopy16(3, gPokedexSprites_Gfx, (void *)OBJ_VRAM0, 0x6C20);
|
||||
|
||||
sub_2DF0();
|
||||
gUnknown_0202C604 = 0;
|
||||
gUnknown_0202A580 = 0;
|
||||
gUnknown_0202C5A4 = 0;
|
||||
gUnknown_0202AD90 = gUnknown_086A5536[gEReaderCardIndex];
|
||||
sub_377C();
|
||||
InitEReaderTextState();
|
||||
gEReaderTextCharIndex = 0;
|
||||
gEReaderTextAnimDelay = 0;
|
||||
gEReaderTextBlinkToggle = 0;
|
||||
gEReaderTextPageIndex = gEReaderCardStartPages[gEReaderCardIndex];
|
||||
ClearEReaderTextRows();
|
||||
|
||||
DmaCopy16(3, gUnknown_03000000, (void *)VRAM + 0x4000, 0x3000);
|
||||
DmaCopy16(3, gTempGfxBuffer, (void *)VRAM + 0x4000, 0x3000);
|
||||
|
||||
sub_394C();
|
||||
UpdateEReaderSprites();
|
||||
m4aSongNumStart(MUS_UNKNOWN_0x5);
|
||||
sub_0CBC();
|
||||
sub_024C();
|
||||
EnableVBlankInterrupts();
|
||||
FadeInScreen();
|
||||
gMain.subState = EREADER_STATE_7;
|
||||
}
|
||||
|
||||
void Ereader_State7_33C8(void)
|
||||
{
|
||||
if (gUnknown_0202C604 <= gUnknown_086A551A[gUnknown_0202AD90]) {
|
||||
gUnknown_0202A580++;
|
||||
if (2 < gUnknown_0202A580) {
|
||||
gUnknown_0202A580 = 0;
|
||||
sub_3828(gUnknown_0202AD90, gUnknown_0202C604);
|
||||
gUnknown_0202C604++;
|
||||
if (gEReaderTextCharIndex <= gEReaderTextLengths[gEReaderTextPageIndex]) {
|
||||
gEReaderTextAnimDelay++;
|
||||
if (2 < gEReaderTextAnimDelay) {
|
||||
gEReaderTextAnimDelay = 0;
|
||||
DrawEReaderTextCharacter(gEReaderTextPageIndex, gEReaderTextCharIndex);
|
||||
gEReaderTextCharIndex++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gUnknown_0202A580++;
|
||||
if (6 < gUnknown_0202A580) {
|
||||
gUnknown_0202A580 = 0;
|
||||
if (gUnknown_0202C5A4 == 0) {
|
||||
sub_38A0(gUnknown_086A551A[gUnknown_0202AD90], 0x3a80);
|
||||
gEReaderTextAnimDelay++;
|
||||
if (6 < gEReaderTextAnimDelay) {
|
||||
gEReaderTextAnimDelay = 0;
|
||||
if (gEReaderTextBlinkToggle == 0) {
|
||||
BlinkEReaderTextCursor(gEReaderTextLengths[gEReaderTextPageIndex], 0x3a80);
|
||||
}
|
||||
else {
|
||||
sub_38A0(gUnknown_086A551A[gUnknown_0202AD90], 0);
|
||||
BlinkEReaderTextCursor(gEReaderTextLengths[gEReaderTextPageIndex], 0);
|
||||
}
|
||||
gUnknown_0202C5A4 = 1 - gUnknown_0202C5A4;
|
||||
gEReaderTextBlinkToggle = 1 - gEReaderTextBlinkToggle;
|
||||
}
|
||||
}
|
||||
if (JOY_NEW(A_BUTTON)) {
|
||||
if (gUnknown_0202C604 <= gUnknown_086A551A[gUnknown_0202AD90]) {
|
||||
sub_37B4(gUnknown_0202AD90);
|
||||
gUnknown_0202C604 = gUnknown_086A551A[gUnknown_0202AD90] + 1;
|
||||
if (gEReaderTextCharIndex <= gEReaderTextLengths[gEReaderTextPageIndex]) {
|
||||
DrawEReaderTextPage(gEReaderTextPageIndex);
|
||||
gEReaderTextCharIndex = gEReaderTextLengths[gEReaderTextPageIndex] + 1;
|
||||
}
|
||||
else if (gUnknown_086A5528[gUnknown_0202AD90] == 0) {
|
||||
else if (gEReaderTextHasNextPage[gEReaderTextPageIndex] == 0) {
|
||||
if (gEReaderCardIndex == EREADER_BONUS_STAGE_CARD) {
|
||||
gUnknown_0202BEF8 = STATE_BONUS_FIELD_SELECT;
|
||||
gEReaderExitTargetState = STATE_BONUS_FIELD_SELECT;
|
||||
}
|
||||
else {
|
||||
gUnknown_0202BEF8 = STATE_TITLE;
|
||||
gEReaderExitTargetState = STATE_TITLE;
|
||||
}
|
||||
gMain.subState = EREADER_STATE_8;
|
||||
}
|
||||
else {
|
||||
sub_377C();
|
||||
gUnknown_0202C604 = 0;
|
||||
gUnknown_0202A580 = 0;
|
||||
gUnknown_0202C5A4 = 0;
|
||||
gUnknown_0202AD90++;
|
||||
ClearEReaderTextRows();
|
||||
gEReaderTextCharIndex = 0;
|
||||
gEReaderTextAnimDelay = 0;
|
||||
gEReaderTextBlinkToggle = 0;
|
||||
gEReaderTextPageIndex++;
|
||||
}
|
||||
}
|
||||
sub_394C();
|
||||
DmaCopy16(3, gUnknown_03000000, (void*) VRAM + 0x4000, 0x3000);
|
||||
UpdateEReaderSprites();
|
||||
DmaCopy16(3, gTempGfxBuffer, (void*) VRAM + 0x4000, 0x3000);
|
||||
}
|
||||
|
||||
void Ereader_State8_374C(void)
|
||||
{
|
||||
sub_02B4();
|
||||
FadeOutScreen();
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
gAutoDisplayTitlescreenMenu = TRUE;
|
||||
SetMainGameState(gUnknown_0202BEF8);
|
||||
SetMainGameState(gEReaderExitTargetState);
|
||||
}
|
||||
|
||||
void sub_377C(void)
|
||||
void ClearEReaderTextRows(void)
|
||||
{
|
||||
s32 iVar2;
|
||||
s32 iVar4;
|
||||
|
|
@ -433,12 +433,12 @@ void sub_377C(void)
|
|||
{
|
||||
for(iVar4 = 0; iVar4 < 0x18; iVar4++)
|
||||
{
|
||||
CopyBgTilesRect(gEReaderText_Gfx, &gUnknown_03001800[iVar2][iVar4*0x20], 1, 2);
|
||||
CopyBgTilesRect(gEReaderText_Gfx, &gEReaderTextTileBuffer[iVar2][iVar4*0x20], 1, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_37B4(s8 arg0)
|
||||
void DrawEReaderTextPage(s8 arg0)
|
||||
{
|
||||
s32 iVar4;
|
||||
s32 iVar3;
|
||||
|
|
@ -447,48 +447,48 @@ void sub_37B4(s8 arg0)
|
|||
{
|
||||
for (iVar3 = 0; iVar3 < 0x18; iVar3++)
|
||||
{
|
||||
CopyBgTilesRect(gEReaderText_Gfx + (gUnknown_086A4CF8[arg0][iVar4*0x18 + iVar3] & 0xFFF0), &gUnknown_03001800[iVar4][iVar3*0x20], 1, 2);
|
||||
CopyBgTilesRect(gEReaderText_Gfx + (gEReaderTextGlyphTable[arg0][iVar4*0x18 + iVar3] & 0xFFF0), &gEReaderTextTileBuffer[iVar4][iVar3*0x20], 1, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_3828(s8 arg0, s8 arg1)
|
||||
void DrawEReaderTextCharacter(s8 arg0, s8 arg1)
|
||||
{
|
||||
s32 quotient = arg1 / 0x18;
|
||||
s32 remainder = arg1 % 0x18;
|
||||
|
||||
CopyBgTilesRect(gEReaderText_Gfx + (gUnknown_086A4CF8[arg0][quotient*0x18 + remainder] & 0xFFF0), &gUnknown_03001800[quotient][remainder*0x20], 1, 2);
|
||||
CopyBgTilesRect(gEReaderText_Gfx + (gEReaderTextGlyphTable[arg0][quotient*0x18 + remainder] & 0xFFF0), &gEReaderTextTileBuffer[quotient][remainder*0x20], 1, 2);
|
||||
}
|
||||
|
||||
void sub_38A0(s8 arg0, u16 arg1)
|
||||
void BlinkEReaderTextCursor(s8 arg0, u16 arg1)
|
||||
{
|
||||
s32 quotient = arg0 / 0x18;
|
||||
s32 remainder = arg0 % 0x18;
|
||||
|
||||
CopyBgTilesRect(gEReaderText_Gfx + arg1, &gUnknown_03001800[quotient][remainder*0x20], 1, 2);
|
||||
CopyBgTilesRect(gEReaderText_Gfx + arg1, &gEReaderTextTileBuffer[quotient][remainder*0x20], 1, 2);
|
||||
}
|
||||
|
||||
s16 GetEReaderCardIndex(void)
|
||||
{
|
||||
s32 uVar1;
|
||||
|
||||
if (gUnknown_0202BEEC == 0x1f52)
|
||||
if (gEReaderReceivedCardId == 0x1f52)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (gUnknown_0202BEEC == 0x3e1a)
|
||||
else if (gEReaderReceivedCardId == 0x3e1a)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (gUnknown_0202BEEC == 0x25af)
|
||||
else if (gEReaderReceivedCardId == 0x25af)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (gUnknown_0202BEEC == 0x4a09)
|
||||
else if (gEReaderReceivedCardId == 0x4a09)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (gUnknown_0202BEEC == 0x6b12)
|
||||
else if (gEReaderReceivedCardId == 0x6b12)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
|
@ -498,7 +498,7 @@ s16 GetEReaderCardIndex(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_394C(void)
|
||||
void UpdateEReaderSprites(void)
|
||||
{
|
||||
struct SpriteGroup *puVar9;
|
||||
struct SpriteGroup *puVar5;
|
||||
|
|
@ -506,15 +506,15 @@ void sub_394C(void)
|
|||
const struct SpriteSet *puVar8;
|
||||
struct OamDataSimple *test2;
|
||||
|
||||
puVar9 = &gMain_spriteGroups[gUnknown_0202A58C];
|
||||
puVar5 = &gMain_spriteGroups[gUnknown_0202BEC0];
|
||||
puVar9->available = gUnknown_0202C584;
|
||||
puVar9 = &gMain_spriteGroups[gEReaderStatusSpriteIndex];
|
||||
puVar5 = &gMain_spriteGroups[gEReaderHeaderSpriteIndex];
|
||||
puVar9->available = gEReaderStatusSpriteVisible;
|
||||
puVar5->available = TRUE;
|
||||
LoadSpriteSets(gUnknown_086A54D8, 13, gMain_spriteGroups);
|
||||
LoadSpriteSets(gCatchHatchSpriteSets, 13, gMain_spriteGroups);
|
||||
|
||||
if (puVar9->available == 1)
|
||||
{
|
||||
if (gUnknown_0202A58C == 0)
|
||||
if (gEReaderStatusSpriteIndex == 0)
|
||||
{
|
||||
puVar9->baseX = 0x78;
|
||||
puVar9->baseY = 100;
|
||||
|
|
@ -525,7 +525,7 @@ void sub_394C(void)
|
|||
puVar9->baseY = 0x50;
|
||||
}
|
||||
|
||||
puVar8 = gUnknown_086A54D8[gUnknown_0202A58C];
|
||||
puVar8 = gCatchHatchSpriteSets[gEReaderStatusSpriteIndex];
|
||||
|
||||
for (iVar7 = 0; iVar7 < puVar8->count; iVar7++)
|
||||
{
|
||||
|
|
@ -537,7 +537,7 @@ void sub_394C(void)
|
|||
|
||||
puVar5->baseX = 0x78;
|
||||
puVar5->baseY = 0x18;
|
||||
puVar8 = gUnknown_086A54D8[gUnknown_0202BEC0];
|
||||
puVar8 = gCatchHatchSpriteSets[gEReaderHeaderSpriteIndex];
|
||||
|
||||
for (iVar7 = 0; iVar7 < puVar8->count; iVar7++)
|
||||
{
|
||||
|
|
@ -550,22 +550,22 @@ void sub_394C(void)
|
|||
puVar5->available = FALSE;
|
||||
}
|
||||
|
||||
void sub_3AB4(void) {
|
||||
void UpdateEReaderSpritesViaOam(void) {
|
||||
struct SpriteGroup *puVar9;
|
||||
struct SpriteGroup *puVar5;
|
||||
s32 iVar7;
|
||||
const struct SpriteSet *puVar8;
|
||||
struct OamDataSimple *test2;
|
||||
|
||||
puVar9 = &gMain_spriteGroups[gUnknown_0202A58C];
|
||||
puVar5 = &gMain_spriteGroups[gUnknown_0202BEC0];
|
||||
puVar9->available = gUnknown_0202C584;
|
||||
puVar9 = &gMain_spriteGroups[gEReaderStatusSpriteIndex];
|
||||
puVar5 = &gMain_spriteGroups[gEReaderHeaderSpriteIndex];
|
||||
puVar9->available = gEReaderStatusSpriteVisible;
|
||||
puVar5->available = TRUE;
|
||||
sub_2414(gUnknown_086A54D8, 13, gMain_spriteGroups);
|
||||
LoadSpriteSetsWithCpuCopy(gCatchHatchSpriteSets, 13, gMain_spriteGroups);
|
||||
|
||||
if (puVar9->available == 1)
|
||||
{
|
||||
if (gUnknown_0202A58C == 0)
|
||||
if (gEReaderStatusSpriteIndex == 0)
|
||||
{
|
||||
puVar9->baseX = 0x78;
|
||||
puVar9->baseY = 100;
|
||||
|
|
@ -576,7 +576,7 @@ void sub_3AB4(void) {
|
|||
puVar9->baseY = 0x50;
|
||||
}
|
||||
|
||||
puVar8 = gUnknown_086A54D8[gUnknown_0202A58C];
|
||||
puVar8 = gCatchHatchSpriteSets[gEReaderStatusSpriteIndex];
|
||||
|
||||
for (iVar7 = 0; iVar7 < puVar8->count; iVar7++)
|
||||
{
|
||||
|
|
@ -588,7 +588,7 @@ void sub_3AB4(void) {
|
|||
|
||||
puVar5->baseX = 0x78;
|
||||
puVar5->baseY = 0x18;
|
||||
puVar8 = gUnknown_086A54D8[gUnknown_0202BEC0];
|
||||
puVar8 = gCatchHatchSpriteSets[gEReaderHeaderSpriteIndex];
|
||||
|
||||
for (iVar7 = 0; iVar7 < puVar8->count; iVar7++)
|
||||
{
|
||||
|
|
@ -601,49 +601,49 @@ void sub_3AB4(void) {
|
|||
puVar5->available = FALSE;
|
||||
}
|
||||
|
||||
void sub_3C1C(void)
|
||||
void InitEReaderLinkBuffers(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
gUnknown_0202A564 = 0;
|
||||
gUnknown_02019C20 = 0;
|
||||
gUnknown_0202ADE8 = 0;
|
||||
gEReaderLinkHandshakeStarted = 0;
|
||||
gEReaderLinkDataReceived = 0;
|
||||
gEReaderLinkAckSent = 0;
|
||||
|
||||
for (i = 0; i < 0x8; i++)
|
||||
{
|
||||
gUnknown_0202C5F0[i] = 0;
|
||||
gLinkSendBuffer[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
gUnknown_0201A4D0[j][i] = 0;
|
||||
gLinkRecvBuffer[j][i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 sub_3C78(void)
|
||||
s32 PrepareEReaderLinkSendCmd(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
if (gUnknown_02019C20)
|
||||
if (gEReaderLinkDataReceived)
|
||||
{
|
||||
gUnknown_0202C5F0[0] = 0xDFDF;
|
||||
gLinkSendBuffer[0] = 0xDFDF;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gUnknown_0202ADE8 == -1)
|
||||
if (gEReaderLinkAckSent == -1)
|
||||
{
|
||||
gUnknown_0202C5F0[0] = 0xCDFE;
|
||||
gUnknown_0202ADE8 = 0;
|
||||
gLinkSendBuffer[0] = 0xCDFE;
|
||||
gEReaderLinkAckSent = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
gUnknown_0202C5F0[i] = 0;
|
||||
gLinkSendBuffer[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -651,41 +651,41 @@ s32 sub_3C78(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
s16 sub_3CD8(void)
|
||||
s16 ProcessEReaderLinkReceive(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
if ((JOY_NEW(A_BUTTON)))
|
||||
{
|
||||
if (gUnknown_0202A564 == 0)
|
||||
if (gEReaderLinkHandshakeStarted == 0)
|
||||
{
|
||||
gUnknown_0202A564 = -1;
|
||||
gUnknown_0202ADE8 = -1;
|
||||
gUnknown_0202A58C = 1;
|
||||
gEReaderLinkHandshakeStarted = -1;
|
||||
gEReaderLinkAckSent = -1;
|
||||
gEReaderStatusSpriteIndex = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (gUnknown_0202A564 != 0)
|
||||
if (gEReaderLinkHandshakeStarted != 0)
|
||||
{
|
||||
if (gUnknown_02019C20 == 0)
|
||||
if (gEReaderLinkDataReceived == 0)
|
||||
{
|
||||
if (gUnknown_0201A4D0[0][0] == 0xFEDC)
|
||||
if (gLinkRecvBuffer[0][0] == 0xFEDC)
|
||||
{
|
||||
gUnknown_0202BEEC = gUnknown_0201A4D0[1][0];
|
||||
gUnknown_02019C20 = -1;
|
||||
gEReaderReceivedCardId = gLinkRecvBuffer[1][0];
|
||||
gEReaderLinkDataReceived = -1;
|
||||
}
|
||||
else if (gUnknown_0201A4D0[0][1] == 0xFEDC)
|
||||
else if (gLinkRecvBuffer[0][1] == 0xFEDC)
|
||||
{
|
||||
gUnknown_0202BEEC = gUnknown_0201A4D0[1][1];
|
||||
gUnknown_02019C20 = -1;
|
||||
gEReaderReceivedCardId = gLinkRecvBuffer[1][1];
|
||||
gEReaderLinkDataReceived = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (gUnknown_0201A4D0[0][i] == 0xDFDF)
|
||||
if (gLinkRecvBuffer[0][i] == 0xDFDF)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -697,7 +697,7 @@ s16 sub_3CD8(void)
|
|||
{
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
gUnknown_0201A4D0[j][i] = 0;
|
||||
gLinkRecvBuffer[j][i] = 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
#include "m4a.h"
|
||||
#include "titlescreen.h"
|
||||
|
||||
static void sub_8F94(void);
|
||||
static void sub_8C38(void);
|
||||
static void RenderFieldSelectSprites(void);
|
||||
static void InitFieldSelectData(void);
|
||||
|
||||
enum FieldSelectStates
|
||||
{
|
||||
|
|
@ -18,17 +18,17 @@ enum FieldSelectStates
|
|||
|
||||
struct FieldSelectData
|
||||
{
|
||||
u16 unk0;
|
||||
u16 unk2;
|
||||
u16 unk4;
|
||||
u16 unk6;
|
||||
u16 rubyFieldSpriteId;
|
||||
u16 sapphireFieldSpriteId;
|
||||
u16 rubyHighlightVisible;
|
||||
u16 sapphireHighlightVisible;
|
||||
u16 selectedField;
|
||||
u16 state;
|
||||
s16 unkC;
|
||||
s16 unkE;
|
||||
s16 transitionFrame;
|
||||
s16 speedBlinkTimer;
|
||||
u8 ballSpeed;
|
||||
s16 unk12;
|
||||
s8 unk14;
|
||||
s16 speedBlinkToggle;
|
||||
s8 ballSpeedVisible;
|
||||
u16 nextMainState;
|
||||
};
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ void FieldSelectMain(void)
|
|||
|
||||
void LoadFieldSelectGraphics(void)
|
||||
{
|
||||
ResetSomeGraphicsRelatedStuff();
|
||||
ResetDisplayState();
|
||||
|
||||
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_FORCED_BLANK | DISPCNT_OBJ_ON;
|
||||
|
||||
|
|
@ -59,50 +59,50 @@ void LoadFieldSelectGraphics(void)
|
|||
DmaCopy16(3, gFieldSelectBGPals, (void *)(PLTT), 0x200);
|
||||
DmaCopy16(3, gFieldSelectWindow_Gfx, (void *)(VRAM + 0x4000), 0x1400);
|
||||
DmaCopy16(3, gFieldSelectMiniFields_Gfx, (void *)(VRAM + 0x8000), 0x3800);
|
||||
DmaCopy16(3, gUnknown_080A2400, (void *)(VRAM), 0x800);
|
||||
DmaCopy16(3, gFieldSelectBG0Tilemap, (void *)(VRAM), 0x800);
|
||||
DmaCopy16(3, gFieldSelectFrameShadowTilemap, (void *)(VRAM + 0x800), 0x800);
|
||||
DmaCopy16(3, gFieldSelectWindowTilemap, (void *)(VRAM + 0x1000), 0x800);
|
||||
DmaCopy16(3, gFieldSelectSpritePals, (void *)(PLTT + 0x200), 0x200);
|
||||
DmaCopy16(3, gFieldSelectSpriteGfx, (void *)(VRAM + 0x10000), 0x4020);
|
||||
|
||||
sub_0CBC();
|
||||
sub_8C38();
|
||||
sub_FD5C(sub_8F94);
|
||||
EnableVBlankInterrupts();
|
||||
InitFieldSelectData();
|
||||
FadeInFromWhite(RenderFieldSelectSprites);
|
||||
gMain.subState++;
|
||||
m4aSongNumStart(MUS_TABLE_SELECT);
|
||||
}
|
||||
|
||||
static void sub_8C38(void)
|
||||
static void InitFieldSelectData(void)
|
||||
{
|
||||
gFieldSelectData.unk0 = 2;
|
||||
gFieldSelectData.unk2 = 3;
|
||||
gFieldSelectData.unk4 = 0;
|
||||
gFieldSelectData.unk6 = 1;
|
||||
gFieldSelectData.rubyFieldSpriteId = 2;
|
||||
gFieldSelectData.sapphireFieldSpriteId = 3;
|
||||
gFieldSelectData.rubyHighlightVisible = 0;
|
||||
gFieldSelectData.sapphireHighlightVisible = 1;
|
||||
gFieldSelectData.selectedField = FIELD_RUBY;
|
||||
gFieldSelectData.state = FIELD_SELECT_STATE_CHOOSE_FIELD;
|
||||
gFieldSelectData.unkC = 0;
|
||||
gFieldSelectData.unkE = 0;
|
||||
gFieldSelectData.transitionFrame = 0;
|
||||
gFieldSelectData.speedBlinkTimer = 0;
|
||||
gFieldSelectData.nextMainState = STATE_INTRO;
|
||||
gFieldSelectData.unk12 = 0;
|
||||
gFieldSelectData.unk14 = 0;
|
||||
gFieldSelectData.speedBlinkToggle = 0;
|
||||
gFieldSelectData.ballSpeedVisible = 0;
|
||||
|
||||
gFieldSelectData.ballSpeed = gMain_saveData.ballSpeed;
|
||||
gMain.selectedField = FIELD_RUBY;
|
||||
gUnknown_02002850 = 0;
|
||||
gFieldSelectSoftReset = 0;
|
||||
}
|
||||
|
||||
#define RESTART_GAME_BUTTONS (A_BUTTON | B_BUTTON | SELECT_BUTTON | START_BUTTON)
|
||||
|
||||
void FieldSelect_State1_8C7C(void)
|
||||
{
|
||||
sub_8F94();
|
||||
RenderFieldSelectSprites();
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
gUnknown_02002850 = 1;
|
||||
gFieldSelectSoftReset = 1;
|
||||
gFieldSelectData.nextMainState = STATE_INTRO;
|
||||
gMain.subState++;
|
||||
}
|
||||
if (gUnknown_02002850 == 0)
|
||||
if (gFieldSelectSoftReset == 0)
|
||||
{
|
||||
switch (gFieldSelectData.state)
|
||||
{
|
||||
|
|
@ -113,8 +113,8 @@ void FieldSelect_State1_8C7C(void)
|
|||
{
|
||||
m4aSongNumStart(SE_UNKNOWN_0x6D);
|
||||
gFieldSelectData.selectedField = FIELD_RUBY;
|
||||
gFieldSelectData.unk4 = 0;
|
||||
gFieldSelectData.unk6 = 1;
|
||||
gFieldSelectData.rubyHighlightVisible = 0;
|
||||
gFieldSelectData.sapphireHighlightVisible = 1;
|
||||
gFieldSelectData.state = FIELD_SELECT_STATE_1;
|
||||
}
|
||||
}
|
||||
|
|
@ -124,8 +124,8 @@ void FieldSelect_State1_8C7C(void)
|
|||
{
|
||||
m4aSongNumStart(SE_UNKNOWN_0x6D);
|
||||
gFieldSelectData.selectedField = FIELD_SAPPHIRE;
|
||||
gFieldSelectData.unk4 = 1;
|
||||
gFieldSelectData.unk6 = 0;
|
||||
gFieldSelectData.rubyHighlightVisible = 1;
|
||||
gFieldSelectData.sapphireHighlightVisible = 0;
|
||||
gFieldSelectData.state = FIELD_SELECT_STATE_1;
|
||||
}
|
||||
}
|
||||
|
|
@ -133,23 +133,23 @@ void FieldSelect_State1_8C7C(void)
|
|||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gFieldSelectData.state = FIELD_SELECT_STATE_BALL_SPEED;
|
||||
gFieldSelectData.unk14 = 1;
|
||||
gFieldSelectData.unkE = 0;
|
||||
gFieldSelectData.ballSpeedVisible = 1;
|
||||
gFieldSelectData.speedBlinkTimer = 0;
|
||||
if (gFieldSelectData.selectedField == FIELD_RUBY)
|
||||
{
|
||||
gFieldSelectData.unk4 = 0;
|
||||
gFieldSelectData.unk6 = 1;
|
||||
gFieldSelectData.unk0 = 2;
|
||||
gFieldSelectData.unk2 = 3;
|
||||
gFieldSelectData.unkC = 0;
|
||||
gFieldSelectData.rubyHighlightVisible = 0;
|
||||
gFieldSelectData.sapphireHighlightVisible = 1;
|
||||
gFieldSelectData.rubyFieldSpriteId = 2;
|
||||
gFieldSelectData.sapphireFieldSpriteId = 3;
|
||||
gFieldSelectData.transitionFrame = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gFieldSelectData.unk4 = 1;
|
||||
gFieldSelectData.unk6 = 0;
|
||||
gFieldSelectData.unk0 = 7;
|
||||
gFieldSelectData.unk2 = 11;
|
||||
gFieldSelectData.unkC = 0;
|
||||
gFieldSelectData.rubyHighlightVisible = 1;
|
||||
gFieldSelectData.sapphireHighlightVisible = 0;
|
||||
gFieldSelectData.rubyFieldSpriteId = 7;
|
||||
gFieldSelectData.sapphireFieldSpriteId = 11;
|
||||
gFieldSelectData.transitionFrame = 0;
|
||||
}
|
||||
}
|
||||
if (JOY_NEW(B_BUTTON))
|
||||
|
|
@ -159,25 +159,25 @@ void FieldSelect_State1_8C7C(void)
|
|||
gFieldSelectData.nextMainState = STATE_TITLE;
|
||||
if (gFieldSelectData.selectedField == FIELD_RUBY)
|
||||
{
|
||||
gFieldSelectData.unk4 = 0;
|
||||
gFieldSelectData.unk6 = 1;
|
||||
gFieldSelectData.unk0 = 2;
|
||||
gFieldSelectData.unk2 = 3;
|
||||
gFieldSelectData.unkC = 0;
|
||||
gFieldSelectData.rubyHighlightVisible = 0;
|
||||
gFieldSelectData.sapphireHighlightVisible = 1;
|
||||
gFieldSelectData.rubyFieldSpriteId = 2;
|
||||
gFieldSelectData.sapphireFieldSpriteId = 3;
|
||||
gFieldSelectData.transitionFrame = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gFieldSelectData.unk4 = 1;
|
||||
gFieldSelectData.unk6 = 0;
|
||||
gFieldSelectData.unk0 = 7;
|
||||
gFieldSelectData.unk2 = 11;
|
||||
gFieldSelectData.unkC = 0;
|
||||
gFieldSelectData.rubyHighlightVisible = 1;
|
||||
gFieldSelectData.sapphireHighlightVisible = 0;
|
||||
gFieldSelectData.rubyFieldSpriteId = 7;
|
||||
gFieldSelectData.sapphireFieldSpriteId = 11;
|
||||
gFieldSelectData.transitionFrame = 0;
|
||||
}
|
||||
}
|
||||
if (gMain.selectedField < MAIN_FIELD_COUNT)
|
||||
gMain.unk6 = 0;
|
||||
gMain.isBonusField = 0;
|
||||
else
|
||||
gMain.unk6 = 1;
|
||||
gMain.isBonusField = 1;
|
||||
break;
|
||||
case FIELD_SELECT_STATE_BALL_SPEED:
|
||||
if (JOY_NEW(DPAD_LEFT | DPAD_RIGHT))
|
||||
|
|
@ -188,8 +188,8 @@ void FieldSelect_State1_8C7C(void)
|
|||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gFieldSelectData.unkE = 0;
|
||||
gFieldSelectData.unkC = 0;
|
||||
gFieldSelectData.speedBlinkTimer = 0;
|
||||
gFieldSelectData.transitionFrame = 0;
|
||||
gMain_saveData.ballSpeed = gFieldSelectData.ballSpeed;
|
||||
SaveFile_WriteToSram();
|
||||
gFieldSelectData.state = FIELD_SELECT_STATE_3;
|
||||
|
|
@ -197,36 +197,36 @@ void FieldSelect_State1_8C7C(void)
|
|||
if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
m4aSongNumStart(SE_MENU_CANCEL);
|
||||
gFieldSelectData.unk14 = 0;
|
||||
gFieldSelectData.ballSpeedVisible = 0;
|
||||
gFieldSelectData.state = FIELD_SELECT_STATE_CHOOSE_FIELD;
|
||||
}
|
||||
gFieldSelectData.unkE++;
|
||||
if (gFieldSelectData.unkE > 4)
|
||||
gFieldSelectData.speedBlinkTimer++;
|
||||
if (gFieldSelectData.speedBlinkTimer > 4)
|
||||
{
|
||||
gFieldSelectData.unkE = 0;
|
||||
gFieldSelectData.unk12 = 1 - gFieldSelectData.unk12;
|
||||
gFieldSelectData.speedBlinkTimer = 0;
|
||||
gFieldSelectData.speedBlinkToggle = 1 - gFieldSelectData.speedBlinkToggle;
|
||||
}
|
||||
break;
|
||||
case FIELD_SELECT_STATE_1:
|
||||
if (gFieldSelectData.selectedField == FIELD_RUBY)
|
||||
{
|
||||
gFieldSelectData.unk0 = gUnknown_086A6B14.unk0[4 - gFieldSelectData.unkC];
|
||||
gFieldSelectData.unk2 = gUnknown_086A6B14.unkA[4 - gFieldSelectData.unkC];
|
||||
gFieldSelectData.rubyFieldSpriteId = gFieldTransitionAnimData.rubyTransitionFrames[4 - gFieldSelectData.transitionFrame];
|
||||
gFieldSelectData.sapphireFieldSpriteId = gFieldTransitionAnimData.sapphireTransitionFrames[4 - gFieldSelectData.transitionFrame];
|
||||
}
|
||||
else
|
||||
{
|
||||
gFieldSelectData.unk0 = gUnknown_086A6B14.unk0[gFieldSelectData.unkC];
|
||||
gFieldSelectData.unk2 = gUnknown_086A6B14.unkA[gFieldSelectData.unkC];
|
||||
gFieldSelectData.rubyFieldSpriteId = gFieldTransitionAnimData.rubyTransitionFrames[gFieldSelectData.transitionFrame];
|
||||
gFieldSelectData.sapphireFieldSpriteId = gFieldTransitionAnimData.sapphireTransitionFrames[gFieldSelectData.transitionFrame];
|
||||
}
|
||||
if (!(gMain.systemFrameCount & 1))
|
||||
{
|
||||
if (gFieldSelectData.unkC < 4)
|
||||
if (gFieldSelectData.transitionFrame < 4)
|
||||
{
|
||||
gFieldSelectData.unkC++;
|
||||
gFieldSelectData.transitionFrame++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gFieldSelectData.unkC = 0;
|
||||
gFieldSelectData.transitionFrame = 0;
|
||||
gFieldSelectData.state = FIELD_SELECT_STATE_CHOOSE_FIELD;
|
||||
}
|
||||
}
|
||||
|
|
@ -236,11 +236,11 @@ void FieldSelect_State1_8C7C(void)
|
|||
{
|
||||
m4aSongNumStart(SE_UNKNOWN_0x6D);
|
||||
gFieldSelectData.selectedField = FIELD_RUBY;
|
||||
gFieldSelectData.unk4 = 0;
|
||||
gFieldSelectData.unk6 = 1;
|
||||
gFieldSelectData.unk0 = 2;
|
||||
gFieldSelectData.unk2 = 3;
|
||||
gFieldSelectData.unkC = 0;
|
||||
gFieldSelectData.rubyHighlightVisible = 0;
|
||||
gFieldSelectData.sapphireHighlightVisible = 1;
|
||||
gFieldSelectData.rubyFieldSpriteId = 2;
|
||||
gFieldSelectData.sapphireFieldSpriteId = 3;
|
||||
gFieldSelectData.transitionFrame = 0;
|
||||
gFieldSelectData.state = FIELD_SELECT_STATE_CHOOSE_FIELD;
|
||||
}
|
||||
}
|
||||
|
|
@ -250,26 +250,26 @@ void FieldSelect_State1_8C7C(void)
|
|||
{
|
||||
m4aSongNumStart(SE_UNKNOWN_0x6D);
|
||||
gFieldSelectData.selectedField = FIELD_SAPPHIRE;
|
||||
gFieldSelectData.unk4 = 1;
|
||||
gFieldSelectData.unk6 = 0;
|
||||
gFieldSelectData.unk0 = 7;
|
||||
gFieldSelectData.unk2 = 11;
|
||||
gFieldSelectData.unkC = 0;
|
||||
gFieldSelectData.rubyHighlightVisible = 1;
|
||||
gFieldSelectData.sapphireHighlightVisible = 0;
|
||||
gFieldSelectData.rubyFieldSpriteId = 7;
|
||||
gFieldSelectData.sapphireFieldSpriteId = 11;
|
||||
gFieldSelectData.transitionFrame = 0;
|
||||
gFieldSelectData.state = FIELD_SELECT_STATE_CHOOSE_FIELD;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FIELD_SELECT_STATE_3:
|
||||
gFieldSelectData.unkE++;
|
||||
if (gFieldSelectData.unkE > 3)
|
||||
gFieldSelectData.speedBlinkTimer++;
|
||||
if (gFieldSelectData.speedBlinkTimer > 3)
|
||||
{
|
||||
gFieldSelectData.unkE = 0;
|
||||
gFieldSelectData.speedBlinkTimer = 0;
|
||||
if (gFieldSelectData.selectedField == FIELD_RUBY)
|
||||
gFieldSelectData.unk4 = 1 - gFieldSelectData.unk4;
|
||||
gFieldSelectData.rubyHighlightVisible = 1 - gFieldSelectData.rubyHighlightVisible;
|
||||
else
|
||||
gFieldSelectData.unk6 = 1 - gFieldSelectData.unk6;
|
||||
gFieldSelectData.unkC++;
|
||||
if (gFieldSelectData.unkC > 5)
|
||||
gFieldSelectData.sapphireHighlightVisible = 1 - gFieldSelectData.sapphireHighlightVisible;
|
||||
gFieldSelectData.transitionFrame++;
|
||||
if (gFieldSelectData.transitionFrame > 5)
|
||||
{
|
||||
gFieldSelectData.nextMainState = STATE_GAME_MAIN;
|
||||
gMain.subState++;
|
||||
|
|
@ -278,20 +278,20 @@ void FieldSelect_State1_8C7C(void)
|
|||
break;
|
||||
}
|
||||
gMain.selectedField = gFieldSelectData.selectedField;
|
||||
gMain.unk5 = gFieldSelectData.selectedField;
|
||||
gMain.tempField = gFieldSelectData.selectedField;
|
||||
}
|
||||
}
|
||||
|
||||
void FieldSelect_State2_8F64(void)
|
||||
{
|
||||
sub_FE04(sub_8F94);
|
||||
FadeOutToWhite(RenderFieldSelectSprites);
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
gAutoDisplayTitlescreenMenu = TRUE;
|
||||
SetMainGameState(gFieldSelectData.nextMainState);
|
||||
}
|
||||
|
||||
static void sub_8F94(void)
|
||||
static void RenderFieldSelectSprites(void)
|
||||
{
|
||||
struct SpriteGroup *r6;
|
||||
struct SpriteGroup *r9;
|
||||
|
|
@ -308,19 +308,19 @@ static void sub_8F94(void)
|
|||
|
||||
r6 = &gMain.spriteGroups[0];
|
||||
r9 = &gMain.spriteGroups[1];
|
||||
sp0 = &gMain.spriteGroups[gFieldSelectData.unk0];
|
||||
r10 = &gMain.spriteGroups[gFieldSelectData.unk2];
|
||||
r8 = &gMain.spriteGroups[12 + gFieldSelectData.ballSpeed * 2 + gFieldSelectData.unk12];
|
||||
sp0 = &gMain.spriteGroups[gFieldSelectData.rubyFieldSpriteId];
|
||||
r10 = &gMain.spriteGroups[gFieldSelectData.sapphireFieldSpriteId];
|
||||
r8 = &gMain.spriteGroups[12 + gFieldSelectData.ballSpeed * 2 + gFieldSelectData.speedBlinkToggle];
|
||||
|
||||
r6->available = gFieldSelectData.unk4;
|
||||
r9->available = gFieldSelectData.unk6;
|
||||
r6->available = gFieldSelectData.rubyHighlightVisible;
|
||||
r9->available = gFieldSelectData.sapphireHighlightVisible;
|
||||
sp0->available = TRUE;
|
||||
r10->available = TRUE;
|
||||
r8->available = gFieldSelectData.unk14;
|
||||
r8->available = gFieldSelectData.ballSpeedVisible;
|
||||
|
||||
LoadSpriteSets(gUnknown_086A6AD4, 16, r6);
|
||||
LoadSpriteSets(gFieldSelectSpriteSets, 16, r6);
|
||||
|
||||
if (gFieldSelectData.unk4 == 1)
|
||||
if (gFieldSelectData.rubyHighlightVisible == 1)
|
||||
{
|
||||
r6->baseX = 0x25;
|
||||
r6->baseY = 0x18;
|
||||
|
|
@ -331,7 +331,7 @@ static void sub_8F94(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (gFieldSelectData.unk6 == 1)
|
||||
if (gFieldSelectData.sapphireHighlightVisible == 1)
|
||||
{
|
||||
r9->baseX = 0x8D;
|
||||
r9->baseY = 0x18;
|
||||
|
|
@ -344,7 +344,7 @@ static void sub_8F94(void)
|
|||
|
||||
sp0->baseX = 32;
|
||||
sp0->baseY = 32;
|
||||
spriteSet = gUnknown_086A6AD4[gFieldSelectData.unk0];
|
||||
spriteSet = gFieldSelectSpriteSets[gFieldSelectData.rubyFieldSpriteId];
|
||||
for (i = 0; i < spriteSet->count; i++)
|
||||
{
|
||||
gOamBuffer[sp0->oam[i].oamId].objMode = 1;
|
||||
|
|
@ -354,7 +354,7 @@ static void sub_8F94(void)
|
|||
|
||||
r10->baseX = 0x88;
|
||||
r10->baseY = 32;
|
||||
spriteSet = gUnknown_086A6AD4[gFieldSelectData.unk2];
|
||||
spriteSet = gFieldSelectSpriteSets[gFieldSelectData.sapphireFieldSpriteId];
|
||||
for (i = 0; i < spriteSet->count; i++)
|
||||
{
|
||||
gOamBuffer[r10->oam[i].oamId].objMode = 1;
|
||||
|
|
@ -364,8 +364,8 @@ static void sub_8F94(void)
|
|||
|
||||
if (r8->available == 1)
|
||||
{
|
||||
r8->baseX = gUnknown_086A6B28[gFieldSelectData.selectedField].x;
|
||||
r8->baseY = gUnknown_086A6B28[gFieldSelectData.selectedField].y;
|
||||
r8->baseX = gFieldSelectBallSpeedPositions[gFieldSelectData.selectedField].x;
|
||||
r8->baseY = gFieldSelectBallSpeedPositions[gFieldSelectData.selectedField].y;
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
gOamBuffer[r8->oam[i].oamId].objMode = 0;
|
||||
|
|
|
|||
102
src/game_idle.c
102
src/game_idle.c
|
|
@ -13,48 +13,48 @@ void IdlePinballGameMain(void)
|
|||
void PinballGameIdle0_19048(void)
|
||||
{
|
||||
s16 i;
|
||||
s16 unk30;
|
||||
s8 unk30LowerBits;
|
||||
s16 demoVariant;
|
||||
s8 demoFieldVariant;
|
||||
|
||||
gMain.unk54 = 0;
|
||||
gMain.unkD = 1;
|
||||
gUnknown_02031510 = 0;
|
||||
gMain.idleFrameCounter = 0;
|
||||
gMain.continueFromSave = 1;
|
||||
gReplayFrameCounter = 0;
|
||||
|
||||
for (i = 0; i < NUM_EREADER_CARDS; i++)
|
||||
gUnknown_02031520.eReaderBonuses[i] = gMain.eReaderBonuses[i];
|
||||
gBoardConfig.eReaderBonuses[i] = gMain.eReaderBonuses[i];
|
||||
|
||||
if (gMain.unk30 == 0)
|
||||
gMain.unk30 = (Random() + gMain.systemFrameCount) % 30;
|
||||
if (gMain.idleDemoVariant == 0)
|
||||
gMain.idleDemoVariant = (Random() + gMain.systemFrameCount) % 30;
|
||||
|
||||
unk30 = gMain.unk30;
|
||||
unk30LowerBits = unk30 & 3;
|
||||
switch (unk30LowerBits)
|
||||
demoVariant = gMain.idleDemoVariant;
|
||||
demoFieldVariant = demoVariant & 3;
|
||||
switch (demoFieldVariant)
|
||||
{
|
||||
case 0:
|
||||
gUnknown_02031520.unk6 = 0xA14;
|
||||
gUnknown_02031520.unk10 = &gUnknown_081450F4;
|
||||
gUnknown_02031520.unkC = &gUnknown_081531F4;
|
||||
gBoardConfig.idleDemoDuration = 0xA14;
|
||||
gBoardConfig.replayInputData = &gIdleBoardConfig0;
|
||||
gBoardConfig.pinballGame = &gIdleBoardGameState0;
|
||||
break;
|
||||
case 1:
|
||||
gUnknown_02031520.unk6 = 0xF00;
|
||||
gUnknown_02031520.unk10 = &gUnknown_0814F9B4;
|
||||
gUnknown_02031520.unkC = &gUnknown_08156E60;
|
||||
gBoardConfig.idleDemoDuration = 0xF00;
|
||||
gBoardConfig.replayInputData = &gIdleBoardConfig1;
|
||||
gBoardConfig.pinballGame = &gIdleBoardGameState1;
|
||||
break;
|
||||
case 2:
|
||||
gUnknown_02031520.unk6 = 0xD20;
|
||||
gUnknown_02031520.unk10 = &gUnknown_08148934;
|
||||
gUnknown_02031520.unkC = &gUnknown_08154618;
|
||||
gBoardConfig.idleDemoDuration = 0xD20;
|
||||
gBoardConfig.replayInputData = &gIdleBoardConfig2;
|
||||
gBoardConfig.pinballGame = &gIdleBoardGameState2;
|
||||
break;
|
||||
case 3:
|
||||
gUnknown_02031520.unk6 = 0xE4C;
|
||||
gUnknown_02031520.unk10 = &gUnknown_0814C174;
|
||||
gUnknown_02031520.unkC = &gUnknown_08155A3C;
|
||||
gBoardConfig.idleDemoDuration = 0xE4C;
|
||||
gBoardConfig.replayInputData = &gIdleBoardConfig3;
|
||||
gBoardConfig.pinballGame = &gIdleBoardGameState3;
|
||||
break;
|
||||
}
|
||||
|
||||
PinballGame_State0_49ED4();
|
||||
|
||||
switch (unk30LowerBits)
|
||||
switch (demoFieldVariant)
|
||||
{
|
||||
case 0:
|
||||
m4aSongNumStart(MUS_FIELD_RUBY);
|
||||
|
|
@ -70,54 +70,54 @@ void PinballGameIdle0_19048(void)
|
|||
break;
|
||||
}
|
||||
|
||||
gUnknown_02031520.rumbleEnabled = gMain_saveData.rumbleEnabled;
|
||||
gBoardConfig.rumbleEnabled = gMain_saveData.rumbleEnabled;
|
||||
gMain_saveData.rumbleEnabled = 0;
|
||||
gMain.unk30++;
|
||||
gMain.idleDemoVariant++;
|
||||
}
|
||||
|
||||
void PinballGameIdle1_19190(void)
|
||||
{
|
||||
u8 unk1D;
|
||||
u8 fadeSubState;
|
||||
|
||||
unk1D = gCurrentPinballGame->unk1D;
|
||||
switch (unk1D)
|
||||
fadeSubState = gCurrentPinballGame->fadeSubState;
|
||||
switch (fadeSubState)
|
||||
{
|
||||
case 0:
|
||||
gCurrentPinballGame->unk1D = 1;
|
||||
gMain.unkE = unk1D;
|
||||
gCurrentPinballGame->fadeSubState = 1;
|
||||
gMain.gameExitState = fadeSubState;
|
||||
break;
|
||||
case 1:
|
||||
if (gMain.selectedField < MAIN_FIELD_COUNT)
|
||||
sub_4ACF0();
|
||||
IdleGameFrameUpdate();
|
||||
else
|
||||
sub_4B000();
|
||||
IdleBonusFieldFrameUpdate();
|
||||
|
||||
if (gMain.unk54++ > gUnknown_02031520.unk6)
|
||||
gMain.unkE = 1;
|
||||
if (gMain.idleFrameCounter++ > gBoardConfig.idleDemoDuration)
|
||||
gMain.gameExitState = 1;
|
||||
|
||||
if (gMain.heldKeys & JOY_EXCL_LR)
|
||||
gMain.unkE = 1;
|
||||
gMain.gameExitState = 1;
|
||||
|
||||
if (gMain.unkE != 0)
|
||||
if (gMain.gameExitState != 0)
|
||||
{
|
||||
if (gMain.selectedField < MAIN_FIELD_COUNT)
|
||||
{
|
||||
sub_1D4D0();
|
||||
sub_31BE8(0);
|
||||
ClampPortraitSpritesToOffscreen();
|
||||
RestoreBoardObjPalettes(0);
|
||||
}
|
||||
else if (gMain.selectedField == FIELD_KECLEON)
|
||||
{
|
||||
sub_356A0();
|
||||
RenderBonusStageOverlaySprites();
|
||||
}
|
||||
|
||||
if ((gMain.modeChangeFlags & MODE_CHANGE_PAUSE) != 0)
|
||||
{
|
||||
DmaCopy16(3, gCurrentPinballGame->unk111A, (void *)OBJ_PLTT, OBJ_PLTT_SIZE);
|
||||
DmaCopy16(3, gCurrentPinballGame->pauseObjPalette, (void *)OBJ_PLTT, OBJ_PLTT_SIZE);
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk1D = 2;
|
||||
if (gMain.unkE == 2)
|
||||
sub_4B408(1);
|
||||
gCurrentPinballGame->fadeSubState = 2;
|
||||
if (gMain.gameExitState == 2)
|
||||
SaveGameStateSnapshot(1);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
|
|
@ -130,18 +130,18 @@ void PinballGameIdle3_19288(void)
|
|||
{
|
||||
s16 i;
|
||||
|
||||
gMain.unk36 = 0;
|
||||
gMain_saveData.rumbleEnabled = gUnknown_02031520.rumbleEnabled;
|
||||
gMain.blendEnabled = 0;
|
||||
gMain_saveData.rumbleEnabled = gBoardConfig.rumbleEnabled;
|
||||
for (i = 0; i < NUM_EREADER_CARDS; i++)
|
||||
gMain.eReaderBonuses[i] = gUnknown_02031520.eReaderBonuses[i];
|
||||
gMain.eReaderBonuses[i] = gBoardConfig.eReaderBonuses[i];
|
||||
|
||||
sub_02B4();
|
||||
FadeOutScreen();
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
if (gMain.unk54 < gUnknown_02031520.unk6)
|
||||
DisableVBlankInterrupts();
|
||||
if (gMain.idleFrameCounter < gBoardConfig.idleDemoDuration)
|
||||
SetMainGameState(STATE_TITLE);
|
||||
else
|
||||
SetMainGameState(STATE_SCORES_IDLE);
|
||||
|
||||
gMain.unk54 = 0;
|
||||
gMain.idleFrameCounter = 0;
|
||||
}
|
||||
|
|
|
|||
284
src/gbplayer.c
284
src/gbplayer.c
|
|
@ -87,58 +87,58 @@ void InitGameBoyPlayer(void)
|
|||
REG_BLDCNT = BLDCNT_TGT2_ALL | BLDCNT_EFFECT_LIGHTEN | BLDCNT_TGT1_ALL;
|
||||
REG_BLDY = 0x10;
|
||||
REG_DISPCNT = DISPCNT_OBJ_ON | DISPCNT_BG0_ON;
|
||||
gUnknown_02019C00 = 0;
|
||||
gUnknown_02019BEC = 0;
|
||||
gUnknown_02019BF4 = 0;
|
||||
gUnknown_02019BF0 = 0;
|
||||
gRumbleCommand = 0;
|
||||
gRumbleMotorMode = 0;
|
||||
gSio32SerialEnabled = 0;
|
||||
gSio32ReconnectTimer = 0;
|
||||
gGameBoyPlayerEnabled = CheckGameBoyPlayer();
|
||||
REG_IE &= ~INTR_FLAG_VBLANK;
|
||||
REG_DISPSTAT &= ~DISPSTAT_VBLANK_INTR;
|
||||
REG_DISPCNT = 0;
|
||||
gUnknown_02019BFC = -1;
|
||||
gUnknown_02019BE4 = 0;
|
||||
gUnknown_02019BE8 = 0;
|
||||
gUnknown_02019BF8 = 0;
|
||||
gUnknown_02019C08 = 2;
|
||||
gRumblePatternPosition = -1;
|
||||
gRumbleLoopCounter = 0;
|
||||
gRumbleFrameCounter = 0;
|
||||
gRumblePatternIndex = 0;
|
||||
gRumbleSpeedMode = 2;
|
||||
}
|
||||
|
||||
void sub_10C0(void)
|
||||
void EnableGbPlayerRumble(void)
|
||||
{
|
||||
if (gGameBoyPlayerEnabled == 1)
|
||||
{
|
||||
gIntrTable[0] = Sio32IDIntr;
|
||||
gIntrTable[1] = sub_1828;
|
||||
gUnknown_02019BF4 = 1;
|
||||
sub_1340();
|
||||
gIntrTable[1] = Sio32TimeoutIntr;
|
||||
gSio32SerialEnabled = 1;
|
||||
InitSio32Hardware();
|
||||
}
|
||||
|
||||
gUnknown_02019BFC = -1;
|
||||
gUnknown_02019BE4 = 0;
|
||||
gUnknown_02019C08 = 2;
|
||||
gUnknown_02019C04 = 0;
|
||||
gRumblePatternPosition = -1;
|
||||
gRumbleLoopCounter = 0;
|
||||
gRumbleSpeedMode = 2;
|
||||
gRumblePaused = 0;
|
||||
}
|
||||
|
||||
void sub_111C(void)
|
||||
void DisableGbPlayerRumble(void)
|
||||
{
|
||||
// TODO This probably wasn't the original code, but it matches.
|
||||
int *var0 = &gUnknown_02019BF4;
|
||||
int *var0 = &gSio32SerialEnabled;
|
||||
int val = 0;
|
||||
gUnknown_02019C00 = val;
|
||||
gUnknown_02019BEC = val;
|
||||
gRumbleCommand = val;
|
||||
gRumbleMotorMode = val;
|
||||
*var0 = val;
|
||||
gUnknown_02019BF0 = val;
|
||||
gUnknown_02019BFC = -1;
|
||||
gUnknown_02019BE4 = val;
|
||||
gUnknown_02019BE8 = val;
|
||||
gUnknown_02019BF8 = val;
|
||||
gUnknown_02019C08 = 2;
|
||||
gSio32ReconnectTimer = val;
|
||||
gRumblePatternPosition = -1;
|
||||
gRumbleLoopCounter = val;
|
||||
gRumbleFrameCounter = val;
|
||||
gRumblePatternIndex = val;
|
||||
gRumbleSpeedMode = 2;
|
||||
}
|
||||
|
||||
int sub_1170(void)
|
||||
int IsGbPlayerReady(void)
|
||||
{
|
||||
if (gGameBoyPlayerEnabled == 1)
|
||||
{
|
||||
u8 val = gUnknown_02019C10 - 4;
|
||||
u8 val = gSio32CommState - 4;
|
||||
if (val > 1)
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ int sub_1170(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
void sub_1198(void)
|
||||
void RestoreDefaultInterrupts(void)
|
||||
{
|
||||
gIntrTable[0] = SerialIntr;
|
||||
gIntrTable[1] = Timer3Intr;
|
||||
|
|
@ -156,31 +156,31 @@ void PlayRumble(int arg0)
|
|||
{
|
||||
if (gMain_saveData.rumbleEnabled)
|
||||
{
|
||||
gUnknown_02019BF8 = arg0;
|
||||
gUnknown_02019BFC = 0;
|
||||
gUnknown_02019BE4 = 0;
|
||||
gUnknown_02019BE8 = 0;
|
||||
gRumblePatternIndex = arg0;
|
||||
gRumblePatternPosition = 0;
|
||||
gRumbleLoopCounter = 0;
|
||||
gRumbleFrameCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_11E4(int arg0)
|
||||
void SetRumbleMode(int arg0)
|
||||
{
|
||||
gUnknown_02019C08 = arg0;
|
||||
gRumbleSpeedMode = arg0;
|
||||
}
|
||||
|
||||
void sub_11F0(int arg0)
|
||||
void SetRumblePaused(int arg0)
|
||||
{
|
||||
gUnknown_02019C04 = arg0;
|
||||
gRumblePaused = arg0;
|
||||
}
|
||||
|
||||
void sub_11FC(void)
|
||||
void ProcessRumbleFrame(void)
|
||||
{
|
||||
int var0;
|
||||
int var1;
|
||||
|
||||
if (gGameBoyPlayerEnabled == 1)
|
||||
{
|
||||
switch (gUnknown_02019C10)
|
||||
switch (gSio32CommState)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
|
|
@ -188,75 +188,75 @@ void sub_11FC(void)
|
|||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
if (gUnknown_02019BFC >= 0 && gUnknown_02019C08 && !gUnknown_02019C04)
|
||||
if (gRumblePatternPosition >= 0 && gRumbleSpeedMode && !gRumblePaused)
|
||||
{
|
||||
if (!(gUnknown_02019BE8 & 1))
|
||||
if (!(gRumbleFrameCounter & 1))
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
var0 = gUnknown_086A4C44[gUnknown_02019BF8][gUnknown_02019BFC++];
|
||||
var1 = gUnknown_086A4C44[gUnknown_02019BF8][gUnknown_02019BFC];
|
||||
var0 = gRumblePatterns[gRumblePatternIndex][gRumblePatternPosition++];
|
||||
var1 = gRumblePatterns[gRumblePatternIndex][gRumblePatternPosition];
|
||||
if (var0 == -1)
|
||||
{
|
||||
gUnknown_02019BFC = var0;
|
||||
gUnknown_02019C00 = 0;
|
||||
gRumblePatternPosition = var0;
|
||||
gRumbleCommand = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (var0 < -1)
|
||||
{
|
||||
if (gUnknown_02019BE4)
|
||||
if (gRumbleLoopCounter)
|
||||
{
|
||||
if (--gUnknown_02019BE4 == 0)
|
||||
if (--gRumbleLoopCounter == 0)
|
||||
{
|
||||
gUnknown_02019BFC++;
|
||||
gRumblePatternPosition++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_02019BFC--;
|
||||
gUnknown_02019BFC -= var1;
|
||||
gRumblePatternPosition--;
|
||||
gRumblePatternPosition -= var1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_02019BE4 = ~var0;
|
||||
gUnknown_02019BFC--;
|
||||
gUnknown_02019BFC -= var1;
|
||||
gRumbleLoopCounter = ~var0;
|
||||
gRumblePatternPosition--;
|
||||
gRumblePatternPosition -= var1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_02019C00 = var0;
|
||||
gRumbleCommand = var0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (gUnknown_02019BE8 % 2 == 1 && gUnknown_02019C08 == 1)
|
||||
else if (gRumbleFrameCounter % 2 == 1 && gRumbleSpeedMode == 1)
|
||||
{
|
||||
gUnknown_02019C00 = 0;
|
||||
gRumbleCommand = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_02019C00 = 0;
|
||||
gRumbleCommand = 0;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (++gUnknown_02019BF0 > 60)
|
||||
if (++gSio32ReconnectTimer > 60)
|
||||
{
|
||||
if (gUnknown_02019BF4)
|
||||
sub_1340();
|
||||
if (gSio32SerialEnabled)
|
||||
InitSio32Hardware();
|
||||
|
||||
gUnknown_02019BF0 = 0;
|
||||
gSio32ReconnectTimer = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gUnknown_02019BE8++;
|
||||
gRumbleFrameCounter++;
|
||||
}
|
||||
|
||||
void sub_1340(void)
|
||||
void InitSio32Hardware(void)
|
||||
{
|
||||
REG_IME = 0;
|
||||
REG_IE &= ~(INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL);
|
||||
|
|
@ -269,8 +269,8 @@ void sub_1340(void)
|
|||
REG_IE |= INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL;
|
||||
REG_IME = INTR_FLAG_VBLANK;
|
||||
REG_SIOCNT_L &= -2;
|
||||
gUnknown_02019C10 = 0;
|
||||
CpuFill32(0, &gUnknown_02002808, 0xC);
|
||||
gSio32CommState = 0;
|
||||
CpuFill32(0, &gSio32Id, 0xC);
|
||||
REG_IME = 0;
|
||||
REG_SIOCNT |= SIO_MULTI_BUSY;
|
||||
REG_IME = INTR_FLAG_VBLANK;
|
||||
|
|
@ -283,129 +283,129 @@ void sub_1340(void)
|
|||
void Sio32IDIntr(void)
|
||||
{
|
||||
s32 iVar6;
|
||||
gUnknown_02002818 = REG_SIODATA32;
|
||||
gSio32ReceivedData = REG_SIODATA32;
|
||||
REG_TM3CNT_H = 0;
|
||||
REG_TM3CNT_L = 0x8000;
|
||||
|
||||
switch (gUnknown_02019C10)
|
||||
switch (gSio32CommState)
|
||||
{
|
||||
case 0: {
|
||||
u32 receiverChunk = REG_SIODATA32;
|
||||
u32 senderChunk;
|
||||
senderChunk = receiverChunk << 16 * gUnknown_02002808.MS_mode >> 16;
|
||||
receiverChunk = receiverChunk << 16 * (1 - gUnknown_02002808.MS_mode) >> 16;
|
||||
if (gUnknown_02002808.lastId == 0)
|
||||
senderChunk = receiverChunk << 16 * gSio32Id.MS_mode >> 16;
|
||||
receiverChunk = receiverChunk << 16 * (1 - gSio32Id.MS_mode) >> 16;
|
||||
if (gSio32Id.lastId == 0)
|
||||
{
|
||||
if ((u16) senderChunk == gUnknown_02002808.recv_id)
|
||||
if ((u16) senderChunk == gSio32Id.recv_id)
|
||||
{
|
||||
if (gUnknown_02002808.count < 4)
|
||||
if (gSio32Id.count < 4)
|
||||
{
|
||||
if (gUnknown_02002808.recv_id == (u16)~gUnknown_02002808.send_id)
|
||||
if (gSio32Id.recv_id == (u16)~gSio32Id.send_id)
|
||||
{
|
||||
if ((u16) receiverChunk == (u16)~gUnknown_02002808.recv_id)
|
||||
++gUnknown_02002808.count;
|
||||
if ((u16) receiverChunk == (u16)~gSio32Id.recv_id)
|
||||
++gSio32Id.count;
|
||||
}
|
||||
// goto green
|
||||
}
|
||||
else // blue
|
||||
{
|
||||
gUnknown_02002808.lastId = receiverChunk;
|
||||
gSio32Id.lastId = receiverChunk;
|
||||
if (receiverChunk == 0x8002)
|
||||
{
|
||||
gUnknown_02019C10 = 1;
|
||||
gUnknown_02002814 = sub_1748(1);
|
||||
REG_SIODATA32 = gUnknown_02002814;
|
||||
gUnknown_02002808.count = 0;
|
||||
gSio32CommState = 1;
|
||||
gSio32SendData = Sio32BuildCommand(1);
|
||||
REG_SIODATA32 = gSio32SendData;
|
||||
gSio32Id.count = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_02002808.lastId = 0;
|
||||
gUnknown_02002808.count = 0;
|
||||
gSio32Id.lastId = 0;
|
||||
gSio32Id.count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_02002808.count = 0;
|
||||
gSio32Id.count = 0;
|
||||
}
|
||||
}
|
||||
// green
|
||||
if (gUnknown_02002808.count < 4)
|
||||
if (gSio32Id.count < 4)
|
||||
{
|
||||
gUnknown_02002808.send_id = *(gUnknown_02002808.count + Sio32ConnectionData); // oh no
|
||||
gSio32Id.send_id = *(gSio32Id.count + Sio32ConnectionData); // oh no
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_02002808.send_id = 0x8000;
|
||||
gSio32Id.send_id = 0x8000;
|
||||
}
|
||||
gUnknown_02002808.recv_id = ~receiverChunk;
|
||||
gSio32Id.recv_id = ~receiverChunk;
|
||||
REG_SIODATA32 =
|
||||
(gUnknown_02002808.send_id << ((1 - gUnknown_02002808.MS_mode) << 4)) +
|
||||
(gUnknown_02002808.recv_id << (gUnknown_02002808.MS_mode << 4));
|
||||
(gSio32Id.send_id << ((1 - gSio32Id.MS_mode) << 4)) +
|
||||
(gSio32Id.recv_id << (gSio32Id.MS_mode << 4));
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
iVar6 = sub_16A0(gUnknown_02019C10);
|
||||
iVar6 = Sio32ValidateResponse(gSio32CommState);
|
||||
if (iVar6 != 0)
|
||||
{
|
||||
u32 stack_temp;
|
||||
gUnknown_02002808.count = 0;
|
||||
gSio32Id.count = 0;
|
||||
stack_temp = 0;
|
||||
CpuSet(&stack_temp, &gUnknown_02002808, 0x5000003);
|
||||
gUnknown_02019C10 = 0;
|
||||
CpuSet(&stack_temp, &gSio32Id, 0x5000003);
|
||||
gSio32CommState = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_02019C10 = 2;
|
||||
gSio32CommState = 2;
|
||||
}
|
||||
|
||||
if (gUnknown_02019BF4 == 0)
|
||||
if (gSio32SerialEnabled == 0)
|
||||
{
|
||||
gUnknown_02019C10 = 4;
|
||||
gSio32CommState = 4;
|
||||
}
|
||||
gUnknown_02002814 = sub_1748(gUnknown_02019C10);
|
||||
REG_SIODATA32 = gUnknown_02002814;
|
||||
gSio32SendData = Sio32BuildCommand(gSio32CommState);
|
||||
REG_SIODATA32 = gSio32SendData;
|
||||
break;
|
||||
case 2:
|
||||
iVar6 = sub_16A0(gUnknown_02019C10);
|
||||
iVar6 = Sio32ValidateResponse(gSio32CommState);
|
||||
if (iVar6 != 0)
|
||||
{
|
||||
u32 stack_temp;
|
||||
gUnknown_02002808.count = 0;
|
||||
gSio32Id.count = 0;
|
||||
stack_temp = 0;
|
||||
CpuSet(&stack_temp, &gUnknown_02002808, 0x5000003);
|
||||
gUnknown_02019C10 = 0;
|
||||
CpuSet(&stack_temp, &gSio32Id, 0x5000003);
|
||||
gSio32CommState = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_02019C10 = 3;
|
||||
gSio32CommState = 3;
|
||||
}
|
||||
|
||||
if (gUnknown_02019BF4 == 0)
|
||||
if (gSio32SerialEnabled == 0)
|
||||
{
|
||||
gUnknown_02019C10 = 4;
|
||||
gSio32CommState = 4;
|
||||
}
|
||||
gUnknown_02002814 = sub_1748(gUnknown_02019C10);
|
||||
REG_SIODATA32 = gUnknown_02002814;
|
||||
gSio32SendData = Sio32BuildCommand(gSio32CommState);
|
||||
REG_SIODATA32 = gSio32SendData;
|
||||
break;
|
||||
case 3:
|
||||
iVar6 = sub_16A0(gUnknown_02019C10);
|
||||
iVar6 = Sio32ValidateResponse(gSio32CommState);
|
||||
if (iVar6 != 0)
|
||||
{
|
||||
u32 stack_temp;
|
||||
gUnknown_02002808.count = 0;
|
||||
gSio32Id.count = 0;
|
||||
stack_temp = 0;
|
||||
CpuSet(&stack_temp, &gUnknown_02002808, 0x5000003);
|
||||
gUnknown_02019C10 = 0;
|
||||
CpuSet(&stack_temp, &gSio32Id, 0x5000003);
|
||||
gSio32CommState = 0;
|
||||
}
|
||||
|
||||
if (gUnknown_02019BF4 == 0)
|
||||
if (gSio32SerialEnabled == 0)
|
||||
{
|
||||
gUnknown_02019C10 = 4;
|
||||
gSio32CommState = 4;
|
||||
}
|
||||
gUnknown_02002814 = sub_1748(gUnknown_02019C10);
|
||||
REG_SIODATA32 = gUnknown_02002814;
|
||||
gSio32SendData = Sio32BuildCommand(gSio32CommState);
|
||||
REG_SIODATA32 = gSio32SendData;
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
|
|
@ -420,7 +420,7 @@ void Sio32IDIntr(void)
|
|||
REG_TM3CNT_H = 0xC1;
|
||||
}
|
||||
|
||||
u32 sub_1668(u32 arg1, u32 arg2)
|
||||
u32 Sio32EncodePacket(u32 arg1, u32 arg2)
|
||||
{
|
||||
u8 uVar1;
|
||||
u32 uVar2;
|
||||
|
|
@ -441,13 +441,13 @@ u32 sub_1668(u32 arg1, u32 arg2)
|
|||
return uVar2;
|
||||
}
|
||||
|
||||
u32 sub_16A0(u8 param_1)
|
||||
u32 Sio32ValidateResponse(u8 param_1)
|
||||
{
|
||||
s8 cVar1;
|
||||
u32 uVar3;
|
||||
|
||||
uVar3 = gUnknown_02002818 >> 0x1C;
|
||||
cVar1 = sub_170C();
|
||||
uVar3 = gSio32ReceivedData >> 0x1C;
|
||||
cVar1 = Sio32VerifyChecksum();
|
||||
|
||||
if (cVar1) return 1;
|
||||
switch (param_1)
|
||||
|
|
@ -456,8 +456,8 @@ u32 sub_16A0(u8 param_1)
|
|||
return 1;
|
||||
case 1:
|
||||
{
|
||||
u32 *r1 = &gUnknown_0200281C;
|
||||
u32 r0 = (gUnknown_02002818 << 4) >> 8;
|
||||
u32 *r1 = &gSio32RemoteDeviceId;
|
||||
u32 r0 = (gSio32ReceivedData << 4) >> 8;
|
||||
*r1 = r0 & 1;
|
||||
if (uVar3 != 1) return 1;
|
||||
}
|
||||
|
|
@ -466,8 +466,8 @@ u32 sub_16A0(u8 param_1)
|
|||
if (uVar3 != 2)
|
||||
return 1;
|
||||
{
|
||||
u32* r0 = &gUnknown_0200281C;
|
||||
u32 r1 = (gUnknown_02002818 << 4) >> 8;
|
||||
u32* r0 = &gSio32RemoteDeviceId;
|
||||
u32 r1 = (gSio32ReceivedData << 4) >> 8;
|
||||
if (*r0 != r1) return 1;
|
||||
}
|
||||
break;
|
||||
|
|
@ -478,7 +478,7 @@ u32 sub_16A0(u8 param_1)
|
|||
return 0;
|
||||
}
|
||||
|
||||
u32 sub_170C(void)
|
||||
u32 Sio32VerifyChecksum(void)
|
||||
{
|
||||
u8 uVar1;
|
||||
u32 uVar2;
|
||||
|
|
@ -486,9 +486,9 @@ u32 sub_170C(void)
|
|||
u32 uVar4;
|
||||
u32 uVar5;
|
||||
|
||||
uVar2 = gUnknown_02002818 / 16;
|
||||
uVar2 = gSio32ReceivedData / 16;
|
||||
++uVar2; --uVar2;
|
||||
uVar3 = gUnknown_02002818 % 16;
|
||||
uVar3 = gSio32ReceivedData % 16;
|
||||
uVar4 = uVar2 >> 0x18;
|
||||
|
||||
for (uVar1 = 6; uVar1 != 0; uVar1--)
|
||||
|
|
@ -508,7 +508,7 @@ u32 sub_170C(void)
|
|||
}
|
||||
}
|
||||
|
||||
u32 sub_1748(u8 param_1)
|
||||
u32 Sio32BuildCommand(u8 param_1)
|
||||
{
|
||||
u32 uVar1;
|
||||
u32 uVar2;
|
||||
|
|
@ -517,22 +517,22 @@ u32 sub_1748(u8 param_1)
|
|||
switch (param_1)
|
||||
{
|
||||
case 2:
|
||||
uVar1 = gUnknown_0200281C;
|
||||
uVar1 = gSio32RemoteDeviceId;
|
||||
uVar2 = 2;
|
||||
goto case_fallthrough;
|
||||
case 3:
|
||||
if (gUnknown_02019C00 == 0)
|
||||
if (gRumbleCommand == 0)
|
||||
{
|
||||
uVar1 = sub_17D8(0);
|
||||
param_3 = sub_1668(uVar1, 4);
|
||||
uVar1 = EncodeRumbleCommand(0);
|
||||
param_3 = Sio32EncodePacket(uVar1, 4);
|
||||
}
|
||||
if (gUnknown_02019C00 == 1)
|
||||
if (gRumbleCommand == 1)
|
||||
{
|
||||
uVar1 = sub_17D8(1);
|
||||
param_3 = sub_1668(uVar1, 4);
|
||||
uVar1 = EncodeRumbleCommand(1);
|
||||
param_3 = Sio32EncodePacket(uVar1, 4);
|
||||
}
|
||||
if (gUnknown_02019C00 != 2) break;
|
||||
uVar1 = sub_17D8(2);
|
||||
if (gRumbleCommand != 2) break;
|
||||
uVar1 = EncodeRumbleCommand(2);
|
||||
uVar2 = 4;
|
||||
goto case_fallthrough;
|
||||
case 1:
|
||||
|
|
@ -541,17 +541,17 @@ u32 sub_1748(u8 param_1)
|
|||
uVar1 = 1;
|
||||
uVar2 = 1;
|
||||
case_fallthrough: // Fairly confident that this is not in fact a fakematch, due to the break above
|
||||
param_3 = sub_1668(uVar1, uVar2);
|
||||
param_3 = Sio32EncodePacket(uVar1, uVar2);
|
||||
}
|
||||
|
||||
return param_3;
|
||||
}
|
||||
|
||||
u32 sub_17D8(u32 arg1)
|
||||
u32 EncodeRumbleCommand(u32 arg1)
|
||||
{
|
||||
u32 retVal;
|
||||
|
||||
switch (gUnknown_02019BEC)
|
||||
switch (gRumbleMotorMode)
|
||||
{
|
||||
case 0:
|
||||
retVal = arg1;
|
||||
|
|
@ -572,7 +572,7 @@ u32 sub_17D8(u32 arg1)
|
|||
return retVal;
|
||||
}
|
||||
|
||||
void sub_1828(void)
|
||||
void Sio32TimeoutIntr(void)
|
||||
{
|
||||
// TODO macro?
|
||||
REG_IME = 0;
|
||||
|
|
@ -586,5 +586,5 @@ void sub_1828(void)
|
|||
REG_TM3CNT_H = 0;
|
||||
REG_TM3CNT_L = 0x8000;
|
||||
|
||||
gUnknown_02019C10 = 5;
|
||||
gSio32CommState = 5;
|
||||
}
|
||||
|
|
|
|||
1474
src/high_scores.c
1474
src/high_scores.c
File diff suppressed because it is too large
Load Diff
2202
src/intro.c
2202
src/intro.c
File diff suppressed because it is too large
Load Diff
110
src/link.c
110
src/link.c
|
|
@ -87,7 +87,7 @@ enum
|
|||
|
||||
// static function declarations
|
||||
static void EnableSerial(void);
|
||||
static void sub_19CC(void);
|
||||
static void LinkMainCallback(void);
|
||||
static void LinkVBlankIntr(void);
|
||||
static void nullsub_15(void);
|
||||
static void CheckMasterOrSlave(void);
|
||||
|
|
@ -112,13 +112,13 @@ extern u8 sChecksumAvailable;
|
|||
extern u16 gLinkSavedIme;
|
||||
extern u8 sNumVBlanksWithoutSerialIntr;
|
||||
extern u8 sSendBufferEmpty;
|
||||
extern u8 gUnknown_02002826;
|
||||
extern u8 gUnknown_02002827; // sHandshakePlayerCount ?
|
||||
extern u8 sLinkFlowControlDelay;
|
||||
extern u8 sHandshakePlayerCount; // sHandshakePlayerCount ?
|
||||
extern u16 sSendNonzeroCheck;
|
||||
extern u16 gUnknown_0200282A;
|
||||
extern u16 sRecvNonzeroCheck;
|
||||
extern u8 gLastSendQueueCount;
|
||||
extern u8 gUnknown_0202A554; // ???
|
||||
extern s8 gUnknown_0202C5E0;
|
||||
extern u8 sRecvQueueSnapshot; // ???
|
||||
extern s8 sLinkMasterHandshakeState;
|
||||
|
||||
// static const definitions
|
||||
|
||||
|
|
@ -131,7 +131,7 @@ static void EnableSerial(void)
|
|||
REG_SIOCNT |= SIO_115200_BPS | SIO_INTR_ENABLE;
|
||||
|
||||
gLinkSavedIme = REG_IME;
|
||||
SetMainCallback(sub_19CC);
|
||||
SetMainCallback(LinkMainCallback);
|
||||
SetVBlankIntrFunc(LinkVBlankIntr);
|
||||
REG_IME = 0;
|
||||
REG_IE |= INTR_FLAG_SERIAL;
|
||||
|
|
@ -143,30 +143,30 @@ static void EnableSerial(void)
|
|||
|
||||
sNumVBlanksWithoutSerialIntr = 0;
|
||||
sSendBufferEmpty = 0;
|
||||
gUnknown_02002827 = 0;
|
||||
sHandshakePlayerCount = 0;
|
||||
gLastSendQueueCount = 0;
|
||||
gUnknown_0202A554 = 0;
|
||||
gUnknown_0202C5E0 = 0;
|
||||
gUnknown_0202ADD0 = 0;
|
||||
gUnknown_0201A444 = 0;
|
||||
gUnknown_0202BDF0 = 0;
|
||||
gUnknown_0201C1AC = 0;
|
||||
gUnknown_0202ADDC = 0;
|
||||
gUnknown_0202BEC8 = 0;
|
||||
sRecvQueueSnapshot = 0;
|
||||
sLinkMasterHandshakeState = 0;
|
||||
gLinkStatusResult = 0;
|
||||
gLinkTimeoutCounter = 0;
|
||||
gLinkConnectionState = 0;
|
||||
gLinkPlayerCount = 0;
|
||||
gLinkNegotiationFlags = 0;
|
||||
gLinkAdvanceState = 0;
|
||||
sChecksumAvailable = 0;
|
||||
sSendNonzeroCheck = 0;
|
||||
gUnknown_0200282A = 0;
|
||||
sRecvNonzeroCheck = 0;
|
||||
}
|
||||
|
||||
extern void sub_19B4(void) // TODO
|
||||
extern void InitLinkHardware(void) // TODO
|
||||
{
|
||||
sub_24DC();
|
||||
sub_250C();
|
||||
ResetSerialIO();
|
||||
SetupDefaultInterrupts();
|
||||
EnableSerial();
|
||||
DisableSerial();
|
||||
}
|
||||
|
||||
static void sub_19CC(void) // TODO
|
||||
static void LinkMainCallback(void) // TODO
|
||||
{
|
||||
if ((REG_DISPSTAT & 0x8) != 0)
|
||||
{
|
||||
|
|
@ -182,7 +182,7 @@ static void sub_19CC(void) // TODO
|
|||
REG_BG3HOFS = gMain.bgOffsets[3].xOffset;
|
||||
REG_BG3VOFS = gMain.bgOffsets[3].yOffset;
|
||||
|
||||
if (gMain.unk36)
|
||||
if (gMain.blendEnabled)
|
||||
{
|
||||
REG_BLDCNT = gMain.blendControl;
|
||||
REG_BLDALPHA = gMain.blendAlpha;
|
||||
|
|
@ -238,16 +238,16 @@ extern s32 LinkMain1(u8 *shouldAdvanceLinkState, s16 *sendCmd, u16 (*recvCmds)[M
|
|||
{
|
||||
default:
|
||||
CheckMasterOrSlave();
|
||||
if (gUnknown_0202C5E0 == 0 && gLink.isMaster && gLink.playerCount == 2)
|
||||
if (sLinkMasterHandshakeState == 0 && gLink.isMaster && gLink.playerCount == 2)
|
||||
{
|
||||
gLink.handshakeAsMaster = TRUE;
|
||||
gUnknown_0202C5E0 = -1;
|
||||
sLinkMasterHandshakeState = -1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (gLink.isMaster != LINK_SLAVE && gLink.playerCount == 2)
|
||||
gLink.handshakeAsMaster = TRUE;
|
||||
gUnknown_0202C5E0 = -1;
|
||||
sLinkMasterHandshakeState = -1;
|
||||
break;
|
||||
case 2:
|
||||
gLink.state = LINK_STATE_START0;
|
||||
|
|
@ -260,7 +260,7 @@ extern s32 LinkMain1(u8 *shouldAdvanceLinkState, s16 *sendCmd, u16 (*recvCmds)[M
|
|||
gLink.state = LINK_STATE_CONN_ESTABLISHED;
|
||||
// fallthrough
|
||||
case LINK_STATE_CONN_ESTABLISHED:
|
||||
if (gLink.unkE == 0)
|
||||
if (gLink.sendPaused == 0)
|
||||
{
|
||||
EnqueueSendCmd(sendCmd);
|
||||
}
|
||||
|
|
@ -277,11 +277,11 @@ extern s32 LinkMain1(u8 *shouldAdvanceLinkState, s16 *sendCmd, u16 (*recvCmds)[M
|
|||
|
||||
{
|
||||
u32 receivedNothing = gLink.receivedNothing << 8;
|
||||
u32 unk11 = gLink.unk11 << 9;
|
||||
u32 checksumError = gLink.checksumError << 9;
|
||||
u32 hardwareError = gLink.hardwareError << 0x10;
|
||||
u32 unk13 = gLink.unk13 << 0x11;
|
||||
u32 invalidIdError = gLink.invalidIdError << 0x11;
|
||||
u32 queueFull = gLink.queueFull << 0x12;
|
||||
u32 unk15 = gLink.unk15 << 0x14;
|
||||
u32 lagError = gLink.lagError << 0x14;
|
||||
u32 val;
|
||||
|
||||
if (gLink.state == LINK_STATE_CONN_ESTABLISHED)
|
||||
|
|
@ -289,21 +289,21 @@ extern s32 LinkMain1(u8 *shouldAdvanceLinkState, s16 *sendCmd, u16 (*recvCmds)[M
|
|||
val = LINK_STAT_CONN_ESTABLISHED;
|
||||
val |= receivedNothing;
|
||||
val |= retVal;
|
||||
val |= unk11;
|
||||
val |= checksumError;
|
||||
val |= hardwareError;
|
||||
val |= unk13;
|
||||
val |= invalidIdError;
|
||||
val |= queueFull;
|
||||
val |= unk15;
|
||||
val |= lagError;
|
||||
}
|
||||
else
|
||||
{
|
||||
val = retVal;
|
||||
val |= receivedNothing;
|
||||
val |= unk11;
|
||||
val |= checksumError;
|
||||
val |= hardwareError;
|
||||
val |= unk13;
|
||||
val |= invalidIdError;
|
||||
val |= queueFull;
|
||||
val |= unk15;
|
||||
val |= lagError;
|
||||
}
|
||||
|
||||
retVal = val;
|
||||
|
|
@ -423,13 +423,13 @@ static void DequeueRecvCmds(u16 (*recvCmds)[MAX_LINK_PLAYERS])
|
|||
|
||||
static void LinkVSync(void)
|
||||
{
|
||||
if (gLink.unkE)
|
||||
if (gLink.sendPaused)
|
||||
{
|
||||
if (--gUnknown_02002826 != 0)
|
||||
if (--sLinkFlowControlDelay != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
gLink.unkE = 0;
|
||||
gLink.sendPaused = 0;
|
||||
}
|
||||
|
||||
if (gLink.isMaster)
|
||||
|
|
@ -441,14 +441,14 @@ static void LinkVSync(void)
|
|||
{
|
||||
if (!gLink.hardwareError)
|
||||
{
|
||||
gLink.unk15 = LAG_MASTER;
|
||||
gLink.lagError = LAG_MASTER;
|
||||
}
|
||||
else
|
||||
{
|
||||
StartTransfer();
|
||||
}
|
||||
}
|
||||
else if (gLink.unk15 == LAG_NONE)
|
||||
else if (gLink.lagError == LAG_NONE)
|
||||
{
|
||||
gLink.serialIntrCounter = 0;
|
||||
StartTransfer();
|
||||
|
|
@ -465,13 +465,13 @@ static void LinkVSync(void)
|
|||
{
|
||||
if (gLink.state == LINK_STATE_CONN_ESTABLISHED)
|
||||
{
|
||||
gLink.unk15 = LAG_SLAVE;
|
||||
gLink.lagError = LAG_SLAVE;
|
||||
}
|
||||
if (gLink.state == LINK_STATE_HANDSHAKE)
|
||||
{
|
||||
gLink.localId = 0;
|
||||
gLink.playerCount = 0;
|
||||
gLink.unk11 = FALSE;
|
||||
gLink.checksumError = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -518,7 +518,7 @@ extern void SerialCB(void)
|
|||
sNumVBlanksWithoutSerialIntr = 0;
|
||||
if (gLink.serialIntrCounter == 8)
|
||||
{
|
||||
gUnknown_0202A554 = gLink.recvQueue.count;
|
||||
sRecvQueueSnapshot = gLink.recvQueue.count;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -569,19 +569,19 @@ static bool8 DoHandshake(void)
|
|||
}
|
||||
}
|
||||
gLink.playerCount = playerCount;
|
||||
if (gLink.playerCount == 2 && gLink.playerCount == gUnknown_02002827 && gLink.handshakeBuffer[0] == MASTER_HANDSHAKE)
|
||||
if (gLink.playerCount == 2 && gLink.playerCount == sHandshakePlayerCount && gLink.handshakeBuffer[0] == MASTER_HANDSHAKE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if (gLink.playerCount == 2) // ???
|
||||
{
|
||||
gLink.unk11 = (minRecv & 3) + 1;
|
||||
gLink.checksumError = (minRecv & 3) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gLink.unk11 = 0;
|
||||
gLink.checksumError = 0;
|
||||
}
|
||||
gUnknown_02002827 = gLink.playerCount;
|
||||
sHandshakePlayerCount = gLink.playerCount;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -598,7 +598,7 @@ static void DoRecv(void)
|
|||
{
|
||||
if (gLink.checksum != recv[i] && sChecksumAvailable)
|
||||
{
|
||||
gLink.unk13 = TRUE;
|
||||
gLink.invalidIdError = TRUE;
|
||||
}
|
||||
}
|
||||
gLink.checksum = 0;
|
||||
|
|
@ -616,12 +616,12 @@ static void DoRecv(void)
|
|||
for (i = 0; i < gLink.playerCount; i++)
|
||||
{
|
||||
gLink.checksum += recv[i];
|
||||
gUnknown_0200282A |= recv[i];
|
||||
sRecvNonzeroCheck |= recv[i];
|
||||
gLink.recvQueue.data[i][gLink.recvCmdIndex][index] = recv[i];
|
||||
if ((gLink.sendCmdIndex == 1) && (gLink.unkE == 0) && ((recv[i] & 0xF) == 1))
|
||||
if ((gLink.sendCmdIndex == 1) && (gLink.sendPaused == 0) && ((recv[i] & 0xF) == 1))
|
||||
{
|
||||
gLink.unkE = 1;
|
||||
gUnknown_02002826 = 5;
|
||||
gLink.sendPaused = 1;
|
||||
sLinkFlowControlDelay = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -630,10 +630,10 @@ static void DoRecv(void)
|
|||
gLink.queueFull |= QUEUE_FULL_RECV;
|
||||
}
|
||||
gLink.recvCmdIndex++;
|
||||
if (gLink.recvCmdIndex == CMD_LENGTH && gUnknown_0200282A)
|
||||
if (gLink.recvCmdIndex == CMD_LENGTH && sRecvNonzeroCheck)
|
||||
{
|
||||
gLink.recvQueue.count++;
|
||||
gUnknown_0200282A = 0;
|
||||
sRecvNonzeroCheck = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -671,7 +671,7 @@ static void DoSend(void)
|
|||
{
|
||||
REG_SIOMLT_SEND = gLink.sendQueue.data[gLink.sendCmdIndex][gLink.sendQueue.pos];
|
||||
}
|
||||
if ((gLink.unkE == 0) && (gLink.sendCmdIndex == 0) && (3 < gLink.recvQueue.count)) {
|
||||
if ((gLink.sendPaused == 0) && (gLink.sendCmdIndex == 0) && (3 < gLink.recvQueue.count)) {
|
||||
REG_SIOMLT_SEND |= 1; // TODO
|
||||
}
|
||||
gLink.sendCmdIndex++;
|
||||
|
|
|
|||
|
|
@ -678,7 +678,7 @@ sub_522D0:
|
|||
ldr r1, [r4, o_SoundChannel_wav]
|
||||
add r2, r2, r1
|
||||
add r2, r2, 0x10
|
||||
ldr r5, =gUnknown_02002958
|
||||
ldr r5, =gDpcmSampleBuffer
|
||||
ldr r6, =0x852D918 @ gDeltaEncodingTable
|
||||
mov r7, 0x40
|
||||
ldrb lr, [r2], 1
|
||||
|
|
@ -699,7 +699,7 @@ _081DD57C:
|
|||
subs r7, r7, 2
|
||||
bgt _081DD568
|
||||
_081DD594:
|
||||
ldr r5, =gUnknown_02002958
|
||||
ldr r5, =gDpcmSampleBuffer
|
||||
and r0, r3, 0x3F
|
||||
ldrsb r1, [r5, r0]
|
||||
pop {r0,r2,r5-r7,pc}
|
||||
|
|
|
|||
38
src/main.c
38
src/main.c
|
|
@ -5,7 +5,7 @@
|
|||
#include "m4a.h"
|
||||
|
||||
static void InitGame(void);
|
||||
static void sub_0B8C(void);
|
||||
static void InitMainState(void);
|
||||
static void InitIntrHandlers(void);
|
||||
static void ReadKeys(void);
|
||||
|
||||
|
|
@ -30,8 +30,8 @@ void Main_09BC(void)
|
|||
switch (gMain.subState)
|
||||
{
|
||||
case 0:
|
||||
sub_0CBC();
|
||||
sub_024C();
|
||||
EnableVBlankInterrupts();
|
||||
FadeInScreen();
|
||||
gMain.subState++;
|
||||
break;
|
||||
case 1:
|
||||
|
|
@ -39,8 +39,8 @@ void Main_09BC(void)
|
|||
gMain.subState = 2;
|
||||
break;
|
||||
default:
|
||||
sub_02B4();
|
||||
sub_0D10();
|
||||
FadeOutScreen();
|
||||
DisableVBlankInterrupts();
|
||||
SetMainGameState(STATE_TITLE);
|
||||
break;
|
||||
}
|
||||
|
|
@ -59,11 +59,11 @@ void VCountIntr(void)
|
|||
if (gMain.mainState == STATE_GAME_MAIN)
|
||||
{
|
||||
REG_BG0HOFS = 0;
|
||||
if (gMain.unk28)
|
||||
if (gMain.shopPanelActive)
|
||||
{
|
||||
if (gMain.vCount == 72)
|
||||
{
|
||||
REG_BG0VOFS = gMain.unk2A * 4 + 88;
|
||||
REG_BG0VOFS = gMain.shopPanelSlideOffset * 4 + 88;
|
||||
gMain.vCount = 144;
|
||||
REG_DISPSTAT &= 0xFF;
|
||||
REG_DISPSTAT |= (gMain.vCount << 8) + DISPSTAT_VCOUNT_INTR;
|
||||
|
|
@ -76,7 +76,7 @@ void VCountIntr(void)
|
|||
REG_DISPSTAT |= (gMain.vCount << 8) + DISPSTAT_VCOUNT_INTR;
|
||||
}
|
||||
}
|
||||
else if (gMain.unk2C)
|
||||
else if (gMain.scoreOverlayActive)
|
||||
{
|
||||
if (gMain.vCount == 40)
|
||||
{
|
||||
|
|
@ -137,13 +137,13 @@ static void InitGame(void)
|
|||
| WAITCNT_SRAM_2;
|
||||
REG_IE = INTR_FLAG_GAMEPAK;
|
||||
REG_IME = INTR_FLAG_VBLANK;
|
||||
sub_0B8C();
|
||||
InitMainState();
|
||||
m4aSoundInit();
|
||||
m4aSoundVSyncOff();
|
||||
SaveFile_LoadGameData();
|
||||
}
|
||||
|
||||
static void sub_0B8C(void)
|
||||
static void InitMainState(void)
|
||||
{
|
||||
gMain.mainState = STATE_INTRO;
|
||||
gMain.subState = 0;
|
||||
|
|
@ -153,11 +153,11 @@ static void sub_0B8C(void)
|
|||
gMain.unk20 = 0;
|
||||
gMain.rngValue = 0;
|
||||
gMain.systemFrameCount = 0;
|
||||
gMain.unk30 = 0;
|
||||
gMain.idleDemoVariant = 0;
|
||||
gMain.vCount = 144;
|
||||
gMain.unk2C = 0;
|
||||
gMain.scoreOverlayActive = 0;
|
||||
ClearHighScoreNameEntry();
|
||||
ResetSomeGraphicsRelatedStuff();
|
||||
ResetDisplayState();
|
||||
}
|
||||
|
||||
static void InitIntrHandlers(void)
|
||||
|
|
@ -211,7 +211,7 @@ static void ReadKeys(void)
|
|||
gMain.heldKeys = keyInput;
|
||||
}
|
||||
|
||||
void sub_0CBC(void)
|
||||
void EnableVBlankInterrupts(void)
|
||||
{
|
||||
if (!(REG_IE & INTR_FLAG_VBLANK))
|
||||
{
|
||||
|
|
@ -237,7 +237,7 @@ void sub_0CBC(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_0D10(void)
|
||||
void DisableVBlankInterrupts(void)
|
||||
{
|
||||
REG_DISPSTAT &= ~DISPSTAT_VBLANK_INTR;
|
||||
REG_DISPSTAT &= ~DISPSTAT_VCOUNT_INTR;
|
||||
|
|
@ -277,9 +277,9 @@ void sub_0D10(void)
|
|||
|
||||
void MainLoopIter(void)
|
||||
{
|
||||
gMainCallback = gUnknown_02017BD4;
|
||||
*gVBlankIntrFuncPtr = gUnknown_02017BD0;
|
||||
*gVCountIntrFuncPtr = gUnknown_0200FBA0;
|
||||
gMainCallback = gMainCallbackShadow;
|
||||
*gVBlankIntrFuncPtr = gVBlankIntrFuncShadow;
|
||||
*gVCountIntrFuncPtr = gVCountIntrFuncShadow;
|
||||
if (gMainCallback)
|
||||
gMainCallback();
|
||||
|
||||
|
|
@ -301,7 +301,7 @@ void DefaultMainCallback(void)
|
|||
REG_BG2VOFS = gMain.bgOffsets[2].yOffset;
|
||||
REG_BG3HOFS = gMain.bgOffsets[3].xOffset;
|
||||
REG_BG3VOFS = gMain.bgOffsets[3].yOffset;
|
||||
if (gMain.unk36)
|
||||
if (gMain.blendEnabled)
|
||||
{
|
||||
REG_BLDCNT = gMain.blendControl;
|
||||
REG_BLDALPHA = gMain.blendAlpha;
|
||||
|
|
|
|||
398
src/options.c
398
src/options.c
|
|
@ -37,10 +37,10 @@ enum CursorPositions
|
|||
struct OptionsData
|
||||
{
|
||||
s16 stateMain;
|
||||
u16 unk2;
|
||||
u16 unk4;
|
||||
u16 unk6;
|
||||
s16 unk8;
|
||||
u16 cursorBlinkToggle;
|
||||
u16 soundTestBlinkToggle;
|
||||
u16 buttonFlashVisible;
|
||||
s16 buttonFlashTimer;
|
||||
s16 cursorPosition;
|
||||
u16 buttonConfigType;
|
||||
s16 selectedBGM;
|
||||
|
|
@ -52,23 +52,23 @@ struct OptionsData
|
|||
u8 digit10sSE;
|
||||
u8 digit1sSE;
|
||||
s16 scollWaitFrames;
|
||||
u8 unk1A[6];
|
||||
s16 unk20;
|
||||
s16 unk22;
|
||||
s16 unk24[2];
|
||||
s16 unk28;
|
||||
u8 buttonEditFlags[6];
|
||||
s16 captureFramesRemaining;
|
||||
s16 capturedKeysMask;
|
||||
s16 capturedButtonSlots[2];
|
||||
s16 capturedButtonCount;
|
||||
bool8 rumbleEnabled;
|
||||
s8 unk2B;
|
||||
s8 unk2C;
|
||||
u8 unk2D;
|
||||
s8 unk2E;
|
||||
u8 unk2F;
|
||||
u8 unk30;
|
||||
s8 rumbleAnimTimer;
|
||||
s8 rumbleAnimFrame;
|
||||
u8 rumbleAnimTileId;
|
||||
s8 rumbleAnimActive;
|
||||
u8 rumbleIdleBlinkState;
|
||||
u8 soundTestActive;
|
||||
};
|
||||
|
||||
extern struct OptionsData gOptionsData;
|
||||
extern s16 gMain_saveData_customButtonConfig[][2];
|
||||
extern u8 gUnknown_02031B18[];
|
||||
extern u8 gCustomButtonConfigTileIds[];
|
||||
|
||||
extern const u16 gOptionsBackground_Pals[];
|
||||
extern const u8 gOptionsText_Gfx[];
|
||||
|
|
@ -83,7 +83,7 @@ void Options_Main(void)
|
|||
|
||||
void Options_LoadGraphics(void)
|
||||
{
|
||||
ResetSomeGraphicsRelatedStuff();
|
||||
ResetDisplayState();
|
||||
|
||||
REG_DISPCNT = 0x1080;
|
||||
REG_BG0CNT = 4;
|
||||
|
|
@ -96,8 +96,8 @@ void Options_LoadGraphics(void)
|
|||
DmaCopy16(3, gOptionsBackground_Pals, (void *)PLTT, 0x200);
|
||||
DmaCopy16(3, gOptionsText_Gfx, (void *)(VRAM + 0x4000), 0x1800);
|
||||
DmaCopy16(3, gOptionsBackground_Gfx, (void *)(VRAM + 0x8000), 0xC00);
|
||||
DmaCopy16(3, gOptionsText_Tilemap, gUnknown_03005C00, 0x800);
|
||||
DmaCopy16(3, gUnknown_03005C00, (void *)VRAM, 0x800);
|
||||
DmaCopy16(3, gOptionsText_Tilemap, gBG0TilemapBuffer, 0x800);
|
||||
DmaCopy16(3, gBG0TilemapBuffer, (void *)VRAM, 0x800);
|
||||
|
||||
if (gGameBoyPlayerEnabled != TRUE)
|
||||
{
|
||||
|
|
@ -105,16 +105,16 @@ void Options_LoadGraphics(void)
|
|||
SetStringPalette(18, 5, 3, 2, 2);
|
||||
}
|
||||
|
||||
DmaCopy16(3, gUnknown_03005C00, (void *)VRAM, 0x800);
|
||||
DmaCopy16(3, gBG0TilemapBuffer, (void *)VRAM, 0x800);
|
||||
DmaCopy16(3, gOptionsBackground_Tilemap, (void *)(VRAM + 0x800), 0x800);
|
||||
DmaCopy16(3, gGBAButtonIcons_Pals, (void *)(PLTT + 0x200), 0x60);
|
||||
DmaCopy16(3, gOptionsSprites_Gfx, (void *)(VRAM + 0x10000), 0x2020);
|
||||
Options_InitStates();
|
||||
sub_51C9C();
|
||||
UpdateOptionsSpritePositions();
|
||||
m4aMPlayAllStop();
|
||||
sub_0CBC();
|
||||
sub_024C();
|
||||
sub_10C0();
|
||||
EnableVBlankInterrupts();
|
||||
FadeInScreen();
|
||||
EnableGbPlayerRumble();
|
||||
|
||||
gMain.subState++;
|
||||
}
|
||||
|
|
@ -125,10 +125,10 @@ void Options_InitStates(void)
|
|||
int j;
|
||||
|
||||
gOptionsData.stateMain = OPTIONS_STATE_MAIN;
|
||||
gOptionsData.unk2 = 0;
|
||||
gOptionsData.unk4 = 0;
|
||||
gOptionsData.unk6 = 1;
|
||||
gOptionsData.unk8 = 0;
|
||||
gOptionsData.cursorBlinkToggle = 0;
|
||||
gOptionsData.soundTestBlinkToggle = 0;
|
||||
gOptionsData.buttonFlashVisible = 1;
|
||||
gOptionsData.buttonFlashTimer = 0;
|
||||
gOptionsData.cursorPosition = CURSOR_POS_BGM;
|
||||
gOptionsData.buttonConfigType = gMain_saveData.buttonConfigType;
|
||||
gOptionsData.selectedBGM = 0;
|
||||
|
|
@ -141,18 +141,18 @@ void Options_InitStates(void)
|
|||
gOptionsData.digit1sSE = 1;
|
||||
gOptionsData.scollWaitFrames = 0;
|
||||
for (i = 0; i < 6; i++)
|
||||
gOptionsData.unk1A[i] = 0;
|
||||
gOptionsData.unk20 = 0;
|
||||
gOptionsData.unk22 = 0;
|
||||
gOptionsData.buttonEditFlags[i] = 0;
|
||||
gOptionsData.captureFramesRemaining = 0;
|
||||
gOptionsData.capturedKeysMask = 0;
|
||||
for (i = 0; i < 2; i++)
|
||||
gOptionsData.unk24[i] = 10;
|
||||
gOptionsData.unk28 = 0;
|
||||
gOptionsData.capturedButtonSlots[i] = 10;
|
||||
gOptionsData.capturedButtonCount = 0;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
for (j = 0; j < 10; j++)
|
||||
gUnknown_02031AF0[i][j] = gDefaultButtonConfigs[i][j];
|
||||
gCustomButtonConfigs[i][j] = gDefaultButtonConfigs[i][j];
|
||||
}
|
||||
sub_52528();
|
||||
InitCustomButtonConfigDisplay();
|
||||
if (gGameBoyPlayerEnabled == TRUE)
|
||||
{
|
||||
gOptionsData.rumbleEnabled = gMain_saveData.rumbleEnabled;
|
||||
|
|
@ -163,19 +163,19 @@ void Options_InitStates(void)
|
|||
gOptionsData.rumbleEnabled = FALSE;
|
||||
gMain_saveData.rumbleEnabled = FALSE;
|
||||
}
|
||||
gOptionsData.unk2E = 0;
|
||||
gOptionsData.unk2B = 0;
|
||||
gOptionsData.unk2C = 0;
|
||||
gOptionsData.unk2D = 0;
|
||||
gOptionsData.unk2F = 0;
|
||||
gOptionsData.unk30 = 0;
|
||||
gOptionsData.rumbleAnimActive = 0;
|
||||
gOptionsData.rumbleAnimTimer = 0;
|
||||
gOptionsData.rumbleAnimFrame = 0;
|
||||
gOptionsData.rumbleAnimTileId = 0;
|
||||
gOptionsData.rumbleIdleBlinkState = 0;
|
||||
gOptionsData.soundTestActive = 0;
|
||||
}
|
||||
|
||||
void Options_HandleInput(void)
|
||||
{
|
||||
s16 r4;
|
||||
|
||||
sub_51C9C();
|
||||
UpdateOptionsSpritePositions();
|
||||
switch (gOptionsData.stateMain)
|
||||
{
|
||||
case OPTIONS_STATE_MAIN:
|
||||
|
|
@ -231,26 +231,26 @@ void Options_HandleInput(void)
|
|||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gOptionsData.stateMain = OPTIONS_STATE_BGM_SELECT,
|
||||
gOptionsData.scollWaitFrames = 0;
|
||||
gOptionsData.unk30 = 1;
|
||||
if (gOptionsData.unk2E == 1)
|
||||
gOptionsData.soundTestActive = 1;
|
||||
if (gOptionsData.rumbleAnimActive == 1)
|
||||
{
|
||||
gOptionsData.unk2B = 0;
|
||||
gOptionsData.unk2D = 0;
|
||||
gOptionsData.unk2C = 0;
|
||||
gOptionsData.unk2E = 0;
|
||||
gOptionsData.rumbleAnimTimer = 0;
|
||||
gOptionsData.rumbleAnimTileId = 0;
|
||||
gOptionsData.rumbleAnimFrame = 0;
|
||||
gOptionsData.rumbleAnimActive = 0;
|
||||
}
|
||||
break;
|
||||
case CURSOR_POS_SE:
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gOptionsData.stateMain = OPTIONS_STATE_SE_MENU_MOVE_0x67,
|
||||
gOptionsData.scollWaitFrames = 0;
|
||||
gOptionsData.unk30 = 1;
|
||||
if (gOptionsData.unk2E == 1)
|
||||
gOptionsData.soundTestActive = 1;
|
||||
if (gOptionsData.rumbleAnimActive == 1)
|
||||
{
|
||||
gOptionsData.unk2B = 0;
|
||||
gOptionsData.unk2D = 0;
|
||||
gOptionsData.unk2C = 0;
|
||||
gOptionsData.unk2E = 0;
|
||||
gOptionsData.rumbleAnimTimer = 0;
|
||||
gOptionsData.rumbleAnimTileId = 0;
|
||||
gOptionsData.rumbleAnimFrame = 0;
|
||||
gOptionsData.rumbleAnimActive = 0;
|
||||
}
|
||||
break;
|
||||
case CURSOR_POS_BUTTON_CONFIG_TYPE_A:
|
||||
|
|
@ -272,11 +272,11 @@ void Options_HandleInput(void)
|
|||
if (gGameBoyPlayerEnabled == TRUE)
|
||||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gOptionsData.unk2D = 0;
|
||||
if (gOptionsData.unk2E == 1)
|
||||
gOptionsData.unk2E = 0;
|
||||
gOptionsData.unk2B = 0;
|
||||
gOptionsData.unk2C = 0;
|
||||
gOptionsData.rumbleAnimTileId = 0;
|
||||
if (gOptionsData.rumbleAnimActive == 1)
|
||||
gOptionsData.rumbleAnimActive = 0;
|
||||
gOptionsData.rumbleAnimTimer = 0;
|
||||
gOptionsData.rumbleAnimFrame = 0;
|
||||
gOptionsData.rumbleEnabled = FALSE;
|
||||
}
|
||||
break;
|
||||
|
|
@ -285,11 +285,11 @@ void Options_HandleInput(void)
|
|||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
PlayRumble(11);
|
||||
if (gOptionsData.unk2E == 0)
|
||||
gOptionsData.unk2E = 1;
|
||||
if (gOptionsData.rumbleAnimActive == 0)
|
||||
gOptionsData.rumbleAnimActive = 1;
|
||||
|
||||
gOptionsData.unk2B = 0;
|
||||
gOptionsData.unk2C = 0;
|
||||
gOptionsData.rumbleAnimTimer = 0;
|
||||
gOptionsData.rumbleAnimFrame = 0;
|
||||
gOptionsData.rumbleEnabled = TRUE;
|
||||
}
|
||||
break;
|
||||
|
|
@ -302,7 +302,7 @@ void Options_HandleInput(void)
|
|||
SetButtonConfigInputs(gMain_saveData.buttonConfigType);
|
||||
}
|
||||
if (!(gMain.systemFrameCount & 7))
|
||||
gOptionsData.unk2 = 1 - gOptionsData.unk2;
|
||||
gOptionsData.cursorBlinkToggle = 1 - gOptionsData.cursorBlinkToggle;
|
||||
break;
|
||||
case OPTIONS_STATE_BGM_SELECT:
|
||||
if (JOY_HELD(DPAD_LEFT))
|
||||
|
|
@ -346,12 +346,12 @@ void Options_HandleInput(void)
|
|||
{
|
||||
m4aMPlayAllStop();
|
||||
m4aSongNumStart(SE_MENU_CANCEL);
|
||||
gOptionsData.unk4 = 0;
|
||||
gOptionsData.unk30 = 0;
|
||||
gOptionsData.soundTestBlinkToggle = 0;
|
||||
gOptionsData.soundTestActive = 0;
|
||||
gOptionsData.stateMain = OPTIONS_STATE_MAIN;
|
||||
}
|
||||
if (!(gMain.systemFrameCount & 7))
|
||||
gOptionsData.unk4 = 1 - gOptionsData.unk4;
|
||||
gOptionsData.soundTestBlinkToggle = 1 - gOptionsData.soundTestBlinkToggle;
|
||||
if (gOptionsData.scollWaitFrames > 0)
|
||||
gOptionsData.scollWaitFrames--;
|
||||
break;
|
||||
|
|
@ -397,12 +397,12 @@ void Options_HandleInput(void)
|
|||
{
|
||||
m4aMPlayAllStop();
|
||||
m4aSongNumStart(SE_MENU_CANCEL);
|
||||
gOptionsData.unk4 = 0;
|
||||
gOptionsData.unk30 = 0;
|
||||
gOptionsData.soundTestBlinkToggle = 0;
|
||||
gOptionsData.soundTestActive = 0;
|
||||
gOptionsData.stateMain = OPTIONS_STATE_MAIN;
|
||||
}
|
||||
if (!(gMain.systemFrameCount & 7))
|
||||
gOptionsData.unk4 = 1 - gOptionsData.unk4;
|
||||
gOptionsData.soundTestBlinkToggle = 1 - gOptionsData.soundTestBlinkToggle;
|
||||
if (gOptionsData.scollWaitFrames > 0)
|
||||
gOptionsData.scollWaitFrames--;
|
||||
break;
|
||||
|
|
@ -427,7 +427,7 @@ void Options_HandleInput(void)
|
|||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gOptionsData.stateMain = OPTIONS_STATE_BUTTON_CONFIG_INPUT,
|
||||
gOptionsData.unk1A[gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER] = 1;
|
||||
gOptionsData.buttonEditFlags[gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER] = 1;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
|
|
@ -436,77 +436,77 @@ void Options_HandleInput(void)
|
|||
gOptionsData.stateMain = OPTIONS_STATE_MAIN;
|
||||
}
|
||||
if (!(gMain.systemFrameCount & 7))
|
||||
gOptionsData.unk2 = 1 - gOptionsData.unk2;
|
||||
gOptionsData.cursorBlinkToggle = 1 - gOptionsData.cursorBlinkToggle;
|
||||
break;
|
||||
case OPTIONS_STATE_BUTTON_CONFIG_INPUT:
|
||||
gOptionsData.unk8++;
|
||||
if (gOptionsData.unk8 > 24)
|
||||
gOptionsData.buttonFlashTimer++;
|
||||
if (gOptionsData.buttonFlashTimer > 24)
|
||||
{
|
||||
gOptionsData.unk8 = 0;
|
||||
gOptionsData.unk6 = 1 - gOptionsData.unk6;
|
||||
gOptionsData.buttonFlashTimer = 0;
|
||||
gOptionsData.buttonFlashVisible = 1 - gOptionsData.buttonFlashVisible;
|
||||
}
|
||||
if (JOY_NEW(KEYS_MASK ^ START_BUTTON))
|
||||
{
|
||||
s16 i;
|
||||
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gOptionsData.unk20 = 10;
|
||||
gOptionsData.unk22 = 0;
|
||||
gOptionsData.captureFramesRemaining = 10;
|
||||
gOptionsData.capturedKeysMask = 0;
|
||||
for (i = 0; i < 2; i++)
|
||||
gOptionsData.unk24[i] = 10;
|
||||
gOptionsData.unk28 = 0;
|
||||
gOptionsData.capturedButtonSlots[i] = 10;
|
||||
gOptionsData.capturedButtonCount = 0;
|
||||
}
|
||||
if (gOptionsData.unk20 > 0)
|
||||
if (gOptionsData.captureFramesRemaining > 0)
|
||||
{
|
||||
sub_524BC();
|
||||
gOptionsData.unk20--;
|
||||
if (gOptionsData.unk20 == 0)
|
||||
CaptureButtonConfigInput();
|
||||
gOptionsData.captureFramesRemaining--;
|
||||
if (gOptionsData.captureFramesRemaining == 0)
|
||||
{
|
||||
gUnknown_02031AF0[4][(gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER) * 2 + 0] = gOptionsData.unk24[0];
|
||||
gUnknown_02031AF0[4][(gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER) * 2 + 1] = gOptionsData.unk24[1];
|
||||
gMain_saveData.customButtonConfig[(gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER)][0] = gUnknown_086BB910[gOptionsData.unk24[0]][0];
|
||||
gMain_saveData.customButtonConfig[(gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER)][1] = gUnknown_086BB910[gOptionsData.unk24[1]][0];
|
||||
gCustomButtonConfigs[4][(gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER) * 2 + 0] = gOptionsData.capturedButtonSlots[0];
|
||||
gCustomButtonConfigs[4][(gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER) * 2 + 1] = gOptionsData.capturedButtonSlots[1];
|
||||
gMain_saveData.customButtonConfig[(gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER)][0] = gButtonInfoTable[gOptionsData.capturedButtonSlots[0]][0];
|
||||
gMain_saveData.customButtonConfig[(gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER)][1] = gButtonInfoTable[gOptionsData.capturedButtonSlots[1]][0];
|
||||
gOptionsData.stateMain = OPTIONS_STATE_BUTTON_CONFIG_SELECT,
|
||||
gOptionsData.unk1A[gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER] = 0;
|
||||
gOptionsData.unk8 = 0;
|
||||
gOptionsData.unk6 = 1;
|
||||
gOptionsData.buttonEditFlags[gOptionsData.cursorPosition - CURSOR_POS_LEFT_FLIPPER] = 0;
|
||||
gOptionsData.buttonFlashTimer = 0;
|
||||
gOptionsData.buttonFlashVisible = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (gOptionsData.unk2E == 1)
|
||||
if (gOptionsData.rumbleAnimActive == 1)
|
||||
{
|
||||
if (++gOptionsData.unk2B > gUnknown_086BB9B4[gOptionsData.unk2C].unk2)
|
||||
if (++gOptionsData.rumbleAnimTimer > gButtonAnimData[gOptionsData.rumbleAnimFrame].frameDuration)
|
||||
{
|
||||
gOptionsData.unk2B = 0;
|
||||
gOptionsData.unk2C++;
|
||||
if (gOptionsData.unk2C > 12)
|
||||
gOptionsData.rumbleAnimTimer = 0;
|
||||
gOptionsData.rumbleAnimFrame++;
|
||||
if (gOptionsData.rumbleAnimFrame > 12)
|
||||
{
|
||||
gOptionsData.unk2C = 0;
|
||||
gOptionsData.unk2D = 0;
|
||||
gOptionsData.unk2E = 0;
|
||||
gOptionsData.rumbleAnimFrame = 0;
|
||||
gOptionsData.rumbleAnimTileId = 0;
|
||||
gOptionsData.rumbleAnimActive = 0;
|
||||
}
|
||||
gOptionsData.unk2D = gUnknown_086BB9B4[gOptionsData.unk2C].unk0;
|
||||
gOptionsData.rumbleAnimTileId = gButtonAnimData[gOptionsData.rumbleAnimFrame].tileId;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gOptionsData.unk2B++;
|
||||
if (gOptionsData.unk2B > 18)
|
||||
gOptionsData.rumbleAnimTimer++;
|
||||
if (gOptionsData.rumbleAnimTimer > 18)
|
||||
{
|
||||
gOptionsData.unk2B = 0;
|
||||
gOptionsData.unk2D = 1 - gOptionsData.unk2D;
|
||||
gOptionsData.rumbleAnimTimer = 0;
|
||||
gOptionsData.rumbleAnimTileId = 1 - gOptionsData.rumbleAnimTileId;
|
||||
}
|
||||
}
|
||||
sub_11FC();
|
||||
ProcessRumbleFrame();
|
||||
}
|
||||
|
||||
void Options_State2_51C3C(void)
|
||||
{
|
||||
sub_111C();
|
||||
if (sub_1170())
|
||||
DisableGbPlayerRumble();
|
||||
if (IsGbPlayerReady())
|
||||
{
|
||||
sub_1198();
|
||||
RestoreDefaultInterrupts();
|
||||
gMain.subState++;
|
||||
}
|
||||
}
|
||||
|
|
@ -515,16 +515,16 @@ void Options_State3_51C60(void)
|
|||
{
|
||||
gMain_saveData.rumbleEnabled = gOptionsData.rumbleEnabled;
|
||||
SaveFile_WriteToSram();
|
||||
sub_02B4();
|
||||
FadeOutScreen();
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
gAutoDisplayTitlescreenMenu = TRUE;
|
||||
SetMainGameState(STATE_TITLE);
|
||||
}
|
||||
|
||||
// TODO
|
||||
NAKED
|
||||
void sub_51C9C(void)
|
||||
void UpdateOptionsSpritePositions(void)
|
||||
{
|
||||
asm_unified("\n\
|
||||
push {r4, r5, r6, r7, lr}\n\
|
||||
|
|
@ -594,7 +594,7 @@ _08051CEA:\n\
|
|||
adds r2, r5, #0\n\
|
||||
subs r2, #0xb8\n\
|
||||
_08051D1E:\n\
|
||||
ldr r0, _08051D48 @ =gUnknown_0200293A\n\
|
||||
ldr r0, _08051D48 @ =gOptionsButtonConfigEditFlags\n\
|
||||
add r0, ip\n\
|
||||
ldrb r0, [r0]\n\
|
||||
cmp r0, #1\n\
|
||||
|
|
@ -612,7 +612,7 @@ _08051D38: .4byte gMain_spriteGroups\n\
|
|||
_08051D3C: .4byte gOptionsData\n\
|
||||
_08051D40: .4byte gMain_spriteGroups_8\n\
|
||||
_08051D44: .4byte gMain_spriteGroups_10\n\
|
||||
_08051D48: .4byte gUnknown_0200293A\n\
|
||||
_08051D48: .4byte gOptionsButtonConfigEditFlags\n\
|
||||
_08051D4C: .4byte gMain_spriteGroups_28\n\
|
||||
_08051D50:\n\
|
||||
str r2, [r1]\n\
|
||||
|
|
@ -707,11 +707,11 @@ _08051DCE:\n\
|
|||
asrs r0, r0, #0x18\n\
|
||||
ldr r1, _08051F74 @ =gMain_spriteGroups_31\n\
|
||||
strh r0, [r1]\n\
|
||||
ldr r0, _08051F78 @ =gUnknown_086BB9EC\n\
|
||||
ldr r0, _08051F78 @ =gOptionsSpriteSets\n\
|
||||
movs r1, #0x20\n\
|
||||
ldr r2, _08051F7C @ =gMain_spriteGroups\n\
|
||||
bl LoadSpriteSets\n\
|
||||
ldr r2, _08051F80 @ =gUnknown_086BB968\n\
|
||||
ldr r2, _08051F80 @ =gOptionsCursorPositionTable\n\
|
||||
movs r3, #0xa\n\
|
||||
ldrsh r1, [r5, r3]\n\
|
||||
lsls r1, r1, #2\n\
|
||||
|
|
@ -774,7 +774,7 @@ _08051E6C:\n\
|
|||
ldrh r2, [r4, #8]\n\
|
||||
lsls r2, r2, #3\n\
|
||||
add r2, r8\n\
|
||||
ldr r0, _08051F90 @ =gUnknown_02002932\n\
|
||||
ldr r0, _08051F90 @ =gOptionsBGMDigitTileIds\n\
|
||||
add r0, ip\n\
|
||||
ldrb r1, [r0]\n\
|
||||
adds r1, #0x16\n\
|
||||
|
|
@ -835,7 +835,7 @@ _08051EE2:\n\
|
|||
ldrh r2, [r4, #8]\n\
|
||||
lsls r2, r2, #3\n\
|
||||
add r2, r8\n\
|
||||
ldr r0, _08051F98 @ =gUnknown_02002935\n\
|
||||
ldr r0, _08051F98 @ =gOptionsSEDigitTileIds\n\
|
||||
add r0, ip\n\
|
||||
ldrb r1, [r0]\n\
|
||||
adds r1, #0x16\n\
|
||||
|
|
@ -892,15 +892,15 @@ _08051F68: .4byte gMain_spriteGroups_8\n\
|
|||
_08051F6C: .4byte gMain_spriteGroups_30\n\
|
||||
_08051F70: .4byte gOptionsData\n\
|
||||
_08051F74: .4byte gMain_spriteGroups_31\n\
|
||||
_08051F78: .4byte gUnknown_086BB9EC\n\
|
||||
_08051F78: .4byte gOptionsSpriteSets\n\
|
||||
_08051F7C: .4byte gMain_spriteGroups\n\
|
||||
_08051F80: .4byte gUnknown_086BB968\n\
|
||||
_08051F80: .4byte gOptionsCursorPositionTable\n\
|
||||
_08051F84: .4byte gOamBuffer\n\
|
||||
_08051F88: .4byte 0x000001FF\n\
|
||||
_08051F8C: .4byte 0xFFFFFE00\n\
|
||||
_08051F90: .4byte gUnknown_02002932\n\
|
||||
_08051F90: .4byte gOptionsBGMDigitTileIds\n\
|
||||
_08051F94: .4byte 0xFFFFFC00\n\
|
||||
_08051F98: .4byte gUnknown_02002935\n\
|
||||
_08051F98: .4byte gOptionsSEDigitTileIds\n\
|
||||
_08051F9C:\n\
|
||||
cmp r0, #1\n\
|
||||
bne _08051FA6\n\
|
||||
|
|
@ -954,7 +954,7 @@ _08051FB2:\n\
|
|||
movs r4, #0xc\n\
|
||||
ldrsh r0, [r3, r4]\n\
|
||||
lsls r0, r0, #1\n\
|
||||
ldr r7, _080520E4 @ =gUnknown_086BB9A8\n\
|
||||
ldr r7, _080520E4 @ =gOptionsBGMSelectorYPositions\n\
|
||||
adds r0, r0, r7\n\
|
||||
ldrh r0, [r0]\n\
|
||||
strh r0, [r2, #4]\n\
|
||||
|
|
@ -1067,7 +1067,7 @@ _080520D4: .4byte 0xFFFFFE00\n\
|
|||
_080520D8: .4byte 0x000001FF\n\
|
||||
_080520DC: .4byte gMain_spriteGroups_8\n\
|
||||
_080520E0: .4byte gOptionsData\n\
|
||||
_080520E4: .4byte gUnknown_086BB9A8\n\
|
||||
_080520E4: .4byte gOptionsBGMSelectorYPositions\n\
|
||||
_080520E8:\n\
|
||||
mov r2, r8\n\
|
||||
ldr r1, [r2]\n\
|
||||
|
|
@ -1088,7 +1088,7 @@ _080520E8:\n\
|
|||
lsls r0, r0, #1\n\
|
||||
ldr r1, [sp, #0x88]\n\
|
||||
adds r0, r1, r0\n\
|
||||
ldr r2, _08052490 @ =gUnknown_02031AF0\n\
|
||||
ldr r2, _08052490 @ =gCustomButtonConfigs\n\
|
||||
adds r0, r0, r2\n\
|
||||
ldrb r0, [r0]\n\
|
||||
ldrh r2, [r4, #8]\n\
|
||||
|
|
@ -1096,7 +1096,7 @@ _080520E8:\n\
|
|||
ldr r3, _08052494 @ =gOamBuffer\n\
|
||||
adds r2, r2, r3\n\
|
||||
lsls r0, r0, #3\n\
|
||||
ldr r1, _08052498 @ =gUnknown_086BB910\n\
|
||||
ldr r1, _08052498 @ =gButtonInfoTable\n\
|
||||
adds r6, r0, r1\n\
|
||||
ldrh r0, [r6, #2]\n\
|
||||
ldr r1, _0805249C @ =0x000003FF\n\
|
||||
|
|
@ -1166,7 +1166,7 @@ _080520E8:\n\
|
|||
adds r0, #1\n\
|
||||
ldr r1, [sp, #0x88]\n\
|
||||
adds r0, r1, r0\n\
|
||||
ldr r2, _08052490 @ =gUnknown_02031AF0\n\
|
||||
ldr r2, _08052490 @ =gCustomButtonConfigs\n\
|
||||
adds r0, r0, r2\n\
|
||||
ldrb r0, [r0]\n\
|
||||
mov sb, r0\n\
|
||||
|
|
@ -1265,7 +1265,7 @@ _080521B8:\n\
|
|||
adds r3, r3, r4\n\
|
||||
mov r0, sb\n\
|
||||
lsls r4, r0, #3\n\
|
||||
ldr r1, _08052498 @ =gUnknown_086BB910\n\
|
||||
ldr r1, _08052498 @ =gButtonInfoTable\n\
|
||||
adds r4, r4, r1\n\
|
||||
ldrh r0, [r4, #2]\n\
|
||||
ldr r1, _0805249C @ =0x000003FF\n\
|
||||
|
|
@ -1544,9 +1544,9 @@ _08052470:\n\
|
|||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.align 2, 0\n\
|
||||
_08052490: .4byte gUnknown_02031AF0\n\
|
||||
_08052490: .4byte gCustomButtonConfigs\n\
|
||||
_08052494: .4byte gOamBuffer\n\
|
||||
_08052498: .4byte gUnknown_086BB910\n\
|
||||
_08052498: .4byte gButtonInfoTable\n\
|
||||
_0805249C: .4byte 0x000003FF\n\
|
||||
_080524A0: .4byte 0xFFFFFC00\n\
|
||||
_080524A4: .4byte 0x000001FF\n\
|
||||
|
|
@ -1557,10 +1557,10 @@ _080524B4: .4byte gMain_spriteGroups_31\n\
|
|||
_080524B8: .4byte gMain");
|
||||
}
|
||||
|
||||
void sub_524BC(void)
|
||||
void CaptureButtonConfigInput(void)
|
||||
{
|
||||
int i, pressedKeys;
|
||||
if (gOptionsData.unk28 >= 2)
|
||||
if (gOptionsData.capturedButtonCount >= 2)
|
||||
return;
|
||||
|
||||
pressedKeys = JOY_HELD(KEYS_MASK ^ START_BUTTON);
|
||||
|
|
@ -1570,17 +1570,17 @@ void sub_524BC(void)
|
|||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
int key = pressedKeys & (1 << i);
|
||||
if (key && !(gOptionsData.unk22 & key))
|
||||
if (key && !(gOptionsData.capturedKeysMask & key))
|
||||
{
|
||||
gOptionsData.unk22 |= key;
|
||||
gOptionsData.unk24[gOptionsData.unk28] = i;
|
||||
if (++gOptionsData.unk28 == 2)
|
||||
gOptionsData.capturedKeysMask |= key;
|
||||
gOptionsData.capturedButtonSlots[gOptionsData.capturedButtonCount] = i;
|
||||
if (++gOptionsData.capturedButtonCount == 2)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_52528(void)
|
||||
void InitCustomButtonConfigDisplay(void)
|
||||
{
|
||||
int i, j;
|
||||
u8 var0;
|
||||
|
|
@ -1622,12 +1622,12 @@ void sub_52528(void)
|
|||
var0 = 10;
|
||||
break;
|
||||
}
|
||||
gUnknown_02031B18[i * 2 + j] = var0;
|
||||
gCustomButtonConfigTileIds[i * 2 + j] = var0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern const u8 gUnknown_08527EFE[];
|
||||
extern const u8 gDefaultCustomButtonConfigTileIds[];
|
||||
|
||||
void SetButtonConfigInputs(s8 buttonConfigType)
|
||||
{
|
||||
|
|
@ -1635,76 +1635,76 @@ void SetButtonConfigInputs(s8 buttonConfigType)
|
|||
switch (buttonConfigType)
|
||||
{
|
||||
case BUTTON_CONFIG_RESET:
|
||||
gMain.buttonConfigs[0][0] = gUnknown_086BB910[5][0];
|
||||
gMain.buttonConfigs[0][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[1][0] = gUnknown_086BB910[0][0];
|
||||
gMain.buttonConfigs[1][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[2][0] = gUnknown_086BB910[9][0];
|
||||
gMain.buttonConfigs[2][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[3][0] = gUnknown_086BB910[8][0];
|
||||
gMain.buttonConfigs[3][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[4][0] = gUnknown_086BB910[9][0];
|
||||
gMain.buttonConfigs[4][1] = gUnknown_086BB910[8][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_LEFT_FLIPPER][0] = gUnknown_086BB910[1][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_LEFT_FLIPPER][1] = gUnknown_086BB910[10][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_RIGHT_FLIPPER][0] = gUnknown_086BB910[0][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_RIGHT_FLIPPER][1] = gUnknown_086BB910[10][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_LEFT][0] = gUnknown_086BB910[5][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_LEFT][1] = gUnknown_086BB910[10][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_RIGHT][0] = gUnknown_086BB910[4][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_RIGHT][1] = gUnknown_086BB910[10][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_UP][0] = gUnknown_086BB910[6][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_UP][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[0][0] = gButtonInfoTable[5][0];
|
||||
gMain.buttonConfigs[0][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[1][0] = gButtonInfoTable[0][0];
|
||||
gMain.buttonConfigs[1][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[2][0] = gButtonInfoTable[9][0];
|
||||
gMain.buttonConfigs[2][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[3][0] = gButtonInfoTable[8][0];
|
||||
gMain.buttonConfigs[3][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[4][0] = gButtonInfoTable[9][0];
|
||||
gMain.buttonConfigs[4][1] = gButtonInfoTable[8][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_LEFT_FLIPPER][0] = gButtonInfoTable[1][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_LEFT_FLIPPER][1] = gButtonInfoTable[10][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_RIGHT_FLIPPER][0] = gButtonInfoTable[0][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_RIGHT_FLIPPER][1] = gButtonInfoTable[10][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_LEFT][0] = gButtonInfoTable[5][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_LEFT][1] = gButtonInfoTable[10][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_RIGHT][0] = gButtonInfoTable[4][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_RIGHT][1] = gButtonInfoTable[10][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_UP][0] = gButtonInfoTable[6][0];
|
||||
gMain_saveData.customButtonConfig[PINBALL_INPUT_TILT_UP][1] = gButtonInfoTable[10][0];
|
||||
for (i = 0; i < 10; i++)
|
||||
gUnknown_02031B18[i] = gUnknown_08527EFE[i];
|
||||
gCustomButtonConfigTileIds[i] = gDefaultCustomButtonConfigTileIds[i];
|
||||
break;
|
||||
case BUTTON_CONFIG_TYPE_A:
|
||||
gMain.buttonConfigs[0][0] = gUnknown_086BB910[5][0];
|
||||
gMain.buttonConfigs[0][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[1][0] = gUnknown_086BB910[0][0];
|
||||
gMain.buttonConfigs[1][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[2][0] = gUnknown_086BB910[9][0];
|
||||
gMain.buttonConfigs[2][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[3][0] = gUnknown_086BB910[8][0];
|
||||
gMain.buttonConfigs[3][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[4][0] = gUnknown_086BB910[9][0];
|
||||
gMain.buttonConfigs[4][1] = gUnknown_086BB910[8][0];
|
||||
gMain.buttonConfigs[0][0] = gButtonInfoTable[5][0];
|
||||
gMain.buttonConfigs[0][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[1][0] = gButtonInfoTable[0][0];
|
||||
gMain.buttonConfigs[1][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[2][0] = gButtonInfoTable[9][0];
|
||||
gMain.buttonConfigs[2][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[3][0] = gButtonInfoTable[8][0];
|
||||
gMain.buttonConfigs[3][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[4][0] = gButtonInfoTable[9][0];
|
||||
gMain.buttonConfigs[4][1] = gButtonInfoTable[8][0];
|
||||
break;
|
||||
case BUTTON_CONFIG_TYPE_B:
|
||||
gMain.buttonConfigs[0][0] = gUnknown_086BB910[5][0];
|
||||
gMain.buttonConfigs[0][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[1][0] = gUnknown_086BB910[0][0];
|
||||
gMain.buttonConfigs[1][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[2][0] = gUnknown_086BB910[9][0];
|
||||
gMain.buttonConfigs[2][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[3][0] = gUnknown_086BB910[8][0];
|
||||
gMain.buttonConfigs[3][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[4][0] = gUnknown_086BB910[1][0];
|
||||
gMain.buttonConfigs[4][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[0][0] = gButtonInfoTable[5][0];
|
||||
gMain.buttonConfigs[0][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[1][0] = gButtonInfoTable[0][0];
|
||||
gMain.buttonConfigs[1][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[2][0] = gButtonInfoTable[9][0];
|
||||
gMain.buttonConfigs[2][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[3][0] = gButtonInfoTable[8][0];
|
||||
gMain.buttonConfigs[3][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[4][0] = gButtonInfoTable[1][0];
|
||||
gMain.buttonConfigs[4][1] = gButtonInfoTable[10][0];
|
||||
break;
|
||||
case BUTTON_CONFIG_TYPE_C:
|
||||
gMain.buttonConfigs[0][0] = gUnknown_086BB910[9][0];
|
||||
gMain.buttonConfigs[0][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[1][0] = gUnknown_086BB910[8][0];
|
||||
gMain.buttonConfigs[1][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[2][0] = gUnknown_086BB910[5][0];
|
||||
gMain.buttonConfigs[2][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[3][0] = gUnknown_086BB910[0][0];
|
||||
gMain.buttonConfigs[3][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[4][0] = gUnknown_086BB910[5][0];
|
||||
gMain.buttonConfigs[4][1] = gUnknown_086BB910[0][0];
|
||||
gMain.buttonConfigs[0][0] = gButtonInfoTable[9][0];
|
||||
gMain.buttonConfigs[0][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[1][0] = gButtonInfoTable[8][0];
|
||||
gMain.buttonConfigs[1][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[2][0] = gButtonInfoTable[5][0];
|
||||
gMain.buttonConfigs[2][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[3][0] = gButtonInfoTable[0][0];
|
||||
gMain.buttonConfigs[3][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[4][0] = gButtonInfoTable[5][0];
|
||||
gMain.buttonConfigs[4][1] = gButtonInfoTable[0][0];
|
||||
break;
|
||||
case BUTTON_CONFIG_TYPE_D:
|
||||
gMain.buttonConfigs[0][0] = gUnknown_086BB910[9][0];
|
||||
gMain.buttonConfigs[0][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[1][0] = gUnknown_086BB910[8][0];
|
||||
gMain.buttonConfigs[1][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[2][0] = gUnknown_086BB910[5][0];
|
||||
gMain.buttonConfigs[2][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[3][0] = gUnknown_086BB910[4][0];
|
||||
gMain.buttonConfigs[3][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[4][0] = gUnknown_086BB910[6][0];
|
||||
gMain.buttonConfigs[4][1] = gUnknown_086BB910[10][0];
|
||||
gMain.buttonConfigs[0][0] = gButtonInfoTable[9][0];
|
||||
gMain.buttonConfigs[0][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[1][0] = gButtonInfoTable[8][0];
|
||||
gMain.buttonConfigs[1][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[2][0] = gButtonInfoTable[5][0];
|
||||
gMain.buttonConfigs[2][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[3][0] = gButtonInfoTable[4][0];
|
||||
gMain.buttonConfigs[3][1] = gButtonInfoTable[10][0];
|
||||
gMain.buttonConfigs[4][0] = gButtonInfoTable[6][0];
|
||||
gMain.buttonConfigs[4][1] = gButtonInfoTable[10][0];
|
||||
break;
|
||||
case BUTTON_CONFIG_TYPE_EDIT:
|
||||
gMain.buttonConfigs[0][0] = gMain_saveData.customButtonConfig[PINBALL_INPUT_LEFT_FLIPPER][0];
|
||||
|
|
|
|||
104
src/pause_game.c
104
src/pause_game.c
|
|
@ -3,58 +3,58 @@
|
|||
#include "main.h"
|
||||
#include "constants/bg_music.h"
|
||||
|
||||
extern const struct Vector16 gUnknown_08137D78[];
|
||||
extern const u16 gUnknown_08137DA4[];
|
||||
extern const struct Vector16 gPauseMenuSpriteOffsets[];
|
||||
extern const u16 gPauseMenuTextAnimFrames[];
|
||||
extern const u8 gPauseMenuText_Gfx[][0x20];
|
||||
|
||||
|
||||
// Pauses the game and saves the blend settings
|
||||
// Also stops the BGM if it was playing before
|
||||
// Sets the blend settings to a dimmed state
|
||||
void sub_495A0(void)
|
||||
void PauseGame(void)
|
||||
{
|
||||
s16 i, j;
|
||||
u16 objPalettes[OBJ_PLTT_SIZE / 0x20][0x10];
|
||||
u8 rgb[3];
|
||||
|
||||
gCurrentPinballGame->unk1104 = 1;
|
||||
gCurrentPinballGame->unk131C = 0;
|
||||
gCurrentPinballGame->pauseMenuCursorIndex = 1;
|
||||
gCurrentPinballGame->pauseAnimTimer = 0;
|
||||
if (gMPlayInfo_BGM.status >= 0)
|
||||
{
|
||||
gCurrentPinballGame->unkF4C = gMPlayInfo_BGM.songHeader;
|
||||
gCurrentPinballGame->savedBgmSongHeader = gMPlayInfo_BGM.songHeader;
|
||||
m4aMPlayStop(&gMPlayInfo_BGM);
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unkF4C = NULL;
|
||||
gCurrentPinballGame->savedBgmSongHeader = NULL;
|
||||
}
|
||||
|
||||
m4aMPlayAllStop();
|
||||
m4aSongNumStart(SE_UNKNOWN_0xA5);
|
||||
if (gMain.selectedField < MAIN_FIELD_COUNT)
|
||||
{
|
||||
gCurrentPinballGame->unk6A = gCurrentPinballGame->unk68;
|
||||
gCurrentPinballGame->hudSpriteBaseY = gCurrentPinballGame->cameraYViewport;
|
||||
if (gMain.selectedField == FIELD_RUBY)
|
||||
sub_4E814();
|
||||
UpdateRubyBoardAnimations();
|
||||
else if (gMain.selectedField == FIELD_SAPPHIRE)
|
||||
sub_4F814();
|
||||
UpdateSapphireBoardAnimations();
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk1106 = gMain.blendControl;
|
||||
gCurrentPinballGame->unk1108 = gMain.blendAlpha;
|
||||
gCurrentPinballGame->unk110A = gMain.blendBrightness;
|
||||
gCurrentPinballGame->unk110C = gMain.unk2C;
|
||||
gCurrentPinballGame->unk110E = gMain.vCount;
|
||||
DmaCopy16(3, (void *)OBJ_PLTT, gCurrentPinballGame->unk111A, OBJ_PLTT_SIZE);
|
||||
gCurrentPinballGame->pauseBlendControl = gMain.blendControl;
|
||||
gCurrentPinballGame->pauseBlendAlpha = gMain.blendAlpha;
|
||||
gCurrentPinballGame->pauseBlendBrightness = gMain.blendBrightness;
|
||||
gCurrentPinballGame->pauseScoreOverlayActive = gMain.scoreOverlayActive;
|
||||
gCurrentPinballGame->pauseVCount = gMain.vCount;
|
||||
DmaCopy16(3, (void *)OBJ_PLTT, gCurrentPinballGame->pauseObjPalette, OBJ_PLTT_SIZE);
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
for (j = 0; j < 16; j++)
|
||||
{
|
||||
if (i != 9 || j != 12)
|
||||
{
|
||||
rgb[0] = (((gCurrentPinballGame->unk111A[i][j] & 0x001F) >> 0) * 2) / 5;
|
||||
rgb[1] = (((gCurrentPinballGame->unk111A[i][j] & 0x03E0) >> 5) * 2) / 5;
|
||||
rgb[2] = (((gCurrentPinballGame->unk111A[i][j] & 0x7C00) >> 10) * 2) / 5;
|
||||
rgb[0] = (((gCurrentPinballGame->pauseObjPalette[i][j] & 0x001F) >> 0) * 2) / 5;
|
||||
rgb[1] = (((gCurrentPinballGame->pauseObjPalette[i][j] & 0x03E0) >> 5) * 2) / 5;
|
||||
rgb[2] = (((gCurrentPinballGame->pauseObjPalette[i][j] & 0x7C00) >> 10) * 2) / 5;
|
||||
objPalettes[i][j] = rgb[0] | (rgb[1] << 5) | (rgb[2] << 10);
|
||||
}
|
||||
else
|
||||
|
|
@ -66,35 +66,35 @@ void sub_495A0(void)
|
|||
|
||||
DmaCopy16(3, objPalettes, (void *)OBJ_PLTT, OBJ_PLTT_SIZE);
|
||||
if (gMain.selectedField < MAIN_FIELD_COUNT)
|
||||
sub_1D4D0();
|
||||
ClampPortraitSpritesToOffscreen();
|
||||
else if (gMain.selectedField == FIELD_DUSCLOPS)
|
||||
sub_356A0();
|
||||
RenderBonusStageOverlaySprites();
|
||||
else if (gMain.selectedField == FIELD_KYOGRE)
|
||||
sub_3ADA0();
|
||||
HideKyogreSplashSprite();
|
||||
else if (gMain.selectedField == FIELD_GROUDON)
|
||||
sub_3E5D0();
|
||||
HideGroudonShockwaveSprite();
|
||||
|
||||
sub_11F0(1);
|
||||
SetRumblePaused(1);
|
||||
}
|
||||
|
||||
//Unpauses the game and restores the blend settings
|
||||
//Also starts the BGM if it was playing before
|
||||
void sub_497BC(void)
|
||||
void UnpauseGame(void)
|
||||
{
|
||||
gMain.blendControl = gCurrentPinballGame->unk1106;
|
||||
gMain.blendAlpha = gCurrentPinballGame->unk1108;
|
||||
gMain.blendBrightness = gCurrentPinballGame->unk110A;
|
||||
gMain.unk2C = gCurrentPinballGame->unk110C;
|
||||
gMain.vCount = gCurrentPinballGame->unk110E;
|
||||
DmaCopy16(3, gCurrentPinballGame->unk111A, (void *)OBJ_PLTT, OBJ_PLTT_SIZE);
|
||||
if (gCurrentPinballGame->unkF4C)
|
||||
gMain.blendControl = gCurrentPinballGame->pauseBlendControl;
|
||||
gMain.blendAlpha = gCurrentPinballGame->pauseBlendAlpha;
|
||||
gMain.blendBrightness = gCurrentPinballGame->pauseBlendBrightness;
|
||||
gMain.scoreOverlayActive = gCurrentPinballGame->pauseScoreOverlayActive;
|
||||
gMain.vCount = gCurrentPinballGame->pauseVCount;
|
||||
DmaCopy16(3, gCurrentPinballGame->pauseObjPalette, (void *)OBJ_PLTT, OBJ_PLTT_SIZE);
|
||||
if (gCurrentPinballGame->savedBgmSongHeader)
|
||||
m4aMPlayContinue(&gMPlayInfo_BGM);
|
||||
|
||||
m4aSongNumStart(SE_UNKNOWN_0xA6);
|
||||
sub_11F0(0);
|
||||
SetRumblePaused(0);
|
||||
}
|
||||
|
||||
void sub_49850(void)
|
||||
void PositionPauseMenuSprites(void)
|
||||
{
|
||||
s16 i;
|
||||
struct SpriteGroup *group;
|
||||
|
|
@ -142,7 +142,7 @@ void sub_49850(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_49A34(void)
|
||||
void AnimatePauseMenuOverlay(void)
|
||||
{
|
||||
s16 i;
|
||||
struct SpriteGroup *group;
|
||||
|
|
@ -154,57 +154,57 @@ void sub_49A34(void)
|
|||
s16 sb;
|
||||
s16 yScale = 8;
|
||||
|
||||
if (gCurrentPinballGame->unk131C == 0)
|
||||
if (gCurrentPinballGame->pauseAnimTimer == 0)
|
||||
{
|
||||
gMain.blendControl = 0xCF;
|
||||
gMain.blendBrightness = 0xA;
|
||||
gMain.unk2C = 0;
|
||||
gMain.scoreOverlayActive = 0;
|
||||
gMain.vCount = 144;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk131C < 16)
|
||||
if (gCurrentPinballGame->pauseAnimTimer < 16)
|
||||
{
|
||||
xOffset = 160 - gCurrentPinballGame->unk131C * 10;
|
||||
xOffset = 160 - gCurrentPinballGame->pauseAnimTimer * 10;
|
||||
yOffset = 24;
|
||||
var0 = -1;
|
||||
sb = -1;
|
||||
yScale = 16;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk131C < 24)
|
||||
else if (gCurrentPinballGame->pauseAnimTimer < 24)
|
||||
{
|
||||
xOffset = 0;
|
||||
yOffset = 24 - (gCurrentPinballGame->unk131C - 15) * 3;
|
||||
if (gCurrentPinballGame->unk131C < 18)
|
||||
yOffset = 24 - (gCurrentPinballGame->pauseAnimTimer - 15) * 3;
|
||||
if (gCurrentPinballGame->pauseAnimTimer < 18)
|
||||
{
|
||||
var0 = -1;
|
||||
sb = -1;
|
||||
yScale = 8;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk131C == 18)
|
||||
else if (gCurrentPinballGame->pauseAnimTimer == 18)
|
||||
{
|
||||
var0 = 9;
|
||||
sb = -10;
|
||||
yScale = 16;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk131C == 19)
|
||||
else if (gCurrentPinballGame->pauseAnimTimer == 19)
|
||||
{
|
||||
var0 = 9;
|
||||
sb = -9;
|
||||
yScale = 128;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk131C == 20)
|
||||
else if (gCurrentPinballGame->pauseAnimTimer == 20)
|
||||
{
|
||||
var0 = 7;
|
||||
sb = -8;
|
||||
yScale = 160;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk131C == 21)
|
||||
else if (gCurrentPinballGame->pauseAnimTimer == 21)
|
||||
{
|
||||
var0 = 6;
|
||||
sb = -7;
|
||||
yScale = 192;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk131C == 22)
|
||||
else if (gCurrentPinballGame->pauseAnimTimer == 22)
|
||||
{
|
||||
var0 = 4;
|
||||
sb = -5;
|
||||
|
|
@ -234,12 +234,12 @@ void sub_49A34(void)
|
|||
group->baseX = 100;
|
||||
group->baseY = 80 + var0;
|
||||
oamSimple = &group->oam[0];
|
||||
gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + group->baseX + gUnknown_08137D78[0].x;
|
||||
gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY + gUnknown_08137D78[0].y + gCurrentPinballGame->unk1104 * 12;
|
||||
gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + group->baseX + gPauseMenuSpriteOffsets[0].x;
|
||||
gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY + gPauseMenuSpriteOffsets[0].y + gCurrentPinballGame->pauseMenuCursorIndex * 12;
|
||||
gOamBuffer[oamSimple->oamId].affineMode = ST_OAM_AFFINE_DOUBLE;
|
||||
gOamBuffer[oamSimple->oamId].matrixNum = 5;
|
||||
|
||||
index = gUnknown_08137DA4[(gMain.systemFrameCount % 65) / 5];
|
||||
index = gPauseMenuTextAnimFrames[(gMain.systemFrameCount % 65) / 5];
|
||||
if (gMain.selectedField < MAIN_FIELD_COUNT)
|
||||
{
|
||||
DmaCopy16(3, gPauseMenuText_Gfx[index], (void *)0x060118C0, 0x20);
|
||||
|
|
@ -249,7 +249,7 @@ void sub_49A34(void)
|
|||
DmaCopy16(3, gPauseMenuText_Gfx[index], (void *)0x06010480, 0x20);
|
||||
}
|
||||
|
||||
offsets = gUnknown_08137D78;
|
||||
offsets = gPauseMenuSpriteOffsets;
|
||||
group->baseX = 100;
|
||||
group->baseY = 80 + var0;
|
||||
for (i = 1; i < 5; i++)
|
||||
|
|
@ -295,5 +295,5 @@ void sub_49A34(void)
|
|||
gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk131C++;
|
||||
gCurrentPinballGame->pauseAnimTimer++;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
1414
src/pokedex.c
1414
src/pokedex.c
File diff suppressed because it is too large
Load Diff
|
|
@ -58,16 +58,16 @@ static void PlayCryInternal(u16 speciesRS, s8 pan, s8 volume, u8 priority, int u
|
|||
switch (table)
|
||||
{
|
||||
case 0:
|
||||
SetPokemonCryTone(&gUnknown_08532D6C[index]);
|
||||
SetPokemonCryTone(&gPokemonCryToneBank0[index]);
|
||||
break;
|
||||
case 1:
|
||||
SetPokemonCryTone(&gUnknown_08533360[index]);
|
||||
SetPokemonCryTone(&gPokemonCryToneBank1[index]);
|
||||
break;
|
||||
case 2:
|
||||
SetPokemonCryTone(&gUnknown_08533960[index]);
|
||||
SetPokemonCryTone(&gPokemonCryToneBank2[index]);
|
||||
break;
|
||||
case 3:
|
||||
SetPokemonCryTone(&gUnknown_08533F60[index]);
|
||||
SetPokemonCryTone(&gPokemonCryToneBank3[index]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ void PrintString(u16 glyph, u16 palette, int x, int y, int width, int height)
|
|||
|
||||
for (j = 0; j < height; j++)
|
||||
for (i = 0; i < width; i++)
|
||||
gUnknown_03005C00[y * 0x20 + x + j * 0x20 + i] = (glyph + j * 0x20 + i) | (palette << 12);
|
||||
gBG0TilemapBuffer[y * 0x20 + x + j * 0x20 + i] = (glyph + j * 0x20 + i) | (palette << 12);
|
||||
}
|
||||
|
||||
void CopyString(int srcX, int srcY, int destX, int destY, int width, int height)
|
||||
|
|
@ -16,7 +16,7 @@ void CopyString(int srcX, int srcY, int destX, int destY, int width, int height)
|
|||
|
||||
for (j = 0; j < height; j++)
|
||||
for (i = 0; i < width; i++)
|
||||
gUnknown_03005C00[destY * 0x20 + destX + j * 0x20 + i] = gUnknown_03005C00[srcY * 0x20 + srcX + j * 0x20 + i];
|
||||
gBG0TilemapBuffer[destY * 0x20 + destX + j * 0x20 + i] = gBG0TilemapBuffer[srcY * 0x20 + srcX + j * 0x20 + i];
|
||||
}
|
||||
|
||||
void SetStringPalette(int x, int y, int width, int height, u16 palette)
|
||||
|
|
@ -29,7 +29,7 @@ void SetStringPalette(int x, int y, int width, int height, u16 palette)
|
|||
for (i = 0; i < width; i++)
|
||||
{
|
||||
index = y * 0x20 + x + j * 0x20 + i;
|
||||
gUnknown_03005C00[index] = (gUnknown_03005C00[index] & 0xFFF) | (palette << 12);
|
||||
gBG0TilemapBuffer[index] = (gBG0TilemapBuffer[index] & 0xFFF) | (palette << 12);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ void CopyBgTilesRect(void *volatile src, void *volatile dest, s16 width, s16 hei
|
|||
|
||||
// This function is unused. It appears to operates on a pixel canvas where each "tile" is represented by
|
||||
// 2 bytes.
|
||||
void sub_10750(void *volatile src, void *volatile dest, s16 width, s16 height)
|
||||
void CopyPixelCanvasRect(void *volatile src, void *volatile dest, s16 width, s16 height)
|
||||
{
|
||||
int j;
|
||||
|
||||
|
|
@ -58,15 +58,15 @@ void sub_10750(void *volatile src, void *volatile dest, s16 width, s16 height)
|
|||
}
|
||||
|
||||
// This function is unused.
|
||||
void sub_10798(void *src1, void *src2, void (*func)(void))
|
||||
void Unused_FadeInWithCustomPalettes(void *src1, void *src2, void (*func)(void))
|
||||
{
|
||||
u16 i;
|
||||
|
||||
DmaCopy16(3, src1, gUnknown_0201A520[1], BG_PLTT_SIZE);
|
||||
DmaCopy16(3, src2, gUnknown_0201A520[2], BG_PLTT_SIZE);
|
||||
DmaFill16(3, RGB_WHITE, gUnknown_0201A520, PLTT_SIZE);
|
||||
DmaCopy16(3, gUnknown_0201A520[0], gUnknown_0201A520[2], PLTT_SIZE);
|
||||
DmaCopy16(3, gUnknown_0201A520[2], (void *)PLTT, PLTT_SIZE);
|
||||
DmaCopy16(3, src1, gPaletteFadeBuffers[1], BG_PLTT_SIZE);
|
||||
DmaCopy16(3, src2, gPaletteFadeBuffers[2], BG_PLTT_SIZE);
|
||||
DmaFill16(3, RGB_WHITE, gPaletteFadeBuffers, PLTT_SIZE);
|
||||
DmaCopy16(3, gPaletteFadeBuffers[0], gPaletteFadeBuffers[2], PLTT_SIZE);
|
||||
DmaCopy16(3, gPaletteFadeBuffers[2], (void *)PLTT, PLTT_SIZE);
|
||||
|
||||
UnblankLCD();
|
||||
gMain.dispcntBackup = REG_DISPCNT;
|
||||
|
|
@ -76,41 +76,41 @@ void sub_10798(void *src1, void *src2, void (*func)(void))
|
|||
if (func != NULL)
|
||||
func();
|
||||
|
||||
sub_1001C(i);
|
||||
InterpolatePaletteStep(i);
|
||||
MainLoopIter();
|
||||
if (i == 0x20)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_0201A520[1], (void *)PLTT, PLTT_SIZE);
|
||||
DmaCopy16(3, gPaletteFadeBuffers[1], (void *)PLTT, PLTT_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_0201A520[2], (void *)PLTT, PLTT_SIZE);
|
||||
DmaCopy16(3, gPaletteFadeBuffers[2], (void *)PLTT, PLTT_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This function is unused.
|
||||
void sub_10860(void (*func)(void))
|
||||
void Unused_FadeOutToWhite(void (*func)(void))
|
||||
{
|
||||
u16 i;
|
||||
|
||||
DmaCopy16(3, (void *)PLTT, gUnknown_0201A520[0], PLTT_SIZE);
|
||||
DmaFill16(3, RGB_WHITE, gUnknown_0201A520[1], PLTT_SIZE);
|
||||
DmaCopy16(3, gUnknown_0201A520[0], gUnknown_0201A520[2], PLTT_SIZE);
|
||||
DmaCopy16(3, (void *)PLTT, gPaletteFadeBuffers[0], PLTT_SIZE);
|
||||
DmaFill16(3, RGB_WHITE, gPaletteFadeBuffers[1], PLTT_SIZE);
|
||||
DmaCopy16(3, gPaletteFadeBuffers[0], gPaletteFadeBuffers[2], PLTT_SIZE);
|
||||
|
||||
for (i = 0; i <= 0x20; i += 0x10)
|
||||
{
|
||||
if (func != NULL)
|
||||
func();
|
||||
sub_1001C(i);
|
||||
InterpolatePaletteStep(i);
|
||||
MainLoopIter();
|
||||
if (i == 0x20)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_0201A520[1], (void *)PLTT, PLTT_SIZE);
|
||||
DmaCopy16(3, gPaletteFadeBuffers[1], (void *)PLTT, PLTT_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_0201A520[2], (void *)PLTT, PLTT_SIZE);
|
||||
DmaCopy16(3, gPaletteFadeBuffers[2], (void *)PLTT, PLTT_SIZE);
|
||||
}
|
||||
}
|
||||
MainLoopIter();
|
||||
|
|
|
|||
252
src/rom_1A0F4.c
252
src/rom_1A0F4.c
|
|
@ -3,105 +3,105 @@
|
|||
#include "m4a.h"
|
||||
#include "constants/bg_music.h"
|
||||
|
||||
extern void sub_1A2C0(void);
|
||||
extern void RenderBannerSlideAnimation(void);
|
||||
|
||||
|
||||
void sub_1A0F4(void)
|
||||
void ProcessBannerCameraTransition(void)
|
||||
{
|
||||
if ((gMain.modeChangeFlags & MODE_CHANGE_BANNER) != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk5F7 = 1;
|
||||
if (gCurrentPinballGame->unkFA != 0)
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 1;
|
||||
if (gCurrentPinballGame->bannerActive != 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1F = 2;
|
||||
gCurrentPinballGame->unk5FA = 1;
|
||||
if (gCurrentPinballGame->unkEA != 0)
|
||||
gCurrentPinballGame->ballFrozenState = 2;
|
||||
gCurrentPinballGame->boardEntityActive = 1;
|
||||
if (gCurrentPinballGame->bannerDelayTimer != 0)
|
||||
{
|
||||
gCurrentPinballGame->unkEA--;
|
||||
gCurrentPinballGame->bannerDelayTimer--;
|
||||
}
|
||||
else if (gCurrentPinballGame->unkEE == 0)
|
||||
else if (gCurrentPinballGame->cameraYScrollSpeed == 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unkEC != 0)
|
||||
if (gCurrentPinballGame->bannerDisplayTimer != 0)
|
||||
{
|
||||
gCurrentPinballGame->unkEC--;
|
||||
gCurrentPinballGame->bannerDisplayTimer--;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unkFA = 0;
|
||||
gCurrentPinballGame->bannerActive = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk68 + gCurrentPinballGame->unkEE <= gCurrentPinballGame->unkE8)
|
||||
if (gCurrentPinballGame->cameraYViewport + gCurrentPinballGame->cameraYScrollSpeed <= gCurrentPinballGame->cameraYScrollTarget)
|
||||
{
|
||||
gCurrentPinballGame->unkE6 += gCurrentPinballGame->unkEE;
|
||||
gCurrentPinballGame->cameraYAdjust += gCurrentPinballGame->cameraYScrollSpeed;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk68 - gCurrentPinballGame->unkEE >= gCurrentPinballGame->unkE8)
|
||||
else if (gCurrentPinballGame->cameraYViewport - gCurrentPinballGame->cameraYScrollSpeed >= gCurrentPinballGame->cameraYScrollTarget)
|
||||
{
|
||||
gCurrentPinballGame->unkE6 -= gCurrentPinballGame->unkEE;
|
||||
gCurrentPinballGame->cameraYAdjust -= gCurrentPinballGame->cameraYScrollSpeed;
|
||||
}
|
||||
else if (gCurrentPinballGame->unkEC != 0)
|
||||
else if (gCurrentPinballGame->bannerDisplayTimer != 0)
|
||||
{
|
||||
gCurrentPinballGame->unkEC--;
|
||||
gCurrentPinballGame->bannerDisplayTimer--;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unkFA = 0;
|
||||
gCurrentPinballGame->bannerActive = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unkF2 != 0)
|
||||
if (gCurrentPinballGame->bannerGfxIndex != 0)
|
||||
{
|
||||
sub_1A2C0();
|
||||
RenderBannerSlideAnimation();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unkEE == 0 || gCurrentPinballGame->unkE6 == 0)
|
||||
if (gCurrentPinballGame->cameraYScrollSpeed == 0 || gCurrentPinballGame->cameraYAdjust == 0)
|
||||
{
|
||||
gCurrentPinballGame->unkE6 = 0;
|
||||
gCurrentPinballGame->unk1F = 0;
|
||||
gCurrentPinballGame->cameraYAdjust = 0;
|
||||
gCurrentPinballGame->ballFrozenState = 0;
|
||||
gMain.modeChangeFlags &= ~MODE_CHANGE_BANNER;
|
||||
gCurrentPinballGame->unk5F7 = 0;
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 0;
|
||||
|
||||
if (gCurrentPinballGame->unkFB == 0)
|
||||
if (gCurrentPinballGame->bannerPreserveBallState == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk5FA = 0;
|
||||
gCurrentPinballGame->boardEntityActive = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unkE6 > 0)
|
||||
if (gCurrentPinballGame->cameraYAdjust > 0)
|
||||
{
|
||||
gCurrentPinballGame->unkE6 -= gCurrentPinballGame->unkEE;
|
||||
if (gCurrentPinballGame->unkE6 > 0)
|
||||
gCurrentPinballGame->cameraYAdjust -= gCurrentPinballGame->cameraYScrollSpeed;
|
||||
if (gCurrentPinballGame->cameraYAdjust > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unkE6 = 0;
|
||||
gCurrentPinballGame->unk1F = 0;
|
||||
gCurrentPinballGame->cameraYAdjust = 0;
|
||||
gCurrentPinballGame->ballFrozenState = 0;
|
||||
gMain.modeChangeFlags &= ~MODE_CHANGE_BANNER;
|
||||
gCurrentPinballGame->unk5F7 = 0;
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 0;
|
||||
|
||||
if (gCurrentPinballGame->unkFB == 0)
|
||||
if (gCurrentPinballGame->bannerPreserveBallState == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk5FA = 0;
|
||||
gCurrentPinballGame->boardEntityActive = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unkE6 <= -1)
|
||||
if (gCurrentPinballGame->cameraYAdjust <= -1)
|
||||
{
|
||||
gCurrentPinballGame->unkE6 += gCurrentPinballGame->unkEE;
|
||||
if (gCurrentPinballGame->unkE6 >= 0)
|
||||
gCurrentPinballGame->cameraYAdjust += gCurrentPinballGame->cameraYScrollSpeed;
|
||||
if (gCurrentPinballGame->cameraYAdjust >= 0)
|
||||
{
|
||||
gCurrentPinballGame->unkE6 = 0;
|
||||
gCurrentPinballGame->unk1F = 0;
|
||||
gCurrentPinballGame->cameraYAdjust = 0;
|
||||
gCurrentPinballGame->ballFrozenState = 0;
|
||||
gMain.modeChangeFlags &= ~MODE_CHANGE_BANNER;
|
||||
gCurrentPinballGame->unk5F7 = 0;
|
||||
gCurrentPinballGame->ballUpgradeTimerFrozen = 0;
|
||||
|
||||
if (gCurrentPinballGame->unkFB == 0)
|
||||
if (gCurrentPinballGame->bannerPreserveBallState == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk5FA = 0;
|
||||
gCurrentPinballGame->boardEntityActive = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -109,7 +109,7 @@ void sub_1A0F4(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_1A2C0(void)
|
||||
void RenderBannerSlideAnimation(void)
|
||||
{
|
||||
s16 i;
|
||||
s16 sp00;
|
||||
|
|
@ -117,188 +117,188 @@ void sub_1A2C0(void)
|
|||
struct OamDataSimple *simple;
|
||||
u32 frameCount;
|
||||
|
||||
sp00 = gCurrentPinballGame->unkF2 - 1;
|
||||
spriteGroup = gMain.unk44[11];
|
||||
sp00 = gCurrentPinballGame->bannerGfxIndex - 1;
|
||||
spriteGroup = gMain.fieldSpriteGroups[11];
|
||||
frameCount = ((gMain.systemFrameCount & 7) / 4);
|
||||
|
||||
if (spriteGroup->available != 0)
|
||||
{
|
||||
spriteGroup->baseX = 0;
|
||||
spriteGroup->baseY = 200;
|
||||
if (gCurrentPinballGame->unkF2 == 4)
|
||||
if (gCurrentPinballGame->bannerGfxIndex == 4)
|
||||
{
|
||||
if (gCurrentPinballGame->unkEA != 0)
|
||||
if (gCurrentPinballGame->bannerDelayTimer != 0)
|
||||
{
|
||||
spriteGroup->baseX = 370;
|
||||
spriteGroup->baseY = 44;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unkE4 = 4;
|
||||
DmaCopy16(3, gUnknown_086ACEF8[gCurrentPinballGame->unkF2], (void *)(VRAM + 0x15800), 0x25E0);
|
||||
sub_2CD98();
|
||||
if (gCurrentPinballGame->unkF4 > 0)
|
||||
gCurrentPinballGame->activePortraitType = 4;
|
||||
DmaCopy16(3, gModeBannerTilemaps[gCurrentPinballGame->bannerGfxIndex], (void *)(VRAM + 0x15800), 0x25E0);
|
||||
AnimateBannerSlide();
|
||||
if (gCurrentPinballGame->bannerDisplayDuration > 0)
|
||||
{
|
||||
gCurrentPinballGame->unkF4--;
|
||||
if (gCurrentPinballGame->unkF4 == 0x77)
|
||||
gCurrentPinballGame->bannerDisplayDuration--;
|
||||
if (gCurrentPinballGame->bannerDisplayDuration == 0x77)
|
||||
{
|
||||
m4aMPlayAllStop();
|
||||
m4aSongNumStart(MUS_TRAVEL_MODE_START);
|
||||
}
|
||||
gCurrentPinballGame->unkF6 -= 0x28;
|
||||
spriteGroup->baseX = (gCurrentPinballGame->unkF6 / 10) + 370;
|
||||
gCurrentPinballGame->bannerSlidePosition -= 0x28;
|
||||
spriteGroup->baseX = (gCurrentPinballGame->bannerSlidePosition / 10) + 370;
|
||||
spriteGroup->baseY = 44;
|
||||
}
|
||||
else
|
||||
{
|
||||
spriteGroup->baseX = -110;
|
||||
spriteGroup->baseY = 44;
|
||||
gMain.unk44[11]->available = 0; // direct index required here
|
||||
gCurrentPinballGame->unkF2 = 0;
|
||||
gCurrentPinballGame->unkE4 = 0;
|
||||
gMain.fieldSpriteGroups[11]->available = 0; // direct index required here
|
||||
gCurrentPinballGame->bannerGfxIndex = 0;
|
||||
gCurrentPinballGame->activePortraitType = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unkE4 = 4;
|
||||
gCurrentPinballGame->activePortraitType = 4;
|
||||
// i = framecount ???
|
||||
DmaCopy16(3, gUnknown_086ACEF8[gCurrentPinballGame->unkF2] + ((i = frameCount) * 0x21C0), (void *)(VRAM + 0x15800), 0x21C0);
|
||||
if (gCurrentPinballGame->unkF4 > 0)
|
||||
DmaCopy16(3, gModeBannerTilemaps[gCurrentPinballGame->bannerGfxIndex] + ((i = frameCount) * 0x21C0), (void *)(VRAM + 0x15800), 0x21C0);
|
||||
if (gCurrentPinballGame->bannerDisplayDuration > 0)
|
||||
{
|
||||
gCurrentPinballGame->unkF4--;
|
||||
if (gCurrentPinballGame->unkF0 != 0)
|
||||
gCurrentPinballGame->bannerDisplayDuration--;
|
||||
if (gCurrentPinballGame->bannerSlideTimer != 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unkF0 == 0x28)
|
||||
if (gCurrentPinballGame->bannerSlideTimer == 0x28)
|
||||
{
|
||||
MPlayStart(&gMPlayInfo_SE1, &se_unk_8b);
|
||||
}
|
||||
gCurrentPinballGame->unkF0--;
|
||||
if (gCurrentPinballGame->unkF0 <= 0xF)
|
||||
gCurrentPinballGame->bannerSlideTimer--;
|
||||
if (gCurrentPinballGame->bannerSlideTimer <= 0xF)
|
||||
{
|
||||
gCurrentPinballGame->unkF6 += 0xA0;
|
||||
gCurrentPinballGame->bannerSlidePosition += 0xA0;
|
||||
}
|
||||
if (gCurrentPinballGame->unkF0 > 32 && gCurrentPinballGame->unkF0 <= 40)
|
||||
if (gCurrentPinballGame->bannerSlideTimer > 32 && gCurrentPinballGame->bannerSlideTimer <= 40)
|
||||
{
|
||||
if (gCurrentPinballGame->unkF0 <= 36)
|
||||
if (gCurrentPinballGame->bannerSlideTimer <= 36)
|
||||
{
|
||||
gMain.blendBrightness = 7;
|
||||
if (gCurrentPinballGame->unkF0 < 36)
|
||||
if (gCurrentPinballGame->bannerSlideTimer < 36)
|
||||
{
|
||||
|
||||
if ((gCurrentPinballGame->unk25 == 3 && gCurrentPinballGame->unk1A5 == 1) ||
|
||||
(gCurrentPinballGame->unk25 == 4 && gCurrentPinballGame->unk6DC == 9))
|
||||
if ((gCurrentPinballGame->ballCatchState == 3 && gCurrentPinballGame->evolutionShopActive == 1) ||
|
||||
(gCurrentPinballGame->ballCatchState == 4 && gCurrentPinballGame->rouletteOutcomeId == 9))
|
||||
{
|
||||
gCurrentPinballGame->unk70 = 0;
|
||||
gCurrentPinballGame->paletteSwapActive = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk70 = 1;
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[2], (void *)(OBJ_PLTT), 0x20);
|
||||
gCurrentPinballGame->paletteSwapActive = 1;
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[2], (void *)(OBJ_PLTT), 0x20);
|
||||
}
|
||||
if (gMain.selectedField == FIELD_SAPPHIRE)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[2] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xC0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[2] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xC0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[2] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xE0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[2] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xE0);
|
||||
}
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[2] + 0x140, (void *)(OBJ_PLTT + 0x140), 0x60);
|
||||
gCurrentPinballGame->unk6F = 2;
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[2] + 0x140, (void *)(OBJ_PLTT + 0x140), 0x60);
|
||||
gCurrentPinballGame->activePaletteIndex = 2;
|
||||
}
|
||||
}
|
||||
else if (gCurrentPinballGame->unkF0 > 0x24)
|
||||
else if (gCurrentPinballGame->bannerSlideTimer > 0x24)
|
||||
{
|
||||
gMain.blendBrightness = 4;
|
||||
if (gCurrentPinballGame->unkF0 <= 0x27)
|
||||
if (gCurrentPinballGame->bannerSlideTimer <= 0x27)
|
||||
{
|
||||
if ((gCurrentPinballGame->unk25 == 3 && gCurrentPinballGame->unk1A5 == 1) ||
|
||||
(gCurrentPinballGame->unk25 == 4 && gCurrentPinballGame->unk6DC == 9))
|
||||
if ((gCurrentPinballGame->ballCatchState == 3 && gCurrentPinballGame->evolutionShopActive == 1) ||
|
||||
(gCurrentPinballGame->ballCatchState == 4 && gCurrentPinballGame->rouletteOutcomeId == 9))
|
||||
{
|
||||
gCurrentPinballGame->unk70 = 0;
|
||||
gCurrentPinballGame->paletteSwapActive = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk70 = 1;
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[1], (void *)(OBJ_PLTT), 0x20);
|
||||
gCurrentPinballGame->paletteSwapActive = 1;
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[1], (void *)(OBJ_PLTT), 0x20);
|
||||
}
|
||||
if (gMain.selectedField == FIELD_SAPPHIRE)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[1] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xC0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[1] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xC0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[1] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xE0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[1] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xE0);
|
||||
}
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[1] + 0x140, (void *)(OBJ_PLTT + 0x140), 0x60);
|
||||
gCurrentPinballGame->unk6F = 1;
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[1] + 0x140, (void *)(OBJ_PLTT + 0x140), 0x60);
|
||||
gCurrentPinballGame->activePaletteIndex = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gCurrentPinballGame->unkF0 == 0)
|
||||
if (gCurrentPinballGame->bannerSlideTimer == 0)
|
||||
{
|
||||
gCurrentPinballGame->unkF6 = 0;
|
||||
gCurrentPinballGame->unkF8 = 0x3C;
|
||||
gCurrentPinballGame->bannerSlidePosition = 0;
|
||||
gCurrentPinballGame->bannerSlideVelocity = 0x3C;
|
||||
}
|
||||
}
|
||||
spriteGroup->baseX = (gCurrentPinballGame->unkF6 / 10) + 127;
|
||||
spriteGroup->baseX = (gCurrentPinballGame->bannerSlidePosition / 10) + 127;
|
||||
spriteGroup->baseY = 44;
|
||||
}
|
||||
else if (gCurrentPinballGame->unkF0 < 30)
|
||||
else if (gCurrentPinballGame->bannerSlideTimer < 30)
|
||||
{
|
||||
gCurrentPinballGame->unkF6 += gCurrentPinballGame->unkF8;
|
||||
spriteGroup->baseX = (gCurrentPinballGame->unkF6 / 10) + 127;
|
||||
gCurrentPinballGame->bannerSlidePosition += gCurrentPinballGame->bannerSlideVelocity;
|
||||
spriteGroup->baseX = (gCurrentPinballGame->bannerSlidePosition / 10) + 127;
|
||||
spriteGroup->baseY = 44;
|
||||
|
||||
gCurrentPinballGame->unkF0++;
|
||||
gCurrentPinballGame->unkF8 -= 0xA;
|
||||
if (gCurrentPinballGame->unkF0 > 0x18 &&
|
||||
(gCurrentPinballGame->unk25 != 3 || gCurrentPinballGame->unk1A5 != 1) &&
|
||||
(gCurrentPinballGame->unk25 != 4 || gCurrentPinballGame->unk6DC != 9))
|
||||
gCurrentPinballGame->bannerSlideTimer++;
|
||||
gCurrentPinballGame->bannerSlideVelocity -= 0xA;
|
||||
if (gCurrentPinballGame->bannerSlideTimer > 0x18 &&
|
||||
(gCurrentPinballGame->ballCatchState != 3 || gCurrentPinballGame->evolutionShopActive != 1) &&
|
||||
(gCurrentPinballGame->ballCatchState != 4 || gCurrentPinballGame->rouletteOutcomeId != 9))
|
||||
{
|
||||
gMain.blendBrightness = 4;
|
||||
if (gCurrentPinballGame->unkF0 > 0x19)
|
||||
if (gCurrentPinballGame->bannerSlideTimer > 0x19)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[1], (void *)(OBJ_PLTT), 0x20);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[1], (void *)(OBJ_PLTT), 0x20);
|
||||
if (gMain.selectedField == FIELD_SAPPHIRE)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[1] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xC0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[1] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xC0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[1] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xE0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[1] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xE0);
|
||||
}
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[1] + 0x140, (void *)(OBJ_PLTT + 0x140), 0x60);
|
||||
gCurrentPinballGame->unk6F = 1;
|
||||
gCurrentPinballGame->unk70 = 1;
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[1] + 0x140, (void *)(OBJ_PLTT + 0x140), 0x60);
|
||||
gCurrentPinballGame->activePaletteIndex = 1;
|
||||
gCurrentPinballGame->paletteSwapActive = 1;
|
||||
}
|
||||
if (gCurrentPinballGame->unkF0 == 0x1D)
|
||||
if (gCurrentPinballGame->bannerSlideTimer == 0x1D)
|
||||
{
|
||||
gMain.blendBrightness = 0;
|
||||
}
|
||||
}
|
||||
if (gCurrentPinballGame->unkF0 == 0x1E)
|
||||
if (gCurrentPinballGame->bannerSlideTimer == 0x1E)
|
||||
{
|
||||
gMain.unk44[11]->available = 0;
|
||||
gCurrentPinballGame->unkF2 = 0;
|
||||
gCurrentPinballGame->unkE4 = 0;
|
||||
if ((gCurrentPinballGame->unk25 != 3 || gCurrentPinballGame->unk1A5 != 1) &&
|
||||
(gCurrentPinballGame->unk25 != 4 || gCurrentPinballGame->unk6DC != 9))
|
||||
gMain.fieldSpriteGroups[11]->available = 0;
|
||||
gCurrentPinballGame->bannerGfxIndex = 0;
|
||||
gCurrentPinballGame->activePortraitType = 0;
|
||||
if ((gCurrentPinballGame->ballCatchState != 3 || gCurrentPinballGame->evolutionShopActive != 1) &&
|
||||
(gCurrentPinballGame->ballCatchState != 4 || gCurrentPinballGame->rouletteOutcomeId != 9))
|
||||
{
|
||||
gMain.blendBrightness = 0;
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[0], (void *)(OBJ_PLTT), 0x20);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[0], (void *)(OBJ_PLTT), 0x20);
|
||||
if (gMain.selectedField == FIELD_SAPPHIRE)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[0] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xC0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[0] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xC0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[0] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xE0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[0] + 0x40, (void *)(OBJ_PLTT + 0x40), 0xE0);
|
||||
}
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[0] + 0x140, (void *)(OBJ_PLTT + 0x140), 0x60);
|
||||
gCurrentPinballGame->unk6F = 0;
|
||||
gCurrentPinballGame->unk70 = 1;
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[0] + 0x140, (void *)(OBJ_PLTT + 0x140), 0x60);
|
||||
gCurrentPinballGame->activePaletteIndex = 0;
|
||||
gCurrentPinballGame->paletteSwapActive = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -312,9 +312,9 @@ void sub_1A2C0(void)
|
|||
u16 *dst;
|
||||
simple = &spriteGroup->oam[i];
|
||||
dst = (u16 *)&gOamBuffer[simple->oamId];
|
||||
*dst++ = gUnknown_086B4568[sp00][i * 3 + 0];
|
||||
*dst++ = gUnknown_086B4568[sp00][i * 3 + 1];
|
||||
*dst++ = gUnknown_086B4568[sp00][i * 3 + 2];
|
||||
*dst++ = gModeBannerOamAttributes[sp00][i * 3 + 0];
|
||||
*dst++ = gModeBannerOamAttributes[sp00][i * 3 + 1];
|
||||
*dst++ = gModeBannerOamAttributes[sp00][i * 3 + 2];
|
||||
|
||||
gOamBuffer[simple->oamId].x = gOamBuffer[simple->oamId].x + spriteGroup->baseX;
|
||||
gOamBuffer[simple->oamId].y = gOamBuffer[simple->oamId].y + spriteGroup->baseY;
|
||||
|
|
|
|||
1058
src/rom_1A98C.c
1058
src/rom_1A98C.c
File diff suppressed because it is too large
Load Diff
1354
src/rom_201B8.c
1354
src/rom_201B8.c
File diff suppressed because it is too large
Load Diff
|
|
@ -3,13 +3,13 @@
|
|||
#include "main.h"
|
||||
#include "variables.h"
|
||||
|
||||
extern u32 gUnknown_0202ADD0;
|
||||
extern s16 gUnknown_0201A444;
|
||||
extern u32 gUnknown_0202BDF0;
|
||||
extern u8 gUnknown_0201C1AC;
|
||||
extern u8 gUnknown_0202ADDC;
|
||||
extern u32 gLinkStatusResult;
|
||||
extern s16 gLinkTimeoutCounter;
|
||||
extern u32 gLinkConnectionState;
|
||||
extern u8 gLinkPlayerCount;
|
||||
extern u8 gLinkNegotiationFlags;
|
||||
|
||||
s16 sub_2414(const struct SpriteSet *const *spriteSets, u16 numSpriteSets, struct SpriteGroup *spriteGroups)
|
||||
s16 LoadSpriteSetsWithCpuCopy(const struct SpriteSet *const *spriteSets, u16 numSpriteSets, struct SpriteGroup *spriteGroups)
|
||||
{
|
||||
struct SpriteGroup *spriteGroup;
|
||||
struct OamDataSimple *simple;
|
||||
|
|
@ -46,7 +46,7 @@ void nullsub_16(void)
|
|||
{
|
||||
}
|
||||
|
||||
void sub_24DC(void)
|
||||
void ResetSerialIO(void)
|
||||
{
|
||||
REG_RCNT = 0;
|
||||
REG_SIOCNT = 0;
|
||||
|
|
@ -62,7 +62,7 @@ void sub_24DC(void)
|
|||
REG_SIOMULTI3 = 0;
|
||||
}
|
||||
|
||||
void sub_250C(void)
|
||||
void SetupDefaultInterrupts(void)
|
||||
{
|
||||
REG_IME = 0;
|
||||
REG_IE = INTR_FLAG_GAMEPAK | INTR_FLAG_VBLANK;
|
||||
|
|
@ -70,18 +70,18 @@ void sub_250C(void)
|
|||
REG_IME = 1;
|
||||
}
|
||||
|
||||
void sub_2538(void)
|
||||
void ResetLinkState(void)
|
||||
{
|
||||
gUnknown_0202ADD0 = 0;
|
||||
gUnknown_0201A444 = 0;
|
||||
gUnknown_0202BDF0 = 0;
|
||||
gUnknown_0201C1AC = 0;
|
||||
gUnknown_0202ADDC = 0;
|
||||
gLinkStatusResult = 0;
|
||||
gLinkTimeoutCounter = 0;
|
||||
gLinkConnectionState = 0;
|
||||
gLinkPlayerCount = 0;
|
||||
gLinkNegotiationFlags = 0;
|
||||
}
|
||||
|
||||
void sub_2568(void)
|
||||
void ResetSerialAndInterrupts(void)
|
||||
{
|
||||
sub_24DC();
|
||||
ResetSerialIO();
|
||||
REG_IME = 0;
|
||||
ResetMainCallback();
|
||||
ResetVBlankIntrFunc();
|
||||
|
|
|
|||
2772
src/rom_27E08.c
2772
src/rom_27E08.c
File diff suppressed because it is too large
Load Diff
1668
src/rom_27F94.c
1668
src/rom_27F94.c
File diff suppressed because it is too large
Load Diff
124
src/rom_2C538.c
124
src/rom_2C538.c
|
|
@ -3,11 +3,11 @@
|
|||
#include "main.h"
|
||||
#include "constants/bg_music.h"
|
||||
|
||||
extern const u8 gUnknown_0847DF0C[][0x300];
|
||||
extern const u8 gRubyRampGateTileGfx[][0x300];
|
||||
extern const u8 gRubyBoardRampPrize_Gfx[][0x80];
|
||||
|
||||
|
||||
void sub_2C538(void)
|
||||
void UpdateRubyRampPrizeGate(void)
|
||||
{
|
||||
s16 i;
|
||||
struct OamDataSimple *oamSimple;
|
||||
|
|
@ -17,71 +17,71 @@ void sub_2C538(void)
|
|||
s16 index;
|
||||
|
||||
index = 0;
|
||||
switch (gCurrentPinballGame->unk300)
|
||||
switch (gCurrentPinballGame->rampGateState)
|
||||
{
|
||||
case 0:
|
||||
index = (gCurrentPinballGame->unk304 % 36) / 18;
|
||||
gCurrentPinballGame->unk304++;
|
||||
gCurrentPinballGame->unk301 = 0;
|
||||
index = (gCurrentPinballGame->rampGateAnimCounter % 36) / 18;
|
||||
gCurrentPinballGame->rampGateAnimCounter++;
|
||||
gCurrentPinballGame->rampGateHitFlag = 0;
|
||||
break;
|
||||
case 1:
|
||||
index = (gCurrentPinballGame->unk304 % 36) / 18 + 2;
|
||||
gCurrentPinballGame->unk304++;
|
||||
if (gCurrentPinballGame->unk301)
|
||||
index = (gCurrentPinballGame->rampGateAnimCounter % 36) / 18 + 2;
|
||||
gCurrentPinballGame->rampGateAnimCounter++;
|
||||
if (gCurrentPinballGame->rampGateHitFlag)
|
||||
{
|
||||
gCurrentPinballGame->unk300 = 2;
|
||||
gCurrentPinballGame->unk304 = 0;
|
||||
gCurrentPinballGame->rampGateState = 2;
|
||||
gCurrentPinballGame->rampGateAnimCounter = 0;
|
||||
}
|
||||
gCurrentPinballGame->unk301 = 0;
|
||||
gCurrentPinballGame->rampGateHitFlag = 0;
|
||||
break;
|
||||
case 2:
|
||||
index = (gCurrentPinballGame->unk304 % 9) / 3 + 4;
|
||||
gCurrentPinballGame->unk304++;
|
||||
if (gCurrentPinballGame->unk304 == 9)
|
||||
index = (gCurrentPinballGame->rampGateAnimCounter % 9) / 3 + 4;
|
||||
gCurrentPinballGame->rampGateAnimCounter++;
|
||||
if (gCurrentPinballGame->rampGateAnimCounter == 9)
|
||||
{
|
||||
gCurrentPinballGame->unk300 = 3;
|
||||
gCurrentPinballGame->unk304 = 0;
|
||||
gCurrentPinballGame->rampGateState = 3;
|
||||
gCurrentPinballGame->rampGateAnimCounter = 0;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
index = (gCurrentPinballGame->unk304 % 36) / 18 + 2;
|
||||
gCurrentPinballGame->unk304++;
|
||||
if (gCurrentPinballGame->unk304 > 65)
|
||||
index = (gCurrentPinballGame->rampGateAnimCounter % 36) / 18 + 2;
|
||||
gCurrentPinballGame->rampGateAnimCounter++;
|
||||
if (gCurrentPinballGame->rampGateAnimCounter > 65)
|
||||
{
|
||||
gCurrentPinballGame->unk300 = 1;
|
||||
gCurrentPinballGame->unk304 = 0;
|
||||
gCurrentPinballGame->rampGateState = 1;
|
||||
gCurrentPinballGame->rampGateAnimCounter = 0;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk304 > 6 && gCurrentPinballGame->unk301)
|
||||
if (gCurrentPinballGame->rampGateAnimCounter > 6 && gCurrentPinballGame->rampGateHitFlag)
|
||||
{
|
||||
gCurrentPinballGame->unk300 = 4;
|
||||
gCurrentPinballGame->unk304 = 0;
|
||||
gCurrentPinballGame->unk301 = 0;
|
||||
gCurrentPinballGame->rampGateState = 4;
|
||||
gCurrentPinballGame->rampGateAnimCounter = 0;
|
||||
gCurrentPinballGame->rampGateHitFlag = 0;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
index = (gCurrentPinballGame->unk304 % 9) / 3 + 7;
|
||||
gCurrentPinballGame->unk304++;
|
||||
if (gCurrentPinballGame->unk304 == 9)
|
||||
index = (gCurrentPinballGame->rampGateAnimCounter % 9) / 3 + 7;
|
||||
gCurrentPinballGame->rampGateAnimCounter++;
|
||||
if (gCurrentPinballGame->rampGateAnimCounter == 9)
|
||||
{
|
||||
gCurrentPinballGame->unk300 = 5;
|
||||
gCurrentPinballGame->unk304 = 0;
|
||||
gCurrentPinballGame->rampGateState = 5;
|
||||
gCurrentPinballGame->rampGateAnimCounter = 0;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
index = (gCurrentPinballGame->unk304 % 36) / 18 + 2;
|
||||
gCurrentPinballGame->unk304++;
|
||||
if (gCurrentPinballGame->unk304 > 65)
|
||||
index = (gCurrentPinballGame->rampGateAnimCounter % 36) / 18 + 2;
|
||||
gCurrentPinballGame->rampGateAnimCounter++;
|
||||
if (gCurrentPinballGame->rampGateAnimCounter > 65)
|
||||
{
|
||||
gCurrentPinballGame->unk300 = 1;
|
||||
gCurrentPinballGame->unk304 = 0;
|
||||
gCurrentPinballGame->rampGateState = 1;
|
||||
gCurrentPinballGame->rampGateAnimCounter = 0;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk304 > 6 && gCurrentPinballGame->unk301)
|
||||
if (gCurrentPinballGame->rampGateAnimCounter > 6 && gCurrentPinballGame->rampGateHitFlag)
|
||||
{
|
||||
gCurrentPinballGame->unk300 = 2;
|
||||
gCurrentPinballGame->unk304 = 0;
|
||||
gCurrentPinballGame->unk301 = 0;
|
||||
gCurrentPinballGame->rampGateState = 2;
|
||||
gCurrentPinballGame->rampGateAnimCounter = 0;
|
||||
gCurrentPinballGame->rampGateHitFlag = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -89,21 +89,21 @@ void sub_2C538(void)
|
|||
group = &gMain.spriteGroups[68];
|
||||
if (group->available)
|
||||
{
|
||||
if (gCurrentPinballGame->unk300 < 3)
|
||||
if (gCurrentPinballGame->rampGateState < 3)
|
||||
{
|
||||
group->baseX = 188 - gCurrentPinballGame->unk58;
|
||||
group->baseY = 281 - gCurrentPinballGame->unk5A;
|
||||
group->baseX = 188 - gCurrentPinballGame->cameraXOffset;
|
||||
group->baseY = 281 - gCurrentPinballGame->cameraYOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
group->baseX = 192 - gCurrentPinballGame->unk58;
|
||||
group->baseY = 278 - gCurrentPinballGame->unk5A;
|
||||
group->baseX = 192 - gCurrentPinballGame->cameraXOffset;
|
||||
group->baseY = 278 - gCurrentPinballGame->cameraYOffset;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk302 > 0)
|
||||
if (gCurrentPinballGame->rampPrizeVisibilityTimer > 0)
|
||||
{
|
||||
gCurrentPinballGame->unk302--;
|
||||
if (gCurrentPinballGame->unk302 == 0)
|
||||
gCurrentPinballGame->rampPrizeVisibilityTimer--;
|
||||
if (gCurrentPinballGame->rampPrizeVisibilityTimer == 0)
|
||||
gMain.spriteGroups[68].available = 0;
|
||||
}
|
||||
|
||||
|
|
@ -112,22 +112,22 @@ void sub_2C538(void)
|
|||
gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk300 == 4 || gCurrentPinballGame->unk300 == 2)
|
||||
if (gCurrentPinballGame->rampGateState == 4 || gCurrentPinballGame->rampGateState == 2)
|
||||
{
|
||||
x = gCurrentPinballGame->ball->positionQ0.x - 190;
|
||||
y = gCurrentPinballGame->ball->positionQ0.y - 285;
|
||||
squaredMagnitude = (x * x) + (y * y);
|
||||
if(squaredMagnitude >= 0 && squaredMagnitude <= 140)
|
||||
{
|
||||
if (gCurrentPinballGame->unk302 <= 0)
|
||||
if (gCurrentPinballGame->rampPrizeVisibilityTimer <= 0)
|
||||
{
|
||||
m4aSongNumStart(SE_UNKNOWN_0xC5);
|
||||
gCurrentPinballGame->scoreAddedInFrame = 10000;
|
||||
gCurrentPinballGame->ball->velocity.x = -600;
|
||||
gCurrentPinballGame->ball->velocity.y = -300;
|
||||
gCurrentPinballGame->ball->unk6 = 0;
|
||||
gCurrentPinballGame->ball->spinSpeed = 0;
|
||||
gMain.spriteGroups[68].available = 1;
|
||||
gCurrentPinballGame->unk302 = 6;
|
||||
gCurrentPinballGame->rampPrizeVisibilityTimer = 6;
|
||||
PlayRumble(8);
|
||||
}
|
||||
}
|
||||
|
|
@ -136,9 +136,9 @@ void sub_2C538(void)
|
|||
group = &gMain.spriteGroups[58];
|
||||
if (group->available)
|
||||
{
|
||||
group->baseX = 184 - gCurrentPinballGame->unk58;
|
||||
group->baseY = 277 - gCurrentPinballGame->unk5A;
|
||||
DmaCopy16(3, gUnknown_0847DF0C[index], (void*) 0x06013580, 0x300);
|
||||
group->baseX = 184 - gCurrentPinballGame->cameraXOffset;
|
||||
group->baseY = 277 - gCurrentPinballGame->cameraYOffset;
|
||||
DmaCopy16(3, gRubyRampGateTileGfx[index], (void*) 0x06013580, 0x300);
|
||||
for (i = 0; i < 3;i++)
|
||||
{
|
||||
oamSimple = &group->oam[i];
|
||||
|
|
@ -148,7 +148,7 @@ void sub_2C538(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_2C9A4(void)
|
||||
void DrawRubyNuzleafPlatformSprite(void)
|
||||
{
|
||||
struct OamDataSimple *oamSimple;
|
||||
struct SpriteGroup *group;
|
||||
|
|
@ -157,16 +157,16 @@ void sub_2C9A4(void)
|
|||
group = &gMain.spriteGroups[66];
|
||||
if (group->available)
|
||||
{
|
||||
if (gCurrentPinballGame->unk29F)
|
||||
group->baseY = (gCurrentPinballGame->unk290 % 32) / 8 - (gCurrentPinballGame->unk5A - 52);
|
||||
if (gCurrentPinballGame->rampPrizeType)
|
||||
group->baseY = (gCurrentPinballGame->globalAnimFrameCounter % 32) / 8 - (gCurrentPinballGame->cameraYOffset - 52);
|
||||
else
|
||||
group->baseY = 180;
|
||||
|
||||
group->baseX = 120 - gCurrentPinballGame->unk58;
|
||||
if (gCurrentPinballGame->unk29F == 1)
|
||||
index = (gCurrentPinballGame->unk290 % 32) / 8 + 4;
|
||||
group->baseX = 120 - gCurrentPinballGame->cameraXOffset;
|
||||
if (gCurrentPinballGame->rampPrizeType == 1)
|
||||
index = (gCurrentPinballGame->globalAnimFrameCounter % 32) / 8 + 4;
|
||||
else
|
||||
index = (gCurrentPinballGame->unk290 % 32) / 8;
|
||||
index = (gCurrentPinballGame->globalAnimFrameCounter % 32) / 8;
|
||||
|
||||
DmaCopy16(3, gRubyBoardRampPrize_Gfx[index], (void *) 0x06014B00, 0x80);
|
||||
oamSimple = &group->oam[0];
|
||||
|
|
|
|||
1230
src/rom_2E67C.c
1230
src/rom_2E67C.c
File diff suppressed because it is too large
Load Diff
386
src/rom_30480.c
386
src/rom_30480.c
|
|
@ -3,28 +3,28 @@
|
|||
#include "main.h"
|
||||
#include "constants/bg_music.h"
|
||||
|
||||
extern const u16 gUnknown_086B4D4E[40][2][3];
|
||||
extern const u16 gUnknown_086AE54A[];
|
||||
extern const u16 gHatchCaveOamFramesets[40][2][3];
|
||||
extern const u16 gSeedotBasketBounceFrames[];
|
||||
extern const u8 gSapphireStageBasket_Gfx[][0x280];
|
||||
extern const u8 gSapphireBoardSeedot_Gfx[][0x180];
|
||||
extern const u16 gUnknown_086AE544[];
|
||||
extern const u16 gSeedotBaseXPositions[];
|
||||
extern const u16 gSapphireBoardSeedotSpritesheetOam[6][6][2][3];
|
||||
extern const u16 gUnknown_08137D06[][14];
|
||||
extern const u16 gUnknown_08137CF6[][4];
|
||||
extern const u16 gUnknown_08137CE2[][5];
|
||||
extern const u16 gShopSignTransitionFrames[][14];
|
||||
extern const u16 gShopSignIntroFrames[][4];
|
||||
extern const u16 gShopSignLoopFrames[][5];
|
||||
|
||||
|
||||
void sub_30480(void)
|
||||
void InitSapphireEggCaveState(void)
|
||||
{
|
||||
gCurrentPinballGame->unk1EC = 1;
|
||||
gCurrentPinballGame->unk1EE = 0;
|
||||
gCurrentPinballGame->unk1ED = 0;
|
||||
gCurrentPinballGame->unk1F0 = 0;
|
||||
gCurrentPinballGame->unk1F4 = 2080;
|
||||
gCurrentPinballGame->unk1F6 = 700;
|
||||
gCurrentPinballGame->eggAnimationPhase = 1;
|
||||
gCurrentPinballGame->prevEggAnimFrame = 0;
|
||||
gCurrentPinballGame->eggAnimFrameIndex = 0;
|
||||
gCurrentPinballGame->eggFrameTimer = 0;
|
||||
gCurrentPinballGame->portraitOffsetX = 2080;
|
||||
gCurrentPinballGame->portraitOffsetY = 700;
|
||||
}
|
||||
|
||||
void sub_304C8(void)
|
||||
void UpdateSapphireEggCaveAnimation(void)
|
||||
{
|
||||
s16 i;
|
||||
struct SpriteGroup *group;
|
||||
|
|
@ -43,7 +43,7 @@ void sub_304C8(void)
|
|||
var2 = 0;
|
||||
group = &gMain.spriteGroups[52];
|
||||
sp0 = 0;
|
||||
switch (gCurrentPinballGame->unk1EC)
|
||||
switch (gCurrentPinballGame->eggAnimationPhase)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
|
|
@ -70,72 +70,72 @@ void sub_304C8(void)
|
|||
break;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk1EE != gCurrentPinballGame->unk1ED)
|
||||
if (gCurrentPinballGame->prevEggAnimFrame != gCurrentPinballGame->eggAnimFrameIndex)
|
||||
{
|
||||
index = gUnknown_086AD2EE[gCurrentPinballGame->unk1ED][3];
|
||||
DmaCopy16(3, &gUnknown_084FD18C[index], (void *)0x06011CE0, 0x200);
|
||||
gCurrentPinballGame->unk1EE = gCurrentPinballGame->unk1ED;
|
||||
index = gEggAnimationFrameData[gCurrentPinballGame->eggAnimFrameIndex][3];
|
||||
DmaCopy16(3, &gEggFrameTilesGfx[index], (void *)0x06011CE0, 0x200);
|
||||
gCurrentPinballGame->prevEggAnimFrame = gCurrentPinballGame->eggAnimFrameIndex;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk1EC > 1)
|
||||
if (gCurrentPinballGame->eggAnimationPhase > 1)
|
||||
{
|
||||
if (gUnknown_086AD2EE[gCurrentPinballGame->unk1ED][1] > gCurrentPinballGame->unk1F0)
|
||||
if (gEggAnimationFrameData[gCurrentPinballGame->eggAnimFrameIndex][1] > gCurrentPinballGame->eggFrameTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk1F0++;
|
||||
gCurrentPinballGame->eggFrameTimer++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk1ED++;
|
||||
gCurrentPinballGame->unk1F0 = 0;
|
||||
if (gCurrentPinballGame->unk1ED >= var3)
|
||||
gCurrentPinballGame->eggAnimFrameIndex++;
|
||||
gCurrentPinballGame->eggFrameTimer = 0;
|
||||
if (gCurrentPinballGame->eggAnimFrameIndex >= var3)
|
||||
{
|
||||
gCurrentPinballGame->unk1ED = var1;
|
||||
gCurrentPinballGame->unk1EC = var2;
|
||||
gCurrentPinballGame->eggAnimFrameIndex = var1;
|
||||
gCurrentPinballGame->eggAnimationPhase = var2;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk1ED == 18)
|
||||
if (gCurrentPinballGame->eggAnimFrameIndex == 18)
|
||||
BuildSpeciesWeightsForEggMode();
|
||||
|
||||
if (gCurrentPinballGame->unk1ED == 19)
|
||||
if (gCurrentPinballGame->eggAnimFrameIndex == 19)
|
||||
{
|
||||
PickSpeciesForEggMode();
|
||||
if (gMain.mainState != STATE_GAME_IDLE)
|
||||
SaveFile_SetPokedexFlags(gCurrentPinballGame->currentSpecies, 1);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk1ED == 20)
|
||||
sub_28BFC();
|
||||
if (gCurrentPinballGame->eggAnimFrameIndex == 20)
|
||||
LoadEggSpriteGraphics();
|
||||
|
||||
if ((gCurrentPinballGame->unk1ED == 8 || gCurrentPinballGame->unk1ED == 27) && gCurrentPinballGame->unk1F0 == 0)
|
||||
if ((gCurrentPinballGame->eggAnimFrameIndex == 8 || gCurrentPinballGame->eggAnimFrameIndex == 27) && gCurrentPinballGame->eggFrameTimer == 0)
|
||||
m4aMPlayAllStop();
|
||||
|
||||
if (gCurrentPinballGame->unk1ED == 12 && gCurrentPinballGame->unk1F0 == 0)
|
||||
if (gCurrentPinballGame->eggAnimFrameIndex == 12 && gCurrentPinballGame->eggFrameTimer == 0)
|
||||
m4aSongNumStart(MUS_EGG_MODE_START);
|
||||
|
||||
if (gCurrentPinballGame->unk1ED == 29)
|
||||
sub_19B64(5);
|
||||
if (gCurrentPinballGame->eggAnimFrameIndex == 29)
|
||||
RequestBoardStateTransition(5);
|
||||
|
||||
if (gCurrentPinballGame->unk1ED == 28)
|
||||
if (gCurrentPinballGame->eggAnimFrameIndex == 28)
|
||||
m4aSongNumStart(SE_UNKNOWN_0x92);
|
||||
}
|
||||
|
||||
sp0 = gUnknown_086AD2EE[gCurrentPinballGame->unk1ED][0];
|
||||
sp0 = gEggAnimationFrameData[gCurrentPinballGame->eggAnimFrameIndex][0];
|
||||
}
|
||||
|
||||
group->baseX = gCurrentPinballGame->unk1F4 / 10 - gCurrentPinballGame->unk58;
|
||||
if (gCurrentPinballGame->unk1EC > 0)
|
||||
group->baseX = gCurrentPinballGame->portraitOffsetX / 10 - gCurrentPinballGame->cameraXOffset;
|
||||
if (gCurrentPinballGame->eggAnimationPhase > 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk1ED == 32 && gCurrentPinballGame->unk1F0 > 208)
|
||||
if (gCurrentPinballGame->eggAnimFrameIndex == 32 && gCurrentPinballGame->eggFrameTimer > 208)
|
||||
{
|
||||
var0 = (0x100 - gCurrentPinballGame->unk1F0) / 16;
|
||||
var0 = (0x100 - gCurrentPinballGame->eggFrameTimer) / 16;
|
||||
if (gMain.systemFrameCount & ((var0 + 1) * 2))
|
||||
group->baseY = gCurrentPinballGame->unk1F6 / 10 - gCurrentPinballGame->unk5A;
|
||||
group->baseY = gCurrentPinballGame->portraitOffsetY / 10 - gCurrentPinballGame->cameraYOffset;
|
||||
else
|
||||
group->baseY = 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
group->baseY = gCurrentPinballGame->unk1F6 / 10 - gCurrentPinballGame->unk5A;
|
||||
group->baseY = gCurrentPinballGame->portraitOffsetY / 10 - gCurrentPinballGame->cameraYOffset;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -147,7 +147,7 @@ void sub_304C8(void)
|
|||
{
|
||||
oamSimple = &group->oam[i];
|
||||
dst = (u16*)&gOamBuffer[oamSimple->oamId];
|
||||
src = gUnknown_086B4D4E[sp0][i];
|
||||
src = gHatchCaveOamFramesets[sp0][i];
|
||||
*dst++ = *src++;
|
||||
*dst++ = *src++;
|
||||
*dst++ = *src++;
|
||||
|
|
@ -159,9 +159,9 @@ void sub_304C8(void)
|
|||
group = &gMain.spriteGroups[51];
|
||||
if (group->available)
|
||||
{
|
||||
group->baseX = 192 - gCurrentPinballGame->unk58;
|
||||
if (gCurrentPinballGame->unk346 > 2 && gMain.modeChangeFlags)
|
||||
group->baseY = 56 - gCurrentPinballGame->unk5A;
|
||||
group->baseX = 192 - gCurrentPinballGame->cameraXOffset;
|
||||
if (gCurrentPinballGame->holeLetterSystemState > 2 && gMain.modeChangeFlags)
|
||||
group->baseY = 56 - gCurrentPinballGame->cameraYOffset;
|
||||
else
|
||||
group->baseY = 200;
|
||||
|
||||
|
|
@ -171,207 +171,207 @@ void sub_304C8(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_308DC(void)
|
||||
void UpdateSapphireSeedotCollection(void)
|
||||
{
|
||||
s16 i;
|
||||
s16 var0;
|
||||
|
||||
if (gCurrentPinballGame->unk328)
|
||||
if (gCurrentPinballGame->seedotCollisionTrigger)
|
||||
{
|
||||
if (gCurrentPinballGame->unk13 != 7)
|
||||
if (gCurrentPinballGame->boardState != 7)
|
||||
{
|
||||
if (gCurrentPinballGame->unk13 < 3)
|
||||
if (gCurrentPinballGame->boardState < 3)
|
||||
{
|
||||
if (gCurrentPinballGame->unk6BD < 3)
|
||||
if (gCurrentPinballGame->seedotCount < 3)
|
||||
{
|
||||
gCurrentPinballGame->unk33C[gCurrentPinballGame->unk6BD] = -100;
|
||||
gCurrentPinballGame->unk332[gCurrentPinballGame->unk6BD] = 0;
|
||||
gCurrentPinballGame->unk336[gCurrentPinballGame->unk6BD] = 0;
|
||||
gCurrentPinballGame->unk32C[gCurrentPinballGame->unk6BD] = 1;
|
||||
gCurrentPinballGame->unk336[gCurrentPinballGame->unk6BD] = 0;
|
||||
gCurrentPinballGame->unk6BD++;
|
||||
gCurrentPinballGame->unk32A = 1800;
|
||||
if (gCurrentPinballGame->unk6BD == 3)
|
||||
gCurrentPinballGame->unk6C2 = 1;
|
||||
gCurrentPinballGame->seedotYOffset[gCurrentPinballGame->seedotCount] = -100;
|
||||
gCurrentPinballGame->seedotOamFramesetIndex[gCurrentPinballGame->seedotCount] = 0;
|
||||
gCurrentPinballGame->seedotAnimTimer[gCurrentPinballGame->seedotCount] = 0;
|
||||
gCurrentPinballGame->seedotState[gCurrentPinballGame->seedotCount] = 1;
|
||||
gCurrentPinballGame->seedotAnimTimer[gCurrentPinballGame->seedotCount] = 0;
|
||||
gCurrentPinballGame->seedotCount++;
|
||||
gCurrentPinballGame->seedotDecayTimer = 1800;
|
||||
if (gCurrentPinballGame->seedotCount == 3)
|
||||
gCurrentPinballGame->seedotModeStartDelay = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk6BD < 2)
|
||||
if (gCurrentPinballGame->seedotCount < 2)
|
||||
{
|
||||
gCurrentPinballGame->unk33C[gCurrentPinballGame->unk6BD] = -100;
|
||||
gCurrentPinballGame->unk332[gCurrentPinballGame->unk6BD] = 0;
|
||||
gCurrentPinballGame->unk336[gCurrentPinballGame->unk6BD] = 0;
|
||||
gCurrentPinballGame->unk32C[gCurrentPinballGame->unk6BD] = 1;
|
||||
gCurrentPinballGame->unk336[gCurrentPinballGame->unk6BD] = 0;
|
||||
gCurrentPinballGame->unk32A = 1800;
|
||||
gCurrentPinballGame->unk6BD++;
|
||||
gCurrentPinballGame->seedotYOffset[gCurrentPinballGame->seedotCount] = -100;
|
||||
gCurrentPinballGame->seedotOamFramesetIndex[gCurrentPinballGame->seedotCount] = 0;
|
||||
gCurrentPinballGame->seedotAnimTimer[gCurrentPinballGame->seedotCount] = 0;
|
||||
gCurrentPinballGame->seedotState[gCurrentPinballGame->seedotCount] = 1;
|
||||
gCurrentPinballGame->seedotAnimTimer[gCurrentPinballGame->seedotCount] = 0;
|
||||
gCurrentPinballGame->seedotDecayTimer = 1800;
|
||||
gCurrentPinballGame->seedotCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk328 = 0;
|
||||
gCurrentPinballGame->seedotCollisionTrigger = 0;
|
||||
gCurrentPinballGame->scoreAddedInFrame = 3000;
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
switch (gCurrentPinballGame->unk32C[i])
|
||||
switch (gCurrentPinballGame->seedotState[i])
|
||||
{
|
||||
case 0:
|
||||
gCurrentPinballGame->unk33C[i] = -100;
|
||||
gCurrentPinballGame->unk332[i] = 0;
|
||||
gCurrentPinballGame->unk336[i] = 0;
|
||||
gCurrentPinballGame->seedotYOffset[i] = -100;
|
||||
gCurrentPinballGame->seedotOamFramesetIndex[i] = 0;
|
||||
gCurrentPinballGame->seedotAnimTimer[i] = 0;
|
||||
break;
|
||||
case 1:
|
||||
if (gCurrentPinballGame->unk336[i] < 33)
|
||||
if (gCurrentPinballGame->seedotAnimTimer[i] < 33)
|
||||
{
|
||||
if (gCurrentPinballGame->unk336[i] == 0)
|
||||
if (gCurrentPinballGame->seedotAnimTimer[i] == 0)
|
||||
m4aSongNumStart(SE_UNKNOWN_0xE9);
|
||||
|
||||
if (gCurrentPinballGame->unk336[i] == 26)
|
||||
if (gCurrentPinballGame->seedotAnimTimer[i] == 26)
|
||||
m4aSongNumStart(SE_UNKNOWN_0xEA);
|
||||
|
||||
gCurrentPinballGame->unk336[i]++;
|
||||
if (gCurrentPinballGame->unk336[i] < 21)
|
||||
gCurrentPinballGame->seedotAnimTimer[i]++;
|
||||
if (gCurrentPinballGame->seedotAnimTimer[i] < 21)
|
||||
{
|
||||
gCurrentPinballGame->unk32F[i] = 0;
|
||||
gCurrentPinballGame->unk33C[i] = gCurrentPinballGame->unk336[i] * 4 - 80;
|
||||
if (gCurrentPinballGame->unk336[i] == 20)
|
||||
gCurrentPinballGame->unk326 = 23;
|
||||
gCurrentPinballGame->seedotSpriteFrame[i] = 0;
|
||||
gCurrentPinballGame->seedotYOffset[i] = gCurrentPinballGame->seedotAnimTimer[i] * 4 - 80;
|
||||
if (gCurrentPinballGame->seedotAnimTimer[i] == 20)
|
||||
gCurrentPinballGame->basketBounceTimer = 23;
|
||||
}
|
||||
else if (gCurrentPinballGame->unk336[i] < 25)
|
||||
else if (gCurrentPinballGame->seedotAnimTimer[i] < 25)
|
||||
{
|
||||
gCurrentPinballGame->unk32F[i] = 1;
|
||||
gCurrentPinballGame->seedotSpriteFrame[i] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk32F[i] = 2;
|
||||
gCurrentPinballGame->seedotSpriteFrame[i] = 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk32C[i] = 2;
|
||||
gCurrentPinballGame->unk336[i] = 0;
|
||||
gCurrentPinballGame->seedotState[i] = 2;
|
||||
gCurrentPinballGame->seedotAnimTimer[i] = 0;
|
||||
if (i == 2)
|
||||
sub_19B64(7);
|
||||
RequestBoardStateTransition(7);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
gCurrentPinballGame->unk32F[i] = (((gCurrentPinballGame->unk290 % 32) / 16) * 2) + 1;
|
||||
if (gCurrentPinballGame->unk32F[i] == 1)
|
||||
gCurrentPinballGame->unk33C[i] = -2;
|
||||
gCurrentPinballGame->seedotSpriteFrame[i] = (((gCurrentPinballGame->globalAnimFrameCounter % 32) / 16) * 2) + 1;
|
||||
if (gCurrentPinballGame->seedotSpriteFrame[i] == 1)
|
||||
gCurrentPinballGame->seedotYOffset[i] = -2;
|
||||
else
|
||||
gCurrentPinballGame->unk33C[i] = 0;
|
||||
gCurrentPinballGame->seedotYOffset[i] = 0;
|
||||
break;
|
||||
case 3:
|
||||
var0 = gCurrentPinballGame->unk336[i];
|
||||
var0 = gCurrentPinballGame->seedotAnimTimer[i];
|
||||
if (var0 < 32)
|
||||
{
|
||||
gCurrentPinballGame->unk32F[i] = var0 / 16 + 4;
|
||||
gCurrentPinballGame->unk332[i] = var0 / 16 + 1;
|
||||
gCurrentPinballGame->seedotSpriteFrame[i] = var0 / 16 + 4;
|
||||
gCurrentPinballGame->seedotOamFramesetIndex[i] = var0 / 16 + 1;
|
||||
}
|
||||
else if (var0 < 38)
|
||||
{
|
||||
if (var0 == 32 && (gMain.modeChangeFlags & MODE_CHANGE_END_OF_GAME) == 0)
|
||||
m4aSongNumStart(SE_UNKNOWN_0xEB);
|
||||
|
||||
gCurrentPinballGame->unk32F[i] = 6;
|
||||
gCurrentPinballGame->unk332[i] = 3;
|
||||
gCurrentPinballGame->seedotSpriteFrame[i] = 6;
|
||||
gCurrentPinballGame->seedotOamFramesetIndex[i] = 3;
|
||||
}
|
||||
else if (var0 < 46)
|
||||
{
|
||||
gCurrentPinballGame->unk332[i] = 4;
|
||||
gCurrentPinballGame->seedotOamFramesetIndex[i] = 4;
|
||||
}
|
||||
else if (var0 < 54)
|
||||
{
|
||||
gCurrentPinballGame->unk332[i] = 5;
|
||||
gCurrentPinballGame->seedotOamFramesetIndex[i] = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk32C[i] = 0;
|
||||
gCurrentPinballGame->seedotState[i] = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk336[i]++;
|
||||
gCurrentPinballGame->seedotAnimTimer[i]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk326)
|
||||
if (gCurrentPinballGame->basketBounceTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk324 = gUnknown_086AE54A[gCurrentPinballGame->unk326 / 6];
|
||||
gCurrentPinballGame->unk326--;
|
||||
gCurrentPinballGame->basketBounceFrame = gSeedotBasketBounceFrames[gCurrentPinballGame->basketBounceTimer / 6];
|
||||
gCurrentPinballGame->basketBounceTimer--;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk6C2)
|
||||
if (gCurrentPinballGame->seedotModeStartDelay)
|
||||
{
|
||||
gCurrentPinballGame->unk6C2--;
|
||||
if (gCurrentPinballGame->unk6C2 == 0)
|
||||
gCurrentPinballGame->seedotModeStartDelay--;
|
||||
if (gCurrentPinballGame->seedotModeStartDelay == 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unkE4)
|
||||
gCurrentPinballGame->unk6C2 = 1;
|
||||
if (gCurrentPinballGame->activePortraitType)
|
||||
gCurrentPinballGame->seedotModeStartDelay = 1;
|
||||
else
|
||||
gCurrentPinballGame->unkE4 = 4;
|
||||
gCurrentPinballGame->activePortraitType = 4;
|
||||
|
||||
if (gCurrentPinballGame->unk6C2 == 0)
|
||||
if (gCurrentPinballGame->seedotModeStartDelay == 0)
|
||||
{
|
||||
gMain.modeChangeFlags |= MODE_CHANGE_BANNER;
|
||||
gCurrentPinballGame->unkEA = 70;
|
||||
gCurrentPinballGame->unkEC = 160;
|
||||
gCurrentPinballGame->unkE8 = 0;
|
||||
gCurrentPinballGame->unkE6 = 0;
|
||||
gCurrentPinballGame->unkEE = 0;
|
||||
gCurrentPinballGame->unkF2 = 4;
|
||||
gCurrentPinballGame->unkFA = 1;
|
||||
gCurrentPinballGame->unkFB = 0;
|
||||
gCurrentPinballGame->unkF4 = 120;
|
||||
gCurrentPinballGame->unkF6 = 0;
|
||||
gCurrentPinballGame->unkF0 = 50;
|
||||
gCurrentPinballGame->unkF8 = 0;
|
||||
DmaCopy16(3, gUnknown_086ACEF8[4], (void *)0x06015800, 0x2400);
|
||||
DmaCopy16(3, gUnknown_086ACF18[4], (void *)0x050003C0, 0x20);
|
||||
gCurrentPinballGame->bannerDelayTimer = 70;
|
||||
gCurrentPinballGame->bannerDisplayTimer = 160;
|
||||
gCurrentPinballGame->cameraYScrollTarget = 0;
|
||||
gCurrentPinballGame->cameraYAdjust = 0;
|
||||
gCurrentPinballGame->cameraYScrollSpeed = 0;
|
||||
gCurrentPinballGame->bannerGfxIndex = 4;
|
||||
gCurrentPinballGame->bannerActive = 1;
|
||||
gCurrentPinballGame->bannerPreserveBallState = 0;
|
||||
gCurrentPinballGame->bannerDisplayDuration = 120;
|
||||
gCurrentPinballGame->bannerSlidePosition = 0;
|
||||
gCurrentPinballGame->bannerSlideTimer = 50;
|
||||
gCurrentPinballGame->bannerSlideVelocity = 0;
|
||||
DmaCopy16(3, gModeBannerTilemaps[4], (void *)0x06015800, 0x2400);
|
||||
DmaCopy16(3, gModeBannerPalettes[4], (void *)0x050003C0, 0x20);
|
||||
gMain.blendControl = 0xCE;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gCurrentPinballGame->unk6BE)
|
||||
if (gCurrentPinballGame->seedotExitSequenceActive)
|
||||
{
|
||||
var0 = gCurrentPinballGame->unk6C0++;
|
||||
var0 = gCurrentPinballGame->seedotExitSequenceTimer++;
|
||||
if (var0 <= 60)
|
||||
{
|
||||
if (var0 % 30 == 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk32C[var0 / 30] == 2)
|
||||
if (gCurrentPinballGame->seedotState[var0 / 30] == 2)
|
||||
{
|
||||
gCurrentPinballGame->unk32C[var0 / 30] = 3;
|
||||
gCurrentPinballGame->unk336[var0 / 30] = 0;
|
||||
gCurrentPinballGame->seedotState[var0 / 30] = 3;
|
||||
gCurrentPinballGame->seedotAnimTimer[var0 / 30] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk6BE = 0;
|
||||
gCurrentPinballGame->unk6C0 = 0;
|
||||
gCurrentPinballGame->seedotExitSequenceActive = 0;
|
||||
gCurrentPinballGame->seedotExitSequenceTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk32A)
|
||||
if (gCurrentPinballGame->seedotDecayTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk32A--;
|
||||
if (gCurrentPinballGame->unk32A == 0)
|
||||
gCurrentPinballGame->seedotDecayTimer--;
|
||||
if (gCurrentPinballGame->seedotDecayTimer == 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk6BD == 1 || gCurrentPinballGame->unk6BD == 2)
|
||||
if (gCurrentPinballGame->seedotCount == 1 || gCurrentPinballGame->seedotCount == 2)
|
||||
{
|
||||
gCurrentPinballGame->unk6BD--;
|
||||
gCurrentPinballGame->unk32C[gCurrentPinballGame->unk6BD] = 3;
|
||||
gCurrentPinballGame->unk336[gCurrentPinballGame->unk6BD] = 0;
|
||||
gCurrentPinballGame->unk32A = 1800;
|
||||
gCurrentPinballGame->seedotCount--;
|
||||
gCurrentPinballGame->seedotState[gCurrentPinballGame->seedotCount] = 3;
|
||||
gCurrentPinballGame->seedotAnimTimer[gCurrentPinballGame->seedotCount] = 0;
|
||||
gCurrentPinballGame->seedotDecayTimer = 1800;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_30EB4(void)
|
||||
void DrawSapphireSeedotAndBasketSprites(void)
|
||||
{
|
||||
s16 i, j;
|
||||
struct SpriteGroup *group;
|
||||
|
|
@ -385,9 +385,9 @@ void sub_30EB4(void)
|
|||
if (!group->available)
|
||||
return;
|
||||
|
||||
group->baseX = 10 - gCurrentPinballGame->unk58;
|
||||
group->baseY = 298 - gCurrentPinballGame->unk5A;
|
||||
index = gCurrentPinballGame->unk324;
|
||||
group->baseX = 10 - gCurrentPinballGame->cameraXOffset;
|
||||
group->baseY = 298 - gCurrentPinballGame->cameraYOffset;
|
||||
index = gCurrentPinballGame->basketBounceFrame;
|
||||
DmaCopy16(3, gSapphireStageBasket_Gfx[index], (void *)0x060139A0, 0x280);
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
|
|
@ -398,8 +398,8 @@ void sub_30EB4(void)
|
|||
}
|
||||
|
||||
group = &gMain.spriteGroups[68];
|
||||
group->baseX = 10 - gCurrentPinballGame->unk58;
|
||||
group->baseY = 298 - gCurrentPinballGame->unk5A;
|
||||
group->baseX = 10 - gCurrentPinballGame->cameraXOffset;
|
||||
group->baseY = 298 - gCurrentPinballGame->cameraYOffset;
|
||||
oamSimple = &group->oam[0];
|
||||
gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + group->baseX;
|
||||
gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY;
|
||||
|
|
@ -408,15 +408,15 @@ void sub_30EB4(void)
|
|||
{
|
||||
group = &gMain.spriteGroups[65 + j];
|
||||
|
||||
var0 = gUnknown_086AE544[j] - j;
|
||||
group->baseX = var0 - gCurrentPinballGame->unk58;
|
||||
if (gCurrentPinballGame->unk32C[j] > 0)
|
||||
group->baseY = gCurrentPinballGame->unk33C[j] + 292 - gCurrentPinballGame->unk5A;
|
||||
var0 = gSeedotBaseXPositions[j] - j;
|
||||
group->baseX = var0 - gCurrentPinballGame->cameraXOffset;
|
||||
if (gCurrentPinballGame->seedotState[j] > 0)
|
||||
group->baseY = gCurrentPinballGame->seedotYOffset[j] + 292 - gCurrentPinballGame->cameraYOffset;
|
||||
else
|
||||
group->baseY = 200;
|
||||
|
||||
DmaCopy16(3, gSapphireBoardSeedot_Gfx[gCurrentPinballGame->unk32F[j]], (void *)0x06013C20 + j * 0x180, 0x160);
|
||||
index = gCurrentPinballGame->unk332[j];
|
||||
DmaCopy16(3, gSapphireBoardSeedot_Gfx[gCurrentPinballGame->seedotSpriteFrame[j]], (void *)0x06013C20 + j * 0x180, 0x160);
|
||||
index = gCurrentPinballGame->seedotOamFramesetIndex[j];
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
oamSimple = &group->oam[i];
|
||||
|
|
@ -432,96 +432,96 @@ void sub_30EB4(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_31144(void)
|
||||
void UpdateSapphireShopSignAnimation(void)
|
||||
{
|
||||
if (gCurrentPinballGame->unk1A4 == 0)
|
||||
if (gCurrentPinballGame->shopTransitionActive == 0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk1A5 == 1)
|
||||
if (gCurrentPinballGame->evolutionShopActive == 1)
|
||||
{
|
||||
if (gCurrentPinballGame->unk1B4 < 96)
|
||||
if (gCurrentPinballGame->shopAnimTimer < 96)
|
||||
{
|
||||
if (gCurrentPinballGame->unk1B4 < 8)
|
||||
gCurrentPinballGame->unk1AC = gUnknown_08137CF6[1][gCurrentPinballGame->unk1B4 / 2];
|
||||
if (gCurrentPinballGame->shopAnimTimer < 8)
|
||||
gCurrentPinballGame->shopSignFrame = gShopSignIntroFrames[1][gCurrentPinballGame->shopAnimTimer / 2];
|
||||
else
|
||||
gCurrentPinballGame->unk1AC = gUnknown_08137CE2[1][(gCurrentPinballGame->unk1B4 % 32) / 8];
|
||||
gCurrentPinballGame->shopSignFrame = gShopSignLoopFrames[1][(gCurrentPinballGame->shopAnimTimer % 32) / 8];
|
||||
|
||||
gCurrentPinballGame->unk1B4++;
|
||||
gCurrentPinballGame->shopAnimTimer++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk1B4 = 0;
|
||||
gCurrentPinballGame->shopAnimTimer = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk1AD = 2;
|
||||
gCurrentPinballGame->shopSignPaletteIndex = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk1B4 < 120)
|
||||
if (gCurrentPinballGame->shopAnimTimer < 120)
|
||||
{
|
||||
if (gCurrentPinballGame->unk1B4 < 8)
|
||||
gCurrentPinballGame->unk1AC = gUnknown_08137CF6[0][gCurrentPinballGame->unk1B4 / 2];
|
||||
if (gCurrentPinballGame->shopAnimTimer < 8)
|
||||
gCurrentPinballGame->shopSignFrame = gShopSignIntroFrames[0][gCurrentPinballGame->shopAnimTimer / 2];
|
||||
else
|
||||
gCurrentPinballGame->unk1AC = gUnknown_08137CE2[0][(gCurrentPinballGame->unk1B4 % 40) / 8];
|
||||
gCurrentPinballGame->shopSignFrame = gShopSignLoopFrames[0][(gCurrentPinballGame->shopAnimTimer % 40) / 8];
|
||||
|
||||
gCurrentPinballGame->unk1B4++;
|
||||
gCurrentPinballGame->shopAnimTimer++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk1B4 = 0;
|
||||
gCurrentPinballGame->shopAnimTimer = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk1AD = 0;
|
||||
gCurrentPinballGame->shopSignPaletteIndex = 0;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk72E > 2)
|
||||
if (gCurrentPinballGame->evoArrowProgress > 2)
|
||||
{
|
||||
if (gCurrentPinballGame->evolvablePartySize > 0 && gCurrentPinballGame->unk1A5 == 0)
|
||||
if (gCurrentPinballGame->evolvablePartySize > 0 && gCurrentPinballGame->evolutionShopActive == 0)
|
||||
{
|
||||
gCurrentPinballGame->unk1A4 = 1;
|
||||
gCurrentPinballGame->unk1B4 = 0;
|
||||
gCurrentPinballGame->unk1A5 = 1;
|
||||
gCurrentPinballGame->shopTransitionActive = 1;
|
||||
gCurrentPinballGame->shopAnimTimer = 0;
|
||||
gCurrentPinballGame->evolutionShopActive = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk13 != 6 && gCurrentPinballGame->unk1A5 == 1)
|
||||
if (gCurrentPinballGame->boardState != 6 && gCurrentPinballGame->evolutionShopActive == 1)
|
||||
{
|
||||
gCurrentPinballGame->unk1A4 = 1;
|
||||
gCurrentPinballGame->unk1B4 = 0;
|
||||
gCurrentPinballGame->unk1A5 = 0;
|
||||
gCurrentPinballGame->shopTransitionActive = 1;
|
||||
gCurrentPinballGame->shopAnimTimer = 0;
|
||||
gCurrentPinballGame->evolutionShopActive = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk1AC = gUnknown_08137D06[gCurrentPinballGame->unk1A5][gCurrentPinballGame->unk1B4 / 3];
|
||||
if (gCurrentPinballGame->unk1AC >= 4 && gCurrentPinballGame->unk1AC < 6)
|
||||
gCurrentPinballGame->shopSignFrame = gShopSignTransitionFrames[gCurrentPinballGame->evolutionShopActive][gCurrentPinballGame->shopAnimTimer / 3];
|
||||
if (gCurrentPinballGame->shopSignFrame >= 4 && gCurrentPinballGame->shopSignFrame < 6)
|
||||
{
|
||||
gCurrentPinballGame->unk1AD = 1;
|
||||
gCurrentPinballGame->shopSignPaletteIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk1A5 == 1)
|
||||
if (gCurrentPinballGame->evolutionShopActive == 1)
|
||||
{
|
||||
if (gCurrentPinballGame->unk1B4 < 15)
|
||||
gCurrentPinballGame->unk1AD = 0;
|
||||
if (gCurrentPinballGame->shopAnimTimer < 15)
|
||||
gCurrentPinballGame->shopSignPaletteIndex = 0;
|
||||
else
|
||||
gCurrentPinballGame->unk1AD = 2;
|
||||
gCurrentPinballGame->shopSignPaletteIndex = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk1B4 < 15)
|
||||
gCurrentPinballGame->unk1AD = 2;
|
||||
if (gCurrentPinballGame->shopAnimTimer < 15)
|
||||
gCurrentPinballGame->shopSignPaletteIndex = 2;
|
||||
else
|
||||
gCurrentPinballGame->unk1AD = 0;
|
||||
gCurrentPinballGame->shopSignPaletteIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk1B4++;
|
||||
if (gCurrentPinballGame->unk1B4 == 42)
|
||||
gCurrentPinballGame->shopAnimTimer++;
|
||||
if (gCurrentPinballGame->shopAnimTimer == 42)
|
||||
{
|
||||
gCurrentPinballGame->unk1A4 = 0;
|
||||
gCurrentPinballGame->unk1B4 = 0;
|
||||
gCurrentPinballGame->shopTransitionActive = 0;
|
||||
gCurrentPinballGame->shopAnimTimer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
232
src/rom_31BE8.c
232
src/rom_31BE8.c
|
|
@ -5,17 +5,17 @@
|
|||
#include "constants/fields.h"
|
||||
#include "constants/bg_music.h"
|
||||
|
||||
extern const u8 gUnknown_0845A08C[][0x100];
|
||||
extern const s16 gUnknown_086AE5A0[][2];
|
||||
extern const s16 gUnknown_086AE58A[][2];
|
||||
extern const s16 gUnknown_086AE588[][2];
|
||||
extern const u8 gUnknown_08490A4C[][0x440];
|
||||
extern struct Vector16 gUnknown_086AE554[];
|
||||
extern const u8 gSplashEffectTileGfx[][0x100];
|
||||
extern const s16 gHoleAnimKeyframeData[][2];
|
||||
extern const s16 gSplashEffectFrameDurations[][2];
|
||||
extern const s16 gSplashEffectTileIndices[][2];
|
||||
extern const u8 gHoleIndicatorTileGfx[][0x440];
|
||||
extern struct Vector16 gSplashEffectPositions[];
|
||||
extern const u8 gRubyStageCyndaquil_Gfx[][0x280];
|
||||
extern const u8 gUnknown_081BC984[][0x20];
|
||||
extern const u8 gUnknown_0848108C[][0x480];
|
||||
extern const u8 gSapphireShopSignPalettes[][0x20];
|
||||
extern const u8 gSapphireShopSignTileGfx[][0x480];
|
||||
|
||||
void sub_313A0(void)
|
||||
void DrawSapphireShopSignSprite(void)
|
||||
{
|
||||
s16 i;
|
||||
struct SpriteGroup *group;
|
||||
|
|
@ -25,11 +25,11 @@ void sub_313A0(void)
|
|||
group = &gMain.spriteGroups[69];
|
||||
if (group->available)
|
||||
{
|
||||
group->baseX = 16 - gCurrentPinballGame->unk58;
|
||||
group->baseY = 115 - gCurrentPinballGame->unk5A;
|
||||
index = gCurrentPinballGame->unk1AD + gCurrentPinballGame->unk6F * 3;
|
||||
DmaCopy16(3, gUnknown_081BC984[index], (void *)0x05000300, 0x20);
|
||||
DmaCopy16(3, gUnknown_0848108C[gCurrentPinballGame->unk1AC], (void *) 0x06014B20, 0x480);
|
||||
group->baseX = 16 - gCurrentPinballGame->cameraXOffset;
|
||||
group->baseY = 115 - gCurrentPinballGame->cameraYOffset;
|
||||
index = gCurrentPinballGame->shopSignPaletteIndex + gCurrentPinballGame->activePaletteIndex * 3;
|
||||
DmaCopy16(3, gSapphireShopSignPalettes[index], (void *)0x05000300, 0x20);
|
||||
DmaCopy16(3, gSapphireShopSignTileGfx[gCurrentPinballGame->shopSignFrame], (void *) 0x06014B20, 0x480);
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
oamSimple = &group->oam[i];
|
||||
|
|
@ -39,39 +39,39 @@ void sub_313A0(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_31498(void)
|
||||
void UpdateSapphireHoleLetterSystem(void)
|
||||
{
|
||||
s16 i, j;
|
||||
struct SpriteGroup *group;
|
||||
struct OamDataSimple *oamSimple;
|
||||
s16 index;
|
||||
|
||||
switch (gCurrentPinballGame->unk346)
|
||||
switch (gCurrentPinballGame->holeLetterSystemState)
|
||||
{
|
||||
case 0:
|
||||
if (gCurrentPinballGame->unk344)
|
||||
if (gCurrentPinballGame->holeLetterNewHit)
|
||||
{
|
||||
if (gCurrentPinballGame->unk13 < 3)
|
||||
if (gCurrentPinballGame->boardState < 3)
|
||||
{
|
||||
if (gCurrentPinballGame->unk345 < 3)
|
||||
if (gCurrentPinballGame->holeLetterCount < 3)
|
||||
{
|
||||
gCurrentPinballGame->unk345++;
|
||||
gCurrentPinballGame->holeLetterCount++;
|
||||
gCurrentPinballGame->scoreAddedInFrame = 20000;
|
||||
m4aSongNumStart(SE_UNKNOWN_0xDE);
|
||||
}
|
||||
else
|
||||
{
|
||||
gMain.modeChangeFlags |= MODE_CHANGE_BANNER;
|
||||
gCurrentPinballGame->unkEA = 0;
|
||||
gCurrentPinballGame->unkEC = 920;
|
||||
gCurrentPinballGame->unkE8 = 0;
|
||||
gCurrentPinballGame->unkE6 = 0;
|
||||
gCurrentPinballGame->unkEE = 0;
|
||||
gCurrentPinballGame->unkF2 = 0;
|
||||
gCurrentPinballGame->unkFA = 1;
|
||||
gCurrentPinballGame->unkFB = 0;
|
||||
gCurrentPinballGame->unk346 = 1;
|
||||
gCurrentPinballGame->unk348 = 0;
|
||||
gCurrentPinballGame->bannerDelayTimer = 0;
|
||||
gCurrentPinballGame->bannerDisplayTimer = 920;
|
||||
gCurrentPinballGame->cameraYScrollTarget = 0;
|
||||
gCurrentPinballGame->cameraYAdjust = 0;
|
||||
gCurrentPinballGame->cameraYScrollSpeed = 0;
|
||||
gCurrentPinballGame->bannerGfxIndex = 0;
|
||||
gCurrentPinballGame->bannerActive = 1;
|
||||
gCurrentPinballGame->bannerPreserveBallState = 0;
|
||||
gCurrentPinballGame->holeLetterSystemState = 1;
|
||||
gCurrentPinballGame->holeAnimFrameCounter = 0;
|
||||
m4aMPlayStop(&gMPlayInfo_BGM);
|
||||
gCurrentPinballGame->scoreAddedInFrame = 200000;
|
||||
m4aSongNumStart(SE_UNKNOWN_0xDF);
|
||||
|
|
@ -79,126 +79,126 @@ void sub_31498(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk345 < 3)
|
||||
if (gCurrentPinballGame->holeLetterCount < 3)
|
||||
{
|
||||
gCurrentPinballGame->unk345++;
|
||||
gCurrentPinballGame->holeLetterCount++;
|
||||
gCurrentPinballGame->scoreAddedInFrame = 20000;
|
||||
m4aSongNumStart(SE_UNKNOWN_0xDE);
|
||||
}
|
||||
}
|
||||
|
||||
index = gCurrentPinballGame->unk345;
|
||||
DmaCopy16(3, &gUnknown_08490A4C[index], (void *)0x600D900, 0x440);
|
||||
gCurrentPinballGame->unk344 = 0;
|
||||
index = gCurrentPinballGame->holeLetterCount;
|
||||
DmaCopy16(3, &gHoleIndicatorTileGfx[index], (void *)0x600D900, 0x440);
|
||||
gCurrentPinballGame->holeLetterNewHit = 0;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (gCurrentPinballGame->unk348 < 270)
|
||||
if (gCurrentPinballGame->holeAnimFrameCounter < 270)
|
||||
{
|
||||
index = (gCurrentPinballGame->unk348 % 60) / 30 + 4;
|
||||
DmaCopy16(3, &gUnknown_08490A4C[index], (void *)0x600D900, 0x440);
|
||||
index = (gCurrentPinballGame->holeAnimFrameCounter % 60) / 30 + 4;
|
||||
DmaCopy16(3, &gHoleIndicatorTileGfx[index], (void *)0x600D900, 0x440);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = 0;
|
||||
DmaCopy16(3, &gUnknown_08490A4C[index], (void *)0x600D900, 0x440);
|
||||
gCurrentPinballGame->unk346 = 2;
|
||||
gCurrentPinballGame->unk345 = 0;
|
||||
DmaCopy16(3, &gHoleIndicatorTileGfx[index], (void *)0x600D900, 0x440);
|
||||
gCurrentPinballGame->holeLetterSystemState = 2;
|
||||
gCurrentPinballGame->holeLetterCount = 0;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk348 == 60)
|
||||
if (gCurrentPinballGame->holeAnimFrameCounter == 60)
|
||||
{
|
||||
m4aSongNumStart(MUS_EGG_MODE_START);
|
||||
gCurrentPinballGame->unk728 = 0;
|
||||
gCurrentPinballGame->unk1EC = 5;
|
||||
gCurrentPinballGame->unk1ED = 12;
|
||||
gCurrentPinballGame->unk1F0 = 0;
|
||||
gCurrentPinballGame->catchArrowPaletteActive = 0;
|
||||
gCurrentPinballGame->eggAnimationPhase = 5;
|
||||
gCurrentPinballGame->eggAnimFrameIndex = 12;
|
||||
gCurrentPinballGame->eggFrameTimer = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk348++;
|
||||
gCurrentPinballGame->holeAnimFrameCounter++;
|
||||
break;
|
||||
case 3:
|
||||
if (gUnknown_086AE5A0[gCurrentPinballGame->unk345][1] > gCurrentPinballGame->unk348)
|
||||
if (gHoleAnimKeyframeData[gCurrentPinballGame->holeLetterCount][1] > gCurrentPinballGame->holeAnimFrameCounter)
|
||||
{
|
||||
gCurrentPinballGame->unk348++;
|
||||
gCurrentPinballGame->holeAnimFrameCounter++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk348 = 0;
|
||||
gCurrentPinballGame->unk345++;
|
||||
if (gCurrentPinballGame->unk345 == 10)
|
||||
gCurrentPinballGame->unk346 = 4;
|
||||
gCurrentPinballGame->holeAnimFrameCounter = 0;
|
||||
gCurrentPinballGame->holeLetterCount++;
|
||||
if (gCurrentPinballGame->holeLetterCount == 10)
|
||||
gCurrentPinballGame->holeLetterSystemState = 4;
|
||||
|
||||
if (gCurrentPinballGame->unk345 == 6)
|
||||
if (gCurrentPinballGame->holeLetterCount == 6)
|
||||
m4aSongNumStart(SE_UNKNOWN_0xE0);
|
||||
|
||||
index = gUnknown_086AE5A0[gCurrentPinballGame->unk345][0];
|
||||
DmaCopy16(3, &gUnknown_08490A4C[index], (void *)0x600D900, 0x440);
|
||||
index = gHoleAnimKeyframeData[gCurrentPinballGame->holeLetterCount][0];
|
||||
DmaCopy16(3, &gHoleIndicatorTileGfx[index], (void *)0x600D900, 0x440);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk345 < 6)
|
||||
if (gCurrentPinballGame->holeLetterCount < 6)
|
||||
{
|
||||
gCurrentPinballGame->unk200 = 280;
|
||||
gCurrentPinballGame->catchCreatureY = 280;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk200 += 6;
|
||||
if (gCurrentPinballGame->unk346 == 4)
|
||||
gCurrentPinballGame->unk200 = gCurrentPinballGame->unk200 + 20;
|
||||
gCurrentPinballGame->catchCreatureY += 6;
|
||||
if (gCurrentPinballGame->holeLetterSystemState == 4)
|
||||
gCurrentPinballGame->catchCreatureY = gCurrentPinballGame->catchCreatureY + 20;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (gCurrentPinballGame->unk343 && gCurrentPinballGame->unk344)
|
||||
if (gCurrentPinballGame->holeCaptureReady && gCurrentPinballGame->holeLetterNewHit)
|
||||
{
|
||||
gMain.modeChangeFlags |= MODE_CHANGE_BANNER;
|
||||
gCurrentPinballGame->unkEA = 0;
|
||||
gCurrentPinballGame->unkEC = 160;
|
||||
gCurrentPinballGame->unkE8 = 0;
|
||||
gCurrentPinballGame->unkE6 = 0;
|
||||
gCurrentPinballGame->unkEE = 0;
|
||||
gCurrentPinballGame->unkF2 = 0;
|
||||
gCurrentPinballGame->unkFA = 1;
|
||||
gCurrentPinballGame->unkFB = 0;
|
||||
gCurrentPinballGame->unk346 = 5;
|
||||
gCurrentPinballGame->unk348 = 0;
|
||||
gCurrentPinballGame->unk345 = 10;
|
||||
gCurrentPinballGame->bannerDelayTimer = 0;
|
||||
gCurrentPinballGame->bannerDisplayTimer = 160;
|
||||
gCurrentPinballGame->cameraYScrollTarget = 0;
|
||||
gCurrentPinballGame->cameraYAdjust = 0;
|
||||
gCurrentPinballGame->cameraYScrollSpeed = 0;
|
||||
gCurrentPinballGame->bannerGfxIndex = 0;
|
||||
gCurrentPinballGame->bannerActive = 1;
|
||||
gCurrentPinballGame->bannerPreserveBallState = 0;
|
||||
gCurrentPinballGame->holeLetterSystemState = 5;
|
||||
gCurrentPinballGame->holeAnimFrameCounter = 0;
|
||||
gCurrentPinballGame->holeLetterCount = 10;
|
||||
m4aSongNumStart(SE_UNKNOWN_0xE0);
|
||||
gCurrentPinballGame->unk1EC = 1;
|
||||
gCurrentPinballGame->unk1F4 = 2080;
|
||||
gCurrentPinballGame->unk1F6 = 960;
|
||||
gCurrentPinballGame->eggAnimationPhase = 1;
|
||||
gCurrentPinballGame->portraitOffsetX = 2080;
|
||||
gCurrentPinballGame->portraitOffsetY = 960;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk344 = 0;
|
||||
gCurrentPinballGame->holeLetterNewHit = 0;
|
||||
break;
|
||||
case 5:
|
||||
if (gUnknown_086AE5A0[gCurrentPinballGame->unk345][1] > gCurrentPinballGame->unk348)
|
||||
if (gHoleAnimKeyframeData[gCurrentPinballGame->holeLetterCount][1] > gCurrentPinballGame->holeAnimFrameCounter)
|
||||
{
|
||||
gCurrentPinballGame->unk348++;
|
||||
gCurrentPinballGame->holeAnimFrameCounter++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk348 = 0;
|
||||
gCurrentPinballGame->unk345++;
|
||||
if (gCurrentPinballGame->unk345 == 15)
|
||||
gCurrentPinballGame->unk346 = 6;
|
||||
gCurrentPinballGame->holeAnimFrameCounter = 0;
|
||||
gCurrentPinballGame->holeLetterCount++;
|
||||
if (gCurrentPinballGame->holeLetterCount == 15)
|
||||
gCurrentPinballGame->holeLetterSystemState = 6;
|
||||
|
||||
index = gUnknown_086AE5A0[gCurrentPinballGame->unk345][0];
|
||||
DmaCopy16(3, gUnknown_08490A4C[index], (void *)0x600D900, 0x440);
|
||||
index = gHoleAnimKeyframeData[gCurrentPinballGame->holeLetterCount][0];
|
||||
DmaCopy16(3, gHoleIndicatorTileGfx[index], (void *)0x600D900, 0x440);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk345 == 14 && gCurrentPinballGame->unk348 == 10)
|
||||
if (gCurrentPinballGame->holeLetterCount == 14 && gCurrentPinballGame->holeAnimFrameCounter == 10)
|
||||
m4aSongNumStart(SE_UNKNOWN_0xE1);
|
||||
|
||||
if (gCurrentPinballGame->unk1F6 > 700)
|
||||
gCurrentPinballGame->unk1F6 -= 5;
|
||||
if (gCurrentPinballGame->portraitOffsetY > 700)
|
||||
gCurrentPinballGame->portraitOffsetY -= 5;
|
||||
else
|
||||
gCurrentPinballGame->unk1F6 = 700;
|
||||
gCurrentPinballGame->portraitOffsetY = 700;
|
||||
break;
|
||||
case 6:
|
||||
gCurrentPinballGame->unk345 = 0;
|
||||
gCurrentPinballGame->unk348 = 0;
|
||||
gCurrentPinballGame->unk346 = 0;
|
||||
gCurrentPinballGame->unk343 = 0;
|
||||
gCurrentPinballGame->holeLetterCount = 0;
|
||||
gCurrentPinballGame->holeAnimFrameCounter = 0;
|
||||
gCurrentPinballGame->holeLetterSystemState = 0;
|
||||
gCurrentPinballGame->holeCaptureReady = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -207,25 +207,25 @@ void sub_31498(void)
|
|||
group = &gMain.spriteGroups[47 + i];
|
||||
if (group->available)
|
||||
{
|
||||
if (gUnknown_086AE58A[gCurrentPinballGame->unk355[i]][0] > gCurrentPinballGame->unk35E[i])
|
||||
if (gSplashEffectFrameDurations[gCurrentPinballGame->splashEffectFrameIndex[i]][0] > gCurrentPinballGame->splashEffectFrameTimer[i])
|
||||
{
|
||||
gCurrentPinballGame->unk35E[i]++;
|
||||
gCurrentPinballGame->splashEffectFrameTimer[i]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk35E[i] = 0;
|
||||
gCurrentPinballGame->unk355[i]++;
|
||||
if (gCurrentPinballGame->unk355[i] == 6)
|
||||
gCurrentPinballGame->splashEffectFrameTimer[i] = 0;
|
||||
gCurrentPinballGame->splashEffectFrameIndex[i]++;
|
||||
if (gCurrentPinballGame->splashEffectFrameIndex[i] == 6)
|
||||
{
|
||||
group->available = 0;
|
||||
gCurrentPinballGame->unk355[i] = 5;
|
||||
gCurrentPinballGame->splashEffectFrameIndex[i] = 5;
|
||||
}
|
||||
}
|
||||
|
||||
index = gUnknown_086AE588[gCurrentPinballGame->unk355[i]][0];
|
||||
DmaCopy16(3, &gUnknown_0845A08C[index], (void *)0x060140a0 + i * 0x100, 0x100);
|
||||
group->baseX = gUnknown_086AE554[gCurrentPinballGame->unk359[i]].x - gCurrentPinballGame->unk58;
|
||||
group->baseY = gUnknown_086AE554[gCurrentPinballGame->unk359[i]].y - gCurrentPinballGame->unk5A;
|
||||
index = gSplashEffectTileIndices[gCurrentPinballGame->splashEffectFrameIndex[i]][0];
|
||||
DmaCopy16(3, &gSplashEffectTileGfx[index], (void *)0x060140a0 + i * 0x100, 0x100);
|
||||
group->baseX = gSplashEffectPositions[gCurrentPinballGame->splashEffectPositionIndex[i]].x - gCurrentPinballGame->cameraXOffset;
|
||||
group->baseY = gSplashEffectPositions[gCurrentPinballGame->splashEffectPositionIndex[i]].y - gCurrentPinballGame->cameraYOffset;
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
oamSimple = &group->oam[j];
|
||||
|
|
@ -236,7 +236,7 @@ void sub_31498(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_31B30(void)
|
||||
void DrawBoardEdgeBanner(void)
|
||||
{
|
||||
s16 i;
|
||||
struct SpriteGroup *group;
|
||||
|
|
@ -248,14 +248,14 @@ void sub_31B30(void)
|
|||
|
||||
if (group->available)
|
||||
{
|
||||
if (gCurrentPinballGame->unk4C < 8)
|
||||
if (gCurrentPinballGame->cameraBaseX < 8)
|
||||
{
|
||||
group->baseX = gCurrentPinballGame->unk58;
|
||||
group->baseX = gCurrentPinballGame->cameraXOffset;
|
||||
group->baseX = -8 - group->baseX;
|
||||
}
|
||||
else
|
||||
{
|
||||
group->baseX = gCurrentPinballGame->unk58;
|
||||
group->baseX = gCurrentPinballGame->cameraXOffset;
|
||||
group->baseX = 256 - group->baseX;
|
||||
}
|
||||
|
||||
|
|
@ -275,31 +275,31 @@ void sub_31B30(void)
|
|||
* 0 when saving and loading normally
|
||||
* 2 when loading into the evo or mart menu
|
||||
*/
|
||||
void sub_31BE8(s16 arg0)
|
||||
void RestoreBoardObjPalettes(s16 arg0)
|
||||
{
|
||||
if (gCurrentPinballGame->unk70 == 1)
|
||||
if (gCurrentPinballGame->paletteSwapActive == 1)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[arg0], (void*)OBJ_PLTT, 0x20);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[arg0], (void*)OBJ_PLTT, 0x20);
|
||||
}
|
||||
|
||||
if (gMain.selectedField == FIELD_SAPPHIRE)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[arg0] + 0x40, (void*)OBJ_PLTT + 0x40, 0xC0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[arg0] + 0x40, (void*)OBJ_PLTT + 0x40, 0xC0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[arg0] + 0x40, (void*)OBJ_PLTT + 0x40, 0xE0);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[arg0] + 0x40, (void*)OBJ_PLTT + 0x40, 0xE0);
|
||||
}
|
||||
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[arg0] + 0x140, (void *)OBJ_PLTT + 0x140, 0x20);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[arg0] + 0x140, (void *)OBJ_PLTT + 0x140, 0x20);
|
||||
|
||||
// related to Y position of camera on the field
|
||||
if (gCurrentPinballGame->unk68 < 170)
|
||||
if (gCurrentPinballGame->cameraYViewport < 170)
|
||||
{
|
||||
DmaCopy16(3, gUnknown_08137B3C[gMain.selectedField][arg0 * 2], (void *)OBJ_PLTT + 0x160, 0x20);
|
||||
DmaCopy16(3, gFieldPaletteVariants[gMain.selectedField][arg0 * 2], (void *)OBJ_PLTT + 0x160, 0x20);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, gUnknown_08137B3C[gMain.selectedField][arg0 * 2 + 1], (void *)OBJ_PLTT + 0x160, 0x20);
|
||||
DmaCopy16(3, gFieldPaletteVariants[gMain.selectedField][arg0 * 2 + 1], (void *)OBJ_PLTT + 0x160, 0x20);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* 0 if captured via ball
|
||||
* 1 if evolved
|
||||
*/
|
||||
void sub_31CF8(s16 evolved)
|
||||
void RegisterCaptureOrEvolution(s16 evolved)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
|
|
|
|||
106
src/rom_356A0.c
106
src/rom_356A0.c
|
|
@ -13,49 +13,49 @@ extern const u8 gRayquazaBonusClear_Gfx[];
|
|||
|
||||
void FadeToMainBoard(void)
|
||||
{
|
||||
gCurrentPinballGame->unk1100 = 1;
|
||||
switch (gCurrentPinballGame->unk17)
|
||||
gCurrentPinballGame->startButtonDisabled = 1;
|
||||
switch (gCurrentPinballGame->boardSubState)
|
||||
{
|
||||
case 0:
|
||||
gCurrentPinballGame->unk18 = 65;
|
||||
gCurrentPinballGame->unk17 = 1;
|
||||
gCurrentPinballGame->stageTimer = 65;
|
||||
gCurrentPinballGame->boardSubState = 1;
|
||||
gMain.blendControl = 0x9F;
|
||||
break;
|
||||
case 1:
|
||||
if (gCurrentPinballGame->unk18)
|
||||
if (gCurrentPinballGame->stageTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk18--;
|
||||
gMain.blendBrightness = 16 - gCurrentPinballGame->unk18 / 4;
|
||||
if (gCurrentPinballGame->unk18 == 0)
|
||||
gCurrentPinballGame->unk17++;
|
||||
gCurrentPinballGame->stageTimer--;
|
||||
gMain.blendBrightness = 16 - gCurrentPinballGame->stageTimer / 4;
|
||||
if (gCurrentPinballGame->stageTimer == 0)
|
||||
gCurrentPinballGame->boardSubState++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (gCurrentPinballGame->unk18 < 30)
|
||||
if (gCurrentPinballGame->stageTimer < 30)
|
||||
{
|
||||
gCurrentPinballGame->unk18++;
|
||||
gCurrentPinballGame->stageTimer++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk18 = 0;
|
||||
gCurrentPinballGame->unk17 = 0;
|
||||
gCurrentPinballGame->stageTimer = 0;
|
||||
gCurrentPinballGame->boardSubState = 0;
|
||||
gMain.spriteGroups[6].available = 0;
|
||||
gMain.spriteGroups[5].available = 0;
|
||||
if (gMain.unk5 != gMain.selectedField)
|
||||
if (gMain.tempField != gMain.selectedField)
|
||||
{
|
||||
sub_357B8();
|
||||
TransitionFromBonusToMainBoard();
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetSomeGraphicsRelatedStuff();
|
||||
gCurrentPinballGame->unk1D = 2;
|
||||
ResetDisplayState();
|
||||
gCurrentPinballGame->fadeSubState = 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ProceessBonusBannerAndScoring(void)
|
||||
void ProcessBonusBannerAndScoring(void)
|
||||
{
|
||||
s16 i;
|
||||
struct SpriteGroup *group;
|
||||
|
|
@ -68,48 +68,48 @@ void ProceessBonusBannerAndScoring(void)
|
|||
var0 = 8;
|
||||
var1 = 0;
|
||||
group = &gMain.spriteGroups[6];
|
||||
if (gCurrentPinballGame->unk394 > 0)
|
||||
if (gCurrentPinballGame->bannerSlideYOffset > 0)
|
||||
{
|
||||
gCurrentPinballGame->unk394 -= 6;
|
||||
if (gCurrentPinballGame->unk394 < 0)
|
||||
gCurrentPinballGame->unk394 = 0;
|
||||
gCurrentPinballGame->bannerSlideYOffset -= 6;
|
||||
if (gCurrentPinballGame->bannerSlideYOffset < 0)
|
||||
gCurrentPinballGame->bannerSlideYOffset = 0;
|
||||
}
|
||||
|
||||
switch (gMain.selectedField)
|
||||
{
|
||||
case FIELD_DUSCLOPS:
|
||||
if (gCurrentPinballGame->unk13 == 5 && gCurrentPinballGame->unk18 < 180)
|
||||
var0 = (gCurrentPinballGame->unk18 % 24) / 12 + 8;
|
||||
if (gCurrentPinballGame->boardState == 5 && gCurrentPinballGame->stageTimer < 180)
|
||||
var0 = (gCurrentPinballGame->stageTimer % 24) / 12 + 8;
|
||||
var1 = 30000000;
|
||||
break;
|
||||
case FIELD_KECLEON:
|
||||
if (gCurrentPinballGame->unk13 == 3 && gCurrentPinballGame->unk18 < 180)
|
||||
var0 = (gCurrentPinballGame->unk18 % 24) / 12 + 8;
|
||||
if (gCurrentPinballGame->boardState == 3 && gCurrentPinballGame->stageTimer < 180)
|
||||
var0 = (gCurrentPinballGame->stageTimer % 24) / 12 + 8;
|
||||
var1 = 30000000;
|
||||
break;
|
||||
case FIELD_KYOGRE:
|
||||
if (gCurrentPinballGame->unk13 == 3 && gCurrentPinballGame->unk18 < 180)
|
||||
var0 = (gCurrentPinballGame->unk18 % 24) / 12 + 8;
|
||||
if (gCurrentPinballGame->boardState == 3 && gCurrentPinballGame->stageTimer < 180)
|
||||
var0 = (gCurrentPinballGame->stageTimer % 24) / 12 + 8;
|
||||
var1 = 50000000;
|
||||
break;
|
||||
case FIELD_GROUDON:
|
||||
if (gCurrentPinballGame->unk13 == 3 && gCurrentPinballGame->unk18 < 180)
|
||||
var0 = (gCurrentPinballGame->unk18 % 24) / 12 + 8;
|
||||
if (gCurrentPinballGame->boardState == 3 && gCurrentPinballGame->stageTimer < 180)
|
||||
var0 = (gCurrentPinballGame->stageTimer % 24) / 12 + 8;
|
||||
var1 = 50000000;
|
||||
break;
|
||||
case FIELD_RAYQUAZA:
|
||||
if (gCurrentPinballGame->unk13 == 3 && gCurrentPinballGame->unk18 < 180)
|
||||
var0 = (gCurrentPinballGame->unk18 % 24) / 12 + 8;
|
||||
if (gCurrentPinballGame->boardState == 3 && gCurrentPinballGame->stageTimer < 180)
|
||||
var0 = (gCurrentPinballGame->stageTimer % 24) / 12 + 8;
|
||||
var1 = 99999999;
|
||||
break;
|
||||
}
|
||||
|
||||
DmaCopy16(3, gUnknown_02031520.unk14.unk2C[0] + var0 * 0x20, (void *)0x05000300, 0x20);
|
||||
DmaCopy16(3, gBoardConfig.fieldLayout.objPaletteSets[0] + var0 * 0x20, (void *)0x05000300, 0x20);
|
||||
|
||||
if (group->available)
|
||||
{
|
||||
group->baseX = 120;
|
||||
group->baseY = gCurrentPinballGame->unk394 + 50;
|
||||
group->baseY = gCurrentPinballGame->bannerSlideYOffset + 50;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
oamSimple = &group->oam[i];
|
||||
|
|
@ -119,7 +119,7 @@ void ProceessBonusBannerAndScoring(void)
|
|||
|
||||
group = &gMain.spriteGroups[5];
|
||||
group->baseX = 120;
|
||||
group->baseY = gCurrentPinballGame->unk394 + 50;
|
||||
group->baseY = gCurrentPinballGame->bannerSlideYOffset + 50;
|
||||
for (i = 0; i < 18; i++)
|
||||
{
|
||||
oamSimple = &group->oam[i];
|
||||
|
|
@ -182,14 +182,14 @@ void ProceessBonusBannerAndScoring(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_356A0(void)
|
||||
void RenderBonusStageOverlaySprites(void)
|
||||
{
|
||||
s16 i;
|
||||
struct SpriteGroup *group;
|
||||
struct OamDataSimple *oamSimple;
|
||||
|
||||
group = &gMain_spriteGroups_14;
|
||||
switch (gCurrentPinballGame->unk3DC)
|
||||
switch (gCurrentPinballGame->bossEntityState)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
|
|
@ -205,7 +205,7 @@ void sub_356A0(void)
|
|||
gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY;
|
||||
break;
|
||||
case 2:
|
||||
if (gCurrentPinballGame->unk3E6 <= 0)
|
||||
if (gCurrentPinballGame->bossAnimLoopCount <= 0)
|
||||
break;
|
||||
|
||||
if (!group->available)
|
||||
|
|
@ -240,31 +240,31 @@ void sub_356A0(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_357B8(void)
|
||||
void TransitionFromBonusToMainBoard(void)
|
||||
{
|
||||
u8 temp;
|
||||
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
|
||||
temp = gMain.unk5;
|
||||
gMain.unk5 = gMain.selectedField;
|
||||
temp = gMain.tempField;
|
||||
gMain.tempField = gMain.selectedField;
|
||||
gMain.selectedField = temp;
|
||||
gMain.unk6 = 0;
|
||||
gMain.isBonusField = 0;
|
||||
gMain.modeChangeFlags = MODE_CHANGE_NONE;
|
||||
gCurrentPinballGame->eventTimer = 0;
|
||||
gCurrentPinballGame->unk294 = 0;
|
||||
gCurrentPinballGame->boardModeType = 0;
|
||||
if (gCurrentPinballGame->numCompletedBonusStages > 4)
|
||||
gMain.eReaderBonuses[EREADER_ENCOUNTER_RATE_UP_CARD] = 1;
|
||||
|
||||
gMain.subState = 0;
|
||||
gCurrentPinballGame->unk15 = 3;
|
||||
gCurrentPinballGame->unk13 = 1;
|
||||
gCurrentPinballGame->unk16 = 0;
|
||||
gCurrentPinballGame->unk5FA = 0;
|
||||
gCurrentPinballGame->unkE6 = 0;
|
||||
sub_1C7F4(0, 0);
|
||||
gCurrentPinballGame->unk6C4 = 0;
|
||||
if (gCurrentPinballGame->unk714)
|
||||
gCurrentPinballGame->unk6EE = 120;
|
||||
gCurrentPinballGame->prevBoardState = 3;
|
||||
gCurrentPinballGame->boardState = 1;
|
||||
gCurrentPinballGame->boardTransitionPhase = 0;
|
||||
gCurrentPinballGame->boardEntityActive = 0;
|
||||
gCurrentPinballGame->cameraYAdjust = 0;
|
||||
LoadPortraitGraphics(0, 0);
|
||||
gCurrentPinballGame->portraitDisplayState = 0;
|
||||
if (gCurrentPinballGame->allHolesLit)
|
||||
gCurrentPinballGame->allHolesLitDelayTimer = 120;
|
||||
}
|
||||
|
|
|
|||
316
src/rom_467F4.c
316
src/rom_467F4.c
|
|
@ -1,71 +1,71 @@
|
|||
#include "global.h"
|
||||
#include "main.h"
|
||||
|
||||
extern const s16 gUnknown_086B0010[][4];
|
||||
extern const s16 gScrollTileUpdateTable[][4];
|
||||
|
||||
struct Unk_86AFCB0
|
||||
struct BoardCollisionDataSet
|
||||
{
|
||||
const s16 *unk0;
|
||||
const s16 *tileData;
|
||||
u8 filler4[0xC];
|
||||
const u16 *unk10;
|
||||
const u16 *angleData;
|
||||
u8 filler14[0xC];
|
||||
const u8 *unk20;
|
||||
const u8 *typeData;
|
||||
u8 filler24[0xC];
|
||||
};
|
||||
extern const struct Unk_86AFCB0 gUnknown_086AFCB0[][2];
|
||||
extern const struct BoardCollisionDataSet gBoardCollisionDataSets[][2];
|
||||
|
||||
extern u8 gUnknown_020030A0[];
|
||||
extern u8 gUnknown_0200FBB0[];
|
||||
extern u8 gBoardBGTileBufferAlt[];
|
||||
extern u8 gBoardGfxBuffer[];
|
||||
|
||||
extern const u16 gUnknown_0816C3E4[];
|
||||
extern const u8 gUnknown_081C08E4[];
|
||||
extern const u8 gUnknown_081BFEE4[];
|
||||
extern const u8 gUnknown_0822E424[];
|
||||
extern const u8 gUnknown_0824C1E4[];
|
||||
extern const u8 gUnknown_0824DD60[];
|
||||
extern const u8 gUnknown_08250934[];
|
||||
extern const u8 gUnknown_08265C10[];
|
||||
extern const u8 gUnknown_0826DC10[];
|
||||
extern const u8 gUnknown_0826EC10[];
|
||||
extern const u8 gUnknown_0826EE10[];
|
||||
extern const u8 gUnknown_082AE6D0[];
|
||||
extern const u8 gUnknown_082D34D0[];
|
||||
extern const u8 gUnknown_082E4EE0[];
|
||||
extern const u8 gUnknown_082D523C[];
|
||||
extern const u8 gUnknown_082D8998[];
|
||||
extern const u8 gUnknown_082ECEE0[];
|
||||
extern const u8 gUnknown_082EDEE0[];
|
||||
extern const u8 gUnknown_082EE4C0[];
|
||||
extern const u16 gFlipperCollisionData[];
|
||||
extern const u8 gRubyBoardBG0Tilemap[];
|
||||
extern const u8 gRubyBoardPalette[];
|
||||
extern const u8 gRubyBoardBG1Tilemap[];
|
||||
extern const u8 gRubyBoardCompressedTiles1[];
|
||||
extern const u8 gRubyBoardCompressedTiles2[];
|
||||
extern const u8 gRubyBoardCompressedBGTileBuffer[];
|
||||
extern const u8 gRubyBoardBGTiles[];
|
||||
extern const u8 gRubyBoardBGTilemap[];
|
||||
extern const u8 gSapphireBoardPalette[];
|
||||
extern const u8 gSapphireBoardBG0Tilemap[];
|
||||
extern const u8 gSapphireBoardBG1Tilemap[];
|
||||
extern const u8 gSapphireBoardCompressedTiles1[];
|
||||
extern const u8 gSapphireBoardBGTiles[];
|
||||
extern const u8 gSapphireBoardCompressedTiles2[];
|
||||
extern const u8 gSapphireBoardCompressedBGTileBuffer[];
|
||||
extern const u8 gSapphireBoardBGTilemap[];
|
||||
extern const u8 gDusclopsBoardPalette[];
|
||||
extern const u8 gDusclopsBoardBG0Tilemap[];
|
||||
|
||||
|
||||
extern const u8 gUnknown_08301700[];
|
||||
extern const u8 gUnknown_08301F00[];
|
||||
extern const u8 gUnknown_08302700[];
|
||||
extern const u8 gUnknown_08303928[];
|
||||
extern const u8 gUnknown_0830CBD4[];
|
||||
extern const u8 gUnknown_0830CDD4[];
|
||||
extern const u16 gUnknown_08327994[];
|
||||
extern const u8 gUnknown_08329994[];
|
||||
extern const u8 gUnknown_0832A194[];
|
||||
extern const u8 gUnknown_08332E04[];
|
||||
extern const u16 gUnknown_08333004[];
|
||||
extern const u8 gUnknown_0833D844[];
|
||||
extern const u8 gUnknown_0833E044[];
|
||||
extern const u8 gUnknown_08352BD8[];
|
||||
extern const u8 gUnknown_08352DD8[];
|
||||
extern const u8 gUnknown_083535D8[];
|
||||
extern const u8 gUnknown_08353DD8[];
|
||||
extern const u8 gUnknown_08363EC8[];
|
||||
extern const u8 gUnknown_083640C8[];
|
||||
extern const u8 gUnknown_0836E808[];
|
||||
extern const u8 gUnknown_0836F808[];
|
||||
extern const u8 gUnknown_08370808[];
|
||||
extern const u8 gUnknown_0837A2E8[];
|
||||
extern const u16 gUnknown_0837A4E8[];
|
||||
extern const u8 gUnknown_0838E028[];
|
||||
extern const u8 gUnknown_0838E828[];
|
||||
extern const u8 gUnknown_083A826C[];
|
||||
extern const u8 gUnknown_083A8ACC[];
|
||||
extern const u8 gDusclopsBoardBG1Tilemap[];
|
||||
extern const u8 gDusclopsBoardBG2Tilemap[];
|
||||
extern const u8 gBonusFieldCompressedBaseTiles[];
|
||||
extern const u8 gDusclopsBoardCompressedBGTiles[];
|
||||
extern const u8 gKecleonBoardPalette[];
|
||||
extern const u8 gKecleonBoardBG1Tilemap[];
|
||||
extern const u16 gKecleonBerryOverlayTilemap[];
|
||||
extern const u8 gKecleonBoardBG0Tilemap[];
|
||||
extern const u8 gKecleonBoardCompressedBGTiles[];
|
||||
extern const u8 gKyogreBoardPalette[];
|
||||
extern const u16 gKyogreWaterBackgroundTilemap[];
|
||||
extern const u8 gKyogreBoardBG1Tilemap[];
|
||||
extern const u8 gKyogreBoardCompressedBGTiles[];
|
||||
extern const u8 gGroudonLavaPaletteCycleData[];
|
||||
extern const u8 gGroudonBoardBG0Tilemap[];
|
||||
extern const u8 gGroudonBoardBG1Tilemap[];
|
||||
extern const u8 gGroudonBoardCompressedBGTiles[];
|
||||
extern const u8 gRayquazaBoardPalette[];
|
||||
extern const u8 gRayquazaBoardBG0Tilemap[];
|
||||
extern const u8 gRayquazaBoardBGScrollTilemap[];
|
||||
extern const u8 gRayquazaBoardBG1Tilemap[];
|
||||
extern const u8 gRayquazaBoardCompressedBGTiles[];
|
||||
extern const u8 gSphealBoardPalette[];
|
||||
extern const u16 gSphealWaterBackgroundTilemap[];
|
||||
extern const u8 gSphealBoardBG1Tilemap[];
|
||||
extern const u8 gSphealBoardCompressedBGTiles[];
|
||||
extern const u8 gBoardHudTilemapB[];
|
||||
extern const u8 gBoardHudTilemapA[];
|
||||
|
||||
extern const u8 gRubyIntroSprites_Gfx[];
|
||||
extern const u8 gSapphireIntroSprites_Gfx[];
|
||||
|
|
@ -74,171 +74,171 @@ extern const u8 gKecleonIntroSprite_Gfx[];
|
|||
extern const u8 gKyogreIntroSprite_Gfx[];
|
||||
extern const u8 gGroudonIntroSprite_Gfx[];
|
||||
extern const u8 gRayquazaIntroSprite_Gfx[];
|
||||
extern const u8 gUnknown_084779EC[];
|
||||
extern const u8 gSphealIntroSprites_Gfx[];
|
||||
|
||||
extern const struct Unk02031520_unk14 gUnknown_086AFD70[];
|
||||
extern const struct FieldBoardLayout gFieldBoardConfigs[];
|
||||
|
||||
void loadIntroduction(void)
|
||||
{
|
||||
struct Unk02031520 *dest = &gUnknown_02031520;
|
||||
const struct Unk02031520_unk14 *src = gUnknown_086AFD70;
|
||||
memcpy(&dest->unk14, &src[gMain.selectedField], sizeof(dest->unk14));
|
||||
struct BoardConfig *dest = &gBoardConfig;
|
||||
const struct FieldBoardLayout *src = gFieldBoardConfigs;
|
||||
memcpy(&dest->fieldLayout, &src[gMain.selectedField], sizeof(dest->fieldLayout));
|
||||
|
||||
switch (gMain.selectedField)
|
||||
{
|
||||
case FIELD_RUBY:
|
||||
DmaCopy16(3, gUnknown_081BFEE4, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
DmaCopy16(3, gUnknown_08265C10, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gUnknown_0826DC10, (void *)0x06003000, 0x1000);
|
||||
LZ77UnCompWram(gUnknown_0824C1E4, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gUnknown_0824DD60, gUnknown_0200FBB0);
|
||||
LZ77UnCompWram(gUnknown_08250934, gUnknown_020030A0);
|
||||
DmaCopy16(3, &gUnknown_0200FBB0[0xC00], (void *)0x0600B400, 0x2400);
|
||||
DmaCopy16(3, &gUnknown_0200FBB0[0x3000], (void *)0x06008000, 0x3400);
|
||||
DmaCopy16(3, gUnknown_081C08E4, (void *)BG_VRAM, 0x1000);
|
||||
DmaCopy16(3, gUnknown_0822E424, (void *)0x06001000, 0x1000);
|
||||
DmaCopy16(3, gUnknown_083A8ACC, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gUnknown_083A826C, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gRubyBoardPalette, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
DmaCopy16(3, gRubyBoardBGTiles, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gRubyBoardBGTilemap, (void *)0x06003000, 0x1000);
|
||||
LZ77UnCompWram(gRubyBoardCompressedTiles1, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gRubyBoardCompressedTiles2, gBoardGfxBuffer);
|
||||
LZ77UnCompWram(gRubyBoardCompressedBGTileBuffer, gBoardBGTileBufferAlt);
|
||||
DmaCopy16(3, &gBoardGfxBuffer[0xC00], (void *)0x0600B400, 0x2400);
|
||||
DmaCopy16(3, &gBoardGfxBuffer[0x3000], (void *)0x06008000, 0x3400);
|
||||
DmaCopy16(3, gRubyBoardBG0Tilemap, (void *)BG_VRAM, 0x1000);
|
||||
DmaCopy16(3, gRubyBoardBG1Tilemap, (void *)0x06001000, 0x1000);
|
||||
DmaCopy16(3, gBoardHudTilemapA, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gBoardHudTilemapB, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gRubyIntroSprites_Gfx, (void *)0x06010000, 0x8000);
|
||||
break;
|
||||
case FIELD_SAPPHIRE:
|
||||
DmaCopy16(3, gUnknown_0826EC10, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
DmaCopy16(3, gUnknown_082E4EE0, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gUnknown_082ECEE0, (void *)0x06003000, 0x1000);
|
||||
LZ77UnCompWram(gUnknown_082D34D0, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gUnknown_082D523C, gUnknown_0200FBB0);
|
||||
LZ77UnCompWram(gUnknown_082D8998, gUnknown_020030A0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x0600A800, 0x3000);
|
||||
DmaCopy16(3, &gUnknown_0200FBB0[0x3000], (void *)0x06008000, 0x2800);
|
||||
DmaCopy16(3, gUnknown_0826EE10, (void *)BG_VRAM, 0x1000);
|
||||
DmaCopy16(3, gUnknown_082AE6D0, (void *)0x06001000, 0x1000);
|
||||
DmaCopy16(3, gUnknown_083A8ACC, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gUnknown_083A826C, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gSapphireBoardPalette, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
DmaCopy16(3, gSapphireBoardBGTiles, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gSapphireBoardBGTilemap, (void *)0x06003000, 0x1000);
|
||||
LZ77UnCompWram(gSapphireBoardCompressedTiles1, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gSapphireBoardCompressedTiles2, gBoardGfxBuffer);
|
||||
LZ77UnCompWram(gSapphireBoardCompressedBGTileBuffer, gBoardBGTileBufferAlt);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x0600A800, 0x3000);
|
||||
DmaCopy16(3, &gBoardGfxBuffer[0x3000], (void *)0x06008000, 0x2800);
|
||||
DmaCopy16(3, gSapphireBoardBG0Tilemap, (void *)BG_VRAM, 0x1000);
|
||||
DmaCopy16(3, gSapphireBoardBG1Tilemap, (void *)0x06001000, 0x1000);
|
||||
DmaCopy16(3, gBoardHudTilemapA, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gBoardHudTilemapB, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gSapphireIntroSprites_Gfx, (void *)0x06010000, 0x8000);
|
||||
break;
|
||||
case FIELD_DUSCLOPS:
|
||||
DmaCopy16(3, gUnknown_082EDEE0, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gUnknown_08302700, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gUnknown_08303928, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gUnknown_082EE4C0, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gUnknown_08301700, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gUnknown_08301F00, (void *)0x06001000, 0x800);
|
||||
DmaCopy16(3, gUnknown_083A8ACC, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gUnknown_083A826C, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gDusclopsBoardPalette, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gDusclopsBoardCompressedBGTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gDusclopsBoardBG0Tilemap, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gDusclopsBoardBG1Tilemap, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gDusclopsBoardBG2Tilemap, (void *)0x06001000, 0x800);
|
||||
DmaCopy16(3, gBoardHudTilemapA, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gBoardHudTilemapB, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gDusclopsIntroSprite_Gfx, (void *)0x06010000, 0x8000);
|
||||
break;
|
||||
case FIELD_KECLEON:
|
||||
DmaCopy16(3, gUnknown_0830CBD4, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gUnknown_08302700, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gUnknown_0832A194, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gUnknown_08329994, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gUnknown_0830CDD4, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gUnknown_08327994, (void *)0x06001000, 0x800);
|
||||
DmaCopy16(3, gUnknown_083A8ACC, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gUnknown_083A826C, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gKecleonBoardPalette, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gKecleonBoardCompressedBGTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gKecleonBoardBG0Tilemap, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gKecleonBoardBG1Tilemap, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gKecleonBerryOverlayTilemap, (void *)0x06001000, 0x800);
|
||||
DmaCopy16(3, gBoardHudTilemapA, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gBoardHudTilemapB, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gKecleonIntroSprite_Gfx, (void *)0x06010000, 0x8000);
|
||||
break;
|
||||
case FIELD_KYOGRE:
|
||||
DmaCopy16(3, gUnknown_08332E04, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gUnknown_08302700, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gUnknown_0833E044, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gUnknown_08333004, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gUnknown_0833D844, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gUnknown_083A8ACC, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gUnknown_083A826C, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gKyogreBoardPalette, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gKyogreBoardCompressedBGTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gKyogreWaterBackgroundTilemap, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gKyogreBoardBG1Tilemap, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gBoardHudTilemapA, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gBoardHudTilemapB, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gKyogreIntroSprite_Gfx, (void *)0x06010000, 0x8000);
|
||||
break;
|
||||
case FIELD_GROUDON:
|
||||
DmaCopy16(3, gUnknown_08352BD8, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gUnknown_08302700, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gUnknown_08353DD8, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gUnknown_08352DD8, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gUnknown_083535D8, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gUnknown_083A8ACC, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gUnknown_083A826C, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gGroudonLavaPaletteCycleData, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gGroudonBoardCompressedBGTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gGroudonBoardBG0Tilemap, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gGroudonBoardBG1Tilemap, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gBoardHudTilemapA, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gBoardHudTilemapB, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gGroudonIntroSprite_Gfx, (void *)0x06010000, 0x8000);
|
||||
break;
|
||||
case FIELD_RAYQUAZA:
|
||||
DmaCopy16(3, gUnknown_08363EC8, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gUnknown_08302700, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gUnknown_08370808, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gUnknown_083640C8, (void *)0x06000000, 0x1000);
|
||||
DmaCopy16(3, gUnknown_0836F808, (void *)0x06001000, 0x1000);
|
||||
DmaCopy16(3, gUnknown_0836E808, (void *)0x06003000, 0x1000);
|
||||
DmaCopy16(3, gUnknown_083A8ACC, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gUnknown_083A826C, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gRayquazaBoardPalette, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gRayquazaBoardCompressedBGTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gRayquazaBoardBG0Tilemap, (void *)0x06000000, 0x1000);
|
||||
DmaCopy16(3, gRayquazaBoardBG1Tilemap, (void *)0x06001000, 0x1000);
|
||||
DmaCopy16(3, gRayquazaBoardBGScrollTilemap, (void *)0x06003000, 0x1000);
|
||||
DmaCopy16(3, gBoardHudTilemapA, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gBoardHudTilemapB, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gRayquazaIntroSprite_Gfx, (void *)0x06010000, 0x8000);
|
||||
break;
|
||||
case FIELD_SPHEAL:
|
||||
DmaCopy16(3, gUnknown_0837A2E8, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gUnknown_08302700, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gUnknown_0838E828, gUnknown_0200FBB0);
|
||||
DmaCopy16(3, gUnknown_0200FBB0, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gUnknown_0837A4E8, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gUnknown_0838E028, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gUnknown_083A8ACC, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gUnknown_083A826C, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gUnknown_084779EC, (void *)0x06010000, 0x8000);
|
||||
DmaCopy16(3, gSphealBoardPalette, (void *)BG_PLTT, BG_PLTT_SIZE);
|
||||
LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06004000, 0x4000);
|
||||
LZ77UnCompWram(gSphealBoardCompressedBGTiles, gBoardGfxBuffer);
|
||||
DmaCopy16(3, gBoardGfxBuffer, (void *)0x06008000, 0x8000);
|
||||
DmaCopy16(3, gSphealWaterBackgroundTilemap, (void *)0x06000000, 0x800);
|
||||
DmaCopy16(3, gSphealBoardBG1Tilemap, (void *)0x06000800, 0x800);
|
||||
DmaCopy16(3, gBoardHudTilemapA, (void *)0x06006800, 0x400);
|
||||
DmaCopy16(3, gBoardHudTilemapB, (void *)0x06006C00, 0x800);
|
||||
DmaCopy16(3, gSphealIntroSprites_Gfx, (void *)0x06010000, 0x8000);
|
||||
break;
|
||||
}
|
||||
|
||||
gUnknown_02031520.unk68 = gUnknown_0816C3E4;
|
||||
gBoardConfig.flipperCollisionData = gFlipperCollisionData;
|
||||
}
|
||||
|
||||
void sub_46FD4(s16 arg0)
|
||||
void SetBoardCollisionConfig(s16 arg0)
|
||||
{
|
||||
gUnknown_02031520.unk14.unk38[0] = gUnknown_086AFCB0[gMain.selectedField][arg0].unk0;
|
||||
gUnknown_02031520.unk14.unk48[0] = gUnknown_086AFCB0[gMain.selectedField][arg0].unk10;
|
||||
gUnknown_02031520.unk14.unk58[0] = gUnknown_086AFCB0[gMain.selectedField][arg0].unk20;
|
||||
gBoardConfig.fieldLayout.collisionTileMap[0] = gBoardCollisionDataSets[gMain.selectedField][arg0].tileData;
|
||||
gBoardConfig.fieldLayout.collisionAngleMap[0] = gBoardCollisionDataSets[gMain.selectedField][arg0].angleData;
|
||||
gBoardConfig.fieldLayout.collisionTypeMap[0] = gBoardCollisionDataSets[gMain.selectedField][arg0].typeData;
|
||||
}
|
||||
|
||||
void sub_47030(void)
|
||||
void UpdateScrollingBackgroundTiles(void)
|
||||
{
|
||||
s16 r4;
|
||||
const s16 *r3;
|
||||
|
||||
r4 = gMain.bgOffsets[3].yOffset / 8;
|
||||
r3 = gUnknown_086B0010[r4];
|
||||
if (r4 == gCurrentPinballGame->unk64)
|
||||
r3 = gScrollTileUpdateTable[r4];
|
||||
if (r4 == gCurrentPinballGame->ballLaunchSpeed)
|
||||
return;
|
||||
|
||||
if (r4 > gCurrentPinballGame->unk64)
|
||||
if (r4 > gCurrentPinballGame->ballLaunchSpeed)
|
||||
{
|
||||
if (r3[0] > 31)
|
||||
{
|
||||
DmaCopy16(3, &gUnknown_020030A0[(r3[0] - 32) * 0x400], (void *)0x06008000 + r3[1] * 0x400, 0x400);
|
||||
DmaCopy16(3, &gBoardBGTileBufferAlt[(r3[0] - 32) * 0x400], (void *)0x06008000 + r3[1] * 0x400, 0x400);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, &gUnknown_0200FBB0[r3[0] * 0x400], (void *)0x06008000 + r3[1] * 0x400, 0x400);
|
||||
DmaCopy16(3, &gBoardGfxBuffer[r3[0] * 0x400], (void *)0x06008000 + r3[1] * 0x400, 0x400);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r3[2] > 31)
|
||||
{
|
||||
DmaCopy16(3, &gUnknown_020030A0[(r3[2] - 32) * 0x400], (void *)0x06008000 + r3[3] * 0x400, 0x400);
|
||||
DmaCopy16(3, &gBoardBGTileBufferAlt[(r3[2] - 32) * 0x400], (void *)0x06008000 + r3[3] * 0x400, 0x400);
|
||||
}
|
||||
else
|
||||
{
|
||||
DmaCopy16(3, &gUnknown_0200FBB0[r3[2] * 0x400], (void *)0x06008000 + r3[3] * 0x400, 0x400);
|
||||
DmaCopy16(3, &gBoardGfxBuffer[r3[2] * 0x400], (void *)0x06008000 + r3[3] * 0x400, 0x400);
|
||||
}
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk64 = r4;
|
||||
gCurrentPinballGame->ballLaunchSpeed = r4;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
290
src/rom_4F258.c
290
src/rom_4F258.c
|
|
@ -3,83 +3,83 @@
|
|||
#include "main.h"
|
||||
#include "constants/bg_music.h"
|
||||
|
||||
extern const u8 *gUnknown_086B0B70[][3];
|
||||
extern const u16 gUnknown_086B0E20[];
|
||||
extern const u8 *gUnknown_086B0B94[][4];
|
||||
extern const u8 *gUnknown_086B0B20[][4];
|
||||
extern const u8 *gUnknown_086B0AF0[][4];
|
||||
extern const u8 *gUnknown_086B0AC0[][4];
|
||||
extern const u8 *gUnknown_086B0A90[][4];
|
||||
extern const u8 *gUnknown_086B0BC4[][4];
|
||||
extern const u8 *gUnknown_086B09E8[][7][2];
|
||||
extern const u8 *gUnknown_086B09C8[][2];
|
||||
extern const u8 *gUnknown_086B0970[][2];
|
||||
extern const u8 *gUnknown_086B094C[][3];
|
||||
extern const s16 gUnknown_086B08CA[];
|
||||
extern const u8 *gUnknown_086B08D4[][3][5];
|
||||
extern const u8 *gRubyBallPowerUpLightTilePointers[][3];
|
||||
extern const u16 gBallShadowTileIndices[];
|
||||
extern const u8 *gRubyCatchProgressArrowTilePointers[][4];
|
||||
extern const u8 *gRubyRouletteSlotTilePointers[][4];
|
||||
extern const u8 *gRubyEvoArrowTilePointers[][4];
|
||||
extern const u8 *gRubyCatchArrowTilePointers[][4];
|
||||
extern const u8 *gRubyModeTimerTilePointers[][4];
|
||||
extern const u8 *gRubyHoleIndicatorTilePointers[][4];
|
||||
extern const u8 *gRubyCatchLightTilePointers[][7][2];
|
||||
extern const u8 *gRubyTrapIndicatorTilePointers[][2];
|
||||
extern const u8 *gRubyProgressDigitTilePointers[][2];
|
||||
extern const u8 *gShopItemTilePointers[][3];
|
||||
extern const s16 gRubySlingshotAnimIndices[];
|
||||
extern const u8 *gRubySlingshotTilePointers[][3][5];
|
||||
|
||||
extern struct SongHeader se_unk_87;
|
||||
|
||||
|
||||
void sub_4E814(void)
|
||||
void UpdateRubyBoardAnimations(void)
|
||||
{
|
||||
gCurrentPinballGame->unk734 = (gCurrentPinballGame->unk70C % 40) / 20;
|
||||
gCurrentPinballGame->unk70C++;
|
||||
sub_4EA44();
|
||||
if (gCurrentPinballGame->unk6A < 232)
|
||||
gCurrentPinballGame->hudBlinkPhase = (gCurrentPinballGame->hudAnimFrameCounter % 40) / 20;
|
||||
gCurrentPinballGame->hudAnimFrameCounter++;
|
||||
DrawRubyProgressDigits();
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 232)
|
||||
{
|
||||
sub_4EDC0();
|
||||
sub_4EE74();
|
||||
AnimateRubyCatchArrow();
|
||||
AnimateRubyEvoArrow();
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk6A >= 81 && gCurrentPinballGame->unk6A < 248)
|
||||
sub_4EF38();
|
||||
if (gCurrentPinballGame->hudSpriteBaseY >= 81 && gCurrentPinballGame->hudSpriteBaseY < 248)
|
||||
AnimateRubyRouletteSlot();
|
||||
|
||||
sub_4F0F0();
|
||||
if (gCurrentPinballGame->unk6A < 112)
|
||||
sub_4F258();
|
||||
AnimateRubyBallPowerUpSequence();
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 112)
|
||||
DrawRubyBallPowerUpLights();
|
||||
|
||||
if (gCurrentPinballGame->unk6A > 112)
|
||||
sub_4F028();
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 112)
|
||||
AnimateRubyCatchProgressArrow();
|
||||
|
||||
if (gCurrentPinballGame->unk6A > 104)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 104)
|
||||
{
|
||||
sub_4F4B4();
|
||||
sub_4F660();
|
||||
DrawEvoArrowProgress();
|
||||
DrawCatchArrowProgress();
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk6A < 256)
|
||||
sub_4F30C();
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 256)
|
||||
DrawCoinRewardMeter();
|
||||
|
||||
sub_4F2B8();
|
||||
if (gCurrentPinballGame->unk6A > 110)
|
||||
sub_4EAB0();
|
||||
UpdateCoinRewardTimer();
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 110)
|
||||
AnimateRubyTrapIndicator();
|
||||
|
||||
if (gCurrentPinballGame->unk6A > 178)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 178)
|
||||
{
|
||||
sub_4EAF8();
|
||||
sub_4EBD0();
|
||||
sub_4E920();
|
||||
AnimateRubyCatchLightBlink();
|
||||
AnimateRubyHoleIndicators();
|
||||
AnimateRubySlingshotTimer();
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk6A > 202)
|
||||
sub_4ECDC();
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 202)
|
||||
DrawRubyModeTimerDisplay();
|
||||
|
||||
if (gCurrentPinballGame->unk724 && gCurrentPinballGame->unk25 == 0)
|
||||
gCurrentPinballGame->unk724--;
|
||||
if (gCurrentPinballGame->modeTimeRemaining && gCurrentPinballGame->ballCatchState == 0)
|
||||
gCurrentPinballGame->modeTimeRemaining--;
|
||||
}
|
||||
|
||||
void sub_4E920(void)
|
||||
void AnimateRubySlingshotTimer(void)
|
||||
{
|
||||
s16 index;
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
index = gUnknown_086B08CA[gCurrentPinballGame->unk716];
|
||||
if (gCurrentPinballGame->unk716)
|
||||
index = gRubySlingshotAnimIndices[gCurrentPinballGame->slingshotHitAnimTimer];
|
||||
if (gCurrentPinballGame->slingshotHitAnimTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk716--;
|
||||
if (gCurrentPinballGame->unk716 == 3)
|
||||
gCurrentPinballGame->slingshotHitAnimTimer--;
|
||||
if (gCurrentPinballGame->slingshotHitAnimTimer == 3)
|
||||
{
|
||||
m4aSongNumStart(SE_SLINGSHOT_HIT);
|
||||
gCurrentPinballGame->scoreAddedInFrame = 500;
|
||||
|
|
@ -87,8 +87,8 @@ void sub_4E920(void)
|
|||
}
|
||||
}
|
||||
|
||||
src = gUnknown_086B08D4[gCurrentPinballGame->unk717][index];
|
||||
dest = gUnknown_086B08D4[gCurrentPinballGame->unk717][2];
|
||||
src = gRubySlingshotTilePointers[gCurrentPinballGame->slingshotSideIndex][index];
|
||||
dest = gRubySlingshotTilePointers[gCurrentPinballGame->slingshotSideIndex][2];
|
||||
DmaCopy16(3, src[0], dest[0], 0x20);
|
||||
DmaCopy16(3, src[1], dest[1], 0x40);
|
||||
DmaCopy16(3, src[2], dest[2], 0x60);
|
||||
|
|
@ -96,82 +96,82 @@ void sub_4E920(void)
|
|||
DmaCopy16(3, src[4], dest[4], 0x40);
|
||||
}
|
||||
|
||||
void sub_4E9F0(s16 arg0)
|
||||
void LoadShopItemGraphics(s16 arg0)
|
||||
{
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
src = gUnknown_086B094C[arg0];
|
||||
dest = gUnknown_086B094C[2];
|
||||
src = gShopItemTilePointers[arg0];
|
||||
dest = gShopItemTilePointers[2];
|
||||
DmaCopy16(3, src[0], dest[0], 0xC0);
|
||||
DmaCopy16(3, src[1], dest[1], 0xC0);
|
||||
DmaCopy16(3, src[2], dest[2], 0x20);
|
||||
}
|
||||
|
||||
void sub_4EA44(void)
|
||||
void DrawRubyProgressDigits(void)
|
||||
{
|
||||
s16 var0, var1;
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
var0 = gCurrentPinballGame->unk70E / 10;
|
||||
var1 = gCurrentPinballGame->unk70E % 10;
|
||||
src = gUnknown_086B0970[var0];
|
||||
dest = gUnknown_086B0970[10];
|
||||
var0 = gCurrentPinballGame->progressLevel / 10;
|
||||
var1 = gCurrentPinballGame->progressLevel % 10;
|
||||
src = gRubyProgressDigitTilePointers[var0];
|
||||
dest = gRubyProgressDigitTilePointers[10];
|
||||
DmaCopy16(3, src[0], dest[0], 0x20);
|
||||
|
||||
src = gUnknown_086B0970[var1];
|
||||
src = gRubyProgressDigitTilePointers[var1];
|
||||
DmaCopy16(3, src[1], dest[1], 0x20);
|
||||
}
|
||||
|
||||
void sub_4EAB0(void)
|
||||
void AnimateRubyTrapIndicator(void)
|
||||
{
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
src = gUnknown_086B09C8[gCurrentPinballGame->unk730];
|
||||
dest = gUnknown_086B09C8[3];
|
||||
src = gRubyTrapIndicatorTilePointers[gCurrentPinballGame->trapAnimState];
|
||||
dest = gRubyTrapIndicatorTilePointers[3];
|
||||
DmaCopy16(3, src[0], dest[0], 0x40);
|
||||
DmaCopy16(3, src[1], dest[1], 0x40);
|
||||
}
|
||||
|
||||
void sub_4EAF8(void)
|
||||
void AnimateRubyCatchLightBlink(void)
|
||||
{
|
||||
s16 i;
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
if (gCurrentPinballGame->unk720)
|
||||
if (gCurrentPinballGame->evoBlinkTimer)
|
||||
{
|
||||
gCurrentPinballGame->unk71D[gCurrentPinballGame->unk721] = 1 - (gCurrentPinballGame->unk720 % 36) / 18;
|
||||
gCurrentPinballGame->unk71D[gCurrentPinballGame->unk722] = gCurrentPinballGame->unk71D[gCurrentPinballGame->unk721];
|
||||
gCurrentPinballGame->unk720--;
|
||||
gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot1] = 1 - (gCurrentPinballGame->evoBlinkTimer % 36) / 18;
|
||||
gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot2] = gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot1];
|
||||
gCurrentPinballGame->evoBlinkTimer--;
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
src = gUnknown_086B09E8[i][gCurrentPinballGame->unk71D[i]];
|
||||
dest = gUnknown_086B09E8[i][6];
|
||||
src = gRubyCatchLightTilePointers[i][gCurrentPinballGame->catchLights[i]];
|
||||
dest = gRubyCatchLightTilePointers[i][6];
|
||||
DmaCopy16(3, src[0], dest[0], 0x40);
|
||||
DmaCopy16(3, src[1], dest[1], 0x40);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_4EBD0(void)
|
||||
void AnimateRubyHoleIndicators(void)
|
||||
{
|
||||
s16 i;
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
if (gCurrentPinballGame->unk714)
|
||||
if (gCurrentPinballGame->allHolesLit)
|
||||
{
|
||||
if (gCurrentPinballGame->unk715)
|
||||
if (gCurrentPinballGame->allHolesLitBlinkTimer)
|
||||
{
|
||||
gCurrentPinballGame->holeIndicators[0] = (gCurrentPinballGame->unk715 % 36) / 18;
|
||||
gCurrentPinballGame->holeIndicators[0] = (gCurrentPinballGame->allHolesLitBlinkTimer % 36) / 18;
|
||||
gCurrentPinballGame->holeIndicators[1] = gCurrentPinballGame->holeIndicators[0];
|
||||
gCurrentPinballGame->holeIndicators[2] = gCurrentPinballGame->holeIndicators[0];
|
||||
gCurrentPinballGame->holeIndicators[3] = gCurrentPinballGame->holeIndicators[0];
|
||||
gCurrentPinballGame->unk715--;
|
||||
gCurrentPinballGame->allHolesLitBlinkTimer--;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -184,106 +184,106 @@ void sub_4EBD0(void)
|
|||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
src = &gUnknown_086B0BC4[i][gCurrentPinballGame->holeIndicators[i]];
|
||||
dest = &gUnknown_086B0BC4[i][2];
|
||||
src = &gRubyHoleIndicatorTilePointers[i][gCurrentPinballGame->holeIndicators[i]];
|
||||
dest = &gRubyHoleIndicatorTilePointers[i][2];
|
||||
DmaCopy16(3, *src, *dest, 0x40);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_4ECDC(void)
|
||||
void DrawRubyModeTimerDisplay(void)
|
||||
{
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
if (gCurrentPinballGame->unk724 > 300)
|
||||
if (gCurrentPinballGame->modeTimeRemaining > 300)
|
||||
{
|
||||
gCurrentPinballGame->unk726 = 1;
|
||||
gCurrentPinballGame->modeTimerDisplayIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gCurrentPinballGame->unk724)
|
||||
if (gCurrentPinballGame->modeTimeRemaining)
|
||||
{
|
||||
if (gCurrentPinballGame->unk25)
|
||||
gCurrentPinballGame->unk726 = 1;
|
||||
if (gCurrentPinballGame->ballCatchState)
|
||||
gCurrentPinballGame->modeTimerDisplayIndex = 1;
|
||||
else
|
||||
gCurrentPinballGame->unk726 = (gMain.fieldFrameCount % 16) / 8;
|
||||
gCurrentPinballGame->modeTimerDisplayIndex = (gMain.fieldFrameCount % 16) / 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk726 = 0;
|
||||
gCurrentPinballGame->modeTimerDisplayIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
src = gUnknown_086B0A90[gCurrentPinballGame->unk726];
|
||||
dest = gUnknown_086B0A90[2];
|
||||
src = gRubyModeTimerTilePointers[gCurrentPinballGame->modeTimerDisplayIndex];
|
||||
dest = gRubyModeTimerTilePointers[2];
|
||||
DmaCopy16(3, src[0], dest[0], 0xC0);
|
||||
DmaCopy16(3, src[1], dest[1], 0xC0);
|
||||
if (gCurrentPinballGame->unk6A >= 216)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY >= 216)
|
||||
{
|
||||
DmaCopy16(3, src[2], dest[2], 0xA0);
|
||||
DmaCopy16(3, src[3], dest[3], 0x40);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_4EDC0(void)
|
||||
void AnimateRubyCatchArrow(void)
|
||||
{
|
||||
s16 index;
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
index = 0;
|
||||
if (gCurrentPinballGame->unk728 > 0)
|
||||
index = 1 - gCurrentPinballGame->unk734;
|
||||
if (gCurrentPinballGame->catchArrowPaletteActive > 0)
|
||||
index = 1 - gCurrentPinballGame->hudBlinkPhase;
|
||||
|
||||
src = gUnknown_086B0AC0[index];
|
||||
dest = gUnknown_086B0AC0[2];
|
||||
if (gCurrentPinballGame->unk6A > 48)
|
||||
src = gRubyCatchArrowTilePointers[index];
|
||||
dest = gRubyCatchArrowTilePointers[2];
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 48)
|
||||
{
|
||||
if (gCurrentPinballGame->unk6A < 216)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 216)
|
||||
{
|
||||
DmaCopy16(3, src[0], dest[0], 0x80);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk6A < 224)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 224)
|
||||
{
|
||||
DmaCopy16(3, src[1], dest[1], 0x80);
|
||||
}
|
||||
}
|
||||
if (gCurrentPinballGame->unk6A > 64)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 64)
|
||||
{
|
||||
DmaCopy16(3, src[2], dest[2], 0x80);
|
||||
DmaCopy16(3, src[3], dest[3], 0x80);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_4EE74(void)
|
||||
void AnimateRubyEvoArrow(void)
|
||||
{
|
||||
s16 index;
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
index = 0;
|
||||
if (gCurrentPinballGame->unk729 > 0)
|
||||
index = 1 - gCurrentPinballGame->unk734;
|
||||
if (gCurrentPinballGame->evoArrowPaletteActive > 0)
|
||||
index = 1 - gCurrentPinballGame->hudBlinkPhase;
|
||||
|
||||
src = gUnknown_086B0AF0[index];
|
||||
dest = gUnknown_086B0AF0[2];
|
||||
if (gCurrentPinballGame->unk6A > 40)
|
||||
src = gRubyEvoArrowTilePointers[index];
|
||||
dest = gRubyEvoArrowTilePointers[2];
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 40)
|
||||
{
|
||||
if (gCurrentPinballGame->unk6A < 208)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 208)
|
||||
{
|
||||
DmaCopy16(3, src[0], dest[0], 0x40);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk6A < 216)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 216)
|
||||
{
|
||||
DmaCopy16(3, src[1], dest[1], 0x80);
|
||||
}
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk6A > 56)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 56)
|
||||
{
|
||||
if (gCurrentPinballGame->unk6A < 224)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 224)
|
||||
{
|
||||
DmaCopy16(3, src[2], dest[2], 0x80);
|
||||
}
|
||||
|
|
@ -292,55 +292,55 @@ void sub_4EE74(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_4EF38(void)
|
||||
void AnimateRubyRouletteSlot(void)
|
||||
{
|
||||
s16 index;
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
index = 0;
|
||||
if (gCurrentPinballGame->unk2F0 > 2)
|
||||
gCurrentPinballGame->unk72A = 1;
|
||||
else if (gCurrentPinballGame->unk13)
|
||||
gCurrentPinballGame->unk72A = 0;
|
||||
if (gCurrentPinballGame->shopDoorTargetFrame > 2)
|
||||
gCurrentPinballGame->rouletteSlotActive = 1;
|
||||
else if (gCurrentPinballGame->boardState)
|
||||
gCurrentPinballGame->rouletteSlotActive = 0;
|
||||
|
||||
if (gCurrentPinballGame->unk72A > 0)
|
||||
index = gCurrentPinballGame->unk1A5 * 2 + 1 - gCurrentPinballGame->unk734;
|
||||
if (gCurrentPinballGame->rouletteSlotActive > 0)
|
||||
index = gCurrentPinballGame->evolutionShopActive * 2 + 1 - gCurrentPinballGame->hudBlinkPhase;
|
||||
else
|
||||
index = gCurrentPinballGame->unk1A5 * 2;
|
||||
index = gCurrentPinballGame->evolutionShopActive * 2;
|
||||
|
||||
src = gUnknown_086B0B20[index];
|
||||
dest = gUnknown_086B0B20[4];
|
||||
if (gCurrentPinballGame->unk6A < 240)
|
||||
src = gRubyRouletteSlotTilePointers[index];
|
||||
dest = gRubyRouletteSlotTilePointers[4];
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 240)
|
||||
{
|
||||
DmaCopy16(3, src[0], dest[0], 0xA0);
|
||||
}
|
||||
|
||||
DmaCopy16(3, src[1], dest[1], 0xA0);
|
||||
DmaCopy16(3, src[2], dest[2], 0xA0);
|
||||
if (gCurrentPinballGame->unk6A > 88)
|
||||
if (gCurrentPinballGame->hudSpriteBaseY > 88)
|
||||
{
|
||||
DmaCopy16(3, src[3], dest[3], 0x60);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_4F028(void)
|
||||
void AnimateRubyCatchProgressArrow(void)
|
||||
{
|
||||
s16 index;
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
index = 0;
|
||||
gCurrentPinballGame->unk731 = 0;
|
||||
if (gCurrentPinballGame->unk72F > 1 && gCurrentPinballGame->unk13 < 3)
|
||||
gCurrentPinballGame->unk731 = 1;
|
||||
gCurrentPinballGame->catchProgressFlashing = 0;
|
||||
if (gCurrentPinballGame->catchArrowProgress > 1 && gCurrentPinballGame->boardState < 3)
|
||||
gCurrentPinballGame->catchProgressFlashing = 1;
|
||||
|
||||
if (gCurrentPinballGame->unk731 > 0)
|
||||
index = 1 - gCurrentPinballGame->unk734;
|
||||
if (gCurrentPinballGame->catchProgressFlashing > 0)
|
||||
index = 1 - gCurrentPinballGame->hudBlinkPhase;
|
||||
|
||||
src = gUnknown_086B0B94[index];
|
||||
dest = gUnknown_086B0B94[2];
|
||||
if (gCurrentPinballGame->unk6A < 264)
|
||||
src = gRubyCatchProgressArrowTilePointers[index];
|
||||
dest = gRubyCatchProgressArrowTilePointers[2];
|
||||
if (gCurrentPinballGame->hudSpriteBaseY < 264)
|
||||
{
|
||||
DmaCopy16(3, src[0], dest[0], 0x40);
|
||||
}
|
||||
|
|
@ -349,61 +349,61 @@ void sub_4F028(void)
|
|||
DmaCopy16(3, src[3], dest[3], 0x80);
|
||||
}
|
||||
|
||||
void sub_4F0F0(void)
|
||||
void AnimateRubyBallPowerUpSequence(void)
|
||||
{
|
||||
if (gCurrentPinballGame->unk71B == 0)
|
||||
if (gCurrentPinballGame->ballPowerUpAnimActive == 0)
|
||||
return;
|
||||
|
||||
if (gCurrentPinballGame->unk71C)
|
||||
if (gCurrentPinballGame->ballShadowTimer)
|
||||
{
|
||||
if (gCurrentPinballGame->unk2F8 == 0)
|
||||
if (gCurrentPinballGame->ballPowerUpOverride == 0)
|
||||
{
|
||||
gCurrentPinballGame->ballPowerUpLight[0] = (gMain.fieldFrameCount % 20) / 10;
|
||||
gCurrentPinballGame->ballPowerUpLight[1] = gCurrentPinballGame->ballPowerUpLight[0];
|
||||
gCurrentPinballGame->ballPowerUpLight[2] = gCurrentPinballGame->ballPowerUpLight[0];
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk71C == 28)
|
||||
if (gCurrentPinballGame->ballShadowTimer == 28)
|
||||
{
|
||||
if (gCurrentPinballGame->ballUpgradeType < BALL_UPGRADE_TYPE_MASTER_BALL)
|
||||
gCurrentPinballGame->ballUpgradeType++;
|
||||
|
||||
gCurrentPinballGame->ballUpgradeCounter = 3600;
|
||||
DmaCopy16(3, gUnknown_08137E14[gCurrentPinballGame->ballUpgradeType], (void *)0x05000220, 0x20);
|
||||
DmaCopy16(3, gBallPalettes[gCurrentPinballGame->ballUpgradeType], (void *)0x05000220, 0x20);
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->unk71C == 40)
|
||||
if (gCurrentPinballGame->ballShadowTimer == 40)
|
||||
MPlayStart(&gMPlayInfo_SE1, &se_unk_87);
|
||||
|
||||
if (gCurrentPinballGame->unk71C == 60)
|
||||
gMain.unk44[43]->available = 1;
|
||||
if (gCurrentPinballGame->ballShadowTimer == 60)
|
||||
gMain.fieldSpriteGroups[43]->available = 1;
|
||||
|
||||
gCurrentPinballGame->unk6E = gUnknown_086B0E20[30 - gCurrentPinballGame->unk71C / 2];
|
||||
gCurrentPinballGame->unk71C--;
|
||||
gCurrentPinballGame->ballShadowTileIndex = gBallShadowTileIndices[30 - gCurrentPinballGame->ballShadowTimer / 2];
|
||||
gCurrentPinballGame->ballShadowTimer--;
|
||||
}
|
||||
else
|
||||
{
|
||||
gCurrentPinballGame->unk71B = 0;
|
||||
if (gCurrentPinballGame->unk2F8 == 0)
|
||||
gCurrentPinballGame->ballPowerUpAnimActive = 0;
|
||||
if (gCurrentPinballGame->ballPowerUpOverride == 0)
|
||||
{
|
||||
gCurrentPinballGame->ballPowerUpLight[0] =
|
||||
gCurrentPinballGame->ballPowerUpLight[1] =
|
||||
gCurrentPinballGame->ballPowerUpLight[2] = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->unk2F8 = 0;
|
||||
gCurrentPinballGame->ballPowerUpOverride = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_4F258(void)
|
||||
void DrawRubyBallPowerUpLights(void)
|
||||
{
|
||||
s16 i;
|
||||
const u8 **src;
|
||||
const u8 **dest;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
src = &gUnknown_086B0B70[i][gCurrentPinballGame->ballPowerUpLight[i]];
|
||||
dest = &gUnknown_086B0B70[i][2];
|
||||
src = &gRubyBallPowerUpLightTilePointers[i][gCurrentPinballGame->ballPowerUpLight[i]];
|
||||
dest = &gRubyBallPowerUpLightTilePointers[i][2];
|
||||
DmaCopy16(3, *src, *dest, 0x40);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
596
src/rom_50AD4.c
596
src/rom_50AD4.c
File diff suppressed because it is too large
Load Diff
|
|
@ -14,7 +14,7 @@ u16 IsInVblank(void)
|
|||
|
||||
void SetMainCallback(void (*func)(void))
|
||||
{
|
||||
gUnknown_02017BD4 = func;
|
||||
gMainCallbackShadow = func;
|
||||
if (!IsInVblank())
|
||||
gMainCallback = func;
|
||||
}
|
||||
|
|
@ -22,12 +22,12 @@ void SetMainCallback(void (*func)(void))
|
|||
void ResetMainCallback(void)
|
||||
{
|
||||
gMainCallback = DefaultMainCallback;
|
||||
gUnknown_02017BD4 = DefaultMainCallback;
|
||||
gMainCallbackShadow = DefaultMainCallback;
|
||||
}
|
||||
|
||||
void SetVBlankIntrFunc(void (*func)(void))
|
||||
{
|
||||
gUnknown_02017BD0 = func;
|
||||
gVBlankIntrFuncShadow = func;
|
||||
if (!IsInVblank())
|
||||
*gVBlankIntrFuncPtr = func;
|
||||
}
|
||||
|
|
@ -35,12 +35,12 @@ void SetVBlankIntrFunc(void (*func)(void))
|
|||
void ResetVBlankIntrFunc(void)
|
||||
{
|
||||
*gVBlankIntrFuncPtr = VBlankIntr;
|
||||
gUnknown_02017BD0 = VBlankIntr;
|
||||
gVBlankIntrFuncShadow = VBlankIntr;
|
||||
}
|
||||
|
||||
void SetVCountIntrFunc(void (*func)(void))
|
||||
{
|
||||
gUnknown_0200FBA0 = func;
|
||||
gVCountIntrFuncShadow = func;
|
||||
if (!IsInVblank())
|
||||
*gVCountIntrFuncPtr = func;
|
||||
}
|
||||
|
|
@ -48,6 +48,6 @@ void SetVCountIntrFunc(void (*func)(void))
|
|||
void ResetVCountIntrFunc(void)
|
||||
{
|
||||
*gVCountIntrFuncPtr = VCountIntr;
|
||||
gUnknown_0200FBA0 = VCountIntr;
|
||||
gVCountIntrFuncShadow = VCountIntr;
|
||||
}
|
||||
|
||||
|
|
|
|||
10
src/save.c
10
src/save.c
|
|
@ -9,14 +9,14 @@ static bool16 LoadSaveDataFromSram(void);
|
|||
void SaveFile_LoadGameData(void)
|
||||
{
|
||||
SetSramFastFunc();
|
||||
gMain.unkC = 0;
|
||||
gMain.sramError = 0;
|
||||
if (LoadSaveDataFromSram() == FALSE)
|
||||
{
|
||||
ResetSaveFile();
|
||||
SaveFile_WriteToSram();
|
||||
if (LoadSaveDataFromSram() == FALSE)
|
||||
{
|
||||
gMain.unkC = 1;
|
||||
gMain.sramError = 1;
|
||||
ResetSaveFile();
|
||||
}
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ void SaveFile_WriteToSram(void)
|
|||
u16 *saveData = (u16 *)&gMain_saveData;
|
||||
size_t size = sizeof(gMain_saveData);
|
||||
|
||||
gMain_saveData.unk2E4++;
|
||||
gMain_saveData.saveChangeCounter++;
|
||||
gMain_saveData.checksum = 0;
|
||||
|
||||
checksum = 0;
|
||||
|
|
@ -103,7 +103,7 @@ void SaveFile_SetPokedexFlags(s16 species, u8 flag)
|
|||
|
||||
if (gMain_saveData.pokedexFlags[species] < flag)
|
||||
{
|
||||
gMain_saveData.unk2E4++;
|
||||
gMain_saveData.saveChangeCounter++;
|
||||
gMain_saveData.pokedexFlags[species] = flag;
|
||||
gMain_saveData.checksum = 0;
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ void ResetSaveFile(void)
|
|||
for (i = 0; i < 10; i++)
|
||||
gMain_saveData.signature[i] = gSaveFileSignature[i];
|
||||
|
||||
gMain_saveData.unk2E4 = 0;
|
||||
gMain_saveData.saveChangeCounter = 0;
|
||||
gMain_saveData.rumbleEnabled = FALSE;
|
||||
gMain_saveData.ballSpeed = 0;
|
||||
SetButtonConfigInputs(BUTTON_CONFIG_RESET);
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#include "constants/bg_music.h"
|
||||
|
||||
static void TitleScreen_CheckDeleteKeyComboPressed(void);
|
||||
static void sub_1157C(void);
|
||||
static void sub_11640(void);
|
||||
static void CheckEReaderAccessCombo(void);
|
||||
static void RenderTitlePressStartSprites(void);
|
||||
|
||||
// If the user doesn't press any buttons at the title screen,
|
||||
// it will transition to a demo gameplay experience.
|
||||
|
|
@ -40,7 +40,7 @@ void LoadTitlescreenGraphics(void)
|
|||
{
|
||||
int autoDisplayMenu;
|
||||
|
||||
ResetSomeGraphicsRelatedStuff();
|
||||
ResetDisplayState();
|
||||
REG_DISPCNT = DISPCNT_OBJ_ON| DISPCNT_FORCED_BLANK;
|
||||
REG_BG1CNT = BGCNT_256COLOR | BGCNT_PRIORITY(1) | BGCNT_CHARBASE(1) | BGCNT_SCREENBASE(0);
|
||||
REG_DISPCNT |= DISPCNT_BG1_ON;
|
||||
|
|
@ -71,18 +71,18 @@ void LoadTitlescreenGraphics(void)
|
|||
autoDisplayMenu = gAutoDisplayTitlescreenMenu;
|
||||
if (autoDisplayMenu == TRUE)
|
||||
{
|
||||
gUnknown_202BE24 = 0;
|
||||
gTitleReturnedFromMenu = 0;
|
||||
gTitlescreen.pressStartAndFlippersVisible = FALSE;
|
||||
gTitlescreen.menuVisible = autoDisplayMenu;
|
||||
gMain.subState = SUBSTATE_3;
|
||||
sub_0CBC();
|
||||
sub_FD5C(NULL);
|
||||
EnableVBlankInterrupts();
|
||||
FadeInFromWhite(NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
gMain.subState = SUBSTATE_WAIT_FOR_START_BUTTON;
|
||||
sub_0CBC();
|
||||
sub_FD5C(sub_11640);
|
||||
EnableVBlankInterrupts();
|
||||
FadeInFromWhite(RenderTitlePressStartSprites);
|
||||
}
|
||||
|
||||
m4aSongNumStart(MUS_TITLE);
|
||||
|
|
@ -93,19 +93,19 @@ void InitTitlescreenStates(void)
|
|||
int i;
|
||||
|
||||
gTitlescreen.animTimer = 0;
|
||||
gTitlescreen.unk2 = 0;
|
||||
gTitlescreen.unk6 = 0;
|
||||
gTitlescreen.unk8 = 0;
|
||||
gTitlescreen.unk10 = 4;
|
||||
gTitlescreen.animPhase = 0;
|
||||
gTitlescreen.menuAction = 0;
|
||||
gTitlescreen.pressStartAnimFrame = 0;
|
||||
gTitlescreen.deleteSaveGroupId = 4;
|
||||
gTitlescreen.pressStartAndFlippersVisible = TRUE;
|
||||
gTitlescreen.deleteSaveWindowVisible = FALSE;
|
||||
gTitlescreen.unkA = 6;
|
||||
gTitlescreen.unkC = 0;
|
||||
gTitlescreen.unkE = 3;
|
||||
gTitlescreen.menuSpriteGroupId = 6;
|
||||
gTitlescreen.cursorSpriteGroupId = 0;
|
||||
gTitlescreen.selectorSpriteGroupId = 3;
|
||||
gTitlescreen.menuVisible = FALSE;
|
||||
gTitlescreen.unkD = 0;
|
||||
gTitlescreen.unkF = 0;
|
||||
gUnknown_0202C588 = 1;
|
||||
gTitlescreen.cursorArrowVisible = 0;
|
||||
gTitlescreen.selectorVisible = 0;
|
||||
gHighScoreEntrySource = 1;
|
||||
gEraseSaveDataAccessStep = 0;
|
||||
gEraseSaveDataAccessCounter = 0;
|
||||
gEReaderAccessStep = 0;
|
||||
|
|
@ -114,56 +114,56 @@ void InitTitlescreenStates(void)
|
|||
if (gMain.hasSavedGame == TRUE)
|
||||
{
|
||||
for (i = 0; i < 7; i++)
|
||||
gUnknown_0202BE00[i] = gUnknown_086A975C[i];
|
||||
gTitleSavedMenuSpriteSets[i] = gTitleSavedDefaultSprites[i];
|
||||
|
||||
gTitlescreen.menuCursorIndex = 1;
|
||||
gTitlescreen.unk7 = 1;
|
||||
gTitlescreen.hasSavedGame = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 7; i++)
|
||||
gUnknown_0201C190[i] = gUnknown_086A96F8[i];
|
||||
gTitleNoSaveMenuSpriteSets[i] = gTitleNoSaveDefaultSprites[i];
|
||||
|
||||
gTitlescreen.menuCursorIndex = 0;
|
||||
gTitlescreen.unk7 = 0;
|
||||
gMain.unkD = 0;
|
||||
gTitlescreen.hasSavedGame = 0;
|
||||
gMain.continueFromSave = 0;
|
||||
}
|
||||
|
||||
gTitlescreen.idleFramesCounter = 0;
|
||||
gTitlescreen.idleFadeoutCounter = 1;
|
||||
gUnknown_020028A4 = 0;
|
||||
gTitleTransitionActive = 0;
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
gUnknown_020028A5 = 1;
|
||||
gTitleRestartDebounce = 1;
|
||||
else
|
||||
gUnknown_020028A5 = 0;
|
||||
gTitleRestartDebounce = 0;
|
||||
|
||||
gUnknown_202BE24 = 0;
|
||||
gTitleReturnedFromMenu = 0;
|
||||
}
|
||||
|
||||
void TitleScreen1_WaitForStartButton(void)
|
||||
{
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
if (!gUnknown_020028A5)
|
||||
if (!gTitleRestartDebounce)
|
||||
{
|
||||
gUnknown_020028A4 = 1;
|
||||
gTitlescreen.unk6 = 9;
|
||||
gTitleTransitionActive = 1;
|
||||
gTitlescreen.menuAction = 9;
|
||||
gMain.subState = SUBSTATE_11;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gUnknown_020028A5 = 0;
|
||||
gTitleRestartDebounce = 0;
|
||||
}
|
||||
|
||||
if (!gUnknown_020028A4)
|
||||
if (!gTitleTransitionActive)
|
||||
{
|
||||
gTitlescreen.animTimer++;
|
||||
if (gTitlescreen.animTimer >= gUnknown_086A9662[gTitlescreen.unk8])
|
||||
if (gTitlescreen.animTimer >= gTitlePressStartAnimDurations[gTitlescreen.pressStartAnimFrame])
|
||||
{
|
||||
gTitlescreen.animTimer = 0;
|
||||
if (++gTitlescreen.unk8 > 3)
|
||||
gTitlescreen.unk8 = 0;
|
||||
if (++gTitlescreen.pressStartAnimFrame > 3)
|
||||
gTitlescreen.pressStartAnimFrame = 0;
|
||||
}
|
||||
|
||||
if (JOY_HELD(KEYS_MASK))
|
||||
|
|
@ -173,12 +173,12 @@ void TitleScreen1_WaitForStartButton(void)
|
|||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gTitlescreen.animTimer = 0;
|
||||
gTitlescreen.unk2 = 0;
|
||||
gTitlescreen.animPhase = 0;
|
||||
gMain.subState = SUBSTATE_2;
|
||||
}
|
||||
|
||||
TitleScreen_CheckDeleteKeyComboPressed();
|
||||
sub_1157C();
|
||||
CheckEReaderAccessCombo();
|
||||
|
||||
gTitlescreen.idleFramesCounter++;
|
||||
if (gTitlescreen.idleFramesCounter > NUM_IDLE_FRAMES)
|
||||
|
|
@ -192,35 +192,35 @@ void TitleScreen1_WaitForStartButton(void)
|
|||
if (gTitlescreen.idleFadeoutCounter > 9)
|
||||
{
|
||||
gTitlescreen.idleFramesCounter = 0;
|
||||
gTitlescreen.unk6 = 7;
|
||||
gTitlescreen.menuAction = 7;
|
||||
gMain.subState = SUBSTATE_11;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub_11640();
|
||||
RenderTitlePressStartSprites();
|
||||
}
|
||||
|
||||
void TitleScreen2_8010CF0(void)
|
||||
void TitleScreen2_AnimOpenMenu(void)
|
||||
{
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
gUnknown_020028A4 = 1;
|
||||
gTitlescreen.unk6 = 9;
|
||||
gTitleTransitionActive = 1;
|
||||
gTitlescreen.menuAction = 9;
|
||||
gMain.subState = SUBSTATE_11;
|
||||
}
|
||||
|
||||
if (!gUnknown_020028A4)
|
||||
if (!gTitleTransitionActive)
|
||||
{
|
||||
gTitlescreen.animTimer++;
|
||||
if (gTitlescreen.animTimer >= gUnknown_086A9666[gTitlescreen.unk2][1])
|
||||
if (gTitlescreen.animTimer >= gTitleMenuSlideInAnimData[gTitlescreen.animPhase][1])
|
||||
{
|
||||
gTitlescreen.animTimer = 0;
|
||||
gTitlescreen.unk8 = gUnknown_086A9666[gTitlescreen.unk2][0];
|
||||
if (++gTitlescreen.unk2 > 5)
|
||||
gTitlescreen.pressStartAnimFrame = gTitleMenuSlideInAnimData[gTitlescreen.animPhase][0];
|
||||
if (++gTitlescreen.animPhase > 5)
|
||||
{
|
||||
gTitlescreen.unk2 = 0;
|
||||
gUnknown_202BE24 = 0;
|
||||
gTitlescreen.animPhase = 0;
|
||||
gTitleReturnedFromMenu = 0;
|
||||
gTitlescreen.pressStartAndFlippersVisible = FALSE;
|
||||
gTitlescreen.menuVisible = TRUE;
|
||||
gMain.subState = SUBSTATE_3;
|
||||
|
|
@ -228,27 +228,27 @@ void TitleScreen2_8010CF0(void)
|
|||
}
|
||||
}
|
||||
|
||||
sub_11640();
|
||||
RenderTitlePressStartSprites();
|
||||
}
|
||||
|
||||
void TitleScreen9_8010D84(void)
|
||||
void TitleScreen9_DeleteSaveConfirmation(void)
|
||||
{
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
gUnknown_020028A4 = 1;
|
||||
gTitlescreen.unk6 = 9;
|
||||
gTitleTransitionActive = 1;
|
||||
gTitlescreen.menuAction = 9;
|
||||
gMain.subState = SUBSTATE_EXEC_MENU_SELECTION;
|
||||
}
|
||||
|
||||
if (!gUnknown_020028A4)
|
||||
if (!gTitleTransitionActive)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
sub_11B74();
|
||||
sub_02B4();
|
||||
DeleteSaveFile();
|
||||
FadeOutScreen();
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
gMain.subState = SUBSTATE_LOAD_GRAPHICS;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
|
|
@ -259,56 +259,56 @@ void TitleScreen9_8010D84(void)
|
|||
}
|
||||
}
|
||||
|
||||
sub_11640();
|
||||
RenderTitlePressStartSprites();
|
||||
}
|
||||
|
||||
void TitleScreen3_8010E00(void)
|
||||
{
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
gUnknown_020028A4 = 1;
|
||||
gTitlescreen.unk6 = 9;
|
||||
gTitleTransitionActive = 1;
|
||||
gTitlescreen.menuAction = 9;
|
||||
gMain.subState = SUBSTATE_11;
|
||||
}
|
||||
|
||||
if (gUnknown_020028A4)
|
||||
if (gTitleTransitionActive)
|
||||
return;
|
||||
|
||||
if (!gTitlescreen.unk7)
|
||||
if (!gTitlescreen.hasSavedGame)
|
||||
{
|
||||
gTitlescreen.animTimer++;
|
||||
if (gTitlescreen.animTimer >= gUnknown_086A9748[gTitlescreen.unk2])
|
||||
if (gTitlescreen.animTimer >= gTitleMenuRetractDurations[gTitlescreen.animPhase])
|
||||
{
|
||||
gTitlescreen.animTimer = 0;
|
||||
gUnknown_0201C190[6] = gUnknown_086A9714[gTitlescreen.unk2];
|
||||
if (++gTitlescreen.unk2 > 11)
|
||||
gTitleNoSaveMenuSpriteSets[6] = gTitleNoSaveAnimSprites[gTitlescreen.animPhase];
|
||||
if (++gTitlescreen.animPhase > 11)
|
||||
{
|
||||
gTitlescreen.unk2 = 0;
|
||||
gTitlescreen.unkD = 1;
|
||||
gTitlescreen.unkF = 1;
|
||||
gTitlescreen.animPhase = 0;
|
||||
gTitlescreen.cursorArrowVisible = 1;
|
||||
gTitlescreen.selectorVisible = 1;
|
||||
gMain.subState = SUBSTATE_MENU_INPUT_NO_SAVED_GAME;
|
||||
}
|
||||
}
|
||||
|
||||
sub_1175C();
|
||||
RenderTitleMenuNoSavedGame();
|
||||
}
|
||||
else
|
||||
{
|
||||
gTitlescreen.animTimer++;
|
||||
if (gTitlescreen.animTimer >= gUnknown_086A9748[gTitlescreen.unk2])
|
||||
if (gTitlescreen.animTimer >= gTitleMenuRetractDurations[gTitlescreen.animPhase])
|
||||
{
|
||||
gTitlescreen.animTimer = 0;
|
||||
gUnknown_0202BE00[6] = gUnknown_086A9778[gTitlescreen.unk2];
|
||||
if (++gTitlescreen.unk2 > 11)
|
||||
gTitleSavedMenuSpriteSets[6] = gTitleSavedAnimSprites[gTitlescreen.animPhase];
|
||||
if (++gTitlescreen.animPhase > 11)
|
||||
{
|
||||
gTitlescreen.unk2 = 0;
|
||||
gTitlescreen.unkD = 1;
|
||||
gTitlescreen.unkF = 1;
|
||||
gTitlescreen.animPhase = 0;
|
||||
gTitlescreen.cursorArrowVisible = 1;
|
||||
gTitlescreen.selectorVisible = 1;
|
||||
gMain.subState = SUBSTATE_MENU_INPUT_SAVED_GAME;
|
||||
}
|
||||
}
|
||||
|
||||
sub_11968();
|
||||
RenderTitleMenuSavedGame();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -316,22 +316,22 @@ void TitleScreen4_MenuInputNoSavedGame(void)
|
|||
{
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
gUnknown_020028A4 = 1;
|
||||
gTitlescreen.unk6 = 9;
|
||||
gTitleTransitionActive = 1;
|
||||
gTitlescreen.menuAction = 9;
|
||||
gMain.subState = SUBSTATE_EXEC_MENU_SELECTION;
|
||||
}
|
||||
|
||||
if (!gUnknown_020028A4)
|
||||
if (!gTitleTransitionActive)
|
||||
{
|
||||
gTitlescreen.animTimer++;
|
||||
if (gTitlescreen.animTimer >= gUnknown_086A9672[gTitlescreen.unk2][1])
|
||||
if (gTitlescreen.animTimer >= gTitleMenuSlideOutAnimData[gTitlescreen.animPhase][1])
|
||||
{
|
||||
gTitlescreen.animTimer = 0;
|
||||
if (++gTitlescreen.unk2 > 6)
|
||||
gTitlescreen.unk2 = 0;
|
||||
if (++gTitlescreen.animPhase > 6)
|
||||
gTitlescreen.animPhase = 0;
|
||||
|
||||
gTitlescreen.unkC = gUnknown_086A9672[gTitlescreen.unk2][0];
|
||||
gTitlescreen.unkE = gUnknown_086A9672[gTitlescreen.unk2][0] + 3;
|
||||
gTitlescreen.cursorSpriteGroupId = gTitleMenuSlideOutAnimData[gTitlescreen.animPhase][0];
|
||||
gTitlescreen.selectorSpriteGroupId = gTitleMenuSlideOutAnimData[gTitlescreen.animPhase][0] + 3;
|
||||
}
|
||||
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
|
|
@ -351,86 +351,86 @@ void TitleScreen4_MenuInputNoSavedGame(void)
|
|||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gTitlescreen.animTimer = 0;
|
||||
gTitlescreen.unk2 = 0;
|
||||
gTitlescreen.animPhase = 0;
|
||||
gMain.subState = SUBSTATE_7;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
m4aSongNumStart(SE_MENU_CANCEL);
|
||||
gTitlescreen.animTimer = 0;
|
||||
gTitlescreen.unk2 = 12;
|
||||
gTitlescreen.unkD = 0;
|
||||
gTitlescreen.unkF = 0;
|
||||
gTitlescreen.animPhase = 12;
|
||||
gTitlescreen.cursorArrowVisible = 0;
|
||||
gTitlescreen.selectorVisible = 0;
|
||||
gMain.subState = SUBSTATE_ANIM_CLOSE_MENU;
|
||||
}
|
||||
|
||||
sub_1157C();
|
||||
CheckEReaderAccessCombo();
|
||||
}
|
||||
|
||||
sub_1175C();
|
||||
RenderTitleMenuNoSavedGame();
|
||||
}
|
||||
|
||||
void TitleScreen7_8011020(void)
|
||||
{
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
gUnknown_020028A4 = 1;
|
||||
gTitlescreen.unk6 = 9;
|
||||
gTitleTransitionActive = 1;
|
||||
gTitlescreen.menuAction = 9;
|
||||
gMain.subState = SUBSTATE_11;
|
||||
}
|
||||
|
||||
if (!gUnknown_020028A4)
|
||||
if (!gTitleTransitionActive)
|
||||
{
|
||||
u16 animTimer = gTitlescreen.animTimer;
|
||||
u16 mask = 0x3;
|
||||
if (!(animTimer & mask))
|
||||
{
|
||||
if (!gTitlescreen.unk2)
|
||||
if (!gTitlescreen.animPhase)
|
||||
{
|
||||
gTitlescreen.unk2 = 1;
|
||||
CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), gUnknown_03000000, 8, 2);
|
||||
gTitlescreen.animPhase = 1;
|
||||
CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), gTempGfxBuffer, 8, 2);
|
||||
CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x61E0), (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
gTitlescreen.unk2 = 0;
|
||||
CopyBgTilesRect(gUnknown_03000000, (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2);
|
||||
gTitlescreen.animPhase = 0;
|
||||
CopyBgTilesRect(gTempGfxBuffer, (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (gTitlescreen.animTimer > 20)
|
||||
{
|
||||
gMain.unkD = 0;
|
||||
gTitlescreen.unk6 = gUnknown_086A96A4[gTitlescreen.menuCursorIndex];
|
||||
gMain.continueFromSave = 0;
|
||||
gTitlescreen.menuAction = gTitleNoSaveMenuActions[gTitlescreen.menuCursorIndex];
|
||||
gMain.subState = SUBSTATE_EXEC_MENU_SELECTION;
|
||||
}
|
||||
|
||||
gTitlescreen.animTimer++;
|
||||
}
|
||||
|
||||
sub_1175C();
|
||||
RenderTitleMenuNoSavedGame();
|
||||
}
|
||||
|
||||
void TitleScreen5_MenuInputSavedGame(void)
|
||||
{
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
gUnknown_020028A4 = 1;
|
||||
gTitlescreen.unk6 = 9;
|
||||
gTitleTransitionActive = 1;
|
||||
gTitlescreen.menuAction = 9;
|
||||
gMain.subState = SUBSTATE_EXEC_MENU_SELECTION;
|
||||
}
|
||||
|
||||
if (!gUnknown_020028A4)
|
||||
if (!gTitleTransitionActive)
|
||||
{
|
||||
gTitlescreen.animTimer++;
|
||||
if (gTitlescreen.animTimer >= gUnknown_086A9672[gTitlescreen.unk2][1])
|
||||
if (gTitlescreen.animTimer >= gTitleMenuSlideOutAnimData[gTitlescreen.animPhase][1])
|
||||
{
|
||||
gTitlescreen.animTimer = 0;
|
||||
if (++gTitlescreen.unk2 > 6)
|
||||
gTitlescreen.unk2 = 0;
|
||||
if (++gTitlescreen.animPhase > 6)
|
||||
gTitlescreen.animPhase = 0;
|
||||
|
||||
gTitlescreen.unkC = gUnknown_086A9672[gTitlescreen.unk2][0];
|
||||
gTitlescreen.unkE = gUnknown_086A9672[gTitlescreen.unk2][0] + 3;
|
||||
gTitlescreen.cursorSpriteGroupId = gTitleMenuSlideOutAnimData[gTitlescreen.animPhase][0];
|
||||
gTitlescreen.selectorSpriteGroupId = gTitleMenuSlideOutAnimData[gTitlescreen.animPhase][0] + 3;
|
||||
}
|
||||
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
|
|
@ -450,35 +450,35 @@ void TitleScreen5_MenuInputSavedGame(void)
|
|||
{
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gTitlescreen.animTimer = 0;
|
||||
gTitlescreen.unk2 = 0;
|
||||
gTitlescreen.animPhase = 0;
|
||||
gMain.subState = SUBSTATE_8;
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
m4aSongNumStart(SE_MENU_CANCEL);
|
||||
gTitlescreen.animTimer = 0;
|
||||
gTitlescreen.unk2 = 12;
|
||||
gTitlescreen.unkD = 0;
|
||||
gTitlescreen.unkF = 0;
|
||||
gTitlescreen.animPhase = 12;
|
||||
gTitlescreen.cursorArrowVisible = 0;
|
||||
gTitlescreen.selectorVisible = 0;
|
||||
gMain.subState = SUBSTATE_ANIM_CLOSE_MENU;
|
||||
}
|
||||
|
||||
sub_1157C();
|
||||
CheckEReaderAccessCombo();
|
||||
}
|
||||
|
||||
sub_11968();
|
||||
RenderTitleMenuSavedGame();
|
||||
}
|
||||
|
||||
void TitleScreen8_8011228(void)
|
||||
{
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
gUnknown_020028A4 = 1;
|
||||
gTitlescreen.unk6 = 9;
|
||||
gTitleTransitionActive = 1;
|
||||
gTitlescreen.menuAction = 9;
|
||||
gMain.subState = SUBSTATE_11;
|
||||
}
|
||||
|
||||
if (!gUnknown_020028A4)
|
||||
if (!gTitleTransitionActive)
|
||||
{
|
||||
u16 animTimer = gTitlescreen.animTimer;
|
||||
u16 mask = 0x3;
|
||||
|
|
@ -486,119 +486,119 @@ void TitleScreen8_8011228(void)
|
|||
// Blink menu item
|
||||
if (!(animTimer & mask))
|
||||
{
|
||||
if (!gTitlescreen.unk2)
|
||||
if (!gTitlescreen.animPhase)
|
||||
{
|
||||
gTitlescreen.unk2 = 1;
|
||||
CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), gUnknown_03000000, 8, 2);
|
||||
gTitlescreen.animPhase = 1;
|
||||
CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), gTempGfxBuffer, 8, 2);
|
||||
CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x61E0), (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
gTitlescreen.unk2 = 0;
|
||||
CopyBgTilesRect(gUnknown_03000000, (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2);
|
||||
gTitlescreen.animPhase = 0;
|
||||
CopyBgTilesRect(gTempGfxBuffer, (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (gTitlescreen.animTimer > 20)
|
||||
{
|
||||
if (gTitlescreen.menuCursorIndex == 1)
|
||||
gMain.unkD = 1;
|
||||
gMain.continueFromSave = 1;
|
||||
else
|
||||
gMain.unkD = 0;
|
||||
gMain.continueFromSave = 0;
|
||||
|
||||
gTitlescreen.unk6 = gUnknown_086A96D4[gTitlescreen.menuCursorIndex];
|
||||
gTitlescreen.menuAction = gTitleSavedMenuActions[gTitlescreen.menuCursorIndex];
|
||||
gMain.subState = SUBSTATE_EXEC_MENU_SELECTION;
|
||||
}
|
||||
|
||||
gTitlescreen.animTimer++;
|
||||
}
|
||||
|
||||
sub_11968();
|
||||
RenderTitleMenuSavedGame();
|
||||
}
|
||||
|
||||
void TitleScreen6_AnimCloseMenu(void)
|
||||
{
|
||||
if (JOY_HELD(RESTART_GAME_BUTTONS) == RESTART_GAME_BUTTONS)
|
||||
{
|
||||
gUnknown_020028A4 = 1;
|
||||
gTitlescreen.unk6 = 9;
|
||||
gTitleTransitionActive = 1;
|
||||
gTitlescreen.menuAction = 9;
|
||||
gMain.subState = SUBSTATE_11;
|
||||
}
|
||||
|
||||
if (gUnknown_020028A4)
|
||||
if (gTitleTransitionActive)
|
||||
return;
|
||||
|
||||
if (!gTitlescreen.unk7)
|
||||
if (!gTitlescreen.hasSavedGame)
|
||||
{
|
||||
gTitlescreen.animTimer++;
|
||||
if (gTitlescreen.animTimer >= gUnknown_086A9748[gTitlescreen.unk2])
|
||||
if (gTitlescreen.animTimer >= gTitleMenuRetractDurations[gTitlescreen.animPhase])
|
||||
{
|
||||
gTitlescreen.animTimer = 0;
|
||||
if (--gTitlescreen.unk2 < 0)
|
||||
if (--gTitlescreen.animPhase < 0)
|
||||
{
|
||||
gTitlescreen.unk2 = 0;
|
||||
gTitlescreen.animPhase = 0;
|
||||
gTitlescreen.menuCursorIndex = 0;
|
||||
gUnknown_202BE24 = 1;
|
||||
gTitleReturnedFromMenu = 1;
|
||||
gTitlescreen.pressStartAndFlippersVisible = TRUE;
|
||||
gTitlescreen.menuVisible = FALSE;
|
||||
gMain.subState = SUBSTATE_WAIT_FOR_START_BUTTON;
|
||||
}
|
||||
|
||||
gUnknown_0201C190[6] = gUnknown_086A9714[gTitlescreen.unk2];
|
||||
gTitleNoSaveMenuSpriteSets[6] = gTitleNoSaveAnimSprites[gTitlescreen.animPhase];
|
||||
}
|
||||
|
||||
sub_1175C();
|
||||
RenderTitleMenuNoSavedGame();
|
||||
}
|
||||
else
|
||||
{
|
||||
gTitlescreen.animTimer++;
|
||||
if (gTitlescreen.animTimer >= gUnknown_086A9748[gTitlescreen.unk2])
|
||||
if (gTitlescreen.animTimer >= gTitleMenuRetractDurations[gTitlescreen.animPhase])
|
||||
{
|
||||
gTitlescreen.animTimer = 0;
|
||||
if (--gTitlescreen.unk2 < 0)
|
||||
if (--gTitlescreen.animPhase < 0)
|
||||
{
|
||||
gTitlescreen.unk2 = 0;
|
||||
gTitlescreen.animPhase = 0;
|
||||
gTitlescreen.menuCursorIndex = 1;
|
||||
gUnknown_202BE24 = 1;
|
||||
gTitleReturnedFromMenu = 1;
|
||||
gTitlescreen.pressStartAndFlippersVisible = TRUE;
|
||||
gTitlescreen.menuVisible = FALSE;
|
||||
gMain.subState = SUBSTATE_WAIT_FOR_START_BUTTON;
|
||||
}
|
||||
|
||||
gUnknown_0202BE00[6] = gUnknown_086A9778[gTitlescreen.unk2];
|
||||
gTitleSavedMenuSpriteSets[6] = gTitleSavedAnimSprites[gTitlescreen.animPhase];
|
||||
}
|
||||
|
||||
sub_11968();
|
||||
RenderTitleMenuSavedGame();
|
||||
}
|
||||
}
|
||||
|
||||
void TitleScreen10_ExecMenuSelection(void)
|
||||
{
|
||||
if (!gTitlescreen.unk7)
|
||||
sub_FE04(sub_1175C);
|
||||
if (!gTitlescreen.hasSavedGame)
|
||||
FadeOutToWhite(RenderTitleMenuNoSavedGame);
|
||||
else
|
||||
sub_FE04(sub_11968);
|
||||
FadeOutToWhite(RenderTitleMenuSavedGame);
|
||||
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
DisableVBlankInterrupts();
|
||||
|
||||
if (gUnknown_086A964C[gTitlescreen.unk6] == STATE_SCORES_MAIN)
|
||||
gUnknown_0202C588 = 0;
|
||||
if (gTitleMenuStateTable[gTitlescreen.menuAction] == STATE_SCORES_MAIN)
|
||||
gHighScoreEntrySource = 0;
|
||||
else
|
||||
gUnknown_0202C588 = 1;
|
||||
gHighScoreEntrySource = 1;
|
||||
|
||||
gAutoDisplayTitlescreenMenu = FALSE;
|
||||
SetMainGameState(gUnknown_086A964C[gTitlescreen.unk6]);
|
||||
SetMainGameState(gTitleMenuStateTable[gTitlescreen.menuAction]);
|
||||
}
|
||||
|
||||
void TitleScreen11_80114B4(void)
|
||||
{
|
||||
sub_FE04(sub_11640);
|
||||
FadeOutToWhite(RenderTitlePressStartSprites);
|
||||
m4aMPlayAllStop();
|
||||
sub_0D10();
|
||||
gUnknown_0202C588 = 1;
|
||||
DisableVBlankInterrupts();
|
||||
gHighScoreEntrySource = 1;
|
||||
gAutoDisplayTitlescreenMenu = FALSE;
|
||||
SetMainGameState(gUnknown_086A964C[gTitlescreen.unk6]);
|
||||
SetMainGameState(gTitleMenuStateTable[gTitlescreen.menuAction]);
|
||||
}
|
||||
|
||||
static void TitleScreen_CheckDeleteKeyComboPressed(void)
|
||||
|
|
@ -627,7 +627,7 @@ static void TitleScreen_CheckDeleteKeyComboPressed(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void sub_1157C(void)
|
||||
static void CheckEReaderAccessCombo(void)
|
||||
{
|
||||
// To access the e-reader screen, alternate pressing R_BUTTON and L_BUTTON 6 times while holding DPAD_RIGHT.
|
||||
s16 buttonMask = gEReaderAccessButtonSequence[gEReaderAccessStep];
|
||||
|
|
@ -640,7 +640,7 @@ static void sub_1157C(void)
|
|||
gEReaderAccessStep = 0;
|
||||
gEReaderAccessCounter = 0;
|
||||
m4aSongNumStart(SE_MENU_SELECT);
|
||||
gTitlescreen.unk6 = 5;
|
||||
gTitlescreen.menuAction = 5;
|
||||
if (gMain.subState == SUBSTATE_WAIT_FOR_START_BUTTON)
|
||||
gMain.subState = SUBSTATE_11;
|
||||
else
|
||||
|
|
@ -664,23 +664,23 @@ static void sub_1157C(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void sub_11640(void)
|
||||
static void RenderTitlePressStartSprites(void)
|
||||
{
|
||||
int i;
|
||||
const struct SpriteSet *spriteSet;
|
||||
struct SpriteGroup *startAndFlippersGroup = &gMain_spriteGroups[gTitlescreen.unk8];
|
||||
struct SpriteGroup *deleteMenuGroup = &gMain_spriteGroups[gTitlescreen.unk10];
|
||||
struct SpriteGroup *startAndFlippersGroup = &gMain_spriteGroups[gTitlescreen.pressStartAnimFrame];
|
||||
struct SpriteGroup *deleteMenuGroup = &gMain_spriteGroups[gTitlescreen.deleteSaveGroupId];
|
||||
|
||||
startAndFlippersGroup->available = gTitlescreen.pressStartAndFlippersVisible;
|
||||
deleteMenuGroup->available = gTitlescreen.deleteSaveWindowVisible;
|
||||
|
||||
LoadSpriteSets(gUnknown_086A96E4, 5, gMain_spriteGroups);
|
||||
LoadSpriteSets(gTitlePressStartSpriteSets, 5, gMain_spriteGroups);
|
||||
|
||||
if (startAndFlippersGroup->available == TRUE)
|
||||
{
|
||||
startAndFlippersGroup->baseX = 120;
|
||||
startAndFlippersGroup->baseY = 102;
|
||||
spriteSet = gUnknown_086A96E4[gTitlescreen.unk8];
|
||||
spriteSet = gTitlePressStartSpriteSets[gTitlescreen.pressStartAnimFrame];
|
||||
for (i = 0; i < spriteSet->count; i++)
|
||||
{
|
||||
gOamBuffer[startAndFlippersGroup->oam[i].oamId].x = startAndFlippersGroup->oam[i].xOffset + startAndFlippersGroup->baseX;
|
||||
|
|
@ -713,7 +713,7 @@ struct UnknownStruct1
|
|||
u8 filler2[6];
|
||||
};
|
||||
|
||||
void sub_1175C(void)
|
||||
void RenderTitleMenuNoSavedGame(void)
|
||||
{
|
||||
struct SpriteGroup *menuSpriteGroup;
|
||||
struct SpriteGroup *r9;
|
||||
|
|
@ -726,21 +726,21 @@ void sub_1175C(void)
|
|||
REG_BLDCNT = gMain.blendControl;
|
||||
REG_BLDALPHA = gMain.blendAlpha;
|
||||
|
||||
menuSpriteGroup = &gMain.spriteGroups[gTitlescreen.unkA];
|
||||
r9 = &gMain.spriteGroups[gTitlescreen.unkC];
|
||||
r8 = &gMain.spriteGroups[gTitlescreen.unkE];
|
||||
menuSpriteGroup = &gMain.spriteGroups[gTitlescreen.menuSpriteGroupId];
|
||||
r9 = &gMain.spriteGroups[gTitlescreen.cursorSpriteGroupId];
|
||||
r8 = &gMain.spriteGroups[gTitlescreen.selectorSpriteGroupId];
|
||||
|
||||
menuSpriteGroup->available = gTitlescreen.menuVisible;
|
||||
r9->available = gTitlescreen.unkD;
|
||||
r8->available = gTitlescreen.unkF;
|
||||
r9->available = gTitlescreen.cursorArrowVisible;
|
||||
r8->available = gTitlescreen.selectorVisible;
|
||||
|
||||
LoadSpriteSets((const struct SpriteSet *const *)gUnknown_0201C190, 7, gMain.spriteGroups);
|
||||
LoadSpriteSets((const struct SpriteSet *const *)gTitleNoSaveMenuSpriteSets, 7, gMain.spriteGroups);
|
||||
|
||||
if (menuSpriteGroup->available == 1)
|
||||
{
|
||||
menuSpriteGroup->baseX = 0x78;
|
||||
menuSpriteGroup->baseY = 0x66;
|
||||
r12 = (const struct UnknownStruct1 *)gUnknown_0201C190[6];
|
||||
r12 = (const struct UnknownStruct1 *)gTitleNoSaveMenuSpriteSets[6];
|
||||
for (sp0 = 0; sp0 < r12->count; sp0++)
|
||||
{
|
||||
struct OamDataSimple *r4 = &menuSpriteGroup->oam[sp0];
|
||||
|
|
@ -757,8 +757,8 @@ void sub_1175C(void)
|
|||
{
|
||||
struct OamDataSimple *r5;
|
||||
|
||||
r9->baseX = gUnknown_086A9684[gTitlescreen.menuCursorIndex].x;
|
||||
r9->baseY = gUnknown_086A9684[gTitlescreen.menuCursorIndex].y;
|
||||
r9->baseX = gTitleNoSaveArrowPositions[gTitlescreen.menuCursorIndex].x;
|
||||
r9->baseY = gTitleNoSaveArrowPositions[gTitlescreen.menuCursorIndex].y;
|
||||
|
||||
r5 = &r9->oam[0];
|
||||
|
||||
|
|
@ -770,8 +770,8 @@ void sub_1175C(void)
|
|||
{
|
||||
struct OamDataSimple *r5;
|
||||
|
||||
r8->baseX = gUnknown_086A9694[gTitlescreen.menuCursorIndex].x;
|
||||
r8->baseY = gUnknown_086A9694[gTitlescreen.menuCursorIndex].y;
|
||||
r8->baseX = gTitleNoSaveSelectorPositions[gTitlescreen.menuCursorIndex].x;
|
||||
r8->baseY = gTitleNoSaveSelectorPositions[gTitlescreen.menuCursorIndex].y;
|
||||
|
||||
r5 = &r8->oam[0];
|
||||
|
||||
|
|
@ -784,7 +784,7 @@ void sub_1175C(void)
|
|||
r8->available = FALSE;
|
||||
}
|
||||
|
||||
void sub_11968(void)
|
||||
void RenderTitleMenuSavedGame(void)
|
||||
{
|
||||
struct SpriteGroup *r10;
|
||||
struct SpriteGroup *r9;
|
||||
|
|
@ -797,21 +797,21 @@ void sub_11968(void)
|
|||
REG_BLDCNT = gMain.blendControl;
|
||||
REG_BLDALPHA = gMain.blendAlpha;
|
||||
|
||||
r10 = &gMain.spriteGroups[gTitlescreen.unkA];
|
||||
r9 = &gMain.spriteGroups[gTitlescreen.unkC];
|
||||
r8 = &gMain.spriteGroups[gTitlescreen.unkE];
|
||||
r10 = &gMain.spriteGroups[gTitlescreen.menuSpriteGroupId];
|
||||
r9 = &gMain.spriteGroups[gTitlescreen.cursorSpriteGroupId];
|
||||
r8 = &gMain.spriteGroups[gTitlescreen.selectorSpriteGroupId];
|
||||
|
||||
r10->available = gTitlescreen.menuVisible;
|
||||
r9->available = gTitlescreen.unkD;
|
||||
r8->available = gTitlescreen.unkF;
|
||||
r9->available = gTitlescreen.cursorArrowVisible;
|
||||
r8->available = gTitlescreen.selectorVisible;
|
||||
|
||||
LoadSpriteSets((const struct SpriteSet *const *)gUnknown_0202BE00, 7, gMain.spriteGroups);
|
||||
LoadSpriteSets((const struct SpriteSet *const *)gTitleSavedMenuSpriteSets, 7, gMain.spriteGroups);
|
||||
|
||||
if (r10->available == 1)
|
||||
{
|
||||
r10->baseX = 0x78;
|
||||
r10->baseY = 0x66;
|
||||
r12 = (const struct UnknownStruct1 *)gUnknown_0202BE00[6];
|
||||
r12 = (const struct UnknownStruct1 *)gTitleSavedMenuSpriteSets[6];
|
||||
for (sp0 = 0; sp0 < r12->count; sp0++)
|
||||
{
|
||||
struct OamDataSimple *r4 = &r10->oam[sp0];
|
||||
|
|
@ -828,8 +828,8 @@ void sub_11968(void)
|
|||
{
|
||||
struct OamDataSimple *r5;
|
||||
|
||||
r9->baseX = gUnknown_086A96AC[gTitlescreen.menuCursorIndex].x;
|
||||
r9->baseY = gUnknown_086A96AC[gTitlescreen.menuCursorIndex].y;
|
||||
r9->baseX = gTitleSavedArrowPositions[gTitlescreen.menuCursorIndex].x;
|
||||
r9->baseY = gTitleSavedArrowPositions[gTitlescreen.menuCursorIndex].y;
|
||||
|
||||
r5 = &r9->oam[0];
|
||||
|
||||
|
|
@ -841,8 +841,8 @@ void sub_11968(void)
|
|||
{
|
||||
struct OamDataSimple *r5;
|
||||
|
||||
r8->baseX = gUnknown_086A96C0[gTitlescreen.menuCursorIndex].x;
|
||||
r8->baseY = gUnknown_086A96C0[gTitlescreen.menuCursorIndex].y;
|
||||
r8->baseX = gTitleSavedSelectorPositions[gTitlescreen.menuCursorIndex].x;
|
||||
r8->baseY = gTitleSavedSelectorPositions[gTitlescreen.menuCursorIndex].y;
|
||||
|
||||
r5 = &r8->oam[0];
|
||||
|
||||
|
|
@ -855,7 +855,7 @@ void sub_11968(void)
|
|||
r8->available = FALSE;
|
||||
}
|
||||
|
||||
void sub_11B74(void)
|
||||
void DeleteSaveFile(void)
|
||||
{
|
||||
ResetSaveFile();
|
||||
SaveFile_WriteToSram();
|
||||
|
|
|
|||
50
src/util.c
50
src/util.c
|
|
@ -1,8 +1,8 @@
|
|||
#include "global.h"
|
||||
#include "main.h"
|
||||
|
||||
static u8 *sub_0734(u32, u8*, u32);
|
||||
static int sub_0780(int, int);
|
||||
static u8 *WriteDigitsRecursive(u32, u8*, u32);
|
||||
static int IntPow(int, int);
|
||||
|
||||
void SetMainGameState(u16 mainState)
|
||||
{
|
||||
|
|
@ -10,7 +10,7 @@ void SetMainGameState(u16 mainState)
|
|||
gMain.subState = 0;
|
||||
}
|
||||
|
||||
void sub_024C(void)
|
||||
void FadeInScreen(void)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ void sub_024C(void)
|
|||
REG_BLDCNT = 0;
|
||||
}
|
||||
|
||||
void sub_02B4(void)
|
||||
void FadeOutScreen(void)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
|
|
@ -92,27 +92,27 @@ s16 LoadSpriteSets(const struct SpriteSet *const *spriteSets, u16 numSpriteSets,
|
|||
return loadedCount;
|
||||
}
|
||||
|
||||
void ResetSomeGraphicsRelatedStuff(void)
|
||||
void ResetDisplayState(void)
|
||||
{
|
||||
gMain.dispcntBackup |= DISPCNT_FORCED_BLANK;
|
||||
REG_DISPCNT |= DISPCNT_FORCED_BLANK;
|
||||
ClearGraphicsMemory();
|
||||
sub_0518();
|
||||
ClearBgTilemapAndOffsets();
|
||||
ClearSprites();
|
||||
gMain.modeChangeFlags = MODE_CHANGE_NONE;
|
||||
gMain.unk10 = 0;
|
||||
gMain.debugMenuCursorIndex = 0;
|
||||
gMain.fieldFrameCount = 0;
|
||||
gMain.unk11 = 0;
|
||||
gMain.unk12 = 0;
|
||||
gMain.unk14 = 0;
|
||||
gMain.pendingModeChangeType = 0;
|
||||
gMain.animationTimer = 0;
|
||||
gMain.modeChangeDelayTimer = 0;
|
||||
gMain.vCount = 144;
|
||||
gMain.unk28 = 0;
|
||||
gMain.unk2A = 0;
|
||||
gMain.unk36 = 0;
|
||||
gMain.shopPanelActive = 0;
|
||||
gMain.shopPanelSlideOffset = 0;
|
||||
gMain.blendEnabled = 0;
|
||||
gMain.blendControl = 0;
|
||||
gMain.blendAlpha = 0;
|
||||
gMain.blendBrightness = 0;
|
||||
gMain.unk2C = 0;
|
||||
gMain.scoreOverlayActive = 0;
|
||||
}
|
||||
|
||||
void ClearGraphicsMemory(void)
|
||||
|
|
@ -134,11 +134,11 @@ void ClearGraphicsMemory(void)
|
|||
REG_BLDALPHA = 0;
|
||||
}
|
||||
|
||||
void sub_0518(void)
|
||||
void ClearBgTilemapAndOffsets(void)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
DmaFill16(3, 0, gUnknown_03005C00, 0xC00);
|
||||
DmaFill16(3, 0, gBG0TilemapBuffer, 0xC00);
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gMain.bgOffsets[i].xOffset = 0;
|
||||
|
|
@ -183,11 +183,11 @@ void ClearSprites(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_0678(u8 *arg0, s16 arg1, s16 arg2)
|
||||
void DrawTextToTilemap(u8 *arg0, s16 arg1, s16 arg2)
|
||||
{
|
||||
// Rumble Pak related?
|
||||
s16 var0 = strlen(arg0) - 1;
|
||||
u16 *dest = &gUnknown_03005C00[arg1 * 32 + arg2];
|
||||
u16 *dest = &gBG0TilemapBuffer[arg1 * 32 + arg2];
|
||||
do
|
||||
{
|
||||
*dest = (*arg0) - 32;
|
||||
|
|
@ -196,7 +196,7 @@ void sub_0678(u8 *arg0, s16 arg1, s16 arg2)
|
|||
} while (var0-- > 0);
|
||||
}
|
||||
|
||||
u8 *sub_06CC(int arg0, u8 *arg1, int arg2, s16 arg3)
|
||||
u8 *FormatIntToString(int arg0, u8 *arg1, int arg2, s16 arg3)
|
||||
{
|
||||
if (arg0 < 0)
|
||||
{
|
||||
|
|
@ -211,7 +211,7 @@ u8 *sub_06CC(int arg0, u8 *arg1, int arg2, s16 arg3)
|
|||
break;
|
||||
|
||||
arg2--;
|
||||
if (arg0 < sub_0780(10, arg2))
|
||||
if (arg0 < IntPow(10, arg2))
|
||||
{
|
||||
*arg1 = 0x30;
|
||||
arg1++;
|
||||
|
|
@ -224,23 +224,23 @@ u8 *sub_06CC(int arg0, u8 *arg1, int arg2, s16 arg3)
|
|||
|
||||
if (arg3)
|
||||
{
|
||||
sub_0734(arg0, arg1, 10);
|
||||
WriteDigitsRecursive(arg0, arg1, 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 *ptr = sub_0734(arg0, arg1, 10);
|
||||
u8 *ptr = WriteDigitsRecursive(arg0, arg1, 10);
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
return arg1;
|
||||
}
|
||||
|
||||
static u8 *sub_0734(u32 arg0, u8 *arg1, u32 arg2)
|
||||
static u8 *WriteDigitsRecursive(u32 arg0, u8 *arg1, u32 arg2)
|
||||
{
|
||||
u8 mod = arg0 % arg2;
|
||||
int div = arg0 / arg2;
|
||||
if (div != 0)
|
||||
arg1 = sub_0734(div, arg1, arg2);
|
||||
arg1 = WriteDigitsRecursive(div, arg1, arg2);
|
||||
|
||||
if (mod < 10)
|
||||
*arg1 = mod + 48;
|
||||
|
|
@ -250,7 +250,7 @@ static u8 *sub_0734(u32 arg0, u8 *arg1, u32 arg2)
|
|||
return arg1 + 1;
|
||||
}
|
||||
|
||||
static int sub_0780(int arg0, int arg1)
|
||||
static int IntPow(int arg0, int arg1)
|
||||
{
|
||||
int var0;
|
||||
int var1 = arg1;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
gUnknown_03000000: @ 0x03000000
|
||||
gTempGfxBuffer: @ 0x03000000
|
||||
.space 0x1800
|
||||
gUnknown_03001800: @ 0x03001800
|
||||
gEReaderTextTileBuffer: @ 0x03001800
|
||||
.space 0xB00
|
||||
gUnknown_03002300: @ 0x03002300
|
||||
gTextTilemapBuffer: @ 0x03002300
|
||||
.space 0x2D00
|
||||
gOamBuffer: @ 0x3005000
|
||||
.space 0x400
|
||||
IntrMain_Buffer: @ 0x3005400
|
||||
.space 0x800
|
||||
gUnknown_03005C00: @ 0x03005C00
|
||||
gBG0TilemapBuffer: @ 0x03005C00
|
||||
.space 0x2C0
|
||||
gUnknown_03005EC0: @ 0x03005EC0
|
||||
.space 0x380
|
||||
|
|
|
|||
338
sym_ewram.txt
338
sym_ewram.txt
|
|
@ -1,4 +1,4 @@
|
|||
gUnknown_02000000: @ 0x02000000
|
||||
gPinballGameState: @ 0x02000000
|
||||
.space 0x2000
|
||||
sGbPlayerCurKeys: @ 0x2002000
|
||||
.space 0x2
|
||||
|
|
@ -6,13 +6,13 @@ sGbPlayerPrevKeys: @ 0x2002002
|
|||
.space 0x6
|
||||
gGbPlayerTilemapBuffer: @ 0x2002008
|
||||
.space 0x800
|
||||
gUnknown_02002808: @ 0x2002808
|
||||
gSio32Id: @ 0x2002808
|
||||
.space 0xC
|
||||
gUnknown_02002814: @ 0x02002814
|
||||
gSio32SendData: @ 0x02002814
|
||||
.space 0x4
|
||||
gUnknown_02002818: @ 0x02002818
|
||||
gSio32ReceivedData: @ 0x02002818
|
||||
.space 0x4
|
||||
gUnknown_0200281C: @ 0x0200281C
|
||||
gSio32RemoteDeviceId: @ 0x0200281C
|
||||
.space 0x4
|
||||
sChecksumAvailable: @ 0x02002820
|
||||
.space 0x2
|
||||
|
|
@ -22,17 +22,17 @@ sNumVBlanksWithoutSerialIntr: @ 0x02002824
|
|||
.space 0x1
|
||||
sSendBufferEmpty: @ 0x02002825
|
||||
.space 0x1
|
||||
gUnknown_02002826: @ 0x02002826
|
||||
sLinkFlowControlDelay: @ 0x02002826
|
||||
.space 0x1
|
||||
gUnknown_02002827: @ 0x02002827
|
||||
sHandshakePlayerCount: @ 0x02002827
|
||||
.space 0x1
|
||||
sSendNonzeroCheck: @ 0x02002828
|
||||
.space 0x2
|
||||
gUnknown_0200282A: @ 0x0200282A
|
||||
sRecvNonzeroCheck: @ 0x0200282A
|
||||
.space 0x2
|
||||
gUnknown_0200282C: @ 0x0200282C
|
||||
gEReaderUnused1: @ 0x0200282C
|
||||
.space 0x1
|
||||
gUnknown_0200282D: @ 0x0200282D
|
||||
gEReaderUnused2: @ 0x0200282D
|
||||
.space 0x3
|
||||
gPokedex_EraseSaveDataAccessCounter: @ 0x02002830
|
||||
.space 0x1
|
||||
|
|
@ -40,19 +40,19 @@ gPokedex_EraseSaveDataAccessStep: @ 0x02002831
|
|||
.space 0x7
|
||||
gFieldSelectData: @ 0x02002838
|
||||
.space 0x18
|
||||
gUnknown_02002850: @ 0x02002850
|
||||
gFieldSelectSoftReset: @ 0x02002850
|
||||
.space 0x8
|
||||
gUnknown_02002858: @ 0x02002858
|
||||
gHighScoreScreenState: @ 0x02002858
|
||||
.space 0x25
|
||||
gUnknown_0200287D: @ 0x0200287D
|
||||
gHighScoreDisplayMode: @ 0x0200287D
|
||||
.space 0x3
|
||||
gUnknown_02002880: @ 0x02002880
|
||||
gScrollDirection: @ 0x02002880
|
||||
.space 0x2
|
||||
gUnknown_02002882: @ 0x02002882
|
||||
gScrollXOffset: @ 0x02002882
|
||||
.space 0x2
|
||||
gUnknown_02002884: @ 0x02002884
|
||||
gResetComboTimer: @ 0x02002884
|
||||
.space 0x1
|
||||
gUnknown_02002885: @ 0x02002885
|
||||
gResetComboCount: @ 0x02002885
|
||||
.space 0x3
|
||||
gTitlescreen: @ 0x2002888
|
||||
.space 0x18
|
||||
|
|
@ -64,23 +64,23 @@ gEReaderAccessStep: @ 0x20028A2
|
|||
.space 0x1
|
||||
gEReaderAccessCounter: @ 0x20028A3
|
||||
.space 0x1
|
||||
gUnknown_020028A4: @ 0x20028A4
|
||||
gTitleTransitionActive: @ 0x20028A4
|
||||
.space 0x1
|
||||
gUnknown_020028A5: @ 0x20028A5
|
||||
gTitleRestartDebounce: @ 0x20028A5
|
||||
.space 0x3
|
||||
gUnknown_020028A8: @ 0x020028A8
|
||||
gPaletteFadeRGBCache: @ 0x020028A8
|
||||
.space 0x30
|
||||
CurrentBoardProcPairs_020028D8: @ 0x020028D8
|
||||
.space 0x48
|
||||
gOptionsData: @ 0x02002920
|
||||
.space 0x12
|
||||
gUnknown_02002932: @ 0x02002932
|
||||
gOptionsBGMDigitTileIds: @ 0x02002932
|
||||
.space 0x3
|
||||
gUnknown_02002935: @ 0x02002935
|
||||
gOptionsSEDigitTileIds: @ 0x02002935
|
||||
.space 0x5
|
||||
gUnknown_0200293A: @ 0x0200293A
|
||||
gOptionsButtonConfigEditFlags: @ 0x0200293A
|
||||
.space 0x1E
|
||||
gUnknown_02002958: @ 0x2002958
|
||||
gDpcmSampleBuffer: @ 0x2002958
|
||||
.space 0x40
|
||||
gMPlayTrack_BGM: @ 0x2002998
|
||||
.space 0x320
|
||||
|
|
@ -96,7 +96,7 @@ readSramFast_Work: @ 0x02002FD8
|
|||
.space 0x88
|
||||
gIntrTable: @ 0x2003060
|
||||
.space 0x40
|
||||
gUnknown_020030A0: @ 0x020030A0
|
||||
gBoardBGTileBufferAlt: @ 0x020030A0
|
||||
.space 0x8020
|
||||
gMain: @ 0x200B0C0
|
||||
.space 0x40
|
||||
|
|
@ -241,297 +241,297 @@ gVBlankIntrFuncPtr: @ 0x200FB98
|
|||
.space 0x4
|
||||
gMainCallback: @ 0x200FB9C
|
||||
.space 0x4
|
||||
gUnknown_0200FBA0: @ 0x200FBA0
|
||||
gVCountIntrFuncShadow: @ 0x200FBA0
|
||||
.space 0x10
|
||||
gUnknown_0200FBB0: @ 0x0200FBB0
|
||||
gBoardGfxBuffer: @ 0x0200FBB0
|
||||
.space 0x8020
|
||||
gUnknown_02017BD0: @ 0x2017BD0
|
||||
gVBlankIntrFuncShadow: @ 0x2017BD0
|
||||
.space 0x4
|
||||
gUnknown_02017BD4: @ 0x2017BD4
|
||||
gMainCallbackShadow: @ 0x2017BD4
|
||||
.space 0xC
|
||||
gUnknown_02017BE0: @ 0x2017BE0
|
||||
.space 0x2000
|
||||
gVCountIntrFuncPtr: @ 0x2019BE0
|
||||
.space 0x4
|
||||
gUnknown_02019BE4: @ 0x2019BE4
|
||||
gRumbleLoopCounter: @ 0x2019BE4
|
||||
.space 0x4
|
||||
gUnknown_02019BE8: @ 0x2019BE8
|
||||
gRumbleFrameCounter: @ 0x2019BE8
|
||||
.space 0x4
|
||||
gUnknown_02019BEC: @ 0x02019BEC
|
||||
gRumbleMotorMode: @ 0x02019BEC
|
||||
.space 0x4
|
||||
gUnknown_02019BF0: @ 0x02019BF0
|
||||
gSio32ReconnectTimer: @ 0x02019BF0
|
||||
.space 0x4
|
||||
gUnknown_02019BF4: @ 0x02019BF4
|
||||
gSio32SerialEnabled: @ 0x02019BF4
|
||||
.space 0x4
|
||||
gUnknown_02019BF8: @ 0x2019BF8
|
||||
gRumblePatternIndex: @ 0x2019BF8
|
||||
.space 0x4
|
||||
gUnknown_02019BFC: @ 0x2019BFC
|
||||
gRumblePatternPosition: @ 0x2019BFC
|
||||
.space 0x4
|
||||
gUnknown_02019C00: @ 0x02019C00
|
||||
gRumbleCommand: @ 0x02019C00
|
||||
.space 0x4
|
||||
gUnknown_02019C04: @ 0x2019C04
|
||||
gRumblePaused: @ 0x2019C04
|
||||
.space 0x4
|
||||
gUnknown_02019C08: @ 0x2019C08
|
||||
gRumbleSpeedMode: @ 0x2019C08
|
||||
.space 0x4
|
||||
gGameBoyPlayerEnabled: @ 0x2019C0C
|
||||
.space 0x4
|
||||
gUnknown_02019C10: @ 0x02019C10
|
||||
gSio32CommState: @ 0x02019C10
|
||||
.space 0x10
|
||||
gUnknown_02019C20: @ 0x02019C20
|
||||
gEReaderLinkDataReceived: @ 0x02019C20
|
||||
.space 0x4
|
||||
gUnknown_02019C24: @ 0x02019C24
|
||||
gPokedexScrollActive: @ 0x02019C24
|
||||
.space 0x4
|
||||
gUnknown_02019C28: @ 0x02019C28
|
||||
gPokedexSpriteIndexBase: @ 0x02019C28
|
||||
.space 0x4
|
||||
gLastSendQueueCount: @ 0x02019C2C
|
||||
.space 0x4
|
||||
gUnknown_02019C30: @ 0x02019C30
|
||||
gIntroScaleX: @ 0x02019C30
|
||||
.space 0x10
|
||||
gUnknown_02019C40: @ 0x02019C40
|
||||
gPokedexVramBuffer: @ 0x02019C40
|
||||
.space 0x800
|
||||
gUnknown_0201A440: @ 0x0201A440
|
||||
gPokedexSpriteAnimTimer: @ 0x0201A440
|
||||
.space 0x4
|
||||
gUnknown_0201A444: @ 0x0201A444
|
||||
gLinkTimeoutCounter: @ 0x0201A444
|
||||
.space 0x4
|
||||
gUnknown_0201A448: @ 0x0201A448
|
||||
gPokedexAnimatedIconFrame: @ 0x0201A448
|
||||
.space 0x4
|
||||
gUnknown_0201A44C: @ 0x0201A44C
|
||||
gEReaderGeneralTimer: @ 0x0201A44C
|
||||
.space 0x4
|
||||
gUnknown_0201A450: @ 0x0201A450
|
||||
gIntroSpriteEntities: @ 0x0201A450
|
||||
.space 0x60
|
||||
gUnknown_0201A4B0: @ 0x0201A4B0
|
||||
gBallSpeedSubmenuVisible: @ 0x0201A4B0
|
||||
.space 0x4
|
||||
gAutoDisplayTitlescreenMenu: @ 0x201A4B4
|
||||
.space 0x4
|
||||
gUnknown_0201A4B8: @ 0x0201A4B8
|
||||
gCompletionBannerY: @ 0x0201A4B8
|
||||
.space 0x4
|
||||
gUnknown_0201A4BC: @ 0x0201A4BC
|
||||
gLinkExchangeSendPhase: @ 0x0201A4BC
|
||||
.space 0x4
|
||||
gUnknown_0201A4C0: @ 0x0201A4C0
|
||||
gSelectedBallSpeed: @ 0x0201A4C0
|
||||
.space 0x10
|
||||
gUnknown_0201A4D0: @ 0x0201A4D0
|
||||
gLinkRecvBuffer: @ 0x0201A4D0
|
||||
.space 0x20
|
||||
gUnknown_0201A4F0: @ 0x0201A4F0
|
||||
gPokedexCursorBlinkOffset: @ 0x0201A4F0
|
||||
.space 0x4
|
||||
gUnknown_0201A4F4: @ 0x0201A4F4
|
||||
gBallSpeedDisplayToggle: @ 0x0201A4F4
|
||||
.space 0x4
|
||||
gSelectedBonusField: @ 0x0201A4F8
|
||||
.space 0x8
|
||||
gHighScoreNameEntry: @ 0x0201A500
|
||||
.space 0x10
|
||||
gUnknown_0201A510: @ 0x0201A510
|
||||
gLinkExchangeFrameCounter: @ 0x0201A510
|
||||
.space 0x4
|
||||
gPokedexNumOwned: @ 0x0201A514
|
||||
.space 0x4
|
||||
gUnknown_0201A518: @ 0x0201A518
|
||||
.space 0x8
|
||||
gUnknown_0201A520: @ 0x0201A520
|
||||
gPaletteFadeBuffers: @ 0x0201A520
|
||||
.space 0xC00
|
||||
gUnknown_0201B120: @ 0x0201B120
|
||||
gPokedexLinkStateTimer: @ 0x0201B120
|
||||
.space 0x4
|
||||
gUnknown_0201B124: @ 0x0201B124
|
||||
gLinkExchangeStep: @ 0x0201B124
|
||||
.space 0x4
|
||||
gUnknown_0201B128: @ 0x0201B128
|
||||
gPokedexLinkTransferPhase: @ 0x0201B128
|
||||
.space 0x8
|
||||
gUnknown_0201B130: @ 0x0201B130
|
||||
gGlyphLowerRowBuffer: @ 0x0201B130
|
||||
.space 0x40
|
||||
gUnknown_0201B170: @ 0x0201B170
|
||||
gMergedSapphireScoreIndex: @ 0x0201B170
|
||||
.space 0x4
|
||||
gUnknown_0201B174: @ 0x0201B174
|
||||
gEReaderTransitionStep: @ 0x0201B174
|
||||
.space 0x4
|
||||
gUnknown_0201B178: @ 0x0201B178
|
||||
gShowDialogFlag: @ 0x0201B178
|
||||
.space 0x8
|
||||
gUnknown_0201B180: @ 0x0201B180
|
||||
gIntroScene3_AltBG1TilemapBuffer: @ 0x0201B180
|
||||
.space 0x1000
|
||||
gUnknown_0201C180: @ 0x0201C180
|
||||
gPokedexLinkSendCounter: @ 0x0201C180
|
||||
.space 0x4
|
||||
gEReaderCardIndex: @ 0x0201C184
|
||||
.space 0x4
|
||||
gUnknown_0201C188: @ 0x0201C188
|
||||
gIntroScaleY: @ 0x0201C188
|
||||
.space 0x4
|
||||
gUnknown_0201C18C: @ 0x0201C18C
|
||||
gCompletionBannerVisible: @ 0x0201C18C
|
||||
.space 0x4
|
||||
gUnknown_0201C190: @ 0x0201C190
|
||||
gTitleNoSaveMenuSpriteSets: @ 0x0201C190
|
||||
.space 0x1C
|
||||
gUnknown_0201C1AC: @ 0x0201C1AC
|
||||
gLinkPlayerCount: @ 0x0201C1AC
|
||||
.space 0x4
|
||||
gUnknown_0201C1B0: @ 0x0201C1B0
|
||||
gLinkExchangeCommand: @ 0x0201C1B0
|
||||
.space 0x4
|
||||
gUnknown_0201C1B4: @ 0x0201C1B4
|
||||
gPokedexShowPageIndicator: @ 0x0201C1B4
|
||||
.space 0x4
|
||||
gUnknown_0201C1B8: @ 0x0201C1B8
|
||||
gIntroBlendSrc: @ 0x0201C1B8
|
||||
.space 0x4
|
||||
gUnknown_0201C1BC: @ 0x0201C1BC
|
||||
gPokedexMasterHandshakeState: @ 0x0201C1BC
|
||||
.space 0x4
|
||||
gUnknown_0201C1C0: @ 0x0201C1C0
|
||||
gIntroTileBuffer: @ 0x0201C1C0
|
||||
.space 0xE000
|
||||
gPokedexFlags: @ 0x0202A1C0
|
||||
.space 0x1D0
|
||||
gPokedexFlagExchangeBuffer: @ 0x0202A390
|
||||
.space 0x1C4
|
||||
gUnknown_0202A554: @ 0x0202A554
|
||||
sRecvQueueSnapshot: @ 0x0202A554
|
||||
.space 0x4
|
||||
gUnknown_0202A558: @ 0x0202A558
|
||||
gPokedexInfoWindowSlideStep: @ 0x0202A558
|
||||
.space 0x4
|
||||
gUnknown_0202A55C: @ 0x0202A55C
|
||||
gPokedexShowPortrait: @ 0x0202A55C
|
||||
.space 0x4
|
||||
gBonusFieldSelectTimer: @ 0x0202A560
|
||||
.space 0x4
|
||||
gUnknown_0202A564: @ 0x0202A564
|
||||
gEReaderLinkHandshakeStarted: @ 0x0202A564
|
||||
.space 0x4
|
||||
gUnknown_0202A568: @ 0x0202A568
|
||||
gPokedexShowCatchHatch: @ 0x0202A568
|
||||
.space 0x4
|
||||
gUnknown_0202A56C: @ 0x0202A56C
|
||||
gIntroBGWhiteFlash: @ 0x0202A56C
|
||||
.space 0x8
|
||||
gPokedexListEntryCount: @ 0x0202A574
|
||||
.space 0x4
|
||||
gUnknown_0202A578: @ 0x0202A578
|
||||
gIntroAnimStep: @ 0x0202A578
|
||||
.space 0x4
|
||||
gUnknown_0202A57C: @ 0x0202A57C
|
||||
gPokedexCursorOffset: @ 0x0202A57C
|
||||
.space 0x4
|
||||
gUnknown_0202A580: @ 0x0202A580
|
||||
gEReaderTextAnimDelay: @ 0x0202A580
|
||||
.space 0x8
|
||||
gUnknown_0202A588: @ 0x0202A588
|
||||
gPokedexShowAnimSprite: @ 0x0202A588
|
||||
.space 0x4
|
||||
gUnknown_0202A58C: @ 0x0202A58C
|
||||
gEReaderStatusSpriteIndex: @ 0x0202A58C
|
||||
.space 0x4
|
||||
gUnknown_0202A590: @ 0x0202A590
|
||||
gPokedexInfoWindowBackupTiles: @ 0x0202A590
|
||||
.space 0x800
|
||||
gUnknown_0202AD90: @ 0x0202AD90
|
||||
gEReaderTextPageIndex: @ 0x0202AD90
|
||||
.space 0x10
|
||||
gUnknown_0202ADA0: @ 0x0202ADA0
|
||||
gIntroBGParams: @ 0x0202ADA0
|
||||
.space 0x30
|
||||
gUnknown_0202ADD0: @ 0x0202ADD0
|
||||
gLinkStatusResult: @ 0x0202ADD0
|
||||
.space 0x4
|
||||
gUnknown_0202ADD4: @ 0x0202ADD4
|
||||
gIntroBlendDst: @ 0x0202ADD4
|
||||
.space 0x4
|
||||
gUnknown_0202ADD8: @ 0x0202ADD8
|
||||
gIntroWailmerScaleY: @ 0x0202ADD8
|
||||
.space 0x4
|
||||
gUnknown_0202ADDC: @ 0x0202ADDC
|
||||
gLinkNegotiationFlags: @ 0x0202ADDC
|
||||
.space 0x4
|
||||
gPokedexSelectedMon: @ 0x0202ADE0
|
||||
.space 0x4
|
||||
gUnknown_0202ADE4: @ 0x0202ADE4
|
||||
gLinkExchangeResult: @ 0x0202ADE4
|
||||
.space 0x4
|
||||
gUnknown_0202ADE8: @ 0x0202ADE8
|
||||
gEReaderLinkAckSent: @ 0x0202ADE8
|
||||
.space 0x1008
|
||||
gUnknown_0202BDF0: @ 0x0202BDF0
|
||||
gLinkConnectionState: @ 0x0202BDF0
|
||||
.space 0x10
|
||||
gUnknown_0202BE00: @ 0x0202BE00
|
||||
gTitleSavedMenuSpriteSets: @ 0x0202BE00
|
||||
.space 0x1C
|
||||
gUnknown_0202BE1C: @ 0x0202BE1C
|
||||
gBonusFieldLoadingCounter: @ 0x0202BE1C
|
||||
.space 0x4
|
||||
gUnknown_0202BE20: @ 0x0202BE20
|
||||
gPokedexBlinkTimer: @ 0x0202BE20
|
||||
.space 0x4
|
||||
gUnknown_202BE24: @ 0x202BE24
|
||||
gTitleReturnedFromMenu: @ 0x202BE24
|
||||
.space 0xC
|
||||
gUnknown_0202BE30: @ 0x0202BE30
|
||||
gGlyphUpperRowBuffer: @ 0x0202BE30
|
||||
.space 0x40
|
||||
gUnknown_0202BE70: @ 0x0202BE70
|
||||
gIntroPalSwapBuffer: @ 0x0202BE70
|
||||
.space 0x40
|
||||
gUnknown_0202BEB0: @ 0x0202BEB0
|
||||
gCompletionBannerDone: @ 0x0202BEB0
|
||||
.space 0x4
|
||||
gUnknown_0202BEB4: @ 0x0202BEB4
|
||||
gIntroScene6EntitySpawnIndex: @ 0x0202BEB4
|
||||
.space 0x4
|
||||
gPokedexNumSeen: @ 0x0202BEB8
|
||||
.space 0x4
|
||||
gUnknown_0202BEBC: @ 0x0202BEBC
|
||||
gDialogType: @ 0x0202BEBC
|
||||
.space 0x4
|
||||
gUnknown_0202BEC0: @ 0x0202BEC0
|
||||
gEReaderHeaderSpriteIndex: @ 0x0202BEC0
|
||||
.space 0x4
|
||||
gUnknown_0202BEC4: @ 0x0202BEC4
|
||||
gPokedexShowPopupWindow: @ 0x0202BEC4
|
||||
.space 0x4
|
||||
gUnknown_0202BEC8: @ 0x0202BEC8
|
||||
gLinkAdvanceState: @ 0x0202BEC8
|
||||
.space 0x4
|
||||
gUnknown_0202BECC: @ 0x0202BECC
|
||||
gPokedexHandshakeRetryCount: @ 0x0202BECC
|
||||
.space 0x4
|
||||
gBonusFieldSelectState: @ 0x0202BED0
|
||||
.space 0x4
|
||||
gUnknown_0202BED4: @ 0x0202BED4
|
||||
gCompletionBannerPhase: @ 0x0202BED4
|
||||
.space 0x4
|
||||
gUnknown_0202BED8: @ 0x0202BED8
|
||||
gMergedRubyScoreIndex: @ 0x0202BED8
|
||||
.space 0x4
|
||||
gUnknown_0202BEDC: @ 0x0202BEDC
|
||||
gIntroObjWhiteFlash: @ 0x0202BEDC
|
||||
.space 0x4
|
||||
gUnknown_0202BEE0: @ 0x0202BEE0
|
||||
gPokedexButtonPromptFrame: @ 0x0202BEE0
|
||||
.space 0x4
|
||||
gBonusFieldSelectNextMainState: @ 0x0202BEE4
|
||||
.space 0x4
|
||||
gUnknown_0202BEE8: @ 0x0202BEE8
|
||||
gBonusFieldHighlightPalette: @ 0x0202BEE8
|
||||
.space 0x4
|
||||
gUnknown_0202BEEC: @ 0x0202BEEC
|
||||
gEReaderReceivedCardId: @ 0x0202BEEC
|
||||
.space 0x4
|
||||
gUnknown_0202BEF0: @ 0x0202BEF0
|
||||
gIntroPalFadeLevel: @ 0x0202BEF0
|
||||
.space 0x4
|
||||
gUnknown_0202BEF4: @ 0x0202BEF4
|
||||
gPokedexPageIndicatorTimer: @ 0x0202BEF4
|
||||
.space 0x4
|
||||
gUnknown_0202BEF8: @ 0x0202BEF8
|
||||
gEReaderExitTargetState: @ 0x0202BEF8
|
||||
.space 0x4
|
||||
Pokedex_PopupTypeIx: @ 0x0202BEFC
|
||||
gPokedexPopupTypeIndex: @ 0x0202BEFC
|
||||
.space 0x4
|
||||
gUnknown_0202BF00: @ 0x0202BF00
|
||||
gPokedexAnimatedIconTimer: @ 0x0202BF00
|
||||
.space 0x4
|
||||
gUnknown_0202BF04: @ 0x0202BF04
|
||||
gPokedexShowButtonPrompt: @ 0x0202BF04
|
||||
.space 0x4
|
||||
gUnknown_0202BF08: @ 0x0202BF08
|
||||
gPokedexScrollbarY: @ 0x0202BF08
|
||||
.space 0x4
|
||||
gUnknown_0202BF0C: @ 0x0202BF0C
|
||||
gPokedexSpriteAnimFrame: @ 0x0202BF0C
|
||||
.space 0x4
|
||||
gUnknown_0202BF10: @ 0x0202BF10
|
||||
gIntroFrameCounter: @ 0x0202BF10
|
||||
.space 0x4
|
||||
gUnknown_0202BF14: @ 0x0202BF14
|
||||
gPokedexSpriteCategory: @ 0x0202BF14
|
||||
.space 0xC
|
||||
gLink: @ 0x0202BF20
|
||||
.space 0x624
|
||||
gUnknown_0202C544: @ 0x0202C544
|
||||
gPokedexClientHandshakeState: @ 0x0202C544
|
||||
.space 0x4
|
||||
gUnknown_0202C548: @ 0x0202C548
|
||||
gIntroScene6VelocityIndex: @ 0x0202C548
|
||||
.space 0x4
|
||||
gUnknown_0202C54C: @ 0x0202C54C
|
||||
gLinkExchangeTimeout: @ 0x0202C54C
|
||||
.space 0x4
|
||||
gUnknown_0202C550: @ 0x0202C550
|
||||
gRemoteTopScores: @ 0x0202C550
|
||||
.space 0x30
|
||||
gUnknown_0202C580: @ 0x0202C580
|
||||
gCompletionBannerFrame: @ 0x0202C580
|
||||
.space 0x4
|
||||
gUnknown_0202C584: @ 0x0202C584
|
||||
gEReaderStatusSpriteVisible: @ 0x0202C584
|
||||
.space 0x4
|
||||
gUnknown_0202C588: @ 0x202C588
|
||||
gHighScoreEntrySource: @ 0x202C588
|
||||
.space 0x4
|
||||
gPokedexScrollWaitFrames: @ 0x0202C58C
|
||||
.space 0x4
|
||||
gUnknown_0202C590: @ 0x0202C590
|
||||
gPokedexShowLinkCableIcon: @ 0x0202C590
|
||||
.space 0x4
|
||||
gUnknown_0202C594: @ 0x0202C594
|
||||
gIntroOverlayFadeStep: @ 0x0202C594
|
||||
.space 0x4
|
||||
gUnknown_0202C598: @ 0x0202C598
|
||||
gLinkExchangeRecvPhase: @ 0x0202C598
|
||||
.space 0x4
|
||||
gUnknown_0202C59C: @ 0x0202C59C
|
||||
gLinkPacketCounter: @ 0x0202C59C
|
||||
.space 0x4
|
||||
gUnknown_0202C5A0: @ 0x0202C5A0
|
||||
gEReaderTransitionTimer: @ 0x0202C5A0
|
||||
.space 0x4
|
||||
gUnknown_0202C5A4: @ 0x0202C5A4
|
||||
gEReaderTextBlinkToggle: @ 0x0202C5A4
|
||||
.space 0x4
|
||||
gUnknown_0202C5A8: @ 0x0202C5A8
|
||||
gIntroJingleVariant: @ 0x0202C5A8
|
||||
.space 0x4
|
||||
gUnknown_0202C5AC: @ 0x0202C5AC
|
||||
gPokedexPageIndicatorBlink: @ 0x0202C5AC
|
||||
.space 0x4
|
||||
gPokedexListPosition: @ 0x0202C5B0
|
||||
.space 0x4
|
||||
gUnknown_0202C5B4: @ 0x0202C5B4
|
||||
gPokedexLinkChunkIndex: @ 0x0202C5B4
|
||||
.space 0xC
|
||||
gUnknown_0202C5C0: @ 0x0202C5C0
|
||||
gScoreDigitBuffer: @ 0x0202C5C0
|
||||
.space 0x20
|
||||
gUnknown_0202C5E0: @ 0x0202C5E0
|
||||
sLinkMasterHandshakeState: @ 0x0202C5E0
|
||||
.space 0x4
|
||||
gUnknown_0202C5E4: @ 0x0202C5E4
|
||||
gIntroWailmerScaleX: @ 0x0202C5E4
|
||||
.space 0x4
|
||||
gUnknown_0202C5E8: @ 0x0202C5E8
|
||||
gPokedexDetailFrameCount: @ 0x0202C5E8
|
||||
.space 0x8
|
||||
gUnknown_0202C5F0: @ 0x0202C5F0
|
||||
gLinkSendBuffer: @ 0x0202C5F0
|
||||
.space 0x14
|
||||
gUnknown_0202C604: @ 0x0202C604
|
||||
gEReaderTextCharIndex: @ 0x0202C604
|
||||
.space 0xC
|
||||
gUnknown_0202C610: @ 0x0202C610
|
||||
gWorkingHighScores: @ 0x0202C610
|
||||
.space 0x14
|
||||
gUnknown_0202C624: @ 0x0202C624
|
||||
.space 0xAC
|
||||
|
|
@ -541,43 +541,43 @@ gUnknown_0202C6E4: @ 0x0202C6E4
|
|||
.space 0xAC
|
||||
gIntroSceneIndex: @ 0x0202C790
|
||||
.space 0x4
|
||||
gUnknown_0202C794: @ 0x0202C794
|
||||
gPokedexDescriptionPage: @ 0x0202C794
|
||||
.space 0xC
|
||||
gUnknown_0202C7A0: @ 0x0202C7A0
|
||||
gCatchSpriteFrameBuffer: @ 0x0202C7A0
|
||||
.space 0xFC0
|
||||
gUnknown_0202D760: @ 0x0202D760
|
||||
gCatchAnimTileBuffer: @ 0x0202D760
|
||||
.space 0x120
|
||||
gUnknown_0202D880: @ 0x0202D880
|
||||
gKecleonSpriteSets: @ 0x0202D880
|
||||
.space 0x2E40
|
||||
gUnknown_020306C0: @ 0x020306C0
|
||||
gGameOverLetterXOffsets: @ 0x020306C0
|
||||
.space 0x10
|
||||
gUnknown_020306D0: @ 0x020306D0
|
||||
gCatchSpritePalettes: @ 0x020306D0
|
||||
.space 0x20
|
||||
gUnknown_020306F0: @ 0x020306F0
|
||||
gCatchSequencePalA: @ 0x020306F0
|
||||
.space 0x20
|
||||
gUnknown_02030710: @ 0x02030710
|
||||
gCatchSequencePalB: @ 0x02030710
|
||||
.space 0x20
|
||||
gUnknown_02030730: @ 0x02030730
|
||||
gCatchSequencePalC: @ 0x02030730
|
||||
.space 0x20
|
||||
gUnknown_02030750: @ 0x02030750
|
||||
gGameOverLetterAmplitudes: @ 0x02030750
|
||||
.space 0x10
|
||||
gUnknown_02030760: @ 0x02030760
|
||||
gCatchSpriteGfxBuffer: @ 0x02030760
|
||||
.space 0x900
|
||||
gUnknown_02031060: @ 0x02031060
|
||||
gCatchSpriteFlashGfx: @ 0x02031060
|
||||
.space 0x480
|
||||
gCurrentPinballGame: @ 0x20314E0
|
||||
.space 0x20
|
||||
gUnknown_02031500: @ 0x02031500
|
||||
gGameOverLetterYOffsets: @ 0x02031500
|
||||
.space 0x10
|
||||
gUnknown_02031510: @ 0x02031510
|
||||
gReplayFrameCounter: @ 0x02031510
|
||||
.space 0x10
|
||||
gUnknown_02031520: @ 0x2031520
|
||||
gBoardConfig: @ 0x2031520
|
||||
.space 0x70
|
||||
gUnknown_02031590: @ 0x02031590
|
||||
gKecleonSpriteOrderMap: @ 0x02031590
|
||||
.space 0x40
|
||||
gUnknown_020315D0: @ 0x020315D0
|
||||
gCatchSpritePaletteBuffer: @ 0x020315D0
|
||||
.space 0x520
|
||||
gUnknown_02031AF0: @ 0x02031AF0
|
||||
gCustomButtonConfigs: @ 0x02031AF0
|
||||
.space 0x28
|
||||
gUnknown_02031B18: @ 0x02031B18
|
||||
gCustomButtonConfigTileIds: @ 0x02031B18
|
||||
.space 0x18
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user