uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 38f534d9ecda12cba041bcf23a9b59614aa1588d
parent 8926bbab2ac0d39e1298e546cb9acab29669f7ce
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Wed,  3 Nov 2021 07:15:14 +0000

Allow shifts up to 0xf in byte mode

Diffstat:
Msrc/uxn-fast.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/uxn-fast.c b/src/uxn-fast.c @@ -478,7 +478,7 @@ uxn_eval(Uxn *u, Uint16 vec) case 0x1f: /* SFT */ { Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; - u->wst.dat[u->wst.ptr - 2] = b >> (a & 0x07) << ((a & 0x70) >> 4); + u->wst.dat[u->wst.ptr - 2] = b >> (a & 0x0f) << ((a & 0xf0) >> 4); #ifndef NO_STACK_CHECKS if(__builtin_expect(u->wst.ptr < 2, 0)) { u->wst.error = 1; @@ -1384,7 +1384,7 @@ uxn_eval(Uxn *u, Uint16 vec) case 0x5f: /* SFTr */ { Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; - u->rst.dat[u->rst.ptr - 2] = b >> (a & 0x07) << ((a & 0x70) >> 4); + u->rst.dat[u->rst.ptr - 2] = b >> (a & 0x0f) << ((a & 0xf0) >> 4); #ifndef NO_STACK_CHECKS if(__builtin_expect(u->rst.ptr < 2, 0)) { u->rst.error = 1; @@ -2374,7 +2374,7 @@ uxn_eval(Uxn *u, Uint16 vec) case 0x9f: /* SFTk */ { Uint8 a = u->wst.dat[u->wst.ptr - 1], b = u->wst.dat[u->wst.ptr - 2]; - u->wst.dat[u->wst.ptr] = b >> (a & 0x07) << ((a & 0x70) >> 4); + u->wst.dat[u->wst.ptr] = b >> (a & 0x0f) << ((a & 0xf0) >> 4); #ifndef NO_STACK_CHECKS if(__builtin_expect(u->wst.ptr < 2, 0)) { u->wst.error = 1; @@ -3448,7 +3448,7 @@ uxn_eval(Uxn *u, Uint16 vec) case 0xdf: /* SFTkr */ { Uint8 a = u->rst.dat[u->rst.ptr - 1], b = u->rst.dat[u->rst.ptr - 2]; - u->rst.dat[u->rst.ptr] = b >> (a & 0x07) << ((a & 0x70) >> 4); + u->rst.dat[u->rst.ptr] = b >> (a & 0x0f) << ((a & 0xf0) >> 4); #ifndef NO_STACK_CHECKS if(__builtin_expect(u->rst.ptr < 2, 0)) { u->rst.error = 1;