From b0a496446f7b35497eafd02ee6a91c1df8c7c452 Mon Sep 17 00:00:00 2001 From: Peter Schorn Date: Tue, 23 May 2023 21:44:47 +0200 Subject: [PATCH] AltairZ80: Code cleanup and simplifications --- AltairZ80/altairz80_cpu.c | 21 +++++++++-------- AltairZ80/altairz80_sio.c | 47 +++++++++++++-------------------------- AltairZ80/altairz80_sys.c | 3 +-- AltairZ80/i86_decode.c | 4 ++-- AltairZ80/ibc.c | 1 - AltairZ80/m68k/m68kdasm.c | 20 ++++++++--------- AltairZ80/s100_2sio.c | 2 -- AltairZ80/s100_64fdc.c | 1 - AltairZ80/s100_adcs6.c | 1 - AltairZ80/s100_disk1a.c | 1 - AltairZ80/s100_hayes.c | 4 +--- AltairZ80/s100_mdsa.c | 32 +++++++++++++------------- AltairZ80/s100_pmmi.c | 4 +--- AltairZ80/s100_scp300f.c | 1 - AltairZ80/s100_tdd.c | 1 - AltairZ80/s100_vdm1.c | 11 +++------ AltairZ80/sol20.c | 10 ++++----- 17 files changed, 64 insertions(+), 100 deletions(-) diff --git a/AltairZ80/altairz80_cpu.c b/AltairZ80/altairz80_cpu.c index 5e52299b..7b34d476 100644 --- a/AltairZ80/altairz80_cpu.c +++ b/AltairZ80/altairz80_cpu.c @@ -28,7 +28,6 @@ */ #include "m68k/m68k.h" -#include #define SWITCHCPU_DEFAULT 0xfd @@ -2110,7 +2109,7 @@ void PutByteDMA(const uint32 Addr, const uint32 Value) { #define INOUTFLAGS_NONZERO(x) \ INOUTFLAGS((HIGH_REGISTER(BC) & 0xa8) | ((HIGH_REGISTER(BC) == 0) << 6), x) -int32 switch_cpu_now = TRUE; /* hharte */ +int32 switch_cpu_now = TRUE; t_stat sim_instr (void) { t_stat result; @@ -3747,7 +3746,7 @@ static t_stat sim_instr_mmu (void) { break; } } - + INCR(1); adr = HL; switch ((op = GetBYTE(PC)) & 7) { @@ -4878,7 +4877,7 @@ static t_stat sim_instr_mmu (void) { break; } } - + INCR(1); switch (RAM_PP(PC)) { @@ -5593,7 +5592,7 @@ static t_stat sim_instr_mmu (void) { break; } } - + INCR(1); switch (RAM_PP(PC)) { @@ -6520,6 +6519,7 @@ static t_stat cpu_ex(t_value *vptr, t_addr addr, UNIT *uptr, int32 sw) { break; default: + *vptr = 0; // make clear to static checking that a value is assigned in all cases return SCPE_AFAIL; break; } @@ -6914,14 +6914,14 @@ static int32 switchcpu_io(const int32 port, const int32 io, CONST int32 data) { sim_printf("CPU: " ADDRESS_FORMAT " SWITCH(port=%02x) to 8086\n", PCX, port); } new_chiptype = CHIP_TYPE_8086; - switch_cpu_now = FALSE; /* hharte */ + switch_cpu_now = FALSE; break; case CHIP_TYPE_8086: if (cpu_unit.flags & UNIT_CPU_VERBOSE) { sim_printf("CPU: " ADDRESS_FORMAT " SWITCH(port=%02x) to 8085/Z80\n", PCX, port); } new_chiptype = CHIP_TYPE_Z80; - switch_cpu_now = FALSE; /* hharte */ + switch_cpu_now = FALSE; break; default: sim_printf("%s: invalid chiptype: %d\n", __FUNCTION__, chiptype); @@ -7087,8 +7087,8 @@ static t_stat m68k_set_chiptype(UNIT* uptr, int32 value, CONST char* cptr, void* } static t_stat cpu_set_hist(UNIT *uptr, int32 val, CONST char *cptr, void *desc) { - uint32 i, lnt; - t_stat r; + uint32 i, lnt; + t_stat r; if ((chiptype >= 0) && (chiptype != CHIP_TYPE_8080) && (chiptype != CHIP_TYPE_Z80)) { sim_printf("History not supported for chiptype: %s\n", @@ -7425,12 +7425,11 @@ void cpu_raise_interrupt(uint32 irq) { static t_addr disp_addr = 0; static t_stat cpu_cmd_memory(int32 flag, const char *cptr) { - const char *result; char abuf[16]; t_addr lo, hi, last; t_value byte; - if ((result = get_range(NULL, cptr, &lo, &hi, 16, MEMORYMASK, 0)) == NULL) { + if (get_range(NULL, cptr, &lo, &hi, 16, MEMORYMASK, 0) == NULL) { lo = hi = disp_addr; } else { diff --git a/AltairZ80/altairz80_sio.c b/AltairZ80/altairz80_sio.c index 4722792a..6476cf12 100644 --- a/AltairZ80/altairz80_sio.c +++ b/AltairZ80/altairz80_sio.c @@ -49,10 +49,7 @@ to the data port writes the character to the device. */ -#include - #include "altairz80_defs.h" -#include "sim_sock.h" #include "sim_tmxr.h" uint8 *URLContents(const char *URL, uint32 *length); @@ -770,11 +767,6 @@ static int32 sio0sCore(const int32 port, const int32 io, const int32 data) { pollConnection(); if (io == 0) { /* IN */ if (sio_unit.u4) { /* attached to a file? */ - ch = sim_poll_kbd(); /* yes, check for stop condition first */ - if ((ch == SCPE_OK) && stop_cpu) { - sim_interval = 0; /* detect stop condition as soon as possible*/ - return spi.sio_cannot_read | spi.sio_can_write; /* do not consume stop character */ - } if (sio_unit.u3) /* character available? */ return spi.sio_can_read | spi.sio_can_write; ch = getc(sio_unit.fileref); @@ -788,15 +780,12 @@ static int32 sio0sCore(const int32 port, const int32 io, const int32 data) { } } if (sio_unit.flags & UNIT_ATT) { /* attached to a port? */ - ch = sim_poll_kbd(); /* yes, check for stop condition first */ - if ((ch == SCPE_OK) && stop_cpu) { - sim_interval = 0; /* detect stop condition as soon as possible*/ - return spi.sio_cannot_read | spi.sio_can_write; /* do not consume stop character */ - } if (tmxr_rqln(&TerminalLines[spi.terminalLine])) result = spi.sio_can_read; else { result = spi.sio_cannot_read; + if (!sim_signaled_int_char) + sim_poll_kbd(); /* check for WRU when signaling is not available */ checkSleep(); } return result | /* read possible if character available */ @@ -1142,17 +1131,11 @@ static t_stat sio_dev_set_interruptoff(UNIT *uptr, int32 value, CONST char *cptr } static t_stat sio_svc(UNIT *uptr) { - int32 sio_status; int32 ch; const SIO_PORT_INFO spi = lookupPortInfo(kbdIrqPort, &ch); ASSURE(spi.port == kbdIrqPort); - - sio_status = sio0s(kbdIrqPort, 0, 0); - - if (sio_status & spi.sio_can_read) { + if (sio0s(kbdIrqPort, 0, 0) & spi.sio_can_read) keyboardInterrupt = TRUE; - } - if (sio_unit.flags & UNIT_SIO_INTERRUPT) sim_activate(&sio_unit, sio_unit.wait); /* activate unit */ return SCPE_OK; @@ -1483,18 +1466,18 @@ static int32 simh_in(const int32 port) { switch(lastCommand) { case readURLCmd: if (isInReadPhase) { - if (showAvailability) { - if (resultPointer < resultLength) - result = 1; - else { - if (urlResult != NULL) - free(urlResult); - urlResult = NULL; - lastCommand = 0; - } - } else if (resultPointer < resultLength) - result = urlResult[resultPointer++]; - showAvailability = 1 - showAvailability; + if (showAvailability) { + if (resultPointer < resultLength) + result = 1; + else { + if (urlResult != NULL) + free(urlResult); + urlResult = NULL; + lastCommand = 0; + } + } else if (resultPointer < resultLength) + result = urlResult[resultPointer++]; + showAvailability = 1 - showAvailability; } else lastCommand = 0; break; diff --git a/AltairZ80/altairz80_sys.c b/AltairZ80/altairz80_sys.c index 1158b344..d44bd456 100644 --- a/AltairZ80/altairz80_sys.c +++ b/AltairZ80/altairz80_sys.c @@ -30,7 +30,6 @@ */ #include "m68k/m68k.h" -#include #define SIM_EMAX 6 @@ -574,7 +573,7 @@ t_stat fprint_sym(FILE *of, t_addr addr, t_value *val, UNIT *uptr, int32 sw) { default: return SCPE_IERR; - + } fprintf(of, "%s", disasm_result); return 1 - r; diff --git a/AltairZ80/i86_decode.c b/AltairZ80/i86_decode.c index 5a29968b..d82ad576 100644 --- a/AltairZ80/i86_decode.c +++ b/AltairZ80/i86_decode.c @@ -189,7 +189,7 @@ static uint32 getFullPC(void) { return cpu8086.R_IP + (cpu8086.R_CS << 4); } -extern int32 switch_cpu_now; /* hharte */ +extern int32 switch_cpu_now; t_stat sim_instr_8086(void) { t_stat reason = SCPE_OK; @@ -198,7 +198,7 @@ t_stat sim_instr_8086(void) { setCPURegisters(); intr = 0; newIP = PCX_S - 16 * CS_S; - switch_cpu_now = TRUE; /* hharte */ + switch_cpu_now = TRUE; if ((0 <= newIP) && (newIP <= 0xffff)) cpu8086.R_IP = newIP; else { diff --git a/AltairZ80/ibc.c b/AltairZ80/ibc.c index f8f5bc23..091b7c09 100644 --- a/AltairZ80/ibc.c +++ b/AltairZ80/ibc.c @@ -38,7 +38,6 @@ *************************************************************************/ #include "altairz80_defs.h" -#include "sim_defs.h" /* simulator definitions */ #include "wd179x.h" #define DEV_NAME "IBC" diff --git a/AltairZ80/m68k/m68kdasm.c b/AltairZ80/m68k/m68kdasm.c index f7ab7a6e..c42e1c3b 100755 --- a/AltairZ80/m68k/m68kdasm.c +++ b/AltairZ80/m68k/m68kdasm.c @@ -236,15 +236,15 @@ static const char *const g_cc[16] = {"t", "f", "hi", "ls", "cc", "cs", "ne", "eq", "vc", "vs", "pl", "mi", "ge", "lt", "gt", "le"}; static const char *const g_cpcc[64] = -{/* 000 001 010 011 100 101 110 111 */ - "f", "eq", "ogt", "oge", "olt", "ole", "ogl", "or", /* 000 */ - "un", "ueq", "ugt", "uge", "ult", "ule", "ne", "t", /* 001 */ +{/* 000 001 010 011 100 101 110 111 */ + "f", "eq", "ogt", "oge", "olt", "ole", "ogl", "or", /* 000 */ + "un", "ueq", "ugt", "uge", "ult", "ule", "ne", "t", /* 001 */ "sf", "seq", "gt", "ge", "lt", "le", "gl", "gle", /* 010 */ - "ngle", "ngl", "nle", "nlt", "nge", "ngt", "sne", "st", /* 011 */ - "?", "?", "?", "?", "?", "?", "?", "?", /* 100 */ - "?", "?", "?", "?", "?", "?", "?", "?", /* 101 */ - "?", "?", "?", "?", "?", "?", "?", "?", /* 110 */ - "?", "?", "?", "?", "?", "?", "?", "?" /* 111 */ + "ngle", "ngl", "nle", "nlt", "nge", "ngt", "sne", "st", /* 011 */ + "?", "?", "?", "?", "?", "?", "?", "?", /* 100 */ + "?", "?", "?", "?", "?", "?", "?", "?", /* 101 */ + "?", "?", "?", "?", "?", "?", "?", "?", /* 110 */ + "?", "?", "?", "?", "?", "?", "?", "?" /* 111 */ }; static const char *const g_mmuregs[8] = @@ -404,7 +404,7 @@ static char* make_signed_hex_str_32(uint val) /* make string of immediate value */ static char* get_imm_str_s(uint size) { - static char str[15]; + static char str[25]; if(size == 0) sprintf(str, "#%s", make_signed_hex_str_8(read_imm_8())); else if(size == 1) @@ -1840,7 +1840,7 @@ static void d68040_fpu(void) case 0x5: // control to ea { - + strcpy(g_dasm_str, "fmovem.l "); if (w2 & 0x1000) strcat(g_dasm_str, "fpcr"); if (w2 & 0x0800) strcat(g_dasm_str, "/fpsr"); diff --git a/AltairZ80/s100_2sio.c b/AltairZ80/s100_2sio.c index 89cacc1d..0501718e 100644 --- a/AltairZ80/s100_2sio.c +++ b/AltairZ80/s100_2sio.c @@ -87,8 +87,6 @@ * = Active Low */ -#include - #include "altairz80_defs.h" #include "sim_tmxr.h" diff --git a/AltairZ80/s100_64fdc.c b/AltairZ80/s100_64fdc.c index a2a80a12..19cb86da 100644 --- a/AltairZ80/s100_64fdc.c +++ b/AltairZ80/s100_64fdc.c @@ -40,7 +40,6 @@ /*#define DBG_MSG */ #include "altairz80_defs.h" -#include "sim_defs.h" /* simulator definitions */ #include "wd179x.h" #ifdef DBG_MSG diff --git a/AltairZ80/s100_adcs6.c b/AltairZ80/s100_adcs6.c index 6676caa0..104c650d 100644 --- a/AltairZ80/s100_adcs6.c +++ b/AltairZ80/s100_adcs6.c @@ -40,7 +40,6 @@ *************************************************************************/ #include "altairz80_defs.h" -#include "sim_defs.h" /* simulator definitions */ #include "wd179x.h" #define DEV_NAME "ADCS6" diff --git a/AltairZ80/s100_disk1a.c b/AltairZ80/s100_disk1a.c index e91aa14e..3c01af2e 100644 --- a/AltairZ80/s100_disk1a.c +++ b/AltairZ80/s100_disk1a.c @@ -40,7 +40,6 @@ /*#define DBG_MSG */ #include "altairz80_defs.h" -#include "sim_defs.h" /* simulator definitions */ #include "i8272.h" #ifdef DBG_MSG diff --git a/AltairZ80/s100_hayes.c b/AltairZ80/s100_hayes.c index 27c419f9..350e856e 100644 --- a/AltairZ80/s100_hayes.c +++ b/AltairZ80/s100_hayes.c @@ -32,8 +32,6 @@ additional information. */ -#include - #include "altairz80_defs.h" #include "sim_tmxr.h" @@ -499,7 +497,7 @@ static t_stat hayes_config_line(UNIT *uptr) } /* - ** AltairZ80 and TMXR refuse to want to play together + ** AltairZ80 and TMXR refuse to want to play together ** nicely when the CLOCK register is set to anything ** other than 0. ** diff --git a/AltairZ80/s100_mdsa.c b/AltairZ80/s100_mdsa.c index 036b439e..aa4a865c 100644 --- a/AltairZ80/s100_mdsa.c +++ b/AltairZ80/s100_mdsa.c @@ -6,9 +6,9 @@ * * Module Description: * Northstar MDS-A Single Density Disk Controller module for SIMH - * + * * Environment: - * User mode only + * User mode only * *************************************************************************/ @@ -121,7 +121,7 @@ static uint32 stepCleared = TRUE; /* true when step bit has returned to zero * #define MDSA_CMD_BEGIN_WR 1 /* start write */ #define MDSA_CMD_STEP 2 /* load step bit from M0 */ #define MDSA_CMD_INTR 3 /* load interrupt enable from M0 */ -#define MDSA_CMD_NOP 4 +#define MDSA_CMD_NOP 4 #define MDSA_CMD_RESET_SF 5 /* reset sector flag */ #define MDSA_CMD_RESET 6 /* reset controller, raise heads, stop motors */ #define MDSA_CMD_STEP_DIR 7 /* load step direction from M0, 1=in, 0=out */ @@ -199,7 +199,7 @@ DEVICE mdsa_dev = { MDSA_MAX_DRIVES, 10, 31, 1, MDSA_MAX_DRIVES, MDSA_MAX_DRIVES, NULL, NULL, &mdsa_reset, &mdsa_boot, &mdsa_attach, &mdsa_detach, - &mdsa_info_data, (DEV_DISABLE | DEV_DIS | DEV_DEBUG), ERROR_MSG, + &mdsa_info_data, (DEV_DISABLE | DEV_DIS | DEV_DEBUG), ERROR_MSG, mdsa_dt, NULL, NULL, NULL, NULL, NULL, &mdsa_description }; @@ -215,7 +215,7 @@ t_stat mdsa_reset(DEVICE *dptr) /* Connect MDSA at base address */ if(sim_map_resource(pnp->mem_base, pnp->mem_size, RESOURCE_TYPE_MEMORY, &mdsadev, "mdsadev", FALSE) != 0) { - printf("%s: error mapping resource at 0x%04x\n", + sim_printf("%s: error mapping resource at 0x%04x\n", __FUNCTION__, pnp->mem_base); dptr->flags |= DEV_DIS; return SCPE_ARG; @@ -258,7 +258,7 @@ t_stat mdsa_attach(UNIT *uptr, CONST char *cptr) if(uptr->capac > 0) { char *rtn = fgets(header, 4, uptr->fileref); if((rtn != NULL) && (strncmp(header, "CPT", 3) == 0)) { - printf("CPT images not yet supported\n"); + sim_printf("CPT images not yet supported\n"); uptr->u3 = IMAGE_TYPE_CPT; mdsa_detach(uptr); return SCPE_OPENERR; @@ -268,7 +268,7 @@ t_stat mdsa_attach(UNIT *uptr, CONST char *cptr) } if (uptr->flags & UNIT_MDSA_VERBOSE) - printf("MDSA%d, attached to '%s', type=%s, len=%d\n", i, cptr, + sim_printf("MDSA%d, attached to '%s', type=%s, len=%d\n", i, cptr, uptr->u3 == IMAGE_TYPE_CPT ? "CPT" : "DSK", uptr->capac); @@ -351,7 +351,7 @@ static void showdata(int32 isRead) { if(((i+1) & 0xf) == 0) sim_printf("\n\t"); } - sim_printf("\n"); + sim_printf("\n"); } static int checksum; @@ -436,7 +436,7 @@ static uint8 MDSA_Read(const uint32 Addr) if(mdsa_info->datacount == 0) { sim_debug(RD_DATA_MSG, &mdsa_dev, "MDSA: " ADDRESS_FORMAT " READ Start: Drive: %d, Track=%d, Sector=%d\n", - PCX, mdsa_info->currentDrive, pDrive->track, pDrive->sector); + PCX, mdsa_info->currentDrive, pDrive->track, pDrive->sector); checksum = 0; sec_offset = calculate_mdsa_sec_offset(pDrive->track, pDrive->sector); @@ -452,7 +452,7 @@ static uint8 MDSA_Read(const uint32 Addr) case IMAGE_TYPE_DSK: if(pDrive->uptr->fileref == NULL) { sim_printf(".fileref is NULL!\n"); - } + } else { if (sim_fseek((pDrive->uptr)->fileref, sec_offset, SEEK_SET) == 0) { rtn = sim_fread(&sdata.u.data[0], 1, MDSA_SECTOR_LEN, @@ -491,7 +491,7 @@ static uint8 MDSA_Read(const uint32 Addr) DBG_PRINT(("MDSA: " ADDRESS_FORMAT " READ-DATA[offset:%06x+%03x]=%02x\n", PCX, sec_offset, mdsa_info->datacount, cData)); - } + } else { /* checksum */ cData = checksum; sim_debug(RD_DATA_MSG, &mdsa_dev, "MDSA: " ADDRESS_FORMAT @@ -505,7 +505,7 @@ static uint8 MDSA_Read(const uint32 Addr) /* Not a read from disk, process the command field */ else { - switch((Addr & 0x1c) >> 2) { /* switch based on 3-bit command field */ + switch((Addr & 0x1c) >> 2) { /* switch based on 3-bit command field */ case MDSA_CMD_DRIVE: /* select drive in M1, M0 */ driveNum = Addr & 0x03; /* drive number in two lsbits */ if (driveNum == 0) /* force drive numbers to 1-3 */ @@ -514,7 +514,7 @@ static uint8 MDSA_Read(const uint32 Addr) sim_debug(CMD_MSG, &mdsa_dev, "MDSA: " ADDRESS_FORMAT " CMD=Select Drive: Drive=%x\n", PCX, mdsa_info->currentDrive); pDrive = &mdsa_info->drive[mdsa_info->currentDrive]; - mdsa_info->a_status.t0 = (pDrive->track == 0); + mdsa_info->a_status.t0 = (pDrive->track == 0); break; case MDSA_CMD_NOP: @@ -562,7 +562,7 @@ static uint8 MDSA_Read(const uint32 Addr) mdsa_info->stepState = Addr & 0x01; sim_debug(CMD_MSG, &mdsa_dev, "MDSA: " ADDRESS_FORMAT " CMD=Set step flip-flop to %d\n", PCX, mdsa_info->stepState); - + if((mdsa_info->stepState == 1) && stepCleared) { if(mdsa_info->stepDir == 0) { sim_debug(SEEK_MSG, &mdsa_dev, "MDSA: " ADDRESS_FORMAT @@ -570,7 +570,7 @@ static uint8 MDSA_Read(const uint32 Addr) pDrive->track == 0 ? "[Warn: already at 0]" : ""); if(pDrive->track > 0) pDrive->track--; - } + } else { sim_debug(SEEK_MSG, &mdsa_dev, "MDSA: " ADDRESS_FORMAT " Step in from track %d%s\n", PCX, pDrive->track, @@ -612,7 +612,7 @@ static uint8 MDSA_Read(const uint32 Addr) cData |= (mdsa_info->com_status.wi & 1) << 6; cData |= (mdsa_info->com_status.mo & 1) << 4; mdsa_info->b_status.sc = pDrive->sector; - + if (Addr & MDSA_B_STATUS) { /* return B status register */ cData |= (mdsa_info->b_status.sc & 0x0f); sim_debug(STATUS_MSG, &mdsa_dev, "MDSA: " ADDRESS_FORMAT diff --git a/AltairZ80/s100_pmmi.c b/AltairZ80/s100_pmmi.c index 130ee771..d15aeb55 100644 --- a/AltairZ80/s100_pmmi.c +++ b/AltairZ80/s100_pmmi.c @@ -42,8 +42,6 @@ additional information. */ -#include - #include "altairz80_defs.h" #include "sim_tmxr.h" @@ -565,7 +563,7 @@ static t_stat pmmi_config_line(UNIT *uptr) sim_debug(STATUS_MSG, uptr->dptr, "port configuration set to '%s'.\n", config); /* - ** AltairZ80 and TMXR refuse to want to play together + ** AltairZ80 and TMXR refuse to want to play together ** nicely when the CLOCK register is set to anything ** other than 0. ** diff --git a/AltairZ80/s100_scp300f.c b/AltairZ80/s100_scp300f.c index f3f4fd85..be593847 100644 --- a/AltairZ80/s100_scp300f.c +++ b/AltairZ80/s100_scp300f.c @@ -33,7 +33,6 @@ * * *************************************************************************/ -#include #include "altairz80_defs.h" /* Debug flags */ diff --git a/AltairZ80/s100_tdd.c b/AltairZ80/s100_tdd.c index 33f230f0..b1416dba 100644 --- a/AltairZ80/s100_tdd.c +++ b/AltairZ80/s100_tdd.c @@ -40,7 +40,6 @@ *************************************************************************/ #include "altairz80_defs.h" -#include "sim_defs.h" #include "wd179x.h" #define DEV_NAME "TDD" diff --git a/AltairZ80/s100_vdm1.c b/AltairZ80/s100_vdm1.c index 4f85e9bb..89b6d790 100644 --- a/AltairZ80/s100_vdm1.c +++ b/AltairZ80/s100_vdm1.c @@ -402,15 +402,10 @@ static t_stat vdm1_boot(int32 unitno, DEVICE *dptr) } static int32 vdm1_io(const int32 port, const int32 io, const int32 data) { - int32 result = 0xff; - - if (io == 1) { /* OUT */ - if (port == VDM1_DSTAT) { - vdm1_dstat = data & 0xff; - } + if ((io == 1) && (port == VDM1_DSTAT)) { + vdm1_dstat = data & 0xff; } - - return result; + return 0xff; } /* diff --git a/AltairZ80/sol20.c b/AltairZ80/sol20.c index 062fde11..fe0014b8 100644 --- a/AltairZ80/sol20.c +++ b/AltairZ80/sol20.c @@ -1396,15 +1396,15 @@ static t_stat sol20_reset(DEVICE *dptr) if ((vdm1 = find_dev("VDM1")) != NULL) { set_dev_enbdis(vdm1, NULL, 1, NULL); } -#else - sim_messagef(SCPE_NOFNC, "%s device requires VDM1 video support.\n", SOL20_SNAME); - return SCPE_NOFNC; -#endif set_dev_enbdis(&sol20k_dev, NULL, 1, NULL); set_dev_enbdis(&sol20t_dev, NULL, 1, NULL); set_dev_enbdis(&sol20s_dev, NULL, 1, NULL); set_dev_enbdis(&sol20p_dev, NULL, 1, NULL); +#else + sim_messagef(SCPE_NOFNC, "%s device requires VDM1 video support.\n", SOL20_SNAME); + return SCPE_NOFNC; +#endif } if (sim_map_resource(sol20_ctx.rom_base, sol20_ctx.rom_size, RESOURCE_TYPE_MEMORY, &sol20rom, "sol20rom", FALSE) != 0) { @@ -1562,7 +1562,7 @@ static t_stat sol20_svc(UNIT *uptr) sim_activate_after_abs(uptr, uptr->wait); /* reactivate timer */ - return SCPE_OK; + return r; } /*