Merge branch '86Box:master' into HDD_Model_Batch
This commit is contained in:
24
src/config.c
24
src/config.c
@@ -895,9 +895,9 @@ load_storage_controllers(void)
|
||||
fatal("load_storage_controllers(): strlen(p) > 2047 "
|
||||
"(cassette_image_history[%i])\n", i);
|
||||
else
|
||||
snprintf(cassette_image_history[i], (MAX_IMAGE_PATH_LEN - 1), "%s", p);
|
||||
snprintf(cassette_image_history[i], MAX_IMAGE_PATH_LEN, "%s", p);
|
||||
} else
|
||||
snprintf(cassette_image_history[i], (MAX_IMAGE_PATH_LEN - 1), "%s%s%s", usr_path,
|
||||
snprintf(cassette_image_history[i], MAX_IMAGE_PATH_LEN, "%s%s%s", usr_path,
|
||||
path_get_slash(usr_path), p);
|
||||
path_normalize(cassette_image_history[i]);
|
||||
}
|
||||
@@ -960,9 +960,9 @@ load_storage_controllers(void)
|
||||
fatal("load_storage_controllers(): strlen(p) > 2047 "
|
||||
"(cart_image_history[%i][%i])\n", c, i);
|
||||
else
|
||||
snprintf(cart_image_history[c][i], (MAX_IMAGE_PATH_LEN - 1), "%s", p);
|
||||
snprintf(cart_image_history[c][i], MAX_IMAGE_PATH_LEN, "%s", p);
|
||||
} else
|
||||
snprintf(cart_image_history[c][i], (MAX_IMAGE_PATH_LEN - 1), "%s%s%s", usr_path,
|
||||
snprintf(cart_image_history[c][i], MAX_IMAGE_PATH_LEN, "%s%s%s", usr_path,
|
||||
path_get_slash(usr_path), p);
|
||||
path_normalize(cart_image_history[c][i]);
|
||||
}
|
||||
@@ -1259,9 +1259,9 @@ load_floppy_and_cdrom_drives(void)
|
||||
fatal("load_floppy_and_cdrom_drives(): strlen(p) > 2047 "
|
||||
"(fdd_image_history[%i][%i])\n", c, i);
|
||||
else
|
||||
snprintf(fdd_image_history[c][i], (MAX_IMAGE_PATH_LEN - 1), "%s", p);
|
||||
snprintf(fdd_image_history[c][i], MAX_IMAGE_PATH_LEN, "%s", p);
|
||||
} else
|
||||
snprintf(fdd_image_history[c][i], (MAX_IMAGE_PATH_LEN - 1), "%s%s%s", usr_path,
|
||||
snprintf(fdd_image_history[c][i], MAX_IMAGE_PATH_LEN, "%s%s%s", usr_path,
|
||||
path_get_slash(usr_path), p);
|
||||
path_normalize(fdd_image_history[c][i]);
|
||||
}
|
||||
@@ -1370,9 +1370,9 @@ load_floppy_and_cdrom_drives(void)
|
||||
fatal("load_floppy_and_cdrom_drives(): strlen(p) > 2047 "
|
||||
"(cdrom[%i].image_history[%i])\n", c, i);
|
||||
else
|
||||
snprintf(cdrom[c].image_history[i], (MAX_IMAGE_PATH_LEN - 1), "%s", p);
|
||||
snprintf(cdrom[c].image_history[i], MAX_IMAGE_PATH_LEN, "%s", p);
|
||||
} else
|
||||
snprintf(cdrom[c].image_history[i], (MAX_IMAGE_PATH_LEN - 1), "%s%s%s", usr_path,
|
||||
snprintf(cdrom[c].image_history[i], MAX_IMAGE_PATH_LEN, "%s%s%s", usr_path,
|
||||
path_get_slash(usr_path), p);
|
||||
path_normalize(cdrom[c].image_history[i]);
|
||||
}
|
||||
@@ -1500,9 +1500,9 @@ load_other_removable_devices(void)
|
||||
fatal("load_other_removable_devices(): strlen(p) > 2047 "
|
||||
"(zip_drives[%i].image_history[%i])\n", c, i);
|
||||
else
|
||||
snprintf(zip_drives[c].image_history[i], (MAX_IMAGE_PATH_LEN - 1), "%s", p);
|
||||
snprintf(zip_drives[c].image_history[i], MAX_IMAGE_PATH_LEN, "%s", p);
|
||||
} else
|
||||
snprintf(zip_drives[c].image_history[i], (MAX_IMAGE_PATH_LEN - 1), "%s%s%s", usr_path,
|
||||
snprintf(zip_drives[c].image_history[i], MAX_IMAGE_PATH_LEN, "%s%s%s", usr_path,
|
||||
path_get_slash(usr_path), p);
|
||||
path_normalize(zip_drives[c].image_history[i]);
|
||||
}
|
||||
@@ -1613,9 +1613,9 @@ load_other_removable_devices(void)
|
||||
fatal("load_other_removable_devices(): strlen(p) > 2047 "
|
||||
"(mo_drives[%i].image_history[%i])\n", c, i);
|
||||
else
|
||||
snprintf(mo_drives[c].image_history[i], (MAX_IMAGE_PATH_LEN - 1), "%s", p);
|
||||
snprintf(mo_drives[c].image_history[i], MAX_IMAGE_PATH_LEN, "%s", p);
|
||||
} else
|
||||
snprintf(mo_drives[c].image_history[i], (MAX_IMAGE_PATH_LEN - 1), "%s%s%s", usr_path,
|
||||
snprintf(mo_drives[c].image_history[i], MAX_IMAGE_PATH_LEN, "%s%s%s", usr_path,
|
||||
path_get_slash(usr_path), p);
|
||||
path_normalize(mo_drives[c].image_history[i]);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
static int
|
||||
opESCAPE_d8_a16(uint32_t fetchdat)
|
||||
{
|
||||
//pclog("D8 A16: fetchdat=%02x.\n", (fetchdat >> 3) & 0x1f);
|
||||
return x86_opcodes_d8_a16[(fetchdat >> 3) & 0x1f](fetchdat);
|
||||
}
|
||||
static int
|
||||
@@ -16,7 +15,6 @@ opESCAPE_d8_a32(uint32_t fetchdat)
|
||||
static int
|
||||
opESCAPE_d9_a16(uint32_t fetchdat)
|
||||
{
|
||||
//pclog("D9 A16: fetchdat=%02x.\n", fetchdat & 0xff);
|
||||
return x86_opcodes_d9_a16[fetchdat & 0xff](fetchdat);
|
||||
}
|
||||
static int
|
||||
@@ -28,7 +26,6 @@ opESCAPE_d9_a32(uint32_t fetchdat)
|
||||
static int
|
||||
opESCAPE_da_a16(uint32_t fetchdat)
|
||||
{
|
||||
//pclog("DA A16: fetchdat=%02x.\n", fetchdat & 0xff);
|
||||
return x86_opcodes_da_a16[fetchdat & 0xff](fetchdat);
|
||||
}
|
||||
static int
|
||||
@@ -40,7 +37,6 @@ opESCAPE_da_a32(uint32_t fetchdat)
|
||||
static int
|
||||
opESCAPE_db_a16(uint32_t fetchdat)
|
||||
{
|
||||
//pclog("DB A16: fetchdat=%02x.\n", fetchdat & 0xff);
|
||||
return x86_opcodes_db_a16[fetchdat & 0xff](fetchdat);
|
||||
}
|
||||
static int
|
||||
@@ -52,7 +48,6 @@ opESCAPE_db_a32(uint32_t fetchdat)
|
||||
static int
|
||||
opESCAPE_dc_a16(uint32_t fetchdat)
|
||||
{
|
||||
//pclog("DC A16: fetchdat=%02x.\n", (fetchdat >> 3) & 0x1f);
|
||||
return x86_opcodes_dc_a16[(fetchdat >> 3) & 0x1f](fetchdat);
|
||||
}
|
||||
static int
|
||||
@@ -64,7 +59,6 @@ opESCAPE_dc_a32(uint32_t fetchdat)
|
||||
static int
|
||||
opESCAPE_dd_a16(uint32_t fetchdat)
|
||||
{
|
||||
//pclog("DD A16: fetchdat=%02x.\n", fetchdat & 0xff);
|
||||
return x86_opcodes_dd_a16[fetchdat & 0xff](fetchdat);
|
||||
}
|
||||
static int
|
||||
@@ -76,7 +70,6 @@ opESCAPE_dd_a32(uint32_t fetchdat)
|
||||
static int
|
||||
opESCAPE_de_a16(uint32_t fetchdat)
|
||||
{
|
||||
//pclog("DE A16: fetchdat=%02x.\n", fetchdat & 0xff);
|
||||
return x86_opcodes_de_a16[fetchdat & 0xff](fetchdat);
|
||||
}
|
||||
static int
|
||||
@@ -88,7 +81,6 @@ opESCAPE_de_a32(uint32_t fetchdat)
|
||||
static int
|
||||
opESCAPE_df_a16(uint32_t fetchdat)
|
||||
{
|
||||
//pclog("DF A16: fetchdat=%02x.\n", fetchdat & 0xff);
|
||||
return x86_opcodes_df_a16[fetchdat & 0xff](fetchdat);
|
||||
}
|
||||
static int
|
||||
@@ -105,15 +97,13 @@ opWAIT(uint32_t fetchdat)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (!cpu_use_dynarec && fpu_softfloat) {
|
||||
#endif
|
||||
if (fpu_softfloat) {
|
||||
if (fpu_state.swd & FPU_SW_Summary) {
|
||||
if (cr0 & 0x20) {
|
||||
if (is486 && (cr0 & 0x20))
|
||||
x86_int(16);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
picint(1 << 13);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
CLOCK_CYCLES(4);
|
||||
|
||||
@@ -97,15 +97,10 @@ opWAIT(uint32_t fetchdat)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (!cpu_use_dynarec && fpu_softfloat) {
|
||||
#endif
|
||||
if (fpu_softfloat) {
|
||||
if (fpu_state.swd & FPU_SW_Summary) {
|
||||
if (cr0 & 0x20) {
|
||||
x86_int(16);
|
||||
return 1;
|
||||
}
|
||||
picint(1 << 13);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
CLOCK_CYCLES(4);
|
||||
|
||||
@@ -355,7 +355,10 @@ FPU_exception(uint32_t fetchdat, uint16_t exceptions, int store)
|
||||
nmi = 1;
|
||||
}
|
||||
#else
|
||||
picint(1 << 13);
|
||||
if (is486 && (cr0 & 0x20))
|
||||
x86_int(16);
|
||||
else
|
||||
picint(1 << 13);
|
||||
#endif // FPU_8087
|
||||
}
|
||||
return unmasked;
|
||||
|
||||
@@ -228,12 +228,10 @@ FPU_save_regi_tag(extFloat80_t reg, int tag, int stnr)
|
||||
#define FPU_check_pending_exceptions() \
|
||||
do { \
|
||||
if (fpu_state.swd & FPU_SW_Summary) { \
|
||||
if (cr0 & 0x20) { \
|
||||
if (is486 && (cr0 & 0x20)) \
|
||||
x86_int(16); \
|
||||
return 1; \
|
||||
} else { \
|
||||
else \
|
||||
picint(1 << 13); \
|
||||
return 1; \
|
||||
} \
|
||||
return 1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@@ -99,7 +99,10 @@ typedef union {
|
||||
dst = src1 / (double) src2; \
|
||||
else { \
|
||||
fpu_log("FPU : divide by zero\n"); \
|
||||
picint(1 << 13); \
|
||||
if (is486 && (cr0 & 0x20)) \
|
||||
x86_int(16); \
|
||||
else \
|
||||
picint(1 << 13); \
|
||||
return 1; \
|
||||
} \
|
||||
} else \
|
||||
|
||||
@@ -197,6 +197,8 @@ serial_receive_timer(void *priv)
|
||||
/* Raise Data Ready interrupt. */
|
||||
dev->lsr |= 0x01;
|
||||
dev->int_status |= SERIAL_INT_RECEIVE;
|
||||
if (dev->lsr & 0x02)
|
||||
dev->int_status |= SERIAL_INT_LSR;
|
||||
|
||||
serial_update_ints(dev);
|
||||
}
|
||||
@@ -266,10 +268,6 @@ serial_move_to_txsr(serial_t *dev)
|
||||
/* Update interrupts to signal THRE and that TXSR is no longer empty. */
|
||||
serial_update_ints(dev);
|
||||
}
|
||||
if (dev->transmit_enabled & 2)
|
||||
dev->baud_cycles++;
|
||||
else
|
||||
dev->baud_cycles = 0; /* If not moving while transmitting, reset BAUDOUT cycle count. */
|
||||
if (!dev->fifo_enabled || (fifo_get_count(dev->xmit_fifo) == 0x0))
|
||||
dev->transmit_enabled &= ~1; /* Stop moving. */
|
||||
dev->transmit_enabled |= 2; /* Start transmitting. */
|
||||
@@ -303,16 +301,26 @@ static void
|
||||
serial_transmit_timer(void *priv)
|
||||
{
|
||||
serial_t *dev = (serial_t *) priv;
|
||||
int delay = 8; /* STOP to THRE delay is 8 BAUDOUT cycles. */
|
||||
/*
|
||||
Norton Diagnostics waits for up to 2 bit periods, this is
|
||||
confirmed by the NS16550A timings graph, which shows operation
|
||||
as follows after write: 1 bit of delay, then start bit, and at
|
||||
the end of the start bit, move from THR to TXSR.
|
||||
*/
|
||||
int delay = 1;
|
||||
|
||||
if (dev->transmit_enabled & 3) {
|
||||
/*
|
||||
If already transmitting, move from THR to TXSR at the end of
|
||||
the last data bit.
|
||||
*/
|
||||
if ((dev->transmit_enabled & 1) && (dev->transmit_enabled & 2))
|
||||
delay = dev->data_bits; /* Delay by less if already transmitting. */
|
||||
delay = dev->data_bits + 1;
|
||||
|
||||
dev->baud_cycles++;
|
||||
|
||||
/* We have processed (total bits) BAUDOUT cycles, transmit the byte. */
|
||||
if ((dev->baud_cycles == dev->bits) && (dev->transmit_enabled & 2))
|
||||
/* We have processed (delay + total bits) BAUDOUT cycles, transmit the byte. */
|
||||
if ((dev->baud_cycles == (dev->bits + 1)) && (dev->transmit_enabled & 2))
|
||||
serial_process_txsr(dev);
|
||||
|
||||
/* We have processed (data bits) BAUDOUT cycles. */
|
||||
@@ -614,6 +622,11 @@ serial_write(uint16_t addr, uint8_t val, void *priv)
|
||||
|
||||
dev->msr = new_msr;
|
||||
|
||||
if (dev->msr & 0x0f) {
|
||||
dev->int_status |= SERIAL_INT_MSR;
|
||||
serial_update_ints(dev);
|
||||
}
|
||||
|
||||
/* TODO: Why reset the FIFO's here?! */
|
||||
fifo_reset(dev->xmit_fifo);
|
||||
fifo_reset(dev->rcvr_fifo);
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
#define SOUND_OPL_H
|
||||
|
||||
enum fm_type {
|
||||
FM_YM3812 = 0, /* OPL2 */
|
||||
FM_YMF262 = 1, /* OPL3 */
|
||||
FM_YMF289B = 2, /* OPL3-L */
|
||||
FM_YMF278B = 3, /* OPL 4 */
|
||||
FM_ESFM = 4, /* ESFM */
|
||||
FM_MAX = 5,
|
||||
FM_OPL2BOARD = 6 /* OPL2BOARD (External Device)*/
|
||||
FM_YM3812 = 0, /* OPL2 */
|
||||
FM_YMF262 = 1, /* OPL3 */
|
||||
FM_YMF289B = 2, /* OPL3-L */
|
||||
FM_YMF278B = 3, /* OPL 4 */
|
||||
FM_ESFM = 4, /* ESFM */
|
||||
FM_OPL2BOARD = 5, /* OPL2BOARD (External Device)*/
|
||||
FM_MAX = 6
|
||||
};
|
||||
|
||||
enum fm_driver {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void *sid_init(void);
|
||||
void *sid_init(uint8_t type);
|
||||
void sid_close(void *priv);
|
||||
void sid_reset(void *priv);
|
||||
uint8_t sid_read(uint16_t addr, void *priv);
|
||||
|
||||
@@ -192,6 +192,7 @@ extern const device_t ps1snd_device;
|
||||
|
||||
/* Innovation SSI-2001 */
|
||||
extern const device_t ssi2001_device;
|
||||
extern const device_t entertainer_device;
|
||||
|
||||
/* Pro Audio Spectrum Plus, 16, and 16D */
|
||||
extern const device_t pasplus_device;
|
||||
|
||||
@@ -56,15 +56,9 @@ opl2board_device_log(const char *fmt, ...)
|
||||
|
||||
typedef struct opl2board_device_t {
|
||||
fm_drv_t opl;
|
||||
|
||||
uint8_t pos_regs[8];
|
||||
|
||||
|
||||
uint8_t pos_regs[8];
|
||||
} opl2board_device_t;
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
opl2board_device_get_buffer(int32_t *buffer, int len, void *priv)
|
||||
{
|
||||
@@ -115,6 +109,7 @@ opl2board_device_mca_write(int port, uint8_t val, void *priv)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
serial->pos_regs[port & 7] = val;
|
||||
}
|
||||
|
||||
@@ -131,8 +126,7 @@ opl2board_device_init(UNUSED(const device_t *info))
|
||||
{
|
||||
opl2board_device_t *serial = malloc(sizeof(opl2board_device_t));
|
||||
memset(serial, 0, sizeof(opl2board_device_t));
|
||||
|
||||
|
||||
|
||||
opl2board_device_log("opl2board_device_init\n");
|
||||
fm_driver_get(FM_OPL2BOARD, &serial->opl);
|
||||
io_sethandler(0x0388, 0x0002,
|
||||
@@ -141,9 +135,7 @@ opl2board_device_init(UNUSED(const device_t *info))
|
||||
serial->opl.priv);
|
||||
music_add_handler(opl2board_device_get_buffer, serial);
|
||||
|
||||
|
||||
return serial;
|
||||
|
||||
}
|
||||
|
||||
void *
|
||||
@@ -175,19 +167,18 @@ opl2board_device_close(void *priv)
|
||||
|
||||
|
||||
static const device_config_t opl2board_config[] = {
|
||||
|
||||
{
|
||||
.name = "host_serial_path",
|
||||
.description = "Host Serial Device",
|
||||
.type = CONFIG_SERPORT,
|
||||
.default_string = "",
|
||||
.file_filter = NULL,
|
||||
.spinner = {},
|
||||
.selection = {}
|
||||
{
|
||||
.name = "host_serial_path",
|
||||
.description = "Host Serial Device",
|
||||
.type = CONFIG_SERPORT,
|
||||
.default_string = "",
|
||||
.file_filter = NULL,
|
||||
.spinner = {},
|
||||
.selection = {}
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
};
|
||||
const device_t opl2board_device = {
|
||||
.name = "OPL2Board (External Device)",
|
||||
.internal_name = "opl2board_device",
|
||||
|
||||
@@ -20,21 +20,21 @@ typedef struct psid_t {
|
||||
psid_t *psid;
|
||||
|
||||
void *
|
||||
sid_init(void)
|
||||
sid_init(uint8_t type)
|
||||
{
|
||||
#if 0
|
||||
psid_t *psid;
|
||||
#endif
|
||||
reSIDfp::SamplingMethod method = reSIDfp::RESAMPLE;
|
||||
float cycles_per_sec = 14318180.0 / 16.0;
|
||||
|
||||
psid = new psid_t;
|
||||
#if 0
|
||||
psid = (psid_t *) malloc(sizeof(sound_t));
|
||||
#endif
|
||||
psid = new psid_t;
|
||||
psid->sid = new SID;
|
||||
|
||||
psid->sid->setChipModel(reSIDfp::MOS6581);
|
||||
switch (type) {
|
||||
default:
|
||||
case 0:
|
||||
psid->sid->setChipModel(reSIDfp::MOS6581);
|
||||
case 1:
|
||||
psid->sid->setChipModel(reSIDfp::MOS8580);
|
||||
}
|
||||
|
||||
psid->sid->reset();
|
||||
|
||||
@@ -57,9 +57,6 @@ sid_init(void)
|
||||
void
|
||||
sid_close(UNUSED(void *priv))
|
||||
{
|
||||
#if 0
|
||||
psid_t *psid = (psid_t *) priv;
|
||||
#endif
|
||||
delete psid->sid;
|
||||
#if 0
|
||||
free(psid);
|
||||
@@ -69,10 +66,6 @@ sid_close(UNUSED(void *priv))
|
||||
void
|
||||
sid_reset(UNUSED(void *priv))
|
||||
{
|
||||
#if 0
|
||||
psid_t *psid = (psid_t *) priv;
|
||||
#endif
|
||||
|
||||
psid->sid->reset();
|
||||
|
||||
for (uint8_t c = 0; c < 32; c++)
|
||||
@@ -82,23 +75,12 @@ sid_reset(UNUSED(void *priv))
|
||||
uint8_t
|
||||
sid_read(uint16_t addr, UNUSED(void *priv))
|
||||
{
|
||||
#if 0
|
||||
psid_t *psid = (psid_t *) priv;
|
||||
#endif
|
||||
|
||||
return psid->sid->read(addr & 0x1f);
|
||||
#if 0
|
||||
return 0xFF;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
sid_write(uint16_t addr, uint8_t val, UNUSED(void *priv))
|
||||
{
|
||||
#if 0
|
||||
psid_t *psid = (psid_t *) priv;
|
||||
#endif
|
||||
|
||||
psid->sid->write(addr & 0x1f, val);
|
||||
}
|
||||
|
||||
@@ -116,9 +98,6 @@ fillbuf2(int &count, int16_t *buf, int len)
|
||||
void
|
||||
sid_fillbuf(int16_t *buf, int len, UNUSED(void *priv))
|
||||
{
|
||||
#if 0
|
||||
psid_t *psid = (psid_t *) priv;
|
||||
#endif
|
||||
int x = CLOCK_DELTA(len);
|
||||
|
||||
fillbuf2(x, buf, len);
|
||||
|
||||
@@ -21,6 +21,10 @@ typedef struct ssi2001_t {
|
||||
int gameport_enabled;
|
||||
} ssi2001_t;
|
||||
|
||||
typedef struct entertainer_t {
|
||||
uint8_t regs;
|
||||
} entertainer_t;
|
||||
|
||||
static void
|
||||
ssi2001_update(ssi2001_t *ssi2001)
|
||||
{
|
||||
@@ -69,7 +73,7 @@ ssi2001_init(UNUSED(const device_t *info))
|
||||
ssi2001_t *ssi2001 = malloc(sizeof(ssi2001_t));
|
||||
memset(ssi2001, 0, sizeof(ssi2001_t));
|
||||
|
||||
ssi2001->psid = sid_init();
|
||||
ssi2001->psid = sid_init(0);
|
||||
sid_reset(ssi2001->psid);
|
||||
uint16_t addr = device_get_config_hex16("base");
|
||||
ssi2001->gameport_enabled = device_get_config_int("gameport");
|
||||
@@ -90,6 +94,48 @@ ssi2001_close(void *priv)
|
||||
free(ssi2001);
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
entertainer_read(uint16_t addr, void *priv)
|
||||
{
|
||||
return 0xa5;
|
||||
}
|
||||
|
||||
static void
|
||||
entertainer_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
entertainer_t *entertainer = (entertainer_t *) priv;
|
||||
entertainer->regs = val;
|
||||
}
|
||||
|
||||
void *
|
||||
entertainer_init(UNUSED(const device_t *info))
|
||||
{
|
||||
ssi2001_t *ssi2001 = malloc(sizeof(ssi2001_t));
|
||||
entertainer_t *entertainer = malloc(sizeof(entertainer_t));
|
||||
memset(ssi2001, 0, sizeof(ssi2001_t));
|
||||
memset(entertainer, 0, sizeof(entertainer_t));
|
||||
|
||||
ssi2001->psid = sid_init(0);
|
||||
sid_reset(ssi2001->psid);
|
||||
ssi2001->gameport_enabled = device_get_config_int("gameport");
|
||||
io_sethandler(0x200, 0x0001, entertainer_read, NULL, NULL, entertainer_write, NULL, NULL, entertainer);
|
||||
io_sethandler(0x280, 0x0020, ssi2001_read, NULL, NULL, ssi2001_write, NULL, NULL, ssi2001);
|
||||
if (ssi2001->gameport_enabled)
|
||||
gameport_remap(gameport_add(&gameport_201_device), 0x201);
|
||||
sound_add_handler(ssi2001_get_buffer, ssi2001);
|
||||
return ssi2001;
|
||||
}
|
||||
|
||||
void
|
||||
entertainer_close(void *priv)
|
||||
{
|
||||
ssi2001_t *ssi2001 = (ssi2001_t *) priv;
|
||||
|
||||
sid_close(ssi2001->psid);
|
||||
|
||||
free(ssi2001);
|
||||
}
|
||||
|
||||
static const device_config_t ssi2001_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
@@ -125,16 +171,37 @@ static const device_config_t ssi2001_config[] = {
|
||||
// clang-format off
|
||||
};
|
||||
|
||||
const device_t ssi2001_device = {
|
||||
.name = "Innovation SSI-2001",
|
||||
.internal_name = "ssi2001",
|
||||
.flags = DEVICE_ISA,
|
||||
.local = 0,
|
||||
.init = ssi2001_init,
|
||||
.close = ssi2001_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = ssi2001_config
|
||||
static const device_config_t entertainer_config[] = {
|
||||
// clang-format off
|
||||
{ "gameport", "Enable Game port", CONFIG_BINARY, "", 1 },
|
||||
{ "", "", -1 }
|
||||
// clang-format off
|
||||
};
|
||||
|
||||
const device_t ssi2001_device = {
|
||||
.name = "Innovation SSI-2001",
|
||||
.internal_name = "ssi2001",
|
||||
.flags = DEVICE_ISA,
|
||||
.local = 0,
|
||||
.init = ssi2001_init,
|
||||
.close = ssi2001_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = ssi2001_config
|
||||
};
|
||||
|
||||
const device_t entertainer_device = {
|
||||
.name = "The Entertainer",
|
||||
.internal_name = "Entertainer",
|
||||
.flags = DEVICE_ISA,
|
||||
.local = 1,
|
||||
.init = entertainer_init,
|
||||
.close = entertainer_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = entertainer_config
|
||||
};
|
||||
|
||||
@@ -132,6 +132,7 @@ static const SOUND_CARD sound_cards[] = {
|
||||
{ &sb_vibra16s_device },
|
||||
{ &sb_vibra16xv_device },
|
||||
{ &ssi2001_device },
|
||||
{ &entertainer_device },
|
||||
{ &pasplus_device },
|
||||
{ &pas16_device },
|
||||
{ &pas16d_device },
|
||||
|
||||
@@ -1473,11 +1473,14 @@ void fm_engine_base<RegisterType>::assign_operators()
|
||||
template<class RegisterType>
|
||||
void fm_engine_base<RegisterType>::update_timer(uint32_t tnum, uint32_t enable, int32_t delta_clocks)
|
||||
{
|
||||
uint32_t subtract = !!(tnum >> 15);
|
||||
tnum &= 0x7fff;
|
||||
|
||||
// if the timer is live, but not currently enabled, set the timer
|
||||
if (enable && !m_timer_running[tnum])
|
||||
{
|
||||
// period comes from the registers, and is different for each
|
||||
uint32_t period = (tnum == 0) ? (1024 - m_regs.timer_a_value()) : 16 * (256 - m_regs.timer_b_value());
|
||||
uint32_t period = (tnum == 0) ? (1024 - subtract - m_regs.timer_a_value()) : 16 * (256 - subtract - m_regs.timer_b_value());
|
||||
|
||||
// caller can also specify a delta to account for other effects
|
||||
period += delta_clocks;
|
||||
@@ -1504,8 +1507,6 @@ void fm_engine_base<RegisterType>::update_timer(uint32_t tnum, uint32_t enable,
|
||||
template<class RegisterType>
|
||||
void fm_engine_base<RegisterType>::engine_timer_expired(uint32_t tnum)
|
||||
{
|
||||
assert(tnum == 0 || tnum == 1);
|
||||
|
||||
// update status
|
||||
if (tnum == 0 && m_regs.enable_timer_a())
|
||||
set_reset_status(STATUS_TIMERA, 0);
|
||||
@@ -1521,8 +1522,11 @@ void fm_engine_base<RegisterType>::engine_timer_expired(uint32_t tnum)
|
||||
m_modified_channels |= 1 << chnum;
|
||||
}
|
||||
|
||||
// reset
|
||||
m_timer_running[tnum] = false;
|
||||
// Make sure the array does not go out of bounds to keep gcc happy
|
||||
if ((tnum < 2) || (sizeof(m_timer_running) > (2 * sizeof(uint8_t)))) {
|
||||
// reset
|
||||
m_timer_running[tnum] = false;
|
||||
}
|
||||
update_timer(tnum, 1, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user