1 /* FCE Ultra - NES/Famicom Emulator
3 * Copyright notice for this file:
4 * Copyright (C) 1998 BERO
5 * Copyright (C) 2002 Ben Parnell
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 int dummy,dummy1,dummy2;
25 "xorl %%edx,%%edx\n\t"
26 "movb (%%esi),%%cl\n\t"
27 "movb 8(%%esi),%%dl\n\t"
28 "movl %%ebx,%%esi\n\t"
29 "addl %%eax,%%esi\n\t"
30 "xorl %%ebx,%%ebx\n\t"
40 "orb %%al, %%bl\n\t" // Stick c1 into bl
41 "orb %%cl, %%dl\n\t" // Stick c2 into dl
42 "xorl %%eax, %%eax\n\t"
43 "xorl %%ecx, %%ecx\n\t"
44 /* At this point, bl contains c1, and dl contains c2 */
45 /* and edi contains P, esi contains VRAM[] */
46 /* al will be used for zz, cl will be used for zz2 */
51 "movb (%%esi,%%eax),%%bh\n\t"
52 "movb (%%esi,%%ecx),%%dh\n\t"
53 "movb %%bh,6(%%edi)\n\t"
54 "movb %%dh,7(%%edi)\n\t"
62 "movb (%%esi,%%eax),%%bh\n\t"
63 "movb (%%esi,%%ecx),%%dh\n\t"
64 "movb %%bh,4(%%edi)\n\t"
65 "movb %%dh,5(%%edi)\n\t"
73 "movb (%%esi,%%eax),%%bh\n\t"
74 "movb (%%esi,%%ecx),%%dh\n\t"
75 "movb %%bh,2(%%edi)\n\t"
76 "movb %%dh,3(%%edi)\n\t"
78 // "movb %%bl,%%al\n\t"
79 // "movb %%dl,%%cl\n\t"
84 "movb (%%esi,%%ebx),%%al\n\t"
85 "movb (%%esi,%%edx),%%cl\n\t"
86 "movb %%al,0(%%edi)\n\t"
87 "movb %%cl,1(%%edi)\n\t"
88 : "=S" (dummy), "=a" (dummy1), "=b" (dummy2)
89 : "D" (P), "S" (C), "a" (cc), "b" (PALRAM)
99 c1=((C[0]>>1)&0x55)|(C[8]&0xAA);
100 c2=(C[0]&0x55)|((C[8]<<1)&0xAA);