In emulation, emitting is near-immediate. On a real machine, it's
often not-so-near-immediate. These little things help usability.
Again, this commit was meta-developed!
Loading the grid subsystem on top of the TRS-80 driver, which is
an interface to its ROM BIOS, would be counter-productive because
the BIOS already has the concept of cursor.
However, VE needs the Grid interface, so we implement a shim for it.
Again, all this work (and the re-assembly that it entails) has been
done from within Collapse OS on the TRS-80!
On a TRS-80 4P, spitting control chars, in addition to being
visually distasteful, generated a bug where the blinking cursor
would disappear, making using VE much, much harder.
I had a hard time reproducing the bug: you don't trigger it by
simply spitting control chars, it had to be a specific number of
them in a specific order. I didn't identify the sequence, but I
know that "bufp" triggered it.
This commit was written on a TRS-80 4P and downloaded from my work
floppies!
So far, I've been using this tool on remotes that had no control
character handling, but it doesn't work on a TRS-80 4P remote.
Much slower, but at least it works.
Later, I'll try to put some order in this so that we use the fast
lane when possible.
This optimisation appears to make the upload process unreliable in
some cases. I can't appear to reliably upload to my TRS-80 with this
version. I prefer reliability than speed...
A ~C! override can, if it wants, go put an error code in there,
which ~AT28 does.
This way, after a copy or xcomp process directly to EEPROM, one
can verify whether all bytes were successfully written by checking
whether "~C!ERR C@" is zero.
Also, turn AT28! and AT28, into ~AT28, pluggable into ~C!.
~AT28 doesn't check for mismatches. It was too complicated to turn
a mismatch into a compiled word we would jump to next. Data
integrity has to be checked through another path.
Also, remove MOVEW. Without indirect memory access, this word
doesn't make sense. Some AVR-specific words will have to be
defined.
I got bitten again, I've over-designed my solution. The last time
it happened, it was that memory mapping thing I was wanting to add.
The indirect memory access feature I was adding was to solve a
specific problem: Allow Collapse OS to cross-compile directly on a
AT28 EEPROM.
It began well. As long as we were staying in the assembler realm,
things were looking good. However, when we got into the xcomp realm
(B260), things became ugly, and I had to creep up indirection where
I didn't want to.
All of this because I wanted to solve my initial problem in a
slightly more generalized way. The broad idea was that these indirect
memory access could allow xcomp into a broad kind of memory-like
devices.
This idea broke on the "@" part of the equation. If I want
indirections to be two-way and allow xcomp to work properly, I have
to add this indirection to FIND (and possibly others) and this just
isn't practical or elegant.
So, I'm taking a step back and accepting that the solution I design
for now is exclusively for the AT28. What I'm thinking is to add a
low-level hook for memory writing, at the assembly level.
Also, rename "Addressed devices" to "Indirect memory access".
I do this because I need to add indirect versions of !, @ and ,
to allow boostrapping directly to EEPROM and that A,, thing I've
added to assemblers felt like really bad names.
With this change, I'd like to generalize the use of the * suffix
for aliases.
This word, suitable to plug to A, , increases HERE before doing its
verification to minimize waiting time: While we increase HERE, the
AT28 has the time to do its programming, and thus we'll need to idle
for less time afterwards.
Also, made the mismatch check silently ignore MSB. Previously, writing
a value larger than 0xff with AT28! would always result in a mismatch.
This brings us a bit closer to TYPE from Forth 2012. I don't think
I'll add TYPE (sig "addr len") anytime soon because there is few
use cases for it, but having "STYPE" instead of "(print)" feels
cleaner.
Doing SPI bit-banging through a controller port is already really
slow, but doing so with the Forth version of (spix) was really,
really slow.
With this pure z80 version of (spix), it's more bearable.
At-XY+EMIT is slow compared to direct CELL! usage. It is seen very
clearly on a SMS when VE is doing its initial clrscr (yes, I could
manage to load VE from a SD card and run it on a real SMS!).
The grid protocol wasn't there when I wrote VE initially. I only had
AT-XY. Now that we have a solid protocol to build on, let's do it.
I hadn't noticed yet, but making CVM use the Grid subsystem made
me lose scrolling. It's fine because that scrolling was "artificial"
in the sense that it was provided by curses, not Collapse OS and I
prefer having something that closer emulates a real machine.
However, CVM didn't properly clear the new line when entering it.
Fixed.
Scrolling behavior will come back when it's implemented in the Grid
subsystem.
In CURSOR!, I was using a write commande to read from VRAM and the
emulator didn't properly behave and did as if everything was fine.
The result on a real SMS was that the cursor would contain the
inverted glyph of the contents of the *old* cursor position.
I do this by adding an inverted version of all glyphs in the upper
range of the pattern memory. This is a big waste of the pattern
space (only one inverted character is needed at once), but it's the
simplest way to proceed. I'll change this if I ever need more
pattern space.
Also, remove _blank. It was wastefully blanking the whole memory.
Only the name table needs to be blanked on initialization.
Replace the "g" arg (glyph) with "c" (character). The reason why "g"
was used was to save a "0x20 -" operation at all CELL! implementations,
but this came with too big a drawback: it made CELL! hardly usable
outside of the Grid subsystem, mostly because the user of CELL! would
often have to do "0x20 -".
For example, I want the SMS's Pad driver to use CELL! directly instead
of having to do EMIT+XYPOS-messing-around. I would have had to do a
"0x20 -" there.