Remove the sound chip; Ctrl-Alt-Del opens the monitor

The sound chip (rtl/sound.v, ports 90h-9Dh, the PmodAMP2 on JA) is removed:
its ports now read FFh like any unused port, the JA pins are free, and the
manual, README, example and tests no longer mention it. No game used it.

Ctrl-Alt-Del raises the monitor's NMI (STOPPED BY CTRL-ALT-DEL) instead of
resetting; pressed in the monitor, again within 2 s, or while an NMI is still
pending it restarts the computer. The monitor gains RESET (port 62), and
BASIC returns to the main screen at start-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-12-02 09:08:48 -08:00
1 parent addf0157fc
commit 305c608bb5
19 files changed
+1707 -2021

No files matched your search

+66 -12
View File
@@ -52,6 +52,16 @@ module tb_terminal;
end
endtask
// Ctrl-Alt-Del pressed and let go (Delete as E0 71), then 10 ms
task cad_press;
begin
ps2_send(8'h14); ps2_send(8'h11); ps2_send(8'hE0); ps2_send(8'h71);
ps2_send(8'hE0); ps2_send(8'hF0); ps2_send(8'h71); ps2_send(8'hF0); ps2_send(8'h11);
ps2_send(8'hF0); ps2_send(8'h14);
#10_000_000;
end
endtask
task ps2_send(input [7:0] d);
integer i;
reg [10:0] f;
@@ -201,6 +211,34 @@ module tb_terminal;
end
endtask
// the restarted BASIC's banner, on whichever row it lands, on the main
// screen (BASIC leaves the monitor's alternate screen as it starts)
task wait_banner(input [8*48-1:0] what);
realtime t0;
integer br, seen;
reg [7:0] b0, b1, b2;
begin
t0 = $realtime;
seen = 0;
while (!seen && $realtime - t0 < 500_000_000) begin
#100_000;
// one cellraw() at a time: several in one expression read wrong
for (br = 0; br < 32; br = br + 1) begin
b0 = cellraw(br, 0); b1 = cellraw(br, 1); b2 = cellraw(br, 2);
if ({b0, b1, b2} == "DAR") seen = 1;
end
end
if (seen && !dut.alt_scr) $display("PASS %0s", what);
else begin
$display("FAIL %0s: banner %0s, alternate screen %b", what,
seen ? "seen" : "not seen", dut.alt_scr);
errors = errors + 1;
dump_screen;
end
#5_000_000;
end
endtask
reg [31:0] pc_a, pc_b, jp_to;
reg [15:0] jp_txt;
integer i;
@@ -623,9 +661,9 @@ module tb_terminal;
// the float registers, in place of the memory window, and setting one
uart_str("F\015");
wait_at(21, 0, " FLOAT REGISTERS");
wait_at(22, 0, " F0 ");
wait_at(22, 0, "FT0 ");
uart_str("R F1=3FC00000\015");
wait_at(22, 13, " F1 3FC00000");
wait_at(22, 13, "FT1 3FC00000");
uart_str("M\015");
wait_at(21, 0, " MEMORY");
uart_str("\015"); // Enter: one step
@@ -716,16 +754,32 @@ module tb_terminal;
uart_str("CLS:CALL 73728\015");
wait_row(0, "ASM OK");
// ---- Ctrl-Alt-Del restarts the computer
ps2_send(8'h14); ps2_send(8'h11); ps2_send(8'hE0); ps2_send(8'h71);
ps2_send(8'hE0); ps2_send(8'hF0); ps2_send(8'h71); ps2_send(8'hF0); ps2_send(8'h11);
ps2_send(8'hF0); ps2_send(8'h14);
// the restarted BASIC's banner, on whichever row it lands
t_cmd = $realtime;
while ({cellraw(2, 0), cellraw(2, 1)} != "DA" && {cellraw(3, 0), cellraw(3, 1)} != "DA" &&
{cellraw(4, 0), cellraw(4, 1)} != "DA" && $realtime - t_cmd < 50_000_000) #100_000;
if ($realtime - t_cmd < 50_000_000) $display("PASS Ctrl-Alt-Del restarted BASIC");
else begin $display("FAIL Ctrl-Alt-Del: no banner"); errors = errors + 1; end
// ---- Ctrl-Alt-Del: into the monitor, even with interrupts off in a
// tight loop; again (within 2 s, or in the monitor) restarts the computer
// csrci mstatus,8 (interrupts off) at 12000, then j . at 12004
uart_str("CLS:POKE 73728,115:POKE 73729,112:POKE 73730,4:POKE 73731,48\015");
uart_str("POKE 73732,111:POKE 73733,0:POKE 73734,0:POKE 73735,0\015");
#5_000_000;
uart_str("CALL 73728\015"); // hangs at 12004, interrupts off
#5_000_000;
cad_press;
wait_at(0, 50, "STOPPED BY CTRL-ALT-DEL");
if (screen_pc(0) == 32'h12004) $display("PASS Ctrl-Alt-Del stopped the loop at 12004");
else begin $display("FAIL Ctrl-Alt-Del: PC %h", screen_pc(0)); errors = errors + 1; end
uart_str("X\015"); // back into the loop
#10_000_000;
cad_press; // within 2 s: restart
wait_banner("Ctrl-Alt-Del twice restarted BASIC");
// a trap goes to the monitor; Ctrl-Alt-Del there restarts
uart_str("CLS:POKE 73728,0:POKE 73729,0:POKE 73730,0:POKE 73731,0:CALL 73728\015");
wait_at(0, 50, "STOPPED BY ILLEGAL INSTRUCTI");
cad_press;
wait_banner("Ctrl-Alt-Del in the monitor restarted BASIC");
// the monitor's RESET
uart_str("CLS:MONITOR\015");
wait_at(29, 0, "> ");
uart_str("RESET\015");
wait_banner("the monitor's RESET restarted BASIC");
dump_screen;
`endif
if (errors == 0) $display("ALL TESTS PASSED");