diff --git a/zsnes/src/gui/gui.asm b/zsnes/src/gui/gui.asm index c7e39f02..eadf4047 100644 --- a/zsnes/src/gui/gui.asm +++ b/zsnes/src/gui/gui.asm @@ -171,6 +171,7 @@ EXTSYM TCPIPGetByte EXTSYM ModemSendChar %ifdef __WIN32__ EXTSYM CheckPriority +EXTSYM CheckAlwaysOnTop %endif NEWSYM GuiAsmStart @@ -544,6 +545,7 @@ NEWSYM UseCubicSpline, db 1 NEWSYM LargeSoundBuf, db 0 NEWSYM HighPriority, db 0 +NEWSYM AlwaysOnTop, db 0 GUIsave equ $-GUIRAdd @@ -562,9 +564,9 @@ ModemOKStat db 0 ; OK is detected on modem status ; LOAD STAT INPT OPT VID SND CHT NET GMKEY GUIOP ABT RSET SRC STCN MOVE CMBO ADDO GUIwinposxo dd 0,5 ,60 ,30 ,55 ,50 ,65 ,5 ,30 ,20 ,10 ,80 ,65 ,20 ,70 ,50 ,3 ,50 -GUIwinposyo dd 0,20 ,70 ,30 ,20 ,22 ,36 ,20 ,30 ,20 ,30 ,70 ,60 ,30 ,65 ,50 ,22 ,60 -GUIwinsizex dd 0,244 ,126 ,189 ,167 ,170 ,148 ,244 ,8*16,13*16,176 ,7*16,9*16,8*16,9*16,140 ,250 ,160 -GUIwinsizey dd 0,190 ,3*16,166 ,190 ,186 ,168 ,191 ,40 ,189 ,152 ,98 ,42 ,40 ,42 ,70 ,190 ,60 +GUIwinposyo dd 0,20 ,70 ,30 ,20 ,22 ,36 ,20 ,30 ,20 ,20 ,70 ,60 ,30 ,65 ,50 ,22 ,60 +GUIwinsizex dd 0,244 ,126 ,189 ,167 ,170 ,148 ,244 ,8*16,13*16,180 ,7*16,9*16,8*16,9*16,140 ,250 ,160 +GUIwinsizey dd 0,190 ,3*16,166 ,190 ,186 ,168 ,191 ,40 ,189 ,182 ,98 ,42 ,40 ,42 ,70 ,190 ,60 GUIwinptr db 0 GUItextcolor db 0,0,0,0,0 @@ -3248,6 +3250,11 @@ DisplayBoxes: cmp al,10 jne .noguiconf call DisplayGUIOptns +%ifdef __WIN32__ + pushad + call CheckAlwaysOnTop + popad +%endif jmp .finstuff .noguiconf cmp al,11 diff --git a/zsnes/src/gui/guimouse.inc b/zsnes/src/gui/guimouse.inc index 9e18e5bf..8631658c 100644 --- a/zsnes/src/gui/guimouse.inc +++ b/zsnes/src/gui/guimouse.inc @@ -2520,6 +2520,9 @@ DisplayGUIOptnsClick: GUIClickCButton 12,73,byte[JoyPad1Move] GUIClickCButton6 12,83,byte[GUIEffect],1 GUIClickCButton6 12,93,byte[GUIEffect],2 +%ifdef __WIN32__ + GUIClickCButton 12,168,byte[AlwaysOnTop] +%endif cmp eax,25 jl near .nomovebar cmp eax,25+32*4-1 diff --git a/zsnes/src/gui/guiwindp.inc b/zsnes/src/gui/guiwindp.inc index 134b68cd..b2fd3d73 100644 --- a/zsnes/src/gui/guiwindp.inc +++ b/zsnes/src/gui/guiwindp.inc @@ -4608,10 +4608,21 @@ DisplayGUIOptns: mov dword[GUITemp],GUIIconDataCheckBoxC .nocheck8 GUIDisplayIconWin 10,12,93,[GUITemp] +%ifdef __WIN32__ + mov dword[GUITemp],GUIIconDataCheckBoxUC + cmp byte[AlwaysOnTop],1 + jne .nocheck9 + mov dword[GUITemp],GUIIconDataCheckBoxC +.nocheck9 + GUIDisplayIconWin 10,12,168,[GUITemp] +%endif mov al,[GUIWincol] mov byte[GUItextcolor],al GUIOuttextwin2 10,6,111,GUIGUIOptnsText1 GUIOuttextwin2 10,6,16,GUIGUIOptnsText5 +%ifdef __WIN32__ + GUIOuttextwin2 10,6,160,GUIGUIOptnsTextD +%endif mov byte[GUItextcolor],163 cmp byte[GUIWincoladd],0 je .zero @@ -4619,6 +4630,9 @@ DisplayGUIOptns: .zero GUIOuttextwin2 10,5,110,GUIGUIOptnsText1 GUIOuttextwin2 10,5,15,GUIGUIOptnsText5 +%ifdef __WIN32__ + GUIOuttextwin2 10,5,160,GUIGUIOptnsTextD +%endif mov byte[GUItextcolor],217 cmp byte[GUIWincoladd],0 je .zero3 @@ -4636,6 +4650,9 @@ DisplayGUIOptns: GUIOuttextwin2u 10,26,78,GUIGUIOptnsTextA,0 GUIOuttextwin2 10,26,88,GUIGUIOptnsTextB GUIOuttextwin2 10,26,98,GUIGUIOptnsTextC +%ifdef __WIN32__ + GUIOuttextwin2 10,26,173,GUIGUIOptnsTextE +%endif mov byte[GUIGUIOptnsText6],'R' GUIOuttextwin2 10,16,123,GUIGUIOptnsText6 mov byte[GUIGUIOptnsText6],'G' @@ -4654,6 +4671,9 @@ DisplayGUIOptns: GUIOuttextwin2 10,25,77,GUIGUIOptnsTextA GUIOuttextwin2 10,25,87,GUIGUIOptnsTextB GUIOuttextwin2 10,25,97,GUIGUIOptnsTextC +%ifdef __WIN32__ + GUIOuttextwin2 10,25,172,GUIGUIOptnsTextE +%endif mov byte[GUIGUIOptnsText6],'R' GUIOuttextwin2 10,15,122,GUIGUIOptnsText6 mov byte[GUIGUIOptnsText6],'G' @@ -4727,12 +4747,14 @@ GUIGUIOptnsText3 db 'MOUSE SHADOW',0 GUIGUIOptnsText4 db 'KEEP MENU POSITION',0 GUIGUIOptnsText5 db 'GUI SWITCHES :',0 GUIGUIOptnsText6 db '@',0 -GUIGUIOptnsText7 db 'SAVE WINDOW POSITIONS',0 +GUIGUIOptnsText7 db 'SAVE GUI WINDOW POSITIONS',0 GUIGUIOptnsText8 db 'CLICK ENTERS/EXITS GUI',0 GUIGUIOptnsText9 dd 0 GUIGUIOptnsTextA db 'USE JOYPAD1 TO CONTROL',0 GUIGUIOptnsTextB dd 'ENABLE SNOW EFFECT',0 GUIGUIOptnsTextC dd 'ENABLE WATER EFFECT',0 +GUIGUIOptnsTextD dd 'MAIN WINDOW OPTIONS :',0 +GUIGUIOptnsTextE dd 'ALWAYS ON TOP',0 DisplayGUIAbout: cmp byte[OSPort],3 diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 1a52ae9d..d4651257 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -186,6 +186,7 @@ extern BYTE StereoSound; extern DWORD SoundQuality; extern BYTE LargeSoundBuf; extern BYTE HighPriority; +extern BYTE AlwaysOnTop; extern int CurKeyPos; extern int CurKeyReadPos; extern int KeyBuffer[16]; @@ -197,6 +198,12 @@ extern "C" void CheckPriority() else SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); } +extern "C" void CheckAlwaysOnTop() +{ + if (AlwaysOnTop == 1) SetWindowPos(hMainWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + else SetWindowPos(hMainWindow, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); +} + BOOL InputRead(void) { static PrevZ=0;