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.
|
|
|
|
|
*
|
2017-09-23 21:12:26 -04:00
|
|
|
* This is intended to be used by another SVGA driver,
|
|
|
|
|
* and not as a card in it's own right.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2020-01-20 05:36:44 +01:00
|
|
|
* Version: @(#)vid_svga.c 1.0.42 2020/01/20
|
2017-09-23 21:12:26 -04:00
|
|
|
*
|
|
|
|
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
2017-05-30 03:38:38 +02:00
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2017-10-11 05:40:44 -04:00
|
|
|
*
|
2019-09-26 16:00:43 +02:00
|
|
|
* Copyright 2008-2019 Sarah Walker.
|
|
|
|
|
* Copyright 2016-2019 Miran Grca.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
2018-01-25 19:35:23 +01:00
|
|
|
#include <inttypes.h>
|
2016-07-19 02:44:32 +02:00
|
|
|
#include <stdio.h>
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <string.h>
|
2016-06-26 00:34:39 +02:00
|
|
|
#include <stdlib.h>
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <wchar.h>
|
2017-10-17 01:59:09 -04:00
|
|
|
#include "../86box.h"
|
2017-11-05 01:57:04 -05:00
|
|
|
#include "../cpu/cpu.h"
|
2017-11-02 02:28:00 -05:00
|
|
|
#include "../machine/machine.h"
|
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
|
|
|
#include "../timer.h"
|
2017-05-06 17:48:33 +02:00
|
|
|
#include "../io.h"
|
2017-11-02 02:28:00 -05:00
|
|
|
#include "../pit.h"
|
2017-05-06 17:48:33 +02:00
|
|
|
#include "../mem.h"
|
2017-09-25 04:31:20 -04:00
|
|
|
#include "../rom.h"
|
2016-06-26 00:34:39 +02:00
|
|
|
#include "video.h"
|
|
|
|
|
#include "vid_svga.h"
|
|
|
|
|
#include "vid_svga_render.h"
|
2017-05-06 17:48:33 +02:00
|
|
|
|
2016-06-26 00:34:39 +02:00
|
|
|
|
|
|
|
|
void svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga);
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
extern int cyc_total;
|
|
|
|
|
extern uint8_t edatlookup[4][4];
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
uint8_t svga_rotate[8][256];
|
|
|
|
|
|
2016-06-26 00:34:39 +02:00
|
|
|
/*Primary SVGA device. As multiple video cards are not yet supported this is the
|
|
|
|
|
only SVGA device.*/
|
2018-04-25 23:51:13 +02:00
|
|
|
static svga_t *svga_pri;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
svga_t
|
|
|
|
|
*svga_get_pri()
|
|
|
|
|
{
|
|
|
|
|
return svga_pri;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
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
|
|
|
if (svga->override && !val)
|
|
|
|
|
svga->fullchange = changeframecount;
|
|
|
|
|
svga->override = val;
|
2019-10-20 15:09:38 +02:00
|
|
|
|
|
|
|
|
if (!val) {
|
|
|
|
|
/* Override turned off, restore overscan X and Y per the CRTC. */
|
|
|
|
|
if (enable_overscan) {
|
|
|
|
|
overscan_y = (svga->rowcount + 1) << 1;
|
|
|
|
|
|
|
|
|
|
if (overscan_y < 16)
|
|
|
|
|
overscan_y = 16;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
overscan_x = (svga->seqregs[1] & 1) ? 16 : 18;
|
|
|
|
|
|
|
|
|
|
if (svga->seqregs[1] & 8)
|
|
|
|
|
overscan_x <<= 1;
|
|
|
|
|
} else
|
|
|
|
|
overscan_x = overscan_y = 16;
|
|
|
|
|
/* Override turned off, fix overcan X and Y to 16. */
|
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)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_t *svga = (svga_t *)p;
|
|
|
|
|
int c;
|
2018-10-04 01:19:43 +02:00
|
|
|
uint8_t o, index;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
switch (addr) {
|
|
|
|
|
case 0x3c0:
|
|
|
|
|
case 0x3c1:
|
|
|
|
|
if (!svga->attrff) {
|
|
|
|
|
svga->attraddr = val & 31;
|
|
|
|
|
if ((val & 0x20) != svga->attr_palette_enable) {
|
|
|
|
|
svga->fullchange = 3;
|
|
|
|
|
svga->attr_palette_enable = val & 0x20;
|
|
|
|
|
svga_recalctimings(svga);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2018-09-10 23:01:01 +02:00
|
|
|
if ((svga->attraddr == 0x13) && (svga->attrregs[0x13] != val))
|
|
|
|
|
svga->fullchange = changeframecount;
|
2016-06-26 00:34:39 +02:00
|
|
|
o = svga->attrregs[svga->attraddr & 31];
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->attrregs[svga->attraddr & 31] = val;
|
|
|
|
|
if (svga->attraddr < 16)
|
|
|
|
|
svga->fullchange = changeframecount;
|
|
|
|
|
if (svga->attraddr == 0x10 || svga->attraddr == 0x14 || svga->attraddr < 0x10) {
|
|
|
|
|
for (c = 0; c < 16; c++) {
|
|
|
|
|
if (svga->attrregs[0x10] & 0x80) {
|
|
|
|
|
svga->egapal[c] = (svga->attrregs[c] & 0xf) |
|
|
|
|
|
((svga->attrregs[0x14] & 0xf) << 4);
|
|
|
|
|
} else {
|
|
|
|
|
svga->egapal[c] = (svga->attrregs[c] & 0x3f) |
|
|
|
|
|
((svga->attrregs[0x14] & 0xc) << 4);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-03-23 04:40:49 +01:00
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
/* Recalculate timings on change of attribute register 0x11
|
|
|
|
|
(overscan border color) too. */
|
|
|
|
|
if (svga->attraddr == 0x10) {
|
|
|
|
|
if (o != val)
|
|
|
|
|
svga_recalctimings(svga);
|
|
|
|
|
} else if (svga->attraddr == 0x11) {
|
|
|
|
|
svga->overscan_color = svga->pallook[svga->attrregs[0x11]];
|
|
|
|
|
if (o != val)
|
|
|
|
|
svga_recalctimings(svga);
|
|
|
|
|
} else if (svga->attraddr == 0x12) {
|
|
|
|
|
if ((val & 0xf) != svga->plane_mask)
|
|
|
|
|
svga->fullchange = changeframecount;
|
|
|
|
|
svga->plane_mask = val & 0xf;
|
2018-03-23 04:40:49 +01:00
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
svga->attrff ^= 1;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c2:
|
|
|
|
|
svga->miscout = val;
|
|
|
|
|
svga->vidclock = val & 4;
|
|
|
|
|
io_removehandler(0x03a0, 0x0020, svga->video_in, NULL, NULL, svga->video_out, NULL, NULL, svga->p);
|
|
|
|
|
if (!(val & 1))
|
|
|
|
|
io_sethandler(0x03a0, 0x0020, svga->video_in, NULL, NULL, svga->video_out, NULL, NULL, svga->p);
|
|
|
|
|
svga_recalctimings(svga);
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c4:
|
|
|
|
|
svga->seqaddr = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c5:
|
|
|
|
|
if (svga->seqaddr > 0xf)
|
|
|
|
|
return;
|
|
|
|
|
o = svga->seqregs[svga->seqaddr & 0xf];
|
|
|
|
|
svga->seqregs[svga->seqaddr & 0xf] = val;
|
|
|
|
|
if (o != val && (svga->seqaddr & 0xf) == 1)
|
|
|
|
|
svga_recalctimings(svga);
|
|
|
|
|
switch (svga->seqaddr & 0xf) {
|
|
|
|
|
case 1:
|
|
|
|
|
if (svga->scrblank && !(val & 0x20))
|
|
|
|
|
svga->fullchange = 3;
|
|
|
|
|
svga->scrblank = (svga->scrblank & ~0x20) | (val & 0x20);
|
|
|
|
|
svga_recalctimings(svga);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2019-10-01 15:14:51 +02:00
|
|
|
svga->writemask = val & 0xf;
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
svga->charsetb = (((val >> 2) & 3) * 0x10000) + 2;
|
|
|
|
|
svga->charseta = ((val & 3) * 0x10000) + 2;
|
|
|
|
|
if (val & 0x10)
|
|
|
|
|
svga->charseta += 0x8000;
|
|
|
|
|
if (val & 0x20)
|
|
|
|
|
svga->charsetb += 0x8000;
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
svga->chain2_write = !(val & 4);
|
|
|
|
|
svga->chain4 = val & 8;
|
|
|
|
|
svga->fast = (svga->gdcreg[8] == 0xff && !(svga->gdcreg[3] & 0x18) &&
|
2019-10-01 15:14:51 +02:00
|
|
|
!svga->gdcreg[1]) && svga->chain4 && !(svga->adv_flags & FLAG_ADDR_BY8);
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c6:
|
|
|
|
|
svga->dac_mask = val;
|
|
|
|
|
break;
|
2018-10-04 01:19:43 +02:00
|
|
|
case 0x3c7:
|
|
|
|
|
case 0x3c8:
|
|
|
|
|
svga->dac_pos = 0;
|
|
|
|
|
svga->dac_status = addr & 0x03;
|
|
|
|
|
svga->dac_addr = (val + (addr & 0x01)) & 255;
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 0x3c9:
|
|
|
|
|
svga->fullchange = changeframecount;
|
|
|
|
|
switch (svga->dac_pos) {
|
|
|
|
|
case 0:
|
|
|
|
|
svga->dac_r = val;
|
|
|
|
|
svga->dac_pos++;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
svga->dac_g = val;
|
|
|
|
|
svga->dac_pos++;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2018-10-04 01:19:43 +02:00
|
|
|
index = svga->dac_addr & 255;
|
|
|
|
|
svga->vgapal[index].r = svga->dac_r;
|
|
|
|
|
svga->vgapal[index].g = svga->dac_g;
|
|
|
|
|
svga->vgapal[index].b = val;
|
2018-04-25 23:51:13 +02:00
|
|
|
if (svga->ramdac_type == RAMDAC_8BIT)
|
2018-10-04 01:19:43 +02:00
|
|
|
svga->pallook[index] = makecol32(svga->vgapal[index].r, svga->vgapal[index].g, svga->vgapal[index].b);
|
2018-04-25 23:51:13 +02:00
|
|
|
else
|
2018-10-04 01:19:43 +02:00
|
|
|
svga->pallook[index] = makecol32(video_6to8[svga->vgapal[index].r & 0x3f], video_6to8[svga->vgapal[index].g & 0x3f], video_6to8[svga->vgapal[index].b & 0x3f]);
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->dac_pos = 0;
|
2018-10-04 01:19:43 +02:00
|
|
|
svga->dac_addr = (svga->dac_addr + 1) & 255;
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0x3ce:
|
|
|
|
|
svga->gdcaddr = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3cf:
|
|
|
|
|
o = svga->gdcreg[svga->gdcaddr & 15];
|
|
|
|
|
switch (svga->gdcaddr & 15) {
|
|
|
|
|
case 2:
|
2019-10-01 15:14:51 +02:00
|
|
|
svga->colourcompare = val;
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
svga->readplane = val & 3;
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
svga->writemode = val & 3;
|
|
|
|
|
svga->readmode = val & 8;
|
|
|
|
|
svga->chain2_read = val & 0x10;
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
if ((svga->gdcreg[6] & 0xc) != (val & 0xc)) {
|
|
|
|
|
switch (val&0xC) {
|
|
|
|
|
case 0x0: /*128k at A0000*/
|
|
|
|
|
mem_mapping_set_addr(&svga->mapping, 0xa0000, 0x20000);
|
|
|
|
|
svga->banked_mask = 0xffff;
|
|
|
|
|
break;
|
|
|
|
|
case 0x4: /*64k at A0000*/
|
|
|
|
|
mem_mapping_set_addr(&svga->mapping, 0xa0000, 0x10000);
|
|
|
|
|
svga->banked_mask = 0xffff;
|
|
|
|
|
break;
|
|
|
|
|
case 0x8: /*32k at B0000*/
|
|
|
|
|
mem_mapping_set_addr(&svga->mapping, 0xb0000, 0x08000);
|
|
|
|
|
svga->banked_mask = 0x7fff;
|
|
|
|
|
break;
|
|
|
|
|
case 0xC: /*32k at B8000*/
|
|
|
|
|
mem_mapping_set_addr(&svga->mapping, 0xb8000, 0x08000);
|
|
|
|
|
svga->banked_mask = 0x7fff;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
2019-10-01 15:14:51 +02:00
|
|
|
svga->colournocare = val;
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
svga->gdcreg[svga->gdcaddr & 15] = val;
|
|
|
|
|
svga->fast = (svga->gdcreg[8] == 0xff && !(svga->gdcreg[3] & 0x18) &&
|
|
|
|
|
!svga->gdcreg[1]) && svga->chain4;
|
|
|
|
|
if (((svga->gdcaddr & 15) == 5 && (val ^ o) & 0x70) ||
|
|
|
|
|
((svga->gdcaddr & 15) == 6 && (val ^ o) & 1))
|
|
|
|
|
svga_recalctimings(svga);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
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 = (svga_t *)p;
|
2018-10-04 01:19:43 +02:00
|
|
|
uint8_t index, ret = 0xff;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
switch (addr) {
|
|
|
|
|
case 0x3c0:
|
|
|
|
|
ret = svga->attraddr | svga->attr_palette_enable;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c1:
|
|
|
|
|
ret = svga->attrregs[svga->attraddr];
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c2:
|
|
|
|
|
if ((svga->vgapal[0].r + svga->vgapal[0].g + svga->vgapal[0].b) >= 0x4e)
|
|
|
|
|
ret = 0;
|
|
|
|
|
else
|
|
|
|
|
ret = 0x10;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c4:
|
|
|
|
|
ret = svga->seqaddr;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c5:
|
|
|
|
|
ret = svga->seqregs[svga->seqaddr & 0x0f];
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c6:
|
|
|
|
|
ret = svga->dac_mask;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c7:
|
|
|
|
|
ret = svga->dac_status;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c8:
|
2018-10-04 01:19:43 +02:00
|
|
|
ret = svga->dac_addr;
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 0x3c9:
|
2018-10-04 01:19:43 +02:00
|
|
|
index = (svga->dac_addr - 1) & 255;
|
2018-04-25 23:51:13 +02:00
|
|
|
switch (svga->dac_pos) {
|
|
|
|
|
case 0:
|
|
|
|
|
svga->dac_pos++;
|
|
|
|
|
if (svga->ramdac_type == RAMDAC_8BIT)
|
2018-10-04 01:19:43 +02:00
|
|
|
ret = svga->vgapal[index].r;
|
2018-04-25 23:51:13 +02:00
|
|
|
else
|
2018-10-04 01:19:43 +02:00
|
|
|
ret = svga->vgapal[index].r & 0x3f;
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
svga->dac_pos++;
|
|
|
|
|
if (svga->ramdac_type == RAMDAC_8BIT)
|
2018-10-04 01:19:43 +02:00
|
|
|
ret = svga->vgapal[index].g;
|
2018-04-25 23:51:13 +02:00
|
|
|
else
|
2018-10-04 01:19:43 +02:00
|
|
|
ret = svga->vgapal[index].g & 0x3f;
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
svga->dac_pos=0;
|
2018-10-04 01:19:43 +02:00
|
|
|
svga->dac_addr = (svga->dac_addr + 1) & 255;
|
2018-04-25 23:51:13 +02:00
|
|
|
if (svga->ramdac_type == RAMDAC_8BIT)
|
2018-10-04 01:19:43 +02:00
|
|
|
ret = svga->vgapal[index].b;
|
2018-04-25 23:51:13 +02:00
|
|
|
else
|
2018-10-04 01:19:43 +02:00
|
|
|
ret = svga->vgapal[index].b & 0x3f;
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0x3cc:
|
|
|
|
|
ret = svga->miscout;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3ce:
|
|
|
|
|
ret = svga->gdcaddr;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3cf:
|
2016-06-26 00:34:39 +02:00
|
|
|
/* The spec says GDC addresses 0xF8 to 0xFB return the latch. */
|
2018-04-25 23:51:13 +02:00
|
|
|
switch(svga->gdcaddr) {
|
|
|
|
|
case 0xf8:
|
2019-12-04 07:20:58 +01:00
|
|
|
ret = svga->latch.b[0];
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 0xf9:
|
2019-12-04 07:20:58 +01:00
|
|
|
ret = svga->latch.b[1];
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 0xfa:
|
2019-12-04 07:20:58 +01:00
|
|
|
ret = svga->latch.b[2];
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 0xfb:
|
2019-12-04 07:20:58 +01:00
|
|
|
ret = svga->latch.b[3];
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ret = svga->gdcreg[svga->gdcaddr & 0xf];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0x3da:
|
|
|
|
|
svga->attrff = 0;
|
|
|
|
|
|
|
|
|
|
if (svga->cgastat & 0x01)
|
|
|
|
|
svga->cgastat &= ~0x30;
|
|
|
|
|
else
|
|
|
|
|
svga->cgastat ^= 0x30;
|
|
|
|
|
ret = svga->cgastat;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(ret);
|
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)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
int c;
|
|
|
|
|
|
|
|
|
|
if (svga->ramdac_type != type) {
|
|
|
|
|
svga->ramdac_type = type;
|
|
|
|
|
|
|
|
|
|
for (c = 0; c < 256; c++) {
|
|
|
|
|
if (svga->ramdac_type == RAMDAC_8BIT)
|
|
|
|
|
svga->pallook[c] = makecol32(svga->vgapal[c].r, svga->vgapal[c].g, svga->vgapal[c].b);
|
|
|
|
|
else
|
|
|
|
|
svga->pallook[c] = makecol32((svga->vgapal[c].r & 0x3f) * 4,
|
|
|
|
|
(svga->vgapal[c].g & 0x3f) * 4,
|
|
|
|
|
(svga->vgapal[c].b & 0x3f) * 4);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_recalctimings(svga_t *svga)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
double crtcconst, _dispontime, _dispofftime, disptime;
|
|
|
|
|
|
|
|
|
|
svga->vtotal = svga->crtc[6];
|
|
|
|
|
svga->dispend = svga->crtc[0x12];
|
|
|
|
|
svga->vsyncstart = svga->crtc[0x10];
|
|
|
|
|
svga->split = svga->crtc[0x18];
|
|
|
|
|
svga->vblankstart = svga->crtc[0x15];
|
|
|
|
|
|
|
|
|
|
if (svga->crtc[7] & 1)
|
|
|
|
|
svga->vtotal |= 0x100;
|
|
|
|
|
if (svga->crtc[7] & 32)
|
|
|
|
|
svga->vtotal |= 0x200;
|
|
|
|
|
svga->vtotal += 2;
|
|
|
|
|
|
|
|
|
|
if (svga->crtc[7] & 2)
|
|
|
|
|
svga->dispend |= 0x100;
|
|
|
|
|
if (svga->crtc[7] & 64)
|
|
|
|
|
svga->dispend |= 0x200;
|
|
|
|
|
svga->dispend++;
|
|
|
|
|
|
|
|
|
|
if (svga->crtc[7] & 4)
|
|
|
|
|
svga->vsyncstart |= 0x100;
|
|
|
|
|
if (svga->crtc[7] & 128)
|
|
|
|
|
svga->vsyncstart |= 0x200;
|
|
|
|
|
svga->vsyncstart++;
|
|
|
|
|
|
|
|
|
|
if (svga->crtc[7] & 0x10)
|
|
|
|
|
svga->split|=0x100;
|
|
|
|
|
if (svga->crtc[9] & 0x40)
|
|
|
|
|
svga->split|=0x200;
|
|
|
|
|
svga->split++;
|
|
|
|
|
|
|
|
|
|
if (svga->crtc[7] & 0x08)
|
|
|
|
|
svga->vblankstart |= 0x100;
|
|
|
|
|
if (svga->crtc[9] & 0x20)
|
|
|
|
|
svga->vblankstart |= 0x200;
|
|
|
|
|
svga->vblankstart++;
|
|
|
|
|
|
|
|
|
|
svga->hdisp = svga->crtc[1];
|
|
|
|
|
svga->hdisp++;
|
|
|
|
|
|
|
|
|
|
svga->htotal = svga->crtc[0];
|
|
|
|
|
svga->htotal += 6; /*+6 is required for Tyrian*/
|
|
|
|
|
|
|
|
|
|
svga->rowoffset = svga->crtc[0x13];
|
|
|
|
|
|
|
|
|
|
svga->clock = (svga->vidclock) ? VGACONST2 : VGACONST1;
|
|
|
|
|
|
|
|
|
|
svga->lowres = svga->attrregs[0x10] & 0x40;
|
|
|
|
|
|
|
|
|
|
svga->interlace = 0;
|
|
|
|
|
|
|
|
|
|
svga->ma_latch = (svga->crtc[0xc] << 8) | svga->crtc[0xd];
|
|
|
|
|
|
|
|
|
|
svga->hdisp_time = svga->hdisp;
|
|
|
|
|
svga->render = svga_render_blank;
|
|
|
|
|
if (!svga->scrblank && svga->attr_palette_enable) {
|
|
|
|
|
if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) { /*Text mode*/
|
|
|
|
|
if (svga->seqregs[1] & 8) /*40 column*/ {
|
|
|
|
|
svga->render = svga_render_text_40;
|
|
|
|
|
svga->hdisp *= (svga->seqregs[1] & 1) ? 16 : 18;
|
|
|
|
|
} else {
|
|
|
|
|
svga->render = svga_render_text_80;
|
|
|
|
|
svga->hdisp *= (svga->seqregs[1] & 1) ? 8 : 9;
|
|
|
|
|
}
|
|
|
|
|
svga->hdisp_old = svga->hdisp;
|
|
|
|
|
} else {
|
|
|
|
|
svga->hdisp *= (svga->seqregs[1] & 8) ? 16 : 8;
|
|
|
|
|
svga->hdisp_old = svga->hdisp;
|
|
|
|
|
|
|
|
|
|
switch (svga->gdcreg[5] & 0x60) {
|
|
|
|
|
case 0x00:
|
|
|
|
|
if (svga->seqregs[1] & 8) /*Low res (320)*/
|
|
|
|
|
svga->render = svga_render_4bpp_lowres;
|
|
|
|
|
else
|
|
|
|
|
svga->render = svga_render_4bpp_highres;
|
|
|
|
|
break;
|
|
|
|
|
case 0x20: /*4 colours*/
|
|
|
|
|
if (svga->seqregs[1] & 8) /*Low res (320)*/
|
|
|
|
|
svga->render = svga_render_2bpp_lowres;
|
|
|
|
|
else
|
|
|
|
|
svga->render = svga_render_2bpp_highres;
|
|
|
|
|
break;
|
|
|
|
|
case 0x40: case 0x60: /*256+ colours*/
|
|
|
|
|
switch (svga->bpp) {
|
|
|
|
|
case 8:
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->map8 = svga->pallook;
|
2018-04-25 23:51:13 +02:00
|
|
|
if (svga->lowres)
|
|
|
|
|
svga->render = svga_render_8bpp_lowres;
|
|
|
|
|
else
|
|
|
|
|
svga->render = svga_render_8bpp_highres;
|
|
|
|
|
break;
|
|
|
|
|
case 15:
|
|
|
|
|
if (svga->lowres)
|
|
|
|
|
svga->render = svga_render_15bpp_lowres;
|
|
|
|
|
else
|
|
|
|
|
svga->render = svga_render_15bpp_highres;
|
|
|
|
|
break;
|
|
|
|
|
case 16:
|
|
|
|
|
if (svga->lowres)
|
|
|
|
|
svga->render = svga_render_16bpp_lowres;
|
|
|
|
|
else
|
|
|
|
|
svga->render = svga_render_16bpp_highres;
|
|
|
|
|
break;
|
|
|
|
|
case 24:
|
|
|
|
|
if (svga->lowres)
|
|
|
|
|
svga->render = svga_render_24bpp_lowres;
|
|
|
|
|
else
|
|
|
|
|
svga->render = svga_render_24bpp_highres;
|
|
|
|
|
break;
|
|
|
|
|
case 32:
|
|
|
|
|
if (svga->lowres)
|
|
|
|
|
svga->render = svga_render_32bpp_lowres;
|
|
|
|
|
else
|
|
|
|
|
svga->render = svga_render_32bpp_highres;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
svga->linedbl = svga->crtc[9] & 0x80;
|
|
|
|
|
svga->rowcount = svga->crtc[9] & 31;
|
2020-01-18 21:35:26 +01:00
|
|
|
svga->char_width = (svga->seqregs[1] & 1) ? 8 : 9;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (enable_overscan) {
|
|
|
|
|
overscan_y = (svga->rowcount + 1) << 1;
|
2019-10-20 15:09:38 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (overscan_y < 16)
|
|
|
|
|
overscan_y = 16;
|
|
|
|
|
}
|
2019-10-20 15:09:38 +02:00
|
|
|
|
2019-11-19 19:18:44 +01:00
|
|
|
if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) {
|
|
|
|
|
overscan_x = (svga->seqregs[1] & 1) ? 16 : 18;
|
2019-10-20 15:09:38 +02:00
|
|
|
|
2019-11-19 19:18:44 +01:00
|
|
|
if (svga->seqregs[1] & 8)
|
|
|
|
|
overscan_x <<= 1;
|
|
|
|
|
} else
|
|
|
|
|
overscan_x = 16;
|
2019-10-20 15:09:38 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (svga->recalctimings_ex)
|
|
|
|
|
svga->recalctimings_ex(svga);
|
|
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->y_add = (overscan_y >> 1) - (svga->crtc[8] & 0x1f);
|
|
|
|
|
svga->x_add = (overscan_x >> 1);
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (svga->vblankstart < svga->dispend)
|
|
|
|
|
svga->dispend = svga->vblankstart;
|
|
|
|
|
|
2020-01-18 21:35:26 +01:00
|
|
|
crtcconst = svga->clock * svga->char_width;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
disptime = svga->htotal;
|
|
|
|
|
_dispontime = svga->hdisp_time;
|
|
|
|
|
|
|
|
|
|
if (svga->seqregs[1] & 8) {
|
|
|
|
|
disptime *= 2;
|
|
|
|
|
_dispontime *= 2;
|
|
|
|
|
}
|
2019-11-19 19:18:44 +01:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
_dispofftime = disptime - _dispontime;
|
|
|
|
|
_dispontime *= crtcconst;
|
|
|
|
|
_dispofftime *= crtcconst;
|
|
|
|
|
|
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
|
|
|
svga->dispontime = (uint64_t)(_dispontime);
|
|
|
|
|
svga->dispofftime = (uint64_t)(_dispofftime);
|
|
|
|
|
if (svga->dispontime < TIMER_USEC)
|
|
|
|
|
svga->dispontime = TIMER_USEC;
|
|
|
|
|
if (svga->dispofftime < TIMER_USEC)
|
|
|
|
|
svga->dispofftime = TIMER_USEC;
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
static void
|
|
|
|
|
svga_do_render(svga_t *svga)
|
|
|
|
|
{
|
|
|
|
|
if (!svga->override) {
|
|
|
|
|
svga->render(svga);
|
|
|
|
|
|
|
|
|
|
svga->x_add = (overscan_x >> 1);
|
|
|
|
|
svga_render_overscan_left(svga);
|
|
|
|
|
svga_render_overscan_right(svga);
|
|
|
|
|
svga->x_add = (overscan_x >> 1) - svga->scrollcache;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (svga->overlay_on) {
|
|
|
|
|
if (!svga->override && svga->overlay_draw)
|
|
|
|
|
svga->overlay_draw(svga, svga->displine + svga->y_add);
|
|
|
|
|
svga->overlay_on--;
|
|
|
|
|
if (svga->overlay_on && svga->interlace)
|
|
|
|
|
svga->overlay_on--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (svga->dac_hwcursor_on) {
|
|
|
|
|
if (!svga->override && svga->dac_hwcursor_draw)
|
|
|
|
|
svga->dac_hwcursor_draw(svga, svga->displine + svga->y_add);
|
|
|
|
|
svga->dac_hwcursor_on--;
|
|
|
|
|
if (svga->dac_hwcursor_on && svga->interlace)
|
|
|
|
|
svga->dac_hwcursor_on--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (svga->hwcursor_on) {
|
|
|
|
|
if (!svga->override && svga->hwcursor_draw)
|
|
|
|
|
svga->hwcursor_draw(svga, svga->displine + svga->y_add);
|
|
|
|
|
svga->hwcursor_on--;
|
|
|
|
|
if (svga->hwcursor_on && svga->interlace)
|
|
|
|
|
svga->hwcursor_on--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
void
|
|
|
|
|
svga_poll(void *p)
|
|
|
|
|
{
|
|
|
|
|
svga_t *svga = (svga_t *)p;
|
2019-10-20 15:09:38 +02:00
|
|
|
uint32_t x, blink_delay;
|
2018-04-25 23:51:13 +02:00
|
|
|
int wx, wy;
|
2019-11-19 19:18:44 +01:00
|
|
|
int skip = (svga->crtc[8] >> 5) & 0x03;
|
2020-01-20 05:36:44 +01:00
|
|
|
int ret, old_ma;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
if (!svga->linepos) {
|
|
|
|
|
if (svga->displine == svga->hwcursor_latch.y && svga->hwcursor_latch.ena) {
|
|
|
|
|
svga->hwcursor_on = 64 - svga->hwcursor_latch.yoff;
|
|
|
|
|
svga->hwcursor_oddeven = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (svga->displine == (svga->hwcursor_latch.y + 1) && svga->hwcursor_latch.ena &&
|
|
|
|
|
svga->interlace) {
|
|
|
|
|
svga->hwcursor_on = 64 - (svga->hwcursor_latch.yoff + 1);
|
|
|
|
|
svga->hwcursor_oddeven = 1;
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
if (svga->displine == svga->dac_hwcursor_latch.y && svga->dac_hwcursor_latch.ena) {
|
|
|
|
|
svga->dac_hwcursor_on = 64 - svga->dac_hwcursor_latch.yoff;
|
|
|
|
|
svga->dac_hwcursor_oddeven = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (svga->displine == (svga->dac_hwcursor_latch.y + 1) && svga->dac_hwcursor_latch.ena &&
|
|
|
|
|
svga->interlace) {
|
|
|
|
|
svga->dac_hwcursor_on = 64 - (svga->dac_hwcursor_latch.yoff + 1);
|
|
|
|
|
svga->dac_hwcursor_oddeven = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (svga->displine == svga->overlay_latch.y && svga->overlay_latch.ena) {
|
|
|
|
|
svga->overlay_on = svga->overlay_latch.ysize - svga->overlay_latch.yoff;
|
|
|
|
|
svga->overlay_oddeven = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (svga->displine == svga->overlay_latch.y+1 && svga->overlay_latch.ena && svga->interlace) {
|
|
|
|
|
svga->overlay_on = svga->overlay_latch.ysize - svga->overlay_latch.yoff;
|
|
|
|
|
svga->overlay_oddeven = 1;
|
2017-05-19 04:35:59 +02:00
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
|
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
|
|
|
timer_advance_u64(&svga->timer, svga->dispofftime);
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->cgastat |= 1;
|
|
|
|
|
svga->linepos = 1;
|
|
|
|
|
|
|
|
|
|
if (svga->dispon) {
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->hdisp_on = 1;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
svga->ma &= svga->vram_display_mask;
|
|
|
|
|
if (svga->firstline == 2000) {
|
|
|
|
|
svga->firstline = svga->displine;
|
|
|
|
|
video_wait_for_buffer();
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
if (svga->hwcursor_on || svga->dac_hwcursor_on || svga->overlay_on) {
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->changedvram[svga->ma >> 12] = svga->changedvram[(svga->ma >> 12) + 1] =
|
|
|
|
|
svga->interlace ? 3 : 2;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
if (svga->vertical_linedbl) {
|
|
|
|
|
old_ma = svga->ma;
|
2019-11-19 19:18:44 +01:00
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
svga->displine <<= 1;
|
|
|
|
|
svga->y_add <<= 1;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
svga_do_render(svga);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
svga->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
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
svga->ma = old_ma;
|
|
|
|
|
|
|
|
|
|
svga_do_render(svga);
|
|
|
|
|
|
|
|
|
|
svga->y_add >>= 1;
|
|
|
|
|
svga->displine >>= 1;
|
|
|
|
|
} else
|
|
|
|
|
svga_do_render(svga);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (svga->lastline < svga->displine)
|
|
|
|
|
svga->lastline = svga->displine;
|
|
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->displine++;
|
|
|
|
|
if (svga->interlace)
|
|
|
|
|
svga->displine++;
|
|
|
|
|
if ((svga->cgastat & 8) && ((svga->displine & 15) == (svga->crtc[0x11] & 15)) && svga->vslines)
|
|
|
|
|
svga->cgastat &= ~8;
|
|
|
|
|
svga->vslines++;
|
|
|
|
|
if (svga->displine > 1500)
|
|
|
|
|
svga->displine = 0;
|
|
|
|
|
} else {
|
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
|
|
|
timer_advance_u64(&svga->timer, svga->dispontime);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
if (svga->dispon)
|
|
|
|
|
svga->cgastat &= ~1;
|
|
|
|
|
svga->hdisp_on = 0;
|
|
|
|
|
|
|
|
|
|
svga->linepos = 0;
|
2019-10-20 15:09:38 +02:00
|
|
|
if ((svga->sc == (svga->crtc[11] & 31)) || (svga->sc == svga->rowcount))
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->con = 0;
|
|
|
|
|
if (svga->dispon) {
|
|
|
|
|
if (svga->linedbl && !svga->linecountff) {
|
|
|
|
|
svga->linecountff = 1;
|
|
|
|
|
svga->ma = svga->maback;
|
|
|
|
|
} else if (svga->sc == svga->rowcount) {
|
|
|
|
|
svga->linecountff = 0;
|
|
|
|
|
svga->sc = 0;
|
|
|
|
|
|
|
|
|
|
svga->maback += (svga->rowoffset << 3);
|
|
|
|
|
if (svga->interlace)
|
|
|
|
|
svga->maback += (svga->rowoffset << 3);
|
|
|
|
|
svga->maback &= svga->vram_display_mask;
|
|
|
|
|
svga->ma = svga->maback;
|
|
|
|
|
} else {
|
|
|
|
|
svga->linecountff = 0;
|
|
|
|
|
svga->sc++;
|
|
|
|
|
svga->sc &= 31;
|
|
|
|
|
svga->ma = svga->maback;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-01-18 22:25:52 +01:00
|
|
|
|
2020-01-19 05:45:05 +01:00
|
|
|
svga->hsync_divisor = !svga->hsync_divisor;
|
|
|
|
|
|
|
|
|
|
if (svga->hsync_divisor && (svga->crtc[0x17] & 4))
|
|
|
|
|
return;
|
2020-01-18 22:25:52 +01:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->vc++;
|
|
|
|
|
svga->vc &= 2047;
|
|
|
|
|
|
|
|
|
|
if (svga->vc == svga->split) {
|
2020-01-17 00:24:18 +01:00
|
|
|
ret = 1;
|
|
|
|
|
|
|
|
|
|
if (svga->line_compare)
|
|
|
|
|
ret = svga->line_compare(svga);
|
|
|
|
|
|
|
|
|
|
if (ret) {
|
|
|
|
|
svga->ma = svga->maback = 0;
|
|
|
|
|
svga->sc = 0;
|
|
|
|
|
if (svga->attrregs[0x10] & 0x20) {
|
|
|
|
|
svga->scrollcache = 0;
|
|
|
|
|
svga->x_add = (overscan_x >> 1);
|
|
|
|
|
}
|
2019-11-19 19:18:44 +01:00
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
if (svga->vc == svga->dispend) {
|
|
|
|
|
if (svga->vblank_start)
|
|
|
|
|
svga->vblank_start(svga);
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->dispon = 0;
|
|
|
|
|
blink_delay = (svga->crtc[11] & 0x60) >> 5;
|
2018-04-25 23:51:13 +02:00
|
|
|
if (svga->crtc[10] & 0x20)
|
|
|
|
|
svga->cursoron = 0;
|
2019-10-20 15:09:38 +02:00
|
|
|
else if (blink_delay == 2)
|
|
|
|
|
svga->cursoron = ((svga->blink % 96) >= 48);
|
2018-04-25 23:51:13 +02:00
|
|
|
else
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->cursoron = svga->blink & (16 + (16 * blink_delay));
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
if (!(svga->gdcreg[6] & 1) && !(svga->blink & 15))
|
|
|
|
|
svga->fullchange = 2;
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->blink = (svga->blink + 1) & 0x7f;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
for (x = 0; x < ((svga->vram_mask + 1) >> 12); x++) {
|
|
|
|
|
if (svga->changedvram[x])
|
|
|
|
|
svga->changedvram[x]--;
|
|
|
|
|
}
|
|
|
|
|
if (svga->fullchange)
|
|
|
|
|
svga->fullchange--;
|
|
|
|
|
}
|
|
|
|
|
if (svga->vc == svga->vsyncstart) {
|
|
|
|
|
svga->dispon = 0;
|
|
|
|
|
svga->cgastat |= 8;
|
|
|
|
|
x = svga->hdisp;
|
|
|
|
|
|
|
|
|
|
if (svga->interlace && !svga->oddeven)
|
|
|
|
|
svga->lastline++;
|
|
|
|
|
if (svga->interlace && svga->oddeven)
|
|
|
|
|
svga->firstline--;
|
|
|
|
|
|
|
|
|
|
wx = x;
|
|
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
if (!svga->override) {
|
|
|
|
|
if (svga->vertical_linedbl) {
|
|
|
|
|
wy = (svga->lastline - svga->firstline) << 1;
|
|
|
|
|
svga_doblit(svga->firstline_draw << 1, (svga->lastline_draw + 1) << 1, wx, wy, svga);
|
|
|
|
|
} else {
|
|
|
|
|
wy = svga->lastline - svga->firstline;
|
|
|
|
|
svga_doblit(svga->firstline_draw, svga->lastline_draw + 1, wx, wy, svga);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
svga->firstline = 2000;
|
|
|
|
|
svga->lastline = 0;
|
|
|
|
|
|
|
|
|
|
svga->firstline_draw = 2000;
|
|
|
|
|
svga->lastline_draw = 0;
|
|
|
|
|
|
|
|
|
|
svga->oddeven ^= 1;
|
|
|
|
|
|
|
|
|
|
changeframecount = svga->interlace ? 3 : 2;
|
|
|
|
|
svga->vslines = 0;
|
|
|
|
|
|
|
|
|
|
if (svga->interlace && svga->oddeven)
|
|
|
|
|
svga->ma = svga->maback = svga->ma_latch + (svga->rowoffset << 1);
|
|
|
|
|
else
|
|
|
|
|
svga->ma = svga->maback = svga->ma_latch;
|
|
|
|
|
svga->ca = (svga->crtc[0xe] << 8) | svga->crtc[0xf];
|
|
|
|
|
|
2019-11-19 19:18:44 +01:00
|
|
|
svga->ma = (svga->ma << 2) + (skip << 2);
|
|
|
|
|
svga->maback = (svga->maback << 2) + (skip << 2);
|
|
|
|
|
svga->ca = (svga->ca << 2) + (skip << 2);
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
if (svga->vc == svga->vtotal) {
|
|
|
|
|
svga->vc = 0;
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->sc = 0;
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->dispon = 1;
|
|
|
|
|
svga->displine = (svga->interlace && svga->oddeven) ? 1 : 0;
|
2019-10-20 15:09:38 +02:00
|
|
|
|
|
|
|
|
svga->scrollcache = (svga->attrregs[0x13] & 0x0f);
|
|
|
|
|
if (!(svga->gdcreg[6] & 1) && !(svga->attrregs[0x10] & 1)) { /*Text mode*/
|
|
|
|
|
if (svga->seqregs[1] & 1)
|
|
|
|
|
svga->scrollcache &= 0x07;
|
|
|
|
|
else {
|
|
|
|
|
svga->scrollcache++;
|
|
|
|
|
if (svga->scrollcache > 8)
|
|
|
|
|
svga->scrollcache = 0;
|
|
|
|
|
}
|
|
|
|
|
} else if ((svga->render == svga_render_2bpp_lowres) || (svga->render == svga_render_2bpp_highres) ||
|
|
|
|
|
(svga->render == svga_render_4bpp_lowres) || (svga->render == svga_render_4bpp_highres))
|
|
|
|
|
svga->scrollcache &= 0x07;
|
|
|
|
|
else
|
|
|
|
|
svga->scrollcache = (svga->scrollcache & 0x06) >> 1;
|
|
|
|
|
|
2019-11-19 19:18:44 +01:00
|
|
|
if ((svga->seqregs[1] & 8) || (svga->render == svga_render_8bpp_lowres))
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->scrollcache <<= 1;
|
|
|
|
|
|
|
|
|
|
svga->x_add = (overscan_x >> 1) - svga->scrollcache;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->linecountff = 0;
|
|
|
|
|
|
|
|
|
|
svga->hwcursor_on = 0;
|
|
|
|
|
svga->hwcursor_latch = svga->hwcursor;
|
|
|
|
|
|
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
|
|
|
svga->dac_hwcursor_on = 0;
|
|
|
|
|
svga->dac_hwcursor_latch = svga->dac_hwcursor;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->overlay_on = 0;
|
|
|
|
|
svga->overlay_latch = svga->overlay;
|
|
|
|
|
}
|
|
|
|
|
if (svga->sc == (svga->crtc[10] & 31))
|
|
|
|
|
svga->con = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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))
|
|
|
|
|
{
|
|
|
|
|
int c, d, e;
|
|
|
|
|
|
|
|
|
|
svga->p = p;
|
|
|
|
|
|
|
|
|
|
for (c = 0; c < 256; c++) {
|
|
|
|
|
e = c;
|
|
|
|
|
for (d = 0; d < 8; d++) {
|
|
|
|
|
svga_rotate[d][c] = e;
|
|
|
|
|
e = (e >> 1) | ((e & 1) ? 0x80 : 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
svga->readmode = 0;
|
|
|
|
|
|
|
|
|
|
svga->attrregs[0x11] = 0;
|
|
|
|
|
svga->overscan_color = 0x000000;
|
|
|
|
|
|
|
|
|
|
overscan_x = 16;
|
|
|
|
|
overscan_y = 32;
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->x_add = 8;
|
|
|
|
|
svga->y_add = 16;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
svga->crtc[0] = 63;
|
|
|
|
|
svga->crtc[6] = 255;
|
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
|
|
|
svga->dispontime = 1000ull << 32;
|
|
|
|
|
svga->dispofftime = 1000ull << 32;
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->bpp = 8;
|
|
|
|
|
svga->vram = malloc(memsize);
|
|
|
|
|
svga->vram_max = memsize;
|
|
|
|
|
svga->vram_display_mask = svga->vram_mask = memsize - 1;
|
|
|
|
|
svga->decode_mask = 0x7fffff;
|
2018-04-26 17:37:44 +02:00
|
|
|
svga->changedvram = malloc(memsize >> 12);
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->recalctimings_ex = recalctimings_ex;
|
|
|
|
|
svga->video_in = video_in;
|
|
|
|
|
svga->video_out = video_out;
|
|
|
|
|
svga->hwcursor_draw = hwcursor_draw;
|
|
|
|
|
svga->overlay_draw = overlay_draw;
|
|
|
|
|
|
2018-10-05 01:54:54 +02:00
|
|
|
svga->hwcursor.xsize = svga->hwcursor.ysize = 32;
|
|
|
|
|
svga->hwcursor.yoff = 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
|
|
|
svga->dac_hwcursor.xsize = svga->dac_hwcursor.ysize = 32;
|
|
|
|
|
svga->dac_hwcursor.yoff = 32;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
mem_mapping_add(&svga->mapping, 0xa0000, 0x20000,
|
|
|
|
|
svga_read, svga_readw, svga_readl,
|
|
|
|
|
svga_write, svga_writew, svga_writel,
|
|
|
|
|
NULL, MEM_MAPPING_EXTERNAL, svga);
|
|
|
|
|
|
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
|
|
|
timer_add(&svga->timer, svga_poll, svga, 1);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
svga_pri = svga;
|
|
|
|
|
|
|
|
|
|
svga->ramdac_type = RAMDAC_6BIT;
|
|
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
svga->map8 = svga->pallook;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
return 0;
|
2016-10-08 04:20:30 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_close(svga_t *svga)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
free(svga->changedvram);
|
|
|
|
|
free(svga->vram);
|
|
|
|
|
|
|
|
|
|
svga_pri = NULL;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
static uint32_t
|
|
|
|
|
svga_decode_addr(svga_t *svga, uint32_t addr, int write)
|
|
|
|
|
{
|
|
|
|
|
int memory_map_mode = (svga->gdcreg[6] >> 2) & 3;
|
|
|
|
|
|
|
|
|
|
addr &= 0x1ffff;
|
|
|
|
|
|
|
|
|
|
switch (memory_map_mode) {
|
|
|
|
|
case 0:
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
if (addr >= 0x10000)
|
|
|
|
|
return 0xffffffff;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
addr -= 0x10000;
|
|
|
|
|
if (addr >= 0x8000)
|
|
|
|
|
return 0xffffffff;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
case 3:
|
|
|
|
|
addr -= 0x18000;
|
|
|
|
|
if (addr >= 0x8000)
|
|
|
|
|
return 0xffffffff;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (memory_map_mode <= 1) {
|
|
|
|
|
if (svga->adv_flags & FLAG_EXTRA_BANKS)
|
|
|
|
|
addr = (addr & 0x17fff) + svga->extra_banks[(addr >> 15) & 1];
|
|
|
|
|
else {
|
|
|
|
|
if (write)
|
|
|
|
|
addr += svga->write_bank;
|
|
|
|
|
else
|
|
|
|
|
addr += svga->read_bank;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return addr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
void
|
|
|
|
|
svga_write_common(uint32_t addr, uint8_t val, uint8_t linear, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_t *svga = (svga_t *)p;
|
|
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
int writemask2 = svga->writemask, reset_wm = 0;
|
|
|
|
|
latch_t vall;
|
|
|
|
|
uint8_t wm = svga->writemask;
|
|
|
|
|
uint8_t count, i;
|
2019-10-01 15:14:51 +02:00
|
|
|
|
|
|
|
|
if (svga->adv_flags & FLAG_ADDR_BY8)
|
|
|
|
|
writemask2 = svga->seqregs[2];
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
egawrites++;
|
|
|
|
|
|
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
|
|
|
sub_cycles(video_timing_write_b);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
if (!linear) {
|
2019-12-04 07:20:58 +01:00
|
|
|
addr = svga_decode_addr(svga, addr, 1);
|
|
|
|
|
|
|
|
|
|
if (addr == 0xffffffff)
|
|
|
|
|
return;
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!(svga->gdcreg[6] & 1))
|
|
|
|
|
svga->fullchange = 2;
|
|
|
|
|
|
2019-10-01 16:21:35 +02:00
|
|
|
if ((svga->adv_flags & FLAG_ADDR_BY8) && (svga->writemode < 4))
|
2019-10-01 15:14:51 +02:00
|
|
|
addr <<= 3;
|
2019-10-01 16:21:35 +02:00
|
|
|
else if ((svga->chain4 || svga->fb_only) && (svga->writemode < 4)) {
|
2018-04-25 23:51:13 +02:00
|
|
|
writemask2 = 1 << (addr & 3);
|
|
|
|
|
addr &= ~3;
|
|
|
|
|
} else if (svga->chain2_write) {
|
|
|
|
|
writemask2 &= ~0xa;
|
|
|
|
|
if (addr & 1)
|
|
|
|
|
writemask2 <<= 1;
|
|
|
|
|
addr &= ~1;
|
|
|
|
|
addr <<= 2;
|
|
|
|
|
} else
|
|
|
|
|
addr <<= 2;
|
2019-10-01 15:14:51 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
addr &= svga->decode_mask;
|
|
|
|
|
|
|
|
|
|
if (addr >= svga->vram_max)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
addr &= svga->vram_mask;
|
|
|
|
|
|
|
|
|
|
svga->changedvram[addr >> 12] = changeframecount;
|
|
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
count = 4;
|
|
|
|
|
if (svga->adv_flags & FLAG_LATCH8)
|
|
|
|
|
count = 8;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
switch (svga->writemode) {
|
|
|
|
|
case 0:
|
2019-12-04 07:20:58 +01:00
|
|
|
if (svga->gdcreg[3] & 7)
|
|
|
|
|
val = svga_rotate[svga->gdcreg[3] & 7][val];
|
|
|
|
|
if ((svga->gdcreg[8] == 0xff) && !(svga->gdcreg[3] & 0x18) && (!svga->gdcreg[1] || svga->set_reset_disabled)) {
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
if (writemask2 & (1 << i))
|
|
|
|
|
svga->vram[addr | i] = val;
|
2019-10-01 15:14:51 +02:00
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
return;
|
2019-12-04 07:20:58 +01:00
|
|
|
} else {
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
if (svga->gdcreg[1] & (1 << i))
|
|
|
|
|
vall.b[i] = !!(svga->gdcreg[0] & (1 << i)) * 0xff;
|
|
|
|
|
else
|
|
|
|
|
vall.b[i] = val;
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
2019-12-04 07:20:58 +01:00
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
if (writemask2 & (1 << i))
|
|
|
|
|
svga->vram[addr | i] = svga->latch.b[i];
|
2019-10-01 15:14:51 +02:00
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
return;
|
|
|
|
|
case 2:
|
2019-12-04 07:20:58 +01:00
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
|
vall.b[i] = !!(val & (1 << i)) * 0xff;
|
|
|
|
|
|
|
|
|
|
if (!(svga->gdcreg[3] & 0x18) && (!svga->gdcreg[1] || svga->set_reset_disabled)) {
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
if (writemask2 & (1 << i))
|
|
|
|
|
svga->vram[addr | i] = (vall.b[i] & svga->gdcreg[8]) | (svga->latch.b[i] & ~svga->gdcreg[8]);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
case 3:
|
2019-12-04 07:20:58 +01:00
|
|
|
if (svga->gdcreg[3] & 7)
|
|
|
|
|
val = svga_rotate[svga->gdcreg[3] & 7][val];
|
|
|
|
|
wm = svga->gdcreg[8];
|
|
|
|
|
svga->gdcreg[8] &= val;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
|
vall.b[i] = !!(svga->gdcreg[0] & (1 << i)) * 0xff;
|
|
|
|
|
|
|
|
|
|
reset_wm = 1;
|
|
|
|
|
break;
|
2018-04-25 23:51:13 +02:00
|
|
|
default:
|
|
|
|
|
if (svga->ven_write)
|
|
|
|
|
svga->ven_write(svga, val, addr);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
switch (svga->gdcreg[3] & 0x18) {
|
|
|
|
|
case 0x00: /* Set */
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
if (writemask2 & (1 << i))
|
|
|
|
|
svga->vram[addr | i] = (vall.b[i] & svga->gdcreg[8]) | (svga->latch.b[i] & ~svga->gdcreg[8]);
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
2019-12-04 07:20:58 +01:00
|
|
|
case 0x08: /* AND */
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
if (writemask2 & (1 << i))
|
|
|
|
|
svga->vram[addr | i] = (vall.b[i] | ~svga->gdcreg[8]) & svga->latch.b[i];
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
2019-12-04 07:20:58 +01:00
|
|
|
case 0x10: /* OR */
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
if (writemask2 & (1 << i))
|
|
|
|
|
svga->vram[addr | i] = (vall.b[i] & svga->gdcreg[8]) | svga->latch.b[i];
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
2019-12-04 07:20:58 +01:00
|
|
|
case 0x18: /* XOR */
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
if (writemask2 & (1 << i))
|
|
|
|
|
svga->vram[addr | i] = (vall.b[i] & svga->gdcreg[8]) ^ svga->latch.b[i];
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
if (reset_wm)
|
|
|
|
|
svga->gdcreg[8] = wm;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
uint8_t
|
|
|
|
|
svga_read_common(uint32_t addr, uint8_t linear, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_t *svga = (svga_t *)p;
|
2019-10-01 15:14:51 +02:00
|
|
|
uint32_t latch_addr = 0;
|
2019-12-04 07:20:58 +01:00
|
|
|
int readplane = svga->readplane;
|
|
|
|
|
uint8_t count, i;
|
|
|
|
|
uint8_t plane, pixel;
|
|
|
|
|
uint8_t temp, ret;
|
2019-10-01 15:14:51 +02:00
|
|
|
|
|
|
|
|
if (svga->adv_flags & FLAG_ADDR_BY8)
|
|
|
|
|
readplane = svga->gdcreg[4] & 7;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
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
|
|
|
sub_cycles(video_timing_read_b);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
egareads++;
|
|
|
|
|
|
|
|
|
|
if (!linear) {
|
2019-12-04 07:20:58 +01:00
|
|
|
addr = svga_decode_addr(svga, addr, 0);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
if (addr == 0xffffffff)
|
|
|
|
|
return 0xff;
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
count = 2;
|
|
|
|
|
if (svga->adv_flags & FLAG_LATCH8)
|
|
|
|
|
count = 3;
|
|
|
|
|
|
|
|
|
|
latch_addr = (addr << count) & svga->decode_mask;
|
|
|
|
|
count = (1 << count);
|
|
|
|
|
|
2019-10-01 16:21:35 +02:00
|
|
|
if (svga->adv_flags & FLAG_ADDR_BY8)
|
2019-10-01 15:14:51 +02:00
|
|
|
addr <<= 3;
|
2019-10-01 16:21:35 +02:00
|
|
|
else if (svga->chain4 || svga->fb_only) {
|
2018-04-25 23:51:13 +02:00
|
|
|
addr &= svga->decode_mask;
|
|
|
|
|
if (addr >= svga->vram_max)
|
|
|
|
|
return 0xff;
|
|
|
|
|
return svga->vram[addr & svga->vram_mask];
|
|
|
|
|
} else if (svga->chain2_read) {
|
|
|
|
|
readplane = (readplane & 2) | (addr & 1);
|
|
|
|
|
addr &= ~1;
|
|
|
|
|
addr <<= 2;
|
|
|
|
|
} else
|
|
|
|
|
addr <<= 2;
|
|
|
|
|
|
|
|
|
|
addr &= svga->decode_mask;
|
|
|
|
|
|
|
|
|
|
/* standard VGA latched access */
|
2019-12-28 05:51:22 +01:00
|
|
|
if (latch_addr >= svga->vram_max) {
|
2019-12-04 07:20:58 +01:00
|
|
|
for (i = 0; i < count; i++)
|
2019-12-28 05:51:22 +01:00
|
|
|
svga->latch.b[i] = 0xff;
|
2018-04-25 23:51:13 +02:00
|
|
|
} else {
|
2019-12-28 05:51:22 +01:00
|
|
|
latch_addr &= svga->vram_mask;
|
2019-12-04 07:20:58 +01:00
|
|
|
|
2019-12-28 05:51:22 +01:00
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
|
svga->latch.b[i] = svga->vram[latch_addr | i];
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-12-28 05:51:22 +01:00
|
|
|
if (addr >= svga->vram_max)
|
|
|
|
|
return 0xff;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-12-28 05:51:22 +01:00
|
|
|
addr &= svga->vram_mask;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-12-04 07:20:58 +01:00
|
|
|
if (svga->readmode) {
|
|
|
|
|
temp = 0xff;
|
|
|
|
|
|
|
|
|
|
for (pixel = 0; pixel < 8; pixel++) {
|
|
|
|
|
for (plane = 0; plane < count; plane++) {
|
|
|
|
|
if (svga->colournocare & (1 << plane)) {
|
|
|
|
|
/* If we care about a plane, and the pixel has a mismatch on it, clear its bit. */
|
|
|
|
|
if (((svga->latch.b[plane] >> pixel) & 1) != ((svga->colourcompare >> plane) & 1))
|
|
|
|
|
temp &= ~(1 << pixel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ret = temp;
|
|
|
|
|
} else
|
|
|
|
|
ret = svga->vram[addr | readplane];
|
|
|
|
|
|
|
|
|
|
return ret;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_write(uint32_t addr, uint8_t val, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_write_common(addr, val, 0, p);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_write_linear(uint32_t addr, uint8_t val, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_write_common(addr, val, 1, p);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
uint8_t
|
|
|
|
|
svga_read(uint32_t addr, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
return svga_read_common(addr, 0, p);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
uint8_t
|
|
|
|
|
svga_read_linear(uint32_t addr, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
return svga_read_common(addr, 1, p);
|
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)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2019-10-21 21:19:23 +02:00
|
|
|
int y_add, x_add, y_start, x_start, bottom;
|
2018-04-25 23:51:13 +02:00
|
|
|
uint32_t *p;
|
|
|
|
|
int i, j;
|
2019-09-26 16:00:43 +02:00
|
|
|
int xs_temp, ys_temp;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
y_add = (enable_overscan) ? overscan_y : 0;
|
|
|
|
|
x_add = (enable_overscan) ? overscan_x : 0;
|
|
|
|
|
y_start = (enable_overscan) ? 0 : (overscan_y >> 1);
|
|
|
|
|
x_start = (enable_overscan) ? 0 : (overscan_x >> 1);
|
|
|
|
|
bottom = (overscan_y >> 1) + (svga->crtc[8] & 0x1f);
|
|
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
if (svga->vertical_linedbl) {
|
|
|
|
|
y_add <<= 1;
|
|
|
|
|
y_start <<= 1;
|
|
|
|
|
bottom <<= 1;
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
if ((wx <= 0) || (wy <= 0)) {
|
|
|
|
|
video_blit_memtoscreen(x_start, y_start, 0, 0, 0, 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
if (y1 > y2) {
|
2019-10-20 15:09:38 +02:00
|
|
|
video_blit_memtoscreen(x_start, y_start, 0, 0, xsize + x_add, ysize + y_add);
|
2018-04-25 23:51:13 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
if (svga->vertical_linedbl)
|
|
|
|
|
svga->y_add <<= 1;
|
|
|
|
|
|
2019-09-26 16:00:43 +02:00
|
|
|
xs_temp = wx;
|
|
|
|
|
ys_temp = wy + 1;
|
2020-01-20 05:36:44 +01:00
|
|
|
if (svga->vertical_linedbl)
|
|
|
|
|
ys_temp++;
|
2019-09-26 16:00:43 +02:00
|
|
|
if (xs_temp < 64)
|
|
|
|
|
xs_temp = 640;
|
|
|
|
|
if (ys_temp < 32)
|
|
|
|
|
ys_temp = 200;
|
|
|
|
|
|
|
|
|
|
if ((xs_temp != xsize) || (ys_temp != ysize) || video_force_resize_get()) {
|
2018-04-25 23:51:13 +02:00
|
|
|
/* Screen res has changed.. fix up, and let them know. */
|
2019-09-26 16:00:43 +02:00
|
|
|
xsize = xs_temp;
|
|
|
|
|
ysize = ys_temp;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
if ((xsize > 1984) || (ysize > 2016)) {
|
|
|
|
|
/* 2048x2048 is the biggest safe render texture, to account for overscan,
|
|
|
|
|
we suppress overscan starting from x 1984 and y 2016. */
|
|
|
|
|
x_add = 0;
|
|
|
|
|
y_add = 0;
|
|
|
|
|
suppress_overscan = 1;
|
|
|
|
|
} else
|
|
|
|
|
suppress_overscan = 0;
|
|
|
|
|
|
2020-01-20 05:36:44 +01:00
|
|
|
set_screen_size(xsize + x_add, ysize + y_add);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
if (video_force_resize_get())
|
|
|
|
|
video_force_resize_set(0);
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
if ((wx >= 160) && ((wy + 1) >= 120)) {
|
|
|
|
|
/* Draw (overscan_size - scroll size) lines of overscan on top and bottom. */
|
|
|
|
|
for (i = 0; i < svga->y_add; i++) {
|
|
|
|
|
p = &buffer32->line[i & 0x7ff][0];
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
for (j = 0; j < (xsize + x_add); j++)
|
|
|
|
|
p[j] = svga->overscan_color;
|
|
|
|
|
}
|
2017-05-19 04:35:59 +02:00
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
for (i = 0; i < bottom; i++) {
|
|
|
|
|
p = &buffer32->line[(ysize + svga->y_add + i) & 0x7ff][0];
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
for (j = 0; j < (xsize + x_add); j++)
|
|
|
|
|
p[j] = svga->overscan_color;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
video_blit_memtoscreen(x_start, y_start, y1, y2 + y_add, xsize + x_add, ysize + y_add);
|
2020-01-20 05:36:44 +01:00
|
|
|
|
|
|
|
|
if (svga->vertical_linedbl)
|
|
|
|
|
svga->vertical_linedbl >>= 1;
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_writeb_linear(uint32_t addr, uint8_t val, void *p)
|
|
|
|
|
{
|
|
|
|
|
svga_t *svga = (svga_t *)p;
|
|
|
|
|
|
|
|
|
|
if (!svga->fast) {
|
|
|
|
|
svga_write_linear(addr, val, p);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
egawrites++;
|
|
|
|
|
|
|
|
|
|
addr &= svga->decode_mask;
|
|
|
|
|
if (addr >= svga->vram_max)
|
|
|
|
|
return;
|
|
|
|
|
addr &= svga->vram_mask;
|
|
|
|
|
svga->changedvram[addr >> 12] = changeframecount;
|
|
|
|
|
*(uint8_t *)&svga->vram[addr] = val;
|
|
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_writew_common(uint32_t addr, uint16_t val, uint8_t linear, void *p)
|
|
|
|
|
{
|
|
|
|
|
svga_t *svga = (svga_t *)p;
|
|
|
|
|
|
|
|
|
|
if (!svga->fast) {
|
|
|
|
|
svga_write_common(addr, val, linear, p);
|
|
|
|
|
svga_write_common(addr + 1, val >> 8, linear, p);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
egawrites += 2;
|
|
|
|
|
|
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
|
|
|
sub_cycles(video_timing_write_w);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-10-01 15:14:51 +02:00
|
|
|
if (!linear) {
|
2019-12-04 07:20:58 +01:00
|
|
|
addr = svga_decode_addr(svga, addr, 1);
|
|
|
|
|
|
|
|
|
|
if (addr == 0xffffffff)
|
|
|
|
|
return;
|
2019-10-01 15:14:51 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
addr &= svga->decode_mask;
|
|
|
|
|
if (addr >= svga->vram_max)
|
|
|
|
|
return;
|
|
|
|
|
addr &= svga->vram_mask;
|
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
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
svga->changedvram[addr >> 12] = changeframecount;
|
|
|
|
|
*(uint16_t *)&svga->vram[addr] = val;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_writew(uint32_t addr, uint16_t val, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_writew_common(addr, val, 0, p);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_writew_linear(uint32_t addr, uint16_t val, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_writew_common(addr, val, 1, p);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_writel_common(uint32_t addr, uint32_t val, uint8_t linear, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_t *svga = (svga_t *)p;
|
|
|
|
|
|
|
|
|
|
if (!svga->fast) {
|
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
|
|
|
svga_write_common(addr, val, linear, p);
|
|
|
|
|
svga_write_common(addr + 1, val >> 8, linear, p);
|
|
|
|
|
svga_write_common(addr + 2, val >> 16, linear, p);
|
|
|
|
|
svga_write_common(addr + 3, val >> 24, linear, p);
|
2018-04-25 23:51:13 +02:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
egawrites += 4;
|
|
|
|
|
|
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
|
|
|
sub_cycles(video_timing_write_l);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-10-01 15:14:51 +02:00
|
|
|
if (!linear) {
|
2019-12-04 07:20:58 +01:00
|
|
|
addr = svga_decode_addr(svga, addr, 1);
|
|
|
|
|
|
|
|
|
|
if (addr == 0xffffffff)
|
|
|
|
|
return;
|
2019-10-01 15:14:51 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
addr &= svga->decode_mask;
|
|
|
|
|
if (addr >= svga->vram_max)
|
|
|
|
|
return;
|
|
|
|
|
addr &= svga->vram_mask;
|
|
|
|
|
|
|
|
|
|
svga->changedvram[addr >> 12] = changeframecount;
|
|
|
|
|
*(uint32_t *)&svga->vram[addr] = val;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_writel(uint32_t addr, uint32_t val, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_writel_common(addr, val, 0, p);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
svga_writel_linear(uint32_t addr, uint32_t val, void *p)
|
2018-03-01 23:05:59 +01:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_writel_common(addr, val, 1, p);
|
2018-03-01 23:05:59 +01:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
uint8_t
|
|
|
|
|
svga_readb_linear(uint32_t addr, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_t *svga = (svga_t *)p;
|
|
|
|
|
|
|
|
|
|
if (!svga->fast)
|
|
|
|
|
return svga_read_linear(addr, p);
|
|
|
|
|
|
|
|
|
|
egareads++;
|
|
|
|
|
|
|
|
|
|
addr &= svga->decode_mask;
|
|
|
|
|
if (addr >= svga->vram_max)
|
|
|
|
|
return 0xff;
|
|
|
|
|
|
|
|
|
|
return *(uint8_t *)&svga->vram[addr & svga->vram_mask];
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
uint16_t
|
|
|
|
|
svga_readw_common(uint32_t addr, uint8_t linear, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_t *svga = (svga_t *)p;
|
|
|
|
|
|
|
|
|
|
if (!svga->fast)
|
|
|
|
|
return svga_read_common(addr, linear, p) | (svga_read_common(addr + 1, linear, p) << 8);
|
|
|
|
|
|
|
|
|
|
egareads += 2;
|
|
|
|
|
|
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
|
|
|
sub_cycles(video_timing_read_w);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
if (!linear) {
|
2019-12-04 07:20:58 +01:00
|
|
|
addr = svga_decode_addr(svga, addr, 0);
|
|
|
|
|
|
|
|
|
|
if (addr == 0xffffffff)
|
|
|
|
|
return 0xffff;
|
2019-10-20 15:09:38 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
addr &= svga->decode_mask;
|
|
|
|
|
if (addr >= svga->vram_max)
|
|
|
|
|
return 0xffff;
|
|
|
|
|
|
|
|
|
|
return *(uint16_t *)&svga->vram[addr & svga->vram_mask];
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
uint16_t
|
|
|
|
|
svga_readw(uint32_t addr, void *p)
|
2018-03-01 23:05:59 +01:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
return svga_readw_common(addr, 0, p);
|
2018-03-01 23:05:59 +01:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
uint16_t
|
|
|
|
|
svga_readw_linear(uint32_t addr, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
return svga_readw_common(addr, 1, p);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
|
svga_readl_common(uint32_t addr, uint8_t linear, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
svga_t *svga = (svga_t *)p;
|
|
|
|
|
|
|
|
|
|
if (!svga->fast) {
|
|
|
|
|
return svga_read_common(addr, linear, p) | (svga_read_common(addr + 1, linear, p) << 8) |
|
|
|
|
|
(svga_read_common(addr + 2, linear, p) << 16) | (svga_read_common(addr + 3, linear, p) << 24);
|
|
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
egareads += 4;
|
2016-06-26 00:34:39 +02:00
|
|
|
|
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
|
|
|
sub_cycles(video_timing_read_l);
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2019-10-20 15:09:38 +02:00
|
|
|
if (!linear) {
|
2019-12-04 07:20:58 +01:00
|
|
|
addr = svga_decode_addr(svga, addr, 0);
|
|
|
|
|
|
|
|
|
|
if (addr == 0xffffffff)
|
|
|
|
|
return 0xffffffff;
|
2019-10-20 15:09:38 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
addr &= svga->decode_mask;
|
|
|
|
|
if (addr >= svga->vram_max)
|
|
|
|
|
return 0xffffffff;
|
|
|
|
|
|
|
|
|
|
return *(uint32_t *)&svga->vram[addr & svga->vram_mask];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
|
svga_readl(uint32_t addr, void *p)
|
|
|
|
|
{
|
|
|
|
|
return svga_readl_common(addr, 0, p);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
|
svga_readl_linear(uint32_t addr, void *p)
|
|
|
|
|
{
|
|
|
|
|
return svga_readl_common(addr, 1, p);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|