mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Cell
This commit is contained in:
parent
38c444cfa1
commit
e2d82394f6
@ -110,9 +110,12 @@ struct ppu_error_code
|
||||
{
|
||||
}
|
||||
|
||||
// Helper
|
||||
enum class not_an_error : s32 {};
|
||||
|
||||
// Silence any error
|
||||
constexpr ppu_error_code(s32 value, const std::nothrow_t&)
|
||||
: value(value)
|
||||
constexpr ppu_error_code(not_an_error value)
|
||||
: value(static_cast<s32>(value))
|
||||
{
|
||||
}
|
||||
|
||||
@ -124,7 +127,7 @@ struct ppu_error_code
|
||||
};
|
||||
|
||||
// Helper macro for silencing possible error checks on returning ppu_error_code values
|
||||
#define NOT_AN_ERROR(value) { static_cast<s32>(value), std::nothrow }
|
||||
#define NOT_AN_ERROR(...) static_cast<ppu_error_code::not_an_error>(__VA_ARGS__)
|
||||
|
||||
template<typename T, typename>
|
||||
struct ppu_gpr_cast_impl;
|
||||
|
@ -15,7 +15,9 @@ extern "C"
|
||||
#include "cellPamf.h"
|
||||
#include "cellAdec.h"
|
||||
|
||||
LOG_CHANNEL(cellAdec);
|
||||
#include <thread>
|
||||
|
||||
logs::channel cellAdec("cellAdec", logs::level::notice);
|
||||
|
||||
AudioDecoder::AudioDecoder(s32 type, u32 addr, u32 size, vm::ptr<CellAdecCbMsg> func, u32 arg)
|
||||
: type(type)
|
||||
@ -468,7 +470,7 @@ void adecOpen(u32 adec_id) // TODO: call from the constructor
|
||||
|
||||
adec.adecCb->cpu_init();
|
||||
adec.adecCb->state -= cpu_state::stop;
|
||||
adec.adecCb->lock_notify();
|
||||
(*adec.adecCb)->lock_notify();
|
||||
}
|
||||
|
||||
bool adecCheckType(s32 type)
|
||||
@ -569,7 +571,7 @@ s32 cellAdecClose(u32 handle)
|
||||
{
|
||||
CHECK_EMU_STATUS;
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
}
|
||||
|
||||
idm::remove<PPUThread>(adec->adecCb->id);
|
||||
@ -682,7 +684,7 @@ s32 cellAdecGetPcm(u32 handle, vm::ptr<float> outBuffer)
|
||||
AdecFrame af;
|
||||
if (!adec->frames.try_pop(af))
|
||||
{
|
||||
//std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
//std::this_thread::sleep_for(1ms); // hack
|
||||
return CELL_ADEC_ERROR_EMPTY;
|
||||
}
|
||||
|
||||
@ -798,7 +800,7 @@ s32 cellAdecGetPcmItem(u32 handle, vm::pptr<CellAdecPcmItem> pcmItem)
|
||||
AdecFrame af;
|
||||
if (!adec->frames.try_peek(af))
|
||||
{
|
||||
//std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
//std::this_thread::sleep_for(1ms); // hack
|
||||
return CELL_ADEC_ERROR_EMPTY;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "cellAtrac.h"
|
||||
|
||||
LOG_CHANNEL(cellAtrac);
|
||||
logs::channel cellAtrac("cellAtrac", logs::level::notice);
|
||||
|
||||
s32 cellAtracSetDataAndGetMemSize(vm::ptr<CellAtracHandle> pHandle, vm::ptr<u8> pucBufferAddr, u32 uiReadByte, u32 uiBufferByte, vm::ptr<u32> puiWorkMemByte)
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "cellAtracMulti.h"
|
||||
|
||||
LOG_CHANNEL(cellAtracMulti);
|
||||
logs::channel cellAtracMulti("cellAtracMulti", logs::level::notice);
|
||||
|
||||
s32 cellAtracMultiSetDataAndGetMemSize(vm::ptr<CellAtracMultiHandle> pHandle, vm::ptr<u8> pucBufferAddr, u32 uiReadByte, u32 uiBufferByte, u32 uiOutputChNum, vm::ptr<s32> piTrackArray, vm::ptr<u32> puiWorkMemByte)
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Utilities/Config.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
@ -8,7 +9,9 @@
|
||||
#include "Emu/Audio/AudioThread.h"
|
||||
#include "cellAudio.h"
|
||||
|
||||
LOG_CHANNEL(cellAudio);
|
||||
#include <thread>
|
||||
|
||||
logs::channel cellAudio("cellAudio", logs::level::notice);
|
||||
|
||||
cfg::bool_entry g_cfg_audio_dump_to_file(cfg::root.audio, "Dump to file");
|
||||
cfg::bool_entry g_cfg_audio_convert_to_u16(cfg::root.audio, "Convert to 16 bit");
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "cellAudioOut.h"
|
||||
|
||||
extern _log::channel cellSysutil;
|
||||
extern logs::channel cellSysutil;
|
||||
|
||||
s32 cellAudioOutGetSoundAvailability(u32 audioOut, u32 type, u32 fs, u32 option)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "cellAudioOut.h"
|
||||
#include "cellVideoOut.h"
|
||||
|
||||
LOG_CHANNEL(cellAvconfExt);
|
||||
logs::channel cellAvconfExt("cellAvconfExt", logs::level::notice);
|
||||
|
||||
vm::gvar<f32> g_gamma; // TODO
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellBGDL);
|
||||
logs::channel cellBGDL("cellBGDL", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -1,11 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
#include "Utilities/Config.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "cellCamera.h"
|
||||
|
||||
LOG_CHANNEL(cellCamera);
|
||||
logs::channel cellCamera("cellCamera", logs::level::notice);
|
||||
|
||||
cfg::map_entry<bool> g_cfg_camera(cfg::root.io, "Camera",
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellCelp8Enc);
|
||||
logs::channel cellCelp8Enc("cellCelp8Enc", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellCelpEnc);
|
||||
logs::channel cellCelpEnc("cellCelpEnc", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellDaisy);
|
||||
logs::channel cellDaisy("cellDaisy", logs::level::notice);
|
||||
|
||||
s32 _ZN4cell5Daisy17LFQueue2PushCloseEPNS0_8LFQueue2EPFiPvjE()
|
||||
{
|
||||
|
@ -6,7 +6,9 @@
|
||||
#include "cellPamf.h"
|
||||
#include "cellDmux.h"
|
||||
|
||||
LOG_CHANNEL(cellDmux);
|
||||
#include <thread>
|
||||
|
||||
logs::channel cellDmux("cellDmux", logs::level::notice);
|
||||
|
||||
PesHeader::PesHeader(DemuxerStream& stream)
|
||||
: pts(CODEC_TS_INVALID)
|
||||
@ -142,7 +144,7 @@ void ElementaryStream::push_au(u32 size, u64 dts, u64 pts, u64 userdata, bool ra
|
||||
u32 addr;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
ASSERT(!is_full(size));
|
||||
VERIFY(!is_full(size));
|
||||
|
||||
if (put + size + 128 > memAddr + memSize)
|
||||
{
|
||||
@ -183,7 +185,7 @@ void ElementaryStream::push_au(u32 size, u64 dts, u64 pts, u64 userdata, bool ra
|
||||
put_count++;
|
||||
}
|
||||
|
||||
ASSERT(entries.push(addr, &dmux->is_closed));
|
||||
VERIFY(entries.push(addr, &dmux->is_closed));
|
||||
}
|
||||
|
||||
void ElementaryStream::push(DemuxerStream& stream, u32 size)
|
||||
@ -447,7 +449,7 @@ void dmuxOpen(u32 dmux_id) // TODO: call from the constructor
|
||||
if (es.raw_data.size() > 1024 * 1024)
|
||||
{
|
||||
stream = backup;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -543,7 +545,7 @@ void dmuxOpen(u32 dmux_id) // TODO: call from the constructor
|
||||
if (es.isfull(old_size))
|
||||
{
|
||||
stream = backup;
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -711,7 +713,7 @@ void dmuxOpen(u32 dmux_id) // TODO: call from the constructor
|
||||
{
|
||||
if (Emu.IsStopped() || dmux.is_closed) break;
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
}
|
||||
|
||||
es.push_au(old_size, es.last_dts, es.last_pts, stream.userdata, false, 0);
|
||||
@ -759,7 +761,7 @@ void dmuxOpen(u32 dmux_id) // TODO: call from the constructor
|
||||
|
||||
dmux.dmuxCb->cpu_init();
|
||||
dmux.dmuxCb->state -= cpu_state::stop;
|
||||
dmux.dmuxCb->lock_notify();
|
||||
(*dmux.dmuxCb)->lock_notify();
|
||||
}
|
||||
|
||||
s32 cellDmuxQueryAttr(vm::cptr<CellDmuxType> type, vm::ptr<CellDmuxAttr> attr)
|
||||
@ -865,7 +867,7 @@ s32 cellDmuxClose(u32 handle)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
}
|
||||
|
||||
idm::remove<PPUThread>(dmux->dmuxCb->id);
|
||||
@ -886,7 +888,7 @@ s32 cellDmuxSetStream(u32 handle, u32 streamAddress, u32 streamSize, b8 disconti
|
||||
|
||||
if (dmux->is_running.exchange(true))
|
||||
{
|
||||
//std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
//std::this_thread::sleep_for(1ms); // hack
|
||||
return CELL_DMUX_ERROR_BUSY;
|
||||
}
|
||||
|
||||
@ -943,7 +945,7 @@ s32 cellDmuxResetStreamAndWaitDone(u32 handle)
|
||||
cellDmux.warning("cellDmuxResetStreamAndWaitDone(%d) aborted", handle);
|
||||
return CELL_OK;
|
||||
}
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "cellFiber.h"
|
||||
|
||||
LOG_CHANNEL(cellFiber);
|
||||
logs::channel cellFiber("cellFiber", logs::level::notice);
|
||||
|
||||
s32 _cellFiberPpuInitialize()
|
||||
{
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "cellFont.h"
|
||||
|
||||
LOG_CHANNEL(cellFont);
|
||||
logs::channel cellFont("cellFont", logs::level::notice);
|
||||
|
||||
// Functions
|
||||
s32 cellFontInitializeWithRevision(u64 revisionFlags, vm::ptr<CellFontConfig> config)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "cellFontFT.h"
|
||||
|
||||
LOG_CHANNEL(cellFontFT);
|
||||
logs::channel cellFontFT("cellFontFT", logs::level::notice);
|
||||
|
||||
s32 cellFontInitLibraryFreeTypeWithRevision(u64 revisionFlags, vm::ptr<CellFontLibraryConfigFT> config, vm::pptr<CellFontLibrary> lib)
|
||||
{
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
LOG_CHANNEL(cellFs);
|
||||
logs::channel cellFs("cellFs", logs::level::notice);
|
||||
|
||||
s32 cellFsOpen(vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, vm::cptr<void> arg, u64 size)
|
||||
{
|
||||
@ -527,7 +527,7 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size)
|
||||
}
|
||||
}
|
||||
|
||||
file->cv.wait_for(lock, std::chrono::milliseconds(1));
|
||||
file->cv.wait_for(lock, 1ms);
|
||||
}
|
||||
|
||||
file->st_status.compare_and_swap(SSS_STOPPED, SSS_INITIALIZED);
|
||||
@ -688,7 +688,7 @@ s32 cellFsStReadWait(u32 fd, u64 size)
|
||||
{
|
||||
CHECK_EMU_STATUS;
|
||||
|
||||
file->cv.wait_for(lock, std::chrono::milliseconds(1));
|
||||
file->cv.wait_for(lock, 1ms);
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -10,7 +10,9 @@
|
||||
#include "Loader/PSF.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
LOG_CHANNEL(cellGame);
|
||||
#include <thread>
|
||||
|
||||
logs::channel cellGame("cellGame", logs::level::notice);
|
||||
|
||||
// Normal content directory (if is_temporary is not involved):
|
||||
// contentInfo = dir
|
||||
@ -308,7 +310,7 @@ ppu_error_code cellGameContentPermit(vm::ptr<char[CELL_GAME_PATH_MAX]> contentIn
|
||||
}
|
||||
|
||||
// Create PARAM.SFO
|
||||
fs::file(dir + "/PARAM.SFO", fs::rewrite).write(psf::save_object(prm->sfo));
|
||||
psf::save_object(fs::file(dir + "/PARAM.SFO", fs::rewrite), prm->sfo);
|
||||
|
||||
// Disable deletion
|
||||
prm->is_temporary = false;
|
||||
@ -555,7 +557,7 @@ ppu_error_code cellGameGetParamString(s32 id, vm::ptr<char> buf, u32 bufsize)
|
||||
std::string&& value = psf::get_string(prm->sfo, key);
|
||||
value.resize(bufsize - 1);
|
||||
|
||||
std::copy_n(value.c_str(), value.size() + 1, buf.get_ptr());
|
||||
std::memcpy(buf.get_ptr(), value.c_str(), bufsize);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "cellGame.h"
|
||||
|
||||
LOG_CHANNEL(cellGameExec);
|
||||
logs::channel cellGameExec("cellGameExec", logs::level::notice);
|
||||
|
||||
s32 cellGameSetExitParam()
|
||||
{
|
||||
|
@ -8,7 +8,9 @@
|
||||
#include "Emu/RSX/GSRender.h"
|
||||
#include "cellGcmSys.h"
|
||||
|
||||
LOG_CHANNEL(cellGcmSys);
|
||||
#include <thread>
|
||||
|
||||
logs::channel cellGcmSys("cellGcmSys", logs::level::notice);
|
||||
|
||||
extern s32 cellGcmCallback(vm::ptr<CellGcmContextData> context, u32 count);
|
||||
|
||||
@ -933,7 +935,7 @@ s32 cellGcmMapEaIoAddressWithFlags(u32 ea, u32 io, u32 size, u32 flags)
|
||||
{
|
||||
cellGcmSys.warning("cellGcmMapEaIoAddressWithFlags(ea=0x%x, io=0x%x, size=0x%x, flags=0x%x)", ea, io, size, flags);
|
||||
|
||||
ASSERT(flags == 2 /*CELL_GCM_IOMAP_FLAG_STRICT_ORDERING*/);
|
||||
VERIFY(flags == 2 /*CELL_GCM_IOMAP_FLAG_STRICT_ORDERING*/);
|
||||
|
||||
return gcmMapEaIoAddress(ea, io, size, true);
|
||||
}
|
||||
@ -1257,7 +1259,7 @@ static std::pair<u32, u32> getNextCommandBufferBeginEnd(u32 current)
|
||||
static u32 getOffsetFromAddress(u32 address)
|
||||
{
|
||||
const u32 upper = offsetTable.ioAddress[address >> 20]; // 12 bits
|
||||
Expects(upper != 0xFFFF);
|
||||
EXPECTS(upper != 0xFFFF);
|
||||
return (upper << 20) | (address & 0xFFFFF);
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "cellGem.h"
|
||||
|
||||
LOG_CHANNEL(cellGem);
|
||||
logs::channel cellGem("cellGem", logs::level::notice);
|
||||
|
||||
struct gem_t
|
||||
{
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "Emu/Cell/lv2/sys_fs.h"
|
||||
#include "cellGifDec.h"
|
||||
|
||||
LOG_CHANNEL(cellGifDec);
|
||||
logs::channel cellGifDec("cellGifDec", logs::level::notice);
|
||||
|
||||
// cellGifDec aliases (only for cellGifDec.cpp)
|
||||
using PPMainHandle = vm::pptr<GifDecoder>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellHttp);
|
||||
logs::channel cellHttp("cellHttp", logs::level::notice);
|
||||
|
||||
s32 cellHttpInit()
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellHttpUtil);
|
||||
logs::channel cellHttpUtil("cellHttpUtil", logs::level::notice);
|
||||
|
||||
s32 cellHttpUtilParseUri()
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellImeJp);
|
||||
logs::channel cellImeJp("cellImeJp", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "Emu/Cell/lv2/sys_fs.h"
|
||||
#include "cellJpgDec.h"
|
||||
|
||||
LOG_CHANNEL(cellJpgDec);
|
||||
logs::channel cellJpgDec("cellJpgDec", logs::level::notice);
|
||||
|
||||
s32 cellJpgDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam)
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellJpgEnc);
|
||||
logs::channel cellJpgEnc("cellJpgEnc", logs::level::notice);
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "Emu/Io/KeyboardHandler.h"
|
||||
#include "cellKb.h"
|
||||
|
||||
extern _log::channel sys_io;
|
||||
extern logs::channel sys_io;
|
||||
|
||||
s32 cellKbInit(u32 max_connect)
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellKey2char);
|
||||
logs::channel cellKey2char("cellKey2char", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -14,7 +14,7 @@ typedef const char *HostCode;
|
||||
|
||||
#include "cellL10n.h"
|
||||
|
||||
LOG_CHANNEL(cellL10n);
|
||||
logs::channel cellL10n("cellL10n", logs::level::notice);
|
||||
|
||||
// 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"
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "cellMic.h"
|
||||
|
||||
LOG_CHANNEL(cellMic);
|
||||
logs::channel cellMic("cellMic", logs::level::notice);
|
||||
|
||||
s32 cellMicInit()
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "Emu/Io/MouseHandler.h"
|
||||
#include "cellMouse.h"
|
||||
|
||||
extern _log::channel sys_io;
|
||||
extern logs::channel sys_io;
|
||||
|
||||
s32 cellMouseInit(u32 max_connect)
|
||||
{
|
||||
|
@ -6,7 +6,9 @@
|
||||
#include "cellSysutil.h"
|
||||
#include "cellMsgDialog.h"
|
||||
|
||||
extern _log::channel cellSysutil;
|
||||
#include <thread>
|
||||
|
||||
extern logs::channel cellSysutil;
|
||||
|
||||
s32 cellMsgDialogOpen()
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "cellMusic.h"
|
||||
|
||||
LOG_CHANNEL(cellMusic);
|
||||
logs::channel cellMusic("cellMusic", logs::level::notice);
|
||||
|
||||
struct music2_t
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellMusicDecode);
|
||||
logs::channel cellMusicDecode("cellMusicDecode", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellMusicExport);
|
||||
logs::channel cellMusicExport("cellMusicExport", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Utilities/Config.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
@ -7,7 +8,7 @@
|
||||
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
LOG_CHANNEL(cellNetCtl);
|
||||
logs::channel cellNetCtl("cellNetCtl", logs::level::notice);
|
||||
|
||||
cfg::map_entry<s32> g_cfg_net_status(cfg::root.net, "Connection status",
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellOskDialog);
|
||||
logs::channel cellOskDialog("cellOskDialog", logs::level::notice);
|
||||
|
||||
s32 cellOskDialogLoadAsync()
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellOvis);
|
||||
logs::channel cellOvis("cellOvis", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "Emu/Io/PadHandler.h"
|
||||
#include "cellPad.h"
|
||||
|
||||
extern _log::channel sys_io;
|
||||
extern logs::channel sys_io;
|
||||
|
||||
s32 cellPadInit(u32 max_connect)
|
||||
{
|
||||
|
@ -12,12 +12,12 @@ bool squeue_test_exit()
|
||||
return Emu.IsStopped();
|
||||
}
|
||||
|
||||
LOG_CHANNEL(cellPamf);
|
||||
logs::channel cellPamf("cellPamf", logs::level::notice);
|
||||
|
||||
s32 pamfStreamTypeToEsFilterId(u8 type, u8 ch, CellCodecEsFilterId& pEsFilterId)
|
||||
{
|
||||
// convert type and ch to EsFilterId
|
||||
Expects(ch < 16);
|
||||
EXPECTS(ch < 16);
|
||||
pEsFilterId.supplementalInfo1 = type == CELL_PAMF_STREAM_TYPE_AVC;
|
||||
pEsFilterId.supplementalInfo2 = 0;
|
||||
|
||||
@ -117,7 +117,7 @@ s32 pamfStreamTypeToEsFilterId(u8 type, u8 ch, CellCodecEsFilterId& pEsFilterId)
|
||||
u8 pamfGetStreamType(vm::ptr<CellPamfReader> pSelf, u32 stream)
|
||||
{
|
||||
// TODO: get stream type correctly
|
||||
Expects(stream < (u32)pSelf->pAddr->stream_count);
|
||||
EXPECTS(stream < (u32)pSelf->pAddr->stream_count);
|
||||
auto& header = pSelf->pAddr->stream_headers[stream];
|
||||
|
||||
switch (header.type)
|
||||
@ -138,7 +138,7 @@ u8 pamfGetStreamType(vm::ptr<CellPamfReader> pSelf, u32 stream)
|
||||
u8 pamfGetStreamChannel(vm::ptr<CellPamfReader> pSelf, u32 stream)
|
||||
{
|
||||
// TODO: get stream channel correctly
|
||||
Expects(stream < (u32)pSelf->pAddr->stream_count);
|
||||
EXPECTS(stream < (u32)pSelf->pAddr->stream_count);
|
||||
auto& header = pSelf->pAddr->stream_headers[stream];
|
||||
|
||||
switch (header.type)
|
||||
@ -146,29 +146,29 @@ u8 pamfGetStreamChannel(vm::ptr<CellPamfReader> pSelf, u32 stream)
|
||||
case 0x1b: // AVC
|
||||
case 0x02: // M2V
|
||||
{
|
||||
Expects((header.fid_major & 0xf0) == 0xe0 && header.fid_minor == 0);
|
||||
EXPECTS((header.fid_major & 0xf0) == 0xe0 && header.fid_minor == 0);
|
||||
return header.fid_major % 16;
|
||||
}
|
||||
|
||||
case 0xdc: // ATRAC3PLUS
|
||||
{
|
||||
Expects(header.fid_major == 0xbd && (header.fid_minor & 0xf0) == 0);
|
||||
EXPECTS(header.fid_major == 0xbd && (header.fid_minor & 0xf0) == 0);
|
||||
return header.fid_minor % 16;
|
||||
}
|
||||
|
||||
case 0x80: // LPCM
|
||||
{
|
||||
Expects(header.fid_major == 0xbd && (header.fid_minor & 0xf0) == 0x40);
|
||||
EXPECTS(header.fid_major == 0xbd && (header.fid_minor & 0xf0) == 0x40);
|
||||
return header.fid_minor % 16;
|
||||
}
|
||||
case 0x81: // AC3
|
||||
{
|
||||
Expects(header.fid_major == 0xbd && (header.fid_minor & 0xf0) == 0x30);
|
||||
EXPECTS(header.fid_major == 0xbd && (header.fid_minor & 0xf0) == 0x30);
|
||||
return header.fid_minor % 16;
|
||||
}
|
||||
case 0xdd:
|
||||
{
|
||||
Expects(header.fid_major == 0xbd && (header.fid_minor & 0xf0) == 0x20);
|
||||
EXPECTS(header.fid_major == 0xbd && (header.fid_minor & 0xf0) == 0x20);
|
||||
return header.fid_minor % 16;
|
||||
}
|
||||
}
|
||||
@ -454,7 +454,7 @@ s32 cellPamfReaderGetEsFilterId(vm::ptr<CellPamfReader> pSelf, vm::ptr<CellCodec
|
||||
|
||||
// always returns CELL_OK
|
||||
|
||||
Expects((u32)pSelf->stream < (u32)pSelf->pAddr->stream_count);
|
||||
EXPECTS((u32)pSelf->stream < (u32)pSelf->pAddr->stream_count);
|
||||
auto& header = pSelf->pAddr->stream_headers[pSelf->stream];
|
||||
pEsFilterId->filterIdMajor = header.fid_major;
|
||||
pEsFilterId->filterIdMinor = header.fid_minor;
|
||||
@ -467,7 +467,7 @@ s32 cellPamfReaderGetStreamInfo(vm::ptr<CellPamfReader> pSelf, vm::ptr<void> pIn
|
||||
{
|
||||
cellPamf.warning("cellPamfReaderGetStreamInfo(pSelf=*0x%x, pInfo=*0x%x, size=%d)", pSelf, pInfo, size);
|
||||
|
||||
Expects((u32)pSelf->stream < (u32)pSelf->pAddr->stream_count);
|
||||
EXPECTS((u32)pSelf->stream < (u32)pSelf->pAddr->stream_count);
|
||||
auto& header = pSelf->pAddr->stream_headers[pSelf->stream];
|
||||
const u8 type = pamfGetStreamType(pSelf, pSelf->stream);
|
||||
const u8 ch = pamfGetStreamChannel(pSelf, pSelf->stream);
|
||||
|
@ -400,6 +400,8 @@ CHECK_SIZE(CellPamfReader, 128);
|
||||
|
||||
s32 cellPamfReaderInitialize(vm::ptr<CellPamfReader> pSelf, vm::cptr<PamfHeader> pAddr, u64 fileSize, u32 attribute);
|
||||
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
|
||||
extern const std::function<bool()> SQUEUE_ALWAYS_EXIT;
|
||||
extern const std::function<bool()> SQUEUE_NEVER_EXIT;
|
||||
@ -462,8 +464,8 @@ public:
|
||||
|
||||
while (u32 res = m_sync.atomic_op([&pos](squeue_sync_var_t& sync) -> u32
|
||||
{
|
||||
Expects(sync.count <= sq_size);
|
||||
Expects(sync.position < sq_size);
|
||||
EXPECTS(sync.count <= sq_size);
|
||||
EXPECTS(sync.position < sq_size);
|
||||
|
||||
if (sync.push_lock)
|
||||
{
|
||||
@ -492,9 +494,9 @@ public:
|
||||
|
||||
m_sync.atomic_op([](squeue_sync_var_t& sync)
|
||||
{
|
||||
Expects(sync.count <= sq_size);
|
||||
Expects(sync.position < sq_size);
|
||||
Expects(sync.push_lock);
|
||||
EXPECTS(sync.count <= sq_size);
|
||||
EXPECTS(sync.position < sq_size);
|
||||
EXPECTS(sync.push_lock);
|
||||
sync.push_lock = 0;
|
||||
sync.count++;
|
||||
});
|
||||
@ -525,8 +527,8 @@ public:
|
||||
|
||||
while (u32 res = m_sync.atomic_op([&pos](squeue_sync_var_t& sync) -> u32
|
||||
{
|
||||
Expects(sync.count <= sq_size);
|
||||
Expects(sync.position < sq_size);
|
||||
EXPECTS(sync.count <= sq_size);
|
||||
EXPECTS(sync.position < sq_size);
|
||||
|
||||
if (!sync.count)
|
||||
{
|
||||
@ -555,9 +557,9 @@ public:
|
||||
|
||||
m_sync.atomic_op([](squeue_sync_var_t& sync)
|
||||
{
|
||||
Expects(sync.count <= sq_size);
|
||||
Expects(sync.position < sq_size);
|
||||
Expects(sync.pop_lock);
|
||||
EXPECTS(sync.count <= sq_size);
|
||||
EXPECTS(sync.position < sq_size);
|
||||
EXPECTS(sync.pop_lock);
|
||||
sync.pop_lock = 0;
|
||||
sync.position++;
|
||||
sync.count--;
|
||||
@ -589,13 +591,13 @@ public:
|
||||
|
||||
bool peek(T& data, u32 start_pos, const std::function<bool()>& test_exit)
|
||||
{
|
||||
Expects(start_pos < sq_size);
|
||||
EXPECTS(start_pos < sq_size);
|
||||
u32 pos = 0;
|
||||
|
||||
while (u32 res = m_sync.atomic_op([&pos, start_pos](squeue_sync_var_t& sync) -> u32
|
||||
{
|
||||
Expects(sync.count <= sq_size);
|
||||
Expects(sync.position < sq_size);
|
||||
EXPECTS(sync.count <= sq_size);
|
||||
EXPECTS(sync.position < sq_size);
|
||||
|
||||
if (sync.count <= start_pos)
|
||||
{
|
||||
@ -624,9 +626,9 @@ public:
|
||||
|
||||
m_sync.atomic_op([](squeue_sync_var_t& sync)
|
||||
{
|
||||
Expects(sync.count <= sq_size);
|
||||
Expects(sync.position < sq_size);
|
||||
Expects(sync.pop_lock);
|
||||
EXPECTS(sync.count <= sq_size);
|
||||
EXPECTS(sync.position < sq_size);
|
||||
EXPECTS(sync.pop_lock);
|
||||
sync.pop_lock = 0;
|
||||
});
|
||||
|
||||
@ -665,7 +667,7 @@ public:
|
||||
public:
|
||||
T& operator [] (u32 index)
|
||||
{
|
||||
Expects(index < m_count);
|
||||
EXPECTS(index < m_count);
|
||||
index += m_pos;
|
||||
index = index < sq_size ? index : index - sq_size;
|
||||
return m_data[index];
|
||||
@ -678,8 +680,8 @@ public:
|
||||
|
||||
while (m_sync.atomic_op([&pos, &count](squeue_sync_var_t& sync) -> u32
|
||||
{
|
||||
Expects(sync.count <= sq_size);
|
||||
Expects(sync.position < sq_size);
|
||||
EXPECTS(sync.count <= sq_size);
|
||||
EXPECTS(sync.position < sq_size);
|
||||
|
||||
if (sync.pop_lock || sync.push_lock)
|
||||
{
|
||||
@ -701,9 +703,9 @@ public:
|
||||
|
||||
m_sync.atomic_op([](squeue_sync_var_t& sync)
|
||||
{
|
||||
Expects(sync.count <= sq_size);
|
||||
Expects(sync.position < sq_size);
|
||||
Expects(sync.pop_lock && sync.push_lock);
|
||||
EXPECTS(sync.count <= sq_size);
|
||||
EXPECTS(sync.position < sq_size);
|
||||
EXPECTS(sync.pop_lock && sync.push_lock);
|
||||
sync.pop_lock = 0;
|
||||
sync.push_lock = 0;
|
||||
});
|
||||
@ -716,8 +718,8 @@ public:
|
||||
{
|
||||
while (m_sync.atomic_op([](squeue_sync_var_t& sync) -> u32
|
||||
{
|
||||
Expects(sync.count <= sq_size);
|
||||
Expects(sync.position < sq_size);
|
||||
EXPECTS(sync.count <= sq_size);
|
||||
EXPECTS(sync.position < sq_size);
|
||||
|
||||
if (sync.pop_lock || sync.push_lock)
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellPhotoDecode);
|
||||
logs::channel cellPhotoDecode("cellPhotoDecode", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellPhotoExport);
|
||||
logs::channel cellPhotoExport("cellPhotoExport", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellPhotoImportUtil);
|
||||
logs::channel cellPhotoImportUtil("cellPhotoImportUtil", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "png.h"
|
||||
#include "cellPngDec.h"
|
||||
|
||||
LOG_CHANNEL(cellPngDec);
|
||||
logs::channel cellPngDec("cellPngDec", logs::level::notice);
|
||||
|
||||
// cellPngDec aliases to improve readability
|
||||
using PPHandle = vm::pptr<PngHandle>;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellPngEnc);
|
||||
logs::channel cellPngEnc("cellPngEnc", logs::level::notice);
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellPrint);
|
||||
logs::channel cellPrint("cellPrint", logs::level::notice);
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellRec);
|
||||
logs::channel cellRec("cellRec", logs::level::notice);
|
||||
|
||||
s32 cellRecOpen()
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellRemotePlay);
|
||||
logs::channel cellRemotePlay("cellRemotePlay", logs::level::notice);
|
||||
|
||||
s32 cellRemotePlayGetStatus()
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "Emu/RSX/GCM.h"
|
||||
#include "cellResc.h"
|
||||
|
||||
LOG_CHANNEL(cellResc);
|
||||
logs::channel cellResc("cellResc", logs::level::notice);
|
||||
|
||||
s32 cellRescInit(vm::ptr<CellRescInitConfig> initConfig)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "cellRtc.h"
|
||||
|
||||
LOG_CHANNEL(cellRtc);
|
||||
logs::channel cellRtc("cellRtc", logs::level::notice);
|
||||
|
||||
s64 convertToUNIXTime(u16 seconds, u16 minutes, u16 hours, u16 days, s32 years)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "cellRudp.h"
|
||||
|
||||
LOG_CHANNEL(cellRudp);
|
||||
logs::channel cellRudp("cellRudp", logs::level::notice);
|
||||
|
||||
struct rudp_t
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "cellSail.h"
|
||||
#include "cellPamf.h"
|
||||
|
||||
LOG_CHANNEL(cellSail);
|
||||
logs::channel cellSail("cellSail", logs::level::notice);
|
||||
|
||||
void playerBoot(vm::ptr<CellSailPlayer> pSelf, u64 userParam)
|
||||
{
|
||||
@ -818,7 +818,7 @@ s32 cellSailPlayerCreateDescriptor(vm::ptr<CellSailPlayer> pSelf, s32 streamType
|
||||
u32 buffer = vm::alloc(size, vm::main);
|
||||
auto bufPtr = vm::cptr<PamfHeader>::make(buffer);
|
||||
PamfHeader *buf = const_cast<PamfHeader*>(bufPtr.get_ptr());
|
||||
ASSERT(f.read(buf, size) == size);
|
||||
VERIFY(f.read(buf, size) == size);
|
||||
u32 sp_ = vm::alloc(sizeof(CellPamfReader), vm::main);
|
||||
auto sp = vm::ptr<CellPamfReader>::make(sp_);
|
||||
u32 reader = cellPamfReaderInitialize(sp, bufPtr, size, 0);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellSailRec);
|
||||
logs::channel cellSailRec("cellSailRec", logs::level::notice);
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
|
@ -7,7 +7,9 @@
|
||||
#include "Loader/PSF.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
LOG_CHANNEL(cellSaveData);
|
||||
#include <algorithm>
|
||||
|
||||
logs::channel cellSaveData("cellSaveData", logs::level::notice);
|
||||
|
||||
// cellSaveData aliases (only for cellSaveData.cpp)
|
||||
using PSetList = vm::ptr<CellSaveDataSetList>;
|
||||
@ -609,7 +611,7 @@ static never_inline s32 savedata_op(PPUThread& ppu, u32 operation, u32 version,
|
||||
// Write PARAM.SFO
|
||||
if (psf.size())
|
||||
{
|
||||
fs::file(sfo_path, fs::rewrite).write(psf::save_object(psf));
|
||||
psf::save_object(fs::file(sfo_path, fs::rewrite), psf);
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "cellScreenshot.h"
|
||||
|
||||
LOG_CHANNEL(cellScreenshot);
|
||||
logs::channel cellScreenshot("cellScreenshot", logs::level::notice);
|
||||
|
||||
s32 cellScreenShotSetParameter() //const CellScreenShotSetParam *param
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "cellSearch.h"
|
||||
|
||||
LOG_CHANNEL(cellSearch);
|
||||
logs::channel cellSearch("cellSearch", logs::level::notice);
|
||||
|
||||
s32 cellSearchInitialize(CellSearchMode mode, u32 container, vm::ptr<CellSearchSystemCallback> func, vm::ptr<u32> userData)
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellSheap);
|
||||
logs::channel cellSheap("cellSheap", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellSpudll);
|
||||
logs::channel cellSpudll("cellSpudll", logs::level::notice);
|
||||
|
||||
s32 cellSpudllGetImageSize(vm::ptr<u32> psize, vm::cptr<void> so_elf, vm::cptr<struct CellSpudllHandleConfig> config)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "sysPrxForUser.h"
|
||||
#include "cellSpurs.h"
|
||||
|
||||
LOG_CHANNEL(cellSpurs);
|
||||
logs::channel cellSpurs("cellSpurs", logs::level::notice);
|
||||
|
||||
// TODO
|
||||
struct cell_error_t
|
||||
@ -30,6 +30,28 @@ struct cell_error_t
|
||||
|
||||
#define CHECK_SUCCESS(expr) if (cell_error_t error{expr}) throw fmt::exception("Failure: %s -> 0x%x" HERE, #expr, error.value)
|
||||
|
||||
static u32 ppu_thread_create(u32 entry, u64 arg, s32 prio, u32 stacksize, const std::string& name, std::function<void(PPUThread&)> task)
|
||||
{
|
||||
const auto ppu = idm::make_ptr<PPUThread>(name);
|
||||
|
||||
ppu->prio = prio;
|
||||
ppu->stack_size = stacksize;
|
||||
ppu->custom_task = std::move(task);
|
||||
ppu->cpu_init();
|
||||
|
||||
if (entry)
|
||||
{
|
||||
ppu->pc = vm::read32(entry);
|
||||
ppu->GPR[2] = vm::read32(entry + 4); // rtoc
|
||||
}
|
||||
|
||||
ppu->GPR[3] = arg;
|
||||
ppu->state -= cpu_state::stop;
|
||||
(*ppu)->lock_notify();
|
||||
|
||||
return ppu->id;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Function prototypes
|
||||
//----------------------------------------------------------------------------
|
||||
@ -588,7 +610,7 @@ void _spurs::handler_entry(PPUThread& ppu, vm::ptr<CellSpurs> spurs)
|
||||
|
||||
if ((spurs->flags1 & SF1_EXIT_IF_NO_WORK) == 0)
|
||||
{
|
||||
ASSERT(spurs->handlerExiting == 1);
|
||||
VERIFY(spurs->handlerExiting == 1);
|
||||
|
||||
return sys_ppu_thread_exit(ppu, 0);
|
||||
}
|
||||
@ -651,16 +673,16 @@ s32 _spurs::wakeup_shutdown_completion_waiter(PPUThread& ppu, vm::ptr<CellSpurs>
|
||||
{
|
||||
wklF->hook(ppu, spurs, wid, wklF->hookArg);
|
||||
|
||||
ASSERT(wklEvent->load() & 0x01);
|
||||
ASSERT(wklEvent->load() & 0x02);
|
||||
ASSERT((wklEvent->load() & 0x20) == 0);
|
||||
VERIFY(wklEvent->load() & 0x01);
|
||||
VERIFY(wklEvent->load() & 0x02);
|
||||
VERIFY((wklEvent->load() & 0x20) == 0);
|
||||
wklEvent->fetch_or(0x20);
|
||||
}
|
||||
|
||||
s32 rc = CELL_OK;
|
||||
if (!wklF->hook || wklEvent->load() & 0x10)
|
||||
{
|
||||
ASSERT(wklF->x28 == 2);
|
||||
VERIFY(wklF->x28 == 2);
|
||||
rc = sys_semaphore_post((u32)wklF->sem, 1);
|
||||
}
|
||||
|
||||
@ -1027,7 +1049,7 @@ s32 _spurs::initialize(PPUThread& ppu, vm::ptr<CellSpurs> spurs, u32 revision, u
|
||||
|
||||
// Import SPURS kernel
|
||||
spurs->spuImg.type = SYS_SPU_IMAGE_TYPE_USER;
|
||||
spurs->spuImg.segs = { vm::alloc(0x40000, vm::main), vm::addr };
|
||||
spurs->spuImg.segs = vm::cast(vm::alloc(0x40000, vm::main));
|
||||
spurs->spuImg.entry_point = isSecond ? CELL_SPURS_KERNEL2_ENTRY_ADDR : CELL_SPURS_KERNEL1_ENTRY_ADDR;
|
||||
spurs->spuImg.nsegs = 1;
|
||||
|
||||
@ -2117,8 +2139,8 @@ s32 _spurs::add_workload(vm::ptr<CellSpurs> spurs, vm::ptr<u32> wid, vm::cptr<vo
|
||||
u32 index = wnum & 0xf;
|
||||
if (wnum <= 15)
|
||||
{
|
||||
ASSERT((spurs->wklCurrentContention[wnum] & 0xf) == 0);
|
||||
ASSERT((spurs->wklPendingContention[wnum] & 0xf) == 0);
|
||||
VERIFY((spurs->wklCurrentContention[wnum] & 0xf) == 0);
|
||||
VERIFY((spurs->wklPendingContention[wnum] & 0xf) == 0);
|
||||
spurs->wklState1[wnum] = 1;
|
||||
spurs->wklStatus1[wnum] = 0;
|
||||
spurs->wklEvent1[wnum] = 0;
|
||||
@ -2153,8 +2175,8 @@ s32 _spurs::add_workload(vm::ptr<CellSpurs> spurs, vm::ptr<u32> wid, vm::cptr<vo
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT((spurs->wklCurrentContention[index] & 0xf0) == 0);
|
||||
ASSERT((spurs->wklPendingContention[index] & 0xf0) == 0);
|
||||
VERIFY((spurs->wklCurrentContention[index] & 0xf0) == 0);
|
||||
VERIFY((spurs->wklPendingContention[index] & 0xf0) == 0);
|
||||
spurs->wklState2[index] = 1;
|
||||
spurs->wklStatus2[index] = 0;
|
||||
spurs->wklEvent2[index] = 0;
|
||||
@ -2233,7 +2255,7 @@ s32 _spurs::add_workload(vm::ptr<CellSpurs> spurs, vm::ptr<u32> wid, vm::cptr<vo
|
||||
v = mask | (0x80000000u >> wnum);
|
||||
});
|
||||
|
||||
ASSERT(res_wkl <= 31);
|
||||
VERIFY(res_wkl <= 31);
|
||||
spurs->wklState(wnum).exchange(2);
|
||||
spurs->sysSrvMsgUpdateWorkload.exchange(0xff);
|
||||
spurs->sysSrvMessage.exchange(0xff);
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "cellSpurs.h"
|
||||
#include "cellSpursJq.h"
|
||||
|
||||
LOG_CHANNEL(cellSpursJq);
|
||||
logs::channel cellSpursJq("cellSpursJq", logs::level::notice);
|
||||
|
||||
s32 cellSpursJobQueueAttributeInitialize()
|
||||
{
|
||||
|
@ -9,11 +9,15 @@
|
||||
#include "Emu/Cell/lv2/sys_spu.h"
|
||||
#include "cellSpurs.h"
|
||||
|
||||
#include <thread>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Externs
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
extern _log::channel cellSpurs;
|
||||
extern logs::channel cellSpurs;
|
||||
|
||||
extern std::mutex& get_current_thread_mutex();
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Function prototypes
|
||||
@ -685,7 +689,7 @@ bool spursKernelEntry(SPUThread& spu)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
std::this_thread::sleep_for(100ms);
|
||||
CHECK_EMU_STATUS;
|
||||
}
|
||||
|
||||
@ -861,7 +865,7 @@ void spursSysServiceIdleHandler(SPUThread& spu, SpursKernelContext* ctxt)
|
||||
// The system service blocks by making a reservation and waiting on the lock line reservation lost event.
|
||||
CHECK_EMU_STATUS;
|
||||
if (!lock) lock.lock();
|
||||
get_current_thread_cv().wait_for(lock, std::chrono::milliseconds(1));
|
||||
get_current_thread_cv().wait_for(lock, 1ms);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellSsl);
|
||||
logs::channel cellSsl("cellSsl", logs::level::notice);
|
||||
|
||||
s32 cellSslInit()
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
extern _log::channel cellSysutil;
|
||||
extern logs::channel cellSysutil;
|
||||
|
||||
s32 cellStorageDataImportMove()
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "cellSubdisplay.h"
|
||||
|
||||
LOG_CHANNEL(cellSubdisplay);
|
||||
logs::channel cellSubdisplay("cellSubdisplay", logs::level::notice);
|
||||
|
||||
s32 cellSubDisplayInit()
|
||||
{
|
||||
|
@ -8,7 +8,9 @@
|
||||
|
||||
#include "Emu/Memory/wait_engine.h"
|
||||
|
||||
LOG_CHANNEL(cellSync);
|
||||
#include <thread>
|
||||
|
||||
logs::channel cellSync("cellSync", logs::level::notice);
|
||||
|
||||
namespace _sync
|
||||
{
|
||||
@ -32,12 +34,12 @@ ppu_error_code cellSyncMutexInitialize(vm::ptr<CellSyncMutex> mutex)
|
||||
{
|
||||
cellSync.trace("cellSyncMutexInitialize(mutex=*0x%x)", mutex);
|
||||
|
||||
if (!mutex)
|
||||
if (UNLIKELY(!mutex))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!mutex.aligned())
|
||||
if (UNLIKELY(!mutex.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -51,12 +53,12 @@ ppu_error_code cellSyncMutexLock(vm::ptr<CellSyncMutex> mutex)
|
||||
{
|
||||
cellSync.trace("cellSyncMutexLock(mutex=*0x%x)", mutex);
|
||||
|
||||
if (!mutex)
|
||||
if (UNLIKELY(!mutex))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!mutex.aligned())
|
||||
if (UNLIKELY(!mutex.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -76,12 +78,12 @@ ppu_error_code cellSyncMutexTryLock(vm::ptr<CellSyncMutex> mutex)
|
||||
{
|
||||
cellSync.trace("cellSyncMutexTryLock(mutex=*0x%x)", mutex);
|
||||
|
||||
if (!mutex)
|
||||
if (UNLIKELY(!mutex))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!mutex.aligned())
|
||||
if (UNLIKELY(!mutex.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -98,12 +100,12 @@ ppu_error_code cellSyncMutexUnlock(vm::ptr<CellSyncMutex> mutex)
|
||||
{
|
||||
cellSync.trace("cellSyncMutexUnlock(mutex=*0x%x)", mutex);
|
||||
|
||||
if (!mutex)
|
||||
if (UNLIKELY(!mutex))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!mutex.aligned())
|
||||
if (UNLIKELY(!mutex.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -119,17 +121,17 @@ ppu_error_code cellSyncBarrierInitialize(vm::ptr<CellSyncBarrier> barrier, u16 t
|
||||
{
|
||||
cellSync.trace("cellSyncBarrierInitialize(barrier=*0x%x, total_count=%d)", barrier, total_count);
|
||||
|
||||
if (!barrier)
|
||||
if (UNLIKELY(!barrier))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!barrier.aligned())
|
||||
if (UNLIKELY(!barrier.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!total_count || total_count > 32767)
|
||||
if (UNLIKELY(!total_count || total_count > 32767))
|
||||
{
|
||||
return CELL_SYNC_ERROR_INVAL;
|
||||
}
|
||||
@ -144,12 +146,12 @@ ppu_error_code cellSyncBarrierNotify(vm::ptr<CellSyncBarrier> barrier)
|
||||
{
|
||||
cellSync.trace("cellSyncBarrierNotify(barrier=*0x%x)", barrier);
|
||||
|
||||
if (!barrier)
|
||||
if (UNLIKELY(!barrier))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!barrier.aligned())
|
||||
if (UNLIKELY(!barrier.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -165,12 +167,12 @@ ppu_error_code cellSyncBarrierTryNotify(vm::ptr<CellSyncBarrier> barrier)
|
||||
{
|
||||
cellSync.trace("cellSyncBarrierTryNotify(barrier=*0x%x)", barrier);
|
||||
|
||||
if (!barrier)
|
||||
if (UNLIKELY(!barrier))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!barrier.aligned())
|
||||
if (UNLIKELY(!barrier.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -191,12 +193,12 @@ ppu_error_code cellSyncBarrierWait(vm::ptr<CellSyncBarrier> barrier)
|
||||
{
|
||||
cellSync.trace("cellSyncBarrierWait(barrier=*0x%x)", barrier);
|
||||
|
||||
if (!barrier)
|
||||
if (UNLIKELY(!barrier))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!barrier.aligned())
|
||||
if (UNLIKELY(!barrier.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -214,12 +216,12 @@ ppu_error_code cellSyncBarrierTryWait(vm::ptr<CellSyncBarrier> barrier)
|
||||
{
|
||||
cellSync.trace("cellSyncBarrierTryWait(barrier=*0x%x)", barrier);
|
||||
|
||||
if (!barrier)
|
||||
if (UNLIKELY(!barrier))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!barrier.aligned())
|
||||
if (UNLIKELY(!barrier.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -240,17 +242,17 @@ ppu_error_code cellSyncRwmInitialize(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buf
|
||||
{
|
||||
cellSync.trace("cellSyncRwmInitialize(rwm=*0x%x, buffer=*0x%x, buffer_size=0x%x)", rwm, buffer, buffer_size);
|
||||
|
||||
if (!rwm || !buffer)
|
||||
if (UNLIKELY(!rwm || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!rwm.aligned() || buffer % 128)
|
||||
if (UNLIKELY(!rwm.aligned() || buffer % 128))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (buffer_size % 128 || buffer_size > 0x4000)
|
||||
if (UNLIKELY(buffer_size % 128 || buffer_size > 0x4000))
|
||||
{
|
||||
return CELL_SYNC_ERROR_INVAL;
|
||||
}
|
||||
@ -269,12 +271,12 @@ ppu_error_code cellSyncRwmRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer)
|
||||
{
|
||||
cellSync.trace("cellSyncRwmRead(rwm=*0x%x, buffer=*0x%x)", rwm, buffer);
|
||||
|
||||
if (!rwm || !buffer)
|
||||
if (UNLIKELY(!rwm || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!rwm.aligned())
|
||||
if (UNLIKELY(!rwm.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -300,12 +302,12 @@ ppu_error_code cellSyncRwmTryRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer
|
||||
{
|
||||
cellSync.trace("cellSyncRwmTryRead(rwm=*0x%x, buffer=*0x%x)", rwm, buffer);
|
||||
|
||||
if (!rwm || !buffer)
|
||||
if (UNLIKELY(!rwm || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!rwm.aligned())
|
||||
if (UNLIKELY(!rwm.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -334,12 +336,12 @@ ppu_error_code cellSyncRwmWrite(vm::ptr<CellSyncRwm> rwm, vm::cptr<void> buffer)
|
||||
{
|
||||
cellSync.trace("cellSyncRwmWrite(rwm=*0x%x, buffer=*0x%x)", rwm, buffer);
|
||||
|
||||
if (!rwm || !buffer)
|
||||
if (UNLIKELY(!rwm || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!rwm.aligned())
|
||||
if (UNLIKELY(!rwm.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -365,12 +367,12 @@ ppu_error_code cellSyncRwmTryWrite(vm::ptr<CellSyncRwm> rwm, vm::cptr<void> buff
|
||||
{
|
||||
cellSync.trace("cellSyncRwmTryWrite(rwm=*0x%x, buffer=*0x%x)", rwm, buffer);
|
||||
|
||||
if (!rwm || !buffer)
|
||||
if (UNLIKELY(!rwm || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!rwm.aligned())
|
||||
if (UNLIKELY(!rwm.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -396,22 +398,22 @@ ppu_error_code cellSyncQueueInitialize(vm::ptr<CellSyncQueue> queue, vm::ptr<u8>
|
||||
{
|
||||
cellSync.trace("cellSyncQueueInitialize(queue=*0x%x, buffer=*0x%x, size=0x%x, depth=0x%x)", queue, buffer, size, depth);
|
||||
|
||||
if (!queue)
|
||||
if (UNLIKELY(!queue))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (size && !buffer)
|
||||
if (UNLIKELY(size && !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned() || buffer % 16)
|
||||
if (UNLIKELY(!queue.aligned() || buffer % 16))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (!depth || size % 16)
|
||||
if (UNLIKELY(!depth || size % 16))
|
||||
{
|
||||
return CELL_SYNC_ERROR_INVAL;
|
||||
}
|
||||
@ -431,12 +433,12 @@ ppu_error_code cellSyncQueuePush(vm::ptr<CellSyncQueue> queue, vm::cptr<void> bu
|
||||
{
|
||||
cellSync.trace("cellSyncQueuePush(queue=*0x%x, buffer=*0x%x)", queue, buffer);
|
||||
|
||||
if (!queue || !buffer)
|
||||
if (UNLIKELY(!queue || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -462,12 +464,12 @@ ppu_error_code cellSyncQueueTryPush(vm::ptr<CellSyncQueue> queue, vm::cptr<void>
|
||||
{
|
||||
cellSync.trace("cellSyncQueueTryPush(queue=*0x%x, buffer=*0x%x)", queue, buffer);
|
||||
|
||||
if (!queue || !buffer)
|
||||
if (UNLIKELY(!queue || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -496,12 +498,12 @@ ppu_error_code cellSyncQueuePop(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buff
|
||||
{
|
||||
cellSync.trace("cellSyncQueuePop(queue=*0x%x, buffer=*0x%x)", queue, buffer);
|
||||
|
||||
if (!queue || !buffer)
|
||||
if (UNLIKELY(!queue || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -527,12 +529,12 @@ ppu_error_code cellSyncQueueTryPop(vm::ptr<CellSyncQueue> queue, vm::ptr<void> b
|
||||
{
|
||||
cellSync.trace("cellSyncQueueTryPop(queue=*0x%x, buffer=*0x%x)", queue, buffer);
|
||||
|
||||
if (!queue || !buffer)
|
||||
if (UNLIKELY(!queue || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -561,12 +563,12 @@ ppu_error_code cellSyncQueuePeek(vm::ptr<CellSyncQueue> queue, vm::ptr<void> buf
|
||||
{
|
||||
cellSync.trace("cellSyncQueuePeek(queue=*0x%x, buffer=*0x%x)", queue, buffer);
|
||||
|
||||
if (!queue || !buffer)
|
||||
if (UNLIKELY(!queue || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -592,12 +594,12 @@ ppu_error_code cellSyncQueueTryPeek(vm::ptr<CellSyncQueue> queue, vm::ptr<void>
|
||||
{
|
||||
cellSync.trace("cellSyncQueueTryPeek(queue=*0x%x, buffer=*0x%x)", queue, buffer);
|
||||
|
||||
if (!queue || !buffer)
|
||||
if (UNLIKELY(!queue || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -626,12 +628,12 @@ ppu_error_code cellSyncQueueSize(vm::ptr<CellSyncQueue> queue)
|
||||
{
|
||||
cellSync.trace("cellSyncQueueSize(queue=*0x%x)", queue);
|
||||
|
||||
if (!queue)
|
||||
if (UNLIKELY(!queue))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -645,12 +647,12 @@ ppu_error_code cellSyncQueueClear(vm::ptr<CellSyncQueue> queue)
|
||||
{
|
||||
cellSync.trace("cellSyncQueueClear(queue=*0x%x)", queue);
|
||||
|
||||
if (!queue)
|
||||
if (UNLIKELY(!queue))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -713,30 +715,30 @@ ppu_error_code cellSyncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cpt
|
||||
{
|
||||
cellSync.warning("cellSyncLFQueueInitialize(queue=*0x%x, buffer=*0x%x, size=0x%x, depth=0x%x, direction=%d, eaSignal=*0x%x)", queue, buffer, size, depth, direction, eaSignal);
|
||||
|
||||
if (!queue)
|
||||
if (UNLIKELY(!queue))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (size)
|
||||
{
|
||||
if (!buffer)
|
||||
if (UNLIKELY(!buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (size > 0x4000 || size % 16)
|
||||
if (UNLIKELY(size > 0x4000 || size % 16))
|
||||
{
|
||||
return CELL_SYNC_ERROR_INVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!depth || depth > 0x7fff || direction > 3)
|
||||
if (UNLIKELY(!depth || depth > 0x7fff || direction > 3))
|
||||
{
|
||||
return CELL_SYNC_ERROR_INVAL;
|
||||
}
|
||||
|
||||
if (!queue.aligned() || buffer % 16)
|
||||
if (UNLIKELY(!queue.aligned() || buffer % 16))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -764,7 +766,7 @@ ppu_error_code cellSyncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cpt
|
||||
|
||||
if (old)
|
||||
{
|
||||
if (sdk_ver > 0x17ffff && old != 2)
|
||||
if (UNLIKELY(sdk_ver > 0x17ffff && old != 2))
|
||||
{
|
||||
return CELL_SYNC_ERROR_STAT;
|
||||
}
|
||||
@ -777,7 +779,7 @@ ppu_error_code cellSyncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cpt
|
||||
{
|
||||
for (const auto& data : vm::_ref<u64[16]>(queue.addr()))
|
||||
{
|
||||
if (data)
|
||||
if (UNLIKELY(data))
|
||||
{
|
||||
return CELL_SYNC_ERROR_STAT;
|
||||
}
|
||||
@ -793,14 +795,14 @@ ppu_error_code cellSyncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::cpt
|
||||
|
||||
if (old_value == 2)
|
||||
{
|
||||
if (queue->m_size != size || queue->m_depth != depth || queue->m_buffer != buffer)
|
||||
if (UNLIKELY(queue->m_size != size || queue->m_depth != depth || queue->m_buffer != buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_INVAL;
|
||||
}
|
||||
|
||||
if (sdk_ver > 0x17ffff)
|
||||
{
|
||||
if (queue->m_eaSignal != eaSignal || queue->m_direction != direction)
|
||||
if (UNLIKELY(queue->m_eaSignal != eaSignal || queue->m_direction != direction))
|
||||
{
|
||||
return CELL_SYNC_ERROR_INVAL;
|
||||
}
|
||||
@ -822,7 +824,7 @@ ppu_error_code _cellSyncLFQueueGetPushPointer(PPUThread& ppu, vm::ptr<CellSyncLF
|
||||
{
|
||||
cellSync.warning("_cellSyncLFQueueGetPushPointer(queue=*0x%x, pointer=*0x%x, isBlocking=%d, useEventQueue=%d)", queue, pointer, isBlocking, useEventQueue);
|
||||
|
||||
if (queue->m_direction != CELL_SYNC_QUEUE_PPU2SPU)
|
||||
if (UNLIKELY(queue->m_direction != CELL_SYNC_QUEUE_PPU2SPU))
|
||||
{
|
||||
return CELL_SYNC_ERROR_PERM;
|
||||
}
|
||||
@ -906,7 +908,7 @@ ppu_error_code _cellSyncLFQueueGetPushPointer(PPUThread& ppu, vm::ptr<CellSyncLF
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(sys_event_queue_receive(ppu, queue->m_eq_id, vm::null, 0) == CELL_OK);
|
||||
VERIFY(sys_event_queue_receive(ppu, queue->m_eq_id, vm::null, 0) == CELL_OK);
|
||||
var1 = 1;
|
||||
}
|
||||
}
|
||||
@ -923,7 +925,7 @@ ppu_error_code _cellSyncLFQueueCompletePushPointer(PPUThread& ppu, vm::ptr<CellS
|
||||
{
|
||||
cellSync.warning("_cellSyncLFQueueCompletePushPointer(queue=*0x%x, pointer=%d, fpSendSignal=*0x%x)", queue, pointer, fpSendSignal);
|
||||
|
||||
if (queue->m_direction != CELL_SYNC_QUEUE_PPU2SPU)
|
||||
if (UNLIKELY(queue->m_direction != CELL_SYNC_QUEUE_PPU2SPU))
|
||||
{
|
||||
return CELL_SYNC_ERROR_PERM;
|
||||
}
|
||||
@ -997,7 +999,7 @@ ppu_error_code _cellSyncLFQueueCompletePushPointer(PPUThread& ppu, vm::ptr<CellS
|
||||
|
||||
if (var9 > 1 && (u32)var8 > 1)
|
||||
{
|
||||
ASSERT(16 - var2 <= 1);
|
||||
VERIFY(16 - var2 <= 1);
|
||||
}
|
||||
|
||||
s32 var11 = (pack >> 10) & 0x1f;
|
||||
@ -1029,11 +1031,11 @@ ppu_error_code _cellSyncLFQueueCompletePushPointer(PPUThread& ppu, vm::ptr<CellS
|
||||
|
||||
if (queue->push2.compare_and_swap_test(old, push2))
|
||||
{
|
||||
ASSERT(var2 + var4 < 16);
|
||||
VERIFY(var2 + var4 < 16);
|
||||
if (var6 != -1)
|
||||
{
|
||||
ASSERT(queue->push3.compare_and_swap_test(old2, push3));
|
||||
ASSERT(fpSendSignal);
|
||||
VERIFY(queue->push3.compare_and_swap_test(old2, push3));
|
||||
VERIFY(fpSendSignal);
|
||||
return NOT_AN_ERROR(fpSendSignal(ppu, (u32)queue->m_eaSignal.addr(), var6));
|
||||
}
|
||||
else
|
||||
@ -1064,12 +1066,12 @@ ppu_error_code _cellSyncLFQueuePushBody(PPUThread& ppu, vm::ptr<CellSyncLFQueue>
|
||||
// cellSyncLFQueuePush has 1 in isBlocking param, cellSyncLFQueueTryPush has 0
|
||||
cellSync.warning("_cellSyncLFQueuePushBody(queue=*0x%x, buffer=*0x%x, isBlocking=%d)", queue, buffer, isBlocking);
|
||||
|
||||
if (!queue || !buffer)
|
||||
if (UNLIKELY(!queue || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned() || buffer % 16)
|
||||
if (UNLIKELY(!queue.aligned() || buffer % 16))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -1098,7 +1100,7 @@ ppu_error_code _cellSyncLFQueuePushBody(PPUThread& ppu, vm::ptr<CellSyncLFQueue>
|
||||
break;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
}
|
||||
|
||||
const s32 depth = queue->m_depth;
|
||||
@ -1121,7 +1123,7 @@ ppu_error_code _cellSyncLFQueueGetPopPointer(PPUThread& ppu, vm::ptr<CellSyncLFQ
|
||||
{
|
||||
cellSync.warning("_cellSyncLFQueueGetPopPointer(queue=*0x%x, pointer=*0x%x, isBlocking=%d, arg4=%d, useEventQueue=%d)", queue, pointer, isBlocking, arg4, useEventQueue);
|
||||
|
||||
if (queue->m_direction != CELL_SYNC_QUEUE_SPU2PPU)
|
||||
if (UNLIKELY(queue->m_direction != CELL_SYNC_QUEUE_SPU2PPU))
|
||||
{
|
||||
return CELL_SYNC_ERROR_PERM;
|
||||
}
|
||||
@ -1205,7 +1207,7 @@ ppu_error_code _cellSyncLFQueueGetPopPointer(PPUThread& ppu, vm::ptr<CellSyncLFQ
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(sys_event_queue_receive(ppu, queue->m_eq_id, vm::null, 0) == CELL_OK);
|
||||
VERIFY(sys_event_queue_receive(ppu, queue->m_eq_id, vm::null, 0) == CELL_OK);
|
||||
var1 = 1;
|
||||
}
|
||||
}
|
||||
@ -1223,7 +1225,7 @@ ppu_error_code _cellSyncLFQueueCompletePopPointer(PPUThread& ppu, vm::ptr<CellSy
|
||||
// arguments copied from _cellSyncLFQueueCompletePushPointer + unknown argument (noQueueFull taken from LFQueue2CompletePopPointer)
|
||||
cellSync.warning("_cellSyncLFQueueCompletePopPointer(queue=*0x%x, pointer=%d, fpSendSignal=*0x%x, noQueueFull=%d)", queue, pointer, fpSendSignal, noQueueFull);
|
||||
|
||||
if (queue->m_direction != CELL_SYNC_QUEUE_SPU2PPU)
|
||||
if (UNLIKELY(queue->m_direction != CELL_SYNC_QUEUE_SPU2PPU))
|
||||
{
|
||||
return CELL_SYNC_ERROR_PERM;
|
||||
}
|
||||
@ -1301,7 +1303,7 @@ ppu_error_code _cellSyncLFQueueCompletePopPointer(PPUThread& ppu, vm::ptr<CellSy
|
||||
|
||||
if (var9 > 1 && (u32)var8 > 1)
|
||||
{
|
||||
ASSERT(16 - var2 <= 1);
|
||||
VERIFY(16 - var2 <= 1);
|
||||
}
|
||||
|
||||
s32 var11 = (pack >> 10) & 0x1f;
|
||||
@ -1331,8 +1333,8 @@ ppu_error_code _cellSyncLFQueueCompletePopPointer(PPUThread& ppu, vm::ptr<CellSy
|
||||
{
|
||||
if (var6 != -1)
|
||||
{
|
||||
ASSERT(queue->pop3.compare_and_swap_test(old2, pop3));
|
||||
ASSERT(fpSendSignal);
|
||||
VERIFY(queue->pop3.compare_and_swap_test(old2, pop3));
|
||||
VERIFY(fpSendSignal);
|
||||
return NOT_AN_ERROR(fpSendSignal(ppu, (u32)queue->m_eaSignal.addr(), var6));
|
||||
}
|
||||
else
|
||||
@ -1363,12 +1365,12 @@ ppu_error_code _cellSyncLFQueuePopBody(PPUThread& ppu, vm::ptr<CellSyncLFQueue>
|
||||
// cellSyncLFQueuePop has 1 in isBlocking param, cellSyncLFQueueTryPop has 0
|
||||
cellSync.warning("_cellSyncLFQueuePopBody(queue=*0x%x, buffer=*0x%x, isBlocking=%d)", queue, buffer, isBlocking);
|
||||
|
||||
if (!queue || !buffer)
|
||||
if (UNLIKELY(!queue || !buffer))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned() || buffer % 16)
|
||||
if (UNLIKELY(!queue.aligned() || buffer % 16))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -1397,7 +1399,7 @@ ppu_error_code _cellSyncLFQueuePopBody(PPUThread& ppu, vm::ptr<CellSyncLFQueue>
|
||||
break;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
}
|
||||
|
||||
const s32 depth = queue->m_depth;
|
||||
@ -1420,12 +1422,12 @@ ppu_error_code cellSyncLFQueueClear(vm::ptr<CellSyncLFQueue> queue)
|
||||
{
|
||||
cellSync.warning("cellSyncLFQueueClear(queue=*0x%x)", queue);
|
||||
|
||||
if (!queue)
|
||||
if (UNLIKELY(!queue))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -1471,12 +1473,12 @@ ppu_error_code cellSyncLFQueueSize(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u32>
|
||||
{
|
||||
cellSync.warning("cellSyncLFQueueSize(queue=*0x%x, size=*0x%x)", queue, size);
|
||||
|
||||
if (!queue || !size)
|
||||
if (UNLIKELY(!queue || !size))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -1508,12 +1510,12 @@ ppu_error_code cellSyncLFQueueDepth(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u32>
|
||||
{
|
||||
cellSync.trace("cellSyncLFQueueDepth(queue=*0x%x, depth=*0x%x)", queue, depth);
|
||||
|
||||
if (!queue || !depth)
|
||||
if (UNLIKELY(!queue || !depth))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -1527,12 +1529,12 @@ ppu_error_code _cellSyncLFQueueGetSignalAddress(vm::cptr<CellSyncLFQueue> queue,
|
||||
{
|
||||
cellSync.trace("_cellSyncLFQueueGetSignalAddress(queue=*0x%x, ppSignal=**0x%x)", queue, ppSignal);
|
||||
|
||||
if (!queue || !ppSignal)
|
||||
if (UNLIKELY(!queue || !ppSignal))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -1546,12 +1548,12 @@ ppu_error_code cellSyncLFQueueGetDirection(vm::cptr<CellSyncLFQueue> queue, vm::
|
||||
{
|
||||
cellSync.trace("cellSyncLFQueueGetDirection(queue=*0x%x, direction=*0x%x)", queue, direction);
|
||||
|
||||
if (!queue || !direction)
|
||||
if (UNLIKELY(!queue || !direction))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
@ -1565,12 +1567,12 @@ ppu_error_code cellSyncLFQueueGetEntrySize(vm::cptr<CellSyncLFQueue> queue, vm::
|
||||
{
|
||||
cellSync.trace("cellSyncLFQueueGetEntrySize(queue=*0x%x, entry_size=*0x%x)", queue, entry_size);
|
||||
|
||||
if (!queue || !entry_size)
|
||||
if (UNLIKELY(!queue || !entry_size))
|
||||
{
|
||||
return CELL_SYNC_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
if (!queue.aligned())
|
||||
if (UNLIKELY(!queue.aligned()))
|
||||
{
|
||||
return CELL_SYNC_ERROR_ALIGN;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
LOG_CHANNEL(cellSync2);
|
||||
logs::channel cellSync2("cellSync2", logs::level::notice);
|
||||
|
||||
vm::gvar<CellSync2CallerThreadType> gCellSync2CallerThreadTypePpuThread;
|
||||
vm::gvar<CellSync2Notifier> gCellSync2NotifierPpuThread;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellSysconf);
|
||||
logs::channel cellSysconf("cellSysconf", logs::level::notice);
|
||||
|
||||
s32 cellSysconfAbort()
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellSysmodule);
|
||||
logs::channel cellSysmodule("cellSysmodule", logs::level::notice);
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "Utilities/Config.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
@ -7,7 +8,7 @@
|
||||
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
LOG_CHANNEL(cellSysutil);
|
||||
logs::channel cellSysutil("cellSysutil", logs::level::notice);
|
||||
|
||||
// Temporarily
|
||||
using sys_callbacks_t = std::array<std::pair<vm::ptr<CellSysutilCallback>, vm::ptr<void>>, 4>;
|
||||
@ -53,43 +54,47 @@ cfg::map_entry<s32> g_cfg_sys_language(cfg::root.sys, "Language",
|
||||
{ "English (UK)", CELL_SYSUTIL_LANG_ENGLISH_GB },
|
||||
});
|
||||
|
||||
static const char* get_systemparam_id_name(s32 id)
|
||||
{
|
||||
static thread_local char tls_id_name[16]; // for test
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_LANG: return "ID_LANG";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN: return "ID_ENTER_BUTTON_ASSIGN";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_DATE_FORMAT: return "ID_DATE_FORMAT";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_TIME_FORMAT: return "ID_TIME_FORMAT";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE: return "ID_TIMEZONE";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_SUMMERTIME: return "ID_SUMMERTIME";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL: return "ID_GAME_PARENTAL_LEVEL";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL0_RESTRICT: return "ID_GAME_PARENTAL_LEVEL0_RESTRICT";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USER_HAS_NP_ACCOUNT: return "ID_CURRENT_USER_HAS_NP_ACCOUNT";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CAMERA_PLFREQ: return "ID_CAMERA_PLFREQ";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_RUMBLE: return "ID_PAD_RUMBLE";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_KEYBOARD_TYPE: return "ID_KEYBOARD_TYPE";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_JAPANESE_KEYBOARD_ENTRY_METHOD: return "ID_JAPANESE_KEYBOARD_ENTRY_METHOD";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CHINESE_KEYBOARD_ENTRY_METHOD: return "ID_CHINESE_KEYBOARD_ENTRY_METHOD";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_AUTOOFF: return "ID_PAD_AUTOOFF";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME: return "ID_NICKNAME";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USERNAME: return "ID_CURRENT_USERNAME";
|
||||
}
|
||||
|
||||
std::snprintf(tls_id_name, sizeof(tls_id_name), "0x%04X", id);
|
||||
return tls_id_name;
|
||||
}
|
||||
|
||||
enum class systemparam_id_name : s32 {};
|
||||
|
||||
template<>
|
||||
struct unveil<systemparam_id_name, void>
|
||||
{
|
||||
static inline const char* get(systemparam_id_name arg)
|
||||
struct temp
|
||||
{
|
||||
return get_systemparam_id_name((s32)arg);
|
||||
s32 value;
|
||||
char buf[12];
|
||||
|
||||
temp(systemparam_id_name value)
|
||||
: value(s32(value))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static inline const char* get(temp&& in)
|
||||
{
|
||||
switch (in.value)
|
||||
{
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_LANG: return "ID_LANG";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN: return "ID_ENTER_BUTTON_ASSIGN";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_DATE_FORMAT: return "ID_DATE_FORMAT";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_TIME_FORMAT: return "ID_TIME_FORMAT";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE: return "ID_TIMEZONE";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_SUMMERTIME: return "ID_SUMMERTIME";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL: return "ID_GAME_PARENTAL_LEVEL";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL0_RESTRICT: return "ID_GAME_PARENTAL_LEVEL0_RESTRICT";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USER_HAS_NP_ACCOUNT: return "ID_CURRENT_USER_HAS_NP_ACCOUNT";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CAMERA_PLFREQ: return "ID_CAMERA_PLFREQ";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_RUMBLE: return "ID_PAD_RUMBLE";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_KEYBOARD_TYPE: return "ID_KEYBOARD_TYPE";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_JAPANESE_KEYBOARD_ENTRY_METHOD: return "ID_JAPANESE_KEYBOARD_ENTRY_METHOD";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CHINESE_KEYBOARD_ENTRY_METHOD: return "ID_CHINESE_KEYBOARD_ENTRY_METHOD";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_AUTOOFF: return "ID_PAD_AUTOOFF";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME: return "ID_NICKNAME";
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USERNAME: return "ID_CURRENT_USERNAME";
|
||||
}
|
||||
|
||||
std::snprintf(in.buf, sizeof(in.buf), "!0x%04X", in.value);
|
||||
return in.buf;
|
||||
}
|
||||
};
|
||||
|
||||
@ -170,7 +175,7 @@ s32 cellSysutilGetSystemParamInt(s32 id, vm::ptr<s32> value)
|
||||
|
||||
s32 cellSysutilGetSystemParamString(s32 id, vm::ptr<char> buf, u32 bufsize)
|
||||
{
|
||||
cellSysutil.trace("cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, get_systemparam_id_name(id), buf, bufsize);
|
||||
cellSysutil.trace("cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, systemparam_id_name(id), buf, bufsize);
|
||||
|
||||
memset(buf.get_ptr(), 0, bufsize);
|
||||
|
||||
@ -255,7 +260,7 @@ s32 cellSysCacheMount(vm::ptr<CellSysCacheParam> param)
|
||||
cellSysutil.warning("cellSysCacheMount(param=*0x%x)", param);
|
||||
|
||||
const std::string& cache_id = param->cacheId;
|
||||
ASSERT(cache_id.size() < sizeof(param->cacheId));
|
||||
VERIFY(cache_id.size() < sizeof(param->cacheId));
|
||||
|
||||
const std::string& cache_path = "/dev_hdd1/cache/" + cache_id + '/';
|
||||
strcpy_trunc(param->getCachePath, cache_path);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellSysutilAp);
|
||||
logs::channel cellSysutilAp("cellSysutilAp", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellSysutilAvc);
|
||||
logs::channel cellSysutilAvc("cellSysutilAvc", logs::level::notice);
|
||||
|
||||
s32 cellSysutilAvcByeRequest()
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "sceNp2.h"
|
||||
#include "cellSysutilAvc2.h"
|
||||
|
||||
LOG_CHANNEL(cellSysutilAvc2);
|
||||
logs::channel cellSysutilAvc2("cellSysutilAvc2", logs::level::notice);
|
||||
|
||||
s32 cellSysutilAvc2GetPlayerInfo()
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellSysutilMisc);
|
||||
logs::channel cellSysutilMisc("cellSysutilMisc", logs::level::notice);
|
||||
|
||||
// License areas
|
||||
enum
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "cellUsbd.h"
|
||||
|
||||
LOG_CHANNEL(cellUsbd);
|
||||
logs::channel cellUsbd("cellUsbd", logs::level::notice);
|
||||
|
||||
s32 cellUsbdInit()
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellUsbPspcm);
|
||||
logs::channel cellUsbPspcm("cellUsbPspcm", logs::level::notice);
|
||||
|
||||
// Return Codes
|
||||
enum
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
LOG_CHANNEL(cellUserInfo);
|
||||
logs::channel cellUserInfo("cellUserInfo", logs::level::notice);
|
||||
|
||||
s32 cellUserInfoGetStat(u32 id, vm::ptr<CellUserInfoUserStat> stat)
|
||||
{
|
||||
|
@ -16,7 +16,9 @@ extern "C"
|
||||
#include "cellPamf.h"
|
||||
#include "cellVdec.h"
|
||||
|
||||
LOG_CHANNEL(cellVdec);
|
||||
#include <thread>
|
||||
|
||||
logs::channel cellVdec("cellVdec", logs::level::notice);
|
||||
|
||||
vm::gvar<s32> _cell_vdec_prx_ver; // ???
|
||||
|
||||
@ -541,7 +543,7 @@ void vdecOpen(u32 vdec_id) // TODO: call from the constructor
|
||||
|
||||
vdec.vdecCb->cpu_init();
|
||||
vdec.vdecCb->state -= cpu_state::stop;
|
||||
vdec.vdecCb->lock_notify();
|
||||
(*vdec.vdecCb)->lock_notify();
|
||||
}
|
||||
|
||||
s32 cellVdecQueryAttr(vm::cptr<CellVdecType> type, vm::ptr<CellVdecAttr> attr)
|
||||
@ -594,7 +596,7 @@ s32 cellVdecClose(u32 handle)
|
||||
{
|
||||
CHECK_EMU_STATUS;
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
}
|
||||
|
||||
idm::remove<PPUThread>(vdec->vdecCb->id);
|
||||
@ -676,7 +678,7 @@ s32 cellVdecGetPicture(u32 handle, vm::cptr<CellVdecPicFormat> format, vm::ptr<u
|
||||
VdecFrame vf;
|
||||
if (!vdec->frames.try_pop(vf))
|
||||
{
|
||||
//std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
//std::this_thread::sleep_for(1ms); // hack
|
||||
return CELL_VDEC_ERROR_EMPTY;
|
||||
}
|
||||
|
||||
@ -800,13 +802,13 @@ s32 cellVdecGetPicItem(u32 handle, vm::pptr<CellVdecPicItem> picItem)
|
||||
VdecFrame vf;
|
||||
if (!vdec->frames.try_peek(vf))
|
||||
{
|
||||
//std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
//std::this_thread::sleep_for(1ms); // hack
|
||||
return CELL_VDEC_ERROR_EMPTY;
|
||||
}
|
||||
|
||||
AVFrame& frame = *vf.data;
|
||||
|
||||
const vm::ptr<CellVdecPicItem> info{ vdec->memAddr + vdec->memBias, vm::addr };
|
||||
const vm::ptr<CellVdecPicItem> info = vm::cast(vdec->memAddr + vdec->memBias);
|
||||
|
||||
vdec->memBias += 512;
|
||||
if (vdec->memBias + 512 > vdec->memSize)
|
||||
@ -834,7 +836,7 @@ s32 cellVdecGetPicItem(u32 handle, vm::pptr<CellVdecPicItem> picItem)
|
||||
|
||||
if (vdec->type == CELL_VDEC_CODEC_TYPE_AVC)
|
||||
{
|
||||
const vm::ptr<CellVdecAvcInfo> avc{ info.addr() + SIZE_32(CellVdecPicItem), vm::addr };
|
||||
const vm::ptr<CellVdecAvcInfo> avc = vm::cast(info.addr() + SIZE_32(CellVdecPicItem));
|
||||
|
||||
avc->horizontalSize = frame.width;
|
||||
avc->verticalSize = frame.height;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellVideoExport);
|
||||
logs::channel cellVideoExport("cellVideoExport", logs::level::notice);
|
||||
|
||||
s32 cellVideoExportProgress()
|
||||
{
|
||||
|
@ -1,10 +1,11 @@
|
||||
#include "stdafx.h"
|
||||
#include "Utilities/Config.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "cellVideoOut.h"
|
||||
|
||||
extern _log::channel cellSysutil;
|
||||
extern logs::channel cellSysutil;
|
||||
|
||||
cfg::map_entry<u8> g_cfg_video_out_resolution(cfg::root.video, "Resolution", "1280x720",
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellVideoUpload);
|
||||
logs::channel cellVideoUpload("cellVideoUpload", logs::level::notice);
|
||||
|
||||
s32 cellVideoUploadInitialize()
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(cellVoice);
|
||||
logs::channel cellVoice("cellVoice", logs::level::notice);
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
|
@ -10,7 +10,7 @@ extern "C"
|
||||
|
||||
#include "cellVpost.h"
|
||||
|
||||
LOG_CHANNEL(cellVpost);
|
||||
logs::channel cellVpost("cellVpost", logs::level::notice);
|
||||
|
||||
s32 cellVpostQueryAttr(vm::cptr<CellVpostCfgParam> cfgParam, vm::ptr<CellVpostAttr> attr)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "cellWebBrowser.h"
|
||||
|
||||
extern _log::channel cellSysutil;
|
||||
extern logs::channel cellSysutil;
|
||||
|
||||
s32 cellWebBrowserActivate()
|
||||
{
|
||||
|
@ -5,9 +5,11 @@
|
||||
|
||||
#include "cellAudio.h"
|
||||
#include "libmixer.h"
|
||||
#include <cmath>
|
||||
|
||||
LOG_CHANNEL(libmixer);
|
||||
#include <cmath>
|
||||
#include <thread>
|
||||
|
||||
logs::channel libmixer("libmixer", logs::level::notice);
|
||||
|
||||
// TODO: use fxm
|
||||
SurMixerConfig g_surmx;
|
||||
@ -332,7 +334,7 @@ s32 cellSurMixerCreate(vm::cptr<CellSurMixerConfig> config)
|
||||
|
||||
if (g_surmx.mixcount > (port.tag + 0)) // adding positive value (1-15): preemptive buffer filling (hack)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
std::this_thread::sleep_for(1ms); // hack
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -448,7 +450,7 @@ s32 cellSurMixerCreate(vm::cptr<CellSurMixerConfig> config)
|
||||
|
||||
ppu->cpu_init();
|
||||
ppu->state -= cpu_state::stop;
|
||||
ppu->lock_notify();
|
||||
(*ppu)->lock_notify();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "libsnd3.h"
|
||||
|
||||
LOG_CHANNEL(libsnd3);
|
||||
logs::channel libsnd3("libsnd3", logs::level::notice);
|
||||
|
||||
s32 cellSnd3Init(u32 maxVoice, u32 samples, vm::ptr<CellSnd3RequestQueueCtx> queue)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "libsynth2.h"
|
||||
|
||||
LOG_CHANNEL(libsynth2);
|
||||
logs::channel libsynth2("libsynth2", logs::level::notice);
|
||||
|
||||
s32 cellSoundSynth2Config(s16 param, s32 value)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "Crypto/unedat.h"
|
||||
#include "sceNp.h"
|
||||
|
||||
LOG_CHANNEL(sceNp);
|
||||
logs::channel sceNp("sceNp", logs::level::notice);
|
||||
|
||||
s32 sceNpInit(u32 poolsize, vm::ptr<void> poolptr)
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "sceNp.h"
|
||||
#include "sceNp2.h"
|
||||
|
||||
LOG_CHANNEL(sceNp2);
|
||||
logs::channel sceNp2("sceNp2", logs::level::notice);
|
||||
|
||||
s32 sceNp2Init(u32 poolsize, vm::ptr<void> poolptr)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "sceNp.h"
|
||||
#include "sceNpClans.h"
|
||||
|
||||
LOG_CHANNEL(sceNpClans);
|
||||
logs::channel sceNpClans("sceNpClans", logs::level::notice);
|
||||
|
||||
s32 sceNpClansInit(vm::ptr<SceNpCommunicationId> commId, vm::ptr<SceNpCommunicationPassphrase> passphrase, vm::ptr<void> pool, vm::ptr<u32> poolSize, u32 flags)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "sceNpCommerce2.h"
|
||||
|
||||
LOG_CHANNEL(sceNpCommerce2);
|
||||
logs::channel sceNpCommerce2("sceNpCommerce2", logs::level::notice);
|
||||
|
||||
s32 sceNpCommerce2ExecuteStoreBrowse()
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "sceNpSns.h"
|
||||
|
||||
LOG_CHANNEL(sceNpSns);
|
||||
logs::channel sceNpSns("sceNpSns", logs::level::notice);
|
||||
|
||||
s32 sceNpSnsFbInit(vm::ptr<const SceNpSnsFbInitParams> params)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
LOG_CHANNEL(sceNpTrophy);
|
||||
logs::channel sceNpTrophy("sceNpTrophy", logs::level::notice);
|
||||
|
||||
struct trophy_context_t
|
||||
{
|
||||
@ -269,7 +269,7 @@ s32 sceNpTrophyGetGameInfo(u32 context, u32 handle, vm::ptr<SceNpTrophyGameDetai
|
||||
const std::string& path = vfs::get("/dev_hdd0/home/00000001/trophy/" + ctxt->trp_name + "/TROPCONF.SFM");
|
||||
|
||||
// TODO: rXmlDocument can open only real file
|
||||
ASSERT(!fs::get_virtual_device(path));
|
||||
VERIFY(!fs::get_virtual_device(path));
|
||||
rXmlDocument doc;
|
||||
doc.Load(path);
|
||||
|
||||
@ -399,7 +399,7 @@ s32 sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, vm::ptr<SceN
|
||||
const std::string& path = vfs::get("/dev_hdd0/home/00000001/trophy/" + ctxt->trp_name + "/TROPCONF.SFM");
|
||||
|
||||
// TODO: rXmlDocument can open only real file
|
||||
ASSERT(!fs::get_virtual_device(path));
|
||||
VERIFY(!fs::get_virtual_device(path));
|
||||
rXmlDocument doc;
|
||||
doc.Load(path);
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "sceNp.h"
|
||||
#include "sceNpTus.h"
|
||||
|
||||
LOG_CHANNEL(sceNpTus);
|
||||
logs::channel sceNpTus("sceNpTus", logs::level::notice);
|
||||
|
||||
s32 sceNpTusInit()
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "sceNp.h"
|
||||
#include "sceNpUtil.h"
|
||||
|
||||
LOG_CHANNEL(sceNpUtil);
|
||||
logs::channel sceNpUtil("sceNpUtil", logs::level::notice);
|
||||
|
||||
s32 sceNpUtilBandwidthTestInitStart(u32 prio, size_t stack)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "Emu/Cell/lv2/sys_process.h"
|
||||
#include "sysPrxForUser.h"
|
||||
|
||||
LOG_CHANNEL(sysPrxForUser);
|
||||
logs::channel sysPrxForUser("sysPrxForUser", logs::level::notice);
|
||||
|
||||
extern u64 get_system_time();
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "sysPrxForUser.h"
|
||||
|
||||
extern _log::channel sysPrxForUser;
|
||||
extern logs::channel sysPrxForUser;
|
||||
|
||||
void sys_game_process_exitspawn(vm::cptr<char> path, u32 argv_addr, u32 envp_addr, u32 data_addr, u32 data_size, u32 prio, u64 flags)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "sysPrxForUser.h"
|
||||
|
||||
extern _log::channel sysPrxForUser;
|
||||
extern logs::channel sysPrxForUser;
|
||||
|
||||
struct HeapInfo
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
LOG_CHANNEL(sys_io);
|
||||
logs::channel sys_io("sys_io", logs::level::notice);
|
||||
|
||||
extern void cellPad_init();
|
||||
extern void cellKb_init();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user