From d49e39c672e78d536d658785adffb9149715832b Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 11 Aug 2020 18:03:48 -0400 Subject: Refactored the keyboard I/O emulation, again. I decided to use keypad now, and create a function to return the actual key sequences. The keyboard I/O is also now being handled by the io emulation function, and not by the main function. This should get rid of any possible deadlocks. --- sux.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sux.h') diff --git a/sux.h b/sux.h index 681e08e..75337c9 100644 --- a/sux.h +++ b/sux.h @@ -28,6 +28,7 @@ static const uint64_t mem_size = 0x04000000; /* Size of address space. */ extern uint8_t step; extern uint8_t esc; +extern uint8_t end; #define setflag(flag, bit) ((flag)) ? (cpu->ps.u8[thread] |= bit) : (cpu->ps.u8[thread] &= ~bit) #define getflag(bit) (cpu->ps.u8[thread] & bit) @@ -41,12 +42,12 @@ extern pthread_cond_t main_cond; extern void disasm(struct sux *cpu, uint64_t *operands, uint8_t lines, uint8_t opcode, uint8_t prefix, uint8_t thread); #endif -#define KEYBUF_SIZE 0x40 -char key[KEYBUF_SIZE]; +/*#define KEYBUF_SIZE 0x40 +char key[KEYBUF_SIZE];*/ -extern int get_keycode(char *str); extern int get_key(WINDOW *scr); extern void io(uint64_t address, uint8_t rw); +extern void init_scr(); static inline uint64_t get_addr(struct sux *cpu, uint64_t *tmpaddr, uint8_t opcode, uint8_t prefix, uint8_t thread) { union reg address; -- cgit v1.2.3-13-gbd6f