0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-23 22:35:11 +00:00

Removed redundant modulo operations.

This commit is contained in:
Andrew Alderwick 2021-03-28 20:37:37 +01:00
parent 296d4c5070
commit 44157aae5b

View file

@ -64,7 +64,7 @@ void op_div(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b
void op_and(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b & a); }
void op_ora(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b | a); }
void op_eor(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b ^ a); }
void op_sft(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b >> ((a & 0x0f) % 8) << (((a & 0xf0) >> 4) % 8)); }
void op_sft(Uxn *u) { Uint8 a = pop8(u->src), b = pop8(u->src); push8(u->src, b >> (a & 0x07) << ((a & 0x70) >> 4)); }
/* Stack */
void op_lit16(Uxn *u) { u->literal += 2; }
void op_nop16(Uxn *u) { printf("%04x\n", pop16(u->src)); }
@ -97,7 +97,7 @@ void op_div16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->s
void op_and16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b & a); }
void op_ora16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b | a); }
void op_eor16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b ^ a); }
void op_sft16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b >> ((a & 0x000f) % 16) << (((a & 0x00f0) >> 4) % 16)); }
void op_sft16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b >> (a & 0x000f) << ((a & 0x00f0) >> 4)); }
void (*ops[])(Uxn *u) = {
op_brk, op_nop, op_lit, op_pop, op_dup, op_swp, op_ovr, op_rot,