Merge pull request #3832 from lemondrops/master
Consistency cleanups and warning fixes
This commit is contained in:
@@ -707,7 +707,7 @@ extern int machine_at_aurora_init(const machine_t *);
|
||||
extern int machine_at_686nx_init(const machine_t *);
|
||||
extern int machine_at_acerv60n_init(const machine_t *);
|
||||
extern int machine_at_vs440fx_init(const machine_t *);
|
||||
extern int machine_at_GW2KVenus_init(const machine_t *);
|
||||
extern int machine_at_gw2kvenus_init(const machine_t *);
|
||||
extern int machine_at_ap440fx_init(const machine_t *);
|
||||
extern int machine_at_mb600n_init(const machine_t *);
|
||||
extern int machine_at_8600ttc_init(const machine_t *);
|
||||
|
@@ -196,15 +196,15 @@ machine_at_vs440fx_init(const machine_t *model)
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_GW2KVenus_init(const machine_t *model)
|
||||
machine_at_gw2kvenus_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined2("roms/machines/GW2KVenus/1011CS1T.BIO",
|
||||
"roms/machines/GW2KVenus/1011CS1T.BI1",
|
||||
"roms/machines/GW2KVenus/1011CS1T.BI2",
|
||||
"roms/machines/GW2KVenus/1011CS1T.BI3",
|
||||
"roms/machines/GW2KVenus/1011CS1T.RCV",
|
||||
ret = bios_load_linear_combined2("roms/machines/gw2kvenus/1011CS1T.BIO",
|
||||
"roms/machines/gw2kvenus/1011CS1T.BI1",
|
||||
"roms/machines/gw2kvenus/1011CS1T.BI2",
|
||||
"roms/machines/gw2kvenus/1011CS1T.BI3",
|
||||
"roms/machines/gw2kvenus/1011CS1T.RCV",
|
||||
0x3a000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
|
@@ -8362,8 +8362,9 @@ const machine_t machines[] = {
|
||||
},
|
||||
.nvrmask = 127,
|
||||
.kbc_device = NULL,
|
||||
.kbc_p1 = 0,
|
||||
.gpio = 0,
|
||||
.kbc_p1 = 0xff,
|
||||
.gpio = 0xffffffff,
|
||||
.gpio_acpi = 0xffffffff,
|
||||
.device = NULL,
|
||||
.fdc_device = NULL,
|
||||
.sio_device = NULL,
|
||||
@@ -10737,8 +10738,9 @@ const machine_t machines[] = {
|
||||
},
|
||||
.nvrmask = 255,
|
||||
.kbc_device = NULL,
|
||||
.kbc_p1 = 0,
|
||||
.gpio = 0,
|
||||
.kbc_p1 = 0xff,
|
||||
.gpio = 0xffffffff,
|
||||
.gpio_acpi = 0xffffffff,
|
||||
.device = NULL,
|
||||
.fdc_device = NULL,
|
||||
.sio_device = NULL,
|
||||
@@ -11738,10 +11740,10 @@ const machine_t machines[] = {
|
||||
/* It's a Intel VS440FX with a Gateway 2000 OEM BIOS */
|
||||
{
|
||||
.name = "[i440FX] Gateway 2000 Venus",
|
||||
.internal_name = "GW2KVenus",
|
||||
.internal_name = "gw2kvenus",
|
||||
.type = MACHINE_TYPE_SOCKET8,
|
||||
.chipset = MACHINE_CHIPSET_INTEL_440FX,
|
||||
.init = machine_at_GW2KVenus_init,
|
||||
.init = machine_at_gw2kvenus_init,
|
||||
.p1_handler = NULL,
|
||||
.gpio_handler = NULL,
|
||||
.available_flag = MACHINE_AVAILABLE,
|
||||
@@ -11765,8 +11767,9 @@ const machine_t machines[] = {
|
||||
},
|
||||
.nvrmask = 127,
|
||||
.kbc_device = NULL,
|
||||
.kbc_p1 = 0,
|
||||
.gpio = 0,
|
||||
.kbc_p1 = 0xff,
|
||||
.gpio = 0xffffffff,
|
||||
.gpio_acpi = 0xffffffff,
|
||||
.device = NULL,
|
||||
.fdc_device = NULL,
|
||||
.sio_device = NULL,
|
||||
|
@@ -103,7 +103,7 @@ nmc93cxx_eeprom_init_params(UNUSED(const device_t *info), void *params)
|
||||
|
||||
if (params_details->filename) {
|
||||
FILE *fp = nvr_fopen(params_details->filename, "rb");
|
||||
strncpy(eeprom->filename, params_details->filename, 1024);
|
||||
strncpy(eeprom->filename, params_details->filename, sizeof(eeprom->filename) - 1);
|
||||
if (fp) {
|
||||
filldefault = !fread(eeprom->contents, sizeof(uint16_t), nwords, fp);
|
||||
fclose(fp);
|
||||
|
@@ -147,8 +147,10 @@ void RendererCommon::drawStatusBarIcons(QPainter* painter)
|
||||
if (label) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
const QPixmap pixmap = label->pixmap();
|
||||
#elif QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
const QPixmap pixmap = label->pixmap(Qt::ReturnByValue);
|
||||
#else
|
||||
const QPixmap pixmap = label->pixmap() ? *label->pixmap() : QPixmap();
|
||||
const QPixmap pixmap = (label->pixmap() ? *label->pixmap() : QPixmap());
|
||||
#endif
|
||||
if (!pixmap.isNull()) {
|
||||
painter->setBrush(QColor::fromRgbF(0, 0, 0, 1.));
|
||||
|
@@ -1,32 +1,31 @@
|
||||
/* some code borrowed from scummvm */
|
||||
#ifdef USE_FLUIDSYNTH
|
||||
# include <stdint.h>
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <wchar.h>
|
||||
# ifdef __unix__
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
# define FLUIDSYNTH_NOT_A_DLL
|
||||
# include <fluidsynth.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#ifdef __unix__
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#define FLUIDSYNTH_NOT_A_DLL
|
||||
#include <fluidsynth.h>
|
||||
|
||||
# include <86box/86box.h>
|
||||
# include <86box/config.h>
|
||||
# include <86box/device.h>
|
||||
# include <86box/midi.h>
|
||||
# include <86box/thread.h>
|
||||
# include <86box/sound.h>
|
||||
# include <86box/plat_unused.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/midi.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
# define RENDER_RATE 100
|
||||
# define BUFFER_SEGMENTS 10
|
||||
#define RENDER_RATE 100
|
||||
#define BUFFER_SEGMENTS 10
|
||||
|
||||
/* Check the FluidSynth version to determine wheteher to use the older reverb/chorus
|
||||
control functions that were deprecated in 2.2.0, or their newer replacements */
|
||||
# if (FLUIDSYNTH_VERSION_MAJOR < 2) || ((FLUIDSYNTH_VERSION_MAJOR == 2) && (FLUIDSYNTH_VERSION_MINOR < 2))
|
||||
# define USE_OLD_FLUIDSYNTH_API
|
||||
# endif
|
||||
#if (FLUIDSYNTH_VERSION_MAJOR < 2) || ((FLUIDSYNTH_VERSION_MAJOR == 2) && (FLUIDSYNTH_VERSION_MINOR < 2))
|
||||
# define USE_OLD_FLUIDSYNTH_API
|
||||
#endif
|
||||
|
||||
extern void givealbuffer_midi(void *buf, uint32_t size);
|
||||
extern void al_set_midi(int freq, int buf_size);
|
||||
@@ -167,19 +166,19 @@ fluidsynth_init(UNUSED(const device_t *info))
|
||||
data->synth = new_fluid_synth(data->settings);
|
||||
|
||||
const char *sound_font = device_get_config_string("sound_font");
|
||||
# ifdef __unix__
|
||||
#ifdef __unix__
|
||||
if (!sound_font || sound_font[0] == 0)
|
||||
sound_font = (access("/usr/share/sounds/sf2/FluidR3_GM.sf2", F_OK) == 0 ? "/usr/share/sounds/sf2/FluidR3_GM.sf2" :
|
||||
(access("/usr/share/soundfonts/default.sf2", F_OK) == 0 ? "/usr/share/soundfonts/default.sf2" : ""));
|
||||
# endif
|
||||
#endif
|
||||
data->sound_font = fluid_synth_sfload(data->synth, sound_font, 1);
|
||||
|
||||
if (device_get_config_int("chorus")) {
|
||||
# ifndef USE_OLD_FLUIDSYNTH_API
|
||||
#ifndef USE_OLD_FLUIDSYNTH_API
|
||||
fluid_synth_chorus_on(data->synth, -1, 1);
|
||||
# else
|
||||
#else
|
||||
fluid_synth_set_chorus_on(data->synth, 1);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int chorus_voices = device_get_config_int("chorus_voices");
|
||||
double chorus_level = device_get_config_int("chorus_level") / 100.0;
|
||||
@@ -192,48 +191,48 @@ fluidsynth_init(UNUSED(const device_t *info))
|
||||
else
|
||||
chorus_waveform = FLUID_CHORUS_MOD_TRIANGLE;
|
||||
|
||||
# ifndef USE_OLD_FLUIDSYNTH_API
|
||||
#ifndef USE_OLD_FLUIDSYNTH_API
|
||||
fluid_synth_set_chorus_group_nr(data->synth, -1, chorus_voices);
|
||||
fluid_synth_set_chorus_group_level(data->synth, -1, chorus_level);
|
||||
fluid_synth_set_chorus_group_speed(data->synth, -1, chorus_speed);
|
||||
fluid_synth_set_chorus_group_depth(data->synth, -1, chorus_depth);
|
||||
fluid_synth_set_chorus_group_type(data->synth, -1, chorus_waveform);
|
||||
# else
|
||||
#else
|
||||
fluid_synth_set_chorus(data->synth, chorus_voices, chorus_level, chorus_speed, chorus_depth, chorus_waveform);
|
||||
# endif
|
||||
#endif
|
||||
} else
|
||||
# ifndef USE_OLD_FLUIDSYNTH_API
|
||||
#ifndef USE_OLD_FLUIDSYNTH_API
|
||||
fluid_synth_chorus_on(data->synth, -1, 0);
|
||||
# else
|
||||
#else
|
||||
fluid_synth_set_chorus_on(data->synth, 0);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (device_get_config_int("reverb")) {
|
||||
# ifndef USE_OLD_FLUIDSYNTH_API
|
||||
#ifndef USE_OLD_FLUIDSYNTH_API
|
||||
fluid_synth_reverb_on(data->synth, -1, 1);
|
||||
# else
|
||||
#else
|
||||
fluid_synth_set_reverb_on(data->synth, 1);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
double reverb_room_size = device_get_config_int("reverb_room_size") / 100.0;
|
||||
double reverb_damping = device_get_config_int("reverb_damping") / 100.0;
|
||||
double reverb_width = device_get_config_int("reverb_width") / 10.0;
|
||||
double reverb_level = device_get_config_int("reverb_level") / 100.0;
|
||||
|
||||
# ifndef USE_OLD_FLUIDSYNTH_API
|
||||
#ifndef USE_OLD_FLUIDSYNTH_API
|
||||
fluid_synth_set_reverb_group_roomsize(data->synth, -1, reverb_room_size);
|
||||
fluid_synth_set_reverb_group_damp(data->synth, -1, reverb_damping);
|
||||
fluid_synth_set_reverb_group_width(data->synth, -1, reverb_width);
|
||||
fluid_synth_set_reverb_group_level(data->synth, -1, reverb_level);
|
||||
# else
|
||||
#else
|
||||
fluid_synth_set_reverb(data->synth, reverb_room_size, reverb_damping, reverb_width, reverb_level);
|
||||
# endif
|
||||
#endif
|
||||
} else
|
||||
# ifndef USE_OLD_FLUIDSYNTH_API
|
||||
#ifndef USE_OLD_FLUIDSYNTH_API
|
||||
fluid_synth_reverb_on(data->synth, -1, 0);
|
||||
# else
|
||||
#else
|
||||
fluid_synth_set_reverb_on(data->synth, 0);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int interpolation = device_get_config_int("interpolation");
|
||||
int fs_interpolation = FLUID_INTERP_4THORDER;
|
||||
@@ -499,4 +498,3 @@ const device_t fluidsynth_device = {
|
||||
.config = fluidsynth_config
|
||||
};
|
||||
|
||||
#endif /*USE_FLUIDSYNTH*/
|
||||
|
Reference in New Issue
Block a user