⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guimouse.inc

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 INC
📖 第 1 页 / 共 5 页
字号:
    dec ebx
    cmp eax,ebx
    jg %%nomod
    mov [%10],eax
%%nomod
    cmp byte[GUIHold],0
    jne %%held
    cmp dword[GUIDClickTL],0
    je %%noprevhold
    cmp byte[GUIDClCWin],%11
    jne %%noprevhold
    cmp [GUIDClCEntry],eax
    jne %%noprevhold
    mov dword[GUIDClickTL],0
    mov eax,%12
    cmp eax,1
    jne %%cheat
    call GUILoadData
    ret
%%cheat
    call CheatCodeToggle
    ret
%%noprevhold
    mov dword[GUIDClickTL],%13
    mov byte[GUIDClCWin],%11
    mov [GUIDClCEntry],eax
%%held
    mov eax,[GUIwinposy+%12*4]
    add eax,%2-1
    mov [GUIHoldYlim],eax
    mov eax,[GUIwinposy+%12*4]
    add eax,%4+1
    mov [GUIHoldYlimR],eax
    mov eax,[GUIwinposx+%12*4]
    add eax,%1
    mov [GUIHoldXlimL],eax
    mov eax,[GUIwinposx+%12*4]
    add eax,%3
    mov [GUIHoldXlimR],eax
    mov byte[GUIHold],3
    ret
%%noload
%endmacro

%macro GUIWinControl2 13 ;Key Combination Editor Exclusive
    cmp eax,%1
    jl near %%noload
    cmp edx,%2
    jl near %%noload
    cmp eax,%3
    jg near %%noload
    cmp edx,%4
    jg near %%noload
    cmp dword[%7],0
    je near %%noload
    mov dword[GUIccomblcursloc],0FFFFFFFFh
    mov dword[%5],%11
    mov eax,edx
    sub eax,%8
    xor edx,edx
    mov ebx,%9
    div ebx
    add eax,[%6]
    mov ebx,[%7]
    dec ebx
    cmp eax,ebx
    jg %%nomod
    mov [%10],eax
%%nomod
    cmp byte[GUIHold],0
    jne %%held
    cmp dword[GUIDClickTL],0
    je %%noprevhold
    cmp byte[GUIDClCWin],%11
    jne %%noprevhold
    cmp [GUIDClCEntry],eax
    jne %%noprevhold
    mov dword[GUIDClickTL],0
    mov eax,%12
    cmp eax,1
    jne %%cheat
    call GUILoadData
    ret
%%cheat
    call CheatCodeToggle
    ret
%%noprevhold
    mov dword[GUIDClickTL],%13
    mov byte[GUIDClCWin],%11
    mov [GUIDClCEntry],eax
%%held
    mov eax,[GUIwinposy+%12*4]
    add eax,%2-1
    mov [GUIHoldYlim],eax
    mov eax,[GUIwinposy+%12*4]
    add eax,%4+1
    mov [GUIHoldYlimR],eax
    mov eax,[GUIwinposx+%12*4]
    add eax,%1
    mov [GUIHoldXlimL],eax
    mov eax,[GUIwinposx+%12*4]
    add eax,%3
    mov [GUIHoldXlimR],eax
    mov byte[GUIHold],3
    ret
%%noload
%endmacro

; Mouseimplementation

DisplayGUIConfirmClick2:
    cmp dword[GUIfileentries],1
    jbe near .noload2
    GUISlidebarPostImpl 146,33,153,33+93,.scrollupsl,.scrolldownsl,1,15,GUIcurrentviewloc,GUIcurrentcursloc,GUIfileentries,GUIcurrentfilewin,0
    GUIPostWinBoxMove 5,26,144,27+15*7,GUIcurrentviewloc,GUIcurrentcursloc,GUIfileentries,.scrollupsl,.scrolldownsl,DisplayGUIConfirmClick.skipscrol,15
.noload2
    cmp dword[GUIdirentries],1
    jbe near .noload3
    GUISlidebarPostImpl 230,33,237,33+93,.scrollupsld,.scrolldownsld,3,15,GUIcurrentdirviewloc,GUIcurrentdircursloc,GUIdirentries,GUIcurrentfilewin,1
    GUIPostWinBoxMove 160,26,228,27+15*7,GUIcurrentdirviewloc,GUIcurrentdircursloc,GUIdirentries,.scrollupsld,.scrolldownsld,DisplayGUIConfirmClick.skipscrol,15
