diff --git a/src/GPU.cpp b/src/GPU.cpp index 92f05d87..af8c5d8c 100644 --- a/src/GPU.cpp +++ b/src/GPU.cpp @@ -651,8 +651,11 @@ void StartHBlank(u32 line) { // draw // note: this should start 48 cycles after the scanline start - GPU2D_A->DrawScanline(line); - GPU2D_B->DrawScanline(line); + if (line < 192) + { + GPU2D_A->DrawScanline(line); + GPU2D_B->DrawScanline(line); + } NDS::CheckDMAs(0, 0x02); } diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp index d818c5ca..7521952e 100644 --- a/src/GPU3D.cpp +++ b/src/GPU3D.cpp @@ -607,6 +607,10 @@ int ClipPolygon(Vertex* vertices, int nverts, int clipstart) // TODO: check for 1-dot polygons // TODO: the hardware seems to use a different algorithm. it reacts differently to vertices with W=0 + // some vertices that should get Y=-0x1000 get Y=0x1000 for some reason on hardware. it doesn't make sense. + // clipping seems to process the Y plane before the X plane. + + // also, polygons with any negative W are completely rejected. (TODO) // X clipping nverts = ClipAgainstPlane<0, attribs>(vertices, nverts, clipstart); diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp index 01653e94..cce5d709 100644 --- a/src/GPU3D_Soft.cpp +++ b/src/GPU3D_Soft.cpp @@ -1522,8 +1522,7 @@ void ScanlineFinalPass(s32 y) if (RenderDispCnt & (1<<5)) { // edge marking - - // TODO: is it applied to bottom pixels? + // only applied to topmost pixels for (int x = 0; x < 256; x++) { @@ -1842,7 +1841,10 @@ void RenderThreadFunc() void RequestLine(int line) { if (RenderThreadRunning) - Platform::Semaphore_Wait(Sema_ScanlineCount); + { + if (line < 192) + Platform::Semaphore_Wait(Sema_ScanlineCount); + } } u32* GetLine(int line) diff --git a/src/NDS.cpp b/src/NDS.cpp index 10f3d640..271b6185 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -400,6 +400,7 @@ u32 RunFrame() s32 ndscyclestorun; s32 ndscycles = 0; + // TODO: give it some margin, so it can directly do 17 cycles instead of 16 then 1 CalcIterationCycles(); if (CPUStop & 0xFFFF) diff --git a/src/wx/main.cpp b/src/wx/main.cpp index 3c2375b5..302f5dae 100644 --- a/src/wx/main.cpp +++ b/src/wx/main.cpp @@ -496,8 +496,12 @@ wxThread::ExitCode EmuThread::Entry() u32 fps = (nframes * 1000) / diff; nframes = 0; + float fpstarget; + if (framerate < 1) fpstarget = 999; + else fpstarget = 1000.0f/framerate; + char melontitle[100]; - sprintf(melontitle, "%d FPS - melonDS " MELONDS_VERSION, fps); + sprintf(melontitle, "%d/%.0f FPS | melonDS " MELONDS_VERSION, fps, fpstarget); SDL_SetWindowTitle(sdlwin, melontitle); } }