411 Commits

Author SHA1 Message Date
bryanthaboi f56970350a Merge branch 'dev' of https://github.com/bryanthaboi/gen1recomp into dev
# Conflicts:
#	data/scripts/story4.lua
#	src/ui/DexEntryMenu.lua
#	tests/drivers/fighting_dojo_bug197_test.lua
2026-08-05 14:43:05 -04:00
bryanthaboi 863f371e68 CLOSES #806, CLOSES #809, CLOSES #853, CLOSES #854, CLOSES #860, CLOSES #862, CLOSES #865, CLOSES #866 2026-08-05 14:38:10 -04:00
bryanthaboi 78744a6853 Merge pull request #856 from johnjohto/fix-karate-master-dex-entry
Show the Pokédex entry for the Fighting Dojo prize balls
2026-08-05 11:18:03 -04:00
bryanthaboi efce1bb116 Merge pull request #858 from johnjohto/fix-modkit-headless-love
Keep CacheFs.read from crashing when modkit runs headless
2026-08-05 11:17:07 -04:00
bryanthaboi 104c95a942 Merge branch 'dev' of https://github.com/bryanthaboi/gen1recomp into dev 2026-08-05 11:15:49 -04:00
bryanthaboi f6392e8932 CLOSES #788, CLOSES #795, CLOSES #796, CLOSES #797, CLOSES #805, CLOSES #826, CLOSES #833, CLOSES #835, CLOSES #837, CLOSES #844, CLOSES #845, CLOSES #846, CLOSES #847 2026-08-05 11:09:05 -04:00
johnjohto 8f0117a145 Treat headless cache reads as misses in CacheFs
The modkit validate and pack drivers run the real loader under plain
luajit, with no love global.  With --base imported, Data:load falls
back to CacheFs.readActive for a generated module require cannot find
(an optional module like data/generated/audio.lua is legitimately
absent from developer and stale caches), and CacheFs.read indexed
love.filesystem once there was no portable root, so validate and pack
died with MK100 before the mod was even looked at.  Headless there is
no save directory to read from, so return nil like any other cache
miss.

Refs #850
2026-08-05 10:25:19 -04:00
johnjohto 1f878c3098 Show the Pokédex entry for the Fighting Dojo prize balls 2026-08-05 10:18:47 -04:00
Andrew Quenehen ae5276b2d1 Show the running app version on the Switch launcher header.
Add an NX-only yellow version chip so players can confirm which build is on the microSD after OTA or zip updates.
2026-08-05 02:08:20 -03:00
bryanthaboi bbf48c7e9e Merge pull request #831 from KikiManjaro/order-dex-in-file-editor 2026-08-04 19:04:30 -04:00
kikimanjaro 272305f3a4 Validate save imports by main-data checksum, not raw file size
The SAVE FILES card only accepted saves of exactly 32768 bytes and
refused anything else. importToSlot now classifies a non-32768 file by
the integrity of its main-data checksum instead:

- Oversize + valid checksum -> an emulator RTC footer, so the launcher
  asks for confirmation, then truncates to 32768 on force.
- Oversize + invalid checksum -> rejected.
- Undersize + valid checksum -> imports zero-padded; otherwise refused.

Adds the "Oversized save file" confirm modal, a new vendor-oracle test
built by gen1lib (PKHeX-derived) run as its own Lua 5.4 tier, oversize/
truncated policy tests, and the LUA54 wiring in test.sh.

# Conflicts:
#	src/import/LauncherView.lua
2026-08-05 00:50:35 +02:00
kikimanjaro 89f023c7dd Order the save editor DEX grid by Pokedex number or name
The DEX grid now defaults to Pokedex-number order with an A-Z view, set
from two chips in the header.  Sorting is view-only: it never dirties the
save, resets the scroll, and no-ops on a re-click.  Ops.dexList builds the
order deterministically and sorts partial mod records last.  Tests pin the
orderings against the real generated data.
2026-08-05 00:10:10 +02:00
bryanthaboi 0fe7a96781 Merge pull request #818 from johnjohto/fix-rare-candy-menu-796
Keep the bag open after using a Rare Candy
2026-08-04 16:38:21 -04:00
bryanthaboi a06a49bfed Merge pull request #820 from johnjohto/fix-gym-bag-full-797
Gym leaders skip the TM hand-over when the bag is full
2026-08-04 16:38:11 -04:00
bryanthaboi 86b90fd4b8 Merge pull request #821 from johnjohto/fix-held-direction-799
Rebuild held input after lifecycle resets
2026-08-04 16:37:59 -04:00
bryanthaboi 12b4c93279 Merge branch 'dev' into performance-enhanced 2026-08-04 15:21:23 -04:00
bryanthaboi af47e19e1a Rebuild the launcher and save editor on a small immediate-mode UI kit
The launcher spent ~9ms per frame building and drawing, and the Find Mods
tab could hang the window for minutes. Both had the same root cause: a
retained UI tree rebuilt every frame, and blocking curl calls made from the
draw path.

