Uncompressed sectors from an IMD image now get their actual image buffer passed rather than the temporary buffer, fixes writing to IMD images;

SVGA memory address is now latched with the mask divided by 2 in text mode, fixes OS/2 1.1 crashing the emulator.
This commit is contained in:
OBattler
2016-10-05 15:41:51 +02:00
parent d8c9b7ab76
commit ecd4c8934d
3 changed files with 24 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ LIBS = -mwindows -lwinmm -lopenal.dll -lopenal -lddraw -ldinput8 -ldxguid -ld3d9
86Box.exe: $(OBJ) $(DBOBJ) $(SIDOBJ) $(SLIRPOBJ)
$(CC) $(OBJ) $(DBOBJ) $(SIDOBJ) $(SLIRPOBJ) -o "86Box.exe" $(LIBS)
strip "86Box.exe"
all : 86Box.exe

View File

@@ -580,9 +580,16 @@ void imd_seek(int drive, int track)
id[2] = real_sector;
id[3] = (n == 0xFF) ? n_map[actual_sector] : n;
ssize = 128 << ((uint32_t) id[3]);
data = imd[drive].track_buffer[side] + track_buf_pos[side];
type = imd[drive].buffer[imd[drive].tracks[track][side].sector_data_offs[actual_sector]];
type = (type >> 1) & 7;
if (type & 1)
{
data = &(imd[drive].buffer[imd[drive].tracks[track][side].sector_data_offs[actual_sector] + 1]);
}
else
{
data = imd[drive].track_buffer[side] + track_buf_pos[side];
}
deleted = bad_crc = 0;
if ((type == 2) || (type == 4)) deleted = 1;
if ((type == 3) || (type == 4)) bad_crc = 1;
@@ -607,12 +614,19 @@ void imd_seek(int drive, int track)
ssize = 128 << ((uint32_t) id[3]);
ordered_pos = imd[drive].xdf_ordered_pos[id[2]][side];
data = imd[drive].track_buffer[side] + track_buf_pos[side];
type = imd[drive].buffer[imd[drive].tracks[track][side].sector_data_offs[ordered_pos]];
type = (type >> 1) & 7;
deleted = bad_crc = 0;
if ((type == 2) || (type == 4)) deleted = 1;
if ((type == 3) || (type == 4)) bad_crc = 1;
if (type & 1)
{
data = &(imd[drive].buffer[imd[drive].tracks[track][side].sector_data_offs[ordered_pos] + 1]);
}
else
{
data = imd[drive].track_buffer[side] + track_buf_pos[side];
}
imd_sector_to_buffer(drive, track, side, data, ordered_pos, ssize);
if (is_trackx)

View File

@@ -587,13 +587,18 @@ void svga_recalctimings(svga_t *svga)
extern int cyc_total;
uint32_t svga_mask_addr(uint32_t addr, svga_t *svga)
{
uint32_t limit_shift = 0;
if (!(svga->gdcreg[6] & 1))
{
limit_shift = 1;
}
if (svga->vrammask == (svga->vram_limit - 1))
{
return addr % svga->vram_limit;
return addr % (svga->vram_limit >> limit_shift);
}
else
{
return addr & svga->vrammask;
return addr & (svga->vrammask >> limit_shift);
}
}