Skip to content

Commit

Permalink
Merge pull request #290 from warmenhoven/warmenhoven/pr/rebase
Browse files Browse the repository at this point in the history
Update to 0.11-dev (bba2c13)
  • Loading branch information
LibretroAdmin committed Feb 28, 2024
2 parents 314bf7b + f9b3fff commit b256448
Show file tree
Hide file tree
Showing 718 changed files with 59,153 additions and 15,033 deletions.
9 changes: 8 additions & 1 deletion .gitignore
@@ -1,12 +1,15 @@
# Generic files
*.user*
*~
*.swp
*.pyc

# Build directories
/build
/build-*
/.vs

# Build files
*.a
*.dylib
*.dll
Expand All @@ -18,5 +21,9 @@ CMakeCache.txt
CMakeFiles
CMakeSettings.json
cmake_install.cmake
hle-bios.bin
version.c
*.d

# Runtime generated cruft
*.sav
*.ss0
91 changes: 91 additions & 0 deletions CHANGES
@@ -1,12 +1,103 @@
0.11.0: (Future)
Features:
- 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 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 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
- 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
- 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)
- Qt: Remove maligned double-click-to-fullscreen shortcut (closes mgba.io/i/2632)
- Qt: Pass logging context through to video proxy thread (fixes mgba.io/i/3095)
- Scripting: Add `callbacks:oneshot` for single-call callbacks
- Switch: Add bilinear filtering option (closes mgba.io/i/3111)
- Vita: Add imc0 and xmc0 mount point support

0.10.3: (2024-01-07)
Emulation fixes:
- ARM: Remove obsolete force-alignment in `bx pc` (fixes mgba.io/i/2964)
- ARM: Fake bpkt instruction should take no cycles (fixes mgba.io/i/2551)
- GB Audio: Fix channels 1/2 staying muted if restarted after long silence
- GB Audio: Fix channel 1 restarting if sweep applies after stop (fixes mgba.io/i/2965)
- GB Audio: Fix restarting envelope when writing to register (fixes mgba.io/i/3067)
- GB Audio: Improve "zombie mode" emulation in CGB mode (fixes mgba.io/i/2029)
- GB I/O: Read back proper SVBK value after writing 0 (fixes mgba.io/i/2921)
- GB SIO: Disabling SIO should cancel pending transfers (fixes mgba.io/i/2537)
- GBA Audio: Fix sample timing drifting when changing sample interval
- GBA Audio: Fix initial channel 3 wave RAM (fixes mgba.io/i/2947)
- GBA Audio: Fix sample position issues when rate changes (fixes mgba.io/i/3006)
- GBA GPIO: Fix tilt scale and orientation (fixes mgba.io/i/2703)
- GBA BIOS: Fix clobbering registers with word-sized CpuSet
- GBA SIO: Fix normal mode SI/SO semantics (fixes mgba.io/i/2925)
Other fixes:
- GB: Fix applying a patch that changes the cartridge mapper (fixes mgba.io/i/3077)
- GBA Savedata: Fix crash when resizing flash save games for RTC data
- mGUI: Fix cases where an older save state screenshot would be shown (fixes mgba.io/i/2183)
- Qt: Re-enable sync for multiplayer windows that aren't connected (fixes mgba.io/i/2974)
- Qt: Fix mute settings not being loaded on setting screen (fixes mgba.io/i/2990)
- Qt: Fix screen freezing on macOS after closing save state window (fixes mgba.io/i/2885)
- Vita: Fix camera setting not appearing (fixes mgba.io/i/3012)
Misc:
- mGUI: Persist fast forwarding after closing menu (fixes mgba.io/i/2414)
- Qt: Add exporting of SAV + RTC saves from Save Converter to strip RTC data
- VFS: Use anonymousMemoryMap for large 7z allocations (fixes mgba.io/i/3013)

