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:
@@ -45,6 +45,7 @@
|
||||
#include <wchar.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include "../86box.h"
|
||||
#include "../timer.h"
|
||||
#include "../dma.h"
|
||||
#include "../nvr.h"
|
||||
#include "../random.h"
|
||||
@@ -534,6 +535,7 @@ common_get_raw_size(int drive, int side)
|
||||
double size = 100000.0;
|
||||
int mfm;
|
||||
int rm, ssd;
|
||||
uint32_t extra_bc = 0;
|
||||
|
||||
mfm = d86f_is_mfm(drive);
|
||||
rpm = ((d86f_track_flags(drive) & 0xE0) == 0x20) ? 360.0 : 300.0;
|
||||
@@ -541,6 +543,13 @@ common_get_raw_size(int drive, int side)
|
||||
rm = d86f_get_rpm_mode(drive);
|
||||
ssd = d86f_get_speed_shift_dir(drive);
|
||||
|
||||
/* 0% speed shift and shift direction 1: special case where extra bit cells are the entire track size. */
|
||||
if (!rm && ssd)
|
||||
extra_bc = d86f_handler[drive].extra_bit_cells(drive, side);
|
||||
|
||||
if (extra_bc)
|
||||
return extra_bc;
|
||||
|
||||
switch (rm) {
|
||||
case 1:
|
||||
rpm_diff = 1.01;
|
||||
@@ -590,13 +599,9 @@ common_get_raw_size(int drive, int side)
|
||||
|
||||
if (! mfm) rate /= 2.0;
|
||||
|
||||
if (!rm && ssd)
|
||||
size = 0.0;
|
||||
else {
|
||||
size = (size / 250.0) * rate;
|
||||
size = (size * 300.0) / rpm;
|
||||
size *= rpm_diff;
|
||||
}
|
||||
size = (size / 250.0) * rate;
|
||||
size = (size * 300.0) / rpm;
|
||||
size *= rpm_diff;
|
||||
|
||||
/*
|
||||
* Round down to a multiple of 16 and add the extra bit cells,
|
||||
@@ -658,7 +663,7 @@ d86f_register_86f(int drive)
|
||||
|
||||
|
||||
int
|
||||
d86f_get_array_size(int drive, int side)
|
||||
d86f_get_array_size(int drive, int side, int words)
|
||||
{
|
||||
int array_size;
|
||||
int hole, rm;
|
||||
@@ -736,10 +741,14 @@ d86f_get_array_size(int drive, int side)
|
||||
|
||||
array_size <<= 4;
|
||||
array_size += d86f_handler[drive].extra_bit_cells(drive, side);
|
||||
array_size >>= 4;
|
||||
|
||||
if (d86f_handler[drive].extra_bit_cells(drive, side) & 15)
|
||||
array_size++;
|
||||
if (array_size & 15)
|
||||
array_size = (array_size >> 4) + 1;
|
||||
else
|
||||
array_size = (array_size >> 4);
|
||||
|
||||
if (!words)
|
||||
array_size <<= 1;
|
||||
|
||||
return array_size;
|
||||
}
|
||||
@@ -795,37 +804,39 @@ d86f_get_encoding(int drive)
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
uint64_t
|
||||
d86f_byteperiod(int drive)
|
||||
{
|
||||
double dusec = (double) TIMER_USEC;
|
||||
double p = 2.0;
|
||||
|
||||
switch (d86f_track_flags(drive) & 0x0f) {
|
||||
case 0x02: /* 125 kbps, FM */
|
||||
return 4.0;
|
||||
|
||||
p = 4.0;
|
||||
break;
|
||||
case 0x01: /* 150 kbps, FM */
|
||||
return 20.0 / 6.0;
|
||||
|
||||
p = 20.0 / 6.0;
|
||||
break;
|
||||
case 0x0a: /* 250 kbps, MFM */
|
||||
case 0x00: /* 250 kbps, FM */
|
||||
return 2.0;
|
||||
|
||||
case 0x09: /* 300 kbps, MFM */
|
||||
return 10.0 / 6.0;
|
||||
|
||||
case 0x08: /* 500 kbps, MFM */
|
||||
return 1.0;
|
||||
|
||||
case 0x0b: /* 1000 kbps, MFM */
|
||||
return 0.5;
|
||||
|
||||
case 0x0d: /* 2000 kbps, MFM */
|
||||
return 0.25;
|
||||
|
||||
default:
|
||||
p = 2.0;
|
||||
break;
|
||||
case 0x09: /* 300 kbps, MFM */
|
||||
p = 10.0 / 6.0;
|
||||
break;
|
||||
case 0x08: /* 500 kbps, MFM */
|
||||
p = 1.0;
|
||||
break;
|
||||
case 0x0b: /* 1000 kbps, MFM */
|
||||
p = 0.5;
|
||||
break;
|
||||
case 0x0d: /* 2000 kbps, MFM */
|
||||
p = 0.25;
|
||||
break;
|
||||
}
|
||||
|
||||
return 2.0;
|
||||
return (uint64_t) (p * dusec);
|
||||
}
|
||||
|
||||
|
||||
@@ -1592,7 +1603,14 @@ d86f_read_sector_data(int drive, int side)
|
||||
/* We've got a byte. */
|
||||
d86f_log("86F: We've got a byte.\n");
|
||||
if (dev->data_find.bytes_obtained < sector_len) {
|
||||
data = decodefm(drive, dev->last_word[side]);
|
||||
#ifdef HACK_FOR_DBASE_III
|
||||
if ((dev->last_sector.id.c == 39) && (dev->last_sector.id.h == 0) &&
|
||||
(dev->last_sector.id.r == 5) && (dev->data_find.bytes_obtained >= 272)) {
|
||||
pclog("Randomly generating sector 39,0,5 byte %i...\n", dev->data_find.bytes_obtained);
|
||||
data = (random_generate() & 0xff);
|
||||
} else
|
||||
#endif
|
||||
data = decodefm(drive, dev->last_word[side]);
|
||||
if (dev->state == STATE_11_SCAN_DATA) {
|
||||
/* Scan/compare command. */
|
||||
recv_data = d86f_get_data(drive, 0);
|
||||
@@ -2618,7 +2636,11 @@ d86f_prepare_pretrack(int drive, int side, int iso)
|
||||
sync_len = mfm ? 12 : 6;
|
||||
real_gap1_len = mfm ? 50 : 26;
|
||||
gap_fill = mfm ? 0x4E : 0xFF;
|
||||
raw_size = d86f_handler[drive].get_raw_size(drive, side) >> 4;
|
||||
raw_size = d86f_handler[drive].get_raw_size(drive, side);
|
||||
if (raw_size & 15)
|
||||
raw_size = (raw_size >> 4) + 1;
|
||||
else
|
||||
raw_size = (raw_size >> 4);
|
||||
|
||||
dev->index_hole_pos[side] = 0;
|
||||
|
||||
@@ -2694,7 +2716,11 @@ d86f_prepare_sector(int drive, int side, int prev_pos, uint8_t *id_buf, uint8_t
|
||||
mfm = d86f_is_mfm(drive);
|
||||
|
||||
gap_fill = mfm ? 0x4E : 0xFF;
|
||||
raw_size = d86f_handler[drive].get_raw_size(drive, side) >> 4;
|
||||
raw_size = d86f_handler[drive].get_raw_size(drive, side);
|
||||
if (raw_size & 15)
|
||||
raw_size = (raw_size >> 4) + 1;
|
||||
else
|
||||
raw_size = (raw_size >> 4);
|
||||
|
||||
pos = prev_pos;
|
||||
|
||||
@@ -2800,7 +2826,7 @@ d86f_construct_encoded_buffer(int drive, int side)
|
||||
uint16_t *src1_s = dev->thin_track_surface_data[0][side];
|
||||
uint16_t *src2 = dev->thin_track_encoded_data[1][side];
|
||||
uint16_t *src2_s = dev->thin_track_surface_data[1][side];
|
||||
len = d86f_get_array_size(drive, side);
|
||||
len = d86f_get_array_size(drive, side, 1);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
/* The two bits differ. */
|
||||
@@ -2847,7 +2873,7 @@ d86f_decompose_encoded_buffer(int drive, int side)
|
||||
uint16_t *src2 = dev->thin_track_encoded_data[1][side];
|
||||
uint16_t *src2_s = dev->thin_track_surface_data[1][side];
|
||||
dst = d86f_handler[drive].encoded_data(drive, side);
|
||||
len = d86f_get_array_size(drive, side);
|
||||
len = d86f_get_array_size(drive, side, 1);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (d86f_has_surface_desc(drive)) {
|
||||
@@ -2909,7 +2935,7 @@ d86f_read_track(int drive, int track, int thin_track, int side, uint16_t *da, ui
|
||||
fread(&(dev->index_hole_pos[side]), 4, 1, dev->f);
|
||||
} else
|
||||
fseek(dev->f, dev->track_offset[logical_track] + d86f_track_header_size(drive), SEEK_SET);
|
||||
array_size = d86f_get_array_size(drive, side) << 1;
|
||||
array_size = d86f_get_array_size(drive, side, 0);
|
||||
if (d86f_has_surface_desc(drive))
|
||||
fread(sa, 1, array_size, dev->f);
|
||||
fread(da, 1, array_size, dev->f);
|
||||
@@ -2995,6 +3021,7 @@ d86f_seek(int drive, int track)
|
||||
void
|
||||
d86f_write_track(int drive, FILE **f, int side, uint16_t *da0, uint16_t *sa0)
|
||||
{
|
||||
uint32_t array_size = d86f_get_array_size(drive, side, 0);
|
||||
uint16_t side_flags = d86f_handler[drive].side_flags(drive);
|
||||
uint32_t extra_bit_cells = d86f_handler[drive].extra_bit_cells(drive, side);
|
||||
uint32_t index_hole_pos = d86f_handler[drive].index_hole_pos(drive, side);
|
||||
@@ -3007,9 +3034,9 @@ d86f_write_track(int drive, FILE **f, int side, uint16_t *da0, uint16_t *sa0)
|
||||
fwrite(&index_hole_pos, 1, 4, *f);
|
||||
|
||||
if (d86f_has_surface_desc(drive))
|
||||
fwrite(sa0, 1, d86f_get_array_size(drive, side) << 1, *f);
|
||||
fwrite(sa0, 1, array_size, *f);
|
||||
|
||||
fwrite(da0, 1, d86f_get_array_size(drive, side) << 1, *f);
|
||||
fwrite(da0, 1, array_size, *f);
|
||||
}
|
||||
|
||||
|
||||
@@ -3049,7 +3076,7 @@ d86f_write_tracks(int drive, FILE **f, uint32_t *track_table)
|
||||
if (track_table)
|
||||
tbl = track_table;
|
||||
|
||||
if (! fdd_doublestep_40(drive)) {
|
||||
if (!fdd_doublestep_40(drive)) {
|
||||
d86f_decompose_encoded_buffer(drive, 0);
|
||||
if (sides == 2)
|
||||
d86f_decompose_encoded_buffer(drive, 1);
|
||||
@@ -3281,8 +3308,7 @@ d86f_add_track(int drive, int track, int side)
|
||||
uint32_t array_size;
|
||||
int logical_track;
|
||||
|
||||
array_size = d86f_get_array_size(drive, side);
|
||||
array_size <<= 1;
|
||||
array_size = d86f_get_array_size(drive, side, 0);
|
||||
|
||||
if (d86f_get_sides(drive) == 2) {
|
||||
logical_track = (track << 1) + side;
|
||||
@@ -3338,7 +3364,7 @@ d86f_common_format(int drive, int side, int rate, uint8_t fill, int proxy)
|
||||
return;
|
||||
}
|
||||
|
||||
array_size = d86f_get_array_size(drive, side);
|
||||
array_size = d86f_get_array_size(drive, side, 0);
|
||||
|
||||
if (d86f_has_surface_desc(drive)) {
|
||||
/* Preserve the physical holes but get rid of the fuzzy bytes. */
|
||||
@@ -3351,7 +3377,7 @@ d86f_common_format(int drive, int side, int rate, uint8_t fill, int proxy)
|
||||
}
|
||||
|
||||
/* Zero the data buffer. */
|
||||
memset(dev->track_encoded_data[side], 0, array_size << 1);
|
||||
memset(dev->track_encoded_data[side], 0, array_size);
|
||||
|
||||
d86f_add_track(drive, dev->cur_track, side);
|
||||
if (! fdd_doublestep_40(drive))
|
||||
@@ -3727,8 +3753,10 @@ d86f_load(int drive, wchar_t *fn)
|
||||
fread(&(dev->side_flags[0]), 2, 1, dev->f);
|
||||
if (dev->disk_flags & 0x80) {
|
||||
fread(&(dev->extra_bit_cells[0]), 4, 1, dev->f);
|
||||
if (dev->extra_bit_cells[0] < -32768) dev->extra_bit_cells[0] = -32768;
|
||||
if (dev->extra_bit_cells[0] > 32768) dev->extra_bit_cells[0] = 32768;
|
||||
if ((dev->disk_flags & 0x1060) != 0x1000) {
|
||||
if (dev->extra_bit_cells[0] < -32768) dev->extra_bit_cells[0] = -32768;
|
||||
if (dev->extra_bit_cells[0] > 32768) dev->extra_bit_cells[0] = 32768;
|
||||
}
|
||||
} else {
|
||||
dev->extra_bit_cells[0] = 0;
|
||||
}
|
||||
@@ -3738,8 +3766,10 @@ d86f_load(int drive, wchar_t *fn)
|
||||
fread(&(dev->side_flags[1]), 2, 1, dev->f);
|
||||
if (dev->disk_flags & 0x80) {
|
||||
fread(&(dev->extra_bit_cells[1]), 4, 1, dev->f);
|
||||
if (dev->extra_bit_cells[1] < -32768) dev->extra_bit_cells[1] = -32768;
|
||||
if (dev->extra_bit_cells[1] > 32768) dev->extra_bit_cells[1] = 32768;
|
||||
if ((dev->disk_flags & 0x1060) != 0x1000) {
|
||||
if (dev->extra_bit_cells[1] < -32768) dev->extra_bit_cells[1] = -32768;
|
||||
if (dev->extra_bit_cells[1] > 32768) dev->extra_bit_cells[1] = 32768;
|
||||
}
|
||||
} else {
|
||||
dev->extra_bit_cells[0] = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user