Browse Source

blockdev: clarify routines specs

pull/10/head
Virgil Dupras 5 years ago
parent
commit
c77d96da22
2 changed files with 31 additions and 1 deletions
  1. +30
    -0
      parts/z80/blockdev.asm
  2. +1
    -1
      parts/z80/fs.asm

+ 30
- 0
parts/z80/blockdev.asm View File

@@ -8,6 +8,36 @@
;
; This part exposes a new "bsel" command to select the currently active block
; device.
;
; *** Blockdev routines ***
;
; There are 4 blockdev routines that can be defined by would-be block devices
; and they follow these specifications:
;
; GetC:
; Reads one character from selected device and returns its value in A.
; Sets Z according to whether read was successful: Set if successful, unset
; if not.
;
; A successful GetC should advance the "pointer" of the device (if there is one)
; by one byte so that a subsequent GetC will read the next char. Unsuccessful
; reads generally mean that we reached EOF.
;
;
; PutC:
; Writes character in A in current position in the selected device. Sets Z
; according to whether the operation was successful.
;
; A successful PutC should advance the "pointer" of the device (if there is one)
; by one byte so that the next PutC places the next char next to this one.
; Unsuccessful writes generally mean that we reached EOF.
;
; Seek:
; Place device "pointer" at position dictated by HL.
;
; Tell:
; Return the position of the "pointer" in HL


; *** DEFINES ***
; BLOCKDEV_COUNT: The number of devices we manage.


+ 1
- 1
parts/z80/fs.asm View File

@@ -25,7 +25,7 @@
; error out if there's no metadata: we create a new CFS fs with an empty block.
;
; The can only be one "mounted" fs at once. Selecting another blockdev through
; "bsel" foesn't affect the currently mounted fs, which can still be interacted
; "bsel" doesn't affect the currently mounted fs, which can still be interacted
; with (which is important if we want to move data around).
;
; *** Block metadata


Loading…
Cancel
Save