diff options
Diffstat (limited to 'sources/meta')
-rw-r--r-- | sources/meta/exec.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) |