1826 Commits

Author SHA1 Message Date
bryanthaboi 1d4f9124a1 Merge pull request #2429 from bryanthaboi/dev v0.3.2 2026-09-23 06:05:58 -04:00
bryanthaboi eaedbccb3b skip game3 trade rules test when no rom cache 2026-09-23 06:00:44 -04:00
bryanthaboi ebbf4709c8 CLOSES #2411, CLOSES #2418, CLOSES #2420, CLOSES #2422, CLOSES #2423, CLOSES #2424 2026-09-23 05:51:05 -04:00
bryanthaboi 18661d45a1 Merge branch 'dev' of https://github.com/bryanthaboi/gen1recomp into dev 2026-09-22 20:44:23 -04:00
bryanthaboi a446147787 CLOSES #2408, CLOSES #2413, CLOSES #2414, CLOSES #2415, CLOSES #2416, CLOSES #2417, CLOSES #2419 2026-09-22 20:44:21 -04:00
bryanthaboi 1c13c4c0d6 Merge pull request #2398 from thibautbus/fix/game3-trainer-class-ids
Recognise FireRed trainer classes by id, not by their name
2026-09-22 20:12:50 -04:00
bryanthaboi 2a463da06b Merge pull request #2400 from thibautbus/fix/game3-unicode-braille
Let FireRed braille messages take Unicode braille cells
2026-09-22 20:12:40 -04:00
bryanthaboi e51c8ec6b6 Merge pull request #2421 from 1Jamie/grandpas-garage
fix(game3): S.S. Anne cutscene, Old Man tutorial, battle EXP participants, trainer sight, party UI & LeafGreen palette
2026-09-22 20:12:00 -04:00
1jamie 63155055a4 fix(game3/battle): preserve foe.name and foe.nickname when constructing wild battle mon 2026-09-22 19:07:19 -05:00
1jamie 6a0e10ec66 fix(test): resolve test runner stubs, cache loaders, and thread yield handling 2026-09-22 18:53:24 -05:00
1jamie f2a75271b0 Merge upstream/dev into grandpas-garage and resolve switch_seq conflict 2026-09-22 18:41:25 -05:00
1jamie ce8a2d3777 Fix battle EXP distribution, party status badges, pacing trainer sight, and LeafGreen launcher colors 2026-09-22 18:32:26 -05:00
1jamie 249d321082 Implement Old Man battle tutorial and S.S. Anne departure cutscene with accurate pret timing and OAM layering 2026-09-22 17:20:31 -05:00
github-actions 0f2277aa39 chore(ios): update app-repo.json [skip ci] 2026-09-22 17:24:28 -04:00
bryanthaboi 16a946dfff Merge pull request #2412 from bryanthaboi/dev
lots and lots of bug clean up
v0.3.1
2026-09-22 17:09:45 -04:00
bryanthaboi d920f7acdb clean up 2026-09-22 17:05:12 -04:00
bryanthaboi 8ad3a53770 Merge pull request #2409 from Nexhas28/nexhas28/gen3-review-v3-fixes 2026-09-22 16:41:24 -04:00
bryanthaboi 9208d83a28 Merge branch 'dev' into pr-2409
# Conflicts:
#	src/ui/game3/save_menu.lua
2026-09-22 16:41:00 -04:00
1jamie 109a87c81c fix(game3): fix BGM silence after fanfares during battle and overworld dialog
- Preserve active track voices in Player.stopAt after fast-forward catchup
- Add start-from-0 fallback in Player.stopAt when at timestamp predates the retained snaps ring
- Mute m4a worker during stopAt pause so it does not synthesize empty buffers while fanfare plays
- Ensure Audio.resumeBgm calls Source:play on bgmSource if stopped
2026-09-22 15:37:18 -05:00
bryanthaboi 23617f43b4 CLOSES #2290, CLOSES #2338, CLOSES #2186, CLOSES #2305, CLOSES #2332, CLOSES #2320, CLOSES #2344, CLOSES #2291, CLOSES #2335, CLOSES #2340, CLOSES #2385, CLOSES #2352, CLOSES #2378, CLOSES #2403, CLOSES #2404, CLOSES #2405, CLOSES #2367, CLOSES #2037, CLOSES #2177, CLOSES #2368, CLOSES #2382, CLOSES #1951
CLOSES #2290, CLOSES #2338, CLOSES #2186, CLOSES #2305, CLOSES #2332, CLOSES #2320, CLOSES #2344, CLOSES #2291, CLOSES #2335, CLOSES #2340, CLOSES #2385, CLOSES #2352, CLOSES #2378, CLOSES #2403, CLOSES #2404, CLOSES #2405, CLOSES #2367, CLOSES #2037, CLOSES #2177, CLOSES #2368, CLOSES #2382, CLOSES #1951
2026-09-22 16:27:28 -04:00
Shane McGovern 787357904d docs(game3): keep the review working notes out of this PR
The nine docs/game3 notes that came with the waves - the review triage
ledger, e10 opcode spec, RSE seam design, both sweep ledgers, the pret
citation audit, the artifact-conversion notes, the test baseline and the
merge trial - stay local working documents instead of shipped files.  The PR
carries the code, the harness and the tests; the notes carry the team's
bookkeeping.