.noload3
DisplayGUIConfirmClick:
;DrawSlideBarWin 1,133,43,[GUIcurrentviewloc],[GUIfileentries],15,94,[GUILStA]
    ; offset 0 = (ysize-(yend-ystart+1)), offset 1 = starty, offset 2 = endy
    ; SlideBar Implementation
    GUISlidebarImpl 146,33,153,33+93,GUILStA,15,GUIcurrentviewloc,GUIcurrentcursloc,GUIfileentries,1
    GUISlidebarImpl 230,33,237,33+93,GUILStB,15,GUIcurrentdirviewloc,GUIcurrentdircursloc,GUIdirentries,1
    mov dword[GUIScrolTim1],0
    mov dword[GUIScrolTim2],6
.skipscrol
    GUIClickCButtonL 10,187
    GUIWinControl 5,27,144,26+15*7,GUIcurrentfilewin,GUIcurrentviewloc,GUIfileentries,27,7,GUIcurrentcursloc,0,1,30
    GUIWinControl 160,27,228,26+15*7,GUIcurrentfilewin,GUIcurrentdirviewloc,GUIdirentries,27,7,GUIcurrentdircursloc,1,1,30
    GUIPHoldbutton 186,167,228,178,1
    GUIPButtonHoleLoad 9,163,byte[GUIloadfntype],0
    GUIPButtonHoleLoad 9,171,byte[GUIloadfntype],1
    GUIPButtonHoleLoad 9,179,byte[GUIloadfntype],2
    ret

DisplayGUIChoseSaveClick:
    GUIPButtonHole 10,28,byte[GUIChoseSaveText2],'T'
    GUIPButtonHole 30,28,byte[GUIChoseSaveText2],'1'
    GUIPButtonHole 50,28,byte[GUIChoseSaveText2],'2'
    GUIPButtonHole 70,28,byte[GUIChoseSaveText2],'3'
    GUIPButtonHole 90,28,byte[GUIChoseSaveText2],'4'
    GUIPButtonHole 10,43,byte[GUIChoseSaveText2],'5'
    GUIPButtonHole 30,43,byte[GUIChoseSaveText2],'6'
    GUIPButtonHole 50,43,byte[GUIChoseSaveText2],'7'
    GUIPButtonHole 70,43,byte[GUIChoseSaveText2],'8'
    GUIPButtonHole 90,43,byte[GUIChoseSaveText2],'9'
    mov ebx,[statefileloc]
    mov al,[GUIChoseSaveText2]
    mov [fnamest+ebx],al
    ret

DisplayGUIMovieClick:
    cmp byte[MovieRecordWinVal],0
    je near .displayboxa
    GUIPHoldbutton 17,55,59,66,19
    GUIPHoldbutton 70,55,112,66,20
    ret
.displayboxa
    GUIPHoldbutton 7,17,49,28,16
    GUIPHoldbutton 7,33,49,44,17
    GUIPHoldbutton 7,49,49,60,18
%ifdef __LINUX__
    GUIPButtonHole 60,25,byte[CMovieExt],'v'
%else
    GUIPButtonHole 60,25,byte[CMovieExt],'V'
%endif
    GUIPButtonHole 80,25,byte[CMovieExt],'1'
    GUIPButtonHole 100,25,byte[CMovieExt],'2'
    GUIPButtonHole 120,25,byte[CMovieExt],'3'
    GUIPButtonHole 60,40,byte[CMovieExt],'4'
    GUIPButtonHole 80,40,byte[CMovieExt],'5'
    GUIPButtonHole 100,40,byte[CMovieExt],'6'
    GUIPButtonHole 120,40,byte[CMovieExt],'7'
    GUIPButtonHole 60,55,byte[CMovieExt],'8'
    GUIPButtonHole 80,55,byte[CMovieExt],'9'
    ret

%macro DGOptnsProcBox 3
    cmp eax,%1
    jl %%skip
    cmp edx,%2
    jl %%skip
    cmp eax,%1+19
    jg %%skip
    cmp edx,%2+6
    jg %%skip
    push edi
    call guipresstest
    pop edi
    cmp ebx,1
    je %%cancelkey
    cmp ebx,3Bh
    je %%cancelkey
    mov %3,ebx
