aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sword2/build_display.cpp8
-rw-r--r--sword2/driver/driver96.h28
-rw-r--r--sword2/driver/misc.cpp16
-rw-r--r--sword2/driver/palette.cpp4
-rw-r--r--sword2/driver/render.cpp6
-rw-r--r--sword2/memory.cpp4
-rw-r--r--sword2/resman.cpp14
7 files changed, 34 insertions, 46 deletions
diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp
index 0a7ea7e7e9..91ef71c81f 100644
--- a/sword2/build_display.cpp
+++ b/sword2/build_display.cpp
@@ -260,11 +260,11 @@ void Build_display(void) //Tony21Sept96
// update our fps reading
frameCount += 1;
- if (timeGetTime() > cycleTime)
+ if (SVM_timeGetTime() > cycleTime)
{
fps = frameCount;
frameCount = 0;
- cycleTime = timeGetTime()+1000;
+ cycleTime = SVM_timeGetTime()+1000;
}
//----------------------------------------------------
// check if we've got time to render the screen again this cycle
@@ -429,9 +429,9 @@ void DisplayMsg( uint8 *text, int time ) // Chris 15May97
}
while(GetFadeStatus()==RDFADE_UP);
- DWORD targetTime = timeGetTime() + (time*1000);
+ DWORD targetTime = SVM_timeGetTime() + (time*1000);
- while(timeGetTime() < targetTime)
+ while(SVM_timeGetTime() < targetTime)
{
//--------------------------------------------------
// Service windows
diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h
index 350b602fd8..da1b7dd001 100644
--- a/sword2/driver/driver96.h
+++ b/sword2/driver/driver96.h
@@ -1612,30 +1612,18 @@ extern int32 IsFxOpen(int32 id);
extern int32 SetFxVolumePan(int32 id, uint8 vol, int8 pan);
extern int32 SetFxIdVolume(int32 id, uint8 vol);
-#ifdef WIN32
-
-#undef timeGetTime
-#undef VirtualUnlock
-#undef GlobalMemoryStatus
-#undef SetFileAttributes
-#undef GetCurrentDirectory
-#undef GetVolumeInformation
-#undef GetModuleFileName
-
-#endif
-
//-----------------------------------------------------------------------------
// Misc functions - from misc.cpp
//-----------------------------------------------------------------------------
-extern uint32 timeGetTime(void);
-extern void VirtualUnlock(uint8 *free_memman, uint32 total_free_memory);
-extern void GlobalMemoryStatus(MEMORYSTATUS *memo);
-extern void SetFileAttributes(char *file, uint32 atrib);
-extern void DeleteFile(char *file);
-extern void GetCurrentDirectory(uint32 max, char* path);
-extern int32 GetVolumeInformation(char *cdPath, char *sCDName, uint32 maxPath, uint8 *, DWORD *dwMaxCompLength, DWORD *dwFSFlags, uint8 *, uint32 a);
+extern uint32 SVM_timeGetTime(void);
+extern void SVM_VirtualUnlock(uint8 *free_memman, uint32 total_free_memory);
+extern void SVM_GlobalMemoryStatus(MEMORYSTATUS *memo);
+extern void SVM_SetFileAttributes(char *file, uint32 atrib);
+extern void SVM_DeleteFile(char *file);
+extern void SVM_GetCurrentDirectory(uint32 max, char* path);
+extern int32 SVM_GetVolumeInformation(char *cdPath, char *sCDName, uint32 maxPath, uint8 *, DWORD *dwMaxCompLength, DWORD *dwFSFlags, uint8 *, uint32 a);
extern void scumm_mkdir(const char *pathname);
-extern void GetModuleFileName(void *module, char *destStr, uint32 maxLen);
+extern void SVM_GetModuleFileName(void *module, char *destStr, uint32 maxLen);
//-----------------------------------------------------------------------------
//Macro for calling error handler with source filename and line.
diff --git a/sword2/driver/misc.cpp b/sword2/driver/misc.cpp
index dd6aa71f23..9a1a5e27cb 100644
--- a/sword2/driver/misc.cpp
+++ b/sword2/driver/misc.cpp
@@ -21,32 +21,32 @@
#include "driver96.h"
#include "../sword2.h"
-uint32 timeGetTime(void) {
+uint32 SVM_timeGetTime(void) {
return g_bs2->_syst->get_msecs();
}
-void VirtualUnlock(uint8 *free_memman, uint32 total_free_memory) {
+void SVM_VirtualUnlock(uint8 *free_memman, uint32 total_free_memory) {
warning("stub VirtualUnlock");
}
-void GlobalMemoryStatus(MEMORYSTATUS *memo) {
+void SVM_GlobalMemoryStatus(MEMORYSTATUS *memo) {
warning("stub GlobalMemoryStatus");
memo->dwTotalPhys = 16000*1024; // hard code 16mb for now
}
-void SetFileAttributes(char *file, uint32 atrib) {
+void SVM_SetFileAttributes(char *file, uint32 atrib) {
warning("stub SetFileAttributes");
}
-void DeleteFile(char *file) {
+void SVM_DeleteFile(char *file) {
warning("stub DeleteFile");
}
-void GetCurrentDirectory(uint32 max, char* path) {
+void SVM_GetCurrentDirectory(uint32 max, char* path) {
warning("stub GetCurrentDirectory");
}
-int32 GetVolumeInformation(char *cdPath, char *sCDName, uint32 maxPath, uint8 *, DWORD *dwMaxCompLength, DWORD *dwFSFlags, uint8 *, uint32 a) {
+int32 SVM_GetVolumeInformation(char *cdPath, char *sCDName, uint32 maxPath, uint8 *, DWORD *dwMaxCompLength, DWORD *dwFSFlags, uint8 *, uint32 a) {
warning("stub GetVolumeInformation %s", cdPath);
strcpy(sCDName, CD1_LABEL);
return 1;
@@ -57,7 +57,7 @@ void scumm_mkdir(const char *pathname) {
warning("stub scumm_mkdir %s", pathname);
}
-void GetModuleFileName(void *module, char *destStr, uint32 maxLen) {
+void SVM_GetModuleFileName(void *module, char *destStr, uint32 maxLen) {
warning("stub GetModuleFileName");
}
diff --git a/sword2/driver/palette.cpp b/sword2/driver/palette.cpp
index bdead2f12d..eb13b349db 100644
--- a/sword2/driver/palette.cpp
+++ b/sword2/driver/palette.cpp
@@ -378,7 +378,7 @@ int32 FadeUp(float time)
fadeTotalTime = (int32) (time * 1000);
fadeStatus = RDFADE_UP;
- fadeStartTime = timeGetTime();
+ fadeStartTime = SVM_timeGetTime();
return RD_OK;
@@ -394,7 +394,7 @@ int32 FadeDown(float time)
fadeTotalTime = (int32) (time * 1000);
fadeStatus = RDFADE_DOWN;
- fadeStartTime = timeGetTime();
+ fadeStartTime = SVM_timeGetTime();
return RD_OK;
diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp
index acbff2fdbd..72a39d9fd2 100644
--- a/sword2/driver/render.cpp
+++ b/sword2/driver/render.cpp
@@ -901,7 +901,7 @@ int32 InitialiseRenderCycle(void)
{
- initialTime = timeGetTime();
+ initialTime = SVM_timeGetTime();
originTime = initialTime;
totalTime = initialTime + MILLISECSPERCYCLE;
@@ -919,7 +919,7 @@ int32 StartRenderCycle(void)
scrollxOld = scrollx;
scrollyOld = scrolly;
- startTime = timeGetTime();
+ startTime = SVM_timeGetTime();
if (startTime + renderAverageTime >= totalTime)
{
@@ -948,7 +948,7 @@ int32 EndRenderCycle(BOOL *end)
int32 time;
- time = timeGetTime();
+ time = SVM_timeGetTime();
renderTimeLog[renderCountIndex] = time - startTime;
startTime += renderTimeLog[renderCountIndex];
renderAverageTime = (renderTimeLog[0] + renderTimeLog[1] + renderTimeLog[2] + renderTimeLog[3]) >> 2;
diff --git a/sword2/memory.cpp b/sword2/memory.cpp
index b87ae331d9..b8078f61ac 100644
--- a/sword2/memory.cpp
+++ b/sword2/memory.cpp
@@ -59,7 +59,7 @@ void Close_memory_manager(void) //Tony2Oct96
{
//unlock our supposedly locked in memory
- VirtualUnlock(free_memman, total_free_memory);
+ SVM_VirtualUnlock(free_memman, total_free_memory);
free(free_memman);
}
@@ -72,7 +72,7 @@ void Init_memory_manager(void) //Tony9April96
MEMORYSTATUS memo;
//find out how much actual physical RAM this computer has
- GlobalMemoryStatus(&memo);
+ SVM_GlobalMemoryStatus(&memo);
//now decide how much to grab - 8MB computer are super critical
if (memo.dwTotalPhys<=(8000*1024)) //if 8MB or less :-O
diff --git a/sword2/resman.cpp b/sword2/resman.cpp
index bb51f80d95..f9732125a5 100644
--- a/sword2/resman.cpp
+++ b/sword2/resman.cpp
@@ -1007,8 +1007,8 @@ void resMan::CacheNewCluster(uint32 newCluster)
if (i<total_clusters)
{
- SetFileAttributes(resource_files[i], FILE_ATTRIBUTE_NORMAL);
- DeleteFile(resource_files[i]);
+ SVM_SetFileAttributes(resource_files[i], FILE_ATTRIBUTE_NORMAL);
+ SVM_DeleteFile(resource_files[i]);
cdTab[i] &= (0xff - LOCAL_CACHE);
FILE *file;
file = fopen("cd.inf", "r+b");
@@ -1106,7 +1106,7 @@ void resMan::CacheNewCluster(uint32 newCluster)
RenderParallax(FetchBackgroundLayer(bgfile), 2);
res_man.Res_close(2950); // release the screen resource
- SetFileAttributes(resource_files[newCluster], FILE_ATTRIBUTE_NORMAL); // Git rid of read-only status, if it is set.
+ SVM_SetFileAttributes(resource_files[newCluster], FILE_ATTRIBUTE_NORMAL); // Git rid of read-only status, if it is set.
FILE *inFile, *outFile;
@@ -1299,7 +1299,7 @@ void resMan::CacheNewCluster(uint32 newCluster)
FlipScreens();
FadeUp((float)0.75);
- SetFileAttributes(resource_files[newCluster], FILE_ATTRIBUTE_NORMAL); // Git rid of read-only status.
+ SVM_SetFileAttributes(resource_files[newCluster], FILE_ATTRIBUTE_NORMAL); // Git rid of read-only status.
// Update cd.inf and cdTab
cdTab[newCluster] |= LOCAL_CACHE;
@@ -1338,7 +1338,7 @@ void resMan::CacheNewCluster(uint32 newCluster)
fseek(file, -3, SEEK_END);
char path[_MAX_PATH];
- GetCurrentDirectory(_MAX_PATH, path);
+ SVM_GetCurrentDirectory(_MAX_PATH, path);
strcat(path, "\\");
strcat(path, resource_files[newCluster]);
@@ -1389,7 +1389,7 @@ void resMan::GetCd(int cd)
{
sprintf(cdPath, "%c:\\", cdDrives[index]);
- if (!GetVolumeInformation(cdPath, sCDName, _MAX_PATH, NULL, &dwMaxCompLength, &dwFSFlags, NULL, 0))
+ if (!SVM_GetVolumeInformation(cdPath, sCDName, _MAX_PATH, NULL, &dwMaxCompLength, &dwFSFlags, NULL, 0))
{
sCDName[0] = 0; // Force the following code to ask for the correct CD.
}
@@ -1469,7 +1469,7 @@ void resMan::GetCd(int cd)
{
sprintf(cdPath, "%c:\\", cdDrives[index]);
- if (!GetVolumeInformation(cdPath, sCDName, _MAX_PATH, NULL, &dwMaxCompLength, &dwFSFlags, NULL, 0))
+ if (!SVM_GetVolumeInformation(cdPath, sCDName, _MAX_PATH, NULL, &dwMaxCompLength, &dwFSFlags, NULL, 0))
{
sCDName[0] = 0;
}