Removing them from the tip cancels their addition against the base, so the
net docs/game3 diff in this PR is empty while the files themselves stay on
disk (untracked and listed in .git/info/exclude, so nothing re-adds them by
accident).
2026-09-22 20:40:29 +01:00
Shane McGovern a5014826cd fix(game3): multichoice cart-arity fallback and tint boundary coverage
The wave-3 tint batch as its own commit, so the harness fold before it stays
reviewable on its own.

multichoice.lua: Multichoice.COUNTS is the live option-count source for the
cart - 65 of 65 entries match pret's src/script_menu.c, where
ScriptMenu_MultichoiceGrid reads sMultichoiceLists[id].list and .count
(:915-930).  The table is load-bearing in a ROM-less run: with no import
cache present there is nothing else to ask how many options a list has.

adapters.lua: the multichoice operand reader no longer treats row[4] as an
option count.  pret asm/macros/event.inc:893-899 lays the command out as
x, y, multichoiceId, ignoreBPress - four bytes and no count field - so the
old read shifted the operand stream and every later decode in the command
went wrong with it.

tests/game3_photo_tint_boundary_test.lua: pins the cache-miss arity fallback
and the yield behaviour it rests on, which is the BUG2 root cause.  Run
twice green; the existing tint suite still passes 33/33 alongside it.
2026-09-22 19:24:52 +01:00
Shane McGovern 3cf9e23178 test: fold the harness and parity-seam fixes into one gate-hardening commit
Ships the CI fix together with the test-harness work that supports it, so
every tier stays honest on every machine.

scripts/test.sh
- T6 records missing-artifact failures as skips when no imported game3 data
  exists at all (empty CI identity, no data/generated): the data-driven
  top-level suites assert instead of self-skipping on a fresh runner.  The
  skipped suite names are printed with that reason; with data present the
  same failure gates exactly as before.
- The T3 content verdict now weighs the exit code and the FAIL-line allowlist
  together.  The exit code used to be discarded, so a mid-run crash
  (unresolvable require under POKEPORT_DATA_DIR) printed green checks, zero
  FAIL lines, and passed.  A non-zero exit with no FAIL line is reported as a
  crash with the error line captured - a crash is not a pass.

Test-suite fixes, each run green (several twice)
- tests/run_tests.lua: restore per-suite leaked state and add the Data seam,
  so one suite's loaded data cannot leak into the next.
- tests/mod_runtime_tests.lua: save and restore the environment around each
  case.
- tests/parity_ss_anne_rooms.lua: _loadModule raw-order fix (30/30).
- tests/parity_ss_anne_departure.lua: the Data seams plus the playMap stub.
- playMap stubs for parity_rival_walkoff, parity_tower_rival,
  parity_silph_rival_bug2241 and parity_ss_anne_guard.
- Class-B seams in mod_registry_tests, mod_catalog_tests, mod_ui_tests,
  parity_ball_shake_anim, parity_wavy_screen, parity_hidden_coins_bcd_bug1810,
  parity_mart_stock and parity_rocket3_sight_bug1814.

Together these close the 57 failing checks that were on the content tier
(allowlist stays at 0), so a content run on a machine with imports ends
ALL TESTS PASSED.
2026-09-22 19:17:22 +01:00
Shane McGovern 59886d9639 fix(game3): PC panel species scope fix and trainer-card var key fallback
Three follow-ups to the merge snapshot, kept as their own commit so the
review of the wave commit stays intact:

- The PC panel's left data panel broke in the merge: upstream inlines the
  egg-aware species read into frontPic while the M8 dedup had removed the
  duplicate local, so `sp` was referenced with no binding and the luacheck
  gate failed. One shared local sp = Pokemon.speciesOrEgg(hoveredMon) serves
  both the TV sprite and the stats card
  (pokefirered/src/pokemon_storage_system_data.c:1034, :1057,
  MON_DATA_SPECIES_OR_EGG).
- Trainer-card vars fall back to the stringified key: persist_sidecar and
  Flags.serialize write tostring(id) keys into session.vars, so a numeric miss
  used to read every var as 0.
- tests/game3_trainer_card_photo_tint_test.lua drives the whole Game Corner
  photo -> card tint chain (setvar -> UpdateTrainerCardPhotoIcons ->
  Flags.serialize/loadInto -> cardData) and pins c.monIconTint/c.monSpecies.
2026-09-22 18:38:24 +01:00
Shane McGovern 72f083f0c4 Merge remote-tracking branch 'upstream/dev' into nexhas28/gen3-review-v3-fixes
# Conflicts:
#	src/core/game3/save_schema_firered.lua
#	src/core/game3/scripting/natives.lua
#	src/import/RomExtractorGen3.lua
#	src/import/gba/versions.lua
2026-09-22 18:28:33 +01:00
Shane McGovern 41935aa2a2 fix(game3): wave 2 - 118 review fixes, seam work, and the gate to 282 suites
Second batch of the Gen 3 review work: the review lanes closed their queues
and the test gate grew with them.

Review census: 139 routed findings -- 118 fixed, 14 invalid (the report had
Gen 4+ semantics in more than one place), 6 struck as stale after
re-verification, 1 re-routed. Every fix carries its own pret citation in
docs/game3/review-v3-triage.md; the E10 opcode closure is itemised in
docs/game3/e10-opcode-spec.md (18 ops wired, 2 reclassified to the seam class).

Representative ROM-grounded changes:
- The POKéMON start-menu entry is now gated on FLAG_SYS_POKEMON_GET the way
  retail does it (pokefirered/src/start_menu.c:217-218, flag 0x828).
- Money ops read their amount raw and gate the change on the disable byte
  (pokefirered/src/scrcmd.c:1798-1830, pokefirered/asm/macros/event.inc:1166-1186);
  random and the warp family VarGet theirs
  (pokefirered/src/scrcmd.c:455-461, :719-731).
- The HM table matches FRLG: there is no Whirlpool HM
  (pokefirered/include/constants/items.h:411-418).
- The day-care party-full guard follows src/daycare.c:525, :1081.
- Knock Off keeps its battle-scoped send-out mask
  (pokefirered/src/battle_script_commands.c:2730-2752, :4489), carried from
  the first batch.

Structural work: the I6/I9/J1 architecture items landed as seams (profile
selector, capability flags, font provider, virtual-object layer), the adopted
footprint register keeps a KEEP verdict, the quantizer target is met, and the
30 drain items plus carves 1-4 are folded in.

Tests: T6 now runs 282 top-level suites (273 + 9 new), the re-sweep ends at
267 pass / 0 fail, the engine tier is 634 suites, modkit 37, and the full
gate ran green twice with T3 active on an imported Red cache. Documented
skips are the lua5.4 oversize-save oracle where lua5.4 is absent and the
config-partials listed in docs/game3/game3-artifact-conversions-v3.md.

Docs shipped: review-v3-triage.md, e10-opcode-spec.md, rse-seams.md,
game3-suite-sweep-v113.md, game3-artifact-conversions-v3.md,
test-baseline-v3.md (plus the first-batch docs already on the branch).
2026-09-22 18:23:06 +01:00
github-actions eaf9286ee6 chore(ios): update app-repo.json [skip ci] 2026-09-22 12:40:52 -04:00
bryanthaboi bf10c01992 Merge pull request #2402 from bryanthaboi/dev
bazinga [release 0.3.0]
v0.3.0
2026-09-22 12:21:09 -04:00
bryanthaboi 78a3defa72 bazinga [release 0.3.0] 2026-09-22 12:18:50 -04:00
bryanthaboi cbe5711486 bazinga [release 0.3.0]
bazinga [release 0.3.0]
2026-09-22 12:15:27 -04:00
bryanthaboi d3369851b8 cache shader bridge 2026-09-22 12:11:44 -04:00
bryanthaboi 4494598463 boat 2026-09-22 12:03:58 -04:00
bryanthaboi 081787d614 Fix Gen 3 mod target expectations for LeafGreen 2026-09-22 11:49:50 -04:00
bryanthaboi 4bdb97fc8d Merge branch 'dev' of https://github.com/bryanthaboi/gen1recomp into dev 2026-09-22 11:44:52 -04:00
bryanthaboi 8356fdd8e1 othe rbig changes 2026-09-22 11:44:50 -04:00
bryanthaboi 29359ab039 Merge pull request #2360 from sergiomele97/fix/thunderAccuracyUnderWeather
fix(SecondGen): adds accuracy override for thunder under weather conditions
2026-09-22 10:26:36 -04:00
bryanthaboi 9308439697 Merge pull request #2370 from bryanthaboi/nexhas28-fix-gen2-encounters-unknown-id
Close Gold's encounters id space so an unknown id fails the mod (#2369)
2026-09-22 10:25:51 -04:00
thibautbus 2701b930d8 Let FireRed braille messages take Unicode braille cells
Braille.encode spells a braille message from Latin letters, through
Braille.CODE and the Latin charmap byte of any other character. That
covers the US cart, but the European carts' braille lines use cells no
character reaches: German ä (dots 3-4-5), the full cell, dot 5 alone. A
translation mod therefore cannot hand over the German, Spanish or Italian
braille, and the 39 lines of the Dotted Hole, Ruin Valley and Mt. Ember
stay in English in every language.

