; SRDISK - device driver definitions
; Copyright (c) 1992-1996, 2005 Marko Kohtala
; Released under GNU GPL, read the file 'COPYING' for more information

%define SRD_VERSION     "2.10"      ; FOUR LETTER VERSION STRING

; General capabilities in conf.c_flags

C_APPENDED      equ 1   ; Capable of having appended drivers
C_MULTIPLE      equ 2   ; Capable of driving many disks
C_32BITSEC      equ 4   ; Capable of handling over 32-bit sector addresses
C_NOALLOC       equ 8   ; Incapable of allocating memory by itself
C_GIOCTL        equ 10h ; Supports Generic IOCTL
C_DISK_IMAGE    equ 20h ; Can load disk image on startup
C_UNKNOWN       equ 0C0h

; If C_NOALLOC is not set, the malloc field in configuration structure points
; into the allocation function. If C_NOALLOC is set, then the malloc
; points into the data that SRDISK.EXE needs to be able to handle the memory
; by itself.

; Boolean
TRUE    EQU 1
FALSE   EQU 0

; Some important internal settings
V_FORMAT        equ     1               ; config_s format version used here
IOCTL_ID        equ     5253h           ; IOCTL write length for call ('SR')

;IFNDEF DEBUGGING
DEBUGGING       equ     FALSE
;DEBUGGING       equ     TRUE
;ENDIF

DEBUGINIT       equ     FALSE

; disk_IO parameter locations
labelsize dIO_bytes, word, bp-6     ; May be changed in disk_IO
labelsize dIO_byteoffset, dword, bp-4    ; May be changed in disk_IO
labelsize dIO_buffer, dword, bp+6    ; Changed in batch_xfer
labelsize dIO_sector, dword, bp+10   ; Changed in batch_xfer
labelsize dIO_count, word, bp+14    ; Changed in batch_xfer
labelsize dIO_RW, byte, bp+16

;******************* Derived definitions ********************

%if DEBUGGING
debug   macro char,num
        push ax
        push dx
        IFDIFI <num>,<dx>
          %IF TYPE num EQ 1
          xor dh,dh
          mov dl,[num]
          %ELSE
          mov dx,[num]
          %ENDIF
        %ENDIF
        mov al,[char]
        call debug_c
        pop dx
        pop ax
        endm
%else
%macro debug 1+
%endmacro
%endif ;DEBUGGING


