mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 12:55:32 -07:00
Make dual video card code use array
This commit is contained in:
@@ -2474,9 +2474,9 @@ machine_amstrad_init(const machine_t *model, int type)
|
||||
|
||||
ams->language = 7;
|
||||
|
||||
video_reset(gfxcard);
|
||||
video_reset(gfxcard[0]);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
switch (type) {
|
||||
case AMS_PC1512:
|
||||
loadfont("roms/machines/pc1512/40078", 8);
|
||||
|
||||
@@ -114,7 +114,7 @@ machine_at_ama932j_init(const machine_t *model)
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&oti067_ama932j_device);
|
||||
|
||||
machine_at_headland_common_init(2);
|
||||
@@ -420,7 +420,7 @@ machine_at_spc4620p_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ati28800k_spc4620p_device);
|
||||
|
||||
machine_at_scat_init(model, 1, 1);
|
||||
@@ -527,7 +527,7 @@ machine_at_wd76c10_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(¶dise_wd90c11_megapc_device);
|
||||
|
||||
device_add(&keyboard_ps2_quadtel_device);
|
||||
@@ -591,7 +591,7 @@ machine_at_cmdsl386sx25_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&gd5402_onboard_device);
|
||||
|
||||
machine_at_scamp_common_init(model, 1);
|
||||
@@ -626,7 +626,7 @@ machine_at_spc6033p_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ati28800k_spc6033p_device);
|
||||
|
||||
machine_at_scamp_common_init(model, 1);
|
||||
@@ -711,7 +711,7 @@ machine_at_flytech386_init(const machine_t *model)
|
||||
device_add(&ali1217_device);
|
||||
device_add(&w83787f_ide_en_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&tvga8900d_device);
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
@@ -833,7 +833,7 @@ machine_at_3302_init(const machine_t *model)
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(¶dise_pvga1a_ncr3302_device);
|
||||
|
||||
device_add(&keyboard_at_ncr_device);
|
||||
|
||||
@@ -168,7 +168,7 @@ machine_at_valuepoint433_init(const machine_t *model) // hangs without the PS/2
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
device_add(&sis_85c461_device);
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&et4000w32_onboard_device);
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
@@ -310,7 +310,7 @@ machine_at_pb410a_init(const machine_t *model)
|
||||
|
||||
device_add(&phoenix_486_jumper_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ht216_32_pb410a_device);
|
||||
|
||||
return ret;
|
||||
@@ -331,7 +331,7 @@ machine_at_vect486vl_init(const machine_t *model) // has HDC problems
|
||||
|
||||
device_add(&vl82c480_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&gd5428_onboard_device);
|
||||
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
@@ -355,7 +355,7 @@ machine_at_d824_init(const machine_t *model)
|
||||
|
||||
device_add(&vl82c480_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&gd5428_onboard_device);
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
@@ -378,7 +378,7 @@ machine_at_acera1g_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
device_add(&ali1429g_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&gd5428_onboard_device);
|
||||
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
@@ -428,7 +428,7 @@ machine_at_decpclpv_init(const machine_t *model)
|
||||
|
||||
device_add(&sis_85c461_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&s3_86c805_onboard_vlb_device);
|
||||
|
||||
/* TODO: Phoenix MultiKey KBC */
|
||||
@@ -1365,7 +1365,7 @@ machine_at_sbc490_init(const machine_t *model)
|
||||
device_add(&ali1489_device);
|
||||
device_add(&fdc37c665_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&tgui9440_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
|
||||
@@ -787,21 +787,21 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
write_ram, write_ramw, write_raml,
|
||||
0xa0000 + ram, MEM_MAPPING_INTERNAL, NULL);
|
||||
|
||||
video_reset(gfxcard);
|
||||
video_reset(gfxcard[0]);
|
||||
|
||||
switch (type) {
|
||||
case COMPAQ_PORTABLEII:
|
||||
break;
|
||||
|
||||
case COMPAQ_PORTABLEIII:
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&compaq_plasma_device);
|
||||
break;
|
||||
|
||||
case COMPAQ_PORTABLEIII386:
|
||||
if (hdc_current == 1)
|
||||
device_add(&ide_isa_device);
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&compaq_plasma_device);
|
||||
break;
|
||||
|
||||
|
||||
@@ -663,7 +663,7 @@ machine_at_ms6168_common_init(const machine_t *model)
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977ef_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&voodoo_3_2000_agp_onboard_8m_device);
|
||||
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
|
||||
@@ -345,7 +345,7 @@ machine_at_pb520r_init(const machine_t *model)
|
||||
device_add(&i430lx_device);
|
||||
device_add(&ide_cmd640_pci_single_channel_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&gd5434_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
|
||||
@@ -398,7 +398,7 @@ machine_at_presario2240_init(const machine_t *model)
|
||||
pci_register_slot(0x14, PCI_CARD_VIDEO, 3, 0, 0, 0);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&s3_trio64v2_dx_onboard_pci_device);
|
||||
|
||||
device_add(&i430vx_device);
|
||||
@@ -429,7 +429,7 @@ machine_at_presario4500_init(const machine_t *model)
|
||||
pci_register_slot(0x14, PCI_CARD_VIDEO, 3, 0, 0, 0);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&s3_trio64v2_dx_onboard_pci_device);
|
||||
|
||||
device_add(&i430vx_device);
|
||||
|
||||
@@ -58,7 +58,7 @@ machine_at_thor_common_init(const machine_t *model, int mr)
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 3, 2, 1);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&s3_phoenix_trio64vplus_onboard_pci_device);
|
||||
|
||||
// device_add(&keyboard_ps2_ami_pci_device);
|
||||
@@ -222,7 +222,7 @@ machine_at_endeavor_init(const machine_t *model)
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&s3_phoenix_trio64_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
@@ -286,7 +286,7 @@ machine_at_pb640_init(const machine_t *model)
|
||||
device_add(&i430fx_rev02_device);
|
||||
device_add(&piix_rev02_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&gd5440_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
@@ -616,7 +616,7 @@ machine_at_vectra54_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&s3_phoenix_trio64_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
|
||||
@@ -178,7 +178,7 @@ machine_elt_init(const machine_t *model)
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL) {
|
||||
if (gfxcard[0] == VID_INTERNAL) {
|
||||
cga = device_add(&cga_device);
|
||||
io_removehandler(0x03d0, 0x0010, cga_in, NULL, NULL, cga_out, NULL, NULL, cga);
|
||||
io_sethandler(0x03d0, 0x0010, elt_vid_in, NULL, NULL, elt_vid_out, NULL, NULL, cga);
|
||||
|
||||
@@ -549,7 +549,7 @@ europc_boot(const device_t *info)
|
||||
* with values set by the user.
|
||||
*/
|
||||
b = (sys->nvr.regs[MRTC_CONF_D] & ~0x17);
|
||||
video_reset(gfxcard);
|
||||
video_reset(gfxcard[0]);
|
||||
if (video_is_cga())
|
||||
b |= 0x12; /* external video, CGA80 */
|
||||
else if (video_is_mda())
|
||||
|
||||
@@ -781,7 +781,7 @@ machine_pcjr_init(const machine_t *model)
|
||||
cpu_set();
|
||||
|
||||
/* Initialize the video controller. */
|
||||
video_reset(gfxcard);
|
||||
video_reset(gfxcard[0]);
|
||||
loadfont("roms/video/mda/mda.rom", 0);
|
||||
mem_mapping_add(&pcjr->mapping, 0xb8000, 0x08000,
|
||||
vid_read, NULL, NULL,
|
||||
|
||||
@@ -300,7 +300,7 @@ ps1_setup(int model)
|
||||
0xfc0000, 0x40000, 0x3ffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
/* Initialize the video controller. */
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ibm_ps1_2121_device);
|
||||
|
||||
device_add(&fdc_at_ps1_device);
|
||||
|
||||
@@ -950,7 +950,7 @@ ps2_mca_board_model_50_init(int slots)
|
||||
ps2_mca_mem_fffc_init(2);
|
||||
}
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ps1vga_mca_device);
|
||||
}
|
||||
|
||||
@@ -1008,7 +1008,7 @@ ps2_mca_board_model_55sx_init(int has_sec_nvram, int slots)
|
||||
ps2.planar_read = model_55sx_read;
|
||||
ps2.planar_write = model_55sx_write;
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ps1vga_mca_device);
|
||||
|
||||
model_55sx_mem_recalc();
|
||||
@@ -1244,7 +1244,7 @@ ps2_mca_board_model_70_type34_init(int is_type4, int slots)
|
||||
}
|
||||
}
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ps1vga_mca_device);
|
||||
}
|
||||
|
||||
@@ -1318,7 +1318,7 @@ ps2_mca_board_model_80_type2_init(int is486)
|
||||
}
|
||||
}
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ps1vga_mca_device);
|
||||
|
||||
ps2.split_size = 0;
|
||||
|
||||
@@ -1437,7 +1437,7 @@ machine_tandy1k_init(const machine_t *model, int type)
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_tandy_device);
|
||||
|
||||
video_reset(gfxcard);
|
||||
video_reset(gfxcard[0]);
|
||||
|
||||
switch (type) {
|
||||
case TYPE_TANDY:
|
||||
|
||||
@@ -90,7 +90,7 @@ machine_v86p_init(const machine_t *model)
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&f82c425_video_device);
|
||||
|
||||
if (hdc_current <= 1)
|
||||
|
||||
@@ -1807,9 +1807,9 @@ machine_xt_m24_init(const machine_t *model)
|
||||
|
||||
mm58174_init(nvr, model->nvrmask + 1);
|
||||
|
||||
video_reset(gfxcard);
|
||||
video_reset(gfxcard[0]);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&ogc_m24_device);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
@@ -1919,7 +1919,7 @@ machine_xt_m19_init(const machine_t *model)
|
||||
|
||||
nmi_init();
|
||||
|
||||
video_reset(gfxcard);
|
||||
video_reset(gfxcard[0]);
|
||||
|
||||
m19_vid_init(vid);
|
||||
device_add_ex(&m19_vid_device, vid);
|
||||
|
||||
@@ -897,7 +897,7 @@ machine_xt_t1000_init(const machine_t *model)
|
||||
t1000_nvr_load();
|
||||
nvr_set_ven_save(t1000_nvr_save);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&t1000_video_device);
|
||||
|
||||
return ret;
|
||||
@@ -957,7 +957,7 @@ machine_xt_t1200_init(const machine_t *model)
|
||||
t1200_nvr_load();
|
||||
nvr_set_ven_save(t1200_nvr_save);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&t1200_video_device);
|
||||
|
||||
if (hdc_current <= 1)
|
||||
|
||||
@@ -96,7 +96,7 @@ machine_init_ex(int m)
|
||||
|
||||
/* Prepare some video-related things if we're using internal
|
||||
or no video. */
|
||||
video_pre_reset(gfxcard);
|
||||
video_pre_reset(gfxcard[0]);
|
||||
|
||||
/* Reset any ISA memory cards. */
|
||||
isamem_reset();
|
||||
@@ -112,7 +112,7 @@ machine_init_ex(int m)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (gfxcard != VID_NONE) {
|
||||
if (gfxcard[0] != VID_NONE) {
|
||||
if (ibm8514_enabled) {
|
||||
ibm8514_device_add();
|
||||
}
|
||||
@@ -122,7 +122,7 @@ machine_init_ex(int m)
|
||||
|
||||
/* Reset the graphics card (or do nothing if it was already done
|
||||
by the machine's init function). */
|
||||
video_reset(gfxcard);
|
||||
video_reset(gfxcard[0]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user