This commit is contained in:
OBattler
2024-07-21 04:54:11 +02:00
50 changed files with 408 additions and 516 deletions

View File

@@ -179,7 +179,7 @@ int postcard_enabled = 0; /* (C) enable
int unittester_enabled = 0; /* (C) enable unit tester device */
int isamem_type[ISAMEM_MAX] = { 0, 0, 0, 0 }; /* (C) enable ISA mem cards */
int isartc_type = 0; /* (C) enable ISA RTC card */
int gfxcard[2] = { 0, 0 }; /* (C) graphics/video card */
int gfxcard[GFXCARD_MAX] = { 0, 0 }; /* (C) graphics/video card */
int show_second_monitors = 1; /* (C) show non-primary monitors */
int sound_is_float = 1; /* (C) sound uses FP values */
int voodoo_enabled = 0; /* (C) video option */
@@ -1004,12 +1004,15 @@ pc_init_modules(void)
}
}
if (!video_card_available(gfxcard[1])) {
char tempc[512] = { 0 };
device_get_name(video_card_getdevice(gfxcard[1]), 0, tempc);
swprintf(temp, sizeof_w(temp), plat_get_string(STRING_HW_NOT_AVAILABLE_VIDEO2), tempc);
ui_msgbox_header(MBX_INFO, plat_get_string(STRING_HW_NOT_AVAILABLE_TITLE), temp);
gfxcard[1] = 0;
// TODO
for (uint8_t i = 1; i < GFXCARD_MAX; i ++) {
if (!video_card_available(gfxcard[i])) {
char tempc[512] = { 0 };
device_get_name(video_card_getdevice(gfxcard[i]), 0, tempc);
swprintf(temp, sizeof_w(temp), plat_get_string(STRING_HW_NOT_AVAILABLE_VIDEO2), tempc);
ui_msgbox_header(MBX_INFO, plat_get_string(STRING_HW_NOT_AVAILABLE_TITLE), temp);
gfxcard[i] = 0;
}
}
atfullspeed = 0;

View File

@@ -459,10 +459,13 @@ load_video(void)
show_second_monitors = !!ini_section_get_int(cat, "show_second_monitors", 1);
video_fullscreen_scale_maximized = !!ini_section_get_int(cat, "video_fullscreen_scale_maximized", 0);
p = ini_section_get_string(cat, "gfxcard_2", NULL);
if (!p)
p = "none";
gfxcard[1] = video_get_video_from_internal_name(p);
// TODO
for (uint8_t i = 1; i < GFXCARD_MAX; i ++) {
p = ini_section_get_string(cat, "gfxcard_2", NULL);
if (!p)
p = "none";
gfxcard[i] = video_get_video_from_internal_name(p);
}
}
/* Load "Input Devices" section. */
@@ -789,9 +792,9 @@ load_storage_controllers(void)
p = ini_section_get_string(cat, "fdc", NULL);
#if 1
if (p != NULL)
fdc_type = fdc_card_get_from_internal_name(p);
fdc_current[0] = fdc_card_get_from_internal_name(p);
else
fdc_type = FDC_INTERNAL;
fdc_current[0] = FDC_INTERNAL;
#else
if (p == NULL) {
if (machine_has_flags(machine, MACHINE_FDC)) {
@@ -804,7 +807,7 @@ load_storage_controllers(void)
free_p = 1;
}
fdc_type = fdc_card_get_from_internal_name(p);
fdc_current[0] = fdc_card_get_from_internal_name(p);
if (free_p) {
free(p);
@@ -826,15 +829,15 @@ load_storage_controllers(void)
}
/* Migrate renamed and merged cards. */
if (!strcmp(p, "xtide_plus")) {
hdc_current = hdc_get_from_internal_name("xtide");
hdc_current[0] = hdc_get_from_internal_name("xtide");
migration_cat = ini_find_or_create_section(config, "PC/XT XTIDE");
ini_section_set_string(migration_cat, "bios", "xt_plus");
} else if (!strcmp(p, "xtide_at_386")) {
hdc_current = hdc_get_from_internal_name("xtide_at");
hdc_current[0] = hdc_get_from_internal_name("xtide_at");
migration_cat = ini_find_or_create_section(config, "PC/AT XTIDE");
ini_section_set_string(migration_cat, "bios", "at_386");
} else
hdc_current = hdc_get_from_internal_name(p);
hdc_current[0] = hdc_get_from_internal_name(p);
if (free_p) {
free(p);
@@ -1628,7 +1631,7 @@ config_load(void)
video_fullscreen_first = 1;
video_fullscreen_scale = 1;
time_sync = TIME_SYNC_ENABLED;
hdc_current = hdc_get_from_internal_name("none");
hdc_current[0] = hdc_get_from_internal_name("none");
com_ports[0].enabled = 1;
com_ports[1].enabled = 1;
@@ -2010,10 +2013,13 @@ save_video(void)
else
ini_section_set_int(cat, "xga", xga_standalone_enabled);
if (gfxcard[1] == 0)
ini_section_delete_var(cat, "gfxcard_2");
else
ini_section_set_string(cat, "gfxcard_2", video_get_internal_name(gfxcard[1]));
// TODO
for (uint8_t i = 1; i < GFXCARD_MAX; i ++) {
if (gfxcard[i] == 0)
ini_section_delete_var(cat, "gfxcard_2");
else
ini_section_set_string(cat, "gfxcard_2", video_get_internal_name(gfxcard[i]));
}
if (show_second_monitors == 1)
ini_section_delete_var(cat, "show_second_monitors");
@@ -2290,14 +2296,14 @@ save_storage_controllers(void)
scsi_card_get_internal_name(scsi_card_current[c]));
}
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
ini_section_delete_var(cat, "fdc");
else
ini_section_set_string(cat, "fdc",
fdc_card_get_internal_name(fdc_type));
fdc_card_get_internal_name(fdc_current[0]));
ini_section_set_string(cat, "hdc",
hdc_get_internal_name(hdc_current));
hdc_get_internal_name(hdc_current[0]));
if (cdrom_interface_current == 0)
ini_section_delete_var(cat, "cdrom_interface");

View File

@@ -843,3 +843,31 @@ device_context_get_device(void)
{
return device_current.dev;
}
const device_t device_none = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t device_internal = {
.name = "Internal",
.internal_name = "internal",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};

View File

