home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / midas / errors.inc < prev    next >
Text File  |  1994-08-06  |  5KB  |  156 lines

  1. ;*    ERRORS.INC
  2. ;*
  3. ;* MIDAS Sound System error codes and error message strings
  4. ;*
  5. ;* Copyright 1994 Petteri Kangaslampi and Jarno Paananen
  6. ;*
  7. ;* This file is part of the MIDAS Sound System, and may only be
  8. ;* used, modified and distributed under the terms of the MIDAS
  9. ;* Sound System license, LICENSE.TXT. By continuing to use,
  10. ;* modify or distribute this file you indicate that you have
  11. ;* read the license and understand and accept it fully.
  12. ;*
  13.  
  14.  
  15. ;/***************************************************************************\
  16. ;*     enum ErrorCodes
  17. ;*     ---------------
  18. ;* Description:  MIDAS Sound System error codes
  19. ;\***************************************************************************/
  20.  
  21. ENUM    ErrorCodes \
  22.     OK = 0, \            ; no error
  23.     errUndefined, \         ; undefined error
  24.     errOutOfMemory, \        ; out of (conventional) memory
  25.     errHeapCorrupted, \        ; (conventional memory) heap corrupted
  26.     errInvalidBlock, \        ; invalid memory block
  27.     errOutOfEMS, \            ; out of EMS memory
  28.     errEMSHeapCorrupted, \        ; EMS heap corrupted
  29.     errInvalidEMSBlock, \        ; invalid EMS memory block
  30.     errEMMFailure, \        ; Expanded Memory Manager failure
  31.     errOutOfCardMemory, \        ; out of soundcard memory
  32.     errCardHeapCorrupted, \     ; soundcard heap corrupted
  33.     errInvalidCardBlock, \        ; invalid soundcard memory block
  34.     errNoInstHandles, \        ; out of instrument handles
  35.     errFileOpen, \            ; unable to open file
  36.     errFileRead, \            ; unable to read file
  37.     errInvalidModule, \        ; invalid module file
  38.     errInvalidInst, \        ; invalid instrument in module
  39.     errInvalidPatt, \        ; invalid pattern data in module
  40.     errInvalidChanNumber, \     ; invalid channel number
  41.     errInvalidInstHandle, \     ; invalid instrument handle
  42.     errNoChannels, \        ; Sound Device channels not open
  43.         errSDFailure, \                 ; Sound Device hardware failure
  44.         errInvalidArguments, \          ; invalid function arguments
  45.         errFileNotFound, \              ; file does not exist
  46.         errInvalidFileHandle, \         ; invalid file handle
  47.         errAccessDenied, \              ; access denied
  48.         errFileExists, \                ; file exists
  49.         errTooManyFiles, \              ; too many open files
  50.         errDiskFull, \                  ; disk full
  51.         errEndOfFile, \                 ; unexpected end of file
  52.         errFileWrite                    ; unable to write file
  53.  
  54.  
  55.  
  56. GLOBAL    LANG errorMsg : dword        ; error message strings
  57.  
  58.  
  59. ;/***************************************************************************\
  60. ;*     enum FunctionIDs
  61. ;*     ----------------
  62. ;* Description:  ID numbers for first functions in all modules
  63. ;\***************************************************************************/
  64.  
  65. ENUM    FunctionIDs \
  66.     ID_error = 0, \         ; error handling
  67.     ID_dma = 100, \         ; DMA handling routines
  68.     ID_dsm = 200, \         ; Digital Sound Mixer
  69.     ID_ems = 300, \         ; EMS heap manager
  70.     ID_mem = 400, \         ; Conventional memory management
  71.     ID_mod = 500, \         ; Protracker Module Player
  72.     ID_s3m = 600, \         ; Scream Tracker 3 Module Player
  73.     ID_tmr = 700, \         ; TempoTimer
  74.     ID_vu = 800, \            ; Real VU meters
  75.         ID_rf = 900, \                  ; Raw file I/O
  76.         ID_file = 1000, \               ; High-level file I/O
  77.         ID_gus = 2000, \                ; GUS Sound Device
  78.     ID_pas = 2100, \        ; PAS Sound Device
  79.     ID_wss = 2200, \        ; WSS Sound Device
  80.     ID_sb = 2300, \         ; SB Sound Device
  81.     ID_nsnd = 2900            ; No Sound Sound Device
  82.  
  83.  
  84.  
  85. IFDEF DEBUG
  86.  
  87. ;/***************************************************************************\
  88. ;*     struct errRecord
  89. ;*     ----------------
  90. ;* Description:  Error record for error list
  91. ;\***************************************************************************/
  92.  
  93. STRUC    errRecord
  94.     errorCode    DW    ?    ; error code number
  95.     functID     DW    ?    ; ID for function that caused the
  96.                     ; error
  97. ENDS
  98.  
  99. GLOBAL    LANG errorList : errRecord    ; error list
  100. GLOBAL    LANG numErrors : word        ; number of errors in list
  101.  
  102.  
  103.  
  104. ;/***************************************************************************\
  105. ;*
  106. ;* Function:     void errAdd(int errorCode, unsigned functID);
  107. ;*
  108. ;* Description:  Add an error to error list
  109. ;*
  110. ;* Input:     int errorCode         error code
  111. ;*         unsigned functID     ID for function that caused the error
  112. ;*
  113. ;\***************************************************************************/
  114.  
  115. GLOBAL    LANG errAdd : far
  116.  
  117.  
  118.  
  119.  
  120. ;/***************************************************************************\
  121. ;*
  122. ;* Function:     void errPrintList(void);
  123. ;*
  124. ;* Description:  Prints the error list to stderr
  125. ;*
  126. ;\***************************************************************************/
  127.  
  128. GLOBAL    LANG errPrintList : far
  129.  
  130.  
  131. ENDIF
  132.  
  133.  
  134.  
  135. ;/***************************************************************************\
  136. ;*
  137. ;* Macro:    ERROR    functID
  138. ;*
  139. ;* Description: Adds an error to the MIDAS error list if DEBUG is defined.
  140. ;*        Does nothing otherwise.
  141. ;*
  142. ;* Input:    ax        error code
  143. ;*        functID     function ID
  144. ;*
  145. ;* Destroys:    all except ds, si, di
  146. ;*
  147. ;\***************************************************************************/
  148.  
  149. MACRO    ERROR    functID
  150. IFDEF    DEBUG
  151.     push    ax
  152.     call    errAdd LANG, ax, functID
  153.     pop    ax
  154. ENDIF
  155. ENDM
  156.