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

📄 menu.asm

📁 linux下的任天堂模拟器代码。供大家参考。
💻 ASM
📖 第 1 页 / 共 2 页
字号:
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach );;http://www.zsnes.com;http://sourceforge.net/projects/zsnes;https://zsnes.bountysource.com;;This program is free software; you can redistribute it and/or;modify it under the terms of the GNU General Public License;version 2 as published by the Free Software Foundation.;;This program is distributed in the hope that it will be useful,;but WITHOUT ANY WARRANTY; without even the implied warranty of;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the;GNU General Public License for more details.;;You should have received a copy of the GNU General Public License;along with this program; if not, write to the Free Software;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.%include "macros.mac"EXTSYM FPSOn,MessageOn,cbitmode,copyvidEXTSYM MsgCount,Msgptr,OutputGraphicString,OutputGraphicString16b,vidbufferEXTSYM curblank,drawhline,drawhline16b,drawvline,drawvline16b,frameskipEXTSYM pressed,dumpsound,Grab_BMP_Data,Grab_BMP_Data_8EXTSYM spcon,vesa2_bpos,vesa2_clbit,vesa2_gpos,vesa2_rpos,EXTSYM spritetablea,sprlefttot,newengen,Get_Key,continueprognokeysEXTSYM ForceNonTransp,GUIOn,Check_Key,JoyRead,GetScreen,SSKeyPressedEXTSYM SPCKeyPressed,StopSound,StartSound,ExecExitOkay,t1cc,Clear2xSaIBufferEXTSYM ScreenShotFormat,spcsaved,savespcdataEXTSYM exiter,xpb,xpc,snesmmap,memtabler8,snesmap2,regaccessbankr8,dmadata,initaddrlEXTSYM spcPCRam,xp,curcyc,Curtableaddr,UpdateDPage,splitflags,execsingle,joinflagsEXTSYM pdh,SPCRAM,cvidmode%ifdef __MSDOS__EXTSYM GUI16VID%endif%ifndef NO_DEBUGGEREXTSYM numinst,debuggeron%endif%ifndef NO_PNGEXTSYM Grab_PNG_Data%endifSECTION .textGUIBufferData:    mov ecx,16000    cmp byte[cbitmode],1    jne near .16b    add ecx,16384.16b    ; copy to spritetable    mov esi,[vidbuffer]    mov edi,[spritetablea]    add esi,4*384    add edi,4*384.loop    mov eax,[esi]    mov [edi],eax    add esi,4    add edi,4    dec ecx    jnz .loop    mov edi,sprlefttot    mov ecx,64*5.a    mov dword[edi],0    add edi,4    dec ecx    jnz .a    retGUIUnBuffer:    mov ecx,16000    cmp byte[cbitmode],1    jne near .16b    add ecx,16384.16b    ; copy from spritetable    mov esi,[vidbuffer]    mov edi,[spritetablea]    add esi,4*384    add edi,4*384.loop    mov eax,[edi]    mov [esi],eax    add esi,4    add edi,4    dec ecx    jnz .loop    retSECTION .bssNEWSYM nextmenupopup, resb 1NEWSYM NoInputRead, resb 1NEWSYM PrevMenuPos, resb 1NEWSYM MenuDisplace, resd 1NEWSYM MenuDisplace16, resd 1NEWSYM MenuNoExit, resb 1NEWSYM SPCSave, resb 1SECTION .textNEWSYM showmenu    mov byte[ForceNonTransp],1    cmp byte[cbitmode],1    je near .nopalread    mov edi,[vidbuffer]    add edi,100000    mov dx,03C7h    mov al,0    out dx,al    mov dx,03C9h    mov ecx,768    mov byte[edi],12    inc edi.b    in al,dx    shl al,2    mov [edi],al    inc edi    dec ecx    jnz .b.nopalread    cmp byte[cbitmode],1    je near .nopal16b    ; set palette of colors 128,144, and 160 to white, blue, and red    mov al,128    mov dx,03C8h    out dx,al    inc dx    mov al,63    out dx,al    out dx,al    out dx,al    mov al,144    mov dx,03C8h    out dx,al    inc dx    xor al,al    out dx,al    out dx,al    mov al,50    out dx,al    mov al,160    mov dx,03C8h    out dx,al    inc dx    mov al,45    out dx,al    xor al,al    out dx,al    out dx,al.nopal16b    mov byte[NoInputRead],0    cmp byte[newengen],0    je .nong16b    cmp byte[cbitmode],0    je .nong16b    call GetScreen.nong16b    cmp byte[SSKeyPressed],1    jne .nosskey    mov byte[SSKeyPressed],0    call saveimage    jmp .nopalwrite.nosskey    cmp byte[SPCKeyPressed],1    je near .savespckey    test byte[pressed+14],1    jz .nof12    call saveimage    jmp .nopalwrite.nof12    mov dword[menucloc],0    cmp byte[nextmenupopup],0    je .nomenuinc2    mov byte[pressed+1Ch],0    mov dword[menucloc],40*288    cmp byte[PrevMenuPos],1    jne .nomenuinc    mov dword[menucloc],50*288.nomenuinc    cmp byte[PrevMenuPos],2    jne .nomenuinc2    mov dword[menucloc],60*288.nomenuinc2    cmp byte[PrevMenuPos],3    jne .nomenuinc3    mov dword[menucloc],70*288.nomenuinc3    mov dword[menudrawbox8b.stringi+13],' BMP'%ifndef NO_PNG    cmp byte[ScreenShotFormat],0    je .normalscrn%ifdef __MSDOS__    movzx eax,byte[cvidmode]    cmp byte[GUI16VID+eax],1    je .pngok    mov byte[ScreenShotFormat],0    jmp .normalscrn%endif.pngok    mov dword[menudrawbox8b.stringi+13],' PNG'%endif.normalscrn    mov byte[nextmenupopup],0    mov byte[menu16btrans],0    mov byte[pressed+1],0    mov byte[pressed+59],0    mov byte[curblank],00h    call GUIBufferData    ; Draw box    call menudrawbox8b    call menudrawbox8b    cmp byte[newengen],0    je .notng    mov byte[GUIOn],1.notng    pushad    call copyvid    popad    call StopSound.nextkey    ;call GUIUnBuffer    call menudrawbox8b    push eax    call copyvid    pop eax    call JoyRead    call Check_Key    or al,al    jz .nextkey    call Get_Key    cmp al,0    jne near .processextend    call Get_Key    cmp al,72    jne .noup    cmp dword[menucloc],0    jne .nogoup    add dword[menucloc],80*288.nogoup    sub dword[menucloc],10*288    call menudrawbox8b;    mov al,[newengen]                  ; WTF?;    mov byte[newengen],0;    mov [newengen],al    jmp .nextkey.noup    cmp al,80    jne .nodown    cmp dword[menucloc],70*288    jne .nogodown    sub dword[menucloc],80*288.nogodown    add dword[menucloc],10*288    call menudrawbox8b;    mov al,[newengen];    mov byte[newengen],0;    push eax    call copyvid;    pop eax;    mov [newengen],al    jmp .nextkey.nodown    jmp .nextkey.processextend    cmp al,27    je near .exitloop    cmp al,13    je .done    jmp .nextkey.done    call GUIUnBuffer;    mov al,[newengen];    mov byte[newengen],0;    push eax    call copyvid;    pop eax;    mov [newengen],al    cmp dword[menucloc],0    jne .nosaveimg    call saveimage.nosaveimg    cmp dword[menucloc],40*288    jne .nosaveimg2    call saveimage    mov byte[ExecExitOkay],0    mov byte[nextmenupopup],3    mov byte[NoInputRead],1    mov byte[t1cc],0    mov byte[PrevMenuPos],0.nosaveimg2    cmp dword[menucloc],50*288    jne .noskipframe    mov byte[ExecExitOkay],0    mov byte[nextmenupopup],3    mov byte[NoInputRead],1    mov byte[t1cc],0    mov byte[PrevMenuPos],1.noskipframe    cmp dword[menucloc],70*288    jne .noimagechange    cmp byte[cbitmode],0    je .noimagechange    xor byte[ScreenShotFormat],1    mov byte[MenuNoExit],1    mov byte[ExecExitOkay],0    mov byte[nextmenupopup],1    mov byte[NoInputRead],1    mov byte[t1cc],0    mov byte[PrevMenuPos],3.noimagechange    cmp dword[menucloc],60*288    jne .nomovewin    mov byte[MenuNoExit],1    mov byte[ExecExitOkay],0    mov byte[nextmenupopup],1    mov byte[NoInputRead],1    mov byte[t1cc],0    mov byte[PrevMenuPos],2    cmp dword[MenuDisplace],0    je .movewin    mov dword[MenuDisplace],0    mov dword[MenuDisplace16],0    jmp .nomovewin.movewin    mov dword[MenuDisplace],90*288    mov dword[MenuDisplace16],90*288*2.nomovewin    cmp dword[menucloc],10*288    jne .nofps    cmp byte[frameskip],0    je .yesfs    mov dword[Msgptr],.unablefps    mov eax,[MsgCount]    mov [MessageOn],eax    jmp .nofps.yesfs    xor byte[FPSOn],1.nofps    cmp dword[menucloc],20*288    jne near .nospcsave.savespckey    cmp byte[spcon],0    je .nospc    mov dword[Msgptr],.search    mov eax,[MsgCount]    mov [MessageOn],eax    call copyvid    mov byte[SPCSave],1    call breakatsignb    mov byte[SPCSave],0    pushad    call savespcdata    popad    mov byte[curblank],40h    mov dword[Msgptr],spcsaved    mov eax,[MsgCount]    mov [MessageOn],eax    jmp .nospcsave.nospc    mov dword[Msgptr],.nosound    mov eax,[MsgCount]    mov [MessageOn],eax    jmp .nospcsave.unablespc    mov dword[Msgptr],.unable    mov eax,[MsgCount]    mov [MessageOn],eax    jmp .nospcsave.yesesc    mov dword[Msgptr],.escpress    mov eax,[MsgCount]    mov [MessageOn],eax.nospcsave    cmp dword[menucloc],30*288    jne .nosnddmp    pushad    call dumpsound    popad    mov dword[Msgptr],.sndbufsav    mov eax,[MsgCount]    mov [MessageOn],eax.nosnddmp    cmp byte[SPCKeyPressed],1    jne .exitloop    mov byte[SPCKeyPressed],0    jmp .nopalwrite.exitloop    call GUIUnBuffer;    mov al,[newengen];    mov byte[newengen],0;    push eax    call copyvid;    pop eax;    mov [newengen],al    cmp byte[cbitmode],1    je near .nopalwrite    mov edi,[vidbuffer]    add edi,100000    mov dx,03C8h    mov al,0    out dx,al    mov dx,03C9h    mov ecx,768    inc edi.c    mov al,[edi]    shr al,2    out dx,al    inc edi    dec ecx    jnz .c.nopalwrite    mov eax,pressed    mov ecx,256.looppr    cmp byte[eax],1    jne .notpr    mov byte[eax],2.notpr    inc eax    dec ecx    jnz .looppr;    mov byte[pressed+1],2;    cmp byte[pressed+59],1;    jne .not59;    mov byte[pressed+59],2;.not59;    cmp byte[pressed+28],1;    jne .not28;    mov byte[pressed+28],2;.not28    call StartSound    mov byte[ForceNonTransp],0    mov byte[GUIOn],0    pushad    call Clear2xSaIBuffer    popad    cmp byte[MenuNoExit],1

⌨️ 快捷键说明

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