mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
Merge remote-tracking branch 'upstream/master' into spurs_taskset
Conflicts: rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp rpcs3/Emu/SysCalls/Modules/cellSpurs.h rpcs3/emucore.vcxproj.filters
This commit is contained in:
commit
411dfd9a3f
141 changed files with 6731 additions and 3936 deletions
|
|
@ -174,7 +174,7 @@ next:
|
|||
buf_size -= adec.reader.size;
|
||||
res += adec.reader.size;
|
||||
|
||||
adec.cbFunc.call(*adec.adecCb, adec.id, CELL_ADEC_MSG_TYPE_AUDONE, adec.task.au.auInfo_addr, adec.cbArg);
|
||||
adec.cbFunc(*adec.adecCb, adec.id, CELL_ADEC_MSG_TYPE_AUDONE, adec.task.au.auInfo_addr, adec.cbArg);
|
||||
|
||||
adec.job.pop(adec.task);
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ u32 adecOpen(AudioDecoder* adec_ptr)
|
|||
adec.id = adec_id;
|
||||
|
||||
adec.adecCb = (PPUThread*)&Emu.GetCPU().AddThread(CPU_THREAD_PPU);
|
||||
adec.adecCb->SetName("Audio Decoder[" + std::to_string(adec_id) + "] Callback");
|
||||
adec.adecCb->SetName(fmt::format("AudioDecoder[%d] Callback", adec_id));
|
||||
adec.adecCb->SetEntry(0);
|
||||
adec.adecCb->SetPrio(1001);
|
||||
adec.adecCb->SetStackSize(0x10000);
|
||||
|
|
@ -232,11 +232,9 @@ u32 adecOpen(AudioDecoder* adec_ptr)
|
|||
adec.adecCb->InitRegs();
|
||||
adec.adecCb->DoRun();
|
||||
|
||||
thread t("Audio Decoder[" + std::to_string(adec_id) + "] Thread", [adec_ptr, sptr]()
|
||||
thread_t t(fmt::format("AudioDecoder[%d] Thread", adec_id), [adec_ptr, sptr]()
|
||||
{
|
||||
AudioDecoder& adec = *adec_ptr;
|
||||
cellAdec->Notice("Audio Decoder thread started");
|
||||
|
||||
AdecTask& task = adec.task;
|
||||
|
||||
while (true)
|
||||
|
|
@ -279,7 +277,7 @@ u32 adecOpen(AudioDecoder* adec_ptr)
|
|||
{
|
||||
// TODO: finalize
|
||||
cellAdec->Warning("adecEndSeq:");
|
||||
adec.cbFunc.call(*adec.adecCb, adec.id, CELL_ADEC_MSG_TYPE_SEQDONE, CELL_OK, adec.cbArg);
|
||||
adec.cbFunc(*adec.adecCb, adec.id, CELL_ADEC_MSG_TYPE_SEQDONE, CELL_OK, adec.cbArg);
|
||||
|
||||
adec.just_finished = true;
|
||||
break;
|
||||
|
|
@ -455,12 +453,12 @@ u32 adecOpen(AudioDecoder* adec_ptr)
|
|||
if (adec.frames.push(frame, &adec.is_closed))
|
||||
{
|
||||
frame.data = nullptr; // to prevent destruction
|
||||
adec.cbFunc.call(*adec.adecCb, adec.id, CELL_ADEC_MSG_TYPE_PCMOUT, CELL_OK, adec.cbArg);
|
||||
adec.cbFunc(*adec.adecCb, adec.id, CELL_ADEC_MSG_TYPE_PCMOUT, CELL_OK, adec.cbArg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
adec.cbFunc.call(*adec.adecCb, adec.id, CELL_ADEC_MSG_TYPE_AUDONE, task.au.auInfo_addr, adec.cbArg);
|
||||
adec.cbFunc(*adec.adecCb, adec.id, CELL_ADEC_MSG_TYPE_AUDONE, task.au.auInfo_addr, adec.cbArg);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -471,18 +469,14 @@ u32 adecOpen(AudioDecoder* adec_ptr)
|
|||
|
||||
default:
|
||||
{
|
||||
ADEC_ERROR("Audio Decoder thread error: unknown task(%d)", task.type);
|
||||
ADEC_ERROR("AudioDecoder thread error: unknown task(%d)", task.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
adec.is_finished = true;
|
||||
if (adec.is_closed) cellAdec->Notice("Audio Decoder thread ended");
|
||||
if (Emu.IsStopped()) cellAdec->Warning("Audio Decoder thread aborted");
|
||||
});
|
||||
|
||||
t.detach();
|
||||
|
||||
return adec_id;
|
||||
}
|
||||
|
||||
|
|
@ -535,7 +529,7 @@ int cellAdecOpen(vm::ptr<CellAdecType> type, vm::ptr<CellAdecResource> res, vm::
|
|||
|
||||
if (!adecCheckType(type->audioCodecType)) return CELL_ADEC_ERROR_ARG;
|
||||
|
||||
*handle = adecOpen(new AudioDecoder(type->audioCodecType, res->startAddr, res->totalMemSize, vm::ptr<CellAdecCbMsg>::make(cb->cbFunc.addr()), cb->cbArg));
|
||||
*handle = adecOpen(new AudioDecoder(type->audioCodecType, res->startAddr, res->totalMemSize, cb->cbFunc.to_le(), cb->cbArg));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -547,7 +541,7 @@ int cellAdecOpenEx(vm::ptr<CellAdecType> type, vm::ptr<CellAdecResourceEx> res,
|
|||
|
||||
if (!adecCheckType(type->audioCodecType)) return CELL_ADEC_ERROR_ARG;
|
||||
|
||||
*handle = adecOpen(new AudioDecoder(type->audioCodecType, res->startAddr, res->totalMemSize, vm::ptr<CellAdecCbMsg>::make(cb->cbFunc.addr()), cb->cbArg));
|
||||
*handle = adecOpen(new AudioDecoder(type->audioCodecType, res->startAddr, res->totalMemSize, cb->cbFunc.to_le(), cb->cbArg));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -617,7 +611,7 @@ int cellAdecStartSeq(u32 handle, u32 param_addr)
|
|||
{
|
||||
auto param = vm::ptr<const CellAdecParamMP3>::make(param_addr);
|
||||
|
||||
cellAdec->Todo("*** CellAdecParamMP3: bw_pcm=%d", param->bw_pcm.ToLE());
|
||||
cellAdec->Todo("*** CellAdecParamMP3: bw_pcm=%d", param->bw_pcm);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
147
rpcs3/Emu/SysCalls/Modules/cellAudio.h
Normal file
147
rpcs3/Emu/SysCalls/Modules/cellAudio.h
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
#pragma once
|
||||
|
||||
// Error codes
|
||||
enum
|
||||
{
|
||||
CELL_AUDIO_ERROR_ALREADY_INIT = 0x80310701,
|
||||
CELL_AUDIO_ERROR_AUDIOSYSTEM = 0x80310702,
|
||||
CELL_AUDIO_ERROR_NOT_INIT = 0x80310703,
|
||||
CELL_AUDIO_ERROR_PARAM = 0x80310704,
|
||||
CELL_AUDIO_ERROR_PORT_FULL = 0x80310705,
|
||||
CELL_AUDIO_ERROR_PORT_ALREADY_RUN = 0x80310706,
|
||||
CELL_AUDIO_ERROR_PORT_NOT_OPEN = 0x80310707,
|
||||
CELL_AUDIO_ERROR_PORT_NOT_RUN = 0x80310708,
|
||||
CELL_AUDIO_ERROR_TRANS_EVENT = 0x80310709,
|
||||
CELL_AUDIO_ERROR_PORT_OPEN = 0x8031070a,
|
||||
CELL_AUDIO_ERROR_SHAREDMEMORY = 0x8031070b,
|
||||
CELL_AUDIO_ERROR_MUTEX = 0x8031070c,
|
||||
CELL_AUDIO_ERROR_EVENT_QUEUE = 0x8031070d,
|
||||
CELL_AUDIO_ERROR_AUDIOSYSTEM_NOT_FOUND = 0x8031070e,
|
||||
CELL_AUDIO_ERROR_TAG_NOT_FOUND = 0x8031070f,
|
||||
};
|
||||
|
||||
// constants
|
||||
enum
|
||||
{
|
||||
CELL_AUDIO_BLOCK_16 = 16,
|
||||
CELL_AUDIO_BLOCK_8 = 8,
|
||||
CELL_AUDIO_BLOCK_SAMPLES = 256,
|
||||
CELL_AUDIO_CREATEEVENTFLAG_SPU = 0x00000001,
|
||||
CELL_AUDIO_EVENT_HEADPHONE = 1,
|
||||
CELL_AUDIO_EVENT_MIX = 0,
|
||||
CELL_AUDIO_EVENTFLAG_BEFOREMIX = 0x80000000,
|
||||
CELL_AUDIO_EVENTFLAG_DECIMATE_2 = 0x08000000,
|
||||
CELL_AUDIO_EVENTFLAG_DECIMATE_4 = 0x10000000,
|
||||
CELL_AUDIO_EVENTFLAG_HEADPHONE = 0x20000000,
|
||||
CELL_AUDIO_EVENTFLAG_NOMIX = 0x40000000,
|
||||
CELL_AUDIO_MAX_PORT = 4,
|
||||
CELL_AUDIO_MAX_PORT_2 = 8,
|
||||
CELL_AUDIO_MISC_ACCVOL_ALLDEVICE = 0x0000ffffUL,
|
||||
CELL_AUDIO_PERSONAL_DEVICE_PRIMARY = 0x8000,
|
||||
CELL_AUDIO_PORT_2CH = 2,
|
||||
CELL_AUDIO_PORT_8CH = 8,
|
||||
CELL_AUDIO_PORTATTR_BGM = 0x0000000000000010ULL,
|
||||
CELL_AUDIO_PORTATTR_INITLEVEL = 0x0000000000001000ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_NO_ROUTE = 0x0000000000100000ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_PERSONAL_0 = 0x0000000001000000ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_PERSONAL_1 = 0x0000000002000000ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_PERSONAL_2 = 0x0000000004000000ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_PERSONAL_3 = 0x0000000008000000ULL,
|
||||
CELL_AUDIO_PORTATTR_OUT_SECONDARY = 0x0000000000000001ULL,
|
||||
CELL_AUDIO_STATUS_CLOSE = 0x1010,
|
||||
CELL_AUDIO_STATUS_READY = 1,
|
||||
CELL_AUDIO_STATUS_RUN = 2,
|
||||
};
|
||||
|
||||
//libaudio datatypes
|
||||
struct CellAudioPortParam
|
||||
{
|
||||
be_t<u64> nChannel;
|
||||
be_t<u64> nBlock;
|
||||
be_t<u64> attr;
|
||||
be_t<float> level;
|
||||
};
|
||||
|
||||
struct CellAudioPortConfig
|
||||
{
|
||||
be_t<u32> readIndexAddr;
|
||||
be_t<u32> status;
|
||||
be_t<u64> nChannel;
|
||||
be_t<u64> nBlock;
|
||||
be_t<u32> portSize;
|
||||
be_t<u32> portAddr;
|
||||
};
|
||||
|
||||
enum : u32
|
||||
{
|
||||
BUFFER_NUM = 32,
|
||||
BUFFER_SIZE = 256,
|
||||
AUDIO_PORT_COUNT = 8,
|
||||
AUDIO_PORT_OFFSET = 256 * 1024,
|
||||
AUDIO_SAMPLES = CELL_AUDIO_BLOCK_SAMPLES,
|
||||
};
|
||||
|
||||
enum AudioState : u32
|
||||
{
|
||||
AUDIO_STATE_NOT_INITIALIZED,
|
||||
AUDIO_STATE_INITIALIZED,
|
||||
AUDIO_STATE_FINALIZED,
|
||||
};
|
||||
|
||||
enum AudioPortState : u32
|
||||
{
|
||||
AUDIO_PORT_STATE_CLOSED,
|
||||
AUDIO_PORT_STATE_OPENED,
|
||||
AUDIO_PORT_STATE_STARTED,
|
||||
};
|
||||
|
||||
struct AudioPortConfig
|
||||
{
|
||||
std::mutex mutex;
|
||||
atomic_le_t<AudioPortState> state;
|
||||
|
||||
u32 channel;
|
||||
u32 block;
|
||||
u64 attr;
|
||||
u64 tag;
|
||||
u64 counter; // copy of global counter
|
||||
u32 addr;
|
||||
u32 read_index_addr;
|
||||
u32 size;
|
||||
float level;
|
||||
float level_set;
|
||||
float level_inc;
|
||||
};
|
||||
|
||||
struct AudioConfig //custom structure
|
||||
{
|
||||
std::mutex mutex;
|
||||
atomic_le_t<AudioState> state;
|
||||
thread_t audio_thread;
|
||||
|
||||
AudioPortConfig ports[AUDIO_PORT_COUNT];
|
||||
u32 buffer; // 1 MB memory for audio ports
|
||||
u32 indexes; // current block indexes and other info
|
||||
u64 counter;
|
||||
u64 start_time;
|
||||
std::vector<u64> keys;
|
||||
|
||||
AudioConfig() : audio_thread("Audio Thread")
|
||||
{
|
||||
}
|
||||
|
||||
u32 open_port()
|
||||
{
|
||||
for (u32 i = 0; i < AUDIO_PORT_COUNT; i++)
|
||||
{
|
||||
if (ports[i].state.compare_and_swap_test(AUDIO_PORT_STATE_CLOSED, AUDIO_PORT_STATE_OPENED))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return ~0;
|
||||
}
|
||||
};
|
||||
|
||||
extern AudioConfig g_audio;
|
||||
|
|
@ -82,7 +82,7 @@ int cellCameraGetDeviceGUID()
|
|||
|
||||
int cellCameraGetType(s32 dev_num, vm::ptr<CellCameraType> type)
|
||||
{
|
||||
cellCamera->Warning("cellCameraGetType(dev_num=%d, type_addr=0x%x)", dev_num, type);
|
||||
cellCamera->Warning("cellCameraGetType(dev_num=%d, type_addr=0x%x)", dev_num, type.addr());
|
||||
|
||||
if (!cellCameraInstance.m_bInitialized)
|
||||
return CELL_CAMERA_ERROR_NOT_INIT;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ PesHeader::PesHeader(DemuxerStream& stream)
|
|||
|
||||
ElementaryStream::ElementaryStream(Demuxer* dmux, u32 addr, u32 size, u32 fidMajor, u32 fidMinor, u32 sup1, u32 sup2, vm::ptr<CellDmuxCbEsMsg> cbFunc, u32 cbArg, u32 spec)
|
||||
: dmux(dmux)
|
||||
, memAddr(a128(addr))
|
||||
, memAddr(align(addr, 128))
|
||||
, memSize(size - (addr - memAddr))
|
||||
, fidMajor(fidMajor)
|
||||
, fidMinor(fidMinor)
|
||||
|
|
@ -92,7 +92,7 @@ ElementaryStream::ElementaryStream(Demuxer* dmux, u32 addr, u32 size, u32 fidMaj
|
|||
, cbFunc(cbFunc)
|
||||
, cbArg(cbArg)
|
||||
, spec(spec)
|
||||
, put(a128(addr))
|
||||
, put(align(addr, 128))
|
||||
, put_count(0)
|
||||
, got_count(0)
|
||||
, released(0)
|
||||
|
|
@ -184,7 +184,7 @@ void ElementaryStream::push_au(u32 size, u64 dts, u64 pts, u64 userdata, bool ra
|
|||
|
||||
addr = put;
|
||||
|
||||
put = a128(put + 128 + size);
|
||||
put = align(put + 128 + size, 128);
|
||||
|
||||
put_count++;
|
||||
}
|
||||
|
|
@ -306,7 +306,7 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
dmux.id = dmux_id;
|
||||
|
||||
dmux.dmuxCb = (PPUThread*)&Emu.GetCPU().AddThread(CPU_THREAD_PPU);
|
||||
dmux.dmuxCb->SetName("Demuxer[" + std::to_string(dmux_id) + "] Callback");
|
||||
dmux.dmuxCb->SetName(fmt::format("Demuxer[%d] Callback", dmux_id));
|
||||
dmux.dmuxCb->SetEntry(0);
|
||||
dmux.dmuxCb->SetPrio(1001);
|
||||
dmux.dmuxCb->SetStackSize(0x10000);
|
||||
|
|
@ -314,10 +314,9 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
dmux.dmuxCb->InitRegs();
|
||||
dmux.dmuxCb->DoRun();
|
||||
|
||||
thread t("Demuxer[" + std::to_string(dmux_id) + "] Thread", [dmux_ptr, sptr]()
|
||||
thread_t t(fmt::format("Demuxer[%d] Thread", dmux_id), [dmux_ptr, sptr]()
|
||||
{
|
||||
Demuxer& dmux = *dmux_ptr;
|
||||
cellDmux->Notice("Demuxer thread started (mem=0x%x, size=0x%x, cb=0x%x, arg=0x%x)", dmux.memAddr, dmux.memSize, dmux.cbFunc, dmux.cbArg);
|
||||
|
||||
DemuxerTask task;
|
||||
DemuxerStream stream = {};
|
||||
|
|
@ -347,16 +346,16 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
if (!stream.peek(code))
|
||||
{
|
||||
// demuxing finished
|
||||
auto dmuxMsg = vm::ptr<CellDmuxMsg>::make(a128(dmux.memAddr) + (cb_add ^= 16));
|
||||
auto dmuxMsg = vm::ptr<CellDmuxMsg>::make(dmux.memAddr + (cb_add ^= 16));
|
||||
dmuxMsg->msgType = CELL_DMUX_MSG_TYPE_DEMUX_DONE;
|
||||
dmuxMsg->supplementalInfo = stream.userdata;
|
||||
dmux.cbFunc.call(*dmux.dmuxCb, dmux.id, dmuxMsg, dmux.cbArg);
|
||||
dmux.cbFunc(*dmux.dmuxCb, dmux.id, dmuxMsg, dmux.cbArg);
|
||||
|
||||
dmux.is_running = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (code.ToLE())
|
||||
switch (code.value())
|
||||
{
|
||||
case PACK_START_CODE:
|
||||
{
|
||||
|
|
@ -387,9 +386,9 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
stream.skip(4);
|
||||
stream.get(len);
|
||||
|
||||
if (!stream.check(len.ToLE()))
|
||||
if (!stream.check(len))
|
||||
{
|
||||
DMUX_ERROR("End of stream (PADDING_STREAM, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of stream (PADDING_STREAM, len=%d)", len);
|
||||
}
|
||||
stream.skip(len);
|
||||
break;
|
||||
|
|
@ -404,11 +403,11 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
stream.skip(4);
|
||||
stream.get(len);
|
||||
|
||||
cellDmux->Notice("PRIVATE_STREAM_2 (%d)", len.ToLE());
|
||||
cellDmux->Notice("PRIVATE_STREAM_2 (%d)", len);
|
||||
|
||||
if (!stream.check(len.ToLE()))
|
||||
if (!stream.check(len))
|
||||
{
|
||||
DMUX_ERROR("End of stream (PRIVATE_STREAM_2, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of stream (PRIVATE_STREAM_2, len=%d)", len);
|
||||
}
|
||||
stream.skip(len);
|
||||
break;
|
||||
|
|
@ -426,20 +425,20 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
stream.skip(4);
|
||||
stream.get(len);
|
||||
|
||||
if (!stream.check(len.ToLE()))
|
||||
if (!stream.check(len))
|
||||
{
|
||||
DMUX_ERROR("End of stream (PRIVATE_STREAM_1, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of stream (PRIVATE_STREAM_1, len=%d)", len);
|
||||
}
|
||||
|
||||
const PesHeader pes(stream);
|
||||
if (!pes.is_ok)
|
||||
{
|
||||
DMUX_ERROR("PesHeader error (PRIVATE_STREAM_1, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("PesHeader error (PRIVATE_STREAM_1, len=%d)", len);
|
||||
}
|
||||
|
||||
if (len < pes.size + 4)
|
||||
{
|
||||
DMUX_ERROR("End of block (PRIVATE_STREAM_1, PesHeader + fid_minor, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of block (PRIVATE_STREAM_1, PesHeader + fid_minor, len=%d)", len);
|
||||
}
|
||||
len -= pes.size + 4;
|
||||
|
||||
|
|
@ -462,7 +461,7 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
|
||||
if (len < 3 || !stream.check(3))
|
||||
{
|
||||
DMUX_ERROR("End of block (ATX, unknown header, len=%d)", len.ToLE());
|
||||
DMUX_ERROR("End of block (ATX, unknown header, len=%d)", len);
|
||||
}
|
||||
len -= 3;
|
||||
stream.skip(3);
|
||||
|
|
@ -484,7 +483,7 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
|
||||
if (data[0] != 0x0f || data[1] != 0xd0)
|
||||
{
|
||||
DMUX_ERROR("ATX: 0x0fd0 header not found (ats=0x%llx)", ((be_t<u64>*)data)->ToLE());
|
||||
DMUX_ERROR("ATX: 0x0fd0 header not found (ats=0x%llx)", *(be_t<u64>*)data);
|
||||
}
|
||||
|
||||
u32 frame_size = ((((u32)data[2] & 0x3) << 8) | (u32)data[3]) * 8 + 8;
|
||||
|
|
@ -495,17 +494,17 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
|
||||
es.push_au(frame_size + 8, es.last_dts, es.last_pts, stream.userdata, false /* TODO: set correct value */, 0);
|
||||
|
||||
//cellDmux->Notice("ATX AU pushed (ats=0x%llx, frame_size=%d)", ((be_t<u64>*)data)->ToLE(), frame_size);
|
||||
//cellDmux->Notice("ATX AU pushed (ats=0x%llx, frame_size=%d)", *(be_t<u64>*)data, frame_size);
|
||||
|
||||
auto esMsg = vm::ptr<CellDmuxEsMsg>::make(a128(dmux.memAddr) + (cb_add ^= 16));
|
||||
auto esMsg = vm::ptr<CellDmuxEsMsg>::make(dmux.memAddr + (cb_add ^= 16));
|
||||
esMsg->msgType = CELL_DMUX_ES_MSG_TYPE_AU_FOUND;
|
||||
esMsg->supplementalInfo = stream.userdata;
|
||||
es.cbFunc.call(*dmux.dmuxCb, dmux.id, es.id, esMsg, es.cbArg);
|
||||
es.cbFunc(*dmux.dmuxCb, dmux.id, es.id, esMsg, es.cbArg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cellDmux->Notice("PRIVATE_STREAM_1 (len=%d, fid_minor=0x%x)", len.ToLE(), fid_minor);
|
||||
cellDmux->Notice("PRIVATE_STREAM_1 (len=%d, fid_minor=0x%x)", len, fid_minor);
|
||||
stream.skip(len);
|
||||
}
|
||||
break;
|
||||
|
|
@ -521,29 +520,29 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
|
||||
if (!stream.check(6))
|
||||
{
|
||||
DMUX_ERROR("End of stream (video, code=0x%x)", code.ToLE());
|
||||
DMUX_ERROR("End of stream (video, code=0x%x)", code);
|
||||
}
|
||||
stream.skip(4);
|
||||
stream.get(len);
|
||||
|
||||
if (!stream.check(len.ToLE()))
|
||||
if (!stream.check(len))
|
||||
{
|
||||
DMUX_ERROR("End of stream (video, code=0x%x, len=%d)", code.ToLE(), len.ToLE());
|
||||
DMUX_ERROR("End of stream (video, code=0x%x, len=%d)", code, len);
|
||||
}
|
||||
|
||||
const PesHeader pes(stream);
|
||||
if (!pes.is_ok)
|
||||
{
|
||||
DMUX_ERROR("PesHeader error (video, code=0x%x, len=%d)", code.ToLE(), len.ToLE());
|
||||
DMUX_ERROR("PesHeader error (video, code=0x%x, len=%d)", code, len);
|
||||
}
|
||||
|
||||
if (len < pes.size + 3)
|
||||
{
|
||||
DMUX_ERROR("End of block (video, code=0x%x, PesHeader)", code.ToLE());
|
||||
DMUX_ERROR("End of block (video, code=0x%x, PesHeader)", code);
|
||||
}
|
||||
len -= pes.size + 3;
|
||||
|
||||
const u32 ch = code.ToLE() % 16;
|
||||
const u32 ch = code % 16;
|
||||
if (esAVC[ch])
|
||||
{
|
||||
ElementaryStream& es = *esAVC[ch];
|
||||
|
|
@ -562,10 +561,10 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
es.push_au(old_size, es.last_dts, es.last_pts, stream.userdata, false /* TODO: set correct value */, 0);
|
||||
|
||||
// callback
|
||||
auto esMsg = vm::ptr<CellDmuxEsMsg>::make(a128(dmux.memAddr) + (cb_add ^= 16));
|
||||
auto esMsg = vm::ptr<CellDmuxEsMsg>::make(dmux.memAddr + (cb_add ^= 16));
|
||||
esMsg->msgType = CELL_DMUX_ES_MSG_TYPE_AU_FOUND;
|
||||
esMsg->supplementalInfo = stream.userdata;
|
||||
es.cbFunc.call(*dmux.dmuxCb, dmux.id, es.id, esMsg, es.cbArg);
|
||||
es.cbFunc(*dmux.dmuxCb, dmux.id, es.id, esMsg, es.cbArg);
|
||||
}
|
||||
|
||||
if (pes.has_ts)
|
||||
|
|
@ -576,13 +575,13 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
}
|
||||
|
||||
// reconstruction of MPEG2-PS stream for vdec module
|
||||
const u32 size = (u32)len.ToLE() + pes.size + 9;
|
||||
const u32 size = len + pes.size + 9;
|
||||
stream = backup;
|
||||
es.push(stream, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
cellDmux->Notice("Video stream (code=0x%x, len=%d)", code.ToLE(), len.ToLE());
|
||||
cellDmux->Notice("Video stream (code=0x%x, len=%d)", code, len);
|
||||
stream.skip(len);
|
||||
}
|
||||
break;
|
||||
|
|
@ -590,9 +589,9 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
|
||||
default:
|
||||
{
|
||||
if ((code.ToLE() & PACKET_START_CODE_MASK) == PACKET_START_CODE_PREFIX)
|
||||
if ((code & PACKET_START_CODE_MASK) == PACKET_START_CODE_PREFIX)
|
||||
{
|
||||
DMUX_ERROR("Unknown code found (0x%x)", code.ToLE());
|
||||
DMUX_ERROR("Unknown code found (0x%x)", code);
|
||||
}
|
||||
|
||||
// search
|
||||
|
|
@ -634,10 +633,10 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
case dmuxResetStream:
|
||||
case dmuxResetStreamAndWaitDone:
|
||||
{
|
||||
auto dmuxMsg = vm::ptr<CellDmuxMsg>::make(a128(dmux.memAddr) + (cb_add ^= 16));
|
||||
auto dmuxMsg = vm::ptr<CellDmuxMsg>::make(dmux.memAddr + (cb_add ^= 16));
|
||||
dmuxMsg->msgType = CELL_DMUX_MSG_TYPE_DEMUX_DONE;
|
||||
dmuxMsg->supplementalInfo = stream.userdata;
|
||||
dmux.cbFunc.call(*dmux.dmuxCb, dmux.id, dmuxMsg, dmux.cbArg);
|
||||
dmux.cbFunc(*dmux.dmuxCb, dmux.id, dmuxMsg, dmux.cbArg);
|
||||
|
||||
stream = {};
|
||||
dmux.is_running = false;
|
||||
|
|
@ -722,10 +721,10 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
es.push_au(old_size, es.last_dts, es.last_pts, stream.userdata, false, 0);
|
||||
|
||||
// callback
|
||||
auto esMsg = vm::ptr<CellDmuxEsMsg>::make(a128(dmux.memAddr) + (cb_add ^= 16));
|
||||
auto esMsg = vm::ptr<CellDmuxEsMsg>::make(dmux.memAddr + (cb_add ^= 16));
|
||||
esMsg->msgType = CELL_DMUX_ES_MSG_TYPE_AU_FOUND;
|
||||
esMsg->supplementalInfo = stream.userdata;
|
||||
es.cbFunc.call(*dmux.dmuxCb, dmux.id, es.id, esMsg, es.cbArg);
|
||||
es.cbFunc(*dmux.dmuxCb, dmux.id, es.id, esMsg, es.cbArg);
|
||||
}
|
||||
|
||||
if (es.raw_data.size())
|
||||
|
|
@ -734,10 +733,10 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
}
|
||||
|
||||
// callback
|
||||
auto esMsg = vm::ptr<CellDmuxEsMsg>::make(a128(dmux.memAddr) + (cb_add ^= 16));
|
||||
auto esMsg = vm::ptr<CellDmuxEsMsg>::make(dmux.memAddr + (cb_add ^= 16));
|
||||
esMsg->msgType = CELL_DMUX_ES_MSG_TYPE_FLUSH_DONE;
|
||||
esMsg->supplementalInfo = stream.userdata;
|
||||
es.cbFunc.call(*dmux.dmuxCb, dmux.id, es.id, esMsg, es.cbArg);
|
||||
es.cbFunc(*dmux.dmuxCb, dmux.id, es.id, esMsg, es.cbArg);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -760,12 +759,8 @@ u32 dmuxOpen(Demuxer* dmux_ptr)
|
|||
}
|
||||
|
||||
dmux.is_finished = true;
|
||||
if (Emu.IsStopped()) cellDmux->Warning("Demuxer thread aborted");
|
||||
if (dmux.is_closed) cellDmux->Notice("Demuxer thread ended");
|
||||
});
|
||||
|
||||
t.detach();
|
||||
|
||||
return dmux_id;
|
||||
}
|
||||
|
||||
|
|
@ -808,7 +803,7 @@ int cellDmuxOpen(vm::ptr<const CellDmuxType> demuxerType, vm::ptr<const CellDmux
|
|||
|
||||
// TODO: check demuxerResource and demuxerCb arguments
|
||||
|
||||
*demuxerHandle = dmuxOpen(new Demuxer(demuxerResource->memAddr, demuxerResource->memSize, vm::ptr<CellDmuxCbMsg>::make(demuxerCb->cbMsgFunc.addr()), demuxerCb->cbArg));
|
||||
*demuxerHandle = dmuxOpen(new Demuxer(demuxerResource->memAddr, demuxerResource->memSize, demuxerCb->cbMsgFunc.to_le(), demuxerCb->cbArg));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -826,7 +821,7 @@ int cellDmuxOpenEx(vm::ptr<const CellDmuxType> demuxerType, vm::ptr<const CellDm
|
|||
|
||||
// TODO: check demuxerResourceEx and demuxerCb arguments
|
||||
|
||||
*demuxerHandle = dmuxOpen(new Demuxer(demuxerResourceEx->memAddr, demuxerResourceEx->memSize, vm::ptr<CellDmuxCbMsg>::make(demuxerCb->cbMsgFunc.addr()), demuxerCb->cbArg));
|
||||
*demuxerHandle = dmuxOpen(new Demuxer(demuxerResourceEx->memAddr, demuxerResourceEx->memSize, demuxerCb->cbMsgFunc.to_le(), demuxerCb->cbArg));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -844,7 +839,7 @@ int cellDmuxOpen2(vm::ptr<const CellDmuxType2> demuxerType2, vm::ptr<const CellD
|
|||
|
||||
// TODO: check demuxerType2, demuxerResource2 and demuxerCb arguments
|
||||
|
||||
*demuxerHandle = dmuxOpen(new Demuxer(demuxerResource2->memAddr, demuxerResource2->memSize, vm::ptr<CellDmuxCbMsg>::make(demuxerCb->cbMsgFunc.addr()), demuxerCb->cbArg));
|
||||
*demuxerHandle = dmuxOpen(new Demuxer(demuxerResource2->memAddr, demuxerResource2->memSize, demuxerCb->cbMsgFunc.to_le(), demuxerCb->cbArg));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -993,14 +988,14 @@ int cellDmuxEnableEs(u32 demuxerHandle, vm::ptr<const CellCodecEsFilterId> esFil
|
|||
|
||||
std::shared_ptr<ElementaryStream> es(new ElementaryStream(dmux.get(), esResourceInfo->memAddr, esResourceInfo->memSize,
|
||||
esFilterId->filterIdMajor, esFilterId->filterIdMinor, esFilterId->supplementalInfo1, esFilterId->supplementalInfo2,
|
||||
vm::ptr<CellDmuxCbEsMsg>::make(esCb->cbEsMsgFunc.addr()), esCb->cbArg, esSpecificInfo_addr));
|
||||
esCb->cbEsMsgFunc.to_le(), esCb->cbArg, esSpecificInfo_addr));
|
||||
|
||||
u32 id = cellDmux->GetNewId(es);
|
||||
es->id = id;
|
||||
*esHandle = id;
|
||||
|
||||
cellDmux->Warning("*** New ES(dmux=%d, addr=0x%x, size=0x%x, filter(0x%x, 0x%x, 0x%x, 0x%x), cb=0x%x(arg=0x%x), spec=0x%x): id = %d",
|
||||
demuxerHandle, es->memAddr, es->memSize, es->fidMajor, es->fidMinor, es->sup1, es->sup2, esCb->cbEsMsgFunc.addr(), es->cbArg, es->spec, id);
|
||||
demuxerHandle, es->memAddr, es->memSize, es->fidMajor, es->fidMinor, es->sup1, es->sup2, es->cbFunc, es->cbArg, es->spec, id);
|
||||
|
||||
DemuxerTask task(dmuxEnableEs);
|
||||
task.es.es = id;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
// align size or address to 128
|
||||
#define a128(x) ((x + 127) & (~127))
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,11 +36,11 @@ int cellFontGetRevisionFlags(vm::ptr<be_t<u64>> revisionFlags)
|
|||
return CELL_FONT_OK;
|
||||
}
|
||||
|
||||
int cellFontInit(vm::ptr<CellFontConfig> config)
|
||||
int cellFontInit(PPUThread& CPU, vm::ptr<CellFontConfig> config)
|
||||
{
|
||||
cellFont->Log("cellFontInit(config=0x%x)", config.addr());
|
||||
|
||||
vm::var<be_t<u64>> revisionFlags;
|
||||
vm::stackvar<be_t<u64>> revisionFlags(CPU);
|
||||
revisionFlags.value() = 0;
|
||||
cellFontGetRevisionFlags(revisionFlags);
|
||||
return cellFontInitializeWithRevision(revisionFlags.value(), config);
|
||||
|
|
@ -101,7 +101,7 @@ int cellFontOpenFontFile(vm::ptr<CellFontLibrary> library, vm::ptr<const char> f
|
|||
return ret;
|
||||
}
|
||||
|
||||
int cellFontOpenFontset(vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
|
||||
int cellFontOpenFontset(PPUThread& CPU, vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType> fontType, vm::ptr<CellFont> font)
|
||||
{
|
||||
cellFont->Log("cellFontOpenFontset(library_addr=0x%x, fontType_addr=0x%x, font_addr=0x%x)",
|
||||
library.addr(), fontType.addr(), font.addr());
|
||||
|
|
@ -177,7 +177,7 @@ int cellFontOpenFontset(vm::ptr<CellFontLibrary> library, vm::ptr<CellFontType>
|
|||
return CELL_FONT_ERROR_NO_SUPPORT_FONTSET;
|
||||
}
|
||||
|
||||
vm::var<char> f((u32)file.length() + 1, 1);
|
||||
vm::stackvar<char> f(CPU, (u32)file.length() + 1, 1);
|
||||
memcpy(f.get_ptr(), file.c_str(), file.size() + 1);
|
||||
int ret = cellFontOpenFontFile(library, f, 0, 0, font); //TODO: Find the correct values of subNum, uniqueId
|
||||
font->origin = CELL_FONT_OPEN_FONTSET;
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ int cellGameContentPermit(vm::ptr<char[CELL_GAME_PATH_MAX]> contentInfoPath, vm:
|
|||
return CELL_GAME_RET_OK;
|
||||
}
|
||||
|
||||
int cellGameDataCheckCreate2(u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
int cellGameDataCheckCreate2(PPUThread& CPU, u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
vm::ptr<void(*)(vm::ptr<CellGameDataCBResult> cbResult, vm::ptr<CellGameDataStatGet> get, vm::ptr<CellGameDataStatSet> set)> funcStat, u32 container)
|
||||
{
|
||||
cellGame->Warning("cellGameDataCheckCreate(2)(version=0x%x, dirName_addr=0x%x, errDialog=0x%x, funcStat_addr=0x%x, container=%d)",
|
||||
|
|
@ -238,10 +238,9 @@ int cellGameDataCheckCreate2(u32 version, vm::ptr<const char> dirName, u32 errDi
|
|||
return CELL_GAMEDATA_ERROR_BROKEN;
|
||||
}
|
||||
|
||||
// TODO: use memory container
|
||||
vm::var<CellGameDataCBResult> cbResult;
|
||||
vm::var<CellGameDataStatGet> cbGet;
|
||||
vm::var<CellGameDataStatSet> cbSet;
|
||||
vm::stackvar<CellGameDataCBResult> cbResult(CPU);
|
||||
vm::stackvar<CellGameDataStatGet> cbGet(CPU);
|
||||
vm::stackvar<CellGameDataStatSet> cbSet(CPU);
|
||||
|
||||
cbGet.value() = {};
|
||||
|
||||
|
|
@ -273,7 +272,7 @@ int cellGameDataCheckCreate2(u32 version, vm::ptr<const char> dirName, u32 errDi
|
|||
if (cbSet->setParam)
|
||||
{
|
||||
// TODO: write PARAM.SFO from cbSet
|
||||
cellGame->Todo("cellGameDataCheckCreate(2)(): writing PARAM.SFO parameters (addr=0x%x)", cbSet->setParam.addr());
|
||||
cellGame->Todo("cellGameDataCheckCreate(2)(): writing PARAM.SFO parameters (addr=0x%x)", cbSet->setParam);
|
||||
}
|
||||
|
||||
switch ((s32)cbResult->result)
|
||||
|
|
@ -307,11 +306,11 @@ int cellGameDataCheckCreate2(u32 version, vm::ptr<const char> dirName, u32 errDi
|
|||
}
|
||||
}
|
||||
|
||||
int cellGameDataCheckCreate(u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
int cellGameDataCheckCreate(PPUThread& CPU, u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
vm::ptr<void(*)(vm::ptr<CellGameDataCBResult> cbResult, vm::ptr<CellGameDataStatGet> get, vm::ptr<CellGameDataStatSet> set)> funcStat, u32 container)
|
||||
{
|
||||
// TODO: almost identical, the only difference is that this function will always calculate the size of game data
|
||||
return cellGameDataCheckCreate2(version, dirName, errDialog, funcStat, container);
|
||||
return cellGameDataCheckCreate2(CPU, version, dirName, errDialog, funcStat, container);
|
||||
}
|
||||
|
||||
int cellGameCreateGameData(vm::ptr<CellGameSetInitParams> init, vm::ptr<char> tmp_contentInfoPath, vm::ptr<char> tmp_usrdirPath)
|
||||
|
|
@ -444,11 +443,11 @@ int cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, vm::ptr<const char>
|
|||
std::string errorMsg;
|
||||
if (type == CELL_GAME_ERRDIALOG_NOSPACE || type == CELL_GAME_ERRDIALOG_NOSPACE_EXIT)
|
||||
{
|
||||
errorMsg = fmt::Format("ERROR: %s\nSpace needed: %d KB", errorName.c_str(), errNeedSizeKB, dirName);
|
||||
errorMsg = fmt::format("ERROR: %s\nSpace needed: %d KB", errorName, errNeedSizeKB);
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMsg = fmt::Format("ERROR: %s", errorName.c_str());
|
||||
errorMsg = fmt::format("ERROR: %s", errorName);
|
||||
}
|
||||
|
||||
if (dirName)
|
||||
|
|
|
|||
|
|
@ -199,4 +199,4 @@ struct CellGameDataStatSet
|
|||
{
|
||||
vm::bptr<CellGameDataSystemFileParam> setParam;
|
||||
be_t<u32> reserved;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -190,10 +190,9 @@ int cellGemGetInfo()
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
// Should int be used, even when type is int_32t (s32)?
|
||||
s32 cellGemGetMemorySize(be_t<s32> max_connect)
|
||||
s32 cellGemGetMemorySize(s32 max_connect)
|
||||
{
|
||||
cellGem->Warning("cellGemGetMemorySize(max_connect=%i)", max_connect);
|
||||
cellGem->Warning("cellGemGetMemorySize(max_connect=%d)", max_connect);
|
||||
|
||||
if (max_connect > CELL_GEM_MAX_NUM)
|
||||
return CELL_GEM_ERROR_INVALID_PARAMETER;
|
||||
|
|
|
|||
|
|
@ -30,17 +30,17 @@ int cellGifDecOpen(u32 mainHandle, vm::ptr<u32> subHandle, vm::ptr<CellGifDecSrc
|
|||
current_subHandle->fd = 0;
|
||||
current_subHandle->src = *src;
|
||||
|
||||
switch(src->srcSelect.ToBE())
|
||||
switch(src->srcSelect.data())
|
||||
{
|
||||
case se32(CELL_GIFDEC_BUFFER):
|
||||
current_subHandle->fileSize = src->streamSize.ToLE();
|
||||
current_subHandle->fileSize = src->streamSize;
|
||||
break;
|
||||
|
||||
case se32(CELL_GIFDEC_FILE):
|
||||
// Get file descriptor
|
||||
vm::var<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
|
||||
current_subHandle->fd = fd->ToLE();
|
||||
int ret = cellFsOpen(src->fileName.to_le(), 0, fd, vm::ptr<const void>::make(0), 0);
|
||||
current_subHandle->fd = fd.value();
|
||||
if (ret != CELL_OK) return CELL_GIFDEC_ERROR_OPEN_FILE;
|
||||
|
||||
// Get size of file
|
||||
|
|
@ -74,7 +74,7 @@ int cellGifDecReadHeader(u32 mainHandle, u32 subHandle, vm::ptr<CellGifDecInfo>
|
|||
vm::var<u8[13]> buffer; // Alloc buffer for GIF header
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch(subHandle_data->src.srcSelect.ToBE())
|
||||
switch(subHandle_data->src.srcSelect.data())
|
||||
{
|
||||
case se32(CELL_GIFDEC_BUFFER):
|
||||
memmove(buffer.begin(), vm::get_ptr<void>(subHandle_data->src.streamPtr), buffer.size());
|
||||
|
|
@ -156,7 +156,7 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, vm::pt
|
|||
vm::var<unsigned char[]> gif((u32)fileSize);
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch(subHandle_data->src.srcSelect.ToBE())
|
||||
switch(subHandle_data->src.srcSelect.data())
|
||||
{
|
||||
case se32(CELL_GIFDEC_BUFFER):
|
||||
memmove(gif.begin(), vm::get_ptr<void>(subHandle_data->src.streamPtr), gif.size());
|
||||
|
|
|
|||
|
|
@ -36,17 +36,17 @@ int cellJpgDecOpen(u32 mainHandle, vm::ptr<u32> subHandle, vm::ptr<CellJpgDecSrc
|
|||
current_subHandle->fd = 0;
|
||||
current_subHandle->src = *src;
|
||||
|
||||
switch(src->srcSelect.ToBE())
|
||||
switch(src->srcSelect.data())
|
||||
{
|
||||
case se32(CELL_JPGDEC_BUFFER):
|
||||
current_subHandle->fileSize = src->streamSize.ToLE();
|
||||
current_subHandle->fileSize = src->streamSize;
|
||||
break;
|
||||
|
||||
case se32(CELL_JPGDEC_FILE):
|
||||
// Get file descriptor
|
||||
vm::var<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
|
||||
current_subHandle->fd = fd->ToLE();
|
||||
int ret = cellFsOpen(src->fileName.to_le(), 0, fd, vm::ptr<const void>::make(0), 0);
|
||||
current_subHandle->fd = fd.value();
|
||||
if (ret != CELL_OK) return CELL_JPGDEC_ERROR_OPEN_FILE;
|
||||
|
||||
// Get size of file
|
||||
|
|
@ -94,7 +94,7 @@ int cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, vm::ptr<CellJpgDecInfo>
|
|||
vm::var<u8[]> buffer((u32)fileSize);
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch(subHandle_data->src.srcSelect.ToBE())
|
||||
switch(subHandle_data->src.srcSelect.data())
|
||||
{
|
||||
case se32(CELL_JPGDEC_BUFFER):
|
||||
memmove(buffer.begin(), vm::get_ptr<void>(subHandle_data->src.streamPtr), buffer.size());
|
||||
|
|
@ -163,7 +163,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, vm::pt
|
|||
vm::var<unsigned char[]> jpg((u32)fileSize);
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch(subHandle_data->src.srcSelect.ToBE())
|
||||
switch(subHandle_data->src.srcSelect.data())
|
||||
{
|
||||
case se32(CELL_JPGDEC_BUFFER):
|
||||
memmove(jpg.begin(), vm::get_ptr<void>(subHandle_data->src.streamPtr), jpg.size());
|
||||
|
|
@ -261,7 +261,7 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr<u8> data, vm::pt
|
|||
case CELL_JPG_UPSAMPLE_ONLY:
|
||||
case CELL_JPG_GRAYSCALE_TO_ALPHA_RGBA:
|
||||
case CELL_JPG_GRAYSCALE_TO_ALPHA_ARGB:
|
||||
cellJpgDec->Error("cellJpgDecDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
|
||||
cellJpgDec->Error("cellJpgDecDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ s32 cellMsgDialogOpen2(u32 type, vm::ptr<const char> msgString, vm::ptr<CellMsgD
|
|||
|
||||
std::string msg = msgString.get_ptr();
|
||||
|
||||
thread t("MsgDialog thread", [type, msg, callback, userData, extParam]()
|
||||
thread_t t("MsgDialog Thread", [type, msg, callback, userData, extParam]()
|
||||
{
|
||||
switch (type & CELL_MSGDIALOG_TYPE_SE_TYPE)
|
||||
{
|
||||
|
|
@ -171,10 +171,10 @@ s32 cellMsgDialogOpen2(u32 type, vm::ptr<const char> msgString, vm::ptr<CellMsgD
|
|||
|
||||
if (callback && (g_msg_dialog_state != msgDialogAbort))
|
||||
{
|
||||
s32 status = (s32)g_msg_dialog_status;
|
||||
Emu.GetCallbackManager().Register([callback, userData, status]() -> s32
|
||||
const s32 status = (s32)g_msg_dialog_status;
|
||||
Emu.GetCallbackManager().Register([callback, userData, status](PPUThread& PPU) -> s32
|
||||
{
|
||||
callback(status, userData);
|
||||
callback(PPU, status, userData);
|
||||
return CELL_OK;
|
||||
});
|
||||
}
|
||||
|
|
@ -186,7 +186,6 @@ s32 cellMsgDialogOpen2(u32 type, vm::ptr<const char> msgString, vm::ptr<CellMsgD
|
|||
g_msg_dialog_state = msgDialogNone;
|
||||
});
|
||||
});
|
||||
t.detach();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ int cellPadInfoSensorMode(u32 port_no)
|
|||
|
||||
int cellPadSetPressMode(u32 port_no, u32 mode)
|
||||
{
|
||||
sys_io->Log("cellPadSetPressMode(port_no=%u, mode=%u)", port_no, mode);
|
||||
sys_io->Log("cellPadSetPressMode(port_no=%d, mode=%d)", port_no, mode);
|
||||
if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED;
|
||||
if (mode != 0 && mode != 1) return CELL_PAD_ERROR_INVALID_PARAMETER;
|
||||
const PadInfo& rinfo = Emu.GetPadManager().GetInfo();
|
||||
|
|
@ -405,7 +405,7 @@ int cellPadSetPressMode(u32 port_no, u32 mode)
|
|||
|
||||
int cellPadSetSensorMode(u32 port_no, u32 mode)
|
||||
{
|
||||
sys_io->Log("cellPadSetSensorMode(port_no=%u, mode=%u)", port_no, mode);
|
||||
sys_io->Log("cellPadSetSensorMode(port_no=%d, mode=%d)", port_no, mode);
|
||||
if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED;
|
||||
if (mode != 0 && mode != 1) return CELL_PAD_ERROR_INVALID_PARAMETER;
|
||||
const PadInfo& rinfo = Emu.GetPadManager().GetInfo();
|
||||
|
|
|
|||
|
|
@ -77,17 +77,17 @@ s64 pngDecOpen(
|
|||
stream->fd = 0;
|
||||
stream->src = *src;
|
||||
|
||||
switch ((u32)src->srcSelect.ToBE())
|
||||
switch (src->srcSelect.data())
|
||||
{
|
||||
case se32(CELL_PNGDEC_BUFFER):
|
||||
stream->fileSize = src->streamSize.ToLE();
|
||||
stream->fileSize = src->streamSize;
|
||||
break;
|
||||
|
||||
case se32(CELL_PNGDEC_FILE):
|
||||
// Get file descriptor
|
||||
vm::var<be_t<u32>> fd;
|
||||
int ret = cellFsOpen(vm::ptr<const char>::make(src->fileName.addr()), 0, fd, vm::ptr<u32>::make(0), 0);
|
||||
stream->fd = fd->ToLE();
|
||||
int ret = cellFsOpen(src->fileName.to_le(), 0, fd, vm::ptr<const void>::make(0), 0);
|
||||
stream->fd = fd.value();
|
||||
if (ret != CELL_OK) return CELL_PNGDEC_ERROR_OPEN_FILE;
|
||||
|
||||
// Get size of file
|
||||
|
|
@ -145,7 +145,7 @@ s64 pngReadHeader(
|
|||
auto buffer_32 = buffer.To<be_t<u32>>();
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch ((u32)stream->src.srcSelect.ToBE())
|
||||
switch (stream->src.srcSelect.data())
|
||||
{
|
||||
case se32(CELL_PNGDEC_BUFFER):
|
||||
memmove(buffer.begin(), stream->src.streamPtr.get_ptr(), buffer.size());
|
||||
|
|
@ -156,9 +156,9 @@ s64 pngReadHeader(
|
|||
break;
|
||||
}
|
||||
|
||||
if (buffer_32[0].ToBE() != se32(0x89504E47) ||
|
||||
buffer_32[1].ToBE() != se32(0x0D0A1A0A) || // Error: The first 8 bytes are not a valid PNG signature
|
||||
buffer_32[3].ToBE() != se32(0x49484452)) // Error: The PNG file does not start with an IHDR chunk
|
||||
if (buffer_32[0].data() != se32(0x89504E47) ||
|
||||
buffer_32[1].data() != se32(0x0D0A1A0A) || // Error: The first 8 bytes are not a valid PNG signature
|
||||
buffer_32[3].data() != se32(0x49484452)) // Error: The PNG file does not start with an IHDR chunk
|
||||
{
|
||||
return CELL_PNGDEC_ERROR_HEADER;
|
||||
}
|
||||
|
|
@ -206,7 +206,7 @@ s64 pngDecSetParameter(
|
|||
current_outParam.outputHeight = current_info.imageHeight;
|
||||
current_outParam.outputColorSpace = inParam->outputColorSpace;
|
||||
|
||||
switch ((u32)current_outParam.outputColorSpace.ToBE())
|
||||
switch (current_outParam.outputColorSpace.data())
|
||||
{
|
||||
case se32(CELL_PNGDEC_PALETTE):
|
||||
case se32(CELL_PNGDEC_GRAYSCALE):
|
||||
|
|
@ -223,7 +223,7 @@ s64 pngDecSetParameter(
|
|||
current_outParam.outputComponents = 4; break;
|
||||
|
||||
default:
|
||||
cellPngDec->Error("pngDecSetParameter: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
|
||||
cellPngDec->Error("pngDecSetParameter: Unsupported color space (%d)", current_outParam.outputColorSpace);
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
}
|
||||
|
||||
|
|
@ -254,7 +254,7 @@ s64 pngDecodeData(
|
|||
vm::var<unsigned char[]> png((u32)fileSize);
|
||||
vm::var<be_t<u64>> pos, nread;
|
||||
|
||||
switch ((u32)stream->src.srcSelect.ToBE())
|
||||
switch (stream->src.srcSelect.data())
|
||||
{
|
||||
case se32(CELL_PNGDEC_BUFFER):
|
||||
memmove(png.begin(), stream->src.streamPtr.get_ptr(), png.size());
|
||||
|
|
@ -283,7 +283,7 @@ s64 pngDecodeData(
|
|||
const int bytesPerLine = (u32)dataCtrlParam->outputBytesPerLine;
|
||||
uint image_size = width * height;
|
||||
|
||||
switch ((u32)current_outParam.outputColorSpace.ToBE())
|
||||
switch (current_outParam.outputColorSpace.data())
|
||||
{
|
||||
case se32(CELL_PNGDEC_RGB):
|
||||
case se32(CELL_PNGDEC_RGBA):
|
||||
|
|
@ -352,11 +352,11 @@ s64 pngDecodeData(
|
|||
case se32(CELL_PNGDEC_GRAYSCALE):
|
||||
case se32(CELL_PNGDEC_PALETTE):
|
||||
case se32(CELL_PNGDEC_GRAYSCALE_ALPHA):
|
||||
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
|
||||
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace);
|
||||
break;
|
||||
|
||||
default:
|
||||
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace.ToLE());
|
||||
cellPngDec->Error("pngDecodeData: Unsupported color space (%d)", current_outParam.outputColorSpace);
|
||||
return CELL_PNGDEC_ERROR_ARG;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -970,11 +970,11 @@ int cellRescSetSrc(s32 idx, vm::ptr<CellRescSrc> src)
|
|||
return CELL_RESC_ERROR_BAD_ARGUMENT;
|
||||
}
|
||||
|
||||
cellResc->Log(" *** format=0x%x", src->format.ToLE());
|
||||
cellResc->Log(" *** pitch=%d", src->pitch.ToLE());
|
||||
cellResc->Log(" *** width=%d", src->width.ToLE());
|
||||
cellResc->Log(" *** height=%d", src->height.ToLE());
|
||||
cellResc->Log(" *** offset=0x%x", src->offset.ToLE());
|
||||
cellResc->Log(" *** format=0x%x", src->format);
|
||||
cellResc->Log(" *** pitch=%d", src->pitch);
|
||||
cellResc->Log(" *** width=%d", src->width);
|
||||
cellResc->Log(" *** height=%d", src->height);
|
||||
cellResc->Log(" *** offset=0x%x", src->offset);
|
||||
|
||||
s_rescInternalInstance->m_rescSrc[idx] = *src;
|
||||
|
||||
|
|
@ -1054,7 +1054,7 @@ int cellRescSetBufferAddress(vm::ptr<u32> colorBuffers, vm::ptr<u32> vertexArray
|
|||
|
||||
for (int i=0; i<GetNumColorBuffers(); i++)
|
||||
{
|
||||
s_rescInternalInstance->m_dstOffsets[i] = dstOffset->ToLE() + i * s_rescInternalInstance->m_dstBufInterval;
|
||||
s_rescInternalInstance->m_dstOffsets[i] = dstOffset.value() + i * s_rescInternalInstance->m_dstBufInterval;
|
||||
}
|
||||
|
||||
for (int i=0; i<GetNumColorBuffers(); i++)
|
||||
|
|
@ -1212,7 +1212,7 @@ int CreateInterlaceTable(u32 ea_addr, float srcH, float dstH, CellRescTableEleme
|
|||
|
||||
int cellRescCreateInterlaceTable(u32 ea_addr, float srcH, CellRescTableElement depth, int length)
|
||||
{
|
||||
cellResc->Warning("cellRescCreateInterlaceTable(ea_addr=0x%x, depth = %i, length = %i)", ea_addr, depth, length);
|
||||
cellResc->Warning("cellRescCreateInterlaceTable(ea_addr=0x%x, srcH=%f, depth=%d, length=%d)", ea_addr, srcH, depth, length);
|
||||
|
||||
if (!s_rescInternalInstance->m_bInitialized)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ int cellRtcFormatRfc2822(vm::ptr<char> pszDateTime, vm::ptr<CellRtcTick> pUtc, s
|
|||
date.Add(tz);
|
||||
|
||||
// Format date string in RFC2822 format (e.g.: Mon, 01 Jan 1990 12:00:00 +0000).
|
||||
const std::string& str = date.Format("%a, %d %b %Y %T %z", rDateTime::TZ::UTC);
|
||||
const std::string str = date.Format("%a, %d %b %Y %T %z", rDateTime::TZ::UTC);
|
||||
memcpy(pszDateTime.get_ptr(), str.c_str(), str.size() + 1);
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -95,7 +95,7 @@ int cellRtcFormatRfc2822LocalTime(vm::ptr<char> pszDateTime, vm::ptr<CellRtcTick
|
|||
rDateTime date = rDateTime((time_t)pUtc->tick);
|
||||
|
||||
// Format date string in RFC2822 format (e.g.: Mon, 01 Jan 1990 12:00:00 +0000).
|
||||
const std::string& str = date.Format("%a, %d %b %Y %T %z", rDateTime::TZ::Local);
|
||||
const std::string str = date.Format("%a, %d %b %Y %T %z", rDateTime::TZ::Local);
|
||||
memcpy(pszDateTime.get_ptr(), str.c_str(), str.size() + 1);
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -113,7 +113,7 @@ int cellRtcFormatRfc3339(vm::ptr<char> pszDateTime, vm::ptr<CellRtcTick> pUtc, s
|
|||
date.Add(tz);
|
||||
|
||||
// Format date string in RFC3339 format (e.g.: 1990-01-01T12:00:00.00Z).
|
||||
const std::string& str = date.Format("%FT%T.%zZ", rDateTime::TZ::UTC);
|
||||
const std::string str = date.Format("%FT%T.%zZ", rDateTime::TZ::UTC);
|
||||
memcpy(pszDateTime.get_ptr(), str.c_str(), str.size() + 1);
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -127,7 +127,7 @@ int cellRtcFormatRfc3339LocalTime(vm::ptr<char> pszDateTime, vm::ptr<CellRtcTick
|
|||
rDateTime date = rDateTime((time_t) pUtc->tick);
|
||||
|
||||
// Format date string in RFC3339 format (e.g.: 1990-01-01T12:00:00.00Z).
|
||||
const std::string& str = date.Format("%FT%T.%zZ", rDateTime::TZ::Local);
|
||||
const std::string str = date.Format("%FT%T.%zZ", rDateTime::TZ::Local);
|
||||
memcpy(pszDateTime.get_ptr(), str.c_str(), str.size() + 1);
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -163,7 +163,7 @@ int cellRtcGetTick(vm::ptr<CellRtcDateTime> pTime, vm::ptr<CellRtcTick> pTick)
|
|||
{
|
||||
cellRtc->Log("cellRtcGetTick(pTime=0x%x, pTick=0x%x)", pTime.addr(), pTick.addr());
|
||||
|
||||
rDateTime datetime = rDateTime(pTime->day, (rDateTime::Month)pTime->month.ToLE(), pTime->year, pTime->hour, pTime->minute, pTime->second, (pTime->microsecond / 1000));
|
||||
rDateTime datetime = rDateTime(pTime->day, (rDateTime::Month)pTime->month.value(), pTime->year, pTime->hour, pTime->minute, pTime->second, (pTime->microsecond / 1000));
|
||||
pTick->tick = datetime.GetTicks();
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -315,7 +315,7 @@ int cellRtcGetDosTime(vm::ptr<CellRtcDateTime> pDateTime, vm::ptr<u32> puiDosTim
|
|||
cellRtc->Log("cellRtcGetDosTime(pDateTime=0x%x, puiDosTime=0x%x)", pDateTime.addr(), puiDosTime.addr());
|
||||
|
||||
// Convert to DOS time.
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.ToLE(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.value(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
*puiDosTime = date_time.GetAsDOS();
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -326,7 +326,7 @@ int cellRtcGetTime_t(vm::ptr<CellRtcDateTime> pDateTime, vm::ptr<s64> piTime)
|
|||
cellRtc->Log("cellRtcGetTime_t(pDateTime=0x%x, piTime=0x%x)", pDateTime.addr(), piTime.addr());
|
||||
|
||||
// Convert to POSIX time_t.
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.ToLE(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.value(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
*piTime = convertToUNIXTime(date_time.GetSecond(rDateTime::TZ::UTC), date_time.GetMinute(rDateTime::TZ::UTC),
|
||||
date_time.GetHour(rDateTime::TZ::UTC), date_time.GetDay(rDateTime::TZ::UTC), date_time.GetYear(rDateTime::TZ::UTC));
|
||||
|
||||
|
|
@ -338,7 +338,7 @@ int cellRtcGetWin32FileTime(vm::ptr<CellRtcDateTime> pDateTime, vm::ptr<u64> pul
|
|||
cellRtc->Log("cellRtcGetWin32FileTime(pDateTime=0x%x, pulWin32FileTime=0x%x)", pDateTime.addr(), pulWin32FileTime.addr());
|
||||
|
||||
// Convert to WIN32 FILETIME.
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.ToLE(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
rDateTime date_time = rDateTime(pDateTime->day, (rDateTime::Month)pDateTime->month.value(), pDateTime->year, pDateTime->hour, pDateTime->minute, pDateTime->second, (pDateTime->microsecond / 1000));
|
||||
*pulWin32FileTime = convertToWin32FILETIME(date_time.GetSecond(rDateTime::TZ::UTC), date_time.GetMinute(rDateTime::TZ::UTC),
|
||||
date_time.GetHour(rDateTime::TZ::UTC), date_time.GetDay(rDateTime::TZ::UTC), date_time.GetYear(rDateTime::TZ::UTC));
|
||||
|
||||
|
|
@ -382,7 +382,7 @@ int cellRtcSetTime_t(vm::ptr<CellRtcDateTime> pDateTime, u64 iTime)
|
|||
|
||||
int cellRtcSetWin32FileTime(vm::ptr<CellRtcDateTime> pDateTime, u64 ulWin32FileTime)
|
||||
{
|
||||
cellRtc->Log("cellRtcSetWin32FileTime(pDateTime=0x%x, ulWin32FileTime=0x%llx)", pDateTime, ulWin32FileTime);
|
||||
cellRtc->Log("cellRtcSetWin32FileTime(pDateTime_addr=0x%x, ulWin32FileTime=0x%llx)", pDateTime.addr(), ulWin32FileTime);
|
||||
|
||||
rDateTime date_time = rDateTime((time_t)ulWin32FileTime);
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ int cellSailDescriptorIsAutoSelection(vm::ptr<CellSailDescriptor> pSelf)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSailDescriptorCreateDatabase(vm::ptr<CellSailDescriptor> pSelf, vm::ptr<void> pDatabase, be_t<u32> size, be_t<u64> arg)
|
||||
int cellSailDescriptorCreateDatabase(vm::ptr<CellSailDescriptor> pSelf, vm::ptr<void> pDatabase, u32 size, u64 arg)
|
||||
{
|
||||
cellSail->Warning("cellSailDescriptorCreateDatabase(pSelf=0x%x, pDatabase=0x%x, size=0x%x, arg=0x%x", pSelf.addr(), pDatabase.addr(), size, arg);
|
||||
|
||||
|
|
@ -825,7 +825,7 @@ int cellSailPlayerIsPaused(vm::ptr<CellSailPlayer> pSelf)
|
|||
|
||||
int cellSailPlayerSetRepeatMode(vm::ptr<CellSailPlayer> pSelf, s32 repeatMode, vm::ptr<CellSailStartCommand> pCommand)
|
||||
{
|
||||
cellSail->Warning("cellSailPlayerSetRepeatMode(pSelf_addr=0x%x, repeatMode=%i, pCommand_addr=0x%x)", pSelf.addr(), repeatMode, pCommand.addr());
|
||||
cellSail->Warning("cellSailPlayerSetRepeatMode(pSelf_addr=0x%x, repeatMode=%d, pCommand_addr=0x%x)", pSelf.addr(), repeatMode, pCommand.addr());
|
||||
|
||||
pSelf->repeatMode = repeatMode;
|
||||
pSelf->playbackCommand = pCommand;
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ void getSaveDataStat(SaveDataEntry entry, vm::ptr<CellSaveDataStatGet> statGet)
|
|||
strcpy_trunc(statGet->getParam.listParam, entry.listParam);
|
||||
|
||||
statGet->fileNum = 0;
|
||||
statGet->fileList.set(be_t<u32>::make(0));
|
||||
statGet->fileList.set(0);
|
||||
statGet->fileListNum = 0;
|
||||
std::string saveDir = "/dev_hdd0/home/00000001/savedata/" + entry.dirName; // TODO: Get the path of the current user
|
||||
vfsDir dir(saveDir);
|
||||
|
|
@ -242,7 +242,7 @@ void getSaveDataStat(SaveDataEntry entry, vm::ptr<CellSaveDataStatGet> statGet)
|
|||
}
|
||||
}
|
||||
|
||||
statGet->fileList = vm::ptr<CellSaveDataFileStat>::make((u32)Memory.Alloc(sizeof(CellSaveDataFileStat) * fileEntries.size(), 8));
|
||||
statGet->fileList.set((u32)Memory.Alloc(sizeof(CellSaveDataFileStat) * fileEntries.size(), 8));
|
||||
for (u32 i = 0; i < fileEntries.size(); i++) {
|
||||
CellSaveDataFileStat *dst = &statGet->fileList[i];
|
||||
memcpy(dst, &fileEntries[i], sizeof(CellSaveDataFileStat));
|
||||
|
|
@ -306,7 +306,7 @@ s32 modifySaveDataFiles(vm::ptr<CellSaveDataFileCallback> funcFile, vm::ptr<Cell
|
|||
break;
|
||||
|
||||
case CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC:
|
||||
cellSysutil->Warning("modifySaveDataFiles: File operation CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC not yet implemented");
|
||||
cellSysutil->Todo("modifySaveDataFiles: CELL_SAVEDATA_FILEOP_WRITE_NOTRUNC");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -317,16 +317,22 @@ s32 modifySaveDataFiles(vm::ptr<CellSaveDataFileCallback> funcFile, vm::ptr<Cell
|
|||
if (file && file->IsOpened())
|
||||
file->Close();
|
||||
}
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
// Functions
|
||||
int cellSaveDataListSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataListSave2(
|
||||
u32 version,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataListSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataListSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
|
|
@ -360,8 +366,8 @@ int cellSaveDataListSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
|||
|
||||
// Sort the entries and fill the listGet->dirList array
|
||||
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
|
||||
listGet->dirList = vm::bptr<CellSaveDataDirList>::make(setBuf->buf.addr());
|
||||
auto dirList = vm::get_ptr<CellSaveDataDirList>(listGet->dirList.addr());
|
||||
listGet->dirList.set(setBuf->buf.addr());
|
||||
auto dirList = listGet->dirList.get_ptr();
|
||||
|
||||
for (u32 i=0; i<saveEntries.size(); i++) {
|
||||
strcpy_trunc(dirList[i].dirName, saveEntries[i].dirName);
|
||||
|
|
@ -376,12 +382,12 @@ int cellSaveDataListSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
|||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
|
||||
setSaveDataList(saveEntries, vm::ptr<CellSaveDataDirList>::make(listSet->fixedList.addr()), listSet->fixedListNum);
|
||||
setSaveDataList(saveEntries, listSet->fixedList.to_le(), listSet->fixedListNum);
|
||||
if (listSet->newData)
|
||||
addNewSaveDataEntry(saveEntries, vm::ptr<CellSaveDataListNewData>::make(listSet->newData.addr()));
|
||||
addNewSaveDataEntry(saveEntries, listSet->newData.to_le());
|
||||
if (saveEntries.size() == 0) {
|
||||
cellSysutil->Warning("cellSaveDataListSave2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Error("cellSaveDataListSave2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
|
||||
|
|
@ -407,11 +413,17 @@ int cellSaveDataListSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int cellSaveDataListLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataListLoad2(
|
||||
u32 version,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataListLoad2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataListLoad2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
|
|
@ -446,8 +458,8 @@ int cellSaveDataListLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
|||
|
||||
// Sort the entries and fill the listGet->dirList array
|
||||
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
|
||||
listGet->dirList = vm::bptr<CellSaveDataDirList>::make(setBuf->buf.addr());
|
||||
auto dirList = vm::get_ptr<CellSaveDataDirList>(listGet->dirList.addr());
|
||||
listGet->dirList.set(setBuf->buf.addr());
|
||||
auto dirList = listGet->dirList.get_ptr();
|
||||
|
||||
for (u32 i=0; i<saveEntries.size(); i++) {
|
||||
strcpy_trunc(dirList[i].dirName, saveEntries[i].dirName);
|
||||
|
|
@ -462,12 +474,12 @@ int cellSaveDataListLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
|||
return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
}
|
||||
|
||||
setSaveDataList(saveEntries, vm::ptr<CellSaveDataDirList>::make(listSet->fixedList.addr()), listSet->fixedListNum);
|
||||
setSaveDataList(saveEntries, listSet->fixedList.to_le(), listSet->fixedListNum);
|
||||
if (listSet->newData)
|
||||
addNewSaveDataEntry(saveEntries, vm::ptr<CellSaveDataListNewData>::make(listSet->newData.addr()));
|
||||
addNewSaveDataEntry(saveEntries, listSet->newData.to_le());
|
||||
if (saveEntries.size() == 0) {
|
||||
cellSysutil->Warning("cellSaveDataListLoad2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Error("cellSaveDataListLoad2: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
|
||||
|
|
@ -493,11 +505,17 @@ int cellSaveDataListLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataFixedSave2(
|
||||
u32 version,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataFixedSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataFixedSave2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
|
|
@ -530,8 +548,8 @@ int cellSaveDataFixedSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, v
|
|||
|
||||
// Sort the entries and fill the listGet->dirList array
|
||||
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
|
||||
listGet->dirList = vm::bptr<CellSaveDataDirList>::make(setBuf->buf.addr());
|
||||
auto dirList = vm::get_ptr<CellSaveDataDirList>(listGet->dirList.addr());
|
||||
listGet->dirList.set(setBuf->buf.addr());
|
||||
auto dirList = listGet->dirList.get_ptr();
|
||||
for (u32 i = 0; i<saveEntries.size(); i++) {
|
||||
strcpy_trunc(dirList[i].dirName, saveEntries[i].dirName);
|
||||
strcpy_trunc(dirList[i].listParam, saveEntries[i].listParam);
|
||||
|
|
@ -563,11 +581,17 @@ int cellSaveDataFixedSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, v
|
|||
return ret;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataFixedLoad2(
|
||||
u32 version,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataFixedLoad2(version=%d, setList_addr=0x%x, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataFixedLoad2(version=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
|
|
@ -600,8 +624,8 @@ int cellSaveDataFixedLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, v
|
|||
|
||||
// Sort the entries and fill the listGet->dirList array
|
||||
std::sort(saveEntries.begin(), saveEntries.end(), sortSaveDataEntry(setList->sortType, setList->sortOrder));
|
||||
listGet->dirList = vm::bptr<CellSaveDataDirList>::make(setBuf->buf.addr());
|
||||
auto dirList = vm::get_ptr<CellSaveDataDirList>(listGet->dirList.addr());
|
||||
listGet->dirList.set(setBuf->buf.addr());
|
||||
auto dirList = listGet->dirList.get_ptr();
|
||||
for (u32 i = 0; i<saveEntries.size(); i++) {
|
||||
strcpy_trunc(dirList[i].dirName, saveEntries[i].dirName);
|
||||
strcpy_trunc(dirList[i].listParam, saveEntries[i].listParam);
|
||||
|
|
@ -633,11 +657,17 @@ int cellSaveDataFixedLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, v
|
|||
return ret;
|
||||
}
|
||||
|
||||
int cellSaveDataAutoSave2(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataAutoSave2(
|
||||
u32 version,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataAutoSave2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataAutoSave2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, dirName.addr(), errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
|
|
@ -685,14 +715,20 @@ int cellSaveDataAutoSave2(u32 version, vm::ptr<const char> dirName, u32 errDialo
|
|||
// Enter the loop where the save files are read/created/deleted.
|
||||
s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
|
||||
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataAutoLoad2(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataAutoLoad2(
|
||||
u32 version,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Warning("cellSaveDataAutoLoad2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Warning("cellSaveDataAutoLoad2(version=%d, dirName_addr=0x%x, errDialog=%d, setBuf_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, dirName.addr(), errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
vm::var<CellSaveDataCBResult> result;
|
||||
|
|
@ -715,7 +751,7 @@ int cellSaveDataAutoLoad2(u32 version, vm::ptr<const char> dirName, u32 errDialo
|
|||
|
||||
// The target entry does not exist
|
||||
if (saveEntries.size() == 0) {
|
||||
cellSysutil->Warning("cellSaveDataAutoLoad2: Couldn't find save entry (%s)", dirN.c_str());
|
||||
cellSysutil->Error("cellSaveDataAutoLoad2: Couldn't find save entry (%s)", dirN.c_str());
|
||||
return CELL_OK; // TODO: Can anyone check the actual behaviour of a PS3 when saves are not found?
|
||||
}
|
||||
|
||||
|
|
@ -735,13 +771,21 @@ int cellSaveDataAutoLoad2(u32 version, vm::ptr<const char> dirName, u32 errDialo
|
|||
// Enter the loop where the save files are read/created/deleted.
|
||||
s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
|
||||
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataListAutoSave(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataListAutoSave(
|
||||
u32 version,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataListAutoSave(version=%d, errDialog=%d, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
cellSysutil->Todo("cellSaveDataListAutoSave(version=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
//vm::var<CellSaveDataCBResult> result;
|
||||
|
|
@ -792,19 +836,10 @@ int cellSaveDataListAutoSave(u32 version, u32 errDialog, vm::ptr<CellSaveDataSet
|
|||
// return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
//}
|
||||
|
||||
//setSaveDataList(saveEntries, (u32)listSet->fixedList.addr(), listSet->fixedListNum);
|
||||
//if (listSet->newData)
|
||||
// addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr());
|
||||
//if (saveEntries.size() == 0) {
|
||||
// cellSysutil->Warning("cellSaveDataListAutoSave: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
// return CELL_SAVEDATA_RET_OK;
|
||||
//}
|
||||
|
||||
//u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
|
||||
//// TODO: Display the dialog here
|
||||
//u32 selectedIndex = focusIndex; // TODO: Until the dialog is implemented, select always the focused entry
|
||||
//getSaveDataStat(saveEntries[selectedIndex], statGet.addr());
|
||||
//result->userdata_addr = userdata_addr;
|
||||
//setSaveDataFixed(saveEntries, fixedSet);
|
||||
//getSaveDataStat(saveEntries[0], statGet); // There should be only one element in this list
|
||||
//// TODO: Display the Yes|No dialog here
|
||||
//result->userdata = userdata;
|
||||
|
||||
//funcStat(result, statGet, statSet);
|
||||
//Memory.Free(statGet->fileList.addr());
|
||||
|
|
@ -814,19 +849,27 @@ int cellSaveDataListAutoSave(u32 version, u32 errDialog, vm::ptr<CellSaveDataSet
|
|||
//}
|
||||
|
||||
///*if (statSet->setParam)
|
||||
//addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr()); // TODO: This *is* wrong
|
||||
//// TODO: Write PARAM.SFO file
|
||||
//*/
|
||||
|
||||
//// Enter the loop where the save files are read/created/deleted.
|
||||
//s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataListAutoLoad(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata)
|
||||
s32 cellSaveDataListAutoLoad(
|
||||
u32 version,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataListAutoLoad(version=%d, errDialog=%d, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
version, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
cellSysutil->Todo("cellSaveDataListAutoLoad(version=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
//vm::var<CellSaveDataCBResult> result;
|
||||
//vm::var<CellSaveDataListGet> listGet;
|
||||
|
|
@ -876,193 +919,411 @@ int cellSaveDataListAutoLoad(u32 version, u32 errDialog, vm::ptr<CellSaveDataSet
|
|||
// return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
//}
|
||||
|
||||
//setSaveDataList(saveEntries, (u32)listSet->fixedList.addr(), listSet->fixedListNum);
|
||||
//if (listSet->newData)
|
||||
// addNewSaveDataEntry(saveEntries, (u32)listSet->newData.addr());
|
||||
//if (saveEntries.size() == 0) {
|
||||
// cellSysutil->Warning("cellSaveDataListAutoLoad: No save entries found!"); // TODO: Find a better way to handle this error
|
||||
// return CELL_SAVEDATA_RET_OK;
|
||||
//}
|
||||
//setSaveDataFixed(saveEntries, fixedSet);
|
||||
//getSaveDataStat(saveEntries[0], statGet); // There should be only one element in this list
|
||||
//// TODO: Display the Yes|No dialog here
|
||||
//result->userdata = userdata;
|
||||
|
||||
//u32 focusIndex = focusSaveDataEntry(saveEntries, listSet->focusPosition);
|
||||
//// TODO: Display the dialog here
|
||||
//u32 selectedIndex = focusIndex; // TODO: Until the dialog is implemented, select always the focused entry
|
||||
//getSaveDataStat(saveEntries[selectedIndex], statGet.addr());
|
||||
//result->userdata_addr = userdata_addr;
|
||||
|
||||
//funcStat(result.addr(), statGet.addr(), statSet.addr());
|
||||
//funcStat(result, statGet, statSet);
|
||||
//Memory.Free(statGet->fileList.addr());
|
||||
|
||||
//if (result->result < 0) {
|
||||
// cellSysutil->Error("cellSaveDataListAutoLoad: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
// cellSysutil->Error("cellSaveDataFixedLoad2: CellSaveDataStatCallback failed."); // TODO: Once we verify that the entire SysCall is working, delete this debug error message.
|
||||
// return CELL_SAVEDATA_ERROR_CBRESULT;
|
||||
//}
|
||||
|
||||
///*if (statSet->setParam)
|
||||
//// TODO: Write PARAM.SFO file
|
||||
//*/
|
||||
|
||||
//// Enter the loop where the save files are read/created/deleted.
|
||||
//s32 ret = modifySaveDataFiles(funcFile, result, saveBaseDir + (char*)statGet->dir.dirName);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataDelete2(u32 container)
|
||||
s32 cellSaveDataDelete2(u32 container)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataDelete2(container=0x%x)", container);
|
||||
cellSysutil->Todo("cellSaveDataDelete2(container=%d)", container);
|
||||
|
||||
return CELL_SAVEDATA_RET_CANCEL;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedDelete(vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataFixedDelete(
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataFixedDelete(setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcDone=0x%x, container=0x%x, userdata_addr=0x%x)", setList.addr(), setBuf.addr(), funcFixed.addr(),
|
||||
funcDone.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataFixedDelete(setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcDone_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
setList.addr(), setBuf.addr(), funcFixed.addr(), funcDone.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListSave(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserListSave(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserListSave(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserListSave(version=%d, userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListLoad(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserListLoad(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserListLoad(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcList=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserListLoad(version=%d, userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcList_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, setList.addr(), setBuf.addr(), funcList.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedSave(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserFixedSave(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserFixedSave(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserFixedSave(version=%d, userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedLoad(u32 version, u32 userId, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserFixedLoad(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserFixedLoad(version=%d, userId=%d, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserFixedLoad(version=%d, userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserAutoSave(u32 version, u32 userId, u32 dirName_addr, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserAutoSave(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserAutoSave(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, dirName_addr, errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserAutoSave(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf_addr=0x%x, funcStat_addr=0x%x, funcFile=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, dirName.addr(), errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserAutoLoad(u32 version, u32 userId, u32 dirName_addr, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserAutoLoad(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserAutoLoad(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)", version,
|
||||
userId, dirName_addr, errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserAutoLoad(version=%d, userId=%d, dirName_addr=0x%x, errDialog=%d, setBuf_addr=0x%x, funcStat_addr=0x%x, funcFile=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, dirName.addr(), errDialog, setBuf.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListAutoSave(u32 version, u32 userId, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserListAutoSave(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserListAutoSave(version=%d, userId=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListAutoLoad(u32 version, u32 userId, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, u32 userdata_addr)
|
||||
s32 cellSaveDataUserListAutoLoad(
|
||||
u32 version,
|
||||
u32 userId,
|
||||
u32 errDialog,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat,
|
||||
vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%D, setList=0x%x, setBuf=0x%x, funcFixed=0x%x, funcStat=0x%x, funcFile=0x%x, container=0x%x, userdata_addr=0x%x)",
|
||||
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata_addr);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserListAutoLoad(version=%d, userId=%d, errDialog=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcStat_addr=0x%x, funcFile_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
version, userId, errDialog, setList.addr(), setBuf.addr(), funcFixed.addr(), funcStat.addr(), funcFile.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedDelete() //CellSysutilUserId userId, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataFixedCallback funcFixed, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserFixedDelete(
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
cellSysutil->Todo("cellSaveDataUserFixedDelete(userId=%d, setList_addr=0x%x, setBuf_addr=0x%x, funcFixed_addr=0x%x, funcDone_addr=0x%x, container=%d, userdata_addr=0x%x)",
|
||||
userId, setList.addr(), setBuf.addr(), funcFixed.addr(), funcDone.addr(), container, userdata.addr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
//void cellSaveDataEnableOverlay(); //int enable
|
||||
void cellSaveDataEnableOverlay(s32 enable)
|
||||
{
|
||||
cellSysutil->Todo("cellSaveDataEnableOverlay(enable=%d)", enable);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Functions (Extensions)
|
||||
int cellSaveDataListDelete() //CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataListCallback funcList, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataListDelete(
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataListImport() //CellSaveDataSetList *setList, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataListImport(
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataListExport() //CellSaveDataSetList *setList, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataListExport(
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedImport() //const char *dirName, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataFixedImport(
|
||||
vm::ptr<const char> dirName,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataFixedExport() //const char *dirName, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataFixedExport(
|
||||
vm::ptr<const char> dirName,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataGetListItem() //const char *dirName, CellSaveDataDirStat *dir, CellSaveDataSystemFileParam *sysFileParam, vm::ptr<u32> bind, vm::ptr<u32> sizeKB
|
||||
s32 cellSaveDataGetListItem(
|
||||
vm::ptr<const char> dirName,
|
||||
vm::ptr<CellSaveDataDirStat> dir,
|
||||
vm::ptr<CellSaveDataSystemFileParam> sysFileParam,
|
||||
vm::ptr<u32> bind,
|
||||
vm::ptr<u32> sizeKB)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListDelete() //CellSysutilUserId userId, CellSaveDataSetList *setList, CellSaveDataSetBuf *setBuf, CellSaveDataListCallback funcList, CellSaveDataDoneCallback funcDone,sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserListDelete(
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListImport() //CellSysutilUserId userId, CellSaveDataSetList *setList, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserListImport(
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserListExport() //CellSysutilUserId userId, CellSaveDataSetList *setList, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserListExport(
|
||||
u32 userId,
|
||||
vm::ptr<CellSaveDataSetList> setList,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedImport() //CellSysutilUserId userId, const char *dirName, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserFixedImport(
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserFixedExport() //CellSysutilUserId userId, const char *dirName, u32 maxSizeKB, CellSaveDataDoneCallback funcDone, sys_memory_container_t container, void *userdata
|
||||
s32 cellSaveDataUserFixedExport(
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
u32 maxSizeKB,
|
||||
vm::ptr<CellSaveDataDoneCallback> funcDone,
|
||||
u32 container,
|
||||
vm::ptr<void> userdata)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSaveDataUserGetListItem() //CellSysutilUserId userId, const char *dirName, CellSaveDataDirStat *dir, CellSaveDataSystemFileParam *sysFileParam, vm::ptr<u32> bind, vm::ptr<u32> sizeKB
|
||||
s32 cellSaveDataUserGetListItem(
|
||||
u32 userId,
|
||||
vm::ptr<const char> dirName,
|
||||
vm::ptr<CellSaveDataDirStat> dir,
|
||||
vm::ptr<CellSaveDataSystemFileParam> sysFileParam,
|
||||
vm::ptr<u32> bind,
|
||||
vm::ptr<u32> sizeKB)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
return CELL_SAVEDATA_RET_OK;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
void cellSysutil_SaveData_init()
|
||||
{
|
||||
// libsysutil functions:
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataEnableOverlay);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataDelete2);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataDelete);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedDelete);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedDelete);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedSave);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedLoad2);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedSave2);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataFixedLoad);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataFixedSave);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListSave);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListLoad2);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListSave2);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataListLoad);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataListSave);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListAutoLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListAutoSave);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListAutoLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListAutoSave);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserAutoLoad);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserAutoSave);
|
||||
REG_FUNC(cellSysutil, cellSaveDataAutoLoad2);
|
||||
REG_FUNC(cellSysutil, cellSaveDataAutoSave2);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataAutoLoad);
|
||||
//REG_FUNC(cellSysutil, cellSaveDataAutoSave);
|
||||
|
||||
// libsysutil_savedata functions:
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserGetListItem);
|
||||
REG_FUNC(cellSysutil, cellSaveDataGetListItem);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListDelete);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListDelete);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedExport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserFixedImport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListExport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataUserListImport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedExport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataFixedImport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListExport);
|
||||
REG_FUNC(cellSysutil, cellSaveDataListImport);
|
||||
|
||||
// libsysutil_savedata_psp functions:
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,10 +257,10 @@ struct CellSaveDataDoneGet
|
|||
|
||||
// Callback Functions
|
||||
typedef void(*CellSaveDataFixedCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataListGet> get, vm::ptr<CellSaveDataFixedSet> set);
|
||||
typedef void(*CellSaveDataListCallback) (vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataListGet> get, vm::ptr<CellSaveDataListSet> set);
|
||||
typedef void(*CellSaveDataStatCallback) (vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataStatGet> get, vm::ptr<CellSaveDataStatSet> set);
|
||||
typedef void(*CellSaveDataFileCallback) (vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataFileGet> get, vm::ptr<CellSaveDataFileSet> set);
|
||||
typedef void(*CellSaveDataDoneCallback) (vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataDoneGet> get);
|
||||
typedef void(*CellSaveDataListCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataListGet> get, vm::ptr<CellSaveDataListSet> set);
|
||||
typedef void(*CellSaveDataStatCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataStatGet> get, vm::ptr<CellSaveDataStatSet> set);
|
||||
typedef void(*CellSaveDataFileCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataFileGet> get, vm::ptr<CellSaveDataFileSet> set);
|
||||
typedef void(*CellSaveDataDoneCallback)(vm::ptr<CellSaveDataCBResult> cbResult, vm::ptr<CellSaveDataDoneGet> get);
|
||||
|
||||
|
||||
// Auxiliary Structs
|
||||
|
|
@ -279,35 +279,3 @@ struct SaveDataEntry
|
|||
u32 iconBufSize;
|
||||
bool isNew;
|
||||
};
|
||||
|
||||
|
||||
// Function declarations
|
||||
int cellSaveDataListSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataListLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataListCallback> funcList, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataFixedSave2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataFixedLoad2(u32 version, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataFixedCallback> funcFixed, vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataAutoSave2(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataAutoLoad2(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm::ptr<CellSaveDataSetBuf> setBuf,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile,
|
||||
u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataListAutoSave(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata);
|
||||
|
||||
int cellSaveDataListAutoLoad(u32 version, u32 errDialog, vm::ptr<CellSaveDataSetList> setList, vm::ptr<CellSaveDataSetBuf> setBuf, vm::ptr<CellSaveDataFixedCallback> funcFixed,
|
||||
vm::ptr<CellSaveDataStatCallback> funcStat, vm::ptr<CellSaveDataFileCallback> funcFile, u32 container, vm::ptr<void> userdata);
|
||||
|
|
@ -34,7 +34,7 @@ s64 spursCreateLv2EventQueue(vm::ptr<CellSpurs> spurs, u32& queue_id, vm::ptr<u8
|
|||
vm::var<be_t<u32>> queue;
|
||||
s32 res = cb_call<s32, vm::ptr<CellSpurs>, vm::ptr<u32>, vm::ptr<u8>, s32, u32>(GetCurrentPPUThread(), libsre + 0xB14C, libsre_rtoc,
|
||||
spurs, queue, port, size, vm::read32(libsre_rtoc - 0x7E2C));
|
||||
queue_id = queue->ToLE();
|
||||
queue_id = queue;
|
||||
return res;
|
||||
#endif
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ s64 spursInit(
|
|||
{
|
||||
#ifdef PRX_DEBUG_XXX
|
||||
return cb_call<s32, vm::ptr<CellSpurs>, u32, u32, s32, s32, s32, u32, u32, u32, u32, u32, u32, u32>(GetCurrentPPUThread(), libsre + 0x74E4, libsre_rtoc,
|
||||
spurs, revision, sdkVersion, nSpus, spuPriority, ppuPriority, flags, Memory.RealToVirtualAddr(prefix), prefixSize, container, Memory.RealToVirtualAddr(swlPriority), swlMaxSpu, swlIsPreem);
|
||||
spurs, revision, sdkVersion, nSpus, spuPriority, ppuPriority, flags, vm::get_addr(prefix), prefixSize, container, vm::get_addr(swlPriority), swlMaxSpu, swlIsPreem);
|
||||
#endif
|
||||
|
||||
// SPURS initialization (asserts should actually rollback and return the error instead)
|
||||
|
|
@ -273,7 +273,7 @@ s64 spursInit(
|
|||
if (Emu.IsStopped()) break;
|
||||
|
||||
spurs->m.xD64.exchange(0);
|
||||
if (spurs->m.exception.ToBE() == 0)
|
||||
if (spurs->m.exception.data() == 0)
|
||||
{
|
||||
bool do_break = false;
|
||||
for (u32 i = 0; i < 16; i++)
|
||||
|
|
@ -397,7 +397,7 @@ s64 spursInit(
|
|||
s32 res = CELL_OK;
|
||||
#ifdef PRX_DEBUG
|
||||
res = cb_call<s32, vm::ptr<CellSpurs>, u32, u32, u32>(GetCurrentPPUThread(), libsre + 0x10428, libsre_rtoc,
|
||||
spurs, Memory.RealToVirtualAddr(swlPriority), swlMaxSpu, swlIsPreem);
|
||||
spurs, vm::get_addr(swlPriority), swlMaxSpu, swlIsPreem);
|
||||
#endif
|
||||
assert(res == CELL_OK);
|
||||
}
|
||||
|
|
@ -460,7 +460,7 @@ s64 cellSpursInitializeWithAttribute(vm::ptr<CellSpurs> spurs, vm::ptr<const Cel
|
|||
attr->m.nSpus,
|
||||
attr->m.spuPriority,
|
||||
attr->m.ppuPriority,
|
||||
attr->m.flags.ToLE() | (attr->m.exitIfNoWork ? SAF_EXIT_IF_NO_WORK : 0),
|
||||
attr->m.flags | (attr->m.exitIfNoWork ? SAF_EXIT_IF_NO_WORK : 0),
|
||||
attr->m.prefix,
|
||||
attr->m.prefixSize,
|
||||
attr->m.container,
|
||||
|
|
@ -496,7 +496,7 @@ s64 cellSpursInitializeWithAttribute2(vm::ptr<CellSpurs> spurs, vm::ptr<const Ce
|
|||
attr->m.nSpus,
|
||||
attr->m.spuPriority,
|
||||
attr->m.ppuPriority,
|
||||
attr->m.flags.ToLE() | (attr->m.exitIfNoWork ? SAF_EXIT_IF_NO_WORK : 0) | SAF_SECOND_VERSION,
|
||||
attr->m.flags | (attr->m.exitIfNoWork ? SAF_EXIT_IF_NO_WORK : 0) | SAF_SECOND_VERSION,
|
||||
attr->m.prefix,
|
||||
attr->m.prefixSize,
|
||||
attr->m.container,
|
||||
|
|
@ -548,7 +548,7 @@ s64 cellSpursAttributeSetMemoryContainerForSpuThread(vm::ptr<CellSpursAttribute>
|
|||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
if (attr->m.flags.ToLE() & SAF_SPU_TGT_EXCLUSIVE_NON_CONTEXT)
|
||||
if (attr->m.flags & SAF_SPU_TGT_EXCLUSIVE_NON_CONTEXT)
|
||||
{
|
||||
return CELL_SPURS_CORE_ERROR_STAT;
|
||||
}
|
||||
|
|
@ -622,7 +622,7 @@ s64 cellSpursAttributeSetSpuThreadGroupType(vm::ptr<CellSpursAttribute> attr, s3
|
|||
|
||||
if (type == SYS_SPU_THREAD_GROUP_TYPE_EXCLUSIVE_NON_CONTEXT)
|
||||
{
|
||||
if (attr->m.flags.ToLE() & SAF_SPU_MEMORY_CONTAINER_SET)
|
||||
if (attr->m.flags & SAF_SPU_MEMORY_CONTAINER_SET)
|
||||
{
|
||||
return CELL_SPURS_CORE_ERROR_STAT;
|
||||
}
|
||||
|
|
@ -673,7 +673,7 @@ s64 cellSpursAttributeEnableSystemWorkload(vm::ptr<CellSpursAttribute> attr, vm:
|
|||
{
|
||||
return CELL_SPURS_CORE_ERROR_PERM;
|
||||
}
|
||||
if (attr->m.flags.ToLE() & SAF_SYSTEM_WORKLOAD_ENABLED)
|
||||
if (attr->m.flags & SAF_SYSTEM_WORKLOAD_ENABLED)
|
||||
{
|
||||
return CELL_SPURS_CORE_ERROR_BUSY;
|
||||
}
|
||||
|
|
@ -737,7 +737,7 @@ s64 spursAttachLv2EventQueue(vm::ptr<CellSpurs> spurs, u32 queue, vm::ptr<u8> po
|
|||
{
|
||||
return CELL_SPURS_CORE_ERROR_ALIGN;
|
||||
}
|
||||
if (spurs->m.exception.ToBE())
|
||||
if (spurs->m.exception.data())
|
||||
{
|
||||
return CELL_SPURS_CORE_ERROR_STAT;
|
||||
}
|
||||
|
|
@ -977,7 +977,7 @@ s64 spursWakeUp(PPUThread& CPU, vm::ptr<CellSpurs> spurs)
|
|||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_ALIGN;
|
||||
}
|
||||
if (spurs->m.exception.ToBE())
|
||||
if (spurs->m.exception.data())
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_STAT;
|
||||
}
|
||||
|
|
@ -1024,7 +1024,7 @@ s32 spursAddWorkload(
|
|||
{
|
||||
#ifdef PRX_DEBUG_XXX
|
||||
return cb_call<s32, vm::ptr<CellSpurs>, vm::ptr<u32>, vm::ptr<const void>, u32, u64, u32, u32, u32, u32, u32, u32, u32>(GetCurrentPPUThread(), libsre + 0x96EC, libsre_rtoc,
|
||||
spurs, wid, pm, size, data, Memory.RealToVirtualAddr(priorityTable), minContention, maxContention,
|
||||
spurs, wid, pm, size, data, vm::get_addr(priorityTable), minContention, maxContention,
|
||||
nameClass.addr(), nameInstance.addr(), hook.addr(), hookArg.addr());
|
||||
#endif
|
||||
|
||||
|
|
@ -1040,7 +1040,7 @@ s32 spursAddWorkload(
|
|||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_INVAL;
|
||||
}
|
||||
if (spurs->m.exception.ToBE())
|
||||
if (spurs->m.exception.data())
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_STAT;
|
||||
}
|
||||
|
|
@ -1146,7 +1146,7 @@ s32 spursAddWorkload(
|
|||
CellSpurs::WorkloadInfo& wkl = wnum <= 15 ? spurs->m.wklInfo1[wnum] : spurs->m.wklInfo2[wnum & 0xf];
|
||||
spurs->m.wklMskB.atomic_op_sync([spurs, &wkl, wnum, &res_wkl](be_t<u32>& v)
|
||||
{
|
||||
const u32 mask = v.ToLE() & ~(0x80000000u >> wnum);
|
||||
const u32 mask = v & ~(0x80000000u >> wnum);
|
||||
res_wkl = 0;
|
||||
|
||||
for (u32 i = 0, m = 0x80000000, k = 0; i < 32; i++, m >>= 1)
|
||||
|
|
@ -1389,11 +1389,11 @@ s64 _cellSpursWorkloadFlagReceiver(vm::ptr<CellSpurs> spurs, u32 wid, u32 is_set
|
|||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_INVAL;
|
||||
}
|
||||
if ((spurs->m.wklMskA.read_relaxed().ToLE() & (0x80000000u >> wid)) == 0)
|
||||
if ((spurs->m.wklMskA.read_relaxed() & (0x80000000u >> wid)) == 0)
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_SRCH;
|
||||
}
|
||||
if (spurs->m.exception.ToBE())
|
||||
if (spurs->m.exception.data())
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_STAT;
|
||||
}
|
||||
|
|
@ -1456,7 +1456,7 @@ s64 cellSpursGetWorkloadFlag(vm::ptr<CellSpurs> spurs, vm::ptr<vm::bptr<CellSpur
|
|||
return CELL_SPURS_POLICY_MODULE_ERROR_ALIGN;
|
||||
}
|
||||
|
||||
flag->set(Memory.RealToVirtualAddr(&spurs->m.wklFlag));
|
||||
flag->set(vm::get_addr(&spurs->m.wklFlag));
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1551,11 +1551,11 @@ s64 cellSpursReadyCountStore(vm::ptr<CellSpurs> spurs, u32 wid, u32 value)
|
|||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_INVAL;
|
||||
}
|
||||
if ((spurs->m.wklMskA.read_relaxed().ToLE() & (0x80000000u >> wid)) == 0)
|
||||
if ((spurs->m.wklMskA.read_relaxed() & (0x80000000u >> wid)) == 0)
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_SRCH;
|
||||
}
|
||||
if (spurs->m.exception.ToBE() || spurs->wklState(wid).read_relaxed() != 2)
|
||||
if (spurs->m.exception.data() || spurs->wklState(wid).read_relaxed() != 2)
|
||||
{
|
||||
return CELL_SPURS_POLICY_MODULE_ERROR_STAT;
|
||||
}
|
||||
|
|
@ -2324,7 +2324,7 @@ s64 spursCreateTaskset(vm::ptr<CellSpurs> spurs, vm::ptr<CellSpursTaskset> tasks
|
|||
// TODO: Check return code
|
||||
|
||||
taskset->m.x72 = 0x80;
|
||||
taskset->m.wid.FromBE(*wid);
|
||||
taskset->m.wid = *wid;
|
||||
// TODO: cellSpursSetExceptionEventHandler(spurs, wid, hook, taskset);
|
||||
// TODO: Check return code
|
||||
|
||||
|
|
|
|||
|
|
@ -499,12 +499,12 @@ struct CellSpurs
|
|||
|
||||
__forceinline vm::ptr<sys_lwmutex_t> get_lwmutex()
|
||||
{
|
||||
return vm::ptr<sys_lwmutex_t>::make(Memory.RealToVirtualAddr(&m.mutex));
|
||||
return vm::ptr<sys_lwmutex_t>::make(vm::get_addr(&m.mutex));
|
||||
}
|
||||
|
||||
__forceinline vm::ptr<sys_lwcond_t> get_lwcond()
|
||||
{
|
||||
return vm::ptr<sys_lwcond_t>::make(Memory.RealToVirtualAddr(&m.cond));
|
||||
return vm::ptr<sys_lwcond_t>::make(vm::get_addr(&m.cond));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ s32 cellSyncRwmInitialize(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer, u32 bu
|
|||
|
||||
s32 syncRwmTryReadBeginOp(CellSyncRwm::data_t& rwm)
|
||||
{
|
||||
if (rwm.m_writers.ToBE())
|
||||
if (rwm.m_writers.data())
|
||||
{
|
||||
return CELL_SYNC_ERROR_BUSY;
|
||||
}
|
||||
|
|
@ -319,9 +319,8 @@ s32 syncRwmTryReadBeginOp(CellSyncRwm::data_t& rwm)
|
|||
|
||||
s32 syncRwmReadEndOp(CellSyncRwm::data_t& rwm)
|
||||
{
|
||||
if (!rwm.m_readers.ToBE())
|
||||
if (!rwm.m_readers.data())
|
||||
{
|
||||
cellSync->Error("syncRwmReadEndOp(rwm_addr=0x%x): m_readers == 0 (m_writers=%d)", Memory.RealToVirtualAddr(&rwm), (u16)rwm.m_writers);
|
||||
return CELL_SYNC_ERROR_ABORT;
|
||||
}
|
||||
|
||||
|
|
@ -354,6 +353,7 @@ s32 cellSyncRwmRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer)
|
|||
// prx: decrease m_readers (return 0x8041010C if already zero)
|
||||
if (s32 res = rwm->data.atomic_op(CELL_OK, syncRwmReadEndOp))
|
||||
{
|
||||
cellSync->Error("syncRwmReadEndOp(rwm=0x%x) failed: m_readers == 0", rwm);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -392,7 +392,7 @@ s32 cellSyncRwmTryRead(vm::ptr<CellSyncRwm> rwm, vm::ptr<void> buffer)
|
|||
|
||||
s32 syncRwmTryWriteBeginOp(CellSyncRwm::data_t& rwm)
|
||||
{
|
||||
if (rwm.m_writers.ToBE())
|
||||
if (rwm.m_writers.data())
|
||||
{
|
||||
return CELL_SYNC_ERROR_BUSY;
|
||||
}
|
||||
|
|
@ -422,7 +422,7 @@ s32 cellSyncRwmWrite(vm::ptr<CellSyncRwm> rwm, vm::ptr<const void> buffer)
|
|||
// prx: wait until m_readers == 0
|
||||
g_sync_rwm_write_wm.wait_op(rwm.addr(), [rwm]()
|
||||
{
|
||||
return rwm->data.read_relaxed().m_readers.ToBE() == 0;
|
||||
return rwm->data.read_relaxed().m_readers.data() == 0;
|
||||
});
|
||||
|
||||
// prx: copy data from buffer_addr
|
||||
|
|
@ -934,13 +934,13 @@ s32 syncLFQueueInitialize(vm::ptr<CellSyncLFQueue> queue, vm::ptr<u8> buffer, u3
|
|||
const auto old = queue->init.read_relaxed();
|
||||
auto init = old;
|
||||
|
||||
if (old.ToBE())
|
||||
if (old.data())
|
||||
{
|
||||
if (sdk_ver > 0x17ffff && old != 2)
|
||||
{
|
||||
return CELL_SYNC_ERROR_STAT;
|
||||
}
|
||||
old_value = old.ToLE();
|
||||
old_value = old;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1030,7 +1030,7 @@ s32 syncLFQueueGetPushPointer(vm::ptr<CellSyncLFQueue> queue, s32& pointer, u32
|
|||
|
||||
s32 var2 = (s32)(s16)push.m_h8;
|
||||
s32 res;
|
||||
if (useEventQueue && ((s32)push.m_h5 != var2 || push.m_h7.ToBE() != 0))
|
||||
if (useEventQueue && ((s32)push.m_h5 != var2 || push.m_h7.data() != 0))
|
||||
{
|
||||
res = CELL_SYNC_ERROR_BUSY;
|
||||
}
|
||||
|
|
@ -1058,7 +1058,7 @@ s32 syncLFQueueGetPushPointer(vm::ptr<CellSyncLFQueue> queue, s32& pointer, u32
|
|||
else if (!isBlocking)
|
||||
{
|
||||
res = CELL_SYNC_ERROR_AGAIN;
|
||||
if (!push.m_h7.ToBE() || res)
|
||||
if (!push.m_h7.data() || res)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
|
@ -1081,7 +1081,7 @@ s32 syncLFQueueGetPushPointer(vm::ptr<CellSyncLFQueue> queue, s32& pointer, u32
|
|||
|
||||
if (queue->push1.compare_and_swap_test(old, push))
|
||||
{
|
||||
if (!push.m_h7.ToBE() || res)
|
||||
if (!push.m_h7.data() || res)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
|
@ -1287,7 +1287,7 @@ s32 _cellSyncLFQueueCompletePushPointer2(vm::ptr<CellSyncLFQueue> queue, s32 poi
|
|||
return syncLFQueueCompletePushPointer2(queue, pointer, fpSendSignal);
|
||||
}
|
||||
|
||||
s32 _cellSyncLFQueuePushBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<const void> buffer, u32 isBlocking)
|
||||
s32 _cellSyncLFQueuePushBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm::ptr<const void> buffer, u32 isBlocking)
|
||||
{
|
||||
// cellSyncLFQueuePush has 1 in isBlocking param, cellSyncLFQueueTryPush has 0
|
||||
cellSync->Warning("_cellSyncLFQueuePushBody(queue_addr=0x%x, buffer_addr=0x%x, isBlocking=%d)", queue.addr(), buffer.addr(), isBlocking);
|
||||
|
|
@ -1302,10 +1302,8 @@ s32 _cellSyncLFQueuePushBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<const void>
|
|||
}
|
||||
|
||||
s32 position;
|
||||
//syncLFQueueDump(queue);
|
||||
|
||||
#ifdef PRX_DEBUG
|
||||
vm::var<be_t<s32>> position_v;
|
||||
vm::stackvar<be_t<s32>> position_v(CPU);
|
||||
#endif
|
||||
while (true)
|
||||
{
|
||||
|
|
@ -1314,9 +1312,9 @@ s32 _cellSyncLFQueuePushBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<const void>
|
|||
if (queue->m_direction != CELL_SYNC_QUEUE_ANY2ANY)
|
||||
{
|
||||
#ifdef PRX_DEBUG_XXX
|
||||
res = cb_caller<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64>::call(GetCurrentPPUThread(), libsre + 0x24B0, libsre_rtoc,
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64>(CPU, libsre + 0x24B0, libsre_rtoc,
|
||||
queue, position_v.addr(), isBlocking, 0);
|
||||
position = position_v->ToLE();
|
||||
position = position_v.value();
|
||||
#else
|
||||
res = syncLFQueueGetPushPointer(queue, position, isBlocking, 0);
|
||||
#endif
|
||||
|
|
@ -1324,17 +1322,14 @@ s32 _cellSyncLFQueuePushBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<const void>
|
|||
else
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64>(GetCurrentPPUThread(), libsre + 0x3050, libsre_rtoc,
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64>(CPU, libsre + 0x3050, libsre_rtoc,
|
||||
queue, position_v.addr(), isBlocking, 0);
|
||||
position = position_v->ToLE();
|
||||
position = position_v.value();
|
||||
#else
|
||||
res = syncLFQueueGetPushPointer2(queue, position, isBlocking, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
//LOG_NOTICE(HLE, "... position = %d", position);
|
||||
//syncLFQueueDump(queue);
|
||||
|
||||
if (!isBlocking || res != CELL_SYNC_ERROR_AGAIN)
|
||||
{
|
||||
if (res)
|
||||
|
|
@ -1352,15 +1347,16 @@ s32 _cellSyncLFQueuePushBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<const void>
|
|||
}
|
||||
}
|
||||
|
||||
s32 depth = (u32)queue->m_depth;
|
||||
s32 size = (u32)queue->m_size;
|
||||
memcpy(vm::get_ptr<void>((u64)(queue->m_buffer.addr() & ~1ull) + size * (position >= depth ? position - depth : position)), buffer.get_ptr(), size);
|
||||
const s32 depth = (u32)queue->m_depth;
|
||||
const s32 size = (u32)queue->m_size;
|
||||
const u32 addr = vm::cast<u64>((queue->m_buffer.addr() & ~1ull) + size * (position >= depth ? position - depth : position));
|
||||
memcpy(vm::get_ptr<void>(addr), buffer.get_ptr(), size);
|
||||
|
||||
s32 res;
|
||||
if (queue->m_direction != CELL_SYNC_QUEUE_ANY2ANY)
|
||||
{
|
||||
#ifdef PRX_DEBUG_XXX
|
||||
res = cb_caller<s32, vm::ptr<CellSyncLFQueue>, s32, u64>::call(GetCurrentPPUThread(), libsre + 0x26C0, libsre_rtoc,
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, s32, u64>(CPU, libsre + 0x26C0, libsre_rtoc,
|
||||
queue, position, 0);
|
||||
#else
|
||||
res = syncLFQueueCompletePushPointer(queue, position, nullptr);
|
||||
|
|
@ -1369,14 +1365,13 @@ s32 _cellSyncLFQueuePushBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<const void>
|
|||
else
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, s32, u64>(GetCurrentPPUThread(), libsre + 0x355C, libsre_rtoc,
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, s32, u64>(CPU, libsre + 0x355C, libsre_rtoc,
|
||||
queue, position, 0);
|
||||
#else
|
||||
res = syncLFQueueCompletePushPointer2(queue, position, nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
//syncLFQueueDump(queue);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
@ -1412,7 +1407,7 @@ s32 syncLFQueueGetPopPointer(vm::ptr<CellSyncLFQueue> queue, s32& pointer, u32 i
|
|||
|
||||
s32 var2 = (s32)(s16)pop.m_h4;
|
||||
s32 res;
|
||||
if (useEventQueue && ((s32)(u16)pop.m_h1 != var2 || pop.m_h3.ToBE() != 0))
|
||||
if (useEventQueue && ((s32)(u16)pop.m_h1 != var2 || pop.m_h3.data() != 0))
|
||||
{
|
||||
res = CELL_SYNC_ERROR_BUSY;
|
||||
}
|
||||
|
|
@ -1440,7 +1435,7 @@ s32 syncLFQueueGetPopPointer(vm::ptr<CellSyncLFQueue> queue, s32& pointer, u32 i
|
|||
else if (!isBlocking)
|
||||
{
|
||||
res = CELL_SYNC_ERROR_AGAIN;
|
||||
if (!pop.m_h3.ToBE() || res)
|
||||
if (!pop.m_h3.data() || res)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
|
@ -1463,7 +1458,7 @@ s32 syncLFQueueGetPopPointer(vm::ptr<CellSyncLFQueue> queue, s32& pointer, u32 i
|
|||
|
||||
if (queue->pop1.compare_and_swap_test(old, pop))
|
||||
{
|
||||
if (!pop.m_h3.ToBE() || res)
|
||||
if (!pop.m_h3.data() || res)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
|
@ -1669,7 +1664,7 @@ s32 _cellSyncLFQueueCompletePopPointer2(vm::ptr<CellSyncLFQueue> queue, s32 poin
|
|||
return syncLFQueueCompletePopPointer2(queue, pointer, fpSendSignal, noQueueFull);
|
||||
}
|
||||
|
||||
s32 _cellSyncLFQueuePopBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<void> buffer, u32 isBlocking)
|
||||
s32 _cellSyncLFQueuePopBody(PPUThread& CPU, vm::ptr<CellSyncLFQueue> queue, vm::ptr<void> buffer, u32 isBlocking)
|
||||
{
|
||||
// cellSyncLFQueuePop has 1 in isBlocking param, cellSyncLFQueueTryPop has 0
|
||||
cellSync->Warning("_cellSyncLFQueuePopBody(queue_addr=0x%x, buffer_addr=0x%x, isBlocking=%d)", queue.addr(), buffer.addr(), isBlocking);
|
||||
|
|
@ -1685,7 +1680,7 @@ s32 _cellSyncLFQueuePopBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<void> buffer
|
|||
|
||||
s32 position;
|
||||
#ifdef PRX_DEBUG
|
||||
vm::var<be_t<s32>> position_v;
|
||||
vm::stackvar<be_t<s32>> position_v(CPU);
|
||||
#endif
|
||||
while (true)
|
||||
{
|
||||
|
|
@ -1693,9 +1688,9 @@ s32 _cellSyncLFQueuePopBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<void> buffer
|
|||
if (queue->m_direction != CELL_SYNC_QUEUE_ANY2ANY)
|
||||
{
|
||||
#ifdef PRX_DEBUG_XXX
|
||||
res = cb_caller<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64, u64>::call(GetCurrentPPUThread(), libsre + 0x2A90, libsre_rtoc,
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64, u64>(CPU, libsre + 0x2A90, libsre_rtoc,
|
||||
queue, position_v.addr(), isBlocking, 0, 0);
|
||||
position = position_v->ToLE();
|
||||
position = position_v.value();
|
||||
#else
|
||||
res = syncLFQueueGetPopPointer(queue, position, isBlocking, 0, 0);
|
||||
#endif
|
||||
|
|
@ -1703,9 +1698,9 @@ s32 _cellSyncLFQueuePopBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<void> buffer
|
|||
else
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64>(GetCurrentPPUThread(), libsre + 0x39AC, libsre_rtoc,
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, u32, u32, u64>(CPU, libsre + 0x39AC, libsre_rtoc,
|
||||
queue, position_v.addr(), isBlocking, 0);
|
||||
position = position_v->ToLE();
|
||||
position = position_v.value();
|
||||
#else
|
||||
res = syncLFQueueGetPopPointer2(queue, position, isBlocking, 0);
|
||||
#endif
|
||||
|
|
@ -1728,15 +1723,16 @@ s32 _cellSyncLFQueuePopBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<void> buffer
|
|||
}
|
||||
}
|
||||
|
||||
s32 depth = (u32)queue->m_depth;
|
||||
s32 size = (u32)queue->m_size;
|
||||
memcpy(buffer.get_ptr(), vm::get_ptr<void>((u64)(queue->m_buffer.addr() & ~1ull) + size * (position >= depth ? position - depth : position)), size);
|
||||
const s32 depth = (u32)queue->m_depth;
|
||||
const s32 size = (u32)queue->m_size;
|
||||
const u32 addr = vm::cast<u64>((queue->m_buffer.addr() & ~1) + size * (position >= depth ? position - depth : position));
|
||||
memcpy(buffer.get_ptr(), vm::get_ptr<void>(addr), size);
|
||||
|
||||
s32 res;
|
||||
if (queue->m_direction != CELL_SYNC_QUEUE_ANY2ANY)
|
||||
{
|
||||
#ifdef PRX_DEBUG_XXX
|
||||
res = cb_caller<s32, vm::ptr<CellSyncLFQueue>, s32, u64, u64>::call(GetCurrentPPUThread(), libsre + 0x2CA8, libsre_rtoc,
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, s32, u64, u64>(CPU, libsre + 0x2CA8, libsre_rtoc,
|
||||
queue, position, 0, 0);
|
||||
#else
|
||||
res = syncLFQueueCompletePopPointer(queue, position, nullptr, 0);
|
||||
|
|
@ -1745,7 +1741,7 @@ s32 _cellSyncLFQueuePopBody(vm::ptr<CellSyncLFQueue> queue, vm::ptr<void> buffer
|
|||
else
|
||||
{
|
||||
#ifdef PRX_DEBUG
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, s32, u64, u64>(GetCurrentPPUThread(), libsre + 0x3EB8, libsre_rtoc,
|
||||
res = cb_call<s32, vm::ptr<CellSyncLFQueue>, s32, u64, u64>(CPU, libsre + 0x3EB8, libsre_rtoc,
|
||||
queue, position, 0, 0);
|
||||
#else
|
||||
res = syncLFQueueCompletePopPointer2(queue, position, nullptr, 0);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include "cellMsgDialog.h"
|
||||
#include "cellGame.h"
|
||||
#include "cellSysutil.h"
|
||||
#include "cellSaveData.h"
|
||||
|
||||
typedef void (*CellHddGameStatCallback)(vm::ptr<CellHddGameCBResult> cbResult, vm::ptr<CellHddGameStatGet> get, vm::ptr<CellHddGameStatSet> set);
|
||||
|
||||
|
|
@ -241,7 +240,7 @@ int cellVideoOutGetConfiguration(u32 videoOut, vm::ptr<CellVideoOutConfiguration
|
|||
|
||||
int cellVideoOutGetDeviceInfo(u32 videoOut, u32 deviceIndex, vm::ptr<CellVideoOutDeviceInfo> info)
|
||||
{
|
||||
cellSysutil->Warning("cellVideoOutGetDeviceInfo(videoOut=%u, deviceIndex=%u, info_addr=0x%x)",
|
||||
cellSysutil->Warning("cellVideoOutGetDeviceInfo(videoOut=%d, deviceIndex=%d, info_addr=0x%x)",
|
||||
videoOut, deviceIndex, info.addr());
|
||||
|
||||
if(deviceIndex) return CELL_VIDEO_OUT_ERROR_DEVICE_NOT_FOUND;
|
||||
|
|
@ -286,8 +285,7 @@ int cellVideoOutGetNumberOfDevice(u32 videoOut)
|
|||
|
||||
int cellVideoOutGetResolutionAvailability(u32 videoOut, u32 resolutionId, u32 aspect, u32 option)
|
||||
{
|
||||
cellSysutil->Warning("cellVideoOutGetResolutionAvailability(videoOut=%d, resolutionId=0x%x, option_addr=0x%x, aspect=%d, option=%d)",
|
||||
videoOut, resolutionId, aspect, option);
|
||||
cellSysutil->Warning("cellVideoOutGetResolutionAvailability(videoOut=%d, resolutionId=0x%x, aspect=%d, option=%d)", videoOut, resolutionId, aspect, option);
|
||||
|
||||
if (!Ini.GS3DTV.GetValue() && (resolutionId == CELL_VIDEO_OUT_RESOLUTION_720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_1024x720_3D_FRAME_PACKING ||
|
||||
resolutionId == CELL_VIDEO_OUT_RESOLUTION_960x720_3D_FRAME_PACKING || resolutionId == CELL_VIDEO_OUT_RESOLUTION_800x720_3D_FRAME_PACKING ||
|
||||
|
|
@ -312,28 +310,28 @@ struct sys_callback
|
|||
|
||||
void sysutilSendSystemCommand(u64 status, u64 param)
|
||||
{
|
||||
// TODO: check it and find the source of the return value (not sure that void becomes CELL_OK)
|
||||
// TODO: check it and find the source of the return value (void isn't equal to CELL_OK)
|
||||
for (auto& cb : g_sys_callback)
|
||||
{
|
||||
if (cb.func)
|
||||
{
|
||||
Emu.GetCallbackManager().Register([=]() -> s32
|
||||
Emu.GetCallbackManager().Register([=](PPUThread& PPU) -> s32
|
||||
{
|
||||
cb.func(status, param, cb.arg);
|
||||
cb.func(PPU, status, param, cb.arg);
|
||||
return CELL_OK;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 cellSysutilCheckCallback()
|
||||
s32 cellSysutilCheckCallback(PPUThread& CPU)
|
||||
{
|
||||
cellSysutil->Log("cellSysutilCheckCallback()");
|
||||
|
||||
s32 res;
|
||||
u32 count = 0;
|
||||
|
||||
while (Emu.GetCallbackManager().Check(res))
|
||||
while (Emu.GetCallbackManager().Check(CPU, res))
|
||||
{
|
||||
count++;
|
||||
|
||||
|
|
@ -392,7 +390,7 @@ int cellAudioOutGetSoundAvailability(u32 audioOut, u32 type, u32 fs, u32 option)
|
|||
|
||||
option = 0;
|
||||
|
||||
int available = 2; // should be at least 2
|
||||
int available = 8; // should be at least 2
|
||||
|
||||
switch(fs)
|
||||
{
|
||||
|
|
@ -433,7 +431,7 @@ int cellAudioOutGetSoundAvailability2(u32 audioOut, u32 type, u32 fs, u32 ch, u3
|
|||
|
||||
option = 0;
|
||||
|
||||
int available = 2; // should be at least 2
|
||||
int available = 8; // should be at least 2
|
||||
|
||||
switch(fs)
|
||||
{
|
||||
|
|
@ -580,9 +578,9 @@ int cellAudioOutGetDeviceInfo(u32 audioOut, u32 deviceIndex, vm::ptr<CellAudioOu
|
|||
info->state = CELL_AUDIO_OUT_DEVICE_STATE_AVAILABLE;
|
||||
info->latency = 1000;
|
||||
info->availableModes[0].type = CELL_AUDIO_IN_CODING_TYPE_LPCM;
|
||||
info->availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_2;
|
||||
info->availableModes[0].channel = CELL_AUDIO_OUT_CHNUM_8;
|
||||
info->availableModes[0].fs = CELL_AUDIO_OUT_FS_48KHZ;
|
||||
info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_2CH;
|
||||
info->availableModes[0].layout = CELL_AUDIO_OUT_SPEAKER_LAYOUT_8CH_LREClrxy;
|
||||
|
||||
return CELL_AUDIO_OUT_SUCCEEDED;
|
||||
}
|
||||
|
|
@ -749,8 +747,8 @@ int cellHddGameCheck(u32 version, vm::ptr<const char> dirName, u32 errDialog, vm
|
|||
|
||||
funcStat(result, get, set);
|
||||
|
||||
if (result->result.ToLE() != CELL_HDDGAME_CBRESULT_OK &&
|
||||
result->result.ToLE() != CELL_HDDGAME_CBRESULT_OK_CANCEL) {
|
||||
if (result->result != CELL_HDDGAME_CBRESULT_OK &&
|
||||
result->result != CELL_HDDGAME_CBRESULT_OK_CANCEL) {
|
||||
return CELL_HDDGAME_ERROR_CBRESULT;
|
||||
}
|
||||
|
||||
|
|
@ -836,12 +834,14 @@ int cellWebBrowserEstimate2(const vm::ptr<const CellWebBrowserConfig2> config, v
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
extern int cellGameDataCheckCreate2(u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
extern int cellGameDataCheckCreate2(PPUThread& CPU, u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
vm::ptr<void(*)(vm::ptr<CellGameDataCBResult> cbResult, vm::ptr<CellGameDataStatGet> get, vm::ptr<CellGameDataStatSet> set)> funcStat, u32 container);
|
||||
|
||||
extern int cellGameDataCheckCreate(u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
extern int cellGameDataCheckCreate(PPUThread& CPU, u32 version, vm::ptr<const char> dirName, u32 errDialog,
|
||||
vm::ptr<void(*)(vm::ptr<CellGameDataCBResult> cbResult, vm::ptr<CellGameDataStatGet> get, vm::ptr<CellGameDataStatSet> set)> funcStat, u32 container);
|
||||
|
||||
extern void cellSysutil_SaveData_init();
|
||||
|
||||
void cellSysutil_init(Module *pxThis)
|
||||
{
|
||||
cellSysutil = pxThis;
|
||||
|
|
@ -894,36 +894,13 @@ void cellSysutil_init(Module *pxThis)
|
|||
//cellSysutil->AddFunc(0x9ca9ffa7, cellHddGameSetSystemVer);
|
||||
//cellSysutil->AddFunc(0xafd605b3, cellHddGameExitBroken);
|
||||
|
||||
//cellSysutil_SaveData
|
||||
//cellSysutil->AddFunc(0x04c06fc2, cellSaveDataGetListItem);
|
||||
//cellSysutil->AddFunc(0x273d116a, cellSaveDataUserListExport);
|
||||
//cellSysutil->AddFunc(0x27cb8bc2, cellSaveDataListDelete);
|
||||
//cellSysutil->AddFunc(0x39d6ee43, cellSaveDataUserListImport);
|
||||
//cellSysutil->AddFunc(0x46a2d878, cellSaveDataFixedExport);
|
||||
//cellSysutil->AddFunc(0x491cc554, cellSaveDataListExport);
|
||||
//cellSysutil->AddFunc(0x52541151, cellSaveDataFixedImport);
|
||||
//cellSysutil->AddFunc(0x529231b0, cellSaveDataUserFixedImport);
|
||||
//cellSysutil->AddFunc(0x6b4e0de6, cellSaveDataListImport);
|
||||
//cellSysutil->AddFunc(0x7048a9ba, cellSaveDataUserListDelete);
|
||||
//cellSysutil->AddFunc(0x95ae2cde, cellSaveDataUserFixedExport);
|
||||
//cellSysutil->AddFunc(0xf6482036, cellSaveDataUserGetListItem);
|
||||
cellSysutil->AddFunc(0x2de0d663, cellSaveDataListSave2);
|
||||
cellSysutil->AddFunc(0x1dfbfdd6, cellSaveDataListLoad2);
|
||||
cellSysutil->AddFunc(0x2aae9ef5, cellSaveDataFixedSave2);
|
||||
cellSysutil->AddFunc(0x2a8eada2, cellSaveDataFixedLoad2);
|
||||
cellSysutil->AddFunc(0x8b7ed64b, cellSaveDataAutoSave2);
|
||||
cellSysutil->AddFunc(0xfbd5c856, cellSaveDataAutoLoad2);
|
||||
cellSysutil->AddFunc(0x4dd03a4e, cellSaveDataListAutoSave);
|
||||
cellSysutil->AddFunc(0x21425307, cellSaveDataListAutoLoad);
|
||||
//cellSysutil->AddFunc(0xedadd797, cellSaveDataDelete2);
|
||||
//cellSysutil->AddFunc(0x0f03cfb0, cellSaveDataUserListSave);
|
||||
//cellSysutil->AddFunc(0x39dd8425, cellSaveDataUserListLoad);
|
||||
//cellSysutil->AddFunc(0x40b34847, cellSaveDataUserFixedSave);
|
||||
//cellSysutil->AddFunc(0x6e7264ed, cellSaveDataUserFixedLoad);
|
||||
//cellSysutil->AddFunc(0x52aac4fa, cellSaveDataUserAutoSave);
|
||||
//cellSysutil->AddFunc(0xcdc6aefd, cellSaveDataUserAutoLoad);
|
||||
//cellSysutil->AddFunc(0x0e091c36, cellSaveDataUserListAutoSave);
|
||||
//cellSysutil->AddFunc(0xe7fa820b, cellSaveDataEnableOverlay);
|
||||
//cellSysutil->AddFunc(0x886D0747, cellSysutilRegisterCallbackDispatcher);
|
||||
//cellSysutil->AddFunc(0xA2720DF2, cellSysutilPacketWrite);
|
||||
//cellSysutil->AddFunc(0x75AA7373, doc.write);
|
||||
//cellSysutil->AddFunc(0x2D96313F, packet_read);
|
||||
|
||||
// cellSaveData functions
|
||||
cellSysutil_SaveData_init();
|
||||
|
||||
cellSysutil->AddFunc(0x6d087930, cellWebBrowserEstimate2);
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ next:
|
|||
buf_size -= vdec.reader.size;
|
||||
res += vdec.reader.size;
|
||||
|
||||
vdec.cbFunc.call(*vdec.vdecCb, vdec.id, CELL_VDEC_MSG_TYPE_AUDONE, CELL_OK, vdec.cbArg);
|
||||
vdec.cbFunc(*vdec.vdecCb, vdec.id, CELL_VDEC_MSG_TYPE_AUDONE, CELL_OK, vdec.cbArg);
|
||||
|
||||
vdec.job.pop(vdec.task);
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ u32 vdecOpen(VideoDecoder* vdec_ptr)
|
|||
vdec.id = vdec_id;
|
||||
|
||||
vdec.vdecCb = (PPUThread*)&Emu.GetCPU().AddThread(CPU_THREAD_PPU);
|
||||
vdec.vdecCb->SetName("Video Decoder[" + std::to_string(vdec_id) + "] Callback");
|
||||
vdec.vdecCb->SetName(fmt::format("VideoDecoder[%d] Callback", vdec_id));
|
||||
vdec.vdecCb->SetEntry(0);
|
||||
vdec.vdecCb->SetPrio(1001);
|
||||
vdec.vdecCb->SetStackSize(0x10000);
|
||||
|
|
@ -222,11 +222,9 @@ u32 vdecOpen(VideoDecoder* vdec_ptr)
|
|||
vdec.vdecCb->InitRegs();
|
||||
vdec.vdecCb->DoRun();
|
||||
|
||||
thread t("Video Decoder[" + std::to_string(vdec_id) + "] Thread", [vdec_ptr, sptr]()
|
||||
thread_t t(fmt::format("VideoDecoder[%d] Thread", vdec_id), [vdec_ptr, sptr]()
|
||||
{
|
||||
VideoDecoder& vdec = *vdec_ptr;
|
||||
cellVdec->Notice("Video Decoder thread started");
|
||||
|
||||
VdecTask& task = vdec.task;
|
||||
|
||||
while (true)
|
||||
|
|
@ -259,7 +257,7 @@ u32 vdecOpen(VideoDecoder* vdec_ptr)
|
|||
// TODO: finalize
|
||||
cellVdec->Warning("vdecEndSeq:");
|
||||
|
||||
vdec.cbFunc.call(*vdec.vdecCb, vdec.id, CELL_VDEC_MSG_TYPE_SEQDONE, CELL_OK, vdec.cbArg);
|
||||
vdec.cbFunc(*vdec.vdecCb, vdec.id, CELL_VDEC_MSG_TYPE_SEQDONE, CELL_OK, vdec.cbArg);
|
||||
|
||||
vdec.just_finished = true;
|
||||
break;
|
||||
|
|
@ -431,7 +429,15 @@ u32 vdecOpen(VideoDecoder* vdec_ptr)
|
|||
{
|
||||
if (vdec.last_pts == -1)
|
||||
{
|
||||
vdec.last_pts = 0x8000; //av_frame_get_best_effort_timestamp(frame.data);
|
||||
u64 ts = av_frame_get_best_effort_timestamp(frame.data);
|
||||
if (ts != AV_NOPTS_VALUE)
|
||||
{
|
||||
vdec.last_pts = ts;
|
||||
}
|
||||
else
|
||||
{
|
||||
vdec.last_pts = 0;
|
||||
}
|
||||
}
|
||||
else switch (vdec.frc_set)
|
||||
{
|
||||
|
|
@ -516,12 +522,12 @@ u32 vdecOpen(VideoDecoder* vdec_ptr)
|
|||
if (vdec.frames.push(frame, &vdec.is_closed))
|
||||
{
|
||||
frame.data = nullptr; // to prevent destruction
|
||||
vdec.cbFunc.call(*vdec.vdecCb, vdec.id, CELL_VDEC_MSG_TYPE_PICOUT, CELL_OK, vdec.cbArg);
|
||||
vdec.cbFunc(*vdec.vdecCb, vdec.id, CELL_VDEC_MSG_TYPE_PICOUT, CELL_OK, vdec.cbArg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vdec.cbFunc.call(*vdec.vdecCb, vdec.id, CELL_VDEC_MSG_TYPE_AUDONE, CELL_OK, vdec.cbArg);
|
||||
vdec.cbFunc(*vdec.vdecCb, vdec.id, CELL_VDEC_MSG_TYPE_AUDONE, CELL_OK, vdec.cbArg);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -539,18 +545,14 @@ u32 vdecOpen(VideoDecoder* vdec_ptr)
|
|||
|
||||
default:
|
||||
{
|
||||
VDEC_ERROR("Video Decoder thread error: unknown task(%d)", task.type);
|
||||
VDEC_ERROR("VideoDecoder thread error: unknown task(%d)", task.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vdec.is_finished = true;
|
||||
if (Emu.IsStopped()) cellVdec->Warning("Video Decoder thread aborted");
|
||||
if (vdec.is_closed) cellVdec->Notice("Video Decoder thread ended");
|
||||
});
|
||||
|
||||
t.detach();
|
||||
|
||||
return vdec_id;
|
||||
}
|
||||
|
||||
|
|
@ -573,7 +575,7 @@ int cellVdecOpen(vm::ptr<const CellVdecType> type, vm::ptr<const CellVdecResourc
|
|||
cellVdec->Warning("cellVdecOpen(type_addr=0x%x, res_addr=0x%x, cb_addr=0x%x, handle_addr=0x%x)",
|
||||
type.addr(), res.addr(), cb.addr(), handle.addr());
|
||||
|
||||
*handle = vdecOpen(new VideoDecoder(type->codecType, type->profileLevel, res->memAddr, res->memSize, vm::ptr<CellVdecCbMsg>::make(cb->cbFunc.addr()), cb->cbArg));
|
||||
*handle = vdecOpen(new VideoDecoder(type->codecType, type->profileLevel, res->memAddr, res->memSize, cb->cbFunc.to_le(), cb->cbArg));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -583,7 +585,7 @@ int cellVdecOpenEx(vm::ptr<const CellVdecTypeEx> type, vm::ptr<const CellVdecRes
|
|||
cellVdec->Warning("cellVdecOpenEx(type_addr=0x%x, res_addr=0x%x, cb_addr=0x%x, handle_addr=0x%x)",
|
||||
type.addr(), res.addr(), cb.addr(), handle.addr());
|
||||
|
||||
*handle = vdecOpen(new VideoDecoder(type->codecType, type->profileLevel, res->memAddr, res->memSize, vm::ptr<CellVdecCbMsg>::make(cb->cbFunc.addr()), cb->cbArg));
|
||||
*handle = vdecOpen(new VideoDecoder(type->codecType, type->profileLevel, res->memAddr, res->memSize, cb->cbFunc.to_le(), cb->cbArg));
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -693,7 +695,7 @@ int cellVdecGetPicture(u32 handle, vm::ptr<const CellVdecPicFormat> format, vm::
|
|||
|
||||
if (outBuff)
|
||||
{
|
||||
u32 buf_size = a128(av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1));
|
||||
const u32 buf_size = align(av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1), 128);
|
||||
|
||||
if (format->formatType != CELL_VDEC_PICFMT_YUV420_PLANAR)
|
||||
{
|
||||
|
|
@ -753,7 +755,7 @@ int cellVdecGetPicItem(u32 handle, vm::ptr<u32> picItem_ptr)
|
|||
|
||||
info->codecType = vdec->type;
|
||||
info->startAddr = 0x00000123; // invalid value (no address for picture)
|
||||
info->size = a128(av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1));
|
||||
info->size = align(av_image_get_buffer_size(vdec->ctx->pix_fmt, vdec->ctx->width, vdec->ctx->height, 1), 128);
|
||||
info->auNum = 1;
|
||||
info->auPts[0].lower = (u32)vf.pts;
|
||||
info->auPts[0].upper = vf.pts >> 32;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#define a128(x) ((x + 127) & (~127))
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,14 +5,12 @@
|
|||
#include "Emu/SysCalls/CB_FUNC.h"
|
||||
|
||||
#include "Emu/CPU/CPUThreadManager.h"
|
||||
#include "Emu/Audio/cellAudio.h"
|
||||
#include "cellAudio.h"
|
||||
#include "libmixer.h"
|
||||
|
||||
Module *libmixer = nullptr;
|
||||
|
||||
CellSurMixerConfig surMixer;
|
||||
|
||||
#define SUR_PORT (7)
|
||||
SurMixerConfig g_surmx;
|
||||
vm::ptr<CellSurMixerNotifyCallbackFunction> surMixerCb;
|
||||
vm::ptr<void> surMixerCbArg;
|
||||
std::mutex mixer_mutex;
|
||||
|
|
@ -23,8 +21,7 @@ std::vector<SSPlayer> ssp;
|
|||
|
||||
int cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr, u32 samples)
|
||||
{
|
||||
libmixer->Log("cellAANAddData(handle=%d, port=%d, offset=0x%x, addr=0x%x, samples=%d)",
|
||||
aan_handle, aan_port, offset, addr.addr(), samples);
|
||||
libmixer->Log("cellAANAddData(handle=%d, port=%d, offset=0x%x, addr_addr=0x%x, samples=%d)", aan_handle, aan_port, offset, addr.addr(), samples);
|
||||
|
||||
u32 type = aan_port >> 16;
|
||||
u32 port = aan_port & 0xffff;
|
||||
|
|
@ -32,21 +29,20 @@ int cellAANAddData(u32 aan_handle, u32 aan_port, u32 offset, vm::ptr<float> addr
|
|||
switch (type)
|
||||
{
|
||||
case CELL_SURMIXER_CHSTRIP_TYPE1A:
|
||||
if (port >= surMixer.chStrips1) type = 0; break;
|
||||
if (port >= g_surmx.ch_strips_1) type = 0; break;
|
||||
case CELL_SURMIXER_CHSTRIP_TYPE2A:
|
||||
if (port >= surMixer.chStrips2) type = 0; break;
|
||||
if (port >= g_surmx.ch_strips_2) type = 0; break;
|
||||
case CELL_SURMIXER_CHSTRIP_TYPE6A:
|
||||
if (port >= surMixer.chStrips6) type = 0; break;
|
||||
if (port >= g_surmx.ch_strips_6) type = 0; break;
|
||||
case CELL_SURMIXER_CHSTRIP_TYPE8A:
|
||||
if (port >= surMixer.chStrips8) type = 0; break;
|
||||
if (port >= g_surmx.ch_strips_8) type = 0; break;
|
||||
default:
|
||||
type = 0; break;
|
||||
}
|
||||
|
||||
if (aan_handle != 0x11111111 || samples != 256 || !type || offset != 0)
|
||||
{
|
||||
libmixer->Error("cellAANAddData(handle=%d, port=%d, offset=0x%x, addr=0x%x, samples=%d): invalid parameters",
|
||||
aan_handle, aan_port, offset, addr, samples);
|
||||
libmixer->Error("cellAANAddData(handle=%d, port=%d, offset=0x%x, addr_addr=0x%x, samples=%d): invalid parameters", aan_handle, aan_port, offset, addr.addr(), samples);
|
||||
return CELL_LIBMIXER_ERROR_INVALID_PARAMATER;
|
||||
}
|
||||
|
||||
|
|
@ -298,35 +294,37 @@ int cellSurMixerCreate(vm::ptr<const CellSurMixerConfig> config)
|
|||
{
|
||||
libmixer->Warning("cellSurMixerCreate(config_addr=0x%x)", config.addr());
|
||||
|
||||
surMixer = *config;
|
||||
g_surmx.audio_port = g_audio.open_port();
|
||||
|
||||
AudioPortConfig& port = m_config.m_ports[SUR_PORT];
|
||||
|
||||
if (port.m_is_audio_port_opened)
|
||||
if (!~g_surmx.audio_port)
|
||||
{
|
||||
return CELL_LIBMIXER_ERROR_FULL;
|
||||
}
|
||||
|
||||
g_surmx.priority = config->priority;
|
||||
g_surmx.ch_strips_1 = config->chStrips1;
|
||||
g_surmx.ch_strips_2 = config->chStrips2;
|
||||
g_surmx.ch_strips_6 = config->chStrips6;
|
||||
g_surmx.ch_strips_8 = config->chStrips8;
|
||||
|
||||
AudioPortConfig& port = g_audio.ports[g_surmx.audio_port];
|
||||
|
||||
port.channel = 8;
|
||||
port.block = 16;
|
||||
port.attr = 0;
|
||||
port.level = 1.0f;
|
||||
port.tag = 0;
|
||||
|
||||
libmixer->Warning("*** audio port opened(default)");
|
||||
|
||||
port.m_is_audio_port_opened = true;
|
||||
port.tag = 0;
|
||||
m_config.m_port_in_use++;
|
||||
|
||||
libmixer->Warning("*** surMixer created (ch1=%d, ch2=%d, ch6=%d, ch8=%d)",
|
||||
(u32)surMixer.chStrips1, (u32)surMixer.chStrips2, (u32)surMixer.chStrips6, (u32)surMixer.chStrips8);
|
||||
|
||||
mixcount = 0;
|
||||
surMixerCb.set(0);
|
||||
|
||||
thread t("Surmixer Thread", []()
|
||||
libmixer->Warning("*** surMixer created (ch1=%d, ch2=%d, ch6=%d, ch8=%d)", config->chStrips1, config->chStrips2, config->chStrips6, config->chStrips8);
|
||||
|
||||
thread_t t("Surmixer Thread", []()
|
||||
{
|
||||
AudioPortConfig& port = m_config.m_ports[SUR_PORT];
|
||||
AudioPortConfig& port = g_audio.ports[g_surmx.audio_port];
|
||||
|
||||
PPUThread& cb_thread = *(PPUThread*)&Emu.GetCPU().AddThread(CPU_THREAD_PPU);
|
||||
cb_thread.SetName("Surmixer Callback Thread");
|
||||
|
|
@ -337,28 +335,22 @@ int cellSurMixerCreate(vm::ptr<const CellSurMixerConfig> config)
|
|||
cb_thread.InitRegs();
|
||||
cb_thread.DoRun();
|
||||
|
||||
while (port.m_is_audio_port_opened)
|
||||
while (port.state.read_relaxed() != AUDIO_PORT_STATE_CLOSED && !Emu.IsStopped())
|
||||
{
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
libmixer->Warning("Surmixer aborted");
|
||||
break;
|
||||
}
|
||||
|
||||
if (mixcount > (port.tag + 0)) // adding positive value (1-15): preemptive buffer filling (hack)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1)); // hack
|
||||
continue;
|
||||
}
|
||||
|
||||
if (port.m_is_audio_port_started)
|
||||
if (port.state.read_relaxed() == AUDIO_PORT_STATE_STARTED)
|
||||
{
|
||||
//u64 stamp0 = get_system_time();
|
||||
|
||||
memset(mixdata, 0, sizeof(mixdata));
|
||||
if (surMixerCb)
|
||||
{
|
||||
surMixerCb.call(cb_thread, surMixerCbArg, (u32)mixcount, 256);
|
||||
surMixerCb(cb_thread, surMixerCbArg, (u32)mixcount, 256);
|
||||
}
|
||||
|
||||
//u64 stamp1 = get_system_time();
|
||||
|
|
@ -442,7 +434,7 @@ int cellSurMixerCreate(vm::ptr<const CellSurMixerConfig> config)
|
|||
|
||||
//u64 stamp2 = get_system_time();
|
||||
|
||||
auto buf = vm::get_ptr<be_t<float>>(m_config.m_buffer + (128 * 1024 * SUR_PORT) + (mixcount % port.block) * port.channel * 256 * sizeof(float));
|
||||
auto buf = vm::get_ptr<be_t<float>>(port.addr + (mixcount % port.block) * port.channel * AUDIO_SAMPLES * sizeof(float));
|
||||
|
||||
for (u32 i = 0; i < (sizeof(mixdata) / sizeof(float)); i++)
|
||||
{
|
||||
|
|
@ -466,7 +458,6 @@ int cellSurMixerCreate(vm::ptr<const CellSurMixerConfig> config)
|
|||
Emu.GetCPU().RemoveThread(cb_thread.GetId());
|
||||
surMixerCb.set(0);
|
||||
});
|
||||
t.detach();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -517,13 +508,13 @@ int cellSurMixerStart()
|
|||
{
|
||||
libmixer->Warning("cellSurMixerStart()");
|
||||
|
||||
AudioPortConfig& port = m_config.m_ports[SUR_PORT];
|
||||
|
||||
if (port.m_is_audio_port_opened)
|
||||
if (g_surmx.audio_port >= AUDIO_PORT_COUNT)
|
||||
{
|
||||
port.m_is_audio_port_started = true;
|
||||
return CELL_LIBMIXER_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
|
||||
g_audio.ports[g_surmx.audio_port].state.compare_and_swap(AUDIO_PORT_STATE_OPENED, AUDIO_PORT_STATE_STARTED);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
@ -537,19 +528,17 @@ int cellSurMixerFinalize()
|
|||
{
|
||||
libmixer->Warning("cellSurMixerFinalize()");
|
||||
|
||||
AudioPortConfig& port = m_config.m_ports[SUR_PORT];
|
||||
|
||||
if (port.m_is_audio_port_opened)
|
||||
if (g_surmx.audio_port >= AUDIO_PORT_COUNT)
|
||||
{
|
||||
port.m_is_audio_port_started = false;
|
||||
port.m_is_audio_port_opened = false;
|
||||
m_config.m_port_in_use--;
|
||||
return CELL_LIBMIXER_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
g_audio.ports[g_surmx.audio_port].state.compare_and_swap(AUDIO_PORT_STATE_OPENED, AUDIO_PORT_STATE_CLOSED);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSurMixerSurBusAddData(u32 busNo, u32 offset, u32 addr, u32 samples)
|
||||
int cellSurMixerSurBusAddData(u32 busNo, u32 offset, vm::ptr<float> addr, u32 samples)
|
||||
{
|
||||
if (busNo < 8 && samples == 256 && offset == 0)
|
||||
{
|
||||
|
|
@ -566,8 +555,7 @@ int cellSurMixerSurBusAddData(u32 busNo, u32 offset, u32 addr, u32 samples)
|
|||
for (u32 i = 0; i < samples; i++)
|
||||
{
|
||||
// reverse byte order and mix
|
||||
u32 v = vm::read32(addr + i * sizeof(float));
|
||||
mixdata[i*8+busNo] += (float&)v;
|
||||
mixdata[i * 8 + busNo] += addr[i];
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
|
|
@ -583,13 +571,13 @@ int cellSurMixerPause(u32 type)
|
|||
{
|
||||
libmixer->Warning("cellSurMixerPause(type=%d)", type);
|
||||
|
||||
AudioPortConfig& port = m_config.m_ports[SUR_PORT];
|
||||
|
||||
if (port.m_is_audio_port_opened)
|
||||
if (g_surmx.audio_port >= AUDIO_PORT_COUNT)
|
||||
{
|
||||
port.m_is_audio_port_started = false;
|
||||
return CELL_LIBMIXER_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
g_audio.ports[g_surmx.audio_port].state.compare_and_swap(AUDIO_PORT_STATE_STARTED, AUDIO_PORT_STATE_OPENED);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
@ -605,7 +593,7 @@ int cellSurMixerGetTimestamp(u64 tag, vm::ptr<u64> stamp)
|
|||
{
|
||||
libmixer->Log("cellSurMixerGetTimestamp(tag=0x%llx, stamp_addr=0x%x)", tag, stamp.addr());
|
||||
|
||||
*stamp = m_config.start_time + (tag) * 256000000 / 48000; // ???
|
||||
*stamp = g_audio.start_time + (tag) * 256000000 / 48000; // ???
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
@ -640,6 +628,8 @@ void libmixer_init(Module *pxThis)
|
|||
{
|
||||
libmixer = pxThis;
|
||||
|
||||
g_surmx.audio_port = ~0;
|
||||
|
||||
REG_SUB(libmixer, "surmxAAN", cellAANAddData,
|
||||
0xffffffff7c691b78,
|
||||
0xffffffff7c0802a6,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
enum //libmixer Error Codes
|
||||
// Error Codes
|
||||
enum
|
||||
{
|
||||
CELL_LIBMIXER_ERROR_NOT_INITIALIZED = 0x80310002,
|
||||
CELL_LIBMIXER_ERROR_INVALID_PARAMATER = 0x80310003,
|
||||
|
|
@ -164,6 +165,16 @@ struct CellSurMixerChStripParam
|
|||
be_t<s32> intVal;
|
||||
};
|
||||
|
||||
struct SurMixerConfig
|
||||
{
|
||||
u32 audio_port;
|
||||
s32 priority;
|
||||
u32 ch_strips_1;
|
||||
u32 ch_strips_2;
|
||||
u32 ch_strips_6;
|
||||
u32 ch_strips_8;
|
||||
};
|
||||
|
||||
struct SSPlayer
|
||||
{
|
||||
bool m_created; // SSPlayerCreate/Remove
|
||||
|
|
|
|||
|
|
@ -60,13 +60,13 @@ u32 cellSoundSynth2GetAddr(u16 reg)
|
|||
|
||||
int cellSoundSynth2SetEffectAttr(s16 bus, vm::ptr<CellSoundSynth2EffectAttr> attr)
|
||||
{
|
||||
libsynth2.Todo("cellSoundSynth2SetEffectAttr(bus=%d, attr_addr=0x%x)", bus, attr.addr());
|
||||
libsynth2.Todo("cellSoundSynth2SetEffectAttr(bus=%d, attr=0x%x)", bus, attr);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSoundSynth2SetEffectMode(s16 bus, vm::ptr<CellSoundSynth2EffectAttr> attr)
|
||||
{
|
||||
libsynth2.Todo("cellSoundSynth2SetEffectMode(bus=%d, attr_addr=0x%x)", bus, attr.addr());
|
||||
libsynth2.Todo("cellSoundSynth2SetEffectMode(bus=%d, attr=0x%x)", bus, attr);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
@ -77,8 +77,7 @@ void cellSoundSynth2SetCoreAttr(u16 entry, u16 value)
|
|||
|
||||
int cellSoundSynth2Generate(u16 samples, u32 L_addr, u32 R_addr, u32 Lr_addr, u32 Rr_addr)
|
||||
{
|
||||
libsynth2.Todo("cellSoundSynth2Generate(samples=0x%x, left=0x%x, right=0x%x, left_rear=0x%x, right_rear=0x%x)",
|
||||
samples, L_addr, R_addr, Lr_addr, Rr_addr);
|
||||
libsynth2.Todo("cellSoundSynth2Generate(samples=0x%x, left=0x%x, right=0x%x, left_rear=0x%x, right_rear=0x%x)", samples, L_addr, R_addr, Lr_addr, Rr_addr);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ int sceNpBasicAddFriend()
|
|||
|
||||
int sceNpBasicGetFriendListEntryCount(vm::ptr<u32> count)
|
||||
{
|
||||
sceNp->Warning("sceNpBasicGetFriendListEntryCount(count=%d)", count);
|
||||
sceNp->Warning("sceNpBasicGetFriendListEntryCount(count_addr=0x%x)", count.addr());
|
||||
|
||||
if (!sceNpInstance.m_bSceNpInitialized)
|
||||
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
|
||||
|
|
@ -476,7 +476,7 @@ int sceNpBasicGetClanMessageEntry(u32 index, vm::ptr<SceNpUserInfo> from)
|
|||
|
||||
int sceNpBasicGetMessageEntryCount(u32 type, vm::ptr<u32> count)
|
||||
{
|
||||
sceNp->Warning("sceNpBasicGetMessageEntryCount(type=%d, count=%d)", type, count);
|
||||
sceNp->Warning("sceNpBasicGetMessageEntryCount(type=%d, count_addr=0x%x)", type, count.addr());
|
||||
|
||||
if (!sceNpInstance.m_bSceNpInitialized)
|
||||
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
|
||||
|
|
@ -984,7 +984,7 @@ int sceNpManagerGetAccountAge()
|
|||
|
||||
int sceNpManagerGetContentRatingFlag(vm::ptr<u32> isRestricted, vm::ptr<u32> age)
|
||||
{
|
||||
sceNp->Warning("sceNpManagerGetContentRatingFlag(isRestricted=%d, age=%d)", isRestricted, age);
|
||||
sceNp->Warning("sceNpManagerGetContentRatingFlag(isRestricted_addr=0x%x, age_addr=0x%x)", isRestricted.addr(), age.addr());
|
||||
|
||||
if (!sceNpInstance.m_bSceNpInitialized)
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ int sceNpTrophyGetTrophyIcon()
|
|||
|
||||
int sceNpTrophyGetTrophyInfo(u32 context, u32 handle, s32 trophyId, vm::ptr<SceNpTrophyDetails> details, vm::ptr<SceNpTrophyData> data)
|
||||
{
|
||||
sceNpTrophy->Warning("sceNpTrophyGetTrophyInfo(context=%u, handle=%u, trophyId=%d, details_addr=0x%x, data_addr=0x%x)",
|
||||
sceNpTrophy->Warning("sceNpTrophyGetTrophyInfo(context=%d, handle=%d, trophyId=%d, details_addr=0x%x, data_addr=0x%x)",
|
||||
context, handle, trophyId, details.addr(), data.addr());
|
||||
|
||||
if (!sceNpTrophyInstance.m_bInitialized)
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ s32 _sys_spu_printf_finalize()
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
s64 _sys_spu_printf_attach_group(u32 group)
|
||||
s32 _sys_spu_printf_attach_group(PPUThread& CPU, u32 group)
|
||||
{
|
||||
sysPrxForUser->Warning("_sys_spu_printf_attach_group(group=%d)", group);
|
||||
|
||||
|
|
@ -295,10 +295,10 @@ s64 _sys_spu_printf_attach_group(u32 group)
|
|||
return CELL_ESTAT;
|
||||
}
|
||||
|
||||
return spu_printf_agcb(group);
|
||||
return spu_printf_agcb(CPU, group);
|
||||
}
|
||||
|
||||
s64 _sys_spu_printf_detach_group(u32 group)
|
||||
s32 _sys_spu_printf_detach_group(PPUThread& CPU, u32 group)
|
||||
{
|
||||
sysPrxForUser->Warning("_sys_spu_printf_detach_group(group=%d)", group);
|
||||
|
||||
|
|
@ -307,10 +307,10 @@ s64 _sys_spu_printf_detach_group(u32 group)
|
|||
return CELL_ESTAT;
|
||||
}
|
||||
|
||||
return spu_printf_dgcb(group);
|
||||
return spu_printf_dgcb(CPU, group);
|
||||
}
|
||||
|
||||
s64 _sys_spu_printf_attach_thread(u32 thread)
|
||||
s32 _sys_spu_printf_attach_thread(PPUThread& CPU, u32 thread)
|
||||
{
|
||||
sysPrxForUser->Warning("_sys_spu_printf_attach_thread(thread=%d)", thread);
|
||||
|
||||
|
|
@ -319,10 +319,10 @@ s64 _sys_spu_printf_attach_thread(u32 thread)
|
|||
return CELL_ESTAT;
|
||||
}
|
||||
|
||||
return spu_printf_atcb(thread);
|
||||
return spu_printf_atcb(CPU, thread);
|
||||
}
|
||||
|
||||
s64 _sys_spu_printf_detach_thread(u32 thread)
|
||||
s32 _sys_spu_printf_detach_thread(PPUThread& CPU, u32 thread)
|
||||
{
|
||||
sysPrxForUser->Warning("_sys_spu_printf_detach_thread(thread=%d)", thread);
|
||||
|
||||
|
|
@ -331,7 +331,7 @@ s64 _sys_spu_printf_detach_thread(u32 thread)
|
|||
return CELL_ESTAT;
|
||||
}
|
||||
|
||||
return spu_printf_dtcb(thread);
|
||||
return spu_printf_dtcb(CPU, thread);
|
||||
}
|
||||
|
||||
s32 _sys_snprintf(vm::ptr<char> dst, u32 count, vm::ptr<const char> fmt) // va_args...
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ int sys_net_accept(s32 s, vm::ptr<sys_net_sockaddr> addr, vm::ptr<pck_len_t> pad
|
|||
|
||||
int sys_net_bind(s32 s, vm::ptr<sys_net_sockaddr_in> addr, u32 addrlen)
|
||||
{
|
||||
sys_net->Warning("bind(s=%d, family_addr=0x%x, addrlen=%u)", s, addr.addr(), addrlen);
|
||||
sys_net->Warning("bind(s=%d, family_addr=0x%x, addrlen=%d)", s, addr.addr(), addrlen);
|
||||
sockaddr_in saddr;
|
||||
memcpy(&saddr, addr.get_ptr(), sizeof(sockaddr_in));
|
||||
saddr.sin_family = addr->sin_family;
|
||||
|
|
@ -127,7 +127,7 @@ int sys_net_bind(s32 s, vm::ptr<sys_net_sockaddr_in> addr, u32 addrlen)
|
|||
|
||||
int sys_net_connect(s32 s, vm::ptr<sys_net_sockaddr_in> addr, u32 addrlen)
|
||||
{
|
||||
sys_net->Warning("connect(s=%d, family_addr=0x%x, addrlen=%u)", s, addr.addr(), addrlen);
|
||||
sys_net->Warning("connect(s=%d, family_addr=0x%x, addrlen=%d)", s, addr.addr(), addrlen);
|
||||
sockaddr_in saddr;
|
||||
memcpy(&saddr, addr.get_ptr(), sizeof(sockaddr_in));
|
||||
saddr.sin_family = addr->sin_family;
|
||||
|
|
@ -242,7 +242,7 @@ int sys_net_recv(s32 s, vm::ptr<char> buf, u32 len, s32 flags)
|
|||
|
||||
int sys_net_recvfrom(s32 s, vm::ptr<char> buf, u32 len, s32 flags, vm::ptr<sys_net_sockaddr> addr, vm::ptr<pck_len_t> paddrlen)
|
||||
{
|
||||
sys_net->Warning("recvfrom(s=%d, buf_addr=0x%x, len=%u, flags=0x%x, addr_addr=0x%x, paddrlen=0x%x)",
|
||||
sys_net->Warning("recvfrom(s=%d, buf_addr=0x%x, len=%d, flags=0x%x, addr_addr=0x%x, paddrlen=0x%x)",
|
||||
s, buf.addr(), len, flags, addr.addr(), paddrlen.addr());
|
||||
|
||||
sockaddr _addr;
|
||||
|
|
@ -278,7 +278,7 @@ int sendmsg()
|
|||
|
||||
int sys_net_sendto(s32 s, vm::ptr<const char> buf, u32 len, s32 flags, vm::ptr<sys_net_sockaddr> addr, u32 addrlen)
|
||||
{
|
||||
sys_net->Warning("sendto(s=%d, buf_addr=0x%x, len=%u, flags=0x%x, addr=0x%x, addrlen=%u)",
|
||||
sys_net->Warning("sendto(s=%d, buf_addr=0x%x, len=%d, flags=0x%x, addr=0x%x, addrlen=%d)",
|
||||
s, buf.addr(), len, flags, addr.addr(), addrlen);
|
||||
|
||||
sockaddr _addr;
|
||||
|
|
@ -291,7 +291,7 @@ int sys_net_sendto(s32 s, vm::ptr<const char> buf, u32 len, s32 flags, vm::ptr<s
|
|||
|
||||
int sys_net_setsockopt(s32 s, s32 level, s32 optname, vm::ptr<const char> optval, u32 optlen)
|
||||
{
|
||||
sys_net->Warning("socket(s=%d, level=%d, optname=%d, optval_addr=0x%x, optlen=%u)", s, level, optname, optval.addr(), optlen);
|
||||
sys_net->Warning("socket(s=%d, level=%d, optname=%d, optval_addr=0x%x, optlen=%d)", s, level, optname, optval.addr(), optlen);
|
||||
|
||||
int ret = setsockopt(s, level, optname, optval.get_ptr(), optlen);
|
||||
*g_lastError = getLastError();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue