diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-02-13 13:59:48 -0500 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-02-13 13:59:48 -0500 |
commit | 8d7f27d9a0b61d3694a62f3e54be885d8073f02b (patch) | |
tree | b505454c79dba2e691ee19f716ccfd0d0aba1430 /programs/sub-suite | |
parent | ac778a4d39ba6c80651ce20ce780dfe859c3dcff (diff) |
- Reverted back one commit before the previous commit.
This is because the previous commit actually created
a bug, rather than fixing one.
- Added JMP, and JSR to the ortho extension, and
implemented them both in the assembler, and
emulator.
Diffstat (limited to 'programs/sub-suite')
-rw-r--r-- | programs/sub-suite/subsuite.s | 2 | ||||
-rw-r--r-- | programs/sub-suite/tmp-stuff/cmd_cpy.c | 33 | ||||
-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 |