2017-05-30 03:38:38 +02:00
|
|
|
/*
|
2019-09-21 03:33:05 +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.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2019-09-21 03:33:05 +02:00
|
|
|
* This file is part of the 86Box distribution.
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
|
|
|
|
* Implementation of the Intel DMA controllers.
|
|
|
|
|
*
|
2020-03-25 00:46:02 +02:00
|
|
|
*
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2019-09-21 03:33:05 +02:00
|
|
|
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
|
2017-05-30 03:38:38 +02:00
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2019-09-21 03:33:05 +02:00
|
|
|
* Fred N. van Kempen, <decwiz@yahoo.com>
|
2017-10-17 01:59:09 -04:00
|
|
|
*
|
2020-01-14 02:14:39 +01:00
|
|
|
* Copyright 2008-2020 Sarah Walker.
|
|
|
|
|
* Copyright 2016-2020 Miran Grca.
|
|
|
|
|
* Copyright 2017-2020 Fred N. van Kempen.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <wchar.h>
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/86box.h>
|
2020-02-29 19:12:23 +01:00
|
|
|
#include "cpu_common/cpu.h"
|
|
|
|
|
#include "cpu_common/x86.h"
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/machine.h>
|
|
|
|
|
#include <86box/mca.h>
|
|
|
|
|
#include <86box/mem.h>
|
|
|
|
|
#include <86box/io.h>
|
|
|
|
|
#include <86box/dma.h>
|
2017-05-06 17:48:33 +02:00
|
|
|
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_t dma[8];
|
2020-01-14 02:14:39 +01:00
|
|
|
uint8_t dma_e;
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2017-05-29 01:18:32 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
static uint8_t dmaregs[16];
|
|
|
|
|
static uint8_t dma16regs[16];
|
|
|
|
|
static uint8_t dmapages[16];
|
|
|
|
|
static int dma_wp,
|
|
|
|
|
dma16_wp;
|
|
|
|
|
static uint8_t dma_m;
|
|
|
|
|
static uint8_t dma_stat;
|
|
|
|
|
static uint8_t dma_stat_rq;
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
static uint8_t dma_stat_rq_pc;
|
2018-04-25 23:51:13 +02:00
|
|
|
static uint8_t dma_command,
|
|
|
|
|
dma16_command;
|
2019-09-28 17:32:05 +02:00
|
|
|
static uint8_t dma_req_is_soft;
|
|
|
|
|
static uint8_t dma_buffer[65536];
|
|
|
|
|
static uint16_t dma16_buffer[65536];
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
static struct {
|
|
|
|
|
int xfr_command,
|
|
|
|
|
xfr_channel;
|
|
|
|
|
int byte_ptr;
|
2018-03-11 18:26:44 +01:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
int is_ps2;
|
2018-03-11 18:26:44 +01:00
|
|
|
} dma_ps2;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
#define DMA_PS2_IOA (1 << 0)
|
|
|
|
|
#define DMA_PS2_XFER_MEM_TO_IO (1 << 2)
|
|
|
|
|
#define DMA_PS2_XFER_IO_TO_MEM (3 << 2)
|
|
|
|
|
#define DMA_PS2_XFER_MASK (3 << 2)
|
|
|
|
|
#define DMA_PS2_DEC2 (1 << 4)
|
|
|
|
|
#define DMA_PS2_SIZE16 (1 << 6)
|
|
|
|
|
|
2018-03-11 18:26:44 +01:00
|
|
|
|
|
|
|
|
static void dma_ps2_run(int channel);
|
2017-05-06 17:48:33 +02:00
|
|
|
|
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
|
|
|
int
|
|
|
|
|
dma_get_drq(int channel)
|
|
|
|
|
{
|
|
|
|
|
return !!(dma_stat_rq_pc & (1 << channel));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dma_set_drq(int channel, int set)
|
|
|
|
|
{
|
|
|
|
|
dma_stat_rq_pc &= ~(1 << channel);
|
|
|
|
|
if (set)
|
|
|
|
|
dma_stat_rq_pc |= (1 << channel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2019-09-28 17:32:05 +02:00
|
|
|
static void
|
|
|
|
|
dma_block_transfer(int channel)
|
|
|
|
|
{
|
|
|
|
|
int i, bit16;
|
|
|
|
|
|
|
|
|
|
bit16 = (channel >= 4);
|
|
|
|
|
|
|
|
|
|
dma_req_is_soft = 1;
|
|
|
|
|
for (i = 0; i <= dma[channel].cb; i++) {
|
|
|
|
|
if ((dma[channel].mode & 0x8c) == 0x84) {
|
|
|
|
|
if (bit16)
|
|
|
|
|
dma_channel_write(channel, dma16_buffer[i]);
|
|
|
|
|
else
|
|
|
|
|
dma_channel_write(channel, dma_buffer[i]);
|
|
|
|
|
} else if ((dma[channel].mode & 0x8c) == 0x88) {
|
|
|
|
|
if (bit16)
|
|
|
|
|
dma16_buffer[i] = dma_channel_read(channel);
|
|
|
|
|
else
|
|
|
|
|
dma_buffer[i] = dma_channel_read(channel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dma_req_is_soft = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
static uint8_t
|
|
|
|
|
dma_read(uint16_t addr, void *priv)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
int channel = (addr >> 1) & 3;
|
|
|
|
|
uint8_t temp;
|
|
|
|
|
|
|
|
|
|
switch (addr & 0xf) {
|
|
|
|
|
case 0:
|
|
|
|
|
case 2:
|
|
|
|
|
case 4:
|
|
|
|
|
case 6: /*Address registers*/
|
|
|
|
|
dma_wp ^= 1;
|
|
|
|
|
if (dma_wp)
|
|
|
|
|
return(dma[channel].ac & 0xff);
|
|
|
|
|
return((dma[channel].ac >> 8) & 0xff);
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
case 3:
|
|
|
|
|
case 5:
|
|
|
|
|
case 7: /*Count registers*/
|
|
|
|
|
dma_wp ^= 1;
|
|
|
|
|
if (dma_wp)
|
|
|
|
|
temp = dma[channel].cc & 0xff;
|
|
|
|
|
else
|
|
|
|
|
temp = dma[channel].cc >> 8;
|
|
|
|
|
return(temp);
|
|
|
|
|
|
|
|
|
|
case 8: /*Status register*/
|
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
|
|
|
temp = dma_stat_rq_pc & 0xf;
|
|
|
|
|
temp <<= 4;
|
|
|
|
|
temp |= dma_stat & 0xf;
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_stat &= ~0xf;
|
|
|
|
|
return(temp);
|
|
|
|
|
|
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
|
|
|
case 0xd: /*Temporary register*/
|
2018-04-25 23:51:13 +02:00
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(dmaregs[addr & 0xf]);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dma_write(uint16_t addr, uint8_t val, void *priv)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
int channel = (addr >> 1) & 3;
|
|
|
|
|
|
|
|
|
|
dmaregs[addr & 0xf] = val;
|
|
|
|
|
switch (addr & 0xf) {
|
|
|
|
|
case 0:
|
|
|
|
|
case 2:
|
|
|
|
|
case 4:
|
|
|
|
|
case 6: /*Address registers*/
|
|
|
|
|
dma_wp ^= 1;
|
|
|
|
|
if (dma_wp)
|
|
|
|
|
dma[channel].ab = (dma[channel].ab & 0xffff00) | val;
|
|
|
|
|
else
|
|
|
|
|
dma[channel].ab = (dma[channel].ab & 0xff00ff) | (val << 8);
|
|
|
|
|
dma[channel].ac = dma[channel].ab;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
case 3:
|
|
|
|
|
case 5:
|
|
|
|
|
case 7: /*Count registers*/
|
|
|
|
|
dma_wp ^= 1;
|
|
|
|
|
if (dma_wp)
|
|
|
|
|
dma[channel].cb = (dma[channel].cb & 0xff00) | val;
|
|
|
|
|
else
|
|
|
|
|
dma[channel].cb = (dma[channel].cb & 0x00ff) | (val << 8);
|
|
|
|
|
dma[channel].cc = dma[channel].cb;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 8: /*Control register*/
|
|
|
|
|
dma_command = val;
|
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 (val & 0x01)
|
|
|
|
|
fatal("Memory-to-memory enable\n");
|
2018-04-25 23:51:13 +02:00
|
|
|
return;
|
|
|
|
|
|
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
|
|
|
case 9: /*Request register */
|
|
|
|
|
channel = (val & 3);
|
2019-09-28 17:32:05 +02:00
|
|
|
if (val & 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
|
|
|
dma_stat_rq_pc |= (1 << channel);
|
2019-09-28 17:32:05 +02:00
|
|
|
dma_block_transfer(channel);
|
|
|
|
|
} 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
|
|
|
dma_stat_rq_pc &= ~(1 << channel);
|
|
|
|
|
break;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
case 0xa: /*Mask*/
|
2019-09-28 17:32:05 +02:00
|
|
|
channel = (val & 3);
|
2018-04-25 23:51:13 +02:00
|
|
|
if (val & 4)
|
2019-09-28 17:32:05 +02:00
|
|
|
dma_m |= (1 << channel);
|
|
|
|
|
else
|
|
|
|
|
dma_m &= ~(1 << channel);
|
2018-04-25 23:51:13 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xb: /*Mode*/
|
|
|
|
|
channel = (val & 3);
|
|
|
|
|
dma[channel].mode = val;
|
|
|
|
|
if (dma_ps2.is_ps2) {
|
|
|
|
|
dma[channel].ps2_mode &= ~0x1c;
|
|
|
|
|
if (val & 0x20)
|
|
|
|
|
dma[channel].ps2_mode |= 0x10;
|
|
|
|
|
if ((val & 0xc) == 8)
|
|
|
|
|
dma[channel].ps2_mode |= 4;
|
|
|
|
|
else if ((val & 0xc) == 4)
|
|
|
|
|
dma[channel].ps2_mode |= 0xc;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xc: /*Clear FF*/
|
|
|
|
|
dma_wp = 0;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xd: /*Master clear*/
|
|
|
|
|
dma_wp = 0;
|
|
|
|
|
dma_m |= 0xf;
|
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
|
|
|
dma_stat_rq_pc &= ~0x0f;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xe: /*Clear mask*/
|
|
|
|
|
dma_m &= 0xf0;
|
2018-04-25 23:51:13 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xf: /*Mask write*/
|
|
|
|
|
dma_m = (dma_m & 0xf0) | (val & 0xf);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static uint8_t
|
|
|
|
|
dma_ps2_read(uint16_t addr, void *priv)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_t *dma_c = &dma[dma_ps2.xfr_channel];
|
|
|
|
|
uint8_t temp = 0xff;
|
|
|
|
|
|
|
|
|
|
switch (addr) {
|
|
|
|
|
case 0x1a:
|
|
|
|
|
switch (dma_ps2.xfr_command) {
|
|
|
|
|
case 2: /*Address*/
|
|
|
|
|
case 3:
|
|
|
|
|
switch (dma_ps2.byte_ptr) {
|
|
|
|
|
case 0:
|
|
|
|
|
temp = dma_c->ac & 0xff;
|
|
|
|
|
dma_ps2.byte_ptr = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
temp = (dma_c->ac >> 8) & 0xff;
|
|
|
|
|
dma_ps2.byte_ptr = 2;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
temp = (dma_c->ac >> 16) & 0xff;
|
|
|
|
|
dma_ps2.byte_ptr = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 4: /*Count*/
|
|
|
|
|
case 5:
|
|
|
|
|
if (dma_ps2.byte_ptr)
|
|
|
|
|
temp = dma_c->cc >> 8;
|
|
|
|
|
else
|
|
|
|
|
temp = dma_c->cc & 0xff;
|
|
|
|
|
dma_ps2.byte_ptr = (dma_ps2.byte_ptr + 1) & 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 6: /*Read DMA status*/
|
|
|
|
|
if (dma_ps2.byte_ptr) {
|
|
|
|
|
temp = ((dma_stat_rq & 0xf0) >> 4) | (dma_stat & 0xf0);
|
|
|
|
|
dma_stat &= ~0xf0;
|
|
|
|
|
dma_stat_rq &= ~0xf0;
|
|
|
|
|
} else {
|
|
|
|
|
temp = (dma_stat_rq & 0xf) | ((dma_stat & 0xf) << 4);
|
|
|
|
|
dma_stat &= ~0xf;
|
|
|
|
|
dma_stat_rq &= ~0xf;
|
|
|
|
|
}
|
|
|
|
|
dma_ps2.byte_ptr = (dma_ps2.byte_ptr + 1) & 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 7: /*Mode*/
|
|
|
|
|
temp = dma_c->ps2_mode;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 8: /*Arbitration Level*/
|
|
|
|
|
temp = dma_c->arb_level;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
fatal("Bad XFR Read command %i channel %i\n", dma_ps2.xfr_command, dma_ps2.xfr_channel);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(temp);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dma_ps2_write(uint16_t addr, uint8_t val, void *priv)
|
2017-05-05 01:49:42 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_t *dma_c = &dma[dma_ps2.xfr_channel];
|
|
|
|
|
uint8_t mode;
|
|
|
|
|
|
|
|
|
|
switch (addr) {
|
|
|
|
|
case 0x18:
|
|
|
|
|
dma_ps2.xfr_channel = val & 0x7;
|
|
|
|
|
dma_ps2.xfr_command = val >> 4;
|
|
|
|
|
dma_ps2.byte_ptr = 0;
|
|
|
|
|
switch (dma_ps2.xfr_command) {
|
|
|
|
|
case 9: /*Set DMA mask*/
|
|
|
|
|
dma_m |= (1 << dma_ps2.xfr_channel);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0xa: /*Reset DMA mask*/
|
|
|
|
|
dma_m &= ~(1 << dma_ps2.xfr_channel);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0xb:
|
|
|
|
|
if (!(dma_m & (1 << dma_ps2.xfr_channel)))
|
|
|
|
|
dma_ps2_run(dma_ps2.xfr_channel);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x1a:
|
|
|
|
|
switch (dma_ps2.xfr_command) {
|
|
|
|
|
case 0: /*I/O address*/
|
|
|
|
|
if (dma_ps2.byte_ptr)
|
|
|
|
|
dma_c->io_addr = (dma_c->io_addr & 0x00ff) | (val << 8);
|
|
|
|
|
else
|
|
|
|
|
dma_c->io_addr = (dma_c->io_addr & 0xff00) | val;
|
|
|
|
|
dma_ps2.byte_ptr = (dma_ps2.byte_ptr + 1) & 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2: /*Address*/
|
|
|
|
|
switch (dma_ps2.byte_ptr) {
|
|
|
|
|
case 0:
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xffff00) | val;
|
|
|
|
|
dma_ps2.byte_ptr = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xff00ff) | (val << 8);
|
|
|
|
|
dma_ps2.byte_ptr = 2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0x00ffff) | (val << 16);
|
|
|
|
|
dma_ps2.byte_ptr = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
dma_c->ab = dma_c->ac;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 4: /*Count*/
|
|
|
|
|
if (dma_ps2.byte_ptr)
|
|
|
|
|
dma_c->cc = (dma_c->cc & 0xff) | (val << 8);
|
|
|
|
|
else
|
|
|
|
|
dma_c->cc = (dma_c->cc & 0xff00) | val;
|
|
|
|
|
dma_ps2.byte_ptr = (dma_ps2.byte_ptr + 1) & 1;
|
|
|
|
|
dma_c->cb = dma_c->cc;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 7: /*Mode register*/
|
|
|
|
|
mode = 0;
|
|
|
|
|
if (val & DMA_PS2_DEC2)
|
|
|
|
|
mode |= 0x20;
|
|
|
|
|
if ((val & DMA_PS2_XFER_MASK) == DMA_PS2_XFER_MEM_TO_IO)
|
|
|
|
|
mode |= 8;
|
|
|
|
|
else if ((val & DMA_PS2_XFER_MASK) == DMA_PS2_XFER_IO_TO_MEM)
|
|
|
|
|
mode |= 4;
|
|
|
|
|
dma_c->mode = (dma_c->mode & ~0x2c) | mode;
|
|
|
|
|
dma_c->ps2_mode = val;
|
|
|
|
|
dma_c->size = val & DMA_PS2_SIZE16;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 8: /*Arbitration Level*/
|
|
|
|
|
dma_c->arb_level = val;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
fatal("Bad XFR command %i channel %i val %02x\n", dma_ps2.xfr_command, dma_ps2.xfr_channel, val);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2017-05-05 01:49:42 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static uint8_t
|
|
|
|
|
dma16_read(uint16_t addr, void *priv)
|
2017-05-05 01:49:42 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
int channel = ((addr >> 2) & 3) + 4;
|
|
|
|
|
uint8_t temp;
|
|
|
|
|
|
|
|
|
|
addr >>= 1;
|
|
|
|
|
switch (addr & 0xf) {
|
|
|
|
|
case 0:
|
|
|
|
|
case 2:
|
|
|
|
|
case 4:
|
|
|
|
|
case 6: /*Address registers*/
|
|
|
|
|
dma16_wp ^= 1;
|
|
|
|
|
if (dma_ps2.is_ps2) {
|
|
|
|
|
if (dma16_wp)
|
|
|
|
|
return(dma[channel].ac);
|
|
|
|
|
return((dma[channel].ac >> 8) & 0xff);
|
|
|
|
|
}
|
|
|
|
|
if (dma16_wp)
|
|
|
|
|
return((dma[channel].ac >> 1) & 0xff);
|
|
|
|
|
return((dma[channel].ac >> 9) & 0xff);
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
case 3:
|
|
|
|
|
case 5:
|
|
|
|
|
case 7: /*Count registers*/
|
|
|
|
|
dma16_wp ^= 1;
|
|
|
|
|
if (dma16_wp)
|
|
|
|
|
temp = dma[channel].cc & 0xff;
|
|
|
|
|
else
|
|
|
|
|
temp = dma[channel].cc >> 8;
|
|
|
|
|
return(temp);
|
|
|
|
|
|
|
|
|
|
case 8: /*Status register*/
|
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
|
|
|
temp = (dma_stat_rq_pc & 0xf0);
|
|
|
|
|
temp |= dma_stat >> 4;
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_stat &= ~0xf0;
|
|
|
|
|
return(temp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(dma16regs[addr & 0xf]);
|
2017-05-05 01:49:42 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dma16_write(uint16_t addr, uint8_t val, void *priv)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
int channel = ((addr >> 2) & 3) + 4;
|
|
|
|
|
addr >>= 1;
|
|
|
|
|
|
|
|
|
|
dma16regs[addr & 0xf] = val;
|
|
|
|
|
switch (addr & 0xf) {
|
|
|
|
|
case 0:
|
|
|
|
|
case 2:
|
|
|
|
|
case 4:
|
|
|
|
|
case 6: /*Address registers*/
|
|
|
|
|
dma16_wp ^= 1;
|
|
|
|
|
if (dma_ps2.is_ps2) {
|
|
|
|
|
if (dma16_wp)
|
|
|
|
|
dma[channel].ab = (dma[channel].ab & 0xffff00) | val;
|
|
|
|
|
else
|
|
|
|
|
dma[channel].ab = (dma[channel].ab & 0xff00ff) | (val << 8);
|
|
|
|
|
} else {
|
|
|
|
|
if (dma16_wp)
|
|
|
|
|
dma[channel].ab = (dma[channel].ab & 0xfffe00) | (val << 1);
|
|
|
|
|
else
|
|
|
|
|
dma[channel].ab = (dma[channel].ab & 0xfe01ff) | (val << 9);
|
|
|
|
|
}
|
|
|
|
|
dma[channel].ac = dma[channel].ab;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
case 3:
|
|
|
|
|
case 5:
|
|
|
|
|
case 7: /*Count registers*/
|
|
|
|
|
dma16_wp ^= 1;
|
|
|
|
|
if (dma16_wp)
|
|
|
|
|
dma[channel].cb = (dma[channel].cb & 0xff00) | val;
|
|
|
|
|
else
|
|
|
|
|
dma[channel].cb = (dma[channel].cb & 0x00ff) | (val << 8);
|
|
|
|
|
dma[channel].cc = dma[channel].cb;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 8: /*Control register*/
|
|
|
|
|
return;
|
|
|
|
|
|
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
|
|
|
case 9: /*Request register */
|
|
|
|
|
channel = (val & 3) + 4;
|
2019-09-28 17:32:05 +02:00
|
|
|
if (val & 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
|
|
|
dma_stat_rq_pc |= (1 << channel);
|
2019-09-28 17:32:05 +02:00
|
|
|
dma_block_transfer(channel);
|
|
|
|
|
} 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
|
|
|
dma_stat_rq_pc &= ~(1 << channel);
|
|
|
|
|
break;
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
case 0xa: /*Mask*/
|
2019-09-28 17:32:05 +02:00
|
|
|
channel = (val & 3);
|
2018-04-25 23:51:13 +02:00
|
|
|
if (val & 4)
|
2019-09-28 17:32:05 +02:00
|
|
|
dma_m |= (0x10 << channel);
|
|
|
|
|
else
|
|
|
|
|
dma_m &= ~(0x10 << channel);
|
2018-04-25 23:51:13 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xb: /*Mode*/
|
|
|
|
|
channel = (val & 3) + 4;
|
|
|
|
|
dma[channel].mode = val;
|
|
|
|
|
if (dma_ps2.is_ps2) {
|
|
|
|
|
dma[channel].ps2_mode &= ~0x1c;
|
|
|
|
|
if (val & 0x20)
|
|
|
|
|
dma[channel].ps2_mode |= 0x10;
|
|
|
|
|
if ((val & 0xc) == 8)
|
|
|
|
|
dma[channel].ps2_mode |= 4;
|
|
|
|
|
else if ((val & 0xc) == 4)
|
|
|
|
|
dma[channel].ps2_mode |= 0xc;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xc: /*Clear FF*/
|
|
|
|
|
dma16_wp = 0;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xd: /*Master clear*/
|
|
|
|
|
dma16_wp = 0;
|
|
|
|
|
dma_m |= 0xf0;
|
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
|
|
|
dma_stat_rq_pc &= ~0xf0;
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xe: /*Clear mask*/
|
|
|
|
|
dma_m &= 0x0f;
|
2018-04-25 23:51:13 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case 0xf: /*Mask write*/
|
|
|
|
|
dma_m = (dma_m & 0x0f) | ((val & 0xf) << 4);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dma_page_write(uint16_t addr, uint8_t val, void *priv)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
dmapages[addr & 0xf] = val;
|
|
|
|
|
|
|
|
|
|
switch (addr & 0xf) {
|
|
|
|
|
case 1:
|
|
|
|
|
dma[2].page = (AT) ? val : val & 0xf;
|
|
|
|
|
dma[2].ab = (dma[2].ab & 0xffff) | (dma[2].page << 16);
|
|
|
|
|
dma[2].ac = (dma[2].ac & 0xffff) | (dma[2].page << 16);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
dma[3].page = (AT) ? val : val & 0xf;
|
|
|
|
|
dma[3].ab = (dma[3].ab & 0xffff) | (dma[3].page << 16);
|
|
|
|
|
dma[3].ac = (dma[3].ac & 0xffff) | (dma[3].page << 16);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
dma[1].page = (AT) ? val : val & 0xf;
|
|
|
|
|
dma[1].ab = (dma[1].ab & 0xffff) | (dma[1].page << 16);
|
|
|
|
|
dma[1].ac = (dma[1].ac & 0xffff) | (dma[1].page << 16);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
|
dma[0].page = (AT) ? val : val & 0xf;
|
|
|
|
|
dma[0].ab = (dma[0].ab & 0xffff) | (dma[0].page << 16);
|
|
|
|
|
dma[0].ac = (dma[0].ac & 0xffff) | (dma[0].page << 16);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0x9:
|
|
|
|
|
dma[6].page = val & 0xfe;
|
|
|
|
|
dma[6].ab = (dma[6].ab & 0x1ffff) | (dma[6].page << 16);
|
|
|
|
|
dma[6].ac = (dma[6].ac & 0x1ffff) | (dma[6].page << 16);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0xa:
|
|
|
|
|
dma[7].page = val & 0xfe;
|
|
|
|
|
dma[7].ab = (dma[7].ab & 0x1ffff) | (dma[7].page << 16);
|
|
|
|
|
dma[7].ac = (dma[7].ac & 0x1ffff) | (dma[7].page << 16);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0xb:
|
|
|
|
|
dma[5].page = val & 0xfe;
|
|
|
|
|
dma[5].ab = (dma[5].ab & 0x1ffff) | (dma[5].page << 16);
|
|
|
|
|
dma[5].ac = (dma[5].ac & 0x1ffff) | (dma[5].page << 16);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 0xf:
|
|
|
|
|
dma[4].page = val & 0xfe;
|
|
|
|
|
dma[4].ab = (dma[4].ab & 0x1ffff) | (dma[4].page << 16);
|
|
|
|
|
dma[4].ac = (dma[4].ac & 0x1ffff) | (dma[4].page << 16);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
static uint8_t
|
|
|
|
|
dma_page_read(uint16_t addr, void *priv)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
return(dmapages[addr & 0xf]);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dma_reset(void)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
int c;
|
|
|
|
|
|
|
|
|
|
dma_wp = dma16_wp = 0;
|
|
|
|
|
dma_m = 0;
|
|
|
|
|
|
2020-01-14 02:14:39 +01:00
|
|
|
dma_e = 0xff;
|
|
|
|
|
|
2019-09-28 17:32:05 +02:00
|
|
|
for (c = 0; c < 16; c++)
|
|
|
|
|
dmaregs[c] = dma16regs[c] = 0;
|
2018-04-25 23:51:13 +02:00
|
|
|
for (c = 0; c < 8; c++) {
|
|
|
|
|
dma[c].mode = 0;
|
|
|
|
|
dma[c].ac = 0;
|
|
|
|
|
dma[c].cc = 0;
|
|
|
|
|
dma[c].ab = 0;
|
|
|
|
|
dma[c].cb = 0;
|
|
|
|
|
dma[c].size = (c & 4) ? 1 : 0;
|
|
|
|
|
}
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
|
|
|
|
dma_stat = 0x00;
|
|
|
|
|
dma_stat_rq = 0x00;
|
|
|
|
|
dma_stat_rq_pc = 0x00;
|
2019-09-28 17:32:05 +02:00
|
|
|
dma_req_is_soft = 0;
|
|
|
|
|
|
|
|
|
|
memset(dma_buffer, 0x00, sizeof(dma_buffer));
|
|
|
|
|
memset(dma16_buffer, 0x00, sizeof(dma16_buffer));
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dma_init(void)
|
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
|
|
|
dma_reset();
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
io_sethandler(0x0000, 16,
|
|
|
|
|
dma_read,NULL,NULL, dma_write,NULL,NULL, NULL);
|
|
|
|
|
io_sethandler(0x0080, 8,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
dma_ps2.is_ps2 = 0;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dma16_init(void)
|
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
|
|
|
dma_reset();
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
io_sethandler(0x00C0, 32,
|
|
|
|
|
dma16_read,NULL,NULL, dma16_write,NULL,NULL, NULL);
|
|
|
|
|
io_sethandler(0x0088, 8,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dma_alias_set(void)
|
2016-12-23 03:16:24 +01:00
|
|
|
{
|
2020-04-16 21:56:19 +02:00
|
|
|
io_sethandler(0x0090, 2,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
io_sethandler(0x0093, 13,
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
2016-12-23 03:16:24 +01:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
void
|
|
|
|
|
dma_alias_set_piix(void)
|
|
|
|
|
{
|
|
|
|
|
io_sethandler(0x0090, 1,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
io_sethandler(0x0094, 3,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
io_sethandler(0x0098, 1,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
io_sethandler(0x009C, 3,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
void
|
|
|
|
|
dma_alias_remove(void)
|
2016-12-23 03:16:24 +01:00
|
|
|
{
|
2020-04-16 21:56:19 +02:00
|
|
|
io_removehandler(0x0090, 2,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
io_removehandler(0x0093, 13,
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
2016-12-23 03:16:24 +01:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
dma_alias_remove_piix(void)
|
2016-12-23 03:16:24 +01:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
io_removehandler(0x0090, 1,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
io_removehandler(0x0094, 3,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
io_removehandler(0x0098, 1,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
|
|
|
|
io_removehandler(0x009C, 3,
|
|
|
|
|
dma_page_read,NULL,NULL, dma_page_write,NULL,NULL, NULL);
|
2016-12-23 03:16:24 +01:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ps2_dma_init(void)
|
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
|
|
|
dma_reset();
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
io_sethandler(0x0018, 1,
|
|
|
|
|
dma_ps2_read,NULL,NULL, dma_ps2_write,NULL,NULL, NULL);
|
|
|
|
|
io_sethandler(0x001a, 1,
|
|
|
|
|
dma_ps2_read,NULL,NULL, dma_ps2_write,NULL,NULL, NULL);
|
|
|
|
|
dma_ps2.is_ps2 = 1;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2017-05-05 01:49:42 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
uint8_t
|
|
|
|
|
_dma_read(uint32_t addr)
|
2016-09-22 21:22:56 +02:00
|
|
|
{
|
2019-02-06 03:34:39 +01:00
|
|
|
uint8_t temp = mem_readb_phys(addr);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
return(temp);
|
2016-09-22 21:22:56 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
_dma_write(uint32_t addr, uint8_t val)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2019-02-06 03:34:39 +01:00
|
|
|
mem_writeb_phys(addr, val);
|
2018-04-25 23:51:13 +02:00
|
|
|
mem_invalidate_range(addr, addr);
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
int
|
|
|
|
|
dma_channel_read(int channel)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_t *dma_c = &dma[channel];
|
|
|
|
|
uint16_t temp;
|
|
|
|
|
int tc = 0;
|
|
|
|
|
|
|
|
|
|
if (channel < 4) {
|
|
|
|
|
if (dma_command & 0x04)
|
|
|
|
|
return(DMA_NODATA);
|
|
|
|
|
} else {
|
|
|
|
|
if (dma16_command & 0x04)
|
|
|
|
|
return(DMA_NODATA);
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-14 02:14:39 +01:00
|
|
|
if (!(dma_e & (1 << channel)))
|
|
|
|
|
return(DMA_NODATA);
|
2019-09-28 17:32:05 +02:00
|
|
|
if ((dma_m & (1 << channel)) && !dma_req_is_soft)
|
2018-04-25 23:51:13 +02:00
|
|
|
return(DMA_NODATA);
|
|
|
|
|
if ((dma_c->mode & 0xC) != 8)
|
|
|
|
|
return(DMA_NODATA);
|
|
|
|
|
|
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 (!AT && !channel)
|
2019-02-06 03:34:39 +01:00
|
|
|
refreshread();
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
if (! dma_c->size) {
|
|
|
|
|
temp = _dma_read(dma_c->ac);
|
|
|
|
|
|
|
|
|
|
if (dma_c->mode & 0x20) {
|
|
|
|
|
if (dma_ps2.is_ps2)
|
|
|
|
|
dma_c->ac--;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xff0000) | ((dma_c->ac - 1) & 0xffff);
|
|
|
|
|
} else {
|
|
|
|
|
if (dma_ps2.is_ps2)
|
|
|
|
|
dma_c->ac++;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xff0000) | ((dma_c->ac + 1) & 0xffff);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
temp = _dma_read(dma_c->ac) | (_dma_read(dma_c->ac + 1) << 8);
|
|
|
|
|
|
|
|
|
|
if (dma_c->mode & 0x20) {
|
|
|
|
|
if (dma_ps2.is_ps2)
|
|
|
|
|
dma_c->ac -= 2;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xfe0000) | ((dma_c->ac - 2) & 0x1ffff);
|
|
|
|
|
} else {
|
|
|
|
|
if (dma_ps2.is_ps2)
|
|
|
|
|
dma_c->ac += 2;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xfe0000) | ((dma_c->ac + 2) & 0x1ffff);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dma_stat_rq |= (1 << channel);
|
|
|
|
|
|
|
|
|
|
dma_c->cc--;
|
|
|
|
|
if (dma_c->cc < 0) {
|
|
|
|
|
tc = 1;
|
|
|
|
|
if (dma_c->mode & 0x10) { /*Auto-init*/
|
|
|
|
|
dma_c->cc = dma_c->cb;
|
|
|
|
|
dma_c->ac = dma_c->ab;
|
|
|
|
|
} else
|
|
|
|
|
dma_m |= (1 << channel);
|
|
|
|
|
dma_stat |= (1 << channel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tc)
|
|
|
|
|
return(temp | DMA_OVER);
|
|
|
|
|
|
|
|
|
|
return(temp);
|
2016-09-22 21:22:56 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
int
|
|
|
|
|
dma_channel_write(int channel, uint16_t val)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_t *dma_c = &dma[channel];
|
|
|
|
|
|
|
|
|
|
if (channel < 4) {
|
|
|
|
|
if (dma_command & 0x04)
|
|
|
|
|
return(DMA_NODATA);
|
|
|
|
|
} else {
|
|
|
|
|
if (dma16_command & 0x04)
|
|
|
|
|
return(DMA_NODATA);
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-14 02:14:39 +01:00
|
|
|
if (!(dma_e & (1 << channel)))
|
|
|
|
|
return(DMA_NODATA);
|
2019-09-28 17:32:05 +02:00
|
|
|
if ((dma_m & (1 << channel)) && !dma_req_is_soft)
|
2018-04-25 23:51:13 +02:00
|
|
|
return(DMA_NODATA);
|
|
|
|
|
if ((dma_c->mode & 0xC) != 4)
|
|
|
|
|
return(DMA_NODATA);
|
|
|
|
|
|
|
|
|
|
if (! dma_c->size) {
|
|
|
|
|
_dma_write(dma_c->ac, val & 0xff);
|
|
|
|
|
|
|
|
|
|
if (dma_c->mode & 0x20) {
|
|
|
|
|
if (dma_ps2.is_ps2)
|
|
|
|
|
dma_c->ac--;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xff0000) | ((dma_c->ac - 1) & 0xffff);
|
|
|
|
|
} else {
|
|
|
|
|
if (dma_ps2.is_ps2)
|
|
|
|
|
dma_c->ac++;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xff0000) | ((dma_c->ac + 1) & 0xffff);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
_dma_write(dma_c->ac, val & 0xff);
|
|
|
|
|
_dma_write(dma_c->ac + 1, val >> 8);
|
|
|
|
|
|
|
|
|
|
if (dma_c->mode & 0x20) {
|
|
|
|
|
if (dma_ps2.is_ps2)
|
|
|
|
|
dma_c->ac -= 2;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xfe0000) | ((dma_c->ac - 2) & 0x1ffff);
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xfe0000) | ((dma_c->ac - 2) & 0x1ffff);
|
|
|
|
|
} else {
|
|
|
|
|
if (dma_ps2.is_ps2)
|
|
|
|
|
dma_c->ac += 2;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac = (dma_c->ac & 0xfe0000) | ((dma_c->ac + 2) & 0x1ffff);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dma_stat_rq |= (1 << channel);
|
|
|
|
|
|
|
|
|
|
dma_c->cc--;
|
|
|
|
|
if (dma_c->cc < 0) {
|
|
|
|
|
if (dma_c->mode & 0x10) { /*Auto-init*/
|
|
|
|
|
dma_c->cc = dma_c->cb;
|
|
|
|
|
dma_c->ac = dma_c->ab;
|
|
|
|
|
} else
|
|
|
|
|
dma_m |= (1 << channel);
|
|
|
|
|
dma_stat |= (1 << channel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dma_m & (1 << channel))
|
|
|
|
|
return(DMA_OVER);
|
|
|
|
|
|
|
|
|
|
return(0);
|
2018-03-11 18:26:44 +01:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
dma_ps2_run(int channel)
|
2018-03-11 18:26:44 +01:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_t *dma_c = &dma[channel];
|
|
|
|
|
|
|
|
|
|
switch (dma_c->ps2_mode & DMA_PS2_XFER_MASK) {
|
|
|
|
|
case DMA_PS2_XFER_MEM_TO_IO:
|
|
|
|
|
do {
|
|
|
|
|
if (! dma_c->size) {
|
|
|
|
|
uint8_t temp = _dma_read(dma_c->ac);
|
|
|
|
|
|
|
|
|
|
outb(dma_c->io_addr, temp);
|
|
|
|
|
|
|
|
|
|
if (dma_c->ps2_mode & DMA_PS2_DEC2)
|
|
|
|
|
dma_c->ac--;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac++;
|
|
|
|
|
} else {
|
|
|
|
|
uint16_t temp = _dma_read(dma_c->ac) | (_dma_read(dma_c->ac + 1) << 8);
|
|
|
|
|
|
|
|
|
|
outw(dma_c->io_addr, temp);
|
|
|
|
|
|
|
|
|
|
if (dma_c->ps2_mode & DMA_PS2_DEC2)
|
|
|
|
|
dma_c->ac -= 2;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac += 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dma_stat_rq |= (1 << channel);
|
|
|
|
|
dma_c->cc--;
|
|
|
|
|
} while (dma_c->cc > 0);
|
|
|
|
|
|
|
|
|
|
dma_stat |= (1 << channel);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DMA_PS2_XFER_IO_TO_MEM:
|
|
|
|
|
do {
|
|
|
|
|
if (! dma_c->size) {
|
|
|
|
|
uint8_t temp = inb(dma_c->io_addr);
|
|
|
|
|
|
|
|
|
|
_dma_write(dma_c->ac, temp);
|
|
|
|
|
|
|
|
|
|
if (dma_c->ps2_mode & DMA_PS2_DEC2)
|
|
|
|
|
dma_c->ac--;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac++;
|
|
|
|
|
} else {
|
|
|
|
|
uint16_t temp = inw(dma_c->io_addr);
|
|
|
|
|
|
|
|
|
|
_dma_write(dma_c->ac, temp & 0xff);
|
|
|
|
|
_dma_write(dma_c->ac + 1, temp >> 8);
|
|
|
|
|
|
|
|
|
|
if (dma_c->ps2_mode & DMA_PS2_DEC2)
|
|
|
|
|
dma_c->ac -= 2;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac += 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dma_stat_rq |= (1 << channel);
|
|
|
|
|
dma_c->cc--;
|
|
|
|
|
} while (dma_c->cc > 0);
|
|
|
|
|
|
|
|
|
|
ps2_cache_clean();
|
|
|
|
|
dma_stat |= (1 << channel);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default: /*Memory verify*/
|
|
|
|
|
do {
|
|
|
|
|
if (! dma_c->size) {
|
|
|
|
|
if (dma_c->ps2_mode & DMA_PS2_DEC2)
|
|
|
|
|
dma_c->ac--;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac++;
|
|
|
|
|
} else {
|
|
|
|
|
if (dma_c->ps2_mode & DMA_PS2_DEC2)
|
|
|
|
|
dma_c->ac -= 2;
|
|
|
|
|
else
|
|
|
|
|
dma_c->ac += 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dma_stat_rq |= (1 << channel);
|
|
|
|
|
dma->cc--;
|
|
|
|
|
} while (dma->cc > 0);
|
|
|
|
|
|
|
|
|
|
dma_stat |= (1 << channel);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
2016-12-23 03:16:24 +01:00
|
|
|
}
|
2016-11-12 15:06:38 +01:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
int
|
|
|
|
|
dma_mode(int channel)
|
2016-12-23 03:16:24 +01:00
|
|
|
{
|
2019-09-21 03:33:05 +02:00
|
|
|
return(dma[channel].mode);
|
2016-11-12 15:06:38 +01:00
|
|
|
}
|
2016-12-23 03:16:24 +01:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2017-05-05 01:49:42 +02:00
|
|
|
/* DMA Bus Master Page Read/Write */
|
2018-04-25 23:51:13 +02:00
|
|
|
void
|
2020-04-28 01:01:39 +02:00
|
|
|
dma_bm_read(uint32_t PhysAddress, uint8_t *DataRead, uint32_t TotalSize, int TransferSize)
|
2016-12-23 03:16:24 +01:00
|
|
|
{
|
2020-04-28 01:01:39 +02:00
|
|
|
uint32_t i = 0, n, n2;
|
|
|
|
|
uint8_t bytes[4] = { 0, 0, 0, 0 };
|
|
|
|
|
|
|
|
|
|
n = TotalSize & ~(TransferSize - 1);
|
|
|
|
|
n2 = TotalSize - n;
|
|
|
|
|
|
|
|
|
|
/* Do the divisible block, if there is one. */
|
|
|
|
|
if (n) {
|
|
|
|
|
for (i = 0; i < n; i += TransferSize)
|
|
|
|
|
mem_read_phys((void *) &(DataRead[i]), PhysAddress + i, TransferSize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Do the non-divisible block, if there is one. */
|
|
|
|
|
if (n2) {
|
|
|
|
|
mem_read_phys((void *) bytes, PhysAddress + n, TransferSize);
|
|
|
|
|
memcpy((void *) &(DataRead[n]), bytes, n2);
|
|
|
|
|
}
|
2017-05-05 01:49:42 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
void
|
2020-04-28 01:01:39 +02:00
|
|
|
dma_bm_write(uint32_t PhysAddress, const uint8_t *DataWrite, uint32_t TotalSize, int TransferSize)
|
2017-05-05 01:49:42 +02:00
|
|
|
{
|
2020-04-28 01:01:39 +02:00
|
|
|
uint32_t i = 0, n, n2;
|
|
|
|
|
uint8_t bytes[4] = { 0, 0, 0, 0 };
|
|
|
|
|
|
|
|
|
|
n = TotalSize & ~(TransferSize - 1);
|
|
|
|
|
n2 = TotalSize - n;
|
2017-12-10 15:16:24 +01:00
|
|
|
|
2020-04-28 01:01:39 +02:00
|
|
|
/* Do the divisible block, if there is one. */
|
|
|
|
|
if (n) {
|
|
|
|
|
for (i = 0; i < n; i += TransferSize)
|
|
|
|
|
mem_write_phys((void *) &(DataWrite[i]), PhysAddress + i, TransferSize);
|
|
|
|
|
}
|
2017-12-10 15:16:24 +01:00
|
|
|
|
2020-04-28 01:01:39 +02:00
|
|
|
/* Do the non-divisible block, if there is one. */
|
|
|
|
|
if (n2) {
|
|
|
|
|
mem_read_phys((void *) bytes, PhysAddress + n, TransferSize);
|
|
|
|
|
memcpy(bytes, (void *) &(DataWrite[n]), n2);
|
|
|
|
|
mem_write_phys((void *) bytes, PhysAddress + n, TransferSize);
|
|
|
|
|
}
|
2017-05-05 01:49:42 +02:00
|
|
|
}
|