/*
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#endifEXPORTOSGLUPROCWarnMsgCorruptedROM(void);EXPORTOSGLUPROCWarnMsgUnsupportedROM(void);EXPORTOSGLUPROCWarnMsgAbnormalID(ui4rid);#if dbglog_HAVEEXPORTOSGLUPROCdbglog_writeCStr(char*s);EXPORTOSGLUPROCdbglog_writeReturn(void);EXPORTOSGLUPROCdbglog_writeHex(ui5rx);EXPORTOSGLUPROCdbglog_writeNum(ui5rx);EXPORTOSGLUPROCdbglog_writeMacChar(ui3rx);EXPORTOSGLUPROCdbglog_writeln(char*s);EXPORTOSGLUPROCdbglog_writelnNum(char*s,simrv);#endifEXPORTOSGLUPROCReserveAllocOneBlock(ui3p*p,uimrn,ui3ralign,blnrFillOnes);EXPORTOSGLUPROCMyMoveBytes(anypsrcPtr,anypdestPtr,si5bbyteCount);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)EXPORTOSGLUFUNCtMacErrCheckPbuf(tPbufPbuf_No);EXPORTOSGLUFUNCtMacErrPbufGetSize(tPbufPbuf_No,ui5r*Count);EXPORTOSGLUFUNCtMacErrPbufNew(ui5bcount,tPbuf*r);EXPORTOSGLUPROCPbufDispose(tPbufi);EXPORTOSGLUPROCPbufTransfer(ui3pBuffer,tPbufi,ui5roffset,ui5rcount,blnrIsWrite);#endif#define tDrive ui4rEXPORTVAR(ui5b,vSonyWritableMask)EXPORTVAR(ui5b,vSonyInsertedMask)#define vSonyIsInserted(Drive_No) \ ((vSonyInsertedMask & ((ui5b)1 << (Drive_No))) != 0)EXPORTOSGLUFUNCtMacErrvSonyTransfer(blnrIsWrite,ui3pBuffer,tDriveDrive_No,ui5rSony_Start,ui5rSony_Count,ui5r*Sony_ActCount);EXPORTOSGLUFUNCtMacErrvSonyEject(tDriveDrive_No);EXPORTOSGLUF