Fixed the third batch of problems.

This commit is contained in:
OBattler
2020-01-15 04:58:28 +01:00
parent af023ff5dd
commit 932ad5595a
39 changed files with 127 additions and 80 deletions

View File

@@ -133,7 +133,7 @@ extern int serial_do_log;
extern int nic_do_log;
#endif
extern wchar_t exe_path[1024]; /* path (dir) of executable */
extern wchar_t exe_path[2048]; /* path (dir) of executable */
extern wchar_t usr_path[1024]; /* path (dir) of user data */
extern wchar_t cfg_path[1024]; /* full path of config file */
#ifndef USE_NEW_DYNAREC

View File

@@ -565,7 +565,7 @@ neat_write(uint16_t port, uint8_t val, void *priv)
case REG_RB7:
val &= RB7_MASK;
*reg = (*reg & ~RB7_MASK) | val;
*reg = val;
#if NEAT_DEBUG > 1
neat_log("NEAT: RB7=%02x(%02x)\n", val, *reg);
#endif

View File

@@ -339,7 +339,7 @@ config_read(wchar_t *fn)
/* Allocate a new variable entry.. */
ne = malloc(sizeof(entry_t));
memset(ne, 0x00, sizeof(entry_t));
strncpy(ne->name, ename, sizeof(ne->name));
strncpy(ne->name, ename, sizeof(ne->name) - 1);
wcsncpy(ne->wdata, &buff[d], sizeof_w(ne->wdata)-1);
ne->wdata[sizeof_w(ne->wdata)-1] = L'\0';
wcstombs(ne->data, ne->wdata, sizeof(ne->data));
@@ -395,7 +395,7 @@ config_write(wchar_t *fn)
ent = (entry_t *)sec->entry_head.next;
while (ent != NULL) {
if (ent->name[0] != '\0') {
mbstowcs(wtemp, ent->name, sizeof_w(wtemp));
mbstowcs(wtemp, ent->name, 128);
if (ent->wdata[0] == L'\0')
fwprintf(f, L"%ls = \n", wtemp);
else
@@ -1708,7 +1708,7 @@ static void
save_hard_disks(void)
{
char *cat = "Hard disks";
char temp[32], tmp2[256];
char temp[32], tmp2[512];
char *p;
int c;
@@ -2167,7 +2167,7 @@ config_set_mac(char *head, char *name, int val)
sprintf(ent->data, "%02x:%02x:%02x",
(val>>16)&0xff, (val>>8)&0xff, val&0xff);
mbstowcs(ent->wdata, ent->data, sizeof_w(ent->wdata));
mbstowcs(ent->wdata, ent->data, 512);
}

View File

@@ -765,6 +765,7 @@ void loadcsjmp(uint16_t seg, uint32_t old_pc)
x86gpf(NULL,seg2&~3);
return;
}
/*FALLTHROUGH*/
case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/
CS=seg2;
do_seg_load(&cpu_state.seg_cs, segdat);
@@ -1235,6 +1236,7 @@ void loadcscall(uint16_t seg)
x86gpf(NULL,seg2&~3);
return;
}
/*FALLTHROUGH*/
case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/
CS=seg2;
do_seg_load(&cpu_state.seg_cs, segdat);
@@ -1766,6 +1768,7 @@ void pmodeint(int num, int soft)
x86gpf(NULL,seg&~3);
return;
}
/*FALLTHROUGH*/
case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/
if (!(segdat2[2]&0x8000))
{

View File

@@ -761,6 +761,7 @@ void loadcsjmp(uint16_t seg, uint32_t old_pc)
x86gpf(NULL,seg2&~3);
return;
}
/*FALLTHROUGH*/
case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/
CS=seg2;
do_seg_load(&cpu_state.seg_cs, segdat);
@@ -1228,6 +1229,7 @@ void loadcscall(uint16_t seg, uint32_t old_pc)
x86gpf(NULL,seg2&~3);
return;
}
/*FALLTHROUGH*/
case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/
CS=seg2;
do_seg_load(&cpu_state.seg_cs, segdat);
@@ -1762,6 +1764,7 @@ void pmodeint(int num, int soft)
x86gpf(NULL,seg&~3);
return;
}
/*FALLTHROUGH*/
case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/
if (!(segdat2[2]&0x8000))
{

View File

@@ -304,6 +304,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
esdi->command &= ~0x03;
if (val & 0x02)
fatal("Read with ECC\n");
/*FALLTHROUGH*/
case 0xa0:
esdi->status = STAT_BUSY;
@@ -351,6 +352,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
default:
esdi_at_log("WD1007: bad command %02X\n", val);
/*FALLTHROUGH*/
case 0xe8: /*???*/
esdi->status = STAT_BUSY;
timer_set_delay_u64(&esdi->callback_timer, 200 * HDC_TIME);

View File

@@ -757,6 +757,7 @@ ide_set_features(ide_t *ide)
default:
return 0;
}
break;
case FEATURE_ENABLE_IRQ_OVERLAPPED:
case FEATURE_ENABLE_IRQ_SERVICE:

