diff --git a/rpcs3/Emu/CMakeLists.txt b/rpcs3/Emu/CMakeLists.txt index c9a1bd8f49..bb4e49ae5a 100644 --- a/rpcs3/Emu/CMakeLists.txt +++ b/rpcs3/Emu/CMakeLists.txt @@ -143,7 +143,11 @@ target_sources(rpcs3_emu PRIVATE Cell/SPURecompiler.cpp Cell/SPUThread.cpp Cell/lv2/lv2.cpp + Cell/lv2/sys_bdemu.cpp + Cell/lv2/sys_btsetting.cpp Cell/lv2/sys_cond.cpp + Cell/lv2/sys_console.cpp + Cell/lv2/sys_crypto_engine.cpp Cell/lv2/sys_config.cpp Cell/lv2/sys_dbg.cpp Cell/lv2/sys_event.cpp @@ -151,7 +155,9 @@ target_sources(rpcs3_emu PRIVATE Cell/lv2/sys_fs.cpp Cell/lv2/sys_gamepad.cpp Cell/lv2/sys_gpio.cpp + Cell/lv2/sys_hid.cpp Cell/lv2/sys_interrupt.cpp + Cell/lv2/sys_io.cpp Cell/lv2/sys_lwcond.cpp Cell/lv2/sys_lwmutex.cpp Cell/lv2/sys_memory.cpp @@ -163,14 +169,18 @@ target_sources(rpcs3_emu PRIVATE Cell/lv2/sys_process.cpp Cell/lv2/sys_prx.cpp Cell/lv2/sys_rsx.cpp + Cell/lv2/sys_rsxaudio.cpp Cell/lv2/sys_rwlock.cpp Cell/lv2/sys_semaphore.cpp Cell/lv2/sys_spu.cpp + Cell/lv2/sys_sm.cpp Cell/lv2/sys_ss.cpp + Cell/lv2/sys_storage.cpp Cell/lv2/sys_time.cpp Cell/lv2/sys_timer.cpp Cell/lv2/sys_trace.cpp Cell/lv2/sys_tty.cpp + Cell/lv2/sys_uart.cpp Cell/lv2/sys_usbd.cpp Cell/lv2/sys_vm.cpp Cell/Modules/cellAdec.cpp @@ -285,7 +295,7 @@ target_sources(rpcs3_emu PRIVATE Cell/Modules/StaticHLE.cpp Cell/Modules/sys_game.cpp Cell/Modules/sys_heap.cpp - Cell/Modules/sys_io.cpp + Cell/Modules/sys_io_.cpp Cell/Modules/sys_libc_.cpp Cell/Modules/sys_libc.cpp Cell/Modules/sys_lv2dbg.cpp diff --git a/rpcs3/Emu/Cell/Modules/sys_io.cpp b/rpcs3/Emu/Cell/Modules/sys_io_.cpp similarity index 100% rename from rpcs3/Emu/Cell/Modules/sys_io.cpp rename to rpcs3/Emu/Cell/Modules/sys_io_.cpp diff --git a/rpcs3/Emu/Cell/PPUFunction.cpp b/rpcs3/Emu/Cell/PPUFunction.cpp index c30534a888..312b0ddf7d 100644 --- a/rpcs3/Emu/Cell/PPUFunction.cpp +++ b/rpcs3/Emu/Cell/PPUFunction.cpp @@ -21,6 +21,7 @@ extern std::string ppu_get_syscall_name(u64 code) case 23: return "sys_process_wait_for_child2"; case 25: return "sys_process_get_sdk_version"; case 26: return "_sys_process_exit2"; + case 27: return "sys_process_spawns_a_self2"; case 28: return "_sys_process_get_number_of_object"; case 29: return "sys_process_get_id2"; case 30: return "_sys_process_get_paramsfo"; @@ -171,6 +172,7 @@ extern std::string ppu_get_syscall_name(u64 code) case 197: return "sys_raw_spu_get_spu_cfg"; case 198: return "sys_spu_thread_recover_page_fault"; case 199: return "sys_raw_spu_recover_page_fault"; + case 213: return "sys_console_write2"; case 215: return "sys_dbg_mat_set_condition"; case 216: return "sys_dbg_mat_get_condition"; case 230: return "sys_isolated_spu_create"; @@ -323,6 +325,8 @@ extern std::string ppu_get_syscall_name(u64 code) case 509: return "sys_hid_manager_release_focus"; case 510: return "sys_hid_manager_check_focus"; case 511: return "sys_hid_manager_set_master_process"; + case 512: return "sys_hid_manager_is_process_permission_root"; + case 514: return "sys_hid_manager_514"; case 516: return "sys_config_open"; case 517: return "sys_config_close"; case 518: return "sys_config_get_service_event"; diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index 0d8cf6d059..f8cd9122c9 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -36,6 +36,16 @@ #include "sys_ss.h" #include "sys_gpio.h" #include "sys_config.h" +#include "sys_bdemu.h" +#include "sys_btsetting.h" +#include "sys_console.h" +#include "sys_hid.h" +#include "sys_io.h" +#include "sys_rsxaudio.h" +#include "sys_sm.h" +#include "sys_storage.h" +#include "sys_uart.h" +#include "sys_crypto_engine.h" extern std::string ppu_get_syscall_name(u64 code); @@ -95,7 +105,7 @@ const std::array s_ppu_syscall_table null_func,//BIND_FUNC(), //24 (0x018) DBG BIND_FUNC(sys_process_get_sdk_version), //25 (0x019) BIND_FUNC(_sys_process_exit2), //26 (0x01A) - null_func,//BIND_FUNC(), //27 (0x01B) DBG + BIND_FUNC(sys_process_spawns_a_self2), //27 (0x01B) DBG null_func,//BIND_FUNC(_sys_process_get_number_of_object)//28 (0x01C) ROOT BIND_FUNC(sys_process_get_id2), //29 (0x01D) ROOT BIND_FUNC(_sys_process_get_paramsfo), //30 (0x01E) @@ -265,7 +275,9 @@ const std::array s_ppu_syscall_table null_func, null_func, null_func, null_func, null_func, //204 UNS? null_func, null_func, null_func, null_func, null_func, //209 UNS? - null_func, null_func, null_func, null_func, null_func, //214 UNS? + null_func, null_func, null_func, //212 UNS? + BIND_FUNC(sys_console_write2), //213 (0x0D5) + null_func, //214 UNS? null_func,//BIND_FUNC(sys_dbg_mat_set_condition) //215 (0x0D7) null_func,//BIND_FUNC(sys_dbg_mat_get_condition) //216 (0x0D8) @@ -357,7 +369,7 @@ const std::array s_ppu_syscall_table BIND_FUNC(sys_memory_allocate_from_container), //350 (0x15E) BIND_FUNC(sys_memory_get_page_attribute), //351 (0x15F) BIND_FUNC(sys_memory_get_user_memory_size), //352 (0x160) - null_func,//BIND_FUNC(sys_memory_get_user_memory_stat) //353 (0x161) + BIND_FUNC(sys_memory_get_user_memory_stat), //353 (0x161) null_func,//BIND_FUNC(sys_memory_...) //354 (0x162) null_func,//BIND_FUNC(sys_memory_...) //355 (0x163) null_func,//BIND_FUNC(sys_memory_allocate_colored) //356 (0x164) @@ -370,10 +382,10 @@ const std::array s_ppu_syscall_table null_func,//BIND_FUNC(sys_mmapper_...) //363 (0x16B) null_func,//BIND_FUNC(sys_mmapper_...) //364 (0x16C) uns_func, uns_func, //366 (0x16E) UNS - null_func,//BIND_FUNC(sys_uart_initialize) //367 (0x16F) ROOT - null_func,//BIND_FUNC(sys_uart_receive) //368 (0x170) ROOT - null_func,//BIND_FUNC(sys_uart_send) //369 (0x171) ROOT - null_func,//BIND_FUNC(sys_uart_get_params) //370 (0x172) ROOT + BIND_FUNC(sys_uart_initialize), //367 (0x16F) ROOT + BIND_FUNC(sys_uart_receive), //368 (0x170) ROOT + BIND_FUNC(sys_uart_send), //369 (0x171) ROOT + BIND_FUNC(sys_uart_get_params), //370 (0x172) ROOT uns_func, //371 (0x173) UNS null_func,//BIND_FUNC(sys_game_watchdog_start) //372 (0x174) null_func,//BIND_FUNC(sys_game_watchdog_stop) //373 (0x175) @@ -381,9 +393,9 @@ const std::array s_ppu_syscall_table null_func,//BIND_FUNC(sys_game_set_system_sw_version) //375 (0x177) ROOT null_func,//BIND_FUNC(sys_game_get_system_sw_version) //376 (0x178) ROOT null_func,//BIND_FUNC(sys_sm_set_shop_mode) //377 (0x179) ROOT - null_func,//BIND_FUNC(sys_sm_get_ext_event2) //378 (0x17A) ROOT - null_func,//BIND_FUNC(sys_sm_shutdown) //379 (0x17B) ROOT - null_func,//BIND_FUNC(sys_sm_get_params) //380 (0x17C) DBG + BIND_FUNC(sys_sm_get_ext_event2), //378 (0x17A) ROOT + BIND_FUNC(sys_sm_shutdown), //379 (0x17B) ROOT + BIND_FUNC(sys_sm_get_params), //380 (0x17C) DBG null_func,//BIND_FUNC(sys_sm_get_inter_lpar_parameter) //381 (0x17D) ROOT null_func,//BIND_FUNC(sys_sm_initialize) //382 (0x17E) ROOT null_func,//BIND_FUNC(sys_game_get_temperature) //383 (0x17F) ROOT @@ -395,13 +407,13 @@ const std::array s_ppu_syscall_table null_func,//BIND_FUNC(sys_sm_set_fan_policy) //389 (0x185) PM null_func,//BIND_FUNC(sys_sm_request_error_log) //390 (0x186) ROOT null_func,//BIND_FUNC(sys_sm_request_be_count) //391 (0x187) ROOT - null_func,//BIND_FUNC(sys_sm_ring_buzzer) //392 (0x188) ROOT + BIND_FUNC(sys_sm_ring_buzzer), //392 (0x188) ROOT null_func,//BIND_FUNC(sys_sm_get_hw_config) //393 (0x189) ROOT null_func,//BIND_FUNC(sys_sm_request_scversion) //394 (0x18A) ROOT null_func,//BIND_FUNC(sys_sm_request_system_event_log) //395 (0x18B) PM null_func,//BIND_FUNC(sys_sm_set_rtc_alarm) //396 (0x18C) ROOT null_func,//BIND_FUNC(sys_sm_get_rtc_alarm) //397 (0x18D) ROOT - null_func,//BIND_FUNC(sys_console_write) //398 (0x18E) ROOT + BIND_FUNC(sys_console_write), //398 (0x18E) ROOT uns_func, //399 (0x18F) UNS null_func,//BIND_FUNC(sys_sm_...) //400 (0x190) PM null_func,//BIND_FUNC(sys_sm_...) //401 (0x191) ROOT @@ -475,21 +487,21 @@ const std::array s_ppu_syscall_table BIND_FUNC(_sys_prx_load_module_on_memcontainer), //497 (0x1F1) BIND_FUNC(_sys_prx_start), //498 (0x1F2) BIND_FUNC(_sys_prx_stop), //499 (0x1F3) - null_func,//BIND_FUNC(sys_hid_manager_open) //500 (0x1F4) + BIND_FUNC(sys_hid_manager_open), //500 (0x1F4) null_func,//BIND_FUNC(sys_hid_manager_close) //501 (0x1F5) - null_func,//BIND_FUNC(sys_hid_manager_read) //502 (0x1F6) ROOT - null_func,//BIND_FUNC(sys_hid_manager_ioctl) //503 (0x1F7) + BIND_FUNC(sys_hid_manager_read), //502 (0x1F6) ROOT + BIND_FUNC(sys_hid_manager_ioctl), //503 (0x1F7) null_func,//BIND_FUNC(sys_hid_manager_map_logical_id_to_port_id) //504 (0x1F8) ROOT null_func,//BIND_FUNC(sys_hid_manager_unmap_logical_id_to_port_id) //505 (0x1F9) ROOT - null_func,//BIND_FUNC(sys_hid_manager_add_hot_key_observer) //506 (0x1FA) ROOT + BIND_FUNC(sys_hid_manager_add_hot_key_observer), //506 (0x1FA) ROOT null_func,//BIND_FUNC(sys_hid_manager_remove_hot_key_observer) //507 (0x1FB) ROOT null_func,//BIND_FUNC(sys_hid_manager_grab_focus) //508 (0x1FC) ROOT null_func,//BIND_FUNC(sys_hid_manager_release_focus) //509 (0x1FD) ROOT - null_func,//BIND_FUNC(sys_hid_manager_check_focus) //510 (0x1FE) + BIND_FUNC(sys_hid_manager_check_focus), //510 (0x1FE) null_func,//BIND_FUNC(sys_hid_manager_set_master_process) //511 (0x1FF) ROOT - null_func,//BIND_FUNC(sys_hid_manager_...) //512 (0x200) ROOT + BIND_FUNC(sys_hid_manager_is_process_permission_root), //512 (0x200) ROOT null_func,//BIND_FUNC(sys_hid_manager_...) //513 (0x201) - null_func,//BIND_FUNC(sys_hid_manager_...) //514 (0x202) + BIND_FUNC(sys_hid_manager_514), //514 (0x202) uns_func, //515 (0x203) UNS BIND_FUNC(sys_config_open), //516 (0x204) BIND_FUNC(sys_config_close), //517 (0x205) @@ -572,41 +584,41 @@ const std::array s_ppu_syscall_table null_func,//BIND_FUNC(sys_bt_cancel_connect_accept_controller) //597 (0x255) null_func,//BIND_FUNC(sys_bluetooth_...) //598 (0x256) ROOT null_func,//BIND_FUNC(sys_bluetooth_...) //599 (0x257) ROOT - null_func,//BIND_FUNC(sys_storage_open) //600 (0x258) ROOT - null_func,//BIND_FUNC(sys_storage_close) //601 (0x259) - null_func,//BIND_FUNC(sys_storage_read) //602 (0x25A) - null_func,//BIND_FUNC(sys_storage_write) //603 (0x25B) - null_func,//BIND_FUNC(sys_storage_send_device_command) //604 (0x25C) - null_func,//BIND_FUNC(sys_storage_async_configure) //605 (0x25D) - null_func,//BIND_FUNC(sys_storage_async_read) //606 (0x25E) - null_func,//BIND_FUNC(sys_storage_async_write) //607 (0x25F) - null_func,//BIND_FUNC(sys_storage_async_cancel) //608 (0x260) - null_func,//BIND_FUNC(sys_storage_get_device_info) //609 (0x261) ROOT - null_func,//BIND_FUNC(sys_storage_get_device_config) //610 (0x262) ROOT - null_func,//BIND_FUNC(sys_storage_report_devices) //611 (0x263) ROOT - null_func,//BIND_FUNC(sys_storage_configure_medium_event) //612 (0x264) ROOT - null_func,//BIND_FUNC(sys_storage_set_medium_polling_interval) //613 (0x265) - null_func,//BIND_FUNC(sys_storage_create_region) //614 (0x266) - null_func,//BIND_FUNC(sys_storage_delete_region) //615 (0x267) - null_func,//BIND_FUNC(sys_storage_execute_device_command) //616 (0x268) - null_func,//BIND_FUNC(sys_storage_check_region_acl) //617 (0x269) - null_func,//BIND_FUNC(sys_storage_set_region_acl) //618 (0x26A) - null_func,//BIND_FUNC(sys_storage_async_send_device_command) //619 (0x26B) + BIND_FUNC(sys_storage_open), //600 (0x258) ROOT + BIND_FUNC(sys_storage_close), //601 (0x259) + BIND_FUNC(sys_storage_read), //602 (0x25A) + BIND_FUNC(sys_storage_write), //603 (0x25B) + BIND_FUNC(sys_storage_send_device_command), //604 (0x25C) + BIND_FUNC(sys_storage_async_configure), //605 (0x25D) + BIND_FUNC(sys_storage_async_read), //606 (0x25E) + BIND_FUNC(sys_storage_async_write), //607 (0x25F) + BIND_FUNC(sys_storage_async_cancel), //608 (0x260) + BIND_FUNC(sys_storage_get_device_info), //609 (0x261) ROOT + BIND_FUNC(sys_storage_get_device_config), //610 (0x262) ROOT + BIND_FUNC(sys_storage_report_devices), //611 (0x263) ROOT + BIND_FUNC(sys_storage_configure_medium_event), //612 (0x264) ROOT + BIND_FUNC(sys_storage_set_medium_polling_interval), //613 (0x265) + BIND_FUNC(sys_storage_create_region), //614 (0x266) + BIND_FUNC(sys_storage_delete_region), //615 (0x267) + BIND_FUNC(sys_storage_execute_device_command), //616 (0x268) + BIND_FUNC(sys_storage_check_region_acl), //617 (0x269) + BIND_FUNC(sys_storage_set_region_acl), //618 (0x26A) + BIND_FUNC(sys_storage_async_send_device_command), //619 (0x26B) null_func,//BIND_FUNC(sys_...) //620 (0x26C) ROOT BIND_FUNC(sys_gamepad_ycon_if), //621 (0x26D) - null_func,//BIND_FUNC(sys_storage_get_region_offset) //622 (0x26E) - null_func,//BIND_FUNC(sys_storage_set_emulated_speed) //623 (0x26F) - null_func,//BIND_FUNC(sys_io_buffer_create) //624 (0x270) - null_func,//BIND_FUNC(sys_io_buffer_destroy) //625 (0x271) - null_func,//BIND_FUNC(sys_io_buffer_allocate) //626 (0x272) - null_func,//BIND_FUNC(sys_io_buffer_free) //627 (0x273) + BIND_FUNC(sys_storage_get_region_offset), //622 (0x26E) + BIND_FUNC(sys_storage_set_emulated_speed), //623 (0x26F) + BIND_FUNC(sys_io_buffer_create), //624 (0x270) + BIND_FUNC(sys_io_buffer_destroy), //625 (0x271) + BIND_FUNC(sys_io_buffer_allocate), //626 (0x272) + BIND_FUNC(sys_io_buffer_free), //627 (0x273) uns_func, uns_func, //629 (0x275) UNS BIND_FUNC(sys_gpio_set), //630 (0x276) BIND_FUNC(sys_gpio_get), //631 (0x277) uns_func, //632 (0x278) UNS null_func,//BIND_FUNC(sys_fsw_connect_event) //633 (0x279) null_func,//BIND_FUNC(sys_fsw_disconnect_event) //634 (0x27A) - null_func,//BIND_FUNC(sys_btsetting_if) //635 (0x27B) + BIND_FUNC(sys_btsetting_if), //635 (0x27B) null_func,//BIND_FUNC(sys_...) //636 (0x27C) null_func,//BIND_FUNC(sys_...) //637 (0x27D) null_func,//BIND_FUNC(sys_...) //638 (0x27E) @@ -623,10 +635,10 @@ const std::array s_ppu_syscall_table null_func,//BIND_FUNC(sys_...) //648 DEPRECATED null_func,//BIND_FUNC(sys_...) //649 DEPRECATED - null_func,//BIND_FUNC(sys_rsxaudio_initialize) //650 (0x28A) - null_func,//BIND_FUNC(sys_rsxaudio_finalize) //651 (0x28B) - null_func,//BIND_FUNC(sys_rsxaudio_import_shared_memory) //652 (0x28C) - null_func,//BIND_FUNC(sys_rsxaudio_unimport_shared_memory) //653 (0x28D) + BIND_FUNC(sys_rsxaudio_initialize), //650 (0x28A) + BIND_FUNC(sys_rsxaudio_finalize), //651 (0x28B) + BIND_FUNC(sys_rsxaudio_import_shared_memory), //652 (0x28C) + BIND_FUNC(sys_rsxaudio_unimport_shared_memory), //653 (0x28D) null_func,//BIND_FUNC(sys_rsxaudio_create_connection) //654 (0x28E) null_func,//BIND_FUNC(sys_rsxaudio_close_connection) //655 (0x28F) null_func,//BIND_FUNC(sys_rsxaudio_prepare_process) //656 (0x290) @@ -669,7 +681,7 @@ const std::array s_ppu_syscall_table null_func,//BIND_FUNC(sys_...) //696 (0x2B8) ROOT uns_func,//BIND_FUNC(sys_...) //697 (0x2B9) UNS uns_func,//BIND_FUNC(sys_...) //698 (0x2BA) UNS - null_func,//BIND_FUNC(sys_bdemu_send_command) //699 (0x2BB) + BIND_FUNC(sys_bdemu_send_command), //699 (0x2BB) BIND_FUNC(sys_net_bnet_accept), //700 (0x2BC) BIND_FUNC(sys_net_bnet_bind), //701 (0x2BD) BIND_FUNC(sys_net_bnet_connect), //702 (0x2BE) @@ -873,15 +885,15 @@ const std::array s_ppu_syscall_table uns_func,//BIND_FUNC(sys_dbg_...) //973 (0x3CD) null_func,//BIND_FUNC(sys_dbg_...) //974 (0x3CE) null_func,//BIND_FUNC(sys_dbg_read_spu_thread_context2) //975 (0x3CF) - null_func,//BIND_FUNC(sys_crypto_engine_create) //976 (0x3D0) - null_func,//BIND_FUNC(sys_crypto_engine_destroy) //977 (0x3D1) + BIND_FUNC(sys_crypto_engine_create), //976 (0x3D0) + BIND_FUNC(sys_crypto_engine_destroy), //977 (0x3D1) null_func,//BIND_FUNC(sys_crypto_engine_hasher_prepare) //978 (0x3D2) ROOT null_func,//BIND_FUNC(sys_crypto_engine_hasher_run) //979 (0x3D3) null_func,//BIND_FUNC(sys_crypto_engine_hasher_get_hash) //980 (0x3D4) null_func,//BIND_FUNC(sys_crypto_engine_cipher_prepare) //981 (0x3D5) ROOT null_func,//BIND_FUNC(sys_crypto_engine_cipher_run) //982 (0x3D6) null_func,//BIND_FUNC(sys_crypto_engine_cipher_get_hash) //983 (0x3D7) - null_func,//BIND_FUNC(sys_crypto_engine_random_generate) //984 (0x3D8) + BIND_FUNC(sys_crypto_engine_random_generate), //984 (0x3D8) null_func,//BIND_FUNC(sys_dbg_get_console_type) //985 (0x3D9) ROOT null_func,//BIND_FUNC(sys_dbg_...) //986 (0x3DA) ROOT DBG null_func,//BIND_FUNC(sys_dbg_...) //987 (0x3DB) ROOT diff --git a/rpcs3/Emu/Cell/lv2/sys_bdemu.cpp b/rpcs3/Emu/Cell/lv2/sys_bdemu.cpp new file mode 100644 index 0000000000..5cc18fa013 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_bdemu.cpp @@ -0,0 +1,16 @@ +#include "stdafx.h" +#include "Emu/System.h" +#include "Emu/Memory/vm.h" + +#include "Emu/Cell/ErrorCodes.h" + +#include "sys_bdemu.h" + +LOG_CHANNEL(sys_bdemu); + +error_code sys_bdemu_send_command(u64 cmd, u64 a2, u64 a3, vm::ptr buf, u64 buf_len) +{ + sys_bdemu.todo("sys_bdemu_send_command(cmd=0%llx, a2=0x%x, a3=0x%x, buf=0x%x, buf_len=0x%x)", cmd, a2, a3, buf, buf_len); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_bdemu.h b/rpcs3/Emu/Cell/lv2/sys_bdemu.h new file mode 100644 index 0000000000..e3771e253c --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_bdemu.h @@ -0,0 +1,7 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +// SysCalls + +error_code sys_bdemu_send_command(u64 cmd, u64 a2, u64 a3, vm::ptr buf, u64 buf_len); diff --git a/rpcs3/Emu/Cell/lv2/sys_btsetting.cpp b/rpcs3/Emu/Cell/lv2/sys_btsetting.cpp new file mode 100644 index 0000000000..b5ecd1d180 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_btsetting.cpp @@ -0,0 +1,13 @@ +#include "stdafx.h" + +#include "sys_btsetting.h" +#include "Emu/Cell/ErrorCodes.h" + +LOG_CHANNEL(sys_btsetting); + +error_code sys_btsetting_if(u64 cmd, vm::ptr msg) +{ + sys_btsetting.todo("sys_btsetting_if(cmd=0x%llx, msg=*0x%x)", cmd, msg); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_btsetting.h b/rpcs3/Emu/Cell/lv2/sys_btsetting.h new file mode 100644 index 0000000000..b2e50913f5 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_btsetting.h @@ -0,0 +1,7 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +// SysCalls + +error_code sys_btsetting_if(u64 cmd, vm::ptr msg); diff --git a/rpcs3/Emu/Cell/lv2/sys_console.cpp b/rpcs3/Emu/Cell/lv2/sys_console.cpp new file mode 100644 index 0000000000..9001d3019e --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_console.cpp @@ -0,0 +1,15 @@ +#include "stdafx.h" +#include "Emu/System.h" +#include "Emu/Cell/ErrorCodes.h" + +#include "sys_console.h" + + +LOG_CHANNEL(sys_console); + +error_code sys_console_write(vm::cptr buf, u32 len) +{ + sys_console.todo("sys_console_write(buf=*0x%x, len=0x%x)", buf, len); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_console.h b/rpcs3/Emu/Cell/lv2/sys_console.h new file mode 100644 index 0000000000..202f238232 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_console.h @@ -0,0 +1,8 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +// SysCalls + +error_code sys_console_write(vm::cptr buf, u32 len); +constexpr auto sys_console_write2 = sys_console_write; diff --git a/rpcs3/Emu/Cell/lv2/sys_crypto_engine.cpp b/rpcs3/Emu/Cell/lv2/sys_crypto_engine.cpp new file mode 100644 index 0000000000..0c149e5eb6 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_crypto_engine.cpp @@ -0,0 +1,28 @@ +#include "stdafx.h" + +#include "Emu/Cell/ErrorCodes.h" + +#include "sys_crypto_engine.h" + +LOG_CHANNEL(sys_crypto_engine); + +error_code sys_crypto_engine_create(vm::ptr id) +{ + sys_crypto_engine.todo("sys_crypto_engine_create(id=*0x%x)", id); + + return CELL_OK; +} + +error_code sys_crypto_engine_destroy(u32 id) +{ + sys_crypto_engine.todo("sys_crypto_engine_destroy(id=0x%x)", id); + + return CELL_OK; +} + +error_code sys_crypto_engine_random_generate(vm::ptr buffer, u64 buffer_size) +{ + sys_crypto_engine.todo("sys_crypto_engine_random_generate(buffer=*0x%x, buffer_size=0x%x", buffer, buffer_size); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_crypto_engine.h b/rpcs3/Emu/Cell/lv2/sys_crypto_engine.h new file mode 100644 index 0000000000..d100fce56e --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_crypto_engine.h @@ -0,0 +1,9 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +// SysCalls + +error_code sys_crypto_engine_create(vm::ptr id); +error_code sys_crypto_engine_destroy(u32 id); +error_code sys_crypto_engine_random_generate(vm::ptr buffer, u64 buffer_size); diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.cpp b/rpcs3/Emu/Cell/lv2/sys_fs.cpp index 1a60b79217..27b443b49a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_fs.cpp @@ -1999,3 +1999,24 @@ error_code sys_fs_truncate2(ppu_thread& ppu, u32 fd, u64 size) return CELL_OK; } + +error_code sys_fs_get_mount_info_size(ppu_thread& ppu, vm::ptr len) +{ + sys_fs.todo("sys_fs_get_mount_info_size(len=*0x%x)", len); + + return CELL_OK; +} + +error_code sys_fs_get_mount_info(ppu_thread& ppu, vm::ptr info, u32 len, vm::ptr out_len) +{ + sys_fs.todo("sys_fs_get_mount_info(info=*0x%x, len=0x%x, out_len=*0x%x)", info, len, out_len); + + return CELL_OK; +} + +error_code sys_fs_mount(ppu_thread& ppu, vm::cptr dev_name, vm::cptr file_system, vm::cptr path, s32 unk1, s32 prot, s32 unk3, vm::cptr str1, u32 str_len) +{ + sys_fs.todo("sys_fs_mount(dev_name=%s, file_system=%s, path=%s, unk1=0x%x, prot=0x%x, unk3=0x%x, str1=%s, str_len=%d)", dev_name, file_system, path, unk1, prot, unk3, str1, str_len); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.h b/rpcs3/Emu/Cell/lv2/sys_fs.h index eb39e46592..ceb0826fea 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.h +++ b/rpcs3/Emu/Cell/lv2/sys_fs.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Emu/Memory/vm_ptr.h" #include "Emu/Cell/ErrorCodes.h" @@ -360,6 +360,20 @@ struct lv2_file_e0000017 : lv2_file_op CHECK_SIZE(lv2_file_e0000017, 0x28); +struct CellFsMountInfo +{ + char mount_path[0x20]; // 0x0 + char filesystem[0x20]; // 0x20 + char dev_name[0x40]; // 0x40 + be_t unk1; // 0x80 + be_t unk2; // 0x84 + be_t unk3; // 0x88 + be_t unk4; // 0x8C + be_t unk5; // 0x90 +}; + +CHECK_SIZE(CellFsMountInfo, 0x94); + // Syscalls error_code sys_fs_test(ppu_thread& ppu, u32 arg1, u32 arg2, vm::ptr arg3, u32 arg4, vm::ptr buf, u32 buf_size); @@ -402,3 +416,6 @@ error_code sys_fs_lsn_write(ppu_thread& ppu, u32 fd, vm::cptr, u64); error_code sys_fs_mapped_allocate(ppu_thread& ppu, u32 fd, u64, vm::pptr out_ptr); error_code sys_fs_mapped_free(ppu_thread& ppu, u32 fd, vm::ptr ptr); error_code sys_fs_truncate2(ppu_thread& ppu, u32 fd, u64 size); +error_code sys_fs_mount(ppu_thread& ppu, vm::cptr dev_name, vm::cptr file_system, vm::cptr path, s32 unk1, s32 prot, s32 unk3, vm::cptr str1, u32 str_len); +error_code sys_fs_get_mount_info_size(ppu_thread& ppu, vm::ptr len); +error_code sys_fs_get_mount_info(ppu_thread& ppu, vm::ptr info, u32 len, vm::ptr out_len); diff --git a/rpcs3/Emu/Cell/lv2/sys_hid.cpp b/rpcs3/Emu/Cell/lv2/sys_hid.cpp new file mode 100644 index 0000000000..5d6729b4eb --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_hid.cpp @@ -0,0 +1,58 @@ +#include "stdafx.h" +#include "Emu/System.h" +#include "Emu/Memory/vm.h" +#include "Emu/Cell/ErrorCodes.h" + +#include "sys_process.h" +#include "sys_hid.h" + +LOG_CHANNEL(sys_hid); + +error_code sys_hid_manager_open(u64 device_type, u64 port_no, vm::ptr handle) +{ + sys_hid.todo("sys_hid_manager_open(device_type=0x%llx, port_no=0x%llx, handle=*0x%llx)", device_type, port_no, handle); + + return CELL_OK; +} + +error_code sys_hid_manager_ioctl(u32 hid_handle, u32 pkg_id, vm::ptr buf, u64 buf_size) +{ + sys_hid.todo("sys_hid_manager_ioctl(hid_handle=0x%x, pkg_id=0x%llx, buf=*0x%x, buf_size=0x%llx)", hid_handle, pkg_id, buf, buf_size); + + return CELL_OK; +} + +error_code sys_hid_manager_check_focus() +{ + sys_hid.todo("sys_hid_manager_check_focus()"); + + return CELL_OK; +} + +error_code sys_hid_manager_514(u32 pkg_id, vm::ptr buf, u64 buf_size) +{ + sys_hid.todo("sys_hid_manager_514(pkg_id=0x%x, buf=*0x%x, buf_size=0x%llx)", pkg_id, buf, buf_size); + + return CELL_OK; +} + +error_code sys_hid_manager_is_process_permission_root(u32 pid) +{ + sys_hid.todo("sys_hid_manager_is_process_permission_root(pid=0x%x)", pid); + + return not_an_error(g_ps3_process_info.has_root_perm()); +} + +error_code sys_hid_manager_add_hot_key_observer(u32 event_queue, vm::ptr unk) +{ + sys_hid.todo("sys_hid_manager_add_hot_key_observer(event_queue=0x%x, unk=*0x%x)", event_queue, unk); + + return CELL_OK; +} + +error_code sys_hid_manager_read(u32 handle, u32 pkg_id, vm::ptr buf, u64 buf_size) +{ + sys_hid.todo("sys_hid_manager_read(handle=0x%x, pkg_id=0x%x, buf=*0x%x, buf_size=0x%llx)", handle, pkg_id, buf, buf_size); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_hid.h b/rpcs3/Emu/Cell/lv2/sys_hid.h new file mode 100644 index 0000000000..6ab88b5dd3 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_hid.h @@ -0,0 +1,13 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +// SysCalls + +error_code sys_hid_manager_open(u64 device_type, u64 port_no, vm::ptr handle); +error_code sys_hid_manager_ioctl(u32 hid_handle, u32 pkg_id, vm::ptr buf, u64 buf_size); +error_code sys_hid_manager_add_hot_key_observer(u32 event_queue, vm::ptr unk); +error_code sys_hid_manager_check_focus(); +error_code sys_hid_manager_is_process_permission_root(u32 pid); +error_code sys_hid_manager_514(u32 pkg_id, vm::ptr buf, u64 buf_size); +error_code sys_hid_manager_read(u32 handle, u32 pkg_id, vm::ptr buf, u64 buf_size); diff --git a/rpcs3/Emu/Cell/lv2/sys_io.cpp b/rpcs3/Emu/Cell/lv2/sys_io.cpp new file mode 100644 index 0000000000..8b7162f17c --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_io.cpp @@ -0,0 +1,37 @@ +#include "stdafx.h" +#include "Emu/System.h" +#include "Emu/Memory/vm.h" +#include "Emu/IdManager.h" +#include "Emu/Cell/ErrorCodes.h" + +#include "sys_io.h" + +LOG_CHANNEL(sys_io); + +error_code sys_io_buffer_create(u32 block_count, u32 block_size, u32 blocks, u32 unk1, vm::ptr handle) +{ + sys_io.todo("sys_io_buffer_create(block_count=0x%x, block_size=0x%x, blocks=0x%x, unk1=0x%x, handle=*0x%x)", block_count, block_size, blocks, unk1, handle); + + return CELL_OK; +} + +error_code sys_io_buffer_destroy(u32 handle) +{ + sys_io.todo("sys_io_buffer_destroy(handle=0x%x)", handle); + + return CELL_OK; +} + +error_code sys_io_buffer_allocate(u32 handle, vm::ptr block) +{ + sys_io.todo("sys_io_buffer_allocate(handle=0x%x, block=*0x%x)", handle, block); + + return CELL_OK; +} + +error_code sys_io_buffer_free(u32 handle, u32 block) +{ + sys_io.todo("sys_io_buffer_free(handle=0x%x, block=0x%x)", handle, block); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_io.h b/rpcs3/Emu/Cell/lv2/sys_io.h new file mode 100644 index 0000000000..1f8924134a --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_io.h @@ -0,0 +1,10 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +// SysCalls + +error_code sys_io_buffer_create(u32 block_count, u32 block_size, u32 blocks, u32 unk1, vm::ptr handle); +error_code sys_io_buffer_destroy(u32 handle); +error_code sys_io_buffer_allocate(u32 handle, vm::ptr block); +error_code sys_io_buffer_free(u32 handle, u32 block); diff --git a/rpcs3/Emu/Cell/lv2/sys_memory.cpp b/rpcs3/Emu/Cell/lv2/sys_memory.cpp index 4ba2372f2c..d8c5d8e3dc 100644 --- a/rpcs3/Emu/Cell/lv2/sys_memory.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_memory.cpp @@ -260,6 +260,15 @@ error_code sys_memory_get_user_memory_size(vm::ptr mem_info) return CELL_OK; } +error_code sys_memory_get_user_memory_stat(vm::ptr mem_stat) +{ + vm::temporary_unlock(); + + sys_memory.todo("sys_memory_get_user_memory_stat(mem_stat=*0x%x)", mem_stat); + + return CELL_OK; +} + error_code sys_memory_container_create(vm::ptr cid, u32 size) { vm::temporary_unlock(); diff --git a/rpcs3/Emu/Cell/lv2/sys_memory.h b/rpcs3/Emu/Cell/lv2/sys_memory.h index 91666f989d..1749e3bb63 100644 --- a/rpcs3/Emu/Cell/lv2/sys_memory.h +++ b/rpcs3/Emu/Cell/lv2/sys_memory.h @@ -91,12 +91,24 @@ struct lv2_memory_alloca lv2_memory_alloca(u32 size, u32 align, u64 flags, const std::shared_ptr& ct); }; +struct sys_memory_user_memory_stat_t +{ + be_t a; // 0x0 + be_t b; // 0x4 + be_t c; // 0x8 + be_t d; // 0xc + be_t e; // 0x10 + be_t f; // 0x14 + be_t g; // 0x18 +}; + // SysCalls error_code sys_memory_allocate(u32 size, u64 flags, vm::ptr alloc_addr); error_code sys_memory_allocate_from_container(u32 size, u32 cid, u64 flags, vm::ptr alloc_addr); error_code sys_memory_free(u32 start_addr); error_code sys_memory_get_page_attribute(u32 addr, vm::ptr attr); error_code sys_memory_get_user_memory_size(vm::ptr mem_info); +error_code sys_memory_get_user_memory_stat(vm::ptr mem_stat); error_code sys_memory_container_create(vm::ptr cid, u32 size); error_code sys_memory_container_destroy(u32 cid); error_code sys_memory_container_get_size(vm::ptr mem_info, u32 cid); diff --git a/rpcs3/Emu/Cell/lv2/sys_process.cpp b/rpcs3/Emu/Cell/lv2/sys_process.cpp index 90141001cf..6d24464db6 100644 --- a/rpcs3/Emu/Cell/lv2/sys_process.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_process.cpp @@ -362,3 +362,11 @@ void _sys_process_exit2(ppu_thread& ppu, s32 status, vm::ptr ar ppu.state += cpu_flag::dbg_global_stop; } + +error_code sys_process_spawns_a_self2(vm::ptr pid, u32 primary_prio, u64 flags, vm::ptr stack, u32 stack_size, u32 mem_id, vm::ptr param_sfo, vm::ptr dbg_data) +{ + sys_process.todo("sys_process_spawns_a_self2(pid=*0x%x, primary_prio=0x%x, flags=0x%llx, stack=*0x%x, stack_size=0x%x, mem_id=0x%x, param_sfo=*0x%x, dbg_data=*0x%x" + , pid, primary_prio, flags, stack, stack_size, mem_id, param_sfo, dbg_data); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_process.h b/rpcs3/Emu/Cell/lv2/sys_process.h index f65d4a4be5..f871cf3f20 100644 --- a/rpcs3/Emu/Cell/lv2/sys_process.h +++ b/rpcs3/Emu/Cell/lv2/sys_process.h @@ -72,3 +72,4 @@ error_code sys_process_wait_for_child2(u64 unk1, u64 unk2, u64 unk3, u64 unk4, u error_code sys_process_detach_child(u64 unk); void _sys_process_exit(ppu_thread& ppu, s32 status, u32 arg2, u32 arg3); void _sys_process_exit2(ppu_thread& ppu, s32 status, vm::ptr arg, u32 arg_size, u32 arg4); +error_code sys_process_spawns_a_self2(vm::ptr pid, u32 primary_prio, u64 flags, vm::ptr stack, u32 stack_size, u32 mem_id, vm::ptr param_sfo, vm::ptr dbg_data); diff --git a/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp new file mode 100644 index 0000000000..7b5482e0b5 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.cpp @@ -0,0 +1,36 @@ +#include "stdafx.h" +#include "Emu/System.h" +#include "Emu/Memory/vm.h" +#include "Emu/Cell/ErrorCodes.h" + +#include "sys_rsxaudio.h" + +LOG_CHANNEL(sys_rsxaudio); + +error_code sys_rsxaudio_initialize(vm::ptr handle) +{ + sys_rsxaudio.todo("sys_rsxaudio_initialize(handle=*0x%x)", handle); + + return CELL_OK; +} + +error_code sys_rsxaudio_finalize(u32 handle) +{ + sys_rsxaudio.todo("sys_rsxaudio_finalize(handle=0x%x)", handle); + + return CELL_OK; +} + +error_code sys_rsxaudio_import_shared_memory(u32 handle, vm::ptr addr) +{ + sys_rsxaudio.todo("sys_rsxaudio_import_shared_memory(handle=0x%x, addr=*0x%x)", handle, addr); + + return CELL_OK; +} + +error_code sys_rsxaudio_unimport_shared_memory(u32 handle, vm::ptr addr) +{ + sys_rsxaudio.todo("sys_rsxaudio_unimport_shared_memory(handle=0x%x, addr=*0x%x)", handle, addr); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_rsxaudio.h b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.h new file mode 100644 index 0000000000..b3802d6146 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_rsxaudio.h @@ -0,0 +1,10 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +// SysCalls + +error_code sys_rsxaudio_initialize(vm::ptr handle); +error_code sys_rsxaudio_finalize(u32 handle); +error_code sys_rsxaudio_import_shared_memory(u32 handle, vm::ptr addr); +error_code sys_rsxaudio_unimport_shared_memory(u32 handle, vm::ptr addr); diff --git a/rpcs3/Emu/Cell/lv2/sys_sm.cpp b/rpcs3/Emu/Cell/lv2/sys_sm.cpp new file mode 100644 index 0000000000..62ac5448e1 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_sm.cpp @@ -0,0 +1,45 @@ +#include "stdafx.h" +#include "Emu/System.h" +#include "Emu/Memory/vm.h" + +#include "Emu/Cell/ErrorCodes.h" + +#include "sys_sm.h" + + +LOG_CHANNEL(sys_sm); + +error_code sys_sm_get_params(vm::ptr a, vm::ptr b, vm::ptr c, vm::ptr d) +{ + sys_sm.todo("sys_sm_get_params(a=*0x%x, b=*0x%x, c=*0x%x, d=*0x%x)", a, b, c, d); + + return CELL_OK; +} + +error_code sys_sm_get_ext_event2(vm::ptr a1, vm::ptr a2, vm::ptr a3, u64 a4) +{ + sys_sm.todo("sys_sm_get_ext_event2(a1=*0x%x, a2=*0x%x, a3=*0x%x, a4=*0x%x, a4=0x%xll", a1, a2, a3, a4); + + return CELL_OK; +} + +error_code sys_sm_shutdown(u16 op, vm::ptr param, u64 size) +{ + sys_sm.todo("sys_sm_shutdown(op=0x%x, param=*0x%x, size=0x%x", op, param, size); + + return CELL_OK; +} + +error_code sys_sm_control_led(u8 led, u8 action) +{ + sys_sm.todo("sys_sm_control_led(led=0x%x, action=0x%x)", led, action); + + return CELL_OK; +} + +error_code sys_sm_ring_buzzer(u64 packet, u64 a1, u64 a2) +{ + sys_sm.todo("sys_sm_ring_buzzer(packet=0x%x, a1=0x%x, a2=0x%x)", packet, a1, a2); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_sm.h b/rpcs3/Emu/Cell/lv2/sys_sm.h new file mode 100644 index 0000000000..3ea4516c90 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_sm.h @@ -0,0 +1,11 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +// SysCalls + +error_code sys_sm_get_ext_event2(vm::ptr a1, vm::ptr a2, vm::ptr a3, u64 a4); +error_code sys_sm_shutdown(u16 op, vm::ptr param, u64 size); +error_code sys_sm_get_params(vm::ptr a, vm::ptr b, vm::ptr c, vm::ptr d); +error_code sys_sm_control_led(u8 led, u8 action); +error_code sys_sm_ring_buzzer(u64 packet, u64 a1, u64 a2); diff --git a/rpcs3/Emu/Cell/lv2/sys_ss.cpp b/rpcs3/Emu/Cell/lv2/sys_ss.cpp index 844c7ac19a..35e3471dca 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ss.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_ss.cpp @@ -87,12 +87,12 @@ error_code sys_ss_access_control_engine(u64 pkg_id, u64 a2, u64 a3) } verify(HERE), a2 == process_getpid(); - vm::_ref(vm::cast(a3)) = authid; + vm::write64(vm::cast(a3), authid); break; } case 0x2: { - vm::_ref(vm::cast(a2)) = authid; + vm::write64(vm::cast(a2), authid); break; } case 0x3: @@ -130,3 +130,52 @@ s32 sys_ss_get_open_psid(vm::ptr psid) return CELL_OK; } + +error_code sys_ss_appliance_info_manager(u32 code, vm::ptr buffer) +{ + sys_ss.todo("sys_ss_appliance_info_manager(code=0x%x, buffer=*0x%x)", code, buffer); + + return CELL_OK; +} + +error_code sys_ss_get_cache_of_product_mode(vm::ptr ptr) +{ + sys_ss.todo("sys_ss_get_cache_of_product_mode(ptr=*0x%x)", ptr); + + return CELL_OK; +} + +error_code sys_ss_secure_rtc(u64 cmd, u64 a2, u64 a3, u64 a4) +{ + sys_ss.todo("sys_ss_secure_rtc(cmd=0x%llx, a2=0x%x, a3=0x%x, a4=0x%x)", cmd, a2, a3, a4); + + return CELL_OK; +} + +error_code sys_ss_get_cache_of_flash_ext_flag(vm::ptr flag) +{ + sys_ss.todo("sys_ss_get_cache_of_flash_ext_flag(flag=*0x%x)", flag); + + return CELL_OK; +} + +error_code sys_ss_get_boot_device(vm::ptr dev) +{ + sys_ss.todo("sys_ss_get_boot_device(dev=*0x%x)", dev); + + return CELL_OK; +} + +error_code sys_ss_update_manager(u64 pkg_id, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6) +{ + sys_ss.todo("sys_ss_update_manager(pkg=0x%llx, a1=0x%x, a2=0x%x, a3=0x%x, a4=0x%x, a5=0x%x, a6=0x%x)", pkg_id, a1, a2, a3, a4, a5, a6); + + return CELL_OK; +} + +error_code sys_ss_virtual_trm_manager(u64 pkg_id, u64 a1, u64 a2, u64 a3, u64 a4) +{ + sys_ss.todo("sys_ss_virtual_trm_manager(pkg=0x%llx, a1=0x%llx, a2=0x%llx, a3=0x%llx, a4=0x%llx)", pkg_id, a1, a2, a3, a4); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_ss.h b/rpcs3/Emu/Cell/lv2/sys_ss.h index 3ca032d67d..44603bd50b 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ss.h +++ b/rpcs3/Emu/Cell/lv2/sys_ss.h @@ -13,3 +13,10 @@ error_code sys_ss_random_number_generator(u32 arg1, vm::ptr buf, u64 size) error_code sys_ss_access_control_engine(u64 pkg_id, u64 a2, u64 a3); s32 sys_ss_get_console_id(vm::ptr buf); s32 sys_ss_get_open_psid(vm::ptr ptr); +error_code sys_ss_appliance_info_manager(u32 code, vm::ptr buffer); +error_code sys_ss_get_cache_of_product_mode(vm::ptr ptr); +error_code sys_ss_secure_rtc(u64 cmd, u64 a2, u64 a3, u64 a4); +error_code sys_ss_get_cache_of_flash_ext_flag(vm::ptr flag); +error_code sys_ss_get_boot_device(vm::ptr dev); +error_code sys_ss_update_manager(u64 pkg_id, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); +error_code sys_ss_virtual_trm_manager(u64 pkg_id, u64 a1, u64 a2, u64 a3, u64 a4); diff --git a/rpcs3/Emu/Cell/lv2/sys_storage.cpp b/rpcs3/Emu/Cell/lv2/sys_storage.cpp new file mode 100644 index 0000000000..ace73e1416 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_storage.cpp @@ -0,0 +1,165 @@ +#include "stdafx.h" +#include "Emu/System.h" +#include "Emu/Memory/vm.h" +#include "Emu/IdManager.h" + +#include "Emu/Cell/ErrorCodes.h" + +#include "sys_storage.h" + + +LOG_CHANNEL(sys_storage); + +error_code sys_storage_open(u64 device, u64 mode, vm::ptr fd, u64 flags) +{ + sys_storage.todo("sys_storage_open(device=0x%x, mode=0x%x, fd=*0x%x, flags=0x%x)", device, mode, fd, flags); + + return CELL_OK; +} + +error_code sys_storage_close(u32 fd) +{ + sys_storage.todo("sys_storage_close(fd=0x%x)", fd); + + return CELL_OK; +} + +error_code sys_storage_read(u32 fd, u32 mode, u32 start_sector, u32 num_sectors, vm::ptr bounce_buf, vm::ptr sectors_read, u64 flags) +{ + sys_storage.todo("sys_storage_read(fd=0x%x, mode=0x%x, start_sector=0x%x, num_sectors=0x%x, bounce_buf=*0x%x, sectors_read=*0x%x, flags=0x%x)", fd, mode, start_sector, num_sectors, bounce_buf, sectors_read, flags); + + return CELL_OK; +} + +error_code sys_storage_write(u32 fd, u32 mode, u32 start_sector, u32 num_sectors, vm::ptr data, vm::ptr sectors_wrote, u64 flags) +{ + sys_storage.todo("sys_storage_write(fd=0x%x, mode=0x%x, start_sector=0x%x, num_sectors=0x%x, data=*=0x%x, sectors_wrote=*0x%x, flags=0x%llx)", fd, mode, start_sector, num_sectors, data, sectors_wrote, flags); + + return CELL_OK; +} + +error_code sys_storage_send_device_command(u32 dev_handle, u64 cmd, vm::ptr in, u64 inlen, vm::ptr out, u64 outlen) +{ + sys_storage.todo("sys_storage_send_device_command(dev_handle=0x%x, cmd=0x%llx, in=*0x%, inlen=0x%x, out=*0x%x, outlen=0x%x)", dev_handle, cmd, in, inlen, out, outlen); + + return CELL_OK; +} + +error_code sys_storage_async_configure(u32 fd, u32 io_buf, u32 equeue_id, u32 unk) +{ + sys_storage.todo("sys_storage_async_configure(fd=0x%x, io_buf=0x%x, equeue_id=0x%x, unk=*0x%x)", fd, io_buf, equeue_id, unk); + + return CELL_OK; +} + +error_code sys_storage_async_send_device_command(u32 dev_handle, u64 cmd, vm::ptr in, u64 inlen, vm::ptr out, u64 outlen, u64 unk) +{ + sys_storage.todo("sys_storage_async_send_device_command(dev_handle=0x%x, cmd=0x%llx, in=*0x%x, inlen=0x%x, out=*0x%x, outlen=0x%x, unk=0x%x)", dev_handle, cmd, in, inlen, out, outlen, unk); + + return CELL_OK; +} + +error_code sys_storage_async_read() +{ + sys_storage.todo("sys_storage_async_read()"); + + return CELL_OK; +} + +error_code sys_storage_async_write() +{ + sys_storage.todo("sys_storage_async_write()"); + + return CELL_OK; +} + +error_code sys_storage_async_cancel() +{ + sys_storage.todo("sys_storage_async_cancel()"); + + return CELL_OK; +} + +error_code sys_storage_get_device_info(u64 device, vm::ptr buffer) +{ + sys_storage.todo("sys_storage_get_device_info(device=0x%x, buffer=*0x%x)", device, buffer); + + return CELL_OK; +} + +error_code sys_storage_get_device_config(vm::ptr storages, vm::ptr devices) +{ + sys_storage.todo("sys_storage_get_device_config(storages=*0x%x, devices=*0x%x)", storages, devices); + + return CELL_OK; +} + +error_code sys_storage_report_devices(u32 storages, u32 start, u32 devices, vm::ptr device_ids) +{ + sys_storage.todo("sys_storage_report_devices(storages=0x%x, start=0x%x, devices=0x%x, device_ids=0x%x)", storages, start, devices, device_ids); + + return CELL_OK; +} + +error_code sys_storage_configure_medium_event(u32 fd, u32 equeue_id, u32 c) +{ + sys_storage.todo("sys_storage_configure_medium_event(fd=0x%x, equeue_id=0x%x, c=0x%x)", fd, equeue_id, c); + + return CELL_OK; +} + +error_code sys_storage_set_medium_polling_interval() +{ + sys_storage.todo("sys_storage_set_medium_polling_interval()"); + + return CELL_OK; +} + +error_code sys_storage_create_region() +{ + sys_storage.todo("sys_storage_create_region()"); + + return CELL_OK; +} + +error_code sys_storage_delete_region() +{ + sys_storage.todo("sys_storage_delete_region()"); + + return CELL_OK; +} + +error_code sys_storage_execute_device_command(u32 fd, u64 cmd, vm::ptr cmdbuf, u64 cmdbuf_size, vm::ptr databuf, u64 databuf_size, vm::ptr driver_status) +{ + sys_storage.todo("sys_storage_execute_device_command(fd=0x%x, cmd=0x%llx, cmdbuf=*0x%x, cmdbuf_size=0x%llx, databuf=*0x%x, databuf_size=0x%llx, driver_status=*0x%x)", fd, cmd, cmdbuf, cmdbuf_size, databuf, databuf_size, driver_status); + + return CELL_OK; +} + +error_code sys_storage_check_region_acl() +{ + sys_storage.todo("sys_storage_check_region_acl()"); + + return CELL_OK; +} + +error_code sys_storage_set_region_acl() +{ + sys_storage.todo("sys_storage_set_region_acl()"); + + return CELL_OK; +} + +error_code sys_storage_get_region_offset() +{ + sys_storage.todo("sys_storage_get_region_offset()"); + + return CELL_OK; +} + +error_code sys_storage_set_emulated_speed() +{ + sys_storage.todo("sys_storage_set_emulated_speed()"); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_storage.h b/rpcs3/Emu/Cell/lv2/sys_storage.h new file mode 100644 index 0000000000..737eebbdf8 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_storage.h @@ -0,0 +1,39 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +struct StorageDeviceInfo +{ + u8 name[0x20]; // 0x0 + be_t zero; // 0x20 + be_t zero2; // 0x24 + be_t sector_count; // 0x28 + be_t sector_size; // 0x30 + be_t one; // 0x34 + u8 flags[8]; // 0x38 +}; + +// SysCalls + +error_code sys_storage_open(u64 device, u64 mode, vm::ptr fd, u64 flags); +error_code sys_storage_close(u32 fd); +error_code sys_storage_read(u32 fd, u32 mode, u32 start_sector, u32 num_sectors, vm::ptr bounce_buf, vm::ptr sectors_read, u64 flags); +error_code sys_storage_write(u32 fd, u32 mode, u32 start_sector, u32 num_sectors, vm::ptr data, vm::ptr sectors_wrote, u64 flags); +error_code sys_storage_send_device_command(u32 dev_handle, u64 cmd, vm::ptr in, u64 inlen, vm::ptr out, u64 outlen); +error_code sys_storage_async_configure(u32 fd, u32 io_buf, u32 equeue_id, u32 unk); +error_code sys_storage_async_read(); +error_code sys_storage_async_write(); +error_code sys_storage_async_cancel(); +error_code sys_storage_get_device_info(u64 device, vm::ptr buffer); +error_code sys_storage_get_device_config(vm::ptr storages, vm::ptr devices); +error_code sys_storage_report_devices(u32 storages, u32 start, u32 devices, vm::ptr device_ids); +error_code sys_storage_configure_medium_event(u32 fd, u32 equeue_id, u32 c); +error_code sys_storage_set_medium_polling_interval(); +error_code sys_storage_create_region(); +error_code sys_storage_delete_region(); +error_code sys_storage_execute_device_command(u32 fd, u64 cmd, vm::ptr cmdbuf, u64 cmdbuf_size, vm::ptr databuf, u64 databuf_size, vm::ptr driver_status); +error_code sys_storage_check_region_acl(); +error_code sys_storage_set_region_acl(); +error_code sys_storage_async_send_device_command(u32 dev_handle, u64 cmd, vm::ptr in, u64 inlen, vm::ptr out, u64 outlen, u64 unk); +error_code sys_storage_get_region_offset(); +error_code sys_storage_set_emulated_speed(); diff --git a/rpcs3/Emu/Cell/lv2/sys_time.cpp b/rpcs3/Emu/Cell/lv2/sys_time.cpp index dbf0c4c4c6..a5796d5b12 100644 --- a/rpcs3/Emu/Cell/lv2/sys_time.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_time.cpp @@ -174,7 +174,7 @@ u64 get_guest_system_time() } // Functions -s32 sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime) +error_code sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime) { sys_time.warning("sys_time_get_timezone(timezone=*0x%x, summertime=*0x%x)", timezone, summertime); @@ -184,7 +184,7 @@ s32 sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime) return CELL_OK; } -s32 sys_time_get_current_time(vm::ptr sec, vm::ptr nsec) +error_code sys_time_get_current_time(vm::ptr sec, vm::ptr nsec) { sys_time.trace("sys_time_get_current_time(sec=*0x%x, nsec=*0x%x)", sec, nsec); @@ -273,3 +273,10 @@ u64 sys_time_get_timebase_frequency() return g_timebase_freq; } + +error_code sys_time_get_rtc(vm::ptr rtc) +{ + sys_time.todo("sys_time_get_rtc(rtc=*0x%x)", rtc); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_time.h b/rpcs3/Emu/Cell/lv2/sys_time.h index 5b4c61ffe6..df7f7f9c61 100644 --- a/rpcs3/Emu/Cell/lv2/sys_time.h +++ b/rpcs3/Emu/Cell/lv2/sys_time.h @@ -3,6 +3,8 @@ #include "Emu/Memory/vm_ptr.h" // SysCalls -s32 sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime); -s32 sys_time_get_current_time(vm::ptr sec, vm::ptr nsec); + +error_code sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime); +error_code sys_time_get_current_time(vm::ptr sec, vm::ptr nsec); u64 sys_time_get_timebase_frequency(); +error_code sys_time_get_rtc(vm::ptr rtc); diff --git a/rpcs3/Emu/Cell/lv2/sys_uart.cpp b/rpcs3/Emu/Cell/lv2/sys_uart.cpp new file mode 100644 index 0000000000..5472836fb9 --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_uart.cpp @@ -0,0 +1,36 @@ +#include "stdafx.h" +#include "Emu/System.h" + +#include "Emu/Cell/ErrorCodes.h" + +#include "sys_uart.h" + +LOG_CHANNEL(sys_uart); + +error_code sys_uart_initialize() +{ + sys_uart.todo("sys_uart_initialize()"); + + return CELL_OK; +} + +error_code sys_uart_receive(vm::ptr buffer, u64 size, u32 unk) +{ + sys_uart.todo("sys_uart_receive(buffer=*0x%x, size=0x%llx, unk=0x%x)", buffer, size, unk); + + return CELL_OK; +} + +error_code sys_uart_send(vm::cptr buffer, u64 size, u64 flags) +{ + sys_uart.todo("sys_uart_send(buffer=0x%x, size=0x%llx, flags=0x%x)", buffer, size, flags); + + return CELL_OK; +} + +error_code sys_uart_get_params(vm::ptr buffer) +{ + sys_uart.todo("sys_uart_get_params(buffer=0x%x)", buffer); + + return CELL_OK; +} diff --git a/rpcs3/Emu/Cell/lv2/sys_uart.h b/rpcs3/Emu/Cell/lv2/sys_uart.h new file mode 100644 index 0000000000..4565876a0e --- /dev/null +++ b/rpcs3/Emu/Cell/lv2/sys_uart.h @@ -0,0 +1,10 @@ +#pragma once + +#include "Emu/Memory/vm_ptr.h" + +// SysCalls + +error_code sys_uart_initialize(); +error_code sys_uart_receive(vm::ptr buffer, u64 size, u32 unk); +error_code sys_uart_send(vm::cptr buffer, u64 size, u64 flags); +error_code sys_uart_get_params(vm::ptr buffer); diff --git a/rpcs3/emucore.vcxproj b/rpcs3/emucore.vcxproj index 19b80868c3..8638602a75 100644 --- a/rpcs3/emucore.vcxproj +++ b/rpcs3/emucore.vcxproj @@ -168,6 +168,16 @@ + + + + + + + + + + @@ -282,7 +292,7 @@ - + @@ -394,6 +404,7 @@ + @@ -497,6 +508,15 @@ + + + + + + + + + diff --git a/rpcs3/emucore.vcxproj.filters b/rpcs3/emucore.vcxproj.filters index d203f3f8ee..3f3646b59e 100644 --- a/rpcs3/emucore.vcxproj.filters +++ b/rpcs3/emucore.vcxproj.filters @@ -299,6 +299,33 @@ Emu\Cell\lv2 + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + Emu\Cell\Modules @@ -632,7 +659,7 @@ Emu\Cell\Modules - + Emu\Cell\Modules @@ -851,6 +878,12 @@ Emu\GPU\RSX\Overlays\Shaders + + Header Files + + + Emu\Cell\lv2 + @@ -1159,6 +1192,33 @@ Emu\Cell\lv2 + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + + + Emu\Cell\lv2 + Emu\Cell\Modules