📄 gui.asm
字号:
%ifdef __MSDOS__ mov byte[GUINetPlayMenuData+14],2%endif cmp byte[romloadskip],0 je .noromloaded mov byte[GUIGameMenuData+14],2 mov byte[GUIGameMenuData+14*2],2 mov byte[GUIGameMenuData+14*4],2 mov byte[GUIGameMenuData+14*5],2 mov byte[GUIGameMenuData+14*6],2 mov byte[GUICheatMenuData],2 mov byte[GUICheatMenuData+14],2 mov byte[GUICheatMenuData+14*2],2 mov byte[GUIMiscMenuData+14*2],2.noromloaded retSECTION .dataSantaData:db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0db 0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0db 0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0db 1,0,0,1,0,0,1,0,0,0,1,1,1,0,1,1db 1,1,0,1,1,0,1,1,0,1,0,1,1,1,1,1db 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1db 1,1,0,1,1,0,1,1,0,0,1,1,1,1,1,1SantaPos dd 272SantaNextT dd 36*15NEWSYM NumSnow, dd 0NEWSYM SnowTimer, dd 36*30MsgGiftLeft dd 0SECTION .textDrawSnow: cmp byte[OkaySC],0 je near .nosanta cmp dword[MsgGiftLeft],0 je .nodec mov edx,20 mov ebx,210 mov byte[GUItextcolor],228 GUIOuttextwin .giftmsg.nodec mov esi,[vidbuffer] add esi,[SantaPos] add esi,60*288 mov edx,SantaData mov ebx,8.sloop2 mov ecx,16.sloop cmp byte[edx],0 je .transp mov byte[esi],0.transp inc esi inc edx dec ecx jnz .sloop add esi,272 dec ebx jnz .sloop2.nosanta mov esi,[vidbuffer] mov ecx,200 xor edx,edx.loop xor eax,eax mov al,[SnowData+edx*4+3] mov ebx,eax shl eax,8 shl ebx,5 add eax,ebx xor ebx,ebx mov bl,[SnowData+edx*4+1] add eax,ebx add eax,16 mov bl,[SnowVelDist+edx*2] and bl,03h add bl,228 test byte[SnowVelDist+edx*2],8 jz .nosnow mov [esi+eax],bl.nosnow inc edx dec ecx jnz .loop ; Change Snow Displacement Values.next cmp dword[SnowMover],0 je .nomore call ProcessSnowVelocity dec dword[SnowMover] jmp .next.nomore retSECTION .data.giftmsg db 'A GIFT TO YOU IN THE OPTIONS!',0SECTION .textProcessSnowVelocity: cmp dword[MsgGiftLeft],0 je .nodec dec dword[MsgGiftLeft].nodec cmp dword[NumSnow],200 jne .snowincr cmp dword[SantaNextT],0 je .skip dec dword[SantaNextT] jmp .notsreset.skip dec dword[SantaPos] cmp dword[SantaPos],0 jne .notsreset mov dword[SantaPos],272 mov dword[SantaNextT],36*60 jmp .notsreset.snowincr dec dword[SnowTimer] jnz .notsreset inc dword[NumSnow] mov dword[SnowTimer],18.notsreset mov ecx,[NumSnow] cmp ecx,0 jne .okay ret.okay xor edx,edx.loop xor eax,eax mov al,[SnowVelDist+edx*2] mov ebx,100 sub bl,[MusicRelVol] add bx,bx add ax,bx add ax,bx add word[SnowData+edx*4],ax xor eax,eax mov al,[SnowVelDist+edx*2+1] add ax,256 add word[SnowData+edx*4+2],ax cmp word[SnowData+edx*4+2],200h ja .nosdata or byte[SnowVelDist+edx*2],8.nosdata inc edx dec ecx jnz .loop retSECTION .bssOkaySC resb 1%macro ProcessOneDigit 1 cmp dl,9 jbe %%notover add dl,65-48-10%%notover add dl,48 mov [.message+%1],dl xor edx,edx div ebx%endmacroSECTION .data.message db 0,0,0,0,' ',0,0,0,0,0,0,0SECTION .textNEWSYM StartGUI%ifdef __OPENGL__ cmp byte[BilinearFilter],1 jne near .skipbl mov byte[blinit],1.skipbl%endif mov byte[GUILoadPos],0 cmp byte[TripBufAvail],0 jne .notexttb%ifdef __MSDOS__ mov byte[Triplebufen],0%endif.notexttb cmp byte[MMXSupport],1 jne .2xSaIdis cmp byte[newgfx16b],0 je .2xSaIdis jmp .no2xSaIdis.2xSaIdis mov byte[En2xSaI],0 mov byte[hqFilter],0.no2xSaIdis cmp byte[En2xSaI],0 je .no2xsaien%ifdef __MSDOS__ mov byte[Triplebufen],0%endif mov byte[hqFilter],0 mov byte[scanlines],0 mov byte[antienab],0.no2xsaien cmp byte[hqFilter],0 je .nohqen mov byte[En2xSaI],0 mov byte[scanlines],0 mov byte[antienab],0.nohqen mov ecx,64 mov eax,SpecialLine.slloop mov dword[eax],0 add eax,4 dec ecx jnz .slloop.okayow mov byte[GUIOn],1 mov byte[GUIOn2],1 mov eax,[NumComboLocl] cmp byte[GUIComboGameSpec],0 jne .local mov eax,[NumComboGlob].local mov [NumCombo],eax call ResetTripleBuf cmp dword[GUIwinposx+16*4],0 jne .notzero mov dword[GUIwinposx+16*4],3 mov dword[GUIwinposy+16*4],22.notzero mov dword[GUICTimer],0 ; Initialize volume xor eax,eax xor edx,edx mov al,[MusicRelVol] shl eax,7 mov ebx,100 div ebx cmp al,127 jb .noofb mov al,127.noofb mov [MusicVol],al mov byte[CheatSearchStatus],0 cmp byte[newgfx16b],0 je .nong mov ecx,256*144 mov eax,[vidbufferofsb].loop mov dword[eax],0 add eax,4 dec ecx jnz .loop.nong mov byte[ShowTimer],1 call Get_Date cmp dh,12 jne .noxmas cmp dl,25 jne .noxmas mov byte[OkaySC],1.noxmas mov byte[lastmouseholded],1 cmp dword[GUIwinposx+15*4],0 jne .nomoviemenufix mov dword[GUIwinposx+15*4],50 mov dword[GUIwinposy+15*4],50.nomoviemenufix mov ax,[resolutn] mov [PrevResoln],ax mov word[resolutn],224 mov byte[GUIPalConv],0 mov byte[MousePRClick],1 pushad cmp byte[MouseInitOkay],1 je near .mousedone mov byte[MouseInitOkay],1 cmp byte[MouseDis],1 je .mousedone call Init_Mouse cmp ax,0 jne .mousedone mov byte[MouseDis],1.mousedone popad mov eax,[KeyQuickLoad] test byte[pressed+eax],1 jz near .noquickload mov byte[GUIcmenupos],0 loadmenuopen 1.noquickload mov esi,pressed mov ecx,64+32+8.pclear mov dword[esi],0 add esi,4 dec ecx jnz .pclear mov byte[pressed+1],2 mov byte[GUIescpress],1 ; set Video cursor location xor eax,eax mov al,[cvidmode] mov [GUIcurrentvideocursloc],eax mov ebx,[NumVideoModes] cmp ebx,20 ja .viewloc mov dword[GUIcurrentvideoviewloc],0 jmp .skip.viewloc sub ebx,20 cmp eax,ebx jbe .noof mov eax,ebx.noof mov [GUIcurrentvideoviewloc],eax.skip pushad call SaveSramData call GUIQuickLoadUpdate popad call LoadDetermine cmp byte[AutoState],0 je .noautostate cmp byte[romloadskip],0 jne .noautostate pushad call SaveSecondState popad.noautostate GUIInitIRQs cmp byte[GUIwinptr],0 jne .nomenuopen cmp byte[esctomenu],0 je .nomenuchange mov byte[GUIcmenupos],2 mov byte[GUIcrowpos],0 mov dword[GUICYLocPtr],MenuDat2 cmp byte[esctomenu],1 je .nomenuchange.nomenuopen mov byte[GUIcmenupos],0.nomenuchange cmp byte[GUIwinactiv+1],0 je .noloadrefresh mov dword[GUIcurrentfilewin],0 call GetLoadData.noloadrefresh mov byte[GUIHold],0 ; clear 256 bytes from hirestiledat mov esi,hirestiledat mov ecx,256.loophires mov byte[esi],0 inc esi dec ecx jnz .loophires mov byte[curblank],00h call InitGUI cmp byte[CheatWinMode],0 je near .csskip ; Load Cheat Search File pushad call LoadCheatSearchFile popad.csskip mov byte[GUIQuit],0.nokey cmp byte[GUIQuit],2 je near .exit cmp byte[GUIQuit],1 je near .exitgui mov byte[GUIQuit],0 cmp byte[MouseDis],1 je .mousedis2 call ProcessMouse cmp byte[videotroub],1 jne .notrouble ret.notrouble.mousedis2 call GUIUnBuffer cmp byte[GUIEffect],1 jne .nosnow call DrawSnow.nosnow cmp byte[GUIEffect],2 jne .nowater call DrawWater.nowater cmp byte[GUIEffect],3 jne .nowater2 call DrawWater.nowater2 cmp byte[GUIEffect],4 jne .noburn call DrawBurn.noburn cmp byte[GUIEffect],5 jne .nosmoke call DrawSmoke.nosmoke cmp dword[GUIEditStringcWin],0 je .noblink cmp dword[GUIEditStringcLen],0 je .noblink mov eax,[GUIEditStringcLen] cmp dword[GUIEditStringLTxt],8 jb .noblinka mov byte[eax],'_' mov byte[eax+1],0 mov dword[GUIEditStringLstb],1.noblinka cmp dword[GUIEditStringLTxt],0 jne .noblink mov dword[GUIEditStringLTxt],16.noblink call DisplayBoxes cmp dword[GUIEditStringLstb],1 jne .notblinked mov dword[GUIEditStringLstb],0 mov eax,[GUIEditStringcLen] mov byte[eax],0.notblinked call DisplayMenu cmp byte[MouseDis],1 je .mousedis3 call DrawMouse.mousedis3 cmp byte[FirstTimeData],0 jne .nofirsttime call guifirsttimemsg mov byte[FirstTimeData],1.nofirsttime cmp byte[guimsgptr],0 jne .nohorizon pushad call GetDate cmp ax,1025 popad jne .nohorizon pushad call GetTime push eax call horizon_get mov [guimsgptr],eax popad call horizonfixmsg.nohorizon cmp dword[GUICTimer],0 je .notimer GUIOuttext 21,211,[GUICMessage],50 GUIOuttext 20,210,[GUICMessage],63.notimer call vidpastecopyscr call GUIgetcurrentinput jmp .nokey.exitgui GUIDeInitIRQs mov ax,[PrevResoln] mov [resolutn],ax jmp endprog.exit mov edi,[spcBuffera] mov ecx,65536 xor eax,eax rep stosd GUIDeInitIRQs%ifdef __MSDOS__ call DOSClearScreen cmp byte[cbitmode],0 jne .nomakepal call dosmakepal.nomakepal%endif mov word[t1cc],1 pushad call GUISaveVars popad mov byte[MousePRClick],1 mov byte[prevbright],0 mov ax,[PrevResoln] mov [resolutn],ax mov byte[CheatOn],0 cmp dword[NumCheats],0 je .nocheats mov byte[CheatOn],1.nocheats cmp byte[CopyRamToggle],1 jne .nocopyram mov byte[CopyRamToggle],0 mov eax,[vidbuffer] add eax,129600 ; copy 128k ram mov ebx,[wramdata] mov ecx,32768.loopcr mov edx,[ebx] mov [eax],edx add ebx,4 add eax,4 dec ecx jnz .loopcr.nocopyram cmp byte[CheatWinMode],2 jne .notview mov byte[CheatWinMode],1.notview cmp byte[CheatWinMode],0 je .csskip2 ;Save Cheat Search File pushad call SaveCheatSearchFile popad .csskip2 mov edi,[vidbuffer] mov ecx,288*120 xor eax,eax rep stosd mov ecx,256*144 mov eax,[vidbufferofsb].loopcl mov dword[eax],0 add eax,4 dec ecx jnz .loopcl call AdjustFrequency mov byte[GUIOn],0 mov byte[GUIOn2],0 mov byte[GUIReset],0 mov dword[StartLL],0 mov dword[StartLR],0 jmp continueprogguimencodermsg: xor ebx,ebx mov ecx,256.a mov byte[pressed+ebx],0 inc ebx dec ecx jnz .a mov byte[pressed+2Ch],0.again GUIBox 43,75,213,163,160 GUIBox 43,75,213,75,162 GUIBox 43,75,43,163,161 GUIBox 213,75,213,163,159 GUIBox 43,163,213,163,158 GUIOuttext 52,96,guimencodert1,220-15 GUIOuttext 51,95,guimencodert1,220 GUIOuttext 52,134,guimencodert2,220-15 GUIOuttext 51,133,guimencodert2,220 call vidpastecopyscr call GUIUnBuffer call DisplayBoxes call DisplayMenu call JoyRead cmp byte[pressed+39h],0 jne .pressedokay jmp .again.pressedokay retguilamemsg: xor ebx,ebx mov ecx,256.a mov byte[pressed+ebx],0 inc ebx dec ecx jnz .a mov byte[pressed+2Ch],0.again GUIBox 43,75,213,163,160 GUIBox 43,75,213,75,162 GUIBox 43,75,43,163,161 GUIBox 213,75,213,163,159
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -