Repository navigation
decomp: name hero control modes, levels, card states, the game camera and syscall stubs - #278
Merged
Merged
Conversation
Decompilation progress
No function changed its match state compared with main (1f76672). Compared with main (1f76672). C_FUZZY uses main's last measurement. |
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.
Before
Hero control modes, level indices and memory card states were raw numbers
(
state.control_mode == 0xD,current_level_index == 14,mode_freeze_state = 0x11). Three files named the card states after the dialogtext they draw (
MODE_FREEZE_ALTERNATE_LEFT_PAIRED_FOOTER_MESSAGE). Thecamera block at D_00186F40 was called
PreviewCamera, its shake channelswere padding or a local struct of
unkfields, and the level copy(
LevelCamera) hadunk180,unk184,unk270,unk350,unk394,unk398. 18 EE kernel stubs were namedinvoke_kernel_syscall_XXXX.After
Names come from rac1-decomp's recent refactor, each one checked against our
code before it went in. Nothing else of theirs was taken.
enum HeroControlMode(rnc/hero/hero_state.h): 18 values, named fromthe states
hero_set_statepairs with each one. 0x9, 0xA, 0xB, 0x10,0x13, 0x15, 0x16 and 0x18 stay numbers. 1493 compares and stores in 89
files use it.
enum LevelId(rnc/world/level_id.h, included byrnc/globals.h):names follow
config/us/levels/levels.json. 318current_level_indexcompares use it.
enum CardState(rnc/ui/menus/save_data/save_card_state.h): the game'sown
CS_*names, from the table of strings that follows the handler tablerun_state_handlerindexes (same order, 25 entries). The globalD_0015EEB0 is now
save_card_state(wasmode_freeze_state); the localMODE_FREEZE_*enums inupdate_mode_freeze.c,draw_dialog_text.candlevel_draw_dialog_text.care replaced by theCS_*values.PreviewCamera/preview_camerabecomeGameCamera/game_camera(the item preview files keep their own local view).New
struct CameraShake(rnc/camera/camera_shake.h), named fromapply_camera_shake;GameCamera.shake[2]replaces the padding.LevelCameragets the same names at the same offsets:current_cameraand
previous_camera(struct UpdateCam *: the code reads+0x30posand
+0x86from it), the shake offset and frames_max fields,transition_mode,rows,underwater,frame_count.assembly/sdk/syscalls/(file, yaml, symbol_addrs, unit_categories):
Interrupt2Iop,_iEnableIntc,iTerminateThread,iChangeThreadPriority,iReleaseWaitThread,iCancelWakeupThread,iResumeThread,iPollSema,SetGsHParam,DisableIntcHandler,DisableDmacHandler,DisableCache,iGetCop0,SetCPUTimerHandler,SetPgifHandler,ExecOSD,_GetGsDxDyOffset,FindAddress. Each number was read fromthe stub's
addiu $3, $0, Nand matched to the public ps2sdk syscalltable; the existing neighbours (0x29 ChangeThreadPriority, -0x34
_iWakeupThread ...) match the same table. 0x0, 0x8, 0x52, 0x56, -0x5A,
-0xFE and the 0x5A copies keep their old names: the table is not clear
for them.
Not taken: their function names from reading the code (about 800 rows),
the full moby class enum and the Wrench pvars. They need checking one by
one.
Verification
make elfends withPASS: reconstructed boot ELF matches retailmake overlaysends withPASSafter a clean overlay rebuild (3014 functions, 24318 data objects)scripts/check-cleanup.py: no new problemsclang -fsyntax-onlyon every changed file: no new errors