1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-24 00:38:06 +11:00
Commit Graph

286 Commits

Author SHA1 Message Date
Virgil Dupras
c6016cd429 VE: fix buffer overflow with 'f' and make 'H' and 'L' affect 'f' 2020-06-06 21:59:22 -04:00
Virgil Dupras
b22ab8437b VE: add command 'f'
Kinda proud of this one. Efficiently piggy-backing on the Block
Editor, keeping things simple, and yet, building power into the
editor.
2020-06-06 21:46:46 -04:00
Virgil Dupras
204a66277e VE: replace 'W' with 'b' and implement 'W' and 'B'
Which are end-of-word movements.
2020-06-06 21:01:35 -04:00
Virgil Dupras
9d4e9ef08d VE: Add X 2020-06-05 14:01:39 -04:00
Virgil Dupras
6212a08866 VE: Add F and E 2020-06-05 13:54:45 -04:00
Virgil Dupras
a1b99275e6 VE: Add replace mode 2020-06-05 11:01:26 -04:00
Virgil Dupras
e7a6c777c7 VE: refactor mode indicators
The indicator is going to be empty most of the time and will be
emitted by the mode changer directly. That's going to the upper-right
corner and the status bar avoids emitting in that area.
2020-06-05 10:38:05 -04:00
Virgil Dupras
4af93d53e3 VE: add I command
Also, add insert and find buffers to the header, making it 3 lines
high.

Also, fix the "I" overshadowing word which wasn't operating on the
proper RSP level.

Also, fix I which didn't mark the block as dirty.
2020-06-04 22:54:27 -04:00
Virgil Dupras
e36080d7b8 VE: load Block Editor and reuse some of its words 2020-06-04 20:20:35 -04:00
Virgil Dupras
297c187426 VE: add mode indicator in status bar 2020-06-04 20:07:02 -04:00
Virgil Dupras
2bf4db59ed VE: Add H and L
Also, add MODE indirection.
2020-06-04 19:20:40 -04:00
Virgil Dupras
878df2d53b VE: make w affected by modifier 2020-06-04 18:59:54 -04:00
Virgil Dupras
98e820cf51 WE: why case-insensitive again? 2020-06-04 18:52:59 -04:00
Virgil Dupras
11843cc613 VE: add W and S movements 2020-06-04 17:22:07 -04:00
Virgil Dupras
77aedd7338 VE: add H, J, K, L 2020-06-04 12:04:13 -04:00
Virgil Dupras
c07a594e1a Begin working on a Visual Editor 2020-06-04 10:39:59 -04:00
Virgil Dupras
f53f91558b find: don't protect BC
not needed
2020-06-03 20:57:29 -04:00
Virgil Dupras
c26c454cbf extra words: allow finer-grained loading 2020-06-03 20:28:18 -04:00
Virgil Dupras
d8a6456206 (parsed): fix crash on parsing non-decimal staring with '-'
The address returned in the error condition would be off by one.
2020-05-25 21:15:07 -04:00
Virgil Dupras
2d17b4e8ec Make string length-prefixed instead of null-terminated
I'm not sure why I chose null-terminated initially. Probably because
the z80asm version had null-terminated strings.

Length-prefixes strings are the traditional form of strings in Forth
and it's a bit easier to work with them with traditional forth words
when they're under this form.
2020-05-25 20:34:52 -04:00
Virgil Dupras
6a507bcaac Add word MOVE, 2020-05-24 19:55:00 -04:00
Virgil Dupras
2d2a846b25 Inline SCPY
I'm planning a string reform and it's standing in the way.
2020-05-24 14:19:25 -04:00
Virgil Dupras
a59322c252 Remove XPACK
Now that everything is cross-compiled, no need to XPACK. If we ever
need it again, we know where to find it.
2020-05-24 13:45:22 -04:00
Virgil Dupras
4c1cacd8d0 Remove Linker
Now that the boot binary is fully cross-compiled, there's no use for
the linker anymore. Theoretically, it could still be useful, but I
can't think of a real use case.

