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

📄 gui.asm

📁 linux下的任天堂模拟器代码。供大家参考。
💻 ASM
📖 第 1 页 / 共 5 页
字号:
  GUIBox 43,163,213,163,158  GUIOuttext 52,96,guilamet1,220-15  GUIOuttext 51,95,guilamet1,220  GUIOuttext 52,134,guilamet2,220-15  GUIOuttext 51,133,guilamet2,220  call vidpastecopyscr  call GUIUnBuffer  call DisplayBoxes  call DisplayMenu  call JoyRead  cmp byte[pressed+39h],0  jne .pressedokay  jmp .again.pressedokay  retSECTION .dataguimencodert1 db ' MENCODER IS MISSING: ',0guimencodert2 db 'PRESS SPACE TO PROCEED',0guilamet1 db ' LAME IS MISSING: ',0guilamet2 db 'PRESS SPACE TO PROCEED',0SECTION .textguifirsttimemsg:  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,81,guiftimemsg1,220-15  GUIOuttext 51,80,guiftimemsg1,220  GUIOuttext 52,96,guiftimemsg2,220-15  GUIOuttext 51,95,guiftimemsg2,220  GUIOuttext 52,104,guiftimemsg3,220-15  GUIOuttext 51,103,guiftimemsg3,220  GUIOuttext 52,112,guiftimemsg4,220-15  GUIOuttext 51,111,guiftimemsg4,220  GUIOuttext 52,120,guiftimemsg5,220-15  GUIOuttext 51,119,guiftimemsg5,220  GUIOuttext 52,128,guiftimemsg6,220-15  GUIOuttext 51,127,guiftimemsg6,220  GUIOuttext 52,136,guiftimemsg7,220-15  GUIOuttext 51,135,guiftimemsg7,220  GUIOuttext 52,151,guiftimemsg8,220-15  GUIOuttext 51,150,guiftimemsg8,220  call vidpastecopyscr  call GUIUnBuffer  call DisplayBoxes  call DisplayMenu  call JoyRead  cmp byte[pressed+39h],0  jne .pressedokay  jmp .again.pressedokay  retSECTION .dataguiftimemsg1 db ' ONE-TIME USER REMINDER : ',0guiftimemsg2 db '  PLEASE BE SURE TO READ  ',0guiftimemsg3 db 'THE DOCUMENTATION INCLUDED',0guiftimemsg4 db ' WITH ZSNES FOR IMPORTANT',0guiftimemsg5 db ' INFORMATION AND ANSWERS',0guiftimemsg6 db '    TO COMMON PROBLEMS',0guiftimemsg7 db '      AND QUESTIONS.',0guiftimemsg8 db 'PRESS SPACEBAR TO PROCEED.',0SECTION .texthorizonfixmsg:  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,81,guimsgmsg,220-15  GUIOuttext 51,80,guimsgmsg,220  GUIOuttext 52,96,[guimsgptr],220-15  GUIOuttext 51,95,[guimsgptr],220  add dword[guimsgptr],32  GUIOuttext 52,104,[guimsgptr],220-15  GUIOuttext 51,103,[guimsgptr],220  add dword[guimsgptr],32  GUIOuttext 52,112,[guimsgptr],220-15  GUIOuttext 51,111,[guimsgptr],220  add dword[guimsgptr],32  GUIOuttext 52,120,[guimsgptr],220-15  GUIOuttext 51,119,[guimsgptr],220  sub dword[guimsgptr],96  GUIOuttext 52,151,guiftimemsg8,220-15  GUIOuttext 51,150,guiftimemsg8,220  call vidpastecopyscr  call GUIUnBuffer  call DisplayBoxes  call DisplayMenu  call JoyRead  cmp byte[pressed+39h],0  jne .pressedokay  jmp .again.pressedokay  retSECTION .dataguimsgptr dd 0guimsgmsg db '     WELCOME TO ZSNES',0SECTION .textguiprevideo:  xor ebx,ebx  mov ecx,256.a  mov byte[pressed+ebx],0  inc ebx  dec ecx  jnz .a  call GUIUnBuffer  call DisplayBoxes  call DisplayMenu  GUIBox 43,90,213,163,160  GUIBox 43,90,213,90,162  GUIBox 43,90,43,163,161  GUIBox 213,90,213,163,159  GUIBox 43,163,213,163,158  GUIOuttext 56,96,guiprevidmsg1,220-15  GUIOuttext 55,95,guiprevidmsg1,220  GUIOuttext 56,104,guiprevidmsg2,220-15  GUIOuttext 55,103,guiprevidmsg2,220  GUIOuttext 56,112,guiprevidmsg3,220-15  GUIOuttext 55,111,guiprevidmsg3,220  GUIOuttext 56,120,guiprevidmsg4,220-15  GUIOuttext 55,119,guiprevidmsg4,220  GUIOuttext 56,128,guiprevidmsg5,220-15  GUIOuttext 55,127,guiprevidmsg5,220  GUIOuttext 56,136,guiprevidmsg6,220-15  GUIOuttext 55,135,guiprevidmsg6,220  GUIOuttext 56,151,guiprevidmsg7,220-15  GUIOuttext 55,150,guiprevidmsg7,220  call vidpastecopyscr  mov byte[pressed+2Ch],0.again  call JoyRead  xor ebx,ebx  mov ecx,256+128+64.b  cmp byte[pressed+ebx],0  jne .pressedkey  inc ebx  dec ecx  jnz .b  cmp byte[MouseDis],1  je .again  call Get_MouseData  cmp byte[lhguimouse],1  jne .notlefthanded  call SwapMouseButtons.notlefthanded  test bx,01h  jnz .pressedokay  jmp .again.pressedkey  mov byte[pressed+ebx],0.pressedokay  retSECTION .dataguiprevidmsg1 db 'ZSNES WILL NOW ATTEMPT',0guiprevidmsg2 db ' TO CHANGE YOUR VIDEO',0guiprevidmsg3 db ' MODE.  IF THE CHANGE',0guiprevidmsg4 db 'IS UNSUCCESSFUL,  WAIT',0guiprevidmsg5 db ' 10 SECONDS AND VIDEO',0guiprevidmsg6 db 'MODE WILL BE RESTORED.',0guiprevidmsg7 db '    PRESS ANY KEY.',0SECTION .textguipostvideo:  mov ecx,256*144  mov eax,[vidbufferofsb].loop  mov dword[eax],0FFFFFFFFh  add eax,4  dec ecx  jnz .loop  mov dword[GUIkeydelay],36*10.pressedfail  call GUIUnBuffer  call DisplayBoxes  call DisplayMenu  GUIBox 43,90,213,163,160  GUIBox 43,90,213,90,162  GUIBox 43,90,43,163,161  GUIBox 213,90,213,163,159  GUIBox 43,163,213,163,158  GUIOuttext 56,96,guipostvidmsg1,220-15  GUIOuttext 55,95,guipostvidmsg1,220  GUIOuttext 56,151,guipostvidmsg2,220-15  GUIOuttext 55,150,guipostvidmsg2,220  call vidpastecopyscr  ; Wait for all mouse and input data to be 0  cmp dword[GUIkeydelay],0  je .pressedokay  ;This is to make all ports not register space bar from being pressed earlier  mov byte[pressed+2Ch],0  call JoyRead  cmp byte[pressed+39h],0  jne .pressedokay  jmp .pressedfail.pressedokay  mov byte[GUIpclicked],1  retSECTION .dataguipostvidmsg1 db 'VIDEO MODE CHANGED.',0guipostvidmsg2 db '  PRESS SPACEBAR.',0SECTION .textguipostvideofail:  mov dword[guipostvidptr],guipostvidmsg3b  mov byte[guipostvidmsg3b],0  mov byte[guipostvidmsg4b],0  mov byte[guipostvidmsg5b],0  mov eax,[ErrorPointer]  mov ebx,eax.loop  cmp byte[ebx],0  je .found  cmp byte[ebx],'$'  je .found  inc ebx  jmp .loop.found  mov edx,ebx  sub edx,eax.detnext  or edx,edx  jz .notext  cmp edx,25  jbe .copytext.nospace  dec edx  cmp byte[eax+edx],32  jne .nospace  jmp .detnext.copytext  push ebx  mov ecx,[guipostvidptr].copytextloop  mov bl,[eax]  cmp bl,'$'  jne .notdol  mov bl,0.notdol  mov [ecx],bl  inc eax  inc ecx  dec edx  jnz .copytextloop  mov byte[ecx],0  pop ebx  add dword[guipostvidptr],26  cmp byte[eax],0  je .notext  cmp byte[eax],'$'  je .notext  inc eax  jmp .found.notext  xor ebx,ebx  mov ecx,256.a  mov byte[pressed+ebx],0  inc ebx  dec ecx  jnz .a  call GUIUnBuffer  call DisplayBoxes  call DisplayMenu  GUIBox 43,90,213,163,160  GUIBox 43,90,213,90,162  GUIBox 43,90,43,163,161  GUIBox 213,90,213,163,159  GUIBox 43,163,213,163,158  GUIOuttext 56,96,guipostvidmsg1b,220-15  GUIOuttext 55,95,guipostvidmsg1b,220  GUIOuttext 56,108,guipostvidmsg2b,220-15  GUIOuttext 55,107,guipostvidmsg2b,220  GUIOuttext 56,119,guipostvidmsg3b,220-15  GUIOuttext 55,118,guipostvidmsg3b,220  GUIOuttext 56,129,guipostvidmsg4b,220-15  GUIOuttext 55,128,guipostvidmsg4b,220  GUIOuttext 56,139,guipostvidmsg5b,220-15  GUIOuttext 55,138,guipostvidmsg5b,220  GUIOuttext 56,152,guipostvidmsg8b,220-15  GUIOuttext 55,151,guipostvidmsg8b,220  call vidpastecopyscr  call GUIUnBuffer  call DisplayBoxes  call DisplayMenu%ifndef __UNIXSDL__  mov dword[GUIkeydelay],0FFFFFFFFh%else  mov dword[GUIkeydelay],0x0%endif  jmp guipostvideo.pressedfailSECTION .dataguipostvidmsg1b db 'VIDEO MODE CHANGE FAILED.',0guipostvidmsg2b db 'UNABLE TO INIT VESA2:',0guipostvidmsg3b db 'AAAAAAAAAAAAAAAAAAAAAAAAA',0guipostvidmsg4b db 'AAAAAAAAAAAAAAAAAAAAAAAAA',0guipostvidmsg5b db 'AAAAAAAAAAAAAAAAAAAAAAAAA',0guipostvidmsg8b db 'PRESS ANY KEY',0SECTION .bssguipostvidptr resd 1SECTION .textNEWSYM guicheaterror    xor ebx,ebx    mov ecx,256+128+64.a    mov byte[pressed+ebx],0    inc ebx    dec ecx    jnz .a.again    call GUIUnBuffer    call DisplayBoxes    call DisplayMenu    GUIBox 75,95,192,143,160    GUIBox 75,95,192,95,162    GUIBox 75,95,75,143,161    GUIBox 192,95,192,143,159    GUIBox 75,143,192,143,158    GUIOuttext 81,101,guicheaterror1,220-15    GUIOuttext 80,100,guicheaterror1,220    GUIOuttext 81,109,guicheaterror2,220-15    GUIOuttext 80,108,guicheaterror2,220    GUIOuttext 81,117,guicheaterror3,220-15    GUIOuttext 80,116,guicheaterror3,220    GUIOuttext 81,125,guicheaterror4,220-15    GUIOuttext 80,124,guicheaterror4,220    GUIOuttext 81,135,guicheaterror5,220-15    GUIOuttext 80,134,guicheaterror5,220    call vidpastecopyscr    call JoyRead    xor ebx,ebx    mov ecx,256+128+64.b    cmp byte[pressed+ebx],0    jne .pressedokay    inc ebx    dec ecx    jnz .b    cmp byte[MouseDis],1    je .mousedis    call Get_MouseData    cmp byte[lhguimouse],1    jne .notlefthanded    call SwapMouseButtons.notlefthanded    test bx,01h    jnz .pressedokay.mousedis    jmp .again.pressedokay.again2    call Check_Key    or al,al    jz .nokey    call Get_Key    jmp .again2.nokey    cmp byte[MouseDis],1    je .mousedis2    push ebx;    mov eax,0Bh;    int 33h    pop ebx.mousedis2    mov dword[GUIcurrentcheatwin],1    mov byte[GUIpclicked],1    retSECTION .dataguicheaterror1 db 'INVALID CODE!  YOU',0guicheaterror2 db 'MUST ENTER A VALID',0guicheaterror3 db 'GAME GENIE,PAR, OR',0guicheaterror4 db 'GOLD FINGER CODE.',0guicheaterror5 db 'PRESS ANY KEY.',0SECTION .textSECTION .bssManualCPtr resd 1ManualStatus resb 1NEWSYM Totalbyteloaded, resd 1NEWSYM sramsavedis, resb 1SECTION .dataSECTION .textCheckMenuItemHelp:  mov al,[GUIcmenupos]  mov [GUIpmenupos],al  mov byte[GUIcmenupos],0  cmp byte[GUIwinactiv+edx],1  je .menuontop  xor eax,eax  mov al,[GUIwinptr]  inc byte[GUIwinptr]  mov [GUIwinorder+eax],dl  mov byte[GUIwinactiv+edx],1  cmp byte[savewinpos],0  jne .nomenuitem  mov eax,[GUIwinposxo+edx*4]  mov [GUIwinposx+edx*4],eax  mov eax,[GUIwinposyo+edx*4]  mov [GUIwinposy+edx*4],eax  jmp .nomenuitem.menuontop  xor eax,eax  ; look for match.notfoundyet  mov bl,[GUIwinorder+eax]  cmp bl,dl  je .nextfind  inc eax  jmp .notfoundyet.nextfind  inc eax  cmp al,[GUIwinptr]  je .foundend  mov cl,[GUIwinorder+eax]  mov [GUIwinorder+eax-1],cl  jmp .nextfind.foundend  mov byte[GUIpclicked],0  mov [GUIwinorder+eax-1],bl.nomenuitem  ret%macro GUICheckMenuItem 2  mov edx,%1  cmp byte[GUIcrowpos],%2  jne near %%nomenuitem  call CheckMenuItemHelp%%nomenuitem%endmacro%macro checkqloadvalue 1  cmp byte[GUIcrowpos],%1  jne %%skip  pushad  push %1  call loadquickfname  pop eax  popad  ret%%skip%endmacroGUITryMenuItem:                     ; Defines which menu item calls what window number  cmp byte[GUIcmenupos],1  jne near .noquickload  checkqloadvalue 0  checkqloadvalue 1  checkqloadvalue 2  checkqloadvalue 3  checkqloadvalue 4  checkqloadvalue 5  checkqloadvalue 6  checkqloadvalue 7  checkqloadvalue 8  checkqloadvalue 9  cmp byte[GUIcrowpos],11  jne .skipswitch  xor byte[prevlfreeze],1  cmp byte[prevlfreeze],0  je .off  mov dword[GUIPrevMenuData+347],' ON '  jmp .on.off  mov dword[GUIPrevMenuData+347],' OFF'.on.skipswitch  cmp byte[GUIcrowpos],12  jne .skipclear  cmp byte[prevlfreeze],0  jne .skipclear  mov edi,prevloadiname  mov eax,20202020h  mov ecx,70  rep stosd  mov edi,prevloaddnamel  xor eax,eax  mov ecx,1280  rep stosd  mov edi,prevloadfnamel  mov ecx,1280  rep stosd  pushad  call GUIQuickLoadUpdate  popad  ret.skipclear.noquickload  cmp byte[GUIcmenupos],2  jne near .nomain  GUICheckMenuItem 1, 0               ; Load  cmp byte[GUIcrowpos],0  jne .noloadrefresh  mov dword[GUIcurrentfilewin],0  jmp GetLoadData.noloadrefresh  cmp byte[romloadskip],0  jne near .noromloaded  cmp byte[GUIcrowpos],1              ; Run  jne .norun  cmp byte[romloadskip],0  jne .dontquit  mov byte[GUIQuit],2.dontquit  ret.norun  GUICheckMenuItem 12, 2              ; Reset  cmp byte[GUIcrowpos],2  jne .noreset  mov byte[GUICResetPos],1.noreset  cmp byte[GUIcrowpos],4  jne .nosavestate  mov byte[GUIStatesText5],0  mov byte[GUICStatePos],1.nosavestate  cmp byte[GUIcrowpos],5  jne .noloadstate  mov byte[GUIStatesText5],1  mov byte[GUICStatePos],1.noloadstate  GUICheckMenuItem 14, 4              ; Save State  GUICheckMenuItem 14, 5              ; Load State  GUICheckMenuItem 2, 6               ; Select State.noromloaded  cmp byte[GUIcrowpos],8  jne .noquit  mov byte[GUIQuit],1.noquit.nomain  cmp byte[GUIcmenupos],3  jne near .noconfig  ;The number on the left is the window to open  ;the number on the right is where in the drop down box we are  GUICheckMenuItem 3,0               ; Input #1-5  GUICheckMenuItem 17,2              ; Devices  GUICheckMenuItem 18,3              ; Chip Config  GUICheckMenuItem 4,5               ; Options  cmp byte[GUIcrowpos],6             ; Video  jne near .novideo  ; set Video cursor location  xor eax,eax  mov al,[cvidmode]  mov [GUIcurrentvideocursloc],eax  mov edx,[NumVideoModes]  cmp edx,20  ja .viewloc  mov dword[GUIcurrentvideoviewloc],0  jmp .skip.viewloc  sub edx,20  cmp eax,edx  jbe .noof  mov eax,edx.noof  mov [GUIcurrentvideoviewloc],eax.skip  mov edx,5  call CheckMenuItemHelp.novideo  GUICheckMenuItem 6,7             ; Sound  GUICheckMenuItem 19,8            ; Paths  GUICheckMenuItem 20,9            ; Saves  GUICheckMenuItem 21,10           ; Speed.noconfig  cmp byte[romloadskip],0  jne near .nocheat  cmp byte[GUIcmenupos],4  jne near .nocheat  GUICheckMenuItem 7, 0  GUICheckMenuItem 7, 1  GUICheckMenuItem 13, 2

⌨️ 快捷键说明

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