First of all, I've hacked together a painfully simple read-only file system. Each file is prefixed with a 13-byte header; 8 bytes for the filename (padded with spaces), 3 bytes for the extension (padded with spaces) and two bytes for the file size. The above file listing can be generated by typing *. at the BASIC prompt.
I've written a new sprite drawing routine that scales sprites up to double size when in CHIP-8 mode; this allows CHIP-8 games to fill the entire screen. Unlike the existing sprite code, which I've retained for SCHIP games, it runs entirely from ROM; the existing sprite code has to be copied to RAM as it uses some horrible self-modifying code tricks. I should probably rewrite that bit next. [smile]
As for the bug I mentioned in the last post, it was because of this:
; --- snip ---; Group 9:; * 9XY0 - Skips the next instruction if VX doesn't equal VY.InstructionGroup.9 call GetRegisterX ld b,a call GetRegisterY cp b jp nz,SkipNextInstruction; Group A:; * ANNN - Sets I to the address NNN.InstructionGroup.A call GetLiteralNNN ld (DataPointer),hl jp ExecutedInstruction; --- snip ---
If an instruction in the form 9XY0 is executed and VX == VY, rather than jumping to ExecutedInstruction the code runs on and executes the instruction as if it had been an ANNN as well, which ended up destroying the data pointer. Adding a jp ExecutedInstruction after the jp nz,SkipNextInstruction fixed the bug.
One other advantage of the zoomed sprites is that "half-pixel" scrolls also work correctly:
...not that I've seen any game that uses them.
The last two screenshots show two versions of the game Blinky, one as a regular CHIP-8 program and the other taking advantages of the SCHIP extensions.
In regards to some of the things you mentioned in this and the previous post, a few random things that popped into my head that may or maynot help:
The problem of 2MHz to 10Mhz, do you have enough memory anywhere to have an screen buffer that you could just blit to the screen when the timing is appropriate? That way you could run at 10Mhz for the code and draw whenever. Of course, that would require that all S/CHIP-8 progs wait on one of the timers, not sure if they do or not. :/ <edit>So, wait. In your previous post, it stated that you already had a buffer since you had to rotate bits of it before sending it to hardware. So would this even be feasible?</edit>
As for the timer, anyway you could check the clock(I think you said it was $D0) and rig up something like:
Kinda ugly, I know. You could just combine it with the idea above, and do all of the instructions until it is time to draw. That would also provide a way to make the gameplay faster or slower.
Again, may not be feasible given your hardware setup. But meh. [disturbed]