diff --git a/etc/mkuxn-fast.lua b/etc/mkuxn-fast.lua index 21c31b2..8c15f72 100644 --- a/etc/mkuxn-fast.lua +++ b/etc/mkuxn-fast.lua @@ -322,6 +322,7 @@ uxn_eval(Uxn *u, Uint16 vec) if(u->dev[0].dat[0xf]) return 0; u->ram.ptr = vec; + if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8; while(u->ram.ptr) { instr = u->ram.dat[u->ram.ptr++]; switch(instr) { diff --git a/etc/mkuxn-fast.moon b/etc/mkuxn-fast.moon index c8ce667..4247bc5 100644 --- a/etc/mkuxn-fast.moon +++ b/etc/mkuxn-fast.moon @@ -231,6 +231,7 @@ uxn_eval(Uxn *u, Uint16 vec) if(u->dev[0].dat[0xf]) return 0; u->ram.ptr = vec; + if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8; while(u->ram.ptr) { instr = u->ram.dat[u->ram.ptr++]; switch(instr) { diff --git a/src/uxn-fast.c b/src/uxn-fast.c index ca462d2..9b74de6 100644 --- a/src/uxn-fast.c +++ b/src/uxn-fast.c @@ -45,6 +45,7 @@ uxn_eval(Uxn *u, Uint16 vec) if(u->dev[0].dat[0xf]) return 0; u->ram.ptr = vec; + if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8; while(u->ram.ptr) { instr = u->ram.dat[u->ram.ptr++]; switch(instr) { diff --git a/src/uxn.c b/src/uxn.c index 8015b48..bedb654 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -125,6 +125,7 @@ uxn_eval(Uxn *u, Uint16 vec) if(u->dev[0].dat[0xf]) return 0; u->ram.ptr = vec; + if(u->wst.ptr > 0xf8) u->wst.ptr = 0xf8; while(u->ram.ptr) { Uint8 instr = u->ram.dat[u->ram.ptr++]; /* Return Mode */