Commit Graph

92 Commits

Author SHA1 Message Date
Retnuhytnuob adc7a106ae Ereader text, overlapping array cleanup/finish dump, moved graphic optimizations back out from graphics_rules.mk files. 2026-08-08 02:13:57 -05:00
Retnuhytnuob 8da1fa1551 bonus score 2026-07-31 21:32:01 -05:00
Retnuhytnuob ef6e7be016 remaining score consts 2026-07-31 21:32:00 -05:00
Retnuhytnuob ba08a59a21 score checkpoint 2 2026-07-31 21:31:59 -05:00
Retnuhytnuob 3be8f808e5 timer defines 2026-07-31 21:28:19 -05:00
Retnuhytnuob 1e49e2f3e0 score display 2026-07-31 21:28:18 -05:00
Retnuhytnuob c37847b6a9 remaining bool true/false consts 2026-07-21 02:20:11 -05:00
Retnuhytnuob 15fe55e04b area portrait base 2026-07-18 20:26:29 -05:00
Retnuhytnuob 99bbbcb580 Merge branch 'spriteGroups' into combined_prs 2026-07-04 01:59:51 -05:00
Retnuhytnuob 4cb3fccc52 Merge branch 'fieldCollision' into combined_prs 2026-07-04 00:34:37 -05:00
Retnuhytnuob 3a742399e4 name remaining sounds 2026-07-04 00:10:52 -05:00
Retnuhytnuob 4b13fa85dd gShopItemData usage 2026-07-01 03:09:40 -05:00
Retnuhytnuob a447ac0dd0 30 SE remaining 2026-07-01 02:04:40 -05:00
Retnuhytnuob 237b742126 additional SE naming 2026-07-01 01:31:21 -05:00
Retnuhytnuob e3555b3cad unused SEs 2026-06-06 23:28:13 -05:00
Retnuhytnuob 524b2f1751 remaining spheal, totodile egg delivery, high score 2026-06-06 22:54:46 -05:00
Retnuhytnuob fa0c71203f spheal and rayquaza SE naming 2026-06-06 21:58:53 -05:00
Retnuhytnuob 8e76fd65e0 emptys 2026-06-05 02:59:57 -05:00
Retnuhytnuob 7e64aa1fb9 kecleon, groudon, kyogre SEs 2026-06-05 02:36:44 -05:00
Retnuhytnuob bce9d8501e sapphire/kecleon trigger consts 2026-06-01 03:49:53 -05:00
Retnuhytnuob 1d633482cf big checkpoint 2026-06-01 02:31:46 -05:00
Retnuhytnuob 4d87510ada board collision var names 2026-05-31 21:20:50 -05:00
Retnuhytnuob fc9d2e8f0f timerMode 2026-05-30 05:21:30 -05:00
Retnuhytnuob cefc7d2026 input array and pika coverage consts 2026-05-30 04:32:28 -05:00
Retnuhytnuob c0b3b6c35b remaining sapphire SGs 2026-05-30 02:07:05 -05:00
Retnuhytnuob 75b9f585bd Remaining Ruby Board SGs 2026-05-30 00:41:10 -05:00
Retnuhytnuob 8fe5ec5f37 placeholders for board specific graphic consts 2026-05-29 02:15:35 -05:00
Retnuhytnuob 1b3cb90a43 remaining field sprite groups 2026-05-29 01:13:12 -05:00
Retnuhytnuob e77f216190 SpriteGroups through 42 2026-05-28 22:54:30 -05:00
Retnuhytnuob b5a4a5b117 Ruby Board through 22 2026-05-27 02:35:32 -05:00
Retnuhytnuob 2b69474046 checkpoint 2026-05-27 00:59:46 -05:00
Retnuhytnuob 92f06b1562 checkpoint 2 2026-05-25 22:01:35 -05:00
Retnuhytnuob bbb9ba26fd checkpoint 1 2026-05-25 19:33:37 -05:00
Retnuhytnuob 5f1dbc13b0 pokedex SG 2026-05-25 00:50:59 -05:00
Retnuhytnuob 6e7ea3cf26 bonus spriteset naming, high score spritegroup consts 2026-05-23 01:12:52 -05:00
Retnuhytnuob 6966706e3c title screen sprite groups 2026-05-15 02:00:44 -05:00
Retnuhytnuob e2f0444a67 field select screen 2026-05-15 00:53:19 -05:00
Retnuhytnuob 238c073352 field sprite group IXs used by bonus boards 2026-05-13 02:50:30 -05:00
Retnuhytnuob 8020b803d5 Pause Sprite Group + Dusclops SpriteSets 2026-05-12 04:16:08 -05:00
Retnuhytnuob c59f13fb4e spheal sprite groups 2026-05-12 02:16:09 -05:00
Retnuhytnuob e3e313cbc0 rayquaza sprite groups 2026-05-12 01:14:47 -05:00
Retnuhytnuob a0a7139420 flippers 2026-05-11 02:40:39 -05:00
Retnuhytnuob e28821d490 kyogre sprite groups 2026-05-11 02:17:25 -05:00
Retnuhytnuob 5d0318af48 kecleon sprite groups 2026-05-11 01:47:48 -05:00
Retnuhytnuob 0ed781a4ab groudon Sprite Groups 2026-05-11 00:49:36 -05:00
Retnuhytnuob 2f5cd288f6 all dusclops sprite groups 2026-05-10 00:25:01 -05:00
Retnuhytnuob fa34dd62c0 base sprite group constants 2026-05-09 23:26:04 -05:00
Retnuhytnuob c75a93182f Renaming of board related src files, Prize state naming, board/bonus board state/substate naming (#214)
* name prize array, start on main board state

* next board state const refs

* main/groudon board states

* spriteGroup Const initialize

* undo SG_ consts for now - Later PR

* sprite group active bool checkpoint

* sprite group active conditions

* center screen display

* board substate initial enum tagging

* board intro mode; bonus board substates

* folderization; partial

* catch tile naming

* remaining board folderization (2 intended exceptions)

* center catch substates

* Finished Catchem substates

* finish jirachi substate mode

* baby mon substates

* clean up center screen in-file naming

* defolderization, evo/travel substates

* pendingModeChangeFlags

* Kecleon board state naming

* spheal board states

* fix unknown enum name

* kyogre initial state enum

* kyogre const checkpoint

* kyogre state enums finished

* data extraction for roulette wheel sets, state for special capturestate

* rayquaza states, roulette prize option dump
2026-05-09 08:06:24 -05:00
Retnuhytnuob 77c628e0ee Sound Effect Naming, kickback naming, catch state enum (#211)
* kickback naming, catch state enum

* sound renaming through 98
2026-03-19 17:59:21 -05:00
Youpeoples 69f931d646 Mass naming: Ball/PinballGame Unk variables, function names (#210)
* 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) |
2026-03-15 19:40:33 -05:00