minivmac4ios/Mini vMac/mnvm_core/MYOSGLUE.h

1 line
9.8 KiB
C
Raw Normal View History

/* MYOSGLUE.h Copyright (C) 2006 Philip Cummins, Richard F. Bannister, Paul C. Pratt You can redistribute this file and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. You should have received a copy of the license along with this file; see the file COPYING. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ /* MY Operating System GLUE. header file for operating system dependent code. the same header is used for all platforms. This code is descended from Richard F. Bannister's Macintosh port of vMac, by Philip Cummins. */ #ifdef MYOSGLUE_H #ifndef AllFiles #error "header already included" #endif #else #define MYOSGLUE_H #endif EXPORTOSGLUPROC WarnMsgCorruptedROM(void); EXPORTOSGLUPROC WarnMsgUnsupportedROM(void); EXPORTOSGLUPROC WarnMsgAbnormalID(ui4r id); #if dbglog_HAVE EXPORTOSGLUPROC dbglog_writeCStr(char *s); EXPORTOSGLUPROC dbglog_writeReturn(void); EXPORTOSGLUPROC dbglog_writeHex(ui5r x); EXPORTOSGLUPROC dbglog_writeNum(ui5r x); EXPORTOSGLUPROC dbglog_writeMacChar(ui3r x); EXPORTOSGLUPROC dbglog_writeln(char *s); EXPORTOSGLUPROC dbglog_writelnNum(char *s, simr v); #endif EXPORTOSGLUPROC ReserveAllocOneBlock(ui3p *p, uimr n, ui3r align, blnr FillOnes); EXPORTOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount); EXPORTVAR(ui3p, ROM) /* error codes returned by Mini vMac extensions (passed back to the emulated 68k code). */ #define tMacErr ui4r #define mnvm_noErr ((tMacErr) 0x0000) /* (ui4b) 0 - No Error */ #define mnvm_miscErr ((tMacErr) 0xFFFF) /* (ui4b) - 1 - Should probably replace these */ #define mnvm_controlErr ((tMacErr) 0xFFEF) /* (ui4b) - 17 - I/O System Errors */ #define mnvm_statusErr ((tMacErr) 0xFFEE) /* (ui4b) - 18 - Driver can't respond to Status call */ #define mnvm_closErr ((tMacErr) 0xFFE8) /* (ui4b) - 24 - I/O System Errors */ #define mnvm_eofErr ((tMacErr) 0xFFD9) /* (ui4b) - 39 - End of file */ #define mnvm_tmfoErr ((tMacErr) 0xFFD6) /* (ui4b) - 42 - too many files open */ #define mnvm_fnfErr ((tMacErr) 0xFFD5) /* (ui4b) - 43 - File not found */ #define mnvm_wPrErr ((tMacErr) 0xFFD4) /* (ui4b) - 44 - diskette is write protected */ #define mnvm_vLckdErr ((tMacErr) 0xFFD2) /* (ui4b) - 46 - volume is locked */ #define mnvm_dupFNErr ((tMacErr) 0xFFD0) /* (ui4b) - 48 - duplicate filename */ #define mnvm_opWrErr ((tMacErr) 0xFFCF) /* (ui4b) - 49 - file already open with with write permission */ #define mnvm_paramErr ((tMacErr) 0xFFCE) /* (ui4b) - 50 - error in parameter list */ #define mnvm_permErr ((tMacErr) 0xFFCA) /* (ui4b) - 54 - permissions error (on file open) */ #define mnvm_nsDrvErr ((tMacErr) 0xFFC8) /* (ui4b) - 56 - No Such Drive */ #define mnvm_wrPermErr ((tMacErr) 0xFFC3) /* (ui4b) - 61 - write permissions error */ #define mnvm_offLinErr ((tMacErr) 0xFFBF) /* (ui4b) - 65 - off-line drive */ #define mnvm_dirNFErr ((tMacErr) 0xFF88) /* (ui4b) - 120 - directory not found */ #define mnvm_afpAccessDenied ((tMacErr) 0xEC78) /* (ui4b) - 5000 - Insufficient access privileges for operation */ #if IncludePbufs #define tPbuf ui4r #define NotAPbuf ((tPbuf)0xFFFF) EXPORTOSGLUFUNC tMacErr CheckPbuf(tPbuf Pbuf_No); EXPORTOSGLUFUNC tMacErr PbufGetSize(tPbuf Pbuf_No, ui5r *Count); EXPORTOSGLUFUNC tMacErr PbufNew(ui5b count, tPbuf *r); EXPORTOSGLUPROC PbufDispose(tPbuf i); EXPORTOSGLUPROC PbufTransfer(ui3p Buffer, tPbuf i, ui5r offset, ui5r count, blnr IsWrite); #endif #define tDrive ui4r EXPORTVAR(ui5b, vSonyWritableMask) EXPORTVAR(ui5b, vSonyInsertedMask) #define vSonyIsInserted(Drive_No) \ ((vSonyInsertedMask & ((ui5b)1 << (Drive_No))) != 0) EXPORTOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer, tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count, ui5r *Sony_ActCount); EXPORTOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No); EXPORTOSGLUF