Replace the vendored FlexLove engine (28.5k lines) with src/ui/kit/ (Kit,
Theme, Layout, Loader). The kit caches Text objects and all measurement,
allocates nothing in the steady state, and draws flat. Build+draw is now
under 1ms at every window size and on every tab (POKEPORT_LAUNCHER_PROF).

Move every network call off the render thread onto a love.thread pool
(src/net/Fetch.lua): mod index fetches, per-mod release checks, find-tab
stats, thumbnails and mod installs. Mod indexes prewarm at boot so the
Find Mods tab is populated before it is opened.

Paginate every list -- mods, find, save slots, settings, release notes,
versions -- with the page size derived from the real viewport height, so a
500-mod index costs what a 10-mod one does. Scrolling is gone.

Anything that waits now raises a non-dismissable loader; per-row background
work shows an inline spinner instead. The in-app updater moves to the top
right beside the settings gear and pulses when an update is waiting.

Theme is black with white outlines, no gradients or glows, and solid
colour-coded embossed buttons with bold labels. The game tabs keep their
cartridge colours. Everything is 1.3x larger. The save editor shares the
theme, and adding an item there is now a searchable pop-up like adding a
Pokemon.

Also:
- Reset rebinds, in Settings and under Touch Controls. Rebinds are additive
  (Input:applyBindings layers them over the defaults), so there was no
  in-game way to undo one.
- Launch options: --game red [--slot N] / POKEPORT_GAME boots straight into
  a game for shortcuts and frontends, falling back to that game's tab when
  its ROM is not imported.

Fixes found while porting:
- Ellipsis and letterspacing truncated bytes, not codepoints, so a
  multi-byte mod name crashed the first frame on a Japanese index.
  Measurement no longer throws on malformed input either.
- The new font set missed UiFont's kana fallback, rendering translated
  builds as tofu.
- Fetch workers idle in Channel:demand() and LOVE waits for live threads at
  exit, so the process outlived the window; quitting mid-download also
  waited on curl's 300s ceiling. Shut the pool down in love.quit and bound
  its transfer timeouts.
- In one column the save-slot card drew below the fold, over the footer,
  with no scrollbar left to reach it.

The two FlexLove engine tests guarded a scroll manager and an auto-height
propagation bug that no longer exist; replace them with a kit suite covering
page bounds, viewport sizing and UTF-8 truncation, and retarget the NX test
to assert the dependency is gone rather than that its perf guards are set.
2026-08-04 15:17:09 -04:00
bryanthaboi 4e666303d0 Merge branch 'dev' of https://github.com/bryanthaboi/gen1recomp into dev 2026-08-04 15:13:07 -04:00
bryanthaboi 0fa8206321 CLOSES #785, CLOSES #807, CLOSES #811, CLOSES #814 2026-08-04 15:13:06 -04:00
johnjohto 78ac154998 Rebuild held input after lifecycle resets
A focus flip, visibility flip, joystick add/remove, or resume reset all
held input, and a still-held direction never re-fires keypressed, so any
spurious reset (macOS Bluetooth re-enumeration fires joystickadded with
no hotplug) parked the player until every direction was re-pressed.
Reconcile from device ground truth after each reset; only what is
physically down comes back, so swallowed releases still clear.
2026-08-04 14:08:15 -04:00
johnjohto bbcaac7b71 Skip the gym leader TM hand-over when the bag is full
The originals run GiveItem before printing the received texts, and when
the bag can't hold the TM they print a make-room line instead and leave
EVENT_GOT_TM* unset, so talking to the leader again retries the give.
The victory reward path added the TM straight into the inventory, so a
full bag went to 21/20.

