1 // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
2 // Copyright (C) 1999-2003 Forgotten
3 // Copyright (C) 2004 Forgotten and the VBA development team
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2, or(at your option)
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 void Simple2x(u8
*srcPtr
, u32 srcPitch
, u8
* /* deltaPtr */,
22 u8
*dstPtr
, u32 dstPitch
, int width
, int height
)
24 u8
*nextLine
, *finish
;
26 nextLine
= dstPtr
+ dstPitch
;
29 u32
*bP
= (u32
*) srcPtr
;
30 u32
*dP
= (u32
*) dstPtr
;
31 u32
*nL
= (u32
*) nextLine
;
34 finish
= (u8
*) bP
+ ((width
+2) << 1);
38 #ifdef WORDS_BIGENDIAN
39 u32 color
= currentPixel
>> 16;
41 u32 color
= currentPixel
& 0xffff;
44 color
= color
| (color
<< 16);
49 #ifdef WORDS_BIGENDIAN
50 color
= currentPixel
& 0xffff;
52 color
= currentPixel
>> 16;
54 color
= color
| (color
<< 16);
62 } while ((u8
*) bP
< finish
);
65 dstPtr
+= dstPitch
<< 1;
66 nextLine
+= dstPitch
<< 1;
71 void Simple2x32(u8
*srcPtr
, u32 srcPitch
, u8
* /* deltaPtr */,
72 u8
*dstPtr
, u32 dstPitch
, int width
, int height
)
74 u8
*nextLine
, *finish
;
76 nextLine
= dstPtr
+ dstPitch
;
79 u32
*bP
= (u32
*) srcPtr
;
80 u32
*dP
= (u32
*) dstPtr
;
81 u32
*nL
= (u32
*) nextLine
;
84 finish
= (u8
*) bP
+ ((width
+1) << 2);
88 u32 color
= currentPixel
;
99 } while ((u8
*) bP
< finish
);
102 dstPtr
+= dstPitch
<< 1;
103 nextLine
+= dstPitch
<< 1;