Fix a bug where v[X] was not handled in 0xFX55 and 0xFX65, use memcpy instead of looping, increment i like in the original implementation

This commit is contained in:
Franck STAUFFER 2020-08-03 16:36:19 +02:00
parent 522af3833a
commit ab05516329
Signed by: franck.stauffer
GPG Key ID: AAF5A94045CEC261
1 changed files with 4 additions and 4 deletions

View File

@ -388,13 +388,13 @@ op_handler(void)
pc += 2;
return 1;
case 0xF055:
for (register uint_fast8_t t = 0; t < X; ++t)
memory[i + t] = v[t];
memcpy(memory + i, v, ((X) + 1) * sizeof(byte));
i += (X) + 1;
pc += 2;
return 1;
case 0xF065:
for (register uint_fast8_t t = 0; t < X; ++t)
v[t] = memory[i + t];
memcpy(v, memory + i, ((X) + 1) * sizeof(byte));
i += (X) + 1;
pc += 2;
return 1;
default: