Compare commits

...

91 Commits

Author SHA1 Message Date
Andy Vandijck
9ae1473f36 Fix 8 bit PNG recording
Fix 8 bit PNG recording
2025-08-02 11:27:21 +02:00
Andy Vandijck
9cd0c5c04c Fix 8 bit video recording
Fix 8 bit video recording
2025-08-02 11:10:00 +02:00
Andy Vandijck
9e41c5476a Fix 8 bit color
Fix 8 bit color
2025-08-02 10:20:05 +02:00
Andy Vandijck
e91171459d Fix policy in newer CMake 2025-08-02 09:49:22 +02:00
Andy Vandijck
16f008b448 Fix macOS build
Fix macOS build
2025-08-02 09:38:42 +02:00
Rafael Kitover
bad10342bd build: use pkg-config on UNIX for SDL3
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-08-02 06:20:37 +00:00
Squall Leonhart
06b3cb094e Merge pull request #1484 from Squall-Leonhart/Correct24bit
24bit was prone to corrupting g_pix on all renderers
2025-08-02 07:50:07 +10:00
Squall-Leonhart
82617ea75d correct memory alignment 2025-08-02 07:48:03 +10:00
Andy Vandijck
0561ef91a4 Fix CoreAudio stall
Fix CoreAudio stall
2025-08-01 09:48:58 +02:00
Rafael Kitover
afc6a1cc3a build: fix build, de translation removed
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-08-01 04:40:38 +00:00
Rafael Kitover
35df9d7647 translations: remove German, not German
Remove the `de` translation as it does not contain a German translation.
Also deleted from Transifex.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-08-01 03:10:01 +00:00
Rafael Kitover
031ae2ebf6 build: fix CMake slowness
Optimize the `find_wx_util` function to try the major and minor version
parsed from the lib file first, avoiding a very slow exhaustive search
of possible version numbers.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-08-01 03:05:55 +00:00
Squall Leonhart
6242679e23 initialise stereo_buffer to 0 to prevent a race condition 2025-08-01 12:12:44 +10:00
Rafael Kitover
537393a0ab translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-31 16:00:20 +00:00
Rafael Kitover
616f7abc4e translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-31 13:00:21 +00:00
Rafael Kitover
f1414000e6 doc: fix release commit instructions
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-30 11:49:27 +00:00
Rafael Kitover
e2a235768e release v2.2.2
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-30 11:46:32 +00:00
Rafael Kitover
1d54ee2135 translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-30 07:00:21 +00:00
Rafael Kitover
013a9b87ac translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-30 03:00:20 +00:00
Rafael Kitover
a06d3ed1b4 translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-30 01:00:22 +00:00
Rafael Kitover
b1bad9d53d translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-30 01:00:06 +00:00
Rafael Kitover
d2eed85c28 Move Languages menu to the top level
Move the new Languages menu to the top level after Help to make it
easier to find.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-30 00:09:05 +00:00
Rafael Kitover
d5a37e06aa translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-29 10:00:20 +00:00
Rafael Kitover
cea049161d translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-29 05:00:20 +00:00
Rafael Kitover
3eadc6e78f translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-28 16:00:19 +00:00
Rafael Kitover
4f3ed0dc8b translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-28 15:00:23 +00:00
Rafael Kitover
d38e1d0f89 translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-28 15:00:06 +00:00
Andy Vandijck
f870bf252d Merge branch 'master' of github.com:visualboyadvance-m/visualboyadvance-m 2025-07-28 16:46:15 +02:00
Andy Vandijck
536ea705ab Add option for external translations (windows) and fix retain of language selection
Add option for external translations (windows) and fix retain of language selection
2025-07-28 16:46:12 +02:00
Rafael Kitover
802162ad97 translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-28 14:00:26 +00:00
Rafael Kitover
25895e8636 translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-28 12:00:24 +00:00
Rafael Kitover
27e7aa6864 translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-28 12:00:07 +00:00
Andy Vandijck
dd7461103b Fix resource load for catalogs for Windows
Fix resource load for catalogs for Windows
2025-07-28 13:54:30 +02:00
Andy Vandijck
c892c269fa Merge branch 'master' of github.com:visualboyadvance-m/visualboyadvance-m 2025-07-28 13:14:10 +02:00
Andy Vandijck
dcf87c0a71 Implement refresh of GUI on language load
Implement refresh of GUI on language load
2025-07-28 13:13:57 +02:00
Rafael Kitover
6d1e7e8069 translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-28 09:00:20 +00:00
Rafael Kitover
b8868fce37 translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-28 08:00:18 +00:00
Rafael Kitover
d92c4e465f translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-27 16:00:20 +00:00
Andy Vandijck
bceb138961 Fix SDL crash on Windows
Fix SDL crash on Windows
2025-07-27 14:48:38 +02:00
Rafael Kitover
83aa80440e translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-27 12:00:25 +00:00
Rafael Kitover
4bd54ba128 translations: rebuild source .pot
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-27 12:00:07 +00:00
Andy Vandijck
27acf80b80 Make language configurable (requires restart)
Make language configurable (requires restart)
2025-07-27 13:27:09 +02:00
Andy Vandijck
ae09ab7189 Embed translations for Windows
Embed translations for Windows
2025-07-26 15:19:45 +02:00
Andy Vandijck
ce8de563e3 Merge branch 'master' of github.com:visualboyadvance-m/visualboyadvance-m 2025-07-26 12:28:50 +02:00
Andy Vandijck
47a8e7e8ed Update wxWidgets for Mac builder to 3.3.1
Update wxWidgets for Mac builder to 3.3.1
2025-07-26 12:28:47 +02:00
Rafael Kitover
adbaeacf20 build: use OpenSSL for FFmpeg for Mac builder
Link FFmpeg to OpenSSL for the Mac builder for the TLS functionality it
needs.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-25 11:53:22 -07:00
Rafael Kitover
8d8ecd8dfa build: remove glib from Mac builder
Remove glib from the Mac builder, it is not a dependency of anything on
Mac.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-25 01:55:50 -07:00
Andy Vandijck
cfbfc9ecb0 Fix glib build
Fix glib build
2025-07-25 10:35:42 +02:00
Andy Vandijck
4445a20d9c Merge branch 'master' of github.com:visualboyadvance-m/visualboyadvance-m 2025-07-25 10:06:24 +02:00
Andy Vandijck
b83a7c8aa2 Add Wii U ARM instruction to the instruction table
Add Wii U ARM instruction to the instruction table
2025-07-25 10:06:21 +02:00
Rafael Kitover
66aabab61f build: yet another Mac builder fix
Remove header paths from flags, keep frameworks path.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-24 20:46:37 -07:00
Rafael Kitover
a5e6b57fd8 translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-24 16:00:21 +00:00
Rafael Kitover
b9061ddafd translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-24 15:00:22 +00:00
Rafael Kitover
3c291ef3ac translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-24 14:00:21 +00:00
Andy Vandijck
e44c83e1d0 log Wii U VC opcodes and address
log Wii U VC opcodes and address
2025-07-24 13:09:42 +02:00
Andy Vandijck
8ce4848dd6 Fix Wii U VC opcodes
Fix Wii U VC opcodes
2025-07-24 13:06:09 +02:00
Andy Vandijck
34cba3bb2c Fix build for macOS
Fix build for macOS
2025-07-24 12:00:45 +02:00
Andy Vandijck
9b78b26010 Fix dependency build
Fix dependency build
2025-07-24 11:26:46 +02:00
Andy Vandijck
94f9df4baa Fix build for macOS
Fix build for macOS
2025-07-24 11:12:56 +02:00
Rafael Kitover
c726989d67 build: improve Metal toolchain detection on Mac
Use `xcrun -f metal` to set the path to the Metal compiler, falling back
to the `CheckLanguage` CMake module if that fails.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-23 17:29:58 -07:00
Rafael Kitover
3344e7cf71 build: add path to Metal compiler for Mac
Try to add the path to the Metal compiler on Mac to `CMAKE_PROGRAM_PATH`
to help it find the Metal compiler.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-23 13:12:51 -07:00
Rafael Kitover
3d69bde8cb build: fix adding/removing Mac SDK paths in flags
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-23 13:04:48 -07:00
Andy Vandijck
09984eed2f Fix path for metal
Fix path for metal
2025-07-23 21:42:25 +02:00
Andy Vandijck
69809ff556 Fix compile of flac
Fix compile of flac
2025-07-23 21:05:10 +02:00
Andy Vandijck
80dec6a38d Fix glib macOS frameworks
Fix glib macOS frameworks
2025-07-23 20:39:54 +02:00
Andy Vandijck
ea7b9e5049 Fix glib build
Fix glib build
2025-07-23 20:29:56 +02:00
Andy Vandijck
18701fc0a4 Fix glib patch
Fix glib patch
2025-07-23 20:10:54 +02:00
Andy Vandijck
6b596c7ad7 Fix patch for glib 2025-07-23 20:06:36 +02:00
Andy Vandijck
3c01643112 Fix glib build
Fix glib build
2025-07-23 20:00:54 +02:00
Rafael Kitover
0895c7a52e build: fix Intel zip name building on Mac ARM64
Try to set the architecture correctly when compiling for Intel on ARM64
Macs, this also sets the zip name correctly for our releases.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-23 09:21:53 -07:00
Andy Vandijck
1e52787078 Fix build on macOS
Fix build on macOS
2025-07-23 18:05:07 +02:00
Andy Vandijck
fc0e63d554 Fix libicu build
Fix libicu build
2025-07-23 17:32:35 +02:00
Andy Vandijck
9b573f4465 Update 7z to 2500 and fix 7zip build
Update 7z to 2500 and fix 7zip build
2025-07-23 16:14:51 +02:00
Rafael Kitover
51ae605850 build: fix -intel build for Mac builder
Make some adjustments to the Mac builder for the Intel build to build
with `-intel`.

Remove unzip and zip and replace with 7zip.

Remove `-mtune=generic` from the base flags.

Remove flex and swig and use them from brew.

Add giflib, needed by libwebp.

Add the `no_autotools_cross_options` and
`remove_arch_flags_from_build_ninja` dist flags.

Set intel macOS target to 10.10 when on an ARM64 host.

Add a patch for glib to build with an older macOS.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-23 06:31:36 -07:00
Andy Vandijck
ac4b39b6d8 Fix save/load state for matrixed ROMs
Fix save/load state for matrixed ROMs
2025-07-23 10:40:39 +02:00
Andy Vandijck
97ca69d050 Fix build
Fix build
2025-07-23 10:09:28 +02:00
Andy Vandijck
b1bcaed3a2 Remap matrix on load
Remap matrix on load
2025-07-23 10:07:32 +02:00
Andy Vandijck
2a1b41040d Fix matrix save state data and fix libretro 64MB ROM
Fix matrix save state data and fix libretro 64MB ROM
2025-07-23 09:57:46 +02:00
Andy Vandijck
930d0e282c A few extra fixes 2025-07-22 19:09:10 +02:00
Andy Vandijck
df23826721 Fix g_rom2 free
Fix g_rom2 free
2025-07-22 19:01:23 +02:00
Andy Vandijck
de46284747 Implement 64MB ROM files and fix ROM load
Implement 64MB ROM files and fix ROM load
2025-07-22 18:57:17 +02:00
Andy Vandijck
715f685447 Fix multi cart
Fix multi cart
2025-07-21 13:21:23 +02:00
Andy Vandijck
eabf319c9a Fix ROM load
Fix ROM load
2025-07-21 12:51:08 +02:00
Rafael Kitover
c98263603d build: fix Mac build
Followup on 9d46f8e6 (build: fix Mac builder regression, 2025-07-20) to
add this `DIST_FLAGS` flag for bison as well, because it also uses this
header file.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-20 18:41:14 +00:00
Rafael Kitover
9d46f8e6d1 build: fix Mac builder regression
Fix the Mac build, broken by 8c3d0f09 (build: fix regression in Mac
builder, 2025-07-19) due to the SDK paths conflicting with a gettext
header.

Fix this regression by introducing the `DIST_FLAGS` feature with a
`no_sdk_paths_in_flags` flag that `build_dist()` treats specially to
remove the include and lib SDK paths from `CPPFLAGS` and `LDFLAGS`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-20 16:14:00 +00:00
Andy Vandijck
dab91fc8ca Fix bigger than 32MB ROM files
Fix bigger than 32MB ROM files
2025-07-20 15:44:39 +02:00
Andy Vandijck
d672d425be Get BZ2 uncompressed size
Get BZ2 uncompressed size
2025-07-20 14:45:01 +02:00
Andy Vandijck
53d60b726d Merge branch 'master' of github.com:visualboyadvance-m/visualboyadvance-m 2025-07-20 12:58:27 +02:00
Andy Vandijck
b6ce89bff8 Fix BZ2 max cart size
Fix BZ2 max cart size
2025-07-20 12:58:24 +02:00
Rafael Kitover
8c3d0f0984 build: fix regression in Mac builder
Fix the Mac builder, broken by 3d4c03d0 (build: fix Mac M1 build on my
Mini, 2025-07-19). Remove `-lintl -liconv` from `LDFLAGS` because they
are not available before they are built.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-19 17:23:18 +00:00
Rafael Kitover
3d4c03d0e6 build: fix Mac M1 build on my Mini
Fix the Mac builder on my M1 Mini.

Update glib and get it building.

Add command line tools include and lib directories to flags.

Add a necessary clang flag to fix vbam build with CoreAudio.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-07-19 17:16:20 +00:00
69 changed files with 11454 additions and 9844 deletions

View File

@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [2.2.2] - 2025-07-30
========================
* 27acf80b - Make language configurable (requires restart) [andyvand]
* ae09ab71 - Embed translations for Windows [andyvand]
* 47a8e7e8 - Update wxWidgets for Mac builder to 3.3.1 [andyvand]
* 8ce4848d - Fix Wii U VC opcodes [andyvand]
* dab91fc8 - Fix bigger than 32MB ROM files [andyvand]
## [2.2.1] - 2025-07-19
=======================
* 23a3d0b2 - build: fix include paths for bundled SFML [rkitover]

View File

@@ -1,6 +1,11 @@
cmake_minimum_required(VERSION 3.19)
cmake_policy(VERSION 3.19...3.28.3)
# Use new link library de-duplication behavior.
cmake_policy(SET CMP0156 NEW)
cmake_policy(SET CMP0179 NEW)
# cmake_policy(SET CMP0181 NEW)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
if(WIN32)
@@ -83,7 +88,16 @@ if(APPLE)
include(CheckLanguage)
include(MetalShaderSupport)
check_language(Metal)
execute_process(
COMMAND xcrun -f metal
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE CMAKE_Metal_COMPILER
)
if(NOT CMAKE_Metal_COMPILER)
check_language(Metal)
endif()
if(CMAKE_Metal_COMPILER)
enable_language(Metal)
endif()

View File

@@ -31,6 +31,15 @@ elseif(VCPKG_TARGET_TRIPLET MATCHES "^[aA][rR][mM]-")
set(CMAKE_SYSTEM_PROCESSOR ARM)
endif()
if(APPLE AND
(CMAKE_OSX_ARCHITECTURES MATCHES "[xX]86_64") OR
(ENV{CFLAGS} MATCHES "[xX]86_64") OR
(ENV{CXXFLAGS} MATCHES "[xX]86_64") OR
(ENV{LDFLAGS} MATCHES "[xX]86_64"))
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
endif()
# Turn asm on by default on 32bit x86 and set WINARCH for windows stuff.
if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64")
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
@@ -46,14 +55,6 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64")
set(WINARCH x64)
set(ARCH_NAME x86_64)
endif()
if(DEFINED VCPKG_TARGET_TRIPLET)
string(REGEX MATCH "^x[86][64]" target_arch ${VCPKG_TARGET_TRIPLET})
if(NOT WINARCH STREQUAL target_arch)
message(FATAL_ERROR "Wrong build environment architecture for VCPKG_TARGET_TRIPLET, you specified ${target_arch} but your compiler is for ${WINARCH}")
endif()
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "[aA][aA][rR][cC][hH]|[aA][rR][mM]")
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
set(ARM32 ON)
@@ -70,6 +71,14 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "[aA][aA][rR][cC][hH]|[aA][rR][mM]")
endif()
endif()
if(DEFINED VCPKG_TARGET_TRIPLET)
string(REGEX MATCH "^[^-]+" target_arch ${VCPKG_TARGET_TRIPLET})
if(NOT WINARCH STREQUAL target_arch)
message(FATAL_ERROR "Wrong build environment architecture for VCPKG_TARGET_TRIPLET, you specified ${target_arch} but your compiler is for ${WINARCH}")
endif()
endif()
# We do not support amd64 asm yet
if(X86_64 AND (ENABLE_ASM_CORE OR ENABLE_ASM_SCALERS OR ENABLE_MMX))
message(FATAL_ERROR "The options ASM_CORE, ASM_SCALERS and MMX are not supported on X86_64 yet.")

View File

@@ -48,16 +48,20 @@ if((NOT ENABLE_SDL3) AND CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg")
endif()
if(ENABLE_SDL3)
if(VBAM_STATIC)
set(VBAM_SDL_LIBS SDL3::SDL3-static ${SDL_LIBRARY_TEMP})
if(UNIX AND NOT APPLE)
set(VBAM_SDL_LIBS "${SDL3_LIBRARIES}")
else()
set(VBAM_SDL_LIBS SDL3::SDL3 ${SDL_LIBRARY_TEMP})
if(VBAM_STATIC)
set(VBAM_SDL_LIBS SDL3::SDL3-static ${SDL_LIBRARY_TEMP})
else()
set(VBAM_SDL_LIBS SDL3::SDL3 ${SDL_LIBRARY_TEMP})
endif()
endif()
else()
if(VBAM_STATIC)
set(VBAM_SDL_LIBS SDL2::SDL2-static ${SDL_LIBRARY_TEMP})
set(VBAM_SDL_LIBS SDL2::SDL2-static ${SDL_LIBRARY_TEMP})
else()
set(VBAM_SDL_LIBS SDL2::SDL2 ${SDL_LIBRARY_TEMP})
set(VBAM_SDL_LIBS SDL2::SDL2 ${SDL_LIBRARY_TEMP})
endif()
endif()
@@ -70,7 +74,7 @@ if(ENABLE_FFMPEG)
list(APPEND FFMPEG_LDFLAGS "SHELL:-framework CoreText" "SHELL:-framework ApplicationServices")
if(UPSTREAM_RELEASE)
list(APPEND FFMPEG_LDFLAGS -lbz2 -ltiff "SHELL:-framework DiskArbitration" -lfreetype -lfontconfig -llzma -lxml2 -lharfbuzz)
list(APPEND FFMPEG_LDFLAGS -lbz2 -ltiff "SHELL:-framework DiskArbitration" -lfreetype -lfontconfig -llzma -lxml2 -lharfbuzz -lcrypto -lssl)
endif()
elseif(WIN32)
set(WIN32_MEDIA_FOUNDATION_LIBS dxva2 evr mf mfplat mfplay mfreadwrite mfuuid amstrmid)

View File

@@ -221,7 +221,7 @@ release notes.
Run the following commands to commit the change:
git commit -m'release ${new_tag}' --signoff -S
git commit -a -m'release ${new_tag}' --signoff -S
git tag -s -m'${new_tag}' ${new_tag}
To rollback these changes, run this command:

View File

@@ -40,15 +40,27 @@ if(VBAM_STATIC)
endif()
endif()
find_package(SDL3 QUIET)
if(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^([xX]86_64|[aA][mM][dD]64)$")
set(PKG_CONFIG_EXECUTABLE "$ENV{VCPKG_ROOT}/installed/x64-windows/tools/pkgconf/pkgconf.exe")
endif()
find_package(PkgConfig)
if(UNIX AND NOT APPLE)
pkg_check_modules(SDL3 sdl3 QUIET)
else()
find_package(SDL3 QUIET)
endif()
option(ENABLE_SDL3 "Use SDL3" "${SDL3_FOUND}")
if(NOT TRANSLATIONS_ONLY)
if(ENABLE_SDL3)
find_package(SDL3 CONFIG REQUIRED)
if(NOT UNIX)
find_package(SDL3 REQUIRED)
endif()
else()
find_package(SDL2 CONFIG REQUIRED)
find_package(SDL2 REQUIRED)
endif()
endif()
@@ -93,12 +105,6 @@ if(APPLE AND NOT DISABLE_MACOS_PACKAGE_MANAGERS)
include(MacPackageManagers)
endif()
if(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^([xX]86_64|[aA][mM][dD]64)$")
set(PKG_CONFIG_EXECUTABLE "$ENV{VCPKG_ROOT}/installed/x64-windows/tools/pkgconf/pkgconf.exe")
endif()
find_package(PkgConfig)
# Link / SFML
if(NOT TRANSLATIONS_ONLY)
set(ENABLE_LINK_DEFAULT ON)

View File

@@ -37,8 +37,48 @@ function(check_clean_exit var)
set(${var} ${exit_status} PARENT_SCOPE)
endfunction()
function(try_wx_util var util conf_suffix major_version minor_version)
unset(suffix)
if(conf_suffix)
set(suffix "-${conf_suffix}")
endif()
if(major_version)
set(suffix "${suffix}-${major_version}")
if(NOT minor_version EQUAL -1)
set(suffix "${suffix}.${minor_version}")
endif()
endif()
# find_program caches the result
set(exe NOTFOUND CACHE INTERNAL "" FORCE)
find_program(exe NAMES "${util}${suffix}")
# try infix variant, as on FreeBSD
if(NOT EXISTS "${exe}")
string(REGEX REPLACE "^-" "" suffix "${suffix}")
string(REGEX REPLACE "-" "${suffix}-" try "${util}")
set(exe NOTFOUND CACHE INTERNAL "" FORCE)
find_program(exe NAMES "${try}")
endif()
if(EXISTS "${exe}")
# check that the utility can be executed cleanly
# in case we find e.g. the wrong architecture binary
# when cross-compiling
check_clean_exit(exit_status "${exe}" --help)
if(exit_status EQUAL 0)
set("${var}" "${exe}" PARENT_SCOPE)
return()
endif()
endif()
endfunction()
function(find_wx_util var util)
if(WIN32 OR EXISTS /etc/gentoo-release)
if((WIN32 AND (NOT CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg")) OR EXISTS /etc/gentoo-release)
# On win32, including cross builds we prefer the plain utility
# name first from PATH, with the exception of -static for static
# builds.
@@ -57,48 +97,34 @@ function(find_wx_util var util)
set(major_versions ";")
endif()
list(APPEND conf_suffixes gtk4u gtk4 gtk3u gtk3 gtk2u gtk2 "")
list(APPEND major_versions 4 3 2 "")
list(APPEND conf_suffixes "" gtk3u gtk3 gtk2u gtk2)
list(APPEND major_versions "" 3)
get_target_property(wx_base_lib_prop wx::base LOCATION)
string(STRIP "${wx_base_lib_prop}" wx_base_lib)
if(wx_base_lib MATCHES "wx_baseu?-([0-9]+)\\.([0-9]+)\\.")
set(lib_major "${CMAKE_MATCH_1}")
set(lib_minor "${CMAKE_MATCH_2}")
endif()
foreach(conf_suffix IN LISTS conf_suffixes)
if(lib_major AND lib_minor)
try_wx_util(exe "${util}" "${conf_suffix}" "${lib_major}" "${lib_minor}")
if(exe)
set("${var}" "${exe}" PARENT_SCOPE)
return()
endif()
endif()
foreach(major_version IN LISTS major_versions)
foreach(minor_version RANGE 100 -1 -1)
unset(suffix)
if(conf_suffix)
set(suffix "-${conf_suffix}")
endif()
if(major_version)
set(suffix "${suffix}-${major_version}")
foreach(minor_version RANGE 30 -1 -1)
try_wx_util(exe "${util}" "${conf_suffix}" "${major_version}" "${minor_version}")
if(NOT minor_version EQUAL -1)
set(suffix "${suffix}.${minor_version}")
endif()
endif()
# find_program caches the result
set(exe NOTFOUND CACHE INTERNAL "" FORCE)
find_program(exe NAMES "${util}${suffix}")
# try infix variant, as on FreeBSD
if(NOT EXISTS ${exe})
string(REGEX REPLACE "^-" "" suffix "${suffix}")
string(REGEX REPLACE "-" "${suffix}-" try ${util})
set(exe NOTFOUND CACHE INTERNAL "" FORCE)
find_program(exe NAMES ${try})
endif()
if(EXISTS ${exe})
# check that the utility can be executed cleanly
# in case we find e.g. the wrong architecture binary
# when cross-compiling
check_clean_exit(exit_status ${exe} --help)
if(exit_status EQUAL 0)
set(${var} ${exe} PARENT_SCOPE)
return()
endif()
if(exe)
set("${var}" "${exe}" PARENT_SCOPE)
return()
endif()
# don't iterate over minor versions for empty major version

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
resource.xrs Normal file

Binary file not shown.

View File

@@ -278,7 +278,7 @@ recording::MediaRet recording::MediaRecorder::setup_video_stream_info(int width,
switch (pixsize)
{
case 1:
tbord = 1; rbord = 2;
tbord = 1; rbord = 4;
break;
case 2:
// 16-bit: 2 @ right, 1 @ top

View File

@@ -10,8 +10,6 @@ extern "C" {
#include "core/base/system.h"
#include "core/base/message.h"
bool no_border = false;
bool utilWritePNGFile(const char* fileName, int w, int h, uint8_t* pix) {
static constexpr size_t kNumChannels = 3;
uint8_t* writeBuffer = new uint8_t[w * h * kNumChannels];
@@ -23,7 +21,7 @@ bool utilWritePNGFile(const char* fileName, int w, int h, uint8_t* pix) {
switch (systemColorDepth) {
case 8: {
uint8_t* pixU8 = (uint8_t*)pix + (w);
uint8_t* pixU8 = (uint8_t*)pix + (w + 4);
for (int y = 0; y < sizeY; y++) {
for (int x = 0; x < sizeX; x++, pixU8++) {
// White color fix
@@ -38,9 +36,7 @@ bool utilWritePNGFile(const char* fileName, int w, int h, uint8_t* pix) {
}
}
if (no_border == false) {
pixU8 += 2;
}
pixU8 += 4;
}
} break;
case 16: {
@@ -155,11 +151,7 @@ bool utilWriteBMPFile(const char* fileName, int w, int h, uint8_t* pix) {
switch (systemColorDepth) {
case 8: {
uint8_t* pixU8 = 0;
if (no_border == false) {
pixU8 = (uint8_t*)pix + ((w + 2) * (h));
} else {
pixU8 = (uint8_t*)pix + ((w) * (h));
}
pixU8 = (uint8_t*)pix + ((w + 4) * (h));
for (int y = 0; y < sizeY; y++) {
for (int x = 0; x < sizeX; x++, pixU8++) {
@@ -175,13 +167,11 @@ bool utilWriteBMPFile(const char* fileName, int w, int h, uint8_t* pix) {
}
}
if (no_border == false) {
pixU8++;
pixU8++;
pixU8 -= 2 * (w + 2);
} else {
pixU8 -= 2 * (w);
}
pixU8++;
pixU8++;
pixU8++;
pixU8++;
pixU8 -= 2 * (w + 4);
fwrite(writeBuffer, 1, 3 * w, fp);
b = writeBuffer;

View File

@@ -1,5 +1,5 @@
/* Compiler.h : Compiler specific defines and pragmas
2024-01-22 : Igor Pavlov : Public domain */
: Igor Pavlov : Public domain */
#ifndef ZIP7_INC_COMPILER_H
#define ZIP7_INC_COMPILER_H
@@ -183,6 +183,16 @@ typedef void (*Z7_void_Function)(void);
#define Z7_ATTRIB_NO_VECTORIZE
#endif
#if defined(Z7_MSC_VER_ORIGINAL) && (Z7_MSC_VER_ORIGINAL >= 1920)
#define Z7_PRAGMA_OPTIMIZE_FOR_CODE_SIZE _Pragma("optimize ( \"s\", on )")
#define Z7_PRAGMA_OPTIMIZE_DEFAULT _Pragma("optimize ( \"\", on )")
#else
#define Z7_PRAGMA_OPTIMIZE_FOR_CODE_SIZE
#define Z7_PRAGMA_OPTIMIZE_DEFAULT
#endif
#if defined(MY_CPU_X86_OR_AMD64) && ( \
defined(__clang__) && (__clang_major__ >= 4) \
|| defined(__GNUC__) && (__GNUC__ >= 5))

View File

@@ -47,6 +47,12 @@ MY_CPU_64BIT means that processor can work with 64-bit registers.
#define MY_CPU_SIZEOF_POINTER 4
#endif
#if defined(__SSE2__) \
|| defined(MY_CPU_AMD64) \
|| defined(_M_IX86_FP) && (_M_IX86_FP >= 2)
#define MY_CPU_SSE2
#endif
#if defined(_M_ARM64) \
|| defined(_M_ARM64EC) \
@@ -571,10 +577,12 @@ problem-4 : performace:
#define Z7_CONV_BE_TO_NATIVE_CONST32(v) (v)
#define Z7_CONV_LE_TO_NATIVE_CONST32(v) Z7_BSWAP32_CONST(v)
#define Z7_CONV_NATIVE_TO_BE_32(v) (v)
// #define Z7_GET_NATIVE16_FROM_2_BYTES(b0, b1) ((b1) | ((b0) << 8))
#elif defined(MY_CPU_LE)
#define Z7_CONV_BE_TO_NATIVE_CONST32(v) Z7_BSWAP32_CONST(v)
#define Z7_CONV_LE_TO_NATIVE_CONST32(v) (v)
#define Z7_CONV_NATIVE_TO_BE_32(v) Z7_BSWAP32(v)
// #define Z7_GET_NATIVE16_FROM_2_BYTES(b0, b1) ((b0) | ((b1) << 8))
#else
#error Stop_Compiling_Unknown_Endian_CONV
#endif

View File

@@ -59,6 +59,14 @@ BZ2_Inflater::~BZ2_Inflater()
end();
}
blargg_err_t BZ2_Inflater::skip_buf( int count )
{
byte* out = buf.end() - count;
zbuf.avail_in = count;
zbuf.next_in = (char *)out;
return blargg_ok;
}
blargg_err_t BZ2_Inflater::fill_buf( int count )
{
byte* out = buf.end() - count;
@@ -164,6 +172,20 @@ blargg_err_t BZ2_Inflater::read_all( void* out, int count )
}
*/
blargg_err_t BZ2_Inflater::get_size( int* count_io )
{
char *buffer = (char *)malloc(*count_io);
if (buffer == NULL) {
return blargg_err_memory;
}
read(buffer, count_io);
free(buffer);
return blargg_ok;
}
blargg_err_t BZ2_Inflater::read( void* out, int* count_io )
{
int remain = *count_io;

View File

@@ -20,6 +20,7 @@ class BZ2_Inflater
// filled to 4K, or specify buf_size and initial_read for custom buffer size
// and how much to read initially.
blargg_err_t begin(callback_t, void *user_data, int buf_size = 0, int initial_read = 0);
blargg_err_t get_size(int *count_io);
// Data read into buffer by begin()
const unsigned char *data() const
@@ -85,6 +86,7 @@ class BZ2_Inflater
void *user_data;
blargg_err_t fill_buf(int count);
blargg_err_t skip_buf(int count);
};
#endif

View File

@@ -19,6 +19,8 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
#include "blargg_source.h"
#include <bzlib.h>
BZ2_Reader::BZ2_Reader()
{
close();
@@ -34,8 +36,16 @@ static blargg_err_t BZ2_reader_read( void* file, void* out, int* count )
blargg_err_t BZ2_Reader::calc_size()
{
size_ = 33554432;
size_ = 0x8000000; // Max cart size
crc32_ = 0;
set_remain(size_);
inflater.get_size(&size_);
fprintf(stderr, "Calculated BZ2 size: %d\n", size_);
in->seek(0);
return blargg_ok;
}
@@ -48,6 +58,9 @@ blargg_err_t BZ2_Reader::open( File_Reader* new_in )
RETURN_ERR( inflater.begin( BZ2_reader_read, new_in ) );
RETURN_ERR( inflater.set_mode( inflater.mode_auto ) );
RETURN_ERR( calc_size() );
inflater.end();
RETURN_ERR( inflater.begin( BZ2_reader_read, new_in ) );
RETURN_ERR( inflater.set_mode( inflater.mode_auto ) );
set_remain( size_ );
return blargg_ok;
@@ -65,7 +78,7 @@ blargg_err_t BZ2_Reader::read_v( void* out, int count )
int actual = count;
RETURN_ERR( inflater.read( out, &actual ) );
if ( actual < count ) {
if ( actual < size_ ) {
size_ = actual;
inflater.resize_buffer(actual);
set_remain(0);

View File

@@ -3905,7 +3905,7 @@ void gbDrawLine()
uint8_t* dest = (uint8_t*)g_pix + gbBorderLineSkip * (register_LY + gbBorderRowSkip)
+ gbBorderColumnSkip;
#else
uint8_t* dest = (uint8_t*)g_pix + (gbBorderLineSkip + 2) * (register_LY + gbBorderRowSkip + 1)
uint8_t* dest = (uint8_t*)g_pix + (gbBorderLineSkip + 4) * (register_LY + gbBorderRowSkip + 1)
+ gbBorderColumnSkip;
#endif
for (size_t x = 0; x < kGBWidth;) {
@@ -3932,7 +3932,7 @@ void gbDrawLine()
if (gbBorderOn)
dest += gbBorderColumnSkip;
#ifndef __LIBRETRO__
*dest++ = 0; // for filters that read one pixel more
* dest++ = 0; // for filters that read one pixel more
#endif
} break;
case 16: {
@@ -3970,48 +3970,62 @@ void gbDrawLine()
*dest++ = 0; // for filters that read one pixel more
#endif
} break;
case 24: {
uint8_t* dest = (uint8_t*)g_pix + 3 * (gbBorderLineSkip * (register_LY + gbBorderRowSkip) + gbBorderColumnSkip);
uint8_t* dest = (uint8_t*)g_pix + (gbBorderLineSkip * 3) * (register_LY + gbBorderRowSkip + 1)
+ (gbBorderColumnSkip * 3);
for (size_t x = 0; x < kGBWidth;) {
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
uint32_t color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[gbLineMix[x++]];
dest += 3;
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[gbLineMix[x++]];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
}
} break;
case 32: {
#ifdef __LIBRETRO__
uint32_t* dest = (uint32_t*)g_pix + gbBorderLineSkip * (register_LY + gbBorderRowSkip)

View File

@@ -16,7 +16,7 @@ extern long soundSampleRate; // current sound quality
gb_effects_config_t gb_effects_config = { false, 0.20f, 0.15f, false };
static gb_effects_config_t gb_effects_config_current;
static Simple_Effects_Buffer* stereo_buffer;
static Simple_Effects_Buffer* stereo_buffer = 0;
static Gb_Apu* gb_apu;
static float soundVolume_ = -1;

View File

@@ -165,6 +165,8 @@ uint8_t memoryWait32[16] = { 0, 0, 5, 0, 0, 1, 1, 0, 7, 7, 9, 9, 13, 13, 4, 0 };
uint8_t memoryWaitSeq[16] = { 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 4, 4, 8, 8, 4, 0 };
uint8_t memoryWaitSeq32[16] = { 0, 0, 5, 0, 0, 1, 1, 0, 5, 5, 9, 9, 17, 17, 4, 0 };
GBAMatrix_t stateMatrix;
// The videoMemoryWait constants are used to add some waitstates
// if the opcode access video memory data outside of vblank/hblank
// It seems to happen on only one ticks for each pixel.
@@ -474,6 +476,40 @@ variable_desc saveGameStruct[] = {
};
static int romSize = SIZE_ROM;
static int pristineRomSize = 0;
#define MAPPING_MASK (GBA_MATRIX_MAPPINGS_MAX - 1)
static void _remapMatrix(GBAMatrix_t *matrix)
{
if (matrix == NULL) {
log("Matrix is NULL");
return;
}
if (matrix->vaddr & 0xFFFFE1FF) {
log("Invalid Matrix mapping: %08X", matrix->vaddr);
return;
}
if (matrix->size & 0xFFFFE1FF) {
log("Invalid Matrix size: %08X", matrix->size);
return;
}
if ((matrix->vaddr + matrix->size - 1) & 0xFFFFE000) {
log("Invalid Matrix mapping end: %08X", matrix->vaddr + matrix->size);
return;
}
int start = matrix->vaddr >> 9;
int size = (matrix->size >> 9) & MAPPING_MASK;
int i;
for (i = 0; i < size; ++i) {
matrix->mappings[(start + i) & MAPPING_MASK] = matrix->paddr + (i << 9);
}
if ((g_rom2 != NULL) && (g_rom != NULL)) {
memcpy(&g_rom[matrix->vaddr], &g_rom2[matrix->paddr], matrix->size);
}
}
void gbaUpdateRomSize(int size)
{
@@ -485,7 +521,7 @@ void gbaUpdateRomSize(int size)
g_rom = tmp;
uint16_t* temp = (uint16_t*)(g_rom + ((romSize + 1) & ~1));
for (int i = (romSize + 1) & ~1; i < SIZE_ROM; i += 2) {
for (int i = (romSize + 1) & ~1; i < romSize; i += 2) {
WRITE16LE(temp, (i >> 1) & 0xFFFF);
temp++;
}
@@ -638,6 +674,15 @@ unsigned int CPUWriteState(uint8_t* data)
soundSaveGame(data);
rtcSaveGame(data);
if (pristineRomSize > SIZE_ROM) {
uint8_t ident = 0;
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
utilWriteMem(data, &GBAMatrix, sizeof(GBAMatrix));
}
}
return (ptrdiff_t)data - (ptrdiff_t)orig;
}
@@ -683,6 +728,15 @@ bool CPUReadState(const uint8_t* data)
soundReadGame(data);
rtcReadGame(data);
if (pristineRomSize > SIZE_ROM) {
uint8_t ident = 0;
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
utilReadMem(&stateMatrix, data, sizeof(stateMatrix));
}
}
//// Copypasta stuff ...
// set pointers!
coreOptions.layerEnable = coreOptions.layerSettings & DISPCNT;
@@ -710,6 +764,27 @@ bool CPUReadState(const uint8_t* data)
CPUUpdateRegister(0x204, CPUReadHalfWordQuick(0x4000204));
if (pristineRomSize > SIZE_ROM) {
uint8_t ident = 0;
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
GBAMatrix.size = 0x200;
for (int i = 0; i < 16; ++i) {
GBAMatrix.mappings[i] = stateMatrix.mappings[i];
GBAMatrix.paddr = GBAMatrix.mappings[i];
GBAMatrix.vaddr = i << 9;
_remapMatrix(&GBAMatrix);
}
GBAMatrix.cmd = stateMatrix.cmd;
GBAMatrix.paddr = stateMatrix.paddr;
GBAMatrix.vaddr = stateMatrix.vaddr;
GBAMatrix.size = stateMatrix.size;
}
}
return true;
}
@@ -749,6 +824,15 @@ static bool CPUWriteState(gzFile gzFile)
// version 1.5
rtcSaveGame(gzFile);
if (pristineRomSize > SIZE_ROM) {
uint8_t ident = 0;
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
utilGzWrite(gzFile, &GBAMatrix, sizeof(GBAMatrix));
}
}
return true;
}
@@ -880,6 +964,15 @@ static bool CPUReadState(gzFile gzFile)
rtcReadGame(gzFile);
}
if (pristineRomSize > SIZE_ROM) {
uint8_t ident = 0;
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
utilGzRead(gzFile, &stateMatrix, sizeof(stateMatrix));
}
}
if (version <= SAVE_GAME_VERSION_7) {
uint32_t temp;
#define SWAP(a, b, c) \
@@ -930,6 +1023,27 @@ static bool CPUReadState(gzFile gzFile)
CPUUpdateRegister(0x204, CPUReadHalfWordQuick(0x4000204));
if (pristineRomSize > SIZE_ROM) {
uint8_t ident = 0;
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
GBAMatrix.size = 0x200;
for (int i = 0; i < 16; ++i) {
GBAMatrix.mappings[i] = stateMatrix.mappings[i];
GBAMatrix.paddr = GBAMatrix.mappings[i];
GBAMatrix.vaddr = i << 9;
_remapMatrix(&GBAMatrix);
}
GBAMatrix.cmd = stateMatrix.cmd;
GBAMatrix.paddr = stateMatrix.paddr;
GBAMatrix.vaddr = stateMatrix.vaddr;
GBAMatrix.size = stateMatrix.size;
}
}
return true;
}
@@ -1389,6 +1503,11 @@ void CPUCleanUp()
g_rom = NULL;
}
if (g_rom2 != NULL) {
free(g_rom2);
g_rom2 = NULL;
}
if (g_vram != NULL) {
free(g_vram);
g_vram = NULL;
@@ -1479,16 +1598,93 @@ void SetMapMasks()
#endif
}
void GBAMatrixReset(GBAMatrix_t *matrix) {
if (matrix == NULL) {
log("Matrix is NULL");
return;
}
memset(matrix->mappings, 0, sizeof(matrix->mappings));
matrix->size = 0x1000;
matrix->paddr = 0;
matrix->vaddr = 0;
_remapMatrix(matrix);
matrix->paddr = 0x200;
matrix->vaddr = 0x1000;
_remapMatrix(matrix);
}
void GBAMatrixWrite(GBAMatrix_t *matrix, uint32_t address, uint32_t value)
{
if (matrix == NULL) {
log("Matrix is NULL");
return;
}
switch (address) {
case 0x0:
matrix->cmd = value;
switch (value) {
case 0x01:
case 0x11:
_remapMatrix(matrix);
break;
default:
log("Unknown Matrix command: %08X", value);
break;
}
return;
case 0x4:
matrix->paddr = value & 0x03FFFFFF;
return;
case 0x8:
matrix->vaddr = value & 0x007FFFFF;
return;
case 0xC:
if (value == 0) {
log("Rejecting Matrix write for size 0");
return;
}
matrix->size = value << 9;
return;
}
log("Unknown Matrix write: %08X:%04X", address, value);
}
void GBAMatrixWrite16(GBAMatrix_t *matrix, uint32_t address, uint16_t value)
{
if (matrix == NULL) {
log("Matrix is NULL");
return;
}
switch (address) {
case 0x0:
GBAMatrixWrite(matrix, address, value | (matrix->cmd & 0xFFFF0000));
break;
case 0x4:
GBAMatrixWrite(matrix, address, value | (matrix->paddr & 0xFFFF0000));
break;
case 0x8:
GBAMatrixWrite(matrix, address, value | (matrix->vaddr & 0xFFFF0000));
break;
case 0xC:
GBAMatrixWrite(matrix, address, value | (matrix->size & 0xFFFF0000));
break;
}
}
int CPULoadRom(const char* szFile)
{
romSize = SIZE_ROM;
romSize = SIZE_ROM * 4;
if (g_rom != NULL) {
CPUCleanUp();
}
systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
g_rom = (uint8_t*)malloc(SIZE_ROM);
g_rom = (uint8_t*)malloc(SIZE_ROM * 4);
if (g_rom == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"ROM");
@@ -1539,13 +1735,39 @@ int CPULoadRom(const char* szFile)
}
}
memset(&GBAMatrix, 0, sizeof(GBAMatrix));
pristineRomSize = romSize;
uint16_t* temp = (uint16_t*)(g_rom + ((romSize + 1) & ~1));
int i;
for (i = (romSize + 1) & ~1; i < SIZE_ROM; i += 2) {
for (i = (romSize + 1) & ~1; i < romSize; i += 2) {
WRITE16LE(temp, (i >> 1) & 0xFFFF);
temp++;
}
char ident = 0;
if (romSize > SIZE_ROM) {
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
g_rom2 = (uint8_t*)malloc(SIZE_ROM * 4);
if (!utilLoad(szFile,
utilIsGBAImage,
g_rom2,
romSize)) {
free(g_rom2);
g_rom2 = NULL;
}
romSize = 0x01000000;
log("GBA Matrix detected");
} else {
romSize = SIZE_ROM;
}
}
g_bios = (uint8_t*)calloc(1, SIZE_BIOS);
if (g_bios == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
@@ -1607,14 +1829,14 @@ int CPULoadRom(const char* szFile)
int CPULoadRomData(const char* data, int size)
{
romSize = SIZE_ROM;
romSize = SIZE_ROM * 4;
if (g_rom != NULL) {
CPUCleanUp();
}
systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
g_rom = (uint8_t*)malloc(SIZE_ROM);
g_rom = (uint8_t*)malloc(SIZE_ROM * 4);
if (g_rom == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
"ROM");
@@ -1632,13 +1854,31 @@ int CPULoadRomData(const char* data, int size)
romSize = size % 2 == 0 ? size : size + 1;
memcpy(whereToLoad, data, size);
memset(&GBAMatrix, 0, sizeof(GBAMatrix));
pristineRomSize = romSize;
uint16_t* temp = (uint16_t*)(g_rom + ((romSize + 1) & ~1));
int i;
for (i = (romSize + 1) & ~1; i < SIZE_ROM; i += 2) {
for (i = (romSize + 1) & ~1; i < romSize; i += 2) {
WRITE16LE(temp, (i >> 1) & 0xFFFF);
temp++;
}
if (romSize > SIZE_ROM) {
char ident = 0;
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
g_rom2 = (uint8_t *)malloc(SIZE_ROM * 4);
memcpy(g_rom2, data, size);
romSize = 0x01000000;
log("GBA Matrix detected");
} else {
romSize = SIZE_ROM;
}
}
g_bios = (uint8_t*)calloc(1, SIZE_BIOS);
if (g_bios == NULL) {
systemMessage(MSG_OUT_OF_MEMORY, N_("Failed to allocate memory for %s"),
@@ -3686,6 +3926,15 @@ void CPUReset()
lastTime = systemGetClock();
SWITicks = 0;
if (pristineRomSize > SIZE_ROM) {
char ident = 0;
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
GBAMatrixReset(&GBAMatrix);
}
}
}
void CPUInterrupt()
@@ -3962,7 +4211,7 @@ void CPULoop(int ticks)
#ifdef __LIBRETRO__
uint8_t* dest = (uint8_t*)g_pix + 240 * VCOUNT;
#else
uint8_t* dest = (uint8_t*)g_pix + 242 * (VCOUNT + 1);
uint8_t* dest = (uint8_t*)g_pix + 244 * (VCOUNT + 1);
#endif
for (int x = 0; x < 240;) {
*dest++ = systemColorMap8[g_lineMix[x++] & 0xFFFF];
@@ -3985,9 +4234,9 @@ void CPULoop(int ticks)
*dest++ = systemColorMap8[g_lineMix[x++] & 0xFFFF];
*dest++ = systemColorMap8[g_lineMix[x++] & 0xFFFF];
}
// for filters that read past the screen
// for filters that read past the screen
#ifndef __LIBRETRO__
*dest++ = 0;
* dest++ = 0;
#endif
} break;
case 16: {
@@ -4023,43 +4272,58 @@ void CPULoop(int ticks)
#endif
} break;
case 24: {
uint8_t* dest = (uint8_t*)g_pix + 240 * VCOUNT * 3;
uint8_t* dest = (uint8_t*)g_pix + (240 * 3) * (VCOUNT + 1);
for (int x = 0; x < 240;) {
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
uint32_t color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
*((uint32_t*)dest) = systemColorMap32[g_lineMix[x++] & 0xFFFF];
dest += 3;
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
color = systemColorMap32[g_lineMix[x++] & 0xFFFF];
*dest++ = (uint8_t)(color & 0xFF);
*dest++ = (uint8_t)((color >> 8) & 0xFF);
*dest++ = (uint8_t)((color >> 16) & 0xFF);
}
} break;
case 32: {

View File

@@ -2593,6 +2593,19 @@ static INSN_REGPARM void armE01(uint32_t opcode)
#define armE01 armUnknownInsn
#endif
static INSN_REGPARM void armE80(uint32_t opcode)
{
if ((opcode & 0xFFFC0000) == (0xEE800000)) {
#ifdef GBA_LOGGING
if (systemVerbose & VERBOSE_UNDEFINED)
log("Undefined Wii U ARM instruction %08x at %08Xx\n", opcode, armNextPC - 4);
#endif
return;
}
armUnknownInsn(opcode);
}
// SWI <comment>
static INSN_REGPARM void armF00(uint32_t opcode)
{
@@ -2791,7 +2804,11 @@ static insnfunc_t armInsnTable[4096] = {
REP16(arm_UI), // E20
REP16(arm_UI), // E30
REP16(arm_UI), REP16(arm_UI), REP16(arm_UI), REP16(arm_UI), // E40
REP16(arm_UI), REP16(arm_UI), REP16(arm_UI), REP16(arm_UI), // E80
armE80, arm_UI, arm_UI, arm_UI, arm_UI, arm_UI, arm_UI, arm_UI, // E80
arm_UI, arm_UI, arm_UI, arm_UI, arm_UI, arm_UI, arm_UI, arm_UI, // E88
REP16(arm_UI), REP16(arm_UI), REP16(arm_UI), // E90
REP16(arm_UI), REP16(arm_UI), REP16(arm_UI), REP16(arm_UI), // EC0
REP256(armF00), // F00

View File

@@ -26,8 +26,11 @@ bool gba_joybus_active = false;
// 0x0000 to 0x7FFF: set custom 15 bit color
int customBackdropColor = -1;
GBAMatrix_t GBAMatrix;
uint8_t* g_bios = 0;
uint8_t* g_rom = 0;
uint8_t* g_rom2 = 0;
uint8_t* g_internalRAM = 0;
uint8_t* g_workRAM = 0;
uint8_t* g_paletteRAM = 0;

View File

@@ -15,6 +15,23 @@
#define VERBOSE_AGBPRINT 512
#define VERBOSE_SOUNDOUTPUT 1024
#define GBA_MATRIX_MAPPINGS_MAX 16
typedef struct GBAMatrix {
uint32_t cmd;
uint32_t paddr;
uint32_t vaddr;
uint32_t size;
uint32_t mappings[GBA_MATRIX_MAPPINGS_MAX];
} GBAMatrix_t;
extern GBAMatrix_t GBAMatrix;
extern void GBAMatrixReset(GBAMatrix_t *matrix);
extern void GBAMatrixWrite(GBAMatrix_t *matrix, uint32_t address, uint32_t value);
extern void GBAMatrixWrite16(GBAMatrix_t *matrix, uint32_t address, uint16_t value);
extern reg_pair reg[45];
extern bool ioReadable[0x400];
extern bool N_FLAG;
@@ -32,6 +49,7 @@ extern int customBackdropColor;
extern uint8_t* g_bios;
extern uint8_t* g_rom;
extern uint8_t* g_rom2;
extern uint8_t* g_internalRAM;
extern uint8_t* g_workRAM;
extern uint8_t* g_paletteRAM;

View File

@@ -535,6 +535,17 @@ static inline void CPUWriteMemory(uint32_t address, uint32_t value)
#endif
WRITE32LE(((uint32_t*)&g_oam[address & 0x3fc]), value);
break;
case 0x08:
case 0x09:
case 0x0A:
case 0x0B:
case 0x0C:
if (GBAMatrix.size && (address & 0x01FFFF00) == 0x00800100)
{
GBAMatrixWrite(&GBAMatrix, address & 0x3C, value);
break;
}
goto unwritable;
case 0x0D:
if (cpuEEPROMEnabled) {
eepromWrite(address, DowncastU8(value));
@@ -639,12 +650,26 @@ static inline void CPUWriteHalfWord(uint32_t address, uint16_t value)
break;
case 8:
case 9:
if (GBAMatrix.size && (address & 0x01FFFF00) == 0x00800100)
{
GBAMatrixWrite16(&GBAMatrix, address & 0x3C, value);
break;
}
if (address == 0x80000c4 || address == 0x80000c6 || address == 0x80000c8) {
if (!rtcWrite(address, value))
goto unwritable;
} else if (!agbPrintWrite(address, value))
goto unwritable;
break;
case 10:
case 11:
case 12:
if (GBAMatrix.size && (address & 0x01FFFF00) == 0x00800100)
{
GBAMatrixWrite16(&GBAMatrix, address & 0x3C, value);
break;
}
goto unwritable;
case 13:
if (cpuEEPROMEnabled) {
eepromWrite(address, (uint8_t)value);

View File

@@ -1632,12 +1632,26 @@ bool retro_load_game(const struct retro_game_info *game)
desc[1].start=0x02000000; desc[1].select=0xFF000000; desc[1].len=0x40000; desc[1].ptr=g_workRAM;//slow WRAM
/* TODO: if SRAM is flash, use start=0 addrspace="S" instead */
desc[2].start=0x0E000000; desc[2].select=0; desc[2].len=g_flashSize; desc[2].ptr=flashSaveMemory;//SRAM
desc[3].start=0x08000000; desc[3].select=0; desc[3].len=romSize; desc[3].ptr=g_rom;//ROM
desc[3].flags=RETRO_MEMDESC_CONST;
desc[4].start=0x0A000000; desc[4].select=0; desc[4].len=romSize; desc[4].ptr=g_rom;//ROM mirror 1
desc[4].flags=RETRO_MEMDESC_CONST;
desc[5].start=0x0C000000; desc[5].select=0; desc[5].len=romSize; desc[5].ptr=g_rom;//ROM mirror 2
desc[5].flags=RETRO_MEMDESC_CONST;
char ident = 0;
memcpy(&ident, &g_rom[0xAC], 1);
if (ident == 'M') {
desc[3].start=0x08000000; desc[3].select=0; desc[3].len=SIZE_ROM; desc[3].ptr=g_rom;//ROM
desc[3].flags=RETRO_MEMDESC_CONST;
desc[4].start=0x0A000000; desc[4].select=0; desc[4].len=SIZE_ROM; desc[4].ptr=g_rom;//ROM mirror 1
desc[4].flags=RETRO_MEMDESC_CONST;
desc[5].start=0x0C000000; desc[5].select=0; desc[5].len=SIZE_ROM; desc[5].ptr=g_rom;//ROM mirror 2
desc[5].flags=RETRO_MEMDESC_CONST;
} else {
desc[3].start=0x08000000; desc[3].select=0; desc[3].len=romSize; desc[3].ptr=g_rom;//ROM
desc[3].flags=RETRO_MEMDESC_CONST;
desc[4].start=0x0A000000; desc[4].select=0; desc[4].len=romSize; desc[4].ptr=g_rom;//ROM mirror 1
desc[4].flags=RETRO_MEMDESC_CONST;
desc[5].start=0x0C000000; desc[5].select=0; desc[5].len=romSize; desc[5].ptr=g_rom;//ROM mirror 2
desc[5].flags=RETRO_MEMDESC_CONST;
}
desc[6].start=0x00000000; desc[6].select=0; desc[6].len=0x4000; desc[6].ptr=g_bios;//BIOS
desc[6].flags=RETRO_MEMDESC_CONST;
desc[7].start=0x06000000; desc[7].select=0xFF000000; desc[7].len=0x18000; desc[7].ptr=g_vram;//VRAM
@@ -1732,7 +1746,7 @@ bool retro_load_game(const struct retro_game_info *game)
update_input_descriptors(); // Initialize input descriptors and info
update_variables(false);
uint8_t* state_buf = (uint8_t*)malloc(2000000);
uint8_t* state_buf = (uint8_t*)malloc(2000080);
serialize_size = core->emuWriteState(state_buf);
free(state_buf);

View File

@@ -1163,7 +1163,7 @@ void sdlInitVideo()
switch (systemColorDepth)
{
case 8:
srcPitch = sizeX * (systemColorDepth >> 3) + 2;
srcPitch = sizeX * (systemColorDepth >> 3) + 4;
break;
case 16:
@@ -1186,7 +1186,7 @@ void sdlInitVideo()
} else {
#ifdef CONFIG_8BIT
systemColorDepth = 8;
srcPitch = sizeX * (systemColorDepth >> 3) + 2;
srcPitch = sizeX * (systemColorDepth >> 3) + 4;
#elif defined(CONFIG_16BIT)
systemColorDepth = 16;
srcPitch = sizeX * (systemColorDepth >> 3) + 4;

View File

@@ -394,6 +394,9 @@ if(APPLE)
default
)
endif()
# Needed for CoreAudio.
target_compile_options(visualboyadvance-m PRIVATE -Wno-error=elaborated-enum-base)
endif()
target_sources(visualboyadvance-m PRIVATE ${VBAM_WX_COMMON} ${VBAM_ICON_PATH})
@@ -479,6 +482,7 @@ if(WIN32)
PRIVATE
audio/internal/dsound.cpp
wxvbam.rc
wxvbam_translations.rc
)
target_link_libraries(visualboyadvance-m
dxguid dsound wsock32 ws2_32 imm32 version winmm)

View File

@@ -106,12 +106,12 @@ public:
uint16_t current_rate = 0;
int current_buffer = 0;
int filled_buffers = 0;
int soundBufferLen = 0;
AudioTimeStamp starttime;
AudioTimeStamp timestamp;
AudioQueueTimelineRef timeline;
private:
int soundBufferLen = 0;
AudioDeviceID GetCoreAudioDevice(wxString name);
void setBuffer(uint16_t* finalWave, int length);
@@ -120,13 +120,29 @@ private:
static void PlaybackBufferReadyCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer)
{
int curbuf = 0;
CoreAudioAudio *cadevice = (CoreAudioAudio *)inUserData;
(void)inAQ;
for (curbuf = 0; curbuf < OPTION(kSoundBuffers); curbuf++) {
if (cadevice->buffers[curbuf] == inBuffer) {
break;
}
}
if (curbuf >= OPTION(kSoundBuffers))
return;
// buffer is unexpectedly here? We're probably dying, but try to requeue this buffer with silence.
if (inBuffer) {
memset(inBuffer->mAudioData, 0, inBuffer->mAudioDataBytesCapacity);
inBuffer->mAudioDataByteSize = 0;
if (cadevice->buffers[curbuf] != NULL) {
AudioQueueFreeBuffer(inAQ, cadevice->buffers[curbuf]);
cadevice->soundBufferLen = (soundGetSampleRate() / 60) * cadevice->description.mBytesPerPacket;
AudioQueueAllocateBuffer(inAQ, cadevice->soundBufferLen, &cadevice->buffers[curbuf]);
cadevice->buffers[curbuf]->mAudioDataByteSize = 0;
} else {
cadevice->soundBufferLen = (soundGetSampleRate() / 60) * cadevice->description.mBytesPerPacket;
AudioQueueAllocateBuffer(inAQ, cadevice->soundBufferLen, &cadevice->buffers[curbuf]);
cadevice->buffers[curbuf]->mAudioDataByteSize = 0;
}
if (cadevice->filled_buffers > 0) {
@@ -491,8 +507,8 @@ void CoreAudioAudio::write(uint16_t* finalWave, int length) {
current_buffer = 0;
}
while (filled_buffers >= (OPTION(kSoundBuffers) - 1)) {
wxMilliSleep(1);
while (filled_buffers >= OPTION(kSoundBuffers)) {
wxMilliSleep(((soundGetSampleRate() / 60) * 4) / (soundGetSampleRate() >> 7));
}
}
@@ -507,8 +523,8 @@ void CoreAudioAudio::write(uint16_t* finalWave, int length) {
current_buffer = 0;
}
while (filled_buffers >= (OPTION(kSoundBuffers) - 1)) {
wxMilliSleep(1);
while (filled_buffers >= OPTION(kSoundBuffers)) {
wxMilliSleep(((soundGetSampleRate() / 60) * 4) / (soundGetSampleRate() >> 7));
}
}

View File

@@ -113,8 +113,6 @@ void SDLAudio::deinit() {
SDLAudio::~SDLAudio() {
deinit();
SDL_QuitSubSystem(SDL_INIT_AUDIO);
}
bool SDLAudio::init(long sampleRate) {

View File

@@ -27,10 +27,78 @@
#include "wx/config/option-proxy.h"
#include "wx/config/option.h"
#include "wx/dialogs/game-maker.h"
#include "wx/wxvbam.h"
#include "wx/widgets/group-check-box.h"
#include "wx/widgets/user-input-ctrl.h"
#include "wx/widgets/utils.h"
#define GetXRCDialog(n) \
wxStaticCast(wxGetApp().frame->FindWindowByName(n), wxDialog)
void RefreshFrame(void)
{
wxXmlResource* xr = wxXmlResource::Get();
const wxRect client_rect(
OPTION(kGeomWindowX).Get(),
OPTION(kGeomWindowY).Get(),
OPTION(kGeomWindowWidth).Get(),
OPTION(kGeomWindowHeight).Get());
const bool is_fullscreen = OPTION(kGeomFullScreen);
const bool is_maximized = OPTION(kGeomIsMaximized);
// note: if linking statically, next 2 pull in lot of unused code
// maybe in future if not wxSHARED, load only builtin-needed handlers
xr->InitAllHandlers();
xr->AddHandler(new widgets::GroupCheckBoxXmlHandler());
xr->AddHandler(new widgets::UserInputCtrlXmlHandler());
wxInitAllImageHandlers();
wxGetApp().SetExitOnFrameDelete(false);
if (wxGetApp().frame)
wxGetApp().frame->Destroy();
wxGetApp().frame = wxDynamicCast(xr->LoadFrame(nullptr, "MainFrame"), MainFrame);
if (!wxGetApp().frame) {
wxLogError(_("Could not create main window"));
return;
}
wxConfigBase* cfg = wxConfigBase::Get();
gopts.recent = new wxFileHistory(10);
cfg->SetPath("/Recent");
gopts.recent->Load(*cfg);
cfg->SetPath("/");
cfg->Flush();
// Create() cannot be overridden easily
if (!wxGetApp().frame->BindControls()) {
return;
}
// Ensure we are not drawing out of bounds.
if (widgets::GetDisplayRect().Intersects(client_rect)) {
wxGetApp().frame->SetSize(client_rect);
}
if (is_maximized) {
wxGetApp().frame->Maximize();
}
if (is_fullscreen && wxGetApp().pending_load != wxEmptyString)
wxGetApp().frame->ShowFullScreen(is_fullscreen);
wxGetApp().frame->Show(true);
// Windows can render the taskbar icon late if this is done in MainFrame
// It may also not update at all until the Window has been minimized/restored
// This seems timing related, possibly based on HWND
// So do this here since it reliably draws the Taskbar icon on Window creation.
wxGetApp().frame->BindAppIcon();
wxGetApp().SetExitOnFrameDelete(true);
}
void MainFrame::GetMenuOptionBool(const wxString& menuName, bool* field)
{
VBAM_CHECK(field);
@@ -2643,13 +2711,773 @@ EVT_HANDLER(LinkConfigure, "Link options...")
#endif
}
EVT_HANDLER(ExternalTranslations, "Use external translations")
{
GetMenuOptionConfig("ExternalTranslations", config::OptionID::kExternalTranslations);
}
EVT_HANDLER(Language0, "Default Language")
{
OPTION(kLocale) = wxLANGUAGE_DEFAULT;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_DEFAULT);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language1, "Bulgarian")
{
OPTION(kLocale) = wxLANGUAGE_BULGARIAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_BULGARIAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language2, "Breton")
{
OPTION(kLocale) = wxLANGUAGE_BRETON;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_BRETON);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language3, "Czech")
{
OPTION(kLocale) = wxLANGUAGE_CZECH;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_CZECH);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language4, "German")
{
OPTION(kLocale) = wxLANGUAGE_GERMAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_GERMAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language5, "Greek")
{
OPTION(kLocale) = wxLANGUAGE_GREEK;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_GREEK);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language6, "English (US)")
{
OPTION(kLocale) = wxLANGUAGE_ENGLISH_US;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_ENGLISH_US);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language7, "Spanish (Latin American)")
{
OPTION(kLocale) = wxLANGUAGE_SPANISH_LATIN_AMERICA;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_SPANISH_LATIN_AMERICA);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language8, "Spanish (Colombia)")
{
OPTION(kLocale) = wxLANGUAGE_SPANISH_COLOMBIA;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_SPANISH_COLOMBIA);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language9, "Spanish (Peru)")
{
OPTION(kLocale) = wxLANGUAGE_SPANISH_PERU;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_SPANISH_PERU);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language10, "Spanish (US)")
{
OPTION(kLocale) = wxLANGUAGE_SPANISH_US;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_SPANISH_US);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language11, "Spanish")
{
OPTION(kLocale) = wxLANGUAGE_SPANISH;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_SPANISH);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language12, "French (France)")
{
OPTION(kLocale) = wxLANGUAGE_FRENCH_FRANCE;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_FRENCH_FRANCE);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language13, "French")
{
OPTION(kLocale) = wxLANGUAGE_FRENCH;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_FRENCH);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language14, "Galician")
{
OPTION(kLocale) = wxLANGUAGE_GALICIAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_GALICIAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language15, "Hebrew (Israel)")
{
OPTION(kLocale) = wxLANGUAGE_HEBREW_ISRAEL;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_HEBREW_ISRAEL);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language16, "Hungarian (Hungary)")
{
OPTION(kLocale) = wxLANGUAGE_HUNGARIAN_HUNGARY;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_HUNGARIAN_HUNGARY);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language17, "Hungarian")
{
OPTION(kLocale) = wxLANGUAGE_HUNGARIAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_HUNGARIAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language18, "Indonesian")
{
OPTION(kLocale) = wxLANGUAGE_INDONESIAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_INDONESIAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language19, "Italian")
{
OPTION(kLocale) = wxLANGUAGE_ITALIAN_ITALY;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_ITALIAN_ITALY);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language20, "Japanese")
{
OPTION(kLocale) = wxLANGUAGE_JAPANESE;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_JAPANESE);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language21, "Korean (Korea)")
{
OPTION(kLocale) = wxLANGUAGE_KOREAN_KOREA;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_KOREAN_KOREA);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language22, "Korean")
{
OPTION(kLocale) = wxLANGUAGE_KOREAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_KOREAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language23, "Malay (Malaysia)")
{
OPTION(kLocale) = wxLANGUAGE_MALAY_MALAYSIA;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_MALAY_MALAYSIA);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language24, "Norwegian")
{
OPTION(kLocale) = wxLANGUAGE_NORWEGIAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_NORWEGIAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language25, "Dutch")
{
OPTION(kLocale) = wxLANGUAGE_DUTCH;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_DUTCH);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language26, "Polish (Poland)")
{
OPTION(kLocale) = wxLANGUAGE_POLISH_POLAND;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_POLISH_POLAND);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language27, "Polish")
{
OPTION(kLocale) = wxLANGUAGE_POLISH;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_POLISH);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language28, "Portuguese (Brazil)")
{
OPTION(kLocale) = wxLANGUAGE_PORTUGUESE_BRAZILIAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_PORTUGUESE_BRAZILIAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language29, "Portuguese (Portugal)")
{
OPTION(kLocale) = wxLANGUAGE_PORTUGUESE_PORTUGAL;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_PORTUGUESE_PORTUGAL);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language30, "Russian (Russia)")
{
OPTION(kLocale) = wxLANGUAGE_RUSSIAN_RUSSIA;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_RUSSIAN_RUSSIA);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language31, "Swedish")
{
OPTION(kLocale) = wxLANGUAGE_SWEDISH;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_SWEDISH);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language32, "Turkish")
{
OPTION(kLocale) = wxLANGUAGE_TURKISH;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_TURKISH);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language33, "Ukrainian")
{
OPTION(kLocale) = wxLANGUAGE_UKRAINIAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_UKRAINIAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language34, "Urdu (Pakistan)")
{
OPTION(kLocale) = wxLANGUAGE_URDU_PAKISTAN;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_URDU_PAKISTAN);
update_opts();
RefreshFrame();
}
EVT_HANDLER(Language35, "Chinese (China)")
{
OPTION(kLocale) = wxLANGUAGE_CHINESE_CHINA;
if (wxvbam_locale != NULL)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
wxvbam_locale->Init(OPTION(kLocale), wxLOCALE_LOAD_DEFAULT);
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam", wxLANGUAGE_CHINESE_CHINA);
update_opts();
RefreshFrame();
}
// Dummy for disabling system key bindings
EVT_HANDLER_MASK(NOOP, "Do nothing", CMDEN_NEVER)
{
}
// The following have been moved to dialogs
// I will not implement as command unless there is great demand
// I will not implement as command unless there is great demand cvbn,;
// CheatsList
//EVT_HANDLER(CheatsLoad, "Load Cheats...")
//EVT_HANDLER(CheatsSave, "Save Cheats...")

View File

@@ -252,6 +252,8 @@ std::array<Option, kNbOptions>& Option::All() {
int32_t volume = 100;
uint32_t bitdepth = 3;
wxString sdlrenderer = wxString("default");
int locale = wxLANGUAGE_DEFAULT;
bool exttrans = false;
};
static OwnedOptions g_owned_opts;
@@ -393,6 +395,8 @@ std::array<Option, kNbOptions>& Option::All() {
Option(OptionID::kSoundDSoundHWAccel, &g_owned_opts.dsound_hw_accel),
Option(OptionID::kSoundUpmix, &g_owned_opts.upmix),
Option(OptionID::kSoundVolume, &g_owned_opts.volume, 0, 200),
Option(OptionID::kLocale, &g_owned_opts.locale, 0, 911),
Option(OptionID::kExternalTranslations, &g_owned_opts.exttrans)
};
// clang-format on
return g_all_opts;
@@ -602,6 +606,8 @@ const std::array<OptionData, kNbOptions + 1> kAllOptionsData = {
OptionData{"Sound/DSoundHWAccel", "DSoundHWAccel", _("Use DirectSound hardware acceleration")},
OptionData{"Sound/Upmix", "Upmix", _("Upmix stereo to surround")},
OptionData{"Sound/Volume", "", _("Sound volume (%)")},
OptionData{"Language/Locale", _("Language")},
OptionData{"Language/ExternalTranslations", _("External translations")},
// Last. This should never be used, it actually maps to OptionID::kLast.
// This is to prevent a memory access violation error in case something

View File

@@ -137,6 +137,8 @@ enum class OptionID {
kSoundDSoundHWAccel,
kSoundUpmix,
kSoundVolume,
kLocale,
kExternalTranslations,
// Do not add anything under here.
Last,

View File

@@ -141,6 +141,8 @@ static constexpr std::array<Option::Type, kNbOptions> kOptionsTypes = {
/*kSoundDSoundHWAccel*/ Option::Type::kBool,
/*kSoundUpmix*/ Option::Type::kBool,
/*kSoundVolume*/ Option::Type::kInt,
/*kLocale*/ Option::Type::kInt,
/*kExternalTranslations*/ Option::Type::kBool,
};
// Less verbose accessor for a specific OptionID with compile-time type checks.

View File

@@ -1846,10 +1846,9 @@ bool MainFrame::BindControls()
hide_menu_bar = nullptr;
#endif
// if a recent menu is present, save its location
wxMenuItem* recentmi = XRCITEM("RecentMenu");
wxMenuItem *recentmi = XRCITEM("RecentMenu");
if (recentmi && recentmi->IsSubMenu()) {
recent = recentmi->GetSubMenu();
gopts.recent->UseMenu(recent);
@@ -1922,6 +1921,43 @@ bool MainFrame::BindControls()
MenuOptionIntRadioValue("LinkType2Wireless", gopts.gba_link_type, 2);
MenuOptionIntRadioValue("LinkType3GameCube", gopts.gba_link_type, 3);
MenuOptionIntRadioValue("LinkType4Gameboy", gopts.gba_link_type, 4);
MenuOptionIntRadioValue("Language0", OPTION(kLocale), wxLANGUAGE_DEFAULT);
MenuOptionIntRadioValue("Language1", OPTION(kLocale), wxLANGUAGE_BULGARIAN);
MenuOptionIntRadioValue("Language2", OPTION(kLocale), wxLANGUAGE_BRETON);
MenuOptionIntRadioValue("Language3", OPTION(kLocale), wxLANGUAGE_CZECH);
MenuOptionIntRadioValue("Language4", OPTION(kLocale), wxLANGUAGE_GERMAN);
MenuOptionIntRadioValue("Language5", OPTION(kLocale), wxLANGUAGE_GREEK);
MenuOptionIntRadioValue("Language6", OPTION(kLocale), wxLANGUAGE_ENGLISH_US);
MenuOptionIntRadioValue("Language7", OPTION(kLocale), wxLANGUAGE_SPANISH_LATIN_AMERICA);
MenuOptionIntRadioValue("Language8", OPTION(kLocale), wxLANGUAGE_SPANISH_COLOMBIA);
MenuOptionIntRadioValue("Language9", OPTION(kLocale), wxLANGUAGE_SPANISH_PERU);
MenuOptionIntRadioValue("Language10", OPTION(kLocale), wxLANGUAGE_SPANISH_US);
MenuOptionIntRadioValue("Language11", OPTION(kLocale), wxLANGUAGE_SPANISH);
MenuOptionIntRadioValue("Language12", OPTION(kLocale), wxLANGUAGE_FRENCH_FRANCE);
MenuOptionIntRadioValue("Language13", OPTION(kLocale), wxLANGUAGE_FRENCH);
MenuOptionIntRadioValue("Language14", OPTION(kLocale), wxLANGUAGE_GALICIAN);
MenuOptionIntRadioValue("Language15", OPTION(kLocale), wxLANGUAGE_HEBREW_ISRAEL);
MenuOptionIntRadioValue("Language16", OPTION(kLocale), wxLANGUAGE_HUNGARIAN_HUNGARY);
MenuOptionIntRadioValue("Language17", OPTION(kLocale), wxLANGUAGE_HUNGARIAN);
MenuOptionIntRadioValue("Language18", OPTION(kLocale), wxLANGUAGE_INDONESIAN);
MenuOptionIntRadioValue("Language19", OPTION(kLocale), wxLANGUAGE_ITALIAN_ITALY);
MenuOptionIntRadioValue("Language20", OPTION(kLocale), wxLANGUAGE_JAPANESE);
MenuOptionIntRadioValue("Language21", OPTION(kLocale), wxLANGUAGE_KOREAN_KOREA);
MenuOptionIntRadioValue("Language22", OPTION(kLocale), wxLANGUAGE_KOREAN);
MenuOptionIntRadioValue("Language23", OPTION(kLocale), wxLANGUAGE_MALAY_MALAYSIA);
MenuOptionIntRadioValue("Language24", OPTION(kLocale), wxLANGUAGE_NORWEGIAN);
MenuOptionIntRadioValue("Language25", OPTION(kLocale), wxLANGUAGE_DUTCH);
MenuOptionIntRadioValue("Language26", OPTION(kLocale), wxLANGUAGE_POLISH_POLAND);
MenuOptionIntRadioValue("Language27", OPTION(kLocale), wxLANGUAGE_POLISH);
MenuOptionIntRadioValue("Language28", OPTION(kLocale), wxLANGUAGE_PORTUGUESE_BRAZILIAN);
MenuOptionIntRadioValue("Language29", OPTION(kLocale), wxLANGUAGE_PORTUGUESE_PORTUGAL);
MenuOptionIntRadioValue("Language30", OPTION(kLocale), wxLANGUAGE_RUSSIAN_RUSSIA);
MenuOptionIntRadioValue("Language31", OPTION(kLocale), wxLANGUAGE_SWEDISH);
MenuOptionIntRadioValue("Language32", OPTION(kLocale), wxLANGUAGE_TURKISH);
MenuOptionIntRadioValue("Language33", OPTION(kLocale), wxLANGUAGE_UKRAINIAN);
MenuOptionIntRadioValue("Language34", OPTION(kLocale), wxLANGUAGE_URDU_PAKISTAN);
MenuOptionIntRadioValue("Language35", OPTION(kLocale), wxLANGUAGE_CHINESE_CHINA);
MenuOptionBool("ExternalTranslations", OPTION(kExternalTranslations));
}
for (size_t i = 0; i < checkable_mi.size(); i++) {

View File

@@ -268,7 +268,7 @@ void MetalDrawingPanel::DrawArea()
DrawingPanelInit();
if (systemColorDepth == 8) {
srcPitch = std::ceil(width * scale) + 2;
srcPitch = std::ceil(width * scale) + 4;
} else if (systemColorDepth == 16) {
srcPitch = std::ceil(width * scale * 2) + 4;
} else if (systemColorDepth == 24) {
@@ -302,7 +302,7 @@ void MetalDrawingPanel::DrawArea()
src_pos++;
}
pos++;
src_pos += 2;
src_pos += 4;
}
_texture = loadTextureUsingData(dst);

View File

@@ -1197,20 +1197,14 @@ void GameArea::OnIdle(wxIdleEvent& event)
if (!panel) {
switch (OPTION(kDispRenderMethod)) {
case config::RenderMethod::kSimple:
no_border = false;
panel = new BasicDrawingPanel(this, basic_width, basic_height);
break;
case config::RenderMethod::kSDL:
no_border = false;
panel = new SDLDrawingPanel(this, basic_width, basic_height);
break;
#ifdef __WXMAC__
#ifndef NO_METAL
case config::RenderMethod::kMetal:
no_border = false;
if (is_macosx_1012_or_newer()) {
panel =
new MetalDrawingPanel(this, basic_width, basic_height);
@@ -1221,27 +1215,17 @@ void GameArea::OnIdle(wxIdleEvent& event)
break;
#endif
case config::RenderMethod::kQuartz2d:
no_border = false;
panel =
new Quartz2DDrawingPanel(this, basic_width, basic_height);
break;
#endif
#ifndef NO_OGL
case config::RenderMethod::kOpenGL:
if (out_8) {
no_border = true;
} else {
no_border = false;
}
panel = new GLDrawingPanel(this, basic_width, basic_height);
break;
#endif
#if defined(__WXMSW__) && !defined(NO_D3D)
case config::RenderMethod::kDirect3d:
no_border = false;
panel = new DXDrawingPanel(this, basic_width, basic_height);
break;
#endif
@@ -1640,12 +1624,12 @@ public:
const int procy = height_ * threadno_ / nthreads_;
height_ = height_ * (threadno_ + 1) / nthreads_ - procy;
const int inbpp = systemColorDepth >> 3;
const int inrb = out_8 ? 2 : out_16 ? 2
const int inrb = out_8 ? 4 : out_16 ? 2
: out_24 ? 0 : 1;
const int instride = (width_ + inrb) * inbpp;
const int instride32 = width_ * 4;
const int outbpp = systemColorDepth >> 3;
const int outrb = out_8 ? 2 : out_24 ? 0 : 4;
const int outrb = out_8 ? 4 : out_24 ? 0 : 4;
const int outstride = std::ceil(width_ * outbpp * scale_) + outrb;
const int outstride32 = std::ceil(width_ * 4 * scale_);
uint8_t *dest = NULL;
@@ -1708,7 +1692,7 @@ public:
pos++;
src_pos++;
}
src_pos += 2;
src_pos += 4;
}
} else if (out_16) {
uint16_t *src16_ = (uint16_t *)src_;
@@ -1761,7 +1745,7 @@ public:
pos++;
dst_pos += 4;
}
pos += 2;
pos += 4;
}
} else if (out_16) {
uint16_t *dest16_ = (uint16_t *)dest;
@@ -2003,7 +1987,7 @@ void DrawingPanelBase::DrawArea(uint8_t** data)
// if filtering, this is filter output, retained for redraws
// if not filtering, we still retain current image for redraws
int outbpp = systemColorDepth >> 3;
int outrb = out_8 ? 2 : out_24 ? 0 : 4;
int outrb = out_8 ? 4 : out_24 ? 0 : 4;
int outstride = std::ceil(width * outbpp * scale) + outrb;
if (!pixbuf2) {
@@ -2618,7 +2602,7 @@ void SDLDrawingPanel::DrawArea()
DrawingPanelInit();
if (out_8) {
srcPitch = std::ceil(width * scale) + 2;
srcPitch = std::ceil(width * scale) + 4;
} else if (out_16) {
srcPitch = std::ceil(width * scale * 2) + 4;
} else if (out_24) {
@@ -2673,7 +2657,7 @@ void SDLDrawingPanel::DrawArea(uint8_t** data)
// if filtering, this is filter output, retained for redraws
// if not filtering, we still retain current image for redraws
int outbpp = systemColorDepth >> 3;
int outrb = out_8 ? 2 : out_24 ? 0 : 4;
int outrb = out_8 ? 4 : out_24 ? 0 : 4;
int outstride = std::ceil(width * outbpp * scale) + outrb;
// FIXME: filters race condition?
@@ -2847,7 +2831,7 @@ void BasicDrawingPanel::DrawArea(wxWindowDC& dc)
} else if (out_8) {
// scaled by filters, top/right borders, transform to 24-bit
im = new wxImage(std::ceil(width * scale), std::ceil(height * scale), false);
uint8_t* src = (uint8_t*)todraw + (int)std::ceil((width + 2) * scale); // skip top border
uint8_t* src = (uint8_t*)todraw + (int)std::ceil((width * scale) + 4); // skip top border
uint8_t* dst = im->GetData();
for (int y = 0; y < std::ceil(height * scale); y++) {
@@ -2864,7 +2848,7 @@ void BasicDrawingPanel::DrawArea(wxWindowDC& dc)
}
}
src += 2;
src += 4;
}
} else if (out_16) {
// scaled by filters, top/right borders, transform to 24-bit
@@ -3175,9 +3159,6 @@ void GLDrawingPanel::RefreshGL()
void GLDrawingPanel::DrawArea(wxWindowDC& dc)
{
uint8_t* src = NULL;
uint8_t* dst = NULL;
(void)dc; // unused params
SetContext();
RefreshGL();
@@ -3186,7 +3167,7 @@ void GLDrawingPanel::DrawArea(wxWindowDC& dc)
DrawingPanelInit();
if (todraw) {
int rowlen = std::ceil(width * scale) + (out_8 ? 0 : out_16 ? 2 : out_24 ? 0 : 1);
int rowlen = std::ceil(width * scale) + (out_8 ? 4 : out_16 ? 2 : out_24 ? 0 : 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlen);
#if wxBYTE_ORDER == wxBIG_ENDIAN
@@ -3195,24 +3176,8 @@ void GLDrawingPanel::DrawArea(wxWindowDC& dc)
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_TRUE);
#endif
if (out_8) {
src = (uint8_t*)todraw + (int)std::ceil((width + 2) * ((systemColorDepth >> 3) * scale)); // skip top border
dst = (uint8_t*)todraw;
for (int y = 0; y < std::ceil(height * scale); y++) {
for (int x = 0; x < std::ceil(width * scale); x++) {
*dst++ = *src++;
}
src += 2;
}
glTexImage2D(GL_TEXTURE_2D, 0, int_fmt, (int)std::ceil(width * scale), (int)std::ceil(height * scale),
0, tex_fmt, todraw);
} else {
glTexImage2D(GL_TEXTURE_2D, 0, int_fmt, (int)std::ceil(width * scale), (int)std::ceil(height * scale),
0, tex_fmt, todraw + (int)std::ceil(rowlen * ((systemColorDepth >> 3) * scale)));
}
glTexImage2D(GL_TEXTURE_2D, 0, int_fmt, (int)std::ceil(width * scale), (int)std::ceil(height * scale),
0, tex_fmt, todraw + (int)std::ceil(rowlen * ((systemColorDepth >> 3) * scale)));
glCallList(vlist);
} else
@@ -3536,7 +3501,7 @@ void MetalDrawingPanel::DrawArea(uint8_t** data)
// if filtering, this is filter output, retained for redraws
// if not filtering, we still retain current image for redraws
int outbpp = systemColorDepth >> 3;
int outrb = out_8 ? 2 : out_24 ? 0 : 4;
int outrb = out_8 ? 4 : out_24 ? 0 : 4;
int outstride = std::ceil(width * outbpp * scale) + outrb;
// FIXME: filters race condition?

View File

@@ -223,7 +223,7 @@ static void get_config_path(wxPathList& path, bool exists = true)
if (!debug_dumped) {
wxLogDebug(wxT("GetUserLocalDataDir(): %s"), stdp.GetUserLocalDataDir().c_str());
wxLogDebug(wxT("GetUserDataDir(): %s"), stdp.GetUserDataDir().c_str());
wxLogDebug(wxT("GetLocalizedResourcesDir(wxGetApp().locale.GetCanonicalName()): %s"), stdp.GetLocalizedResourcesDir(wxGetApp().locale.GetCanonicalName()).c_str());
wxLogDebug(wxT("GetLocalizedResourcesDir(wxvbam_locale->GetCanonicalName()): %s"), stdp.GetLocalizedResourcesDir(wxvbam_locale->GetCanonicalName()).c_str());
wxLogDebug(wxT("GetResourcesDir(): %s"), stdp.GetResourcesDir().c_str());
wxLogDebug(wxT("GetDataDir(): %s"), stdp.GetDataDir().c_str());
wxLogDebug(wxT("GetLocalDataDir(): %s"), stdp.GetLocalDataDir().c_str());
@@ -257,7 +257,7 @@ static void get_config_path(wxPathList& path, bool exists = true)
// NOTE: this does not support XDG (freedesktop.org) paths
add_path(GetUserLocalDataDir());
add_path(GetUserDataDir());
add_path(GetLocalizedResourcesDir(wxGetApp().locale.GetCanonicalName()));
add_path(GetLocalizedResourcesDir(wxvbam_locale->GetCanonicalName()));
add_path(GetResourcesDir());
add_path(GetDataDir());
add_path(GetLocalDataDir());
@@ -352,6 +352,9 @@ wxString wxvbamApp::GetAbsolutePath(wxString path)
return path;
}
int language = wxLANGUAGE_DEFAULT;
wxLocale *wxvbam_locale = NULL;
bool wxvbamApp::OnInit() {
using_wayland = IsWayland();
@@ -364,9 +367,21 @@ bool wxvbamApp::OnInit() {
#if (wxMAJOR_VERSION >= 3)
SetAppDisplayName("VisualBoyAdvance-M");
#endif
// load system default locale, if available
locale.Init();
locale.AddCatalog("wxvbam");
wxvbam_locale = new wxLocale;
language = OPTION(kLocale);
if (language != wxLANGUAGE_DEFAULT) {
wxvbam_locale->Init(language, wxLOCALE_LOAD_DEFAULT);
} else {
wxvbam_locale->Init();
}
// load selected language
wxvbam_locale->AddCatalog("wxvbam");
// make built-in xrc file available
// this has to be done before parent OnInit() so xrc dump works
wxFileSystem::AddHandler(new wxMemoryFSHandler);
@@ -468,6 +483,30 @@ bool wxvbamApp::OnInit() {
// Load the default options.
load_opts(!config_file_.Exists());
if (wxvbam_locale)
wxDELETE(wxvbam_locale);
wxvbam_locale = new wxLocale;
language = OPTION(kLocale);
if (language != wxLANGUAGE_DEFAULT) {
wxvbam_locale->Init(language, wxLOCALE_LOAD_DEFAULT);
} else {
wxvbam_locale->Init();
}
fprintf(stderr, "Language: %d\n", language);
// load selected language
#ifdef _WIN32
if (OPTION(kExternalTranslations) == false)
wxTranslations::Get()->SetLoader(new wxResourceTranslationsLoader);
#endif
wxvbam_locale->AddCatalog("wxvbam");
// wxGLCanvas segfaults under wayland before wx 3.2
#if defined(HAVE_WAYLAND_SUPPORT) && !defined(HAVE_WAYLAND_EGL)
if (UsingWayland()) {

View File

@@ -38,6 +38,8 @@
#include "wx/wxlogdebug.h"
#include "wx/compat_generic_file_dialog.h"
extern wxLocale *wxvbam_locale;
template <typename T>
void CheckPointer(T pointer)
{

View File

@@ -0,0 +1,33 @@
wxvbam_bg MOFILE "translations/bg/LC_MESSAGES/wxvbam.mo"
wxvbam_br MOFILE "translations/br/LC_MESSAGES/wxvbam.mo"
wxvbam_cs MOFILE "translations/cs/LC_MESSAGES/wxvbam.mo"
wxvbam_el MOFILE "translations/el/LC_MESSAGES/wxvbam.mo"
wxvbam_en_US MOFILE "translations/en_US/LC_MESSAGES/wxvbam.mo"
wxvbam_es MOFILE "translations/es/LC_MESSAGES/wxvbam.mo"
wxvbam_es_419 MOFILE "translations/es_419/LC_MESSAGES/wxvbam.mo"
wxvbam_es_CO MOFILE "translations/es_CO/LC_MESSAGES/wxvbam.mo"
wxvbam_es_US MOFILE "translations/es_US/LC_MESSAGES/wxvbam.mo"
wxvbam_fr MOFILE "translations/fr/LC_MESSAGES/wxvbam.mo"
wxvbam_fr_FR MOFILE "translations/fr_FR/LC_MESSAGES/wxvbam.mo"
wxvbam_gl MOFILE "translations/gl/LC_MESSAGES/wxvbam.mo"
wxvbam_he_IL MOFILE "translations/he_IL/LC_MESSAGES/wxvbam.mo"
wxvbam_hu MOFILE "translations/hu/LC_MESSAGES/wxvbam.mo"
wxvbam_hu_HU MOFILE "translations/hu_HU/LC_MESSAGES/wxvbam.mo"
wxvbam_id MOFILE "translations/id/LC_MESSAGES/wxvbam.mo"
wxvbam_it_IT MOFILE "translations/it_IT/LC_MESSAGES/wxvbam.mo"
wxvbam_ja MOFILE "translations/ja/LC_MESSAGES/wxvbam.mo"
wxvbam_ko MOFILE "translations/ko/LC_MESSAGES/wxvbam.mo"
wxvbam_ko_KR MOFILE "translations/ko_KR/LC_MESSAGES/wxvbam.mo"
wxvbam_ms_MY MOFILE "translations/ms_MY/LC_MESSAGES/wxvbam.mo"
wxvbam_nb MOFILE "translations/nb/LC_MESSAGES/wxvbam.mo"
wxvbam_nl MOFILE "translations/nl/LC_MESSAGES/wxvbam.mo"
wxvbam_pl MOFILE "translations/pl/LC_MESSAGES/wxvbam.mo"
wxvbam_pl_PL MOFILE "translations/pl_PL/LC_MESSAGES/wxvbam.mo"
wxvbam_pt_BR MOFILE "translations/pt_BR/LC_MESSAGES/wxvbam.mo"
wxvbam_pt_PT MOFILE "translations/pt_PT/LC_MESSAGES/wxvbam.mo"
wxvbam_ru_RU MOFILE "translations/ru_RU/LC_MESSAGES/wxvbam.mo"
wxvbam_sv MOFILE "translations/sv/LC_MESSAGES/wxvbam.mo"
wxvbam_tr MOFILE "translations/tr/LC_MESSAGES/wxvbam.mo"
wxvbam_uk MOFILE "translations/uk/LC_MESSAGES/wxvbam.mo"
wxvbam_ur_PK MOFILE "translations/ur_PK/LC_MESSAGES/wxvbam.mo"
wxvbam_zh_CN MOFILE "translations/zh_CN/LC_MESSAGES/wxvbam.mo"

View File

@@ -751,5 +751,156 @@
<label>_About...</label>
</object>
</object>
<object class="wxMenu">
<label>_Languages</label>
<object class="wxMenuItem" name="Language0">
<label>Default Language</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language1">
<label>Bulgarian</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language2">
<label>Breton</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language3">
<label>Czech</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language4">
<label>German</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language5">
<label>Greek</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language6">
<label>English (US)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language7">
<label>Spanish (Latin American)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language8">
<label>Spanish (Colombia)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language9">
<label>Spanish (Peru)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language10">
<label>Spanish (United States)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language11">
<label>Spanish</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language12">
<label>French (France)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language13">
<label>French</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language14">
<label>Galician</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language15">
<label>Hebrew (Israel)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language16">
<label>Hungarian (Hungary)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language17">
<label>Hungarian</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language18">
<label>Indonesian</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language19">
<label>Italian</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language20">
<label>Japanese</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language21">
<label>Korean (Korea)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language22">
<label>Korean</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language23">
<label>Malay (Malaysia)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language24">
<label>Norwegian</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language25">
<label>Dutch</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language26">
<label>Polish (Poland)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language27">
<label>Polish</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language28">
<label>Portuguese (Brazil)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language29">
<label>Portuguese (Portugal)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language30">
<label>Russian (Russia)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language31">
<label>Swedish</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language32">
<label>Turkish</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language33">
<label>Ukrainian</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language34">
<label>Urdu (Pakistan)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="Language35">
<label>Chinese (China)</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="ExternalTranslations">
<label>_Use external translations</label>
<checkable>1</checkable>
</object>
</object>
</object>
</resource>

View File

@@ -31,8 +31,6 @@ export CMAKE_REQUIRED_ARGS="-DGETTEXT_MSGFMT_EXECUTABLE:FILEPATH=\"\$BUILD_ROOT/
. "${0%/*}/../builder/mingw-cross.sh"
table_line_append DIST_MAKE_ARGS unzip 'CFLAGS="$CFLAGS -DNO_LCHMOD"'
# FIXME: problems with autopoint that need to be sorted
table_line_remove DISTS flex

View File

@@ -164,31 +164,6 @@ if mime_info_libs=$(table_line DIST_EXTRA_LIBS shared-mime-info); then
table_line_replace DIST_EXTRA_LIBS shared-mime-info "$(puts "$mime_info_libs" | sed 's/-ldl//g; s/-lresolv//g;')"
fi
table_line_remove DIST_CONFIGURE_OVERRIDES unzip
table_line_remove DIST_PRE_BUILD unzip
table_line_replace DIST_MAKE_ARGS unzip '-f win32/Makefile.gcc NOASM=1 CC_CPU_OPT='
table_line_replace DIST_INSTALL_OVERRIDES unzip 'cp -af $(find . -name "*.exe") "$BUILD_ROOT/root/bin"'
table_line_replace DIST_PRE_BUILD unzip ":; \
sed -i.bak 's,#include \"../unzip\\.h\",#include <windows.h>,; \
t; \
s,#include <windows.h>,#include \"../unzip.h\",' win32/win32.c win32/nt.c; \
"
table_line_append DIST_PATCHES zip 'https://gist.githubusercontent.com/rkitover/17e4c90185b7ad533e848b6230a90b8d/raw/434e0f74c872a928e77b93bdbf4ee9a1140fe879/zip-mingw.patch'
table_line_remove DIST_CONFIGURE_OVERRIDES zip
table_line_remove DIST_PRE_BUILD zip
table_line_replace DIST_MAKE_ARGS zip '-f win32/Makefile.gcc'
table_line_replace DIST_INSTALL_OVERRIDES zip 'cp -af *.exe "$BUILD_ROOT/root/bin"'
table_line_replace DIST_POST_BUILD unzip ":; \
mkdir -p \"\$BUILD_ROOT/root/bin\"; \
cp -a \"\$BUILD_ROOT/dists/unzip\"/*.exe \"\$BUILD_ROOT/root/bin\"; \
"
table_line_replace DIST_CONFIGURE_OVERRIDES openssl "$(table_line DIST_CONFIGURE_OVERRIDES openssl | sed 's,^./config ,./Configure Cygwin-x86_64 ,')"
builder "$@"

View File

@@ -28,7 +28,7 @@ export BUILD_ROOT="$HOME/vbam-build-mingw${target_bits}"
do_not_remove_dists=
host_dists='
unzip zip cmake autoconf autoconf-archive automake getopt m4 gsed bison
7zip cmake autoconf autoconf-archive automake getopt m4 gsed bison
flex-2.6.3 flex c2man docbook2x libtool help2man texinfo xmlto pkgconfig
nasm yasm xorg-macros dejavu liberation urw graphviz docbook4.2
docbook4.1.2 docbook4.3 docbook4.4 docbook4.5 docbook5.0 docbook-xsl

View File

@@ -38,18 +38,11 @@ case "\$CC" in
;;
esac
if [ -n "APPLE_SILICON" ]; then
export MARCH="arm64"
else
# Intel and compatibility with old machines.
export MARCH="core2"
fi
export CPPFLAGS="-isystem \$BUILD_ROOT/root/include $CPPFLAGS${CPPFLAGS:+ } -DCURL_STATICLIB -DGRAPHITE2_STATIC -DFLOAT_APPROX -Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close"
export CFLAGS="-mtune=generic $CFLAGS${CFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -pthread -lm -O3 -ffast-math $MARCH -pipe -Wno-error=implicit-int -I/"
export CXXFLAGS="-mtune=generic $CXXFLAGS${CXXFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -std=gnu++17 -fpermissive -pthread -lm -O3 -ffast-math $MARCH -pipe -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"
export OBJCXXFLAGS="-mtune=generic $OBJCXXFLAGS${OBJCXXFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -std=gnu++17 -fpermissive -pthread -lm -O3 -ffast-math $MARCH -mtune=generic -pipe"
export LDFLAGS="-mtune=generic $LDFLAGS${LDFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -pthread -lm -O3 -ffast-math $MARCH -pipe"
export CFLAGS="$CFLAGS${CFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -pthread -lm -O3 -ffast-math -pipe -Wno-error=implicit-int"
export CXXFLAGS="$CXXFLAGS${CXXFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -std=gnu++17 -fpermissive -pthread -lm -O3 -ffast-math -pipe"
export OBJCXXFLAGS="$OBJCXXFLAGS${OBJCXXFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -std=gnu++17 -fpermissive -pthread -lm -O3 -ffast-math -pipe"
export LDFLAGS="$LDFLAGS${LDFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -pthread -lm -O3 -ffast-math -pipe"
export STRIP="\${STRIP:-strip}"
if [ -z "\$OPENMP" ] && echo "\$CC" | grep -Eq gcc; then
@@ -60,6 +53,15 @@ if [ -z "\$OPENMP" ] && echo "\$CC" | grep -Eq gcc; then
export OPENMP=1
fi
case "\$CC" in
*clang*)
export GCC_OR_CLANG=clang
;;
*)
export GCC_OR_CLANG=gcc
;;
esac
export CMAKE_PREFIX_PATH="\${CMAKE_PREFIX_PATH:-\$BUILD_ROOT/root}"
export PKG_CONFIG_PATH="\$BUILD_ROOT/root/lib/pkgconfig:\$BUILD_ROOT/root/share/pkgconfig"
@@ -105,25 +107,24 @@ export BUILD_ENV
ORIG_PATH=$PATH
PRE_BUILD_DISTS="$PRE_BUILD_DISTS bzip2 xz unzip"
PRE_BUILD_DISTS="$PRE_BUILD_DISTS bzip2 xz 7zip"
DISTS=$DISTS'
bzip2 ftp://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz lib/libbz2.a
xz https://tukaani.org/xz/xz-5.8.1.tar.gz lib/liblzma.a
unzip https://downloads.sourceforge.net/project/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz bin/unzip
7zip https://7-zip.org/a/7z2500-src.tar.xz bin/7z
autoconf https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.xz bin/autoconf
autoconf-archive http://gnu.askapache.com/autoconf-archive/autoconf-archive-2022.09.03.tar.xz share/aclocal/ax_check_gl.m4
automake https://ftp.gnu.org/gnu/automake/automake-1.17.tar.xz bin/automake
libtool https://ftp.gnu.org/gnu/libtool/libtool-2.5.4.tar.xz bin/libtool
libiconv https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.18.tar.gz lib/libiconv.a
zlib-ng https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.4.tar.gz lib/libz.a
zip https://downloads.sourceforge.net/project/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz bin/zip
openssl https://github.com/openssl/openssl/releases/download/openssl-3.5.0/openssl-3.5.0.tar.gz lib/libssl.a
libunistring https://ftp.gnu.org/gnu/libunistring/libunistring-1.3.tar.xz lib/libunistring.a
libpsl https://github.com/rockdaboot/libpsl/archive/refs/heads/master.zip lib/libpsl.a
zstd https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz lib/libzstd.a
curl https://github.com/curl/curl/releases/download/curl-8_13_0/curl-8.13.0.tar.bz2 lib/libcurl.a
cmake https://github.com/Kitware/CMake/releases/download/v4.0.1/cmake-4.0.1.tar.gz bin/cmake
zstd https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz lib/libzstd.a
libdeflate https://github.com/ebiggers/libdeflate/releases/download/v1.23/libdeflate-1.23.tar.gz lib/libdeflate.a
hiredis https://github.com/redis/hiredis/archive/refs/tags/v1.2.0.tar.gz lib/libhiredis.a
ccache https://github.com/ccache/ccache/releases/download/v4.11.2/ccache-4.11.2.tar.xz bin/ccache
@@ -135,8 +136,7 @@ DISTS=$DISTS'
gsed http://ftp.gnu.org/gnu/sed/sed-4.9.tar.xz bin/sed
bison https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.xz bin/bison
texinfo http://ftp.gnu.org/gnu/texinfo/texinfo-7.2.tar.xz bin/makeinfo
flex-2.6.4 https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz bin/flex
flex https://github.com/westes/flex/archive/ea6493d9b6f1915ba096160df666637a6e1b3f20.tar.gz bin/flex
flex https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz bin/flex
gperf http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz bin/gperf
libicu https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz lib/libicud*t*.a
pkgconf https://github.com/pkgconf/pkgconf/archive/refs/tags/pkgconf-2.4.3.tar.gz bin/pkgconf
@@ -180,7 +180,7 @@ DISTS=$DISTS'
XML-Parser https://cpan.metacpan.org/authors/id/T/TO/TODDR/XML-Parser-2.47.tar.gz perl5/man/man3/XML*Parser.3*
intltool https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz bin/intltoolize
ninja https://github.com/ninja-build/ninja/archive/v1.12.1.tar.gz bin/ninja
glib https://download.gnome.org/sources/glib/2.85/glib-2.85.0.tar.xz lib/libglib-2.0.a
glib https://download.gnome.org/sources/glib/2.85/glib-2.85.2.tar.xz lib/libglib-2.0.a
libgpg-error https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.54.tar.bz2 lib/libgpg-error.a
libgcrypt https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.0.tar.bz2 lib/libgcrypt.a
libsecret https://gitlab.gnome.org/GNOME/libsecret/-/archive/0.21.7/libsecret-0.21.7.tar.bz2 lib/libsecret-1.a
@@ -189,9 +189,10 @@ DISTS=$DISTS'
flac https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.5.0.tar.xz lib/libFLAC.a
harfbuzz https://github.com/harfbuzz/harfbuzz/releases/download/11.1.0/harfbuzz-11.1.0.tar.xz lib/libharfbuzz.a
shared-mime-info https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/2.4/shared-mime-info-2.4.tar.bz2 bin/update-mime-database
libmspack https://github.com/kyz/libmspack/archive/refs/tags/v1.11.tar.gz lib/libmspack.a
libwebp https://github.com/webmproject/libwebp/archive/refs/tags/v1.5.0.tar.gz lib/libwebp.a
wxwidgets https://github.com/wxWidgets/wxWidgets/releases/download/v3.3.0/wxWidgets-3.3.0.tar.bz2 lib/libwx_baseu-3.*.a
libmspack https://github.com/kyz/libmspack/archive/refs/tags/v1.11.tar.gz lib/libmspack.a
giflib https://downloads.sourceforge.net/project/giflib/giflib-5.2.2.tar.gz?ts=gAAAAABof7w9w5Ou1me5kQswguOibl2AQUX8WQHClQT0jKeq1qXFf5ZaT6x9TsfhIDqnNPe5j7rjS1curgDQ2h4lLue7wNlV6g%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fgiflib%2Ffiles%2Fgiflib-5.2.2.tar.gz%2Fdownload lib/libgif.a
libwebp https://github.com/webmproject/libwebp/archive/refs/tags/v1.6.0.tar.gz lib/libwebp.a
wxwidgets https://github.com/wxWidgets/wxWidgets/releases/download/v3.3.1/wxWidgets-3.3.1.tar.bz2 lib/libwx_baseu-3.*.a
libx264 https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2 lib/libx264.a
libx265 https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.1.tar.gz lib/libx265.a
ffmpeg http://ffmpeg.org/releases/ffmpeg-7.1.1.tar.xz lib/libavformat.a
@@ -232,7 +233,6 @@ export MESON_ARGS="$meSON_BASE_ARGS --buildtype release --default-library=static
DIST_PATCHES=$DIST_PATCHES'
libx265 https://gist.githubusercontent.com/andyvand/9f9770878c63b6307f0b5384b01967da/raw/738672b9dd3a76c44b2368853f9c862366720416/libx265_cmake_fix.diff
unzip https://gist.githubusercontent.com/andyvand/23b485fa21139ba3aa08816425f03294/raw/9febcf8725e42ecdb5ff914ac3b1e0899623e620/unzip_buildfix.diff
python3 https://gist.githubusercontent.com/andyvand/d275de733d362bf20a9c0b05f87ff4fc/raw/8d6e1c09fa52611ccf0b959284a6f68596769ba1/python3_configure.diff
fontconfig https://gist.githubusercontent.com/andyvand/7ee00be1f5561a1550c6fa97277f7472/raw/9194e9b8e641c8a098f06d13bbfb4ac82b381860/fontconfig_atomic.diff
expat https://gist.githubusercontent.com/andyvand/9c3f7497a68188db7d4be5e276c40d4f/raw/5816ef1bfdcb1f295e7ff0f152c4d6b960919c66/expat_buildconf.diff
@@ -249,10 +249,10 @@ DIST_TAR_ARGS="$DIST_TAR_ARGS
"
DIST_CONFIGURE_TYPES="$DIST_CONFIGURE_TYPES
7zip make
expat autoreconf
libxml2 meson
unzip make
zip make
flex autoreconf
pkgconf autoreconf_noargs
libffi autoreconf
libgd cmake
@@ -275,9 +275,6 @@ DIST_PRE_BUILD="$DIST_PRE_BUILD
getopt sed -i.bak 's/\\\$(LDFLAGS)\\(.*\\)\$/\\1 \$(LDFLAGS)/' Makefile;
libpsl rm -rf list; git clone --depth 1 https://github.com/publicsuffix/list; sed -E -i.bak -e '/subdir[(].tools.[)]/d' meson.build
libicu cd source;
flex mkdir -p build-aux; touch build-aux/config.rpath; mkdir -p po; touch po/Makefile.in.in; sed -i.bak '/po \\\\$/d' Makefile.am;
unzip rm -f unix/Contents; ln -sf \$(find unix -mindepth 1 -maxdepth 1) .;
zip rm -f unix/Contents; ln -sf \$(find unix -mindepth 1 -maxdepth 1) .;
gettext sed -i.bak 's/-Wl,--disable-auto-import//' m4/woe32-dll.m4;
expat sed -i.bak '/doc\\/Makefile/d' configure.ac; \
sed -i.bak '/SUBDIRS/{; s/ doc//; }' Makefile.am;
@@ -301,10 +298,10 @@ DIST_PRE_BUILD="$DIST_PRE_BUILD
"
DIST_POST_BUILD="$DIST_POST_BUILD
giflib cp -f libutil.a \"\$BUILD_ROOT/root/lib\"
pkgconf ln -sf \"\$BUILD_ROOT/root/bin/pkgconf\" \"\$BUILD_ROOT/root/bin/pkg-config\";
ccache setup_ccache
harfbuzz rebuild_dist freetype -Dharfbuzz=enabled;
flex-2.6.3 build_dist flex || :;
libtool ln -sf \"\$BUILD_ROOT/root/bin/libtoolize\" \"\$BUILD_ROOT/root/bin/glibtoolize\";
libxml2 mkdir -p \"\$BUILD_ROOT/root/etc/xml\"; \
xmlcatalog --noout --create \"\$(cygpath -m \"\$BUILD_ROOT/root/etc/xml/catalog.xml\")\" || :;
@@ -328,10 +325,11 @@ DIST_CONFIGURE_OVERRIDES="$DIST_CONFIGURE_OVERRIDES
XML-SAX echo no | PERL_MM_USE_DEFAULT=0 \"\$perl\" Makefile.PL
libvpx ./configure --disable-shared --enable-static --prefix=/usr --disable-unit-tests --disable-tools --disable-docs --disable-examples
libmspack cd libmspack && \"\$BUILD_ROOT/root/bin/aclocal\" && \"\$BUILD_ROOT/root/bin/autoheader\" -I. && \"\$BUILD_ROOT/root/bin/libtoolize\" && \"\$BUILD_ROOT/root/bin/automake\" --add-missing && \"\$BUILD_ROOT/root/bin/autoreconf\" && ./configure --enable-static --disable-shared --prefix=/usr
ffmpeg ./configure --disable-pthreads --disable-shared --enable-static --prefix=/usr --pkg-config-flags=--static --disable-nonfree --enable-fontconfig --enable-gpl --enable-version3 --disable-libass --disable-libbluray --enable-libfreetype --disable-libgsm --disable-libmodplug --disable-libmp3lame --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libopus --disable-libsnappy --disable-libsoxr --disable-libspeex --disable-libtheora --disable-libvidstab --disable-libvo-amrwbenc --disable-libvorbis --disable-libvpx --enable-libx264 --enable-libx265 --disable-libxavs --disable-libxvid --disable-libzmq --disable-openssl --enable-lzma --extra-cflags='-DMODPLUG_STATIC -DZMQ_STATIC' --extra-cxxflags='-DMODPLUG_STATIC -DZMQ_STATIC' --extra-objcflags='-DMODPLUG_STATIC -DZMQ_STATIC' --extra-libs=-liconv --cc=\"\$CC\" --cxx=\"\$CXX\"
ffmpeg ./configure --disable-pthreads --disable-shared --enable-static --prefix=/usr --pkg-config-flags=--static --disable-nonfree --enable-fontconfig --enable-gpl --enable-version3 --disable-libass --disable-libbluray --enable-libfreetype --disable-libgsm --disable-libmodplug --disable-libmp3lame --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libopus --disable-libsnappy --disable-libsoxr --disable-libspeex --disable-libtheora --disable-libvidstab --disable-libvo-amrwbenc --disable-libvorbis --disable-libvpx --enable-libx264 --enable-libx265 --disable-libxavs --disable-libxvid --disable-libzmq --enable-openssl --disable-securetransport --enable-lzma --extra-cflags='-DMODPLUG_STATIC -DZMQ_STATIC' --extra-cxxflags='-DMODPLUG_STATIC -DZMQ_STATIC' --extra-objcflags='-DMODPLUG_STATIC -DZMQ_STATIC' --extra-libs=-liconv --cc=\"\$CC\" --cxx=\"\$CXX\"
"
DIST_BUILD_OVERRIDES="$DIST_BUILD_OVERRIDES
7zip cd CPP/7zip/Bundles/Alone2; make -j\$NUM_CPUS -f ../../cmpl_\${GCC_OR_CLANG}.mak CC=\"\$CC\" CXX=\"\$CXX\" CFLAGS=\"\$CPPFLAGS \$CFLAGS -c\" CXXFLAGS=\"\$CPPFLAGS \$CXXFLAGS -c\" LFLAGS=\"\$LDFLAGS\" O=. PROG=7z && cp 7z \$BUILD_ROOT/root/bin
c2man ./Configure -de -Dprefix=/usr -Dmansrc=/usr/share/man/man1 -Dcc=\"\$CC\"; \
sed -i.bak \"s|/[^ ][^ ]*/libfl[.][^ ]*|-L\$BUILD_ROOT/root/lib -lfl|\" Makefile; \
\$MAKE -j\$NUM_CPUS; \
@@ -356,16 +354,25 @@ DIST_BUILD_OVERRIDES="$DIST_BUILD_OVERRIDES
urw install_fonts
"
DIST_FLAGS="$DIST_FLAGS
libicu no_autotools_cross_options
gettext no_sdk_paths_in_flags
bison no_sdk_paths_in_flags
libwebp remove_arch_flags_from_build_ninja
docbook2x no_autotools_cross_options
libuuid no_autotools_cross_options
python3 no_autotools_cross_options
"
DIST_ARGS="$DIST_ARGS
pkgconf --disable-tests
libdeflate -DLIBDEFLATE_BUILD_STATIC_LIB=TRUE -DLIBDEFLATE_BUILD_SHARED_LIB=FALSE
libpsl -Druntime=no -Dtests=false
curl --with-openssl --without-nghttp2 --without-libidn2 --without-librtmp --without-brotli
libffi --enable-static
libicu --enable-static --disable-extras --disable-tools --disable-tests --disable-samples --with-library-bits=64
libicu --enable-static --disable-extras --disable-tools --disable-tests --disable-samples --with-library-bits=64 CXXFLAGS=\"\$CXXFLAGS\"
gettext --with-included-gettext --with-included-glib --with-included-libcroco --with-included-libunistring --with-included-libxml --disable-curses CPPFLAGS=\"\$CPPFLAGS -DLIBXML_STATIC\"
pkgconfig --with-internal-glib --with-libiconv=gnu
curl --with-ssl --without-brotli
pcre --enable-utf --enable-unicode-properties --enable-pcre16 --enable-pcre32 --enable-jit
pcre2 --enable-utf8 --enable-pcre2-8 --enable-pcre2-16 --enable-pcre2-32 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-jit
libxslt --without-python --without-crypto
@@ -374,7 +381,7 @@ DIST_ARGS="$DIST_ARGS
graphviz --disable-ltdl --without-x --disable-swig CFLAGS=\"-include \$PWD/declspec.h \$CFLAGS\" CC=\"\$CXX\"
python2 --with-ensurepip=install --with-system-expat
python3 --with-ensurepip=install --with-system-expat
glib -Dtests=false
glib -Dtests=false -Ddtrace=false
XML-Parser EXPATINCPATH=\"\$BUILD_ROOT/root/include\" EXPATLIBPATH=\"\$BUILD_ROOT/root/lib\"
libcroco --disable-Bsymbolic
snappy -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF
@@ -393,6 +400,7 @@ DIST_ARGS="$DIST_ARGS
vidstab -DUSE_OMP=NO
sdl3 -DSDL_CAMERA=OFF
libx264 --enable-static --enable-pic
libwebp -DCMAKE_EXE_LINKER_FLAGS=\"-lutil\"
libx265 -DHIGH_BIT_DEPTH=ON -DENABLE_ASSEMBLY=OFF -DENABLE_CLI=OFF
wxwidgets -DwxUSE_LIBJPEG=sys -DwxUSE_LIBPNG=sys -DwxUSE_LIBTIFF=sys -DwxUSE_LIBWEBP=sys -DwxUSE_REGEX=sys
"
@@ -405,8 +413,6 @@ DIST_MAKE_ARGS="$DIST_MAKE_ARGS
openssl CC=\"\$CC\"
getopt LDFLAGS=\"\$LDFLAGS -lintl -liconv\" CFLAGS=\"\$CFLAGS\"
bzip2 libbz2.a bzip2 bzip2recover CFLAGS=\"\$CFLAGS\" LDFLAGS=\"\$LDFLAGS\"
unzip generic2
zip generic
expat DOCBOOK_TO_MAN=docbook2man
shared-mime-info -j1
xvidcore -j1
@@ -431,7 +437,7 @@ DIST_EXTRA_CFLAGS="$DIST_EXTRA_CFLAGS
DIST_EXTRA_CXXFLAGS="$DIST_EXTRA_CXXFLAGS
gperf -std=gnu++11
wxwidgets -std=gnu++11
wxwidgets -std=gnu++11 -Wno-error=elaborated-enum-base
libmodplug -std=gnu++11
libopencore-amrnb -std=gnu++11
"
@@ -845,7 +851,7 @@ mac_install_core_deps() {
error 'Please install Mac Homebrew: https://brew.sh/'
fi
"$BREW_PREFIX"/bin/brew install -q m4 perl perl-xml-parser meson ninja pyenv cmake gnu-getopt
"$BREW_PREFIX"/bin/brew install -q m4 perl perl-xml-parser meson ninja pyenv cmake ccache gnu-getopt flex swig
ln -sf "$(find "$BREW_PREFIX"/Cellar/gnu-getopt -path '*/bin/getopt' | head -1)" "$BUILD_ROOT/root/bin/getopt"
ln -sf "$(find "$BREW_PREFIX"/Cellar/m4 -path '*/bin/m4' | head -1)" "$BUILD_ROOT/root/bin/m4"
@@ -1197,7 +1203,7 @@ unpack_dist() {
bzip2 -dc "$dist_file" | $TAR $@ -xf -
;;
*.zip)
unzip -q "$dist_file"
7z x "$dist_file"
;;
esac
@@ -1441,6 +1447,11 @@ rebuild_dist() {
run_ninja() {
eval "set -- $(dist_ninja_args "$current_dist")"
if dist_flags "$current_dist" remove_arch_flags_from_build_ninja; then
sed -i.bak -E '/^ *ARCH_FLAGS =/d' build.ninja
fi
echo_run ninja "$@"
}
@@ -1482,6 +1493,14 @@ build_dist() {
export LDFLAGS="$LDFLAGS $(eval puts "$(dist_extra_ldflags "$current_dist")")"
export LIBS="$LIBS $(eval puts "$(dist_extra_libs "$current_dist")")"
if dist_flags "$current_dist" no_sdk_paths_in_flags; then
local xcode_path=$(xcode-select -p)
CPPFLAGS=$( echo "$CPPFLAGS" | sed -E "s,-isystem (/Library/Developer|${xcode_path})[^ ]*,,g")
CXXFLAGS=$( echo "$CXXFLAGS" | sed -E "s,-isystem (/Library/Developer|${xcode_path})[^ ]*,,g")
OBJCXXFLAGS=$(echo "$OBJCXXFLAGS" | sed -E "s,-isystem (/Library/Developer|${xcode_path})[^ ]*,,g")
LDFLAGS=$( echo "$LDFLAGS" | sed -E "s,-[LF](/Library/Developer|${xcode_path})[^ ]*,,g")
fi
configure_override=$(dist_configure_override "$current_dist")
install_override=$(dist_install_override "$current_dist")
build_override=$(dist_build_override "$current_dist")
@@ -1574,13 +1593,35 @@ build_dist() {
if [ -z "$autogen" ] || ! path_exists config.status; then
if path_exists Configure; then
chmod +x ./Configure
eval "set -- $CONFIGURE_REQUIRED_ARGS $(dist_args "$current_dist" autoconf) $extra_dist_args"
echo_run ./Configure "$@"
configure=./Configure
else
chmod +x ./configure
eval "set -- $CONFIGURE_REQUIRED_ARGS $(dist_args "$current_dist" autoconf) $extra_dist_args"
echo_run ./configure "$@"
configure=./configure
fi
eval "set -- $CONFIGURE_REQUIRED_ARGS $(dist_args "$current_dist" autoconf) $extra_dist_args"
if dist_flags "$current_dist" no_autotools_cross_options; then
i=1
while [ $i -le $# ]; do
eval "arg=\$$i"
case "$arg" in
--host=*)
shift
continue
;;
--build=*)
shift
continue
;;
esac
i=$(($i + 1))
done
fi
echo_run $configure "$@"
fi
fi
@@ -2290,6 +2331,27 @@ dist_prefix() {
puts "$prefix"
}
dist_flags() {
current_dist=$1
[ -n "$current_dist" ] || die 'dist_flags: dist name required'
shift
[ -n "$1" ] || die 'dist_flags: at least one flag required'
dist_flags=$(table_line DIST_FLAGS "$current_dist") || :
while [ $# -ne 0 ]; do
flag=$1
shift
case "$dist_flags" in
*${flag}*)
return 0
;;
esac
return 1
done
}
dist_tar_args() {
current_dist=$1
[ -n "$current_dist" ] || die 'dist_tar_args: dist name required'
@@ -2781,7 +2843,7 @@ build_project() {
# Release build.
puts "${NL}Building Release...${NL}${NL}"
cd release
echo_eval_run cmake "'$CHECKOUT'" $CMAKE_REQUIRED_ARGS -DENABLE_FAUDIO=ON -DENABLE_FFMPEG=ON -DENABLE_GENERIC_FILE_DIALOGS=ON -DVBAM_STATIC=ON -DENABLE_LTO=${lto} -DUPSTREAM_RELEASE=TRUE $CMAKE_ARGS $PROJECT_ARGS -G Ninja $@
echo_eval_run PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH" cmake "'$CHECKOUT'" $CMAKE_REQUIRED_ARGS -DENABLE_FAUDIO=ON -DENABLE_FFMPEG=ON -DENABLE_GENERIC_FILE_DIALOGS=ON -DVBAM_STATIC=ON -DENABLE_LTO=${lto} -DUPSTREAM_RELEASE=TRUE $CMAKE_ARGS $PROJECT_ARGS -G Ninja $@
run_ninja
dist_post_build project
cd ..
@@ -2789,7 +2851,7 @@ build_project() {
# Debug build.
puts "${NL}Building Debug...${NL}${NL}"
cd debug
echo_eval_run cmake "'$CHECKOUT'" $CMAKE_REQUIRED_ARGS -DENABLE_FAUDIO=ON -DENABLE_FFMPEG=ON -DENABLE_GENERIC_FILE_DIALOGS=ON -DVBAM_STATIC=ON -DENABLE_LTO=${lto} -DUPSTREAM_RELEASE=TRUE $CMAKE_ARGS $PROJECT_ARGS -DCMAKE_BUILD_TYPE=Debug -G Ninja $@
echo_eval_run PATH="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH" cmake "'$CHECKOUT'" $CMAKE_REQUIRED_ARGS -DENABLE_FAUDIO=ON -DENABLE_FFMPEG=ON -DENABLE_GENERIC_FILE_DIALOGS=ON -DVBAM_STATIC=ON -DENABLE_LTO=${lto} -DUPSTREAM_RELEASE=TRUE $CMAKE_ARGS $PROJECT_ARGS -DCMAKE_BUILD_TYPE=Debug -G Ninja $@
run_ninja
dist_post_build project
cd ..

View File

@@ -17,7 +17,7 @@ if [ -z "$IN_DASH" ]; then
fi
target_bits=64
target_build_arch=-m64
target_build_arch=
if [ "$(uname -m)" = arm64 ]; then
export APPLE_SILICON=1
@@ -57,13 +57,13 @@ export MACOSX_DEPLOYMENT_TARGET=10.10
if [ -n "$APPLE_SILICON" ]; then
if [ -n "$intel_target" ]; then
target_build_arch='-target x86_64-apple-macos10.15 -march=core2 -mtune=skylake'
target_build_arch="-target x86_64-apple-macos${MACOSX_DEPLOYMENT_TARGET}"
target_cpu=x86_64
else
export MACOSX_DEPLOYMENT_TARGET=11.0 # Big Sur
fi
elif [ "$target_cpu" = x86_64 ]; then
target_build_arch="-m64 -march=core2 -mtune=skylake -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
target_build_arch="-target x86_64-apple-macos${MACOSX_DEPLOYMENT_TARGET}"
fi
# Need to use Xcode 9 for 32 bit builds on Mojave and newer.
@@ -117,6 +117,7 @@ best_llvm_path=$(
[ -z "$best_llvm_path" ] && best_llvm_path=/usr
clang_path=${best_llvm_path%%:*}
xcode_path=$(xcode-select -p)
BUILD_ENV=$(cat <<EOF
export MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET
@@ -126,14 +127,15 @@ export PATH="$best_llvm_path/bin:$BREW_PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export CC="$clang_path/bin/clang $target_build_arch"
export CPP="$clang_path/bin/clang -E $target_build_arch"
export CXX="$clang_path/bin/clang++ $target_build_arch"
export ARCHFLAGS="$target_build_arch"
export CPPFLAGS="-DICONV_CONST="
export CFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind"
export CXXFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind"
export OBJCXXFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind"
export LDFLAGS="-framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind"
export CFLAGS="-F$xcode_path/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wno-error=incompatible-function-pointer-types -fpermissive -Wno-error=unguarded-availability"
export CXXFLAGS="-F$xcode_path/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wno-error=unguarded-availability"
export OBJCXXFLAGS="-F$xcode_path/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wno-error=unguarded-availability"
export LDFLAGS="-L\"\$BUILD_ROOT/root/lib\" -L$xcode_path/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -F$xcode_path/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind"
export UUID_CFLAGS="-I\$BUILD_ROOT/root/stow/libuuid/include"
export UUID_LIBS="-L\$BUILD_ROOT/root/stow/libuuid/lib -luuid"
export UUID_CFLAGS="-I\"\$BUILD_ROOT/root/stow/libuuid/include\""
export UUID_LIBS="-L\"\$BUILD_ROOT/root/stow/libuuid/lib\" -luuid"
EOF
)
@@ -143,6 +145,9 @@ export TAR=tar
if [ "$target_cpu" = i386 ]; then
export CONFIGURE_REQUIRED_ARGS='--host=i386-apple-darwin --build=x86_64-apple-darwin'
elif [ -n "$intel_target" ]; then
export CONFIGURE_REQUIRED_ARGS='--host=x86_64-apple-darwin --build=arm64-apple-darwin'
export CMAKE_BASE_ARGS="-DCMAKE_OSX_ARCHITECTURES=x86_64"
fi
. "$(dirname "$0")/../builder/core.sh"
@@ -151,16 +156,12 @@ fi
BUILD_ENV=$(printf '%s' "$BUILD_ENV" | sed 's/ -lm / /g')
export BUILD_ENV
for dist in XML-Parser c2man cmake cmake flex getopt graphviz libffi libgcrypt libsecret m4 ninja python2 shared-mime-info zip; do
for dist in XML-Parser c2man cmake cmake ccache flex getopt glib graphviz libffi libgcrypt libsecret m4 ninja python2 shared-mime-info swig; do
table_line_remove DISTS $dist
done
table_line_replace DIST_PREFIX libuuid /usr/stow/libuuid
table_line_append DIST_PRE_BUILD zip " \
sed -i.bak 's/-DZMEM//g; s/-DNO_DIR//g;' unix/configure \
"
if [ "$target_cpu" = i386 ]; then
table_line_replace DIST_CONFIGURE_OVERRIDES openssl './Configure darwin-i386-cc no-shared --prefix=/usr --openssldir=/etc/ssl'
elif [ "$target_cpu" = ARM64 ]; then
@@ -187,8 +188,6 @@ table_line_append DIST_EXTRA_CFLAGS libtheora "-include $stdint_h"
table_line_append DIST_EXTRA_CFLAGS ffmpeg "-include $stdint_h"
table_line_append DIST_MAKE_ARGS unzip "LD=clang"
# -Wl,-no_compact_unwind must be passed in LDFLAGS to openssl
table_line_append DIST_MAKE_ARGS openssl "LDFLAGS=\"\$LDFLAGS\""
@@ -211,10 +210,6 @@ table_line_append DIST_PRE_BUILD libmodplug " \
sed -i.bak 's/-lstdc++/-lc++/g' libmodplug.pc.in; \
"
if [ -z "$APPLE_SILICON" ]; then
table_line_replace DISTS glib 'https://download.gnome.org/sources/glib/2.78/glib-2.78.3.tar.xz lib/libglib-2.0.a'
fi
table_line_append DIST_PRE_BUILD libzmq "sed -i.bak 's/-lstdc++/-lc++/g' src/libzmq.pc.in"
table_line_append DIST_PRE_BUILD ffmpeg "sed -i.bak 's/-lstdc++/-lc++/g' configure"