mirror of
https://github.com/86Box/86Box.git
synced 2026-02-27 17:34:25 -07:00
Merge branch 'master' of ssh://github.com/86Box/86Box
This commit is contained in:
@@ -157,8 +157,7 @@ midi_out_device_init(void)
|
||||
void
|
||||
midi_out_init(midi_device_t *device)
|
||||
{
|
||||
midi_out = (midi_t *) malloc(sizeof(midi_t));
|
||||
memset(midi_out, 0, sizeof(midi_t));
|
||||
midi_out = (midi_t *) calloc(1, sizeof(midi_t));
|
||||
|
||||
midi_out->m_out_device = device;
|
||||
}
|
||||
@@ -166,8 +165,7 @@ midi_out_init(midi_device_t *device)
|
||||
void
|
||||
midi_in_init(midi_device_t *device, midi_t **mididev)
|
||||
{
|
||||
*mididev = (midi_t *) malloc(sizeof(midi_t));
|
||||
memset(*mididev, 0, sizeof(midi_t));
|
||||
*mididev = (midi_t *) calloc(1, sizeof(midi_t));
|
||||
|
||||
(*mididev)->m_in_device = device;
|
||||
}
|
||||
@@ -394,8 +392,7 @@ midi_in_handler(int set, void (*msg)(void *priv, uint8_t *msg, uint32_t len), in
|
||||
if ((mih_first != NULL) && (mih_last == NULL))
|
||||
fatal("First MIDI IN handler present with no last MIDI IN handler\n");
|
||||
|
||||
temp = (midi_in_handler_t *) malloc(sizeof(midi_in_handler_t));
|
||||
memset(temp, 0, sizeof(midi_in_handler_t));
|
||||
temp = (midi_in_handler_t *) calloc(1, sizeof(midi_in_handler_t));
|
||||
temp->msg = msg;
|
||||
temp->sysex = sysex;
|
||||
temp->priv = priv;
|
||||
|
||||
@@ -262,8 +262,7 @@ fluidsynth_init(UNUSED(const device_t *info))
|
||||
|
||||
al_set_midi(data->samplerate, data->buf_size);
|
||||
|
||||
dev = malloc(sizeof(midi_device_t));
|
||||
memset(dev, 0, sizeof(midi_device_t));
|
||||
dev = calloc(1, sizeof(midi_device_t));
|
||||
|
||||
dev->play_msg = fluidsynth_msg;
|
||||
dev->play_sysex = fluidsynth_sysex;
|
||||
|
||||
@@ -298,8 +298,7 @@ mt32emu_init(char *control_rom, char *pcm_rom)
|
||||
|
||||
al_set_midi(samplerate, buf_size);
|
||||
|
||||
dev = malloc(sizeof(midi_device_t));
|
||||
memset(dev, 0, sizeof(midi_device_t));
|
||||
dev = calloc(1, sizeof(midi_device_t));
|
||||
|
||||
dev->play_msg = mt32_msg;
|
||||
dev->play_sysex = mt32_sysex;
|
||||
|
||||
@@ -557,7 +557,7 @@ program_change(uint8_t midi_channel, uint8_t program, opl4_midi_t *opl4_midi)
|
||||
}
|
||||
|
||||
static void
|
||||
opl4_midi_thread(void *arg)
|
||||
opl4_midi_thread(UNUSED(void *arg))
|
||||
{
|
||||
opl4_midi_t *opl4_midi = opl4_midi_cur;
|
||||
uint32_t i = 0;
|
||||
@@ -648,18 +648,18 @@ opl4_midi_msg(uint8_t *val)
|
||||
}
|
||||
|
||||
void
|
||||
opl4_midi_sysex(uint8_t *data, unsigned int len)
|
||||
opl4_midi_sysex(UNUSED(uint8_t *data), UNUSED(unsigned int len))
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
void *
|
||||
opl4_init(const device_t *info)
|
||||
opl4_init(UNUSED(const device_t *info))
|
||||
{
|
||||
midi_device_t *dev;
|
||||
extern void al_set_midi(int freq, int buf_size);
|
||||
|
||||
dev = malloc(sizeof(midi_device_t));
|
||||
memset(dev, 0, sizeof(midi_device_t));
|
||||
dev = calloc(1, sizeof(midi_device_t));
|
||||
|
||||
dev->play_msg = opl4_midi_msg;
|
||||
dev->play_sysex = opl4_midi_sysex;
|
||||
|
||||
@@ -73,8 +73,7 @@ rtmidi_play_sysex(uint8_t *sysex, unsigned int len)
|
||||
void *
|
||||
rtmidi_output_init(UNUSED(const device_t *info))
|
||||
{
|
||||
midi_device_t *dev = (midi_device_t *) malloc(sizeof(midi_device_t));
|
||||
memset(dev, 0, sizeof(midi_device_t));
|
||||
midi_device_t *dev = (midi_device_t *) calloc(1, sizeof(midi_device_t));
|
||||
|
||||
dev->play_msg = rtmidi_play_msg;
|
||||
dev->play_sysex = rtmidi_play_sysex;
|
||||
@@ -156,8 +155,7 @@ rtmidi_input_callback(UNUSED(double timeStamp), std::vector<unsigned char> *mess
|
||||
void *
|
||||
rtmidi_input_init(UNUSED(const device_t *info))
|
||||
{
|
||||
midi_device_t *dev = (midi_device_t *) malloc(sizeof(midi_device_t));
|
||||
memset(dev, 0, sizeof(midi_device_t));
|
||||
midi_device_t *dev = (midi_device_t *) calloc(1, sizeof(midi_device_t));
|
||||
|
||||
try {
|
||||
if (!midiin)
|
||||
|
||||
@@ -577,8 +577,7 @@ ac97_codec_getrate(void *priv, uint8_t reg)
|
||||
static void *
|
||||
ac97_codec_init(const device_t *info)
|
||||
{
|
||||
ac97_codec_t *dev = malloc(sizeof(ac97_codec_t));
|
||||
memset(dev, 0, sizeof(ac97_codec_t));
|
||||
ac97_codec_t *dev = calloc(1, sizeof(ac97_codec_t));
|
||||
|
||||
for (; dev->model < (sizeof(ac97_codecs) / sizeof(ac97_codecs[0])); dev->model++) {
|
||||
if (ac97_codecs[dev->model].device->local == info->local)
|
||||
|
||||
@@ -787,8 +787,7 @@ ac97_via_speed_changed(void *priv)
|
||||
static void *
|
||||
ac97_via_init(UNUSED(const device_t *info))
|
||||
{
|
||||
ac97_via_t *dev = malloc(sizeof(ac97_via_t));
|
||||
memset(dev, 0, sizeof(ac97_via_t));
|
||||
ac97_via_t *dev = calloc(1, sizeof(ac97_via_t));
|
||||
|
||||
ac97_via_log("AC97 VIA: init()\n");
|
||||
|
||||
|
||||
@@ -103,8 +103,7 @@ adlib_mca_feedb(void *priv)
|
||||
void *
|
||||
adlib_init(UNUSED(const device_t *info))
|
||||
{
|
||||
adlib_t *adlib = malloc(sizeof(adlib_t));
|
||||
memset(adlib, 0, sizeof(adlib_t));
|
||||
adlib_t *adlib = calloc(1, sizeof(adlib_t));
|
||||
|
||||
adlib_log("adlib_init\n");
|
||||
fm_driver_get(FM_YM3812, &adlib->opl);
|
||||
|
||||
@@ -1066,8 +1066,7 @@ adgold_init(UNUSED(const device_t *info))
|
||||
FILE *fp;
|
||||
int c;
|
||||
double out;
|
||||
adgold_t *adgold = malloc(sizeof(adgold_t));
|
||||
memset(adgold, 0, sizeof(adgold_t));
|
||||
adgold_t *adgold = calloc(1, sizeof(adgold_t));
|
||||
|
||||
adgold->dma = device_get_config_int("dma");
|
||||
adgold->irq = device_get_config_int("irq");
|
||||
|
||||
@@ -2645,8 +2645,7 @@ static void es137x_speed_changed(void *priv);
|
||||
static void *
|
||||
es1370_init(const device_t *info)
|
||||
{
|
||||
es137x_t *dev = malloc(sizeof(es137x_t));
|
||||
memset(dev, 0x00, sizeof(es137x_t));
|
||||
es137x_t *dev = calloc(1, sizeof(es137x_t));
|
||||
dev->type = info->local;
|
||||
|
||||
if (device_get_config_int("receive_input"))
|
||||
@@ -2689,8 +2688,7 @@ es1370_init(const device_t *info)
|
||||
static void *
|
||||
es1371_init(const device_t *info)
|
||||
{
|
||||
es137x_t *dev = malloc(sizeof(es137x_t));
|
||||
memset(dev, 0x00, sizeof(es137x_t));
|
||||
es137x_t *dev = calloc(1, sizeof(es137x_t));
|
||||
dev->type = info->local & 0xffffff00;
|
||||
|
||||
if (device_get_config_int("receive_input"))
|
||||
|
||||
@@ -974,8 +974,7 @@ azt_init(const device_t *info)
|
||||
int loaded_from_eeprom = 0;
|
||||
uint16_t addr_setting;
|
||||
uint8_t read_eeprom[AZTECH_EEPROM_SIZE];
|
||||
azt2316a_t *azt2316a = malloc(sizeof(azt2316a_t));
|
||||
memset(azt2316a, 0, sizeof(azt2316a_t));
|
||||
azt2316a_t *azt2316a = calloc(1, sizeof(azt2316a_t));
|
||||
|
||||
azt2316a->type = info->local;
|
||||
|
||||
@@ -1226,8 +1225,7 @@ azt_init(const device_t *info)
|
||||
2x4 to 2x5 -> Mixer interface
|
||||
2x6, 2xA, 2xC, 2xE -> DSP chip
|
||||
2x8, 2x9, 388 and 389 FM chip (9 voices).*/
|
||||
azt2316a->sb = malloc(sizeof(sb_t));
|
||||
memset(azt2316a->sb, 0, sizeof(sb_t));
|
||||
azt2316a->sb = calloc(1, sizeof(sb_t));
|
||||
|
||||
azt2316a->sb->opl_enabled = device_get_config_int("opl");
|
||||
|
||||
@@ -1259,8 +1257,7 @@ azt_init(const device_t *info)
|
||||
sound_set_cd_audio_filter(sbpro_filter_cd_audio, azt2316a->sb);
|
||||
|
||||
if (azt2316a->cur_mpu401_enabled) {
|
||||
azt2316a->mpu = (mpu_t *) malloc(sizeof(mpu_t));
|
||||
memset(azt2316a->mpu, 0, sizeof(mpu_t));
|
||||
azt2316a->mpu = (mpu_t *) calloc(1, sizeof(mpu_t));
|
||||
mpu401_init(azt2316a->mpu, azt2316a->cur_mpu401_addr, azt2316a->cur_mpu401_irq, M_UART, device_get_config_int("receive_input401"));
|
||||
} else
|
||||
azt2316a->mpu = NULL;
|
||||
|
||||
@@ -1434,8 +1434,7 @@ cmi8x38_reset(void *priv)
|
||||
static void *
|
||||
cmi8x38_init(const device_t *info)
|
||||
{
|
||||
cmi8x38_t *dev = malloc(sizeof(cmi8x38_t));
|
||||
memset(dev, 0, sizeof(cmi8x38_t));
|
||||
cmi8x38_t *dev = calloc(1, sizeof(cmi8x38_t));
|
||||
|
||||
/* Set the chip type. */
|
||||
if ((info->local == CMEDIA_CMI8738_6CH) && !device_get_config_int("six_channel"))
|
||||
|
||||
@@ -181,8 +181,7 @@ cms_read(uint16_t addr, void *priv)
|
||||
void *
|
||||
cms_init(UNUSED(const device_t *info))
|
||||
{
|
||||
cms_t *cms = malloc(sizeof(cms_t));
|
||||
memset(cms, 0, sizeof(cms_t));
|
||||
cms_t *cms = calloc(1, sizeof(cms_t));
|
||||
|
||||
uint16_t addr = device_get_config_hex16("base");
|
||||
io_sethandler(addr, 0x0010, cms_read, NULL, NULL, cms_write, NULL, NULL, cms);
|
||||
|
||||
@@ -475,10 +475,9 @@ cs423x_slam_write(UNUSED(uint16_t addr), uint8_t val, void *priv)
|
||||
if (dev->slam_config)
|
||||
cs423x_pnp_config_changed(dev->slam_ld, dev->slam_config, dev);
|
||||
else
|
||||
dev->slam_config = (isapnp_device_config_t *) malloc(sizeof(isapnp_device_config_t));
|
||||
dev->slam_config = (isapnp_device_config_t *) calloc(1, sizeof(isapnp_device_config_t));
|
||||
|
||||
/* Start new logical device. */
|
||||
memset(dev->slam_config, 0, sizeof(isapnp_device_config_t));
|
||||
dev->slam_ld = val;
|
||||
break;
|
||||
|
||||
@@ -853,8 +852,7 @@ cs423x_reset(void *priv)
|
||||
static void *
|
||||
cs423x_init(const device_t *info)
|
||||
{
|
||||
cs423x_t *dev = malloc(sizeof(cs423x_t));
|
||||
memset(dev, 0, sizeof(cs423x_t));
|
||||
cs423x_t *dev = calloc(1, sizeof(cs423x_t));
|
||||
|
||||
/* Initialize model-specific data. */
|
||||
dev->type = info->local & 0xff;
|
||||
|
||||
@@ -328,7 +328,7 @@ emu8k_log(const char *fmt, ...)
|
||||
static inline int16_t
|
||||
EMU8K_READ(emu8k_t *emu8k, uint32_t addr)
|
||||
{
|
||||
const register emu8k_mem_pointers_t addrmem = { { addr } };
|
||||
register const emu8k_mem_pointers_t addrmem = { { addr } };
|
||||
return emu8k->ram_pointers[addrmem.hb_address][addrmem.lw_address];
|
||||
}
|
||||
|
||||
@@ -2171,8 +2171,7 @@ emu8k_init(emu8k_t *emu8k, uint16_t emu_addr, int onboard_ram)
|
||||
emu8k->rom[0x7ffff] = 0;
|
||||
}
|
||||
|
||||
emu8k->empty = malloc(2 * BLOCK_SIZE_WORDS);
|
||||
memset(emu8k->empty, 0, 2 * BLOCK_SIZE_WORDS);
|
||||
emu8k->empty = calloc(2, BLOCK_SIZE_WORDS);
|
||||
|
||||
int j = 0;
|
||||
for (; j < 0x8; j++) {
|
||||
@@ -2186,8 +2185,7 @@ emu8k_init(emu8k_t *emu8k, uint16_t emu_addr, int onboard_ram)
|
||||
/*Clip to 28MB, since that's the max that we can address. */
|
||||
if (onboard_ram > 0x7000)
|
||||
onboard_ram = 0x7000;
|
||||
emu8k->ram = malloc(onboard_ram * 1024);
|
||||
memset(emu8k->ram, 0, onboard_ram * 1024);
|
||||
emu8k->ram = calloc(1024, onboard_ram);
|
||||
const int i_end = onboard_ram >> 7;
|
||||
int i = 0;
|
||||
for (; i < i_end; i++, j++) {
|
||||
|
||||
@@ -1348,12 +1348,10 @@ gus_init(UNUSED(const device_t *info))
|
||||
int c;
|
||||
double out = 1.0;
|
||||
uint8_t gus_ram = device_get_config_int("gus_ram");
|
||||
gus_t *gus = malloc(sizeof(gus_t));
|
||||
memset(gus, 0x00, sizeof(gus_t));
|
||||
gus_t *gus = calloc(1, sizeof(gus_t));
|
||||
|
||||
gus->gus_end_ram = 1 << (18 + gus_ram);
|
||||
gus->ram = (uint8_t *) malloc(gus->gus_end_ram);
|
||||
memset(gus->ram, 0x00, (gus->gus_end_ram));
|
||||
gus->ram = (uint8_t *) calloc(1, gus->gus_end_ram);
|
||||
|
||||
for (c = 0; c < 32; c++) {
|
||||
gus->ctrl[c] = 1;
|
||||
|
||||
@@ -82,8 +82,7 @@ dac_get_buffer(int32_t *buffer, int len, void *priv)
|
||||
static void *
|
||||
dac_init(void *lpt)
|
||||
{
|
||||
lpt_dac_t *lpt_dac = malloc(sizeof(lpt_dac_t));
|
||||
memset(lpt_dac, 0, sizeof(lpt_dac_t));
|
||||
lpt_dac_t *lpt_dac = calloc(1, sizeof(lpt_dac_t));
|
||||
|
||||
lpt_dac->lpt = lpt;
|
||||
|
||||
|
||||
@@ -115,8 +115,7 @@ dss_callback(void *priv)
|
||||
static void *
|
||||
dss_init(void *lpt)
|
||||
{
|
||||
dss_t *dss = malloc(sizeof(dss_t));
|
||||
memset(dss, 0, sizeof(dss_t));
|
||||
dss_t *dss = calloc(1, sizeof(dss_t));
|
||||
|
||||
dss->lpt = lpt;
|
||||
|
||||
|
||||
@@ -124,8 +124,7 @@ opl2board_device_mca_feedb(void *priv)
|
||||
void *
|
||||
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_t *serial = calloc(1, sizeof(opl2board_device_t));
|
||||
|
||||
opl2board_device_log("opl2board_device_init\n");
|
||||
fm_driver_get(FM_OPL2BOARD, &serial->opl);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/snd_opl.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#define RSM_FRAC 10
|
||||
|
||||
@@ -175,7 +176,7 @@ esfm_drv_set_do_cycles(void *priv, int8_t do_cycles)
|
||||
}
|
||||
|
||||
static void *
|
||||
esfm_drv_init(const device_t *info)
|
||||
esfm_drv_init(UNUSED(const device_t *info))
|
||||
{
|
||||
esfm_drv_t *dev = (esfm_drv_t *) calloc(1, sizeof(esfm_drv_t));
|
||||
dev->flags = FLAG_CYCLES | FLAG_OPL3;
|
||||
|
||||
@@ -419,8 +419,7 @@ optimc_init(const device_t *info)
|
||||
music_add_handler(sb_get_music_buffer_sbpro, optimc->sb);
|
||||
sound_set_cd_audio_filter(sbpro_filter_cd_audio, optimc->sb); /* CD audio filter for the default context */
|
||||
|
||||
optimc->mpu = (mpu_t *) malloc(sizeof(mpu_t));
|
||||
memset(optimc->mpu, 0, sizeof(mpu_t));
|
||||
optimc->mpu = (mpu_t *) calloc(1, sizeof(mpu_t));
|
||||
mpu401_init(optimc->mpu, optimc->cur_mpu401_addr, optimc->cur_mpu401_irq, M_UART, device_get_config_int("receive_input401"));
|
||||
|
||||
if (device_get_config_int("receive_input"))
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
* Copyright 2008-2024 Sarah Walker.
|
||||
* Copyright 2024 Miran Grca.
|
||||
*/
|
||||
#define _USE_MATH_DEFINES
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
@@ -706,6 +706,7 @@ static uint8_t
|
||||
pas16_in(uint16_t port, void *priv)
|
||||
{
|
||||
pas16_t *pas16 = (pas16_t *) priv;
|
||||
scsi_bus_t *scsi_bus = NULL;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
port -= pas16->base;
|
||||
@@ -784,9 +785,11 @@ pas16_in(uint16_t port, void *priv)
|
||||
ret = t128_read(0x1e00, pas16->scsi);
|
||||
break;
|
||||
case 0x5c01:
|
||||
if (pas16->has_scsi)
|
||||
if (pas16->has_scsi) {
|
||||
scsi_bus = &pas16->scsi->ncr.scsibus;
|
||||
/* Bits 0-6 must absolutely be set for SCSI hard disk drivers to work. */
|
||||
ret = (((pas16->scsi->ncr.dma_mode != DMA_IDLE) && (pas16->scsi->status & 0x04)) << 7) | 0x7f;
|
||||
ret = (((scsi_bus->tx_mode != PIO_TX_BUS) && (pas16->scsi->status & 0x04)) << 7) | 0x7f;
|
||||
}
|
||||
break;
|
||||
case 0x5c03:
|
||||
if (pas16->has_scsi)
|
||||
@@ -1183,10 +1186,11 @@ pas16_scsi_callback(void *priv)
|
||||
{
|
||||
pas16_t * pas16 = (pas16_t *) priv;
|
||||
t128_t * dev = pas16->scsi;
|
||||
scsi_bus_t * scsi_bus = &dev->ncr.scsibus;
|
||||
|
||||
t128_callback(pas16->scsi);
|
||||
|
||||
if ((dev->ncr.dma_mode != DMA_IDLE) && (dev->status & 0x04)) {
|
||||
if ((scsi_bus->tx_mode != PIO_TX_BUS) && (dev->status & 0x04)) {
|
||||
timer_stop(&pas16->scsi_timer);
|
||||
pas16->timeout_status &= 0x7f;
|
||||
}
|
||||
@@ -1667,7 +1671,7 @@ pas16_out(uint16_t port, uint8_t val, void *priv)
|
||||
- A 16-bit sample always takes two ctr_clock() ticks.
|
||||
*/
|
||||
static uint16_t
|
||||
pas16_dma_channel_read(pas16_t *pas16, int channel)
|
||||
pas16_dma_channel_read(pas16_t *pas16, UNUSED(int channel))
|
||||
{
|
||||
int status;
|
||||
uint16_t ret;
|
||||
@@ -2316,8 +2320,7 @@ pas16_init(const device_t *info)
|
||||
fm_driver_get(FM_YMF262, &pas16->opl);
|
||||
sb_dsp_set_real_opl(&pas16->dsp, 1);
|
||||
sb_dsp_init(&pas16->dsp, SB_DSP_201, SB_SUBTYPE_DEFAULT, pas16);
|
||||
pas16->mpu = (mpu_t *) malloc(sizeof(mpu_t));
|
||||
memset(pas16->mpu, 0, sizeof(mpu_t));
|
||||
pas16->mpu = (mpu_t *) calloc(1, sizeof(mpu_t));
|
||||
mpu401_init(pas16->mpu, 0, 0, M_UART, device_get_config_int("receive_input401"));
|
||||
sb_dsp_set_mpu(&pas16->dsp, pas16->mpu);
|
||||
|
||||
|
||||
@@ -166,8 +166,7 @@ ps1snd_get_buffer(int32_t *buffer, int len, void *priv)
|
||||
static void *
|
||||
ps1snd_init(UNUSED(const device_t *info))
|
||||
{
|
||||
ps1snd_t *ps1snd = malloc(sizeof(ps1snd_t));
|
||||
memset(ps1snd, 0x00, sizeof(ps1snd_t));
|
||||
ps1snd_t *ps1snd = calloc(1, sizeof(ps1snd_t));
|
||||
|
||||
sn76489_init(&ps1snd->sn76489, 0x0205, 0x0001, SN76496, 4000000);
|
||||
|
||||
|
||||
@@ -193,8 +193,7 @@ pssj_get_buffer(int32_t *buffer, int len, void *priv)
|
||||
void *
|
||||
pssj_init(UNUSED(const device_t *info))
|
||||
{
|
||||
pssj_t *pssj = malloc(sizeof(pssj_t));
|
||||
memset(pssj, 0, sizeof(pssj_t));
|
||||
pssj_t *pssj = calloc(1, sizeof(pssj_t));
|
||||
|
||||
sn76489_init(&pssj->sn76489, 0x00c0, 0x0004, PSSJ, 3579545);
|
||||
|
||||
@@ -208,8 +207,7 @@ pssj_init(UNUSED(const device_t *info))
|
||||
void *
|
||||
pssj_1e0_init(UNUSED(const device_t *info))
|
||||
{
|
||||
pssj_t *pssj = malloc(sizeof(pssj_t));
|
||||
memset(pssj, 0, sizeof(pssj_t));
|
||||
pssj_t *pssj = calloc(1, sizeof(pssj_t));
|
||||
|
||||
sn76489_init(&pssj->sn76489, 0x01e0, 0x0004, PSSJ, 3579545);
|
||||
|
||||
@@ -223,8 +221,7 @@ pssj_1e0_init(UNUSED(const device_t *info))
|
||||
void *
|
||||
pssj_isa_init(UNUSED(const device_t *info))
|
||||
{
|
||||
pssj_t *pssj = malloc(sizeof(pssj_t));
|
||||
memset(pssj, 0, sizeof(pssj_t));
|
||||
pssj_t *pssj = calloc(1, sizeof(pssj_t));
|
||||
|
||||
uint16_t addr = device_get_config_hex16("base");
|
||||
|
||||
|
||||
@@ -87,10 +87,10 @@ sid_write(uint16_t addr, uint8_t val, UNUSED(void *priv))
|
||||
#define CLOCK_DELTA(n) (int) (((14318180.0 * n) / 16.0) / (float) RESID_FREQ)
|
||||
|
||||
static void
|
||||
fillbuf2(int &count, int16_t *buf, int len)
|
||||
fillbuf2(int &count, int16_t *buf, UNUSED(int len))
|
||||
{
|
||||
int c;
|
||||
c = psid->sid->clock(count, buf);
|
||||
int c = psid->sid->clock(count, buf);
|
||||
|
||||
if (!c)
|
||||
*buf = psid->last_sample;
|
||||
psid->last_sample = *buf;
|
||||
|
||||
@@ -1417,7 +1417,7 @@ sb_ct1745_mixer_reset(sb_t *sb)
|
||||
}
|
||||
|
||||
static void
|
||||
ess_base_write(uint16_t addr, uint8_t val, void *priv)
|
||||
ess_base_write(uint16_t addr, UNUSED(uint8_t val), void *priv)
|
||||
{
|
||||
sb_t *ess = (sb_t *) priv;
|
||||
|
||||
@@ -1463,7 +1463,7 @@ ess_base_read(uint16_t addr, void *priv)
|
||||
}
|
||||
|
||||
static void
|
||||
ess_fm_midi_write(uint16_t addr, uint8_t val, void *priv)
|
||||
ess_fm_midi_write(UNUSED(uint16_t addr), UNUSED(uint8_t val), void *priv)
|
||||
{
|
||||
sb_t *ess = (sb_t *) priv;
|
||||
|
||||
@@ -1471,7 +1471,7 @@ ess_fm_midi_write(uint16_t addr, uint8_t val, void *priv)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
ess_fm_midi_read(uint16_t addr, void *priv)
|
||||
ess_fm_midi_read(UNUSED(uint16_t addr), void *priv)
|
||||
{
|
||||
sb_t *ess = (sb_t *) priv;
|
||||
|
||||
@@ -5913,7 +5913,7 @@ const device_t sb_16_pnp_device = {
|
||||
.init = sb_16_pnp_init,
|
||||
.close = sb_close,
|
||||
.reset = NULL,
|
||||
{ .available = sb_16_pnp_noide_available },
|
||||
.available = sb_16_pnp_noide_available,
|
||||
.speed_changed = sb_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = sb_16_pnp_config
|
||||
@@ -6039,7 +6039,7 @@ const device_t sb_awe64_device = {
|
||||
.init = sb_awe32_pnp_init,
|
||||
.close = sb_awe32_close,
|
||||
.reset = NULL,
|
||||
{ .available = sb_awe64_noide_available },
|
||||
.available = sb_awe64_noide_available,
|
||||
.speed_changed = sb_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = sb_awe64_config
|
||||
|
||||
@@ -228,8 +228,7 @@ sn76489_init(sn76489_t *sn76489, uint16_t base, uint16_t size, int type, int fre
|
||||
void *
|
||||
sn76489_device_init(UNUSED(const device_t *info))
|
||||
{
|
||||
sn76489_t *sn76489 = malloc(sizeof(sn76489_t));
|
||||
memset(sn76489, 0, sizeof(sn76489_t));
|
||||
sn76489_t *sn76489 = calloc(1, sizeof(sn76489_t));
|
||||
|
||||
sn76489_init(sn76489, 0x00c0, 0x0008, SN76496, 3579545);
|
||||
|
||||
@@ -239,8 +238,7 @@ sn76489_device_init(UNUSED(const device_t *info))
|
||||
void *
|
||||
ncr8496_device_init(UNUSED(const device_t *info))
|
||||
{
|
||||
sn76489_t *sn76489 = malloc(sizeof(sn76489_t));
|
||||
memset(sn76489, 0, sizeof(sn76489_t));
|
||||
sn76489_t *sn76489 = calloc(1, sizeof(sn76489_t));
|
||||
|
||||
sn76489_init(sn76489, 0x00c0, 0x0008, NCR8496, 3579545);
|
||||
|
||||
@@ -250,8 +248,7 @@ ncr8496_device_init(UNUSED(const device_t *info))
|
||||
void *
|
||||
tndy_device_init(UNUSED(const device_t *info))
|
||||
{
|
||||
sn76489_t *sn76489 = malloc(sizeof(sn76489_t));
|
||||
memset(sn76489, 0, sizeof(sn76489_t));
|
||||
sn76489_t *sn76489 = calloc(1, sizeof(sn76489_t));
|
||||
|
||||
uint16_t addr = device_get_config_hex16("base");
|
||||
|
||||
|
||||
@@ -70,8 +70,7 @@ ssi2001_write(uint16_t addr, uint8_t val, void *priv)
|
||||
void *
|
||||
ssi2001_init(UNUSED(const device_t *info))
|
||||
{
|
||||
ssi2001_t *ssi2001 = malloc(sizeof(ssi2001_t));
|
||||
memset(ssi2001, 0, sizeof(ssi2001_t));
|
||||
ssi2001_t *ssi2001 = calloc(1, sizeof(ssi2001_t));
|
||||
|
||||
ssi2001->psid = sid_init(0);
|
||||
sid_reset(ssi2001->psid);
|
||||
@@ -95,13 +94,13 @@ ssi2001_close(void *priv)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
entertainer_read(uint16_t addr, void *priv)
|
||||
entertainer_read(UNUSED(uint16_t addr), UNUSED(void *priv))
|
||||
{
|
||||
return 0xa5;
|
||||
}
|
||||
|
||||
static void
|
||||
entertainer_write(uint16_t addr, uint8_t val, void *priv)
|
||||
entertainer_write(UNUSED(uint16_t addr), uint8_t val, void *priv)
|
||||
{
|
||||
entertainer_t *entertainer = (entertainer_t *) priv;
|
||||
entertainer->regs = val;
|
||||
@@ -110,10 +109,8 @@ entertainer_write(uint16_t addr, uint8_t val, void *priv)
|
||||
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_t *ssi2001 = calloc(1, sizeof(ssi2001_t));
|
||||
entertainer_t *entertainer = calloc(1, sizeof(entertainer_t));
|
||||
|
||||
ssi2001->psid = sid_init(0);
|
||||
sid_reset(ssi2001->psid);
|
||||
@@ -166,15 +163,27 @@ static const device_config_t ssi2001_config[] = {
|
||||
{ .description = "" }
|
||||
}
|
||||
},
|
||||
{ "gameport", "Enable Game port", CONFIG_BINARY, "", 1 },
|
||||
{ "", "", -1 }
|
||||
{
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_int = 1
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format off
|
||||
};
|
||||
|
||||
static const device_config_t entertainer_config[] = {
|
||||
// clang-format off
|
||||
{ "gameport", "Enable Game port", CONFIG_BINARY, "", 1 },
|
||||
{ "", "", -1 }
|
||||
{
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_int = 1
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format off
|
||||
};
|
||||
|
||||
|
||||
@@ -107,8 +107,7 @@ wss_get_music_buffer(int32_t *buffer, int len, void *priv)
|
||||
void *
|
||||
wss_init(UNUSED(const device_t *info))
|
||||
{
|
||||
wss_t *wss = malloc(sizeof(wss_t));
|
||||
memset(wss, 0, sizeof(wss_t));
|
||||
wss_t *wss = calloc(1, sizeof(wss_t));
|
||||
|
||||
uint16_t addr = device_get_config_hex16("base");
|
||||
wss->opl_enabled = device_get_config_int("opl");
|
||||
@@ -209,8 +208,7 @@ ncr_audio_mca_feedb(void *priv)
|
||||
void *
|
||||
ncr_audio_init(UNUSED(const device_t *info))
|
||||
{
|
||||
wss_t *wss = malloc(sizeof(wss_t));
|
||||
memset(wss, 0, sizeof(wss_t));
|
||||
wss_t *wss = calloc(1, sizeof(wss_t));
|
||||
|
||||
fm_driver_get(FM_YMF262, &wss->opl);
|
||||
ad1848_init(&wss->ad1848, AD1848_TYPE_DEFAULT);
|
||||
|
||||
Reference in New Issue
Block a user