mirror of
https://github.com/MiSTer-devel/InputTest_MiSTer.git
synced 2026-04-19 03:04:18 +00:00
Clock fixes etc
This commit is contained in:
20
InputTest.sv
20
InputTest.sv
@@ -294,8 +294,6 @@ hps_io #(.CONF_STR(CONF_STR)) hps_io
|
||||
//////////////////// CLOCKS ///////////////////
|
||||
|
||||
wire clk_sys;
|
||||
reg ce_pix;
|
||||
|
||||
pll pll
|
||||
(
|
||||
.refclk(CLK_50M),
|
||||
@@ -303,15 +301,13 @@ pll pll
|
||||
.outclk_0(clk_sys)
|
||||
);
|
||||
|
||||
|
||||
/////////////////// CLOCK DIVIDER ////////////////////
|
||||
|
||||
always @(posedge clk_sys) begin
|
||||
reg div;
|
||||
div <= div + 1'd1;
|
||||
ce_pix <= !div;
|
||||
end
|
||||
|
||||
wire ce_pix;
|
||||
jtframe_cen24 divider
|
||||
(
|
||||
.clk(clk_sys),
|
||||
.cen4(ce_pix)
|
||||
);
|
||||
|
||||
/////////////////// VIDEO ////////////////////
|
||||
wire hblank, vblank;
|
||||
@@ -321,7 +317,7 @@ wire [7:0] r;
|
||||
wire [7:0] g;
|
||||
wire [7:0] b;
|
||||
wire [23:0] rgb = {r,g,b};
|
||||
arcade_video #(224,24) arcade_video
|
||||
arcade_video #(320,24) arcade_video
|
||||
(
|
||||
.*,
|
||||
.clk_video(clk_sys),
|
||||
@@ -357,7 +353,7 @@ system system(
|
||||
.joystick({joystick_5,joystick_4,joystick_3,joystick_2,joystick_1,joystick_0}),
|
||||
.analog({joystick_analog_5,joystick_analog_4,joystick_analog_3,joystick_analog_2,joystick_analog_1,joystick_analog_0}),
|
||||
.paddle({paddle_5,paddle_4,paddle_3,paddle_2,paddle_1,paddle_0}),
|
||||
.spinner({spinner_5,spinner_4,spinner_3,spinner_2,spinner_1,spinner_0})
|
||||
.spinner({7'b0,spinner_5,7'b0,spinner_4,7'b0,spinner_3,7'b0,spinner_2,7'b0,spinner_1,7'b0,spinner_0})
|
||||
);
|
||||
|
||||
endmodule
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -37,7 +37,7 @@ module jtframe_cen24(
|
||||
);
|
||||
|
||||
reg [3:0] cencnt =4'd0;
|
||||
reg [2:0] cencnt3=2'd0;
|
||||
reg [2:0] cencnt3=3'd0;
|
||||
reg [2:0] cencnt8=3'd1;
|
||||
|
||||
assign cen8 = cencnt8[2];
|
||||
|
||||
10
rtl/pll.qip
10
rtl/pll.qip
@@ -41,11 +41,11 @@ set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAM
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2ZyYWNfbXVsdGlwbHlfZmFjdG9y::MQ==::RnJhY3Rpb25hbCBNdWx0aXBseSBGYWN0b3IgKEsp"
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2RpdmlkZV9mYWN0b3Jfbg==::MQ==::RGl2aWRlIEZhY3RvciAoTi1Db3VudGVyKQ=="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2Nhc2NhZGVfY291bnRlcjA=::ZmFsc2U=::TWFrZSB0aGlzIGEgY2FzY2FkZSBjb3VudGVy"
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX291dHB1dF9jbG9ja19mcmVxdWVuY3kw::NC41::RGVzaXJlZCBGcmVxdWVuY3k="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX291dHB1dF9jbG9ja19mcmVxdWVuY3kw::MjQuMA==::RGVzaXJlZCBGcmVxdWVuY3k="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2RpdmlkZV9mYWN0b3JfYzA=::MQ==::RGl2aWRlIEZhY3RvciAoQy1Db3VudGVyKQ=="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2FjdHVhbF9tdWx0aXBseV9mYWN0b3Iw::Mjc=::QWN0dWFsIE11bHRpcGx5IEZhY3Rvcg=="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2FjdHVhbF9tdWx0aXBseV9mYWN0b3Iw::MzY=::QWN0dWFsIE11bHRpcGx5IEZhY3Rvcg=="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2FjdHVhbF9mcmFjX211bHRpcGx5X2ZhY3RvcjA=::MQ==::QWN0dWFsIEZyYWN0aW9uYWwgTXVsdGlwbHkgRmFjdG9yIChLKQ=="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2FjdHVhbF9kaXZpZGVfZmFjdG9yMA==::MzAw::QWN0dWFsIERpdmlkZSBGYWN0b3I="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2FjdHVhbF9kaXZpZGVfZmFjdG9yMA==::NzU=::QWN0dWFsIERpdmlkZSBGYWN0b3I="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2FjdHVhbF9vdXRwdXRfY2xvY2tfZnJlcXVlbmN5MA==::MCBNSHo=::QWN0dWFsIEZyZXF1ZW5jeQ=="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX3BzX3VuaXRzMA==::cHM=::UGhhc2UgU2hpZnQgdW5pdHM="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX3BoYXNlX3NoaWZ0MA==::MA==::UGhhc2UgU2hpZnQ="
|
||||
@@ -256,7 +256,7 @@ set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAM
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX3BoYXNlX3NoaWZ0X2RlZzE3::MC4w::UGhhc2UgU2hpZnQ="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2FjdHVhbF9waGFzZV9zaGlmdDE3::MA==::QWN0dWFsIFBoYXNlIFNoaWZ0"
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2R1dHlfY3ljbGUxNw==::NTA=::RHV0eSBDeWNsZQ=="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "b3V0cHV0X2Nsb2NrX2ZyZXF1ZW5jeTA=::NC41MDAwMDAgTUh6::b3V0cHV0X2Nsb2NrX2ZyZXF1ZW5jeTA="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "b3V0cHV0X2Nsb2NrX2ZyZXF1ZW5jeTA=::MjQuMDAwMDAwIE1Ieg==::b3V0cHV0X2Nsb2NrX2ZyZXF1ZW5jeTA="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "cGhhc2Vfc2hpZnQw::MCBwcw==::cGhhc2Vfc2hpZnQw"
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "ZHV0eV9jeWNsZTA=::NTA=::ZHV0eV9jeWNsZTA="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "b3V0cHV0X2Nsb2NrX2ZyZXF1ZW5jeTE=::MCBNSHo=::b3V0cHV0X2Nsb2NrX2ZyZXF1ZW5jeTE="
|
||||
@@ -318,7 +318,7 @@ set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAM
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "cGxsX3R5cGU=::R2VuZXJhbA==::UExMIFRZUEU="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "cGxsX3N1YnR5cGU=::R2VuZXJhbA==::UExMIFNVQlRZUEU="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX3BhcmFtZXRlcl9saXN0::TS1Db3VudGVyIEhpIERpdmlkZSxNLUNvdW50ZXIgTG93IERpdmlkZSxOLUNvdW50ZXIgSGkgRGl2aWRlLE4tQ291bnRlciBMb3cgRGl2aWRlLE0tQ291bnRlciBCeXBhc3MgRW5hYmxlLE4tQ291bnRlciBCeXBhc3MgRW5hYmxlLE0tQ291bnRlciBPZGQgRGl2aWRlIEVuYWJsZSxOLUNvdW50ZXIgT2RkIERpdmlkZSBFbmFibGUsQy1Db3VudGVyLTAgSGkgRGl2aWRlLEMtQ291bnRlci0wIExvdyBEaXZpZGUsQy1Db3VudGVyLTAgQ29hcnNlIFBoYXNlIFNoaWZ0LEMtQ291bnRlci0wIFZDTyBQaGFzZSBUYXAsQy1Db3VudGVyLTAgSW5wdXQgU291cmNlLEMtQ291bnRlci0wIEJ5cGFzcyBFbmFibGUsQy1Db3VudGVyLTAgT2RkIERpdmlkZSBFbmFibGUsVkNPIFBvc3QgRGl2aWRlIENvdW50ZXIgRW5hYmxlLENoYXJnZSBQdW1wIGN1cnJlbnQgKHVBKSxMb29wIEZpbHRlciBCYW5kd2lkdGggUmVzaXN0b3IgKE9obXMpICxQTEwgT3V0cHV0IFZDTyBGcmVxdWVuY3ksSy1GcmFjdGlvbmFsIERpdmlzaW9uIFZhbHVlIChEU00pLEZlZWRiYWNrIENsb2NrIFR5cGUsRmVlZGJhY2sgQ2xvY2sgTVVYIDEsRmVlZGJhY2sgQ2xvY2sgTVVYIDIsTSBDb3VudGVyIFNvdXJjZSBNVVgsUExMIEF1dG8gUmVzZXQ=::UGFyYW1ldGVyIE5hbWVz"
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX3BhcmFtZXRlcl92YWx1ZXM=::MTQsMTMsMiwyLGZhbHNlLGZhbHNlLHRydWUsZmFsc2UsMzgsMzcsMSwwLHBoX211eF9jbGssZmFsc2UsdHJ1ZSwyLDIwLDYwMDAsMzM3LjUgTUh6LDEsbm9uZSxnbGIsbV9jbnQscGhfbXV4X2Nsayx0cnVl::UGFyYW1ldGVyIFZhbHVlcw=="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX3BhcmFtZXRlcl92YWx1ZXM=::MTgsMTgsMywyLGZhbHNlLGZhbHNlLGZhbHNlLHRydWUsOCw3LDEsMCxwaF9tdXhfY2xrLGZhbHNlLHRydWUsMiwyMCwxMDAwMCwzNjAuMCBNSHosMSxub25lLGdsYixtX2NudCxwaF9tdXhfY2xrLHRydWU=::UGFyYW1ldGVyIFZhbHVlcw=="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX21pZl9nZW5lcmF0ZQ==::ZmFsc2U=::R2VuZXJhdGUgTUlGIGZpbGU="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2VuYWJsZV9taWZfZHBz::ZmFsc2U=::RW5hYmxlIER5bmFtaWMgUGhhc2UgU2hpZnQgZm9yIE1JRiBzdHJlYW1pbmc="
|
||||
set_global_assignment -entity "pll_0002" -library "pll" -name IP_COMPONENT_PARAMETER "Z3VpX2Rwc19jbnRy::QzA=::RFBTIENvdW50ZXIgU2VsZWN0aW9u"
|
||||
|
||||
@@ -66,7 +66,7 @@ endmodule
|
||||
// Retrieval info: <generic name="gui_frac_multiply_factor" value="1" />
|
||||
// Retrieval info: <generic name="gui_divide_factor_n" value="1" />
|
||||
// Retrieval info: <generic name="gui_cascade_counter0" value="false" />
|
||||
// Retrieval info: <generic name="gui_output_clock_frequency0" value="4.5" />
|
||||
// Retrieval info: <generic name="gui_output_clock_frequency0" value="24.0" />
|
||||
// Retrieval info: <generic name="gui_divide_factor_c0" value="1" />
|
||||
// Retrieval info: <generic name="gui_actual_output_clock_frequency0" value="0 MHz" />
|
||||
// Retrieval info: <generic name="gui_ps_units0" value="ps" />
|
||||
|
||||
@@ -19,7 +19,7 @@ module pll_0002(
|
||||
.reference_clock_frequency("50.0 MHz"),
|
||||
.operation_mode("direct"),
|
||||
.number_of_clocks(1),
|
||||
.output_clock_frequency0("4.500000 MHz"),
|
||||
.output_clock_frequency0("24.000000 MHz"),
|
||||
.phase_shift0("0 ps"),
|
||||
.duty_cycle0(50),
|
||||
.output_clock_frequency1("0 MHz"),
|
||||
|
||||
13
rtl/system.v
13
rtl/system.v
@@ -17,8 +17,8 @@ module system (
|
||||
// 6 devices, 8 bits each - paddle 0..255
|
||||
input [47:0] paddle,
|
||||
|
||||
// 6 devices, 9 bits eachspinner [7:0] -128..+127, [8] - toggle with every update
|
||||
input [53:0] spinner,
|
||||
// 6 devices, 16 bits eachspinner [7:0] -128..+127, [8] - toggle with every update, [9-15] padding
|
||||
input [95:0] spinner,
|
||||
|
||||
output VGA_HS,
|
||||
output VGA_VS,
|
||||
@@ -45,8 +45,8 @@ wire vinit;
|
||||
|
||||
// Display timing module from JTFRAME
|
||||
jtframe_vtimer #(
|
||||
.HB_START(VGA_WIDTH),
|
||||
.VB_START(VGA_HEIGHT)
|
||||
.HB_START(VGA_WIDTH - 1'b1),
|
||||
.VB_START(VGA_HEIGHT- 1'b1)
|
||||
) vtimer
|
||||
(
|
||||
.clk(clk_sys),
|
||||
@@ -62,7 +62,7 @@ jtframe_vtimer #(
|
||||
);
|
||||
|
||||
// Character map
|
||||
wire [3:0] chpos_x = 4'd9 - hcnt[2:0];
|
||||
wire [3:0] chpos_x = 4'd7 - hcnt[2:0];
|
||||
wire [2:0] chpos_y = vcnt[2:0];
|
||||
wire [5:0] chram_x = hcnt[8:3];
|
||||
wire [5:0] chram_y = vcnt[8:3];
|
||||
@@ -118,7 +118,7 @@ wire [7:0] in0_data_out = {VGA_HS, VGA_VS, 6'b101000};
|
||||
wire [7:0] joystick_data_out = joystick[cpu_addr[7:0] +: 8];
|
||||
wire [7:0] analog_data_out = analog[cpu_addr[6:0] +: 8];
|
||||
wire [7:0] paddle_data_out = paddle[cpu_addr[5:0] +: 8];
|
||||
wire [7:0] spinner_data_out = spinner[cpu_addr[5:0] +: 8];
|
||||
wire [7:0] spinner_data_out = spinner[cpu_addr[6:0] +: 8];
|
||||
|
||||
// CPU address decodes
|
||||
wire pgrom_cs = cpu_addr[15:14] == 2'b00;
|
||||
@@ -140,6 +140,7 @@ always @(posedge clk_sys) begin
|
||||
// if(in0_cs) $display("%x in0 i %x o %x", cpu_addr, cpu_dout, in0_data_out);
|
||||
//if(joystick_cs) $display("joystick %b %b", joystick_bit, joystick_data_out);
|
||||
//if(analog_cs) $display("analog %b %b", analog_bit, analog_data_out);
|
||||
//if(paddle_cs) $display("paddle %b", paddle_data_out);
|
||||
// $display("%x", cpu_addr);
|
||||
end
|
||||
|
||||
|
||||
784
src/boot_rom.asm
784
src/boot_rom.asm
File diff suppressed because it is too large
Load Diff
BIN
src/boot_rom.bin
BIN
src/boot_rom.bin
Binary file not shown.
@@ -5,7 +5,9 @@
|
||||
// Memory maps
|
||||
unsigned char __at(0x6000) input0;
|
||||
unsigned char __at(0x7000) joystick[24];
|
||||
unsigned char __at(0x7100) analog[24];
|
||||
unsigned char __at(0x7100) analog[12];
|
||||
unsigned char __at(0x7200) paddle[6];
|
||||
unsigned char __at(0x7300) spinner[12];
|
||||
unsigned char __at(0x8000) chram[2048];
|
||||
unsigned char __at(0x8800) colram[2048];
|
||||
|
||||
@@ -69,13 +71,20 @@ void page_inputs()
|
||||
clear_chars();
|
||||
page_border(0b00000111);
|
||||
write_string("UDLRABCXYZLRSs", 0xFF, 7, 3);
|
||||
write_string("AX AY", 0xFF, 25, 3);
|
||||
write_string("AX", 0xFF, 26, 3);
|
||||
write_string("AY", 0xFF, 31, 3);
|
||||
|
||||
char label[5];
|
||||
for (unsigned char j = 0; j < 6; j++)
|
||||
{
|
||||
sprintf(label, "JOY%d", j + 1);
|
||||
write_string(label, 0xFF - (j*2), 2, 4 + j);
|
||||
write_string(label, 0xFF - (j * 2), 2, 4 + j);
|
||||
|
||||
sprintf(label, "PAD%d", j + 1);
|
||||
write_string(label, 0xFF - (j * 2), 2, 11 + j);
|
||||
|
||||
sprintf(label, "SPN%d", j + 1);
|
||||
write_string(label, 0xFF - (j * 2), 2, 18 + j);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +105,8 @@ void main()
|
||||
// if(hsync && !hsync_last){
|
||||
// }
|
||||
|
||||
char j = 0;
|
||||
|
||||
if (vsync && !vsync_last)
|
||||
{
|
||||
color++;
|
||||
@@ -107,7 +118,7 @@ void main()
|
||||
for (char i = 0; i < 8; i++)
|
||||
{
|
||||
char x = 7 + i + (b * 8);
|
||||
for (char j = 0; j < 6; j++)
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
write_char((joystick[(b * 8) + (j * 32)] & m) ? asc_1 : asc_0, 0xFF, x, 4 + j);
|
||||
}
|
||||
@@ -116,26 +127,47 @@ void main()
|
||||
}
|
||||
|
||||
y = 4;
|
||||
|
||||
// ANALOG
|
||||
char m = 0b00000001;
|
||||
char str1[4];
|
||||
char str2[4];
|
||||
for (char j = 0; j < 6; j++)
|
||||
char stra[10];
|
||||
// char stra2[5];
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
signed char jx = analog[(j * 16)];
|
||||
signed char jy = analog[(j * 16) + 8];
|
||||
|
||||
sprintf(str1, "%4d", jx);
|
||||
write_string(str1, 0xFF, 23, y + j);
|
||||
sprintf(str2, "%-4d", jy);
|
||||
write_string(str2, 0xFF, 28, y + j);
|
||||
|
||||
sprintf(stra, "%4d %4d", jx, jy);
|
||||
write_string(stra, 0xFF, 24, y + j);
|
||||
// sprintf(stra2, "%-4d", jy);
|
||||
// write_string(stra2, 0xFF, 29, y + j);
|
||||
m <<= 1;
|
||||
}
|
||||
|
||||
// PADDLE
|
||||
y = 11;
|
||||
m = 0b00000001;
|
||||
char strp[3];
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
char px = paddle[(j * 8)];
|
||||
sprintf(strp, "%4d", px);
|
||||
write_string(strp, 0xFF, 6, y + j);
|
||||
m <<= 1;
|
||||
}
|
||||
|
||||
// ADD THE PADDLES AND SPINNERS HERE
|
||||
|
||||
// SPINNER
|
||||
y = 18;
|
||||
m = 0b00000001;
|
||||
char strs[3];
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
signed char sx = spinner[(j * 16)];
|
||||
sprintf(strs, "%4d", sx);
|
||||
write_string(strs, 0xFF, 7, y + j);
|
||||
m <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
hsync_last = hsync;
|
||||
vsync_last = vsync;
|
||||
}
|
||||
|
||||
1743
src/boot_rom.lst
1743
src/boot_rom.lst
File diff suppressed because it is too large
Load Diff
@@ -42,28 +42,39 @@ Area Addr Size Decimal Bytes (A
|
||||
0000000C l__HEADER8
|
||||
0000000F l__GSINIT
|
||||
00000200 s__CODE
|
||||
00001098 l__CODE
|
||||
00001298 s__HOME
|
||||
00001298 s__INITIALIZER
|
||||
0000129A s__GSINIT
|
||||
000012A9 s__GSFINAL
|
||||
00001238 l__CODE
|
||||
00001438 s__HOME
|
||||
00001438 s__INITIALIZER
|
||||
0000143A s__GSINIT
|
||||
00001449 s__GSFINAL
|
||||
00006000 _input0 boot_rom
|
||||
00007000 _joystick boot_rom
|
||||
00007100 _analog boot_rom
|
||||
00007200 _paddle boot_rom
|
||||
00007300 _spinner boot_rom
|
||||
00008000 _chram boot_rom
|
||||
00008800 _colram boot_rom
|
||||
0000C000 s__DATA
|
||||
0000C006 s__INITIALIZED
|
||||
0000C008 s__BSEG
|
||||
0000C008 s__BSS
|
||||
0000C008 s__HEAP
|
||||
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 2.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
-------------------------------- ---- ---- ------- ----- ------------
|
||||
_CODE 00000200 00001098 = 4248. bytes (REL,CON)
|
||||
. .ABS. 00000000 00000000 = 0. bytes (ABS,CON)
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
0000C008 s__BSS
|
||||
0000C008 s__HEAP
|
||||
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 3.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
-------------------------------- ---- ---- ------- ----- ------------
|
||||
_CODE 00000200 00001238 = 4664. bytes (REL,CON)
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
@@ -76,16 +87,16 @@ _CODE 00000200 00001098 = 4248. bytes (R
|
||||
0000027E _write_char boot_rom
|
||||
000002B7 _page_border boot_rom
|
||||
00000382 _page_inputs boot_rom
|
||||
00000450 _main boot_rom
|
||||
00000665 __mulint
|
||||
0000066B __mul16
|
||||
0000069F _vsprintf sprintf
|
||||
000006D4 _sprintf sprintf
|
||||
00000708 _strlen
|
||||
00000832 __print_format printf_large
|
||||
00001297 ___sdcc_call_hl
|
||||
0000052A _main boot_rom
|
||||
00000805 __mulint
|
||||
0000080B __mul16
|
||||
0000083F _vsprintf sprintf
|
||||
00000874 _sprintf sprintf
|
||||
000008A8 _strlen
|
||||
000009D2 __print_format printf_large
|
||||
00001437 ___sdcc_call_hl
|
||||
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 3.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 4.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
@@ -94,7 +105,7 @@ _HEADER0 00000000 00000003 = 3. bytes (A
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 4.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 5.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
@@ -103,7 +114,7 @@ _HEADER1 00000000 00000004 = 4. bytes (A
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 5.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 6.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
@@ -112,7 +123,7 @@ _HEADER2 00000000 00000003 = 3. bytes (A
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 6.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 7.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
@@ -121,7 +132,7 @@ _HEADER3 00000000 00000003 = 3. bytes (A
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 7.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 8.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
@@ -130,7 +141,7 @@ _HEADER4 00000000 00000003 = 3. bytes (A
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 8.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 9.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
@@ -139,7 +150,7 @@ _HEADER5 00000000 00000003 = 3. bytes (A
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 9.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 10.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
@@ -148,7 +159,7 @@ _HEADER6 00000000 00000003 = 3. bytes (A
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 10.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 11.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
@@ -157,22 +168,13 @@ _HEADER7 00000000 00000003 = 3. bytes (A
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 11.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 12.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
-------------------------------- ---- ---- ------- ----- ------------
|
||||
_HEADER8 00000000 0000000C = 12. bytes (ABS,CON)
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 12.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
-------------------------------- ---- ---- ------- ----- ------------
|
||||
_INITIALIZER 00001298 00000002 = 2. bytes (REL,CON)
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 13.
|
||||
@@ -180,24 +182,33 @@ Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
-------------------------------- ---- ---- ------- ----- ------------
|
||||
_GSINIT 0000129A 0000000F = 15. bytes (REL,CON)
|
||||
_INITIALIZER 00001438 00000002 = 2. bytes (REL,CON)
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
0000129A gsinit crt0
|
||||
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 14.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
-------------------------------- ---- ---- ------- ----- ------------
|
||||
_GSFINAL 000012A9 00000001 = 1. bytes (REL,CON)
|
||||
_GSINIT 0000143A 0000000F = 15. bytes (REL,CON)
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
0000143A gsinit crt0
|
||||
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 15.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
-------------------------------- ---- ---- ------- ----- ------------
|
||||
_GSFINAL 00001449 00000001 = 1. bytes (REL,CON)
|
||||
|
||||
Value Global Global Defined In Module
|
||||
----- -------------------------------- ------------------------
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 16.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
-------------------------------- ---- ---- ------- ----- ------------
|
||||
_DATA 0000C000 00000006 = 6. bytes (REL,CON)
|
||||
@@ -210,7 +221,7 @@ _DATA 0000C000 00000006 = 6. bytes (R
|
||||
0000C004 _vsync boot_rom
|
||||
0000C005 _vsync_last boot_rom
|
||||
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 16.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 17.
|
||||
Hexadecimal [32-Bits]
|
||||
|
||||
Area Addr Size Decimal Bytes (Attributes)
|
||||
@@ -222,7 +233,7 @@ _INITIALIZED 0000C006 00000002 = 2. bytes (R
|
||||
0000C006 _asc_0 boot_rom
|
||||
0000C007 _asc_1 boot_rom
|
||||
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 17.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 18.
|
||||
|
||||
Files Linked [ module(s) ]
|
||||
|
||||
@@ -238,7 +249,7 @@ Libraries Linked [ object file ]
|
||||
/usr/bin/../share/sdcc/lib/z80/z80.lib [ printf_large.rel ]
|
||||
/usr/bin/../share/sdcc/lib/z80/z80.lib [ __sdcc_call_hl.rel ]
|
||||
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 18.
|
||||
ASxxxx Linker V03.00 + NoICE + sdld, page 19.
|
||||
|
||||
User Base Address Definitions
|
||||
|
||||
|
||||
@@ -33,14 +33,16 @@ DEF l__DATA 0x6
|
||||
DEF l__HEADER8 0xC
|
||||
DEF l__GSINIT 0xF
|
||||
DEF s__CODE 0x200
|
||||
DEF l__CODE 0x1098
|
||||
DEF s__HOME 0x1298
|
||||
DEF s__INITIALIZER 0x1298
|
||||
DEF s__GSINIT 0x129A
|
||||
DEF s__GSFINAL 0x12A9
|
||||
DEF l__CODE 0x1238
|
||||
DEF s__HOME 0x1438
|
||||
DEF s__INITIALIZER 0x1438
|
||||
DEF s__GSINIT 0x143A
|
||||
DEF s__GSFINAL 0x1449
|
||||
DEF _input0 0x6000
|
||||
DEF _joystick 0x7000
|
||||
DEF _analog 0x7100
|
||||
DEF _paddle 0x7200
|
||||
DEF _spinner 0x7300
|
||||
DEF _chram 0x8000
|
||||
DEF _colram 0x8800
|
||||
DEF s__DATA 0xC000
|
||||
@@ -57,15 +59,15 @@ DEF _write_string 0x221
|
||||
DEF _write_char 0x27E
|
||||
DEF _page_border 0x2B7
|
||||
DEF _page_inputs 0x382
|
||||
DEF _main 0x450
|
||||
DEF __mulint 0x665
|
||||
DEF __mul16 0x66B
|
||||
DEF _vsprintf 0x69F
|
||||
DEF _sprintf 0x6D4
|
||||
DEF _strlen 0x708
|
||||
DEF __print_format 0x832
|
||||
DEF ___sdcc_call_hl 0x1297
|
||||
DEF gsinit 0x129A
|
||||
DEF _main 0x52A
|
||||
DEF __mulint 0x805
|
||||
DEF __mul16 0x80B
|
||||
DEF _vsprintf 0x83F
|
||||
DEF _sprintf 0x874
|
||||
DEF _strlen 0x8A8
|
||||
DEF __print_format 0x9D2
|
||||
DEF ___sdcc_call_hl 0x1437
|
||||
DEF gsinit 0x143A
|
||||
DEF _chram_size 0xC000
|
||||
DEF _hsync 0xC002
|
||||
DEF _hsync_last 0xC003
|
||||
|
||||
@@ -7,12 +7,15 @@ Symbol Table
|
||||
.__.ABS. = 0000 G
|
||||
.__.CPU. = 0000 L
|
||||
.__.H$L. = 0000 L
|
||||
0 ___str_0 022A R
|
||||
0 ___str_1 0239 R
|
||||
0 ___str_2 0240 R
|
||||
0 ___str_3 0436 R
|
||||
0 ___str_4 0452 R
|
||||
0 ___str_5 0456 R
|
||||
0 ___str_0 02F9 R
|
||||
0 ___str_1 0308 R
|
||||
0 ___str_2 030B R
|
||||
0 ___str_3 030E R
|
||||
0 ___str_4 0314 R
|
||||
0 ___str_5 031A R
|
||||
0 ___str_6 05D3 R
|
||||
0 ___str_7 05EF R
|
||||
0 ___str_8 05F7 R
|
||||
__mulint **** GX
|
||||
7 __xinit__asc_0 0000 R
|
||||
7 __xinit__asc_1 0001 R
|
||||
@@ -29,9 +32,11 @@ Symbol Table
|
||||
1 _hsync_last 0003 GR
|
||||
_input0 = 6000 G
|
||||
_joystick = 7000 G
|
||||
0 _main 0246 GR
|
||||
0 _main 0320 GR
|
||||
_paddle = 7200 G
|
||||
0 _page_border 00AD GR
|
||||
0 _page_inputs 0178 GR
|
||||
_spinner = 7300 G
|
||||
_sprintf **** GX
|
||||
_strlen **** GX
|
||||
1 _vsync 0004 GR
|
||||
@@ -45,7 +50,7 @@ Hexadecimal [16-Bits]
|
||||
|
||||
Area Table
|
||||
|
||||
0 _CODE size 45B flags 0
|
||||
0 _CODE size 5FB flags 0
|
||||
1 _DATA size 6 flags 0
|
||||
2 _INITIALIZED size 2 flags 0
|
||||
3 _DABS size 0 flags 8
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
module top(
|
||||
|
||||
input clk_sys/*verilator public_flat*/,
|
||||
input clk_vid/*verilator public_flat*/,
|
||||
input reset/*verilator public_flat*/,
|
||||
|
||||
// 6 joysticks, 32 buttons each
|
||||
@@ -60,9 +59,19 @@ module top(
|
||||
output reg ioctl_wait=1'b0
|
||||
);
|
||||
|
||||
// Clock divider from JTFRAME
|
||||
wire ce_pix;
|
||||
/* verilator lint_off PINMISSING */
|
||||
jtframe_cen24 divider
|
||||
(
|
||||
.clk(clk_sys),
|
||||
.cen4(ce_pix)
|
||||
);
|
||||
/* verilator lint_on PINMISSING */
|
||||
|
||||
system system(
|
||||
.clk_sys(clk_sys),
|
||||
.ce_pix(clk_sys),
|
||||
.ce_pix(ce_pix),
|
||||
.reset(reset | ioctl_download),
|
||||
.VGA_HS(VGA_HS),
|
||||
.VGA_VS(VGA_VS),
|
||||
@@ -79,7 +88,7 @@ system system(
|
||||
.joystick({joystick_5,joystick_4,joystick_3,joystick_2,joystick_1,joystick_0}),
|
||||
.analog({joystick_analog_5,joystick_analog_4,joystick_analog_3,joystick_analog_2,joystick_analog_1,joystick_analog_0}),
|
||||
.paddle({paddle_5,paddle_4,paddle_3,paddle_2,paddle_1,paddle_0}),
|
||||
.spinner({spinner_5,spinner_4,spinner_3,spinner_2,spinner_1,spinner_0})
|
||||
.spinner({7'b0,spinner_5,7'b0,spinner_4,7'b0,spinner_3,7'b0,spinner_2,7'b0,spinner_1,7'b0,spinner_0})
|
||||
);
|
||||
|
||||
endmodule
|
||||
|
||||
@@ -73,15 +73,12 @@ double sc_time_stamp() { // Called by $time in Verilog.
|
||||
return main_time;
|
||||
}
|
||||
|
||||
int clockSpeed = 24; // This is not used, just a reminder for the dividers below
|
||||
SimClock clk_sys(1); // 12mhz
|
||||
SimClock clk_pix(1); // 6mhz
|
||||
SimClock clk_sys(1);
|
||||
|
||||
void resetSim() {
|
||||
main_time = 0;
|
||||
top->reset = 1;
|
||||
clk_sys.Reset();
|
||||
clk_pix.Reset();
|
||||
}
|
||||
|
||||
int verilate() {
|
||||
@@ -95,18 +92,10 @@ int verilate() {
|
||||
|
||||
// Clock dividers
|
||||
clk_sys.Tick();
|
||||
clk_pix.Tick();
|
||||
|
||||
// Set system clock in core
|
||||
top->clk_sys = clk_sys.clk;
|
||||
top->clk_vid = clk_pix.clk;
|
||||
|
||||
// Output pixels on rising edge of pixel clock
|
||||
if (clk_pix.IsRising()) {
|
||||
uint32_t colour = 0xFF000000 | top->VGA_B << 16 | top->VGA_G << 8 | top->VGA_R;
|
||||
video.Clock(top->VGA_HB, top->VGA_VB, top->VGA_HS, top->VGA_VS, colour);
|
||||
}
|
||||
|
||||
|
||||
// Simulate both edges of system clock
|
||||
if (clk_sys.clk != clk_sys.old) {
|
||||
if (clk_sys.clk) { bus.BeforeEval(); }
|
||||
@@ -114,6 +103,12 @@ int verilate() {
|
||||
if (clk_sys.clk) { bus.AfterEval(); }
|
||||
}
|
||||
|
||||
// Output pixels on rising edge of pixel clock
|
||||
if (clk_sys.IsRising() && top->top__DOT__system__DOT__ce_pix) {
|
||||
uint32_t colour = 0xFF000000 | top->VGA_B << 16 | top->VGA_G << 8 | top->VGA_R;
|
||||
video.Clock(top->VGA_HB, top->VGA_VB, top->VGA_HS, top->VGA_VS, colour);
|
||||
}
|
||||
|
||||
main_time++;
|
||||
|
||||
return 1;
|
||||
@@ -281,6 +276,11 @@ int main(int argc, char** argv, char** env) {
|
||||
top->joystick_analog_1 -= 1;
|
||||
top->joystick_analog_1 += 256;
|
||||
|
||||
top->paddle_0 += 1;
|
||||
top->paddle_1 -= 1;
|
||||
|
||||
top->spinner_0 += 1;
|
||||
top->spinner_1 -= 1;
|
||||
|
||||
// Run simulation
|
||||
if (run_enable) {
|
||||
|
||||
Reference in New Issue
Block a user