Open kurtjd opened 6 months ago
Display wait is typically implemented easiest by ending a frame when a draw opcode was used or only executing a draw if it is the first opcode of a frame, either one works. As you implement your timing using two accumulators, one for cpu, one for timers, it seems a bit more tricky, like the you could set a flag in the display updated condition and the execute resets it every time it executed an opcode and inside the draw you would reset the pc to say on the draw if that frag is not set. Also be aware that you don't need three accumulators for screen, delay and sound, as they are all in sync on every CHIP-8 variant, even those that run on non-60Hz frame rates (like the actual HP-48 SCHIP that ran on 64Hz, or Dream6800 CHIIP-8 that ran at 50Hz) the timers are supposed to run at the frame rate.
The quirks "CLIPPING ERR2" comes from the fact that the initial coordinates of a sprite draw are to be wrapped, no matter if wrapping is selected as quirk or not. The clipping quirk just selects what happens to the pixels drawn inside the draw loop.
Scrolling: First of all, legacy SCHIP means SCHIP as on the HP-48SX. On the HP scrolling was always done in display resolution, meaning that e.g. horizontal scroll will scroll by 4 display (hires) pixels, and in lores that looks like scrolling two logical pixels. In modern SCHIP and XO-CHIP scrolling is always done in logical pixels, so lores 4 pixel scroll scrolls 8 physical pixels if one always uses a physical resolution of 128x64 and just scales lores draws.
There appear to be issues with sprite clipping and scrolling (as well as display wait not being implemented):
Running quirks test in legacy mode:
./jaxe -l ../roms/optests/chip8-test-suite/5-quirks.ch8
Running quirks test in S-CHIP mode:
./jaxe ../roms/optests/chip8-test-suite/5-quirks.ch8
S-CHIP Legacy: S-CHIP Modern: ^^^ Not sure about the difference between "S-CHIP legacy" and regular CHIP-8 mode (which I call "legacy")
Running scrolling test in S-CHIP mode:
./jaxe ../roms/optests/chip8-test-suite/8-scrolling.ch8
S-CHIP modern lores:
Running scrolling test in XO-CHIP mode:
./jaxe -x ../roms/optests/chip8-test-suite/8-scrolling.ch8
XO-CHIP lores:
To summarize: