mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
- Implemented send open system menu cmd.
- Added cellSysutil module. - Improved OpenGL renderer. - Added cube & hello world homebrews. - Implemented more GCM syscalls.
This commit is contained in:
parent
2f5fa75bb4
commit
234e174b7d
@ -63,7 +63,7 @@ public:
|
||||
|
||||
m_parent = nullptr;
|
||||
|
||||
//if(wait)
|
||||
if(wait)
|
||||
{
|
||||
Delete();
|
||||
//wxCriticalSectionLocker lock(m_wait_for_exit);
|
||||
|
BIN
bin/dev_hdd0/game/TEST12345/USRDIR/cube.elf
Normal file
BIN
bin/dev_hdd0/game/TEST12345/USRDIR/cube.elf
Normal file
Binary file not shown.
BIN
bin/dev_hdd0/game/TEST12345/USRDIR/hello_world.elf
Normal file
BIN
bin/dev_hdd0/game/TEST12345/USRDIR/hello_world.elf
Normal file
Binary file not shown.
@ -18,6 +18,7 @@ PPCThread::PPCThread(PPCThreadType type)
|
||||
, m_offset(0)
|
||||
, m_sync_wait(false)
|
||||
, m_wait_thread_id(-1)
|
||||
, m_free_data(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -28,6 +29,11 @@ PPCThread::~PPCThread()
|
||||
|
||||
void PPCThread::Close()
|
||||
{
|
||||
if(IsAlive())
|
||||
{
|
||||
m_free_data = true;
|
||||
}
|
||||
|
||||
if(DisAsmFrame)
|
||||
{
|
||||
DisAsmFrame->Close();
|
||||
@ -261,7 +267,7 @@ void PPCThread::Stop()
|
||||
wxGetApp().SendDbgCommand(DID_STOP_THREAD, this);
|
||||
|
||||
m_status = Stopped;
|
||||
ThreadBase::Stop();
|
||||
ThreadBase::Stop(false);
|
||||
Reset();
|
||||
DoStop();
|
||||
Emu.CheckStatus();
|
||||
@ -284,7 +290,7 @@ void PPCThread::ExecOnce()
|
||||
|
||||
void PPCThread::Task()
|
||||
{
|
||||
ConLog.Write("%s enter", PPCThread::GetFName());
|
||||
//ConLog.Write("%s enter", PPCThread::GetFName());
|
||||
|
||||
const Array<u64>& bp = Emu.GetBreakPoints();
|
||||
|
||||
@ -336,5 +342,8 @@ void PPCThread::Task()
|
||||
ConLog.Error("Exception: %s", e);
|
||||
}
|
||||
|
||||
ConLog.Write("%s leave", PPCThread::GetFName());
|
||||
//ConLog.Write("%s leave", PPCThread::GetFName());
|
||||
|
||||
if(m_free_data)
|
||||
free(this);
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ protected:
|
||||
Array<u64> argv_addr;
|
||||
u64 m_offset;
|
||||
u32 m_exit_status;
|
||||
bool m_free_data;
|
||||
|
||||
public:
|
||||
u64 stack_size;
|
||||
|
@ -20,6 +20,8 @@ void PPCThreadManager::Close()
|
||||
|
||||
PPCThread& PPCThreadManager::AddThread(PPCThreadType type)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mtx_thread);
|
||||
|
||||
PPCThread* new_thread;
|
||||
char* name;
|
||||
switch(type)
|
||||
@ -40,6 +42,8 @@ PPCThread& PPCThreadManager::AddThread(PPCThreadType type)
|
||||
|
||||
void PPCThreadManager::RemoveThread(const u32 id)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mtx_thread);
|
||||
|
||||
for(u32 i=0; i<m_threads.GetCount(); ++i)
|
||||
{
|
||||
if(m_threads[i].m_wait_thread_id == id)
|
||||
@ -51,10 +55,19 @@ void PPCThreadManager::RemoveThread(const u32 id)
|
||||
if(m_threads[i].GetId() != id) continue;
|
||||
|
||||
PPCThread* thr = &m_threads[i];
|
||||
m_threads.RemoveFAt(i);
|
||||
wxGetApp().SendDbgCommand(DID_REMOVE_THREAD, thr);
|
||||
if(thr->IsAlive())
|
||||
{
|
||||
thr->Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
thr->Close();
|
||||
delete thr;
|
||||
}
|
||||
|
||||
|
||||
m_threads.RemoveFAt(i);
|
||||
i--;
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,9 @@ class PPCThreadManager
|
||||
//ArrayF<PPUThread> m_ppu_threads;
|
||||
//ArrayF<SPUThread> m_spu_threads;
|
||||
ArrayF<PPCThread> m_threads;
|
||||
std::mutex m_mtx_thread;
|
||||
wxSemaphore m_sem_task;
|
||||
Stack<u32> m_delete_threads;
|
||||
|
||||
public:
|
||||
PPCThreadManager();
|
||||
@ -23,4 +26,5 @@ public:
|
||||
//IdManager& GetIDs() {return m_threads_id;}
|
||||
|
||||
void Exec();
|
||||
void Task();
|
||||
};
|
@ -63,8 +63,8 @@ void PPUThread::InitRegs()
|
||||
const u32 pc = Memory.Read32(entry);
|
||||
const u32 rtoc = Memory.Read32(entry + 4);
|
||||
|
||||
ConLog.Write("entry = 0x%x", entry);
|
||||
ConLog.Write("rtoc = 0x%x", rtoc);
|
||||
//ConLog.Write("entry = 0x%x", entry);
|
||||
//ConLog.Write("rtoc = 0x%x", rtoc);
|
||||
|
||||
SetPc(pc);
|
||||
|
||||
@ -132,9 +132,11 @@ void PPUThread::InitRegs()
|
||||
GPR[29] = GPR[3];
|
||||
GPR[31] = GPR[5];
|
||||
|
||||
LR = Emu.GetPPUThreadExit();
|
||||
CTR = PC;
|
||||
CR.CR = 0x22000082;
|
||||
VSCR.NJ = 1;
|
||||
TB = 0;
|
||||
}
|
||||
|
||||
u64 PPUThread::GetFreeStackSize() const
|
||||
@ -202,14 +204,13 @@ void PPUThread::DoCode(const s32 code)
|
||||
{
|
||||
is_last_enabled = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if(++cycle > 220)
|
||||
{
|
||||
cycle = 0;
|
||||
TB++;
|
||||
}
|
||||
#endif
|
||||
|
||||
m_dec->Decode(code);
|
||||
}
|
||||
|
@ -37,9 +37,17 @@ void FragmentDecompilerThread::AddCode(wxString code)
|
||||
|
||||
if(cond.Len())
|
||||
{
|
||||
ConLog.Error("cond! [eq: %d gr: %d lt: %d] (%s)", src0.exec_if_eq, src0.exec_if_gr, src0.exec_if_lt, cond);
|
||||
Emu.Pause();
|
||||
return;
|
||||
|
||||
static const char f[4] = {'x', 'y', 'z', 'w'};
|
||||
wxString swizzle = wxEmptyString;
|
||||
swizzle += f[src0.cond_swizzle_x];
|
||||
swizzle += f[src0.cond_swizzle_y];
|
||||
swizzle += f[src0.cond_swizzle_z];
|
||||
swizzle += f[src0.cond_swizzle_w];
|
||||
cond = wxString::Format("if(rc.%s %s 0.0) ", swizzle, cond);
|
||||
//ConLog.Error("cond! [eq: %d gr: %d lt: %d] (%s)", src0.exec_if_eq, src0.exec_if_gr, src0.exec_if_lt, cond);
|
||||
//Emu.Pause();
|
||||
//return;
|
||||
}
|
||||
|
||||
if(src1.scale)
|
||||
@ -60,13 +68,12 @@ void FragmentDecompilerThread::AddCode(wxString code)
|
||||
}
|
||||
}
|
||||
|
||||
if(dst.fp16)
|
||||
if(dst.saturate)
|
||||
{
|
||||
//HACK! TODO: fp16 -> fp32
|
||||
code = "/*" + code + "*/ vec4(1.0, 1.0, 1.0, 1.0)";
|
||||
code = "clamp(" + code + ", 0.0, 1.0)";
|
||||
}
|
||||
|
||||
code = AddReg(dst.dest_reg, dst.fp16) + GetMask() + " = " + code + GetMask();
|
||||
code = cond + (dst.set_cond ? AddCond(dst.fp16) : AddReg(dst.dest_reg, dst.fp16)) + GetMask() + " = " + code + GetMask();
|
||||
|
||||
main += "\t" + code + ";\n";
|
||||
}
|
||||
@ -96,6 +103,11 @@ wxString FragmentDecompilerThread::AddReg(u32 index, int fp16)
|
||||
wxString::Format((fp16 ? "h%d" : "r%d"), index), (index || fp16) ? -1 : 0);
|
||||
}
|
||||
|
||||
wxString FragmentDecompilerThread::AddCond(int fp16)
|
||||
{
|
||||
return m_parr.AddParam(PARAM_NONE , "vec4", (fp16 ? "hc" : "rc"), -1);
|
||||
}
|
||||
|
||||
wxString FragmentDecompilerThread::AddConst()
|
||||
{
|
||||
mem32_t data(m_addr + m_size + m_offset);
|
||||
|
@ -117,6 +117,7 @@ struct FragmentDecompilerThread : public ThreadBase
|
||||
|
||||
void AddCode(wxString code);
|
||||
wxString AddReg(u32 index, int fp16);
|
||||
wxString AddCond(int fp16);
|
||||
wxString AddConst();
|
||||
wxString AddTex();
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#define CMD_LOG(...)
|
||||
#endif
|
||||
|
||||
gcmBuffer gcmBuffers[2];
|
||||
gcmBuffer gcmBuffers[8];
|
||||
|
||||
void printGlError(GLenum err, const char* situation)
|
||||
{
|
||||
@ -176,14 +176,16 @@ void GLRSXThread::Task()
|
||||
if(draw)
|
||||
{
|
||||
p.m_frame->Flip();
|
||||
}
|
||||
|
||||
p.m_gcm_current_buffer = ++p.m_gcm_current_buffer % p.m_gcm_buffers_count;
|
||||
p.m_flip_status = 0;
|
||||
if(p.m_flip_handler)
|
||||
{
|
||||
p.m_flip_handler.Handle(1, 0, 0);
|
||||
p.m_flip_handler.Branch(false);
|
||||
}
|
||||
}
|
||||
|
||||
p.m_flip_status = 0;
|
||||
if(SemaphorePostAndWait(p.m_sem_flip)) continue;
|
||||
}
|
||||
|
||||
@ -198,7 +200,7 @@ void GLRSXThread::Task()
|
||||
if(cmd & CELL_GCM_METHOD_FLAG_JUMP)
|
||||
{
|
||||
u32 addr = cmd & ~(CELL_GCM_METHOD_FLAG_JUMP | CELL_GCM_METHOD_FLAG_NON_INCREMENT);
|
||||
addr &= ~0x1000;
|
||||
addr -= 0x1000;
|
||||
ConLog.Warning("rsx jump(0x%x) #addr=0x%x, cmd=0x%x, get=0x%x, put=0x%x", addr, p.m_ioAddress + get, cmd, get, put);
|
||||
re(p.m_ctrl->get, addr);
|
||||
continue;
|
||||
@ -621,17 +623,14 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
|
||||
case NV4097_SET_ALPHA_TEST_ENABLE:
|
||||
m_set_alpha_test = args[0] ? true : false;
|
||||
//Enable(args[0] ? true : false, GL_ALPHA_TEST);
|
||||
break;
|
||||
|
||||
case NV4097_SET_BLEND_ENABLE:
|
||||
m_set_blend = args[0] ? true : false;
|
||||
//Enable(args[0] ? true : false, GL_BLEND);
|
||||
break;
|
||||
|
||||
case NV4097_SET_DEPTH_BOUNDS_TEST_ENABLE:
|
||||
m_set_depth_bounds_test = args[0] ? true : false;
|
||||
//Enable(args[0] ? true : false, GL_DEPTH_CLAMP);
|
||||
break;
|
||||
|
||||
case NV4097_SET_ALPHA_FUNC:
|
||||
@ -680,47 +679,51 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
m_clip_max = (float&)clip_max;
|
||||
|
||||
CMD_LOG("clip_min=%.01f, clip_max=%.01f", m_clip_min, m_clip_max);
|
||||
|
||||
//glDepthRangef(m_clip_min, m_clip_max);
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_DEPTH_FUNC:
|
||||
m_set_depth_func = true;
|
||||
m_depth_func = args[0];
|
||||
//glDepthFunc(m_depth_func);
|
||||
break;
|
||||
|
||||
case NV4097_SET_DEPTH_TEST_ENABLE:
|
||||
m_depth_test_enable = args[0] ? true : false;
|
||||
//Enable(args[0] ? true : false, GL_DEPTH_TEST);
|
||||
break;
|
||||
|
||||
case NV4097_SET_FRONT_POLYGON_MODE:
|
||||
glPolygonMode(GL_FRONT, args[0]);
|
||||
m_set_front_polygon_mode = true;
|
||||
m_front_polygon_mode = args[0];
|
||||
//glPolygonMode(GL_FRONT, args[0]);
|
||||
break;
|
||||
|
||||
case NV4097_CLEAR_SURFACE:
|
||||
{
|
||||
const u32 mask = args[0];
|
||||
GLbitfield f = 0;
|
||||
if (mask & 0x1) f |= GL_DEPTH_BUFFER_BIT;
|
||||
if (mask & 0x2) f |= GL_STENCIL_BUFFER_BIT;
|
||||
if (mask & 0x10) f |= GL_COLOR_BUFFER_BIT;
|
||||
glClear(f);
|
||||
m_set_clear_surface = true;
|
||||
m_clear_surface_mask = args[0];
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_BLEND_FUNC_SFACTOR:
|
||||
{
|
||||
const u16 src_rgb = args[0] & 0xffff;
|
||||
const u16 dst_rgb = args[0] >> 16;
|
||||
const u16 src_alpha = args[1] & 0xffff;
|
||||
const u16 dst_alpha = args[1] >> 16;
|
||||
CMD_LOG("src_rgb=0x%x, dst_rgb=0x%x, src_alpha=0x%x, dst_alpha=0x%x",
|
||||
src_rgb, dst_rgb, src_alpha, dst_alpha);
|
||||
m_set_blend_sfactor = true;
|
||||
m_blend_sfactor_rgb = args[0] & 0xffff;
|
||||
m_blend_sfactor_alpha = args[0] >> 16;
|
||||
|
||||
glBlendFuncSeparate(src_rgb, dst_rgb, src_alpha, dst_alpha);
|
||||
if(count >= 2)
|
||||
{
|
||||
m_set_blend_dfactor = true;
|
||||
m_blend_dfactor_rgb = args[1] & 0xffff;
|
||||
m_blend_dfactor_alpha = args[1] >> 16;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_BLEND_FUNC_DFACTOR:
|
||||
{
|
||||
m_set_blend_dfactor = true;
|
||||
m_blend_dfactor_rgb = args[0] & 0xffff;
|
||||
m_blend_dfactor_alpha = args[0] >> 16;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -822,12 +825,20 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
if(args[0])
|
||||
{
|
||||
//begin
|
||||
if(Emu.GetCallbackManager().m_exit_callback.m_callbacks.GetCount())
|
||||
{
|
||||
//Emu.GetCallbackManager().m_exit_callback.Handle(0x0121, 0);
|
||||
}
|
||||
m_draw_mode = args[0] - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//end
|
||||
ExecCMD();
|
||||
if(Emu.GetCallbackManager().m_exit_callback.m_callbacks.GetCount())
|
||||
{
|
||||
//Emu.GetCallbackManager().m_exit_callback.Handle(0x0122, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -941,19 +952,66 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
break;
|
||||
|
||||
case NV4097_SET_LOGIC_OP_ENABLE:
|
||||
Enable(args[0] ? true : false, GL_LOGIC_OP);
|
||||
m_set_logic_op = args[0] ? true : false;
|
||||
break;
|
||||
|
||||
case NV4097_SET_CULL_FACE_ENABLE:
|
||||
Enable(args[0] ? true : false, GL_CULL_FACE);
|
||||
m_set_cull_face = args[0] ? true : false;
|
||||
break;
|
||||
|
||||
case NV4097_SET_DITHER_ENABLE:
|
||||
Enable(args[0] ? true : false, GL_DITHER);
|
||||
m_set_dither = args[0] ? true : false;
|
||||
break;
|
||||
|
||||
case NV4097_SET_STENCIL_TEST_ENABLE:
|
||||
Enable(args[0] ? true : false, GL_STENCIL_TEST);
|
||||
m_set_stencil_test = args[0] ? true : false;
|
||||
break;
|
||||
|
||||
case NV4097_SET_STENCIL_MASK:
|
||||
m_set_stencil_mask = true;
|
||||
m_stencil_mask = args[0];
|
||||
break;
|
||||
|
||||
case NV4097_SET_STENCIL_FUNC:
|
||||
m_set_stencil_func = true;
|
||||
m_stencil_func = args[0];
|
||||
if(count >= 2)
|
||||
{
|
||||
m_set_stencil_func_ref = true;
|
||||
m_stencil_func_ref = args[1];
|
||||
|
||||
if(count >= 3)
|
||||
{
|
||||
m_set_stencil_func_mask = true;
|
||||
m_stencil_func_mask = args[2];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_STENCIL_FUNC_REF:
|
||||
m_set_stencil_func_ref = true;
|
||||
m_stencil_func_ref = args[0];
|
||||
break;
|
||||
|
||||
case NV4097_SET_STENCIL_FUNC_MASK:
|
||||
m_set_stencil_func_mask = true;
|
||||
m_stencil_func_mask = args[0];
|
||||
break;
|
||||
|
||||
case NV4097_SET_STENCIL_OP_FAIL:
|
||||
m_set_stencil_fail = true;
|
||||
m_stencil_fail = args[0];
|
||||
if(count >= 2)
|
||||
{
|
||||
m_set_stencil_zfail = true;
|
||||
m_stencil_zfail = args[1];
|
||||
|
||||
if(count >= 3)
|
||||
{
|
||||
m_set_stencil_zpass = true;
|
||||
m_stencil_zpass = args[2];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_TWO_SIDED_STENCIL_TEST_ENABLE:
|
||||
@ -984,8 +1042,11 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
break;
|
||||
|
||||
case NV4097_SET_BLEND_COLOR:
|
||||
glBlendColor(args[0] & 0xff, (args[0] >> 8) & 0xff,
|
||||
(args[0] >> 16) & 0xff, (args[0] >> 24) & 0xff);
|
||||
m_set_blend_color = true;
|
||||
m_blend_color_r = args[0] & 0xff;
|
||||
m_blend_color_g = (args[0] >> 8) & 0xff;
|
||||
m_blend_color_b = (args[0] >> 16) & 0xff;
|
||||
m_blend_color_a = (args[0] >> 24) & 0xff;
|
||||
break;
|
||||
|
||||
case NV4097_SET_BLEND_COLOR2:
|
||||
@ -993,8 +1054,9 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
break;
|
||||
|
||||
case NV4097_SET_BLEND_EQUATION:
|
||||
glBlendEquationSeparate(args[0] & 0xffff, args[0] >> 16);
|
||||
//glBlendEquation
|
||||
m_set_blend_equation = true;
|
||||
m_blend_equation_rgb = args[0] & 0xffff;
|
||||
m_blend_equation_alpha = args[0] >> 16;
|
||||
break;
|
||||
|
||||
case NV4097_SET_REDUCE_DST_COLOR:
|
||||
@ -1002,7 +1064,8 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
break;
|
||||
|
||||
case NV4097_SET_DEPTH_MASK:
|
||||
glDepthMask(args[0]);
|
||||
m_set_depth_mask = true;
|
||||
m_depth_mask = args[0];
|
||||
break;
|
||||
|
||||
case NV4097_SET_SCISSOR_VERTICAL:
|
||||
@ -1025,10 +1088,6 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
m_scissor_y = args[1] & 0xffff;
|
||||
m_scissor_h = args[1] >> 16;
|
||||
}
|
||||
|
||||
CMD_LOG("x=%d, y=%d, w=%d, h=%d", m_scissor_x, m_scissor_y, m_scissor_w, m_scissor_h);
|
||||
|
||||
//glScissor(m_scissor_x, m_scissor_y, m_scissor_w, m_scissor_h);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1148,6 +1207,20 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
}
|
||||
break;
|
||||
|
||||
case NV4097_SET_LINE_SMOOTH_ENABLE:
|
||||
m_set_line_smooth = args[0] ? true : false;
|
||||
break;
|
||||
|
||||
case NV4097_SET_LINE_WIDTH:
|
||||
m_set_line_width = true;
|
||||
m_line_width = args[0];
|
||||
break;
|
||||
|
||||
case NV4097_SET_SHADE_MODE:
|
||||
m_set_shade_mode = true;
|
||||
m_shade_mode = args[0];
|
||||
break;
|
||||
|
||||
case NV4097_SET_ZSTENCIL_CLEAR_VALUE:
|
||||
case NV4097_SET_ZCULL_CONTROL0:
|
||||
case NV4097_SET_ZCULL_CONTROL1:
|
||||
@ -1165,6 +1238,7 @@ void GLGSRender::DoCmd(const u32 fcmd, const u32 cmd, mem32_t& args, const u32 c
|
||||
{
|
||||
case 1:
|
||||
data = std::chrono::steady_clock::now().time_since_epoch().count();
|
||||
data *= 1000000;
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1285,6 +1359,15 @@ void GLGSRender::ExecCMD()
|
||||
{
|
||||
if(LoadProgram())
|
||||
{
|
||||
if(m_set_clear_surface)
|
||||
{
|
||||
GLbitfield f = 0;
|
||||
if (m_clear_surface_mask & 0x1) f |= GL_DEPTH_BUFFER_BIT;
|
||||
if (m_clear_surface_mask & 0x2) f |= GL_STENCIL_BUFFER_BIT;
|
||||
if (m_clear_surface_mask & 0x10) f |= GL_COLOR_BUFFER_BIT;
|
||||
glClear(f);
|
||||
}
|
||||
|
||||
if(m_set_color_mask)
|
||||
{
|
||||
glColorMask(m_color_mask_r, m_color_mask_g, m_color_mask_b, m_color_mask_a);
|
||||
@ -1303,10 +1386,45 @@ void GLGSRender::ExecCMD()
|
||||
glScissor(m_scissor_x, m_scissor_y, m_scissor_w, m_scissor_h);
|
||||
}
|
||||
|
||||
if(m_set_front_polygon_mode)
|
||||
{
|
||||
glPolygonMode(GL_FRONT, m_front_polygon_mode);
|
||||
}
|
||||
|
||||
Enable(m_depth_test_enable, GL_DEPTH_TEST);
|
||||
Enable(m_set_alpha_test, GL_ALPHA_TEST);
|
||||
Enable(m_set_depth_bounds_test, GL_DEPTH_CLAMP);
|
||||
Enable(m_set_blend, GL_BLEND);
|
||||
Enable(m_set_logic_op, GL_LOGIC_OP);
|
||||
Enable(m_set_cull_face, GL_CULL_FACE);
|
||||
Enable(m_set_dither, GL_DITHER);
|
||||
Enable(m_set_stencil_test, GL_STENCIL_TEST);
|
||||
Enable(m_set_line_smooth, GL_LINE_SMOOTH);
|
||||
|
||||
if(m_set_stencil_mask)
|
||||
{
|
||||
glStencilMask(m_stencil_mask);
|
||||
}
|
||||
|
||||
if(m_set_stencil_func && m_set_stencil_func_ref && m_set_stencil_func_mask)
|
||||
{
|
||||
glStencilFunc(m_stencil_func, m_stencil_func_ref, m_stencil_func_mask);
|
||||
}
|
||||
|
||||
if(m_set_stencil_fail && m_set_stencil_zfail && m_set_stencil_zpass)
|
||||
{
|
||||
glStencilOp(m_stencil_fail, m_stencil_zfail, m_stencil_zpass);
|
||||
}
|
||||
|
||||
if(m_set_shade_mode)
|
||||
{
|
||||
glShadeModel(m_shade_mode);
|
||||
}
|
||||
|
||||
if(m_set_depth_mask)
|
||||
{
|
||||
glDepthMask(m_depth_mask);
|
||||
}
|
||||
|
||||
if(m_set_depth_func)
|
||||
{
|
||||
@ -1318,6 +1436,26 @@ void GLGSRender::ExecCMD()
|
||||
glDepthRangef(m_clip_min, m_clip_max);
|
||||
}
|
||||
|
||||
if(m_set_line_width)
|
||||
{
|
||||
glLineWidth(m_line_width / 255.f);
|
||||
}
|
||||
|
||||
if(m_set_blend_equation)
|
||||
{
|
||||
glBlendEquationSeparate(m_blend_equation_rgb, m_blend_equation_alpha);
|
||||
}
|
||||
|
||||
if(m_set_blend_sfactor && m_set_blend_dfactor)
|
||||
{
|
||||
glBlendFuncSeparate(m_blend_sfactor_rgb, m_blend_dfactor_rgb, m_blend_sfactor_alpha, m_blend_dfactor_alpha);
|
||||
}
|
||||
|
||||
if(m_set_blend_color)
|
||||
{
|
||||
glBlendColor(m_blend_color_r, m_blend_color_g, m_blend_color_b, m_blend_color_a);
|
||||
}
|
||||
|
||||
if(m_indexed_array.m_count && m_draw_array_count)
|
||||
{
|
||||
ConLog.Warning("m_indexed_array.m_count && draw_array_count");
|
||||
|
@ -113,9 +113,17 @@ public:
|
||||
checkForGlError("GLTexture::Init() -> glTexImage2D");
|
||||
break;
|
||||
|
||||
case 0x94://FIXME
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_R16, m_width, m_height, 0, GL_RED, GL_SHORT, Memory.GetMemFromAddr(m_offset));
|
||||
checkForGlError("GLTexture::Init() -> glTexImage2D");
|
||||
break;
|
||||
|
||||
default: ConLog.Error("Init tex error: Bad tex format (0x%x)", m_format); break;
|
||||
}
|
||||
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
//Unbind();
|
||||
}
|
||||
|
||||
@ -269,8 +277,6 @@ private:
|
||||
virtual void OnSize(wxSizeEvent& event);
|
||||
};
|
||||
|
||||
extern gcmBuffer gcmBuffers[2];
|
||||
|
||||
struct GLRSXThread : public ThreadBase
|
||||
{
|
||||
wxWindow* m_parent;
|
||||
|
@ -38,15 +38,8 @@ struct gcmBuffer
|
||||
u32 pitch;
|
||||
u32 width;
|
||||
u32 height;
|
||||
bool update;
|
||||
|
||||
gcmBuffer() : update(false)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
extern gcmBuffer gcmBuffers[2];
|
||||
|
||||
class GSManager
|
||||
{
|
||||
GSInfo m_info;
|
||||
|
@ -51,6 +51,10 @@ struct GSRender
|
||||
volatile bool m_draw;
|
||||
Callback m_flip_handler;
|
||||
|
||||
u32 m_gcm_buffers_addr;
|
||||
u32 m_gcm_buffers_count;
|
||||
u32 m_gcm_current_buffer;
|
||||
|
||||
GSRender();
|
||||
|
||||
virtual void Init(const u32 ioAddress, const u32 ioSize, const u32 ctrlAddress, const u32 localAddress)=0;
|
||||
|
@ -36,6 +36,67 @@ protected:
|
||||
u16 m_scissor_w;
|
||||
u16 m_scissor_h;
|
||||
|
||||
bool m_set_front_polygon_mode;
|
||||
u32 m_front_polygon_mode;
|
||||
|
||||
bool m_set_clear_surface;
|
||||
u32 m_clear_surface_mask;
|
||||
|
||||
bool m_set_blend_sfactor;
|
||||
u16 m_blend_sfactor_rgb;
|
||||
u16 m_blend_sfactor_alpha;
|
||||
|
||||
bool m_set_blend_dfactor;
|
||||
u16 m_blend_dfactor_rgb;
|
||||
u16 m_blend_dfactor_alpha;
|
||||
|
||||
bool m_set_logic_op;
|
||||
bool m_set_cull_face;
|
||||
bool m_set_dither;
|
||||
bool m_set_stencil_test;
|
||||
|
||||
bool m_set_stencil_mask;
|
||||
u32 m_stencil_mask;
|
||||
|
||||
bool m_set_stencil_func;
|
||||
u32 m_stencil_func;
|
||||
|
||||
bool m_set_stencil_func_ref;
|
||||
u32 m_stencil_func_ref;
|
||||
|
||||
bool m_set_stencil_func_mask;
|
||||
u32 m_stencil_func_mask;
|
||||
|
||||
bool m_set_stencil_fail;
|
||||
u32 m_stencil_fail;
|
||||
|
||||
bool m_set_stencil_zfail;
|
||||
u32 m_stencil_zfail;
|
||||
|
||||
bool m_set_stencil_zpass;
|
||||
u32 m_stencil_zpass;
|
||||
|
||||
bool m_set_blend_equation;
|
||||
u16 m_blend_equation_rgb;
|
||||
u16 m_blend_equation_alpha;
|
||||
|
||||
bool m_set_depth_mask;
|
||||
u32 m_depth_mask;
|
||||
|
||||
bool m_set_line_smooth;
|
||||
|
||||
bool m_set_line_width;
|
||||
u32 m_line_width;
|
||||
|
||||
bool m_set_shade_mode;
|
||||
u32 m_shade_mode;
|
||||
|
||||
bool m_set_blend_color;
|
||||
u8 m_blend_color_r;
|
||||
u8 m_blend_color_g;
|
||||
u8 m_blend_color_b;
|
||||
u8 m_blend_color_a;
|
||||
|
||||
public:
|
||||
ExecRSXCMDdata()
|
||||
{
|
||||
@ -55,6 +116,27 @@ public:
|
||||
m_set_viewport_vertical = false;
|
||||
m_set_scissor_horizontal = false;
|
||||
m_set_scissor_vertical = false;
|
||||
m_set_front_polygon_mode = false;
|
||||
m_set_clear_surface = false;
|
||||
m_set_blend_sfactor = false;
|
||||
m_set_blend_dfactor = false;
|
||||
m_set_logic_op = false;
|
||||
m_set_cull_face = false;
|
||||
m_set_dither = false;
|
||||
m_set_stencil_test = false;
|
||||
m_set_stencil_mask = false;
|
||||
m_set_stencil_func = false;
|
||||
m_set_stencil_func_ref = false;
|
||||
m_set_stencil_func_mask = false;
|
||||
m_set_stencil_fail = false;
|
||||
m_set_stencil_zfail = false;
|
||||
m_set_stencil_zpass = false;
|
||||
m_set_blend_equation = false;
|
||||
m_set_depth_mask = false;
|
||||
m_set_line_smooth = false;
|
||||
m_set_line_width = false;
|
||||
m_set_shade_mode = false;
|
||||
m_set_blend_color = false;
|
||||
}
|
||||
|
||||
virtual void ExecCMD()=0;
|
||||
|
@ -60,7 +60,6 @@ void Callback::Branch(bool wait)
|
||||
new_thread.SetArg(0, a1);
|
||||
new_thread.SetArg(1, a2);
|
||||
new_thread.SetArg(2, a3);
|
||||
((PPUThread&)new_thread).LR = Emu.GetPPUThreadExit();
|
||||
new_thread.Run();
|
||||
|
||||
new_thread.Exec();
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Emu/SysCalls/SC_FUNC.h"
|
||||
#include "Emu/GS/GCM.h"
|
||||
|
||||
void cellGcmSys_init();
|
||||
Module cellGcmSys(0x0010, cellGcmSys_init);
|
||||
@ -17,6 +18,68 @@ s64 cellGcmSetFlipCommandWithWaitLabel()
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cellGcmInitCursor()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellGcmSetCursorPosition(s32 x, s32 y)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellGcmSetCursorDisable()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellGcmSetVBlankHandler()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellGcmUpdateCursor()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellGcmSetCursorEnable()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellGcmSetCursorImageOffset(u32 offset)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellGcmSys);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
u32 cellGcmGetDisplayInfo()
|
||||
{
|
||||
cellGcmSys.Warning("cellGcmGetDisplayInfo() = 0x%x", Emu.GetGSManager().GetRender().m_gcm_buffers_addr);
|
||||
return Emu.GetGSManager().GetRender().m_gcm_buffers_addr;
|
||||
}
|
||||
|
||||
int cellGcmGetCurrentDisplayBufferId(u32 id_addr)
|
||||
{
|
||||
cellGcmSys.Warning("cellGcmGetCurrentDisplayBufferId(id_addr=0x%x)", id_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(id_addr))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
Memory.Write32(id_addr, Emu.GetGSManager().GetRender().m_gcm_current_buffer);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
void cellGcmSys_init()
|
||||
{
|
||||
cellGcmSys.AddFunc(0x055bd74d, cellGcmGetTiledPitchSize);
|
||||
@ -39,4 +102,15 @@ void cellGcmSys_init()
|
||||
cellGcmSys.AddFunc(0xd9b7653e, cellGcmUnbindTile);
|
||||
cellGcmSys.AddFunc(0xa75640e8, cellGcmUnbindZcull);
|
||||
cellGcmSys.AddFunc(0xa41ef7e8, cellGcmSetFlipHandler);
|
||||
cellGcmSys.AddFunc(0xa114ec67, cellGcmMapMainMemory);
|
||||
cellGcmSys.AddFunc(0xf80196c1, cellGcmGetLabelAddress);
|
||||
cellGcmSys.AddFunc(0x107bf3a1, cellGcmInitCursor);
|
||||
cellGcmSys.AddFunc(0x1a0de550, cellGcmSetCursorPosition);
|
||||
cellGcmSys.AddFunc(0x69c6cc82, cellGcmSetCursorDisable);
|
||||
cellGcmSys.AddFunc(0xa91b0402, cellGcmSetVBlankHandler);
|
||||
cellGcmSys.AddFunc(0xbd2fa0a7, cellGcmUpdateCursor);
|
||||
cellGcmSys.AddFunc(0xc47d0812, cellGcmSetCursorEnable);
|
||||
cellGcmSys.AddFunc(0xf9bfdc72, cellGcmSetCursorImageOffset);
|
||||
cellGcmSys.AddFunc(0x0e6b0dae, cellGcmGetDisplayInfo);
|
||||
cellGcmSys.AddFunc(0x93806525, cellGcmGetCurrentDisplayBufferId);
|
||||
}
|
||||
|
240
rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp
Normal file
240
rpcs3/Emu/SysCalls/Modules/cellSysutil.cpp
Normal file
@ -0,0 +1,240 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Emu/SysCalls/SC_FUNC.h"
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_LANG = 0x0111,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN = 0x0112,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_DATE_FORMAT = 0x0114,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_TIME_FORMAT = 0x0115,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE = 0x0116,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_SUMMERTIME = 0x0117,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL = 0x0121,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL0_RESTRICT = 0x0123,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USER_HAS_NP_ACCOUNT = 0x0141,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_CAMERA_PLFREQ = 0x0151,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_RUMBLE = 0x0152,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_KEYBOARD_TYPE = 0x0153,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_JAPANESE_KEYBOARD_ENTRY_METHOD = 0x0154,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_CHINESE_KEYBOARD_ENTRY_METHOD = 0x0155,
|
||||
CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_AUTOOFF = 0x0156,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_LANG_JAPANESE = 0,
|
||||
CELL_SYSUTIL_LANG_ENGLISH_US = 1,
|
||||
CELL_SYSUTIL_LANG_FRENCH = 2,
|
||||
CELL_SYSUTIL_LANG_SPANISH = 3,
|
||||
CELL_SYSUTIL_LANG_GERMAN = 4,
|
||||
CELL_SYSUTIL_LANG_ITALIAN = 5,
|
||||
CELL_SYSUTIL_LANG_DUTCH = 6,
|
||||
CELL_SYSUTIL_LANG_PORTUGUESE_PT = 7,
|
||||
CELL_SYSUTIL_LANG_RUSSIAN = 8,
|
||||
CELL_SYSUTIL_LANG_KOREAN = 9,
|
||||
CELL_SYSUTIL_LANG_CHINESE_T = 10,
|
||||
CELL_SYSUTIL_LANG_CHINESE_S = 11,
|
||||
CELL_SYSUTIL_LANG_FINNISH = 12,
|
||||
CELL_SYSUTIL_LANG_SWEDISH = 13,
|
||||
CELL_SYSUTIL_LANG_DANISH = 14,
|
||||
CELL_SYSUTIL_LANG_NORWEGIAN = 15,
|
||||
CELL_SYSUTIL_LANG_POLISH = 16,
|
||||
CELL_SYSUTIL_LANG_PORTUGUESE_BR = 17,
|
||||
CELL_SYSUTIL_LANG_ENGLISH_GB = 18,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CIRCLE = 0,
|
||||
CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CROSS = 1,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_DATE_FMT_YYYYMMDD = 0,
|
||||
CELL_SYSUTIL_DATE_FMT_DDMMYYYY = 1,
|
||||
CELL_SYSUTIL_DATE_FMT_MMDDYYYY = 2,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_TIME_FMT_CLOCK12 = 0,
|
||||
CELL_SYSUTIL_TIME_FMT_CLOCK24 = 1,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_GAME_PARENTAL_OFF = 0,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL01 = 1,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL02 = 2,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL03 = 3,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL04 = 4,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL05 = 5,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL06 = 6,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL07 = 7,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL08 = 8,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL09 = 9,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL10 = 10,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL11 = 11,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL0_RESTRICT_OFF = 0,
|
||||
CELL_SYSUTIL_GAME_PARENTAL_LEVEL0_RESTRICT_ON = 1,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_CAMERA_PLFREQ_DISABLED = 0,
|
||||
CELL_SYSUTIL_CAMERA_PLFREQ_50HZ = 1,
|
||||
CELL_SYSUTIL_CAMERA_PLFREQ_60HZ = 2,
|
||||
CELL_SYSUTIL_CAMERA_PLFREQ_DEVCIE_DEPEND = 4,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_PAD_RUMBLE_OFF = 0,
|
||||
CELL_SYSUTIL_PAD_RUMBLE_ON = 1,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CELL_KB_MAPPING_101,
|
||||
CELL_KB_MAPPING_106,
|
||||
CELL_KB_MAPPING_106_KANA,
|
||||
CELL_KB_MAPPING_GERMAN_GERMANY,
|
||||
CELL_KB_MAPPING_SPANISH_SPAIN,
|
||||
CELL_KB_MAPPING_FRENCH_FRANCE,
|
||||
CELL_KB_MAPPING_ITALIAN_ITALY,
|
||||
CELL_KB_MAPPING_DUTCH_NETHERLANDS,
|
||||
CELL_KB_MAPPING_PORTUGUESE_PORTUGAL,
|
||||
CELL_KB_MAPPING_RUSSIAN_RUSSIA,
|
||||
CELL_KB_MAPPING_ENGLISH_UK,
|
||||
CELL_KB_MAPPING_KOREAN_KOREA,
|
||||
CELL_KB_MAPPING_NORWEGIAN_NORWAY,
|
||||
CELL_KB_MAPPING_FINNISH_FINLAND,
|
||||
CELL_KB_MAPPING_DANISH_DENMARK,
|
||||
CELL_KB_MAPPING_SWEDISH_SWEDEN,
|
||||
CELL_KB_MAPPING_CHINESE_TRADITIONAL,
|
||||
CELL_KB_MAPPING_CHINESE_SIMPLIFIED,
|
||||
CELL_KB_MAPPING_SWISS_FRENCH_SWITZERLAND,
|
||||
CELL_KB_MAPPING_SWISS_GERMAN_SWITZERLAND,
|
||||
CELL_KB_MAPPING_CANADIAN_FRENCH_CANADA,
|
||||
CELL_KB_MAPPING_BELGIAN_BELGIUM,
|
||||
CELL_KB_MAPPING_POLISH_POLAND,
|
||||
CELL_KB_MAPPING_PORTUGUESE_BRAZIL,
|
||||
};
|
||||
|
||||
void cellSysutil_init();
|
||||
Module cellSysutil(0x0015, cellSysutil_init);
|
||||
|
||||
void cellVideoOutGetDeviceInfo()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysutil);
|
||||
}
|
||||
|
||||
int cellSysutilGetSystemParamInt(int id, u32 value_addr)
|
||||
{
|
||||
cellSysutil.Log("cellSysutilGetSystemParamInt(id=0x%x, value_addr=0x%x)", id, value_addr);
|
||||
|
||||
if(!Memory.IsGoodAddr(value_addr))
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
switch(id)
|
||||
{
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_LANG:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_LANG");
|
||||
Memory.Write32(value_addr, CELL_SYSUTIL_LANG_ENGLISH_US);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_ENTER_BUTTON_ASSIGN");
|
||||
Memory.Write32(value_addr, CELL_SYSUTIL_ENTER_BUTTON_ASSIGN_CROSS);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_DATE_FORMAT:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_DATE_FORMAT");
|
||||
Memory.Write32(value_addr, CELL_SYSUTIL_DATE_FMT_DDMMYYYY);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_TIME_FORMAT:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_TIME_FORMAT");
|
||||
Memory.Write32(value_addr, CELL_SYSUTIL_TIME_FMT_CLOCK24);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_TIMEZONE");
|
||||
Memory.Write32(value_addr, 3);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_SUMMERTIME:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_SUMMERTIME");
|
||||
Memory.Write32(value_addr, 1);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL");
|
||||
Memory.Write32(value_addr, CELL_SYSUTIL_GAME_PARENTAL_OFF);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL0_RESTRICT:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_GAME_PARENTAL_LEVEL0_RESTRICT");
|
||||
Memory.Write32(value_addr, CELL_SYSUTIL_GAME_PARENTAL_LEVEL0_RESTRICT_OFF);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USER_HAS_NP_ACCOUNT:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USER_HAS_NP_ACCOUNT");
|
||||
Memory.Write32(value_addr, 0);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CAMERA_PLFREQ:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_CAMERA_PLFREQ");
|
||||
Memory.Write32(value_addr, CELL_SYSUTIL_CAMERA_PLFREQ_DISABLED);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_RUMBLE:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_RUMBLE");
|
||||
Memory.Write32(value_addr, CELL_SYSUTIL_PAD_RUMBLE_OFF);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_KEYBOARD_TYPE:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_KEYBOARD_TYPE");
|
||||
Memory.Write32(value_addr, 0);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_JAPANESE_KEYBOARD_ENTRY_METHOD:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_JAPANESE_KEYBOARD_ENTRY_METHOD");
|
||||
Memory.Write32(value_addr, 0);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_CHINESE_KEYBOARD_ENTRY_METHOD:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_CHINESE_KEYBOARD_ENTRY_METHOD");
|
||||
Memory.Write32(value_addr, 0);
|
||||
break;
|
||||
|
||||
case CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_AUTOOFF:
|
||||
cellSysutil.Warning("cellSysutilGetSystemParamInt: CELL_SYSUTIL_SYSTEMPARAM_ID_PAD_AUTOOFF");
|
||||
Memory.Write32(value_addr, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
void cellSysutil_init()
|
||||
{
|
||||
cellSysutil.AddFunc(0x0bae8772, cellVideoOutConfigure);
|
||||
cellSysutil.AddFunc(0x189a74da, cellSysutilCheckCallback);
|
||||
cellSysutil.AddFunc(0x1e930eef, cellVideoOutGetDeviceInfo);
|
||||
cellSysutil.AddFunc(0x40e895d3, cellSysutilGetSystemParamInt);
|
||||
cellSysutil.AddFunc(0x887572d5, cellVideoOutGetState);
|
||||
cellSysutil.AddFunc(0x9d98afa0, cellSysutilRegisterCallback);
|
||||
cellSysutil.AddFunc(0xe558748d, cellVideoOutGetResolution);
|
||||
}
|
@ -271,6 +271,8 @@ extern int sys_time_get_current_time(u32 sec_addr, u32 nsec_addr);
|
||||
extern s64 sys_time_get_system_time();
|
||||
extern u64 sys_time_get_timebase_frequency();
|
||||
|
||||
#define UNIMPLEMENTED_FUNC(module) module.Error("Unimplemented function: "__FUNCTION__)
|
||||
|
||||
#define SC_ARGS_1 CPU.GPR[3]
|
||||
#define SC_ARGS_2 SC_ARGS_1,CPU.GPR[4]
|
||||
#define SC_ARGS_3 SC_ARGS_2,CPU.GPR[5]
|
||||
|
@ -62,6 +62,10 @@ int cellGcmInit(u32 context_addr, u32 cmdSize, u32 ioSize, u32 ioAddress)
|
||||
ctrl.get = 0;
|
||||
ctrl.ref = -1;
|
||||
|
||||
Emu.GetGSManager().GetRender().m_gcm_buffers_addr = Memory.Alloc(sizeof(gcmBuffer) * 8, sizeof(gcmBuffer));
|
||||
Emu.GetGSManager().GetRender().m_gcm_buffers_count = 0;
|
||||
Emu.GetGSManager().GetRender().m_gcm_current_buffer = 0;
|
||||
|
||||
Emu.GetGSManager().GetRender().Init(ctx_begin, ctx_size, gcm_info.control_addr, local_addr);
|
||||
|
||||
return CELL_OK;
|
||||
@ -122,13 +126,19 @@ int cellGcmSetDisplayBuffer(u32 id, u32 offset, u32 pitch, u32 width, u32 height
|
||||
{
|
||||
cellGcmSys.Warning("cellGcmSetDisplayBuffer(id=0x%x,offset=0x%x,pitch=%d,width=%d,height=%d)",
|
||||
id, offset, width ? pitch/width : pitch, width, height);
|
||||
if(id > 1) return CELL_EINVAL;
|
||||
if(id > 7) return CELL_EINVAL;
|
||||
|
||||
gcmBuffers[id].offset = offset;
|
||||
gcmBuffers[id].pitch = pitch;
|
||||
gcmBuffers[id].width = width;
|
||||
gcmBuffers[id].height = height;
|
||||
gcmBuffers[id].update = true;
|
||||
gcmBuffer* buffers = (gcmBuffer*)Memory.GetMemFromAddr(Emu.GetGSManager().GetRender().m_gcm_buffers_addr);
|
||||
|
||||
buffers[id].offset = re(offset);
|
||||
buffers[id].pitch = re(pitch);
|
||||
buffers[id].width = re(width);
|
||||
buffers[id].height = re(height);
|
||||
|
||||
if(id + 1 > Emu.GetGSManager().GetRender().m_gcm_buffers_count)
|
||||
{
|
||||
Emu.GetGSManager().GetRender().m_gcm_buffers_count = id + 1;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ int sys_ppu_thread_exit(int errorcode)
|
||||
|
||||
PPUThread& thr = GetCurrentPPUThread();
|
||||
thr.SetExitStatus(errorcode);
|
||||
wxGetApp().SendDbgCommand(DID_EXIT_THR_SYSCALL, &thr);
|
||||
Emu.GetCPU().RemoveThread(thr.GetId());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
@ -157,7 +157,6 @@ void sys_ppu_thread_once(u32 once_ctrl_addr, u32 entry)
|
||||
|
||||
PPCThread& new_thread = Emu.GetCPU().AddThread(PPC_THREAD_PPU);
|
||||
new_thread.SetEntry(entry);
|
||||
((PPUThread&)new_thread).LR = Emu.GetPPUThreadExit();
|
||||
new_thread.Run();
|
||||
new_thread.Exec();
|
||||
|
||||
|
@ -138,9 +138,10 @@ void Emulator::Load()
|
||||
callback_data += SC(2);
|
||||
callback_data += BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
|
||||
m_ppu_thr_exit = Memory.MainMem.Alloc(4 * 3);
|
||||
m_ppu_thr_exit = Memory.MainMem.Alloc(4 * 4);
|
||||
|
||||
mem32_t ppu_thr_exit_data(m_ppu_thr_exit);
|
||||
ppu_thr_exit_data += ADDI(3, 0, 0);
|
||||
ppu_thr_exit_data += ADDI(11, 0, 41);
|
||||
ppu_thr_exit_data += SC(2);
|
||||
ppu_thr_exit_data += BCLR(0x10 | 0x04, 0, 0, 0);
|
||||
|
@ -302,6 +302,9 @@ void InterpreterDisAsmFrame::HandleCommand(wxCommandEvent& event)
|
||||
switch(event.GetId())
|
||||
{
|
||||
case DID_STOPED_EMU:
|
||||
UpdateUnitList();
|
||||
break;
|
||||
|
||||
case DID_PAUSED_EMU:
|
||||
//DoUpdate();
|
||||
break;
|
||||
|
@ -20,6 +20,7 @@ enum IDs
|
||||
id_boot_game,
|
||||
id_sys_pause,
|
||||
id_sys_stop,
|
||||
id_sys_send_open_menu,
|
||||
id_sys_send_exit,
|
||||
id_config_emu,
|
||||
id_config_vfs_manager,
|
||||
@ -35,8 +36,9 @@ wxString GetPaneName()
|
||||
}
|
||||
|
||||
MainFrame::MainFrame()
|
||||
: FrameBase(NULL, wxID_ANY, "", "MainFrame", wxSize(800, 600))
|
||||
: FrameBase(nullptr, wxID_ANY, "", "MainFrame", wxSize(800, 600))
|
||||
, m_aui_mgr(this)
|
||||
, m_sys_menu_opened(false)
|
||||
{
|
||||
SetLabel(wxString::Format(_PRGNAME_ " " _PRGVER_));
|
||||
wxMenuBar& menubar(*new wxMenuBar());
|
||||
@ -57,6 +59,7 @@ MainFrame::MainFrame()
|
||||
menu_sys.Append(id_sys_pause, "Pause")->Enable(false);
|
||||
menu_sys.Append(id_sys_stop, "Stop\tCtrl + S")->Enable(false);
|
||||
menu_sys.AppendSeparator();
|
||||
menu_sys.Append(id_sys_send_open_menu, "Send open system menu cmd")->Enable(false);
|
||||
menu_sys.Append(id_sys_send_exit, "Send exit cmd")->Enable(false);
|
||||
|
||||
menu_conf.Append(id_config_emu, "Settings");
|
||||
@ -75,6 +78,7 @@ MainFrame::MainFrame()
|
||||
|
||||
Connect( id_sys_pause, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::Pause) );
|
||||
Connect( id_sys_stop, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::Stop) );
|
||||
Connect( id_sys_send_open_menu, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::SendOpenCloseSysMenu) );
|
||||
Connect( id_sys_send_exit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::SendExit) );
|
||||
|
||||
Connect( id_config_emu, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrame::Config) );
|
||||
@ -272,6 +276,13 @@ void MainFrame::SendExit(wxCommandEvent& event)
|
||||
Emu.GetCallbackManager().m_exit_callback.Handle(0x0101, 0);
|
||||
}
|
||||
|
||||
void MainFrame::SendOpenCloseSysMenu(wxCommandEvent& event)
|
||||
{
|
||||
Emu.GetCallbackManager().m_exit_callback.Handle(m_sys_menu_opened ? 0x0132 : 0x0131, 0);
|
||||
m_sys_menu_opened = !m_sys_menu_opened;
|
||||
UpdateUI(wxCommandEvent());
|
||||
}
|
||||
|
||||
void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
//TODO
|
||||
@ -410,6 +421,7 @@ void MainFrame::UpdateUI(wxCommandEvent& event)
|
||||
is_runned = false;
|
||||
is_stopped = true;
|
||||
is_ready = false;
|
||||
m_sys_menu_opened = false;
|
||||
break;
|
||||
|
||||
case DID_PAUSE_EMU:
|
||||
@ -432,11 +444,14 @@ void MainFrame::UpdateUI(wxCommandEvent& event)
|
||||
is_ready = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
case DID_REGISTRED_CALLBACK:
|
||||
is_runned = Emu.IsRunned();
|
||||
is_stopped = Emu.IsStopped();
|
||||
is_ready = Emu.IsReady();
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -450,14 +465,18 @@ void MainFrame::UpdateUI(wxCommandEvent& event)
|
||||
wxMenuItem& pause = *menubar.FindItem( id_sys_pause );
|
||||
wxMenuItem& stop = *menubar.FindItem( id_sys_stop );
|
||||
wxMenuItem& send_exit = *menubar.FindItem( id_sys_send_exit );
|
||||
|
||||
wxMenuItem& send_open_menu = *menubar.FindItem( id_sys_send_open_menu );
|
||||
pause.SetText(is_runned ? "Pause\tCtrl + P" : is_ready ? "Start\tCtrl + C" : "Resume\tCtrl + C");
|
||||
pause.Enable(!is_stopped);
|
||||
stop.Enable(!is_stopped);
|
||||
//send_exit.Enable(false);
|
||||
send_exit.Enable(!is_stopped && Emu.GetCallbackManager().m_exit_callback.m_callbacks.GetCount());
|
||||
bool enable_commands = !is_stopped && Emu.GetCallbackManager().m_exit_callback.m_callbacks.GetCount();
|
||||
|
||||
m_aui_mgr.Update();
|
||||
send_open_menu.SetText(wxString::Format("Send %s system menu cmd", m_sys_menu_opened ? "close" : "open"));
|
||||
send_open_menu.Enable(enable_commands);
|
||||
send_exit.Enable(enable_commands);
|
||||
|
||||
//m_aui_mgr.Update();
|
||||
|
||||
//wxCommandEvent refit( wxEVT_COMMAND_MENU_SELECTED, id_update_dbg );
|
||||
//GetEventHandler()->AddPendingEvent( refit );
|
||||
|
@ -7,6 +7,7 @@ class MainFrame : public FrameBase
|
||||
GameViewer* m_game_viewer;
|
||||
wxAuiManager m_aui_mgr;
|
||||
AppConnector m_app_connector;
|
||||
bool m_sys_menu_opened;
|
||||
|
||||
public:
|
||||
MainFrame();
|
||||
@ -24,6 +25,7 @@ private:
|
||||
void Pause(wxCommandEvent& event);
|
||||
void Stop(wxCommandEvent& event);
|
||||
void SendExit(wxCommandEvent& event);
|
||||
void SendOpenCloseSysMenu(wxCommandEvent& event);
|
||||
void Config(wxCommandEvent& event);
|
||||
void ConfigVFS(wxCommandEvent& event);
|
||||
void ConfigVHDD(wxCommandEvent& event);
|
||||
|
@ -247,6 +247,7 @@
|
||||
<ClCompile Include="Emu\SysCalls\Modules.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellGcmSys.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellSysmodule.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellSysutil.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\sysPrxForUser.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\sys_fs.cpp" />
|
||||
<ClCompile Include="Emu\SysCalls\Modules\sys_io.cpp" />
|
||||
|
@ -280,6 +280,9 @@
|
||||
<ClCompile Include="Gui\TextInputDialog.cpp">
|
||||
<Filter>Gui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Emu\SysCalls\Modules\cellSysutil.cpp">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="rpcs3.rc" />
|
||||
|
Loading…
Reference in New Issue
Block a user