Implemented delay function for windows, fixes some annoyances in the GUI

This commit is contained in:
pagefault
2006-02-17 00:14:02 +00:00
parent 4629fb11ff
commit 0889cd4d84
2 changed files with 22 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ EXTSYM GetMouseMoveY,GetMouseButton,SetMouseMinX,SetMouseMaxX,SetMouseMinY
EXTSYM SetMouseMaxY,SetMouseX,SetMouseY,T36HZEnabled,MouseButton,Start36HZ EXTSYM SetMouseMaxY,SetMouseX,SetMouseY,T36HZEnabled,MouseButton,Start36HZ
EXTSYM Stop36HZ,BufferSizeW,BufferSizeB,ProcessSoundBuffer,CheckTimers EXTSYM Stop36HZ,BufferSizeW,BufferSizeB,ProcessSoundBuffer,CheckTimers
EXTSYM vesa2_rfull,vesa2_rtrcl,vesa2_rtrcla,vesa2_gfull,vesa2_gtrcl,vesa2_gtrcla EXTSYM vesa2_rfull,vesa2_rtrcl,vesa2_rtrcla,vesa2_gfull,vesa2_gtrcl,vesa2_gtrcla
EXTSYM vesa2_bfull,vesa2_btrcl,vesa2_btrcla,Init_2xSaIMMXW EXTSYM vesa2_bfull,vesa2_btrcl,vesa2_btrcla,Init_2xSaIMMXW,DoSleep
EXTSYM ZsnesPage,V8Mode,GrayscaleMode,PrevWinMode,PrevFSMode,FrameSemaphore EXTSYM ZsnesPage,V8Mode,GrayscaleMode,PrevWinMode,PrevFSMode,FrameSemaphore
EXTSYM _imp__GetLocalTime@4 EXTSYM _imp__GetLocalTime@4
EXTSYM DisplayWIPDisclaimer EXTSYM DisplayWIPDisclaimer
@@ -879,9 +879,6 @@ NEWSYM initvideo ; Returns 1 in videotroub if trouble occurs
popad popad
ret ret
NEWSYM initvideo2 ; ModeQ scanline re-init (Keep blank on non-dos ports)
ret
NEWSYM deinitvideo NEWSYM deinitvideo
ret ret
@@ -1290,7 +1287,16 @@ NEWSYM SoundProcess ; This function is called ~60 times/s at full speed
.nosound .nosound
ret ret
section .data
NEWSYM delayvalue, db 0
section .text
NEWSYM delay NEWSYM delay
mov [delayvalue],ecx
pushad
call DoSleep
popad
ret ret
NEWSYM Check60hz NEWSYM Check60hz

View File

@@ -2535,8 +2535,7 @@ void drawscreenwin(void)
DrawWin256x224x32(); DrawWin256x224x32();
break; break;
} }
/* SURFDW=(DWORD *) &SurfBuf[(resolutn-1)*pitch];
SURFDW=(DWORD *) &SurfBuf[(resolutn-1)*pitch];
color32=0x7F000000; color32=0x7F000000;
for(i=0;i<256;i++) for(i=0;i<256;i++)
@@ -2551,7 +2550,7 @@ void drawscreenwin(void)
{ {
SURFDW[i]=color32; SURFDW[i]=color32;
} }
break; break;*/
case 24: case 24:
MessageBox (NULL, "Sorry. ZSNESw does not work in windowed 24 bit color modes. \nClick 'OK' to switch to a full screen mode.", "DDRAW Error" , MB_ICONERROR ); MessageBox (NULL, "Sorry. ZSNESw does not work in windowed 24 bit color modes. \nClick 'OK' to switch to a full screen mode.", "DDRAW Error" , MB_ICONERROR );
cvidmode=3; cvidmode=3;
@@ -3135,6 +3134,16 @@ int CheckBatteryPercent()
return((SysPowerStat.BatteryLifePercent == 255) ? -1 : SysPowerStat.BatteryLifePercent); return((SysPowerStat.BatteryLifePercent == 255) ? -1 : SysPowerStat.BatteryLifePercent);
} }
extern "C" unsigned int delayvalue;
// Delay function for GUI
void DoSleep()
{
// Fraction value for windows version of sleep
delayvalue /= 100;
Sleep(delayvalue);
}
extern "C" unsigned int PrevBuildNum; extern "C" unsigned int PrevBuildNum;