Repository navigation
refactor: name the vibration code, a camera shake and hero fields and states after Going Commando - #248
Open
Promises wants to merge 5 commits into
Open
refactor: name the vibration code, a camera shake and hero fields and states after Going Commando#248Promises wants to merge 5 commits into
Promises wants to merge 5 commits into
Conversation
actuator_CalcPower is the same mixer as Going Commando's LevelActuatorCalcPower (OpenRAC's rac2-decomp), so its slot record and locals take that function's names: - L00Entry becomes ActuatorWave, with kind, output, multiply, delay, duration, frame, rise, fall, amplitude and bias, and an enum for the six wave shapes. kind stays a halfword: Going Commando reads byte 1 as a separate `permanent` flag, here the duration always counts down. - PadState's two bytes at 0x188 and 0x189 are small_motor and large_motor. The poll clears them and never sends them, as sceVibSetActParam was dead-stripped. - The debug menu's Actuator flag is actuator_enabled, as the NTSC decomp names it. Names, types and comments only: the compiler's output for every touched file, and for its PAL v1.00 and NTSC-U spliced units, is the same as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…istance func_L07_003134B8 took the NTSC decomp's name rumble_by_distance, but it never touches the pad. It writes the camera block: debris_far_point is the camera's position (CameraSystem.pos, +0x140), and the two stores from that base minus 0x140 are shake[0].amplitude (+0x160, up to 0.1, none from 80 units away) and shake[0].frames (+0x168, 20). The name is a clash row in config/names_local.tsv, carried into names.tsv, names.h and the sources with tools/names.py local and rename. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hero's word at 0xA64 is set by emit_filtered_entry_sparkles the first time a wrench swing's hit spheres find a moby, which plays the hit sound once per swing. HeroEnterMoveState (and each level's copy of it) clears it as each melee state starts: the wrench combo, slam and crouch swing, the held-item attack, the grind attack and the attack-record states. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hruster-Pack hover states Four hero states take names from the code that enters them: - 0x08 was LAND. The hero enters it from a fall with Cross held, more than 0.6 above the ground, once the Heli-Pack is owned and while the Hydro-Pack is not on his back; it falls slowly (gravity 0.72 of the step), at 3 a second, or 5 with the Thruster-Pack, and plays the pack's sound. It is the pack glide: HERO_STATE_PACK_GLIDE. - 0x81 was DELAYED_JUMP_OR_R1_REPEAT_EXIT_WAIT. A double tap of R1 with the Thruster-Pack on his back enters it; it holds him 0.17 above the ground on a spring (higher, he sinks slowly) at up to 5.75 a second: HERO_STATE_THRUSTER_HOVER, as OpenRAC's SDK calls it. - 0x11, new: Cross while wall_jump_window is open, from a jump, a run jump, a wall jump or a glide begun from one: HERO_STATE_WALL_JUMP. - 0x35, new: R1 or R2 held while swimming once the Hydro-Pack is owned: HERO_STATE_HYDRO_PACK_DASH. The two new members are not written into their use sites yet: the hero_states tidy has other conversions pending on main, kept out of this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it blame Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The controller vibration code now has names.
actuator_CalcPoweris the same mixer as Going Commando'sLevelActuatorCalcPowerin OpenRAC's rac2-decomp, so its record and locals use that function's names. I found this while building a rumble mod.L00Entryis nowActuatorWave, with the fieldskind,output,multiply,delay,duration,frame,rise,fall,amplitudeandbias. I checked each one by its offset and by how the function uses it. The six wave shapes are nowenum ActuatorWaveKindconstants, which replace thecase 0..case 5numbers. The struct name follows the globalactuator_waveand the NTSC decomp's newer header.kindstays a halfword. Retail loads and clears offset 0 withlh/sh. Going Commando reads byte 1 as its ownpermanentflag, but here the duration always counts down. A comment at the countdown says so.PadState, the bytes at 0x188 and 0x189 are nowsmall_motorandlarge_motor. That is how Going Commando's poll sends them throughsceVibSetActParam(small motor on/off, large motor 0..255). Here the poll only clears them, becausesceVibSetActParamwas dead-stripped. The comments inpad.h,pad.canddocs/game/data-structures.mdsay so.actuator_enabled, the NTSC decomp's name for it. That coversdebug_menu_and_text.cand therun_level_main_loopstore that turns it on.config/data_types.tsvandconfig/data_in_c.tsvfollow the type rename.This changes names, types, comments and one enum only. The compiled output is unchanged.
Further commits found while scanning Going Commando's rumble code. I checked each name against RAC1's own code.
Camera shake, not rumble (
refactor(l07))func_L07_003134B8had the NTSC decomp's namerumble_by_distance, but it never touches the pad.debris_far_pointis the camera's position (CameraSystem.pos, +0x140), and the function writesshake[0].amplitude(+0x160) andshake[0].frames(+0x168) from 0x140 before it. The amplitude is up to 0.1 at the camera and none from 80 units away, for 20 frames. It is nowcamera_shake_by_distance. I added it as aclashrow inconfig/names_local.tsvand carried it through withtools/names.py localandrename.names.pyalso put the address name back ininclude/overlays/l07_umbris/taxi_platform.h, because declarations keep the address name.Wrench hit latch (
refactor(hero), 0xA64)unkA64is nowwrench_hit_latch.emit_filtered_entry_sparklessets it the first time a swing's hit spheres find a moby, so the hit sound plays once per swing.HeroEnterMoveStateand each level's copy of it clear it as each melee state starts: wrench combo, slam, crouch swing, held-item attack, grind attack and the attack-record states. The rename touches 44 files, version copies included.Hero states (
refactor(hero))LAND→HERO_STATE_PACK_GLIDE. The hero enters it from a fall with Cross held, more than 0.6 above the ground, once the Heli-Pack is owned and while the Hydro-Pack is not equipped. In this state he falls slowly (0.72 of the step) at 3 units a second, or 5 with the Thruster-Pack, and the pack's sound plays.DELAYED_JUMP_OR_R1_REPEAT_EXIT_WAIT→HERO_STATE_THRUSTER_HOVER. A double tap of R1 with the Thruster-Pack equipped enters it. A spring holds him 0.17 above the ground; when he is higher, he sinks slowly. OpenRAC's SDK already calls this state the Thruster-Pack's hover.HERO_STATE_WALL_JUMP= 0x11. Cross whilewall_jump_windowis open, from a jump, a run jump, another wall jump or a glide begun from one.HERO_STATE_HYDRO_PACK_DASH= 0x35. R1 or R2 held while swimming, once the Hydro-Pack is owned.A comment in the header lists the NTSC decomp's names for these four values. The two new members are not yet used at their call sites.
tools/tidy/hero_states.pywould do that, but it also has 96 unrelated conversions pending on main, so I kept it out of this PR. The two rename commits (0xA64 and the states) are listed in.git-blame-ignore-revs.Validation
I don't have the PAL v2.00, PAL v1.00 or NTSC-J discs, so
tools/check_all.shcould not run (it needsbaserom/). In its place:Compiler output, before and after, for the whole tree. I compiled the game's C with its compiler (
ee-gcc2953v1.14 under Wine in therac1-buildcontainer,-O2 -G2 -Iinclude -Wa,-I,.plus each file'sconfig/file_cflags.txtflags,-S) on upstream84bd565fand on this branch:src/, exceptsrc/libgccand the data files other than the actuator's block, which got a placeholder.inc;tools/version_src.py'sspliced()with all of that version's definitions.675 of 678 units compiled, and all 675
.sfiles are identical apart from the.filepath line. The 3 that did not compile fail the same way on both trees:kprintf.c,printf_rand.candsprintf.care 2.9-ee units that need itsstdarg.h, and this branch does not touch them. Everything after the compiler is a text pass over that.s, so the objects are identical too.Checks that run without a disc:
gen_progress_report.py --checkandversion_sync.py check(reports current, versions in step, nothing to commit),move_src.py --check,check_docs.py,data_in_c.py check,fakematch_scan.py --check,check_no_retail.py,names.py check,overlay_rename.py --check,ratchets.py --check(no count went up),format.py --check(clang-format 22.1.8),check_syntax.py(13 known errors, as on main) and all 402 tool tests. All of these passed.Not run: the full build, link and image comparison against retail for any version,
overlay_remnants.py --check(needs the level dumps) andversion_sync.py run.