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
|
From: Spacy <sp...@us...> - 2006-05-27 14:10:38
|
Update of /cvsroot/vba/VisualBoyAdvance/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26366/win32 Modified Files: .cvsignore Log Message: Index: .cvsignore =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/win32/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 13 May 2006 16:38:00 -0000 1.2 --- .cvsignore 27 May 2006 14:10:22 -0000 1.3 *************** *** 4,6 **** gba_sdl.ncb gba_sdl.opt gba_sdl.plg vba_vs2005.ncb ! vba_vs2005.vcproj.A2.Spacy.user \ No newline at end of file --- 4,9 ---- gba_sdl.ncb gba_sdl.opt gba_sdl.plg vba_vs2005.ncb ! vba_vs2005.vcproj.A2.Spacy.user ! MFC_Release ! MFC_Debug ! vba_vs2005.vcproj.A1.Spacy.user \ No newline at end of file |
From: Spacy <sp...@us...> - 2006-05-26 14:38:53
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12503/src/win32 Modified Files: Directories.cpp Directories.h Log Message: made directories edit boxes editable by hand Index: Directories.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/Directories.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Directories.h 13 May 2004 15:06:49 -0000 1.2 --- Directories.h 26 May 2006 14:38:47 -0000 1.3 *************** *** 76,80 **** //}}AFX_MSG DECLARE_MESSAGE_MAP() ! }; //{{AFX_INSERT_LOCATION}} --- 76,82 ---- //}}AFX_MSG DECLARE_MESSAGE_MAP() ! public: ! // afx_msg void OnBnClickedOk(); ! }; //{{AFX_INSERT_LOCATION}} Index: Directories.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/Directories.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Directories.cpp 13 May 2004 15:06:49 -0000 1.2 --- Directories.cpp 26 May 2006 14:38:47 -0000 1.3 *************** *** 55,61 **** : CDialog(Directories::IDD, pParent) { - //{{AFX_DATA_INIT(Directories) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT } --- 55,58 ---- *************** *** 64,68 **** { CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(Directories) DDX_Control(pDX, IDC_SAVE_PATH, m_savePath); DDX_Control(pDX, IDC_ROM_PATH, m_romPath); --- 61,64 ---- *************** *** 70,79 **** DDX_Control(pDX, IDC_CAPTURE_PATH, m_capturePath); DDX_Control(pDX, IDC_BATTERY_PATH, m_batteryPath); - //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(Directories, CDialog) - //{{AFX_MSG_MAP(Directories) ON_BN_CLICKED(IDC_BATTERY_DIR, OnBatteryDir) ON_BN_CLICKED(IDC_BATTERY_DIR_RESET, OnBatteryDirReset) --- 66,73 ---- *************** *** 86,91 **** ON_BN_CLICKED(IDC_SAVE_DIR, OnSaveDir) ON_BN_CLICKED(IDC_SAVE_DIR_RESET, OnSaveDirReset) ! //}}AFX_MSG_MAP ! END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// --- 80,84 ---- ON_BN_CLICKED(IDC_SAVE_DIR, OnSaveDir) ON_BN_CLICKED(IDC_SAVE_DIR_RESET, OnSaveDirReset) ! END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// *************** *** 255,257 **** } return res; ! } --- 248,250 ---- } return res; ! } \ No newline at end of file |
From: Spacy <sp...@us...> - 2006-05-26 14:37:49
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10723/src/win32 Modified Files: AboutDialog.cpp AboutDialog.h resource.h vba.rc vba.rc2 Log Message: updated about dialog Index: AboutDialog.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/AboutDialog.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AboutDialog.h 13 May 2004 15:06:49 -0000 1.2 --- AboutDialog.h 26 May 2006 14:37:41 -0000 1.3 *************** *** 61,65 **** //{{AFX_MSG(AboutDialog) virtual BOOL OnInitDialog(); ! virtual void OnOK(); //}}AFX_MSG --- 61,65 ---- //{{AFX_MSG(AboutDialog) virtual BOOL OnInitDialog(); ! // virtual void OnOK(); //}}AFX_MSG Index: vba.rc2 =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/vba.rc2,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vba.rc2 13 May 2006 16:32:16 -0000 1.3 --- vba.rc2 26 May 2006 14:37:41 -0000 1.4 *************** *** 35,43 **** BEGIN VALUE "Comments", "VisualBoyAdvance comes with NO WARRANTY. Use it at your own risk.\0" ! VALUE "CompanyName", "None\0" VALUE "FileDescription", "VisualBoyAdvance emulator\0" VALUE "FileVersion", STRFILEVER VALUE "InternalName", "VisualBoyAdvance\0" ! VALUE "LegalCopyright", "Copyright © 2004 Forgotten and the VBA team\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "VisualBoyAdvance.exe\0" --- 35,43 ---- BEGIN VALUE "Comments", "VisualBoyAdvance comes with NO WARRANTY. Use it at your own risk.\0" ! VALUE "CompanyName", "http://vba.ngemu.com/\0" VALUE "FileDescription", "VisualBoyAdvance emulator\0" VALUE "FileVersion", STRFILEVER VALUE "InternalName", "VisualBoyAdvance\0" ! VALUE "LegalCopyright", "Copyright © 2006 VBA development team\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "VisualBoyAdvance.exe\0" Index: vba.rc =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/vba.rc,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** vba.rc 13 May 2006 16:32:16 -0000 1.53 --- vba.rc 26 May 2006 14:37:41 -0000 1.54 *************** *** 45,53 **** BEGIN VALUE "Comments", "VisualBoyAdvance comes with NO WARRANTY. Use it at your own risk." ! VALUE "CompanyName", "None" VALUE "FileDescription", "VisualBoyAdvance emulator" VALUE "FileVersion", "1, 8, 0, 600" VALUE "InternalName", "VisualBoyAdvance" ! VALUE "LegalCopyright", "Copyright © 2004 Forgotten and the VBA team" VALUE "OriginalFilename", "VisualBoyAdvance.exe" VALUE "PrivateBuild", "0" --- 45,53 ---- BEGIN VALUE "Comments", "VisualBoyAdvance comes with NO WARRANTY. Use it at your own risk." ! VALUE "CompanyName", "http://vba.ngemu.com/" VALUE "FileDescription", "VisualBoyAdvance emulator" VALUE "FileVersion", "1, 8, 0, 600" VALUE "InternalName", "VisualBoyAdvance" ! VALUE "LegalCopyright", "Copyright © 2006 VBA development team" VALUE "OriginalFilename", "VisualBoyAdvance.exe" VALUE "PrivateBuild", "0" *************** *** 126,148 **** END ! IDD_ABOUT DIALOG 0, 0, 164, 93 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "About VisualBoyAdvance" ! FONT 8, "MS Sans Serif" BEGIN ! DEFPUSHBUTTON "OK",IDOK,56,72,50,14 ! ICON 101,IDC_STATIC,5,12,21,20 ! CTEXT "VisualBoyAdvance Emulator",IDC_STATIC,14,7,134,8 ! CTEXT "Copyright (c) 2004 Forgotten and the VBA team",IDC_STATIC,6,35,150,8 ! CTEXT "http://vba.ngemu.com",IDC_URL,43,55,76,8 ! CTEXT "Contribution by Costis",IDC_STATIC,30,45,102,8 ! CTEXT "Version",IDC_STATIC,46,16,70,8 ! CTEXT "",IDC_VERSION,60,25,43,8,SS_NOPREFIX END ! IDD_DIRECTORIES DIALOG 0, 0, 284, 129 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Directories" ! FONT 8, "MS Sans Serif" BEGIN PUSHBUTTON "Browse...",IDC_ROM_DIR,174,7,50,14 --- 126,147 ---- END ! IDD_ABOUT DIALOGEX 0, 0, 154, 78 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "About" ! FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN ! ICON "IDI_ICON",IDC_STATIC,6,6,21,20 ! CTEXT "VisualBoyAdvance Emulator",IDC_STATIC,30,6,120,8 ! CTEXT "Copyright © 2006 VBA development team",IDC_STATIC,6,36,144,8 ! CTEXT "http://vba.ngemu.com",IDC_URL,6,66,144,8 ! CTEXT "Contribution by Costis",IDC_STATIC,6,48,144,8 ! CTEXT "Version",IDC_STATIC,30,18,60,8 ! CTEXT "",IDC_VERSION,90,18,60,8,SS_NOPREFIX END ! IDD_DIRECTORIES DIALOGEX 0, 0, 284, 129 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Directories" ! FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN PUSHBUTTON "Browse...",IDC_ROM_DIR,174,7,50,14 *************** *** 157,166 **** LTEXT "Save Game:",IDC_STATIC,7,66,40,8 LTEXT "Capture:",IDC_STATIC,7,85,28,8 ! EDITTEXT IDC_ROM_PATH,49,7,121,14,ES_AUTOHSCROLL | WS_DISABLED ! EDITTEXT IDC_BATTERY_PATH,49,45,121,14,ES_AUTOHSCROLL | WS_DISABLED ! EDITTEXT IDC_SAVE_PATH,49,64,121,14,ES_AUTOHSCROLL | WS_DISABLED ! EDITTEXT IDC_CAPTURE_PATH,49,83,121,14,ES_AUTOHSCROLL | WS_DISABLED LTEXT "GB ROM:",IDC_STATIC,7,28,32,8 ! EDITTEXT IDC_GBROM_PATH,49,26,121,14,ES_AUTOHSCROLL | WS_DISABLED PUSHBUTTON "Reset",IDC_ROM_DIR_RESET,228,6,50,14 PUSHBUTTON "Reset",IDC_GBROM_DIR_RESET,228,25,50,14 --- 156,165 ---- LTEXT "Save Game:",IDC_STATIC,7,66,40,8 LTEXT "Capture:",IDC_STATIC,7,85,28,8 ! EDITTEXT IDC_ROM_PATH,49,7,121,14,ES_AUTOHSCROLL ! EDITTEXT IDC_BATTERY_PATH,49,45,121,14,ES_AUTOHSCROLL ! EDITTEXT IDC_SAVE_PATH,49,64,121,14,ES_AUTOHSCROLL ! EDITTEXT IDC_CAPTURE_PATH,49,83,121,14,ES_AUTOHSCROLL LTEXT "GB ROM:",IDC_STATIC,7,28,32,8 ! EDITTEXT IDC_GBROM_PATH,49,26,121,14,ES_AUTOHSCROLL PUSHBUTTON "Reset",IDC_ROM_DIR_RESET,228,6,50,14 PUSHBUTTON "Reset",IDC_GBROM_DIR_RESET,228,25,50,14 *************** *** 1105,1111 **** BEGIN LEFTMARGIN, 7 ! RIGHTMARGIN, 157 TOPMARGIN, 7 ! BOTTOMMARGIN, 86 END --- 1104,1110 ---- BEGIN LEFTMARGIN, 7 ! RIGHTMARGIN, 147 TOPMARGIN, 7 ! BOTTOMMARGIN, 71 END Index: resource.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/resource.h,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** resource.h 13 May 2006 16:32:16 -0000 1.41 --- resource.h 26 May 2006 14:37:41 -0000 1.42 *************** *** 45,49 **** #define IDS_CBA_CODE_WARNING 40 #define IDS_OUT_OF_MEMORY 41 - #define IDI_ICON 101 #define IDD_REGISTERS 102 #define IDD_DEBUG 103 --- 45,48 ---- Index: AboutDialog.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/AboutDialog.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AboutDialog.cpp 13 May 2004 15:06:49 -0000 1.3 --- AboutDialog.cpp 26 May 2006 14:37:41 -0000 1.4 *************** *** 75,83 **** // EXCEPTION: OCX Property Pages should return FALSE } - - void AboutDialog::OnOK() - { - // TODO: Add extra validation here - - CDialog::OnOK(); - } --- 75,76 ---- |
From: Spacy <sp...@us...> - 2006-05-26 14:37:47
|
Update of /cvsroot/vba/VisualBoyAdvance/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10723/win32 Modified Files: vba_vs2005.suo vba_vs2005.vcproj Log Message: updated about dialog Index: vba_vs2005.vcproj =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/win32/vba_vs2005.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** vba_vs2005.vcproj 13 May 2006 16:25:15 -0000 1.1 --- vba_vs2005.vcproj 26 May 2006 14:37:41 -0000 1.2 *************** *** 2521,2524 **** --- 2521,2528 ---- </FileConfiguration> </File> + <File + RelativePath="..\src\win32\vbavista.ico" + > + </File> </Filter> <Filter *************** *** 4768,4776 **** </Filter> </Filter> </Files> <Globals> <Global Name="RESOURCE_FILE" ! Value="\Dev\VisualBoyAdvance\src\win32\vba.rc" /> </Globals> --- 4772,4784 ---- </Filter> </Filter> + <File + RelativePath="..\src\win32\VisualBoyAdvance.exe.manifest" + > + </File> </Files> <Globals> <Global Name="RESOURCE_FILE" ! Value="\Dokumente und Einstellungen\Spacy\Eigene Dateien\dev\VisualBoyAdvance\src\win32\vba.rc" /> </Globals> Index: vba_vs2005.suo =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/win32/vba_vs2005.suo,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsVt1NC5 and /tmp/cvsYFzSg2 differ |
From: Spacy <sp...@us...> - 2006-05-26 14:32:38
|
Update of /cvsroot/vba/VisualBoyAdvance In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10279 Modified Files: INSTALL Log Message: corrected informations Index: INSTALL =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/INSTALL,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** INSTALL 13 May 2006 16:23:15 -0000 1.5 --- INSTALL 26 May 2006 14:32:26 -0000 1.6 *************** *** 70,89 **** Needed software: ! - Microsoft Visual C++ 2005 > http://msdn.microsoft.com/visualc/ > You do not need the DLL runtimes and the .NET Framework ! - Microsoft Platform SDK > http://www.microsoft.com/downloads/details.aspx?FamilyId=E15438AC-60BE-41BD-AA14-7F1E0F19CA0D&displaylang=en ! - Microsoft DirectX 9.0 SDK > http://msdn.microsoft.com/directx/sdk/ ! - Yasm > http://www.tortall.net/projects/yasm/ > Unpack it anywhere on your pc, rename the exe to "yasm.exe" and add it to "Tools>Options>Projects and Solutions>VC++ Directories>Executable files" ! - AMD CodeAnalyst > http://developer.amd.com/cawin.aspx?session_id=FB$37649@DJEBIGID > Free and easy profiling for AMD CPUs (32bit and 64bit), Visual Studio 2005 plugin ! Those are all needed packages for now. The VBA source also includes the sources of various free libraries for zip, image and skin support. Those can be accessed through the "dependencies" folder in the main --- 70,89 ---- Needed software: ! - Microsoft Visual C++ 2005 (buy) > http://msdn.microsoft.com/visualc/ > You do not need the DLL runtimes and the .NET Framework ! - Microsoft Platform SDK (free, optional) > http://www.microsoft.com/downloads/details.aspx?FamilyId=E15438AC-60BE-41BD-AA14-7F1E0F19CA0D&displaylang=en ! - Microsoft DirectX 9.0 SDK (free) > http://msdn.microsoft.com/directx/sdk/ ! - Yasm (free) > http://www.tortall.net/projects/yasm/ > Unpack it anywhere on your pc, rename the exe to "yasm.exe" and add it to "Tools>Options>Projects and Solutions>VC++ Directories>Executable files" ! - AMD CodeAnalyst (optional) > http://developer.amd.com/cawin.aspx?session_id=FB$37649@DJEBIGID > Free and easy profiling for AMD CPUs (32bit and 64bit), Visual Studio 2005 plugin ! Those are all packages for now. The VBA source also includes the sources of various free libraries for zip, image and skin support. Those can be accessed through the "dependencies" folder in the main |
From: Spacy <sp...@us...> - 2006-05-13 16:42:52
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/dependencies/zlib In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10293/win32/dependencies/zlib Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- zlib.vcproj.A2.Spacy.user debug release |
From: Spacy <sp...@us...> - 2006-05-13 16:42:19
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/dependencies/libtiff In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10265/win32/dependencies/libtiff Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- libtiff.vcproj.A2.Spacy.user debug release |
From: Spacy <sp...@us...> - 2006-05-13 16:41:52
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/dependencies/libpng In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9939/win32/dependencies/libpng Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- release libpng.vcproj.A2.Spacy.user debug |
From: Spacy <sp...@us...> - 2006-05-13 16:41:20
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/dependencies/libjpeg In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9917/win32/dependencies/libjpeg Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- release debug libjpeg.vcproj.A2.Spacy.user |
From: Spacy <sp...@us...> - 2006-05-13 16:40:24
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/dependencies/libjasper In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9585/win32/dependencies/libjasper Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- libjasper.vcproj.A2.Spacy.user release debug |
From: Spacy <sp...@us...> - 2006-05-13 16:39:21
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/dependencies/cximage In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9239/win32/dependencies/cximage Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- debug release cximage.vcproj.A2.Spacy.user |
From: Spacy <sp...@us...> - 2006-05-13 16:38:06
|
Update of /cvsroot/vba/VisualBoyAdvance/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8627/win32 Modified Files: .cvsignore Log Message: added vs2005 outputs to ignore list Index: .cvsignore =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/win32/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 22 Oct 2002 20:27:46 -0000 1.1 --- .cvsignore 13 May 2006 16:38:00 -0000 1.2 *************** *** 1,3 **** --- 1,6 ---- Debug Release ReleaseNoDev SDLDebug SDLRelease + mfc_release mfc_debug sdl_release sdl_debug GBA.ncb GBA.opt GBA.plg gba_sdl.ncb gba_sdl.opt gba_sdl.plg + vba_vs2005.ncb + vba_vs2005.vcproj.A2.Spacy.user \ No newline at end of file |
From: Spacy <sp...@us...> - 2006-05-13 16:32:22
|
Update of /cvsroot/vba/VisualBoyAdvance/src/sdl In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6744/src/sdl Modified Files: SDL.cpp debugger.cpp Log Message: vs2005 compatibility Index: SDL.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/sdl/SDL.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SDL.cpp 8 May 2006 10:12:44 -0000 1.10 --- SDL.cpp 13 May 2006 16:32:16 -0000 1.11 *************** *** 24,42 **** #include <sys/stat.h> ! #include "AutoBuild.h" #include "SDL.h" ! #include "GBA.h" ! #include "agbprint.h" ! #include "Flash.h" ! #include "Port.h" #include "debugger.h" ! #include "RTC.h" ! #include "Sound.h" ! #include "Text.h" ! #include "unzip.h" ! #include "Util.h" ! #include "gb/GB.h" ! #include "gb/gbGlobals.h" #ifndef WIN32 --- 24,42 ---- #include <sys/stat.h> ! #include "../AutoBuild.h" #include "SDL.h" ! #include "../GBA.h" ! #include "../agbprint.h" ! #include "../Flash.h" ! #include "../Port.h" #include "debugger.h" ! #include "../RTC.h" ! #include "../Sound.h" ! #include "../Text.h" ! #include "../unzip.h" ! #include "../Util.h" ! #include "../gb/GB.h" ! #include "../gb/gbGlobals.h" #ifndef WIN32 *************** *** 51,55 **** # define HAVE_DECL_GETOPT 0 # define __STDC__ 1 ! # include "getopt.h" #else // ! __GNUC__ # define HAVE_DECL_GETOPT 1 --- 51,55 ---- # define HAVE_DECL_GETOPT 0 # define __STDC__ 1 ! # include "../getopt.h" #else // ! __GNUC__ # define HAVE_DECL_GETOPT 1 Index: debugger.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/sdl/debugger.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** debugger.cpp 25 Jun 2005 06:17:52 -0000 1.7 --- debugger.cpp 13 May 2006 16:32:16 -0000 1.8 *************** *** 24,32 **** #include <ctype.h> ! #include "GBA.h" ! #include "Port.h" ! #include "armdis.h" ! #include "elf.h" ! #include "exprNode.h" extern bool debugger; --- 24,32 ---- #include <ctype.h> ! #include "../GBA.h" ! #include "../Port.h" ! #include "../armdis.h" ! #include "../elf.h" ! #include "../exprNode.h" extern bool debugger; *************** *** 1067,1071 **** address &= 0x3ffff; final &= 0x3ffff; ! for(int i = address; i < final; i++) if(freezeWorkRAM[i] == 1) freezeWorkRAM[i] = 0; --- 1067,1071 ---- address &= 0x3ffff; final &= 0x3ffff; ! for(u32 i = address; i < final; i++) if(freezeWorkRAM[i] == 1) freezeWorkRAM[i] = 0; *************** *** 1078,1082 **** address &= 0x7fff; final &= 0x7fff; ! for(int i = address; i < final; i++) if(freezeInternalRAM[i] == 1) freezeInternalRAM[i] = 0; --- 1078,1082 ---- address &= 0x7fff; final &= 0x7fff; ! for(u32 i = address; i < final; i++) if(freezeInternalRAM[i] == 1) freezeInternalRAM[i] = 0; *************** *** 1167,1171 **** address &= 0x3ffff; final &= 0x3ffff; ! for(int i = address; i < final; i++) if(freezeWorkRAM[i] == 2) freezeWorkRAM[i] = 0; --- 1167,1171 ---- address &= 0x3ffff; final &= 0x3ffff; ! for(u32 i = address; i < final; i++) if(freezeWorkRAM[i] == 2) freezeWorkRAM[i] = 0; *************** *** 1178,1182 **** address &= 0x7fff; final &= 0x7fff; ! for(int i = address; i < final; i++) if(freezeInternalRAM[i] == 2) freezeInternalRAM[i] = 0; --- 1178,1182 ---- address &= 0x7fff; final &= 0x7fff; ! for(u32 i = address; i < final; i++) if(freezeInternalRAM[i] == 2) freezeInternalRAM[i] = 0; *************** *** 1604,1608 **** u32 addr = 0; sscanf(args[1], "%x", &addr); ! for(int i = 0; i < 16; i++) { int a = debuggerReadByte(addr); int b = debuggerReadByte(addr+1); --- 1604,1608 ---- u32 addr = 0; sscanf(args[1], "%x", &addr); ! for(int _i = 0; _i < 16; _i++) { int a = debuggerReadByte(addr); int b = debuggerReadByte(addr+1); *************** *** 1640,1644 **** sscanf(args[1], "%x", &addr); addr = addr & 0xfffffffe; ! for(int i = 0; i < 16; i++) { int a = debuggerReadByte(addr); int b = debuggerReadByte(addr+1); --- 1640,1644 ---- sscanf(args[1], "%x", &addr); addr = addr & 0xfffffffe; ! for(int _i = 0; _i < 16; _i++) { int a = debuggerReadByte(addr); int b = debuggerReadByte(addr+1); *************** *** 1676,1680 **** sscanf(args[1], "%x", &addr); addr = addr & 0xfffffffc; ! for(int i = 0; i < 16; i++) { int a = debuggerReadByte(addr); int b = debuggerReadByte(addr+1); --- 1676,1680 ---- sscanf(args[1], "%x", &addr); addr = addr & 0xfffffffc; ! for(int _i = 0; _i < 16; _i++) { int a = debuggerReadByte(addr); int b = debuggerReadByte(addr+1); |
From: Spacy <sp...@us...> - 2006-05-13 16:32:19
|
Update of /cvsroot/vba/VisualBoyAdvance/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6744/src/win32 Modified Files: AccelEditor.cpp CmdAccelOb.cpp Direct3D.cpp DirectDraw.cpp DirectInput.cpp Joypad.cpp MainWndFile.cpp VBA.cpp VideoMode.cpp resource.h vba.rc vba.rc2 Removed Files: UniVideoModeDlg.cpp UniVideoModeDlg.h Log Message: vs2005 compatibility Index: vba.rc2 =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/vba.rc2,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vba.rc2 15 May 2004 14:07:51 -0000 1.2 --- vba.rc2 13 May 2006 16:32:16 -0000 1.3 *************** *** 1,4 **** --- 1,15 ---- #ifndef _MAC #include "../AutoBuild.h" + + #if _MSC_VER >= 1400 + // use modern icon + IDI_ICON ICON DISCARDABLE "vbavista.ico" + #else + // use traditional icon + IDI_ICON ICON DISCARDABLE "gbadvance.ico" + #endif + + + ///////////////////////////////////////////////////////////////////////////// // --- UniVideoModeDlg.cpp DELETED --- Index: CmdAccelOb.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/CmdAccelOb.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CmdAccelOb.cpp 4 Nov 2003 14:09:52 -0000 1.2 --- CmdAccelOb.cpp 13 May 2006 16:32:16 -0000 1.3 *************** *** 265,269 **** // modifiers part ! for (int i = 0; i < sizetable(mapVirtSysKeys); i++) { if (m_cVirt & mapVirtSysKeys[i].wKey) { szBuffer += mapVirtSysKeys[i].szKey; --- 265,270 ---- // modifiers part ! int i; ! for (i = 0; i < sizetable(mapVirtSysKeys); i++) { if (m_cVirt & mapVirtSysKeys[i].wKey) { szBuffer += mapVirtSysKeys[i].szKey; Index: DirectInput.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/DirectInput.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DirectInput.cpp 30 Apr 2006 14:31:17 -0000 1.4 --- DirectInput.cpp 13 May 2006 16:32:16 -0000 1.5 *************** *** 723,727 **** if(dinputDLL) { ! AfxFreeLibrary(dinputDLL); dinputDLL = NULL; } --- 723,731 ---- if(dinputDLL) { ! #ifdef _AFXDLL ! AfxFreeLibrary( dinputDLL ); ! #else ! FreeLibrary( dinputDLL ); ! #endif dinputDLL = NULL; } *************** *** 734,738 **** 0, "VBA.ini"); ! dinputDLL = AfxLoadLibrary("DINPUT.DLL"); HRESULT (WINAPI *DInputCreate)(HINSTANCE,DWORD,LPDIRECTINPUT *,IUnknown *); if(dinputDLL != NULL) { --- 738,747 ---- 0, "VBA.ini"); ! #ifdef _AFXDLL ! dinputDLL = AfxLoadLibrary("dinput.dll"); ! #else ! dinputDLL = LoadLibrary( _T("dinput.dll") ); ! #endif ! HRESULT (WINAPI *DInputCreate)(HINSTANCE,DWORD,LPDIRECTINPUT *,IUnknown *); if(dinputDLL != NULL) { *************** *** 802,806 **** } ! for(int i = 1; i < numDevices; i++) { pDevices[i].device->SetDataFormat(&c_dfDIJoystick); pDevices[i].needed = false; --- 811,816 ---- } ! int i; ! for(i = 1; i < numDevices; i++) { pDevices[i].device->SetDataFormat(&c_dfDIJoystick); pDevices[i].needed = false; Index: MainWndFile.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWndFile.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MainWndFile.cpp 30 Apr 2006 14:32:53 -0000 1.12 --- MainWndFile.cpp 13 May 2006 16:32:16 -0000 1.13 *************** *** 738,742 **** CFileStatus status; CString str; ! unsigned long time = (unsigned long)-1; int found = 0; --- 738,742 ---- CFileStatus status; CString str; ! __time64_t time = -1; int found = 0; *************** *** 824,828 **** CFileStatus status; CString str; ! unsigned long time = 0; int found = -1; --- 824,828 ---- CFileStatus status; CString str; ! __time64_t time = 0; int found = -1; --- UniVideoModeDlg.h DELETED --- Index: AccelEditor.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/AccelEditor.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AccelEditor.cpp 13 May 2004 15:06:49 -0000 1.3 --- AccelEditor.cpp 13 May 2006 16:32:16 -0000 1.4 *************** *** 186,190 **** int count = m_commands.GetCount(); ! for (int index = 0; index < count; index++) { wIDCommand = LOWORD(m_commands.GetItemData(index)); --- 186,191 ---- int count = m_commands.GetCount(); ! int index; ! for (index = 0; index < count; index++) { wIDCommand = LOWORD(m_commands.GetItemData(index)); Index: Direct3D.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/Direct3D.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Direct3D.cpp 15 Sep 2004 22:11:19 -0000 1.7 --- Direct3D.cpp 13 May 2006 16:32:16 -0000 1.8 *************** *** 20,26 **** #include "vba.h" ! #define DIRECT3D_VERSION 0x0800 ! #include <d3d8.h> ! #include <d3dx8.h> #include "MainWnd.h" --- 20,26 ---- #include "vba.h" ! #define DIRECT3D_VERSION 0x0900 ! #include <d3d9.h> ! #include <d3dx9.h> #include "MainWnd.h" *************** *** 74,81 **** class Direct3DDisplay : public IDisplay { private: ! HINSTANCE d3dDLL; ! LPDIRECT3D8 pD3D; ! LPDIRECT3DDEVICE8 pDevice; ! LPDIRECT3DTEXTURE8 pTexture; D3DSURFACE_DESC dsdBackBuffer; D3DPRESENT_PARAMETERS dpp; --- 74,80 ---- class Direct3DDisplay : public IDisplay { private: ! LPDIRECT3D9 pD3D; ! LPDIRECT3DDEVICE9 pDevice; ! LPDIRECT3DTEXTURE9 pTexture; D3DSURFACE_DESC dsdBackBuffer; D3DPRESENT_PARAMETERS dpp; *************** *** 110,114 **** Direct3DDisplay::Direct3DDisplay() { - d3dDLL = NULL; pD3D = NULL; pDevice = NULL; --- 109,112 ---- *************** *** 147,155 **** pD3D->Release(); pD3D = NULL; - - if(d3dDLL != NULL) { - FreeLibrary(d3dDLL); - d3dDLL = NULL; - } } } --- 145,148 ---- *************** *** 262,282 **** theApp.adjustDestRect(); - - d3dDLL = LoadLibrary("D3D8.DLL"); - LPDIRECT3D8 (WINAPI *D3DCreate)(UINT); - if(d3dDLL != NULL) { - D3DCreate = (LPDIRECT3D8 (WINAPI *)(UINT)) - GetProcAddress(d3dDLL, "Direct3DCreate8"); ! if(D3DCreate == NULL) { ! theApp.directXMessage("Direct3DCreate8"); ! return FALSE; ! } ! } else { ! theApp.directXMessage("D3D8.DLL"); ! return FALSE; ! } ! ! pD3D = D3DCreate(120); if(pD3D == NULL) { --- 255,261 ---- theApp.adjustDestRect(); ! // load Direct3D v9 ! pD3D = Direct3DCreate9( D3D_SDK_VERSION ); if(pD3D == NULL) { *************** *** 417,429 **** case 0: // point filtering ! pDevice->SetTextureStageState( 0, D3DTSS_MINFILTER, D3DTEXF_POINT ); ! pDevice->SetTextureStageState( 0, D3DTSS_MAGFILTER, D3DTEXF_POINT ); ! pDevice->SetTextureStageState( 0, D3DTSS_MIPFILTER, D3DTEXF_POINT ); break; case 1: ! // bilinear ! pDevice->SetTextureStageState( 0, D3DTSS_MINFILTER, D3DTEXF_LINEAR ); ! pDevice->SetTextureStageState( 0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR ); ! pDevice->SetTextureStageState( 0, D3DTSS_MIPFILTER, D3DTEXF_POINT ); break; } --- 396,406 ---- case 0: // point filtering ! pDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_POINT ); ! pDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT ); break; case 1: ! // bilinear filtering ! pDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR ); ! pDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR ); break; } *************** *** 433,439 **** { // Store render target surface desc ! LPDIRECT3DSURFACE8 pBackBuffer; HRESULT hr; ! if(SUCCEEDED(hr = pDevice->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer ))) { pBackBuffer->GetDesc( &dsdBackBuffer ); pBackBuffer->Release(); --- 410,416 ---- { // Store render target surface desc ! LPDIRECT3DSURFACE9 pBackBuffer; HRESULT hr; ! if(SUCCEEDED(hr = pDevice->GetBackBuffer( 0, 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer ))) { pBackBuffer->GetDesc( &dsdBackBuffer ); pBackBuffer->Release(); *************** *** 468,476 **** pFont = NULL; } // Create a D3D font using D3DX ! HFONT hFont = CreateFont( 14, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ! ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, ! ANTIALIASED_QUALITY, FF_DONTCARE, "Arial" ); ! D3DXCreateFont( pDevice, hFont, &pFont ); } --- 445,451 ---- pFont = NULL; } + // Create a D3D font using D3DX ! D3DXCreateFont( pDevice, 24, 0, FW_BOLD, 1, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_DONTCARE, "Arial", &pFont ); } *************** *** 492,497 **** } ! static void BlitRect(LPDIRECT3DDEVICE8 lpDevice, ! LPDIRECT3DTEXTURE8 lpSrc, float left, float top, float right, float bottom, --- 467,472 ---- } ! static void BlitRect(LPDIRECT3DDEVICE9 lpDevice, ! LPDIRECT3DTEXTURE9 lpSrc, float left, float top, float right, float bottom, *************** *** 516,520 **** // configure shader for vertex type ! lpDevice->SetVertexShader(D3DFVF_TLVERTEX); // draw the rectangle --- 491,495 ---- // configure shader for vertex type ! lpDevice->SetFVF(D3DFVF_TLVERTEX); // draw the rectangle *************** *** 657,661 **** !theApp.disableStatusMessage && pFont) { D3DCOLOR color = D3DCOLOR_ARGB(255, 255, 0, 0); - pFont->Begin(); RECT r; r.left = 10; --- 632,635 ---- *************** *** 664,669 **** r.bottom = r.top + 20; ! pFont->DrawText(theApp.screenMessageBuffer, -1, &r, 0, color); ! pFont->End(); } else { theApp.screenMessage = false; --- 638,642 ---- r.bottom = r.top + 20; ! pFont->DrawText(NULL, theApp.screenMessageBuffer, -1, &r, 0, color); } else { theApp.screenMessage = false; Index: VideoMode.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/VideoMode.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** VideoMode.cpp 13 May 2004 15:06:55 -0000 1.5 --- VideoMode.cpp 13 May 2006 16:32:16 -0000 1.6 *************** *** 124,128 **** --- 124,132 ---- int winVideoModeSelect(CWnd *pWnd, GUID **guid) { + #ifdef _AFXDLL HINSTANCE h = AfxLoadLibrary("ddraw.dll"); + #else + HMODULE h = LoadLibrary( _T("ddraw.dll") ); + #endif // If ddraw.dll doesn't exist in the search path, *************** *** 184,190 **** if(selected == -1) { ! // If the library was loaded by calling LoadLibrary(), ! // then you must use FreeLibrary() to let go of it. ! AfxFreeLibrary(h); return -1; --- 188,196 ---- if(selected == -1) { ! #ifdef _AFXDLL ! AfxFreeLibrary( h ); ! #else ! FreeLibrary( h ); ! #endif return -1; *************** *** 204,208 **** if(hret != DD_OK) { systemMessage(0, "Error during DirectDrawCreateEx: %08x", hret); ! AfxFreeLibrary(h); return -1; } --- 210,218 ---- if(hret != DD_OK) { systemMessage(0, "Error during DirectDrawCreateEx: %08x", hret); ! #ifdef _AFXDLL ! AfxFreeLibrary( h ); ! #else ! FreeLibrary( h ); ! #endif return -1; } *************** *** 210,214 **** // should not happen.... systemMessage(0, "Error getting DirectDrawCreateEx"); ! AfxFreeLibrary(h); return -1; } --- 220,228 ---- // should not happen.... systemMessage(0, "Error getting DirectDrawCreateEx"); ! #ifdef _AFXDLL ! AfxFreeLibrary( h ); ! #else ! FreeLibrary( h ); ! #endif return -1; } *************** *** 226,230 **** // If the library was loaded by calling LoadLibrary(), // then you must use FreeLibrary() to let go of it. ! AfxFreeLibrary(h); return res; --- 240,248 ---- // If the library was loaded by calling LoadLibrary(), // then you must use FreeLibrary() to let go of it. ! #ifdef _AFXDLL ! AfxFreeLibrary( h ); ! #else ! FreeLibrary( h ); ! #endif return res; Index: VBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/VBA.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** VBA.cpp 4 Jan 2006 15:10:33 -0000 1.13 --- VBA.cpp 13 May 2006 16:32:16 -0000 1.14 *************** *** 21,24 **** --- 21,25 ---- #include "stdafx.h" #include <mmsystem.h> + #include <windows.h> #include "AVIWrite.h" *************** *** 415,418 **** --- 416,420 ---- // the specific initialization routines you do not need. + #if _MSC_VER < 1400 #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL *************** *** 420,423 **** --- 422,426 ---- Enable3dControlsStatic(); // Call this when linking to MFC statically #endif + #endif SetRegistryKey(_T("VBA")); *************** *** 1476,1488 **** DWORD dwVersion = 0; ! hinstDll = AfxLoadLibrary("USER32.DLL"); if(hinstDll) { ! GETMENUBARINFO func = (GETMENUBARINFO)GetProcAddress(hinstDll, ! "GetMenuBarInfo"); if(func) { MENUBARINFO info; ! info.cbSize = sizeof(info); func(AfxGetMainWnd()->GetSafeHwnd(), OBJID_MENU, 0, &info); --- 1479,1494 ---- DWORD dwVersion = 0; ! #ifdef _AFXDLL ! hinstDll = AfxLoadLibrary("user32.dll"); ! #else ! hinstDll = LoadLibrary( _T("user32.dll") ); ! #endif if(hinstDll) { ! GETMENUBARINFO func = (GETMENUBARINFO)GetProcAddress(hinstDll, "GetMenuBarInfo"); if(func) { MENUBARINFO info; ! info.cbSize = sizeof(MENUBARINFO); func(AfxGetMainWnd()->GetSafeHwnd(), OBJID_MENU, 0, &info); *************** *** 1501,1505 **** } } ! AfxFreeLibrary(hinstDll); } } --- 1507,1515 ---- } } ! #ifdef _AFXDLL ! AfxFreeLibrary( hinstDll ); ! #else ! FreeLibrary( hinstDll ); ! #endif } } *************** *** 1898,1902 **** AfxSetResourceHandle(l); if(languageModule != NULL) ! AfxFreeLibrary(languageModule); languageModule = l; } else { --- 1908,1916 ---- AfxSetResourceHandle(l); if(languageModule != NULL) ! #ifdef _AFXDLL ! AfxFreeLibrary( languageModule ); ! #else ! FreeLibrary( languageModule ); ! #endif languageModule = l; } else { *************** *** 1909,1913 **** case 1: if(languageModule != NULL) ! AfxFreeLibrary(languageModule); languageModule = NULL; AfxSetResourceHandle(AfxGetInstanceHandle()); --- 1923,1931 ---- case 1: if(languageModule != NULL) ! #ifdef _AFXDLL ! AfxFreeLibrary( languageModule ); ! #else ! FreeLibrary( languageModule ); ! #endif languageModule = NULL; AfxSetResourceHandle(AfxGetInstanceHandle()); *************** *** 1927,1931 **** AfxSetResourceHandle(l); if(languageModule != NULL) ! AfxFreeLibrary(languageModule); languageModule = l; } --- 1945,1955 ---- AfxSetResourceHandle(l); if(languageModule != NULL) ! { ! #ifdef _AFXDLL ! AfxFreeLibrary( languageModule ); ! #else ! FreeLibrary( languageModule ); ! #endif ! } languageModule = l; } *************** *** 1956,1962 **** CString buffer; ! buffer.Format("vba_%s.dll", name); ! HINSTANCE l = AfxLoadLibrary(buffer); if(l == NULL) { --- 1980,1990 ---- CString buffer; ! buffer.Format( _T("vba_%s.dll"), name); ! #ifdef _AFXDLL ! HINSTANCE l = AfxLoadLibrary( buffer ); ! #else ! HMODULE l = LoadLibrary( buffer ); ! #endif if(l == NULL) { *************** *** 1968,1972 **** buffer.Format("vba_%s.dll", buffer2); ! return AfxLoadLibrary(buffer); } } --- 1996,2004 ---- buffer.Format("vba_%s.dll", buffer2); ! #ifdef _AFXDLL ! return AfxLoadLibrary( buffer ); ! #else ! return LoadLibrary( buffer ); ! #endif } } Index: vba.rc =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/vba.rc,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** vba.rc 30 Apr 2006 14:34:24 -0000 1.52 --- vba.rc 13 May 2006 16:32:16 -0000 1.53 *************** *** 1,3 **** ! //Microsoft Developer Studio generated resource script. // #include "resource.h" --- 1,3 ---- ! // Microsoft Visual C++ generated resource script. // #include "resource.h" *************** *** 14,17 **** --- 14,71 ---- [...2431 lines suppressed...] IDS_ERROR_CREATING_SOCKET "Error creating socket." --- 2068,2072 ---- END ! STRINGTABLE BEGIN IDS_ERROR_CREATING_SOCKET "Error creating socket." *************** *** 2384,2388 **** END ! STRINGTABLE DISCARDABLE BEGIN IDS_INVALID_INTERVAL_VALUE --- 2089,2093 ---- END ! STRINGTABLE BEGIN IDS_INVALID_INTERVAL_VALUE Index: resource.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/resource.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** resource.h 4 Jan 2006 15:10:33 -0000 1.40 --- resource.h 13 May 2006 16:32:16 -0000 1.41 *************** *** 1,5 **** //{{NO_DEPENDENCIES}} ! // Microsoft Developer Studio generated include file. ! // Used by VBA.rc // #define IDS_UNSUPPORTED_VBA_SGM 1 --- 1,5 ---- //{{NO_DEPENDENCIES}} ! // Microsoft Visual C++ generated include file. ! // Used by vba.rc // #define IDS_UNSUPPORTED_VBA_SGM 1 *************** *** 758,762 **** #define _APS_NEXT_COMMAND_VALUE 40278 #define _APS_NEXT_CONTROL_VALUE 1256 ! #define _APS_NEXT_SYMED_VALUE 103 #endif #endif --- 758,762 ---- #define _APS_NEXT_COMMAND_VALUE 40278 #define _APS_NEXT_CONTROL_VALUE 1256 ! #define _APS_NEXT_SYMED_VALUE 104 #endif #endif Index: Joypad.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/Joypad.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Joypad.cpp 13 May 2004 15:06:50 -0000 1.4 --- Joypad.cpp 13 May 2006 16:32:16 -0000 1.5 *************** *** 164,168 **** CDialog::OnInitDialog(); ! timerId = SetTimer(0,200,NULL); SetWindowLong(up, GWL_USERDATA,joypad[which][KEY_UP]); --- 164,168 ---- CDialog::OnInitDialog(); ! timerId = SetTimer(0,50,NULL); SetWindowLong(up, GWL_USERDATA,joypad[which][KEY_UP]); Index: DirectDraw.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/DirectDraw.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DirectDraw.cpp 15 Sep 2004 22:08:53 -0000 1.7 --- DirectDraw.cpp 13 May 2006 16:32:16 -0000 1.8 *************** *** 154,158 **** if(ddrawDLL != NULL) { ! AfxFreeLibrary(ddrawDLL); ddrawDLL = NULL; } --- 154,162 ---- if(ddrawDLL != NULL) { ! #ifdef _AFXDLL ! AfxFreeLibrary( ddrawDLL ); ! #else ! FreeLibrary( ddrawDLL ); ! #endif ddrawDLL = NULL; } *************** *** 266,270 **** guid = theApp.pVideoDriverGUID; ! ddrawDLL = AfxLoadLibrary("DDRAW.DLL"); HRESULT (WINAPI *DDrawCreateEx)(GUID *,LPVOID *,REFIID,IUnknown *); if(ddrawDLL != NULL) { --- 270,279 ---- guid = theApp.pVideoDriverGUID; ! #ifdef _AFXDLL ! ddrawDLL = AfxLoadLibrary("ddraw.dll"); ! #else ! ddrawDLL = LoadLibrary( _T("ddraw.dll") ); ! #endif ! HRESULT (WINAPI *DDrawCreateEx)(GUID *,LPVOID *,REFIID,IUnknown *); if(ddrawDLL != NULL) { |
From: Spacy <sp...@us...> - 2006-05-13 16:32:19
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gb In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6744/src/gb Modified Files: GB.cpp gbMemory.cpp Log Message: vs2005 compatibility Index: GB.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/GB.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** GB.cpp 30 Apr 2006 14:40:02 -0000 1.24 --- GB.cpp 13 May 2006 16:32:15 -0000 1.25 *************** *** 2059,2063 **** { if(strlen(file) > 4) { ! char * p = strrchr(file,'.'); if(p != NULL) { --- 2059,2063 ---- { if(strlen(file) > 4) { ! const char * p = strrchr(file,'.'); if(p != NULL) { *************** *** 2270,2274 **** gbMemory[0xff03] = 0xff; ! for (int i = 0x8; i<0xf; i++) gbMemory[0xff00+i] = 0xff; --- 2270,2275 ---- gbMemory[0xff03] = 0xff; ! int i; ! for (i = 0x8; i<0xf; i++) gbMemory[0xff00+i] = 0xff; Index: gbMemory.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbMemory.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gbMemory.cpp 30 Apr 2006 14:44:16 -0000 1.5 --- gbMemory.cpp 13 May 2006 16:32:15 -0000 1.6 *************** *** 345,349 **** if(diff > 0) { // update the clock according to the last update time ! gbDataMBC3.mapperSeconds += diff % 60; if(gbDataMBC3.mapperSeconds > 59) { gbDataMBC3.mapperSeconds -= 60; --- 345,349 ---- if(diff > 0) { // update the clock according to the last update time ! gbDataMBC3.mapperSeconds += (int)(diff % 60); if(gbDataMBC3.mapperSeconds > 59) { gbDataMBC3.mapperSeconds -= 60; *************** *** 353,357 **** diff /= 60; ! gbDataMBC3.mapperMinutes += diff % 60; if(gbDataMBC3.mapperMinutes > 59) { gbDataMBC3.mapperMinutes -= 60; --- 353,357 ---- diff /= 60; ! gbDataMBC3.mapperMinutes += (int)(diff % 60); if(gbDataMBC3.mapperMinutes > 59) { gbDataMBC3.mapperMinutes -= 60; *************** *** 361,365 **** diff /= 60; ! gbDataMBC3.mapperHours += diff % 24; if(gbDataMBC3.mapperHours > 23) { gbDataMBC3.mapperHours -= 24; --- 361,365 ---- diff /= 60; ! gbDataMBC3.mapperHours += (int)(diff % 24); if(gbDataMBC3.mapperHours > 23) { gbDataMBC3.mapperHours -= 24; *************** *** 368,372 **** diff /= 24; ! gbDataMBC3.mapperDays += diff; if(gbDataMBC3.mapperDays > 255) { if(gbDataMBC3.mapperDays > 511) { --- 368,372 ---- diff /= 24; ! gbDataMBC3.mapperDays += (int)(diff & 0xffffffff); if(gbDataMBC3.mapperDays > 255) { if(gbDataMBC3.mapperDays > 511) { *************** *** 1238,1242 **** if(diff > 0) { // update the clock according to the last update time ! gbDataTAMA5.mapperSeconds += diff % 60; if(gbDataTAMA5.mapperSeconds > 59) { gbDataTAMA5.mapperSeconds -= 60; --- 1238,1242 ---- if(diff > 0) { // update the clock according to the last update time ! gbDataTAMA5.mapperSeconds += (int)(diff % 60); if(gbDataTAMA5.mapperSeconds > 59) { gbDataTAMA5.mapperSeconds -= 60; *************** *** 1246,1250 **** diff /= 60; ! gbDataTAMA5.mapperMinutes += diff % 60; if(gbDataTAMA5.mapperMinutes > 59) { gbDataTAMA5.mapperMinutes -= 60; --- 1246,1250 ---- diff /= 60; ! gbDataTAMA5.mapperMinutes += (int)(diff % 60); if(gbDataTAMA5.mapperMinutes > 59) { gbDataTAMA5.mapperMinutes -= 60; *************** *** 1254,1258 **** diff /= 60; ! gbDataTAMA5.mapperHours += diff % 24; diff /= 24; if(gbDataTAMA5.mapperHours > 23) { --- 1254,1258 ---- diff /= 60; ! gbDataTAMA5.mapperHours += (int)(diff % 24); diff /= 24; if(gbDataTAMA5.mapperHours > 23) { *************** *** 1262,1266 **** } ! int days = diff; while (days) { --- 1262,1266 ---- } ! time_t days = diff; while (days) { |
From: Spacy <sp...@us...> - 2006-05-13 16:32:18
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6744/src Modified Files: GBA.cpp Util.cpp expr-lex.cpp exprNode.cpp Log Message: vs2005 compatibility Index: expr-lex.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/expr-lex.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** expr-lex.cpp 6 Jun 2003 14:17:21 -0000 1.2 --- expr-lex.cpp 13 May 2006 16:32:15 -0000 1.3 *************** *** 1286,1290 **** b->yy_is_interactive = 0; #else ! b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif --- 1286,1290 ---- b->yy_is_interactive = 0; #else ! b->yy_is_interactive = file ? (isatty( _fileno(file) ) > 0) : 0; #endif #endif Index: GBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/GBA.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** GBA.cpp 30 Apr 2006 14:36:59 -0000 1.65 --- GBA.cpp 13 May 2006 16:32:15 -0000 1.66 *************** *** 1364,1368 **** { if(strlen(file) > 4) { ! char * p = strrchr(file,'.'); if(p != NULL) { --- 1364,1368 ---- { if(strlen(file) > 4) { ! const char * p = strrchr(file,'.'); if(p != NULL) { *************** *** 1379,1383 **** cpuIsMultiBoot = false; if(strlen(file) > 4) { ! char * p = strrchr(file,'.'); if(p != NULL) { --- 1379,1383 ---- cpuIsMultiBoot = false; if(strlen(file) > 4) { ! const char * p = strrchr(file,'.'); if(p != NULL) { *************** *** 1403,1407 **** { if(strlen(file) > 4) { ! char * p = strrchr(file,'.'); if(p != NULL) { --- 1403,1407 ---- { if(strlen(file) > 4) { ! const char * p = strrchr(file,'.'); if(p != NULL) { *************** *** 1423,1427 **** { if(strlen(file) > 4) { ! char * p = strrchr(file,'.'); if(p != NULL) { --- 1423,1427 ---- { if(strlen(file) > 4) { ! const char * p = strrchr(file,'.'); if(p != NULL) { Index: exprNode.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/exprNode.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** exprNode.cpp 13 May 2004 15:06:45 -0000 1.3 --- exprNode.cpp 13 May 2006 16:32:15 -0000 1.4 *************** *** 51,55 **** { Node *n = (Node *)calloc(1, sizeof(Node)); ! n->name = strdup(yytext); exprNodeClean(n->name); --- 51,55 ---- { Node *n = (Node *)calloc(1, sizeof(Node)); ! n->name = _strdup(yytext); exprNodeClean(n->name); Index: Util.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/Util.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Util.cpp 30 Apr 2006 14:37:27 -0000 1.25 --- Util.cpp 13 May 2006 16:32:15 -0000 1.26 *************** *** 487,491 **** cpuIsMultiBoot = false; if(strlen(file) > 4) { ! char * p = strrchr(file,'.'); if(p != NULL) { --- 487,491 ---- cpuIsMultiBoot = false; if(strlen(file) > 4) { ! const char * p = strrchr(file,'.'); if(p != NULL) { *************** *** 511,515 **** { if(strlen(file) > 4) { ! char * p = strrchr(file,'.'); if(p != NULL) { --- 511,515 ---- { if(strlen(file) > 4) { ! const char * p = strrchr(file,'.'); if(p != NULL) { *************** *** 531,535 **** { if(strlen(file) > 4) { ! char * p = strrchr(file,'.'); if(p != NULL) { --- 531,535 ---- { if(strlen(file) > 4) { ! const char * p = strrchr(file,'.'); if(p != NULL) { *************** *** 561,565 **** { if(strlen(file) > 3) { ! char * p = strrchr(file,'.'); if(p != NULL) { --- 561,565 ---- { if(strlen(file) > 3) { ! const char * p = strrchr(file,'.'); if(p != NULL) { |
From: Spacy <sp...@us...> - 2006-05-13 16:28:13
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/sdl_release In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5778/sdl_release Log Message: Directory /cvsroot/vba/VisualBoyAdvance/win32/sdl_release added to the repository |
From: Spacy <sp...@us...> - 2006-05-13 16:28:10
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/sdl_debug In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5778/sdl_debug Log Message: Directory /cvsroot/vba/VisualBoyAdvance/win32/sdl_debug added to the repository |
From: Spacy <sp...@us...> - 2006-05-13 16:28:10
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/mfc_release In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5778/mfc_release Log Message: Directory /cvsroot/vba/VisualBoyAdvance/win32/mfc_release added to the repository |
From: Spacy <sp...@us...> - 2006-05-13 16:28:10
|
Update of /cvsroot/vba/VisualBoyAdvance/win32/mfc_debug In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5778/mfc_debug Log Message: Directory /cvsroot/vba/VisualBoyAdvance/win32/mfc_debug added to the repository |
From: Spacy <sp...@us...> - 2006-05-13 16:25:18
|
Update of /cvsroot/vba/VisualBoyAdvance/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4571/win32 Added Files: vba_vs2005.sln vba_vs2005.suo vba_vs2005.vcproj Log Message: added vs2005 project files --- NEW FILE: vba_vs2005.vcproj --- (This appears to be a binary file; contents omitted.) --- NEW FILE: vba_vs2005.suo --- (This appears to be a binary file; contents omitted.) --- NEW FILE: vba_vs2005.sln --- (This appears to be a binary file; contents omitted.) |
From: Spacy <sp...@us...> - 2006-05-13 16:23:19
|
Update of /cvsroot/vba/VisualBoyAdvance In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4247 Modified Files: INSTALL Log Message: added vs2005 section Index: INSTALL =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/INSTALL,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** INSTALL 22 May 2004 14:08:17 -0000 1.4 --- INSTALL 13 May 2006 16:23:15 -0000 1.5 *************** *** 66,69 **** --- 66,99 ---- ---------- + 2.1 Visual C++ 2005 + ---------------------- + + Needed software: + - Microsoft Visual C++ 2005 + > http://msdn.microsoft.com/visualc/ + > You do not need the DLL runtimes and the .NET Framework + - Microsoft Platform SDK + > http://www.microsoft.com/downloads/details.aspx?FamilyId=E15438AC-60BE-41BD-AA14-7F1E0F19CA0D&displaylang=en + - Microsoft DirectX 9.0 SDK + > http://msdn.microsoft.com/directx/sdk/ + - Yasm + > http://www.tortall.net/projects/yasm/ + > Unpack it anywhere on your pc, rename the exe to "yasm.exe" and add it to + "Tools>Options>Projects and Solutions>VC++ Directories>Executable files" + - AMD CodeAnalyst + > http://developer.amd.com/cawin.aspx?session_id=FB$37649@DJEBIGID + > Free and easy profiling for AMD CPUs (32bit and 64bit), Visual Studio 2005 plugin + + Those are all needed packages for now. The VBA source also includes the + sources of various free libraries for zip, image and skin support. + Those can be accessed through the "dependencies" folder in the main + solution file. The main solution file includes references to all files + for all platforms. At the moment, only MFC and SDL build targets for + 32bit Windows are configured. GTK+ and 64bit Windows support may also + be possible. + + 2.2 Visual C++ 6.0 and Visual C++ 2002 + ----------------------------------------- + Needed software: - nasm: see above for URL. Install it in the default directory |
From: Spacy <sp...@us...> - 2006-05-12 21:27:41
|
Update of /cvsroot/vba/VisualBoyAdvance/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20508/win32 Removed Files: test.txt Log Message: --- test.txt DELETED --- |
Update of /cvsroot/vba/VisualBoyAdvance/win32/dependencies/zlib In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20508/win32/dependencies/zlib Added Files: adler32.c compress.c crc32.c crc32.h deflate.c deflate.h gzio.c infback.c inffast.c inffast.h inffixed.h inflate.c inflate.h inftrees.c inftrees.h trees.c trees.h uncompr.c zconf.h zlib.h zlib.vcproj zutil.c zutil.h Log Message: --- NEW FILE: inffast.h --- /* inffast.h -- header to use inffast.c * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ void inflate_fast OF((z_streamp strm, unsigned start)); --- NEW FILE: trees.h --- /* header created automatically with -DGEN_TREES_H */ local const ct_data static_ltree[L_CODES+2] = { {{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, {{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, {{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, {{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, {{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, {{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, {{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, {{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, {{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, {{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, {{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, {{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, {{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, {{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, {{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, {{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, {{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, {{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, {{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, {{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, {{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, {{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, {{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, {{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, {{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, {{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, {{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, {{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, {{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, {{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, {{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, {{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, {{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, {{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, {{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, {{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, {{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, {{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, {{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, {{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, {{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, {{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, {{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, {{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, {{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, {{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, {{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, {{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, {{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, {{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, {{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, {{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, {{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, {{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, {{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, {{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, {{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, {{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} }; local const ct_data static_dtree[D_CODES] = { {{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, {{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, {{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, {{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, {{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, {{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} }; const uch _dist_code[DIST_CODE_LEN] = { 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 }; const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 }; local const int base_length[LENGTH_CODES] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0 }; local const int base_dist[D_CODES] = { 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 }; --- NEW FILE: inftrees.h --- /* inftrees.h -- header to use inftrees.c * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ /* Structure for decoding tables. Each entry provides either the information needed to do the operation requested by the code that indexed that table entry, or it provides a pointer to another table that indexes more bits of the code. op indicates whether the entry is a pointer to another table, a literal, a length or distance, an end-of-block, or an invalid code. For a table pointer, the low four bits of op is the number of index bits of that table. For a length or distance, the low four bits of op is the number of extra bits to get after the code. bits is the number of bits in this code or part of the code to drop off of the bit buffer. val is the actual byte to output in the case of a literal, the base length or distance, or the offset from the current table to the next table. Each entry is four bytes. */ typedef struct { unsigned char op; /* operation, extra bits, table bits */ unsigned char bits; /* bits in this part of the code */ unsigned short val; /* offset in table or code value */ } code; /* op values as set by inflate_table(): 00000000 - literal 0000tttt - table link, tttt != 0 is the number of table index bits 0001eeee - length or distance, eeee is the number of extra bits 01100000 - end of block 01000000 - invalid code */ /* Maximum size of dynamic tree. The maximum found in a long but non- exhaustive search was 1444 code structures (852 for length/literals and 592 for distances, the latter actually the result of an exhaustive search). The true maximum is not known, but the value below is more than safe. */ #define ENOUGH 2048 #define MAXD 592 /* Type of code to build for inftable() */ typedef enum { CODES, LENS, DISTS } codetype; extern int inflate_table OF((codetype type, unsigned short FAR *lens, unsigned codes, code FAR * FAR *table, unsigned FAR *bits, unsigned short FAR *work)); --- NEW FILE: zconf.h --- /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id: zconf.h,v 1.1 2006/05/12 21:27:37 spacy51 Exp $ */ #ifndef ZCONF_H #define ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. */ #ifdef Z_PREFIX # define deflateInit_ z_deflateInit_ # define deflate z_deflate # define deflateEnd z_deflateEnd # define inflateInit_ z_inflateInit_ # define inflate z_inflate # define inflateEnd z_inflateEnd # define deflateInit2_ z_deflateInit2_ # define deflateSetDictionary z_deflateSetDictionary # define deflateCopy z_deflateCopy # define deflateReset z_deflateReset # define deflateParams z_deflateParams # define deflateBound z_deflateBound # define deflatePrime z_deflatePrime # define inflateInit2_ z_inflateInit2_ # define inflateSetDictionary z_inflateSetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateCopy z_inflateCopy # define inflateReset z_inflateReset # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd # define compress z_compress # define compress2 z_compress2 # define compressBound z_compressBound # define uncompress z_uncompress # define adler32 z_adler32 # define crc32 z_crc32 # define get_crc_table z_get_crc_table # define zError z_zError # define alloc_func z_alloc_func # define free_func z_free_func # define in_func z_in_func # define out_func z_out_func # define Byte z_Byte # define uInt z_uInt # define uLong z_uLong # define Bytef z_Bytef # define charf z_charf # define intf z_intf # define uIntf z_uIntf # define uLongf z_uLongf # define voidpf z_voidpf # define voidp z_voidp #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) # define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) # ifndef WIN32 # define WIN32 # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) # ifndef SYS16BIT # define SYS16BIT # endif # endif #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT # define MAXSEG_64K #endif #ifdef MSDOS # define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ # ifndef STDC # define STDC # endif # if __STDC_VERSION__ >= 199901L # ifndef STDC99 # define STDC99 # endif # endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) # define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) # define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) # define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) # define STDC #endif #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ # define STDC #endif #ifndef STDC # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # define const /* note: need a more gentle solution here */ # endif #endif /* Some Mac compilers merge all .h files incorrectly: */ #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) # define NO_DUMMY_DECL #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #ifdef SYS16BIT # if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER # define FAR _far # else # define FAR far # endif # endif # if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ # define SMALL_MEDIUM # ifdef __BORLANDC__ # define FAR _far # else # define FAR far # endif # endif #endif #if defined(WINDOWS) || defined(WIN32) /* If building or using zlib as a DLL, define ZLIB_DLL. * This is not mandatory, but it offers a little performance increase. */ # ifdef ZLIB_DLL # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) # ifdef ZLIB_INTERNAL # define ZEXTERN extern __declspec(dllexport) # else # define ZEXTERN extern __declspec(dllimport) # endif # endif # endif /* ZLIB_DLL */ /* If building or using zlib with the WINAPI/WINAPIV calling convention, * define ZLIB_WINAPI. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ # ifdef ZLIB_WINAPI # ifdef FAR # undef FAR # endif # include <windows.h> /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI # ifdef WIN32 # define ZEXPORTVA WINAPIV # else # define ZEXPORTVA FAR CDECL # endif # endif #endif #if defined (__BEOS__) # ifdef ZLIB_DLL # ifdef ZLIB_INTERNAL # define ZEXPORT __declspec(dllexport) # define ZEXPORTVA __declspec(dllexport) # else # define ZEXPORT __declspec(dllimport) # define ZEXPORTVA __declspec(dllimport) # endif # endif #endif #ifndef ZEXTERN # define ZEXTERN extern #endif #ifndef ZEXPORT # define ZEXPORT #endif #ifndef ZEXPORTVA # define ZEXPORTVA #endif #ifndef FAR # define FAR #endif #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ # define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ # include <sys/types.h> /* for off_t */ # include <unistd.h> /* for SEEK_* and off_t */ # ifdef VMS # include <unixio.h> /* for off_t */ # endif # define z_off_t off_t #endif #ifndef SEEK_SET # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t # define z_off_t long #endif #if defined(__OS400__) # define NO_vsnprintf #endif #if defined(__MVS__) # define NO_vsnprintf # ifdef FAR # undef FAR # endif #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) # pragma map(deflateInit_,"DEIN") # pragma map(deflateInit2_,"DEIN2") # pragma map(deflateEnd,"DEEND") # pragma map(deflateBound,"DEBND") # pragma map(inflateInit_,"ININ") # pragma map(inflateInit2_,"ININ2") # pragma map(inflateEnd,"INEND") # pragma map(inflateSync,"INSY") # pragma map(inflateSetDictionary,"INSEDI") # pragma map(compressBound,"CMBND") # pragma map(inflate_table,"INTABL") # pragma map(inflate_fast,"INFA") # pragma map(inflate_copyright,"INCOPY") #endif #endif /* ZCONF_H */ --- NEW FILE: inffast.c --- /* inffast.c -- fast decoding * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "inftrees.h" #include "inflate.h" #include "inffast.h" #ifndef ASMINF /* Allow machine dependent optimization for post-increment or pre-increment. Based on testing to date, Pre-increment preferred for: - PowerPC G3 (Adler) - MIPS R5000 (Randers-Pehrson) Post-increment preferred for: - none No measurable difference: - Pentium III (Anderson) - M68060 (Nikl) */ #ifdef POSTINC # define OFF 0 # define PUP(a) *(a)++ #else # define OFF 1 # define PUP(a) *++(a) #endif /* Decode literal, length, and distance codes and write out the resulting literal and match bytes until either not enough input or output is available, an end-of-block is encountered, or a data error is encountered. When large enough input and output buffers are supplied to inflate(), for example, a 16K input buffer and a 64K output buffer, more than 95% of the inflate execution time is spent in this routine. Entry assumptions: state->mode == LEN strm->avail_in >= 6 strm->avail_out >= 258 start >= strm->avail_out state->bits < 8 On return, state->mode is one of: LEN -- ran out of enough output space or enough available input TYPE -- reached end of block code, inflate() to interpret next block BAD -- error in block data Notes: - The maximum input bits used by a length/distance pair is 15 bits for the length code, 5 bits for the length extra, 15 bits for the distance code, and 13 bits for the distance extra. This totals 48 bits, or six bytes. Therefore if strm->avail_in >= 6, then there is enough input to avoid checking for available input while decoding. - The maximum bytes that a single length/distance pair can output is 258 bytes, which is the maximum length that can be coded. inflate_fast() requires strm->avail_out >= 258 for each loop to avoid checking for output space. */ void inflate_fast(strm, start) z_streamp strm; unsigned start; /* inflate()'s starting value for strm->avail_out */ { struct inflate_state FAR *state; unsigned char FAR *in; /* local strm->next_in */ unsigned char FAR *last; /* while in < last, enough input available */ unsigned char FAR *out; /* local strm->next_out */ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ unsigned char FAR *end; /* while out < end, enough space available */ #ifdef INFLATE_STRICT unsigned dmax; /* maximum distance from zlib header */ #endif unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ unsigned write; /* window write index */ unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ unsigned long hold; /* local strm->hold */ unsigned bits; /* local strm->bits */ code const FAR *lcode; /* local strm->lencode */ code const FAR *dcode; /* local strm->distcode */ unsigned lmask; /* mask for first level of length codes */ unsigned dmask; /* mask for first level of distance codes */ code this; /* retrieved table entry */ unsigned op; /* code bits, operation, extra bits, or */ /* window position, window bytes to copy */ unsigned len; /* match length, unused bytes */ unsigned dist; /* match distance */ unsigned char FAR *from; /* where to copy match from */ /* copy state to local variables */ state = (struct inflate_state FAR *)strm->state; in = strm->next_in - OFF; last = in + (strm->avail_in - 5); out = strm->next_out - OFF; beg = out - (start - strm->avail_out); end = out + (strm->avail_out - 257); #ifdef INFLATE_STRICT dmax = state->dmax; #endif wsize = state->wsize; whave = state->whave; write = state->write; window = state->window; hold = state->hold; bits = state->bits; lcode = state->lencode; dcode = state->distcode; lmask = (1U << state->lenbits) - 1; dmask = (1U << state->distbits) - 1; /* decode literals and length/distances until end-of-block or not enough input data or output space */ do { if (bits < 15) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; hold += (unsigned long)(PUP(in)) << bits; bits += 8; } this = lcode[hold & lmask]; dolen: op = (unsigned)(this.bits); hold >>= op; bits -= op; op = (unsigned)(this.op); if (op == 0) { /* literal */ Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? "inflate: literal '%c'\n" : "inflate: literal 0x%02x\n", this.val)); PUP(out) = (unsigned char)(this.val); } else if (op & 16) { /* length base */ len = (unsigned)(this.val); op &= 15; /* number of extra bits */ if (op) { if (bits < op) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; } len += (unsigned)hold & ((1U << op) - 1); hold >>= op; bits -= op; } Tracevv((stderr, "inflate: length %u\n", len)); if (bits < 15) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; hold += (unsigned long)(PUP(in)) << bits; bits += 8; } this = dcode[hold & dmask]; dodist: op = (unsigned)(this.bits); hold >>= op; bits -= op; op = (unsigned)(this.op); if (op & 16) { /* distance base */ dist = (unsigned)(this.val); op &= 15; /* number of extra bits */ if (bits < op) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; if (bits < op) { hold += (unsigned long)(PUP(in)) << bits; bits += 8; } } dist += (unsigned)hold & ((1U << op) - 1); #ifdef INFLATE_STRICT if (dist > dmax) { strm->msg = (char *)"invalid distance too far back"; state->mode = BAD; break; } #endif hold >>= op; bits -= op; Tracevv((stderr, "inflate: distance %u\n", dist)); op = (unsigned)(out - beg); /* max distance in output */ if (dist > op) { /* see if copy from window */ op = dist - op; /* distance back in window */ if (op > whave) { strm->msg = (char *)"invalid distance too far back"; state->mode = BAD; break; } from = window - OFF; if (write == 0) { /* very common case */ from += wsize - op; if (op < len) { /* some from window */ len -= op; do { PUP(out) = PUP(from); } while (--op); from = out - dist; /* rest from output */ } } else if (write < op) { /* wrap around window */ from += wsize + write - op; op -= write; if (op < len) { /* some from end of window */ len -= op; do { PUP(out) = PUP(from); } while (--op); from = window - OFF; if (write < len) { /* some from start of window */ op = write; len -= op; do { PUP(out) = PUP(from); } while (--op); from = out - dist; /* rest from output */ } } } else { /* contiguous in window */ from += write - op; if (op < len) { /* some from window */ len -= op; do { PUP(out) = PUP(from); } while (--op); from = out - dist; /* rest from output */ } } while (len > 2) { PUP(out) = PUP(from); PUP(out) = PUP(from); PUP(out) = PUP(from); len -= 3; } if (len) { PUP(out) = PUP(from); if (len > 1) PUP(out) = PUP(from); } } else { from = out - dist; /* copy direct from output */ do { /* minimum length is three */ PUP(out) = PUP(from); PUP(out) = PUP(from); PUP(out) = PUP(from); len -= 3; } while (len > 2); if (len) { PUP(out) = PUP(from); if (len > 1) PUP(out) = PUP(from); } } } else if ((op & 64) == 0) { /* 2nd level distance code */ this = dcode[this.val + (hold & ((1U << op) - 1))]; goto dodist; } else { strm->msg = (char *)"invalid distance code"; state->mode = BAD; break; } } else if ((op & 64) == 0) { /* 2nd level length code */ this = lcode[this.val + (hold & ((1U << op) - 1))]; goto dolen; } else if (op & 32) { /* end-of-block */ Tracevv((stderr, "inflate: end of block\n")); state->mode = TYPE; break; } else { strm->msg = (char *)"invalid literal/length code"; state->mode = BAD; break; } } while (in < last && out < end); /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ len = bits >> 3; in -= len; bits -= len << 3; hold &= (1U << bits) - 1; /* update state and return */ strm->next_in = in + OFF; strm->next_out = out + OFF; strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); strm->avail_out = (unsigned)(out < end ? 257 + (end - out) : 257 - (out - end)); state->hold = hold; state->bits = bits; return; } /* inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): - Using bit fields for code structure - Different op definition to avoid & for extra bits (do & for table bits) - Three separate decoding do-loops for direct, window, and write == 0 - Special case for distance > 1 copies to do overlapped load and store copy - Explicit branch predictions (based on measured branch probabilities) - Deferring match copy and interspersed it with decoding subsequent codes - Swapping literal/length else - Swapping window/direct else - Larger unrolled copy loops (three is about right) - Moving len -= 3 statement into middle of loop */ #endif /* !ASMINF */ --- NEW FILE: inftrees.c --- /* inftrees.c -- generate Huffman trees for efficient decoding * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #include "zutil.h" #include "inftrees.h" #define MAXBITS 15 const char inflate_copyright[] = " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot include such an acknowledgment, I would appreciate that you keep this copyright string in the executable of your product. */ /* Build a set of tables to decode the provided canonical Huffman code. The code lengths are lens[0..codes-1]. The result starts at *table, whose indices are 0..2^bits-1. work is a writable array of at least lens shorts, which is used as a work area. type is the type of code to be generated, CODES, LENS, or DISTS. On return, zero is success, -1 is an invalid code, and +1 means that ENOUGH isn't enough. table on return points to the next available entry's address. bits is the requested root table index bits, and on return it is the actual root table index bits. It will differ if the request is greater than the longest code or if it is less than the shortest code. */ int inflate_table(type, lens, codes, table, bits, work) codetype type; unsigned short FAR *lens; unsigned codes; code FAR * FAR *table; unsigned FAR *bits; unsigned short FAR *work; { unsigned len; /* a code's length in bits */ unsigned sym; /* index of code symbols */ unsigned min, max; /* minimum and maximum code lengths */ unsigned root; /* number of index bits for root table */ unsigned curr; /* number of index bits for current table */ unsigned drop; /* code bits to drop for sub-table */ int left; /* number of prefix codes available */ unsigned used; /* code entries in table used */ unsigned huff; /* Huffman code */ unsigned incr; /* for incrementing code, index */ unsigned fill; /* index for replicating entries */ unsigned low; /* low bits for current root entry */ unsigned mask; /* mask for low root bits */ code this; /* table entry for duplication */ code FAR *next; /* next available space in table */ const unsigned short FAR *base; /* base value table to use */ const unsigned short FAR *extra; /* extra bits table to use */ int end; /* use base and extra for symbol > end */ unsigned short count[MAXBITS+1]; /* number of codes of each length */ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ static const unsigned short lbase[31] = { /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0}; static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64}; /* Process a set of code lengths to create a canonical Huffman code. The code lengths are lens[0..codes-1]. Each length corresponds to the symbols 0..codes-1. The Huffman code is generated by first sorting the symbols by length from short to long, and retaining the symbol order for codes with equal lengths. Then the code starts with all zero bits for the first code of the shortest length, and the codes are integer increments for the same length, and zeros are appended as the length increases. For the deflate format, these bits are stored backwards from their more natural integer increment ordering, and so when the decoding tables are built in the large loop below, the integer codes are incremented backwards. This routine assumes, but does not check, that all of the entries in lens[] are in the range 0..MAXBITS. The caller must assure this. 1..MAXBITS is interpreted as that code length. zero means that that symbol does not occur in this code. The codes are sorted by computing a count of codes for each length, creating from that a table of starting indices for each length in the sorted table, and then entering the symbols in order in the sorted table. The sorted table is work[], with that space being provided by the caller. The length counts are used for other purposes as well, i.e. finding the minimum and maximum length codes, determining if there are any codes at all, checking for a valid set of lengths, and looking ahead at length counts to determine sub-table sizes when building the decoding tables. */ /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ for (len = 0; len <= MAXBITS; len++) count[len] = 0; for (sym = 0; sym < codes; sym++) count[lens[sym]]++; /* bound code lengths, force root to be within code lengths */ root = *bits; for (max = MAXBITS; max >= 1; max--) if (count[max] != 0) break; if (root > max) root = max; if (max == 0) { /* no symbols to code at all */ this.op = (unsigned char)64; /* invalid code marker */ this.bits = (unsigned char)1; this.val = (unsigned short)0; *(*table)++ = this; /* make a table to force an error */ *(*table)++ = this; *bits = 1; return 0; /* no symbols, but wait for decoding to report error */ } for (min = 1; min <= MAXBITS; min++) if (count[min] != 0) break; if (root < min) root = min; /* check for an over-subscribed or incomplete set of lengths */ left = 1; for (len = 1; len <= MAXBITS; len++) { left <<= 1; left -= count[len]; if (left < 0) return -1; /* over-subscribed */ } if (left > 0 && (type == CODES || max != 1)) return -1; /* incomplete set */ /* generate offsets into symbol table for each length for sorting */ offs[1] = 0; for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + count[len]; /* sort symbols by length, by symbol order within each length */ for (sym = 0; sym < codes; sym++) if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; /* Create and fill in decoding tables. In this loop, the table being filled is at next and has curr index bits. The code being used is huff with length len. That code is converted to an index by dropping drop bits off of the bottom. For codes where len is less than drop + curr, those top drop + curr - len bits are incremented through all values to fill the table with replicated entries. root is the number of index bits for the root table. When len exceeds root, sub-tables are created pointed to by the root entry with an index of the low root bits of huff. This is saved in low to check for when a new sub-table should be started. drop is zero when the root table is being filled, and drop is root when sub-tables are being filled. When a new sub-table is needed, it is necessary to look ahead in the code lengths to determine what size sub-table is needed. The length counts are used for this, and so count[] is decremented as codes are entered in the tables. used keeps track of how many table entries have been allocated from the provided *table space. It is checked when a LENS table is being made against the space in *table, ENOUGH, minus the maximum space needed by the worst case distance code, MAXD. This should never happen, but the sufficiency of ENOUGH has not been proven exhaustively, hence the check. This assumes that when type == LENS, bits == 9. sym increments through all symbols, and the loop terminates when all codes of length max, i.e. all codes, have been processed. This routine permits incomplete codes, so another loop after this one fills in the rest of the decoding tables with invalid code markers. */ /* set up for code type */ switch (type) { case CODES: base = extra = work; /* dummy value--not used */ end = 19; break; case LENS: base = lbase; base -= 257; extra = lext; extra -= 257; end = 256; break; default: /* DISTS */ base = dbase; extra = dext; end = -1; } /* initialize state for loop */ huff = 0; /* starting code */ sym = 0; /* starting code symbol */ len = min; /* starting code length */ next = *table; /* current table to fill in */ curr = root; /* current table index bits */ drop = 0; /* current bits to drop from code for index */ low = (unsigned)(-1); /* trigger new sub-table when len > root */ used = 1U << root; /* use root table entries */ mask = used - 1; /* mask for comparing low */ /* check available table space */ if (type == LENS && used >= ENOUGH - MAXD) return 1; /* process all codes and make table entries */ for (;;) { /* create table entry */ this.bits = (unsigned char)(len - drop); if ((int)(work[sym]) < end) { this.op = (unsigned char)0; this.val = work[sym]; } else if ((int)(work[sym]) > end) { this.op = (unsigned char)(extra[work[sym]]); this.val = base[work[sym]]; } else { this.op = (unsigned char)(32 + 64); /* end of block */ this.val = 0; } /* replicate for those indices with low len bits equal to huff */ incr = 1U << (len - drop); fill = 1U << curr; min = fill; /* save offset to next table */ do { fill -= incr; next[(huff >> drop) + fill] = this; } while (fill != 0); /* backwards increment the len-bit code huff */ incr = 1U << (len - 1); while (huff & incr) incr >>= 1; if (incr != 0) { huff &= incr - 1; huff += incr; } else huff = 0; /* go to next symbol, update count, len */ sym++; if (--(count[len]) == 0) { if (len == max) break; len = lens[work[sym]]; } /* create new sub-table if needed */ if (len > root && (huff & mask) != low) { /* if first time, transition to sub-tables */ if (drop == 0) drop = root; /* increment past last table */ next += min; /* here min is 1 << curr */ /* determine length of next table */ curr = len - drop; left = (int)(1 << curr); while (curr + drop < max) { left -= count[curr + drop]; if (left <= 0) break; curr++; left <<= 1; } /* check for enough space */ used += 1U << curr; if (type == LENS && used >= ENOUGH - MAXD) return 1; /* point entry in root table to sub-table */ low = huff & mask; (*table)[low].op = (unsigned char)curr; (*table)[low].bits = (unsigned char)root; (*table)[low].val = (unsigned short)(next - *table); } } /* Fill in rest of table for incomplete codes. This loop is similar to the loop above in incrementing huff for table indices. It is assumed that len is equal to curr + drop, so there is no loop needed to increment through high index bits. When the current sub-table is filled, the loop drops back to the root table to fill in any remaining entries there. */ this.op = (unsigned char)64; /* invalid code marker */ this.bits = (unsigned char)(len - drop); this.val = (unsigned short)0; while (huff != 0) { /* when done with sub-table, drop back to root table */ if (drop != 0 && (huff & mask) != low) { drop = 0; len = root; next = *table; this.bits = (unsigned char)len; } /* put invalid code marker in table */ next[huff >> drop] = this; /* backwards increment the len-bit code huff */ incr = 1U << (len - 1); while (huff & incr) incr >>= 1; if (incr != 0) { huff &= incr - 1; huff += incr; } else huff = 0; } /* set return parameters */ *table += used; *bits = root; return 0; } --- NEW FILE: zutil.h --- /* zutil.h -- internal interface and configuration of the compression library * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ /* @(#) $Id: zutil.h,v 1.1 2006/05/12 21:27:37 spacy51 Exp $ */ #ifndef ZUTIL_H #define ZUTIL_H #define ZLIB_INTERNAL #include "zlib.h" #ifdef STDC # ifndef _WIN32_WCE # include <stddef.h> # endif # include <string.h> # include <stdlib.h> #endif #ifdef NO_ERRNO_H # ifdef _WIN32_WCE /* The Microsoft C Run-Time Library for Windows CE doesn't have * errno. We define it as a global variable to simplify porting. * Its value is always 0 and should not be used. We rename it to * avoid conflict with other libraries that use the same workaround. */ # define errno z_errno # endif extern int errno; #else # ifndef _WIN32_WCE # include <errno.h> # endif #endif #ifndef local # define local static #endif /* compile with -Dlocal if your debugger can't find static symbols */ typedef unsigned char uch; typedef uch FAR uchf; typedef unsigned short ush; typedef ush FAR ushf; typedef unsigned long ulg; extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] #define ERR_RETURN(strm,err) \ return (strm->msg = (char*)ERR_MSG(err), (err)) /* To be used only when the state is known to be valid */ /* common constants */ #ifndef DEF_WBITS # define DEF_WBITS MAX_WBITS #endif /* default windowBits for decompression. MAX_WBITS is for compression only */ #if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 #else # define DEF_MEM_LEVEL MAX_MEM_LEVEL #endif /* default memLevel */ #define STORED_BLOCK 0 #define STATIC_TREES 1 #define DYN_TREES 2 /* The three kinds of block type */ #define MIN_MATCH 3 #define MAX_MATCH 258 /* The minimum and maximum match lengths */ #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ /* target dependencies */ #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) # define OS_CODE 0x00 # if defined(__TURBOC__) || defined(__BORLANDC__) # if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) /* Allow compilation with ANSI keywords only enabled */ void _Cdecl farfree( void *block ); void *_Cdecl farmalloc( unsigned long nbytes ); # else # include <alloc.h> # endif # else /* MSC or DJGPP */ # include <malloc.h> # endif #endif #ifdef AMIGA # define OS_CODE 0x01 #endif #if defined(VAXC) || defined(VMS) # define OS_CODE 0x02 # define F_OPEN(name, mode) \ fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") #endif #if defined(ATARI) || defined(atarist) # define OS_CODE 0x05 #endif #ifdef OS2 # define OS_CODE 0x06 # ifdef M_I86 #include <malloc.h> # endif #endif #if defined(MACOS) || defined(TARGET_OS_MAC) # define OS_CODE 0x07 # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include <unix.h> /* for fdopen */ # else # ifndef fdopen # define fdopen(fd,mode) NULL /* No fdopen() */ # endif # endif #endif #ifdef TOPS20 # define OS_CODE 0x0a #endif #ifdef WIN32 # ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ # define OS_CODE 0x0b # endif #endif #ifdef __50SERIES /* Prime/PRIMOS */ # define OS_CODE 0x0f #endif #if defined(_BEOS_) || defined(RISCOS) # define fdopen(fd,mode) NULL /* No fdopen() */ #endif #if (defined(_MSC_VER) && (_MSC_VER > 600)) # if defined(_WIN32_WCE) # define fdopen(fd,mode) NULL /* No fdopen() */ # ifndef _PTRDIFF_T_DEFINED typedef int ptrdiff_t; # define _PTRDIFF_T_DEFINED # endif # else # define fdopen(fd,type) _fdopen(fd,type) # endif #endif /* common defaults */ #ifndef OS_CODE # define OS_CODE 0x03 /* assume Unix */ #endif #ifndef F_OPEN # define F_OPEN(name, mode) fopen((name), (mode)) #endif /* functions */ #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) # ifndef HAVE_VSNPRINTF # define HAVE_VSNPRINTF # endif #endif #if defined(__CYGWIN__) # ifndef HAVE_VSNPRINTF # define HAVE_VSNPRINTF # endif #endif #ifndef HAVE_VSNPRINTF # ifdef MSDOS /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), but for now we just assume it doesn't. */ # define NO_vsnprintf # endif # ifdef __TURBOC__ # define NO_vsnprintf # endif # ifdef WIN32 /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ # if !defined(vsnprintf) && !defined(NO_vsnprintf) # define vsnprintf _vsnprintf # endif # endif # ifdef __SASC # define NO_vsnprintf # endif #endif #ifdef VMS # define NO_vsnprintf #endif #if defined(pyr) # define NO_MEMCPY #endif #if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) /* Use our own functions for small and medium model with MSC <= 5.0. * You may have to use the same strategy for Borland C (untested). * The __SC__ check is for Symantec. */ # define NO_MEMCPY #endif #if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) # define HAVE_MEMCPY #endif #ifdef HAVE_MEMCPY # ifdef SMALL_MEDIUM /* MSDOS small or medium model */ # define zmemcpy _fmemcpy # define zmemcmp _fmemcmp # define zmemzero(dest, len) _fmemset(dest, 0, len) # else # define zmemcpy memcpy # define zmemcmp memcmp # define zmemzero(dest, len) memset(dest, 0, len) # endif #else extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); extern void zmemzero OF((Bytef* dest, uInt len)); #endif /* Diagnostic functions */ #ifdef DEBUG # include <stdio.h> extern int z_verbose; extern void z_error OF((char *m)); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;} # define Tracevv(x) {if (z_verbose>1) fprintf x ;} # define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} #else # define Assert(cond,msg) # define Trace(x) # define Tracev(x) # define Tracevv(x) # define Tracec(c,x) # define Tracecv(c,x) #endif voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); void zcfree OF((voidpf opaque, voidpf ptr)); #define ZALLOC(strm, items, size) \ (*((strm)->zalloc))((strm)->opaque, (items), (size)) #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} #endif /* ZUTIL_H */ --- NEW FILE: infback.c --- /* infback.c -- inflate using a call-back interface * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* This code is largely copied from inflate.c. Normally either infback.o or inflate.o would be linked into an application--not both. The interface with inffast.c is retained so that optimized assembler-coded versions of inflate_fast() can be used with either inflate.c or infback.c. */ #include "zutil.h" #include "inftrees.h" #include "inflate.h" #include "inffast.h" /* function prototypes */ local void fixedtables OF((struct inflate_state FAR *state)); /* strm provides memory allocation functions in zalloc and zfree, or Z_NULL to use the library memory allocation functions. windowBits is in the range 8..15, and window is a user-supplied window and output buffer that is 2**windowBits bytes. */ int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) z_streamp strm; int windowBits; unsigned char FAR *window; const char *version; int stream_size; { struct inflate_state FAR *state; if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || stream_size != (int)(sizeof(z_stream))) return Z_VERSION_ERROR; if (strm == Z_NULL || window == Z_NULL || windowBits < 8 || windowBits > 15) return Z_STREAM_ERROR; strm->msg = Z_NULL; /* in case we return an error */ if (strm->zalloc == (alloc_func)0) { strm->zalloc = zcalloc; strm->opaque = (voidpf)0; } if (strm->zfree == (free_func)0) strm->zfree = zcfree; state = (struct inflate_state FAR *)ZALLOC(strm, 1, sizeof(struct inflate_state)); if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); strm->state = (struct internal_state FAR *)state; state->dmax = 32768U; state->wbits = windowBits; state->wsize = 1U << windowBits; state->window = window; state->write = 0; state->whave = 0; return Z_OK; } /* Return state with length and distance decoding tables and index sizes set to fixed code decoding. Normally this returns fixed tables from inffixed.h. If BUILDFIXED is defined, then instead this routine builds the tables the first time it's called, and returns those tables the first time and thereafter. This reduces the size of the code by about 2K bytes, in exchange for a little execution time. However, BUILDFIXED should not be used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ local void fixedtables(state) struct inflate_state FAR *state; { #ifdef BUILDFIXED static int virgin = 1; static code *lenfix, *distfix; static code fixed[544]; /* build fixed huffman tables if first call (may not be thread safe) */ if (virgin) { unsigned sym, bits; static code *next; /* literal/length table */ sym = 0; while (sym < 144) state->lens[sym++] = 8; while (sym < 256) state->lens[sym++] = 9; while (sym < 280) state->lens[sym++] = 7; while (sym < 288) state->lens[sym++] = 8; next = fixed; lenfix = next; bits = 9; inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); /* distance table */ sym = 0; while (sym < 32) state->lens[sym++] = 5; distfix = next; bits = 5; inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); /* do this just once */ virgin = 0; } #else /* !BUILDFIXED */ # include "inffixed.h" #endif /* BUILDFIXED */ state->lencode = lenfix; state->lenbits = 9; state->distcode = distfix; state->distbits = 5; } /* Macros for inflateBack(): */ /* Load returned state from inflate_fast() */ #define LOAD() \ do { \ put = strm->next_out; \ left = strm->avail_out; \ next = strm->next_in; \ have = strm->avail_in; \ hold = state->hold; \ bits = state->bits; \ } while (0) /* Set state from registers for inflate_fast() */ #define RESTORE() \ do { \ strm->next_out = put; \ strm->avail_out = left; \ strm->next_in = next; \ strm->avail_in = have; \ state->hold = hold; \ state->bits = bits; \ } while (0) /* Clear the input bit accumulator */ #define INITBITS() \ do { \ hold = 0; \ bits = 0; \ } while (0) /* Assure that some input is available. If input is requested, but denied, then return a Z_BUF_ERROR from inflateBack(). */ #define PULL() \ do { \ if (have == 0) { \ have = in(in_desc, &next); \ if (have == 0) { \ next = Z_NULL; \ ret = Z_BUF_ERROR; \ goto inf_leave; \ } \ } \ } while (0) /* Get a byte of input into the bit accumulator, or return from inflateBack() with an error if there is no input available. */ #define PULLBYTE() \ do { \ PULL(); \ have--; \ hold += (unsigned long)(*next++) << bits; \ bits += 8; \ } while (0) /* Assure that there are at least n bits in the bit accumulator. If there is not enough available input to do that, then return from inflateBack() with an error. */ #define NEEDBITS(n) \ do { \ while (bits < (unsigned)(n)) \ PULLBYTE(); \ } while (0) /* Return the low n bits of the bit accumulator (n < 16) */ #define BITS(n) \ ((unsigned)hold & ((1U << (n)) - 1)) /* Remove n bits from the bit accumulator */ #define DROPBITS(n) \ do { \ hold >>= (n); \ bits -= (unsigned)(n); \ } while (0) /* Remove zero to seven bits as needed to go to a byte boundary */ #define BYTEBITS() \ do { \ hold >>= bits & 7; \ bits -= bits & 7; \ } while (0) /* Assure that some output space is available, by writing... [truncated message content] |
Update of /cvsroot/vba/VisualBoyAdvance/win32/dependencies/sdl In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20508/win32/dependencies/sdl Added Files: SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_copying.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_quit.h SDL_rwops.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h Log Message: --- NEW FILE: SDL_syswm.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_syswm.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Include file for SDL custom system window manager hooks */ #ifndef _SDL_syswm_h #define _SDL_syswm_h #include "SDL_version.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* Your application has access to a special type of event 'SDL_SYSWMEVENT', which contains window-manager specific information and arrives whenever an unhandled window event occurs. This event is ignored by default, but you can enable it with SDL_EventState() */ #ifdef SDL_PROTOTYPES_ONLY struct SDL_SysWMinfo; typedef struct SDL_SysWMinfo SDL_SysWMinfo; #else /* This is the structure for custom window manager events */ #if (defined(unix) || defined(__unix__) || defined(_AIX) || defined(__OpenBSD__) || defined(__NetBSD__)) && \ (!defined(DISABLE_X11) && !defined(__CYGWIN32__) && !defined(ENABLE_NANOX) && \ !defined(__QNXNTO__)) /* AIX is unix, of course, but the native compiler CSet doesn't define unix */ #include <X11/Xlib.h> #include <X11/Xatom.h> /* These are the various supported subsystems under UNIX */ typedef enum { SDL_SYSWM_X11 } SDL_SYSWM_TYPE; /* The UNIX custom event structure */ struct SDL_SysWMmsg { SDL_version version; SDL_SYSWM_TYPE subsystem; union { XEvent xevent; } event; }; /* The UNIX custom window manager information structure. When this structure is returned, it holds information about which low level system it is using, and will be one of SDL_SYSWM_TYPE. */ typedef struct SDL_SysWMinfo { SDL_version version; SDL_SYSWM_TYPE subsystem; union { struct { Display *display; /* The X11 display */ Window window; /* The X11 display window */ /* These locking functions should be called around any X11 functions using the display variable. They lock the event thread, so should not be called around event functions or from event filters. */ void (*lock_func)(void); void (*unlock_func)(void); /* Introduced in SDL 1.0.2 */ Window fswindow; /* The X11 fullscreen window */ Window wmwindow; /* The X11 managed input window */ } x11; } info; } SDL_SysWMinfo; #elif defined(ENABLE_NANOX) #include <microwin/nano-X.h> /* The generic custom event structure */ struct SDL_SysWMmsg { SDL_version version; int data; }; /* The windows custom window manager information structure */ typedef struct SDL_SysWMinfo { SDL_version version ; GR_WINDOW_ID window ; /* The display window */ } SDL_SysWMinfo; #elif defined(WIN32) #define WIN32_LEAN_AND_MEAN #include <windows.h> /* The windows custom event structure */ struct SDL_SysWMmsg { SDL_version version; HWND hwnd; /* The window for the message */ UINT msg; /* The type of message */ WPARAM wParam; /* WORD message parameter */ LPARAM lParam; /* LONG message parameter */ }; /* The windows custom window manager information structure */ typedef struct SDL_SysWMinfo { SDL_version version; HWND window; /* The Win32 display window */ HGLRC hglrc; /* The OpenGL context, if any */ } SDL_SysWMinfo; #elif defined(__riscos__) /* RISC OS custom event structure */ struct SDL_SysWMmsg { SDL_version version; int eventCode; /* The window for the message */ int pollBlock[64]; }; /* The RISC OS custom window manager information structure */ typedef struct SDL_SysWMinfo { SDL_version version; int wimpVersion; /* Wimp version running under */ int taskHandle; /* The RISC OS task handle */ int window; /* The RISC OS display window */ } SDL_SysWMinfo; #elif defined(__QNXNTO__) #include <sys/neutrino.h> #include <Ph.h> /* The QNX custom event structure */ struct SDL_SysWMmsg { SDL_version version; int data; }; /* The QNX custom window manager information structure */ typedef struct SDL_SysWMinfo { SDL_version version; int data; } SDL_SysWMinfo; #else /* The generic custom event structure */ struct SDL_SysWMmsg { SDL_version version; int data; }; /* The generic custom window manager information structure */ typedef struct SDL_SysWMinfo { SDL_version version; int data; } SDL_SysWMinfo; #endif /* OS type */ #endif /* SDL_PROTOTYPES_ONLY */ /* Function prototypes */ /* * This function gives you custom hooks into the window manager information. * It fills the structure pointed to by 'info' with custom information and * returns 1 if the function is implemented. If it's not implemented, or * the version member of the 'info' structure is invalid, it returns 0. * * You typically use this function like this: * SDL_SysWMInfo info; * SDL_VERSION(&info.version); * if ( SDL_GetWMInfo(&info) ) { ... } */ extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_syswm_h */ --- NEW FILE: SDL_getenv.h --- /* Not all environments have a working getenv()/putenv() */ #if defined(macintosh) || defined(_WIN32_WCE) #define NEED_SDL_GETENV #endif #ifdef NEED_SDL_GETENV #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* Put a variable of the form "name=value" into the environment */ extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); #define putenv(X) SDL_putenv(X) /* Retrieve a variable named "name" from the environment */ extern DECLSPEC char * SDLCALL SDL_getenv(const char *name); #define getenv(X) SDL_getenv(X) /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* NEED_GETENV */ --- NEW FILE: SDL_thread.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_thread.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif #ifndef _SDL_thread_h #define _SDL_thread_h /* Header for the SDL thread management routines These are independent of the other SDL routines. */ #include "SDL_main.h" #include "SDL_types.h" /* Thread synchronization primitives */ #include "SDL_mutex.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* The SDL thread structure, defined in SDL_thread.c */ struct SDL_Thread; typedef struct SDL_Thread SDL_Thread; /* Create a thread */ extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); /* Get the 32-bit thread identifier for the current thread */ extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); /* Get the 32-bit thread identifier for the specified thread, equivalent to SDL_ThreadID() if the specified thread is NULL. */ extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); /* Wait for a thread to finish. The return code for the thread function is placed in the area pointed to by 'status', if 'status' is not NULL. */ extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); /* Forcefully kill a thread without worrying about its state */ extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_thread_h */ --- NEW FILE: SDL_copying.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_copying.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif --- NEW FILE: SDL_audio.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_audio.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Access to the raw audio mixing buffer for the SDL library */ #ifndef _SDL_audio_h #define _SDL_audio_h #include <stdio.h> #include "SDL_main.h" #include "SDL_types.h" #include "SDL_error.h" #include "SDL_rwops.h" #include "SDL_byteorder.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* The calculated values in this structure are calculated by SDL_OpenAudio() */ typedef struct SDL_AudioSpec { int freq; /* DSP frequency -- samples per second */ Uint16 format; /* Audio data format */ Uint8 channels; /* Number of channels: 1 mono, 2 stereo */ Uint8 silence; /* Audio buffer silence value (calculated) */ Uint16 samples; /* Audio buffer size in samples (power of 2) */ Uint16 padding; /* Necessary for some compile environments */ Uint32 size; /* Audio buffer size in bytes (calculated) */ /* This function is called when the audio device needs more data. 'stream' is a pointer to the audio data buffer 'len' is the length of that buffer in bytes. Once the callback returns, the buffer will no longer be valid. Stereo samples are stored in a LRLRLR ordering. */ void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); void *userdata; } SDL_AudioSpec; /* Audio format flags (defaults to LSB byte order) */ #define AUDIO_U8 0x0008 /* Unsigned 8-bit samples */ #define AUDIO_S8 0x8008 /* Signed 8-bit samples */ #define AUDIO_U16LSB 0x0010 /* Unsigned 16-bit samples */ #define AUDIO_S16LSB 0x8010 /* Signed 16-bit samples */ #define AUDIO_U16MSB 0x1010 /* As above, but big-endian byte order */ #define AUDIO_S16MSB 0x9010 /* As above, but big-endian byte order */ #define AUDIO_U16 AUDIO_U16LSB #define AUDIO_S16 AUDIO_S16LSB /* Native audio byte ordering */ #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define AUDIO_U16SYS AUDIO_U16LSB #define AUDIO_S16SYS AUDIO_S16LSB #else #define AUDIO_U16SYS AUDIO_U16MSB #define AUDIO_S16SYS AUDIO_S16MSB #endif /* A structure to hold a set of audio conversion filters and buffers */ typedef struct SDL_AudioCVT { int needed; /* Set to 1 if conversion possible */ Uint16 src_format; /* Source audio format */ Uint16 dst_format; /* Target audio format */ double rate_incr; /* Rate conversion increment */ Uint8 *buf; /* Buffer to hold entire audio data */ int len; /* Length of original audio buffer */ int len_cvt; /* Length of converted audio buffer */ int len_mult; /* buffer must be len*len_mult big */ double len_ratio; /* Given len, final size is len*len_ratio */ void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); int filter_index; /* Current audio conversion function */ } SDL_AudioCVT; /* Function prototypes */ /* These functions are used internally, and should not be used unless you * have a specific need to specify the audio driver you want to use. * You should normally use SDL_Init() or SDL_InitSubSystem(). */ extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); extern DECLSPEC void SDLCALL SDL_AudioQuit(void); /* This function fills the given character buffer with the name of the * current audio driver, and returns a pointer to it if the audio driver has * been initialized. It returns NULL if no driver has been initialized. */ extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); /* * This function opens the audio device with the desired parameters, and * returns 0 if successful, placing the actual hardware parameters in the * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio * data passed to the callback function will be guaranteed to be in the * requested format, and will be automatically converted to the hardware * audio format if necessary. This function returns -1 if it failed * to open the audio device, or couldn't set up the audio thread. * * When filling in the desired audio spec structure, * 'desired->freq' should be the desired audio frequency in samples-per-second. * 'desired->format' should be the desired audio format. * 'desired->samples' is the desired size of the audio buffer, in samples. * This number should be a power of two, and may be adjusted by the audio * driver to a value more suitable for the hardware. Good values seem to * range between 512 and 8096 inclusive, depending on the application and * CPU speed. Smaller values yield faster response time, but can lead * to underflow if the application is doing heavy processing and cannot * fill the audio buffer in time. A stereo sample consists of both right * and left channels in LR ordering. * Note that the number of samples is directly related to time by the * following formula: ms = (samples*1000)/freq * 'desired->size' is the size in bytes of the audio buffer, and is * calculated by SDL_OpenAudio(). * 'desired->silence' is the value used to set the buffer to silence, * and is calculated by SDL_OpenAudio(). * 'desired->callback' should be set to a function that will be called * when the audio device is ready for more data. It is passed a pointer * to the audio buffer, and the length in bytes of the audio buffer. * This function usually runs in a separate thread, and so you should * protect data structures that it accesses by calling SDL_LockAudio() * and SDL_UnlockAudio() in your code. * 'desired->userdata' is passed as the first parameter to your callback * function. * * The audio device starts out playing silence when it's opened, and should * be enabled for playing by calling SDL_PauseAudio(0) when you are ready * for your audio callback function to be called. Since the audio driver * may modify the requested size of the audio buffer, you should allocate * any local mixing buffers after you open the audio device. */ extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); /* * Get the current audio state: */ typedef enum { SDL_AUDIO_STOPPED = 0, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED } SDL_audiostatus; extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); /* * This function pauses and unpauses the audio callback processing. * It should be called with a parameter of 0 after opening the audio * device to start playing sound. This is so you can safely initialize * data for your callback function after opening the audio device. * Silence will be written to the audio device during the pause. */ extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); /* * This function loads a WAVE from the data source, automatically freeing * that source if 'freesrc' is non-zero. For example, to load a WAVE file, * you could do: * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); * * If this function succeeds, it returns the given SDL_AudioSpec, * filled with the audio data format of the wave data, and sets * 'audio_buf' to a malloc()'d buffer containing the audio data, * and sets 'audio_len' to the length of that audio buffer, in bytes. * You need to free the audio buffer with SDL_FreeWAV() when you are * done with it. * * This function returns NULL and sets the SDL error message if the * wave file cannot be opened, uses an unknown data format, or is * corrupt. Currently raw and MS-ADPCM WAVE files are supported. */ extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); /* Compatibility convenience function -- loads a WAV from a file */ #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) /* * This function frees data previously allocated with SDL_LoadWAV_RW() */ extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); /* * This function takes a source format and rate and a destination format * and rate, and initializes the 'cvt' structure with information needed * by SDL_ConvertAudio() to convert a buffer of audio data from one format * to the other. * This function returns 0, or -1 if there was an error. */ extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate); /* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), * created an audio buffer cvt->buf, and filled it with cvt->len bytes of * audio data in the source format, this function will convert it in-place * to the desired format. * The data conversion may expand the size of the audio data, so the buffer * cvt->buf should be allocated after the cvt structure is initialized by * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. */ extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); /* * This takes two audio buffers of the playing audio format and mixes * them, performing addition, volume adjustment, and overflow clipping. * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME * for full audio volume. Note this does not change hardware volume. * This is provided for convenience -- you can mix your own audio data. */ #define SDL_MIX_MAXVOLUME 128 extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); /* * The lock manipulated by these functions protects the callback function. * During a LockAudio/UnlockAudio pair, you can be guaranteed that the * callback function is not running. Do not call these from the callback * function or you will cause deadlock. */ extern DECLSPEC void SDLCALL SDL_LockAudio(void); extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); /* * This function shuts down audio processing and closes the audio device. */ extern DECLSPEC void SDLCALL SDL_CloseAudio(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_audio_h */ --- NEW FILE: SDL_quit.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_quit.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Include file for SDL quit event handling */ #ifndef _SDL_quit_h #define _SDL_quit_h /* An SDL_QUITEVENT is generated when the user tries to close the application window. If it is ignored or filtered out, the window will remain open. If it is not ignored or filtered, it is queued normally and the window is allowed to close. When the window is closed, screen updates will complete, but have no effect. SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) and SIGTERM (system termination request), if handlers do not already exist, that generate SDL_QUITEVENT events as well. There is no way to determine the cause of an SDL_QUITEVENT, but setting a signal handler in your application will override the default generation of quit events for that signal. */ /* There are no functions directly affecting the quit event */ #define SDL_QuitRequested() \ (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) #endif /* _SDL_quit_h */ --- NEW FILE: SDL_joystick.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_joystick.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Include file for SDL joystick event handling */ #ifndef _SDL_joystick_h #define _SDL_joystick_h #include "SDL_types.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* In order to use these functions, SDL_Init() must have been called with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system for joysticks, and load appropriate drivers. */ /* The joystick structure used to identify an SDL joystick */ struct _SDL_Joystick; typedef struct _SDL_Joystick SDL_Joystick; /* Function prototypes */ /* * Count the number of joysticks attached to the system */ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); /* * Get the implementation dependent name of a joystick. * This can be called before any joysticks are opened. * If no name can be found, this function returns NULL. */ extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index); /* * Open a joystick for use - the index passed as an argument refers to * the N'th joystick on the system. This index is the value which will * identify this joystick in future joystick events. * * This function returns a joystick identifier, or NULL if an error occurred. */ extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index); /* * Returns 1 if the joystick has been opened, or 0 if it has not. */ extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); /* * Get the device index of an opened joystick. */ extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick); /* * Get the number of general axis controls on a joystick */ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); /* * Get the number of trackballs on a joystick * Joystick trackballs have only relative motion events associated * with them and their state cannot be polled. */ extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); /* * Get the number of POV hats on a joystick */ extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); /* * Get the number of buttons on a joystick */ extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); /* * Update the current state of the open joysticks. * This is called automatically by the event loop if any joystick * events are enabled. */ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); /* * Enable/disable joystick event polling. * If joystick events are disabled, you must call SDL_JoystickUpdate() * yourself and check the state of the joystick when you want joystick * information. * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. */ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); /* * Get the current state of an axis control on a joystick * The state is a value ranging from -32768 to 32767. * The axis indices start at index 0. */ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); /* * Get the current state of a POV hat on a joystick * The return value is one of the following positions: */ #define SDL_HAT_CENTERED 0x00 #define SDL_HAT_UP 0x01 #define SDL_HAT_RIGHT 0x02 #define SDL_HAT_DOWN 0x04 #define SDL_HAT_LEFT 0x08 #define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) #define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) #define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) #define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) /* * The hat indices start at index 0. */ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); /* * Get the ball axis change since the last poll * This returns 0, or -1 if you passed it invalid parameters. * The ball indices start at index 0. */ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); /* * Get the current state of a button on a joystick * The button indices start at index 0. */ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); /* * Close a joystick previously opened with SDL_JoystickOpen() */ extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_joystick_h */ --- NEW FILE: SDL_active.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_active.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Include file for SDL application focus event handling */ #ifndef _SDL_active_h #define _SDL_active_h #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* The available application states */ #define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */ #define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */ #define SDL_APPACTIVE 0x04 /* The application is active */ /* Function prototypes */ /* * This function returns the current state of the application, which is a * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to * see your application, otherwise it has been iconified or disabled. */ extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_active_h */ --- NEW FILE: SDL_rwops.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_rwops.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* This file provides a general interface for SDL to read and write data sources. It can easily be extended to files, memory, etc. */ #ifndef _SDL_RWops_h #define _SDL_RWops_h #include <stdio.h> #include "SDL_types.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* This is the read/write operation structure -- very basic */ typedef struct SDL_RWops { /* Seek to 'offset' relative to whence, one of stdio's whence values: SEEK_SET, SEEK_CUR, SEEK_END Returns the final offset in the data source. */ int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence); /* Read up to 'num' objects each of size 'objsize' from the data source to the area pointed at by 'ptr'. Returns the number of objects read, or -1 if the read failed. */ int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); /* Write exactly 'num' objects each of size 'objsize' from the area pointed at by 'ptr' to data source. Returns 'num', or -1 if the write failed. */ int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num); /* Close and free an allocated SDL_FSops structure */ int (SDLCALL *close)(struct SDL_RWops *context); Uint32 type; union { struct { int autoclose; FILE *fp; } stdio; struct { Uint8 *base; Uint8 *here; Uint8 *stop; } mem; struct { void *data1; } unknown; } hidden; } SDL_RWops; /* Functions to create SDL_RWops structures from various data sources */ extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode); extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose); extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size); extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size); extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void); extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area); /* Macros to easily read and write from an SDL_RWops structure */ #define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) #define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, SEEK_CUR) #define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) #define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) #define SDL_RWclose(ctx) (ctx)->close(ctx) /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_RWops_h */ --- NEW FILE: SDL_keyboard.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_keyboard.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Include file for SDL keyboard event handling */ #ifndef _SDL_keyboard_h #define _SDL_keyboard_h #include "SDL_types.h" #include "SDL_keysym.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* Keysym structure - The scancode is hardware dependent, and should not be used by general applications. If no hardware scancode is available, it will be 0. - The 'unicode' translated character is only available when character translation is enabled by the SDL_EnableUNICODE() API. If non-zero, this is a UNICODE character corresponding to the keypress. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character: char ch; if ( (keysym.unicode & 0xFF80) == 0 ) { ch = keysym.unicode & 0x7F; } else { An international character.. } */ typedef struct SDL_keysym { Uint8 scancode; /* hardware specific scancode */ SDLKey sym; /* SDL virtual keysym */ SDLMod mod; /* current key modifiers */ Uint16 unicode; /* translated character */ } SDL_keysym; /* This is the mask which refers to all hotkey bindings */ #define SDL_ALL_HOTKEYS 0xFFFFFFFF /* Function prototypes */ /* * Enable/Disable UNICODE translation of keyboard input. * This translation has some overhead, so translation defaults off. * If 'enable' is 1, translation is enabled. * If 'enable' is 0, translation is disabled. * If 'enable' is -1, the translation state is not changed. * It returns the previous state of keyboard translation. */ extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); /* * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. * 'delay' is the initial delay in ms between the time when a key is * pressed, and keyboard repeat begins. * 'interval' is the time in ms between keyboard repeat events. */ #define SDL_DEFAULT_REPEAT_DELAY 500 #define SDL_DEFAULT_REPEAT_INTERVAL 30 /* * If 'delay' is set to 0, keyboard repeat is disabled. */ extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); /* * Get a snapshot of the current state of the keyboard. * Returns an array of keystates, indexed by the SDLK_* syms. * Used: * Uint8 *keystate = SDL_GetKeyState(NULL); * if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed. */ extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); /* * Get the current key modifier state */ extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); /* * Set the current key modifier state * This does not change the keyboard state, only the key modifier flags. */ extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); /* * Get the name of an SDL virtual keysym */ extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_keyboard_h */ --- NEW FILE: SDL_timer.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_timer.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif #ifndef _SDL_timer_h #define _SDL_timer_h /* Header for the SDL time management routines */ #include "SDL_main.h" #include "SDL_types.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* This is the OS scheduler timeslice, in milliseconds */ #define SDL_TIMESLICE 10 /* This is the maximum resolution of the SDL timer on all platforms */ #define TIMER_RESOLUTION 10 /* Experimentally determined */ /* Get the number of milliseconds since the SDL library initialization. * Note that this value wraps if the program runs for more than ~49 days. */ extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); /* Wait a specified number of milliseconds before returning */ extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); /* Function prototype for the timer callback function */ typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); /* Set a callback to run after the specified number of milliseconds has * elapsed. The callback function is passed the current timer interval * and returns the next timer interval. If the returned value is the * same as the one passed in, the periodic alarm continues, otherwise a * new alarm is scheduled. If the callback returns 0, the periodic alarm * is cancelled. * * To cancel a currently running timer, call SDL_SetTimer(0, NULL); * * The timer callback function may run in a different thread than your * main code, and so shouldn't call any functions from within itself. * * The maximum resolution of this timer is 10 ms, which means that if * you request a 16 ms timer, your callback will run approximately 20 ms * later on an unloaded system. If you wanted to set a flag signaling * a frame update at 30 frames per second (every 33 ms), you might set a * timer for 30 ms: * SDL_SetTimer((33/10)*10, flag_update); * * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). * * Under UNIX, you should not use raise or use SIGALRM and this function * in the same program, as it is implemented using setitimer(). You also * should not use this function in multi-threaded applications as signals * to multi-threaded apps have undefined behavior in some implementations. * * This function returns 0 if successful, or -1 if there was an error. */ extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); /* New timer API, supports multiple timers * Written by Stephane Peter <meg...@lo...> */ /* Function prototype for the new timer callback function. * The callback function is passed the current timer interval and returns * the next timer interval. If the returned value is the same as the one * passed in, the periodic alarm continues, otherwise a new alarm is * scheduled. If the callback returns 0, the periodic alarm is cancelled. */ typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); /* Definition of the timer ID type */ typedef struct _SDL_TimerID *SDL_TimerID; /* Add a new timer to the pool of timers already running. Returns a timer ID, or NULL when an error occurs. */ extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); /* Remove one of the multiple timers knowing its ID. * Returns a boolean value indicating success. */ extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_timer_h */ --- NEW FILE: SDL_byteorder.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_byteorder.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Macros for determining the byte-order of this platform */ #ifndef _SDL_byteorder_h #define _SDL_byteorder_h /* The two types of endianness */ #define SDL_LIL_ENDIAN 1234 #define SDL_BIG_ENDIAN 4321 /* Pardon the mess, I'm trying to determine the endianness of this host. I'm doing it by preprocessor defines rather than some sort of configure script so that application code can use this too. The "right" way would be to dynamically generate this file on install, but that's a lot of work. */ #if (defined(__i386__) || defined(__i386)) || \ defined(__ia64__) || defined(WIN32) || \ (defined(__alpha__) || defined(__alpha)) || \ defined(__arm__) || \ (defined(__mips__) && defined(__MIPSEL__)) || \ defined(__SYMBIAN32__) || \ defined(__x86_64__) || \ defined(__LITTLE_ENDIAN__) #define SDL_BYTEORDER SDL_LIL_ENDIAN #else #define SDL_BYTEORDER SDL_BIG_ENDIAN #endif #endif /* _SDL_byteorder_h */ --- NEW FILE: SDL_error.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_error.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Simple error message routines for SDL */ #ifndef _SDL_error_h #define _SDL_error_h #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* Public functions */ extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); extern DECLSPEC char * SDLCALL SDL_GetError(void); extern DECLSPEC void SDLCALL SDL_ClearError(void); /* Private error message function - used internally */ #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) typedef enum { SDL_ENOMEM, SDL_EFREAD, SDL_EFWRITE, SDL_EFSEEK, SDL_LASTERROR } SDL_errorcode; extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_error_h */ --- NEW FILE: SDL_mouse.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_mouse.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Include file for SDL mouse event handling */ #ifndef _SDL_mouse_h #define _SDL_mouse_h #include "SDL_types.h" #include "SDL_video.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif typedef struct WMcursor WMcursor; /* Implementation dependent */ typedef struct SDL_Cursor { SDL_Rect area; /* The area of the mouse cursor */ Sint16 hot_x, hot_y; /* The "tip" of the cursor */ Uint8 *data; /* B/W cursor data */ Uint8 *mask; /* B/W cursor mask */ Uint8 *save[2]; /* Place to save cursor area */ WMcursor *wm_cursor; /* Window-manager cursor */ } SDL_Cursor; /* Function prototypes */ /* * Retrieve the current state of the mouse. * The current button state is returned as a button bitmask, which can * be tested using the SDL_BUTTON(X) macros, and x and y are set to the * current mouse cursor position. You can pass NULL for either x or y. */ extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); /* * Retrieve the current state of the mouse. * The current button state is returned as a button bitmask, which can * be tested using the SDL_BUTTON(X) macros, and x and y are set to the * mouse deltas since the last call to SDL_GetRelativeMouseState(). */ extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); /* * Set the position of the mouse cursor (generates a mouse motion event) */ extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); /* * Create a cursor using the specified data and mask (in MSB format). * The cursor width must be a multiple of 8 bits. * * The cursor is created in black and white according to the following: * data mask resulting pixel on screen * 0 1 White * 1 1 Black * 0 0 Transparent * 1 0 Inverted color if possible, black if not. * * Cursors created with this function must be freed with SDL_FreeCursor(). */ extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); /* * Set the currently active cursor to the specified one. * If the cursor is currently visible, the change will be immediately * represented on the display. */ extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); /* * Returns the currently active cursor. */ extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); /* * Deallocates a cursor created with SDL_CreateCursor(). */ extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); /* * Toggle whether or not the cursor is shown on the screen. * The cursor start off displayed, but can be turned off. * SDL_ShowCursor() returns 1 if the cursor was being displayed * before the call, or 0 if it was not. You can query the current * state by passing a 'toggle' value of -1. */ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); /* Used as a mask when testing buttons in buttonstate Button 1: Left mouse button Button 2: Middle mouse button Button 3: Right mouse button Button 4: Mouse wheel up (may also be a real button) Button 5: Mouse wheel down (may also be a real button) */ #define SDL_BUTTON(X) (SDL_PRESSED << ((X)-1)) #define SDL_BUTTON_LEFT 1 #define SDL_BUTTON_MIDDLE 2 #define SDL_BUTTON_RIGHT 3 #define SDL_BUTTON_WHEELUP 4 #define SDL_BUTTON_WHEELDOWN 5 #define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) #define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) #define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* _SDL_mouse_h */ --- NEW FILE: SDL_events.h --- /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2004 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Sam Lantinga sl...@li... */ #ifdef SAVE_RCSID static char rcsid = "@(#) $Id: SDL_events.h,v 1.1 2006/05/12 21:27:23 spacy51 Exp $"; #endif /* Include file for SDL event handling */ #ifndef _SDL_events_h #define _SDL_events_h #include "SDL_types.h" #include "SDL_active.h" #include "SDL_keyboard.h" #include "SDL_mouse.h" #include "SDL_joystick.h" #include "SDL_quit.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* Event enumerations */ enum { SDL_NOEVENT = 0, /* Unused (do not remove) */ SDL_ACTIVEEVENT, /* Application loses/gains visibility */ SDL_KEYDOWN, /* Keys pressed */ SDL_KEYUP, /* Keys released */ SDL_MOUSEMOTION, /* Mouse moved */ SDL_MOUSEBUTTONDOWN, /* Mouse button pressed */ SDL_MOUSEBUTTONUP, /* Mouse button released */ SDL_JOYAXISMOTION, /* Joystick axis motion */ SDL_JOYBALLMOTION, /* Joystick trackball motion */ SDL_JOYHATMOTION, /* Joystick hat position change */ SDL_JOYBUTTONDOWN, /* Joystick button pressed */ SDL_JOYBUTTONUP, /* Joystick button released */ SDL_QUIT, /* User-requested quit */ SDL_SYSWMEVENT, /* System specific event */ SDL_EVENT_RESERVEDA, /* Reserved for future use.. */ SDL_EVENT_RESERVEDB, /* Reserved for future use.. */ SDL_VIDEORESIZE, /* User resized video mode */ SDL_VIDEOEXPOSE, /* Screen needs to be redrawn */ SDL_EVENT_RESERVED2, /* Reserved for future use.. */ SDL_EVENT_RESERVED3, /* Reserved for future use.. */ SDL_EVENT_RESERVED4, /* Reserved for future use.. */ SDL_EVENT_RESERVED5, /* Reserved for future use.. */ SDL_EVENT_RESERVED6, /* Reserved for future use.. */ SDL_EVENT_RESERVED7, /* Reserved for future use.. */ /* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ SDL_USEREVENT = 24, /* This last event is only for bounding internal arrays It is the number of bits in the event mask datatype -- Uint32 */ SDL_NUMEVENTS = 32 }; /* Predefined event masks */ #define SDL_EVENTMASK(X) (1<<(X)) enum { SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| SDL_EVENTMASK(SDL_MOUSEBUTTONUP), SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| SDL_EVENTMASK(SDL_JOYBALLMOTION)| SDL_EVENTMASK(SDL_JOYHATMOTION)| SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| SDL_EVENTMASK(SDL_JOYBUTTONUP), SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) }; #define SDL_ALLEVENTS 0xFFFFFFFF /* Application visibility event structure */ typedef struct SDL_ActiveEvent { Uint8 type; /* SDL_ACTIVEEVENT */ Uint8 gain; /* Whether given states were gained or lost (1/0) */ Uint8 state; /* A mask of the focus states */ } SDL_ActiveEvent; /* Keyboard event structure */ typedef struct SDL_KeyboardEvent { Uint8 type; /* SDL_KEYDOWN or SDL_KEYUP */ Uint8 which; /* The keyboard device index */ Uint8 state; /* SDL_PRESSED or SDL_RELEASED */ SDL_keysym keysym; } SDL_KeyboardEvent; /* Mouse motion event structure */ typedef struct SDL_MouseMotionEvent { Uint8 type; /* SDL_MOUSEMOTION */ Uint8 which; /* The mouse device index */ Uint8 state; /* The current button state */ Uint16 x, y; /* The X/Y coordinates of the mouse */ Sint16 xrel; /* The relative motion in the X direction */ Sint16 yrel; /* The relative motion in the Y direction */ } SDL_MouseMotionEvent; /* Mouse button event structure */ typedef struct SDL_MouseButtonEvent { Uint8 type; /* SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ Uint8 which; /* The mouse device index */ Uint8 button; /* The mouse button index */ Uint8 state; /* SDL_PRESSED or SDL_RELEASED */ Uint16 x, y; /* The X/Y coordinates of the mouse at press time */ } SDL_MouseButtonEvent; /* Joystick axis motion event structure */ typedef struct SDL_JoyAxisEvent { Uint8 type; /* SDL_JOYAXISMOTION */ Uint8 which; /* The joystick device index */ Uint8 axis; /* The joystick axis index */ Sint16 value; /* The axis value (range: -32768 to 32767) */ } SDL_JoyAxisEvent; /* Joystick trackball motion event structure */ typedef struct SDL_JoyBallEvent { Uint8 type; /* SDL_JOYBALLMOTION */ Uint8 which; /* The joystick device index */ Uint8 ball; /* The joystick trackball index */ Sint16 xrel; /* The relative motion in the X direction */ Sint16 yrel; /* The relative motion in the Y direction */ } SDL_JoyBallEvent; /* Joystick hat position change event structure */ typedef struct SDL_JoyHatEvent { Uint8 type; /* SDL_JOYHATMOTION */ Uint8 which; /* The joystick device index */ Uint8 hat; /* The joystick hat index */ Uint8 value; /* The hat position value: SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN Note that zero means the POV is centered. */ } SDL_JoyHatEvent; /* Joystick button event structure */ typedef struct SDL_JoyButtonEvent { Uint8 type; /* SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ Uint8 which; /* The joystick device index */ Uint8 button; /* The joystick button index */ Uint8 state; /* SDL_PRESSED or SDL_RELEASED */ } SDL_JoyButtonEvent; /* The "window resized" event When you get this event, you are responsible for setting a new video mode with the new width and height. */ typedef struct SDL_ResizeEvent { Uint8 type; /* SDL_VIDEORESIZE */ int w; /* New width */ int h; /* New height */ } SDL_ResizeEvent; /* The "screen redraw" event */ typedef struct SDL_ExposeEvent { Uint8 type; /* SDL_VIDEOEXPOSE */ } SDL_ExposeEvent; /* The "quit requested" event */ typedef struct SDL_QuitEvent { Uint8 type; /* SDL_QUIT */ } SDL_QuitEvent; /* A user-defined event type */ typedef struct SDL_UserEvent { Uint8 type; /* SDL_USEREVENT through SDL_NUMEVENTS-1 */ int code; /* User defined event code */ void *data1; /* User defined data pointer */ void *data2; /* User defined data pointer */ } SDL_UserEvent; /* If you want to use this event, you should include SDL_syswm.h */ struct SDL_SysWMmsg; typedef struct SDL_SysWMmsg SDL_SysWMmsg; typedef struct SDL_SysWMEvent { Uint8 type; SDL_SysWMmsg *msg; } SDL_SysWMEvent; /* General event structure */ typedef union { Uint8 type; SDL_ActiveEvent active; SDL_KeyboardEvent key; SDL_MouseMotionEvent motion; SDL_MouseButtonEvent button; SDL_JoyAxisEvent jaxis; SDL_JoyBallEvent jball; SDL_JoyHatEvent jhat; SDL_JoyButtonEvent jbutton; SDL_ResizeEvent resize; SDL_ExposeEvent expose; SDL_QuitEvent quit; SDL_UserEvent user; SDL_SysWMEvent syswm; } SDL_Event; /* Function prototypes */ /* Pumps the event loop, gathering events from the input devices. This function updates the event queue and internal input device state. This should only be run in the thread that sets the video mode. */ extern DECLSPEC void SDLCALL SDL_PumpEvents(void); /* Checks the event queue for messages and optionally returns them. If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to the back of the event queue. If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front of the event queue, matching 'mask', will be returned and will not be removed from the queue. If 'action' is SDL_GETEVENT, up to 'numevents' events at the front of the event queue, matching 'mask', will be returned and will be removed from the queue. This function returns the number of events actually stored, or -1 if there was an error. This function ... [truncated message content] |