Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timendus' test suite revealing issues with clipping and scrolling #22

Open
kurtjd opened this issue Apr 12, 2024 · 1 comment
Open

Timendus' test suite revealing issues with clipping and scrolling #22

kurtjd opened this issue Apr 12, 2024 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kurtjd
Copy link
Owner

kurtjd commented Apr 12, 2024

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

chip8_legacy_5

Running quirks test in S-CHIP mode:
./jaxe ../roms/optests/chip8-test-suite/5-quirks.ch8

S-CHIP Legacy:
chip8_schip_legacy_5
S-CHIP Modern:
chip8_schip_modern_5
^^^ 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:
chip8_schip_lores_modern_8

Running scrolling test in XO-CHIP mode:
./jaxe -x ../roms/optests/chip8-test-suite/8-scrolling.ch8

XO-CHIP lores:
chip8_xochip_lores_8

To summarize:

  • Display wait (draw with vertical blank interrupt) needs implementing
  • Sprite clipping has issues
  • Scrolling in XO-CHIP and S-CHIP lores modes has issues
@kurtjd kurtjd added bug Something isn't working help wanted Extra attention is needed labels Apr 12, 2024
@gulrak
Copy link

gulrak commented May 3, 2024

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants