2017-05-30 03:38:38 +02: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.
|
|
|
|
|
*
|
|
|
|
|
* This file is part of the 86Box distribution.
|
|
|
|
|
*
|
|
|
|
|
* Generic SVGA handling.
|
|
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2017-11-05 01:57:04 -05:00
|
|
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
2017-05-30 03:38:38 +02:00
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2017-11-05 01:57:04 -05:00
|
|
|
*
|
2018-01-24 23:15:00 +01:00
|
|
|
* Copyright 2008-2018 Sarah Walker.
|
|
|
|
|
* Copyright 2016-2018 Miran Grca.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
|
|
|
|
|
2019-10-01 15:14:51 +02:00
|
|
|
|
|
|
|
|
#define FLAG_EXTRA_BANKS 1
|
|
|
|
|
#define FLAG_ADDR_BY8 2
|
|
|
|
|
#define FLAG_LATCH8 4
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
typedef struct {
|
|
|
|
|
int ena,
|
|
|
|
|
x, y, xoff, yoff, xsize, ysize,
|
|
|
|
|
v_acc, h_acc;
|
|
|
|
|
uint32_t addr, pitch;
|
|
|
|
|
} hwcursor_t;
|
|
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
typedef union {
|
|
|
|
|
uint64_t q;
|
|
|
|
|
uint32_t d[2];
|
|
|
|
|
uint16_t w[4];
|
|
|
|
|
uint8_t b[8];
|
|
|
|
|
} latch_t;
|
|
|
|
|
|
2016-06-26 00:34:39 +02:00
|
|
|
typedef struct svga_t
|
|
|
|
|
{
|
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,
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
int dac_addr, dac_pos, dac_r, dac_g,
|
2018-10-05 01:54:54 +02:00
|
|
|
vtotal, dispend, vsyncstart, split, vblankstart,
|
|
|
|
|
hdisp, hdisp_old, htotal, hdisp_time, rowoffset,
|
|
|
|
|
dispon, hdisp_on,
|
|
|
|
|
vc, sc, linepos, vslines, linecountff, oddeven,
|
2020-01-18 21:35:26 +01:00
|
|
|
con, cursoron, blink, scrollcache, char_width,
|
2018-10-05 01:54:54 +02:00
|
|
|
firstline, lastline, firstline_draw, lastline_draw,
|
2019-10-20 15:09:38 +02:00
|
|
|
displine, fullchange, x_add, y_add, pan,
|
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
|
|
|
vram_display_mask, vidclock,
|
|
|
|
|
hwcursor_on, dac_hwcursor_on, overlay_on;
|
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,
|
|
|
|
|
vram_mask,
|
|
|
|
|
charseta, charsetb,
|
2019-10-01 15:14:51 +02:00
|
|
|
adv_flags, ma_latch,
|
2018-04-25 23:51:13 +02:00
|
|
|
ma, maback,
|
|
|
|
|
write_bank, read_bank,
|
2019-10-01 15:14:51 +02:00
|
|
|
extra_banks[2],
|
2018-04-25 23:51:13 +02:00
|
|
|
banked_mask,
|
|
|
|
|
ca, overscan_color,
|
2019-10-20 15:09:38 +02:00
|
|
|
*map8, pallook[256];
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
PALETTE vgapal;
|
|
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
uint64_t dispontime, dispofftime;
|
|
|
|
|
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,
|
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
|
|
|
dac_hwcursor, dac_hwcursor_latch,
|
2018-04-25 23:51:13 +02:00
|
|
|
overlay, overlay_latch;
|
|
|
|
|
|
|
|
|
|
void (*render)(struct svga_t *svga);
|
|
|
|
|
void (*recalctimings_ex)(struct svga_t *svga);
|
|
|
|
|
|
|
|
|
|
void (*video_out)(uint16_t addr, uint8_t val, void *p);
|
|
|
|
|
uint8_t (*video_in) (uint16_t addr, void *p);
|
|
|
|
|
|
|
|
|
|
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*/
|
|
|
|
|
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);
|
|
|
|
|
|
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 */
|
|
|
|
|
int override;
|
|
|
|
|
void *p;
|
2018-10-05 01:54:54 +02:00
|
|
|
|
|
|
|
|
uint8_t crtc[128], gdcreg[64], attrregs[32], seqregs[64],
|
|
|
|
|
egapal[16],
|
|
|
|
|
*vram, *changedvram;
|
|
|
|
|
|
|
|
|
|
uint8_t crtcreg, gdcaddr,
|
|
|
|
|
attrff, attr_palette_enable, attraddr, seqaddr,
|
|
|
|
|
miscout, cgastat, scrblank,
|
|
|
|
|
plane_mask, writemask,
|
|
|
|
|
colourcompare, colournocare,
|
|
|
|
|
dac_mask, dac_status,
|
|
|
|
|
ksc5601_sbyte_mask;
|
|
|
|
|
|
2020-01-18 22:25:52 +01:00
|
|
|
int vertical_linedbl;
|
|
|
|
|
|
|
|
|
|
/*Used to implement CRTC[0x17] bit 2 hsync divisor*/
|
|
|
|
|
int hsync_divisor;
|
|
|
|
|
|
2018-10-05 01:54:54 +02:00
|
|
|
void *ramdac, *clock_gen;
|
2016-06-26 00:34:39 +02:00
|
|
|
} svga_t;
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
extern int svga_init(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);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
void svga_add_status_info(char *s, int max_len, void *p);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
extern uint8_t svga_rotate[8][256];
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02: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
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_t *svga_get_pri();
|
|
|
|
|
void svga_set_override(svga_t *svga, int val);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02: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
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
uint32_t svga_mask_addr(uint32_t addr, svga_t *svga);
|
|
|
|
|
uint32_t svga_mask_changedaddr(uint32_t addr, svga_t *svga);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
void svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga);
|
2017-05-05 01:49:42 +02:00
|
|
|
|
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. */
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
extern void att49x_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga);
|
|
|
|
|
extern uint8_t att49x_ramdac_in(uint16_t addr, void *p, svga_t *svga);
|
|
|
|
|
|
|
|
|
|
extern float av9194_getclock(int clock, void *p);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
extern void icd2061_write(void *p, int val);
|
|
|
|
|
extern float icd2061_getclock(int clock, void *p);
|
|
|
|
|
|
|
|
|
|
/* The code is the same, the #define's are so that the correct name can be used. */
|
|
|
|
|
#define ics9161_write icd2061_write
|
|
|
|
|
#define ics9161_getclock icd2061_getclock
|
|
|
|
|
|
|
|
|
|
extern void ics2595_write(void *p, int strobe, int dat);
|
|
|
|
|
extern double ics2595_getclock(void *p);
|
|
|
|
|
extern void ics2595_setclock(void *p, double clock);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef EMU_DEVICE_H
|
|
|
|
|
extern const device_t ati68860_ramdac_device;
|
|
|
|
|
extern const device_t att490_ramdac_device;
|
|
|
|
|
extern const device_t att492_ramdac_device;
|
|
|
|
|
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;
|
|
|
|
|
extern const device_t ics2595_device;
|
|
|
|
|
extern const device_t icd2061_device;
|
|
|
|
|
extern const device_t ics9161_device;
|
|
|
|
|
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;
|
|
|
|
|
#endif
|