Entry 616
The accuracy work to the clean-up's standard
6h 21mengine
Linked from F_Obj records as DecodeF_Obj sets them and the engine's glam matrices as the game's setters.
Files23 in 12 directories
vu0.rsvu1.rsanim.rslight.rsmodel.rsshadow.rscrates/piney-data/src/field/render.rscrates/piney-data/src/dungeon/mod.rscrates/piney-battle/src/geom.rsentry.rscrates/piney-effect/src/vu.rscrates/piney-desktop/src/anm.rscamera.rscrates/piney-desktop/src/shadow/draw.rsgif.rsvu1.rscrates/piney-world/src/chara/kite.rscrates/piney-world/src/systems/statics.rscrates/piney-world/src/town/mod.rscrates/piney-stream/src/draw.rsscene.rsdocs/engine/field.mdeffects.mdWorklogs 610-615 made the lights, the keyed rotations, the shadows, the desktop cursor, the model boxes and the new-game boot bit-exact. This entry reviews that code against plans/rust-cleanup.md and brings it up to the standard. It is a refactor: every harness, pin and shot is unchanged.
One home for libvu0
The accuracy work had added VU0 routines to piney_data::vu0, but older
copies stayed. _sceVu0ecossin and the rotations were written out seven
times (anim, piney-effect's vu, battle geom and entry, field
render, evcam, the map sprite), each with its own MulMatrix.
ApplyMatrix, the unit matrix and the vector ops had more copies still.
Each copy was checked to give the same bits as the kept routine (the extra
vadd with zero folds away).
piney_data::vu0now holdsecossin,rot_matrix_x/y/z,rot_matrix, the realmul_matrix(the old one re-exported anim'svu_mul),vdiv(sceVu0DivVector),scale_matrix, andccCoord's setterspos_rot_xyz_scale,pos_rot_zyx_scale,pos_rot_xyzandpos_rot_zyx. Before this there were seven setter copies, in effectvu, world ambient and town, stream scene, and Corbenik's two.- Battle
geomand worldeestay as their crates' maths preludes, but re-export vu0 under vu0's names. Battle'sapply_matrixandunit_matrix()are nowapplyandUNIT. - The glam conversions are now only
vu0::of_mat4andto_mat4. Gone: worlddraw::mat, combat bossmat4, the stream's and the desktop camera'sto_mat4, and three hand-writtento_cols_arrayloops. - Removed shims:
anim::ee, town'sLight/Falloff/LightKind/AnimLight,kite::SHADE, bossset_color, dungeoninversandhit::UNIT. Their users now namepiney_data::light,vu0andfield::ee. - The copied
c.eq.s(light, worldee, geom), theto_f64comparisons (eef, cinema) and vu1'svsubnow usefield::eeandvu0.
The light group
light_regsandset_light_matrixtake the group as an iterator.AddGrp's order is walked level by level (highest priority first, equal priorities in the order added), so a lit model no longer allocates a sortedVec.SetLightMatrix's three records are aSlot(priority, row) instead of a tuple.- One conversion from the VU1 registers to the draw's
Lights:piney_desktop::anm::model_lights. It replaces three copies (kite, the stream, the title). - Kite's shaded group is now a
mapover a chain, with no per-model allocation. StaticObjectskeeps each light as anObjectLightstruct instead of a tuple, and the town and story map refill a kept buffer each frame.
Poses, shadows, data
Animation::local_bits_atgives the locals as float bits. The poses no longer go bits to glam and back per object per frame.- The shadow kicks' triangles and quads are
Polygon<3>andPolygon<4>arrays, not aVecper polygon. - The box check's MAC mask is now a named constant.
- The shadow draw's scale matrices are
vu0::scale_matrix. - The shadow
directionisvu1::itof12thenvu0::vdiv. FogRow::ambient_bitsreplaces world dungeon's copy.VertexBoxis typed asV4.- The model's 16, 256 and 4096 are named constants.
checked_maxreadsMIN_TRANSPARENCY.- Comments: the pose
instancesdoc is cut to the cap; the docs name the modules that hold the maths (field.md "EE floating point", the effects module table).
ShadowTri::pixels stays in piney-draw. It states which pixels a shadow
request covers, which both backends need, so it is not the CPU renderer's
alone.
Checks
All on fe06078, the code of this entry:
- The sweep: 412 of 412 rc 0, each line as in
summary-main.txt. A harness replaced the worktree'stools/eemu_rs.sosymlink with a build; the symlink was put back and main's file is untouched. - Battle pins: 291 calls, 0 differ (probe wt-review at fe06078).
- Golden shots: a same-day base from a clean worktree of main 1aa226b
equals
world2/shots/base(4,550 files, 0 differ). The tip against that base: 4,550 files, 0 differ. The base worktree and its target were removed afterwards. - Crate tests: 786 passed, 0 failed. Two tests went with their copies; vu0's rotations and setters and the light group's order gained three.
- The piney-game suite: 351 / 0 / 153.
- Clippy on all targets and features: clean. fmt,
piney-gen gen,symsandcarry --check,cairns checkandtools/docs.py checkall pass.
Noticed, not changed
piney_desktop::anm::fobj_matrix builds an F_Obj record's matrix from
glam's host-float Euler turns. piney_data::anim::ObjRecord::pose builds
the same record through DecodeF_Obj's EE arithmetic. The desktop's F_Obj
objects may therefore be off in the last bits. This was not checked
against the game.
- Whether
fobj_matrixdiffers from the game anywhere. No harness compares a desktop F_Obj matrix word for word. - Piney-world's
ee, battle'sgeomand the desktop'seefremain as per-crate maths preludes. They re-export the one home and add only their own helpers. Whether the clean-up wants them folded into direct imports is the maintainer's call.