├── .gitignore ├── English.lproj └── InfoPlist.strings ├── GBAGameCore.h ├── GBAGameCore.mm ├── Info.plist ├── VisualBoyAdvance.icns ├── VisualBoyAdvance.xcodeproj ├── TemplateIcon.icns └── project.pbxproj ├── gba.png └── src ├── AutoBuild.h ├── NLS.h ├── System.h ├── Util.cpp ├── Util.h ├── apu ├── Blip_Buffer.cpp ├── Blip_Buffer.h ├── Effects_Buffer.cpp ├── Effects_Buffer.h ├── Gb_Apu.cpp ├── Gb_Apu.h ├── Gb_Apu_State.cpp ├── Gb_Oscs.cpp ├── Gb_Oscs.h ├── Multi_Buffer.cpp ├── Multi_Buffer.h ├── blargg_common.h ├── blargg_config.h └── blargg_source.h ├── common ├── Array.h ├── Patch.cpp ├── Patch.h ├── Port.h ├── RingBuffer.h ├── SoundDriver.h ├── SoundSDL.cpp ├── SoundSDL.h ├── Types.h ├── ffmpeg.cpp ├── ffmpeg.h ├── memgzio.c └── memgzio.h ├── filters ├── 2xSaI.cpp ├── 2xSaImmx.asm ├── admame.cpp ├── bilinear.cpp ├── hq │ ├── asm │ │ ├── hq3x32.cpp │ │ ├── hq3x_16.asm │ │ ├── hq3x_32.asm │ │ ├── hq4x_16.asm │ │ ├── hq4x_32.asm │ │ └── macros.mac │ └── c │ │ ├── hq3x_pattern.h │ │ ├── hq4x_pattern.h │ │ ├── hq_base.h │ │ ├── hq_implementation.cpp │ │ └── hq_shared.h ├── hq2x.cpp ├── hq2x.h ├── interframe.cpp ├── interp.h ├── lq2x.h ├── pixel.cpp ├── scanline.cpp └── simpleFilter.cpp ├── gb ├── GB.cpp ├── gb.h ├── gbCheats.cpp ├── gbCheats.h ├── gbCodes.h ├── gbCodesCB.h ├── gbDis.cpp ├── gbGfx.cpp ├── gbGlobals.cpp ├── gbGlobals.h ├── gbMemory.cpp ├── gbMemory.h ├── gbPrinter.cpp ├── gbPrinter.h ├── gbSGB.cpp ├── gbSGB.h ├── gbSound.cpp └── gbSound.h ├── gba ├── CheatSearch.cpp ├── CheatSearch.h ├── Cheats.cpp ├── Cheats.h ├── EEprom.cpp ├── EEprom.h ├── Flash.cpp ├── Flash.h ├── GBA-arm.cpp ├── GBA-thumb.cpp ├── GBA.cpp ├── GBA.h ├── GBAGfx.cpp ├── GBAGfx.h ├── GBALink.cpp ├── GBALink.h ├── GBASockClient.cpp ├── GBASockClient.h ├── GBAcpu.h ├── GBAinline.h ├── Globals.cpp ├── Globals.h ├── Mode0.cpp ├── Mode1.cpp ├── Mode2.cpp ├── Mode3.cpp ├── Mode4.cpp ├── Mode5.cpp ├── RTC.cpp ├── RTC.h ├── Sound.cpp ├── Sound.h ├── Sram.cpp ├── Sram.h ├── agbprint.cpp ├── agbprint.h ├── armdis.cpp ├── armdis.h ├── bios.cpp ├── bios.h ├── elf.cpp ├── elf.h ├── gbafilter.cpp ├── gbafilter.h └── remote.cpp ├── gtk ├── cheatedit.cpp ├── cheatedit.h ├── cheatlist.cpp ├── cheatlist.h ├── configfile.cpp ├── configfile.h ├── directoriesconfig.cpp ├── directoriesconfig.h ├── displayconfig.cpp ├── displayconfig.h ├── filters.cpp ├── filters.h ├── gameboyadvancecheatlist.cpp ├── gameboyadvancecheatlist.h ├── gameboyadvanceconfig.cpp ├── gameboyadvanceconfig.h ├── gameboycheatlist.cpp ├── gameboycheatlist.h ├── gameboyconfig.cpp ├── gameboyconfig.h ├── generalconfig.cpp ├── generalconfig.h ├── gvbam.desktop ├── intl.h ├── joypadconfig.cpp ├── joypadconfig.h ├── main.cpp ├── screenarea-cairo.cpp ├── screenarea-cairo.h ├── screenarea-opengl.cpp ├── screenarea-opengl.h ├── screenarea.cpp ├── screenarea.h ├── soundconfig.cpp ├── soundconfig.h ├── system.cpp ├── tools.cpp ├── tools.h ├── ui │ ├── cheatedit.ui │ ├── cheatlist.ui │ ├── display.ui │ ├── gameboy.ui │ ├── gameboyadvance.ui │ ├── preferences.ui │ ├── sound.ui │ └── vbam.ui ├── window.cpp ├── window.h └── windowcallbacks.cpp ├── libretro ├── Makefile ├── SoundRetro.cpp ├── SoundRetro.h ├── UtilRetro.cpp ├── gbaconv │ └── gbaconv.c ├── jni │ ├── Android.mk │ └── Application.mk ├── libretro.cpp ├── libretro.h ├── link.T ├── msvc │ ├── msvc-2003-xbox1.bat │ ├── msvc-2003-xbox1.sln │ ├── msvc-2003-xbox1 │ │ ├── msvc-2003-xbox1.vcproj │ │ └── stdint.h │ ├── msvc-2010-360.bat │ ├── msvc-2010-360.sln │ ├── msvc-2010-360 │ │ ├── msvc-2010-360.vcxproj │ │ └── msvc-2010-360.vcxproj.filters │ ├── msvc-2010.sln │ └── msvc-2010 │ │ ├── libretro.def │ │ ├── msvc-2010.vcxproj │ │ └── msvc-2010.vcxproj.filters ├── qnx │ └── playbook │ │ ├── .cproject │ │ └── .project └── scrc32.cpp ├── sdl ├── SDL.cpp ├── debugger.cpp ├── debugger.h ├── expr-lex.cpp ├── expr.cpp ├── expr.cpp.h ├── expr.l ├── expr.ypp ├── exprNode.cpp ├── exprNode.h ├── filters.cpp ├── filters.h ├── getopt.c ├── getopt.h ├── getopt1.c ├── inputSDL.cpp ├── inputSDL.h ├── text.cpp ├── text.h └── vbam.cfg-example ├── vba-over.ini ├── version.h ├── win32 ├── AVIWrite.cpp ├── AVIWrite.h ├── AboutDialog.cpp ├── AboutDialog.h ├── AccelEditor.cpp ├── AccelEditor.h ├── AcceleratorManager.cpp ├── AcceleratorManager.h ├── Associate.cpp ├── Associate.h ├── AudioCoreSettingsDlg.cpp ├── AudioCoreSettingsDlg.h ├── BIOSDialog.cpp ├── BIOSDialog.h ├── BitmapControl.cpp ├── BitmapControl.h ├── BugReport.cpp ├── BugReport.h ├── CmdAccelOb.cpp ├── CmdAccelOb.h ├── ColorButton.cpp ├── ColorButton.h ├── ColorControl.cpp ├── ColorControl.h ├── Commands.cpp ├── Direct3D.cpp ├── DirectInput.cpp ├── DirectSound.cpp ├── Directories.cpp ├── Directories.h ├── Disassemble.cpp ├── Disassemble.h ├── Display.h ├── ExportGSASnapshot.cpp ├── ExportGSASnapshot.h ├── FileDlg.cpp ├── FileDlg.h ├── FullscreenSettings.cpp ├── FullscreenSettings.h ├── GBACheats.cpp ├── GBACheats.h ├── GBCheatsDlg.cpp ├── GBCheatsDlg.h ├── GBColorDlg.cpp ├── GBColorDlg.h ├── GBDisassemble.cpp ├── GBDisassemble.h ├── GBMapView.cpp ├── GBMapView.h ├── GBMemoryViewerDlg.cpp ├── GBMemoryViewerDlg.h ├── GBOamView.cpp ├── GBOamView.h ├── GBPaletteView.cpp ├── GBPaletteView.h ├── GBPrinterDlg.cpp ├── GBPrinterDlg.h ├── GBTileView.cpp ├── GBTileView.h ├── GDBConnection.cpp ├── GDBConnection.h ├── GSACodeSelect.cpp ├── GSACodeSelect.h ├── GameOverrides.cpp ├── GameOverrides.h ├── Hyperlink.cpp ├── Hyperlink.h ├── IOViewer.cpp ├── IOViewer.h ├── IOViewerRegs.h ├── IUpdate.h ├── Input.h ├── JoybusOptions.cpp ├── JoybusOptions.h ├── Joypad.cpp ├── Joypad.h ├── KeyboardEdit.cpp ├── KeyboardEdit.h ├── LangSelect.cpp ├── LangSelect.h ├── LinkOptions.cpp ├── LinkOptions.h ├── LoadOAL.cpp ├── LoadOAL.h ├── Logging.cpp ├── Logging.h ├── MainWnd.cpp ├── MainWnd.h ├── MainWndCheats.cpp ├── MainWndFile.cpp ├── MainWndHelp.cpp ├── MainWndOptions.cpp ├── MainWndTools.cpp ├── MapView.cpp ├── MapView.h ├── MaxScale.cpp ├── MaxScale.h ├── MemoryViewer.cpp ├── MemoryViewer.h ├── MemoryViewerAddressSize.cpp ├── MemoryViewerAddressSize.h ├── MemoryViewerDlg.cpp ├── MemoryViewerDlg.h ├── OALConfig.cpp ├── OALConfig.h ├── OamView.cpp ├── OamView.h ├── OpenAL.cpp ├── OpenGL.cpp ├── PaletteView.cpp ├── PaletteView.h ├── PaletteViewControl.cpp ├── PaletteViewControl.h ├── Reg.cpp ├── Reg.h ├── ResizeDlg.cpp ├── ResizeDlg.h ├── RewindInterval.cpp ├── RewindInterval.h ├── RomInfo.cpp ├── RomInfo.h ├── SelectPlugin.cpp ├── SelectPlugin.h ├── StringTokenizer.cpp ├── StringTokenizer.h ├── Throttle.cpp ├── Throttle.h ├── TileView.cpp ├── TileView.h ├── VBA.cpp ├── VBA.h ├── VBA.rc ├── WavWriter.cpp ├── WavWriter.h ├── WinHelper.h ├── WinResUtil.cpp ├── WinResUtil.h ├── XAudio2.cpp ├── XAudio2_Config.cpp ├── XAudio2_Config.h ├── ZoomControl.cpp ├── ZoomControl.h ├── glfont.c ├── glfont.h ├── gzglfont.h ├── res │ ├── VBA.ico │ └── VBA.rc2 ├── resource.h ├── rpi.cpp ├── rpi.h ├── stdafx.cpp ├── stdafx.h └── targetver.h └── wx ├── CMakeLists.txt ├── bin2c.cmake ├── cmdevents.cpp ├── copy-events.cmake ├── drawing.h ├── dsound.cpp ├── filters.h ├── gfxviewers.cpp ├── guiinit.cpp ├── ioregs.h ├── openal.cpp ├── openal.h ├── opts.cpp ├── opts.h ├── panel.cpp ├── sys.cpp ├── viewers.cpp ├── viewsupt.cpp ├── viewsupt.h ├── widgets ├── checkedlistctrl.cpp ├── joyedit.cpp ├── keyedit.cpp ├── sdljoy.cpp ├── wx │ ├── checkedlistctrl.h │ ├── joyedit.h │ ├── keyedit.h │ ├── sdljoy.h │ ├── webupdatedef.h │ └── wxmisc.h └── wxmisc.cpp ├── wxhead.h ├── wxplist.in ├── wxvbam.cpp ├── wxvbam.desktop ├── wxvbam.h ├── wxvbam.rc ├── wxvbam.xrc └── xaudio2.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | *.DS_Store 3 | OEBuildVersion.h 4 | */build/* 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | *.xcworkspace 14 | !OpenEmu.xcworkspace 15 | !default.xcworkspace 16 | xcuserdata 17 | profile 18 | *.moved-aside 19 | icon? 20 | -------------------------------------------------------------------------------- /English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEmu/VisualBoyAdvance-Core/9a002f0799208d4af08e01d8f666bc5d3ea80d9c/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /GBAGameCore.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009, OpenEmu Team 3 | 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of the OpenEmu Team nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY OpenEmu Team ''AS IS'' AND ANY 17 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL OpenEmu Team BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #import 29 | #import 30 | 31 | @class OERingBuffer; 32 | 33 | OE_EXPORTED_CLASS 34 | @interface GBAGameCore : OEGameCore 35 | @end 36 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | VisualBoyAdvance 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.8.0.1233 21 | NSPrincipalClass 22 | OEGameCoreController 23 | OEGameCoreClass 24 | GBAGameCore 25 | OEGameCoreOptions 26 | 27 | openemu.system.gba 28 | 29 | OEGameCoreRewindBufferSeconds 30 | 60 31 | OEGameCoreRewindInterval 32 | 0 33 | OEGameCoreSupportsCheatCode 34 | 35 | OEGameCoreSupportsRewinding 36 | 37 | 38 | 39 | OEGameCorePlayerCount 40 | 1 41 | OEProjectURL 42 | http://sourceforge.net/projects/vbam/ 43 | OESystemIdentifiers 44 | 45 | openemu.system.gba 46 | 47 | SUEnableAutomaticChecks 48 | 1 49 | SUFeedURL 50 | https://raw.github.com/OpenEmu/OpenEmu-Update/master/vba_appcast.xml 51 | 52 | 53 | -------------------------------------------------------------------------------- /VisualBoyAdvance.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEmu/VisualBoyAdvance-Core/9a002f0799208d4af08e01d8f666bc5d3ea80d9c/VisualBoyAdvance.icns -------------------------------------------------------------------------------- /VisualBoyAdvance.xcodeproj/TemplateIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEmu/VisualBoyAdvance-Core/9a002f0799208d4af08e01d8f666bc5d3ea80d9c/VisualBoyAdvance.xcodeproj/TemplateIcon.icns -------------------------------------------------------------------------------- /gba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEmu/VisualBoyAdvance-Core/9a002f0799208d4af08e01d8f666bc5d3ea80d9c/gba.png -------------------------------------------------------------------------------- /src/AutoBuild.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | #ifndef __AUTOBUILD_H__ 21 | #define __AUTOBUILD_H__ 22 | #include "version.h" 23 | //change the FALSE to TRUE for autoincrement of build number 24 | #define INCREMENT_VERSION FALSE 25 | #define FILEVER 1,8,0,600 26 | #define PRODUCTVER 1,8,0,600 27 | #define STRFILEVER "1, 8, 0, 600\0" 28 | #define STRPRODUCTVER "1, 8, 0, 600\0" 29 | #endif //__AUTOBUILD_H__ 30 | -------------------------------------------------------------------------------- /src/NLS.h: -------------------------------------------------------------------------------- 1 | #define N_(String) (String) 2 | 3 | #define MSG_UNSUPPORTED_VBA_SGM 1 4 | #define MSG_CANNOT_LOAD_SGM 2 5 | #define MSG_SAVE_GAME_NOT_USING_BIOS 3 6 | #define MSG_SAVE_GAME_USING_BIOS 4 7 | #define MSG_UNSUPPORTED_SAVE_TYPE 5 8 | #define MSG_CANNOT_OPEN_FILE 6 9 | #define MSG_BAD_ZIP_FILE 7 10 | #define MSG_NO_IMAGE_ON_ZIP 8 11 | #define MSG_ERROR_OPENING_IMAGE 9 12 | #define MSG_ERROR_READING_IMAGE 10 13 | #define MSG_UNSUPPORTED_BIOS_FUNCTION 11 14 | #define MSG_INVALID_BIOS_FILE_SIZE 12 15 | #define MSG_INVALID_CHEAT_CODE 13 16 | #define MSG_UNKNOWN_ARM_OPCODE 14 17 | #define MSG_UNKNOWN_THUMB_OPCODE 15 18 | #define MSG_ERROR_CREATING_FILE 16 19 | #define MSG_FAILED_TO_READ_SGM 17 20 | #define MSG_FAILED_TO_READ_RTC 18 21 | #define MSG_UNSUPPORTED_VB_SGM 19 22 | #define MSG_CANNOT_LOAD_SGM_FOR 20 23 | #define MSG_ERROR_OPENING_IMAGE_FROM 21 24 | #define MSG_ERROR_READING_IMAGE_FROM 22 25 | #define MSG_UNSUPPORTED_ROM_SIZE 23 26 | #define MSG_UNSUPPORTED_RAM_SIZE 24 27 | #define MSG_UNKNOWN_CARTRIDGE_TYPE 25 28 | #define MSG_MAXIMUM_NUMBER_OF_CHEATS 26 29 | #define MSG_INVALID_GAMESHARK_CODE 27 30 | #define MSG_INVALID_GAMEGENIE_CODE 28 31 | #define MSG_INVALID_CHEAT_TO_REMOVE 29 32 | #define MSG_INVALID_CHEAT_CODE_ADDRESS 30 33 | #define MSG_UNSUPPORTED_CHEAT_LIST_VERSION 31 34 | #define MSG_UNSUPPORTED_CHEAT_LIST_TYPE 32 35 | #define MSG_INVALID_GSA_CODE 33 36 | #define MSG_CANNOT_IMPORT_SNAPSHOT_FOR 34 37 | #define MSG_UNSUPPORTED_SNAPSHOT_FILE 35 38 | #define MSG_UNSUPPORTED_ARM_MODE 36 39 | #define MSG_UNSUPPORTED_CODE_FILE 37 40 | #define MSG_GBA_CODE_WARNING 38 41 | #define MSG_INVALID_CBA_CODE 39 42 | #define MSG_CBA_CODE_WARNING 40 43 | #define MSG_OUT_OF_MEMORY 41 44 | #define MSG_WRONG_GAMESHARK_CODE 42 45 | #define MSG_UNSUPPORTED_GAMESHARK_CODE 43 46 | -------------------------------------------------------------------------------- /src/Util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | #include "System.h" 5 | 6 | enum IMAGE_TYPE { 7 | IMAGE_UNKNOWN = -1, 8 | IMAGE_GBA = 0, 9 | IMAGE_GB = 1 10 | }; 11 | 12 | // save game 13 | typedef struct { 14 | void *address; 15 | int size; 16 | } variable_desc; 17 | bool utilWritePNGFile(const char *, int, int, u8 *); 18 | bool utilWriteBMPFile(const char *, int, int, u8 *); 19 | void utilApplyIPS(const char *ips, uint8_t **rom, int *size); 20 | bool utilIsGBAImage(const char *); 21 | bool utilIsGBImage(const char *); 22 | bool utilIsGzipFile(const char *); 23 | bool utilIsZipFile(const char *); 24 | void utilStripDoubleExtension(const char *, char *); 25 | IMAGE_TYPE utilFindType(const char *); 26 | uint8_t *utilLoad(const char *, bool (*)(const char*), uint8_t *, int &); 27 | 28 | void utilPutDword(uint8_t *, uint32_t); 29 | void utilPutWord(uint8_t *, uint16_t); 30 | void utilWriteData(gzFile, variable_desc *); 31 | void utilReadData(gzFile, variable_desc *); 32 | void utilReadDataSkip(gzFile, variable_desc *); 33 | int utilReadInt(gzFile); 34 | void utilWriteInt(gzFile, int); 35 | gzFile utilGzOpen(const char *file, const char *mode); 36 | gzFile utilMemGzOpen(char *memory, int available, const char *mode); 37 | int utilGzWrite(gzFile file, const voidp buffer, unsigned int len); 38 | int utilGzRead(gzFile file, voidp buffer, unsigned int len); 39 | int utilGzClose(gzFile file); 40 | z_off_t utilGzSeek(gzFile file, z_off_t offset, int whence); 41 | long utilGzMemTell(gzFile file); 42 | void utilGBAFindSave(const u8 *, const int); 43 | void utilUpdateSystemColorMaps(bool lcd = false); 44 | bool utilFileExists( const char *filename ); 45 | 46 | 47 | 48 | void utilWriteIntMem(uint8_t *& data, int); 49 | void utilWriteMem(uint8_t *& data, const void *in_data, unsigned size); 50 | void utilWriteDataMem(uint8_t *& data, variable_desc *); 51 | 52 | int utilReadIntMem(const uint8_t *& data); 53 | void utilReadMem(void *buf, const uint8_t *& data, unsigned size); 54 | void utilReadDataMem(const uint8_t *& data, variable_desc *); 55 | 56 | #endif // UTIL_H 57 | -------------------------------------------------------------------------------- /src/apu/blargg_config.h: -------------------------------------------------------------------------------- 1 | // $package user configuration file. Don't replace when updating library. 2 | 3 | #ifndef BLARGG_CONFIG_H 4 | #define BLARGG_CONFIG_H 5 | 6 | // Uncomment to have Gb_Apu run at 4x normal clock rate (16777216 Hz), useful in 7 | // a Game Boy Advance emulator. 8 | #define GB_APU_OVERCLOCK 4 9 | 10 | #define GB_APU_CUSTOM_STATE 1 11 | 12 | // Uncomment to enable platform-specific (and possibly non-portable) optimizations. 13 | //#define BLARGG_NONPORTABLE 1 14 | 15 | // Uncomment if automatic byte-order determination doesn't work 16 | //#define BLARGG_BIG_ENDIAN 1 17 | 18 | // Uncomment to use zlib for transparent decompression of gzipped files 19 | //#define HAVE_ZLIB_H 20 | 21 | // Uncomment if you get errors in the bool section of blargg_common.h 22 | //#define BLARGG_COMPILER_HAS_BOOL 1 23 | 24 | // Uncomment to disable out-of-memory exceptions 25 | //#include 26 | //#define BLARGG_NEW new (std::nothrow) 27 | 28 | // Use standard config.h if present 29 | #ifdef HAVE_CONFIG_H 30 | #include "config.h" 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/common/Array.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2008 by Sindre Aam�s * 3 | * aamas@stud.ntnu.no * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License version 2 as * 7 | * published by the Free Software Foundation. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License version 2 for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * version 2 along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | #ifndef ARRAY_H 20 | #define ARRAY_H 21 | 22 | #include 23 | 24 | template 25 | class Array { 26 | T *a; 27 | std::size_t sz; 28 | 29 | Array(const Array &ar); 30 | 31 | public: 32 | Array(const std::size_t size = 0) : a(size ? new T[size] : 0), sz(size) {} 33 | ~Array() { delete []a; } 34 | void reset(const std::size_t size) { delete []a; a = size ? new T[size] : 0; sz = size; } 35 | std::size_t size() const { return sz; } 36 | operator T*() { return a; } 37 | operator const T*() const { return a; } 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/common/Patch.h: -------------------------------------------------------------------------------- 1 | #ifndef PATCH_H 2 | #define PATCH_H 3 | 4 | #include "Types.h" 5 | 6 | bool applyPatch(const char *patchname, u8 **rom, int *size); 7 | 8 | #endif // PATCH_H 9 | -------------------------------------------------------------------------------- /src/common/Port.h: -------------------------------------------------------------------------------- 1 | #ifndef PORT_H 2 | #define PORT_H 3 | 4 | #ifdef __CELLOS_LV2__ 5 | /* PlayStation3 */ 6 | #include 7 | #endif 8 | 9 | #ifdef _XBOX360 10 | /* XBox 360 */ 11 | #include 12 | #endif 13 | 14 | #include "Types.h" 15 | 16 | // swaps a 16-bit value 17 | static inline u16 swap16(u16 v) 18 | { 19 | return (v<<8)|(v>>8); 20 | } 21 | 22 | // swaps a 32-bit value 23 | static inline u32 swap32(u32 v) 24 | { 25 | return (v<<24)|((v<<8)&0xff0000)|((v>>8)&0xff00)|(v>>24); 26 | } 27 | 28 | #ifdef WORDS_BIGENDIAN 29 | #if defined(__GNUC__) && defined(__ppc__) 30 | 31 | #define READ16LE(base) \ 32 | ({ unsigned short lhbrxResult; \ 33 | __asm__ ("lhbrx %0, 0, %1" : "=r" (lhbrxResult) : "r" (base) : "memory"); \ 34 | lhbrxResult; }) 35 | 36 | #define READ32LE(base) \ 37 | ({ unsigned long lwbrxResult; \ 38 | __asm__ ("lwbrx %0, 0, %1" : "=r" (lwbrxResult) : "r" (base) : "memory"); \ 39 | lwbrxResult; }) 40 | 41 | #define WRITE16LE(base, value) \ 42 | __asm__ ("sthbrx %0, 0, %1" : : "r" (value), "r" (base) : "memory") 43 | 44 | #define WRITE32LE(base, value) \ 45 | __asm__ ("stwbrx %0, 0, %1" : : "r" (value), "r" (base) : "memory") 46 | 47 | #else 48 | #define READ16LE(x) \ 49 | swap16(*((u16 *)(x))) 50 | #define READ32LE(x) \ 51 | swap32(*((u32 *)(x))) 52 | #define WRITE16LE(x,v) \ 53 | *((u16 *)x) = swap16((v)) 54 | #define WRITE32LE(x,v) \ 55 | *((u32 *)x) = swap32((v)) 56 | #endif 57 | #else 58 | #define READ16LE(x) \ 59 | *((u16 *)x) 60 | #define READ32LE(x) \ 61 | *((u32 *)x) 62 | #define WRITE16LE(x,v) \ 63 | *((u16 *)x) = (v) 64 | #define WRITE32LE(x,v) \ 65 | *((u32 *)x) = (v) 66 | #endif 67 | 68 | #endif // PORT_H 69 | -------------------------------------------------------------------------------- /src/common/SoundDriver.h: -------------------------------------------------------------------------------- 1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 2 | // Copyright (C) 2008 VBA-M development team 3 | 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2, or(at your option) 7 | // any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software Foundation, 16 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | #ifndef __VBA_SOUND_DRIVER_H__ 19 | #define __VBA_SOUND_DRIVER_H__ 20 | 21 | #include "Types.h" 22 | 23 | /** 24 | * Sound driver abstract interface for the core to use to output sound. 25 | * Subclass this to implement a new sound driver. 26 | */ 27 | class SoundDriver 28 | { 29 | public: 30 | 31 | /** 32 | * Destructor. Free the resources allocated by the sound driver. 33 | */ 34 | virtual ~SoundDriver() { }; 35 | 36 | /** 37 | * Initialize the sound driver. 38 | * @param sampleRate In Hertz 39 | */ 40 | virtual bool init(long sampleRate) = 0; 41 | 42 | /** 43 | * Tell the driver that the sound stream has paused 44 | */ 45 | virtual void pause() = 0; 46 | 47 | /** 48 | * Reset the sound driver 49 | */ 50 | virtual void reset() = 0; 51 | 52 | /** 53 | * Tell the driver that the sound stream has resumed 54 | */ 55 | virtual void resume() = 0; 56 | 57 | /** 58 | * Write length bytes of data from the finalWave buffer to the driver output buffer. 59 | */ 60 | virtual void write(u16 * finalWave, int length) = 0; 61 | 62 | virtual void setThrottle(unsigned short throttle) { }; 63 | }; 64 | 65 | #endif // __VBA_SOUND_DRIVER_H__ 66 | -------------------------------------------------------------------------------- /src/common/SoundSDL.h: -------------------------------------------------------------------------------- 1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 2 | // Copyright (C) 2008 VBA-M development team 3 | 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2, or(at your option) 7 | // any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software Foundation, 16 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | #ifndef __VBA_SOUND_SDL_H__ 19 | #define __VBA_SOUND_SDL_H__ 20 | 21 | #include "SoundDriver.h" 22 | #include "RingBuffer.h" 23 | 24 | #include 25 | 26 | class SoundSDL: public SoundDriver 27 | { 28 | public: 29 | SoundSDL(); 30 | virtual ~SoundSDL(); 31 | 32 | virtual bool init(long sampleRate); 33 | virtual void pause(); 34 | virtual void reset(); 35 | virtual void resume(); 36 | virtual void write(u16 * finalWave, int length); 37 | 38 | private: 39 | RingBuffer _rbuf; 40 | 41 | SDL_mutex * _mutex; 42 | SDL_sem *_semBufferFull; 43 | SDL_sem *_semBufferEmpty; 44 | 45 | bool _initialized; 46 | 47 | // Defines what delay in seconds we keep in the sound buffer 48 | static const float _delay; 49 | 50 | static void soundCallback(void *data, u8 *stream, int length); 51 | virtual void read(u16 * stream, int length); 52 | }; 53 | 54 | #endif // __VBA_SOUND_SDL_H__ 55 | -------------------------------------------------------------------------------- /src/common/Types.h: -------------------------------------------------------------------------------- 1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 2 | // Copyright (C) 2008 VBA-M development team 3 | 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2, or(at your option) 7 | // any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software Foundation, 16 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | #ifndef __VBA_TYPES_H__ 19 | #define __VBA_TYPES_H__ 20 | 21 | #include 22 | 23 | typedef uint8_t u8; 24 | typedef uint16_t u16; 25 | typedef uint32_t u32; 26 | typedef uint64_t u64; 27 | 28 | typedef int8_t s8; 29 | typedef int16_t s16; 30 | typedef int32_t s32; 31 | typedef int64_t s64; 32 | 33 | #endif // __VBA_TYPES_H__ 34 | -------------------------------------------------------------------------------- /src/common/memgzio.h: -------------------------------------------------------------------------------- 1 | #ifndef MEMGZIO_H 2 | #define MEMGZIO_H 3 | 4 | /* gzio.c -- IO on .gz files 5 | * Copyright (C) 1995-2002 Jean-loup Gailly. 6 | * For conditions of distribution and use, see copyright notice in zlib.h 7 | * 8 | * Compile this file with -DNO_DEFLATE to avoid the compression code. 9 | */ 10 | 11 | /* memgzio.c - IO on .gz files in memory 12 | * Adapted from original gzio.c from zlib library by Forgotten 13 | */ 14 | 15 | #include 16 | 17 | gzFile ZEXPORT memgzopen(char *memory, int available, const char *mode); 18 | int ZEXPORT memgzread(gzFile file, voidp buf, unsigned len); 19 | int ZEXPORT memgzwrite(gzFile file, const voidp buf, unsigned len); 20 | int ZEXPORT memgzclose(gzFile file); 21 | long ZEXPORT memtell(gzFile file); 22 | z_off_t ZEXPORT memgzseek(gzFile file, z_off_t off, int whence); 23 | 24 | #endif // MEMGZIO_H 25 | -------------------------------------------------------------------------------- /src/filters/hq/asm/macros.mac: -------------------------------------------------------------------------------- 1 | ;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach ) 2 | ; 3 | ;http://www.zsnes.com 4 | ;http://sourceforge.net/projects/zsnes 5 | ;https://zsnes.bountysource.com 6 | ; 7 | ;This program is free software; you can redistribute it and/or 8 | ;modify it under the terms of the GNU General Public License 9 | ;version 2 as published by the Free Software Foundation. 10 | ; 11 | ;This program is distributed in the hope that it will be useful, 12 | ;but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ;GNU General Public License for more details. 15 | ; 16 | ;You should have received a copy of the GNU General Public License 17 | ;along with this program; if not, write to the Free Software 18 | ;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | 20 | 21 | %ifdef __AMD64__ 22 | bits 64 23 | %else 24 | bits 32 25 | %endif 26 | 27 | %ifdef MACHO 28 | section .text align=16 29 | section .data align=4 30 | section .bss align=4 31 | %endif 32 | 33 | %ifdef ELF 34 | 35 | %imacro newsym 1 36 | GLOBAL %1 37 | %1: 38 | %endmacro 39 | %imacro newsym 2+ 40 | GLOBAL %1 41 | %1: %2 42 | %endmacro 43 | %define EXTSYM EXTERN 44 | 45 | section .note.GNU-stack noalloc noexec nowrite progbits 46 | 47 | %else 48 | 49 | %imacro newsym 1 50 | GLOBAL _%1 51 | _%1: 52 | %1: 53 | %endmacro 54 | %imacro newsym 2+ 55 | GLOBAL _%1 56 | _%1: 57 | %1: %2 58 | %endmacro 59 | %imacro EXTSYM 1-* 60 | %rep %0 61 | EXTERN _%1 62 | %define %1 _%1 63 | %rotate 1 64 | %endrep 65 | %endmacro 66 | %endif 67 | 68 | %macro ALIGN32 0 69 | times ($$-$) & 1Fh nop ; Long word alignment 70 | %endmacro 71 | %macro ALIGN16 0 72 | times ($$-$) & 1Fh nop ; Long word alignment 73 | %endmacro 74 | -------------------------------------------------------------------------------- /src/filters/hq/c/hq_implementation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | VisualBoyAdvance - a Game Boy & Game Boy Advance emulator 3 | 4 | Copyright (C) 2008 VBA-M development team 5 | 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | 21 | hq filter by Maxim Stepin ( http://hiend3d.com ) 22 | */ 23 | 24 | 25 | #include "hq_shared.h" 26 | 27 | 28 | #define _16BIT 29 | #define _HQ3X 30 | // hq3x, 16bit 31 | #include "hq_base.h" 32 | #undef _HQ3X 33 | 34 | #define _HQ4X 35 | // hq4x, 16bit 36 | #include "hq_base.h" 37 | #undef _HQ4X 38 | #undef _16BIT 39 | 40 | 41 | #define _32BIT 42 | #define _HQ3X 43 | // hq3x, 32bit 44 | #include "hq_base.h" 45 | #undef _HQ3X 46 | 47 | #define _HQ4X 48 | // hq4x, 32bit 49 | #include "hq_base.h" 50 | #undef _HQ4X 51 | #undef _32BIT 52 | 53 | 54 | 55 | #undef GMASK 56 | #undef RBMASK 57 | #undef GSHIFT1MASK 58 | #undef RBSHIFT1MASK 59 | #undef GSHIFT2MASK 60 | #undef RBSHIFT2MASK 61 | #undef GSHIFT3MASK 62 | #undef RBSHIFT3MASK 63 | #undef GSHIFT4MASK 64 | #undef RBSHIFT4MASK 65 | -------------------------------------------------------------------------------- /src/gb/gb.h: -------------------------------------------------------------------------------- 1 | #ifndef GB_H 2 | #define GB_H 3 | 4 | #define C_FLAG 0x10 5 | #define H_FLAG 0x20 6 | #define N_FLAG 0x40 7 | #define Z_FLAG 0x80 8 | 9 | typedef union { 10 | struct { 11 | #ifdef WORDS_BIGENDIAN 12 | u8 B1, B0; 13 | #else 14 | u8 B0,B1; 15 | #endif 16 | } B; 17 | u16 W; 18 | } gbRegister; 19 | 20 | extern gbRegister AF, BC, DE, HL, SP, PC; 21 | extern u16 IFF; 22 | int gbDis(char *, u16); 23 | 24 | bool gbLoadRom(const char *); 25 | bool gbUpdateSizes(); 26 | void gbEmulate(int); 27 | void gbWriteMemory(register u16, register u8); 28 | void gbDrawLine(); 29 | bool gbIsGameboyRom(const char *); 30 | void gbGetHardwareType(); 31 | void gbReset(); 32 | void gbCleanUp(); 33 | void gbCPUInit(const char *,bool); 34 | bool gbWriteBatteryFile(const char *); 35 | bool gbWriteBatteryFile(const char *, bool); 36 | bool gbReadBatteryFile(const char *); 37 | bool gbWriteSaveState(const char *); 38 | bool gbWriteMemSaveState(char *, int); 39 | bool gbReadSaveState(const char *); 40 | bool gbReadMemSaveState(char *, int); 41 | void gbSgbRenderBorder(); 42 | bool gbWritePNGFile(const char *); 43 | bool gbWriteBMPFile(const char *); 44 | bool gbReadGSASnapshot(const char *); 45 | 46 | extern int gbHardware; 47 | 48 | extern struct EmulatedSystem GBSystem; 49 | 50 | #endif // GB_H 51 | -------------------------------------------------------------------------------- /src/gb/gbCheats.h: -------------------------------------------------------------------------------- 1 | #ifndef GBCHEATS_H 2 | #define GBCHEATS_H 3 | 4 | #include "../System.h" 5 | 6 | struct gbXxCheat { 7 | char cheatDesc[100]; 8 | char cheatCode[20]; 9 | }; 10 | 11 | struct gbCheat { 12 | char cheatCode[20]; 13 | char cheatDesc[32]; 14 | u16 address; 15 | int code; 16 | u8 compare; 17 | u8 value; 18 | bool enabled; 19 | }; 20 | 21 | void gbCheatsSaveGame(gzFile); 22 | void gbCheatsReadGame(gzFile, int); 23 | void gbCheatsReadGameSkip(gzFile, int); 24 | void gbCheatsSaveCheatList(const char *); 25 | bool gbCheatsLoadCheatList(const char *); 26 | bool gbCheatReadGSCodeFile(const char *); 27 | 28 | bool gbAddGsCheat(const char *, const char*); 29 | bool gbAddGgCheat(const char *, const char*); 30 | void gbCheatRemove(int); 31 | void gbCheatRemoveAll(); 32 | void gbCheatEnable(int); 33 | void gbCheatDisable(int); 34 | u8 gbCheatRead(u16); 35 | void gbCheatWrite(bool); 36 | bool gbVerifyGsCode(const char *code); 37 | bool gbVerifyGgCode(const char *code); 38 | 39 | 40 | extern int gbCheatNumber; 41 | extern gbCheat gbCheatList[100]; 42 | extern bool gbCheatMap[0x10000]; 43 | 44 | #endif // GBCHEATS_H 45 | -------------------------------------------------------------------------------- /src/gb/gbGlobals.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../common/Types.h" 3 | 4 | u8 *gbMemoryMap[16]; 5 | 6 | int gbRomSizeMask = 0; 7 | int gbRomSize = 0; 8 | int gbRamSizeMask = 0; 9 | int gbRamSize = 0; 10 | int gbTAMA5ramSize = 0; 11 | 12 | u8 *gbMemory = NULL; 13 | u8 *gbVram = NULL; 14 | u8 *gbRom = NULL; 15 | u8 *gbRam = NULL; 16 | u8 *gbWram = NULL; 17 | u16 *gbLineBuffer = NULL; 18 | u8 *gbTAMA5ram = NULL; 19 | 20 | u16 gbPalette[128]; 21 | u8 gbBgp[4] = { 0, 1, 2, 3}; 22 | u8 gbObp0[4] = { 0, 1, 2, 3}; 23 | u8 gbObp1[4] = { 0, 1, 2, 3}; 24 | int gbWindowLine = -1; 25 | 26 | bool genericflashcardEnable = false; 27 | int gbCgbMode = 0; 28 | 29 | u16 gbColorFilter[32768]; 30 | int gbColorOption = 0; 31 | int gbPaletteOption = 0; 32 | int gbEmulatorType = 0; 33 | int gbBorderOn = 0; 34 | int gbBorderAutomatic = 0; 35 | int gbBorderLineSkip = 160; 36 | int gbBorderRowSkip = 0; 37 | int gbBorderColumnSkip = 0; 38 | int gbDmaTicks = 0; 39 | 40 | u8 (*gbSerialFunction)(u8) = NULL; 41 | -------------------------------------------------------------------------------- /src/gb/gbGlobals.h: -------------------------------------------------------------------------------- 1 | #ifndef GBGLOBALS_H 2 | #define GBGLOBALS_H 3 | 4 | extern int gbRomSizeMask; 5 | extern int gbRomSize; 6 | extern int gbRamSize; 7 | extern int gbRamSizeMask; 8 | extern int gbTAMA5ramSize; 9 | 10 | extern bool useBios; 11 | extern bool skipBios; 12 | extern u8 *bios; 13 | extern bool skipSaveGameBattery; 14 | extern bool skipSaveGameCheats; 15 | 16 | extern u8 *gbRom; 17 | extern u8 *gbRam; 18 | extern u8 *gbVram; 19 | extern u8 *gbWram; 20 | extern u8 *gbMemory; 21 | extern u16 *gbLineBuffer; 22 | extern u8 *gbTAMA5ram; 23 | 24 | extern u8 *gbMemoryMap[16]; 25 | 26 | extern int gbFrameSkip; 27 | extern u16 gbColorFilter[32768]; 28 | extern int gbColorOption; 29 | extern int gbPaletteOption; 30 | extern int gbEmulatorType; 31 | extern int gbBorderOn; 32 | extern int gbBorderAutomatic; 33 | extern int gbCgbMode; 34 | extern int gbSgbMode; 35 | extern int gbWindowLine; 36 | extern int gbSpeed; 37 | extern u8 gbBgp[4]; 38 | extern u8 gbObp0[4]; 39 | extern u8 gbObp1[4]; 40 | extern u16 gbPalette[128]; 41 | extern bool gbScreenOn; 42 | extern bool gbDrawWindow; 43 | extern u8 gbSCYLine[300]; 44 | // gbSCXLine is used for the emulation (bug) of the SX change 45 | // found in the Artic Zone game. 46 | extern u8 gbSCXLine[300]; 47 | // gbBgpLine is used for the emulation of the 48 | // Prehistorik Man's title screen scroller. 49 | extern u8 gbBgpLine[300]; 50 | extern u8 gbObp0Line [300]; 51 | extern u8 gbObp1Line [300]; 52 | // gbSpritesTicks is used for the emulation of Parodius' Laser Beam. 53 | extern u8 gbSpritesTicks[300]; 54 | 55 | extern u8 register_LCDC; 56 | extern u8 register_LY; 57 | extern u8 register_SCY; 58 | extern u8 register_SCX; 59 | extern u8 register_WY; 60 | extern u8 register_WX; 61 | extern u8 register_VBK; 62 | extern u8 oldRegister_WY; 63 | 64 | extern int emulating; 65 | extern bool genericflashcardEnable; 66 | 67 | extern int gbBorderLineSkip; 68 | extern int gbBorderRowSkip; 69 | extern int gbBorderColumnSkip; 70 | extern int gbDmaTicks; 71 | 72 | extern void gbRenderLine(); 73 | extern void gbDrawSprites(bool); 74 | 75 | extern u8 (*gbSerialFunction)(u8); 76 | 77 | #endif // GBGLOBALS_H 78 | -------------------------------------------------------------------------------- /src/gb/gbPrinter.h: -------------------------------------------------------------------------------- 1 | #ifndef GBPRINTER_H 2 | #define GBPRINTER_H 3 | 4 | #include "../System.h" 5 | 6 | u8 gbPrinterSend(u8 b); 7 | 8 | #endif // GBPRINTER_H 9 | -------------------------------------------------------------------------------- /src/gb/gbSGB.h: -------------------------------------------------------------------------------- 1 | #ifndef GBSGB_H 2 | #define GBSGB_H 3 | 4 | void gbSgbInit(); 5 | void gbSgbShutdown(); 6 | void gbSgbCommand(); 7 | void gbSgbResetPacketState(); 8 | void gbSgbReset(); 9 | void gbSgbDoBitTransfer(u8); 10 | void gbSgbSaveGame(gzFile); 11 | void gbSgbReadGame(gzFile, int version); 12 | void gbSgbRenderBorder(); 13 | 14 | extern u8 gbSgbATF[20*18]; 15 | extern int gbSgbMode; 16 | extern int gbSgbMask; 17 | extern int gbSgbMultiplayer; 18 | extern u8 gbSgbNextController; 19 | extern int gbSgbPacketTimeout; 20 | extern u8 gbSgbReadingController; 21 | extern int gbSgbFourPlayers; 22 | 23 | #endif // GBSGB_H 24 | -------------------------------------------------------------------------------- /src/gb/gbSound.h: -------------------------------------------------------------------------------- 1 | #ifndef GBSOUND_H 2 | #define GBSOUND_H 3 | 4 | // GB sound emulation 5 | 6 | // See Sound.h for sound setup/options 7 | 8 | //// GB sound options 9 | 10 | void gbSoundSetSampleRate( long sampleRate ); 11 | 12 | // Manages declicking mode. When enabled, clicks are reduced. Note that clicks 13 | // are normal for GB and GBC sound hardware. 14 | void gbSoundSetDeclicking( bool enable ); 15 | bool gbSoundGetDeclicking(); 16 | 17 | // Effects configuration 18 | struct gb_effects_config_t 19 | { 20 | bool enabled; // false = disable all effects 21 | 22 | float echo; // 0.0 = none, 1.0 = lots 23 | float stereo; // 0.0 = channels in center, 1.0 = channels on left/right 24 | bool surround; // true = put some channels in back 25 | }; 26 | 27 | // Changes effects configuration 28 | void gbSoundConfigEffects( gb_effects_config_t const& ); 29 | extern gb_effects_config_t gb_effects_config; // current configuration 30 | 31 | 32 | //// GB sound emulation 33 | 34 | // GB sound registers 35 | #define NR10 0xff10 36 | #define NR11 0xff11 37 | #define NR12 0xff12 38 | #define NR13 0xff13 39 | #define NR14 0xff14 40 | #define NR21 0xff16 41 | #define NR22 0xff17 42 | #define NR23 0xff18 43 | #define NR24 0xff19 44 | #define NR30 0xff1a 45 | #define NR31 0xff1b 46 | #define NR32 0xff1c 47 | #define NR33 0xff1d 48 | #define NR34 0xff1e 49 | #define NR41 0xff20 50 | #define NR42 0xff21 51 | #define NR43 0xff22 52 | #define NR44 0xff23 53 | #define NR50 0xff24 54 | #define NR51 0xff25 55 | #define NR52 0xff26 56 | 57 | // Resets emulated sound hardware 58 | void gbSoundReset(); 59 | 60 | // Emulates write to sound hardware 61 | void gbSoundEvent( u16 address, int data ); 62 | #define SOUND_EVENT gbSoundEvent 63 | 64 | // Emulates read from sound hardware 65 | u8 gbSoundRead( u16 address ); 66 | 67 | // Notifies emulator that SOUND_CLOCK_TICKS clocks have passed 68 | void gbSoundTick(); 69 | extern int SOUND_CLOCK_TICKS; // Number of 16.8 MHz clocks between calls to gbSoundTick() 70 | extern int soundTicks; // Number of 16.8 MHz clocks until gbSoundTick() will be called 71 | 72 | // Saves/loads emulator state 73 | void gbSoundSaveGame( gzFile out ); 74 | void gbSoundReadGame( int version, gzFile in ); 75 | 76 | #endif // GBSOUND_H 77 | -------------------------------------------------------------------------------- /src/gba/CheatSearch.h: -------------------------------------------------------------------------------- 1 | #ifndef CHEATSEARCH_H 2 | #define CHEATSEARCH_H 3 | 4 | #include "../System.h" 5 | 6 | struct CheatSearchBlock { 7 | int size; 8 | u32 offset; 9 | u8 *bits; 10 | u8 *data; 11 | u8 *saved; 12 | }; 13 | 14 | struct CheatSearchData { 15 | int count; 16 | CheatSearchBlock *blocks; 17 | }; 18 | 19 | enum { 20 | SEARCH_EQ, 21 | SEARCH_NE, 22 | SEARCH_LT, 23 | SEARCH_LE, 24 | SEARCH_GT, 25 | SEARCH_GE 26 | }; 27 | 28 | enum { 29 | BITS_8, 30 | BITS_16, 31 | BITS_32 32 | }; 33 | 34 | #define SET_BIT(bits,off) \ 35 | (bits)[(off) >> 3] |= (1 << ((off) & 7)) 36 | 37 | #define CLEAR_BIT(bits, off) \ 38 | (bits)[(off) >> 3] &= ~(1 << ((off) & 7)) 39 | 40 | #define IS_BIT_SET(bits, off) \ 41 | (bits)[(off) >> 3] & (1 << ((off) & 7)) 42 | 43 | extern CheatSearchData cheatSearchData; 44 | 45 | void cheatSearchCleanup(CheatSearchData *cs); 46 | void cheatSearchStart(const CheatSearchData *cs); 47 | void cheatSearch(const CheatSearchData *cs, int compare, int size, bool isSigned); 48 | void cheatSearchValue(const CheatSearchData *cs, int compare, int size, bool isSigned, u32 value); 49 | int cheatSearchGetCount(const CheatSearchData *cs, int size); 50 | void cheatSearchUpdateValues(const CheatSearchData *cs); 51 | s32 cheatSearchSignedRead(u8 *data, int off, int size); 52 | u32 cheatSearchRead(u8 *data, int off, int size); 53 | 54 | #endif // CHEATSEARCH_H 55 | -------------------------------------------------------------------------------- /src/gba/Cheats.h: -------------------------------------------------------------------------------- 1 | #ifndef CHEATS_H 2 | #define CHEATS_H 3 | 4 | struct CheatsData { 5 | int code; 6 | int size; 7 | int status; 8 | bool enabled; 9 | u32 rawaddress; 10 | u32 address; 11 | u32 value; 12 | u32 oldValue; 13 | char codestring[20]; 14 | char desc[32]; 15 | }; 16 | 17 | void cheatsAdd(const char *codeStr, const char *desc, u32 rawaddress, u32 address, u32 value, int code, int size); 18 | void cheatsAddCheatCode(const char *code, const char *desc); 19 | void cheatsAddGSACode(const char *code, const char *desc, bool v3); 20 | void cheatsAddCBACode(const char *code, const char *desc); 21 | bool cheatsImportGSACodeFile(const char *name, int game, bool v3); 22 | void cheatsDelete(int number, bool restore); 23 | void cheatsDeleteAll(bool restore); 24 | void cheatsEnable(int number); 25 | void cheatsDisable(int number); 26 | void cheatsSaveGame(gzFile file); 27 | void cheatsReadGame(gzFile file, int version); 28 | void cheatsReadGameSkip(gzFile file, int version); 29 | void cheatsSaveCheatList(const char *file); 30 | bool cheatsLoadCheatList(const char *file); 31 | void cheatsWriteMemory(u32 address, u32 value); 32 | void cheatsWriteHalfWord(u32 address, u16 value); 33 | void cheatsWriteByte(u32 address, u8 value); 34 | int cheatsCheckKeys(u32 keys, u32 extended); 35 | 36 | extern int cheatsNumber; 37 | extern CheatsData cheatsList[100]; 38 | 39 | #endif // CHEATS_H 40 | -------------------------------------------------------------------------------- /src/gba/EEprom.h: -------------------------------------------------------------------------------- 1 | #ifndef EEPROM_H 2 | #define EEPROM_H 3 | 4 | #define EEPROM_SERIAL_SIZE ((sizeof(int)*5) + sizeof(bool) + 512 + 16 + 0x2000) 5 | 6 | extern void eepromSerialize(uint8_t *& data); 7 | extern void eepromDeserialize(const uint8_t *& data); 8 | 9 | #ifdef __LIBRETRO__ 10 | extern void eepromSaveGame(u8* &data); 11 | extern void eepromReadGame(const u8 *&data, int version); 12 | #else 13 | extern void eepromSaveGame(gzFile _gzFile); 14 | extern void eepromReadGame(gzFile _gzFile, int version); 15 | #endif 16 | extern void eepromReadGameSkip(gzFile _gzFile, int version); 17 | extern int eepromRead(u32 address); 18 | extern void eepromWrite(u32 address, u8 value); 19 | extern void eepromInit(); 20 | extern void eepromReset(); 21 | #ifdef __LIBRETRO__ 22 | extern u8 *eepromData; 23 | #else 24 | extern u8 eepromData[0x2000]; 25 | #endif 26 | extern bool eepromInUse; 27 | extern int eepromSize; 28 | 29 | #define EEPROM_IDLE 0 30 | #define EEPROM_READADDRESS 1 31 | #define EEPROM_READDATA 2 32 | #define EEPROM_READDATA2 3 33 | #define EEPROM_WRITEDATA 4 34 | 35 | #endif // EEPROM_H 36 | -------------------------------------------------------------------------------- /src/gba/Flash.h: -------------------------------------------------------------------------------- 1 | #ifndef FLASH_H 2 | #define FLASH_H 3 | 4 | #define FLASH_128K_SZ 0x20000 5 | #define FLASH_SERIAL_SIZE ((sizeof(int)*4) + 0x20000) 6 | 7 | extern void flashSerialize(uint8_t *& data); 8 | extern void flashDeserialize(const uint8_t *& data); 9 | 10 | #ifdef __LIBRETRO__ 11 | extern void flashSaveGame(u8 *& data); 12 | extern void flashReadGame(const u8 *& data, int); 13 | #else 14 | extern void flashSaveGame(gzFile _gzFile); 15 | extern void flashReadGame(gzFile _gzFile, int version); 16 | #endif 17 | extern void flashReadGameSkip(gzFile _gzFile, int version); 18 | extern u8 flashRead(u32 address); 19 | extern void flashWrite(u32 address, u8 byte); 20 | extern void flashDelayedWrite(u32 address, u8 byte); 21 | #ifdef __LIBRETRO__ 22 | extern uint8_t *flashSaveMemory; 23 | #else 24 | extern u8 flashSaveMemory[FLASH_128K_SZ]; 25 | #endif 26 | extern void flashSaveDecide(u32 address, u8 byte); 27 | extern void flashReset(); 28 | extern void flashSetSize(int size); 29 | extern void flashInit(); 30 | 31 | extern int flashSize; 32 | 33 | #endif // FLASH_H 34 | -------------------------------------------------------------------------------- /src/gba/GBAGfx.cpp: -------------------------------------------------------------------------------- 1 | #include "../System.h" 2 | 3 | int coeff[32] = { 4 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5 | 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}; 6 | 7 | u32 line0[240]; 8 | u32 line1[240]; 9 | u32 line2[240]; 10 | u32 line3[240]; 11 | u32 lineOBJ[240]; 12 | u32 lineOBJWin[240]; 13 | u32 lineMix[240]; 14 | bool gfxInWin0[240]; 15 | bool gfxInWin1[240]; 16 | int lineOBJpixleft[128]; 17 | 18 | int gfxBG2Changed = 0; 19 | int gfxBG3Changed = 0; 20 | 21 | int gfxBG2X = 0; 22 | int gfxBG2Y = 0; 23 | int gfxBG3X = 0; 24 | int gfxBG3Y = 0; 25 | int gfxLastVCOUNT = 0; 26 | -------------------------------------------------------------------------------- /src/gba/GBASockClient.cpp: -------------------------------------------------------------------------------- 1 | #ifndef NO_LINK 2 | 3 | #include "GBASockClient.h" 4 | 5 | // Currently only for Joybus communications 6 | 7 | GBASockClient::GBASockClient(sf::IPAddress _server_addr) 8 | { 9 | if (!_server_addr.IsValid()) 10 | server_addr = sf::IPAddress::LocalHost; 11 | else 12 | server_addr = _server_addr; 13 | 14 | client.Connect(0xd6ba, server_addr); 15 | //client.SetBlocking(false); 16 | } 17 | 18 | GBASockClient::~GBASockClient() 19 | { 20 | client.Close(); 21 | } 22 | 23 | void GBASockClient::Send(std::vector data) 24 | { 25 | char* plain_data = new char[data.size()]; 26 | std::copy(data.begin(), data.end(), plain_data); 27 | 28 | client.Send(plain_data, data.size()); 29 | 30 | delete[] plain_data; 31 | } 32 | 33 | // Returns cmd for convenience 34 | char GBASockClient::ReceiveCmd(char* data_in) 35 | { 36 | std::size_t num_received; 37 | client.Receive(data_in, 5, num_received); 38 | 39 | return data_in[0]; 40 | } 41 | 42 | #endif // NO_LINK 43 | -------------------------------------------------------------------------------- /src/gba/GBASockClient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "../common/Types.h" 5 | 6 | class GBASockClient : public sf::SocketTCP 7 | { 8 | public: 9 | GBASockClient(sf::IPAddress server_addr); 10 | ~GBASockClient(); 11 | 12 | void Send(std::vector data); 13 | char ReceiveCmd(char* data_in); 14 | 15 | private: 16 | sf::IPAddress server_addr; 17 | sf::SocketTCP client; 18 | }; 19 | -------------------------------------------------------------------------------- /src/gba/RTC.h: -------------------------------------------------------------------------------- 1 | #ifndef RTC_H 2 | #define RTC_H 3 | 4 | enum RTCSTATE 5 | { 6 | IDLE = 0, 7 | COMMAND, 8 | DATA, 9 | READDATA 10 | }; 11 | 12 | typedef struct { 13 | u8 byte0; 14 | u8 byte1; 15 | u8 byte2; 16 | u8 command; 17 | int dataLen; 18 | int bits; 19 | RTCSTATE state; 20 | u8 data[12]; 21 | // reserved variables for future 22 | u8 reserved[12]; 23 | bool reserved2; 24 | u32 reserved3; 25 | } RTCCLOCKDATA; 26 | 27 | u16 rtcRead(u32 address); 28 | bool rtcWrite(u32 address, u16 value); 29 | void rtcEnable(bool); 30 | bool rtcIsEnabled(); 31 | void rtcReset(); 32 | 33 | #define RTC_SERIAL_SIZE (sizeof(RTCCLOCKDATA)) 34 | 35 | void rtcSerialize(uint8_t *& data); 36 | void rtcDeserialize(const uint8_t *& data); 37 | 38 | #ifdef __LIBRETRO__ 39 | void rtcReadGame(const u8 *&data); 40 | void rtcSaveGame(u8 *&data); 41 | #else 42 | void rtcReadGame(gzFile gzFile); 43 | void rtcSaveGame(gzFile gzFile); 44 | #endif 45 | 46 | #endif // RTC_H 47 | -------------------------------------------------------------------------------- /src/gba/Sram.cpp: -------------------------------------------------------------------------------- 1 | #include "GBA.h" 2 | #include "Globals.h" 3 | #include "Flash.h" 4 | #include "Sram.h" 5 | 6 | u8 sramRead(u32 address) 7 | { 8 | return flashSaveMemory[address & 0xFFFF]; 9 | } 10 | void sramDelayedWrite(u32 address, u8 byte) 11 | { 12 | saveType = 1; 13 | cpuSaveGameFunc = sramWrite; 14 | sramWrite(address, byte); 15 | } 16 | 17 | void sramWrite(u32 address, u8 byte) 18 | { 19 | flashSaveMemory[address & 0xFFFF] = byte; 20 | systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; 21 | } 22 | -------------------------------------------------------------------------------- /src/gba/Sram.h: -------------------------------------------------------------------------------- 1 | #ifndef SRAM_H 2 | #define SRAM_H 3 | 4 | u8 sramRead(u32 address); 5 | void sramWrite(u32 address, u8 byte); 6 | void sramDelayedWrite(u32 address, u8 byte); 7 | 8 | #endif // SRAM_H 9 | -------------------------------------------------------------------------------- /src/gba/agbprint.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "GBA.h" 5 | #include "Globals.h" 6 | #include "../common/Port.h" 7 | #include "../System.h" 8 | 9 | #define debuggerWriteHalfWord(addr, value) \ 10 | WRITE16LE((u16*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask], (value)) 11 | 12 | #define debuggerReadHalfWord(addr) \ 13 | READ16LE(((u16*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask])) 14 | 15 | static bool agbPrintEnabled = false; 16 | static bool agbPrintProtect = false; 17 | 18 | bool agbPrintWrite(u32 address, u16 value) 19 | { 20 | if(agbPrintEnabled) { 21 | if(address == 0x9fe2ffe) { // protect 22 | agbPrintProtect = (value != 0); 23 | debuggerWriteHalfWord(address, value); 24 | return true; 25 | } else { 26 | if(agbPrintProtect && 27 | ((address >= 0x9fe20f8 && address <= 0x9fe20ff) // control structure 28 | || (address >= 0x8fd0000 && address <= 0x8fdffff) 29 | || (address >= 0x9fd0000 && address <= 0x9fdffff))) { 30 | debuggerWriteHalfWord(address, value); 31 | return true; 32 | } 33 | } 34 | } 35 | return false; 36 | } 37 | 38 | void agbPrintReset() 39 | { 40 | agbPrintProtect = false; 41 | } 42 | 43 | void agbPrintEnable(bool enable) 44 | { 45 | agbPrintEnabled = enable; 46 | } 47 | 48 | bool agbPrintIsEnabled() 49 | { 50 | return agbPrintEnabled; 51 | } 52 | 53 | void agbPrintFlush() 54 | { 55 | u16 get = debuggerReadHalfWord(0x9fe20fc); 56 | u16 put = debuggerReadHalfWord(0x9fe20fe); 57 | 58 | u32 address = (debuggerReadHalfWord(0x9fe20fa) << 16); 59 | if(address != 0xfd0000 && address != 0x1fd0000) { 60 | dbgOutput("Did you forget to call AGBPrintInit?\n", 0); 61 | // get rid of the text otherwise we will continue to be called 62 | debuggerWriteHalfWord(0x9fe20fc, put); 63 | return; 64 | } 65 | 66 | u8 *data = &rom[address]; 67 | 68 | while(get != put) { 69 | char c = data[get++]; 70 | char s[2]; 71 | s[0] = c; 72 | s[1] = 0; 73 | 74 | if(systemVerbose & VERBOSE_AGBPRINT) 75 | dbgOutput(s, 0); 76 | if(c == '\n') 77 | break; 78 | } 79 | debuggerWriteHalfWord(0x9fe20fc, get); 80 | } 81 | -------------------------------------------------------------------------------- /src/gba/agbprint.h: -------------------------------------------------------------------------------- 1 | #ifndef AGBPRINT_H 2 | #define AGBPRINT_H 3 | 4 | void agbPrintEnable(bool enable); 5 | bool agbPrintIsEnabled(); 6 | void agbPrintReset(); 7 | bool agbPrintWrite(u32 address, u16 value); 8 | void agbPrintFlush(); 9 | 10 | #endif // AGBPRINT_H 11 | -------------------------------------------------------------------------------- /src/gba/armdis.h: -------------------------------------------------------------------------------- 1 | /************************************************************************/ 2 | /* Arm/Thumb command set disassembler */ 3 | /************************************************************************/ 4 | 5 | #ifndef __ARMDIS_H__ 6 | #define __ARMDIS_H__ 7 | 8 | #define DIS_VIEW_ADDRESS 1 9 | #define DIS_VIEW_CODE 2 10 | 11 | int disThumb(u32 offset, char *dest, int flags); 12 | int disArm(u32 offset, char *dest, int flags); 13 | 14 | #endif // __ARMDIS_H__ 15 | -------------------------------------------------------------------------------- /src/gba/bios.h: -------------------------------------------------------------------------------- 1 | #ifndef BIOS_H 2 | #define BIOS_H 3 | 4 | extern void BIOS_ArcTan(); 5 | extern void BIOS_ArcTan2(); 6 | extern void BIOS_BitUnPack(); 7 | extern void BIOS_GetBiosChecksum(); 8 | extern void BIOS_BgAffineSet(); 9 | extern void BIOS_CpuSet(); 10 | extern void BIOS_CpuFastSet(); 11 | extern void BIOS_Diff8bitUnFilterWram(); 12 | extern void BIOS_Diff8bitUnFilterVram(); 13 | extern void BIOS_Diff16bitUnFilter(); 14 | extern void BIOS_Div(); 15 | extern void BIOS_DivARM(); 16 | extern void BIOS_HuffUnComp(); 17 | extern void BIOS_LZ77UnCompVram(); 18 | extern void BIOS_LZ77UnCompWram(); 19 | extern void BIOS_ObjAffineSet(); 20 | extern void BIOS_RegisterRamReset(); 21 | extern void BIOS_RegisterRamReset(u32); 22 | extern void BIOS_RLUnCompVram(); 23 | extern void BIOS_RLUnCompWram(); 24 | extern void BIOS_SoftReset(); 25 | extern void BIOS_Sqrt(); 26 | extern void BIOS_MidiKey2Freq(); 27 | extern void BIOS_SndDriverJmpTableCopy(); 28 | 29 | #endif // BIOS_H 30 | -------------------------------------------------------------------------------- /src/gba/gbafilter.h: -------------------------------------------------------------------------------- 1 | #include "../System.h" 2 | 3 | void gbafilter_pal(u16 * buf, int count); 4 | void gbafilter_pal32(u32 * buf, int count); 5 | void gbafilter_pad(u8 * buf, int count); 6 | -------------------------------------------------------------------------------- /src/gtk/cheatedit.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 2008 VBA-M development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef __VBA_CHEATEDIT_H__ 20 | #define __VBA_CHEATEDIT_H__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include "window.h" 29 | 30 | namespace VBA 31 | { 32 | 33 | enum ECheatType 34 | { 35 | CheatGeneric, 36 | CheatGSA, 37 | CheatCBA, 38 | CheatGS, 39 | CheatGG 40 | }; 41 | 42 | class EditCheatCodeColumns : public Gtk::TreeModel::ColumnRecord 43 | { 44 | public: 45 | EditCheatCodeColumns() 46 | { 47 | add(uText); 48 | add(iType); 49 | } 50 | 51 | ~EditCheatCodeColumns() {} 52 | 53 | Gtk::TreeModelColumn uText; 54 | Gtk::TreeModelColumn iType; 55 | }; 56 | 57 | class CheatEditDialog : public Gtk::Dialog 58 | { 59 | public: 60 | CheatEditDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder); 61 | Glib::RefPtr vGetCode(); 62 | Glib::ustring vGetDesc(); 63 | ECheatType vGetType(); 64 | void vSetWindow(VBA::Window * _poWindow); 65 | 66 | private: 67 | void vOnApply(); 68 | void vOnCancel(); 69 | 70 | VBA::Window * m_poWindow; 71 | 72 | Gtk::Entry * m_poCheatDescEntry; 73 | Gtk::ComboBox * m_poCheatTypeComboBox; 74 | Gtk::TextView * m_poCheatInputTextView; 75 | Gtk::Button * m_poCheatApplyButton; 76 | Gtk::Button * m_poCheatCancelButton; 77 | Glib::RefPtr m_poCheatInputBuffer; 78 | Glib::RefPtr m_poCheatTypeStore; 79 | EditCheatCodeColumns m_oTypeModel; 80 | }; 81 | 82 | } // namespace VBA 83 | 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /src/gtk/directoriesconfig.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 2008 VBA-M development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef __VBA_DIRECTORIESCONFIG_H__ 20 | #define __VBA_DIRECTORIESCONFIG_H__ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include "configfile.h" 28 | 29 | namespace VBA 30 | { 31 | 32 | class DirectoriesConfigDialog : public Gtk::Dialog 33 | { 34 | public: 35 | DirectoriesConfigDialog(Config::Section * _poConfig); 36 | 37 | protected: 38 | void on_response(int response_id); 39 | 40 | private: 41 | struct SDirEntry 42 | { 43 | const char * m_csKey; 44 | const char * m_csLabel; 45 | const char * m_csFileChooserButton; 46 | }; 47 | 48 | Config::Section * m_poConfig; 49 | static const SDirEntry m_astDirs[]; 50 | Gtk::FileChooserButton * m_poButtons[6]; 51 | }; 52 | 53 | } // namespace VBA 54 | 55 | 56 | #endif // __VBA_DIRECTORIESCONFIG_H__ 57 | -------------------------------------------------------------------------------- /src/gtk/displayconfig.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 2008 VBA-M development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef __VBA_DISPLAYCONFIG_H__ 20 | #define __VBA_DISPLAYCONFIG_H__ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "configfile.h" 27 | #include "window.h" 28 | 29 | namespace VBA 30 | { 31 | 32 | class DisplayConfigDialog : public Gtk::Dialog 33 | { 34 | public: 35 | DisplayConfigDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder); 36 | 37 | void vSetConfig(Config::Section * _poConfig, VBA::Window * _poWindow); 38 | 39 | private: 40 | void vOnFilterChanged(); 41 | void vOnFilterIBChanged(); 42 | void vOnOutputChanged(VBA::Window::EVideoOutput _eOutput); 43 | void vOnScaleChanged(); 44 | 45 | VBA::Window * m_poWindow; 46 | 47 | Config::Section * m_poConfig; 48 | Gtk::ComboBox * m_poFiltersComboBox; 49 | Gtk::ComboBox * m_poIBFiltersComboBox; 50 | Gtk::ComboBox * m_poDefaultScaleComboBox; 51 | Gtk::RadioButton * m_poOutputOpenGLRadioButton; 52 | Gtk::RadioButton * m_poOutputCairoRadioButton; 53 | }; 54 | 55 | } // namespace VBA 56 | 57 | 58 | #endif // __VBA_DISPLAYCONFIG_H__ 59 | -------------------------------------------------------------------------------- /src/gtk/filters.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | #ifndef __VBA_FILTERS_H__ 21 | #define __VBA_FILTERS_H__ 22 | 23 | #include "../System.h" 24 | 25 | int Init_2xSaI(u32); 26 | 27 | namespace VBA 28 | { 29 | 30 | typedef void (*Filter)(u8 *, u32, u8 *, u8 *, u32, int, int); 31 | typedef void (*FilterIB)(u8 *, u32, int, int); 32 | 33 | enum EFilter 34 | { 35 | FirstFilter, 36 | FilterNone = FirstFilter, 37 | Filter2xSaI, 38 | FilterSuper2xSaI, 39 | FilterSuperEagle, 40 | FilterPixelate, 41 | FilterAdMame2x, 42 | FilterBilinear, 43 | FilterBilinearPlus, 44 | FilterScanlines, 45 | FilterScanlinesTV, 46 | FilterHq2x, 47 | FilterLq2x, 48 | LastFilter = FilterLq2x 49 | }; 50 | 51 | enum EFilterIB 52 | { 53 | FirstFilterIB, 54 | FilterIBNone = FirstFilterIB, 55 | FilterIBSmart, 56 | FilterIBMotionBlur, 57 | LastFilterIB = FilterIBMotionBlur 58 | }; 59 | 60 | enum EFilterDepth 61 | { 62 | FilterDepth16, 63 | FilterDepth32 64 | }; 65 | 66 | Filter pvGetFilter(EFilter _eFilter, EFilterDepth _eDepth); 67 | const char* pcsGetFilterName(const EFilter _eFilter); 68 | 69 | FilterIB pvGetFilterIB(EFilterIB _eFilterIB, EFilterDepth _eDepth); 70 | const char* pcsGetFilterIBName(const EFilterIB _eFilterIB); 71 | 72 | } // namespace VBA 73 | 74 | 75 | #endif // __VBA_FILTERS_H__ 76 | -------------------------------------------------------------------------------- /src/gtk/gameboyadvancecheatlist.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 2008 VBA-M development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef __VBA_GAMEBOYADVANCECHEATLIST_H__ 20 | #define __VBA_GAMEBOYADVANCECHEATLIST_H__ 21 | 22 | #include "../System.h" 23 | #include "../gba/Cheats.h" 24 | #include "../gba/GBA.h" 25 | #include "../gba/Globals.h" 26 | #include "cheatlist.h" 27 | 28 | namespace VBA 29 | { 30 | 31 | class GameBoyAdvanceCheatListDialog : public CheatListDialog 32 | { 33 | public: 34 | GameBoyAdvanceCheatListDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder); 35 | 36 | protected: 37 | void vAddCheat(Glib::ustring sDesc, ECheatType type, Glib::RefPtr buffer); 38 | bool vCheatListOpen(const char *file); 39 | void vCheatListSave(const char *file); 40 | void vRemoveCheat(int index); 41 | void vRemoveAllCheats(); 42 | void vToggleCheat(int index, bool enable); 43 | void vUpdateList(int previous = 0); 44 | }; 45 | 46 | } // namespace VBA 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/gtk/gameboyadvanceconfig.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 2008 VBA-M development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef __VBA_GAMEBOYADVANCECONFIG_H__ 20 | #define __VBA_GAMEBOYADVANCECONFIG_H__ 21 | 22 | #include 23 | #include 24 | 25 | #include "configfile.h" 26 | #include "window.h" 27 | 28 | namespace VBA 29 | { 30 | 31 | class GameBoyAdvanceConfigDialog : public Gtk::Dialog 32 | { 33 | public: 34 | GameBoyAdvanceConfigDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder); 35 | 36 | void vSetConfig(Config::Section * _poConfig, VBA::Window * _poWindow); 37 | 38 | private: 39 | void vOnSaveTypeChanged(); 40 | void vOnFlashSizeChanged(); 41 | void vOnUseBiosChanged(); 42 | void vOnBiosSelectionChanged(); 43 | void vOnEnableRTCChanged(); 44 | 45 | VBA::Window * m_poWindow; 46 | 47 | Config::Section * m_poConfig; 48 | Gtk::ComboBox * m_poSaveTypeComboBox; 49 | Gtk::ComboBox * m_poFlashSizeComboBox; 50 | Gtk::CheckButton * m_poBiosCheckButton; 51 | Gtk::FileChooserButton * m_poBiosFileChooserButton; 52 | Gtk::CheckButton * m_poRTCCheckButton; 53 | }; 54 | 55 | } // namespace VBA 56 | 57 | 58 | #endif // __VBA_GAMEBOYADVANCECONFIG_H__ 59 | -------------------------------------------------------------------------------- /src/gtk/gameboycheatlist.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 2008 VBA-M development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef __VBA_GAMEBOYCHEATLIST_H__ 20 | #define __VBA_GAMEBOYCHEATLIST_H__ 21 | 22 | #include "../gb/gbCheats.h" 23 | #include "cheatlist.h" 24 | 25 | namespace VBA 26 | { 27 | 28 | class GameBoyCheatListDialog : public CheatListDialog 29 | { 30 | public: 31 | GameBoyCheatListDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder); 32 | 33 | protected: 34 | void vAddCheat(Glib::ustring sDesc, ECheatType type, Glib::RefPtr buffer); 35 | bool vCheatListOpen(const char *file); 36 | void vCheatListSave(const char *file); 37 | void vRemoveCheat(int index); 38 | void vRemoveAllCheats(); 39 | void vToggleCheat(int index, bool enable); 40 | void vUpdateList(int previous = 0); 41 | }; 42 | 43 | } // namespace VBA 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/gtk/gameboyconfig.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 2008 VBA-M development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef __VBA_GAMEBOYCONFIG_H__ 20 | #define __VBA_GAMEBOYCONFIG_H__ 21 | 22 | #include 23 | #include 24 | 25 | #include "configfile.h" 26 | #include "window.h" 27 | 28 | namespace VBA 29 | { 30 | 31 | class GameBoyConfigDialog : public Gtk::Dialog 32 | { 33 | public: 34 | GameBoyConfigDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder); 35 | 36 | void vSetConfig(Config::Section * _poConfig, VBA::Window * _poWindow); 37 | 38 | private: 39 | void vOnSystemChanged(); 40 | void vOnBorderChanged(); 41 | void vOnPrinterChanged(); 42 | void vOnUseBootRomChanged(); 43 | void vOnBootRomSelectionChanged(); 44 | 45 | VBA::Window * m_poWindow; 46 | 47 | Config::Section * m_poConfig; 48 | Gtk::ComboBox * m_poSystemComboBox; 49 | Gtk::CheckButton * m_poBorderCheckButton; 50 | Gtk::CheckButton * m_poPrinterCheckButton; 51 | Gtk::CheckButton * m_poBootRomCheckButton; 52 | Gtk::FileChooserButton * m_poBootRomFileChooserButton; 53 | }; 54 | 55 | } // namespace VBA 56 | 57 | 58 | #endif // __VBA_GAMEBOYCONFIG_H__ 59 | -------------------------------------------------------------------------------- /src/gtk/generalconfig.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 2008 VBA-M development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef __VBA_GENERALCONFIG_H__ 20 | #define __VBA_GENERALCONFIG_H__ 21 | 22 | #include 23 | 24 | #include "configfile.h" 25 | #include "window.h" 26 | 27 | namespace VBA 28 | { 29 | 30 | class PreferencesDialog : public Gtk::Dialog 31 | { 32 | public: 33 | PreferencesDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder); 34 | 35 | void vSetConfig(Config::Section * _poConfig, VBA::Window * _poWindow); 36 | 37 | private: 38 | void vOnPauseWhenInactiveChanged(); 39 | void vOnFrameskipChanged(); 40 | void vOnSpeedIndicatorChanged(); 41 | 42 | 43 | VBA::Window * m_poWindow; 44 | 45 | Config::Section * m_poConfig; 46 | Gtk::CheckButton * m_poPauseWhenInactiveCheckButton; 47 | Gtk::CheckButton * m_poFrameSkipAutomaticCheckButton; 48 | Gtk::SpinButton * m_poFrameSkipLevelSpinButton; 49 | Gtk::ComboBox * m_poSpeedIndicatorComboBox; 50 | 51 | }; 52 | 53 | } // namespace VBA 54 | 55 | 56 | #endif // __VBA_GENERALCONFIG_H__ 57 | -------------------------------------------------------------------------------- /src/gtk/gvbam.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Name=VBA-M 5 | GenericName=GameBoy Advance Emulator 6 | Comment=Nindendo GameBoy Advance Emulator 7 | Exec=gvbam %f 8 | Icon=vbam 9 | Categories=Game;Emulator;GTK; 10 | MimeType=application/x-gameboy-rom;application/x-gameboy-advance-rom;application/x-dmg-rom;application/x-agb-rom;application/x-gb-rom;application/x-gba-rom; 11 | -------------------------------------------------------------------------------- /src/gtk/intl.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | #ifndef __VBA_INTL_H__ 21 | #define __VBA_INTL_H__ 22 | 23 | #ifdef ENABLE_NLS 24 | # include 25 | #else 26 | # define _(String) (String) 27 | # define N_(String) (String) 28 | # define textdomain(String) (String) 29 | # define gettext(String) (String) 30 | # define dgettext(Domain,String) (String) 31 | # define dcgettext(Domain,String,Type) (String) 32 | # define bindtextdomain(Domain,Directory) (Domain) 33 | #endif 34 | 35 | 36 | #endif // __VBA_INTL_H__ 37 | -------------------------------------------------------------------------------- /src/gtk/screenarea-cairo.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | #ifndef __VBA_SCREENAREA_CAIRO_H__ 21 | #define __VBA_SCREENAREA_CAIRO_H__ 22 | 23 | #include "screenarea.h" 24 | 25 | namespace VBA 26 | { 27 | 28 | class ScreenAreaCairo : public ScreenArea 29 | { 30 | public: 31 | ScreenAreaCairo(int _iWidth, int _iHeight, int _iScale = 1); 32 | void vDrawPixels(u8 * _puiData); 33 | void vDrawBlackScreen(); 34 | 35 | protected: 36 | bool on_expose_event(GdkEventExpose * _pstEvent); 37 | void vOnWidgetResize(); 38 | 39 | private: 40 | double m_dScaleFactor; 41 | int m_iAreaTop; 42 | int m_iAreaLeft; 43 | }; 44 | 45 | } // namespace VBA 46 | 47 | 48 | #endif // __VBA_SCREENAREA_CAIRO_H__ 49 | -------------------------------------------------------------------------------- /src/gtk/screenarea-opengl.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | #ifndef __VBA_SCREENAREA_OPENGL_H__ 21 | #define __VBA_SCREENAREA_OPENGL_H__ 22 | 23 | #include "screenarea.h" 24 | #include 25 | 26 | namespace VBA 27 | { 28 | 29 | class ScreenAreaGl : public ScreenArea, 30 | public Gtk::GL::Widget 31 | { 32 | public: 33 | ScreenAreaGl(int _iWidth, int _iHeight, int _iScale = 1); 34 | void vDrawPixels(u8 * _puiData); 35 | void vDrawBlackScreen(); 36 | 37 | protected: 38 | void on_realize(); 39 | bool on_expose_event(GdkEventExpose * _pstEvent); 40 | void vOnWidgetResize(); 41 | 42 | private: 43 | GLuint m_uiScreenTexture; 44 | int m_iTextureSize; 45 | 46 | void vUpdateTexture(); 47 | void vOnSizeUpdated(); 48 | }; 49 | 50 | } // namespace VBA 51 | 52 | 53 | #endif // __VBA_SCREENAREA_OPENGL_H__ 54 | -------------------------------------------------------------------------------- /src/gtk/soundconfig.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 2008 VBA-M development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef __VBA_SOUNDCONFIG_H__ 20 | #define __VBA_SOUNDCONFIG_H__ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include "configfile.h" 27 | #include "window.h" 28 | 29 | namespace VBA 30 | { 31 | 32 | class SoundConfigDialog : public Gtk::Dialog 33 | { 34 | public: 35 | SoundConfigDialog(GtkDialog* _pstDialog, const Glib::RefPtr& refBuilder); 36 | 37 | void vSetConfig(Config::Section * _poConfig, VBA::Window * _poWindow); 38 | 39 | private: 40 | void vOnVolumeChanged(); 41 | void vOnRateChanged(); 42 | 43 | VBA::Window * m_poWindow; 44 | 45 | Config::Section * m_poConfig; 46 | Gtk::ComboBox * m_poVolumeComboBox; 47 | Gtk::ComboBox * m_poRateComboBox; 48 | }; 49 | 50 | } // namespace VBA 51 | 52 | 53 | #endif // __VBA_SOUNDCONFIG_H__ 54 | -------------------------------------------------------------------------------- /src/gtk/tools.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | #ifndef __VBA_TOOLS_H__ 21 | #define __VBA_TOOLS_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace VBA 28 | { 29 | 30 | std::string sCutSuffix(const std::string & _rsString, 31 | const std::string & _rsSep = "."); 32 | 33 | Glib::ustring sCutSuffix(const Glib::ustring & _rsString, 34 | const Glib::ustring & _rsSep = "."); 35 | 36 | bool bHasSuffix(const Glib::ustring & _rsString, 37 | const Glib::ustring & _rsSuffix, 38 | bool _bCaseSensitive = true); 39 | 40 | void vTokenize(Glib::ustring source, std::vector& tokens); 41 | 42 | } 43 | 44 | 45 | #endif // __VBA_TOOLS_H__ 46 | -------------------------------------------------------------------------------- /src/libretro/Makefile: -------------------------------------------------------------------------------- 1 | TILED_RENDERING = 0 2 | 3 | ifeq ($(platform),) 4 | platform = unix 5 | ifeq ($(shell uname -a),) 6 | platform = win 7 | else ifneq ($(findstring MINGW,$(shell uname -a)),) 8 | platform = win 9 | else ifneq ($(findstring win,$(shell uname -a)),) 10 | platform = win 11 | else ifneq ($(findstring Darwin,$(shell uname -a)),) 12 | platform = osx 13 | endif 14 | endif 15 | 16 | TARGET_NAME = vbam 17 | 18 | ifeq ($(platform), unix) 19 | TARGET := $(TARGET_NAME)_libretro.so 20 | fpic := -fPIC 21 | SHARED := -shared 22 | TILED_RENDERING = 1 23 | else ifeq ($(platform), osx) 24 | TARGET := $(TARGET_NAME)_libretro.dylib 25 | fpic := -fPIC 26 | SHARED := -dynamiclib 27 | else 28 | TARGET := $(TARGET_NAME)_libretro.dll 29 | LDFLAGS += -Wl,-no-undefined -Wl,--version-script=link.T 30 | CC = gcc 31 | CXX = g++ 32 | SHARED := -shared -static-libgcc -static-libstdc++ 33 | endif 34 | 35 | ifeq ($(TILED_RENDERING), 1) 36 | VBA_DEFINES += -DTILED_RENDERING 37 | endif 38 | 39 | VBA_DIR := ../ 40 | 41 | VBA_SRC_DIRS := $(VBA_DIR)/gba $(VBA_DIR)/apu 42 | 43 | VBA_CXXSRCS := $(foreach dir,$(VBA_SRC_DIRS),$(wildcard $(dir)/*.cpp)) 44 | VBA_CXXOBJ := $(VBA_CXXSRCS:.cpp=.o) ../common/Patch.o 45 | VBA_CSRCS := $(foreach dir,$(VBA_SRC_DIRS),$(wildcard $(dir)/*.c)) 46 | VBA_COBJ := $(VBA_CSRCS:.c=.o) 47 | UTIL_SOURCES := $(wildcard ../common/utils/zlib/*.c) 48 | UTIL_OBJS := $(UTIL_SOURCES:.c=.o) 49 | 50 | OBJS := $(VBA_COBJ) $(VBA_CXXOBJ) $(UTIL_OBJS) libretro.o UtilRetro.o SoundRetro.o scrc32.o 51 | 52 | VBA_DEFINES += -D__LIBRETRO__ -DFINAL_VERSION -DC_CORE -DUSE_GBA_ONLY -DNO_LINK 53 | VBA_DEFINES += -DFRONTEND_SUPPORTS_RGB565 54 | 55 | CFLAGS += -O3 -std=gnu99 $(fpic) $(VBA_DEFINES) -I../common/utils/zlib 56 | CXXFLAGS += -O3 $(fpic) $(VBA_DEFINES) -I../common/utils/zlib 57 | 58 | 59 | INCDIRS := -I$(VBA_DIR) 60 | LIBS := 61 | 62 | $(TARGET): $(OBJS) 63 | $(CXX) -o $@ $(SHARED) $(OBJS) $(LDFLAGS) $(LIBS) 64 | 65 | %.o: %.cpp 66 | $(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS) 67 | 68 | %.o: %.c 69 | $(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) 70 | 71 | clean: 72 | rm -f $(OBJS) 73 | rm -f $(TARGET) 74 | 75 | .PHONY: clean 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/libretro/SoundRetro.cpp: -------------------------------------------------------------------------------- 1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 2 | // Copyright (C) 2008 VBA-M development team 3 | 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2, or(at your option) 7 | // any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software Foundation, 16 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | #include "libretro.h" 19 | #include "SoundRetro.h" 20 | unsigned g_audio_frames; 21 | extern retro_audio_sample_batch_t audio_batch_cb; 22 | 23 | SoundRetro::SoundRetro() 24 | { 25 | } 26 | 27 | void SoundRetro::write(u16 * finalWave, int length) 28 | { 29 | const int16_t* wave = (const int16_t*)finalWave; 30 | int frames = length >> 1; 31 | audio_batch_cb(wave, frames); 32 | 33 | g_audio_frames += frames; 34 | } 35 | 36 | 37 | bool SoundRetro::init(long sampleRate) 38 | { 39 | g_audio_frames = 0; 40 | 41 | return true; 42 | } 43 | 44 | SoundRetro::~SoundRetro() 45 | { 46 | } 47 | 48 | void SoundRetro::pause() 49 | { 50 | } 51 | 52 | void SoundRetro::resume() 53 | { 54 | } 55 | 56 | void SoundRetro::reset() 57 | { 58 | } 59 | -------------------------------------------------------------------------------- /src/libretro/SoundRetro.h: -------------------------------------------------------------------------------- 1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 2 | // Copyright (C) 2008 VBA-M development team 3 | 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2, or(at your option) 7 | // any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software Foundation, 16 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | #ifndef __VBA_SOUND_RETRO_H__ 19 | #define __VBA_SOUND_RETRO_H__ 20 | 21 | #include "../common/SoundDriver.h" 22 | 23 | class SoundRetro: public SoundDriver 24 | { 25 | public: 26 | SoundRetro(); 27 | virtual ~SoundRetro(); 28 | 29 | virtual bool init(long sampleRate); 30 | virtual void pause(); 31 | virtual void reset(); 32 | virtual void resume(); 33 | virtual void write(u16 * finalWave, int length); 34 | }; 35 | 36 | #endif // __VBA_SOUND_RETRO_H__ 37 | -------------------------------------------------------------------------------- /src/libretro/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | ifeq ($(TARGET_ARCH),arm) 6 | LOCAL_CFLAGS += -DANDROID_ARM 7 | LOCAL_ARM_MODE := arm 8 | endif 9 | 10 | ifeq ($(TARGET_ARCH),x86) 11 | LOCAL_CFLAGS += -DANDROID_X86 12 | endif 13 | 14 | ifeq ($(TARGET_ARCH),mips) 15 | LOCAL_CFLAGS += -DANDROID_MIPS 16 | endif 17 | 18 | VBADIR = ../../ 19 | 20 | LOCAL_MODULE := libretro 21 | LOCAL_SRC_FILES = $(VBADIR)/gba/agbprint.cpp \ 22 | $(VBADIR)/gba/armdis.cpp \ 23 | $(VBADIR)/gba/bios.cpp \ 24 | $(VBADIR)/gba/Cheats.cpp \ 25 | $(VBADIR)/gba/CheatSearch.cpp \ 26 | $(VBADIR)/gba/EEprom.cpp \ 27 | $(VBADIR)/gba/elf.cpp \ 28 | $(VBADIR)/gba/Flash.cpp \ 29 | $(VBADIR)/gba/GBA-arm.cpp \ 30 | $(VBADIR)/gba/GBA.cpp \ 31 | $(VBADIR)/gba/gbafilter.cpp \ 32 | $(VBADIR)/gba/GBAGfx.cpp \ 33 | $(VBADIR)/gba/GBALink.cpp \ 34 | $(VBADIR)/gba/GBASockClient.cpp \ 35 | $(VBADIR)/gba/GBA-thumb.cpp \ 36 | $(VBADIR)/gba/Globals.cpp \ 37 | $(VBADIR)/gba/Mode0.cpp \ 38 | $(VBADIR)/gba/Mode1.cpp \ 39 | $(VBADIR)/gba/Mode2.cpp \ 40 | $(VBADIR)/gba/Mode3.cpp \ 41 | $(VBADIR)/gba/Mode4.cpp \ 42 | $(VBADIR)/gba/Mode5.cpp \ 43 | $(VBADIR)/gba/remote.cpp \ 44 | $(VBADIR)/gba/RTC.cpp \ 45 | $(VBADIR)/gba/Sound.cpp \ 46 | $(VBADIR)/gba/Sram.cpp \ 47 | $(VBADIR)/apu/Blip_Buffer.cpp \ 48 | $(VBADIR)/apu/Effects_Buffer.cpp \ 49 | $(VBADIR)/apu/Gb_Apu.cpp \ 50 | $(VBADIR)/apu/Gb_Apu_State.cpp \ 51 | $(VBADIR)/apu/Gb_Oscs.cpp \ 52 | $(VBADIR)/apu/Multi_Buffer.cpp \ 53 | $(VBADIR)/libretro/libretro.cpp \ 54 | $(VBADIR)/libretro/UtilRetro.cpp \ 55 | $(VBADIR)/libretro/SoundRetro.cpp \ 56 | $(VBADIR)/libretro/scrc32.cpp 57 | 58 | LOCAL_CFLAGS = -O3 -DINLINE=inline -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DLSB_FIRST -D__LIBRETRO__ -DFINAL_VERSION -DC_CORE -DUSE_GBA_ONLY -DNO_LINK -DFRONTEND_SUPPORTS_RGB565 -DTILED_RENDERING 59 | LOCAL_C_INCLUDES = $(VBADIR) 60 | 61 | include $(BUILD_SHARED_LIBRARY) 62 | -------------------------------------------------------------------------------- /src/libretro/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | -------------------------------------------------------------------------------- /src/libretro/link.T: -------------------------------------------------------------------------------- 1 | { 2 | global: retro_*; 3 | local: *; 4 | }; 5 | -------------------------------------------------------------------------------- /src/libretro/msvc/msvc-2003-xbox1.bat: -------------------------------------------------------------------------------- 1 | @SET VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE 2 | @SET VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio .NET 2003 3 | @SET FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework 4 | @SET FrameworkVersion=v1.1.4322 5 | @SET FrameworkSDKDir=C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1 6 | @rem Root of Visual Studio common files. 7 | 8 | @if "%VSINSTALLDIR%"=="" goto Usage 9 | @if "%VCINSTALLDIR%"=="" set VCINSTALLDIR=%VSINSTALLDIR% 10 | 11 | @rem 12 | @rem Root of Visual Studio ide installed files. 13 | @rem 14 | @set DevEnvDir=%VSINSTALLDIR% 15 | 16 | @rem 17 | @rem Root of Visual C++ installed files. 18 | @rem 19 | @set MSVCDir=%VCINSTALLDIR%\VC7 20 | 21 | @rem 22 | @echo Setting environment for using Microsoft Visual Studio .NET 2003 tools. 23 | @echo (If you have another version of Visual Studio or Visual C++ installed and wish 24 | @echo to use its tools from the command line, run vcvars32.bat for that version.) 25 | @rem 26 | 27 | @REM %VCINSTALLDIR%\Common7\Tools dir is added only for real setup. 28 | 29 | @set PATH=%DevEnvDir%;%MSVCDir%\BIN;%VCINSTALLDIR%\Common7\Tools;%VCINSTALLDIR%\Common7\Tools\bin\prerelease;%VCINSTALLDIR%\Common7\Tools\bin;%FrameworkSDKDir%\bin;%FrameworkDir%\%FrameworkVersion%;%PATH%; 30 | @set INCLUDE=%MSVCDir%\ATLMFC\INCLUDE;%MSVCDir%\INCLUDE;%FrameworkSDKDir%\include;%INCLUDE%;%XDK%\xbox\include 31 | @set LIB=%MSVCDir%\ATLMFC\LIB;%MSVCDir%\LIB;%MSVCDir%\PlatformSDK\lib;%XDK%\lib;%XDK%\xbox\lib;%LIB% 32 | 33 | @goto end 34 | 35 | :Usage 36 | 37 | @echo. VSINSTALLDIR variable is not set. 38 | @echo. 39 | @echo SYNTAX: %0 40 | 41 | @goto end 42 | 43 | :end 44 | 45 | devenv /clean Release msvc-2003-xbox1.sln 46 | devenv /build Release msvc-2003-xbox1.sln 47 | exit 48 | -------------------------------------------------------------------------------- /src/libretro/msvc/msvc-2003-xbox1.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vbanext-msvc2003-xbox1", "msvc-2003-xbox1/msvc-2003-xbox1.vcproj", "{BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Profile = Profile 10 | Profile_FastCap = Profile_FastCap 11 | Release = Release 12 | Release_LTCG = Release_LTCG 13 | EndGlobalSection 14 | GlobalSection(ProjectConfiguration) = postSolution 15 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Debug.ActiveCfg = Debug|Xbox 16 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Debug.Build.0 = Debug|Xbox 17 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Profile.ActiveCfg = Profile|Xbox 18 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Profile.Build.0 = Profile|Xbox 19 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Profile_FastCap.ActiveCfg = Profile_FastCap|Xbox 20 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Profile_FastCap.Build.0 = Profile_FastCap|Xbox 21 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Release.ActiveCfg = Release|Xbox 22 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Release.Build.0 = Release|Xbox 23 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Release_LTCG.ActiveCfg = Release_LTCG|Xbox 24 | {BDCB70E0-EEBB-404A-9874-9A2E22A4A2B3}.Release_LTCG.Build.0 = Release_LTCG|Xbox 25 | EndGlobalSection 26 | GlobalSection(ExtensibilityGlobals) = postSolution 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityAddIns) = postSolution 29 | EndGlobalSection 30 | EndGlobal 31 | -------------------------------------------------------------------------------- /src/libretro/msvc/msvc-2010-360.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mvc-2010-360", "msvc-2010-360/msvc-2010-360.vcxproj", "{DB17AF79-EB79-4062-ACA8-F82864712DA0}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | CodeAnalysis|Xbox 360 = CodeAnalysis|Xbox 360 9 | Debug|Xbox 360 = Debug|Xbox 360 10 | Profile_FastCap|Xbox 360 = Profile_FastCap|Xbox 360 11 | Profile|Xbox 360 = Profile|Xbox 360 12 | Release_LTCG|Xbox 360 = Release_LTCG|Xbox 360 13 | Release|Xbox 360 = Release|Xbox 360 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.CodeAnalysis|Xbox 360.ActiveCfg = CodeAnalysis|Xbox 360 17 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.CodeAnalysis|Xbox 360.Build.0 = CodeAnalysis|Xbox 360 18 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 19 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 20 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Profile_FastCap|Xbox 360.ActiveCfg = Profile_FastCap|Xbox 360 21 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Profile_FastCap|Xbox 360.Build.0 = Profile_FastCap|Xbox 360 22 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Profile|Xbox 360.ActiveCfg = Profile|Xbox 360 23 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Profile|Xbox 360.Build.0 = Profile|Xbox 360 24 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Release_LTCG|Xbox 360.ActiveCfg = Release_LTCG|Xbox 360 25 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Release_LTCG|Xbox 360.Build.0 = Release_LTCG|Xbox 360 26 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 27 | {DB17AF79-EB79-4062-ACA8-F82864712DA0}.Release|Xbox 360.Build.0 = Release|Xbox 360 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /src/libretro/msvc/msvc-2010-360/msvc-2010-360.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {d19de43b-0337-4673-9b9e-1892d348647d} 14 | 15 | 16 | {becd444c-3df5-4a9e-9885-8a181058095d} 17 | 18 | 19 | 20 | 21 | Header Files\libretro 22 | 23 | 24 | Header Files 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | 49 | 50 | Source Files\libretro 51 | 52 | 53 | Source Files 54 | 55 | 56 | Source Files 57 | 58 | 59 | Source Files 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/libretro/msvc/msvc-2010.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msvc-2010", "msvc-2010/msvc-2010.vcxproj", "{C461207F-8F4F-4BFB-A90D-25298F37B47D}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {C461207F-8F4F-4BFB-A90D-25298F37B47D}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {C461207F-8F4F-4BFB-A90D-25298F37B47D}.Debug|Win32.Build.0 = Debug|Win32 14 | {C461207F-8F4F-4BFB-A90D-25298F37B47D}.Release|Win32.ActiveCfg = Release|Win32 15 | {C461207F-8F4F-4BFB-A90D-25298F37B47D}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /src/libretro/msvc/msvc-2010/libretro.def: -------------------------------------------------------------------------------- 1 | LIBRARY "libretro-prboom msvc2010" 2 | EXPORTS 3 | retro_set_environment 4 | retro_set_video_refresh 5 | retro_set_audio_sample 6 | retro_set_audio_sample_batch 7 | retro_set_input_poll 8 | retro_set_input_state 9 | retro_init 10 | retro_deinit 11 | retro_api_version 12 | retro_get_system_info 13 | retro_get_system_av_info 14 | retro_set_controller_port_device 15 | retro_reset 16 | retro_run 17 | retro_serialize_size 18 | retro_serialize 19 | retro_unserialize 20 | retro_cheat_reset 21 | retro_cheat_set 22 | retro_load_game 23 | retro_load_game_special 24 | retro_unload_game 25 | retro_get_region 26 | retro_get_memory_data 27 | retro_get_memory_size 28 | -------------------------------------------------------------------------------- /src/sdl/debugger.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | extern void debuggerMain(); 21 | extern void debuggerOutput(const char *, u32); 22 | extern void debuggerSignal(int,int); 23 | -------------------------------------------------------------------------------- /src/sdl/expr.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "expr.cpp.h" 3 | 4 | #ifndef __GNUC__ 5 | #include 6 | #define isatty _isatty 7 | #define fileno _fileno 8 | #endif 9 | 10 | char *exprString; 11 | int exprCol; 12 | 13 | #define YY_INPUT(buf,result,max_size) \ 14 | { \ 15 | int c = *exprString++; \ 16 | exprCol++;\ 17 | result = (c == 0) ? YY_NULL : (buf[0] = c, 1); \ 18 | } 19 | %} 20 | 21 | %option nomain 22 | %option noyywrap 23 | %option nounput 24 | 25 | SIZEOF "sizeof" 26 | ID [a-zA-Z_][a-zA-Z0-9_]* 27 | NUM [0-9]+ 28 | DOT "." 29 | ARROW "->" 30 | STAR "*" 31 | ADDR "&" 32 | 33 | %% 34 | 35 | {SIZEOF} { 36 | return TOKEN_SIZEOF; 37 | } 38 | 39 | {ID} { 40 | return TOKEN_IDENTIFIER; 41 | } 42 | 43 | {NUM} { 44 | return TOKEN_NUMBER; 45 | } 46 | 47 | {DOT} { 48 | return TOKEN_DOT; 49 | } 50 | 51 | {ARROW} { 52 | return TOKEN_ARROW; 53 | } 54 | 55 | {ADDR} { 56 | return TOKEN_ADDR; 57 | } 58 | 59 | {STAR} { 60 | return TOKEN_STAR; 61 | } 62 | 63 | [ \t\n]+ 64 | 65 | . return *yytext; 66 | 67 | %% 68 | 69 | void exprCleanBuffer() 70 | { 71 | yy_delete_buffer(YY_CURRENT_BUFFER); 72 | yy_init = 1; 73 | } 74 | -------------------------------------------------------------------------------- /src/sdl/expr.ypp: -------------------------------------------------------------------------------- 1 | %{ 2 | namespace std { 3 | #include 4 | #include 5 | #include 6 | #include 7 | } 8 | 9 | using namespace std; 10 | 11 | #include "../System.h" 12 | #include "../gba/elf.h" 13 | #include "exprNode.h" 14 | 15 | extern int yyerror(const char *); 16 | extern int yylex(); 17 | extern char *yytext; 18 | 19 | 20 | //#define YYERROR_VERBOSE 1 21 | //#define YYDEBUG 1 22 | 23 | Node *result = NULL; 24 | %} 25 | 26 | %token TOKEN_IDENTIFIER TOKEN_DOT TOKEN_STAR TOKEN_ARROW TOKEN_ADDR 27 | %token TOKEN_SIZEOF TOKEN_NUMBER 28 | %left TOKEN_DOT TOKEN_ARROW '[' 29 | %expect 6 30 | %% 31 | 32 | final: expression { result = $1; } 33 | ; 34 | 35 | expression: 36 | simple_expression { $$ = $1; } | 37 | '(' expression ')' { $$ = $2; } | 38 | expression TOKEN_DOT ident { $$ = exprNodeDot($1, $3); } | 39 | expression TOKEN_ARROW ident { $$ = exprNodeArrow($1, $3); } | 40 | expression '[' number ']' { $$ = exprNodeArray($1, $3); } 41 | ; 42 | simple_expression: 43 | ident { $$ = $1; } | 44 | TOKEN_STAR expression { $$ = exprNodeStar($2); } | 45 | TOKEN_ADDR expression { $$ = exprNodeAddr($2); } | 46 | TOKEN_SIZEOF '(' expression ')' { $$ = exprNodeSizeof($3); } 47 | ; 48 | 49 | number: 50 | TOKEN_NUMBER { $$ = exprNodeNumber(); } 51 | ; 52 | 53 | ident: 54 | TOKEN_IDENTIFIER {$$ = exprNodeIdentifier(); } 55 | ; 56 | 57 | %% 58 | 59 | int yyerror(const char *s) 60 | { 61 | return 0; 62 | } 63 | 64 | #ifndef SDL 65 | extern FILE *yyin; 66 | int main(int argc, char **argv) 67 | { 68 | // yydebug = 1; 69 | ++argv, --argc; 70 | if(argc > 0) 71 | yyin = fopen(argv[0], "r"); 72 | else 73 | yyin = stdin; 74 | if(!yyparse()) 75 | result->print(); 76 | } 77 | #endif 78 | -------------------------------------------------------------------------------- /src/sdl/filters.h: -------------------------------------------------------------------------------- 1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 2 | // Copyright (C) 1999-2003 Forgotten 3 | // Copyright (C) 2004-2008 Forgotten and the VBA development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #ifndef VBA_SDL_FILTERS_H 20 | #define VBA_SDL_FILTERS_H 21 | 22 | #include "../System.h" 23 | 24 | // 25 | // Screen filters 26 | // 27 | 28 | // List of available filters 29 | enum Filter { kStretch1x, kStretch2x, k2xSaI, kSuper2xSaI, kSuperEagle, kPixelate, 30 | kAdMame2x, kBilinear, kBilinearPlus, kScanlines, kScanlinesTV, 31 | klq2x, khq2x, kStretch3x, khq3x, kStretch4x, khq4x, kInvalidFilter }; 32 | 33 | // Function pointer type for a filter function 34 | typedef void(*FilterFunc)(u8*, u32, u8*, u8*, u32, int, int); 35 | 36 | // Initialize a filter and get the corresponding filter function pointer 37 | FilterFunc initFilter(const Filter f, const int colorDepth, const int srcWidth); 38 | 39 | // Get the enlarge factor of a filter 40 | int getFilterEnlargeFactor(const Filter f); 41 | 42 | // Get the display name for a filter 43 | char* getFilterName(const Filter f); 44 | 45 | // 46 | // Interframe filters 47 | // 48 | 49 | // List of available IFB filters 50 | enum IFBFilter { kIFBNone, kIBMotionBlur, kIBSmart, kInvalidIFBFilter }; 51 | 52 | // Function pointer type for an IFB filter function 53 | typedef void(*IFBFilterFunc)(u8*, u32, int, int); 54 | 55 | // Initialize an IFB filter and get the corresponding filter function pointer 56 | IFBFilterFunc initIFBFilter(const IFBFilter f, const int colorDepth); 57 | 58 | // Get the display name for an IFB filter 59 | char* getIFBFilterName(const IFBFilter f); 60 | 61 | #endif // VBA_SDL_FILTERS_H 62 | -------------------------------------------------------------------------------- /src/sdl/text.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | extern void drawText(u8 *, int, int, int, const char *, bool); 21 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | #define VBA_NAME "VisualBoyAdvance-M" 21 | 22 | #ifdef WIN32 23 | #include "svnrev.h" 24 | #else 25 | #ifdef SVN_REV 26 | #define SVN_REV_STR SVN_REV 27 | #else 28 | #define SVN_REV_STR "" 29 | #endif 30 | #endif 31 | 32 | #define VBA_FEATURE_STRING "" 33 | 34 | #ifdef DEBUG 35 | #define VBA_SUBVERSION_STRING " debug" 36 | #elif defined(PUBLIC_RELEASE) 37 | #define VBA_SUBVERSION_STRING "" 38 | #else 39 | #define VBA_SUBVERSION_STRING " (SVN" SVN_REV_STR ")" 40 | #endif 41 | 42 | #if defined(_MSC_VER) 43 | #define VBA_COMPILER "" 44 | #define VBA_COMPILER_DETAIL " msvc " _Py_STRINGIZE(_MSC_VER) 45 | #define _Py_STRINGIZE(X) _Py_STRINGIZE1((X)) 46 | #define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X 47 | #define _Py_STRINGIZE2(X) #X 48 | //re: http://72.14.203.104/search?q=cache:HG-okth5NGkJ:mail.python.org/pipermail/python-checkins/2002-November/030704.html+_msc_ver+compiler+version+string&hl=en&gl=us&ct=clnk&cd=5 49 | #else 50 | // TODO: make for others compilers 51 | #define VBA_COMPILER "" 52 | #define VBA_COMPILER_DETAIL "" 53 | #endif 54 | 55 | #define VBA_VERSION_STRING " " "1.8.0" VBA_SUBVERSION_STRING VBA_FEATURE_STRING VBA_COMPILER 56 | #define VBA_NAME_AND_VERSION " " VBA_NAME VBA_VERSION_STRING 57 | #define VBA_NAME_AND_SUBVERSION " " VBA_NAME VBA_SUBVERSION_STRING 58 | -------------------------------------------------------------------------------- /src/win32/AVIWrite.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | // info: recreate the whole AVIWrite object if any method fails 5 | class AVIWrite 6 | { 7 | public: 8 | AVIWrite(); 9 | virtual ~AVIWrite(); 10 | 11 | bool CreateAVIFile( LPCTSTR filename ); 12 | bool CreateVideoStream( LONG imageWidth, LONG imageHeight, WORD colorBits, DWORD framesPerSecond, HWND parentWnd ); 13 | bool CreateAudioStream( WORD channelCount, DWORD sampleRate, WORD sampleBits, HWND parentWnd ); 14 | bool AddVideoFrame( LPVOID imageData ); 15 | bool AddAudioFrame( LPVOID soundData ); 16 | 17 | private: 18 | bool m_failed; 19 | PAVIFILE m_file; 20 | PAVISTREAM m_videoStream; 21 | PAVISTREAM m_audioStream; 22 | AVICOMPRESSOPTIONS m_videoCompSettings; 23 | AVICOMPRESSOPTIONS m_audioCompSettings; 24 | PAVISTREAM m_videoCompressed; 25 | PAVISTREAM m_audioCompressed; 26 | DWORD m_frameRate; 27 | LONG m_frameCounter; 28 | LONG m_sampleCounter; 29 | LONG m_videoFrameSize; 30 | LONG m_audioFrameSize; 31 | WORD m_audioBlockAlign; 32 | }; 33 | -------------------------------------------------------------------------------- /src/win32/AboutDialog.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "AboutDialog.h" 3 | #include "../AutoBuild.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #undef THIS_FILE 8 | static char THIS_FILE[] = __FILE__; 9 | #endif 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // AboutDialog dialog 13 | 14 | 15 | AboutDialog::AboutDialog(CWnd* pParent /*=NULL*/) 16 | : CDialog(AboutDialog::IDD, pParent) 17 | { 18 | m_version = _T(VBA_VERSION_STRING); 19 | m_date = _T(__DATE__); 20 | } 21 | 22 | 23 | void AboutDialog::DoDataExchange(CDataExchange* pDX) 24 | { 25 | CDialog::DoDataExchange(pDX); 26 | //{{AFX_DATA_MAP(AboutDialog) 27 | DDX_Text(pDX, IDC_VERSION, m_version); 28 | DDX_Control(pDX, IDC_URL, m_link); 29 | //}}AFX_DATA_MAP 30 | DDX_Text(pDX, IDC_DATE, m_date); 31 | } 32 | 33 | 34 | BEGIN_MESSAGE_MAP(AboutDialog, CDialog) 35 | //{{AFX_MSG_MAP(AboutDialog) 36 | //}}AFX_MSG_MAP 37 | END_MESSAGE_MAP() 38 | 39 | ///////////////////////////////////////////////////////////////////////////// 40 | // AboutDialog message handlers 41 | 42 | BOOL AboutDialog::OnInitDialog() 43 | { 44 | CDialog::OnInitDialog(); 45 | 46 | CWnd *p = GetDlgItem(IDC_TRANSLATOR_URL); 47 | if(p) { 48 | m_translator.SubclassDlgItem(IDC_TRANSLATOR_URL, this); 49 | } 50 | 51 | m_link.SetWindowText("http://vba-m.com"); 52 | 53 | return TRUE; // return TRUE unless you set the focus to a control 54 | // EXCEPTION: OCX Property Pages should return FALSE 55 | } 56 | -------------------------------------------------------------------------------- /src/win32/AboutDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "Hyperlink.h" 5 | #include "resource.h" 6 | 7 | 8 | class AboutDialog : public CDialog 9 | { 10 | public: 11 | AboutDialog(CWnd* pParent = NULL); 12 | enum { IDD = IDD_ABOUT }; 13 | 14 | protected: 15 | virtual void DoDataExchange(CDataExchange* pDX); 16 | virtual BOOL OnInitDialog(); 17 | DECLARE_MESSAGE_MAP() 18 | 19 | private: 20 | Hyperlink m_link; 21 | Hyperlink m_translator; 22 | CString m_version; 23 | CString m_date; 24 | }; 25 | -------------------------------------------------------------------------------- /src/win32/AccelEditor.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_ACCELEDITOR_H__66F5C854_E28E_40D1_B763_1850374B46A2__INCLUDED_) 2 | #define AFX_ACCELEDITOR_H__66F5C854_E28E_40D1_B763_1850374B46A2__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // AccelEditor.h : header file 8 | // 9 | #include "AcceleratorManager.h" 10 | #include "KeyboardEdit.h" 11 | #include "ResizeDlg.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // AccelEditor dialog 15 | 16 | class AccelEditor : public ResizeDlg 17 | { 18 | // Construction 19 | public: 20 | CAcceleratorManager mgr; 21 | void InitCommands(); 22 | AccelEditor(CWnd* pParent = NULL); // standard constructor 23 | 24 | // Dialog Data 25 | //{{AFX_DATA(AccelEditor) 26 | enum { IDD = IDD_ACCEL_EDITOR }; 27 | CListBox m_currents; 28 | CStatic m_alreadyAffected; 29 | CListBox m_commands; 30 | CKeyboardEdit m_key; 31 | //}}AFX_DATA 32 | 33 | 34 | // Overrides 35 | // ClassWizard generated virtual function overrides 36 | //{{AFX_VIRTUAL(AccelEditor) 37 | protected: 38 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 39 | //}}AFX_VIRTUAL 40 | 41 | // Implementation 42 | protected: 43 | 44 | // Generated message map functions 45 | //{{AFX_MSG(AccelEditor) 46 | virtual BOOL OnInitDialog(); 47 | afx_msg void OnCancel(); 48 | afx_msg void OnOk(); 49 | afx_msg void OnSelchangeCommands(); 50 | afx_msg void OnReset(); 51 | afx_msg void OnAssign(); 52 | afx_msg void OnRemove(); 53 | //}}AFX_MSG 54 | DECLARE_MESSAGE_MAP() 55 | }; 56 | 57 | //{{AFX_INSERT_LOCATION}} 58 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 59 | 60 | #endif // !defined(AFX_ACCELEDITOR_H__66F5C854_E28E_40D1_B763_1850374B46A2__INCLUDED_) 61 | -------------------------------------------------------------------------------- /src/win32/Associate.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_ASSOCIATE_H__3326525B_B405_40A7_82C4_B2594669A930__INCLUDED_) 2 | #define AFX_ASSOCIATE_H__3326525B_B405_40A7_82C4_B2594669A930__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // Associate.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Associate dialog 12 | 13 | class Associate : public CDialog 14 | { 15 | // Construction 16 | public: 17 | Associate(CWnd* pParent = NULL); // standard constructor 18 | 19 | // Dialog Data 20 | //{{AFX_DATA(Associate) 21 | enum { IDD = IDD_ASSOCIATIONS }; 22 | BOOL m_agb; 23 | BOOL m_bin; 24 | BOOL m_cgb; 25 | BOOL m_dmg; 26 | BOOL m_gb; 27 | BOOL m_gba; 28 | BOOL m_gbc; 29 | BOOL m_sgb; 30 | //}}AFX_DATA 31 | 32 | 33 | // Overrides 34 | // ClassWizard generated virtual function overrides 35 | //{{AFX_VIRTUAL(Associate) 36 | protected: 37 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 38 | //}}AFX_VIRTUAL 39 | 40 | // Implementation 41 | protected: 42 | 43 | // Generated message map functions 44 | //{{AFX_MSG(Associate) 45 | virtual BOOL OnInitDialog(); 46 | afx_msg void OnCancel(); 47 | afx_msg void OnOk(); 48 | //}}AFX_MSG 49 | DECLARE_MESSAGE_MAP() 50 | }; 51 | 52 | //{{AFX_INSERT_LOCATION}} 53 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 54 | 55 | #endif // !defined(AFX_ASSOCIATE_H__3326525B_B405_40A7_82C4_B2594669A930__INCLUDED_) 56 | -------------------------------------------------------------------------------- /src/win32/AudioCoreSettingsDlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // AudioCoreSettingsDlg dialog 4 | 5 | class AudioCoreSettingsDlg : public CDialog 6 | { 7 | DECLARE_DYNAMIC(AudioCoreSettingsDlg) 8 | 9 | public: 10 | bool m_enabled; 11 | bool m_surround; 12 | bool m_declicking; 13 | bool m_sound_interpolation; 14 | float m_echo; 15 | float m_stereo; 16 | float m_volume; 17 | float m_sound_filtering; 18 | unsigned int m_sample_rate; 19 | 20 | AudioCoreSettingsDlg(CWnd* pParent = NULL); // standard constructor 21 | virtual ~AudioCoreSettingsDlg(); 22 | 23 | virtual BOOL OnInitDialog(); 24 | virtual BOOL PreTranslateMessage(MSG* pMsg); 25 | afx_msg void OnBnClickedDefaultVolume(); 26 | 27 | // Dialog Data 28 | enum { IDD = IDD_AUDIO_CORE_SETTINGS }; 29 | 30 | protected: 31 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 32 | afx_msg BOOL OnTtnNeedText(UINT id, NMHDR *pNMHDR, LRESULT *pResult); // Retrieve text for ToolTip 33 | 34 | DECLARE_MESSAGE_MAP() 35 | 36 | private: 37 | CButton enhance_sound; 38 | CButton surround; 39 | CButton declicking; 40 | CButton sound_interpolation; 41 | CSliderCtrl echo; 42 | CSliderCtrl stereo; 43 | CSliderCtrl volume; 44 | CSliderCtrl sound_filtering; 45 | CToolTipCtrl *toolTip; 46 | CComboBox sample_rate; 47 | }; 48 | -------------------------------------------------------------------------------- /src/win32/BIOSDialog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | // BIOSDialog dialog 5 | 6 | class BIOSDialog : public CDialog 7 | { 8 | DECLARE_DYNAMIC(BIOSDialog) 9 | 10 | public: 11 | BIOSDialog(CWnd* pParent = NULL); // standard constructor 12 | virtual ~BIOSDialog(); 13 | 14 | // Dialog Data 15 | enum { IDD = IDD_BIOS }; 16 | 17 | protected: 18 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 19 | 20 | DECLARE_MESSAGE_MAP() 21 | private: 22 | CEdit m_editGB; 23 | CEdit m_editGBC; 24 | CEdit m_editGBA; 25 | bool fileExists(CString& file); 26 | afx_msg void OnBnClickedSelectGbBiosPath(); 27 | afx_msg void OnBnClickedSelectGbcBiosPath(); 28 | afx_msg void OnBnClickedSelectGbaBiosPath(); 29 | public: 30 | BOOL m_enableBIOS_GB; 31 | BOOL m_enableBIOS_GBC; 32 | BOOL m_enableBIOS_GBA; 33 | BOOL m_skipLogo; 34 | CString m_pathGB; 35 | CString m_pathGBC; 36 | CString m_pathGBA; 37 | }; 38 | -------------------------------------------------------------------------------- /src/win32/BitmapControl.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_BITMAPCONTROL_H__2434AADB_B6A5_4E43_AA16_7B65B6F7FA26__INCLUDED_) 2 | #define AFX_BITMAPCONTROL_H__2434AADB_B6A5_4E43_AA16_7B65B6F7FA26__INCLUDED_ 3 | 4 | #include "../System.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // BitmapControl.h : header file 9 | // 10 | #ifndef WM_MAPINFO 11 | #define WM_MAPINFO WM_APP+101 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // BitmapControl view 16 | 17 | class BitmapControl : public CScrollView 18 | { 19 | public: 20 | BitmapControl(); // protected constructor used by dynamic creation 21 | protected: 22 | DECLARE_DYNCREATE(BitmapControl) 23 | 24 | // Attributes 25 | public: 26 | 27 | // Operations 28 | public: 29 | void setStretch(bool b); 30 | void refresh(); 31 | void setSize(int w1, int h1); 32 | void setData(u8 *d); 33 | void setBmpInfo(BITMAPINFO *info); 34 | static bool isRegistered; 35 | 36 | // Overrides 37 | // ClassWizard generated virtual function overrides 38 | //{{AFX_VIRTUAL(BitmapControl) 39 | protected: 40 | virtual void OnDraw(CDC* pDC); // overridden to draw this view 41 | virtual void OnInitialUpdate(); // first time after construct 42 | virtual void PostNcDestroy(); 43 | //}}AFX_VIRTUAL 44 | 45 | // Implementation 46 | public: 47 | bool getStretch(); 48 | virtual ~BitmapControl(); 49 | protected: 50 | #ifdef _DEBUG 51 | virtual void AssertValid() const; 52 | virtual void Dump(CDumpContext& dc) const; 53 | #endif 54 | 55 | // Generated message map functions 56 | //{{AFX_MSG(BitmapControl) 57 | afx_msg BOOL OnEraseBkgnd(CDC* pDC); 58 | afx_msg void OnSize(UINT nType, int cx, int cy); 59 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 60 | //}}AFX_MSG 61 | DECLARE_MESSAGE_MAP() 62 | private: 63 | void registerClass(); 64 | bool stretch; 65 | u8 colors[3*64]; 66 | BITMAPINFO *bmpInfo; 67 | u8 * data; 68 | int h; 69 | int w; 70 | }; 71 | 72 | ///////////////////////////////////////////////////////////////////////////// 73 | 74 | //{{AFX_INSERT_LOCATION}} 75 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 76 | 77 | #endif // !defined(AFX_BITMAPCONTROL_H__2434AADB_B6A5_4E43_AA16_7B65B6F7FA26__INCLUDED_) 78 | -------------------------------------------------------------------------------- /src/win32/BugReport.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 | 20 | #if !defined(AFX_BUGREPORT_H__DE7BC381_E45D_4200_910C_E5378E6364C9__INCLUDED_) 21 | #define AFX_BUGREPORT_H__DE7BC381_E45D_4200_910C_E5378E6364C9__INCLUDED_ 22 | 23 | #if _MSC_VER > 1000 24 | #pragma once 25 | #endif // _MSC_VER > 1000 26 | // BugReport.h : header file 27 | // 28 | 29 | ///////////////////////////////////////////////////////////////////////////// 30 | // BugReport dialog 31 | 32 | class BugReport : public CDialog 33 | { 34 | // Construction 35 | public: 36 | BugReport(CWnd* pParent = NULL); // standard constructor 37 | 38 | // Dialog Data 39 | //{{AFX_DATA(BugReport) 40 | enum { IDD = IDD_BUG_REPORT }; 41 | CEdit m_report; 42 | //}}AFX_DATA 43 | 44 | 45 | // Overrides 46 | // ClassWizard generated virtual function overrides 47 | //{{AFX_VIRTUAL(BugReport) 48 | protected: 49 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 50 | //}}AFX_VIRTUAL 51 | 52 | // Implementation 53 | protected: 54 | CString createReport(); 55 | 56 | // Generated message map functions 57 | //{{AFX_MSG(BugReport) 58 | afx_msg void OnCopy(); 59 | afx_msg void OnOk(); 60 | virtual BOOL OnInitDialog(); 61 | //}}AFX_MSG 62 | DECLARE_MESSAGE_MAP() 63 | }; 64 | 65 | //{{AFX_INSERT_LOCATION}} 66 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 67 | 68 | #endif // !defined(AFX_BUGREPORT_H__DE7BC381_E45D_4200_910C_E5378E6364C9__INCLUDED_) 69 | -------------------------------------------------------------------------------- /src/win32/ColorButton.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_COLORBUTTON_H__DF02109B_B91C_49FD_954F_74A48B83C314__INCLUDED_) 2 | #define AFX_COLORBUTTON_H__DF02109B_B91C_49FD_954F_74A48B83C314__INCLUDED_ 3 | 4 | #include "../System.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // ColorButton.h : header file 9 | // 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // ColorButton window 13 | 14 | class ColorButton : public CButton 15 | { 16 | // Construction 17 | public: 18 | ColorButton(); 19 | 20 | // Attributes 21 | public: 22 | // Operations 23 | static bool isRegistered; 24 | public: 25 | void PreSubclassWindow(); 26 | void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); 27 | 28 | // Overrides 29 | // ClassWizard generated virtual function overrides 30 | //{{AFX_VIRTUAL(ColorButton) 31 | //}}AFX_VIRTUAL 32 | 33 | // Implementation 34 | public: 35 | void setColor(u16 c); 36 | u16 color; 37 | virtual ~ColorButton(); 38 | 39 | void registerClass(); 40 | 41 | // Generated message map functions 42 | protected: 43 | //{{AFX_MSG(ColorButton) 44 | // NOTE - the ClassWizard will add and remove member functions here. 45 | //}}AFX_MSG 46 | 47 | DECLARE_MESSAGE_MAP() 48 | }; 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | 52 | //{{AFX_INSERT_LOCATION}} 53 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 54 | 55 | #endif // !defined(AFX_COLORBUTTON_H__DF02109B_B91C_49FD_954F_74A48B83C314__INCLUDED_) 56 | -------------------------------------------------------------------------------- /src/win32/ColorControl.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "vba.h" 3 | #include "ColorControl.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #undef THIS_FILE 8 | static char THIS_FILE[] = __FILE__; 9 | #endif 10 | 11 | bool ColorControl::isRegistered = false; 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // ColorControl 15 | 16 | ColorControl::ColorControl() 17 | { 18 | color = 0; 19 | registerClass(); 20 | } 21 | 22 | ColorControl::~ColorControl() 23 | { 24 | } 25 | 26 | 27 | BEGIN_MESSAGE_MAP(ColorControl, CWnd) 28 | //{{AFX_MSG_MAP(ColorControl) 29 | ON_WM_PAINT() 30 | ON_WM_ERASEBKGND() 31 | //}}AFX_MSG_MAP 32 | END_MESSAGE_MAP() 33 | 34 | 35 | ///////////////////////////////////////////////////////////////////////////// 36 | // ColorControl message handlers 37 | 38 | void ColorControl::OnPaint() 39 | { 40 | CPaintDC dc(this); // device context for painting 41 | } 42 | 43 | BOOL ColorControl::OnEraseBkgnd(CDC* pDC) 44 | { 45 | int r = (color & 0x1f) << 3; 46 | int g = (color & 0x3e0) >> 2; 47 | int b = (color & 0x7c00) >> 7; 48 | 49 | CBrush br; 50 | br.CreateSolidBrush(RGB(r,g,b)); 51 | 52 | RECT rect; 53 | GetClientRect(&rect); 54 | pDC->FillRect(&rect,&br); 55 | pDC->DrawEdge(&rect, EDGE_SUNKEN, BF_RECT); 56 | br.DeleteObject(); 57 | return TRUE; 58 | } 59 | 60 | void ColorControl::setColor(u16 c) 61 | { 62 | color = c; 63 | Invalidate(); 64 | } 65 | 66 | void ColorControl::registerClass() 67 | { 68 | if(!isRegistered) { 69 | WNDCLASS wc; 70 | ZeroMemory(&wc, sizeof(wc)); 71 | wc.style = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS; 72 | wc.lpfnWndProc = (WNDPROC)::DefWindowProc; 73 | wc.hInstance = AfxGetInstanceHandle(); 74 | wc.hIcon = NULL; 75 | wc.hCursor = LoadCursor(NULL, IDC_ARROW); 76 | wc.hbrBackground = (HBRUSH )GetStockObject(BLACK_BRUSH); 77 | wc.lpszMenuName = NULL; 78 | wc.lpszClassName = "VbaColorControl"; 79 | AfxRegisterClass(&wc); 80 | isRegistered = true; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/win32/ColorControl.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_COLORCONTROL_H__747E1E47_DDFA_4D67_B337_A473F2BACB86__INCLUDED_) 2 | #define AFX_COLORCONTROL_H__747E1E47_DDFA_4D67_B337_A473F2BACB86__INCLUDED_ 3 | 4 | #include "../System.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // ColorControl.h : header file 9 | // 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // ColorControl window 13 | 14 | class ColorControl : public CWnd 15 | { 16 | // Construction 17 | public: 18 | ColorControl(); 19 | 20 | // Attributes 21 | public: 22 | // Operations 23 | static bool isRegistered; 24 | 25 | // Operations 26 | public: 27 | 28 | // Overrides 29 | // ClassWizard generated virtual function overrides 30 | //{{AFX_VIRTUAL(ColorControl) 31 | //}}AFX_VIRTUAL 32 | 33 | // Implementation 34 | public: 35 | void setColor(u16 c); 36 | u16 color; 37 | virtual ~ColorControl(); 38 | 39 | // Generated message map functions 40 | protected: 41 | //{{AFX_MSG(ColorControl) 42 | afx_msg void OnPaint(); 43 | afx_msg BOOL OnEraseBkgnd(CDC* pDC); 44 | //}}AFX_MSG 45 | DECLARE_MESSAGE_MAP() 46 | private: 47 | void registerClass(); 48 | }; 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | 52 | //{{AFX_INSERT_LOCATION}} 53 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 54 | 55 | #endif // !defined(AFX_COLORCONTROL_H__747E1E47_DDFA_4D67_B337_A473F2BACB86__INCLUDED_) 56 | -------------------------------------------------------------------------------- /src/win32/Directories.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | class Directories : public CDialog 5 | { 6 | public: 7 | Directories(CWnd* pParent = NULL); 8 | enum { IDD = IDD_DIRECTORIES }; 9 | 10 | protected: 11 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 12 | virtual BOOL OnInitDialog(); 13 | afx_msg void OnBatteryDir(); 14 | afx_msg void OnCaptureDir(); 15 | afx_msg void OnGbromDir(); 16 | afx_msg void OnGbcromDir(); 17 | afx_msg void OnRomDir(); 18 | afx_msg void OnSaveDir(); 19 | virtual void OnCancel(); 20 | virtual void OnOK(); 21 | DECLARE_MESSAGE_MAP() 22 | 23 | private: 24 | CEdit m_savePath; 25 | CEdit m_romPath; 26 | CEdit m_gbcromPath; 27 | CEdit m_gbromPath; 28 | CEdit m_capturePath; 29 | CEdit m_batteryPath; 30 | CString initialFolderDir; 31 | 32 | CString browseForDir(CString title); 33 | bool directoryDoesExist(const char *directory); 34 | }; 35 | -------------------------------------------------------------------------------- /src/win32/Disassemble.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_DISASSEMBLE_H__CA10E857_7D76_4B19_A62B_D0677040FD0F__INCLUDED_) 2 | #define AFX_DISASSEMBLE_H__CA10E857_7D76_4B19_A62B_D0677040FD0F__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // Disassemble.h : header file 8 | // 9 | 10 | #include "IUpdate.h" 11 | #include "ResizeDlg.h" 12 | #include "../System.h" // Added by ClassView 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // Disassemble dialog 16 | 17 | class Disassemble : public ResizeDlg, IUpdateListener 18 | { 19 | // Construction 20 | public: 21 | virtual void update(); 22 | void refresh(); 23 | int count; 24 | bool autoUpdate; 25 | u32 address; 26 | Disassemble(CWnd* pParent = NULL); // standard constructor 27 | 28 | // Dialog Data 29 | //{{AFX_DATA(Disassemble) 30 | enum { IDD = IDD_DISASSEMBLE }; 31 | CEdit m_address; 32 | CListBox m_list; 33 | BOOL m_c; 34 | BOOL m_f; 35 | BOOL m_i; 36 | BOOL m_n; 37 | BOOL m_t; 38 | BOOL m_v; 39 | BOOL m_z; 40 | int mode; 41 | //}}AFX_DATA 42 | 43 | 44 | // Overrides 45 | // ClassWizard generated virtual function overrides 46 | //{{AFX_VIRTUAL(Disassemble) 47 | protected: 48 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 49 | virtual void PostNcDestroy(); 50 | //}}AFX_VIRTUAL 51 | 52 | // Implementation 53 | protected: 54 | 55 | // Generated message map functions 56 | //{{AFX_MSG(Disassemble) 57 | afx_msg void OnAutoUpdate(); 58 | afx_msg void OnAutomatic(); 59 | afx_msg void OnArm(); 60 | afx_msg void OnClose(); 61 | afx_msg void OnGo(); 62 | afx_msg void OnGopc(); 63 | afx_msg void OnNext(); 64 | afx_msg void OnRefresh(); 65 | afx_msg void OnThumb(); 66 | virtual BOOL OnInitDialog(); 67 | afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 68 | //}}AFX_MSG 69 | DECLARE_MESSAGE_MAP() 70 | }; 71 | 72 | //{{AFX_INSERT_LOCATION}} 73 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 74 | 75 | #endif // !defined(AFX_DISASSEMBLE_H__CA10E857_7D76_4B19_A62B_D0677040FD0F__INCLUDED_) 76 | -------------------------------------------------------------------------------- /src/win32/ExportGSASnapshot.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_EXPORTGSASNAPSHOT_H__ADF8566A_C64D_43CF_9CD2_A290370BA4F1__INCLUDED_) 2 | #define AFX_EXPORTGSASNAPSHOT_H__ADF8566A_C64D_43CF_9CD2_A290370BA4F1__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // ExportGSASnapshot.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // ExportGSASnapshot dialog 12 | 13 | class ExportGSASnapshot : public CDialog 14 | { 15 | // Construction 16 | public: 17 | ExportGSASnapshot(CString filename, CString title,CWnd* pParent = NULL); // standard constructor 18 | 19 | // Dialog Data 20 | //{{AFX_DATA(ExportGSASnapshot) 21 | enum { IDD = IDD_EXPORT_SPS }; 22 | CString m_desc; 23 | CString m_notes; 24 | CString m_title; 25 | //}}AFX_DATA 26 | CString m_filename; 27 | 28 | 29 | // Overrides 30 | // ClassWizard generated virtual function overrides 31 | //{{AFX_VIRTUAL(ExportGSASnapshot) 32 | protected: 33 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 34 | //}}AFX_VIRTUAL 35 | 36 | // Implementation 37 | protected: 38 | 39 | // Generated message map functions 40 | //{{AFX_MSG(ExportGSASnapshot) 41 | virtual BOOL OnInitDialog(); 42 | afx_msg void OnCancel(); 43 | afx_msg void OnOk(); 44 | //}}AFX_MSG 45 | DECLARE_MESSAGE_MAP() 46 | }; 47 | 48 | //{{AFX_INSERT_LOCATION}} 49 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 50 | 51 | #endif // !defined(AFX_EXPORTGSASNAPSHOT_H__ADF8566A_C64D_43CF_9CD2_A290370BA4F1__INCLUDED_) 52 | -------------------------------------------------------------------------------- /src/win32/FileDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_FILEDLG_H__7E4F8B92_1B63_4126_8261_D9334C645940__INCLUDED_) 2 | #define AFX_FILEDLG_H__7E4F8B92_1B63_4126_8261_D9334C645940__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // FileDlg.h : header file 8 | // 9 | 10 | struct OPENFILENAMEEX : public OPENFILENAME { 11 | void * pvReserved; 12 | DWORD dwReserved; 13 | DWORD FlagsEx; 14 | }; 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // FileDlg dialog 18 | 19 | class FileDlg 20 | { 21 | private: 22 | CString m_file; 23 | CString m_filter; 24 | public: 25 | OPENFILENAMEEX m_ofn; 26 | int DoModal(); 27 | LPCTSTR GetPathName(); 28 | virtual int getFilterIndex(); 29 | virtual void OnTypeChange(HWND hwnd); 30 | FileDlg(CWnd *parent, LPCTSTR file, LPCTSTR filter, 31 | int filterIndex, LPCTSTR ext, LPCTSTR *exts, LPCTSTR initialDir, 32 | LPCTSTR title, bool save); 33 | virtual ~FileDlg(); 34 | 35 | protected: 36 | bool isSave; 37 | LPCTSTR *extensions; 38 | 39 | protected: 40 | //{{AFX_INSERT_LOCATION}} 41 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 42 | }; 43 | 44 | #endif // !defined(AFX_FILEDLG_H__7E4F8B92_1B63_4126_8261_D9334C645940__INCLUDED_) 45 | -------------------------------------------------------------------------------- /src/win32/FullscreenSettings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Display.h" 4 | 5 | 6 | #ifndef NO_D3D 7 | #pragma comment( lib, "d3d9" ) 8 | #ifdef _DEBUG 9 | #define D3D_DEBUG_INFO 10 | #endif 11 | #define DIRECT3D_VERSION 0x0900 12 | #include 13 | #endif 14 | 15 | 16 | // FullscreenSettings dialog 17 | 18 | class FullscreenSettings : public CDialog 19 | { 20 | DECLARE_DYNAMIC(FullscreenSettings) 21 | 22 | public: 23 | FullscreenSettings(CWnd* pParent = NULL); // standard constructor 24 | virtual ~FullscreenSettings(); 25 | 26 | // Dialog Data 27 | enum { IDD = IDD_FULLSCREEN }; 28 | 29 | // Call this function to select the API for the display mode enumeration. 30 | void setAPI( DISPLAY_TYPE type ); 31 | afx_msg void OnCbnSelchangeComboDevice(); 32 | afx_msg void OnCbnSelchangeComboColorDepth(); 33 | afx_msg void OnCbnSelchangeComboResolution(); 34 | 35 | unsigned int m_device; 36 | unsigned int m_colorDepth; 37 | unsigned int m_width; 38 | unsigned int m_height; 39 | unsigned int m_refreshRate; 40 | 41 | protected: 42 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 43 | virtual void OnOK(); 44 | 45 | DECLARE_MESSAGE_MAP() 46 | 47 | private: 48 | DISPLAY_TYPE api; 49 | bool failed; 50 | 51 | #ifndef NO_D3D 52 | LPDIRECT3D9 pD3D; 53 | #endif 54 | 55 | virtual BOOL OnInitDialog(); 56 | 57 | CComboBox combo_device; 58 | CComboBox combo_resolution; 59 | CComboBox combo_color_depth; 60 | CComboBox combo_refresh_rate; 61 | }; 62 | -------------------------------------------------------------------------------- /src/win32/GBColorDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_GBCOLORDLG_H__8D6126EF_06BB_48CF_ABB3_2CC4B1B60358__INCLUDED_) 2 | #define AFX_GBCOLORDLG_H__8D6126EF_06BB_48CF_ABB3_2CC4B1B60358__INCLUDED_ 3 | 4 | #include "ColorButton.h" // Added by ClassView 5 | #include "../System.h" // Added by ClassView 6 | #if _MSC_VER > 1000 7 | #pragma once 8 | #endif // _MSC_VER > 1000 9 | // GBColorDlg.h : header file 10 | // 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // GBColorDlg dialog 14 | 15 | class GBColorDlg : public CDialog 16 | { 17 | // Construction 18 | public: 19 | int getWhich(); 20 | afx_msg void OnColorClicked(UINT id); 21 | u16 * getColors(); 22 | void setWhich(int w); 23 | u16 colors[24]; 24 | ColorButton colorControls[8]; 25 | GBColorDlg(CWnd* pParent = NULL); // standard constructor 26 | 27 | // Dialog Data 28 | //{{AFX_DATA(GBColorDlg) 29 | enum { IDD = IDD_GB_COLORS }; 30 | CComboBox m_predefined; 31 | int which; 32 | //}}AFX_DATA 33 | 34 | 35 | // Overrides 36 | // ClassWizard generated virtual function overrides 37 | //{{AFX_VIRTUAL(GBColorDlg) 38 | protected: 39 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 40 | //}}AFX_VIRTUAL 41 | 42 | // Implementation 43 | protected: 44 | 45 | // Generated message map functions 46 | //{{AFX_MSG(GBColorDlg) 47 | afx_msg void OnDefault(); 48 | afx_msg void OnReset(); 49 | afx_msg void OnUser1(); 50 | afx_msg void OnUser2(); 51 | afx_msg void OnCancel(); 52 | afx_msg void OnOk(); 53 | virtual BOOL OnInitDialog(); 54 | afx_msg void OnSelchangePredefined(); 55 | //}}AFX_MSG 56 | DECLARE_MESSAGE_MAP() 57 | }; 58 | 59 | //{{AFX_INSERT_LOCATION}} 60 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 61 | 62 | #endif // !defined(AFX_GBCOLORDLG_H__8D6126EF_06BB_48CF_ABB3_2CC4B1B60358__INCLUDED_) 63 | -------------------------------------------------------------------------------- /src/win32/GBDisassemble.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_GBDISASSEMBLE_H__3EFD5B47_6DBF_4F63_8F91_A9511EC590EB__INCLUDED_) 2 | #define AFX_GBDISASSEMBLE_H__3EFD5B47_6DBF_4F63_8F91_A9511EC590EB__INCLUDED_ 3 | 4 | #include "../System.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // GBDisassemble.h : header file 9 | // 10 | 11 | #include "IUpdate.h" 12 | #include "ResizeDlg.h" 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // GBDisassemble dialog 16 | 17 | class GBDisassemble : public ResizeDlg, IUpdateListener 18 | { 19 | // Construction 20 | public: 21 | void refresh(); 22 | u16 lastAddress; 23 | int count; 24 | bool autoUpdate; 25 | u16 address; 26 | GBDisassemble(CWnd* pParent = NULL); // standard constructor 27 | 28 | virtual void update(); 29 | 30 | // Dialog Data 31 | //{{AFX_DATA(GBDisassemble) 32 | enum { IDD = IDD_GB_DISASSEMBLE }; 33 | CEdit m_address; 34 | CListBox m_list; 35 | BOOL m_c; 36 | BOOL m_h; 37 | BOOL m_n; 38 | BOOL m_z; 39 | //}}AFX_DATA 40 | 41 | 42 | // Overrides 43 | // ClassWizard generated virtual function overrides 44 | //{{AFX_VIRTUAL(GBDisassemble) 45 | protected: 46 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 47 | virtual void PostNcDestroy(); 48 | //}}AFX_VIRTUAL 49 | 50 | // Implementation 51 | protected: 52 | 53 | // Generated message map functions 54 | //{{AFX_MSG(GBDisassemble) 55 | afx_msg void OnClose(); 56 | afx_msg void OnRefresh(); 57 | afx_msg void OnNext(); 58 | afx_msg void OnGo(); 59 | afx_msg void OnGopc(); 60 | afx_msg void OnAutoUpdate(); 61 | virtual BOOL OnInitDialog(); 62 | afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 63 | //}}AFX_MSG 64 | DECLARE_MESSAGE_MAP() 65 | }; 66 | 67 | //{{AFX_INSERT_LOCATION}} 68 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 69 | 70 | #endif // !defined(AFX_GBDISASSEMBLE_H__3EFD5B47_6DBF_4F63_8F91_A9511EC590EB__INCLUDED_) 71 | -------------------------------------------------------------------------------- /src/win32/GBMapView.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_GBMAPVIEW_H__4CD23D38_F2CD_4B95_AE76_2781591DD077__INCLUDED_) 2 | #define AFX_GBMAPVIEW_H__4CD23D38_F2CD_4B95_AE76_2781591DD077__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // GBMapView.h : header file 8 | // 9 | 10 | #include "BitmapControl.h" 11 | #include "ColorControl.h" 12 | #include "ZoomControl.h" 13 | #include "ResizeDlg.h" 14 | #include "IUpdate.h" 15 | #include "../System.h" // Added by ClassView 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // GBMapView dialog 19 | 20 | class GBMapView : public ResizeDlg, IUpdateListener 21 | { 22 | private: 23 | BITMAPINFO bmpInfo; 24 | u8 *data; 25 | int bank; 26 | int bg; 27 | int w; 28 | int h; 29 | BitmapControl mapView; 30 | ZoomControl mapViewZoom; 31 | ColorControl color; 32 | bool autoUpdate; 33 | // Construction 34 | public: 35 | afx_msg LRESULT OnColInfo(WPARAM wParam, LPARAM lParam); 36 | afx_msg LRESULT OnMapInfo(WPARAM wParam, LPARAM lParam); 37 | u32 GetClickAddress(int x, int y); 38 | void update(); 39 | void paint(); 40 | void render(); 41 | void savePNG(const char *name); 42 | void saveBMP(const char *name); 43 | ~GBMapView(); 44 | GBMapView(CWnd* pParent = NULL); // standard constructor 45 | 46 | // Dialog Data 47 | //{{AFX_DATA(GBMapView) 48 | enum { IDD = IDD_GB_MAP_VIEW }; 49 | // NOTE: the ClassWizard will add data members here 50 | //}}AFX_DATA 51 | 52 | 53 | // Overrides 54 | // ClassWizard generated virtual function overrides 55 | //{{AFX_VIRTUAL(GBMapView) 56 | protected: 57 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 58 | virtual void PostNcDestroy(); 59 | //}}AFX_VIRTUAL 60 | 61 | // Implementation 62 | protected: 63 | 64 | // Generated message map functions 65 | //{{AFX_MSG(GBMapView) 66 | afx_msg void OnSave(); 67 | afx_msg void OnRefresh(); 68 | virtual BOOL OnInitDialog(); 69 | afx_msg void OnBg0(); 70 | afx_msg void OnBg1(); 71 | afx_msg void OnBank0(); 72 | afx_msg void OnBank1(); 73 | afx_msg void OnStretch(); 74 | afx_msg void OnAutoUpdate(); 75 | afx_msg void OnClose(); 76 | //}}AFX_MSG 77 | DECLARE_MESSAGE_MAP() 78 | }; 79 | 80 | //{{AFX_INSERT_LOCATION}} 81 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 82 | 83 | #endif // !defined(AFX_GBMAPVIEW_H__4CD23D38_F2CD_4B95_AE76_2781591DD077__INCLUDED_) 84 | -------------------------------------------------------------------------------- /src/win32/GBMemoryViewerDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_GBMEMORYVIEWERDLG_H__23AD2804_EFA5_4900_AEC5_47196A41C50D__INCLUDED_) 2 | #define AFX_GBMEMORYVIEWERDLG_H__23AD2804_EFA5_4900_AEC5_47196A41C50D__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // GBMemoryViewerDlg.h : header file 8 | // 9 | #include "MemoryViewer.h" 10 | #include "ResizeDlg.h" 11 | #include "IUpdate.h" 12 | 13 | class GBMemoryViewer : public MemoryViewer { 14 | public: 15 | GBMemoryViewer(); 16 | virtual void readData(u32, int, u8 *); 17 | virtual void editData(u32, int, int, u32); 18 | }; 19 | 20 | ///////////////////////////////////////////////////////////////////////////// 21 | // GBMemoryViewerDlg dialog 22 | 23 | class GBMemoryViewerDlg : public ResizeDlg, IUpdateListener, IMemoryViewerDlg 24 | { 25 | GBMemoryViewer m_viewer; 26 | bool autoUpdate; 27 | // Construction 28 | public: 29 | void setCurrentAddress(u32 address); 30 | GBMemoryViewerDlg(CWnd* pParent = NULL); // standard constructor 31 | 32 | virtual void update(); 33 | 34 | // Dialog Data 35 | //{{AFX_DATA(GBMemoryViewerDlg) 36 | enum { IDD = IDD_MEM_VIEWER }; 37 | CEdit m_current; 38 | CEdit m_address; 39 | CComboBox m_addresses; 40 | int m_size; 41 | //}}AFX_DATA 42 | 43 | 44 | // Overrides 45 | // ClassWizard generated virtual function overrides 46 | //{{AFX_VIRTUAL(GBMemoryViewerDlg) 47 | protected: 48 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 49 | virtual void PostNcDestroy(); 50 | //}}AFX_VIRTUAL 51 | 52 | // Implementation 53 | protected: 54 | 55 | // Generated message map functions 56 | //{{AFX_MSG(GBMemoryViewerDlg) 57 | virtual BOOL OnInitDialog(); 58 | afx_msg void OnClose(); 59 | afx_msg void OnRefresh(); 60 | afx_msg void On8Bit(); 61 | afx_msg void On16Bit(); 62 | afx_msg void On32Bit(); 63 | afx_msg void OnAutoUpdate(); 64 | afx_msg void OnGo(); 65 | afx_msg void OnSelchangeAddresses(); 66 | afx_msg void OnSave(); 67 | afx_msg void OnLoad(); 68 | //}}AFX_MSG 69 | DECLARE_MESSAGE_MAP() 70 | }; 71 | 72 | //{{AFX_INSERT_LOCATION}} 73 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 74 | 75 | #endif // !defined(AFX_GBMEMORYVIEWERDLG_H__23AD2804_EFA5_4900_AEC5_47196A41C50D__INCLUDED_) 76 | -------------------------------------------------------------------------------- /src/win32/GBOamView.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_GBOAMVIEW_H__FE8105E6_9693_479A_8C57_DEEA1B2EA3D6__INCLUDED_) 2 | #define AFX_GBOAMVIEW_H__FE8105E6_9693_479A_8C57_DEEA1B2EA3D6__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // GBOamView.h : header file 8 | // 9 | 10 | #include "BitmapControl.h" 11 | #include "ZoomControl.h" 12 | #include "ColorControl.h" 13 | 14 | #include "IUpdate.h" 15 | #include "ResizeDlg.h" 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // GBOamView dialog 19 | 20 | class GBOamView : public ResizeDlg, IUpdateListener 21 | { 22 | private: 23 | BITMAPINFO bmpInfo; 24 | u8 *data; 25 | int w; 26 | int h; 27 | int number; 28 | bool autoUpdate; 29 | BitmapControl oamView; 30 | ZoomControl oamZoom; 31 | ColorControl color; 32 | 33 | 34 | // Construction 35 | public: 36 | void updateScrollInfo(); 37 | void save(); 38 | void savePNG(const char *name); 39 | void saveBMP(const char *name); 40 | void render(); 41 | void setAttributes(int y, int x, int tile, int flags); 42 | void paint(); 43 | ~GBOamView(); 44 | GBOamView(CWnd* pParent = NULL); // standard constructor 45 | 46 | afx_msg LRESULT OnColInfo(WPARAM wParam, LPARAM lParam); 47 | afx_msg LRESULT OnMapInfo(WPARAM wParam, LPARAM lParam); 48 | virtual void update(); 49 | 50 | // Dialog Data 51 | //{{AFX_DATA(GBOamView) 52 | enum { IDD = IDD_GB_OAM_VIEW }; 53 | CEdit m_sprite; 54 | BOOL m_stretch; 55 | //}}AFX_DATA 56 | 57 | 58 | // Overrides 59 | // ClassWizard generated virtual function overrides 60 | //{{AFX_VIRTUAL(GBOamView) 61 | protected: 62 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 63 | virtual void PostNcDestroy(); 64 | //}}AFX_VIRTUAL 65 | 66 | // Implementation 67 | protected: 68 | 69 | // Generated message map functions 70 | //{{AFX_MSG(GBOamView) 71 | virtual BOOL OnInitDialog(); 72 | afx_msg void OnStretch(); 73 | afx_msg void OnAutoUpdate(); 74 | afx_msg void OnChangeSprite(); 75 | afx_msg void OnClose(); 76 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 77 | //}}AFX_MSG 78 | DECLARE_MESSAGE_MAP() 79 | }; 80 | 81 | //{{AFX_INSERT_LOCATION}} 82 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 83 | 84 | #endif // !defined(AFX_GBOAMVIEW_H__FE8105E6_9693_479A_8C57_DEEA1B2EA3D6__INCLUDED_) 85 | -------------------------------------------------------------------------------- /src/win32/GBPaletteView.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_GBPALETTEVIEW_H__F909FF55_3021_4301_B017_0C2C9D8D8C08__INCLUDED_) 2 | #define AFX_GBPALETTEVIEW_H__F909FF55_3021_4301_B017_0C2C9D8D8C08__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // GBPaletteView.h : header file 8 | // 9 | 10 | #include "ColorControl.h" 11 | #include "IUpdate.h" 12 | #include "PaletteViewControl.h" 13 | #include "ResizeDlg.h" 14 | 15 | class GBPaletteViewControl : public PaletteViewControl { 16 | public: 17 | virtual void updatePalette(); 18 | }; 19 | 20 | ///////////////////////////////////////////////////////////////////////////// 21 | // GBPaletteView dialog 22 | 23 | class GBPaletteView : public ResizeDlg, IUpdateListener 24 | { 25 | private: 26 | GBPaletteViewControl paletteView; 27 | GBPaletteViewControl paletteViewOBJ; 28 | ColorControl colorControl; 29 | bool autoUpdate; 30 | // Construction 31 | public: 32 | void save(int which); 33 | GBPaletteView(CWnd* pParent = NULL); // standard constructor 34 | virtual ~GBPaletteView(); 35 | 36 | // Dialog Data 37 | //{{AFX_DATA(GBPaletteView) 38 | enum { IDD = IDD_GB_PALETTE_VIEW }; 39 | // NOTE: the ClassWizard will add data members here 40 | //}}AFX_DATA 41 | 42 | 43 | // Overrides 44 | // ClassWizard generated virtual function overrides 45 | //{{AFX_VIRTUAL(GBPaletteView) 46 | protected: 47 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 48 | virtual void PostNcDestroy(); 49 | //}}AFX_VIRTUAL 50 | 51 | virtual void update(); 52 | 53 | // Implementation 54 | protected: 55 | afx_msg virtual LRESULT OnPalInfo(WPARAM wParam, LPARAM lParam); 56 | // Generated message map functions 57 | //{{AFX_MSG(GBPaletteView) 58 | virtual BOOL OnInitDialog(); 59 | afx_msg void OnSaveBg(); 60 | afx_msg void OnSaveObj(); 61 | afx_msg void OnRefresh2(); 62 | afx_msg void OnAutoUpdate(); 63 | afx_msg void OnClose(); 64 | //}}AFX_MSG 65 | DECLARE_MESSAGE_MAP() 66 | }; 67 | 68 | //{{AFX_INSERT_LOCATION}} 69 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 70 | 71 | #endif // !defined(AFX_GBPALETTEVIEW_H__F909FF55_3021_4301_B017_0C2C9D8D8C08__INCLUDED_) 72 | -------------------------------------------------------------------------------- /src/win32/GBPrinterDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_GBPRINTER_H__3180CC5A_1F9D_47E5_B044_407442CB40A4__INCLUDED_) 2 | #define AFX_GBPRINTER_H__3180CC5A_1F9D_47E5_B044_407442CB40A4__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // GBPrinter.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // GBPrinter dialog 12 | 13 | class GBPrinterDlg : public CDialog 14 | { 15 | private: 16 | u8 bitmapHeader[sizeof(BITMAPINFO)+4*sizeof(RGBQUAD)]; 17 | BITMAPINFO *bitmap; 18 | u8 *bitmapData; 19 | int scale; 20 | // Construction 21 | public: 22 | void processData(u8 *data); 23 | void saveAsPNG(const char *name); 24 | void saveAsBMP(const char *name); 25 | GBPrinterDlg(CWnd* pParent = NULL); // standard constructor 26 | ~GBPrinterDlg(); 27 | 28 | // Dialog Data 29 | //{{AFX_DATA(GBPrinterDlg) 30 | enum { IDD = IDD_GB_PRINTER }; 31 | int m_scale; 32 | //}}AFX_DATA 33 | 34 | 35 | // Overrides 36 | // ClassWizard generated virtual function overrides 37 | //{{AFX_VIRTUAL(GBPrinterDlg) 38 | protected: 39 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 40 | //}}AFX_VIRTUAL 41 | 42 | // Implementation 43 | protected: 44 | 45 | // Generated message map functions 46 | //{{AFX_MSG(GBPrinterDlg) 47 | afx_msg void OnSave(); 48 | afx_msg void OnPrint(); 49 | virtual BOOL OnInitDialog(); 50 | afx_msg void OnOk(); 51 | afx_msg void On1x(); 52 | afx_msg void On2x(); 53 | afx_msg void On3x(); 54 | afx_msg void On4x(); 55 | afx_msg void OnPaint(); 56 | //}}AFX_MSG 57 | DECLARE_MESSAGE_MAP() 58 | }; 59 | 60 | //{{AFX_INSERT_LOCATION}} 61 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 62 | 63 | #endif // !defined(AFX_GBPRINTER_H__3180CC5A_1F9D_47E5_B044_407442CB40A4__INCLUDED_) 64 | -------------------------------------------------------------------------------- /src/win32/GBTileView.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_GBTILEVIEW_H__C8C8DEBB_17ED_4C5C_9DBE_D730A49B312C__INCLUDED_) 2 | #define AFX_GBTILEVIEW_H__C8C8DEBB_17ED_4C5C_9DBE_D730A49B312C__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // GBTileView.h : header file 8 | // 9 | #include "BitmapControl.h" 10 | #include "ColorControl.h" 11 | #include "IUpdate.h" 12 | #include "ResizeDlg.h" 13 | #include "ZoomControl.h" 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // GBTileView dialog 17 | 18 | class GBTileView : public ResizeDlg, IUpdateListener 19 | { 20 | int charBase; 21 | int palette; 22 | int bank; 23 | BitmapControl tileView; 24 | BITMAPINFO bmpInfo; 25 | u8 *data; 26 | ZoomControl zoom; 27 | ColorControl color; 28 | int w; 29 | int h; 30 | bool autoUpdate; 31 | // Construction 32 | public: 33 | void paint(); 34 | void render(); 35 | void renderTile(int tile, int x, int y, u8 *charBase); 36 | void savePNG(const char *name); 37 | void saveBMP(const char *name); 38 | GBTileView(CWnd* pParent = NULL); // standard constructor 39 | virtual ~GBTileView(); 40 | 41 | virtual void update(); 42 | 43 | // Dialog Data 44 | //{{AFX_DATA(GBTileView) 45 | enum { IDD = IDD_GB_TILE_VIEWER }; 46 | CSliderCtrl m_slider; 47 | int m_charBase; 48 | int m_bank; 49 | BOOL m_stretch; 50 | //}}AFX_DATA 51 | 52 | 53 | // Overrides 54 | // ClassWizard generated virtual function overrides 55 | //{{AFX_VIRTUAL(GBTileView) 56 | protected: 57 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 58 | virtual void PostNcDestroy(); 59 | //}}AFX_VIRTUAL 60 | 61 | // Implementation 62 | protected: 63 | virtual afx_msg LRESULT OnMapInfo(WPARAM wParam, LPARAM lParam); 64 | virtual afx_msg LRESULT OnColInfo(WPARAM wParam, LPARAM lParam); 65 | 66 | // Generated message map functions 67 | //{{AFX_MSG(GBTileView) 68 | afx_msg void OnSave(); 69 | virtual BOOL OnInitDialog(); 70 | afx_msg void OnClose(); 71 | afx_msg void OnAutoUpdate(); 72 | afx_msg void OnCharbase0(); 73 | afx_msg void OnCharbase1(); 74 | afx_msg void OnBank0(); 75 | afx_msg void OnBank1(); 76 | afx_msg void OnStretch(); 77 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 78 | //}}AFX_MSG 79 | DECLARE_MESSAGE_MAP() 80 | }; 81 | 82 | //{{AFX_INSERT_LOCATION}} 83 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 84 | 85 | #endif // !defined(AFX_GBTILEVIEW_H__C8C8DEBB_17ED_4C5C_9DBE_D730A49B312C__INCLUDED_) 86 | -------------------------------------------------------------------------------- /src/win32/GSACodeSelect.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_GSACODESELECT_H__189BD94D_288F_4E2A_9395_EAB16F104D87__INCLUDED_) 2 | #define AFX_GSACODESELECT_H__189BD94D_288F_4E2A_9395_EAB16F104D87__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // GSACodeSelect.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // GSACodeSelect dialog 12 | 13 | class GSACodeSelect : public CDialog 14 | { 15 | // Construction 16 | public: 17 | GSACodeSelect(FILE *file, CWnd* pParent = NULL); // standard constructor 18 | 19 | // Dialog Data 20 | //{{AFX_DATA(GSACodeSelect) 21 | enum { IDD = IDD_CODE_SELECT }; 22 | CListBox m_games; 23 | //}}AFX_DATA 24 | FILE *m_file; 25 | 26 | 27 | // Overrides 28 | // ClassWizard generated virtual function overrides 29 | //{{AFX_VIRTUAL(GSACodeSelect) 30 | protected: 31 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 32 | //}}AFX_VIRTUAL 33 | 34 | // Implementation 35 | protected: 36 | 37 | // Generated message map functions 38 | //{{AFX_MSG(GSACodeSelect) 39 | afx_msg void OnCancel(); 40 | afx_msg void OnOk(); 41 | afx_msg void OnSelchangeGameList(); 42 | virtual BOOL OnInitDialog(); 43 | //}}AFX_MSG 44 | DECLARE_MESSAGE_MAP() 45 | }; 46 | 47 | //{{AFX_INSERT_LOCATION}} 48 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 49 | 50 | #endif // !defined(AFX_GSACODESELECT_H__189BD94D_288F_4E2A_9395_EAB16F104D87__INCLUDED_) 51 | -------------------------------------------------------------------------------- /src/win32/GameOverrides.h: -------------------------------------------------------------------------------- 1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 2 | // Copyright (C) 1999-2003 Forgotten 3 | // Copyright (C) 2005 Forgotten and the VBA development team 4 | 5 | // This program is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation; either version 2, or(at your option) 8 | // any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software Foundation, 17 | // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | 19 | #include "afxwin.h" 20 | #if !defined(AFX_GAMEOVERRIDES_H__EEEFE37F_F477_455D_8682_705FB2DBCC0C__INCLUDED_) 21 | #define AFX_GAMEOVERRIDES_H__EEEFE37F_F477_455D_8682_705FB2DBCC0C__INCLUDED_ 22 | 23 | #if _MSC_VER > 1000 24 | #pragma once 25 | #endif // _MSC_VER > 1000 26 | // GameOverrides.h : header file 27 | // 28 | 29 | ///////////////////////////////////////////////////////////////////////////// 30 | // GameOverrides dialog 31 | 32 | class GameOverrides : public CDialog 33 | { 34 | // Construction 35 | public: 36 | GameOverrides(CWnd* pParent = NULL); // standard constructor 37 | 38 | // Dialog Data 39 | //{{AFX_DATA(GameOverrides) 40 | enum { IDD = IDD_GAME_OVERRIDES }; 41 | CEdit m_name; 42 | CComboBox m_mirroring; 43 | CComboBox m_flashSize; 44 | CComboBox m_saveType; 45 | CComboBox m_rtc; 46 | //}}AFX_DATA 47 | 48 | 49 | // Overrides 50 | // ClassWizard generated virtual function overrides 51 | //{{AFX_VIRTUAL(GameOverrides) 52 | protected: 53 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 54 | //}}AFX_VIRTUAL 55 | 56 | // Implementation 57 | protected: 58 | 59 | // Generated message map functions 60 | //{{AFX_MSG(GameOverrides) 61 | virtual void OnOK(); 62 | afx_msg void OnDefaults(); 63 | virtual void OnCancel(); 64 | virtual BOOL OnInitDialog(); 65 | //}}AFX_MSG 66 | DECLARE_MESSAGE_MAP() 67 | public: 68 | CEdit m_comment; 69 | }; 70 | 71 | //{{AFX_INSERT_LOCATION}} 72 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 73 | 74 | #endif // !defined(AFX_GAMEOVERRIDES_H__EEEFE37F_F477_455D_8682_705FB2DBCC0C__INCLUDED_) 75 | -------------------------------------------------------------------------------- /src/win32/Hyperlink.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "vba.h" 3 | #include "Hyperlink.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #undef THIS_FILE 8 | static char THIS_FILE[] = __FILE__; 9 | #endif 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // Hyperlink 13 | 14 | Hyperlink::Hyperlink() 15 | { 16 | m_over = false; 17 | } 18 | 19 | Hyperlink::~Hyperlink() 20 | { 21 | m_underlineFont.DeleteObject(); 22 | } 23 | 24 | 25 | BEGIN_MESSAGE_MAP(Hyperlink, CStatic) 26 | //{{AFX_MSG_MAP(Hyperlink) 27 | ON_WM_CTLCOLOR_REFLECT() 28 | ON_WM_ERASEBKGND() 29 | ON_WM_MOUSEMOVE() 30 | //}}AFX_MSG_MAP 31 | ON_CONTROL_REFLECT(STN_CLICKED, OnClicked) 32 | END_MESSAGE_MAP() 33 | 34 | ///////////////////////////////////////////////////////////////////////////// 35 | // Hyperlink message handlers 36 | 37 | void Hyperlink::PreSubclassWindow() 38 | { 39 | DWORD dwStyle = GetStyle(); 40 | ::SetWindowLong(GetSafeHwnd(), GWL_STYLE, dwStyle | SS_NOTIFY); 41 | 42 | // 32649 is the hand cursor 43 | m_cursor = LoadCursor(NULL, MAKEINTRESOURCE(32649)); 44 | 45 | CFont *font = GetFont(); 46 | 47 | LOGFONT lg; 48 | font->GetLogFont(&lg); 49 | 50 | lg.lfUnderline = TRUE; 51 | 52 | m_underlineFont.CreateFontIndirect(&lg); 53 | SetFont(&m_underlineFont); 54 | 55 | CStatic::PreSubclassWindow(); 56 | } 57 | 58 | void Hyperlink::OnClicked() 59 | { 60 | CString url; 61 | GetWindowText(url); 62 | ::ShellExecute(0, _T("open"), url, 63 | 0, 0, SW_SHOWNORMAL); 64 | } 65 | 66 | HBRUSH Hyperlink::CtlColor(CDC* pDC, UINT nCtlColor) 67 | { 68 | pDC->SetTextColor(RGB(0,0,240)); 69 | 70 | return (HBRUSH)GetStockObject(NULL_BRUSH); 71 | } 72 | 73 | BOOL Hyperlink::OnEraseBkgnd(CDC* pDC) 74 | { 75 | CRect rect; 76 | GetClientRect(rect); 77 | pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE)); 78 | 79 | return TRUE; 80 | } 81 | 82 | void Hyperlink::OnMouseMove(UINT nFlags, CPoint point) 83 | { 84 | if(!m_over) { 85 | m_over = true; 86 | SetCapture(); 87 | ::SetCursor(m_cursor); 88 | } else { 89 | CRect r; 90 | GetClientRect(&r); 91 | 92 | if(!r.PtInRect(point)) { 93 | m_over = false; 94 | ReleaseCapture(); 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/win32/Hyperlink.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_HYPERLINK_H__BECEAB7D_31FB_4727_A42B_8732162EEBCC__INCLUDED_) 2 | #define AFX_HYPERLINK_H__BECEAB7D_31FB_4727_A42B_8732162EEBCC__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // Hyperlink.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Hyperlink window 12 | 13 | class Hyperlink : public CStatic 14 | { 15 | // Construction 16 | public: 17 | Hyperlink(); 18 | 19 | // Attributes 20 | public: 21 | 22 | // Operations 23 | public: 24 | 25 | // Overrides 26 | // ClassWizard generated virtual function overrides 27 | //{{AFX_VIRTUAL(Hyperlink) 28 | protected: 29 | virtual void PreSubclassWindow(); 30 | //}}AFX_VIRTUAL 31 | 32 | // Implementation 33 | public: 34 | bool m_over; 35 | HCURSOR m_cursor; 36 | afx_msg void OnClicked(); 37 | CFont m_underlineFont; 38 | virtual ~Hyperlink(); 39 | 40 | // Generated message map functions 41 | protected: 42 | //{{AFX_MSG(Hyperlink) 43 | afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); 44 | afx_msg BOOL OnEraseBkgnd(CDC* pDC); 45 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 46 | //}}AFX_MSG 47 | 48 | DECLARE_MESSAGE_MAP() 49 | }; 50 | 51 | ///////////////////////////////////////////////////////////////////////////// 52 | 53 | //{{AFX_INSERT_LOCATION}} 54 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 55 | 56 | #endif // !defined(AFX_HYPERLINK_H__BECEAB7D_31FB_4727_A42B_8732162EEBCC__INCLUDED_) 57 | -------------------------------------------------------------------------------- /src/win32/IOViewer.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_IOVIEWER_H__9C266B78_FC02_4572_9062_0241802B0E76__INCLUDED_) 2 | #define AFX_IOVIEWER_H__9C266B78_FC02_4572_9062_0241802B0E76__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // IOViewer.h : header file 8 | // 9 | 10 | #include "ResizeDlg.h" 11 | #include "IUpdate.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // IOViewer dialog 15 | 16 | class IOViewer : public ResizeDlg, IUpdateListener 17 | { 18 | // Construction 19 | public: 20 | void update(); 21 | void bitChange(); 22 | bool autoUpdate; 23 | int selected; 24 | IOViewer(CWnd* pParent = NULL); // standard constructor 25 | 26 | // Dialog Data 27 | //{{AFX_DATA(IOViewer) 28 | enum { IDD = IDD_IO_VIEWER }; 29 | CStatic m_value; 30 | CComboBox m_address; 31 | //}}AFX_DATA 32 | 33 | 34 | // Overrides 35 | // ClassWizard generated virtual function overrides 36 | //{{AFX_VIRTUAL(IOViewer) 37 | protected: 38 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 39 | virtual void PostNcDestroy(); 40 | //}}AFX_VIRTUAL 41 | 42 | // Implementation 43 | protected: 44 | 45 | // Generated message map functions 46 | //{{AFX_MSG(IOViewer) 47 | afx_msg void OnClose(); 48 | afx_msg void OnRefresh(); 49 | afx_msg void OnAutoUpdate(); 50 | afx_msg void OnSelchangeAddresses(); 51 | virtual BOOL OnInitDialog(); 52 | afx_msg void OnApply(); 53 | //}}AFX_MSG 54 | DECLARE_MESSAGE_MAP() 55 | }; 56 | 57 | //{{AFX_INSERT_LOCATION}} 58 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 59 | 60 | #endif // !defined(AFX_IOVIEWER_H__9C266B78_FC02_4572_9062_0241802B0E76__INCLUDED_) 61 | -------------------------------------------------------------------------------- /src/win32/IUpdate.h: -------------------------------------------------------------------------------- 1 | #ifndef VBA_WIN32_IUPDATE_H 2 | #define VBA_WIN32_IUPDATE_H 3 | 4 | class IUpdateListener { 5 | public: 6 | virtual void update()=0; 7 | }; 8 | #endif 9 | -------------------------------------------------------------------------------- /src/win32/Input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../System.h" 4 | 5 | #define JOYCONFIG_MESSAGE (WM_USER + 1000) 6 | #define JOYPADS 4 7 | #define MOTION_KEYS 4 8 | #define KEYS_PER_PAD 13 9 | #define MOTION(i) ((JOYPADS*KEYS_PER_PAD)+i) 10 | #define JOYPAD(i,j) ((i*KEYS_PER_PAD)+j) 11 | 12 | #define DEVICEOF(key) (key >> 8) 13 | #define KEYOF(key) (key & 255) 14 | 15 | typedef CList KeyList; 16 | 17 | enum { 18 | KEY_LEFT, KEY_RIGHT, 19 | KEY_UP, KEY_DOWN, 20 | KEY_BUTTON_A, KEY_BUTTON_B, 21 | KEY_BUTTON_START, KEY_BUTTON_SELECT, 22 | KEY_BUTTON_L, KEY_BUTTON_R, 23 | KEY_BUTTON_SPEED, KEY_BUTTON_CAPTURE, 24 | KEY_BUTTON_GS 25 | }; 26 | 27 | class Input { 28 | 29 | public: 30 | KeyList joypaddata[JOYPADS * KEYS_PER_PAD + MOTION_KEYS]; 31 | 32 | Input() {}; 33 | virtual ~Input() {}; 34 | 35 | virtual bool initialize() = 0; 36 | 37 | virtual bool readDevices() = 0; 38 | virtual u32 readDevice(int which) = 0; 39 | virtual CString getKeyName(LONG_PTR key) = 0; 40 | virtual void checkKeys() = 0; 41 | virtual void checkMotionKeys() = 0; 42 | virtual void checkDevices() = 0; 43 | virtual void activate() = 0; 44 | virtual void loadSettings() = 0; 45 | virtual void saveSettings() = 0; 46 | }; 47 | -------------------------------------------------------------------------------- /src/win32/JoybusOptions.cpp: -------------------------------------------------------------------------------- 1 | #ifndef NO_LINK 2 | 3 | #include "stdafx.h" 4 | #include "vba.h" 5 | #include "JoybusOptions.h" 6 | #include "../gba/GBALink.h" 7 | 8 | // JoybusOptions dialog 9 | 10 | IMPLEMENT_DYNAMIC(JoybusOptions, CDialog) 11 | 12 | JoybusOptions::JoybusOptions(CWnd* pParent /*=NULL*/) 13 | : CDialog(JoybusOptions::IDD, pParent) 14 | { 15 | } 16 | 17 | JoybusOptions::~JoybusOptions() 18 | { 19 | } 20 | 21 | void JoybusOptions::DoDataExchange(CDataExchange* pDX) 22 | { 23 | CDialog::DoDataExchange(pDX); 24 | DDX_Control(pDX, IDC_JOYBUS_ENABLE, enable_check); 25 | DDX_Control(pDX, IDC_JOYBUS_HOSTNAME, hostname); 26 | } 27 | 28 | BEGIN_MESSAGE_MAP(JoybusOptions, CDialog) 29 | ON_BN_CLICKED(IDC_JOYBUS_ENABLE, &JoybusOptions::OnBnClickedJoybusEnable) 30 | ON_BN_CLICKED(IDOK, &JoybusOptions::OnBnClickedOk) 31 | END_MESSAGE_MAP() 32 | 33 | BOOL JoybusOptions::OnInitDialog() 34 | { 35 | CDialog::OnInitDialog(); 36 | 37 | enable_check.SetCheck(gba_joybus_enabled ? BST_CHECKED : BST_UNCHECKED); 38 | 39 | hostname.EnableWindow(enable_check.GetCheck() == BST_CHECKED); 40 | 41 | hostname.SetWindowText(joybusHostAddr.ToString().c_str()); 42 | 43 | return TRUE; 44 | } 45 | 46 | void JoybusOptions::OnBnClickedJoybusEnable() 47 | { 48 | hostname.EnableWindow(enable_check.GetCheck() == BST_CHECKED); 49 | } 50 | 51 | void JoybusOptions::OnBnClickedOk() 52 | { 53 | if ( (hostname.GetWindowTextLength() == 0) 54 | && (enable_check.GetCheck() == BST_CHECKED) ) 55 | { 56 | hostname.SetWindowText("Enter IP or Hostname"); 57 | return; 58 | } 59 | 60 | gba_joybus_enabled = enable_check.GetCheck() == BST_CHECKED; 61 | 62 | CString address; 63 | hostname.GetWindowText(address); 64 | 65 | sf::IPAddress new_server; 66 | new_server = std::string(address); 67 | 68 | if (!new_server.IsValid()) 69 | { 70 | hostname.SetWindowText("Enter IP or Hostname"); 71 | return; 72 | } 73 | 74 | joybusHostAddr = new_server; 75 | JoyBusConnect(); 76 | 77 | OnOK(); 78 | } 79 | 80 | #endif // NO_LINK 81 | -------------------------------------------------------------------------------- /src/win32/JoybusOptions.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "afxwin.h" 3 | 4 | // JoybusOptions dialog 5 | 6 | class JoybusOptions : public CDialog 7 | { 8 | DECLARE_DYNAMIC(JoybusOptions) 9 | 10 | public: 11 | JoybusOptions(CWnd* pParent = NULL); // standard constructor 12 | virtual ~JoybusOptions(); 13 | 14 | // Dialog Data 15 | enum { IDD = IDD_JOYBUS_DIALOG }; 16 | 17 | protected: 18 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 19 | 20 | DECLARE_MESSAGE_MAP() 21 | public: 22 | virtual BOOL OnInitDialog(); 23 | afx_msg void OnBnClickedJoybusEnable(); 24 | CButton enable_check; 25 | CEdit hostname; 26 | afx_msg void OnBnClickedOk(); 27 | }; 28 | -------------------------------------------------------------------------------- /src/win32/LangSelect.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "VBA.h" 3 | #include "LangSelect.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #undef THIS_FILE 8 | static char THIS_FILE[] = __FILE__; 9 | #endif 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // LangSelect dialog 13 | 14 | 15 | LangSelect::LangSelect(CWnd* pParent /*=NULL*/) 16 | : CDialog(LangSelect::IDD, pParent) 17 | { 18 | //{{AFX_DATA_INIT(LangSelect) 19 | // NOTE: the ClassWizard will add member initialization here 20 | //}}AFX_DATA_INIT 21 | } 22 | 23 | 24 | void LangSelect::DoDataExchange(CDataExchange* pDX) 25 | { 26 | CDialog::DoDataExchange(pDX); 27 | //{{AFX_DATA_MAP(LangSelect) 28 | DDX_Control(pDX, IDC_LANG_STRING, m_langString); 29 | DDX_Control(pDX, IDC_LANG_NAME, m_langName); 30 | //}}AFX_DATA_MAP 31 | } 32 | 33 | 34 | BEGIN_MESSAGE_MAP(LangSelect, CDialog) 35 | //{{AFX_MSG_MAP(LangSelect) 36 | ON_BN_CLICKED(ID_CANCEL, OnCancel) 37 | ON_BN_CLICKED(ID_OK, OnOk) 38 | //}}AFX_MSG_MAP 39 | END_MESSAGE_MAP() 40 | 41 | ///////////////////////////////////////////////////////////////////////////// 42 | // LangSelect message handlers 43 | 44 | void LangSelect::OnCancel() 45 | { 46 | EndDialog(FALSE); 47 | } 48 | 49 | void LangSelect::OnOk() 50 | { 51 | m_langString.GetWindowText(theApp.languageName); 52 | EndDialog(TRUE); 53 | } 54 | 55 | BOOL LangSelect::OnInitDialog() 56 | { 57 | CDialog::OnInitDialog(); 58 | 59 | char lbuffer[10]; 60 | if(GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVLANGNAME, 61 | lbuffer, 10)) { 62 | m_langName.SetWindowText(lbuffer); 63 | } else { 64 | m_langName.SetWindowText("???"); 65 | } 66 | 67 | if(!theApp.languageName.IsEmpty()) 68 | m_langString.SetWindowText(theApp.languageName); 69 | 70 | m_langString.LimitText(3); 71 | 72 | CenterWindow(); 73 | 74 | return TRUE; // return TRUE unless you set the focus to a control 75 | // EXCEPTION: OCX Property Pages should return FALSE 76 | } 77 | -------------------------------------------------------------------------------- /src/win32/LangSelect.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_LANGSELECT_H__63619E13_A375_4ED4_952F_DCF8998C2914__INCLUDED_) 2 | #define AFX_LANGSELECT_H__63619E13_A375_4ED4_952F_DCF8998C2914__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // LangSelect.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // LangSelect dialog 12 | 13 | class LangSelect : public CDialog 14 | { 15 | // Construction 16 | public: 17 | LangSelect(CWnd* pParent = NULL); // standard constructor 18 | 19 | // Dialog Data 20 | //{{AFX_DATA(LangSelect) 21 | enum { IDD = IDD_LANG_SELECT }; 22 | CEdit m_langString; 23 | CStatic m_langName; 24 | //}}AFX_DATA 25 | 26 | 27 | // Overrides 28 | // ClassWizard generated virtual function overrides 29 | //{{AFX_VIRTUAL(LangSelect) 30 | protected: 31 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 32 | //}}AFX_VIRTUAL 33 | 34 | // Implementation 35 | protected: 36 | 37 | // Generated message map functions 38 | //{{AFX_MSG(LangSelect) 39 | afx_msg void OnCancel(); 40 | afx_msg void OnOk(); 41 | virtual BOOL OnInitDialog(); 42 | //}}AFX_MSG 43 | DECLARE_MESSAGE_MAP() 44 | }; 45 | 46 | //{{AFX_INSERT_LOCATION}} 47 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 48 | 49 | #endif // !defined(AFX_LANGSELECT_H__63619E13_A375_4ED4_952F_DCF8998C2914__INCLUDED_) 50 | -------------------------------------------------------------------------------- /src/win32/Logging.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ResizeDlg.h" 4 | 5 | 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // Logging dialog 8 | 9 | class Logging : public ResizeDlg 10 | { 11 | public: 12 | void log(const char *); 13 | void clearLog(); 14 | Logging(CWnd* pParent = NULL); // standard constructor 15 | 16 | // Dialog Data 17 | enum { IDD = IDD_LOGGING }; 18 | CEdit m_log; 19 | BOOL m_swi; 20 | BOOL m_unaligned_access; 21 | BOOL m_illegal_write; 22 | BOOL m_illegal_read; 23 | BOOL m_dma0; 24 | BOOL m_dma1; 25 | BOOL m_dma2; 26 | BOOL m_dma3; 27 | BOOL m_agbprint; 28 | BOOL m_undefined; 29 | BOOL m_sound_output; 30 | 31 | // Overrides 32 | protected: 33 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 34 | virtual void PostNcDestroy(); 35 | 36 | protected: 37 | afx_msg void OnOk(); 38 | afx_msg void OnClear(); 39 | afx_msg void OnVerboseAgbprint(); 40 | afx_msg void OnVerboseDma0(); 41 | afx_msg void OnVerboseDma1(); 42 | afx_msg void OnVerboseDma2(); 43 | afx_msg void OnVerboseDma3(); 44 | afx_msg void OnVerboseIllegalRead(); 45 | afx_msg void OnVerboseIllegalWrite(); 46 | afx_msg void OnVerboseSwi(); 47 | afx_msg void OnVerboseUnalignedAccess(); 48 | afx_msg void OnVerboseUndefined(); 49 | afx_msg void OnVerboseSoundoutput(); 50 | afx_msg void OnSave(); 51 | afx_msg void OnClose(); 52 | afx_msg void OnErrspaceLog(); 53 | afx_msg void OnMaxtextLog(); 54 | virtual BOOL OnInitDialog(); 55 | 56 | DECLARE_MESSAGE_MAP() 57 | public: 58 | static Logging *instance; 59 | static CString text; 60 | }; 61 | 62 | void toolsLogging(); 63 | void toolsLoggingClose(); 64 | void toolsLog(const char *s); 65 | void toolsClearLog(); 66 | -------------------------------------------------------------------------------- /src/win32/MainWndHelp.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "MainWnd.h" 3 | 4 | #include "AboutDialog.h" 5 | 6 | extern int emulating; 7 | 8 | void MainWnd::OnHelpAbout() 9 | { 10 | AboutDialog dlg; 11 | 12 | dlg.DoModal(); 13 | } 14 | 15 | void MainWnd::OnHelpFaq() 16 | { 17 | ::ShellExecute(0, _T("open"), "http://vba-m.com/forum/", 18 | 0, 0, SW_SHOWNORMAL); 19 | } 20 | 21 | void MainWnd::OnHelpBugreport() 22 | { 23 | ::ShellExecute(0, _T("open"), "http://sourceforge.net/tracker/?group_id=212795&atid=1023154", 24 | 0, 0, SW_SHOWNORMAL); 25 | } 26 | 27 | void MainWnd::OnHelpGnupubliclicense() 28 | { 29 | ::ShellExecute(0, _T("open"), "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html", 30 | 0, 0, SW_SHOWNORMAL); 31 | } 32 | -------------------------------------------------------------------------------- /src/win32/MaxScale.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "vba.h" 3 | #include "MaxScale.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #undef THIS_FILE 8 | static char THIS_FILE[] = __FILE__; 9 | #endif 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // MaxScale dialog 13 | 14 | 15 | MaxScale::MaxScale(CWnd* pParent /*=NULL*/) 16 | : CDialog(MaxScale::IDD, pParent) 17 | { 18 | //{{AFX_DATA_INIT(MaxScale) 19 | // NOTE: the ClassWizard will add member initialization here 20 | //}}AFX_DATA_INIT 21 | } 22 | 23 | 24 | void MaxScale::DoDataExchange(CDataExchange* pDX) 25 | { 26 | CDialog::DoDataExchange(pDX); 27 | //{{AFX_DATA_MAP(MaxScale) 28 | DDX_Control(pDX, IDC_VALUE, m_value); 29 | //}}AFX_DATA_MAP 30 | } 31 | 32 | 33 | BEGIN_MESSAGE_MAP(MaxScale, CDialog) 34 | //{{AFX_MSG_MAP(MaxScale) 35 | ON_BN_CLICKED(ID_OK, OnOk) 36 | ON_BN_CLICKED(ID_CANCEL, OnCancel) 37 | //}}AFX_MSG_MAP 38 | END_MESSAGE_MAP() 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | // MaxScale message handlers 42 | 43 | void MaxScale::OnCancel() 44 | { 45 | EndDialog(FALSE); 46 | } 47 | 48 | void MaxScale::OnOk() 49 | { 50 | CString tmp; 51 | m_value.GetWindowText(tmp); 52 | theApp.maxScale = atoi(tmp); 53 | EndDialog(TRUE); 54 | } 55 | 56 | BOOL MaxScale::OnInitDialog() 57 | { 58 | CDialog::OnInitDialog(); 59 | 60 | CString temp; 61 | 62 | temp.Format("%d", theApp.maxScale); 63 | 64 | m_value.SetWindowText(temp); 65 | 66 | return TRUE; // return TRUE unless you set the focus to a control 67 | // EXCEPTION: OCX Property Pages should return FALSE 68 | } 69 | -------------------------------------------------------------------------------- /src/win32/MaxScale.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_MAXSCALE_H__3F42C0CC_DD5E_4A96_A60D_33AB7CBDE406__INCLUDED_) 2 | #define AFX_MAXSCALE_H__3F42C0CC_DD5E_4A96_A60D_33AB7CBDE406__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // MaxScale.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // MaxScale dialog 12 | 13 | class MaxScale : public CDialog 14 | { 15 | // Construction 16 | public: 17 | MaxScale(CWnd* pParent = NULL); // standard constructor 18 | 19 | // Dialog Data 20 | //{{AFX_DATA(MaxScale) 21 | enum { IDD = IDD_MAX_SCALE }; 22 | CEdit m_value; 23 | //}}AFX_DATA 24 | 25 | 26 | // Overrides 27 | // ClassWizard generated virtual function overrides 28 | //{{AFX_VIRTUAL(MaxScale) 29 | protected: 30 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 31 | //}}AFX_VIRTUAL 32 | 33 | // Implementation 34 | protected: 35 | 36 | // Generated message map functions 37 | //{{AFX_MSG(MaxScale) 38 | afx_msg void OnCancel(); 39 | afx_msg void OnOk(); 40 | virtual BOOL OnInitDialog(); 41 | //}}AFX_MSG 42 | DECLARE_MESSAGE_MAP() 43 | }; 44 | 45 | //{{AFX_INSERT_LOCATION}} 46 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 47 | 48 | #endif // !defined(AFX_MAXSCALE_H__3F42C0CC_DD5E_4A96_A60D_33AB7CBDE406__INCLUDED_) 49 | -------------------------------------------------------------------------------- /src/win32/MemoryViewerAddressSize.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_MEMORYVIEWERADDRESSSIZE_H__04605262_2B1D_4EED_A467_B6C56AC2CACD__INCLUDED_) 2 | #define AFX_MEMORYVIEWERADDRESSSIZE_H__04605262_2B1D_4EED_A467_B6C56AC2CACD__INCLUDED_ 3 | 4 | #include "../System.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // MemoryViewerAddressSize.h : header file 9 | // 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // MemoryViewerAddressSize dialog 13 | 14 | class MemoryViewerAddressSize : public CDialog 15 | { 16 | u32 address; 17 | int size; 18 | // Construction 19 | public: 20 | int getSize(); 21 | u32 getAddress(); 22 | void setSize(int s); 23 | void setAddress(u32 a); 24 | MemoryViewerAddressSize(u32 a=0xffffff, int s=-1, CWnd* pParent = NULL); // standard constructor 25 | 26 | // Dialog Data 27 | //{{AFX_DATA(MemoryViewerAddressSize) 28 | enum { IDD = IDD_ADDR_SIZE }; 29 | CEdit m_size; 30 | CEdit m_address; 31 | //}}AFX_DATA 32 | 33 | 34 | // Overrides 35 | // ClassWizard generated virtual function overrides 36 | //{{AFX_VIRTUAL(MemoryViewerAddressSize) 37 | protected: 38 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 39 | //}}AFX_VIRTUAL 40 | 41 | // Implementation 42 | protected: 43 | 44 | // Generated message map functions 45 | //{{AFX_MSG(MemoryViewerAddressSize) 46 | virtual BOOL OnInitDialog(); 47 | afx_msg void OnOk(); 48 | afx_msg void OnCancel(); 49 | //}}AFX_MSG 50 | DECLARE_MESSAGE_MAP() 51 | }; 52 | 53 | //{{AFX_INSERT_LOCATION}} 54 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 55 | 56 | #endif // !defined(AFX_MEMORYVIEWERADDRESSSIZE_H__04605262_2B1D_4EED_A467_B6C56AC2CACD__INCLUDED_) 57 | -------------------------------------------------------------------------------- /src/win32/MemoryViewerDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_MEMORYVIEWERDLG_H__15046D5B_D5A2_4C49_A969_2A77F803F2F1__INCLUDED_) 2 | #define AFX_MEMORYVIEWERDLG_H__15046D5B_D5A2_4C49_A969_2A77F803F2F1__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // MemoryViewerDlg.h : header file 8 | // 9 | 10 | #include "MemoryViewer.h" 11 | #include "ResizeDlg.h" 12 | #include "IUpdate.h" 13 | 14 | class GBAMemoryViewer : public MemoryViewer { 15 | public: 16 | GBAMemoryViewer(); 17 | virtual void readData(u32, int, u8 *); 18 | virtual void editData(u32,int,int,u32); 19 | }; 20 | 21 | ///////////////////////////////////////////////////////////////////////////// 22 | // MemoryViewerDlg dialog 23 | 24 | class MemoryViewerDlg : public ResizeDlg, IUpdateListener, IMemoryViewerDlg 25 | { 26 | GBAMemoryViewer m_viewer; 27 | // Construction 28 | public: 29 | void setCurrentAddress(u32 address); 30 | bool autoUpdate; 31 | void update(); 32 | MemoryViewerDlg(CWnd* pParent = NULL); // standard constructor 33 | 34 | // Dialog Data 35 | //{{AFX_DATA(MemoryViewerDlg) 36 | enum { IDD = IDD_MEM_VIEWER }; 37 | CEdit m_current; 38 | CEdit m_address; 39 | CComboBox m_addresses; 40 | int m_size; 41 | //}}AFX_DATA 42 | 43 | 44 | // Overrides 45 | // ClassWizard generated virtual function overrides 46 | //{{AFX_VIRTUAL(MemoryViewerDlg) 47 | protected: 48 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 49 | virtual void PostNcDestroy(); 50 | //}}AFX_VIRTUAL 51 | 52 | // Implementation 53 | protected: 54 | 55 | // Generated message map functions 56 | //{{AFX_MSG(MemoryViewerDlg) 57 | virtual BOOL OnInitDialog(); 58 | afx_msg void OnClose(); 59 | afx_msg void OnRefresh(); 60 | afx_msg void On8Bit(); 61 | afx_msg void On16Bit(); 62 | afx_msg void On32Bit(); 63 | afx_msg void OnAutoUpdate(); 64 | afx_msg void OnGo(); 65 | afx_msg void OnSelchangeAddresses(); 66 | afx_msg void OnSave(); 67 | afx_msg void OnLoad(); 68 | //}}AFX_MSG 69 | DECLARE_MESSAGE_MAP() 70 | }; 71 | 72 | //{{AFX_INSERT_LOCATION}} 73 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 74 | 75 | #endif // !defined(AFX_MEMORYVIEWERDLG_H__15046D5B_D5A2_4C49_A969_2A77F803F2F1__INCLUDED_) 76 | -------------------------------------------------------------------------------- /src/win32/OALConfig.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #ifndef NO_OAL 3 | #include "VBA.h" 4 | 5 | #include "OALConfig.h" 6 | 7 | // OpenAL 8 | #include 9 | #include 10 | #include "LoadOAL.h" 11 | 12 | 13 | // OALConfig dialog 14 | 15 | IMPLEMENT_DYNAMIC(OALConfig, CDialog) 16 | 17 | OALConfig::OALConfig(CWnd* pParent /*=NULL*/) 18 | : CDialog(OALConfig::IDD, pParent) 19 | , selectedDevice(_T("")) 20 | , bufferCount(0) 21 | { 22 | if( !LoadOAL10Library( NULL, &ALFunction ) ) { 23 | systemMessage( IDS_OAL_NODLL, "OpenAL32.dll could not be found on your system. Please install the runtime from http://openal.org" ); 24 | } 25 | } 26 | 27 | OALConfig::~OALConfig() 28 | { 29 | } 30 | 31 | void OALConfig::DoDataExchange(CDataExchange* pDX) 32 | { 33 | CDialog::DoDataExchange(pDX); 34 | DDX_Control(pDX, IDC_DEVICE, m_cbDevice); 35 | 36 | if( !pDX->m_bSaveAndValidate ) { 37 | // enumerate devices 38 | const ALchar *devices = NULL; 39 | devices = ALFunction.alcGetString( NULL, ALC_DEVICE_SPECIFIER ); 40 | if( strlen( devices ) ) { 41 | while( *devices ) { 42 | m_cbDevice.AddString( devices ); 43 | devices += strlen( devices ) + 1; 44 | } 45 | } else { 46 | systemMessage( IDS_OAL_NODEVICE, "There are no sound devices present on this system." ); 47 | } 48 | } 49 | DDX_CBString(pDX, IDC_DEVICE, selectedDevice); 50 | DDX_Control(pDX, IDC_SLIDER_BUFFERCOUNT, m_sliderBufferCount); 51 | DDX_Slider(pDX, IDC_SLIDER_BUFFERCOUNT, bufferCount); 52 | DDX_Control(pDX, IDC_BUFFERINFO, m_bufferInfo); 53 | } 54 | 55 | 56 | BOOL OALConfig::OnInitDialog() 57 | { 58 | CDialog::OnInitDialog(); 59 | m_sliderBufferCount.SetRange( 2, 10, FALSE ); 60 | m_sliderBufferCount.SetTicFreq( 1 ); 61 | m_sliderBufferCount.SetPos( bufferCount ); 62 | 63 | CString info; 64 | int pos = m_sliderBufferCount.GetPos(); 65 | info.Format( _T("%i frames = %.2f ms"), pos, (float)pos / 60.0f * 1000.0f ); 66 | m_bufferInfo.SetWindowText( info ); 67 | 68 | return TRUE; 69 | } 70 | 71 | 72 | BEGIN_MESSAGE_MAP(OALConfig, CDialog) 73 | ON_WM_HSCROLL() 74 | END_MESSAGE_MAP() 75 | 76 | 77 | // OALConfig message handlers 78 | 79 | void OALConfig::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 80 | { 81 | CString info; 82 | int pos = m_sliderBufferCount.GetPos(); 83 | info.Format( _T("%i frames = %.2f ms"), pos, (float)pos / 60.0f * 1000.0f ); 84 | m_bufferInfo.SetWindowText( info ); 85 | 86 | CDialog::OnHScroll(nSBCode, nPos, pScrollBar); 87 | } 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /src/win32/OALConfig.h: -------------------------------------------------------------------------------- 1 | #ifndef NO_OAL 2 | 3 | #pragma once 4 | 5 | // OpenAL 6 | #include 7 | #include 8 | #include "LoadOAL.h" 9 | 10 | 11 | // OALConfig dialog 12 | 13 | class OALConfig : public CDialog 14 | { 15 | DECLARE_DYNAMIC(OALConfig) 16 | 17 | public: 18 | OALConfig(CWnd* pParent = NULL); // standard constructor 19 | virtual ~OALConfig(); 20 | 21 | // Dialog Data 22 | enum { IDD = IDD_OAL_CONFIG }; 23 | 24 | protected: 25 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 26 | virtual BOOL OnInitDialog(); 27 | 28 | DECLARE_MESSAGE_MAP() 29 | private: 30 | OPENALFNTABLE ALFunction; 31 | CComboBox m_cbDevice; 32 | CSliderCtrl m_sliderBufferCount; 33 | CStatic m_bufferInfo; 34 | public: 35 | CString selectedDevice; 36 | int bufferCount; 37 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/win32/OamView.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OAMVIEW_H__E5369352_80F8_49C4_9F23_05EB6FC1345B__INCLUDED_) 2 | #define AFX_OAMVIEW_H__E5369352_80F8_49C4_9F23_05EB6FC1345B__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OamView.h : header file 8 | // 9 | #include "BitmapControl.h" 10 | #include "ZoomControl.h" 11 | #include "ColorControl.h" 12 | 13 | #include "IUpdate.h" 14 | #include "ResizeDlg.h" 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // OamView dialog 18 | 19 | class OamView : public ResizeDlg, IUpdateListener 20 | { 21 | private: 22 | BITMAPINFO bmpInfo; 23 | u8 *data; 24 | int w; 25 | int h; 26 | int number; 27 | bool autoUpdate; 28 | BitmapControl oamView; 29 | ZoomControl oamZoom; 30 | ColorControl color; 31 | 32 | // Construction 33 | public: 34 | void updateScrollInfo(); 35 | afx_msg LRESULT OnColInfo(WPARAM wParam, LPARAM lParam); 36 | afx_msg LRESULT OnMapInfo(WPARAM wParam, LPARAM lParam); 37 | void savePNG(const char *name); 38 | void saveBMP(const char *name); 39 | void render(); 40 | void setAttributes(u16 a0, u16 a1, u16 a2); 41 | void paint(); 42 | ~OamView(); 43 | OamView(CWnd* pParent = NULL); // standard constructor 44 | 45 | virtual void update(); 46 | // Dialog Data 47 | //{{AFX_DATA(OamView) 48 | enum { IDD = IDD_OAM_VIEW }; 49 | CEdit m_sprite; 50 | BOOL m_stretch; 51 | //}}AFX_DATA 52 | 53 | 54 | // Overrides 55 | // ClassWizard generated virtual function overrides 56 | //{{AFX_VIRTUAL(OamView) 57 | protected: 58 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 59 | virtual void PostNcDestroy(); 60 | //}}AFX_VIRTUAL 61 | 62 | // Implementation 63 | protected: 64 | 65 | // Generated message map functions 66 | //{{AFX_MSG(OamView) 67 | afx_msg void OnSave(); 68 | virtual BOOL OnInitDialog(); 69 | afx_msg void OnStretch(); 70 | afx_msg void OnAutoUpdate(); 71 | afx_msg void OnChangeSprite(); 72 | afx_msg void OnClose(); 73 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 74 | //}}AFX_MSG 75 | DECLARE_MESSAGE_MAP() 76 | }; 77 | 78 | //{{AFX_INSERT_LOCATION}} 79 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 80 | 81 | #endif // !defined(AFX_OAMVIEW_H__E5369352_80F8_49C4_9F23_05EB6FC1345B__INCLUDED_) 82 | -------------------------------------------------------------------------------- /src/win32/PaletteView.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_PALETTEVIEW1_H__0873E3FF_9486_4B2C_8EF0_59C3B4F47162__INCLUDED_) 2 | #define AFX_PALETTEVIEW1_H__0873E3FF_9486_4B2C_8EF0_59C3B4F47162__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // PaletteView.h : header file 8 | // 9 | 10 | #include "ColorControl.h" 11 | #include "PaletteViewControl.h" 12 | #include "ResizeDlg.h" 13 | 14 | class GBAPaletteViewControl : public PaletteViewControl { 15 | public: 16 | virtual void updatePalette(); 17 | }; 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | // PaletteView dialog 21 | 22 | class PaletteView : public ResizeDlg, IUpdateListener 23 | { 24 | private: 25 | GBAPaletteViewControl paletteView; 26 | GBAPaletteViewControl paletteViewOBJ; 27 | ColorControl colorControl; 28 | bool autoUpdate; 29 | // Construction 30 | public: 31 | void save(int which); 32 | PaletteView(CWnd* pParent = NULL); // standard constructor 33 | ~PaletteView(); 34 | afx_msg LRESULT OnPalInfo(WPARAM wParam, LPARAM lParam); 35 | 36 | // Dialog Data 37 | //{{AFX_DATA(PaletteView) 38 | enum { IDD = IDD_PALETTE_VIEW }; 39 | // NOTE: the ClassWizard will add data members here 40 | //}}AFX_DATA 41 | 42 | 43 | // Overrides 44 | // ClassWizard generated virtual function overrides 45 | //{{AFX_VIRTUAL(PaletteView) 46 | protected: 47 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 48 | virtual void PostNcDestroy(); 49 | //}}AFX_VIRTUAL 50 | 51 | virtual void update(); 52 | 53 | // Implementation 54 | protected: 55 | 56 | // Generated message map functions 57 | //{{AFX_MSG(PaletteView) 58 | virtual BOOL OnInitDialog(); 59 | afx_msg void OnSaveBg(); 60 | afx_msg void OnSaveObj(); 61 | afx_msg void OnRefresh2(); 62 | afx_msg void OnAutoUpdate(); 63 | afx_msg void OnClose(); 64 | //}}AFX_MSG 65 | DECLARE_MESSAGE_MAP() 66 | public: 67 | afx_msg void OnBnClickedChangeBackdrop(); 68 | }; 69 | 70 | //{{AFX_INSERT_LOCATION}} 71 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 72 | 73 | #endif // !defined(AFX_PALETTEVIEW1_H__0873E3FF_9486_4B2C_8EF0_59C3B4F47162__INCLUDED_) 74 | -------------------------------------------------------------------------------- /src/win32/PaletteViewControl.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_PALETTEVIEWCONTROL_H__31F600AE_B7E5_4F6C_80B6_55E4B61FBD57__INCLUDED_) 2 | #define AFX_PALETTEVIEWCONTROL_H__31F600AE_B7E5_4F6C_80B6_55E4B61FBD57__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // PaletteViewControl.h : header file 8 | // 9 | #define WM_PALINFO WM_APP+1 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // PaletteViewControl window 13 | 14 | class PaletteViewControl : public CWnd 15 | { 16 | int w; 17 | int h; 18 | int colors; 19 | u8 *data; 20 | BITMAPINFO bmpInfo; 21 | static bool isRegistered; 22 | int selected; 23 | protected: 24 | u16 palette[256]; 25 | int paletteAddress; 26 | // Construction 27 | public: 28 | PaletteViewControl(); 29 | 30 | virtual void updatePalette()=0; 31 | 32 | // Attributes 33 | public: 34 | 35 | // Operations 36 | public: 37 | 38 | // Overrides 39 | // ClassWizard generated virtual function overrides 40 | //{{AFX_VIRTUAL(PaletteViewControl) 41 | //}}AFX_VIRTUAL 42 | 43 | // Implementation 44 | public: 45 | void registerClass(); 46 | void refresh(); 47 | void render(u16 color, int x, int y); 48 | void setSelected(int s); 49 | void setPaletteAddress(int address); 50 | bool saveJASCPAL(const char *name); 51 | bool saveMSPAL(const char *name); 52 | bool saveAdobe(const char *name); 53 | void init(int c, int w, int h); 54 | virtual ~PaletteViewControl(); 55 | 56 | // Generated message map functions 57 | protected: 58 | //{{AFX_MSG(PaletteViewControl) 59 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 60 | afx_msg BOOL OnEraseBkgnd(CDC* pDC); 61 | afx_msg void OnPaint(); 62 | //}}AFX_MSG 63 | DECLARE_MESSAGE_MAP() 64 | }; 65 | 66 | ///////////////////////////////////////////////////////////////////////////// 67 | 68 | //{{AFX_INSERT_LOCATION}} 69 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 70 | 71 | #endif // !defined(AFX_PALETTEVIEWCONTROL_H__31F600AE_B7E5_4F6C_80B6_55E4B61FBD57__INCLUDED_) 72 | -------------------------------------------------------------------------------- /src/win32/Reg.h: -------------------------------------------------------------------------------- 1 | #ifndef VBA_REG_H 2 | #define VBA_REG_H 3 | 4 | extern bool regEnabled; 5 | 6 | char *regQueryStringValue(const char *key, char *def); 7 | DWORD regQueryDwordValue(const char *key, DWORD def, bool force=false); 8 | BOOL regQueryBinaryValue(const char *key, char *value, int count); 9 | void regSetStringValue(const char *key,const char *value); 10 | void regSetDwordValue(const char *key,DWORD value,bool force=false); 11 | void regSetBinaryValue(const char *key, char *value, int count); 12 | void regDeleteValue(char *key); 13 | void regInit(const char *, bool force = false); 14 | void regShutdown(); 15 | bool regCreateFileType( const char *ext, const char *type ); 16 | bool regAssociateType( const char *type, const char *desc, const char *application, const char *icon = NULL ); 17 | void regExportSettingsToINI(); 18 | #endif // VBA_REG_H 19 | -------------------------------------------------------------------------------- /src/win32/ResizeDlg.h: -------------------------------------------------------------------------------- 1 | #ifndef VBA_WIN32_RESIZEDLG_H 2 | #define VBA_WIN32_RESIZEDLG_H 3 | 4 | #ifndef _INC_TCHAR 5 | #include 6 | #endif // _INC_TCHAR 7 | 8 | // 9 | // Predefined sizing information 10 | #define DS_MoveX 1 11 | #define DS_MoveY 2 12 | #define DS_SizeX 4 13 | #define DS_SizeY 8 14 | 15 | typedef struct DialogSizerSizingItem // sdi 16 | { 17 | UINT uControlID; 18 | UINT uSizeInfo; 19 | } DialogSizerSizingItem; 20 | 21 | #define DIALOG_SIZER_START( name ) DialogSizerSizingItem name[] = { 22 | #define DIALOG_SIZER_ENTRY( controlID, flags ) { controlID, flags }, 23 | #define DIALOG_SIZER_END() { 0xFFFFFFFF, 0xFFFFFFFF } }; 24 | 25 | class ResizeDlg : public CDialog { 26 | void *dd; 27 | public: 28 | ResizeDlg(UINT id, CWnd *parent = NULL); 29 | 30 | void *AddDialogData(); 31 | BOOL SetData(const DialogSizerSizingItem *psd, 32 | BOOL bShowSizingGrip, 33 | HKEY hkRootSave, 34 | LPCTSTR pcszName, 35 | SIZE *psizeMax); 36 | void UpdateWindowSize(const int cx, const int cy, HWND); 37 | 38 | virtual BOOL OnWndMsg(UINT, WPARAM, LPARAM, LRESULT *); 39 | }; 40 | #endif 41 | -------------------------------------------------------------------------------- /src/win32/RewindInterval.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "vba.h" 3 | #include "RewindInterval.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #undef THIS_FILE 8 | static char THIS_FILE[] = __FILE__; 9 | #endif 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // RewindInterval dialog 13 | 14 | 15 | RewindInterval::RewindInterval(int interval, CWnd* pParent /*=NULL*/) 16 | : CDialog(RewindInterval::IDD, pParent) 17 | { 18 | //{{AFX_DATA_INIT(RewindInterval) 19 | // NOTE: the ClassWizard will add member initialization here 20 | //}}AFX_DATA_INIT 21 | this->interval = interval; 22 | } 23 | 24 | 25 | void RewindInterval::DoDataExchange(CDataExchange* pDX) 26 | { 27 | CDialog::DoDataExchange(pDX); 28 | //{{AFX_DATA_MAP(RewindInterval) 29 | DDX_Control(pDX, IDC_INTERVAL, m_interval); 30 | //}}AFX_DATA_MAP 31 | } 32 | 33 | 34 | BEGIN_MESSAGE_MAP(RewindInterval, CDialog) 35 | //{{AFX_MSG_MAP(RewindInterval) 36 | ON_BN_CLICKED(ID_CANCEL, OnCancel) 37 | ON_BN_CLICKED(ID_OK, OnOk) 38 | //}}AFX_MSG_MAP 39 | END_MESSAGE_MAP() 40 | 41 | ///////////////////////////////////////////////////////////////////////////// 42 | // RewindInterval message handlers 43 | 44 | void RewindInterval::OnCancel() 45 | { 46 | EndDialog(-1); 47 | } 48 | 49 | void RewindInterval::OnOk() 50 | { 51 | CString buffer; 52 | 53 | m_interval.GetWindowText(buffer); 54 | 55 | int v = atoi(buffer); 56 | 57 | if(v >= 0 && v <= 600) { 58 | EndDialog(v); 59 | } else 60 | systemMessage(IDS_INVALID_INTERVAL_VALUE, 61 | "Invalid rewind interval value. Please enter a number " 62 | "between 0 and 600 seconds"); 63 | } 64 | 65 | BOOL RewindInterval::OnInitDialog() 66 | { 67 | CDialog::OnInitDialog(); 68 | 69 | m_interval.LimitText(3); 70 | 71 | CString buffer; 72 | buffer.Format("%d", interval); 73 | m_interval.SetWindowText(buffer); 74 | 75 | CenterWindow(); 76 | 77 | return TRUE; // return TRUE unless you set the focus to a control 78 | // EXCEPTION: OCX Property Pages should return FALSE 79 | } 80 | -------------------------------------------------------------------------------- /src/win32/RewindInterval.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_REWINDINTERVAL_H__C95AFF44_1F64_44C8_BAAB_A54B982D28EA__INCLUDED_) 2 | #define AFX_REWINDINTERVAL_H__C95AFF44_1F64_44C8_BAAB_A54B982D28EA__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // RewindInterval.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // RewindInterval dialog 12 | 13 | class RewindInterval : public CDialog 14 | { 15 | // Construction 16 | public: 17 | int interval; 18 | RewindInterval(int interval, CWnd* pParent = NULL); // standard constructor 19 | 20 | // Dialog Data 21 | //{{AFX_DATA(RewindInterval) 22 | enum { IDD = IDD_REWIND_INTERVAL }; 23 | CEdit m_interval; 24 | //}}AFX_DATA 25 | 26 | 27 | // Overrides 28 | // ClassWizard generated virtual function overrides 29 | //{{AFX_VIRTUAL(RewindInterval) 30 | protected: 31 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 32 | //}}AFX_VIRTUAL 33 | 34 | // Implementation 35 | protected: 36 | 37 | // Generated message map functions 38 | //{{AFX_MSG(RewindInterval) 39 | afx_msg void OnCancel(); 40 | afx_msg void OnOk(); 41 | virtual BOOL OnInitDialog(); 42 | //}}AFX_MSG 43 | DECLARE_MESSAGE_MAP() 44 | }; 45 | 46 | //{{AFX_INSERT_LOCATION}} 47 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 48 | 49 | #endif // !defined(AFX_REWINDINTERVAL_H__C95AFF44_1F64_44C8_BAAB_A54B982D28EA__INCLUDED_) 50 | -------------------------------------------------------------------------------- /src/win32/RomInfo.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_ROMINFO_H__9888A45C_3E71_4C0F_B119_EFC74DFF8CD3__INCLUDED_) 2 | #define AFX_ROMINFO_H__9888A45C_3E71_4C0F_B119_EFC74DFF8CD3__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // RomInfo.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // RomInfoGB dialog 12 | 13 | class RomInfoGB : public CDialog 14 | { 15 | // Construction 16 | public: 17 | RomInfoGB(u8 *rom, CWnd* pParent = NULL); // standard constructor 18 | 19 | // Dialog Data 20 | //{{AFX_DATA(RomInfoGB) 21 | enum { IDD = IDD_GB_ROM_INFO }; 22 | // NOTE: the ClassWizard will add data members here 23 | //}}AFX_DATA 24 | 25 | 26 | // Overrides 27 | // ClassWizard generated virtual function overrides 28 | //{{AFX_VIRTUAL(RomInfoGB) 29 | protected: 30 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 31 | //}}AFX_VIRTUAL 32 | u8 *rom; 33 | 34 | // Implementation 35 | protected: 36 | 37 | // Generated message map functions 38 | //{{AFX_MSG(RomInfoGB) 39 | afx_msg void OnOk(); 40 | virtual BOOL OnInitDialog(); 41 | //}}AFX_MSG 42 | DECLARE_MESSAGE_MAP() 43 | }; 44 | 45 | ///////////////////////////////////////////////////////////////////////////// 46 | // RomInfoGBA dialog 47 | 48 | class RomInfoGBA : public CDialog 49 | { 50 | // Construction 51 | public: 52 | RomInfoGBA(u8 *rom, CWnd* pParent = NULL); // standard constructor 53 | 54 | // Dialog Data 55 | //{{AFX_DATA(RomInfoGBA) 56 | enum { IDD = IDD_GBA_ROM_INFO }; 57 | // NOTE: the ClassWizard will add data members here 58 | //}}AFX_DATA 59 | u8 *rom; 60 | 61 | 62 | // Overrides 63 | // ClassWizard generated virtual function overrides 64 | //{{AFX_VIRTUAL(RomInfoGBA) 65 | protected: 66 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 67 | //}}AFX_VIRTUAL 68 | 69 | // Implementation 70 | protected: 71 | 72 | // Generated message map functions 73 | //{{AFX_MSG(RomInfoGBA) 74 | afx_msg void OnOk(); 75 | virtual BOOL OnInitDialog(); 76 | //}}AFX_MSG 77 | DECLARE_MESSAGE_MAP() 78 | }; 79 | //{{AFX_INSERT_LOCATION}} 80 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 81 | 82 | #endif // !defined(AFX_ROMINFO_H__9888A45C_3E71_4C0F_B119_EFC74DFF8CD3__INCLUDED_) 83 | -------------------------------------------------------------------------------- /src/win32/SelectPlugin.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_SELECTPLUGIN_H__A097B9D0_7C23_4C1A_A2D3_1AEC07501BBC__INCLUDED_) 2 | #define AFX_SELECTPLUGIN_H__A097B9D0_7C23_4C1A_A2D3_1AEC07501BBC__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // SelectPlugin.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // SelectPlugin dialog 12 | struct PluginDesc 13 | { 14 | char sFile[MAX_PATH]; 15 | char sDesc[60]; 16 | }; 17 | 18 | class SelectPlugin : public CDialog 19 | { 20 | // Construction 21 | public: 22 | SelectPlugin(CWnd* pParent = NULL); // standard constructor 23 | size_t EnumPlugins(); 24 | bool GetPluginDesc(const char *sRpi, PluginDesc *pDesc); 25 | 26 | // Dialog Data 27 | //{{AFX_DATA(SelectPlugin) 28 | enum { IDD = IDD_SELECT_PLUGIN }; 29 | CComboBox m_comboPlugin; 30 | //}}AFX_DATA 31 | 32 | 33 | // Overrides 34 | // ClassWizard generated virtual function overrides 35 | //{{AFX_VIRTUAL(SelectPlugin) 36 | protected: 37 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 38 | //}}AFX_VIRTUAL 39 | 40 | // Implementation 41 | protected: 42 | 43 | // Generated message map functions 44 | //{{AFX_MSG(SelectPlugin) 45 | virtual void OnOK(); 46 | virtual void OnCancel(); 47 | virtual BOOL OnInitDialog(); 48 | //}}AFX_MSG 49 | DECLARE_MESSAGE_MAP() 50 | }; 51 | 52 | //{{AFX_INSERT_LOCATION}} 53 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 54 | 55 | #endif // !defined(AFX_SELECTPLUGIN_H__A097B9D0_7C23_4C1A_A2D3_1AEC07501BBC__INCLUDED_) 56 | -------------------------------------------------------------------------------- /src/win32/StringTokenizer.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "vba.h" 3 | #include "StringTokenizer.h" 4 | 5 | #ifdef _DEBUG 6 | #undef THIS_FILE 7 | static char THIS_FILE[]=__FILE__; 8 | #define new DEBUG_NEW 9 | #endif 10 | 11 | ////////////////////////////////////////////////////////////////////// 12 | // Construction/Destruction 13 | ////////////////////////////////////////////////////////////////////// 14 | 15 | StringTokenizer::StringTokenizer(CString str, CString del) 16 | { 17 | m_right = str; 18 | m_delim = del; 19 | } 20 | 21 | StringTokenizer::~StringTokenizer() 22 | { 23 | 24 | } 25 | 26 | 27 | const char *StringTokenizer::next() 28 | { 29 | int index = m_right.FindOneOf(m_delim); 30 | 31 | while(index == 0) { 32 | m_right = m_right.Right(m_right.GetLength()-1); 33 | index = m_right.FindOneOf(m_delim); 34 | } 35 | if(index == -1) { 36 | if(m_right.IsEmpty()) 37 | return NULL; 38 | m_token = m_right; 39 | m_right.Empty(); 40 | return m_token; 41 | } 42 | 43 | m_token = m_right.Left(index); 44 | m_right = m_right.Right(m_right.GetLength()-(1+index)); 45 | 46 | return m_token; 47 | } 48 | -------------------------------------------------------------------------------- /src/win32/StringTokenizer.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_STRINGTOKENIZER_H__1AB4CD12_6B7A_49E4_A87F_75D3DC3FF20F__INCLUDED_) 2 | #define AFX_STRINGTOKENIZER_H__1AB4CD12_6B7A_49E4_A87F_75D3DC3FF20F__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | 8 | class StringTokenizer 9 | { 10 | public: 11 | const char * next(); 12 | StringTokenizer(CString str, CString token); 13 | virtual ~StringTokenizer(); 14 | 15 | private: 16 | CString m_token; 17 | CString m_delim; 18 | CString m_right; 19 | }; 20 | 21 | #endif // !defined(AFX_STRINGTOKENIZER_H__1AB4CD12_6B7A_49E4_A87F_75D3DC3FF20F__INCLUDED_) 22 | -------------------------------------------------------------------------------- /src/win32/Throttle.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "vba.h" 3 | #include "Throttle.h" 4 | 5 | #ifdef _DEBUG 6 | #define new DEBUG_NEW 7 | #undef THIS_FILE 8 | static char THIS_FILE[] = __FILE__; 9 | #endif 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // Throttle dialog 13 | 14 | 15 | Throttle::Throttle(CWnd* pParent /*=NULL*/) 16 | : CDialog(Throttle::IDD, pParent) 17 | { 18 | //{{AFX_DATA_INIT(Throttle) 19 | m_throttle = 0; 20 | //}}AFX_DATA_INIT 21 | } 22 | 23 | 24 | void Throttle::DoDataExchange(CDataExchange* pDX) 25 | { 26 | CDialog::DoDataExchange(pDX); 27 | //{{AFX_DATA_MAP(Throttle) 28 | DDX_Text(pDX, IDC_THROTTLE, m_throttle); 29 | //}}AFX_DATA_MAP 30 | } 31 | 32 | 33 | BEGIN_MESSAGE_MAP(Throttle, CDialog) 34 | //{{AFX_MSG_MAP(Throttle) 35 | ON_BN_CLICKED(ID_CANCEL, OnCancel) 36 | ON_BN_CLICKED(ID_OK, OnOk) 37 | //}}AFX_MSG_MAP 38 | END_MESSAGE_MAP() 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | // Throttle message handlers 42 | 43 | BOOL Throttle::OnInitDialog() 44 | { 45 | CDialog::OnInitDialog(); 46 | 47 | CenterWindow(); 48 | 49 | return TRUE; // return TRUE unless you set the focus to a control 50 | // EXCEPTION: OCX Property Pages should return FALSE 51 | } 52 | 53 | void Throttle::OnCancel() 54 | { 55 | EndDialog(false); 56 | } 57 | 58 | void Throttle::OnOk() 59 | { 60 | UpdateData(); 61 | 62 | if(m_throttle < 5 || m_throttle > 1000) 63 | systemMessage(IDS_INVALID_THROTTLE_VALUE, "Invalid throttle value. Please enter a number between 5 and 1000"); 64 | else 65 | EndDialog(m_throttle); 66 | } 67 | -------------------------------------------------------------------------------- /src/win32/Throttle.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_THROTTLE_H__5F03B6E9_0C43_4933_A7BC_1618428C2B7F__INCLUDED_) 2 | #define AFX_THROTTLE_H__5F03B6E9_0C43_4933_A7BC_1618428C2B7F__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // Throttle.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Throttle dialog 12 | 13 | class Throttle : public CDialog 14 | { 15 | // Construction 16 | public: 17 | Throttle(CWnd* pParent = NULL); // standard constructor 18 | 19 | // Dialog Data 20 | //{{AFX_DATA(Throttle) 21 | enum { IDD = IDD_THROTTLE }; 22 | int m_throttle; 23 | //}}AFX_DATA 24 | 25 | 26 | // Overrides 27 | // ClassWizard generated virtual function overrides 28 | //{{AFX_VIRTUAL(Throttle) 29 | protected: 30 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 31 | //}}AFX_VIRTUAL 32 | 33 | // Implementation 34 | protected: 35 | 36 | // Generated message map functions 37 | //{{AFX_MSG(Throttle) 38 | virtual BOOL OnInitDialog(); 39 | afx_msg void OnCancel(); 40 | afx_msg void OnOk(); 41 | //}}AFX_MSG 42 | DECLARE_MESSAGE_MAP() 43 | }; 44 | 45 | //{{AFX_INSERT_LOCATION}} 46 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 47 | 48 | #endif // !defined(AFX_THROTTLE_H__5F03B6E9_0C43_4933_A7BC_1618428C2B7F__INCLUDED_) 49 | -------------------------------------------------------------------------------- /src/win32/VBA.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEmu/VisualBoyAdvance-Core/9a002f0799208d4af08e01d8f666bc5d3ea80d9c/src/win32/VBA.rc -------------------------------------------------------------------------------- /src/win32/WavWriter.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "vba.h" 3 | #include "WavWriter.h" 4 | 5 | #include "../System.h" 6 | #include "../Util.h" 7 | 8 | #ifdef _DEBUG 9 | #undef THIS_FILE 10 | static char THIS_FILE[]=__FILE__; 11 | #define new DEBUG_NEW 12 | #endif 13 | 14 | ////////////////////////////////////////////////////////////////////// 15 | // Construction/Destruction 16 | ////////////////////////////////////////////////////////////////////// 17 | 18 | WavWriter::WavWriter() 19 | { 20 | m_file = NULL; 21 | m_len = 0; 22 | m_posSize = 0; 23 | } 24 | 25 | WavWriter::~WavWriter() 26 | { 27 | if(m_file) 28 | Close(); 29 | } 30 | 31 | void WavWriter::Close() 32 | { 33 | // calculate the total file length 34 | u32 len = ftell(m_file)-8; 35 | fseek(m_file, 4, SEEK_SET); 36 | u8 data[4]; 37 | utilPutDword(data, len); 38 | fwrite(data, 1, 4, m_file); 39 | // write out the size of the data section 40 | fseek(m_file, m_posSize, SEEK_SET); 41 | utilPutDword(data, m_len); 42 | fwrite(data, 1, 4, m_file); 43 | fclose(m_file); 44 | m_file = NULL; 45 | } 46 | 47 | bool WavWriter::Open(const char *name) 48 | { 49 | if(m_file) 50 | Close(); 51 | m_file = fopen(name, "wb"); 52 | 53 | if(!m_file) 54 | return false; 55 | // RIFF header 56 | u8 data[4] = { 'R', 'I', 'F', 'F' }; 57 | fwrite(data, 1, 4, m_file); 58 | utilPutDword(data, 0); 59 | // write 0 for now. Will get filled during close 60 | fwrite(data, 1, 4, m_file); 61 | // write WAVE header 62 | u8 data2[4] = { 'W', 'A', 'V', 'E' }; 63 | fwrite(data2, 1, 4, m_file); 64 | return true; 65 | } 66 | 67 | void WavWriter::SetFormat(const WAVEFORMATEX *format) 68 | { 69 | if(m_file == NULL) 70 | return; 71 | // write fmt header 72 | u8 data[4] = { 'f', 'm', 't', ' ' }; 73 | fwrite(data, 1, 4, m_file); 74 | u32 value = sizeof(WAVEFORMATEX); 75 | utilPutDword(data, value); 76 | fwrite(data, 1, 4, m_file); 77 | fwrite(format, 1, sizeof(WAVEFORMATEX), m_file); 78 | // start data header 79 | u8 data2[4] = { 'd', 'a', 't', 'a' }; 80 | fwrite(data2, 1, 4, m_file); 81 | 82 | m_posSize = ftell(m_file); 83 | // write 0 for data chunk size. Filled out during Close() 84 | utilPutDword(data, 0); 85 | fwrite(data, 1, 4, m_file); 86 | } 87 | 88 | void WavWriter::AddSound(const u8 *data, int len) 89 | { 90 | if(m_file == NULL) 91 | return; 92 | // write a block of sound data 93 | fwrite(data, 1, len, m_file); 94 | m_len += len; 95 | } 96 | -------------------------------------------------------------------------------- /src/win32/WavWriter.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_WAVWRITER_H__BE6C9DE9_60E7_4192_9797_8C7F55B3CE46__INCLUDED_) 2 | #define AFX_WAVWRITER_H__BE6C9DE9_60E7_4192_9797_8C7F55B3CE46__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | 8 | #include 9 | 10 | class WavWriter 11 | { 12 | private: 13 | FILE *m_file; 14 | int m_len; 15 | long m_posSize; 16 | 17 | public: 18 | WavWriter(); 19 | ~WavWriter(); 20 | 21 | bool Open(const char *name); 22 | void SetFormat(const WAVEFORMATEX *format); 23 | void AddSound(const u8 *data, int len); 24 | 25 | private: 26 | void Close(); 27 | }; 28 | 29 | #endif // !defined(AFX_WAVWRITER_H__BE6C9DE9_60E7_4192_9797_8C7F55B3CE46__INCLUDED_) 30 | -------------------------------------------------------------------------------- /src/win32/WinResUtil.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | static HINSTANCE winResGetInstance(LPCTSTR resType, LPCTSTR resName) 4 | { 5 | // TODO: make language DLL first 6 | return AfxFindResourceHandle(resName, resType); 7 | } 8 | 9 | 10 | UCHAR *winResGetResource(LPCTSTR resType, LPCTSTR resName) 11 | { 12 | HINSTANCE winResInstance = winResGetInstance(resType, resName); 13 | 14 | HRSRC hRsrc = FindResourceEx(winResInstance, resType, resName, 0); 15 | 16 | if(hRsrc != NULL) { 17 | HGLOBAL hGlobal = LoadResource(winResInstance, hRsrc); 18 | 19 | if(hGlobal != NULL) { 20 | UCHAR * b = (UCHAR *)LockResource(hGlobal); 21 | 22 | return b; 23 | } 24 | } 25 | return NULL; 26 | } 27 | 28 | HMENU winResLoadMenu(LPCTSTR menuName) 29 | { 30 | UCHAR * b = winResGetResource(RT_MENU, menuName); 31 | 32 | if(b != NULL) { 33 | HMENU menu = LoadMenuIndirect((CONST MENUTEMPLATE *)b); 34 | 35 | if(menu != NULL) 36 | return menu; 37 | } 38 | 39 | return LoadMenu(NULL, menuName); 40 | } 41 | 42 | int winResDialogBox(LPCTSTR boxName, 43 | HWND parent, 44 | DLGPROC dlgProc, 45 | LPARAM lParam) 46 | { 47 | /* 48 | UCHAR * b = winResGetResource(RT_DIALOG, boxName); 49 | 50 | if(b != NULL) { 51 | 52 | return DialogBoxIndirectParam(hInstance, 53 | (LPCDLGTEMPLATE)b, 54 | parent, 55 | dlgProc, 56 | lParam); 57 | } 58 | 59 | return DialogBoxParam(hInstance, 60 | boxName, 61 | parent, 62 | dlgProc, 63 | lParam); 64 | */ 65 | return 0; 66 | } 67 | 68 | int winResDialogBox(LPCTSTR boxName, 69 | HWND parent, 70 | DLGPROC dlgProc) 71 | { 72 | return winResDialogBox(boxName, 73 | parent, 74 | dlgProc, 75 | 0); 76 | } 77 | 78 | CString winResLoadString(UINT id) 79 | { 80 | int stId = id / 16 + 1; 81 | HINSTANCE inst = winResGetInstance(RT_STRING, MAKEINTRESOURCE(stId)); 82 | 83 | CString res; 84 | if(res.LoadString(id)) 85 | return res; 86 | 87 | // TODO: handle case where string is only in the default English 88 | res = ""; 89 | 90 | return res; 91 | } 92 | -------------------------------------------------------------------------------- /src/win32/WinResUtil.h: -------------------------------------------------------------------------------- 1 | extern HMENU winResLoadMenu(LPCTSTR menuName); 2 | 3 | extern int winResDialogBox(LPCTSTR boxName, 4 | HWND parent, 5 | DLGPROC dlgProc); 6 | 7 | extern int winResDialogBox(LPCTSTR boxName, 8 | HWND parent, 9 | DLGPROC dlgProc, 10 | LPARAM lParam); 11 | 12 | extern CString winResLoadString(UINT id); 13 | -------------------------------------------------------------------------------- /src/win32/XAudio2_Config.h: -------------------------------------------------------------------------------- 1 | #ifndef NO_XAUDIO2 2 | 3 | #pragma once 4 | 5 | 6 | class XAudio2_Config : public CDialog 7 | { 8 | DECLARE_DYNAMIC(XAudio2_Config) 9 | DECLARE_MESSAGE_MAP() 10 | 11 | public: 12 | UINT32 m_selected_device_index; 13 | UINT32 m_buffer_count; 14 | bool m_enable_upmixing; 15 | 16 | private: 17 | CComboBox m_combo_dev; 18 | CSliderCtrl m_slider_buffer; 19 | CStatic m_info_buffer; 20 | CButton m_check_upmix; 21 | 22 | 23 | public: 24 | XAudio2_Config(CWnd* pParent = NULL); // standard constructor 25 | virtual ~XAudio2_Config(); 26 | 27 | // Dialog Data 28 | enum { IDD = IDD_XAUDIO2_CONFIG }; 29 | 30 | virtual BOOL OnInitDialog(); 31 | afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 32 | 33 | protected: 34 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/win32/ZoomControl.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_ZOOMCONTROL_H__BC193230_D2D6_4240_93AE_28C2EF2C641A__INCLUDED_) 2 | #define AFX_ZOOMCONTROL_H__BC193230_D2D6_4240_93AE_28C2EF2C641A__INCLUDED_ 3 | 4 | #include "../System.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // ZoomControl.h : header file 9 | // 10 | #ifndef WM_COLINFO 11 | #define WM_COLINFO WM_APP+100 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // ZoomControl window 16 | 17 | class ZoomControl : public CWnd 18 | { 19 | // Construction 20 | public: 21 | ZoomControl(); 22 | 23 | // Attributes 24 | public: 25 | 26 | // Operations 27 | public: 28 | 29 | // Overrides 30 | // ClassWizard generated virtual function overrides 31 | //{{AFX_VIRTUAL(ZoomControl) 32 | //}}AFX_VIRTUAL 33 | 34 | // Implementation 35 | public: 36 | void setColors(const u8 *c); 37 | static bool isRegistered; 38 | virtual ~ZoomControl(); 39 | 40 | // Generated message map functions 41 | protected: 42 | //{{AFX_MSG(ZoomControl) 43 | afx_msg void OnPaint(); 44 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 45 | afx_msg BOOL OnEraseBkgnd(CDC* pDC); 46 | //}}AFX_MSG 47 | DECLARE_MESSAGE_MAP() 48 | private: 49 | int selected; 50 | u8 colors[3*64]; 51 | void registerClass(); 52 | }; 53 | 54 | ///////////////////////////////////////////////////////////////////////////// 55 | 56 | //{{AFX_INSERT_LOCATION}} 57 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 58 | 59 | #endif // !defined(AFX_ZOOMCONTROL_H__BC193230_D2D6_4240_93AE_28C2EF2C641A__INCLUDED_) 60 | -------------------------------------------------------------------------------- /src/win32/glfont.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef NO_OGL 4 | 5 | //********************************************************* 6 | //GLFONT.H -- Header for GLFONT.CPP 7 | //Copyright (c) 1998 Brad Fish 8 | //See glFont.txt for terms of use 9 | //November 10, 1998 10 | //********************************************************* 11 | 12 | #ifndef TRUE 13 | #define TRUE 1 14 | #endif 15 | 16 | #ifndef FALSE 17 | #define FALSE 0 18 | #endif 19 | 20 | //********************************************************* 21 | //Structures 22 | //********************************************************* 23 | 24 | //glFont character structure 25 | typedef struct 26 | { 27 | float dx, dy; 28 | float tx1, ty1; 29 | float tx2, ty2; 30 | } GLFONTCHAR; 31 | 32 | //glFont structure 33 | typedef struct 34 | { 35 | int Tex; 36 | int TexWidth, TexHeight; 37 | int IntStart, IntEnd; 38 | GLFONTCHAR *Char; 39 | } GLFONT; 40 | 41 | //********************************************************* 42 | //Function Declarations 43 | //********************************************************* 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | //Creates a glFont 48 | int glFontCreate(GLFONT *Font, char *Buffer, int Tex); 49 | 50 | //Deletes a glFont 51 | void glFontDestroy (GLFONT *Font); 52 | 53 | //Needs to be called before text output 54 | void glFontBegin (GLFONT *Font); 55 | 56 | //Needs to be called after text output 57 | void glFontEnd (void); 58 | 59 | //Draws text with a glFont 60 | void glFontTextOut (char *String, float x, float y, 61 | float z); 62 | //********************************************************* 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | //End of file 67 | 68 | #endif // NO_OGL 69 | -------------------------------------------------------------------------------- /src/win32/res/VBA.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEmu/VisualBoyAdvance-Core/9a002f0799208d4af08e01d8f666bc5d3ea80d9c/src/win32/res/VBA.ico -------------------------------------------------------------------------------- /src/win32/res/VBA.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // VBA.RC2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Add manually edited resources here... 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | -------------------------------------------------------------------------------- /src/win32/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /src/win32/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // make windows controls look newer / enable visual styles: 4 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' ""version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 5 | 6 | #ifndef VC_EXTRALEAN 7 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 8 | #endif 9 | 10 | #ifndef NO_STRICT 11 | #define STRICT 12 | #endif 13 | 14 | #include "targetver.h" 15 | 16 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 17 | 18 | // turns off MFC's hiding of some common and often safely ignored warning messages 19 | #define _AFX_ALL_WARNINGS 20 | 21 | #include // MFC core and standard components 22 | #include // MFC extensions 23 | 24 | 25 | #ifndef _AFX_NO_OLE_SUPPORT 26 | #include // MFC support for Internet Explorer 4 Common Controls 27 | #endif 28 | #ifndef _AFX_NO_AFXCMN_SUPPORT 29 | #include // MFC support for Windows Common Controls 30 | #endif // _AFX_NO_AFXCMN_SUPPORT 31 | -------------------------------------------------------------------------------- /src/win32/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // The following macros define the minimum required platform. The minimum required platform 4 | // is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run 5 | // your application. The macros work by enabling all features available on platform versions up to and 6 | // including the version specified. 7 | 8 | // Modify the following defines if you have to target a platform prior to the ones specified below. 9 | // Refer to MSDN for the latest info on corresponding values for different platforms. 10 | #ifndef WINVER // Specifies that the minimum required platform is Windows 2000. 11 | #define WINVER 0x0500 // Change this to the appropriate value to target other versions of Windows. 12 | #endif 13 | 14 | #ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows 2000. 15 | #define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows. 16 | #endif 17 | 18 | #ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. 19 | #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. 20 | #endif 21 | 22 | #ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 5.0. 23 | #define _WIN32_IE 0x0500 // Change this to the appropriate value to target other versions of IE. 24 | #endif // Actually, we don't care 25 | -------------------------------------------------------------------------------- /src/wx/bin2c.cmake: -------------------------------------------------------------------------------- 1 | # portably convert binary file to header 2 | FUNCTION(FILE2C INFILE VARNAME OUTFILE) 3 | FILE(READ ${INFILE} HEXFILE HEX) 4 | STRING(LENGTH ${HEXFILE} XRSLEN) 5 | SET(HEXPOS 0) 6 | FILE(WRITE ${OUTFILE} 7 | "/* generated from ${INFILE}; do not edit */\n" 8 | "const unsigned char ${VARNAME}[] = {") 9 | WHILE(${HEXPOS} LESS ${XRSLEN}) 10 | MATH(EXPR LPOS "${HEXPOS} % 32") 11 | IF(NOT ${LPOS}) 12 | FILE(APPEND ${OUTFILE} "\n") 13 | ENDIF(NOT ${LPOS}) 14 | STRING(SUBSTRING ${HEXFILE} ${HEXPOS} 2 HEXBYTE) 15 | FILE(APPEND ${OUTFILE} "0x${HEXBYTE}") 16 | MATH(EXPR HEXPOS "${HEXPOS} + 2") 17 | IF(${HEXPOS} LESS ${XRSLEN}) 18 | FILE(APPEND ${OUTFILE} ",") 19 | ENDIF(${HEXPOS} LESS ${XRSLEN}) 20 | ENDWHILE(${HEXPOS} LESS ${XRSLEN}) 21 | FILE(APPEND ${OUTFILE} "};\n") 22 | ENDFUNCTION(FILE2C) 23 | 24 | FILE2C(${INFILE} ${VARNAME} ${OUTFILE}) 25 | -------------------------------------------------------------------------------- /src/wx/copy-events.cmake: -------------------------------------------------------------------------------- 1 | # Create cmdtab.cpp, cmdhandlers.h, cmd-evtable.h from cmdevents.cpp 2 | 3 | IF(NOT OUTDIR) 4 | SET(OUTDIR ".") 5 | ENDIF(NOT OUTDIR) 6 | 7 | SET(CMDTAB "${OUTDIR}/cmdtab.cpp") 8 | SET(EVPROTO "${OUTDIR}/cmdhandlers.h") 9 | SET(EVTABLE "${OUTDIR}/cmd-evtable.h") 10 | 11 | FILE(READ cmdevents.cpp MW) 12 | STRING(REGEX MATCHALL "\nEVT_HANDLER([^\")]|\"[^\"]*\")*\\)" MW "${MW}") 13 | 14 | # cmdtab.cpp is a table of cmd-id-name/cmd-name pairs 15 | # sorted for binary searching 16 | FILE(WRITE "${CMDTAB}" "// Generated from cmdevents.cpp; do not edit\n#include \"wxvbam.h\"\n\nstruct cmditem cmdtab[] = {\n") 17 | SET(EVLINES ) 18 | FOREACH(EV ${MW}) 19 | # stripping the wxID_ makes it look better, but it's still all-caps 20 | STRING(REGEX REPLACE "^[^\"]*\\((wxID_|)([^,]*),[^\"]*(\"[^\"]*\")[^,)]*(,[^)]*|).*" 21 | " {wxT(\"\\2\"), wxTRANSLATE(\\3), XRCID(\"\\1\\2\")\\4 }" 22 | EV "${EV}") 23 | STRING(REGEX REPLACE "XRCID\\(\"(wxID_[^\"]*)\"\\)" "\\1" EV ${EV}) 24 | LIST(APPEND EVLINES "${EV},\n") 25 | ENDFOREACH(EV) 26 | LIST(SORT EVLINES) 27 | STRING(REGEX REPLACE ",\n\$" "\n" EVLINES "${EVLINES}") 28 | FILE(APPEND "${CMDTAB}" ${EVLINES}) 29 | FILE(APPEND "${CMDTAB}" "};\nconst int ncmds = sizeof(cmdtab) / sizeof(cmdtab[0]);\n") 30 | 31 | # cmdhandlers.h contains prototypes for all handlers 32 | FILE(WRITE "${EVPROTO}" "// Generated from cmdevents.cpp; do not edit\n") 33 | FOREACH(EV ${MW}) 34 | STRING(REGEX REPLACE "^[^\"]*\\(" "void On" P1 "${EV}") 35 | STRING(REGEX REPLACE ",.*" "(wxCommandEvent&);\n" P1 "${P1}") 36 | FILE(APPEND "${EVPROTO}" "${P1}") 37 | IF(EV MATCHES "EVT_HANDLER_MASK") 38 | STRING(REGEX REPLACE "^[^\"]*\\(" "void Do" P1 "${EV}") 39 | STRING(REGEX REPLACE ",.*" "();\n" P1 "${P1}") 40 | FILE(APPEND "${EVPROTO}" "${P1}") 41 | ENDIF(EV MATCHES "EVT_HANDLER_MASK") 42 | ENDFOREACH(EV) 43 | 44 | # cmd-evtable.h has the event table entries for all handlers 45 | FILE(WRITE "${EVTABLE}" "// Generated from cmdevents.cpp; do not edit\n") 46 | FOREACH(EV ${MW}) 47 | FILE(APPEND "${EVTABLE}" "EVT_MENU(") 48 | STRING(REGEX REPLACE "[^\"]*\\(" "" EV "${EV}") 49 | STRING(REGEX REPLACE ",.*" "" EV "${EV}") 50 | IF("${EV}" MATCHES "wx.*") 51 | FILE(APPEND "${EVTABLE}" "${EV}") 52 | ELSE("${EV}" MATCHES "wx.*") 53 | FILE(APPEND "${EVTABLE}" "XRCID(\"${EV}\")") 54 | ENDIF("${EV}" MATCHES "wx.*") 55 | FILE(APPEND "${EVTABLE}" ", MainFrame::On${EV})\n") 56 | ENDFOREACH(EV) 57 | -------------------------------------------------------------------------------- /src/wx/drawing.h: -------------------------------------------------------------------------------- 1 | #ifndef GAME_DRAWING_H 2 | #define GAME_DRAWING_H 3 | 4 | class BasicDrawingPanel : public DrawingPanel, public wxPanel 5 | { 6 | public: 7 | BasicDrawingPanel(wxWindow *parent, int _width, int _height); 8 | wxWindow *GetWindow() { return this; } 9 | void Delete() { Destroy(); } 10 | 11 | protected: 12 | void PaintEv2(wxPaintEvent &ev) { PaintEv(ev); } 13 | void DrawArea(wxWindowDC &dc); 14 | 15 | DECLARE_CLASS() 16 | DECLARE_EVENT_TABLE() 17 | }; 18 | 19 | #ifndef NO_OGL 20 | #include 21 | 22 | class GLDrawingPanel : public DrawingPanel, public wxGLCanvas 23 | { 24 | public: 25 | GLDrawingPanel(wxWindow *parent, int _width, int _height); 26 | virtual ~GLDrawingPanel(); 27 | wxWindow *GetWindow() { return this; } 28 | void Delete() { Destroy(); } 29 | 30 | protected: 31 | void PaintEv2(wxPaintEvent &ev) { PaintEv(ev); } 32 | void OnSize(wxSizeEvent &); 33 | void DrawArea(wxWindowDC &dc); 34 | #if wxCHECK_VERSION(2,9,0) || !defined(__WXMAC__) 35 | wxGLContext ctx; 36 | #endif 37 | bool did_init; 38 | void Init(); 39 | GLuint texid, vlist; 40 | int texsize; 41 | 42 | DECLARE_CLASS() 43 | DECLARE_EVENT_TABLE() 44 | }; 45 | #endif 46 | 47 | #if defined(__WXMSW__) && !defined(NO_D3D) 48 | class DXDrawingPanel : public DrawingPanel, public wxPanel 49 | { 50 | public: 51 | DXDrawingPanel(wxWindow *parent, int _width, int _height); 52 | wxWindow *GetWindow() { return this; } 53 | void Delete() { Destroy(); } 54 | 55 | protected: 56 | void PaintEv2(wxPaintEvent &ev) { PaintEv(ev); } 57 | void DrawArea(wxWindowDC&); 58 | bool did_init; 59 | void Init(); 60 | 61 | DECLARE_CLASS() 62 | DECLARE_EVENT_TABLE() 63 | }; 64 | #endif 65 | 66 | #ifndef NO_CAIRO 67 | #include 68 | 69 | class CairoDrawingPanel : public DrawingPanel, public wxPanel 70 | { 71 | public: 72 | CairoDrawingPanel(wxWindow *parent, int _width, int _height); 73 | ~CairoDrawingPanel(); 74 | wxWindow *GetWindow() { return this; } 75 | void Delete() { Destroy(); } 76 | 77 | protected: 78 | void PaintEv2(wxPaintEvent &ev) { PaintEv(ev); } 79 | void DrawArea(wxWindowDC&); 80 | cairo_surface_t *conv_surf; 81 | 82 | DECLARE_CLASS() 83 | DECLARE_EVENT_TABLE() 84 | }; 85 | #endif 86 | 87 | #endif /* GAME_DRAWING_H */ 88 | -------------------------------------------------------------------------------- /src/wx/widgets/wx/webupdatedef.h: -------------------------------------------------------------------------------- 1 | // dummy webupdatedef.h for checklistctrl 2 | #ifndef WXDLLIMPEXP_WEBUPDATE 3 | // this will never be part of a DLL 4 | #define WXDLLIMPEXP_WEBUPDATE 5 | // why would I include it and not enable it? 6 | #define wxUSE_CHECKEDLISTCTRL 1 7 | // enable customizations: 8 | // - include wx/settings.h (bugfix; always enabled) 9 | // - make a dynamic class so it can be subclass in xrc 10 | // - only make col0 checkable 11 | // - use "native" checkbox (also requires CLC_USE_SYSICONS) 12 | #define CLC_VBAM_USAGE 1 13 | #define CLC_USE_SYSICONS 1 14 | #endif 15 | -------------------------------------------------------------------------------- /src/wx/wxvbam.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Name=VBA-M 5 | GenericName=GameBoy Advance Emulator 6 | Comment=Nindendo GameBoy Advance Emulator 7 | Exec=wxvbam 8 | Icon=vbam 9 | Categories=Game;Emulator; -------------------------------------------------------------------------------- /src/wx/wxvbam.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenEmu/VisualBoyAdvance-Core/9a002f0799208d4af08e01d8f666bc5d3ea80d9c/src/wx/wxvbam.rc --------------------------------------------------------------------------------