;    cmp byte[OSPort],3
;    jne %%notwin32
%ifndef __MSDOS__
    cmp dword[keycontrolval],0
    je %%notwin32
    push ebx
    mov ebx,[keycontrolval]
    mov byte[ebx],1
    pop ebx
%endif
%%notwin32
    ret
%%cancelkey
    xor ebx,ebx
    mov %3,ebx
    ret
%%skip
%endmacro

%macro DGOptnsProcBoxc 5
    cmp eax,%1
    jl %%skip
    cmp edx,%2
    jl %%skip
    cmp eax,%3
    jg %%skip
    cmp edx,%4
    jg %%skip
    push edi
    call guipresstest
    pop edi
    cmp ebx,1
    je %%cancelkey
    cmp ebx,3Bh
    je %%cancelkey
    mov %5,ebx
    ret
%%cancelkey
    cmp ebx,1
    jne %%noesc
    mov byte[pressed+1],2
%%noesc
    xor ebx,ebx
    mov %5,ebx
    ret
%%skip
%endmacro

%macro DGOptnsProcBoxb 3
    cmp eax,%1
    jl near %%skip
    cmp edx,%2
    jl near %%skip
    cmp eax,%1+19
    jg near %%skip
    cmp edx,%2+6
    jg near %%skip
    push edi
    call guipresstest
    pop edi
    cmp ebx,1
    je %%cancelkey
    cmp ebx,3Bh
    je %%cancelkey
    mov %3,ebx
    jmp %%donekey
%%cancelkey
    cmp ebx,1
    jne %%noesc
    mov byte[pressed+1],2
%%noesc
    xor ebx,ebx
    mov %3,ebx
%%donekey
    xor ecx,ecx
%%joysloop
    cmp dword[pl1ULk+ecx*4],80h
    jbe %%nojoystick
    mov dword[pl1ULk+ecx*4],0
%%nojoystick
    inc ecx
    cmp ecx,16
    jne %%joysloop
    ret
%%skip
%endmacro

DisplayGUIInputClick2:
    push eax
    mov eax,[NumInputDevices]
    mov dword[GUINumValue],eax
    pop eax
    GUISlidebarPostImpl 109,42,116,69,.scrollup,.scrolldown,9,5,GUIcurrentinputviewloc,GUIcurrentinputcursloc,GUINumValue,GUIBlankVar,1
    GUIPostWinBoxMove 5,35,107,35+5*8,GUIcurrentinputviewloc,GUIcurrentinputcursloc,GUINumValue,.scrollup,.scrolldown,DisplayGUIInputClick.skipscrol,5
DisplayGUIInputClick:
    ; SlideBar Implementation
    push eax
    mov eax,[NumInputDevices]
    mov dword[GUINumValue],eax
    pop eax
    GUISlidebarImpl 109,42,116,69,GUIIStA,5,GUIcurrentinputviewloc,GUIcurrentinputcursloc,GUINumValue,3
.skipscrol
    ;x,y,x2,y2,currentwin,vpos,#entries,starty,y/entry,cpos,winval,win#,dclicktick#
    GUIWinControl 5,36,107,34+5*8,GUIBlankVar,GUIcurrentinputviewloc,GUINumValue,35,8,GUIcurrentinputcursloc,4,3,0
    GUIPHoldbutton 125,34,155,45,14
;    cmp byte[OSPort],3
;    je near .win32
%ifdef __MSDOS__
    GUIPHoldbutton 125,50,185,61,15
%endif
;.win32
    GUIPHoldbutton 125,66,185,77,40
    mov edi,pl1selk
    mov dword[keycontrolval],pl1contrl
    cmp byte[cplayernum],1
    jne .nopl2
    mov edi,pl2selk
    mov dword[keycontrolval],pl2contrl
.nopl2
    cmp byte[cplayernum],2
    jne .nopl3
    mov edi,pl3selk
    mov dword[keycontrolval],pl3contrl
.nopl3
    cmp byte[cplayernum],3
    jne .nopl4
    mov edi,pl4selk
    mov dword[keycontrolval],pl4contrl
.nopl4
    cmp byte[cplayernum],4
    jne .nopl5
    mov edi,pl5selk
    mov dword[keycontrolval],pl5contrl
