Removed the "legacy ID" mess from the video code;

Removed obsolete compatibility stuff from config.c;
Removed the useless gfx_present array.
This commit is contained in:
OBattler
2018-09-19 20:46:42 +02:00
parent 69b57c49b0
commit c7a331a903
6 changed files with 116 additions and 320 deletions

View File

@@ -8,7 +8,7 @@
*
* Define all known video cards.
*
* Version: @(#)vid_table.c 1.0.37 2018/09/19
* Version: @(#)vid_table.c 1.0.38 2018/09/19
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -64,7 +64,6 @@ typedef struct {
const char *name;
const char *internal_name;
const device_t *device;
int legacy_id;
} VIDEO_CARD;
@@ -72,99 +71,99 @@ static video_timings_t timing_default = {VIDEO_ISA, 8, 16, 32, 8, 16, 32};
static const VIDEO_CARD
video_cards[] = {
{ "None", "none", NULL, VID_NONE },
{ "Internal", "internal", NULL, VID_INTERNAL },
{ "[ISA] ATI Graphics Pro Turbo (Mach64 GX)", "mach64gx_isa", &mach64gx_isa_device, VID_MACH64GX_ISA },
{ "[ISA] ATI Korean VGA (ATI-28800-5)", "ati28800k", &ati28800k_device, VID_ATIKOREANVGA },
{ "[ISA] ATI VGA-88 (ATI-18800-1)", "ati18800v", &ati18800_vga88_device, VID_VGA88 },
{ "[ISA] ATI VGA Charger (ATI-28800-5)", "ati28800", &ati28800_device, VID_VGACHARGER },
{ "[ISA] ATI VGA Edge-16 (ATI-18800-5)", "ati18800", &ati18800_device, VID_VGAEDGE16 },
{ "None", "none", NULL },
{ "Internal", "internal", NULL },
{ "[ISA] ATI Graphics Pro Turbo (Mach64 GX)", "mach64gx_isa", &mach64gx_isa_device },
{ "[ISA] ATI Korean VGA (ATI-28800-5)", "ati28800k", &ati28800k_device },
{ "[ISA] ATI VGA-88 (ATI-18800-1)", "ati18800v", &ati18800_vga88_device },
{ "[ISA] ATI VGA Charger (ATI-28800-5)", "ati28800", &ati28800_device },
{ "[ISA] ATI VGA Edge-16 (ATI-18800-5)", "ati18800", &ati18800_device },
#if defined(DEV_BRANCH) && defined(USE_VGAWONDER)
{ "[ISA] ATI VGA Wonder (ATI-18800)", "ati18800w", &ati18800_wonder_device, VID_VGAWONDER },
{ "[ISA] ATI VGA Wonder (ATI-18800)", "ati18800w", &ati18800_wonder_device },
#endif
#if defined(DEV_BRANCH) && defined(USE_XL24)
{ "[ISA] ATI VGA Wonder XL24 (ATI-28800-6)", "ati28800w", &ati28800_wonderxl24_device, VID_VGAWONDERXL24 },
{ "[ISA] ATI VGA Wonder XL24 (ATI-28800-6)", "ati28800w", &ati28800_wonderxl24_device },
#endif
{ "[ISA] CGA", "cga", &cga_device, VID_CGA },
{ "[ISA] Chips & Technologies SuperEGA", "superega", &sega_device, VID_SUPER_EGA },
{ "[ISA] Cirrus Logic CL-GD 5428", "cl_gd5428_isa", &gd5428_isa_device, VID_CL_GD5428_ISA },
{ "[ISA] Cirrus Logic CL-GD 5429", "cl_gd5429_isa", &gd5429_isa_device, VID_CL_GD5429_ISA },
{ "[ISA] Cirrus Logic CL-GD 5434", "cl_gd5434_isa", &gd5434_isa_device, VID_CL_GD5434_ISA },
{ "[ISA] Compaq ATI VGA Wonder XL (ATI-28800-5)", "compaq_ati28800", &compaq_ati28800_device, VID_VGAWONDERXL },
{ "[ISA] Compaq CGA", "compaq_cga", &compaq_cga_device, VID_COMPAQ_CGA },
{ "[ISA] Compaq CGA 2", "compaq_cga_2", &compaq_cga_2_device, VID_COMPAQ_CGA_2 },
{ "[ISA] Compaq EGA", "compaq_ega", &cpqega_device, VID_COMPAQ_EGA },
{ "[ISA] EGA", "ega", &ega_device, VID_EGA },
{ "[ISA] Hercules", "hercules", &hercules_device, VID_HERCULES },
{ "[ISA] Hercules Plus", "hercules_plus", &herculesplus_device, VID_HERCULESPLUS },
{ "[ISA] Hercules InColor", "incolor", &incolor_device, VID_INCOLOR },
{ "[ISA] MDA", "mda", &mda_device, VID_MDA },
{ "[ISA] MDSI Genius", "genius", &genius_device, VID_GENIUS },
{ "[ISA] OAK OTI-037C", "oti037c", &oti037c_device, VID_OTI037C },
{ "[ISA] OAK OTI-067", "oti067", &oti067_device, VID_OTI067 },
{ "[ISA] OAK OTI-077", "oti077", &oti077_device, VID_OTI077 },
{ "[ISA] Paradise PVGA1A", "pvga1a", &paradise_pvga1a_device, VID_PVGA1A },
{ "[ISA] Paradise WD90C11-LR", "wd90c11", &paradise_wd90c11_device, VID_WD90C11 },
{ "[ISA] Paradise WD90C30-LR", "wd90c30", &paradise_wd90c30_device, VID_WD90C30 },
{ "[ISA] Plantronics ColorPlus", "plantronics", &colorplus_device, VID_COLORPLUS },
{ "[ISA] CGA", "cga", &cga_device },
{ "[ISA] Chips & Technologies SuperEGA", "superega", &sega_device },
{ "[ISA] Cirrus Logic CL-GD 5428", "cl_gd5428_isa", &gd5428_isa_device },
{ "[ISA] Cirrus Logic CL-GD 5429", "cl_gd5429_isa", &gd5429_isa_device },
{ "[ISA] Cirrus Logic CL-GD 5434", "cl_gd5434_isa", &gd5434_isa_device },
{ "[ISA] Compaq ATI VGA Wonder XL (ATI-28800-5)", "compaq_ati28800", &compaq_ati28800_device },
{ "[ISA] Compaq CGA", "compaq_cga", &compaq_cga_device },
{ "[ISA] Compaq CGA 2", "compaq_cga_2", &compaq_cga_2_device },
{ "[ISA] Compaq EGA", "compaq_ega", &cpqega_device },
{ "[ISA] EGA", "ega", &ega_device },
{ "[ISA] Hercules", "hercules", &hercules_device },
{ "[ISA] Hercules Plus", "hercules_plus", &herculesplus_device },
{ "[ISA] Hercules InColor", "incolor", &incolor_device },
{ "[ISA] MDA", "mda", &mda_device },
{ "[ISA] MDSI Genius", "genius", &genius_device },
{ "[ISA] OAK OTI-037C", "oti037c", &oti037c_device },
{ "[ISA] OAK OTI-067", "oti067", &oti067_device },
{ "[ISA] OAK OTI-077", "oti077", &oti077_device },
{ "[ISA] Paradise PVGA1A", "pvga1a", &paradise_pvga1a_device },
{ "[ISA] Paradise WD90C11-LR", "wd90c11", &paradise_wd90c11_device },
{ "[ISA] Paradise WD90C30-LR", "wd90c30", &paradise_wd90c30_device },
{ "[ISA] Plantronics ColorPlus", "plantronics", &colorplus_device },
#if defined(DEV_BRANCH) && defined(USE_TI)
{ "[ISA] TI CF62011 SVGA", "ti_cf62011", &ti_cf62011_device, VID_TICF62011 },
{ "[ISA] TI CF62011 SVGA", "ti_cf62011", &ti_cf62011_device },
#endif
{"[ISA] Trident TVGA8900D", "tvga8900d", &tvga8900d_device, VID_TVGA },
{"[ISA] Trigem Korean VGA (ET4000AX)", "tgkorvga", &et4000k_isa_device, VID_TGKOREANVGA },
{"[ISA] Tseng ET4000AX", "et4000ax", &et4000_isa_device, VID_ET4000_ISA },
{"[ISA] VGA", "vga", &vga_device, VID_VGA },
{"[ISA] Wyse 700", "wy700", &wy700_device, VID_WY700 },
{"[MCA] Tseng ET4000AX", "et4000mca", &et4000_mca_device, VID_ET4000_MCA },
{"[PCI] ATI Graphics Pro Turbo (Mach64 GX)", "mach64gx_pci", &mach64gx_pci_device, VID_MACH64GX_PCI },
{"[PCI] ATI Video Xpression (Mach64 VT2)", "mach64vt2", &mach64vt2_device, VID_MACH64VT2 },
{"[PCI] Cardex Tseng ET4000/w32p", "et4000w32p_pci", &et4000w32p_cardex_pci_device, VID_ET4000W32_CARDEX_PCI },
{"[PCI] Cirrus Logic CL-GD 5430", "cl_gd5430_pci", &gd5430_pci_device, VID_CL_GD5430_PCI },
{"[PCI] Cirrus Logic CL-GD 5434", "cl_gd5434_pci", &gd5434_pci_device, VID_CL_GD5434_PCI },
{"[PCI] Cirrus Logic CL-GD 5436", "cl_gd5436_pci", &gd5436_pci_device, VID_CL_GD5436_PCI },
{"[PCI] Cirrus Logic CL-GD 5440", "cl_gd5440_pci", &gd5440_pci_device, VID_CL_GD5440_PCI },
{"[PCI] Cirrus Logic CL-GD 5446", "cl_gd5446_pci", &gd5446_pci_device, VID_CL_GD5446_PCI },
{"[PCI] Cirrus Logic CL-GD 5480", "cl_gd5480_pci", &gd5480_pci_device, VID_CL_GD5480_PCI },
{"[ISA] Trident TVGA8900D", "tvga8900d", &tvga8900d_device },
{"[ISA] Trigem Korean VGA (ET4000AX)", "tgkorvga", &et4000k_isa_device },
{"[ISA] Tseng ET4000AX", "et4000ax", &et4000_isa_device },
{"[ISA] VGA", "vga", &vga_device },
{"[ISA] Wyse 700", "wy700", &wy700_device },
{"[MCA] Tseng ET4000AX", "et4000mca", &et4000_mca_device },
{"[PCI] ATI Graphics Pro Turbo (Mach64 GX)", "mach64gx_pci", &mach64gx_pci_device },
{"[PCI] ATI Video Xpression (Mach64 VT2)", "mach64vt2", &mach64vt2_device },
{"[PCI] Cardex Tseng ET4000/w32p", "et4000w32p_pci", &et4000w32p_cardex_pci_device },
{"[PCI] Cirrus Logic CL-GD 5430", "cl_gd5430_pci", &gd5430_pci_device, },
{"[PCI] Cirrus Logic CL-GD 5434", "cl_gd5434_pci", &gd5434_pci_device },
{"[PCI] Cirrus Logic CL-GD 5436", "cl_gd5436_pci", &gd5436_pci_device },
{"[PCI] Cirrus Logic CL-GD 5440", "cl_gd5440_pci", &gd5440_pci_device },
{"[PCI] Cirrus Logic CL-GD 5446", "cl_gd5446_pci", &gd5446_pci_device },
{"[PCI] Cirrus Logic CL-GD 5480", "cl_gd5480_pci", &gd5480_pci_device },
#if defined(DEV_BRANCH) && defined(USE_STEALTH32)
{"[PCI] Diamond Stealth 32 (Tseng ET4000/w32p)", "stealth32_pci", &et4000w32p_pci_device, VID_ET4000W32_PCI },
{"[PCI] Diamond Stealth 32 (Tseng ET4000/w32p)", "stealth32_pci", &et4000w32p_pci_device },
#endif
{"[PCI] Diamond Stealth 3D 2000 (S3 ViRGE)", "stealth3d_2000_pci", &s3_virge_pci_device, VID_VIRGE_PCI },
{"[PCI] Diamond Stealth 3D 3000 (S3 ViRGE/VX)", "stealth3d_3000_pci", &s3_virge_988_pci_device, VID_VIRGEVX_PCI },
{"[PCI] Diamond Stealth 64 DRAM (S3 Trio64)", "stealth64d_pci", &s3_diamond_stealth64_pci_device, VID_STEALTH64_PCI },
{"[PCI] ExpertColor DSV3868P CF55 (S3 Vision868)", "expertcolor_pci", &s3_expertcolor_pci_device, VID_EXPERTCOLOR_PCI },
{"[PCI] Number Nine 9FX (S3 Trio64)", "n9_9fx_pci", &s3_9fx_pci_device, VID_N9_9FX_PCI },
{"[PCI] Paradise Bahamas 64 (S3 Vision864)", "bahamas64_pci", &s3_bahamas64_pci_device, VID_BAHAMAS64_PCI },
{"[PCI] Phoenix S3 Vision864", "px_vision864_pci", &s3_phoenix_vision864_pci_device, VID_PHOENIX_VISION864_PCI },
{"[PCI] Phoenix S3 Trio32", "px_trio32_pci", &s3_phoenix_trio32_pci_device, VID_PHOENIX_TRIO32_PCI },
{"[PCI] Phoenix S3 Trio64", "px_trio64_pci", &s3_phoenix_trio64_pci_device, VID_PHOENIX_TRIO64_PCI },
{"[PCI] S3 ViRGE/DX", "virge375_pci", &s3_virge_375_pci_device, VID_VIRGEDX_PCI },
{"[PCI] S3 ViRGE/DX (VBE 2.0)", "virge375_vbe20_pci", &s3_virge_375_4_pci_device, VID_VIRGEDX4_PCI },
{"[PCI] STB Nitro 64V (CL-GD 5446)", "cl_gd5446_stb_pci", &gd5446_stb_pci_device, VID_CL_GD5446_STB_PCI },
{"[PCI] Trident TGUI9440", "tgui9440_pci", &tgui9440_pci_device, VID_TGUI9440_PCI },
{"[VLB] ATI Graphics Pro Turbo (Mach64 GX)", "mach64gx_vlb", &mach64gx_vlb_device, VID_MACH64GX_VLB },
{"[VLB] Cardex Tseng ET4000/w32p", "et4000w32p_vlb", &et4000w32p_cardex_vlb_device, VID_ET4000W32_CARDEX_VLB },
{"[VLB] Cirrus Logic CL-GD 5428", "cl_gd5428_vlb", &gd5428_vlb_device, VID_CL_GD5428_VLB },
{"[VLB] Cirrus Logic CL-GD 5429", "cl_gd5429_vlb", &gd5429_vlb_device, VID_CL_GD5429_VLB },
{"[VLB] Cirrus Logic CL-GD 5434", "cl_gd5434_vlb", &gd5434_vlb_device, VID_CL_GD5434_VLB },
{"[PCI] Diamond Stealth 3D 2000 (S3 ViRGE)", "stealth3d_2000_pci", &s3_virge_pci_device },
{"[PCI] Diamond Stealth 3D 3000 (S3 ViRGE/VX)", "stealth3d_3000_pci", &s3_virge_988_pci_device },
{"[PCI] Diamond Stealth 64 DRAM (S3 Trio64)", "stealth64d_pci", &s3_diamond_stealth64_pci_device },
{"[PCI] ExpertColor DSV3868P CF55 (S3 Vision868)", "expertcolor_pci", &s3_expertcolor_pci_device },
{"[PCI] Number Nine 9FX (S3 Trio64)", "n9_9fx_pci", &s3_9fx_pci_device },
{"[PCI] Paradise Bahamas 64 (S3 Vision864)", "bahamas64_pci", &s3_bahamas64_pci_device },
{"[PCI] Phoenix S3 Vision864", "px_vision864_pci", &s3_phoenix_vision864_pci_device },
{"[PCI] Phoenix S3 Trio32", "px_trio32_pci", &s3_phoenix_trio32_pci_device },
{"[PCI] Phoenix S3 Trio64", "px_trio64_pci", &s3_phoenix_trio64_pci_device },
{"[PCI] S3 ViRGE/DX", "virge375_pci", &s3_virge_375_pci_device },
{"[PCI] S3 ViRGE/DX (VBE 2.0)", "virge375_vbe20_pci", &s3_virge_375_4_pci_device },
{"[PCI] STB Nitro 64V (CL-GD 5446)", "cl_gd5446_stb_pci", &gd5446_stb_pci_device },
{"[PCI] Trident TGUI9440", "tgui9440_pci", &tgui9440_pci_device },
{"[VLB] ATI Graphics Pro Turbo (Mach64 GX)", "mach64gx_vlb", &mach64gx_vlb_device },
{"[VLB] Cardex Tseng ET4000/w32p", "et4000w32p_vlb", &et4000w32p_cardex_vlb_device },
{"[VLB] Cirrus Logic CL-GD 5428", "cl_gd5428_vlb", &gd5428_vlb_device },
{"[VLB] Cirrus Logic CL-GD 5429", "cl_gd5429_vlb", &gd5429_vlb_device },
{"[VLB] Cirrus Logic CL-GD 5434", "cl_gd5434_vlb", &gd5434_vlb_device },
#if defined(DEV_BRANCH) && defined(USE_STEALTH32)
{"[VLB] Diamond Stealth 32 (Tseng ET4000/w32p)", "stealth32_vlb", &et4000w32p_vlb_device, VID_ET4000W32_VLB },
{"[VLB] Diamond Stealth 32 (Tseng ET4000/w32p)", "stealth32_vlb", &et4000w32p_vlb_device },
#endif
{"[VLB] Diamond SpeedStar PRO (CL-GD 5426)", "cl_gd5426_vlb", &gd5426_vlb_device, VID_CL_GD5426_VLB },
{"[VLB] Diamond SpeedStar PRO SE (CL-GD 5430)", "cl_gd5430_vlb", &gd5430_vlb_device, VID_CL_GD5430_VLB },
{"[VLB] Diamond Stealth 3D 2000 (S3 ViRGE)", "stealth3d_2000_vlb", &s3_virge_vlb_device, VID_VIRGE_VLB },
{"[VLB] Diamond Stealth 3D 3000 (S3 ViRGE/VX)", "stealth3d_3000_vlb", &s3_virge_988_vlb_device, VID_VIRGEVX_VLB },
{"[VLB] Diamond Stealth 64 DRAM (S3 Trio64)", "stealth64d_vlb", &s3_diamond_stealth64_vlb_device, VID_STEALTH64_VLB },
{"[VLB] ExpertColor DSV3868P CF55 (S3 Vision868)", "expertcolor_vlb", &s3_expertcolor_vlb_device, VID_EXPERTCOLOR_VLB },
{"[VLB] Number Nine 9FX (S3 Trio64)", "n9_9fx_vlb", &s3_9fx_vlb_device, VID_N9_9FX_VLB },
{"[VLB] Paradise Bahamas 64 (S3 Vision864)", "bahamas64_vlb", &s3_bahamas64_vlb_device, VID_BAHAMAS64_VLB },
{"[VLB] Phoenix S3 Vision864", "px_vision864_vlb", &s3_phoenix_vision864_vlb_device, VID_PHOENIX_VISION864_VLB },
{"[VLB] Phoenix S3 Trio32", "px_trio32_vlb", &s3_phoenix_trio32_vlb_device, VID_PHOENIX_TRIO32_VLB },
{"[VLB] Phoenix S3 Trio64", "px_trio64_vlb", &s3_phoenix_trio64_vlb_device, VID_PHOENIX_TRIO64_VLB },
{"[VLB] S3 ViRGE/DX", "virge375_vlb", &s3_virge_375_vlb_device, VID_VIRGEDX_VLB },
{"[VLB] S3 ViRGE/DX (VBE 2.0)", "virge375_vbe20_vlb", &s3_virge_375_4_vlb_device, VID_VIRGEDX4_VLB },
{"[VLB] Trident TGUI9400CXi", "tgui9400cxi_vlb", &tgui9400cxi_device, VID_TGUI9400CXI },
{"[VLB] Trident TGUI9440", "tgui9440_vlb", &tgui9440_vlb_device, VID_TGUI9440_VLB },
{"", "", NULL, -1 }
{"[VLB] Diamond SpeedStar PRO (CL-GD 5426)", "cl_gd5426_vlb", &gd5426_vlb_device },
{"[VLB] Diamond SpeedStar PRO SE (CL-GD 5430)", "cl_gd5430_vlb", &gd5430_vlb_device },
{"[VLB] Diamond Stealth 3D 2000 (S3 ViRGE)", "stealth3d_2000_vlb", &s3_virge_vlb_device },
{"[VLB] Diamond Stealth 3D 3000 (S3 ViRGE/VX)", "stealth3d_3000_vlb", &s3_virge_988_vlb_device },
{"[VLB] Diamond Stealth 64 DRAM (S3 Trio64)", "stealth64d_vlb", &s3_diamond_stealth64_vlb_device },
{"[VLB] ExpertColor DSV3868P CF55 (S3 Vision868)", "expertcolor_vlb", &s3_expertcolor_vlb_device },
{"[VLB] Number Nine 9FX (S3 Trio64)", "n9_9fx_vlb", &s3_9fx_vlb_device },
{"[VLB] Paradise Bahamas 64 (S3 Vision864)", "bahamas64_vlb", &s3_bahamas64_vlb_device },
{"[VLB] Phoenix S3 Vision864", "px_vision864_vlb", &s3_phoenix_vision864_vlb_device },
{"[VLB] Phoenix S3 Trio32", "px_trio32_vlb", &s3_phoenix_trio32_vlb_device },
{"[VLB] Phoenix S3 Trio64", "px_trio64_vlb", &s3_phoenix_trio64_vlb_device },
{"[VLB] S3 ViRGE/DX", "virge375_vlb", &s3_virge_375_vlb_device },
{"[VLB] S3 ViRGE/DX (VBE 2.0)", "virge375_vbe20_vlb", &s3_virge_375_4_vlb_device },
{"[VLB] Trident TGUI9400CXi", "tgui9400cxi_vlb", &tgui9400cxi_device },
{"[VLB] Trident TGUI9440", "tgui9440_vlb", &tgui9440_vlb_device },
{"", "", NULL }
};
@@ -207,14 +206,14 @@ video_reset(int card)
/* Do not initialize internal cards here. */
if (!(card == VID_NONE) && \
!(card == VID_INTERNAL) && !machines[machine].fixed_gfxcard) {
vid_table_log("VIDEO: initializing '%s'\n", video_cards[video_old_to_new(card)].name);
vid_table_log("VIDEO: initializing '%s'\n", video_cards[card].name);
/* Do an inform on the default values, so that that there's some sane values initialized
even if the device init function does not do an inform of its own. */
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_default);
/* Initialize the video card. */
device_add(video_cards[video_old_to_new(card)].device);
device_add(video_cards[card].device);
}
/* Enable the Voodoo if configured. */
@@ -261,7 +260,7 @@ video_card_getid(char *s)
{
int c = 0;
while (video_cards[c].legacy_id != -1) {
while (video_cards[c].name != NULL) {
if (!strcmp((char *) video_cards[c].name, s))
return(c);
c++;
@@ -271,28 +270,6 @@ video_card_getid(char *s)
}
int
video_old_to_new(int card)
{
int c = 0;
while (video_cards[c].legacy_id != -1) {
if (video_cards[c].legacy_id == card)
return(c);
c++;
}
return(0);
}
int
video_new_to_old(int card)
{
return(video_cards[card].legacy_id);
}
char *
video_get_internal_name(int card)
{
@@ -305,9 +282,9 @@ video_get_video_from_internal_name(char *s)
{
int c = 0;
while (video_cards[c].legacy_id != -1) {
while (video_cards[c].name != NULL) {
if (!strcmp((char *) video_cards[c].internal_name, s))
return(video_cards[c].legacy_id);
return(c);
c++;
}