pret's braille font holds every dot combination
(pokefirered/include/characters.h:282), so Braille.encode now draws a
Unicode braille character (U+2800-U+283F) as that very cell, mapping
Unicode's dot bits to the cart's cell numbering (dot 1 = 0x01, 4 = 0x02,
2 = 0x04, 5 = 0x08, 3 = 0x10, 6 = 0x20). A cell spells its own number sign,
as the carts' braille does. Latin text is spelled as before.
2026-09-22 15:57:49 +02:00
bryanthaboi 21c868b90a leafgreen 2026-09-22 09:56:36 -04:00
github-actions 1a934fa738 chore(ios): update app-repo.json [skip ci] 2026-09-22 09:41:33 -04:00
bryanthaboi d8462f197a Merge pull request #2397 from bryanthaboi/dev
Bugs and slugs
v0.2.75
2026-09-22 09:29:42 -04:00
thibautbus 5ad701022b Pick the FireRed Elite Four and champion transitions by class id
BattleTransition.pickTrainer told the Elite Four and the champion by class
names ("ELITE_FOUR", "CHAMPION", "RIVAL") or by class ids 57 and 58, and
the Elite Four members by trainer ids 412-419. None of these is
FireRed's: TRAINER_CLASS_ELITE_FOUR is 87, TRAINER_CLASS_CHAMPION 90, and
Lorelei, Bruno, Agatha and Lance are trainers 410-413 (735-738 for the
rematch). The bridge also never passed the class, so these battles always
got the terrain transition. The bridge now hands over the foe's class id
and pickTrainer follows GetTrainerBattleTransition
(pokefirered/src/battle_setup.c:624): the Elite Four member's own
transition, BLUE for the champion, and none for the rival's class (a
caller's isRival flag still asks for BLUE).

