diff --git a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp index b2f535460c..4829fc0747 100644 --- a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp @@ -289,6 +289,9 @@ template std::string FragmentProgramDecompiler::GetSRC(T src) ret += AddConst(); break; + case 3: // ??? Used by a few games, what is it? + LOG_ERROR(RSX, "Src type 3 used, please report this to a developer."); + default: LOG_ERROR(RSX, "Bad src type %d", u32{ src.reg_type }); Emu.Pause(); @@ -315,7 +318,10 @@ std::string FragmentProgramDecompiler::BuildCode() { //main += fmt::format("\tgl_FragColor = %c0;\n", m_ctrl & 0x40 ? 'r' : 'h'); - if (m_ctrl & 0xe) main += m_ctrl & 0x40 ? "\tgl_FragDepth = r1.z;\n" : "\tgl_FragDepth = h2.z;\n"; + if (m_ctrl & 0xe) + { + main += m_ctrl & 0x40 ? "\tgl_FragDepth = r1.z;\n" : "\tgl_FragDepth = h0.z;\n"; + } std::stringstream OS; insertHeader(OS); diff --git a/rpcs3/Emu/RSX/GCM.h b/rpcs3/Emu/RSX/GCM.h index 27c13c7857..366f81cbf1 100644 --- a/rpcs3/Emu/RSX/GCM.h +++ b/rpcs3/Emu/RSX/GCM.h @@ -282,6 +282,14 @@ enum CELL_GCM_CONTEXT_DMA_NOTIFY_MAIN_0 = 0x6660420F, }; +// User Clip Values +enum +{ + CELL_GCM_USER_CLIP_PLANE_DISABLE = 0, + CELL_GCM_USER_CLIP_PLANE_ENABLE_LT = 1, + CELL_GCM_USER_CLIP_PLANE_ENABLE_GE = 2, +}; + struct CellGcmControl { atomic_be_t put; @@ -1440,9 +1448,10 @@ static const std::string GetMethodName(const u32 id) { NV4097_SET_TRANSFORM_BRANCH_BITS, "NV4097_SET_TRANSFORM_BRANCH_BITS" } }; - for(auto& s: METHOD_NAME_LIST) { - if(s.id == id) - return "CELL_GCM_" + s.name; + for (auto& s: METHOD_NAME_LIST) + { + if (s.id == id) + return s.name; } return fmt::format("unknown/illegal method [0x%08x]", id); diff --git a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp index bec90b0f2d..296d06b6ec 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp @@ -300,7 +300,7 @@ s32 cellFontGetRenderCharGlyphMetrics(vm::ptr font, u32 code, vm::ptr< s32 cellFontRenderCharGlyphImage(vm::ptr font, u32 code, vm::ptr surface, float x, float y, vm::ptr metrics, vm::ptr transInfo) { - cellFont.Log("cellFontRenderCharGlyphImage(font=*0x%x, code=0x%x, surface=*0x%x, x=%f, y=%f, metrics=*0x%x, trans=*0x%x)", font, code, surface, x, y, metrics, transInfo); + cellFont.Notice("cellFontRenderCharGlyphImage(font=*0x%x, code=0x%x, surface=*0x%x, x=%f, y=%f, metrics=*0x%x, trans=*0x%x)", font, code, surface, x, y, metrics, transInfo); if (!font->renderer_addr) { @@ -374,7 +374,7 @@ s32 cellFontGetEffectSlant(vm::ptr font, vm::ptr slantParam) s32 cellFontGetFontIdCode(vm::ptr font, u32 code, vm::ptr fontId, vm::ptr fontCode) { - cellFont.Todo("cellFontGetFontIdCode(font=*0x%x, code=0x%x, fontId=*0x%x, fontCode=*0x%x)", font, code, fontId, fontCode); + cellFont.Todo("cellFontGetFontIdCode(font=*0x%x, code=%d, fontId=*0x%x, fontCode=*0x%x)", font, code, fontId, fontCode); // TODO: ? return CELL_OK; diff --git a/rpcs3/Emu/SysCalls/Modules/cellFs.cpp b/rpcs3/Emu/SysCalls/Modules/cellFs.cpp index 02a887dce4..3d9f4ee8f9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFs.cpp @@ -789,7 +789,6 @@ s32 sdata_unpack(const std::string& packed_file, const std::string& unpacked_fil cellFs.Warning("cellFsSdataOpen: Compressed SDATA files are not supported yet."); return CELL_EFSSPECIFIC; } - // SDATA file is NOT compressed else { @@ -826,7 +825,7 @@ s32 sdata_unpack(const std::string& packed_file, const std::string& unpacked_fil s32 cellFsSdataOpen(PPUThread& ppu, vm::cptr path, s32 flags, vm::ptr fd, vm::cptr arg, u64 size) { - cellFs.Log("cellFsSdataOpen(path=*0x%x, flags=%#o, fd=*0x%x, arg=*0x%x, size=0x%llx)", path, flags, fd, arg, size); + cellFs.Notice("cellFsSdataOpen(path=*0x%x, flags=%#o, fd=*0x%x, arg=*0x%x, size=0x%llx)", path, flags, fd, arg, size); if (flags != CELL_FS_O_RDONLY) { diff --git a/rpcs3/Emu/SysCalls/Modules/cellGameExec.cpp b/rpcs3/Emu/SysCalls/Modules/cellGameExec.cpp index 33f7bc9c65..5b23200638 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGameExec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGameExec.cpp @@ -11,9 +11,13 @@ s32 cellGameSetExitParam() throw EXCEPTION(""); } -s32 cellGameGetHomeDataExportPath() +s32 cellGameGetHomeDataExportPath(vm::ptr exportPath) { - throw EXCEPTION(""); + cellGameExec.Warning("cellGameGetHomeDataExportPath(exportPath=0x%x)", exportPath); + + // TODO: PlayStation home is defunct. + + return CELL_GAME_ERROR_NOAPP; } s32 cellGameGetHomePath() diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 8ed5c626f5..82adb5d307 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -253,7 +253,7 @@ s32 cellGcmBindTile(u8 index) if (index >= RSXThread::m_tiles_count) { - cellGcmSys.Error("cellGcmBindTile : CELL_GCM_ERROR_INVALID_VALUE"); + cellGcmSys.Error("cellGcmBindTile: CELL_GCM_ERROR_INVALID_VALUE"); return CELL_GCM_ERROR_INVALID_VALUE; } @@ -269,7 +269,7 @@ s32 cellGcmBindZcull(u8 index) if (index >= RSXThread::m_zculls_count) { - cellGcmSys.Error("cellGcmBindZcull : CELL_GCM_ERROR_INVALID_VALUE"); + cellGcmSys.Error("cellGcmBindZcull: CELL_GCM_ERROR_INVALID_VALUE"); return CELL_GCM_ERROR_INVALID_VALUE; } @@ -328,7 +328,7 @@ s32 _cellGcmInitBody(vm::pptr context, u32 cmdSize, u32 ioSi { cellGcmSys.Warning("_cellGcmInitBody(context=**0x%x, cmdSize=0x%x, ioSize=0x%x, ioAddress=0x%x)", context, cmdSize, ioSize, ioAddress); - if(!local_size && !local_addr) + if (!local_size && !local_addr) { local_size = 0xf900000; // TODO: Get sdk_version in _cellGcmFunc15 and pass it to gcmGetLocalMemorySize local_addr = 0xC0000000; @@ -351,7 +351,7 @@ s32 _cellGcmInitBody(vm::pptr context, u32 cmdSize, u32 ioSi if (gcmMapEaIoAddress(ioAddress, 0, ioSize, false) != CELL_OK) { - cellGcmSys.Error("cellGcmInit : CELL_GCM_ERROR_FAILURE"); + cellGcmSys.Error("cellGcmInit: CELL_GCM_ERROR_FAILURE"); return CELL_GCM_ERROR_FAILURE; } @@ -432,8 +432,9 @@ s32 cellGcmSetDisplayBuffer(u32 id, u32 offset, u32 pitch, u32 width, u32 height { cellGcmSys.Log("cellGcmSetDisplayBuffer(id=0x%x,offset=0x%x,pitch=%d,width=%d,height=%d)", id, offset, width ? pitch / width : pitch, width, height); - if (id > 7) { - cellGcmSys.Error("cellGcmSetDisplayBuffer : CELL_EINVAL"); + if (id > 7) + { + cellGcmSys.Error("cellGcmSetDisplayBuffer: CELL_EINVAL"); return CELL_EINVAL; } @@ -444,7 +445,8 @@ s32 cellGcmSetDisplayBuffer(u32 id, u32 offset, u32 pitch, u32 width, u32 height buffers[id].width = width; buffers[id].height = height; - if (id + 1 > Emu.GetGSManager().GetRender().m_gcm_buffers_count) { + if (id + 1 > Emu.GetGSManager().GetRender().m_gcm_buffers_count) + { Emu.GetGSManager().GetRender().m_gcm_buffers_count = id + 1; } @@ -490,7 +492,7 @@ s32 cellGcmSetPrepareFlip(PPUThread& ppu, vm::ptr ctxt, u32 if (id > 7) { - cellGcmSys.Error("cellGcmSetPrepareFlip : CELL_GCM_ERROR_FAILURE"); + cellGcmSys.Error("cellGcmSetPrepareFlip: CELL_GCM_ERROR_FAILURE"); return CELL_GCM_ERROR_FAILURE; } @@ -498,7 +500,7 @@ s32 cellGcmSetPrepareFlip(PPUThread& ppu, vm::ptr ctxt, u32 { if (s32 res = ctxt->callback(ppu, ctxt, 8 /* ??? */)) { - cellGcmSys.Error("cellGcmSetPrepareFlip : callback failed (0x%08x)", res); + cellGcmSys.Error("cellGcmSetPrepareFlip: callback failed (0x%08x)", res); return res; } } @@ -551,19 +553,19 @@ s32 cellGcmSetTileInfo(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u if (index >= RSXThread::m_tiles_count || base >= 800 || bank >= 4) { - cellGcmSys.Error("cellGcmSetTileInfo : CELL_GCM_ERROR_INVALID_VALUE"); + cellGcmSys.Error("cellGcmSetTileInfo: CELL_GCM_ERROR_INVALID_VALUE"); return CELL_GCM_ERROR_INVALID_VALUE; } if (offset & 0xffff || size & 0xffff || pitch & 0xf) { - cellGcmSys.Error("cellGcmSetTileInfo : CELL_GCM_ERROR_INVALID_ALIGNMENT"); + cellGcmSys.Error("cellGcmSetTileInfo: CELL_GCM_ERROR_INVALID_ALIGNMENT"); return CELL_GCM_ERROR_INVALID_ALIGNMENT; } if (location >= 2 || (comp != 0 && (comp < 7 || comp > 12))) { - cellGcmSys.Error("cellGcmSetTileInfo : CELL_GCM_ERROR_INVALID_ALIGNMENT"); + cellGcmSys.Error("cellGcmSetTileInfo: CELL_GCM_ERROR_INVALID_ALIGNMENT"); return CELL_GCM_ERROR_INVALID_ENUM; } @@ -625,7 +627,7 @@ s32 cellGcmSetZcull(u8 index, u32 offset, u32 width, u32 height, u32 cullStart, if (index >= RSXThread::m_zculls_count) { - cellGcmSys.Error("cellGcmSetZcull : CELL_GCM_ERROR_INVALID_VALUE"); + cellGcmSys.Error("cellGcmSetZcull: CELL_GCM_ERROR_INVALID_VALUE"); return CELL_GCM_ERROR_INVALID_VALUE; } @@ -652,7 +654,7 @@ s32 cellGcmUnbindTile(u8 index) if (index >= RSXThread::m_tiles_count) { - cellGcmSys.Error("cellGcmUnbindTile : CELL_GCM_ERROR_INVALID_VALUE"); + cellGcmSys.Error("cellGcmUnbindTile: CELL_GCM_ERROR_INVALID_VALUE"); return CELL_GCM_ERROR_INVALID_VALUE; } @@ -668,7 +670,7 @@ s32 cellGcmUnbindZcull(u8 index) if (index >= 8) { - cellGcmSys.Error("cellGcmUnbindZcull : CELL_EINVAL"); + cellGcmSys.Error("cellGcmUnbindZcull: CELL_EINVAL"); return CELL_EINVAL; } @@ -773,7 +775,7 @@ s32 cellGcmSetFlipImmediate(u8 id) if (id > 7) { - cellGcmSys.Error("cellGcmSetFlipImmediate : CELL_GCM_ERROR_FAILURE"); + cellGcmSys.Error("cellGcmSetFlipImmediate: CELL_GCM_ERROR_FAILURE"); return CELL_GCM_ERROR_FAILURE; } @@ -898,7 +900,7 @@ s32 gcmMapEaIoAddress(u32 ea, u32 io, u32 size, bool is_strict) } else { - cellGcmSys.Error("cellGcmMapEaIoAddress : CELL_GCM_ERROR_FAILURE"); + cellGcmSys.Error("cellGcmMapEaIoAddress: CELL_GCM_ERROR_FAILURE"); return CELL_GCM_ERROR_FAILURE; } @@ -962,7 +964,7 @@ s32 cellGcmMapMainMemory(u32 ea, u32 size, vm::ptr offset) } else { - cellGcmSys.Error("cellGcmMapMainMemory : CELL_GCM_ERROR_NO_IO_PAGE_TABLE"); + cellGcmSys.Error("cellGcmMapMainMemory: CELL_GCM_ERROR_NO_IO_PAGE_TABLE"); return CELL_GCM_ERROR_NO_IO_PAGE_TABLE; } @@ -977,13 +979,13 @@ s32 cellGcmReserveIoMapSize(u32 size) if (size & 0xFFFFF) { - cellGcmSys.Error("cellGcmReserveIoMapSize : CELL_GCM_ERROR_INVALID_ALIGNMENT"); + cellGcmSys.Error("cellGcmReserveIoMapSize: CELL_GCM_ERROR_INVALID_ALIGNMENT"); return CELL_GCM_ERROR_INVALID_ALIGNMENT; } if (size > cellGcmGetMaxIoMapSize()) { - cellGcmSys.Error("cellGcmReserveIoMapSize : CELL_GCM_ERROR_INVALID_VALUE"); + cellGcmSys.Error("cellGcmReserveIoMapSize: CELL_GCM_ERROR_INVALID_VALUE"); return CELL_GCM_ERROR_INVALID_VALUE; } @@ -1045,13 +1047,13 @@ s32 cellGcmUnreserveIoMapSize(u32 size) if (size & 0xFFFFF) { - cellGcmSys.Error("cellGcmReserveIoMapSize : CELL_GCM_ERROR_INVALID_ALIGNMENT"); + cellGcmSys.Error("cellGcmReserveIoMapSize: CELL_GCM_ERROR_INVALID_ALIGNMENT"); return CELL_GCM_ERROR_INVALID_ALIGNMENT; } if (size > RSXIOMem.GetReservedAmount()) { - cellGcmSys.Error("cellGcmReserveIoMapSize : CELL_GCM_ERROR_INVALID_VALUE"); + cellGcmSys.Error("cellGcmReserveIoMapSize: CELL_GCM_ERROR_INVALID_VALUE"); return CELL_GCM_ERROR_INVALID_VALUE; } @@ -1140,25 +1142,25 @@ s32 cellGcmSetTile(u8 index, u8 location, u32 offset, u32 size, u32 pitch, u8 co index, location, offset, size, pitch, comp, base, bank); // Copied form cellGcmSetTileInfo - if(index >= RSXThread::m_tiles_count || base >= 800 || bank >= 4) + if (index >= RSXThread::m_tiles_count || base >= 800 || bank >= 4) { - cellGcmSys.Error("cellGcmSetTile : CELL_GCM_ERROR_INVALID_VALUE"); + cellGcmSys.Error("cellGcmSetTile: CELL_GCM_ERROR_INVALID_VALUE"); return CELL_GCM_ERROR_INVALID_VALUE; } - if(offset & 0xffff || size & 0xffff || pitch & 0xf) + if (offset & 0xffff || size & 0xffff || pitch & 0xf) { - cellGcmSys.Error("cellGcmSetTile : CELL_GCM_ERROR_INVALID_ALIGNMENT"); + cellGcmSys.Error("cellGcmSetTile: CELL_GCM_ERROR_INVALID_ALIGNMENT"); return CELL_GCM_ERROR_INVALID_ALIGNMENT; } - if(location >= 2 || (comp != 0 && (comp < 7 || comp > 12))) + if (location >= 2 || (comp != 0 && (comp < 7 || comp > 12))) { - cellGcmSys.Error("cellGcmSetTile : CELL_GCM_ERROR_INVALID_ENUM"); + cellGcmSys.Error("cellGcmSetTile: CELL_GCM_ERROR_INVALID_ENUM"); return CELL_GCM_ERROR_INVALID_ENUM; } - if(comp) + if (comp) { cellGcmSys.Error("cellGcmSetTile: bad compression mode! (%d)", comp); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp index e33ebab106..2906827504 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp @@ -12,14 +12,14 @@ extern Module cellL10n; -//translate code id to code name. some codepage may has another name. -//If this makes your compilation fail, try replace the string code with one in "iconv -l" +// Translate code id to code name. some codepage may has another name. +// If this makes your compilation fail, try replace the string code with one in "iconv -l" bool _L10nCodeParse(s32 code, std::string& retCode) { if ((code >= _L10N_CODE_) || (code < 0)) return false; switch (code) { - //I don't know these Unicode Variants is LB or BE. + // I don't know these Unicode Variants is LB or BE. case L10N_UTF8: retCode = "UTF-8"; return true; case L10N_UTF16: retCode = "UTF-16"; return true; case L10N_UTF32: retCode = "UTF-32"; return true; @@ -36,7 +36,7 @@ bool _L10nCodeParse(s32 code, std::string& retCode) case L10N_ISO_8859_9: retCode = "ISO-8859-9"; return true; case L10N_ISO_8859_10: retCode = "ISO-8859-10"; return true; case L10N_ISO_8859_11: retCode = "ISO-8859-11"; return true; - case L10N_ISO_8859_13: retCode = "ISO-8859-13"; return true; //No ISO-8859-12 ha ha. + case L10N_ISO_8859_13: retCode = "ISO-8859-13"; return true; // No ISO-8859-12 ha ha. case L10N_ISO_8859_14: retCode = "ISO-8859-14"; return true; case L10N_ISO_8859_15: retCode = "ISO-8859-15"; return true; case L10N_ISO_8859_16: retCode = "ISO-8859-16"; return true; @@ -48,25 +48,25 @@ bool _L10nCodeParse(s32 code, std::string& retCode) case L10N_CODEPAGE_936: retCode = "CP936"; return true; case L10N_CODEPAGE_949: retCode = "CP949"; return true; case L10N_CODEPAGE_950: retCode = "CP950"; return true; - case L10N_CODEPAGE_1251:retCode = "CP1251"; return true; //CYRL - case L10N_CODEPAGE_1252:retCode = "CP1252"; return true; //ANSI - case L10N_EUC_CN: retCode = "EUC-CN"; return true; //GB2312 + case L10N_CODEPAGE_1251:retCode = "CP1251"; return true; // CYRL + case L10N_CODEPAGE_1252:retCode = "CP1252"; return true; // ANSI + case L10N_EUC_CN: retCode = "EUC-CN"; return true; // GB2312 case L10N_EUC_JP: retCode = "EUC-JP"; return true; case L10N_EUC_KR: retCode = "EUC-KR"; return true; case L10N_ISO_2022_JP: retCode = "ISO-2022-JP"; return true; - case L10N_ARIB: retCode = "ARABIC"; return true; //TODO: think that should be ARABIC. + case L10N_ARIB: retCode = "ARABIC"; return true; // TODO: think that should be ARABIC. case L10N_HZ: retCode = "HZ"; return true; case L10N_GB18030: retCode = "GB18030"; return true; - case L10N_RIS_506: retCode = "SHIFT-JIS"; return true; //MusicShiftJIS, MS_KANJI - //These are only supported with FW 3.10 and above + case L10N_RIS_506: retCode = "SHIFT-JIS"; return true; // MusicShiftJIS, MS_KANJI + // These are only supported with FW 3.10 and above case L10N_CODEPAGE_852: retCode = "CP852"; return true; - case L10N_CODEPAGE_1250:retCode = "CP1250"; return true; //EE + case L10N_CODEPAGE_1250:retCode = "CP1250"; return true; // EE case L10N_CODEPAGE_737: retCode = "CP737"; return true; - case L10N_CODEPAGE_1253:retCode = "CP1253"; return true; //Greek + case L10N_CODEPAGE_1253:retCode = "CP1253"; return true; // Greek case L10N_CODEPAGE_857: retCode = "CP857"; return true; - case L10N_CODEPAGE_1254:retCode = "CP1254"; return true; //Turk + case L10N_CODEPAGE_1254:retCode = "CP1254"; return true; // Turk case L10N_CODEPAGE_775: retCode = "CP775"; return true; - case L10N_CODEPAGE_1257:retCode = "CP1257"; return true; //WINBALTRIM + case L10N_CODEPAGE_1257:retCode = "CP1257"; return true; // WINBALTRIM case L10N_CODEPAGE_855: retCode = "CP855"; return true; case L10N_CODEPAGE_858: retCode = "CP858"; return true; case L10N_CODEPAGE_860: retCode = "CP860"; return true; @@ -77,8 +77,8 @@ bool _L10nCodeParse(s32 code, std::string& retCode) } } -//translate code id to code name. -//If this makes your compilation fail, try replace the string code with one in "iconv -l" +// Translate code id to code name. +// If this makes your compilation fail, try replace the string code with one in "iconv -l" bool _L10nCodeParse(s32 code, u32& retCode) { retCode = 0; @@ -86,10 +86,10 @@ bool _L10nCodeParse(s32 code, u32& retCode) switch (code) { case L10N_UTF8: retCode = 65001; return false; - case L10N_UTF16: retCode = 1200; return false; //1200=LE,1201=BE - case L10N_UTF32: retCode = 12000; return false; //12000=LE,12001=BE - case L10N_UCS2: retCode = 1200; return false; //Not in OEM, but just the same as UTF16 - case L10N_UCS4: retCode = 12000; return false; //Not in OEM, but just the same as UTF32 + case L10N_UTF16: retCode = 1200; return false; // 1200=LE,1201=BE + case L10N_UTF32: retCode = 12000; return false; // 12000=LE,12001=BE + case L10N_UCS2: retCode = 1200; return false; // Not in OEM, but just the same as UTF16 + case L10N_UCS4: retCode = 12000; return false; // Not in OEM, but just the same as UTF32 //All OEM Code Pages are Multi-Byte, not wchar_t,u16,u32. case L10N_ISO_8859_1: retCode = 28591; return true; case L10N_ISO_8859_2: retCode = 28592; return true; @@ -102,7 +102,7 @@ bool _L10nCodeParse(s32 code, u32& retCode) case L10N_ISO_8859_9: retCode = 28599; return true; case L10N_ISO_8859_10: retCode = 28600; return true; case L10N_ISO_8859_11: retCode = 28601; return true; - case L10N_ISO_8859_13: retCode = 28603; return true; //No ISO-8859-12 ha ha. + case L10N_ISO_8859_13: retCode = 28603; return true; // No ISO-8859-12 ha ha. case L10N_ISO_8859_14: retCode = 28604; return true; case L10N_ISO_8859_15: retCode = 28605; return true; case L10N_ISO_8859_16: retCode = 28606; return true; @@ -114,26 +114,26 @@ bool _L10nCodeParse(s32 code, u32& retCode) case L10N_CODEPAGE_936: retCode = 936; return true; case L10N_CODEPAGE_949: retCode = 949; return true; case L10N_CODEPAGE_950: retCode = 950; return true; - case L10N_CODEPAGE_1251:retCode = 1251; return true; //CYRL - case L10N_CODEPAGE_1252:retCode = 1252; return true; //ANSI - case L10N_EUC_CN: retCode = 51936; return true; //GB2312 + case L10N_CODEPAGE_1251:retCode = 1251; return true; // CYRL + case L10N_CODEPAGE_1252:retCode = 1252; return true; // ANSI + case L10N_EUC_CN: retCode = 51936; return true; // GB2312 case L10N_EUC_JP: retCode = 51932; return true; case L10N_EUC_KR: retCode = 51949; return true; case L10N_ISO_2022_JP: retCode = 50222; return true; - //Maybe 708/720/864/1256/10004/20420/28596/ - case L10N_ARIB: retCode = 20420; return true; //TODO: think that should be ARABIC. + // Maybe 708/720/864/1256/10004/20420/28596/ + case L10N_ARIB: retCode = 20420; return true; // TODO: think that should be ARABIC. case L10N_HZ: retCode = 52936; return true; case L10N_GB18030: retCode = 54936; return true; - case L10N_RIS_506: retCode = 932; return true; //MusicShiftJIS, MS_KANJI, TODO: Code page - //These are only supported with FW 3.10 and above + case L10N_RIS_506: retCode = 932; return true; // MusicShiftJIS, MS_KANJI, TODO: Code page + // These are only supported with FW 3.10 and above case L10N_CODEPAGE_852: retCode = 852; return true; - case L10N_CODEPAGE_1250:retCode = 1250; return true; //EE + case L10N_CODEPAGE_1250:retCode = 1250; return true; // EE case L10N_CODEPAGE_737: retCode = 737; return true; - case L10N_CODEPAGE_1253:retCode = 1253; return true; //Greek + case L10N_CODEPAGE_1253:retCode = 1253; return true; // Greek case L10N_CODEPAGE_857: retCode = 857; return true; - case L10N_CODEPAGE_1254:retCode = 1254; return true; //Turk + case L10N_CODEPAGE_1254:retCode = 1254; return true; // Turk case L10N_CODEPAGE_775: retCode = 775; return true; - case L10N_CODEPAGE_1257:retCode = 1257; return true; //WINBALTRIM + case L10N_CODEPAGE_1257:retCode = 1257; return true; // WINBALTRIM case L10N_CODEPAGE_855: retCode = 855; return true; case L10N_CODEPAGE_858: retCode = 858; return true; case L10N_CODEPAGE_860: retCode = 860; return true; @@ -144,10 +144,10 @@ bool _L10nCodeParse(s32 code, u32& retCode) } } -//TODO: check and complete transforms. note: unicode to/from other Unicode Formats is needed. +// TODO: check and complete transforms. note: unicode to/from other Unicode Formats is needed. #ifdef _MSC_VER -//Use code page to transform std::string to std::wstring. +// Use code page to transform std::string to std::wstring. s32 _OEM2Wide(u32 oem_code, const std::string src, std::wstring& dst) { //Such length returned should include the '\0' character. @@ -164,7 +164,7 @@ s32 _OEM2Wide(u32 oem_code, const std::string src, std::wstring& dst) return length - 1; } -//Use Code page to transform std::wstring to std::string. +// Use Code page to transform std::wstring to std::string. s32 _Wide2OEM(u32 oem_code, const std::wstring src, std::string& dst) { //Such length returned should include the '\0' character. @@ -181,7 +181,7 @@ s32 _Wide2OEM(u32 oem_code, const std::wstring src, std::string& dst) return length - 1; } -//Convert Codepage to Codepage (all char*) +// Convert Codepage to Codepage (all char*) std::string _OemToOem(u32 src_code, u32 dst_code, const std::string str) { std::wstring wide; std::string result; @@ -191,8 +191,8 @@ std::string _OemToOem(u32 src_code, u32 dst_code, const std::string str) } /* -//Original piece of code. and this is for windows using with _OEM2Wide,_Wide2OEM,_OemToOem. -//The Char -> Char Execution of this function has already been tested using VS and CJK text with encoding. +// Original piece of code. and this is for windows using with _OEM2Wide,_Wide2OEM,_OemToOem. +// The Char -> Char Execution of this function has already been tested using VS and CJK text with encoding. s32 _L10nConvertStr(s32 src_code, const void *src, size_t * src_len, s32 dst_code, void *dst, size_t * dst_len) { u32 srcCode = 0, dstCode = 0; //OEM code pages @@ -215,8 +215,8 @@ s32 _L10nConvertStr(s32 src_code, const void *src, size_t * src_len, s32 dst_cod return ConversionOK; } -//This is the one used with iconv library for linux/mac. Also char->char. -//I've tested the code with console apps using codeblocks. +// This is the one used with iconv library for linux/mac. Also char->char. +// I've tested the code with console apps using codeblocks. s32 _L10nConvertStr(s32 src_code, const void* src, size_t * src_len, s32 dst_code, void * dst, size_t * dst_len) { std::string srcCode, dstCode; diff --git a/rpcs3/Emu/SysCalls/Modules/cellL10n.h b/rpcs3/Emu/SysCalls/Modules/cellL10n.h index 7595d2a000..a1a8d02e94 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellL10n.h +++ b/rpcs3/Emu/SysCalls/Modules/cellL10n.h @@ -17,13 +17,13 @@ enum enum { L10N_STR_UNKNOWN = (1 << 0), - L10N_STR_ASCII = (1 << 1), - L10N_STR_JIS = (1 << 2), - L10N_STR_EUCJP = (1 << 3), - L10N_STR_SJIS = (1 << 4), - L10N_STR_UTF8 = (1 << 5), + L10N_STR_ASCII = (1 << 1), + L10N_STR_JIS = (1 << 2), + L10N_STR_EUCJP = (1 << 3), + L10N_STR_SJIS = (1 << 4), + L10N_STR_UTF8 = (1 << 5), L10N_STR_ILLEGAL = (1 << 16), - L10N_STR_ERROR = (1 << 17), + L10N_STR_ERROR = (1 << 17), }; // CodePages diff --git a/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp b/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp index df354a0442..6fa25276ab 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellMouse.cpp @@ -11,8 +11,16 @@ extern Module sys_io; s32 cellMouseInit(u32 max_connect) { sys_io.Warning("cellMouseInit(max_connect=%d)", max_connect); - if(Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_ALREADY_INITIALIZED; - if(max_connect > 7) return CELL_MOUSE_ERROR_INVALID_PARAMETER; + + if (Emu.GetMouseManager().IsInited()) + { + return CELL_MOUSE_ERROR_ALREADY_INITIALIZED; + } + + if (max_connect > 7) + { + return CELL_MOUSE_ERROR_INVALID_PARAMETER; + } Emu.GetMouseManager().Init(max_connect); return CELL_OK; @@ -22,8 +30,16 @@ s32 cellMouseInit(u32 max_connect) s32 cellMouseClearBuf(u32 port_no) { sys_io.Log("cellMouseClearBuf(port_no=%d)", port_no); - if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; - if(port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_INVALID_PARAMETER; + + if (!Emu.GetMouseManager().IsInited()) + { + return CELL_MOUSE_ERROR_UNINITIALIZED; + } + + if (port_no >= Emu.GetMouseManager().GetMice().size()) + { + return CELL_MOUSE_ERROR_INVALID_PARAMETER; + } //? @@ -33,7 +49,12 @@ s32 cellMouseClearBuf(u32 port_no) s32 cellMouseEnd() { sys_io.Log("cellMouseEnd()"); - if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; + + if (!Emu.GetMouseManager().IsInited()) + { + return CELL_MOUSE_ERROR_UNINITIALIZED; + } + Emu.GetMouseManager().Close(); return CELL_OK; } @@ -41,15 +62,19 @@ s32 cellMouseEnd() s32 cellMouseGetInfo(vm::ptr info) { sys_io.Log("cellMouseGetInfo(info=*0x%x)", info); - if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; + + if (!Emu.GetMouseManager().IsInited()) + { + return CELL_MOUSE_ERROR_UNINITIALIZED; + } const MouseInfo& current_info = Emu.GetMouseManager().GetInfo(); info->max_connect = current_info.max_connect; info->now_connect = current_info.now_connect; info->info = current_info.info; - for(u32 i=0; ivendor_id[i] = current_info.vendor_id[i]; - for(u32 i=0; iproduct_id[i] = current_info.product_id[i]; - for(u32 i=0; istatus[i] = current_info.status[i]; + for (u32 i=0; ivendor_id[i] = current_info.vendor_id[i]; + for (u32 i=0; iproduct_id[i] = current_info.product_id[i]; + for (u32 i=0; istatus[i] = current_info.status[i]; return CELL_OK; } @@ -57,8 +82,15 @@ s32 cellMouseGetInfo(vm::ptr info) s32 cellMouseInfoTabletMode(u32 port_no, vm::ptr info) { sys_io.Log("cellMouseInfoTabletMode(port_no=%d, info=*0x%x)", port_no, info); - if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; - if(port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_INVALID_PARAMETER; + if (!Emu.GetMouseManager().IsInited()) + { + return CELL_MOUSE_ERROR_UNINITIALIZED; + } + + if (port_no >= Emu.GetMouseManager().GetMice().size()) + { + return CELL_MOUSE_ERROR_INVALID_PARAMETER; + } info->is_supported = 0; // Unimplemented: (0=Tablet mode is not supported) info->mode = 1; // Unimplemented: (1=Mouse mode) @@ -69,8 +101,14 @@ s32 cellMouseInfoTabletMode(u32 port_no, vm::ptr info) s32 cellMouseGetData(u32 port_no, vm::ptr data) { sys_io.Log("cellMouseGetData(port_no=%d, data=*0x%x)", port_no, data); - if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; - if(port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_NO_DEVICE; + if (!Emu.GetMouseManager().IsInited()) + { + return CELL_MOUSE_ERROR_UNINITIALIZED; + } + if (port_no >= Emu.GetMouseManager().GetMice().size()) + { + return CELL_MOUSE_ERROR_NO_DEVICE; + } MouseData& current_data = Emu.GetMouseManager().GetData(port_no); data->update = current_data.update; @@ -112,8 +150,8 @@ s32 cellMouseGetTabletDataList(u32 port_no, u32 data_addr) s32 cellMouseGetRawData(u32 port_no, vm::ptr data) { sys_io.Todo("cellMouseGetRawData(port_no=%d, data=*0x%x)", port_no, data); - /*if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; - if(port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_NO_DEVICE; + /*if (!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; + if (port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_NO_DEVICE; CellMouseRawData& current_rawdata = Emu.GetMouseManager().GetRawData(port_no); data += current_rawdata.len; diff --git a/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp b/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp index 95c903c8cd..f1e7329f65 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellVideoOut.cpp @@ -51,7 +51,7 @@ s32 cellVideoOutGetResolution(u32 resolutionId, vm::ptr s32 cellVideoOutConfigure(u32 videoOut, vm::ptr config, vm::ptr option, u32 waitForEvent) { - cellSysutil.Warning("cellVideoOutConfigure(videoOut=%d, config=*0x%x, option=*0x%x, waitForEvent=0x%x)", videoOut, config, option, waitForEvent); + cellSysutil.Warning("cellVideoOutConfigure(videoOut=%d, config=*0x%x, option=*0x%x, waitForEvent=%d)", videoOut, config, option, waitForEvent); switch (videoOut) { diff --git a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp index 95ed5477d3..d5bc0d1f14 100644 --- a/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sysPrxForUser.cpp @@ -145,9 +145,12 @@ s32 console_putc() throw EXCEPTION(""); } -s32 console_write() +void console_write(vm::ptr data, u32 len) { - throw EXCEPTION(""); + sysPrxForUser.Warning("console_write(data=*0x%x, len=%d)", data, len); + sysPrxForUser.Warning("*** data='%s'", data.get_ptr()); + + LOG_NOTICE(TTY, "%s", data.get_ptr()); } diff --git a/rpcs3/Emu/SysCalls/SysCalls.cpp b/rpcs3/Emu/SysCalls/SysCalls.cpp index ff2ec5cd0f..38a2e4c3ef 100644 --- a/rpcs3/Emu/SysCalls/SysCalls.cpp +++ b/rpcs3/Emu/SysCalls/SysCalls.cpp @@ -59,7 +59,7 @@ const ppu_func_caller g_sc_table[1024] = bind_func(sys_process_get_number_of_object), //12 (0x00C) bind_func(sys_process_get_id), //13 (0x00D) - bind_func(sys_process_is_spu_lock_line_reservation_address), //14 (0x00E) + bind_func(sys_process_is_spu_lock_line_reservation_address), //14 (0x00E) null_func, null_func, null_func, //15-17 UNS @@ -75,7 +75,7 @@ const ppu_func_caller g_sc_table[1024] = null_func,//bind_func(), //27 (0x01B) DBG null_func,//bind_func(_sys_process_get_number_of_object)//28 (0x01C) ROOT bind_func(sys_process_get_id), //29 (0x01D) ROOT - bind_func(_sys_process_get_paramsfo), //30 (0x01E) + bind_func(_sys_process_get_paramsfo), //30 (0x01E) null_func,//bind_func(sys_process_get_ppu_guid), //31 (0x01F) null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, null_func, //32-40 UNS @@ -91,7 +91,7 @@ const ppu_func_caller g_sc_table[1024] = bind_func(sys_ppu_thread_get_stack_information), //49 (0x031) null_func,//bind_func(sys_ppu_thread_stop), //50 (0x032) ROOT null_func,//bind_func(sys_ppu_thread_restart), //51 (0x033) ROOT - bind_func(_sys_ppu_thread_create), //52 (0x034) DBG + bind_func(_sys_ppu_thread_create), //52 (0x034) DBG bind_func(sys_ppu_thread_start), //53 (0x035) null_func,//bind_func(sys_ppu_...), //54 (0x036) ROOT null_func,//bind_func(sys_ppu_...), //55 (0x037) ROOT @@ -442,14 +442,14 @@ const ppu_func_caller g_sc_table[1024] = null_func, null_func, null_func, //477-479 UNS - bind_func(sys_prx_load_module), //480 (0x1E0) - bind_func(sys_prx_start_module), //481 (0x1E1) - bind_func(sys_prx_stop_module), //482 (0x1E2) - bind_func(sys_prx_unload_module), //483 (0x1E3) - bind_func(sys_prx_register_module), //484 (0x1E4) + bind_func(sys_prx_load_module), //480 (0x1E0) + bind_func(sys_prx_start_module), //481 (0x1E1) + bind_func(sys_prx_stop_module), //482 (0x1E2) + bind_func(sys_prx_unload_module), //483 (0x1E3) + bind_func(sys_prx_register_module), //484 (0x1E4) bind_func(sys_prx_query_module), //485 (0x1E5) bind_func(sys_prx_register_library), //486 (0x1E6) - bind_func(sys_prx_unregister_library), //487 (0x1E7) + bind_func(sys_prx_unregister_library), //487 (0x1E7) bind_func(sys_prx_link_library), //488 (0x1E8) bind_func(sys_prx_unlink_library), //489 (0x1E9) bind_func(sys_prx_query_library), //490 (0x1EA)