That was an interesting bug. It didn't cause a problem in emulation, but
in an RC2014 on an SD card, an include that didn't end with two newlines
would cause an infinite loop.
Needed if we want to compile the kernel and zasm from within a SD card.
I didn't go straight for 32-bit because it was significantly more
complex and 24-bit give us 16M. Enough to go on for a while...
A new app to stress test the SD card driver. Also, accompanying this
commit, changes solidifying the SD card driver so that stress tests
actually pass :)
With fsGetC becoming a "random address" API, it broke pgm. This commit
fixes it. To avoid adding the weight of a blkdev in pgm, I manage the
read offset directly in pgm.
This huge refactoring remove the Seek and Tell routine from blockdev
implementation requirements and change GetC and PutC's API so that they
take an address to read and write (through HL/DE) at each call.
The "PTR" approach in blockdev implementation was very redundant from
device to device and it made more sense to generalize. It's possible
that future device aren't "random access", but we'll be able to add more
device types later.
Another important change in this commit is that the "blockdev handle" is
now opaque. Previously, consumers of the API would happily call routines
directly from one of the 4 offsets. We can't do that any more. This
makes the API more solid for future improvements.
This change forced me to change a lot of things in fs, but overall,
things are now simpler. No more `FS_PTR`: the "device handle" now holds
the active pointer.
Lots, lots of changes, but it also feels a lot cleaner and solid.
The ability to specify "0" routines in blkdev table is not used anymore
now that stdio is a separate subsystem.
Also, I'm preparing a blockdev refactoring and this complicates my work.
What used to be `tools/emul/user.h` was in fact specific to zasm, so I
moved it there.
To avoid name confusion, I renamed what used to be kernel.h and user.h
to kernel-bin.h and user-bin.h.