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

astrocade: support mid-screen updates w/ palette changes

This commit is contained in:
Steven Hugg 2019-06-11 22:55:45 -04:00
parent 96131f6cd0
commit 11957bb086
2 changed files with 12 additions and 2 deletions

View File

@ -156,7 +156,6 @@ TODO:
- switching platform of a repo?
- make sure to flatten subdirs
- astrocade
- what if update earlier part of screen with different palette? it'd be nice to have instant updates when debugging tho...
- ctrl+alt+l on ubuntu locks screen
WEB WORKER FORMAT

View File

@ -103,14 +103,20 @@ const _BallyAstrocadePlatform = function(mainElement, arcade) {
var palette = new Uint32Array(8);
var palinds = new Uint8Array(8);
var refreshlines = 0;
var dirtylines = new Uint8Array(arcade ? 262 : 131);
var vidactive = false;
var rotdata = new Uint8Array(4);
var rotcount = 0;
var intst = 0;
function ramwrite(a:number, v:number) {
// set RAM
ram.mem[a] = v;
ramupdate(a, v);
// mark scanline as dirty
dirtylines[Math.floor((a & 0xfff)/swbytes)] = 1;
// this was old behavior where we updated instantly
// but it had problems if we had mid-screen palette changes
//ramupdate(a, v);
}
function ramupdate(a:number, v:number) {
@ -386,9 +392,14 @@ const _BallyAstrocadePlatform = function(mainElement, arcade) {
}
// refresh this line in frame buffer?
if (sl < sheight && refreshlines>0) {
dirtylines[sl] = 0;
refreshline(sl);
refreshlines--;
}
else if (dirtylines[sl]) {
dirtylines[sl] = 0;
refreshline(sl);
}
}
if (!novideo) {
video.updateFrame(0, 0, 0, 0, swidth, verbl);