View File

@@ -133,7 +133,8 @@ image_is_hdx(const wchar_t *s, int check_signature)
fclose(f);
return 0;
}
fread(&signature, 1, 8, f);
if (fread(&signature, 1, 8, f) != 8)
fatal("image_is_hdx(): Error reading signature\n");
fclose(f);
if (signature == 0xD778A82044445459ll)
return 1;
@@ -175,7 +176,8 @@ image_is_vhd(const wchar_t *s, int check_signature)
fclose(f);
return 0;
}
fread(&signature, 1, 8, f);
if (fread(&signature, 1, 8, f) != 8)
fatal("image_is_vhd(): Error reading signature\n");
fclose(f);
if (signature == 0x78697463656E6F63ll)
return 1;
@@ -770,7 +772,8 @@ hdd_image_seek(uint8_t id, uint32_t sector)
addr = (uint64_t)sector << 9LL;
hdd_images[id].pos = sector;
fseeko64(hdd_images[id].file, addr + hdd_images[id].base, SEEK_SET);
if (fseeko64(hdd_images[id].file, addr + hdd_images[id].base, SEEK_SET) == -1)
fatal("hdd_image_seek(): Error seeking\n");
}

View File

@@ -994,6 +994,7 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
case 0x16: /* Verify */
if (fdc->params[0] & 0x80)
fdc->sc = fdc->params[7];
/*FALLTHROUGH*/
case 0x06: /* Read data */
case 0x0c: /* Read deleted data */
fdc_io_command_phase1(fdc, 0);

View File