A Trainer Tower or e-Reader foe carries a facility class instead, whose
numbers overlap the trainer classes (FACILITY_CLASS_LASS is 90, the
champion's class), and pret never picks their transition by class
(battle_setup.c:660), so pickTrainer ignores the class for them.
2026-09-22 15:28:54 +02:00
thibautbus fa0ab3621f Record FireRed gym, Elite Four and champion wins by class id
The quest log told a gym leader, Elite Four or champion win from the
trainer's class name ("LEADER", "ELITE FOUR", "CHAMPION"). With a
translated class every such win fell back to the plain trainer event, and
in French, where the gym LEADER class reads CHAMPION, every gym win would
be logged as a champion battle. pret switches on the class id
(pokefirered/src/quest_log_battle.c:25); the battle state now keeps the
trainer's class id next to its name, and the recorder reads it.
2026-09-22 15:20:31 +02:00
thibautbus 1c2a7d64de Give the FireRed rival and champion the rival's name by class id
Trainers.info gave a trainer the player's chosen rival name only when its
class was called "RIVAL". A mod that translates the class (RIVALE in
German and Italian) made the rival battle as the ROM's placeholder TERRY,
and the champion, whose class is CHAMPION, was always TERRY. pret's
B_TXT_TRAINER1_NAME names TRAINER_CLASS_RIVAL_EARLY, _RIVAL_LATE and
_CHAMPION by the rival's name (pokefirered/src/battle_message.c:2078);
Trainers.info now does the same, by class id.
2026-09-22 15:20:31 +02:00
bryanthaboi 351b7b3cbb Merge pull request #2396 from thibautbus/fix/game3-egg-nickname 2026-09-22 07:38:18 -04:00
bryanthaboi 35f02cc5d2 CLOSES #2394 2026-09-22 07:36:16 -04:00
Shane McGovern b5f2f4fcfd Merge remote-tracking branch 'upstream/dev' into nexhas28/gen3-review-v3-fixes
# Conflicts:
#	src/core/game3/battle/anim_seq.lua
#	src/core/game3/battle/effects/secondary.lua
#	src/core/game3/battle/engine.lua
#	src/core/game3/battle/state.lua
#	src/core/game3/battle/switch_seq.lua
#	tests/engine/game3_knock_off_item_test.lua
2026-09-22 12:25:30 +01:00
Shane McGovern e2454bf568 fix(game3): review v3 fixes (battle, field, script, save) + gated T6 tier
Second wave of fixes from the Gen 3 codebase review (210 findings), the
regressions the full-suite sweep surfaced, and a T6 tier so the top-level
tests/game3_*.lua suites run inside ./scripts/test.sh instead of outside it.

Battle: Knock Off and Thief/Trick item persistence follow the ROM, not the
review - the party slot is never written through during battle, and the
knocked-off mask suppresses the item on later send-outs
(pokefirered/src/battle_script_commands.c:2731 MOVE_EFFECT_KNOCK_OFF with the
STICKY_HOLD guard at :2732, opponent-steal guard at :2610-2622, mask use at
:4489). Rapid Spin keeps its one-per-use chain order (:8435-8474); Growl
keeps pret's target (src/data/battle_moves.h, include/battle.h:63).

Scripting: operand layouts match pret/asm/macros/event.inc - givemon 15 bytes
(:989-997), comparestat {B,W} (:1573-1576), setptr/loadbytefromptr/setptrbyte
take a word pointer (:118-137). 18 of the 20 E10 ops are wired per
src/scrcmd.c (per-op citations in docs/game3/e10-opcode-spec.md), money and
random and the warp family read their operands as VarGets
(src/scrcmd.c:1798-1830, :455-461, :719-731), and the day-care party-full
guard is in place (src/daycare.c:525,:1081).

Field and UI: fishing counts rounds as the ROM does
(src/field_player_avatar.c:1740-1765), an unresolved map section no longer
reports Pallet Town (src/region_map.c:3782), and a font provider sits behind
a FireRed capability/profile seam.

Save data: profile-driven Options.block, a save version round-trip, and slot
id validation that blocks path traversal (slotDiskPath("firered", "../evil")
returns nil).

Importer: the parallel import path now writes both completion markers,
object kind/clone bytes decode as pret defines them
(include/global.fieldmap.h:110-130), and the HM table drops Whirlpool
(include/constants/items.h:411-418).

Tests: six new scenario suites (battle_ai, capture, event, menu, move,
overworld) and eight engine suites (profile, capabilities, cache paths, font
provider, options block, save version round-trip, version dispatch,
versions_game). T6 runs every top-level game3 suite at GAME3_JOBS default 8
with per-suite logs, failure cause classification and a KNOWN_GAME3_FAILURES
ceiling of 23 as a shrinking guard.

Docs: the working notes under docs/game3 (triage ledger, pret citation audit,
e10 opcode spec, RSE seams, sweep v3/v113, test baseline, artifact
conversions, merge trial).

Full gate at this snapshot: exit 0, all tiers passed - engine 624/624,
T6 279/279 (0 known, 0 fresh failures), gen2 146/146, modkit 37/37, luacheck
clean, privacy gate 3/3 over a 9,711-file publication set.
2026-09-22 12:22:50 +01:00
thibautbus 32d52b88c0 Show only an egg's name in its FireRed party slot
The party menu drew an egg's slot like any other mon's: level, gender, HP
numbers and HP bar. pret's DisplayPartyPokemonData prints only the nickname
for an egg and blits the slot without its HP frame (sSlotTilemap_MainNoHP /
WideNoHP; pokefirered/src/party_menu.c:781, :2197), and
DisplayPartyPokemonDescriptionData likewise skips the level and gender of an
egg (party_menu.c:804). The slot now does the same, reusing the no-HP frame
the description slots already draw.
2026-09-22 12:47:50 +02:00
github-actions 8672eb69f7 chore(ios): update app-repo.json [skip ci] 2026-09-22 06:27:36 -04:00