Rewritten parts of the 86F handler to minimize false CRC errors and misidentification of sectors;

Replaced IMG handler with one that now proxies to the 86F handler;
Applies the remaining Mainline PCem speedup commit;
Fixed the National Semiconductors PC87306 Super I/O Chip's serial port IRQ assignment;
DMF images are now loaded with the correct sector interleave, improving read/write speed;
XDF images are now loaded in a way that emulates the real order of the sectors on the track, improving read/write speed;
Added 16-bit physical memory read/write routines (mem_phys_readw, mem_phys_writew) and modified the 16-bit DMA code to use them instead of two 8-bit reads/writes.
This commit is contained in:
OBattler
2016-09-22 21:22:56 +02:00
parent 0ae428b5f5
commit 6318e2bb17
24 changed files with 1688 additions and 513 deletions

View File

@@ -246,12 +246,23 @@ uint8_t _dma_read(uint32_t addr)
return mem_readb_phys(addr);
}
uint16_t _dma_readw(uint32_t addr)
{
return mem_readw_phys(addr);
}
void _dma_write(uint32_t addr, uint8_t val)
{
mem_writeb_phys(addr, val);
mem_invalidate_range(addr, addr);
}
void _dma_writew(uint32_t addr, uint16_t val)
{
mem_writew_phys(addr, val);
mem_invalidate_range(addr, addr + 1);
}
int dma_channel_read(int channel)
{
uint16_t temp;
@@ -300,8 +311,12 @@ int dma_channel_read(int channel)
if ((dma16.mode[channel] & 0xC) != 8)
return DMA_NODATA;
#if 0
temp = _dma_read((dma16.ac[channel] << 1) + ((dma16.page[channel] & ~1) << 16)) |
(_dma_read((dma16.ac[channel] << 1) + ((dma16.page[channel] & ~1) << 16) + 1) << 8);
#endif
temp = _dma_readw((dma16.ac[channel] << 1) + ((dma16.page[channel] & ~1) << 16));
if (dma16.mode[channel] & 0x20) dma16.ac[channel]--;
else dma16.ac[channel]++;
@@ -325,6 +340,18 @@ int dma_channel_read(int channel)
}
}
void dma_channel_dump()
{
int i = 0;
FILE *f;
f = fopen("dma.dmp", "wb");
for (i = 0; i < (21 * 512); i++)
{
fputc(mem_readb_phys((dma.page[2] << 16) + dma16.ac[2] + i), f);
}
fclose(f);
}
int dma_channel_write(int channel, uint16_t val)
{
if (dma.command & 0x04)
@@ -368,8 +395,12 @@ int dma_channel_write(int channel, uint16_t val)
if ((dma16.mode[channel] & 0xC) != 4)
return DMA_NODATA;
#if 0
_dma_write((dma16.ac[channel] << 1) + ((dma16.page[channel] & ~1) << 16), val);
_dma_write((dma16.ac[channel] << 1) + ((dma16.page[channel] & ~1) << 16) + 1, val >> 8);
#endif
_dma_writew((dma16.ac[channel] << 1) + ((dma16.page[channel] & ~1) << 16), val);
if (dma16.mode[channel]&0x20) dma16.ac[channel]--;
else dma16.ac[channel]++;