Files
86Box/src/video/vid_table.c

434 lines
16 KiB
C
Raw Normal View History

/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Define all known video cards.
*
2020-03-25 00:46:02 +02:00
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016-2020 Miran Grca.
* Copyright 2017-2020 Fred N. van Kempen.
*/
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include <86box/86box.h>
#include <86box/timer.h>
#include <86box/machine.h>
#include <86box/mem.h>
#include <86box/device.h>
#include <86box/plat.h>
#include <86box/video.h>
#include <86box/vid_svga.h>
#include <86box/vid_cga.h>
#include <86box/vid_ega.h>
#include <86box/vid_colorplus.h>
#include <86box/vid_mda.h>
typedef struct {
2022-08-31 19:19:29 -04:00
const device_t *device;
int flags;
} VIDEO_CARD;
2022-08-31 19:19:29 -04:00
static video_timings_t timing_default = { .type = VIDEO_ISA, .write_b = 8, .write_w = 16, .write_l = 32, .read_b = 8, .read_w = 16, .read_l = 32 };
Added the IBM 5161 ISA expansion for PC and XT; Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port; Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX); Finished the 586MC1; Added 8087 emulation; Moved Cyrix 6x86'es to the Dev branch; Sanitized/cleaned up memregs.c/h and intel.c/h; Split the chipsets from machines and sanitized Port 92 emulation; Added support for the 15bpp mode to the Compaq ATI 28800; Moved the MR 386DX and 486 machines to the Dev branch; Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00; Ported the new timer code from PCem; Cleaned up the CPU table of unused stuff and better optimized its structure; Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch; Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem; Added the AHA-1540A and the BusTek BT-542B; Moved the Sumo SCSI-AT to the Dev branch; Minor IDE, FDC, and floppy drive code clean-ups; Made NCR 5380/53C400-based cards' BIOS address configurable; Got rid of the legacy romset variable; Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit; Added the Amstead PPC512 per PCem patch by John Elliott; Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages); Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing; Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem; Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit; Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement; Amstrad MegaPC does now works correctly with non-internal graphics card; The SLiRP code no longer casts a packed struct type to a non-packed struct type; The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present; The S3 Virge on BeOS is no longer broken (was broken by build #1591); OS/2 2.0 build 6.167 now sees key presses again; Xi8088 now work on CGA again; 86F images converted from either the old or new variants of the HxC MFM format now work correctly; Hardware interrupts with a vector of 0xFF are now handled correctly; OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct; Fixed VNC keyboard input bugs; Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver; Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly; Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4; Compaq Portable now works with all graphics cards; Fixed various MDSI Genius bugs; Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly; Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355; OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400. Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391. Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389. Fixed a minor IDE timing bug, fixes #388. Fixed Toshiba T1000 RAM issues, fixes #379. Fixed EGA/(S)VGA overscan border handling, fixes #378; Got rid of the now long useless IDE channel 2 auto-removal, fixes #370; Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366; Ported the Unicode CD image file name fix from VARCem, fixes #365; Fixed high density floppy disks on the Xi8088, fixes #359; Fixed some bugs in the Hercules emulation, fixes #346, fixes #358; Fixed the SCSI hard disk mode sense pages, fixes #356; Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349; Fixed bugs in the serial mouse emulation, fixes #344; Compiled 86Box binaries now include all the required .DLL's, fixes #341; Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
static int was_reset = 0;
static const device_t vid_none_device = {
2022-08-31 19:19:29 -04:00
.name = "None",
2022-04-09 20:09:14 -04:00
.internal_name = "none",
2022-08-31 19:19:29 -04:00
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
2022-04-09 20:09:14 -04:00
{ .available = NULL },
.speed_changed = NULL,
2022-08-31 19:19:29 -04:00
.force_redraw = NULL,
.config = NULL
};
static const device_t vid_internal_device = {
2022-08-31 19:19:29 -04:00
.name = "Internal",
2022-04-09 20:09:14 -04:00
.internal_name = "internal",
2022-08-31 19:19:29 -04:00
.flags = 0,
.local = 0,
.init = NULL,
.close = NULL,
.reset = NULL,
2022-04-09 20:09:14 -04:00
{ .available = NULL },
.speed_changed = NULL,
2022-08-31 19:19:29 -04:00
.force_redraw = NULL,
.config = NULL
};
static const VIDEO_CARD
video_cards[] = {
2022-11-19 08:49:04 -05:00
// clang-format off
2022-02-26 23:31:28 -05:00
{ &vid_none_device },
{ &vid_internal_device },
{ &atiega_device },
{ &mach64gx_isa_device },
{ &ati28800k_device },
{ &ati18800_vga88_device },
{ &ati28800_device },
{ &compaq_ati28800_device },
#if defined(DEV_BRANCH) && defined(USE_XL24)
2022-02-26 23:31:28 -05:00
{ &ati28800_wonderxl24_device },
#endif
2022-02-26 23:31:28 -05:00
{ &ati18800_device },
#if defined(DEV_BRANCH) && defined(USE_VGAWONDER)
2022-02-26 23:31:28 -05:00
{ &ati18800_wonder_device },
2018-03-11 18:31:47 +01:00
#endif
2022-02-26 23:31:28 -05:00
{ &cga_device },
{ &sega_device },
{ &gd5401_isa_device },
{ &gd5402_isa_device },
{ &gd5420_isa_device },
{ &gd5422_isa_device },
{ &gd5426_isa_device },
{ &gd5426_diamond_speedstar_pro_a1_isa_device },
2022-07-27 17:43:28 -04:00
{ &gd5428_boca_isa_device },
2022-02-26 23:31:28 -05:00
{ &gd5428_isa_device },
{ &gd5429_isa_device },
{ &gd5434_isa_device },
{ &gd5434_diamond_speedstar_64_a3_isa_device },
{ &compaq_cga_device },
{ &compaq_cga_2_device },
{ &cpqega_device },
{ &ega_device },
{ &g2_gc205_device },
2022-07-07 14:34:59 +06:00
{ &hercules_device, VIDEO_FLAG_TYPE_MDA },
{ &herculesplus_device, VIDEO_FLAG_TYPE_MDA },
2022-02-26 23:31:28 -05:00
{ &incolor_device },
{ &im1024_device },
{ &iskra_ega_device },
{ &et4000_kasan_isa_device },
2022-07-07 14:34:59 +06:00
{ &mda_device, VIDEO_FLAG_TYPE_MDA },
2022-02-26 23:31:28 -05:00
{ &genius_device },
{ &nga_device },
{ &ogc_device },
{ &oti037c_device },
{ &oti067_device },
{ &oti077_device },
{ &paradise_pvga1a_device },
{ &paradise_wd90c11_device },
{ &paradise_wd90c30_device },
{ &colorplus_device },
{ &pgc_device },
{ &cga_pravetz_device },
2022-02-26 23:31:28 -05:00
{ &radius_svga_multiview_isa_device },
{ &realtek_rtg3106_device },
{ &s3_diamond_stealth_vram_isa_device },
{ &s3_orchid_86c911_isa_device },
{ &s3_ami_86c924_isa_device },
{ &s3_metheus_86c928_isa_device },
{ &s3_phoenix_86c801_isa_device },
{ &s3_spea_mirage_86c801_isa_device },
{ &sigma_device },
{ &tvga8900b_device },
{ &tvga8900d_device },
{ &tvga9000b_device },
2022-10-02 01:35:17 +06:00
{ &nec_sv9000_device },
2022-02-26 23:31:28 -05:00
{ &et4000k_isa_device },
{ &et2000_device },
{ &et3000_isa_device },
2022-02-26 23:31:28 -05:00
{ &et4000_isa_device },
{ &et4000w32_device },
{ &et4000w32i_isa_device },
{ &vga_device },
{ &v7_vga_1024i_device },
{ &wy700_device },
{ &gd5426_mca_device },
2022-02-26 23:31:28 -05:00
{ &gd5428_mca_device },
{ &et4000_mca_device },
{ &radius_svga_multiview_mca_device },
{ &mach64gx_pci_device },
{ &mach64vt2_device },
{ &et4000w32p_videomagic_revb_pci_device },
{ &et4000w32p_revc_pci_device },
{ &et4000w32p_cardex_pci_device },
{ &et4000w32p_noncardex_pci_device },
{ &et4000w32p_pci_device },
{ &gd5430_pci_device, },
{ &gd5434_pci_device },
{ &gd5436_pci_device, VIDEO_FLAG_TYPE_SPECIAL },
2022-02-26 23:31:28 -05:00
{ &gd5440_pci_device },
{ &gd5446_pci_device, VIDEO_FLAG_TYPE_SPECIAL },
{ &gd5446_stb_pci_device,VIDEO_FLAG_TYPE_SPECIAL },
2022-02-26 23:31:28 -05:00
{ &gd5480_pci_device },
{ &s3_spea_mercury_lite_86c928_pci_device },
{ &s3_diamond_stealth64_964_pci_device },
{ &s3_elsa_winner2000_pro_x_964_pci_device },
{ &s3_mirocrystal_20sv_964_pci_device },
{ &s3_bahamas64_pci_device },
{ &s3_phoenix_vision864_pci_device },
{ &s3_diamond_stealth_se_pci_device },
{ &s3_phoenix_trio32_pci_device },
{ &s3_diamond_stealth64_pci_device },
{ &s3_9fx_pci_device },
{ &s3_phoenix_trio64_pci_device },
{ &s3_elsa_winner2000_pro_x_pci_device },
{ &s3_mirovideo_40sv_ergo_968_pci_device },
{ &s3_9fx_771_pci_device },
{ &s3_phoenix_vision968_pci_device },
{ &s3_spea_mercury_p64v_pci_device },
{ &s3_9fx_531_pci_device },
{ &s3_phoenix_vision868_pci_device },
{ &s3_phoenix_trio64vplus_pci_device },
{ &s3_trio64v2_dx_pci_device },
{ &s3_virge_325_pci_device },
{ &s3_diamond_stealth_2000_pci_device },
{ &s3_diamond_stealth_3000_pci_device },
{ &s3_stb_velocity_3d_pci_device },
{ &s3_virge_375_pci_device },
{ &s3_diamond_stealth_2000pro_pci_device },
{ &s3_virge_385_pci_device },
{ &s3_virge_357_pci_device },
{ &s3_diamond_stealth_4000_pci_device },
{ &s3_trio3d2x_pci_device },
#if defined(DEV_BRANCH) && defined(USE_MGA)
2022-02-26 23:31:28 -05:00
{ &millennium_device },
{ &mystique_device },
{ &mystique_220_device },
#endif
2022-02-26 23:31:28 -05:00
{ &tgui9440_pci_device },
{ &tgui9660_pci_device },
{ &tgui9680_pci_device },
{ &voodoo_banshee_device },
{ &creative_voodoo_banshee_device },
2022-11-10 13:06:47 -05:00
{ &voodoo_3_1000_device },
2022-02-26 23:31:28 -05:00
{ &voodoo_3_2000_device },
{ &voodoo_3_3000_device },
{ &mach64gx_vlb_device },
{ &et4000w32i_vlb_device },
{ &et4000w32p_videomagic_revb_vlb_device },
{ &et4000w32p_revc_vlb_device },
{ &et4000w32p_cardex_vlb_device },
{ &et4000w32p_vlb_device },
{ &et4000w32p_noncardex_vlb_device },
{ &gd5424_vlb_device },
{ &gd5426_vlb_device },
{ &gd5428_vlb_device },
{ &gd5428_diamond_speedstar_pro_b1_vlb_device },
{ &gd5429_vlb_device },
{ &gd5430_diamond_speedstar_pro_se_a8_vlb_device },
{ &gd5430_vlb_device },
2022-02-26 23:31:28 -05:00
{ &gd5434_vlb_device },
{ &s3_metheus_86c928_vlb_device },
{ &s3_mirocrystal_8s_805_vlb_device },
{ &s3_mirocrystal_10sd_805_vlb_device },
{ &s3_phoenix_86c805_vlb_device },
{ &s3_spea_mirage_86c805_vlb_device },
{ &s3_diamond_stealth64_964_vlb_device },
{ &s3_mirocrystal_20sv_964_vlb_device },
{ &s3_mirocrystal_20sd_864_vlb_device },
{ &s3_bahamas64_vlb_device },
{ &s3_phoenix_vision864_vlb_device },
{ &s3_diamond_stealth_se_vlb_device },
{ &s3_phoenix_trio32_vlb_device },
{ &s3_diamond_stealth64_vlb_device },
{ &s3_9fx_vlb_device },
{ &s3_phoenix_trio64_vlb_device },
{ &s3_spea_mirage_p64_vlb_device },
{ &s3_phoenix_vision968_vlb_device },
{ &s3_phoenix_vision868_vlb_device },
{ &ht216_32_standalone_device },
{ &tgui9400cxi_device },
{ &tgui9440_vlb_device },
{ &s3_virge_357_agp_device },
{ &s3_diamond_stealth_4000_agp_device },
{ &s3_trio3d2x_agp_device },
{ &velocity_100_agp_device },
2022-11-10 13:10:39 -05:00
{ &velocity_200_agp_device },
2022-11-10 13:06:47 -05:00
{ &voodoo_3_1000_agp_device },
2022-02-26 23:31:28 -05:00
{ &voodoo_3_2000_agp_device },
{ &voodoo_3_3000_agp_device },
2022-11-10 13:07:52 -05:00
{ &voodoo_3_3500_agp_ntsc_device },
{ &voodoo_3_3500_agp_pal_device },
2022-11-10 17:18:16 -05:00
{ &compaq_voodoo_3_3500_agp_device },
2022-11-10 17:19:50 -05:00
{ &voodoo_3_3500_se_agp_device },
2022-11-10 17:20:54 -05:00
{ &voodoo_3_3500_si_agp_device },
2022-02-26 23:31:28 -05:00
{ NULL }
2022-11-19 08:49:04 -05:00
// clang-format on
};
#ifdef ENABLE_VID_TABLE_LOG
int vid_table_do_log = ENABLE_VID_TABLE_LOG;
static void
vid_table_log(const char *fmt, ...)
{
va_list ap;
if (vid_table_do_log) {
2022-08-31 19:19:29 -04:00
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
}
#else
2022-08-31 19:19:29 -04:00
# define vid_table_log(fmt, ...)
#endif
Added the IBM 5161 ISA expansion for PC and XT; Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port; Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX); Finished the 586MC1; Added 8087 emulation; Moved Cyrix 6x86'es to the Dev branch; Sanitized/cleaned up memregs.c/h and intel.c/h; Split the chipsets from machines and sanitized Port 92 emulation; Added support for the 15bpp mode to the Compaq ATI 28800; Moved the MR 386DX and 486 machines to the Dev branch; Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00; Ported the new timer code from PCem; Cleaned up the CPU table of unused stuff and better optimized its structure; Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch; Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem; Added the AHA-1540A and the BusTek BT-542B; Moved the Sumo SCSI-AT to the Dev branch; Minor IDE, FDC, and floppy drive code clean-ups; Made NCR 5380/53C400-based cards' BIOS address configurable; Got rid of the legacy romset variable; Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit; Added the Amstead PPC512 per PCem patch by John Elliott; Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages); Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing; Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem; Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit; Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement; Amstrad MegaPC does now works correctly with non-internal graphics card; The SLiRP code no longer casts a packed struct type to a non-packed struct type; The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present; The S3 Virge on BeOS is no longer broken (was broken by build #1591); OS/2 2.0 build 6.167 now sees key presses again; Xi8088 now work on CGA again; 86F images converted from either the old or new variants of the HxC MFM format now work correctly; Hardware interrupts with a vector of 0xFF are now handled correctly; OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct; Fixed VNC keyboard input bugs; Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver; Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly; Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4; Compaq Portable now works with all graphics cards; Fixed various MDSI Genius bugs; Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly; Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355; OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400. Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391. Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389. Fixed a minor IDE timing bug, fixes #388. Fixed Toshiba T1000 RAM issues, fixes #379. Fixed EGA/(S)VGA overscan border handling, fixes #378; Got rid of the now long useless IDE channel 2 auto-removal, fixes #370; Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366; Ported the Unicode CD image file name fix from VARCem, fixes #365; Fixed high density floppy disks on the Xi8088, fixes #359; Fixed some bugs in the Hercules emulation, fixes #346, fixes #358; Fixed the SCSI hard disk mode sense pages, fixes #356; Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349; Fixed bugs in the serial mouse emulation, fixes #344; Compiled 86Box binaries now include all the required .DLL's, fixes #341; Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
void
video_reset_close(void)
{
2022-07-04 01:50:42 +06:00
for (int i = 1; i < MONITORS_NUM; i++)
video_monitor_close(i);
monitor_index_global = 0;
Added the IBM 5161 ISA expansion for PC and XT; Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port; Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX); Finished the 586MC1; Added 8087 emulation; Moved Cyrix 6x86'es to the Dev branch; Sanitized/cleaned up memregs.c/h and intel.c/h; Split the chipsets from machines and sanitized Port 92 emulation; Added support for the 15bpp mode to the Compaq ATI 28800; Moved the MR 386DX and 486 machines to the Dev branch; Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00; Ported the new timer code from PCem; Cleaned up the CPU table of unused stuff and better optimized its structure; Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch; Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem; Added the AHA-1540A and the BusTek BT-542B; Moved the Sumo SCSI-AT to the Dev branch; Minor IDE, FDC, and floppy drive code clean-ups; Made NCR 5380/53C400-based cards' BIOS address configurable; Got rid of the legacy romset variable; Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit; Added the Amstead PPC512 per PCem patch by John Elliott; Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages); Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing; Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem; Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit; Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement; Amstrad MegaPC does now works correctly with non-internal graphics card; The SLiRP code no longer casts a packed struct type to a non-packed struct type; The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present; The S3 Virge on BeOS is no longer broken (was broken by build #1591); OS/2 2.0 build 6.167 now sees key presses again; Xi8088 now work on CGA again; 86F images converted from either the old or new variants of the HxC MFM format now work correctly; Hardware interrupts with a vector of 0xFF are now handled correctly; OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct; Fixed VNC keyboard input bugs; Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver; Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly; Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4; Compaq Portable now works with all graphics cards; Fixed various MDSI Genius bugs; Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly; Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355; OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400. Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391. Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389. Fixed a minor IDE timing bug, fixes #388. Fixed Toshiba T1000 RAM issues, fixes #379. Fixed EGA/(S)VGA overscan border handling, fixes #378; Got rid of the now long useless IDE channel 2 auto-removal, fixes #370; Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366; Ported the Unicode CD image file name fix from VARCem, fixes #365; Fixed high density floppy disks on the Xi8088, fixes #359; Fixed some bugs in the Hercules emulation, fixes #346, fixes #358; Fixed the SCSI hard disk mode sense pages, fixes #356; Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349; Fixed bugs in the serial mouse emulation, fixes #344; Compiled 86Box binaries now include all the required .DLL's, fixes #341; Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
video_inform(VIDEO_FLAG_TYPE_NONE, &timing_default);
was_reset = 0;
Added the IBM 5161 ISA expansion for PC and XT; Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port; Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX); Finished the 586MC1; Added 8087 emulation; Moved Cyrix 6x86'es to the Dev branch; Sanitized/cleaned up memregs.c/h and intel.c/h; Split the chipsets from machines and sanitized Port 92 emulation; Added support for the 15bpp mode to the Compaq ATI 28800; Moved the MR 386DX and 486 machines to the Dev branch; Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00; Ported the new timer code from PCem; Cleaned up the CPU table of unused stuff and better optimized its structure; Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch; Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem; Added the AHA-1540A and the BusTek BT-542B; Moved the Sumo SCSI-AT to the Dev branch; Minor IDE, FDC, and floppy drive code clean-ups; Made NCR 5380/53C400-based cards' BIOS address configurable; Got rid of the legacy romset variable; Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit; Added the Amstead PPC512 per PCem patch by John Elliott; Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages); Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing; Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem; Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit; Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement; Amstrad MegaPC does now works correctly with non-internal graphics card; The SLiRP code no longer casts a packed struct type to a non-packed struct type; The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present; The S3 Virge on BeOS is no longer broken (was broken by build #1591); OS/2 2.0 build 6.167 now sees key presses again; Xi8088 now work on CGA again; 86F images converted from either the old or new variants of the HxC MFM format now work correctly; Hardware interrupts with a vector of 0xFF are now handled correctly; OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct; Fixed VNC keyboard input bugs; Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver; Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly; Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4; Compaq Portable now works with all graphics cards; Fixed various MDSI Genius bugs; Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly; Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355; OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400. Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391. Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389. Fixed a minor IDE timing bug, fixes #388. Fixed Toshiba T1000 RAM issues, fixes #379. Fixed EGA/(S)VGA overscan border handling, fixes #378; Got rid of the now long useless IDE channel 2 auto-removal, fixes #370; Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366; Ported the Unicode CD image file name fix from VARCem, fixes #365; Fixed high density floppy disks on the Xi8088, fixes #359; Fixed some bugs in the Hercules emulation, fixes #346, fixes #358; Fixed the SCSI hard disk mode sense pages, fixes #356; Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349; Fixed bugs in the serial mouse emulation, fixes #344; Compiled 86Box binaries now include all the required .DLL's, fixes #341; Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
}
static void
video_prepare(void)
{
/* Reset (deallocate) the video font arrays. */
if (fontdatksc5601) {
2022-08-31 19:19:29 -04:00
free(fontdatksc5601);
fontdatksc5601 = NULL;
}
/* Reset the blend. */
herc_blend = 0;
for (int i = 0; i < MONITORS_NUM; i++) {
/* Reset the CGA palette. */
2022-08-31 19:19:29 -04:00
if (monitors[i].mon_cga_palette)
*monitors[i].mon_cga_palette = 0;
cgapal_rebuild_monitor(i);
/* 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_monitor(VIDEO_FLAG_TYPE_SPECIAL, &timing_default, i);
}
}
void
video_pre_reset(int card)
{
2022-08-31 19:19:29 -04:00
if ((card == VID_NONE) || (card == VID_INTERNAL) || machine_has_flags(machine, MACHINE_VIDEO_ONLY))
video_prepare();
}
void
video_reset(int card)
{
/* This is needed to avoid duplicate resets. */
if ((video_get_type() != VIDEO_FLAG_TYPE_NONE) && was_reset)
2022-08-31 19:19:29 -04:00
return;
2023-02-06 04:12:46 -05:00
vid_table_log("VIDEO: reset (gfxcard[0]=%d, internal=%d)\n",
2022-08-31 19:19:29 -04:00
card, machine_has_flags(machine, MACHINE_VIDEO) ? 1 : 0);
2022-07-04 01:50:42 +06:00
monitor_index_global = 0;
loadfont("roms/video/mda/mda.rom", 0);
/* Do not initialize internal cards here. */
2022-08-31 19:19:29 -04:00
if (!(card == VID_NONE) && !(card == VID_INTERNAL) && !machine_has_flags(machine, MACHINE_VIDEO_ONLY)) {
vid_table_log("VIDEO: initializing '%s'\n", video_cards[card].device->name);
2022-08-31 19:19:29 -04:00
video_prepare();
2022-08-31 19:19:29 -04:00
/* Initialize the video card. */
device_add(video_cards[card].device);
2022-07-07 14:34:59 +06:00
}
2022-07-04 01:50:42 +06:00
2022-07-07 14:34:59 +06:00
if (!(card == VID_NONE)
&& !machine_has_flags(machine, MACHINE_VIDEO_ONLY)
2023-02-06 04:12:46 -05:00
&& gfxcard[1] != 0
&& device_is_valid(video_card_getdevice(gfxcard[1]), machine)) {
2022-07-04 01:50:42 +06:00
video_monitor_init(1);
monitor_index_global = 1;
2023-02-06 04:12:46 -05:00
device_add(video_cards[gfxcard[1]].device);
2022-07-04 01:50:42 +06:00
monitor_index_global = 0;
}
2017-11-08 16:29:54 -05:00
/* Enable the Voodoo if configured. */
if (voodoo_enabled)
2022-08-31 19:19:29 -04:00
device_add(&voodoo_device);
Added the IBM 5161 ISA expansion for PC and XT; Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port; Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX); Finished the 586MC1; Added 8087 emulation; Moved Cyrix 6x86'es to the Dev branch; Sanitized/cleaned up memregs.c/h and intel.c/h; Split the chipsets from machines and sanitized Port 92 emulation; Added support for the 15bpp mode to the Compaq ATI 28800; Moved the MR 386DX and 486 machines to the Dev branch; Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00; Ported the new timer code from PCem; Cleaned up the CPU table of unused stuff and better optimized its structure; Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch; Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem; Added the AHA-1540A and the BusTek BT-542B; Moved the Sumo SCSI-AT to the Dev branch; Minor IDE, FDC, and floppy drive code clean-ups; Made NCR 5380/53C400-based cards' BIOS address configurable; Got rid of the legacy romset variable; Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit; Added the Amstead PPC512 per PCem patch by John Elliott; Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages); Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing; Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem; Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit; Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement; Amstrad MegaPC does now works correctly with non-internal graphics card; The SLiRP code no longer casts a packed struct type to a non-packed struct type; The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present; The S3 Virge on BeOS is no longer broken (was broken by build #1591); OS/2 2.0 build 6.167 now sees key presses again; Xi8088 now work on CGA again; 86F images converted from either the old or new variants of the HxC MFM format now work correctly; Hardware interrupts with a vector of 0xFF are now handled correctly; OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct; Fixed VNC keyboard input bugs; Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver; Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly; Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4; Compaq Portable now works with all graphics cards; Fixed various MDSI Genius bugs; Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly; Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355; OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400. Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391. Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389. Fixed a minor IDE timing bug, fixes #388. Fixed Toshiba T1000 RAM issues, fixes #379. Fixed EGA/(S)VGA overscan border handling, fixes #378; Got rid of the now long useless IDE channel 2 auto-removal, fixes #370; Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366; Ported the Unicode CD image file name fix from VARCem, fixes #365; Fixed high density floppy disks on the Xi8088, fixes #359; Fixed some bugs in the Hercules emulation, fixes #346, fixes #358; Fixed the SCSI hard disk mode sense pages, fixes #356; Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349; Fixed bugs in the serial mouse emulation, fixes #344; Compiled 86Box binaries now include all the required .DLL's, fixes #341; Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
was_reset = 1;
}
int
video_card_available(int card)
{
if (video_cards[card].device)
2022-08-31 19:19:29 -04:00
return (device_available(video_cards[card].device));
2022-08-31 19:19:29 -04:00
return (1);
}
2022-07-07 14:34:59 +06:00
int
video_card_get_flags(int card)
{
return video_cards[card].flags;
}
const device_t *
video_card_getdevice(int card)
{
2022-08-31 19:19:29 -04:00
return (video_cards[card].device);
}
int
video_card_has_config(int card)
{
2022-08-31 19:19:29 -04:00
if (video_cards[card].device == NULL)
return (0);
2022-08-31 19:19:29 -04:00
return (device_has_config(video_cards[card].device) ? 1 : 0);
}
char *
video_get_internal_name(int card)
{
return device_get_internal_name(video_cards[card].device);
}
int
video_get_video_from_internal_name(char *s)
{
int c = 0;
while (video_cards[c].device != NULL) {
2022-08-31 19:19:29 -04:00
if (!strcmp((char *) video_cards[c].device->internal_name, s))
return (c);
c++;
}
2022-08-31 19:19:29 -04:00
return (0);
}
int
video_is_mda(void)
{
return (video_get_type() == VIDEO_FLAG_TYPE_MDA);
}
int
video_is_cga(void)
{
return (video_get_type() == VIDEO_FLAG_TYPE_CGA);
}
int
video_is_ega_vga(void)
{
return (video_get_type() == VIDEO_FLAG_TYPE_SPECIAL);
}