mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-25 23:11:15 +02:00
ca4d3d283c
Crystal boots from a user-supplied ROM, imports a full cache and is playable: copyright, the Crystal intro movie, the animated title, gender select, Oak, and out into Johto. 122 of the cart's 169 script specials are implemented. Import and data - tools/make_crystal_manifest.py derives the manifest by importing make_gold_manifest as a library, with three additive keyword seams. Gold and Silver still regenerate byte-identical, which is the standing requirement for touching that generator. - crystal_symbol_deltas.py and crystal_movie_symbols.py carry the symbol delta: Crystal renames the credits mons, splits the trainer card, Pokegear and pack-pal blocks by gender, and replaces the intro and title outright. - Crystal-only manifest keys: engineFlagOrder (162 flags to Gold's 93, so the badge block sits one higher) and unownCharmap (the main charmap parser stops at the first newcharmap so the two cannot contaminate each other). Extractor - RomExtractorGen2 becomes three-edition. Crystal corrections: PAL_MAP_BANK 0x13, a flat PICS_FIX pic bank, audio bank 0x5e, the mapSongs id-100 hole, seven NPC trades, a TradeTexts stride of 8, the five Crystal tileset anim steps with per-row degrade, and the column-major trainer card portraits. - New: animated front sprites (frames, bitmasks, play and idle scripts), the Battle Tower roster, Kris assets, Mobile System GB art, and the Crystal intro and title via src/import/CrystalMovie.lua. Engine - GameVersion gains engine(id) and fixes(id). Gold and Silver keep their original bugs where the bug is not hardware dependent; Crystal gets the fixes Crystal shipped: Lucky Number boxes 10-14, surfing onto an NPC, and the Reflect and Light Screen defence overflow. - Crystal story: Suicune and Eusine, Celebi behind the GS Ball flag, the Ruins of Alph chambers, Buena, the Move Tutor, the Poke Seer, and the Battle Tower including the wInBattleTowerBattle badge-boost guard. - Kris and the gender flag, animated fronts in battle and the summary screen, and mon caught data. Verification - Every extracted asset is pixel-compared against pret's own source PNGs. - Gold caches are byte-identical before and after, file for file. - New Crystal suites plus a T2 Gen 2 tier; the full suite passes.
102 lines
3.4 KiB
Lua
102 lines
3.4 KiB
Lua
-- The save editor's whole mutable world. Ops.lua is the only module allowed
|
|
-- to change the `save` sub-tree (and it always sets dirty + status together);
|
|
-- everything else here is view state -- which tab, which row, which page.
|
|
|
|
local State = {}
|
|
|
|
function State.new()
|
|
return {
|
|
-- loaded content
|
|
data = nil,
|
|
cat = nil, -- sorted species / items / moves id lists (Catalog)
|
|
events = nil, -- scraped EVENT_* / MOD_* flag names (Catalog)
|
|
save = nil,
|
|
path = nil,
|
|
validation = nil, -- what the running game would quarantine, on a copy
|
|
|
|
-- file state
|
|
dirty = false,
|
|
loadError = false, -- true when the save file exists but failed to decode
|
|
allowSave = true, -- false while loadError, until a successful Reload
|
|
_quitArmed = false,
|
|
_openArmed = false,
|
|
|
|
-- Which game this save belongs to, so the title bar can show the RED /
|
|
-- BLUE chip and the launcher can hand the editor the right slot. Set by
|
|
-- App.load's opts; nil in a bare `love . --editor` run.
|
|
version = nil,
|
|
slotId = nil,
|
|
modRoots = nil,
|
|
-- Hosted inside the launcher process (Edit on a save row) rather than a
|
|
-- standalone `--editor` window: Close returns to the launcher instead of
|
|
-- quitting, and App calls onClose() to do it.
|
|
embedded = false,
|
|
onClose = nil,
|
|
|
|
-- chrome
|
|
tab = "party", -- party|boxes|items|events|map|dex
|
|
status = "",
|
|
armed = nil, -- id of the destructive button awaiting confirmation
|
|
armedAt = nil, -- when it was armed (Ops.ARM_SECONDS to commit)
|
|
|
|
-- party / inspector
|
|
selectedParty = 1,
|
|
partyOffset = 0, -- roster scroll position (#715)
|
|
inspectorScroll = 0, -- MonEditor body pixel scroll (#715)
|
|
editingMon = nil, -- reference into party or a box
|
|
nicknameDraft = nil, -- text being typed in the inspector's nickname field
|
|
nicknameMon = nil, -- the mon the draft belongs to (nil for none)
|
|
-- species picker overlay: nil when closed, otherwise { query, offset }
|
|
-- plus mode = "box-add" when it is adding to a box instead of changing a
|
|
-- species (Ops.openBoxAddPicker). Modal in the literal sense -- App
|
|
-- shields every widget under it for the frame -- because Kit hit-tests
|
|
-- without a z-order (#541).
|
|
speciesPicker = nil,
|
|
|
|
-- item picker overlay: nil when closed, otherwise
|
|
-- { query, offset, dest = "bag"|"pc" }. Same modal contract as
|
|
-- speciesPicker above -- adding an item is now a full-screen picker
|
|
-- rather than a card competing for height inside the Items tab.
|
|
itemPicker = nil,
|
|
|
|
-- boxes
|
|
selectedBox = 1,
|
|
selectedBoxSlot = 1,
|
|
dockOffset = 0, -- party dock scroll position (#715)
|
|
|
|
-- items
|
|
itemQuery = "",
|
|
selectedItemId = nil,
|
|
selectedBagId = nil,
|
|
selectedPcId = nil,
|
|
itemPickOffset = 0, -- scroll position in the ADD ITEM list (#595)
|
|
bagOffset = 0,
|
|
pcOffset = 0,
|
|
itemsScroll = 0, -- stacked-layout pixel scroll (#715)
|
|
|
|
-- events
|
|
eventsTab = "flags",
|
|
eventFilter = "",
|
|
eventsOffset = 0,
|
|
|
|
-- dex
|
|
dexSort = "dex", -- how the DEX grid is ordered: "dex" (by number) | "name" (A-Z)
|
|
dexOffset = 0,
|
|
|
|
-- map
|
|
mapId = nil,
|
|
mapQuery = "",
|
|
mapListOffset = 0,
|
|
mapCamX = 0,
|
|
mapCamY = 0,
|
|
mapZoom = 2,
|
|
mapClickCell = nil,
|
|
}
|
|
end
|
|
|
|
function State.markDirty(s)
|
|
s.dirty = true
|
|
end
|
|
|
|
return State
|