Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
398cbac
doesn't seem to be a good change
Arisotura Aug 15, 2025
2abdaaf
crap
Arisotura Aug 15, 2025
af84734
nix: add faad2 dependency, update packages while we're at it
nadiaholmquist Aug 15, 2025
367d05b
ci: vcpkg improvements
nadiaholmquist Aug 16, 2025
3d460cc
Revert "Fix FF_ReadStorage/FF_WriteStorage callback return value (#24…
Arisotura Aug 28, 2025
3e1e8bd
JIT: x64: ensure writable code memory after alloc
RayyanAnsari Aug 28, 2025
435c06e
JIT: add support for PaX MPROTECT on NetBSD
RayyanAnsari Aug 28, 2025
eaa477d
NDS: call JIT.Reset() instead of JIT.ResetBlockCache()
RayyanAnsari Aug 29, 2025
18a4885
JIT: fastmem: handle W^X codemem in fault handler
RayyanAnsari Aug 28, 2025
631080a
JIT: fix building with ENABLE_JIT on OpenBSD targets (#2398)
Izder456 Aug 29, 2025
7ed33b4
fix possible crash in SD/MMC code
Arisotura Aug 30, 2025
4d635e7
fix: GDB stub reading wrong code for vCont packet (#2388)
jonko0493 Sep 3, 2025
7e60fee
Create OpenBSD CI using vm-actions (#2423)
Izder456 Sep 7, 2025
5d36d82
update log2(size) in melonDLDI (it's more than 512 bytes long)
Arisotura Sep 10, 2025
afb0ede
merp
Arisotura Sep 13, 2025
32d6f4a
fix DSi camera reset behavior (CAM_MCNT)
Arisotura Sep 14, 2025
3d6e87d
huh. oops
Arisotura Sep 14, 2025
306fab9
ci: add x86-64 FreeBSD and NetBSD jobs
RayyanAnsari Sep 12, 2025
ad8200e
README: add badge for (Free|Net|Open)BSD workflow
RayyanAnsari Sep 14, 2025
9249068
FIFO: don't drop const qualifier in cast
RayyanAnsari Sep 14, 2025
b7bfb53
Add high-quality resampling using blip-buf to the core (#2412)
nadiaholmquist Sep 18, 2025
f143e89
fix UB in software renderer
Arisotura Sep 29, 2025
91ab680
AR: add fun D4 opcodes
Arisotura Oct 13, 2025
89e70df
qt6: use new way to access the native display/window on X11/Wayland
nadiaholmquist Oct 24, 2025
a189b31
nix: update inputs and add dev shell Qt wrapper workaround
nadiaholmquist Oct 24, 2025
420a1fa
fix the qt version check so it actually works
nadiaholmquist Oct 24, 2025
0b43c3c
DSi: add hack so we can properly adjust main RAM size when loading a …
Arisotura Oct 27, 2025
6f0b07e
Merge remote-tracking branch 'origin/master'
Arisotura Oct 27, 2025
1588f0b
remove unnecessary printfs
Arisotura Oct 27, 2025
8a1ef8e
nix: update inputs
nadiaholmquist Oct 30, 2025
f8c4ab8
AR cheat database import feature (#2479)
Arisotura Nov 6, 2025
220b238
fix Wayland OpenGL glitchiness
Arisotura Nov 6, 2025
241b2b8
fix minor thumb blx immediate bugs (#2450)
Jaklyy Nov 16, 2025
85ae6a3
SRC: Update xxHash to 0.8.3 (#2406)
JordanTheToaster Nov 16, 2025
968bacf
reduce the hardcoded frontend audio buffer size to 512
nadiaholmquist Nov 17, 2025
7a7c6fd
unbreak audio sync
nadiaholmquist Nov 17, 2025
2323659
initialize curFPS to a reasonable value
nadiaholmquist Nov 17, 2025
7777453
Implement tile size scaling for the compute renderer (#2065)
FireNX70 Nov 17, 2025
7f7d99f
SPU: make sure output buffer is properly initialized to a null pointer
nadiaholmquist Nov 17, 2025
2a86ee7
Windows non-MinGW Clang support (#2429)
nadiaholmquist Nov 17, 2025
84f10b8
core: Fix xxhash compile errors when using -Og
RayyanAnsari Nov 17, 2025
7631ab4
frontend: CheatImport: fix duplicate widget name warning
RayyanAnsari Nov 17, 2025
99d2900
temporarily disable JIT on x86_64 macOS
nadiaholmquist Nov 17, 2025
ee6afbf
BAHAHAAAHAHAHAHARKGKGKJDSJD----%~^`!*
Arisotura Nov 17, 2025
f82a7e4
greater delay for stopping NDS mic (PSG_Play.nds being weird)
Arisotura Nov 18, 2025
b86390e
attempt at fixing this shit
Arisotura Nov 18, 2025
1740375
merge release 1.1
SuuperW Nov 28, 2025
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
107 changes: 107 additions & 0 deletions .github/workflows/build-bsd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: BSD

on:
push:
branches:
- master
- ci/*
pull_request:
branches:
- master

env:
MELONDS_GIT_BRANCH: ${{ github.ref }}
MELONDS_GIT_HASH: ${{ github.sha }}
MELONDS_BUILD_PROVIDER: GitHub Actions

jobs:
build:
strategy:
matrix:
os: [freebsd, netbsd, openbsd]
# The emulated aarch64 VMs are quite slow, so disable aarch64
# runs for now.
arch: [x86_64] #, aarch64]
include:
- os: freebsd
os_name: FreeBSD
# CMake's autorcc for Qt tries to lock files, so we need to
# start lockd for NFS, otherwise the build will fail.
prepare_vm: service lockd onestart
install_deps: >
pkg install -y cmake kf6-extra-cmake-modules pkgconf ninja
qt6-base qt6-multimedia qt6-svg sdl2 libarchive zstd enet
faad2

- os: netbsd
os_name: NetBSD
# The NetBSD VM image does not come with X sets by default,
# so download and unpack the sets we need manually.
# See https://github.com/vmactions/netbsd-vm/issues/2
# Also, for some reason pkg_add is not in $PATH, so we have
# to call it using its absolute location.
prepare_vm: |
/usr/sbin/pkg_add pkgin curl
mach=$(uname -m | sed "s/evbarm/evbarm-$(uname -p)/")
for set in xbase xcomp; do
curl -sL ${PKG_PATH%%/pkgsrc*}/NetBSD/NetBSD-$(uname -r
)/$mach/binary/sets/$set.tar.xz | tar xJpf - -C /
done
install_deps: >
pkgin -y install cmake extra-cmake-modules pkgconf
ninja-build qt6-qtbase qt6-qtmultimedia qt6-qtsvg SDL2
libarchive zstd enet faad2

- os: openbsd
os_name: OpenBSD
install_deps: >
pkg_add -v cmake kf6-extra-cmake-modules pkgconf ninja
qt6-qtbase qt6-qtmultimedia qt6-qtsvg sdl2 libarchive zstd
enet faad


name: ${{ matrix.os_name }} / ${{ matrix.arch }}
runs-on: ubuntu-latest
defaults:
run:
shell: ${{ matrix.os }} {0}

steps:
- uses: actions/checkout@v4
name: Check out sources

- name: Start ${{ matrix.os_name }} VM
uses: jenseng/dynamic-uses@v1
with:
uses: vmactions/${{ matrix.os }}-vm@v1
# As we are using multiple steps, we need to use NFS to sync the
# workspace between host and VM, as with the default, rsync, the
# workspace is only synced before and after the setup VM step.
with: >
{
"arch": ${{ matrix.arch }},
"envs": "MELONDS_GIT_BRANCH MELONDS_GIT_HASH
MELONDS_BUILD_PROVIDER",
"prepare": ${{ toJSON(matrix.prepare_vm) }},
"sync": "nfs",
"usesh": "true",
}

- name: Install dependencies
run: ${{ matrix.install_deps }}

- name: Configure
run: |
cd $GITHUB_WORKSPACE
cmake -B build -G Ninja -DMELONDS_EMBED_BUILD_INFO=ON

- name: Build
run: |
cd $GITHUB_WORKSPACE
cmake --build build

- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: melonDS-${{ matrix.os }}-${{ matrix.arch }}
path: build/melonDS
18 changes: 16 additions & 2 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- master

env:
VCPKG_COMMIT: 2ad004460f5db4d3b66f62f5799ff66c265c4b5d
MELONDS_GIT_BRANCH: ${{ github.ref }}
MELONDS_GIT_HASH: ${{ github.sha }}
MELONDS_BUILD_PROVIDER: GitHub Actions
Expand All @@ -24,6 +23,10 @@ jobs:

name: ${{ matrix.arch }}
runs-on: macos-14

env:
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite

steps:
- name: Check out sources
uses: actions/checkout@v3
Expand All @@ -32,10 +35,16 @@ jobs:
brew install autoconf automake autoconf-archive libtool python-setuptools
- name: Set up CMake
uses: lukka/get-cmake@latest
- name: Restore vcpkg cache
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-${{ matrix.arch }}-osx-${{ hashFiles('vcpkg.json') }}
restore-keys: vcpkg-${{ matrix.arch }}-osx-
- name: Set up vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
vcpkgJsonGlob: vcpkg.json
- name: Build
uses: lukka/run-cmake@v10
with:
Expand All @@ -53,6 +62,11 @@ jobs:
name: macOS-${{ matrix.arch }}
path: macOS-${{ matrix.arch }}.zip
retention-days: 1
- name: Save vcpkg cache
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-${{ matrix.arch }}-osx-${{ hashFiles('vcpkg.json') }}

universal-binary:
name: Universal binary
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ on:
- master

env:
VCPKG_COMMIT: 2ad004460f5db4d3b66f62f5799ff66c265c4b5d
MELONDS_GIT_BRANCH: ${{ github.ref }}
MELONDS_GIT_HASH: ${{ github.sha }}
MELONDS_BUILD_PROVIDER: GitHub Actions
# MELONDS_VERSION_SUFFIX: " RC"

jobs:
build:
runs-on: windows-latest
runs-on: windows-2025
defaults:
run:
shell: msys2 {0}
env:
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
steps:
- name: Check out sources
uses: actions/checkout@v3
Expand All @@ -31,10 +32,16 @@ jobs:
msystem: ucrt64
update: true
pacboy: gcc:p cmake:p ninja:p make:p
- name: Restore vcpkg cache
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-x86_64-mingw-${{ hashFiles('vcpkg.json') }}
restore-keys: vcpkg-x86_64-mingw-
- name: Set up vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
vcpkgJsonGlob: vcpkg.json
- name: Configure
run: cmake --preset=release-mingw-x86_64 -DMELONDS_EMBED_BUILD_INFO=ON
- name: Build
Expand All @@ -43,3 +50,8 @@ jobs:
with:
name: melonDS-windows-x86_64
path: .\build\release-mingw-x86_64\melonDS.exe
- name: Save vcpkg cache
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-x86_64-mingw-${{ hashFiles('vcpkg.json') }}
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (USE_VCPKG)
endif()

project(melonDS
VERSION 1.0
VERSION 1.1
DESCRIPTION "DS emulator, sorta"
HOMEPAGE_URL "https://melonds.kuribo64.net"
LANGUAGES C CXX)
Expand Down Expand Up @@ -63,7 +63,7 @@ detect_architecture("__arm__" ARM)
detect_architecture("__aarch64__" ARM64)

cmake_dependent_option(ENABLE_JIT "Enable JIT recompiler" ON
"ARCHITECTURE STREQUAL x86_64 OR ARCHITECTURE STREQUAL ARM64" OFF)
"ARCHITECTURE STREQUAL x86_64 OR ARCHITECTURE STREQUAL ARM64;NOT ARCHITECTURE STREQUAL x86_64 OR NOT APPLE" OFF)
cmake_dependent_option(ENABLE_JIT_PROFILING "Enable JIT profiling with VTune" OFF "ENABLE_JIT" OFF)
option(ENABLE_OGLRENDERER "Enable OpenGL renderer" ON)

Expand All @@ -85,10 +85,15 @@ endif()

if (WIN32)
option(BUILD_STATIC "Statically link dependencies" OFF)
endif()

if (BUILD_STATIC AND WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
add_definitions(-DWIN32_LEAN_AND_MEAN -DNOMINMAX)
if (NOT MINGW)
add_definitions(-D__WIN32__ -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES)
if (BUILD_STATIC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
elseif (BUILD_STATIC AND MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
endif()
endif()

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<h2 align="center"><b>melonDS</b></h2>
<p align="center">
<a href="http://melonds.kuribo64.net/" alt="melonDS website"><img src="https://img.shields.io/badge/website-melonds.kuribo64.net-%2331352e.svg"></a>
<a href="http://melonds.kuribo64.net/downloads.php" alt="Release: 1.0"><img src="https://img.shields.io/badge/release-1.0-%235c913b.svg"></a>
<a href="http://melonds.kuribo64.net/downloads.php" alt="Release: 1.1"><img src="https://img.shields.io/badge/release-1.1-%235c913b.svg"></a>
<a href="https://www.gnu.org/licenses/gpl-3.0" alt="License: GPLv3"><img src="https://img.shields.io/badge/License-GPL%20v3-%23ff554d.svg"></a>
<a href="https://kiwiirc.com/client/irc.badnik.net/?nick=IRC-Source_?#melonds" alt="IRC channel: #melonds"><img src="https://img.shields.io/badge/IRC%20chat-%23melonds-%23dd2e44.svg"></a>
<a href="https://discord.gg/pAMAtExcqV" alt="Discord"><img src="https://img.shields.io/badge/Discord-Kuribo64-7289da?logo=discord&logoColor=white"></a>
<br>
<a href="https://github.com/melonDS-emu/melonDS/actions/workflows/build-windows.yml?query=event%3Apush"><img src="https://github.com/melonDS-emu/melonDS/actions/workflows/build-windows.yml/badge.svg" /></a>
<a href="https://github.com/melonDS-emu/melonDS/actions/workflows/build-ubuntu.yml?query=event%3Apush"><img src="https://github.com/melonDS-emu/melonDS/actions/workflows/build-ubuntu.yml/badge.svg" /></a>
<a href="https://github.com/melonDS-emu/melonDS/actions/workflows/build-macos.yml?query=event%3Apush"><img src="https://github.com/melonDS-emu/melonDS/actions/workflows/build-macos.yml/badge.svg" /></a>
<a href="https://github.com/melonDS-emu/melonDS/actions/workflows/build-bsd.yml?query=event%3Apush"><img src="https://github.com/melonDS-emu/melonDS/actions/workflows/build-bsd.yml/badge.svg" /></a>
</p>
DS emulator, sorta

Expand Down
39 changes: 33 additions & 6 deletions cmake/ConfigureVcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ if (VCPKG_ROOT STREQUAL "${_DEFAULT_VCPKG_ROOT}")
endif()
FetchContent_Declare(vcpkg
GIT_REPOSITORY "https://github.com/Microsoft/vcpkg.git"
GIT_TAG 2ad004460f5db4d3b66f62f5799ff66c265c4b5d
GIT_TAG HEAD
EXCLUDE_FROM_ALL
SOURCE_DIR "${CMAKE_SOURCE_DIR}/vcpkg")
FetchContent_MakeAvailable(vcpkg)
endif()

set(VCPKG_OVERLAY_TRIPLETS "${CMAKE_SOURCE_DIR}/cmake/overlay-triplets")
set(VCPKG_OVERLAY_PORTS "${CMAKE_SOURCE_DIR}/cmake/overlay-ports/faad2")

option(USE_RECOMMENDED_TRIPLETS "Use the recommended triplets that are used for official builds" ON)

# Required for Windows non-MinGW debug builds, optional for all other platforms
if (WIN32)
if (DEFINED ENV{MINGW_PREFIX})
option(ENABLE_DEBUG_DEPS "Enable debug builds of vcpkg dependencies" OFF)
else()
option(ENABLE_DEBUG_DEPS "Enable debug builds of vcpkg dependencies" ON)
endif()
endif()

# Duplicated here because it needs to be set before project()
option(USE_QT6 "Use Qt 6 instead of Qt 5" ON)

Expand Down Expand Up @@ -62,9 +68,30 @@ if (USE_RECOMMENDED_TRIPLETS)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
endif()
elseif(WIN32)
# TODO Windows arm64 if possible
set(_CAN_TARGET_AS_HOST ON)
set(_WANTED_TRIPLET x64-mingw-static-release)
if (ENABLE_DEBUG_DEPS)
set(_RELEASE_SUFFIX "")
else()
set(_RELEASE_SUFFIX "-release")
endif()

if (DEFINED ENV{MINGW_PREFIX})
set(_WIN32_ENV mingw)
else()
set(_WIN32_ENV windows)
endif()

if ("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "AMD64")
set(_WIN32_ARCH x64)
elseif ("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "ARM64")
set(_WIN32_ARCH arm64)
elseif ("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
set(_WIN32_ARCH x86)
else()
message(FATAL_ERROR "Unknown processor architecture '$ENV{PROCESSOR_ARCHITECTURE}'. Please disable USE_RECOMMENDED_TRIPLETS and set your vcpkg settings manually.")
endif()

set(_WANTED_TRIPLET ${_WIN32_ARCH}-${_WIN32_ENV}-static${_RELEASE_SUFFIX})
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL Linux)
# Can't really detect cross compiling here.
set(_CAN_TARGET_AS_HOST ON)
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
libGL
libslirp
enet
faad2
]) ++ optionals (!isDarwin) (with pkgs; [
kdePackages.extra-cmake-modules
qt6.qtwayland
Expand Down Expand Up @@ -79,6 +80,12 @@
packages = with pkgs; [
qt6.qttools
];

# https://discourse.nixos.org/t/how-to-create-a-qt-devshell/58529/5
shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APPEND_LIBRARY_PATH"
eval $(echo "''${qtWrapperArgs[@]}"|perl -n -e '$_ =~ s/--prefix (\w+) : ([\w-.\/]+)/export ''${1}="''${2}:\''${''${1}}";/g;print')
'';
};

# Shell for building static melonDS release builds with vcpkg
Expand Down
2 changes: 1 addition & 1 deletion melonDLDI/melonDLDI.s
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _start:
.word 0xBF8DA5ED
.string " Chishm"
.byte 1
.byte 9 @ size
.byte 10 @ size
.byte 0
.byte 0
.string "melonDS DLDI driver"
Expand Down
2 changes: 2 additions & 0 deletions res/melon.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ FILETYPE VFT_APP
}
}

#if (0${MINGW})
1 24 "xp.manifest"
#endif
Loading