- Improved sc function binder.

- Improved GLGSRender.
This commit is contained in:
DH 2013-06-30 11:46:29 +03:00
parent 3bb7a299ca
commit 5753edf6ef
133 changed files with 13624 additions and 3898 deletions

View file

@ -1,8 +1,8 @@
#include "stdafx.h"
#include "SysCalls.h"
#define FUNC_LOG_ERROR(x) ConLog.Warning(x); return 0
s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
#define FUNC_LOG_ERROR(x) ConLog.Error(x); return SC_ARGS_1
s64 SysCalls::DoFunc(const u32 id)
{
switch(id)
{
@ -309,7 +309,7 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0x3a33c1fd: FUNC_LOG_ERROR("TODO: _cellGcmFunc15");
case 0x3b9bd5bd: FUNC_LOG_ERROR("TODO: cellGcmUnreserveIoMapSize");
case 0x4524cccd: FUNC_LOG_ERROR("TODO: cellGcmBindTile");
case 0x4ae8d215: FUNC_LOG_ERROR("TODO: cellGcmSetFlipMode");
case 0x4ae8d215: return cellGcmSetFlipMode(SC_ARGS_1); //FUNC_LOG_ERROR("TODO: cellGcmSetFlipMode");
case 0x4d7ce993: FUNC_LOG_ERROR("TODO: cellGcmSetSecondVFrequency");
case 0x51c9d62b: FUNC_LOG_ERROR("TODO: cellGcmSetDebugOutputLevel");
case 0x527c6439: FUNC_LOG_ERROR("TODO: cellGcmTerminate");
@ -336,7 +336,7 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0x9a0159af: FUNC_LOG_ERROR("TODO: cellGcmGetReportDataAddress");
case 0x9ba451e4: FUNC_LOG_ERROR("TODO: cellGcmSetDefaultFifoSize");
case 0x9dc04436: FUNC_LOG_ERROR("TODO: cellGcmBindZcull");
case 0xa114ec67: FUNC_LOG_ERROR("TODO: cellGcmMapMainMemory");
case 0xa114ec67: return cellGcmMapMainMemory(SC_ARGS_3); //FUNC_LOG_ERROR("TODO: cellGcmMapMainMemory");
case 0xa41ef7e8: FUNC_LOG_ERROR("TODO: cellGcmSetFlipHandler");
case 0xa47c09ff: FUNC_LOG_ERROR("TODO: cellGcmSetFlipStatus");
case 0xa53d12ae: return cellGcmSetDisplayBuffer(SC_ARGS_5); //FUNC_LOG_ERROR("TODO: cellGcmSetDisplayBuffer");
@ -356,8 +356,8 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0xc8f3bd09: FUNC_LOG_ERROR("TODO: cellGcmGetCurrentField");
case 0xcaabd992: FUNC_LOG_ERROR("TODO: cellGcmInitDefaultFifoMode");
case 0xd01b570d: FUNC_LOG_ERROR("TODO: cellGcmSetGraphicsHandler");
case 0xd0b1d189: return cellGcmSetTile(SC_ARGS_8);//FUNC_LOG_ERROR("TODO: cellGcmSetTile");
case 0xd34a420d: FUNC_LOG_ERROR("TODO: cellGcmSetZcull");
case 0xd0b1d189: cellGcmSetTile(SC_ARGS_8); return SC_ARGS_1;//FUNC_LOG_ERROR("TODO: cellGcmSetTile");
case 0xd34a420d: ConLog.Error("TODO: cellGcmSetZcull"); return SC_ARGS_1;
case 0xd8f88e1a: FUNC_LOG_ERROR("TODO: _cellGcmSetFlipCommandWithWaitLabel");
case 0xd9a0a879: FUNC_LOG_ERROR("TODO: cellGcmGetZcullInfo");
case 0xd9b7653e: FUNC_LOG_ERROR("TODO: cellGcmUnbindTile");
@ -1410,19 +1410,19 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0xa193143c: FUNC_LOG_ERROR("TODO: cellSysmoduleSetMemcontainer");
case 0x018a1381: FUNC_LOG_ERROR("TODO: cellSysutilAvcSetLayoutMode");
case 0x01f04d94: FUNC_LOG_ERROR("TODO: cellSysutilGamePowerOff_I");
case 0x02ff3c1b: FUNC_LOG_ERROR("TODO: cellSysutilUnregisterCallback");
case 0x02ff3c1b: return cellSysutilUnregisterCallback(SC_ARGS_1); //FUNC_LOG_ERROR("TODO: cellSysutilUnregisterCallback");
case 0x073b89d5: FUNC_LOG_ERROR("TODO: cellSysutilAvcGetSpeakerVolumeLevel");
case 0x08269f37: FUNC_LOG_ERROR("TODO: cellSysutilAvcGetShowStatus");
case 0x0bae8772: FUNC_LOG_ERROR("TODO: cellVideoOutConfigure");
case 0x0bae8772: return cellVideoOutConfigure(SC_ARGS_4); //FUNC_LOG_ERROR("TODO: cellVideoOutConfigure");
case 0x0c316b87: FUNC_LOG_ERROR("TODO: cellWebBrowserConfigGetHeapSize2");
case 0x0e091c36: FUNC_LOG_ERROR("TODO: cellSaveDataUserListAutoSave");
case 0x0f03cfb0: FUNC_LOG_ERROR("TODO: cellSaveDataUserListSave");
case 0x0f8a3b6b: FUNC_LOG_ERROR("TODO: cellWebBrowserConfigSetMimeSet");
case 0x10cabeff: FUNC_LOG_ERROR("TODO: cellWebBrowserGetUsrdataOnGameExit");
case 0x15b0b0cd: FUNC_LOG_ERROR("TODO: cellVideoOutGetConfiguration");
case 0x15b0b0cd: return cellVideoOutGetConfiguration(SC_ARGS_3); //FUNC_LOG_ERROR("TODO: cellVideoOutGetConfiguration");
case 0x15df71ed: FUNC_LOG_ERROR("TODO: cellSysutilAvcLoadAsync");
case 0x17dbe8b3: FUNC_LOG_ERROR("TODO: cellSysutilAvcJoinRequest");
case 0x189a74da: return 0; //FUNC_LOG_ERROR("TODO: cellSysutilCheckCallback");
case 0x189a74da: return cellSysutilCheckCallback(); //FUNC_LOG_ERROR("TODO: cellSysutilCheckCallback");
case 0x1a91874b: FUNC_LOG_ERROR("TODO: cellWebBrowserConfigSetFullScreen2");
case 0x1d99c3ee: FUNC_LOG_ERROR("TODO: cellOskDialogGetInputText");
case 0x1dfbfdd6: FUNC_LOG_ERROR("TODO: cellSaveDataListLoad2");
@ -1484,8 +1484,8 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0x71acb8d3: FUNC_LOG_ERROR("TODO: cellSysutilAvcSetVideoMuting");
case 0x744c1544: FUNC_LOG_ERROR("TODO: cellSysCacheClear");
case 0x749c9b5f: FUNC_LOG_ERROR("TODO: cellWebBrowserInitialize");
case 0x75bbb672: FUNC_LOG_ERROR("TODO: cellVideoOutGetNumberOfDevice");
case 0x7603d3db: FUNC_LOG_ERROR("TODO: cellMsgDialogOpen2");
case 0x75bbb672: return cellVideoOutGetNumberOfDevice(SC_ARGS_1); //FUNC_LOG_ERROR("TODO: cellVideoOutGetNumberOfDevice");
case 0x7603d3db: return cellMsgDialogOpen2(SC_ARGS_5); //FUNC_LOG_ERROR("TODO: cellMsgDialogOpen2");
case 0x7663e368: FUNC_LOG_ERROR("TODO: cellAudioOutGetDeviceInfo");
case 0x76948bfc: FUNC_LOG_ERROR("TODO: cellSysconfAbort");
case 0x76fc8fb1: FUNC_LOG_ERROR("TODO: cellWebBrowserConfigSetHeapSize");
@ -1515,11 +1515,11 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0x9c9fe6a4: FUNC_LOG_ERROR("TODO: cellWebBrowserConfigSetFunction");
case 0x9ca9ffa7: FUNC_LOG_ERROR("TODO: cellHddGameSetSystemVer");
case 0x9d6af72a: FUNC_LOG_ERROR("TODO: cellMsgDialogProgressBarSetMsg");
case 0x9d98afa0: FUNC_LOG_ERROR("TODO: cellSysutilRegisterCallback");
case 0x9d98afa0: return cellSysutilRegisterCallback(SC_ARGS_3); //FUNC_LOG_ERROR("TODO: cellSysutilRegisterCallback");
case 0x9dfdad46: FUNC_LOG_ERROR("TODO: cellAudioOutUnregisterCallback");
case 0x9fb97b10: FUNC_LOG_ERROR("TODO: cellWebBrowserNavigate2");
case 0xa11552f6: FUNC_LOG_ERROR("TODO: cellSysutilGetBgmPlaybackStatus");
case 0xa322db75: FUNC_LOG_ERROR("TODO: cellVideoOutGetResolutionAvailability");
case 0xa322db75: return cellVideoOutGetResolutionAvailability(SC_ARGS_4); //FUNC_LOG_ERROR("TODO: cellVideoOutGetResolutionAvailability");
case 0xa36335a5: FUNC_LOG_ERROR("TODO: cellSysutilDisableBgmPlaybackEx");
case 0xa4dd11cc: FUNC_LOG_ERROR("TODO: cellWebBrowserConfigGetHeapSize");
case 0xa4ed7dfe: FUNC_LOG_ERROR("TODO: cellSaveDataDelete");
@ -3563,14 +3563,14 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0x05c65656: FUNC_LOG_ERROR("TODO: sys_mempool_try_allocate_block");
case 0x0618936b: FUNC_LOG_ERROR("TODO: _sys_vsnprintf");
case 0x06574237: FUNC_LOG_ERROR("TODO: _sys_snprintf");
case 0x1573dc3f: return Lv2LwmutexLock(CPU);//FUNC_LOG_ERROR("TODO: sys_lwmutex_lock");
case 0x1573dc3f: return sys_lwmutex_lock(SC_ARGS_2);//FUNC_LOG_ERROR("TODO: sys_lwmutex_lock");
case 0x191f0c4a: FUNC_LOG_ERROR("TODO: _sys_strrchr");
case 0x1ae10b92: FUNC_LOG_ERROR("TODO: _sys_spu_printf_attach_thread");
case 0x1bc200f4: return Lv2LwmutexUnlock(CPU);//FUNC_LOG_ERROR("TODO: sys_lwmutex_unlock");
case 0x1bc200f4: return sys_lwmutex_unlock(SC_ARGS_1);//FUNC_LOG_ERROR("TODO: sys_lwmutex_unlock");
case 0x1c9a942c: FUNC_LOG_ERROR("TODO: sys_lwcond_destroy");
case 0x1ca525a2: FUNC_LOG_ERROR("TODO: _sys_strncasecmp");
case 0x1ed454ce: FUNC_LOG_ERROR("TODO: sys_spu_elf_get_information");
case 0x24a1ea07: return lv2PPUThreadCreate(CPU);//FUNC_LOG_ERROR("TODO: sys_ppu_thread_create");
case 0x24a1ea07: return sys_ppu_thread_create(SC_ARGS_7);//FUNC_LOG_ERROR("TODO: sys_ppu_thread_create");
case 0x25596f51: FUNC_LOG_ERROR("TODO: sys_mempool_get_count");
case 0x26090058: FUNC_LOG_ERROR("TODO: sys_prx_load_module");
case 0x27427742: FUNC_LOG_ERROR("TODO: _sys_memmove");
@ -3578,12 +3578,12 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0x2c847572: FUNC_LOG_ERROR("TODO: _sys_process_atexitspawn");
case 0x2d36462b:
//FUNC_LOG_ERROR("TODO: _sys_strlen");
ConLog.Write("sys_strlen(addr=0x%x)", SC_ARGS_1);
return Memory.ReadString(SC_ARGS_1).Len();
case 0x2f85c0ef: return Lv2LwmutexCreate(CPU);//FUNC_LOG_ERROR("TODO: sys_lwmutex_create");
ConLog.Write("sys_strlen(addr=0x%x(%s))", SC_ARGS_1, Memory.ReadString(SC_ARGS_1));
return strlen((const char*)&Memory[SC_ARGS_1]);
case 0x2f85c0ef: return sys_lwmutex_create(SC_ARGS_2);//FUNC_LOG_ERROR("TODO: sys_lwmutex_create");
case 0x3172759d: FUNC_LOG_ERROR("TODO: sys_game_get_temperature");
case 0x318f17e1: FUNC_LOG_ERROR("TODO: _sys_memalign");
case 0x350d454e: return lv2PPUThreadGetId(CPU);//FUNC_LOG_ERROR("TODO: sys_ppu_thread_get_id");
case 0x350d454e: return sys_ppu_thread_get_id();//FUNC_LOG_ERROR("TODO: sys_ppu_thread_get_id");
case 0x35168520: return sys_heap_malloc(SC_ARGS_2); //FUNC_LOG_ERROR("TODO: _sys_heap_malloc");
case 0x3bd53c7b: FUNC_LOG_ERROR("TODO: _sys_memchr");
case 0x3dd4a957: FUNC_LOG_ERROR("TODO: sys_ppu_thread_register_atexit");
@ -3617,13 +3617,13 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0x744680a2:
// FUNC_LOG_ERROR("TODO: sys_initialize_tls");
ConLog.Warning("sys_initialize_tls()");
CPU.GPR[4] = Emu.GetTLSFilesz();
CPU.GPR[5] = Emu.GetTLSMemsz();
return Emu.GetTLSAddr();
//CPU.GPR[4] = Emu.GetTLSFilesz();
//CPU.GPR[5] = Emu.GetTLSMemsz();
return 0;//Memory.MainMem.Alloc(Emu.GetTLSMemsz());//Emu.GetTLSAddr();
case 0x7498887b: FUNC_LOG_ERROR("TODO: _sys_strchr");
case 0x791b9219: FUNC_LOG_ERROR("TODO: _sys_vsprintf");
case 0x80fb0c19: FUNC_LOG_ERROR("TODO: sys_prx_stop_module");
case 0x8461e528: return DoSyscall(146, CPU);//FUNC_LOG_ERROR("TODO: sys_time_get_system_time");
case 0x8461e528: return sys_time_get_system_time();//FUNC_LOG_ERROR("TODO: sys_time_get_system_time");
case 0x84bb6774: FUNC_LOG_ERROR("TODO: sys_prx_get_module_info");
case 0x893305fa: FUNC_LOG_ERROR("TODO: sys_raw_spu_load");
case 0x8985b5b6: FUNC_LOG_ERROR("TODO: _sys_heap_stats");
@ -3652,10 +3652,10 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0xaa6d9bff: FUNC_LOG_ERROR("TODO: sys_prx_load_module_on_memcontainer");
case 0xac6fc404: FUNC_LOG_ERROR("TODO: sys_ppu_thread_unregister_atexit");
case 0xacad8fb6: FUNC_LOG_ERROR("TODO: sys_game_watchdog_clear");
case 0xaeb78725: return Lv2LwmutexTrylock(CPU);//FUNC_LOG_ERROR("TODO: sys_lwmutex_trylock");
case 0xaeb78725: return sys_lwmutex_trylock(SC_ARGS_1);//FUNC_LOG_ERROR("TODO: sys_lwmutex_trylock");
case 0xaede4b03: FUNC_LOG_ERROR("TODO: _sys_heap_delete_heap");
case 0xaff080a4: return lv2PPUThreadExit(CPU);//FUNC_LOG_ERROR("TODO: sys_ppu_thread_exit");
case 0xb257540b: FUNC_LOG_ERROR("TODO: sys_mmapper_allocate_memory");
case 0xaff080a4: return sys_ppu_thread_exit(SC_ARGS_1);//FUNC_LOG_ERROR("TODO: sys_ppu_thread_exit");
case 0xb257540b: return sys_mmapper_allocate_memory(SC_ARGS_3); //FUNC_LOG_ERROR("TODO: sys_mmapper_allocate_memory");
case 0xb27c8ae7: FUNC_LOG_ERROR("TODO: sys_prx_load_module_list");
case 0xb2fcf2c8: return sys_heap_create_heap(SC_ARGS_3);//FUNC_LOG_ERROR("TODO: _sys_heap_create_heap");
case 0xb3bbcf2a: FUNC_LOG_ERROR("TODO: _sys_spu_printf_detach_thread");
@ -3666,7 +3666,7 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
ConLog.Warning("_sys_malloc(0x%llx)", SC_ARGS_1);
return Memory.Alloc(CPU.GPR[3], Emu.GetMallocPageSize());
FUNC_LOG_ERROR("TODO: _sys_malloc");
case 0xc3476d0c: return Lv2LwmutexDestroy(CPU);////FUNC_LOG_ERROR("TODO: sys_lwmutex_destroy");
case 0xc3476d0c: return sys_lwmutex_destroy(SC_ARGS_1);////FUNC_LOG_ERROR("TODO: sys_lwmutex_destroy");
case 0xc4fd6121: FUNC_LOG_ERROR("TODO: _sys_qsort");
case 0xca9a60bf: FUNC_LOG_ERROR("TODO: sys_mempool_create");
case 0xd0ea47a7: FUNC_LOG_ERROR("TODO: sys_prx_unregister_library");
@ -3674,13 +3674,13 @@ s64 SysCalls::DoFunc(const u32 id, PPUThread& CPU)
case 0xd3039d4d: FUNC_LOG_ERROR("TODO: _sys_strncpy");
case 0xda0eb71a: FUNC_LOG_ERROR("TODO: sys_lwcond_create");
case 0xdb6b3250: FUNC_LOG_ERROR("TODO: sys_spu_elf_get_segments");
case 0xdc578057: FUNC_LOG_ERROR("TODO: sys_mmapper_map_memory");
case 0xdc578057: return sys_mmapper_map_memory(SC_ARGS_3); //FUNC_LOG_ERROR("TODO: sys_mmapper_map_memory");
case 0xdd0c1e09: FUNC_LOG_ERROR("TODO: _sys_spu_printf_attach_group");
case 0xdd3b27ac: FUNC_LOG_ERROR("TODO: _sys_spu_printf_finalize");
case 0xe0998dbf: FUNC_LOG_ERROR("TODO: sys_prx_get_module_id_by_name");
case 0xe0da8efd: FUNC_LOG_ERROR("TODO: sys_spu_image_close");
case 0xe66bac36: FUNC_LOG_ERROR("TODO: console_putc");
case 0xe6f2c1e7: return lv2ProcessExit(CPU);///FUNC_LOG_ERROR("TODO: sys_process_exit");
case 0xe6f2c1e7: return sys_process_exit(SC_ARGS_1);///FUNC_LOG_ERROR("TODO: sys_process_exit");
case 0xe76964f5: FUNC_LOG_ERROR("TODO: sys_game_board_storage_read");
case 0xe7ef3a80: FUNC_LOG_ERROR("TODO: sys_prx_load_module_list_on_memcontainer");
case 0xe9a1bd84: FUNC_LOG_ERROR("TODO: sys_lwcond_signal_all");