DEFC ESXDOS_MODE_READ = 0x01
DEFC ESXDOS_MODE_WRITE = 0x02
DEFC ESXDOS_MODE_CREATE_NOEXIST = 0x04
DEFC ESXDOS_MODE_OPEN_CREATE = 0x08
DEFC ESXDOS_MODE_CREAT_TRUNC = 0x0c

DEFC ESXDOS_SYS_CALL = 8		; rst #8
DEFC ESXDOS_ROM_CALL = 24		; rst #18

DEFC ESXDOS_SYS_AUTOLOAD = 144

DEFC ESXDOS_SYS_DISK_STATUS = 128
DEFC ESXDOS_SYS_DISK_READ = 129
DEFC ESXDOS_SYS_DISK_INFO = 132
DEFC ESxDOS_SYS_DISK_EJECT = 133

DEFC ESXDOS_SYS_F_OPEN = 154
DEFC ESXDOS_SYS_F_CLOSE = 155
DEFC ESXDOS_SYS_F_FSTAT = 161
DEFC ESXDOS_SYS_F_READ = 157
DEFC ESXDOS_SYS_F_WRITE = 158
DEFC ESXDOS_SYS_F_SEEK = 159
DEFC ESXDOS_SYS_F_GETPOS = 160
DEFC ESXDOS_SYS_F_OPENDIR = 163
DEFC ESXDOS_SYS_F_READDIR = 164
DEFC ESXDOS_SYS_F_GETCWD = 168
DEFC ESXDOS_SYS_F_CHDIR = 169
DEFC ESXDOS_SYS_F_MKDIR = 170
DEFC ESXDOS_SYS_F_RMDIR = 171
DEFC ESXDOS_SYS_F_UNLINK = 173		; delete
DEFC ESXDOS_SYS_F_RENAME = 176

DEFC ESXDOS_SYS_M_DOSVERSION = 136
DEFC ESXDOS_SYS_M_GETSETDRV = 137
DEFC ESXDOS_SYS_M_TAPEIN = 139
DEFC ESXDOS_SYS_M_TAPEOUT = 140

DEFC ESXDOS_TAPEIN_OPEN = 0
DEFC ESXDOS_TAPEIN_CLOSE = 1
DEFC ESXDOS_TAPEIN_INFO = 2
DEFC ESXDOS_TAPEIN_SETPOS = 3
DEFC ESXDOS_TAPEIN_GETPOS = 4
DEFC ESXDOS_TAPEIN_PAUSE = 5

DEFC ESXDOS_TAPEOUT_OPEN = 0
DEFC ESXDOS_TAPEOUT_CLOSE = 1
DEFC ESXDOS_TAPEOUT_INFO = 2
DEFC ESXDOS_TAPEOUT_TRUNC = 3

DEFC ESXDOS_SEEK_SET = 0
DEFC ESXDOS_SEEK_FWD = 1
DEFC ESXDOS_SEEK_BWD = 2

DEFC ESXDOS_SYSTEM_DRIVE = $24		; $
DEFC ESXDOS_CURRENT_DRIVE = $2a		; *

; Error codes
;
; 1 O.K. ESXDOS
; 2 Nonsense in ESXDOS
; 3 Statement END error
; 4 Wrong file TYPE
; 5 No such FILE or DIR
; 6 I/O ERROR
; 7 Invalid FILENAME
; 8 Access DENIED
; 9 Drive FULL
; 10 Invalid I/O REQUEST
; 11 No such DRIVE
; 12 Too many OPEN FILES
; 13 Bad file DESCRIPTON
; 14 No such DEVICE
; 15 File pointer OVERFLOW
; 16 Is a DIRECTORY
; 17 Not a DIRECTORY
; 18 File already EXISTS
; 19 Invalid PATH
; 20 No SYS
; 21 Path too LONG
; 22 No such COMMAND
; 23 File in USE
; 24 File is READ ONLY
; 25 Verify FAILED
; 26 Loading .KO FAILED
; 27 Directory NOT EMPTY
; 28 MAPRAM is ACTIVE
; 29 Drive is BUSY
; 30 Unknown FILESYSTEM
; 31 Device is BUSY

DEFC ESXDOS_ERROR_OK = 1
DEFC ESXDOS_ERROR_NO_SUCH_FILE_OR_DIR=5
DEFC ESXDOS_ERROR_IS_A_DIRECTORY=16
DEFC ESXDOS_ERROR_FILE_ALREADY_EXISTS = 18
DEFC ESXDOS_ERROR_INVALID_PATH = 19

; DivMMC memory constants
DEFC MMC_MEMORY_PORT=227
DEFC MMC_MEMORY_FIRST_PAGE=5
DEFC MMC_MEMORY_LAST_PAGE=11 ; (5,6,7,8,9,10)
DEFC MMC_MEMORY_PLUGIN_PAGE1=MMC_MEMORY_LAST_PAGE + 1
DEFC MMC_MEMORY_PLUGIN_PAGE2=MMC_MEMORY_PLUGIN_PAGE1 + 1
DEFC MMC_MEMORY_PLUGIN_PAGE3=MMC_MEMORY_PLUGIN_PAGE2 + 1
DEFC MMC_MEMORY_LAST_RESTORE_PAGE=MMC_MEMORY_LAST_PAGE-1 ; (5,6,7,8,9,10)
DEFC DIV_MMC_BANK_SIZE=8192

DEFC NMI_RAM_BUFFER=$3200
DEFC NMI_RAM_BUFFER_SIZE=$200