0.10.2: (2023-04-23)
Emulation fixes:
- GBA Audio: Fix improperly deserializing GB audio registers (fixes mgba.io/i/2793)
- GBA Audio: Clear GB audio state when disabled
- GBA Memory: Make VRAM access stalls only apply to BG RAM
- GBA Overrides: Fix saving in PMD:RRT (JP) (fixes mgba.io/i/2862)
- GBA SIO: Fix SIOCNT SI pin value after attaching player 2 (fixes mgba.io/i/2805)
- GBA SIO: Fix unconnected normal mode SIOCNT SI bit (fixes mgba.io/i/2810)
- GBA SIO: Normal mode transfers with no clock should not finish (fixes mgba.io/i/2811)
- GBA Timers: Cascading timers don't tick when disabled (fixes mgba.io/i/2812)
- GBA Video: Fix interpolation issues with OpenGL renderer
Other fixes:
- Core: Allow sending thread requests to a crashed core (fixes mgba.io/i/2784)
- FFmpeg: Force lower sample rate for codecs not supporting high rates (fixes mgba.io/i/2869)
- Qt: Fix crash when attempting to use OpenGL 2.1 to 3.1 (fixes mgba.io/i/2794)
- Qt: Disable sync while running scripts from main thread (fixes mgba.io/i/2738)
- Qt: Properly cap number of attached players by platform (fixes mgba.io/i/2807)
- Qt: Disable attempted linking betwen incompatible platforms (fixes mgba.io/i/2702)
- Qt: Fix modifier key names in shortcut editor (fixes mgba.io/i/2817)
- Qt: Fix a handful of edge cases with graphics viewers (fixes mgba.io/i/2827)
- Qt: Fix full-buffer rewind
- Qt: Fix crash if loading a shader fails
- Qt: Fix black screen when starting with a game (fixes mgba.io/i/2781)
- Qt: Fix OSD on modern macOS (fixes mgba.io/i/2736)
- Qt: Fix checked state of mute menu option at load (fixes mgba.io/i/2701)
- Qt: Remove OpenGL proxy thread and override SwapInterval directly instead
- Scripting: Fix receiving packets for client sockets
- Scripting: Fix empty receive calls returning unknown error on Windows
- Scripting: Return proper callback ID from socket.add
- Vita: Work around broken mktime implementation in Vita SDK (fixes mgba.io/i/2876)
Misc:
- Qt: Include wayland QPA in AppImage (fixes mgba.io/i/2796)
- Qt: Stop eating boolean action key events (fixes mgba.io/i/2636)
- Qt: Automatically change video file extension as appropriate
- Qt: Swap P1 and other player's save if P1 loaded it first (closes mgba.io/i/2750)

0.10.1: (2023-01-10)
Emulation fixes:
Expand Down
62 changes: 54 additions & 8 deletions CMakeLists.txt
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.3)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/src/platform/cmake/")

