migrate main segment data, rename some files, and various cleanup - #70
migrate main segment data, rename some files, and various cleanup#70Drahsid wants to merge 2 commits into
Conversation
| var_t3 = gActors[actor_index].var_158 / FIXED_UNIT(1); | ||
| gActors[actor_index].var_15C = gActors[actor_index].unk_114 * 393216.0f; | ||
| gActors[actor_index].var_160 = gActors[actor_index].unk_114 * -65536.0f; | ||
| gActors[actor_index].var_160 = gActors[actor_index].unk_114 * (f32)FIXED_UNIT(-1.0); |
There was a problem hiding this comment.
nit: was this indentation intentional?
| scale_2 = vals[2]; | ||
| scale_2 += gActors[actor_1].var_154 / 65536.0f; | ||
| scale_2 += gActors[actor_index].var_154 / 65536.0f; | ||
| scale_2 += gActors[actor_1].var_154 / (f32)FIXED_UNIT(1.0); |
There was a problem hiding this comment.
Is this an instance where FROM_FIXED((f32)gActors[actor_1].var_154) here and TO_FIXED() below would be preferable?
There was a problem hiding this comment.
TO_FIXED doesn't work due to casting, but FROM_FIXED worked fine.
| angle = gActors[actor_index].unk_16C / FIXED_UNIT(1.0); | ||
| gActors[actor_index].velocityX.raw = Math_ApproachS32(gActors[actor_index].velocityX.raw, COS(angle) * 98304.0f, FIXED_UNIT(32.0/256)); | ||
| gActors[actor_index].velocityY.raw = Math_ApproachS32(gActors[actor_index].velocityY.raw, SIN(angle) * 65536.0f, FIXED_UNIT(32.0/256)); | ||
| gActors[actor_index].velocityY.raw = Math_ApproachS32(gActors[actor_index].velocityY.raw, SIN(angle) * (f32)FIXED_UNIT(1.0), FIXED_UNIT(32.0/256)); |
There was a problem hiding this comment.
nit: inconsistent indentation
|
suggested renames:
I also have a few renames of scripts in #63 , |
Co-Authored-By: queueRAM <129774+queueRAM@users.noreply.github.com>
|
For any of the renames which have ambiguity between this and #63, let me know and I'll revert them here. I think it's mostly just the player/marina stuff. |
I have migrated all of the main segment data/rodata/bss to C, which is the vast majority of this PR. In doing this, I also did a bunch of minor cleanup:
// BUG: inconsistent prototype!at declaration; and// BUG: incorrect prototype!before header includessrc/texturesI also renamed the following files and their relevant headers, though if you have better ideas, let me know:
156F0->actor_physics: this file primarily has code doing actor velocity, position, physics callback tables, platform, and screen-space updates.26A00->asset_loader: this one pretty straightforwardly is responsible for DMAing assets134E0->collision_query: this has point/edge probes into the stage collision map and the code which reads the shape and collision flagsgameover->continue_screen: more consistent with other file names and the behavior within the filecosineTable->cosine_table: snake_casefloatTable->cosine_table_unused: snake_case and better describe contentsstage->frontend: this has intro/title, debug sound and stage menus, world map, progression, ranks/times, transitions, and records screens; so I thinkfrontendortop_menuare probably betterglobals->game_globals: make name slightly less ambiguoussoft_reset->game_init: this isn't just used for soft reset (GameState_Loading is in here, for example,) this is really mostly code for initializing the game statetext->game_text: make name slightly less ambiguous and also make it more distinct fromfontandosd_debug_text82DB0->marina_graphics: small file with the goal of decompressing marina's graphics5E230->overlay_abi: this only has functions which wrap the overlay abi59EA0->particles: this seems to exclusively deal with particle-effect actors48A30->marina_action_dispatch: I believe this is related to special input commands and/or guest/child player logic. SeeD_800BE5F4andD_800D3D204FEB0->player_actions: code for Marina's core movement; grab, dash, shake, throw, etc. The actual behavior/state machine.12DD0->player_control: this resets and initializes Marina's input state, and handles camera and scrollingA540->render: this seems to be the primary rendererE44A0->render_setup_data: this contains data used to setup the rendering; seems similar and is probably derived from an sdk demo, though I didn't check438E0->stage_runtime: this has code for the lifecycle of a stage (setup, step, exit)11820->stage_tilemap: this builds the 16x16 collision-byte map and maintains the visible 10x7 midground/environment/background tile grids17A70->actor_update: the single purpose of this file is the actor update functionsThe newly introduced files are:
actor_attachment_offsets: data which seems to contain fixed-point offsets for child actors or attached actorsactor_query_data: seems to store/query data on the nearest actoraudio_data: mostly unused data (strings); likely part of music.c but I was able to split heregraphic_lists: most of the game's lists of graphic indicespalette_data: most of the game's palettesstacks: game stacksNote that I also have some ideas for naming other files. I'm not as confident in these, but maybe we can workshop something:
80D90appears to be related to rigging multi-part actors82920appears to specifically be the rig for the cat8F080I think this is all Calina and her magical girl transformation74A50appears to mostly contain code for hostile enemiesEdit: I used
git mvon all the files I renamed, but I guess some of these appear as file deletions and additions for some reason.