Add thread logger, split renderer from PICA

This commit is contained in:
wheremyfoodat 2023-01-01 21:04:34 +02:00
parent 672a893938
commit 9f792c2cf5
5 changed files with 28 additions and 25 deletions

View file

@ -11,7 +11,7 @@ void Kernel::switchThread(int newThreadIndex) {
auto& oldThread = threads[currentThreadIndex];
auto& newThread = threads[newThreadIndex];
newThread.status = ThreadStatus::Running;
printf("Switching from thread %d to %d\n", currentThreadIndex, newThreadIndex);
logThread("Switching from thread %d to %d\n", currentThreadIndex, newThreadIndex);
// Bail early if the new thread is actually the old thread
if (currentThreadIndex == newThreadIndex) [[unlikely]] {
@ -70,8 +70,6 @@ std::optional<int> Kernel::getNextThread() {
if (canThreadRun(t)) {
return index;
}
// TODO: Check timeouts here
}
// No thread was found

View file

@ -191,8 +191,8 @@ void GPU::drawVertices(OpenGL::Primitives primType, Vertex* vertices, u32 count)
f24 depthOffset = f24::fromRaw(regs[PICAInternalRegs::DepthOffset] & 0xffffff);
printf("Depth enable: %d, func: %d, writeEnable: %d\n", depthEnable, depthFunc, depthWriteEnable);
if (depthScale.toFloat32() != -1.0 || depthOffset.toFloat32() != 0.0)
Helpers::panic("TODO: Implement depth scale/offset. Remove the depth *= -1.0 from vertex shader");
//if (depthScale.toFloat32() != -1.0 || depthOffset.toFloat32() != 0.0)
// Helpers::panic("TODO: Implement depth scale/offset. Remove the depth *= -1.0 from vertex shader");
// TODO: Actually use this
float viewportWidth = f24::fromRaw(regs[PICAInternalRegs::ViewportWidth] & 0xffffff).toFloat32() * 2.0;