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;
|
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
|
#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 {
|
static const struct {
|
||||||
const device_t *dev;
|
const device_t *dev;
|
||||||
} boards[] = {
|
} boards[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ &isa_none_device },
|
{ &device_none },
|
||||||
// XT Ram Expansion Cards
|
// XT Ram Expansion Cards
|
||||||
{ &ibmxt_32k_device },
|
{ &ibmxt_32k_device },
|
||||||
{ &ibmxt_64k_device },
|
{ &ibmxt_64k_device },
|
||||||
|
|||||||
@@ -752,30 +752,16 @@ const device_t vendex_xt_rtc_onboard_device = {
|
|||||||
.config = NULL
|
.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 {
|
static const struct {
|
||||||
const device_t *dev;
|
const device_t *dev;
|
||||||
} boards[] = {
|
} boards[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ &isartc_none_device },
|
{ &device_none },
|
||||||
{ &ev170_device },
|
{ &ev170_device },
|
||||||
{ &pii147_device },
|
{ &pii147_device },
|
||||||
{ &p5pak_device },
|
{ &p5pak_device },
|
||||||
{ &a6pak_device },
|
{ &a6pak_device },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -50,40 +50,12 @@ hdc_log(const char *fmt, ...)
|
|||||||
# define hdc_log(fmt, ...)
|
# define hdc_log(fmt, ...)
|
||||||
#endif
|
#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 {
|
static const struct {
|
||||||
const device_t *device;
|
const device_t *device;
|
||||||
} controllers[] = {
|
} controllers[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ &hdc_none_device },
|
{ &device_none },
|
||||||
{ &hdc_internal_device },
|
{ &device_internal },
|
||||||
{ &st506_xt_xebec_device },
|
{ &st506_xt_xebec_device },
|
||||||
{ &st506_xt_wdxt_gen_device },
|
{ &st506_xt_wdxt_gen_device },
|
||||||
{ &st506_xt_dtc5150x_device },
|
{ &st506_xt_dtc5150x_device },
|
||||||
|
|||||||
@@ -97,49 +97,21 @@ fdc_log(const char *fmt, ...)
|
|||||||
# define fdc_log(fmt, ...)
|
# define fdc_log(fmt, ...)
|
||||||
#endif
|
#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 {
|
typedef const struct {
|
||||||
const device_t *device;
|
const device_t *device;
|
||||||
} fdc_cards_t;
|
} fdc_cards_t;
|
||||||
|
|
||||||
static fdc_cards_t fdc_cards[] = {
|
static fdc_cards_t fdc_cards[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ &fdc_none_device },
|
{ &device_none },
|
||||||
{ &fdc_internal_device },
|
{ &device_internal },
|
||||||
{ &fdc_xt_device },
|
{ &fdc_xt_device },
|
||||||
{ &fdc_at_device },
|
{ &fdc_at_device },
|
||||||
{ &fdc_b215_device },
|
{ &fdc_b215_device },
|
||||||
{ &fdc_pii151b_device },
|
{ &fdc_pii151b_device },
|
||||||
{ &fdc_pii158b_device },
|
{ &fdc_pii158b_device },
|
||||||
{ &fdc_monster_device },
|
{ &fdc_monster_device },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
// clang-format on
|
// 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 int machine_get_config_int(char *s);
|
||||||
extern char *machine_get_config_string(char *s);
|
extern char *machine_get_config_string(char *s);
|
||||||
|
|
||||||
|
extern const device_t device_none;
|
||||||
|
extern const device_t device_internal;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -77,37 +77,9 @@
|
|||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
#endif
|
#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[] = {
|
static const device_t *net_cards[] = {
|
||||||
&net_none_device,
|
&device_none,
|
||||||
&net_internal_device,
|
&device_internal,
|
||||||
&threec501_device,
|
&threec501_device,
|
||||||
&threec503_device,
|
&threec503_device,
|
||||||
&pcnet_am79c960_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 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 {
|
typedef const struct {
|
||||||
const device_t *device;
|
const device_t *device;
|
||||||
} SCSI_CARD;
|
} SCSI_CARD;
|
||||||
|
|
||||||
static SCSI_CARD scsi_cards[] = {
|
static SCSI_CARD scsi_cards[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ &scsi_none_device, },
|
{ &device_none, },
|
||||||
{ &aha154xa_device, },
|
{ &aha154xa_device, },
|
||||||
{ &aha154xb_device, },
|
{ &aha154xb_device, },
|
||||||
{ &aha154xc_device, },
|
{ &aha154xc_device, },
|
||||||
|
|||||||
@@ -71,59 +71,31 @@ typedef struct
|
|||||||
const device_t *device;
|
const device_t *device;
|
||||||
} MIDI_OUT_DEVICE, MIDI_IN_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[] = {
|
static const MIDI_OUT_DEVICE devices[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ &midi_out_none_device },
|
{ &device_none },
|
||||||
#ifdef USE_FLUIDSYNTH
|
#ifdef USE_FLUIDSYNTH
|
||||||
{ &fluidsynth_device },
|
{ &fluidsynth_device },
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_MUNT
|
#ifdef USE_MUNT
|
||||||
{ &mt32_old_device },
|
{ &mt32_old_device },
|
||||||
{ &mt32_new_device },
|
{ &mt32_new_device },
|
||||||
{ &cm32l_device },
|
{ &cm32l_device },
|
||||||
{ &cm32ln_device },
|
{ &cm32ln_device },
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_RTMIDI
|
#ifdef USE_RTMIDI
|
||||||
{ &rtmidi_output_device },
|
{ &rtmidi_output_device },
|
||||||
#endif
|
#endif
|
||||||
#if defined(DEV_BRANCH) && defined(USE_OPL4ML)
|
#if defined(DEV_BRANCH) && defined(USE_OPL4ML)
|
||||||
{ &opl4_midi_device },
|
{ &opl4_midi_device },
|
||||||
#endif
|
#endif
|
||||||
{ NULL }
|
{ NULL }
|
||||||
// clang-format on
|
// 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[] = {
|
static const MIDI_IN_DEVICE midi_in_devices[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ &midi_in_none_device },
|
{ &device_none },
|
||||||
#ifdef USE_RTMIDI
|
#ifdef USE_RTMIDI
|
||||||
{ &rtmidi_input_device },
|
{ &rtmidi_input_device },
|
||||||
#endif
|
#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)(int channel, double *buffer, void *priv) = NULL;
|
||||||
void *filter_pc_speaker_p = 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[] = {
|
static const SOUND_CARD sound_cards[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ &sound_none_device },
|
{ &device_none },
|
||||||
{ &sound_internal_device },
|
{ &device_internal },
|
||||||
{ &acermagic_s20_device },
|
{ &acermagic_s20_device },
|
||||||
{ &mirosound_pcm10_device },
|
{ &mirosound_pcm10_device },
|
||||||
{ &adlib_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 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
|
static const VIDEO_CARD
|
||||||
video_cards[] = {
|
video_cards[] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ &vid_none_device },
|
{ &device_none },
|
||||||
{ &vid_internal_device },
|
{ &device_internal },
|
||||||
{ &atiega800p_device },
|
{ &atiega800p_device },
|
||||||
{ &mach8_vga_isa_device, VIDEO_FLAG_TYPE_8514 },
|
{ &mach8_vga_isa_device, VIDEO_FLAG_TYPE_8514 },
|
||||||
{ &mach32_isa_device, VIDEO_FLAG_TYPE_8514 },
|
{ &mach32_isa_device, VIDEO_FLAG_TYPE_8514 },
|
||||||
|
|||||||
Reference in New Issue
Block a user