summaryrefslogtreecommitdiff
path: root/programs/c-ports/subeditor.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-03-17 15:07:20 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-03-17 15:36:07 -0400
commit071edf621a6722f94027f37720a5a5f73d9696c0 (patch)
tree87761e6dca9e7cf47bf0b6f2d52e8e31623ac01a /programs/c-ports/subeditor.h
parent917f864a6d1304d9f0c650c107a5fd6576690cb7 (diff)
Revamped the opcode table, made the emulator more
efficient, and ported SuBEditor to C. I revamped the opcode table to add another prefix bit for the addressing mode, finally giving access to all addresses, without wasting any bytes. I made the stack based operations more efficient, by sort of applying Duff's device to it. And I ported SuBEditor to C, to make it easier for me to figure out how to implement SuBAsm.
Diffstat (limited to 'programs/c-ports/subeditor.h')
-rw-r--r--programs/c-ports/subeditor.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/programs/c-ports/subeditor.h b/programs/c-ports/subeditor.h
new file mode 100644
index 0000000..f20088d
--- /dev/null
+++ b/programs/c-ports/subeditor.h
@@ -0,0 +1,36 @@
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#define debug 0
+
+extern char *buffer;
+extern char *cmd_buf;
+
+extern uint8_t scr_row = 0;
+extern uint8_t scr_col = 0;
+extern uint8_t scr_trow = 0;
+extern uint8_t scr_tcol = 0;
+extern uint16_t scr_ptr = 0;
+
+extern uint8_t byte = 0;
+extern uint8_t mask = 0;
+
+extern uint8_t a = 0;
+extern uint8_t b = 0;
+extern uint8_t c = 0;
+extern uint8_t d = 0;
+extern uint8_t e = 0;
+extern uint8_t f = 0;
+
+extern uint8_t bitmask = 0;
+extern uint8_t bitabl[16];
+
+extern uint8_t scr_str = 0;
+extern uint8_t scr_end = 23;
+extern uint8_t wrapped = 0;
+
+extern void print_str(const char *str);
+int16_t str_cmp(const char *s0, uint16_t i, const char *s1, uint16_t j)
+extern void subasm();