@@ -491,7 +491,8 @@ fdd_load(int drive, wchar_t *fn)
f = plat_fopen(fn, L"rb");
if (!f)
return;
fseek(f, -1, SEEK_END);
if (fseek(f, -1, SEEK_END) == -1)
fatal("fdd_load(): Error seeking to the end of the file\n");
size = ftell(f) + 1;
fclose(f);
while (loaders[c].ext) {

View File

@@ -1174,15 +1174,8 @@ d86f_put_bit(int drive, int side, int bit)
if (d86f_has_surface_desc(drive)) {
surface_bit = (surface_data >> track_bit) & 1;
if (! surface_bit) {
if (! current_bit) {
/* Bit is 0 and is not set to fuzzy, we overwrite it as is. */
dev->last_word[side] |= bit;
current_bit = bit;
} else {
/* Bit is 1 and is not set to fuzzy, we overwrite it as is. */
dev->last_word[side] |= bit;
current_bit = bit;
}
dev->last_word[side] |= bit;
current_bit = bit;
} else {
if (current_bit) {
/* Bit is 1 and is set to fuzzy, we overwrite it with a non-fuzzy bit. */
@@ -2949,10 +2942,13 @@ d86f_read_track(int drive, int track, int thin_track, int side, uint16_t *da, ui
if (dev->track_offset[logical_track]) {
if (! thin_track) {
fseek(dev->f, dev->track_offset[logical_track], SEEK_SET);
fread(&(dev->side_flags[side]), 2, 1, dev->f);
if (fseek(dev->f, dev->track_offset[logical_track], SEEK_SET) == -1)
fatal("d86f_read_track(): Error seeking to offset dev->track_offset[logical_track]\n");
if (fread(&(dev->side_flags[side]), 1, 2, dev->f) != 2)
fatal("d86f_read_track(): Error reading side flags\n");
if (d86f_has_extra_bit_cells(drive)) {
fread(&(dev->extra_bit_cells[side]), 4, 1, dev->f);
if (fread(&(dev->extra_bit_cells[side]), 1, 4, dev->f) != 4)
fatal("d86f_read_track(): Error reading number of extra bit cells\n");
/* If RPM shift is 0% and direction is 1, do not adjust extra bit cells,
as that is the whole track length. */
if (d86f_get_rpm_mode(drive) || !d86f_get_speed_shift_dir(drive)) {
@@ -3146,7 +3142,8 @@ d86f_write_tracks(int drive, FILE **f, uint32_t *track_table)
}
if (tbl[logical_track]) {
fseek(*f, tbl[logical_track], SEEK_SET);
if (fseek(*f, tbl[logical_track], SEEK_SET) == -1)
fatal("d86f_write_tracks(): Error seeking to offset tbl[logical_track]\n");
d86f_write_track(drive, f, side, d86f_handler[drive].encoded_data(drive, side), dev->track_surface_data[side]);
}
}

View File

@@ -331,7 +331,6 @@ fdi_load(int drive, wchar_t *fn)
dev = (fdi_t *)malloc(sizeof(fdi_t));
memset(dev, 0x00, sizeof(fdi_t));
dev->f = plat_fopen(fn, L"rb");
if (dev == NULL) {
free(dev);
memset(floppyfns[drive], 0, sizeof(floppyfns[drive]));
@@ -340,8 +339,11 @@ fdi_load(int drive, wchar_t *fn)
d86f_unregister(drive);
fread(header, 1, 25, dev->f);
fseek(dev->f, 0, SEEK_SET);
dev->f = plat_fopen(fn, L"rb");
if (fread(header, 1, 25, dev->f) != 25)
fatal("fdi_load(): Error reading header\n");
if (fseek(dev->f, 0, SEEK_SET) == -1)
fatal("fdi_load(): Error seeking to the beginning of the file\n");
header[25] = 0;
if (strcmp(header, "Formatted Disk Image file") != 0) {
/* This is a Japanese FDI file. */

View File

@@ -629,6 +629,7 @@ imd_load(int drive, wchar_t *fn)
dev->f = plat_fopen(fn, L"rb");
if (dev->f == NULL) {
memset(floppyfns[drive], 0, sizeof(floppyfns[drive]));
free(dev);
return;
}
writeprot[drive] = 1;
@@ -654,6 +655,13 @@ imd_load(int drive, wchar_t *fn)
if (fseek(dev->f, 0, SEEK_END) == -1)
fatal("imd_load(): Error seeking to the end of the file\n");
fsize = ftell(dev->f);
if (fsize <= 0) {
imd_log("IMD: Too small ImageDisk image\n");
fclose(dev->f);
free(dev);
memset(floppyfns[drive], 0, sizeof(floppyfns[drive]));
return;
}
if (fseek(dev->f, 0, SEEK_SET) == -1)
fatal("imd_load(): Error seeking to the beginning of the file again\n");
dev->buffer = malloc(fsize);
@@ -661,7 +669,7 @@ imd_load(int drive, wchar_t *fn)
fatal("imd_load(): Error reading data\n");
buffer = dev->buffer;
buffer2 = strchr(buffer, 0x1A);
buffer2 = memchr(buffer, 0x1A, fsize);
if (buffer2 == NULL) {
imd_log("IMD: No ASCII EOF character\n");
fclose(dev->f);

View File

@@ -358,8 +358,9 @@ mfm_read_side(int drive, int side)
else
ret = fseek(dev->f, dev->tracks[track_index].track_offset, SEEK_SET);
if (ret == -1)
fatal("MFM: Error seeking in mfm_read_side()\n");
fread(dev->track_data[side], 1, track_bytes, dev->f);
fatal("mfm_read_side(): Error seeking to the beginning of the file\n");
if (fread(dev->track_data[side], 1, track_bytes, dev->f) != track_bytes)
fatal("mfm_read_side(): Error reading track bytes\n");
}
mfm_log("drive = %i, side = %i, dev->cur_track = %i, track_index = %i, track_size = %i\n",

View File

@@ -231,8 +231,10 @@ fdd_image_read(int drive, char *buffer, uint32_t offset, uint32_t len)
{
td0_t *dev = td0[drive];
fseek(dev->f, offset, SEEK_SET);
fread(buffer, 1, len, dev->f);
if (fseek(dev->f, offset, SEEK_SET) == -1)
fatal("fdd_image_read(): Error seeking to the beginning of the file\n");
if (fread(buffer, 1, len, dev->f) != len)
fatal("fdd_image_read(): Error reading data\n");
}

View File

@@ -2039,9 +2039,12 @@ FDI *fdi2raw_header(FILE *f)
fdi_free(fdi);
return NULL;
}
fseek (fdi->file, 0, SEEK_SET);
fread (fdi->header, 2048, 1, fdi->file);
fseek (fdi->file, oldseek, SEEK_SET);
if (fseek (fdi->file, 0, SEEK_SET) == -1)
fatal("fdi2raw_header(): Error seeking to the beginning of the file\n");
if (fread (fdi->header, 1, 2048, fdi->file) != 2048)
fatal("fdi2raw_header(): Error reading header\n");
if (fseek (fdi->file, oldseek, SEEK_SET) == -1)
fatal("fdi2raw_header(): Error seeking to offset oldseek\n");
if (memcmp (fdiid, fdi->header, strlen ((char *)fdiid)) ) {
fdi_free(fdi);
return NULL;

View File

@@ -581,6 +581,9 @@ void t3100e_ems_out(uint16_t addr, uint8_t val, void *p)
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)p;
int pg = port_to_page(addr);
if (pg == -1)
return;
regs->page_exec[pg & 3] = t3100e_ems_execaddr(regs, pg, val);
t3100e_log("EMS: page %d %02x -> %02x [%06x]\n",
pg, regs->page[pg], val, regs->page_exec[pg & 3]);

View File

@@ -882,7 +882,8 @@ machine_xt_t1000_init(const machine_t *model)
if (f != NULL) {
t1000.romdrive = malloc(T1000_ROMSIZE);
if (t1000.romdrive) {
memset(t1000.romdrive, 0xff, T1000_ROMSIZE);
memset(t1000.romdrive, 0xff, T1000_ROMSIZE);
if (fread(t1000.romdrive, 1, T1000_ROMSIZE, f) != T1000_ROMSIZE)
fatal("machine_xt_t1000_init(): Error reading DOS ROM data\n");
}
fclose(f);
@@ -1016,11 +1017,14 @@ static void
static void
t1000_configsys_load(void)
{
FILE *f;
int size;
memset(t1000.t1000_nvram, 0x1a, sizeof(t1000.t1000_nvram));
f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"rb");
if (f != NULL) {
if (f != NULL) {
size = sizeof(t1000.t1000_nvram);
if (fread(t1000.t1000_nvram, size, 1, f) != size)
fatal("t1000_configsys_load(): Error reading data\n");
fclose(f);
}
@@ -1030,10 +1034,13 @@ static void
static void
t1000_configsys_save(void)
{
FILE *f;
int size;
f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"wb");
if (f != NULL) {
if (f != NULL) {
size = sizeof(t1000.t1000_nvram);
if (fwrite(t1000.t1000_nvram, 1, size, f) != size)
fatal("t1000_configsys_save(): Error writing data\n");
fclose(f);
}
@@ -1043,11 +1050,14 @@ static void
static void
t1200_state_load(void)
{
FILE *f;
int size;
memset(t1000.t1200_nvram, 0, sizeof(t1000.t1200_nvram));
f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"rb");
if (f != NULL) {
if (f != NULL) {
size = sizeof(t1000.t1200_nvram);
if (fread(t1000.t1200_nvram, 1, size, f) != size)
fatal("t1200_state_load(): Error reading data\n");
fclose(f);
}
@@ -1057,10 +1067,13 @@ static void
static void
t1200_state_save(void)
{
FILE *f;
int size;
f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"wb");
if (f != NULL) {
if (f != NULL) {
size = sizeof(t1000.t1200_nvram);
if (fwrite(t1000.t1200_nvram, 1, size, f) != size)
fatal("t1200_state_save(): Error writing data\n");
fclose(f);
}

View File

@@ -623,6 +623,7 @@ ltsermouse_write(struct serial_s *serial, void *priv, uint8_t data)
switch (data) {
default:
mouse_serial_log("Serial mouse: Invalid period %02X, using 1200 bps\n", data);
/*FALLTHROUGH*/
case 0x6E:
dev->transmit_period = sermouse_transmit_period(dev, 1200, -1);
break;

View File

@@ -264,7 +264,8 @@ nvr_load(void)
fp = plat_fopen(path, L"rb");
if (fp != NULL) {
/* Read NVR contents from file. */
(void)fread(saved_nvr->regs, saved_nvr->size, 1, fp);
if (fread(saved_nvr->regs, 1, saved_nvr->size, fp) != saved_nvr->size)
fatal("nvr_load(): Error reading data\n");
(void)fclose(fp);
}
}

View File

@@ -150,8 +150,6 @@ ps2_nvr_close(void *priv)
fclose(f);
}
free(nvr->ram);
free(nvr);
}

View File

@@ -149,7 +149,7 @@ int output;
int atfullspeed;
int clockrate;
wchar_t exe_path[1024]; /* path (dir) of executable */
wchar_t exe_path[2048]; /* path (dir) of executable */
wchar_t usr_path[1024]; /* path (dir) of user data */
wchar_t cfg_path[1024]; /* full path of config file */
FILE *stdlog = NULL; /* file to log output to */
@@ -554,8 +554,8 @@ pc_init_modules(void)
/* Load the ROMs for the selected machine. */
if (! machine_available(machine)) {
c = 0;
machine = -1;
while (machine_get_internal_name_ex(c) != NULL) {
machine = -1;
if (machine_available(c)) {
ui_msgbox(MBX_INFO, (wchar_t *)IDS_2063);
machine = c;

View File

@@ -410,15 +410,17 @@ static void
new_page(escp_t *dev, int8_t save, int8_t resetx)
{
/* Dump the current page if needed. */
if (save)
if (save && dev->page)
dump_page(dev);
if (resetx)
dev->curr_x = dev->left_margin;
/* Clear page. */
dev->curr_y = dev->top_margin;
dev->page->dirty = 0;
memset(dev->page->pixels, 0x00, dev->page->pitch * dev->page->h);
if (dev->page) {
dev->page->dirty = 0;
memset(dev->page->pixels, 0x00, dev->page->pitch * dev->page->h);
}
/* Make the page's file name. */
plat_tempfile(dev->page_fn, NULL, L".png");

View File

@@ -729,7 +729,8 @@ aha_setnvr(x54x_t *dev)
f = nvr_fopen(dev->nvr_path, L"rb");
if (f) {
fread(dev->nvr, 1, NVR_SIZE, f);
if (fread(dev->nvr, 1, NVR_SIZE, f) != NVR_SIZE)
fatal("aha_setnvr(): Error reading data\n");
fclose(f);
f = NULL;
} else

View File

@@ -410,7 +410,8 @@ BuslogicInitializeAutoSCSIRam(x54x_t *dev)
f = nvr_fopen(BuslogicGetNVRFileName(bl), L"rb");
if (f)
{
fread(&(bl->LocalRAM.structured.autoSCSIData), 1, 64, f);
if (fread(&(bl->LocalRAM.structured.autoSCSIData), 1, 64, f) != 64)
fatal("BuslogicInitializeAutoSCSIRam(): Error reading data\n");
fclose(f);
f = NULL;
if (bl->chip == CHIP_BUSLOGIC_PCI) {
@@ -1229,6 +1230,7 @@ BuslogicPCIWrite(int func, int addr, uint8_t val, void *p)
case 0x10:
val &= 0xe0;
val |= 1;
/*FALLTHROUGH*/
case 0x11: case 0x12: case 0x13:
/* I/O Base set. */

View File

@@ -155,7 +155,8 @@ scsi_disk_mode_sense_load(scsi_disk_t *dev)
swprintf(file_name, 512, L"scsi_disk_%02i_mode_sense.bin", dev->id);
f = plat_fopen(nvr_path(file_name), L"rb");
if (f) {
fread(dev->ms_pages_saved.pages[0x30], 1, 0x18, f);
if (fread(dev->ms_pages_saved.pages[0x30], 1, 0x18, f) != 0x18)
fatal("scsi_disk_mode_sense_load(): Error reading data\n");
fclose(f);
}
}

View File

@@ -1096,14 +1096,6 @@ x54x_req_setup(x54x_t *dev, uint32_t CCBPointer, Mailbox32_t *Mailbox32)
return;
}
if (req->CmdBlock.common.ControlByte > 0x03) {
x54x_log("Invalid control byte: %02X\n",
req->CmdBlock.common.ControlByte);
x54x_mbi_setup(dev, CCBPointer, &req->CmdBlock, CCB_INVALID_DIRECTION, SCSI_STATUS_OK, MBI_ERROR);
dev->callback_sub_phase = 4;
return;
}
dev->callback_sub_phase = 1;
}
}

View File

@@ -384,7 +384,7 @@ void adgold_write(uint16_t addr, uint8_t val, void *p)
adgold->adgold_mma_regs[0][adgold->adgold_mma_addr] = val;
break;
case 7:
if (adgold->adgold_mma_addr >= 0xf) break;
if (adgold->adgold_mma_addr >= 0xe) break;
switch (adgold->adgold_mma_addr)
{
case 0x9:
@@ -503,8 +503,10 @@ uint8_t adgold_read(uint16_t addr, void *p)
}
break;
case 7:
if (adgold->adgold_mma_addr >= 0xf) temp = 0xff;
temp = adgold->adgold_mma_regs[1][adgold->adgold_mma_addr];
if (adgold->adgold_mma_addr >= 0xf)
temp = 0xff;
else
temp = adgold->adgold_mma_regs[1][adgold->adgold_mma_addr];
break;
}
return temp;

View File

@@ -2143,7 +2143,8 @@ void emu8k_init(emu8k_t *emu8k, uint16_t emu_addr, int onboard_ram)
fatal("AWE32.RAW not found\n");
emu8k->rom = malloc(1024 * 1024);
fread(emu8k->rom, 1024 * 1024, 1, f);
if (fread(emu8k->rom, 1, 1048576, f) != 1048576)
fatal("emu8k_init(): Error reading data\n");
fclose(f);
/*AWE-DUMP creates ROM images offset by 2 bytes, so if we detect this
then correct it*/

View File

@@ -668,6 +668,7 @@ static void mach64_accel_write_fifo(mach64_t *mach64, uint32_t addr, uint8_t val
case 0x118: case 0x119: case 0x11a: case 0x11b:
case 0x11e: case 0x11f:
WRITE8(addr, mach64->dst_height_width, val);
/*FALLTHROUGH*/
case 0x113:
if (((addr & 0x3ff) == 0x11b || (addr & 0x3ff) == 0x11f ||
(addr & 0x3ff) == 0x113) && !(val & 0x80))
@@ -797,6 +798,7 @@ static void mach64_accel_write_fifo(mach64_t *mach64, uint32_t addr, uint8_t val
break;
case 0x2b0: case 0x2b1:
addr += 2;
/*FALLTHROUGH*/
case 0x2b6: case 0x2b7:
WRITE8(addr, mach64->sc_top_bottom, val);
break;
@@ -1886,6 +1888,7 @@ uint8_t mach64_ext_readb(uint32_t addr, void *p)
break;
case 0x110: case 0x111:
addr += 2;
/*FALLTHROUGH*/
case 0x114: case 0x115:
case 0x118: case 0x119: case 0x11a: case 0x11b:
case 0x11e: case 0x11f:
@@ -2005,6 +2008,7 @@ uint8_t mach64_ext_readb(uint32_t addr, void *p)
break;
case 0x2b0: case 0x2b1:
addr += 2;
/*FALLTHROUGH*/
case 0x2b6: case 0x2b7:
mach64_wait_fifo_idle(mach64);
READ8(addr, mach64->sc_top_bottom);

View File

@@ -1249,7 +1249,7 @@ void et4000w32p_pci_write(int func, int addr, uint8_t val, void *p)
et4000->linearbase &= 0x00c00000;
et4000->linearbase = (et4000->pci_regs[0x13] << 24);
svga->crtc[0x30] &= 3;
svga->crtc[0x30] = ((et4000->linearbase & 0x3f000000) >> 22);
svga->crtc[0x30] |= ((et4000->linearbase & 0x3f000000) >> 22);
et4000w32p_recalcmapping(et4000);
break;

View File

@@ -112,7 +112,8 @@ static const char *pgc_err_msgs[] = {
"Stack \r",
"Too long\r",
"Area \r",
"Missing \r"
"Missing \r",
"Unknown \r"
};

View File

@@ -2076,15 +2076,9 @@ uint8_t s3_accel_in(uint16_t port, void *p)
break;
temp = s3->accel.pix_trans[1];
if ((s3->accel.multifunc[0xa] & 0xc0) == 0x80 && (s3->accel.cmd & 0x600) == 0x200 && (s3->accel.cmd & 0x100))
{
if (s3->accel.cmd & 0x1000) s3_accel_start(16, 1, 0xffffffff, 0, s3);
else s3_accel_start(16, 1, 0xffffffff, 0, s3);
}
s3_accel_start(16, 1, 0xffffffff, 0, s3);
else if ((s3->accel.cmd & 0x600) == 0x200 && (s3->accel.cmd & 0x100))
{
if (s3->accel.cmd & 0x1000) s3_accel_start(2, 1, 0xffffffff, 0xffffffff, s3);
else s3_accel_start(2, 1, 0xffffffff, 0xffffffff, s3);
}
s3_accel_start(2, 1, 0xffffffff, 0xffffffff, s3);
return temp;
case 0xe14a: case 0xe2ea:
if (!s3_cpu_dest(s3))

View File

@@ -383,6 +383,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
if (source_hwnd)
PostMessage((HWND) (uintptr_t) source_hwnd, WM_HAS_SHUTDOWN, (WPARAM) 0, (LPARAM) hwndMain);
free(argw);
return(1);
}
@@ -393,6 +394,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
/* Handle our GUI. */
i = ui_init(nCmdShow);
free(argw);
return(i);
}

View File

@@ -88,8 +88,8 @@ extern HICON hIcon[256];
// extern int status_is_open;
extern char openfilestring[260];
extern WCHAR wopenfilestring[260];
extern char openfilestring[512];
extern WCHAR wopenfilestring[512];
extern uint8_t filterindex;

View File

@@ -34,8 +34,8 @@
#include "win.h"
WCHAR wopenfilestring[260];
char openfilestring[260];
WCHAR wopenfilestring[512];
char openfilestring[512];
uint8_t filterindex = 0;

View File

@@ -608,6 +608,7 @@ NewFloppyDialogProcedure(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
new_floppy_msgbox(hdlg, MBX_ERROR, (wchar_t *)IDS_4108);
return TRUE;
}
/*FALLTHROUGH*/
case IDCANCEL:
EndDialog(hdlg, 0);
plat_pause(0);

View File

@@ -2924,8 +2924,9 @@ hdd_add_file_open_error:
chs_enabled = 1;
no_update = 0;
} else
fclose(f);
}
fclose(f);
}
h = GetDlgItem(hdlg, IDC_EDIT_HD_FILE_NAME);

View File

@@ -59,8 +59,8 @@ int infocus = 1;
int rctrl_is_lalt = 0;
int user_resize = 0;
char openfilestring[260];
WCHAR wopenfilestring[260];
char openfilestring[512];
WCHAR wopenfilestring[512];
/* Local data. */