From 5ddd2ed571b47555d08ffbe142e0237f3258b4dd Mon Sep 17 00:00:00 2001 From: Luxferre <3335173-suborg@users.noreply.gitlab.com> Date: Fri, 29 Jul 2022 07:56:45 +0300 Subject: [PATCH] Updated the screen implementation according to the spec --- web/esop-ext.js | 2 ++ web/uxncore.js | 1 + 2 files changed, 3 insertions(+) diff --git a/web/esop-ext.js b/web/esop-ext.js index 1098c3f..099cb85 100644 --- a/web/esop-ext.js +++ b/web/esop-ext.js @@ -79,6 +79,8 @@ function ESOPExtensions() { // also, we need to set up the screen vector var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame rAF(function vecframe() { + //the order is: clear - vector - render + vm.setramblk(vramOffset, new Uint8Array(vramSize)) vm.triggerVector(0) renderScreen() if(vm.active) diff --git a/web/uxncore.js b/web/uxncore.js index 6e479c4..70be98a 100644 --- a/web/uxncore.js +++ b/web/uxncore.js @@ -171,6 +171,7 @@ function UxnCore() { getdev: function(port) {return mem.dev[port]}, getram: function(start, length) {return mem.ram.subarray(start, start+length)}, setram: function(addr, bVal) {mem.ram[addr] = bVal}, + setramblk: function(addr, blk) {mem.ram.set(blk, addr)}, setWriteHook: function(port, cb) { if(!cb) cb = function(){} devWriteHooks[port] = cb