diff --git a/rpcs3/Emu/Cell/MFC.cpp b/rpcs3/Emu/Cell/MFC.cpp index 71c138d47e..01ea85be3a 100644 --- a/rpcs3/Emu/Cell/MFC.cpp +++ b/rpcs3/Emu/Cell/MFC.cpp @@ -158,7 +158,7 @@ void mfc_thread::cpu_task() if ((cmd.cmd & ~(MFC_BARRIER_MASK | MFC_FENCE_MASK)) == MFC_PUTQLLUC_CMD) { - auto& data = vm::ps3::_ref(cmd.eal); + auto& data = vm::_ref(cmd.eal); const auto to_write = spu._ref(cmd.lsa & 0x3ffff); cmd.size = 0; diff --git a/rpcs3/Emu/Cell/Modules/cellAdec.h b/rpcs3/Emu/Cell/Modules/cellAdec.h index ba5d0c16be..98f99cdc3b 100644 --- a/rpcs3/Emu/Cell/Modules/cellAdec.h +++ b/rpcs3/Emu/Cell/Modules/cellAdec.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum @@ -308,7 +308,7 @@ enum CellAdecChannel : s32 CELL_ADEC_CH_3_4, CELL_ADEC_CH_3_4_LFE, CELL_ADEC_CH_RESERVED3, -}; +}; // Sampling Rate enum CellAdecSampleRate : s32 @@ -532,13 +532,13 @@ struct CellAdecParamM4Aac union { - struct + struct { be_t programNumber; } adifConfig; - struct + struct { be_t samplingFreqIndex; // MPEG4AAC_SamplingFreq be_t profile; // LC profile (1) @@ -683,10 +683,10 @@ struct CellAdecParamAc3 AC3_WordSize wordSize; AC3_OutputMode outputMode; AC3_LFE outLfeOn; - + be_t drcCutScaleFactor; be_t drcBoostScaleFactor; - + AC3_CompressionMode compressionMode; AC3_InputChannel numberOfChannels; AC3_StereoMode stereoMode; diff --git a/rpcs3/Emu/Cell/Modules/cellAtrac.h b/rpcs3/Emu/Cell/Modules/cellAtrac.h index e9cca6f3bf..7d6f21cf1e 100644 --- a/rpcs3/Emu/Cell/Modules/cellAtrac.h +++ b/rpcs3/Emu/Cell/Modules/cellAtrac.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellAtracMulti.h b/rpcs3/Emu/Cell/Modules/cellAtracMulti.h index 51d5b7d889..61ad210185 100644 --- a/rpcs3/Emu/Cell/Modules/cellAtracMulti.h +++ b/rpcs3/Emu/Cell/Modules/cellAtracMulti.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellAudio.h b/rpcs3/Emu/Cell/Modules/cellAudio.h index dd0411281a..30f24d62ea 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudio.h +++ b/rpcs3/Emu/Cell/Modules/cellAudio.h @@ -2,7 +2,7 @@ #include "Utilities/Thread.h" -namespace vm { using namespace ps3; } + // Error codes enum CellAudioError : u32 @@ -32,7 +32,7 @@ enum CELL_AUDIO_BLOCK_SAMPLES = 256, CELL_AUDIO_CREATEEVENTFLAG_SPU = 0x00000001, CELL_AUDIO_EVENT_HEADPHONE = 1, - CELL_AUDIO_EVENT_MIX = 0, + CELL_AUDIO_EVENT_MIX = 0, CELL_AUDIO_EVENTFLAG_BEFOREMIX = 0x80000000, CELL_AUDIO_EVENTFLAG_DECIMATE_2 = 0x08000000, CELL_AUDIO_EVENTFLAG_DECIMATE_4 = 0x10000000, @@ -40,7 +40,7 @@ enum CELL_AUDIO_EVENTFLAG_NOMIX = 0x40000000, CELL_AUDIO_MAX_PORT = 4, CELL_AUDIO_MAX_PORT_2 = 8, - CELL_AUDIO_MISC_ACCVOL_ALLDEVICE = 0x0000ffffUL, + CELL_AUDIO_MISC_ACCVOL_ALLDEVICE = 0x0000ffffUL, CELL_AUDIO_PERSONAL_DEVICE_PRIMARY = 0x8000, CELL_AUDIO_PORT_2CH = 2, CELL_AUDIO_PORT_8CH = 8, @@ -51,7 +51,7 @@ enum CELL_AUDIO_PORTATTR_OUT_PERSONAL_1 = 0x0000000002000000ULL, CELL_AUDIO_PORTATTR_OUT_PERSONAL_2 = 0x0000000004000000ULL, CELL_AUDIO_PORTATTR_OUT_PERSONAL_3 = 0x0000000008000000ULL, - CELL_AUDIO_PORTATTR_OUT_SECONDARY = 0x0000000000000001ULL, + CELL_AUDIO_PORTATTR_OUT_SECONDARY = 0x0000000000000001ULL, CELL_AUDIO_STATUS_CLOSE = 0x1010, CELL_AUDIO_STATUS_READY = 1, CELL_AUDIO_STATUS_RUN = 2, @@ -59,15 +59,15 @@ enum //libaudio datatypes struct CellAudioPortParam -{ +{ be_t nChannel; be_t nBlock; be_t attr; be_t level; -}; +}; struct CellAudioPortConfig -{ +{ vm::bptr readIndexAddr; be_t status; be_t nChannel; @@ -115,7 +115,7 @@ struct audio_port float inc; }; - float level; + float level; atomic_t level_set; }; diff --git a/rpcs3/Emu/Cell/Modules/cellAudioIn.h b/rpcs3/Emu/Cell/Modules/cellAudioIn.h index 300869111c..a93f814282 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudioIn.h +++ b/rpcs3/Emu/Cell/Modules/cellAudioIn.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellAudioOut.h b/rpcs3/Emu/Cell/Modules/cellAudioOut.h index 92ab800e3d..24af5c5250 100644 --- a/rpcs3/Emu/Cell/Modules/cellAudioOut.h +++ b/rpcs3/Emu/Cell/Modules/cellAudioOut.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellBgdl.cpp b/rpcs3/Emu/Cell/Modules/cellBgdl.cpp index 932b94aa67..d25cb76cf8 100644 --- a/rpcs3/Emu/Cell/Modules/cellBgdl.cpp +++ b/rpcs3/Emu/Cell/Modules/cellBgdl.cpp @@ -4,7 +4,7 @@ #include "cellBgdl.h" -namespace vm { using namespace ps3; } + logs::channel cellBGDL("cellBGDL"); diff --git a/rpcs3/Emu/Cell/Modules/cellBgdl.h b/rpcs3/Emu/Cell/Modules/cellBgdl.h index 37a7319ad6..b7edc57b62 100644 --- a/rpcs3/Emu/Cell/Modules/cellBgdl.h +++ b/rpcs3/Emu/Cell/Modules/cellBgdl.h @@ -30,5 +30,5 @@ struct CellBGDLInfo be_t received_size; be_t content_size; be_t state; // CellBGDLState - vm::ps3::bptr reserved; + vm::bptr reserved; }; diff --git a/rpcs3/Emu/Cell/Modules/cellCamera.h b/rpcs3/Emu/Cell/Modules/cellCamera.h index 8950d16db7..2aafef959f 100644 --- a/rpcs3/Emu/Cell/Modules/cellCamera.h +++ b/rpcs3/Emu/Cell/Modules/cellCamera.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellCelp8Enc.h b/rpcs3/Emu/Cell/Modules/cellCelp8Enc.h index a2e55ae9fb..09b4eecaab 100644 --- a/rpcs3/Emu/Cell/Modules/cellCelp8Enc.h +++ b/rpcs3/Emu/Cell/Modules/cellCelp8Enc.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // libCelp8Enc = 0x806140a1 - 0x806140bf @@ -19,9 +19,9 @@ enum enum { CELL_CELP8ENC_FS_8kHz = 1, - + CELL_CELP8ENC_EXCITATION_MODE_MPE = 0, - + CELL_CELP8ENC_MPE_CONFIG_0 = 0, CELL_CELP8ENC_MPE_CONFIG_2 = 2, CELL_CELP8ENC_MPE_CONFIG_6 = 6, @@ -32,6 +32,6 @@ enum CELL_CELP8ENC_MPE_CONFIG_21 = 21, CELL_CELP8ENC_MPE_CONFIG_24 = 24, CELL_CELP8ENC_MPE_CONFIG_26 = 26, - + CELL_CELP8ENC_WORD_SZ_FLOAT, }; diff --git a/rpcs3/Emu/Cell/Modules/cellCelpEnc.h b/rpcs3/Emu/Cell/Modules/cellCelpEnc.h index 079920f389..2becd0afdb 100644 --- a/rpcs3/Emu/Cell/Modules/cellCelpEnc.h +++ b/rpcs3/Emu/Cell/Modules/cellCelpEnc.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // libCelpEnc = 0x80614001 - 0x806140ff @@ -19,14 +19,14 @@ enum enum { CELL_CELPENC_FS_16kHz = 2, - + CELL_CELPENC_EXCITATION_MODE_RPE = 1, - + CELL_CELPENC_RPE_CONFIG_0, CELL_CELPENC_RPE_CONFIG_1, CELL_CELPENC_RPE_CONFIG_2, CELL_CELPENC_RPE_CONFIG_3, - + CELL_CELPENC_WORD_SZ_INI16_LE, CELL_CELPENC_WORD_SZ_FLOAT, }; diff --git a/rpcs3/Emu/Cell/Modules/cellCrossController.cpp b/rpcs3/Emu/Cell/Modules/cellCrossController.cpp index bde07c79bb..0ff42f5b09 100644 --- a/rpcs3/Emu/Cell/Modules/cellCrossController.cpp +++ b/rpcs3/Emu/Cell/Modules/cellCrossController.cpp @@ -2,7 +2,7 @@ #include "Emu/System.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } + logs::channel cellCrossController("cellCrossController"); diff --git a/rpcs3/Emu/Cell/Modules/cellDaisy.h b/rpcs3/Emu/Cell/Modules/cellDaisy.h index 7ddd53f68a..aad3bd051b 100644 --- a/rpcs3/Emu/Cell/Modules/cellDaisy.h +++ b/rpcs3/Emu/Cell/Modules/cellDaisy.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // libDaisy = 0x80410501 - 0x804105ff @@ -35,7 +35,7 @@ enum CELL_DAISY_MIN_ENTRY_SIZE = 16, CELL_DAISY_MAX_ENTRY_SIZE = (16*1024), CELL_DAISY_MAX_DMA_TAG = 31, - + // CELL_DAISY_ENTRY_SIZE(x) // CELL_DAISY_EA_ATOMIC(x) // CELL_DAISY_EA_DMA(x) @@ -48,35 +48,35 @@ enum // Queue IO DAISY_OUTPUT, DAISY_INPUT, - + // Block Mode DAISY_NOT_STALL = 0, DAISY_STALL = 1, - + // Queue Status DAISY_PTR_UNAVAILABLE = 0x40000001, DAISY_PTR_TERMINATED = 0x40000002, - + // Buffer Mode DAISY_COPY = 0, DAISY_REFERENCE = 1, - + // Constructor Mode DAISY_NO_PARAMETER = 0, DAISY_PARAMETER = 1, - + // Glue Mode DAISY_ONE_PORT = 1, DAISY_TWO_PORT = 2, - + // Queue Mode DAISY_IN_ORDER, DAISY_OUT_OF_ORDER, - + // Buffer Type DAISY_BUFFER_TYPE_REMOTE = 1, DAISY_BUFFER_TYPE_LOCAL = 2, - + // Queue Control Type DAISY_QCTL_TYPE_ATOMIC = 1, DAISY_QCTL_TYPE_LOCAL = 2, diff --git a/rpcs3/Emu/Cell/Modules/cellDmux.h b/rpcs3/Emu/Cell/Modules/cellDmux.h index fd32643dba..a90b6311af 100644 --- a/rpcs3/Emu/Cell/Modules/cellDmux.h +++ b/rpcs3/Emu/Cell/Modules/cellDmux.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum @@ -156,7 +156,7 @@ struct CellDmuxEsMsg be_t supplementalInfo; }; -struct CellDmuxType +struct CellDmuxType { be_t streamType; // CellDmuxStreamType be_t reserved[2]; @@ -223,7 +223,7 @@ using CellDmuxCbMsg = u32(u32 demuxerHandle, vm::ptr demuxerMsg, u3 struct CellDmuxCb { - vm::bptr cbMsgFunc; + vm::bptr cbMsgFunc; be_t cbArg; }; diff --git a/rpcs3/Emu/Cell/Modules/cellFiber.h b/rpcs3/Emu/Cell/Modules/cellFiber.h index 860b94f2cc..d1b3732fa4 100644 --- a/rpcs3/Emu/Cell/Modules/cellFiber.h +++ b/rpcs3/Emu/Cell/Modules/cellFiber.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return Codes enum CellFiberError : u32 diff --git a/rpcs3/Emu/Cell/Modules/cellFont.h b/rpcs3/Emu/Cell/Modules/cellFont.h index 0b1d3274a0..905f142102 100644 --- a/rpcs3/Emu/Cell/Modules/cellFont.h +++ b/rpcs3/Emu/Cell/Modules/cellFont.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellFontFT.h b/rpcs3/Emu/Cell/Modules/cellFontFT.h index 37f8204062..cf8255322a 100644 --- a/rpcs3/Emu/Cell/Modules/cellFontFT.h +++ b/rpcs3/Emu/Cell/Modules/cellFontFT.h @@ -2,7 +2,7 @@ #include "cellFont.h" -namespace vm { using namespace ps3; } + struct CellFontLibraryConfigFT { diff --git a/rpcs3/Emu/Cell/Modules/cellFs.cpp b/rpcs3/Emu/Cell/Modules/cellFs.cpp index b67f531d0b..288581343b 100644 --- a/rpcs3/Emu/Cell/Modules/cellFs.cpp +++ b/rpcs3/Emu/Cell/Modules/cellFs.cpp @@ -11,7 +11,7 @@ #include -namespace vm { using namespace ps3; } + logs::channel cellFs("cellFs"); @@ -417,7 +417,7 @@ error_code cellFsGetDirectoryEntries(u32 fd, vm::ptr entri return CellError(+op->arg._code); } - return not_an_error(rc); + return not_an_error(rc); } error_code cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr buf, u64 buffer_size, vm::ptr nread) @@ -433,7 +433,7 @@ error_code cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr buf, u64 buffe vm::var arg; arg->_vtable = vm::cast(0xfa8a0000); // Intentionally wrong (provide correct vtable if necessary) - + arg->op = 0x8000000a; arg->fd = fd; arg->buf = buf; @@ -447,7 +447,7 @@ error_code cellFsReadWithOffset(u32 fd, u64 offset, vm::ptr buf, u64 buffe { *nread = rc && rc != CELL_EFSSPECIFIC ? 0 : arg->out_size.value(); } - + if (!rc && arg->out_code) { return CellError(+arg->out_code); @@ -475,7 +475,7 @@ error_code cellFsWriteWithOffset(u32 fd, u64 offset, vm::cptr buf, u64 dat vm::var arg; arg->_vtable = vm::cast(0xfa8b0000); // Intentionally wrong (provide correct vtable if necessary) - + arg->op = 0x8000000b; arg->fd = fd; arg->buf = vm::const_ptr_cast(buf); @@ -623,7 +623,7 @@ error_code cellFsAllocateFileAreaWithoutZeroFill(vm::cptr path, u64 size) { return CellError(rc); } - + return CELL_OK; } @@ -670,7 +670,7 @@ s32 cellFsStReadInit(u32 fd, vm::cptr ringbuf) { return CELL_EBADF; } - + if (file->flags & CELL_FS_O_WRONLY) { return CELL_EPERM; @@ -780,7 +780,7 @@ s32 cellFsStReadStop(u32 fd) s32 cellFsStRead(u32 fd, vm::ptr buf, u64 size, vm::ptr rsize) { cellFs.todo("cellFsStRead(fd=%d, buf=*0x%x, size=0x%llx, rsize=*0x%x)", fd, buf, size, rsize); - + const auto file = idm::get(fd); if (!file) @@ -812,7 +812,7 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr addr, vm::ptr size) s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr addr, u64 size) { cellFs.todo("cellFsStReadPutCurrentAddr(fd=%d, addr=*0x%x, size=0x%llx)", fd, addr, size); - + const auto file = idm::get(fd); if (!file) @@ -828,7 +828,7 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr addr, u64 size) s32 cellFsStReadWait(u32 fd, u64 size) { cellFs.todo("cellFsStReadWait(fd=%d, size=0x%llx)", fd, size); - + const auto file = idm::get(fd); if (!file) @@ -837,7 +837,7 @@ s32 cellFsStReadWait(u32 fd, u64 size) } // TODO - + return CELL_OK; } @@ -853,7 +853,7 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr } // TODO - + return CELL_OK; } diff --git a/rpcs3/Emu/Cell/Modules/cellGame.h b/rpcs3/Emu/Cell/Modules/cellGame.h index 47a8a651e2..55dedb6653 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.h +++ b/rpcs3/Emu/Cell/Modules/cellGame.h @@ -2,7 +2,7 @@ #include "Emu/Cell/ErrorCodes.h" -namespace vm { using namespace ps3; } + // Return Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellGcmSys.h b/rpcs3/Emu/Cell/Modules/cellGcmSys.h index 1c4109cbcb..59583ce442 100644 --- a/rpcs3/Emu/Cell/Modules/cellGcmSys.h +++ b/rpcs3/Emu/Cell/Modules/cellGcmSys.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + #include "Emu/RSX/GCM.h" diff --git a/rpcs3/Emu/Cell/Modules/cellGem.h b/rpcs3/Emu/Cell/Modules/cellGem.h index de85d72055..62c90d5883 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.h +++ b/rpcs3/Emu/Cell/Modules/cellGem.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + static const float CELL_GEM_SPHERE_RADIUS_MM = 22.5f; diff --git a/rpcs3/Emu/Cell/Modules/cellGifDec.h b/rpcs3/Emu/Cell/Modules/cellGifDec.h index 947a424796..be4b6aad82 100644 --- a/rpcs3/Emu/Cell/Modules/cellGifDec.h +++ b/rpcs3/Emu/Cell/Modules/cellGifDec.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellHttp.h b/rpcs3/Emu/Cell/Modules/cellHttp.h index 3b6ad50d21..2c014b9501 100644 --- a/rpcs3/Emu/Cell/Modules/cellHttp.h +++ b/rpcs3/Emu/Cell/Modules/cellHttp.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // libHttp = 0x80710001 - 0x80710fff // libHttps = 0x80710a01 - 0x80710aff @@ -10,10 +10,10 @@ enum { CELL_HTTP_NET_ERROR_TYPE_MASK = 0xffffff00, CELL_HTTP_NET_ERROR_MASK = 0xff, - + // CELL_HTTP_NET_ERROR // CELL_HTTP_IS_NET_RESOLVER_ERROR - + CELL_HTTP_ERROR_ALREADY_INITIALIZED = 0x80710001, CELL_HTTP_ERROR_NOT_INITIALIZED = 0x80710002, CELL_HTTP_ERROR_NO_MEMORY = 0x80710003, @@ -48,7 +48,7 @@ enum CELL_HTTP_ERROR_CACHE_NOT_INITIALIZED = 0x80710044, CELL_HTTP_ERROR_LINE_EXCEEDS_MAX = 0x80710045, CELL_HTTP_ERROR_REQUIRES_BASIC_AUTH = 0x80710046, - + CELL_HTTP_ERROR_UNKNOWN = 0x80710051, CELL_HTTP_ERROR_INTERNAL = 0x80710052, CELL_HTTP_ERROR_NONREMOVABLE = 0x80710053, @@ -62,7 +62,7 @@ enum CELL_HTTP_ERROR_DECODE_SETUP = 0x8071005b, CELL_HTTP_ERROR_DECODE_STREAM = 0x8071005c, CELL_HTTP_ERROR_BROKEN_DECODE_STREAM = 0x8071005d, - + CELL_HTTP_ERROR_INVALID_DCACHE_PATH = 0x80710060, CELL_HTTP_ERROR_DCACHE_ALREADY_INITIALIZED = 0x80710061, CELL_HTTP_ERROR_DCACHE_NOT_INITIALIZED = 0x80710062, @@ -94,12 +94,12 @@ enum CELL_HTTP_ERROR_DCACHE_ABORTED = 0x80710082, CELL_HTTP_ERROR_DCACHE_INDEX_IS_CLOSING = 0x80710083, CELL_HTTP_ERROR_DCACHE_UNKNOWN_INDEX_STATE = 0x80710084, - + CELL_HTTP_ERROR_NET_FIN = 0x80710091, CELL_HTTP_ERROR_NET_CONNECT_TIMEOUT = 0x80710092, CELL_HTTP_ERROR_NET_SELECT_TIMEOUT = 0x80710093, CELL_HTTP_ERROR_NET_SEND_TIMEOUT = 0x80710094, - + CELL_HTTP_ERROR_NET_RESOLVER = 0x80710100, CELL_HTTP_ERROR_NET_ABORT = 0x80710200, CELL_HTTP_ERROR_NET_OPTION = 0x80710300, diff --git a/rpcs3/Emu/Cell/Modules/cellHttpUtil.h b/rpcs3/Emu/Cell/Modules/cellHttpUtil.h index d6c10b5c7a..3d2f324249 100644 --- a/rpcs3/Emu/Cell/Modules/cellHttpUtil.h +++ b/rpcs3/Emu/Cell/Modules/cellHttpUtil.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // libHttp_Util: 0x80711001 - 0x807110ff diff --git a/rpcs3/Emu/Cell/Modules/cellImeJp.h b/rpcs3/Emu/Cell/Modules/cellImeJp.h index cfed9b257f..617d67820d 100644 --- a/rpcs3/Emu/Cell/Modules/cellImeJp.h +++ b/rpcs3/Emu/Cell/Modules/cellImeJp.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + typedef vm::ptr CellImeJpHandle; @@ -17,11 +17,9 @@ enum { CELL_IMEJP_MOVE_CLAUSE_GAP = 8, }; -//cellImeJpEnterChar, returning values pointed in pOutputStatus. +//cellImeJpEnterChar, returning values pointed in pOutputStatus. enum { CELL_IMEJP_RET_NONE = 0, CELL_IMEJP_RET_THROUGH = 1, CELL_IMEJP_RET_CONFIRMED = 2, }; - - diff --git a/rpcs3/Emu/Cell/Modules/cellJpgDec.h b/rpcs3/Emu/Cell/Modules/cellJpgDec.h index cabffcbd25..eda7fc4682 100644 --- a/rpcs3/Emu/Cell/Modules/cellJpgDec.h +++ b/rpcs3/Emu/Cell/Modules/cellJpgDec.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + //Return Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellJpgEnc.h b/rpcs3/Emu/Cell/Modules/cellJpgEnc.h index 154def9f5a..89fd0961f3 100644 --- a/rpcs3/Emu/Cell/Modules/cellJpgEnc.h +++ b/rpcs3/Emu/Cell/Modules/cellJpgEnc.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum @@ -11,7 +11,7 @@ enum CELL_JPGENC_ERROR_EMPTY = 0x80611194, CELL_JPGENC_ERROR_RESET = 0x80611195, CELL_JPGENC_ERROR_FATAL = 0x80611196, - + CELL_JPGENC_ERROR_STREAM_ABORT = 0x806111A1, CELL_JPGENC_ERROR_STREAM_SKIP = 0x806111A2, CELL_JPGENC_ERROR_STREAM_OVERFLOW = 0x806111A3, @@ -26,19 +26,19 @@ enum CELL_JPGENC_COLOR_SPACE_YCbCr = 3, CELL_JPGENC_COLOR_SPACE_RGBA = 10, CELL_JPGENC_COLOR_SPACE_ARGB = 20, - + CELL_JPGENC_SAMPLING_FMT_YCbCr444, CELL_JPGENC_SAMPLING_FMT_YCbCr422, CELL_JPGENC_SAMPLING_FMT_YCbCr420, CELL_JPGENC_SAMPLING_FMT_YCbCr411, CELL_JPGENC_SAMPLING_FMT_FULL, - + CELL_JPGENC_DCT_METHOD_QUALITY = 0, CELL_JPGENC_DCT_METHOD_FAST = 5, - + CELL_JPGENC_COMPR_MODE_CONSTANT_QUALITY, CELL_JPGENC_COMPR_MODE_STREAM_SIZE_LIMIT, - + CELL_JPGENC_LOCATION_FILE, CELL_JPGENC_LOCATION_BUFFER, }; diff --git a/rpcs3/Emu/Cell/Modules/cellKb.cpp b/rpcs3/Emu/Cell/Modules/cellKb.cpp index 0c80f816ad..cb9b98ac75 100644 --- a/rpcs3/Emu/Cell/Modules/cellKb.cpp +++ b/rpcs3/Emu/Cell/Modules/cellKb.cpp @@ -6,7 +6,7 @@ #include "Emu/Io/KeyboardHandler.h" #include "cellKb.h" -namespace vm { using namespace ps3; } + extern logs::channel sys_io; @@ -95,8 +95,8 @@ u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode) // ASCII if (rawcode >= 0x04 && rawcode <= 0x1D) // 'A' - 'Z' { - rawcode -= - (mkey&(CELL_KB_MKEY_L_SHIFT|CELL_KB_MKEY_R_SHIFT)) ? + rawcode -= + (mkey&(CELL_KB_MKEY_L_SHIFT|CELL_KB_MKEY_R_SHIFT)) ? ((led&(CELL_KB_LED_CAPS_LOCK)) ? 0 : 0x20) : ((led&(CELL_KB_LED_CAPS_LOCK)) ? 0x20 : 0); return rawcode + 0x5D; diff --git a/rpcs3/Emu/Cell/Modules/cellKey2char.cpp b/rpcs3/Emu/Cell/Modules/cellKey2char.cpp index ae22106228..58bd287588 100644 --- a/rpcs3/Emu/Cell/Modules/cellKey2char.cpp +++ b/rpcs3/Emu/Cell/Modules/cellKey2char.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } + logs::channel cellKey2char("cellKey2char"); diff --git a/rpcs3/Emu/Cell/Modules/cellL10n.h b/rpcs3/Emu/Cell/Modules/cellL10n.h index f51cae868e..2a70dfb58f 100644 --- a/rpcs3/Emu/Cell/Modules/cellL10n.h +++ b/rpcs3/Emu/Cell/Modules/cellL10n.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // L10nResult enum diff --git a/rpcs3/Emu/Cell/Modules/cellMic.h b/rpcs3/Emu/Cell/Modules/cellMic.h index 2050f5aa79..2a64e4d0f2 100644 --- a/rpcs3/Emu/Cell/Modules/cellMic.h +++ b/rpcs3/Emu/Cell/Modules/cellMic.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellMouse.h b/rpcs3/Emu/Cell/Modules/cellMouse.h index ab6edbec3a..e407003814 100644 --- a/rpcs3/Emu/Cell/Modules/cellMouse.h +++ b/rpcs3/Emu/Cell/Modules/cellMouse.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + enum { diff --git a/rpcs3/Emu/Cell/Modules/cellMsgDialog.h b/rpcs3/Emu/Cell/Modules/cellMsgDialog.h index 6f989f0af2..ad0412283f 100644 --- a/rpcs3/Emu/Cell/Modules/cellMsgDialog.h +++ b/rpcs3/Emu/Cell/Modules/cellMsgDialog.h @@ -2,7 +2,7 @@ #include "Utilities/BitField.h" -namespace vm { using namespace ps3; } + enum { diff --git a/rpcs3/Emu/Cell/Modules/cellMusic.cpp b/rpcs3/Emu/Cell/Modules/cellMusic.cpp index 04ca0f964b..3da1d60dc0 100644 --- a/rpcs3/Emu/Cell/Modules/cellMusic.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMusic.cpp @@ -6,7 +6,7 @@ #include "cellMusic.h" #include "cellSysutil.h" -namespace vm { using namespace ps3; } + logs::channel cellMusic("cellMusic"); @@ -18,115 +18,115 @@ struct music2_t s32 cellMusicGetSelectionContext() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicSetSelectionContext2() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicSetVolume2() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicGetContentsId() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicSetSelectionContext() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicInitialize2SystemWorkload() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicGetPlaybackStatus2() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicGetContentsId2() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicFinalize() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicInitializeSystemWorkload() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicInitialize() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicFinalize2() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicGetSelectionContext2() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicGetVolume() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicGetPlaybackStatus() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicSetPlaybackCommand2() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicSetPlaybackCommand() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicSelectContents2() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicSelectContents() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } @@ -155,13 +155,13 @@ s32 cellMusicInitialize2(s32 mode, s32 spuPriority, vm::ptr s32 cellMusicSetVolume() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } s32 cellMusicGetVolume2() { - UNIMPLEMENTED_FUNC(cellMusic); + UNIMPLEMENTED_FUNC(cellMusic); return CELL_OK; } diff --git a/rpcs3/Emu/Cell/Modules/cellMusic.h b/rpcs3/Emu/Cell/Modules/cellMusic.h index 92d21a1260..8ed707268c 100644 --- a/rpcs3/Emu/Cell/Modules/cellMusic.h +++ b/rpcs3/Emu/Cell/Modules/cellMusic.h @@ -120,8 +120,8 @@ enum CELL_MUSIC_SELECTION_CONTEXT_SIZE = 2048, }; -using CellMusicCallback = void(u32 event, vm::ps3::ptr param, vm::ps3::ptr userData); -using CellMusic2Callback = void(u32 event, vm::ps3::ptr param, vm::ps3::ptr userData); +using CellMusicCallback = void(u32 event, vm::ptr param, vm::ptr userData); +using CellMusic2Callback = void(u32 event, vm::ptr param, vm::ptr userData); struct CellMusicSelectionContext { diff --git a/rpcs3/Emu/Cell/Modules/cellMusicDecode.cpp b/rpcs3/Emu/Cell/Modules/cellMusicDecode.cpp index 0127f06260..24b4ef2d6f 100644 --- a/rpcs3/Emu/Cell/Modules/cellMusicDecode.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMusicDecode.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } + logs::channel cellMusicDecode("cellMusicDecode"); diff --git a/rpcs3/Emu/Cell/Modules/cellMusicExport.cpp b/rpcs3/Emu/Cell/Modules/cellMusicExport.cpp index c63b192e21..cdd09658e0 100644 --- a/rpcs3/Emu/Cell/Modules/cellMusicExport.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMusicExport.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } + logs::channel cellMusicExport("cellMusicExport"); diff --git a/rpcs3/Emu/Cell/Modules/cellNetCtl.h b/rpcs3/Emu/Cell/Modules/cellNetCtl.h index 81fb946440..1ebc683efa 100644 --- a/rpcs3/Emu/Cell/Modules/cellNetCtl.h +++ b/rpcs3/Emu/Cell/Modules/cellNetCtl.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum CellNetCtlError : u32 diff --git a/rpcs3/Emu/Cell/Modules/cellOskDialog.h b/rpcs3/Emu/Cell/Modules/cellOskDialog.h index eb065d3e7e..9fc7555bfa 100644 --- a/rpcs3/Emu/Cell/Modules/cellOskDialog.h +++ b/rpcs3/Emu/Cell/Modules/cellOskDialog.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + //error codes enum @@ -92,7 +92,7 @@ enum CellOskDialogType CELL_OSKDIALOG_TYPE_SEPARATE_CANDIDATE_WINDOW = 8, }; -enum +enum { CELL_OSKDIALOG_STRING_SIZE = 512, //Theroretical maxium for osk input, games can specify a lower limit }; diff --git a/rpcs3/Emu/Cell/Modules/cellOvis.cpp b/rpcs3/Emu/Cell/Modules/cellOvis.cpp index c40e73a9e0..05593f449f 100644 --- a/rpcs3/Emu/Cell/Modules/cellOvis.cpp +++ b/rpcs3/Emu/Cell/Modules/cellOvis.cpp @@ -2,7 +2,7 @@ #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_spu.h" -namespace vm { using namespace ps3; } + logs::channel cellOvis("cellOvis"); diff --git a/rpcs3/Emu/Cell/Modules/cellPad.h b/rpcs3/Emu/Cell/Modules/cellPad.h index 47deac7c23..92695769de 100644 --- a/rpcs3/Emu/Cell/Modules/cellPad.h +++ b/rpcs3/Emu/Cell/Modules/cellPad.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + enum { diff --git a/rpcs3/Emu/Cell/Modules/cellPamf.h b/rpcs3/Emu/Cell/Modules/cellPamf.h index 674b229710..4952aa7544 100644 --- a/rpcs3/Emu/Cell/Modules/cellPamf.h +++ b/rpcs3/Emu/Cell/Modules/cellPamf.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum @@ -38,7 +38,7 @@ enum CELL_PAMF_FS_48kHz = 1, }; -enum +enum { CELL_PAMF_BIT_LENGTH_16 = 1, CELL_PAMF_BIT_LENGTH_24 = 3, @@ -60,7 +60,7 @@ enum CELL_PAMF_AVC_LEVEL_4P2 = 42, }; -enum +enum { CELL_PAMF_AVC_FRC_24000DIV1001 = 0, CELL_PAMF_AVC_FRC_24 = 1, @@ -263,7 +263,7 @@ struct PamfStreamHeader u8 unknown2; be_t ep_offset; // offset of EP section in header be_t ep_num; // count of EPs - + union { u8 data[32]; // specific info diff --git a/rpcs3/Emu/Cell/Modules/cellPhotoDecode.cpp b/rpcs3/Emu/Cell/Modules/cellPhotoDecode.cpp index 92ec06bc22..222e9b5fe3 100644 --- a/rpcs3/Emu/Cell/Modules/cellPhotoDecode.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPhotoDecode.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } + logs::channel cellPhotoDecode("cellPhotoDecode"); @@ -18,14 +18,14 @@ enum // Datatypes struct CellPhotoDecodeSetParam -{ +{ u32 dstBuffer_addr; u16 width; u16 height; }; struct CellPhotoDecodeReturnParam -{ +{ u16 width; u16 height; }; diff --git a/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp b/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp index 0b2024abd8..093e1ab158 100644 --- a/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPhotoExport.cpp @@ -2,7 +2,7 @@ #include "Emu/Cell/PPUModule.h" #include "cellSysutil.h" -namespace vm { using namespace ps3; } + logs::channel cellPhotoExport("cellPhotoExport"); diff --git a/rpcs3/Emu/Cell/Modules/cellPhotoImport.cpp b/rpcs3/Emu/Cell/Modules/cellPhotoImport.cpp index 32b96cb506..a938d4719f 100644 --- a/rpcs3/Emu/Cell/Modules/cellPhotoImport.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPhotoImport.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } + logs::channel cellPhotoImportUtil("cellPhotoImportUtil"); @@ -18,24 +18,24 @@ enum // Datatypes struct CellPhotoImportFileDataSub -{ +{ int width; int height; - //CellPhotoImportFormatType format; - //CellPhotoImportTexRot rotate; -}; + //CellPhotoImportFormatType format; + //CellPhotoImportTexRot rotate; +}; struct CellPhotoImportFileData -{ - char dstFileName; //[CELL_FS_MAX_FS_FILE_NAME_LENGTH]; - char photo_title; //[CELL_PHOTO_IMPORT_PHOTO_TITLE_MAX_LENGTH*3]; - char game_title; //[CELL_PHOTO_IMPORT_GAME_TITLE_MAX_SIZE]; - char game_comment; //[CELL_PHOTO_IMPORT_GAME_COMMENT_MAX_SIZE]; - CellPhotoImportFileDataSub* data_sub; +{ + char dstFileName; //[CELL_FS_MAX_FS_FILE_NAME_LENGTH]; + char photo_title; //[CELL_PHOTO_IMPORT_PHOTO_TITLE_MAX_LENGTH*3]; + char game_title; //[CELL_PHOTO_IMPORT_GAME_TITLE_MAX_SIZE]; + char game_comment; //[CELL_PHOTO_IMPORT_GAME_COMMENT_MAX_SIZE]; + CellPhotoImportFileDataSub* data_sub; }; struct CellPhotoImportSetParam -{ +{ unsigned int fileSizeMax; }; diff --git a/rpcs3/Emu/Cell/Modules/cellPng.h b/rpcs3/Emu/Cell/Modules/cellPng.h index b744ca602f..00e02b54d6 100644 --- a/rpcs3/Emu/Cell/Modules/cellPng.h +++ b/rpcs3/Emu/Cell/Modules/cellPng.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + enum CellPngTxtType : s32 { diff --git a/rpcs3/Emu/Cell/Modules/cellPngDec.h b/rpcs3/Emu/Cell/Modules/cellPngDec.h index 85fc9de79b..0377e7ed41 100644 --- a/rpcs3/Emu/Cell/Modules/cellPngDec.h +++ b/rpcs3/Emu/Cell/Modules/cellPngDec.h @@ -1,5 +1,5 @@ #pragma once -namespace vm { using namespace ps3; } + #include "cellPng.h" @@ -328,7 +328,7 @@ static s32 getPngDecColourType(u8 type) static bool cellPngColorSpaceHasAlpha(u32 colorspace) { - switch (colorspace) + switch (colorspace) { case CELL_PNGDEC_RGBA: case CELL_PNGDEC_ARGB: diff --git a/rpcs3/Emu/Cell/Modules/cellRec.cpp b/rpcs3/Emu/Cell/Modules/cellRec.cpp index 1525594613..5a4f4d9338 100644 --- a/rpcs3/Emu/Cell/Modules/cellRec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellRec.cpp @@ -3,7 +3,7 @@ #include "Emu/IdManager.h" #include "cellSysutil.h" -namespace vm { using namespace ps3; } + logs::channel cellRec("cellRec"); diff --git a/rpcs3/Emu/Cell/Modules/cellResc.h b/rpcs3/Emu/Cell/Modules/cellResc.h index a4b135d5ac..5a37f43fd0 100644 --- a/rpcs3/Emu/Cell/Modules/cellResc.h +++ b/rpcs3/Emu/Cell/Modules/cellResc.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + enum { @@ -27,33 +27,33 @@ enum enum CellRescBufferMode { - CELL_RESC_720x480 = 0x1, - CELL_RESC_720x576 = 0x2, - CELL_RESC_1280x720 = 0x4, - CELL_RESC_1920x1080 = 0x8, + CELL_RESC_720x480 = 0x1, + CELL_RESC_720x576 = 0x2, + CELL_RESC_1280x720 = 0x4, + CELL_RESC_1920x1080 = 0x8, }; enum CellRescPalTemporalMode { - CELL_RESC_PAL_50 = 0, - CELL_RESC_PAL_60_DROP = 1, - CELL_RESC_PAL_60_INTERPOLATE = 2, - CELL_RESC_PAL_60_INTERPOLATE_30_DROP = 3, - CELL_RESC_PAL_60_INTERPOLATE_DROP_FLEXIBLE = 4, - CELL_RESC_PAL_60_FOR_HSYNC = 5, + CELL_RESC_PAL_50 = 0, + CELL_RESC_PAL_60_DROP = 1, + CELL_RESC_PAL_60_INTERPOLATE = 2, + CELL_RESC_PAL_60_INTERPOLATE_30_DROP = 3, + CELL_RESC_PAL_60_INTERPOLATE_DROP_FLEXIBLE = 4, + CELL_RESC_PAL_60_FOR_HSYNC = 5, }; enum CellRescRatioConvertMode { - CELL_RESC_FULLSCREEN = 0, - CELL_RESC_LETTERBOX = 1, - CELL_RESC_PANSCAN = 2, + CELL_RESC_FULLSCREEN = 0, + CELL_RESC_LETTERBOX = 1, + CELL_RESC_PANSCAN = 2, }; enum CellRescFlipMode { - CELL_RESC_DISPLAY_VSYNC = 0, - CELL_RESC_DISPLAY_HSYNC = 1, + CELL_RESC_DISPLAY_VSYNC = 0, + CELL_RESC_DISPLAY_HSYNC = 1, }; enum CellRescDstFormat @@ -64,18 +64,18 @@ enum CellRescDstFormat enum CellRescResourcePolicy { - CELL_RESC_CONSTANT_VRAM = 0x0, - CELL_RESC_MINIMUM_VRAM = 0x1, - CELL_RESC_MINIMUM_GPU_LOAD = 0x2, + CELL_RESC_CONSTANT_VRAM = 0x0, + CELL_RESC_MINIMUM_VRAM = 0x1, + CELL_RESC_MINIMUM_GPU_LOAD = 0x2, }; enum CellRescConvolutionFilterMode { - CELL_RESC_NORMAL_BILINEAR = 0, - CELL_RESC_INTERLACE_FILTER = 1, - CELL_RESC_3X3_GAUSSIAN = 2, - CELL_RESC_2X3_QUINCUNX = 3, - CELL_RESC_2X3_QUINCUNX_ALT = 4, + CELL_RESC_NORMAL_BILINEAR = 0, + CELL_RESC_INTERLACE_FILTER = 1, + CELL_RESC_3X3_GAUSSIAN = 2, + CELL_RESC_2X3_QUINCUNX = 3, + CELL_RESC_2X3_QUINCUNX_ALT = 4, }; struct CellRescDsts diff --git a/rpcs3/Emu/Cell/Modules/cellRtc.h b/rpcs3/Emu/Cell/Modules/cellRtc.h index 2c51bac05e..878e220a95 100644 --- a/rpcs3/Emu/Cell/Modules/cellRtc.h +++ b/rpcs3/Emu/Cell/Modules/cellRtc.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellRudp.h b/rpcs3/Emu/Cell/Modules/cellRudp.h index 95d9f34530..75b9d3905d 100644 --- a/rpcs3/Emu/Cell/Modules/cellRudp.h +++ b/rpcs3/Emu/Cell/Modules/cellRudp.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellSail.h b/rpcs3/Emu/Cell/Modules/cellSail.h index 097659b5a9..73509e5546 100644 --- a/rpcs3/Emu/Cell/Modules/cellSail.h +++ b/rpcs3/Emu/Cell/Modules/cellSail.h @@ -2,7 +2,7 @@ #include "cellVpost.h" -namespace vm { using namespace ps3; } + // Error Codes enum @@ -157,8 +157,8 @@ enum _CELL_SAIL_PARAMETER_TYPE_NUM_OF_ELEMENTS = 36, // Should be never used CELL_SAIL_PARAMETER_SOURCE_PPU_THREAD_PRIORITY = CELL_SAIL_PARAMETER_IO_PPU_THREAD_PRIORITY, CELL_SAIL_PARAMETER_DMUX_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_DMUX_SPURS_TASK_PRIORITIES, // Deprecated - CELL_SAIL_PARAMETER_VDEC_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_VDEC_SPURS_TASK_PRIORITIES, // Deprecated - CELL_SAIL_PARAMETER_ADEC_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_ADEC_SPURS_TASK_PRIORITIES, // Deprecated + CELL_SAIL_PARAMETER_VDEC_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_VDEC_SPURS_TASK_PRIORITIES, // Deprecated + CELL_SAIL_PARAMETER_ADEC_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_ADEC_SPURS_TASK_PRIORITIES, // Deprecated CELL_SAIL_PARAMETER_VPOST_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_VPOST_SPURS_TASK_PRIORITIES, // Deprecated }; @@ -367,7 +367,7 @@ enum // 5. Back Right // 6. Back Center // 7. LFE - // (for at3plus) + // (for at3plus) CELL_SAIL_AUDIO_CH_LAYOUT_7CH_LCRxycE = 10, // 1. Front Left @@ -1035,7 +1035,7 @@ struct CellSailAviMediaType union u { struct audio { be_t formatTag; - be_t reserved; // Specify 0 + be_t reserved; // Specify 0 union u { struct mpeg { be_t headLayer; // Specify 0 diff --git a/rpcs3/Emu/Cell/Modules/cellSaveData.h b/rpcs3/Emu/Cell/Modules/cellSaveData.h index 216999fc22..5793feb7a5 100644 --- a/rpcs3/Emu/Cell/Modules/cellSaveData.h +++ b/rpcs3/Emu/Cell/Modules/cellSaveData.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return codes enum @@ -16,7 +16,7 @@ enum CELL_SAVEDATA_ERROR_NOUSER = 0x8002b409, CELL_SAVEDATA_ERROR_SIZEOVER = 0x8002b40a, CELL_SAVEDATA_ERROR_NODATA = 0x8002b40b, - CELL_SAVEDATA_ERROR_NOTSUPPORTED = 0x8002b40c, + CELL_SAVEDATA_ERROR_NOTSUPPORTED = 0x8002b40c, }; // Callback return codes @@ -97,7 +97,7 @@ enum // Datatypes struct CellSaveDataSetList -{ +{ be_t sortType; be_t sortOrder; vm::bptr dirNamePrefix; @@ -105,7 +105,7 @@ struct CellSaveDataSetList }; struct CellSaveDataSetBuf -{ +{ be_t dirListMax; be_t fileListMax; be_t reserved[6]; @@ -113,16 +113,16 @@ struct CellSaveDataSetBuf vm::bptr buf; }; -struct CellSaveDataNewDataIcon -{ +struct CellSaveDataNewDataIcon +{ vm::bptr title; be_t iconBufSize; vm::bptr iconBuf; vm::bptr reserved; }; -struct CellSaveDataListNewData -{ +struct CellSaveDataListNewData +{ be_t iconPosition; vm::bptr dirName; vm::bptr icon; @@ -130,14 +130,14 @@ struct CellSaveDataListNewData }; struct CellSaveDataDirList -{ - char dirName[CELL_SAVEDATA_DIRNAME_SIZE]; +{ + char dirName[CELL_SAVEDATA_DIRNAME_SIZE]; char listParam[CELL_SAVEDATA_SYSP_LPARAM_SIZE]; char reserved[8]; }; struct CellSaveDataListGet -{ +{ be_t dirNum; be_t dirListNum; vm::bptr dirList; @@ -145,7 +145,7 @@ struct CellSaveDataListGet }; struct CellSaveDataListSet -{ +{ be_t focusPosition; vm::bptr focusDirName; be_t fixedListNum; @@ -155,45 +155,45 @@ struct CellSaveDataListSet }; struct CellSaveDataFixedSet -{ +{ vm::bptr dirName; vm::bptr newIcon; be_t option; }; -struct CellSaveDataSystemFileParam -{ - char title[CELL_SAVEDATA_SYSP_TITLE_SIZE]; - char subTitle[CELL_SAVEDATA_SYSP_SUBTITLE_SIZE]; - char detail[CELL_SAVEDATA_SYSP_DETAIL_SIZE]; - be_t attribute; - char reserved2[4]; - char listParam[CELL_SAVEDATA_SYSP_LPARAM_SIZE]; - char reserved[256]; +struct CellSaveDataSystemFileParam +{ + char title[CELL_SAVEDATA_SYSP_TITLE_SIZE]; + char subTitle[CELL_SAVEDATA_SYSP_SUBTITLE_SIZE]; + char detail[CELL_SAVEDATA_SYSP_DETAIL_SIZE]; + be_t attribute; + char reserved2[4]; + char listParam[CELL_SAVEDATA_SYSP_LPARAM_SIZE]; + char reserved[256]; }; struct CellSaveDataDirStat -{ +{ be_t atime; be_t mtime; be_t ctime; - char dirName[CELL_SAVEDATA_DIRNAME_SIZE]; + char dirName[CELL_SAVEDATA_DIRNAME_SIZE]; }; struct CellSaveDataFileStat -{ +{ be_t fileType; char reserved1[4]; be_t size; be_t atime; be_t mtime; be_t ctime; - char fileName[CELL_SAVEDATA_FILENAME_SIZE]; + char fileName[CELL_SAVEDATA_FILENAME_SIZE]; char reserved2[3]; }; struct CellSaveDataStatGet -{ +{ be_t hddFreeSizeKB; be_t isNewData; CellSaveDataDirStat dir; @@ -208,7 +208,7 @@ struct CellSaveDataStatGet }; struct CellSaveDataAutoIndicator -{ +{ be_t dispPosition; be_t dispMode; vm::bptr dispMsg; @@ -217,25 +217,25 @@ struct CellSaveDataAutoIndicator vm::bptr reserved; }; -struct CellSaveDataStatSet -{ +struct CellSaveDataStatSet +{ vm::bptr setParam; be_t reCreateMode; vm::bptr indicator; }; struct CellSaveDataFileGet -{ +{ be_t excSize; char reserved[64]; -}; +}; -struct CellSaveDataFileSet -{ +struct CellSaveDataFileSet +{ be_t fileOperation; vm::bptr reserved; be_t fileType; - u8 secureFileId[CELL_SAVEDATA_SECUREFILEID_SIZE]; + u8 secureFileId[CELL_SAVEDATA_SECUREFILEID_SIZE]; vm::bptr fileName; be_t fileOffset; be_t fileSize; @@ -243,8 +243,8 @@ struct CellSaveDataFileSet vm::bptr fileBuf; }; -struct CellSaveDataCBResult -{ +struct CellSaveDataCBResult +{ be_t result; be_t progressBarInc; be_t errNeedSizeKB; @@ -253,9 +253,9 @@ struct CellSaveDataCBResult }; struct CellSaveDataDoneGet -{ +{ be_t excResult; - char dirName[CELL_SAVEDATA_DIRNAME_SIZE]; + char dirName[CELL_SAVEDATA_DIRNAME_SIZE]; be_t sizeKB; be_t hddFreeSizeKB; char reserved[64]; diff --git a/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp b/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp index f6c5d14ae3..f0f67d88fa 100644 --- a/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp +++ b/rpcs3/Emu/Cell/Modules/cellScreenshot.cpp @@ -4,7 +4,7 @@ #include "cellScreenshot.h" -namespace vm { using namespace ps3; } + logs::channel cellScreenshot("cellScreenshot"); diff --git a/rpcs3/Emu/Cell/Modules/cellScreenshot.h b/rpcs3/Emu/Cell/Modules/cellScreenshot.h index a427b4d257..e7e45066cb 100644 --- a/rpcs3/Emu/Cell/Modules/cellScreenshot.h +++ b/rpcs3/Emu/Cell/Modules/cellScreenshot.h @@ -12,7 +12,7 @@ enum struct CellScreenShotSetParam { - vm::ps3::bcptr photo_title; - vm::ps3::bcptr game_title; - vm::ps3::bcptr game_comment; + vm::bcptr photo_title; + vm::bcptr game_title; + vm::bcptr game_comment; }; diff --git a/rpcs3/Emu/Cell/Modules/cellSearch.h b/rpcs3/Emu/Cell/Modules/cellSearch.h index bef91358ca..c7c04594a0 100644 --- a/rpcs3/Emu/Cell/Modules/cellSearch.h +++ b/rpcs3/Emu/Cell/Modules/cellSearch.h @@ -226,7 +226,7 @@ enum CellSearchSharableType : s32 }; using CellSearchId = s32; -using CellSearchSystemCallback = void(CellSearchEvent event, s32 result, vm::ps3::cptr param, vm::ps3::ptr userData); +using CellSearchSystemCallback = void(CellSearchEvent event, s32 result, vm::cptr param, vm::ptr userData); struct CellSearchContentId { diff --git a/rpcs3/Emu/Cell/Modules/cellSpudll.cpp b/rpcs3/Emu/Cell/Modules/cellSpudll.cpp index 9512b5d921..3295732921 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpudll.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSpudll.cpp @@ -3,7 +3,7 @@ #include "cellSpudll.h" -namespace vm { using namespace ps3; } + logs::channel cellSpudll("cellSpudll"); diff --git a/rpcs3/Emu/Cell/Modules/cellSpudll.h b/rpcs3/Emu/Cell/Modules/cellSpudll.h index 7fd1bfa4de..e78ab66717 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpudll.h +++ b/rpcs3/Emu/Cell/Modules/cellSpudll.h @@ -17,8 +17,8 @@ struct CellSpudllHandleConfig be_t dmaTag; be_t numMaxReferred; be_t numMaxDepend; - vm::ps3::bptr unresolvedSymbolValueForFunc; - vm::ps3::bptr unresolvedSymbolValueForObject; - vm::ps3::bptr unresolvedSymbolValueForOther; + vm::bptr unresolvedSymbolValueForFunc; + vm::bptr unresolvedSymbolValueForObject; + vm::bptr unresolvedSymbolValueForOther; be_t __reserved__[9]; }; diff --git a/rpcs3/Emu/Cell/Modules/cellSpurs.h b/rpcs3/Emu/Cell/Modules/cellSpurs.h index ba72027f7a..f127a79211 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpurs.h +++ b/rpcs3/Emu/Cell/Modules/cellSpurs.h @@ -2,7 +2,7 @@ #include "cellSync.h" -namespace vm { using namespace ps3; } + struct CellSpurs; struct CellSpursTaskset; @@ -671,7 +671,7 @@ struct alignas(16) CellSpursTaskAttribute2 be_t eaContext; CellSpursTaskLsPattern lsPattern; vm::bcptr name; - + u8 reserved[220]; }; diff --git a/rpcs3/Emu/Cell/Modules/cellSpursJq.h b/rpcs3/Emu/Cell/Modules/cellSpursJq.h index 8744312ca5..6f70f09bee 100644 --- a/rpcs3/Emu/Cell/Modules/cellSpursJq.h +++ b/rpcs3/Emu/Cell/Modules/cellSpursJq.h @@ -1,3 +1 @@ #pragma once - -namespace vm { using namespace ps3; } diff --git a/rpcs3/Emu/Cell/Modules/cellSsl.cpp b/rpcs3/Emu/Cell/Modules/cellSsl.cpp index 6efc347a44..0464542136 100644 --- a/rpcs3/Emu/Cell/Modules/cellSsl.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSsl.cpp @@ -9,7 +9,7 @@ logs::channel cellSsl("cellSsl"); -namespace vm { using namespace ps3; } + enum SpecialCerts { BaltimoreCert = 6, Class3G2V2Cert = 13, ClassSSV4Cert = 15, EntrustNetCert = 18, GTECyberTrustGlobalCert = 23 }; diff --git a/rpcs3/Emu/Cell/Modules/cellStorage.cpp b/rpcs3/Emu/Cell/Modules/cellStorage.cpp index 49345a69a9..e7b29b026d 100644 --- a/rpcs3/Emu/Cell/Modules/cellStorage.cpp +++ b/rpcs3/Emu/Cell/Modules/cellStorage.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } + extern logs::channel cellSysutil; diff --git a/rpcs3/Emu/Cell/Modules/cellSubDisplay.h b/rpcs3/Emu/Cell/Modules/cellSubDisplay.h index fd43e94814..76249e4777 100644 --- a/rpcs3/Emu/Cell/Modules/cellSubDisplay.h +++ b/rpcs3/Emu/Cell/Modules/cellSubDisplay.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return Codes enum CellSubDisplayError : u32 diff --git a/rpcs3/Emu/Cell/Modules/cellSync.h b/rpcs3/Emu/Cell/Modules/cellSync.h index a367273452..b457b8b3aa 100644 --- a/rpcs3/Emu/Cell/Modules/cellSync.h +++ b/rpcs3/Emu/Cell/Modules/cellSync.h @@ -2,7 +2,7 @@ #include "Utilities/BitField.h" -namespace vm { using namespace ps3; } + // Return Codes enum CellSyncError : u32 diff --git a/rpcs3/Emu/Cell/Modules/cellSync2.h b/rpcs3/Emu/Cell/Modules/cellSync2.h index 01a430df45..17f0035504 100644 --- a/rpcs3/Emu/Cell/Modules/cellSync2.h +++ b/rpcs3/Emu/Cell/Modules/cellSync2.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellSysconf.h b/rpcs3/Emu/Cell/Modules/cellSysconf.h index 5a6891c96a..6965ebb594 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysconf.h +++ b/rpcs3/Emu/Cell/Modules/cellSysconf.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + typedef void(CellSysconfCallback)(s32 result, vm::ptr userdata); diff --git a/rpcs3/Emu/Cell/Modules/cellSysutil.h b/rpcs3/Emu/Cell/Modules/cellSysutil.h index 74c59b2739..2470b0a18d 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutil.h +++ b/rpcs3/Emu/Cell/Modules/cellSysutil.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + enum { @@ -141,9 +141,9 @@ enum enum { CELL_SYSCACHE_RET_OK_CLEARED = 0, - CELL_SYSCACHE_RET_OK_RELAYED = 1, + CELL_SYSCACHE_RET_OK_RELAYED = 1, - CELL_SYSCACHE_ID_SIZE = 32, + CELL_SYSCACHE_ID_SIZE = 32, CELL_SYSCACHE_PATH_MAX = 1055, CELL_SYSCACHE_ERROR_ACCESS_ERROR = 0x8002bc01, // I don't think we need this diff --git a/rpcs3/Emu/Cell/Modules/cellSysutilAp.cpp b/rpcs3/Emu/Cell/Modules/cellSysutilAp.cpp index bc70503053..66dca3633b 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutilAp.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutilAp.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } + logs::channel cellSysutilAp("cellSysutilAp"); diff --git a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h index 2dc5e84bbb..6441b9c348 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h +++ b/rpcs3/Emu/Cell/Modules/cellSysutilAvc2.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error codes enum CellSysutilAvc2Error : u32 diff --git a/rpcs3/Emu/Cell/Modules/cellUsbd.h b/rpcs3/Emu/Cell/Modules/cellUsbd.h index 56f08c0210..f0c75eb260 100644 --- a/rpcs3/Emu/Cell/Modules/cellUsbd.h +++ b/rpcs3/Emu/Cell/Modules/cellUsbd.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return Codes enum diff --git a/rpcs3/Emu/Cell/Modules/cellUserInfo.h b/rpcs3/Emu/Cell/Modules/cellUserInfo.h index f48771c8f1..c1735ecbae 100644 --- a/rpcs3/Emu/Cell/Modules/cellUserInfo.h +++ b/rpcs3/Emu/Cell/Modules/cellUserInfo.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum CellUserInfoError : u32 diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.h b/rpcs3/Emu/Cell/Modules/cellVdec.h index 8a8ce8193f..84a94fd5fc 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.h +++ b/rpcs3/Emu/Cell/Modules/cellVdec.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum @@ -129,7 +129,7 @@ struct CellVdecResourceEx }; // Access Unit Information -struct CellVdecAuInfo +struct CellVdecAuInfo { be_t startAddr; be_t size; diff --git a/rpcs3/Emu/Cell/Modules/cellVideoExport.cpp b/rpcs3/Emu/Cell/Modules/cellVideoExport.cpp index 4a9ee93b4b..360fa39451 100644 --- a/rpcs3/Emu/Cell/Modules/cellVideoExport.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVideoExport.cpp @@ -3,7 +3,7 @@ #include "cellSysutil.h" -namespace vm { using namespace ps3; } + logs::channel cellVideoExport("cellVideoExport"); diff --git a/rpcs3/Emu/Cell/Modules/cellVideoOut.h b/rpcs3/Emu/Cell/Modules/cellVideoOut.h index e1df00a26e..f7e4333e4f 100644 --- a/rpcs3/Emu/Cell/Modules/cellVideoOut.h +++ b/rpcs3/Emu/Cell/Modules/cellVideoOut.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + #include "Emu/Cell/ErrorCodes.h" diff --git a/rpcs3/Emu/Cell/Modules/cellVideoUpload.h b/rpcs3/Emu/Cell/Modules/cellVideoUpload.h index f57eb912b3..c7694a438f 100644 --- a/rpcs3/Emu/Cell/Modules/cellVideoUpload.h +++ b/rpcs3/Emu/Cell/Modules/cellVideoUpload.h @@ -9,27 +9,27 @@ struct CellVideoUploadOption struct CellVideoUploadParam { be_t siteID; - vm::ps3::bcptr pFilePath; + vm::bcptr pFilePath; union { struct { - vm::ps3::bcptr pClientId; - vm::ps3::bcptr pDeveloperKey; - vm::ps3::bcptr pTitle_UTF8; - vm::ps3::bcptr pDescription_UTF8; - vm::ps3::bcptr pKeyword_1_UTF8; - vm::ps3::bcptr pKeyword_2_UTF8; - vm::ps3::bcptr pKeyword_3_UTF8; + vm::bcptr pClientId; + vm::bcptr pDeveloperKey; + vm::bcptr pTitle_UTF8; + vm::bcptr pDescription_UTF8; + vm::bcptr pKeyword_1_UTF8; + vm::bcptr pKeyword_2_UTF8; + vm::bcptr pKeyword_3_UTF8; u8 isPrivate; u8 rating; } youtube; } u; be_t numOfOption; - vm::ps3::bptr pOption; + vm::bptr pOption; }; -using CellVideoUploadCallback = void(s32 status, s32 errorCode, vm::ps3::cptr pResultURL, vm::ps3::ptr userdata); +using CellVideoUploadCallback = void(s32 status, s32 errorCode, vm::cptr pResultURL, vm::ptr userdata); enum { diff --git a/rpcs3/Emu/Cell/Modules/cellVoice.h b/rpcs3/Emu/Cell/Modules/cellVoice.h index 4255f355d6..2d8edd5689 100644 --- a/rpcs3/Emu/Cell/Modules/cellVoice.h +++ b/rpcs3/Emu/Cell/Modules/cellVoice.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // libvoice = 0x80310801 - 0x803108ff // libvoice version 100 @@ -37,7 +37,7 @@ enum CELLVOICE_GAME_1MB_MAX_OUT_VOICE_PORT = 2, CELLVOICE_MAX_PORT = 128, CELLVOICE_INVALID_PORT_ID = 0xff, - + CELLVOICE_PORTTYPE_NULL = -1, CELLVOICE_PORTTYPE_IN_MIC = 0, CELLVOICE_PORTTYPE_IN_PCMAUDIO = 1, @@ -45,13 +45,13 @@ enum CELLVOICE_PORTTYPE_OUT_PCMAUDIO = 3, CELLVOICE_PORTTYPE_OUT_VOICE = 4, CELLVOICE_PORTTYPE_OUT_SECONDARY = 5, - + CELLVOICE_PORTSTATE_NULL = -1, CELLVOICE_PORTSTATE_IDLE = 0, CELLVOICE_PORTSTATE_READY = 1, CELLVOICE_PORTSTATE_BUFFERING = 2, CELLVOICE_PORTSTATE_RUNNING = 3, - + CELLVOICE_BITRATE_NULL = -1, CELLVOICE_BITRATE_3850 = 3850, CELLVOICE_BITRATE_4650 = 4650, @@ -60,10 +60,10 @@ enum CELLVOICE_BITRATE_14400 = 14400, CELLVOICE_BITRATE_16000 = 16000, CELLVOICE_BITRATE_22533 = 22533, - + CELLVOICE_SAMPLINGRATE_NULL = -1, CELLVOICE_SAMPLINGRATE_16000 = 16000, - + CELLVOICE_EVENT_DATA_ERROR = 1 << 0, CELLVOICE_EVENT_PORT_ATTACHED = 1 << 1, CELLVOICE_EVENT_PORT_DETACHED = 1 << 2, @@ -71,7 +71,7 @@ enum CELLVOICE_EVENT_SERVICE_DETACHED = 1 << 4, CELLVOICE_EVENT_PORT_WEAK_ATTACHED = 1 << 5, CELLVOICE_EVENT_PORT_WEAK_DETACHED = 1 << 6, - + CELLVOICE_PCM_NULL = -1, CELLVOICE_PCM_FLOAT = 0, CELLVOICE_PCM_FLOAT_LITTLE_ENDIAN = 1, @@ -79,13 +79,13 @@ enum CELLVOICE_PCM_SHORT_LITTLE_ENDIAN = 3, CELLVOICE_PCM_INTEGER = 4, CELLVOICE_PCM_INTEGER_LITTLE_ENDIAN = 5, - + CELLVOICE_ATTR_ENERGY_LEVEL = 1000, CELLVOICE_ATTR_VAD = 1001, CELLVOICE_ATTR_DTX = 1002, CELLVOICE_ATTR_AUTO_RESAMPLE = 1003, CELLVOICE_ATTR_LATENCY = 1004, CELLVOICE_ATTR_SILENCE_THRESHOLD = 1005, - + CELLVOICE_APPTYPE_GAME_1MB = 1 << 29 }; diff --git a/rpcs3/Emu/Cell/Modules/cellVpost.h b/rpcs3/Emu/Cell/Modules/cellVpost.h index d49c797c66..b1d8ad264e 100644 --- a/rpcs3/Emu/Cell/Modules/cellVpost.h +++ b/rpcs3/Emu/Cell/Modules/cellVpost.h @@ -5,7 +5,7 @@ extern "C" #include "libswscale/swscale.h" } -namespace vm { using namespace ps3; } + // Error Codes enum diff --git a/rpcs3/Emu/Cell/Modules/libmixer.h b/rpcs3/Emu/Cell/Modules/libmixer.h index 404826902d..43b6c8e1e9 100644 --- a/rpcs3/Emu/Cell/Modules/libmixer.h +++ b/rpcs3/Emu/Cell/Modules/libmixer.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum @@ -118,10 +118,10 @@ struct CellSSPlayerConfig { be_t channels; be_t outputMode; -}; +}; -struct CellSSPlayerWaveParam -{ +struct CellSSPlayerWaveParam +{ be_t addr; be_t format; be_t samples; @@ -129,28 +129,28 @@ struct CellSSPlayerWaveParam be_t startOffset; }; -struct CellSSPlayerCommonParam -{ +struct CellSSPlayerCommonParam +{ be_t loopMode; be_t attackMode; }; -struct CellSurMixerPosition -{ +struct CellSurMixerPosition +{ be_t x; be_t y; be_t z; }; -struct CellSSPlayerRuntimeInfo -{ +struct CellSSPlayerRuntimeInfo +{ be_t level; be_t speed; CellSurMixerPosition position; }; -struct CellSurMixerConfig -{ +struct CellSurMixerConfig +{ be_t priority; be_t chStrips1; be_t chStrips2; @@ -158,8 +158,8 @@ struct CellSurMixerConfig be_t chStrips8; }; -struct CellSurMixerChStripParam -{ +struct CellSurMixerChStripParam +{ be_t param; be_t attribute_addr; be_t dBSwitch; diff --git a/rpcs3/Emu/Cell/Modules/libsnd3.h b/rpcs3/Emu/Cell/Modules/libsnd3.h index c54cff7914..083c2bc86b 100644 --- a/rpcs3/Emu/Cell/Modules/libsnd3.h +++ b/rpcs3/Emu/Cell/Modules/libsnd3.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error Codes enum diff --git a/rpcs3/Emu/Cell/Modules/libsynth2.cpp b/rpcs3/Emu/Cell/Modules/libsynth2.cpp index e87c0539f5..425c63c6ae 100644 --- a/rpcs3/Emu/Cell/Modules/libsynth2.cpp +++ b/rpcs3/Emu/Cell/Modules/libsynth2.cpp @@ -3,7 +3,7 @@ #include "libsynth2.h" -namespace vm { using namespace ps3; } + logs::channel libsynth2("libsynth2"); diff --git a/rpcs3/Emu/Cell/Modules/sceNp.h b/rpcs3/Emu/Cell/Modules/sceNp.h index d0222570d0..c44de05d89 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.h +++ b/rpcs3/Emu/Cell/Modules/sceNp.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + #include "cellRtc.h" diff --git a/rpcs3/Emu/Cell/Modules/sceNp2.h b/rpcs3/Emu/Cell/Modules/sceNp2.h index 5c40117983..27bd028ec7 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp2.h +++ b/rpcs3/Emu/Cell/Modules/sceNp2.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error codes enum diff --git a/rpcs3/Emu/Cell/Modules/sceNpClans.h b/rpcs3/Emu/Cell/Modules/sceNpClans.h index 11ce289c75..7faba3c130 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpClans.h +++ b/rpcs3/Emu/Cell/Modules/sceNpClans.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return codes enum diff --git a/rpcs3/Emu/Cell/Modules/sceNpCommerce2.h b/rpcs3/Emu/Cell/Modules/sceNpCommerce2.h index 2b97705e05..aebbca5fcc 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpCommerce2.h +++ b/rpcs3/Emu/Cell/Modules/sceNpCommerce2.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + #include "cellRtc.h" diff --git a/rpcs3/Emu/Cell/Modules/sceNpMatchingInt.cpp b/rpcs3/Emu/Cell/Modules/sceNpMatchingInt.cpp index 03a88d057e..569920a50d 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpMatchingInt.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNpMatchingInt.cpp @@ -2,7 +2,7 @@ #include "Emu/System.h" #include "Emu/Cell/PPUModule.h" -namespace vm { using namespace ps3; } + logs::channel sceNpMatchingInt("sceNpMatchingInt"); diff --git a/rpcs3/Emu/Cell/Modules/sceNpSns.h b/rpcs3/Emu/Cell/Modules/sceNpSns.h index 84c924bb92..2362ee2f3a 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpSns.h +++ b/rpcs3/Emu/Cell/Modules/sceNpSns.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Return codes enum sceNpSnsError : u32 diff --git a/rpcs3/Emu/Cell/Modules/sceNpTrophy.h b/rpcs3/Emu/Cell/Modules/sceNpTrophy.h index 526778c9b6..65ee6b403d 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpTrophy.h +++ b/rpcs3/Emu/Cell/Modules/sceNpTrophy.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // Error codes enum SceNpTrophyError : u32 diff --git a/rpcs3/Emu/Cell/Modules/sceNpTus.h b/rpcs3/Emu/Cell/Modules/sceNpTus.h index 26c7dffeb2..e70b754e05 100644 --- a/rpcs3/Emu/Cell/Modules/sceNpTus.h +++ b/rpcs3/Emu/Cell/Modules/sceNpTus.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + #include "cellRtc.h" diff --git a/rpcs3/Emu/Cell/Modules/sysPrxForUser.h b/rpcs3/Emu/Cell/Modules/sysPrxForUser.h index ecb94d70e4..beedcd9c78 100644 --- a/rpcs3/Emu/Cell/Modules/sysPrxForUser.h +++ b/rpcs3/Emu/Cell/Modules/sysPrxForUser.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + using spu_printf_cb_t = vm::ptr; diff --git a/rpcs3/Emu/Cell/Modules/sys_libc.cpp b/rpcs3/Emu/Cell/Modules/sys_libc.cpp index 9614f9388a..7f4bf9635e 100644 --- a/rpcs3/Emu/Cell/Modules/sys_libc.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_libc.cpp @@ -3,7 +3,7 @@ #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/PPUOpcodes.h" -namespace vm { using namespace ps3; } + logs::channel sys_libc("sys_libc"); diff --git a/rpcs3/Emu/Cell/Modules/sys_libc_.cpp b/rpcs3/Emu/Cell/Modules/sys_libc_.cpp index 284cf7c64f..b7f62e465f 100644 --- a/rpcs3/Emu/Cell/Modules/sys_libc_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_libc_.cpp @@ -4,7 +4,7 @@ #include #include -namespace vm { using namespace ps3; } + extern logs::channel sysPrxForUser; @@ -37,7 +37,7 @@ struct ps3_fmt_src std::size_t fmt_string(std::string& out, std::size_t extra) const { const std::size_t start = out.size(); - out += vm::ps3::_ptr(get(extra)); + out += vm::_ptr(get(extra)); return out.size() - start; } @@ -339,7 +339,7 @@ vm::ptr _sys_strncpy(vm::ptr dst, vm::cptr src, s32 len) s32 _sys_strncasecmp(vm::cptr str1, vm::cptr str2, u32 n) { sysPrxForUser.trace("_sys_strncasecmp(str1=%s, str2=%s, n=%d)", str1, str2, n); - + for (u32 i = 0; i < n; i++) { const int ch1 = _sys_tolower(str1[i]), ch2 = _sys_tolower(str2[i]); @@ -356,7 +356,7 @@ s32 _sys_strncasecmp(vm::cptr str1, vm::cptr str2, u32 n) vm::cptr _sys_strrchr(vm::cptr str, char ch) { sysPrxForUser.trace("_sys_strrchr(str=%s, ch=%d)", str, ch); - + vm::cptr res = vm::null; for (u32 i = 0;; i++) diff --git a/rpcs3/Emu/Cell/Modules/sys_lv2dbg.h b/rpcs3/Emu/Cell/Modules/sys_lv2dbg.h index e9a30c19fd..38a357790c 100644 --- a/rpcs3/Emu/Cell/Modules/sys_lv2dbg.h +++ b/rpcs3/Emu/Cell/Modules/sys_lv2dbg.h @@ -9,7 +9,7 @@ #include "Emu/Cell/lv2/sys_lwcond.h" #include "Emu/Cell/lv2/sys_event_flag.h" -namespace vm { using namespace ps3; } + // Error Codes enum diff --git a/rpcs3/Emu/Cell/Modules/sys_mmapper_.cpp b/rpcs3/Emu/Cell/Modules/sys_mmapper_.cpp index a4a0fbaf41..37bd8fdd4a 100644 --- a/rpcs3/Emu/Cell/Modules/sys_mmapper_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_mmapper_.cpp @@ -2,7 +2,7 @@ #include "Emu/Cell/PPUModule.h" #include "Emu/Cell/lv2/sys_mmapper.h" -namespace vm { using namespace ps3; } + extern logs::channel sysPrxForUser; diff --git a/rpcs3/Emu/Cell/Modules/sys_net_.cpp b/rpcs3/Emu/Cell/Modules/sys_net_.cpp index ec824cba46..95bf687575 100644 --- a/rpcs3/Emu/Cell/Modules/sys_net_.cpp +++ b/rpcs3/Emu/Cell/Modules/sys_net_.cpp @@ -4,7 +4,7 @@ #include "sys_net_.h" -namespace vm { using namespace ps3; } + logs::channel libnet("libnet"); @@ -690,7 +690,7 @@ DECLARE(ppu_module_manager::sys_net)("sys_net", []() REG_FUNC(sys_net, _sys_net_h_errno_loc); REG_FUNC(sys_net, sys_net_set_netemu_test_param); REG_FUNC(sys_net, sys_net_free_thread_context); - + REG_FUNC(sys_net, _sys_net_lib_abort); REG_FUNC(sys_net, _sys_net_lib_bnet_control); REG_FUNC(sys_net, __sys_net_lib_calloc); @@ -703,7 +703,7 @@ DECLARE(ppu_module_manager::sys_net)("sys_net", []() REG_FUNC(sys_net, __sys_net_lib_realloc); REG_FUNC(sys_net, _sys_net_lib_reset_libnetctl_queue); REG_FUNC(sys_net, _sys_net_lib_set_libnetctl_queue); - + REG_FUNC(sys_net, _sys_net_lib_thread_create); REG_FUNC(sys_net, _sys_net_lib_thread_exit); REG_FUNC(sys_net, _sys_net_lib_thread_join); @@ -716,7 +716,7 @@ DECLARE(ppu_module_manager::sys_net)("sys_net", []() REG_FUNC(sys_net, _sys_net_lib_sysctl); REG_FUNC(sys_net, _sys_net_lib_usleep); - + REG_FUNC(sys_net, sys_netset_abort); REG_FUNC(sys_net, sys_netset_close); REG_FUNC(sys_net, sys_netset_get_if_id); diff --git a/rpcs3/Emu/Cell/Modules/sys_net_.h b/rpcs3/Emu/Cell/Modules/sys_net_.h index 1263ee2226..c49a65e26d 100644 --- a/rpcs3/Emu/Cell/Modules/sys_net_.h +++ b/rpcs3/Emu/Cell/Modules/sys_net_.h @@ -35,7 +35,7 @@ struct sys_net_sockinfo_ex_t struct sys_net_initialize_parameter_t { - vm::ps3::bptr memory; + vm::bptr memory; be_t memory_size; be_t flags; }; diff --git a/rpcs3/Emu/Cell/PPUAnalyser.cpp b/rpcs3/Emu/Cell/PPUAnalyser.cpp index d73941fc32..a541629624 100644 --- a/rpcs3/Emu/Cell/PPUAnalyser.cpp +++ b/rpcs3/Emu/Cell/PPUAnalyser.cpp @@ -7,7 +7,7 @@ #include "yaml-cpp/yaml.h" -namespace vm { using namespace ps3; } + const ppu_decoder s_ppu_itype; @@ -876,7 +876,7 @@ void ppu_module::analyse(u32 lib_toc, u32 entry) func.attr += ppu_attr::no_return; continue; } - + if (target >= start && target < end) { auto& new_func = add_func(target, func.toc, func.addr); @@ -1122,7 +1122,7 @@ void ppu_module::analyse(u32 lib_toc, u32 entry) block_queue.clear(); break; } - + // Add next block if necessary if ((is_call && !test(pfunc->attr, ppu_attr::no_return)) || (type == ppu_itype::BC && (op.bo & 0x14) != 0x14)) { @@ -1241,7 +1241,7 @@ void ppu_module::analyse(u32 lib_toc, u32 entry) func_queue.emplace_back(func); continue; } - + // Finalization: determine function size if (!test(func.attr, ppu_attr::known_size)) { @@ -1400,7 +1400,7 @@ void ppu_module::analyse(u32 lib_toc, u32 entry) { _ptr.set(next); } - + if (_ptr.addr() >= next) { LOG_WARNING(PPU, "Function gap: [0x%x] 0x%x bytes at 0x%x", func.addr, next - start, start); @@ -1422,7 +1422,7 @@ void ppu_module::analyse(u32 lib_toc, u32 entry) } } } - + // Convert map to vector (destructive) for (auto&& pair : fmap) { @@ -3384,6 +3384,6 @@ const bool s_tes = []() r1 = ppu_acontext::spec_gpr::range(0x13311, 0x1fe22); r1 = r1 ^ ppu_acontext::spec_gpr::approx(0x000, 0xf00); LOG_SUCCESS(PPU, "0x%x..0x%x", r1.imin, r1.imax); - + return true; }(); diff --git a/rpcs3/Emu/Cell/PPUCallback.h b/rpcs3/Emu/Cell/PPUCallback.h index 5371666f9e..5dcb98cbfe 100644 --- a/rpcs3/Emu/Cell/PPUCallback.h +++ b/rpcs3/Emu/Cell/PPUCallback.h @@ -26,7 +26,7 @@ namespace ppu_cb_detail static_assert(!std::is_pointer::value, "Invalid callback argument type (pointer)"); static_assert(!std::is_reference::value, "Invalid callback argument type (reference)"); static_assert(sizeof(T) <= 8, "Invalid callback argument type for ARG_GENERAL"); - + static inline void set_value(ppu_thread& CPU, const T& arg) { CPU.gpr[g_count + 2] = ppu_gpr_cast(arg); @@ -64,7 +64,7 @@ namespace ppu_cb_detail { const s64 stack_pos = (g_count - 1) * 0x8 + 0x30 - FIXED_STACK_FRAME_SIZE; static_assert(stack_pos < 0, "TODO: Increase FIXED_STACK_FRAME_SIZE (arg count limit broken)"); - vm::ps3::write64(CPU.gpr[1] + stack_pos, ppu_gpr_cast(arg)); // TODO + vm::write64(CPU.gpr[1] + stack_pos, ppu_gpr_cast(arg)); // TODO } }; @@ -103,7 +103,7 @@ namespace ppu_cb_detail const u32 g = g_count + (is_general || is_float ? 1 : is_vector ? ::align(g_count, 2) + 2 : 0); const u32 f = f_count + is_float; const u32 v = v_count + is_vector; - + _func_arg::set_value(CPU, arg1); // return true if stack was used @@ -179,7 +179,7 @@ namespace vm template FORCE_INLINE RT _ptr_base::operator()(ppu_thread& CPU, T... args) const { - const auto data = vm::ps3::_ptr(vm::cast(m_addr, HERE)); + const auto data = vm::_ptr(vm::cast(m_addr, HERE)); const u32 pc = data[0]; const u32 rtoc = data[1]; diff --git a/rpcs3/Emu/Cell/PPUInterpreter.cpp b/rpcs3/Emu/Cell/PPUInterpreter.cpp index 64f9048ec0..a1da359322 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/PPUInterpreter.cpp @@ -303,7 +303,7 @@ extern u64 ppu_ldarx(ppu_thread& ppu, u32 addr); extern bool ppu_stwcx(ppu_thread& ppu, u32 addr, u32 reg_value); extern bool ppu_stdcx(ppu_thread& ppu, u32 addr, u64 reg_value); -namespace vm { using namespace ps3; } + class ppu_scale_table_t { diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index f041e6cb66..2421bfadfe 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -17,7 +17,7 @@ #include #include -namespace vm { using namespace ps3; } + extern void ppu_initialize_syscalls(); extern std::string ppu_get_function_name(const std::string& module, u32 fnid); @@ -269,8 +269,8 @@ static void ppu_initialize_modules(const std::shared_ptr& link for (u32 addr = ppu_function_manager::addr, index = 0; index < hle_funcs.size(); addr += 8, index++) { // Function address = current address, RTOC = BLR instruction for the interpreter - vm::ps3::write32(addr + 0, addr); - vm::ps3::write32(addr + 4, ppu_instructions::BLR()); + vm::write32(addr + 0, addr); + vm::write32(addr + 4, ppu_instructions::BLR()); // Register the HLE function directly ppu_register_function_at(addr + 0, 4, hle_funcs[index]); @@ -1129,7 +1129,7 @@ void ppu_load_exec(const ppu_exec_object& elf) //be_t crash_dump_param_addr; }; - const auto& info = vm::ps3::_ref(vm::cast(prog.p_vaddr, HERE)); + const auto& info = vm::_ref(vm::cast(prog.p_vaddr, HERE)); if (info.size < sizeof(process_param_t)) { diff --git a/rpcs3/Emu/Cell/PPUModule.h b/rpcs3/Emu/Cell/PPUModule.h index b55c4c648d..b64dada643 100644 --- a/rpcs3/Emu/Cell/PPUModule.h +++ b/rpcs3/Emu/Cell/PPUModule.h @@ -20,7 +20,7 @@ constexpr const char* ppu_select_name(const char* name, const char* orig_name) // Generate FNID or VNID for given name extern u32 ppu_generate_id(const char* name); -// Overload for REG_FNID, REG_VNID macro +// Overload for REG_FNID, REG_VNID macro constexpr u32 ppu_generate_id(u32 id) { return id; @@ -55,7 +55,7 @@ struct ppu_static_function struct ppu_static_variable { const char* name; - vm::ps3::gvar* var; // Pointer to variable address storage + vm::gvar* var; // Pointer to variable address storage void(*init)(); // Variable initialization function u32 size; u32 align; @@ -150,7 +150,7 @@ public: auto& info = access_static_variable(module, vnid); info.name = name; - info.var = reinterpret_cast*>(Var); + info.var = reinterpret_cast*>(Var); info.init = [] {}; info.size = SIZE_32(typename T::type); info.align = ALIGN_32(typename T::type); @@ -274,7 +274,7 @@ ppu_static_function* ppu_module_manager::registered::info = nullptr; template> inline RT ppu_execute_function_or_callback(ppu_thread& ppu, Args&&... args) { - vm::ps3::ptr func = vm::cast(*ppu_module_manager::find_static_function().export_addr); + vm::ptr func = vm::cast(*ppu_module_manager::find_static_function().export_addr); return func(ppu, std::forward(args)...); } diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index fabfc5839d..53871f8be0 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -68,7 +68,7 @@ const bool s_use_ssse3 = extern u64 get_system_time(); -namespace vm { using namespace ps3; } + enum class join_status : u32 { @@ -842,7 +842,7 @@ u32 ppu_thread::stack_push(u32 size, u32 align_v) else { const u32 addr = static_cast(context.gpr[1]); - vm::ps3::_ref>(addr + size) = old_pos; + vm::_ref>(addr + size) = old_pos; std::memset(vm::base(addr), 0, size); return addr; } @@ -863,7 +863,7 @@ void ppu_thread::stack_pop_verbose(u32 addr, u32 size) noexcept return; } - context.gpr[1] = vm::ps3::_ref>(context.gpr[1] + size); + context.gpr[1] = vm::_ref>(context.gpr[1] + size); return; } @@ -1274,7 +1274,7 @@ extern void ppu_initialize(const ppu_module& info) } // TODO: relocations must be taken into account (TODO) - sha1_update(&ctx, vm::ps3::_ptr(block.first), block.second); + sha1_update(&ctx, vm::_ptr(block.first), block.second); } if (reloc) @@ -1282,7 +1282,7 @@ extern void ppu_initialize(const ppu_module& info) continue; } - sha1_update(&ctx, vm::ps3::_ptr(func.addr), func.size); + sha1_update(&ctx, vm::_ptr(func.addr), func.size); } if (info.name == "liblv2.sprx" || info.name == "libsysmodule.sprx" || info.name == "libnet.sprx") diff --git a/rpcs3/Emu/Cell/PPUTranslator.cpp b/rpcs3/Emu/Cell/PPUTranslator.cpp index 10b957f1f2..55a7b80c4c 100644 --- a/rpcs3/Emu/Cell/PPUTranslator.cpp +++ b/rpcs3/Emu/Cell/PPUTranslator.cpp @@ -151,7 +151,7 @@ Function* PPUTranslator::Translate(const ppu_function& info) const auto block = std::make_pair(info.addr, info.size); { // Optimize BLR (prefetch LR) - if (vm::ps3::read32(vm::cast(block.first + block.second - 4)) == ppu_instructions::BLR()) + if (vm::read32(vm::cast(block.first + block.second - 4)) == ppu_instructions::BLR()) { RegLoad(m_lr); } @@ -176,7 +176,7 @@ Function* PPUTranslator::Translate(const ppu_function& info) m_rel = nullptr; } - const u32 op = vm::ps3::read32(vm::cast(m_addr + base)); + const u32 op = vm::read32(vm::cast(m_addr + base)); (this->*(s_ppu_decoder.decode(op)))({op}); if (m_rel) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 34e6dfba39..3d5fa04ce9 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -21,7 +21,7 @@ void spu_recompiler_base::enter(SPUThread& spu) } // Get SPU LS pointer - const auto _ls = vm::ps3::_ptr(spu.offset); + const auto _ls = vm::_ptr(spu.offset); // Search if cached data matches auto func = spu.compiled_cache[spu.pc / 4]; diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index ae16a1960e..932c91e635 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -389,7 +389,7 @@ void SPUThread::cpu_task() (fmt::throw_exception("Invalid SPU decoder"), nullptr)); // LS base address - const auto base = vm::ps3::_ptr(offset); + const auto base = vm::_ptr(offset); while (true) { @@ -644,7 +644,7 @@ void SPUThread::process_mfc_cmd() { case MFC_GETLLAR_CMD: { - auto& data = vm::ps3::_ref(ch_mfc_cmd.eal); + auto& data = vm::_ref(ch_mfc_cmd.eal); const u32 _addr = ch_mfc_cmd.eal; const u64 _time = vm::reservation_acquire(raddr, 128); @@ -718,7 +718,7 @@ void SPUThread::process_mfc_cmd() case MFC_PUTLLC_CMD: { // Store conditionally - auto& data = vm::ps3::_ref(ch_mfc_cmd.eal); + auto& data = vm::_ref(ch_mfc_cmd.eal); const auto to_write = _ref(ch_mfc_cmd.lsa & 0x3ffff); bool result = false; @@ -784,7 +784,7 @@ void SPUThread::process_mfc_cmd() raddr = 0; } - auto& data = vm::ps3::_ref(ch_mfc_cmd.eal); + auto& data = vm::_ref(ch_mfc_cmd.eal); const auto to_write = _ref(ch_mfc_cmd.lsa & 0x3ffff); vm::reservation_acquire(ch_mfc_cmd.eal, 128); @@ -974,7 +974,7 @@ void SPUThread::process_mfc_cmd() u32 SPUThread::get_events(bool waiting) { // Check reservation status and set SPU_EVENT_LR if lost - if (raddr && (vm::reservation_acquire(raddr, sizeof(rdata)) != rtime || rdata != vm::ps3::_ref(raddr))) + if (raddr && (vm::reservation_acquire(raddr, sizeof(rdata)) != rtime || rdata != vm::_ref(raddr))) { ch_event_stat |= SPU_EVENT_LR; raddr = 0; diff --git a/rpcs3/Emu/Cell/lv2/sys_cond.cpp b/rpcs3/Emu/Cell/lv2/sys_cond.cpp index b511033484..a6fa51ec45 100644 --- a/rpcs3/Emu/Cell/lv2/sys_cond.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_cond.cpp @@ -9,7 +9,7 @@ #include "sys_mutex.h" #include "sys_cond.h" -namespace vm { using namespace ps3; } + logs::channel sys_cond("sys_cond"); @@ -248,7 +248,7 @@ error_code sys_cond_wait(ppu_thread& ppu, u32 cond_id, u64 timeout) if (passed >= timeout) { semaphore_lock lock(cond->mutex->mutex); - + // Try to cancel the waiting if (cond->unqueue(cond->sq, &ppu)) { diff --git a/rpcs3/Emu/Cell/lv2/sys_cond.h b/rpcs3/Emu/Cell/lv2/sys_cond.h index 76e1bf3468..58363e3d4b 100644 --- a/rpcs3/Emu/Cell/lv2/sys_cond.h +++ b/rpcs3/Emu/Cell/lv2/sys_cond.h @@ -50,7 +50,7 @@ class ppu_thread; // Syscalls -error_code sys_cond_create(vm::ps3::ptr cond_id, u32 mutex_id, vm::ps3::ptr attr); +error_code sys_cond_create(vm::ptr cond_id, u32 mutex_id, vm::ptr attr); error_code sys_cond_destroy(u32 cond_id); error_code sys_cond_wait(ppu_thread& ppu, u32 cond_id, u64 timeout); error_code sys_cond_signal(ppu_thread& ppu, u32 cond_id); diff --git a/rpcs3/Emu/Cell/lv2/sys_dbg.cpp b/rpcs3/Emu/Cell/lv2/sys_dbg.cpp index 4a969eab90..a89978ccc3 100644 --- a/rpcs3/Emu/Cell/lv2/sys_dbg.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_dbg.cpp @@ -6,6 +6,6 @@ #include "Emu/Cell/ErrorCodes.h" #include "sys_dbg.h" -namespace vm { using namespace ps3; } + logs::channel sys_dbg("sys_dbg"); diff --git a/rpcs3/Emu/Cell/lv2/sys_event.cpp b/rpcs3/Emu/Cell/lv2/sys_event.cpp index cbf5460de5..aa1c34458b 100644 --- a/rpcs3/Emu/Cell/lv2/sys_event.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_event.cpp @@ -10,7 +10,7 @@ #include "sys_process.h" #include "sys_event.h" -namespace vm { using namespace ps3; } + logs::channel sys_event("sys_event"); @@ -238,7 +238,7 @@ error_code sys_event_queue_receive(ppu_thread& ppu, u32 equeue_id, vm::ptr eport_id, s32 port_type, u64 name) *eport_id = id; return CELL_OK; } - + return CELL_EAGAIN; } @@ -372,7 +372,7 @@ error_code sys_event_port_connect_local(u32 eport_id, u32 equeue_id) writer_lock lock(id_manager::g_mutex); const auto port = idm::check_unlocked(eport_id); - + if (!port || !idm::check_unlocked(equeue_id)) { return CELL_ESRCH; diff --git a/rpcs3/Emu/Cell/lv2/sys_event.h b/rpcs3/Emu/Cell/lv2/sys_event.h index 0323c0ef31..6bbe7b2fb9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_event.h +++ b/rpcs3/Emu/Cell/lv2/sys_event.h @@ -127,13 +127,13 @@ class ppu_thread; // Syscalls -error_code sys_event_queue_create(vm::ps3::ptr equeue_id, vm::ps3::ptr attr, u64 event_queue_key, s32 size); +error_code sys_event_queue_create(vm::ptr equeue_id, vm::ptr attr, u64 event_queue_key, s32 size); error_code sys_event_queue_destroy(ppu_thread& ppu, u32 equeue_id, s32 mode); -error_code sys_event_queue_receive(ppu_thread& ppu, u32 equeue_id, vm::ps3::ptr dummy_event, u64 timeout); -error_code sys_event_queue_tryreceive(u32 equeue_id, vm::ps3::ptr event_array, s32 size, vm::ps3::ptr number); +error_code sys_event_queue_receive(ppu_thread& ppu, u32 equeue_id, vm::ptr dummy_event, u64 timeout); +error_code sys_event_queue_tryreceive(u32 equeue_id, vm::ptr event_array, s32 size, vm::ptr number); error_code sys_event_queue_drain(u32 event_queue_id); -error_code sys_event_port_create(vm::ps3::ptr eport_id, s32 port_type, u64 name); +error_code sys_event_port_create(vm::ptr eport_id, s32 port_type, u64 name); error_code sys_event_port_destroy(u32 eport_id); error_code sys_event_port_connect_local(u32 event_port_id, u32 event_queue_id); error_code sys_event_port_connect_ipc(u32 eport_id, u64 ipc_key); diff --git a/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp b/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp index c042c1f6f2..a3f39831d1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_event_flag.cpp @@ -10,7 +10,7 @@ #include -namespace vm { using namespace ps3; } + logs::channel sys_event_flag("sys_event_flag"); @@ -186,7 +186,7 @@ error_code sys_event_flag_wait(ppu_thread& ppu, u32 id, u64 bitptn, u32 mode, vm thread_ctrl::wait(); } } - + ppu.test_state(); if (result) *result = ppu.gpr[6]; return not_an_error(ppu.gpr[3]); @@ -267,7 +267,7 @@ error_code sys_event_flag_set(u32 id, u64 bitptn) const u64 pattern = ppu.gpr[4]; const u64 mode = ppu.gpr[5]; - + if (lv2_event_flag::check_pattern(value, pattern, mode, &ppu.gpr[6])) { ppu.gpr[3] = CELL_OK; @@ -300,7 +300,7 @@ error_code sys_event_flag_set(u32 id, u64 bitptn) flag->sq.erase(tail, flag->sq.end()); } - + return CELL_OK; } diff --git a/rpcs3/Emu/Cell/lv2/sys_event_flag.h b/rpcs3/Emu/Cell/lv2/sys_event_flag.h index 9188061307..a7541c0319 100644 --- a/rpcs3/Emu/Cell/lv2/sys_event_flag.h +++ b/rpcs3/Emu/Cell/lv2/sys_event_flag.h @@ -112,11 +112,11 @@ class ppu_thread; // Syscalls -error_code sys_event_flag_create(vm::ps3::ptr id, vm::ps3::ptr attr, u64 init); +error_code sys_event_flag_create(vm::ptr id, vm::ptr attr, u64 init); error_code sys_event_flag_destroy(u32 id); -error_code sys_event_flag_wait(ppu_thread& ppu, u32 id, u64 bitptn, u32 mode, vm::ps3::ptr result, u64 timeout); -error_code sys_event_flag_trywait(u32 id, u64 bitptn, u32 mode, vm::ps3::ptr result); +error_code sys_event_flag_wait(ppu_thread& ppu, u32 id, u64 bitptn, u32 mode, vm::ptr result, u64 timeout); +error_code sys_event_flag_trywait(u32 id, u64 bitptn, u32 mode, vm::ptr result); error_code sys_event_flag_set(u32 id, u64 bitptn); error_code sys_event_flag_clear(u32 id, u64 bitptn); -error_code sys_event_flag_cancel(ppu_thread& ppu, u32 id, vm::ps3::ptr num); -error_code sys_event_flag_get(u32 id, vm::ps3::ptr flags); +error_code sys_event_flag_cancel(ppu_thread& ppu, u32 id, vm::ptr num); +error_code sys_event_flag_get(u32 id, vm::ptr flags); diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.cpp b/rpcs3/Emu/Cell/lv2/sys_fs.cpp index 0a38745ae4..5feb0237ab 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_fs.cpp @@ -9,7 +9,7 @@ #include "Emu/IdManager.h" #include "Utilities/StrUtil.h" -namespace vm { using namespace ps3; } + logs::channel sys_fs("sys_fs"); @@ -64,7 +64,7 @@ lv2_fs_mount_point* lv2_fs_object::get_mp(const char* filename) return &g_mp_sys_dev_hdd0; } -u64 lv2_file::op_read(vm::ps3::ptr buf, u64 size) +u64 lv2_file::op_read(vm::ptr buf, u64 size) { // Copy data from intermediate buffer (avoid passing vm pointer to a native API) std::unique_ptr local_buf(new u8[size]); @@ -73,7 +73,7 @@ u64 lv2_file::op_read(vm::ps3::ptr buf, u64 size) return result; } -u64 lv2_file::op_write(vm::ps3::cptr buf, u64 size) +u64 lv2_file::op_write(vm::cptr buf, u64 size) { // Copy data to intermediate buffer (avoid passing vm pointer to a native API) std::unique_ptr local_buf(new u8[size]); @@ -725,7 +725,7 @@ error_code sys_fs_unlink(vm::cptr path) return CELL_OK; } -error_code sys_fs_access(vm::ps3::cptr path, s32 mode) +error_code sys_fs_access(vm::cptr path, s32 mode) { sys_fs.todo("sys_fs_access(path=%s, mode=%#o)", path, mode); @@ -1300,7 +1300,7 @@ error_code sys_fs_chown(vm::cptr path, s32 uid, s32 gid) return CELL_OK; } -error_code sys_fs_disk_free(vm::ps3::cptr path, vm::ptr total_free, vm::ptr avail_free) +error_code sys_fs_disk_free(vm::cptr path, vm::ptr total_free, vm::ptr avail_free) { sys_fs.warning("sys_fs_disk_free(path=%s total_free=*0x%x avail_free=*0x%x)", path, total_free, avail_free); @@ -1334,7 +1334,7 @@ error_code sys_fs_disk_free(vm::ps3::cptr path, vm::ptr total_free, v return CELL_OK; } -error_code sys_fs_utime(vm::ps3::cptr path, vm::ps3::cptr timep) +error_code sys_fs_utime(vm::cptr path, vm::cptr timep) { sys_fs.warning("sys_fs_utime(path=%s, timep=*0x%x)", path, timep); sys_fs.warning("** actime=%u, modtime=%u", timep->actime, timep->modtime); @@ -1365,21 +1365,21 @@ error_code sys_fs_utime(vm::ps3::cptr path, vm::ps3::cptr t return CELL_OK; } -error_code sys_fs_acl_read(vm::ps3::cptr path, vm::ps3::ptr ptr) +error_code sys_fs_acl_read(vm::cptr path, vm::ptr ptr) { sys_fs.todo("sys_fs_acl_read(path=%s, ptr=*0x%x)", path, ptr); return CELL_OK; } -error_code sys_fs_acl_write(vm::ps3::cptr path, vm::ps3::ptr ptr) +error_code sys_fs_acl_write(vm::cptr path, vm::ptr ptr) { sys_fs.todo("sys_fs_acl_write(path=%s, ptr=*0x%x)", path, ptr); return CELL_OK; } -error_code sys_fs_lsn_get_cda_size(u32 fd, vm::ps3::ptr ptr) +error_code sys_fs_lsn_get_cda_size(u32 fd, vm::ptr ptr) { sys_fs.warning("sys_fs_lsn_get_cda_size(fd=%d, ptr=*0x%x)", fd, ptr); @@ -1395,7 +1395,7 @@ error_code sys_fs_lsn_get_cda_size(u32 fd, vm::ps3::ptr ptr) return CELL_OK; } -error_code sys_fs_lsn_get_cda(u32 fd, vm::ps3::ptr arg2, u64 arg3, vm::ps3::ptr arg4) +error_code sys_fs_lsn_get_cda(u32 fd, vm::ptr arg2, u64 arg3, vm::ptr arg4) { sys_fs.todo("sys_fs_lsn_get_cda(fd=%d, arg2=*0x%x, arg3=0x%x, arg4=*0x%x)", fd, arg2, arg3, arg4); @@ -1442,28 +1442,28 @@ error_code sys_fs_lsn_unlock(u32 fd) return CELL_OK; } -error_code sys_fs_lsn_read(u32 fd, vm::ps3::cptr ptr, u64 size) +error_code sys_fs_lsn_read(u32 fd, vm::cptr ptr, u64 size) { sys_fs.todo("sys_fs_lsn_read(fd=%d, ptr=*0x%x, size=0x%x)", fd, ptr, size); return CELL_OK; } -error_code sys_fs_lsn_write(u32 fd, vm::ps3::cptr ptr, u64 size) +error_code sys_fs_lsn_write(u32 fd, vm::cptr ptr, u64 size) { sys_fs.todo("sys_fs_lsn_write(fd=%d, ptr=*0x%x, size=0x%x)", fd, ptr, size); return CELL_OK; } -error_code sys_fs_mapped_allocate(u32 fd, u64 size, vm::ps3::pptr out_ptr) +error_code sys_fs_mapped_allocate(u32 fd, u64 size, vm::pptr out_ptr) { sys_fs.todo("sys_fs_mapped_allocate(fd=%d, arg2=0x%x, out_ptr=**0x%x)", fd, size, out_ptr); return CELL_OK; } -error_code sys_fs_mapped_free(u32 fd, vm::ps3::ptr ptr) +error_code sys_fs_mapped_free(u32 fd, vm::ptr ptr) { sys_fs.todo("sys_fs_mapped_free(fd=%d, ptr=0x%#x)", fd, ptr); diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.h b/rpcs3/Emu/Cell/lv2/sys_fs.h index d4d1a070d3..4ab07f63aa 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.h +++ b/rpcs3/Emu/Cell/lv2/sys_fs.h @@ -186,10 +186,10 @@ struct lv2_file final : lv2_fs_object } // File reading with intermediate buffer - u64 op_read(vm::ps3::ptr buf, u64 size); + u64 op_read(vm::ptr buf, u64 size); // File writing with intermediate buffer - u64 op_write(vm::ps3::cptr buf, u64 size); + u64 op_write(vm::cptr buf, u64 size); // For MSELF support struct file_view; @@ -299,7 +299,7 @@ struct lv2_file_c0000002 : lv2_file_op be_t op; be_t _x8; - vm::ps3::bcptr path; + vm::bcptr path; be_t _x10; // 0 be_t _x14; @@ -317,7 +317,7 @@ struct lv2_file_c0000006 : lv2_file_op be_t _x4; // 0x10 be_t _x8; // 0x18 be_t _xc; // 0x9 - vm::ps3::bcptr name; + vm::bcptr name; be_t _x14; // 0 be_t _x18; // 0x80010003 be_t _x1c; // 0 @@ -332,7 +332,7 @@ struct lv2_file_e0000017 : lv2_file_op be_t _x4; // 0x10, offset be_t _x8; // 0x20, offset be_t _xc; // - - vm::ps3::bcptr file_path; + vm::bcptr file_path; be_t file_size; be_t out_code; }; @@ -341,43 +341,43 @@ CHECK_SIZE(lv2_file_e0000017, 0x28); // Syscalls -error_code sys_fs_test(u32 arg1, u32 arg2, vm::ps3::ptr arg3, u32 arg4, vm::ps3::ptr buf, u32 buf_size); -error_code sys_fs_open(vm::ps3::cptr path, s32 flags, vm::ps3::ptr fd, s32 mode, vm::ps3::cptr arg, u64 size); -error_code sys_fs_read(u32 fd, vm::ps3::ptr buf, u64 nbytes, vm::ps3::ptr nread); -error_code sys_fs_write(u32 fd, vm::ps3::cptr buf, u64 nbytes, vm::ps3::ptr nwrite); +error_code sys_fs_test(u32 arg1, u32 arg2, vm::ptr arg3, u32 arg4, vm::ptr buf, u32 buf_size); +error_code sys_fs_open(vm::cptr path, s32 flags, vm::ptr fd, s32 mode, vm::cptr arg, u64 size); +error_code sys_fs_read(u32 fd, vm::ptr buf, u64 nbytes, vm::ptr nread); +error_code sys_fs_write(u32 fd, vm::cptr buf, u64 nbytes, vm::ptr nwrite); error_code sys_fs_close(u32 fd); -error_code sys_fs_opendir(vm::ps3::cptr path, vm::ps3::ptr fd); -error_code sys_fs_readdir(u32 fd, vm::ps3::ptr dir, vm::ps3::ptr nread); +error_code sys_fs_opendir(vm::cptr path, vm::ptr fd); +error_code sys_fs_readdir(u32 fd, vm::ptr dir, vm::ptr nread); error_code sys_fs_closedir(u32 fd); -error_code sys_fs_stat(vm::ps3::cptr path, vm::ps3::ptr sb); -error_code sys_fs_fstat(u32 fd, vm::ps3::ptr sb); -error_code sys_fs_link(vm::ps3::cptr from, vm::ps3::cptr to); -error_code sys_fs_mkdir(vm::ps3::cptr path, s32 mode); -error_code sys_fs_rename(vm::ps3::cptr from, vm::ps3::cptr to); -error_code sys_fs_rmdir(vm::ps3::cptr path); -error_code sys_fs_unlink(vm::ps3::cptr path); -error_code sys_fs_access(vm::ps3::cptr path, s32 mode); -error_code sys_fs_fcntl(u32 fd, u32 op, vm::ps3::ptr arg, u32 size); -error_code sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ps3::ptr pos); +error_code sys_fs_stat(vm::cptr path, vm::ptr sb); +error_code sys_fs_fstat(u32 fd, vm::ptr sb); +error_code sys_fs_link(vm::cptr from, vm::cptr to); +error_code sys_fs_mkdir(vm::cptr path, s32 mode); +error_code sys_fs_rename(vm::cptr from, vm::cptr to); +error_code sys_fs_rmdir(vm::cptr path); +error_code sys_fs_unlink(vm::cptr path); +error_code sys_fs_access(vm::cptr path, s32 mode); +error_code sys_fs_fcntl(u32 fd, u32 op, vm::ptr arg, u32 size); +error_code sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ptr pos); error_code sys_fs_fdatasync(u32 fd); error_code sys_fs_fsync(u32 fd); -error_code sys_fs_fget_block_size(u32 fd, vm::ps3::ptr sector_size, vm::ps3::ptr block_size, vm::ps3::ptr arg4, vm::ps3::ptr arg5); -error_code sys_fs_get_block_size(vm::ps3::cptr path, vm::ps3::ptr sector_size, vm::ps3::ptr block_size, vm::ps3::ptr arg4); -error_code sys_fs_truncate(vm::ps3::cptr path, u64 size); +error_code sys_fs_fget_block_size(u32 fd, vm::ptr sector_size, vm::ptr block_size, vm::ptr arg4, vm::ptr arg5); +error_code sys_fs_get_block_size(vm::cptr path, vm::ptr sector_size, vm::ptr block_size, vm::ptr arg4); +error_code sys_fs_truncate(vm::cptr path, u64 size); error_code sys_fs_ftruncate(u32 fd, u64 size); -error_code sys_fs_symbolic_link(vm::ps3::cptr target, vm::ps3::cptr linkpath); -error_code sys_fs_chmod(vm::ps3::cptr path, s32 mode); -error_code sys_fs_chown(vm::ps3::cptr path, s32 uid, s32 gid); -error_code sys_fs_disk_free(vm::ps3::cptr path, vm::ps3::ptr total_free, vm::ps3::ptr avail_free); -error_code sys_fs_utime(vm::ps3::cptr path, vm::ps3::cptr timep); -error_code sys_fs_acl_read(vm::ps3::cptr path, vm::ps3::ptr); -error_code sys_fs_acl_write(vm::ps3::cptr path, vm::ps3::ptr); -error_code sys_fs_lsn_get_cda_size(u32 fd, vm::ps3::ptr ptr); -error_code sys_fs_lsn_get_cda(u32 fd, vm::ps3::ptr, u64, vm::ps3::ptr); +error_code sys_fs_symbolic_link(vm::cptr target, vm::cptr linkpath); +error_code sys_fs_chmod(vm::cptr path, s32 mode); +error_code sys_fs_chown(vm::cptr path, s32 uid, s32 gid); +error_code sys_fs_disk_free(vm::cptr path, vm::ptr total_free, vm::ptr avail_free); +error_code sys_fs_utime(vm::cptr path, vm::cptr timep); +error_code sys_fs_acl_read(vm::cptr path, vm::ptr); +error_code sys_fs_acl_write(vm::cptr path, vm::ptr); +error_code sys_fs_lsn_get_cda_size(u32 fd, vm::ptr ptr); +error_code sys_fs_lsn_get_cda(u32 fd, vm::ptr, u64, vm::ptr); error_code sys_fs_lsn_lock(u32 fd); error_code sys_fs_lsn_unlock(u32 fd); -error_code sys_fs_lsn_read(u32 fd, vm::ps3::cptr, u64); -error_code sys_fs_lsn_write(u32 fd, vm::ps3::cptr, u64); -error_code sys_fs_mapped_allocate(u32 fd, u64, vm::ps3::pptr out_ptr); -error_code sys_fs_mapped_free(u32 fd, vm::ps3::ptr ptr); +error_code sys_fs_lsn_read(u32 fd, vm::cptr, u64); +error_code sys_fs_lsn_write(u32 fd, vm::cptr, u64); +error_code sys_fs_mapped_allocate(u32 fd, u64, vm::pptr out_ptr); +error_code sys_fs_mapped_free(u32 fd, vm::ptr ptr); error_code sys_fs_truncate2(u32 fd, u64 size); diff --git a/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp b/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp index 70b3661029..72ccafadbd 100644 --- a/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_gamepad.cpp @@ -7,72 +7,72 @@ #include "sys_gamepad.h" -namespace vm { using namespace ps3; } + logs::channel sys_gamepad("sys_gamepad"); -u32 sys_gamepad_ycon_initalize(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_initalize(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_initalize(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -u32 sys_gamepad_ycon_finalize(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_finalize(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_finalize(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -u32 sys_gamepad_ycon_has_input_ownership(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_has_input_ownership(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_has_input_ownership(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -u32 sys_gamepad_ycon_enumerate_device(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_enumerate_device(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_enumerate_device(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -u32 sys_gamepad_ycon_get_device_info(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_get_device_info(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_get_device_info(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -u32 sys_gamepad_ycon_read_raw_report(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_read_raw_report(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_read_raw_report(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -u32 sys_gamepad_ycon_write_raw_report(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_write_raw_report(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_write_raw_report(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -u32 sys_gamepad_ycon_get_feature(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_get_feature(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_get_feature(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -u32 sys_gamepad_ycon_set_feature(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_set_feature(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_set_feature(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -u32 sys_gamepad_ycon_is_gem(vm::ps3::ptr in, vm::ps3::ptr out) +u32 sys_gamepad_ycon_is_gem(vm::ptr in, vm::ptr out) { sys_gamepad.todo("sys_gamepad_ycon_is_gem(in=%d, out=%d) -> CELL_OK", in, out); return CELL_OK; } -// syscall(621,packet_id,uint8_t *in,uint8_t *out) Talk:LV2_Functions_and_Syscalls#Syscall_621_.280x26D.29 gamepad_if usage -u32 sys_gamepad_ycon_if(uint8_t packet_id, vm::ps3::ptr in, vm::ps3::ptr out) +// syscall(621,packet_id,uint8_t *in,uint8_t *out) Talk:LV2_Functions_and_Syscalls#Syscall_621_.280x26D.29 gamepad_if usage +u32 sys_gamepad_ycon_if(uint8_t packet_id, vm::ptr in, vm::ptr out) { switch (packet_id) diff --git a/rpcs3/Emu/Cell/lv2/sys_gamepad.h b/rpcs3/Emu/Cell/lv2/sys_gamepad.h index 53c1421cc0..9e9a6ff9a9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_gamepad.h +++ b/rpcs3/Emu/Cell/lv2/sys_gamepad.h @@ -4,4 +4,4 @@ //Syscalls -u32 sys_gamepad_ycon_if(uint8_t packet_id, vm::ps3::ptr in, vm::ps3::ptr out); +u32 sys_gamepad_ycon_if(uint8_t packet_id, vm::ptr in, vm::ptr out); diff --git a/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp b/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp index df7eaa6aa0..2c99fe72ee 100644 --- a/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_interrupt.cpp @@ -8,7 +8,7 @@ #include "Emu/Cell/PPUOpcodes.h" #include "sys_interrupt.h" -namespace vm { using namespace ps3; } + logs::channel sys_interrupt("sys_interrupt"); diff --git a/rpcs3/Emu/Cell/lv2/sys_interrupt.h b/rpcs3/Emu/Cell/lv2/sys_interrupt.h index 637ffd17e8..dca783b03e 100644 --- a/rpcs3/Emu/Cell/lv2/sys_interrupt.h +++ b/rpcs3/Emu/Cell/lv2/sys_interrupt.h @@ -33,6 +33,6 @@ struct lv2_int_serv final : lv2_obj // Syscalls error_code sys_interrupt_tag_destroy(u32 intrtag); -error_code _sys_interrupt_thread_establish(vm::ps3::ptr ih, u32 intrtag, u32 intrthread, u64 arg1, u64 arg2); -error_code _sys_interrupt_thread_disestablish(ppu_thread& ppu, u32 ih, vm::ps3::ptr r13); +error_code _sys_interrupt_thread_establish(vm::ptr ih, u32 intrtag, u32 intrthread, u64 arg1, u64 arg2); +error_code _sys_interrupt_thread_disestablish(ppu_thread& ppu, u32 ih, vm::ptr r13); void sys_interrupt_thread_eoi(ppu_thread& ppu); diff --git a/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp b/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp index 51fe3fbfa6..36cb6071a6 100644 --- a/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_lwcond.cpp @@ -8,7 +8,7 @@ #include "sys_lwmutex.h" #include "sys_lwcond.h" -namespace vm { using namespace ps3; } + logs::channel sys_lwcond("sys_lwcond"); @@ -126,7 +126,7 @@ error_code _sys_lwcond_signal(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id, u3 return nullptr; }); - + if ((lwmutex_id && !mutex) || !cond) { return CELL_ESRCH; diff --git a/rpcs3/Emu/Cell/lv2/sys_lwcond.h b/rpcs3/Emu/Cell/lv2/sys_lwcond.h index 82a547248f..a8fe686f27 100644 --- a/rpcs3/Emu/Cell/lv2/sys_lwcond.h +++ b/rpcs3/Emu/Cell/lv2/sys_lwcond.h @@ -15,7 +15,7 @@ struct sys_lwcond_attribute_t struct sys_lwcond_t { - vm::ps3::bptr lwmutex; + vm::bptr lwmutex; be_t lwcond_queue; // lwcond pseudo-id }; @@ -25,13 +25,13 @@ struct lv2_lwcond final : lv2_obj const u64 name; const u32 lwid; - vm::ps3::ptr control; + vm::ptr control; semaphore<> mutex; atomic_t waiters{0}; std::deque sq; - lv2_lwcond(u64 name, u32 lwid, vm::ps3::ptr control) + lv2_lwcond(u64 name, u32 lwid, vm::ptr control) : name(name) , lwid(lwid) , control(control) @@ -44,7 +44,7 @@ class ppu_thread; // Syscalls -error_code _sys_lwcond_create(vm::ps3::ptr lwcond_id, u32 lwmutex_id, vm::ps3::ptr control, u64 name, u32 arg5); +error_code _sys_lwcond_create(vm::ptr lwcond_id, u32 lwmutex_id, vm::ptr control, u64 name, u32 arg5); error_code _sys_lwcond_destroy(u32 lwcond_id); error_code _sys_lwcond_signal(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id, u32 ppu_thread_id, u32 mode); error_code _sys_lwcond_signal_all(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id, u32 mode); diff --git a/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp b/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp index 9bdb334fee..4416d98ae6 100644 --- a/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_lwmutex.cpp @@ -7,7 +7,7 @@ #include "Emu/Cell/PPUThread.h" #include "sys_lwmutex.h" -namespace vm { using namespace ps3; } + logs::channel sys_lwmutex("sys_lwmutex"); @@ -19,7 +19,7 @@ error_code _sys_lwmutex_create(vm::ptr lwmutex_id, u32 protocol, vm::ptr all_info; }; - + be_t attribute; be_t recursive_count; be_t sleep_queue; // lwmutex pseudo-id @@ -54,14 +54,14 @@ struct lv2_lwmutex final : lv2_obj static const u32 id_base = 0x95000000; const u32 protocol; - const vm::ps3::ptr control; + const vm::ptr control; const u64 name; semaphore<> mutex; atomic_t signaled{0}; std::deque sq; - lv2_lwmutex(u32 protocol, vm::ps3::ptr control, u64 name) + lv2_lwmutex(u32 protocol, vm::ptr control, u64 name) : protocol(protocol) , control(control) , name(name) @@ -74,7 +74,7 @@ class ppu_thread; // Syscalls -error_code _sys_lwmutex_create(vm::ps3::ptr lwmutex_id, u32 protocol, vm::ps3::ptr control, u32 arg4, u64 name, u32 arg6); +error_code _sys_lwmutex_create(vm::ptr lwmutex_id, u32 protocol, vm::ptr control, u32 arg4, u64 name, u32 arg6); error_code _sys_lwmutex_destroy(u32 lwmutex_id); error_code _sys_lwmutex_lock(ppu_thread& ppu, u32 lwmutex_id, u64 timeout); error_code _sys_lwmutex_trylock(u32 lwmutex_id); diff --git a/rpcs3/Emu/Cell/lv2/sys_memory.cpp b/rpcs3/Emu/Cell/lv2/sys_memory.cpp index 52a15054cd..2c5d5018b3 100644 --- a/rpcs3/Emu/Cell/lv2/sys_memory.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_memory.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "sys_memory.h" -namespace vm { using namespace ps3; } + logs::channel sys_memory("sys_memory"); @@ -22,7 +22,7 @@ error_code sys_memory_allocate(u32 size, u64 flags, vm::ptr alloc_addr) break; } - + case SYS_MEMORY_PAGE_SIZE_64K: { if (size % 0x10000) @@ -57,7 +57,7 @@ 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) { sys_memory.warning("sys_memory_allocate_from_container(size=0x%x, cid=0x%x, flags=0x%llx, alloc_addr=*0x%x)", size, cid, flags, alloc_addr); - + // Check allocation size switch (flags) { @@ -172,7 +172,7 @@ error_code sys_memory_get_page_attribute(u32 addr, vm::ptr attr { attr->page_size = 4096; } - + return CELL_OK; } @@ -264,11 +264,11 @@ error_code sys_memory_container_get_size(vm::ptr mem_info, u3 } mem_info->total_user_memory = ct->size; // Total container memory - // Available container memory, minus a hidden 'buffer' + // Available container memory, minus a hidden 'buffer' // This buffer seems to be used by the PS3 OS for c style 'mallocs' - // Todo: Research this more, even though we dont use this buffer, it helps out games when calculating + // Todo: Research this more, even though we dont use this buffer, it helps out games when calculating // expected memory they can use allowing them to boot - mem_info->available_user_memory = ct->size - ct->used - 0x1000000; + mem_info->available_user_memory = ct->size - ct->used - 0x1000000; return CELL_OK; } diff --git a/rpcs3/Emu/Cell/lv2/sys_memory.h b/rpcs3/Emu/Cell/lv2/sys_memory.h index beaa008a8d..c18f650220 100644 --- a/rpcs3/Emu/Cell/lv2/sys_memory.h +++ b/rpcs3/Emu/Cell/lv2/sys_memory.h @@ -55,7 +55,7 @@ struct lv2_memory_container const u32 size = 0xEC00000; // Amount of "physical" memory in this container atomic_t used{}; // Amount of "physical" memory currently used - + lv2_memory_container() = default; lv2_memory_container(u32 size) @@ -84,11 +84,11 @@ struct lv2_memory_container }; // SysCalls -error_code sys_memory_allocate(u32 size, u64 flags, vm::ps3::ptr alloc_addr); -error_code sys_memory_allocate_from_container(u32 size, u32 cid, u64 flags, vm::ps3::ptr alloc_addr); +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::ps3::ptr attr); -error_code sys_memory_get_user_memory_size(vm::ps3::ptr mem_info); -error_code sys_memory_container_create(vm::ps3::ptr cid, u32 size); +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_container_create(vm::ptr cid, u32 size); error_code sys_memory_container_destroy(u32 cid); -error_code sys_memory_container_get_size(vm::ps3::ptr mem_info, u32 cid); +error_code sys_memory_container_get_size(vm::ptr mem_info, u32 cid); diff --git a/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp b/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp index 94061efa18..68b822b043 100644 --- a/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_mmapper.cpp @@ -4,7 +4,7 @@ #include "sys_ppu_thread.h" #include "Emu/Cell/lv2/sys_event.h" -namespace vm { using namespace ps3; } + logs::channel sys_mmapper("sys_mmapper"); @@ -23,7 +23,7 @@ error_code sys_mmapper_allocate_address(u64 size, u64 flags, u64 alignment, vm:: } // This is a workaround for psl1ght, which gives us an alignment of 0, which is technically invalid, but apparently is allowed on actual ps3 - // https://github.com/ps3dev/PSL1GHT/blob/534e58950732c54dc6a553910b653c99ba6e9edc/ppu/librt/sbrk.c#L71 + // https://github.com/ps3dev/PSL1GHT/blob/534e58950732c54dc6a553910b653c99ba6e9edc/ppu/librt/sbrk.c#L71 if (!alignment) { alignment = 0x10000000; @@ -60,7 +60,7 @@ error_code sys_mmapper_allocate_fixed_address() { return CELL_EEXIST; } - + return CELL_OK; } @@ -124,7 +124,7 @@ error_code sys_mmapper_allocate_shared_memory_from_container(u64 unk, u32 size, { return CELL_EALIGN; } - + break; } @@ -350,7 +350,7 @@ error_code sys_mmapper_unmap_shared_memory(u32 addr, vm::ptr mem_id) *mem_id = id; return true; } - + return false; }); diff --git a/rpcs3/Emu/Cell/lv2/sys_mmapper.h b/rpcs3/Emu/Cell/lv2/sys_mmapper.h index 6ddb15e02e..515bd593ac 100644 --- a/rpcs3/Emu/Cell/lv2/sys_mmapper.h +++ b/rpcs3/Emu/Cell/lv2/sys_mmapper.h @@ -68,14 +68,14 @@ struct page_fault_event_entries }; // SysCalls -error_code sys_mmapper_allocate_address(u64 size, u64 flags, u64 alignment, vm::ps3::ptr alloc_addr); +error_code sys_mmapper_allocate_address(u64 size, u64 flags, u64 alignment, vm::ptr alloc_addr); error_code sys_mmapper_allocate_fixed_address(); -error_code sys_mmapper_allocate_shared_memory(u64 unk, u32 size, u64 flags, vm::ps3::ptr mem_id); -error_code sys_mmapper_allocate_shared_memory_from_container(u64 unk, u32 size, u32 cid, u64 flags, vm::ps3::ptr mem_id); +error_code sys_mmapper_allocate_shared_memory(u64 unk, u32 size, u64 flags, vm::ptr mem_id); +error_code sys_mmapper_allocate_shared_memory_from_container(u64 unk, u32 size, u32 cid, u64 flags, vm::ptr mem_id); error_code sys_mmapper_change_address_access_right(u32 addr, u64 flags); error_code sys_mmapper_free_address(u32 addr); error_code sys_mmapper_free_shared_memory(u32 mem_id); error_code sys_mmapper_map_shared_memory(u32 addr, u32 mem_id, u64 flags); -error_code sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, vm::ps3::ptr alloc_addr); -error_code sys_mmapper_unmap_shared_memory(u32 addr, vm::ps3::ptr mem_id); +error_code sys_mmapper_search_and_map(u32 start_addr, u32 mem_id, u64 flags, vm::ptr alloc_addr); +error_code sys_mmapper_unmap_shared_memory(u32 addr, vm::ptr mem_id); error_code sys_mmapper_enable_page_fault_notification(u32 start_addr, u32 event_queue_id); diff --git a/rpcs3/Emu/Cell/lv2/sys_mutex.cpp b/rpcs3/Emu/Cell/lv2/sys_mutex.cpp index e05e28e576..97238cae56 100644 --- a/rpcs3/Emu/Cell/lv2/sys_mutex.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_mutex.cpp @@ -8,7 +8,7 @@ #include "Emu/Cell/PPUThread.h" #include "sys_mutex.h" -namespace vm { using namespace ps3; } + logs::channel sys_mutex("sys_mutex"); @@ -42,7 +42,7 @@ error_code sys_mutex_create(vm::ptr mutex_id, vm::ptrrecursive) { case SYS_SYNC_RECURSIVE: break; - case SYS_SYNC_NOT_RECURSIVE: break; + case SYS_SYNC_NOT_RECURSIVE: break; default: { sys_mutex.error("sys_mutex_create(): unknown recursive (0x%x)", attr->recursive); diff --git a/rpcs3/Emu/Cell/lv2/sys_mutex.h b/rpcs3/Emu/Cell/lv2/sys_mutex.h index 13966f2483..28ce95d430 100644 --- a/rpcs3/Emu/Cell/lv2/sys_mutex.h +++ b/rpcs3/Emu/Cell/lv2/sys_mutex.h @@ -147,7 +147,7 @@ class ppu_thread; // Syscalls -error_code sys_mutex_create(vm::ps3::ptr mutex_id, vm::ps3::ptr attr); +error_code sys_mutex_create(vm::ptr mutex_id, vm::ptr attr); error_code sys_mutex_destroy(u32 mutex_id); error_code sys_mutex_lock(ppu_thread& ppu, u32 mutex_id, u64 timeout); error_code sys_mutex_trylock(ppu_thread& ppu, u32 mutex_id); diff --git a/rpcs3/Emu/Cell/lv2/sys_net.cpp b/rpcs3/Emu/Cell/lv2/sys_net.cpp index 8202abd6e3..a4763f4c97 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_net.cpp @@ -24,7 +24,7 @@ #include #endif -namespace vm { using namespace ps3; } + logs::channel sys_net("sys_net"); diff --git a/rpcs3/Emu/Cell/lv2/sys_net.h b/rpcs3/Emu/Cell/lv2/sys_net.h index 3cd2e3daff..7a408321fa 100644 --- a/rpcs3/Emu/Cell/lv2/sys_net.h +++ b/rpcs3/Emu/Cell/lv2/sys_net.h @@ -187,11 +187,11 @@ struct sys_net_fd_set // hostent prefixed with sys_net_ struct sys_net_hostent { - vm::ps3::bptr h_name; - vm::ps3::bpptr h_aliases; + vm::bptr h_name; + vm::bpptr h_aliases; be_t h_addrtype; be_t h_length; - vm::ps3::bpptr h_addr_list; + vm::bpptr h_addr_list; }; // in_addr prefixed with sys_net_ @@ -204,7 +204,7 @@ struct sys_net_in_addr struct sys_net_iovec { be_t zero1; - vm::ps3::bptr iov_base; + vm::bptr iov_base; be_t zero2; be_t iov_len; }; @@ -220,15 +220,15 @@ struct sys_net_ip_mreq struct sys_net_msghdr { be_t zero1; - vm::ps3::bptr msg_name; + vm::bptr msg_name; be_t msg_namelen; be_t pad1; be_t zero2; - vm::ps3::bptr msg_iov; + vm::bptr msg_iov; be_t msg_iovlen; be_t pad2; be_t zero3; - vm::ps3::bptr msg_control; + vm::bptr msg_control; be_t msg_controllen; be_t msg_flags; }; @@ -360,30 +360,30 @@ class ppu_thread; // Syscalls -s32 sys_net_bnet_accept(ppu_thread&, s32 s, vm::ps3::ptr addr, vm::ps3::ptr paddrlen); -s32 sys_net_bnet_bind(ppu_thread&, s32 s, vm::ps3::cptr addr, u32 addrlen); -s32 sys_net_bnet_connect(ppu_thread&, s32 s, vm::ps3::ptr addr, u32 addrlen); -s32 sys_net_bnet_getpeername(ppu_thread&, s32 s, vm::ps3::ptr addr, vm::ps3::ptr paddrlen); -s32 sys_net_bnet_getsockname(ppu_thread&, s32 s, vm::ps3::ptr addr, vm::ps3::ptr paddrlen); -s32 sys_net_bnet_getsockopt(ppu_thread&, s32 s, s32 level, s32 optname, vm::ps3::ptr optval, vm::ps3::ptr optlen); +s32 sys_net_bnet_accept(ppu_thread&, s32 s, vm::ptr addr, vm::ptr paddrlen); +s32 sys_net_bnet_bind(ppu_thread&, s32 s, vm::cptr addr, u32 addrlen); +s32 sys_net_bnet_connect(ppu_thread&, s32 s, vm::ptr addr, u32 addrlen); +s32 sys_net_bnet_getpeername(ppu_thread&, s32 s, vm::ptr addr, vm::ptr paddrlen); +s32 sys_net_bnet_getsockname(ppu_thread&, s32 s, vm::ptr addr, vm::ptr paddrlen); +s32 sys_net_bnet_getsockopt(ppu_thread&, s32 s, s32 level, s32 optname, vm::ptr optval, vm::ptr optlen); s32 sys_net_bnet_listen(ppu_thread&, s32 s, s32 backlog); -s32 sys_net_bnet_recvfrom(ppu_thread&, s32 s, vm::ps3::ptr buf, u32 len, s32 flags, vm::ps3::ptr addr, vm::ps3::ptr paddrlen); -s32 sys_net_bnet_recvmsg(ppu_thread&, s32 s, vm::ps3::ptr msg, s32 flags); -s32 sys_net_bnet_sendmsg(ppu_thread&, s32 s, vm::ps3::cptr msg, s32 flags); -s32 sys_net_bnet_sendto(ppu_thread&, s32 s, vm::ps3::cptr buf, u32 len, s32 flags, vm::ps3::cptr addr, u32 addrlen); -s32 sys_net_bnet_setsockopt(ppu_thread&, s32 s, s32 level, s32 optname, vm::ps3::cptr optval, u32 optlen); +s32 sys_net_bnet_recvfrom(ppu_thread&, s32 s, vm::ptr buf, u32 len, s32 flags, vm::ptr addr, vm::ptr paddrlen); +s32 sys_net_bnet_recvmsg(ppu_thread&, s32 s, vm::ptr msg, s32 flags); +s32 sys_net_bnet_sendmsg(ppu_thread&, s32 s, vm::cptr msg, s32 flags); +s32 sys_net_bnet_sendto(ppu_thread&, s32 s, vm::cptr buf, u32 len, s32 flags, vm::cptr addr, u32 addrlen); +s32 sys_net_bnet_setsockopt(ppu_thread&, s32 s, s32 level, s32 optname, vm::cptr optval, u32 optlen); s32 sys_net_bnet_shutdown(ppu_thread&, s32 s, s32 how); s32 sys_net_bnet_socket(ppu_thread&, s32 family, s32 type, s32 protocol); s32 sys_net_bnet_close(ppu_thread&, s32 s); -s32 sys_net_bnet_poll(ppu_thread&, vm::ps3::ptr fds, s32 nfds, s32 ms); -s32 sys_net_bnet_select(ppu_thread&, s32 nfds, vm::ps3::ptr readfds, vm::ps3::ptr writefds, vm::ps3::ptr exceptfds, vm::ps3::ptr timeout); +s32 sys_net_bnet_poll(ppu_thread&, vm::ptr fds, s32 nfds, s32 ms); +s32 sys_net_bnet_select(ppu_thread&, s32 nfds, vm::ptr readfds, vm::ptr writefds, vm::ptr exceptfds, vm::ptr timeout); s32 _sys_net_open_dump(ppu_thread&, s32 len, s32 flags); -s32 _sys_net_read_dump(ppu_thread&, s32 id, vm::ps3::ptr buf, s32 len, vm::ps3::ptr pflags); -s32 _sys_net_close_dump(ppu_thread&, s32 id, vm::ps3::ptr pflags); -s32 _sys_net_write_dump(ppu_thread&, s32 id, vm::ps3::cptr buf, s32 len, u32 unknown); +s32 _sys_net_read_dump(ppu_thread&, s32 id, vm::ptr buf, s32 len, vm::ptr pflags); +s32 _sys_net_close_dump(ppu_thread&, s32 id, vm::ptr pflags); +s32 _sys_net_write_dump(ppu_thread&, s32 id, vm::cptr buf, s32 len, u32 unknown); s32 sys_net_abort(ppu_thread&, s32 type, u64 arg, s32 flags); -s32 sys_net_infoctl(ppu_thread&, s32 cmd, vm::ps3::ptr arg); -s32 sys_net_control(ppu_thread&, u32 arg1, s32 arg2, vm::ps3::ptr arg3, s32 arg4); +s32 sys_net_infoctl(ppu_thread&, s32 cmd, vm::ptr arg); +s32 sys_net_control(ppu_thread&, u32 arg1, s32 arg2, vm::ptr arg3, s32 arg4); s32 sys_net_bnet_ioctl(ppu_thread&, s32 arg1, u32 arg2, u32 arg3); -s32 sys_net_bnet_sysctl(ppu_thread&, u32 arg1, u32 arg2, u32 arg3, vm::ps3::ptr arg4, u32 arg5, u32 arg6); +s32 sys_net_bnet_sysctl(ppu_thread&, u32 arg1, u32 arg2, u32 arg3, vm::ptr arg4, u32 arg5, u32 arg6); s32 sys_net_eurus_post_command(ppu_thread&, s32 arg1, u32 arg2, u32 arg3); diff --git a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp index 75ab34d083..bf00d5a089 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_ppu_thread.cpp @@ -9,7 +9,7 @@ #include "sys_event.h" #include "sys_mmapper.h" -namespace vm { using namespace ps3; } + logs::channel sys_ppu_thread("sys_ppu_thread"); @@ -105,7 +105,7 @@ error_code sys_ppu_thread_join(ppu_thread& ppu, u32 thread_id, vm::ptr vptr { lv2_obj::sleep(ppu); } - + return result; }); @@ -113,7 +113,7 @@ error_code sys_ppu_thread_join(ppu_thread& ppu, u32 thread_id, vm::ptr vptr { return CELL_ESRCH; } - + if (thread.ret && thread.ret != CELL_EBUSY) { return thread.ret; @@ -182,7 +182,7 @@ error_code sys_ppu_thread_detach(u32 thread_id) { idm::remove(thread_id); } - + return CELL_OK; } @@ -448,4 +448,3 @@ error_code sys_ppu_thread_get_page_fault_context(u32 thread_id, vm::ptr entry; // vm::ps3::bptr - be_t tls; // vm::ps3::bptr + be_t entry; // vm::bptr + be_t tls; // vm::bptr }; struct sys_ppu_thread_icontext_t @@ -56,16 +56,16 @@ enum : u32 void _sys_ppu_thread_exit(ppu_thread& ppu, u64 errorcode); void sys_ppu_thread_yield(ppu_thread& ppu); -error_code sys_ppu_thread_join(ppu_thread& ppu, u32 thread_id, vm::ps3::ptr vptr); +error_code sys_ppu_thread_join(ppu_thread& ppu, u32 thread_id, vm::ptr vptr); error_code sys_ppu_thread_detach(u32 thread_id); -void sys_ppu_thread_get_join_state(ppu_thread& ppu, vm::ps3::ptr isjoinable); +void sys_ppu_thread_get_join_state(ppu_thread& ppu, vm::ptr isjoinable); error_code sys_ppu_thread_set_priority(ppu_thread& ppu, u32 thread_id, s32 prio); -error_code sys_ppu_thread_get_priority(u32 thread_id, vm::ps3::ptr priop); -error_code sys_ppu_thread_get_stack_information(ppu_thread& ppu, vm::ps3::ptr sp); +error_code sys_ppu_thread_get_priority(u32 thread_id, vm::ptr priop); +error_code sys_ppu_thread_get_stack_information(ppu_thread& ppu, vm::ptr sp); error_code sys_ppu_thread_stop(u32 thread_id); error_code sys_ppu_thread_restart(u32 thread_id); -error_code _sys_ppu_thread_create(vm::ps3::ptr thread_id, vm::ps3::ptr param, u64 arg, u64 arg4, s32 prio, u32 stacksize, u64 flags, vm::ps3::cptr threadname); +error_code _sys_ppu_thread_create(vm::ptr thread_id, vm::ptr param, u64 arg, u64 arg4, s32 prio, u32 stacksize, u64 flags, vm::cptr threadname); error_code sys_ppu_thread_start(ppu_thread& ppu, u32 thread_id); -error_code sys_ppu_thread_rename(u32 thread_id, vm::ps3::cptr name); +error_code sys_ppu_thread_rename(u32 thread_id, vm::cptr name); error_code sys_ppu_thread_recover_page_fault(u32 thread_id); -error_code sys_ppu_thread_get_page_fault_context(u32 thread_id, vm::ps3::ptr ctxt); +error_code sys_ppu_thread_get_page_fault_context(u32 thread_id, vm::ptr ctxt); diff --git a/rpcs3/Emu/Cell/lv2/sys_process.cpp b/rpcs3/Emu/Cell/lv2/sys_process.cpp index ca16783b2e..5c504e05fd 100644 --- a/rpcs3/Emu/Cell/lv2/sys_process.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_process.cpp @@ -23,7 +23,7 @@ #include "sys_fs.h" #include "sys_process.h" -namespace vm { using namespace ps3; } + logs::channel sys_process("sys_process"); diff --git a/rpcs3/Emu/Cell/lv2/sys_process.h b/rpcs3/Emu/Cell/lv2/sys_process.h index e38b804680..f5a77c7f7a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_process.h +++ b/rpcs3/Emu/Cell/lv2/sys_process.h @@ -30,7 +30,7 @@ struct sys_exit2_param be_t next_size; be_t prio; be_t flags; - vm::ps3::bpptr args; + vm::bpptr args; }; // Auxiliary functions @@ -41,15 +41,15 @@ s32 process_is_spu_lock_line_reservation_address(u32 addr, u64 flags); // SysCalls s32 sys_process_getpid(); s32 sys_process_getppid(); -s32 sys_process_get_number_of_object(u32 object, vm::ps3::ptr nump); -s32 sys_process_get_id(u32 object, vm::ps3::ptr buffer, u32 size, vm::ps3::ptr set_size); -s32 _sys_process_get_paramsfo(vm::ps3::ptr buffer); -s32 sys_process_get_sdk_version(u32 pid, vm::ps3::ptr version); +s32 sys_process_get_number_of_object(u32 object, vm::ptr nump); +s32 sys_process_get_id(u32 object, vm::ptr buffer, u32 size, vm::ptr set_size); +s32 _sys_process_get_paramsfo(vm::ptr buffer); +s32 sys_process_get_sdk_version(u32 pid, vm::ptr version); s32 sys_process_get_status(u64 unk); s32 sys_process_is_spu_lock_line_reservation_address(u32 addr, u64 flags); s32 sys_process_kill(u32 pid); -s32 sys_process_wait_for_child(u32 pid, vm::ps3::ptr status, u64 unk); +s32 sys_process_wait_for_child(u32 pid, vm::ptr status, u64 unk); s32 sys_process_wait_for_child2(u64 unk1, u64 unk2, u64 unk3, u64 unk4, u64 unk5, u64 unk6); s32 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::ps3::ptr arg, u32 arg_size, u32 arg4); +void _sys_process_exit2(ppu_thread& ppu, s32 status, vm::ptr arg, u32 arg_size, u32 arg4); diff --git a/rpcs3/Emu/Cell/lv2/sys_prx.cpp b/rpcs3/Emu/Cell/lv2/sys_prx.cpp index cb67a4425c..0392657812 100644 --- a/rpcs3/Emu/Cell/lv2/sys_prx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_prx.cpp @@ -10,7 +10,7 @@ #include "sys_fs.h" #include "sys_prx.h" -namespace vm { using namespace ps3; } + extern std::shared_ptr ppu_load_prx(const ppu_prx_object&, const std::string&); extern void ppu_unload_prx(const lv2_prx& prx); diff --git a/rpcs3/Emu/Cell/lv2/sys_prx.h b/rpcs3/Emu/Cell/lv2/sys_prx.h index 6496e5ea90..26643b517d 100644 --- a/rpcs3/Emu/Cell/lv2/sys_prx.h +++ b/rpcs3/Emu/Cell/lv2/sys_prx.h @@ -34,13 +34,13 @@ enum CellPrxError : u32 struct sys_prx_get_module_id_by_name_option_t { be_t size; - vm::ps3::ptr base; + vm::ptr base; }; struct sys_prx_load_module_option_t { be_t size; - vm::ps3::bptr base_addr; + vm::bptr base_addr; }; struct sys_prx_segment_info_t @@ -61,16 +61,16 @@ struct sys_prx_module_info_t be_t start_entry; be_t stop_entry; be_t all_segments_num; - vm::ps3::bptr filename; + vm::bptr filename; be_t filename_size; - vm::ps3::bptr segments; + vm::bptr segments; be_t segments_num; }; struct sys_prx_module_info_option_t { be_t size; // 0x10 - vm::ps3::bptr info; + vm::bptr info; }; struct sys_prx_start_module_option_t @@ -87,9 +87,9 @@ struct sys_prx_start_stop_module_option_t { be_t size; be_t cmd; - vm::ps3::bptr argv), u64> entry; + vm::bptr argv), u64> entry; be_t res; - vm::ps3::bptr), u64>, u32 argc, vm::ps3::ptr argv), u64> entry2; + vm::bptr), u64>, u32 argc, vm::ptr argv), u64> entry2; }; struct sys_prx_unload_module_option_t @@ -102,7 +102,7 @@ struct sys_prx_get_module_list_t be_t size; be_t max; be_t count; - vm::ps3::bptr idlist; + vm::bptr idlist; }; struct sys_prx_get_module_list_option_t @@ -111,7 +111,7 @@ struct sys_prx_get_module_list_option_t be_t pad; be_t max; be_t count; - vm::ps3::bptr idlist; + vm::bptr idlist; be_t unk; // 0 }; @@ -124,11 +124,11 @@ struct lv2_prx final : lv2_obj, ppu_module std::unordered_map specials; std::unordered_map imports; - vm::ps3::ptr argv)> start = vm::null; - vm::ps3::ptr argv)> stop = vm::null; - vm::ps3::ptr argv)> prologue = vm::null; - vm::ps3::ptr argv)> epilogue = vm::null; - vm::ps3::ptr exit = vm::null; + vm::ptr argv)> start = vm::null; + vm::ptr argv)> stop = vm::null; + vm::ptr argv)> prologue = vm::null; + vm::ptr argv)> epilogue = vm::null; + vm::ptr exit = vm::null; char module_info_name[28]; u8 module_info_version[2]; @@ -138,25 +138,25 @@ struct lv2_prx final : lv2_obj, ppu_module // SysCalls error_code sys_prx_get_ppu_guid(); -error_code _sys_prx_load_module_by_fd(s32 fd, u64 offset, u64 flags, vm::ps3::ptr pOpt); -error_code _sys_prx_load_module_on_memcontainer_by_fd(s32 fd, u64 offset, u32 mem_ct, u64 flags, vm::ps3::ptr pOpt); -error_code _sys_prx_load_module_list(s32 count, vm::ps3::cpptr path_list, u64 flags, vm::ps3::ptr pOpt, vm::ps3::ptr id_list); -error_code _sys_prx_load_module_list_on_memcontainer(s32 count, vm::ps3::cpptr path_list, u32 mem_ct, u64 flags, vm::ps3::ptr pOpt, vm::ps3::ptr id_list); -error_code _sys_prx_load_module_on_memcontainer(vm::ps3::cptr path, u32 mem_ct, u64 flags, vm::ps3::ptr pOpt); -error_code _sys_prx_load_module(vm::ps3::cptr path, u64 flags, vm::ps3::ptr pOpt); -error_code _sys_prx_start_module(u32 id, u64 flags, vm::ps3::ptr pOpt); -error_code _sys_prx_stop_module(u32 id, u64 flags, vm::ps3::ptr pOpt); -error_code _sys_prx_unload_module(u32 id, u64 flags, vm::ps3::ptr pOpt); +error_code _sys_prx_load_module_by_fd(s32 fd, u64 offset, u64 flags, vm::ptr pOpt); +error_code _sys_prx_load_module_on_memcontainer_by_fd(s32 fd, u64 offset, u32 mem_ct, u64 flags, vm::ptr pOpt); +error_code _sys_prx_load_module_list(s32 count, vm::cpptr path_list, u64 flags, vm::ptr pOpt, vm::ptr id_list); +error_code _sys_prx_load_module_list_on_memcontainer(s32 count, vm::cpptr path_list, u32 mem_ct, u64 flags, vm::ptr pOpt, vm::ptr id_list); +error_code _sys_prx_load_module_on_memcontainer(vm::cptr path, u32 mem_ct, u64 flags, vm::ptr pOpt); +error_code _sys_prx_load_module(vm::cptr path, u64 flags, vm::ptr pOpt); +error_code _sys_prx_start_module(u32 id, u64 flags, vm::ptr pOpt); +error_code _sys_prx_stop_module(u32 id, u64 flags, vm::ptr pOpt); +error_code _sys_prx_unload_module(u32 id, u64 flags, vm::ptr pOpt); error_code _sys_prx_register_module(); error_code _sys_prx_query_module(); -error_code _sys_prx_register_library(vm::ps3::ptr library); -error_code _sys_prx_unregister_library(vm::ps3::ptr library); +error_code _sys_prx_register_library(vm::ptr library); +error_code _sys_prx_unregister_library(vm::ptr library); error_code _sys_prx_link_library(); error_code _sys_prx_unlink_library(); error_code _sys_prx_query_library(); -error_code _sys_prx_get_module_list(u64 flags, vm::ps3::ptr pInfo); -error_code _sys_prx_get_module_info(u32 id, u64 flags, vm::ps3::ptr pOpt); -error_code _sys_prx_get_module_id_by_name(vm::ps3::cptr name, u64 flags, vm::ps3::ptr pOpt); +error_code _sys_prx_get_module_list(u64 flags, vm::ptr pInfo); +error_code _sys_prx_get_module_info(u32 id, u64 flags, vm::ptr pOpt); +error_code _sys_prx_get_module_id_by_name(vm::cptr name, u64 flags, vm::ptr pOpt); error_code _sys_prx_get_module_id_by_address(u32 addr); error_code _sys_prx_start(); error_code _sys_prx_stop(); diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index a5e27ec7e0..a41ff71c58 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -8,7 +8,7 @@ #include "sys_rsx.h" #include "sys_event.h" -namespace vm { using namespace ps3; } + logs::channel sys_rsx("sys_rsx"); @@ -44,7 +44,7 @@ s32 sys_rsx_device_close() * @param size (IN): Local memory size. E.g. 0x0F900000 (249 MB). * @param flags (IN): E.g. Immediate value passed in cellGcmSys is 8. * @param a5 (IN): E.g. Immediate value passed in cellGcmSys is 0x00300000 (3 MB?). - * @param a6 (IN): E.g. Immediate value passed in cellGcmSys is 16. + * @param a6 (IN): E.g. Immediate value passed in cellGcmSys is 16. * @param a7 (IN): E.g. Immediate value passed in cellGcmSys is 8. */ s32 sys_rsx_memory_allocate(vm::ptr mem_handle, vm::ptr mem_addr, u32 size, u64 flags, u64 a5, u64 a6, u64 a7) @@ -326,8 +326,8 @@ s32 sys_rsx_context_attribute(s32 context_id, u32 package_id, u64 a3, u64 a4, u6 //a5 low bits = ret.format = base | ((base + ((size - 1) / 0x10000)) << 13) | (comp << 26) | (1 << 30); auto& tile = render->tiles[a3]; - - // When tile is going to be unbinded, we can use it as a hint that the address will no longer be used as a surface and can be removed/invalidated + + // When tile is going to be unbinded, we can use it as a hint that the address will no longer be used as a surface and can be removed/invalidated // Todo: There may be more checks such as format/size/width can could be done if (tile.binded && a5 == 0) render->notify_tile_unbound(a3); @@ -391,7 +391,7 @@ s32 sys_rsx_context_attribute(s32 context_id, u32 package_id, u64 a3, u64 a4, u6 sys_event_port_send(m_sysrsx->rsx_event_port, 0, (1 << 11), 0); // second vhandler break; case 0xFEF: // hack: user command - // 'custom' invalid package id for now + // 'custom' invalid package id for now // as i think we need custom lv1 interrupts to handle this accurately // this also should probly be set by rsxthread driverInfo.userCmdParam = a4; @@ -415,7 +415,7 @@ s32 sys_rsx_device_map(vm::ptr addr, vm::ptr a2, u32 dev_id) sys_rsx.warning("sys_rsx_device_map(addr=*0x%x, a2=*0x%x, dev_id=0x%x)", addr, a2, dev_id); if (dev_id != 8) { - // TODO: lv1 related + // TODO: lv1 related fmt::throw_exception("sys_rsx_device_map: Invalid dev_id %d", dev_id); } diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.h b/rpcs3/Emu/Cell/lv2/sys_rsx.h index 0a867c3013..52199bd67a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.h +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.h @@ -27,7 +27,7 @@ struct RsxDriverInfo be_t unk3; // 0x18 be_t unk6; // 0x18 possible low bits of time stamp? used in getlastVBlankTime be_t lastSecondVTime; // 0x20 last time for second vhandler freq - be_t unk4; // 0x28 + be_t unk4; // 0x28 be_t vBlankCount; // 0x30 be_t unk; // 0x38 possible u32, 'flip field', top/bottom for interlaced be_t unk5; // 0x3C possible high bits of time stamp? used in getlastVBlankTime @@ -48,7 +48,7 @@ struct RsxDriverInfo be_t unk16; // 0x12E8 be_t unk17; // 0x12F0 be_t lastError; // 0x12F4 error param for cellGcmSetGraphicsHandler - // todo: theres more to this + // todo: theres more to this }; static_assert(sizeof(RsxDriverInfo) == 0x12F8, "rsxSizeTest"); @@ -102,13 +102,13 @@ struct RsxDisplayInfo // SysCalls s32 sys_rsx_device_open(); s32 sys_rsx_device_close(); -s32 sys_rsx_memory_allocate(vm::ps3::ptr mem_handle, vm::ps3::ptr mem_addr, u32 size, u64 flags, u64 a5, u64 a6, u64 a7); +s32 sys_rsx_memory_allocate(vm::ptr mem_handle, vm::ptr mem_addr, u32 size, u64 flags, u64 a5, u64 a6, u64 a7); s32 sys_rsx_memory_free(u32 mem_handle); -s32 sys_rsx_context_allocate(vm::ps3::ptr context_id, vm::ps3::ptr lpar_dma_control, vm::ps3::ptr lpar_driver_info, vm::ps3::ptr lpar_reports, u64 mem_ctx, u64 system_mode); +s32 sys_rsx_context_allocate(vm::ptr context_id, vm::ptr lpar_dma_control, vm::ptr lpar_driver_info, vm::ptr lpar_reports, u64 mem_ctx, u64 system_mode); s32 sys_rsx_context_free(u32 context_id); s32 sys_rsx_context_iomap(u32 context_id, u32 io, u32 ea, u32 size, u64 flags); s32 sys_rsx_context_iounmap(u32 context_id, u32 a2, u32 io_addr, u32 size); s32 sys_rsx_context_attribute(s32 context_id, u32 package_id, u64 a3, u64 a4, u64 a5, u64 a6); -s32 sys_rsx_device_map(vm::ps3::ptr addr, vm::ps3::ptr a2, u32 dev_id); +s32 sys_rsx_device_map(vm::ptr addr, vm::ptr a2, u32 dev_id); s32 sys_rsx_device_unmap(u32 dev_id); s32 sys_rsx_attribute(u32 a1, u32 a2, u32 a3, u32 a4, u32 a5); \ No newline at end of file diff --git a/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp b/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp index fb5899836e..632639547c 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rwlock.cpp @@ -8,7 +8,7 @@ #include "Emu/Cell/PPUThread.h" #include "sys_rwlock.h" -namespace vm { using namespace ps3; } + logs::channel sys_rwlock("sys_rwlock"); @@ -383,7 +383,7 @@ error_code sys_rwlock_trywlock(ppu_thread& ppu, u32 rw_lock_id) { return CELL_EDEADLK; } - + return not_an_error(CELL_EBUSY); } diff --git a/rpcs3/Emu/Cell/lv2/sys_rwlock.h b/rpcs3/Emu/Cell/lv2/sys_rwlock.h index 6847f350db..de4759bb83 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rwlock.h +++ b/rpcs3/Emu/Cell/lv2/sys_rwlock.h @@ -47,7 +47,7 @@ class ppu_thread; // Syscalls -error_code sys_rwlock_create(vm::ps3::ptr rw_lock_id, vm::ps3::ptr attr); +error_code sys_rwlock_create(vm::ptr rw_lock_id, vm::ptr attr); error_code sys_rwlock_destroy(u32 rw_lock_id); error_code sys_rwlock_rlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout); error_code sys_rwlock_tryrlock(u32 rw_lock_id); diff --git a/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp b/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp index a4c1f08d3d..324cdfdd95 100644 --- a/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_semaphore.cpp @@ -8,7 +8,7 @@ #include "Emu/Cell/PPUThread.h" #include "sys_semaphore.h" -namespace vm { using namespace ps3; } + logs::channel sys_semaphore("sys_semaphore"); @@ -72,7 +72,7 @@ error_code sys_semaphore_destroy(u32 sem_id) { return CELL_ESRCH; } - + if (sem.ret) { return sem.ret; @@ -88,7 +88,7 @@ error_code sys_semaphore_wait(ppu_thread& ppu, u32 sem_id, u64 timeout) const auto sem = idm::get(sem_id, [&](lv2_sema& sema) { const s32 val = sema.val; - + if (val > 0) { if (sema.val.compare_and_swap_test(val, val - 1)) @@ -167,7 +167,7 @@ error_code sys_semaphore_trywait(u32 sem_id) const auto sem = idm::check(sem_id, [&](lv2_sema& sema) { const s32 val = sema.val; - + if (val > 0) { if (sema.val.compare_and_swap_test(val, val - 1)) diff --git a/rpcs3/Emu/Cell/lv2/sys_semaphore.h b/rpcs3/Emu/Cell/lv2/sys_semaphore.h index 7e02b36309..580ef572b9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_semaphore.h +++ b/rpcs3/Emu/Cell/lv2/sys_semaphore.h @@ -49,9 +49,9 @@ class ppu_thread; // Syscalls -error_code sys_semaphore_create(vm::ps3::ptr sem_id, vm::ps3::ptr attr, s32 initial_val, s32 max_val); +error_code sys_semaphore_create(vm::ptr sem_id, vm::ptr attr, s32 initial_val, s32 max_val); error_code sys_semaphore_destroy(u32 sem_id); error_code sys_semaphore_wait(ppu_thread& ppu, u32 sem_id, u64 timeout); error_code sys_semaphore_trywait(u32 sem_id); error_code sys_semaphore_post(ppu_thread& ppu, u32 sem_id, s32 count); -error_code sys_semaphore_get_value(u32 sem_id, vm::ps3::ptr count); +error_code sys_semaphore_get_value(u32 sem_id, vm::ptr count); diff --git a/rpcs3/Emu/Cell/lv2/sys_spu.cpp b/rpcs3/Emu/Cell/lv2/sys_spu.cpp index 66a48a3e19..9c34d414f3 100644 --- a/rpcs3/Emu/Cell/lv2/sys_spu.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_spu.cpp @@ -15,7 +15,7 @@ #include "sys_event.h" #include "sys_spu.h" -namespace vm { using namespace ps3; } + logs::channel sys_spu("sys_spu"); diff --git a/rpcs3/Emu/Cell/lv2/sys_spu.h b/rpcs3/Emu/Cell/lv2/sys_spu.h index 341315c011..5309902710 100644 --- a/rpcs3/Emu/Cell/lv2/sys_spu.h +++ b/rpcs3/Emu/Cell/lv2/sys_spu.h @@ -57,7 +57,7 @@ enum : s32 struct sys_spu_thread_group_attribute { be_t nsize; // name length including NULL terminator - vm::ps3::bcptr name; + vm::bcptr name; be_t type; be_t ct; // memory container id }; @@ -71,7 +71,7 @@ enum : u32 struct sys_spu_thread_attribute { - vm::ps3::bcptr name; + vm::bcptr name; be_t name_len; be_t option; }; @@ -109,7 +109,7 @@ struct sys_spu_image { be_t type; // user, kernel be_t entry_point; - vm::ps3::bptr segs; + vm::bptr segs; be_t nsegs; template @@ -138,7 +138,7 @@ struct sys_spu_image } template - static s32 fill(vm::ps3::ptr segs, s32 nsegs, const Phdrs& phdrs, u32 src) + static s32 fill(vm::ptr segs, s32 nsegs, const Phdrs& phdrs, u32 src) { s32 num_segs = 0; @@ -286,46 +286,46 @@ class ppu_thread; // Syscalls error_code sys_spu_initialize(u32 max_usable_spu, u32 max_raw_spu); -error_code _sys_spu_image_get_information(vm::ps3::ptr img, vm::ps3::ptr entry_point, vm::ps3::ptr nsegs); -error_code sys_spu_image_open(vm::ps3::ptr img, vm::ps3::cptr path); -error_code _sys_spu_image_import(vm::ps3::ptr img, u32 src, u32 size, u32 arg4); -error_code _sys_spu_image_close(vm::ps3::ptr img); -error_code _sys_spu_image_get_segments(vm::ps3::ptr img, vm::ps3::ptr segments, s32 nseg); -error_code sys_spu_thread_initialize(vm::ps3::ptr thread, u32 group, u32 spu_num, vm::ps3::ptr, vm::ps3::ptr, vm::ps3::ptr); -error_code sys_spu_thread_set_argument(u32 id, vm::ps3::ptr arg); -error_code sys_spu_thread_group_create(vm::ps3::ptr id, u32 num, s32 prio, vm::ps3::ptr attr); +error_code _sys_spu_image_get_information(vm::ptr img, vm::ptr entry_point, vm::ptr nsegs); +error_code sys_spu_image_open(vm::ptr img, vm::cptr path); +error_code _sys_spu_image_import(vm::ptr img, u32 src, u32 size, u32 arg4); +error_code _sys_spu_image_close(vm::ptr img); +error_code _sys_spu_image_get_segments(vm::ptr img, vm::ptr segments, s32 nseg); +error_code sys_spu_thread_initialize(vm::ptr thread, u32 group, u32 spu_num, vm::ptr, vm::ptr, vm::ptr); +error_code sys_spu_thread_set_argument(u32 id, vm::ptr arg); +error_code sys_spu_thread_group_create(vm::ptr id, u32 num, s32 prio, vm::ptr attr); error_code sys_spu_thread_group_destroy(u32 id); error_code sys_spu_thread_group_start(ppu_thread&, u32 id); error_code sys_spu_thread_group_suspend(u32 id); error_code sys_spu_thread_group_resume(u32 id); error_code sys_spu_thread_group_yield(u32 id); error_code sys_spu_thread_group_terminate(u32 id, s32 value); -error_code sys_spu_thread_group_join(ppu_thread&, u32 id, vm::ps3::ptr cause, vm::ps3::ptr status); +error_code sys_spu_thread_group_join(ppu_thread&, u32 id, vm::ptr cause, vm::ptr status); error_code sys_spu_thread_group_set_priority(u32 id, s32 priority); -error_code sys_spu_thread_group_get_priority(u32 id, vm::ps3::ptr priority); +error_code sys_spu_thread_group_get_priority(u32 id, vm::ptr priority); error_code sys_spu_thread_group_connect_event(u32 id, u32 eq, u32 et); error_code sys_spu_thread_group_disconnect_event(u32 id, u32 et); -error_code sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, vm::ps3::ptr spup); +error_code sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, vm::ptr spup); error_code sys_spu_thread_group_disconnect_event_all_threads(u32 id, u8 spup); error_code sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type); -error_code sys_spu_thread_read_ls(u32 id, u32 address, vm::ps3::ptr value, u32 type); +error_code sys_spu_thread_read_ls(u32 id, u32 address, vm::ptr value, u32 type); error_code sys_spu_thread_write_spu_mb(u32 id, u32 value); error_code sys_spu_thread_set_spu_cfg(u32 id, u64 value); -error_code sys_spu_thread_get_spu_cfg(u32 id, vm::ps3::ptr value); +error_code sys_spu_thread_get_spu_cfg(u32 id, vm::ptr value); error_code sys_spu_thread_write_snr(u32 id, u32 number, u32 value); error_code sys_spu_thread_connect_event(u32 id, u32 eq, u32 et, u8 spup); error_code sys_spu_thread_disconnect_event(u32 id, u32 event_type, u8 spup); error_code sys_spu_thread_bind_queue(u32 id, u32 spuq, u32 spuq_num); error_code sys_spu_thread_unbind_queue(u32 id, u32 spuq_num); -error_code sys_spu_thread_get_exit_status(u32 id, vm::ps3::ptr status); +error_code sys_spu_thread_get_exit_status(u32 id, vm::ptr status); -error_code sys_raw_spu_create(vm::ps3::ptr id, vm::ps3::ptr attr); +error_code sys_raw_spu_create(vm::ptr id, vm::ptr attr); error_code sys_raw_spu_destroy(ppu_thread& ppu, u32 id); -error_code sys_raw_spu_create_interrupt_tag(u32 id, u32 class_id, u32 hwthread, vm::ps3::ptr intrtag); +error_code sys_raw_spu_create_interrupt_tag(u32 id, u32 class_id, u32 hwthread, vm::ptr intrtag); error_code sys_raw_spu_set_int_mask(u32 id, u32 class_id, u64 mask); -error_code sys_raw_spu_get_int_mask(u32 id, u32 class_id, vm::ps3::ptr mask); +error_code sys_raw_spu_get_int_mask(u32 id, u32 class_id, vm::ptr mask); error_code sys_raw_spu_set_int_stat(u32 id, u32 class_id, u64 stat); -error_code sys_raw_spu_get_int_stat(u32 id, u32 class_id, vm::ps3::ptr stat); -error_code sys_raw_spu_read_puint_mb(u32 id, vm::ps3::ptr value); +error_code sys_raw_spu_get_int_stat(u32 id, u32 class_id, vm::ptr stat); +error_code sys_raw_spu_read_puint_mb(u32 id, vm::ptr value); error_code sys_raw_spu_set_spu_cfg(u32 id, u32 value); -error_code sys_raw_spu_get_spu_cfg(u32 id, vm::ps3::ptr value); +error_code sys_raw_spu_get_spu_cfg(u32 id, vm::ptr value); diff --git a/rpcs3/Emu/Cell/lv2/sys_ss.cpp b/rpcs3/Emu/Cell/lv2/sys_ss.cpp index 8911a250d6..aa76c39e15 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ss.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_ss.cpp @@ -28,7 +28,7 @@ const HCRYPTPROV s_crypto_provider = []() -> HCRYPTPROV }(); #endif -namespace vm { using namespace ps3; } + logs::channel sys_ss("sys_ss"); @@ -63,7 +63,7 @@ error_code sys_ss_random_number_generator(u32 arg1, vm::ptr buf, u64 size) return CELL_OK; } -s32 sys_ss_get_console_id(vm::ps3::ptr buf) +s32 sys_ss_get_console_id(vm::ptr buf) { sys_ss.todo("sys_ss_get_console_id(buf=*0x%x)", buf); @@ -73,7 +73,7 @@ s32 sys_ss_get_console_id(vm::ps3::ptr buf) return CELL_OK; } -s32 sys_ss_get_open_psid(vm::ps3::ptr psid) +s32 sys_ss_get_open_psid(vm::ptr psid) { sys_ss.warning("sys_ss_get_open_psid(psid=*0x%x)", psid); diff --git a/rpcs3/Emu/Cell/lv2/sys_ss.h b/rpcs3/Emu/Cell/lv2/sys_ss.h index 4aefcb51ed..0a13195c6d 100644 --- a/rpcs3/Emu/Cell/lv2/sys_ss.h +++ b/rpcs3/Emu/Cell/lv2/sys_ss.h @@ -9,6 +9,6 @@ struct CellSsOpenPSID be_t low; }; -error_code sys_ss_random_number_generator(u32 arg1, vm::ps3::ptr buf, u64 size); -s32 sys_ss_get_console_id(vm::ps3::ptr buf); -s32 sys_ss_get_open_psid(vm::ps3::ptr ptr); +error_code sys_ss_random_number_generator(u32 arg1, vm::ptr buf, u64 size); +s32 sys_ss_get_console_id(vm::ptr buf); +s32 sys_ss_get_open_psid(vm::ptr ptr); diff --git a/rpcs3/Emu/Cell/lv2/sys_time.cpp b/rpcs3/Emu/Cell/lv2/sys_time.cpp index 6843505e66..0e8a85f1e8 100644 --- a/rpcs3/Emu/Cell/lv2/sys_time.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_time.cpp @@ -103,7 +103,7 @@ static int clock_gettime(int clk_id, struct timespec* tp) #endif -namespace vm { using namespace ps3; } + logs::channel sys_time("sys_time"); diff --git a/rpcs3/Emu/Cell/lv2/sys_time.h b/rpcs3/Emu/Cell/lv2/sys_time.h index 3cdc8cf026..651019ff72 100644 --- a/rpcs3/Emu/Cell/lv2/sys_time.h +++ b/rpcs3/Emu/Cell/lv2/sys_time.h @@ -1,6 +1,6 @@ #pragma once // SysCalls -s32 sys_time_get_timezone(vm::ps3::ptr timezone, vm::ps3::ptr summertime); -s32 sys_time_get_current_time(vm::ps3::ptr sec, vm::ps3::ptr nsec); +s32 sys_time_get_timezone(vm::ptr timezone, vm::ptr summertime); +s32 sys_time_get_current_time(vm::ptr sec, vm::ptr nsec); u64 sys_time_get_timebase_frequency(); diff --git a/rpcs3/Emu/Cell/lv2/sys_timer.cpp b/rpcs3/Emu/Cell/lv2/sys_timer.cpp index 3ec9cf5cd5..bcd81a99d7 100644 --- a/rpcs3/Emu/Cell/lv2/sys_timer.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_timer.cpp @@ -11,7 +11,7 @@ #include -namespace vm { using namespace ps3; } + logs::channel sys_timer("sys_timer"); @@ -45,7 +45,7 @@ void lv2_timer::on_task() } // Stop: oneshot or the event port was disconnected (TODO: is it correct?) - state = SYS_TIMER_STATE_STOP; + state = SYS_TIMER_STATE_STOP; continue; } @@ -81,7 +81,7 @@ error_code sys_timer_create(vm::ptr timer_id) *timer_id = id; return CELL_OK; } - + return CELL_EAGAIN; } @@ -146,7 +146,7 @@ error_code _sys_timer_start(u32 timer_id, u64 base_time, u64 period) // Invalid oneshot (TODO: what will happen if both args are 0?) return not_an_error(CELL_ETIMEDOUT); } - + if (period && period < 100) { // Invalid periodic timer diff --git a/rpcs3/Emu/Cell/lv2/sys_timer.h b/rpcs3/Emu/Cell/lv2/sys_timer.h index a3f2b8c831..5e561dedaf 100644 --- a/rpcs3/Emu/Cell/lv2/sys_timer.h +++ b/rpcs3/Emu/Cell/lv2/sys_timer.h @@ -31,7 +31,7 @@ struct lv2_timer final : public lv2_obj, public named_thread u64 source; u64 data1; u64 data2; - + atomic_t expire{0}; // Next expiration time atomic_t period{0}; // Period (oneshot if 0) }; @@ -40,9 +40,9 @@ class ppu_thread; // Syscalls -error_code sys_timer_create(vm::ps3::ptr timer_id); +error_code sys_timer_create(vm::ptr timer_id); error_code sys_timer_destroy(u32 timer_id); -error_code sys_timer_get_information(u32 timer_id, vm::ps3::ptr info); +error_code sys_timer_get_information(u32 timer_id, vm::ptr info); error_code _sys_timer_start(u32 timer_id, u64 basetime, u64 period); // basetime type changed from s64 error_code sys_timer_stop(u32 timer_id); error_code sys_timer_connect_event_queue(u32 timer_id, u32 queue_id, u64 name, u64 data1, u64 data2); diff --git a/rpcs3/Emu/Cell/lv2/sys_trace.cpp b/rpcs3/Emu/Cell/lv2/sys_trace.cpp index 6a43d9b093..e24a8c32c9 100644 --- a/rpcs3/Emu/Cell/lv2/sys_trace.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_trace.cpp @@ -5,7 +5,7 @@ #include "Emu/Cell/ErrorCodes.h" #include "sys_trace.h" -namespace vm { using namespace ps3; } + logs::channel sys_trace("sys_trace"); diff --git a/rpcs3/Emu/Cell/lv2/sys_tty.cpp b/rpcs3/Emu/Cell/lv2/sys_tty.cpp index dc0626526d..7a5cef8021 100644 --- a/rpcs3/Emu/Cell/lv2/sys_tty.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_tty.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "sys_tty.h" -namespace vm { using namespace ps3; } + logs::channel sys_tty("sys_tty"); @@ -23,20 +23,20 @@ error_code sys_tty_write(s32 ch, vm::cptr buf, u32 len, vm::ptr pwrit { return CELL_EINVAL; } - + const u32 written_len = static_cast(len) > 0 ? len : 0; if (written_len > 0 && g_tty) { g_tty.write(buf.get_ptr(), len); } - + if (!pwritelen) { return CELL_EFAULT; } *pwritelen = written_len; - + return CELL_OK; } diff --git a/rpcs3/Emu/Cell/lv2/sys_tty.h b/rpcs3/Emu/Cell/lv2/sys_tty.h index 3420408370..fdf0214ecf 100644 --- a/rpcs3/Emu/Cell/lv2/sys_tty.h +++ b/rpcs3/Emu/Cell/lv2/sys_tty.h @@ -26,5 +26,5 @@ enum }; // SysCalls -error_code sys_tty_read(s32 ch, vm::ps3::ptr buf, u32 len, vm::ps3::ptr preadlen); -error_code sys_tty_write(s32 ch, vm::ps3::cptr buf, u32 len, vm::ps3::ptr pwritelen); +error_code sys_tty_read(s32 ch, vm::ptr buf, u32 len, vm::ptr preadlen); +error_code sys_tty_write(s32 ch, vm::cptr buf, u32 len, vm::ptr pwritelen); diff --git a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp index d92432a0ae..c3a8c2ed07 100644 --- a/rpcs3/Emu/Cell/lv2/sys_usbd.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_usbd.cpp @@ -5,7 +5,7 @@ #include "Emu/Cell/ErrorCodes.h" #include "sys_usbd.h" #include "sys_ppu_thread.h" -namespace vm { using namespace ps3; } + logs::channel sys_usbd("sys_usbd"); diff --git a/rpcs3/Emu/Cell/lv2/sys_usbd.h b/rpcs3/Emu/Cell/lv2/sys_usbd.h index c31da5700f..6208b6df9e 100644 --- a/rpcs3/Emu/Cell/lv2/sys_usbd.h +++ b/rpcs3/Emu/Cell/lv2/sys_usbd.h @@ -1,6 +1,6 @@ #pragma once -namespace vm { using namespace ps3; } + // SysCalls diff --git a/rpcs3/Emu/Cell/lv2/sys_vm.cpp b/rpcs3/Emu/Cell/lv2/sys_vm.cpp index 624428f9f3..d98b0223db 100644 --- a/rpcs3/Emu/Cell/lv2/sys_vm.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_vm.cpp @@ -2,7 +2,7 @@ #include "sys_vm.h" #include "sys_memory.h" -namespace vm { using namespace ps3; } + logs::channel sys_vm("sys_vm"); diff --git a/rpcs3/Emu/Cell/lv2/sys_vm.h b/rpcs3/Emu/Cell/lv2/sys_vm.h index f143933605..2942bf22c6 100644 --- a/rpcs3/Emu/Cell/lv2/sys_vm.h +++ b/rpcs3/Emu/Cell/lv2/sys_vm.h @@ -26,8 +26,8 @@ struct sys_vm_statistics_t }; // SysCalls -error_code sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, vm::ps3::ptr addr); -error_code sys_vm_memory_map_different(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, vm::ps3::ptr addr); +error_code sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, vm::ptr addr); +error_code sys_vm_memory_map_different(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, vm::ptr addr); error_code sys_vm_unmap(u32 addr); error_code sys_vm_append_memory(u32 addr, u32 size); error_code sys_vm_return_memory(u32 addr, u32 size); @@ -38,5 +38,5 @@ error_code sys_vm_flush(u32 addr, u32 size); error_code sys_vm_invalidate(u32 addr, u32 size); error_code sys_vm_store(u32 addr, u32 size); error_code sys_vm_sync(u32 addr, u32 size); -error_code sys_vm_test(u32 addr, u32 size, vm::ps3::ptr result); -error_code sys_vm_get_statistics(u32 addr, vm::ps3::ptr stat); +error_code sys_vm_test(u32 addr, u32 size, vm::ptr result); +error_code sys_vm_get_statistics(u32 addr, vm::ptr stat); diff --git a/rpcs3/Emu/Memory/Memory.cpp b/rpcs3/Emu/Memory/Memory.cpp index 61c90dc60c..4599109c51 100644 --- a/rpcs3/Emu/Memory/Memory.cpp +++ b/rpcs3/Emu/Memory/Memory.cpp @@ -105,7 +105,7 @@ bool VirtualMemoryBlock::Read32(const u32 addr, u32* value) u32 realAddr; if (!getRealAddr(addr, realAddr)) return false; - *value = vm::ps3::read32(realAddr); + *value = vm::read32(realAddr); return true; } @@ -114,7 +114,7 @@ bool VirtualMemoryBlock::Write32(const u32 addr, const u32 value) u32 realAddr; if (!getRealAddr(addr, realAddr)) return false; - vm::ps3::write32(realAddr, value); + vm::write32(realAddr, value); return true; } diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index 78d3d92c61..637f2ac153 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -781,7 +781,7 @@ namespace vm return nullptr; } - inline namespace ps3 + inline namespace ps3_ { void init() { diff --git a/rpcs3/Emu/Memory/vm.h b/rpcs3/Emu/Memory/vm.h index f4435515e0..07fe91e0b4 100644 --- a/rpcs3/Emu/Memory/vm.h +++ b/rpcs3/Emu/Memory/vm.h @@ -268,7 +268,7 @@ namespace vm g_base_addr[addr] = value; } - inline namespace ps3 + inline namespace ps3_ { // Convert specified PS3 address to a pointer of specified (possibly converted to BE) type template inline to_be_t* _ptr(u32 addr) diff --git a/rpcs3/Emu/Memory/vm_ptr.h b/rpcs3/Emu/Memory/vm_ptr.h index 225d6d1819..5e24f59846 100644 --- a/rpcs3/Emu/Memory/vm_ptr.h +++ b/rpcs3/Emu/Memory/vm_ptr.h @@ -287,7 +287,7 @@ namespace vm // LE pointer to BE data template using lptrb = _ptr_base, to_le_t>; - inline namespace ps3 + inline namespace ps3_ { // Default pointer type for PS3 HLE functions (Native endianness pointer to BE data) template using ptr = ptrb; diff --git a/rpcs3/Emu/Memory/vm_ref.h b/rpcs3/Emu/Memory/vm_ref.h index 02dd5e2aa1..b6348f2a72 100644 --- a/rpcs3/Emu/Memory/vm_ref.h +++ b/rpcs3/Emu/Memory/vm_ref.h @@ -163,7 +163,7 @@ namespace vm // LE reference to BE data template using lrefb = _ref_base, to_le_t>; - inline namespace ps3 + inline namespace ps3_ { // default reference for PS3 HLE functions (Native endianness reference to BE data) template using ref = refb; diff --git a/rpcs3/Emu/Memory/vm_var.h b/rpcs3/Emu/Memory/vm_var.h index 39346ca6a0..c573bf1fef 100644 --- a/rpcs3/Emu/Memory/vm_var.h +++ b/rpcs3/Emu/Memory/vm_var.h @@ -114,7 +114,7 @@ namespace vm // BE variable template using varb = _var_base, A>; - inline namespace ps3 + inline namespace ps3_ { // BE variable template> using var = varb; diff --git a/rpcs3/Emu/RSX/CgBinaryProgram.h b/rpcs3/Emu/RSX/CgBinaryProgram.h index 117d407737..4d79c1d23b 100644 --- a/rpcs3/Emu/RSX/CgBinaryProgram.h +++ b/rpcs3/Emu/RSX/CgBinaryProgram.h @@ -324,13 +324,13 @@ public: if (!f) return; size_t size = f.size(); - vm::ps3::init(); + vm::init(); ptr = vm::alloc(size, vm::main); f.read(vm::base(ptr), size); } - - auto& vmprog = vm::ps3::_ref(ptr); - auto& vmfprog = vm::ps3::_ref(ptr + vmprog.program); + + auto& vmprog = vm::_ref(ptr); + auto& vmfprog = vm::_ref(ptr + vmprog.program); u32 size; u32 ctrl = (vmfprog.outputFromH0 ? 0 : 0x40) | (vmfprog.depthReplace ? 0xe : 0); std::vector td; diff --git a/rpcs3/Emu/RSX/Common/TextureUtils.cpp b/rpcs3/Emu/RSX/Common/TextureUtils.cpp index f328ceb80f..a170584c3e 100644 --- a/rpcs3/Emu/RSX/Common/TextureUtils.cpp +++ b/rpcs3/Emu/RSX/Common/TextureUtils.cpp @@ -147,7 +147,7 @@ std::vector get_subresources_layout_impl(const RsxTextur int format = texture.format() & ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN); const u32 texaddr = rsx::get_address(texture.offset(), texture.location()); - auto pixels = reinterpret_cast(vm::ps3::_ptr(texaddr)); + auto pixels = reinterpret_cast(vm::_ptr(texaddr)); bool is_swizzled = !(texture.format() & CELL_GCM_TEXTURE_LN); switch (format) { @@ -209,7 +209,7 @@ void upload_texture_subresource(gsl::span dst_buffer, const rsx_subre // Ignore when texture width > pitch if (w > pitch) return; - + switch (format) { case CELL_GCM_TEXTURE_B8: diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index 2749a6592f..9d6b3de483 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -1916,12 +1916,12 @@ namespace rsx } protect_info.second->unprotect(); - vm::ps3::write32(texaddr, texaddr); + vm::write32(texaddr, texaddr); protect_info.second->protect(protect_info.first); return; } - vm::ps3::write32(texaddr, texaddr); + vm::write32(texaddr, texaddr); } bool test_framebuffer(u32 texaddr) @@ -1940,13 +1940,13 @@ namespace rsx //Address isnt actually covered by the region, it only shares a page with it protect_info.second->unprotect(); - bool result = (vm::ps3::read32(texaddr) == texaddr); + bool result = (vm::read32(texaddr) == texaddr); protect_info.second->protect(utils::protection::no); return result; } } - return vm::ps3::read32(texaddr) == texaddr; + return vm::read32(texaddr) == texaddr; } }; } diff --git a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp index 5b34c42d2e..fd2f553597 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp @@ -57,7 +57,7 @@ void unloadD3D12FunctionPointers() /** * Wait until command queue has completed all task. - */ + */ void wait_for_command_queue(ID3D12Device *device, ID3D12CommandQueue *command_queue) { ComPtr fence; @@ -152,12 +152,12 @@ D3D12GSRender::D3D12GSRender() // Create adapter ComPtr adapter; const std::wstring adapter_name = std::wstring_convert>().from_bytes(g_cfg.video.d3d12.adapter); - + for (UINT id = 0; dxgi_factory->EnumAdapters(id, adapter.ReleaseAndGetAddressOf()) != DXGI_ERROR_NOT_FOUND; id++) { DXGI_ADAPTER_DESC desc; adapter->GetDesc(&desc); - + // Adapter with specified name if (adapter_name == desc.Description) { @@ -174,7 +174,7 @@ D3D12GSRender::D3D12GSRender() if (FAILED(wrapD3D12CreateDevice(adapter.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device)))) { LOG_ERROR(RSX, "Failed to initialize D3D device on adapter '%s', falling back to first available GPU", g_cfg.video.d3d12.adapter.get()); - + //Try to create a device on the first available device if (FAILED(wrapD3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device)))) { @@ -532,7 +532,7 @@ void D3D12GSRender::flip(int buffer) u32 addr = rsx::get_address(display_buffers[current_display_buffer].offset, CELL_GCM_LOCATION_LOCAL); w = display_buffers[current_display_buffer].width; h = display_buffers[current_display_buffer].height; - u8 *src_buffer = vm::ps3::_ptr(addr); + u8 *src_buffer = vm::_ptr(addr); row_pitch = align(w * 4, 256); size_t texture_size = row_pitch * h; // * 4 for mipmap levels diff --git a/rpcs3/Emu/RSX/GCM.h b/rpcs3/Emu/RSX/GCM.h index 99bce3daf7..75a78a575e 100644 --- a/rpcs3/Emu/RSX/GCM.h +++ b/rpcs3/Emu/RSX/GCM.h @@ -24,14 +24,14 @@ struct CellGcmConfig struct CellGcmContextData; -typedef s32(CellGcmContextCallback)(vm::ps3::ptr, u32); +typedef s32(CellGcmContextCallback)(vm::ptr, u32); struct CellGcmContextData { - vm::ps3::bptr begin; - vm::ps3::bptr end; - vm::ps3::bptr current; - vm::ps3::bptr callback; + vm::bptr begin; + vm::bptr end; + vm::bptr current; + vm::bptr callback; }; struct gcmInfo diff --git a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp index 7f741498b4..5799128196 100644 --- a/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp +++ b/rpcs3/Emu/RSX/GL/GLRenderTargets.cpp @@ -475,7 +475,7 @@ void GLGSRender::read_buffers() if (!m_surface_info[i].pitch) continue; - + const u32 range = pitch * height; rsx::tiled_region color_buffer = get_tiled_address(offset, location & 0xf); @@ -560,7 +560,7 @@ void GLGSRender::read_buffers() if (rsx::method_registers.surface_depth_fmt() == rsx::surface_depth_format::z16) { u16 *dst = (u16*)pixels; - const be_t* src = vm::ps3::_ptr(depth_address); + const be_t* src = vm::_ptr(depth_address); for (int i = 0, end = std::get<1>(m_rtts.m_bound_depth_stencil)->width() * std::get<1>(m_rtts.m_bound_depth_stencil)->height(); i < end; ++i) { dst[i] = src[i]; @@ -569,7 +569,7 @@ void GLGSRender::read_buffers() else { u32 *dst = (u32*)pixels; - const be_t* src = vm::ps3::_ptr(depth_address); + const be_t* src = vm::_ptr(depth_address); for (int i = 0, end = std::get<1>(m_rtts.m_bound_depth_stencil)->width() * std::get<1>(m_rtts.m_bound_depth_stencil)->height(); i < end; ++i) { dst[i] = src[i]; diff --git a/rpcs3/Emu/RSX/GL/GLTextureCache.h b/rpcs3/Emu/RSX/GL/GLTextureCache.h index 263ef35adb..cccf64aba9 100644 --- a/rpcs3/Emu/RSX/GL/GLTextureCache.h +++ b/rpcs3/Emu/RSX/GL/GLTextureCache.h @@ -201,14 +201,14 @@ namespace gl if (flushable) init_buffer(); - + flushed = false; copied = false; is_depth = false; vram_texture = 0; } - + void create(u16 w, u16 h, u16 depth, u16 mipmaps, void*, gl::texture* image, u32 rsx_pitch, bool read_only, gl::texture::format gl_format, gl::texture::type gl_type, bool swap_bytes) @@ -444,7 +444,7 @@ namespace gl glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo_id); void *data = glMapBufferRange(GL_PIXEL_PACK_BUFFER, 0, pbo_size, GL_MAP_READ_BIT); - u8 *dst = vm::ps3::_ptr(cpu_address_base); + u8 *dst = vm::_ptr(cpu_address_base); //throw if map failed since we'll segfault anyway verify(HERE), data != nullptr; @@ -498,17 +498,17 @@ namespace gl if (!m_fence.is_empty()) m_fence.destroy(); } - + texture::format get_format() const { return format; } - + bool exists() const { return vram_texture != 0; } - + bool is_flushable() const { return (locked && pbo_id != 0); @@ -563,7 +563,7 @@ namespace gl return (gl::texture::format)fmt == tex->get_internal_format(); } }; - + class texture_cache : public rsx::texture_cache { private: @@ -596,7 +596,7 @@ namespace gl clear_temporary_subresources(); m_unreleased_texture_objects = 0; } - + void clear_temporary_subresources() { for (u32 &id : m_temporary_surfaces) @@ -686,9 +686,9 @@ namespace gl } } } - + protected: - + void free_texture_section(cached_texture_section& tex) override { tex.destroy(); @@ -898,7 +898,7 @@ namespace gl { purge_dirty(); } - + clear_temporary_subresources(); m_temporary_subresource_cache.clear(); } diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index e4b1c48286..7cd927a860 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -24,7 +24,7 @@ class GSRender; bool user_asked_for_frame_capture = false; rsx::frame_capture_data frame_debug; -namespace vm { using namespace ps3; } + namespace rsx { diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index 44901e5f90..77401f9478 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -311,9 +311,9 @@ namespace rsx u64 start_rsx_time = 0; u64 int_flip_index = 0; u64 last_flip_time; - vm::ps3::ptr flip_handler = vm::null; - vm::ps3::ptr user_handler = vm::null; - vm::ps3::ptr vblank_handler = vm::null; + vm::ptr flip_handler = vm::null; + vm::ptr user_handler = vm::null; + vm::ptr vblank_handler = vm::null; u64 vblank_count; public: @@ -333,7 +333,7 @@ namespace rsx virtual void on_task() override; virtual void on_exit() override; - + /** * Execute a backend local task queue * Idle argument checks that the FIFO queue is in an idle state @@ -375,7 +375,7 @@ namespace rsx std::vector> get_vertex_buffers(const rsx::rsx_state& state, const std::vector>& vertex_ranges, const u64 consumed_attrib_mask) const; - + std::variant get_draw_command(const rsx::rsx_state& state) const; diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index 9cd69c8633..27e4af8be8 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -35,7 +35,7 @@ void fmt_class_string::format(std::string& out, u64 arg) namespace rsx { rsx_state method_registers; - + std::array methods{}; void invalid_method(thread* rsx, u32 _reg, u32 arg) @@ -64,10 +64,10 @@ namespace rsx { rsx->sync_point_request = true; const u32 addr = get_address(method_registers.semaphore_offset_406e(), method_registers.semaphore_context_dma_406e()); - if (vm::ps3::read32(addr) == arg) return; + if (vm::read32(addr) == arg) return; u64 start = get_system_time(); - while (vm::ps3::read32(addr) != arg) + while (vm::read32(addr) != arg) { // todo: LLE: why does this one keep hanging? is it vsh system semaphore? whats actually pushing this to the command buffer?! if (addr == 0x40000030) @@ -116,12 +116,12 @@ namespace rsx if (addr >> 28 == 0x4) { // TODO: check no reservation area instead - vm::ps3::write32(addr, arg); + vm::write32(addr, arg); return; } vm::reader_lock lock; - vm::ps3::write32(addr, arg); + vm::write32(addr, arg); vm::notify(addr, 4); } } @@ -162,7 +162,7 @@ namespace rsx { // } - auto& sema = vm::ps3::_ref(rsx->label_addr); + auto& sema = vm::_ref(rsx->label_addr); sema.semaphore[index].val = arg; sema.semaphore[index].pad = 0; sema.semaphore[index].timestamp = rsx->timestamp(); @@ -177,7 +177,7 @@ namespace rsx } u32 val = (arg & 0xff00ff00) | ((arg & 0xff) << 16) | ((arg >> 16) & 0xff); - auto& sema = vm::ps3::_ref(rsx->label_addr); + auto& sema = vm::_ref(rsx->label_addr); sema.semaphore[index].val = val; sema.semaphore[index].pad = 0; sema.semaphore[index].timestamp = rsx->timestamp(); @@ -416,7 +416,7 @@ namespace rsx return; } - vm::ps3::ptr result = address_ptr; + vm::ptr result = address_ptr; switch (type) { @@ -484,7 +484,7 @@ namespace rsx return; } - vm::ps3::ptr result = address_ptr; + vm::ptr result = address_ptr; rsx->conditional_render_test_failed = (result->value == 0); } @@ -553,7 +553,7 @@ namespace rsx const u32 pixel_offset = (method_registers.blit_engine_output_pitch_nv3062() * y) + (x << 2); u32 address = get_address(method_registers.blit_engine_output_offset_nv3062() + pixel_offset + index * 4, method_registers.blit_engine_output_location_nv3062()); - vm::ps3::write32(address, arg); + vm::write32(address, arg); } }; } @@ -662,7 +662,7 @@ namespace rsx const tiled_region dst_region = rsx->get_tiled_address(dst_offset + out_offset, dst_dma & 0xf); u8* pixels_src = src_region.tile ? src_region.ptr + src_region.base : src_region.ptr; - u8* pixels_dst = vm::ps3::_ptr(get_address(dst_offset + out_offset, dst_dma)); + u8* pixels_dst = vm::_ptr(get_address(dst_offset + out_offset, dst_dma)); if (out_pitch == 0) { @@ -789,7 +789,7 @@ namespace rsx if (method_registers.blit_engine_context_surface() != blit_engine::context_surface::swizzle2d) { if (need_convert || need_clip) - { + { if (need_clip) { if (need_convert) @@ -855,7 +855,7 @@ namespace rsx pixels_src = temp2.get(); } - // It looks like rsx may ignore the requested swizzle size and just always + // It looks like rsx may ignore the requested swizzle size and just always // round up to nearest power of 2 /*u8 sw_width_log2 = method_registers.nv309e_sw_width_log2(); u8 sw_height_log2 = method_registers.nv309e_sw_height_log2(); @@ -1027,7 +1027,7 @@ namespace rsx } } } - + rsx->int_flip_index++; rsx->current_display_buffer = arg; rsx->flip(arg); @@ -1561,7 +1561,7 @@ namespace rsx //Some custom GCM methods methods[GCM_SET_DRIVER_OBJECT] = nullptr; - + bind_array(); bind_array(); @@ -1678,8 +1678,8 @@ namespace rsx // custom methods bind(); - - return true; + + return true; }(); } diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 4400c71a5c..a88124533b 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -671,7 +671,7 @@ void Emulator::Load(bool add_only) m_state = system_state::ready; GetCallbacks().on_ready(); - vm::ps3::init(); + vm::init(); if (argv.empty()) { @@ -709,7 +709,7 @@ void Emulator::Load(bool add_only) // PPU PRX (experimental) m_state = system_state::ready; GetCallbacks().on_ready(); - vm::ps3::init(); + vm::init(); ppu_load_prx(ppu_prx, m_path); } else if (spu_exec.open(elf_file) == elf_error::ok) @@ -717,7 +717,7 @@ void Emulator::Load(bool add_only) // SPU executable (experimental) m_state = system_state::ready; GetCallbacks().on_ready(); - vm::ps3::init(); + vm::init(); spu_load_exec(spu_exec); } else diff --git a/rpcs3/rpcs3qt/instruction_editor_dialog.cpp b/rpcs3/rpcs3qt/instruction_editor_dialog.cpp index 4be4a00ba9..327455e3cb 100644 --- a/rpcs3/rpcs3qt/instruction_editor_dialog.cpp +++ b/rpcs3/rpcs3qt/instruction_editor_dialog.cpp @@ -19,7 +19,7 @@ instruction_editor_dialog::instruction_editor_dialog(QWidget *parent, u32 _pc, c const auto cpu = _cpu.get(); m_cpu_offset = cpu->id_type() != 1 ? static_cast(*cpu).offset : 0; - QString instruction = qstr(fmt::format("%08x", vm::ps3::read32(m_cpu_offset + m_pc).value())); + QString instruction = qstr(fmt::format("%08x", vm::read32(m_cpu_offset + m_pc).value())); QVBoxLayout* vbox_panel(new QVBoxLayout()); QHBoxLayout* hbox_panel(new QHBoxLayout()); @@ -85,7 +85,7 @@ instruction_editor_dialog::instruction_editor_dialog(QWidget *parent, u32 _pc, c } else { - vm::ps3::write32(m_cpu_offset + m_pc, static_cast(opcode)); + vm::write32(m_cpu_offset + m_pc, static_cast(opcode)); } accept(); diff --git a/rpcs3/rpcs3qt/rsx_debugger.cpp b/rpcs3/rpcs3qt/rsx_debugger.cpp index 07ea0c1358..afab779ae3 100644 --- a/rpcs3/rpcs3qt/rsx_debugger.cpp +++ b/rpcs3/rpcs3qt/rsx_debugger.cpp @@ -81,7 +81,7 @@ rsx_debugger::rsx_debugger(QWidget* parent) b_break_draw->setEnabled(false); b_break_prim->setEnabled(false); b_break_inst->setEnabled(false); - + hbox_controls->addWidget(gb_controls_addr); hbox_controls->addWidget(gb_controls_goto); hbox_controls->addWidget(gb_controls_breaks); @@ -215,7 +215,7 @@ rsx_debugger::rsx_debugger(QWidget* parent) gb_buffers_depth ->setLayout(hbox_buffers_depth); gb_buffers_stencil->setLayout(hbox_buffers_stencil); gb_buffers_text ->setLayout(hbox_buffers_text); - + //Buffers and textures int m_panel_width = 108; int m_panel_height = 108; @@ -244,7 +244,7 @@ rsx_debugger::rsx_debugger(QWidget* parent) hbox_buffers_depth ->addWidget(m_buffer_depth); hbox_buffers_stencil->addWidget(m_buffer_stencil); hbox_buffers_text ->addWidget(m_buffer_tex); - + //Merge and display everything vbox_buffers1->addSpacing(10); vbox_buffers1->addWidget(gb_buffers_colorA); @@ -356,7 +356,7 @@ void rsx_debugger::wheelEvent(QWheelEvent* event) u32 offset; if(vm::check_addr(m_addr, 4)) { - u32 cmd = vm::ps3::read32(m_addr); + u32 cmd = vm::read32(m_addr); u32 count = ((cmd & RSX_METHOD_OLD_JUMP_CMD_MASK) == RSX_METHOD_OLD_JUMP_CMD) || ((cmd & RSX_METHOD_NEW_JUMP_CMD_MASK) == RSX_METHOD_NEW_JUMP_CMD) || ((cmd & RSX_METHOD_CALL_CMD_MASK) == RSX_METHOD_CALL_CMD) @@ -421,7 +421,7 @@ void Buffer::mouseDoubleClickEvent(QMouseEvent* event) return; } - const auto buffers = render->display_buffers; + const auto buffers = render->display_buffers; // TODO: Is there any better way to choose the color buffers #define SHOW_BUFFER(id) \ @@ -664,10 +664,10 @@ void rsx_debugger::GetMemory() for(u32 i=0, addr = m_addr; isetItem(i, 0, new QTableWidgetItem(qstr(fmt::format("%08x", addr)))); - + if (vm::check_addr(addr)) { - u32 cmd = vm::ps3::read32(addr); + u32 cmd = vm::read32(addr); u32 count = (cmd >> 18) & 0x7ff; m_list_commands->setItem(i, 1, new QTableWidgetItem(qstr(fmt::format("%08x", cmd)))); m_list_commands->setItem(i, 3, new QTableWidgetItem(qstr(fmt::format("%d", count)))); @@ -722,8 +722,8 @@ void rsx_debugger::GetBuffers() if(!vm::check_addr(RSXbuffer_addr)) continue; - auto RSXbuffer = vm::ps3::_ptr(RSXbuffer_addr); - + auto RSXbuffer = vm::_ptr(RSXbuffer_addr); + u32 width = buffers[bufferId].width; u32 height = buffers[bufferId].height; unsigned char* buffer = (unsigned char*)malloc(width * height * 4); @@ -771,7 +771,7 @@ void rsx_debugger::GetBuffers() if(!vm::check_addr(TexBuffer_addr)) return; - unsigned char* TexBuffer = vm::ps3::_ptr(TexBuffer_addr); + unsigned char* TexBuffer = vm::_ptr(TexBuffer_addr); u32 width = render->textures[m_cur_texture].width(); u32 height = render->textures[m_cur_texture].height(); @@ -861,7 +861,7 @@ void rsx_debugger::GetTexture() } else { - m_list_texture->setItem(i, 1, + m_list_texture->setItem(i, 1, new QTableWidgetItem(qstr(fmt::format("0x%x", rsx::get_address(render->textures[i].offset(), location))))); } @@ -1081,7 +1081,7 @@ const char* rsx_debugger::ParseGCMEnum(u32 value, u32 type) case 9: return "QUAD_STRIP"; case 10: return "POLYGON"; - default: return "Wrong Value!"; + default: return "Wrong Value!"; } } default: return "Unknown!"; @@ -1141,7 +1141,7 @@ QString rsx_debugger::DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioA && (cmd & RSX_METHOD_CALL_CMD_MASK) != RSX_METHOD_CALL_CMD && cmd != RSX_METHOD_RETURN_CMD) { - auto args = vm::ps3::ptr::make(currentAddr + 4); + auto args = vm::ptr::make(currentAddr + 4); u32 index = 0; switch((cmd & 0x3ffff) >> 2)