Entry 94
The staff roll: the ending's credits as ccThStaffRoll runs them, checked frame by frame
Filescrates/piney-desktop/src/staffroll.rscrates/piney-desktop/src/lib.rscrates/piney-desktop/src/view.rscrates/piney-desktop/tests/staffroll.rscrates/piney-desktop/tests/staffroll_fixture.txtcrates/piney-game/src/desktop.rscrates/piney-game/src/mode.rscrates/piney-game/src/main.rstools/test_staffroll_rs.pydocs/engine/desktop.md
With story starts to the ending (93), story:31 reached the
instruction staff_roll. The desktop host had nothing for it: its wait
ended at once, and the credits never showed. The desktop page listed
ccThStaffRoll as unknown.
What the game does
The details are on the desktop page.
- The task.
ccThStaffRoll(desktop.prg 0x004125c0) loadsstfroll1and builds accThStaffRollCtrlof 19 lines. It playsBGM.BINtrack 1 and runsMainonce a frame until the controller is done. - The pages. There are 28 (
g_srDataGrp): credits and a picture, or a picture alone. - The four phases.
_Random. The view zooms in from 5 to 1. Every line shows 44 random characters (ccRand) and settles one more each frame into the credits (StopChar, the C library'srand, seeded by the frame count)._Fix. The random characters fade while the picture fades in behind the credits._End. The page holds for 110 frames, then shrinks and fades._BGOnly. A page with a picture alone fades in, holds and fades out.
- Names. A credit's
#0and#1are the save's two names (ccTransCode2Name).
The port
- The controller. piney-desktop's
staffroll.rskeeps the fields under their offsets' names and records each frame's draws.StaffRoll::renderdraws them with the port'sccKanji(theLargeFixedfont) and the page picture's mask. - The task.
Desktop::start_staff_roll: two breaths, thenMaineach frame, andccBgmPlay(1)/ccBgmStopas new requests. They reach the audio asEvent::BgmStreamandEvent::BgmStreamStop(Audio::bgm_stream,bgm_stream_stop). - The desktop host.
begin(StaffRoll)starts the task,busy(StaffRoll)waits for it, andenddoes nothing. - The layer centre. The layer's view needed a centre
(
LayerView::frame_centred:SetFramethenSetLayerCenter). - Ending music.
bgm_controlcame in 4d7a889.
Two mistakes the check caught
Except's column.v * 0x2aaaaaab >> 32is v / 6, and thesra 1after it makes it v / 12, the column. The first port used v / 6.- The picture's
MakePacketflag._Fixand_Endnever set$a2before the call; it still holds the 1 stored inwijust before. The first port passed 0.
Checked
- The whole roll against the game.
tools/test_staffroll_rs.pyruns the game's controller natively in eemu over all of it (7,231 frames, seed 12345, names Kite and Tester,ccRandas at boot). Only the drawing calls are hooked, and they are recorded. - What each frame keeps. The controller's words, every line's bytes,
and the draws (hashed). The fixture is 650 KB;
detail Nprints a frame in full. - The replay.
crates/piney-desktop/tests/staffroll.rsreplays every frame with 0 mismatches. - The view. The harness also runs the game's
ccView:SetFrameat one scale,SetLayerCenter, thenSetFrameat another (as_Randomand_Enddo each frame). All 36 points throughApplyLayerScreenMatrixmatchLayerView::frame_centred. So a laterSetFramekeeps the centre. - The rest. The workspace's tests, clippy, fmt and the docs check pass.
- Shots. From
story:31: "Story, Kazunori Ito" over Kite's picture, and the CAST page (the English voice actors in two columns).
Still unknown
- Not compared: the pixels and when music starts and stops. The glyphs come from the port's
ccKanji(checked for the desktop), and the picture from the port's sprite. The frame the ending song starts and stops is not compared. - The generators' state at the ending. The runtime startsccRandas at boot and seedsrandwith the desktop's own frame count, so the random characters differ from a console's. They look alike. - Created and never used.ccBufferSampling(+0x138c) and the second mask (+0x1358, left null). - The later volumes' staff rolls (stfroll2-4) are not tried.