From 90f1c5689c4fc5f4ad75d544496c16ce54d01533 Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Date: Mon, 19 Jul 2021 16:58:51 +0100 Subject: Feature: Implemented instructions to run the logo rom --- emulator.h | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) (limited to 'emulator.h') diff --git a/emulator.h b/emulator.h index 78ae516..05cd3ef 100644 --- a/emulator.h +++ b/emulator.h @@ -1,32 +1,42 @@ #ifndef _EMULATOR_H_ #define _EMULATOR_H_ -#include #include +#include +#include #include #include typedef struct { // general purpose registers - uint8_t V0; - uint8_t V1; - uint8_t V2; - uint8_t V3; - uint8_t V4; - uint8_t V5; - uint8_t V6; - uint8_t V7; - uint8_t V8; - uint8_t V9; - uint8_t VA; - uint8_t VB; - uint8_t VC; - uint8_t VD; - uint8_t VE; - uint8_t VF; //flag register + union + { + uint8_t V[16]; //VF is the flag register + + struct + { + uint8_t V0; + uint8_t V1; + uint8_t V2; + uint8_t V3; + uint8_t V4; + uint8_t V5; + uint8_t V6; + uint8_t V7; + uint8_t V8; + uint8_t V9; + uint8_t VA; + uint8_t VB; + uint8_t VC; + uint8_t VD; + uint8_t VE; + uint8_t VF; //flag register + }; + }; - uint16_t I; // index register + // index register + uint16_t I; } Registers; typedef struct -- cgit 1.4.1