Compare commits
4
Commits
master
...
FujiNet_V1.00
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
def4bc0b5b | ||
|
|
dacbc5b7e1 | ||
|
|
5e1b2e4c33 | ||
|
|
bbbee96a30 |
No files matched your search
@@ -198,7 +198,7 @@ assign VIDEO_ARY = (!ar) ? 12'd3 : 12'd0;
|
||||
localparam CONF_STR = {
|
||||
"COCO3;UART19200:9600:4800:2400:1200:300;",
|
||||
"-;",
|
||||
"OCD,Multi-Pak,(Slot 2) CoCoSDC,(Slot3) ECB /Cart,(Slot 4) Disk;",
|
||||
"OCD,Multi-Pak,(Slot 1) FujiNet,(Slot 2) CoCoSDC,(Slot3) ECB /Cart,(Slot 4) Disk;",
|
||||
"H3-;",
|
||||
"H3S2,DSK,Load Disk Drive 0;",
|
||||
"H3S3,DSK,Load Disk Drive 1;",
|
||||
@@ -214,6 +214,7 @@ localparam CONF_STR = {
|
||||
"H1S3,DSK,Load OS9 Floppy /d1;",
|
||||
"H1S4,DSK,Load OS9 Floppy /d3;",
|
||||
"H1S5,DSK,Load OS9 Floppy /d4;",
|
||||
"H0-;",
|
||||
"-;",
|
||||
|
||||
"F2,CAS,Load Cassette;",
|
||||
@@ -243,7 +244,7 @@ localparam CONF_STR = {
|
||||
"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;",
|
||||
"P2OT,SAM Wrt Only Ena,Off,On;",
|
||||
"-;",
|
||||
"ON,D-Pad Joystick emu,No,Yes;",
|
||||
"O6,Swap Joysticks,Off,On;",
|
||||
@@ -339,7 +340,7 @@ hps_io #(.CONF_STR(CONF_STR),.PS2DIV(2400), .VDNUM(7), .BLKSZ(2)) hps_io
|
||||
.status_in(status_in),
|
||||
.status_set(status_set),
|
||||
|
||||
.status_menumask({ ~(mpi == 2'b11), ~(mpi == 2'b10),~(mpi == 2'b01), 1'b1}),
|
||||
.status_menumask({ ~(mpi == 2'b11), ~(mpi == 2'b10),~(mpi == 2'b01), ~(mpi == 2'b00)}),
|
||||
.forced_scandoubler(forced_scandoubler),
|
||||
.RTC(RTC),
|
||||
.gamma_bus(gamma_bus),
|
||||
@@ -613,7 +614,7 @@ coco3fpga coco3 (
|
||||
.AUTO_MODE(Auto_Mode),
|
||||
|
||||
.Config_Data(Config_Data),
|
||||
.Display_Debug(display_debug),
|
||||
.SAM_WO(SAM_WO),
|
||||
|
||||
.UART_TXD(UART_TXD),
|
||||
.UART_RXD(UART_RXD),
|
||||
@@ -636,7 +637,8 @@ wire AMW_ACK;
|
||||
|
||||
//wire cpu_speed = status[11];
|
||||
|
||||
wire [1:0] mpi = status[13:12] + 1'b1;
|
||||
//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];
|
||||
@@ -649,7 +651,7 @@ wire coldboot = status[22];
|
||||
wire F_Turbo = status[24];
|
||||
wire [2:0] Mem_Size = status[27:25];
|
||||
wire SWAP_M_J = status[28];
|
||||
wire display_debug = status[29];
|
||||
wire SAM_WO = status[29];
|
||||
wire UART_INPUT = status[30];
|
||||
wire digitalJoy = status[23];
|
||||
reg [2:0] mpi_d = 2'b00;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
`define BUILD_NUMBER "001"
|
||||
`define BUILD_NUMBER "006"
|
||||
+22
-4
@@ -6,12 +6,30 @@
|
||||
[done]
|
||||
4. Routing RS-232 tx/rx lines to the SNAC port for initial serial debugging
|
||||
of Fuji-Net interface. [done - untested]
|
||||
|
||||
5. Added Fujinet support.
|
||||
a) Install Fujinet [seperate instruction document]
|
||||
a) Slot 1 is now Fujunet only support.
|
||||
b) You will need HDBDos 'HDBDW3S3' which will be autoloaded if named
|
||||
BOOT2.ROM. Tested with ver 1.5 SY6551 @ 115,200 baud.
|
||||
c) In the Debug menu on the OSD 'Swap Mister Uart:' is set to RS CART.
|
||||
'SWAP Uart to IO:' is set to 'Off'.
|
||||
d) In the 'System' page of the OSD, 'Uart Mode' Should be set to 'Fujinet'
|
||||
and the baud rate to '115,200'.
|
||||
e) In slot 1 ONLY [Fujinet], a cold boot issued through the OSD will cause
|
||||
a firewire reset command [$FF] to be transmitted to the Fujinet daemon
|
||||
which will cause the Fujinet Config screem to come up after boot.
|
||||
f) The SD drive in Fujinet is configured to the CoCo3 games area on the MiSTer
|
||||
storage location.
|
||||
6. A bug was fixed in that this core did not allow SAM registers to be set / cleared
|
||||
by reads. This was fixed with the side effect of preventing older OS9 disks
|
||||
from booting. [OS9 L1v1.02]. In the OSD Debug Menu, 'SAM Wrt Only Ena' should
|
||||
be set to 'Off' for true CoCo3 compadibility. Turn it on if your old OS9
|
||||
disks hang.
|
||||
a) This fix has moved the RTC availibility to be moved to the config data.
|
||||
(see manual for details)
|
||||
|
||||
To Do...
|
||||
1. Add Fuji-Net port.
|
||||
2. Add Speech / Music cart
|
||||
3. Fix Castle of Tharoggad
|
||||
1. Fix Castle of Tharoggad
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -36,4 +36,5 @@ set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_32K.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_8K.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_16.vhd
|
||||
set_global_assignment -name VHDL_FILE rtl/OVO.vhd
|
||||
set_global_assignment -name VERILOG_FILE rtl/UIM.v
|
||||
set_global_assignment -name SDC_FILE rtl/CoCo3FPGA.sdc
|
||||
@@ -308,8 +308,15 @@ end
|
||||
assign TX_CLK = (CTL_REG[3:0] == 4'h0) ? XTAL_CLK_IN:
|
||||
TX_CLK_REG;
|
||||
|
||||
assign RX_CLK = (CTL_REG[4] == 1'b0) ? RX_CLK_IN:
|
||||
TX_CLK;
|
||||
//assign RX_CLK = (CTL_REG[4] == 1'b0) ? RX_CLK_IN:
|
||||
// TX_CLK;
|
||||
|
||||
// Receiver clock. CTL bit 4 = 0 selects the external RxC input, which used to
|
||||
// be the fixed 1.8475 MHz enable (115,200 baud): a program writing CTL=$0F
|
||||
// (19,200, bit 4 clear -- the FujiNet HDB-DOS L3 cart) then transmitted at
|
||||
// 19,200 but received at 115,200. RxC is taken from the baud generator
|
||||
// instead; for CTL[3:0]=0 that is the same 1.8475 MHz clock as before.
|
||||
assign RX_CLK = TX_CLK;
|
||||
|
||||
assign RESET_X = RESET_NX ? 1'b0:
|
||||
RESET_N;
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Project Name: CoCo3FPGA Version 5.0
|
||||
// File Name: UIM.v
|
||||
//
|
||||
// CoCo3 in an FPGA
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Color Computer 3 compatible system on a chip
|
||||
//
|
||||
//
|
||||
// Copyright (c) 2008 Gary Becker ([email protected])
|
||||
//
|
||||
// All rights reserved
|
||||
//
|
||||
// Redistribution and use in source and synthezised forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in synthesized form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// Neither the name of the author nor the names of other contributors may
|
||||
// be used to endorse or promote products derived from this software without
|
||||
// specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Please report bugs to the author, but before you do so, please
|
||||
// make sure that this is not a derivative work and that
|
||||
// you have the latest version of this file.
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Stan Hodge
|
||||
//
|
||||
// UART Injection Module by Stan Hodge 11/8/26
|
||||
//
|
||||
// This module uses the AMW_END chain to cause a $FF to be written to the 6551
|
||||
// uart, then delay until that transmission has been made, then pass on the AMW_END.
|
||||
// This only occurs in slot 1. In other slots, AMW_END_OUT = AMW_END_IN.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
module UIM(
|
||||
input CLK,
|
||||
input RESET_N,
|
||||
|
||||
input [1:0] MPI_SCS,
|
||||
input PH_2,
|
||||
|
||||
input AMW_END_IN,
|
||||
input ENABLE_IN,
|
||||
input RW_N_IN,
|
||||
|
||||
input [1:0] ADDRESS_IN,
|
||||
input [7:0] DATA_IN,
|
||||
|
||||
|
||||
output AMW_END_OUT,
|
||||
output ENABLE_OUT,
|
||||
output RW_N_OUT,
|
||||
|
||||
output [1:0] ADDRESS_OUT,
|
||||
output [7:0] DATA_OUT
|
||||
|
||||
);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
localparam UIM_START = 3'd0;
|
||||
localparam UIM_F1 = 3'd1;
|
||||
localparam UIM_F2 = 3'd2;
|
||||
localparam UIM_F3 = 3'd3;
|
||||
localparam UIM_F4 = 3'd4;
|
||||
localparam UIM_F5 = 3'd5;
|
||||
localparam UIM_F6 = 3'd6;
|
||||
localparam UIM_ST_END = 3'd7;
|
||||
|
||||
reg [2:0] state;
|
||||
reg mux,rw,ena,timer_ena, AMW_END_OUT_ST;
|
||||
reg [13:0] timer;
|
||||
|
||||
assign ADDRESS_OUT = (mux == 1'b0) ? ADDRESS_IN:
|
||||
2'b00;
|
||||
|
||||
assign DATA_OUT = (mux == 1'b0) ? DATA_IN:
|
||||
8'b11111111;
|
||||
|
||||
assign RW_N_OUT = (mux == 1'b0) ? RW_N_IN:
|
||||
rw;
|
||||
|
||||
assign ENABLE_OUT = (mux == 1'b0) ? ENABLE_IN:
|
||||
ena;
|
||||
|
||||
assign AMW_END_OUT = (MPI_SCS == 2'b00) ? AMW_END_OUT_ST:
|
||||
AMW_END_IN;
|
||||
|
||||
always @(negedge CLK or negedge RESET_N)
|
||||
begin
|
||||
if(!RESET_N)
|
||||
begin
|
||||
state <= UIM_START;
|
||||
mux <= 1'b0;
|
||||
rw <= 1'b1;
|
||||
ena <= 1'b0;
|
||||
timer <= 14'b00000000000000;
|
||||
timer_ena <=1'b0;
|
||||
AMW_END_OUT_ST <= 1'b0;
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
if (timer_ena == 1'b1)
|
||||
timer <= timer + 1'b1;
|
||||
|
||||
case(state)
|
||||
|
||||
UIM_START:
|
||||
begin
|
||||
if ((MPI_SCS == 2'b00) && (AMW_END_IN == 1'b1))
|
||||
state <= UIM_F1;
|
||||
end
|
||||
|
||||
UIM_F1:
|
||||
begin
|
||||
mux <= 1'b1;
|
||||
state <= UIM_F2;
|
||||
end
|
||||
|
||||
UIM_F2:
|
||||
begin
|
||||
ena <= 1'b1;
|
||||
state <= UIM_F3;
|
||||
end
|
||||
|
||||
UIM_F3:
|
||||
begin
|
||||
rw <= 1'b0;
|
||||
state <= UIM_F4;
|
||||
end
|
||||
|
||||
UIM_F4:
|
||||
begin
|
||||
if (PH_2)
|
||||
begin
|
||||
rw <= 1'b1;
|
||||
state <= UIM_F5;
|
||||
end
|
||||
end
|
||||
|
||||
UIM_F5:
|
||||
begin
|
||||
ena <= 1'b0;
|
||||
state <= UIM_F6;
|
||||
end
|
||||
|
||||
UIM_F6:
|
||||
begin
|
||||
mux <= 1'b0;
|
||||
timer_ena <= 1'b1;
|
||||
state <= UIM_ST_END;
|
||||
end
|
||||
|
||||
UIM_ST_END:
|
||||
begin
|
||||
if (timer[13] == 1'b1)
|
||||
begin
|
||||
AMW_END_OUT_ST <= 1'b1;
|
||||
timer_ena <= 1'b0;
|
||||
end
|
||||
end
|
||||
|
||||
default:;
|
||||
endcase
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
+206
-41
@@ -106,7 +106,7 @@ input ps2_data,
|
||||
|
||||
input [24:0] ps2_mouse,
|
||||
|
||||
input Display_Debug,
|
||||
input SAM_WO,
|
||||
|
||||
// RS-232
|
||||
output UART_TXD,
|
||||
@@ -328,6 +328,7 @@ wire FLASH_CE_S;
|
||||
|
||||
wire ENA_DSK;
|
||||
wire ENA_DISK2;
|
||||
wire ENA_SLT0;
|
||||
wire ENA_PAK;
|
||||
|
||||
wire HDD_EN;
|
||||
@@ -697,10 +698,11 @@ assign BUTTON_N[3:0] = {COCO_RESET_N, 2'b1,EE_N};
|
||||
wire UART_TXD_I;
|
||||
wire UART_RXD_I;
|
||||
|
||||
|
||||
assign UART_TXD = SWITCH[4]? coco_rs232_out:
|
||||
UART_TXD_I;
|
||||
|
||||
assign uart_input = SWITCH[8]? PROBE_I[1]:
|
||||
assign uart_input = ~SWITCH[8]? PROBE_I[1]:
|
||||
UART_RXD;
|
||||
|
||||
|
||||
@@ -801,10 +803,12 @@ assign FLASH_CE_S = ROM_SEL ? 1'b1:
|
||||
ENA_DISK2 ? 1'b1:
|
||||
ENA_PAK ? 1'b1:
|
||||
ENA_DSK ? 1'b1:
|
||||
ENA_SLT0 ? 1'b1:
|
||||
1'b0;
|
||||
|
||||
wire [7:0] COCO3_ROM_DATA;
|
||||
wire [7:0] COCO3_DISK_ROM_DATA;
|
||||
wire [7:0] COCO3_HDB_DISK_ROM_DATA;
|
||||
|
||||
localparam [1:0] BOOT0 = 2'd0;
|
||||
localparam [1:0] BOOT1 = 2'd1;
|
||||
@@ -815,6 +819,7 @@ localparam [5:0] BOOT = 6'd0;
|
||||
|
||||
wire COCO3_ROM_WRITE = (ioctl_index[7:0] == {BOOT0, BOOT}) & ioctl_wr;
|
||||
wire COCO3_DISKROM_WRITE = (ioctl_index[7:0] == {BOOT1, BOOT}) & ioctl_wr;
|
||||
wire COCO3_HDB_DISKROM_WRITE = (ioctl_index[7:0] == {BOOT2, BOOT}) & ioctl_wr;
|
||||
wire COCO3_CART_WRITE = (ioctl_index[5:0] == 6'd1) & ioctl_wr & !cart_lock;
|
||||
|
||||
reg rom_loaded = 1'b0;
|
||||
@@ -826,7 +831,7 @@ begin
|
||||
end
|
||||
|
||||
// A decision.
|
||||
// Looking at this logic it is fairly obvious that the 8Kx8 ROM is not needed.
|
||||
// Looking at this logic it is fairly obvious that the disk 8Kx8 ROM is not needed.
|
||||
// Physically (bus wise) it sits in the same place as the CART rom and is obviously
|
||||
// smaller. I have made these changes at least twice during the development of
|
||||
// this code. While it works and saves the resources of a 8kx8 sram, it does not
|
||||
@@ -857,9 +862,21 @@ COCO_ROM_8K CC3_DISK_ROM(
|
||||
.WRITE(COCO3_DISKROM_WRITE)
|
||||
);
|
||||
|
||||
// DOS Cart for slot 1
|
||||
|
||||
COCO_ROM_8K CC3_HDB_DISK_ROM(
|
||||
.ADDR(FLASH_ADDRESS[12:0]),
|
||||
.DATA(COCO3_HDB_DISK_ROM_DATA),
|
||||
.CLK(~clk_sys),
|
||||
.WR_ADDR(ioctl_addr[12:0]),
|
||||
.WR_DATA(ioctl_data[7:0]),
|
||||
.WRITE(COCO3_HDB_DISKROM_WRITE)
|
||||
);
|
||||
|
||||
|
||||
assign FLASH_DATA = ENA_PAK ? CART_DATA:
|
||||
(ENA_DSK || ENA_DISK2) ? COCO3_DISK_ROM_DATA:
|
||||
ENA_SLT0 ? COCO3_HDB_DISK_ROM_DATA:
|
||||
COCO3_ROM_DATA;
|
||||
|
||||
|
||||
@@ -874,6 +891,9 @@ COCO_ROM_CART CC3_ROM_CART(
|
||||
|
||||
wire SDC_EN_CS;
|
||||
|
||||
assign ENA_SLT0 = ({CART_SEL, MPI_CTS} == 3'b100) ? 1'b1: // Disk C000-DFFF Slot 1
|
||||
1'b0;
|
||||
|
||||
assign ENA_DISK2 = ({CART_SEL, MPI_CTS} == 3'b101) ? 1'b1: // Alternative Disk controller ROM up to 32K
|
||||
1'b0;
|
||||
|
||||
@@ -899,7 +919,10 @@ assign SDC_EN_CS = ({MPI_SCS, ADDRESS[15:5]} == 13'b0111111111010) ? 1'b1:
|
||||
//assign RS232_EN = ({MPI_SCS, ADDRESS[15:2]} == 16'b0011111111011010) ? 1'b1: //FF68-FF6B - Now in slot 1
|
||||
// 1'b0 ;
|
||||
|
||||
assign RS232_EN = ({MPI_SCS[0], ADDRESS[15:2]} == 15'b111111111011010) ? 1'b1: //FF68-FF6B - Now in slot 2 and 4
|
||||
//assign RS232_EN = ({MPI_SCS[0], ADDRESS[15:2]} == 15'b111111111011010) ? 1'b1: //FF68-FF6B - Now in slot 2 and 4
|
||||
// 1'b0;
|
||||
|
||||
assign RS232_EN = (ADDRESS[15:2] == 14'b11111111011010) ? 1'b1: //FF68-FF6B - Now in all slots
|
||||
1'b0;
|
||||
|
||||
assign SLOT3_HW = ({SWITCH[2:1], ADDRESS[15:5]} == 13'b1011111111010) ? 1'b1: // FF40-FF5F Ensure this only appears in slot 3 PHYSICALLY
|
||||
@@ -934,7 +957,7 @@ end
|
||||
|
||||
wire [3:0] Config_FLAG = `Config_Debug_FLAG;
|
||||
wire [7:0] Build_Info;
|
||||
reg [3:0] Build_Info_Count;
|
||||
reg [4:0] Build_Info_Count;
|
||||
reg Build_Info_Read, Build_Info_Read_Delay;
|
||||
|
||||
reg [3:0] i_count;
|
||||
@@ -1002,7 +1025,7 @@ always @(negedge clk_sys or negedge RESET_N)
|
||||
begin
|
||||
if(!RESET_N)
|
||||
begin
|
||||
Build_Info_Count <= 4'b0000;
|
||||
Build_Info_Count <= 5'b00000;
|
||||
Build_Info <= 8'h00;
|
||||
Build_Info_Read <= 1'b0;
|
||||
Build_Info_Read_Delay <= 1'b0;
|
||||
@@ -1015,39 +1038,58 @@ begin
|
||||
Build_Info_Count <= Build_Info_Count + 1'b1;
|
||||
|
||||
case (Build_Info_Count)
|
||||
4'd0:
|
||||
5'd0:
|
||||
Build_Info <= Config_Data[71:64]; // Year MSB
|
||||
4'd1:
|
||||
5'd1:
|
||||
Build_Info <= Config_Data[63:56]; // Year LSB
|
||||
4'd2:
|
||||
5'd2:
|
||||
Build_Info <= Config_Data[55:48]; // Month MSB
|
||||
4'd3:
|
||||
5'd3:
|
||||
Build_Info <= Config_Data[47:40]; // Month LSB
|
||||
4'd4:
|
||||
5'd4:
|
||||
Build_Info <= Config_Data[39:32]; // Day MSB
|
||||
4'd5:
|
||||
5'd5:
|
||||
Build_Info <= Config_Data[31:24]; // Day LSB
|
||||
4'd6:
|
||||
5'd6:
|
||||
Build_Info <= Config_Data[23:16]; // Daily Build ID
|
||||
4'd7:
|
||||
5'd7:
|
||||
Build_Info <= Config_Data[15:8]; // Daily Build ID
|
||||
4'd8:
|
||||
5'd8:
|
||||
Build_Info <= Config_Data[7:0]; // Daily Build ID
|
||||
4'd9:
|
||||
5'd9:
|
||||
`ifdef Config_Debug
|
||||
Build_Info <= {4'b1111, Config_FLAG};
|
||||
`else
|
||||
Build_Info <= {4'b0000, Config_FLAG};
|
||||
`endif
|
||||
4'd10:
|
||||
5'd10:
|
||||
Build_Info <= i_val;
|
||||
4'd11:
|
||||
5'd11:
|
||||
Build_Info <= {Config_FLAG, sdram_sz[15], 1'b0, sdram_sz[1:0]};
|
||||
4'd12:
|
||||
5'd12:
|
||||
Build_Info <= Version_Hi;
|
||||
4'd13:
|
||||
5'd13:
|
||||
Build_Info <= (Version_Lo + BOARD_TYPE);
|
||||
|
||||
// RTC Moved here so not to collide with SAM reads
|
||||
|
||||
5'd14:
|
||||
Build_Info <= {3'b000, CENT};
|
||||
5'd15:
|
||||
Build_Info <= {1'b0, YEAR};
|
||||
5'd16:
|
||||
Build_Info <= {4'b0000, MNTH};
|
||||
5'd17:
|
||||
Build_Info <= {3'b000, DMTH};
|
||||
5'd18:
|
||||
Build_Info <= {5'b00000, DWK};
|
||||
5'd19:
|
||||
Build_Info <= {3'b000, HOUR};
|
||||
5'd20:
|
||||
Build_Info <= {2'b00, MIN};
|
||||
5'd21:
|
||||
Build_Info <= {2'b00, SEC};
|
||||
|
||||
default:
|
||||
Build_Info <= 8'h00;
|
||||
endcase
|
||||
@@ -1149,16 +1191,6 @@ assign DATA_IN =
|
||||
(ADDRESS == 16'hFFBD) ? {2'b00, PALETTE[13][5:0]}:
|
||||
(ADDRESS == 16'hFFBE) ? {2'b00, PALETTE[14][5:0]}:
|
||||
(ADDRESS == 16'hFFBF) ? {2'b00, PALETTE[15][5:0]}:
|
||||
(ADDRESS == 16'hFFC0) ? {3'b000, CENT}:
|
||||
(ADDRESS == 16'hFFC1) ? {1'b0, YEAR}:
|
||||
(ADDRESS == 16'hFFC2) ? {4'h0, MNTH}:
|
||||
(ADDRESS == 16'hFFC3) ? {3'b000, DMTH}:
|
||||
(ADDRESS == 16'hFFC4) ? {5'b00000, DWK}:
|
||||
(ADDRESS == 16'hFFC5) ? {3'b000, HOUR}:
|
||||
(ADDRESS == 16'hFFC6) ? {2'b00, MIN}:
|
||||
(ADDRESS == 16'hFFC7) ? {2'b00, SEC}:
|
||||
|
||||
(ADDRESS == 16'hFFD9) ? {5'h00, RATE_PGM}:
|
||||
|
||||
(ADDRESS == 16'hFFEF) ? Build_Info:
|
||||
8'hAA;
|
||||
@@ -1203,7 +1235,7 @@ wire AMW_EN;
|
||||
wire AMW_Ready;
|
||||
wire AMW_End;
|
||||
|
||||
assign AMW_ACK = AMW_End;
|
||||
//assign AMW_ACK = AMW_End;
|
||||
|
||||
AMW coco_AMW (
|
||||
.CLK(clk_sys),
|
||||
@@ -3531,19 +3563,125 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
if(ADDRESS == 16'hFFE8)
|
||||
// Register reads
|
||||
if (~SAM_WO)
|
||||
begin
|
||||
case (ADDRESS)
|
||||
16'hFFC0:
|
||||
begin
|
||||
V[0] <= 1'b0;
|
||||
end
|
||||
16'hFFC1:
|
||||
begin
|
||||
V[0] <= 1'b1;
|
||||
end
|
||||
16'hFFC2:
|
||||
begin
|
||||
V[1] <= 1'b0;
|
||||
end
|
||||
16'hFFC3:
|
||||
begin
|
||||
V[1] <= 1'b1;
|
||||
end
|
||||
16'hFFC4:
|
||||
begin
|
||||
V[2] <= 1'b0;
|
||||
end
|
||||
16'hFFC5:
|
||||
begin
|
||||
V[2] <= 1'b1;
|
||||
end
|
||||
16'hFFC6:
|
||||
begin
|
||||
VERT[0] <= 1'b0;
|
||||
end
|
||||
16'hFFC7:
|
||||
begin
|
||||
VERT[0] <= 1'b1;
|
||||
end
|
||||
16'hFFC8:
|
||||
begin
|
||||
VERT[1] <= 1'b0;
|
||||
end
|
||||
16'hFFC9:
|
||||
begin
|
||||
VERT[1] <= 1'b1;
|
||||
end
|
||||
16'hFFCA:
|
||||
begin
|
||||
VERT[2] <= 1'b0;
|
||||
end
|
||||
16'hFFCB:
|
||||
begin
|
||||
VERT[2] <= 1'b1;
|
||||
end
|
||||
16'hFFCC:
|
||||
begin
|
||||
VERT[3] <= 1'b0;
|
||||
end
|
||||
16'hFFCD:
|
||||
begin
|
||||
VERT[3] <= 1'b1;
|
||||
end
|
||||
16'hFFCE:
|
||||
begin
|
||||
VERT[4] <= 1'b0;
|
||||
end
|
||||
16'hFFCF:
|
||||
begin
|
||||
VERT[4] <= 1'b1;
|
||||
end
|
||||
16'hFFD0:
|
||||
begin
|
||||
VERT[5] <= 1'b0;
|
||||
end
|
||||
16'hFFD1:
|
||||
begin
|
||||
VERT[5] <= 1'b1;
|
||||
end
|
||||
16'hFFD2:
|
||||
begin
|
||||
VERT[6] <= 1'b0;
|
||||
end
|
||||
16'hFFD3:
|
||||
begin
|
||||
VERT[6] <= 1'b1;
|
||||
end
|
||||
16'hFFD8:
|
||||
begin
|
||||
RATE <= 1'b0;
|
||||
RATE_PGM <= 3'b010;
|
||||
end
|
||||
16'hFFD9:
|
||||
begin
|
||||
RATE <= 1'b1;
|
||||
RATE_PGM <= 3'b010; // Normal Turbo
|
||||
end
|
||||
16'hFFDE:
|
||||
begin
|
||||
RAM <= 1'b0;
|
||||
end
|
||||
16'hFFDF:
|
||||
begin
|
||||
RAM <= 1'b1;
|
||||
end
|
||||
endcase
|
||||
end
|
||||
|
||||
case (ADDRESS)
|
||||
|
||||
16'hFFE8:
|
||||
begin
|
||||
if(GART_INC[1])
|
||||
GART_READ <= GART_READ + 1'b1;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if(ADDRESS == 16'hFFE9)
|
||||
|
||||
16'hFFE9:
|
||||
begin
|
||||
if(GART_INC[1])
|
||||
GART_READ <= GART_READ + 1'b1;
|
||||
end
|
||||
end
|
||||
endcase
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -4218,6 +4356,33 @@ begin
|
||||
end
|
||||
|
||||
|
||||
UIM UIM_COCO3(
|
||||
.CLK(clk_sys),
|
||||
.RESET_N(RESET_N),
|
||||
|
||||
.MPI_SCS(MPI_SCS),
|
||||
.PH_2(PH_2),
|
||||
|
||||
.AMW_END_IN(AMW_End),
|
||||
.ENABLE_IN(RS232_EN),
|
||||
.RW_N_IN(RW_N),
|
||||
|
||||
.ADDRESS_IN(ADDRESS[1:0]),
|
||||
.DATA_IN(DATA_OUT),
|
||||
|
||||
.AMW_END_OUT(AMW_ACK),
|
||||
.ENABLE_OUT(RS232_EN_ST),
|
||||
.RW_N_OUT(RW_N_ST),
|
||||
|
||||
.ADDRESS_OUT(ADDRESS_ST),
|
||||
.DATA_OUT(DATA_OUT_ST)
|
||||
);
|
||||
|
||||
wire RS232_EN_ST;
|
||||
wire RW_N_ST;
|
||||
wire [1:0] ADDRESS_ST;
|
||||
wire [7:0] DATA_OUT_ST;
|
||||
|
||||
// RS232PAK UART
|
||||
glb6551 RS232(
|
||||
.RESET_N(RESET_N),
|
||||
@@ -4226,12 +4391,12 @@ glb6551 RS232(
|
||||
.RX_CLK_IN(CLK_6551_EN), // These are now enables
|
||||
.XTAL_CLK_IN(CLK_6551_EN),
|
||||
.PH_2(PH_2),
|
||||
.DI(DATA_OUT),
|
||||
.DI(DATA_OUT_ST),
|
||||
.DO(DATA_RS232),
|
||||
.IRQ(SER_IRQ),
|
||||
.CS({1'b0, RS232_EN}),
|
||||
.RW_N(RW_N),
|
||||
.RS(ADDRESS[1:0]),
|
||||
.CS({1'b0, RS232_EN_ST}),
|
||||
.RW_N(RW_N_ST),
|
||||
.RS(ADDRESS_ST[1:0]),
|
||||
.TXDATA_OUT(UART_TXD_I),
|
||||
.RXDATA_IN(UART_RXD_I),
|
||||
.RTS(UART_RTS),
|
||||
@@ -4298,7 +4463,7 @@ ovo #(.COLS(32), .LINES(23)) NOROMOVO
|
||||
.i_Hcount({1'b0, PIXEL_COUNT[10:1]}),
|
||||
.i_VCount(LINE),
|
||||
.o_r(CN_R),
|
||||
.ena(Display_Debug || ((!rom_loaded) && SEC[0])),
|
||||
.ena((!rom_loaded) && SEC[0]),
|
||||
.in0(NOrom1),
|
||||
.in1(NOrom2)
|
||||
);
|
||||
|
||||
@@ -84,6 +84,11 @@ reg [8:0] read_count;
|
||||
reg [4:0] state;
|
||||
reg second_write;
|
||||
reg init_offset_a0;
|
||||
// End-of-line test for the fetch being requested, registered in state_start.
|
||||
// read_count only changes on SDRAM_VID_ACK, so this equals the old in-line
|
||||
// compare; it takes the 9-bit compare off the ACK -> VID_READ_OFFSET path,
|
||||
// which missed timing at 114 MHz.
|
||||
reg last_fetch;
|
||||
reg [4:0] a0_delay;
|
||||
|
||||
localparam state_pre_start = 4'd0;
|
||||
@@ -161,6 +166,7 @@ begin
|
||||
SDRAM_VID_REQ <= 1'b1;
|
||||
state <= state_wait_accept;
|
||||
init_offset_a0 <= PHY_VID_ADD[1];
|
||||
last_fetch <= (read_count >= WORD_END_COUNT);
|
||||
end
|
||||
end
|
||||
|
||||
@@ -170,7 +176,8 @@ begin
|
||||
begin
|
||||
SDRAM_VID_REQ <= 1'b0;
|
||||
|
||||
if (read_count >= WORD_END_COUNT)
|
||||
// if (read_count >= WORD_END_COUNT)
|
||||
if (last_fetch)
|
||||
begin
|
||||
read_count <= 9'h000;
|
||||
state <= state_done;
|
||||
|
||||
+8
-2
@@ -99,6 +99,7 @@ reg [1:0] wd_size_code;
|
||||
wire [7:0] buff_dout;
|
||||
reg [1:0] sd_block = 0;
|
||||
reg format;
|
||||
reg buff_wr;
|
||||
generate
|
||||
if(RWMODE) begin
|
||||
wd1793_dpram sbuf
|
||||
@@ -115,7 +116,6 @@ generate
|
||||
.wren_b(wre & buff_wr & (addr == A_DATA) & ~scan_active),
|
||||
.q_b(buff_dout)
|
||||
);
|
||||
reg buff_wr;
|
||||
end else begin
|
||||
assign buff_dout = 0;
|
||||
assign sd_buff_din = 0;
|
||||
@@ -788,13 +788,19 @@ wire[10:0] edsk_next = ((edsk_addr + 1'd1) >= edsk_size) ? 11'd0 : edsk_addr + 1
|
||||
|
||||
reg [7:0] spt_size = 0;
|
||||
|
||||
// spt_addr is assigned from the always block above, outside the
|
||||
// `generate if(EDSK)` scope it used to be declared in. Quartus tolerates that,
|
||||
// but Verilator rejects it ("Can't find definition of variable: 'spt_addr'"),
|
||||
// so it lives at module scope, next to spt_size. No behavioural change.
|
||||
reg [7:0] spt_addr;
|
||||
|
||||
generate
|
||||
if(EDSK) begin
|
||||
wire [7:0] scan_data = RWMODE ? buff_dout : input_data;
|
||||
reg [53:0] edsk[1992];
|
||||
reg [7:0] spt[166];
|
||||
|
||||
reg [7:0] spt_addr;
|
||||
// reg [7:0] spt_addr;
|
||||
always @(posedge clk_sys) begin
|
||||
{edsk_track,edsk_side,edsk_trackf,edsk_sidef,edsk_sector,edsk_sizecode,edsk_offset} <= edsk[edsk_addr];
|
||||
edsk_spt <= spt[spt_addr];
|
||||
|
||||
Reference in new issue
Block a user