mirror of
https://github.com/hsoft/collapseos.git
synced 2024-09-07 09:08:46 +10:00
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.
32 lines
819 B
C
32 lines
819 B
C
.equ USER_CODE 0x8600
|
|
.equ USER_RAMSTART USER_CODE+0x1800
|
|
.equ FS_HANDLE_SIZE 8
|
|
.equ BLOCKDEV_SIZE 8
|
|
|
|
; *** JUMP TABLE ***
|
|
.equ strncmp 0x03
|
|
.equ addDE 0x06
|
|
.equ addHL 0x09
|
|
.equ upcase 0x0c
|
|
.equ unsetZ 0x0f
|
|
.equ intoDE 0x12
|
|
.equ intoHL 0x15
|
|
.equ writeHLinDE 0x18
|
|
.equ findchar 0x1b
|
|
.equ parseHex 0x1e
|
|
.equ parseHexPair 0x21
|
|
.equ blkSel 0x24
|
|
.equ fsFindFN 0x27
|
|
.equ fsOpen 0x2a
|
|
.equ fsGetC 0x2d
|
|
.equ fsSeek 0x30
|
|
.equ fsTell 0x33
|
|
|
|
.equ cpHLDE 0x3b
|
|
.equ parseArgs 0x3e
|
|
.equ printstr 0x41
|
|
.equ _blkGetC 0x44
|
|
.equ _blkPutC 0x47
|
|
.equ _blkSeek 0x4a
|
|
.equ _blkTell 0x4d
|