Skip to content

Commit

Permalink
Merge branch 'master' into DeviceEmulation-XboxControllerS
Browse files Browse the repository at this point in the history
  • Loading branch information
faha223 authored Dec 31, 2024
2 parents 8356922 + 8f478e0 commit 0337806
Show file tree
Hide file tree
Showing 138 changed files with 26,571 additions and 10,407 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ IndentWidth: 4
AccessModifierOffset: -4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
MacroBlockEnd: '.*_END$'
#MacroBlockBegin: '.*_BEGIN$' # only PREC_BEGIN ?
#MacroBlockEnd: '.*_END$'
MaxEmptyLinesToKeep: 2
#PenaltyBreakBeforeFirstCallParameter: 19
#PenaltyBreakComment: 300
Expand Down
56 changes: 43 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: sudo apt-get install meson
# On push to master, increment patch version and create a new tag on release
- name: Increment patch version
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down Expand Up @@ -54,20 +56,30 @@ jobs:
path: src.tar.gz

Windows:
name: Build for Windows (${{ matrix.configuration }}) on Ubuntu
name: Build for Windows (${{ matrix.arch }}, ${{ matrix.configuration }}) on Ubuntu
runs-on: ubuntu-latest
needs: Init
strategy:
matrix:
include:
- configuration: Debug
build_param: --debug
artifact_name: xemu-win-debug
artifact_name: xemu-win-x86_64-debug
arch: x86_64
- configuration: Release
build_param:
artifact_name: xemu-win-x86_64-release
arch: x86_64
- configuration: Debug
build_param: --debug
artifact_name: xemu-win-aarch64-debug
arch: aarch64
- configuration: Release
build_param:
artifact_name: xemu-win-release
artifact_name: xemu-win-aarch64-release
arch: aarch64
env:
DOCKER_IMAGE_NAME: ghcr.io/xemu-project/xemu-win64-toolchain:sha-8152913
DOCKER_IMAGE_NAME: ghcr.io/xemu-project/xemu-win64-toolchain:sha-b6d29d4

