commit 74b387b

Devine Lu Linvega  ·  2025-01-22 03:33:31 +0000 UTC
parent 2987ebe
Tiny optimization to expansion port
1 files changed,  +3, -3
+3, -3
 1@@ -101,10 +101,10 @@ system_deo(Uint8 port)
 2 			for(; a < b; uxn.ram[c++] = uxn.ram[a++]);
 3 		} else if(uxn.ram[addr] == 0x2) {
 4 			unsigned int a = PEEK2(aptr + 3) * 0x10000 + PEEK2(aptr + 5);
 5-			unsigned int b = a + length - 1;
 6+			unsigned int b = a + length;
 7 			unsigned int c = PEEK2(aptr + 7) * 0x10000 + PEEK2(aptr + 9);
 8-			unsigned int d = c + length - 1;
 9-			for(; b >= a; uxn.ram[d--] = uxn.ram[b--]);
10+			unsigned int d = c + length;
11+			for(; b >= a; uxn.ram[--d] = uxn.ram[--b]);
12 		} else
13 			fprintf(stderr, "Unknown Expansion Command 0x%02x\n", uxn.ram[addr]);
14 		break;