diff --git a/presets/atari7800/wsync.c b/presets/atari7800/wsync.c new file mode 100644 index 00000000..98f62dcc --- /dev/null +++ b/presets/atari7800/wsync.c @@ -0,0 +1,27 @@ + +#include "atari7800.h" + +void main() { + byte y1 = 110; // Y start of bar + byte y2 = 10; // height of bar + byte i; + while (1) { + // wait for end of frame / start of vblank + while ((MARIA.MSTAT & MSTAT_VBLANK) == 0) ; + // wait for end of vblank / start of frame + while ((MARIA.MSTAT & MSTAT_VBLANK) != 0) ; + // skip scanlines until at top of bar + for (i=0; i>1)) : (gfxadr+i) ); if (indirect) { let indadr = ((this.regs[0x14] + this.offset) << 8) + data; - if (dbl && (i&1)) indadr++; + if (dbl && (i&1)) { + indadr++; + this.cycles -= 3; // indirect read has 6/9 cycles + } data = this.readDMA(indadr); } // TODO: more modes diff --git a/src/platform/atari7800.ts b/src/platform/atari7800.ts index 023c4e54..eb50c09e 100644 --- a/src/platform/atari7800.ts +++ b/src/platform/atari7800.ts @@ -5,6 +5,7 @@ import { PLATFORMS } from "../emu"; var Atari7800_PRESETS = [ {id:'sprites.dasm', name:'Sprites (ASM)'}, + {id:'wsync.c', name:'WSYNC'}, ]; class Atari7800Platform extends Base6502MachinePlatform implements Platform {