1 /* FCE Ultra - NES/Famicom Emulator
3 * Copyright notice for this file:
4 * Copyright (C) 2002 Xodnizel
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
36 static void FP_FASTAPASS(3) ZapperFrapper(uint8 *bg, uint8 *spr, uint32 linets, int final)
41 if(!bg) // New line, so reset stuff.
54 if(scanline>=(zy-4) && scanline<=(zy+4))
60 if(xs<=(zx+4) && xs>=(zx-4))
68 if(!(a2&0x40) || (a1&64))
73 sum=palo[a1].r+palo[a1].g+palo[a1].b;
76 ZD.zaphit=((uint64)linets+(xs+16)*(PAL?15:16))/48+timestampbase;
87 static INLINE int CheckColor(void)
91 if((ZD.zaphit+10)>=(timestampbase+timestamp)) return(0);
97 static uint8 FP_FASTAPASS(2) ReadZapper(int w, uint8 ret)
109 //printf("Kayo: %d\n",ZD.zap_readbit);
111 //if(ZD.zap_readbit==4) ret|=ZD.mzb&2;
118 static void FP_FASTAPASS(2) DrawZapper(uint8 *buf, int arg)
121 FCEU_DrawCursor(buf, ZD.mzx, ZD.mzy);
124 static void FP_FASTAPASS(2) UpdateZapper(void *data, int arg)
126 uint32 *ptr=(uint32*)data;
130 if(ptr[2]&1 && (!(ZD.mzb&1)))
138 static void StrobeShadow(void)
143 static INPUTCFC SHADOWC={ReadZapper,0,StrobeShadow,UpdateZapper,ZapperFrapper,DrawZapper};
145 INPUTCFC *FCEU_InitSpaceShadow(void)
147 memset(&ZD,0,sizeof(ZAPPER));