Skip to content

Commit

Permalink
jak3 speedrun c++ stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Hat-Kid committed Nov 15, 2024
1 parent 85a265b commit 6d1ee67
Show file tree
Hide file tree
Showing 4 changed files with 920 additions and 6 deletions.
2 changes: 0 additions & 2 deletions game/kernel/jak2/kmachine_extras.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ void pc_set_levels(u32 lev_list);
void pc_set_active_levels(u32 lev_list);
u32 alloc_vagdir_names(u32 heap_sym);
inline u64 bool_to_symbol(const bool val);
// TODO - move to common
void encode_utf8_string(u32 src_str_ptr, u32 str_dest_ptr);
void init_autosplit_struct();
void callback_fetch_external_speedrun_times(bool success,
const std::string& cache_id,
Expand Down
42 changes: 41 additions & 1 deletion game/kernel/jak3/kmachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ void InitMachine_PCPort() {
make_function_symbol_from_c("__pc-set-active-levels",
(void*)kmachine_extras::pc_set_active_levels);
make_function_symbol_from_c("__pc-get-tex-remap", (void*)lookup_jak3_texture_dest_offset);
// make_function_symbol_from_c("pc-init-autosplitter-struct", (void*)init_autosplit_struct);
make_function_symbol_from_c("pc-init-autosplitter-struct",
(void*)kmachine_extras::init_autosplit_struct);

// discord rich presence
make_function_symbol_from_c("pc-discord-rpc-update", (void*)kmachine_extras::update_discord_rpc);
Expand All @@ -395,6 +396,45 @@ void InitMachine_PCPort() {
(void*)pc_get_num_external_highscores);
*/

// speedrunning stuff
make_function_symbol_from_c("pc-sr-mode-get-practice-entries-amount",
(void*)kmachine_extras::pc_sr_mode_get_practice_entries_amount);
make_function_symbol_from_c("pc-sr-mode-get-practice-entry-name",
(void*)kmachine_extras::pc_sr_mode_get_practice_entry_name);
make_function_symbol_from_c("pc-sr-mode-get-practice-entry-continue-point",
(void*)kmachine_extras::pc_sr_mode_get_practice_entry_continue_point);
make_function_symbol_from_c(
"pc-sr-mode-get-practice-entry-history-success",
(void*)kmachine_extras::pc_sr_mode_get_practice_entry_history_success);
make_function_symbol_from_c(
"pc-sr-mode-get-practice-entry-history-attempts",
(void*)kmachine_extras::pc_sr_mode_get_practice_entry_history_attempts);
make_function_symbol_from_c(
"pc-sr-mode-get-practice-entry-session-success",
(void*)kmachine_extras::pc_sr_mode_get_practice_entry_session_success);
make_function_symbol_from_c(
"pc-sr-mode-get-practice-entry-session-attempts",
(void*)kmachine_extras::pc_sr_mode_get_practice_entry_session_attempts);
make_function_symbol_from_c("pc-sr-mode-get-practice-entry-avg-time",
(void*)kmachine_extras::pc_sr_mode_get_practice_entry_avg_time);
make_function_symbol_from_c("pc-sr-mode-get-practice-entry-fastest-time",
(void*)kmachine_extras::pc_sr_mode_get_practice_entry_fastest_time);
make_function_symbol_from_c("pc-sr-mode-record-practice-entry-attempt!",
(void*)kmachine_extras::pc_sr_mode_record_practice_entry_attempt);
make_function_symbol_from_c("pc-sr-mode-init-practice-info!",
(void*)kmachine_extras::pc_sr_mode_init_practice_info);
make_function_symbol_from_c("pc-sr-mode-get-custom-category-amount",
(void*)kmachine_extras::pc_sr_mode_get_custom_category_amount);
make_function_symbol_from_c("pc-sr-mode-get-custom-category-name",
(void*)kmachine_extras::pc_sr_mode_get_custom_category_name);
make_function_symbol_from_c(
"pc-sr-mode-get-custom-category-continue-point",
(void*)kmachine_extras::pc_sr_mode_get_custom_category_continue_point);
make_function_symbol_from_c("pc-sr-mode-init-custom-category-info!",
(void*)kmachine_extras::pc_sr_mode_init_custom_category_info);
make_function_symbol_from_c("pc-sr-mode-dump-new-custom-category",
(void*)kmachine_extras::pc_sr_mode_dump_new_custom_category);

// setup string constants
auto user_dir_path = file_util::get_user_config_dir();
intern_from_c(-1, 0, "*pc-user-dir-base-path*")->value() =
Expand Down
Loading

0 comments on commit 6d1ee67

Please sign in to comment.