2017-05-30 03:38:38 +02:00
|
|
|
/*
|
2022-11-13 16:37:58 -05:00
|
|
|
* 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.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2022-11-13 16:37:58 -05:00
|
|
|
* This file is part of the 86Box distribution.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2022-11-13 16:37:58 -05:00
|
|
|
* Generic SVGA handling.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2023-01-06 15:36:29 -05:00
|
|
|
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
|
2022-11-13 16:37:58 -05:00
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2017-11-05 01:57:04 -05:00
|
|
|
*
|
2022-11-13 16:37:58 -05:00
|
|
|
* Copyright 2008-2020 Sarah Walker.
|
|
|
|
|
* Copyright 2016-2020 Miran Grca.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
2022-02-18 19:42:21 -05:00
|
|
|
|
2022-05-14 18:55:00 +02:00
|
|
|
#include <86box/thread.h>
|
|
|
|
|
#include <86box/vid_8514a.h>
|
2022-06-17 21:26:26 +02:00
|
|
|
#include <86box/vid_xga.h>
|
2022-05-14 18:55:00 +02:00
|
|
|
|
2022-01-30 02:11:21 -05:00
|
|
|
#ifndef VIDEO_SVGA_H
|
2022-07-27 17:00:34 -04:00
|
|
|
# define VIDEO_SVGA_H
|
2017-05-30 03:38:38 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
# define FLAG_EXTRA_BANKS 1
|
|
|
|
|
# define FLAG_ADDR_BY8 2
|
|
|
|
|
# define FLAG_EXT_WRITE 4
|
|
|
|
|
# define FLAG_LATCH8 8
|
|
|
|
|
# define FLAG_NOSKEW 16
|
|
|
|
|
# define FLAG_ADDR_BY16 32
|
|
|
|
|
# define FLAG_RAMDAC_SHIFT 64
|
|
|
|
|
# define FLAG_128K_MASK 128
|
2019-10-01 15:14:51 +02:00
|
|
|
|
2023-01-22 16:50:21 +06:00
|
|
|
struct monitor_t;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
typedef struct {
|
|
|
|
|
int ena,
|
2022-07-27 17:00:34 -04:00
|
|
|
x, y, xoff, yoff, cur_xsize, cur_ysize,
|
|
|
|
|
v_acc, h_acc;
|
2018-04-25 23:51:13 +02:00
|
|
|
uint32_t addr, pitch;
|
|
|
|
|
} hwcursor_t;
|
|
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
typedef union {
|
2022-07-27 17:00:34 -04:00
|
|
|
uint64_t q;
|
|
|
|
|
uint32_t d[2];
|
|
|
|
|
uint16_t w[4];
|
|
|
|
|
uint8_t b[8];
|
2019-12-04 07:20:58 +01:00
|
|
|
} latch_t;
|
|
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
typedef struct svga_t {
|
|
|
|
|
ibm8514_t dev8514;
|
|
|
|
|
xga_t xga;
|
2018-04-25 23:51:13 +02:00
|
|
|
mem_mapping_t mapping;
|
|
|
|
|
|
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
|
|
|
uint8_t fast, chain4, chain2_write, chain2_read,
|
2022-07-27 17:00:34 -04:00
|
|
|
ext_overscan, bus_size,
|
|
|
|
|
lowres, interlace, linedbl, rowcount,
|
|
|
|
|
set_reset_disabled, bpp, ramdac_type, fb_only,
|
|
|
|
|
readmode, writemode, readplane,
|
|
|
|
|
hwcursor_oddeven, dac_hwcursor_oddeven, overlay_oddeven,
|
|
|
|
|
fcr, hblank_overscan;
|
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
|
|
|
|
|
|
|
|
int dac_addr, dac_pos, dac_r, dac_g,
|
2022-07-27 17:00:34 -04:00
|
|
|
vtotal, dispend, vsyncstart, split, vblankstart,
|
|
|
|
|
hdisp, hdisp_old, htotal, hdisp_time, rowoffset,
|
|
|
|
|
dispon, hdisp_on,
|
|
|
|
|
vc, sc, linepos, vslines, linecountff, oddeven,
|
|
|
|
|
con, cursoron, blink, scrollcache, char_width,
|
|
|
|
|
firstline, lastline, firstline_draw, lastline_draw,
|
|
|
|
|
displine, fullchange, x_add, y_add, pan,
|
|
|
|
|
vram_display_mask, vidclock, dots_per_clock, hblank_ext,
|
|
|
|
|
hwcursor_on, dac_hwcursor_on, overlay_on, set_override,
|
|
|
|
|
hblankstart, hblankend, hblank_sub, hblank_end_val, hblank_end_len;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
/*The three variables below allow us to implement memory maps like that seen on a 1MB Trio64 :
|
|
|
|
|
0MB-1MB - VRAM
|
|
|
|
|
1MB-2MB - VRAM mirror
|
|
|
|
|
2MB-4MB - open bus
|
|
|
|
|
4MB-xMB - mirror of above
|
|
|
|
|
|
|
|
|
|
For the example memory map, decode_mask would be 4MB-1 (4MB address space), vram_max would be 2MB
|
|
|
|
|
(present video memory only responds to first 2MB), vram_mask would be 1MB-1 (video memory wraps at 1MB)
|
|
|
|
|
*/
|
2018-10-05 01:54:54 +02:00
|
|
|
uint32_t decode_mask, vram_max,
|
2022-07-27 17:00:34 -04:00
|
|
|
vram_mask,
|
|
|
|
|
charseta, charsetb,
|
|
|
|
|
adv_flags, ma_latch,
|
|
|
|
|
ca_adj, ma, maback,
|
|
|
|
|
write_bank, read_bank,
|
|
|
|
|
extra_banks[2],
|
|
|
|
|
banked_mask,
|
|
|
|
|
ca, overscan_color,
|
|
|
|
|
*map8, pallook[512];
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
PALETTE vgapal;
|
|
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
uint64_t dispontime, dispofftime;
|
2022-07-27 17:00:34 -04:00
|
|
|
latch_t latch;
|
2019-10-01 15:14:51 +02:00
|
|
|
|
|
|
|
|
pc_timer_t timer;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2018-10-05 01:54:54 +02:00
|
|
|
double clock;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
hwcursor_t hwcursor, hwcursor_latch,
|
2022-07-27 17:00:34 -04:00
|
|
|
dac_hwcursor, dac_hwcursor_latch,
|
|
|
|
|
overlay, overlay_latch;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void (*render)(struct svga_t *svga);
|
|
|
|
|
void (*recalctimings_ex)(struct svga_t *svga);
|
|
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
void (*video_out)(uint16_t addr, uint8_t val, void *p);
|
|
|
|
|
uint8_t (*video_in)(uint16_t addr, void *p);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void (*hwcursor_draw)(struct svga_t *svga, int displine);
|
|
|
|
|
|
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 (*dac_hwcursor_draw)(struct svga_t *svga, int displine);
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
void (*overlay_draw)(struct svga_t *svga, int displine);
|
|
|
|
|
|
|
|
|
|
void (*vblank_start)(struct svga_t *svga);
|
|
|
|
|
|
|
|
|
|
void (*ven_write)(struct svga_t *svga, uint8_t val, uint32_t addr);
|
2018-10-05 01:54:54 +02:00
|
|
|
float (*getclock)(int clock, void *p);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
/* Called when VC=R18 and friends. If this returns zero then MA resetting
|
|
|
|
|
is skipped. Matrox Mystique in Power mode reuses this counter for
|
|
|
|
|
vertical line interrupt*/
|
2022-02-20 02:26:27 -05:00
|
|
|
int (*line_compare)(struct svga_t *svga);
|
2020-01-17 00:24:18 +01:00
|
|
|
|
2020-03-31 00:33:49 +02:00
|
|
|
/*Called at the start of vertical sync*/
|
|
|
|
|
void (*vsync_callback)(struct svga_t *svga);
|
|
|
|
|
|
2020-05-12 00:37:30 +02:00
|
|
|
uint32_t (*translate_address)(uint32_t addr, void *p);
|
2018-04-25 23:51:13 +02:00
|
|
|
/*If set then another device is driving the monitor output and the SVGA
|
|
|
|
|
card should not attempt to display anything */
|
2022-07-27 17:00:34 -04:00
|
|
|
int override;
|
2018-04-25 23:51:13 +02:00
|
|
|
void *p;
|
2018-10-05 01:54:54 +02:00
|
|
|
|
2021-09-03 00:05:43 +02:00
|
|
|
uint8_t crtc[256], gdcreg[256], attrregs[32], seqregs[256],
|
2022-07-27 17:00:34 -04:00
|
|
|
egapal[16],
|
|
|
|
|
*vram, *changedvram;
|
2018-10-05 01:54:54 +02:00
|
|
|
|
|
|
|
|
uint8_t crtcreg, gdcaddr,
|
2022-07-27 17:00:34 -04:00
|
|
|
attrff, attr_palette_enable, attraddr, seqaddr,
|
|
|
|
|
miscout, cgastat, scrblank,
|
|
|
|
|
plane_mask, writemask,
|
|
|
|
|
colourcompare, colournocare,
|
|
|
|
|
dac_mask, dac_status,
|
|
|
|
|
dpms, dpms_ui,
|
|
|
|
|
ksc5601_sbyte_mask, ksc5601_udc_area_msb[2];
|
|
|
|
|
|
|
|
|
|
int ksc5601_swap_mode;
|
2020-05-12 00:37:30 +02:00
|
|
|
uint16_t ksc5601_english_font_type;
|
2018-10-05 01:54:54 +02:00
|
|
|
|
2020-01-18 22:25:52 +01:00
|
|
|
int vertical_linedbl;
|
2022-02-20 02:26:27 -05:00
|
|
|
|
2020-01-18 22:25:52 +01:00
|
|
|
/*Used to implement CRTC[0x17] bit 2 hsync divisor*/
|
|
|
|
|
int hsync_divisor;
|
|
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
/*Tseng-style chain4 mode - CRTC dword mode is the same as byte mode, chain4
|
|
|
|
|
addresses are shifted to match*/
|
|
|
|
|
int packed_chain4;
|
2021-05-30 02:01:16 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
/*Force CRTC to dword mode, regardless of CR14/CR17. Required for S3 enhanced mode*/
|
|
|
|
|
int force_dword_mode;
|
2022-04-12 15:58:57 +05:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
int force_old_addr;
|
2021-05-30 02:01:16 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
int remap_required;
|
|
|
|
|
uint32_t (*remap_func)(struct svga_t *svga, uint32_t in_addr);
|
2021-05-30 02:01:16 +02:00
|
|
|
|
2018-10-05 01:54:54 +02:00
|
|
|
void *ramdac, *clock_gen;
|
2023-01-22 16:50:21 +06:00
|
|
|
|
|
|
|
|
/* Monitor Index */
|
|
|
|
|
uint8_t monitor_index;
|
|
|
|
|
|
|
|
|
|
/* Pointer to monitor */
|
|
|
|
|
monitor_t* monitor;
|
2016-06-26 00:34:39 +02:00
|
|
|
} svga_t;
|
|
|
|
|
|
2022-06-12 18:28:38 +02:00
|
|
|
extern int vga_on, ibm8514_on;
|
2022-05-14 18:55:00 +02:00
|
|
|
|
|
|
|
|
extern void ibm8514_poll(ibm8514_t *dev, svga_t *svga);
|
|
|
|
|
extern void ibm8514_recalctimings(svga_t *svga);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2022-06-17 21:26:26 +02:00
|
|
|
extern void xga_poll(xga_t *xga, svga_t *svga);
|
|
|
|
|
extern void xga_recalctimings(svga_t *svga);
|
|
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern int svga_init(const device_t *info, svga_t *svga, void *p, int memsize,
|
|
|
|
|
void (*recalctimings_ex)(struct svga_t *svga),
|
|
|
|
|
uint8_t (*video_in)(uint16_t addr, void *p),
|
|
|
|
|
void (*video_out)(uint16_t addr, uint8_t val, void *p),
|
|
|
|
|
void (*hwcursor_draw)(struct svga_t *svga, int displine),
|
|
|
|
|
void (*overlay_draw)(struct svga_t *svga, int displine));
|
|
|
|
|
extern void svga_recalctimings(svga_t *svga);
|
|
|
|
|
extern void svga_close(svga_t *svga);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
uint8_t svga_read(uint32_t addr, void *p);
|
|
|
|
|
uint16_t svga_readw(uint32_t addr, void *p);
|
|
|
|
|
uint32_t svga_readl(uint32_t addr, void *p);
|
|
|
|
|
void svga_write(uint32_t addr, uint8_t val, void *p);
|
|
|
|
|
void svga_writew(uint32_t addr, uint16_t val, void *p);
|
|
|
|
|
void svga_writel(uint32_t addr, uint32_t val, void *p);
|
|
|
|
|
uint8_t svga_read_linear(uint32_t addr, void *p);
|
|
|
|
|
uint8_t svga_readb_linear(uint32_t addr, void *p);
|
|
|
|
|
uint16_t svga_readw_linear(uint32_t addr, void *p);
|
|
|
|
|
uint32_t svga_readl_linear(uint32_t addr, void *p);
|
|
|
|
|
void svga_write_linear(uint32_t addr, uint8_t val, void *p);
|
|
|
|
|
void svga_writeb_linear(uint32_t addr, uint8_t val, void *p);
|
|
|
|
|
void svga_writew_linear(uint32_t addr, uint16_t val, void *p);
|
|
|
|
|
void svga_writel_linear(uint32_t addr, uint32_t val, void *p);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
void svga_add_status_info(char *s, int max_len, void *p);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern uint8_t svga_rotate[8][256];
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
void svga_out(uint16_t addr, uint8_t val, void *p);
|
|
|
|
|
uint8_t svga_in(uint16_t addr, void *p);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2022-11-17 22:44:06 +01:00
|
|
|
svga_t *svga_get_pri(void);
|
2022-07-27 17:00:34 -04:00
|
|
|
void svga_set_override(svga_t *svga, int val);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
void svga_set_ramdac_type(svga_t *svga, int type);
|
|
|
|
|
void svga_close(svga_t *svga);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
uint32_t svga_mask_addr(uint32_t addr, svga_t *svga);
|
|
|
|
|
uint32_t svga_mask_changedaddr(uint32_t addr, svga_t *svga);
|
2017-05-05 01:49:42 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
void svga_doblit(int wx, int wy, svga_t *svga);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
RAMDAC_6BIT = 0,
|
|
|
|
|
RAMDAC_8BIT
|
|
|
|
|
};
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
/* We need a way to add a device with a pointer to a parent device so it can attach itself to it, and
|
|
|
|
|
possibly also a second ATi 68860 RAM DAC type that auto-sets SVGA render on RAM DAC render change. */
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void ati68860_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t ati68860_ramdac_in(uint16_t addr, void *p, svga_t *svga);
|
|
|
|
|
extern void ati68860_set_ramdac_type(void *p, int type);
|
|
|
|
|
extern void ati68860_ramdac_set_render(void *p, svga_t *svga);
|
|
|
|
|
extern void ati68860_ramdac_set_pallook(void *p, int i, uint32_t col);
|
|
|
|
|
extern void ati68860_hwcursor_draw(svga_t *svga, int displine);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void att49x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t att49x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void att498_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t att498_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
|
|
|
|
extern float av9194_getclock(int clock, void *p);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void bt48x_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t bt48x_ramdac_in(uint16_t addr, int rs2, int rs3, void *p, svga_t *svga);
|
|
|
|
|
extern void bt48x_recalctimings(void *p, svga_t *svga);
|
|
|
|
|
extern void bt48x_hwcursor_draw(svga_t *svga, int displine);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void ibm_rgb528_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t ibm_rgb528_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
|
|
|
|
extern void ibm_rgb528_recalctimings(void *p, svga_t *svga);
|
|
|
|
|
extern void ibm_rgb528_hwcursor_draw(svga_t *svga, int displine);
|
2020-12-08 22:56:45 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void icd2061_write(void *p, int val);
|
|
|
|
|
extern float icd2061_getclock(int clock, void *p);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
/* The code is the same, the #define's are so that the correct name can be used. */
|
2022-07-27 17:00:34 -04:00
|
|
|
# define ics9161_write icd2061_write
|
|
|
|
|
# define ics9161_getclock icd2061_getclock
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern float ics2494_getclock(int clock, void *p);
|
2020-07-26 01:53:46 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void ics2595_write(void *p, int strobe, int dat);
|
|
|
|
|
extern double ics2595_getclock(void *p);
|
|
|
|
|
extern void ics2595_setclock(void *p, double clock);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t sc1148x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
2020-06-25 13:18:29 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void sc1502x_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t sc1502x_ramdac_in(uint16_t addr, void *p, svga_t *svga);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void sdac_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t sdac_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga);
|
|
|
|
|
extern float sdac_getclock(int clock, void *p);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void stg_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t stg_ramdac_in(uint16_t addr, void *p, svga_t *svga);
|
|
|
|
|
extern float stg_getclock(int clock, void *p);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void tkd8001_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t tkd8001_ramdac_in(uint16_t addr, void *p, svga_t *svga);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void tvp3026_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_t *svga);
|
2021-09-03 00:05:43 +02:00
|
|
|
extern uint8_t tvp3026_ramdac_in(uint16_t addr, int rs2, int rs3, void *p, svga_t *svga);
|
2022-07-27 17:00:34 -04:00
|
|
|
extern void tvp3026_recalctimings(void *p, svga_t *svga);
|
|
|
|
|
extern void tvp3026_hwcursor_draw(svga_t *svga, int displine);
|
|
|
|
|
extern float tvp3026_getclock(int clock, void *p);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
# ifdef EMU_DEVICE_H
|
2020-02-29 19:12:23 +01:00
|
|
|
extern const device_t ati68860_ramdac_device;
|
|
|
|
|
extern const device_t att490_ramdac_device;
|
2021-05-12 18:51:02 +02:00
|
|
|
extern const device_t att491_ramdac_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
extern const device_t att492_ramdac_device;
|
2021-11-18 23:58:04 +01:00
|
|
|
extern const device_t att498_ramdac_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
extern const device_t av9194_device;
|
|
|
|
|
extern const device_t bt484_ramdac_device;
|
|
|
|
|
extern const device_t att20c504_ramdac_device;
|
|
|
|
|
extern const device_t bt485_ramdac_device;
|
|
|
|
|
extern const device_t att20c505_ramdac_device;
|
|
|
|
|
extern const device_t bt485a_ramdac_device;
|
|
|
|
|
extern const device_t gendac_ramdac_device;
|
2020-12-22 14:58:28 +01:00
|
|
|
extern const device_t ibm_rgb528_ramdac_device;
|
2020-07-26 01:53:46 +02:00
|
|
|
extern const device_t ics2494an_305_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
extern const device_t ics2595_device;
|
|
|
|
|
extern const device_t icd2061_device;
|
|
|
|
|
extern const device_t ics9161_device;
|
2020-06-25 13:18:29 +02:00
|
|
|
extern const device_t sc11483_ramdac_device;
|
|
|
|
|
extern const device_t sc11487_ramdac_device;
|
2021-10-24 19:06:05 +02:00
|
|
|
extern const device_t sc11486_ramdac_device;
|
2021-05-20 20:57:54 +02:00
|
|
|
extern const device_t sc11484_nors2_ramdac_device;
|
2020-02-29 19:12:23 +01:00
|
|
|
extern const device_t sc1502x_ramdac_device;
|
|
|
|
|
extern const device_t sdac_ramdac_device;
|
|
|
|
|
extern const device_t stg_ramdac_device;
|
|
|
|
|
extern const device_t tkd8001_ramdac_device;
|
2021-03-24 03:51:56 +01:00
|
|
|
extern const device_t tseng_ics5301_ramdac_device;
|
|
|
|
|
extern const device_t tseng_ics5341_ramdac_device;
|
2021-09-03 00:05:43 +02:00
|
|
|
extern const device_t tvp3026_ramdac_device;
|
2022-07-27 17:00:34 -04:00
|
|
|
# endif
|
2022-01-30 02:11:21 -05:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
#endif /*VIDEO_SVGA_H*/
|