From d1968cacbec85ef20345473bbfde1bc0c3693740 Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Thu, 9 Jun 2022 10:31:36 -0400 Subject: [PATCH] SCP: Updated to current. --- sim_console.c | 6 +++++- sim_imd.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/sim_console.c b/sim_console.c index d9b1ca6..3168ccb 100644 --- a/sim_console.c +++ b/sim_console.c @@ -2206,7 +2206,11 @@ return SCPE_OK; t_stat sim_set_cons_speed (int32 flag, CONST char *cptr) { -return tmxr_set_line_speed (&sim_con_ldsc, cptr); +t_stat r = tmxr_set_line_speed (&sim_con_ldsc, cptr); + +if ((r == SCPE_OK) && (sim_con_ldsc.uptr != NULL)) + sim_con_ldsc.uptr->wait = sim_con_ldsc.rxdeltausecs; +return r; } t_stat sim_show_cons_speed (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, CONST char *cptr) diff --git a/sim_imd.c b/sim_imd.c index ebaf64f..b5943ac 100644 --- a/sim_imd.c +++ b/sim_imd.c @@ -119,7 +119,7 @@ static t_stat diskParse(DISK_INFO *myDisk, uint32 isVerbose) uint8 sectorHeadMap[256]; uint8 sectorCylMap[256]; uint32 sectorSize, sectorHeadwithFlags, sectRecordType; - uint32 i; + uint32 hdrBytes, i; uint8 start_sect; uint32 TotalSectorCount = 0; @@ -150,7 +150,13 @@ static t_stat diskParse(DISK_INFO *myDisk, uint32 isVerbose) do { sim_debug(myDisk->debugmask, myDisk->device, "start of track %d at file offset %ld\n", myDisk->ntracks, ftell(myDisk->file)); - if (sim_fread(&imd, 1, 5, myDisk->file) != 5) { + hdrBytes = sim_fread(&imd, 1, 5, myDisk->file); + + if ((hdrBytes == 0) && feof(myDisk->file)) + break; /* detected end of IMD file */ + + if (hdrBytes != 5) { + sim_printf("SIM_IMD: Header read returned %d bytes instead of 5.\n", hdrBytes); return (SCPE_OPENERR); }