menu.asm

来自「linux下的任天堂模拟器代码。供大家参考。」· 汇编 代码 · 共 910 行 · 第 1/2 页

ASM
910
字号
    je .noexitmenu    jmp continueprognokeys.noexitmenu    mov byte[MenuNoExit],0    jmp showmenuSECTION .data.unablefps db 'NEED AUTO FRAMERATE ON',0.sndbufsav db 'BUFFER SAVED AS SOUNDDMP.RAW',0.search    db 'SEARCHING FOR SONG START.',0.nosound   db 'SOUND MUST BE ENABLED.',0.unable    db 'CANNOT USE IN NEW GFX ENGINE.',0.escpress  db 'ESC TERMINATED SEARCH.',0SECTION .textNEWSYM menudrawbox8b    cmp byte[cbitmode],1    je near menudrawbox16b    ; draw a small blue box with a white border    mov esi,40+20*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov ecx,150    mov al,95.loop    mov byte[esi],144    inc esi    dec ecx    jnz .loop    add esi,288-150    dec al    mov ecx,150    jnz .loop    mov al,128    ; Draw lines    mov esi,40+20*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov ecx,150    call drawhline    mov esi,40+20*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov ecx,95    call drawvline    mov esi,40+114*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov ecx,150    call drawhline    mov esi,40+32*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov ecx,150    call drawhline    mov esi,189+20*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov ecx,95    call drawvline    call menudrawcursor8b    mov esi,45+23*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov edi,.string    call OutputGraphicString    mov esi,45+35*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov edi,.stringa    call OutputGraphicString    mov esi,45+45*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov edi,.stringb    test byte[FPSOn],1    jz .nofps    mov edi,.stringc.nofps    call OutputGraphicString    mov esi,45+55*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov edi,.stringd    call OutputGraphicString    mov esi,45+65*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov edi,.stringe    call OutputGraphicString    mov esi,45+75*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov edi,.stringf    call OutputGraphicString    mov esi,45+85*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov edi,.stringg    call OutputGraphicString    mov esi,45+95*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov edi,.stringh    call OutputGraphicString    mov esi,45+105*288    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov edi,.stringi    call OutputGraphicString;    mov al,[newengen];    mov byte[newengen],0;    push eax    call copyvid;    pop eax;    mov [newengen],al    retSECTION .data.string db 'MISC OPTIONS',0.stringa db 'SAVE SNAPSHOT',0.stringb db 'SHOW FPS',0.stringc db 'HIDE FPS',0.stringd db 'SAVE SPC DATA',0.stringe db 'SOUND BUFFER DUMP',0.stringf db 'SNAPSHOT/INCR FRM',0.stringg db 'INCR FRAME ONLY',0.stringh db 'MOVE THIS WINDOW',0.stringi db 'IMAGE FORMAT: ---',0SECTION .textNEWSYM menudrawcursor8b    cmp byte[cbitmode],1    je near menudrawcursor16b    ; draw a small red box    mov esi,41+34*288    add esi,[menucloc]    add esi,[vidbuffer]    add esi,[MenuDisplace]    mov ecx,148    mov al,9.loop    mov byte[esi],160    inc esi    dec ecx    jnz .loop    add esi,288-148    dec al    mov ecx,148    jnz .loop    mov al,128    retSECTION .bssNEWSYM menucloc, resd 1SECTION .textNEWSYM menudrawbox16b    ; draw shadow behind box    cmp byte[menu16btrans],0    jne .noshadow    mov byte[menu16btrans],1    mov esi,50*2+30*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov ecx,150    mov al,95    mov ah,5.loop16b2    mov dx,[esi]    and dx,[vesa2_clbit]    shr dx,1    mov [esi],dx    add esi,2    dec ecx    jnz .loop16b2    add esi,288*2-150*2    dec al    mov ecx,150    jnz .loop16b2.noshadow    mov ax,01Fh    mov cl,[vesa2_rpos]    shl ax,cl    mov [.allred],ax    mov ax,012h    mov cl,[vesa2_bpos]    shl ax,cl    mov dx,ax    mov ax,01h    mov cl,[vesa2_gpos]    shl ax,cl    mov bx,ax    mov ax,01h    mov cl,[vesa2_rpos]    shl ax,cl    or bx,ax    ; draw a small blue box with a white border    mov esi,40*2+20*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov ecx,150    mov al,95    mov ah,5.loop16b    mov [esi],dx    add esi,2    dec ecx    jnz .loop16b    add esi,288*2-150*2    dec ah    jnz .nocolinc16b    add dx,bx    mov ah,5.nocolinc16b    dec al    mov ecx,150    jnz .loop16b    ; Draw lines    mov ax,0FFFFh    mov esi,40*2+20*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov ecx,150    call drawhline16b    mov esi,40*2+20*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov ecx,95    call drawvline16b    mov esi,40*2+114*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov ecx,150    call drawhline16b    mov esi,40*2+32*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov ecx,150    call drawhline16b    mov esi,189*2+20*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov ecx,95    call drawvline16b    call menudrawcursor16b    mov esi,45*2+23*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov edi,menudrawbox8b.string    call OutputGraphicString16b    mov esi,45*2+35*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov edi,menudrawbox8b.stringa    call OutputGraphicString16b    mov esi,45*2+45*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov edi,menudrawbox8b.stringb    test byte[FPSOn],1    jz .nofps    mov edi,menudrawbox8b.stringc.nofps    call OutputGraphicString16b    mov esi,45*2+55*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov edi,menudrawbox8b.stringd    call OutputGraphicString16b    mov esi,45*2+65*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov edi,menudrawbox8b.stringe    call OutputGraphicString16b    mov esi,45*2+75*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov edi,menudrawbox8b.stringf    call OutputGraphicString16b    mov esi,45*2+85*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov edi,menudrawbox8b.stringg    call OutputGraphicString16b    mov esi,45*2+95*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov edi,menudrawbox8b.stringh    call OutputGraphicString16b    mov esi,45*2+105*288*2    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov edi,menudrawbox8b.stringi    call OutputGraphicString16b;    mov al,[newengen];    mov byte[newengen],0;    push eax    call copyvid;    pop eax;    mov [newengen],al    retSECTION .bss.allred resw 1.blue   resw 1.stepb  resw 1NEWSYM menu16btrans, resb 1SECTION .textNEWSYM menudrawcursor16b    ; draw a small red box    mov esi,41*2+34*288*2    add esi,[menucloc]    add esi,[menucloc]    add esi,[vidbuffer]    add esi,[MenuDisplace16]    mov ecx,148    mov al,9    mov bx,[menudrawbox16b.allred].loop    mov [esi],bx    add esi,2    dec ecx    jnz .loop    add esi,288*2-148*2    dec al    mov ecx,148    jnz .loop    mov al,128    retsaveimage:    mov byte[pressed+1],0    mov byte[pressed+59],0%ifndef NO_PNG    cmp byte[ScreenShotFormat],1    jne .notpng    pushad    call Grab_PNG_Data    popad    ret.notpng%endif    cmp byte[cbitmode],1    je near .save16b    pushad    call Grab_BMP_Data_8    popad    ret.save16b    pushad    call Grab_BMP_Data    popad    retSECTION .dataNEWSYM keyonsn, db 0NEWSYM prbreak, db 0SECTION .textbreakatsignb:    mov byte[keyonsn],0    mov byte[prbreak],0%ifndef NO_DEBUGGER    cmp byte[SPCSave],1    jne .nospcsave    mov byte[debuggeron],1.nospcsave%endif    mov byte[exiter],01h    xor eax,eax    xor ebx,ebx    xor ecx,ecx    xor edx,edx    mov bl,[xpb]    mov ax,[xpc]    test ax,8000h    jz .loweraddr    mov esi,[snesmmap+ebx*4]    jmp .skiplower.loweraddr    cmp ax,4300h    jb .lower    cmp dword[memtabler8+ebx*4],regaccessbankr8    je .dma.lower    mov esi,[snesmap2+ebx*4]    jmp .skiplower.dma    mov esi,dmadata-4300h.skiplower    mov [initaddrl],esi    add esi,eax                 ; add program counter to address    mov ebp,[spcPCRam]    mov dl,[xp]                 ; set flags    mov dh,[curcyc]             ; set cycles    mov edi,[Curtableaddr]    call UpdateDPage    ; execute.loopa    call splitflags    call execsingle    call joinflags    mov dh,[pdh]%ifndef NO_DEBUGGER    inc dword[numinst]    cmp byte[numinst],0    jne .skipa    call Check_Key    test al,0FFh    jz .skipa    call Get_Key    cmp al,27    je .skipc.skipa%endif    cmp byte[SPCRAM+6],40h    je .skipc    cmp byte[keyonsn],1    jne .loopa    jmp .noesc.skipc    mov byte[prbreak],1.noesc    ; copy back data    mov [spcPCRam],ebp    mov [Curtableaddr],edi    mov [xp],dl    mov [curcyc],dh    mov eax,[initaddrl]    sub esi,eax                 ; subtract program counter by address    mov [xpc],si    mov byte[exiter],0%ifndef NO_DEBUGGER    cmp byte[SPCSave],1    jne .nospcsave2    mov byte[debuggeron],0.nospcsave2%endif    ret

⌨️ 快捷键说明

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