summaryrefslogtreecommitdiff
path: root/programs/sub-suite
diff options
context:
space:
mode:
Diffstat (limited to 'programs/sub-suite')
-rw-r--r--programs/sub-suite/subsuite.s2
-rw-r--r--programs/sub-suite/tmp-stuff/cmd_cpy.c33
-rw-r--r--programs/sub-suite/tmp-stuff/free-new.s (renamed from programs/sub-suite/free-new.s)0
-rw-r--r--programs/sub-suite/tmp-stuff/free-old.s (renamed from programs/sub-suite/free-old.s)0
-rw-r--r--programs/sub-suite/tmp-stuff/print_char.s (renamed from programs/sub-suite/print_char.s)0
-rw-r--r--programs/sub-suite/tmp-stuff/shift_line.c (renamed from programs/sub-suite/shift_line.c)0
-rw-r--r--programs/sub-suite/tmp-stuff/subeditor-new.s (renamed from programs/sub-suite/subeditor-new.s)0
-rw-r--r--programs/sub-suite/tmp-stuff/test-size.s (renamed from programs/sub-suite/test-size.s)0
8 files changed, 34 insertions, 1 deletions
diff --git a/programs/sub-suite/subsuite.s b/programs/sub-suite/subsuite.s
index 7b31c31..3fc025d 100644
--- a/programs/sub-suite/subsuite.s
+++ b/programs/sub-suite/subsuite.s
@@ -20,5 +20,5 @@ a
;.org reset
;v
;f "subsuite.bin" $8000
-;q
+q
d
diff --git a/programs/sub-suite/tmp-stuff/cmd_cpy.c b/programs/sub-suite/tmp-stuff/cmd_cpy.c
new file mode 100644
index 0000000..6b89e7d
--- /dev/null
+++ b/programs/sub-suite/tmp-stuff/cmd_cpy.c
@@ -0,0 +1,33 @@
+#include <stdint.h>
+
+int cmd_size = 0x400;
+int maxcol = 80;
+
+extern uint8_t scr_row;
+extern uint8_t scr_col;
+extern uint8_t scr_str;
+
+int find_end(char *str, int pos) {
+ int i;
+ for (i = pos; str[i] != '\0'; i++);
+ return i;
+}
+
+void cmd_cpy(char *scr_buf, char *cmd_buf, int pos) {
+ int end_line = (find_end(scr_buf, pos)/(maxcol+1)) - scr_str;
+ int start_line = (find_start(scr_buf, end_line) + scr_str) * (maxcol+1);
+
+ for (int i = 0, done = 0; !done; i++) {
+ uint64_t tmp = (uint64_t)scr_buf[i];
+ for (int j = 0; j < 8; j++ , tmp >>= 8) {
+ int idx = (i*8) + j;
+ uint8_t tmp2 = tmp;
+ if (idx >= cmd_size || !tmp2) {
+ done = 1;
+ cmd_buf[idx] = '\0';
+ break;
+ }
+ cmd_buf[idx] = tmp2;
+ }
+ }
+}
diff --git a/programs/sub-suite/free-new.s b/programs/sub-suite/tmp-stuff/free-new.s
index dad19d0..dad19d0 100644
--- a/programs/sub-suite/free-new.s
+++ b/programs/sub-suite/tmp-stuff/free-new.s
diff --git a/programs/sub-suite/free-old.s b/programs/sub-suite/tmp-stuff/free-old.s
index 7f75edd..7f75edd 100644
--- a/programs/sub-suite/free-old.s
+++ b/programs/sub-suite/tmp-stuff/free-old.s
diff --git a/programs/sub-suite/print_char.s b/programs/sub-suite/tmp-stuff/print_char.s
index e12461c..e12461c 100644
--- a/programs/sub-suite/print_char.s
+++ b/programs/sub-suite/tmp-stuff/print_char.s
diff --git a/programs/sub-suite/shift_line.c b/programs/sub-suite/tmp-stuff/shift_line.c
index 365666b..365666b 100644
--- a/programs/sub-suite/shift_line.c
+++ b/programs/sub-suite/tmp-stuff/shift_line.c
diff --git a/programs/sub-suite/subeditor-new.s b/programs/sub-suite/tmp-stuff/subeditor-new.s
index 6c1cfb1..6c1cfb1 100644
--- a/programs/sub-suite/subeditor-new.s
+++ b/programs/sub-suite/tmp-stuff/subeditor-new.s
diff --git a/programs/sub-suite/test-size.s b/programs/sub-suite/tmp-stuff/test-size.s
index b543a36..b543a36 100644
--- a/programs/sub-suite/test-size.s
+++ b/programs/sub-suite/tmp-stuff/test-size.s