chip8

CHIP-8 emulator
git clone git://git.christosmarg.xyz/chip8.git
Log | Files | Refs | README | LICENSE

commit 00af84869fd5c1e894d3dddf21b6e080f77f135c
parent 5ff61a79e7a4b0a7bf18ab342ca84e6281492cda
Author: Christos Margiolis <christos@margiolis.net>
Date:   Wed, 21 Oct 2020 11:52:52 +0300

removed FETCH macro

Diffstat:
Mchip8.c | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/chip8.c b/chip8.c @@ -23,8 +23,6 @@ typedef unsigned char u_int8_t #define NN_MASK(x) (x & 0x00ff) #define NNN_MASK(x) (x & 0x0fff) #define ROM_SIZE_MAX (4096 - 512) -#define FETCH(c8) \ - (c8->opcode = c8->memory[c8->pc] << 8 | c8->memory[c8->pc + 1]) #define EXECUTE(pc) do { pc += 2; } while (0) struct Chip8 { @@ -141,7 +139,7 @@ romload(struct Chip8 *chip8, const char *fpath) void emulate(struct Chip8 *chip8) { - FETCH(opcode); + opcode = memory[pc] << 8 | memory[pc + 1]; if (decode(chip8)) { EXECUTE(pc); timers_update(chip8);