mirror of
https://github.com/xemu-project/xemu.git
synced 2024-05-19 21:30:50 -04:00
Compare commits
11 commits
a5d97a12cd
...
ed912f43a8
Author | SHA1 | Date | |
---|---|---|---|
ed912f43a8 | |||
5a144a3fd3 | |||
27df9ada50 | |||
09c7a5692c | |||
569b9bde76 | |||
b426beaa4a | |||
f7ae22e3c0 | |||
8b6cd8979c | |||
89119bc34e | |||
4e70c629e0 | |||
21eab4381c |
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
|
||||
|
|
|
@ -24,19 +24,20 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/option.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/acpi/acpi.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/i2c/i2c.h"
|
||||
#include "hw/i2c/smbus_slave.h"
|
||||
#include "qemu/config-file.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/config-file.h"
|
||||
#include "qemu/option.h"
|
||||
#include "sysemu/block-backend.h"
|
||||
#include "sysemu/blockdev.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "smbus.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include "ui/xemu-settings.h"
|
||||
#include "smbus.h"
|
||||
|
||||
#define TYPE_XBOX_SMC "smbus-xbox-smc"
|
||||
#define XBOX_SMC(obj) OBJECT_CHECK(SMBusSMCDevice, (obj), TYPE_XBOX_SMC)
|
||||
|
@ -91,7 +92,10 @@
|
|||
#define SMC_REG_RESETONEJECT 0x19
|
||||
#define SMC_REG_INTEN 0x1a
|
||||
#define SMC_REG_SCRATCH 0x1b
|
||||
#define SMC_REG_SCRATCH_EJECT_AFTER_BOOT 0x01
|
||||
#define SMC_REG_SCRATCH_ERROR_AFTER_BOOT 0x02
|
||||
#define SMC_REG_SCRATCH_SHORT_ANIMATION 0x04
|
||||
#define SMC_REG_SCRATCH_FORCE_DASH_BOOT 0x08
|
||||
|
||||
#define SMC_VERSION_LENGTH 3
|
||||
|
||||
|
@ -114,6 +118,7 @@ static void smc_quick_cmd(SMBusDevice *dev, uint8_t read)
|
|||
|
||||
static int smc_write_data(SMBusDevice *dev, uint8_t *buf, uint8_t len)
|
||||
{
|
||||
Error *error = NULL;
|
||||
SMBusSMCDevice *smc = XBOX_SMC(dev);
|
||||
|
||||
smc->cmd = buf[0];
|
||||
|
@ -140,6 +145,19 @@ static int smc_write_data(SMBusDevice *dev, uint8_t *buf, uint8_t len)
|
|||
}
|
||||
break;
|
||||
|
||||
case SMC_REG_TRAYEJECT:
|
||||
if (buf[0]) {
|
||||
const char *path = g_config.sys.files.dvd_path;
|
||||
qmp_blockdev_change_medium(true, "ide0-cd1", false, NULL, path,
|
||||
false, "", false, false, false, 0,
|
||||
&error);
|
||||
} else {
|
||||
xemu_settings_set_string(&g_config.sys.files.dvd_path, "");
|
||||
qmp_eject(true, "ide0-cd1", false, NULL, true, false, &error);
|
||||
}
|
||||
xbox_smc_update_tray_state();
|
||||
break;
|
||||
|
||||
case SMC_REG_ERROR_WRITE:
|
||||
smc->error_reg = buf[0];
|
||||
break;
|
||||
|
@ -264,8 +282,13 @@ static void smbus_smc_realize(DeviceState *dev, Error **errp)
|
|||
smc->cmd = 0;
|
||||
smc->error_reg = 0;
|
||||
|
||||
if (object_property_get_bool(qdev_get_machine(), "eject-after-boot",
|
||||
NULL)) {
|
||||
smc->scratch_reg |= SMC_REG_SCRATCH_EJECT_AFTER_BOOT;
|
||||
}
|
||||
|
||||
if (object_property_get_bool(qdev_get_machine(), "short-animation", NULL)) {
|
||||
smc->scratch_reg = SMC_REG_SCRATCH_SHORT_ANIMATION;
|
||||
smc->scratch_reg |= SMC_REG_SCRATCH_SHORT_ANIMATION;
|
||||
}
|
||||
|
||||
avpack = object_property_get_str(qdev_get_machine(), "avpack", NULL);
|
||||
|
|
|
@ -437,6 +437,18 @@ static bool machine_get_short_animation(Object *obj, Error **errp)
|
|||
return ms->short_animation;
|
||||
}
|
||||
|
||||
static void machine_set_eject_after_boot(Object *obj, bool value, Error **errp)
|
||||
{
|
||||
XboxMachineState *ms = XBOX_MACHINE(obj);
|
||||
ms->eject_after_boot = value;
|
||||
}
|
||||
|
||||
static bool machine_get_eject_after_boot(Object *obj, Error **errp)
|
||||
{
|
||||
XboxMachineState *ms = XBOX_MACHINE(obj);
|
||||
return ms->eject_after_boot;
|
||||
}
|
||||
|
||||
static char *machine_get_smc_version(Object *obj, Error **errp)
|
||||
{
|
||||
XboxMachineState *ms = XBOX_MACHINE(obj);
|
||||
|
@ -504,6 +516,13 @@ static inline void xbox_machine_initfn(Object *obj)
|
|||
"Skip Xbox boot animation");
|
||||
object_property_set_bool(obj, "short-animation", false, &error_fatal);
|
||||
|
||||
object_property_add_bool(obj, "eject-after-boot",
|
||||
machine_get_eject_after_boot,
|
||||
machine_set_eject_after_boot);
|
||||
object_property_set_description(obj, "eject-after-boot",
|
||||
"Eject disc tray after boot");
|
||||
object_property_set_bool(obj, "eject-after-boot", false, &error_fatal);
|
||||
|
||||
object_property_add_str(obj, "smc-version", machine_get_smc_version,
|
||||
machine_set_smc_version);
|
||||
object_property_set_description(obj, "smc-version",
|
||||
|
|
|
@ -45,6 +45,7 @@ typedef struct XboxMachineState {
|
|||
char *bootrom;
|
||||
char *avpack;
|
||||
bool short_animation;
|
||||
bool eject_after_boot;
|
||||
char *smc_version;
|
||||
char *video_encoder;
|
||||
} XboxMachineState;
|
||||
|
|
18
softmmu/vl.c
18
softmmu/vl.c
|
@ -2782,12 +2782,20 @@ void qemu_init(int argc, char **argv)
|
|||
"none",
|
||||
}[g_config.sys.avpack];
|
||||
|
||||
fake_argv[fake_argc++] = g_strdup_printf("xbox%s%s%s,avpack=%s",
|
||||
(bootrom_arg != NULL) ? bootrom_arg : "",
|
||||
bool eject_after_boot = false;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (argv[i] && strcmp(argv[i], "-eject_after_boot") == 0) {
|
||||
argv[i] = NULL;
|
||||
eject_after_boot = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fake_argv[fake_argc++] = g_strdup_printf(
|
||||
"xbox%s%s%s%s,avpack=%s", (bootrom_arg != NULL) ? bootrom_arg : "",
|
||||
eject_after_boot ? ",eject-after-boot=on" : "",
|
||||
g_config.general.skip_boot_anim ? ",short-animation=on" : "",
|
||||
",kernel-irqchip=off",
|
||||
avpack_str
|
||||
);
|
||||
",kernel-irqchip=off", avpack_str);
|
||||
|
||||
if (bootrom_arg != NULL) {
|
||||
g_free(bootrom_arg);
|
||||
|
|
|
@ -1220,7 +1220,8 @@ void MainMenuSystemView::Draw()
|
|||
}
|
||||
|
||||
if ((int)g_config.sys.avpack == CONFIG_SYS_AVPACK_NONE) {
|
||||
ImGui::TextColored(ImVec4(1,0,0,1), "Setting AV Pack to NONE disables video output.");
|
||||
ImGui::TextColored(ImVec4(1, 0, 0, 1),
|
||||
"Setting AV Pack to NONE disables video output.");
|
||||
}
|
||||
|
||||
SectionTitle("System Configuration");
|
||||
|
|
Loading…
Reference in a new issue