instruction encoding and decoding working
This commit is contained in:
10
src/emu.h
10
src/emu.h
@@ -3,8 +3,13 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include "memory.h"
|
||||
|
||||
#define FLAG_ZERO (1 << 0)
|
||||
#define FLAG_NEGATIVE (1 << 1)
|
||||
#define FLAG_OVERFLOW (1 << 2)
|
||||
|
||||
// -- TYPES -- //
|
||||
typedef struct {
|
||||
uint16_t regs[REG_MAX];
|
||||
@@ -13,8 +18,11 @@ typedef struct {
|
||||
uint32_t pc;
|
||||
uint32_t ihp;
|
||||
uint32_t sp;
|
||||
|
||||
bool halted;
|
||||
} Emulator;
|
||||
|
||||
// -- FUNCTIONS -- //
|
||||
Emulator* initEmulator(uint32_t memorySize);
|
||||
void freeEmulator(Emulator* emu);
|
||||
void freeEmulator(Emulator* emu);
|
||||
void startEmulator(Emulator* emu);
|
||||
Reference in New Issue
Block a user