From ef84fb6fcb45a86fce97acda58606a76a937a1da Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 1 May 2023 21:44:35 +0100 Subject: Added the VM player using SDL - Wired basic functionality (fram-buffer, frame interrupt) - Bug fixes in the assembler --- vm.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'vm.h') 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 */ -- cgit v1.2.3