@@ -2040,25 +2040,11 @@ static const device_t iab_device = {
};
#endif
static const device_t isa_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const struct {
const device_t *dev;
} boards[] = {
// clang-format off
{ &isa_none_device },
{ &device_none },
// XT Ram Expansion Cards
{ &ibmxt_32k_device },
{ &ibmxt_64k_device },

View File

@@ -752,30 +752,16 @@ const device_t vendex_xt_rtc_onboard_device = {
.config = NULL
};
static const device_t isartc_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const struct {
const device_t *dev;
} boards[] = {
// clang-format off
{ &isartc_none_device },
{ &ev170_device },
{ &pii147_device },
{ &p5pak_device },
{ &a6pak_device },
{ NULL },
{ &device_none },
{ &ev170_device },
{ &pii147_device },
{ &p5pak_device },
{ &a6pak_device },
{ NULL },
// clang-format on
};

View File

@@ -30,7 +30,7 @@
#include <86box/hdc_ide.h>
#include <86box/hdd.h>
int hdc_current;
int hdc_current[HDC_MAX] = { 0, 0 };
#ifdef ENABLE_HDC_LOG
int hdc_do_log = ENABLE_HDC_LOG;
@@ -50,40 +50,12 @@ hdc_log(const char *fmt, ...)
# define hdc_log(fmt, ...)
#endif
static const device_t hdc_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const device_t hdc_internal_device = {
.name = "Internal",
.internal_name = "internal",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const struct {
const device_t *device;
} controllers[] = {
// clang-format off
{ &hdc_none_device },
{ &hdc_internal_device },
{ &device_none },
{ &device_internal },
{ &st506_xt_xebec_device },
{ &st506_xt_wdxt_gen_device },
{ &st506_xt_dtc5150x_device },
@@ -129,11 +101,11 @@ void
hdc_reset(void)
{
hdc_log("HDC: reset(current=%d, internal=%d)\n",
hdc_current, (machines[machine].flags & MACHINE_HDC) ? 1 : 0);
hdc_current[0], (machines[machine].flags & MACHINE_HDC) ? 1 : 0);
/* If we have a valid controller, add its device. */
if (hdc_current > HDC_INTERNAL)
device_add(controllers[hdc_current].device);
if (hdc_current[0] > HDC_INTERNAL)
device_add(controllers[hdc_current[0]].device);
/* Now, add the tertiary and/or quaternary IDE controllers. */
if (ide_ter_enabled)

View File

@@ -77,7 +77,7 @@ int lastbyte = 0;
int floppymodified[4];
int floppyrate[4];
int fdc_type = 0;
int fdc_current[FDC_MAX] = { 0, 0 };
#ifdef ENABLE_FDC_LOG
int fdc_do_log = ENABLE_FDC_LOG;
@@ -97,49 +97,21 @@ fdc_log(const char *fmt, ...)
# define fdc_log(fmt, ...)
#endif
const device_t fdc_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t fdc_internal_device = {
.name = "Internal",
.internal_name = "internal",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
typedef const struct {
const device_t *device;
} fdc_cards_t;
static fdc_cards_t fdc_cards[] = {
// clang-format off
{ &fdc_none_device },
{ &fdc_internal_device },
{ &fdc_xt_device },
{ &fdc_at_device },
{ &fdc_b215_device },
{ &fdc_pii151b_device },
{ &fdc_pii158b_device },
{ &fdc_monster_device },
{ NULL }
{ &device_none },
{ &device_internal },
{ &fdc_xt_device },
{ &fdc_at_device },
{ &fdc_b215_device },
{ &fdc_pii151b_device },
{ &fdc_pii158b_device },
{ &fdc_monster_device },
{ NULL }
// clang-format on
};
@@ -190,8 +162,8 @@ fdc_card_get_from_internal_name(char *s)
void
fdc_card_init(void)
{
if ((fdc_type > FDC_INTERNAL) && fdc_cards[fdc_type].device)
device_add_inst(fdc_cards[fdc_type].device, 0);
if ((fdc_current[0] > FDC_INTERNAL) && fdc_cards[fdc_current[0]].device)
device_add_inst(fdc_cards[fdc_current[0]].device, 0);
}
uint8_t

View File

@@ -21,6 +21,7 @@
#define EMU_86BOX_H
/* Configuration values. */
#define GFXCARD_MAX 2
#define SERIAL_MAX 7
#define PARALLEL_MAX 4
#define SCREEN_RES_X 640
@@ -124,7 +125,7 @@ extern int force_43; /* (C) video */
extern int video_filter_method; /* (C) video */
extern int video_vsync; /* (C) video */
extern int video_framerate; /* (C) video */
extern int gfxcard[2]; /* (C) graphics/video card */
extern int gfxcard[GFXCARD_MAX]; /* (C) graphics/video card */
extern char video_shader[512]; /* (C) video */
extern int bugger_enabled; /* (C) enable ISAbugger */
extern int novell_keycard_enabled; /* (C) enable Novell NetWare 2.x key card emulation. */

View File

@@ -113,8 +113,8 @@ typedef struct config_t {
# endif
/* Other peripherals category */
int fdc_type; /* Floppy disk controller type */
int hdc_current; /* Hard disk controller type */
int fdc_current[FDC_MAX]; /* Floppy disk controller type */
int hdc_current[HDC_MAX]; /* Hard disk controller type */
int hdc; /* Hard disk controller */
int scsi_card; /* SCSI controller */
int ide_ter_enabled; /* Tertiary IDE controller enabled */

View File

@@ -244,6 +244,9 @@ extern const char *device_get_internal_name(const device_t *dev);
extern int machine_get_config_int(char *s);
extern char *machine_get_config_string(char *s);
extern const device_t device_none;
extern const device_t device_internal;
#ifdef __cplusplus
}
#endif

View File

@@ -22,8 +22,6 @@
#ifndef EMU_FDC_H
#define EMU_FDC_H
extern int fdc_type;
#define FDC_PRIMARY_ADDR 0x03f0
#define FDC_PRIMARY_IRQ 6
#define FDC_PRIMARY_DMA 2

View File

@@ -22,7 +22,9 @@
#ifndef EMU_FDC_EXT_H
#define EMU_FDC_EXT_H
extern int fdc_type;
#define FDC_MAX 2
extern int fdc_current[FDC_MAX];
/* Controller types. */
#define FDC_NONE 0
@@ -42,4 +44,4 @@ extern const device_t *fdc_card_getdevice(int card);
extern int fdc_card_has_config(int card);
extern int fdc_card_available(int card);
#endif /*EMU_FDC_H*/
#endif /*EMU_FDC_EXT_H*/

View File

@@ -32,7 +32,9 @@
#define HDC_NONE 0
#define HDC_INTERNAL 1
extern int hdc_current;
#define HDC_MAX 2
extern int hdc_current[HDC_MAX];
extern const device_t st506_xt_xebec_device; /* st506_xt_xebec */
extern const device_t st506_xt_wdxt_gen_device; /* st506_xt_wdxt_gen */

View File

@@ -105,7 +105,7 @@ machine_at_ibm_common_init(const machine_t *model)
mem_remap_top(384);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
}
@@ -252,7 +252,7 @@ machine_at_siemens_init(const machine_t *model)
mem_remap_top(384);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;

View File

@@ -59,7 +59,7 @@ machine_at_mr286_init(const machine_t *model)
machine_at_common_ide_init(model);
device_add(&keyboard_at_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -70,7 +70,7 @@ machine_at_headland_common_init(int type)
{
device_add(&keyboard_at_ami_device);
if ((type != 2) && (fdc_type == FDC_INTERNAL))
if ((type != 2) && (fdc_current[0] == FDC_INTERNAL))
device_add(&fdc_at_device);
if (type == 2)
@@ -137,7 +137,7 @@ machine_at_quadt286_init(const machine_t *model)
machine_at_common_init(model);
device_add(&keyboard_at_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&headland_gc10x_device);
@@ -160,7 +160,7 @@ machine_at_quadt386sx_init(const machine_t *model)
machine_at_common_init(model);
device_add(&keyboard_at_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&headland_gc10x_device);
@@ -183,7 +183,7 @@ machine_at_neat_init(const machine_t *model)
device_add(&neat_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -204,7 +204,7 @@ machine_at_neat_ami_init(const machine_t *model)
device_add(&neat_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&keyboard_at_ami_device);
@@ -226,7 +226,7 @@ machine_at_px286_init(const machine_t *model)
machine_at_common_init(model);
device_add(&keyboard_at_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&neat_device);
@@ -248,7 +248,7 @@ machine_at_micronics386_init(const machine_t *model)
machine_at_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -284,7 +284,7 @@ machine_at_scatsx_init(const machine_t *model)
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&scat_sx_device);
@@ -303,7 +303,7 @@ machine_at_award286_init(const machine_t *model)
machine_at_scat_init(model, 0, 1);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&ide_isa_device);
@@ -324,7 +324,7 @@ machine_at_gdc212m_init(const machine_t *model)
machine_at_scat_init(model, 0, 1);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&ide_isa_device);
@@ -365,7 +365,7 @@ machine_at_senor_scat286_init(const machine_t *model)
machine_at_scat_init(model, 0, 1);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -386,7 +386,7 @@ machine_at_super286c_init(const machine_t *model)
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&neat_device);
@@ -407,7 +407,7 @@ machine_at_super286tr_init(const machine_t *model)
machine_at_scat_init(model, 0, 1);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -426,7 +426,7 @@ machine_at_spc4200p_init(const machine_t *model)
machine_at_scat_init(model, 0, 1);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&ide_isa_device);
@@ -448,7 +448,7 @@ machine_at_spc4216p_init(const machine_t *model)
machine_at_scat_init(model, 1, 1);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -471,7 +471,7 @@ machine_at_spc4620p_init(const machine_t *model)
machine_at_scat_init(model, 1, 1);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&ide_isa_device);
@@ -508,7 +508,7 @@ machine_at_deskmaster286_init(const machine_t *model)
machine_at_scat_init(model, 0, 1);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&ide_isa_device);
@@ -533,7 +533,7 @@ machine_at_shuttle386sx_init(const machine_t *model)
device_add(&intel_82335_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -557,7 +557,7 @@ machine_at_adi386sx_init(const machine_t *model)
device_add(&intel_82335_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -603,7 +603,7 @@ machine_at_cmdsl386sx16_init(const machine_t *model)
device_add(&keyboard_at_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&neat_device);
@@ -624,7 +624,7 @@ machine_at_scamp_common_init(const machine_t *model, int is_ps2)
else
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&vlsi_scamp_device);
@@ -699,7 +699,7 @@ machine_at_awardsx_init(const machine_t *model)
device_add(&opti291_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -718,7 +718,7 @@ machine_at_acer100t_init(const machine_t *model)
machine_at_ps2_ide_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&ali1409_device);
@@ -896,7 +896,7 @@ machine_at_pc8_init(const machine_t *model)
machine_at_common_init(model);
device_add(&keyboard_at_ncr_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -921,7 +921,7 @@ machine_at_3302_init(const machine_t *model)
machine_at_common_ide_init(model);
device_add(&neat_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
if (gfxcard[0] == VID_INTERNAL)
@@ -953,7 +953,7 @@ machine_at_pc916sx_init(const machine_t *model)
device_add(&keyboard_at_ncr_device);
mem_remap_top(384);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -975,7 +975,7 @@ machine_at_m290_init(const machine_t *model)
device_add(&keyboard_at_olivetti_device);
device_add(&port_6x_olivetti_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&olivetti_eva_device);

View File

@@ -63,7 +63,7 @@ machine_at_acc386_init(const machine_t *model)
device_add(&acc2168_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -84,7 +84,7 @@ machine_at_asus386_init(const machine_t *model)
device_add(&rabbit_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -104,7 +104,7 @@ machine_at_tandy4000_init(const machine_t *model)
machine_at_common_init(model);
device_add(&keyboard_at_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -117,7 +117,7 @@ machine_at_sis401_common_init(const machine_t *model)
device_add(&sis_85c401_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
}
@@ -168,7 +168,7 @@ machine_at_av4_init(const machine_t *model)
device_add(&sis_85c460_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -192,7 +192,7 @@ machine_at_valuepoint433_init(const machine_t *model) // hangs without the PS/2
device_add(&keyboard_ps2_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -213,7 +213,7 @@ machine_at_ecs386_init(const machine_t *model)
machine_at_common_init(model);
device_add(&cs8230_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&keyboard_at_ami_device);
@@ -236,7 +236,7 @@ machine_at_spc6000a_init(const machine_t *model)
machine_at_common_init_ex(model, 1);
device_add(&cs8230_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&keyboard_at_ami_device);
@@ -259,7 +259,7 @@ machine_at_ecs386v_init(const machine_t *model)
device_add(&ali1429_device);
device_add(&keyboard_ps2_intel_ami_pci_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -281,7 +281,7 @@ machine_at_rycleopardlx_init(const machine_t *model)
device_add(&opti283_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -303,7 +303,7 @@ machine_at_486vchd_init(const machine_t *model)
device_add(&via_vt82c49x_device);
device_add(&keyboard_at_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -324,7 +324,7 @@ machine_at_cs4031_init(const machine_t *model)
device_add(&cs4031_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -448,7 +448,7 @@ machine_at_acerv10_init(const machine_t *model)
device_add(&keyboard_ps2_acer_pci_device);
device_add(&ide_isa_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -492,7 +492,7 @@ machine_at_ali1429_common_init(const machine_t *model, int is_green)
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
}
@@ -545,7 +545,7 @@ machine_at_opti495_init(const machine_t *model)
device_add(&keyboard_at_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -560,7 +560,7 @@ machine_at_opti495_ami_common_init(const machine_t *model)
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
}
@@ -612,7 +612,7 @@ machine_at_exp4349_init(const machine_t *model)
device_add(&ali1429g_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
}
@@ -630,7 +630,7 @@ machine_at_403tg_common_init(const machine_t *model, int nvr_hack)
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
}
@@ -801,7 +801,7 @@ machine_at_sis_85c471_common_init(const machine_t *model)
{
machine_at_common_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&sis_85c471_device);
@@ -920,7 +920,7 @@ machine_at_pci400ca_init(const machine_t *model)
device_add(&i420tx_device);
device_add(&ncr53c810_onboard_pci_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -956,7 +956,7 @@ machine_at_greenb_init(const machine_t *model)
machine_at_common_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&contaq_82c597_device);
@@ -979,7 +979,7 @@ machine_at_4gpv5_init(const machine_t *model)
machine_at_common_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&contaq_82c596a_device);
@@ -1417,7 +1417,7 @@ machine_at_pci400cb_init(const machine_t *model)
device_add(&ims8848_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -1446,7 +1446,7 @@ machine_at_g486ip_init(const machine_t *model)
device_add(&ims8848_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -1506,7 +1506,7 @@ machine_at_486ap4_init(const machine_t *model)
pci_register_slot(0x0c, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 0c = Slot 4 */
device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&i420ex_device);
@@ -1986,7 +1986,7 @@ machine_at_atc1415_init(const machine_t *model)
device_add(&intel_flash_bxt_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -2247,7 +2247,7 @@ machine_at_ecsal486_init(const machine_t *model)
device_add(&ali1429g_device);
device_add(&keyboard_ps2_ami_pci_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -2290,9 +2290,8 @@ machine_at_atc1762_init(const machine_t *model)
device_add(&ali1429g_device);
device_add(&keyboard_ps2_ami_pci_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
}

View File

@@ -112,7 +112,7 @@ machine_at_cmdpc_init(const machine_t *model)
mem_remap_top(384);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
cmd_uart = device_add(&ns8250_device);

View File

@@ -779,7 +779,7 @@ machine_at_compaq_init(const machine_t *model, int type)
{
compaq_machine_type = type;
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
if (type < COMPAQ_PORTABLEIII386) {
@@ -798,7 +798,7 @@ machine_at_compaq_init(const machine_t *model, int type)
break;
case COMPAQ_PORTABLEIII:
if (hdc_current == HDC_INTERNAL)
if (hdc_current[0] == HDC_INTERNAL)
device_add(&ide_isa_device);
if (gfxcard[0] == VID_INTERNAL)
device_add(&compaq_plasma_device);
@@ -806,7 +806,7 @@ machine_at_compaq_init(const machine_t *model, int type)
break;
case COMPAQ_PORTABLEIII386:
if (hdc_current == HDC_INTERNAL)
if (hdc_current[0] == HDC_INTERNAL)
device_add(&ide_isa_device);
if (gfxcard[0] == VID_INTERNAL)
device_add(&compaq_plasma_device);

View File

@@ -293,7 +293,7 @@ machine_at_award_common_init(const machine_t *model)
pci_register_slot(0x07, PCI_CARD_SCSI, 1, 2, 3, 4); /* 07 = SCSI */
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&keyboard_ps2_ami_pci_device);
@@ -402,7 +402,7 @@ machine_at_p5vl_init(const machine_t *model)
device_add(&sst_flash_29ee010_device);
device_add(&keyboard_at_ami_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;

View File

@@ -371,7 +371,7 @@ machine_at_pat54pv_init(const machine_t *model)
device_add(&opti5x7_device);
device_add(&keyboard_ps2_intel_ami_pci_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;
@@ -401,7 +401,7 @@ machine_at_hot543_init(const machine_t *model)
device_add(&sst_flash_29ee010_device);
device_add(&keyboard_at_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
return ret;

View File

@@ -815,7 +815,7 @@ machine_at_t3100e_init(const machine_t *model)
device_add(&keyboard_at_toshiba_device);
if (fdc_type == FDC_INTERNAL) {
if (fdc_current[0] == FDC_INTERNAL) {
device_add(&fdc_at_device);
}

View File

@@ -178,7 +178,7 @@ machine_elt_init(const machine_t *model)
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_device);
if (gfxcard[0] == VID_INTERNAL) {

View File

@@ -660,7 +660,7 @@ europc_boot(UNUSED(const device_t *info))
*
* We only do this if we have not configured another one.
*/
if (hdc_current == HDC_INTERNAL)
if (hdc_current[0] == HDC_INTERNAL)
(void) device_add(&xta_hd20_device);
return sys;

View File

@@ -353,7 +353,7 @@ ps1_setup(int model)
device_add(&fdc_at_ps1_device);
/* Enable the builtin HDC. */
if (hdc_current == HDC_INTERNAL) {
if (hdc_current[0] == HDC_INTERNAL) {
priv = device_add(&ps1_hdc_device);
ps1_hdc_inform(priv, &ps->ps1_91);

View File

@@ -179,7 +179,7 @@ ps2_isa_setup(int model, int cpu_type)
device_add(&fdc_at_ps1_device);
/* Enable the builtin HDC. */
if (hdc_current == HDC_INTERNAL) {
if (hdc_current[0] == HDC_INTERNAL) {
priv = device_add(&ps1_hdc_device);
ps1_hdc_inform(priv, &ps2->ps2_91);
}

View File

@@ -1395,7 +1395,7 @@ machine_ps2_common_init(const machine_t *model)
{
machine_common_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
dma16_init();

View File

@@ -1738,7 +1738,7 @@ machine_tandy1k_init(const machine_t *model, int type)
device_add(&keyboard_tandy_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_tandy_device);
video_reset(gfxcard[0]);

View File

@@ -88,13 +88,13 @@ machine_v86p_init(const machine_t *model)
device_add(&keyboard_xt_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_device);
if (gfxcard[0] == VID_INTERNAL)
device_add(&f82c425_video_device);
if (hdc_current <= HDC_INTERNAL)
if (hdc_current[0] <= HDC_INTERNAL)
device_add(&st506_xt_victor_v86p_device);
return ret;

View File

@@ -25,7 +25,7 @@ extern const device_t vendex_xt_rtc_onboard_device;
static void
machine_xt_common_init(const machine_t *model, int fixed_floppy)
{
if ((fdc_type == FDC_INTERNAL) || fixed_floppy)
if ((fdc_current[0] == FDC_INTERNAL) || fixed_floppy)
device_add(&fdc_xt_device);
machine_common_init(model);

View File

@@ -53,7 +53,7 @@ machine_xt_compaq_deskpro_init(const machine_t *model)
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
device_add(&keyboard_xt_compaq_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_device);
nmi_init();
standalone_gameport_type = &gameport_device;
@@ -80,7 +80,7 @@ machine_xt_compaq_portable_init(const machine_t *model)
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
device_add(&keyboard_xt_compaq_device);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_device);
nmi_init();
if (joystick_type)

View File

@@ -147,7 +147,7 @@ machine_xt_laserxt_common_init(const machine_t *model,int is_lxt3)
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_device);
nmi_init();

View File

@@ -591,7 +591,7 @@ m24_kbd_write(uint16_t port, uint8_t val, void *priv)
* bit 7 - use BIOS HD on mainboard (on) / on controller (off)
* bit 6 - use OCG/CGA display adapter (on) / other display adapter (off)
*/
ret = (hdc_current == HDC_INTERNAL) ? 0x00 : 0x80;
ret = (hdc_current[0] == HDC_INTERNAL) ? 0x00 : 0x80;
ret |= video_is_cga() ? 0x40 : 0x00;
m24_kbd_adddata(ret);
@@ -2219,7 +2219,7 @@ m24_read(uint16_t port, UNUSED(void *priv))
"Reserved for HDU", same as for Switch 3 */
/* Switch 3 - Disable internal BIOS HD */
if (hdc_current != HDC_INTERNAL)
if (hdc_current[0] != HDC_INTERNAL)
ret |= 0x4;
/* Switch 2 - Set fast startup */
@@ -2317,7 +2317,7 @@ machine_xt_m24_init(const machine_t *model)
machine_common_init(model);
/* On-board FDC can be disabled only on M24SP */
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_device);
/* Address 66-67 = mainboard dip-switch settings */
@@ -2349,7 +2349,7 @@ machine_xt_m24_init(const machine_t *model)
m24_kbd_init(m24_kbd);
device_add_ex(&m24_kbd_device, m24_kbd);
if (hdc_current == HDC_INTERNAL)
if (hdc_current[0] == HDC_INTERNAL)
device_add(&st506_xt_wd1002a_wx1_nobios_device);
return ret;
@@ -2393,7 +2393,7 @@ machine_xt_m240_init(const machine_t *model)
m24_kbd_init(m24_kbd);
device_add_ex(&m24_kbd_device, m24_kbd);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device); /* io.c logs clearly show it using port 3F7 */
if (joystick_type)
@@ -2409,7 +2409,7 @@ machine_xt_m240_init(const machine_t *model)
mm58274_init(nvr, model->nvrmask + 1);
if (hdc_current == HDC_INTERNAL)
if (hdc_current[0] == HDC_INTERNAL)
device_add(&st506_xt_wd1002a_wx1_nobios_device);
return ret;

View File

@@ -969,7 +969,7 @@ machine_xt_t1200_init(const machine_t *model)
if (gfxcard[0] == VID_INTERNAL)
device_add(&t1200_video_device);
if (hdc_current <= HDC_INTERNAL)
if (hdc_current[0] <= HDC_INTERNAL)
device_add(&st506_xt_toshiba_t1200_device);
return ret;

View File

@@ -201,7 +201,7 @@ machine_xt_xi8088_init(const machine_t *model)
machine_common_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_at_device);
device_add(&keyboard_ps2_xi8088_device);

View File

@@ -140,7 +140,7 @@ machine_xt_z184_init(const machine_t *model)
machine_zenith_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_device);
lpt1_remove(); /* only one parallel port */
@@ -170,7 +170,7 @@ machine_xt_z151_init(const machine_t *model)
machine_zenith_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_tandy_device);
return ret;
@@ -193,7 +193,7 @@ machine_xt_z159_init(const machine_t *model)
machine_zenith_init(model);
if (fdc_type == FDC_INTERNAL)
if (fdc_current[0] == FDC_INTERNAL)
device_add(&fdc_xt_tandy_device);
/* parallel port is on the memory board */

View File

@@ -77,37 +77,9 @@
# include <winsock2.h>
#endif
static const device_t net_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = NET_TYPE_NONE,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const device_t net_internal_device = {
.name = "Internal",
.internal_name = "internal",
.flags = 0,
.local = NET_TYPE_NONE,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const device_t *net_cards[] = {
&net_none_device,
&net_internal_device,
&device_none,
&device_internal,
&threec501_device,
&threec503_device,
&pcnet_am79c960_device,

View File

@@ -294,7 +294,7 @@ MachineStatus::iterateFDD(const std::function<void(int)> &cb)
void
MachineStatus::iterateCDROM(const std::function<void(int)> &cb)
{
auto hdc_name = QString(hdc_get_internal_name(hdc_current));
auto hdc_name = QString(hdc_get_internal_name(hdc_current[0]));
for (size_t i = 0; i < CDROM_NUM; i++) {
/* Could be Internal or External IDE.. */
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) && !hasIDE() &&
@@ -317,7 +317,7 @@ MachineStatus::iterateCDROM(const std::function<void(int)> &cb)
void
MachineStatus::iterateZIP(const std::function<void(int)> &cb)
{
auto hdc_name = QString(hdc_get_internal_name(hdc_current));
auto hdc_name = QString(hdc_get_internal_name(hdc_current[0]));
for (size_t i = 0; i < ZIP_NUM; i++) {
/* Could be Internal or External IDE.. */
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && !hasIDE() &&
@@ -338,7 +338,7 @@ MachineStatus::iterateZIP(const std::function<void(int)> &cb)
void
MachineStatus::iterateMO(const std::function<void(int)> &cb)
{
auto hdc_name = QString(hdc_get_internal_name(hdc_current));
auto hdc_name = QString(hdc_get_internal_name(hdc_current[0]));
for (size_t i = 0; i < MO_NUM; i++) {
/* Could be Internal or External IDE.. */
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && !hasIDE() &&
@@ -602,7 +602,7 @@ MachineStatus::refresh(QStatusBar *sbar)
sbar->addWidget(d->net[i].label.get());
});
auto hdc_name = QString(hdc_get_internal_name(hdc_current));
auto hdc_name = QString(hdc_get_internal_name(hdc_current[0]));
if ((has_mfm || (hdc_name.left(5) == QStringLiteral("st506"))) && (c_mfm > 0)) {
d->hdds[HDD_BUS_MFM].label = std::make_unique<QLabel>();
d->hdds[HDD_BUS_MFM].setActive(false);

View File

@@ -145,9 +145,11 @@ main_thread_fn()
}
is_quit = 1;
if (gfxcard[1]) {
ui_deinit_monitor(1);
std::this_thread::sleep_for(std::chrono::milliseconds(500));
for (uint8_t i = 1; i < GFXCARD_MAX; i ++) {
if (gfxcard[i]) {
ui_deinit_monitor(i);
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
}
QTimer::singleShot(0, QApplication::instance(), []() { QApplication::processEvents(); QApplication::instance()->quit(); });
}

View File

@@ -36,8 +36,8 @@ SettingsDisplay::SettingsDisplay(QWidget *parent)
{
ui->setupUi(this);
videoCard[0] = gfxcard[0];
videoCard[1] = gfxcard[1];
for (uint8_t i = 0; i < GFXCARD_MAX; i ++)
videoCard[i] = gfxcard[i];
onCurrentMachineChanged(machine);
}
@@ -50,7 +50,9 @@ void
SettingsDisplay::save()
{
gfxcard[0] = ui->comboBoxVideo->currentData().toInt();
gfxcard[1] = ui->comboBoxVideoSecondary->currentData().toInt();
// TODO
for (uint8_t i = 1; i < GFXCARD_MAX; i ++)
gfxcard[i] = ui->comboBoxVideoSecondary->currentData().toInt();
voodoo_enabled = ui->checkBoxVoodoo->isChecked() ? 1 : 0;
ibm8514_standalone_enabled = ui->checkBox8514->isChecked() ? 1 : 0;
xga_standalone_enabled = ui->checkBoxXga->isChecked() ? 1 : 0;
@@ -103,8 +105,10 @@ SettingsDisplay::onCurrentMachineChanged(int machineId)
ui->pushButtonConfigureSecondary->setEnabled(true);
}
ui->comboBoxVideo->setCurrentIndex(selectedRow);
if (gfxcard[1] == 0)
ui->pushButtonConfigureSecondary->setEnabled(false);
// TODO
for (uint8_t i = 1; i < GFXCARD_MAX; i ++)
if (gfxcard[i] == 0)
ui->pushButtonConfigureSecondary->setEnabled(false);
}
void

View File

@@ -3,6 +3,8 @@
#include <QWidget>
#define VIDEOCARD_MAX 2
namespace Ui {
class SettingsDisplay;
}
@@ -36,7 +38,7 @@ private slots:
private:
Ui::SettingsDisplay *ui;
int machineId = 0;
int videoCard[2] = { 0, 0 };
int videoCard[VIDEOCARD_MAX] = { 0, 0 };
};
#endif // QT_SETTINGSDISPLAY_HPP

View File

@@ -66,19 +66,23 @@ SettingsPorts::SettingsPorts(QWidget *parent)
}
for (int i = 0; i < SERIAL_MAX; i++) {
auto *checkBox = findChild<QCheckBox *>(QString("checkBoxSerial%1").arg(i + 1));
auto *checkBox = findChild<QCheckBox *>(QString("checkBoxSerial%1").arg(i + 1));
auto *checkBoxPass = findChild<QCheckBox *>(QString("checkBoxSerialPassThru%1").arg(i + 1));
if (checkBox != NULL)
checkBox->setChecked(com_ports[i].enabled > 0);
if (checkBoxPass != NULL)
checkBoxPass->setChecked(serial_passthrough_enabled[i]);
}
ui->checkBoxSerialPassThru1->setChecked(serial_passthrough_enabled[0]);
ui->pushButtonSerialPassThru1->setEnabled(serial_passthrough_enabled[0]);
ui->checkBoxSerialPassThru2->setChecked(serial_passthrough_enabled[1]);
ui->pushButtonSerialPassThru2->setEnabled(serial_passthrough_enabled[1]);
ui->checkBoxSerialPassThru3->setChecked(serial_passthrough_enabled[2]);
ui->pushButtonSerialPassThru3->setEnabled(serial_passthrough_enabled[2]);
ui->checkBoxSerialPassThru4->setChecked(serial_passthrough_enabled[3]);
ui->pushButtonSerialPassThru4->setEnabled(serial_passthrough_enabled[3]);
#if 0
ui->pushButtonSerialPassThru5->setEnabled(serial_passthrough_enabled[4]);
ui->pushButtonSerialPassThru6->setEnabled(serial_passthrough_enabled[5]);
ui->pushButtonSerialPassThru7->setEnabled(serial_passthrough_enabled[6]);
#endif
}
SettingsPorts::~SettingsPorts()
@@ -90,7 +94,7 @@ void
SettingsPorts::save()
{
for (int i = 0; i < PARALLEL_MAX; i++) {
auto *cbox = findChild<QComboBox *>(QString("comboBoxLpt%1").arg(i + 1));
auto *cbox = findChild<QComboBox *>(QString("comboBoxLpt%1").arg(i + 1));
auto *checkBox = findChild<QCheckBox *>(QString("checkBoxParallel%1").arg(i + 1));
if (cbox != NULL)
lpt_ports[i].device = cbox->currentData().toInt();
@@ -99,15 +103,13 @@ SettingsPorts::save()
}
for (int i = 0; i < SERIAL_MAX; i++) {
auto *checkBox = findChild<QCheckBox *>(QString("checkBoxSerial%1").arg(i + 1));
auto *checkBox = findChild<QCheckBox *>(QString("checkBoxSerial%1").arg(i + 1));
auto *checkBoxPass = findChild<QCheckBox *>(QString("checkBoxSerialPassThru%1").arg(i + 1));
if (checkBox != NULL)
com_ports[i].enabled = checkBox->isChecked() ? 1 : 0;
if (checkBoxPass != NULL)
serial_passthrough_enabled[i] = checkBoxPass->isChecked();
}
serial_passthrough_enabled[0] = ui->checkBoxSerialPassThru1->isChecked();
serial_passthrough_enabled[1] = ui->checkBoxSerialPassThru2->isChecked();
serial_passthrough_enabled[2] = ui->checkBoxSerialPassThru3->isChecked();
serial_passthrough_enabled[3] = ui->checkBoxSerialPassThru4->isChecked();
}
void
@@ -158,6 +160,24 @@ SettingsPorts::on_pushButtonSerialPassThru4_clicked()
DeviceConfig::ConfigureDevice(&serial_passthrough_device, 4, qobject_cast<Settings *>(Settings::settings));
}
void
SettingsPorts::on_pushButtonSerialPassThru5_clicked()
{
DeviceConfig::ConfigureDevice(&serial_passthrough_device, 5, qobject_cast<Settings *>(Settings::settings));
}
void
SettingsPorts::on_pushButtonSerialPassThru6_clicked()
{
DeviceConfig::ConfigureDevice(&serial_passthrough_device, 6, qobject_cast<Settings *>(Settings::settings));
}
void
SettingsPorts::on_pushButtonSerialPassThru7_clicked()
{
DeviceConfig::ConfigureDevice(&serial_passthrough_device, 7, qobject_cast<Settings *>(Settings::settings));
}
void
SettingsPorts::on_checkBoxSerialPassThru1_clicked(bool checked)
{
@@ -181,3 +201,23 @@ SettingsPorts::on_checkBoxSerialPassThru4_clicked(bool checked)
{
ui->pushButtonSerialPassThru4->setEnabled(checked);
}
#if 0
void
SettingsPorts::on_checkBoxSerialPassThru5_clicked(bool checked)
{
ui->pushButtonSerialPassThru5->setEnabled(checked);
}
void
SettingsPorts::on_checkBoxSerialPassThru6_clicked(bool checked)
{
ui->pushButtonSerialPassThru6->setEnabled(checked);
}
void
SettingsPorts::on_checkBoxSerialPassThru7_clicked(bool checked)
{
ui->pushButtonSerialPassThru7->setEnabled(checked);
}
#endif

View File

@@ -15,6 +15,18 @@ public:
~SettingsPorts();
void save();
#if 0
private slots:
void on_checkBoxSerialPassThru7_clicked(bool checked);
private slots:
void on_checkBoxSerialPassThru6_clicked(bool checked);
private slots:
void on_checkBoxSerialPassThru5_clicked(bool checked);
#endif
private slots:
void on_checkBoxSerialPassThru4_clicked(bool checked);
@@ -24,6 +36,18 @@ private slots:
private slots:
void on_checkBoxSerialPassThru2_clicked(bool checked);
private slots:
void on_checkBoxSerialPassThru1_clicked(bool checked);
private slots:
void on_pushButtonSerialPassThru7_clicked();
private slots:
void on_pushButtonSerialPassThru6_clicked();
private slots:
void on_pushButtonSerialPassThru5_clicked();
private slots:
void on_pushButtonSerialPassThru4_clicked();
@@ -37,15 +61,11 @@ private slots:
void on_pushButtonSerialPassThru1_clicked();
private slots:
void on_checkBoxSerialPassThru1_clicked(bool checked);
private slots:
void on_checkBoxParallel4_stateChanged(int arg1);
void on_checkBoxParallel3_stateChanged(int arg1);
void on_checkBoxParallel2_stateChanged(int arg1);
void on_checkBoxParallel1_stateChanged(int arg1);
void on_checkBoxParallel4_stateChanged(int arg1);
private:
Ui::SettingsPorts *ui;
};

View File

@@ -56,8 +56,8 @@ SettingsStorageControllers::save()
auto *cbox = findChild<QComboBox *>(QString("comboBoxSCSI%1").arg(i + 1));
scsi_card_current[i] = cbox->currentData().toInt();
}
hdc_current = ui->comboBoxHD->currentData().toInt();
fdc_type = ui->comboBoxFD->currentData().toInt();
hdc_current[0] = ui->comboBoxHD->currentData().toInt();
fdc_current[0] = ui->comboBoxFD->currentData().toInt();
cdrom_interface_current = ui->comboBoxCDInterface->currentData().toInt();
ide_ter_enabled = ui->checkBoxTertiaryIDE->isChecked() ? 1 : 0;
ide_qua_enabled = ui->checkBoxQuaternaryIDE->isChecked() ? 1 : 0;
@@ -92,7 +92,7 @@ SettingsStorageControllers::onCurrentMachineChanged(int machineId)
if (device_is_valid(hdc_dev, machineId)) {
int row = Models::AddEntry(model, name, c);
if (c == hdc_current) {
if (c == hdc_current[0]) {
selectedRow = row - removeRows;
}
}
@@ -128,7 +128,7 @@ SettingsStorageControllers::onCurrentMachineChanged(int machineId)
if (device_is_valid(fdc_dev, machineId)) {
int row = Models::AddEntry(model, name, c);
if (c == fdc_type) {
if (c == fdc_current[0]) {
selectedRow = row - removeRows;
}
}

View File

@@ -30,7 +30,6 @@
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include <86box/86box.h>
@@ -327,55 +326,17 @@ plat_cdrom_get_audio_sub(UNUSED(uint32_t sector), uint8_t *attr, uint8_t *track,
}
int
plat_cdrom_get_sector_size(uint32_t sector)
plat_cdrom_get_sector_size(UNUSED(uint32_t sector))
{
/* Sector size returned by Windows is always a power of two, which is pointless. */
return 2352;
}
long size;
DISK_GEOMETRY dgCDROM;
/* Used EXCLUSIVELY to read raw sectors, not to detect tracks. */
static int
plat_cdrom_read_scsi_direct(uint32_t sector, uint8_t *buffer)
{
DWORD unused;
int ret;
typedef struct SCSI_PASS_THROUGH_DIRECT_BUF {
SCSI_PASS_THROUGH_DIRECT spt;
ULONG Filler;
UCHAR SenseBuf[32];
} SCSI_PASS_THROUGH_DIRECT_BUF;
plat_cdrom_open();
DeviceIoControl(handle, IOCTL_CDROM_GET_DRIVE_GEOMETRY, NULL, 0, &dgCDROM, sizeof(dgCDROM), (LPDWORD)&size, NULL);
plat_cdrom_close();
SCSI_PASS_THROUGH_DIRECT_BUF req;
memset(&req, 0, sizeof(req));
req.Filler = 0;
req.spt.Length = sizeof(SCSI_PASS_THROUGH_DIRECT);
req.spt.CdbLength = 12;
req.spt.DataIn = SCSI_IOCTL_DATA_IN;
req.spt.SenseInfoOffset = offsetof(SCSI_PASS_THROUGH_DIRECT_BUF, SenseBuf);
req.spt.SenseInfoLength = sizeof(req.SenseBuf);
req.spt.TimeOutValue = 6;
req.spt.DataTransferLength = 2352;
req.spt.DataBuffer = buffer;
/* Fill in the CDB. */
req.spt.Cdb[0] = 0xBE; /* READ CD */
req.spt.Cdb[1] = 0x00; /* DAP = 0, Any Sector Type. */
req.spt.Cdb[2] = (sector & 0xFF000000) >> 24;
req.spt.Cdb[3] = (sector & 0xFF0000) >> 16;
req.spt.Cdb[4] = (sector & 0xFF00) >> 8;
req.spt.Cdb[5] = (sector & 0xFF); /* Starting Logical Block Address. */
req.spt.Cdb[6] = 0;
req.spt.Cdb[7] = 0;
req.spt.Cdb[8] = 1; /* Transfer Length. */
req.spt.Cdb[9] = 0xF8; /* 2352 bytes of data (non-subchannel). */
req.spt.Cdb[10] = 0; /* No subchannel data. */
req.spt.Cdb[11] = 0;
ret = DeviceIoControl(handle, IOCTL_SCSI_PASS_THROUGH_DIRECT, &req, sizeof(req), &req, sizeof(req), &unused, NULL) && req.spt.DataTransferLength == 2352;
win_cdrom_ioctl_log("plat_cdrom_read_scsi_direct: ret = %d, req.spt.DataTransferLength = %lu\n", ret, req.spt.DataTransferLength);
return ret;
win_cdrom_ioctl_log("BytesPerSector=%d\n", dgCDROM.BytesPerSector);
return dgCDROM.BytesPerSector;
}
int
@@ -390,18 +351,13 @@ plat_cdrom_read_sector(uint8_t *buffer, int raw, uint32_t sector)
if (raw) {
win_cdrom_ioctl_log("Raw\n");
/* Raw */
status = plat_cdrom_read_scsi_direct(sector, buffer);
if (status) {
return 1;
} else {
RAW_READ_INFO in;
in.DiskOffset.LowPart = sector * COOKED_SECTOR_SIZE;
in.DiskOffset.HighPart = 0;
in.SectorCount = 1;
in.TrackMode = CDDA;
status = DeviceIoControl(handle, IOCTL_CDROM_RAW_READ, &in, sizeof(in),
buffer, buflen, (LPDWORD)&size, NULL);
}
RAW_READ_INFO in;
in.DiskOffset.LowPart = sector * COOKED_SECTOR_SIZE;
in.DiskOffset.HighPart = 0;
in.SectorCount = 1;
in.TrackMode = CDDA;
status = DeviceIoControl(handle, IOCTL_CDROM_RAW_READ, &in, sizeof(in),
buffer, buflen, (LPDWORD)&size, NULL);
} else {
win_cdrom_ioctl_log("Cooked\n");
/* Cooked */

View File

@@ -47,27 +47,13 @@ double scsi_bus_speed[SCSI_BUS_MAX] = { 0.0, 0.0, 0.0, 0.0 };
static uint8_t next_scsi_bus = 0;
static const device_t scsi_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
typedef const struct {
const device_t *device;
} SCSI_CARD;
static SCSI_CARD scsi_cards[] = {
// clang-format off
{ &scsi_none_device, },
{ &device_none, },
{ &aha154xa_device, },
{ &aha154xb_device, },
{ &aha154xc_device, },

View File

@@ -71,59 +71,31 @@ typedef struct
const device_t *device;
} MIDI_OUT_DEVICE, MIDI_IN_DEVICE;
static const device_t midi_out_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const MIDI_OUT_DEVICE devices[] = {
// clang-format off
{ &midi_out_none_device },
{ &device_none },
#ifdef USE_FLUIDSYNTH
{ &fluidsynth_device },
{ &fluidsynth_device },
#endif
#ifdef USE_MUNT
{ &mt32_old_device },
{ &mt32_new_device },
{ &cm32l_device },
{ &cm32ln_device },
{ &mt32_old_device },
{ &mt32_new_device },
{ &cm32l_device },
{ &cm32ln_device },
#endif
#ifdef USE_RTMIDI
{ &rtmidi_output_device },
{ &rtmidi_output_device },
#endif
#if defined(DEV_BRANCH) && defined(USE_OPL4ML)
{ &opl4_midi_device },
{ &opl4_midi_device },
#endif
{ NULL }
{ NULL }
// clang-format on
};
static const device_t midi_in_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const MIDI_IN_DEVICE midi_in_devices[] = {
// clang-format off
{ &midi_in_none_device },
{ &device_none },
#ifdef USE_RTMIDI
{ &rtmidi_input_device },
#endif

View File

@@ -96,38 +96,10 @@ static void *filter_cd_audio_p = NULL;
void (*filter_pc_speaker)(int channel, double *buffer, void *priv) = NULL;
void *filter_pc_speaker_p = NULL;
static const device_t sound_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const device_t sound_internal_device = {
.name = "Internal",
.internal_name = "internal",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const SOUND_CARD sound_cards[] = {
// clang-format off
{ &sound_none_device },
{ &sound_internal_device },
{ &device_none },
{ &device_internal },
{ &acermagic_s20_device },
{ &mirosound_pcm10_device },
{ &adlib_device },
@@ -249,14 +221,9 @@ sound_card_get_from_internal_name(const char *s)
void
sound_card_init(void)
{
if ((sound_card_current[0] > SOUND_INTERNAL) && (sound_cards[sound_card_current[0]].device))
device_add_inst(sound_cards[sound_card_current[0]].device, 1);
if ((sound_card_current[1] > SOUND_INTERNAL) && (sound_cards[sound_card_current[1]].device))
device_add_inst(sound_cards[sound_card_current[1]].device, 2);
if ((sound_card_current[2] > SOUND_INTERNAL) && (sound_cards[sound_card_current[2]].device))
device_add_inst(sound_cards[sound_card_current[2]].device, 3);
if ((sound_card_current[3] > SOUND_INTERNAL) && (sound_cards[sound_card_current[3]].device))
device_add_inst(sound_cards[sound_card_current[3]].device, 4);
for (uint8_t i = 0; i < SOUND_CARD_MAX; i++)
if ((sound_card_current[i] > SOUND_INTERNAL) && (sound_cards[sound_card_current[i]].device))
device_add_inst(sound_cards[sound_card_current[i]].device, i + 1);
}
void

View File

@@ -1168,7 +1168,7 @@ monitor_thread(void *param)
#endif
}
extern int gfxcard[2];
extern int gfxcard[GFXCARD_MAX];
int
main(int argc, char **argv)
{
@@ -1186,7 +1186,8 @@ main(int argc, char **argv)
return 6;
}
gfxcard[1] = 0;
for (uint8_t i = 1; i < GFXCARD_MAX; i++)
gfxcard[i] = 0;
eventthread = SDL_ThreadID();
blitmtx = SDL_CreateMutex();
if (!blitmtx) {

View File

@@ -161,6 +161,8 @@ typedef struct chips_69000_t {
uint8_t st01;
} chips_69000_t;
static chips_69000_t *reset_state = NULL;
/* TODO: Probe timings on real hardware. */
static video_timings_t timing_chips = { .type = VIDEO_PCI, .write_b = 2, .write_w = 2, .write_l = 1, .read_b = 10, .read_w = 10, .read_l = 10 };
@@ -777,7 +779,7 @@ chips_69000_recalctimings(svga_t *svga)
if (!(chips->ext_regs[0x81] & 0x10))
svga->htotal += 5;
svga->hblank_end_val = ((svga->crtc[3] & 0x1f) | ((svga->crtc[5] & 0x80) ? 0x20 : 0x00)) | (svga->crtc[0x3c] & 0b11000000);
svga->hblank_end_mask = 0xff;
@@ -980,7 +982,7 @@ chips_69000_process_pixel(chips_69000_t* chips, uint32_t pixel)
if (!!(color_key == dest_pixel) == !!(chips->bitblt_running.bitblt.bitblt_control & (1 << 16))) {
return;
}
break;
}
}
@@ -1018,7 +1020,7 @@ chips_69000_process_pixel(chips_69000_t* chips, uint32_t pixel)
if (!!(color_key == dest_pixel) == !!(chips->bitblt_running.bitblt.bitblt_control & (1 << 16))) {
return;
}
break;
}
}
@@ -1191,7 +1193,7 @@ chips_69000_setup_bitblt(chips_69000_t* chips)
chips->bitblt_running.mono_bytes_pitch = ((chips->bitblt_running.actual_destination_width + chips->bitblt_running.bitblt.monochrome_source_left_clip + 63) & ~63) / 8;
}
}
return;
}
@@ -1273,7 +1275,7 @@ chips_69000_setup_bitblt(chips_69000_t* chips)
do {
uint32_t pixel = 0;
uint32_t source_addr = chips->bitblt_running.bitblt.source_addr + (chips->bitblt_running.y * chips->bitblt.source_span) + (chips->bitblt_running.x * chips->bitblt_running.bytes_per_pixel);
switch (chips->bitblt_running.bytes_per_pixel) {
case 1: /* 8 bits-per-pixel. */
{
@@ -1423,7 +1425,7 @@ chips_69000_bitblt_write(chips_69000_t* chips, uint8_t data) {
source_pixel |= (chips->bitblt_running.bytes_port[1] << 8);
if (chips->bitblt_running.bytes_per_pixel >= 3)
source_pixel |= (chips->bitblt_running.bytes_port[2] << 16);
chips->bitblt_running.bytes_in_line_written += chips->bitblt_running.bytes_per_pixel;
chips_69000_process_pixel(chips, source_pixel);
@@ -1446,7 +1448,7 @@ chips_69000_bitblt_write(chips_69000_t* chips, uint8_t data) {
chips->bitblt_running.count_x = 0;
chips->bitblt_running.x = 0;
if (chips->bitblt_running.count_y >= chips->bitblt_running.actual_destination_height) {
chips_69000_bitblt_interrupt(chips);
return;
@@ -1498,7 +1500,7 @@ chips_69000_read_ext_reg(chips_69000_t* chips)
val = chips->ext_regs[index];
if (!(chips->ext_regs[0x62] & 0x8))
val = (val & ~8) | (i2c_gpio_get_scl(chips->i2c) << 3);
if (!(chips->ext_regs[0x62] & 0x4))
val = (val & ~4) | (i2c_gpio_get_sda(chips->i2c) << 2);
@@ -1561,12 +1563,12 @@ chips_69000_write_ext_reg(chips_69000_t* chips, uint8_t val)
scl = !!(val & 8);
else
scl = i2c_gpio_get_scl(chips->i2c);
if (chips->ext_regs[0x62] & 0x4)
sda = !!(val & 4);
else
scl = i2c_gpio_get_sda(chips->i2c);
i2c_gpio_set(chips->i2c, scl, sda);
chips->ext_regs[chips->ext_index] = val & 0x9F;
@@ -1742,7 +1744,7 @@ chips_69000_out(uint16_t addr, uint8_t val, void *p)
case 0x3B7:
case 0x3D7:
return chips_69000_write_ext_reg(chips, val);
}
svga_out(addr, val, svga);
}
@@ -1901,17 +1903,15 @@ chips_69000_pci_write(int func, int addr, uint8_t val, void *p)
if (chips->pci_conf_status & PCI_COMMAND_MEM) {
mem_mapping_enable(&chips->svga.mapping);
if (chips->linear_mapping.base)
mem_mapping_enable(&chips->linear_mapping);
mem_mapping_set_addr(&chips->linear_mapping, chips->linear_mapping.base, (1 << 24));
}
break;
}
case 0x13:
{
if (!chips->linear_mapping.enable) {
chips->linear_mapping.base = val << 24;
break;
}
mem_mapping_set_addr(&chips->linear_mapping, val << 24, (1 << 24));
chips->linear_mapping.base = val << 24;
if (chips->linear_mapping.base)
mem_mapping_set_addr(&chips->linear_mapping, chips->linear_mapping.base, (1 << 24));
break;
}
case 0x3c:
@@ -2093,7 +2093,7 @@ chips_69000_writeb_mmio(uint32_t addr, uint8_t val, chips_69000_t* chips)
chips->mem_regs_b[addr & 0xF] = val;
break;
}
}
chips->mem_regs_b[addr & 0xF] = val;
break;
@@ -2213,7 +2213,7 @@ chips_69000_readw_linear(uint32_t addr, void *p)
if (addr & 0x800000) {
if (addr & 0x400000)
return bswap16(chips_69000_readw_mmio(addr, chips));
return bswap16(svga_readw_linear(addr & 0x1FFFFF, p));
}
@@ -2232,7 +2232,7 @@ chips_69000_readl_linear(uint32_t addr, void *p)
if (addr & 0x800000) {
if (addr & 0x400000)
return bswap32(chips_69000_readl_mmio(addr, chips));
return bswap32(svga_readl_linear(addr & 0x1FFFFF, p));
}
@@ -2290,7 +2290,7 @@ chips_69000_vblank_start(svga_t *svga)
chips_69000_t *chips = (chips_69000_t *) svga->priv;
chips->mem_regs[1] |= 1 << 14;
chips->svga.crtc[0x40] &= ~0x80;
chips_69000_interrupt(chips);
}
@@ -2307,13 +2307,13 @@ chips_69000_hwcursor_draw_64x64(svga_t *svga, int displine)
dat[1] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr]));
dat[0] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr + 8]));
svga->hwcursor_latch.addr += 16;
for (uint8_t x = 0; x < 64; x++) {
if (!(dat[1] & (1ULL << 63)))
svga->monitor->target_buffer->line[displine][(offset + svga->x_add) & 2047] = (dat[0] & (1ULL << 63)) ? svga_lookup_lut_ram(svga, chips->cursor_pallook[5]) : svga_lookup_lut_ram(svga, chips->cursor_pallook[4]);
else if (dat[0] & (1ULL << 63))
svga->monitor->target_buffer->line[displine][(offset + svga->x_add) & 2047] ^= 0xffffff;
offset++;
dat[0] <<= 1;
dat[1] <<= 1;
@@ -2430,14 +2430,48 @@ chips_69000_line_compare(svga_t* svga)
if (chips->ext_regs[0x81] & 0xF) {
return 0;
}
return 1;
}
static void
chips_69000_disable_handlers(chips_69000_t *chips)
{
io_removehandler(0x03c0, 0x0020, chips_69000_in, NULL, NULL, chips_69000_out, NULL, NULL, chips);
mem_mapping_disable(&chips->linear_mapping);
mem_mapping_disable(&chips->svga.mapping);
if (!chips->on_board)
mem_mapping_disable(&chips->bios_rom.mapping);
/* Save all the mappings and the timers because they are part of linked lists. */
reset_state->linear_mapping = chips->linear_mapping;
reset_state->svga.mapping = chips->svga.mapping;
reset_state->bios_rom.mapping = chips->bios_rom.mapping;
reset_state->decrement_timer = chips->decrement_timer;
reset_state->svga.timer = chips->svga.timer;
reset_state->svga.timer8514 = chips->svga.timer8514;
}
static void
chips_69000_reset(void *priv)
{
chips_69000_t *chips = (chips_69000_t *) priv;
if (reset_state != NULL) {
chips_69000_disable_handlers(chips);
reset_state->slot = chips->slot;
*chips = *reset_state;
}
}
static void *
chips_69000_init(const device_t *info)
{
chips_69000_t *chips = calloc(1, sizeof(chips_69000_t));
reset_state = calloc(1, sizeof(chips_69000_t));
/* Appears to have an odd VBIOS size. */
if (!info->local) {
@@ -2450,7 +2484,7 @@ chips_69000_init(const device_t *info)
svga_init(info, &chips->svga, chips, 1 << 21, /*2048kb*/
chips_69000_recalctimings,
chips_69000_in, chips_69000_out,
NULL,
chips_69000_hwcursor_draw,
NULL);
io_sethandler(0x03c0, 0x0020, chips_69000_in, NULL, NULL, chips_69000_out, NULL, NULL, chips);
@@ -2459,9 +2493,7 @@ chips_69000_init(const device_t *info)
chips->svga.bpp = 8;
chips->svga.miscout = 1;
chips->svga.recalctimings_ex = chips_69000_recalctimings;
chips->svga.vblank_start = chips_69000_vblank_start;
chips->svga.hwcursor_draw = chips_69000_hwcursor_draw;
chips->svga.getclock = chips_69000_getclock;
chips->svga.conv_16to32 = chips_69000_conv_16to32;
chips->svga.line_compare = chips_69000_line_compare;
@@ -2471,7 +2503,7 @@ chips_69000_init(const device_t *info)
chips->quit = 0;
chips->engine_active = 0;
chips->on_board = !!(info->local);
chips->svga.packed_chain4 = 1;
timer_add(&chips->decrement_timer, chips_69000_decrement_timer, chips, 0);
@@ -2479,9 +2511,11 @@ chips_69000_init(const device_t *info)
chips->i2c = i2c_gpio_init("ddc_chips_69000");
chips->ddc = ddc_init(i2c_gpio_get_bus(chips->i2c));
chips->flat_panel_regs[0x01] = 1;
*reset_state = *chips;
return chips;
}
@@ -2503,6 +2537,9 @@ chips_69000_close(void *p)
i2c_gpio_close(chips->i2c);
svga_close(&chips->svga);
free(reset_state);
reset_state = NULL;
free(chips);
}
@@ -2519,7 +2556,7 @@ chips_69000_force_redraw(void *p)
{
chips_69000_t *chips = (chips_69000_t *) p;
chips->svga.fullchange = changeframecount;
chips->svga.fullchange = chips->svga.monitor->mon_changeframecount;
}
const device_t chips_69000_device = {
@@ -2529,7 +2566,7 @@ const device_t chips_69000_device = {
.local = 0,
.init = chips_69000_init,
.close = chips_69000_close,
.reset = NULL,
.reset = chips_69000_reset,
{ .available = chips_69000_available },
.speed_changed = chips_69000_speed_changed,
.force_redraw = chips_69000_force_redraw,
@@ -2543,7 +2580,7 @@ const device_t chips_69000_onboard_device = {
.local = 1,
.init = chips_69000_init,
.close = chips_69000_close,
.reset = NULL,
.reset = chips_69000_reset,
{ .available = chips_69000_available },
.speed_changed = chips_69000_speed_changed,
.force_redraw = chips_69000_force_redraw,

View File

@@ -47,38 +47,11 @@ static video_timings_t timing_default = { .type = VIDEO_ISA, .write_b = 8, .writ
static int was_reset = 0;
static const device_t vid_none_device = {
.name = "None",
.internal_name = "none",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const device_t vid_internal_device = {
.name = "Internal",
.internal_name = "internal",
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
static const VIDEO_CARD
video_cards[] = {
// clang-format off
{ &vid_none_device },
{ &vid_internal_device },
{ &device_none },
{ &device_internal },
{ &atiega800p_device },
{ &mach8_vga_isa_device, VIDEO_FLAG_TYPE_8514 },
{ &mach32_isa_device, VIDEO_FLAG_TYPE_8514 },
@@ -349,12 +322,14 @@ video_reset(int card)
monitor_index_global = 0;
loadfont("roms/video/mda/mda.rom", 0);
if ((card != VID_NONE) && !machine_has_flags(machine, MACHINE_VIDEO_ONLY) &&
(gfxcard[1] > VID_INTERNAL) && device_is_valid(video_card_getdevice(gfxcard[1]), machine)) {
video_monitor_init(1);
monitor_index_global = 1;
device_add(video_cards[gfxcard[1]].device);
monitor_index_global = 0;
for (uint8_t i = 1; i < GFXCARD_MAX; i ++) {
if ((card != VID_NONE) && !machine_has_flags(machine, MACHINE_VIDEO_ONLY) &&
(gfxcard[i] > VID_INTERNAL) && device_is_valid(video_card_getdevice(gfxcard[i]), machine)) {
video_monitor_init(i);
monitor_index_global = 1;
device_add(video_cards[gfxcard[i]].device);
monitor_index_global = 0;
}
}
/* Do not initialize internal cards here. */