From 866d31145a50f9a3e2b14380b64acab2d55c44be Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Fri, 26 Apr 2024 13:52:27 -0700 Subject: [PATCH 1/4] IMLAC: Type consistency warnings. --- imlac/imlac_cpu.c | 19 +++++++++++-------- imlac/imlac_crt.c | 5 +++-- imlac/imlac_dp.c | 15 ++++++++++++--- imlac/tests/ssv.simh | 4 ++-- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/imlac/imlac_cpu.c b/imlac/imlac_cpu.c index 2c05ef4d1..10baf9417 100644 --- a/imlac/imlac_cpu.c +++ b/imlac/imlac_cpu.c @@ -211,7 +211,8 @@ static void cpu_class1 (uint16 insn) static void cpu_ral (int n) { - int i, x; + int i; + uint16 x; for (i = 0; i < n; i++) { x = L; L = AC >> 15; @@ -221,7 +222,9 @@ static void cpu_ral (int n) static void cpu_rar (int n) { - int i, x; + int i; + uint16 x; + for (i = 0; i < n; i++) { x = L; L = AC & 1; @@ -252,7 +255,7 @@ static void cpu_class2 (uint16 insn) x = 01600000 >> n; else x = 0; - AC = x | ((AC & 077777) >> n); + AC = (uint16) (x | ((AC & 077777) >> n)); break; } } @@ -485,7 +488,7 @@ t_stat sim_instr (void) } } - return SCPE_OK; + /* unreachable: return SCPE_OK; */ } static t_stat @@ -602,13 +605,13 @@ flag_check (uint16 flag) } static uint16 -irq_iot (uint16 insn, uint16 AC) +irq_iot (uint16 insn, uint16 CUR_AC) { if ((insn & 0771) == 0101) { /* RDI */ - AC |= FLAGS; + CUR_AC |= FLAGS; } if ((insn & 0771) == 0141) { /* ARM */ - ARM = AC; + ARM = CUR_AC; } if ((insn & 0771) == 0161) { /* IOF */ sim_debug (DBG_IRQ, &irq_dev, "Interrupts off\n"); @@ -618,7 +621,7 @@ irq_iot (uint16 insn, uint16 AC) /* Delay the action until next instruction has executed. */ ion_delay = 2; } - return AC; + return CUR_AC; } void diff --git a/imlac/imlac_crt.c b/imlac/imlac_crt.c index 1e0371815..4113102fd 100644 --- a/imlac/imlac_crt.c +++ b/imlac/imlac_crt.c @@ -42,7 +42,8 @@ static UNIT crt_unit = { }; static DEBTAB crt_deb[] = { - { "DBG", DBG }, + { "DBG", DBG }, + { "VVID", SIM_VID_DBG_VIDEO }, { NULL, 0 } }; @@ -90,8 +91,8 @@ crt_reset (DEVICE *dptr) } else { display_reset (); display_init (DIS_IMLAC, 1, dptr); - sim_activate_abs (&crt_unit, 0); vid_register_quit_callback (&crt_quit_callback); + sim_activate_abs (&crt_unit, 0); } #endif return SCPE_OK; diff --git a/imlac/imlac_dp.c b/imlac/imlac_dp.c index 80fe71044..c759827b6 100644 --- a/imlac/imlac_dp.c +++ b/imlac/imlac_dp.c @@ -45,6 +45,7 @@ static uint16 SYNC = 1; /* Function declaration. */ static uint16 dp_iot (uint16, uint16); static t_stat dp_svc (UNIT *uptr); +static t_stat dp_reset(DEVICE *dptr); static uint16 sync_iot (uint16, uint16); static t_stat sync_svc (UNIT *uptr); @@ -83,7 +84,7 @@ static DEBTAB dp_deb[] = { DEVICE dp_dev = { "DP", &dp_unit, dp_reg, NULL, 1, 8, 16, 1, 8, 16, - NULL, NULL, NULL, + NULL, NULL, dp_reset, NULL, NULL, NULL, &dp_imdev, DEV_DEBUG, 0, dp_deb, NULL, NULL, NULL, NULL, NULL, NULL }; @@ -131,7 +132,7 @@ dp_on (int flag) if (SYNC && HALT) flag_on (FLAG_SYNC); } - ON = flag; + ON = (uint16) flag; } uint16 @@ -468,12 +469,20 @@ dp_svc(UNIT * uptr) } else dp_insn (insn); - if (ON) + if (ON) { sim_activate_after (&dp_unit, 2); + } return SCPE_OK; } +static t_stat +dp_reset(DEVICE * uptr) +{ + sim_activate_abs (&dp_unit, 0); + return SCPE_OK; +} + static t_stat sync_svc (UNIT *uptr) { diff --git a/imlac/tests/ssv.simh b/imlac/tests/ssv.simh index 73ec79b8a..470bb8b46 100644 --- a/imlac/tests/ssv.simh +++ b/imlac/tests/ssv.simh @@ -1,9 +1,9 @@ # Attach to a server. If the remote port isn't telnet, append ;notelnet. -attach tty 12345,connect=localhost:23 +attach tty 12345,connect=192.168.50.248:23 # Configure a bootstrap ROM; some programs require this. set rom type=stty # Load SSV version 22. -load -s ssv22.iml +load -s %~p0/ssv22.iml # Reset and run. reset go From ce1e95bfb194fbf6cc8235196f93e4a4a1feeb6d Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Mon, 30 Sep 2024 09:57:07 -0700 Subject: [PATCH 2/4] Remove unintentional changes --- imlac/tests/ssv.simh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imlac/tests/ssv.simh b/imlac/tests/ssv.simh index 470bb8b46..73ec79b8a 100644 --- a/imlac/tests/ssv.simh +++ b/imlac/tests/ssv.simh @@ -1,9 +1,9 @@ # Attach to a server. If the remote port isn't telnet, append ;notelnet. -attach tty 12345,connect=192.168.50.248:23 +attach tty 12345,connect=localhost:23 # Configure a bootstrap ROM; some programs require this. set rom type=stty # Load SSV version 22. -load -s %~p0/ssv22.iml +load -s ssv22.iml # Reset and run. reset go From 8ce52c102ba9bd127c216715218fe6f480db0bf7 Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Mon, 30 Sep 2024 09:58:58 -0700 Subject: [PATCH 3/4] Remove extra braces --- imlac/imlac_dp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/imlac/imlac_dp.c b/imlac/imlac_dp.c index c759827b6..6f9adc3ad 100644 --- a/imlac/imlac_dp.c +++ b/imlac/imlac_dp.c @@ -469,9 +469,8 @@ dp_svc(UNIT * uptr) } else dp_insn (insn); - if (ON) { + if (ON) sim_activate_after (&dp_unit, 2); - } return SCPE_OK; } From d7a767ecca0f4800c99794fd2c4d553b09be2654 Mon Sep 17 00:00:00 2001 From: "B. Scott Michel" Date: Mon, 30 Sep 2024 23:16:18 -0700 Subject: [PATCH 4/4] CUR_AC -> AC (revert) --- imlac/imlac_cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imlac/imlac_cpu.c b/imlac/imlac_cpu.c index 10baf9417..1fa8416ae 100644 --- a/imlac/imlac_cpu.c +++ b/imlac/imlac_cpu.c @@ -605,13 +605,13 @@ flag_check (uint16 flag) } static uint16 -irq_iot (uint16 insn, uint16 CUR_AC) +irq_iot (uint16 insn, uint16 AC) { if ((insn & 0771) == 0101) { /* RDI */ - CUR_AC |= FLAGS; + AC |= FLAGS; } if ((insn & 0771) == 0141) { /* ARM */ - ARM = CUR_AC; + ARM = AC; } if ((insn & 0771) == 0161) { /* IOF */ sim_debug (DBG_IRQ, &irq_dev, "Interrupts off\n"); @@ -621,7 +621,7 @@ irq_iot (uint16 insn, uint16 CUR_AC) /* Delay the action until next instruction has executed. */ ion_delay = 2; } - return CUR_AC; + return AC; } void