├── .github └── workflows │ └── build_with_visualstudio.yml ├── .gitignore ├── GNUmakefile ├── README ├── build ├── 3rdparty │ ├── 3rdparty.props │ ├── 3rdparty.sln │ ├── libxml2.vcxproj │ ├── libxml2.vcxproj.filters │ └── xmlres_without_fontmap.patch ├── components.mk ├── custom.mk ├── detectsys.py ├── executils.py ├── flavour-debug.mk ├── flavour-devel.mk ├── flavour-opt.mk ├── info2code.mk ├── main.mk ├── makeutils.py ├── msvc │ ├── genconfig.py │ ├── sed │ │ ├── libiconv2.dll │ │ ├── libintl3.dll │ │ ├── readme.txt │ │ └── sed.exe │ ├── wxCatapult.sln │ ├── wxCatapult.vcxproj │ └── wxCatapult.vcxproj.filters ├── msysutils.py ├── outpututils.py ├── platform-darwin.mk ├── platform-freebsd.mk ├── platform-gnu.mk ├── platform-linux.mk ├── platform-mingw32.mk ├── platform-netbsd.mk ├── platform-openbsd.mk ├── platform-solaris.mk ├── probe-results.mk ├── probe.mk ├── version.mk ├── version.py ├── version2code.py ├── win_resource.py └── wxg2xrc.sed ├── desktop └── openMSX-Catapult.desktop ├── dialogs ├── about.wxg ├── audiocontrols.wxg ├── catapult.wxg ├── checkconfigs.wxg ├── config.wxg ├── fullscreen.wxg ├── input.wxg ├── ipsselect.wxg ├── misccontrols.wxg ├── romtype.wxg ├── screenshot.wxg ├── session.wxg ├── status.wxg └── videocontrols.wxg ├── doc ├── ChangeLog ├── ChangeLog.old ├── GPL.txt ├── authors.txt ├── manual │ ├── audio.png │ ├── compile.html │ ├── index.html │ ├── input.png │ ├── mainscreen.png │ ├── manual-minty.css │ ├── manual-purple.css │ ├── manual.css │ ├── misc.png │ ├── session.png │ ├── status.png │ ├── user.html │ └── video.png ├── release-history.txt ├── release-notes.txt └── release-process.txt ├── resources └── bitmaps │ ├── about.png │ ├── diskimage.png │ ├── eject.png │ ├── file.png │ ├── harddisk.png │ ├── ledoff.png │ ├── ledon.png │ ├── openMSX-Catapult-logo.xcf │ ├── romimage.png │ └── tapeimage.png └── src ├── AboutDlg.cpp ├── AboutDlg.h ├── AudioControlPage.cpp ├── AudioControlPage.h ├── CatapultConfigDlg.cpp ├── CatapultConfigDlg.h ├── CatapultPage.cpp ├── CatapultPage.h ├── CatapultXMLParser.cpp ├── CatapultXMLParser.h ├── CheckConfigsDlg.cpp ├── CheckConfigsDlg.h ├── ConfigurationData.cpp ├── ConfigurationData.h ├── FullScreenDlg.cpp ├── FullScreenDlg.h ├── IPSSelectionDlg.cpp ├── IPSSelectionDlg.h ├── InputPage.cpp ├── InputPage.h ├── MiscControlPage.cpp ├── MiscControlPage.h ├── PipeConnectThread.cpp ├── PipeConnectThread.h ├── PipeReadThread.cpp ├── PipeReadThread.h ├── RomTypeDlg.cpp ├── RomTypeDlg.h ├── ScreenShotDlg.cpp ├── ScreenShotDlg.h ├── SessionPage.cpp ├── SessionPage.h ├── StatusPage.cpp ├── StatusPage.h ├── Version.cpp ├── Version.h ├── VideoControlPage.cpp ├── VideoControlPage.h ├── catapult.ico ├── catapult.rc ├── catapult.xpm ├── openMSXController.cpp ├── openMSXController.h ├── resource.h ├── utils.cpp ├── utils.h ├── wxCatapultApp.cpp ├── wxCatapultApp.h ├── wxCatapultFrm.cpp └── wxCatapultFrm.h /.github/workflows/build_with_visualstudio.yml: -------------------------------------------------------------------------------- 1 | name: Visual Studio build 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | 9 | jobs: 10 | build: 11 | runs-on: windows-latest 12 | 13 | steps: 14 | - name: Get current code from Git repo 15 | uses: actions/checkout@v3 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Add MSBuild to PATH 20 | uses: microsoft/setup-msbuild@v1.1.3 21 | 22 | - name: Cache 3rdparty libs 23 | id: cache-3rdparty 24 | uses: actions/cache@v3 25 | with: 26 | path: | 27 | derived/3rdparty 28 | derived/*/3rdparty 29 | key: ${{ github.ref }}-${{ hashFiles('build/3rdparty/3rdparty.props') }} 30 | 31 | - name: Install prerequisites (wget) 32 | if: steps.cache-3rdparty.outputs.cache-hit != 'true' 33 | run: choco install wget 34 | 35 | - name: Get 3rdparty source code 36 | if: steps.cache-3rdparty.outputs.cache-hit != 'true' 37 | run: | 38 | wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.1/wxWidgets-3.2.1.7z 39 | wget https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.9.14/libxml2-v2.9.14.zip 40 | 41 | - name: Extract 3rdparty source code 42 | if: steps.cache-3rdparty.outputs.cache-hit != 'true' 43 | shell: cmd 44 | run: | 45 | mkdir derived\3rdparty\src 46 | cd derived\3rdparty\src 47 | 7z x ${{ github.workspace }}\libxml2-v2.9.14.zip 48 | 7z x ${{ github.workspace }}\wxWidgets-3.2.1.7z -o"wxWidgets-3.2.1" 49 | 50 | - name: Build 3rdparty stuff 51 | if: steps.cache-3rdparty.outputs.cache-hit != 'true' 52 | run: msbuild -p:Configuration="Unicode Release" -p:Platform=x64 build\3rdparty\3rdparty.sln 53 | 54 | - name: Set up developer prompt for nmake use to build wxWidgets libs 55 | if: steps.cache-3rdparty.outputs.cache-hit != 'true' 56 | uses: ilammy/msvc-dev-cmd@v1 57 | 58 | - name: Build wxWidgets libs 59 | if: steps.cache-3rdparty.outputs.cache-hit != 'true' 60 | shell: cmd 61 | run: | 62 | cd derived\3rdparty\src\wxWidgets-3.2.1\build\msw 63 | nmake /f makefile.vc BUILD=release TARGET_CPU=X64 RUNTIME_LIBS=static 64 | 65 | - name: Install wxWidgets libs 66 | if: steps.cache-3rdparty.outputs.cache-hit != 'true' 67 | shell: cmd 68 | run: | 69 | mkdir derived\x64-VC-Unicode Release\3rdparty\install\lib\ 70 | cd derived\x64-VC-Unicode Release\3rdparty\install\lib\ 71 | xcopy "${{ github.workspace }}\derived\3rdparty\src\wxWidgets-3.2.1\lib\vc_x64_lib" . /y 72 | 73 | - name: Build Catapult 74 | run: msbuild -p:Configuration="Unicode Release" -p:Platform=x64 build\msvc\wxCatapult.sln /m 75 | 76 | - name: Determine version and redistributable paths and names 77 | shell: bash 78 | id: catapult 79 | run: | 80 | CATAPULT_VERSION=`python3 build/version.py` 81 | echo "version=$CATAPULT_VERSION" >> $GITHUB_OUTPUT 82 | echo "target_file=catapult-$CATAPULT_VERSION-Windows-VC-x64-bin" >> $GITHUB_OUTPUT 83 | echo "target_file_pdb=catapult-$CATAPULT_VERSION-Windows-VC-x64-pdb" >> $GITHUB_OUTPUT 84 | 85 | - name: Prepare redistributable 86 | shell: bash 87 | run: | 88 | mkdir -p derived/dist/Catapult 89 | mkdir derived/dist/Catapult/bin 90 | cp "derived/x64-VC-Unicode Release/install/catapult.exe" derived/dist/Catapult/bin 91 | cp -r doc derived/dist/Catapult 92 | cp -r resources derived/dist/Catapult 93 | cp -r "derived/x64-VC-Unicode Release/install/dialogs" derived/dist/Catapult/resources 94 | mkdir derived/dist/Catapult/resources/icons 95 | cp src/catapult.xpm derived/dist/Catapult/resources/icons 96 | cp README derived/dist/Catapult/doc 97 | 98 | - name: Upload Windows VC redistributable 99 | uses: actions/upload-artifact@v3 100 | with: 101 | name: ${{ steps.catapult.outputs.target_file }}.zip 102 | path: derived/dist 103 | 104 | - name: Upload Windows VC debug symbols 105 | uses: actions/upload-artifact@v3 106 | with: 107 | name: ${{ steps.catapult.outputs.target_file_pdb }}.zip 108 | path: derived/**/*.pdb 109 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.cproject 2 | /.project 3 | /derived 4 | /*.diff 5 | /*.log 6 | *.swp 7 | *~ 8 | *.suo 9 | *.sdf 10 | *.opensdf 11 | *.ipch 12 | build/3rdparty/vc_mswd/* 13 | core.* 14 | core 15 | *.pyc 16 | -------------------------------------------------------------------------------- /GNUmakefile: -------------------------------------------------------------------------------- 1 | include build/main.mk 2 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | openMSX Catapult - the GUI for openMSX 3 | ---------------------------------------------------------------------------- 4 | 5 | openMSX Catapult is an optional part (a subproject) of openMSX, the MSX 6 | emulator that aims for perfection. With Catapult you can control openMSX via 7 | a graphical user interface. A release of Catapult is compatible with the 8 | current release of openMSX. The project is not being developed anymore, but we 9 | will try to keep it working to make working with openMSX more convenient. We do 10 | have plans to migrate openMSX to a set of libraries that support a native GUI. 11 | 12 | Although the program should be self explanatory, we included a set of HTML 13 | manuals, that tell how you can compile the program (if you want or need to) 14 | and how to use Catapult with openMSX. To understand what all options mean 15 | and to get a better feeling of what openMSX is, we also recommend to read the 16 | documentation of openMSX. 17 | 18 | You can read what has changed in this and the previous releases in the 19 | release notes. You can find the release notes of this release in the file 20 | 'release-notes.txt' in the directory 'doc'. Highlights of previous releases 21 | can be found in 'release-history.txt'. 22 | 23 | All source code and other works that are part of, or distributed with 24 | Catapult are copyrighted by their respective authors. The file 'AUTHORS' 25 | contains a list of people who made works for Catapult or contributed works to 26 | Catapult. 27 | 28 | Some source files may contain a license notice; all other source files are 29 | licensed under the GNU Public License (GPL), of which you can find a copy in 30 | the file 'GPL'. If you got a binary release of openMSX Catapult and are 31 | interested in the sources, please visit our home page: 32 | http://openmsx.org/ 33 | 34 | Happy MSX-ing! 35 | the openMSX developers 36 | -------------------------------------------------------------------------------- /build/3rdparty/3rdparty.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ..\.. 5 | ..\..\derived 6 | $(Platform)-VC-$(Configuration) 7 | $(DerivedDir)\$(BuildFlavor) 8 | $(DerivedDir)\3rdparty\src 9 | $(BuildDir)\3rdparty 10 | $(ThirdPartyBuildDir)\build 11 | $(ThirdPartyBuildDir)\install\lib 12 | $(BuildDir)\build 13 | $(BuildDir)\install 14 | $(BuildDir)\config 15 | libxml2-v2.9.14 16 | wxWidgets-3.2.1 17 | 18 | 19 | <_ProjectFileVersion>10.0.30319.1 20 | <_PropertySheetDisplayName>Thirdparty 21 | 22 | 23 | 24 | $(CatapultRootDir) 25 | true 26 | 27 | 28 | $(DerivedDir) 29 | true 30 | 31 | 32 | $(BuildFlavor) 33 | true 34 | 35 | 36 | $(BuildDir) 37 | true 38 | 39 | 40 | $(ThirdPartySrcDir) 41 | true 42 | 43 | 44 | $(ThirdPartyBuildDir) 45 | true 46 | 47 | 48 | $(ThirdPartyIntDir) 49 | true 50 | 51 | 52 | $(ThirdPartyOutDir) 53 | true 54 | 55 | 56 | $(CatapultIntDir) 57 | true 58 | 59 | 60 | $(CatapultOutDir) 61 | true 62 | 63 | 64 | $(CatapultConfigDir) 65 | true 66 | 67 | 68 | $(LibNameLibXml) 69 | true 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /build/3rdparty/3rdparty.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30128.74 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "libxml2.vcxproj", "{459F9609-4CE3-461B-A087-DE03F5140D9D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | Unicode Debug|Win32 = Unicode Debug|Win32 15 | Unicode Debug|x64 = Unicode Debug|x64 16 | Unicode Release|Win32 = Unicode Release|Win32 17 | Unicode Release|x64 = Unicode Release|x64 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Debug|Win32.ActiveCfg = Unicode Debug|Win32 21 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Debug|Win32.Build.0 = Unicode Debug|Win32 22 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Debug|x64.ActiveCfg = Unicode Debug|x64 23 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Debug|x64.Build.0 = Unicode Debug|x64 24 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Release|Win32.ActiveCfg = Unicode Release|Win32 25 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Release|Win32.Build.0 = Unicode Release|Win32 26 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Release|x64.ActiveCfg = Unicode Release|x64 27 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Release|x64.Build.0 = Unicode Release|x64 28 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 29 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 30 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Unicode Debug|x64.ActiveCfg = Unicode Debug|x64 31 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Unicode Debug|x64.Build.0 = Unicode Debug|x64 32 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 33 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 34 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Unicode Release|x64.ActiveCfg = Unicode Release|x64 35 | {459F9609-4CE3-461B-A087-DE03F5140D9D}.Unicode Release|x64.Build.0 = Unicode Release|x64 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | GlobalSection(ExtensibilityGlobals) = postSolution 41 | SolutionGuid = {AA9DD90D-3B9B-456E-94A4-0A0DAD7D88C9} 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /build/3rdparty/libxml2.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;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 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | Source Files 70 | 71 | 72 | Source Files 73 | 74 | 75 | Source Files 76 | 77 | 78 | Source Files 79 | 80 | 81 | Source Files 82 | 83 | 84 | Source Files 85 | 86 | 87 | Source Files 88 | 89 | 90 | Source Files 91 | 92 | 93 | Source Files 94 | 95 | 96 | Source Files 97 | 98 | 99 | Source Files 100 | 101 | 102 | Source Files 103 | 104 | 105 | Source Files 106 | 107 | 108 | Source Files 109 | 110 | 111 | Source Files 112 | 113 | 114 | Source Files 115 | 116 | 117 | Source Files 118 | 119 | 120 | Source Files 121 | 122 | 123 | Source Files 124 | 125 | 126 | Source Files 127 | 128 | 129 | Source Files 130 | 131 | 132 | Source Files 133 | 134 | 135 | Source Files 136 | 137 | 138 | Source Files 139 | 140 | 141 | Source Files 142 | 143 | 144 | Source Files 145 | 146 | 147 | 148 | 149 | Header Files 150 | 151 | 152 | Header Files 153 | 154 | 155 | Header Files 156 | 157 | 158 | Header Files 159 | 160 | 161 | Header Files 162 | 163 | 164 | Header Files 165 | 166 | 167 | Header Files 168 | 169 | 170 | Header Files 171 | 172 | 173 | Header Files 174 | 175 | 176 | Header Files 177 | 178 | 179 | Header Files 180 | 181 | 182 | Header Files 183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /build/3rdparty/xmlres_without_fontmap.patch: -------------------------------------------------------------------------------- 1 | --- xmlres.cpp Sat Sep 29 19:07:10 2007 2 | +++ xmlresPATCHED.cpp Thu Aug 30 10:05:16 2007 3 | @@ -1336,6 +1336,7 @@ 4 | 5 | wxString facename; 6 | bool hasFacename = HasParam(wxT("face")); 7 | +#if wxUSE_FONTMAP 8 | if (hasFacename) 9 | { 10 | wxString faces = GetParamValue(wxT("face")); 11 | @@ -1352,9 +1353,11 @@ 12 | } 13 | } 14 | } 15 | +#endif 16 | 17 | // encoding 18 | wxFontEncoding enc = wxFONTENCODING_DEFAULT; 19 | +#if wxUSE_FONTMAP 20 | bool hasEncoding = HasParam(wxT("encoding")); 21 | if (hasEncoding) 22 | { 23 | @@ -1365,6 +1368,7 @@ 24 | if (enc == wxFONTENCODING_SYSTEM) 25 | enc = wxFONTENCODING_DEFAULT; 26 | } 27 | +#endif 28 | 29 | // is this font based on a system font? 30 | wxFont sysfont = GetSystemFont(GetParamValue(wxT("sysfont"))); 31 | @@ -1385,10 +1389,12 @@ 32 | sysfont.SetUnderlined(underlined); 33 | if (hasFamily) 34 | sysfont.SetFamily(ifamily); 35 | +#if wxUSE_FONTMAP 36 | if (hasFacename) 37 | sysfont.SetFaceName(facename); 38 | if (hasEncoding) 39 | sysfont.SetDefaultEncoding(enc); 40 | +#endif 41 | 42 | m_node = oldnode; 43 | return sysfont; 44 | -------------------------------------------------------------------------------- /build/components.mk: -------------------------------------------------------------------------------- 1 | # Defines the building blocks of Catapult and their dependencies. 2 | 3 | ifneq ($(PROBE_MAKE_INCLUDED),true) 4 | $(error Include probe results before including "components.mk") 5 | endif 6 | 7 | CORE_LIBS:=WX XRC XML 8 | ifneq ($(filter x,$(foreach LIB,$(CORE_LIBS),x$(HAVE_$(LIB)_LIB))),) 9 | COMPONENT_CORE:=false 10 | endif 11 | ifneq ($(filter x,$(foreach LIB,$(CORE_LIBS),x$(HAVE_$(LIB)_H))),) 12 | COMPONENT_CORE:=false 13 | endif 14 | COMPONENT_CORE?=true 15 | 16 | -------------------------------------------------------------------------------- /build/custom.mk: -------------------------------------------------------------------------------- 1 | # This file contains user-adjustable settings for the build and installation 2 | # process. 3 | 4 | # Directory to install to. 5 | # Catapult is always installed into a single self-contained directory. 6 | # But you can change that directory to for example /usr/local/openMSX-Catapult 7 | # or /usr/games/openMSX-Catapult if you like. 8 | INSTALL_BASE:=/opt/openMSX-Catapult 9 | 10 | # Create a symbolic link to the installed binary? 11 | # This link is placed in a location that is typically in a user's path: 12 | # /usr/local/bin for system-wide installs and ~/bin for personal installs. 13 | SYMLINK_FOR_BINARY:=true 14 | 15 | # Locations for openMSX binaries and share directory 16 | # these are suggested as initial values when you run catapult 17 | # for the first time 18 | CATAPULT_OPENMSX_BINARY:=/opt/openMSX/bin/openmsx 19 | CATAPULT_OPENMSX_SHARE:=/opt/openMSX/share 20 | -------------------------------------------------------------------------------- /build/detectsys.py: -------------------------------------------------------------------------------- 1 | # Detect the native OS. 2 | # Actually we rely on the Python "platform" module and map its output to names 3 | # that the Catapult build understands. 4 | 5 | from platform import machine, python_version, system 6 | import sys 7 | 8 | def detectOS(): 9 | '''Detects the operating system of the machine were are running on. 10 | Raises ValueError if no known OS is detected. 11 | ''' 12 | os = system().lower() 13 | if os in ('linux', 'darwin', 'freebsd', 'netbsd', 'openbsd', 'gnu'): 14 | return os 15 | elif os.startswith('gnu/'): 16 | # GNU userland on non-Hurd kernel, for example Debian GNU/kFreeBSD. 17 | # For openMSX the kernel is not really relevant, so treat it like 18 | # a generic GNU system. 19 | return 'gnu' 20 | elif os.startswith('mingw') or os == 'windows': 21 | return 'mingw32' 22 | elif os == 'sunos': 23 | return 'solaris' 24 | elif os == '': 25 | # Python couldn't figure it out. 26 | raise ValueError('Unable to detect OS') 27 | else: 28 | raise ValueError('Unsupported or unrecognised OS "%s"' % os) 29 | 30 | if __name__ == '__main__': 31 | try: 32 | print( 33 | ' Using Python %s native system detection...' % python_version(), 34 | file=sys.stderr 35 | ) 36 | hostOS = detectOS() 37 | print(' Detected OS: %s' % (hostOS,), file=sys.stderr) 38 | print('CATAPULT_TARGET_OS=%s' % hostOS) 39 | except ValueError as ex: 40 | print(ex, file=sys.stderr) 41 | sys.exit(1) 42 | -------------------------------------------------------------------------------- /build/executils.py: -------------------------------------------------------------------------------- 1 | from msysutils import msysActive, msysShell 2 | 3 | from os import environ 4 | from shlex import split as shsplit 5 | from subprocess import PIPE, Popen 6 | 7 | def captureStdout(log, commandLine): 8 | '''Run a command and capture what it writes to stdout. 9 | If the command fails or writes something to stderr, that is logged. 10 | Returns the captured string, or None if the command failed. 11 | ''' 12 | # TODO: This is a modified copy-paste from compilers._Command. 13 | commandParts = shsplit(commandLine) 14 | env = dict(environ) 15 | env['LC_ALL'] = 'C.UTF-8' 16 | while commandParts: 17 | if '=' in commandParts[0]: 18 | name, value = commandParts[0].split('=', 1) 19 | del commandParts[0] 20 | env[name] = value 21 | else: 22 | break 23 | else: 24 | raise ValueError( 25 | 'No command specified in "%s"' % commandLine 26 | ) 27 | 28 | if msysActive() and commandParts[0] != 'sh': 29 | commandParts = [ 30 | msysShell(), '-c', shjoin(commandParts) 31 | ] 32 | 33 | try: 34 | proc = Popen( 35 | commandParts, bufsize = -1, env = env, 36 | stdin = None, stdout = PIPE, stderr = PIPE, 37 | ) 38 | except OSError as ex: 39 | print('Failed to execute "%s": %s' % (commandLine, ex), file=log) 40 | return None 41 | stdoutdata, stderrdata = proc.communicate() 42 | if stderrdata: 43 | severity = 'warning' if proc.returncode == 0 else 'error' 44 | log.write('%s executing "%s"\n' % (severity.capitalize(), commandLine)) 45 | # pylint 0.18.0 somehow thinks stderrdata is a list, not a string. 46 | # pylint: disable-msg=E1103 47 | stderrdata = stderrdata.decode('utf-8').replace('\r', '') 48 | log.write(stderrdata) 49 | if not stderrdata.endswith('\n'): 50 | log.write('\n') 51 | if proc.returncode == 0: 52 | return stdoutdata.decode('utf-8') 53 | else: 54 | print('Execution failed with exit code %d' % proc.returncode, file=log) 55 | return None 56 | 57 | def shjoin(parts): 58 | '''Joins the given sequence into a single string with space as a separator. 59 | Characters that have a special meaning for the shell are escaped. 60 | This is the counterpart of shlex.split(). 61 | ''' 62 | def escape(part): 63 | return ''.join( 64 | '\\' + ch if ch in '\\ \'"$()[]' else ch 65 | for ch in part 66 | ) 67 | return ' '.join(escape(part) for part in parts) 68 | -------------------------------------------------------------------------------- /build/flavour-debug.mk: -------------------------------------------------------------------------------- 1 | # Configuration for "debug" flavour: 2 | # Build with all debugging info, no optimisations. 3 | 4 | # Debug flags. 5 | CXXFLAGS+=-O0 -g -DDEBUG 6 | 7 | # Strip executable? 8 | CATAPULT_STRIP:=false 9 | -------------------------------------------------------------------------------- /build/flavour-devel.mk: -------------------------------------------------------------------------------- 1 | # Configuration for "debug" flavour: 2 | # Build with all debugging info, no optimisations. 3 | 4 | # Debug flags. 5 | CXXFLAGS+=-O2 -g -DDEBUG 6 | 7 | # Strip executable? 8 | CATAPULT_STRIP:=false 9 | -------------------------------------------------------------------------------- /build/flavour-opt.mk: -------------------------------------------------------------------------------- 1 | # Generic optimisation flavour: 2 | # does not target any specific CPU. 3 | 4 | # Optimisation flags. 5 | CXXFLAGS+=-O3 -DNDEBUG \ 6 | -ffast-math -funroll-loops 7 | 8 | # Strip executable? 9 | CATAPULT_STRIP:=true 10 | -------------------------------------------------------------------------------- /build/info2code.mk: -------------------------------------------------------------------------------- 1 | # Write build info to C++ constants, so source can access it. 2 | # Advantages of this approach: 3 | # - file dates used for dependency checks (as opposed to "-D" compile flag) 4 | # - inactive code is still checked by compiler (as opposed to "#if") 5 | 6 | $(CONFIG_HEADER): $(MAKE_PATH)/info2code.mk $(CUSTOM_MAKE) 7 | @echo "Creating $@..." 8 | @mkdir -p $(@D) 9 | @echo "// Automatically generated by build process." > $@ 10 | @echo "" >> $@ 11 | @echo "#ifndef CONFIG_H" >> $@ 12 | @echo "#define CONFIG_H" >> $@ 13 | @echo "" >> $@ 14 | @echo "#include " >> $@ 15 | @echo "" >> $@ 16 | @echo "#ifndef __WXMSW__" >> $@ 17 | @echo "static const wxString RESOURCEDIR = wxT(\"$(INSTALL_BASE)/resources\");" >> $@ 18 | @echo "static const wxString CATAPULT_OPENMSX_BINARY = wxT(\"$(CATAPULT_OPENMSX_BINARY)\");" >> $@ 19 | @echo "static const wxString CATAPULT_OPENMSX_SHARE = wxT(\"$(CATAPULT_OPENMSX_SHARE)\");" >> $@ 20 | @echo "#endif" >> $@ 21 | @echo "" >> $@ 22 | @echo "#endif" >> $@ 23 | 24 | $(VERSION_HEADER): forceversionextraction $(MAKE_PATH)/info2code.mk $(MAKE_PATH)/version.mk 25 | @echo "Creating $@..." 26 | @mkdir -p $(@D) 27 | @echo "// Automatically generated by build process." > $@ 28 | @echo "" >> $@ 29 | @echo "const bool Version::RELEASE = $(RELEASE_FLAG);" >> $@ 30 | @echo "const std::string Version::VERSION = \"$(PACKAGE_VERSION)\";" >> $@ 31 | @echo "const std::string Version::REVISION = \"$(REVISION)\";" >> $@ 32 | 33 | -------------------------------------------------------------------------------- /build/makeutils.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | def filterLines(lines, regex): 4 | '''Filters each line of the given line iterator using the given regular 5 | expression string. For each match, a tuple containing the text matching 6 | each capture group from the regular expression is yielded. 7 | ''' 8 | matcher = re.compile(regex) 9 | for line in lines: 10 | if line.endswith('\n'): 11 | line = line[ : -1] 12 | match = matcher.match(line) 13 | if match: 14 | yield match.groups() 15 | 16 | def filterFile(filePath, regex): 17 | '''Filters each line of the given text file using the given regular 18 | expression string. For each match, a tuple containing the text matching 19 | each capture group from the regular expression is yielded. 20 | ''' 21 | inp = open(filePath, 'r') 22 | try: 23 | for groups in filterLines(inp, regex): 24 | yield groups 25 | finally: 26 | inp.close() 27 | 28 | def joinContinuedLines(lines): 29 | '''Iterates through the given lines, replacing lines that are continued 30 | using a trailing backslash with a single line. 31 | ''' 32 | buf = '' 33 | for line in lines: 34 | if line.endswith('\\\n'): 35 | buf += line[ : -2] 36 | elif line.endswith('\\'): 37 | buf += line[ : -1] 38 | else: 39 | yield buf + line 40 | buf = '' 41 | if buf: 42 | raise ValueError('Continuation on last line') 43 | 44 | def extractMakeVariables(filePath): 45 | '''Extract all variable definitions from the given Makefile. 46 | Returns a dictionary that maps each variable name to its value. 47 | ''' 48 | makeVars = {} 49 | inp = open(filePath, 'r') 50 | try: 51 | for name, value in filterLines( 52 | joinContinuedLines(inp), 53 | r'[ ]*([A-Za-z0-9_]+)[ ]*:=(.*)' 54 | ): 55 | makeVars[name] = value.strip() 56 | finally: 57 | inp.close() 58 | return makeVars 59 | 60 | def parseBool(valueStr): 61 | '''Parses a string containing a boolean value. 62 | Accepted values are "true" and "false"; anything else raises ValueError. 63 | ''' 64 | if valueStr == 'true': 65 | return True 66 | elif valueStr == 'false': 67 | return False 68 | else: 69 | raise ValueError('Invalid boolean "%s"' % valueStr) 70 | -------------------------------------------------------------------------------- /build/msvc/genconfig.py: -------------------------------------------------------------------------------- 1 | # Generates configuration headers for VC++ builds 2 | 3 | import sys 4 | import os.path 5 | import outpututils 6 | import win_resource 7 | import version2code 8 | 9 | # 10 | # platform: one of { Win32, x64 } 11 | # configuration: one of { Debug, Developer, Release } 12 | # outputPath: the location in which to generate config files 13 | # 14 | def genConfig(platform, configuration, outputPath): 15 | 16 | # 17 | # resource-info.hh 18 | # 19 | resourceInfoHeader = os.path.join(outputPath, 'resource-info.h') 20 | generator = win_resource.iterResourceHeader() 21 | outpututils.rewriteIfChanged(resourceInfoHeader, generator) 22 | 23 | # 24 | # version.ii 25 | # 26 | versionHeader = os.path.join(outputPath, 'version.ii') 27 | generator = version2code.iterVersionInclude() 28 | outpututils.rewriteIfChanged(versionHeader, generator) 29 | 30 | # 31 | # config.h 32 | # 33 | versionHeader = os.path.join(outputPath, 'config.h') 34 | outpututils.rewriteIfChanged(versionHeader, '') 35 | 36 | if len(sys.argv) == 4: 37 | genConfig(sys.argv[1], sys.argv[2], sys.argv[3]) 38 | else: 39 | print('Usage: python3 genconfig.py platform configuration outputPath', file=sys.stderr) 40 | sys.exit(2) 41 | -------------------------------------------------------------------------------- /build/msvc/sed/libiconv2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openMSX/wxcatapult/c2231edf3da6d223f06be4341c336c4f93241d04/build/msvc/sed/libiconv2.dll -------------------------------------------------------------------------------- /build/msvc/sed/libintl3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openMSX/wxcatapult/c2231edf3da6d223f06be4341c336c4f93241d04/build/msvc/sed/libintl3.dll -------------------------------------------------------------------------------- /build/msvc/sed/readme.txt: -------------------------------------------------------------------------------- 1 | These binaries are checked in to allow VC++ to run the Sed-based dialog conversion script automatically. 2 | 3 | They were downloaded from http://gnuwin32.sourceforge.net/packages/sed.htm on 2009/02/28 -------------------------------------------------------------------------------- /build/msvc/sed/sed.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openMSX/wxcatapult/c2231edf3da6d223f06be4341c336c4f93241d04/build/msvc/sed/sed.exe -------------------------------------------------------------------------------- /build/msvc/wxCatapult.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2035 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wxCatapult", "wxCatapult.vcxproj", "{DF2143B4-16E7-42BE-B5C4-B077833EB0A7}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | Unicode Debug|Win32 = Unicode Debug|Win32 15 | Unicode Debug|x64 = Unicode Debug|x64 16 | Unicode Release|Win32 = Unicode Release|Win32 17 | Unicode Release|x64 = Unicode Release|x64 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Debug|Win32.Build.0 = Debug|Win32 22 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Debug|x64.ActiveCfg = Debug|x64 23 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Debug|x64.Build.0 = Debug|x64 24 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Release|Win32.ActiveCfg = Release|Win32 25 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Release|Win32.Build.0 = Release|Win32 26 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Release|x64.ActiveCfg = Release|x64 27 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Release|x64.Build.0 = Release|x64 28 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 29 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 30 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Unicode Debug|x64.ActiveCfg = Unicode Debug|x64 31 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Unicode Debug|x64.Build.0 = Unicode Debug|x64 32 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 33 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 34 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Unicode Release|x64.ActiveCfg = Unicode Release|x64 35 | {DF2143B4-16E7-42BE-B5C4-B077833EB0A7}.Unicode Release|x64.Build.0 = Unicode Release|x64 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | GlobalSection(ExtensibilityGlobals) = postSolution 41 | SolutionGuid = {1A5C9BE4-D514-4735-99EB-719576B9C973} 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /build/msvc/wxCatapult.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {708c4866-2a09-4601-9379-ffc5960d2820} 6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat 7 | 8 | 9 | {e493b976-1eca-4e2e-ae2a-b664c50d608b} 10 | wxg 11 | 12 | 13 | {d5db027b-1ccb-4e44-ad06-e74ee99724ef} 14 | 15 | 16 | {a63c8af1-44b3-4967-b628-15fe96a0ba5b} 17 | 18 | 19 | {79986e8e-5d59-487f-8ab7-31a95371db18} 20 | h;hpp;hxx;hm;inl 21 | 22 | 23 | {f657cb25-9ceb-4795-a61d-9cc189c09421} 24 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe 25 | 26 | 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | Source Files 48 | 49 | 50 | Source Files 51 | 52 | 53 | Source Files 54 | 55 | 56 | Source Files 57 | 58 | 59 | Source Files 60 | 61 | 62 | Source Files 63 | 64 | 65 | Source Files 66 | 67 | 68 | Source Files 69 | 70 | 71 | Source Files 72 | 73 | 74 | Source Files 75 | 76 | 77 | Source Files 78 | 79 | 80 | Source Files 81 | 82 | 83 | Source Files 84 | 85 | 86 | Source Files 87 | 88 | 89 | Source Files 90 | 91 | 92 | Source Files 93 | 94 | 95 | Source Files 96 | 97 | 98 | 99 | 100 | Source Files 101 | 102 | 103 | Header Files 104 | 105 | 106 | Header Files 107 | 108 | 109 | Header Files 110 | 111 | 112 | Header Files 113 | 114 | 115 | Header Files 116 | 117 | 118 | Header Files 119 | 120 | 121 | Header Files 122 | 123 | 124 | Header Files 125 | 126 | 127 | Header Files 128 | 129 | 130 | Header Files 131 | 132 | 133 | Header Files 134 | 135 | 136 | Header Files 137 | 138 | 139 | Header Files 140 | 141 | 142 | Header Files 143 | 144 | 145 | Header Files 146 | 147 | 148 | Header Files 149 | 150 | 151 | Header Files 152 | 153 | 154 | Header Files 155 | 156 | 157 | Header Files 158 | 159 | 160 | Header Files 161 | 162 | 163 | Header Files 164 | 165 | 166 | 167 | 168 | Source Files\Version 169 | 170 | 171 | Source Files\Bitmaps 172 | 173 | 174 | Source Files\Bitmaps 175 | 176 | 177 | Source Files\Bitmaps 178 | 179 | 180 | Source Files\Bitmaps 181 | 182 | 183 | Source Files\Bitmaps 184 | 185 | 186 | Source Files\Bitmaps 187 | 188 | 189 | Source Files\Bitmaps 190 | 191 | 192 | Source Files\Bitmaps 193 | 194 | 195 | Resource Files 196 | 197 | 198 | 199 | 200 | Resource Files 201 | 202 | 203 | 204 | 205 | Source Files\Dialogs 206 | 207 | 208 | Source Files\Dialogs 209 | 210 | 211 | Source Files\Dialogs 212 | 213 | 214 | Source Files\Dialogs 215 | 216 | 217 | Source Files\Dialogs 218 | 219 | 220 | Source Files\Dialogs 221 | 222 | 223 | Source Files\Dialogs 224 | 225 | 226 | Source Files\Dialogs 227 | 228 | 229 | Source Files\Dialogs 230 | 231 | 232 | Source Files\Dialogs 233 | 234 | 235 | Source Files\Dialogs 236 | 237 | 238 | Source Files\Dialogs 239 | 240 | 241 | Source Files\Dialogs 242 | 243 | 244 | Source Files\Dialogs 245 | 246 | 247 | Header Files 248 | 249 | 250 | 251 | -------------------------------------------------------------------------------- /build/msysutils.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | from os.path import isfile 3 | from subprocess import PIPE, Popen 4 | import sys 5 | 6 | def _determineMounts(): 7 | # The MSYS shell provides a Unix-like file system by translating paths on 8 | # the command line to Windows paths. Usually this is transparent, but not 9 | # for us since we call GCC without going through the shell. 10 | 11 | # Figure out the root directory of MSYS. 12 | proc = Popen( 13 | [ msysShell(), '-c', '"%s" -c \'import sys ; print sys.argv[1]\' /' 14 | % sys.executable.replace('\\', '\\\\') ], 15 | stdin = None, 16 | stdout = PIPE, 17 | stderr = PIPE, 18 | ) 19 | stdoutdata, stderrdata = proc.communicate() 20 | if stderrdata or proc.returncode: 21 | if stderrdata: 22 | print('Error determining MSYS root:', stderrdata, file=sys.stderr) 23 | if proc.returncode: 24 | print('Exit code %d' % proc.returncode, file=sys.stderr) 25 | raise IOError('Error determining MSYS root') 26 | msysRoot = stdoutdata.strip() 27 | 28 | # Figure out all mount points of MSYS. 29 | mounts = { '/': msysRoot + '/' } 30 | fstab = msysRoot + '/etc/fstab' 31 | if isfile(fstab): 32 | try: 33 | inp = open(fstab, 'r') 34 | try: 35 | for line in inp: 36 | line = line.strip() 37 | if line and not line.startswith('#'): 38 | nativePath, mountPoint = ( 39 | path.rstrip('/') + '/' for path in line.split() 40 | ) 41 | mounts[mountPoint] = nativePath 42 | finally: 43 | inp.close() 44 | except IOError as ex: 45 | print('Failed to read MSYS fstab:', ex, file=sys.stderr) 46 | except ValueError as ex: 47 | print('Failed to parse MSYS fstab:', ex, file=sys.stderr) 48 | return mounts 49 | 50 | def msysPathToNative(path): 51 | if path.startswith('/'): 52 | if len(path) == 2 or (len(path) > 2 and path[2] == '/'): 53 | # Support drive letters as top-level dirs. 54 | return '%s:/%s' % (path[1], path[3 : ]) 55 | longestMatch = '' 56 | for mountPoint in msysMounts.keys(): 57 | if path.startswith(mountPoint): 58 | if len(mountPoint) > len(longestMatch): 59 | longestMatch = mountPoint 60 | return msysMounts[longestMatch] + path[len(longestMatch) : ] 61 | else: 62 | return path 63 | 64 | def msysActive(): 65 | return environ.get('OSTYPE') == 'msys' or 'MSYSCON' in environ 66 | 67 | def msysShell(): 68 | return environ.get('MSYSCON') or environ.get('SHELL') or 'sh.exe' 69 | 70 | if msysActive(): 71 | msysMounts = _determineMounts() 72 | else: 73 | msysMounts = None 74 | 75 | if __name__ == '__main__': 76 | print('MSYS mounts:', msysMounts) 77 | -------------------------------------------------------------------------------- /build/outpututils.py: -------------------------------------------------------------------------------- 1 | # Various utility functions for generating output files and directories. 2 | 3 | from os import makedirs 4 | from os.path import dirname, isdir, isfile 5 | 6 | def createDirFor(filePath): 7 | '''Creates an output directory for containing the given file path. 8 | Nothing happens if the directory already exsits. 9 | ''' 10 | dirPath = dirname(filePath) 11 | if dirPath and not isdir(dirPath): 12 | makedirs(dirPath) 13 | 14 | def rewriteIfChanged(path, lines): 15 | '''Writes the file with the given path if it does not exist yet or if its 16 | contents should change. The contents are given by the "lines" sequence. 17 | Returns True if the file was (re)written, False otherwise. 18 | ''' 19 | newLines = [ line + '\n' for line in lines ] 20 | 21 | if isfile(path): 22 | inp = open(path, 'r') 23 | try: 24 | oldLines = inp.readlines() 25 | finally: 26 | inp.close() 27 | 28 | if newLines == oldLines: 29 | print('Up to date: %s' % path) 30 | return False 31 | else: 32 | print('Updating %s...' % path) 33 | else: 34 | print('Creating %s...' % path) 35 | createDirFor(path) 36 | 37 | out = open(path, 'w') 38 | try: 39 | out.writelines(newLines) 40 | finally: 41 | out.close() 42 | return True 43 | -------------------------------------------------------------------------------- /build/platform-darwin.mk: -------------------------------------------------------------------------------- 1 | # Configuration for Darwin. 2 | 3 | # Does platform support symlinks? 4 | USE_SYMLINK:=true 5 | 6 | # File name extension of executables. 7 | EXEEXT:= 8 | 9 | # Bind when executable is loaded, rather then when symbols are accessed. 10 | # I don't know why, but the linker suggests this. 11 | LINK_FLAGS+=-bind_at_load 12 | 13 | # The next line is needed to determine the name of the XRC library from wx-config. 14 | WX2XRC_DYNAMIC:=s/-lwx_\\([^-]*\\)-\\([^ ]*\\)/& -lwx_\\1_xrc-\\2/ 15 | 16 | CXXFLAGS+= -std=c++17 17 | -------------------------------------------------------------------------------- /build/platform-freebsd.mk: -------------------------------------------------------------------------------- 1 | # Configuration for FreeBSD. 2 | 3 | # Does platform support symlinks? 4 | USE_SYMLINK:=true 5 | 6 | # File name extension of executables. 7 | EXEEXT:= 8 | 9 | # The next line is needed to determine the name of the XRC library from wx-config. 10 | WX2XRC_DYNAMIC:=s/-lwx_\\([^-]*\\)-\\([^ ]*\\)/& -lwx_\\1_xrc-\\2/ 11 | 12 | CXXFLAGS+=-D_REENTRANT -D_THREADSAFE \ 13 | `if [ -d /usr/local/include ]; then echo '-I/usr/local/include'; fi` 14 | 15 | LINK_FLAGS+=-pthread \ 16 | `if [ -d /usr/local/lib ]; then echo '-L/usr/local/lib'; fi` 17 | -------------------------------------------------------------------------------- /build/platform-gnu.mk: -------------------------------------------------------------------------------- 1 | # Configuration for Debian GNU systems on various kernels (FreeBSD, Hurd). 2 | 3 | # This should be the same as compiling for a GNU system with a Linux kernel: 4 | include build/platform-linux.mk 5 | -------------------------------------------------------------------------------- /build/platform-linux.mk: -------------------------------------------------------------------------------- 1 | # Configuration for Linux. 2 | 3 | # Does platform support symlinks? 4 | USE_SYMLINK:=true 5 | 6 | # File name extension of executables. 7 | EXEEXT:= 8 | 9 | # The next line is needed to determine the name of the XRC library from wx-config. 10 | WX2XRC_DYNAMIC:=s/-lwx_\\([^-]*\\)-\\([^ ]*\\)/& -lwx_\\1_xrc-\\2/ 11 | 12 | CXXFLAGS+= -std=c++17 13 | -------------------------------------------------------------------------------- /build/platform-mingw32.mk: -------------------------------------------------------------------------------- 1 | # Configuration for MinGW. 2 | 3 | # Does platform support symlinks? 4 | USE_SYMLINK:=false 5 | 6 | # File name extension of executables. 7 | EXEEXT:=.exe 8 | 9 | # The next lines are needed to determine the name of the XRC library from wx-config. 10 | WX2XRC_DYNAMIC:=s/-lwx\\([^0-9]*\\)\\([0-9]\\)\\([0-9]\\)./ -lwx_\\1_xrc-\\2\\.\\3 & / 11 | WX2XRC_STATIC:=s/\\(\\/[^ ]*\\/\\)libwx\\([^0-9]*\\)\\([0-9]\\)\\([0-9]\\).\\.a/ \\1libwx_\\2_xrc-\\3\\.\\4\\.a & / 12 | 13 | # Compiler flags. 14 | CXXFLAGS+= \ 15 | -std=gnu++0x \ 16 | -mthreads -mconsole -mms-bitfields \ 17 | -I/mingw/include -I/mingw/include/w32api \ 18 | `if test -d /usr/local/include; then echo '-I/usr/local/include'; fi` \ 19 | -D__GTHREAD_HIDE_WIN32API \ 20 | -DFS_CASEINSENSE 21 | 22 | # Linker flags. 23 | LINK_FLAGS:=-L/mingw/lib -L/mingw/lib/w32api \ 24 | `if test -d /usr/local/lib; then echo '-L/usr/local/lib'; fi` \ 25 | $(LINK_FLAGS) 26 | 27 | # Platform specific source files. 28 | SOURCES+=PipeConnectThread 29 | -------------------------------------------------------------------------------- /build/platform-netbsd.mk: -------------------------------------------------------------------------------- 1 | # Configuration for NetBSD. 2 | 3 | # Assume NetBSD is a lot like FreeBSD. 4 | include build/platform-freebsd.mk 5 | -------------------------------------------------------------------------------- /build/platform-openbsd.mk: -------------------------------------------------------------------------------- 1 | # Configuration for OpenBSD. 2 | 3 | # Assume OpenBSD is a lot like FreeBSD. 4 | include build/platform-freebsd.mk 5 | -------------------------------------------------------------------------------- /build/platform-solaris.mk: -------------------------------------------------------------------------------- 1 | # Configuration for Solaris machines. 2 | 3 | # Does platform support symlinks? 4 | USE_SYMLINK:=true 5 | 6 | # File name extension of executables. 7 | EXEEXT:= 8 | 9 | # The next line is needed to determine the name of the XRC library from wx-config. 10 | WX2XRC_DYNAMIC:=s/-lwx_\\([^-]*\\)-\\([^ ]*\\)/& -lwx_\\1_xrc-\\2/ 11 | -------------------------------------------------------------------------------- /build/probe-results.mk: -------------------------------------------------------------------------------- 1 | # Display probe results, so user can decide whether to start the build, 2 | # or to change system configuration and rerun "configure". 3 | 4 | # This Makefile needs parameters to operate; check that they were specified: 5 | # - PROBE_MAKE: Makefile with probe results 6 | ifeq ($(PROBE_MAKE),) 7 | $(error Missing parameter: PROBE_MAKE) 8 | endif 9 | # - MAKE_PATH: Directory containing global Makefiles 10 | ifeq ($(MAKE_PATH),) 11 | $(error Missing parameter: MAKE_PATH) 12 | endif 13 | 14 | include $(PROBE_MAKE) 15 | include $(MAKE_PATH)/components.mk 16 | include $(MAKE_PATH)/custom.mk 17 | 18 | # Usage: $(call FOUND,LIB_NAME) 19 | FOUND=$(if $(HAVE_$(1)_LIB),$(HAVE_$(1)_LIB),no) 20 | 21 | # Usage: $(call HEADER,LIB1 LIB2 ...) 22 | HEADER=$(if $(strip $(foreach LIB,$(1),$(HAVE_$(LIB)_H))),yes,no) 23 | 24 | all: 25 | @echo "" 26 | @echo "Found libraries:" 27 | @echo " wxWidgets: $(call FOUND,WX)" 28 | @echo " wxWidgets XRC: $(call FOUND,XRC)" 29 | @echo " libxml2: $(call FOUND,XML)" 30 | @echo "" 31 | @echo "Found headers:" 32 | @echo " wxWidgets: $(call HEADER,WX)" 33 | @echo " wxWidgets XRC: $(call HEADER,XRC)" 34 | @echo " libxml2: $(call HEADER,XML)" 35 | @echo "" 36 | @echo "Customizable options:" 37 | @echo " Install to: $(INSTALL_BASE)" 38 | @echo " Default openMSX binary location: $(CATAPULT_OPENMSX_BINARY)" 39 | @echo " Default openMSX system share dir: $(CATAPULT_OPENMSX_SHARE)" 40 | @echo " (you can edit these in build/custom.mk)" 41 | @echo "" 42 | 43 | -------------------------------------------------------------------------------- /build/probe.mk: -------------------------------------------------------------------------------- 1 | # Replacement for "configure". 2 | # Performs some test compiles, to check for headers and functions. 3 | # Unlike configure, it does not run any test code, so it is more friendly for 4 | # cross compiles. 5 | 6 | # This Makefile needs parameters to operate; check that they were specified: 7 | # - output directory 8 | ifeq ($(OUTDIR),) 9 | $(error Missing parameter: OUTDIR) 10 | endif 11 | # - command line to invoke compiler + options 12 | ifeq ($(COMPILE),) 13 | $(error Missing parameter: COMPILE) 14 | endif 15 | 16 | # - platform specific makefiles directory 17 | ifeq ($(MAKE_LOCATION),) 18 | $(error Missing parameter: MAKE_LOCATION) 19 | endif 20 | 21 | # - used platform 22 | ifeq ($(CURRENT_OS),) 23 | $(error Missing parameter: CURRENT_OS) 24 | endif 25 | 26 | # include platform specific options 27 | include $(MAKE_LOCATION)/platform-$(CURRENT_OS).mk 28 | 29 | # Result files. 30 | LOG:=$(OUTDIR)/probe.log 31 | OUTMAKE:=$(OUTDIR)/probed_defs.mk 32 | 33 | 34 | # Headers 35 | # ======= 36 | 37 | CHECK_HEADERS:=$(addsuffix _H, \ 38 | WX XRC XML ) 39 | 40 | WX_HEADER:= 41 | WX_CFLAGS:=`wx-config --cflags 2>> $(LOG)` 42 | 43 | XML_HEADER:= 44 | XML_CFLAGS:=`xml2-config --cflags 2>> $(LOG)` 45 | 46 | XRC_HEADER:= 47 | XRC_CFLAGS:=$(WX_CFLAGS) 48 | 49 | 50 | # Libraries 51 | # ========= 52 | 53 | CHECK_LIBS:=WX XRC XML 54 | 55 | WX_LDFLAGS:=`wx-config --libs 2>> $(LOG)` 56 | WX_RESULT:=`wx-config --version` 57 | 58 | XML_LDFLAGS:=`xml2-config --libs 2>> $(LOG)` 59 | XML_RESULT:=`xml2-config --version` 60 | 61 | WX_LD_RESULT:=$(shell wx-config --ld) 62 | ifeq ($(WX_LD_RESULT),) 63 | WX2XRC:=$(WX2XRC_STATIC) 64 | else 65 | WX2XRC:=$(WX2XRC_DYNAMIC) 66 | endif 67 | 68 | XRC_IN_WXCONFIG :=$(strip $(shell wx-config --libs | grep xrc)) 69 | ifeq ($(XRC_IN_WXCONFIG),) 70 | XRC_LDFLAGS:=`((wx-config --libs > /dev/null) && (wx-config --libs | sed -e "$(WX2XRC)")) 2>> $(LOG)` 71 | else 72 | XRC_LDFLAGS:=`wx-config --libs 2>> $(LOG)` 73 | endif 74 | XRC_RESULT:=yes 75 | 76 | # Implementation 77 | # ============== 78 | 79 | CHECK_TARGETS:=$(CHECK_HEADERS) $(CHECK_LIBS) 80 | PRINT_LIBS:=$(addsuffix -print,$(CHECK_LIBS)) 81 | 82 | .PHONY: all init check-targets print-libs $(CHECK_TARGETS) $(PRINT_LIBS) 83 | 84 | # Default target. 85 | all: check-targets print-libs 86 | check-targets: $(CHECK_TARGETS) 87 | print-libs: $(PRINT_LIBS) 88 | 89 | # Create empty log and result files. 90 | init: 91 | @echo "Probing target system..." 92 | @mkdir -p $(OUTDIR) 93 | @echo "Probing system:" > $(LOG) 94 | @echo "# Automatically generated by build system." > $(OUTMAKE) 95 | @echo "# Non-empty value means found, empty means not found." >> $(OUTMAKE) 96 | @echo "PROBE_MAKE_INCLUDED:=true" >> $(OUTMAKE) 97 | 98 | # Probe for header: 99 | # Try to include the header. 100 | $(CHECK_HEADERS): init 101 | @echo > $(OUTDIR)/$@.cc 102 | @if [ -n "$($(@:%_H=%)_PREHEADER)" ]; then \ 103 | echo "#include $($(@:%_H=%)_PREHEADER)"; fi >> $(OUTDIR)/$@.cc 104 | @echo "#include $($(@:%_H=%)_HEADER)" >> $(OUTDIR)/$@.cc 105 | @if FLAGS="$($(@:%_H=%_CFLAGS))" && $(COMPILE) $(CXXFLAGS) $$FLAGS \ 106 | -c $(OUTDIR)/$@.cc -o $(OUTDIR)/$@.o 2>> $(LOG); \ 107 | then echo "Found header: $(@:%_H=%)" >> $(LOG); \ 108 | echo "HAVE_$@:=true" >> $(OUTMAKE); \ 109 | else echo "Missing header: $(@:%_H=%)" >> $(LOG); \ 110 | echo "HAVE_$@:=" >> $(OUTMAKE); \ 111 | fi 112 | @rm -f $(OUTDIR)/$@.cc $(OUTDIR)/$@.o 113 | 114 | # Probe for library: 115 | # Try to link dummy program to the library. 116 | $(CHECK_LIBS): init 117 | @echo "int main(int argc, char *argv[]) { return 0; }" > $(OUTDIR)/$@.cc 118 | @if FLAGS="$($@_LDFLAGS)" && $(COMPILE) $(CXXFLAGS) \ 119 | $(OUTDIR)/$@.cc -o $(OUTDIR)/$@.exe $(LINK_FLAGS) $$FLAGS 2>> $(LOG); \ 120 | then echo "Found library: $@" >> $(LOG); \ 121 | echo "HAVE_$@_LIB:=$($@_RESULT)" >> $(OUTMAKE); \ 122 | else echo "Missing library: $@" >> $(LOG); \ 123 | echo "HAVE_$@_LIB:=" >> $(OUTMAKE); \ 124 | fi 125 | @rm -f $(OUTDIR)/$@.cc $(OUTDIR)/$@.exe 126 | 127 | # Print the flags for using a certain library (CFLAGS and LDFLAGS). 128 | $(PRINT_LIBS): check-targets 129 | @echo "$(@:%-print=%)_CFLAGS:=$($(@:%-print=%)_CFLAGS)" >> $(OUTMAKE) 130 | @echo "$(@:%-print=%)_LDFLAGS:=$($(@:%-print=%)_LDFLAGS)" >> $(OUTMAKE) 131 | 132 | -------------------------------------------------------------------------------- /build/version.mk: -------------------------------------------------------------------------------- 1 | # Version info. 2 | 3 | # Name used for packaging. 4 | PACKAGE_NAME:=openmsx-catapult 5 | 6 | # Version number. 7 | PACKAGE_VERSION:=19.0 8 | 9 | # Is this a release version ("true") or development version ("false"). 10 | RELEASE_FLAG:=true 11 | -------------------------------------------------------------------------------- /build/version.py: -------------------------------------------------------------------------------- 1 | # Contains the Catapult version number and versioning related functions. 2 | 3 | from executils import captureStdout 4 | from makeutils import filterLines 5 | 6 | from os import makedirs 7 | from os.path import isdir 8 | 9 | import re 10 | 11 | # Name used for packaging. 12 | packageName = 'catapult' 13 | 14 | # Version number. 15 | packageVersionNumber = '19.0' 16 | 17 | # Note: suffix should be empty or with dash, like "-rc2" or "-test1" 18 | packageVersionSuffix = '' 19 | packageVersion = packageVersionNumber + packageVersionSuffix 20 | 21 | # Is this a release version ("True") or development version ("False"). 22 | releaseFlag = True 23 | 24 | # TODO: Before extraction of SVN or git-SVN revision number can be done, we 25 | # should figure out a way to avoid rewriting Version.ii on every build. 26 | # Option 1: Read Version.ii and do not write if new contents are the same. 27 | # Option 2: Persist the extracted revision number. 28 | # I prefer option 2, since it is more modular (separate extraction and 29 | # include generation steps) but option 1 might be easier to implement at 30 | # first (no need to persist anything). 31 | 32 | def _extractRevisionFromStdout(log, command, regex): 33 | text = captureStdout(log, command) 34 | if text is None: 35 | # Error logging already done by captureStdout(). 36 | return None 37 | # pylint 0.18.0 somehow thinks captureStdout() returns a list, not a string. 38 | lines = text.split('\n') # pylint: disable-msg=E1103 39 | for revision, in filterLines(lines, regex): 40 | print('Revision number found by "%s": %s' % (command, revision), file=log) 41 | return revision 42 | else: 43 | print('Revision number not found in "%s" output:' % command, file=log) 44 | print(str(text), file=log) 45 | return None 46 | 47 | def extractGitRevision(log): 48 | return _extractRevisionFromStdout( 49 | log, 'git describe --dirty', r'\S+?-(\S+)$' 50 | ) 51 | 52 | def extractNumberFromGitRevision(revisionStr): 53 | if revisionStr is None: 54 | return None 55 | if revisionStr == 'dirty': 56 | return None 57 | return re.match(r'(\d+)+', revisionStr).group(0) 58 | 59 | _cachedRevision = False # because None is a valid result 60 | 61 | def extractRevision(): 62 | global _cachedRevision 63 | if _cachedRevision is not False: 64 | return _cachedRevision 65 | if releaseFlag: 66 | # Not necessary, we do not append revision for a release build. 67 | return None 68 | if not isdir('derived'): 69 | makedirs('derived') 70 | with open('derived/version.log', 'w', encoding='utf-8') as log: 71 | print('Extracting revision info...', file=log) 72 | revision = extractGitRevision(log) 73 | print('Revision string: %s' % revision, file=log) 74 | revisionNumber = extractNumberFromGitRevision(revision) 75 | print('Revision number: %s' % revisionNumber, file=log) 76 | _cachedRevision = revision 77 | return revision 78 | 79 | def extractRevisionNumber(): 80 | return int(extractNumberFromGitRevision(extractRevision()) or 0) 81 | 82 | def extractRevisionString(): 83 | return extractRevision() or 'unknown' 84 | 85 | def getVersionTripleString(): 86 | """Version in "x.y.z" format.""" 87 | return '%s.%d' % (packageVersionNumber, extractRevisionNumber()) 88 | 89 | def getDetailedVersion(): 90 | if releaseFlag: 91 | return packageVersion 92 | else: 93 | return '%s-%s' % (packageVersion, extractRevisionString()) 94 | 95 | def getVersionedPackageName(): 96 | return '%s-%s' % (packageName, getDetailedVersion()) 97 | 98 | def countGitCommits(): 99 | if not isdir('derived'): 100 | makedirs('derived') 101 | with open('derived/commitCountVersion.log', 'w', encoding='utf-8') as log: 102 | print('Extracting commit count...', file=log) 103 | commitCount = captureStdout(log, 'git rev-list HEAD --count') 104 | print('Commit count: %s' % commitCount, file=log) 105 | return commitCount 106 | 107 | formatMap = dict( 108 | main=lambda: packageVersionNumber, 109 | plain=lambda: packageVersion, 110 | triple=getVersionTripleString, 111 | detailed=getDetailedVersion, 112 | ) 113 | 114 | if __name__ == '__main__': 115 | import sys 116 | badFormat = False 117 | for fmt in sys.argv[1:] or ['detailed']: 118 | try: 119 | formatter = formatMap[fmt] 120 | except KeyError: 121 | print('Unknown version format "%s"' % fmt, file=sys.stderr) 122 | badFormat = True 123 | else: 124 | print(formatter()) 125 | if badFormat: 126 | print('Supported version formats:', ', '.join(sorted(formatMap.keys())), 127 | file=sys.stderr) 128 | sys.exit(2) 129 | -------------------------------------------------------------------------------- /build/version2code.py: -------------------------------------------------------------------------------- 1 | # Generates version include file. 2 | 3 | from outpututils import rewriteIfChanged 4 | from version import extractRevision, packageVersion, releaseFlag 5 | 6 | import sys 7 | 8 | def iterVersionInclude(): 9 | revision = extractRevision() 10 | 11 | yield '// Automatically generated by build process.' 12 | yield 'const bool Version::RELEASE = %s;' % str(releaseFlag).lower() 13 | yield 'const std::string Version::VERSION = "%s";' % packageVersion 14 | yield 'const std::string Version::REVISION = "%s";' % revision 15 | 16 | if __name__ == '__main__': 17 | if len(sys.argv) == 2: 18 | rewriteIfChanged(sys.argv[1], iterVersionInclude()) 19 | else: 20 | print('Usage: python3 version2code.py VERSION_HEADER', file=sys.stderr) 21 | sys.exit(2) 22 | -------------------------------------------------------------------------------- /build/win_resource.py: -------------------------------------------------------------------------------- 1 | # Generates Windows resource header. 2 | 3 | from outpututils import rewriteIfChanged 4 | from version import ( 5 | extractRevisionNumber, getDetailedVersion, packageVersion 6 | ) 7 | 8 | import sys 9 | 10 | def iterResourceHeader(): 11 | versionComponents = packageVersion.split('-')[0].split('.') 12 | versionComponents += ['0'] * (3 - len(versionComponents)) 13 | versionComponents.append(str(extractRevisionNumber())) 14 | assert len(versionComponents) == 4, versionComponents 15 | 16 | yield '#define CATAPULT_VERSION_INT %s' % ', '.join(versionComponents) 17 | yield '#define CATAPULT_VERSION_STR "%s\\0"' % getDetailedVersion() 18 | 19 | if __name__ == '__main__': 20 | if len(sys.argv) == 2: 21 | rewriteIfChanged(sys.argv[1], iterResourceHeader()) 22 | else: 23 | print('Usage: python3 win-resource.py RESOURCE_HEADER', file=sys.stderr) 24 | sys.exit(2) 25 | -------------------------------------------------------------------------------- /build/wxg2xrc.sed: -------------------------------------------------------------------------------- 1 | # specific for catapult.xrc 2 | 3 | /name="CatapultFrame"/{ 4 | s/class="CatapultFrame"/class="wxFrame"/ 5 | s/>/ subclass="CatapultFrame">/ 6 | } 7 | //,/<\/object>/d 8 | s/\([^<]*\)\(\)/\1\2\3\ 9 | \1 1<\/usenotebooksizer>/ 10 | 11 | /name="SessionPage"/,${ 12 | /selection/d 13 | //,/<\/choices>/d 14 | } 15 | 16 | /name="RomTypeDialog"/,${ 17 | /selection/d 18 | //,/<\/choices>/d 19 | } 20 | 21 | /name="IPSSelectionDialog"/,${ 22 | /selection/d 23 | //,/<\/choices>/d 24 | } 25 | 26 | /name="VideoControlPage"/,${ 27 | s/choices/content/ 28 | s/choice/item/g 29 | } 30 | 31 | #global deletes 32 | 33 | /