aboutsummaryrefslogtreecommitdiff
path: root/vm.h
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-01 21:44:35 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-01 21:44:35 +0100
commitef84fb6fcb45a86fce97acda58606a76a937a1da (patch)
treea3e049b858724837cc9ce0106e30c9e1c028ddc6 /vm.h
parentc081dfe226c6e92865cbb97d8e9a2ef86d8c6acb (diff)
downloadtr8vm-ef84fb6fcb45a86fce97acda58606a76a937a1da.tar.gz
tr8vm-ef84fb6fcb45a86fce97acda58606a76a937a1da.zip
Added the VM player using SDL
- Wired basic functionality (fram-buffer, frame interrupt) - Bug fixes in the assembler
Diffstat (limited to 'vm.h')
-rw-r--r--vm.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/vm.h b/vm.h
index c35596d..4664168 100644
--- a/vm.h
+++ b/vm.h
@@ -25,18 +25,24 @@
#ifndef _TR8_H
#define _TR8_H
+#define VIDEO_RAM 0xbf00
+#define FRAME_INT_VECT 0xff00
+
typedef struct
{
uint16_t pc;
uint16_t sp;
uint16_t ssp;
uint8_t f;
+ uint8_t intr;
uint8_t regs[4];
- uint8_t *ram;
uint32_t icnt;
+ void (*write_m)(uint16_t, uint8_t);
+ uint8_t (*read_m)(uint16_t);
} Tr8;
-void tr8_init(Tr8 *vm, uint8_t *ram);
+void tr8_init(Tr8 *vm, void (*write_m)(uint16_t, uint8_t), uint8_t (*read_m)(uint16_t));
uint8_t tr8_eval(Tr8 *vm);
+uint8_t tr8_frame_int(Tr8 *vm);
#endif /* _TR8_H */