@@ -121,16 +121,28 @@ left and right panels can remain open together; opening only one shifts the
121121live world and its input anchor to the exposed half of the screen. Items move
122122directly between either owner without a second transfer path, and the fourth
123123retail save container restores exact Special Item cells on load.
124- ` S ` and the authored STATUS button open the first tab of the shared
124+ ` S ` and the authored STATUS button open the Status tab of the shared
125125Status/Magic window. The live Status page uses retail pattern 5 for its frame
126126and labels, then overlays the character identity, current pools, base and
127127equipment-adjusted physical and magical values, eight elemental affinities,
128128and the saved elemental marker. Its game-side profile ignores broken gear and
129129suppressed off-hand items; the UI only formats and draws the result. Status can
130130remain open beside Inventory, replaces Special Item on the left, shifts the
131131world and input by the same integer offset, and is closed together with other
132- open panels by Escape. The shared panel owner already has a separate Magic tab
133- state so that the next slice can add Magic without creating another window.
132+ open panels by Escape.
133+
134+ ` M ` and the authored top tab open the other half of that same owner. Magic uses
135+ retail pattern 6, four six-spell pages, authored icon wells, saved availability,
136+ level and experience arrays, and streamed Tables 16, 17, 27, and 600 through
137+ 621 . Learned icons can be dragged into eight saved slots and moved without
138+ duplicates. The always-visible bar above the HUD uses its original compact and
139+ selected icons, expands around the selected spell, and follows the retail
140+ full/left/right-panel positions. Clicking its final icon selects normal attack;
141+ every new or loaded gameplay entry starts there. UI code owns the page, hit
142+ rectangles, tooltip, and held icon, while ` game/player_magic.c ` owns spell data
143+ and applies the emitted selection or assignment. Samples 57 and 58 use a small
144+ general world-event queue and dedicated gameplay-interface assets before TAL
145+ plays them at the runtime edge.
134146
135147Choosing a retail save now restores more than its load-screen summary. The
136148` ShadowFlare0005 ` envelope is decoded and checksummed as a stream, so even a
@@ -228,8 +240,8 @@ it is invalid.
228240
229241## Current screen budgets
230242
231- The complete title currently uses 1,452,293 bytes of the 7 MiB main arena,
232- leaving 5,887,739 bytes free. Its screen-scoped artwork accounts for 1,101,182
243+ The complete title currently uses 1,454,573 bytes of the 7 MiB main arena,
244+ leaving 5,885,459 bytes free. Its screen-scoped artwork accounts for 1,101,182
233245bytes. The rest includes TWL/TAL state, game and screen metadata, persistent
2342468-bit menu music and effects, and one reusable 60,000-byte decode buffer. The
235247video pool contains only the 614,400-byte RGB555 framebuffer, leaving 3,579,904
@@ -242,22 +254,22 @@ nonblank case, all ten smoke streams together decode at most 57,864 bytes into
242254the same reusable buffer during one rendered frame.
243255
244256Character creation releases all title-only artwork before loading its own
245- assets. It uses 765,216 bytes of the main arena, leaving 6,574,816 bytes free;
257+ assets. It uses 767,496 bytes of the main arena, leaving 6,572,536 bytes free;
246258414,105 bytes of that total are character-screen artwork and font data. Shared
247259NJP parts are decoded only once even when several patterns reference them, and
248260a static character screen is not filled again until a visible state changes.
249261
250- The load-game screen uses 725,432 bytes of the main arena, leaving 6,614,600
262+ The load-game screen uses 727,712 bytes of the main arena, leaving 6,612,320
251263bytes free. Its screen-scoped artwork, font, and selected save preview account
252264for 374,321 bytes. Save headers stay in a fixed six-entry catalog, while only
253265the selected 391x114 thumbnail occupies memory. Changing selection decodes the
254266new preview into the same 89,148-byte RGB555 buffer; idle frames perform no
255267file access and do not refill the framebuffer.
256268
257- The complete Remote Town gameplay screen uses 5,199,068 bytes of the main
258- arena, leaving 2,140,964 bytes free. Its screen-owned scenario, script, map,
269+ The complete Remote Town gameplay screen uses 5,423,692 bytes of the main
270+ arena, leaving 1,916,340 bytes free. Its screen-owned scenario, script, map,
259271player, PEOPLE, ground-item, inventory-panel, equipment, and UI data and
260- artwork account for 4,847,957
272+ artwork account for 5,070,301
261273bytes. GND rendering data is decoded directly from its compressed three-plane
262274stream into two bytes
263275per tile, so the 300x300 town grid occupies 180,000 bytes instead of retaining
@@ -346,7 +358,7 @@ grid placement, single-item swaps, invalid-placement rollback, and partial
346358Gold merges all stay in ` game/inventory.c ` .
347359
348360The inventory and character panels follow the same lifetime. ` Status.njp ` is
349- streamed twice to retain only 33 required patterns, without constructing
361+ streamed to retain only 37 required patterns, without constructing
350362metadata for its other 115 patterns. Item definitions provide the inventory
351363group, pattern, and optional palette directly; only groups and cells referenced
352364by the active map's retained definitions are decoded.
@@ -364,6 +376,15 @@ fixed 9x10 owner but shares this pointer transfer and item presentation path.
364376Both panels can be open at once; their opposing integer camera offsets cancel,
365377while either panel alone leaves the other half as the live world.
366378
379+ Magic follows the same prepared-resource rule. Only the 23 required
380+ ` MagicIcon.njp ` patterns and 24 required ` MagicBarIcon.njp ` patterns are
381+ decoded when gameplay loads. The table scanner copies the 22 fixed MP/effect
382+ rows, experience thresholds, and bounded help lines into gameplay-owned
383+ storage, then discards the table stream. Panel rendering performs no file
384+ access, allocation, decompression, or format conversion. Its only normal-frame
385+ cost is composing the nine small gameplay-bar entries when that region is
386+ redrawn; the four-page panel is drawn only while open or visibly changing.
387+
367388The same held-item path now owns all nine visible equipment regions. Their
368389retail rectangles live in one small UI layout file, while category, subtype,
369390level requirement, swapping, equipped weight, and off-hand suppression remain
0 commit comments