📄 newgfx2.asm
字号:
;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 ngwintable,ngwinen,ngcwinptr,ngcpixleft,ngcwinmode,cachesingle4bngEXTSYM tleftn,ng16bprval,vrama,bg1drwng,ng16bbgval,bg1totng,ngptrdat2EXTSYM bgtxadd,taddnfy16x16,taddfy16x16,switch16x16,curmosaicsz,domosaicngEXTSYM vidmemch4,vidmemch2,vidmemch8,mode0add,vcache4b,vcache2b,vcache8bEXTSYM cachesingle2bng,cachesingle8bng,ngpalcon4b,ngpalcon8b,ofshvaladdEXTSYM ngpalcon2b,tleftnb,tltype2b,tltype4b,tltype8b,yposng,flipyposngEXTSYM ofsmcptr,ofsmtptr,ofsmmptr,ofsmcyps,ofsmady,ofsmadx,ofsmtptrs,ofsmcptr2EXTSYM yposngom,flipyposngom,cbgval,ofsmval,ofsmvalh,bgtxadd2%include "video/vidmacro.mac"%include "video/newgfx2.mac"%include "video/newgfx.mac"%include "video/newgfxwn.mac";******************************************; 8x8 tiles - tile engine;******************************************%macro WinClipMacro 1 mov byte[tleftn],33 mov dword[ngcwinptr],ngwintable mov dword[ngcwinmode],0 cmp dword[ngwintable],0 jne .loop add dword[ngcwinptr],4 mov dword[ngcwinmode],1.winclipped mov ebx,[ngcwinptr] mov cx,[vrama+eax] cmp dword[ebx],8 jbe near %1 sub dword[ebx],8 add ax,2 mov ebx,[ng16bbgval] add edi,8 inc dword[bg1totng+ebx*4] test eax,03Fh jnz .notileadd add ax,[bgtxadd].notileadd dec byte[tleftn] jnz .winclipped pop ebx cmp byte[curmosaicsz],1 jne near domosaicng ret.loop mov ebx,[ngcwinptr] mov cx,[vrama+eax] cmp dword[ebx],8 jbe near %1 sub dword[ebx],8 xor ecx,[ng16bprval] test ecx,2000h jnz near .finline%endmacroSECTION .textNEWSYM drawtileng2b cmp byte[ngwinen],1 je near drawtileng2bwin mov byte[tleftn],33.loop mov cx,[vrama+eax] xor ecx,[ng16bprval] test ecx,2000h jnz near .finline drawtileng tltype2b, preparet2ba, cachesingle2bng,.loop,.finline,ngpalcon2b,test2ba,03h retdrawtileng2bwin: WinClipMacro Processwinclip2bt drawtileng tltype2b, preparet2ba, cachesingle2bng,.loop,.finline,ngpalcon2b,test2ba,03hProcesswinclip2bt: mov ebx,[ngcwinptr] mov cx,[vrama+eax] mov ebx,[ebx] xor ecx,[ng16bprval] mov [ngcpixleft],ebx test ecx,2000h jnz near .finline drawtilengwin tltype2b, preparet2ba, cachesingle2bng,.loop,.finline,ngpalcon2b,test2ba,03h.loop push eax mov ebx,[ngcwinptr] mov eax,[ngcpixleft] mov [ebx],eax pop eax cmp dword[ngcwinmode],1 je near drawtileng2bwin.winclipped jmp drawtileng2bwin.loopNEWSYM drawtileng4b cmp byte[ngwinen],1 je near drawtileng4bwin mov byte[tleftn],33.loop mov cx,[vrama+eax] xor ecx,[ng16bprval] test ecx,2000h jnz near .finline drawtileng tltype4b, preparet4ba, cachesingle4bng,.loop,.finline,ngpalcon4b,test4ba,0Fh retdrawtileng4bwin: WinClipMacro Processwinclip4bt drawtileng tltype4b, preparet4ba, cachesingle4bng,.loop,.finline,ngpalcon4b,test4ba,0FhProcesswinclip4bt: mov ebx,[ngcwinptr] mov cx,[vrama+eax] mov ebx,[ebx] xor ecx,[ng16bprval] mov [ngcpixleft],ebx test ecx,2000h jnz near .finline drawtilengwin tltype4b, preparet4ba, cachesingle4bng,.loop,.finline,ngpalcon4b,test4ba,0Fh.loop push eax mov ebx,[ngcwinptr] mov eax,[ngcpixleft] mov [ebx],eax pop eax cmp dword[ngcwinmode],1 je near drawtileng4bwin.winclipped jmp drawtileng4bwin.loopNEWSYM drawtileng8b cmp byte[ngwinen],1 je near drawtileng8bwin mov byte[tleftn],33.loop mov cx,[vrama+eax] xor ecx,[ng16bprval] test ecx,2000h jnz near .finline drawtileng tltype8b, preparet8ba, cachesingle8bng,.loop,.finline,ngpalcon8b,test8ba,0FFh retdrawtileng8bwin: WinClipMacro Processwinclip8bt drawtileng tltype8b, preparet8ba, cachesingle8bng,.loop,.finline,ngpalcon8b,test8ba,0FFhProcesswinclip8bt: mov ebx,[ngcwinptr] mov cx,[vrama+eax] mov ebx,[ebx] xor ecx,[ng16bprval] mov [ngcpixleft],ebx test ecx,2000h jnz near .finline drawtilengwin tltype8b, preparet8ba, cachesingle8bng,.loop,.finline,ngpalcon8b,test8ba,0FFh.loop push eax mov ebx,[ngcwinptr] mov eax,[ngcpixleft] mov [ebx],eax pop eax cmp dword[ngcwinmode],1 je near drawtileng8bwin.winclipped jmp drawtileng8bwin.loop;******************************************; 16x16 tiles - tile engine;******************************************%macro WinClipMacro16x16 1 mov byte[tleftn],17 mov dword[ngcwinptr],ngwintable mov dword[ngcwinmode],0 cmp dword[ngwintable],0 jne .loop add dword[ngcwinptr],4 mov dword[ngcwinmode],1.winclipped mov ebx,[ngcwinptr] mov cx,[vrama+eax] cmp dword[ebx],16 jbe near %1 sub dword[ebx],16 add ax,2 mov ebx,[ng16bbgval] add edi,16 inc dword[bg1totng+ebx*4] test eax,03Fh jnz .notileadd add ax,[bgtxadd].notileadd dec byte[tleftn] jnz .winclipped pop ebx cmp byte[curmosaicsz],1 jne near domosaicng ret.loop mov ebx,[ngcwinptr] mov cx,[vrama+eax] cmp dword[ebx],16 jbe near %1 sub dword[ebx],16 xor ecx,[ng16bprval] test ecx,2000h jnz near .finline%endmacroNEWSYM drawtileng16x162b cmp byte[ngwinen],1 je near drawtileng16x162bwin mov byte[tleftn],17.loop mov cx,[vrama+eax] xor ecx,[ng16bprval] test ecx,2000h jnz near .finline drawtileng16x16 tltype2b, preparet2ba, cachesingle2bng,.loop,.finline,ngpalcon2b,test2ba,03h retdrawtileng16x162bwin: WinClipMacro16x16 Processwinclip16x162bt drawtileng16x16 tltype2b, preparet2ba, cachesingle2bng,.loop,.finline,ngpalcon2b,test2ba,03hProcesswinclip16x162bt: mov ebx,[ngcwinptr] mov cx,[vrama+eax] mov ebx,[ebx] xor ecx,[ng16bprval] mov [ngcpixleft],ebx test ecx,2000h jnz near .finline drawtileng16x16win tltype2b, preparet2ba, cachesingle2bng,.loop,.finline,ngpalcon2b,test2ba,03h.loop push eax mov ebx,[ngcwinptr] mov eax,[ngcpixleft] mov [ebx],eax pop eax cmp dword[ngcwinmode],1 je near drawtileng16x162bwin.winclipped jmp drawtileng16x162bwin.loopNEWSYM drawtileng16x164b cmp byte[ngwinen],1 je near drawtileng16x164bwin mov byte[tleftn],17.loop mov cx,[vrama+eax] xor ecx,[ng16bprval] test ecx,2000h jnz near .finline drawtileng16x16 tltype4b, preparet4ba, cachesingle4bng,.loop,.finline,ngpalcon4b,test4ba,0Fh retdrawtileng16x164bwin: WinClipMacro16x16 Processwinclip16x164bt drawtileng16x16 tltype4b, preparet4ba, cachesingle4bng,.loop,.finline,ngpalcon4b,test4ba,0FhProcesswinclip16x164bt: mov ebx,[ngcwinptr] mov cx,[vrama+eax] mov ebx,[ebx] xor ecx,[ng16bprval] mov [ngcpixleft],ebx test ecx,2000h jnz near .finline drawtileng16x16win tltype4b, preparet4ba, cachesingle4bng,.loop,.finline,ngpalcon4b,test4ba,0Fh.loop push eax mov ebx,[ngcwinptr] mov eax,[ngcpixleft] mov [ebx],eax pop eax cmp dword[ngcwinmode],1 je near drawtileng16x164bwin.winclipped jmp drawtileng16x164bwin.loopNEWSYM drawtileng16x168b mov byte[tleftn],17.loop mov cx,[vrama+eax] xor ecx,[ng16bprval] test ecx,2000h jnz near .finline drawtileng16x16 tltype8b, preparet8ba, cachesingle8bng,.loop,.finline,ngpalcon8b,test8ba,0FFh retdrawtileng16x168bwin: WinClipMacro16x16 Processwinclip16x168bt drawtileng16x16 tltype8b, preparet8ba, cachesingle8bng,.loop,.finline,ngpalcon8b,test8ba,0FFhProcesswinclip16x168bt: mov ebx,[ngcwinptr] mov cx,[vrama+eax] mov ebx,[ebx] xor ecx,[ng16bprval] mov [ngcpixleft],ebx test ecx,2000h jnz near .finline drawtileng16x16win tltype8b, preparet8ba, cachesingle8bng,.loop,.finline,ngpalcon8b,test8ba,0FFh.loop push eax mov ebx,[ngcwinptr] mov eax,[ngcpixleft] mov [ebx],eax pop eax cmp dword[ngcwinmode],1 je near drawtileng16x168bwin.winclipped jmp drawtileng16x168bwin.loop;******************************************; 8x8 tiles - line by line engine;******************************************NEWSYM drawlineng2b cmp byte[ngwinen],1 je near drawlineng2bwin mov byte[tleftn],33.loop mov cx,[vrama+eax] xor ecx,[ng16bprval] test ecx,2000h jnz near .finline drawlineng tltype2b, preparet2ba, cachesingle2bng,.loop,.finline,ngpalcon2b,test2ba,03h ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -