Compare commits

...

11 commits

Author SHA1 Message Date
BiatuAutMiahn ed912f43a8
Merge 27df9ada50 into 5a144a3fd3 2024-05-08 00:24:17 +03:00
Mason Thompson 5a144a3fd3
ci: Update actions to silence Node 16 warnings 2024-05-06 16:00:55 -07:00
BiatuAutMiahn 27df9ada50 Omit unnecessary config include 2023-12-17 23:43:32 -05:00
BiatuAutMiahn 09c7a5692c don't declare DEBUG in smbux_xbox_smc.c 2023-12-17 23:21:51 -05:00
BiatuAutMiahn 569b9bde76 Fix how smc scratch reg flags are set 2023-12-17 23:19:48 -05:00
BiatuAutMiahn b426beaa4a clang-formatting 2023-12-17 23:17:25 -05:00
BiatuAutMiahn f7ae22e3c0
Update vl.c 2023-11-28 18:14:45 -05:00
BiatuAutMiahn 8b6cd8979c
Update vl.c 2023-11-28 18:13:56 -05:00
BiatuAutMiahn 89119bc34e Merge branch 'master' of https://github.com/BiatuAutMiahn/xemu 2023-11-28 17:51:13 -05:00
BiatuAutMiahn 4e70c629e0 Proper eject handling, and revert -no-dvd.
-Reverts -no_dvd arg
-Adds eject/load tray handling to xbox smc.
-Adds -eject_after_boot arg
-Adds smc handling of eject_after_handling
2023-11-28 17:45:09 -05:00
BiatuAutMiahn 21eab4381c
Add -no_dvd parameter 2023-11-28 12:19:14 -05:00
7 changed files with 90 additions and 38 deletions

View file

@ -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' }}

View file

@ -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

View file

@ -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);

View file

@ -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",

View file

@ -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;

View file

@ -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);

View file

@ -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");