Entry 610
The later discs' last harnesses, and gcmn's statics as the overlay loads
5h 53mbattleuiaudioworldvolumestoolingtest
Files31 in 9 directories
prim.rscrates/piney-data/src/dungeon/mod.rscrates/piney-data/tests/sound.rscrates/piney-desktop/tests/staffroll.rscrates/piney-fieldui/src/disp.rscrates/piney-world/src/dungeon/mod.rsdocs/engine/battle.mddungeon.mdfield-ui.mdsound.mddocs/formats/prg.mdtools/dungeon.pyrefscan.pysound.pytest_battle.pytest_battle_event_rs.pytest_battle_flow_rs.pytest_battle_frame_rs.pytest_battle_items_rs.pytest_battle_navi_rs.pytest_desktop_data_rs.pytest_dungeon_rs.pytest_effect_skill_rs.pytest_field_rt.pytest_fieldui_option_rs.pytest_fieldui_rs.pytest_fieldui_trade_rs.pytest_lights_rs.pytest_sound_rs.pytest_staffroll_rs.pyvolume.pyWhat failed
On main (934b942), the sweep still failed in four harnesses on the later discs:
test_dungeon_rs: 2 failures each on Mutation, Outbreak and Quarantine.test_enemy_weapon_rs: 1 failure each on Outbreak and Quarantine.test_sound_rs: 1 error each on Mutation, Outbreak and Quarantine (IndexErrorinsound.load_bgm).test_staffroll_rs: 1 failure each on Mutation and Outbreak, and 1 error on Quarantine (noSetLayerCentersymbol).
None of the four was a port bug. Following the weapon failure turned up
one in 607's work instead. The harnesses build the game's memory from
the PRG file, and they never run what mwLoadOverlay runs after the read.
gcmn's statics as the overlay loads
ccPrimPacket::makePacket sets ADC on a pair that starts a run, has a
point behind the eye, or has both points off the screen.
- Infection and Mutation compare with
slti5633 and 4609 (INF gcmn 0x004386dc, MUT 0x0044e07c). - Outbreak and Quarantine read two gcmn statics and shift them left by 4 (OUT makePacket 0x00449100 reads 0x006dc5a8 and 0x006dc5b0; QUA 0x0033ba10 reads 0x005d4fa8 and 0x005d4fb0).
The PRG holds both words as 0. test_enemy_weapon_rs ran makePacket on
the file's image, so its bounds were 0, and every pair off the screen's
centre carried ADC. 607 read the condition icons' y the same way (OUT
Disp 0x00539ad8 reads 0x00720c90, QUA 0x0042c3e8 reads 0x00619690). It
found the word 0 in the PRG and no store in the code, so it moved the
icons to the screen's top on those two discs.
mwLoadOverlay (INF main 0x001002c0, OUT 0x001002e0) does more than read
the file:
mwBloadreads the whole file to the load address. The PRG has no relocation table. Besides text and data it holds only its 0x40-byte header: magic, id, load address, text, data and bss sizes, the constructor table's bounds and the name. So nothing relocates the image.- It calls
FlushCache(2). - It clears
bss_sizebytes past the file. __initialize_cpp_rtsruns the static initialisers in the constructor table. CodeWarrior puts them at the tail of.data, just before the table.
Outbreak's and Quarantine's gcmn has four initialisers:
| OUT | QUA | writes |
|---|---|---|
| 0x0073d680 | 0x0063a200 | 0x006dc5a8 = (int)(96 + (int)(f[0x006dc600] / 2.0)); 0x006dc5b0 = the same of f[0x006dc5f8] (QUA 0x005d4fa8 and 0x005d4fb0, from 0x005d5000 and 0x005d4ff8) |
| 0x0073d6f0 | 0x0063a270 | ccDamUprStr's list root (main) |
| 0x0073d730 | 0x0063a2b0 | 0x00720c90 = 352 - [0x00720c88] (QUA 0x00619690, from 0x00619688); menuList's 93 constructors |
| 0x0073d790 | 0x0063a310 | ccSPC::Initialise on ccSpcManager |
On both discs the PRG holds the three source words as 512.0, 384.0 and 32.
I ran each disc's own mwLoadOverlay on the disc's GCMN.PRG in eemu (the
Rust machine), then read the words:
- First the overlay window was filled with 0xa5, so any word the loader did not write would show.
mwBloadwas given the file's bytes, andFlushCachedid nothing.- Everything else was the game's own code.
| disc | across | down | icons' y | file bytes the load changes |
|---|---|---|---|---|
| Infection | literal (slti 5633) | literal (4609) | literal 320 | 0 |
| Mutation | literal (5633) | literal (4609) | literal 320 | 0 |
| Outbreak | 0x160 = 352 | 0x120 = 288 | 0x140 = 320 | 6, the three words |
| Quarantine | 0x160 = 352 | 0x120 = 288 | 0x140 = 320 | 6, the three words |
The neighbours after the load:
- Before 0x006dc5a8 is the jump table
@864(0x004488f0 ...). The words at 0x006dc5ac, 0x006dc5b4 and after are 0. - Around 0x00720c90 come 32, 0, 32, 0, then 0x140, 0, then "PERSONAL".
- Infection and Mutation have no such words: they compare with literals,
and their three initialisers write only
.bssand main.
So on every disc the bounds are 352 << 4 = 5632 and 288 << 4 = 4608, and the icons' y is 320.
tools/refscan.py missed the stores because it read only the overlays'
text as code. It now scans the initialisers too, and finds one store for
each word, in the initialisers: OUT 0x0073d6b8 and 0x0073d6e0, and QUA
0x0063a2cc for the icons. Nothing writes the source words: only the
initialisers load 0x006dc600, 0x006dc5f8, 0x00720c88 and Quarantine's
three.
The port changes:
- The icons. 607's
party_icons_yis gone.PARTY_ICONS_Yis 320 on every disc, as the port had it before 607. - makePacket.
pair_continueskeeps Infection's bounds on every disc, with the initialiser in its comment. Earlier in this work the branch had made them per volume (0 on Outbreak and Quarantine, which hid the weapon trails and the boxes' rays there). That is reverted. - The harnesses.
volume.overlay_init(m, prog)runs the overlay's initialisers on a harness machine and keeps their writes to the overlay's.data. The objects they build in.bssand main (menuList,ccSpcManager, the damage list) are left as each harness sets them up.test_battle.GameBattleandtest_fieldui_rscall it. - docs/formats/prg.md ("Loading"), docs/engine/battle.md and docs/engine/field-ui.md ("The condition icons' static") carry the proof.
The four harnesses
- test_enemy_weapon_rs. As above: its machine now has the loaded
.data, and its probe and the port are main's. - test_dungeon_rs.
- Its "e" rule queries asked the port for the volume's own rule but
asked
dungeon.pyfor Infection's ("alt"). From Mutation on,SetDungeonTypeFromFieldhas the "plain" rule (MUT 0x001b1a20, OUT 0x001a77c0, QUA 0x001aefd0;test_dungeon.pychecksdungeon.pyagainst each). The query now usesData.type_rule, read from the code. - It asserted 88
EditDungeonrows. From Mutation on, the constructor's bound is 90. - The last two rows' ROOMDATA tables (areas 118 and 119, MUT gcmn
0x006c31e0 and 0x006c3c40) have no carried name. piney-gen calls them
rooms_<address>, anddungeon.pycalled them by the bare address.dungeon.pynow uses piney-gen's name. - The fog test allowed one bit in
SetAmbient(row / 255), becauseFogRow::ambientdivided in IEEE. The runtime already used the EE'sdiv.s(ambient_bits). NowFogRow::ambientdoes too, and the test is exact. Only piney-viewer read the old value.
- Its "e" rule queries asked the port for the volume's own rule but
asked
- test_sound_rs.
sound.Program.wordssized tables by their carried symbols, which keep Infection's sizes.bgmParamis 16 bytes on Infection and 64 from Mutation on (eight rows: MUT main 0x0031cce0, OUT 0x00314a10, QUA 0x00208990).bgmWavTblmoved to main with eight tracks (MUT 0x0031e840).wavPlay(MUT 0x00181750) indexes both by the track.sound.Program.rowsnow sizes a later table as piney-gen'splacement::sound::extentdoes.commseTbl's padding grew on Outbreak (0x00314af8), so only its first three words are read.
- The voice rows were read by Infection's names (
evVoiceDataVol1M...), which name other data on the later discs.sound.event_tablesreadsccEvVoiceRequest's tables from each volume's code (INF main 0x0017e810, MUT 0x00181910, OUT 0x00181620, QUA 0x001816e0): the lui/addiu bases before eachvoiceFilestore.- On Infection, every table it finds starts at an
evVoiceDatasymbol, and every array with rows is a whole VOICE_DATA object.
- There is a fixture per disc (
sound_fixture.txt,_mut,_out,_qua), and the Rust test checks each disc against its own. - New: every message every event script can open runs through the
game's
ccEvVoiceRequestandevVoicePlay(tools/evscript.py), in both languages and in Parody Mode.- The line they send is the table row: 1,322, 1,640, 2,592 and 3,096 voiced lines on the four discs.
- No message is past its event's array. So the rows the tables keep past an array's end are never asked for. (On Outbreak, EVVOL3SE's event 266 array is one row in .sdata at 0x003862f8; its script has one message.)
- test_staffroll_rs. It stored
volumeNum1 and kept one fixture.- Each disc now runs with its own number against its own fixture
(
staffroll_fixture_mut.txt,_out). The Rust test runs all three, and the port matched both later rolls with no change. - Quarantine's desktop.prg has no staff roll: no
ccThStaffRollsymbol, and nostfrollscene name in the file. The harness checks that, and the Rust test checks that the generated tables hold none. Quarantine's ending runs its roll in the field, throughending_kanji(RollCase, piney-event).
- Each disc now runs with its own number against its own fixture
(
The harnesses outside the sweep
The sweep picks up a tools/test_*_rs.py that names PINEY_VOLUME. Eleven
harnesses did not name it, and the sweep read no tools/test_*_rt.py. All
of them already ran on the volume's disc:
| harness | how it follows the volume |
|---|---|
| test_battle_event_rs, _flow_rs, _items_rs, test_desktop_data_rs | import volume |
| test_battle_navi_rs | import volume. It read Mac Anu's dummies from Infection's DATA.BIN; it now uses volume.DATA |
| test_battle_frame_rs | test_battle_rs's game. The operation byte is saveData+0x6773 on every disc |
| test_effect_skill_rs | test_effect_rs's game |
| test_fieldui_option_rs, _trade_rs | test_fieldui_rs's game |
| test_lights_rs | test_stream_rs's game and test_world_rs's probe |
| test_field_rt | test_world_rs's game and ISO |
| test_dungeon_rt | import volume; it already named the variable |
None of them is specific to one volume by design. Each now names
PINEY_VOLUME, and scratch/sweep/sweep.sh also takes
tools/test_*_rt.py: 89 harnesses, 356 runs. Before the marks, all twelve
passed on all four discs.
Checks
At cdf8a59 (the code of this entry):
- The sweep. 356 runs, none failing. On main's (304 runs):
- These 10 now pass:
test_dungeon_rsMUT, OUT and QUA;test_enemy_weapon_rsOUT and QUA;test_sound_rsMUT, OUT and QUA;test_staffroll_rsMUT and OUT. test_staffroll_rsQUA passes too, which makes 11 of main's 11 failures.- Nothing that passed on main fails.
- The 52 new runs all pass: the 11 newly marked harnesses and
test_dungeon_rt, on four discs each. test_piros_rsandtest_stream_rsare fixture writers with rc 0 and no test line, as on main.
- These 10 now pass:
- Battle pins. 291 calls, 0 differ. The probe is the worktree's.
- Golden shots. I shot a base today from 934b942 in its own worktree
(removed after). It matches
world2/shots/base: 4,550 files, 0 differ.- Against that base, the tip has 22 differences, all
macha_shotsfrom frame 6670 on: the condition icons go back over the panels. - Against the base 607 compared with (2d2b796, shot today), the tip has 0 differences in 4,550 files.
- The per-volume makePacket bounds this branch first had would have changed 25 Outbreak and Quarantine shots: their weapon trails and rays went missing. With main's bounds those files are as in the base (2,732 files reshot, 0 differ).
- Against that base, the tip has 22 differences, all
- Tests and tools. Crate tests (world, data, desktop, battle, effect,
event, audio, fieldui): 42 ok, 0 failed. The piney-game suite: 349
passed, 0 failed, 153 ignored.
gen --check,syms --checkandcarry --checkare current. clippy (all targets and features) has 0 findings. fmt,cairns checkanddocs.py checkare clean. - Regenerations for main. None: the tables, syms and carry are unchanged.
test_lights_rscompares the light group within 1e-4 for directions and 1e-5 for colours. Compared exactly, 309 of its 400 random groups differ in the last bits of a direction. piney-world'slight_matrix(chara/kite.rs) works in glam's f32, where the game uses EE and VU0 arithmetic:ccDrawEnv::SetLightMatrix(main 0x00105900);ccOmniLight::CheckRange(0x00139830);ccDirectLight::CheckRange(0x00139330);ccDistantLight::CheckRange(0x00139170);ccSpotLight::CheckRange(0x001395b0).
- closed by #612
test_dungeon_rtcompares a keyed rotation's hit matrices within 1e-5 for rotation and 0.05 for translation. The largest difference is 12,288 ULP on the later discs and 8,192 on Infection, over 7,961 such hits per later disc.piney_data::animinterpolates keyed rotations in double precision, where the game uses its own single-precision arithmetic (_AnimateForward). The harness also skips one case on each disc, "roomless rows walked into by the door path". test_fieldui_rswith every write of gcmn's initialisers kept: three chat-member tests then differ on every disc.ccSPC::Initialise(INF gcmn 0x0059f5f0) puts Kite in slot 0, sets the count to 1 and the other slots to -1.- With the damage list's root also built, the game's chat member window has four rows where the scenario's port has one.
- The scenario sets
ccPartyManager, notccSpcManager. Sooverlay_initkeeps only the.datawrites, and it is open which state ofccSpcManagera real party in a town has there.