diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/gbos.inc | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/gbos.inc b/include/gbos.inc index 156876b..7c3f325 100644 --- a/include/gbos.inc +++ b/include/gbos.inc @@ -84,7 +84,32 @@ DEF SYS_GETPID EQU 8 DEF SYS_KILL EQU 9 DEF SYS_BRK EQU 10 DEF SYS_YIELD EQU 11 -DEF SYS_MAX EQU 12 +DEF SYS_GETB EQU 12 ; read a byte from an open file (B=fd -> A, CF=EOF) +DEF SYS_PUTB EQU 13 ; append a byte to an open file (B=fd, E=byte) +DEF SYS_LIST EQU 14 ; list a directory slot (B=slot, DE=namebuf) +DEF SYS_REMOVE EQU 15 ; delete a file (DE=name) +DEF SYS_MAX EQU 16 +; (SYS_OPEN=4 / SYS_CLOSE=5 are now implemented by the filesystem) + +; ----------------------------------------------------------------------------- +; RAM filesystem (lives in WRAMX $D000-$DFFF, 4 KiB; fixed in DMG mode). +; 8 files x 512 bytes: name[8] (first byte 0 = free) + len[2] + data[502]. +; ----------------------------------------------------------------------------- +DEF FS_BASE EQU $D000 +DEF FS_MAX_FILES EQU 8 +DEF FS_FILE_SIZE EQU 512 +DEF FS_NAME EQU 0 +DEF FS_LEN EQU 8 +DEF FS_DATA EQU 10 +DEF FS_MAX_DATA EQU 502 + +; open-file table (kernel WRAM0): inuse, slot, mode, pos(2) +DEF OF_MAX EQU 4 +DEF OF_INUSE EQU 0 +DEF OF_SLOT EQU 1 +DEF OF_MODE EQU 2 +DEF OF_POS EQU 3 +DEF OF_SIZE EQU 5 ; ----------------------------------------------------------------------------- ; Program table indices (see programs.asm). exec() takes one of these in B. @@ -102,5 +127,8 @@ DEF PROG_CAT EQU 9 DEF PROG_WC EQU 10 DEF PROG_HEAD EQU 11 DEF PROG_ARGS EQU 12 +DEF PROG_LS EQU 13 +DEF PROG_SAVE EQU 14 +DEF PROG_RM EQU 15 ENDC |
