diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-05-01 21:44:35 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-05-01 21:44:35 +0100 |
commit | ef84fb6fcb45a86fce97acda58606a76a937a1da (patch) | |
tree | a3e049b858724837cc9ce0106e30c9e1c028ddc6 /vm.h | |
parent | c081dfe226c6e92865cbb97d8e9a2ef86d8c6acb (diff) | |
download | tr8vm-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.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 */ |