1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-15 06:29:32 +00:00

atari7800: new presets; fixed indirect timing

This commit is contained in:
Steven Hugg 2019-09-08 18:07:07 -05:00
parent bb330ae6e6
commit e45806e8cf
3 changed files with 33 additions and 2 deletions

27
presets/atari7800/wsync.c Normal file
View File

@ -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<y1; i++) {
WSYNC();
}
// set the background color on each scanline
for (i=0; i<y2; i++) {
MARIA.BACKGRND = P6532.SWCHA - i;
WSYNC();
}
// clear the background after the final scanline
MARIA.BACKGRND = 0;
// move bar slowly downward
y1++;
}
}

View File

@ -191,7 +191,7 @@ class MARIA {
this.cycles = 0;
this.pixels.fill(this.regs[0x0]);
if (this.isDMAEnabled()) {
this.cycles += 16;
this.cycles += 16; // TODO: last line in zone gets additional 8 cycles
// time for a new DLL entry?
if (this.offset < 0) {
this.readDLLEntry(bus);
@ -237,7 +237,10 @@ class MARIA {
let data = this.readDMA( dbl ? (gfxadr+(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

View File

@ -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<Atari7800> implements Platform {