Entry 347
"Ryu Books IV to VIII: their pages, lists and keys, each run against the game"
This entry answers the question left open by Ryu Books begun, a voice row outside its table, condition effects on the flute and on a foe struck with the party gone.
Filescrates/piney-fieldui/src/book/pages.rscrates/piney-fieldui/src/book/mod.rstools/test_fieldui_rs.pycrates/piney-game/src/session/tests/fairy_orb.rsdocs/engine/field-ui.md
317 ported Books I-III and left IV-VIII's pages: their DispNN,
CheckItemGetNN, and PadControl04, 05 and 08. The rewards
(GetBookNNItem) were already in. A player opened Book IV (issue #23,
and the user's own run): an empty window, and the game stuck.
BOOK::PadControl closes the book on cancel only once wait is 0, and
wait (15 at the start) is counted down only by the page's own keys,
which IV-VIII did not have.
All five are now ported (INF gcmn, the reference in
field-ui.md).
tools/test_fieldui_rs.py gains test_book_4 to test_book_8. Each runs
the game's own ccThBook in eemu beside the port, frame by frame, over
every sprite packet, kanji row, message state and sound. Every one
passes, along with the harness's other 60 tests. A one-pixel change to
Book VI's count column fails its test at once.
What the code showed, where it was not what one would guess:
- Book IV (
Disp040x00415790): the list's search for the next enemy slain runs to 304, one past the 303 rows. Row 303's kill count is thenBOOK.checkValue[2], whichDrawzeroes each frame, so it is never taken. The sub-window shows the enemy'senemyTblrow:base.level,max_hp(10000 or more spelled out ofcheatHpStr),max_sp, the spellsmag0/mag1(skill+0x70, +0x74), the threeitems, and a weakness from the protect points (max_pp-1, elsep_def_ppagainstm_def_pp). Its help line names where one was last slain:enemyKillArea(+0x69f0, server and three words) between#Band#W. The sub-window's column starts 40 higher than the list, which a first try got wrong and the harness caught. - Book V (
Disp05,PadControl05): off the list the cursor moves with the held buttons (ccSys+0x2cc), not the pushed ones,keyWaitletting a hold through every third frame. The harness's first scenario pushed DOWN and the game did not move; the emulator'sBOOKfields showed every gate open, which led to the read of +0x2cc. Book V's help setsBookHelp50's second and third strings to NULL in place. - Book VI, VII (
Disp06,Disp07): counter rows like Book II's, the count at a fixed 250 or 182. VII's first two rows say "encountered" (bookEncountMsg), and its third row stands a line lower. - Book VIII (
Disp08,PadControl08): a menu with the Grunties (ccGetNpcParam(145 + i)) and their food (gimmickTbl[22 + i]); each page resizes the window by writing the globalBookOfs. In the food list's help the count'ssprintfis overwritten by thestrcpyafter it, so the line is the food's name andbookPuchiFood. On the food page the total moves down by repeat and up by the held buttons, and the list's "none above" setskeyWaitwhere IV's and V's do not.
the_later_ryu_books_open_and_close opens each of IV-VIII in Mac Anu
through PERSONAL's Key Items and closes it with cancel.
the one-frame difference in the message window's mode just after a book closes (frame 471 of test_book_8 when run past its closing frame; Books I-VII's scenarios also stop on that frame); the cover's palette from the second book on ([[317]], [[318]]).