From 7f509298a981ce19dde857449e73d5c23d176797 Mon Sep 17 00:00:00 2001 From: Jake Date: Thu, 13 Jul 2017 01:31:57 -0500 Subject: [PATCH] fix video playback --- rpcs3/Emu/Cell/lv2/sys_rsx.cpp | 14 ++++++-------- rpcs3/Emu/RSX/rsx_methods.cpp | 3 --- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index 4bfe5cfc01..75bb574d54 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -12,6 +12,8 @@ namespace vm { using namespace ps3; } logs::channel sys_rsx("sys_rsx"); +extern u64 get_timebased_time(); + struct RsxDriverInfo { be_t version_driver; // 0x0 be_t version_gpu; // 0x4 @@ -28,7 +30,7 @@ struct RsxDriverInfo { be_t systemModeFlags; // 0x54 u8 unk4[0x1064]; // 0x10B8 struct Head { - be_t lastFlip; // 0x0 last flip time + be_t lastFlipTime; // 0x0 last flip time be_t flipFlags; // 0x8 flags to handle flip/queue be_t unk1; // 0xC be_t flipBufferId; // 0x10 @@ -98,9 +100,8 @@ struct RsxReports { be_t g_rsx_event_port{ 0 }; u32 g_driverInfo{ 0 }; -// this timestamp is a complete guess, it seems 'roughly' right for now so im just leaving it u64 rsxTimeStamp() { - return (get_system_time() / 1000000 * 0x5F5E100); + return get_timebased_time(); } s32 sys_rsx_device_open() @@ -323,7 +324,7 @@ s32 sys_rsx_context_attribute(s32 context_id, u32 package_id, u64 a3, u64 a4, u6 case 0x102: // Display flip driverInfo.head[a3].flipFlags |= 0x80000000; - driverInfo.head[a3].lastFlip = rsxTimeStamp(); // should rsxthread set this? + driverInfo.head[a3].lastFlipTime = rsxTimeStamp(); // should rsxthread set this? // lets give this a shot for giving bufferid back to gcm driverInfo.head[a3].flipBufferId = driverInfo.head[a3].queuedBufferId; // seems gcmSysWaitLabel uses this offset, so lets set it to 0 every flip @@ -390,15 +391,12 @@ s32 sys_rsx_context_attribute(s32 context_id, u32 package_id, u64 a3, u64 a4, u6 auto& tile = render->tiles[a3]; tile.location = ((a4 >> 32) & 0xF) - 1; tile.offset = ((((a4 >> 32) & 0xFFFFFFFF) >> 16) * 0x10000); - tile.size = ((((a4 & 0x7FFFFFFF) >> 16) + 1) * 0x10000) - tile.offset; // size is wrong, + tile.size = ((((a4 & 0x7FFFFFFF) >> 16) + 1) * 0x10000) - tile.offset; tile.pitch = (((a5 >> 32) & 0xFFFFFFFF) >> 8) * 0x100; tile.comp = ((a5 & 0xFFFFFFFF) >> 26) & 0xF; tile.base = (a5 & 0xFFFFFFFF) & 0x7FF; tile.bank = (((a4 >> 32) & 0xFFFFFFFF) >> 4) & 0xF; tile.binded = a5 != 0; - - sys_rsx.error("package 0x300 tile, index=%d, location=%d, offset=%d, size=%d, pitch=%d, comp=%d, base=%d, bank=%d", - a3, tile.location, tile.offset, tile.size, tile.pitch, tile.comp, tile.base, tile.bank); } break; diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index bb3bf6bff6..d309007c49 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -61,7 +61,6 @@ namespace rsx void set_context_dma_semaphore(thread* rsx, u32 _reg, u32 arg) { - LOG_ERROR(RSX, "dmaSemaphore: 0x%x", arg); rsx->nv406e_semaphore_addr = arg; } @@ -73,7 +72,6 @@ namespace rsx //todo: make me atomic while (vm::ps3::read32(addr) != arg) { - //if (rsx->nv406e_semaphore_addr == CELL_GCM_CONTEXT_DMA_DEVICE_R || rsx->nv406e_semaphore_addr == CELL_GCM_CONTEXT_DMA_DEVICE_RW) // todo: why does this one keep hanging? is it vsh system semaphore? whats actually pushing this to the command buffer?! if (addr == 0x40000030) break; @@ -972,7 +970,6 @@ namespace rsx std::this_thread::sleep_for(std::chrono::milliseconds((s64)(1000.0 / limit - rsx->timer_sync.GetElapsedTimeInMilliSec()))); rsx->timer_sync.Start(); } - rsx->reset(); // fixes kh, so lets leave it here and see what happens sys_rsx_context_attribute(0x55555555, 0x102, index, arg, 0, 0); }