fix video playback

This commit is contained in:
Jake 2017-07-13 01:31:57 -05:00 committed by Zangetsu38
parent e2f3a1952f
commit 7f509298a9
2 changed files with 6 additions and 11 deletions

View file

@ -12,6 +12,8 @@ namespace vm { using namespace ps3; }
logs::channel sys_rsx("sys_rsx");
extern u64 get_timebased_time();
struct RsxDriverInfo {
be_t<u32> version_driver; // 0x0
be_t<u32> version_gpu; // 0x4
@ -28,7 +30,7 @@ struct RsxDriverInfo {
be_t<u32> systemModeFlags; // 0x54
u8 unk4[0x1064]; // 0x10B8
struct Head {
be_t<u64> lastFlip; // 0x0 last flip time
be_t<u64> lastFlipTime; // 0x0 last flip time
be_t<u32> flipFlags; // 0x8 flags to handle flip/queue
be_t<u32> unk1; // 0xC
be_t<u32> flipBufferId; // 0x10
@ -98,9 +100,8 @@ struct RsxReports {
be_t<u32> 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;

View file

@ -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);
}