/*
COMOSGLU.h
Copyright (C) 2009 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.
*//*
COMmon code for Operating System GLUe
*/#if EnableMouseMotion && MayFullScreen#define EnableFSMouseMotion 1#else#define EnableFSMouseMotion 0#endif#if EnableMagnify || VarFullScreen#define EnableRecreateW 1#else#define EnableRecreateW 0#endif#if EnableRecreateW || EnableFSMouseMotion#define EnableMoveMouse 1#else#define EnableMoveMouse 0#endifGLOBALVARui3pROM=nullpr;GLOBALVARui5bvSonyWritableMask=0;GLOBALVARui5bvSonyInsertedMask=0;#if IncludeSonyRawModeGLOBALVARblnrvSonyRawMode=falseblnr;#endif#if IncludeSonyNewGLOBALVARblnrvSonyNewDiskWanted=falseblnr;GLOBALVARui5bvSonyNewDiskSize;#endif#if IncludeSonyNameNewGLOBALVARtPbufvSonyNewDiskName=NotAPbuf;#endifGLOBALVARui5bCurMacDateInSeconds=0;GLOBALVARui5bCurMacLatitude=0;GLOBALVARui5bCurMacLongitude=0;GLOBALVARui5bCurMacDelta=0;#if 0 != vMacScreenDepth
GLOBALVAR blnr UseColorMode = falseblnr;
GLOBALVAR blnr ColorModeWorks = falseblnr;
#endif
#if 0 != vMacScreenDepth
GLOBALVAR blnr ColorMappingChanged = falseblnr;
#endif
#if (0 != vMacScreenDepth) && (vMacScreenDepth < 4)GLOBALVARui4rCLUT_reds[CLUT_size];GLOBALVARui4rCLUT_greens[CLUT_size];GLOBALVARui4rCLUT_blues[CLUT_size];#endifLOCALVARblnrRequestMacOff=falseblnr;GLOBALVARblnrForceMacOff=falseblnr;GLOBALVARblnrWantMacInterrupt=falseblnr;GLOBALVARblnrWantMacReset=falseblnr;GLOBALVARui3bSpeedValue=WantInitSpeedValue;#if EnableAutoSlowGLOBALVARblnrWantNotAutoSlow=(WantInitNotAutoSlow!=0);#endifGLOBALVARui4bCurMouseV=0;GLOBALVARui4bCurMouseH=0;#if EnableFSMouseMotionLOCALVARblnrHaveMouseMotion=falseblnr;#endif#if EnableAutoSlowGLOBALVARui5rQuietTime=0;GLOBALVARui5rQuietSubTicks=0;#endif#ifndef GrabKeysFullScreen#define GrabKeysFullScreen 1#endif#ifndef GrabKeysMaxFullScreen#define GrabKeysMaxFullScreen 0#endif#if IncludePbufsLOCALVARui5bPbufAllocatedMask;LOCALVARui5bPbufSize[NumPbufs];#endif#if IncludePbufs#define PbufIsAllocated(i) ((PbufAllocatedMask & ((ui5b)1 << (i))) != 0)#endif#if IncludePbufsLOCALFUNCblnrFirstFreePbuf(tPbuf*r){tPbufi;for(i=0;i<NumPbufs;++i){if(!PbufIsAllocated(i)){*r=i;returntrueblnr;}}returnfalseblnr;}#endif#if IncludePbufsLOCALPROCPbufNewNotify(tPbufPbuf_No,ui5bcount){PbufSize[Pbuf_No]=count;PbufAllocatedMask|=((ui5b)1<<Pbuf_No);}#endif#if IncludePbufsLOCALPROCPbufDisposeNotify(tPbufPbuf_No){PbufAllocatedMask&=~((ui5b)1<<Pbuf_No);}#endif#if IncludePbufsGLOBALOSGLUFUNCtMacErrCheckPbuf(tPbufPbuf_No){tMacErrresult;if(Pbuf_No>=NumPbufs){result=mnvm_nsDrvErr;}elseif(!PbufIsAllocated(Pbuf_No)){result=mnvm_offLinErr;}else{result=mnvm_noErr;}returnresult;}#endif#if IncludePbufsGLOBALOSGLUFUNCtMacErrPbufGetSize(tPbufPbuf_No,ui5r*Count){tMacErrresult=CheckPbuf(Pbuf_No);if(mnvm_noErr==result){*Count=PbufSize[Pbuf_No];}returnresult;}#endifLOCALFUNCblnrFirstFreeDisk(tDrive*Drive_No){tDrivei;for(i=0;i<NumDrives;++i){if(!vSonyIsInserted(i)){*Drive_No=i;returntrueblnr;}}returnfalseblnr;}GLOBALOSGLUFUNCblnrAnyDiskInserted(void){#if 0 tDrive i;
for (i = 0; i < NumDrives; ++i) {
if (vSonyIsInserted(i)) {
return trueblnr;
}
}
return falseblnr;
#endif
return0!=vSonyInsertedMask;}GLOBALOSGLUPROCDiskRevokeWritable(tDriveDrive_No){vSonyWritableMask&=~((ui5b)1<<Drive_No);}