steps:
- name: Download source package
Expand All @@ -93,6 +105,8 @@ jobs:
-v /tmp/xemu-ccache:/tmp/xemu-ccache \
-e CCACHE_DIR=/tmp/xemu-ccache \
-e CCACHE_MAXSIZE=512M \
-e CROSSPREFIX=${{ matrix.arch }}-w64-mingw32.static- \
-e CROSSAR=${{ matrix.arch }}-w64-mingw32.static-ar \
-u $(id -u):$(id -g) \
$DOCKER_IMAGE_NAME \
bash -c "ccache -z; ./build.sh -p win64-cross ${{ matrix.build_param }} && ccache -s"
Expand All @@ -106,16 +120,24 @@ jobs:
# DWARF and update + strip the executable. Re-package the original release
# and create symbols package.
WindowsPdb:
name: Generate PDB for Windows (${{ matrix.configuration }})
name: Generate PDB for Windows (${{ matrix.arch }}, ${{ matrix.configuration }})
runs-on: windows-latest
needs: Windows
strategy:
matrix:
include:
- configuration: Debug
artifact_name: xemu-win-debug
artifact_name: xemu-win-x86_64-debug
arch: x86_64
- configuration: Release
artifact_name: xemu-win-x86_64-release
arch: x86_64
- configuration: Debug
artifact_name: xemu-win-aarch64-debug
arch: aarch64
- configuration: Release
artifact_name: xemu-win-release
artifact_name: xemu-win-aarch64-release
arch: aarch64
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
Expand All @@ -125,9 +147,12 @@ jobs:
- name: Generate PDB
run: |
Invoke-WebRequest -Uri "https://github.com/rainers/cv2pdb/releases/download/v0.52/cv2pdb-0.52.zip" -OutFile "cv2pdb.zip"
Invoke-WebRequest -Uri "https://github.com/mstorsjo/llvm-mingw/releases/download/20241217/llvm-mingw-20241217-ucrt-x86_64.zip" -OutFile "llvm-mingw.zip"
7z x -ocv2pdb -y cv2pdb.zip
7z x -y llvm-mingw.zip
cd ${{ matrix.artifact_name }}
../cv2pdb/cv2pdb64.exe xemu.exe
../llvm-mingw-20241217-ucrt-x86_64/bin/${{ matrix.arch }}-w64-mingw32-strip.exe xemu.exe
mkdir ../dist
7z a -tzip ../dist/${{ matrix.artifact_name }}.zip * "-xr!*.pdb"
7z a -tzip ../dist/${{ matrix.artifact_name }}-pdb.zip "-ir!*.pdb"
Expand Down Expand Up @@ -350,7 +375,7 @@ jobs:
Release:
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
needs: [Ubuntu, macOSUniversal, WindowsPdb]
needs: [Ubuntu, macOSUniversal, Windows, WindowsPdb]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
Expand All @@ -370,6 +395,10 @@ jobs:
pushd dist/xemu-ubuntu-debug
tar xvf xemu-ubuntu-debug.tgz
popd
# Architecture tags were recently added to the Windows release path. Provide an alias with the former name for a while.
- name: Add transitionary package alias
run: |
cp dist/xemu-win-x86_64-release-pdb/xemu-win-x86_64-release.zip dist/xemu-win-x86_64-release-pdb/xemu-win-release.zip
- name: Publish release
uses: softprops/action-gh-release@v1
with:
Expand All @@ -379,10 +408,11 @@ jobs:
draft: false
files: |
dist/src.tar.gz/src.tar.gz
dist/xemu-win-debug-pdb/xemu-win-debug.zip
dist/xemu-win-debug-pdb/xemu-win-debug-pdb.zip
dist/xemu-win-release-pdb/xemu-win-release.zip
dist/xemu-win-release-pdb/xemu-win-release-pdb.zip
dist/xemu-win-x86_64-debug-pdb/xemu-win-x86_64-debug.zip
dist/xemu-win-x86_64-debug-pdb/xemu-win-x86_64-debug-pdb.zip
dist/xemu-win-x86_64-release-pdb/xemu-win-x86_64-release.zip
dist/xemu-win-x86_64-release-pdb/xemu-win-release.zip
dist/xemu-win-x86_64-release-pdb/xemu-win-x86_64-release-pdb.zip
dist/xemu-macos-universal-release/xemu-macos-universal-release.zip
dist/xemu-macos-universal-debug/xemu-macos-universal-debug.zip
dist/xemu-ubuntu-release/xemu/xemu-v${{ env.XEMU_VERSION }}-x86_64.AppImage
Expand All @@ -402,7 +432,7 @@ jobs:
PushToPPA:
name: Push to PPA Snapshot Branch
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))
needs: [Ubuntu, macOSUniversal, WindowsPdb]
needs: [Ubuntu, macOSUniversal, Windows, WindowsPdb]
runs-on: ubuntu-latest
steps:
- name: Download source package
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
[submodule "tomlplusplus"]
path = tomlplusplus
url = https://github.com/marzer/tomlplusplus
[submodule "hw/xbox/nv2a/thirdparty/nv2a_vsh_cpu"]
path = hw/xbox/nv2a/thirdparty/nv2a_vsh_cpu
[submodule "hw/xbox/nv2a/pgraph/thirdparty/nv2a_vsh_cpu"]
path = hw/xbox/nv2a/pgraph/thirdparty/nv2a_vsh_cpu
url = https://github.com/abaire/nv2a_vsh_cpu.git
[submodule "ui/thirdparty/httplib"]
path = ui/thirdparty/httplib
Expand Down
8 changes: 7 additions & 1 deletion block/file-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
}

filename = qemu_opt_get(opts, "filename");
if (filename == NULL) {
ret = -EINVAL;
goto fail;
}

use_aio = get_aio_option(opts, flags, &local_err);
if (local_err) {
Expand All @@ -401,7 +405,8 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
}

wfilename = g_utf8_to_utf16(filename, -1, NULL, NULL, NULL);
if (!filename) {
if (!wfilename) {
ret = -EINVAL;
goto fail;
}

Expand All @@ -420,6 +425,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
OPEN_EXISTING, overlapped, NULL);
#endif
g_free(wfilename);

