summaryrefslogtreecommitdiff
path: root/emu/emul.h
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-11-22 20:38:51 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-11-22 20:38:51 +0100
commit6c3401b8a2ce7a2dfe21a253f840f286088b1921 (patch)
treef49b1bba8b10c3b3681927764cd795e7af4ad9e5 /emu/emul.h
parent052899e196c6a2660651b9896ceed3313e7d0bac (diff)
download6502-6c3401b8a2ce7a2dfe21a253f840f286088b1921.tar.gz
6502-6c3401b8a2ce7a2dfe21a253f840f286088b1921.tar.bz2
more work on emulator
Diffstat (limited to 'emu/emul.h')
-rw-r--r--emu/emul.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/emu/emul.h b/emu/emul.h
index cefa020..131cd4c 100644
--- a/emu/emul.h
+++ b/emu/emul.h
@@ -1,9 +1,37 @@
#ifndef EMUL_H
#define EMUL_H
+#include "6502.h"
+#include "memory.h"
+
+#include <stdbool.h>
+
+#ifdef WITH_GUI
+#include <SDL.h>
+#endif
+
enum {
ROM_START = 0xF800,
- ROM_SIZE = 2048
+ ROM_SIZE = 2048,
+ CPU_FREQUENCY = 1000000,
+ DISPLAY_FPS = 25
};
+typedef struct emul_t {
+ cpu_6502_t *cpu;
+ memory_t *memory;
+ bool gui;
+#ifdef WITH_GUI
+ SDL_Window *window;
+ SDL_Renderer *renderer;
+ SDL_Surface *background_image;
+ SDL_Texture *background_texture;
+#endif
+} emul_t;
+
+void emul_init( emul_t *emul, cpu_6502_t *cpu, memory_t *memory );
+void emul_start( emul_t *emul );
+void emul_run( emul_t *emul );
+void emul_free( emul_t *emul );
+
#endif