Let's take it out of the picture. If it's ever needed again, I'll
know where to find it.
2020-05-24 10:22:56 -04:00
Virgil Dupras
ed2b91411a Limit ourselves to 8-bit branching
I'm planning on going back to 8-bit branching. 16-bit br cells incur
a non-negligible penalty and, while at first 64 words (128 bytes
forward or backward) seemed a bit limiting, I now don't see why one
would ever construct such a big branch. It would be un-forthy.

Also, I looked at using BC instead of IY to hold IP and the transition
would be a lot easier with 8-bit branching.

In this commit, all I do is add overflow checks in IF. The mechanic
below doesn't change. I'll give myself some time to think it over so
that I avoid yet another back and forth.
2020-05-24 10:16:25 -04:00
Virgil Dupras
5bbc256faf Flush input buffer on QUIT
Prebiously, when encountering an error during a : ; definition from
input buffer, because the input buffer wasn't flushed, we would continue
interpreting and quit the whole program when encountering ;.
2020-05-24 09:23:19 -04:00
Virgil Dupras
d041b91846 Optimize chkPS
Use EXX instead of the stack for HL protection and remove all
spurious uses of chkPS,

I wanted to inline chkPS in next because of its "tight loop" status,
but for reasons I don't understand, doing so breaks Collapse OS.
Later...
2020-05-22 23:12:03 -04:00
Virgil Dupras
4f2c2ab80a z80a: add a few ops 2020-05-22 22:23:24 -04:00
Virgil Dupras
581c6d015c Fix blk overflow in usage guide index 2020-05-22 20:39:28 -04:00
Virgil Dupras
6bff03a48b Move adev to core
It's small enough to be worth it.
2020-05-22 14:50:34 -04:00
Virgil Dupras
bb190f9665 Add word TUCK 2020-05-22 14:19:02 -04:00
Virgil Dupras
41d439376d Add word NIP 2020-05-22 14:19:02 -04:00
Virgil Dupras
f75b1c8864 Add word ?DUP 2020-05-22 14:19:02 -04:00
Virgil Dupras
ae87e88c52 Add 5x7 font
Also, fix PSP leak in font compilers.
2020-05-22 08:06:55 -04:00
Virgil Dupras
0939241db1 Add bootstrap guide 2020-05-21 15:25:12 -04:00
Virgil Dupras
e9e3bd80f6 ps2: fix PS2_SHIFT check 2020-05-21 08:53:36 -04:00
Virgil Dupras
7d28637740 ps2: add shift support 2020-05-20 20:31:56 -04:00
Virgil Dupras
b874a1c175 ps2: wip 2020-05-20 18:56:18 -04:00
Virgil Dupras
c86d8a74a0 sms/kbd: PS/2 driver WIP 2020-05-19 21:18:44 -04:00
Virgil Dupras
aad6b5c2e5 avra: add global constants 2020-05-19 10:48:48 -04:00
Virgil Dupras
ac309bbd9e avra: rename AGAIN, to AGAIN?,
AGAIN, becomes a shortcut for "' RJMP AGAIN?,"
2020-05-19 10:36:07 -04:00
Virgil Dupras
7a41c5c6f9 avra: add IF, .. THEN,
I decided to keep SKIP, .. TO, (renamed from AT,) around and limit
IF, .. THEN, to the simple BRNE case.
2020-05-19 10:26:57 -04:00
Virgil Dupras
8bbd29d37d avra: add SKIP, .. AT,
Will change to IF, .. THEN, but I need a way to easily reverse a
BR op. But from this commit, the translation of sms/kbd/ps2ctl.asm
is complete! perfect binary match!
2020-05-19 10:19:37 -04:00
Virgil Dupras
8ca85abfbd avra: add BEGIN, .. AGAIN, 2020-05-19 07:39:34 -04:00
Virgil Dupras
7b7e60ed4a avra: implement LD/ST
Still making great progress on sms/kbd/ps2ctl. Still matching ref
binary.
2020-05-18 22:28:58 -04:00
Virgil Dupras
e0bc14e55c avra: implement BR*
Getting good! still advancing on ps2ctl in sms/kbd and still
matching reference binary.
2020-05-18 20:34:06 -04:00
Virgil Dupras
cdddfdefae avra: add a layer of indirection to FLBL!
This will make it easier to fit BR* in there.
2020-05-18 19:45:30 -04:00
Virgil Dupras
63dec372ce sms/kbd: continue advancing on ps2ctl rewrite
Still binary matching. Next step is branching support.
2020-05-17 21:10:02 -04:00
Virgil Dupras
177e70580f sms/kbd: begin rewriting ps2ctl to Forth
So far, the resulting binary matches.
2020-05-17 14:24:27 -04:00
Virgil Dupras
8c4c879a65 avra: begin implementing forward label system 2020-05-17 11:04:08 -04:00
Virgil Dupras
212126d6d2 avra: add RJMP and RCALL 2020-05-17 10:13:43 -04:00
Virgil Dupras
b5d42924ba avra: add arg range checks 2020-05-17 09:30:36 -04:00
Virgil Dupras
5227777b34 avra: add OPb and OPRdb instr classes 2020-05-17 08:57:23 -04:00
Virgil Dupras
2e23b84fc1 avra: simplify OPRdRr 2020-05-16 22:16:41 -04:00
Virgil Dupras
75a1b2d504 avra: add OPAb instr class 2020-05-16 21:59:07 -04:00
Virgil Dupras
322be4d576 avra: add OPNA instr class 2020-05-16 21:44:47 -04:00
Virgil Dupras
0f2d14ad8a z80a: add BREAK, instruction
This allows us to remove a lot of labels usage in boot code. This
commit has no effect on forth.bin.
2020-05-16 21:02:50 -04:00
Virgil Dupras
fd597d29d2 boot: remove spurious label usage 2020-05-16 19:47:34 -04:00
Virgil Dupras
ee3407bf1c avra: first steps 2020-05-16 09:51:02 -04:00
Virgil Dupras
863540f7c6 core: define H@ a bit sooner 2020-05-15 22:59:38 -04:00
Virgil Dupras
bd38d80f9c Move Cross-compiled core from B390 to B350
and renamed it "Core words". Also, reworded the presentation.
2020-05-15 22:44:49 -04:00
Virgil Dupras
f2817870aa sms: working on real hardware! 2020-05-15 21:53:26 -04:00
Virgil Dupras
7ceff6144c sms: implement pad button B ( next class ) 2020-05-15 21:18:32 -04:00
Virgil Dupras
b6c039589f Don't emit BS when at beginning of input buffer 2020-05-15 20:51:09 -04:00
Virgil Dupras
aad713c477 sms: implement backspace with pad button A 2020-05-15 20:32:04 -04:00
Virgil Dupras
fdea069544 sms: implement button C and Start in Pad 2020-05-15 17:46:18 -04:00
Virgil Dupras
852c775b5b sms: implement linefeed in VDP 2020-05-15 16:08:27 -04:00
Virgil Dupras
f9a8e6f180 sms: Pad WIP 2020-05-15 15:41:06 -04:00
Virgil Dupras
1597f1e131 Don't generalize XYPOS just yet
It was ill-advised.
2020-05-15 14:09:31 -04:00
Virgil Dupras
db9885b8cf Rename (find) to FIND
I hadn't noticed that this word was almost ANS compliant.
2020-05-15 12:50:14 -04:00
Virgil Dupras
175b4bc497 sms: CollapseOS prompt! 2020-05-15 12:46:25 -04:00
Virgil Dupras
ca60685067 Streamline initialization process
Instead of letting each configuration taking care of RDLN$ and
"CollapseOS" prompt, move this to BOOT to simplify xcomp units.

