mirror of
https://github.com/xemu-project/xemu.git
synced 2024-05-19 21:30:50 -04:00
Compare commits
3 commits
18b6ef8793
...
f0e8f31b1e
Author | SHA1 | Date | |
---|---|---|---|
f0e8f31b1e | |||
5a144a3fd3 | |||
3e633bbbc0 |
10
.github/workflows/build-xemu-win64-toolchain.yml
vendored
10
.github/workflows/build-xemu-win64-toolchain.yml
vendored
|
@ -21,10 +21,10 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone tree
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
- name: Extract image metadata (tags, labels)
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4.3.0
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
labels: |
|
||||
|
@ -35,16 +35,16 @@ jobs:
|
|||
type=ref,event=branch
|
||||
type=sha
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2.2.1
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v3
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v3.2.0
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ubuntu-win64-cross
|
||||
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
|
|
40
.github/workflows/build.yml
vendored
40
.github/workflows/build.yml
vendored
|
@ -20,7 +20,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone tree
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# On push to master, increment patch version and create a new tag on release
|
||||
|
@ -48,7 +48,7 @@ jobs:
|
|||
./scripts/archive-source.sh src.tar
|
||||
gzip -1 src.tar
|
||||
- name: Upload source package artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: src.tar.gz
|
||||
path: src.tar.gz
|
||||
|
@ -71,14 +71,14 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Download source package
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: src.tar.gz
|
||||
- name: Extract source package
|
||||
run: tar xf src.tar.gz
|
||||
- name: Initialize compiler cache
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/xemu-ccache
|
||||
key: cache-wincross-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
||||
|
@ -97,7 +97,7 @@ jobs:
|
|||
$DOCKER_IMAGE_NAME \
|
||||
bash -c "ccache -z; ./build.sh -p win64-cross ${{ matrix.build_param }} && ccache -s"
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact_name }}
|
||||
path: dist
|
||||
|
@ -118,7 +118,7 @@ jobs:
|
|||
artifact_name: xemu-win-release
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact_name }}
|
||||
path: ${{ matrix.artifact_name }}
|
||||
|
@ -132,7 +132,7 @@ jobs:
|
|||
7z a -tzip ../dist/${{ matrix.artifact_name }}.zip * "-xr!*.pdb"
|
||||
7z a -tzip ../dist/${{ matrix.artifact_name }}-pdb.zip "-ir!*.pdb"
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact_name }}-pdb
|
||||
path: dist
|
||||
|
@ -155,13 +155,13 @@ jobs:
|
|||
steps:
|
||||
- name: Initialize compiler cache
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/xemu-ccache
|
||||
key: cache-${{ runner.os }}-${{ matrix.configuration }}-${{ github.sha }}
|
||||
restore-keys: cache-${{ runner.os }}-${{ matrix.configuration }}-
|
||||
- name: Download source package
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: src.tar.gz
|
||||
- name: Extract source package
|
||||
|
@ -169,7 +169,7 @@ jobs:
|
|||
mkdir src
|
||||
tar -C src -xf src.tar.gz
|
||||
- name: Clone Debian packaging
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: deb
|
||||
path: debian-tmp
|
||||
|
@ -232,7 +232,7 @@ jobs:
|
|||
run: |
|
||||
tar -czvf ${{ matrix.artifact_filename }} --transform "s#^dist#xemu#" dist
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact_name }}
|
||||
path: ${{ matrix.artifact_filename }}
|
||||
|
@ -266,7 +266,7 @@ jobs:
|
|||
artifact_filename: xemu-macos-arm64-release.zip
|
||||
steps:
|
||||
- name: Download source package
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: src.tar.gz
|
||||
- name: Extract source package
|
||||
|
@ -284,7 +284,7 @@ jobs:
|
|||
python3 -m pip install pyyaml requests
|
||||
- name: Initialize compiler, library cache
|
||||
id: cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
xemu-ccache
|
||||
|
@ -304,7 +304,7 @@ jobs:
|
|||
zip -r ../${{ matrix.artifact_filename }} *
|
||||
popd
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact_name }}
|
||||
path: ${{ matrix.artifact_filename }}
|
||||
|
@ -318,12 +318,12 @@ jobs:
|
|||
configuration: ["debug", "release"]
|
||||
steps:
|
||||
- name: Download x86_64 build
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: xemu-macos-x86_64-${{ matrix.configuration }}
|
||||
path: xemu-macos-x86_64-${{ matrix.configuration }}
|
||||
- name: Download arm64 build
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: xemu-macos-arm64-${{ matrix.configuration }}
|
||||
path: xemu-macos-arm64-${{ matrix.configuration }}
|
||||
|
@ -347,7 +347,7 @@ jobs:
|
|||
zip -r ../xemu-macos-universal-${{ matrix.configuration }}.zip *
|
||||
popd
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: xemu-macos-universal-${{ matrix.configuration }}
|
||||
path: xemu-macos-universal-${{ matrix.configuration }}.zip
|
||||
|
@ -358,7 +358,7 @@ jobs:
|
|||
needs: [Ubuntu, macOSUniversal, WindowsPdb]
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: dist
|
||||
- name: Extract source package
|
||||
|
@ -411,7 +411,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download source package
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: src.tar.gz
|
||||
- name: Extract source package
|
||||
|
@ -419,7 +419,7 @@ jobs:
|
|||
mkdir src
|
||||
tar -C src -xf src.tar.gz
|
||||
- name: Clone Debian packaging
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: deb
|
||||
path: debian-tmp
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
#include "hw/xbox/nv2a/nv2a_int.h"
|
||||
|
||||
static NV2AState *g_nv2a;
|
||||
|
||||
void nv2a_update_irq(NV2AState *d)
|
||||
{
|
||||
/* PFIFO */
|
||||
|
@ -362,17 +364,7 @@ static void qdev_nv2a_reset(DeviceState *dev)
|
|||
static void nv2a_vm_state_change(void *opaque, bool running, RunState state)
|
||||
{
|
||||
NV2AState *d = opaque;
|
||||
if (state == RUN_STATE_SAVE_VM) {
|
||||
nv2a_lock_fifo(d);
|
||||
qatomic_set(&d->pfifo.halt, true);
|
||||
qatomic_set(&d->pgraph.download_dirty_surfaces_pending, true);
|
||||
qemu_event_reset(&d->pgraph.dirty_surfaces_download_complete);
|
||||
nv2a_unlock_fifo(d);
|
||||
qemu_mutex_unlock_iothread();
|
||||
qemu_event_wait(&d->pgraph.dirty_surfaces_download_complete);
|
||||
qemu_mutex_lock_iothread();
|
||||
nv2a_lock_fifo(d);
|
||||
} else if (state == RUN_STATE_RESTORE_VM) {
|
||||
if (state == RUN_STATE_RESTORE_VM) {
|
||||
nv2a_lock_fifo(d);
|
||||
qatomic_set(&d->pfifo.halt, true);
|
||||
nv2a_unlock_fifo(d);
|
||||
|
@ -391,6 +383,19 @@ static void nv2a_vm_state_change(void *opaque, bool running, RunState state)
|
|||
}
|
||||
}
|
||||
|
||||
void nv2a_save_vm_state(void)
|
||||
{
|
||||
nv2a_lock_fifo(g_nv2a);
|
||||
qatomic_set(&g_nv2a->pfifo.halt, true);
|
||||
qatomic_set(&g_nv2a->pgraph.download_dirty_surfaces_pending, true);
|
||||
qemu_event_reset(&g_nv2a->pgraph.dirty_surfaces_download_complete);
|
||||
nv2a_unlock_fifo(g_nv2a);
|
||||
qemu_mutex_unlock_iothread();
|
||||
qemu_event_wait(&g_nv2a->pgraph.dirty_surfaces_download_complete);
|
||||
qemu_mutex_lock_iothread();
|
||||
nv2a_lock_fifo(g_nv2a);
|
||||
}
|
||||
|
||||
static int nv2a_post_save(void *opaque)
|
||||
{
|
||||
NV2AState *d = opaque;
|
||||
|
@ -590,6 +595,7 @@ void nv2a_init(PCIBus *bus, int devfn, MemoryRegion *ram)
|
|||
{
|
||||
PCIDevice *dev = pci_create_simple(bus, devfn, "nv2a");
|
||||
NV2AState *d = NV2A_DEVICE(dev);
|
||||
g_nv2a = d;
|
||||
nv2a_init_memory(d, ram);
|
||||
nv2a_init_vga(d);
|
||||
qemu_add_vm_change_state_handler(nv2a_vm_state_change, d);
|
||||
|
|
|
@ -28,5 +28,6 @@ void nv2a_set_surface_scale_factor(unsigned int scale);
|
|||
unsigned int nv2a_get_surface_scale_factor(void);
|
||||
const uint8_t *nv2a_get_dac_palette(void);
|
||||
int nv2a_get_screen_off(void);
|
||||
void nv2a_save_vm_state(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
#include "yank_functions.h"
|
||||
|
||||
#include "ui/xemu-snapshots.h"
|
||||
#include "hw/xbox/nv2a/nv2a.h"
|
||||
|
||||
const unsigned int postcopy_ram_discard_version;
|
||||
|
||||
|
@ -2854,6 +2855,9 @@ bool save_snapshot(const char *name, bool overwrite, const char *vmstate,
|
|||
return false;
|
||||
}
|
||||
vm_stop(RUN_STATE_SAVE_VM);
|
||||
#ifdef XBOX
|
||||
nv2a_save_vm_state();
|
||||
#endif
|
||||
|
||||
bdrv_drain_all_begin();
|
||||
|
||||
|
|
Loading…
Reference in a new issue