diff --git a/src/audio/banks/snd_bank_load_by_loc.c b/src/audio/banks/snd_bank_load_by_loc.c index 5f36455305..6d8b87b4da 100644 --- a/src/audio/banks/snd_bank_load_by_loc.c +++ b/src/audio/banks/snd_bank_load_by_loc.c @@ -16,7 +16,7 @@ extern s32 sceSifCallRpc(void *, s32, s32, void *, s32, void *, s32, void *, voi s32 snd_bank_load_by_loc(s32 location, s32 arg1) __asm__("FUN_0012df20"); -s32 snd_bank_load_by_loc(s32 location, s32 arg1) { +s32 snd_bank_load_by_loc(s32 location, s32 byte_offset) { snd_cd_load_error = 0; if (snd_cd_callback_pending != 0) { printf("snd_BankLoadByLoc: Load already in progress!\n"); @@ -26,7 +26,7 @@ s32 snd_bank_load_by_loc(s32 location, s32 arg1) { printf("snd_BankLoadByLoc: CD BUSY!\n"); return 0; } - snd_cd_bank_load_request[1] = arg1; + snd_cd_bank_load_request[1] = byte_offset; snd_cd_callback_arg = 0xFFFFFFFF; snd_cd_bank_load_request[0] = location; while (SceSifCheckStatRpc(D_0015EBE8) != 0) { diff --git a/src/audio/banks/snd_unload_bank.c b/src/audio/banks/snd_unload_bank.c index 4092067589..55d947c7d7 100644 --- a/src/audio/banks/snd_unload_bank.c +++ b/src/audio/banks/snd_unload_bank.c @@ -3,9 +3,9 @@ extern s32 snd_send_iop_command_no_wait(s32 cmd, s32 size, void *buf, s32 a, s32 b) __asm__("func_0012E6E0"); void snd_unload_bank(s32 arg0) __asm__("FUN_0012e1d8"); -void snd_unload_bank(s32 arg0) { +void snd_unload_bank(s32 bank_handle) { u8 sp_slot[0x10]; - *(s32 *)sp_slot = arg0; + *(s32 *)sp_slot = bank_handle; snd_send_iop_command_no_wait(6, 4, sp_slot, 0, 0); } diff --git a/src/audio/decoder/audio_dec_create.c b/src/audio/decoder/audio_dec_create.c index ef2c8b8ade..430a313ce0 100644 --- a/src/audio/decoder/audio_dec_create.c +++ b/src/audio/decoder/audio_dec_create.c @@ -7,7 +7,7 @@ extern s32 snd_init_movie_sound() __asm__("FUN_0012f068"); extern void fast_mem_zero16() __asm__("func_001F9810"); s32 audio_dec_create(struct AudioDec *dec, s32 buffer, s32 buffer_size, s32 arg3) __asm__("FUN_0023abd0"); -s32 audio_dec_create(struct AudioDec *dec, s32 buffer, s32 buffer_size, s32 arg3) { +s32 audio_dec_create(struct AudioDec *dec, s32 buffer, s32 buffer_size, s32 globals_address) { s32 movie_handle; s32 three; s32 four; @@ -26,7 +26,7 @@ s32 audio_dec_create(struct AudioDec *dec, s32 buffer, s32 buffer_size, s32 arg3 dec->totalBytesSent = 0; dec->iopZero = 0; dec->spuPos = 0; - D_001612BC = (struct Globals_001612BC *)arg3; + D_001612BC = (struct Globals_001612BC *)globals_address; four = 0x400; dec->iopBuffSize = four; movie_handle = snd_init_movie_sound(0x400, 0x1000, 0x400, 0, 5, 3); diff --git a/src/audio/decoder/audio_dec_delete.c b/src/audio/decoder/audio_dec_delete.c index ec1a64134b..e20f0bbf29 100644 --- a/src/audio/decoder/audio_dec_delete.c +++ b/src/audio/decoder/audio_dec_delete.c @@ -2,7 +2,7 @@ extern s32 snd_close_movie_sound() __asm__("FUN_0012f0e0"); s32 audio_dec_delete(s32 arg0) __asm__("FUN_0023ac90"); -s32 audio_dec_delete(s32 arg0) { +s32 audio_dec_delete(s32 unused_arg) { snd_close_movie_sound(); return 1; } diff --git a/src/audio/decoder/send_adpcm.c b/src/audio/decoder/send_adpcm.c index 46b1ab830c..2404b121d9 100644 --- a/src/audio/decoder/send_adpcm.c +++ b/src/audio/decoder/send_adpcm.c @@ -16,8 +16,8 @@ extern void send_to_spu(struct AudioDec *, unsigned char *, int, int) __asm__("f pointer (one load, as retail). */ void send_adpcm(void *arg0) __asm__("FUN_0023afc0"); -void send_adpcm(void *arg0) { - struct AudioDec *ad = arg0; +void send_adpcm(void *audio_decoder) { + struct AudioDec *ad = audio_decoder; int avail = 0; int i, j, n; unsigned char *src, *dst; diff --git a/src/audio/decoder/send_to_spu.c b/src/audio/decoder/send_to_spu.c index 2dc8a51dc6..016f18dcec 100644 --- a/src/audio/decoder/send_to_spu.c +++ b/src/audio/decoder/send_to_spu.c @@ -8,7 +8,7 @@ extern void snd_update_movie_adpcm(s32, s32) __asm__("FUN_0012f148"); void send_to_spu(struct AudioDec *dec, s32 src, s32 size, s32 arg3) __asm__("FUN_0023af18"); -void send_to_spu(struct AudioDec *dec, s32 src, s32 size, s32 arg3) { +void send_to_spu(struct AudioDec *dec, s32 src, s32 size, s32 staging_byte_offset) { u32 descriptor[4]; s32 dma_id; @@ -22,7 +22,7 @@ void send_to_spu(struct AudioDec *dec, s32 src, s32 size, s32 arg3) { } while (dma_id == 0); while (sceSifDmaStat(dma_id) >= 0) { } - snd_update_movie_adpcm(size, arg3); + snd_update_movie_adpcm(size, staging_byte_offset); } extern __typeof__(send_to_spu) func_0023AF18 __attribute__((alias("FUN_0023af18"))); diff --git a/src/audio/mixer/snd_set_playback_mode.c b/src/audio/mixer/snd_set_playback_mode.c index 2a6c553c07..71815b5117 100644 --- a/src/audio/mixer/snd_set_playback_mode.c +++ b/src/audio/mixer/snd_set_playback_mode.c @@ -3,8 +3,8 @@ extern s32 snd_send_iop_command_no_wait(s32 cmd, s32 size, void *buf, s32 a, s32 b) __asm__("func_0012E6E0"); void snd_set_playback_mode(s32 arg0) __asm__("FUN_0012e240"); -void snd_set_playback_mode(s32 arg0) { +void snd_set_playback_mode(s32 playback_mode) { u8 sp_slot[0x10]; - *(s32 *)sp_slot = arg0; + *(s32 *)sp_slot = playback_mode; snd_send_iop_command_no_wait(11, 4, sp_slot, 0, 0); } diff --git a/src/audio/music/music_pause.c b/src/audio/music/music_pause.c index 8abdea4c14..c0038ccfba 100644 --- a/src/audio/music/music_pause.c +++ b/src/audio/music/music_pause.c @@ -1,7 +1,7 @@ #include "types.h" #include "rnc/audio/music/music_stream_state.h" -void music_pause(s32 arg0) { - if (arg0 != 0) { +void music_pause(s32 pause_secondary) { + if (pause_secondary != 0) { music_stream_state.secondary.fade_flags = -0x8000; music_stream_state.secondary.unkE = 0; } diff --git a/src/audio/rpc/snd_reset_state_and_flush_commands.c b/src/audio/rpc/snd_reset_state_and_flush_commands.c index 2acb1084b1..49afb72230 100644 --- a/src/audio/rpc/snd_reset_state_and_flush_commands.c +++ b/src/audio/rpc/snd_reset_state_and_flush_commands.c @@ -3,7 +3,7 @@ extern s32 snd_flush_sound_commands() __asm__("FUN_0012dc80"); void snd_reset_state_and_flush_commands(s32 arg0) __asm__("FUN_0012eb00"); extern s32 GlobalTableStatus __asm__("D_0015ECC4") __attribute__((sda)); -void snd_reset_state_and_flush_commands(s32 arg0) { +void snd_reset_state_and_flush_commands(s32 unused_arg) { GlobalTableStatus = 0; snd_flush_sound_commands(); } diff --git a/src/audio/snd_get_doppler_pitch_mod.c b/src/audio/snd_get_doppler_pitch_mod.c index f806e7664a..32efd060a8 100644 --- a/src/audio/snd_get_doppler_pitch_mod.c +++ b/src/audio/snd_get_doppler_pitch_mod.c @@ -1,3 +1,3 @@ -int snd_get_doppler_pitch_mod(int arg0) { - return (arg0 * 0x5F4) / 0x2E5; +int snd_get_doppler_pitch_mod(int projected_velocity) { + return (projected_velocity * 0x5F4) / 0x2E5; } diff --git a/src/audio/streaming/clear_record_flag_by_key.c b/src/audio/streaming/clear_record_flag_by_key.c index 101d58550a..27d184abc0 100644 --- a/src/audio/streaming/clear_record_flag_by_key.c +++ b/src/audio/streaming/clear_record_flag_by_key.c @@ -7,11 +7,11 @@ struct KeyedFlagRecord { s32 clear_record_flag_by_key(s32 arg0) __asm__("FUN_00225e20"); -s32 clear_record_flag_by_key(s32 arg0) { +s32 clear_record_flag_by_key(s32 record_key) { s32 i; for (i = 0; i < 5; i++) { - if (graphics_buffer_descriptors[i].address == arg0) { + if (graphics_buffer_descriptors[i].address == record_key) { graphics_buffer_descriptors[i].flags &= ~4; return 0; } diff --git a/src/audio/streaming/finish_audio_stream_read.c b/src/audio/streaming/finish_audio_stream_read.c index a1067ef2fe..3ae4968495 100644 --- a/src/audio/streaming/finish_audio_stream_read.c +++ b/src/audio/streaming/finish_audio_stream_read.c @@ -6,8 +6,8 @@ extern s32 snd_stream_safe_cd_get_error() __asm__("func_0012EEF0"); void finish_audio_stream_read(s32 arg0) __asm__("FUN_00216950"); -void finish_audio_stream_read(s32 arg0) { - if (arg0 == 1) { +void finish_audio_stream_read(s32 callback_value) { + if (callback_value == 1) { music_stream_state.read_state = 0; if (snd_stream_safe_cd_get_error() != 0) { music_stream_state.read_state = 2; diff --git a/src/audio/streaming/request_audio_stream_break.c b/src/audio/streaming/request_audio_stream_break.c index 1241d4aa05..bd41b793f0 100644 --- a/src/audio/streaming/request_audio_stream_break.c +++ b/src/audio/streaming/request_audio_stream_break.c @@ -6,7 +6,7 @@ extern s32 snd_stream_safe_cd_break() __asm__("func_0012EEA8"); void request_audio_stream_break(s32 arg0) __asm__("FUN_002166e8"); -void request_audio_stream_break(s32 arg0) { +void request_audio_stream_break(s32 unused_parameter) { if (music_stream_state.read_state != 0) { snd_stream_safe_cd_break(); music_stream_state.break_requested = 1; diff --git a/src/audio/streaming/select_next_stream_buffer.c b/src/audio/streaming/select_next_stream_buffer.c index 53c7b6aebc..0141a02c6d 100644 --- a/src/audio/streaming/select_next_stream_buffer.c +++ b/src/audio/streaming/select_next_stream_buffer.c @@ -5,12 +5,12 @@ extern s32 get_stream_buffer_size() __asm__("func_00225D88"); s32 select_next_stream_buffer(s32 arg0) __asm__("FUN_00225c18"); -s32 select_next_stream_buffer(s32 arg0) { +s32 select_next_stream_buffer(s32 require_low_flag_bit) { s32 i; s32 f; for (i = 0; i < 5; i++) { - if (arg0 != 0) { + if (require_low_flag_bit != 0) { f = graphics_buffer_descriptors[i].flags ^ 1; } else { f = graphics_buffer_descriptors[i].flags; diff --git a/src/audio/streaming/snd_continue_vag_stream.c b/src/audio/streaming/snd_continue_vag_stream.c index 9f95271b19..938413c9e5 100644 --- a/src/audio/streaming/snd_continue_vag_stream.c +++ b/src/audio/streaming/snd_continue_vag_stream.c @@ -3,9 +3,9 @@ extern s32 snd_send_iop_command_no_wait(s32 cmd, s32 size, void *buf, s32 a, s32 b) __asm__("func_0012E6E0"); void snd_continue_vag_stream(s32 arg0) __asm__("FUN_0012eca0"); -void snd_continue_vag_stream(s32 arg0) { +void snd_continue_vag_stream(s32 sound_handle) { u8 sp_slot[0x10]; - *(s32 *)(sp_slot + 0) = arg0; + *(s32 *)(sp_slot + 0) = sound_handle; snd_send_iop_command_no_wait(46, 4, sp_slot, 0, 0); } diff --git a/src/audio/streaming/snd_pause_vag_stream.c b/src/audio/streaming/snd_pause_vag_stream.c index 8db7f74abb..e36f697033 100644 --- a/src/audio/streaming/snd_pause_vag_stream.c +++ b/src/audio/streaming/snd_pause_vag_stream.c @@ -3,9 +3,9 @@ extern s32 snd_send_iop_command_no_wait(s32 cmd, s32 size, void *buf, s32 a, s32 b) __asm__("func_0012E6E0"); void snd_pause_vag_stream(s32 arg0) __asm__("FUN_0012ec70"); -void snd_pause_vag_stream(s32 arg0) { +void snd_pause_vag_stream(s32 sound_handle) { u8 sp_slot[0x10]; - *(s32 *)(sp_slot + 0) = arg0; + *(s32 *)(sp_slot + 0) = sound_handle; snd_send_iop_command_no_wait(45, 4, sp_slot, 0, 0); } diff --git a/src/audio/streaming/snd_play_vag_stream_by_loc_ex_cb.c b/src/audio/streaming/snd_play_vag_stream_by_loc_ex_cb.c index 5215e505c2..32c14d229c 100644 --- a/src/audio/streaming/snd_play_vag_stream_by_loc_ex_cb.c +++ b/src/audio/streaming/snd_play_vag_stream_by_loc_ex_cb.c @@ -16,7 +16,7 @@ void snd_play_vag_stream_by_loc_ex_cb(s32 loc, s32 size, s32 vol_l, s32 vol_r, s u64 cb_data) __asm__("FUN_0012ec08"); void snd_play_vag_stream_by_loc_ex_cb(s32 loc, s32 size, s32 vol_l, s32 vol_r, s32 pitch, s32 flags, - s32 voice, s32 channel, s32 a8, s32 id, u64 cb_data) { + s32 voice, s32 channel, s32 request_word_6, s32 id, u64 cb_data) { int new_var; s32 buf[7]; new_var = (pitch << 16) | (vol_l & 0xFFFF); @@ -29,7 +29,7 @@ void snd_play_vag_stream_by_loc_ex_cb(s32 loc, s32 size, s32 vol_l, s32 vol_r, s buf[3] = (flags << 16) | (vol_r & 0xFFFF); buf[4] = voice; buf[5] = channel; - buf[6] = a8; + buf[6] = request_word_6; snd_send_iop_command_no_wait(0x2C, 0x1C, buf, id, cb_data); } diff --git a/src/audio/streaming/snd_stream_safe_cd_get_error.c b/src/audio/streaming/snd_stream_safe_cd_get_error.c index e9810e7e7c..49c546e0ab 100644 --- a/src/audio/streaming/snd_stream_safe_cd_get_error.c +++ b/src/audio/streaming/snd_stream_safe_cd_get_error.c @@ -5,7 +5,7 @@ extern s32 sceCdGetError(); s32 snd_stream_safe_cd_get_error(s32 arg0) __asm__("FUN_0012eef0"); -s32 snd_stream_safe_cd_get_error(s32 arg0) { +s32 snd_stream_safe_cd_get_error(s32 unused_arg) { if (snd_cd_stream_active == 0) { return sceCdGetError(); } diff --git a/src/audio/streaming/snd_stream_safe_check_cd_idle.c b/src/audio/streaming/snd_stream_safe_check_cd_idle.c index b15d8b3b00..24d5c17c99 100644 --- a/src/audio/streaming/snd_stream_safe_check_cd_idle.c +++ b/src/audio/streaming/snd_stream_safe_check_cd_idle.c @@ -2,9 +2,9 @@ extern s32 snd_send_iop_command_and_wait() __asm__("func_0012E548"); void snd_stream_safe_check_cd_idle(s32 arg0) __asm__("FUN_0012ed30"); -void snd_stream_safe_check_cd_idle(s32 arg0) { +void snd_stream_safe_check_cd_idle(s32 payload_word) { u8 sp_slot[0x10]; - *(s32 *)sp_slot = arg0; + *(s32 *)sp_slot = payload_word; snd_send_iop_command_and_wait(0x36, 4, sp_slot); } diff --git a/src/audio/streaming/update_audio_stream_until_idle.c b/src/audio/streaming/update_audio_stream_until_idle.c index 7e0cf336b0..32c4873767 100644 --- a/src/audio/streaming/update_audio_stream_until_idle.c +++ b/src/audio/streaming/update_audio_stream_until_idle.c @@ -9,8 +9,8 @@ extern s32 music_update() __asm__("func_00216290"); extern s32 sceGsSyncV(); s16 update_audio_stream_until_idle(s32 arg0) __asm__("FUN_002168a8"); -s16 update_audio_stream_until_idle(s32 arg0) { - if (arg0 != 0) { +s16 update_audio_stream_until_idle(s32 wait_for_completion) { + if (wait_for_completion != 0) { if (music_stream_state.read_state != 0) { do { sceGsSyncV(0); diff --git a/src/audio/voices/snd_continue_all_sounds_in_group.c b/src/audio/voices/snd_continue_all_sounds_in_group.c index d5cefd5a2b..a6c05d410d 100644 --- a/src/audio/voices/snd_continue_all_sounds_in_group.c +++ b/src/audio/voices/snd_continue_all_sounds_in_group.c @@ -3,9 +3,9 @@ extern s32 snd_send_iop_command_no_wait(s32 cmd, s32 size, void *buf, s32 a, s32 b) __asm__("func_0012E6E0"); void snd_continue_all_sounds_in_group(s32 arg0) __asm__("FUN_0012e418"); -void snd_continue_all_sounds_in_group(s32 arg0) { +void snd_continue_all_sounds_in_group(s32 payload_word) { u8 sp_slot[0x10]; - *(s32 *)(sp_slot + 0) = arg0; + *(s32 *)(sp_slot + 0) = payload_word; snd_send_iop_command_no_wait(23, 4, sp_slot, 0, 0); } diff --git a/src/audio/voices/snd_pause_all_sounds_in_group.c b/src/audio/voices/snd_pause_all_sounds_in_group.c index 71a00c3e5a..0573453a91 100644 --- a/src/audio/voices/snd_pause_all_sounds_in_group.c +++ b/src/audio/voices/snd_pause_all_sounds_in_group.c @@ -3,9 +3,9 @@ extern s32 snd_send_iop_command_no_wait(s32 cmd, s32 size, void *buf, s32 a, s32 b) __asm__("func_0012E6E0"); void snd_pause_all_sounds_in_group(s32 arg0) __asm__("FUN_0012e3e8"); -void snd_pause_all_sounds_in_group(s32 arg0) { +void snd_pause_all_sounds_in_group(s32 payload_word) { u8 sp_slot[0x10]; - *(s32 *)(sp_slot + 0) = arg0; + *(s32 *)(sp_slot + 0) = payload_word; snd_send_iop_command_no_wait(22, 4, sp_slot, 0, 0); } diff --git a/src/audio/voices/snd_play_sound_vol_pan_pmpb.c b/src/audio/voices/snd_play_sound_vol_pan_pmpb.c index 8518901b3d..9608312209 100644 --- a/src/audio/voices/snd_play_sound_vol_pan_pmpb.c +++ b/src/audio/voices/snd_play_sound_vol_pan_pmpb.c @@ -3,15 +3,15 @@ extern s32 snd_send_iop_command_no_wait() __asm__("func_0012E6E0"); void snd_play_sound_vol_pan_pmpb(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5, s32 a6, s32 a7) __asm__("FUN_0012e308"); -void snd_play_sound_vol_pan_pmpb(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5, s32 callback_address, s32 callback_context_address) { +void snd_play_sound_vol_pan_pmpb(s32 request_word_0, s32 request_word_1, s32 request_word_2, s32 request_word_3, s32 request_word_4, s32 request_word_5, s32 callback_address, s32 callback_context_address) { s32 buf[6]; - buf[0] = a0; - buf[1] = a1; - buf[2] = a2; - buf[3] = a3; - buf[4] = a4; - buf[5] = a5; + buf[0] = request_word_0; + buf[1] = request_word_1; + buf[2] = request_word_2; + buf[3] = request_word_3; + buf[4] = request_word_4; + buf[5] = request_word_5; snd_send_iop_command_no_wait(0x11, 0x18, buf, callback_address, callback_context_address); } diff --git a/src/audio/voices/snd_set_sound_params_cb.c b/src/audio/voices/snd_set_sound_params_cb.c index f33f0d34fa..b150614172 100644 --- a/src/audio/voices/snd_set_sound_params_cb.c +++ b/src/audio/voices/snd_set_sound_params_cb.c @@ -3,7 +3,7 @@ extern s32 snd_send_iop_command_no_wait() __asm__("func_0012E6E0"); void snd_set_sound_params_cb(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5, s32 a6, s32 a7) __asm__("FUN_0012e4c0"); -void snd_set_sound_params_cb(s32 request_word_0, s32 request_word_1, s32 request_word_2, s32 request_word_3, s32 request_word_4, s32 request_word_5, s32 a6, s32 a7) { +void snd_set_sound_params_cb(s32 request_word_0, s32 request_word_1, s32 request_word_2, s32 request_word_3, s32 request_word_4, s32 request_word_5, s32 callback_address, s32 callback_context_address) { s32 buf[6]; buf[0] = request_word_0; @@ -12,7 +12,7 @@ void snd_set_sound_params_cb(s32 request_word_0, s32 request_word_1, s32 request buf[3] = request_word_3; buf[4] = request_word_4; buf[5] = request_word_5; - snd_send_iop_command_no_wait(0x21, 0x18, buf, a6, a7); + snd_send_iop_command_no_wait(0x21, 0x18, buf, callback_address, callback_context_address); } extern __typeof__(snd_set_sound_params_cb) func_0012E4C0 __attribute__((alias("FUN_0012e4c0"))); diff --git a/src/audio/voices/snd_stop_sound.c b/src/audio/voices/snd_stop_sound.c index a6d883c3dd..d181e54996 100644 --- a/src/audio/voices/snd_stop_sound.c +++ b/src/audio/voices/snd_stop_sound.c @@ -2,10 +2,10 @@ extern s32 snd_send_iop_command_no_wait() __asm__("func_0012E6E0"); void snd_stop_sound(s32 arg0) __asm__("FUN_0012e368"); -void snd_stop_sound(s32 arg0) { +void snd_stop_sound(s32 sound_handle) { s32 buf[4]; - buf[0] = arg0; + buf[0] = sound_handle; snd_send_iop_command_no_wait(0x15, 4, buf, 0, 0); } diff --git a/src/gameplay/entities/build_moby_bone_transform.c b/src/gameplay/entities/build_moby_bone_transform.c index 9752ec24cf..3ac64360b8 100644 --- a/src/gameplay/entities/build_moby_bone_transform.c +++ b/src/gameplay/entities/build_moby_bone_transform.c @@ -8,13 +8,13 @@ extern void multiply_matrix(s32, void *, s32) __asm__("FUN_001fa378"); extern void FUN_00210850(struct Moby *, s32, s32 *, s32); void build_moby_bone_transform(struct Moby *arg0, s32 arg1, s32 arg2) __asm__("FUN_0020cca8"); -void build_moby_bone_transform(struct Moby *moby, s32 arg1, s32 output_transform) { +void build_moby_bone_transform(struct Moby *moby, s32 bone_index, s32 output_transform) { u8 sp_slot[0x40]; s32 sp40; f32 scale; s32 temp_16_22; - sp40 = arg1; + sp40 = bone_index; scale = (*(f32 *)((u8 *)moby + 0x2C)) * 0.0009765625f; FUN_00210850(moby, 1, &sp40, output_transform); temp_16_22 = output_transform + 0x30; diff --git a/src/gameplay/entities/draw_moby_list.c b/src/gameplay/entities/draw_moby_list.c index bcf709f602..2893ace5ea 100644 --- a/src/gameplay/entities/draw_moby_list.c +++ b/src/gameplay/entities/draw_moby_list.c @@ -9,11 +9,11 @@ extern s32 vu1_add_g_sregister() __asm__("func_00233980"); void draw_moby_list(s32 arg0, s32 arg1) __asm__("FUN_0020d330"); -void draw_moby_list(s32 arg0, s32 arg1) { +void draw_moby_list(s32 source_address, s32 arg1) { vu1_add_g_sregister(0x47, (long)0x5360B); flush_cache(0); restore_moby_class_dists(); - moby_anim_head = moby_proc(arg0, moby_anim_head, arg1, 0); + moby_anim_head = moby_proc(source_address, moby_anim_head, arg1, 0); stash_moby_class_dists(); moby_anim_head -= 0x10; } diff --git a/src/gameplay/missions/collect_mission_ids.c b/src/gameplay/missions/collect_mission_ids.c index 9ff12ebbb3..7ed56af931 100644 --- a/src/gameplay/missions/collect_mission_ids.c +++ b/src/gameplay/missions/collect_mission_ids.c @@ -12,7 +12,7 @@ extern MissionNode *D_001A2C20[]; int collect_mission_ids(int *out, int *mask, int *nums, int arg3) __asm__("FUN_0020bc00"); -int collect_mission_ids(int *out, int *mask, int *nums, int arg3) { +int collect_mission_ids(int *out, int *mask, int *nums, int use_selected_ids) { MissionNode *p = D_001A2C20[0]; int count = 0; int all = 1; @@ -36,7 +36,7 @@ int collect_mission_ids(int *out, int *mask, int *nums, int arg3) { } if (!(f & 2) && t != 0 && !((f & 1) && t == 2)) { out[count] = p->id; - if (arg3 != 0) { + if (use_selected_ids != 0) { out[count] = (p->status == 2) ? 0x523E : p->ids[p->sel]; } if (mask != 0 && p->status == 2) { diff --git a/src/gameplay/missions/fun_0020be68.c b/src/gameplay/missions/fun_0020be68.c index 18834578f1..d8f2eb50dd 100644 --- a/src/gameplay/missions/fun_0020be68.c +++ b/src/gameplay/missions/fun_0020be68.c @@ -1,7 +1,7 @@ /* Ported from rac1-decomp (src/game/missionfunc.c, func_0020CCB8). */ #include "rnc/gameplay/state/item_state.h" -int FUN_0020be68(int arg0) { - return item_available[arg0] != 0; +int FUN_0020be68(int item_index) { + return item_available[item_index] != 0; } extern __typeof__(FUN_0020be68) func_0020BE68 __attribute__((alias("FUN_0020be68"))); diff --git a/src/gameplay/state/transition_default_draw.c b/src/gameplay/state/transition_default_draw.c index e1a9119207..2db0e7222a 100644 --- a/src/gameplay/state/transition_default_draw.c +++ b/src/gameplay/state/transition_default_draw.c @@ -51,7 +51,7 @@ extern s32 draw_ties_1() __asm__("func_002358C8"); extern s32 light_ties() __asm__("func_00237370"); void transition_default_draw(s32 *arg0) __asm__("FUN_001eb410"); -void transition_default_draw(s32 *arg0) { +void transition_default_draw(s32 *unused_parameter) { s32 n; if (D_0016045C == 0 || D_0016045C->unk4 != 0) { diff --git a/src/math/conversion/round_float_to_decimal_places.c b/src/math/conversion/round_float_to_decimal_places.c index ce7fd74f81..cc4777cd35 100644 --- a/src/math/conversion/round_float_to_decimal_places.c +++ b/src/math/conversion/round_float_to_decimal_places.c @@ -4,13 +4,13 @@ extern s32 truncate_float_to_s32(f32) __asm__("FUN_001fa6d0"); f32 round_float_to_decimal_places(s32 arg0, f32 fparg0) __asm__("FUN_00214c48"); -f32 round_float_to_decimal_places(s32 arg0, f32 fparg0) { +f32 round_float_to_decimal_places(s32 decimal_places, f32 fparg0) { s32 count; s32 value; f32 scale; f32 half; - count = arg0; + count = decimal_places; value = 1; if (count > 0) { do { diff --git a/src/math/interpolation/cosine_interpolate.c b/src/math/interpolation/cosine_interpolate.c index ffde38c30e..5cf37120c5 100644 --- a/src/math/interpolation/cosine_interpolate.c +++ b/src/math/interpolation/cosine_interpolate.c @@ -4,7 +4,7 @@ extern f32 fast_cos(f32) __asm__("func_001F9DC8"); f32 cosine_interpolate(s32 arg0, f32 from, f32 to, f32 t) __asm__("FUN_002133d0"); -f32 cosine_interpolate(s32 arg0, f32 from, f32 to, f32 t) { +f32 cosine_interpolate(s32 unused_arg, f32 from, f32 to, f32 t) { if (t == 0.0f) { return from; } diff --git a/src/math/random/random_angle_radians.c b/src/math/random/random_angle_radians.c index 1b067a12ba..5a2a1df14b 100644 --- a/src/math/random/random_angle_radians.c +++ b/src/math/random/random_angle_radians.c @@ -4,7 +4,7 @@ extern s32 rand(); f32 random_angle_radians(s32 arg0) __asm__("FUN_00213308"); -f32 random_angle_radians(s32 arg0) { +f32 random_angle_radians(s32 unused_arg) { return (f32)(((rand() >> 0x10) & 0xFFF) - 0x800) * 3.1415927f * 0.00048828125f; } extern __typeof__(random_angle_radians) func_00213308 __attribute__((alias("FUN_00213308"))); diff --git a/src/math/random/random_float_between.c b/src/math/random/random_float_between.c index d6364b3028..27b087e53c 100644 --- a/src/math/random/random_float_between.c +++ b/src/math/random/random_float_between.c @@ -2,7 +2,7 @@ extern s32 rand(); f32 random_float_between(s32 arg0, f32 fparg0, f32 fparg1) __asm__("FUN_002132a8"); -f32 random_float_between(s32 arg0, f32 fparg0, f32 fparg1) { +f32 random_float_between(s32 unused_parameter, f32 fparg0, f32 fparg1) { return fparg0 + ((f32)((rand() >> 0x10) & 0x7FFF) * (fparg1 - fparg0) * 0.000030517578f); } diff --git a/src/math/rotations/matrix_to_quaternion.c b/src/math/rotations/matrix_to_quaternion.c index 86d3ba8128..aad08fca57 100644 --- a/src/math/rotations/matrix_to_quaternion.c +++ b/src/math/rotations/matrix_to_quaternion.c @@ -8,9 +8,9 @@ extern QuatNext D_0015FFD8; largest diagonal element, working on a packed 3x3 copy. */ void matrix_to_quaternion(void *arg0, void *arg1) __asm__("FUN_00214260"); -void matrix_to_quaternion(void *arg0, void *arg1) { - float *q = arg0; - float(*m)[4] = arg1; +void matrix_to_quaternion(void *output_quaternion, void *rotation_matrix) { + float *q = output_quaternion; + float(*m)[4] = rotation_matrix; QuatNext n = D_0015FFD8; float mat[3][3]; float trace; diff --git a/src/math/vectors/normalize_vector_triplet.c b/src/math/vectors/normalize_vector_triplet.c index f5f7187f02..6270352717 100644 --- a/src/math/vectors/normalize_vector_triplet.c +++ b/src/math/vectors/normalize_vector_triplet.c @@ -9,7 +9,7 @@ extern void fast_vec_normalize(f32 *, f32 *, f32) __asm__("func_001F9BF8"); void normalize_vector_triplet(f32 *arg0) __asm__("FUN_00214128"); -void normalize_vector_triplet(f32 *arg0) { +void normalize_vector_triplet(f32 *matrix) { struct Vec3Padded scratch; f32 *base; f32 *src; @@ -20,7 +20,7 @@ void normalize_vector_triplet(f32 *arg0) { s32 next; s32 count; - base = arg0; + base = matrix; i = 0; do { next = i + 1; diff --git a/src/rendering/effects/spawn_spark.c b/src/rendering/effects/spawn_spark.c index 443aab90d6..fc4bb84a9d 100644 --- a/src/rendering/effects/spawn_spark.c +++ b/src/rendering/effects/spawn_spark.c @@ -45,8 +45,8 @@ struct Obj *spawn_spark(u128 *source_quadword, f32 *first_vector, f32 *second_ve s32 arg7, s32 lookup_index_and_flags) { struct Obj *o; struct Sub *s; - f32 t0[4]; - f32 t1[4]; + f32 first_vector_scratch[4]; + f32 second_vector_scratch[4]; o = create_part(2); if (o != 0) { @@ -71,8 +71,8 @@ struct Obj *spawn_spark(u128 *source_quadword, f32 *first_vector, f32 *second_ve s->h18 = truncate_float_to_s32(second_vector[3] * 210000.0f / 1000.0f); pack_vector_xyz_with_shared_scale(first_vector, &s->a); pack_vector_xyz_with_shared_scale(second_vector, &s->b); - load_display_text_resource_entry(t0, &s->a); - load_display_text_resource_entry(t1, &s->b); + load_display_text_resource_entry(first_vector_scratch, &s->a); + load_display_text_resource_entry(second_vector_scratch, &s->b); s->c = arg3; s->d = arg4; s->h10 = arg5; diff --git a/src/rendering/geometry/transform_scaled_vertex_batch.c b/src/rendering/geometry/transform_scaled_vertex_batch.c index 9eb6993c63..db42b281e0 100644 --- a/src/rendering/geometry/transform_scaled_vertex_batch.c +++ b/src/rendering/geometry/transform_scaled_vertex_batch.c @@ -13,7 +13,7 @@ extern void func_002106F8(void); void transform_scaled_vertex_batch(struct VertexBatch *object, s32 count, s32 arg2, u8 *cursor) __asm__("FUN_0020cd48"); -void transform_scaled_vertex_batch(struct VertexBatch *object, s32 count, s32 arg2, u8 *cursor) { +void transform_scaled_vertex_batch(struct VertexBatch *object, s32 count, s32 point_indices, u8 *cursor) { f32 scale; scale = *(f32 *)((u8 *)object + 0x2C) * 0.0009765625f; diff --git a/src/rendering/refresh_point_light.c b/src/rendering/refresh_point_light.c index 84f5de6aef..5524891fcc 100644 --- a/src/rendering/refresh_point_light.c +++ b/src/rendering/refresh_point_light.c @@ -3,7 +3,7 @@ extern s32 create_point_light() __asm__("FUN_00201ba8"); extern s32 detach_point_light() __asm__("FUN_00201f88"); void refresh_point_light(s32 arg0) __asm__("FUN_00201f58"); -void refresh_point_light(s32 arg0) { +void refresh_point_light(s32 point_light_index) { detach_point_light(); - create_point_light(arg0); + create_point_light(point_light_index); } diff --git a/src/rendering/set_up_vis_gif_viewer.c b/src/rendering/set_up_vis_gif_viewer.c index 09e0bf2a1a..af23ab037e 100644 --- a/src/rendering/set_up_vis_gif_viewer.c +++ b/src/rendering/set_up_vis_gif_viewer.c @@ -5,7 +5,7 @@ void set_up_vis_gif_viewer(u64 *q, s32 n, s32 prim, s32 a3, s32 t0, s32 mode) __asm__("FUN_00202fd0"); -void set_up_vis_gif_viewer(u64 *q, s32 n, s32 prim, s32 a3, s32 t0, s32 mode) { +void set_up_vis_gif_viewer(u64 *q, s32 n, s32 prim, s32 material_control_base, s32 material_control_shift2, s32 mode) { u64 w0; s64 w1; u64 w2; @@ -17,7 +17,7 @@ void set_up_vis_gif_viewer(u64 *q, s32 n, s32 prim, s32 a3, s32 t0, s32 mode) { if (mode >= 0) { q[0] = (0x20 | (w1 & 0x1C)) | ((u64)prim << 6) | ((u64)(u32)n << 32); q += 2; - q[0] = (a3 | ((u64)t0 << 2)) | ((u64)mode << 24); + q[0] = (material_control_base | ((u64)material_control_shift2 << 2)) | ((u64)mode << 24); q += 2; q[0] = w0; q[2] = w2; diff --git a/src/rendering/vu0/vu0_load_micro_program.c b/src/rendering/vu0/vu0_load_micro_program.c index f111353c8b..1171a5d126 100644 --- a/src/rendering/vu0/vu0_load_micro_program.c +++ b/src/rendering/vu0/vu0_load_micro_program.c @@ -4,14 +4,14 @@ extern void SpinWait(s32); void vu0_load_micro_program(s32 arg0) __asm__("FUN_002334d8"); -void vu0_load_micro_program(s32 arg0) { +void vu0_load_micro_program(s32 dma_tag_address) { if ((*(volatile u32 *)0x10008000 & 0x100) != 0) { do { SpinWait(0x10); } while ((*(volatile u32 *)0x10008000 & 0x100) != 0); } *(volatile u32 *)0x10008020 = 0; - *(volatile u32 *)0x10008030 = arg0 & 0x0FFFFFFF; + *(volatile u32 *)0x10008030 = dma_tag_address & 0x0FFFFFFF; *(volatile u32 *)0x10008000 = 0x145; if ((*(volatile u32 *)0x10008000 & 0x100) != 0) { do { diff --git a/src/rendering/vu1/vu1_add_vif_code.c b/src/rendering/vu1/vu1_add_vif_code.c index 08feae674c..b4c63ded20 100644 --- a/src/rendering/vu1/vu1_add_vif_code.c +++ b/src/rendering/vu1/vu1_add_vif_code.c @@ -5,11 +5,11 @@ void vu1_add_vif_code(s32 arg0) __asm__("FUN_00233938"); -void vu1_add_vif_code(s32 arg0) { +void vu1_add_vif_code(s32 vif_code) { *render_packet_cursor.words = 0x10000000; *(s32 *)((u32)render_packet_cursor.words + 4) = 0; *(s32 *)((u32)render_packet_cursor.words + 8) = 0; - *(s32 *)((u32)render_packet_cursor.words + 12) = arg0; + *(s32 *)((u32)render_packet_cursor.words + 12) = vif_code; render_packet_cursor.words += 4; } diff --git a/src/rendering/wait_for_graphics_pipeline_idle.c b/src/rendering/wait_for_graphics_pipeline_idle.c index c38dcb403a..e15adc9708 100644 --- a/src/rendering/wait_for_graphics_pipeline_idle.c +++ b/src/rendering/wait_for_graphics_pipeline_idle.c @@ -10,7 +10,7 @@ */ s32 wait_for_graphics_pipeline_idle(s32 arg0, s32 arg1) __asm__("FUN_00120558"); -s32 wait_for_graphics_pipeline_idle(s32 arg0, s32 arg1) { +s32 wait_for_graphics_pipeline_idle(s32 unused_arg0, s32 unused_arg1) { u32 busy; u32 initial_busy; u32 vif1_dma; @@ -19,8 +19,8 @@ s32 wait_for_graphics_pipeline_idle(s32 arg0, s32 arg1) { u32 vpu_status; u32 gif_status; - (void)arg0; - (void)arg1; + (void)unused_arg0; + (void)unused_arg1; do { vif1_dma = *(vu32 *)0x10009000; initial_busy = 1; diff --git a/src/runtime/dma/disable_dmac.c b/src/runtime/dma/disable_dmac.c index ff8cf4d9df..5caf7f0337 100644 --- a/src/runtime/dma/disable_dmac.c +++ b/src/runtime/dma/disable_dmac.c @@ -7,7 +7,7 @@ extern s32 EnableInterrupts(); s32 disable_dmac(s32 arg0) __asm__("FUN_001190f8"); -s32 disable_dmac(s32 arg0) { +s32 disable_dmac(s32 channel_index) { u32 status; s32 result; @@ -16,7 +16,7 @@ s32 disable_dmac(s32 arg0) { if (status != 0) { DIntr(); } - result = _DisableDmac(arg0); + result = _DisableDmac(channel_index); CpuSync(); if (status != 0) { EnableInterrupts(); diff --git a/src/runtime/dma/enable_dmac.c b/src/runtime/dma/enable_dmac.c index 19d84cec54..69a8dc74af 100644 --- a/src/runtime/dma/enable_dmac.c +++ b/src/runtime/dma/enable_dmac.c @@ -7,7 +7,7 @@ extern s32 EnableInterrupts(); s32 enable_dmac(s32 arg0) __asm__("FUN_00119160"); -s32 enable_dmac(s32 arg0) { +s32 enable_dmac(s32 channel_index) { u32 status; s32 result; @@ -16,7 +16,7 @@ s32 enable_dmac(s32 arg0) { if (status != 0) { DIntr(); } - result = _EnableDmac(arg0); + result = _EnableDmac(channel_index); CpuSync(); if (status != 0) { EnableInterrupts(); diff --git a/src/runtime/interrupts/disable_intc.c b/src/runtime/interrupts/disable_intc.c index 1772a06f32..c3b43add74 100644 --- a/src/runtime/interrupts/disable_intc.c +++ b/src/runtime/interrupts/disable_intc.c @@ -7,7 +7,7 @@ extern s32 EnableInterrupts(); s32 disable_intc(s32 arg0) __asm__("FUN_00119028"); -s32 disable_intc(s32 arg0) { +s32 disable_intc(s32 intc_cause) { u32 status; s32 result; @@ -16,7 +16,7 @@ s32 disable_intc(s32 arg0) { if (status != 0) { DIntr(); } - result = _DisableIntc(arg0); + result = _DisableIntc(intc_cause); CpuSync(); if (status != 0) { EnableInterrupts(); diff --git a/src/runtime/interrupts/enable_intc.c b/src/runtime/interrupts/enable_intc.c index 489226d02b..280152e5bc 100644 --- a/src/runtime/interrupts/enable_intc.c +++ b/src/runtime/interrupts/enable_intc.c @@ -7,7 +7,7 @@ extern s32 EnableInterrupts(); s32 enable_intc(s32 arg0) __asm__("FUN_00119090"); -s32 enable_intc(s32 arg0) { +s32 enable_intc(s32 cause_index) { u32 status; s32 result; @@ -16,7 +16,7 @@ s32 enable_intc(s32 arg0) { if (status != 0) { DIntr(); } - result = _EnableIntc(arg0); + result = _EnableIntc(cause_index); CpuSync(); if (status != 0) { EnableInterrupts(); diff --git a/src/runtime/iop/load_irx_module.c b/src/runtime/iop/load_irx_module.c index 6f41a678d7..965dea4c82 100644 --- a/src/runtime/iop/load_irx_module.c +++ b/src/runtime/iop/load_irx_module.c @@ -14,14 +14,14 @@ extern s32 InvokeIopStatus(s32 module_id, s32 a1, s32 a2); extern void invoke_state_initializer(s32 module_id) __asm__("InvokeStateInitializer"); s32 load_irx_module(s32 irx_image, s32 arg1) __asm__("FUN_00201520"); -s32 load_irx_module(s32 irx_image, s32 arg1) { +s32 load_irx_module(s32 irx_image, s32 size_bytes) { struct sceSifDmaData transfer; s32 module_id; s32 dma_id; s32 result; - module_id = sceSifAllocIopHeap(arg1); - transfer.size = arg1; + module_id = sceSifAllocIopHeap(size_bytes); + transfer.size = size_bytes; transfer.source = irx_image; transfer.destination = module_id; transfer.attr = 0; diff --git a/src/runtime/memory/reserve_aligned_buffer_space.c b/src/runtime/memory/reserve_aligned_buffer_space.c index 2c63c8e02a..0c13e7470e 100644 --- a/src/runtime/memory/reserve_aligned_buffer_space.c +++ b/src/runtime/memory/reserve_aligned_buffer_space.c @@ -10,7 +10,7 @@ extern s32 _Error(); s32 reserve_aligned_buffer_space(s32 arg0, struct BufferPool *pool, s32 size, u32 alignment) __asm__("FUN_0012bc20"); -s32 reserve_aligned_buffer_space(s32 arg0, struct BufferPool *pool, s32 size, u32 alignment) { +s32 reserve_aligned_buffer_space(s32 decoder_state, struct BufferPool *pool, s32 size, u32 alignment) { s32 start; u32 new_end; @@ -20,6 +20,6 @@ s32 reserve_aligned_buffer_space(s32 arg0, struct BufferPool *pool, s32 size, u3 pool->unk8 = new_end; return start; } - _Error(arg0, D_00153A38); + _Error(decoder_state, D_00153A38); return 0; } \ No newline at end of file diff --git a/src/runtime/memory/unpack_spr_descriptor.c b/src/runtime/memory/unpack_spr_descriptor.c index a49bf43ea5..5930ced258 100644 --- a/src/runtime/memory/unpack_spr_descriptor.c +++ b/src/runtime/memory/unpack_spr_descriptor.c @@ -19,8 +19,8 @@ */ void unpack_spr_descriptor(void *arg0) __asm__("FUN_001238a0"); -void unpack_spr_descriptor(void *arg0) { - char *p = (char *)((unsigned int)arg0 | 0x20000000); +void unpack_spr_descriptor(void *descriptor) { + char *p = (char *)((unsigned int)descriptor | 0x20000000); unsigned char *src; char *d; int i; diff --git a/src/runtime/relocation/relocate_asset_entry_pointers.c b/src/runtime/relocation/relocate_asset_entry_pointers.c index f2b172f81a..6e252e3b25 100644 --- a/src/runtime/relocation/relocate_asset_entry_pointers.c +++ b/src/runtime/relocation/relocate_asset_entry_pointers.c @@ -2,8 +2,8 @@ void relocate_asset_entry_pointers(u8 *a0, s32 idx, s32 on) __asm__("FUN_002032e0"); -void relocate_asset_entry_pointers(u8 *a0, s32 idx, s32 on) { - u8 *base = a0; +void relocate_asset_entry_pointers(u8 *table_container, s32 idx, s32 on) { + u8 *base = table_container; u8 *p; u32 v; diff --git a/src/runtime/sio/handle_sif_initialize_command.c b/src/runtime/sio/handle_sif_initialize_command.c index 766dc7b6c4..3515c9e2cc 100644 --- a/src/runtime/sio/handle_sif_initialize_command.c +++ b/src/runtime/sio/handle_sif_initialize_command.c @@ -2,11 +2,11 @@ s32 handle_sif_initialize_command(s32 *a0, s32 *a1) __asm__("FUN_0011a448"); -s32 handle_sif_initialize_command(s32 *a0, s32 *a1) { +s32 handle_sif_initialize_command(s32 *initialize_packet, s32 *command_state) { s32 value; - value = *(s32 *)((u8 *)a0 + 0x10); - *(s32 *)((u8 *)a1 + 0x8) = value; + value = *(s32 *)((u8 *)initialize_packet + 0x10); + *(s32 *)((u8 *)command_state + 0x8) = value; return value; } diff --git a/src/runtime/sio/handle_sif_set_system_register.c b/src/runtime/sio/handle_sif_set_system_register.c index d4b680d10e..a0f11468f7 100644 --- a/src/runtime/sio/handle_sif_set_system_register.c +++ b/src/runtime/sio/handle_sif_set_system_register.c @@ -4,14 +4,14 @@ array a1+0x1C at slot a0+0x10. Returns nothing (SIO calls it void). */ void handle_sif_set_system_register(s32 *a0, s32 *a1) __asm__("FUN_0011a428"); -void handle_sif_set_system_register(s32 *a0, s32 *a1) { +void handle_sif_set_system_register(s32 *packet, s32 *command_state) { s32 *dst; s32 index; s32 value; - index = *(s32 *)((u8 *)a0 + 0x10); - dst = *(s32 **)((u8 *)a1 + 0x1C); - value = *(s32 *)((u8 *)a0 + 0x14); + index = *(s32 *)((u8 *)packet + 0x10); + dst = *(s32 **)((u8 *)command_state + 0x1C); + value = *(s32 *)((u8 *)packet + 0x14); dst[index] = value; } diff --git a/src/runtime/state/check_state_range.c b/src/runtime/state/check_state_range.c index e6058606a2..0ceb00a4f4 100644 --- a/src/runtime/state/check_state_range.c +++ b/src/runtime/state/check_state_range.c @@ -1,5 +1,5 @@ #include "types.h" extern s64 call_global_state_resource(s32 resource, s32 first, s32 second) __asm__("CallGlobalStateResource"); -s64 CheckStateRange(s32 arg0) { - return (s64)(s32)(call_global_state_resource(arg0, 0, 0xA) << 32 >> 32); +s64 CheckStateRange(s32 resource) { + return (s64)(s32)(call_global_state_resource(resource, 0, 0xA) << 32 >> 32); } diff --git a/src/runtime/time/set_video_timing.c b/src/runtime/time/set_video_timing.c index 2912246841..22be6afdd3 100644 --- a/src/runtime/time/set_video_timing.c +++ b/src/runtime/time/set_video_timing.c @@ -13,8 +13,8 @@ extern f32 frame_scale_inv_macro __asm__("D_0015ED68") MACRO_ADDR; extern f32 frame_time_macro __asm__("D_0015ED6C") MACRO_ADDR; extern f32 frame_time_sq_macro __asm__("D_0015ED70") MACRO_ADDR; extern f32 frame_time_cube_macro __asm__("D_0015ED74") MACRO_ADDR; -void set_video_timing(s32 arg0) { - if (arg0 == 0) { +void set_video_timing(s32 pal_mode_enabled) { + if (pal_mode_enabled == 0) { pal_mode = 0; frame_scale_macro = 1.0f; frame_scale_sq_macro = 1.0f; diff --git a/src/sdk/dma/receive_data_from_ipu.c b/src/sdk/dma/receive_data_from_ipu.c index 5560efe3f3..9c9041f93d 100644 --- a/src/sdk/dma/receive_data_from_ipu.c +++ b/src/sdk/dma/receive_data_from_ipu.c @@ -1,12 +1,12 @@ #include "types.h" extern s32 DIntr(); extern void EnableInterrupts(); -void receiveDataFromIPU(s32 arg0, s32 arg1) { +void receiveDataFromIPU(s32 destination_address, s32 byte_count) { s32 old; old = DIntr(); - *(volatile u32 *)0x1000B010 = (arg0 & 0x0FFFFFFF) | 0x80000000; - *(volatile u32 *)0x1000B020 = arg1 >> 4; + *(volatile u32 *)0x1000B010 = (destination_address & 0x0FFFFFFF) | 0x80000000; + *(volatile u32 *)0x1000B020 = byte_count >> 4; *(volatile u32 *)0x1000B000 = 0x100; if (old != 0) { EnableInterrupts(0x100); diff --git a/src/sdk/dma/sce_dma_reset.c b/src/sdk/dma/sce_dma_reset.c index 0b7040afdb..97a43836c5 100644 --- a/src/sdk/dma/sce_dma_reset.c +++ b/src/sdk/dma/sce_dma_reset.c @@ -27,7 +27,7 @@ extern s32 DmaChannelsUsed[] __asm__("D_001533F8"); extern s32 Memclr(); extern s32 sceDmaPutEnv(); -s32 sceDmaReset(s32 arg0) { +s32 sceDmaReset(s32 enable_dma) { s32 buf[5]; s32 status; s32 i; @@ -50,7 +50,7 @@ s32 sceDmaReset(s32 arg0) { *(u32 *)0x1000E010 = mask; Memclr(buf, 0x14); sceDmaPutEnv(buf); - if (arg0 == 1) { + if (enable_dma == 1) { *(volatile u32 *)0x1000E000 |= 1; } return status; diff --git a/src/sdk/dma/set_d3_chcr.c b/src/sdk/dma/set_d3_chcr.c index e6c50a80c8..0fe19a0c90 100644 --- a/src/sdk/dma/set_d3_chcr.c +++ b/src/sdk/dma/set_d3_chcr.c @@ -3,10 +3,10 @@ extern s32 DIntr(); extern s32 EnableInterrupts(); -void SetD3Chcr(s32 arg0) { +void SetD3Chcr(s32 channel_control) { DIntr(); *(volatile u32 *)0x1000F590 = *(volatile u32 *)0x1000F520 | 0x10000; - *(volatile u32 *)0x1000B000 = arg0; + *(volatile u32 *)0x1000B000 = channel_control; *(volatile u32 *)0x1000F590 = *(volatile u32 *)0x1000F520 & 0xFFFEFFFF; EnableInterrupts(); } diff --git a/src/sdk/dma/set_d4_chcr.c b/src/sdk/dma/set_d4_chcr.c index 68c7db255f..6ec68a1950 100644 --- a/src/sdk/dma/set_d4_chcr.c +++ b/src/sdk/dma/set_d4_chcr.c @@ -3,10 +3,10 @@ extern s32 DIntr(); extern s32 EnableInterrupts(); -void SetD4Chcr(s32 arg0) { +void SetD4Chcr(s32 channel_control) { DIntr(); *(volatile u32 *)0x1000F590 = *(volatile u32 *)0x1000F520 | 0x10000; - *(volatile u32 *)0x1000B400 = arg0; + *(volatile u32 *)0x1000B400 = channel_control; *(volatile u32 *)0x1000F590 = *(volatile u32 *)0x1000F520 & 0xFFFEFFFF; EnableInterrupts(); } diff --git a/src/sdk/dma/set_d4_chcr_variant.c b/src/sdk/dma/set_d4_chcr_variant.c index c2606d5501..62524c6515 100644 --- a/src/sdk/dma/set_d4_chcr_variant.c +++ b/src/sdk/dma/set_d4_chcr_variant.c @@ -3,10 +3,10 @@ extern s32 DIntr(); extern s32 EnableInterrupts(); -void SetD4ChcrVariant(s32 arg0) { +void SetD4ChcrVariant(s32 chcr_value) { DIntr(); *(volatile u32 *)0x1000F590 = *(volatile u32 *)0x1000F520 | 0x10000; - *(volatile u32 *)0x1000B400 = arg0; + *(volatile u32 *)0x1000B400 = chcr_value; *(volatile u32 *)0x1000F590 = *(volatile u32 *)0x1000F520 & 0xFFFEFFFF; EnableInterrupts(); } diff --git a/src/sdk/input/sce_pad2_check_dma.c b/src/sdk/input/sce_pad2_check_dma.c index 07c6e7d9cf..a04ae4139a 100644 --- a/src/sdk/input/sce_pad2_check_dma.c +++ b/src/sdk/input/sce_pad2_check_dma.c @@ -15,12 +15,12 @@ extern PadPort D_0015B540[]; __attribute__((section(".data"))) extern DmaState D_00132DD8; -s32 scePad2CheckDma(s32 arg0) { +s32 scePad2CheckDma(s32 socket_index) { u32 sides[2]; u32 p; s32 value; - p = (u32)D_0015B540[arg0].unkC; + p = (u32)D_0015B540[socket_index].unkC; value = *(s32 *)(p + 0x7C); sides[0] = p; sides[1] = p + 0x80; diff --git a/src/sdk/input/sce_pad2_get_side.c b/src/sdk/input/sce_pad2_get_side.c index f8deec03db..052e2cb647 100644 --- a/src/sdk/input/sce_pad2_get_side.c +++ b/src/sdk/input/sce_pad2_get_side.c @@ -9,10 +9,10 @@ typedef struct PadPort { extern PadPort D_0015B540[]; extern void synchronize_cache_range(s32, s32) __asm__("func_00118F88"); -void *scePad2GetSide(s32 arg0) { +void *scePad2GetSide(s32 port_index) { u8 *sides[2]; - sides[0] = D_0015B540[arg0].unkC; + sides[0] = D_0015B540[port_index].unkC; sides[1] = sides[0] + 0x80; synchronize_cache_range((s32)sides[0], (s32)(sides[0] + 0x100)); return sides[*(s32 *)(sides[0] + 0x7C) < *(s32 *)(sides[1] + 0x7C)]; diff --git a/src/sdk/input/sce_pad2_link_driver.c b/src/sdk/input/sce_pad2_link_driver.c index 180703f950..6b3f3c1211 100644 --- a/src/sdk/input/sce_pad2_link_driver.c +++ b/src/sdk/input/sce_pad2_link_driver.c @@ -7,12 +7,12 @@ struct Pad { }; extern struct Pad D_0015B540[]; extern s32 sceDbcGetDepNumber(); -s32 scePad2LinkDriver(s32 arg0) { +s32 scePad2LinkDriver(s32 socket_index) { s32 dep; dep = sceDbcGetDepNumber(); if (dep < 0) return dep; - D_0015B540[arg0].unk8 = dep; - D_0015B540[arg0].unk4 = 1; + D_0015B540[socket_index].unk8 = dep; + D_0015B540[socket_index].unk4 = 1; return dep; } diff --git a/src/sdk/library/_PES_packet.c b/src/sdk/library/_PES_packet.c index c3571452bc..88bd462396 100644 --- a/src/sdk/library/_PES_packet.c +++ b/src/sdk/library/_PES_packet.c @@ -32,18 +32,18 @@ struct PES_TBL { u8 v[16]; } __attribute__((packed)); -s32 _PES_packet(s32 arg0, struct PES_BS *bs, struct PES_HDR *hdr) { +s32 _PES_packet(s32 error_context, struct PES_BS *bs, struct PES_HDR *hdr) { struct PES_TBL tbl; s32 ctx; s32 flag1; s32 len; /* PES_header_data_length */ s32 base; /* (s32)bs->stamp, captured before the header fields */ s64 now; /* the same stamp, re-read at the sync point */ - s32 v7; /* PTS_DTS_flags */ + s32 pts_dts_flags; /* PTS_DTS_flags */ s32 v8; /* 4-bit length, indexes tbl */ - s32 v5; /* PES_extension_flag */ + s32 pes_extension_flag; /* PES_extension_flag */ - ctx = arg0; + ctx = error_context; hdr->unk28 = (s32)bs->stamp; tbl = *(struct PES_TBL *)D_001539C8; _sysbitGet(bs, 0x18); @@ -58,13 +58,13 @@ s32 _PES_packet(s32 arg0, struct PES_BS *bs, struct PES_HDR *hdr) { _sysbitGet(bs, 2); hdr->unkC = _sysbitGet(bs, 2); _sysbitGet(bs, 4); - v7 = _sysbitGet(bs, 2); + pts_dts_flags = _sysbitGet(bs, 2); flag1 = _sysbitGet(bs, 1); v8 = _sysbitGet(bs, 4); - v5 = _sysbitGet(bs, 1); + pes_extension_flag = _sysbitGet(bs, 1); len = _sysbitGet(bs, 8); base = bs->stamp; - if (v7 & 2) { + if (pts_dts_flags & 2) { u32 a, b, c; _sysbitGet(bs, 4); a = _sysbitGet(bs, 3); @@ -75,7 +75,7 @@ s32 _PES_packet(s32 arg0, struct PES_BS *bs, struct PES_HDR *hdr) { _sysbitMarker(bs); hdr->unk10 = ((s64)((a >> 2) & 1) << 0x20) | (s64)(u32)(a << 30 | b << 15 | c); } - if (v7 == 3) { + if (pts_dts_flags == 3) { u32 a, b, c; _sysbitGet(bs, 4); a = _sysbitGet(bs, 3); @@ -92,34 +92,34 @@ s32 _PES_packet(s32 arg0, struct PES_BS *bs, struct PES_HDR *hdr) { if (v8 != 0) { _sysbitGet(bs, tbl.v[v8]); } - if (v5 == 1) { + if (pes_extension_flag == 1) { s32 a1; - s32 a2; + s32 pack_header_field_flag; s32 a3; s32 a4; - s32 a5; + s32 pes_extension_2_flag; a1 = _sysbitGet(bs, 1); - a2 = _sysbitGet(bs, 1); + pack_header_field_flag = _sysbitGet(bs, 1); a3 = _sysbitGet(bs, 1); a4 = _sysbitGet(bs, 1); _sysbitGet(bs, 3); - a5 = _sysbitGet(bs, 1); - if (a1 == v5) { + pes_extension_2_flag = _sysbitGet(bs, 1); + if (a1 == pes_extension_flag) { _sysbitGet(bs, 0x30); _sysbitGet(bs, 0x30); _sysbitGet(bs, 0x20); } - if (a2 == v5) { + if (pack_header_field_flag == pes_extension_flag) { _Error(ctx, D_001539D8); return 0; } - if (a3 == v5) { + if (a3 == pes_extension_flag) { _sysbitGet(bs, 0x10); } - if (a4 == v5) { + if (a4 == pes_extension_flag) { _sysbitGet(bs, 0x10); } - if (a5 == v5) { + if (pes_extension_2_flag == pes_extension_flag) { u32 i; u32 n; _sysbitMarker(bs); diff --git a/src/sdk/library/_decMB0.c b/src/sdk/library/_decMB0.c index 2a69719f09..71f3d9b98b 100644 --- a/src/sdk/library/_decMB0.c +++ b/src/sdk/library/_decMB0.c @@ -22,7 +22,7 @@ extern s32 _nextBit(struct MpegDecoder *, s32); extern void _sendIpuCommand(); extern void _waitIpuIdle(); extern void receiveDataFromIPU(); -int _decMB0(struct MpegDecoder *decoder, int *mb_type, int *motion_type, int *dct_type_out, struct MpegMbState *arg4, +int _decMB0(struct MpegDecoder *decoder, int *mb_type, int *motion_type, int *dct_type_out, struct MpegMbState *motion_vector_state, int *arg5, int arg6) { int *sp20; int *sp24; @@ -89,22 +89,22 @@ int _decMB0(struct MpegDecoder *decoder, int *mb_type, int *motion_type, int *dc } if (((*mb_type) & 8) || (((*mb_type) & 1) && (decoder->concealment_motion_vectors != 0))) { if (decoder->unk848 != 0) { - _motionVectors(decoder, arg4, arg6, sp24, 0, var_19_84, var_20_86, decoder->f_code_forward_h - 1, + _motionVectors(decoder, motion_vector_state, arg6, sp24, 0, var_19_84, var_20_86, decoder->f_code_forward_h - 1, decoder->f_code_forward_v - 1, motion_flag, var_23_95); } else { temp_7_163 = decoder->unk158 - 1; - _motionVector(decoder, arg4, arg6, temp_7_163, temp_7_163, 0, 0, decoder->unk154); + _motionVector(decoder, motion_vector_state, arg6, temp_7_163, temp_7_163, 0, 0, decoder->unk154); } } var_2_172 = 0; if (decoder->unk11C == 0) { if ((*mb_type) & 4) { if (decoder->unk848 != 0) { - _motionVectors(decoder, arg4, arg6, sp24, 1, var_19_84, var_20_86, decoder->f_code_backward_h - 1, + _motionVectors(decoder, motion_vector_state, arg6, sp24, 1, var_19_84, var_20_86, decoder->f_code_backward_h - 1, decoder->f_code_backward_v - 1, 0, var_23_95); } else { temp_7_200 = decoder->unk160 - 1; - _motionVector(decoder, ((u8 *)arg4) + 8, arg6, temp_7_200, temp_7_200, 0, 0, + _motionVector(decoder, ((u8 *)motion_vector_state) + 8, arg6, temp_7_200, temp_7_200, 0, 0, decoder->unk15C); } } @@ -136,21 +136,21 @@ int _decMB0(struct MpegDecoder *decoder, int *mb_type, int *motion_type, int *dc } if ((((*mb_type) & 1) || ((decoder->dc_reset = 1, ((*mb_type) & 1) != 0))) && (decoder->concealment_motion_vectors == 0)) { - arg4->unk14 = 0; - arg4->unk10 = 0; - arg4->unk4 = 0; - arg4->unk0 = 0; - arg4->unk1C = 0; - arg4->unk18 = 0; - arg4->unkC = 0; - arg4->unk8 = 0; + motion_vector_state->unk14 = 0; + motion_vector_state->unk10 = 0; + motion_vector_state->unk4 = 0; + motion_vector_state->unk0 = 0; + motion_vector_state->unk1C = 0; + motion_vector_state->unk18 = 0; + motion_vector_state->unkC = 0; + motion_vector_state->unk8 = 0; } temp_4_287 = decoder->picture_coding_type; var_2_172 = 1; if (temp_4_287 == 2) { var_2_172 = 1; if (!((*mb_type) & 9)) { - arg4->unk0 = (arg4->unk4 = (arg4->unk10 = (arg4->unk14 = 0))); + motion_vector_state->unk0 = (motion_vector_state->unk4 = (motion_vector_state->unk10 = (motion_vector_state->unk14 = 0))); if (decoder->picture_structure == 3) { *motion_type = temp_4_287; } else { diff --git a/src/sdk/library/_decodeOrSkip.c b/src/sdk/library/_decodeOrSkip.c index a2679c06ae..92c76c0503 100644 --- a/src/sdk/library/_decodeOrSkip.c +++ b/src/sdk/library/_decodeOrSkip.c @@ -3,9 +3,9 @@ extern s32 _decodeOrSkipFrame(); extern s32 _decodeOrSkipField(); -s32 _decodeOrSkip(s32 mp, s32 arg1, s32 arg2) { +s32 _decodeOrSkip(s32 mp, s32 arg1, s32 skip_threshold) { if ((*(s32 **)(mp + 0x40))[0x5D] != 3) { - return _decodeOrSkipField(mp, arg1, arg2); + return _decodeOrSkipField(mp, arg1, skip_threshold); } - return _decodeOrSkipFrame(mp, arg1, arg2); + return _decodeOrSkipFrame(mp, arg1, skip_threshold); } diff --git a/src/sdk/library/_decodeOrSkipField.c b/src/sdk/library/_decodeOrSkipField.c index d427793436..39850ce5dd 100644 --- a/src/sdk/library/_decodeOrSkipField.c +++ b/src/sdk/library/_decodeOrSkipField.c @@ -9,26 +9,26 @@ extern s32 _updateRefImage(); extern void _outputFrame(); s32 _decodeOrSkipField(struct sceMpeg *decoder, s32 arg1, s32 arg2) { struct MpegDecoder *p; - s32 bVar3; + s32 should_decode; unsigned int new_var2; - s32 iVar4; + s32 expected_second_field_structure; long lVar5; s32 uVar2; - s32 uVar7; + s32 second_field_decode_nonzero; short new_var; s32 gate; - bVar3 = 0; + should_decode = 0; p = decoder->sys; p->second_field = 0; if ((arg2 == (-1)) || (arg1 < arg2)) { - bVar3 = 1; + should_decode = 1; }; if (p->unk8 == 0) { decoder->frameCount = 0; p->unk8 = 1; } lVar5 = _updateRefImage(p, 0); - if ((lVar5 != 0) && (bVar3 != 0)) { + if ((lVar5 != 0) && (should_decode != 0)) { _decPicture(p); } p->second_field = 1; @@ -38,11 +38,11 @@ s32 _decodeOrSkipField(struct sceMpeg *decoder, s32 arg1, s32 arg2) { p->unk0 = 1; return 0; } - iVar4 = 2; + expected_second_field_structure = 2; if (p->unkD4 != 1) { - iVar4 = 1; + expected_second_field_structure = 1; } - if (p->picture_structure != iVar4) { + if (p->picture_structure != expected_second_field_structure) { return -1; } new_var2 = _updateRefImage(p, 1); @@ -50,15 +50,15 @@ s32 _decodeOrSkipField(struct sceMpeg *decoder, s32 arg1, s32 arg2) { if (new_var2 != 0) { gate = 1; } - uVar7 = 0; + second_field_decode_nonzero = 0; if (gate != 0) { - if (bVar3 == 0) { + if (should_decode == 0) { uVar2 = p->frame_count; goto out; } lVar5 = _decPicture(p); if (lVar5 != 0) { - uVar7 = 1; + second_field_decode_nonzero = 1; } }; out: @@ -68,8 +68,8 @@ s32 _decodeOrSkipField(struct sceMpeg *decoder, s32 arg1, s32 arg2) { decoder->frameCount = p->frame_count - p->frame_base; p->frame_count = p->frame_count + 1; p->unk4 = (unsigned long long)(p->unk4 + 1); - if (bVar3 == 0) { + if (should_decode == 0) { _dispatchMpegCbNodata(decoder); } - return uVar7; + return second_field_decode_nonzero; } diff --git a/src/sdk/library/_decodeOrSkipFrame.c b/src/sdk/library/_decodeOrSkipFrame.c index ada6793db6..1940cf8f82 100644 --- a/src/sdk/library/_decodeOrSkipFrame.c +++ b/src/sdk/library/_decodeOrSkipFrame.c @@ -4,14 +4,14 @@ extern s32 _decPicture(struct MpegDecoder *a0); extern void _dispatchMpegCbNodata(struct sceMpeg *a0); extern void _outputFrame(struct MpegDecoder *a0, s32 a1, s32 a2); extern s32 _updateRefImage(struct MpegDecoder *a0, s32 a1); -s32 _decodeOrSkipFrame(struct sceMpeg *decoder, s32 arg1, s32 arg2) { +s32 _decodeOrSkipFrame(struct sceMpeg *decoder, s32 arg1, s32 skip_threshold) { s32 ret; s32 flag; s32 t; struct MpegDecoder *tmp; flag = 0; tmp = decoder->sys; - if ((arg2 == -1) || (arg1 < arg2)) { + if ((skip_threshold == -1) || (arg1 < skip_threshold)) { if (tmp->unk8 == 0) { decoder->frameCount = 0; tmp->unk8 = 1; diff --git a/src/sdk/library/_dispRefImage.c b/src/sdk/library/_dispRefImage.c index cf084c402a..d78d8f3f45 100644 --- a/src/sdk/library/_dispRefImage.c +++ b/src/sdk/library/_dispRefImage.c @@ -13,32 +13,32 @@ extern s32 _cpr8(); extern s32 _csc_storeRefImage(); extern s32 _getPtsDtsFlags(); extern s32 _isOutSizeOK(); -void _dispRefImage(struct MpegDecoder *decoder, struct MpegRefImage *arg1) { +void _dispRefImage(struct MpegDecoder *decoder, struct MpegRefImage *ref_image) { u64 temp_6_28; struct MpegDisplayState *ref_info; s32 *temp_7_9; temp_7_9 = (s32 *)decoder->mpeg; - _getPtsDtsFlags(decoder, arg1, (s32 *)((u8 *)temp_7_9 + 0x10), (s32 *)((u8 *)temp_7_9 + 0x18), + _getPtsDtsFlags(decoder, ref_image, (s32 *)((u8 *)temp_7_9 + 0x10), (s32 *)((u8 *)temp_7_9 + 0x18), (s32 *)((u8 *)temp_7_9 + 0x20)); ref_info = (struct MpegDisplayState *)decoder->mpeg; decoder->unk80 = (s32)ref_info->unk10; temp_6_28 = D_00132E98[(s32)(ref_info->unk20 >> 5) & 0xF]; - decoder->unkCC = (s32)arg1->unk5C; + decoder->unkCC = (s32)ref_image->unk5C; decoder->unk88 = temp_6_28; - decoder->unkD0 = (s32)arg1->unk60; - decoder->unkB4 = (s32)arg1->unk44; - decoder->unkB8 = (s32)arg1->unk48; - decoder->unkBC = (s32)arg1->unk4C; - decoder->unkC0 = (s32)arg1->unk50; - decoder->unkC4 = (s32)arg1->unk54; - decoder->unkC8 = (s32)arg1->unk58; - if (_isOutSizeOK(decoder, arg1) != 0) { - if (arg1->status == 1) { + decoder->unkD0 = (s32)ref_image->unk60; + decoder->unkB4 = (s32)ref_image->unk44; + decoder->unkB8 = (s32)ref_image->unk48; + decoder->unkBC = (s32)ref_image->unk4C; + decoder->unkC0 = (s32)ref_image->unk50; + decoder->unkC4 = (s32)ref_image->unk54; + decoder->unkC8 = (s32)ref_image->unk58; + if (_isOutSizeOK(decoder, ref_image) != 0) { + if (ref_image->status == 1) { if (decoder->unkB0 != 0) { - _csc_storeRefImage(decoder, arg1); + _csc_storeRefImage(decoder, ref_image); } else { - _cpr8(decoder, arg1); + _cpr8(decoder, ref_image); } func_00129B38(decoder); } diff --git a/src/sdk/library/_flushBuf.c b/src/sdk/library/_flushBuf.c index 0ad9018122..bd6bff8570 100644 --- a/src/sdk/library/_flushBuf.c +++ b/src/sdk/library/_flushBuf.c @@ -35,7 +35,7 @@ typedef struct FlushBufContext { extern s32 _dispatchMpegCbNodata(); extern s64 _waitIpuIdle64(); -void _flushBuf(FlushBufContext *context, s32 arg1) { +void _flushBuf(FlushBufContext *context, s32 bit_count) { s32 value; s32 counter; u32 command; @@ -43,7 +43,7 @@ void _flushBuf(FlushBufContext *context, s32 arg1) { s32 index; s64 idle_result; - value = arg1; + value = bit_count; counter = 0; if ((*(volatile u32 *)0x10002010 & 0x80004000) == 0x80000000) { do { diff --git a/src/sdk/library/_lastFrame.c b/src/sdk/library/_lastFrame.c index b42d8d8656..382b461997 100644 --- a/src/sdk/library/_lastFrame.c +++ b/src/sdk/library/_lastFrame.c @@ -5,17 +5,17 @@ extern s32 _Error(struct MpegDecoder *, u8 *, s32); extern s32 _dispRefImage(struct MpegDecoder *, struct MpegRefImage *, s32); extern s32 _dispRefImageField(struct MpegDecoder *, struct MpegRefImage *, struct MpegRefImage *, s32); -void _lastFrame(struct MpegDecoder *arg0) { +void _lastFrame(struct MpegDecoder *decoder) { s32 count; - count = arg0->frame_count; - if (arg0->second_field != 0) { - _Error(arg0, D_00153AB8, count); + count = decoder->frame_count; + if (decoder->second_field != 0) { + _Error(decoder, D_00153AB8, count); } else { - if (arg0->picture_structure == 3) { - _dispRefImage(arg0, arg0->ref_images[1], count - 1); + if (decoder->picture_structure == 3) { + _dispRefImage(decoder, decoder->ref_images[1], count - 1); } else { - _dispRefImageField(arg0, arg0->ref_images[5], arg0->ref_images[9], count - 1); + _dispRefImageField(decoder, decoder->ref_images[5], decoder->ref_images[9], count - 1); } } - arg0->second_field = 0; + decoder->second_field = 0; } diff --git a/src/sdk/library/_pack_header.c b/src/sdk/library/_pack_header.c index e24ac760db..86f8a9f275 100644 --- a/src/sdk/library/_pack_header.c +++ b/src/sdk/library/_pack_header.c @@ -10,7 +10,7 @@ extern s32 SignExtendPackedValue(); extern s32 _sysbitGet(); extern s32 _sysbitMarker(); extern s32 _system_header(); -s32 _pack_header(s32 arg0, struct PackHeaderInfo *arg1) { +s32 _pack_header(s32 bitstream_context, struct PackHeaderInfo *pack_header_info) { u32 temp_16_20; u32 temp_17_26; u32 temp_18_32; @@ -18,31 +18,31 @@ s32 _pack_header(s32 arg0, struct PackHeaderInfo *arg1) { u32 var_21_16; var_21_16 = 0; - _sysbitGet(arg0, 0x22); - temp_16_20 = _sysbitGet(arg0, 3); - _sysbitMarker(arg0); - temp_17_26 = _sysbitGet(arg0, 0xF); - _sysbitMarker(arg0); - temp_18_32 = _sysbitGet(arg0, 0xF); - _sysbitMarker(arg0); - arg1->unk0 = _sysbitGet(arg0, 9); - _sysbitGet(arg0, 0x1E); - temp_20_45 = _sysbitGet(arg0, 3); - arg1->unk8 = (s32)((temp_16_20 >> 2) & 1); - arg1->unk4 = (s32)((temp_16_20 << 0x1E) | (temp_17_26 << 0xF) | temp_18_32); + _sysbitGet(bitstream_context, 0x22); + temp_16_20 = _sysbitGet(bitstream_context, 3); + _sysbitMarker(bitstream_context); + temp_17_26 = _sysbitGet(bitstream_context, 0xF); + _sysbitMarker(bitstream_context); + temp_18_32 = _sysbitGet(bitstream_context, 0xF); + _sysbitMarker(bitstream_context); + pack_header_info->unk0 = _sysbitGet(bitstream_context, 9); + _sysbitGet(bitstream_context, 0x1E); + temp_20_45 = _sysbitGet(bitstream_context, 3); + pack_header_info->unk8 = (s32)((temp_16_20 >> 2) & 1); + pack_header_info->unk4 = (s32)((temp_16_20 << 0x1E) | (temp_17_26 << 0xF) | temp_18_32); if (temp_20_45 != 0) { do { do { - _sysbitGet(arg0, 8); + _sysbitGet(bitstream_context, 8); var_21_16 += 1; } while (var_21_16 < temp_20_45); } while (0); } - if (SignExtendPackedValue(arg0, 0x20) == 0x1BB) { - arg1->unkC = 1; - _system_header(arg0, arg1); + if (SignExtendPackedValue(bitstream_context, 0x20) == 0x1BB) { + pack_header_info->unkC = 1; + _system_header(bitstream_context, pack_header_info); } else { - arg1->unkC = 0; + pack_header_info->unkC = 0; } return 1; } diff --git a/src/sdk/library/cpr8.c b/src/sdk/library/cpr8.c index 5b393331e4..16568d37d8 100644 --- a/src/sdk/library/cpr8.c +++ b/src/sdk/library/cpr8.c @@ -19,7 +19,7 @@ struct MpegDecoderFrame { extern s32 DIntr(); extern s32 EnableInterrupts(); -void _cpr8(struct MpegDecoder *arg0, struct MpegCopyParams *arg1) { +void _cpr8(struct MpegDecoder *decoder, struct MpegCopyParams *copy_params) { struct MpegDecoderFrame *sp0; s32 sp4; s32 sp8; @@ -35,9 +35,9 @@ void _cpr8(struct MpegDecoder *arg0, struct MpegCopyParams *arg1) { s32 var_3_29; s32 var_5_64; - sp0 = (struct MpegDecoderFrame *)arg0; - var_18_22 = arg1->unk0 & 0x0FFFFFFF; - sp8 = arg0->unkD8 & 0x0FFFFFFF; + sp0 = (struct MpegDecoderFrame *)decoder; + var_18_22 = copy_params->unk0 & 0x0FFFFFFF; + sp8 = decoder->unkD8 & 0x0FFFFFFF; if (sp0->unk174 == 3) { goto block_3; } @@ -50,7 +50,7 @@ void _cpr8(struct MpegDecoder *arg0, struct MpegCopyParams *arg1) { block_3: var_3_29 = sp0->unkE0; block_4: - var_21_38 = arg1->unk10 * 0x180; + var_21_38 = copy_params->unk10 * 0x180; var_20_40 = var_21_38 >> 4; if (var_3_29 == 0) { goto block_6; @@ -64,14 +64,14 @@ void _cpr8(struct MpegDecoder *arg0, struct MpegCopyParams *arg1) { goto block_9; block_8: var_30_43 = (temp_4_27 >> 4) * 0xC0; - var_21_38 = ((s32)arg1->unk10 >> 1) * 0x180; + var_21_38 = ((s32)copy_params->unk10 >> 1) * 0x180; sp4 = 2; var_20_40 = var_21_38 >> 4; block_9: var_5_64 = 0; while (var_5_64 < sp4) { var_17_68 = sp8; - for (var_16_70 = 0; var_16_70 < arg1->unkC; var_16_70++) { + for (var_16_70 = 0; var_16_70 < copy_params->unkC; var_16_70++) { temp_2_73 = DIntr(); *(volatile s32 *)0x1000D480 = 0; *(volatile s32 *)0x1000D410 = var_18_22; diff --git a/src/sdk/library/decode_motion_vector.c b/src/sdk/library/decode_motion_vector.c index c9ced751f3..588cc6a76a 100644 --- a/src/sdk/library/decode_motion_vector.c +++ b/src/sdk/library/decode_motion_vector.c @@ -3,7 +3,7 @@ void decode_motion_vector(s32 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) __asm__("FUN_001280a8"); -void decode_motion_vector(s32 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { +void decode_motion_vector(s32 *motion_vector, s32 delta_shift, s32 motion_code, s32 motion_residual, s32 arg4) { int new_var; s32 temp_4_5; int new_var3; @@ -11,13 +11,13 @@ void decode_motion_vector(s32 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { s32 temp_9_6; s32 var_2_17; s32 var_4_9; - temp_4_5 = *arg0; + temp_4_5 = *motion_vector; new_var = 1; - temp_9_6 = 0x10 << arg1; + temp_9_6 = 0x10 << delta_shift; var_4_9 = (arg4 != 0) ? (temp_4_5 >> new_var) : (temp_4_5); - new_var3 = arg2 > 0; + new_var3 = motion_code > 0; if (new_var3) { - var_4_9 = (var_4_9 + new_var) + (((arg2 - new_var) << arg1) + arg3); + var_4_9 = (var_4_9 + new_var) + (((motion_code - new_var) << delta_shift) + motion_residual); var_2_17 = var_4_9 * 2; if (var_4_9 >= temp_9_6) { var_4_9 -= temp_9_6 * 2; @@ -25,9 +25,9 @@ void decode_motion_vector(s32 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { } } else { var_2_17 = var_4_9 * 2; - if (arg2 < 0) { - new_var2 = (~arg2) << arg1; - var_4_9 = (var_4_9 - new_var) - (new_var2 + arg3); + if (motion_code < 0) { + new_var2 = (~motion_code) << delta_shift; + var_4_9 = (var_4_9 - new_var) - (new_var2 + motion_residual); if (var_4_9 < (-temp_9_6)) { temp_9_6 = temp_9_6 * 2; new_var3 = temp_9_6; @@ -41,13 +41,13 @@ void decode_motion_vector(s32 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { ; } } - if (arg2) { + if (motion_code) { { new_var3 = arg4 != 0; } - *arg0 = (new_var3) ? (var_4_9 * 2) : (var_4_9); + *motion_vector = (new_var3) ? (var_4_9 * 2) : (var_4_9); } else { - *arg0 = (arg4 != 0) ? (var_4_9 * 2) : (var_4_9); + *motion_vector = (arg4 != 0) ? (var_4_9 * 2) : (var_4_9); } } diff --git a/src/sdk/library/dpsub.c b/src/sdk/library/dpsub.c index 55e8bf7333..c796b6f166 100644 --- a/src/sdk/library/dpsub.c +++ b/src/sdk/library/dpsub.c @@ -49,11 +49,11 @@ struct DpsubWork { s64 unk60; s64 unk68; }; -void dpsub(s64 arg0, s64 arg1) { +void dpsub(s64 minuend, s64 subtrahend) { struct DpsubWork work; - work.unk60 = arg0; - work.unk68 = arg1; + work.unk60 = minuend; + work.unk68 = subtrahend; __unpack_d(&work.unk60, &work); __unpack_d(&work.unk68, &work.unk20); work.unk24 ^= 1; diff --git a/src/sdk/library/fun_00129b38.c b/src/sdk/library/fun_00129b38.c index 266125748e..efc071cc69 100644 --- a/src/sdk/library/fun_00129b38.c +++ b/src/sdk/library/fun_00129b38.c @@ -33,8 +33,8 @@ typedef struct Obj40 { the entry budget at +0xE0; an unsized one has to fit width * height against +0xE4. On a refusal, format the two figures into the message at D_00153A80 and report it. Returns whether it fits. */ -int FUN_00129b38(void *arg0) { - Obj40 *s = (Obj40 *)arg0; +int FUN_00129b38(void *object) { + Obj40 *s = (Obj40 *)object; int r = 1; if (s->unk008 != 2) { int v = s->unk118; diff --git a/src/sdk/library/get_iob.c b/src/sdk/library/get_iob.c index 8657cd7156..2ba42f4a5a 100644 --- a/src/sdk/library/get_iob.c +++ b/src/sdk/library/get_iob.c @@ -25,16 +25,16 @@ extern s32 WaitSema(); extern s32 SignalSema(); extern u8 D_00157D80[]; -void *get_iob(u32 arg0) { +void *get_iob(u32 slot_index) { void *result; _sceFsIobSemaMK(); WaitSema(D_0012FCA0[0]); - if (arg0 >= 32) { + if (slot_index >= 32) { SignalSema(D_0012FCA0[0]); return 0; } - result = (void *)&D_00157D80[arg0 << 4]; + result = (void *)&D_00157D80[slot_index << 4]; SignalSema(D_0012FCA0[0]); return result; } diff --git a/src/sdk/library/is_out_size_ok.c b/src/sdk/library/is_out_size_ok.c index 607a376f6e..d845f7b57c 100644 --- a/src/sdk/library/is_out_size_ok.c +++ b/src/sdk/library/is_out_size_ok.c @@ -5,34 +5,34 @@ const u8 D_00153980[] = "Too small buffer size for %dx%d picture\n"; extern s32 _Error(void *a, void *b); extern s32 sprintf(char *d, char *f, ...); -s32 _isOutSizeOK(struct MpegDecoder *arg0, struct MpegRefImage *arg1) { +s32 _isOutSizeOK(struct MpegDecoder *decoder, struct MpegRefImage *reference_image) { char sp_slot[0x100]; s32 t; int new_var2; struct MpegRefImage *new_var; - s32 s1; - t = arg0->out_max_height; + s32 out_size_ok; + t = decoder->out_max_height; if (t != 0) { - s1 = 0; - new_var = arg1; - if (arg0->out_max_width < arg1->width) { + out_size_ok = 0; + new_var = reference_image; + if (decoder->out_max_width < reference_image->width) { goto tail; } - new_var2 = t < arg1->height; - if (arg1->unk10) { - s1 = (t < new_var->height) ^ 1; + new_var2 = t < reference_image->height; + if (reference_image->unk10) { + out_size_ok = (t < new_var->height) ^ 1; goto tail; } else { - s1 = new_var2 ^ 1; + out_size_ok = new_var2 ^ 1; goto tail; } } else { - s1 = (arg0->out_max_size < (arg1->unkC * arg1->unk10)) ^ 1; + out_size_ok = (decoder->out_max_size < (reference_image->unkC * reference_image->unk10)) ^ 1; } tail: - if (s1 == 0) { - sprintf(sp_slot, (char *)D_00153980, arg1->width, arg1->height); - _Error(arg0, sp_slot); + if (out_size_ok == 0) { + sprintf(sp_slot, (char *)D_00153980, reference_image->width, reference_image->height); + _Error(decoder, sp_slot); } - return s1; + return out_size_ok; } diff --git a/src/sdk/library/lshift.c b/src/sdk/library/lshift.c index 1c58929b61..4705ac0912 100644 --- a/src/sdk/library/lshift.c +++ b/src/sdk/library/lshift.c @@ -33,7 +33,7 @@ struct Bigint { extern struct Bigint *_Balloc(s32, s32); extern s32 InsertLinkObject(); -struct Bigint *_lshift(s32 arg0, struct Bigint *arg1, s32 arg2) { +struct Bigint *_lshift(s32 arg0, struct Bigint *input_bigint, s32 shift_bits) { s32 i; s32 k1; s32 n; @@ -44,10 +44,10 @@ struct Bigint *_lshift(s32 arg0, struct Bigint *arg1, s32 arg2) { u32 *xe; u32 z; - n = arg2 >> 5; - k1 = arg1->_k; - n1 = n + arg1->_wds + 1; - for (i = arg1->_maxwds; n1 > i; i <<= 1) { + n = shift_bits >> 5; + k1 = input_bigint->_k; + n1 = n + input_bigint->_wds + 1; + for (i = input_bigint->_maxwds; n1 > i; i <<= 1) { k1++; } b1 = _Balloc(arg0, k1); @@ -55,13 +55,13 @@ struct Bigint *_lshift(s32 arg0, struct Bigint *arg1, s32 arg2) { for (i = 0; i < n; i++) { *x1++ = 0; } - x = arg1->_x; - xe = x + arg1->_wds; - if (arg2 &= 0x1F) { - k1 = 32 - arg2; + x = input_bigint->_x; + xe = x + input_bigint->_wds; + if (shift_bits &= 0x1F) { + k1 = 32 - shift_bits; z = 0; do { - *x1++ = *x << arg2 | z; + *x1++ = *x << shift_bits | z; z = *x++ >> k1; } while (x < xe); if ((*x1 = z) != 0) { @@ -73,6 +73,6 @@ struct Bigint *_lshift(s32 arg0, struct Bigint *arg1, s32 arg2) { } while (x < xe); } b1->_wds = n1 - 1; - InsertLinkObject(arg0, arg1); + InsertLinkObject(arg0, input_bigint); return b1; } diff --git a/src/sdk/library/motion_vector.c b/src/sdk/library/motion_vector.c index 3aa88c8db3..f24cbf69fb 100644 --- a/src/sdk/library/motion_vector.c +++ b/src/sdk/library/motion_vector.c @@ -15,35 +15,35 @@ extern s32 _ipuVdec(); extern s32 _nextBit(); extern s32 decode_motion_vector() __asm__("func_001280A8"); -void _motionVector(s32 arg0, struct MotionVector *arg1, struct MotionVectorStore *arg2, s32 arg3, s32 arg4, - s32 arg5, s32 arg6, s32 arg7) { +void _motionVector(s32 decoder_state, struct MotionVector *motion_vector, struct MotionVectorStore *arg2, s32 first_component_bit_count, s32 second_component_bit_count, + s32 arg5, s32 halve_second_component_for_decode, s32 arg7) { s32 code; s32 bits; - code = _ipuVdec(arg0, 2); - if (arg3 != 0 && code != 0) { - bits = _nextBit(arg0, arg3); + code = _ipuVdec(decoder_state, 2); + if (first_component_bit_count != 0 && code != 0) { + bits = _nextBit(decoder_state, first_component_bit_count); } else { bits = 0; } - decode_motion_vector(arg1, arg3, code, bits, arg7); + decode_motion_vector(motion_vector, first_component_bit_count, code, bits, arg7); if (arg5 != 0) { - arg2->unk0 = InitializeMemoryCardDirectory(arg0); + arg2->unk0 = InitializeMemoryCardDirectory(decoder_state); } - code = _ipuVdec(arg0, 2); - if (arg4 != 0 && code != 0) { - bits = _nextBit(arg0, arg4); + code = _ipuVdec(decoder_state, 2); + if (second_component_bit_count != 0 && code != 0) { + bits = _nextBit(decoder_state, second_component_bit_count); } else { bits = 0; } - if (arg6 != 0) { - arg1->unk4 >>= 1; + if (halve_second_component_for_decode != 0) { + motion_vector->unk4 >>= 1; } - decode_motion_vector((u8 *)arg1 + 4, arg4, code, bits, arg7); - if (arg6 != 0) { - arg1->unk4 *= 2; + decode_motion_vector((u8 *)motion_vector + 4, second_component_bit_count, code, bits, arg7); + if (halve_second_component_for_decode != 0) { + motion_vector->unk4 *= 2; } if (arg5 != 0) { - arg2->unk4 = InitializeMemoryCardDirectory(arg0); + arg2->unk4 = InitializeMemoryCardDirectory(decoder_state); } } diff --git a/src/sdk/library/nextstartcode.c b/src/sdk/library/nextstartcode.c index e6e803ff41..9652e4ce01 100644 --- a/src/sdk/library/nextstartcode.c +++ b/src/sdk/library/nextstartcode.c @@ -2,16 +2,16 @@ extern void _waitIpuIdle(s32 *ctx); extern s32 _peepBit(s32 *ctx, s32 count); extern void _flushBuf(s32 *ctx, s32 count); -void _nextStartCode(s32 *arg0) { +void _nextStartCode(s32 *decoder_state) { s32 raw; s32 amount; - _waitIpuIdle(arg0); + _waitIpuIdle(decoder_state); raw = *(volatile s32 *)0x10002020; amount = (-(raw & 7)) & 7; if (amount != 0) { - _flushBuf(arg0, amount); + _flushBuf(decoder_state, amount); } - while (_peepBit(arg0, 0x18) != 1) { - _flushBuf(arg0, 8); + while (_peepBit(decoder_state, 0x18) != 1) { + _flushBuf(decoder_state, 8); } } diff --git a/src/sdk/library/outputframe.c b/src/sdk/library/outputframe.c index fbc5ef89a2..c8a0711968 100644 --- a/src/sdk/library/outputframe.c +++ b/src/sdk/library/outputframe.c @@ -4,12 +4,12 @@ #include "rnc/sdk/libmpeg.h" extern s32 _dispRefImage(struct MpegDecoder *mpeg, struct MpegRefImage *arg1, s32 arg2); extern s32 _dispRefImageField(struct MpegDecoder *mpeg, struct MpegRefImage *arg1, struct MpegRefImage *arg2, s32 arg3); -void _outputFrame(struct MpegDecoder *mpeg, s32 arg1, s32 arg2) { +void _outputFrame(struct MpegDecoder *mpeg, s32 arg1, s32 output_enabled) { struct MpegRefImage *var_5_14; struct MpegRefImage *var_5_24; struct MpegRefImage *var_6_27; - if (arg2 != 0) { + if (output_enabled != 0) { if (mpeg->picture_structure == 3) { if (mpeg->picture_coding_type == 3) { var_5_14 = mpeg->ref_images[3]; diff --git a/src/sdk/library/read.c b/src/sdk/library/read.c index ced1fc3ffa..0e2dfdad99 100644 --- a/src/sdk/library/read.c +++ b/src/sdk/library/read.c @@ -10,8 +10,8 @@ extern s32 sceTtyInit(void); extern s32 sceTtyRead(); -s32 read(s32 arg0, s32 arg1, s32 arg2) { - if (arg0 == 0) { +s32 read(s32 file_descriptor, s32 destination_buffer, s32 arg2) { + if (file_descriptor == 0) { if (CoreGlobalWord == 0) { if (sceTtyInit() != 0) { do { @@ -22,7 +22,7 @@ s32 read(s32 arg0, s32 arg1, s32 arg2) { goto block_5; } block_4: - return sceTtyRead(arg1, arg2); + return sceTtyRead(destination_buffer, arg2); } block_5: return -1; diff --git a/src/sdk/library/sceCdCallback.c b/src/sdk/library/sceCdCallback.c index ace7e7fbff..4fafe9f846 100644 --- a/src/sdk/library/sceCdCallback.c +++ b/src/sdk/library/sceCdCallback.c @@ -5,7 +5,7 @@ extern s32 sceCdSync(); extern s32 DIntr(); extern s32 EnableInterrupts(); -s32 sceCdCallback(s32 arg0) { +s32 sceCdCallback(s32 callback) { s32 intr; s32 old; @@ -14,7 +14,7 @@ s32 sceCdCallback(s32 arg0) { } intr = DIntr(); old = D_00159740[0]; - D_00159740[0] = arg0; + D_00159740[0] = callback; if (intr != 0) { EnableInterrupts(); } diff --git a/src/sdk/library/sceDbcGetDepNumber.c b/src/sdk/library/sceDbcGetDepNumber.c index cbb5f7dbbc..910bf5d271 100644 --- a/src/sdk/library/sceDbcGetDepNumber.c +++ b/src/sdk/library/sceDbcGetDepNumber.c @@ -23,15 +23,15 @@ extern s32 synchronize_cache_range() __asm__("func_00118F88"); extern s32 debug_print_stub() __asm__("func_00124A20"); extern s32 sceSifCallRpc(); extern struct DbCState RpcReceiveData __asm__("D_0015B080"); -s32 sceDbcGetDepNumber(s32 arg0) { +s32 sceDbcGetDepNumber(s32 dependency_index) { s32 result; synchronize_cache_range(D_0015B480, D_0015B480 + 0x80); DIntr(); *(struct DbCBlob *)D_0015B500 = *(struct DbCBlob *)D_0015B480; EnableInterrupts(); - if (((s32 *)D_0015B500)[arg0] == 1) { - RpcReceiveData.unk0 = arg0; + if (((s32 *)D_0015B500)[dependency_index] == 1) { + RpcReceiveData.unk0 = dependency_index; if (sceSifCallRpc(D_0015B008, 0x80000903, 0, &RpcReceiveData, 0x400, &RpcReceiveData, 0x400, 0, 0) < 0) { debug_print_stub(D_001535B8); diff --git a/src/sdk/library/sceDbcSetWorkAddr.c b/src/sdk/library/sceDbcSetWorkAddr.c index f9550e3944..8da44c5779 100644 --- a/src/sdk/library/sceDbcSetWorkAddr.c +++ b/src/sdk/library/sceDbcSetWorkAddr.c @@ -16,8 +16,8 @@ extern u8 D_00153558[]; extern s32 debug_print_stub() __asm__("func_00124A20"); extern s32 sceSifCallRpc(); extern struct DbCState RpcReceiveData __asm__("D_0015B080"); -s32 sceDbcSetWorkAddr(s32 arg0) { - RpcReceiveData.unk4 = arg0; +s32 sceDbcSetWorkAddr(s32 work_address) { + RpcReceiveData.unk4 = work_address; if (sceSifCallRpc(RpcQueueData, 0x80000904, 0, &RpcReceiveData, 0x400, &RpcReceiveData, 0x400, 0, 0) < 0) { debug_print_stub(D_00153558); diff --git a/src/sdk/library/scecdmmode.c b/src/sdk/library/scecdmmode.c index 45895ab47a..dd57e47b52 100644 --- a/src/sdk/library/scecdmmode.c +++ b/src/sdk/library/scecdmmode.c @@ -5,13 +5,13 @@ extern s32 SignalSema(); extern s32 cd_check_scmd() __asm__("func_00120D40"); extern s32 sceSifCallRpc(); extern void sceSifWriteBackDCache(); -s32 sceCdMmode(s32 arg0) { +s32 sceCdMmode(s32 media_mode) { register u8 *state; register s32 mode; s32 result; state = D_00132900; - mode = arg0; + mode = media_mode; if (cd_check_scmd(0x22) == 0) { return 0; } diff --git a/src/sdk/library/scedbcreceivedata.c b/src/sdk/library/scedbcreceivedata.c index 0901929a0b..ace7e41049 100644 --- a/src/sdk/library/scedbcreceivedata.c +++ b/src/sdk/library/scedbcreceivedata.c @@ -12,13 +12,13 @@ extern u8 D_001536A0[]; extern s32 debug_print_stub() __asm__("func_00124A20"); extern s32 sceSifCallRpc(); extern struct DbCState RpcReceiveData __asm__("D_0015B080"); -s32 sceDbcReceiveData(s32 arg0, s32 arg1, s32 *arg2, u8 *arg3) { +s32 sceDbcReceiveData(s32 arg0, s32 arg1, s32 *byte_count, u8 *destination) { struct DbCState *state = &RpcReceiveData; s32 i; state->unk0 = arg0; state->unk4 = arg1; - state->unk8 = *arg2; + state->unk8 = *byte_count; if (sceSifCallRpc(RpcQueueData, 0x8000091A, 0, state, 0x400, state, 0x400, 0, 0) < 0) { debug_print_stub(D_001536A0); return 0; @@ -26,11 +26,11 @@ s32 sceDbcReceiveData(s32 arg0, s32 arg1, s32 *arg2, u8 *arg3) { if (state->unk8C < 0) { return state->unk8C; } - *arg2 = state->unk8; + *byte_count = state->unk8; i = 0; if (state->unk8 > 0) { do { - arg3[i] = state->payload[i]; + destination[i] = state->payload[i]; i++; } while (i < state->unk8); return state->unk8C; diff --git a/src/sdk/library/sinit.c b/src/sdk/library/sinit.c index ce136b713e..432995ea82 100644 --- a/src/sdk/library/sinit.c +++ b/src/sdk/library/sinit.c @@ -30,16 +30,16 @@ struct Reent { }; extern void std(); -void __sinit(struct Reent *arg0) { +void __sinit(struct Reent *reent_context) { s32 *temp_17_9; - temp_17_9 = ((u8 *)arg0 + (0x1E4)); - arg0->unk3C = D_00113AC8; - arg0->unk38 = 1; - std(temp_17_9, 4, 0, arg0); - std(((u8 *)arg0 + (0x23C)), 9, 1, arg0); - std(((u8 *)arg0 + (0x294)), 0xA, 2, arg0); - arg0->unk1E0 = temp_17_9; - arg0->unk1DC = 3; - arg0->unk1D8 = 0; + temp_17_9 = ((u8 *)reent_context + (0x1E4)); + reent_context->unk3C = D_00113AC8; + reent_context->unk38 = 1; + std(temp_17_9, 4, 0, reent_context); + std(((u8 *)reent_context + (0x23C)), 9, 1, reent_context); + std(((u8 *)reent_context + (0x294)), 0xA, 2, reent_context); + reent_context->unk1E0 = temp_17_9; + reent_context->unk1DC = 3; + reent_context->unk1D8 = 0; } diff --git a/src/sdk/library/skip_mb0.c b/src/sdk/library/skip_mb0.c index b0acb074b9..8d2909449a 100644 --- a/src/sdk/library/skip_mb0.c +++ b/src/sdk/library/skip_mb0.c @@ -15,34 +15,34 @@ struct MpegMotionRef { extern u8 D_00153868[]; extern s32 _Error(struct MpegDecoder *a0, u8 *a1); -s32 _skipMB0(struct MpegDecoder *arg0, struct MpegSkipState *arg1, s32 *arg2, struct MpegMotionRef *arg3, - s32 *arg4) { +s32 _skipMB0(struct MpegDecoder *decoder, struct MpegSkipState *arg1, s32 *arg2, struct MpegMotionRef *arg3, + s32 *flags) { s32 temp_10_11; s32 temp_2_32; s32 var_9_6; var_9_6 = 1; - temp_10_11 = arg0->mb_buf_index * 0x140; - *(s32 *)((u8 *)(((u8 *)arg0 + (temp_10_11))) + 0x6CC) = 1; - arg0->dc_reset = 1; - if (arg0->picture_coding_type == 2) { + temp_10_11 = decoder->mb_buf_index * 0x140; + *(s32 *)((u8 *)(((u8 *)decoder + (temp_10_11))) + 0x6CC) = 1; + decoder->dc_reset = 1; + if (decoder->picture_coding_type == 2) { arg1->unk14 = 0; arg1->unk10 = 0; arg1->unk4 = 0; arg1->unk0 = 0; } - if (arg0->picture_structure == 3) { + if (decoder->picture_structure == 3) { *arg2 = 2; } else { *arg2 = 1; - temp_2_32 = arg0->picture_structure == 2; + temp_2_32 = decoder->picture_structure == 2; arg3->unk4 = temp_2_32; arg3->unk0 = temp_2_32; } - if (arg0->picture_coding_type == 1) { - _Error(arg0, D_00153868); + if (decoder->picture_coding_type == 1) { + _Error(decoder, D_00153868); var_9_6 = 0; } - *arg4 &= ~1; + *flags &= ~1; return var_9_6; } diff --git a/src/sdk/library/update_temp_track_data.c b/src/sdk/library/update_temp_track_data.c index 642d699e1b..d7f5c0af0d 100644 --- a/src/sdk/library/update_temp_track_data.c +++ b/src/sdk/library/update_temp_track_data.c @@ -1,6 +1,6 @@ #include "types.h" #include "rnc/sdk/libmpeg.h" -void UpdateTempTrackData(struct MpegDecoder *arg0, s32 delta) { +void UpdateTempTrackData(struct MpegDecoder *decoder, s32 delta) { s32 temp_2_30; s32 temp_3_21; s32 temp_4_32; @@ -8,18 +8,18 @@ void UpdateTempTrackData(struct MpegDecoder *arg0, s32 delta) { s32 var_7_4; var_7_4 = 0; var_4_8 = 0; - if ((arg0->picture_coding_type != 3) && (delta != 0)) { + if ((decoder->picture_coding_type != 3) && (delta != 0)) { if (delta < 0) { - var_7_4 = arg0->unk854 == 0; + var_7_4 = decoder->unk854 == 0; } - arg0->unk854 = 0; + decoder->unk854 = 0; var_4_8 = delta; } - temp_3_21 = arg0->unk84C + delta; - arg0->unk1AC = temp_3_21; + temp_3_21 = decoder->unk84C + delta; + decoder->unk1AC = temp_3_21; if ((var_7_4 != 0) && (var_4_8 >= delta)) { - arg0->unk1AC = (s32)(temp_3_21 + 0x400); + decoder->unk1AC = (s32)(temp_3_21 + 0x400); }; - temp_4_32 = arg0->unk1AC; - arg0->unk850 = (s32)((arg0->unk850 < temp_4_32) ? (temp_4_32) : (arg0->unk850)); + temp_4_32 = decoder->unk1AC; + decoder->unk850 = (s32)((decoder->unk850 < temp_4_32) ? (temp_4_32) : (decoder->unk850)); } diff --git a/src/sdk/rpc/request_bind.c b/src/sdk/rpc/request_bind.c index 8cbae2c7dd..2ffc4dd6bb 100644 --- a/src/sdk/rpc/request_bind.c +++ b/src/sdk/rpc/request_bind.c @@ -34,16 +34,16 @@ struct sceSifServeData { extern s32 GetRpcPacket(); extern s32 SearchSvdata(); extern void isceSifSendCmd(); -void _request_bind(struct RpcBindRequest *arg0, s32 arg1) { +void _request_bind(struct RpcBindRequest *bind_request, s32 rpc_state) { struct RpcBindPacket *packet; s32 new_var; struct sceSifServeData *svdata; - packet = GetRpcPacket(arg1); - new_var = (s32)arg0->unk14; - packet->unk1C = (s32)arg0->unk1C; + packet = GetRpcPacket(rpc_state); + new_var = (s32)bind_request->unk14; + packet->unk1C = (s32)bind_request->unk1C; packet->unk14 = new_var; packet->unk20 = 0x80000009; - svdata = SearchSvdata(arg0->unk20, arg1); + svdata = SearchSvdata(bind_request->unk20, rpc_state); if (svdata == 0) { packet->unk24 = 0; packet->unk28 = 0; diff --git a/src/sdk/rpc/request_rdata.c b/src/sdk/rpc/request_rdata.c index c108809f3f..8d0d78e192 100644 --- a/src/sdk/rpc/request_rdata.c +++ b/src/sdk/rpc/request_rdata.c @@ -26,15 +26,15 @@ struct RpcRdataPacket { }; extern s32 GetRpcPacket(); extern void isceSifSendCmd(); -void _request_rdata(struct RpcRdataRequest *arg0, s32 arg1) { +void _request_rdata(struct RpcRdataRequest *request, s32 arg1) { s32 a; s32 b; struct RpcRdataPacket *packet; packet = GetRpcPacket(arg1); - a = (s32)arg0->unk14; - b = (s32)arg0->unk1C; + a = (s32)request->unk14; + b = (s32)request->unk1C; packet->unk14 = a; packet->unk1C = b; packet->unk20 = 0x8000000C; - isceSifSendCmd(0x80000008, packet, 0x40, arg0->unk20, arg0->unk24, arg0->unk28); + isceSifSendCmd(0x80000008, packet, 0x40, request->unk20, request->unk24, request->unk28); } diff --git a/src/sdk/rpc/sce_sif_load_module_buffer.c b/src/sdk/rpc/sce_sif_load_module_buffer.c index bdcadd261f..e16efc6484 100644 --- a/src/sdk/rpc/sce_sif_load_module_buffer.c +++ b/src/sdk/rpc/sce_sif_load_module_buffer.c @@ -10,7 +10,7 @@ extern s32 sif_load_module_server_changed() __asm__("func_0011CAE0"); extern s32 memcpy(); extern s32 sceSifCallRpc(); #define SIFCMD ((struct SifLoadModuleArgs *)D_00158200) -s32 _sceSifLoadModuleBuffer(s32 arg0, s32 size, s32 src, s32 *result_out) { +s32 _sceSifLoadModuleBuffer(s32 iop_address, s32 size, s32 src, s32 *result_out) { s32 var_2_18; s32 temp; @@ -21,7 +21,7 @@ s32 _sceSifLoadModuleBuffer(s32 arg0, s32 size, s32 src, s32 *result_out) { if (sif_load_module_server_changed() != 0) { return 0xFFFEFFFC; } - SIFCMD->unk0 = arg0; + SIFCMD->unk0 = iop_address; if (src != 0) { if (size >= 0xFD) { memcpy(D_00158200 + 0x104, (void *)src, 0xFC); diff --git a/src/sdk/storage/memory_card/sce_mc_sync.c b/src/sdk/storage/memory_card/sce_mc_sync.c index 4999a6a899..aacb4105e9 100644 --- a/src/sdk/storage/memory_card/sce_mc_sync.c +++ b/src/sdk/storage/memory_card/sce_mc_sync.c @@ -6,11 +6,11 @@ extern u32 D_0015AFC0[]; extern s32 SceSifCheckStatRpc(); extern s32 SignalSema(); extern s32 mcDelayThread(); -s32 sceMcSync(s32 arg0, s32 *arg1, s32 *arg2) { +s32 sceMcSync(s32 poll_mode, s32 *active_code_out, s32 *completion_status_out) { s32 var_16_24; - register s32 wait_flag = arg0; - register s32 *code_out = arg1; - register s32 *status_out = arg2; + register s32 wait_flag = poll_mode; + register s32 *code_out = active_code_out; + register s32 *status_out = completion_status_out; if (D_00132DA8[0] == 0) { return -1; diff --git a/src/sdk/system/sysbit_init.c b/src/sdk/system/sysbit_init.c index a915958719..ef5eac2434 100644 --- a/src/sdk/system/sysbit_init.c +++ b/src/sdk/system/sysbit_init.c @@ -14,9 +14,9 @@ typedef struct SysbitState { extern void _sysbitFlush(SysbitState *ctx, s32 amount); -void _sysbitInit(SysbitState *ctx, s32 arg1, s32 base_addr, s32 size) { - ctx->field8 = arg1; - ctx->bit_pointer = arg1; +void _sysbitInit(SysbitState *ctx, s32 initial_bit_pointer, s32 base_addr, s32 size) { + ctx->field8 = initial_bit_pointer; + ctx->bit_pointer = initial_bit_pointer; ctx->bits = 0; ctx->cnt = 0; ctx->total = 0; diff --git a/src/sdk/video/ipu/sce_ipu_sync.c b/src/sdk/video/ipu/sce_ipu_sync.c index 69a56131b5..0e16d6a5a9 100644 --- a/src/sdk/video/ipu/sce_ipu_sync.c +++ b/src/sdk/video/ipu/sce_ipu_sync.c @@ -1,9 +1,9 @@ #include "types.h" -u32 sceIpuSync(s32 arg0) { +u32 sceIpuSync(s32 sync_mode) { u32 result; result = 0; - switch (arg0) { + switch (sync_mode) { case 0: while (*(volatile s32 *)0x10002010 < 0) { } diff --git a/src/textbin/runtime/memory/mode_freeze_init.c b/src/textbin/runtime/memory/mode_freeze_init.c index 91c9766f2c..dc0d202f6e 100644 --- a/src/textbin/runtime/memory/mode_freeze_init.c +++ b/src/textbin/runtime/memory/mode_freeze_init.c @@ -24,7 +24,7 @@ extern s32 push_help_history() __asm__("func_001FED30"); void mode_freeze_init(u32 mode, s32 arg1) __asm__("FUN_001fbab8"); -void mode_freeze_init(u32 mode, s32 arg1) { +void mode_freeze_init(u32 mode, s32 freeze_context) { struct FreezeModeState *st; if (game_mode != 3) { @@ -32,7 +32,7 @@ void mode_freeze_init(u32 mode, s32 arg1) { music_pause(0); } freeze.unk14 = game_mode; - freeze.unk18 = arg1; + freeze.unk18 = freeze_context; game_mode = 4; freeze.unk0 = mode; switch (mode) { diff --git a/src/ui/frames/draw_stretchable_ui_frame.c b/src/ui/frames/draw_stretchable_ui_frame.c index d4cec0734e..db6726f23f 100644 --- a/src/ui/frames/draw_stretchable_ui_frame.c +++ b/src/ui/frames/draw_stretchable_ui_frame.c @@ -5,15 +5,15 @@ extern s32 draw_hud_sprite_flipped() __asm__("FUN_001ffe18"); void draw_stretchable_ui_frame(s32 x, s32 y, s32 width, s32 arg3, s32 arg4) __asm__("FUN_00201128"); -void draw_stretchable_ui_frame(s32 x, s32 y, s32 width, s32 arg3, s32 arg4) { +void draw_stretchable_ui_frame(s32 x, s32 y, s32 width, s32 height, s32 alpha) { s32 middle_frame; s32 edge_frame; middle_frame = get_icon_frame(0x7580, 0); edge_frame = get_icon_frame(0x7580, 1); - draw_hud_sprite(edge_frame, x, y, 0x20, arg3, arg4); - draw_hud_sprite(middle_frame, x + 0x20, y, width - 0x40, arg3, arg4); - draw_hud_sprite_flipped(edge_frame, (x + width) - 0x20, y, 0x20, arg3, arg4); + draw_hud_sprite(edge_frame, x, y, 0x20, height, alpha); + draw_hud_sprite(middle_frame, x + 0x20, y, width - 0x40, height, alpha); + draw_hud_sprite_flipped(edge_frame, (x + width) - 0x20, y, 0x20, height, alpha); } extern void func_00201128(s32 x, s32 y, s32 width, s32 arg3, s32 arg4) diff --git a/src/ui/hud/draw_hud_sprite_rect.c b/src/ui/hud/draw_hud_sprite_rect.c index f41d1dd1e6..3fa7d3c2ab 100644 --- a/src/ui/hud/draw_hud_sprite_rect.c +++ b/src/ui/hud/draw_hud_sprite_rect.c @@ -7,7 +7,7 @@ extern u64 get_frame_texture(s32) __asm__("func_001FFA10"); void draw_hud_sprite_rect(s32 tex, s32 x0, s32 y0, s32 x1, s32 y1, s32 u0, s32 v0, s32 u1, s32 v1, s32 alpha) __asm__("FUN_00200958"); -void draw_hud_sprite_rect(s32 tex, s32 x0, s32 y0, s32 x1, s32 y1, s32 u0, s32 v0, s32 u1, s32 v1, +void draw_hud_sprite_rect(s32 tex, s32 x0, s32 y0, s32 x1, s32 y1, s32 u0, s32 texture_v0, s32 u1, s32 texture_v1, s32 alpha) { u64 *q; @@ -21,10 +21,10 @@ void draw_hud_sprite_rect(s32 tex, s32 x0, s32 y0, s32 x1, s32 y1, s32 u0, s32 v q[2] = get_frame_texture(tex); q[3] = 0x156; q[4] = (u64)alpha << 24 | 0x7F7F7F; - q[5] = u0 | ((u64)v0 << 16); + q[5] = u0 | ((u64)texture_v0 << 16); q[6] = (x0 + screen_extent.left - 8) | ((u64)(y0 + screen_extent.top - 8) << 16) | ((u64)hud_state.z << 32); - q[7] = u1 | ((u64)v1 << 16); + q[7] = u1 | ((u64)texture_v1 << 16); q[8] = (x1 + screen_extent.left - 8) | ((u64)(y1 + screen_extent.top - 8) << 16) | ((u64)hud_state.z << 32); q[9] = 0; diff --git a/src/ui/loading/append_scrolling_textured_quad.c b/src/ui/loading/append_scrolling_textured_quad.c index f9f69c574c..da215406fc 100644 --- a/src/ui/loading/append_scrolling_textured_quad.c +++ b/src/ui/loading/append_scrolling_textured_quad.c @@ -20,7 +20,7 @@ void append_scrolling_textured_quad(int x, int y, int w, int h, unsigned long rg float u1, float v0, float v1) __asm__("FUN_002316e8"); void append_scrolling_textured_quad(int x, int y, int w, int h, unsigned long rgba, unsigned long tex, float u0, - float u1, float v0, float v1) { + float u1, float texture_v_top, float texture_v_bottom) { int x0 = x * 16 + screen_extent.left - 8; int x1 = (x + w) * 16 + screen_extent.left - 8; int y0 = y * 16 + screen_extent.top - 8; @@ -30,13 +30,13 @@ void append_scrolling_textured_quad(int x, int y, int w, int h, unsigned long rg int *base; uv[0].f.u = u0; - uv[0].f.v = v0; + uv[0].f.v = texture_v_top; uv[1].f.u = u1; - uv[1].f.v = v0; + uv[1].f.v = texture_v_top; uv[2].f.u = u0; - uv[2].f.v = v1; + uv[2].f.v = texture_v_bottom; uv[3].f.u = u1; - uv[3].f.v = v1; + uv[3].f.v = texture_v_bottom; render_packet_cursor.words[0] = 0x10000007; render_packet_cursor.words[1] = 0; diff --git a/src/ui/map/decode_map_mask.c b/src/ui/map/decode_map_mask.c index 1e19ef03f9..73a12a320e 100644 --- a/src/ui/map/decode_map_mask.c +++ b/src/ui/map/decode_map_mask.c @@ -4,7 +4,7 @@ extern void decode_map_rle_row(u8 *dst, s32 arg1, s32 arg2, s16 *arg3) __asm__(" void decode_map_mask(u8 *dst, s32 arg1, s16 *arg2) __asm__("FUN_00206710"); -void decode_map_mask(u8 *dst, s32 arg1, s16 *arg2) { +void decode_map_mask(u8 *dst, s32 compressed_data_base, s16 *row_end_offsets) { s32 s; s32 i; s32 col; @@ -16,7 +16,7 @@ void decode_map_mask(u8 *dst, s32 arg1, s16 *arg2) { src = (u8 *)0x70000000; for (i = 0; i < 0x100; i++) { - decode_map_rle_row((u8 *)0x70000000, i, arg1, arg2); + decode_map_rle_row((u8 *)0x70000000, i, compressed_data_base, row_end_offsets); s = i % 0x10; p = dst + ((s + ((i / 0x10) * 0x200)) * 4); for (col = 0; col < 0x20; col++) { diff --git a/src/ui/map/find_map_entry_slot.c b/src/ui/map/find_map_entry_slot.c index 45acd28162..ef98efc12d 100644 --- a/src/ui/map/find_map_entry_slot.c +++ b/src/ui/map/find_map_entry_slot.c @@ -4,7 +4,7 @@ s32 find_map_entry_slot(s32 arg0) __asm__("FUN_002050a0"); /* Returns the cache slot holding map id arg0, or -1. */ -s32 find_map_entry_slot(s32 arg0) { +s32 find_map_entry_slot(s32 map_id) { register struct MapState *map; register s32 *id; register s32 count = 0; @@ -12,7 +12,7 @@ s32 find_map_entry_slot(s32 arg0) { map = &level_map_selection; id = map->slot_id; do { - if (id[-5] != 0 && *id == arg0) { /* slot[count], slot_id[count] */ + if (id[-5] != 0 && *id == map_id) { /* slot[count], slot_id[count] */ return count; } count += 1; diff --git a/src/ui/map/pick_map_slot_to_evict.c b/src/ui/map/pick_map_slot_to_evict.c index 24497b24cb..2bc8158f05 100644 --- a/src/ui/map/pick_map_slot_to_evict.c +++ b/src/ui/map/pick_map_slot_to_evict.c @@ -6,7 +6,7 @@ extern s32 find_id_in_terminated_table(s32 id) __asm__("func_00205220"); s32 pick_map_slot_to_evict(s32 arg0, s32 arg1) __asm__("FUN_00205278"); -s32 pick_map_slot_to_evict(s32 arg0, s32 arg1) { +s32 pick_map_slot_to_evict(s32 unused_arg0, s32 unused_arg1) { s64 max; s32 base; s64 delta; diff --git a/src/ui/menus/draw_menu_selection_marker.c b/src/ui/menus/draw_menu_selection_marker.c index e32c5a4c2d..e21a5f8629 100644 --- a/src/ui/menus/draw_menu_selection_marker.c +++ b/src/ui/menus/draw_menu_selection_marker.c @@ -6,10 +6,10 @@ extern s32 draw_hud_sprite() __asm__("func_001FFC30"); extern s32 append_screen_rect_packet(s32, s32, s32, s32, u64, s32) __asm__("func_00200E08"); void draw_menu_selection_marker(s32 x, s32 y, s32 arg2) __asm__("FUN_0021f8e8"); -void draw_menu_selection_marker(s32 x, s32 y, s32 arg2) { +void draw_menu_selection_marker(s32 x, s32 y, s32 draw_icon) { append_screen_rect_packet(x - 5, y - 5, x + 5, y + 5, (u64)0x80FFA888, 0); append_screen_rect_packet(x - 4, y - 4, x + 4, y + 4, (u64)panel_clear_color, 0); - if (arg2 != 0) { + if (draw_icon != 0) { draw_hud_sprite(get_icon_frame(0xE99E, 1), x - 0xD, y - 0x12, 0x1E, 0x1E, 0x80); } diff --git a/src/ui/menus/draw_menu_text_box.c b/src/ui/menus/draw_menu_text_box.c index d62e5ec991..b92d5a39e2 100644 --- a/src/ui/menus/draw_menu_text_box.c +++ b/src/ui/menus/draw_menu_text_box.c @@ -16,7 +16,7 @@ extern void vu1_add_g_sregister(int, long) __asm__("func_00233980"); the start subtracts its own variable, which keeps retail's order. */ int draw_menu_text_box(char *arg0) __asm__("FUN_00222768"); -int draw_menu_text_box(char *arg0) { +int draw_menu_text_box(char *menu_text_box) { short box[12]; int ypos; int n; @@ -25,16 +25,16 @@ int draw_menu_text_box(char *arg0) { vu1_add_g_sregister(0x47, 0x30000); vu1_add_g_sregister(0x42, 0x8000000044L); setup_gif_paging(0); - PackImageDescriptor(box, arg0); + PackImageDescriptor(box, menu_text_box); box[9] = 9; - box[3] = *(int *)(arg0 + 0x18) + *(int *)(arg0 + 0x20); - box[0] = *(int *)(arg0 + 0x1C) + 4; - box[1] = *(int *)(arg0 + 0x1C) + *(int *)(arg0 + 0x24) - 4; - box[2] = *(int *)(arg0 + 0x18); - box[4] = *(int *)(arg0 + 0x18) + (*(int *)(arg0 + 0x20) >> 1); + box[3] = *(int *)(menu_text_box + 0x18) + *(int *)(menu_text_box + 0x20); + box[0] = *(int *)(menu_text_box + 0x1C) + 4; + box[1] = *(int *)(menu_text_box + 0x1C) + *(int *)(menu_text_box + 0x24) - 4; + box[2] = *(int *)(menu_text_box + 0x18); + box[4] = *(int *)(menu_text_box + 0x18) + (*(int *)(menu_text_box + 0x20) >> 1); box[10] = 0; box[11] = 0; - switch (*(int *)(arg0 + 0x50)) { + switch (*(int *)(menu_text_box + 0x50)) { case 1: case 2: case 3: @@ -50,26 +50,26 @@ int draw_menu_text_box(char *arg0) { case 16: case 17: case 18: - n = (*(int *)(arg0 + 0x3C) >> 4) - 4; - ypos = *(int *)(arg0 + 0x1C) - n; - for (i = 0; (*(int **)(arg0 + 0x34))[i] != -1; i++) { + n = (*(int *)(menu_text_box + 0x3C) >> 4) - 4; + ypos = *(int *)(menu_text_box + 0x1C) - n; + for (i = 0; (*(int **)(menu_text_box + 0x34))[i] != -1; i++) { box[5] = ypos; - box[11] = (*(int *)(arg0 + 0x3C) >> 4) & 0xF; + box[11] = (*(int *)(menu_text_box + 0x3C) >> 4) & 0xF; font_print_window_regular(box, 0x80FFA888L, - get_help_message_text((*(int **)(arg0 + 0x34))[i]), -1); + get_help_message_text((*(int **)(menu_text_box + 0x34))[i]), -1); ypos += box[7]; ypos += 10; } - if (ypos + 0x18 < *(int *)(arg0 + 0x1C) + *(int *)(arg0 + 0x24)) { - *(int *)(arg0 + 0x54) = 1; + if (ypos + 0x18 < *(int *)(menu_text_box + 0x1C) + *(int *)(menu_text_box + 0x24)) { + *(int *)(menu_text_box + 0x54) = 1; } break; case 4: case 11: case 15: case 19: - box[5] = *(int *)(arg0 + 0x1C) + 0x20; - font_print_window_regular(box, 0x80FFA888L, get_help_message_text(*(int *)(arg0 + 0x34)), + box[5] = *(int *)(menu_text_box + 0x1C) + 0x20; + font_print_window_regular(box, 0x80FFA888L, get_help_message_text(*(int *)(menu_text_box + 0x34)), -1); break; case 0: diff --git a/src/ui/menus/draw_quit_game_menu.c b/src/ui/menus/draw_quit_game_menu.c index 6b4b61d5eb..e2b9233711 100644 --- a/src/ui/menus/draw_quit_game_menu.c +++ b/src/ui/menus/draw_quit_game_menu.c @@ -24,7 +24,7 @@ extern void vu1_add_g_sregister() __asm__("func_00233980"); extern void memset() __asm__("func_001153FC"); s32 draw_quit_game_menu(struct QuitMenu *arg0) __asm__("FUN_0021e890"); -s32 draw_quit_game_menu(struct QuitMenu *arg0) { +s32 draw_quit_game_menu(struct QuitMenu *quit_menu) { unsigned long new_var; s16 packet[0xC]; s32 temp_16_69; @@ -33,8 +33,8 @@ s32 draw_quit_game_menu(struct QuitMenu *arg0) { s32 temp_18_25; s32 temp_2_73; s32 temp_16_16; - temp_16_16 = arg0->unk20; - temp_17_18 = arg0->unk24; + temp_16_16 = quit_menu->unk20; + temp_17_18 = quit_menu->unk24; memset(packet, 0, 0x18); temp_18_25 = (s32)(temp_16_16 + (((u32)temp_16_16) >> 0x1F)); temp_18_25 = temp_18_25 >> 1; @@ -55,7 +55,7 @@ s32 draw_quit_game_menu(struct QuitMenu *arg0) { temp_16_69 = measure_text_width_regular(get_help_message_text(0x524B), -1); temp_2_73 = measure_text_width_regular(get_help_message_text(0x524F), -1); temp_17_81 = - ((s32)(arg0->unk20 - ((temp_2_73 >= temp_16_69) ? (temp_2_73) : (temp_16_69)))) >> 1; + ((s32)(quit_menu->unk20 - ((temp_2_73 >= temp_16_69) ? (temp_2_73) : (temp_16_69)))) >> 1; font_print_large(temp_17_81, temp_17_18 - 0x28, 0x80FFA888, get_help_message_text(0x524B), -1); font_print_large(temp_17_81, temp_17_18 - 0x14, 0x80FFA888, get_help_message_text(0x524F), -1); do_gif_paging(); diff --git a/src/ui/menus/draw_selected_item_ammo.c b/src/ui/menus/draw_selected_item_ammo.c index df7b9256ab..648e6fa9c8 100644 --- a/src/ui/menus/draw_selected_item_ammo.c +++ b/src/ui/menus/draw_selected_item_ammo.c @@ -24,7 +24,7 @@ extern void vu1_add_g_sregister(s32, s32) __asm__("func_00233980"); extern s32 sprintf(); s32 draw_selected_item_ammo(s32 arg0) __asm__("FUN_0021f158"); -s32 draw_selected_item_ammo(s32 arg0) { +s32 draw_selected_item_ammo(s32 image_descriptor_input) { u8 sp_slot[0x50]; u8 descriptor[0x20]; s16 temp_4_20; @@ -61,7 +61,7 @@ s32 draw_selected_item_ammo(s32 arg0) { } } setup_gif_paging(0); - PackImageDescriptor((s32 *)descriptor, arg0); + PackImageDescriptor((s32 *)descriptor, image_descriptor_input); *(s16 *)(descriptor + 0x10) = 0x10; *(s16 *)(descriptor + 0x12) = 3; font_print_window_regular((s32 *)descriptor, (((u64)0x80FF << 0x10) | 0xA888), sp_slot, -1); diff --git a/src/ui/menus/enter_menu_prompt.c b/src/ui/menus/enter_menu_prompt.c index 38279140d1..941ecc713a 100644 --- a/src/ui/menus/enter_menu_prompt.c +++ b/src/ui/menus/enter_menu_prompt.c @@ -4,8 +4,8 @@ extern s32 select_next_stream_buffer() __asm__("func_00225C18"); s32 enter_menu_prompt(struct MenuScreen *arg0) __asm__("FUN_00221a48"); -s32 enter_menu_prompt(struct MenuScreen *arg0) { +s32 enter_menu_prompt(struct MenuScreen *menu_screen) { menu_system.current->confirmed = 0; - arg0->data.prompt.buffer = select_next_stream_buffer(0); + menu_screen->data.prompt.buffer = select_next_stream_buffer(0); return 0; } diff --git a/src/ui/menus/fun_0021ca98.c b/src/ui/menus/fun_0021ca98.c index 0d3751de5f..9524eaa8b2 100644 --- a/src/ui/menus/fun_0021ca98.c +++ b/src/ui/menus/fun_0021ca98.c @@ -3,8 +3,8 @@ extern unsigned char D_0013D4C2 NOT_SDA; extern char D_001D06D0[]; extern char D_001D0708[]; -int FUN_0021ca98(void *arg0) { - *(char **)((char *)arg0 + 0x34) = (D_0013D4C2 != 0) ? D_001D06D0 : D_001D0708; +int FUN_0021ca98(void *destination) { + *(char **)((char *)destination + 0x34) = (D_0013D4C2 != 0) ? D_001D06D0 : D_001D0708; return 0; } diff --git a/src/ui/menus/fun_0021df30.c b/src/ui/menus/fun_0021df30.c index 8d5b09adf3..02733de193 100644 --- a/src/ui/menus/fun_0021df30.c +++ b/src/ui/menus/fun_0021df30.c @@ -1,6 +1,6 @@ /* Ported from rac1-decomp (src/game/pause.c, func_0021EF38). */ -int FUN_0021df30(void *arg0) { - char *p = (char *)arg0; +int FUN_0021df30(void *destination) { + char *p = (char *)destination; *(float *)(p + 0x38) = 3.14159274f; *(int *)(p + 0x34) = 0; *(int *)(p + 0x44) = 0; diff --git a/src/ui/menus/fun_00221968.c b/src/ui/menus/fun_00221968.c index 002ded431b..bcee75b7b2 100644 --- a/src/ui/menus/fun_00221968.c +++ b/src/ui/menus/fun_00221968.c @@ -7,7 +7,7 @@ #include "rnc/ui/menus/menu_globals.h" extern s32 allocate_voice_for_target_entry() __asm__("func_0022DA68"); -s32 FUN_00221968(struct MenuScreen *arg0) { +s32 FUN_00221968(struct MenuScreen *menu_screen) { if (controller_state.pressed_unmasked & PAD_TRIANGLE) { if (menu_system.current->back != 0) { menu_system.next = menu_system.current->back; @@ -18,14 +18,14 @@ s32 FUN_00221968(struct MenuScreen *arg0) { selected_level_index[0] = current_level_index; return 1; } else if (controller_state.pressed_unmasked & PAD_CROSS) { - allocate_voice_for_target_entry(0, 0x11, arg0->moby); + allocate_voice_for_target_entry(0, 0x11, menu_screen->moby); return 1; } else if (controller_state.pressed_unmasked & PAD_CIRCLE) { menu_system.unkE4 = selected_level_index[0]; menu_system.unkF0 = menu_system.current; menu_system.close_request = 3; menu_system.unkF4 = 0xF; - allocate_voice_for_target_entry(0, 0x11, arg0->moby); + allocate_voice_for_target_entry(0, 0x11, menu_screen->moby); } return 0; } diff --git a/src/ui/menus/fun_00221d28.c b/src/ui/menus/fun_00221d28.c index 73557da99b..30b2170dc9 100644 --- a/src/ui/menus/fun_00221d28.c +++ b/src/ui/menus/fun_00221d28.c @@ -5,8 +5,8 @@ extern int pause_level_sprite_lists[] __asm__("D_001D4528"); extern s32 current_level_index __asm__("D_0015ED84") MACRO_ADDR; /* `D_001D4528[(unsigned)D_0015ED84 % 19]`; the older near-miss predated MACRO_ADDR. */ -int FUN_00221d28(char *arg0) { - *(int *)(arg0 + 0x34) = pause_level_sprite_lists[(unsigned int)current_level_index % 19]; +int FUN_00221d28(char *destination) { + *(int *)(destination + 0x34) = pause_level_sprite_lists[(unsigned int)current_level_index % 19]; return 0; } diff --git a/src/ui/menus/fun_00227140.c b/src/ui/menus/fun_00227140.c index df8cc708aa..61418844c7 100644 --- a/src/ui/menus/fun_00227140.c +++ b/src/ui/menus/fun_00227140.c @@ -7,13 +7,13 @@ extern struct Mat D_001D7D90[]; extern s32 D_00160360[2] __attribute__((sda)); extern void FUN_00228598(s32, s32); -void FUN_00227140(s32 arg0, s32 slot, s32 mat) { +void FUN_00227140(s32 render_selector, s32 slot, s32 mat) { render_packet_cursor.tag->tag = 0x30000003; render_packet_cursor.tag->addr = (u32)&D_001D7D90[mat]; render_packet_cursor.tag->vif0 = 0x13000000; render_packet_cursor.tag->vif1 = 0x50000003; render_packet_cursor.tag++; - FUN_00228598(arg0, D_00160360[slot]); + FUN_00228598(render_selector, D_00160360[slot]); } extern __typeof__(FUN_00227140) func_00227140 __attribute__((alias("FUN_00227140"))); diff --git a/src/ui/menus/leave_menu_prompt.c b/src/ui/menus/leave_menu_prompt.c index f7ea194f86..c3615edd31 100644 --- a/src/ui/menus/leave_menu_prompt.c +++ b/src/ui/menus/leave_menu_prompt.c @@ -3,7 +3,7 @@ extern s32 complete_stream_buffer_transfer() __asm__("FUN_00225cd8"); s32 leave_menu_prompt(struct MenuScreen *arg0) __asm__("FUN_00221a88"); -s32 leave_menu_prompt(struct MenuScreen *arg0) { - arg0->data.prompt.buffer = complete_stream_buffer_transfer(arg0->data.prompt.buffer); +s32 leave_menu_prompt(struct MenuScreen *menu_screen) { + menu_screen->data.prompt.buffer = complete_stream_buffer_transfer(menu_screen->data.prompt.buffer); return 0; } diff --git a/src/ui/menus/mark_stream_buffer_read_active.c b/src/ui/menus/mark_stream_buffer_read_active.c index 6011b21bea..226f8de452 100644 --- a/src/ui/menus/mark_stream_buffer_read_active.c +++ b/src/ui/menus/mark_stream_buffer_read_active.c @@ -3,13 +3,13 @@ s32 mark_stream_buffer_read_active(s32 arg0) __asm__("FUN_00225dd8"); -s32 mark_stream_buffer_read_active(s32 arg0) { +s32 mark_stream_buffer_read_active(s32 buffer_address) { s32 count = 0; u8 *base = (u8 *)graphics_buffer_descriptors; s32 *entry = (s32 *)(base + 4); loop: count += 1; - if (entry[-1] != arg0) { + if (entry[-1] != buffer_address) { entry += 2; if (count >= 5) { return 1; diff --git a/src/ui/menus/pause/draw_pause_ring.c b/src/ui/menus/pause/draw_pause_ring.c index ba7abb0793..8fae267d0e 100644 --- a/src/ui/menus/pause/draw_pause_ring.c +++ b/src/ui/menus/pause/draw_pause_ring.c @@ -47,23 +47,23 @@ s32 draw_pause_ring(struct PauseState *pause_state) { s32 flag; f32 cx, cy, radius; struct IconEnt *iconTab; - s32 v1, viewport_height; + s32 viewport_dimension, viewport_height; setup_gif_paging(0); - v1 = pause_state->w; + viewport_dimension = pause_state->w; iconTab = D_001863D0; viewport_height = pause_state->h; - flag = v1 < viewport_height; + flag = viewport_dimension < viewport_height; /* v1 doubles as `selected`: retail's movz reuses the same register that already holds v1 (loaded straight into it), so the C must overwrite v1 itself rather than assign a fresh local -- that fresh local costs an extra `move` before the conditional one. */ - cx = (f32)v1 * 0.5f; + cx = (f32)viewport_dimension * 0.5f; cy = (f32)viewport_height * 0.5f; if (flag == 0) { - v1 = viewport_height; + viewport_dimension = viewport_height; } - radius = (f32)v1 * 0.5f - 40.0f; + radius = (f32)viewport_dimension * 0.5f - 40.0f; i = 0; do { f32 t, x, y; diff --git a/src/ui/menus/pause/find_next_pause_page.c b/src/ui/menus/pause/find_next_pause_page.c index 87c90aa87c..70f7cd425c 100644 --- a/src/ui/menus/pause/find_next_pause_page.c +++ b/src/ui/menus/pause/find_next_pause_page.c @@ -12,7 +12,7 @@ copy is retail's kept %hi. */ int find_next_pause_page(char *arg0, int reverse) __asm__("FUN_0021b7a8"); -int find_next_pause_page(char *arg0, int reverse) { +int find_next_pause_page(char *page, int reverse) { int ok = 0; int found = 0; @@ -21,28 +21,28 @@ int find_next_pause_page(char *arg0, int reverse) { } { struct MenuSystem *g = &menu_system; - if (g->unk134 != 0 && (*(int *)(arg0 + 0x30) & 8)) { + if (g->unk134 != 0 && (*(int *)(page + 0x30) & 8)) { ok = 1; } - if (g->unk138 != 0 && (*(int *)(arg0 + 0x30) & 4)) { + if (g->unk138 != 0 && (*(int *)(page + 0x30) & 4)) { ok = 1; } } while (ok) { struct MenuSystem *g = &menu_system; found = 1; - arg0 = *(char **)(arg0 + 0x4C); + page = *(char **)(page + 0x4C); ok = 0; - if (g->unk134 != 0 && (*(int *)(arg0 + 0x30) & 8)) { + if (g->unk134 != 0 && (*(int *)(page + 0x30) & 8)) { ok = 1; } - if (g->unk138 != 0 && (*(int *)(arg0 + 0x30) & 4)) { + if (g->unk138 != 0 && (*(int *)(page + 0x30) & 4)) { ok = 1; } } if (found) { struct MenuSystem *g2 = &menu_system; - g2->current->pending_focus = (struct MenuScreen *)arg0; + g2->current->pending_focus = (struct MenuScreen *)page; } return 0; } diff --git a/src/ui/menus/save_data/enter_save_slot_screen.c b/src/ui/menus/save_data/enter_save_slot_screen.c index 40fcaaaafb..3276dcfb40 100644 --- a/src/ui/menus/save_data/enter_save_slot_screen.c +++ b/src/ui/menus/save_data/enter_save_slot_screen.c @@ -4,9 +4,9 @@ extern s32 initialize_graphics_buffer_descriptors() __asm__("FUN_00225ac0"); extern s32 select_next_stream_buffer() __asm__("FUN_00225c18"); s32 enter_save_slot_screen(struct MenuScreen *arg0) __asm__("FUN_00222f18"); -s32 enter_save_slot_screen(struct MenuScreen *arg0) { +s32 enter_save_slot_screen(struct MenuScreen *menu_screen) { initialize_graphics_buffer_descriptors(1); - arg0->data.save.save_data = select_next_stream_buffer(0); - arg0->data.save.step = 0; + menu_screen->data.save.save_data = select_next_stream_buffer(0); + menu_screen->data.save.step = 0; return 0; } diff --git a/src/ui/menus/save_data/leave_save_slot_screen.c b/src/ui/menus/save_data/leave_save_slot_screen.c index 6ffa386b9c..86f620a4d1 100644 --- a/src/ui/menus/save_data/leave_save_slot_screen.c +++ b/src/ui/menus/save_data/leave_save_slot_screen.c @@ -3,7 +3,7 @@ extern s32 complete_stream_buffer_transfer() __asm__("FUN_00225cd8"); s32 leave_save_slot_screen(struct MenuScreen *arg0) __asm__("FUN_00222f58"); -s32 leave_save_slot_screen(struct MenuScreen *arg0) { - arg0->data.save.save_data = complete_stream_buffer_transfer(arg0->data.save.save_data); +s32 leave_save_slot_screen(struct MenuScreen *screen) { + screen->data.save.save_data = complete_stream_buffer_transfer(screen->data.save.save_data); return 0; } diff --git a/src/ui/text/font_print_wrapped_small.c b/src/ui/text/font_print_wrapped_small.c index 76e8046d5a..63d441815e 100644 --- a/src/ui/text/font_print_wrapped_small.c +++ b/src/ui/text/font_print_wrapped_small.c @@ -5,9 +5,9 @@ extern s32 font_print_wrapped() __asm__("FUN_001f6cb8"); void font_print_wrapped_small(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) __asm__("FUN_001f6fd0"); -void font_print_wrapped_small(s32 start_x, s32 start_y, s32 wrap_width, s32 max_height, s32 arg4, s32 text, +void font_print_wrapped_small(s32 start_x, s32 start_y, s32 wrap_width, s32 max_height, s32 packed_render_attributes, s32 text, s32 byte_limit) { - font_print_wrapped(start_x, start_y, wrap_width, max_height, arg4, text, byte_limit, get_effect_texture(2), small_font_metrics); + font_print_wrapped(start_x, start_y, wrap_width, max_height, packed_render_attributes, text, byte_limit, get_effect_texture(2), small_font_metrics); } extern void func_001F6FD0(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) diff --git a/src/ui/text/load_display_text_resource_entry.c b/src/ui/text/load_display_text_resource_entry.c index f955a41ada..a164612595 100644 --- a/src/ui/text/load_display_text_resource_entry.c +++ b/src/ui/text/load_display_text_resource_entry.c @@ -21,7 +21,7 @@ extern void fast_vec_scale(void *dst, void *a, f32 scale) __asm__("FUN_001f9a68" void load_display_text_resource_entry(void *arg0, s32 *arg1) __asm__("FUN_00214bc0"); -void load_display_text_resource_entry(void *arg0, s32 *arg1) { +void load_display_text_resource_entry(void *destination, s32 *packed_chars_source) { struct Loc loc; f32 scale; @@ -30,10 +30,10 @@ void load_display_text_resource_entry(void *arg0, s32 *arg1) { loc.v.f[1] = 127.0f; loc.v.f[2] = 127.0f; - fast_vector_from_packed_chars(&loc, *arg1); + fast_vector_from_packed_chars(&loc, *packed_chars_source); scale = loc.d * 0.0001f; subtract_vector_xyz(&loc, &loc, &loc.v); - fast_vec_scale(arg0, &loc, scale); + fast_vec_scale(destination, &loc, scale); } extern __typeof__(load_display_text_resource_entry) func_00214BC0 diff --git a/src/ui/text/set_scrolling_status_message.c b/src/ui/text/set_scrolling_status_message.c index 747c65aea0..abdc16a282 100644 --- a/src/ui/text/set_scrolling_status_message.c +++ b/src/ui/text/set_scrolling_status_message.c @@ -11,8 +11,8 @@ extern u8 D_001E8A70[]; extern s32 sprintf(); void set_scrolling_status_message(s32 arg0) __asm__("FUN_00237e90"); -void set_scrolling_status_message(s32 arg0) { - sprintf(D_001E63C0.unk2C, D_001E8A70, arg0); +void set_scrolling_status_message(s32 message) { + sprintf(D_001E63C0.unk2C, D_001E8A70, message); D_001E63C0.unk44 = 0; } diff --git a/src/video/decoder/callbacks/get_mpeg_timestamp.c b/src/video/decoder/callbacks/get_mpeg_timestamp.c index 8595959d00..cd4b70d57a 100644 --- a/src/video/decoder/callbacks/get_mpeg_timestamp.c +++ b/src/video/decoder/callbacks/get_mpeg_timestamp.c @@ -9,7 +9,7 @@ struct Out { }; s32 get_mpeg_timestamp(s32 arg0, struct Out *out) __asm__("FUN_0023d140"); -s32 get_mpeg_timestamp(s32 arg0, struct Out *out) { +s32 get_mpeg_timestamp(s32 unused_parameter, struct Out *out) { u64 tmp[3]; vi_buf_get_ts(decoder_state + 0xD9090, tmp); diff --git a/src/video/decoder/callbacks/mpeg_error.c b/src/video/decoder/callbacks/mpeg_error.c index 304367399c..ff9d73ee8e 100644 --- a/src/video/decoder/callbacks/mpeg_error.c +++ b/src/video/decoder/callbacks/mpeg_error.c @@ -10,7 +10,7 @@ extern u8 video_error_message[] __asm__("D_00161220"); extern s32 DebugPrint(); s32 mpeg_error(s32 arg0, struct MpegErrorData *cb_data) __asm__("FUN_0023d080"); -s32 mpeg_error(s32 arg0, struct MpegErrorData *cb_data) { +s32 mpeg_error(s32 unused_mpeg, struct MpegErrorData *cb_data) { DebugPrint(video_error_message, cb_data->unk4); return 1; } diff --git a/src/video/decoder/callbacks/video_callback.c b/src/video/decoder/callbacks/video_callback.c index 25cbbd6726..fdeda1e80e 100644 --- a/src/video/decoder/callbacks/video_callback.c +++ b/src/video/decoder/callbacks/video_callback.c @@ -24,7 +24,7 @@ extern s32 video_dec_put_ts(u8 *, s64, s64, u32, s32) __asm__("func_0023CC98"); s32 video_callback(s32 arg0, struct VdecCb *cb, struct VdecBuf *ab) __asm__("FUN_0023b5f0"); -s32 video_callback(s32 arg0, struct VdecCb *cb, struct VdecBuf *ab) { +s32 video_callback(s32 unused_callback_arg, struct VdecCb *cb, struct VdecBuf *ab) { u32 ptr0; s32 len0; u32 ptr1; diff --git a/src/video/decoder/dma/set_d3_chcr.c b/src/video/decoder/dma/set_d3_chcr.c index 5a805089fe..92416b6fd6 100644 --- a/src/video/decoder/dma/set_d3_chcr.c +++ b/src/video/decoder/dma/set_d3_chcr.c @@ -5,10 +5,10 @@ extern void EnableInterrupts(void); void set_d3_chcr(s32 arg0) __asm__("FUN_0023bb40"); -void set_d3_chcr(s32 arg0) { +void set_d3_chcr(s32 chcr_value) { DIntr(); *(volatile s32 *)0x1000F590 = *(volatile s32 *)0x1000F520 | 0x10000; - *(volatile s32 *)0x1000B000 = arg0; + *(volatile s32 *)0x1000B000 = chcr_value; *(volatile s32 *)0x1000F590 = *(volatile s32 *)0x1000F520 & 0xFFFEFFFF; EnableInterrupts(); } diff --git a/src/video/decoder/dma/set_d4_chcr.c b/src/video/decoder/dma/set_d4_chcr.c index 292d991e7c..9737d109c5 100644 --- a/src/video/decoder/dma/set_d4_chcr.c +++ b/src/video/decoder/dma/set_d4_chcr.c @@ -5,10 +5,10 @@ extern void EnableInterrupts(void); void set_d4_chcr(s32 arg0) __asm__("FUN_0023bbb0"); -void set_d4_chcr(s32 arg0) { +void set_d4_chcr(s32 control_value) { DIntr(); *(volatile s32 *)0x1000F590 = *(volatile s32 *)0x1000F520 | 0x10000; - *(volatile s32 *)0x1000B400 = arg0; + *(volatile s32 *)0x1000B400 = control_value; *(volatile s32 *)0x1000F590 = *(volatile s32 *)0x1000F520 & 0xFFFEFFFF; EnableInterrupts(); } diff --git a/src/video/decoder/play_mpeg_movie.c b/src/video/decoder/play_mpeg_movie.c index 4c63aeff56..8dda3d628b 100644 --- a/src/video/decoder/play_mpeg_movie.c +++ b/src/video/decoder/play_mpeg_movie.c @@ -10,11 +10,11 @@ extern s32 term_all() __asm__("func_0023AA68"); s32 play_mpeg_movie(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) __asm__("FUN_0023a3b8"); -s32 play_mpeg_movie(s32 arg0, s32 arg1, s32 decoder_buffer_base, s32 decoder_state_base, s32 arg4) { +s32 play_mpeg_movie(s32 movie_source, s32 arg1, s32 decoder_buffer_base, s32 decoder_state_base, s32 arg4) { decoder_buffer_address = decoder_buffer_base; decoder_state = decoder_state_base; ChangeThreadPriority(GetThreadId(), 1); - if (init_all(arg0, arg1, arg4) != 0) { + if (init_all(movie_source, arg1, arg4) != 0) { read_mpeg(decoder_state + 0xD9048, decoder_state, decoder_state + 0xD9040); } term_all(); diff --git a/src/video/decoder/video_dec_create.c b/src/video/decoder/video_dec_create.c index 659356d86a..38d48ee50c 100644 --- a/src/video/decoder/video_dec_create.c +++ b/src/video/decoder/video_dec_create.c @@ -11,7 +11,7 @@ extern s32 video_dec_reset() __asm__("func_0023CC30"); s32 video_dec_create(s32 video_dec, s32 arg1, s32 arg2, s32 data, s32 tag, s32 size, s32 ts, s32 ts_count) __asm__("FUN_0023cac8"); -s32 video_dec_create(s32 video_dec, s32 arg1, s32 arg2, s32 data, s32 tag, s32 size, s32 ts, +s32 video_dec_create(s32 video_dec, s32 mpeg_work_area, s32 mpeg_work_area_size, s32 data, s32 tag, s32 size, s32 ts, s32 ts_count) { sceMpegCreate(video_dec); AddMpegCallback(video_dec, 0, D_0023D080, 0); diff --git a/src/video/decoder/vo_buf_create.c b/src/video/decoder/vo_buf_create.c index 731e2173f2..a1afe78880 100644 --- a/src/video/decoder/vo_buf_create.c +++ b/src/video/decoder/vo_buf_create.c @@ -1,13 +1,13 @@ #include "types.h" void vo_buf_create(void *buffer, s32 a1, s32 a2, s32 count) __asm__("FUN_0023d190"); -void vo_buf_create(void *buffer, s32 a1, s32 entry_base_address, s32 count) { +void vo_buf_create(void *buffer, s32 initial_buffer_word, s32 entry_base_address, s32 count) { s32 offset; volatile s32 *p; p = (volatile s32 *)buffer; p[3] = 0; - p[0] = a1; + p[0] = initial_buffer_word; p[1] = entry_base_address; p[4] = count; p[2] = 0; diff --git a/src/video/decoder/vo_buf_get_data.c b/src/video/decoder/vo_buf_get_data.c index 0ab76c9998..0809458475 100644 --- a/src/video/decoder/vo_buf_get_data.c +++ b/src/video/decoder/vo_buf_get_data.c @@ -8,11 +8,11 @@ struct VoBuf { extern s32 FUN_0023d1f8(); s32 vo_buf_get_data(struct VoBuf *arg0) __asm__("FUN_0023d288"); -s32 vo_buf_get_data(struct VoBuf *arg0) { +s32 vo_buf_get_data(struct VoBuf *vo_buffer) { if (FUN_0023d1f8() != 0) { return 0; } - return arg0->unk0 + (arg0->unk8 * 0xD0000); + return vo_buffer->unk0 + (vo_buffer->unk8 * 0xD0000); } /* Recovered original symbol name. */ diff --git a/src/video/display/start_display.c b/src/video/display/start_display.c index e7b0484da5..2d7f9dacae 100644 --- a/src/video/display/start_display.c +++ b/src/video/display/start_display.c @@ -7,10 +7,10 @@ extern s32 sceGsSyncV(); void start_display(s32 arg0) __asm__("FUN_0023b590"); -void start_display(s32 arg0) { +void start_display(s32 vblank_field_to_skip) { do { - } while (sceGsSyncV(0) == arg0); + } while (sceGsSyncV(0) == vblank_field_to_skip); movie_display_active = 1; D_001611E4 = 0; } diff --git a/src/world/animation/update_world_object_animation.c b/src/world/animation/update_world_object_animation.c index a405fff450..2d4518ce82 100644 --- a/src/world/animation/update_world_object_animation.c +++ b/src/world/animation/update_world_object_animation.c @@ -81,7 +81,7 @@ extern struct Moby *func_0020D348_m(int) __asm__("FUN_0020c4f8"); void update_world_object_animation(void *arg0) __asm__("FUN_00204790"); extern s32 game_mode_macro __asm__("D_0015F604") MACRO_ADDR; -void update_world_object_animation(void *arg0) { +void update_world_object_animation(void *unused_arg) { struct ModelRec *rec; struct Moby *mob; int *cp; diff --git a/src/world/loaders/register_moby_class.c b/src/world/loaders/register_moby_class.c index acc36671cd..35ec63e9d3 100644 --- a/src/world/loaders/register_moby_class.c +++ b/src/world/loaders/register_moby_class.c @@ -13,7 +13,7 @@ extern void prepare_resident_class_render_data(MobyClassData *, s32, s32, s32) __asm__("FUN_00203338"); void register_moby_class(MobyClassData *moby, s32 arg1, s32 arg2, s32 oclass) __asm__("FUN_00203640"); -void register_moby_class(MobyClassData *moby, s32 arg1, s32 arg2, s32 oclass) { +void register_moby_class(MobyClassData *moby, s32 indexed_textures, s32 material_map, s32 oclass) { s32 n; n = D_0015FF00; @@ -27,7 +27,7 @@ void register_moby_class(MobyClassData *moby, s32 arg1, s32 arg2, s32 oclass) { D_001B6180[n] = moby->unk2C; assign_moby_class_data(oclass); D_0015FF00++; - prepare_resident_class_render_data(moby, arg1, arg2, oclass); + prepare_resident_class_render_data(moby, indexed_textures, material_map, oclass); } }