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
@@ -1,3 +1,5 @@
|
||||
// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman.
|
||||
// Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md.
|
||||
//============================================================================
|
||||
// CoCo3 port to MiSTer
|
||||
// Copyright (c) 2019 Alan Steremberg - alanswx, Stan Hodge - MasterS3263827
|
||||
@@ -196,70 +198,80 @@ assign VIDEO_ARY = (!ar) ? 12'd3 : 12'd0;
|
||||
`include "build_id_num.v"
|
||||
|
||||
localparam CONF_STR = {
|
||||
"COCO3;UART19200:9600:4800:2400:1200:300;",
|
||||
"-;",
|
||||
"OCD,Multi-Pak,(Slot 2) CoCoSDC,(Slot3) ECB /Cart,(Slot 4) Disk;",
|
||||
"H3-;",
|
||||
"H3S2,DSK,Load Disk Drive 0;",
|
||||
"H3S3,DSK,Load Disk Drive 1;",
|
||||
"H3S4,DSK,Load Disk Drive 2;",
|
||||
"H3S5,DSK,Load Disk Drive 3;",
|
||||
"H2-;",
|
||||
"H2F1,CCC,Load Cartridge;",
|
||||
"H1-;",
|
||||
"H1S0,DSKVHD,Load SDC Drive 0;",
|
||||
"H1S1,DSKVHD,Load SDC Drive 1;",
|
||||
"H1-;",
|
||||
"H1S2,DSK,Load OS9 Floppy /d0;",
|
||||
"H1S3,DSK,Load OS9 Floppy /d1;",
|
||||
"H1S4,DSK,Load OS9 Floppy /d3;",
|
||||
"H1S5,DSK,Load OS9 Floppy /d4;",
|
||||
"-;",
|
||||
|
||||
"F2,CAS,Load Cassette;",
|
||||
"TF,Stop & Rewind;",
|
||||
"OH,Monitor Tape Sound,No,Yes;",
|
||||
"-;",
|
||||
"S6,CAS,Save Cassette;",
|
||||
"OE,Cass Rwd=0 / Rec=1,0,1;",
|
||||
"-;",
|
||||
|
||||
"P1,Video Settings;",
|
||||
"P1-;",
|
||||
"P1-, -= Video Settings =-;",
|
||||
"P1-;",
|
||||
"P1O89,Aspect ratio,Original,Full Screen,Wide,[ARC1];",
|
||||
"P1O35,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%,CRT 75%;",
|
||||
"P1-;",
|
||||
"P1OL,CoCo3 LC,Yes,No-(SG6=Yes);",
|
||||
"P1-;",
|
||||
"P1o56,Artifact Type,MESS,Simple,NONE;",
|
||||
"P1OI,Artifact Color Set,0,1;",
|
||||
"-;",
|
||||
"P2,Debug Menu;",
|
||||
"P2-;",
|
||||
"P2-, -= Debug Menu =-;",
|
||||
"P2-;",
|
||||
"P2F3,BIN,Load COCO Font;",
|
||||
"P2OG,Swap MiSTer Uart,RS CART,Default;",
|
||||
"P2OU,Swap Uart to IO,RS IO,MiSTer;",
|
||||
"P2OT,Display Debug,Off,On;",
|
||||
"-;",
|
||||
"ON,D-Pad Joystick emu,No,Yes;",
|
||||
"O6,Swap Joysticks,Off,On;",
|
||||
"OS,Use Mouse for Rt Joystk,Off,On;",
|
||||
"RA,Easter Egg;",
|
||||
"-;",
|
||||
"OO,Force Turbo,No,Yes;",
|
||||
"o02,Turbo Speed,CoCo Ctrl, 0.89 Mhz,1.78 Mhz,2.86 Mhz, 3.58 Mhz,7.16 Mhz,9.54 Mhz;",
|
||||
"OPR,Memory Size,512K,1M,2M,16M;",
|
||||
"o89,Auto Run,No,DOS,AUTO.BAS;",
|
||||
"-;",
|
||||
"RM,Cold Boot;",
|
||||
"R0,Reset;",
|
||||
"Coco 3 Plus;UART19200:9600:4800:2400:1200:300;",
|
||||
// Native remembered-file records are deliberately independent of pages.
|
||||
"H0FC1,CCCROMBIN,Legacy cartridge;",
|
||||
"H4FC4,BINROM,Load SSC controller (4K);",
|
||||
"H4FC5,BINROM,Load SSC voice (2K);",
|
||||
"P1,Cartridges & Multi-Pak;",
|
||||
"P1OCD,Startup slot,Slot 1,Slot 2,Slot 3,Slot 4;",
|
||||
"P1-,Built-in devices move slots;",
|
||||
"P1-,Changes restart the CoCo;",
|
||||
"P1oBD,Slot 1,Empty,ROM file,Floppy,CoCo SDC,Sound & Speech,Orchestra90,Audio expansions,RS232;",
|
||||
"H8P1FC6,CCCROMBIN,Slot 1 ROM;",
|
||||
"P1oEG,Slot 2,Empty,ROM file,Floppy,CoCo SDC,Sound & Speech,Orchestra90,Audio expansions,RS232;",
|
||||
"H9P1FC7,CCCROMBIN,Slot 2 ROM;",
|
||||
"P1oHJ,Slot 3,Empty,ROM file,Floppy,CoCo SDC,Sound & Speech,Orchestra90,Audio expansions,RS232;",
|
||||
"HAP1FC8,CCCROMBIN,Slot 3 ROM;",
|
||||
"P1oKM,Slot 4,Empty,ROM file,Floppy,CoCo SDC,Sound & Speech,Orchestra90,Audio expansions,RS232;",
|
||||
"HBP1FC9,CCCROMBIN,Slot 4 ROM;",
|
||||
"P1-,ROM pool: 256K total;",
|
||||
"P1-,Max ROM: 128K per slot;",
|
||||
"HCP1-,ROM load error: size/full;",
|
||||
"P2,Floppy Disks;",
|
||||
"P2-,Media follows controller;",
|
||||
"D3P2S2,DSK,Drive 0;",
|
||||
"D3P2S3,DSK,Drive 1;",
|
||||
"D3P2S4,DSK,Drive 2;",
|
||||
"D3P2S5,DSK,Drive 3;",
|
||||
"P3,CoCo SDC;",
|
||||
"D1P3S0,DSKVHD,SDC Drive 0;",
|
||||
"D1P3S1,DSKVHD,SDC Drive 1;",
|
||||
"P3-,OS9 floppy mounts;",
|
||||
"D1P3S2,DSK,OS9 Floppy /d0;",
|
||||
"D1P3S3,DSK,OS9 Floppy /d1;",
|
||||
"D1P3S4,DSK,OS9 Floppy /d3;",
|
||||
"D1P3S5,DSK,OS9 Floppy /d4;",
|
||||
"P4,Sound & Expansion;",
|
||||
"DDP4oA,Expansion,Extended palette,Sound & Speech;",
|
||||
"hDP4-,Assign SSC in Multi-Pak;",
|
||||
"H5P4-,Sound & Speech not ready;",
|
||||
"H6P4-,Sound & Speech ready;",
|
||||
"H7P4-,Sound & Speech error;",
|
||||
"HFP4-,Orchestra90 stereo enabled;",
|
||||
"P4-,Audio = SSC + Orchestra90;",
|
||||
"P5,Cassette;",
|
||||
"P5F2,CAS,Load Cassette;",
|
||||
"P5TF,Stop & Rewind;",
|
||||
"P5OH,Monitor Tape Sound,No,Yes;",
|
||||
"P5S6,CAS,Save Cassette;",
|
||||
"P5OE,Transport,Playback / Rewind,Record;",
|
||||
"P6,Machine;",
|
||||
"P6OPR,Memory Size,512K,1M,2M,16M;",
|
||||
"P6OO,Force Turbo,No,Yes;",
|
||||
"P6o02,Turbo Speed,CoCo Ctrl,0.89 MHz,1.78 MHz,2.86 MHz,3.58 MHz,7.16 MHz,9.54 MHz;",
|
||||
"P6o89,Auto Run,Off,DOS,AUTO.BAS;",
|
||||
"P6RM,Cold Boot;",
|
||||
"P6R0,Reset;",
|
||||
"P7,Display;",
|
||||
"P7O89,Aspect ratio,Original,Full Screen,Wide,[ARC1];",
|
||||
"P7O35,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%,CRT 75%;",
|
||||
"P7OL,CoCo3 LC,Yes,No-(SG6=Yes);",
|
||||
"P7o56,Artifact Type,MESS,Simple,NONE;",
|
||||
"P7OI,Artifact Color Set,0,1;",
|
||||
"P8,Input;",
|
||||
"P8ON,D-Pad Joystick emu,No,Yes;",
|
||||
"P8O6,Swap Joysticks,Off,On;",
|
||||
"P8OS,Mouse as right joystick,Off,On;",
|
||||
"P9,Advanced;",
|
||||
"P9F3,BIN,Load COCO Font;",
|
||||
"P9OG,Swap MiSTer Uart,RS CART,Default;",
|
||||
"P9OU,Swap Uart to IO,RS IO,MiSTer;",
|
||||
"P9OT,Display Debug,Off,On;",
|
||||
"P9RA,Easter Egg;",
|
||||
"J,Button1,Button2;",
|
||||
"jn,A,B;",
|
||||
"v,51;",
|
||||
"v,51;",
|
||||
"V,v",{`BUILD_DATE,"-",`BUILD_NUMBER}
|
||||
};
|
||||
|
||||
@@ -282,7 +294,7 @@ wire clk_sys;
|
||||
|
||||
assign clk_sys=CLK_57;
|
||||
|
||||
wire pll_locked, pll2_locked;
|
||||
wire pll2_locked;
|
||||
wire CLK_114, CLK_57, CLK_28, CLK_14;
|
||||
|
||||
assign VGA_DISABLE = 1'b0;
|
||||
@@ -298,10 +310,37 @@ pll pll
|
||||
.locked(pll2_locked)
|
||||
);
|
||||
|
||||
// Cartridge ROM validity is cleared only by loss of the actual core PLL lock.
|
||||
// Release synchronously after two system-clock edges, independent of CoCo reset.
|
||||
(* preserve, altera_attribute = "-name SYNCHRONIZER_IDENTIFICATION FORCED_IF_ASYNCHRONOUS" *)
|
||||
reg [1:0] ssc_power_release = 2'b00;
|
||||
always @(posedge clk_sys or negedge pll2_locked)
|
||||
if(!pll2_locked) ssc_power_release <= 2'b00;
|
||||
else ssc_power_release <= {ssc_power_release[0],1'b1};
|
||||
wire ssc_power_reset = !ssc_power_release[1];
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
wire [63:0] status;
|
||||
wire [63:0] status_in = 63'd0;
|
||||
wire [63:0] status_raw;
|
||||
reg [63:0] status = 64'd0;
|
||||
wire [63:0] status_accepted;
|
||||
bh_mpi_config mpi_configuration(.clk(clk_sys),.reset(ssc_power_reset),
|
||||
.requested(status_raw),.accepted(status_accepted),
|
||||
.status_in(status_in),.status_set(status_set));
|
||||
always @(negedge clk_sys) status <= status_accepted;
|
||||
wire [11:0] mpi_layout=status[54:43];
|
||||
wire [3:0] mpi_rom_fault;
|
||||
wire mpi_rom_loading,mpi_rom_loaded;
|
||||
wire [2:0] menu_rom_kind,menu_io_kind;
|
||||
wire menu_ssc,menu_orchestra,menu_floppy,menu_sdc;
|
||||
bh_mpi_router menu_devices(.layout(mpi_layout),.cts(status[13:12]),.scs(status[13:12]),
|
||||
.rom_kind(menu_rom_kind),.io_kind(menu_io_kind),.floppy_io(),.sdc_io(),.rom_io(),.serial_io(),
|
||||
.ssc_present(menu_ssc),.orchestra_present(menu_orchestra),
|
||||
.floppy_present(menu_floppy),.sdc_present(menu_sdc));
|
||||
function rom_picker_hidden(input [2:0] kind);
|
||||
begin rom_picker_hidden=!(kind==1||kind==5||kind==6);end
|
||||
endfunction
|
||||
wire [63:0] status_in;
|
||||
wire status_set;
|
||||
|
||||
wire [1:0] buttons;
|
||||
@@ -335,11 +374,18 @@ hps_io #(.CONF_STR(CONF_STR),.PS2DIV(2400), .VDNUM(7), .BLKSZ(2)) hps_io
|
||||
|
||||
|
||||
.buttons(buttons),
|
||||
.status(status),
|
||||
.status(status_raw),
|
||||
.status_in(status_in),
|
||||
.status_set(status_set),
|
||||
|
||||
.status_menumask({ ~(mpi == 2'b11), ~(mpi == 2'b10),~(mpi == 2'b01), 1'b1}),
|
||||
.status_menumask({!menu_orchestra,1'b0,!menu_ssc,!(|mpi_rom_fault),
|
||||
rom_picker_hidden(mpi_layout[11:9]),
|
||||
rom_picker_hidden(mpi_layout[8:6]),
|
||||
rom_picker_hidden(mpi_layout[5:3]),
|
||||
rom_picker_hidden(mpi_layout[2:0]),
|
||||
!status[42]||!ssc_fault,!status[42]||!ssc_ready,
|
||||
!status[42]||ssc_ready,1'b1,
|
||||
!menu_floppy,1'b0,!menu_sdc,1'b1}),
|
||||
.forced_scandoubler(forced_scandoubler),
|
||||
.RTC(RTC),
|
||||
.gamma_bus(gamma_bus),
|
||||
@@ -411,11 +457,15 @@ wire [9:0] center_joystick_y2 = 8'd128 + joya2[15:8];
|
||||
wire [9:0] center_joystick_x2 = 8'd128 + joya2[7:0];
|
||||
wire vclk;
|
||||
|
||||
wire [31:0] coco_joy1 = status[6] ? joy2 : joy1;
|
||||
wire [31:0] coco_joy2 = status[6] ? joy1 : joy2;
|
||||
reg [31:0] coco_joy1 = 0;
|
||||
always @(negedge clk_sys) coco_joy1 <= status[6] ? joy2 : joy1;
|
||||
reg [31:0] coco_joy2 = 0;
|
||||
always @(negedge clk_sys) coco_joy2 <= status[6] ? joy1 : joy2;
|
||||
|
||||
wire [15:0] coco_ajoy1 = status[6] ? {center_joystick_x2[7:0],center_joystick_y2[7:0]} : {center_joystick_x1[7:0],center_joystick_y1[7:0]};
|
||||
wire [15:0] coco_ajoy2 = status[6] ? {center_joystick_x1[7:0],center_joystick_y1[7:0]} : {center_joystick_x2[7:0],center_joystick_y2[7:0]};
|
||||
reg [15:0] coco_ajoy1 = 0;
|
||||
always @(negedge clk_sys) coco_ajoy1 <= status[6] ? {center_joystick_x2[7:0],center_joystick_y2[7:0]} : {center_joystick_x1[7:0],center_joystick_y1[7:0]};
|
||||
reg [15:0] coco_ajoy2 = 0;
|
||||
always @(negedge clk_sys) coco_ajoy2 <= status[6] ? {center_joystick_x1[7:0],center_joystick_y1[7:0]} : {center_joystick_x2[7:0],center_joystick_y2[7:0]};
|
||||
|
||||
|
||||
|
||||
@@ -478,6 +528,7 @@ EE_Cold_Bt COCO3_EE_Cold_Bt (
|
||||
|
||||
|
||||
wire [15:0] audio_left;
|
||||
wire ssc_ready,ssc_fault;
|
||||
assign AUDIO_L = { audio_left[15:14], audio_left[13] ^ (status[17] ? casdout : 1'b0),audio_left[12:0]};
|
||||
//assign AUDIO_R = AUDIO_L;
|
||||
assign AUDIO_S = 0;
|
||||
@@ -507,8 +558,15 @@ coco3fpga coco3 (
|
||||
.CLK_28(CLK_28),
|
||||
.CLK_14(CLK_14),
|
||||
|
||||
.SSC_POWER_RESET(ssc_power_reset),
|
||||
.SSC_MODE(status[42]),
|
||||
.MPI_LAYOUT(mpi_layout),.MPI_BOOT_LOADING(status[0]),.MPI_ROM_FAULT(mpi_rom_fault),
|
||||
.MPI_ROM_LOADING(mpi_rom_loading),.MPI_ROM_LOADED(mpi_rom_loaded),
|
||||
.SSC_READY(ssc_ready),
|
||||
.SSC_FAULT(ssc_fault),
|
||||
|
||||
// Reset
|
||||
.COCO_RESET_N((~reset & Programmed_RESET_N)),
|
||||
.COCO_RESET_N((~reset & Programmed_RESET_N) && !mpi_rom_loading),
|
||||
|
||||
.RED_O(r),
|
||||
.GREEN_O(g),
|
||||
@@ -577,7 +635,7 @@ coco3fpga coco3 (
|
||||
.PROBE_O(probe_o),
|
||||
.PROBE_I(probe_i),
|
||||
.clk_Q_out(clk_Q_out),
|
||||
.casdout( casdout),
|
||||
.casdout( cassette_cpu_sample),
|
||||
.cas_relay(cas_relay),
|
||||
|
||||
// SDRAM
|
||||
@@ -602,7 +660,7 @@ coco3fpga coco3 (
|
||||
|
||||
.RTC(RTC),
|
||||
|
||||
.AMW_Trigger(coldboot | mpi_reset | mem_reset),
|
||||
.AMW_Trigger(coldboot | mpi_reset | mem_reset | mpi_rom_loaded),
|
||||
// .AMW_Trigger(coldboot),
|
||||
.AMW_ACK(AMW_ACK),
|
||||
|
||||
@@ -623,7 +681,7 @@ coco3fpga coco3 (
|
||||
.UART_DSR(UART_DSR)
|
||||
);
|
||||
|
||||
assign status_set = 1'b0;
|
||||
// status_set is driven by the versioned layout/status normalizer.
|
||||
|
||||
//wire [5:0] cocosound;
|
||||
|
||||
@@ -636,7 +694,7 @@ wire AMW_ACK;
|
||||
|
||||
//wire cpu_speed = status[11];
|
||||
|
||||
wire [1:0] mpi = status[13:12] + 1'b1;
|
||||
wire [1:0] mpi = status[13:12];
|
||||
//wire video=status[14];
|
||||
wire CASS_REW_RECORD=status[14];
|
||||
wire rs_swap=status[16];
|
||||
@@ -652,16 +710,16 @@ wire SWAP_M_J = status[28];
|
||||
wire display_debug = status[29];
|
||||
wire UART_INPUT = status[30];
|
||||
wire digitalJoy = status[23];
|
||||
reg [2:0] mpi_d = 2'b00;
|
||||
reg [13:0] mpi_d=14'd0;
|
||||
reg first_mpi_chg = 1'b0;
|
||||
reg mpi_reset = 1'b0;
|
||||
|
||||
always @ (negedge CLK_14)
|
||||
begin
|
||||
mpi_d <= mpi;
|
||||
mpi_d <= {mpi_layout,mpi};
|
||||
mpi_reset <= 1'b0;
|
||||
|
||||
if (~(mpi == mpi_d))
|
||||
if (~({mpi_layout,mpi} == mpi_d))
|
||||
if (~first_mpi_chg)
|
||||
first_mpi_chg <= 1'b1;
|
||||
else
|
||||
@@ -709,18 +767,30 @@ wire sdram_vid_ready;
|
||||
wire sdram_busy;
|
||||
|
||||
|
||||
// Research: decoded request payload is captured before the fast controller.
|
||||
wire [24:0] bridge_addr;
|
||||
wire [7:0] bridge_din;
|
||||
wire bridge_req, bridge_rnw, bridge_ack;
|
||||
cpu_sdram_bridge cpu_memory_boundary (
|
||||
.clk(clk_sys), .fast_clk(CLK_114), .reset(reset), .cpu_addr(sdram_cpu_addr),
|
||||
.cpu_din(sdram_cpu_din), .cpu_req(sdram_cpu_req), .cpu_rnw(sdram_cpu_rnw),
|
||||
.memory_ack(bridge_ack), .cpu_ack(sdram_cpu_ack),
|
||||
.memory_addr(bridge_addr), .memory_din(bridge_din),
|
||||
.memory_req(bridge_req), .memory_rnw(bridge_rnw)
|
||||
);
|
||||
|
||||
sdram_32r8w coco3_sdram
|
||||
(
|
||||
.*,
|
||||
.init(reset),
|
||||
.clk(CLK_114),
|
||||
.sdram_cpu_addr(sdram_cpu_addr[24:0]),
|
||||
.sdram_cpu_addr(bridge_addr),
|
||||
// .sdram_ldout(sdram_ldout),
|
||||
.sdram_dout(sdram_dout),
|
||||
.sdram_cpu_din(sdram_cpu_din),
|
||||
.sdram_cpu_req(sdram_cpu_req),
|
||||
.sdram_cpu_rnw(sdram_cpu_rnw),
|
||||
.sdram_cpu_ack(sdram_cpu_ack),
|
||||
.sdram_cpu_din(bridge_din),
|
||||
.sdram_cpu_req(bridge_req),
|
||||
.sdram_cpu_rnw(bridge_rnw),
|
||||
.sdram_cpu_ack(bridge_ack),
|
||||
.sdram_cpu_ready(sdram_cpu_ready),
|
||||
|
||||
.sdram_vid_addr(sdram_vid_addr[24:0]),
|
||||
@@ -733,6 +803,8 @@ sdram_32r8w coco3_sdram
|
||||
|
||||
|
||||
wire casdout;
|
||||
reg cassette_cpu_sample = 1'b0;
|
||||
always @(negedge clk_sys) cassette_cpu_sample <= casdout;
|
||||
wire cas_relay;
|
||||
wire load_tape = ioctl_index == 2;
|
||||
|
||||
|
||||
Reference in new issue
Block a user