From 0533b005901b976e3e6d11d7ec5078118bbe5a2f Mon Sep 17 00:00:00 2001 From: dweller Date: Fri, 4 Apr 2025 00:00:52 +0300 Subject: fix DRW instruction, add arena to iui so I don't need to manage label buffers --- sources/meta/exec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sources/meta/exec.c') diff --git a/sources/meta/exec.c b/sources/meta/exec.c index 4f34d1b..663a2ae 100644 --- a/sources/meta/exec.c +++ b/sources/meta/exec.c @@ -237,7 +237,6 @@ BEGIN \ if(c8->V[x] != c8->V[y]) c8->pc += 2; \ END -/* FIXME: correct wrapping, test */ #define X_C8_DRW \ BEGIN \ u8 l; \ @@ -245,7 +244,11 @@ BEGIN \ u8 cy = c8->V[y]; \ \ for(l = 0; l < n; l++) \ - c8->DISPLAY[(cy + l) % 32] ^= ((u64)c8->RAM[c8->i + l]) << (64 - cx); \ + { \ + u64 pix = (u64)c8->RAM[c8->i + l]; \ + pix = (pix << (64 - cx)) | (pix >> cx); \ + c8->DISPLAY[(cy + l) % 32] ^= pix; \ + } \ END c8_decode_generate(exec) -- cgit v1.2.3