Add option to skip Xbox boot animation.

This commit is contained in:
Matt Borgerson 2015-08-21 17:56:00 -07:00
parent d90dee0892
commit c107b96789
2 changed files with 18 additions and 6 deletions

View File

@ -20,8 +20,9 @@
#include "hw/hw.h"
#include "hw/i2c/i2c.h"
#include "hw/i2c/smbus.h"
#include <qemu/config-file.h>
/*
/*
* Hardware is a PIC16LC
* http://www.xbox-linux.org/wiki/PIC
*/
@ -128,7 +129,7 @@ static uint8_t smc_read_data(SMBusDevice *dev, uint8_t cmd, int n)
printf("smc_read_data: addr=0x%02x cmd=0x%02x n=%d\n",
dev->i2c.address, cmd, n);
#endif
switch(cmd) {
case SMC_REG_VER:
return smc_version_string[
@ -137,9 +138,16 @@ static uint8_t smc_read_data(SMBusDevice *dev, uint8_t cmd, int n)
/* pretend to have a composite av pack plugged in */
return SMC_REG_AVPACK_COMPOSITE;
case SMC_REG_SCRATCH:
case SMC_REG_SCRATCH: {
/* Skip boot animation if the "skipanim" flag was set. */
QemuOpts *opts = qemu_opts_find(qemu_find_opts("machine"), NULL);
if (opts && qemu_opt_get_bool(opts, "skipanim", 0))
{
return SMC_REG_SCRATCH_SHORT_ANIMATION;
}
return 0;
// return SMC_REG_SCRATCH_SHORT_ANIMATION;
}
/* challenge request:
* must be non-0 */
@ -155,14 +163,14 @@ static uint8_t smc_read_data(SMBusDevice *dev, uint8_t cmd, int n)
default:
break;
}
return 0;
}
static int smbus_smc_init(SMBusDevice *dev)
{
SMBusSMCDevice *smc = (SMBusSMCDevice *)dev;
smc->versionStringIndex = 0;
return 0;

4
vl.c
View File

@ -440,6 +440,10 @@ static QemuOptsList qemu_machine_opts = {
.name = "mediaboard_filesystem",
.type = QEMU_OPT_STRING,
.help = "Chihiro mediaboard filesystem file",
},{
.name = "skipanim",
.type = QEMU_OPT_BOOL,
.help = "Skip boot animation",
},
{ /* End of list */ }
},