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:
@@ -25,17 +25,18 @@
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include "../86box.h"
|
||||
#include "../timer.h"
|
||||
#include "../io.h"
|
||||
#include "../pic.h"
|
||||
#include "../pit.h"
|
||||
#include "../ppi.h"
|
||||
#include "../nmi.h"
|
||||
#include "../mem.h"
|
||||
#include "../timer.h"
|
||||
#include "../device.h"
|
||||
#include "../nvr.h"
|
||||
#include "../keyboard.h"
|
||||
#include "../mouse.h"
|
||||
#include "../rom.h"
|
||||
#include "../floppy/fdd.h"
|
||||
#include "../floppy/fdc.h"
|
||||
#include "../game/gameport.h"
|
||||
@@ -70,13 +71,13 @@ typedef struct {
|
||||
int linepos, displine;
|
||||
int sc, vc;
|
||||
int con, coff, cursoron, blink;
|
||||
int64_t vsynctime;
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
int lineff;
|
||||
uint16_t ma, maback;
|
||||
int dispon;
|
||||
int64_t dispontime, dispofftime;
|
||||
int64_t vidtime;
|
||||
uint64_t dispontime, dispofftime;
|
||||
pc_timer_t timer;
|
||||
int firstline, lastline;
|
||||
|
||||
/* Keyboard stuff. */
|
||||
@@ -93,6 +94,7 @@ typedef struct {
|
||||
/* Mouse stuff. */
|
||||
int mouse_mode;
|
||||
int x, y, b;
|
||||
pc_timer_t send_delay_timer;
|
||||
} olim24_t;
|
||||
|
||||
static video_timings_t timing_m24 = {VIDEO_ISA, 8,16,32, 8,16,32};
|
||||
@@ -147,8 +149,8 @@ recalc_timings(olim24_t *m24)
|
||||
_dispofftime = disptime - _dispontime;
|
||||
_dispontime *= CGACONST / 2;
|
||||
_dispofftime *= CGACONST / 2;
|
||||
m24->dispontime = (int64_t)(_dispontime * (1 << TIMER_SHIFT));
|
||||
m24->dispofftime = (int64_t)(_dispofftime * (1 << TIMER_SHIFT));
|
||||
m24->dispontime = (uint64_t)(_dispontime);
|
||||
m24->dispofftime = (uint64_t)(_dispofftime);
|
||||
}
|
||||
|
||||
|
||||
@@ -234,10 +236,12 @@ static void
|
||||
vid_write(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
int offset;
|
||||
|
||||
m24->vram[addr & 0x7FFF]=val;
|
||||
m24->charbuffer[ ((int)(((m24->dispontime - m24->vidtime) * 2) / (CGACONST / 2))) & 0xfc] = val;
|
||||
m24->charbuffer[(((int)(((m24->dispontime - m24->vidtime) * 2) / (CGACONST / 2))) & 0xfc) | 1] = val;
|
||||
offset = ((timer_get_remaining_u64(&m24->timer) / CGACONST) * 4) & 0xfc;
|
||||
m24->charbuffer[offset] = m24->vram[addr & 0x7fff];
|
||||
m24->charbuffer[offset | 1] = m24->vram[addr & 0x7fff];
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +269,7 @@ vid_poll(void *priv)
|
||||
int oldsc;
|
||||
|
||||
if (!m24->linepos) {
|
||||
m24->vidtime += m24->dispofftime;
|
||||
timer_advance_u64(&m24->timer, m24->dispofftime);
|
||||
m24->stat |= 1;
|
||||
m24->linepos = 1;
|
||||
oldsc = m24->sc;
|
||||
@@ -279,17 +283,17 @@ vid_poll(void *priv)
|
||||
for (c = 0; c < 8; c++)
|
||||
{
|
||||
if ((m24->cgamode & 0x12) == 0x12) {
|
||||
buffer->line[m24->displine][c] = 0;
|
||||
((uint32_t *)buffer32->line[m24->displine])[c] = 0;
|
||||
if (m24->cgamode & 1)
|
||||
buffer->line[m24->displine][c + (m24->crtc[1] << 3) + 8] = 0;
|
||||
((uint32_t *)buffer32->line[m24->displine])[c + (m24->crtc[1] << 3) + 8] = 0;
|
||||
else
|
||||
buffer->line[m24->displine][c + (m24->crtc[1] << 4) + 8] = 0;
|
||||
((uint32_t *)buffer32->line[m24->displine])[c + (m24->crtc[1] << 4) + 8] = 0;
|
||||
} else {
|
||||
buffer->line[m24->displine][c] = (m24->cgacol & 15) + 16;
|
||||
((uint32_t *)buffer32->line[m24->displine])[c] = (m24->cgacol & 15) + 16;
|
||||
if (m24->cgamode & 1)
|
||||
buffer->line[m24->displine][c + (m24->crtc[1] << 3) + 8] = (m24->cgacol & 15) + 16;
|
||||
((uint32_t *)buffer32->line[m24->displine])[c + (m24->crtc[1] << 3) + 8] = (m24->cgacol & 15) + 16;
|
||||
else
|
||||
buffer->line[m24->displine][c + (m24->crtc[1] << 4) + 8] = (m24->cgacol & 15) + 16;
|
||||
((uint32_t *)buffer32->line[m24->displine])[c + (m24->crtc[1] << 4) + 8] = (m24->cgacol & 15) + 16;
|
||||
}
|
||||
}
|
||||
if (m24->cgamode & 1) {
|
||||
@@ -308,10 +312,10 @@ vid_poll(void *priv)
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++)
|
||||
buffer->line[m24->displine][(x << 3) + c + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 3) + c + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
||||
} else {
|
||||
for (c = 0; c < 8; c++)
|
||||
buffer->line[m24->displine][(x << 3) + c + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 3) + c + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
m24->ma++;
|
||||
}
|
||||
@@ -332,12 +336,12 @@ vid_poll(void *priv)
|
||||
m24->ma++;
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++)
|
||||
buffer->line[m24->displine][(x << 4) + (c << 1) + 8] =
|
||||
buffer->line[m24->displine][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 8] =
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
||||
} else {
|
||||
for (c = 0; c < 8; c++)
|
||||
buffer->line[m24->displine][(x << 4) + (c << 1) + 8] =
|
||||
buffer->line[m24->displine][(x << 4) + (c << 1) + 1 + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 8] =
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
} else if (!(m24->cgamode & 16)) {
|
||||
@@ -361,8 +365,8 @@ vid_poll(void *priv)
|
||||
m24->vram[((m24->ma << 1) & 0x1fff) + ((m24->sc & 1) * 0x2000) + 1 + m24->base];
|
||||
m24->ma++;
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer->line[m24->displine][(x << 4) + (c << 1) + 8] =
|
||||
buffer->line[m24->displine][(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 8] =
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
|
||||
dat <<= 2;
|
||||
}
|
||||
}
|
||||
@@ -379,15 +383,15 @@ vid_poll(void *priv)
|
||||
dat = (m24->vram[((m24->ma << 1) & 0x1fff) + dat2] << 8) | m24->vram[((m24->ma << 1) & 0x1fff) + dat2 + 1];
|
||||
m24->ma++;
|
||||
for (c = 0; c < 16; c++) {
|
||||
buffer->line[m24->displine][(x << 4) + c + 8] = cols[dat >> 15];
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + c + 8] = cols[dat >> 15];
|
||||
dat <<= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cols[0] = ((m24->cgamode & 0x12) == 0x12) ? 0 : (m24->cgacol & 15) + 16;
|
||||
if (m24->cgamode & 1) hline(buffer, 0, m24->displine, (m24->crtc[1] << 3) + 16, cols[0]);
|
||||
else hline(buffer, 0, m24->displine, (m24->crtc[1] << 4) + 16, cols[0]);
|
||||
if (m24->cgamode & 1) hline(buffer32, 0, m24->displine, (m24->crtc[1] << 3) + 16, cols[0]);
|
||||
else hline(buffer32, 0, m24->displine, (m24->crtc[1] << 4) + 16, cols[0]);
|
||||
}
|
||||
|
||||
if (m24->cgamode & 1)
|
||||
@@ -401,7 +405,7 @@ vid_poll(void *priv)
|
||||
m24->displine++;
|
||||
if (m24->displine >= 720) m24->displine = 0;
|
||||
} else {
|
||||
m24->vidtime += m24->dispontime;
|
||||
timer_advance_u64(&m24->timer, m24->dispontime);
|
||||
if (m24->dispon) m24->stat &= ~1;
|
||||
m24->linepos = 0;
|
||||
m24->lineff ^= 1;
|
||||
@@ -525,7 +529,7 @@ kbd_poll(void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
|
||||
keyboard_delay += (1000LL * TIMER_USEC);
|
||||
timer_advance_u64(&m24->send_delay_timer, 1000 * TIMER_USEC);
|
||||
if (m24->wantirq) {
|
||||
m24->wantirq = 0;
|
||||
picint(2);
|
||||
@@ -634,9 +638,6 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
case 0x61:
|
||||
ppi.pb = val;
|
||||
|
||||
timer_process();
|
||||
timer_update_outstanding();
|
||||
|
||||
speaker_update();
|
||||
speaker_gated = val & 1;
|
||||
speaker_enable = val & 2;
|
||||
@@ -803,9 +804,39 @@ const device_t m24_device = {
|
||||
};
|
||||
|
||||
|
||||
void
|
||||
static void
|
||||
kbd_reset(void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
|
||||
/* Initialize the keyboard. */
|
||||
m24->status = STAT_LOCK | STAT_CD;
|
||||
m24->wantirq = 0;
|
||||
keyboard_scan = 1;
|
||||
m24->param = m24->param_total = 0;
|
||||
m24->mouse_mode = 0;
|
||||
m24->scan[0] = 0x1c;
|
||||
m24->scan[1] = 0x53;
|
||||
m24->scan[2] = 0x01;
|
||||
m24->scan[3] = 0x4b;
|
||||
m24->scan[4] = 0x4d;
|
||||
m24->scan[5] = 0x48;
|
||||
m24->scan[6] = 0x50;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_olim24_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/olivetti_m24/olivetti_m24_version_1.43_low.bin",
|
||||
L"roms/machines/olivetti_m24/olivetti_m24_version_1.43_high.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
olim24_t *m24;
|
||||
|
||||
m24 = (olim24_t *)malloc(sizeof(olim24_t));
|
||||
@@ -823,31 +854,25 @@ machine_olim24_init(const machine_t *model)
|
||||
vid_read, NULL, NULL,
|
||||
vid_write, NULL, NULL, NULL, 0, m24);
|
||||
io_sethandler(0x03d0, 16, vid_in, NULL, NULL, vid_out, NULL, NULL, m24);
|
||||
timer_add(vid_poll, &m24->vidtime, TIMER_ALWAYS_ENABLED, m24);
|
||||
timer_add(&m24->timer, vid_poll, m24, 1);
|
||||
device_add_ex(&m24_device, m24);
|
||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_m24);
|
||||
|
||||
/* Initialize the keyboard. */
|
||||
m24->status = STAT_LOCK | STAT_CD;
|
||||
m24->scan[0] = 0x1c;
|
||||
m24->scan[1] = 0x53;
|
||||
m24->scan[2] = 0x01;
|
||||
m24->scan[3] = 0x4b;
|
||||
m24->scan[4] = 0x4d;
|
||||
m24->scan[5] = 0x48;
|
||||
m24->scan[6] = 0x50;
|
||||
io_sethandler(0x0060, 2,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, m24);
|
||||
io_sethandler(0x0064, 1,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, m24);
|
||||
keyboard_set_table(scancode_xt);
|
||||
keyboard_send = kbd_adddata_ex;
|
||||
keyboard_scan = 1;
|
||||
timer_add(kbd_poll, &keyboard_delay, TIMER_ALWAYS_ENABLED, m24);
|
||||
kbd_reset(m24);
|
||||
timer_add(&m24->send_delay_timer, kbd_poll, m24, 1);
|
||||
|
||||
/* Tell mouse driver about our internal mouse. */
|
||||
mouse_reset();
|
||||
mouse_set_poll(ms_poll, m24);
|
||||
|
||||
keyboard_set_table(scancode_xt);
|
||||
|
||||
if (joystick_type != 7)
|
||||
device_add(&gameport_device);
|
||||
|
||||
@@ -855,25 +880,6 @@ machine_olim24_init(const machine_t *model)
|
||||
device_add(&at_nvr_device);
|
||||
|
||||
nmi_init();
|
||||
}
|
||||
|
||||
void machine_olim24_video_init(void) {
|
||||
olim24_t *m24;
|
||||
|
||||
m24 = (olim24_t *)malloc(sizeof(olim24_t));
|
||||
memset(m24, 0x00, sizeof(olim24_t));
|
||||
|
||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_m24);
|
||||
|
||||
/* Initialize the video adapter. */
|
||||
m24->vram = malloc(0x8000);
|
||||
overscan_x = overscan_y = 16;
|
||||
mem_mapping_add(&m24->mapping, 0xb8000, 0x08000,
|
||||
vid_read, NULL, NULL,
|
||||
vid_write, NULL, NULL, NULL, 0, m24);
|
||||
io_sethandler(0x03d0, 16, vid_in, NULL, NULL, vid_out, NULL, NULL, m24);
|
||||
io_sethandler(0x13c6, 1, vid_in, NULL, NULL, vid_out, NULL, NULL, m24);
|
||||
io_sethandler(0x23c6, 1, vid_in, NULL, NULL, vid_out, NULL, NULL, m24);
|
||||
timer_add(vid_poll, &m24->vidtime, TIMER_ALWAYS_ENABLED, m24);
|
||||
device_add_ex(&m24_device, m24);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user