Exophase
Nothing good will ever come of Exophase.
Some numbers about the Wiz's video default video timings:
Horizontal clocks per line: 330
Lines per display: 335 (320 in active display, 3 in vertical sync, 7 from vertical sync to start of active display, 327 from start of vertical sync to end of active display.. there's probably a fudge factor of something else in there)
Frame period: 11.3167ms, measured with timers.
That gives a VCLK period of ~0.102367us, or 9.769MHz.. it's possibly really 10MHz take some roundoff.
This is 88.365 frames per second, which is not a good refresh rate for games. So I changed the number of VCLKs per horizontal line to 487 and got 59.89Hz, and waited for vsync on every frame. Good, except now the diagonal tearing was MUCH more noticeable. Like, on every frame.
So I figured I'd push my luck and try for 120Hz to get the best of both worlds. And sure enough, it seems to work fine. It's hard to tell if the diagonal tearing is better or worse than it was before - obviously it won't every go away completely. It's something that happens when the display update aligns with the OLED's refresh rate. If the OLED is being driven at 60Hz then I think something that's not a multiple of 60Hz will actually be better. Unfortunately, that doesn't synchronize well with games. I don't really know what the best solution is and will probably experiment more. Once we get something out of the way to eliminate landscape mode then things might be different.
If anyone wants to play around with it too, here are some register locations (offset from 0xC0000000)
CODE
typedef enum
{
DPC_HTOTAL = 0x307C,
DPC_VTOTAL = 0x3084,
DPC_VSWIDTH = 0x3086,
DPC_VASTART = 0x3088,
DPC_VAEND = 0x308A,
DPC_CONTROL0 = 0x308C
} wiz_dplc_regs_enum;
Here's a wait for vsync:
CODE
void wiz_wait_vsync_poll()
{
while((wiz_reg16(DPC_CONTROL0) & (1 << 10)) == 0);
wiz_reg16(DPC_CONTROL0) |= (1 << 10);
}
I modified DPC_HTOTAL to change the number of clocks per line.
Horizontal clocks per line: 330
Lines per display: 335 (320 in active display, 3 in vertical sync, 7 from vertical sync to start of active display, 327 from start of vertical sync to end of active display.. there's probably a fudge factor of something else in there)
Frame period: 11.3167ms, measured with timers.
That gives a VCLK period of ~0.102367us, or 9.769MHz.. it's possibly really 10MHz take some roundoff.
This is 88.365 frames per second, which is not a good refresh rate for games. So I changed the number of VCLKs per horizontal line to 487 and got 59.89Hz, and waited for vsync on every frame. Good, except now the diagonal tearing was MUCH more noticeable. Like, on every frame.
So I figured I'd push my luck and try for 120Hz to get the best of both worlds. And sure enough, it seems to work fine. It's hard to tell if the diagonal tearing is better or worse than it was before - obviously it won't every go away completely. It's something that happens when the display update aligns with the OLED's refresh rate. If the OLED is being driven at 60Hz then I think something that's not a multiple of 60Hz will actually be better. Unfortunately, that doesn't synchronize well with games. I don't really know what the best solution is and will probably experiment more. Once we get something out of the way to eliminate landscape mode then things might be different.
If anyone wants to play around with it too, here are some register locations (offset from 0xC0000000)
CODE
typedef enum
{
DPC_HTOTAL = 0x307C,
DPC_VTOTAL = 0x3084,
DPC_VSWIDTH = 0x3086,
DPC_VASTART = 0x3088,
DPC_VAEND = 0x308A,
DPC_CONTROL0 = 0x308C
} wiz_dplc_regs_enum;
Here's a wait for vsync:
CODE
void wiz_wait_vsync_poll()
{
while((wiz_reg16(DPC_CONTROL0) & (1 << 10)) == 0);
wiz_reg16(DPC_CONTROL0) |= (1 << 10);
}
I modified DPC_HTOTAL to change the number of clocks per line.