|
@@ -285,12 +285,14 @@ int main(int argc, char **argv) {
|
285
|
285
|
|
286
|
286
|
case 0xC000: // random generator
|
287
|
287
|
reg = (opcode & 0x0F00) >> 8;
|
288
|
|
- state.registers[reg] = (rand() % 255) & ((byte) opcode);
|
|
288
|
+ state.registers[reg] = (rand() % 256) & ((byte) opcode);
|
289
|
289
|
if (DEBUG) printf("Storing random in %i (%x)\n", reg, state.registers[reg]);
|
290
|
290
|
|
291
|
291
|
break;
|
292
|
292
|
|
293
|
293
|
case 0xD000: // draw sprite
|
|
294
|
+ state.registers[0xF] = 0;
|
|
295
|
+
|
294
|
296
|
first = (opcode & 0x0F00) >> 8;
|
295
|
297
|
second = (opcode & 0x00F0) >> 4;
|
296
|
298
|
|