Initialization source code is now only for driver initialization.
2020-05-15 11:34:35 -04:00
Virgil Dupras
0163af470a Fix EOT behavior after QUIT
Previously, calling quit would break EOT behavior and not properly
quit Collapse OS.
2020-05-15 10:19:39 -04:00
Virgil Dupras
43eabf566b sms: WIP ! 2020-05-14 22:15:31 -04:00
Virgil Dupras
87b51a6261 By default, allocate about 0x100 bytes for PSP+RSP
During "make updatebootstrap", we use less than 0x20 bytes on the
PSP side and less than 0x40 bytes on the RSP one. 0x100 bytes ought
to be enough for anybody.
2020-05-14 18:41:09 -04:00
Virgil Dupras
bf289b0a67 z80a: de-variable-ize
Use straight VARIABLE instead of Z80MEM+. Initially, I used this
system to allow z80a to be embedded in a system binary, but now
I don't think it's worth it. Compiled, z80a is 2.5k. Sure, it's a
sizeable amount of RAM, but I think that even with it in RAM, I'll
manage a bootstrap within my most constrained machine, the SMS with
8K.
2020-05-14 15:29:22 -04:00
Virgil Dupras
3fbae082f4 Remove INTJUMP mechanism
Not worth the trouble. Easier to set jump in binary directly.
2020-05-14 15:13:16 -04:00
Virgil Dupras
a5269a1c7c Make blk use system RAM 2020-05-14 14:51:20 -04:00
Virgil Dupras
eec9549bde Make rdln use system RAM 2020-05-14 14:26:56 -04:00
Virgil Dupras
b606dbf9af rc2014: move xcomp unit's contents to blkfs 2020-05-14 12:29:34 -04:00
Virgil Dupras
a8e8204eba trs80: adapt recipe to single stage xcomp 2020-05-14 12:08:17 -04:00
Virgil Dupras
8a58449776 Add word ERR 2020-05-14 11:57:26 -04:00
Virgil Dupras
e6bac985fa Cross-compiles in a single stage!
Finally got rid of the XPACKed core and managed to cross-compile
all core words, which greatly simplifies the bootstrapping process.
2020-05-14 10:17:38 -04:00
Virgil Dupras
68262f925b Almost done De-XPACKing! 2020-05-14 09:58:48 -04:00
Virgil Dupras
640e3321fc Move a bunch of words from XPACKed core to xcomp core 2020-05-14 09:54:33 -04:00
Virgil Dupras
4143e2a699 Improve late-stage xcomp 2020-05-14 09:45:42 -04:00
Virgil Dupras
179c66be8a Move a bunch of words from XPACKed core to xcomp core 2020-05-14 08:50:43 -04:00
Virgil Dupras
74896051bb Move BOOT, (boot<) and INTEPRET to high xcomp
Saves us an (ok) indirection and will save us more soon.
2020-05-14 08:45:01 -04:00
Virgil Dupras
b17bd4dca0 wip 2020-05-14 08:33:06 -04:00
Virgil Dupras
40a756cf1c Move a bunch of words from XPACKed core to xcomp core 2020-05-14 08:18:53 -04:00
Virgil Dupras
51997533ff Move a bunch of words from XPACKed core to xcomp core 2020-05-14 07:58:55 -04:00
Virgil Dupras
80d730318a Simplify LOAD's INTERPRET exit mechanism 2020-05-13 22:55:52 -04:00
Virgil Dupras
2e9e7047bf Make INTERPRET break on ASCII EOT
This should allow me to simplify LOAD's exit mechanism on block
end.
2020-05-13 21:44:46 -04:00
Virgil Dupras
052d59a3a2 TOWORD: tiny optimization
My mind is getting forthy.
2020-05-13 20:59:00 -04:00
Virgil Dupras
33d37d4ce9 WORD: don't overwrite RAM on words over 31 chars
This allows me to reclaim some RAM I hadn't even noticed I
needlessly monopolise.
2020-05-13 20:39:53 -04:00
Virgil Dupras
bd1e76ec5b Gather all RC2014 drivers into a single "RC2014 Recipe section" 2020-05-13 14:56:38 -04:00
Virgil Dupras
9b85961093 Rename "Core words" to "XPACKed core"
Now that this section is so small, I think I can see a possibility
for cross-compiling Collapse OS entirely, which would be great
because we could get rid of the relinker.
2020-05-13 14:31:56 -04:00
Virgil Dupras
76037ca1e7 Simplify boot process
That INIT thing is unnecessary.
2020-05-13 14:19:54 -04:00
Virgil Dupras
bb77cd0759 xcomp: add overrides into a loadable block
Makes xcomp.fs units shorter.
2020-05-13 13:33:24 -04:00
Virgil Dupras
0434d02818 xcomp: implement X['] 2020-05-13 13:24:58 -04:00