if(POLICY CMP0025)
Expand Down Expand Up @@ -34,8 +34,12 @@ if(NOT MSVC)
# mingw32 likes to complain about using the "wrong" format strings despite them actually working
set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-format")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=implicit-function-declaration -Werror=implicit-int")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=implicit-function-declaration -Werror=implicit-int -fwrapv")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
# 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")
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-")
Expand All @@ -55,6 +59,7 @@ if(NOT LIBMGBA_ONLY)
set(USE_SQLITE3 ON CACHE BOOL "Whether or not to enable SQLite3 support")
set(USE_ELF ON CACHE BOOL "Whether or not to enable ELF support")
set(USE_LUA ON CACHE BOOL "Whether or not to enable Lua scripting support")
set(USE_JSON_C ON CACHE BOOL "Whether or not to enable JSON-C support")
set(M_CORE_GBA ON CACHE BOOL "Build Game Boy Advance core")
set(M_CORE_GB ON CACHE BOOL "Build Game Boy core")
set(USE_LZMA ON CACHE BOOL "Whether or not to enable 7-Zip support")
Expand All @@ -80,6 +85,7 @@ if(NOT LIBMGBA_ONLY)
set(BUILD_GLES2 ON CACHE BOOL "Build with OpenGL|ES 2")
set(BUILD_GLES3 ON CACHE BOOL "Build with OpenGL|ES 3")
set(BUILD_DOCGEN OFF CACHE BOOL "Build the scripting API documentation generator")
set(BUILD_MAINTAINER_TOOLS OFF CACHE BOOL "Build tools only useful for maintainers")
set(USE_EPOXY ON CACHE STRING "Build with libepoxy")
set(DISABLE_DEPS OFF CACHE BOOL "Build without dependencies")
set(DISTBUILD OFF CACHE BOOL "Build distribution packages")
Expand All @@ -88,6 +94,7 @@ if(NOT LIBMGBA_ONLY)
mark_as_advanced(WIN32_UNIX_PATHS)
endif()
mark_as_advanced(BUILD_DOCGEN)
mark_as_advanced(BUILD_MAINTAINER_TOOLS)
else()
set(DISABLE_FRONTENDS ON)
set(DISABLE_DEPS ON)
Expand Down Expand Up @@ -175,7 +182,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/core/version.c.in ${CMAKE_CURRENT
source_group("Generated sources" FILES ${CMAKE_CURRENT_BINARY_DIR}/version.c)

# Advanced settings
if(NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_COMPILER_VERSION VERSION_LESS "4.5"))
if(NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.5"))
set(DEFAULT_LTO ON)
else()
set(DEFAULT_LTO OFF)
Expand Down Expand Up @@ -337,6 +344,8 @@ find_function(popcount32)
find_function(futimens)
find_function(futimes)

find_function(realpath)

if(ANDROID AND ANDROID_NDK_MAJOR GREATER 13)
find_function(localtime_r)
set(HAVE_STRTOF_L ON)
Expand Down Expand Up @@ -419,6 +428,13 @@ if(BUILD_GL)
elseif(UNIX AND NOT APPLE AND TARGET OpenGL::GL)
set(OPENGL_LIBRARY OpenGL::GL)
endif()
if(OpenGL_GLX_FOUND)
list(APPEND FEATURES GLX)
endif()
if(OpenGL_EGL_FOUND)
list(APPEND FEATURES EGL)
list(APPEND OPENGL_LIBRARY ${OPENGL_egl_LIBRARY})
endif()
endif()
if(BUILD_GL)
list(APPEND FEATURE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/opengl/gl.c)
Expand Down Expand Up @@ -477,6 +493,7 @@ endif()
if(DISABLE_DEPS)
set(USE_GDB_STUB OFF)
set(USE_DISCORD_RPC OFF)
set(USE_JSON_C OFF)
set(USE_SQLITE3 OFF)
set(USE_PNG OFF)
set(USE_ZLIB OFF)
Expand Down Expand Up @@ -522,14 +539,12 @@ if(USE_EDITLINE)
set(DEBUGGER_LIB ${LIBEDIT_LIBRARIES})
endif()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libedit2")
list(APPEND FEATURE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/feature/editline/cli-el-backend.c")
else()
set(DEBUGGER_LIB "")
endif()

if(USE_GDB_STUB)
list(APPEND FEATURES GDB_STUB)
list(APPEND FEATURE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/debugger/gdb-stub.c)
endif()
source_group("Debugger" FILES ${DEBUGGER_SRC})

Expand Down Expand Up @@ -765,11 +780,36 @@ endif()

if(ENABLE_SCRIPTING)
list(APPEND ENABLES SCRIPTING)
find_feature(USE_JSON_C "json-c")
if(NOT USE_LUA VERSION_LESS 5.1)
find_feature(USE_LUA "Lua" ${USE_LUA})
else()
find_feature(USE_LUA "Lua")
endif()
if(USE_JSON_C)
list(APPEND FEATURES JSON_C)
if(TARGET json-c::json-c)
list(APPEND DEPENDENCY_LIB json-c::json-c)
get_target_property(JSON_C_SONAME json-c::json-c IMPORTED_SONAME_NONE)
string(SUBSTRING "${JSON_C_SONAME}" 13 -1 JSON_C_SOVER)

# This is only needed on 0.15, but the target unhelpfully does not contain version info
get_target_property(JSON_C_INCLUDE_DIR json-c::json-c INTERFACE_INCLUDE_DIRECTORIES)
if(NOT JSON_C_INCLUDE_DIR MATCHES json-c$)
include_directories(AFTER "${JSON_C_INCLUDE_DIR}/json-c")
endif()
else()
if(${json-c_VERSION} VERSION_LESS 0.13.0)
set(JSON_C_SOVER 3)
elseif(${json-c_VERSION} VERSION_LESS 0.15.0)
set(JSON_C_SOVER 4)
endif()
list(APPEND DEPENDENCY_LIB ${json-c_LIBRARIES})
include_directories(AFTER ${json-c_INCLUDE_DIRS})
link_directories(${json-c_LIBDIRS})
endif()
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libjson-c${JSON_C_SOVER}")
endif()
if(USE_LUA)
list(APPEND FEATURE_DEFINES USE_LUA)
include_directories(AFTER ${LUA_INCLUDE_DIR})
Expand Down Expand Up @@ -989,7 +1029,7 @@ if(BUILD_UPDATER)
add_executable(updater-stub WIN32 ${CORE_VFS_SRC} ${VFS_SRC} ${OS_SRC} ${UTIL_BASE_SRC} ${THIRD_PARTY_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/src/core/config.c
${CMAKE_CURRENT_SOURCE_DIR}/src/feature/updater.c
${CMAKE_CURRENT_SOURCE_DIR}/src/feature/updater-main.c)
${CMAKE_CURRENT_SOURCE_DIR}/src/tools/updater-main.c)
target_link_libraries(updater-stub ${ZLIB_LIBRARY} ${ZLIB_LIBRARY} ${ZIP_LIBRARIES} ${OS_LIB} ${PLATFORM_LIBRARY})
set_target_properties(updater-stub PROPERTIES COMPILE_DEFINITIONS "${OS_DEFINES};${FUNCTION_DEFINES};${FEATURE_DEFINES};BUILD_STATIC")
if(MSVC)
Expand All @@ -1001,10 +1041,15 @@ if(BUILD_UPDATER)
endif()

if(ENABLE_SCRIPTING AND BUILD_DOCGEN)
add_executable(docgen ${CMAKE_CURRENT_SOURCE_DIR}/src/script/docgen.c)
add_executable(docgen ${CMAKE_CURRENT_SOURCE_DIR}/src/tools/docgen.c)
target_link_libraries(docgen ${OS_LIB} ${PLATFORM_LIBRARY} ${BINARY_NAME})
endif()

if(BUILD_MAINTAINER_TOOLS)
add_executable(font-sdf-tool ${CMAKE_CURRENT_SOURCE_DIR}/src/tools/font-sdf.c ${CMAKE_CURRENT_SOURCE_DIR}/src/util/gui/font-metrics.c)
target_link_libraries(font-sdf-tool ${OS_LIB} ${PLATFORM_LIBRARY} ${BINARY_NAME})
endif()

if(BUILD_SDL)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/sdl ${CMAKE_CURRENT_BINARY_DIR}/sdl)
endif()
Expand Down Expand Up @@ -1289,6 +1334,7 @@ if(NOT QUIET AND NOT LIBMGBA_ONLY)
else()
message(STATUS " Lua: ${USE_LUA}")
endif()
message(STATUS " storage API: ${USE_JSON_C}")
endif()
message(STATUS "Frontends:")
message(STATUS " Qt: ${BUILD_QT}")
Expand Down
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -125,9 +125,9 @@ Compiling requires using CMake 3.1 or newer. GCC, Clang, and Visual Studio 2019

#### Docker building

The recommended way to build for most platforms is to use Docker. Several Docker images are provided that contain the requisite toolchain and dependencies for building mGBA across several platforms.
The recommended way to build for most platforms is to use Docker. Several Docker images are provided that contain the requisite toolchain and dependencies for building mGBA across several platforms.

Note: If you are on an older Windows system before Windows 10, you may need to configure your Docker to use VirtualBox shared folders to correctly map your current `mgba` checkout directory to the Docker image's working directory. (See issue [#1985](https://mgba.io/i/1985) for details.)
Note: If you are on an older Windows system before Windows 10, you may need to configure your Docker to use VirtualBox shared folders to correctly map your current `mgba` checkout directory to the Docker image's working directory. (See issue [#1985](https://mgba.io/i/1985) for details.)

To use a Docker image to build mGBA, simply run the following command while in the root of an mGBA checkout:

Expand Down Expand Up @@ -234,6 +234,7 @@ mGBA has no hard dependencies, however, the following optional dependencies are
- SQLite3: for game databases.
- libelf: for ELF loading.
- Lua: for scripting.
- json-c: for the scripting `storage` API.

SQLite3, libpng, and zlib are included with the emulator, so they do not need to be externally compiled first.

Expand All @@ -254,7 +255,7 @@ Footnotes
Copyright
---------

mGBA is Copyright © 2013 – 2022 Jeffrey Pfau. It is distributed under the [Mozilla Public License version 2.0](https://www.mozilla.org/MPL/2.0/). A copy of the license is available in the distributed LICENSE file.
mGBA is Copyright © 2013 – 2023 Jeffrey Pfau. It is distributed under the [Mozilla Public License version 2.0](https://www.mozilla.org/MPL/2.0/). A copy of the license is available in the distributed LICENSE file.

mGBA contains the following third-party libraries:

Expand Down
Binary file added cinema/gb/acid/cgb-acid2/baseline_0000.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cinema/gb/acid/cgb-acid2/test.gbc
Binary file not shown.
6 changes: 6 additions & 0 deletions cinema/gb/acid/config.ini
@@ -0,0 +1,6 @@
[testinfo]
skip=15
frames=1

[ports.cinema]
sgb.borders=0
Binary file added cinema/gb/acid/dmg-acid2/baseline_0000.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cinema/gb/acid/dmg-acid2/test.gb
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified cinema/gb/mooneye-gb/misc/boot_div-cgb0/xbaseline_0000.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
44 changes: 44 additions & 0 deletions cinema/gb/samesuite/apu/channel_1/align/test.sym
@@ -0,0 +1,44 @@
; File generated by rgblink
00:00ff reboot
00:0100 Start
00:0150 LCDOff
00:0157 LCDOff.LCDOffLoop
00:0163 LCDOff.ret
00:0165 LCDOn
00:016e LoadFont
00:0176 LoadFont.loop
00:017c LoadFont.loop2
00:0185 LoadFont.loop3
00:0192 LoadFont.loop4
00:01a1 HexDigits
00:03a1 Palette
00:03b1 LoadObjPalettes
00:03b5 LoadBGPalettes
00:03b7 LoadPalettes
00:03bc LoadPalettes.loop
00:03c2 CommonInit
00:03d0 CommonInit.clearLogoTilemap
00:03e9 ModemSleep
00:0401 ModemCh1Freqs
00:0411 ModemCh2Freqs
00:0421 ModemCh3Freqs
00:0431 ModemSendByte
00:0485 ModemStart
00:04bf ModemStop
00:04c3 ModemSendBuffer
00:04cb _Start
00:04e7 _Start.loop_u16400
00:0502 _Start.failed
00:0509 _Start.sendSerial
00:0521 _Start.loop_u16401
00:052a PrintResults
00:0533 PrintResults.yLoop
00:0557 PrintResults.xLoop
00:0569 PrintResults.correct
00:057d PrintResults.correct2
00:059e SerialSendByte
00:05a4 SerialSendByte.loop
00:05ab CorrectResults
00:05db RunTest
00:0b92 StoreResult
01:4000 NopSlide
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions cinema/gb/samesuite/apu/channel_1/align_cpu/config.ini
@@ -0,0 +1,2 @@
[testinfo]
fail=1
Binary file not shown.

0 comments on commit b256448

Please sign in to comment.