diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2021-07-19 16:58:51 +0100 |
---|---|---|
committer | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2021-07-19 16:58:51 +0100 |
commit | 90f1c5689c4fc5f4ad75d544496c16ce54d01533 (patch) | |
tree | 460bb2e568b7b6f9f0015fc4657653ab0cacefd5 /emulator.c | |
parent | Feature: Added placeholder for basic instructions needed to run the logo rom (diff) | |
download | CHIP8-Emulator-90f1c5689c4fc5f4ad75d544496c16ce54d01533.tar.gz CHIP8-Emulator-90f1c5689c4fc5f4ad75d544496c16ce54d01533.tar.bz2 CHIP8-Emulator-90f1c5689c4fc5f4ad75d544496c16ce54d01533.zip |
Feature: Implemented instructions to run the logo rom
Diffstat (limited to 'emulator.c')
-rw-r--r-- | emulator.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/emulator.c b/emulator.c index 6bfdaa0..5962dc1 100644 --- a/emulator.c +++ b/emulator.c @@ -81,7 +81,7 @@ int emulator_tick(Emulator* emulator) switch(NNN) { case 0x000: - exit(1); + exit(1); //stop executing when program over case 0x0E0: //00E0: Clear screen printf("CLEAR SCREEN!\n"); break; @@ -90,6 +90,7 @@ int emulator_tick(Emulator* emulator) break; case 0x1: printf("JUMP! (0x%x)\n", NNN); + emulator->pc = NNN; break; case 0x2: break; @@ -101,14 +102,17 @@ int emulator_tick(Emulator* emulator) break; case 0x6: printf("SET REGISTER VX! (0x%x)\n", NN); + emulator->regs.V[X] = NN; break; case 0x7: printf("ADD VALUE TO REGISTER VX! (0x%x)\n", NN); + emulator->regs.V[X] += NN; break; case 0x8: break; case 0xA: printf("SET INDEX REGISTER I! (0x%x)\n", NNN); + emulator->regs.I = NNN; break; case 0xB: break; |