From 51532f7aaac6e3a13cfcd355d9db1adbac44da23 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 08:58:31 -0400 Subject: [PATCH 01/25] lpt_device_t.internal_name added --- src/device/hasp.c | 1 + src/include/86box/lpt.h | 1 + src/lpt.c | 27 ++++++++++++++++++--------- src/network/net_plip.c | 1 + src/printer/prt_escp.c | 1 + src/printer/prt_ps.c | 1 + src/printer/prt_text.c | 1 + src/sound/snd_lpt_dac.c | 2 ++ src/sound/snd_lpt_dss.c | 1 + 9 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/device/hasp.c b/src/device/hasp.c index 60dae74c6..299796a6d 100644 --- a/src/device/hasp.c +++ b/src/device/hasp.c @@ -301,6 +301,7 @@ hasp_close(void *priv) const lpt_device_t lpt_hasp_savquest_device = { .name = "Protection Dongle for Savage Quest", + .internal_name = "dongle_savquest", .init = hasp_init_savquest, .close = hasp_close, .write_data = hasp_write_data, diff --git a/src/include/86box/lpt.h b/src/include/86box/lpt.h index b5b8d2699..8ddf2c805 100644 --- a/src/include/86box/lpt.h +++ b/src/include/86box/lpt.h @@ -20,6 +20,7 @@ typedef struct { const char *name; + const char *internal_name; void * (*init)(void *lpt); void (*close)(void *p); diff --git a/src/lpt.c b/src/lpt.c index bc82454bc..b6c639d6b 100644 --- a/src/lpt.c +++ b/src/lpt.c @@ -16,13 +16,24 @@ lpt_port_t lpt_ports[PARALLEL_MAX]; +const lpt_device_t lpt_none_device = { + .name = "None", + .internal_name = "none", + .init = NULL, + .close = NULL, + .write_data = NULL, + .write_ctrl = NULL, + .read_data = NULL, + .read_status = NULL, + .read_ctrl = NULL +}; static const struct { const char *internal_name; const lpt_device_t *device; } lpt_devices[] = { // clang-format off - {"none", NULL }, + {"none", &lpt_none_device }, {"dss", &dss_device }, {"lpt_dac", &lpt_dac_device }, {"lpt_dac_stereo", &lpt_dac_stereo_device }, @@ -39,31 +50,29 @@ char * lpt_device_get_name(int id) { if (strlen((char *) lpt_devices[id].internal_name) == 0) - return NULL; + return NULL; if (!lpt_devices[id].device) - return "None"; + return "None"; return (char *) lpt_devices[id].device->name; } - char * lpt_device_get_internal_name(int id) { if (strlen((char *) lpt_devices[id].internal_name) == 0) - return NULL; + return NULL; return (char *) lpt_devices[id].internal_name; } - int lpt_device_get_from_internal_name(char *s) { int c = 0; while (strlen((char *) lpt_devices[c].internal_name) != 0) { - if (strcmp(lpt_devices[c].internal_name, s) == 0) - return c; - c++; + if (strcmp(lpt_devices[c].internal_name, s) == 0) + return c; + c++; } return 0; diff --git a/src/network/net_plip.c b/src/network/net_plip.c index f0af9dee5..528099f9b 100644 --- a/src/network/net_plip.c +++ b/src/network/net_plip.c @@ -493,6 +493,7 @@ plip_close(void *priv) const lpt_device_t lpt_plip_device = { .name = "Parallel Line Internet Protocol", + .internal_name = "plip", .init = plip_lpt_init, .close = plip_close, .write_data = plip_write_data, diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index b788c317f..ef8b26eac 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -2144,6 +2144,7 @@ escp_close(void *priv) const lpt_device_t lpt_prt_escp_device = { "Generic ESC/P Dot-Matrix", + "dot_matrix", escp_init, escp_close, write_data, diff --git a/src/printer/prt_ps.c b/src/printer/prt_ps.c index fdc820a84..e90e19e82 100644 --- a/src/printer/prt_ps.c +++ b/src/printer/prt_ps.c @@ -401,6 +401,7 @@ ps_close(void *p) const lpt_device_t lpt_prt_ps_device = { .name = "Generic PostScript Printer", + .internal_name = "postscript", .init = ps_init, .close = ps_close, .write_data = ps_write_data, diff --git a/src/printer/prt_text.c b/src/printer/prt_text.c index 070e1bd4c..e4ddb2b20 100644 --- a/src/printer/prt_text.c +++ b/src/printer/prt_text.c @@ -484,6 +484,7 @@ prnt_close(void *priv) const lpt_device_t lpt_prt_text_device = { "Generic Text Printer", + "text_prt", prnt_init, prnt_close, write_data, diff --git a/src/sound/snd_lpt_dac.c b/src/sound/snd_lpt_dac.c index e4869f397..cac610c91 100644 --- a/src/sound/snd_lpt_dac.c +++ b/src/sound/snd_lpt_dac.c @@ -110,6 +110,7 @@ dac_close(void *p) const lpt_device_t lpt_dac_device = { "LPT DAC / Covox Speech Thing", + "lpt_dac", dac_init, dac_close, dac_write_data, @@ -121,6 +122,7 @@ const lpt_device_t lpt_dac_device = { const lpt_device_t lpt_dac_stereo_device = { "Stereo LPT DAC", + "lpt_dac_stereo", dac_stereo_init, dac_close, dac_write_data, diff --git a/src/sound/snd_lpt_dss.c b/src/sound/snd_lpt_dss.c index 131349141..caf98b20b 100644 --- a/src/sound/snd_lpt_dss.c +++ b/src/sound/snd_lpt_dss.c @@ -133,6 +133,7 @@ dss_close(void *p) const lpt_device_t dss_device = { "Disney Sound Source", + "dss", dss_init, dss_close, dss_write_data, From 297909a8846a8d5573d4994e5fee7f1afc1f0b6d Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:00:03 -0400 Subject: [PATCH 02/25] midi out device named correctly to aid code readability --- src/86box.c | 8 +- src/config.c | 9 +- src/include/86box/midi.h | 22 ++--- src/include/86box/midi_rtmidi.h | 4 +- src/qt/qt_deviceconfig.cpp | 4 +- src/qt/qt_settingssound.cpp | 16 ++-- src/sound/midi.c | 158 ++++++++++++++++---------------- src/sound/midi_fluidsynth.c | 2 +- src/sound/midi_mt32.c | 2 +- src/sound/midi_rtmidi.cpp | 29 +++--- src/sound/sound.c | 2 +- src/sound/xaudio2.c | 2 +- src/win/win_devconf.c | 4 +- src/win/win_settings.c | 28 +++--- 14 files changed, 146 insertions(+), 144 deletions(-) diff --git a/src/86box.c b/src/86box.c index 17a1cca9c..344dc8294 100644 --- a/src/86box.c +++ b/src/86box.c @@ -935,7 +935,9 @@ pc_reset_hard_close(void) scsi_device_close_all(); - midi_close(); + midi_out_close(); + + midi_in_close(); cdrom_close(); @@ -1158,7 +1160,9 @@ pc_close(thread_t *ptr) scsi_device_close_all(); - midi_close(); + midi_out_close(); + + midi_in_close(); network_close(); diff --git a/src/config.c b/src/config.c index acf70d15a..4dbbb4a21 100644 --- a/src/config.c +++ b/src/config.c @@ -1036,9 +1036,9 @@ load_sound(void) p = config_get_string(cat, "midi_device", NULL); if (p != NULL) - midi_device_current = midi_device_get_from_internal_name(p); + midi_output_device_current = midi_out_device_get_from_internal_name(p); else - midi_device_current = 0; + midi_output_device_current = 0; p = config_get_string(cat, "midi_in_device", NULL); if (p != NULL) @@ -2111,6 +2111,7 @@ config_load(void) serial_enabled[1] = 1; for (i = 2 ; i < SERIAL_MAX; i++) serial_enabled[i] = 0; + lpt_ports[0].enabled = 1; for (i = 1 ; i < PARALLEL_MAX; i++) @@ -2529,10 +2530,10 @@ save_sound(void) else config_set_string(cat, "sndcard", sound_card_get_internal_name(sound_card_current)); - if (!strcmp(midi_device_get_internal_name(midi_device_current), "none")) + if (!strcmp(midi_out_device_get_internal_name(midi_output_device_current), "none")) config_delete_var(cat, "midi_device"); else - config_set_string(cat, "midi_device", midi_device_get_internal_name(midi_device_current)); + config_set_string(cat, "midi_device", midi_out_device_get_internal_name(midi_output_device_current)); if (!strcmp(midi_in_device_get_internal_name(midi_input_device_current), "none")) config_delete_var(cat, "midi_in_device"); diff --git a/src/include/86box/midi.h b/src/include/86box/midi.h index 3eec73234..01ec88881 100644 --- a/src/include/86box/midi.h +++ b/src/include/86box/midi.h @@ -6,26 +6,26 @@ extern uint8_t MIDI_InSysexBuf[SYSEX_SIZE]; extern uint8_t MIDI_evt_len[256]; -extern int midi_device_current; +extern int midi_output_device_current; extern int midi_input_device_current; extern void (*input_msg)(void *p, uint8_t *msg, uint32_t len); extern int (*input_sysex)(void *p, uint8_t *buf, uint32_t len, int abort); extern void *midi_in_p; -extern int midi_device_available(int card); +extern int midi_out_device_available(int card); extern int midi_in_device_available(int card); #ifdef EMU_DEVICE_H -const device_t *midi_device_getdevice(int card); +const device_t *midi_out_device_getdevice(int card); const device_t *midi_in_device_getdevice(int card); #endif -extern int midi_device_has_config(int card); +extern int midi_out_device_has_config(int card); extern int midi_in_device_has_config(int card); -extern char *midi_device_get_internal_name(int card); +extern char *midi_out_device_get_internal_name(int card); extern char *midi_in_device_get_internal_name(int card); -extern int midi_device_get_from_internal_name(char *s); +extern int midi_out_device_get_from_internal_name(char *s); extern int midi_in_device_get_from_internal_name(char *s); -extern void midi_device_init(); +extern void midi_out_device_init(); extern void midi_in_device_init(); typedef struct midi_device_t { @@ -56,11 +56,11 @@ typedef struct midi_t { midi_device_t *m_out_device, *m_in_device; } midi_t; -extern midi_t *midi, *midi_in; +extern midi_t *midi_out, *midi_in; -extern void midi_init(midi_device_t *device); +extern void midi_out_init(midi_device_t *device); extern void midi_in_init(midi_device_t *device, midi_t **mididev); -extern void midi_close(); +extern void midi_out_close(); extern void midi_in_close(void); extern void midi_raw_out_rt_byte(uint8_t val); extern void midi_raw_out_thru_rt_byte(uint8_t val); @@ -90,7 +90,7 @@ extern void midi_in_sysex(uint8_t *buffer, uint32_t len); #define MIDI_INPUT_INTERNAL_NAME "midi_in" #ifdef EMU_DEVICE_H -extern const device_t rtmidi_device; +extern const device_t rtmidi_output_device; extern const device_t rtmidi_input_device; # ifdef USE_FLUIDSYNTH extern const device_t fluidsynth_device; diff --git a/src/include/86box/midi_rtmidi.h b/src/include/86box/midi_rtmidi.h index d2d3869e3..fb2074302 100644 --- a/src/include/86box/midi_rtmidi.h +++ b/src/include/86box/midi_rtmidi.h @@ -5,8 +5,8 @@ extern "C" { #endif -extern int rtmidi_get_num_devs(void); -extern void rtmidi_get_dev_name(int num, char *s); +extern int rtmidi_out_get_num_devs(void); +extern void rtmidi_out_get_dev_name(int num, char *s); extern int rtmidi_in_get_num_devs(void); extern void rtmidi_in_get_dev_name(int num, char *s); diff --git a/src/qt/qt_deviceconfig.cpp b/src/qt/qt_deviceconfig.cpp index 8e5ce3bef..faf5a6ddc 100644 --- a/src/qt/qt_deviceconfig.cpp +++ b/src/qt/qt_deviceconfig.cpp @@ -75,9 +75,9 @@ void DeviceConfig::ConfigureDevice(const _device_* device, int instance, Setting auto* model = cbox->model(); int currentIndex = -1; int selected = config_get_int(device_context.name, const_cast(config->name), config->default_int); - for (int i = 0; i < rtmidi_get_num_devs(); i++) { + for (int i = 0; i < rtmidi_out_get_num_devs(); i++) { char midiName[512] = { 0 }; - rtmidi_get_dev_name(i, midiName); + rtmidi_out_get_dev_name(i, midiName); Models::AddEntry(model, midiName, i); if (selected == i) { diff --git a/src/qt/qt_settingssound.cpp b/src/qt/qt_settingssound.cpp index 5cf1114b0..6b12023a6 100644 --- a/src/qt/qt_settingssound.cpp +++ b/src/qt/qt_settingssound.cpp @@ -45,7 +45,7 @@ SettingsSound::~SettingsSound() void SettingsSound::save() { sound_card_current = ui->comboBoxSoundCard->currentData().toInt(); - midi_device_current = ui->comboBoxMidiOut->currentData().toInt(); + midi_output_device_current = ui->comboBoxMidiOut->currentData().toInt(); midi_input_device_current = ui->comboBoxMidiIn->currentData().toInt(); mpu401_standalone_enable = ui->checkBoxMPU401->isChecked() ? 1 : 0; SSI2001 = ui->checkBoxSSI2001->isChecked() ? 1 : 0;; @@ -95,14 +95,14 @@ void SettingsSound::onCurrentMachineChanged(int machineId) { c = 0; selectedRow = 0; while (true) { - QString name = DeviceConfig::DeviceName(midi_device_getdevice(c), midi_device_get_internal_name(c), 0); + QString name = DeviceConfig::DeviceName(midi_out_device_getdevice(c), midi_out_device_get_internal_name(c), 0); if (name.isEmpty()) { break; } - if (midi_device_available(c)) { + if (midi_out_device_available(c)) { int row = Models::AddEntry(model, name, c); - if (c == midi_device_current) { + if (c == midi_output_device_current) { selectedRow = row - removeRows; } } @@ -118,7 +118,7 @@ void SettingsSound::onCurrentMachineChanged(int machineId) { c = 0; selectedRow = 0; while (true) { - QString name = DeviceConfig::DeviceName(midi_in_device_getdevice(c), midi_device_get_internal_name(c), 0); + QString name = DeviceConfig::DeviceName(midi_in_device_getdevice(c), midi_in_device_get_internal_name(c), 0); if (name.isEmpty()) { break; } @@ -154,7 +154,7 @@ void SettingsSound::onCurrentMachineChanged(int machineId) { } static bool allowMpu401(Ui::SettingsSound *ui) { - QString midiOut = midi_device_get_internal_name(ui->comboBoxMidiOut->currentData().toInt()); + QString midiOut = midi_out_device_get_internal_name(ui->comboBoxMidiOut->currentData().toInt()); QString midiIn = midi_in_device_get_internal_name(ui->comboBoxMidiIn->currentData().toInt()); if (midiOut.isEmpty()) { @@ -184,13 +184,13 @@ void SettingsSound::on_comboBoxMidiOut_currentIndexChanged(int index) { if (index < 0) { return; } - ui->pushButtonConfigureMidiOut->setEnabled(midi_device_has_config(ui->comboBoxMidiOut->currentData().toInt())); + ui->pushButtonConfigureMidiOut->setEnabled(midi_out_device_has_config(ui->comboBoxMidiOut->currentData().toInt())); ui->checkBoxMPU401->setEnabled(allowMpu401(ui) && (machine_has_bus(machineId, MACHINE_BUS_ISA) || machine_has_bus(machineId, MACHINE_BUS_MCA))); ui->pushButtonConfigureMPU401->setEnabled(allowMpu401(ui) && ui->checkBoxMPU401->isChecked()); } void SettingsSound::on_pushButtonConfigureMidiOut_clicked() { - DeviceConfig::ConfigureDevice(midi_device_getdevice(ui->comboBoxMidiOut->currentData().toInt()), 0, qobject_cast(Settings::settings)); + DeviceConfig::ConfigureDevice(midi_out_device_getdevice(ui->comboBoxMidiOut->currentData().toInt()), 0, qobject_cast(Settings::settings)); } void SettingsSound::on_comboBoxMidiIn_currentIndexChanged(int index) { diff --git a/src/sound/midi.c b/src/sound/midi.c index 67d2afceb..085dab873 100644 --- a/src/sound/midi.c +++ b/src/sound/midi.c @@ -31,12 +31,12 @@ #include <86box/midi.h> #include <86box/plat.h> -int midi_device_current = 0; -static int midi_device_last = 0; -int midi_input_device_current = 0; -static int midi_input_device_last = 0; +int midi_output_device_current = 0; +static int midi_output_device_last = 0; +int midi_input_device_current = 0; +static int midi_input_device_last = 0; -midi_t *midi = NULL, *midi_in = NULL; +midi_t *midi_out = NULL, *midi_in = NULL; midi_in_handler_t *mih_first = NULL, *mih_last = NULL, *mih_cur = NULL; @@ -69,9 +69,9 @@ uint8_t MIDI_evt_len[256] = { typedef struct { const device_t *device; -} MIDI_DEVICE, MIDI_IN_DEVICE; +} MIDI_OUT_DEVICE, MIDI_IN_DEVICE; -static const device_t midi_none_device = { +static const device_t midi_out_none_device = { "None", "none", 0, @@ -85,20 +85,20 @@ static const device_t midi_none_device = { NULL }; -static const MIDI_DEVICE devices[] = { +static const MIDI_OUT_DEVICE devices[] = { // clang-format off - { &midi_none_device }, + { &midi_out_none_device }, #ifdef USE_FLUIDSYNTH - { &fluidsynth_device }, + { &fluidsynth_device }, #endif #ifdef USE_MUNT - { &mt32_device }, - { &cm32l_device }, + { &mt32_device }, + { &cm32l_device }, #endif #ifdef USE_RTMIDI - { &rtmidi_device }, + { &rtmidi_output_device }, #endif - { NULL } + { NULL } // clang-format on }; @@ -127,7 +127,7 @@ static const MIDI_IN_DEVICE midi_in_devices[] = { }; int -midi_device_available(int card) +midi_out_device_available(int card) { if (devices[card].device) return device_available(devices[card].device); @@ -136,13 +136,13 @@ midi_device_available(int card) } const device_t * -midi_device_getdevice(int card) +midi_out_device_getdevice(int card) { return devices[card].device; } int -midi_device_has_config(int card) +midi_out_device_has_config(int card) { if (!devices[card].device) return 0; @@ -150,13 +150,13 @@ midi_device_has_config(int card) } char * -midi_device_get_internal_name(int card) +midi_out_device_get_internal_name(int card) { return device_get_internal_name(devices[card].device); } int -midi_device_get_from_internal_name(char *s) +midi_out_device_get_from_internal_name(char *s) { int c = 0; @@ -170,20 +170,20 @@ midi_device_get_from_internal_name(char *s) } void -midi_device_init() +midi_out_device_init() { - if (devices[midi_device_current].device) - device_add(devices[midi_device_current].device); - midi_device_last = midi_device_current; + if (devices[midi_output_device_current].device) + device_add(devices[midi_output_device_current].device); + midi_output_device_last = midi_output_device_current; } void -midi_init(midi_device_t *device) +midi_out_init(midi_device_t *device) { - midi = (midi_t *) malloc(sizeof(midi_t)); - memset(midi, 0, sizeof(midi_t)); + midi_out = (midi_t *) malloc(sizeof(midi_t)); + memset(midi_out, 0, sizeof(midi_t)); - midi->m_out_device = device; + midi_out->m_out_device = device; } void @@ -196,16 +196,16 @@ midi_in_init(midi_device_t *device, midi_t **mididev) } void -midi_close(void) +midi_out_close(void) { - if (midi && midi->m_out_device) { - free(midi->m_out_device); - midi->m_out_device = NULL; + if (midi_out && midi_out->m_out_device) { + free(midi_out->m_out_device); + midi_out->m_out_device = NULL; } - if (midi) { - free(midi); - midi = NULL; + if (midi_out) { + free(midi_out); + midi_out = NULL; } } @@ -226,22 +226,22 @@ midi_in_close(void) void midi_poll(void) { - if (midi && midi->m_out_device && midi->m_out_device->poll) - midi->m_out_device->poll(); + if (midi_out && midi_out->m_out_device && midi_out->m_out_device->poll) + midi_out->m_out_device->poll(); } void play_msg(uint8_t *msg) { - if (midi->m_out_device->play_msg) - midi->m_out_device->play_msg(msg); + if (midi_out->m_out_device->play_msg) + midi_out->m_out_device->play_msg(msg); } void play_sysex(uint8_t *sysex, unsigned int len) { - if (midi->m_out_device->play_sysex) - midi->m_out_device->play_sysex(sysex, len); + if (midi_out->m_out_device->play_sysex) + midi_out->m_out_device->play_sysex(sysex, len); } int @@ -324,69 +324,69 @@ midi_raw_out_byte(uint8_t val) { uint32_t passed_ticks; - if (!midi || !midi->m_out_device) + if (!midi_out || !midi_out->m_out_device) return; - if ((midi->m_out_device->write && midi->m_out_device->write(val))) + if ((midi_out->m_out_device->write && midi_out->m_out_device->write(val))) return; - if (midi->midi_sysex_start) { - passed_ticks = plat_get_ticks() - midi->midi_sysex_start; - if (passed_ticks < midi->midi_sysex_delay) - plat_delay_ms(midi->midi_sysex_delay - passed_ticks); + if (midi_out->midi_sysex_start) { + passed_ticks = plat_get_ticks() - midi_out->midi_sysex_start; + if (passed_ticks < midi_out->midi_sysex_delay) + plat_delay_ms(midi_out->midi_sysex_delay - passed_ticks); } /* Test for a realtime MIDI message */ if (val >= 0xf8) { - midi->midi_rt_buf[0] = val; - play_msg(midi->midi_rt_buf); + midi_out->midi_rt_buf[0] = val; + play_msg(midi_out->midi_rt_buf); return; } /* Test for a active sysex transfer */ - if (midi->midi_status == 0xf0) { + if (midi_out->midi_status == 0xf0) { if (!(val & 0x80)) { - if (midi->midi_pos < (SYSEX_SIZE - 1)) - midi->midi_sysex_data[midi->midi_pos++] = val; + if (midi_out->midi_pos < (SYSEX_SIZE - 1)) + midi_out->midi_sysex_data[midi_out->midi_pos++] = val; return; } else { - midi->midi_sysex_data[midi->midi_pos++] = 0xf7; + midi_out->midi_sysex_data[midi_out->midi_pos++] = 0xf7; - if ((midi->midi_sysex_start) && (midi->midi_pos >= 4) && (midi->midi_pos <= 9) && (midi->midi_sysex_data[1] == 0x41) && (midi->midi_sysex_data[3] == 0x16)) { + if ((midi_out->midi_sysex_start) && (midi_out->midi_pos >= 4) && (midi_out->midi_pos <= 9) && (midi_out->midi_sysex_data[1] == 0x41) && (midi_out->midi_sysex_data[3] == 0x16)) { /* pclog("MIDI: Skipping invalid MT-32 SysEx MIDI message\n"); */ } else { - play_sysex(midi->midi_sysex_data, midi->midi_pos); - if (midi->midi_sysex_start) { - if (midi->midi_sysex_data[5] == 0x7f) - midi->midi_sysex_delay = 290; /* All parameters reset */ - else if ((midi->midi_sysex_data[5] == 0x10) && (midi->midi_sysex_data[6] == 0x00) && (midi->midi_sysex_data[7] == 0x04)) - midi->midi_sysex_delay = 145; /* Viking Child */ - else if ((midi->midi_sysex_data[5] == 0x10) && (midi->midi_sysex_data[6] == 0x00) && (midi->midi_sysex_data[7] == 0x01)) - midi->midi_sysex_delay = 30; /* Dark Sun 1 */ + play_sysex(midi_out->midi_sysex_data, midi_out->midi_pos); + if (midi_out->midi_sysex_start) { + if (midi_out->midi_sysex_data[5] == 0x7f) + midi_out->midi_sysex_delay = 290; /* All parameters reset */ + else if ((midi_out->midi_sysex_data[5] == 0x10) && (midi_out->midi_sysex_data[6] == 0x00) && (midi_out->midi_sysex_data[7] == 0x04)) + midi_out->midi_sysex_delay = 145; /* Viking Child */ + else if ((midi_out->midi_sysex_data[5] == 0x10) && (midi_out->midi_sysex_data[6] == 0x00) && (midi_out->midi_sysex_data[7] == 0x01)) + midi_out->midi_sysex_delay = 30; /* Dark Sun 1 */ else - midi->midi_sysex_delay = (unsigned int) (((float) (midi->midi_pos) * 1.25f) * 1000.0f / 3125.0f) + 2; + midi_out->midi_sysex_delay = (unsigned int) (((float) (midi_out->midi_pos) * 1.25f) * 1000.0f / 3125.0f) + 2; - midi->midi_sysex_start = plat_get_ticks(); + midi_out->midi_sysex_start = plat_get_ticks(); } } } } if (val & 0x80) { - midi->midi_status = val; - midi->midi_cmd_pos = 0; - midi->midi_cmd_len = MIDI_evt_len[val]; - if (midi->midi_status == 0xf0) { - midi->midi_sysex_data[0] = 0xf0; - midi->midi_pos = 1; + midi_out->midi_status = val; + midi_out->midi_cmd_pos = 0; + midi_out->midi_cmd_len = MIDI_evt_len[val]; + if (midi_out->midi_status == 0xf0) { + midi_out->midi_sysex_data[0] = 0xf0; + midi_out->midi_pos = 1; } } - if (midi->midi_cmd_len) { - midi->midi_cmd_buf[midi->midi_cmd_pos++] = val; - if (midi->midi_cmd_pos >= midi->midi_cmd_len) { - play_msg(midi->midi_cmd_buf); - midi->midi_cmd_pos = 1; + if (midi_out->midi_cmd_len) { + midi_out->midi_cmd_buf[midi_out->midi_cmd_pos++] = val; + if (midi_out->midi_cmd_pos >= midi_out->midi_cmd_len) { + play_msg(midi_out->midi_cmd_buf); + midi_out->midi_cmd_pos = 1; } } } @@ -394,13 +394,13 @@ midi_raw_out_byte(uint8_t val) void midi_clear_buffer(void) { - if (!midi) + if (!midi_out) return; - midi->midi_pos = 0; - midi->midi_status = 0x00; - midi->midi_cmd_pos = 0; - midi->midi_cmd_len = 0; + midi_out->midi_pos = 0; + midi_out->midi_status = 0x00; + midi_out->midi_cmd_pos = 0; + midi_out->midi_cmd_len = 0; } void diff --git a/src/sound/midi_fluidsynth.c b/src/sound/midi_fluidsynth.c index 52d21ac47..dd450e856 100644 --- a/src/sound/midi_fluidsynth.c +++ b/src/sound/midi_fluidsynth.c @@ -317,7 +317,7 @@ fluidsynth_init(const device_t *info) dev->play_sysex = fluidsynth_sysex; dev->poll = fluidsynth_poll; - midi_init(dev); + midi_out_init(dev); data->on = 1; diff --git a/src/sound/midi_mt32.c b/src/sound/midi_mt32.c index c0a0bc81a..f4a4a493a 100644 --- a/src/sound/midi_mt32.c +++ b/src/sound/midi_mt32.c @@ -272,7 +272,7 @@ mt32emu_init(char *control_rom, char *pcm_rom) dev->play_sysex = mt32_sysex; dev->poll = mt32_poll; - midi_init(dev); + midi_out_init(dev); mt32_on = 1; diff --git a/src/sound/midi_rtmidi.cpp b/src/sound/midi_rtmidi.cpp index 352cdcdfc..5eaf5a964 100644 --- a/src/sound/midi_rtmidi.cpp +++ b/src/sound/midi_rtmidi.cpp @@ -66,7 +66,7 @@ rtmidi_play_sysex(uint8_t *sysex, unsigned int len) void* -rtmidi_init(const device_t *info) +rtmidi_output_init(const device_t *info) { midi_device_t* dev = (midi_device_t*)malloc(sizeof(midi_device_t)); memset(dev, 0, sizeof(midi_device_t)); @@ -99,14 +99,14 @@ rtmidi_init(const device_t *info) } } - midi_init(dev); + midi_out_init(dev); return dev; } void -rtmidi_close(void *p) +rtmidi_output_close(void *p) { if (!midiout) return; @@ -116,12 +116,12 @@ rtmidi_close(void *p) delete midiout; midiout = nullptr; - midi_close(); + midi_out_close(); } int -rtmidi_get_num_devs(void) +rtmidi_out_get_num_devs(void) { if (!midiout) { try { @@ -136,7 +136,7 @@ rtmidi_get_num_devs(void) void -rtmidi_get_dev_name(int num, char *s) +rtmidi_out_get_dev_name(int num, char *s) { strcpy(s, midiout->getPortName(num).c_str()); } @@ -207,7 +207,7 @@ rtmidi_input_close(void* p) delete midiin; midiin = nullptr; - midi_close(); + midi_out_close(); } @@ -232,8 +232,7 @@ rtmidi_in_get_dev_name(int num, char *s) strcpy(s, midiin->getPortName(num).c_str()); } -static const device_config_t system_midi_config[] = -{ +static const device_config_t system_midi_config[] = { { "midi", "MIDI out device", CONFIG_MIDI_OUT, "", 0 }, @@ -242,8 +241,7 @@ static const device_config_t system_midi_config[] = } }; -static const device_config_t midi_input_config[] = -{ +static const device_config_t midi_input_config[] = { { "midi_input", "MIDI in device", CONFIG_MIDI_IN, "", 0 }, @@ -261,15 +259,14 @@ static const device_config_t midi_input_config[] = } }; -const device_t rtmidi_device = -{ +const device_t rtmidi_output_device = { SYSTEM_MIDI_NAME, SYSTEM_MIDI_INTERNAL_NAME, 0, 0, - rtmidi_init, - rtmidi_close, + rtmidi_output_init, + rtmidi_output_close, NULL, - { rtmidi_get_num_devs }, + { rtmidi_out_get_num_devs }, NULL, NULL, system_midi_config diff --git a/src/sound/sound.c b/src/sound/sound.c index a1a3353c6..2783526d9 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -481,7 +481,7 @@ sound_reset(void) { sound_realloc_buffers(); - midi_device_init(); + midi_out_device_init(); midi_in_device_init(); inital(); diff --git a/src/sound/xaudio2.c b/src/sound/xaudio2.c index c7e8dbf8f..b26bb9c9f 100644 --- a/src/sound/xaudio2.c +++ b/src/sound/xaudio2.c @@ -167,7 +167,7 @@ inital() IXAudio2SourceVoice_Start(srcvoice, 0, XAUDIO2_COMMIT_NOW); IXAudio2SourceVoice_Start(srcvoicecd, 0, XAUDIO2_COMMIT_NOW); - char *mdn = midi_device_get_internal_name(midi_device_current); + char *mdn = midi_out_device_get_internal_name(midi_output_device_current); if (strcmp(mdn, "none") && strcmp(mdn, SYSTEM_MIDI_INTERNAL_NAME)) { fmt.nSamplesPerSec = midi_freq; diff --git a/src/win/win_devconf.c b/src/win/win_devconf.c index e69aa59f1..42197ff33 100644 --- a/src/win/win_devconf.c +++ b/src/win/win_devconf.c @@ -98,9 +98,9 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) val_int = config_get_int((char *) config_device.name, (char *) config->name, config->default_int); - num = rtmidi_get_num_devs(); + num = rtmidi_out_get_num_devs(); for (c = 0; c < num; c++) { - rtmidi_get_dev_name(c, s); + rtmidi_out_get_dev_name(c, s); mbstowcs(lptsTemp, s, strlen(s) + 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lptsTemp); if (val_int == c) diff --git a/src/win/win_settings.c b/src/win/win_settings.c index dcd8d33ad..e6b4226b6 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -91,7 +91,7 @@ static int temp_gfxcard, temp_voodoo; static int temp_mouse, temp_joystick; /* Sound category */ -static int temp_sound_card, temp_midi_device, temp_midi_input_device, temp_mpu401, temp_SSI2001, temp_GAMEBLASTER, temp_GUS; +static int temp_sound_card, temp_midi_output_device, temp_midi_input_device, temp_mpu401, temp_SSI2001, temp_GAMEBLASTER, temp_GUS; static int temp_float; /* Network category */ @@ -339,7 +339,7 @@ win_settings_init(void) /* Sound category */ temp_sound_card = sound_card_current; - temp_midi_device = midi_device_current; + temp_midi_output_device = midi_output_device_current; temp_midi_input_device = midi_input_device_current; temp_mpu401 = mpu401_standalone_enable; temp_SSI2001 = SSI2001; @@ -463,7 +463,7 @@ win_settings_changed(void) /* Sound category */ i = i || (sound_card_current != temp_sound_card); - i = i || (midi_device_current != temp_midi_device); + i = i || (midi_output_device_current != temp_midi_output_device); i = i || (midi_input_device_current != temp_midi_input_device); i = i || (mpu401_standalone_enable != temp_mpu401); i = i || (SSI2001 != temp_SSI2001); @@ -553,7 +553,7 @@ win_settings_save(void) /* Sound category */ sound_card_current = temp_sound_card; - midi_device_current = temp_midi_device; + midi_output_device_current = temp_midi_output_device; midi_input_device_current = temp_midi_input_device; mpu401_standalone_enable = temp_mpu401; SSI2001 = temp_SSI2001; @@ -1261,7 +1261,7 @@ mpu401_standalone_allow(void) if (!machine_has_bus(temp_machine, MACHINE_BUS_ISA) && !machine_has_bus(temp_machine, MACHINE_BUS_MCA)) return 0; - md = midi_device_get_internal_name(temp_midi_device); + md = midi_out_device_get_internal_name(temp_midi_output_device); mdin = midi_in_device_get_internal_name(temp_midi_input_device); if (md != NULL) { @@ -1327,18 +1327,18 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) c = d = 0; settings_reset_content(hdlg, IDC_COMBO_MIDI_OUT); while (1) { - generate_device_name(midi_device_getdevice(c), midi_device_get_internal_name(c), 0); + generate_device_name(midi_out_device_getdevice(c), midi_out_device_get_internal_name(c), 0); if (!device_name[0]) break; - if (midi_device_available(c)) { + if (midi_out_device_available(c)) { if (c == 0) settings_add_string(hdlg, IDC_COMBO_MIDI_OUT, win_get_string(IDS_2103)); else settings_add_string(hdlg, IDC_COMBO_MIDI_OUT, (LPARAM) device_name); settings_list_to_midi[d] = c; - if ((c == 0) || (c == temp_midi_device)) + if ((c == 0) || (c == temp_midi_output_device)) settings_set_cur_sel(hdlg, IDC_COMBO_MIDI_OUT, d); d++; } @@ -1346,7 +1346,7 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) c++; } - settings_enable_window(hdlg, IDC_CONFIGURE_MIDI_OUT, midi_device_has_config(temp_midi_device)); + settings_enable_window(hdlg, IDC_CONFIGURE_MIDI_OUT, midi_out_device_has_config(temp_midi_output_device)); c = d = 0; settings_reset_content(hdlg, IDC_COMBO_MIDI_IN); @@ -1405,16 +1405,16 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) break; case IDC_COMBO_MIDI_OUT: - temp_midi_device = settings_list_to_midi[settings_get_cur_sel(hdlg, IDC_COMBO_MIDI_OUT)]; - settings_enable_window(hdlg, IDC_CONFIGURE_MIDI_OUT, midi_device_has_config(temp_midi_device)); + temp_midi_output_device = settings_list_to_midi[settings_get_cur_sel(hdlg, IDC_COMBO_MIDI_OUT)]; + settings_enable_window(hdlg, IDC_CONFIGURE_MIDI_OUT, midi_out_device_has_config(temp_midi_output_device)); settings_set_check(hdlg, IDC_CHECK_MPU401, temp_mpu401); settings_enable_window(hdlg, IDC_CHECK_MPU401, mpu401_standalone_allow()); settings_enable_window(hdlg, IDC_CONFIGURE_MPU401, mpu401_standalone_allow() && temp_mpu401); break; case IDC_CONFIGURE_MIDI_OUT: - temp_midi_device = settings_list_to_midi[settings_get_cur_sel(hdlg, IDC_COMBO_MIDI_OUT)]; - temp_deviceconfig |= deviceconfig_open(hdlg, (void *)midi_device_getdevice(temp_midi_device)); + temp_midi_output_device = settings_list_to_midi[settings_get_cur_sel(hdlg, IDC_COMBO_MIDI_OUT)]; + temp_deviceconfig |= deviceconfig_open(hdlg, (void *)midi_out_device_getdevice(temp_midi_output_device)); break; case IDC_COMBO_MIDI_IN: @@ -1474,7 +1474,7 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_SAVESETTINGS: temp_sound_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_SOUND)]; - temp_midi_device = settings_list_to_midi[settings_get_cur_sel(hdlg, IDC_COMBO_MIDI_OUT)]; + temp_midi_output_device = settings_list_to_midi[settings_get_cur_sel(hdlg, IDC_COMBO_MIDI_OUT)]; temp_midi_input_device = settings_list_to_midi_in[settings_get_cur_sel(hdlg, IDC_COMBO_MIDI_IN)]; temp_mpu401 = settings_get_check(hdlg, IDC_CHECK_MPU401); temp_GAMEBLASTER = settings_get_check(hdlg, IDC_CHECK_CMS); From c5d1a7b456bc315f1a954c4f29e2a31c066734d5 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:00:26 -0400 Subject: [PATCH 03/25] small bit of cleanup in gameport.c --- src/game/gameport.c | 50 ++++++++++++--------------------------------- 1 file changed, 13 insertions(+), 37 deletions(-) diff --git a/src/game/gameport.c b/src/game/gameport.c index d33b40959..7551b2b91 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -36,7 +36,6 @@ #include <86box/joystick_sw_pad.h> #include <86box/joystick_tm_fcs.h> - typedef struct { pc_timer_t timer; int axis_nr; @@ -58,10 +57,8 @@ typedef struct _joystick_instance_ { void *dat; } joystick_instance_t; - int joystick_type = 0; - static const joystick_if_t joystick_none = { "None", "none", @@ -76,25 +73,24 @@ static const joystick_if_t joystick_none = { 0 }; - static const struct { const joystick_if_t *joystick; } joysticks[] = { - { &joystick_none }, - { &joystick_2axis_2button }, - { &joystick_2axis_4button }, - { &joystick_2axis_6button }, - { &joystick_2axis_8button }, - { &joystick_3axis_2button }, - { &joystick_3axis_4button }, - { &joystick_4axis_4button }, - { &joystick_ch_flightstick_pro }, - { &joystick_sw_pad }, - { &joystick_tm_fcs }, - { NULL } + { &joystick_none }, + { &joystick_2axis_2button }, + { &joystick_2axis_4button }, + { &joystick_2axis_6button }, + { &joystick_2axis_8button }, + { &joystick_3axis_2button }, + { &joystick_3axis_4button }, + { &joystick_4axis_4button }, + { &joystick_ch_flightstick_pro }, + { &joystick_sw_pad }, + { &joystick_tm_fcs }, + { NULL } }; -static joystick_instance_t *joystick_instance = NULL; +static joystick_instance_t *joystick_instance = NULL; static uint8_t gameport_pnp_rom[] = { 0x09, 0xf8, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, /* BOX0002, dummy checksum (filled in by isapnp_add_card) */ @@ -120,14 +116,12 @@ static const isapnp_device_config_t gameport_pnp_defaults[] = { } }; - const device_t *standalone_gameport_type; int gameport_instance_id = 0; /* Linked list of active game ports. Only the top port responds to reads or writes, and ports at the standard 200h location are prioritized. */ static gameport_t *active_gameports = NULL; - char * joystick_get_name(int js) { @@ -136,7 +130,6 @@ joystick_get_name(int js) return (char *) joysticks[js].joystick->name; } - char * joystick_get_internal_name(int js) { @@ -146,7 +139,6 @@ joystick_get_internal_name(int js) return (char *) joysticks[js].joystick->internal_name; } - int joystick_get_from_internal_name(char *s) { @@ -161,56 +153,48 @@ joystick_get_from_internal_name(char *s) return 0; } - int joystick_get_max_joysticks(int js) { return joysticks[js].joystick->max_joysticks; } - int joystick_get_axis_count(int js) { return joysticks[js].joystick->axis_count; } - int joystick_get_button_count(int js) { return joysticks[js].joystick->button_count; } - int joystick_get_pov_count(int js) { return joysticks[js].joystick->pov_count; } - char * joystick_get_axis_name(int js, int id) { return (char *) joysticks[js].joystick->axis_names[id]; } - char * joystick_get_button_name(int js, int id) { return (char *) joysticks[js].joystick->button_names[id]; } - char * joystick_get_pov_name(int js, int id) { return (char *) joysticks[js].joystick->pov_names[id]; } - static void gameport_time(joystick_instance_t *joystick, int nr, int axis) { @@ -225,7 +209,6 @@ gameport_time(joystick_instance_t *joystick, int nr, int axis) } } - static void gameport_write(uint16_t addr, uint8_t val, void *priv) { @@ -250,7 +233,6 @@ gameport_write(uint16_t addr, uint8_t val, void *priv) cycles -= ISA_CYCLES(8); } - static uint8_t gameport_read(uint16_t addr, void *priv) { @@ -269,7 +251,6 @@ gameport_read(uint16_t addr, void *priv) return ret; } - static void timer_over(void *priv) { @@ -282,7 +263,6 @@ timer_over(void *priv) axis->joystick->intf->a0_over(axis->joystick->dat); } - void gameport_update_joystick_type(void) { @@ -298,7 +278,6 @@ gameport_update_joystick_type(void) } } - void gameport_remap(void *priv, uint16_t address) { @@ -346,7 +325,6 @@ gameport_remap(void *priv, uint16_t address) } } - static void gameport_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv) { @@ -359,7 +337,6 @@ gameport_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *pr gameport_remap(dev, (config->activate && (config->io[0].base != ISAPNP_IO_DISABLED)) ? config->io[0].base : 0); } - void * gameport_add(const device_t *gameport_type) { @@ -372,7 +349,6 @@ gameport_add(const device_t *gameport_type) return device_add_inst(gameport_type, gameport_instance_id++); } - static void * gameport_init(const device_t *info) { From 66a687d68ddcb69026ce6a94db7648b8478d0ce8 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:15:11 -0400 Subject: [PATCH 04/25] src/ --- src/acpi.c | 127 +++++++++++++++----------------- src/apm.c | 77 +++++++++---------- src/ddma.c | 26 +++---- src/ioapic.c | 18 +++-- src/nvr_at.c | 199 ++++++++++++++++++++++++++++++-------------------- src/nvr_ps2.c | 17 +++-- src/pit.c | 111 +++++++++++++++------------- src/port_6x.c | 76 +++++++++++-------- src/port_92.c | 76 +++++++++++-------- src/usb.c | 26 +++---- 10 files changed, 411 insertions(+), 342 deletions(-) diff --git a/src/acpi.c b/src/acpi.c index 7db4d0e26..11d991f63 100644 --- a/src/acpi.c +++ b/src/acpi.c @@ -1613,79 +1613,72 @@ acpi_init(const device_t *info) return dev; } -const device_t acpi_ali_device = -{ - "ALi M7101 ACPI", - "acpi_ali", - DEVICE_PCI, - VEN_ALI, - acpi_init, - acpi_close, - acpi_reset, - { NULL }, - acpi_speed_changed, - NULL, - NULL +const device_t acpi_ali_device = { + .name = "ALi M7101 ACPI", + .internal_name = "acpi_ali", + .flags = DEVICE_PCI, + .local = VEN_ALI, + .init = acpi_init, + .close = acpi_close, + .reset = acpi_reset, + { .available = NULL }, + .speed_changed = acpi_speed_changed, + .force_redraw = NULL, + .config = NULL }; -const device_t acpi_intel_device = -{ - "Intel ACPI", - "acpi_intel", - DEVICE_PCI, - VEN_INTEL, - acpi_init, - acpi_close, - acpi_reset, - { NULL }, - acpi_speed_changed, - NULL, - NULL +const device_t acpi_intel_device = { + .name = "Intel ACPI", + .internal_name = "acpi_intel", + .flags = DEVICE_PCI, + .local = VEN_INTEL, + .init = acpi_init, + .close = acpi_close, + .reset = acpi_reset, + { .available = NULL }, + .speed_changed = acpi_speed_changed, + .force_redraw = NULL, + .config = NULL }; -const device_t acpi_via_device = -{ - "VIA ACPI", - "acpi_via", - DEVICE_PCI, - VEN_VIA, - acpi_init, - acpi_close, - acpi_reset, - { NULL }, - acpi_speed_changed, - NULL, - NULL +const device_t acpi_via_device = { + .name = "VIA ACPI", + .internal_name = "acpi_via", + .flags = DEVICE_PCI, + .local = VEN_VIA, + .init = acpi_init, + .close = acpi_close, + .reset = acpi_reset, + { .available = NULL }, + .speed_changed = acpi_speed_changed, + .force_redraw = NULL, + .config = NULL }; - -const device_t acpi_via_596b_device = -{ - "VIA VT82C596 ACPI", - "acpi_via_596b", - DEVICE_PCI, - VEN_VIA_596B, - acpi_init, - acpi_close, - acpi_reset, - { NULL }, - acpi_speed_changed, - NULL, - NULL +const device_t acpi_via_596b_device = { + .name = "VIA VT82C596 ACPI", + .internal_name = "acpi_via_596b", + .flags = DEVICE_PCI, + .local = VEN_VIA_596B, + .init = acpi_init, + .close = acpi_close, + .reset = acpi_reset, + { .available = NULL }, + .speed_changed = acpi_speed_changed, + .force_redraw = NULL, + .config = NULL }; - -const device_t acpi_smc_device = -{ - "SMC FDC73C931APM ACPI", - "acpi_smc", - DEVICE_PCI, - VEN_SMC, - acpi_init, - acpi_close, - acpi_reset, - { NULL }, - acpi_speed_changed, - NULL, - NULL +const device_t acpi_smc_device = { + .name = "SMC FDC73C931APM ACPI", + .internal_name = "acpi_smc", + .flags = DEVICE_PCI, + .local = VEN_SMC, + .init = acpi_init, + .close = acpi_close, + .reset = acpi_reset, + { .available = NULL }, + .speed_changed = acpi_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/apm.c b/src/apm.c index def8db7bc..9bee70e78 100644 --- a/src/apm.c +++ b/src/apm.c @@ -123,49 +123,44 @@ static void } -const device_t apm_device = -{ - "Advanced Power Management", - "apm", - 0, - 0, - apm_init, - apm_close, - NULL, - { NULL }, - NULL, - NULL, - NULL +const device_t apm_device = { + .name = "Advanced Power Management", + .internal_name = "apm", + .flags = 0, + .local = 0, + .init = apm_init, + .close = apm_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t apm_pci_device = -{ - "Advanced Power Management (PCI)", - "apm_pci", - DEVICE_PCI, - 0, - apm_init, - apm_close, - apm_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t apm_pci_device = { + .name = "Advanced Power Management (PCI)", + .internal_name = "apm_pci", + .flags = DEVICE_PCI, + .local = 0, + .init = apm_init, + .close = apm_close, + .reset = apm_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t apm_pci_acpi_device = -{ - "Advanced Power Management (PCI)", - "apm_pci_acpi", - DEVICE_PCI, - 1, - apm_init, - apm_close, - apm_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t apm_pci_acpi_device = { + .name = "Advanced Power Management (PCI)", + .internal_name = "apm_pci_acpi", + .flags = DEVICE_PCI, + .local = 1, + .init = apm_init, + .close = apm_close, + .reset = apm_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/ddma.c b/src/ddma.c index c99225150..2993add52 100644 --- a/src/ddma.c +++ b/src/ddma.c @@ -184,18 +184,16 @@ ddma_init(const device_t *info) return dev; } - -const device_t ddma_device = -{ - "Distributed DMA", - "ddma", - DEVICE_PCI, - 0, - ddma_init, - ddma_close, - NULL, - { NULL }, - NULL, - NULL, - NULL +const device_t ddma_device = { + .name = "Distributed DMA", + .internal_name = "ddma", + .flags = DEVICE_PCI, + .local = 0, + .init = ddma_init, + .close = ddma_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/ioapic.c b/src/ioapic.c index b899beec0..e308b9a1c 100644 --- a/src/ioapic.c +++ b/src/ioapic.c @@ -121,11 +121,15 @@ ioapic_init(const device_t *info) const device_t ioapic_device = { - "I/O Advanced Programmable Interrupt Controller", - "ioapic", - DEVICE_AT, - 0, - ioapic_init, ioapic_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "I/O Advanced Programmable Interrupt Controller", + .internal_name = "ioapic", + .flags = DEVICE_AT, + .local = 0, + .init = ioapic_init, + .close = ioapic_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/nvr_at.c b/src/nvr_at.c index b3c6299b3..d7b1a780f 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -1120,113 +1120,156 @@ nvr_at_close(void *priv) nvr_at_inited = 0; } - const device_t at_nvr_old_device = { - "PC/AT NVRAM (No century)", - "at_nvr_old", - DEVICE_ISA | DEVICE_AT, - 0, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "PC/AT NVRAM (No century)", + .internal_name = "at_nvr_old", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t at_nvr_device = { - "PC/AT NVRAM", - "at_nvr", - DEVICE_ISA | DEVICE_AT, - 1, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "PC/AT NVRAM", + .internal_name = "at_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 1, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ps_nvr_device = { - "PS/1 or PS/2 NVRAM", - "ps_nvr", - DEVICE_PS2, - 2, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "PS/1 or PS/2 NVRAM", + .internal_name = "ps_nvr", + .flags = DEVICE_PS2, + .local = 2, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t amstrad_nvr_device = { - "Amstrad NVRAM", - "amstrad_nvr", - DEVICE_ISA | DEVICE_AT, - 3, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "Amstrad NVRAM", + .internal_name = "amstrad_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 3, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ibmat_nvr_device = { - "IBM AT NVRAM", - "ibmat_nvr", - DEVICE_ISA | DEVICE_AT, - 4, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "IBM AT NVRAM", + .internal_name = "ibmat_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 4, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t piix4_nvr_device = { - "Intel PIIX4 PC/AT NVRAM", - "piix4_nvr", - DEVICE_ISA | DEVICE_AT, - 9, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "Intel PIIX4 PC/AT NVRAM", + .internal_name = "piix4_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 9, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ami_1992_nvr_device = { - "AMI Color 1992 PC/AT NVRAM", - "ami_1992_nvr", - DEVICE_ISA | DEVICE_AT, - 12, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "AMI Color 1992 PC/AT NVRAM", + .internal_name = "ami_1992_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 12, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ami_1994_nvr_device = { - "AMI WinBIOS 1994 PC/AT NVRAM", - "ami_1994_nvr", - DEVICE_ISA | DEVICE_AT, - 13, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "AMI WinBIOS 1994 PC/AT NVRAM", + .internal_name = "ami_1994_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 13, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ami_1995_nvr_device = { - "AMI WinBIOS 1995 PC/AT NVRAM", - "ami_1995_nvr", - DEVICE_ISA | DEVICE_AT, - 14, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "AMI WinBIOS 1995 PC/AT NVRAM", + .internal_name = "ami_1995_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 14, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t via_nvr_device = { - "VIA PC/AT NVRAM", - "via_nvr", - DEVICE_ISA | DEVICE_AT, - 15, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "VIA PC/AT NVRAM", + .internal_name = "via_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 15, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t p6rp4_nvr_device = { - "ASUS P/I-P6RP4 PC/AT NVRAM", - "p6rp4_nvr", - DEVICE_ISA | DEVICE_AT, - 16, - nvr_at_init, nvr_at_close, nvr_at_reset, - { NULL }, nvr_at_speed_changed, - NULL + .name = "ASUS P/I-P6RP4 PC/AT NVRAM", + .internal_name = "p6rp4_nvr", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 16, + .init = nvr_at_init, + .close = nvr_at_close, + .reset = nvr_at_reset, + { .available = NULL }, + .speed_changed = nvr_at_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/nvr_ps2.c b/src/nvr_ps2.c index 5e38d5a57..cd6f47af7 100644 --- a/src/nvr_ps2.c +++ b/src/nvr_ps2.c @@ -153,10 +153,15 @@ ps2_nvr_close(void *priv) const device_t ps2_nvr_device = { - "PS/2 Secondary NVRAM", - "ps2_nvr", - 0, 0, - ps2_nvr_init, ps2_nvr_close, NULL, - { NULL }, NULL, - NULL + .name = "PS/2 Secondary NVRAM", + .internal_name = "ps2_nvr", + .flags = 0, + .local = 0, + .init = ps2_nvr_init, + .close = ps2_nvr_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/pit.c b/src/pit.c index 40927dea5..28fc9b3c2 100644 --- a/src/pit.c +++ b/src/pit.c @@ -841,67 +841,76 @@ pit_init(const device_t *info) return dev; } - -const device_t i8253_device = -{ - "Intel 8253/8253-5 Programmable Interval Timer", - "i8253", - DEVICE_ISA, - PIT_8253, - pit_init, pit_close, NULL, - { NULL }, NULL, NULL, - NULL +const device_t i8253_device = { + .name = "Intel 8253/8253-5 Programmable Interval Timer", + .internal_name = "i8253", + .flags = DEVICE_ISA, + .local = PIT_8253, + .init = pit_init, + .close = pit_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i8254_device = -{ - "Intel 8254 Programmable Interval Timer", - "i8254", - DEVICE_ISA, - PIT_8254, - pit_init, pit_close, NULL, - { NULL }, NULL, NULL, - NULL +const device_t i8254_device = { + .name = "Intel 8254 Programmable Interval Timer", + .internal_name = "i8254", + .flags = DEVICE_ISA, + .local = PIT_8254, + .init = pit_init, + .close = pit_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i8254_sec_device = -{ - "Intel 8254 Programmable Interval Timer (Secondary)", - "i8254_sec", - DEVICE_ISA, - PIT_8254 | PIT_SECONDARY, - pit_init, pit_close, NULL, - { NULL }, NULL, NULL, - NULL +const device_t i8254_sec_device = { + .name = "Intel 8254 Programmable Interval Timer (Secondary)", + .internal_name = "i8254_sec", + .flags = DEVICE_ISA, + .local = PIT_8254 | PIT_SECONDARY, + .init = pit_init, + .close = pit_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i8254_ext_io_device = -{ - "Intel 8254 Programmable Interval Timer (External I/O)", - "i8254_ext_io", - DEVICE_ISA, - PIT_8254 | PIT_EXT_IO, - pit_init, pit_close, NULL, - { NULL }, NULL, NULL, - NULL +const device_t i8254_ext_io_device = { + .name = "Intel 8254 Programmable Interval Timer (External I/O)", + .internal_name = "i8254_ext_io", + .flags = DEVICE_ISA, + .local = PIT_8254 | PIT_EXT_IO, + .init = pit_init, + .close = pit_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i8254_ps2_device = -{ - "Intel 8254 Programmable Interval Timer (PS/2)", - "i8254_ps2", - DEVICE_ISA, - PIT_8254 | PIT_PS2 | PIT_EXT_IO, - pit_init, pit_close, NULL, - { NULL }, NULL, NULL, - NULL +const device_t i8254_ps2_device = { + .name = "Intel 8254 Programmable Interval Timer (PS/2)", + .internal_name = "i8254_ps2", + .flags = DEVICE_ISA, + .local = PIT_8254 | PIT_PS2 | PIT_EXT_IO, + .init = pit_init, + .close = pit_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - pit_t * pit_common_init(int type, void (*out0)(int new_out, int old_out), void (*out1)(int new_out, int old_out)) { diff --git a/src/port_6x.c b/src/port_6x.c index 365b2aff9..dafa5d987 100644 --- a/src/port_6x.c +++ b/src/port_6x.c @@ -173,46 +173,58 @@ port_6x_init(const device_t *info) return dev; } - const device_t port_6x_device = { - "Port 6x Registers", - "port_6x", - 0, - 0, - port_6x_init, port_6x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Port 6x Registers", + .internal_name = "port_6x", + .flags = 0, + .local = 0, + .init = port_6x_init, + .close = port_6x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t port_6x_xi8088_device = { - "Port 6x Registers (Xi8088)", - "port_6x_xi8088", - 0, - PORT_6X_TURBO | PORT_6X_EXT_REF | PORT_6X_MIRROR, - port_6x_init, port_6x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Port 6x Registers (Xi8088)", + .internal_name = "port_6x_xi8088", + .flags = 0, + .local = PORT_6X_TURBO | PORT_6X_EXT_REF | PORT_6X_MIRROR, + .init = port_6x_init, + .close = port_6x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t port_6x_ps2_device = { - "Port 6x Registers (IBM PS/2)", - "port_6x_ps2", - 0, - PORT_6X_EXT_REF, - port_6x_init, port_6x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Port 6x Registers (IBM PS/2)", + .internal_name = "port_6x_ps2", + .flags = 0, + .local = PORT_6X_EXT_REF, + .init = port_6x_init, + .close = port_6x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t port_6x_olivetti_device = { - "Port 6x Registers (Olivetti)", - "port_6x_olivetti", - 0, - PORT_6X_SWA, - port_6x_init, port_6x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Port 6x Registers (Olivetti)", + .internal_name = "port_6x_olivetti", + .flags = 0, + .local = PORT_6X_SWA, + .init = port_6x_init, + .close = port_6x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/port_92.c b/src/port_92.c index 6981a3596..c4c421f53 100644 --- a/src/port_92.c +++ b/src/port_92.c @@ -216,46 +216,58 @@ port_92_init(const device_t *info) return dev; } - const device_t port_92_device = { - "Port 92 Register", - "port_92", - 0, - 0, - port_92_init, port_92_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Port 92 Register", + .internal_name = "port_92", + .flags = 0, + .local = 0, + .init = port_92_init, + .close = port_92_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t port_92_inv_device = { - "Port 92 Register (inverted bits 2-7)", - "port_92_inv", - 0, - PORT_92_INV, - port_92_init, port_92_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Port 92 Register (inverted bits 2-7)", + .internal_name = "port_92_inv", + .flags = 0, + .local = PORT_92_INV, + .init = port_92_init, + .close = port_92_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t port_92_word_device = { - "Port 92 Register (16-bit)", - "port_92_word", - 0, - PORT_92_WORD, - port_92_init, port_92_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Port 92 Register (16-bit)", + .internal_name = "port_92_word", + .flags = 0, + .local = PORT_92_WORD, + .init = port_92_init, + .close = port_92_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t port_92_pci_device = { - "Port 92 Register (PCI)", - "port_92_pci", - 0, - PORT_92_PCI, - port_92_init, port_92_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Port 92 Register (PCI)", + .internal_name = "port_92_pci", + .flags = 0, + .local = PORT_92_PCI, + .init = port_92_init, + .close = port_92_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/usb.c b/src/usb.c index d1424023e..2f8f957b5 100644 --- a/src/usb.c +++ b/src/usb.c @@ -409,18 +409,16 @@ usb_init(const device_t *info) return dev; } - -const device_t usb_device = -{ - "Universal Serial Bus", - "usb", - DEVICE_PCI, - 0, - usb_init, - usb_close, - usb_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t usb_device = { + .name = "Universal Serial Bus", + .internal_name = "usb", + .flags = DEVICE_PCI, + .local = 0, + .init = usb_init, + .close = usb_close, + .reset = usb_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; From a52f0cca79ad50d12b22dbeb37f18cd5a98d75ea Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:21:08 -0400 Subject: [PATCH 05/25] src/chipset --- src/chipset/82c100.c | 18 +- src/chipset/acc2168.c | 23 +- src/chipset/ali1429.c | 36 ++-- src/chipset/ali1489.c | 24 +-- src/chipset/ali1531.c | 23 +- src/chipset/ali1541.c | 23 +- src/chipset/ali1543.c | 45 ++-- src/chipset/ali1621.c | 23 +- src/chipset/ali6117.c | 52 +++-- src/chipset/contaq_82c59x.c | 46 ++-- src/chipset/cs4031.c | 23 +- src/chipset/cs8230.c | 19 +- src/chipset/et6000.c | 23 +- src/chipset/gc100.c | 37 ++-- src/chipset/headland.c | 73 ++++--- src/chipset/ims8848.c | 19 +- src/chipset/intel_420ex.c | 52 +++-- src/chipset/intel_4x0.c | 410 +++++++++++++++++------------------- src/chipset/intel_82335.c | 23 +- src/chipset/intel_i450kx.c | 23 +- src/chipset/intel_piix.c | 176 ++++++++-------- src/chipset/intel_sio.c | 50 +++-- src/chipset/neat.c | 19 +- src/chipset/olivetti_eva.c | 18 +- src/chipset/opti283.c | 23 +- src/chipset/opti291.c | 23 +- src/chipset/opti391.c | 23 +- src/chipset/opti495.c | 38 ++-- src/chipset/opti499.c | 19 +- src/chipset/opti5x7.c | 23 +- src/chipset/opti822.c | 23 +- src/chipset/opti895.c | 38 ++-- src/chipset/scamp.c | 19 +- src/chipset/scat.c | 55 +++-- src/chipset/sis_5511.c | 23 +- src/chipset/sis_5571.c | 23 +- src/chipset/sis_85c310.c | 19 +- src/chipset/sis_85c496.c | 52 +++-- src/chipset/sis_85c4xx.c | 73 ++++--- src/chipset/sis_85c50x.c | 20 +- src/chipset/stpc.c | 151 +++++++------ src/chipset/umc_8886.c | 37 ++-- src/chipset/umc_hb4.c | 19 +- src/chipset/via_apollo.c | 188 ++++++++--------- src/chipset/via_pipc.c | 155 +++++++------- src/chipset/via_vt82c49x.c | 76 ++++--- src/chipset/via_vt82c505.c | 23 +- src/chipset/vl82c480.c | 38 ++-- src/chipset/wd76c10.c | 23 +- 49 files changed, 1268 insertions(+), 1214 deletions(-) diff --git a/src/chipset/82c100.c b/src/chipset/82c100.c index 76a6590bf..8b2259374 100644 --- a/src/chipset/82c100.c +++ b/src/chipset/82c100.c @@ -397,11 +397,15 @@ ct_82c100_init(const device_t *info) const device_t ct_82c100_device = { - "C&T 82C100", - "ct_82c100", - 0, - 0, - ct_82c100_init, ct_82c100_close, ct_82c100_reset, - { NULL }, NULL, NULL, - NULL + .name = "C&T 82C100", + .internal_name = "ct_82c100", + .flags = 0, + .local = 0, + .init = ct_82c100_init, + .close = ct_82c100_close, + .reset = ct_82c100_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/acc2168.c b/src/chipset/acc2168.c index ba8331447..9b8865784 100644 --- a/src/chipset/acc2168.c +++ b/src/chipset/acc2168.c @@ -193,14 +193,15 @@ acc2168_init(const device_t *info) } const device_t acc2168_device = { - "ACC 2046/2168", - "acc2168", - 0, - 0, - acc2168_init, - acc2168_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "ACC 2046/2168", + .internal_name = "acc2168", + .flags = 0, + .local = 0, + .init = acc2168_init, + .close = acc2168_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/ali1429.c b/src/chipset/ali1429.c index ccd7e5007..468ed4f00 100644 --- a/src/chipset/ali1429.c +++ b/src/chipset/ali1429.c @@ -339,21 +339,29 @@ ali1429_init(const device_t *info) } const device_t ali1429_device = { - "ALi M1429", - "ali1429", - 0, - 0, - ali1429_init, ali1429_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "ALi M1429", + .internal_name = "ali1429", + .flags = 0, + .local = 0, + .init = ali1429_init, + .close = ali1429_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ali1429g_device = { - "ALi M1429G", - "ali1429g", - 0, - 1, - ali1429_init, ali1429_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "ALi M1429G", + .internal_name = "ali1429g", + .flags = 0, + .local = 1, + .init = ali1429_init, + .close = ali1429_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/ali1489.c b/src/chipset/ali1489.c index 1ab245b40..5ba53f34c 100644 --- a/src/chipset/ali1489.c +++ b/src/chipset/ali1489.c @@ -626,16 +626,16 @@ ali1489_init(const device_t *info) return dev; } - const device_t ali1489_device = { - "ALi M1489", - "ali1489", - 0, - 0, - ali1489_init, - ali1489_close, - ali1489_reset, - {NULL}, - NULL, - NULL, - NULL}; + .name = "ALi M1489", + .internal_name = "ali1489", + .flags = 0, + .local = 0, + .init = ali1489_init, + .close = ali1489_close, + .reset = ali1489_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/ali1531.c b/src/chipset/ali1531.c index 12f425c36..350ec146f 100644 --- a/src/chipset/ali1531.c +++ b/src/chipset/ali1531.c @@ -376,17 +376,16 @@ ali1531_init(const device_t *info) return dev; } - const device_t ali1531_device = { - "ALi M1531 CPU-to-PCI Bridge", - "ali1531", - DEVICE_PCI, - 0, - ali1531_init, - ali1531_close, - ali1531_reset, - {NULL}, - NULL, - NULL, - NULL + .name = "ALi M1531 CPU-to-PCI Bridge", + .internal_name = "ali1531", + .flags = DEVICE_PCI, + .local = 0, + .init = ali1531_init, + .close = ali1531_close, + .reset = ali1531_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/ali1541.c b/src/chipset/ali1541.c index 3f94ec694..097726106 100644 --- a/src/chipset/ali1541.c +++ b/src/chipset/ali1541.c @@ -641,17 +641,16 @@ ali1541_init(const device_t *info) return dev; } - const device_t ali1541_device = { - "ALi M1541 CPU-to-PCI Bridge", - "ali1541", - DEVICE_PCI, - 0, - ali1541_init, - ali1541_close, - ali1541_reset, - {NULL}, - NULL, - NULL, - NULL + .name = "ALi M1541 CPU-to-PCI Bridge", + .internal_name = "ali1541", + .flags = DEVICE_PCI, + .local = 0, + .init = ali1541_init, + .close = ali1541_close, + .reset = ali1541_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/ali1543.c b/src/chipset/ali1543.c index d555fb88e..9811b198c 100644 --- a/src/chipset/ali1543.c +++ b/src/chipset/ali1543.c @@ -1741,31 +1741,30 @@ ali1543_init(const device_t *info) return dev; } - const device_t ali1543_device = { - "ALi M1543 Desktop South Bridge", - "ali1543", - DEVICE_PCI, - 0, - ali1543_init, - ali1543_close, - ali1543_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "ALi M1543 Desktop South Bridge", + .internal_name = "ali1543", + .flags = DEVICE_PCI, + .local = 0, + .init = ali1543_init, + .close = ali1543_close, + .reset = ali1543_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ali1543c_device = { - "ALi M1543C Desktop South Bridge", - "ali1543c", - DEVICE_PCI, - 1, - ali1543_init, - ali1543_close, - ali1543_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "ALi M1543C Desktop South Bridge", + .internal_name = "ali1543c", + .flags = DEVICE_PCI, + .local = 1, + .init = ali1543_init, + .close = ali1543_close, + .reset = ali1543_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/ali1621.c b/src/chipset/ali1621.c index 65cee2fd6..c234e65ce 100644 --- a/src/chipset/ali1621.c +++ b/src/chipset/ali1621.c @@ -670,17 +670,16 @@ ali1621_init(const device_t *info) return dev; } - const device_t ali1621_device = { - "ALi M1621 CPU-to-PCI Bridge", - "ali1621", - DEVICE_PCI, - 0, - ali1621_init, - ali1621_close, - ali1621_reset, - {NULL}, - NULL, - NULL, - NULL + .name = "ALi M1621 CPU-to-PCI Bridge", + .internal_name = "ali1621", + .flags = DEVICE_PCI, + .local = 0, + .init = ali1621_init, + .close = ali1621_close, + .reset = ali1621_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/ali6117.c b/src/chipset/ali6117.c index 04869fe50..815085ee8 100644 --- a/src/chipset/ali6117.c +++ b/src/chipset/ali6117.c @@ -375,34 +375,30 @@ ali6117_init(const device_t *info) return dev; } - -const device_t ali1217_device = -{ - "ALi M1217", - "ali1217", - DEVICE_AT, - 0x8, - ali6117_init, - ali6117_close, - ali6117_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t ali1217_device = { + .name = "ALi M1217", + .internal_name = "ali1217", + .flags = DEVICE_AT, + .local = 0x8, + .init = ali6117_init, + .close = ali6117_close, + .reset = ali6117_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t ali6117d_device = -{ - "ALi M6117D", - "ali6117d", - DEVICE_AT, - 0x2, - ali6117_init, - ali6117_close, - ali6117_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t ali6117d_device = { + .name = "ALi M6117D", + .internal_name = "ali6117d", + .flags = DEVICE_AT, + .local = 0x2, + .init = ali6117_init, + .close = ali6117_close, + .reset = ali6117_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/contaq_82c59x.c b/src/chipset/contaq_82c59x.c index 0abab7f02..6763202d0 100644 --- a/src/chipset/contaq_82c59x.c +++ b/src/chipset/contaq_82c59x.c @@ -346,32 +346,30 @@ contaq_82c59x_init(const device_t *info) return dev; } - const device_t contaq_82c596a_device = { - "Contaq 82C596A", - "contaq_82c596a", - 0, - 0, - contaq_82c59x_init, - contaq_82c59x_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "Contaq 82C596A", + .internal_name = "contaq_82c596a", + .flags = 0, + .local = 0, + .init = contaq_82c59x_init, + .close = contaq_82c59x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t contaq_82c597_device = { - "Contaq 82C597", - "contaq_82c597", - 0, - 1, - contaq_82c59x_init, - contaq_82c59x_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "Contaq 82C597", + .internal_name = "contaq_82c597", + .flags = 0, + .local = 1, + .init = contaq_82c59x_init, + .close = contaq_82c59x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/cs4031.c b/src/chipset/cs4031.c index 01e3edc18..d5970b048 100644 --- a/src/chipset/cs4031.c +++ b/src/chipset/cs4031.c @@ -176,14 +176,15 @@ cs4031_init(const device_t *info) } const device_t cs4031_device = { - "Chips & Technogies CS4031", - "cs4031", - 0, - 0, - cs4031_init, - cs4031_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "Chips & Technogies CS4031", + .internal_name = "cs4031", + .flags = 0, + .local = 0, + .init = cs4031_init, + .close = cs4031_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/cs8230.c b/src/chipset/cs8230.c index 3718a93ca..f6a77cabc 100644 --- a/src/chipset/cs8230.c +++ b/src/chipset/cs8230.c @@ -156,13 +156,16 @@ static void return cs8230; } - const device_t cs8230_device = { - "C&T CS8230 (386/AT)", - "cs8230", - 0, - 0, - cs8230_init, cs8230_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "C&T CS8230 (386/AT)", + .internal_name = "cs8230", + .flags = 0, + .local = 0, + .init = cs8230_init, + .close = cs8230_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/et6000.c b/src/chipset/et6000.c index 4dd00bdf3..1d7541c7e 100644 --- a/src/chipset/et6000.c +++ b/src/chipset/et6000.c @@ -149,14 +149,15 @@ et6000_init(const device_t *info) } const device_t et6000_device = { - "ETEQ Cheetah ET6000", - "et6000", - 0, - 0, - et6000_init, - et6000_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "ETEQ Cheetah ET6000", + .internal_name = "et6000", + .flags = 0, + .local = 0, + .init = et6000_init, + .close = et6000_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/gc100.c b/src/chipset/gc100.c index 6618534af..09df87856 100644 --- a/src/chipset/gc100.c +++ b/src/chipset/gc100.c @@ -230,23 +230,30 @@ gc100_init(const device_t *info) return dev; } - const device_t gc100_device = { - "G2 GC100", - "gc100", - 0, - 0, - gc100_init, gc100_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "G2 GC100", + .internal_name = "gc100", + .flags = 0, + .local = 0, + .init = gc100_init, + .close = gc100_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t gc100a_device = { - "G2 GC100A", - "gc100a", - 0, - 1, - gc100_init, gc100_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "G2 GC100A", + .internal_name = "gc100a", + .flags = 0, + .local = 1, + .init = gc100_init, + .close = gc100_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/headland.c b/src/chipset/headland.c index 8a67df9b1..ed2e318fc 100644 --- a/src/chipset/headland.c +++ b/src/chipset/headland.c @@ -684,43 +684,58 @@ headland_init(const device_t *info) return(dev); } - const device_t headland_gc10x_device = { - "Headland GC101/102/103", - "headland_gc10x", - 0, - 0, - headland_init, headland_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Headland GC101/102/103", + .internal_name = "headland_gc10x", + .flags = 0, + .local = 0, + .init = headland_init, + .close = headland_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t headland_ht18a_device = { - "Headland HT18 Rev. A", - "headland_ht18a", - 0, - 1, - headland_init, headland_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Headland HT18 Rev. A", + .internal_name = "headland_ht18a", + .flags = 0, + .local = 1, + .init = headland_init, + .close = headland_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t headland_ht18b_device = { - "Headland HT18 Rev. B", - "headland_ht18b", - 0, - 2, - headland_init, headland_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Headland HT18 Rev. B", + .internal_name = "headland_ht18b", + .flags = 0, + .local = 2, + .init = headland_init, + .close = headland_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t headland_ht18c_device = { - "Headland HT18 Rev. C", - "headland_ht18c", - 0, - 8, - headland_init, headland_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Headland HT18 Rev. C", + .internal_name = "headland_ht18c", + .flags = 0, + .local = 8, + .init = headland_init, + .close = headland_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/ims8848.c b/src/chipset/ims8848.c index d96c53508..10e87b530 100644 --- a/src/chipset/ims8848.c +++ b/src/chipset/ims8848.c @@ -400,13 +400,16 @@ ims8848_init(const device_t *info) return dev; } - const device_t ims8848_device = { - "IMS 8848/8849", - "ims8848", - 0, - 0, - ims8848_init, ims8848_close, ims8848_reset, - { NULL }, NULL, NULL, - NULL + .name = "IMS 8848/8849", + .internal_name = "ims8848", + .flags = 0, + .local = 0, + .init = ims8848_init, + .close = ims8848_close, + .reset = ims8848_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/intel_420ex.c b/src/chipset/intel_420ex.c index aed5a6e6d..187e6f636 100644 --- a/src/chipset/intel_420ex.c +++ b/src/chipset/intel_420ex.c @@ -528,34 +528,30 @@ i420ex_init(const device_t *info) return dev; } - -const device_t i420ex_device = -{ - "Intel 82420EX", - "i420ex", - DEVICE_PCI, - 0x00, - i420ex_init, - i420ex_close, - i420ex_reset, - { NULL }, - i420ex_speed_changed, - NULL, - NULL +const device_t i420ex_device = { + .name = "Intel 82420EX", + .internal_name = "i420ex", + .flags = DEVICE_PCI, + .local = 0x00, + .init = i420ex_init, + .close = i420ex_close, + .reset = i420ex_reset, + { .available = NULL }, + .speed_changed = i420ex_speed_changed, + .force_redraw = NULL, + .config = NULL }; - -const device_t i420ex_ide_device = -{ - "Intel 82420EX (With IDE)", - "i420ex_ide", - DEVICE_PCI, - 0x01, - i420ex_init, - i420ex_close, - i420ex_reset, - { NULL }, - i420ex_speed_changed, - NULL, - NULL +const device_t i420ex_ide_device = { + .name = "Intel 82420EX (With IDE)", + .internal_name = "i420ex_ide", + .flags = DEVICE_PCI, + .local = 0x01, + .init = i420ex_init, + .close = i420ex_close, + .reset = i420ex_reset, + { .available = NULL }, + .speed_changed = i420ex_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/intel_4x0.c b/src/chipset/intel_4x0.c index b0e043613..7e8ff9405 100644 --- a/src/chipset/intel_4x0.c +++ b/src/chipset/intel_4x0.c @@ -1633,252 +1633,226 @@ static void return dev; } - -const device_t i420tx_device = -{ - "Intel 82424TX", - "i420tx", - DEVICE_PCI, - INTEL_420TX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i420tx_device = { + .name = "Intel 82424TX", + .internal_name = "i420tx", + .flags = DEVICE_PCI, + .local = INTEL_420TX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i420zx_device = -{ - "Intel 82424ZX", - "i420zx", - DEVICE_PCI, - INTEL_420ZX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i420zx_device = { + .name = "Intel 82424ZX", + .internal_name = "i420zx", + .flags = DEVICE_PCI, + .local = INTEL_420ZX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i430lx_device = -{ - "Intel 82434LX", - "i430lx", - DEVICE_PCI, - INTEL_430LX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i430lx_device = { + .name = "Intel 82434LX", + .internal_name = "i430lx", + .flags = DEVICE_PCI, + .local = INTEL_430LX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i430nx_device = -{ - "Intel 82434NX", - "i430nx", - DEVICE_PCI, - INTEL_430NX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i430nx_device = { + .name = "Intel 82434NX", + .internal_name = "i430nx", + .flags = DEVICE_PCI, + .local = INTEL_430NX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i430fx_device = -{ - "Intel SB82437FX-66", - "i430fx", - DEVICE_PCI, - INTEL_430FX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i430fx_device = { + .name = "Intel SB82437FX-66", + .internal_name = "i430fx", + .flags = DEVICE_PCI, + .local = INTEL_430FX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i430fx_rev02_device = -{ - "Intel SB82437FX-66 (Rev. 02)", - "i430fx_rev02", - DEVICE_PCI, - 0x0200 | INTEL_430FX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i430fx_rev02_device = { + .name = "Intel SB82437FX-66 (Rev. 02)", + .internal_name = "i430fx_rev02", + .flags = DEVICE_PCI, + .local = 0x0200 | INTEL_430FX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i430hx_device = -{ - "Intel 82439HX", - "i430hx", - DEVICE_PCI, - INTEL_430HX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i430hx_device = { + .name = "Intel 82439HX", + .internal_name = "i430hx", + .flags = DEVICE_PCI, + .local = INTEL_430HX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i430vx_device = -{ - "Intel 82437VX", - "i430vx", - DEVICE_PCI, - INTEL_430VX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i430vx_device = { + .name = "Intel 82437VX", + .internal_name = "i430vx", + .flags = DEVICE_PCI, + .local = INTEL_430VX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i430tx_device = -{ - "Intel 82439TX", - "i430tx", - DEVICE_PCI, - INTEL_430TX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i430tx_device = { + .name = "Intel 82439TX", + .internal_name = "i430tx", + .flags = DEVICE_PCI, + .local = INTEL_430TX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t i440fx_device = -{ - "Intel 82441FX", - "i440fx", - DEVICE_PCI, - INTEL_440FX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440fx_device = { + .name = "Intel 82441FX", + .internal_name = "i440fx", + .flags = DEVICE_PCI, + .local = INTEL_440FX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t i440lx_device = -{ - "Intel 82443LX", - "i440lx", - DEVICE_PCI, - INTEL_440LX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440lx_device = { + .name = "Intel 82443LX", + .internal_name = "i440lx", + .flags = DEVICE_PCI, + .local = INTEL_440LX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t i440ex_device = -{ - "Intel 82443EX", - "i440ex", - DEVICE_PCI, - INTEL_440EX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440ex_device = { + .name = "Intel 82443EX", + .internal_name = "i440ex", + .flags = DEVICE_PCI, + .local = INTEL_440EX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t i440bx_device = -{ - "Intel 82443BX", - "i440bx", - DEVICE_PCI, - 0x8000 | INTEL_440BX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440bx_device = { + .name = "Intel 82443BX", + .internal_name = "i440bx", + .flags = DEVICE_PCI, + .local = 0x8000 | INTEL_440BX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t i440bx_no_agp_device = -{ - "Intel 82443BX", - "i440bx_no_agp", - DEVICE_PCI, - 0x8200 | INTEL_440BX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440bx_no_agp_device = { + .name = "Intel 82443BX", + .internal_name = "i440bx_no_agp", + .flags = DEVICE_PCI, + .local = 0x8200 | INTEL_440BX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t i440gx_device = -{ - "Intel 82443GX", - "i440gx", - DEVICE_PCI, - 0x8000 | INTEL_440GX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440gx_device = { + .name = "Intel 82443GX", + .internal_name = "i440gx", + .flags = DEVICE_PCI, + .local = 0x8000 | INTEL_440GX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t i440zx_device = -{ - "Intel 82443ZX", - "i440zx", - DEVICE_PCI, - 0x8000 | INTEL_440ZX, - i4x0_init, - i4x0_close, - i4x0_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440zx_device = { + .name = "Intel 82443ZX", + .internal_name = "i440zx", + .flags = DEVICE_PCI, + .local = 0x8000 | INTEL_440ZX, + .init = i4x0_init, + .close = i4x0_close, + .reset = i4x0_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/intel_82335.c b/src/chipset/intel_82335.c index 6dbe0ea4f..2c018d3ef 100644 --- a/src/chipset/intel_82335.c +++ b/src/chipset/intel_82335.c @@ -197,14 +197,15 @@ intel_82335_init(const device_t *info) } const device_t intel_82335_device = { - "Intel 82335", - "intel_82335", - 0, - 0, - intel_82335_init, - intel_82335_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "Intel 82335", + .internal_name = "intel_82335", + .flags = 0, + .local = 0, + .init = intel_82335_init, + .close = intel_82335_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/intel_i450kx.c b/src/chipset/intel_i450kx.c index 315947108..ad92218f8 100644 --- a/src/chipset/intel_i450kx.c +++ b/src/chipset/intel_i450kx.c @@ -806,17 +806,16 @@ i450kx_init(const device_t *info) return dev; } - const device_t i450kx_device = { - "Intel 450KX (Mars)", - "i450kx", - DEVICE_PCI, - 0, - i450kx_init, - i450kx_close, - i450kx_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "Intel 450KX (Mars)", + .internal_name = "i450kx", + .flags = DEVICE_PCI, + .local = 0, + .init = i450kx_init, + .close = i450kx_close, + .reset = i450kx_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/intel_piix.c b/src/chipset/intel_piix.c index 0a6204b19..025862c44 100644 --- a/src/chipset/intel_piix.c +++ b/src/chipset/intel_piix.c @@ -1599,108 +1599,100 @@ static void return dev; } - -const device_t piix_device = -{ - "Intel 82371FB (PIIX)", - "piix", - DEVICE_PCI, - 0x122e0101, - piix_init, - piix_close, - piix_reset, - { NULL }, - piix_speed_changed, - NULL, - NULL +const device_t piix_device = { + .name = "Intel 82371FB (PIIX)", + .internal_name = "piix", + .flags = DEVICE_PCI, + .local = 0x122e0101, + .init = piix_init, + .close = piix_close, + .reset = piix_reset, + { .available = NULL }, + .speed_changed = piix_speed_changed, + .force_redraw = NULL, + .config = NULL }; -const device_t piix_rev02_device = -{ - "Intel 82371FB (PIIX) (Faulty BusMastering!!)", - "piix_rev02", - DEVICE_PCI, - 0x122e0121, - piix_init, - piix_close, - piix_reset, - { NULL }, - piix_speed_changed, - NULL, - NULL +const device_t piix_rev02_device = { + .name = "Intel 82371FB (PIIX) (Faulty BusMastering!!)", + .internal_name = "piix_rev02", + .flags = DEVICE_PCI, + .local = 0x122e0121, + .init = piix_init, + .close = piix_close, + .reset = piix_reset, + { .available = NULL }, + .speed_changed = piix_speed_changed, + .force_redraw = NULL, + .config = NULL }; -const device_t piix3_device = -{ - "Intel 82371SB (PIIX3)", - "piix3", - DEVICE_PCI, - 0x70000403, - piix_init, - piix_close, - piix_reset, - { NULL }, - piix_speed_changed, - NULL, - NULL +const device_t piix3_device = { + .name = "Intel 82371SB (PIIX3)", + .internal_name = "piix3", + .flags = DEVICE_PCI, + .local = 0x70000403, + .init = piix_init, + .close = piix_close, + .reset = piix_reset, + { .available = NULL }, + .speed_changed = piix_speed_changed, + .force_redraw = NULL, + .config = NULL }; -const device_t piix3_ioapic_device = -{ - "Intel 82371SB (PIIX3) (Boards with I/O APIC)", - "piix3_ioapic", - DEVICE_PCI, - 0x70001403, - piix_init, - piix_close, - piix_reset, - { NULL }, - piix_speed_changed, - NULL, - NULL +const device_t piix3_ioapic_device = { + .name = "Intel 82371SB (PIIX3) (Boards with I/O APIC)", + .internal_name = "piix3_ioapic", + .flags = DEVICE_PCI, + .local = 0x70001403, + .init = piix_init, + .close = piix_close, + .reset = piix_reset, + { .available = NULL }, + .speed_changed = piix_speed_changed, + .force_redraw = NULL, + .config = NULL }; -const device_t piix4_device = -{ - "Intel 82371AB/EB (PIIX4/PIIX4E)", - "piix4", - DEVICE_PCI, - 0x71100004, - piix_init, - piix_close, - piix_reset, - { NULL }, - piix_speed_changed, - NULL, - NULL +const device_t piix4_device = { + .name = "Intel 82371AB/EB (PIIX4/PIIX4E)", + .internal_name = "piix4", + .flags = DEVICE_PCI, + .local = 0x71100004, + .init = piix_init, + .close = piix_close, + .reset = piix_reset, + { .available = NULL }, + .speed_changed = piix_speed_changed, + .force_redraw = NULL, + .config = NULL }; -const device_t piix4e_device = -{ - "Intel 82371EB (PIIX4E)", - "piix4e", - DEVICE_PCI, - 0x71100094, - piix_init, - piix_close, - piix_reset, - { NULL }, - piix_speed_changed, - NULL, - NULL +const device_t piix4e_device = { + .name = "Intel 82371EB (PIIX4E)", + .internal_name = "piix4e", + .flags = DEVICE_PCI, + .local = 0x71100094, + .init = piix_init, + .close = piix_close, + .reset = piix_reset, + { .available = NULL }, + .speed_changed = piix_speed_changed, + .force_redraw = NULL, + .config = NULL }; -const device_t slc90e66_device = -{ - "SMSC SLC90E66 (Victory66)", - "slc90e66", - DEVICE_PCI, - 0x94600005, - piix_init, - piix_close, - piix_reset, - { NULL }, - piix_speed_changed, - NULL, - NULL +const device_t slc90e66_device = { + .name = "SMSC SLC90E66 (Victory66)", + .internal_name = "slc90e66", + .flags = DEVICE_PCI, + .local = 0x94600005, + .init = piix_init, + .close = piix_close, + .reset = piix_reset, + { .available = NULL }, + .speed_changed = piix_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/intel_sio.c b/src/chipset/intel_sio.c index df8bb8e61..ab535cb65 100644 --- a/src/chipset/intel_sio.c +++ b/src/chipset/intel_sio.c @@ -545,33 +545,31 @@ sio_init(const device_t *info) } -const device_t sio_device = -{ - "Intel 82378IB (SIO)", - "sio", - DEVICE_PCI, - 0x00, - sio_init, - sio_close, - sio_reset, - { NULL }, - sio_speed_changed, - NULL, - NULL +const device_t sio_device = { + .name = "Intel 82378IB (SIO)", + .internal_name = "sio", + .flags = DEVICE_PCI, + .local = 0x00, + .init = sio_init, + .close = sio_close, + .reset = sio_reset, + { .available = NULL }, + .speed_changed = sio_speed_changed, + .force_redraw = NULL, + .config = NULL }; -const device_t sio_zb_device = -{ - "Intel 82378ZB (SIO)", - "sio_zb", - DEVICE_PCI, - 0x03, - sio_init, - sio_close, - sio_reset, - { NULL }, - sio_speed_changed, - NULL, - NULL +const device_t sio_zb_device = { + .name = "Intel 82378ZB (SIO)", + .internal_name = "sio_zb", + .flags = DEVICE_PCI, + .local = 0x03, + .init = sio_init, + .close = sio_close, + .reset = sio_reset, + { .available = NULL }, + .speed_changed = sio_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/neat.c b/src/chipset/neat.c index 258982ea7..8e7bc1937 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -824,13 +824,16 @@ neat_init(const device_t *info) return dev; } - const device_t neat_device = { - "C&T CS8121 (NEAT)", - "neat", - 0, - 0, - neat_init, neat_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "C&T CS8121 (NEAT)", + .internal_name = "neat", + .flags = 0, + .local = 0, + .init = neat_init, + .close = neat_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/olivetti_eva.c b/src/chipset/olivetti_eva.c index 2f31458be..0728d44e5 100644 --- a/src/chipset/olivetti_eva.c +++ b/src/chipset/olivetti_eva.c @@ -157,11 +157,15 @@ olivetti_eva_init(const device_t *info) } const device_t olivetti_eva_device = { - "Olivetti EVA Gate Array", - "olivetta_eva", - 0, - 0, - olivetti_eva_init, olivetti_eva_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Olivetti EVA Gate Array", + .internal_name = "olivetta_eva", + .flags = 0, + .local = 0, + .init = olivetti_eva_init, + .close = olivetti_eva_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/opti283.c b/src/chipset/opti283.c index d02ea4add..8e9403c29 100644 --- a/src/chipset/opti283.c +++ b/src/chipset/opti283.c @@ -302,17 +302,16 @@ opti283_init(const device_t *info) return dev; } - const device_t opti283_device = { - "OPTi 82C283", - "opti283", - 0, - 0, - opti283_init, - opti283_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "OPTi 82C283", + .internal_name = "opti283", + .flags = 0, + .local = 0, + .init = opti283_init, + .close = opti283_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/opti291.c b/src/chipset/opti291.c index c981f6b36..6bf8851e7 100644 --- a/src/chipset/opti291.c +++ b/src/chipset/opti291.c @@ -147,14 +147,15 @@ opti291_init(const device_t *info) } const device_t opti291_device = { - "OPTi 82C291", - "opti291", - 0, - 0, - opti291_init, - opti291_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "OPTi 82C291", + .internal_name = "opti291", + .flags = 0, + .local = 0, + .init = opti291_init, + .close = opti291_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/opti391.c b/src/chipset/opti391.c index fde71fe3e..51c8d9daa 100644 --- a/src/chipset/opti391.c +++ b/src/chipset/opti391.c @@ -211,17 +211,16 @@ opti391_init(const device_t *info) return dev; } - const device_t opti391_device = { - "OPTi 82C391", - "opti391", - 0, - 0, - opti391_init, - opti391_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "OPTi 82C391", + .internal_name = "opti391", + .flags = 0, + .local = 0, + .init = opti391_init, + .close = opti391_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/opti495.c b/src/chipset/opti495.c index 605d0fb8d..c02f9cc1f 100644 --- a/src/chipset/opti495.c +++ b/src/chipset/opti495.c @@ -236,24 +236,30 @@ opti495_init(const device_t *info) return dev; } - const device_t opti493_device = { - "OPTi 82C493", - "opti493", - 0, - 0, - opti495_init, opti495_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "OPTi 82C493", + .internal_name = "opti493", + .flags = 0, + .local = 0, + .init = opti495_init, + .close = opti495_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t opti495_device = { - "OPTi 82C495", - "opti495", - 0, - 1, - opti495_init, opti495_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "OPTi 82C495", + .internal_name = "opti495", + .flags = 0, + .local = 1, + .init = opti495_init, + .close = opti495_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/opti499.c b/src/chipset/opti499.c index ca9692964..08c06d58c 100644 --- a/src/chipset/opti499.c +++ b/src/chipset/opti499.c @@ -253,13 +253,16 @@ opti499_init(const device_t *info) return dev; } - const device_t opti499_device = { - "OPTi 82C499", - "opti499", - 0, - 1, - opti499_init, opti499_close, opti499_reset, - { NULL }, NULL, NULL, - NULL + .name = "OPTi 82C499", + .internal_name = "opti499", + .flags = 0, + .local = 1, + .init = opti499_init, + .close = opti499_close, + .reset = opti499_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/opti5x7.c b/src/chipset/opti5x7.c index 54ecd6c76..f0459a97f 100644 --- a/src/chipset/opti5x7.c +++ b/src/chipset/opti5x7.c @@ -176,14 +176,15 @@ opti5x7_init(const device_t *info) } const device_t opti5x7_device = { - "OPTi 82C5x6/82C5x7", - "opti5x7", - 0, - 0, - opti5x7_init, - opti5x7_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "OPTi 82C5x6/82C5x7", + .internal_name = "opti5x7", + .flags = 0, + .local = 0, + .init = opti5x7_init, + .close = opti5x7_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/opti822.c b/src/chipset/opti822.c index 42a7c89cd..0235e3ee9 100644 --- a/src/chipset/opti822.c +++ b/src/chipset/opti822.c @@ -310,14 +310,15 @@ opti822_init(const device_t *info) } const device_t opti822_device = { - "OPTi 82C822 PCIB", - "opti822", - DEVICE_PCI, - 0, - opti822_init, - opti822_close, - opti822_reset, - {NULL}, - NULL, - NULL, - NULL}; + .name = "OPTi 82C822 PCIB", + .internal_name = "opti822", + .flags = DEVICE_PCI, + .local = 0, + .init = opti822_init, + .close = opti822_close, + .reset = opti822_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/opti895.c b/src/chipset/opti895.c index 14b0080fd..00f632f59 100644 --- a/src/chipset/opti895.c +++ b/src/chipset/opti895.c @@ -273,24 +273,30 @@ opti895_init(const device_t *info) return dev; } - const device_t opti802g_device = { - "OPTi 82C802G", - "opti802g", - 0, - 0, - opti895_init, opti895_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "OPTi 82C802G", + .internal_name = "opti802g", + .flags = 0, + .local = 0, + .init = opti895_init, + .close = opti895_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t opti895_device = { - "OPTi 82C895", - "opti895", - 0, - 0, - opti895_init, opti895_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "OPTi 82C895", + .internal_name = "opti895", + .flags = 0, + .local = 0, + .init = opti895_init, + .close = opti895_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/scamp.c b/src/chipset/scamp.c index 42f579dca..621f7d9c5 100644 --- a/src/chipset/scamp.c +++ b/src/chipset/scamp.c @@ -955,13 +955,16 @@ scamp_init(const device_t *info) return dev; } - const device_t vlsi_scamp_device = { - "VLSI SCAMP", - "vlsi_scamp", - 0, - 0, - scamp_init, scamp_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "VLSI SCAMP", + .internal_name = "vlsi_scamp", + .flags = 0, + .local = 0, + .init = scamp_init, + .close = scamp_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/scat.c b/src/chipset/scat.c index 0780ec507..1e7ba9263 100644 --- a/src/chipset/scat.c +++ b/src/chipset/scat.c @@ -1542,33 +1542,44 @@ scat_init(const device_t *info) return(dev); } - const device_t scat_device = { - "C&T SCAT (v1)", - "scat", - 0, - 0, - scat_init, scat_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "C&T SCAT (v1)", + .internal_name = "scat", + .flags = 0, + .local = 0, + .init = scat_init, + .close = scat_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t scat_4_device = { - "C&T SCAT (v4)", - "scat_4", - 0, - 4, - scat_init, scat_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "C&T SCAT (v4)", + .internal_name = "scat_4", + .flags = 0, + .local = 4, + .init = scat_init, + .close = scat_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t scat_sx_device = { - "C&T SCATsx", - "scat_sx", - 0, - 32, - scat_init, scat_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "C&T SCATsx", + .internal_name = "scat_sx", + .flags = 0, + .local = 32, + .init = scat_init, + .close = scat_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/sis_5511.c b/src/chipset/sis_5511.c index 44e8f98de..63950d47a 100644 --- a/src/chipset/sis_5511.c +++ b/src/chipset/sis_5511.c @@ -740,14 +740,15 @@ sis_5511_init(const device_t *info) } const device_t sis_5511_device = { - "SiS 5511", - "sis_5511", - DEVICE_PCI, - 0, - sis_5511_init, - sis_5511_close, - sis_5511_reset, - {NULL}, - NULL, - NULL, - NULL}; + .name = "SiS 5511", + .internal_name = "sis_5511", + .flags = DEVICE_PCI, + .local = 0, + .init = sis_5511_init, + .close = sis_5511_close, + .reset = sis_5511_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/sis_5571.c b/src/chipset/sis_5571.c index 4cc99319f..3f678d87b 100644 --- a/src/chipset/sis_5571.c +++ b/src/chipset/sis_5571.c @@ -742,14 +742,15 @@ sis_5571_init(const device_t *info) } const device_t sis_5571_device = { - "SiS 5571", - "sis_5571", - DEVICE_PCI, - 0, - sis_5571_init, - sis_5571_close, - sis_5571_reset, - {NULL}, - NULL, - NULL, - NULL}; + .name = "SiS 5571", + .internal_name = "sis_5571", + .flags = DEVICE_PCI, + .local = 0, + .init = sis_5571_init, + .close = sis_5571_close, + .reset = sis_5571_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/chipset/sis_85c310.c b/src/chipset/sis_85c310.c index e1130b733..2e83e3367 100644 --- a/src/chipset/sis_85c310.c +++ b/src/chipset/sis_85c310.c @@ -135,13 +135,16 @@ rabbit_init(const device_t *info) return dev; } - const device_t rabbit_device = { - "SiS Rabbit", - "rabbit", - 0, - 0, - rabbit_init, rabbit_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SiS Rabbit", + .internal_name = "rabbit", + .flags = 0, + .local = 0, + .init = rabbit_init, + .close = rabbit_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/sis_85c496.c b/src/chipset/sis_85c496.c index a649f5053..b900d4443 100644 --- a/src/chipset/sis_85c496.c +++ b/src/chipset/sis_85c496.c @@ -618,34 +618,30 @@ static void return dev; } - -const device_t sis_85c496_device = -{ - "SiS 85c496/85c497", - "sis_85c496", - DEVICE_PCI, - 0, - sis_85c496_init, - sis_85c496_close, - sis_85c496_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t sis_85c496_device = { + .name = "SiS 85c496/85c497", + .internal_name = "sis_85c496", + .flags = DEVICE_PCI, + .local = 0, + .init = sis_85c496_init, + .close = sis_85c496_close, + .reset = sis_85c496_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t sis_85c496_ls486e_device = -{ - "SiS 85c496/85c497 (Lucky Star LS-486E)", - "sis_85c496_ls486e", - DEVICE_PCI, - 1, - sis_85c496_init, - sis_85c496_close, - sis_85c496_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t sis_85c496_ls486e_device = { + .name = "SiS 85c496/85c497 (Lucky Star LS-486E)", + .internal_name = "sis_85c496_ls486e", + .flags = DEVICE_PCI, + .local = 1, + .init = sis_85c496_init, + .close = sis_85c496_close, + .reset = sis_85c496_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/sis_85c4xx.c b/src/chipset/sis_85c4xx.c index c679c1dad..b705eb32e 100644 --- a/src/chipset/sis_85c4xx.c +++ b/src/chipset/sis_85c4xx.c @@ -358,44 +358,59 @@ sis_85c4xx_init(const device_t *info) return dev; } - const device_t sis_85c401_device = { - "SiS 85c401/85c402", - "sis_85c401", - 0, - 0x060, - sis_85c4xx_init, sis_85c4xx_close, sis_85c4xx_reset, - { NULL }, NULL, NULL, - NULL + .name = "SiS 85c401/85c402", + .internal_name = "sis_85c401", + .flags = 0, + .local = 0x060, + .init = sis_85c4xx_init, + .close = sis_85c4xx_close, + .reset = sis_85c4xx_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t sis_85c460_device = { - "SiS 85c460", - "sis_85c460", - 0, - 0x050, - sis_85c4xx_init, sis_85c4xx_close, sis_85c4xx_reset, - { NULL }, NULL, NULL, - NULL + .name = "SiS 85c460", + .internal_name = "sis_85c460", + .flags = 0, + .local = 0x050, + .init = sis_85c4xx_init, + .close = sis_85c4xx_close, + .reset = sis_85c4xx_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; /* TODO: Log to make sure the registers are correct. */ const device_t sis_85c461_device = { - "SiS 85c461", - "sis_85c461", - 0, - 0x050, - sis_85c4xx_init, sis_85c4xx_close, sis_85c4xx_reset, - { NULL }, NULL, NULL, - NULL + .name = "SiS 85c461", + .internal_name = "sis_85c461", + .flags = 0, + .local = 0x050, + .init = sis_85c4xx_init, + .close = sis_85c4xx_close, + .reset = sis_85c4xx_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t sis_85c471_device = { - "SiS 85c407/85c471", - "sis_85c471", - 0, - 0x150, - sis_85c4xx_init, sis_85c4xx_close, sis_85c4xx_reset, - { NULL }, NULL, NULL, - NULL + .name = "SiS 85c407/85c471", + .internal_name = "sis_85c471", + .flags = 0, + .local = 0x150, + .init = sis_85c4xx_init, + .close = sis_85c4xx_close, + .reset = sis_85c4xx_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/sis_85c50x.c b/src/chipset/sis_85c50x.c index 93bbcb745..9d5dddebd 100644 --- a/src/chipset/sis_85c50x.c +++ b/src/chipset/sis_85c50x.c @@ -390,14 +390,16 @@ sis_85c50x_init(const device_t *info) return dev; } - const device_t sis_85c50x_device = { - "SiS 85C50x", - "sis_85c50x", - DEVICE_PCI, - 0, - sis_85c50x_init, sis_85c50x_close, - sis_85c50x_reset, { NULL }, - NULL, NULL, - NULL + .name = "SiS 85C50x", + .internal_name = "sis_85c50x", + .flags = DEVICE_PCI, + .local = 0, + .init = sis_85c50x_init, + .close = sis_85c50x_close, + .reset = sis_85c50x_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/stpc.c b/src/chipset/stpc.c index 8dcfc2862..f9bd8faff 100644 --- a/src/chipset/stpc.c +++ b/src/chipset/stpc.c @@ -1055,95 +1055,88 @@ stpc_lpt_init(const device_t *info) return dev; } - /* STPC SoCs */ -const device_t stpc_client_device = -{ - "STPC Client", - "stpc_client", - DEVICE_PCI, - STPC_CLIENT, - stpc_init, - stpc_close, - stpc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t stpc_client_device = { + .name = "STPC Client", + .internal_name = "stpc_client", + .flags = DEVICE_PCI, + .local = STPC_CLIENT, + .init = stpc_init, + .close = stpc_close, + .reset = stpc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t stpc_consumer2_device = -{ - "STPC Consumer-II", - "stpc_consumer2", - DEVICE_PCI, - STPC_CONSUMER2, - stpc_init, - stpc_close, - stpc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t stpc_consumer2_device = { + .name = "STPC Consumer-II", + .internal_name = "stpc_consumer2", + .flags = DEVICE_PCI, + .local = STPC_CONSUMER2, + .init = stpc_init, + .close = stpc_close, + .reset = stpc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t stpc_elite_device = -{ - "STPC Elite", - "stpc_elite", - DEVICE_PCI, - STPC_ELITE, - stpc_init, - stpc_close, - stpc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t stpc_elite_device = { + .name = "STPC Elite", + .internal_name = "stpc_elite", + .flags = DEVICE_PCI, + .local = STPC_ELITE, + .init = stpc_init, + .close = stpc_close, + .reset = stpc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t stpc_atlas_device = -{ - "STPC Atlas", - "stpc_atlas", - DEVICE_PCI, - STPC_ATLAS, - stpc_init, - stpc_close, - stpc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t stpc_atlas_device = { + .name = "STPC Atlas", + .internal_name = "stpc_atlas", + .flags = DEVICE_PCI, + .local = STPC_ATLAS, + .init = stpc_init, + .close = stpc_close, + .reset = stpc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; /* Auxiliary devices */ -const device_t stpc_serial_device = -{ - "STPC Serial UARTs", - "stpc_serial", - 0, - 0, - stpc_serial_init, - stpc_serial_close, - NULL, - { NULL }, - NULL, - NULL, - NULL +const device_t stpc_serial_device = { + .name = "STPC Serial UARTs", + .internal_name = "stpc_serial", + .flags = 0, + .local = 0, + .init = stpc_serial_init, + .close = stpc_serial_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t stpc_lpt_device = -{ - "STPC Parallel Port", - "stpc_lpt", - 0, - 0, - stpc_lpt_init, - stpc_lpt_close, - stpc_lpt_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t stpc_lpt_device = { + .name = "STPC Parallel Port", + .internal_name = "stpc_lpt", + .flags = 0, + .local = 0, + .init = stpc_lpt_init, + .close = stpc_lpt_close, + .reset = stpc_lpt_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/umc_8886.c b/src/chipset/umc_8886.c index ea99460d7..72dc8778b 100644 --- a/src/chipset/umc_8886.c +++ b/src/chipset/umc_8886.c @@ -377,23 +377,30 @@ umc_8886_init(const device_t *info) return dev; } - const device_t umc_8886f_device = { - "UMC 8886F", - "umc_8886f", - DEVICE_PCI, - 0x8886, - umc_8886_init, umc_8886_close, umc_8886_reset, - { NULL }, NULL, NULL, - NULL + .name = "UMC 8886F", + .internal_name = "umc_8886f", + .flags = DEVICE_PCI, + .local = 0x8886, + .init = umc_8886_init, + .close = umc_8886_close, + .reset = umc_8886_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t umc_8886af_device = { - "UMC 8886AF/8886BF", - "umc_8886af", - DEVICE_PCI, - 0x886a, - umc_8886_init, umc_8886_close, umc_8886_reset, - { NULL }, NULL, NULL, - NULL + .name = "UMC 8886AF/8886BF", + .internal_name = "umc_8886af", + .flags = DEVICE_PCI, + .local = 0x886a, + .init = umc_8886_init, + .close = umc_8886_close, + .reset = umc_8886_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/umc_hb4.c b/src/chipset/umc_hb4.c index 6bb7b13d3..4440b7eef 100644 --- a/src/chipset/umc_hb4.c +++ b/src/chipset/umc_hb4.c @@ -416,13 +416,16 @@ hb4_init(const device_t *info) return dev; } - const device_t umc_hb4_device = { - "UMC HB4(8881F)", - "umc_hb4", - DEVICE_PCI, - 0x886a, - hb4_init, hb4_close, hb4_reset, - { NULL }, NULL, NULL, - NULL + .name = "UMC HB4(8881F)", + .internal_name = "umc_hb4", + .flags = DEVICE_PCI, + .local = 0x886a, + .init = hb4_init, + .close = hb4_close, + .reset = hb4_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/via_apollo.c b/src/chipset/via_apollo.c index 60aa83a47..9a491478f 100644 --- a/src/chipset/via_apollo.c +++ b/src/chipset/via_apollo.c @@ -760,118 +760,114 @@ via_apollo_close(void *priv) free(dev); } -const device_t via_vpx_device = -{ - "VIA Apollo VPX", - "via_vpx", - DEVICE_PCI, - VIA_585, /*VT82C585*/ - via_apollo_init, - via_apollo_close, - via_apollo_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vpx_device = { + .name = "VIA Apollo VPX", + .internal_name = "via_vpx", + .flags = DEVICE_PCI, + .local = VIA_585, /*VT82C585*/ + .init = via_apollo_init, + .close = via_apollo_close, + .reset = via_apollo_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t amd640_device = -{ - "AMD 640 System Controller", - "amd640", - DEVICE_PCI, - VIA_595, /*VT82C595*/ - via_apollo_init, - via_apollo_close, - via_apollo_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t amd640_device = { + .name = "AMD 640 System Controller", + .internal_name = "amd640", + .flags = DEVICE_PCI, + .local = VIA_595, /*VT82C595*/ + .init = via_apollo_init, + .close = via_apollo_close, + .reset = via_apollo_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t via_vp3_device = -{ - "VIA Apollo VP3", - "via_vp3", - DEVICE_PCI, - VIA_597, /*VT82C597*/ - via_apollo_init, - via_apollo_close, - via_apollo_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vp3_device = { + .name = "VIA Apollo VP3", + .internal_name = "via_vp3", + .flags = DEVICE_PCI, + .local = VIA_597, /*VT82C597*/ + .init = via_apollo_init, + .close = via_apollo_close, + .reset = via_apollo_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t via_mvp3_device = -{ - "VIA Apollo MVP3", - "via_mvp3", - DEVICE_PCI, - VIA_598, /*VT82C598MVP*/ - via_apollo_init, - via_apollo_close, - via_apollo_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_mvp3_device = { + .name = "VIA Apollo MVP3", + .internal_name = "via_mvp3", + .flags = DEVICE_PCI, + .local = VIA_598, /*VT82C598MVP*/ + .init = via_apollo_init, + .close = via_apollo_close, + .reset = via_apollo_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t via_apro_device = { - "VIA Apollo Pro", - "via_apro", - DEVICE_PCI, - VIA_691, /*VT82C691*/ - via_apollo_init, - via_apollo_close, - via_apollo_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "VIA Apollo Pro", + .internal_name = "via_apro", + .flags = DEVICE_PCI, + .local = VIA_691, /*VT82C691*/ + .init = via_apollo_init, + .close = via_apollo_close, + .reset = via_apollo_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t via_apro133_device = { - "VIA Apollo Pro133", - "via_apro133", - DEVICE_PCI, - VIA_693A, /*VT82C693A*/ - via_apollo_init, - via_apollo_close, - via_apollo_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "VIA Apollo Pro133", + .internal_name = "via_apro133", + .flags = DEVICE_PCI, + .local = VIA_693A, /*VT82C693A*/ + .init = via_apollo_init, + .close = via_apollo_close, + .reset = via_apollo_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t via_apro133a_device = { - "VIA Apollo Pro133A", - "via_apro_133a", - DEVICE_PCI, - VIA_694, /*VT82C694X*/ - via_apollo_init, - via_apollo_close, - via_apollo_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "VIA Apollo Pro133A", + .internal_name = "via_apro_133a", + .flags = DEVICE_PCI, + .local = VIA_694, /*VT82C694X*/ + .init = via_apollo_init, + .close = via_apollo_close, + .reset = via_apollo_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t via_vt8601_device = { - "VIA Apollo ProMedia", - "via_vt8601", - DEVICE_PCI, - VIA_8601, /*VT8601*/ - via_apollo_init, - via_apollo_close, - via_apollo_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "VIA Apollo ProMedia", + .internal_name = "via_vt8601", + .flags = DEVICE_PCI, + .local = VIA_8601, /*VT8601*/ + .init = via_apollo_init, + .close = via_apollo_close, + .reset = via_apollo_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/via_pipc.c b/src/chipset/via_pipc.c index b985b2ba8..076328a00 100644 --- a/src/chipset/via_pipc.c +++ b/src/chipset/via_pipc.c @@ -1631,97 +1631,86 @@ pipc_close(void *p) free(dev); } - -const device_t via_vt82c586b_device = -{ - "VIA VT82C586B", - "via_vt82c586b", - DEVICE_PCI, - VIA_PIPC_586B, - pipc_init, - pipc_close, - pipc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vt82c586b_device = { + .name = "VIA VT82C586B", + .internal_name = "via_vt82c586b", + .flags = DEVICE_PCI, + .local = VIA_PIPC_586B, + .init = pipc_init, + .close = pipc_close, + .reset = pipc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t via_vt82c596a_device = -{ - "VIA VT82C596A", - "via_vt82c596a", - DEVICE_PCI, - VIA_PIPC_596A, - pipc_init, - pipc_close, - pipc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vt82c596a_device = { + .name = "VIA VT82C596A", + .internal_name = "via_vt82c596a", + .flags = DEVICE_PCI, + .local = VIA_PIPC_596A, + .init = pipc_init, + .close = pipc_close, + .reset = pipc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t via_vt82c596b_device = -{ - "VIA VT82C596B", - "via_vt82c596b", - DEVICE_PCI, - VIA_PIPC_596B, - pipc_init, - pipc_close, - pipc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vt82c596b_device = { + .name = "VIA VT82C596B", + .internal_name = "via_vt82c596b", + .flags = DEVICE_PCI, + .local = VIA_PIPC_596B, + .init = pipc_init, + .close = pipc_close, + .reset = pipc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t via_vt82c686a_device = -{ - "VIA VT82C686A", - "via_vt82c686a", - DEVICE_PCI, - VIA_PIPC_686A, - pipc_init, - pipc_close, - pipc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vt82c686a_device = { + .name = "VIA VT82C686A", + .internal_name = "via_vt82c686a", + .flags = DEVICE_PCI, + .local = VIA_PIPC_686A, + .init = pipc_init, + .close = pipc_close, + .reset = pipc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t via_vt82c686b_device = -{ - "VIA VT82C686B", - "via_vt82c686b", - DEVICE_PCI, - VIA_PIPC_686B, - pipc_init, - pipc_close, - pipc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vt82c686b_device = { + .name = "VIA VT82C686B", + .internal_name = "via_vt82c686b", + .flags = DEVICE_PCI, + .local = VIA_PIPC_686B, + .init = pipc_init, + .close = pipc_close, + .reset = pipc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t via_vt8231_device = -{ - "VIA VT8231", - "via_vt8231", - DEVICE_PCI, - VIA_PIPC_8231, - pipc_init, - pipc_close, - pipc_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vt8231_device = { + .name = "VIA VT8231", + .internal_name = "via_vt8231", + .flags = DEVICE_PCI, + .local = VIA_PIPC_8231, + .init = pipc_init, + .close = pipc_close, + .reset = pipc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/via_vt82c49x.c b/src/chipset/via_vt82c49x.c index 80a00e606..7efa76d01 100644 --- a/src/chipset/via_vt82c49x.c +++ b/src/chipset/via_vt82c49x.c @@ -358,46 +358,58 @@ vt82c49x_init(const device_t *info) return dev; } - const device_t via_vt82c49x_device = { - "VIA VT82C49X", - "via_vt82c49x", - 0, - 0, - vt82c49x_init, vt82c49x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "VIA VT82C49X", + .internal_name = "via_vt82c49x", + .flags = 0, + .local = 0, + .init = vt82c49x_init, + .close = vt82c49x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t via_vt82c49x_pci_device = { - "VIA VT82C49X PCI", - "via_vt82c49x_pci", - DEVICE_PCI, - 0, - vt82c49x_init, vt82c49x_close, vt82c49x_reset, - { NULL }, NULL, NULL, - NULL + .name = "VIA VT82C49X PCI", + .internal_name = "via_vt82c49x_pci", + .flags = DEVICE_PCI, + .local = 0, + .init = vt82c49x_init, + .close = vt82c49x_close, + .reset = vt82c49x_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t via_vt82c49x_ide_device = { - "VIA VT82C49X (With IDE)", - "via_vt82c49x_ide", - 0, - 1, - vt82c49x_init, vt82c49x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "VIA VT82C49X (With IDE)", + .internal_name = "via_vt82c49x_ide", + .flags = 0, + .local = 1, + .init = vt82c49x_init, + .close = vt82c49x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t via_vt82c49x_pci_ide_device = { - "VIA VT82C49X PCI (With IDE)", - "via_vt82c49x_pci_ide", - DEVICE_PCI, - 1, - vt82c49x_init, vt82c49x_close, vt82c49x_reset, - { NULL }, NULL, NULL, - NULL + .name = "VIA VT82C49X PCI (With IDE)", + .internal_name = "via_vt82c49x_pci_ide", + .flags = DEVICE_PCI, + .local = 1, + .init = vt82c49x_init, + .close = vt82c49x_close, + .reset = vt82c49x_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/via_vt82c505.c b/src/chipset/via_vt82c505.c index 6dea85d80..5ce799ab6 100644 --- a/src/chipset/via_vt82c505.c +++ b/src/chipset/via_vt82c505.c @@ -216,17 +216,16 @@ vt82c505_init(const device_t *info) return dev; } - const device_t via_vt82c505_device = { - "VIA VT82C505", - "via_vt82c505", - DEVICE_PCI, - 0, - vt82c505_init, - vt82c505_close, - vt82c505_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "VIA VT82C505", + .internal_name = "via_vt82c505", + .flags = DEVICE_PCI, + .local = 0, + .init = vt82c505_init, + .close = vt82c505_close, + .reset = vt82c505_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/vl82c480.c b/src/chipset/vl82c480.c index 455e8bf16..ec4703399 100644 --- a/src/chipset/vl82c480.c +++ b/src/chipset/vl82c480.c @@ -188,24 +188,30 @@ vl82c480_init(const device_t *info) return dev; } - const device_t vl82c480_device = { - "VLSI VL82c480", - "vl82c480", - 0, - 0x90, - vl82c480_init, vl82c480_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "VLSI VL82c480", + .internal_name = "vl82c480", + .flags = 0, + .local = 0x90, + .init = vl82c480_init, + .close = vl82c480_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t vl82c486_device = { - "VLSI VL82c486", - "vl82c486", - 0, - 0x98, - vl82c480_init, vl82c480_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "VLSI VL82c486", + .internal_name = "vl82c486", + .flags = 0, + .local = 0x98, + .init = vl82c480_init, + .close = vl82c480_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/chipset/wd76c10.c b/src/chipset/wd76c10.c index f737c371b..138349955 100644 --- a/src/chipset/wd76c10.c +++ b/src/chipset/wd76c10.c @@ -538,14 +538,15 @@ wd76c10_init(const device_t *info) } const device_t wd76c10_device = { - "Western Digital WD76C10", - "wd76c10", - 0, - 0, - wd76c10_init, - wd76c10_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "Western Digital WD76C10", + .internal_name = "wd76c10", + .flags = 0, + .local = 0, + .init = wd76c10_init, + .close = wd76c10_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; From a7edaf0608fab00cbcaa8818e7609077959f8d09 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:28:28 -0400 Subject: [PATCH 06/25] src/device --- src/device/bugger.c | 19 +- src/device/cassette.c | 18 +- src/device/hwm_gl518sm.c | 37 ++-- src/device/hwm_lm75.c | 36 +-- src/device/hwm_lm78.c | 114 ++++++---- src/device/hwm_vt82c686.c | 19 +- src/device/ibm_5161.c | 26 +-- src/device/isamem.c | 220 ++++++++++-------- src/device/isartc.c | 93 ++++---- src/device/keyboard_at.c | 382 ++++++++++++++++++-------------- src/device/keyboard_xt.c | 191 +++++++++------- src/device/mouse.c | 39 ++-- src/device/mouse_bus.c | 53 +++-- src/device/mouse_ps2.c | 19 +- src/device/mouse_serial.c | 54 +++-- src/device/pci_bridge.c | 251 ++++++++++----------- src/device/phoenix_486_jumper.c | 38 ++-- src/device/postcard.c | 18 +- src/device/serial.c | 145 +++++++----- src/device/smbus_ali7101.c | 19 +- src/device/smbus_piix4.c | 37 ++-- 21 files changed, 1047 insertions(+), 781 deletions(-) diff --git a/src/device/bugger.c b/src/device/bugger.c index 214f8acb8..bcea70af3 100644 --- a/src/device/bugger.c +++ b/src/device/bugger.c @@ -354,13 +354,16 @@ bug_close(UNUSED(void *priv)) bug_read, NULL, NULL, bug_write, NULL, NULL, NULL); } - const device_t bugger_device = { - "ISA/PCI Bus Bugger", - "bugger", - DEVICE_ISA | DEVICE_AT, - 0, - bug_init, bug_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "ISA/PCI Bus Bugger", + .internal_name = "bugger", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = bug_init, + .close = bug_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/cassette.c b/src/device/cassette.c index 2874971f5..211909dcb 100644 --- a/src/device/cassette.c +++ b/src/device/cassette.c @@ -714,11 +714,15 @@ cassette_init(const device_t *info) const device_t cassette_device = { - "IBM PC/PCjr Cassette Device", - "cassette", - 0, - 0, - cassette_init, cassette_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "IBM PC/PCjr Cassette Device", + .internal_name = "cassette", + .flags = 0, + .local = 0, + .init = cassette_init, + .close = cassette_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/hwm_gl518sm.c b/src/device/hwm_gl518sm.c index 126ad182f..4afe016f2 100644 --- a/src/device/hwm_gl518sm.c +++ b/src/device/hwm_gl518sm.c @@ -296,25 +296,32 @@ gl518sm_init(const device_t *info) return dev; } - /* GL518SM on SMBus address 2Ch */ const device_t gl518sm_2c_device = { - "Genesys Logic GL518SM Hardware Monitor", - "gl518sm_2c", - DEVICE_ISA, - 0x2c, - gl518sm_init, gl518sm_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Genesys Logic GL518SM Hardware Monitor", + .internal_name = "gl518sm_2c", + .flags = DEVICE_ISA, + .local = 0x2c, + .init = gl518sm_init, + .close = gl518sm_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; /* GL518SM on SMBus address 2Dh */ const device_t gl518sm_2d_device = { - "Genesys Logic GL518SM Hardware Monitor", - "gl518sm_2d", - DEVICE_ISA, - 0x2d, - gl518sm_init, gl518sm_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Genesys Logic GL518SM Hardware Monitor", + .internal_name = "gl518sm_2d", + .flags = DEVICE_ISA, + .local = 0x2d, + .init = gl518sm_init, + .close = gl518sm_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/hwm_lm75.c b/src/device/hwm_lm75.c index f9bfa397b..b169d8e9e 100644 --- a/src/device/hwm_lm75.c +++ b/src/device/hwm_lm75.c @@ -243,24 +243,32 @@ lm75_init(const device_t *info) /* LM75 on SMBus address 4Ah, reporting temperatures[1]. */ const device_t lm75_1_4a_device = { - "National Semiconductor LM75 Temperature Sensor", - "lm75_1_4a", - DEVICE_ISA, - 0x14a, - lm75_init, lm75_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor LM75 Temperature Sensor", + .internal_name = "lm75_1_4a", + .flags = DEVICE_ISA, + .local = 0x14a, + .init = lm75_init, + .close = lm75_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; /* LM75 secondary/tertiary temperature sensors built into the Winbond W83781D family. Not to be used stand-alone. */ const device_t lm75_w83781d_device = { - "Winbond W83781D Secondary Temperature Sensor", - "lm75_w83781d", - DEVICE_ISA, - 0, - lm75_init, lm75_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83781D Secondary Temperature Sensor", + .internal_name = "lm75_w83781d", + .flags = DEVICE_ISA, + .local = 0, + .init = lm75_init, + .close = lm75_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/hwm_lm78.c b/src/device/hwm_lm78.c index 87793bbac..627a0e15e 100644 --- a/src/device/hwm_lm78.c +++ b/src/device/hwm_lm78.c @@ -783,75 +783,93 @@ lm78_init(const device_t *info) return dev; } - /* National Semiconductor LM78 on ISA and SMBus. */ const device_t lm78_device = { - "National Semiconductor LM78 Hardware Monitor", - "lm78", - DEVICE_ISA, - 0x290 | LM78_I2C, - lm78_init, lm78_close, lm78_reset, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor LM78 Hardware Monitor", + .internal_name = "lm78", + .flags = DEVICE_ISA, + .local = 0x290 | LM78_I2C, + .init = lm78_init, + .close = lm78_close, + .reset = lm78_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - /* Winbond W83781D on ISA and SMBus. */ const device_t w83781d_device = { - "Winbond W83781D Hardware Monitor", - "w83781d", - DEVICE_ISA, - 0x290 | LM78_I2C | LM78_W83781D, - lm78_init, lm78_close, lm78_reset, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83781D Hardware Monitor", + .internal_name = "w83781d", + .flags = DEVICE_ISA, + .local = 0x290 | LM78_I2C | LM78_W83781D, + .init = lm78_init, + .close = lm78_close, + .reset = lm78_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - /* Winbond W83781D on ISA and SMBus. */ const device_t w83781d_p5a_device = { - "Winbond W83781D Hardware Monitor (ASUS P5A)", - "w83781d_p5a", - DEVICE_ISA, - 0x290 | LM78_I2C | LM78_W83781D | LM78_P5A, - lm78_init, lm78_close, lm78_reset, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83781D Hardware Monitor (ASUS P5A)", + .internal_name = "w83781d_p5a", + .flags = DEVICE_ISA, + .local = 0x290 | LM78_I2C | LM78_W83781D | LM78_P5A, + .init = lm78_init, + .close = lm78_close, + .reset = lm78_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - /* The AS99127F is an ASIC manufactured by Holtek for ASUS, containing an I2C-only W83781D clone with additional voltages, GPIOs and fan control. */ const device_t as99127f_device = { - "ASUS AS99127F Rev. 1 Hardware Monitor", - "as99137f", - DEVICE_ISA, - LM78_I2C | LM78_AS99127F_REV1, - lm78_init, lm78_close, lm78_reset, - { NULL }, NULL, NULL, - NULL + .name = "ASUS AS99127F Rev. 1 Hardware Monitor", + .internal_name = "as99137f", + .flags = DEVICE_ISA, + .local = LM78_I2C | LM78_AS99127F_REV1, + .init = lm78_init, + .close = lm78_close, + .reset = lm78_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - /* Rev. 2 is manufactured by Winbond and differs only in GPI registers. */ const device_t as99127f_rev2_device = { - "ASUS AS99127F Rev. 2 Hardware Monitor", - "as99127f_rev2", - DEVICE_ISA, - LM78_I2C | LM78_AS99127F_REV2, - lm78_init, lm78_close, lm78_reset, - { NULL }, NULL, NULL, - NULL + .name = "ASUS AS99127F Rev. 2 Hardware Monitor", + .internal_name = "as99127f_rev2", + .flags = DEVICE_ISA, + .local = LM78_I2C | LM78_AS99127F_REV2, + .init = lm78_init, + .close = lm78_close, + .reset = lm78_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - /* Winbond W83782D on ISA and SMBus. */ const device_t w83782d_device = { - "Winbond W83782D Hardware Monitor", - "w83783d", - DEVICE_ISA, - 0x290 | LM78_I2C | LM78_W83782D, - lm78_init, lm78_close, lm78_reset, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83782D Hardware Monitor", + .internal_name = "w83783d", + .flags = DEVICE_ISA, + .local = 0x290 | LM78_I2C | LM78_W83782D, + .init = lm78_init, + .close = lm78_close, + .reset = lm78_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/hwm_vt82c686.c b/src/device/hwm_vt82c686.c index d2a1d00dc..83e67b66e 100644 --- a/src/device/hwm_vt82c686.c +++ b/src/device/hwm_vt82c686.c @@ -204,13 +204,16 @@ vt82c686_init(const device_t *info) return dev; } - const device_t via_vt82c686_hwm_device = { - "VIA VT82C686 Integrated Hardware Monitor", - "via_vt82c686_hwm", - DEVICE_ISA, - 0, - vt82c686_init, vt82c686_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "VIA VT82C686 Integrated Hardware Monitor", + .internal_name = "via_vt82c686_hwm", + .flags = DEVICE_ISA, + .local = 0, + .init = vt82c686_init, + .close = vt82c686_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/ibm_5161.c b/src/device/ibm_5161.c index d18b93cc2..3da5a2797 100644 --- a/src/device/ibm_5161.c +++ b/src/device/ibm_5161.c @@ -111,18 +111,16 @@ ibm_5161_init(const device_t *info) return dev; } - -const device_t ibm_5161_device = -{ - "IBM Expansion Unit (5161)", - "ibm_5161", - DEVICE_ISA, - 0, - ibm_5161_init, - ibm_5161_close, - NULL, - { NULL }, - NULL, - NULL, - NULL +const device_t ibm_5161_device = { + .name = "IBM Expansion Unit (5161)", + .internal_name = "ibm_5161", + .flags = DEVICE_ISA, + .local = 0, + .init = ibm_5161_init, + .close = ibm_5161_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/isamem.c b/src/device/isamem.c index 9b1ee7090..063595197 100644 --- a/src/device/isamem.c +++ b/src/device/isamem.c @@ -693,13 +693,17 @@ static const device_config_t ibmxt_config[] = { }; static const device_t ibmxt_device = { - "IBM PC/XT Memory Expansion", - "ibmxt", - DEVICE_ISA, - ISAMEM_IBMXT_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - ibmxt_config + .name = "IBM PC/XT Memory Expansion", + .internal_name = "ibmxt", + .flags = DEVICE_ISA, + .local = ISAMEM_IBMXT_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ibmxt_config }; static const device_config_t genericxt_config[] = { @@ -719,16 +723,19 @@ static const device_config_t genericxt_config[] = { }; static const device_t genericxt_device = { - "Generic PC/XT Memory Expansion", - "genericxt", - DEVICE_ISA, - ISAMEM_GENXT_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - genericxt_config + .name = "Generic PC/XT Memory Expansion", + .internal_name = "genericxt", + .flags = DEVICE_ISA, + .local = ISAMEM_GENXT_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = genericxt_config }; - static const device_config_t ibmat_config[] = { // clang-format off { @@ -746,16 +753,19 @@ static const device_config_t ibmat_config[] = { }; static const device_t ibmat_device = { - "IBM PC/AT Memory Expansion", - "ibmat", - DEVICE_ISA, - ISAMEM_IBMAT_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - ibmat_config + .name = "IBM PC/AT Memory Expansion", + .internal_name = "ibmat", + .flags = DEVICE_ISA, + .local = ISAMEM_IBMAT_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ibmat_config }; - static const device_config_t genericat_config[] = { // clang-format off { @@ -773,16 +783,19 @@ static const device_config_t genericat_config[] = { }; static const device_t genericat_device = { - "Generic PC/AT Memory Expansion", - "genericat", - DEVICE_ISA, - ISAMEM_GENAT_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - genericat_config + .name = "Generic PC/AT Memory Expansion", + .internal_name = "genericat", + .flags = DEVICE_ISA, + .local = ISAMEM_GENAT_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = genericat_config }; - static const device_config_t p5pak_config[] = { // clang-format off { @@ -800,13 +813,17 @@ static const device_config_t p5pak_config[] = { }; static const device_t p5pak_device = { - "Paradise Systems 5-PAK", - "p5pak", - DEVICE_ISA, - ISAMEM_P5PAK_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - p5pak_config + .name = "Paradise Systems 5-PAK", + .internal_name = "p5pak", + .flags = DEVICE_ISA, + .local = ISAMEM_P5PAK_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = p5pak_config }; @@ -827,16 +844,19 @@ static const device_config_t a6pak_config[] = { }; static const device_t a6pak_device = { - "AST SixPakPlus", - "a6pak", - DEVICE_ISA, - ISAMEM_A6PAK_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - a6pak_config + .name = "AST SixPakPlus", + .internal_name = "a6pak", + .flags = DEVICE_ISA, + .local = ISAMEM_A6PAK_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = a6pak_config }; - static const device_config_t ems5150_config[] = { // clang-format off { @@ -860,13 +880,17 @@ static const device_config_t ems5150_config[] = { }; static const device_t ems5150_device = { - "Micro Mainframe EMS-5150(T)", - "ems5150", - DEVICE_ISA, - ISAMEM_EMS5150_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - ems5150_config + .name = "Micro Mainframe EMS-5150(T)", + .internal_name = "ems5150", + .flags = DEVICE_ISA, + .local = ISAMEM_EMS5150_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ems5150_config }; static const device_config_t ev159_config[] = { @@ -928,13 +952,17 @@ static const device_config_t ev159_config[] = { }; static const device_t ev159_device = { - "Everex EV-159 RAM 3000 Deluxe", - "ev159", - DEVICE_ISA, - ISAMEM_EV159_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - ev159_config + .name = "Everex EV-159 RAM 3000 Deluxe", + .internal_name = "ev159", + .flags = DEVICE_ISA, + .local = ISAMEM_EV159_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ev159_config }; #if defined(DEV_BRANCH) && defined(USE_ISAMEM_BRAT) @@ -986,13 +1014,17 @@ static const device_config_t brat_config[] = { }; static const device_t brat_device = { - "BocaRAM/AT", - "brat", - DEVICE_ISA, - ISAMEM_BRAT_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - brat_config + .name = "BocaRAM/AT", + .internal_name = "brat", + .flags = DEVICE_ISA, + .local = ISAMEM_BRAT_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = brat_config }; #endif @@ -1048,17 +1080,20 @@ static const device_config_t rampage_config[] = { }; static const device_t rampage_device = { - "AST RAMpage/XT", - "rampage", - DEVICE_ISA, - ISAMEM_RAMPAGEXT_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - rampage_config + .name = "AST RAMpage/XT", + .internal_name = "rampage", + .flags = DEVICE_ISA, + .local = ISAMEM_RAMPAGEXT_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = rampage_config }; #endif - #if defined(DEV_BRANCH) && defined(USE_ISAMEM_IAB) static const device_config_t iab_config[] = { // clang-format off @@ -1111,23 +1146,32 @@ static const device_config_t iab_config[] = { }; static const device_t iab_device = { - "Intel AboveBoard", - "iab", - DEVICE_ISA, - ISAMEM_ABOVEBOARD_CARD, - isamem_init, isamem_close, NULL, - { NULL }, NULL, NULL, - iab_config + .name = "Intel AboveBoard", + .internal_name = "iab", + .flags = DEVICE_ISA, + .local = ISAMEM_ABOVEBOARD_CARD, + .init = isamem_init, + .close = isamem_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = iab_config }; #endif static const device_t isa_none_device = { - "None", - "none", - 0, 0, - NULL, NULL, NULL, - { NULL }, NULL, NULL, - NULL + .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 { diff --git a/src/device/isartc.c b/src/device/isartc.c index 6acf01f0c..dc9557e3e 100644 --- a/src/device/isartc.c +++ b/src/device/isartc.c @@ -592,7 +592,6 @@ isartc_close(void *priv) free(dev); } - static const device_config_t ev170_config[] = { // clang-format off { @@ -618,16 +617,19 @@ static const device_config_t ev170_config[] = { }; static const device_t ev170_device = { - "Everex EV-170 Magic I/O", - "ev170", - DEVICE_ISA, - ISARTC_EV170, - isartc_init, isartc_close, NULL, - { NULL }, NULL, NULL, - ev170_config + .name = "Everex EV-170 Magic I/O", + .internal_name = "ev170", + .flags = DEVICE_ISA, + .local = ISARTC_EV170, + .init = isartc_init, + .close = isartc_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ev170_config }; - static const device_config_t pii147_config[] = { // clang-format off { @@ -643,16 +645,19 @@ static const device_config_t pii147_config[] = { }; static const device_t pii147_device = { - "DTK PII-147 Hexa I/O Plus", - "pii147", - DEVICE_ISA, - ISARTC_DTK, - isartc_init, isartc_close, NULL, - { NULL }, NULL, NULL, - pii147_config + .name = "DTK PII-147 Hexa I/O Plus", + .internal_name = "pii147", + .flags = DEVICE_ISA, + .local = ISARTC_DTK, + .init = isartc_init, + .close = isartc_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pii147_config }; - static const device_config_t p5pak_config[] = { // clang-format off { @@ -670,16 +675,19 @@ static const device_config_t p5pak_config[] = { }; static const device_t p5pak_device = { - "Paradise Systems 5-PAK", - "p5pak", - DEVICE_ISA, - ISARTC_P5PAK, - isartc_init, isartc_close, NULL, - { NULL }, NULL, NULL, - p5pak_config + .name = "Paradise Systems 5-PAK", + .internal_name = "p5pak", + .flags = DEVICE_ISA, + .local = ISARTC_P5PAK, + .init = isartc_init, + .close = isartc_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = p5pak_config }; - static const device_config_t a6pak_config[] = { // clang-format off { @@ -697,22 +705,31 @@ static const device_config_t a6pak_config[] = { }; static const device_t a6pak_device = { - "AST SixPakPlus", - "a6pak", - DEVICE_ISA, - ISARTC_A6PAK, - isartc_init, isartc_close, NULL, - { NULL }, NULL, NULL, - a6pak_config + .name = "AST SixPakPlus", + .internal_name = "a6pak", + .flags = DEVICE_ISA, + .local = ISARTC_A6PAK, + .init = isartc_init, + .close = isartc_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = a6pak_config }; static const device_t isartc_none_device = { - "None", - "none", - 0, 0, - NULL, NULL, NULL, - { NULL }, NULL, NULL, - NULL + .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 { diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index 7d35a4046..087fa2b96 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -2340,228 +2340,286 @@ kbd_init(const device_t *info) return(dev); } - const device_t keyboard_at_device = { - "PC/AT Keyboard", - "keyboard_at", - 0, - KBC_TYPE_ISA | KBC_VEN_GENERIC, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PC/AT Keyboard", + .internal_name = "keyboard_at", + .flags = 0, + .local = KBC_TYPE_ISA | KBC_VEN_GENERIC, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_at_ami_device = { - "PC/AT Keyboard (AMI)", - "keyboard_at_ami", - 0, - KBC_TYPE_ISA | KBC_VEN_AMI, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PC/AT Keyboard (AMI)", + .internal_name = "keyboard_at_ami", + .flags = 0, + .local = KBC_TYPE_ISA | KBC_VEN_AMI, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_at_samsung_device = { - "PC/AT Keyboard (Samsung)", - "keyboard_at_samsung", - 0, - KBC_TYPE_ISA | KBC_VEN_SAMSUNG, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PC/AT Keyboard (Samsung)", + .internal_name = "keyboard_at_samsung", + .flags = 0, + .local = KBC_TYPE_ISA | KBC_VEN_SAMSUNG, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_at_toshiba_device = { - "PC/AT Keyboard (Toshiba)", - "keyboard_at_toshiba", - 0, - KBC_TYPE_ISA | KBC_VEN_TOSHIBA, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PC/AT Keyboard (Toshiba)", + .internal_name = "keyboard_at_toshiba", + .flags = 0, + .local = KBC_TYPE_ISA | KBC_VEN_TOSHIBA, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_at_olivetti_device = { - "PC/AT Keyboard (Olivetti)", - "keyboard_at_olivetti", - 0, - KBC_TYPE_ISA | KBC_VEN_OLIVETTI, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PC/AT Keyboard (Olivetti)", + .internal_name = "keyboard_at_olivetti", + .flags = 0, + .local = KBC_TYPE_ISA | KBC_VEN_OLIVETTI, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_at_ncr_device = { - "PC/AT Keyboard (NCR)", - "keyboard_at_ncr", - 0, - KBC_TYPE_ISA | KBC_VEN_NCR, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PC/AT Keyboard (NCR)", + .internal_name = "keyboard_at_ncr", + .flags = 0, + .local = KBC_TYPE_ISA | KBC_VEN_NCR, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_device = { - "PS/2 Keyboard", - "keyboard_ps2", - 0, - KBC_TYPE_PS2_NOREF | KBC_VEN_GENERIC, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard", + .internal_name = "keyboard_ps2", + .flags = 0, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_GENERIC, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_ps2_device = { - "PS/2 Keyboard", - "keyboard_ps2_ps2", - 0, - KBC_TYPE_PS2_1 | KBC_VEN_GENERIC, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard", + .internal_name = "keyboard_ps2_ps2", + .flags = 0, + .local = KBC_TYPE_PS2_1 | KBC_VEN_GENERIC, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_ps1_device = { - "PS/2 Keyboard (IBM PS/1)", - "keyboard_ps2_ps1", - 0, - KBC_TYPE_PS2_NOREF | KBC_VEN_IBM_PS1, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard (IBM PS/1)", + .internal_name = "keyboard_ps2_ps1", + .flags = 0, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_IBM_PS1, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_ps1_pci_device = { - "PS/2 Keyboard (IBM PS/1)", - "keyboard_ps2_ps1_pci", - DEVICE_PCI, - KBC_TYPE_PS2_NOREF | KBC_VEN_IBM_PS1, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard (IBM PS/1)", + .internal_name = "keyboard_ps2_ps1_pci", + .flags = DEVICE_PCI, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_IBM_PS1, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_xi8088_device = { - "PS/2 Keyboard (Xi8088)", - "keyboard_ps2_xi8088", - 0, - KBC_TYPE_PS2_1 | KBC_VEN_XI8088, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard (Xi8088)", + .internal_name = "keyboard_ps2_xi8088", + .flags = 0, + .local = KBC_TYPE_PS2_1 | KBC_VEN_XI8088, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_ami_device = { - "PS/2 Keyboard (AMI)", - "keyboard_ps2_ami", - 0, - KBC_TYPE_PS2_NOREF | KBC_VEN_AMI, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard (AMI)", + .internal_name = "keyboard_ps2_ami", + .flags = 0, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_AMI, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_olivetti_device = { - "PS/2 Keyboard (Olivetti)", - "keyboard_ps2_olivetti", - 0, - KBC_TYPE_PS2_NOREF | KBC_VEN_OLIVETTI, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard (Olivetti)", + .internal_name = "keyboard_ps2_olivetti", + .flags = 0, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_OLIVETTI, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_mca_device = { - "PS/2 Keyboard", - "keyboard_ps2_mca", - 0, - KBC_TYPE_PS2_1 | KBC_VEN_IBM_MCA, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard", + .internal_name = "keyboard_ps2_mca", + .flags = 0, + .local = KBC_TYPE_PS2_1 | KBC_VEN_IBM_MCA, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_mca_2_device = { - "PS/2 Keyboard", - "keyboard_ps2_mca_2", - 0, - KBC_TYPE_PS2_2 | KBC_VEN_IBM_MCA, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard", + .internal_name = "keyboard_ps2_mca_2", + .flags = 0, + .local = KBC_TYPE_PS2_2 | KBC_VEN_IBM_MCA, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_quadtel_device = { - "PS/2 Keyboard (Quadtel/MegaPC)", - "keyboard_ps2_quadtel", - 0, - KBC_TYPE_PS2_NOREF | KBC_VEN_QUADTEL, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard (Quadtel/MegaPC)", + .internal_name = "keyboard_ps2_quadtel", + .flags = 0, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_QUADTEL, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_pci_device = { - "PS/2 Keyboard", - "keyboard_ps2_pci", - DEVICE_PCI, - KBC_TYPE_PS2_NOREF | KBC_VEN_GENERIC, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard", + .internal_name = "keyboard_ps2_pci", + .flags = DEVICE_PCI, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_GENERIC, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_ami_pci_device = { - "PS/2 Keyboard (AMI)", - "keyboard_ps2_ami_pci", - DEVICE_PCI, - KBC_TYPE_PS2_NOREF | KBC_VEN_AMI, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard (AMI)", + .internal_name = "keyboard_ps2_ami_pci", + .flags = DEVICE_PCI, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_AMI, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_intel_ami_pci_device = { - "PS/2 Keyboard (AMI)", - "keyboard_ps2_intel_ami_pci", - DEVICE_PCI, - KBC_TYPE_PS2_NOREF | KBC_VEN_INTEL_AMI, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard (AMI)", + .internal_name = "keyboard_ps2_intel_ami_pci", + .flags = DEVICE_PCI, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_INTEL_AMI, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_ps2_acer_pci_device = { - "PS/2 Keyboard (Acer 90M002A)", - "keyboard_ps2_acer_pci", - DEVICE_PCI, - KBC_TYPE_PS2_NOREF | KBC_VEN_ACER, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL, NULL + .name = "PS/2 Keyboard (Acer 90M002A)", + .internal_name = "keyboard_ps2_acer_pci", + .flags = DEVICE_PCI, + .local = KBC_TYPE_PS2_NOREF | KBC_VEN_ACER, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - void keyboard_at_set_mouse(void (*func)(uint8_t val, void *priv), void *priv) { diff --git a/src/device/keyboard_xt.c b/src/device/keyboard_xt.c index b4e6c0e28..9b19669e2 100644 --- a/src/device/keyboard_xt.c +++ b/src/device/keyboard_xt.c @@ -871,115 +871,144 @@ kbd_close(void *priv) free(kbd); } - const device_t keyboard_pc_device = { - "IBM PC Keyboard (1981)", - "keyboard_pc", - 0, - KBD_TYPE_PC81, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "IBM PC Keyboard (1981)", + .internal_name = "keyboard_pc", + .flags = 0, + .local = KBD_TYPE_PC81, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_pc82_device = { - "IBM PC Keyboard (1982)", - "keyboard_pc82", - 0, - KBD_TYPE_PC82, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "IBM PC Keyboard (1982)", + .internal_name = "keyboard_pc82", + .flags = 0, + .local = KBD_TYPE_PC82, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_xt_device = { - "XT (1982) Keyboard", - "keyboard_xt", - 0, - KBD_TYPE_XT82, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "XT (1982) Keyboard", + .internal_name = "keyboard_xt", + .flags = 0, + .local = KBD_TYPE_XT82, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_xt86_device = { - "XT (1986) Keyboard", - "keyboard_xt86", - 0, - KBD_TYPE_XT86, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "XT (1986) Keyboard", + .internal_name = "keyboard_xt86", + .flags = 0, + .local = KBD_TYPE_XT86, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_xt_compaq_device = { - "Compaq Portable Keyboard", - "keyboard_xt_compaq", - 0, - KBD_TYPE_COMPAQ, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "Compaq Portable Keyboard", + .internal_name = "keyboard_xt_compaq", + .flags = 0, + .local = KBD_TYPE_COMPAQ, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_tandy_device = { - "Tandy 1000 Keyboard", - "keyboard_tandy", - 0, - KBD_TYPE_TANDY, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "Tandy 1000 Keyboard", + .internal_name = "keyboard_tandy", + .flags = 0, + .local = KBD_TYPE_TANDY, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_xt_t1x00_device = { - "Toshiba T1x00 Keyboard", - "keyboard_xt_t1x00", - 0, - KBD_TYPE_TOSHIBA, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "Toshiba T1x00 Keyboard", + .internal_name = "keyboard_xt_t1x00", + .flags = 0, + .local = KBD_TYPE_TOSHIBA, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; #if defined(DEV_BRANCH) && defined(USE_LASERXT) const device_t keyboard_xt_lxt3_device = { - "VTech Laser XT3 Keyboard", - "keyboard_xt_lxt3", - 0, - KBD_TYPE_VTECH, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "VTech Laser XT3 Keyboard", + .internal_name = "keyboard_xt_lxt3", + .flags = 0, + .local = KBD_TYPE_VTECH, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; #endif const device_t keyboard_xt_olivetti_device = { - "Olivetti XT Keyboard", - "keyboard_xt_olivetti", - 0, - KBD_TYPE_OLIVETTI, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "Olivetti XT Keyboard", + .internal_name = "keyboard_xt_olivetti", + .flags = 0, + .local = KBD_TYPE_OLIVETTI, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t keyboard_xt_zenith_device = { - "Zenith XT Keyboard", - "keyboard_xt_zenith", - 0, - KBD_TYPE_ZENITH, - kbd_init, - kbd_close, - kbd_reset, - { NULL }, NULL, NULL + .name = "Zenith XT Keyboard", + .internal_name = "keyboard_xt_zenith", + .flags = 0, + .local = KBD_TYPE_ZENITH, + .init = kbd_init, + .close = kbd_close, + .reset = kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/mouse.c b/src/device/mouse.c index 295f0b8fb..4fc9b5378 100644 --- a/src/device/mouse.c +++ b/src/device/mouse.c @@ -41,24 +41,33 @@ int mouse_x, mouse_z, mouse_buttons; - static const device_t mouse_none_device = { - "None", - "none", - 0, MOUSE_TYPE_NONE, - NULL, NULL, NULL, - { NULL }, NULL, NULL, - NULL -}; -static const device_t mouse_internal_device = { - "Internal", - "internal", - 0, MOUSE_TYPE_INTERNAL, - NULL, NULL, NULL, - { NULL }, NULL, NULL, - NULL + .name = "None", + .internal_name = "none", + .flags = 0, + .local = MOUSE_TYPE_NONE, + .init = NULL, + .close = NULL, + .reset = NULL, + { .poll = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; +static const device_t mouse_internal_device = { + .name = "Internal", + .internal_name = "internal", + .flags = 0, + .local = MOUSE_TYPE_INTERNAL, + .init = NULL, + .close = NULL, + .reset = NULL, + { .poll = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; static mouse_t mouse_devices[] = { // clang-format off diff --git a/src/device/mouse_bus.c b/src/device/mouse_bus.c index de2183b4d..f201c4f1f 100644 --- a/src/device/mouse_bus.c +++ b/src/device/mouse_bus.c @@ -765,30 +765,43 @@ static const device_config_t ms_config[] = { }; const device_t mouse_logibus_device = { - "Logitech/Microsoft Bus Mouse", - "logibus", - DEVICE_ISA, - MOUSE_TYPE_LOGIBUS, - bm_init, bm_close, NULL, - { .poll = bm_poll }, NULL, NULL, - lt_config + .name = "Logitech/Microsoft Bus Mouse", + .internal_name = "logibus", + .flags = DEVICE_ISA, + .local = MOUSE_TYPE_LOGIBUS, + .init = bm_init, + .close = bm_close, + .reset = NULL, + { .poll = bm_poll }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = lt_config }; const device_t mouse_logibus_onboard_device = { - "Logitech Bus Mouse (On-Board)", - "logibus_onboard", - DEVICE_ISA, - MOUSE_TYPE_LOGIBUS | MOUSE_TYPE_ONBOARD, - bm_init, bm_close, NULL, - { .poll = bm_poll }, NULL, NULL + .name = "Logitech Bus Mouse (On-Board)", + .internal_name = "logibus_onboard", + .flags = DEVICE_ISA, + .local = MOUSE_TYPE_LOGIBUS | MOUSE_TYPE_ONBOARD, + .init = bm_init, + .close = bm_close, + .reset = NULL, + { .poll = bm_poll }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t mouse_msinport_device = { - "Microsoft Bus Mouse (InPort)", - "msbus", - DEVICE_ISA, - MOUSE_TYPE_INPORT, - bm_init, bm_close, NULL, - { .poll = bm_poll }, NULL, NULL, - ms_config + .name = "Microsoft Bus Mouse (InPort)", + .internal_name = "msbus", + .flags = DEVICE_ISA, + .local = MOUSE_TYPE_INPORT, + .init = bm_init, + .close = bm_close, + .reset = NULL, + { .poll = bm_poll }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ms_config }; diff --git a/src/device/mouse_ps2.c b/src/device/mouse_ps2.c index 04653661b..8757f01ee 100644 --- a/src/device/mouse_ps2.c +++ b/src/device/mouse_ps2.c @@ -329,7 +329,6 @@ ps2_close(void *priv) free(dev); } - static const device_config_t ps2_config[] = { // clang-format off { @@ -347,11 +346,15 @@ static const device_config_t ps2_config[] = { }; const device_t mouse_ps2_device = { - "Standard PS/2 Mouse", - "ps2", - DEVICE_PS2, - MOUSE_TYPE_PS2, - mouse_ps2_init, ps2_close, NULL, - { .poll = ps2_poll }, NULL, NULL, - ps2_config + .name = "Standard PS/2 Mouse", + .internal_name = "ps2", + .flags = DEVICE_PS2, + .local = MOUSE_TYPE_PS2, + .init = mouse_ps2_init, + .close = ps2_close, + .reset = NULL, + { .poll = ps2_poll }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ps2_config }; diff --git a/src/device/mouse_serial.c b/src/device/mouse_serial.c index 32365fffe..71d628558 100644 --- a/src/device/mouse_serial.c +++ b/src/device/mouse_serial.c @@ -876,31 +876,43 @@ static const device_config_t ltsermouse_config[] = { }; const device_t mouse_mssystems_device = { - "Mouse Systems Serial Mouse", - "mssystems", - 0, - MOUSE_TYPE_MSYSTEMS, - sermouse_init, sermouse_close, NULL, - { .poll = sermouse_poll }, sermouse_speed_changed, NULL, - mssermouse_config + .name = "Mouse Systems Serial Mouse", + .internal_name = "mssystems", + .flags = DEVICE_COM, + .local = MOUSE_TYPE_MSYSTEMS, + .init = sermouse_init, + .close = sermouse_close, + .reset = NULL, + { .poll = sermouse_poll }, + .speed_changed = sermouse_speed_changed, + .force_redraw = NULL, + .config = mssermouse_config }; const device_t mouse_msserial_device = { - "Microsoft Serial Mouse", - "msserial", - 0, - 0, - sermouse_init, sermouse_close, NULL, - { .poll = sermouse_poll }, sermouse_speed_changed, NULL, - mssermouse_config + .name = "Microsoft Serial Mouse", + .internal_name = "msserial", + .flags = DEVICE_COM, + .local = 0, + .init = sermouse_init, + .close = sermouse_close, + .reset = NULL, + { .poll = sermouse_poll }, + .speed_changed = sermouse_speed_changed, + .force_redraw = NULL, + .config = mssermouse_config }; const device_t mouse_ltserial_device = { - "Logitech Serial Mouse", - "ltserial", - 0, - 1, - sermouse_init, sermouse_close, NULL, - { .poll = sermouse_poll }, sermouse_speed_changed, NULL, - ltsermouse_config + .name = "Logitech Serial Mouse", + .internal_name = "ltserial", + .flags = DEVICE_COM, + .local = 1, + .init = sermouse_init, + .close = sermouse_close, + .reset = NULL, + { .poll = sermouse_poll }, + .speed_changed = sermouse_speed_changed, + .force_redraw = NULL, + .config = ltsermouse_config }; diff --git a/src/device/pci_bridge.c b/src/device/pci_bridge.c index 5cb13a1f5..a771dc6bb 100644 --- a/src/device/pci_bridge.c +++ b/src/device/pci_bridge.c @@ -497,156 +497,145 @@ pci_bridge_init(const device_t *info) return dev; } - /* PCI bridges */ -const device_t dec21150_device = -{ - "DEC 21150 PCI Bridge", - "dec21150", - DEVICE_PCI, - PCI_BRIDGE_DEC_21150, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t dec21150_device = { + .name = "DEC 21150 PCI Bridge", + .internal_name = "dec21150", + .flags = DEVICE_PCI, + .local = PCI_BRIDGE_DEC_21150, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; /* AGP bridges */ -const device_t ali5243_agp_device = -{ - "ALi M5243 AGP Bridge", - "ali5243_agp", - DEVICE_PCI, - AGP_BRIDGE_ALI_M5243, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t ali5243_agp_device = { + .name = "ALi M5243 AGP Bridge", + .internal_name = "ali5243_agp", + .flags = DEVICE_PCI, + .local = AGP_BRIDGE_ALI_M5243, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; /* AGP bridges */ -const device_t ali5247_agp_device = -{ - "ALi M5247 AGP Bridge", - "ali5247_agp", - DEVICE_PCI, - AGP_BRIDGE_ALI_M5247, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t ali5247_agp_device = { + .name = "ALi M5247 AGP Bridge", + .internal_name = "ali5247_agp", + .flags = DEVICE_PCI, + .local = AGP_BRIDGE_ALI_M5247, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t i440lx_agp_device = -{ - "Intel 82443LX/EX AGP Bridge", - "i440lx_agp", - DEVICE_PCI, - AGP_BRIDGE_INTEL_440LX, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440lx_agp_device = { + .name = "Intel 82443LX/EX AGP Bridge", + .internal_name = "i440lx_agp", + .flags = DEVICE_PCI, + .local = AGP_BRIDGE_INTEL_440LX, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t i440bx_agp_device = -{ - "Intel 82443BX/ZX AGP Bridge", - "i440bx_agp", - DEVICE_PCI, - AGP_BRIDGE_INTEL_440BX, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440bx_agp_device = { + .name = "Intel 82443BX/ZX AGP Bridge", + .internal_name = "i440bx_agp", + .flags = DEVICE_PCI, + .local = AGP_BRIDGE_INTEL_440BX, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t i440gx_agp_device = -{ - "Intel 82443GX AGP Bridge", - "i440gx_agp", - DEVICE_PCI, - AGP_BRIDGE_INTEL_440GX, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t i440gx_agp_device = { + .name = "Intel 82443GX AGP Bridge", + .internal_name = "i440gx_agp", + .flags = DEVICE_PCI, + .local = AGP_BRIDGE_INTEL_440GX, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t via_vp3_agp_device = -{ - "VIA Apollo VP3 AGP Bridge", - "via_vp3_agp", - DEVICE_PCI, - AGP_BRIDGE_VIA_597, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vp3_agp_device = { + .name = "VIA Apollo VP3 AGP Bridge", + .internal_name = "via_vp3_agp", + .flags = DEVICE_PCI, + .local = AGP_BRIDGE_VIA_597, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t via_mvp3_agp_device = -{ - "VIA Apollo MVP3 AGP Bridge", - "via_mvp3_agp", - DEVICE_PCI, - AGP_BRIDGE_VIA_598, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_mvp3_agp_device = { + .name = "VIA Apollo MVP3 AGP Bridge", + .internal_name = "via_mvp3_agp", + .flags = DEVICE_PCI, + .local = AGP_BRIDGE_VIA_598, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t via_apro_agp_device = -{ - "VIA Apollo Pro AGP Bridge", - "via_apro_agp", - DEVICE_PCI, - AGP_BRIDGE_VIA_691, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_apro_agp_device = { + .name = "VIA Apollo Pro AGP Bridge", + .internal_name = "via_apro_agp", + .flags = DEVICE_PCI, + .local = AGP_BRIDGE_VIA_691, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t via_vt8601_agp_device = -{ - "VIA Apollo ProMedia AGP Bridge", - "via_vt8601_agp", - DEVICE_PCI, - AGP_BRIDGE_VIA_8601, - pci_bridge_init, - NULL, - pci_bridge_reset, - { NULL }, - NULL, - NULL, - NULL +const device_t via_vt8601_agp_device = { + .name = "VIA Apollo ProMedia AGP Bridge", + .internal_name = "via_vt8601_agp", + .flags = DEVICE_PCI, + .local = AGP_BRIDGE_VIA_8601, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/phoenix_486_jumper.c b/src/device/phoenix_486_jumper.c index 8bbbdaee1..10f37c4ce 100644 --- a/src/device/phoenix_486_jumper.c +++ b/src/device/phoenix_486_jumper.c @@ -123,24 +123,30 @@ phoenix_486_jumper_init(const device_t *info) return dev; } - const device_t phoenix_486_jumper_device = { - "Phoenix 486 Jumper Readout", - "phoenix_486_jumper", - 0, - 0, - phoenix_486_jumper_init, phoenix_486_jumper_close, phoenix_486_jumper_reset, - { NULL }, NULL, NULL, - NULL + .name = "Phoenix 486 Jumper Readout", + .internal_name = "phoenix_486_jumper", + .flags = 0, + .local = 0, + .init = phoenix_486_jumper_init, + .close = phoenix_486_jumper_close, + .reset = phoenix_486_jumper_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t phoenix_486_jumper_pci_device = { - "Phoenix 486 Jumper Readout (PCI machines)", - "phoenix_486_jumper_pci", - 0, - 1, - phoenix_486_jumper_init, phoenix_486_jumper_close, phoenix_486_jumper_reset, - { NULL }, NULL, NULL, - NULL + .name = "Phoenix 486 Jumper Readout (PCI machines)", + .internal_name = "phoenix_486_jumper_pci", + .flags = 0, + .local = 1, + .init = phoenix_486_jumper_init, + .close = phoenix_486_jumper_close, + .reset = phoenix_486_jumper_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/postcard.c b/src/device/postcard.c index 62d37c156..3fb06680d 100644 --- a/src/device/postcard.c +++ b/src/device/postcard.c @@ -141,11 +141,15 @@ postcard_close(UNUSED(void *priv)) const device_t postcard_device = { - "POST Card", - "postcard", - DEVICE_ISA, - 0, - postcard_init, postcard_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "POST Card", + .internal_name = "postcard", + .flags = DEVICE_ISA, + .local = 0, + .init = postcard_init, + .close = postcard_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/serial.c b/src/device/serial.c index b5644c669..c801c20f8 100644 --- a/src/device/serial.c +++ b/src/device/serial.c @@ -721,83 +721,114 @@ serial_standalone_init(void) { device_add_inst(&ns8250_device, next_inst + 1); }; - const device_t ns8250_device = { - "National Semiconductor 8250(-compatible) UART", - "ns8250", - 0, - SERIAL_8250, - serial_init, serial_close, NULL, - { NULL }, serial_speed_changed, NULL, - NULL + .name = "National Semiconductor 8250(-compatible) UART", + .internal_name = "ns8250", + .flags = 0, + .local = SERIAL_8250, + .init = serial_init, + .close = serial_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = serial_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ns8250_pcjr_device = { - "National Semiconductor 8250(-compatible) UART for PCjr", - "ns8250_pcjr", - DEVICE_PCJR, - SERIAL_8250_PCJR, - serial_init, serial_close, NULL, - { NULL }, serial_speed_changed, NULL, - NULL + .name = "National Semiconductor 8250(-compatible) UART for PCjr", + .internal_name = "ns8250_pcjr", + .flags = DEVICE_PCJR, + .local = SERIAL_8250_PCJR, + .init = serial_init, + .close = serial_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = serial_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ns16450_device = { - "National Semiconductor NS16450(-compatible) UART", - "ns16450", - 0, - SERIAL_16450, - serial_init, serial_close, NULL, - { NULL }, serial_speed_changed, NULL, - NULL + .name = "National Semiconductor NS16450(-compatible) UART", + .internal_name = "ns16450", + .flags = 0, + .local = SERIAL_16450, + .init = serial_init, + .close = serial_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = serial_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ns16550_device = { - "National Semiconductor NS16550(-compatible) UART", - "ns16550", - 0, - SERIAL_16550, - serial_init, serial_close, NULL, - { NULL }, serial_speed_changed, NULL, - NULL + .name = "National Semiconductor NS16550(-compatible) UART", + .internal_name = "ns16550", + .flags = 0, + .local = SERIAL_16550, + .init = serial_init, + .close = serial_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = serial_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ns16650_device = { - "Startech Semiconductor 16650(-compatible) UART", - "ns16650", - 0, - SERIAL_16650, - serial_init, serial_close, NULL, - { NULL }, serial_speed_changed, NULL, - NULL + .name = "Startech Semiconductor 16650(-compatible) UART", + .internal_name = "ns16650", + .flags = 0, + .local = SERIAL_16650, + .init = serial_init, + .close = serial_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = serial_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ns16750_device = { - "Texas Instruments 16750(-compatible) UART", - "ns16750", - 0, - SERIAL_16750, - serial_init, serial_close, NULL, - { NULL }, serial_speed_changed, NULL, - NULL + .name = "Texas Instruments 16750(-compatible) UART", + .internal_name = "ns16750", + .flags = 0, + .local = SERIAL_16750, + .init = serial_init, + .close = serial_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = serial_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ns16850_device = { - "Exar Corporation NS16850(-compatible) UART", - "ns16850", - 0, - SERIAL_16850, - serial_init, serial_close, NULL, - { NULL }, serial_speed_changed, NULL, - NULL + .name = "Exar Corporation NS16850(-compatible) UART", + .internal_name = "ns16850", + .flags = 0, + .local = SERIAL_16850, + .init = serial_init, + .close = serial_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = serial_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t ns16950_device = { - "Oxford Semiconductor NS16950(-compatible) UART", - "ns16950", - 0, - SERIAL_16950, - serial_init, serial_close, NULL, - { NULL }, serial_speed_changed, NULL, - NULL + .name = "Oxford Semiconductor NS16950(-compatible) UART", + .internal_name = "ns16950", + .flags = 0, + .local = SERIAL_16950, + .init = serial_init, + .close = serial_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = serial_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/smbus_ali7101.c b/src/device/smbus_ali7101.c index 5733c46eb..c56ecd881 100644 --- a/src/device/smbus_ali7101.c +++ b/src/device/smbus_ali7101.c @@ -299,13 +299,16 @@ smbus_ali7101_close(void *priv) free(dev); } - const device_t ali7101_smbus_device = { - "ALi M7101-compatible SMBus Host Controller", - "ali7101_smbus", - DEVICE_AT, - 0, - smbus_ali7101_init, smbus_ali7101_close, smbus_ali7101_reset, - { NULL }, NULL, NULL, - NULL + .name = "ALi M7101-compatible SMBus Host Controller", + .internal_name = "ali7101_smbus", + .flags = DEVICE_AT, + .local = 0, + .init = smbus_ali7101_init, + .close = smbus_ali7101_close, + .reset = smbus_ali7101_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/device/smbus_piix4.c b/src/device/smbus_piix4.c index 0b2416ad7..de26b061c 100644 --- a/src/device/smbus_piix4.c +++ b/src/device/smbus_piix4.c @@ -384,23 +384,30 @@ smbus_piix4_close(void *priv) free(dev); } - const device_t piix4_smbus_device = { - "PIIX4-compatible SMBus Host Controller", - "piix4_smbus", - DEVICE_AT, - SMBUS_PIIX4, - smbus_piix4_init, smbus_piix4_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "PIIX4-compatible SMBus Host Controller", + .internal_name = "piix4_smbus", + .flags = DEVICE_AT, + .local = SMBUS_PIIX4, + .init = smbus_piix4_init, + .close = smbus_piix4_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t via_smbus_device = { - "VIA VT82C686B SMBus Host Controller", - "via_smbus", - DEVICE_AT, - SMBUS_VIA, - smbus_piix4_init, smbus_piix4_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "VIA VT82C686B SMBus Host Controller", + .internal_name = "via_smbus", + .flags = DEVICE_AT, + .local = SMBUS_VIA, + .init = smbus_piix4_init, + .close = smbus_piix4_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; From 369f6774f951521d2265cb8debd4b94b05f48cf2 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:37:19 -0400 Subject: [PATCH 07/25] src/disk --- src/disk/hdc.c | 45 ++++++---- src/disk/hdc_esdi_at.c | 19 ++-- src/disk/hdc_esdi_mca.c | 16 ++-- src/disk/hdc_ide.c | 174 +++++++++++++++++++++++------------- src/disk/hdc_ide_cmd640.c | 90 +++++++++++-------- src/disk/hdc_ide_cmd646.c | 54 ++++++----- src/disk/hdc_ide_opti611.c | 18 ++-- src/disk/hdc_ide_sff8038i.c | 22 ++--- src/disk/hdc_st506_at.c | 17 ++-- src/disk/hdc_st506_xt.c | 114 +++++++++++++---------- src/disk/hdc_xta.c | 36 +++++--- src/disk/hdc_xtide.c | 90 +++++++++++-------- 12 files changed, 424 insertions(+), 271 deletions(-) diff --git a/src/disk/hdc.c b/src/disk/hdc.c index 10b9ea72a..9fd3a2fab 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -52,49 +52,60 @@ hdc_log(const char *fmt, ...) #define hdc_log(fmt, ...) #endif - static void * -null_init(const device_t *info) +nullhdc_init(const device_t *info) { return(NULL); } - static void -null_close(void *priv) +nullhdc_close(void *priv) { } - static void * inthdc_init(const device_t *info) { return(NULL); } - static void inthdc_close(void *priv) { } - static const device_t hdc_none_device = { - "None", "none", 0, 0, - null_init, null_close, NULL, - { NULL }, NULL, NULL, NULL -}; -static const device_t hdc_internal_device = { - "Internal", "internal", 0, 0, - inthdc_init, inthdc_close, NULL, - { NULL }, NULL, NULL, NULL + .name = "None", + .internal_name = "none", + .flags = 0, + .local = 0, + .init = nullhdc_init, + .close = nullhdc_close, + .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 = inthdc_init, + .close = inthdc_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; static const struct { -// clang-format off const device_t *device; } controllers[] = { +// clang-format off { &hdc_none_device }, { &hdc_internal_device }, { &st506_xt_xebec_device }, @@ -118,7 +129,7 @@ static const struct { { &ide_pci_2ch_device }, { &ide_vlb_device }, { &ide_vlb_2ch_device }, - { NULL } + { NULL } // clang-format on }; diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index c68ec5cf3..fb9ef7479 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -845,12 +845,15 @@ wd1007vse1_available(void) const device_t esdi_at_wd1007vse1_device = { - "Western Digital WD1007V-SE1 (ESDI)", - "esdi_at", - DEVICE_ISA | DEVICE_AT, - 0, - wd1007vse1_init, wd1007vse1_close, NULL, - { wd1007vse1_available }, - NULL, NULL, - NULL + .name = "Western Digital WD1007V-SE1 (ESDI)", + .internal_name = "esdi_at", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = wd1007vse1_init, + .close = wd1007vse1_close, + .reset = NULL, + { .available = wd1007vse1_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/disk/hdc_esdi_mca.c b/src/disk/hdc_esdi_mca.c index 6a8de8075..d3c2b9e88 100644 --- a/src/disk/hdc_esdi_mca.c +++ b/src/disk/hdc_esdi_mca.c @@ -1180,9 +1180,15 @@ esdi_available(void) const device_t esdi_ps2_device = { - "IBM PS/2 ESDI Fixed Disk Adapter (MCA)", - "esdi_mca", - DEVICE_MCA, 0, - esdi_init, esdi_close, NULL, - { esdi_available }, NULL, NULL, NULL + .name = "IBM PS/2 ESDI Fixed Disk Adapter (MCA)", + .internal_name = "esdi_mca", + .flags = DEVICE_MCA, + .local = 0, + .init = esdi_init, + .close = esdi_close, + .reset = NULL, + { .available = esdi_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 7350f6d84..d0ca2c84e 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -3064,57 +3064,87 @@ ide_close(void *priv) const device_t ide_isa_device = { - "ISA PC/AT IDE Controller", - "ide_isa", - DEVICE_ISA | DEVICE_AT, - 0, - ide_init, ide_close, ide_reset, - { NULL }, NULL, NULL, NULL + .name = "ISA PC/AT IDE Controller", + .internal_name = "ide_isa", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = ide_init, + .close = ide_close, + .reset = ide_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_isa_2ch_device = { - "ISA PC/AT IDE Controller (Dual-Channel)", - "ide_isa_2ch", - DEVICE_ISA | DEVICE_AT, - 1, - ide_init, ide_close, ide_reset, - { NULL }, NULL, NULL, NULL + .name = "ISA PC/AT IDE Controller (Dual-Channel)", + .internal_name = "ide_isa_2ch", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 1, + .init = ide_init, + .close = ide_close, + .reset = ide_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_vlb_device = { - "VLB IDE Controller", - "ide_vlb", - DEVICE_VLB | DEVICE_AT, - 2, - ide_init, ide_close, ide_reset, - { NULL }, NULL, NULL, NULL + .name = "VLB IDE Controller", + .internal_name = "ide_vlb", + .flags = DEVICE_VLB | DEVICE_AT, + .local = 2, + .init = ide_init, + .close = ide_close, + .reset = ide_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_vlb_2ch_device = { - "VLB IDE Controller (Dual-Channel)", - "ide_vlb_2ch", - DEVICE_VLB | DEVICE_AT, - 3, - ide_init, ide_close, ide_reset, - { NULL }, NULL, NULL, NULL + .name = "VLB IDE Controller (Dual-Channel)", + .internal_name = "ide_vlb_2ch", + .flags = DEVICE_VLB | DEVICE_AT, + .local = 3, + .init = ide_init, + .close = ide_close, + .reset = ide_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_pci_device = { - "PCI IDE Controller", - "ide_pci", - DEVICE_PCI | DEVICE_AT, - 4, - ide_init, ide_close, ide_reset, - { NULL }, NULL, NULL, NULL + .name = "PCI IDE Controller", + .internal_name = "ide_pci", + .flags = DEVICE_PCI | DEVICE_AT, + .local = 4, + .init = ide_init, + .close = ide_close, + .reset = ide_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_pci_2ch_device = { - "PCI IDE Controller (Dual-Channel)", - "ide_pci_2ch", - DEVICE_PCI | DEVICE_AT, - 5, - ide_init, ide_close, ide_reset, - { NULL }, NULL, NULL, NULL + .name = "PCI IDE Controller (Dual-Channel)", + .internal_name = "ide_pci_2ch", + .flags = DEVICE_PCI | DEVICE_AT, + .local = 5, + .init = ide_init, + .close = ide_close, + .reset = ide_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; // clang-format off @@ -3160,41 +3190,57 @@ static const device_config_t ide_qua_config[] = { // clang-format on const device_t ide_ter_device = { - "Tertiary IDE Controller", - "ide_ter", - DEVICE_AT, - 0, - ide_ter_init, ide_ter_close, NULL, - { NULL }, NULL, NULL, - ide_ter_config + .name = "Tertiary IDE Controller", + .internal_name = "ide_ter", + .flags = DEVICE_AT, + .local = 0, + .init = ide_ter_init, + .close = ide_ter_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ide_ter_config }; const device_t ide_ter_pnp_device = { - "Tertiary IDE Controller (Plug and Play only)", - "ide_ter_pnp", - DEVICE_AT, - 1, - ide_ter_init, ide_ter_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Tertiary IDE Controller (Plug and Play only)", + .internal_name = "ide_ter_pnp", + .flags = DEVICE_AT, + .local = 1, + .init = ide_ter_init, + .close = ide_ter_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_qua_device = { - "Quaternary IDE Controller", - "ide_qua", - DEVICE_AT, - 0, - ide_qua_init, ide_qua_close, NULL, - { NULL }, NULL, NULL, - ide_qua_config + .name = "Quaternary IDE Controller", + .internal_name = "ide_qua", + .flags = DEVICE_AT, + .local = 0, + .init = ide_qua_init, + .close = ide_qua_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ide_qua_config }; const device_t ide_qua_pnp_device = { - "Quaternary IDE Controller (Plug and Play only)", - "ide_qua_pnp", - DEVICE_AT, - 1, - ide_qua_init, ide_qua_close, NULL, - { NULL }, NULL, NULL, - ide_qua_config + .name = "Quaternary IDE Controller (Plug and Play only)", + .internal_name = "ide_qua_pnp", + .flags = DEVICE_AT, + .local = 1, + .init = ide_qua_init, + .close = ide_qua_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ide_qua_config }; diff --git a/src/disk/hdc_ide_cmd640.c b/src/disk/hdc_ide_cmd640.c index f07caa0a8..dec8fac18 100644 --- a/src/disk/hdc_ide_cmd640.c +++ b/src/disk/hdc_ide_cmd640.c @@ -493,51 +493,71 @@ cmd640_init(const device_t *info) const device_t ide_cmd640_vlb_device = { - "CMD PCI-0640B VLB", - "ide_cmd640_vlb", - DEVICE_VLB, - 0x0078, - cmd640_init, cmd640_close, cmd640_reset, - { NULL }, NULL, NULL, - NULL + .name = "CMD PCI-0640B VLB", + .internal_name = "ide_cmd640_vlb", + .flags = DEVICE_VLB, + .local = 0x0078, + .init = cmd640_init, + .close = cmd640_close, + .reset = cmd640_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_cmd640_vlb_178_device = { - "CMD PCI-0640B VLB (Port 178h)", - "ide_cmd640_vlb_178", - DEVICE_VLB, - 0x0178, - cmd640_init, cmd640_close, cmd640_reset, - { NULL }, NULL, NULL, - NULL + .name = "CMD PCI-0640B VLB (Port 178h)", + .internal_name = "ide_cmd640_vlb_178", + .flags = DEVICE_VLB, + .local = 0x0178, + .init = cmd640_init, + .close = cmd640_close, + .reset = cmd640_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_cmd640_pci_device = { - "CMD PCI-0640B PCI", - "ide_cmd640_pci", - DEVICE_PCI, - 0x0a, - cmd640_init, cmd640_close, cmd640_reset, - { NULL }, NULL, NULL, - NULL + .name = "CMD PCI-0640B PCI", + .internal_name = "ide_cmd640_pci", + .flags = DEVICE_PCI, + .local = 0x0a, + .init = cmd640_init, + .close = cmd640_close, + .reset = cmd640_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_cmd640_pci_legacy_only_device = { - "CMD PCI-0640B PCI (Legacy Mode Only)", - "ide_cmd640_pci_legacy_only", - DEVICE_PCI, - 0x00, - cmd640_init, cmd640_close, cmd640_reset, - { NULL }, NULL, NULL, - NULL + .name = "CMD PCI-0640B PCI (Legacy Mode Only)", + .internal_name = "ide_cmd640_pci_legacy_only", + .flags = DEVICE_PCI, + .local = 0x00, + .init = cmd640_init, + .close = cmd640_close, + .reset = cmd640_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_cmd640_pci_single_channel_device = { - "CMD PCI-0640B PCI", - "ide_cmd640_pci_single_channel", - DEVICE_PCI, - 0x2000a, - cmd640_init, cmd640_close, cmd640_reset, - { NULL }, NULL, NULL, - NULL + .name = "CMD PCI-0640B PCI", + .internal_name = "ide_cmd640_pci_single_channel", + .flags = DEVICE_PCI, + .local = 0x2000a, + .init = cmd640_init, + .close = cmd640_close, + .reset = cmd640_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/disk/hdc_ide_cmd646.c b/src/disk/hdc_ide_cmd646.c index d2b2fe978..960a07b16 100644 --- a/src/disk/hdc_ide_cmd646.c +++ b/src/disk/hdc_ide_cmd646.c @@ -408,31 +408,43 @@ cmd646_init(const device_t *info) const device_t ide_cmd646_device = { - "CMD PCI-0646", - "ide_cmd646", - DEVICE_PCI, - 0x8a, - cmd646_init, cmd646_close, cmd646_reset, - { NULL }, NULL, NULL, - NULL + .name = "CMD PCI-0646", + .internal_name = "ide_cmd646", + .flags = DEVICE_PCI, + .local = 0x8a, + .init = cmd646_init, + .close = cmd646_close, + .reset = cmd646_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_cmd646_legacy_only_device = { - "CMD PCI-0646 (Legacy Mode Only)", - "ide_cmd646_legacy_only", - DEVICE_PCI, - 0x80, - cmd646_init, cmd646_close, cmd646_reset, - { NULL }, NULL, NULL, - NULL + .name = "CMD PCI-0646 (Legacy Mode Only)", + .internal_name = "ide_cmd646_legacy_only", + .flags = DEVICE_PCI, + .local = 0x80, + .init = cmd646_init, + .close = cmd646_close, + .reset = cmd646_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ide_cmd646_single_channel_device = { - "CMD PCI-0646", - "ide_cmd646_single_channel", - DEVICE_PCI, - 0x2008a, - cmd646_init, cmd646_close, cmd646_reset, - { NULL }, NULL, NULL, - NULL + .name = "CMD PCI-0646", + .internal_name = "ide_cmd646_single_channel", + .flags = DEVICE_PCI, + .local = 0x2008a, + .init = cmd646_init, + .close = cmd646_close, + .reset = cmd646_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/disk/hdc_ide_opti611.c b/src/disk/hdc_ide_opti611.c index c8f5ac838..e53971768 100644 --- a/src/disk/hdc_ide_opti611.c +++ b/src/disk/hdc_ide_opti611.c @@ -313,11 +313,15 @@ opti611_init(const device_t *info) const device_t ide_opti611_vlb_device = { - "OPTi 82C611/82C611A VLB", - "ide_opti611_vlb", - 0, - 0, - opti611_init, opti611_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "OPTi 82C611/82C611A VLB", + .internal_name = "ide_opti611_vlb", + .flags = DEVICE_VLB, + .local = 0, + .init = opti611_init, + .close = opti611_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/disk/hdc_ide_sff8038i.c b/src/disk/hdc_ide_sff8038i.c index 82b417b3d..7caecc37d 100644 --- a/src/disk/hdc_ide_sff8038i.c +++ b/src/disk/hdc_ide_sff8038i.c @@ -587,15 +587,15 @@ static void const device_t sff8038i_device = { - "SFF-8038i IDE Bus Master", - "sff8038i", - DEVICE_PCI, - 0, - sff_init, - sff_close, - sff_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "SFF-8038i IDE Bus Master", + .internal_name = "sff8038i", + .flags = DEVICE_PCI, + .local = 0, + .init = sff_init, + .close = sff_close, + .reset = sff_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/disk/hdc_st506_at.c b/src/disk/hdc_st506_at.c index 7177d37bd..c510f5319 100644 --- a/src/disk/hdc_st506_at.c +++ b/src/disk/hdc_st506_at.c @@ -769,10 +769,15 @@ mfm_close(void *priv) const device_t st506_at_wd1003_device = { - "WD1003 AT MFM/RLL Controller", - "st506_at", - DEVICE_ISA | DEVICE_AT, - 0, - mfm_init, mfm_close, NULL, - { NULL }, NULL, NULL, NULL + .name = "WD1003 AT MFM/RLL Controller", + .internal_name = "st506_at", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = mfm_init, + .close = mfm_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index fd2ef2b9b..10e3c3731 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -1737,67 +1737,85 @@ static const device_config_t wd_rll_config[] = { // clang-format on const device_t st506_xt_xebec_device = { - "IBM PC Fixed Disk Adapter (MFM)", - "st506_xt", - DEVICE_ISA, - (HDD_BUS_MFM << 8) | 0, - st506_init, st506_close, NULL, - { xebec_available }, - NULL, NULL, - NULL + .name = "IBM PC Fixed Disk Adapter (MFM)", + .internal_name = "st506_xt", + .flags = DEVICE_ISA, + .local = (HDD_BUS_MFM << 8) | 0, + .init = st506_init, + .close = st506_close, + .reset = NULL, + { .available = xebec_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t st506_xt_dtc5150x_device = { - "DTC 5150X MFM Fixed Disk Adapter", - "st506_xt_dtc5150x", - DEVICE_ISA, - (HDD_BUS_MFM << 8) | 1, - st506_init, st506_close, NULL, - { dtc5150x_available }, - NULL, NULL, - dtc_config + .name = "DTC 5150X MFM Fixed Disk Adapter", + .internal_name = "st506_xt_dtc5150x", + .flags = DEVICE_ISA, + .local = (HDD_BUS_MFM << 8) | 1, + .init = st506_init, + .close = st506_close, + .reset = NULL, + { .available = dtc5150x_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = dtc_config }; const device_t st506_xt_st11_m_device = { - "ST-11M MFM Fixed Disk Adapter", - "st506_xt_st11_m", - DEVICE_ISA, - (HDD_BUS_MFM << 8) | 11, - st506_init, st506_close, NULL, - { st11_m_available }, - NULL, NULL, - st11_config + .name = "ST-11M MFM Fixed Disk Adapter", + .internal_name = "st506_xt_st11_m", + .flags = DEVICE_ISA, + .local = (HDD_BUS_MFM << 8) | 11, + .init = st506_init, + .close = st506_close, + .reset = NULL, + { .available = st11_m_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = st11_config }; const device_t st506_xt_st11_r_device = { - "ST-11R RLL Fixed Disk Adapter", - "st506_xt_st11_r", - DEVICE_ISA, - (HDD_BUS_MFM << 8) | 12, - st506_init, st506_close, NULL, - { st11_r_available }, - NULL, NULL, - st11_config + .name = "ST-11R RLL Fixed Disk Adapter", + .internal_name = "st506_xt_st11_r", + .flags = DEVICE_ISA, + .local = (HDD_BUS_MFM << 8) | 12, + .init = st506_init, + .close = st506_close, + .reset = NULL, + { .available = st11_r_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = st11_config }; const device_t st506_xt_wd1002a_wx1_device = { - "WD1002A-WX1 MFM Fixed Disk Adapter", - "st506_xt_wd1002a_wx1", - DEVICE_ISA, - (HDD_BUS_MFM << 8) | 21, - st506_init, st506_close, NULL, - { wd1002a_wx1_available }, - NULL, NULL, - wd_config + .name = "WD1002A-WX1 MFM Fixed Disk Adapter", + .internal_name = "st506_xt_wd1002a_wx1", + .flags = DEVICE_ISA, + .local = (HDD_BUS_MFM << 8) | 21, + .init = st506_init, + .close = st506_close, + .reset = NULL, + { .available = wd1002a_wx1_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = wd_config }; const device_t st506_xt_wd1002a_27x_device = { - "WD1002A-27X RLL Fixed Disk Adapter", - "st506_xt_wd1002a_27x", - DEVICE_ISA, - (HDD_BUS_MFM << 8) | 22, - st506_init, st506_close, NULL, - { wd1002a_27x_available }, - NULL, NULL, - wd_rll_config + .name = "WD1002A-27X RLL Fixed Disk Adapter", + .internal_name = "st506_xt_wd1002a_27x", + .flags = DEVICE_ISA, + .local = (HDD_BUS_MFM << 8) | 22, + .init = st506_init, + .close = st506_close, + .reset = NULL, + { .available = wd1002a_27x_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = wd_rll_config }; diff --git a/src/disk/hdc_xta.c b/src/disk/hdc_xta.c index 03a7c6fb2..754a4114a 100644 --- a/src/disk/hdc_xta.c +++ b/src/disk/hdc_xta.c @@ -1134,21 +1134,29 @@ static const device_config_t wdxt150_config[] = { }; const device_t xta_wdxt150_device = { - "WDXT-150 XTA Fixed Disk Controller", - "xta_wdxt150", - DEVICE_ISA, - 0, - xta_init, xta_close, NULL, - { xta_available }, NULL, NULL, - wdxt150_config + .name = "WDXT-150 XTA Fixed Disk Controller", + .internal_name = "xta_wdxt150", + .flags = DEVICE_ISA, + .local = 0, + .init = xta_init, + .close = xta_close, + .reset = NULL, + { .available = xta_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = wdxt150_config }; const device_t xta_hd20_device = { - "EuroPC HD20 Fixed Disk Controller", - "xta_hd20", - DEVICE_ISA, - 1, - xta_init, xta_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "EuroPC HD20 Fixed Disk Controller", + .internal_name = "xta_hd20", + .flags = DEVICE_ISA, + .local = 1, + .init = xta_init, + .close = xta_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 84b31bc8d..51c8dbf4a 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -261,51 +261,71 @@ xtide_at_close(void *priv) const device_t xtide_device = { - "PC/XT XTIDE", - "xtide", - DEVICE_ISA, - 0, - xtide_init, xtide_close, NULL, - { xtide_available }, NULL, NULL, - NULL + .name = "PC/XT XTIDE", + .internal_name = "xtide", + .flags = DEVICE_ISA, + .local = 0, + .init = xtide_init, + .close = xtide_close, + .reset = NULL, + { .available = xtide_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t xtide_at_device = { - "PC/AT XTIDE", - "xtide_at", - DEVICE_ISA | DEVICE_AT, - 0, - xtide_at_init, xtide_at_close, NULL, - { xtide_at_available }, NULL, NULL, - NULL + .name = "PC/AT XTIDE", + .internal_name = "xtide_at", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = xtide_at_init, + .close = xtide_at_close, + .reset = NULL, + { .available = xtide_at_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t xtide_at_386_device = { - "PC/AT XTIDE (386)", - "xtide_at_386", - DEVICE_ISA | DEVICE_AT, - 1, - xtide_at_init, xtide_at_close, NULL, - { xtide_at_386_available }, NULL, NULL, - NULL + .name = "PC/AT XTIDE (386)", + .internal_name = "xtide_at_386", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 1, + .init = xtide_at_init, + .close = xtide_at_close, + .reset = NULL, + { .available = xtide_at_386_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t xtide_acculogic_device = { - "Acculogic XT IDE", - "xtide_acculogic", - DEVICE_ISA, - 0, - xtide_acculogic_init, xtide_close, NULL, - { xtide_acculogic_available }, NULL, NULL, - NULL + .name = "Acculogic XT IDE", + .internal_name = "xtide_acculogic", + .flags = DEVICE_ISA, + .local = 0, + .init = xtide_acculogic_init, + .close = xtide_close, + .reset = NULL, + { .available = xtide_acculogic_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t xtide_at_ps2_device = { - "PS/2 AT XTIDE (1.1.5)", - "xtide_at_ps2", - DEVICE_ISA | DEVICE_AT, - 0, - xtide_at_ps2_init, xtide_at_close, NULL, - { xtide_at_ps2_available }, NULL, NULL, - NULL + .name = "PS/2 AT XTIDE (1.1.5)", + .internal_name = "xtide_at_ps2", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = xtide_at_ps2_init, + .close = xtide_at_close, + .reset = NULL, + { .available = xtide_at_ps2_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; From 288e2ce1d2f46a5e6e0c93a2086823407b0fc5d9 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:38:53 -0400 Subject: [PATCH 08/25] src/floppy --- src/floppy/fdc.c | 277 +++++++++++++++++++++--------------- src/floppy/fdc_magitronic.c | 24 ++-- src/floppy/fdc_pii15xb.c | 46 +++--- 3 files changed, 198 insertions(+), 149 deletions(-) diff --git a/src/floppy/fdc.c b/src/floppy/fdc.c index 485b8925c..171a77fa7 100644 --- a/src/floppy/fdc.c +++ b/src/floppy/fdc.c @@ -102,12 +102,17 @@ fdc_log(const char *fmt, ...) const device_t fdc_internal_device = { - "Internal", - "internal", - 0, 0, - NULL, NULL, NULL, - { NULL }, NULL, NULL, - NULL + .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 }; @@ -117,11 +122,13 @@ typedef const struct { /* All emulated machines have at least one integrated FDC controller */ static fdc_cards_t fdc_cards[] = { - { &fdc_internal_device }, - { &fdc_b215_device }, - { &fdc_pii151b_device }, - { &fdc_pii158b_device }, - { NULL } +// clang-format off + { &fdc_internal_device }, + { &fdc_b215_device }, + { &fdc_pii151b_device }, + { &fdc_pii158b_device }, + { NULL } +// clang-format on }; @@ -2382,145 +2389,183 @@ fdc_3f1_enable(fdc_t *fdc, int enable) } const device_t fdc_xt_device = { - "PC/XT Floppy Drive Controller", - "fdc_xt", - 0, - 0, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/XT Floppy Drive Controller", + .internal_name = "fdc_xt", + .flags = 0, + .local = 0, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_xt_t1x00_device = { - "PC/XT Floppy Drive Controller (Toshiba)", - "fdc_xt_t1x00", - 0, - FDC_FLAG_TOSHIBA, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/XT Floppy Drive Controller (Toshiba)", + .internal_name = "fdc_xt_t1x00", + .flags = 0, + .local = FDC_FLAG_TOSHIBA, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_xt_amstrad_device = { - "PC/XT Floppy Drive Controller (Amstrad)", - "fdc_xt_amstrad", - 0, - FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AMSTRAD, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/XT Floppy Drive Controller (Amstrad)", + .internal_name = "fdc_xt_amstrad", + .flags = 0, + .local = FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AMSTRAD, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_xt_tandy_device = { - "PC/XT Floppy Drive Controller (Tandy)", - "fdc_xt_tandy", - 0, - FDC_FLAG_AMSTRAD, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/XT Floppy Drive Controller (Tandy)", + .internal_name = "fdc_xt_tandy", + .flags = 0, + .local = FDC_FLAG_AMSTRAD, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t fdc_pcjr_device = { - "PCjr Floppy Drive Controller", - "fdc_pcjr", - 0, - FDC_FLAG_PCJR, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PCjr Floppy Drive Controller", + .internal_name = "fdc_pcjr", + .flags = 0, + .local = FDC_FLAG_PCJR, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_at_device = { - "PC/AT Floppy Drive Controller", - "fdc_at", - 0, - FDC_FLAG_AT, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/AT Floppy Drive Controller", + .internal_name = "fdc_at", + .flags = 0, + .local = FDC_FLAG_AT, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_at_actlow_device = { - "PC/AT Floppy Drive Controller (Active low)", - "fdc_at_actlow", - 0, - FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/AT Floppy Drive Controller (Active low)", + .internal_name = "fdc_at_actlow", + .flags = 0, + .local = FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_at_ps1_device = { - "PC/AT Floppy Drive Controller (PS/1, PS/2 ISA)", - "fdc_at_ps1", - 0, - FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT | FDC_FLAG_PS1, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/AT Floppy Drive Controller (PS/1, PS/2 ISA)", + .internal_name = "fdc_at_ps1", + .flags = 0, + .local = FDC_FLAG_DISKCHG_ACTLOW | FDC_FLAG_AT | FDC_FLAG_PS1, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_at_smc_device = { - "PC/AT Floppy Drive Controller (SM(s)C FDC37Cxxx)", - "fdc_at_smc", - 0, - FDC_FLAG_AT | FDC_FLAG_SUPERIO, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/AT Floppy Drive Controller (SM(s)C FDC37Cxxx)", + .internal_name = "fdc_at_smc", + .flags = 0, + .local = FDC_FLAG_AT | FDC_FLAG_SUPERIO, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_at_winbond_device = { - "PC/AT Floppy Drive Controller (Winbond W83x77F)", - "fdc_at_winbond", - 0, - FDC_FLAG_AT | FDC_FLAG_SUPERIO | FDC_FLAG_START_RWC_1 | FDC_FLAG_MORE_TRACKS, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/AT Floppy Drive Controller (Winbond W83x77F)", + .internal_name = "fdc_at_winbond", + .flags = 0, + .local = FDC_FLAG_AT | FDC_FLAG_SUPERIO | FDC_FLAG_START_RWC_1 | FDC_FLAG_MORE_TRACKS, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_at_nsc_device = { - "PC/AT Floppy Drive Controller (NSC PC8730x)", - "fdc_at_nsc", - 0, - FDC_FLAG_AT | FDC_FLAG_MORE_TRACKS | FDC_FLAG_NSC, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "PC/AT Floppy Drive Controller (NSC PC8730x)", + .internal_name = "fdc_at_nsc", + .flags = 0, + .local = FDC_FLAG_AT | FDC_FLAG_MORE_TRACKS | FDC_FLAG_NSC, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_dp8473_device = { - "NS DP8473 Floppy Drive Controller", - "fdc_dp8473", - 0, - FDC_FLAG_AT | FDC_FLAG_NSC, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "NS DP8473 Floppy Drive Controller", + .internal_name = "fdc_dp8473", + .flags = 0, + .local = FDC_FLAG_AT | FDC_FLAG_NSC, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc_um8398_device = { - "UMC UM8398 Floppy Drive Controller", - "fdc_um8398", - 0, - FDC_FLAG_UMC, - fdc_init, - fdc_close, - fdc_reset, - { NULL }, NULL, NULL + .name = "UMC UM8398 Floppy Drive Controller", + .internal_name = "fdc_um8398", + .flags = 0, + .local = FDC_FLAG_UMC, + .init = fdc_init, + .close = fdc_close, + .reset = fdc_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/floppy/fdc_magitronic.c b/src/floppy/fdc_magitronic.c index 58679a5aa..a27e19748 100644 --- a/src/floppy/fdc_magitronic.c +++ b/src/floppy/fdc_magitronic.c @@ -126,14 +126,16 @@ static const device_config_t b215_config[] = { }; const device_t fdc_b215_device = { - "Magitronic B215", - "b215", - DEVICE_ISA, - 0, - b215_init, - b215_close, - NULL, - {b215_available}, - NULL, - NULL, - b215_config}; + .name = "Magitronic B215", + .internal_name = "b215", + .flags = DEVICE_ISA, + .local = 0, + .init = b215_init, + .close = b215_close, + .reset = NULL, + { .available = b215_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = b215_config +}; + diff --git a/src/floppy/fdc_pii15xb.c b/src/floppy/fdc_pii15xb.c index 6ac6786c9..2e865ec56 100644 --- a/src/floppy/fdc_pii15xb.c +++ b/src/floppy/fdc_pii15xb.c @@ -138,27 +138,29 @@ static const device_config_t pii_config[] = { }; const device_t fdc_pii151b_device = { - "DTK PII-151B (MiniMicro) Floppy Drive Controller", - "dtk_pii151b", - DEVICE_ISA, - 151, - pii_init, - pii_close, - NULL, - {pii_151b_available}, - NULL, - NULL, - pii_config}; + .name = "DTK PII-151B (MiniMicro) Floppy Drive Controller", + .internal_name = "dtk_pii151b", + .flags = DEVICE_ISA, + .local = 151, + .init = pii_init, + .close = pii_close, + .reset = NULL, + { .available = pii_151b_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pii_config +}; const device_t fdc_pii158b_device = { - "DTK PII-158B (MiniMicro4) Floppy Drive Controller", - "dtk_pii158b", - DEVICE_ISA, - 158, - pii_init, - pii_close, - NULL, - {pii_158_available}, - NULL, - NULL, - pii_config}; + .name = "DTK PII-158B (MiniMicro4) Floppy Drive Controller", + .internal_name = "dtk_pii158b", + .flags = DEVICE_ISA, + .local = 158, + .init = pii_init, + .close = pii_close, + .reset = NULL, + { .available = pii_158_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pii_config +}; From 1a7c27286a3f054d72244b691f535105d677d634 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:40:04 -0400 Subject: [PATCH 09/25] src/game --- src/game/gameport.c | 26 +-- src/game/joystick_ch_flightstick_pro.c | 30 ++-- src/game/joystick_standard.c | 230 +++++++++++++------------ src/game/joystick_sw_pad.c | 32 ++-- src/game/joystick_tm_fcs.c | 30 ++-- 5 files changed, 179 insertions(+), 169 deletions(-) diff --git a/src/game/gameport.c b/src/game/gameport.c index 7551b2b91..04fb01de5 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -60,17 +60,21 @@ typedef struct _joystick_instance_ { int joystick_type = 0; static const joystick_if_t joystick_none = { - "None", - "none", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - 0, - 0 + .name = "None", + .internal_name = "none", + .init = NULL, + .close = NULL, + .read = NULL, + .write = NULL, + .read_axis = NULL, + .a0_over = NULL, + .axis_count = 0, + .button_count = 0, + .pov_count = 0, + .max_joysticks = 0, + .axis_names = { NULL }, + .button_names = { NULL }, + .pov_names = { NULL } }; static const struct { diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index 5a44c2312..5be3ce50f 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -115,19 +115,19 @@ static void ch_flightstick_pro_a0_over(void *p) const joystick_if_t joystick_ch_flightstick_pro = { - "CH Flightstick Pro", - "ch_flightstick_pro", - ch_flightstick_pro_init, - ch_flightstick_pro_close, - ch_flightstick_pro_read, - ch_flightstick_pro_write, - ch_flightstick_pro_read_axis, - ch_flightstick_pro_a0_over, - 3, - 4, - 1, - 1, - {"X axis", "Y axis", "Throttle"}, - {"Button 1", "Button 2", "Button 3", "Button 4"}, - {"POV"} + .name = "CH Flightstick Pro", + .internal_name = "ch_flightstick_pro", + .init = ch_flightstick_pro_init, + .close = ch_flightstick_pro_close, + .read = ch_flightstick_pro_read, + .write = ch_flightstick_pro_write, + .read_axis = ch_flightstick_pro_read_axis, + .a0_over = ch_flightstick_pro_a0_over, + .axis_count = 3, + .button_count = 4, + .pov_count = 1, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis", "Throttle" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { "POV" } }; diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index f091841b0..ce2a72664 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -236,122 +236,128 @@ static void joystick_standard_a0_over(void *p) { } -const joystick_if_t joystick_2axis_2button = -{ - "2-axis, 2-button joystick(s)", - "2axis_2button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read, - joystick_standard_write, - joystick_standard_read_axis, - joystick_standard_a0_over, - 2, - 2, - 0, - 2, - {"X axis", "Y axis"}, - {"Button 1", "Button 2"} +const joystick_if_t joystick_2axis_2button = { + .name = "2-axis, 2-button joystick(s)", + .internal_name = "2axis_2button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis, + .a0_over = joystick_standard_a0_over, + .axis_count = 2, + .button_count = 2, + .pov_count = 0, + .max_joysticks = 2, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_2axis_4button = -{ - "2-axis, 4-button joystick", - "2axis_4button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_4button, - joystick_standard_a0_over, - 2, - 4, - 0, - 1, - {"X axis", "Y axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4"} + +const joystick_if_t joystick_2axis_4button = { + .name = "2-axis, 4-button joystick", + .internal_name = "2axis_4button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_4button, + .a0_over = joystick_standard_a0_over, + .axis_count = 2, + .button_count = 4, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_3axis_2button = -{ - "3-axis, 2-button joystick", - "3axis_2button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read, - joystick_standard_write, - joystick_standard_read_axis_3axis, - joystick_standard_a0_over, - 3, - 2, - 0, - 1, - {"X axis", "Y axis", "Z axis"}, - {"Button 1", "Button 2"} + +const joystick_if_t joystick_3axis_2button = { + .name = "3-axis, 2-button joystick", + .internal_name = "3axis_2button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_3axis, + .a0_over = joystick_standard_a0_over, + .axis_count = 3, + .button_count = 2, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis", "Z axis" }, + .button_names = { "Button 1", "Button 2" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_3axis_4button = -{ - "3-axis, 4-button joystick", - "3axis_4button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_3axis, - joystick_standard_a0_over, - 3, - 4, - 0, - 1, - {"X axis", "Y axis", "Z axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4"} + +const joystick_if_t joystick_3axis_4button = { + .name = "3-axis, 4-button joystick", + .internal_name = "3axis_4button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_3axis, + .a0_over = joystick_standard_a0_over, + .axis_count = 3, + .button_count = 4, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis", "Z axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_4axis_4button = -{ - "4-axis, 4-button joystick", - "4axis_4button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_4axis, - joystick_standard_a0_over, - 4, - 4, - 0, - 1, - {"X axis", "Y axis", "Z axis", "zX axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4"} + +const joystick_if_t joystick_4axis_4button = { + .name = "4-axis, 4-button joystick", + .internal_name = "4axis_4button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_4axis, + .a0_over = joystick_standard_a0_over, + .axis_count = 4, + .button_count = 4, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis", "Z axis", "zX axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_2axis_6button = -{ - "2-axis, 6-button joystick", - "2axis_6button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_6button, - joystick_standard_a0_over, - 2, - 6, - 0, - 1, - {"X axis", "Y axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6"} + +const joystick_if_t joystick_2axis_6button = { + .name = "2-axis, 6-button joystick", + .internal_name = "2axis_6button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_6button, + .a0_over = joystick_standard_a0_over, + .axis_count = 2, + .button_count = 6, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_2axis_8button = -{ - "2-axis, 8-button joystick", - "2axis_8button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_8button, - joystick_standard_a0_over, - 2, - 8, - 0, - 1, - {"X axis", "Y axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6", "Button 7", "Button 8"} + +const joystick_if_t joystick_2axis_8button = { + .name = "2-axis, 8-button joystick", + .internal_name = "2axis_8button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_8button, + .a0_over = joystick_standard_a0_over, + .axis_count = 2, + .button_count = 8, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6", "Button 7", "Button 8" }, + .pov_names = { NULL } }; diff --git a/src/game/joystick_sw_pad.c b/src/game/joystick_sw_pad.c index 8c0235046..718eefbb4 100644 --- a/src/game/joystick_sw_pad.c +++ b/src/game/joystick_sw_pad.c @@ -262,20 +262,20 @@ static void sw_a0_over(void *p) timer_set_delay_u64(&sw->trigger_timer, TIMER_USEC * 10000); } -const joystick_if_t joystick_sw_pad = -{ - "Microsoft SideWinder Pad", - "sidewinder_pad", - sw_init, - sw_close, - sw_read, - sw_write, - sw_read_axis, - sw_a0_over, - 2, - 10, - 0, - 4, - {"X axis", "Y axis"}, - {"A", "B", "C", "X", "Y", "Z", "L", "R", "Start", "M"} +const joystick_if_t joystick_sw_pad = { + .name = "Microsoft SideWinder Pad", + .internal_name = "sidewinder_pad", + .init = sw_init, + .close = sw_close, + .read = sw_read, + .write = sw_write, + .read_axis = sw_read_axis, + .a0_over = sw_a0_over, + .axis_count = 2, + .button_count = 10, + .pov_count = 0, + .max_joysticks = 4, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "A", "B", "C", "X", "Y", "Z", "L", "R", "Start", "M" }, + .pov_names = { NULL } }; diff --git a/src/game/joystick_tm_fcs.c b/src/game/joystick_tm_fcs.c index e3dbae1e3..ee83c5ad2 100644 --- a/src/game/joystick_tm_fcs.c +++ b/src/game/joystick_tm_fcs.c @@ -114,19 +114,19 @@ static void tm_fcs_a0_over(void *p) const joystick_if_t joystick_tm_fcs = { - "Thrustmaster Flight Control System", - "thrustmaster_fcs", - tm_fcs_init, - tm_fcs_close, - tm_fcs_read, - tm_fcs_write, - tm_fcs_read_axis, - tm_fcs_a0_over, - 2, - 4, - 1, - 1, - {"X axis", "Y axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4"}, - {"POV"} + .name = "Thrustmaster Flight Control System", + .internal_name = "thrustmaster_fcs", + .init = tm_fcs_init, + .close = tm_fcs_close, + .read = tm_fcs_read, + .write = tm_fcs_write, + .read_axis = tm_fcs_read_axis, + .a0_over = tm_fcs_a0_over, + .axis_count = 2, + .button_count = 4, + .pov_count = 1, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { "POV" } }; From 698b16a603c6a59ad90274040361cbda409cf75f Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:46:07 -0400 Subject: [PATCH 10/25] src/machine --- src/machine/m_amstrad.c | 723 +++++++++++++++------------------- src/machine/m_at_compaq.c | 126 +++--- src/machine/m_at_t3100e_vid.c | 24 +- src/machine/m_europc.c | 48 +-- src/machine/m_pcjr.c | 38 +- src/machine/m_ps1_hdc.c | 20 +- src/machine/m_tandy.c | 124 +++--- src/machine/m_xt_olivetti.c | 91 ++--- src/machine/m_xt_philips.c | 19 +- src/machine/m_xt_t1000_vid.c | 100 ++--- src/machine/m_xt_xi8088.c | 169 ++++---- src/machine/m_xt_zenith.c | 20 +- 12 files changed, 714 insertions(+), 788 deletions(-) diff --git a/src/machine/m_amstrad.c b/src/machine/m_amstrad.c index 72cb73425..511855ce9 100644 --- a/src/machine/m_amstrad.c +++ b/src/machine/m_amstrad.c @@ -670,89 +670,73 @@ vid_speed_change_1512(void *priv) } -device_config_t vid_1512_config[] = -{ - { - "display_type", "Display type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { - "PC-CM (Colour)", 0 - }, - { - "PC-MM (Monochrome)", 3 - }, - { - "" - } - } - }, - { - "codepage", "Hardware font", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { - "US English", 3 - }, - { - "Danish", 1 - }, - { - "Greek", 0 - }, - { - "" - } - } - }, - { - "language", "BIOS language", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { - "English", 7 - }, - { - "German", 6 - }, - { - "French", 5 - }, - { - "Spanish", 4 - }, - { - "Danish", 3 - }, - { - "Swedish", 2 - }, - { - "Italian", 1 - }, - { - "Diagnostic mode", 0 - }, - { - "" - } - } - }, - { - "", "", -1 - } +device_config_t vid_1512_config[] = { + { + .name = "display_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "PC-CM (Colour)", .value = 0 }, + { .description = "PC-MM (Monochrome)", .value = 3 }, + { .description = "" } + } + }, + { + .name = "codepage", + .description = "Hardware font", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "US English", .value = 3 }, + { .description = "Danish", .value = 1 }, + { .description = "Greek", .value = 0 }, + { .description = "" } + } + }, + { + .name = "language", + .description = "BIOS language", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "English", .value = 7 }, + { .description = "German", .value = 6 }, + { .description = "French", .value = 5 }, + { .description = "Spanish", .value = 4 }, + { .description = "Danish", .value = 3 }, + { .description = "Swedish", .value = 2 }, + { .description = "Italian", .value = 1 }, + { .description = "Diagnostic mode", .value = 0 }, + { .description = "" } + } + }, + { .name = "", .description = "", .type = -1 } }; - static const device_t vid_1512_device = { - "Amstrad PC1512 (video)", - "vid_1512", - 0, 0, - NULL, vid_close_1512, NULL, - { NULL }, - vid_speed_change_1512, - NULL, - vid_1512_config + .name = "Amstrad PC1512 (video)", + .internal_name = "vid_1512", + .flags = 0, + .local = 0, + .init = NULL, + .close = vid_close_1512, + .reset = NULL, + { .available = NULL }, + .speed_changed = vid_speed_change_1512, + .force_redraw = NULL, + .config = vid_1512_config }; - const device_t * pc1512_get_device(void) { @@ -898,55 +882,42 @@ vid_speed_changed_1640(void *priv) recalc_timings_1640(vid); } - -device_config_t vid_1640_config[] = -{ - { - "language", "BIOS language", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { - "English", 7 - }, - { - "German", 6 - }, - { - "French", 5 - }, - { - "Spanish", 4 - }, - { - "Danish", 3 - }, - { - "Swedish", 2 - }, - { - "Italian", 1 - }, - { - "Diagnostic mode", 0 - }, - { - "" - } - } - }, - { - "", "", -1 +device_config_t vid_1640_config[] = { + { + .name = "language", + .description = "BIOS language", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "English", .value = 7 }, + { .description = "German", .value = 6 }, + { .description = "French", .value = 5 }, + { .description = "Spanish", .value = 4 }, + { .description = "Danish", .value = 3 }, + { .description = "Swedish", .value = 2 }, + { .description = "Italian", .value = 1 }, + { .description = "Diagnostic mode", .value = 0 }, + { .description = "" } } + }, + { .name = "", .description = "", .type = -1 } }; static const device_t vid_1640_device = { - "Amstrad PC1640 (video)", - "vid_1640", - 0, 0, - NULL, vid_close_1640, NULL, - { NULL }, - vid_speed_changed_1640, - NULL, - vid_1640_config + .name = "Amstrad PC1640 (video)", + .internal_name = "vid_1640", + .flags = 0, + .local = 0, + .init = NULL, + .close = vid_close_1640, + .reset = NULL, + { .available = NULL }, + .speed_changed = vid_speed_changed_1640, + .force_redraw = NULL, + .config = vid_1640_config }; const device_t * @@ -1744,330 +1715,276 @@ vid_close_200(void *priv) } -device_config_t vid_200_config[] = -{ - /* TODO: Should have options here for: - * - * > Display port (TTL or RF) - */ - { - "video_emulation", "Display type", CONFIG_SELECTION, "", PC200_CGA, "", { 0 }, - { - { - "CGA monitor", PC200_CGA - }, - { - "MDA monitor", PC200_MDA - }, - { - "Television", PC200_TV - }, - { - "" - } - } - }, - { - "display_type", "Monitor type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { - "RGB", 0 - }, - { - "RGB (no brown)", 4 - }, - { - "Green Monochrome", 1 - }, - { - "Amber Monochrome", 2 - }, - { - "White Monochrome", 3 - }, - { - "" - } - } - }, - { - "codepage", "Hardware font", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { - "US English", 3 - }, - { - "Portugese", 2 - }, - { - "Norwegian", 1 - }, - { - "Greek", 0 - }, - { - "" - } - } - }, - { - "language", "BIOS language", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { - "English", 7 - }, - { - "German", 6 - }, - { - "French", 5 - }, - { - "Spanish", 4 - }, - { - "Danish", 3 - }, - { - "Swedish", 2 - }, - { - "Italian", 1 - }, - { - "Diagnostic mode", 0 - }, - { - "" - } - } - }, - { - "", "", -1 +device_config_t vid_200_config[] = { + /* TODO: Should have options here for: + * + * > Display port (TTL or RF) + */ + { + .name = "video_emulation", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = PC200_CGA, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "CGA monitor", .value = PC200_CGA }, + { .description = "MDA monitor", .value = PC200_MDA }, + { .description = "Television", .value = PC200_TV }, + { .description = "" } } + }, + { + .name = "display_type", + .description = "Monitor type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "RGB", .value = 0 }, + { .description = "RGB (no brown)", .value = 4 }, + { .description = "Green Monochrome", .value = 1 }, + { .description = "Amber Monochrome", .value = 2 }, + { .description = "White Monochrome", .value = 3 }, + { .description = "" } + } + }, + { + .name = "codepage", + .description = "Hardware font", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "US English", .value = 3 }, + { .description = "Portugese", .value = 2 }, + { .description = "Norwegian", .value = 1 }, + { .description = "Greek", .value = 0 }, + { .description = "" } + } + }, + { + .name = "language", + .description = "BIOS language", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "English", .value = 7 }, + { .description = "German", .value = 6 }, + { .description = "French", .value = 5 }, + { .description = "Spanish", .value = 4 }, + { .description = "Danish", .value = 3 }, + { .description = "Swedish", .value = 2 }, + { .description = "Italian", .value = 1 }, + { .description = "Diagnostic mode", .value = 0 }, + { .description = "" } + } + }, + { .name = "", .description = "", .type = -1 } }; - static const device_t vid_200_device = { - "Amstrad PC200 (video)", - "vid_200", - 0, 0, - NULL, vid_close_200, NULL, - { NULL }, - vid_speed_changed_200, - NULL, - vid_200_config + .name = "Amstrad PC200 (video)", + .internal_name = "vid_200", + .flags = 0, + .local = 0, + .init = NULL, + .close = vid_close_200, + .reset = NULL, + { .available = NULL }, + .speed_changed = vid_speed_changed_200, + .force_redraw = NULL, + .config = vid_200_config }; - const device_t * pc200_get_device(void) { return(&vid_200_device); } - -device_config_t vid_ppc512_config[] = -{ - /* TODO: Should have options here for: - * - * > Display port (TTL or RF) - */ - { - "video_emulation", "Display type", CONFIG_SELECTION, "", PC200_LCDC, "", { 0 }, - { - { - "CGA monitor", PC200_CGA - }, - { - "MDA monitor", PC200_MDA - }, - { - "LCD (CGA mode)", PC200_LCDC - }, - { - "LCD (MDA mode)", PC200_LCDM - }, - { - "" - } - }, - }, - { - "display_type", "Monitor type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { - "RGB", 0 - }, - { - "RGB (no brown)", 4 - }, - { - "Green Monochrome", 1 - }, - { - "Amber Monochrome", 2 - }, - { - "White Monochrome", 3 - }, - { - "" - } - }, +device_config_t vid_ppc512_config[] = { + /* TODO: Should have options here for: + * + * > Display port (TTL or RF) + */ + { + .name = "video_emulation", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = PC200_LCDC, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "CGA monitor", .value = PC200_CGA }, + { .description = "MDA monitor", .value = PC200_MDA }, + { .description = "LCD (CGA mode)", .value = PC200_LCDC }, + { .description = "LCD (MDA mode)", .value = PC200_LCDM }, + { .description = "" } }, - { - "codepage", "Hardware font", CONFIG_SELECTION, "", 3, "", { 0 }, - { - { - "US English", 3 - }, - { - "Portugese", 2 - }, - { - "Norwegian",1 - }, - { - "Greek", 0 - }, - { - "" - } - }, + }, + { + .name = "display_type", + .description = "Monitor type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "RGB", .value = 0 }, + { .description = "RGB (no brown)", .value = 4 }, + { .description = "Green Monochrome", .value = 1 }, + { .description = "Amber Monochrome", .value = 2 }, + { .description = "White Monochrome", .value = 3 }, + { .description = "" } }, - { - "language", "BIOS language", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { - "English", 7 - }, - { - "German", 6 - }, - { - "French", 5 - }, - { - "Spanish", 4 - }, - { - "Danish", 3 - }, - { - "Swedish", 2 - }, - { - "Italian", 1 - }, - { - "Diagnostic mode", 0 - }, - { - "" - } - } - }, - { - "invert", "Invert LCD colors", CONFIG_BINARY, "", 0 - }, - { - "", "", -1 + }, + { + .name = "codepage", + .description = "Hardware font", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 3, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "US English", .value = 3 }, + { .description = "Portugese", .value = 2 }, + { .description = "Norwegian", .value = 1 }, + { .description = "Greek", .value = 0 }, + { .description = "" } + }, + }, + { + .name = "language", + .description = "BIOS language", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "English", .value = 7 }, + { .description = "German", .value = 6 }, + { .description = "French", .value = 5 }, + { .description = "Spanish", .value = 4 }, + { .description = "Danish", .value = 3 }, + { .description = "Swedish", .value = 2 }, + { .description = "Italian", .value = 1 }, + { .description = "Diagnostic mode", .value = 0 }, + { .description = "" } } + }, + { + .name = "invert", + .description = "Invert LCD colors", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .name = "", .description = "", .type = -1 } }; static const device_t vid_ppc512_device = { - "Amstrad PPC512 (video)", - "vid_ppc512", - 0, 0, - NULL, vid_close_200, NULL, - { NULL }, - vid_speed_changed_200, - NULL, - vid_ppc512_config + .name = "Amstrad PPC512 (video)", + .internal_name = "vid_ppc512", + .flags = 0, + .local = 0, + .init = NULL, + .close = vid_close_200, + .reset = NULL, + { .available = NULL }, + .speed_changed = vid_speed_changed_200, + .force_redraw = NULL, + .config = vid_ppc512_config }; - const device_t * ppc512_get_device(void) { return(&vid_ppc512_device); } - -device_config_t vid_pc2086_config[] = -{ - { - "language", "BIOS language", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { - "English", 7 - }, - { - "Diagnostic mode", 0 - }, - { - "" - } - } - }, - { - "", "", -1 +device_config_t vid_pc2086_config[] = { + { + .name = "language", + .description = "BIOS language", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "English", .value = 7 }, + { .description = "Diagnostic mode", .value = 0 }, + { .description = "" } } + }, + { "", "", -1 } }; static const device_t vid_pc2086_device = { - "Amstrad PC2086", - "vid_pc2086", - 0, 0, - NULL, NULL, NULL, - { NULL }, - NULL, - NULL, - vid_pc2086_config + .name = "Amstrad PC2086", + .internal_name = "vid_pc2086", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = vid_pc2086_config }; - const device_t * pc2086_get_device(void) { return(&vid_pc2086_device); } - -device_config_t vid_pc3086_config[] = -{ - { - "language", "BIOS language", CONFIG_SELECTION, "", 7, "", { 0 }, - { - { - "English", 7 - }, - { - "Diagnostic mode", 3 - }, - { - "" - } - } - }, - { - "", "", -1 +device_config_t vid_pc3086_config[] = { + { + .name = "language", + .description = "BIOS language", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 7, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "English", .value = 7 }, + { .description = "Diagnostic mode", .value = 3 }, + { .description = "" } } + }, + { .name = "", .description = "", .type = -1 } }; static const device_t vid_pc3086_device = { - "Amstrad PC3086", - "vid_pc3086", - 0, 0, - NULL, NULL, NULL, - { NULL }, - NULL, - NULL, - vid_pc3086_config + .name = "Amstrad PC3086", + .internal_name = "vid_pc3086", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = vid_pc3086_config }; - const device_t * pc3086_get_device(void) { diff --git a/src/machine/m_at_compaq.c b/src/machine/m_at_compaq.c index 72c29ec07..41316bd50 100644 --- a/src/machine/m_at_compaq.c +++ b/src/machine/m_at_compaq.c @@ -670,77 +670,67 @@ compaq_plasma_speed_changed(void *p) compaq_plasma_recalctimings(self); } -const device_config_t compaq_plasma_config[] = -{ - { - "display_type", "Display type", CONFIG_SELECTION, "", CGA_RGB, "", { 0 }, - { - { - "RGB", CGA_RGB - }, - { - "Composite", CGA_COMPOSITE - }, - { - "" - } - } - }, - { - "composite_type", "Composite type", CONFIG_SELECTION, "", COMPOSITE_OLD, "", { 0 }, - { - { - "Old", COMPOSITE_OLD - }, - { - "New", COMPOSITE_NEW - }, - { - "" - } - } - }, - { - "rgb_type", "RGB type", CONFIG_SELECTION, "", 0, "", { 0 }, - { - { - "Color", 0 - }, - { - "Green Monochrome", 1 - }, - { - "Amber Monochrome", 2 - }, - { - "Gray Monochrome", 3 - }, - { - "Color (no brown)", 4 - }, - { - "" - } - } - }, - { - "", "", -1 +const device_config_t compaq_plasma_config[] = { + { + .name = "display_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = CGA_RGB, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "RGB", .value = CGA_RGB }, + { .description = "Composite", .value = CGA_COMPOSITE }, + { .description = "" } } + }, + { + .name = "composite_type", + .description = "Composite type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = COMPOSITE_OLD, + .file_filter = "", + .spinner = { 0 }, + { + { .description = "Old", .value = COMPOSITE_OLD }, + { .description = "New", .value = COMPOSITE_NEW }, + { .description = "" } + } + }, + { + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Color", .value = 0 }, + { .description = "Green Monochrome", .value = 1 }, + { .description = "Amber Monochrome", .value = 2 }, + { .description = "Gray Monochrome", .value = 3 }, + { .description = "Color (no brown)", .value = 4 }, + { .description = "" } + } + }, + { .name = "", .description = "", .type = -1 } }; - -static const device_t compaq_plasma_device = -{ - "Compaq Plasma", - "compaq_plasma", - 0, 0, - compaq_plasma_init, - compaq_plasma_close, - NULL, - { NULL }, - compaq_plasma_speed_changed, - NULL, - compaq_plasma_config +static const device_t compaq_plasma_device = { + .name = "Compaq Plasma", + .internal_name = "compaq_plasma", + .flags = 0, + .local = 0, + .init = compaq_plasma_init, + .close = compaq_plasma_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = compaq_plasma_speed_changed, + .force_redraw = NULL, + .config = compaq_plasma_config }; static uint8_t diff --git a/src/machine/m_at_t3100e_vid.c b/src/machine/m_at_t3100e_vid.c index 045ad7d61..88aaabdec 100644 --- a/src/machine/m_at_t3100e_vid.c +++ b/src/machine/m_at_t3100e_vid.c @@ -757,16 +757,16 @@ void t3100e_speed_changed(void *p) t3100e_recalctimings(t3100e); } -const device_t t3100e_device = -{ - "Toshiba T3100e", - "t3100e", - 0, - 0, - t3100e_init, - t3100e_close, - NULL, - { NULL }, - t3100e_speed_changed, - NULL +const device_t t3100e_device = { + .name = "Toshiba T3100e", + .internal_name = "t3100e", + .flags = 0, + .local = 0, + .init = t3100e_init, + .close = t3100e_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = t3100e_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/machine/m_europc.c b/src/machine/m_europc.c index 4c2f5f0b3..921feda2b 100644 --- a/src/machine/m_europc.c +++ b/src/machine/m_europc.c @@ -666,38 +666,38 @@ europc_close(void *priv) free(nvr->fn); } - static const device_config_t europc_config[] = { { - "js9", "JS9 Jumper (JIM)", CONFIG_INT, "", 0, "", { 0 }, - { - { - "Disabled (250h)", 0 - }, - { - "Enabled (350h)", 1 - }, - { - "" - } - }, + .name = "js9", + .description = "JS9 Jumper (JIM)", + .type = CONFIG_INT, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled (250h)", .value = 0 }, + { .description = "Enabled (350h)", .value = 1 }, + { "" } + }, }, - { - "", "", -1 - } + { .name = "", .description = "", .type = -1 } }; - const device_t europc_device = { - "EuroPC System Board", - "europc", - 0, 0, - europc_boot, europc_close, NULL, - { NULL }, NULL, NULL, - europc_config + .name = "EuroPC System Board", + .internal_name = "europc", + .flags = 0, + .local = 0, + .init = europc_boot, + .close = europc_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = europc_config }; - /* * This function sets up the Scheider EuroPC machine. * diff --git a/src/machine/m_pcjr.c b/src/machine/m_pcjr.c index b38b70d44..c6b38d572 100644 --- a/src/machine/m_pcjr.c +++ b/src/machine/m_pcjr.c @@ -769,40 +769,38 @@ speed_changed(void *priv) recalc_timings(pcjr); } - static const device_config_t pcjr_config[] = { { - "display_type", "Display type", CONFIG_SELECTION, "", PCJR_RGB, "", { 0 }, - { - { - "RGB", PCJR_RGB - }, - { - "Composite", PCJR_COMPOSITE - }, - { - "" - } - } + .name = "display_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = PCJR_RGB, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "RGB", .value = PCJR_RGB }, + { .description = "Composite", .value = PCJR_COMPOSITE }, + { .description = "" } + } }, - { - "", "", -1 - } + { .name = "", .description = "", .type = -1 } }; - static const device_t pcjr_device = { "IBM PCjr", "pcjr", - 0, 0, - NULL, NULL, NULL, + 0, + 0, + NULL, + NULL, + NULL, { NULL }, speed_changed, NULL, pcjr_config }; - const device_t * pcjr_get_device(void) { diff --git a/src/machine/m_ps1_hdc.c b/src/machine/m_ps1_hdc.c index e08e0e198..5cba0e8b5 100644 --- a/src/machine/m_ps1_hdc.c +++ b/src/machine/m_ps1_hdc.c @@ -1349,18 +1349,20 @@ ps1_hdc_close(void *priv) free(dev); } - const device_t ps1_hdc_device = { - "PS/1 2011 Fixed Disk Controller", - "ps1_hdc", - DEVICE_ISA | DEVICE_PS2, - 0, - ps1_hdc_init, ps1_hdc_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "PS/1 2011 Fixed Disk Controller", + .internal_name = "ps1_hdc", + .flags = DEVICE_ISA | DEVICE_PS2, + .local = 0, + .init = ps1_hdc_init, + .close = ps1_hdc_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - /* * Very nasty. * diff --git a/src/machine/m_tandy.c b/src/machine/m_tandy.c index 293919c50..894cae784 100644 --- a/src/machine/m_tandy.c +++ b/src/machine/m_tandy.c @@ -1144,59 +1144,64 @@ vid_init(tandy_t *dev) static const device_config_t vid_config[] = { { - "display_type", "Display type", CONFIG_SELECTION, "", TANDY_RGB, "", { 0 }, - { - { - "RGB", TANDY_RGB - }, - { - "Composite", TANDY_COMPOSITE - }, - { - "" - } - } + .name = "display_type", + .description = "Display type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = TANDY_RGB, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "RGB", .value = TANDY_RGB }, + { .description = "Composite", .value = TANDY_COMPOSITE }, + { .description = "" } + } }, - { - "", "", -1 - } + { .name = "", .description = "", .type = -1 } }; - static const device_t vid_device = { - "Tandy 1000", - "tandy1000_video", - 0, 0, - NULL, vid_close, NULL, - { NULL }, - vid_speed_changed, - NULL, - vid_config + .name = "Tandy 1000", + .internal_name = "tandy1000_video", + .flags = 0, + .local = 0, + .init = NULL, + .close = vid_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = vid_speed_changed, + .force_redraw = NULL, + .config = vid_config }; static const device_t vid_device_hx = { - "Tandy 1000 HX", - "tandy1000_hx_video", - 0, 0, - NULL, vid_close, NULL, - { NULL }, - vid_speed_changed, - NULL, - vid_config + .name = "Tandy 1000 HX", + .internal_name = "tandy1000_hx_video", + .flags = 0, + .local = 0, + .init = NULL, + .close = vid_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = vid_speed_changed, + .force_redraw = NULL, + .config = vid_config }; static const device_t vid_device_sl = { - "Tandy 1000SL2", - "tandy1000_sl_video", - 0, 1, - NULL, vid_close, NULL, - { NULL }, - vid_speed_changed, - NULL, - NULL + .name = "Tandy 1000SL2", + .internal_name = "tandy1000_sl_video", + .flags = 0, + .local = 1, + .init = NULL, + .close = vid_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = vid_speed_changed, + .force_redraw = NULL, + .config = NULL }; - const device_t * tandy1k_get_device(void) { @@ -1344,27 +1349,34 @@ eep_close(void *priv) free(eep); } - static const device_t eep_1000hx_device = { - "Tandy 1000HX EEPROM", - "eep_1000hx", - 0, TYPE_TANDY1000HX, - eep_init, eep_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Tandy 1000HX EEPROM", + .internal_name = "eep_1000hx", + .flags = 0, + .local = TYPE_TANDY1000HX, + .init = eep_init, + .close = eep_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - static const device_t eep_1000sl2_device = { - "Tandy 1000SL2 EEPROM", - "eep_1000sl2", - 0, TYPE_TANDY1000SL2, - eep_init, eep_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Tandy 1000SL2 EEPROM", + .internal_name = "eep_1000sl2", + .flags = 0, + .local = TYPE_TANDY1000SL2, + .init = eep_init, + .close = eep_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - static void tandy_write(uint16_t addr, uint8_t val, void *priv) { diff --git a/src/machine/m_xt_olivetti.c b/src/machine/m_xt_olivetti.c index bb6ae7db5..9cb6bfc68 100644 --- a/src/machine/m_xt_olivetti.c +++ b/src/machine/m_xt_olivetti.c @@ -588,56 +588,59 @@ m19_vid_init(m19_vid_t *vid) const device_t m24_kbd_device = { - "Olivetti M24 keyboard and mouse", - "m24_kbd", - 0, - 0, - NULL, - m24_kbd_close, - m24_kbd_reset, - { NULL }, NULL, NULL + .name = "Olivetti M24 keyboard and mouse", + .internal_name = "m24_kbd", + .flags = 0, + .local = 0, + .init = NULL, + .close = m24_kbd_close, + .reset = m24_kbd_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_config_t m19_vid_config[] = -{ - { - /* Olivetti / ATT compatible displays */ - "rgb_type", "RGB type", CONFIG_SELECTION, "", CGA_RGB, "", { 0 }, - { - { - "Color", 0 - }, - { - "Green Monochrome", 1 - }, - { - "Amber Monochrome", 2 - }, - { - "Gray Monochrome", 3 - }, - { - "" - } - } - }, - { - "snow_enabled", "Snow emulation", CONFIG_BINARY, "", 1, - }, - { - "", "", -1 +const device_config_t m19_vid_config[] = { + { + /* Olivetti / ATT compatible displays */ + .name = "rgb_type", + .description = "RGB type", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = CGA_RGB, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Color", .value = 0 }, + { .description = "Green Monochrome", .value = 1 }, + { .description = "Amber Monochrome", .value = 2 }, + { .description = "Gray Monochrome", .value = 3 }, + { .description = "" } } + }, + { + .name = "snow_enabled", + .description = "Snow emulation", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1, + }, + { .name = "", .description = "", .type = -1 } }; const device_t m19_vid_device = { - "Olivetti M19 graphics card", - "m19_vid", - 0, 0, - NULL, m19_vid_close, NULL, - { NULL }, - m19_vid_speed_changed, - NULL, - m19_vid_config + .name = "Olivetti M19 graphics card", + .internal_name = "m19_vid", + .flags = 0, + .local = 0, + .init = NULL, + .close = m19_vid_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = m19_vid_speed_changed, + .force_redraw = NULL, + .config = m19_vid_config }; const device_t * diff --git a/src/machine/m_xt_philips.c b/src/machine/m_xt_philips.c index e3d23deb7..cafccf061 100644 --- a/src/machine/m_xt_philips.c +++ b/src/machine/m_xt_philips.c @@ -134,16 +134,19 @@ philips_init(const device_t *info) } const device_t philips_device = { - "Philips XT Mainboard", - "philips", - 0, - 0, - philips_init, philips_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Philips XT Mainboard", + .internal_name = "philips", + .flags = 0, + .local = 0, + .init = philips_init, + .close = philips_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - void machine_xt_philips_common_init(const machine_t *model) { diff --git a/src/machine/m_xt_t1000_vid.c b/src/machine/m_xt_t1000_vid.c index 158990984..b2dcce64d 100644 --- a/src/machine/m_xt_t1000_vid.c +++ b/src/machine/m_xt_t1000_vid.c @@ -740,56 +740,64 @@ static void t1000_speed_changed(void *p) t1000_recalctimings(t1000); } -static const device_config_t t1000_config[] = -{ - { - .name = "display_language", - .description = "Language", - .type = CONFIG_SELECTION, - .selection = - { - { - .description = "USA", - .value = 0 - }, - { - .description = "Danish", - .value = 1 - } - }, - .default_int = 0 - }, - { - "backlight", "Enable backlight", CONFIG_BINARY, "", 1 - }, - { - "invert", "Invert colors", CONFIG_BINARY, "", 0 - }, - { - .type = -1 - } +static const device_config_t t1000_config[] = { + { + .name = "display_language", + .description = "Language", + .type = CONFIG_SELECTION, + .selection = + { + { + .description = "USA", + .value = 0 + }, + { + .description = "Danish", + .value = 1 + } + }, + .default_int = 0 + }, + { + .name = "backlight", + .description = "Enable backlight", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 1 }, + { + .name = "invert", + .description = "Invert colors", + .type = CONFIG_BINARY, + .default_string = "", + .default_int = 0 + }, + { .type = -1 } }; - const device_t t1000_video_device = { - "Toshiba T1000 Video", - "t1000_video", - 0, 0, - t1000_init, t1000_close, NULL, - { NULL }, - t1000_speed_changed, - NULL, - t1000_config + .name = "Toshiba T1000 Video", + .internal_name = "t1000_video", + .flags = 0, + .local = 0, + .init = t1000_init, + .close = t1000_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = t1000_speed_changed, + .force_redraw = NULL, + .config = t1000_config }; - const device_t t1200_video_device = { - "Toshiba T1200 Video", - "t1200_video", - 0, 0, - t1000_init, t1000_close, NULL, - { NULL }, - t1000_speed_changed, - NULL, - t1000_config + .name = "Toshiba T1200 Video", + .internal_name = "t1200_video", + .flags = 0, + .local = 0, + .init = t1000_init, + .close = t1000_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = t1000_speed_changed, + .force_redraw = NULL, + .config = t1000_config }; diff --git a/src/machine/m_xt_xi8088.c b/src/machine/m_xt_xi8088.c index bb56b3486..ea778a023 100644 --- a/src/machine/m_xt_xi8088.c +++ b/src/machine/m_xt_xi8088.c @@ -91,101 +91,92 @@ xi8088_init(const device_t *info) return &xi8088; } - -static const device_config_t xi8088_config[] = -{ - { - .name = "turbo_setting", - .description = "Turbo", - .type = CONFIG_SELECTION, - .selection = - { - { - .description = "Always at selected speed", - .value = 0 - }, - { - .description = "BIOS setting + Hotkeys (off during POST)", - .value = 1 - } - }, - .default_int = 0 +static const device_config_t xi8088_config[] = { + { + .name = "turbo_setting", + .description = "Turbo", + .type = CONFIG_SELECTION, + .selection = { + { + .description = "Always at selected speed", + .value = 0 + }, + { + .description = "BIOS setting + Hotkeys (off during POST)", + .value = 1 + } }, - { - .name = "bios_128kb", - .description = "BIOS size", - .type = CONFIG_SELECTION, - .selection = - { - { - .description = "64KB starting from 0xF0000", - .value = 0 - }, - { - .description = "128KB starting from 0xE0000 (address MSB inverted, last 64KB first)", - .value = 1 - } - }, - .default_int = 1 + .default_int = 0 + }, + { + .name = "bios_128kb", + .description = "BIOS size", + .type = CONFIG_SELECTION, + .selection = { + { + .description = "64KB starting from 0xF0000", + .value = 0 + }, + { + .description = "128KB starting from 0xE0000 (address MSB inverted, last 64KB first)", + .value = 1 + } }, - { - .name = "umb_c0000h_c7fff", - .description = "Map 0xc0000-0xc7fff as UMB", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .name = "umb_c8000h_cffff", - .description = "Map 0xc8000-0xcffff as UMB", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .name = "umb_d0000h_d7fff", - .description = "Map 0xd0000-0xd7fff as UMB", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .name = "umb_d8000h_dffff", - .description = "Map 0xd8000-0xdffff as UMB", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .name = "umb_e0000h_e7fff", - .description = "Map 0xe0000-0xe7fff as UMB", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .name = "umb_e8000h_effff", - .description = "Map 0xe8000-0xeffff as UMB", - .type = CONFIG_BINARY, - .default_int = 0 - }, - { - .type = -1 - } + .default_int = 1 + }, + { + .name = "umb_c0000h_c7fff", + .description = "Map 0xc0000-0xc7fff as UMB", + .type = CONFIG_BINARY, + .default_int = 0 + }, + { + .name = "umb_c8000h_cffff", + .description = "Map 0xc8000-0xcffff as UMB", + .type = CONFIG_BINARY, + .default_int = 0 + }, + { + .name = "umb_d0000h_d7fff", + .description = "Map 0xd0000-0xd7fff as UMB", + .type = CONFIG_BINARY, + .default_int = 0 + }, + { + .name = "umb_d8000h_dffff", + .description = "Map 0xd8000-0xdffff as UMB", + .type = CONFIG_BINARY, + .default_int = 0 + }, + { + .name = "umb_e0000h_e7fff", + .description = "Map 0xe0000-0xe7fff as UMB", + .type = CONFIG_BINARY, + .default_int = 0 + }, + { + .name = "umb_e8000h_effff", + .description = "Map 0xe8000-0xeffff as UMB", + .type = CONFIG_BINARY, + .default_int = 0 + }, + { .type = -1 } }; - -const device_t xi8088_device = -{ - "Xi8088", - "xi8088", - 0, - 0, - xi8088_init, - NULL, - NULL, - { NULL }, - NULL, - NULL, - xi8088_config +const device_t xi8088_device = { + .name = "Xi8088", + .internal_name = "xi8088", + .flags = 0, + .local = 0, + .init = xi8088_init, + .close = NULL, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = xi8088_config }; - const device_t * xi8088_get_device(void) { diff --git a/src/machine/m_xt_zenith.c b/src/machine/m_xt_zenith.c index 138badafa..c210d5086 100644 --- a/src/machine/m_xt_zenith.c +++ b/src/machine/m_xt_zenith.c @@ -98,18 +98,20 @@ zenith_scratchpad_close(void *p) free(dev); } - static const device_t zenith_scratchpad_device = { - "Zenith scratchpad RAM", - "zenith_scratchpad", - 0, 0, - zenith_scratchpad_init, zenith_scratchpad_close, NULL, - { NULL }, - NULL, - NULL + .name = "Zenith scratchpad RAM", + .internal_name = "zenith_scratchpad", + .flags = 0, + .local = 0, + .init = zenith_scratchpad_init, + .close = zenith_scratchpad_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - void machine_zenith_init(const machine_t *model){ From 438e05d100c72ed120803ce51a59354c5441693d Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:47:11 -0400 Subject: [PATCH 11/25] src/mem --- src/mem/catalyst_flash.c | 22 ++++--- src/mem/intel_flash.c | 67 ++++++++++--------- src/mem/spd.c | 18 +++-- src/mem/sst_flash.c | 137 ++++++++++++++++++++------------------- 4 files changed, 131 insertions(+), 113 deletions(-) diff --git a/src/mem/catalyst_flash.c b/src/mem/catalyst_flash.c index 246063276..0a7fe2cdf 100644 --- a/src/mem/catalyst_flash.c +++ b/src/mem/catalyst_flash.c @@ -242,14 +242,16 @@ catalyst_flash_close(void *p) } -const device_t catalyst_flash_device = -{ - "Catalyst 28F010-D Flash BIOS", - "catalyst_flash", - DEVICE_PCI, - 0, - catalyst_flash_init, - catalyst_flash_close, - catalyst_flash_reset, - { NULL }, NULL, NULL, NULL +const device_t catalyst_flash_device = { + .name = "Catalyst 28F010-D Flash BIOS", + .internal_name = "catalyst_flash", + .flags = DEVICE_PCI, + .local = 0, + .init = catalyst_flash_init, + .close = catalyst_flash_close, + .reset = catalyst_flash_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/mem/intel_flash.c b/src/mem/intel_flash.c index 42da74e71..66c59914d 100644 --- a/src/mem/intel_flash.c +++ b/src/mem/intel_flash.c @@ -560,40 +560,45 @@ intel_flash_close(void *p) free(dev); } - /* For AMI BIOS'es - Intel 28F001BXT with A16 pin inverted. */ -const device_t intel_flash_bxt_ami_device = -{ - "Intel 28F001BXT/28F002BXT/28F004BXT Flash BIOS", - "intel_flash_bxt_ami", - DEVICE_PCI, - FLAG_INV_A16, - intel_flash_init, - intel_flash_close, - intel_flash_reset, - { NULL }, NULL, NULL, NULL +const device_t intel_flash_bxt_ami_device = { + .name = "Intel 28F001BXT/28F002BXT/28F004BXT Flash BIOS", + .internal_name = "intel_flash_bxt_ami", + .flags = DEVICE_PCI, + .local = FLAG_INV_A16, + .init = intel_flash_init, + .close = intel_flash_close, + .reset = intel_flash_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t intel_flash_bxt_device = -{ - "Intel 28F001BXT/28F002BXT/28F004BXT Flash BIOS", - "intel_flash_bxt", - DEVICE_PCI, 0, - intel_flash_init, - intel_flash_close, - intel_flash_reset, - { NULL }, NULL, NULL, NULL +const device_t intel_flash_bxt_device = { + .name = "Intel 28F001BXT/28F002BXT/28F004BXT Flash BIOS", + .internal_name = "intel_flash_bxt", + .flags = DEVICE_PCI, + .local = 0, + .init = intel_flash_init, + .close = intel_flash_close, + .reset = intel_flash_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t intel_flash_bxb_device = -{ - "Intel 28F001BXB/28F002BXB/28F004BXB Flash BIOS", - "intel_flash_bxb", - DEVICE_PCI, FLAG_BXB, - intel_flash_init, - intel_flash_close, - intel_flash_reset, - { NULL }, NULL, NULL, NULL +const device_t intel_flash_bxb_device = { + .name = "Intel 28F001BXB/28F002BXB/28F004BXB Flash BIOS", + .internal_name = "intel_flash_bxb", + .flags = DEVICE_PCI, + .local = FLAG_BXB, + .init = intel_flash_init, + .close = intel_flash_close, + .reset = intel_flash_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/mem/spd.c b/src/mem/spd.c index f65d72ae7..96df99867 100644 --- a/src/mem/spd.c +++ b/src/mem/spd.c @@ -578,11 +578,15 @@ spd_write_drbs_ali1621(uint8_t *regs, uint8_t reg_min, uint8_t reg_max) static const device_t spd_device = { - "Serial Presence Detect ROMs", - "spd", - DEVICE_ISA, - 0, - spd_init, spd_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Serial Presence Detect ROMs", + .internal_name = "spd", + .flags = DEVICE_ISA, + .local = 0, + .init = spd_init, + .close = spd_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/mem/sst_flash.c b/src/mem/sst_flash.c index 8988b7e14..1fc5b2082 100644 --- a/src/mem/sst_flash.c +++ b/src/mem/sst_flash.c @@ -474,79 +474,86 @@ sst_close(void *p) free(dev); } - -const device_t sst_flash_29ee010_device = -{ - "SST 29EE010 Flash BIOS", - "sst_flash_29ee010", - 0, - SST | SST29EE010 | SIZE_1M, - sst_init, - sst_close, - NULL, - { NULL }, NULL, NULL, NULL +const device_t sst_flash_29ee010_device = { + .name = "SST 29EE010 Flash BIOS", + .internal_name = "sst_flash_29ee010", + .flags = 0, + .local = SST | SST29EE010 | SIZE_1M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t sst_flash_29ee020_device = -{ - "SST 29EE020 Flash BIOS", - "sst_flash_29ee020", - 0, - SST | SST29EE020 | SIZE_2M, - sst_init, - sst_close, - NULL, - { NULL }, NULL, NULL, NULL +const device_t sst_flash_29ee020_device = { + .name = "SST 29EE020 Flash BIOS", + .internal_name = "sst_flash_29ee020", + .flags = 0, + .local = SST | SST29EE020 | SIZE_2M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t winbond_flash_w29c020_device = -{ - "Winbond W29C020 Flash BIOS", - "winbond_flash_w29c020", - 0, - WINBOND | W29C020 | SIZE_2M, - sst_init, - sst_close, - NULL, - { NULL }, NULL, NULL, NULL +const device_t winbond_flash_w29c020_device = { + .name = "Winbond W29C020 Flash BIOS", + .internal_name = "winbond_flash_w29c020", + .flags = 0, + .local = WINBOND | W29C020 | SIZE_2M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t sst_flash_39sf010_device = -{ - "SST 39SF010 Flash BIOS", - "sst_flash_39sf010", - 0, - SST | SST39SF010 | SIZE_1M, - sst_init, - sst_close, - NULL, - { NULL }, NULL, NULL, NULL +const device_t sst_flash_39sf010_device = { + .name = "SST 39SF010 Flash BIOS", + .internal_name = "sst_flash_39sf010", + .flags = 0, + .local = SST | SST39SF010 | SIZE_1M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - -const device_t sst_flash_39sf020_device = -{ - "SST 39SF020 Flash BIOS", - "sst_flash_39sf020", - 0, - SST | SST39SF020 | SIZE_2M, - sst_init, - sst_close, - NULL, - { NULL }, NULL, NULL, NULL +const device_t sst_flash_39sf020_device = { + .name = "SST 39SF020 Flash BIOS", + .internal_name = "sst_flash_39sf020", + .flags = 0, + .local = SST | SST39SF020 | SIZE_2M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t sst_flash_39sf040_device = -{ - "SST 39SF040 Flash BIOS", - "sst_flash_39sf040", - 0, - SST | SST39SF040 | SIZE_4M, - sst_init, - sst_close, - NULL, - { NULL }, NULL, NULL, NULL +const device_t sst_flash_39sf040_device = { + .name = "SST 39SF040 Flash BIOS", + .internal_name = "sst_flash_39sf040", + .flags = 0, + .local = SST | SST39SF040 | SIZE_4M, + .init = sst_init, + .close = sst_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; From d1dc795659ffa19ce7782821daf4873ff37ac366 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:50:25 -0400 Subject: [PATCH 12/25] src/network --- src/network/net_3c503.c | 18 ++++--- src/network/net_dp8390.c | 16 ++++-- src/network/net_ne2000.c | 90 +++++++++++++++++++------------- src/network/net_pcnet.c | 108 ++++++++++++++++++++++++--------------- src/network/net_plip.c | 16 ++++-- src/network/net_wd8003.c | 90 +++++++++++++++++++------------- src/network/network.c | 17 +++--- 7 files changed, 220 insertions(+), 135 deletions(-) diff --git a/src/network/net_3c503.c b/src/network/net_3c503.c index 7700c8039..03d224a4a 100644 --- a/src/network/net_3c503.c +++ b/src/network/net_3c503.c @@ -692,11 +692,15 @@ static const device_config_t threec503_config[] = { }; const device_t threec503_device = { - "3Com EtherLink II", - "3c503", - DEVICE_ISA, - 0, - threec503_nic_init, threec503_nic_close, NULL, - { NULL }, NULL, NULL, - threec503_config + .name = "3Com EtherLink II", + .internal_name = "3c503", + .flags = DEVICE_ISA, + .local = 0, + .init = threec503_nic_init, + .close = threec503_nic_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = threec503_config }; diff --git a/src/network/net_dp8390.c b/src/network/net_dp8390.c index 8e9b16f59..7dfcf8c34 100644 --- a/src/network/net_dp8390.c +++ b/src/network/net_dp8390.c @@ -1112,9 +1112,15 @@ dp8390_close(void *priv) const device_t dp8390_device = { - "DP8390 Network Interface Controller", - "dp8390", - 0, 0, - dp8390_init, dp8390_close, - NULL, { NULL }, NULL, NULL + .name = "DP8390 Network Interface Controller", + .internal_name = "dp8390", + .flags = 0, + .local = 0, + .init = dp8390_init, + .close = dp8390_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index a836d5d8a..1161a5a9c 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -1226,51 +1226,71 @@ static const device_config_t mca_mac_config[] = { // clang-format on const device_t ne1000_device = { - "Novell NE1000", - "ne1k", - DEVICE_ISA, - NE2K_NE1000, - nic_init, nic_close, NULL, - { NULL }, NULL, NULL, - ne1000_config + .name = "Novell NE1000", + .internal_name = "ne1k", + .flags = DEVICE_ISA, + .local = NE2K_NE1000, + .init = nic_init, + .close = nic_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ne1000_config }; const device_t ne2000_device = { - "Novell NE2000", - "ne2k", - DEVICE_ISA | DEVICE_AT, - NE2K_NE2000, - nic_init, nic_close, NULL, - { NULL }, NULL, NULL, - ne2000_config + .name = "Novell NE2000", + .internal_name = "ne2k", + .flags = DEVICE_ISA | DEVICE_AT, + .local = NE2K_NE2000, + .init = nic_init, + .close = nic_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ne2000_config }; const device_t ethernext_mc_device = { - "NetWorth EtherNext/MC", - "ethernextmc", - DEVICE_MCA, - NE2K_ETHERNEXT_MC, - nic_init, nic_close, NULL, - { NULL }, NULL, NULL, - mca_mac_config + .name = "NetWorth EtherNext/MC", + .internal_name = "ethernextmc", + .flags = DEVICE_MCA, + .local = NE2K_ETHERNEXT_MC, + .init = nic_init, + .close = nic_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = mca_mac_config }; const device_t rtl8019as_device = { - "Realtek RTL8019AS", - "ne2kpnp", - DEVICE_ISA | DEVICE_AT, - NE2K_RTL8019AS, - nic_init, nic_close, NULL, - { NULL }, NULL, NULL, - rtl8019as_config + .name = "Realtek RTL8019AS", + .internal_name = "ne2kpnp", + .flags = DEVICE_ISA | DEVICE_AT, + .local = NE2K_RTL8019AS, + .init = nic_init, + .close = nic_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = rtl8019as_config }; const device_t rtl8029as_device = { - "Realtek RTL8029AS", - "ne2kpci", - DEVICE_PCI, - NE2K_RTL8029AS, - nic_init, nic_close, NULL, - { NULL }, NULL, NULL, - rtl8029as_config + .name = "Realtek RTL8029AS", + .internal_name = "ne2kpci", + .flags = DEVICE_PCI, + .local = NE2K_RTL8029AS, + .init = nic_init, + .close = nic_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = rtl8029as_config }; diff --git a/src/network/net_pcnet.c b/src/network/net_pcnet.c index 17049e2bf..6dd22315d 100644 --- a/src/network/net_pcnet.c +++ b/src/network/net_pcnet.c @@ -3144,61 +3144,85 @@ static const device_config_t pcnet_vlb_config[] = { // clang-format on const device_t pcnet_am79c960_device = { - "AMD PCnet-ISA", - "pcnetisa", - DEVICE_AT | DEVICE_ISA, - DEV_AM79C960, - pcnet_init, pcnet_close, NULL, - { NULL }, NULL, NULL, - pcnet_isa_config + .name = "AMD PCnet-ISA", + .internal_name = "pcnetisa", + .flags = DEVICE_AT | DEVICE_ISA, + .local = DEV_AM79C960, + .init = pcnet_init, + .close = pcnet_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pcnet_isa_config }; const device_t pcnet_am79c960_eb_device = { - "Racal Interlan EtherBlaster", - "pcnetracal", - DEVICE_AT | DEVICE_ISA, - DEV_AM79C960_EB, - pcnet_init, pcnet_close, NULL, - { NULL }, NULL, NULL, - pcnet_isa_config + .name = "Racal Interlan EtherBlaster", + .internal_name = "pcnetracal", + .flags = DEVICE_AT | DEVICE_ISA, + .local = DEV_AM79C960_EB, + .init = pcnet_init, + .close = pcnet_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pcnet_isa_config }; const device_t pcnet_am79c960_vlb_device = { - "AMD PCnet-VL", - "pcnetvlb", - DEVICE_VLB, - DEV_AM79C960_VLB, - pcnet_init, pcnet_close, NULL, - { NULL }, NULL, NULL, - pcnet_vlb_config + .name = "AMD PCnet-VL", + .internal_name = "pcnetvlb", + .flags = DEVICE_VLB, + .local = DEV_AM79C960_VLB, + .init = pcnet_init, + .close = pcnet_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pcnet_vlb_config }; const device_t pcnet_am79c961_device = { - "AMD PCnet-ISA+", - "pcnetisaplus", - DEVICE_AT | DEVICE_ISA, - DEV_AM79C961, - pcnet_init, pcnet_close, NULL, - { NULL }, NULL, NULL, - pcnet_pci_config + .name = "AMD PCnet-ISA+", + .internal_name = "pcnetisaplus", + .flags = DEVICE_AT | DEVICE_ISA, + .local = DEV_AM79C961, + .init = pcnet_init, + .close = pcnet_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pcnet_pci_config }; const device_t pcnet_am79c970a_device = { - "AMD PCnet-PCI II", - "pcnetpci", - DEVICE_PCI, - DEV_AM79C970A, - pcnet_init, pcnet_close, NULL, - { NULL }, NULL, NULL, - pcnet_pci_config + .name = "AMD PCnet-PCI II", + .internal_name = "pcnetpci", + .flags = DEVICE_PCI, + .local = DEV_AM79C970A, + .init = pcnet_init, + .close = pcnet_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pcnet_pci_config }; const device_t pcnet_am79c973_device = { - "AMD PCnet-FAST III", - "pcnetfast", - DEVICE_PCI, - DEV_AM79C973, - pcnet_init, pcnet_close, NULL, - { NULL }, NULL, NULL, - pcnet_pci_config + .name = "AMD PCnet-FAST III", + .internal_name = "pcnetfast", + .flags = DEVICE_PCI, + .local = DEV_AM79C973, + .init = pcnet_init, + .close = pcnet_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pcnet_pci_config }; diff --git a/src/network/net_plip.c b/src/network/net_plip.c index 528099f9b..e8e7df008 100644 --- a/src/network/net_plip.c +++ b/src/network/net_plip.c @@ -504,9 +504,15 @@ const lpt_device_t lpt_plip_device = { }; const device_t plip_device = { - "Parallel Line Internet Protocol", - "plip", - DEVICE_LPT, 0, - plip_net_init, NULL, - NULL, { NULL }, NULL, NULL + .name = "Parallel Line Internet Protocol", + .internal_name = "plip", + .flags = DEVICE_LPT, + .local = 0, + .init = plip_net_init, + .close = NULL, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/network/net_wd8003.c b/src/network/net_wd8003.c index 90cbdea2e..be6c46905 100644 --- a/src/network/net_wd8003.c +++ b/src/network/net_wd8003.c @@ -892,51 +892,71 @@ static const device_config_t mca_mac_config[] = { // clang-format on const device_t wd8003e_device = { - "Western Digital WD8003E", - "wd8003e", - DEVICE_ISA, - WD8003E, - wd_init, wd_close, NULL, - { NULL }, NULL, NULL, - wd8003_config + .name = "Western Digital WD8003E", + .internal_name = "wd8003e", + .flags = DEVICE_ISA, + .local = WD8003E, + .init = wd_init, + .close = wd_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = wd8003_config }; const device_t wd8003eb_device = { - "Western Digital WD8003EB", - "wd8003eb", - DEVICE_ISA, - WD8003EB, - wd_init, wd_close, NULL, - { NULL }, NULL, NULL, - wd8003eb_config + .name = "Western Digital WD8003EB", + .internal_name = "wd8003eb", + .flags = DEVICE_ISA, + .local = WD8003EB, + .init = wd_init, + .close = wd_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = wd8003eb_config }; const device_t wd8013ebt_device = { - "Western Digital WD8013EBT", - "wd8013ebt", - DEVICE_ISA, - WD8013EBT, - wd_init, wd_close, NULL, - { NULL }, NULL, NULL, - wd8013_config + .name = "Western Digital WD8013EBT", + .internal_name = "wd8013ebt", + .flags = DEVICE_ISA, + .local = WD8013EBT, + .init = wd_init, + .close = wd_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = wd8013_config }; const device_t wd8003eta_device = { - "Western Digital WD8003ET/A", - "wd8003eta", - DEVICE_MCA, - WD8003ETA, - wd_init, wd_close, NULL, - { NULL }, NULL, NULL, - mca_mac_config + .name = "Western Digital WD8003ET/A", + .internal_name = "wd8003eta", + .flags = DEVICE_MCA, + .local = WD8003ETA, + .init = wd_init, + .close = wd_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = mca_mac_config }; const device_t wd8003ea_device = { - "Western Digital WD8003E/A", - "wd8003ea", - DEVICE_MCA, - WD8003EA, - wd_init, wd_close, NULL, - { NULL }, NULL, NULL, - mca_mac_config + .name = "Western Digital WD8003E/A", + .internal_name = "wd8003ea", + .flags = DEVICE_MCA, + .local = WD8003EA, + .init = wd_init, + .close = wd_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = mca_mac_config }; diff --git a/src/network/network.c b/src/network/network.c index ea1ccdf46..a02000372 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -71,12 +71,17 @@ static const device_t net_none_device = { - "None", - "none", - 0, NET_TYPE_NONE, - NULL, NULL, NULL, - { NULL }, NULL, NULL, - NULL + .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 }; From e188137b96d61bf1fd7b85b1d809ad70a89ca071 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:51:07 -0400 Subject: [PATCH 13/25] src/printer --- src/printer/prt_escp.c | 18 +++++++++--------- src/printer/prt_text.c | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/printer/prt_escp.c b/src/printer/prt_escp.c index ef8b26eac..d290e295f 100644 --- a/src/printer/prt_escp.c +++ b/src/printer/prt_escp.c @@ -2143,13 +2143,13 @@ escp_close(void *priv) const lpt_device_t lpt_prt_escp_device = { - "Generic ESC/P Dot-Matrix", - "dot_matrix", - escp_init, - escp_close, - write_data, - write_ctrl, - read_data, - read_status, - read_ctrl + .name = "Generic ESC/P Dot-Matrix", + .internal_name = "dot_matrix", + .init = escp_init, + .close = escp_close, + .write_data = write_data, + .write_ctrl = write_ctrl, + .read_data = read_data, + .read_status = read_status, + .read_ctrl = read_ctrl }; diff --git a/src/printer/prt_text.c b/src/printer/prt_text.c index e4ddb2b20..7c791227f 100644 --- a/src/printer/prt_text.c +++ b/src/printer/prt_text.c @@ -483,13 +483,13 @@ prnt_close(void *priv) const lpt_device_t lpt_prt_text_device = { - "Generic Text Printer", - "text_prt", - prnt_init, - prnt_close, - write_data, - write_ctrl, - NULL, - read_status, - NULL + .name = "Generic Text Printer", + .internal_name = "text_prt", + .init = prnt_init, + .close = prnt_close, + .write_data = write_data, + .write_ctrl = write_ctrl, + .read_data = NULL, + .read_status = read_status, + .read_ctrl = NULL }; From 98be04c95514cac56bb253b856873a6c204a3920 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:54:10 -0400 Subject: [PATCH 14/25] src/scsi --- src/scsi/scsi.c | 81 +++++++++++---------- src/scsi/scsi_aha154x.c | 108 +++++++++++++++++----------- src/scsi/scsi_buslogic.c | 144 ++++++++++++++++++++++--------------- src/scsi/scsi_ncr5380.c | 110 +++++++++++++++------------- src/scsi/scsi_ncr53c8xx.c | 146 ++++++++++++++++++++++---------------- src/scsi/scsi_pcscsi.c | 42 ++++++----- src/scsi/scsi_spock.c | 22 +++--- 7 files changed, 377 insertions(+), 276 deletions(-) diff --git a/src/scsi/scsi.c b/src/scsi/scsi.c index b898f9de8..7edfa1844 100644 --- a/src/scsi/scsi.c +++ b/src/scsi/scsi.c @@ -52,12 +52,17 @@ static uint8_t next_scsi_bus = 0; static const device_t scsi_none_device = { - "None", - "none", - 0, 0, - NULL, NULL, NULL, - { NULL }, NULL, NULL, - NULL + .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 }; @@ -67,39 +72,41 @@ typedef const struct { static SCSI_CARD scsi_cards[] = { - { &scsi_none_device, }, - { &aha154xa_device, }, - { &aha154xb_device, }, - { &aha154xc_device, }, - { &aha154xcf_device, }, - { &aha154xcp_device, }, - { &buslogic_542b_device, }, - { &buslogic_542bh_device, }, - { &buslogic_545s_device, }, - { &buslogic_545c_device, }, - { &scsi_ls2000_device, }, - { &scsi_lcs6821n_device, }, - { &scsi_rt1000b_device, }, - { &scsi_t128_device, }, - { &scsi_t130b_device, }, +// clang-format off + { &scsi_none_device, }, + { &aha154xa_device, }, + { &aha154xb_device, }, + { &aha154xc_device, }, + { &aha154xcf_device, }, + { &aha154xcp_device, }, + { &buslogic_542b_device, }, + { &buslogic_542bh_device, }, + { &buslogic_545s_device, }, + { &buslogic_545c_device, }, + { &scsi_ls2000_device, }, + { &scsi_lcs6821n_device, }, + { &scsi_rt1000b_device, }, + { &scsi_t128_device, }, + { &scsi_t130b_device, }, #ifdef WALTJE - { &scsi_wd33c93_device, }, + { &scsi_wd33c93_device, }, #endif - { &aha1640_device, }, - { &buslogic_640a_device, }, - { &ncr53c90_mca_device, }, - { &spock_device, }, - { &buslogic_958d_pci_device, }, - { &ncr53c810_pci_device, }, - { &ncr53c815_pci_device, }, - { &ncr53c820_pci_device, }, - { &ncr53c825a_pci_device, }, - { &ncr53c860_pci_device, }, - { &ncr53c875_pci_device, }, - { &dc390_pci_device, }, - { &buslogic_445s_device, }, - { &buslogic_445c_device, }, - { NULL, }, + { &aha1640_device, }, + { &buslogic_640a_device, }, + { &ncr53c90_mca_device, }, + { &spock_device, }, + { &buslogic_958d_pci_device, }, + { &ncr53c810_pci_device, }, + { &ncr53c815_pci_device, }, + { &ncr53c820_pci_device, }, + { &ncr53c825a_pci_device, }, + { &ncr53c860_pci_device, }, + { &ncr53c875_pci_device, }, + { &dc390_pci_device, }, + { &buslogic_445s_device, }, + { &buslogic_445c_device, }, + { NULL, }, +// clang-format on }; diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index e47d61497..9fac11764 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -1320,61 +1320,85 @@ static const device_config_t aha_154xcf_config[] = { // clang-format on const device_t aha154xa_device = { - "Adaptec AHA-154xA", - "aha154xa", - DEVICE_ISA | DEVICE_AT, - AHA_154xA, - aha_init, x54x_close, NULL, - { NULL }, NULL, NULL, - aha_154xb_config + .name = "Adaptec AHA-154xA", + .internal_name = "aha154xa", + .flags = DEVICE_ISA | DEVICE_AT, + .local = AHA_154xA, + .init = aha_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = aha_154xb_config }; const device_t aha154xb_device = { - "Adaptec AHA-154xB", - "aha154xb", - DEVICE_ISA | DEVICE_AT, - AHA_154xB, - aha_init, x54x_close, NULL, - { NULL }, NULL, NULL, - aha_154xb_config + .name = "Adaptec AHA-154xB", + .internal_name = "aha154xb", + .flags = DEVICE_ISA | DEVICE_AT, + .local = AHA_154xB, + .init = aha_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = aha_154xb_config }; const device_t aha154xc_device = { - "Adaptec AHA-154xC", - "aha154xc", - DEVICE_ISA | DEVICE_AT, - AHA_154xC, - aha_init, x54x_close, NULL, - { NULL }, NULL, NULL, - aha_154x_config + .name = "Adaptec AHA-154xC", + .internal_name = "aha154xc", + .flags = DEVICE_ISA | DEVICE_AT, + .local = AHA_154xC, + .init = aha_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = aha_154x_config }; const device_t aha154xcf_device = { - "Adaptec AHA-154xCF", - "aha154xcf", - DEVICE_ISA | DEVICE_AT, - AHA_154xCF, - aha_init, x54x_close, NULL, - { NULL }, NULL, NULL, - aha_154xcf_config + .name = "Adaptec AHA-154xCF", + .internal_name = "aha154xcf", + .flags = DEVICE_ISA | DEVICE_AT, + .local = AHA_154xCF, + .init = aha_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = aha_154xcf_config }; const device_t aha154xcp_device = { - "Adaptec AHA-154xCP", - "aha154xcp", - DEVICE_ISA | DEVICE_AT, - AHA_154xCP, - aha_init, aha1542cp_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Adaptec AHA-154xCP", + .internal_name = "aha154xcp", + .flags = DEVICE_ISA | DEVICE_AT, + .local = AHA_154xCP, + .init = aha_init, + .close = aha1542cp_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t aha1640_device = { - "Adaptec AHA-1640", - "aha1640", - DEVICE_MCA, - AHA_1640, - aha_init, x54x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Adaptec AHA-1640", + .internal_name = "aha1640", + .flags = DEVICE_MCA, + .local = AHA_1640, + .init = aha_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index 84144383b..79a019821 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -1857,81 +1857,113 @@ static const device_config_t BT958D_Config[] = { // clang-format on const device_t buslogic_542b_device = { - "BusLogic BT-542B ISA", - "bt542b", - DEVICE_ISA | DEVICE_AT, - CHIP_BUSLOGIC_ISA_542B_1991_12_14, - buslogic_init, x54x_close, NULL, - { NULL }, NULL, NULL, - BT_ISA_Config + .name = "BusLogic BT-542B ISA", + .internal_name = "bt542b", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CHIP_BUSLOGIC_ISA_542B_1991_12_14, + .init = buslogic_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = BT_ISA_Config }; const device_t buslogic_545s_device = { - "BusLogic BT-545S ISA", - "bt545s", - DEVICE_ISA | DEVICE_AT, - CHIP_BUSLOGIC_ISA_545S_1992_10_05, - buslogic_init, x54x_close, NULL, - { NULL }, NULL, NULL, - BT_ISA_Config + .name = "BusLogic BT-545S ISA", + .internal_name = "bt545s", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CHIP_BUSLOGIC_ISA_545S_1992_10_05, + .init = buslogic_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = BT_ISA_Config }; const device_t buslogic_542bh_device = { - "BusLogic BT-542BH ISA", - "bt542bh", - DEVICE_ISA | DEVICE_AT, - CHIP_BUSLOGIC_ISA_542BH_1993_05_23, - buslogic_init, x54x_close, NULL, - { NULL }, NULL, NULL, - BT_ISA_Config + .name = "BusLogic BT-542BH ISA", + .internal_name = "bt542bh", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CHIP_BUSLOGIC_ISA_542BH_1993_05_23, + .init = buslogic_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = BT_ISA_Config }; const device_t buslogic_545c_device = { - "BusLogic BT-545C ISA", - "bt545c", - DEVICE_ISA | DEVICE_AT, - CHIP_BUSLOGIC_ISA_545C_1994_12_01, - buslogic_init, x54x_close, NULL, - { NULL }, NULL, NULL, - BT_ISA_Config + .name = "BusLogic BT-545C ISA", + .internal_name = "bt545c", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CHIP_BUSLOGIC_ISA_545C_1994_12_01, + .init = buslogic_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = BT_ISA_Config }; const device_t buslogic_640a_device = { - "BusLogic BT-640A MCA", - "bt640a", - DEVICE_MCA, - CHIP_BUSLOGIC_MCA_640A_1993_05_23, - buslogic_init, x54x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "BusLogic BT-640A MCA", + .internal_name = "bt640a", + .flags = DEVICE_MCA, + .local = CHIP_BUSLOGIC_MCA_640A_1993_05_23, + .init = buslogic_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t buslogic_445s_device = { - "BusLogic BT-445S VLB", - "bt445s", - DEVICE_VLB, - CHIP_BUSLOGIC_VLB_445S_1993_11_16, - buslogic_init, x54x_close, NULL, - { NULL }, NULL, NULL, - BT_ISA_Config + .name = "BusLogic BT-445S VLB", + .internal_name = "bt445s", + .flags = DEVICE_VLB, + .local = CHIP_BUSLOGIC_VLB_445S_1993_11_16, + .init = buslogic_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = BT_ISA_Config }; const device_t buslogic_445c_device = { - "BusLogic BT-445C VLB", - "bt445c", - DEVICE_VLB, - CHIP_BUSLOGIC_VLB_445C_1994_12_01, - buslogic_init, x54x_close, NULL, - { NULL }, NULL, NULL, - BT_ISA_Config + .name = "BusLogic BT-445C VLB", + .internal_name = "bt445c", + .flags = DEVICE_VLB, + .local = CHIP_BUSLOGIC_VLB_445C_1994_12_01, + .init = buslogic_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = BT_ISA_Config }; const device_t buslogic_958d_pci_device = { - "BusLogic BT-958D PCI", - "bt958d", - DEVICE_PCI, - CHIP_BUSLOGIC_PCI_958D_1995_12_30, - buslogic_init, x54x_close, NULL, - { NULL }, NULL, NULL, - BT958D_Config + .name = "BusLogic BT-958D PCI", + .internal_name = "bt958d", + .flags = DEVICE_PCI, + .local = CHIP_BUSLOGIC_PCI_958D_1995_12_30, + .init = buslogic_init, + .close = x54x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = BT958D_Config }; diff --git a/src/scsi/scsi_ncr5380.c b/src/scsi/scsi_ncr5380.c index 083efabe4..1fa91f8c7 100644 --- a/src/scsi/scsi_ncr5380.c +++ b/src/scsi/scsi_ncr5380.c @@ -1707,62 +1707,72 @@ static const device_config_t t128_config[] = { }; // clang-format on -const device_t scsi_lcs6821n_device = -{ - "Longshine LCS-6821N", - "lcs6821n", - DEVICE_ISA, - 0, - ncr_init, ncr_close, NULL, - { lcs6821n_available }, - NULL, NULL, - ncr5380_mmio_config +const device_t scsi_lcs6821n_device = { + .name = "Longshine LCS-6821N", + .internal_name = "lcs6821n", + .flags = DEVICE_ISA, + .local = 0, + .init = ncr_init, + .close = ncr_close, + .reset = NULL, + { .available = lcs6821n_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ncr5380_mmio_config }; -const device_t scsi_rt1000b_device = -{ - "Rancho RT1000B", - "rt1000b", - DEVICE_ISA, - 1, - ncr_init, ncr_close, NULL, - { rt1000b_available }, - NULL, NULL, - rancho_config +const device_t scsi_rt1000b_device = { + .name = "Rancho RT1000B", + .internal_name = "rt1000b", + .flags = DEVICE_ISA, + .local = 1, + .init = ncr_init, + .close = ncr_close, + .reset = NULL, + { .available = rt1000b_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = rancho_config }; -const device_t scsi_t130b_device = -{ - "Trantor T130B", - "t130b", - DEVICE_ISA, - 2, - ncr_init, ncr_close, NULL, - { t130b_available }, - NULL, NULL, - t130b_config +const device_t scsi_t130b_device = { + .name = "Trantor T130B", + .internal_name = "t130b", + .flags = DEVICE_ISA, + .local = 2, + .init = ncr_init, + .close = ncr_close, + .reset = NULL, + { .available = t130b_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = t130b_config }; -const device_t scsi_t128_device = -{ - "Trantor T128", - "t128", - DEVICE_ISA, - 3, - ncr_init, ncr_close, NULL, - { t128_available }, - NULL, NULL, - t128_config +const device_t scsi_t128_device = { + .name = "Trantor T128", + .internal_name = "t128", + .flags = DEVICE_ISA, + .local = 3, + .init = ncr_init, + .close = ncr_close, + .reset = NULL, + { .available = t128_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = t128_config }; -const device_t scsi_ls2000_device = -{ - "Corel LS2000", - "ls2000", - DEVICE_ISA, - 4, - ncr_init, ncr_close, NULL, - { corel_ls2000_available }, - NULL, NULL, - ncr5380_mmio_config +const device_t scsi_ls2000_device = { + .name = "Corel LS2000", + .internal_name = "ls2000", + .flags = DEVICE_ISA, + .local = 4, + .init = ncr_init, + .close = ncr_close, + .reset = NULL, + { .available = corel_ls2000_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ncr5380_mmio_config }; diff --git a/src/scsi/scsi_ncr53c8xx.c b/src/scsi/scsi_ncr53c8xx.c index 12439e4ee..f438a342c 100644 --- a/src/scsi/scsi_ncr53c8xx.c +++ b/src/scsi/scsi_ncr53c8xx.c @@ -2648,80 +2648,100 @@ static const device_config_t ncr53c8xx_pci_config[] = { // clang-format on }; - -const device_t ncr53c810_pci_device = -{ - "NCR 53c810", - "ncr53c810", - DEVICE_PCI, - CHIP_810, - ncr53c8xx_init, ncr53c8xx_close, NULL, - { NULL }, NULL, NULL, - NULL +const device_t ncr53c810_pci_device = { + .name = "NCR 53c810", + .internal_name = "ncr53c810", + .flags = DEVICE_PCI, + .local = CHIP_810, + .init = ncr53c8xx_init, + .close = ncr53c8xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t ncr53c810_onboard_pci_device = -{ - "NCR 53c810 On-Board", - "ncr53c810_onboard", - DEVICE_PCI, - 0x8001, - ncr53c8xx_init, ncr53c8xx_close, NULL, - { NULL }, NULL, NULL, - NULL +const device_t ncr53c810_onboard_pci_device = { + .name = "NCR 53c810 On-Board", + .internal_name = "ncr53c810_onboard", + .flags = DEVICE_PCI, + .local = 0x8001, + .init = ncr53c8xx_init, + .close = ncr53c8xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t ncr53c815_pci_device = -{ - "NCR 53c815", - "ncr53c815", - DEVICE_PCI, - CHIP_815, - ncr53c8xx_init, ncr53c8xx_close, NULL, - { NULL }, NULL, NULL, +const device_t ncr53c815_pci_device = { + .name = "NCR 53c815", + .internal_name = "ncr53c815", + .flags = DEVICE_PCI, + .local = CHIP_815, + .init = ncr53c8xx_init, + .close = ncr53c8xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, ncr53c8xx_pci_config }; -const device_t ncr53c820_pci_device = -{ - "NCR 53c820", - "ncr53c820", - DEVICE_PCI, - CHIP_820, - ncr53c8xx_init, ncr53c8xx_close, NULL, - { NULL }, NULL, NULL, - NULL +const device_t ncr53c820_pci_device = { + .name = "NCR 53c820", + .internal_name = "ncr53c820", + .flags = DEVICE_PCI, + .local = CHIP_820, + .init = ncr53c8xx_init, + .close = ncr53c8xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; -const device_t ncr53c825a_pci_device = -{ - "NCR 53c825A", - "ncr53c825a", - DEVICE_PCI, - CHIP_825, - ncr53c8xx_init, ncr53c8xx_close, NULL, - { NULL }, NULL, NULL, - ncr53c8xx_pci_config +const device_t ncr53c825a_pci_device = { + .name = "NCR 53c825A", + .internal_name = "ncr53c825a", + .flags = DEVICE_PCI, + .local = CHIP_825, + .init = ncr53c8xx_init, + .close = ncr53c8xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ncr53c8xx_pci_config }; -const device_t ncr53c860_pci_device = -{ - "NCR 53c860", - "ncr53c860", - DEVICE_PCI, - CHIP_860, - ncr53c8xx_init, ncr53c8xx_close, NULL, - { NULL }, NULL, NULL, - ncr53c8xx_pci_config +const device_t ncr53c860_pci_device = { + .name = "NCR 53c860", + .internal_name = "ncr53c860", + .flags = DEVICE_PCI, + .local = CHIP_860, + .init = ncr53c8xx_init, + .close = ncr53c8xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ncr53c8xx_pci_config }; -const device_t ncr53c875_pci_device = -{ - "NCR 53c875", - "ncr53c875", - DEVICE_PCI, - CHIP_875, - ncr53c8xx_init, ncr53c8xx_close, NULL, - { NULL }, NULL, NULL, - ncr53c8xx_pci_config +const device_t ncr53c875_pci_device = { + .name = "NCR 53c875", + .internal_name = "ncr53c875", + .flags = DEVICE_PCI, + .local = CHIP_875, + .init = ncr53c8xx_init, + .close = ncr53c8xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ncr53c8xx_pci_config }; diff --git a/src/scsi/scsi_pcscsi.c b/src/scsi/scsi_pcscsi.c index aff95074e..74011b21b 100644 --- a/src/scsi/scsi_pcscsi.c +++ b/src/scsi/scsi_pcscsi.c @@ -2010,24 +2010,30 @@ static const device_config_t bios_enable_config[] = { // clang-format on }; -const device_t dc390_pci_device = -{ - "Tekram DC-390 PCI", - "dc390", - DEVICE_PCI, - 0, - dc390_init, esp_close, NULL, - { NULL }, NULL, NULL, - bios_enable_config +const device_t dc390_pci_device = { + .name = "Tekram DC-390 PCI", + .internal_name = "dc390", + .flags = DEVICE_PCI, + .local = 0, + .init = dc390_init, + .close = esp_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = bios_enable_config }; -const device_t ncr53c90_mca_device = -{ - "NCR 53c90 MCA", - "ncr53c90", - DEVICE_MCA, - 0, - ncr53c90_mca_init, esp_close, NULL, - { NULL }, NULL, NULL, - NULL +const device_t ncr53c90_mca_device = { + .name = "NCR 53c90 MCA", + .internal_name = "ncr53c90", + .flags = DEVICE_MCA, + .local = 0, + .init = ncr53c90_mca_init, + .close = esp_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/scsi/scsi_spock.c b/src/scsi/scsi_spock.c index 32ce2a812..f00782983 100644 --- a/src/scsi/scsi_spock.c +++ b/src/scsi/scsi_spock.c @@ -1170,14 +1170,16 @@ static const device_config_t spock_rom_config[] = { // clang-format on }; -const device_t spock_device = -{ - "IBM PS/2 SCSI Adapter (Spock)", - "spock", - DEVICE_MCA, - 0, - spock_init, spock_close, NULL, - { spock_available }, - NULL, NULL, - spock_rom_config +const device_t spock_device = { + .name = "IBM PS/2 SCSI Adapter (Spock)", + .internal_name = "spock", + .flags = DEVICE_MCA, + .local = 0, + .init = spock_init, + .close = spock_close, + .reset = NULL, + { .available = spock_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = spock_rom_config }; From a61379eaee2cdaa1a17f278aa3d9cd9e8e02e9df Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:57:57 -0400 Subject: [PATCH 15/25] src/sio --- src/sio/sio_82091aa.c | 57 ++++++++------ src/sio/sio_acc3221.c | 18 +++-- src/sio/sio_detect.c | 18 +++-- src/sio/sio_f82c710.c | 37 +++++---- src/sio/sio_fdc37c669.c | 37 +++++---- src/sio/sio_fdc37c67x.c | 18 +++-- src/sio/sio_fdc37c6xx.c | 163 ++++++++++++++++++++++++---------------- src/sio/sio_fdc37c93x.c | 91 +++++++++++++--------- src/sio/sio_fdc37m60x.c | 45 ++++++----- src/sio/sio_it8661f.c | 23 +++--- src/sio/sio_pc87306.c | 19 +++-- src/sio/sio_pc87307.c | 76 +++++++++++-------- src/sio/sio_pc87309.c | 38 ++++++---- src/sio/sio_pc87310.c | 37 +++++---- src/sio/sio_pc87311.c | 46 ++++++------ src/sio/sio_pc87332.c | 95 +++++++++++++---------- src/sio/sio_prime3b.c | 46 ++++++------ src/sio/sio_prime3c.c | 46 ++++++------ src/sio/sio_um8669f.c | 18 +++-- src/sio/sio_vt82c686.c | 18 +++-- src/sio/sio_w83787f.c | 73 +++++++++++------- src/sio/sio_w83877f.c | 76 +++++++++++-------- src/sio/sio_w83977f.c | 95 +++++++++++++---------- 23 files changed, 688 insertions(+), 502 deletions(-) diff --git a/src/sio/sio_82091aa.c b/src/sio/sio_82091aa.c index f08f686ed..e385bcd2d 100644 --- a/src/sio/sio_82091aa.c +++ b/src/sio/sio_82091aa.c @@ -275,35 +275,44 @@ i82091aa_init(const device_t *info) return dev; } - const device_t i82091aa_device = { - "Intel 82091AA Super I/O", - "i82091aa", - 0, - 0x40, - i82091aa_init, i82091aa_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Intel 82091AA Super I/O", + .internal_name = "i82091aa", + .flags = 0, + .local = 0x40, + .init = i82091aa_init, + .close = i82091aa_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t i82091aa_398_device = { - "Intel 82091AA Super I/O (Port 398h)", - "i82091aa_398", - 0, - 0x148, - i82091aa_init, i82091aa_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Intel 82091AA Super I/O (Port 398h)", + .internal_name = "i82091aa_398", + .flags = 0, + .local = 0x148, + .init = i82091aa_init, + .close = i82091aa_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t i82091aa_ide_device = { - "Intel 82091AA Super I/O (With IDE)", - "i82091aa_ide", - 0, - 0x240, - i82091aa_init, i82091aa_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Intel 82091AA Super I/O (With IDE)", + .internal_name = "i82091aa_ide", + .flags = 0, + .local = 0x240, + .init = i82091aa_init, + .close = i82091aa_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_acc3221.c b/src/sio/sio_acc3221.c index 31a62896f..313bbbd1a 100644 --- a/src/sio/sio_acc3221.c +++ b/src/sio/sio_acc3221.c @@ -476,11 +476,15 @@ acc3221_init(const device_t *info) const device_t acc3221_device = { - "ACC 3221-SP Super I/O", - "acc3221", - 0, - 0, - acc3221_init, acc3221_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "ACC 3221-SP Super I/O", + .internal_name = "acc3221", + .flags = 0, + .local = 0, + .init = acc3221_init, + .close = acc3221_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_detect.c b/src/sio/sio_detect.c index 9ac0240d1..2e3302179 100644 --- a/src/sio/sio_detect.c +++ b/src/sio/sio_detect.c @@ -108,11 +108,15 @@ sio_detect_init(const device_t *info) const device_t sio_detect_device = { - "Super I/O Detection Helper", - "sio_detect", - 0, - 0, - sio_detect_init, sio_detect_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Super I/O Detection Helper", + .internal_name = "sio_detect", + .flags = 0, + .local = 0, + .init = sio_detect_init, + .close = sio_detect_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_f82c710.c b/src/sio/sio_f82c710.c index aaa00c004..fadbc76e2 100644 --- a/src/sio/sio_f82c710.c +++ b/src/sio/sio_f82c710.c @@ -340,23 +340,30 @@ f82c710_init(const device_t *info) return dev; } - const device_t f82c606_device = { - "82C606 CHIPSpak Multifunction Controller", - "f82c606", - 0, - 606, - f82c710_init, f82c710_close, f82c710_reset, - { NULL }, NULL, NULL, - NULL + .name = "82C606 CHIPSpak Multifunction Controller", + .internal_name = "f82c606", + .flags = 0, + .local = 606, + .init = f82c710_init, + .close = f82c710_close, + .reset = f82c710_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t f82c710_device = { - "F82C710 UPC Super I/O", - "f82c710", - 0, - 710, - f82c710_init, f82c710_close, f82c710_reset, - { NULL }, NULL, NULL, - NULL + .name = "F82C710 UPC Super I/O", + .internal_name = "f82c710", + .flags = 0, + .local = 710, + .init = f82c710_init, + .close = f82c710_close, + .reset = f82c710_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_fdc37c669.c b/src/sio/sio_fdc37c669.c index e0d46d7f0..caa92fad5 100644 --- a/src/sio/sio_fdc37c669.c +++ b/src/sio/sio_fdc37c669.c @@ -326,24 +326,31 @@ fdc37c669_init(const device_t *info) return dev; } - const device_t fdc37c669_device = { - "SMC FDC37C669 Super I/O", - "fdc37c669", - 0, - 0, - fdc37c669_init, fdc37c669_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C669 Super I/O", + .internal_name = "fdc37c669", + .flags = 0, + .local = 0, + .init = fdc37c669_init, + .close = fdc37c669_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c669_370_device = { - "SMC FDC37C669 Super I/O (Port 370h)", - "fdc37c669_370", - 0, - 1, - fdc37c669_init, fdc37c669_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C669 Super I/O (Port 370h)", + .internal_name = "fdc37c669_370", + .flags = 0, + .local = 1, + fdc37c669_init, + fdc37c669_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_fdc37c67x.c b/src/sio/sio_fdc37c67x.c index 36b03d12f..098ffbb44 100644 --- a/src/sio/sio_fdc37c67x.c +++ b/src/sio/sio_fdc37c67x.c @@ -604,11 +604,15 @@ fdc37c67x_init(const device_t *info) const device_t fdc37c67x_device = { - "SMC FDC37C67X Super I/O", - "fdc37c67x", - 0, - 0x40, - fdc37c67x_init, fdc37c67x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C67X Super I/O", + .internal_name = "fdc37c67x", + .flags = 0, + .local = 0x40, + .init = fdc37c67x_init, + .close = fdc37c67x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_fdc37c6xx.c b/src/sio/sio_fdc37c6xx.c index 2757bb97d..15949c81c 100644 --- a/src/sio/sio_fdc37c6xx.c +++ b/src/sio/sio_fdc37c6xx.c @@ -333,95 +333,130 @@ fdc37c6xx_init(const device_t *info) return dev; } - /* The three appear to differ only in the chip ID, if I understood their datasheets correctly. */ const device_t fdc37c651_device = { - "SMC FDC37C651 Super I/O", - "fdc37c651", - 0, - 0x51, - fdc37c6xx_init, fdc37c6xx_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C651 Super I/O", + .internal_name = "fdc37c651", + .flags = 0, + .local = 0x51, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c651_ide_device = { - "SMC FDC37C651 Super I/O (With IDE)", - "fdc37c651_ide", - 0, - 0x151, - fdc37c6xx_init, fdc37c6xx_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C651 Super I/O (With IDE)", + .internal_name = "fdc37c651_ide", + .flags = 0, + .local = 0x151, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c661_device = { - "SMC FDC37C661 Super I/O", - "fdc37c661", - 0, - 0x61, - fdc37c6xx_init, fdc37c6xx_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C661 Super I/O", + .internal_name = "fdc37c661", + .flags = 0, + .local = 0x61, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c661_ide_device = { - "SMC FDC37C661 Super I/O (With IDE)", - "fdc37c661_ide", - 0, - 0x161, - fdc37c6xx_init, fdc37c6xx_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C661 Super I/O (With IDE)", + .internal_name = "fdc37c661_ide", + .flags = 0, + .local = 0x161, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c663_device = { - "SMC FDC37C663 Super I/O", - "fdc37c663", - 0, - 0x63, - fdc37c6xx_init, fdc37c6xx_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C663 Super I/O", + .internal_name = "fdc37c663", + .flags = 0, + .local = 0x63, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c663_ide_device = { - "SMC FDC37C663 Super I/O (With IDE)", - "fdc37c663_ide", - 0, - 0x163, - fdc37c6xx_init, fdc37c6xx_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C663 Super I/O (With IDE)", + .internal_name = "fdc37c663_ide", + .flags = 0, + .local = 0x163, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c665_device = { - "SMC FDC37C665 Super I/O", - "fdc37c665", - 0, - 0x65, - fdc37c6xx_init, fdc37c6xx_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C665 Super I/O", + .internal_name = "fdc37c665", + .flags = 0, + .local = 0x65, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c665_ide_device = { - "SMC FDC37C665 Super I/O (With IDE)", - "fdc37c665_ide", - 0, - 0x265, - fdc37c6xx_init, fdc37c6xx_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C665 Super I/O (With IDE)", + .internal_name = "fdc37c665_ide", + .flags = 0, + .local = 0x265, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c666_device = { - "SMC FDC37C666 Super I/O", - "fdc37c666", - 0, - 0x66, - fdc37c6xx_init, fdc37c6xx_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C666 Super I/O", + .internal_name = "fdc37c666", + .flags = 0, + .local = 0x66, + .init = fdc37c6xx_init, + .close = fdc37c6xx_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_fdc37c93x.c b/src/sio/sio_fdc37c93x.c index 0530c1dd0..b9e9ef767 100644 --- a/src/sio/sio_fdc37c93x.c +++ b/src/sio/sio_fdc37c93x.c @@ -884,53 +884,72 @@ fdc37c93x_init(const device_t *info) return dev; } - const device_t fdc37c931apm_device = { - "SMC FDC37C932QF Super I/O", - "fdc37c931apm", - 0, - 0x130, /* Share the same ID with the 932QF. */ - fdc37c93x_init, fdc37c93x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C932QF Super I/O", + .internal_name = "fdc37c931apm", + .flags = 0, + .local = 0x130, /* Share the same ID with the 932QF. */ + .init = fdc37c93x_init, + .close = fdc37c93x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c931apm_compaq_device = { - "SMC FDC37C932QF Super I/O (Compaq Presario 4500)", - "fdc37c931apm_compaq", - 0, - 0x330, /* Share the same ID with the 932QF. */ - fdc37c93x_init, fdc37c93x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C932QF Super I/O (Compaq Presario 4500)", + .internal_name = "fdc37c931apm_compaq", + .flags = 0, + .local = 0x330, /* Share the same ID with the 932QF. */ + .init = fdc37c93x_init, + .close = fdc37c93x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c932fr_device = { - "SMC FDC37C932FR Super I/O", - "fdc37c932fr", - 0, - 0x03, - fdc37c93x_init, fdc37c93x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C932FR Super I/O", + .internal_name = "fdc37c932fr", + .flags = 0, + .local = 0x03, + .init = fdc37c93x_init, + .close = fdc37c93x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c932qf_device = { - "SMC FDC37C932QF Super I/O", - "fdc37c932qf", - 0, - 0x30, - fdc37c93x_init, fdc37c93x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C932QF Super I/O", + .internal_name = "fdc37c932qf", + .flags = 0, + .local = 0x30, + .init = fdc37c93x_init, + .close = fdc37c93x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37c935_device = { - "SMC FDC37C935 Super I/O", - "fdc37c935", - 0, - 0x02, - fdc37c93x_init, fdc37c93x_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "SMC FDC37C935 Super I/O", + .internal_name = "fdc37c935", + .flags = 0, + .local = 0x02, + .init = fdc37c93x_init, + .close = fdc37c93x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_fdc37m60x.c b/src/sio/sio_fdc37m60x.c index fc54ec157..a4433e582 100644 --- a/src/sio/sio_fdc37m60x.c +++ b/src/sio/sio_fdc37m60x.c @@ -314,31 +314,30 @@ fdc37m60x_init(const device_t *info) return dev; } - const device_t fdc37m60x_device = { - "SMSC FDC37M60X", - "fdc37m60x", - 0, - FDC_PRIMARY_ADDR, - fdc37m60x_init, - fdc37m60x_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "SMSC FDC37M60X", + .internal_name = "fdc37m60x", + .flags = 0, + .local = FDC_PRIMARY_ADDR, + .init = fdc37m60x_init, + .close = fdc37m60x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t fdc37m60x_370_device = { - "SMSC FDC37M60X with 10K Pull Up Resistor", - "fdc37m60x_370", - 0, - FDC_SECONDARY_ADDR, - fdc37m60x_init, - fdc37m60x_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "SMSC FDC37M60X with 10K Pull Up Resistor", + .internal_name = "fdc37m60x_370", + .flags = 0, + .local = FDC_SECONDARY_ADDR, + .init = fdc37m60x_init, + .close = fdc37m60x_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_it8661f.c b/src/sio/sio_it8661f.c index 529e6f0a9..31109df91 100644 --- a/src/sio/sio_it8661f.c +++ b/src/sio/sio_it8661f.c @@ -335,17 +335,16 @@ it8661f_init(const device_t *info) return dev; } - const device_t it8661f_device = { - "ITE IT8661F", - "it8661f", - 0, - 0, - it8661f_init, - it8661f_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "ITE IT8661F", + .internal_name = "it8661f", + .flags = 0, + .local = 0, + .init = it8661f_init, + .close = it8661f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_pc87306.c b/src/sio/sio_pc87306.c index ce768112a..5037768fd 100644 --- a/src/sio/sio_pc87306.c +++ b/src/sio/sio_pc87306.c @@ -418,13 +418,16 @@ pc87306_init(const device_t *info) return dev; } - const device_t pc87306_device = { - "National Semiconductor PC87306 Super I/O", - "pc87306", - 0, - 0, - pc87306_init, pc87306_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87306 Super I/O", + .internal_name = "pc87306", + .flags = 0, + .local = 0, + .init = pc87306_init, + .close = pc87306_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_pc87307.c b/src/sio/sio_pc87307.c index 24432c670..91dd1f59d 100644 --- a/src/sio/sio_pc87307.c +++ b/src/sio/sio_pc87307.c @@ -590,46 +590,58 @@ pc87307_init(const device_t *info) return dev; } - const device_t pc87307_device = { - "National Semiconductor PC87307 Super I/O", - "pc87307", - 0, - 0x1c0, - pc87307_init, pc87307_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87307 Super I/O", + .internal_name = "pc87307", + .flags = 0, + .local = 0x1c0, + .init = pc87307_init, + .close = pc87307_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t pc87307_15c_device = { - "National Semiconductor PC87307 Super I/O (Port 15Ch)", - "pc87307_15c", - 0, - 0x2c0, - pc87307_init, pc87307_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87307 Super I/O (Port 15Ch)", + .internal_name = "pc87307_15c", + .flags = 0, + .local = 0x2c0, + .init = pc87307_init, + .close = pc87307_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t pc87307_both_device = { - "National Semiconductor PC87307 Super I/O (Ports 2Eh and 15Ch)", - "pc87307_both", - 0, - 0x3c0, - pc87307_init, pc87307_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87307 Super I/O (Ports 2Eh and 15Ch)", + .internal_name = "pc87307_both", + .flags = 0, + .local = 0x3c0, + .init = pc87307_init, + .close = pc87307_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t pc97307_device = { - "National Semiconductor PC97307 Super I/O", - "pc97307", - 0, - 0x1cf, - pc87307_init, pc87307_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC97307 Super I/O", + .internal_name = "pc97307", + .flags = 0, + .local = 0x1cf, + .init = pc87307_init, + .close = pc87307_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_pc87309.c b/src/sio/sio_pc87309.c index ad214ff6a..bf261a26f 100644 --- a/src/sio/sio_pc87309.c +++ b/src/sio/sio_pc87309.c @@ -471,24 +471,30 @@ pc87309_init(const device_t *info) return dev; } - const device_t pc87309_device = { - "National Semiconductor PC87309 Super I/O", - "pc87309", - 0, - 0xe0, - pc87309_init, pc87309_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87309 Super I/O", + .internal_name = "pc87309", + .flags = 0, + .local = 0xe0, + .init = pc87309_init, + .close = pc87309_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t pc87309_15c_device = { - "National Semiconductor PC87309 Super I/O (Port 15Ch)", - "pc87309_15c", - 0, - 0x1e0, - pc87309_init, pc87309_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87309 Super I/O (Port 15Ch)", + .internal_name = "pc87309_15c", + .flags = 0, + .local = 0x1e0, + .init = pc87309_init, + .close = pc87309_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_pc87310.c b/src/sio/sio_pc87310.c index d753e4c57..7817fee9d 100644 --- a/src/sio/sio_pc87310.c +++ b/src/sio/sio_pc87310.c @@ -263,23 +263,30 @@ pc87310_init(const device_t *info) return dev; } - const device_t pc87310_device = { - "National Semiconductor PC87310 Super I/O", - "pc87310", - 0, - 0, - pc87310_init, pc87310_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87310 Super I/O", + .internal_name = "pc87310", + .flags = 0, + .local = 0, + .init = pc87310_init, + .close = pc87310_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t pc87310_ide_device = { - "National Semiconductor PC87310 Super I/O with IDE functionality", - "pc87310_ide", - 0, - 1, - pc87310_init, pc87310_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87310 Super I/O with IDE functionality", + .internal_name = "pc87310_ide", + .flags = 0, + .local = 1, + .init = pc87310_init, + .close = pc87310_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_pc87311.c b/src/sio/sio_pc87311.c index be845b316..f52b065df 100644 --- a/src/sio/sio_pc87311.c +++ b/src/sio/sio_pc87311.c @@ -273,27 +273,29 @@ pc87311_init(const device_t *info) } const device_t pc87311_device = { - "National Semiconductor PC87311", - "pc87311", - 0, - 0, - pc87311_init, - pc87311_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "National Semiconductor PC87311", + .internal_name = "pc87311", + .flags = 0, + .local = 0, + .init = pc87311_init, + .close = pc87311_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; const device_t pc87311_ide_device = { - "National Semiconductor PC87311 with IDE functionality", - "pc87311_ide", - 0, - 1, - pc87311_init, - pc87311_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "National Semiconductor PC87311 with IDE functionality", + .internal_name = "pc87311_ide", + .flags = 0, + .local = 1, + .init = pc87311_init, + .close = pc87311_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/sio/sio_pc87332.c b/src/sio/sio_pc87332.c index 06df40669..a2fd7f0d3 100644 --- a/src/sio/sio_pc87332.c +++ b/src/sio/sio_pc87332.c @@ -335,57 +335,72 @@ pc87332_init(const device_t *info) return dev; } - const device_t pc87332_device = { - "National Semiconductor PC87332 Super I/O", - "pc87332", - 0, - 0x00, - pc87332_init, pc87332_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87332 Super I/O", + .internal_name = "pc87332", + .flags = 0, + .local = 0x00, + .init = pc87332_init, + .close = pc87332_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t pc87332_398_device = { - "National Semiconductor PC87332 Super I/O (Port 398h)", - "pc87332_398", - 0, - 0x01, - pc87332_init, pc87332_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87332 Super I/O (Port 398h)", + .internal_name = "pc87332_398", + .flags = 0, + .local = 0x01, + .init = pc87332_init, + .close = pc87332_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t pc87332_398_ide_device = { - "National Semiconductor PC87332 Super I/O (Port 398h) (With IDE)", - "pc87332_398_ide", - 0, - 0x101, - pc87332_init, pc87332_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87332 Super I/O (Port 398h) (With IDE)", + .internal_name = "pc87332_398_ide", + .flags = 0, + .local = 0x101, + .init = pc87332_init, + .close = pc87332_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t pc87332_398_ide_sec_device = { - "National Semiconductor PC87332 Super I/O (Port 398h) (With Secondary IDE)", - "pc87332_398_ide_sec", - 0, - 0x201, - pc87332_init, pc87332_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87332 Super I/O (Port 398h) (With Secondary IDE)", + .internal_name = "pc87332_398_ide_sec", + .flags = 0, + .local = 0x201, + .init = pc87332_init, + .close = pc87332_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t pc87332_398_ide_fdcon_device = { - "National Semiconductor PC87332 Super I/O (Port 398h) (With IDE and FDC on)", - "pc87332_398_ide_fdcon", - 0, - 0x10101, - pc87332_init, pc87332_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "National Semiconductor PC87332 Super I/O (Port 398h) (With IDE and FDC on)", + .internal_name = "pc87332_398_ide_fdcon", + .flags = 0, + .local = 0x10101, + .init = pc87332_init, + .close = pc87332_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_prime3b.c b/src/sio/sio_prime3b.c index ec3b74a5c..ac00106d3 100644 --- a/src/sio/sio_prime3b.c +++ b/src/sio/sio_prime3b.c @@ -269,27 +269,29 @@ prime3b_init(const device_t *info) } const device_t prime3b_device = { - "Goldstar Prime3B", - "prime3b", - 0, - 0, - prime3b_init, - prime3b_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "Goldstar Prime3B", + .internal_name = "prime3b", + .flags = 0, + .local = 0, + .init = prime3b_init, + .close = prime3b_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; const device_t prime3b_ide_device = { - "Goldstar Prime3B with IDE functionality", - "prime3b_ide", - 0, - 1, - prime3b_init, - prime3b_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "Goldstar Prime3B with IDE functionality", + .internal_name = "prime3b_ide", + .flags = 0, + .local = 1, + .init = prime3b_init, + .close = prime3b_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/sio/sio_prime3c.c b/src/sio/sio_prime3c.c index 1b4bde5d4..ec350ece2 100644 --- a/src/sio/sio_prime3c.c +++ b/src/sio/sio_prime3c.c @@ -318,27 +318,29 @@ prime3c_init(const device_t *info) } const device_t prime3c_device = { - "Goldstar Prime3C", - "prime3c", - 0, - 0, - prime3c_init, - prime3c_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "Goldstar Prime3C", + .internal_name = "prime3c", + .flags = 0, + .local = 0, + .init = prime3c_init, + .close = prime3c_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; const device_t prime3c_ide_device = { - "Goldstar Prime3C with IDE functionality", - "prime3c_ide", - 0, - 1, - prime3c_init, - prime3c_close, - NULL, - {NULL}, - NULL, - NULL, - NULL}; + .name = "Goldstar Prime3C with IDE functionality", + .internal_name = "prime3c_ide", + .flags = 0, + .local = 1, + .init = prime3c_init, + .close = prime3c_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/sio/sio_um8669f.c b/src/sio/sio_um8669f.c index dc9fa5209..aece09fe6 100644 --- a/src/sio/sio_um8669f.c +++ b/src/sio/sio_um8669f.c @@ -302,11 +302,15 @@ um8669f_init(const device_t *info) const device_t um8669f_device = { - "UMC UM8669F Super I/O", - "um8669f", - 0, - 0, - um8669f_init, um8669f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "UMC UM8669F Super I/O", + .internal_name = "um8669f", + .flags = 0, + .local = 0, + .init = um8669f_init, + .close = um8669f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_vt82c686.c b/src/sio/sio_vt82c686.c index 40ba7c356..8d242165e 100644 --- a/src/sio/sio_vt82c686.c +++ b/src/sio/sio_vt82c686.c @@ -303,11 +303,15 @@ vt82c686_init(const device_t *info) const device_t via_vt82c686_sio_device = { - "VIA VT82C686 Integrated Super I/O", - "via_vt82c686_sio", - 0, - 0, - vt82c686_init, vt82c686_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "VIA VT82C686 Integrated Super I/O", + .internal_name = "via_vt82c686_sio", + .flags = 0, + .local = 0, + .init = vt82c686_init, + .close = vt82c686_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_w83787f.c b/src/sio/sio_w83787f.c index 9bd6c86c0..fe48f5d79 100644 --- a/src/sio/sio_w83787f.c +++ b/src/sio/sio_w83787f.c @@ -444,43 +444,58 @@ w83787f_init(const device_t *info) return dev; } - const device_t w83787f_device = { - "Winbond W83787F/IF Super I/O", - "w83787f", - 0, - 0x09, - w83787f_init, w83787f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83787F/IF Super I/O", + .internal_name = "w83787f", + .flags = 0, + .local = 0x09, + .init = w83787f_init, + .close = w83787f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t w83787f_ide_device = { - "Winbond W83787F/IF Super I/O (With IDE)", - "w83787f_ide", - 0, - 0x19, - w83787f_init, w83787f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83787F/IF Super I/O (With IDE)", + .internal_name = "w83787f_ide", + .flags = 0, + .local = 0x19, + .init = w83787f_init, + .close = w83787f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t w83787f_ide_en_device = { - "Winbond W83787F/IF Super I/O (With IDE Enabled)", - "w83787f_ide_en", - 0, - 0x59, - w83787f_init, w83787f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83787F/IF Super I/O (With IDE Enabled)", + .internal_name = "w83787f_ide_en", + .flags = 0, + .local = 0x59, + .init = w83787f_init, + .close = w83787f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t w83787f_ide_sec_device = { - "Winbond W83787F/IF Super I/O (With Secondary IDE)", - "w83787f_ide_sec", - 0, - 0x39, - w83787f_init, w83787f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83787F/IF Super I/O (With Secondary IDE)", + .internal_name = "w83787f_ide_sec", + .flags = 0, + .local = 0x39, + .init = w83787f_init, + .close = w83787f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_w83877f.c b/src/sio/sio_w83877f.c index fc0c64c3c..424414e01 100644 --- a/src/sio/sio_w83877f.c +++ b/src/sio/sio_w83877f.c @@ -459,46 +459,58 @@ w83877f_init(const device_t *info) return dev; } - const device_t w83877f_device = { - "Winbond W83877F Super I/O", - "w83877f", - 0, - 0x0a05, - w83877f_init, w83877f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83877F Super I/O", + .internal_name = "w83877f", + .flags = 0, + .local = 0x0a05, + .init = w83877f_init, + .close = w83877f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t w83877f_president_device = { - "Winbond W83877F Super I/O (President)", - "w83877f_president", - 0, - 0x0a04, - w83877f_init, w83877f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83877F Super I/O (President)", + .internal_name = "w83877f_president", + .flags = 0, + .local = 0x0a04, + .init = w83877f_init, + .close = w83877f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t w83877tf_device = { - "Winbond W83877TF Super I/O", - "w83877tf", - 0, - 0x0c04, - w83877f_init, w83877f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83877TF Super I/O", + .internal_name = "w83877tf", + .flags = 0, + .local = 0x0c04, + .init = w83877f_init, + .close = w83877f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t w83877tf_acorp_device = { - "Winbond W83877TF Super I/O", - "w83877tf_acorp", - 0, - 0x0c05, - w83877f_init, w83877f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83877TF Super I/O", + .internal_name = "w83877tf_acorp", + .flags = 0, + .local = 0x0c05, + .init = w83877f_init, + .close = w83877f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sio/sio_w83977f.c b/src/sio/sio_w83977f.c index 6320d64c3..370bb8c68 100644 --- a/src/sio/sio_w83977f.c +++ b/src/sio/sio_w83977f.c @@ -566,57 +566,72 @@ w83977f_init(const device_t *info) return dev; } - const device_t w83977f_device = { - "Winbond W83977F Super I/O", - "w83977f", - 0, - 0, - w83977f_init, w83977f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83977F Super I/O", + .internal_name = "w83977f", + .flags = 0, + .local = 0, + .init = w83977f_init, + .close = w83977f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t w83977f_370_device = { - "Winbond W83977F Super I/O (Port 370h)", - "w83977f_370", - 0, - 0x40, - w83977f_init, w83977f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83977F Super I/O (Port 370h)", + .internal_name = "w83977f_370", + .flags = 0, + .local = 0x40, + .init = w83977f_init, + .close = w83977f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t w83977tf_device = { - "Winbond W83977TF Super I/O", - "w83977tf", - 0, - 1, - w83977f_init, w83977f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83977TF Super I/O", + .internal_name = "w83977tf", + .flags = 0, + .local = 1, + .init = w83977f_init, + .close = w83977f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t w83977ef_device = { - "Winbond W83977TF Super I/O", - "w83977ef", - 0, - 2, - w83977f_init, w83977f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83977TF Super I/O", + .internal_name = "w83977ef", + .flags = 0, + .local = 2, + .init = w83977f_init, + .close = w83977f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; - const device_t w83977ef_370_device = { - "Winbond W83977TF Super I/O (Port 370h)", - "w83977ef_370", - 0, - 0x42, - w83977f_init, w83977f_close, NULL, - { NULL }, NULL, NULL, - NULL + .name = "Winbond W83977TF Super I/O (Port 370h)", + .internal_name = "w83977ef_370", + .flags = 0, + .local = 0x42, + .init = w83977f_init, + .close = w83977f_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; From 0d9161016d04912ea41314bf83e71bb67eebdd83 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 09:59:11 -0400 Subject: [PATCH 16/25] Some escaped hardcoding of max devices in fdd.c --- src/floppy/fdd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/floppy/fdd.c b/src/floppy/fdd.c index 0c55471bc..1344c3f02 100644 --- a/src/floppy/fdd.c +++ b/src/floppy/fdd.c @@ -313,7 +313,7 @@ fdd_set_densel(int densel) { int i = 0; - for (i = 0; i < 4; i++) { + for (i = 0; i < FDD_NUM; i++) { if (drive_types[fdd[i].type].flags & FLAG_INVERT_DENSEL) fdd[i].densel = densel ^ 1; else @@ -627,7 +627,7 @@ fdd_reset(void) { int i; - for (i = 0; i < 4; i++) { + for (i = 0; i < FDD_NUM; i++) { drives[i].id = i; timer_add(&(fdd_poll_time[i]), fdd_poll, &drives[i], 0); } @@ -702,7 +702,7 @@ fdd_init(void) { int i; - for (i = 0; i < 4; i++) { + for (i = 0; i < FDD_NUM; i++) { drives[i].poll = 0; drives[i].seek = 0; drives[i].readsector = 0; @@ -714,10 +714,9 @@ fdd_init(void) imd_init(); json_init(); - fdd_load(0, floppyfns[0]); - fdd_load(1, floppyfns[1]); - fdd_load(2, floppyfns[2]); - fdd_load(3, floppyfns[3]); + for (i = 0; i < FDD_NUM; i++) { + fdd_load(i, floppyfns[i]); + } } From c195b348a7376af2de29be2ae9e972fdf12648e3 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 10:03:39 -0400 Subject: [PATCH 17/25] src/sound --- src/sound/midi.c | 44 ++--- src/sound/midi_fluidsynth.c | 22 +-- src/sound/midi_mt32.c | 44 ++--- src/sound/snd_ac97_codec.c | 176 +++++++++--------- src/sound/snd_ac97_via.c | 22 +-- src/sound/snd_adlib.c | 44 ++--- src/sound/snd_adlibgold.c | 22 +-- src/sound/snd_audiopci.c | 44 ++--- src/sound/snd_azt2316a.c | 44 ++--- src/sound/snd_cms.c | 22 +-- src/sound/snd_cs423x.c | 110 +++++------ src/sound/snd_gus.c | 22 +-- src/sound/snd_lpt_dac.c | 36 ++-- src/sound/snd_lpt_dss.c | 18 +- src/sound/snd_mpu401.c | 44 ++--- src/sound/snd_pas16.c | 22 +-- src/sound/snd_ps1.c | 22 +-- src/sound/snd_pssj.c | 64 +++---- src/sound/snd_sb.c | 352 ++++++++++++++++++------------------ src/sound/snd_sn76489.c | 64 +++---- src/sound/snd_ssi2001.c | 22 +-- src/sound/snd_wss.c | 44 ++--- 22 files changed, 654 insertions(+), 650 deletions(-) diff --git a/src/sound/midi.c b/src/sound/midi.c index 085dab873..ae5cdc456 100644 --- a/src/sound/midi.c +++ b/src/sound/midi.c @@ -72,17 +72,17 @@ typedef struct } MIDI_OUT_DEVICE, MIDI_IN_DEVICE; static const device_t midi_out_none_device = { - "None", - "none", - 0, - 0, - NULL, - NULL, - NULL, - { NULL }, - NULL, - NULL, - NULL + .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[] = { @@ -103,17 +103,17 @@ static const MIDI_OUT_DEVICE devices[] = { }; static const device_t midi_in_none_device = { - "None", - "none", - 0, - 0, - NULL, - NULL, - NULL, - { NULL }, - NULL, - NULL, - NULL + .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[] = { diff --git a/src/sound/midi_fluidsynth.c b/src/sound/midi_fluidsynth.c index dd450e856..23635ee1d 100644 --- a/src/sound/midi_fluidsynth.c +++ b/src/sound/midi_fluidsynth.c @@ -540,17 +540,17 @@ static const device_config_t fluidsynth_config[] = { }; const device_t fluidsynth_device = { - "FluidSynth", - "fluidsynth", - 0, - 0, - fluidsynth_init, - fluidsynth_close, - NULL, - { fluidsynth_available }, - NULL, - NULL, - fluidsynth_config + .name = "FluidSynth", + .internal_name = "fluidsynth", + .flags = 0, + .local = 0, + .init = fluidsynth_init, + .close = fluidsynth_close, + .reset = NULL, + { .available = fluidsynth_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = fluidsynth_config }; #endif /*USE_FLUIDSYNTH*/ diff --git a/src/sound/midi_mt32.c b/src/sound/midi_mt32.c index f4a4a493a..5b19aa018 100644 --- a/src/sound/midi_mt32.c +++ b/src/sound/midi_mt32.c @@ -375,29 +375,29 @@ static const device_config_t mt32_config[] = { }; const device_t mt32_device = { - "Roland MT-32 Emulation", - "mt32", - 0, - 0, - mt32_init, - mt32_close, - NULL, - { mt32_available }, - NULL, - NULL, - mt32_config + .name = "Roland MT-32 Emulation", + .internal_name = "mt32", + .flags = 0, + .local = 0, + .init = mt32_init, + .close = mt32_close, + .reset = NULL, + { .available = mt32_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = mt32_config }; const device_t cm32l_device = { - "Roland CM-32L Emulation", - "cm32l", - 0, - 0, - cm32l_init, - mt32_close, - NULL, - { cm32l_available }, - NULL, - NULL, - mt32_config + .name = "Roland CM-32L Emulation", + .internal_name = "cm32l", + .flags = 0, + .local = 0, + .init = cm32l_init, + .close = mt32_close, + .reset = NULL, + { .available = cm32l_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = mt32_config }; diff --git a/src/sound/snd_ac97_codec.c b/src/sound/snd_ac97_codec.c index d59db5656..348989180 100644 --- a/src/sound/snd_ac97_codec.c +++ b/src/sound/snd_ac97_codec.c @@ -641,113 +641,113 @@ ac97_codec_get(int model) } const device_t ad1881_device = { - "Analog Devices AD1881", - "ad1881", - DEVICE_AC97, - AC97_CODEC_AD1881, - ac97_codec_init, - ac97_codec_close, - ac97_codec_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "Analog Devices AD1881", + .internal_name = "ad1881", + .flags = DEVICE_AC97, + .local = AC97_CODEC_AD1881, + .init = ac97_codec_init, + .close = ac97_codec_close, + .reset = ac97_codec_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ak4540_device = { - "Asahi Kasei AK4540", - "ak4540", - DEVICE_AC97, - AC97_CODEC_AK4540, - ac97_codec_init, - ac97_codec_close, - ac97_codec_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "Asahi Kasei AK4540", + .internal_name = "ak4540", + .flags = DEVICE_AC97, + .local = AC97_CODEC_AK4540, + .init = ac97_codec_init, + .close = ac97_codec_close, + .reset = ac97_codec_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t alc100_device = { - "Avance Logic ALC100", - "alc100", - DEVICE_AC97, - AC97_CODEC_ALC100, - ac97_codec_init, - ac97_codec_close, - ac97_codec_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "Avance Logic ALC100", + .internal_name = "alc100", + .flags = DEVICE_AC97, + .local = AC97_CODEC_ALC100, + .init = ac97_codec_init, + .close = ac97_codec_close, + .reset = ac97_codec_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t cs4297_device = { - "Crystal CS4297", - "cs4297", - DEVICE_AC97, - AC97_CODEC_CS4297, - ac97_codec_init, - ac97_codec_close, - ac97_codec_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "Crystal CS4297", + .internal_name = "cs4297", + .flags = DEVICE_AC97, + .local = AC97_CODEC_CS4297, + .init = ac97_codec_init, + .close = ac97_codec_close, + .reset = ac97_codec_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t cs4297a_device = { - "Crystal CS4297A", - "cs4297a", - DEVICE_AC97, - AC97_CODEC_CS4297A, - ac97_codec_init, - ac97_codec_close, - ac97_codec_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "Crystal CS4297A", + .internal_name = "cs4297a", + .flags = DEVICE_AC97, + .local = AC97_CODEC_CS4297A, + .init = ac97_codec_init, + .close = ac97_codec_close, + .reset = ac97_codec_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t stac9708_device = { - "SigmaTel STAC9708", - "stac9708", - DEVICE_AC97, - AC97_CODEC_STAC9708, - ac97_codec_init, - ac97_codec_close, - ac97_codec_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "SigmaTel STAC9708", + .internal_name = "stac9708", + .flags = DEVICE_AC97, + .local = AC97_CODEC_STAC9708, + .init = ac97_codec_init, + .close = ac97_codec_close, + .reset = ac97_codec_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t stac9721_device = { - "SigmaTel STAC9721", - "stac9721", - DEVICE_AC97, - AC97_CODEC_STAC9721, - ac97_codec_init, - ac97_codec_close, - ac97_codec_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "SigmaTel STAC9721", + .internal_name = "stac9721", + .flags = DEVICE_AC97, + .local = AC97_CODEC_STAC9721, + .init = ac97_codec_init, + .close = ac97_codec_close, + .reset = ac97_codec_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t wm9701a_device = { - "Wolfson WM9701A", - "wm9701a", - DEVICE_AC97, - AC97_CODEC_WM9701A, - ac97_codec_init, - ac97_codec_close, - ac97_codec_reset, - { NULL }, - NULL, - NULL, - NULL + .name = "Wolfson WM9701A", + .internal_name = "wm9701a", + .flags = DEVICE_AC97, + .local = AC97_CODEC_WM9701A, + .init = ac97_codec_init, + .close = ac97_codec_close, + .reset = ac97_codec_reset, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sound/snd_ac97_via.c b/src/sound/snd_ac97_via.c index 53afbdf25..b3dbd30d8 100644 --- a/src/sound/snd_ac97_via.c +++ b/src/sound/snd_ac97_via.c @@ -804,15 +804,15 @@ ac97_via_close(void *priv) } const device_t ac97_via_device = { - "VIA VT82C686 Integrated AC97 Controller", - "ac97_via", - DEVICE_PCI, - 0, - ac97_via_init, - ac97_via_close, - NULL, - { NULL }, - ac97_via_speed_changed, - NULL, - NULL + .name = "VIA VT82C686 Integrated AC97 Controller", + .internal_name = "ac97_via", + .flags = DEVICE_PCI, + .local = 0, + .init = ac97_via_init, + .close = ac97_via_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = ac97_via_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sound/snd_adlib.c b/src/sound/snd_adlib.c index f4326f87b..1592131d0 100644 --- a/src/sound/snd_adlib.c +++ b/src/sound/snd_adlib.c @@ -142,29 +142,29 @@ adlib_close(void *p) } const device_t adlib_device = { - "AdLib", - "adlib", - DEVICE_ISA, - 0, - adlib_init, - adlib_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "AdLib", + .internal_name = "adlib", + .flags = DEVICE_ISA, + .local = 0, + .init = adlib_init, + .close = adlib_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t adlib_mca_device = { - "AdLib (MCA)", - "adlib_mca", - DEVICE_MCA, - 0, - adlib_init, - adlib_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "AdLib (MCA)", + .internal_name = "adlib_mca", + .flags = DEVICE_MCA, + .local = 0, + .init = adlib_init, + .close = adlib_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index fc169d5e0..2a82b3b85 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -990,15 +990,15 @@ static const device_config_t adgold_config[] = { }; const device_t adgold_device = { - "AdLib Gold", - "adlibgold", - DEVICE_ISA, - 0, - adgold_init, - adgold_close, - NULL, - { NULL }, - NULL, - NULL, - adgold_config + .name = "AdLib Gold", + .internal_name = "adlibgold", + .flags = DEVICE_ISA, + .local = 0, + .init = adgold_init, + .close = adgold_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = adgold_config }; diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index 23f1fa40c..7dbb1f1f2 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -2088,29 +2088,29 @@ static const device_config_t es1371_config[] = { }; const device_t es1371_device = { - "Ensoniq AudioPCI (ES1371)", - "es1371", - DEVICE_PCI, - 0, - es1371_init, - es1371_close, - es1371_reset, - { NULL }, - es1371_speed_changed, - NULL, - es1371_config + .name = "Ensoniq AudioPCI (ES1371)", + .internal_name = "es1371", + .flags = DEVICE_PCI, + .local = 0, + .init = es1371_init, + .close = es1371_close, + .reset = es1371_reset, + { .available = NULL }, + .speed_changed = es1371_speed_changed, + .force_redraw = NULL, + .config = es1371_config }; const device_t es1371_onboard_device = { - "Ensoniq AudioPCI (ES1371) (On-Board)", - "es1371_onboard", - DEVICE_PCI, - 1, - es1371_init, - es1371_close, - es1371_reset, - { NULL }, - es1371_speed_changed, - NULL, - NULL + .name = "Ensoniq AudioPCI (ES1371) (On-Board)", + .internal_name = "es1371_onboard", + .flags = DEVICE_PCI, + .local = 1, + .init = es1371_init, + .close = es1371_close, + .reset = es1371_reset, + { .available = NULL }, + .speed_changed = es1371_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sound/snd_azt2316a.c b/src/sound/snd_azt2316a.c index 6a842e029..ede159219 100644 --- a/src/sound/snd_azt2316a.c +++ b/src/sound/snd_azt2316a.c @@ -1425,29 +1425,29 @@ static const device_config_t azt2316a_config[] = { }; const device_t azt2316a_device = { - "Aztech Sound Galaxy Pro 16 AB (Washington)", - "azt2316a", - DEVICE_ISA | DEVICE_AT, - SB_SUBTYPE_CLONE_AZT2316A_0X11, - azt_init, - azt_close, - NULL, - { NULL }, - azt_speed_changed, - NULL, - azt2316a_config + .name = "Aztech Sound Galaxy Pro 16 AB (Washington)", + .internal_name = "azt2316a", + .flags = DEVICE_ISA | DEVICE_AT, + .local = SB_SUBTYPE_CLONE_AZT2316A_0X11, + .init = azt_init, + .close = azt_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = azt_speed_changed, + .force_redraw = NULL, + .config = azt2316a_config }; const device_t azt1605_device = { - "Aztech Sound Galaxy Nova 16 Extra (Clinton)", - "azt1605", - DEVICE_ISA | DEVICE_AT, - SB_SUBTYPE_CLONE_AZT1605_0X0C, - azt_init, - azt_close, - NULL, - { NULL }, - azt_speed_changed, - NULL, - azt1605_config + .name = "Aztech Sound Galaxy Nova 16 Extra (Clinton)", + .internal_name = "azt1605", + .flags = DEVICE_ISA | DEVICE_AT, + .local = SB_SUBTYPE_CLONE_AZT1605_0X0C, + .init = azt_init, + .close = azt_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = azt_speed_changed, + .force_redraw = NULL, + .config = azt1605_config }; diff --git a/src/sound/snd_cms.c b/src/sound/snd_cms.c index 308af6351..2be54f4fc 100644 --- a/src/sound/snd_cms.c +++ b/src/sound/snd_cms.c @@ -207,15 +207,15 @@ static const device_config_t cms_config[] = { }; const device_t cms_device = { - "Creative Music System / Game Blaster", - "cms", - DEVICE_ISA, - 0, - cms_init, - cms_close, - NULL, - { NULL }, - NULL, - NULL, - cms_config + .name = "Creative Music System / Game Blaster", + .internal_name = "cms", + .flags = DEVICE_ISA, + .local = 0, + .init = cms_init, + .close = cms_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = cms_config }; diff --git a/src/sound/snd_cs423x.c b/src/sound/snd_cs423x.c index 34d4fb21d..c3c711f91 100644 --- a/src/sound/snd_cs423x.c +++ b/src/sound/snd_cs423x.c @@ -827,71 +827,71 @@ cs423x_speed_changed(void *priv) } const device_t cs4235_device = { - "Crystal CS4235", - "cs4235", - DEVICE_ISA | DEVICE_AT, - CRYSTAL_CS4235, - cs423x_init, - cs423x_close, - cs423x_reset, - { NULL }, - cs423x_speed_changed, - NULL, - NULL + .name = "Crystal CS4235", + .internal_name = "cs4235", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CRYSTAL_CS4235, + .init = cs423x_init, + .close = cs423x_close, + .reset = cs423x_reset, + { .available = NULL }, + .speed_changed = cs423x_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t cs4235_onboard_device = { - "Crystal CS4235 (On-Board)", - "cs4235_onboard", - DEVICE_ISA | DEVICE_AT, - CRYSTAL_CS4235 | CRYSTAL_NOEEPROM, - cs423x_init, - cs423x_close, - cs423x_reset, - { NULL }, - cs423x_speed_changed, - NULL, - NULL + .name = "Crystal CS4235 (On-Board)", + .internal_name = "cs4235_onboard", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CRYSTAL_CS4235 | CRYSTAL_NOEEPROM, + .init = cs423x_init, + .close = cs423x_close, + .reset = cs423x_reset, + { .available = NULL }, + .speed_changed = cs423x_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t cs4236b_device = { - "Crystal CS4236B", - "cs4236b", - DEVICE_ISA | DEVICE_AT, - CRYSTAL_CS4236B, - cs423x_init, - cs423x_close, - cs423x_reset, - { NULL }, - cs423x_speed_changed, - NULL, - NULL + .name = "Crystal CS4236B", + .internal_name = "cs4236b", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CRYSTAL_CS4236B, + .init = cs423x_init, + .close = cs423x_close, + .reset = cs423x_reset, + { .available = NULL }, + .speed_changed = cs423x_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t cs4237b_device = { - "Crystal CS4237B", - "cs4237b", - DEVICE_ISA | DEVICE_AT, - CRYSTAL_CS4237B, - cs423x_init, - cs423x_close, - cs423x_reset, - { NULL }, - cs423x_speed_changed, - NULL, - NULL + .name = "Crystal CS4237B", + .internal_name = "cs4237b", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CRYSTAL_CS4237B, + .init = cs423x_init, + .close = cs423x_close, + .reset = cs423x_reset, + { .available = NULL }, + .speed_changed = cs423x_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t cs4238b_device = { - "Crystal CS4238B", - "cs4238b", - DEVICE_ISA | DEVICE_AT, - CRYSTAL_CS4238B, - cs423x_init, - cs423x_close, - cs423x_reset, - { NULL }, - cs423x_speed_changed, - NULL, - NULL + .name = "Crystal CS4238B", + .internal_name = "cs4238b", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CRYSTAL_CS4238B, + .init = cs423x_init, + .close = cs423x_close, + .reset = cs423x_reset, + { .available = NULL }, + .speed_changed = cs423x_speed_changed, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index 95c006612..a70798555 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -1239,15 +1239,15 @@ static const device_config_t gus_config[] = { }; const device_t gus_device = { - "Gravis UltraSound", - "gus", - DEVICE_ISA | DEVICE_AT, - 0, - gus_init, - gus_close, - NULL, - { NULL }, - gus_speed_changed, - NULL, - gus_config + .name = "Gravis UltraSound", + .internal_name = "gus", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = gus_init, + .close = gus_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = gus_speed_changed, + .force_redraw = NULL, + .config = gus_config }; diff --git a/src/sound/snd_lpt_dac.c b/src/sound/snd_lpt_dac.c index cac610c91..70e02d847 100644 --- a/src/sound/snd_lpt_dac.c +++ b/src/sound/snd_lpt_dac.c @@ -109,25 +109,25 @@ dac_close(void *p) } const lpt_device_t lpt_dac_device = { - "LPT DAC / Covox Speech Thing", - "lpt_dac", - dac_init, - dac_close, - dac_write_data, - dac_write_ctrl, - NULL, - dac_read_status, - NULL + .name = "LPT DAC / Covox Speech Thing", + .internal_name = "lpt_dac", + .init = dac_init, + .close = dac_close, + .write_data = dac_write_data, + .write_ctrl = dac_write_ctrl, + .read_data = NULL, + .read_status = dac_read_status, + .read_ctrl = NULL }; const lpt_device_t lpt_dac_stereo_device = { - "Stereo LPT DAC", - "lpt_dac_stereo", - dac_stereo_init, - dac_close, - dac_write_data, - dac_write_ctrl, - NULL, - dac_read_status, - NULL + .name = "Stereo LPT DAC", + .internal_name = "lpt_dac_stereo", + .init = dac_stereo_init, + .close = dac_close, + .write_data = dac_write_data, + .write_ctrl = dac_write_ctrl, + .read_data = NULL, + .read_status = dac_read_status, + .read_ctrl = NULL }; diff --git a/src/sound/snd_lpt_dss.c b/src/sound/snd_lpt_dss.c index caf98b20b..a855425b2 100644 --- a/src/sound/snd_lpt_dss.c +++ b/src/sound/snd_lpt_dss.c @@ -132,13 +132,13 @@ dss_close(void *p) } const lpt_device_t dss_device = { - "Disney Sound Source", - "dss", - dss_init, - dss_close, - dss_write_data, - dss_write_ctrl, - NULL, - dss_read_status, - NULL + .name = "Disney Sound Source", + .internal_name = "dss", + .init = dss_init, + .close = dss_close, + .write_data = dss_write_data, + .write_ctrl = dss_write_ctrl, + .read_data = NULL, + .read_status = dss_read_status, + .read_ctrl = NULL }; diff --git a/src/sound/snd_mpu401.c b/src/sound/snd_mpu401.c index fe686c875..c2cfa4caa 100644 --- a/src/sound/snd_mpu401.c +++ b/src/sound/snd_mpu401.c @@ -1857,29 +1857,29 @@ static const device_config_t mpu401_standalone_mca_config[] = { }; const device_t mpu401_device = { - "Roland MPU-IPC-T", - "mpu401", - DEVICE_ISA, - 0, - mpu401_standalone_init, - mpu401_standalone_close, - NULL, - { NULL }, - NULL, - NULL, - mpu401_standalone_config + .name = "Roland MPU-IPC-T", + .internal_name = "mpu401", + .flags = DEVICE_ISA, + .local = 0, + .init = mpu401_standalone_init, + .close = mpu401_standalone_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = mpu401_standalone_config }; const device_t mpu401_mca_device = { - "Roland MPU-IMC", - "mpu401_mca", - DEVICE_MCA, - 0, - mpu401_standalone_init, - mpu401_standalone_close, - NULL, - { NULL }, - NULL, - NULL, - mpu401_standalone_mca_config + .name = "Roland MPU-IMC", + .internal_name = "mpu401_mca", + .flags = DEVICE_MCA, + .local = 0, + .init = mpu401_standalone_init, + .close = mpu401_standalone_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = mpu401_standalone_mca_config }; diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index 12afc3740..33bd51b34 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -743,15 +743,15 @@ pas16_close(void *p) } const device_t pas16_device = { - "Pro Audio Spectrum 16", - "pas16", - DEVICE_ISA | DEVICE_NOT_WORKING, - 0, - pas16_init, - pas16_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "Pro Audio Spectrum 16", + .internal_name = "pas16", + .flags = DEVICE_ISA | DEVICE_NOT_WORKING, + .local = 0, + .init = pas16_init, + .close = pas16_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sound/snd_ps1.c b/src/sound/snd_ps1.c index ff778dfbf..308d01589 100644 --- a/src/sound/snd_ps1.c +++ b/src/sound/snd_ps1.c @@ -187,15 +187,15 @@ ps1snd_close(void *priv) } const device_t ps1snd_device = { - "IBM PS/1 Audio Card", - "ps1snd", - 0, - 0, - ps1snd_init, - ps1snd_close, - NULL, - { NULL }, - NULL, - NULL, - NULL + .name = "IBM PS/1 Audio Card", + .internal_name = "ps1snd", + .flags = 0, + .local = 0, + .init = ps1snd_init, + .close = ps1snd_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 9bf1c47f5..2929baec1 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -253,43 +253,45 @@ static const device_config_t pssj_isa_config[] = { #endif const device_t pssj_device = { - "Tandy PSSJ", - "pssj", - 0, - 0, - pssj_init, - pssj_close, - NULL, - { NULL }, - NULL, - NULL + .name = "Tandy PSSJ", + .internal_name = "pssj", + .flags = 0, + .local = 0, + .init = pssj_init, + .close = pssj_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t pssj_1e0_device = { - "Tandy PSSJ (port 1e0h)", - "pssj_1e0", - 0, - 0, - pssj_1e0_init, - pssj_close, - NULL, - { NULL }, - NULL, - NULL + .name = "Tandy PSSJ (port 1e0h)", + .internal_name = "pssj_1e0", + .flags = 0, + .local = 0, + .init = pssj_1e0_init, + .close = pssj_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; #if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) const device_t pssj_isa_device = { - "Tandy PSSJ Clone", - "pssj_isa", - DEVICE_ISA, - 0, - pssj_isa_init, - pssj_close, - NULL, - { NULL }, - NULL, - NULL, - pssj_isa_config + .name = "Tandy PSSJ Clone", + .internal_name = "pssj_isa", + .flags = DEVICE_ISA, + .local = 0, + .init = pssj_isa_init, + .close = pssj_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pssj_isa_config }; #endif diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index fcf59788d..27c1c168c 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -2394,225 +2394,225 @@ static const device_config_t sb_awe64_gold_config[] = { // clang-format on const device_t sb_1_device = { - "Sound Blaster v1.0", - "sb", - DEVICE_ISA, - 0, - sb_1_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - sb_config + .name = "Sound Blaster v1.0", + .internal_name = "sb", + .flags = DEVICE_ISA, + .local = 0, + .init = sb_1_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_config }; const device_t sb_15_device = { - "Sound Blaster v1.5", - "sb1.5", - DEVICE_ISA, - 0, - sb_15_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - sb15_config + .name = "Sound Blaster v1.5", + .internal_name = "sb1.5", + .flags = DEVICE_ISA, + .local = 0, + .init = sb_15_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb15_config }; const device_t sb_mcv_device = { - "Sound Blaster MCV", - "sbmcv", - DEVICE_MCA, - 0, - sb_mcv_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - sb_mcv_config + .name = "Sound Blaster MCV", + .internal_name = "sbmcv", + .flags = DEVICE_MCA, + .local = 0, + .init = sb_mcv_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_mcv_config }; const device_t sb_2_device = { - "Sound Blaster v2.0", - "sb2.0", - DEVICE_ISA, - 0, - sb_2_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - sb2_config + .name = "Sound Blaster v2.0", + .internal_name = "sb2.0", + .flags = DEVICE_ISA, + .local = 0, + .init = sb_2_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb2_config }; const device_t sb_pro_v1_device = { - "Sound Blaster Pro v1", - "sbprov1", - DEVICE_ISA, - 0, - sb_pro_v1_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - sb_pro_config + .name = "Sound Blaster Pro v1", + .internal_name = "sbprov1", + .flags = DEVICE_ISA, + .local = 0, + .init = sb_pro_v1_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_pro_config }; const device_t sb_pro_v2_device = { - "Sound Blaster Pro v2", - "sbprov2", - DEVICE_ISA, - 0, - sb_pro_v2_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - sb_pro_config + .name = "Sound Blaster Pro v2", + .internal_name = "sbprov2", + .flags = DEVICE_ISA, + .local = 0, + .init = sb_pro_v2_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_pro_config }; const device_t sb_pro_mcv_device = { - "Sound Blaster Pro MCV", - "sbpromcv", - DEVICE_MCA, - 0, - sb_pro_mcv_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - NULL + .name = "Sound Blaster Pro MCV", + .internal_name = "sbpromcv", + .flags = DEVICE_MCA, + .local = 0, + .init = sb_pro_mcv_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t sb_pro_compat_device = { - "Sound Blaster Pro (Compatibility)", - "sbpro_compat", - DEVICE_ISA | DEVICE_AT, - 0, - sb_pro_compat_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - NULL + .name = "Sound Blaster Pro (Compatibility)", + .internal_name = "sbpro_compat", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = sb_pro_compat_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = NULL }; const device_t sb_16_device = { - "Sound Blaster 16", - "sb16", - DEVICE_ISA | DEVICE_AT, - 0, - sb_16_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - sb_16_config + .name = "Sound Blaster 16", + .internal_name = "sb16", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = sb_16_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_16_config }; const device_t sb_16_pnp_device = { - "Sound Blaster 16 PnP", - "sb16_pnp", - DEVICE_ISA | DEVICE_AT, - 0, - sb_16_pnp_init, - sb_close, - NULL, - { NULL }, - sb_speed_changed, - NULL, - sb_16_pnp_config + .name = "Sound Blaster 16 PnP", + .internal_name = "sb16_pnp", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = sb_16_pnp_init, + .close = sb_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_16_pnp_config }; const device_t sb_32_pnp_device = { - "Sound Blaster 32 PnP", - "sb32_pnp", - DEVICE_ISA | DEVICE_AT, - 0, - sb_awe32_pnp_init, - sb_awe32_close, - NULL, - { sb_32_pnp_available }, - sb_speed_changed, - NULL, - sb_32_pnp_config + .name = "Sound Blaster 32 PnP", + .internal_name = "sb32_pnp", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = sb_awe32_pnp_init, + .close = sb_awe32_close, + .reset = NULL, + { .available = sb_32_pnp_available }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_32_pnp_config }; const device_t sb_awe32_device = { - "Sound Blaster AWE32", - "sbawe32", - DEVICE_ISA | DEVICE_AT, - 0, - sb_awe32_init, - sb_awe32_close, - NULL, - { sb_awe32_available }, - sb_speed_changed, - NULL, - sb_awe32_config + .name = "Sound Blaster AWE32", + .internal_name = "sbawe32", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = sb_awe32_init, + .close = sb_awe32_close, + .reset = NULL, + { .available = sb_awe32_available }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_awe32_config }; const device_t sb_awe32_pnp_device = { - "Sound Blaster AWE32 PnP", - "sbawe32_pnp", - DEVICE_ISA | DEVICE_AT, - 1, - sb_awe32_pnp_init, - sb_awe32_close, - NULL, - { sb_awe32_pnp_available }, - sb_speed_changed, - NULL, - sb_awe32_pnp_config + .name = "Sound Blaster AWE32 PnP", + .internal_name = "sbawe32_pnp", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 1, + .init = sb_awe32_pnp_init, + .close = sb_awe32_close, + .reset = NULL, + { .available = sb_awe32_pnp_available }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_awe32_pnp_config }; const device_t sb_awe64_value_device = { - "Sound Blaster AWE64 Value", - "sbawe64_value", - DEVICE_ISA | DEVICE_AT, - 2, - sb_awe32_pnp_init, - sb_awe32_close, - NULL, - { sb_awe64_value_available }, - sb_speed_changed, - NULL, - sb_awe64_value_config + .name = "Sound Blaster AWE64 Value", + .internal_name = "sbawe64_value", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 2, + .init = sb_awe32_pnp_init, + .close = sb_awe32_close, + .reset = NULL, + { .available = sb_awe64_value_available }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_awe64_value_config }; const device_t sb_awe64_device = { - "Sound Blaster AWE64", - "sbawe64", - DEVICE_ISA | DEVICE_AT, - 3, - sb_awe32_pnp_init, - sb_awe32_close, - NULL, - { sb_awe64_available }, - sb_speed_changed, - NULL, - sb_awe64_config + .name = "Sound Blaster AWE64", + .internal_name = "sbawe64", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 3, + .init = sb_awe32_pnp_init, + .close = sb_awe32_close, + .reset = NULL, + { .available = sb_awe64_available }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_awe64_config }; const device_t sb_awe64_gold_device = { - "Sound Blaster AWE64 Gold", - "sbawe64_gold", - DEVICE_ISA | DEVICE_AT, - 4, - sb_awe32_pnp_init, - sb_awe32_close, - NULL, - { sb_awe64_gold_available }, - sb_speed_changed, - NULL, - sb_awe64_gold_config + .name = "Sound Blaster AWE64 Gold", + .internal_name = "sbawe64_gold", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 4, + .init = sb_awe32_pnp_init, + .close = sb_awe32_close, + .reset = NULL, + { .available = sb_awe64_gold_available }, + .speed_changed = sb_speed_changed, + .force_redraw = NULL, + .config = sb_awe64_gold_config }; diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index 96b152b18..ad2581b33 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -261,43 +261,45 @@ static const device_config_t tndy_config[] = { #endif const device_t sn76489_device = { - "TI SN74689 PSG", - "sn76489", - 0, - 0, - sn76489_device_init, - sn76489_device_close, - NULL, - { NULL }, - NULL, - NULL + .name = "TI SN74689 PSG", + .internal_name = "sn76489", + .flags = 0, + .local = 0, + .init = sn76489_device_init, + .close = sn76489_device_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; const device_t ncr8496_device = { - "NCR8496 PSG", - "ncr8496", - 0, - 0, - ncr8496_device_init, - sn76489_device_close, - NULL, - { NULL }, - NULL, - NULL + .name = "NCR8496 PSG", + .internal_name = "ncr8496", + .flags = 0, + .local = 0, + .init = ncr8496_device_init, + .close = sn76489_device_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL }; #if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) const device_t tndy_device = { - "TNDY", - "tndy", - DEVICE_ISA, - 0, - tndy_device_init, - sn76489_device_close, - NULL, - { NULL }, - NULL, - NULL, - tndy_config + .name = "TNDY", + .internal_name = "tndy", + .flags = DEVICE_ISA, + .local = 0, + .init = tndy_device_init, + .close = sn76489_device_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = tndy_config }; #endif diff --git a/src/sound/snd_ssi2001.c b/src/sound/snd_ssi2001.c index cfbdf8d49..127968d96 100644 --- a/src/sound/snd_ssi2001.c +++ b/src/sound/snd_ssi2001.c @@ -108,15 +108,15 @@ static const device_config_t ssi2001_config[] = { const device_t ssi2001_device = { - "Innovation SSI-2001", - "ssi2001", - DEVICE_ISA, - 0, - ssi2001_init, - ssi2001_close, - NULL, - { NULL }, - NULL, - NULL, - ssi2001_config + .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 }; diff --git a/src/sound/snd_wss.c b/src/sound/snd_wss.c index 7428d22d6..aafb7cbeb 100644 --- a/src/sound/snd_wss.c +++ b/src/sound/snd_wss.c @@ -243,29 +243,29 @@ static const device_config_t wss_config[] = { }; const device_t wss_device = { - "Windows Sound System", - "wss", - DEVICE_ISA | DEVICE_AT, - 0, - wss_init, - wss_close, - NULL, - { NULL }, - wss_speed_changed, - NULL, - wss_config + .name = "Windows Sound System", + .internal_name = "wss", + .flags = DEVICE_ISA | DEVICE_AT, + .local = 0, + .init = wss_init, + .close = wss_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = wss_speed_changed, + .force_redraw = NULL, + .config = wss_config }; const device_t ncr_business_audio_device = { - "NCR Business Audio", - "ncraudio", - DEVICE_MCA, - 0, - ncr_audio_init, - wss_close, - NULL, - { NULL }, - wss_speed_changed, - NULL, - NULL + .name = "NCR Business Audio", + .internal_name = "ncraudio", + .flags = DEVICE_MCA, + .local = 0, + .init = ncr_audio_init, + .close = wss_close, + .reset = NULL, + { .available = NULL }, + .speed_changed = wss_speed_changed, + .force_redraw = NULL, + .config = NULL }; From e54d136e3b907b3933c54578ee1a415a5d69bcc2 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 10:21:21 -0400 Subject: [PATCH 18/25] Add WD1004 series of XT HDD controllers --- src/disk/hdc.c | 3 + src/disk/hdc_st506_xt.c | 175 ++++++++++++++++++++++++++++++++++++++++ src/include/86box/hdc.h | 3 + 3 files changed, 181 insertions(+) diff --git a/src/disk/hdc.c b/src/disk/hdc.c index 9fd3a2fab..90d46a815 100644 --- a/src/disk/hdc.c +++ b/src/disk/hdc.c @@ -112,9 +112,12 @@ static const struct { { &st506_xt_dtc5150x_device }, { &st506_xt_st11_m_device }, { &st506_xt_wd1002a_wx1_device }, + { &st506_xt_wd1004a_wx1_device }, { &st506_at_wd1003_device }, { &st506_xt_st11_r_device }, { &st506_xt_wd1002a_27x_device }, + { &st506_xt_wd1004_27x_device }, + { &st506_xt_wd1004a_27x_device }, { &esdi_at_wd1007vse1_device }, { &ide_isa_device }, { &ide_isa_2ch_device }, diff --git a/src/disk/hdc_st506_xt.c b/src/disk/hdc_st506_xt.c index 10e3c3731..4a4bb3395 100644 --- a/src/disk/hdc_st506_xt.c +++ b/src/disk/hdc_st506_xt.c @@ -96,10 +96,13 @@ #define ST11_BIOS_FILE_OLD "roms/hdd/st506/st11_bios_vers_1.7.bin" #define ST11_BIOS_FILE_NEW "roms/hdd/st506/st11_bios_vers_2.0.bin" #define WD1002A_WX1_BIOS_FILE "roms/hdd/st506/wd1002a_wx1-62-000094-032.bin" +#define WD1004A_WX1_BIOS_FILE "roms/hdd/st506/wd1002a_wx1-62-000094-032.bin" /* SuperBIOS was for both the WX1 and 27X, users jumpers readout to determine if to use 26 sectors per track, 26 -> 17 sectors per track translation, or 17 sectors per track. */ #define WD1002A_27X_BIOS_FILE "roms/hdd/st506/wd1002a_27x-62-000094-032.bin" +#define WD1004_27X_BIOS_FILE "roms/hdd/st506/western_digital_WD1004A-27X.bin" +#define WD1004A_27X_BIOS_FILE "roms/hdd/st506/western_digital_WD1004A-27X.bin" #define ST506_TIME (250 * TIMER_USEC) @@ -1614,6 +1617,24 @@ wd1002a_27x_available(void) return(rom_present(WD1002A_27X_BIOS_FILE)); } +static int +wd1004a_wx1_available(void) +{ + return(rom_present(WD1004A_WX1_BIOS_FILE)); +} + +static int +wd1004_27x_available(void) +{ + return(rom_present(WD1004_27X_BIOS_FILE)); +} + +static int +wd1004a_27x_available(void) +{ + return(rom_present(WD1004A_27X_BIOS_FILE)); +} + // clang-format off static const device_config_t dtc_config[] = { { @@ -1734,6 +1755,118 @@ static const device_config_t wd_rll_config[] = { }, { "", "", -1 } }; + +static const device_config_t wd1004a_config[] = { + { + .name = "bios_addr", + .description = "BIOS address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xc8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "" } + } + }, + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0320, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "320H", .value = 0x0320 }, + { .description = "324H", .value = 0x0324 }, + { .description = "" } + } + }, + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "" } + } + }, + { .name = "", .description = "", .type = -1 } +}; + +static const device_config_t wd1004_rll_config[] = { + { + .name = "bios_addr", + .description = "BIOS address", + .type = CONFIG_HEX20, + .default_string = "", + .default_int = 0xc8000, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Disabled", .value = 0x00000 }, + { .description = "C800H", .value = 0xc8000 }, + { .description = "CA00H", .value = 0xca000 }, + { .description = "CC00H", .value = 0xcc000 }, + { .description = "CE00H", .value = 0xce000 }, + { .description = "" } + } + }, + { + .name = "base", + .description = "Address", + .type = CONFIG_HEX16, + .default_string = "", + .default_int = 0x0320, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "320H", .value = 0x0320 }, + { .description = "324H", .value = 0x0324 }, + { .description = "328H", .value = 0x0328 }, + { .description = "32CH", .value = 0x032c }, + { .description = "" } + } + }, + { + .name = "irq", + .description = "IRQ", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 5, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "IRQ 2", .value = 2 }, + { .description = "IRQ 5", .value = 5 }, + { .description = "" } + } + }, + { + .name = "translate", + .description = "Translate 26 -> 17", + .type = CONFIG_SELECTION, + .default_string = "", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .selection = { + { .description = "Off", .value = 0 }, + { .description = "On", .value = 1 }, + { .description = "" } + } + }, + { .name = "", .description = "", .type = -1 } +}; + // clang-format on const device_t st506_xt_xebec_device = { @@ -1819,3 +1952,45 @@ const device_t st506_xt_wd1002a_27x_device = { .force_redraw = NULL, .config = wd_rll_config }; + +const device_t st506_xt_wd1004a_wx1_device = { + .name = "WD1004A-WX1 MFM Fixed Disk Adapter", + .internal_name = "st506_xt_wd1004a_wx1", + .flags = DEVICE_ISA, + .local = (HDD_BUS_MFM << 8) | 21, + .init = st506_init, + .close = st506_close, + .reset = NULL, + { wd1004a_wx1_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = wd1004a_config +}; + +const device_t st506_xt_wd1004_27x_device = { + .name = "WD1004-27X RLL Fixed Disk Adapter", + .internal_name = "st506_xt_wd1004_27x", + .flags = DEVICE_ISA, + .local = (HDD_BUS_MFM << 8) | 22, + .init = st506_init, + .close = st506_close, + .reset = NULL, + { .available = wd1004_27x_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = wd1004_rll_config +}; + +const device_t st506_xt_wd1004a_27x_device = { + .name = "WD1004a-27X RLL Fixed Disk Adapter", + .internal_name = "st506_xt_wd1004a_27x", + .flags = DEVICE_ISA, + .local = (HDD_BUS_MFM << 8) | 22, + .init = st506_init, + .close = st506_close, + .reset = NULL, + { .available = wd1004a_27x_available }, + .speed_changed = NULL, + .force_redraw = NULL, + .config = wd_rll_config +}; diff --git a/src/include/86box/hdc.h b/src/include/86box/hdc.h index 1008b38c9..3f8426dea 100644 --- a/src/include/86box/hdc.h +++ b/src/include/86box/hdc.h @@ -39,6 +39,9 @@ extern const device_t st506_xt_st11_r_device; /* st506_xt_st11_m */ extern const device_t st506_xt_wd1002a_wx1_device; /* st506_xt_wd1002a_wx1 */ extern const device_t st506_xt_wd1002a_27x_device; /* st506_xt_wd1002a_27x */ extern const device_t st506_at_wd1003_device; /* st506_at_wd1003 */ +extern const device_t st506_xt_wd1004a_wx1_device; /* st506_xt_wd1004a_wx1 */ +extern const device_t st506_xt_wd1004_27x_device; /* st506_xt_wd1004_27x */ +extern const device_t st506_xt_wd1004a_27x_device; /* st506_xt_wd1004a_27x */ extern const device_t esdi_at_wd1007vse1_device; /* esdi_at */ extern const device_t esdi_ps2_device; /* esdi_mca */ From fc513595790fd64969b136aebb08220463b4c8e1 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 17:15:54 -0400 Subject: [PATCH 19/25] Fix warnings in gameport.c --- src/game/gameport.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/game/gameport.c b/src/game/gameport.c index 04fb01de5..478d355f7 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -402,20 +402,24 @@ static void * tmacm_init(const device_t *info) { uint16_t port = 0x0000; + gameport_t *dev = NULL; + + dev = malloc(sizeof(gameport_t)); + memset(dev, 0x00, sizeof(gameport_t)); port = device_get_config_hex16("port1_addr"); switch(port) { case 0x201: - gameport_add(&gameport_201_device); + dev = gameport_add(&gameport_201_device); break; case 0x203: - gameport_add(&gameport_203_device); + dev = gameport_add(&gameport_203_device); break; case 0x205: - gameport_add(&gameport_205_device); + dev = gameport_add(&gameport_205_device); break; case 0x207: - gameport_add(&gameport_207_device); + dev = gameport_add(&gameport_207_device); break; default: break; @@ -424,16 +428,16 @@ tmacm_init(const device_t *info) port = device_get_config_hex16("port2_addr"); switch(port) { case 0x201: - gameport_add(&gameport_209_device); + dev = gameport_add(&gameport_209_device); break; case 0x203: - gameport_add(&gameport_20b_device); + dev = gameport_add(&gameport_20b_device); break; case 0x205: - gameport_add(&gameport_20d_device); + dev = gameport_add(&gameport_20d_device); break; case 0x207: - gameport_add(&gameport_20f_device); + dev = gameport_add(&gameport_20f_device); break; default: break; From 591ff2c2c512e8f10f399333a895b78acca75346 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 17:16:11 -0400 Subject: [PATCH 20/25] Fix null dereference in lpt.c --- src/lpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lpt.c b/src/lpt.c index b6c639d6b..d5666e457 100644 --- a/src/lpt.c +++ b/src/lpt.c @@ -1,3 +1,4 @@ +/* Copyright holders: Sarah Walker /* Copyright holders: Sarah Walker see COPYING for more details */ @@ -87,7 +88,7 @@ lpt_devices_init(void) for (i = 0; i < PARALLEL_MAX; i++) { lpt_ports[i].dt = (lpt_device_t *) lpt_devices[lpt_ports[i].device].device; - if (lpt_ports[i].dt) + if (lpt_ports[i].dt && lpt_ports[i].dt->init) lpt_ports[i].priv = lpt_ports[i].dt->init(&lpt_ports[i]); } } From 27a2631069c907ae85d57e70a98a3b5c2ef6659b Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 17:16:28 -0400 Subject: [PATCH 21/25] correct function calls in openal.c --- src/sound/openal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sound/openal.c b/src/sound/openal.c index a570e070d..5b1128cb6 100644 --- a/src/sound/openal.c +++ b/src/sound/openal.c @@ -124,7 +124,7 @@ inital(void) alutInit(0, 0); atexit(closeal); - mdn = midi_device_get_internal_name(midi_device_current); + mdn = midi_out_device_get_internal_name(midi_output_device_current); if (strcmp(mdn, "none") && strcmp(mdn, SYSTEM_MIDI_INTERNAL_NAME)) init_midi = 1; /* If the device is neither none, nor system MIDI, initialize the MIDI buffer and source, otherwise, do not. */ From 8cbbf151b7865548685c4fa02e2720ad033b3047 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 17:22:57 -0400 Subject: [PATCH 22/25] yet another null dereference in lpt.c --- src/lpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lpt.c b/src/lpt.c index d5666e457..30cf6c418 100644 --- a/src/lpt.c +++ b/src/lpt.c @@ -103,7 +103,7 @@ lpt_devices_close(void) for (i = 0; i < PARALLEL_MAX; i++) { dev = &lpt_ports[i]; - if (dev->dt) + if (lpt_ports[i].dt && lpt_ports[i].dt->init) dev->dt->close(dev->priv); dev->dt = NULL; From 3b380424093d674de1687fa8c299d2f33e4d547c Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 17:25:17 -0400 Subject: [PATCH 23/25] Fix the fix --- src/lpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lpt.c b/src/lpt.c index 30cf6c418..dd1b4ed6a 100644 --- a/src/lpt.c +++ b/src/lpt.c @@ -103,7 +103,7 @@ lpt_devices_close(void) for (i = 0; i < PARALLEL_MAX; i++) { dev = &lpt_ports[i]; - if (lpt_ports[i].dt && lpt_ports[i].dt->init) + if (lpt_ports[i].dt && lpt_ports[i].dt->close) dev->dt->close(dev->priv); dev->dt = NULL; From fdd1070b2cf8b397a18c8ec8280e236980787e32 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 17:37:11 -0400 Subject: [PATCH 24/25] Fix missing return --- src/game/gameport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/game/gameport.c b/src/game/gameport.c index 478d355f7..20ea51ffa 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -442,6 +442,8 @@ tmacm_init(const device_t *info) default: break; } + + return dev; } static void From f7e91c4e2cc0bce395daef794b2cd6604d288efa Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 13 Mar 2022 17:42:18 -0400 Subject: [PATCH 25/25] Fix header screwup in lpt.c --- src/lpt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lpt.c b/src/lpt.c index dd1b4ed6a..df8276ae1 100644 --- a/src/lpt.c +++ b/src/lpt.c @@ -1,4 +1,3 @@ -/* Copyright holders: Sarah Walker /* Copyright holders: Sarah Walker see COPYING for more details */