Fix some 32bpp slowdown problems and also some miscellanious cleanups

This commit is contained in:
theoddone33
2001-05-13 20:13:47 +00:00
parent 93df5959a5
commit ef53f205ab

View File

@@ -39,7 +39,6 @@ SDL_Joystick *JoystickInput[4];
DWORD BitDepth=0; DWORD BitDepth=0;
BYTE BackColor=0; BYTE BackColor=0;
int DTimerCheck;
float MouseMinX=0; float MouseMinX=0;
float MouseMaxX=256; float MouseMaxX=256;
float MouseMinY=0; float MouseMinY=0;
@@ -276,7 +275,7 @@ int Main_Proc(void)
void ProcessKeyBuf(int scancode) void ProcessKeyBuf(int scancode)
{ {
int accept = 0; int accept = 0;
int vkeyval; int vkeyval = 0;
if (((scancode>='A') && (scancode<='Z')) || if (((scancode>='A') && (scancode<='Z')) ||
((scancode>='a') && (scancode<='z')) || ((scancode>='a') && (scancode<='z')) ||
@@ -504,7 +503,7 @@ int startgame(void)
} }
if (sdl_inited == 0) { if (sdl_inited == 0) {
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0) { if (SDL_Init(SDL_INIT_AUDIO|SDL_INIT_TIMER|SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0) {
fprintf(stderr, "Could not initialize SDL!\n"); fprintf(stderr, "Could not initialize SDL!\n");
return FALSE; return FALSE;
} else { } else {
@@ -559,6 +558,7 @@ DWORD LockSurface(void)
void UnlockSurface(void) void UnlockSurface(void)
{ {
if (SurfaceLocking) SDL_UnlockSurface(surface); if (SurfaceLocking) SDL_UnlockSurface(surface);
SDL_UpdateRect(surface,0,0,0,0);
SurfBuf = surface->pixels; SurfBuf = surface->pixels;
} }
@@ -596,15 +596,14 @@ extern unsigned char romispal;
void Start60HZ(void) void Start60HZ(void)
{ {
freq = 1000; update_ticks_pc2 = UPDATE_TICKS_UDP;
update_ticks_pc2 = UPDATE_TICKS_UDP * freq / 1000;
if(romispal==1) if(romispal==1)
{ {
update_ticks_pc = UPDATE_TICKS_GAMEPAL * freq / 1000; update_ticks_pc = UPDATE_TICKS_GAMEPAL;
} }
else else
{ {
update_ticks_pc = UPDATE_TICKS_GAME * freq / 1000; update_ticks_pc = UPDATE_TICKS_GAME;
} }
start = SDL_GetTicks(); start = SDL_GetTicks();
@@ -622,9 +621,8 @@ void Stop60HZ(void)
void Start36HZ(void) void Start36HZ(void)
{ {
freq = 1000; update_ticks_pc2 = UPDATE_TICKS_UDP;
update_ticks_pc2 = UPDATE_TICKS_UDP * freq / 1000; update_ticks_pc = UPDATE_TICKS_GUI;
update_ticks_pc = UPDATE_TICKS_GUI * freq / 1000;
// QueryPerformanceCounter((LARGE_INTEGER*)&start); // QueryPerformanceCounter((LARGE_INTEGER*)&start);
// QueryPerformanceCounter((LARGE_INTEGER*)&start2); // QueryPerformanceCounter((LARGE_INTEGER*)&start2);
@@ -639,7 +637,6 @@ void Stop36HZ(void)
T36HZEnabled=0; T36HZEnabled=0;
} }
char WinMessage[256];
extern unsigned char cvidmode; extern unsigned char cvidmode;
DWORD FirstVid=1; DWORD FirstVid=1;
DWORD FirstFull=1; DWORD FirstFull=1;
@@ -756,7 +753,6 @@ void CheckTimers(void)
// call Game60hzcall // call Game60hzcall
// popad // popad
// } // }
DTimerCheck = 1;
Game60hzcall(); Game60hzcall();
start += update_ticks_pc; start += update_ticks_pc;
} }
@@ -775,7 +771,6 @@ void CheckTimers(void)
// popad // popad
// } // }
GUI36hzcall(); GUI36hzcall();
DTimerCheck = 1;
start += update_ticks_pc; start += update_ticks_pc;
} }
} }
@@ -860,12 +855,6 @@ void UpdateVFrame(void)
WinUpdateDevices(); WinUpdateDevices();
CheckTimers(); CheckTimers();
if (DTimerCheck == 1)
{
SDL_UpdateRect(surface,0,0,0,0);
DTimerCheck = 0;
}
#else #else
int DataNeeded; int DataNeeded;
int SPCSize=256; int SPCSize=256;