Less dummy devices
This commit is contained in:
28
src/device.c
28
src/device.c
@@ -843,3 +843,31 @@ device_context_get_device(void)
|
||||
{
|
||||
return device_current.dev;
|
||||
}
|
||||
|
||||
const device_t device_none = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t device_internal = {
|
||||
.name = "Internal",
|
||||
.internal_name = "internal",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
@@ -2040,25 +2040,11 @@ static const device_t iab_device = {
|
||||
};
|
||||
#endif
|
||||
|
||||
static const device_t isa_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const struct {
|
||||
const device_t *dev;
|
||||
} boards[] = {
|
||||
// clang-format off
|
||||
{ &isa_none_device },
|
||||
{ &device_none },
|
||||
// XT Ram Expansion Cards
|
||||
{ &ibmxt_32k_device },
|
||||
{ &ibmxt_64k_device },
|
||||
|
@@ -752,30 +752,16 @@ const device_t vendex_xt_rtc_onboard_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const device_t isartc_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const struct {
|
||||
const device_t *dev;
|
||||
} boards[] = {
|
||||
// clang-format off
|
||||
{ &isartc_none_device },
|
||||
{ &ev170_device },
|
||||
{ &pii147_device },
|
||||
{ &p5pak_device },
|
||||
{ &a6pak_device },
|
||||
{ NULL },
|
||||
{ &device_none },
|
||||
{ &ev170_device },
|
||||
{ &pii147_device },
|
||||
{ &p5pak_device },
|
||||
{ &a6pak_device },
|
||||
{ NULL },
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
|
@@ -50,40 +50,12 @@ hdc_log(const char *fmt, ...)
|
||||
# define hdc_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
static const device_t hdc_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const device_t hdc_internal_device = {
|
||||
.name = "Internal",
|
||||
.internal_name = "internal",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const struct {
|
||||
const device_t *device;
|
||||
} controllers[] = {
|
||||
// clang-format off
|
||||
{ &hdc_none_device },
|
||||
{ &hdc_internal_device },
|
||||
{ &device_none },
|
||||
{ &device_internal },
|
||||
{ &st506_xt_xebec_device },
|
||||
{ &st506_xt_wdxt_gen_device },
|
||||
{ &st506_xt_dtc5150x_device },
|
||||
|
@@ -97,49 +97,21 @@ fdc_log(const char *fmt, ...)
|
||||
# define fdc_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
const device_t fdc_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t fdc_internal_device = {
|
||||
.name = "Internal",
|
||||
.internal_name = "internal",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
typedef const struct {
|
||||
const device_t *device;
|
||||
} fdc_cards_t;
|
||||
|
||||
static fdc_cards_t fdc_cards[] = {
|
||||
// clang-format off
|
||||
{ &fdc_none_device },
|
||||
{ &fdc_internal_device },
|
||||
{ &fdc_xt_device },
|
||||
{ &fdc_at_device },
|
||||
{ &fdc_b215_device },
|
||||
{ &fdc_pii151b_device },
|
||||
{ &fdc_pii158b_device },
|
||||
{ &fdc_monster_device },
|
||||
{ NULL }
|
||||
{ &device_none },
|
||||
{ &device_internal },
|
||||
{ &fdc_xt_device },
|
||||
{ &fdc_at_device },
|
||||
{ &fdc_b215_device },
|
||||
{ &fdc_pii151b_device },
|
||||
{ &fdc_pii158b_device },
|
||||
{ &fdc_monster_device },
|
||||
{ NULL }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
|
@@ -244,6 +244,9 @@ extern const char *device_get_internal_name(const device_t *dev);
|
||||
extern int machine_get_config_int(char *s);
|
||||
extern char *machine_get_config_string(char *s);
|
||||
|
||||
extern const device_t device_none;
|
||||
extern const device_t device_internal;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -77,37 +77,9 @@
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
|
||||
static const device_t net_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = NET_TYPE_NONE,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const device_t net_internal_device = {
|
||||
.name = "Internal",
|
||||
.internal_name = "internal",
|
||||
.flags = 0,
|
||||
.local = NET_TYPE_NONE,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const device_t *net_cards[] = {
|
||||
&net_none_device,
|
||||
&net_internal_device,
|
||||
&device_none,
|
||||
&device_internal,
|
||||
&threec501_device,
|
||||
&threec503_device,
|
||||
&pcnet_am79c960_device,
|
||||
|
@@ -47,27 +47,13 @@ double scsi_bus_speed[SCSI_BUS_MAX] = { 0.0, 0.0, 0.0, 0.0 };
|
||||
|
||||
static uint8_t next_scsi_bus = 0;
|
||||
|
||||
static const device_t scsi_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
typedef const struct {
|
||||
const device_t *device;
|
||||
} SCSI_CARD;
|
||||
|
||||
static SCSI_CARD scsi_cards[] = {
|
||||
// clang-format off
|
||||
{ &scsi_none_device, },
|
||||
{ &device_none, },
|
||||
{ &aha154xa_device, },
|
||||
{ &aha154xb_device, },
|
||||
{ &aha154xc_device, },
|
||||
|
@@ -71,59 +71,31 @@ typedef struct
|
||||
const device_t *device;
|
||||
} MIDI_OUT_DEVICE, MIDI_IN_DEVICE;
|
||||
|
||||
static const device_t midi_out_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const MIDI_OUT_DEVICE devices[] = {
|
||||
// clang-format off
|
||||
{ &midi_out_none_device },
|
||||
{ &device_none },
|
||||
#ifdef USE_FLUIDSYNTH
|
||||
{ &fluidsynth_device },
|
||||
{ &fluidsynth_device },
|
||||
#endif
|
||||
#ifdef USE_MUNT
|
||||
{ &mt32_old_device },
|
||||
{ &mt32_new_device },
|
||||
{ &cm32l_device },
|
||||
{ &cm32ln_device },
|
||||
{ &mt32_old_device },
|
||||
{ &mt32_new_device },
|
||||
{ &cm32l_device },
|
||||
{ &cm32ln_device },
|
||||
#endif
|
||||
#ifdef USE_RTMIDI
|
||||
{ &rtmidi_output_device },
|
||||
{ &rtmidi_output_device },
|
||||
#endif
|
||||
#if defined(DEV_BRANCH) && defined(USE_OPL4ML)
|
||||
{ &opl4_midi_device },
|
||||
{ &opl4_midi_device },
|
||||
#endif
|
||||
{ NULL }
|
||||
{ NULL }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static const device_t midi_in_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const MIDI_IN_DEVICE midi_in_devices[] = {
|
||||
// clang-format off
|
||||
{ &midi_in_none_device },
|
||||
{ &device_none },
|
||||
#ifdef USE_RTMIDI
|
||||
{ &rtmidi_input_device },
|
||||
#endif
|
||||
|
@@ -96,38 +96,10 @@ static void *filter_cd_audio_p = NULL;
|
||||
void (*filter_pc_speaker)(int channel, double *buffer, void *priv) = NULL;
|
||||
void *filter_pc_speaker_p = NULL;
|
||||
|
||||
static const device_t sound_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const device_t sound_internal_device = {
|
||||
.name = "Internal",
|
||||
.internal_name = "internal",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const SOUND_CARD sound_cards[] = {
|
||||
// clang-format off
|
||||
{ &sound_none_device },
|
||||
{ &sound_internal_device },
|
||||
{ &device_none },
|
||||
{ &device_internal },
|
||||
{ &acermagic_s20_device },
|
||||
{ &mirosound_pcm10_device },
|
||||
{ &adlib_device },
|
||||
|
@@ -47,38 +47,11 @@ static video_timings_t timing_default = { .type = VIDEO_ISA, .write_b = 8, .writ
|
||||
|
||||
static int was_reset = 0;
|
||||
|
||||
static const device_t vid_none_device = {
|
||||
.name = "None",
|
||||
.internal_name = "none",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
static const device_t vid_internal_device = {
|
||||
.name = "Internal",
|
||||
.internal_name = "internal",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static const VIDEO_CARD
|
||||
video_cards[] = {
|
||||
// clang-format off
|
||||
{ &vid_none_device },
|
||||
{ &vid_internal_device },
|
||||
{ &device_none },
|
||||
{ &device_internal },
|
||||
{ &atiega800p_device },
|
||||
{ &mach8_vga_isa_device, VIDEO_FLAG_TYPE_8514 },
|
||||
{ &mach32_isa_device, VIDEO_FLAG_TYPE_8514 },
|
||||
|
Reference in New Issue
Block a user