newgfx.mac

来自「linux下的任天堂模拟器代码。供大家参考。」· MAC 代码 · 共 3,357 行 · 第 1/5 页

MAC
3,357
字号
    cmp dl,3    jne near .no8bit    shr ecx,6    add edi,esi    mov [ngptrdat+%2*1024+ebx*4],ecx    mov [ngptrdat2],ecx    mov [ngceax+%2*1024+ebx*4],eax    mov [ngcedi+%2*1024+ebx*4],edi    ; eax = pointer to beginning of tile area    ProcessBuildWindow %1    jmp drawlineng8b.no8bit    pop ebx    ret.tiles16x16    mov dword[taddnfy16x16],0    mov dword[taddfy16x16],16    test ecx,08h    jz .nobottomy    mov dword[taddnfy16x16],16    mov dword[taddfy16x16],-16.nobottomy    mov eax,[BGPT1+ebx*2+%1*512]    test ecx,200h    jz .noyinc2    add eax,[BGPT1Y+ebx*2+%1*512].noyinc2    lea edx,[ecx*8]    lea ecx,[ecx*4]    and edx,38h    and ecx,07C0h      ; 1Fh*40h    mov [yposng],edx    xor edx,38h    add eax,ecx    mov [flipyposng],edx    mov ecx,[BG1SXl+ebx*2+%1*512]    mov edx,[BGPT1X+ebx*2+%1*512]    test ecx,200h    jz .noxinc2    add eax,edx    neg dx.noxinc2    mov edi,ecx    sub dx,64    and ecx,1F0h    and eax,0FFFFh    shr ecx,3    mov [bgtxadd],edx    mov [bgtxad+ebx*2+%2*512],dx    add eax,ecx    mov ecx,[BGOPT1+ebx*2+%1*512]    mov edx,[BGMA+ebx]    and edi,0Fh    and edx,07h    and ecx,0FFFFh    mov edx,[colormodedef+edx*4+%1]    neg edi    cmp dl,2    jne near .no4bit2    shr ecx,5    add edi,esi    mov [ngptrdat+%2*1024+ebx*4],ecx    mov [ngptrdat2],ecx    mov [ngceax+%2*1024+ebx*4],eax    mov [ngcedi+%2*1024+ebx*4],edi    ; eax = pointer to beginning of tile area    ProcessBuildWindow %1    jmp drawlineng16x164b.no4bit2    cmp dl,1    jne near .no2bit2    shr ecx,4    add edi,esi    mov [ngptrdat+%2*1024+ebx*4],ecx    mov [ngptrdat2],ecx    mov [ngceax+%2*1024+ebx*4],eax    mov [ngcedi+%2*1024+ebx*4],edi    ; eax = pointer to beginning of tile area    mov dword[mode0add],0    ProcessBuildWindow %1    cmp byte[BGMA+ebx],0    jne .nomode02    mov ebx,[mode0ads]    mov [mode0add],ebx.nomode02    jmp drawlineng16x162b.no2bit2    cmp dl,3    jne near .no8bit    shr ecx,6    add edi,esi    mov [ngptrdat+%2*1024+ebx*4],ecx    mov [ngptrdat2],ecx    mov [ngceax+%2*1024+ebx*4],eax    mov [ngcedi+%2*1024+ebx*4],edi    ; eax = pointer to beginning of tile area    ProcessBuildWindow %1    jmp drawlineng16x168b.no8bit2    pop ebx    ret.tiles16x8    cmp byte[t16x161+ebx+%1*256],1    je .tiles16x16hr    mov dword[taddnfy16x16],0    mov dword[taddfy16x16],0    mov eax,[BGPT1+ebx*2+%1*512]    test ecx,100h    jz .noyinc2c    add eax,[BGPT1Y+ebx*2+%1*512].noyinc2c    lea ecx,[ecx*8]    mov edx,ecx    and ecx,07C0h      ; 1Fh*40h    and edx,38h    jmp .tiles16x8hr.tiles16x16hr    mov dword[taddnfy16x16],0    mov dword[taddfy16x16],16    test ecx,08h    jz .nobottomy2    mov dword[taddnfy16x16],16    mov dword[taddfy16x16],-16.nobottomy2    mov eax,[BGPT1+ebx*2+%1*512]    test ecx,200h    jz .noyinc2b    add eax,[BGPT1Y+ebx*2+%1*512].noyinc2b    lea edx,[ecx*8]    lea ecx,[ecx*4]    and edx,38h    and ecx,07C0h      ; 1Fh*40h.tiles16x8hr    mov [yposng],edx    xor edx,38h    add eax,ecx    mov [flipyposng],edx    mov ecx,[BG1SXl+ebx*2+%1*512]    add ecx,ecx    mov edx,[BGPT1X+ebx*2+%1*512]    test ecx,200h    jz .noxinc2b    add eax,edx    neg dx.noxinc2b    mov edi,ecx    sub dx,64    and ecx,01F0h    and eax,0FFFFh    shr ecx,3    mov [bgtxadd],edx    mov [bgtxad+ebx*2+%2*512],dx    add eax,ecx    mov ecx,[BGOPT1+ebx*2+%1*512]    mov edx,[BGMA+ebx]    and edi,0Fh    and edx,07h    and ecx,0FFFFh    shr edi,1    mov edx,[colormodedef+edx*4+%1]    neg edi    cmp dl,2    jne near .no4bit2b    shr ecx,5    add edi,esi    mov [ngptrdat+%2*1024+ebx*4],ecx    mov [ngptrdat2],ecx    mov [ngceax+%2*1024+ebx*4],eax    mov [ngcedi+%2*1024+ebx*4],edi    ; eax = pointer to beginning of tile area    mov dword[cbgval],%1    jmp drawlineng16x84b.no4bit2b    cmp dl,1    jne near .no2bit2b    shr ecx,4    add edi,esi    mov [ngptrdat+%2*1024+ebx*4],ecx    mov [ngptrdat2],ecx    mov [ngceax+%2*1024+ebx*4],eax    mov [ngcedi+%2*1024+ebx*4],edi    ; eax = pointer to beginning of tile area    mov dword[mode0add],0    mov dword[cbgval],%1    jmp drawlineng16x82b.no2bit2b    pop ebx    ret    ; Offsetmode calculation : <b2-7,2109>*1024+<b3-7,2112>*32+<b3-7,2111>.offsetm    xor edx,edx    mov dx,[BG3SYl+ebx*2];    and dx,0F8h    shr edx,3    shl edx,6    xor eax,eax    mov ax,[BGPT3+ebx*2]    add ax,dx    xor edx,edx    mov dx,[BG3SXl+ebx*2]    and dx,0F8h    mov [ofsmcyps],ebx    shr edx,3    shl edx,1    add ax,dx    mov dx,[bg3scrolx]    test dx,8000h    jz .nooma    and dx,0F000h    shr dx,5    add ax,dx.nooma;    cmp byte[BGMA+ebx],4;    je .offsetm4    add eax,40h;.offsetm4    mov edx,eax    and edx,0FFFFFFC0h    add edx,[vram]    mov [ofsmcptr],edx    and eax,3Fh    mov [ofsmcptr2],eax    mov eax,[BGPT1Y+ebx*2+%1*512]    mov [ofsmady],eax    mov eax,[BGPT1X+ebx*2+%1*512]    mov [ofsmadx],eax    mov eax,[BGPT1+ebx*2+%1*512]    mov [ofsmtptr],eax    mov [ofsmtptrs],eax    test ecx,100h    jz .noyincd    add eax,[BGPT1Y+ebx*2+%1*512].noyincd    lea ecx,[ecx*8]    mov edx,ecx    and ecx,07C0h      ; 1Fh*40h    and edx,38h    add eax,ecx    mov [yposng],edx    mov [yposngom],edx    xor edx,38h    mov ecx,[BG1SXl+ebx*2+%1*512]    mov [flipyposng],edx    mov [flipyposngom],edx    mov edx,[BGPT1X+ebx*2+%1*512]    test ecx,100h    jz .noxincd    add eax,edx    add [ofsmtptr],edx    neg dx.noxincd    mov edi,ecx    sub dx,64    and ecx,0F8h    and eax,0FFFFh    shr ecx,2    mov [bgtxadd],edx    mov [bgtxad+ebx*2+%2*512],dx    add eax,ecx    add [ofsmtptr],ecx    mov [ofsmmptr],eax    mov word[bgtxadd2],0    cmp word[BGPT3X+ebx*2],0    je .yesoverfl    mov cx,[BG3SXl+ebx*2]    add cx,16    test cx,100h    jz .notoverfl    add dword[ofsmcptr],800h    sub word[bgtxadd2],800h    jmp .yesoverfl.notoverfl    add word[bgtxadd2],800h.yesoverfl    mov dword[ofshvaladd],0    mov ecx,[BGOPT1+ebx*2+%1*512]    mov edx,[BGMA+ebx]    and edi,07h    and edx,07h    and ecx,0FFFFh    mov edx,[colormodedef+edx*4+%1]    neg edi    cmp dl,2    jne near .no4bitd    shr ecx,5    add edi,esi    mov [ngptrdat+%2*1024+ebx*4],ecx    mov [ngptrdat2],ecx    mov [ngceax+%2*1024+ebx*4],eax    mov [ngcedi+%2*1024+ebx*4],edi    ; eax = pointer to beginning of tile area    mov dword[ofsmval],2000h << %1    mov dword[ofsmvalh],2000h << %1    mov dword[cbgval],%1    ProcessBuildWindow %1    jmp drawlinengom4b.no4bitd    cmp dl,1    jne near .no2bitdn    ; eax = pointer to beginning of tile area    shr ecx,4    add edi,esi    mov [ngptrdat+%2*1024+ebx*4],ecx    mov [ngptrdat2],ecx    mov [ngceax+%2*1024+ebx*4],eax    mov [ngcedi+%2*1024+ebx*4],edi    ; eax = pointer to beginning of tile area    mov dword[mode0add],0    mov byte[tleftn],33.loopdn    mov cx,[vrama+eax]    test cx,2000h    jnz near .fintiledn    drawlinengom2 tltype2b, preparet2ba, cachesingle2bng,.loopdn,.fintiledn,ngpalcon2b,test2ba,03h,%1.no2bitdn    cmp dl,3    jne near .no8bitdn    ; eax = pointer to beginning of tile area    shr ecx,6    add edi,esi    mov [ngptrdat+%2*1024+ebx*4],ecx    mov [ngptrdat2],ecx    mov [ngceax+%2*1024+ebx*4],eax    mov [ngcedi+%2*1024+ebx*4],edi    ; eax = pointer to beginning of tile area    mov byte[tleftn],33.loopdn2    mov cx,[vrama+eax]    test cx,2000h    jnz near .fintiledn2    drawlinengom2 tltype8b, preparet8ba, cachesingle8bng,.loopdn2,.fintiledn2,ngpalcon8b,test8ba,0FFh,%1.no8bitdn    pop ebx    ret%endmacro%macro mosender 1.nodraw    add edi,%1    add esi,%1    dec ecx    jnz .next    pop esi    mov dword[ignor512],0    ret%endmacro%macro drawbglinengpr1 2    mov dword[ng16bprval],2000h    mov dword[ng16bbgval],%1    push ebx    mov byte[curmosaicsz],1    xor eax,eax    test byte[mosenng+ebx],1 << %1    jz %%nomosaic    mov al,[mosszng+ebx]    or al,al    jz %%nomosaic    inc al    mov [curmosaicsz],al    mov cl,al    mov al,bl    div cl    mul cl    mov ebx,eax    mov [pesimpng],esi    mov edi,xtravbuf+16    mov ecx,64    xor eax,eax    mov esi,xtravbuf+16    rep stosd    or ebx,ebx    jnz %%nomosaic    inc ebx    jmp %%yesmosaic%%nomosaic    cmp byte[BGMA+ebx],5    jae near .tiles16x8%%yesmosaic    cmp byte[t16x161+ebx+%1*256],1    je near .tiles16x16    cmp byte[osm2dis],1    je .nooffsetm    cmp byte[BGMA+ebx],2    je near .offsetm;    cmp byte[BGMA+ebx],4;    je near .offsetm.nooffsetm    mov eax,[BG1SYl+ebx*2+%1*512]    and eax,0FFFFh    add eax,ebx    test byte[intrlng+ebx],01h    jz %%nointerl    add eax,ebx    add eax,[cfieldad]%%nointerl    lea eax,[eax*8]    and eax,38h    mov [yposng],eax    xor eax,38h    mov [flipyposng],eax    mov edx,[BGMA+ebx]    mov ecx,[bgtxad+ebx*2+%2*512]    and edx,07h    mov [bgtxadd],cx    mov ecx,[ngptrdat+%2*1024+ebx*4]    mov edx,[colormodedef+edx*4+%1]    mov [ngptrdat2],ecx    mov eax,[ngceax+%2*1024+ebx*4]    mov edi,[ngcedi+%2*1024+ebx*4]    cmp dl,2    jne near .no4bit    ; eax = pointer to beginning of tile area    ProcessBuildWindow %1    jmp drawlineng4b.no4bit    cmp dl,1    jne near .no2bit    ; eax = pointer to beginning of tile area    mov dword[mode0add],0    ProcessBuildWindow %1    cmp byte[BGMA+ebx],0    jne .nomode0    mov ebx,[mode0ads]    mov [mode0add],ebx.nomode0    jmp drawlineng2b.no2bit    cmp dl,3    jne near .no8bit    ; eax = pointer to beginning of tile area    ProcessBuildWindow %1    jmp drawlineng8b.no8bit    pop ebx    ret.tiles16x16    mov ecx,[BG1SYl+ebx*2+%1*512]    and ecx,0FFFFh    mov dword[taddnfy16x16],0    add ecx,ebx    test byte[intrlng+ebx],01h    jz %%nointerl2    add ecx,ebx    add ecx,[cfieldad]%%nointerl2    mov dword[taddfy16x16],16    test ecx,08h    jz .nobottomy    mov dword[taddnfy16x16],16    mov dword[taddfy16x16],-16.nobottomy    lea eax,[ecx*8]    and eax,38h    mov [yposng],eax    xor eax,38h    mov [flipyposng],eax    mov edx,[BGMA+ebx]    mov ecx,[bgtxad+ebx*2+%2*512]    and edx,07h    mov [bgtxadd],cx    mov ecx,[ngptrdat+%2*1024+ebx*4]    mov edx,[colormodedef+edx*4+%1]    mov [ngptrdat2],ecx    mov eax,[ngceax+%2*1024+ebx*4]    mov edi,[ngcedi+%2*1024+ebx*4]    cmp dl,2    jne near .no4bit2    ; eax = pointer to beginning of tile area    ProcessBuildWindow %1    jmp drawlineng16x164b.no4bit2    cmp dl,1    jne near .no2bit2    ; eax = pointer to beginning of tile area    mov dword[mode0add],0    ProcessBuildWindow %1    cmp byte[BGMA+ebx],0    jne .nomode02    mov ebx,[mode0ads]    mov [mode0add],ebx.nomode02    jmp drawlineng16x162b.no2bit2    cmp dl,3    jne near .no8bit2    ; eax = pointer to beginning of tile area    ProcessBuildWindow %1    jmp drawlineng16x168b.no8bit2    pop ebx    ret.tiles16x8    mov ecx,[BG1SYl+ebx*2+%1*512]    and ecx,0FFFFh    add ecx,ebx    test byte[intrlng+ebx],01h    jz %%nointerl3    add ecx,ebx    add ecx,[cfieldad]%%nointerl3    mov dword[taddnfy16x16],0    mov dword[taddfy16x16],16    test ecx,08h    jz .nobottomyb    mov dword[taddnfy16x16],16    mov dword[taddfy16x16],-16.nobottomyb    cmp byte[t16x161+ebx+%1*256],1    je near .tiles16x16hr    mov dword[taddnfy16x16],0    mov dword[taddfy16x16],0.tiles16x16hr    lea eax,[ecx*8]    and eax,38h    mov [yposng],eax    xor eax,38h    mov [flipyposng],eax    mov edx,[BGMA+ebx]    mov ecx,[bgtxad+ebx*2+%2*512]    and edx,07h    mov [bgtxadd],cx    mov ecx,[ngptrdat+%2*1024+ebx*4]    mov edx,[colormodedef+edx*4+%1]    mov [ngptrdat2],ecx    mov eax,[ngceax+%2*1024+ebx*4]    mov edi,[ngcedi+%2*1024+ebx*4]    cmp dl,2    jne near .no4bit2b    ; eax = pointer to beginning of tile area    mov dword[cbgval],%1    jmp drawlineng16x84b.no4bit2b    cmp dl,1    jne near .no2bit2b    ; eax = pointer to beginning of tile area    mov dword[mode0add],0    mov dword[cbgval],%1    jmp drawlineng16x82b.no2bit2b    pop ebx    ret.offsetm    xor edx,edx    mov dx,[BG3SYl+ebx*2];    and dx,0F8h    shr edx,3    shl edx,6    xor eax,eax    mov ax,[BGPT3+ebx*2]    add ax,dx    xor edx,edx    mov dx,[BG3SXl+ebx*2]    and dx,0F8h    mov [ofsmcyps],ebx    shr edx,3    shl edx,1    add ax,dx    mov dx,[bg3scrolx]    test dx,8000h    jz .nooma    and dx,0F000h    shr dx,5    add ax,dx.nooma    mov edx,eax;    cmp byte[BGMA+ebx],4;    je .offsetm4    add edx,40h;.offsetm4    and edx,0FFC0h    add edx,[vram]    mov [ofsmcptr],edx    and eax,3Fh    mov [ofsmcptr2],eax    mov eax,[BGPT1Y+ebx*2+%1*512]    mov [ofsmady],eax    mov eax,[BGPT1X+ebx*2+%1*512]    mov [ofsmadx],eax    mov eax,[BGPT1+ebx*2+%1*512]    mov [ofsmtptr],eax    mov [ofsmtptrs],eax    mov word[bgtxadd2],0    cmp word[BGPT3X+ebx*2],0    je .yesoverfl    mov cx,[BG3SXl+ebx*2]    add cx,16    test cx,100h    jz .notoverfl    add dword[ofsmcptr],800h    sub word[bgtxadd2],800h    jmp .yesoverfl.notoverfl    add word[bgtxadd2],800h.yesoverfl    mov ecx,[BG1SXl+ebx*2+%1*512]    mov edx,[BGPT1X+ebx*2+%1*512]    test ecx,100h    jz .noxincdd    add [ofsmtptr],edx.noxincdd    and ecx,0F8h    shr ecx,2    add [ofsmtptr],ecx    mov eax,[BG1SYl+ebx*2+%1*512]    and eax,0FFFFh    add eax,ebx    lea eax,[eax*8]    and eax,38h    mov [yposng],eax    mov [yposngom],eax    xor eax,38h    mov [flipyposng],eax    mov [flipyposngom],eax    mov edx,[BGMA+ebx]    mov ecx,[bgtxad+ebx*2+%2*512]    and edx,07h    mov [bgtxadd],cx    mov ecx,[ngptrdat+%2*1024+ebx*4]    mov edx,[colormodedef+edx*4+%1]    mov [ngptrdat2],ecx    mov eax,[ngceax+%2*1024+ebx*4]    mov edi,[ngcedi+%2*1024+ebx*4]    mov [ofsmmptr],eax    mov dword[ofshvaladd],0    cmp dl,2    jne near .no4bitd    ; eax = pointer to beginning of tile area    mov dword[ofsmval],2000h << %1    mov dword[ofsmvalh],2000h << %1    mov dword[cbgval],%1    ProcessBuildWindow %1    jmp drawlinengom4b.no4bitd    cmp dl,1    jne near .no2bitdn    ; eax = pointer to beginning of tile area    mov byte[tleftn],33.loopdn    mov cx,[vrama+eax]    test cx,2000h    jz near .fintiledn    drawlinengom2 tltype2b, preparet2ba, cachesingle2bng,.loopdn,.fintiledn,ngpalcon2b,test2ba,03h,%1.no2bitdn    cmp dl,3    jne near .no8bitdn    ; eax = pointer to beginning of tile area    mov byte[tleftn],33.loopdn2    mov cx,[vrama+eax]    test cx,2000h    jz near .fintiledn2    drawlinengom2 tltype8b, preparet8ba, cachesingle8bn

⌨️ 快捷键说明

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