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.
This commit is contained in:
OBattler
2019-09-20 14:02:30 +02:00
parent b06296bbf6
commit 552a87ea3d
524 changed files with 129555 additions and 21862 deletions

View File

@@ -90,7 +90,7 @@
#define BIOS_FILE_H L"roms/hdd/esdi/90x8970.bin"
#define ESDI_TIME (200LL*TIMER_USEC)
#define ESDI_TIME (200*TIMER_USEC)
#define CMD_ADAPTER 0
@@ -134,7 +134,8 @@ typedef struct esdi {
int cmd_state;
int in_reset;
int64_t callback;
uint64_t callback;
pc_timer_t timer;
uint32_t rba;
@@ -188,6 +189,8 @@ typedef struct esdi {
#define CMD_GET_DEV_STATUS 0x08
#define CMD_GET_DEV_CONFIG 0x09
#define CMD_GET_POS_INFO 0x0a
#define CMD_FORMAT_UNIT 0x16
#define CMD_FORMAT_PREPARE 0x17
#define STATUS_LEN(x) ((x) << 8)
#define STATUS_DEVICE(x) ((x) << 5)
@@ -228,6 +231,21 @@ clear_irq(esdi_t *dev)
picintc(1 << 14);
}
static void
esdi_mca_set_callback(esdi_t *dev, uint64_t callback)
{
if (!dev) {
return;
}
if (callback) {
dev->callback = callback;
timer_set_delay_u64(&dev->timer, dev->callback);
} else {
dev->callback = 0;
timer_disable(&dev->timer);
}
}
static void
@@ -339,7 +357,7 @@ esdi_callback(void *priv)
drive_t *drive;
int val;
dev->callback = 0LL;
esdi_mca_set_callback(dev, 0);
/* If we are returning from a RESET, handle this first. */
if (dev->in_reset) {
@@ -377,13 +395,13 @@ esdi_callback(void *priv)
set_irq(dev);
dev->cmd_state = 1;
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
dev->data_pos = 0;
break;
case 1:
if (!(dev->basic_ctrl & CTRL_DMA_ENA)) {
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
return;
}
@@ -399,7 +417,7 @@ esdi_callback(void *priv)
val = dma_channel_write(dev->dma, dev->data[dev->data_pos]);
if (val == DMA_NODATA) {
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
return;
}
@@ -413,7 +431,7 @@ esdi_callback(void *priv)
dev->status = STATUS_CMD_IN_PROGRESS;
dev->cmd_state = 2;
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
break;
case 2:
@@ -452,13 +470,13 @@ esdi_callback(void *priv)
set_irq(dev);
dev->cmd_state = 1;
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
dev->data_pos = 0;
break;
case 1:
if (! (dev->basic_ctrl & CTRL_DMA_ENA)) {
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
return;
}
@@ -467,7 +485,7 @@ esdi_callback(void *priv)
val = dma_channel_read(dev->dma);
if (val == DMA_NODATA) {
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
return;
}
@@ -487,7 +505,7 @@ esdi_callback(void *priv)
dev->status = STATUS_CMD_IN_PROGRESS;
dev->cmd_state = 2;
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
break;
case 2:
@@ -630,13 +648,13 @@ esdi_callback(void *priv)
set_irq(dev);
dev->cmd_state = 1;
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
dev->data_pos = 0;
break;
case 1:
if (! (dev->basic_ctrl & CTRL_DMA_ENA)) {
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
return;
}
while (dev->sector_pos < dev->sector_count) {
@@ -644,7 +662,7 @@ esdi_callback(void *priv)
val = dma_channel_read(dev->dma);
if (val == DMA_NODATA) {
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
return;
}
@@ -657,7 +675,7 @@ esdi_callback(void *priv)
dev->status = STATUS_CMD_IN_PROGRESS;
dev->cmd_state = 2;
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
break;
case 2:
@@ -684,13 +702,13 @@ esdi_callback(void *priv)
set_irq(dev);
dev->cmd_state = 1;
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
dev->data_pos = 0;
break;
case 1:
if (! (dev->basic_ctrl & CTRL_DMA_ENA)) {
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
return;
}
@@ -701,7 +719,7 @@ esdi_callback(void *priv)
val = dma_channel_write(dev->dma, dev->data[dev->data_pos]);
if (val == DMA_NODATA) {
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
return;
}
@@ -713,7 +731,7 @@ esdi_callback(void *priv)
dev->status = STATUS_CMD_IN_PROGRESS;
dev->cmd_state = 2;
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
break;
case 2:
@@ -740,6 +758,59 @@ esdi_callback(void *priv)
set_irq(dev);
break;
case CMD_FORMAT_UNIT:
case CMD_FORMAT_PREPARE:
ESDI_DRIVE_ONLY();
if (! drive->present) {
device_not_present(dev);
return;
}
switch (dev->cmd_state) {
case 0:
dev->rba = (dev->cmd_data[2] | (dev->cmd_data[3] << 16)) & 0x0fffffff;
dev->sector_count = dev->cmd_data[1];
if ((dev->rba + dev->sector_count) > hdd_image_get_last_sector(drive->hdd_num)) {
rba_out_of_range(dev);
return;
}
dev->status = STATUS_IRQ | STATUS_CMD_IN_PROGRESS | STATUS_TRANSFER_REQ;
dev->irq_status = dev->cmd_dev | IRQ_DATA_TRANSFER_READY;
dev->irq_in_progress = 1;
set_irq(dev);
dev->cmd_state = 1;
esdi_mca_set_callback(dev, ESDI_TIME);
break;
case 1:
if (!(dev->basic_ctrl & CTRL_DMA_ENA)) {
esdi_mca_set_callback(dev, ESDI_TIME);
return;
}
hdd_image_zero(drive->hdd_num, dev->rba, dev->sector_count);
ui_sb_update_icon(SB_HDD | HDD_BUS_ESDI, 1);
dev->status = STATUS_CMD_IN_PROGRESS;
dev->cmd_state = 2;
esdi_mca_set_callback(dev, ESDI_TIME);
break;
case 2:
complete_command_status(dev);
dev->status = STATUS_IRQ | STATUS_STATUS_OUT_FULL;
dev->irq_status = dev->cmd_dev | IRQ_CMD_COMPLETE_SUCCESS;
dev->irq_in_progress = 1;
set_irq(dev);
break;
}
break;
default:
fatal("BAD COMMAND %02x %i\n", dev->command, dev->cmd_dev);
}
@@ -781,7 +852,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
case 2: /*Basic control register*/
if ((dev->basic_ctrl & CTRL_RESET) && !(val & CTRL_RESET)) {
dev->in_reset = 1;
dev->callback = ESDI_TIME * 50LL;
esdi_mca_set_callback(dev, ESDI_TIME * 50);
dev->status = STATUS_BUSY;
}
dev->basic_ctrl = val;
@@ -812,7 +883,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
case ATTN_RESET:
dev->in_reset = 1;
dev->callback = ESDI_TIME * 50LL;
esdi_mca_set_callback(dev, ESDI_TIME * 50);
dev->status = STATUS_BUSY;
break;
@@ -923,7 +994,7 @@ esdi_writew(uint16_t port, uint16_t val, void *priv)
if ((dev->cmd_data[0] & CMD_DEVICE_SEL) != dev->cmd_dev)
fatal("Command device mismatch with attn\n");
dev->command = dev->cmd_data[0] & CMD_MASK;
dev->callback = ESDI_TIME;
esdi_mca_set_callback(dev, ESDI_TIME);
dev->status = STATUS_BUSY;
dev->data_pos = 0;
}
@@ -1007,6 +1078,15 @@ esdi_mca_write(int port, uint8_t val, void *priv)
}
static uint8_t
esdi_mca_feedb(void *priv)
{
esdi_t *dev = (esdi_t *)priv;
return (dev->pos_regs[2] & 1);
}
static void *
esdi_init(const device_t *info)
{
@@ -1059,15 +1139,15 @@ esdi_init(const device_t *info)
dev->pos_regs[1] = 0xdd;
/* Enable the device. */
mca_add(esdi_mca_read, esdi_mca_write, dev);
mca_add(esdi_mca_read, esdi_mca_write, esdi_mca_feedb, dev);
/* Mark for a reset. */
dev->in_reset = 1;
dev->callback = ESDI_TIME * 50LL;
esdi_mca_set_callback(dev, ESDI_TIME * 50);
dev->status = STATUS_BUSY;
/* Set the reply timer. */
timer_add(esdi_callback, &dev->callback, &dev->callback, dev);
timer_add(&dev->timer, esdi_callback, dev, 0);
return(dev);
}