.nopl5
    DGOptnsProcBox 45,150,[edi]
    DGOptnsProcBox 45,140,[edi+4]
    DGOptnsProcBox 45,100,[edi+8]
    DGOptnsProcBox 45,110,[edi+12]
    DGOptnsProcBox 45,120,[edi+16]
    DGOptnsProcBox 45,130,[edi+20]
    DGOptnsProcBox 85,120,[edi+24]
    DGOptnsProcBox 85,100,[edi+28]
    DGOptnsProcBox 85,140,[edi+32]
    DGOptnsProcBox 85,130,[edi+36]
    DGOptnsProcBox 85,110,[edi+40]
    DGOptnsProcBox 85,150,[edi+44]

    mov edi,pl1Atk
    cmp byte[cplayernum],1
    jne .nopl2t
    mov edi,pl2Atk
.nopl2t
    cmp byte[cplayernum],2
    jne .nopl3t
    mov edi,pl3Atk
.nopl3t
    cmp byte[cplayernum],3
    jne .nopl4t
    mov edi,pl4Atk
.nopl4t
    cmp byte[cplayernum],4
    jne .nopl5t
    mov edi,pl5Atk
.nopl5t
    DGOptnsProcBox 165,100,[edi]      ; A Turbo
    DGOptnsProcBox 165,110,[edi+4]    ; B Turbo
    DGOptnsProcBox 125,100,[edi+8]    ; X Turbo
    DGOptnsProcBox 125,110,[edi+12]   ; Y Turbo

    mov edi,pl1Ltk
    cmp byte[cplayernum],1
    jne .nopl2tl
    mov edi,pl2Ltk
.nopl2tl
    cmp byte[cplayernum],2
    jne .nopl3tl
    mov edi,pl3Ltk
.nopl3tl
    cmp byte[cplayernum],3
    jne .nopl4tl
    mov edi,pl4Ltk
.nopl4tl
    cmp byte[cplayernum],4
    jne .nopl5tl
    mov edi,pl5Ltk
.nopl5tl
    DGOptnsProcBox 125,120,[edi]      ; L Turbo
    DGOptnsProcBox 165,120,[edi+4]    ; R Turbo

    mov edi,pl1ULk
    cmp byte[cplayernum],1
    jne .nopl2tb
    mov edi,pl2ULk
.nopl2tb
    cmp byte[cplayernum],2
    jne .nopl3tb
    mov edi,pl3ULk
.nopl3tb
    cmp byte[cplayernum],3
    jne .nopl4tb
    mov edi,pl4ULk
.nopl4tb
    cmp byte[cplayernum],4
    jne .nopl5tb
    mov edi,pl5ULk
.nopl5tb
    DGOptnsProcBoxb 165,140,[edi]
    DGOptnsProcBoxb 165,150,[edi+4]
    DGOptnsProcBoxb 125,140,[edi+8]
    DGOptnsProcBoxb 125,150,[edi+12]
%ifdef __MSDOS__
    xor ebx,ebx
    mov bl,[cplayernum]
    GUIClickCButtonID 5,162,byte[pl1p209+ebx]
%endif
    ret


DisplayGUIOptionClick:
    GUIClickCButtonfr 11,26,byte[frameskip]
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUINGVID+ebx],1
    jne near .invalidng
    GUIClickCButton2 11,36,byte[newengen],byte[cfgnewgfx],1
.invalidng
%ifndef __LINUX__
    GUIClickCButton2 11,46,byte[vsyncon],byte[cfgvsync],1
%endif
    GUIClickCButton2 11,56,byte[FPUCopy],byte[cfgcopymethod],2
    GUIClickCButtonM 11,66,byte[pl12s34]
%ifdef __MSDOS__
    GUIClickCButton 11,76,byte[SidewinderFix]
%endif
%ifdef __WIN32__
    GUIClickCButton 11,76,byte[HighPriority]
%endif
    GUIClickCButton 11,86,byte[FPSAtStart]
    GUIClickCButton 11,96,byte[Turbo30hz]
    GUIClickCButton 11,106,byte[TimerEnable]
    GUIClickCButton 11,116,byte[FastFwdToggle]
    GUIClickCButton 11,126,byte[SRAMSave5Sec]
    GUIClickCButtonO 11,136,byte[OldGfxMode2]
    GUIClickCButton 11,146,byte[LatestSave]
    GUIClickCButton 11,156,byte[AutoState]
    GUIClickCButton 11,166,byte[DontSavePath]
%ifdef __WIN32__
    GUIClickCButton 11,176,byte[DisableScreenSaver]
    GUIClickCButtonat 11,186,byte[AlternateTimer]
