Introduce Coco 3 Plus for MiSTer
Add original-firmware Sound & Speech, four configurable Multi-Pak sockets, bounded per-slot ROM allocation and a nine-page menu organized around devices and media. Repair inherited clock/reset/CPU-memory/video paths and add explicit conditional external-I/O timing contracts. Preserve native Main startup-file ordering, saved layouts, stock-core separation and the coco3plus media profile. Provide native Windows tool downloads, pinned ToolShed ROM assembly, fresh Quartus builds, functional and fitted timing checks, reviewed release packaging and passwordless SSH installation with backups. Retain original component notices, document contribution copyright and keep SSC ROM inputs outside Git. Validation: Quartus17.0.2 Build602 seed5, zero errors; 15 functional jobs, 368 both-corner timing scopes and eight tooling-integrity checks pass. The renamed build reaches Disk BASIC, PRINT1+1 returns2 and SSC loads ready. Physical cold power cycling and conditional board-delay assumptions remain separate. Full original upstream histories are preserved before this single consolidated implementation commit.
This commit is contained in:
1 parent
8b8cf72d1f
commit
cb40fed3b9
126 files changed
+12795
-528
No files matched your search
@@ -0,0 +1,84 @@
|
||||
// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman.
|
||||
// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Coco 3 Plus: Sound/Speech host interface.
|
||||
// Behavioral reference: VCCPlus a8a84f22 src/devices/ssc/ssc_core.cpp;
|
||||
// CoCo SSC wiring derives from MAME, copyright Tim Lindner. See LICENSE.
|
||||
// This block does not implement the PIC, PSG, speech engine or audio circuit.
|
||||
// All inputs must be synchronous to clk. host_write/pic_command_read are
|
||||
// single-cycle transaction strobes, not unqualified CPU bus levels.
|
||||
module ssc_host (
|
||||
input wire clk,
|
||||
input wire reset,
|
||||
input wire enable,
|
||||
input wire host_read,
|
||||
input wire host_write,
|
||||
input wire [15:0] host_address,
|
||||
input wire [7:0] host_data,
|
||||
output wire host_read_valid,
|
||||
output wire [7:0] host_read_data,
|
||||
// Future controller's port A input and INT3 command request.
|
||||
input wire pic_command_read,
|
||||
input wire pic_busy_line,
|
||||
output reg [7:0] command_data,
|
||||
output reg command_irq,
|
||||
output reg command_busy,
|
||||
// Future engines supply these levels; this block does not synthesize them.
|
||||
input wire speech_standby,
|
||||
input wire sound_active,
|
||||
// Reset requests last one clk tick (held asserted during global reset).
|
||||
output reg controller_reset,
|
||||
output reg speech_reset
|
||||
);
|
||||
localparam [15:0] CONTROL_ADDRESS = 16'hFF7D;
|
||||
localparam [15:0] COMMAND_ADDRESS = 16'hFF7E;
|
||||
reg reset_bit;
|
||||
reg previous_busy_line;
|
||||
wire control_write = enable && host_write && host_address == CONTROL_ADDRESS;
|
||||
wire command_write = enable && host_write && host_address == COMMAND_ADDRESS;
|
||||
|
||||
assign host_read_valid = enable && host_read &&
|
||||
(host_address == CONTROL_ADDRESS || host_address == COMMAND_ADDRESS);
|
||||
// An unselected device contributes nothing to the shared read mux.
|
||||
assign host_read_data = !host_read_valid ? 8'h00 :
|
||||
host_address == CONTROL_ADDRESS ? 8'hFF :
|
||||
{ !command_busy, speech_standby, !sound_active, 5'b11111 };
|
||||
|
||||
always @(posedge clk) begin
|
||||
if (reset) begin
|
||||
reset_bit <= 1'b1;
|
||||
previous_busy_line <= 1'b0; // controller reset drives port C to zero
|
||||
command_data <= 8'h00;
|
||||
command_irq <= 1'b0;
|
||||
command_busy <= 1'b0;
|
||||
controller_reset <= 1'b1;
|
||||
speech_reset <= 1'b1;
|
||||
end else begin
|
||||
controller_reset <= 1'b0;
|
||||
speech_reset <= 1'b0;
|
||||
previous_busy_line <= pic_busy_line;
|
||||
if (!previous_busy_line && pic_busy_line)
|
||||
command_busy <= 1'b0;
|
||||
if (pic_command_read)
|
||||
command_irq <= 1'b0;
|
||||
if (control_write) begin
|
||||
reset_bit <= host_data[0];
|
||||
if (host_data[0]) speech_reset <= 1'b1;
|
||||
if (reset_bit && !host_data[0]) begin
|
||||
controller_reset <= 1'b1;
|
||||
command_busy <= 1'b0;
|
||||
command_irq <= 1'b0;
|
||||
previous_busy_line <= 1'b0;
|
||||
end
|
||||
end
|
||||
// A fresh host command wins over simultaneous completion/read strobes.
|
||||
// The controller consuming port A on this edge sees the OLD payload;
|
||||
// the new payload remains latched with INT3 asserted for its next read.
|
||||
if (command_write) begin
|
||||
command_data <= host_data;
|
||||
command_busy <= 1'b1;
|
||||
command_irq <= 1'b1;
|
||||
end
|
||||
end
|
||||
end
|
||||
endmodule
|
||||
Reference in new issue
Block a user