SCP Local Fixes =============== INCORPORATED FIXES ------------------ The following modifications to the SCP framework are maintained locally: 1. PROBLEM: Detach of unattached unit succeeds without warning. VERSION: 3.6-1 OBSERVATION: Currently, detaching a unit that is not attached succeeds quietly. It would be helpful if it printed a warning ("Unit not attached") for this condition. Note that the RESTORE command unconditionally calls "scp_detach_unit" if a unit is to be attached as part of the restoration. Returning SCPE_UNATT would terminate the restoration, so this case must be detected and SCPE_OK returned unconditionally. RESOLUTION: Modify "detach_unit" (scp.c) to return SCPE_UNATT if the unit is not attached, except when restoring a saved session. STATUS: Local patch created 2006-08-30. 2. PROBLEM: The patch delta report isn't obvious. VERSION: 3.8-0 OBSERVATION: A patch delta was added to the printed version string. But the form chosen -- a number in parentheses -- isn't obvious as to its meaning. RESOLUTION: Modify "show_version" (scp.c) to display the delta number as a decimal fraction of the release number (e.g., 3.8-0.1). STATUS: Local patch created 2008-06-04. 3. PROBLEM: ATTACH -R and ATTACH -N commands are too noisy. VERSION: 3.9-0 OBSERVATION: The ATTACH command prints informative messages when it creates a new file, opens a read-only file, or buffers a file to memory. These messages are useful indicators for the plain ATTACH command to indicate that something unexpected may have occurred. However, when explicitly requesting a read-only (-R) or new file (-N) attachment, messages that restate the request are redundant. Moreover, with scripted attachments, they can disrupt program output by intruding between logged prompts and responses. These messages are suppressed when SIMH is started with the -Q (quiet) option, but that option also suppresses messages from DO commands, which may be undesirable. CAUSE: Message printing does not take into account whether the request was explicit. RESOLUTION: Modify "attach_unit" (scp.c) to suppress informative messages if the ATTACH command explicitly specifies the "-R" or "-N" options. STATUS: Local patch created 2014-11-10. 5. ENHANCEMENT: Write ECHO command output to the OutputDebugString function. VERSION: 3.99-0 OBSERVATION: It is desirable to have a simple mechanism to time sections of simulated execution. For example, it might be desired to determine how much execution time a new algorithm saves over a previous one. A way of timing that section to a reasonably high resolution would be helpful. Rather than creating a new command that calls a high-resolution timer, derives a delta from the prior call, and outputs that to the console, it would be simpler to leverage the timing facility of the System Internals "DbgView" program, which captures the output of the OutputDebugString function of the Win32 API. RESOLUTION: Modify "echo_cmd" (scp.c) to write the ECHO command's string parameter to the OutputDebugString function when a new "sim_debug_echo" variable is TRUE. Modify "sim_set_debon" and "sim_set_deboff" (sim_console.c) to set and clear this variable in response to SET DEBUG (with no filename specified) and SET NODEBUG commands. STATUS: Local patch created 2018-03-29. 6. PROBLEM: Idling is not supported on Cygwin. VERSION: 3.10-0 OBSERVATION: A SET CPU IDLE command is rejected with "Command not allowed" when the simulator is compiled for Cygwin. CAUSE: When running on Windows, the "sim_os_ms_sleep_init" routine calls "timeBeginPeriod" to set the timer to the fastest supported clock rate, which is typically one millisecond. Without this call, the clock ticks at about a 16 millisecond rate, which is too slow for idle support. On Unix, the default clock rate is measured, and idling is disabled if the rate is too slow. Because Cygwin using the Unix "sim_os_ms_sleep_init" routine, the default rate for the underlying Windows clock is used. This results in the "sim_idle_rate_ms" variable being set to 0, causing the idling enable request to be rejected. RESOLUTION: Modify the Unix version of "sim_os_ms_sleep_init" (sim_timer.c) to add a conditional call to the Cygwin-specific "clock_setres" routine to increase the underlying Windows timer resolution to one millisecond. STATUS: Local patch created 2019-05-22. 7. ENHANCEMENT: Add a command to dump the REG structures. VERSION: 3.11-2 OBSERVATION: Invalid register (REG) structure initializations are hard to catch, especially if the access sizing algorithm is implicit. It would be helpful to be able to dump the REG tables for each device in a readable format. RESOLUTION: Add a new "REGDUMP" command to the "cmd_table" (scp.c) that points at a new "reg_cmd" command processing routine that dumps the REG structures for all devices. STATUS: Local patch created 2021-01-20. 8. ENHANCEMENT: Add debug printouts to the "ex_set_dev_count" routine. VERSION: 3.12-4 OBSERVATION: To ensure that device cloning works properly, it is helpful to show the changes to the "sim_devices" table that result from the SET COUNT commands. Unfortunately, there is no device related to SCP on which to hang the debug flag. So instead, we print the debugging reports on the console and console log if the debug log is defined, under the theory that the latter means that a debugging session is in progress. RESOLUTION: Modify "ex_set_dev_count" (sim_extension.c) to include debugging printouts when "sim_deb" is non-NULL. STATUS: Local patch created 2023-04-01. 9. ENHANCEMENT: EVAL command-line switchs now apply only to the output. VERSION: 3.12-4 OBSERVATION: The user's manual says, "The EVAL command evaluates a symbolic instruction and returns the equivalent numeric value," while the accompanying illustration shows, "EVAL ," and the response to HELP EVAL is "evaluate symbolic expression." In operation, the command passes the expression string to "parse_sym" with fallback to "get_uint" and then calls "fprint_sym" with fallback to "fprint_val" to print the parsed value. As such, it accepts numeric and symbolic values, in addition to instruction mnemonic instructions: HP 2100 simulator V3.12-4 Release 32 sim> eval CLA 0: 002400 sim> eval CLB 0: 006400 sim> eval 14 0: 000014 sim> eval -h 14 0: 0014 sim> eval -d 14 0: 00014 As seen in the third through fifth examples, command-line switches can override the interpretation of numeric values from the CPU data radix of octal to hexadecimal or decimal values. But note that the displays have also switched from octal to hexadecimal and decimal. This is because the same command-line switches are passed to both the parse and the display routines. As such, this isn't very useful. It can also lead to confusing displays. For example, we can display characters as numeric values: sim> eval 'A 0: 000101 sim> eval "AB" 0: 040502 But if we attempt to invert the evaluations of these items, we get: sim> eval -a 101 0: '1' sim> eval -c 040502 0: '0','4' These result from passing the switches to the parse routine, which returns the numeric values associated with the first character of the string "101" and the first two characters of the string "040502". The EVAL command would be much more useful if the switches were passed only to the display routine and not to the parse routine. Then the results would be: sim> eval -h 14 0: 000C sim> eval -d 14 0: 00012 sim> eval -a 101 0: 'A' sim> eval -c 040502 0: 'A','B' RESOLUTION: Modify "eval_cmd" (scp.c) to pass the "sim_switches" value to the "fprint_sym" routine only. STATUS: Local patch created 2023-06-22. ——————————————————————————————————————————————————————————————————————————————— xxx. PROBLEM: VERSION: 3.12-4 OBSERVATION: CAUSE: RESOLUTION: STATUS: Local patch created xxx. ENHANCEMENT: VERSION: 3.12-4 OBSERVATION: RESOLUTION: STATUS: Local patch created