%endif
    ; Frameskip = 0
    cmp byte[frameskip],0
    je near .autopress
    GUIPHoldbutton2 97,12,105,22,12,byte[frameskip],1,10
    GUIPHoldbutton2 108,12,116,22,13,byte[frameskip],-1,1
    ret
.autopress
    GUIPHoldbutton2 118,12,126,22,12,byte[maxskip],1,9
    GUIPHoldbutton2 129,12,137,22,13,byte[maxskip],-1,0
    ret


DisplayGUIVideoClick2:
    push eax
    mov eax,[NumVideoModes]
    mov dword[GUINumValue],eax
    pop eax
    GUISlidebarPostImpl 117,33,124,62,.scrollup,.scrolldown,5,5,GUIcurrentvideoviewloc,GUIcurrentvideocursloc,GUINumValue,GUIBlankVar,1
    GUIPostWinBoxMove 5,27,115,27+5*8,GUIcurrentvideoviewloc,GUIcurrentvideocursloc,GUINumValue,.scrollup,.scrolldown,DisplayGUIVideoClick.skipscrol,5
DisplayGUIVideoClick:
    ; SlideBar Implementation
    push eax
    mov eax,[NumVideoModes]
    mov dword[GUINumValue],eax
    pop eax
    GUISlidebarImpl 117,33,124,62,GUIVStA,5,GUIcurrentvideoviewloc,GUIcurrentvideocursloc,GUINumValue,5
.skipscrol
    GUIWinControl 5,28,115,26+5*8,GUIBlankVar,GUIcurrentvideoviewloc,GUINumValue,27,8,GUIcurrentvideocursloc,2,5,0

    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUISLVID+ebx],0
    je near .nocheckboxb
.nocheckboxb
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUITBVID+ebx],0
    je .nocheckboxttb
    GUIClickCButton5 11,163,byte[Triplebufen],1
.nocheckboxttb
%ifndef __MSDOS__
    GUIClickCButton 11,183,byte[GrayscaleMode]
%endif
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUIM7VID+ebx],0
    je .nocheckboxtm7
    GUIClickCButton5 11,173,byte[Mode7HiRes16b],1
.nocheckboxtm7
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUIHSVID+ebx],0
    je near .nohsline
    GUIClickCButton4 21,114,byte[scanlines],byte[cfgscanline],1
    GUIClickCButton4 61,114,byte[scanlines],byte[cfgscanline],3
    GUIClickCButton4 101,114,byte[scanlines],byte[cfgscanline],2
.nohsline
    GUIClickCButton 11,123,byte[TripleBufferWin]
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUI2xVID+ebx],0
    je near .no2xSaI
    GUIClickCButton6 11,133,byte[En2xSaI],1
    GUIClickCButton6 11,143,byte[En2xSaI],2
    GUIClickCButton6 11,153,byte[En2xSaI],3
.no2xSaI
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUIIEVID+ebx],0
    je .nocheckbox1b
    GUIClickCButton3 11,78,byte[antienab],byte[cfginterp],1
.nocheckbox1b
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUIBIFIL+ebx],0
    je .nocheckbox1bf
    GUIClickCButton 11,163,byte[BilinearFilter]
.nocheckbox1bf
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUIFSVID+ebx],0
    je .nocheckbox2b
    GUIClickCButton3 11,88,byte[ScreenScale],byte[GUIScreenScale],1
.nocheckbox2b
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUISSVID+ebx],0
    je .nocheckbox3b
    GUIClickCButton3 11,98,byte[smallscreenon],byte[GUIsmallscreenon],1
.nocheckbox3b
    xor ebx,ebx
    mov bl,[cvidmode]
    cmp byte[GUII2VID+ebx],0
    je .nocheckboxi2
    GUIClickCButton3 11,163,byte[antienab],byte[cfginterp],1
.nocheckboxi2

    GUIPHoldbutton 128,60,164,71,4
    ret

GUINumValue dd 0
GUIBlankVar dd 0

DisplayGUISoundClick:
    mov eax,[GUImouseposx]
    sub eax,[GUIwinposx+6*4]
    mov edx,[GUImouseposy]
    sub edx,[GUIwinposy+6*4]
    GUIClickCButton 11,21,byte[cfgsoundon]
    GUIClickCButton 11,30,byte[cfgStereoSound]
    GUIClickCButton 11,39,byte[RaisePitch]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -