Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 0.11-dev (2cbbaea) #291

Open
wants to merge 100 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
55c7c2f
CMake: Remove leftover debug print
endrift Feb 7, 2024
c917a71
Qt: Improve OpenGLES support and cleanup ifdef maze
endrift Feb 7, 2024
49d9b70
Core: Move rewind state coalescing into mCoreRewindRestore
endrift Feb 9, 2024
cf54ddd
CMake: make compile with mingw-w64 and Qt6
oltolm Jan 7, 2024
3571b11
fix compilation warnings
oltolm Jan 7, 2024
c541a79
Windows: Fix compilation woes from last commit
endrift Mar 5, 2024
4ee6339
3DS: Implement 3x sharp bilinear scaling and make it the default
TuxSH Aug 11, 2023
369e6a0
Fix menu bug that allowed the selection of invalid states when wrap=true
TuxSH Sep 17, 2023
d8ab552
GB: Fix type coercion
endrift Mar 12, 2024
c8c9fcb
SDL: Use SDL_GameControllerRumble instead of SDL_JoystickRumble if av…
endrift Mar 13, 2024
4fdadc5
GB Audio: Fix audio envelope timing resetting too often (fixes #3164)
endrift Mar 18, 2024
776d52a
Scripting: Export new image masking function
endrift Mar 19, 2024
c80f3af
Qt: Reattach video backend when resetting scripts (fixes #3167)
endrift Mar 19, 2024
aa7b934
Core: Clean up thread state mutex usage
endrift Mar 20, 2024
a2587cb
Util: Code cleanup to remove unreachable code
endrift Mar 20, 2024
cf0d8fd
Qt: Get InputController compiling with Qt6
endrift Mar 24, 2024
3f21de2
Qt: Port AudioProcessorQt to Qt6
endrift Mar 24, 2024
06448e8
Qt: Get VideoDumper compiling with Qt6
endrift Mar 25, 2024
dc29af8
Qt: Hook up cameras in Qt6
endrift Mar 25, 2024
04bbcdf
Qt: Fix build
endrift Mar 25, 2024
6940b42
Qt: Fix non-Multimedia build
endrift Mar 25, 2024
ea53393
GBA Savedata: Prefix SavedataType constants and type name
endrift Mar 25, 2024
e48acb6
GB, GBA: Move override structs to public API
endrift Mar 25, 2024
abf4846
GBA: Fix build
endrift Mar 25, 2024
4a17ed3
GBA: Remove legacy "mirroring" field from overrides
endrift Mar 25, 2024
318c5d7
GBA: Move GBAHardwareDevice to public API
endrift Mar 25, 2024
a430f58
GB, GBA: Move more override-adjacent stuff to public API
endrift Mar 25, 2024
1179d21
Qt: Fix Qt6 build
endrift Mar 25, 2024
ae8b88a
Qt: Fix underrun stalling with Qt6
endrift Mar 26, 2024
8655161
Qt: Enable building against Qt6 by default
endrift Mar 26, 2024
e3edca1
Scripting: Attempt to shake out single-lua_State requirement
endrift Mar 27, 2024
5ff777d
Scripting: Add overloads, overload isKeyActive
endrift Apr 3, 2024
fb7ad7d
Qt: Actually load defaults again
endrift Apr 3, 2024
68d120e
SDL: Start actually using SDL_GameController for its intended purpose
endrift Apr 3, 2024
9320588
Qt: Switch SDL controller usage from Joystick to GameController
endrift Apr 3, 2024
6e39eb3
Qt: Update translation (Spanish)
gallegonovato Jul 29, 2023
5acef1c
Qt: Update translation (Spanish)
momocaoo Sep 22, 2023
dcb07f6
Qt: Update translation (Korean)
DDinghoya Aug 4, 2023
424ef6f
Qt: Update translation (Portuguese (Brazil))
Felipefpl Aug 1, 2023
7af70a6
Qt: Update translation (Polish)
Sep 30, 2023
3a37c1d
Qt: Update translation (Turkish)
KaptanLingu Oct 17, 2023
0a8470a
Qt: Update translation (Turkish)
enescetinkal Jan 27, 2024
b78d230
Qt: Update translation (Hungarian)
Guih48 Oct 20, 2023
af2e2fd
Qt: Update translation (German)
tolik518 Nov 3, 2023
33bfd7f
Qt: Update translation (Portuguese)
SantosSi Dec 18, 2023
910326f
Qt: Update translation (Norwegian Bokmål)
DandelionSprout Feb 22, 2024
8907131
Qt: Update translation (Italian)
Hexaae Feb 25, 2024
ee1a860
SDL: Fix build on SDL 2.0.12
endrift Apr 3, 2024
b5a2f62
SDL: Really fix the build this time
endrift Apr 3, 2024
104d746
Core: Fix some mutex ordering
endrift Apr 4, 2024
008a6f3
Scripting: Attempt to fix MSVC build
endrift Apr 4, 2024
e61a324
Core: More threading cleanup
endrift Apr 5, 2024
1f2d0d5
GBA GPIO: Fix gyro read-out start (fixes #3141)
endrift Apr 5, 2024
04a95a5
CHANGES: Remove duplicate entry
endrift Apr 8, 2024
47ec447
CMakeLists: Fix strtof_l detection logic
endrift Apr 8, 2024
02b2f5a
flags.h: Add missing flags
endrift Apr 8, 2024
4652bbb
Util: Fix #if into #ifdef
endrift Apr 8, 2024
0e44152
CMake: Rename USE_DEBUGGERS and USE_GDB_STUB to ENABLE_DEBUGGERS and …
endrift Apr 8, 2024
2037e97
Qt: Update translation (Chinese (Simplified))
endrift Apr 8, 2024
61172d8
Core: Fix thread not waking up properly on canceling request
endrift Apr 9, 2024
7220254
Core: Don't trigger watchpoints with access inside of a script (fixes…
endrift Apr 9, 2024
cbd117e
Util: Start bringing up better audio resampling
endrift Apr 11, 2024
2d03ae6
3DS: Handle audio resampling in DSP
endrift Apr 11, 2024
a8023e4
Qt: Remove debug message from CMakeLists
endrift Apr 12, 2024
bc6a801
Util: Start adding CircleBuffer tests
endrift Apr 12, 2024
cecb454
Util: Remember to free memory in tests
endrift Apr 12, 2024
042a66b
Scripting: Fix leak when freeing painters
endrift Apr 13, 2024
6d2109d
Util: Add offset parameter to CircleBufferDump, more tests
endrift Apr 13, 2024
c689a7f
Util: Add CircleBufferWriteTruncate
endrift Apr 13, 2024
ce46b6f
Util: Fix overzealous CircleBufferRead/Write16, lots more tests
endrift Apr 13, 2024
e8c6613
Util: Fix misaligned end pointer case
endrift Apr 13, 2024
b62ae33
Util: Change mInterpolator data API
endrift Apr 13, 2024
fd4175e
Util: Rename CircleBuffer to mCircleBuffer
endrift Apr 13, 2024
237d502
Util: Add prototype mAudioBuffer wrapper
endrift Apr 13, 2024
f13a087
Feature: Fix (unused) mVideoProxyBackendRun with block=true
endrift Apr 14, 2024
2d7000c
Util: Remove unreachable code
endrift Apr 14, 2024
a999a87
Debugger: Actually handle parseLexedExpression returning false
endrift Apr 14, 2024
e8e6b80
Qt: Fix window resizing when no game is loaded
endrift Apr 14, 2024
be85200
Qt: Fix race condition in Qt display driver that could cause division…
endrift Apr 15, 2024
d1a6e6b
Qt: Add option to lock the maximum frame size (closes #1493)
endrift Apr 15, 2024
4bd09bd
fix hang in AudioDevice
oltolm Mar 28, 2024
9fa825e
Util: Start bringing up new resampler
endrift Apr 16, 2024
76169c6
Util: Fix circle buffer dump offset forcing an early wrap
endrift Apr 16, 2024
96a2ef5
Util: Enable dropping part of a circle buffer with a null read
endrift Apr 16, 2024
73a39de
Core: Finally kill off GBAAudioCalculateRatio
endrift Apr 17, 2024
7b2edbd
Core: Add functions to get native sample rates
endrift Apr 17, 2024
5d92c3c
SDL: Fix GB audio speed
endrift Apr 17, 2024
b40cdd0
Switch: Switch to resampling with audren
endrift Apr 20, 2024
61791c9
Switch: Fix warnings
endrift Apr 20, 2024
f298c01
Qt: Add option to force a specific version of Qt
endrift Apr 21, 2024
f84208a
GBA Memory: Let raw access read high MMIO addresses
endrift Apr 21, 2024
2eca3c1
Vita: Switch to using lw mutexes
endrift Apr 21, 2024
afa8a25
Util: Add cosine interpolator
endrift Apr 21, 2024
febedc3
Util: Allow audio resampler to use different interpolators
endrift Apr 21, 2024
89866af
GBA Audio: Remove broken XQ audio pending rewrite
endrift Apr 22, 2024
f51cb15
Core: Switch from blip to mAudioResampler
endrift Apr 22, 2024
fa2fe8e
Third-Party: Remove blip_buf
endrift Apr 22, 2024
d422cbe
OpenEmu: Remove upstream core
endrift Apr 22, 2024
2cbbaea
Python: Attempt to fix build
endrift Apr 22, 2024
3117738
Update to 0.11-dev (2cbbaea)
Ryunam Apr 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
CMakeCache.txt
CMakeFiles
CMakeSettings.json
CMakeUserPresets.json
compile_commands.json
/.cache
/.vscode
cmake_install.cmake
hle-bios.bin
version.c
Expand Down
6 changes: 5 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
0.11.0: (Future)
Features:
- New option to lock the maximum frame size
- Scripting: New `input` API for getting raw keyboard/mouse/controller state
- Scripting: New `storage` API for saving data for a script, e.g. settings
- Scripting: Debugger integration to allow for breakpoints and watchpoints
- New unlicensed GB mappers: NT (older types 1 and 2), Li Cheng, GGB-81
- Debugger: Add range watchpoints
Emulation fixes:
- GB Audio: Fix audio envelope timing resetting too often (fixes mgba.io/i/3164)
- GB I/O: Fix STAT writing IRQ trigger conditions (fixes mgba.io/i/2501)
- GB Serialize: Add missing Pocket Cam state to savestates
- GB Video: Implement DMG-style sprite ordering
- GBA: Unhandled bkpt should be treated as an undefined exception
- GBA GPIO: Fix tilt scale and orientation (fixes mgba.io/i/2703)
- GBA GPIO: Fix gyro read-out start (fixes mgba.io/i/3141)
- GBA I/O: Fix HALTCNT access behavior (fixes mgba.io/i/2309)
- GBA SIO: Fix MULTI mode SIOCNT bit 7 writes on secondary GBAs (fixes mgba.io/i/3110)
- GBA Video: Disable BG target 1 blending when OBJ blending (fixes mgba.io/i/2722)
Other fixes:
- Core: Fix inconsistencies with setting game-specific overrides (fixes mgba.io/i/2963)
- Debugger: Fix writing to specific segment in command-line debugger
- GB: Fix uninitialized save data when loading undersized temporary saves
- GBA Memory: Let raw access read high MMIO addresses
- Qt: Fix savestate preview sizes with different scales (fixes mgba.io/i/2560)
- Updater: Fix updating appimage across filesystems
Misc:
- Core: Handle relative paths for saves, screenshots, etc consistently (fixes mgba.io/i/2826)
- GB: Prevent incompatible BIOSes from being used on differing models
- GB Serialize: Add missing savestate support for MBC6 and NT (newer)
- GBA: Improve detection of valid ELF ROMs
- GBA Audio: Remove broken XQ audio pending rewrite
- mGUI: Enable auto-softpatching (closes mgba.io/i/2899)
- mGUI: Persist fast forwarding after closing menu (fixes mgba.io/i/2414)
- Qt: Handle multiple save game files for disparate games separately (fixes mgba.io/i/2887)
Expand Down
75 changes: 22 additions & 53 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ if(NOT MSVC)
# TODO: Remove this once mScript KV pairs support const correctness
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=incompatible-pointer-types")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual -Werror=reorder")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS /wd4003 /wd4244 /wd4146 /wd4267 /Zc:preprocessor-")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS /wd4003 /wd4244 /wd4146 /wd4267 /Zc:preprocessor-")
endif()

if(NOT LIBMGBA_ONLY)
set(USE_DEBUGGERS ON CACHE BOOL "Whether or not to enable the debugging infrastructure")
set(ENABLE_DEBUGGERS ON CACHE BOOL "Whether or not to enable the debugging infrastructure")
if (NOT WIN32)
set(USE_EDITLINE ON CACHE BOOL "Whether or not to enable the CLI-mode debugger")
endif()
set(USE_GDB_STUB ON CACHE BOOL "Whether or not to enable the GDB stub ARM debugger")
set(ENABLE_GDB_STUB ON CACHE BOOL "Whether or not to enable the GDB stub ARM debugger")
set(USE_FFMPEG ON CACHE BOOL "Whether or not to enable FFmpeg support")
set(USE_ZLIB ON CACHE BOOL "Whether or not to enable zlib support")
set(USE_MINIZIP ON CACHE BOOL "Whether or not to enable external minizip support")
Expand All @@ -68,9 +68,6 @@ if(NOT LIBMGBA_ONLY)
set(BUILD_QT ON CACHE BOOL "Build Qt frontend")
set(BUILD_SDL ON CACHE BOOL "Build SDL frontend")
set(BUILD_LIBRETRO OFF CACHE BOOL "Build libretro core")
if(APPLE)
set(BUILD_OPENEMU OFF CACHE BOOL "Build OpenEmu core")
endif()
set(BUILD_PERF OFF CACHE BOOL "Build performance profiling tool")
set(BUILD_TEST OFF CACHE BOOL "Build testing harness")
set(BUILD_SUITE OFF CACHE BOOL "Build test suite")
Expand All @@ -80,7 +77,7 @@ if(NOT LIBMGBA_ONLY)
set(BUILD_PYTHON OFF CACHE BOOL "Build Python bindings")
set(BUILD_STATIC OFF CACHE BOOL "Build a static library")
set(BUILD_SHARED ON CACHE BOOL "Build a shared library")
set(SKIP_LIBRARY OFF CACHE BOOL "Skip building the library (useful for only building libretro or OpenEmu cores)")
set(SKIP_LIBRARY OFF CACHE BOOL "Skip building the library (useful for only building libretro core)")
set(BUILD_GL ON CACHE BOOL "Build with OpenGL")
set(BUILD_GLES2 ON CACHE BOOL "Build with OpenGL|ES 2")
set(BUILD_GLES3 ON CACHE BOOL "Build with OpenGL|ES 3")
Expand Down Expand Up @@ -144,11 +141,6 @@ if (BUILD_LIBRETRO)
mark_as_advanced(LIBRETRO_LIBDIR)
endif()

if (BUILD_OPENEMU)
set(OE_LIBDIR "${LIBDIR}" CACHE PATH "Installed library directory (OpenEmu)")
mark_as_advanced(OE_LIBDIR)
endif()

if (DISTBUILD)
set(EXTRA_LICENSES "" CACHE FILEPATH "Extra licenses to include in distribution packaages")
mark_as_advanced(EXTRA_LICENSES)
Expand Down Expand Up @@ -217,13 +209,15 @@ endif()
# Platform support
if(WIN32)
set(WIN32_VERSION "${LIB_VERSION_MAJOR},${LIB_VERSION_MINOR},${LIB_VERSION_PATCH}")
add_definitions(-D_WIN32_WINNT=0x0600)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
if(MSVC)
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
add_definitions(-D_UNICODE -DUNICODE)
else()
add_definitions(-D_GNU_SOURCE)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_compile_definitions(_FILE_OFFSET_BITS=64)
endif()
endif()
list(APPEND OS_LIB ws2_32 shlwapi)
list(APPEND CORE_VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-fd.c ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/windows/vfs-w32.c)
Expand Down Expand Up @@ -299,7 +293,7 @@ endif()

if(DEFINED 3DS OR DEFINED PSP2 OR DEFINED WII OR DEFINED SWITCH)
set(IS_EMBEDDED ON)
set(USE_DEBUGGERS OFF)
set(ENABLE_DEBUGGERS OFF)
set(USE_SQLITE3 OFF)
set(USE_DISCORD_RPC OFF)
set(USE_LIBZIP OFF CACHE BOOL "")
Expand All @@ -311,12 +305,12 @@ if(DEFINED SWITCH)
endif()

if(NOT M_CORE_GBA)
set(USE_GDB_STUB OFF)
set(ENABLE_GDB_STUB OFF)
endif()

if(NOT USE_DEBUGGERS)
if(NOT ENABLE_DEBUGGERS)
set(USE_EDITLINE OFF)
set(USE_GDB_STUB OFF)
set(ENABLE_GDB_STUB OFF)
endif()

if(WII)
Expand All @@ -343,18 +337,14 @@ find_function(popcount32)

find_function(futimens)
find_function(futimes)
find_function(localtime_r)

find_function(realpath)

if(ANDROID AND ANDROID_NDK_MAJOR GREATER 13)
find_function(localtime_r)
set(HAVE_STRTOF_L ON)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_function(localtime_r)
list(APPEND FUNCTION_DEFINES HAVE_STRTOF_L)
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
# The strtof_l on Linux not actually exposed nor actually strtof_l
set(HAVE_STRTOF_L OFF)
else()
find_function(localtime_r)
find_function(strtof_l)
endif()

Expand Down Expand Up @@ -491,7 +481,7 @@ if(NOT BUILD_GLES2 AND NOT BUILD_GLES3 AND NOT LIBMGBA_ONLY)
endif()

if(DISABLE_DEPS)
set(USE_GDB_STUB OFF)
set(ENABLE_GDB_STUB OFF)
set(USE_DISCORD_RPC OFF)
set(USE_JSON_C OFF)
set(USE_SQLITE3 OFF)
Expand Down Expand Up @@ -543,8 +533,8 @@ else()
set(DEBUGGER_LIB "")
endif()

if(USE_GDB_STUB)
list(APPEND FEATURES GDB_STUB)
if(ENABLE_GDB_STUB)
list(APPEND ENABLES GDB_STUB)
endif()
source_group("Debugger" FILES ${DEBUGGER_SRC})

Expand Down Expand Up @@ -588,8 +578,6 @@ if(USE_FFMPEG)
endif()
endif()

list(APPEND THIRD_PARTY_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/blip_buf/blip_buf.c")

if(WANT_ZLIB AND NOT USE_ZLIB)
set(SKIP_INSTALL_ALL ON)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/zlib zlib EXCLUDE_FROM_ALL)
Expand Down Expand Up @@ -853,10 +841,10 @@ if(M_CORE_GBA)
list(APPEND TEST_SRC ${ARM_TEST_SRC} ${GBA_TEST_SRC})
endif()

if(USE_DEBUGGERS)
if(ENABLE_DEBUGGERS)
list(APPEND FEATURE_SRC ${DEBUGGER_SRC})
list(APPEND TEST_SRC ${DEBUGGER_TEST_SRC})
list(APPEND FEATURES DEBUGGERS)
list(APPEND ENABLES DEBUGGERS)
endif()

if(ENABLE_SCRIPTING)
Expand Down Expand Up @@ -1005,22 +993,6 @@ if(BUILD_LIBRETRO)
endif()
endif()

if(BUILD_OPENEMU)
find_library(FOUNDATION Foundation)
find_library(OPENEMUBASE OpenEmuBase)
file(GLOB OE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/openemu/*.m)
add_library(${BINARY_NAME}-openemu MODULE ${CORE_SRC} ${OS_SRC})
set_target_properties(${BINARY_NAME}-openemu PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/openemu/Info.plist.in
BUNDLE TRUE
BUNDLE_EXTENSION oecoreplugin
OUTPUT_NAME ${PROJECT_NAME}
COMPILE_OPTIONS "-fobjc-arc"
COMPILE_DEFINITIONS "DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};MINIMAL_CORE=1")
target_link_libraries(${BINARY_NAME}-openemu ${OS_LIB} ${FOUNDATION} ${OPENEMUBASE})
install(TARGETS ${BINARY_NAME}-openemu LIBRARY DESTINATION ${OE_LIBDIR} COMPONENT ${BINARY_NAME}.oecoreplugin NAMELINK_SKIP)
endif()

if(BUILD_QT AND (WIN32 OR APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Linux"))
set(BUILD_UPDATER ON)
endif()
Expand Down Expand Up @@ -1087,7 +1059,7 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/mgba-util DESTINATION ${CM
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/mgba/flags.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mgba COMPONENT ${BINARY_NAME}-dev)

# Packaging
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/licenses/blip_buf.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}/licenses COMPONENT ${BINARY_NAME})
install(FILES DESTINATION ${CMAKE_INSTALL_DOCDIR}/licenses COMPONENT ${BINARY_NAME})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/licenses/inih.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}/licenses COMPONENT ${BINARY_NAME})
if(USE_DISCORD_RPC)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/res/licenses/discord-rpc.txt DESTINATION ${CMAKE_INSTALL_DOCDIR}/licenses COMPONENT ${BINARY_NAME})
Expand Down Expand Up @@ -1314,11 +1286,11 @@ if(NOT QUIET AND NOT LIBMGBA_ONLY)
message(STATUS " Game Boy Advance: ${M_CORE_GBA}")
message(STATUS " Game Boy: ${M_CORE_GB}")
message(STATUS "Features:")
message(STATUS " Debuggers: ${USE_DEBUGGERS}")
message(STATUS " Debuggers: ${ENABLE_DEBUGGERS}")
if(NOT WIN32)
message(STATUS " CLI debugger: ${USE_EDITLINE}")
endif()
message(STATUS " GDB stub: ${USE_GDB_STUB}")
message(STATUS " GDB stub: ${ENABLE_GDB_STUB}")
message(STATUS " GIF/Video recording: ${USE_FFMPEG}")
message(STATUS " Screenshot/advanced savestate support: ${USE_PNG}")
message(STATUS " ZIP support: ${SUMMARY_ZIP}")
Expand Down Expand Up @@ -1349,9 +1321,6 @@ if(NOT QUIET AND NOT LIBMGBA_ONLY)
message(STATUS " ROM tester: ${BUILD_ROM_TEST}")
message(STATUS "Cores:")
message(STATUS " Libretro core: ${BUILD_LIBRETRO}")
if(APPLE)
message(STATUS " OpenEmu core: ${BUILD_OPENEMU}")
endif()
message(STATUS "Libraries:")
message(STATUS " Static: ${BUILD_STATIC}")
message(STATUS " Shared: ${BUILD_SHARED}")
Expand Down
21 changes: 21 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": 3,
"configurePresets": [
{
"name": "clang",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
"name": "gcc",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
}
]
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ mGBA is Copyright © 2013 – 2023 Jeffrey Pfau. It is distributed under the [Mo
mGBA contains the following third-party libraries:

- [inih](https://github.com/benhoyt/inih), which is copyright © 2009 – 2020 Ben Hoyt and used under a BSD 3-clause license.
- [blip-buf](https://code.google.com/archive/p/blip-buf), which is copyright © 2003 – 2009 Shay Green and used under a Lesser GNU Public License.
- [LZMA SDK](http://www.7-zip.org/sdk.html), which is public domain.
- [MurmurHash3](https://github.com/aappleby/smhasher) implementation by Austin Appleby, which is public domain.
- [getopt for MSVC](https://github.com/skandhurkat/Getopt-for-Visual-Studio/), which is public domain.
Expand Down
1 change: 0 additions & 1 deletion README_DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ Copyright für mGBA © 2013 – 2021 Jeffrey Pfau. mGBA wird unter der [Mozilla
mGBA beinhaltet die folgenden Bibliotheken von Drittanbietern:

- [inih](https://github.com/benhoyt/inih), Copyright © 2009 - 2020 Ben Hoyt, verwendet unter einer BSD 3-clause-Lizenz.
- [blip-buf](https://code.google.com/archive/b/blip-buf), Copyright © 2003 - 2009 Shay Green, verwendet unter einer Lesser GNU Public License.
- [LZMA SDK](http://www.7-zip.org/sdk.html), Public Domain.
- [MurmurHash3](https://github.com/aappleby/smhasher), Implementierung von Austin Appleby, Public Domain.
- [getopt fot MSVC](https://github.com/skandhurkat/Getopt-for-Visual-Studio/), Public Domain.
Expand Down
1 change: 0 additions & 1 deletion README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ mGBA es Copyright © 2013 – 2021 Jeffrey Pfau. Es distribuído bajo la [licenc
mGBA contiene las siguientes bibliotecas de terceros:

- [inih](https://github.com/benhoyt/inih), que es copyright © 2009 - 2020 Ben Hoyt y se utiliza bajo licencia de la cláusula 3 de BSD.
- [blip-buf](https://code.google.com/archive/p/blip-buf), que es copyright © 2003 - 2009 Shay Green y se usa bajo LGPL.
- [LZMA SDK](http://www.7-zip.org/sdk.html), la cual está en el dominio público.
- [MurmurHash3](https://github.com/aappleby/smhasher), implementación por Austin Appleby, la cual está en el dominio público.
- [getopt for MSVC](https://github.com/skandhurkat/Getopt-for-Visual-Studio/), la cual está en el dominio público.
Expand Down
1 change: 0 additions & 1 deletion README_ZH_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ mGBA 版权 © 2013 – 2020 Jeffrey Pfau。基于 [Mozilla 公共许可证版
mGBA 包含以下第三方库:

- [inih](https://github.com/benhoyt/inih):版权 © 2009 – 2020 Ben Hoyt,基于 BSD 3-clause 许可证使用。
- [blip-buf](https://code.google.com/archive/p/blip-buf):版权 © 2003 – 2009 Shay Green,基于 Lesser GNU 公共许可证使用。
- [LZMA SDK](http://www.7-zip.org/sdk.html):属公有领域使用。
- [MurmurHash3](https://github.com/aappleby/smhasher):由 Austin Appleby 实施,属公有领域使用。
- [getopt for MSVC](https://github.com/skandhurkat/Getopt-for-Visual-Studio/):属公有领域使用。
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions include/mgba-util/audio-buffer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Copyright (c) 2013-2024 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef M_AUDIO_BUFFER_H
#define M_AUDIO_BUFFER_H

#include <mgba-util/common.h>

CXX_GUARD_START

#include <mgba-util/circle-buffer.h>

struct mAudioBuffer {
struct mCircleBuffer data;
unsigned channels;
};

void mAudioBufferInit(struct mAudioBuffer* buffer, size_t capacity, unsigned channels);
void mAudioBufferDeinit(struct mAudioBuffer* buffer);

size_t mAudioBufferAvailable(const struct mAudioBuffer* buffer);
size_t mAudioBufferCapacity(const struct mAudioBuffer* buffer);

void mAudioBufferClear(struct mAudioBuffer* buffer);
int16_t mAudioBufferPeek(const struct mAudioBuffer* buffer, unsigned channel, size_t offset);
size_t mAudioBufferDump(const struct mAudioBuffer* buffer, int16_t* samples, size_t count, size_t offset);
size_t mAudioBufferRead(struct mAudioBuffer* buffer, int16_t* samples, size_t count);
size_t mAudioBufferWrite(struct mAudioBuffer* buffer, const int16_t* samples, size_t count);

CXX_GUARD_END

#endif
42 changes: 42 additions & 0 deletions include/mgba-util/audio-resampler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Copyright (c) 2013-2024 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef M_AUDIO_RESAMPLER_H
#define M_AUDIO_RESAMPLER_H

#include <mgba-util/common.h>

CXX_GUARD_START

#include <mgba-util/interpolator.h>

struct mAudioBuffer;
struct mAudioResampler {
struct mAudioBuffer* source;
struct mAudioBuffer* destination;
double sourceRate;
double destRate;
double timestamp;
double lowWaterMark;
double highWaterMark;
enum mInterpolatorType interpType;
union {
struct mInterpolator interp;
struct mInterpolatorSinc sinc;
struct mInterpolatorCosine cosine;
};
bool consume;
};

void mAudioResamplerInit(struct mAudioResampler*, enum mInterpolatorType);
void mAudioResamplerDeinit(struct mAudioResampler*);
void mAudioResamplerSetSource(struct mAudioResampler*, struct mAudioBuffer* source, double rate, bool consume);
void mAudioResamplerSetDestination(struct mAudioResampler*, struct mAudioBuffer* destination, double rate);
size_t mAudioResamplerProcess(struct mAudioResampler*);

CXX_GUARD_END

#endif

Loading
Loading