Fixed high priority mode to work without restarting zsnes

This commit is contained in:
pagefault
2001-04-25 20:32:52 +00:00
parent 9ca8fe7cbb
commit 73b40113dd
3 changed files with 17 additions and 4 deletions

View File

@@ -169,6 +169,9 @@ EXTSYM DeInitModemC
EXTSYM ipxgetchar,ipxsendchar,TCPIPStoreByte
EXTSYM TCPIPGetByte
EXTSYM ModemSendChar
%ifdef __WIN32__
EXTSYM CheckPriority
%endif
NEWSYM GuiAsmStart
@@ -3210,6 +3213,11 @@ DisplayBoxes:
cmp al,4
jne .noguioption
call DisplayGUIOption
%ifdef __WIN32__
pushad
call CheckPriority
popad
%endif
jmp .finstuff
.noguioption
cmp al,5

View File

@@ -69,9 +69,9 @@ MAINOBJ=cfgload.obj endmem.obj fixsin.obj init.obj ui.obj vcache.obj water.obj
OBJS=${CHIPSOBJ} ${CPUOBJ} ${WINOBJ} ${GUIOBJ} ${VIDEOBJ} ${ZIPOBJ} ${MAINOBJ} ${WINDOSOBJ}
LIBS=
CFLAGS=/c
CFLAGS=/c /D__WIN32__
ASM=nasm
ASMFLAGS=-f win32
ASMFLAGS=-f win32 -D__WIN32__
CC=cl
.SUFFIXES: .c .cpp .asm

View File

@@ -191,6 +191,12 @@ extern int CurKeyReadPos;
extern int KeyBuffer[16];
}
extern "C" void CheckPriority ( void )
{
if (HighPriority == 1) SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
else SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
}
BOOL InputRead(void)
{
static PrevZ=0;
@@ -439,7 +445,6 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
int RegisterWinClass ( void )
{
WNDCLASS wcl;
@@ -456,7 +461,7 @@ int RegisterWinClass ( void )
wcl.lpszMenuName = NULL;
wcl.lpszClassName = "ZSNESWIN";
if (HighPriority == 1) SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
CheckPriority();
if (RegisterClass(&wcl) == 0) return FALSE;