feat: added new empty stubs (#47)

This commit is contained in:
Ranieri
2026-02-06 01:39:52 -03:00
committed by GitHub
parent df745d7ee9
commit 5e4361a1c6
3 changed files with 2744 additions and 89 deletions
+505 -89
View File
@@ -20,6 +20,8 @@
X(SleepThread) \
X(WakeupThread) \
X(iWakeupThread) \
X(CancelWakeupThread) \
X(iCancelWakeupThread) \
X(ChangeThreadPriority) \
X(RotateThreadReadyQueue) \
X(ReleaseWaitThread) \
@@ -99,92 +101,506 @@
X(RegisterExitHandler)
// Stubs
#define PS2_STUB_LIST(X) \
X(malloc) \
X(free) \
X(calloc) \
X(realloc) \
X(memcpy) \
X(memset) \
X(memmove) \
X(memcmp) \
\
X(strcpy) \
X(strncpy) \
X(strlen) \
X(strcmp) \
X(strncmp) \
X(strcat) \
X(strncat) \
X(strchr) \
X(strrchr) \
X(strstr) \
\
X(printf) \
X(sprintf) \
X(snprintf) \
X(puts) \
X(fopen) \
X(fclose) \
X(fread) \
X(fwrite) \
X(fprintf) \
X(fseek) \
X(ftell) \
X(fflush) \
\
X(sqrt) \
X(sin) \
X(cos) \
X(tan) \
X(atan2) \
X(pow) \
X(exp) \
X(log) \
X(log10) \
X(ceil) \
X(floor) \
X(fabs) \
X(sceCdRead) \
X(sceCdSync) \
X(sceCdGetError) \
X(njSetBorderColor) \
X(njSetTextureMemorySize) \
X(njInitVertexBuffer) \
X(njTextureShadingMode) \
X(njInitView) \
X(njSetAspect) \
X(njInitSystem) \
X(njInitPrint) \
X(njPolygonCullingMode) \
X(njSetView) \
X(njGetMatrix) \
X(njInitTexture) \
X(njInitTextureBuffer) \
X(njSetPaletteMode) \
X(njClipZ) \
X(syRtcInit) \
X(_builtin_set_imask) \
X(syFree) \
X(InitSdcParameter) \
X(Ps2_pad_actuater) \
X(syMallocInit) \
X(syHwInit) \
X(syHwInit2) \
X(InitGdSystemEx) \
X(pdInitPeripheral) \
X(njSetVertexBuffer) \
X(njPrintSize) \
X(pdGetPeripheral) \
X(Ps2SwapDBuff) \
X(InitReadKeyEx) \
X(SetRepeatKeyTimer) \
X(StopFxProgram) \
X(sdSndStopAll) \
X(sdSysFinish) \
X(ADXT_Init) \
X(ADXT_SetNumRetry) \
X(cvFsSetDefDev) \
X(sndr_trans_func) \
X(sdDrvInit) \
X(ADXF_LoadPartitionNw)
#define PS2_STUB_LIST(X) \
/* Std/Libc */ \
X(_calloc_r) \
X(_free_r) \
X(_malloc_r) \
X(_malloc_trim_r) \
X(_mbtowc_r) \
X(_printf) \
X(_printf_r) \
X(abs) \
X(atan) \
X(atan2) \
X(calloc) \
X(ceil) \
X(close) \
X(cos) \
X(exit) \
X(exp) \
X(fabs) \
X(fclose) \
X(fflush) \
X(floor) \
X(fopen) \
X(fprintf) \
X(fread) \
X(free) \
X(fseek) \
X(fstat) \
X(ftell) \
X(fwrite) \
X(getpid) \
X(log) \
X(log10) \
X(lseek) \
X(malloc) \
X(memchr) \
X(memcmp) \
X(memcpy) \
X(memmove) \
X(memset) \
X(open) \
X(pow) \
X(printf) \
X(puts) \
X(rand) \
X(read) \
X(realloc) \
X(sin) \
X(snprintf) \
X(sprintf) \
X(sqrt) \
X(srand) \
X(stat) \
X(strcasecmp) \
X(strcat) \
X(strchr) \
X(strcmp) \
X(strcpy) \
X(strlen) \
X(strncat) \
X(strncmp) \
X(strncpy) \
X(strrchr) \
X(strstr) \
X(tan) \
X(vfprintf) \
X(vsprintf) \
X(write) \
/* PS2 native */ \
X(DmaAddr) \
X(Pad_init) \
X(Pad_set) \
X(_builtin_set_imask) \
X(_sceCdRI) \
X(_sceCdRM) \
X(_sceFsDbChk) \
X(_sceFsIntrSigSema) \
X(_sceFsSemExit) \
X(_sceFsSemInit) \
X(_sceFsSigSema) \
X(_sceIDC) \
X(_sceMpegFlush) \
X(_sceRpcFreePacket) \
X(_sceRpcGetFPacket) \
X(_sceRpcGetFPacket2) \
X(_sceSDC) \
X(_sceSifCmdIntrHdlr) \
X(_sceSifLoadElfPart) \
X(_sceSifLoadModule) \
X(_sceSifSendCmd) \
X(_sceVu0ecossin) \
X(iopGetArea) \
X(mcCallMessageTypeSe) \
X(mcCheckReadStartConfigFile) \
X(mcCheckReadStartSaveFile) \
X(mcCheckWriteStartConfigFile) \
X(mcCheckWriteStartSaveFile) \
X(mcCreateConfigInit) \
X(mcCreateFileSelectWindow) \
X(mcCreateIconInit) \
X(mcCreateSaveFileInit) \
X(mcDispFileName) \
X(mcDispFileNumber) \
X(mcDispWindowCurSol) \
X(mcDispWindowFoundtion) \
X(mcDisplayFileSelectWindow) \
X(mcDisplaySelectFileInfo) \
X(mcDisplaySelectFileInfoMesCount) \
X(mcGetConfigCapacitySize) \
X(mcGetFileSelectWindowCursol) \
X(mcGetFreeCapacitySize) \
X(mcGetIconCapacitySize) \
X(mcGetIconFileCapacitySize) \
X(mcGetPortSelectDirInfo) \
X(mcGetSaveFileCapacitySize) \
X(mcGetStringEnd) \
X(mcMoveFileSelectWindowCursor) \
X(mcNewCreateConfigFile) \
X(mcNewCreateIcon) \
X(mcNewCreateSaveFile) \
X(mcReadIconData) \
X(mcReadStartConfigFile) \
X(mcReadStartSaveFile) \
X(mcSelectFileInfoInit) \
X(mcSelectSaveFileCheck) \
X(mcSetFileSelectWindowCursol) \
X(mcSetFileSelectWindowCursolInit) \
X(mcSetStringSaveFile) \
X(mcSetTyepWriteMode) \
X(mcWriteIconData) \
X(mcWriteStartConfigFile) \
X(mcWriteStartSaveFile) \
X(mceGetInfoApdx) \
X(mceIntrReadFixAlign) \
X(mceStorePwd) \
X(pdGetPeripheral) \
X(pdInitPeripheral) \
X(sceCdApplyNCmd) \
X(sceCdBreak) \
X(sceCdCallback) \
X(sceCdChangeThreadPriority) \
X(sceCdDelayThread) \
X(sceCdDiskReady) \
X(sceCdGetDiskType) \
X(sceCdGetError) \
X(sceCdGetReadPos) \
X(sceCdGetToc) \
X(sceCdInit) \
X(sceCdInitEeCB) \
X(sceCdIntToPos) \
X(sceCdMmode) \
X(sceCdNcmdDiskReady) \
X(sceCdPause) \
X(sceCdPosToInt) \
X(sceCdRead) \
X(sceCdReadChain) \
X(sceCdReadClock) \
X(sceCdReadIOPm) \
X(sceCdSearchFile) \
X(sceCdSeek) \
X(sceCdStInit) \
X(sceCdStPause) \
X(sceCdStRead) \
X(sceCdStResume) \
X(sceCdStSeek) \
X(sceCdStSeekF) \
X(sceCdStStart) \
X(sceCdStStat) \
X(sceCdStStop) \
X(sceCdStandby) \
X(sceCdStatus) \
X(sceCdStop) \
X(sceCdStream) \
X(sceCdSync) \
X(sceCdSyncS) \
X(sceCdTrayReq) \
X(sceClose) \
X(sceDeci2Close) \
X(sceDeci2ExLock) \
X(sceDeci2ExRecv) \
X(sceDeci2ExReqSend) \
X(sceDeci2ExSend) \
X(sceDeci2ExUnLock) \
X(sceDeci2Open) \
X(sceDeci2Poll) \
X(sceDeci2ReqSend) \
X(sceDmaCallback) \
X(sceDmaDebug) \
X(sceDmaGetChan) \
X(sceDmaGetEnv) \
X(sceDmaLastSyncTime) \
X(sceDmaPause) \
X(sceDmaPutEnv) \
X(sceDmaPutStallAddr) \
X(sceDmaRecv) \
X(sceDmaRecvI) \
X(sceDmaRecvN) \
X(sceDmaReset) \
X(sceDmaRestart) \
X(sceDmaSend) \
X(sceDmaSendI) \
X(sceDmaSendM) \
X(sceDmaSendN) \
X(sceDmaSync) \
X(sceDmaSyncN) \
X(sceDmaWatch) \
X(sceFsInit) \
X(sceFsReset) \
X(sceGsExecLoadImage) \
X(sceGsExecStoreImage) \
X(sceGsGetGParam) \
X(sceGsPutDispEnv) \
X(sceGsPutDrawEnv) \
X(sceGsResetGraph) \
X(sceGsResetPath) \
X(sceGsSetDefClear) \
X(sceGsSetDefDBuffDc) \
X(sceGsSetDefDispEnv) \
X(sceGsSetDefDrawEnv) \
X(sceGsSetDefDrawEnv2) \
X(sceGsSetDefLoadImage) \
X(sceGsSetDefStoreImage) \
X(sceGsSwapDBuffDc) \
X(sceGsSyncPath) \
X(sceGsSyncV) \
X(sceGsSyncVCallback) \
X(sceGszbufaddr) \
X(sceIoctl) \
X(sceIpuInit) \
X(sceIpuRestartDMA) \
X(sceIpuStopDMA) \
X(sceIpuSync) \
X(sceLseek) \
X(sceMcChangeThreadPriority) \
X(sceMcChdir) \
X(sceMcClose) \
X(sceMcDelete) \
X(sceMcFlush) \
X(sceMcFormat) \
X(sceMcGetDir) \
X(sceMcGetEntSpace) \
X(sceMcGetInfo) \
X(sceMcGetSlotMax) \
X(sceMcInit) \
X(sceMcMkdir) \
X(sceMcOpen) \
X(sceMcRead) \
X(sceMcRename) \
X(sceMcSeek) \
X(sceMcSetFileInfo) \
X(sceMcSync) \
X(sceMcUnformat) \
X(sceMcWrite) \
X(sceMpegAddBs) \
X(sceMpegAddCallback) \
X(sceMpegAddStrCallback) \
X(sceMpegClearRefBuff) \
X(sceMpegCreate) \
X(sceMpegDelete) \
X(sceMpegDemuxPss) \
X(sceMpegDemuxPssRing) \
X(sceMpegDispCenterOffX) \
X(sceMpegDispCenterOffY) \
X(sceMpegDispHeight) \
X(sceMpegDispWidth) \
X(sceMpegGetDecodeMode) \
X(sceMpegGetPicture) \
X(sceMpegGetPictureRAW8) \
X(sceMpegGetPictureRAW8xy) \
X(sceMpegInit) \
X(sceMpegIsEnd) \
X(sceMpegIsRefBuffEmpty) \
X(sceMpegReset) \
X(sceMpegResetDefaultPtsGap) \
X(sceMpegSetDecodeMode) \
X(sceMpegSetDefaultPtsGap) \
X(sceMpegSetImageBuff) \
X(sceOpen) \
X(scePadEnd) \
X(scePadEnterPressMode) \
X(scePadExitPressMode) \
X(scePadGetButtonMask) \
X(scePadGetDmaStr) \
X(scePadGetFrameCount) \
X(scePadGetModVersion) \
X(scePadGetPortMax) \
X(scePadGetReqState) \
X(scePadGetSlotMax) \
X(scePadGetState) \
X(scePadInfoAct) \
X(scePadInfoComb) \
X(scePadInfoMode) \
X(scePadInfoPressMode) \
X(scePadInit) \
X(scePadInit2) \
X(scePadPortClose) \
X(scePadPortOpen) \
X(scePadRead) \
X(scePadReqIntToStr) \
X(scePadSetActAlign) \
X(scePadSetActDirect) \
X(scePadSetButtonInfo) \
X(scePadSetMainMode) \
X(scePadSetReqState) \
X(scePadSetVrefParam) \
X(scePadSetWarningLevel) \
X(scePadStateIntToStr) \
X(scePrintf) \
X(sceRead) \
X(sceResetttyinit) \
X(sceSSyn_BreakAtick) \
X(sceSSyn_ClearBreakAtick) \
X(sceSSyn_SendExcMsg) \
X(sceSSyn_SendNrpnMsg) \
X(sceSSyn_SendRpnMsg) \
X(sceSSyn_SendShortMsg) \
X(sceSSyn_SetChPriority) \
X(sceSSyn_SetMasterVolume) \
X(sceSSyn_SetOutPortVolume) \
X(sceSSyn_SetOutputAssign) \
X(sceSSyn_SetOutputMode) \
X(sceSSyn_SetPortMaxPoly) \
X(sceSSyn_SetPortVolume) \
X(sceSSyn_SetTvaEnvMode) \
X(sceSdCallBack) \
X(sceSdRemote) \
X(sceSdRemoteInit) \
X(sceSdTransToIOP) \
X(sceSetBrokenLink) \
X(sceSetPtm) \
X(sceSifAddCmdHandler) \
X(sceSifAllocIopHeap) \
X(sceSifBindRpc) \
X(sceSifCheckStatRpc) \
X(sceSifDmaStat) \
X(sceSifExecRequest) \
X(sceSifExitCmd) \
X(sceSifExitRpc) \
X(sceSifFreeIopHeap) \
X(sceSifGetDataTable) \
X(sceSifGetIopAddr) \
X(sceSifGetNextRequest) \
X(sceSifGetOtherData) \
X(sceSifGetReg) \
X(sceSifGetSreg) \
X(sceSifInitCmd) \
X(sceSifInitIopHeap) \
X(sceSifInitRpc) \
X(sceSifIsAliveIop) \
X(sceSifLoadElf) \
X(sceSifLoadElfPart) \
X(sceSifLoadFileReset) \
X(sceSifLoadIopHeap) \
X(sceSifLoadModuleBuffer) \
X(sceSifRebootIop) \
X(sceSifRegisterRpc) \
X(sceSifRemoveCmdHandler) \
X(sceSifRemoveRpc) \
X(sceSifRemoveRpcQueue) \
X(sceSifResetIop) \
X(sceSifRpcLoop) \
X(sceSifSetCmdBuffer) \
X(sceSifSetDChain) \
X(sceSifSetDma) \
X(sceSifSetIopAddr) \
X(sceSifSetReg) \
X(sceSifSetRpcQueue) \
X(sceSifSetSreg) \
X(sceSifSetSysCmdBuffer) \
X(sceSifStopDma) \
X(sceSifSyncIop) \
X(sceSifWriteBackDCache) \
X(sceSynthSizerLfoTriangle) \
X(sceSynthesizerAmpProcI) \
X(sceSynthesizerAmpProcNI) \
X(sceSynthesizerAssignAllNoteOff) \
X(sceSynthesizerAssignAllSoundOff) \
X(sceSynthesizerAssignHoldChange) \
X(sceSynthesizerAssignNoteOff) \
X(sceSynthesizerAssignNoteOn) \
X(sceSynthesizerCalcEnv) \
X(sceSynthesizerCalcPortamentPitch) \
X(sceSynthesizerCalcTvfCoefAll) \
X(sceSynthesizerCalcTvfCoefF0) \
X(sceSynthesizerCent2PhaseInc) \
X(sceSynthesizerChangeEffectSend) \
X(sceSynthesizerChangeHsPanpot) \
X(sceSynthesizerChangeNrpnCutOff) \
X(sceSynthesizerChangeNrpnLfoDepth) \
X(sceSynthesizerChangeNrpnLfoRate) \
X(sceSynthesizerChangeOutAttrib) \
X(sceSynthesizerChangeOutVol) \
X(sceSynthesizerChangePanpot) \
X(sceSynthesizerChangePartBendSens) \
X(sceSynthesizerChangePartExpression) \
X(sceSynthesizerChangePartHsExpression) \
X(sceSynthesizerChangePartHsPitchBend) \
X(sceSynthesizerChangePartModuration) \
X(sceSynthesizerChangePartPitchBend) \
X(sceSynthesizerChangePartVolume) \
X(sceSynthesizerChangePortamento) \
X(sceSynthesizerChangePortamentoTime) \
X(sceSynthesizerClearKeyMap) \
X(sceSynthesizerClearSpr) \
X(sceSynthesizerCopyOutput) \
X(sceSynthesizerDmaFromSPR) \
X(sceSynthesizerDmaSpr) \
X(sceSynthesizerDmaToSPR) \
X(sceSynthesizerGetPartOutLevel) \
X(sceSynthesizerGetPartial) \
X(sceSynthesizerGetSampleParam) \
X(sceSynthesizerHsMessage) \
X(sceSynthesizerLfoNone) \
X(sceSynthesizerLfoProc) \
X(sceSynthesizerLfoSawDown) \
X(sceSynthesizerLfoSawUp) \
X(sceSynthesizerLfoSquare) \
X(sceSynthesizerReadNoise) \
X(sceSynthesizerReadNoiseAdd) \
X(sceSynthesizerReadSample16) \
X(sceSynthesizerReadSample16Add) \
X(sceSynthesizerReadSample8) \
X(sceSynthesizerReadSample8Add) \
X(sceSynthesizerResetPart) \
X(sceSynthesizerRestorDma) \
X(sceSynthesizerSelectPatch) \
X(sceSynthesizerSendShortMessage) \
X(sceSynthesizerSetMasterVolume) \
X(sceSynthesizerSetRVoice) \
X(sceSynthesizerSetupDma) \
X(sceSynthesizerSetupLfo) \
X(sceSynthesizerSetupMidiModuration) \
X(sceSynthesizerSetupMidiPanpot) \
X(sceSynthesizerSetupNewNoise) \
X(sceSynthesizerSetupReleaseEnv) \
X(sceSynthesizerSetupTruncateTvaEnv) \
X(sceSynthesizerSetupTruncateTvfPitchEnv) \
X(sceSynthesizerSetuptEnv) \
X(sceSynthesizerTonegenerator) \
X(sceSynthesizerTransposeMatrix) \
X(sceSynthesizerTvfProcI) \
X(sceSynthesizerTvfProcNI) \
X(sceSynthesizerWaitDmaFromSPR) \
X(sceSynthesizerWaitDmaToSPR) \
X(sceSynthsizerGetDrumPatch) \
X(sceSynthsizerGetMeloPatch) \
X(sceSynthsizerLfoNoise) \
X(sceTtyHandler) \
X(sceTtyInit) \
X(sceTtyRead) \
X(sceTtyWrite) \
X(sceVpu0Reset) \
X(sceVu0AddVector) \
X(sceVu0ApplyMatrix) \
X(sceVu0CameraMatrix) \
X(sceVu0ClampVector) \
X(sceVu0ClipAll) \
X(sceVu0ClipScreen) \
X(sceVu0ClipScreen3) \
X(sceVu0CopyMatrix) \
X(sceVu0CopyVector) \
X(sceVu0CopyVectorXYZ) \
X(sceVu0DivVector) \
X(sceVu0DivVectorXYZ) \
X(sceVu0DropShadowMatrix) \
X(sceVu0FTOI0Vector) \
X(sceVu0FTOI4Vector) \
X(sceVu0ITOF0Vector) \
X(sceVu0ITOF12Vector) \
X(sceVu0ITOF4Vector) \
X(sceVu0InnerProduct) \
X(sceVu0InterVector) \
X(sceVu0InterVectorXYZ) \
X(sceVu0InversMatrix) \
X(sceVu0LightColorMatrix) \
X(sceVu0MulMatrix) \
X(sceVu0MulVector) \
X(sceVu0NormalLightMatrix) \
X(sceVu0Normalize) \
X(sceVu0OuterProduct) \
X(sceVu0RotMatrix) \
X(sceVu0RotMatrixX) \
X(sceVu0RotMatrixY) \
X(sceVu0RotMatrixZ) \
X(sceVu0RotTransPers) \
X(sceVu0RotTransPersN) \
X(sceVu0ScaleVector) \
X(sceVu0ScaleVectorXYZ) \
X(sceVu0SubVector) \
X(sceVu0TransMatrix) \
X(sceVu0TransposeMatrix) \
X(sceVu0UnitMatrix) \
X(sceVu0ViewScreenMatrix) \
X(sceWrite) \
X(sdDrvInit) \
X(sdSndStopAll) \
X(sdSysFinish) \
X(syFree) \
X(syHwInit) \
X(syHwInit2) \
X(syMallocInit) \
X(syRtcInit) \
/* Game/middleware */ \
File diff suppressed because it is too large Load Diff
+22
View File
@@ -365,6 +365,28 @@ namespace ps2_syscalls
setReturnS32(ctx, 0);
}
void CancelWakeupThread(uint8_t *rdram, R5900Context *ctx, PS2Runtime *runtime)
{
static int logCount = 0;
if (logCount < 32)
{
std::cout << "[CancelWakeupThread]" << std::endl;
++logCount;
}
setReturnS32(ctx, 0);
}
void iCancelWakeupThread(uint8_t *rdram, R5900Context *ctx, PS2Runtime *runtime)
{
static int logCount = 0;
if (logCount < 32)
{
std::cout << "[iCancelWakeupThread]" << std::endl;
++logCount;
}
setReturnS32(ctx, 0);
}
void ChangeThreadPriority(uint8_t *rdram, R5900Context *ctx, PS2Runtime *runtime)
{
int tid = static_cast<int>(getRegU32(ctx, 4));