/* MYOSGLUE.c Copyright (C) 2006 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 */ #include "CNFGRAPI.h" #include "SYSDEPNS.h" #include "MYOSGLUE.h" IMPORTFUNC blnr InitEmulation(void); IMPORTPROC DoEmulateOneTick(void); IMPORTFUNC blnr ScreenFindChanges(si3b TimeAdjust, si4b *top, si4b *left, si4b *bottom, si4b *right); IMPORTPROC DoEmulateExtraTime(void); GLOBALVAR char *screencomparebuff = nullpr; GLOBALVAR ui4b *RAM = nullpr; GLOBALVAR ui4b *ROM = nullpr; GLOBALVAR ui4b CurMouseV = 0; GLOBALVAR ui4b CurMouseH = 0; GLOBALVAR ui3b CurMouseButton = falseblnr; GLOBALVAR ui5b theKeys[4]; #ifndef WantInitSpeedValue #define WantInitSpeedValue 3 #endif GLOBALVAR ui3b SpeedValue = WantInitSpeedValue; GLOBALVAR blnr SpeedLimit = (WantInitSpeedValue != -1); #if EnableMouseMotion GLOBALVAR blnr HaveMouseMotion = falseblnr; GLOBALVAR ui4b MouseMotionV = 0; GLOBALVAR ui4b MouseMotionH = 0; #endif #if MySoundEnabled #ifndef MySoundFullScreenOnly #define MySoundFullScreenOnly 0 #endif #endif #ifndef EnableDragDrop #define EnableDragDrop 1 #endif LOCALVAR blnr RequestMacOff = falseblnr; GLOBALVAR blnr ForceMacOff = falseblnr; GLOBALVAR blnr WantMacInterrupt = falseblnr; GLOBALVAR blnr WantMacReset = falseblnr; GLOBALVAR ui5b vSonyWritableMask = 0; GLOBALVAR ui5b vSonyInsertedMask = 0; GLOBALVAR ui5b vSonyMountedMask = 0; GLOBALVAR ui5b CurMacDateInSeconds = 0; GLOBALVAR ui5b CurMacLatitude = 0; GLOBALVAR ui5b CurMacLongitude = 0; GLOBALVAR ui5b CurMacDelta = 0; LOCALFUNC blnr FirstFreeDisk(ui4b *Drive_No) { si4b i; for (i = 0; i < NumDrives; ++i) { if ((vSonyInsertedMask & ((ui5b)1 << i)) == 0) { *Drive_No = i; return trueblnr; } } return falseblnr; } GLOBALFUNC blnr AnyDiskInserted(void) { si4b i; for (i = 0; i < NumDrives; ++i) { if ((vSonyInsertedMask & ((ui5b)1 << i)) != 0) { return trueblnr; } } return falseblnr; } FORWARDPROC HaveChangedScreenBuff(si4b top, si4b left, si4b bottom, si4b right); /* Draw the screen */ LOCALPROC Screen_Draw(si3b TimeAdjust) { si4b top; si4b left; si4b bottom; si4b right; if (ScreenFindChanges(TimeAdjust, &top, &left, &bottom, &right)) { HaveChangedScreenBuff(top, left, bottom, right); } } LOCALPROC SetLongs(ui5b *p, long n) { long i; for (i = n; --i >= 0; ) { *p++ = (ui5b) -1; } } #include "STRCONST.h" #include "PLATGLUE.h"