Route the gym TM give through Bag.add, split the TM lines out of the
victory dialogue table into tmPre/tmDialogue/noRoom, and port the
beaten-leader middle branch that re-runs the ReceiveTM script. Saves
that already hold the TM without the flag count as received so they
don't collect a second copy.

Refs #797
2026-08-04 13:44:46 -04:00
bryanthaboi 719ba49a85 Merge pull request #816 from johnjohto/fix-hm-menu-position-792 2026-08-04 13:18:38 -04:00
johnjohto 54ae20c69b Keep the bag open after using a Rare Candy (#796) 2026-08-04 13:18:32 -04:00
bryanthaboi f864837cbe Merge pull request #815 from johnjohto/fix-fly-menu-788-795 2026-08-04 13:18:25 -04:00
johnjohto 6426e913b6 Pin HM moves above STATS/SWITCH in the party submenu (#792) 2026-08-04 12:42:22 -04:00
johnjohto 3d3e42c6a3 Fix the fly map cursor start and cycle directions 2026-08-04 12:28:24 -04:00
johnjohto 6fe106f55c Stop offering the route Pokemon Centers as fly destinations 2026-08-04 12:28:08 -04:00
johnjohto ba8ac3d143 Tick residuals after each move in Gen 1 mode
In pokered, MainInBattleLoop calls HandlePoisonBurnLeechSeed right
after every Execute*Move (core.asm:426-464), so a seeded, poisoned or
burned mon takes its residual before the slower side acts. The port
ran the whole sweep in endOfTurn, which made leech seed behave like
Gen 3+ and never showed the drain animation (#784).

The residual sweep now runs per action under the gen1_faithful
ruleset, gated by a new residualAfterMove flag; modern_clean keeps
the end of round sweep. The leech seed drain plays the ABSORB
animation from the healing side, the way the original flips
hWhoseTurn before PlayMoveAnimation. Item, ball, failed run and
ghost-fear turns still tick the player's residual, matching
ExecutePlayerMoveDone.
2026-08-04 12:06:21 -04:00
Caorthann ad9b03fe56 Add Xbox UWP build workflow 2026-08-04 15:36:35 +01:00
Caorthann dacd9abe73 Add Xbox UWP port 2026-08-04 15:35:52 +01:00
bryanthaboi 8fbe819493 bingus dingus 2026-08-04 10:32:51 -04:00
Shane McGovern 626080d228 Show mod downloads and release dates in the launcher MODS and Find Mods panels (#793)
* Resolve Find Mods stats from each mod's GitHub repo when the feed lacks them

A FIND MODS row now shows download/date stats even when its feed publishes
none: the row fetches the mod's own GitHub releases through the same
cached ModUpdate.fetchReleases the MODS tab uses (six-hour options cache,
so an installed mod's repo is instant). Feed-published stats still win
when present; otherwise one repo is fetched per frame -- the thumbnail
budget pattern -- so opening the tab never stalls for the whole listing.
ModUpdate.statsForReleases is the shared resolver.

* Fix crash opening the Find Mods tab: rename the stats cache field

The resolver stored results in self._findStats, which collides with the
method of the same name: self._findStats resolves through the metatable to
the function, so the or {} guard never fired and indexing it crashed the
launcher the moment the panel built. State now lives in _findStatsCache.

* Fix Find Mods crash: require ModUpdate in the find panel

buildFindPanel called ModUpdate.statsLine without a local require --
only buildModsPanel had one -- so opening the tab indexed a nil global.

* Retry Find Mods stats after failed repo fetches

A failed repo fetch (hourly GitHub API rate limit, transient network error)
was memoized as resolved, so a rate-limited first visit left those rows
empty for the whole session. Failures now schedule a 60s retry; a 404 is
still permanent so a renamed or vanished repo is fetched once.

* Add the MODS tab sort options to the Find Mods tab
2026-08-04 10:16:44 -04:00
bryanthaboi f56e82de81 translate the launcher: load mod string catalogs before it draws (#794)
the launcher runs before Game:load, so #767's Strings hooks had nothing
filling the catalog and a restart could not help - the ordering is the same
every launch. reads lang/strings.lua from enabled mods only, data not the
entry chunk, sandboxed.

plus a plain pixel fallback on the ui faces, or the kana draw as tofu.
2026-08-04 10:15:10 -04:00
bryanthaboi 3c1246ee06 Merge pull request #787 from luisgonzaleznf/fix/love12-scissor-bias
Fix LÖVE 12 anchored UI scissor seam
2026-08-04 09:45:17 -04:00
bryanthaboi 30edac03a6 fix ttf text erased after a box, and type names outside battle
drawBox left the color white, which tiles ignore but ttf text does not, so
every label after a box drew white on white.

typechart only loaded on entering a battle, so the summary screen got raw
type ids back instead of display names.
2026-08-04 09:43:01 -04:00
bryanthaboi dd4aface93 test fixes 2026-08-04 09:41:44 -04:00
bryanthaboi b1350fdecd Merge branch 'dev' of https://github.com/bryanthaboi/gen1recomp into dev 2026-08-04 09:25:30 -04:00
bryanthaboi f2d9b74490 CLOSES #644, CLOSES #703, CLOSES #726, CLOSES #737, CLOSES #750, CLOSES #752, CLOSES #764, CLOSES #765, CLOSES #768, CLOSES #773, CLOSES #774, CLOSES #775, CLOSES #777, CLOSES #780, CLOSES #782 2026-08-04 09:25:28 -04:00
luisgonzaleznf 84d09d0894 Fix LÖVE 12 scissor seam 2026-08-04 15:20:06 +02:00
bryanthaboi e61f231316 Merge pull request #789 from bryanthaboi/ttf-tiles
add ttf tiles option
2026-08-04 09:14:49 -04:00
bryanthaboi 33998aab5d add ttf tiles option
lets a translation keep chosen characters on the rom tiles instead of the ttf.
needed for japanese: sizing the font for kana makes latin narrower, which
knocks the party menu numbers out of line.
2026-08-04 09:11:05 -04:00
bryanthaboi 9ce7379946 Merge pull request #786 from ShaneMcGovernIE/find-mods-release-stats
Show feed-published release stats on Find Mods rows
2026-08-04 08:00:46 -04:00
Shane McGovern b692474e24 Show feed-published release stats on Find Mods rows
A mod index can now publish three optional per-entry fields -- downloads
(total across every release), first_release and last_release (ISO days) --
which the FIND MODS listing shows in the same gold line the MODS tab uses.

The fields are additive by design: feeds that carry them stay readable by
every build that predates them (schema_version stays 1), and feeds that do
not render exactly as before. ModUpdate.statsLine builds the shared line;
the MODS tab reuses it. Parser, formatting, and parse coverage are tested.
2026-08-04 12:37:28 +01:00
bryanthaboi 3a6557ffe2 CLOSES #779 , CLOSES #743 + new font 2026-08-04 06:41:34 -04:00
Shane McGovern 6ea59f1a79 Show mod downloads and release dates in the launcher MODS panel
The MODS tab now shows each installed mod's total GitHub downloads
(summed asset download_count across all releases), its first and latest
release dates, and a Sort row (Name / Popularity / Release date /
Last updated) persisted in options.modSort.

The launcher already fetched per-repo release lists for update checks, so
the data rides the same cached fetch: parseRelease keeps download_count
and published_at, writeCache persists them, and a cache entry written
before the fields existed is treated as stale and refetched once instead
of hiding the line behind an old cache.
2026-08-03 22:17:56 +01:00
bryanthaboi 51fb4db82e Merge origin/main into dev; resolve Game.lua gamepad speed-hotkey conflict 2026-08-03 17:17:26 -04:00
bryanthaboi 7f78de8718 Merge pull request #574 from andrewqsantos/feat/switch-nx
Nintendo Switch / love-nx support (#531)
2026-08-03 17:08:54 -04:00
bryanthaboi 76aab74bf1 potentially CLOSES #758 2026-08-03 17:08:42 -04:00
bryanthaboi b831076839 CLOSES #592 2026-08-03 16:38:07 -04:00
Andrew Barnes 4a00f2335c Fix launcher save-slot panel overlap 2026-08-03 16:18:35 -04:00