User talk:Kozarovv: Difference between revisions

From PS4 Developer wiki
Jump to navigation Jump to search
 
(29 intermediate revisions by 4 users not shown)
Line 3: Line 3:
==psfour2pstwo==
==psfour2pstwo==


====gs====
====vu0====
 
For JAK emu. Todo: Exec from VIF0 seems to always run program for 0x7FFFFFFF cycles...
* --gs-kernel-cl="DarkCloud2"
void __fastcall Vu0MicroExec()
* --gs-kernel-cl="fantavision"
{
 
  run_vu0(vu0_functions_ptr, 256LL, 0LL);
Special case kernel plugins?
                                                // run vu for 256 cycles.
 
                                                // This kill whole sync idea. We have 256 cycles run already on first run.
====possible speed/comp hacks====
                                                // Games like SST/ARR/TM:HEAD-ON are alredy broken before we even started.
 
* --detect-idle-vif
  if (is_vu0_running())                        // if still running (no ebit, no mbit)
* --detect-idle-ee
  {
* --detect-idle-iop
    v0 = ee_sched_stru;
* --detect-idle-intc
    v1 = 0LL;
* --detect-idle-chcr
    v2 = *(ee_core_regs_base + 0x378) - *(ee_core_regs_base + 0x370) + 512LL;
 
                                                // passed cycles + 512
====Sound - SPU2 behavior====
                                                // terrible idea, we are falling behind ee here.
 
                                                // There is usually no point to run behind ee if we failed to do this at start.
* --spu2-update-deferral
                                                // This break games like Ratchet/Rayman.
* --spu2-reverb
    sched_Vu0MicroExec.delta = v2;
* --spu2-c0-memin-to-bgm
    if ( ee_sched_stru )
* --spu2-c1-memin-to-bgm
    {
* --spu2Trace
      while ( 1 )
 
      {
 
        v3 = v0;
==PSPHD==
        if ( v0[2] >= v2 )                     // if delta from scheduler higher than from v0
 
          break;
===LUA===
        v0 = *v0;
 
        v1 = v3;
====basic====
        if ( !*v3 )                            // schedule next run...
 
*axInsnReplace (mem, org opcode, new opcode) - Replace allegrex memory
*axFuncReplace - Replace allegrex function
 
 
====hooks/registers====
 
Allegrex (usage - remove AX_):
 
*AX_GetPC
*AX_SetPC
*AX_GetHi
*AX_SetHi
*AX_GetLo
*AX_SetLo
*AX_GetReg
*AX_SetReg
*AX_GetFpr
*AX_SetFpr
*AX_ReadMem8
*AX_ReadMem16
*AX_ReadMem32
*AX_ReadMemFloat
*AX_ReadMemString
*AX_WriteMem8
*AX_WriteMem16
*AX_WriteMem32
*AX_WriteMemFloat
*AX_WriteMemString
*AX_WriteMemStringZ
*AX_AddHook
*AX_RemoveHook
*AX_Overlay
*AX_InsnReplace
*AX_FuncReplace


Media Engine usage - remove EM_:
====todo====


*EM_SetTextureHashMode
seems to be like internal threads, not real threads. Emu print with that.
*EM_SetTextureScaleOffset
<pre>_____________________________________________________________________________
*EM_SetTextureSaveSubdir
| Emotion Engine:      | Input Output Processor (iop)  | x Extra?          |
*EM_SetSampleTitle
|-----------------------|-------------------------------|-------------------|
*EM_SetDrawEDRam
| e-dbg                | i-fw                          | x-stdlib          |
*EM_ToggleTextures
| e-r59                | i-debug                      | x-emu            |
*EM_PadRead
| e-mem                | i-cdvd                        | x-lpnr            |
*EM_PadReadPitch
| e-dmac                | i-dmac                        | x-cdvd            |
*EM_PadReadRoll
| e-timer              | i-gmif                        | x-isofs          |
*EM_PadVibrate
| e-sio                | i-intc                        | x-log            |
*EM_PadRegisterSamples
| e-dramc              | i-mem                        | x-mcd            |
*EM_PadSetButtonsMode
| e-intc                | i-memcard                    | x-replay          |
*EM_AddVsyncHook
| e-sif                | i-mtap                        | x-rtc            |
*EM_RemoveVsyncHook
| e-gif                | i-pad                        | x-save            |
*EM_ThrottleMax
| e-vif0                | i-pif                        | x-osd            |
*EM_ThrottleNormal
| e-vif1                | i-sched                      | x-snap            |
*EM_Log
| e-ipu                | i-sif                        | x-host            |
*EM_GetLanguage
| e-jit                | i-sio2                        | x-trphy          |
*EM_GetNativeLanguage
| e-hook                | i-timer                      | x-audio          |
*EM_DisplayManual
| e-Lua                | i-usb                        | x-pad            |
*EM_LoadConfig
| e-gs                  | i-spu2                        | x-srvc            |
*EM_SaveConfig
| e-sched              | i-EndSlice                    | x-dialog          |
*EM_LoadMIDI
|                      | i-r30                        | x-dlc            |
*EM_GetMIDINotesAtTick
|                      | i-jit                        | x-stream          |
*EM_LoadSlideshow
|                      | i-Lua                        | x-mem            |
*EM_StartSlideshow
|                      | i-thread                      | x-core            |
*EM_LoadState
|-----------------------|-------------------------------|-------------------|</pre>
*EM_SaveState


===config psp===
==Shaders==


Desc: https://pastebin.com/CXRpVLdd
===SB header===
<br>1,0 is done by true/false commands.
{| border="1" cellspacing="0" cellpadding="5" border="#999" class="wikitable" style="border:1px solid #999; border-collapse: collapse;"
|- bgcolor="#cccccc"
! Offset !! Size !! Description !! Example
|-
| 0x00 || 2 bytes || SB Version || 00 04 (00.04)
|-
| 0x02 || 2 bytes || Compiler Version || F9 F1 (63985)
|-
| 0x04 || 8 bytes || Association Hash || B2 09 E0 A5 00 00 00 00
|-
| 0x0C || 1 byte || Shader Type || 02
|-
| 0x0D || 1 byte || Code Type || 01
|-
| 0x0E || 1 byte || UseShaderResourceTable || 00/01 (true/false)
|-
| 0x0F || 1 byte || Compiler Type || 03
|-
| 0x10 || 4 bytes || Code Size || E8 00 00 00 (232)
|-
| 0x14 || 4 bytes || ? || 00 00 00 00
|-
| 0x18 || 12 bytes? || System Attribute Info - Num Threads || 40 00 01 00  01 00 00 00  00 00 00 00
|-
|}
<pre>
'''Shader Type'''


*--boot [disc0:/PSP_GAME/SYSDIR/BOOT.BIN - path (no loaders support like on PS3? vide ct2, psc)]
*(unknown)             0
*--notrophies
*kShaderTypeVsShader  1
*--texsave
*kShaderTypeFsShader  2
*--texmissingsave
*kShaderTypeCsShader  3
*--samplesave
*kShaderTypeGsShader  4
*--texreplace
*kShaderTypeHsShader  5
*--samplereplace
*kShaderTypeDsShader  6
*--replacementalpha [true]
*--parappaalphahack
*--locorocomeshsmooth
*--replacementfilter
*--gputhread
*--antialias [MSAA4x, SSAA4x]
*--texcachemode [drawbounds, drawboundsloco]
*--texclutmode [filter, full]
*--texloadmode [launch, ondemand_lz4]
*--parappajapanesefonthack
*--parappareplacecolor [%08x (rgb?)]
*--volume [  ? (Adjusting volume level to %d%%)]
*--image [umd0 ,disc0]
*--addon
*--host [host0, flash0]


====Standard: ====


*patches/
'''Code type'''
*_patches.lua
*feature_data/
*_features.lua
*tooling/
*_tooling.lua
*trophy_data/
*_trophies.lua


====other====
*kCodeTypeIl  0
*kCodeTypeIsa  1
*kCodeTypeScu  2


*_config.txt
*--vms
*--autoresampler [true]


*videos/
'''UseShaderResourceTable'''
*.mp4
*videos/%08x.mp4
*audio/%08x.ogg
*--texswitch [original, replacement]


Paths:
*false  0
*true  1


*/app0/
*/download0/
*/savedata
*/host/
*/hostapp/
*/data/


====sample====
'''Compiler Type'''


<pre>; PS4 configuration file for PSPHD
   
   
; Game Image
*kCompilerTypeUnspecified 0
--image="data/USER_L0.IMG"
*kCompilerTypeOrbisPsslc 1
   
*kCompilerTypeOrbisEsslc 2
; Redirect host0: to a specific directory (uncomment to enable).
*kCompilerTypeOrbisWave  3
; By default it's mapped to either "/hostapp/" if available, or "/app0/" if "/hostapp/" is not available.
*kCompilerTypeOrbisCuAs  4</pre>
;--host="/hostapp/"
   
; To dump the original video in PMF format, uncomment the --dumpvideos line
; For example, with the current setting, it will save them in a "videos" directory inside the File Serving Directory
;--dumpvideos="host0:videos"
; To dump the original audio in Atrac3 format, uncomment the --dumpaudio line
; For example, with the current setting, it will save them in a "audio" directory inside the File Serving Directory
;--dumpaudio="host0:audio"
; To replace atrac3 audio samples, use this.
--samplereplace="host0:samplereplace"
; To save the in-game textures as the game runs, uncomment the --texsave line
; For example, with the current setting, it will save them in a "texdump" directory inside the File Serving Directory
;--texsave="host0:texdump"
;--texmissingsave="host0:texdump"
; To replace specific textures as the game runs, uncomment the --texreplace line
; For example, with the current setting, it will load them from the "texreplace" directory inside the File Serving Directory
--texreplace="host0:texreplace"
; This forces alpha blending to on for replaced textures. (uncomment to enable)
; With this we can freely make use of a normal alpha channel on replacement textures
--replacementalpha=true
; This enables bilinear filtering on replaced textures. (uncomment to enable)
--replacementfilter=true
; Antialiasing mode. SSAA4x looks best, MSAA4x only smooths edges.
; Choices: off, SSAA4x, MSAA4x
--antialias=SSAA4x
; Enable switching between original and replacement textures at runtime using the L3 button on a DS4 or the 'T' key on Windows
;--texswitch=true
; Turns on the auto-resampler. Assumes textures in texreplace are at 8x resolution and resamples them at load
--autoresampler=true
; Parappa Alpha Hack
--parappaalphahack=true
; Adjust overall volume level (does not include pad speaker volume). Range from 0.0 (min) to 1.0 (max)
--volume="0.25"
; Special thanks to Matsuura, Rodney, Allan and all the awesome people at Japan Studio! Also HUUUUGE thanks to Ernesto, Adam, Henrick, Taku, Tim, Nick, Mayene, Tyler, Dave Thach and Scott Rohde whose support made this project of love possible! PaRappa-4-Ever!!!!!
; If you're reading this message, congratulations! you win !!!
; we love you so much. you’ve made hacking great again.</pre>
 
===NIDs in HLE,  without.. NIDs :( ===
 
=====HLEInterruptManager=====
 
*sceKernelRegisterSubIntrHandler
*sceKernelReleaseSubIntrHandler
*sceKernelEnableSubIntr
 
=====HLEStdioForUser=====
 
*sceIoOpen
*sceIoClose
*sceIoRead
*sceIoWrite
*sceIoLseek
*sceIoLseek32
*sceIoDopen
*sceIoDread
*sceIoDclose
*sceIoChdir
*sceIoGetstat
*sceIoDevctl
*sceIoRename
*sceIoMkDir
*sceIoChstat
*sceIoRemove
*sceIoRmdir
*sceIoOpenAsync
*sceIoReadAsync
*sceIoIoctlAsync
*sceIoWaitAsync
*sceIoWaitAsyncCB
*sceIoCloseAsync
*sceIoSetAsyncCallback
*sceIoPollAsync
*sceIoLseekAsync
*sceIoGetAsyncStat
*asyncWaitTimerCallback
*asyncCallbackTimerCallback
*sceKernelStdin
*sceKernelStdout
*sceKernelStderr
 
=====HLELoadExecForUser=====
 
*sceKernelCpuSuspendIntr
*sceKernelCpuResumeIntr
*sceKernelIsCpuIntrEnable
*sceKernelExitGame
*sceKernelRegisterExitCallback
*sceKernelLoadModule
*sceKernelUnloadModule
*sceKernelStartModule
*sceKernelStopModule
*sceKernelStopUnloadSelfModule
*sceKernelGetModuleIdByAddress
*sceKernelStopUnloadSelfModuleWithStatus
*sceKernelGetModuleId
 
=====HLEsceAtrac3plus=====
 
*sceAtracReinit
*sceAtracDecodeData
*sceAtracGetNextDecodePosition
*sceAtracSetHalfwayBufferAndGetID
*sceAtracGetSoundSample
*sceAtracGetStreamDataInfo
*sceAtracGetRemainFrame
*sceAtracSetLoopNum
*sceAtracResetPlayPosition
*sceAtracReleaseAtracID
*sceAtracGetAtracID
*sceAtracGetNextSample
*sceAtracSetData
*sceAtracAddStreamData
 
=====HLEsceAudio=====
 
*sceAudioChReserve
*sceAudioChRelease
*sceAudioOutputBlocking
*sceAudioChangeChannelConfig
*sceAudioGetChannelRestLength
*sceAudioChangeChannelVolume
*sceAudioSetChannelDataLen
*sceAudioOutputPanned
*sceAudioOutputPannedBlocking
*sceAudioGetChannelRestLen
*sceAudioOutput2Reserve
*sceAudioOutput2OutputBlocking
*sceAudioOutput2Release
*outputCallback
 
=====HLEsceCtrl=====
 
*sceCtrlSetSamplingCycle
*sceCtrlSetSamplingMode
*sceCtrlReadBufferPositive
*sceCtrlReadBufferNegative
*sceCtrlPeekBufferPositive
*sceCtrlPeekBufferNegative
*sceCtrlGetIdleCancelThreshold
*sceCtrlSetIdleCancelThreshold
*sceCtrlReadLatch
*sceCtrlPeekLatch
*sampleControllerCallback
*vibrationControllerCallback
 
=====HLEsceDisplay=====
 
*sceDisplaySetMode
*sceDisplaySetFramebuf
*sceDisplayGetFramebuf
*sceDisplayGetVcount
*sceDisplayWaitVblankStart
*sceDisplayWaitVblankStartCB
*sceDisplayGetCurrentHcount
*sceDisplayGetAccumulatedHcount
*sceDisplayGetFramePerSec
*sceDisplayWaitVblank
*sceDisplayWaitVblankCB
*sceDisplayIsVblank
*sceDisplaySetHoldMode
*vblankStart
*vblankEnd
 
=====HLEsceGe_user=====
 
*sceGeEdramGetAddr
*sceGeEdramGetSize
*sceGeGetCmd
*sceGeGetMtx
*sceGeListEnQueue
*sceGeListEnQueueHead
*sceGeListDeQueue
*sceGeListSync
*sceGeListUpdateStallAddr
*sceGeDrawSync
*sceGeSetCallback
*sceGeUnsetCallback
*sceGeBreak
*sceGeContinue
*interruptCallback
 
=====HLEsceImpose=====
 
*sceImposeGetLanguageMode
*sceImposeSetLanguageMode
*sceImposeSetUMDPopup
 
=====HLEsceMpeg=====
 
*sceMpegInit
*sceMpegFinish
*sceMpegCreate
*sceMpegDelete
*sceMpegQueryMemSize
*sceMpegMallocAvcEsBuf
*sceMpegFreeAvcEsBuf
*sceMpegInitAu
*sceMpegGetAvcAu
*sceMpegGetAtracAu
*sceMpegQueryAtracEsSize
*sceMpegAtracDecode
*sceMpegRingbufferQueryMemSize
*sceMpegRingbufferConstruct
*sceMpegRingbufferDestruct
*sceMpegRingbufferPut
*sceMpegRingbufferAvailableSize
*sceMpegAvcCsc
*sceMpegAvcDecodeMode
*sceMpegAvcDecodeDetail
*sceMpegAvcDecodeFlush
*sceMpegAvcQueryYCbCrSize
*sceMpegAvcInitYCbCr
*sceMpegAvcDecodeYCbCr
*sceMpegAvcDecodeStopYCbCr
*sceMpegRegistStream
*sceMpegUnRegistStream
*sceMpegQueryStreamSize
*sceMpegQueryStreamOffset
*sceMpegFlushAllStream
 
=====HLEsceNet=====
 
*sceNetInit
*sceNetInetGetsockopt
*sceNetInetSetsockopt
*sceNetInetGetErrno
 
=====HLEscePower=====
 
*scePowerRegisterCallback
*scePowerUnregisterCallback
*scePowerSetClockFrequency
*scePowerSetCpuClockFrequency
*scePowerSetBusClockFrequency
 
=====HLEscePsmf=====
 
*scePsmfVerifyPsmf
*scePsmfSetPsmf
*scePsmfSpecifyStreamWithStreamTypeNumber
*scePsmfCheckEPmap
*scePsmfGetVideoInfo
*scePsmfGetNumberOfStreams
*scePsmfGetNumberOfEPentries
*scePsmfGetEPWithId
*scePsmfGetPsmfVersion
*scePsmfGetNumberOfSpecificStreams
*scePsmfSpecifyStream
*scePsmfGetCurrentStreamType
 
=====HLEscePsmfPlayer=====
 
*scePsmfPlayerCreate
*scePsmfPlayerDelete
*scePsmfPlayerSetPsmf
*scePsmfPlayerReleasePsmf
*scePsmfPlayerStart
*scePsmfPlayerGetAudioOutSize
*scePsmfPlayerStop
*scePsmfPlayerUpdate
*scePsmfPlayerGetVideoData
*scePsmfPlayerGetAudioData
*scePsmfPlayerGetCurrentStatus
*scePsmfPlayerGetPsmfInfo
*scePsmfPlayerConfigPlayer
*scePsmfPlayerBreak
*scePsmfPlayerChangePlayMode
 
=====HLEsceRtc=====
 
*sceRtcGetCurrentTick
*sceRtcGetAccumulativeTime
*sceRtcGetCurrentClockLocalTime
 
=====HLEsceSasCore=====
 
*sceSasInit
*sceSasCore
*sceSasCoreWithMix
*sceSasGetEndFlag
*sceSasGetPauseFlag
*sceSasGetEnvelopeHeight
*sceSasGetAllEnvelopeHeights
*sceSasGetOutputMode
*sceSasSetOutputMode
*sceSasGetGrain
*sceSasSetGrain
*sceSasSetVoice
*sceSasSetNoise
*sceSasSetPitch
*sceSasSetVolume
*sceSasSetSimpleADSR
*sceSasSetKeyOn
*sceSasSetKeyOff
*sceSasSetPause
*sceSasSetSL
*sceSasSetADSR
*sceSasSetADSRMode
*sceSasRevEVOL
*sceSasRevType
*sceSasRevParam
*sceSasRevVON
 
=====HLEsceSuspendForUser=====
 
*sceKernelPowerTick
*sceKernelPowerLock
*sceKernelPowerUnlock
*sceKernelVolatileMemTryLock
*sceKernelVolatileMemUnlock
*sceKernelVolatileMemLock
 
=====HLEsceUmdUser=====
 
*sceUmdActivate
*sceUmdGetDriveStat
*sceUmdCheckMedium
*sceUmdRegisterUMDCallback
*sceUmdUnRegisterUMDCallBack
*sceUmdWaitDriveStat
*sceUmdWaitDriveStatWithTimer
*sceUmdWaitDriveStatCB
*sceUmdCancelWaitDriveStat
*_UmdWaitDriveTimeout
 
=====HLEsceUtility=====
 
*sceUtilityLoadModule
*sceUtilityUnloadModule
*sceUtilityLoadNetModule
*sceUtilityUnloadNetModule
*sceUtilityLoadAvModule
*sceUtilityUnloadAvModule
*sceUtilityGetSystemParamInt
*sceUtilityGetSystemParamString
*sceUtilitySavedataGetStatus
*sceUtilitySavedataShutdownStart
*sceUtilitySavedataInitStart
*sceUtilitySavedataUpdate
*sceUtilityMsgDialogGetStatus
*sceUtilityMsgDialogShutdownStart
*sceUtilityMsgDialogInitStart
*sceUtilityMsgDialogUpdate
*sceUtilityMsgDialogAbort
*sceUtilityOskGetStatus
*sceUtilityOskShutdownStart
*sceUtilityOskInitStart
*sceUtilityOskUpdate
*saveDataUpdateCallback
*oskUpdateCallback
 
=====HLEsceWlanDrv=====
 
*sceWlanGetSwitchState
*sceWlanGetEtherAddr
 
=====HLESysMemUserForUser=====
 
*sceKernelMaxFreeMemSize
*sceKernelTotalFreeMemSize
*sceKernelQueryMemoryInfo
*sceKernelDevkitVersion
*sceKernelPrintf
*sceKernelGetPTRIG
*sceKernelSetPTRIG
*sceKernelAllocPartitionMemory
*sceKernelFreePartitionMemory
*sceKernelGetBlockHeadAddr
*sceKernelGetMemoryBlockAddr
*sceKernelAllocMemoryBlock
*sceKernelFreeMemoryBlock
*sceKernelSetCompilerVersion
*sceKernelGetCompiledSdkVersion
*sceKernelSetCompiledSdkVersion
*sceKernelSetCompiledSdkVersion370
*sceKernelSetCompiledSdkVersion380_390
*sceKernelSetCompiledSdkVersion395
*sceKernelSetCompiledSdkVersion401_402
*sceKernelSetCompiledSdkVersion500_505
*sceKernelSetCompiledSdkVersion507
*sceKernelSetCompiledSdkVersion600_602
*sceKernelSetCompiledSdkVersion603_605
*sceKernelSetCompiledSdkVersion606
*sceKernelSetUsersystemLibWork
*sceKernelSysMemUserForUser_ACBD88CA
*sceKernelSysMemUserForUser_D8DE5C1E
*sceKernelSysMemUserForUser_945E45DA
 
=====HLEThreadManForUser=====
 
*sceKernelDelayThread
*sceKernelDelayThreadCB
*sceKernelCreateCallback
*sceKernelDeleteCallback
*sceKernelSleepThread
*sceKernelSleepThreadCB
*sceKernelWakeupThread
*sceKernelCreateMsgPipe
*sceKernelDeleteMsgPipe
*sceKernelSendMsgPipe
*sceKernelTrySendMsgPipe
*sceKernelReceiveMsgPipe
*sceKernelTryReceiveMsgPipe
*sceKernelReferMsgPipeStatus
*sceKernelCreateThread
*sceKernelStartThread
*sceKernelExitThread
*sceKernelDeleteThread
*sceKernelExitDeleteThread
*sceKernelGetThreadExitStatus
*sceKernelTerminateThread
*sceKernelTerminateDeleteThread
*sceKernelWaitThreadEnd
*sceKernelWaitThreadEndCB
*sceKernelRotateThreadReadyQueue
*sceKernelReferThreadStatus
*sceKernelSuspendDispatchThread
*sceKernelResumeDispatchThread
*sceKernelSuspendThread
*sceKernelResumeThread
*sceKernelCancelWakeupThread
*sceKernelGetThreadStackFreeSize
*sceKernelGetSystemTimeLow
*sceKernelGetSystemTime
*sceKernelGetSystemTimeWide
*sceKernelGetThreadCurrentPriority
*sceKernelChangeCurrentThreadAttr
*sceKernelGetThreadId
*sceKernelChangeThreadPriority
*sceKernelReferThreadProfiler
*sceKernelCheckCallback
*sceKernelCancelSema
*sceKernelCreateSema
*sceKernelDeleteSema
*sceKernelPollSema
*sceKernelSignalSema
*sceKernelReferSemaStatus
*sceKernelWaitSema
*sceKernelWaitSemaCB
*sceKernelCreateFpl
*sceKernelDeleteFpl
*sceKernelAllocateFpl
*sceKernelAllocateFplCB
*sceKernelTryAllocateFpl
*sceKernelFreeFpl
*sceKernelCancelFpl
*sceKernelReferFplStatus
*sceKernelCreateVpl
*sceKernelDeleteVpl
*sceKernelAllocateVpl
*sceKernelAllocateVplCB
*sceKernelTryAllocateVpl
*sceKernelFreeVpl
*sceKernelCancelVpl
*sceKernelReferVplStatus
*sceKernelCreateEventFlag
*sceKernelSetEventFlag
*sceKernelDeleteEventFlag
*sceKernelClearEventFlag
*sceKernelWaitEventFlag
*sceKernelWaitEventFlagCB
*sceKernelPollEventFlag
*sceKernelCancelEventFlag
*sceKernelReferEventFlagStatus
*sceKernelCreateMbx
*sceKernelDeleteMbx
*sceKernelSendMbx
*sceKernelReceiveMbx
*sceKernelReceiveMbxCB
*sceKernelPollMbx
*sceKernelCancelReceiveMbx
*sceKernelReferMbxStatus
*sceKernelCreateMutex
*sceKernelDeleteMutex
*sceKernelLockMutex
*sceKernelLockMutexCB
*sceKernelTryLockMutex
*sceKernelUnlockMutex
*sceKernelCancelMutex
*sceKernelReferMutexStatus
*_sceKernelDelayThreadCallback
*_sceKernelWaitThreadEndTimeout
*_sceKernelAllocateFplTimeout
*_sceKernelAllocateVplTimeout
*_sceKernelWaitEventFlagTimeout
*_sceKernelMsgPipeTimeout
*_sceKernelLockMutexTimeout
 
=====HLEUtilsForKernel=====
 
*sceKernelIcacheInvalidateRange


=====HLEUtilsForUser=====
===GNM Header===


*sceKernelIcacheInvalidateRange
{| border="1" cellspacing="0" cellpadding="5" border="#999" class="wikitable" style="border:1px solid #999; border-collapse: collapse;"
*sceKernelDcacheInvalidateRange
|- bgcolor="#cccccc"
*sceKernelDcacheWritebackInvalidateRange
! Offset !! Size !! Description !! Example
*sceKernelDcacheWritebackAll
|-
*sceKernelDcacheWritebackRange
| 0x00 || 4 bytes || Magic || 72 64 68 53 Shdr
*sceKernelDcacheWritebackInvalidateAll
|-
*sceKernelSetGPO
| 0x04 || 4 bytes || Version || 00 07 00 02 (0007.0002)
*sceKernelGetGPI
|-
*sceKernelLibcClock
| 0x08 || 1 byte || Shader type || 04 (Compute)
*sceKernelLibcTime
|-
*sceKernelLibcGettimeofday
| 0x09 || 1 byte || Shader header size in DW || 0D (13)
|-
| 0x0A || 1 byte || Has shader aux data || 00/01 ? 
|-
| 0x0B || 1 byte || Target GPU types || 03 (Base|NEO)
|-
| 0x0C || 4 bytes || padding || 00 00 00 00
|-
|}

Latest revision as of 17:30, 11 April 2023

Rough draft[edit source]

psfour2pstwo[edit source]

vu0[edit source]

For JAK emu. Todo: Exec from VIF0 seems to always run program for 0x7FFFFFFF cycles...

void __fastcall Vu0MicroExec()
{
  run_vu0(vu0_functions_ptr, 256LL, 0LL);
                                                // run vu for 256 cycles.
                                                // This kill whole sync idea. We have 256 cycles run already on first run.
                                                // Games like SST/ARR/TM:HEAD-ON are alredy broken before we even started. 

  if (is_vu0_running())                         // if still running (no ebit, no mbit)
  {
    v0 = ee_sched_stru;
    v1 = 0LL;
    v2 = *(ee_core_regs_base + 0x378) - *(ee_core_regs_base + 0x370) + 512LL;
                                                // passed cycles + 512
                                                // terrible idea, we are falling behind ee here.
                                                // There is usually no point to run behind ee if we failed to do this at start.
                                                // This break games like Ratchet/Rayman.
    sched_Vu0MicroExec.delta = v2;
    if ( ee_sched_stru )
    {
      while ( 1 )
      {
        v3 = v0;
        if ( v0[2] >= v2 )                      // if delta from scheduler higher than from v0
          break;
        v0 = *v0;
        v1 = v3;
        if ( !*v3 )                             // schedule next run...

todo[edit source]

seems to be like internal threads, not real threads. Emu print with that.

_____________________________________________________________________________
| Emotion Engine:       | Input Output Processor (iop)  | x Extra?          |
|-----------------------|-------------------------------|-------------------|
| e-dbg                 | i-fw                          | x-stdlib          |
| e-r59                 | i-debug                       | x-emu             |
| e-mem                 | i-cdvd                        | x-lpnr            |
| e-dmac                | i-dmac                        | x-cdvd            |
| e-timer               | i-gmif                        | x-isofs           |
| e-sio                 | i-intc                        | x-log             |
| e-dramc               | i-mem                         | x-mcd             |
| e-intc                | i-memcard                     | x-replay          |
| e-sif                 | i-mtap                        | x-rtc             |
| e-gif                 | i-pad                         | x-save            |
| e-vif0                | i-pif                         | x-osd             |
| e-vif1                | i-sched                       | x-snap            |
| e-ipu                 | i-sif                         | x-host            |
| e-jit                 | i-sio2                        | x-trphy           |
| e-hook                | i-timer                       | x-audio           |
| e-Lua                 | i-usb                         | x-pad             |
| e-gs                  | i-spu2                        | x-srvc            |
| e-sched               | i-EndSlice                    | x-dialog          |
|                       | i-r30                         | x-dlc             |
|                       | i-jit                         | x-stream          |
|                       | i-Lua                         | x-mem             |
|                       | i-thread                      | x-core            |
|-----------------------|-------------------------------|-------------------|

Shaders[edit source]

SB header[edit source]

Offset Size Description Example
0x00 2 bytes SB Version 00 04 (00.04)
0x02 2 bytes Compiler Version F9 F1 (63985)
0x04 8 bytes Association Hash B2 09 E0 A5 00 00 00 00
0x0C 1 byte Shader Type 02
0x0D 1 byte Code Type 01
0x0E 1 byte UseShaderResourceTable 00/01 (true/false)
0x0F 1 byte Compiler Type 03
0x10 4 bytes Code Size E8 00 00 00 (232)
0x14 4 bytes ? 00 00 00 00
0x18 12 bytes? System Attribute Info - Num Threads 40 00 01 00 01 00 00 00 00 00 00 00
'''Shader Type'''

*(unknown)             0
*kShaderTypeVsShader   1
*kShaderTypeFsShader   2
*kShaderTypeCsShader   3
*kShaderTypeGsShader   4
*kShaderTypeHsShader   5
*kShaderTypeDsShader   6


'''Code type'''

*kCodeTypeIl   0
*kCodeTypeIsa  1
*kCodeTypeScu  2


'''UseShaderResourceTable'''

*false  0
*true   1


'''Compiler Type'''

 
*kCompilerTypeUnspecified 0
*kCompilerTypeOrbisPsslc  1
*kCompilerTypeOrbisEsslc  2
*kCompilerTypeOrbisWave   3
*kCompilerTypeOrbisCuAs   4

GNM Header[edit source]

Offset Size Description Example
0x00 4 bytes Magic 72 64 68 53 Shdr
0x04 4 bytes Version 00 07 00 02 (0007.0002)
0x08 1 byte Shader type 04 (Compute)
0x09 1 byte Shader header size in DW 0D (13)
0x0A 1 byte Has shader aux data 00/01 ?
0x0B 1 byte Target GPU types NEO)
0x0C 4 bytes padding 00 00 00 00