More 808x fixed - fixed (kind of) the 8086 lock ups and the DRAM refresh wait states, also further fixed (and cleaned up) prefetch queue operation, applied a few warning fixes, and fixed the behavior of PUSH SP - anything that uses it to tell 808x apart from 286 is now fixed;

Re-added the higher-clocked 8088's;
Fixed PIT timings for 808x CPU's that don't run off an 14.3 MHz crystal;
Fixed CGA cursor half blink rate setting - fixes insane cursor blinking speed in several cases;
DMA now issues DMA refresh DRAM states on every channel;
Gave the 1982 years to the previously emulated PC and XT's names, and added the 1981 IBM PC and 1986 IBM XT;
Redid the PPI DIP switch redout for the PC/XT keyboard controller;
Fixed a segmentation fault in hdc_ide.c that tended to occur on hard reset after switching machines;
Implemented the port 3B8 color disable on the Hercules, Hercules Plus, and Hercules InColor cards;
Fixed the joystick configuration dialog strings;
Fixed a problem that would have prevented win_sdl.c from compiling with logging enabled.
This commit is contained in:
OBattler
2019-02-11 01:33:15 +01:00
parent a4c11f9536
commit c1f18d9abc
21 changed files with 611 additions and 359 deletions

View File

@@ -463,10 +463,17 @@ cga_poll(void *p)
cga->cgadispon = 1;
cga->ma = cga->maback = (cga->crtc[13] | (cga->crtc[12] << 8)) & 0x3fff;
}
if ((cga->crtc[10] & 0x60) == 0x20)
cga->cursoron = 0;
else
cga->cursoron = cga->cgablink & 8;
switch (cga->crtc[10] & 0x60) {
case 0x20:
cga->cursoron = 0;
break;
case 0x60:
cga->cursoron = cga->cgablink & 0x10;
break;
default:
cga->cursoron = cga->cgablink & 0x08;
break;
}
}
if (cga->vc == cga->crtc[7]) {

View File

@@ -8,13 +8,13 @@
*
* Hercules emulation.
*
* Version: @(#)vid_hercules.c 1.0.16 2018/11/18
* Version: @(#)vid_hercules.c 1.0.17 2019/02/07
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2018 Sarah Walker.
* Copyright 2016-2018 Miran Grca.
* Copyright 2008-2019 Sarah Walker.
* Copyright 2016-2019 Miran Grca.
*/
#include <stdio.h>
#include <stdint.h>
@@ -22,6 +22,7 @@
#include <string.h>
#include <wchar.h>
#include "../86box.h"
#include "../cpu/cpu.h"
#include "../mem.h"
#include "../rom.h"
#include "../io.h"
@@ -92,6 +93,7 @@ static void
hercules_out(uint16_t addr, uint8_t val, void *priv)
{
hercules_t *dev = (hercules_t *)priv;
uint8_t old;
switch (addr) {
case 0x03b0:
@@ -105,6 +107,7 @@ hercules_out(uint16_t addr, uint8_t val, void *priv)
case 0x03b3:
case 0x03b5:
case 0x03b7:
old = dev->crtc[dev->crtcreg];
dev->crtc[dev->crtcreg] = val;
/*
@@ -115,11 +118,15 @@ hercules_out(uint16_t addr, uint8_t val, void *priv)
dev->crtc[10] = 0xb;
dev->crtc[11] = 0xc;
}
recalc_timings(dev);
if (old ^ val)
recalc_timings(dev);
break;
case 0x03b8:
old = dev->ctrl;
dev->ctrl = val;
if (old ^ val)
recalc_timings(dev);
break;
case 0x03bf:
@@ -158,7 +165,9 @@ hercules_in(uint16_t addr, void *priv)
break;
case 0x03ba:
ret = (dev->stat & 0xf) | ((dev->stat & 8) << 4);
ret = 0x72; /* Hercules ident */
if (dev->stat & 0x08)
ret |= 0x88;
break;
default:
@@ -169,12 +178,24 @@ hercules_in(uint16_t addr, void *priv)
}
static void
hercules_waitstates(void *p)
{
int ws_array[16] = {3, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8};
int ws;
ws = ws_array[cycles & 0xf];
cycles -= ws;
}
static void
hercules_write(uint32_t addr, uint8_t val, void *priv)
{
hercules_t *dev = (hercules_t *)priv;
dev->vram[addr & 0xffff] = val;
hercules_waitstates(dev);
}
@@ -184,6 +205,7 @@ hercules_read(uint32_t addr, void *priv)
hercules_t *dev = (hercules_t *)priv;
return(dev->vram[addr & 0xffff]);
hercules_waitstates(dev);
}
@@ -221,7 +243,10 @@ hercules_poll(void *priv)
ca += 0x8000;
for (x = 0; x < dev->crtc[1]; x++) {
dat = (dev->vram[((dev->ma << 1) & 0x1fff) + ca] << 8) | dev->vram[((dev->ma << 1) & 0x1fff) + ca + 1];
if (dev->ctrl & 8)
dat = (dev->vram[((dev->ma << 1) & 0x1fff) + ca] << 8) | dev->vram[((dev->ma << 1) & 0x1fff) + ca + 1];
else
dat = 0;
dev->ma++;
for (c = 0; c < 16; c++) {
buffer->line[dev->displine][(x << 4) + c] = (dat & (32768 >> c)) ? 7 : 0;
@@ -231,8 +256,11 @@ hercules_poll(void *priv)
}
} else {
for (x = 0; x < dev->crtc[1]; x++) {
chr = dev->vram[(dev->ma << 1) & 0xfff];
attr = dev->vram[((dev->ma << 1) + 1) & 0xfff];
if (dev->ctrl & 8) {
chr = dev->vram[(dev->ma << 1) & 0xfff];
attr = dev->vram[((dev->ma << 1) + 1) & 0xfff];
} else
chr = attr = 0;
drawcursor = ((dev->ma == ca) && dev->con && dev->cursoron);
blink = ((dev->blink & 16) && (dev->ctrl & 0x20) && (attr & 0x80) && !drawcursor);
@@ -267,9 +295,6 @@ hercules_poll(void *priv)
} else {
dev->vidtime += dev->dispontime;
if (dev->dispon)
dev->stat &= ~1;
dev->linepos = 0;
if (dev->vsynctime) {
dev->vsynctime--;
@@ -327,7 +352,8 @@ hercules_poll(void *priv)
x = dev->crtc[1] * 9;
dev->lastline++;
if ((x != xsize) || ((dev->lastline - dev->firstline) != ysize) || video_force_resize_get()) {
if ((dev->ctrl & 8) &&
((x != xsize) || ((dev->lastline - dev->firstline) != ysize) || video_force_resize_get())) {
xsize = x;
ysize = dev->lastline - dev->firstline;
if (xsize < 64) xsize = 656;
@@ -360,6 +386,9 @@ hercules_poll(void *priv)
dev->ma = dev->maback;
}
if (dev->dispon)
dev->stat &= ~1;
if ((dev->sc == (dev->crtc[10] & 31) ||
((dev->crtc[8] & 3)==3 && dev->sc == ((dev->crtc[10] & 31) >> 1))))
dev->con = 1;

View File

@@ -8,7 +8,7 @@
*
* Hercules Plus emulation.
*
* Version: @(#)vid_herculesplus.c 1.0.14 2018/11/18
* Version: @(#)vid_herculesplus.c 1.0.15 2019/02/07
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -113,6 +113,7 @@ static void
herculesplus_out(uint16_t port, uint8_t val, void *priv)
{
herculesplus_t *dev = (herculesplus_t *)priv;
uint8_t old;
switch (port) {
case 0x3b0:
@@ -127,6 +128,7 @@ herculesplus_out(uint16_t port, uint8_t val, void *priv)
case 0x3b5:
case 0x3b7:
if (dev->crtcreg > 22) return;
old = dev->crtc[dev->crtcreg];
dev->crtc[dev->crtcreg] = val;
if (dev->crtc[10] == 6 && dev->crtc[11] == 7) {
/*Fix for Generic Turbo XT BIOS,
@@ -134,11 +136,15 @@ herculesplus_out(uint16_t port, uint8_t val, void *priv)
dev->crtc[10] = 0xb;
dev->crtc[11] = 0xc;
}
recalc_timings(dev);
if (old ^ val)
recalc_timings(dev);
return;
case 0x3b8:
old = dev->ctrl;
dev->ctrl = val;
if (old ^ val)
recalc_timings(dev);
return;
case 0x3bf:
@@ -414,8 +420,11 @@ text_line(herculesplus_t *dev, uint16_t ca)
uint32_t col;
for (x = 0; x < dev->crtc[1]; x++) {
chr = dev->vram[(dev->ma << 1) & 0xfff];
attr = dev->vram[((dev->ma << 1) + 1) & 0xfff];
if (dev->ctrl & 8) {
chr = dev->vram[(dev->ma << 1) & 0xfff];
attr = dev->vram[((dev->ma << 1) + 1) & 0xfff];
} else
chr = attr = 0;
drawcursor = ((dev->ma == ca) && dev->con && dev->cursoron);
@@ -459,8 +468,11 @@ graphics_line(herculesplus_t *dev)
ca += 0x8000;
for (x = 0; x < dev->crtc[1]; x++) {
val = (dev->vram[((dev->ma << 1) & 0x1fff) + ca + 0x10000 * plane] << 8)
| dev->vram[((dev->ma << 1) & 0x1fff) + ca + 0x10000 * plane + 1];
if (dev->ctrl & 8)
val = (dev->vram[((dev->ma << 1) & 0x1fff) + ca + 0x10000 * plane] << 8)
| dev->vram[((dev->ma << 1) & 0x1fff) + ca + 0x10000 * plane + 1];
else
val = 0;
dev->ma++;
for (c = 0; c < 16; c++) {
@@ -559,7 +571,8 @@ herculesplus_poll(void *priv)
else
x = dev->crtc[1] * 9;
dev->lastline++;
if ((x != xsize) || ((dev->lastline - dev->firstline) != ysize) || video_force_resize_get()) {
if ((dev->ctrl & 8) &&
((x != xsize) || ((dev->lastline - dev->firstline) != ysize) || video_force_resize_get())) {
xsize = x;
ysize = dev->lastline - dev->firstline;
if (xsize < 64) xsize = 656;

View File

@@ -8,7 +8,7 @@
*
* Hercules InColor emulation.
*
* Version: @(#)vid_incolor.c 1.0.13 2018/10/11
* Version: @(#)vid_incolor.c 1.0.14 2019/02/08
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -210,6 +210,7 @@ static void
incolor_out(uint16_t port, uint8_t val, void *priv)
{
incolor_t *dev = (incolor_t *)priv;
uint8_t old;
switch (port) {
case 0x3b0:
@@ -226,6 +227,7 @@ incolor_out(uint16_t port, uint8_t val, void *priv)
dev->palette[dev->palette_idx % 16] = val;
++dev->palette_idx;
}
old = dev->crtc[dev->crtcreg];
dev->crtc[dev->crtcreg] = val;
if (dev->crtc[10] == 6 && dev->crtc[11] == 7) {
@@ -234,11 +236,15 @@ incolor_out(uint16_t port, uint8_t val, void *priv)
dev->crtc[10] = 0xb;
dev->crtc[11] = 0xc;
}
recalc_timings(dev);
if (old ^ val)
recalc_timings(dev);
return;
case 0x3b8:
old = dev->ctrl;
dev->ctrl = val;
if (old ^ val)
recalc_timings(dev);
return;
case 0x3bf:
@@ -795,8 +801,11 @@ text_line(incolor_t *dev, uint16_t ca)
uint32_t col;
for (x = 0; x < dev->crtc[1]; x++) {
chr = dev->vram[(dev->ma << 1) & 0xfff];
attr = dev->vram[((dev->ma << 1) + 1) & 0xfff];
if (dev->ctrl & 8) {
chr = dev->vram[(dev->ma << 1) & 0xfff];
attr = dev->vram[((dev->ma << 1) + 1) & 0xfff];
} else
chr = attr = 0;
drawcursor = ((dev->ma == ca) && dev->con && dev->cursoron);
@@ -862,10 +871,13 @@ graphics_line(incolor_t *dev)
mask = dev->crtc[INCOLOR_CRTC_MASK]; /* Planes to display */
for (plane = 0; plane < 4; plane++, mask = mask >> 1)
{
if (mask & 1)
val[plane] = (dev->vram[((dev->ma << 1) & 0x1fff) + ca + 0x10000 * plane] << 8) |
dev->vram[((dev->ma << 1) & 0x1fff) + ca + 0x10000 * plane + 1];
else val[plane] = 0;
if (dev->ctrl & 8) {
if (mask & 1)
val[plane] = (dev->vram[((dev->ma << 1) & 0x1fff) + ca + 0x10000 * plane] << 8) |
dev->vram[((dev->ma << 1) & 0x1fff) + ca + 0x10000 * plane + 1];
else val[plane] = 0;
} else
val[plane] = 0;
}
dev->ma++;
@@ -976,7 +988,8 @@ incolor_poll(void *priv)
else
x = dev->crtc[1] * 9;
dev->lastline++;
if ((x != xsize) || ((dev->lastline - dev->firstline) != ysize) || video_force_resize_get()) {
if ((dev->ctrl & 8) &&
((x != xsize) || ((dev->lastline - dev->firstline) != ysize) || video_force_resize_get())) {
xsize = x;
ysize = dev->lastline - dev->firstline;
if (xsize < 64) xsize = 656;