if (s->hfile == INVALID_HANDLE_VALUE) {
int err = GetLastError();

Expand Down
8 changes: 8 additions & 0 deletions config_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ input:
default: 18 # w

display:
renderer:
type: enum
values: ["NULL", OPENGL, VULKAN]
default: OPENGL
vulkan:
validation_layers: bool
debug_shaders: bool
assert_on_validation_msg: bool
quality:
surface_scale:
type: integer
Expand Down
17 changes: 12 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ else
git_submodules_action="ignore"
fi

git_submodules="ui/keycodemapdb ui/thirdparty/imgui ui/thirdparty/implot ui/thirdparty/httplib util/xxHash tomlplusplus genconfig hw/xbox/nv2a/thirdparty/nv2a_vsh_cpu"
git_submodules="ui/keycodemapdb ui/thirdparty/imgui ui/thirdparty/implot ui/thirdparty/httplib util/xxHash tomlplusplus genconfig hw/xbox/nv2a/pgraph/thirdparty/nv2a_vsh_cpu"
git="git"

# Don't accept a target_list environment variable.
Expand Down Expand Up @@ -1333,6 +1333,13 @@ EOF

# Meson currently only handles pie as a boolean for now so if we have
# explicitly disabled PIE we need to extend our cflags because it wont.

if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1; then
NO_PIE_LDFLAG=""
else
NO_PIE_LDFLAG="-no-pie"
fi

if test "$static" = "yes"; then
if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then
CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS"
Expand All @@ -1341,13 +1348,13 @@ if test "$static" = "yes"; then
error_exit "-static-pie not available due to missing toolchain support"
else
pie="no"
QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
QEMU_CFLAGS="-fno-pie $NO_PIE_LDFLAG $QEMU_CFLAGS"
fi
elif test "$pie" = "no"; then
if compile_prog "-Werror -fno-pie" "-no-pie"; then
if compile_prog "-Werror -fno-pie" $NO_PIE_LDFLAG; then
CONFIGURE_CFLAGS="-fno-pie $CONFIGURE_CFLAGS"
CONFIGURE_LDFLAGS="-no-pie $CONFIGURE_LDFLAGS"
QEMU_CFLAGS="-fno-pie -no-pie $QEMU_CFLAGS"
CONFIGURE_LDFLAGS="$NO_PIE_LDFLAG $CONFIGURE_LDFLAGS"
QEMU_CFLAGS="-fno-pie $NO_PIE_LDFLAG $QEMU_CFLAGS"
fi
elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS"
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Build-Depends: debhelper (>= 11),
libssl-dev,
libpcap-dev,
libslirp-dev,
libvulkan-dev,
Standards-Version: 3.9.8
Homepage: https://xemu.app
XS-Debian-Vcs-Browser: https://github.com/mborgerson/xemu
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ override_dh_auto_configure:

override_dh_auto_build:
./build.sh ${XEMU_BUILD_OPTIONS} ${common_configure_opts} || \
{ echo ===== BUILD FAILED ===; tail -n 50 config.log; exit 1; }
{ echo ===== BUILD FAILED ===; cat build/meson-logs/meson-log.txt; exit 1; }
cp debian/copyright debian/qemu.deb.copyright
cp dist/LICENSE.txt debian/copyright

Expand Down
2 changes: 0 additions & 2 deletions hw/xbox/mcpx/dsp/dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,13 @@ void dsp_run(DSPState* dsp, int cycles)

if (dsp->save_cycles <= 0) return;

int count = 0;
int dma_timer = 0;

while (dsp->save_cycles > 0)
{
dsp56k_execute_instruction(&dsp->core);
dsp->save_cycles -= dsp->core.instr_cycle;
dsp->core.cycle_count++;
count++;

if (dsp->dma.control & DMA_CONTROL_RUNNING) {
dma_timer++;
Expand Down
Loading

0 comments on commit 0337806

Please sign in to comment.