You can subscribe to this list here.
2004 |
Jan
(17) |
Feb
(38) |
Mar
(24) |
Apr
(18) |
May
(75) |
Jun
(2) |
Jul
|
Aug
|
Sep
(21) |
Oct
(3) |
Nov
(19) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(15) |
Jul
(2) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
(8) |
Feb
|
Mar
|
Apr
(6) |
May
(73) |
Jun
(57) |
Jul
(12) |
Aug
(68) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
(9) |
2
|
3
|
4
|
5
(5) |
6
(2) |
7
(8) |
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
(3) |
17
(4) |
18
|
19
|
20
|
21
|
22
|
23
|
24
(2) |
25
|
26
|
27
|
28
|
29
(5) |
|
|
|
|
|
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/include/cximage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28367/include/cximage Added Files: xfile.h ximabmp.h ximadefs.h ximage.h ximagif.h ximaico.h ximaiter.h ximaj2k.h ximajas.h ximajbg.h ximajpg.h ximamng.h ximapcx.h ximapng.h ximatga.h ximatif.h ximawbmp.h ximawmf.h xiofile.h xmemfile.h Log Message: Added support for JPEG/PNG skin images --- NEW FILE: xfile.h --- /* * File: xfile.h * Purpose: General Purpose File Class */ /* === C R E D I T S & D I S C L A I M E R S ============== * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * CxFile (c) 11/May/2002 Davide Pizzolato - www.xdp.it * CxFile version 2.00 23/Aug/2002 * See the file history.htm for the complete bugfix and news report. * * Special thanks to Chris Shearer Cooper for new features, enhancements and bugfixes * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__xfile_h) #define __xfile_h #ifdef WIN32 #include <windows.h> #endif #include <stdio.h> #include <stdlib.h> #include "ximadefs.h" class DLL_EXP CxFile { public: CxFile(void) { }; virtual ~CxFile() { }; virtual bool Close() = 0; virtual size_t Read(void *buffer, size_t size, size_t count) = 0; virtual size_t Write(const void *buffer, size_t size, size_t count) = 0; virtual bool Seek(long offset, int origin) = 0; virtual long Tell() = 0; virtual long Size() = 0; virtual bool Flush() = 0; virtual bool Eof() = 0; virtual long Error() = 0; virtual bool PutC(unsigned char c) { // Default implementation size_t nWrote = Write(&c, 1, 1); return (bool)(nWrote == 1); } virtual long GetC() = 0; }; #endif //__xfile_h --- NEW FILE: ximabmp.h --- /* * File: ximabmp.h * Purpose: BMP Image Class Loader and Writer */ /* === C R E D I T S & D I S C L A I M E R S ============== * CxImageBMP (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * CxImage version 5.99a 08/Feb/2004 * See the file history.htm for the complete bugfix and news report. * * Special thanks to Troels Knakkergaard for new features, enhancements and bugfixes * * original CImageBMP and CImageIterator implementation are: * Copyright: (c) 1995, Alejandro Aguilar Sierra <asierra(at)servidor(dot)unam(dot)mx> * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__ximaBMP_h) #define __ximaBMP_h #include "ximage.h" const int RLE_COMMAND = 0; const int RLE_ENDOFLINE = 0; const int RLE_ENDOFBITMAP = 1; const int RLE_DELTA = 2; #if !defined(BI_RLE8) #define BI_RLE8 1L #endif #if !defined(BI_RLE4) #define BI_RLE4 2L #endif #if CXIMAGE_SUPPORT_BMP class CxImageBMP: public CxImage { public: CxImageBMP(): CxImage(CXIMAGE_FORMAT_BMP) {}; bool Decode(CxFile * hFile); bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } #if CXIMAGE_SUPPORT_ENCODE bool Encode(CxFile * hFile); bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } #endif // CXIMAGE_SUPPORT_ENCODE protected: bool DibReadBitmapInfo(CxFile* fh, BITMAPINFOHEADER *pdib); }; #define BFT_ICON 0x4349 /* 'IC' */ #define BFT_BITMAP 0x4d42 /* 'BM' */ #define BFT_CURSOR 0x5450 /* 'PT' */ #ifndef WIDTHBYTES #define WIDTHBYTES(i) ((unsigned)((i+31)&(~31))/8) /* ULONG aligned ! */ #endif #define DibWidthBytesN(lpbi, n) (UINT)WIDTHBYTES((UINT)(lpbi)->biWidth * (UINT)(n)) #define DibWidthBytes(lpbi) DibWidthBytesN(lpbi, (lpbi)->biBitCount) #define DibSizeImage(lpbi) ((lpbi)->biSizeImage == 0 \ ? ((DWORD)(UINT)DibWidthBytes(lpbi) * (DWORD)(UINT)(lpbi)->biHeight) \ : (lpbi)->biSizeImage) #define DibNumColors(lpbi) ((lpbi)->biClrUsed == 0 && (lpbi)->biBitCount <= 8 \ ? (int)(1 << (int)(lpbi)->biBitCount) \ : (int)(lpbi)->biClrUsed) #define FixBitmapInfo(lpbi) if ((lpbi)->biSizeImage == 0) \ (lpbi)->biSizeImage = DibSizeImage(lpbi); \ if ((lpbi)->biClrUsed == 0) \ (lpbi)->biClrUsed = DibNumColors(lpbi); \ #endif #endif --- NEW FILE: ximadefs.h --- #if !defined(__ximadefs_h) #define __ximadefs_h #if defined(_AFXDLL)||defined(_USRDLL) #define DLL_EXP __declspec(dllexport) #elif defined(_MSC_VER)&&(_MSC_VER<1200) #define DLL_EXP __declspec(dllimport) #else #define DLL_EXP #endif #if CXIMAGE_SUPPORT_JP2 || CXIMAGE_SUPPORT_JPC || CXIMAGE_SUPPORT_PGX || CXIMAGE_SUPPORT_PNM || CXIMAGE_SUPPORT_RAS #define CXIMAGE_SUPPORT_JASPER 1 #else #define CXIMAGE_SUPPORT_JASPER 0 #endif #if CXIMAGE_SUPPORT_DSP #undef CXIMAGE_SUPPORT_TRANSFORMATION #define CXIMAGE_SUPPORT_TRANSFORMATION 1 #endif #if CXIMAGE_SUPPORT_TRANSFORMATION || CXIMAGE_SUPPORT_TIF || CXIMAGE_SUPPORT_TGA || CXIMAGE_SUPPORT_BMP || CXIMAGE_SUPPORT_WINDOWS #define CXIMAGE_SUPPORT_BASICTRANSFORMATIONS 1 #endif #if CXIMAGE_SUPPORT_WINCE #undef CXIMAGE_SUPPORT_WMF #define CXIMAGE_SUPPORT_WMF 0 #undef CXIMAGE_SUPPORT_WINDOWS #define CXIMAGE_SUPPORT_WINDOWS 0 #endif #ifndef WIN32 #undef CXIMAGE_SUPPORT_WINDOWS #define CXIMAGE_SUPPORT_WINDOWS 0 #endif #ifndef min #define min(a,b) (((a)<(b))?(a):(b)) #endif #ifndef max #define max(a,b) (((a)>(b))?(a):(b)) #endif #ifdef WIN32 #include <windows.h> //#include <tchar.h> #endif #include <stdio.h> #include <math.h> #ifdef __BORLANDC__ #define _complex complex #define _cabs cabs #endif #ifndef WIN32 #include <stdlib.h> #include <string.h> #include <ctype.h> typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; typedef unsigned int UINT; typedef DWORD COLORREF; typedef unsigned int HANDLE; typedef void* HRGN; #define BOOL bool #define TRUE true #define FALSE false typedef struct tagRECT { long left; long top; long right; long bottom; } RECT; typedef struct tagPOINT { long x; long y; } POINT; typedef struct tagRGBQUAD { BYTE rgbBlue; BYTE rgbGreen; BYTE rgbRed; BYTE rgbReserved; } RGBQUAD; #pragma pack(1) typedef struct tagBITMAPINFOHEADER{ DWORD biSize; long biWidth; long biHeight; WORD biPlanes; WORD biBitCount; DWORD biCompression; DWORD biSizeImage; long biXPelsPerMeter; long biYPelsPerMeter; DWORD biClrUsed; DWORD biClrImportant; } BITMAPINFOHEADER; typedef struct tagBITMAPFILEHEADER { WORD bfType; DWORD bfSize; WORD bfReserved1; WORD bfReserved2; DWORD bfOffBits; } BITMAPFILEHEADER; typedef struct tagBITMAPCOREHEADER { DWORD bcSize; WORD bcWidth; WORD bcHeight; WORD bcPlanes; WORD bcBitCount; } BITMAPCOREHEADER; typedef struct tagRGBTRIPLE { BYTE rgbtBlue; BYTE rgbtGreen; BYTE rgbtRed; } RGBTRIPLE; #pragma pack() #define BI_RGB 0L #define BI_RLE8 1L #define BI_RLE4 2L #define BI_BITFIELDS 3L #define GetRValue(rgb) ((BYTE)(rgb)) #define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8)) #define GetBValue(rgb) ((BYTE)((rgb)>>16)) #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) #ifndef _COMPLEX_DEFINED typedef struct tagcomplex { double x,y; } _complex; #endif #define _cabs(c) sqrt(c.x*c.x+c.y*c.y) #endif #endif //__ximadefs --- NEW FILE: ximage.h --- /* * File: ximage.h * Purpose: General Purpose Image Class */ /* === C R E D I T S & D I S C L A I M E R S ============== * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * CxImage (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it * CxImage version 5.99a 08/Feb/2004 * See the file history.htm for the complete bugfix and news report. * * original CImage and CImageIterator implementation are: * Copyright: (c) 1995, Alejandro Aguilar Sierra <asierra(at)servidor(dot)unam(dot)mx> * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__CXIMAGE_H) #define __CXIMAGE_H #if _MSC_VER > 1000 #pragma once #endif ///////////////////////////////////////////////////////////////////////////// // CxImage supported features #define CXIMAGE_SUPPORT_ALPHA 1 #define CXIMAGE_SUPPORT_SELECTION 0 #define CXIMAGE_SUPPORT_TRANSFORMATION 0 #define CXIMAGE_SUPPORT_DSP 0 #define CXIMAGE_SUPPORT_LAYERS 0 #define CXIMAGE_SUPPORT_DECODE 1 #define CXIMAGE_SUPPORT_ENCODE 0 //<vho><T.Peck> #define CXIMAGE_SUPPORT_WINDOWS 1 #define CXIMAGE_SUPPORT_WINCE 0 //<T.Peck> ///////////////////////////////////////////////////////////////////////////// // CxImage supported formats #define CXIMAGE_SUPPORT_BMP 1 #define CXIMAGE_SUPPORT_GIF 0 #define CXIMAGE_SUPPORT_JPG 1 #define CXIMAGE_SUPPORT_PNG 1 #define CXIMAGE_SUPPORT_MNG 0 #define CXIMAGE_SUPPORT_ICO 0 #define CXIMAGE_SUPPORT_TIF 0 #define CXIMAGE_SUPPORT_TGA 0 #define CXIMAGE_SUPPORT_PCX 0 #define CXIMAGE_SUPPORT_WBMP 0 #define CXIMAGE_SUPPORT_WMF 0 #define CXIMAGE_SUPPORT_J2K 0 // Beta, use JP2 #define CXIMAGE_SUPPORT_JBG 0 // GPL'd see ../jbig/copying.txt & ../jbig/patents.htm #define CXIMAGE_SUPPORT_JP2 0 #define CXIMAGE_SUPPORT_JPC 0 #define CXIMAGE_SUPPORT_PGX 0 #define CXIMAGE_SUPPORT_PNM 0 #define CXIMAGE_SUPPORT_RAS 0 ///////////////////////////////////////////////////////////////////////////// #include <TCHAR.h> // For UNICODE support #include "xfile.h" #include "xiofile.h" #include "xmemfile.h" #include "ximadefs.h" //<vho> adjust some #define ///////////////////////////////////////////////////////////////////////////// // CxImage formats enumerator enum ENUM_CXIMAGE_FORMATS{ CXIMAGE_FORMAT_UNKNOWN, #if CXIMAGE_SUPPORT_BMP CXIMAGE_FORMAT_BMP, #endif #if CXIMAGE_SUPPORT_GIF CXIMAGE_FORMAT_GIF, #endif #if CXIMAGE_SUPPORT_JPG CXIMAGE_FORMAT_JPG, #endif #if CXIMAGE_SUPPORT_PNG CXIMAGE_FORMAT_PNG, #endif #if CXIMAGE_SUPPORT_MNG CXIMAGE_FORMAT_MNG, #endif #if CXIMAGE_SUPPORT_ICO CXIMAGE_FORMAT_ICO, #endif #if CXIMAGE_SUPPORT_TIF CXIMAGE_FORMAT_TIF, #endif #if CXIMAGE_SUPPORT_TGA CXIMAGE_FORMAT_TGA, #endif #if CXIMAGE_SUPPORT_PCX CXIMAGE_FORMAT_PCX, #endif #if CXIMAGE_SUPPORT_WBMP CXIMAGE_FORMAT_WBMP, #endif #if CXIMAGE_SUPPORT_WMF CXIMAGE_FORMAT_WMF, #endif #if CXIMAGE_SUPPORT_J2K CXIMAGE_FORMAT_J2K, #endif #if CXIMAGE_SUPPORT_JBG CXIMAGE_FORMAT_JBG, #endif #if CXIMAGE_SUPPORT_JP2 CXIMAGE_FORMAT_JP2, #endif #if CXIMAGE_SUPPORT_JPC CXIMAGE_FORMAT_JPC, #endif #if CXIMAGE_SUPPORT_PGX CXIMAGE_FORMAT_PGX, #endif #if CXIMAGE_SUPPORT_PNM CXIMAGE_FORMAT_PNM, #endif #if CXIMAGE_SUPPORT_RAS CXIMAGE_FORMAT_RAS, #endif CMAX_IMAGE_FORMATS }; //color to grey mapping <H. Muelner> <jurgene> //#define RGB2GRAY(r,g,b) (((b)*114 + (g)*587 + (r)*299)/1000) #define RGB2GRAY(r,g,b) (((b)*117 + (g)*601 + (r)*306) >> 10) struct rgb_color { BYTE r,g,b; }; // <VATI> text placement data // members must be initialized with the InitTextInfo(&this) function. typedef struct DLL_EXP tagCxTextInfo { char text[4096]; // text LOGFONT lfont; // font and codepage data COLORREF fcolor; // foreground color long align; // DT_CENTER, DT_RIGHT, DT_LEFT aligment for multiline text BYTE opaque; // text has background or hasn't. Default is true. // data for background (ignored if .opaque==FALSE) COLORREF bcolor; // background color float b_opacity; // opacity value for background between 0.0-1.0 Default is 0. (opaque) BYTE b_outline; // outline width for background (zero: no outline) BYTE b_round; // rounding radius for background rectangle. % of the height, between 0-50. Default is 10. // (backgr. always has a frame: width = 3 pixel + 10% of height by default.) } CXTEXTINFO; ///////////////////////////////////////////////////////////////////////////// // CxImage class ///////////////////////////////////////////////////////////////////////////// class DLL_EXP CxImage { //extensible information collector typedef struct tagCxImageInfo { DWORD dwEffWidth; //DWORD aligned scan line width BYTE* pImage; //THE IMAGE BITS CxImage* pGhost; //if this is a ghost, pGhost points to the body CxImage* pParent; //if this is a layer, pParent points to the body DWORD dwType; //original image format char szLastError[256]; //debugging long nProgress; //monitor long nEscape; //escape long nBkgndIndex; //used for GIF, PNG, MNG RGBQUAD nBkgndColor; //used for RGB transparency BYTE nQuality; //used for JPEG BYTE nScale; //used for JPEG <ignacio> long nFrame; //used for TIF, GIF, MNG : actual frame long nNumFrames; //used for TIF, GIF, MNG : total number of frames DWORD dwFrameDelay; //used for GIF, MNG long xDPI; //horizontal resolution long yDPI; //vertical resolution RECT rSelectionBox; //bounding rectangle BYTE nAlphaMax; //max opacity (fade) bool bAlphaPaletteEnabled; //true if alpha values in the palette are enabled. bool bEnabled; //enables the painting functions long xOffset; long yOffset; DWORD dwCodecOption; //for GIF, TIF : 0=def.1=unc,2=fax3,3=fax4,4=pack,5=jpg RGBQUAD last_c; //for GetNearestIndex optimization BYTE last_c_index; bool last_c_isvalid; long nNumLayers; DWORD dwFlags; // 0x??00000 = reserved, 0x00??0000 = blend mode, 0x0000???? = layer id - user flags } CXIMAGEINFO; public: //constructors CxImage(DWORD imagetype = 0); CxImage(DWORD dwWidth, DWORD dwHeight, DWORD wBpp, DWORD imagetype = 0); CxImage(const CxImage &src, bool copypixels = true, bool copyselection = true, bool copyalpha = true); CxImage(const TCHAR * filename, DWORD imagetype); // For UNICODE support: char -> TCHAR // CxImage(const char * filename, DWORD imagetype); CxImage(FILE * stream, DWORD imagetype); CxImage(CxFile * stream, DWORD imagetype); CxImage(BYTE * buffer, DWORD size, DWORD imagetype); virtual ~CxImage() { Destroy(); }; CxImage& operator = (const CxImage&); //initializzation void* Create(DWORD dwWidth, DWORD dwHeight, DWORD wBpp, DWORD imagetype = 0); bool Destroy(); void Clear(BYTE bval=0); void Copy(const CxImage &src, bool copypixels = true, bool copyselection = true, bool copyalpha = true); bool Transfer(CxImage &from); bool CreateFromArray(BYTE* pArray,DWORD dwWidth,DWORD dwHeight,DWORD dwBitsperpixel, DWORD dwBytesperline, bool bFlipImage); bool CreateFromMatrix(BYTE** ppMatrix,DWORD dwWidth,DWORD dwHeight,DWORD dwBitsperpixel, DWORD dwBytesperline, bool bFlipImage); //Attributes long GetSize(); BYTE* GetBits(DWORD row = 0); BYTE GetColorType(); void* GetDIB() const {return pDib;} DWORD GetHeight() const {return head.biHeight;} DWORD GetWidth() const {return head.biWidth;} DWORD GetEffWidth() const {return info.dwEffWidth;} DWORD GetNumColors() const {return head.biClrUsed;} WORD GetBpp() const {return head.biBitCount;} DWORD GetType() const {return info.dwType;} char* GetLastError() {return info.szLastError;} const TCHAR* GetVersion(); DWORD GetFrameDelay() const {return info.dwFrameDelay;} void SetFrameDelay(DWORD d) {info.dwFrameDelay=d;} void GetOffset(long *x,long *y) {*x=info.xOffset; *y=info.yOffset;} void SetOffset(long x,long y) {info.xOffset=x; info.yOffset=y;} BYTE GetJpegQuality() const {return info.nQuality;} void SetJpegQuality(BYTE q) {info.nQuality = q;} //<ignacio> used for scaling down during JPEG decoding valid numbers are 1, 2, 4, 8 BYTE GetJpegScale() const {return info.nScale;} void SetJpegScale(BYTE q) {info.nScale = q;} long GetXDPI() const {return info.xDPI;} long GetYDPI() const {return info.yDPI;} void SetXDPI(long dpi); void SetYDPI(long dpi); DWORD GetClrImportant() const {return head.biClrImportant;} void SetClrImportant(DWORD ncolors = 0); long GetProgress() const {return info.nProgress;} long GetEscape() const {return info.nEscape;} void SetProgress(long p) {info.nProgress = p;} void SetEscape(long i) {info.nEscape = i;} long GetTransIndex() const {return info.nBkgndIndex;} RGBQUAD GetTransColor(); void SetTransIndex(long idx) {info.nBkgndIndex = idx;} void SetTransColor(RGBQUAD rgb) {rgb.rgbReserved=0; info.nBkgndColor = rgb;} bool IsTransparent() const {return info.nBkgndIndex>=0;} // <vho> DWORD GetCodecOption() const {return info.dwCodecOption;} void SetCodecOption(DWORD opt) {info.dwCodecOption = opt;} DWORD GetFlags() const {return info.dwFlags;} void SetFlags(DWORD flags, bool bLockReservedFlags = true); //void* GetUserData() const {return info.pUserData;} //void SetUserData(void* pUserData) {info.pUserData = pUserData;} //palette operations bool IsGrayScale(); bool IsIndexed() {return head.biClrUsed!=0;} DWORD GetPaletteSize(); RGBQUAD* GetPalette() const; RGBQUAD GetPaletteColor(BYTE idx); bool GetPaletteColor(BYTE i, BYTE* r, BYTE* g, BYTE* b); BYTE GetNearestIndex(RGBQUAD c); void BlendPalette(COLORREF cr,long perc); void SetGrayPalette(); void SetPalette(DWORD n, BYTE *r, BYTE *g, BYTE *b); void SetPalette(RGBQUAD* pPal,DWORD nColors=256); void SetPalette(rgb_color *rgb,DWORD nColors=256); void SetPaletteColor(BYTE idx, BYTE r, BYTE g, BYTE b, BYTE alpha=0); void SetPaletteColor(BYTE idx, RGBQUAD c); void SetPaletteColor(BYTE idx, COLORREF cr); void SwapIndex(BYTE idx1, BYTE idx2); void SetStdPalette(); //pixel operations bool IsInside(long x, long y); bool IsTransparent(long x,long y); RGBQUAD GetPixelColor(long x,long y, bool bGetAlpha = true); BYTE GetPixelIndex(long x,long y); BYTE GetPixelGray(long x, long y); void SetPixelColor(long x,long y,RGBQUAD c, bool bSetAlpha = false); void SetPixelColor(long x,long y,COLORREF cr); void SetPixelIndex(long x,long y,BYTE i); void DrawLine(int StartX, int EndX, int StartY, int EndY, RGBQUAD color, bool bSetAlpha=false); void DrawLine(int StartX, int EndX, int StartY, int EndY, COLORREF cr); //painting operations #if CXIMAGE_SUPPORT_WINCE long Blt(HDC pDC, long x=0, long y=0); #endif #if CXIMAGE_SUPPORT_WINDOWS HBITMAP MakeBitmap(HDC hdc = NULL); HANDLE CopyToHandle(); bool CreateFromHANDLE(HANDLE hMem); //Windows objects (clipboard) bool CreateFromHBITMAP(HBITMAP hbmp, HPALETTE hpal=0); //Windows resource bool CreateFromHICON(HICON hico); long Draw(HDC hdc, long x=0, long y=0, long cx = -1, long cy = -1, RECT* pClipRect = 0); long Draw(HDC hdc, const RECT& rect, RECT* pClipRect=NULL) { return Draw(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, pClipRect); } long Stretch(HDC hdc, long xoffset, long yoffset, long xsize, long ysize, DWORD dwRop = SRCCOPY); long Stretch(HDC hdc, const RECT& rect, DWORD dwRop = SRCCOPY) { return Stretch(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, dwRop); } long Tile(HDC hdc, RECT *rc); long Draw2(HDC hdc, long x=0, long y=0, long cx = -1, long cy = -1); long Draw2(HDC hdc, const RECT& rect) { return Draw2(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); } //long DrawString(HDC hdc, long x, long y, const char* text, RGBQUAD color, const char* font, long lSize=0, long lWeight=400, BYTE bItalic=0, BYTE bUnderline=0, bool bSetAlpha=false); long DrawString(HDC hdc, long x, long y, const TCHAR* text, RGBQUAD color, const TCHAR* font, long lSize=0, long lWeight=400, BYTE bItalic=0, BYTE bUnderline=0, bool bSetAlpha=false); // <VATI> extensions long DrawStringEx(HDC hdc, long x, long y, CXTEXTINFO *pTextType, bool bSetAlpha=false ); void InitTextInfo( CXTEXTINFO *txt ); #endif //CXIMAGE_SUPPORT_WINDOWS // file operations #if CXIMAGE_SUPPORT_DECODE #ifdef WIN32 //bool Load(LPCWSTR filename, DWORD imagetype=0); bool LoadResource(HRSRC hRes, DWORD imagetype, HMODULE hModule=NULL); #endif // For UNICODE support: char -> TCHAR bool Load(const TCHAR* filename, DWORD imagetype=0); //bool Load(const char * filename, DWORD imagetype=0); bool Decode(FILE * hFile, DWORD imagetype); bool Decode(CxFile * hFile, DWORD imagetype); bool Decode(BYTE * buffer, DWORD size, DWORD imagetype); #endif //CXIMAGE_SUPPORT_DECODE #if CXIMAGE_SUPPORT_ENCODE protected: bool EncodeSafeCheck(CxFile *hFile); public: #ifdef WIN32 //bool Save(LPCWSTR filename, DWORD imagetype=0); #endif // For UNICODE support: char -> TCHAR bool Save(const TCHAR* filename, DWORD imagetype=0); //bool Save(const char * filename, DWORD imagetype=0); bool Encode(FILE * hFile, DWORD imagetype); bool Encode(CxFile * hFile, DWORD imagetype); bool Encode(CxFile * hFile, CxImage ** pImages, int pagecount, DWORD imagetype); bool Encode(FILE *hFile, CxImage ** pImages, int pagecount, DWORD imagetype); bool Encode(BYTE * &buffer, long &size, DWORD imagetype); #endif //CXIMAGE_SUPPORT_ENCODE //misc. bool IsValid() const {return pDib!=0;} bool IsEnabled() const {return info.bEnabled;} void Enable(bool enable=true){info.bEnabled=enable;} // frame operations long GetNumFrames() const {return info.nNumFrames;} long GetFrame() const {return info.nFrame;} void SetFrame(long nFrame) {info.nFrame=nFrame;} #if CXIMAGE_SUPPORT_BASICTRANSFORMATIONS bool GrayScale(); bool Flip(); bool Mirror(); bool Negative(); bool RotateLeft(CxImage* iDst = NULL); bool RotateRight(CxImage* iDst = NULL); #endif //CXIMAGE_SUPPORT_BASICTRANSFORMATIONS #if CXIMAGE_SUPPORT_TRANSFORMATION // image operations bool Rotate(float angle, CxImage* iDst = NULL); bool Rotate180(CxImage* iDst = NULL); bool Resample(long newx, long newy, int mode = 1, CxImage* iDst = NULL); bool DecreaseBpp(DWORD nbit, bool errordiffusion, RGBQUAD* ppal = 0, DWORD clrimportant = 0); bool IncreaseBpp(DWORD nbit); bool Dither(long method = 0); bool Crop(long left, long top, long right, long bottom, CxImage* iDst = NULL); bool Crop(const RECT& rect, CxImage* iDst = NULL) { return Crop(rect.left, rect.top, rect.right, rect.bottom, iDst); } bool CropRotatedRectangle( long topx, long topy, long width, long height, float angle, CxImage* iDst = NULL); bool Skew(float xgain, float ygain, long xpivot=0, long ypivot=0); bool Expand(long left, long top, long right, long bottom, RGBQUAD canvascolor, CxImage* iDst = 0); bool Expand(long newx, long newy, RGBQUAD canvascolor, CxImage* iDst = 0); bool Thumbnail(long newx, long newy, RGBQUAD canvascolor, CxImage* iDst = 0); bool CircleTransform(int type,long rmax=0,float Koeff=1.0f); protected: float b3spline(float x); public: #endif //CXIMAGE_SUPPORT_TRANSFORMATION #if CXIMAGE_SUPPORT_DSP bool Contour(); bool HistogramStretch(long method = 0); bool HistogramEqualize(); bool HistogramNormalize(); bool HistogramRoot(); bool HistogramLog(); long Histogram(long* red, long* green = 0, long* blue = 0, long* gray = 0, long colorspace = 0); bool Jitter(long radius=2); bool Repair(float radius = 0.25f, long niterations = 1, long colorspace = 0); bool Combine(CxImage* r,CxImage* g,CxImage* b,CxImage* a, long colorspace = 0); bool FFT2(CxImage* srcReal, CxImage* srcImag, CxImage* dstReal, CxImage* dstImag, long direction = 1, bool bForceFFT = true, bool bMagnitude = true); bool Noise(long level); bool Median(long Ksize=3); bool Gamma(float gamma); bool ShiftRGB(long r, long g, long b); bool Threshold(BYTE level); bool Colorize(BYTE hue, BYTE sat); bool Light(long brightness, long contrast = 0); float Mean(); bool Filter(long* kernel, long Ksize, long Kfactor, long Koffset); bool Erode(long Ksize=2); bool Dilate(long Ksize=2); void HuePalette(float correction=1); enum ImageOpType { OpAdd, OpAnd, OpXor, OpOr, OpMask, OpSrcCopy, OpDstCopy, OpSub, OpSrcBlend }; void Mix(CxImage & imgsrc2, ImageOpType op, long lXOffset = 0, long lYOffset = 0); void MixFrom(CxImage & imagesrc2, long lXOffset, long lYOffset); bool UnsharpMask(float radius = 5.0, float amount = 0.5, int threshold = 0); bool Lut(BYTE* pLut); bool Lut(BYTE* pLutR, BYTE* pLutG, BYTE* pLutB, BYTE* pLutA = 0); protected: bool IsPowerof2(long x); bool FFT(int dir,int m,double *x,double *y); bool DFT(int dir,long m,double *x1,double *y1,double *x2,double *y2); bool RepairChannel(CxImage *ch, float radius); // <nipper> int gen_convolve_matrix (float radius, float **cmatrix_p); float* gen_lookup_table (float *cmatrix, int cmatrix_length); void blur_line (float *ctable, float *cmatrix, int cmatrix_length, BYTE* cur_col, BYTE* dest_col, int y, long bytes); public: //color conversion utilities bool SplitRGB(CxImage* r,CxImage* g,CxImage* b); bool SplitYUV(CxImage* y,CxImage* u,CxImage* v); bool SplitHSL(CxImage* h,CxImage* s,CxImage* l); bool SplitYIQ(CxImage* y,CxImage* i,CxImage* q); bool SplitXYZ(CxImage* x,CxImage* y,CxImage* z); bool SplitCMYK(CxImage* c,CxImage* m,CxImage* y,CxImage* k); RGBQUAD HSLtoRGB(COLORREF cHSLColor); RGBQUAD RGBtoHSL(RGBQUAD lRGBColor); RGBQUAD HSLtoRGB(RGBQUAD lHSLColor); RGBQUAD YUVtoRGB(RGBQUAD lYUVColor); RGBQUAD RGBtoYUV(RGBQUAD lRGBColor); RGBQUAD YIQtoRGB(RGBQUAD lYIQColor); RGBQUAD RGBtoYIQ(RGBQUAD lRGBColor); RGBQUAD XYZtoRGB(RGBQUAD lXYZColor); RGBQUAD RGBtoXYZ(RGBQUAD lRGBColor); #endif //CXIMAGE_SUPPORT_DSP RGBQUAD RGBtoRGBQUAD(COLORREF cr); COLORREF RGBQUADtoRGB (RGBQUAD c); #if CXIMAGE_SUPPORT_SELECTION //selection bool SelectionClear(); bool SelectionCreate(); bool SelectionDelete(); bool SelectionInvert(); bool SelectionAddRect(RECT r); bool SelectionAddEllipse(RECT r); bool SelectionAddPolygon(POINT *points, long npoints); bool SelectionAddColor(RGBQUAD c); bool SelectionAddPixel(int x, int y); bool SelectionCopy(CxImage &from); bool SelectionIsInside(long x, long y); bool SelectionIsValid(){return pSelection!=0;} void SelectionGetBox(RECT& r){memcpy(&r,&info.rSelectionBox,sizeof(RECT));} bool SelectionToHRGN(HRGN& region); #endif //CXIMAGE_SUPPORT_SELECTION #if CXIMAGE_SUPPORT_ALPHA //Alpha void AlphaClear(); void AlphaCreate(); void AlphaDelete(); void AlphaInvert(); bool AlphaMirror(); bool AlphaFlip(); bool AlphaCopy(CxImage &from); bool AlphaSplit(CxImage *dest); void AlphaStrip(); void AlphaSet(BYTE level); bool AlphaSet(CxImage &from); void AlphaSet(long x,long y,BYTE level); BYTE AlphaGet(long x,long y); BYTE AlphaGetMax() const {return info.nAlphaMax;} void AlphaSetMax(BYTE nAlphaMax) {info.nAlphaMax=nAlphaMax;} bool AlphaIsValid(){return pAlpha!=0;} BYTE* AlphaGetBits() const {return pAlpha;} void AlphaPaletteClear(); void AlphaPaletteEnable(bool enable=true){info.bAlphaPaletteEnabled=enable;} bool AlphaPaletteIsEnabled(){return info.bAlphaPaletteEnabled;} bool AlphaPaletteIsValid(); bool AlphaPaletteSplit(CxImage *dest); #endif //CXIMAGE_SUPPORT_ALPHA #if CXIMAGE_SUPPORT_LAYERS bool LayerCreate(long position = -1); bool LayerDelete(long position = -1); void LayerDeleteAll(); CxImage* GetLayer(long position); CxImage* GetParent() const {return info.pParent;} long GetNumLayers() const {return info.nNumLayers;} #endif //CXIMAGE_SUPPORT_LAYERS protected: void Startup(DWORD imagetype = 0); void CopyInfo(const CxImage &src); void Ghost(CxImage *src); void RGBtoBGR(BYTE *buffer, int length); float HueToRGB(float n1,float n2, float hue); void Bitfield2RGB(BYTE *src, WORD redmask, WORD greenmask, WORD bluemask, BYTE bpp); static int CompareColors(const void *elem1, const void *elem2); void* pDib; //contains the header, the palette, the pixels BITMAPINFOHEADER head; //standard header CXIMAGEINFO info; //extended information BYTE* pSelection; //selected region BYTE* pAlpha; //alpha channel CxImage** pLayers; //generic layers }; //////////////////////////////////////////////////////////////////////////// #define CXIMAGE_MAX_MEMORY 256000000 #define CXIMAGE_ERR_NOFILE "null file handler" #define CXIMAGE_ERR_NOIMAGE "null image!!!" //////////////////////////////////////////////////////////////////////////// #endif // !defined(__CXIMAGE_H) --- NEW FILE: ximagif.h --- /* * File: ximagif.h * Purpose: GIF Image Class Loader and Writer */ /* === C R E D I T S & D I S C L A I M E R S ============== * CxImageGIF (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * CxImage version 5.99a 08/Feb/2004 * See the file history.htm for the complete bugfix and news report. * * Special thanks to Troels Knakkergaard for new features, enhancements and bugfixes * * original CImageGIF and CImageIterator implementation are: * Copyright: (c) 1995, Alejandro Aguilar Sierra <asierra(at)servidor(dot)unam(dot)mx> * * 6/15/97 Randy Spann: Added GIF87a writing support * R....@Co... * * DECODE.C - An LZW decoder for GIF * Copyright (C) 1987, by Steven A. Bennett * Copyright (C) 1994, C++ version by Alejandro Aguilar Sierra * * In accordance with the above, I want to credit Steve Wilhite who wrote * the code which this is heavily inspired by... * * GIF and 'Graphics Interchange Format' are trademarks (tm) of * Compuserve, Incorporated, an H&R Block Company. * * Release Notes: This file contains a decoder routine for GIF images * which is similar, structurally, to the original routine by Steve Wilhite. * It is, however, somewhat noticably faster in most cases. * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__ximaGIF_h) #define __ximaGIF_h #include "ximage.h" #if CXIMAGE_SUPPORT_GIF typedef short int code_int; /* Various error codes used by decoder */ #define OUT_OF_MEMORY -10 #define BAD_CODE_SIZE -20 #define READ_ERROR -1 #define WRITE_ERROR -2 #define OPEN_ERROR -3 #define CREATE_ERROR -4 #define MAX_CODES 4095 #define GIFBUFTAM 16384 #define TRANSPARENCY_CODE 0xF9 //LZW GIF Image compression #define MAXBITSCODES 12 #define HSIZE 5003 /* 80% occupancy */ #define MAXCODE(n_bits) (((code_int) 1 << (n_bits)) - 1) #define HashTabOf(i) htab[i] #define CodeTabOf(i) codetab[i] class CImageIterator; class DLL_EXP CxImageGIF: public CxImage { #pragma pack(1) typedef struct tag_gifgce{ BYTE transpcolflag:1; BYTE userinputflag:1; BYTE dispmeth:3; BYTE res:3; WORD delaytime; BYTE transpcolindex; } struct_gifgce; typedef struct tag_dscgif{ /* Logic Screen Descriptor */ char header[6]; /* Firma and version */ WORD scrwidth; WORD scrheight; char pflds; char bcindx; char pxasrat; } struct_dscgif; typedef struct tag_image{ /* Image Descriptor */ WORD l; WORD t; WORD w; WORD h; BYTE pf; } struct_image; typedef struct tag_TabCol{ /* Tabla de colores */ short colres; /* color resolution */ short sogct; /* size of global color table */ rgb_color paleta[256]; /* paleta */ } struct_TabCol; typedef struct tag_RLE{ int rl_pixel; int rl_basecode; int rl_count; int rl_table_pixel; int rl_table_max; int just_cleared; int out_bits; int out_bits_init; int out_count; int out_bump; int out_bump_init; int out_clear; int out_clear_init; int max_ocodes; int code_clear; int code_eof; unsigned int obuf; int obits; unsigned char oblock[256]; int oblen; } struct_RLE; #pragma pack() public: CxImageGIF(): CxImage(CXIMAGE_FORMAT_GIF) {m_loops=0; m_dispmeth=0; m_comment[0]='\0';} // bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_GIF);} // bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_GIF);} bool Decode(CxFile * fp); bool Decode(FILE *fp) { CxIOFile file(fp); return Decode(&file); } #if CXIMAGE_SUPPORT_ENCODE bool Encode(CxFile * fp); bool Encode(CxFile * fp, CxImage ** pImages, int pagecount, bool bLocalColorMap = false); bool Encode(FILE *fp) { CxIOFile file(fp); return Encode(&file); } bool Encode(FILE *fp, CxImage ** pImages, int pagecount, bool bLocalColorMap = false) { CxIOFile file(fp); return Encode(&file, pImages, pagecount, bLocalColorMap); } #endif // CXIMAGE_SUPPORT_ENCODE void SetLoops(int loops); long GetLoops(); void SetComment(const char* sz_comment_in); void GetComment(char* sz_comment_out); void SetDisposalMethod(int dm); long GetDisposalMethod(); protected: bool DecodeExtension(CxFile *fp); void EncodeHeader(CxFile *fp); void EncodeLoopExtension(CxFile *fp); void EncodeExtension(CxFile *fp); void EncodeBody(CxFile *fp, bool bLocalColorMap = false); void EncodeComment(CxFile *fp); bool EncodeRGB(CxFile *fp); void GifMix(CxImage & imgsrc2, long lxOffset, long lyOffset); struct_gifgce gifgce; int curx, cury; long CountDown; unsigned long cur_accum; int cur_bits; int interlaced, iypos, istep, iheight, ipass; int ibf; int ibfmax; BYTE buf[GIFBUFTAM + 1]; // Implementation int GifNextPixel (); void Putword (int w, CxFile* fp ); void compressNONE (int init_bits, CxFile* outfile); void compressLZW (int init_bits, CxFile* outfile); void output (code_int code ); void cl_hash (long hsize); void char_out (int c); void flush_char (); short init_exp(short size); short get_next_code(CxFile*); short decoder(CxFile*, CImageIterator* iter, short linewidth, int &bad_code_count); int get_byte(CxFile*); int out_line(CImageIterator* iter, unsigned char *pixels, int linelen); int get_num_frames(CxFile *f,struct_TabCol* TabColSrc); short curr_size; /* The current code size */ short clear; /* Value for a clear code */ short ending; /* Value for a ending code */ short newcodes; /* First available code */ short top_slot; /* Highest code for current size */ short slot; /* Last read code */ /* The following static variables are used * for seperating out codes */ short navail_bytes; /* # bytes left in block */ short nbits_left; /* # bits left in current BYTE */ BYTE b1; /* Current BYTE */ BYTE byte_buff[257]; /* Current block */ BYTE *pbytes; /* Pointer to next BYTE in block */ /* The reason we have these seperated like this instead of using * a structure like the original Wilhite code did, is because this * stuff generally produces significantly faster code when compiled... * This code is full of similar speedups... (For a good book on writing * C for speed or for space optomisation, see Efficient C by Tom Plum, * published by Plum-Hall Associates...) */ BYTE stack[MAX_CODES + 1]; /* Stack for storing pixels */ BYTE suffix[MAX_CODES + 1]; /* Suffix table */ WORD prefix[MAX_CODES + 1]; /* Prefix linked list */ //LZW GIF Image compression routines long htab [HSIZE]; unsigned short codetab [HSIZE]; int n_bits; /* number of bits/code */ code_int maxcode; /* maximum code, given n_bits */ code_int free_ent; /* first unused entry */ int clear_flg; int g_init_bits; CxFile* g_outfile; int ClearCode; int EOFCode; int a_count; char accum[256]; char m_comment[256]; int m_loops; int m_dispmeth; //RLE compression routines void compressRLE( int init_bits, CxFile* outfile); void rle_clear(struct_RLE* rle); void rle_flush(struct_RLE* rle); void rle_flush_withtable(int count, struct_RLE* rle); void rle_flush_clearorrep(int count, struct_RLE* rle); void rle_flush_fromclear(int count,struct_RLE* rle); void rle_output_plain(int c,struct_RLE* rle); void rle_reset_out_clear(struct_RLE* rle); unsigned int rle_compute_triangle_count(unsigned int count, unsigned int nrepcodes); unsigned int rle_isqrt(unsigned int x); void rle_write_block(struct_RLE* rle); void rle_block_out(unsigned char c, struct_RLE* rle); void rle_block_flush(struct_RLE* rle); void rle_output(int val, struct_RLE* rle); void rle_output_flush(struct_RLE* rle); }; #endif #endif --- NEW FILE: ximaico.h --- /* * File: ximaico.h * Purpose: ICON Image Class Loader and Writer */ /* === C R E D I T S & D I S C L A I M E R S ============== * CxImageICO (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * CxImage version 5.99a 08/Feb/2004 * See the file history.htm for the complete bugfix and news report. * * Parts of the code come from FreeImage 2 * Design and implementation by Floris van den Berg <flvdberg(at)wxs(dot)nl> * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__ximaICO_h) #define __ximaICO_h #include "ximage.h" #if CXIMAGE_SUPPORT_ICO class CxImageICO: public CxImage { typedef struct tagIconDirectoryEntry { BYTE bWidth; BYTE bHeight; BYTE bColorCount; BYTE bReserved; WORD wPlanes; WORD wBitCount; DWORD dwBytesInRes; DWORD dwImageOffset; } ICONDIRENTRY; typedef struct tagIconDir { WORD idReserved; WORD idType; WORD idCount; } ICONHEADER; public: CxImageICO(): CxImage(CXIMAGE_FORMAT_ICO) {} // bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_ICO);} // bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_ICO);} bool Decode(CxFile * hFile); bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } #if CXIMAGE_SUPPORT_ENCODE bool Encode(CxFile * hFile); bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } #endif // CXIMAGE_SUPPORT_ENCODE }; #endif #endif --- NEW FILE: ximaiter.h --- /* * File: ImaIter.h * Purpose: Declaration of the Platform Independent Image Base Class * Author: Alejandro Aguilar Sierra * Created: 1995 * Copyright: (c) 1995, Alejandro Aguilar Sierra <asierra(at)servidor(dot)unam(dot)mx> * * 07/08/2001 Davide Pizzolato - www.xdp.it * - removed slow loops * - added safe checks * * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__ImaIter_h) #define __ImaIter_h #include "ximage.h" #include "ximadefs.h" class CImageIterator { friend class CxImage; protected: int Itx, Ity; // Counters int Stepx, Stepy; BYTE* IterImage; // Image pointer CxImage *ima; public: // Constructors CImageIterator ( void ); CImageIterator ( CxImage *image ); operator CxImage* (); // Iterators BOOL ItOK (); void Reset (); void Upset (); void SetRow(BYTE *buf, int n); void GetRow(BYTE *buf, int n); BYTE GetByte( ) { return IterImage[Itx]; } void SetByte(BYTE b) { IterImage[Itx] = b; } BYTE* GetRow(void); BYTE* GetRow(int n); BOOL NextRow(); BOOL PrevRow(); BOOL NextByte(); BOOL PrevByte(); void SetSteps(int x, int y=0) { Stepx = x; Stepy = y; } void GetSteps(int *x, int *y) { *x = Stepx; *y = Stepy; } BOOL NextStep(); BOOL PrevStep(); void SetY(int y); /* AD - for interlace */ int GetY() {return Ity;} BOOL GetCol(BYTE* pCol, DWORD x); BOOL SetCol(BYTE* pCol, DWORD x); }; ///////////////////////////////////////////////////////////////////// inline CImageIterator::CImageIterator(void) { ima = 0; IterImage = 0; Itx = Ity = 0; Stepx = Stepy = 0; } ///////////////////////////////////////////////////////////////////// inline CImageIterator::CImageIterator(CxImage *imageImpl): ima(imageImpl) { if (ima) IterImage = ima->GetBits(); Itx = Ity = 0; Stepx = Stepy = 0; } ///////////////////////////////////////////////////////////////////// inline CImageIterator::operator CxImage* () { return ima; } ///////////////////////////////////////////////////////////////////// inline BOOL CImageIterator::ItOK () { if (ima) return ima->IsInside(Itx, Ity); else return FALSE; } ///////////////////////////////////////////////////////////////////// inline void CImageIterator::Reset() { if (ima) IterImage = ima->GetBits(); else IterImage=0; Itx = Ity = 0; } ///////////////////////////////////////////////////////////////////// inline void CImageIterator::Upset() { Itx = 0; Ity = ima->GetHeight()-1; IterImage = ima->GetBits() + ima->GetEffWidth()*(ima->GetHeight()-1); } ///////////////////////////////////////////////////////////////////// inline BOOL CImageIterator::NextRow() { if (++Ity >= (int)ima->GetHeight()) return 0; IterImage += ima->GetEffWidth(); return 1; } ///////////////////////////////////////////////////////////////////// inline BOOL CImageIterator::PrevRow() { if (--Ity < 0) return 0; IterImage -= ima->GetEffWidth(); return 1; } /* AD - for interlace */ inline void CImageIterator::SetY(int y) { if ((y < 0) || (y > (int)ima->GetHeight())) return; Ity = y; IterImage = ima->GetBits() + ima->GetEffWidth()*y; } ///////////////////////////////////////////////////////////////////// inline void CImageIterator::SetRow(BYTE *buf, int n) { if (n<0) n = (int)ima->GetEffWidth(); else n = min(n,(int)ima->GetEffWidth()); if (IterImage) memcpy(IterImage,buf,n); } ///////////////////////////////////////////////////////////////////// inline void CImageIterator::GetRow(BYTE *buf, int n) { if ((buf!=NULL)&&(n>0)) memcpy(buf,IterImage,n); } ///////////////////////////////////////////////////////////////////// inline BYTE* CImageIterator::GetRow() { return IterImage; } ///////////////////////////////////////////////////////////////////// inline BYTE* CImageIterator::GetRow(int n) { SetY(n); return IterImage; } ///////////////////////////////////////////////////////////////////// inline BOOL CImageIterator::NextByte() { if (++Itx < (int)ima->GetEffWidth()) return 1; else if (++Ity < (int)ima->GetHeight()){ IterImage += ima->GetEffWidth(); Itx = 0; return 1; } else return 0; } ///////////////////////////////////////////////////////////////////// inline BOOL CImageIterator::PrevByte() { if (--Itx >= 0) return 1; else if (--Ity >= 0){ IterImage -= ima->GetEffWidth(); Itx = 0; return 1; } else return 0; } ///////////////////////////////////////////////////////////////////// inline BOOL CImageIterator::NextStep() { Itx += Stepx; if (Itx < (int)ima->GetEffWidth()) return 1; else { Ity += Stepy; if (Ity < (int)ima->GetHeight()){ IterImage += ima->GetEffWidth(); Itx = 0; return 1; } else return 0; } } ///////////////////////////////////////////////////////////////////// inline BOOL CImageIterator::PrevStep() { Itx -= Stepx; if (Itx >= 0) return 1; else { Ity -= Stepy; if (Ity >= 0 && Ity < (int)ima->GetHeight()) { IterImage -= ima->GetEffWidth(); Itx = 0; return 1; } else return 0; } } ///////////////////////////////////////////////////////////////////// inline BOOL CImageIterator::GetCol(BYTE* pCol, DWORD x) { if ((pCol==0)||(ima->GetBpp()<8)||(x>=ima->GetWidth())) return 0; DWORD h = ima->GetHeight(); DWORD line = ima->GetEffWidth(); BYTE bytes = ima->GetBpp()>>3; BYTE* pSrc; for (DWORD y=0;y<h;y++){ pSrc = ima->GetBits(y) + x*bytes; for (BYTE w=0;w<bytes;w++){ *pCol++=*pSrc++; } } return 1; } ///////////////////////////////////////////////////////////////////// inline BOOL CImageIterator::SetCol(BYTE* pCol, DWORD x) { if ((pCol==0)||(ima->GetBpp()<8)||(x>=ima->GetWidth())) return 0; DWORD h = ima->GetHeight(); DWORD line = ima->GetEffWidth(); BYTE bytes = ima->GetBpp()>>3; BYTE* pSrc; for (DWORD y=0;y<h;y++){ pSrc = ima->GetBits(y) + x*bytes; for (BYTE w=0;w<bytes;w++){ *pSrc++=*pCol++; } } return 1; } ///////////////////////////////////////////////////////////////////// #endif --- NEW FILE: ximaj2k.h --- /* * File: ximaj2k.h * Purpose: J2K Image Class Loader and Writer */ /* === C R E D I T S & D I S C L A I M E R S ============== * CxImageJ2K (c) 04/Aug/2002 Davide Pizzolato - www.xdp.it * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * CxImage version 5.99a 08/Feb/2004 * See the file history.htm for the complete bugfix and news report. * * based on LIBJ2K Copyright (c) 2001-2002, David Janssens - All rights reserved. * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__ximaJ2K_h) #define __ximaJ2K_h #include "ximage.h" #if CXIMAGE_SUPPORT_J2K #define LIBJ2K_EXPORTS extern "C" { #include "../j2k/j2k.h" }; class CxImageJ2K: public CxImage { public: CxImageJ2K(): CxImage(CXIMAGE_FORMAT_J2K) {} // bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_J2K);} // bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_J2K);} bool Decode(CxFile * hFile); bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } #if CXIMAGE_SUPPORT_ENCODE bool Encode(CxFile * hFile); bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } #endif // CXIMAGE_SUPPORT_ENCODE protected: void j2k_calc_explicit_stepsizes(j2k_tccp_t *tccp, int prec); void j2k_encode_stepsize(int stepsize, int numbps, int *expn, int *mant); int j2k_floorlog2(int a); }; #endif #endif --- NEW FILE: ximajas.h --- /* * File: ximajas.h * Purpose: Jasper Image Class Loader and Writer */ /* === C R E D I T S & D I S C L A I M E R S ============== * CxImageJAS (c) 12/Apr/2003 Davide Pizzolato - www.xdp.it * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * CxImage version 5.99a 08/Feb/2004 * See the file history.htm for the complete bugfix and news report. * * based on JasPer Copyright (c) 2001-2003 Michael David Adams - All rights reserved. * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__ximaJAS_h) #define __ximaJAS_h #include "ximage.h" #if CXIMAGE_SUPPORT_JASPER #include "..\jasper\include\jasper\jasper.h" class CxImageJAS: public CxImage { public: CxImageJAS(): CxImage(0) {} // bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,0);} // bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,0);} bool Decode(CxFile * hFile, DWORD imagetype = 0); bool Decode(FILE *hFile, DWORD imagetype = 0) { CxIOFile file(hFile); return Decode(&file,imagetype); } #if CXIMAGE_SUPPORT_ENCODE bool Encode(CxFile * hFile, DWORD imagetype = 0); bool Encode(FILE *hFile, DWORD imagetype = 0) { CxIOFile file(hFile); return Encode(&file,imagetype); } #endif // CXIMAGE_SUPPORT_ENCODE protected: class CxFileJas { public: CxFileJas(CxFile* pFile,jas_stream_t *stream) { if (stream->obj_) jas_free(stream->obj_); stream->obj_ = pFile; stream->ops_->close_ = JasClose; stream->ops_->read_ = JasRead; stream->ops_->seek_ = JasSeek; stream->ops_->write_ = JasWrite; } static int JasRead(jas_stream_obj_t *obj, char *buf, int cnt) { return ((CxFile*)obj)->Read(buf,1,cnt); } static int JasWrite(jas_stream_obj_t *obj, char *buf, int cnt) { return ((CxFile*)obj)->Write(buf,1,cnt); } static long JasSeek(jas_stream_obj_t *obj, long offset, int origin) { return ((CxFile*)obj)->Seek(offset,origin); } static int JasClose(jas_stream_obj_t *obj) { return 1; } }; }; #endif #endif --- NEW FILE: ximajbg.h --- /* * File: ximajbg.h * Purpose: JBG Image Class Loader and Writer */ /* === C R E D I T S & D I S C L A I M E R S ============== * CxImageJBG (c) 18/Aug/2002 Davide Pizzolato - www.xdp.it * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * CxImage version 5.99a 08/Feb/2004 * See the file history.htm for the complete bugfix and news report. * * based on LIBJBG Copyright (c) 2002, Markus Kuhn - All rights reserved. * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__ximaJBG_h) #define __ximaJBG_h #include "ximage.h" #if CXIMAGE_SUPPORT_JBG extern "C" { #include "../jbig/jbig.h" }; class CxImageJBG: public CxImage { public: CxImageJBG(): CxImage(CXIMAGE_FORMAT_JBG) {} // bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_JBG);} // bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_JBG);} bool Decode(CxFile * hFile); bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } #if CXIMAGE_SUPPORT_ENCODE bool Encode(CxFile * hFile); bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } #endif // CXIMAGE_SUPPORT_ENCODE protected: static void jbig_data_out(BYTE *buffer, unsigned int len, void *file) {((CxFile*)file)->Write(buffer,len,1);} }; #endif #endif --- NEW FILE: ximajpg.h --- /* * File: ximajpg.h * Purpose: JPG Image Class Loader and Writer */ /* === C R E D I T S & D I S C L A I M E R S ============== * CxImageJPG (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it * Permission is given by the author to freely redistribute and include * this code in any program as long as this credit is given where due. * * CxImage version 5.99a 08/Feb/2004 * See the file history.htm for the complete bugfix and news report. * * Special thanks to Troels Knakkergaard for new features, enhancements and bugfixes * * Special thanks to Chris Shearer Cooper for CxFileJpg tips & code * * EXIF support based on jhead-1.8 by Matthias Wandel <mwandel(at)rim(dot)net> * * original CImageJPG and CImageIterator implementation are: * Copyright: (c) 1995, Alejandro Aguilar Sierra <asierra(at)servidor(dot)unam(dot)mx> * * This software is based in part on the work of the Independent JPEG Group. * Copyright (C) 1991-1998, Thomas G. Lane. * * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER * THIS DISCLAIMER. * * Use at your own risk! * ========================================================== */ #if !defined(__ximaJPEG_h) #define __ixmaJPEG_h #include "ximage.h" #if CXIMAGE_SUPPORT_JPG #define CXIMAGEJPG_SUPPORT_EXIF 1 extern "C" { #include "../jpeg/jpeglib.h" #include "../jpeg/jerror.h" } class DLL_EXP CxImageJPG: public CxImage { public: CxImageJPG(); ~CxImageJPG() {}; // bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_JPG);} // bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_JPG);} bool Decode(CxFile * hFile); bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } #if CXIMAGE_SUPPORT_ENCODE bool Encode(CxFile * hFile); bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } #endif // CXIMAGE_SUPPORT_ENCODE /* * EXIF support based on jhead-1.8 by Matthias Wandel <mwandel(at)rim(dot)net> */ #if CXIMAGEJPG_SUPPORT_EXIF #define MAX_COMMENT 1000 #define MAX_SECTIONS 20 typedef struct tag_ExifInfo { char Version [5]; char CameraMake [32]; char CameraModel [40]; char DateTime [20]; int Height, Width; int Orientation; int IsColor; int Process; int FlashUsed; float FocalLength; float ExposureTime; float ApertureFNumber; float Distance; float CCDWidth; float ExposureBias; int Whitebalance; int MeteringMode; int ExposureProgram; int ISOequivalent; int CompressionLevel; float FocalplaneXRes; float FocalplaneYRes; float FocalplaneUnits; float Xresolution; float Yresolution; float ResolutionUnit; float Brightness; char Comments[MAX_COMMENT]; unsigned char * ThumbnailPointer; /* Pointer at the thumbnail */ unsigned ThumbnailSize; /* Size of thumbnail. */ bool IsExif; } EXIFINFO; //-------------------------------------------------------------------------- // JPEG markers consist of one or more 0xFF bytes, followed by a marker // code byte (which is not an FF). Here are the marker codes of interest // in this program. (See jdmarker.c for a more complete list.) //-------------------------------------------------------------------------- #define M_SOF0 0xC0 // Start Of Frame N #define M_SOF1 0xC1 // N indicates which compression process #define M_SOF2 0xC2 // Only SOF0-SOF2 are now in common use #define M_SOF3 0xC3 #define M_SOF5 0xC5 // NB: codes C4 and CC are NOT SOF markers #define M_SOF6 0xC6 #define M_SOF7 0xC7 #define M_SOF9 0xC9 #define M_SOF10 0xCA #define M_SOF11 0xCB #define M_SOF13 0xCD #define M_SOF14 0xCE #define M_SOF15 0xCF #define M_SOI 0xD8 // Start Of Image (beginning of datastream) #define M_EOI 0xD9 // End Of Image (end of datastream) #define M_SOS 0xDA // Start Of Scan (begins compressed data) #define M_JFIF 0xE0 // Jfif marker #define M_EXIF 0xE1 // Exif marker #define M_COM 0xFE // COMment class CxExifInfo { typedef struct tag_Section_t{ BYTE* Data; int Type; unsigned Size; } Section_t; public: EXIFINFO* m_exifi... [truncated message content] |
From: <for...@us...> - 2004-02-29 13:17:17
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/lib/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28367/lib/win32 Added Files: CxImage.lib jpeg.lib Log Message: Added support for JPEG/PNG skin images --- NEW FILE: CxImage.lib --- (This appears to be a binary file; contents omitted.) --- NEW FILE: jpeg.lib --- (This appears to be a binary file; contents omitted.) |
From: <for...@us...> - 2004-02-29 13:17:16
|
Update of /cvsroot/vba/VisualBoyAdvance/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28367 Modified Files: GBA.dsp Log Message: Added support for JPEG/PNG skin images Index: GBA.dsp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/win32/GBA.dsp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** GBA.dsp 9 Dec 2003 21:53:28 -0000 1.19 --- GBA.dsp 29 Feb 2004 13:07:01 -0000 1.20 *************** *** 45,49 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "include\zlib" /I "include\png" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "OEMRESOURCE" /D "_AFXDLL" /D "MMX" /D "FINAL_VERSION" /D "BKPT_SUPPORT" /D "DEV_VERSION" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 45,49 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "include\zlib" /I "include\png" /I "include\cxImage" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "OEMRESOURCE" /D "_AFXDLL" /D "MMX" /D "FINAL_VERSION" /D "BKPT_SUPPORT" /D "DEV_VERSION" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 72,76 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\zlib" /I "include\png" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "OEMRESOURCE" /D "_AFXDLL" /D "MMX" /D "DEV_VERSION" /D "BKPT_SUPPORT" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 72,76 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "include\zlib" /I "include\png" /I "include\cxImage" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "OEMRESOURCE" /D "_AFXDLL" /D "MMX" /D "DEV_VERSION" /D "BKPT_SUPPORT" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 100,104 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "include\zlib" /I "include\png" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "OEMRESOURCE" /D "_AFXDLL" /D "MMX" /D "FINAL_VERSION" /D "BKPT_SUPPORT" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "include\zlib" /I "include\png" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "OEMRESOURCE" /D "_AFXDLL" /D "MMX" /D "FINAL_VERSION" /D "BKPT_SUPPORT" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 100,104 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "include\zlib" /I "include\png" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "OEMRESOURCE" /D "_AFXDLL" /D "MMX" /D "FINAL_VERSION" /D "BKPT_SUPPORT" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "include\zlib" /I "include\png" /I "include\cxImage" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "OEMRESOURCE" /D "_AFXDLL" /D "MMX" /D "FINAL_VERSION" /D "BKPT_SUPPORT" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 1044,1047 **** --- 1044,1055 ---- SOURCE=.\lib\win32\zlibMD.lib # End Source File + # Begin Source File + + SOURCE=.\lib\win32\CxImage.lib + # End Source File + # Begin Source File + + SOURCE=.\lib\win32\jpeg.lib + # End Source File # End Target # End Project |
From: <for...@us...> - 2004-02-29 13:15:42
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/include/cximage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28169/cximage Log Message: Directory /cvsroot/vba/VisualBoyAdvance/win32/include/cximage added to the repository |
From: <for...@us...> - 2004-02-29 13:15:10
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28019 Modified Files: skin.cpp skin.h Log Message: Added support for JPEG/PNG skin images Index: skin.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/skin.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** skin.cpp 4 Nov 2003 14:09:52 -0000 1.5 --- skin.cpp 29 Feb 2004 13:04:54 -0000 1.6 *************** *** 15,18 **** --- 15,19 ---- #include "skin.h" #include <stdio.h> + #include "xImage.h" #include "../System.h" *************** *** 57,60 **** --- 58,72 ---- } + HBITMAP CSkin::LoadImage(const char *filename) + { + CxImage image; + image.Load(filename); + if(!image.IsValid()) { + return NULL; + } + + return image.MakeBitmap(NULL); + } + // ---------------------------------------------------------------------------- // Initialize the skin *************** *** 383,388 **** if(strcmp(rgn, "")) rgn = path + rgn; ! ! m_hBmp = (HBITMAP)LoadImage(NULL, bmpName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION); if (!m_hBmp) { m_error = "Error loading skin bitmap " + bmpName; --- 395,401 ---- if(strcmp(rgn, "")) rgn = path + rgn; ! ! m_hBmp = LoadImage(bmpName); ! if (!m_hBmp) { m_error = "Error loading skin bitmap " + bmpName; *************** *** 445,455 **** CString normalBmp = path + buffer; ! HBITMAP bmp = (HBITMAP)LoadImage(NULL, ! normalBmp, ! IMAGE_BITMAP, ! 0, ! 0, ! LR_LOADFROMFILE|LR_CREATEDIBSECTION); ! if (!bmp) { m_error = "Error loading button bitmap " + normalBmp; return false; --- 458,463 ---- CString normalBmp = path + buffer; ! HBITMAP bmp = LoadImage(normalBmp); ! if(!bmp) { m_error = "Error loading button bitmap " + normalBmp; return false; *************** *** 464,473 **** CString downBmp = path + buffer; ! bmp = (HBITMAP)LoadImage(NULL, ! downBmp, ! IMAGE_BITMAP, ! 0, ! 0, ! LR_LOADFROMFILE|LR_CREATEDIBSECTION); if (!bmp) { m_error = "Error loading button down bitmap " + downBmp; --- 472,477 ---- CString downBmp = path + buffer; ! bmp = LoadImage(downBmp); ! if (!bmp) { m_error = "Error loading button down bitmap " + downBmp; *************** *** 479,488 **** CString overBmp = path + buffer; ! bmp = (HBITMAP)LoadImage(NULL, ! overBmp, ! IMAGE_BITMAP, ! 0, ! 0, ! LR_LOADFROMFILE|LR_CREATEDIBSECTION); if (!bmp) { m_error = "Error loading button over bitmap " + overBmp; --- 483,488 ---- CString overBmp = path + buffer; ! bmp = LoadImage(overBmp); ! if (!bmp) { m_error = "Error loading button over bitmap " + overBmp; Index: skin.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/skin.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** skin.h 4 Nov 2003 14:09:53 -0000 1.3 --- skin.h 29 Feb 2004 13:04:54 -0000 1.4 *************** *** 154,157 **** --- 154,158 ---- private: + HBITMAP LoadImage(const char *); bool ReadButton(const char *, int); static bool ParseRect(char *, RECT &); |
From: <for...@us...> - 2004-02-24 11:28:57
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19684 Modified Files: admame.cpp Log Message: Sync code with Scale2x V2.0 Index: admame.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/admame.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** admame.cpp 20 Jan 2004 22:02:03 -0000 1.9 --- admame.cpp 24 Feb 2004 11:22:35 -0000 1.10 *************** *** 42,171 **** #endif ! /* Suggested in "Intel Optimization" for Pentium II */ ! #define ASM_JUMP_ALIGN ".p2align 4\n" ! ! static void internal_scale2x_16_def(u16 *dst0, u16* dst1, const u16* src0, const u16* src1, const u16* src2, unsigned count) { /* first pixel */ ! dst0[0] = src1[0]; ! dst1[0] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) ! dst0[1] =src0[0]; ! else ! dst0[1] =src1[0]; ! if (src1[1] == src2[0] && src0[0] != src2[0]) ! dst1[1] =src2[0]; else ! dst1[1] =src1[0]; ++src0; ++src1; ++src2; ! dst0 += 2; ! dst1 += 2; /* central pixels */ count -= 2; while (count) { ! if (src1[-1] == src0[0] && src2[0] != src0[0] && src1[1] != src0[0]) ! dst0[0] = src0[0]; ! else ! dst0[0] = src1[0]; ! if (src1[1] == src0[0] && src2[0] != src0[0] && src1[-1] != src0[0]) ! dst0[1] =src0[0]; ! else ! dst0[1] =src1[0]; ! ! if (src1[-1] == src2[0] && src0[0] != src2[0] && src1[1] != src2[0]) ! dst1[0] =src2[0]; ! else ! dst1[0] =src1[0]; ! if (src1[1] == src2[0] && src0[0] != src2[0] && src1[-1] != src2[0]) ! dst1[1] =src2[0]; ! else ! dst1[1] =src1[0]; ! ++src0; ++src1; ++src2; ! dst0 += 2; ! dst1 += 2; --count; } ! /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) ! dst0[0] =src0[0]; ! else ! dst0[0] =src1[0]; ! if (src1[-1] == src2[0] && src0[0] != src2[0]) ! dst1[0] =src2[0]; else ! dst1[0] =src1[0]; ! dst0[1] =src1[0]; ! dst1[1] =src1[0]; } ! static void internal_scale2x_32_def(u32* dst0, ! u32* dst1, const u32* src0, const u32* src1, const u32* src2, ! unsigned count) { /* first pixel */ ! dst0[0] = src1[0]; ! dst1[0] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) ! dst0[1] = src0[0]; ! else ! dst0[1] = src1[0]; ! if (src1[1] == src2[0] && src0[0] != src2[0]) ! dst1[1] = src2[0]; else ! dst1[1] = src1[0]; ++src0; ++src1; ++src2; ! dst0 += 2; ! dst1 += 2; ! /* central pixels */ count -= 2; while (count) { ! if (src1[-1] == src0[0] && src2[0] != src0[0] && src1[1] != src0[0]) ! dst0[0] = src0[0]; ! else ! dst0[0] = src1[0]; ! if (src1[1] == src0[0] && src2[0] != src0[0] && src1[-1] != src0[0]) ! dst0[1] = src0[0]; ! else ! dst0[1] = src1[0]; ! ! if (src1[-1] == src2[0] && src0[0] != src2[0] && src1[1] != src2[0]) ! dst1[0] = src2[0]; ! else ! dst1[0] = src1[0]; ! if (src1[1] == src2[0] && src0[0] != src2[0] && src1[-1] != src2[0]) ! dst1[1] = src2[0]; ! else ! dst1[1] = src1[0]; ! ++src0; ++src1; ++src2; ! dst0 += 2; ! dst1 += 2; --count; } ! /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) ! dst0[0] = src0[0]; ! else ! dst0[0] = src1[0]; ! if (src1[-1] == src2[0] && src0[0] != src2[0]) ! dst1[0] = src2[0]; else ! dst1[0] = src1[0]; ! dst0[1] = src1[0]; ! dst1[1] = src1[0]; } --- 42,124 ---- #endif ! static void internal_scale2x_16_def(u16 *dst, const u16* src0, const u16* src1, const u16* src2, unsigned count) { /* first pixel */ ! dst[0] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) ! dst[1] = src0[0]; else ! dst[1] = src1[0]; ++src0; ++src1; ++src2; ! dst += 2; /* central pixels */ count -= 2; while (count) { ! if (src0[0] != src2[0] && src1[-1] != src1[1]) { ! dst[0] = src1[-1] == src0[0] ? src0[0] : src1[0]; ! dst[1] = src1[1] == src0[0] ? src0[0] : src1[0]; ! } else { ! dst[0] = src1[0]; ! dst[1] = src1[0]; ! } ! ++src0; ++src1; ++src2; ! dst += 2; --count; } ! /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) ! dst[0] = src0[0]; else ! dst[0] = src1[0]; ! dst[1] = src1[0]; } ! static void internal_scale2x_32_def(u32* dst, const u32* src0, const u32* src1, const u32* src2, ! unsigned count) ! { /* first pixel */ ! dst[0] = src1[0]; if (src1[1] == src0[0] && src2[0] != src0[0]) ! dst[1] = src0[0]; else ! dst[1] = src1[0]; ++src0; ++src1; ++src2; ! dst += 2; ! /* central pixels */ count -= 2; while (count) { ! if (src0[0] != src2[0] && src1[-1] != src1[1]) { ! dst[0] = src1[-1] == src0[0] ? src0[0] : src1[0]; ! dst[1] = src1[1] == src0[0] ? src0[0] : src1[0]; ! } else { ! dst[0] = src1[0]; ! dst[1] = src1[0]; ! } ! ++src0; ++src1; ++src2; ! dst += 2; --count; } ! /* last pixel */ if (src1[-1] == src0[0] && src2[0] != src0[0]) ! dst[0] = src0[0]; else ! dst[0] = src1[0]; ! dst[1] = src1[0]; } *************** *** 179,187 **** /* first run */ /* set the current, current_pre, current_next registers */ ! "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ "movq 0(%1),%%mm7\n" "movq 8(%1),%%mm1\n" ! "psrlq $48,%%mm0\n" "psllq $48,%%mm1\n" "movq %%mm7,%%mm2\n" "movq %%mm7,%%mm3\n" --- 132,141 ---- /* first run */ /* set the current, current_pre, current_next registers */ ! "movq 0(%1), %%mm0\n" "movq 0(%1),%%mm7\n" "movq 8(%1),%%mm1\n" ! "psllq $48,%%mm0\n" "psllq $48,%%mm1\n" + "psrlq $48, %%mm0\n" "movq %%mm7,%%mm2\n" "movq %%mm7,%%mm3\n" *************** *** 194,199 **** "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" --- 148,153 ---- "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" *************** *** 221,225 **** "por %%mm5,%%mm4\n" ! /* set *dst0 */ "movq %%mm2,%%mm3\n" "punpcklwd %%mm4,%%mm2\n" --- 175,179 ---- "por %%mm5,%%mm4\n" ! /* set *dst */ "movq %%mm2,%%mm3\n" "punpcklwd %%mm4,%%mm2\n" *************** *** 237,241 **** "shrl $2,%4\n" "jz 1f\n" ! ASM_JUMP_ALIGN "0:\n" --- 191,195 ---- "shrl $2,%4\n" "jz 1f\n" ! "0:\n" *************** *** 256,261 **** "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" --- 210,215 ---- "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" *************** *** 283,287 **** "por %%mm5,%%mm4\n" ! /* set *dst0 */ "movq %%mm2,%%mm3\n" "punpcklwd %%mm4,%%mm2\n" --- 237,241 ---- "por %%mm5,%%mm4\n" ! /* set *dst */ "movq %%mm2,%%mm3\n" "punpcklwd %%mm4,%%mm2\n" *************** *** 302,308 **** /* final run */ /* set the current, current_pre, current_next registers */ ! "movq -8(%1),%%mm0\n" "movq (%1),%%mm7\n" ! "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ "psrlq $48,%%mm0\n" "psllq $48,%%mm1\n" --- 256,263 ---- /* final run */ /* set the current, current_pre, current_next registers */ ! "movq (%1),%%mm1\n" "movq (%1),%%mm7\n" ! "movq -8(%1),%%mm0\n" ! "psrlq $48,%%mm1\n" "psrlq $48,%%mm0\n" "psllq $48,%%mm1\n" *************** *** 317,322 **** "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" --- 272,277 ---- "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" *************** *** 344,348 **** "por %%mm5,%%mm4\n" ! /* set *dst0 */ "movq %%mm2,%%mm3\n" "punpcklwd %%mm4,%%mm2\n" --- 299,303 ---- "por %%mm5,%%mm4\n" ! /* set *dst */ "movq %%mm2,%%mm3\n" "punpcklwd %%mm4,%%mm2\n" *************** *** 366,374 **** /* first run */ /* set the current, current_pre, current_next registers */ ! pxor mm0,mm0; /* use a fake black out of screen */ movq mm7, qword ptr [ebx]; movq mm1, qword ptr [ebx + 8]; ! psrlq mm0, 48; psllq mm1, 48; movq mm2, mm7; movq mm3, mm7; --- 321,330 ---- /* first run */ /* set the current, current_pre, current_next registers */ ! movq mm0, qword ptr [ebx]; movq mm7, qword ptr [ebx]; movq mm1, qword ptr [ebx + 8]; ! psllq mm0, 48; psllq mm1, 48; + psrlq mm0, 48; movq mm2, mm7; movq mm3, mm7; *************** *** 381,386 **** movq mm6, qword ptr [eax]; ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ movq mm2, mm0; movq mm4, mm1; --- 337,342 ---- movq mm6, qword ptr [eax]; ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ movq mm2, mm0; movq mm4, mm1; *************** *** 443,448 **** movq mm6, qword ptr [eax]; ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ movq mm2,mm0; movq mm4,mm1; --- 399,404 ---- movq mm6, qword ptr [eax]; ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ movq mm2,mm0; movq mm4,mm1; *************** *** 470,474 **** por mm4,mm5; ! /* set *dst0 */ movq mm3,mm2; punpcklwd mm2,mm4; --- 426,430 ---- por mm4,mm5; ! /* set *dst */ movq mm3,mm2; punpcklwd mm2,mm4; *************** *** 489,495 **** /* final run */ /* set the current, current_pre, current_next registers */ ! movq mm0, qword ptr [ebx-8]; movq mm7, qword ptr [ebx]; ! pxor mm1,mm1; /* use a fake black out of screen */ psrlq mm0,48; psllq mm1,48; --- 445,452 ---- /* final run */ /* set the current, current_pre, current_next registers */ ! movq mm1, qword ptr [ebx]; movq mm7, qword ptr [ebx]; ! movq mm0, qword ptr [ebx-8]; ! psrlq mm1,48; psrlq mm0,48; psllq mm1,48; *************** *** 504,509 **** movq mm6, qword ptr [eax]; ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ movq mm2,mm0; movq mm4,mm1; --- 461,466 ---- movq mm6, qword ptr [eax]; ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ movq mm2,mm0; movq mm4,mm1; *************** *** 531,535 **** por mm4,mm5; ! /* set *dst0 */ movq mm3,mm2; punpcklwd mm2,mm4; --- 488,492 ---- por mm4,mm5; ! /* set *dst */ movq mm3,mm2; punpcklwd mm2,mm4; *************** *** 557,565 **** /* first run */ /* set the current, current_pre, current_next registers */ ! "pxor %%mm0,%%mm0\n" /* use a fake black out of screen */ "movq 0(%1),%%mm7\n" "movq 8(%1),%%mm1\n" ! "psrlq $32,%%mm0\n" "psllq $32,%%mm1\n" "movq %%mm7,%%mm2\n" "movq %%mm7,%%mm3\n" --- 514,523 ---- /* first run */ /* set the current, current_pre, current_next registers */ ! "movq 0(%1),%%mm0\n" "movq 0(%1),%%mm7\n" "movq 8(%1),%%mm1\n" ! "psllq $32,%%mm0\n" "psllq $32,%%mm1\n" + "psrlq $32,%%mm0\n" "movq %%mm7,%%mm2\n" "movq %%mm7,%%mm3\n" *************** *** 572,577 **** "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" --- 530,535 ---- "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" *************** *** 599,608 **** "por %%mm5,%%mm4\n" ! /* set *dst0 */ "movq %%mm2,%%mm3\n" "punpckldq %%mm4,%%mm2\n" "punpckhdq %%mm4,%%mm3\n" "movq %%mm2,(%3)\n" ! "movq %%mm3,8(%3)\n" /* next */ --- 557,566 ---- "por %%mm5,%%mm4\n" ! /* set *dst */ "movq %%mm2,%%mm3\n" "punpckldq %%mm4,%%mm2\n" "punpckhdq %%mm4,%%mm3\n" "movq %%mm2,(%3)\n" ! "movq %%mm3, 8(%3)\n" /* next */ *************** *** 615,619 **** "shrl $1,%4\n" "jz 1f\n" ! ASM_JUMP_ALIGN "0:\n" --- 573,577 ---- "shrl $1,%4\n" "jz 1f\n" ! "0:\n" *************** *** 634,639 **** "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" --- 592,597 ---- "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" *************** *** 661,665 **** "por %%mm5,%%mm4\n" ! /* set *dst0 */ "movq %%mm2,%%mm3\n" "punpckldq %%mm4,%%mm2\n" --- 619,623 ---- "por %%mm5,%%mm4\n" ! /* set *dst */ "movq %%mm2,%%mm3\n" "punpckldq %%mm4,%%mm2\n" *************** *** 680,686 **** /* final run */ /* set the current, current_pre, current_next registers */ ! "movq -8(%1),%%mm0\n" "movq (%1),%%mm7\n" ! "pxor %%mm1,%%mm1\n" /* use a fake black out of screen */ "psrlq $32,%%mm0\n" "psllq $32,%%mm1\n" --- 638,645 ---- /* final run */ /* set the current, current_pre, current_next registers */ ! "movq (%1),%%mm1\n" "movq (%1),%%mm7\n" ! "movq -8(%1), %%mm0\n" ! "psrlq $32,%%mm1\n" "psrlq $32,%%mm0\n" "psllq $32,%%mm1\n" *************** *** 695,700 **** "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" --- 654,659 ---- "movq (%0),%%mm6\n" ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ "movq %%mm0,%%mm2\n" "movq %%mm1,%%mm4\n" *************** *** 722,726 **** "por %%mm5,%%mm4\n" ! /* set *dst0 */ "movq %%mm2,%%mm3\n" "punpckldq %%mm4,%%mm2\n" --- 681,685 ---- "por %%mm5,%%mm4\n" ! /* set *dst */ "movq %%mm2,%%mm3\n" "punpckldq %%mm4,%%mm2\n" *************** *** 744,752 **** /* first run */ /* set the current, current_pre, current_next registers */ ! pxor mm0,mm0; movq mm7,qword ptr [ebx]; movq mm1,qword ptr [ebx + 8]; ! psrlq mm0,32; psllq mm1,32; movq mm2,mm7; movq mm3,mm7; --- 703,712 ---- /* first run */ /* set the current, current_pre, current_next registers */ ! movq mm0,qword ptr [ebx]; movq mm7,qword ptr [ebx]; movq mm1,qword ptr [ebx + 8]; ! psllq mm0,32; psllq mm1,32; + psrlq mm0,32; movq mm2,mm7; movq mm3,mm7; *************** *** 759,764 **** movq mm6,qword ptr [eax]; ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ movq mm2,mm0; movq mm4,mm1; --- 719,724 ---- movq mm6,qword ptr [eax]; ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ movq mm2,mm0; movq mm4,mm1; *************** *** 786,790 **** por mm4,mm5; ! /* set *dst0 */ movq mm3,mm2; punpckldq mm2,mm4; --- 746,750 ---- por mm4,mm5; ! /* set *dst */ movq mm3,mm2; punpckldq mm2,mm4; *************** *** 820,825 **** movq mm6,qword ptr[eax]; ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ movq mm2,mm0; movq mm4,mm1; --- 780,785 ---- movq mm6,qword ptr[eax]; ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ movq mm2,mm0; movq mm4,mm1; *************** *** 847,851 **** por mm4,mm5; ! /* set *dst0 */ movq mm3,mm2; punpckldq mm2,mm4; --- 807,811 ---- por mm4,mm5; ! /* set *dst */ movq mm3,mm2; punpckldq mm2,mm4; *************** *** 866,872 **** /* final run */ /* set the current, current_pre, current_next registers */ ! movq mm0,qword ptr [ebx-8]; movq mm7,qword ptr [ebx]; ! pxor mm1,mm1; psrlq mm0,32; psllq mm1,32; --- 826,833 ---- /* final run */ /* set the current, current_pre, current_next registers */ ! movq mm1,qword ptr [ebx]; movq mm7,qword ptr [ebx]; ! movq mm0,qword ptr [ebx-8]; ! psrlq mm1,32; psrlq mm0,32; psllq mm1,32; *************** *** 881,886 **** movq mm6,qword ptr [eax]; ! /* compute the upper-left pixel for dst0 on %%mm2 */ ! /* compute the upper-right pixel for dst0 on %%mm4 */ movq mm2,mm0; movq mm4,mm1; --- 842,847 ---- movq mm6,qword ptr [eax]; ! /* compute the upper-left pixel for dst on %%mm2 */ ! /* compute the upper-right pixel for dst on %%mm4 */ movq mm2,mm0; movq mm4,mm1; *************** *** 908,912 **** por mm4,mm5; ! /* set *dst0 */ movq mm3,mm2; punpckldq mm2,mm4; --- 869,873 ---- por mm4,mm5; ! /* set *dst */ movq mm3,mm2; punpckldq mm2,mm4; *************** *** 969,973 **** } else { #endif ! internal_scale2x_16_def(dst0, dst1, src0, src0, src1, width); int count = height; --- 930,935 ---- } else { #endif ! internal_scale2x_16_def(dst0, src0, src0, src1, width); ! internal_scale2x_16_def(dst1, src1, src0, src0, width); int count = height; *************** *** 977,981 **** dst0 += dstPitch; dst1 += dstPitch; ! internal_scale2x_16_def(dst0, dst1, src0, src1, src2, width); src0 = src1; src1 = src2; --- 939,944 ---- dst0 += dstPitch; dst1 += dstPitch; ! internal_scale2x_16_def(dst0, src0, src1, src2, width); ! internal_scale2x_16_def(dst1, src2, src1, src0, width); src0 = src1; src1 = src2; *************** *** 985,989 **** dst0 += dstPitch; dst1 += dstPitch; ! internal_scale2x_16_def(dst0, dst1, src0, src1, src1, width); #ifdef MMX } --- 948,953 ---- dst0 += dstPitch; dst1 += dstPitch; ! internal_scale2x_16_def(dst0, src0, src1, src1, width); ! internal_scale2x_16_def(dst1, src1, src1, src0, width); #ifdef MMX } *************** *** 1021,1025 **** } else { #endif ! internal_scale2x_32_def(dst0, dst1, src0, src0, src1, width); int count = height; --- 985,990 ---- } else { #endif ! internal_scale2x_32_def(dst0, src0, src0, src1, width); ! internal_scale2x_32_def(dst1, src1, src0, src0, width); int count = height; *************** *** 1029,1033 **** dst0 += dstPitch >> 1; dst1 += dstPitch >> 1; ! internal_scale2x_32_def(dst0, dst1, src0, src1, src2, width); src0 = src1; src1 = src2; --- 994,999 ---- dst0 += dstPitch >> 1; dst1 += dstPitch >> 1; ! internal_scale2x_32_def(dst0, src0, src1, src2, width); ! internal_scale2x_32_def(dst1, src2, src1, src0, width); src0 = src1; src1 = src2; *************** *** 1037,1041 **** dst0 += dstPitch >> 1; dst1 += dstPitch >> 1; ! internal_scale2x_32_def(dst0, dst1, src0, src1, src1, width); #ifdef MMX } --- 1003,1008 ---- dst0 += dstPitch >> 1; dst1 += dstPitch >> 1; ! internal_scale2x_32_def(dst0, src0, src1, src1, width); ! internal_scale2x_32_def(dst1, src1, src1, src0, width); #ifdef MMX } |
From: <for...@us...> - 2004-02-24 10:46:43
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12266 Modified Files: Cheats.cpp Log Message: Improve CodeBreaker code 0xDxxxxxxx support Index: Cheats.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Cheats.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Cheats.cpp 21 Jan 2004 01:01:34 -0000 1.17 --- Cheats.cpp 24 Feb 2004 10:40:23 -0000 1.18 *************** *** 274,283 **** break; case CBA_IF_KEYS_PRESSED: ! if(cheatsList[i].address == 0x20) { ! if((keys & cheatsList[i].value) != cheatsList[i].value) { ! i++; } - } else if(cheatsList[i].value != keys) { - i++; } break; --- 274,289 ---- break; case CBA_IF_KEYS_PRESSED: ! { ! u16 value = cheatsList[i].value; ! u32 addr = cheatsList[i].address; ! if((addr & 0x30) == 0x20) { ! if((keys & value) != value) { ! i++; ! } ! } else if((addr & 0x30) == 0x10) { ! if((keys & value) == value) { ! i++; ! } } } break; |
From: <for...@us...> - 2004-02-17 11:36:28
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29052 Modified Files: BitmapControl.cpp MemoryViewer.cpp PaletteViewControl.cpp skinButton.cpp ZoomControl.cpp Log Message: Fix GDI problems on Win98 Index: BitmapControl.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/BitmapControl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BitmapControl.cpp 4 Nov 2003 14:09:52 -0000 1.1 --- BitmapControl.cpp 17 Feb 2004 11:27:36 -0000 1.2 *************** *** 87,93 **** h1 = h; } ! CBitmap bitmap; bitmap.CreateCompatibleBitmap(dc, w1, h1); ! memDC.SelectObject(&bitmap); if(stretch) { bmpInfo->bmiHeader.biWidth = w; --- 87,93 ---- h1 = h; } ! CBitmap bitmap, *pOldBitmap; bitmap.CreateCompatibleBitmap(dc, w1, h1); ! pOldBitmap = memDC.SelectObject(&bitmap); if(stretch) { bmpInfo->bmiHeader.biWidth = w; *************** *** 128,131 **** --- 128,132 ---- dc->BitBlt(0,0,w1,h1, &memDC,0,0,SRCCOPY); + memDC.SelectObject(pOldBitmap); bitmap.DeleteObject(); Index: MemoryViewer.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MemoryViewer.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MemoryViewer.cpp 4 Nov 2003 14:09:52 -0000 1.4 --- MemoryViewer.cpp 17 Feb 2004 11:27:36 -0000 1.5 *************** *** 158,164 **** CDC memDC; memDC.CreateCompatibleDC(&dc); ! CBitmap bitmap; bitmap.CreateCompatibleBitmap(&dc, w, rect.bottom - rect.top); ! memDC.SelectObject(&bitmap); memDC.FillRect(&rect, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH))); --- 158,164 ---- CDC memDC; memDC.CreateCompatibleDC(&dc); ! CBitmap bitmap, *pOldBitmap; bitmap.CreateCompatibleBitmap(&dc, w, rect.bottom - rect.top); ! pOldBitmap = memDC.SelectObject(&bitmap); memDC.FillRect(&rect, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH))); *************** *** 263,266 **** --- 263,267 ---- dc.BitBlt(0, 0, w, rect.bottom - rect.top, &memDC, 0, 0, SRCCOPY); + memDC.SelectObject(pOldBitmap); memDC.DeleteDC(); bitmap.DeleteObject(); Index: PaletteViewControl.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/PaletteViewControl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PaletteViewControl.cpp 4 Nov 2003 14:09:52 -0000 1.1 --- PaletteViewControl.cpp 17 Feb 2004 11:27:36 -0000 1.2 *************** *** 328,334 **** CDC memDC; memDC.CreateCompatibleDC(&dc); ! CBitmap bitmap; bitmap.CreateCompatibleBitmap(&dc, w, h); ! memDC.SelectObject(bitmap); StretchDIBits(memDC.GetSafeHdc(), --- 328,334 ---- CDC memDC; memDC.CreateCompatibleDC(&dc); ! CBitmap bitmap, *pOldBitmap; bitmap.CreateCompatibleBitmap(&dc, w, h); ! pOldBitmap = memDC.SelectObject(&bitmap); StretchDIBits(memDC.GetSafeHdc(), *************** *** 387,390 **** --- 387,391 ---- &memDC,0,0,SRCCOPY); + memDC.SelectObject(pOldBitmap); bitmap.DeleteObject(); memDC.DeleteDC(); Index: skinButton.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/skinButton.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** skinButton.cpp 4 Nov 2003 14:09:53 -0000 1.4 --- skinButton.cpp 17 Feb 2004 11:27:36 -0000 1.5 *************** *** 99,113 **** HDC memDC = ::CreateCompatibleDC(hDC); UINT state = ::SendMessage(m_hWnd, BM_GETSTATE, 0, 0); ! if(state & BST_PUSHED) ! SelectObject(memDC, downBmp); else if(mouseOver && overBmp != NULL) ! SelectObject(memDC, overBmp); else ! SelectObject(memDC, normalBmp); SelectClipRgn(hDC, region); BitBlt(hDC, 0, 0, theApp.rect.right - theApp.rect.left, theApp.rect.bottom - theApp.rect.top, memDC, 0, 0, SRCCOPY); SelectClipRgn(hDC, NULL); DeleteDC(memDC); --- 99,114 ---- HDC memDC = ::CreateCompatibleDC(hDC); UINT state = ::SendMessage(m_hWnd, BM_GETSTATE, 0, 0); ! HBITMAP oldBitmap; if(state & BST_PUSHED) ! oldBitmap = (HBITMAP)SelectObject(memDC, downBmp); else if(mouseOver && overBmp != NULL) ! oldBitmap = (HBITMAP)SelectObject(memDC, overBmp); else ! oldBitmap = (HBITMAP)SelectObject(memDC, normalBmp); SelectClipRgn(hDC, region); BitBlt(hDC, 0, 0, theApp.rect.right - theApp.rect.left, theApp.rect.bottom - theApp.rect.top, memDC, 0, 0, SRCCOPY); SelectClipRgn(hDC, NULL); + SelectObject(memDC, oldBitmap); DeleteDC(memDC); Index: ZoomControl.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/ZoomControl.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ZoomControl.cpp 18 Jan 2004 14:54:22 -0000 1.2 --- ZoomControl.cpp 17 Feb 2004 11:27:36 -0000 1.3 *************** *** 89,96 **** CDC memDC ; memDC.CreateCompatibleDC(&dc); ! CBitmap bitmap; bitmap.CreateCompatibleBitmap(&dc, w, h); ! memDC.SelectObject(&bitmap); int multX = w / 8; --- 89,96 ---- CDC memDC ; memDC.CreateCompatibleDC(&dc); ! CBitmap bitmap, *pOldBitmap; bitmap.CreateCompatibleBitmap(&dc, w, h); ! pOldBitmap = memDC.SelectObject(&bitmap); int multX = w / 8; *************** *** 148,151 **** --- 148,152 ---- &memDC,0,0, SRCCOPY); + memDC.SelectObject(pOldBitmap); bitmap.DeleteObject(); memDC.DeleteDC(); |
From: <for...@us...> - 2004-02-17 11:20:22
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26226 Modified Files: VBA.cpp Log Message: Patch to allow base language to be searched when selecting system language Index: VBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/VBA.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** VBA.cpp 7 Feb 2004 13:55:16 -0000 1.9 --- VBA.cpp 17 Feb 2004 11:11:34 -0000 1.10 *************** *** 1883,1890 **** HINSTANCE l = winLoadLanguage(lbuffer); if(l == NULL) { ! systemMessage(IDS_FAILED_TO_LOAD_LIBRARY, ! "Failed to load library %s", ! lbuffer); ! return; } AfxSetResourceHandle(l); --- 1883,1897 ---- HINSTANCE l = winLoadLanguage(lbuffer); if(l == NULL) { ! LCID locIdBase = MAKELCID( MAKELANGID( PRIMARYLANGID( GetSystemDefaultLangID() ), SUBLANG_NEUTRAL ), SORT_DEFAULT ); ! if(GetLocaleInfo(locIdBase, LOCALE_SABBREVLANGNAME, ! lbuffer, 10)) { ! l = winLoadLanguage(lbuffer); ! if(l == NULL) { ! systemMessage(IDS_FAILED_TO_LOAD_LIBRARY, ! "Failed to load library %s", ! lbuffer); ! return; ! } ! } } AfxSetResourceHandle(l); |
From: <for...@us...> - 2004-02-17 11:19:41
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26093 Modified Files: elf.cpp Log Message: Fix warnings... Index: elf.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/elf.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** elf.cpp 17 Feb 2004 11:03:50 -0000 1.13 --- elf.cpp 17 Feb 2004 11:10:53 -0000 1.14 *************** *** 244,248 **** char *elfSectionHeadersStringTable = NULL; int elfSectionHeadersCount = 0; ! char *elfFileData = NULL; CompileUnit *elfCompileUnits = NULL; --- 244,248 ---- char *elfSectionHeadersStringTable = NULL; int elfSectionHeadersCount = 0; ! u8 *elfFileData = NULL; CompileUnit *elfCompileUnits = NULL; |
From: <for...@us...> - 2004-02-17 11:12:37
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25053 Modified Files: elf.cpp Log Message: Fix problems caused by memory leak fix Index: elf.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/elf.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** elf.cpp 20 Jan 2004 00:46:11 -0000 1.12 --- elf.cpp 17 Feb 2004 11:03:50 -0000 1.13 *************** *** 244,247 **** --- 244,248 ---- char *elfSectionHeadersStringTable = NULL; int elfSectionHeadersCount = 0; + char *elfFileData = NULL; CompileUnit *elfCompileUnits = NULL; *************** *** 2801,2810 **** fseek(f, 0, SEEK_END); long size = ftell(f); ! u8 *filedata = (u8 *)malloc(size); fseek(f, 0, SEEK_SET); ! fread(filedata, 1, size, f); fclose(f); ! ELFHeader *header = (ELFHeader *)filedata; if(READ32LE(&header->magic) != 0x464C457F || --- 2802,2811 ---- fseek(f, 0, SEEK_END); long size = ftell(f); ! elfFileData = (u8 *)malloc(size); fseek(f, 0, SEEK_SET); ! fread(elfFileData, 1, size, f); fclose(f); ! ELFHeader *header = (ELFHeader *)elfFileData; if(READ32LE(&header->magic) != 0x464C457F || *************** *** 2812,2825 **** header->clazz != 1) { systemMessage(0, "Not a valid ELF file %s", name); ! free(filedata); return false; } ! if(!elfReadProgram(header, filedata, siz, parseDebug)) { ! free(filedata); return false; } - free(filedata); - // systemMessage(0, "Done"); return true; --- 2813,2826 ---- header->clazz != 1) { systemMessage(0, "Not a valid ELF file %s", name); ! free(elfFileData); ! elfFileData = NULL; return false; } ! if(!elfReadProgram(header, elfFileData, siz, parseDebug)) { ! free(elfFileData); ! elfFileData = NULL; return false; } return true; *************** *** 2989,2991 **** --- 2990,2997 ---- cie = next; } + + if(elfFileData) { + free(elfFileData); + elfFileData = NULL; + } } |
From: <fl...@us...> - 2004-02-16 03:16:24
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27454/src Modified Files: Gfx.h Log Message: Mosaic fix Index: Gfx.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Gfx.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Gfx.h 16 Feb 2004 00:46:42 -0000 1.9 --- Gfx.h 16 Feb 2004 03:08:40 -0000 1.10 *************** *** 251,255 **** if(mosaicOn) { for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { line[i] = line[i-1]; i++; } --- 251,255 ---- if(mosaicOn) { for(int i = 0; i < 240; i+=2) { ! for(int m = 1; m < mosaicX; m++) { line[i] = line[i-1]; i++; } *************** *** 411,415 **** int mosaicX = (MOSAIC & 0xF) + 1; for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { line[i] = line[i-1]; i++; } --- 411,415 ---- int mosaicX = (MOSAIC & 0xF) + 1; for(int i = 0; i < 240; i+=2) { ! for(int m = 1; m < mosaicX; m++) { line[i] = line[i-1]; i++; } *************** *** 502,506 **** int mosaicX = (MOSAIC & 0xF) + 1; for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { line[i] = line[i-1]; i++; } --- 502,506 ---- int mosaicX = (MOSAIC & 0xF) + 1; for(int i = 0; i < 240; i+=2) { ! for(int m = 1; m < mosaicX; m++) { line[i] = line[i-1]; i++; } *************** *** 597,601 **** int mosaicX = (MOSAIC & 0xF) + 1; for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { line[i] = line[i-1]; i++; } --- 597,601 ---- int mosaicX = (MOSAIC & 0xF) + 1; for(int i = 0; i < 240; i+=2) { ! for(int m = 1; m < mosaicX; m++) { line[i] = line[i-1]; i++; } *************** *** 690,694 **** int mosaicX = (MOSAIC & 0xF) + 1; for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { line[i] = line[i-1]; i++; } --- 690,694 ---- int mosaicX = (MOSAIC & 0xF) + 1; for(int i = 0; i < 240; i+=2) { ! for(int m = 1; m < mosaicX; m++) { line[i] = line[i-1]; i++; } |
From: <fl...@us...> - 2004-02-16 00:54:21
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4010/src Modified Files: Gfx.h Log Message: More graphics optimizations Index: Gfx.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Gfx.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Gfx.h 16 Feb 2004 00:23:47 -0000 1.8 --- Gfx.h 16 Feb 2004 00:46:42 -0000 1.9 *************** *** 167,172 **** } if((control) & 0x80) { ! u16 *screenSource = screenBase + 0x400 * (xxx>>8) + ((xxx & 255)>>3) + ((yyy>>3)*32); for(int x = 0; x < 240; x++) { u16 data = READ16LE(screenSource); --- 167,173 ---- } + int yshift = ((yyy>>3)<<5); if((control) & 0x80) { ! u16 *screenSource = screenBase + 0x400 * (xxx>>8) + ((xxx & 255)>>3) + yshift; for(int x = 0; x < 240; x++) { u16 data = READ16LE(screenSource); *************** *** 193,209 **** if(xxx == 256) { if(sizeX > 256) ! screenSource = screenBase + 0x400 + ((yyy>>3)*32); else { ! screenSource = screenBase + ((yyy>>3)*32); xxx = 0; } } else if(xxx >= sizeX) { xxx = 0; ! screenSource = screenBase + ((yyy>>3)*32); } } } else { u16 *screenSource = screenBase + 0x400*(xxx>>8)+((xxx&255)>>3) + ! ((yyy>>3)*32); for(int x = 0; x < 240; x++) { u16 data = READ16LE(screenSource); --- 194,210 ---- if(xxx == 256) { if(sizeX > 256) ! screenSource = screenBase + 0x400 + yshift; else { ! screenSource = screenBase + yshift; xxx = 0; } } else if(xxx >= sizeX) { xxx = 0; ! screenSource = screenBase + yshift; } } } else { u16 *screenSource = screenBase + 0x400*(xxx>>8)+((xxx&255)>>3) + ! yshift; for(int x = 0; x < 240; x++) { u16 data = READ16LE(screenSource); *************** *** 218,222 **** tileY = 7 - tileY; ! u8 color = charBase[tile * 32 + tileY * 4 + (tileX>>1)]; if(tileX & 1) { --- 219,223 ---- tileY = 7 - tileY; ! u8 color = charBase[(tile<<5) + (tileY<<2) + (tileX>>1)]; if(tileX & 1) { *************** *** 237,248 **** if(xxx == 256) { if(sizeX > 256) ! screenSource = screenBase + 0x400 + (yyy>>3)*32; else { ! screenSource = screenBase + (yyy>>3)*32; xxx = 0; } } else if(xxx >= sizeX) { xxx = 0; ! screenSource = screenBase + ((yyy>>3)*32); } } --- 238,249 ---- if(xxx == 256) { if(sizeX > 256) ! screenSource = screenBase + 0x400 + yshift; else { ! screenSource = screenBase + yshift; xxx = 0; } } else if(xxx >= sizeX) { xxx = 0; ! screenSource = screenBase + yshift; } } *************** *** 354,358 **** int tileY = yyy & 7; ! u8 color = charBase[tile * 64 + tileY * 8 + tileX]; line[x] = color ? (READ16LE(&palette[color])|prio): 0x80000000; --- 355,359 ---- int tileY = yyy & 7; ! u8 color = charBase[(tile<<6) + (tileY<<3) + tileX]; line[x] = color ? (READ16LE(&palette[color])|prio): 0x80000000; *************** *** 386,390 **** int tileY = yyy & 7; ! u8 color = charBase[tile * 64 + tileY * 8 + tileX]; line[x] = color ? (READ16LE(&palette[color])|prio): 0x80000000; --- 387,391 ---- int tileY = yyy & 7; ! u8 color = charBase[(tile<<6) + (tileY<<3) + tileX]; line[x] = color ? (READ16LE(&palette[color])|prio): 0x80000000; *************** *** 823,828 **** sx >= 240); else { ! u32 color = vram[0x10000 + (((c + (yyy>>3) * inc)* ! 32 + (yyy & 7) * 8 + (xxx >> 3) * 64 + (xxx & 7))&0x7FFF)]; if ((color==0) && (((prio >> 25)&3) < --- 824,829 ---- sx >= 240); else { ! u32 color = vram[0x10000 + ((((c + (yyy>>3) * inc)<<5) ! + ((yyy & 7)<<3) + ((xxx >> 3)<<6) + (xxx & 7))&0x7FFF)]; if ((color==0) && (((prio >> 25)&3) < *************** *** 861,866 **** sx >= 240); else { ! u32 color = vram[0x10000 + (((c + (yyy>>3) * inc)* ! 32 + (yyy & 7) * 4 + (xxx >> 3) * 32 + ((xxx & 7)>>1))&0x7FFF)]; if(xxx & 1) --- 862,867 ---- sx >= 240); else { ! u32 color = vram[0x10000 + ((((c + (yyy>>3) * inc)<<5) ! + ((yyy & 7)<<2) + ((xxx >> 3)<<5) + ((xxx & 7)>>1))&0x7FFF)]; if(xxx & 1) *************** *** 982,987 **** } ! int address = 0x10000 + (((c + (t>>3) * inc) * 32 ! + (t & 7) * 4 + (xxx>>3) * 32 + ((xxx & 7) >> 1))&0x7FFF); u32 prio = (((a2 >> 10) & 3) << 25) | ((a0 & 0x0c00)<<6); int palette = (a2 >> 8) & 0xF0; --- 983,988 ---- } ! int address = 0x10000 + ((((c + (t>>3) * inc)<<5) ! + ((t & 7)<<2) + ((xxx>>3)<<5) + ((xxx & 7) >> 1))&0x7FFF); u32 prio = (((a2 >> 10) & 3) << 25) | ((a0 & 0x0c00)<<6); int palette = (a2 >> 8) & 0xF0; *************** *** 1183,1188 **** yyy < 0 || yyy >= sizeY) { } else { ! u32 color = vram[0x10000 + (((c + (yyy>>3) * inc)* ! 32 + (yyy & 7) * 8 + (xxx >> 3) * 64 + (xxx & 7))&0x7fff)]; if(color) { --- 1184,1189 ---- yyy < 0 || yyy >= sizeY) { } else { ! u32 color = vram[0x10000 + ((((c + (yyy>>3) * inc)<<5) ! + ((yyy & 7)<<3) + ((xxx >> 3)<<6) + (xxx & 7))&0x7fff)]; if(color) { *************** *** 1214,1219 **** yyy < 0 || yyy >= sizeY){ } else { ! u32 color = vram[0x10000 + (((c + (yyy>>3) * inc)* ! 32 + (yyy & 7) * 4 + (xxx >> 3) * 32 + ((xxx & 7)>>1))&0x7fff)]; if(xxx & 1) --- 1215,1220 ---- yyy < 0 || yyy >= sizeY){ } else { ! u32 color = vram[0x10000 + ((((c + (yyy>>3) * inc)<<5) ! + ((yyy & 7)<<2) + ((xxx >> 3)<<5) + ((xxx & 7)>>1))&0x7fff)]; if(xxx & 1) *************** *** 1303,1308 **** if(a1 & 0x1000) xxx = sizeX - 1; ! int address = 0x10000 + (((c + (t>>3) * inc) * 32 ! + (t & 7) * 4 + (xxx>>3) * 32 + ((xxx & 7) >> 1))&0x7fff); // u32 prio = (((a2 >> 10) & 3) << 25) | ((a0 & 0x0c00)<<6); // int palette = (a2 >> 8) & 0xF0; --- 1304,1309 ---- if(a1 & 0x1000) xxx = sizeX - 1; ! int address = 0x10000 + ((((c + (t>>3) * inc)<<5) ! + ((t & 7)<<2) + ((xxx>>3)<<5) + ((xxx & 7) >> 1))&0x7fff); // u32 prio = (((a2 >> 10) & 3) << 25) | ((a0 & 0x0c00)<<6); // int palette = (a2 >> 8) & 0xF0; |
From: <fl...@us...> - 2004-02-16 00:31:26
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv350/src Modified Files: Gfx.h Log Message: Optimize mosaic logic. Index: Gfx.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Gfx.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Gfx.h 15 Jun 2003 12:11:44 -0000 1.7 --- Gfx.h 16 Feb 2004 00:23:47 -0000 1.8 *************** *** 249,259 **** } if(mosaicOn) { ! int m = 0; ! for(int i = 0; i < 240; i++) { ! if(m) ! line[i] = line[i-1]; ! m++; ! if(m == mosaicX) ! m = 0; } } --- 249,256 ---- } if(mosaicOn) { ! for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { ! line[i] = line[i-1]; i++; ! } } } *************** *** 412,422 **** if(control & 0x40) { int mosaicX = (MOSAIC & 0xF) + 1; ! int m = 0; ! for(int i = 0; i < 240; i++) { ! if(m) ! line[i] = line[i-1]; ! m++; ! if(m == mosaicX) ! m = 0; } } --- 409,416 ---- if(control & 0x40) { int mosaicX = (MOSAIC & 0xF) + 1; ! for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { ! line[i] = line[i-1]; i++; ! } } } *************** *** 506,516 **** if(control & 0x40) { int mosaicX = (MOSAIC & 0xF) + 1; ! int m = 0; ! for(int i = 0; i < 240; i++) { ! if(m) ! line[i] = line[i-1]; ! m++; ! if(m == mosaicX) ! m = 0; } } --- 500,507 ---- if(control & 0x40) { int mosaicX = (MOSAIC & 0xF) + 1; ! for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { ! line[i] = line[i-1]; i++; ! } } } *************** *** 604,614 **** if(control & 0x40) { int mosaicX = (MOSAIC & 0xF) + 1; ! int m = 0; ! for(int i = 0; i < 240; i++) { ! if(m) ! line[i] = line[i-1]; ! m++; ! if(m == mosaicX) ! m = 0; } } --- 595,602 ---- if(control & 0x40) { int mosaicX = (MOSAIC & 0xF) + 1; ! for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { ! line[i] = line[i-1]; i++; ! } } } *************** *** 700,710 **** if(control & 0x40) { int mosaicX = (MOSAIC & 0xF) + 1; ! int m = 0; ! for(int i = 0; i < 240; i++) { ! if(m) ! line[i] = line[i-1]; ! m++; ! if(m == mosaicX) ! m = 0; } } --- 688,695 ---- if(control & 0x40) { int mosaicX = (MOSAIC & 0xF) + 1; ! for(int i = 0; i < 240; i+=2) { ! for(int m = 1; i < mosaicX; m++) { ! line[i] = line[i-1]; i++; ! } } } |
From: <for...@us...> - 2004-02-07 15:44:19
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25448 Modified Files: MainWnd.cpp MainWnd.h MainWndFile.cpp VBA.cpp VBA.h Log Message: Fixed screensaver/power management code Index: MainWnd.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWnd.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MainWnd.cpp 5 Feb 2004 11:38:43 -0000 1.9 --- MainWnd.cpp 7 Feb 2004 13:55:16 -0000 1.10 *************** *** 414,417 **** --- 414,418 ---- ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_JOYPAD_AUTOFIRE_A, ID_OPTIONS_JOYPAD_AUTOFIRE_R, OnUpdateOptionsJoypadAutofire) ON_MESSAGE(VBA_CONFIRM_MODE, OnConfirmMode) + ON_MESSAGE(WM_SYSCOMMAND, OnMySysCommand) END_MESSAGE_MAP() *************** *** 422,427 **** void MainWnd::OnClose() { - theApp.enablePowerManagement(); - CWnd::OnClose(); --- 423,426 ---- *************** *** 593,598 **** theApp.rewindSaveNeeded = false; - theApp.disablePowerManagement(); - return true; } --- 592,595 ---- *************** *** 1084,1088 **** if(!theApp.paused) { if(emulating) { - theApp.disablePowerManagement(); soundResume(); } --- 1081,1084 ---- *************** *** 1092,1096 **** if(theApp.pauseWhenInactive) { if(emulating) { - theApp.enablePowerManagement(); soundPause(); } --- 1088,1091 ---- *************** *** 1140,1141 **** --- 1135,1145 ---- DragFinish(hDropInfo); } + + LRESULT MainWnd::OnMySysCommand(WPARAM wParam, LPARAM lParam) + { + if(emulating && !theApp.paused) { + if((wParam&0xFFF0) == SC_SCREENSAVE || (wParam&0xFFF0) == SC_MONITORPOWER) + return 0; + } + return Default(); + } Index: MainWnd.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWnd.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MainWnd.h 19 Jan 2004 23:52:56 -0000 1.4 --- MainWnd.h 7 Feb 2004 13:55:16 -0000 1.5 *************** *** 57,60 **** --- 57,61 ---- bool fileOpenSelect(); afx_msg LRESULT OnConfirmMode(WPARAM, LPARAM); + afx_msg LRESULT OnMySysCommand(WPARAM, LPARAM); afx_msg void OnUpdateFileLoadGameSlot(CCmdUI *pCmdUI); afx_msg void OnUpdateFileSaveGameSlot(CCmdUI *pCmdUI); Index: MainWndFile.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWndFile.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MainWndFile.cpp 28 Jan 2004 17:45:37 -0000 1.3 --- MainWndFile.cpp 7 Feb 2004 13:55:16 -0000 1.4 *************** *** 54,61 **** theApp.wasPaused = true; soundPause(); - theApp.enablePowerManagement(); } else { soundResume(); - theApp.disablePowerManagement(); } } --- 54,59 ---- *************** *** 153,158 **** RedrawWindow(NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN); systemSetTitle("VisualBoyAdvance"); - - theApp.enablePowerManagement(); } --- 151,154 ---- Index: VBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/VBA.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** VBA.cpp 5 Feb 2004 11:38:43 -0000 1.8 --- VBA.cpp 7 Feb 2004 13:55:16 -0000 1.9 *************** *** 2170,2213 **** } - static UINT power_get[3] = { - SPI_GETSCREENSAVETIMEOUT, - SPI_GETLOWPOWERTIMEOUT, - SPI_GETPOWEROFFTIMEOUT - }; - - static UINT power_set[3] = { - SPI_SETSCREENSAVETIMEOUT, - SPI_SETLOWPOWERTIMEOUT, - SPI_SETPOWEROFFTIMEOUT - }; - - static int power[3]; - - void VBA::enablePowerManagement() - { - for(int i = 0;i < 3; i++) { - if(power[i] != -1) - SystemParametersInfo(power_set[i], - power[i], - NULL, - 0); - } - } - - void VBA::disablePowerManagement() - { - for(int i = 0;i < 3; i++) { - power[i] = -1; - if(SystemParametersInfo(power_get[i], - 0, - &power[i], - 0)) - SystemParametersInfo(power_set[i], - 0, - NULL, - 0); - } - } - void winSignal(int, int) { --- 2170,2173 ---- Index: VBA.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/VBA.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VBA.h 28 Jan 2004 17:45:37 -0000 1.4 --- VBA.h 7 Feb 2004 13:55:16 -0000 1.5 *************** *** 222,227 **** public: - void disablePowerManagement(); - void enablePowerManagement(); void saveSettings(); void movieReadNext(); --- 222,225 ---- |
From: <for...@us...> - 2004-02-07 15:36:41
|
Update of /cvsroot/vba/VisualBoyAdvance In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27695 Modified Files: ChangeLog NEWS Log Message: Disable remove intros option (too many problems with it) Index: ChangeLog =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/ChangeLog,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** ChangeLog 7 Feb 2004 13:59:56 -0000 1.67 --- ChangeLog 7 Feb 2004 14:07:28 -0000 1.68 *************** *** 1,4 **** --- 1,7 ---- 2004-02-07 Forgotten <for...@us...> + * src/SDL.cpp (main): disable remove intros option + * src/win32/MainWndOptions.cpp (OnUpdateOptionsEmulatorRemoveintrosgba): disable remove intros option + * src/win32/MainWnd.cpp: disable remove intros option * src/win32/VBA.cpp: fix power management code * src/win32/MainWnd.cpp (OnMySysCommand): fix power management code Index: NEWS =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/NEWS,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** NEWS 7 Feb 2004 13:59:56 -0000 1.55 --- NEWS 7 Feb 2004 14:07:28 -0000 1.56 *************** *** 4,7 **** --- 4,8 ---- - avoid crash when loading an invalid ELF file - avoid turning sound on if soundOffFlag is true + - disabled remove intros option - fixed memory leak in ELF support code - fixed memory corruption if loading a bigger file than the memory to hold it |
From: <for...@us...> - 2004-02-07 15:36:23
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27695/src Modified Files: SDL.cpp VisualBoyAdvance.cfg Log Message: Disable remove intros option (too many problems with it) Index: SDL.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/SDL.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** SDL.cpp 5 Feb 2004 11:38:30 -0000 1.52 --- SDL.cpp 7 Feb 2004 14:07:28 -0000 1.53 *************** *** 2229,2235 **** --- 2229,2237 ---- emulator = GBASystem; + /* disabled due to problems if(removeIntros && rom != NULL) { WRITE32LE(&rom[0], 0xea00002e); } + */ CPUInit(biosFileName, useBios); Index: VisualBoyAdvance.cfg =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/VisualBoyAdvance.cfg,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** VisualBoyAdvance.cfg 20 Nov 2003 11:34:44 -0000 1.22 --- VisualBoyAdvance.cfg 7 Feb 2004 14:07:28 -0000 1.23 *************** *** 132,138 **** soundReverse=0 ! # Remove GBA intros # 0=false, anything else for true ! removeIntros=0 # Save Type --- 132,138 ---- soundReverse=0 ! # Remove GBA intros (not supported anymore) # 0=false, anything else for true ! # removeIntros=0 # Save Type |
From: <for...@us...> - 2004-02-07 15:19:18
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27695/src/win32 Modified Files: MainWnd.cpp MainWndOptions.cpp Log Message: Disable remove intros option (too many problems with it) Index: MainWnd.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWnd.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MainWnd.cpp 7 Feb 2004 13:55:16 -0000 1.10 --- MainWnd.cpp 7 Feb 2004 14:07:28 -0000 1.11 *************** *** 535,541 **** --- 535,543 ---- theApp.emulator = GBASystem; + /* disabled due to problems if(theApp.removeIntros && rom != NULL) { *((u32 *)rom)= 0xea00002e; } + */ if(theApp.autoIPS) { Index: MainWndOptions.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWndOptions.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MainWndOptions.cpp 20 Nov 2003 02:47:10 -0000 1.2 --- MainWndOptions.cpp 7 Feb 2004 14:07:28 -0000 1.3 *************** *** 640,649 **** void MainWnd::OnOptionsEmulatorRemoveintrosgba() { ! theApp.removeIntros = !theApp.removeIntros; } void MainWnd::OnUpdateOptionsEmulatorRemoveintrosgba(CCmdUI* pCmdUI) { ! pCmdUI->SetCheck(theApp.removeIntros); } --- 640,650 ---- void MainWnd::OnOptionsEmulatorRemoveintrosgba() { ! // theApp.removeIntros = !theApp.removeIntros; } void MainWnd::OnUpdateOptionsEmulatorRemoveintrosgba(CCmdUI* pCmdUI) { ! pCmdUI->Enable(false); ! // pCmdUI->SetCheck(theApp.removeIntros); } |
From: <kx...@us...> - 2004-02-07 15:10:12
|
Update of /cvsroot/vba/VisualBoyAdvance/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5443 Modified Files: gba_sdl.vcproj Log Message: Remove GP dependencies Index: gba_sdl.vcproj =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/win32/gba_sdl.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gba_sdl.vcproj 20 Jan 2004 02:16:02 -0000 1.1 --- gba_sdl.vcproj 7 Feb 2004 15:07:18 -0000 1.2 *************** *** 252,265 **** </Filter> <Filter - Name="GP" - Filter=""> - <File - RelativePath="..\src\gp\GP.cpp"> - </File> - <File - RelativePath="..\src\gp\gpGfxRender.cpp"> - </File> - </Filter> - <Filter Name="SDL" Filter=""> --- 252,255 ---- |
From: <for...@us...> - 2004-02-07 14:12:28
|
Update of /cvsroot/vba/VisualBoyAdvance In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26417 Modified Files: ChangeLog NEWS Log Message: Update news/changelog for version 1.7.1 Index: ChangeLog =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/ChangeLog,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** ChangeLog 4 Nov 2003 14:13:57 -0000 1.66 --- ChangeLog 7 Feb 2004 13:59:56 -0000 1.67 *************** *** 1,157 **** ! 2003-09-03 Forgotten <for...@us...> ! ! * src/armdis.cpp: fixed thumb disassembly bug with ldsb and ldrh opcodes ! ! 2003-08-23 Forgotten <for...@us...> ! ! * src/win32/Win32.cpp (updateRenderMethod0): return true if render type did not change ! * src/bios.cpp (BIOS_CpuSet): fixed bug introduced in previous fix ! * src/GBA.cpp (CPULoop): fixed slowdown problem introduced in version 1.6 ! ! 2003-08-09 Forgotten <for...@us...> ! ! * src/GBA.cpp (CPUCheckDMA): fix minor DMA problem introduced with previous fixes ! * src/GBA.cpp: fix DMA timings and add DMA hack fix ! * src/Util.cpp (utilGBAFindSave): change search slightly ! * src/agbprint.cpp (agbPrintWrite): return true to avoid warning message ! * src/win32/TileViewer.cpp (OnMapInfo): fixed tile information when in 256 color mode ! * src/win32/Win32.cpp (initApp): fix bug when initially switching to INI ! ! 2003-08-02 Forgotten <for...@us...> ! ! * src/win32/TileViewer.cpp (render): fixed TileViewer for 256 color display (incorrect tile and address) ! ! 2003-08-01 Forgotten <for...@us...> ! ! * src/win32/Win32.cpp (initApp): changed default rewind interval to 0 (disabled) ! * src/bios.cpp (BIOS_CpuFastSet): fixed ! * src/bios.cpp (BIOS_CpuSet): fixed ! ! 2003-07-21 Forgotten <for...@us...> ! ! * src/win32/Win32.cpp (fileMoviePlay): added message when playing movie ! * src/Sound.cpp (soundTick): produce mute sound while in sleep state ! * src/GBA.cpp (CPULoop): improve stop state/sleep support ! ! 2003-07-19 Forgotten <for...@us...> ! ! * src/win32/Win32.cpp (updateFileMenu): allow customize in fullscreen (not at 320x240 though) ! ! 2003-07-18 Forgotten <for...@us...> ! ! * src/win32/MapView.cpp (renderTextScreen): fixed rendering when 512x512 ! * src/win32/MapView.cpp (GetTextClickAddress): fixed click address for text screens when size > 256 ! ! 2003-07-16 Forgotten <for...@us...> ! ! * src/Sound.cpp (soundEvent): fix sound envelope bug when set to 0 ! ! 2003-07-15 Forgotten <for...@us...> ! ! * src/TestEmu.cpp (systemGbBorderOn): fixed TestEmu compilation ! * src/SDL.cpp: added save type NONE support ! * src/win32/Win32.cpp (helpBugReport): fixed bug with bug report when emulating GB/GBC program ! ! 2003-07-13 Forgotten <for...@us...> ! ! * src/Util.cpp (utilGBAFindSave): added enhanced save type detection ! ! 2003-07-09 Forgotten <for...@us...> ! * src/SDL.cpp: rewind default to disabled ! * src/win32/Win32.cpp: rewind default to disabled ! * src/win32/RewindInterval.cpp (OnOk): allow a rewind interval between 0 and 600 seconds - 0 to disable it ! * src/win32/Win32.cpp (fileMoviePlay): put a warning when playing a movie ! * src/GBA.cpp (CPUReadState): fix sound problem loading old save states ! ! 2003-07-08 Forgotten <for...@us...> ! ! * src/armdis.cpp: fixed thumb disassembly bug ! * src/win32/Win32.cpp: fix rewind enable and reset when loading a game ! * src/win32/Reg.cpp (regQueryBinaryValue): fix problem saving binary settings into INI ! ! 2003-07-05 Forgotten <for...@us...> ! ! * src/Mode0.cpp (mode0RenderLineAll): fixed priority between OBJ Win and Windows ! * src/Mode1.cpp (mode0RenderLineAll): fixed priority between OBJ Win and Windows ! * src/Mode2.cpp (mode0RenderLineAll): fixed priority between OBJ Win and Windows ! * src/Mode3.cpp (mode0RenderLineAll): fixed priority between OBJ Win and Windows ! * src/Mode4.cpp (mode0RenderLineAll): fixed priority between OBJ Win and Windows ! * src/Mode5.cpp (mode0RenderLineAll): fixed priority between OBJ Win and Windows ! ! 2003-07-04 Forgotten <for...@us...> ! ! * src/win32/Win32.cpp: menu toggle can have a customizable accelerator ! * src/win32/Commands.cpp: added file toggle menu ! ! 2003-07-02 Forgotten <for...@us...> ! ! * src/SDL.cpp: fixed type on pause-when-inactive option ! ! 2003-06-29 Forgotten <for...@us...> ! * src/win32/Reg.cpp (regExportSettingsToINI): also exporting settings for viewers ! 2003-06-28 Forgotten <for...@us...> ! * src/win32/Win32.cpp (WindowProc): added rewind interval configuration ! * src/bios.cpp (BIOS_SndDriverJmpTableCopy): simple emulation of function 0x2a ! 2003-06-26 Forgotten <for...@us...> ! * src/win32/Win32.cpp: added movie version for future updates ! 2003-06-25 Forgotten <for...@us...> ! * src/win32/Win32.cpp (helpFAQ): added FAQ menu to take to website ! 2003-06-24 Forgotten <for...@us...> ! * src/win32/Win32.cpp (helpBugReport): added bug report option ! * src/SDL.cpp: added rewind support ! 2003-06-21 Forgotten <for...@us...> ! * src/GBA.cpp (CPULoadRom): speed up loading ! 2003-06-20 Forgotten <for...@us...> ! * src/gb/GB.cpp: added rewind support ! 2003-06-19 Forgotten <for...@us...> ! * src/Cheats.cpp (cheatsCheckKeys): added support for slowdown codes ! * src/elf.cpp (elfGetAddressSymbol): fix crash debugging the initialization code ! 2003-06-17 Forgotten <for...@us...> ! * src/GBA.cpp: added rewind support ! * src/Win32.cpp: added rewind support ! * src/Util.cpp: added memory gzip support for rewind ! 2003-06-15 Forgotten <for...@us...> ! * src/Gfx.h (gfxDrawSprites): emulate sprite priority bug ! * src/GBA.cpp: fix for DMA emulation problems ! 2003-06-13 Forgotten <for...@us...> ! * src/SDL.cpp: support for automatic SGB border ! * src/win32/Win32.cpp (systemGbBorderOn): support for automatic SGB border ! * src/gb/gbSGB.cpp: added support for automatic SGB border ! * src/GBA.cpp: fixed bug with enable/disable layers introduced in version 1.5.1 ! 2003-06-12 Forgotten <for...@us...> ! * src/SDL.cpp: added sound off/enable support ! * src/VisualBoyAdvance.cfg: added sound off/enable flags ! * src/win32/Win32.cpp: added auto hide menu support ! * src/GBA.cpp, src/gb/GB.cpp: code cleanup ! 2003-06-11 Forgotten <for...@us...> ! * src/win32/Win32.cpp: added movie support ! 2003-06-10 Forgotten <for...@us...> ! * GBACheats.cpp: fixed bug with enable/disable cheats --- 1,94 ---- ! 2004-02-07 Forgotten <for...@us...> ! * src/win32/VBA.cpp: fix power management code ! * src/win32/MainWnd.cpp (OnMySysCommand): fix power management code ! * src/win32/MainWndFile.cpp: fix power management code ! 2004-02-06 Forgotten <for...@us...> ! * src/Sound.cpp (soundSetQuality): avoid turning sound on if sound off is checked ! * src/gb/gbSound.cpp (gbSoundSetQuality): avoid turning sound on if sound off is checked ! * src/GBA.cpp (CPUSoftwareInterrupt): added SWI call to exit emulator ! 2004-02-05 Forgotten <for...@us...> ! * src/win32/MainWnd.cpp (FileRun): update battery file more often ! * src/win32/VBA.cpp (system10Frames): update battery file more often ! * src/gb/gbMemory.cpp: update battery file more often ! * src/gb/GB.cpp: update battery file more often ! * src/System.h: update battery file more often ! * src/Sram.cpp (sramWrite): update battery file more often ! * src/SDL.cpp (main): update battery file more often ! * src/GBA.cpp: update battery file more often ! * src/Flash.cpp (flashWrite): update battery file more often ! * src/EEprom.cpp (eepromWrite): update battery file more often ! 2004-01-30 Forgotten <for...@us...> ! * src/win32/OpenGL.cpp (render): fix memory leak in OpenGL rendering ! 2004-01-29 Forgotten <for...@us...> ! * src/gb/gbCodes.h: fix HALT when no matching in IE and IF ! 2004-01-28 Forgotten <for...@us...> ! * src/prof/prof.cpp: fix compile warnings ! * src/win32/MainWndTools.cpp: switch to use structure functions ! * src/win32/MainWndFile.cpp: switch to use structure functions ! * src/win32/VBA.cpp (VBA): use structure instead of individual functions for emulation ! * src/win32/VBA.h (class VBA): use structure instead of individual functions for emulation ! * src/win32/MainWnd.cpp: switch to use structure functions ! * src/System.h: structure for emulator functions ! * src/win32/MainWnd.cpp (FileRun): save rom size for later use ! * src/win32/BugReport.cpp (createReport): include cart save strings to bug report ! 2004-01-25 Forgotten <for...@us...> ! * src/win32/AboutDialog.cpp (OnInitDialog): fix problem with translator URLs not working correctly and force URL to new site ! * src/win32/MainWndHelp.cpp (OnHelpFaq): update FAQ URL to new site ! 2004-01-21 Forgotten <for...@us...> ! * src/Util.cpp (utilLoad): fix possible memory corruption when loading files with a passed in memory location ! 2004-01-20 Forgotten <for...@us...> ! * src/Port.h (READ32LE): big endian updates from flea ! * src/GBA.cpp: big endian updates from flea ! * src/Cheats.cpp: big endian updates from flea ! * src/win32/VBA.cpp (VBA): initialize default GB color palette ! * src/win32/Direct3D.cpp (initialize): avoid resetting GB colors set by user ! * src/win32/OpenGL.cpp (initialize): avoid resetting GB colors set by user ! * src/win32/GDIDisplay.cpp (initialize): avoid resetting GB colors set by user ! * src/win32/DirectDraw.cpp (initializeOffscreen): avoid resetting GB colors set by user ! 2004-01-19 Forgotten <for...@us...> ! * src/gb/GB.cpp (gbEmulate): reset the window line before starting a new frame ! * src/elf.cpp (elfRead): fix memory leak ! * src/GBA.cpp (CPULoadRom): avoid crash with invalid ELF file ! 2004-01-18 Forgotten <for...@us...> ! * src/win32/FileDlg.cpp (FileDlg): fix problem on 320x240 mode ! * src/win32/ZoomControl.cpp (OnPaint): fix crash on map/oam/tile viewer ! 2004-01-16 Forgotten <for...@us...> ! * win32/GBMemoryViewerDlg.cpp (OnLoad): fixed bug loading memory dump ! * win32/MemoryViewerDlg.cpp (OnLoad): fixed bug loading memory dump ! 2004-01-15 Forgotten <for...@us...> ! * win32/VBA.cpp: store throttle value ! 2004-01-14 Forgotten <for...@us...> ! * win32/VBA.cpp (adjustDestRect): fix multi-mon support ! * win32/FileDlg.cpp (FileDlg): fix problem on VC 7.1 ! * win32/MainWnd.cpp (OnActivateApp): fix compile errors on VC 7.1 ! * win32/GBCheatsDlg.cpp: fix compile errors on VC 7.1 ! * win32/GBACheats.cpp: fix compile errors on VC 7.1 ! * bios.cpp: fix compile errors on VC 7.1 Index: NEWS =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/NEWS,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** NEWS 9 Dec 2003 21:53:40 -0000 1.54 --- NEWS 7 Feb 2004 13:59:56 -0000 1.55 *************** *** 1,2 **** --- 1,32 ---- + Version 1.7.1: + Core changes: + - added SWI call (0xf9 in thumb mode) to exit emulator in SDL version + - avoid crash when loading an invalid ELF file + - avoid turning sound on if soundOffFlag is true + - fixed memory leak in ELF support code + - fixed memory corruption if loading a bigger file than the memory to hold it + - fixed some compile warnings in the profiling code + - merged some big endian fixes into the code + - update battery files more often (a bit after the save memory is last updated) + + Gameboy: + - fixed bug with window support introduced in version 1.7 + - fixed HALT bug when no matching bits for interrupt + + Windows: + - added cartridge save strings to bug report + - changed default button on disassembly views to Go instead of Close + - changed power management/screen saver disabling code again to avoid problems + - fixed compilation problems on VC 7 + - fixed multi-monitor support + - fixed bug loading memory dumps + - fixed crash onb map/oam/tile viewers + - fixed problem 320x240 mode open/save dialogs + - fixed bug where user selected Gameboy colors were reset and not stored + - fixed bug rendering the translator URL + - fixed memory leak in OpenGL code which caused nasty problems + - store throttle value between restarts of the emulator + - updated FAQ and URL links to the new site + Version 1.7: Core changes: |
From: <for...@us...> - 2004-02-07 00:20:56
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20964 Modified Files: Sound.cpp Log Message: Avoid turning sound on when changing sound quality if soundOffFlag is true. Index: Sound.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Sound.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Sound.cpp 4 Nov 2003 14:11:52 -0000 1.12 --- Sound.cpp 7 Feb 2004 00:18:07 -0000 1.13 *************** *** 1285,1292 **** { if(soundQuality != quality && systemCanChangeSoundQuality()) { ! soundShutdown(); soundQuality = quality; soundNextPosition = 0; ! soundInit(); SOUND_CLOCK_TICKS = USE_TICKS_AS * soundQuality; soundIndex = 0; --- 1285,1294 ---- { if(soundQuality != quality && systemCanChangeSoundQuality()) { ! if(!soundOffFlag) ! soundShutdown(); soundQuality = quality; soundNextPosition = 0; ! if(!soundOffFlag) ! soundInit(); SOUND_CLOCK_TICKS = USE_TICKS_AS * soundQuality; soundIndex = 0; |
From: <for...@us...> - 2004-02-07 00:20:56
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20964/gb Modified Files: gbSound.cpp Log Message: Avoid turning sound on when changing sound quality if soundOffFlag is true. Index: gbSound.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbSound.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gbSound.cpp 4 Nov 2003 14:08:07 -0000 1.5 --- gbSound.cpp 7 Feb 2004 00:18:07 -0000 1.6 *************** *** 119,122 **** --- 119,123 ---- extern bool soundLowPass; extern bool soundReverse; + extern bool soundOffFlag; bool gbDigitalSound = false; *************** *** 854,861 **** { if(soundQuality != quality && systemCanChangeSoundQuality()) { ! soundShutdown(); soundQuality = quality; soundNextPosition = 0; ! soundInit(); SOUND_CLOCK_TICKS = (gbSpeed ? 2 : 1) * 24 * soundQuality; soundIndex = 0; --- 855,864 ---- { if(soundQuality != quality && systemCanChangeSoundQuality()) { ! if(!soundOffFlag) ! soundShutdown(); soundQuality = quality; soundNextPosition = 0; ! if(!soundOffFlag) ! soundInit(); SOUND_CLOCK_TICKS = (gbSpeed ? 2 : 1) * 24 * soundQuality; soundIndex = 0; |
From: <for...@us...> - 2004-02-06 11:29:40
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4797 Modified Files: GBA.cpp Log Message: Added BIOS call to exit the emulator in SDL version (SWI #0xf9 in thumb mode) Tracker #880413 Index: GBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/GBA.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** GBA.cpp 5 Feb 2004 11:38:30 -0000 1.51 --- GBA.cpp 6 Feb 2004 11:26:58 -0000 1.52 *************** *** 1675,1678 **** --- 1675,1685 ---- return; } + #ifdef SDL + if(comment == 0xf9) { + emulating = 0; + CPU_BREAK_LOOP_2; + return; + } + #endif if(useBios) { #ifdef DEV_VERSION |
From: <for...@us...> - 2004-02-06 11:13:10
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2135 Modified Files: vba.rc Log Message: Change default button on disassembly view to Go instead of Close Tracker #891315 Index: vba.rc =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/vba.rc,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** vba.rc 25 Jan 2004 13:49:29 -0000 1.44 --- vba.rc 6 Feb 2004 11:10:27 -0000 1.45 *************** *** 725,729 **** EDITTEXT IDC_ADDRESS,158,7,65,14,ES_UPPERCASE | ES_AUTOHSCROLL | WS_GROUP ! PUSHBUTTON "Go",IDC_GO,232,7,50,14 LISTBOX IDC_DISASSEMBLE,7,25,276,161,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_TABSTOP --- 725,729 ---- EDITTEXT IDC_ADDRESS,158,7,65,14,ES_UPPERCASE | ES_AUTOHSCROLL | WS_GROUP ! DEFPUSHBUTTON "Go",IDC_GO,232,7,50,14 LISTBOX IDC_DISASSEMBLE,7,25,276,161,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_TABSTOP *************** *** 732,736 **** PUSHBUTTON "Refresh",IDC_REFRESH,120,204,50,14 PUSHBUTTON "Next",IDC_NEXT,233,204,50,14 ! DEFPUSHBUTTON "Close",IDC_CLOSE,346,204,50,14 LTEXT "R0:",IDC_STATIC,309,7,18,8 LTEXT "R1:",IDC_STATIC,309,15,18,8 --- 732,736 ---- PUSHBUTTON "Refresh",IDC_REFRESH,120,204,50,14 PUSHBUTTON "Next",IDC_NEXT,233,204,50,14 ! PUSHBUTTON "Close",IDC_CLOSE,346,204,50,14 LTEXT "R0:",IDC_STATIC,309,7,18,8 LTEXT "R1:",IDC_STATIC,309,15,18,8 *************** *** 913,917 **** EDITTEXT IDC_ADDRESS,7,7,65,14,ES_UPPERCASE | ES_AUTOHSCROLL | WS_GROUP ! PUSHBUTTON "Go",IDC_GO,81,7,50,14 LISTBOX IDC_DISASSEMBLE,7,25,222,161,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_TABSTOP --- 913,917 ---- EDITTEXT IDC_ADDRESS,7,7,65,14,ES_UPPERCASE | ES_AUTOHSCROLL | WS_GROUP ! DEFPUSHBUTTON "Go",IDC_GO,81,7,50,14 LISTBOX IDC_DISASSEMBLE,7,25,222,161,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_TABSTOP *************** *** 920,924 **** PUSHBUTTON "Refresh",IDC_REFRESH,100,204,50,14 PUSHBUTTON "Next",IDC_NEXT,193,204,50,14 ! DEFPUSHBUTTON "Close",IDC_CLOSE,287,204,50,14 LTEXT "AF:",IDC_STATIC,250,25,18,8 LTEXT "BC:",IDC_STATIC,250,35,18,8 --- 920,924 ---- PUSHBUTTON "Refresh",IDC_REFRESH,100,204,50,14 PUSHBUTTON "Next",IDC_NEXT,193,204,50,14 ! PUSHBUTTON "Close",IDC_CLOSE,287,204,50,14 LTEXT "AF:",IDC_STATIC,250,25,18,8 LTEXT "BC:",IDC_STATIC,250,35,18,8 |
From: <kx...@us...> - 2004-02-05 22:00:58
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12371 Modified Files: TestEmu.cpp Log Message: Update battery file more often, a while after the game stops writing to it (RFE #882246) Index: TestEmu.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/TestEmu.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TestEmu.cpp 31 Jan 2004 01:14:36 -0000 1.9 --- TestEmu.cpp 5 Feb 2004 21:58:16 -0000 1.10 *************** *** 74,77 **** --- 74,78 ---- int systemDebug = 0; int systemVerbose = 0; + int systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; int cartridgeType = 3; |