aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@trantor.hos.anvin.org>2010-09-18 17:34:42 -0700
committerH. Peter Anvin <hpa@trantor.hos.anvin.org>2010-09-18 17:36:33 -0700
commit029479d9d8b95452220794d500e94b1e4c873ca6 (patch)
treec4725475dc35f784add4906b1c394f57cb555052
parentcd6787f59338c5f4feced73eab3c0e5b8ba89023 (diff)
downloadabc80-029479d9d8b95452220794d500e94b1e4c873ca6.tar.gz
abc80-029479d9d8b95452220794d500e94b1e4c873ca6.tar.xz
abc80-029479d9d8b95452220794d500e94b1e4c873ca6.zip
Add ROM for ABC800C/M-style FGCTL color select
Add a ROM to set up the color choices for ABC800C/M FGCTL graphics color selection (4 out of 8).
-rw-r--r--abc80.qsf2
-rw-r--r--data/Makefile5
-rwxr-xr-xdata/fgcol.pl42
-rw-r--r--mega/fgcolrom.v159
4 files changed, 207 insertions, 1 deletions
diff --git a/abc80.qsf b/abc80.qsf
index f850806..399eb12 100644
--- a/abc80.qsf
+++ b/abc80.qsf
@@ -544,6 +544,8 @@ set_global_assignment -name USE_CONFIGURATION_DEVICE ON
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
set_global_assignment -name USE_SIGNALTAP_FILE stp6.stp
+set_global_assignment -name VERILOG_FILE mega/fgcolrom.v
+set_global_assignment -name MIF_FILE data/fgcol.mif
set_global_assignment -name VERILOG_FILE mega/pll2.v
set_global_assignment -name VERILOG_FILE mega/serrxfifo.v
set_global_assignment -name VERILOG_FILE i2c.v
diff --git a/data/Makefile b/data/Makefile
index ebb8418..1631799 100644
--- a/data/Makefile
+++ b/data/Makefile
@@ -8,7 +8,7 @@ Z80ASM = ../tools/z80asm/z80asm
$(Z80ASM) -o $@ -l $*.lst $<
all : keyboard.mif abc80rom.bin basic80.mif \
- mmu.mif chargen.mif videoram.mif sddrom.mif \
+ mmu.mif chargen.mif videoram.mif fgcol.mif sddrom.mif \
abcsefi.bas abcdkno.bas abcintl.bas
abc80rom.bin : buildrom.pl abcbasic.rom ufddos.bin printer.bin
@@ -68,6 +68,9 @@ abcdkno.bin : $(FONT) bdf2bin.pl
abcintl.bin : $(FONT) bdf2bin.pl
$(PERL) bdf2bin.pl abcintl $(SIZES) < $< > $@ || ( rm -f $@ ; exit 1 )
+fgcol.mif : fgcol.pl
+ $(PERL) fgcol.pl > $@ || ( rm -f $@ ; exit 1 )
+
clean:
rm -f *.obj *.bin *.mif *.bas
diff --git a/data/fgcol.pl b/data/fgcol.pl
new file mode 100755
index 0000000..b67656f
--- /dev/null
+++ b/data/fgcol.pl
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+#
+# Create a MIF file for the FG color ROM
+#
+
+@coltbl = ('KKKK', 'KWWW', 'KRGY', 'KRGB', 'KRGM', 'KRGC', 'KRGW', 'KRYB',
+ 'KRYM', 'KRYC', 'KRYW', 'KRBM', 'KRBC', 'KRBW', 'KRMC', 'KRMW',
+ 'KRCW', 'KGYB', 'KGYM', 'KGYC', 'KGYW', 'KGBM', 'KGBC', 'KGBW',
+ 'KGMC', 'KGMW', 'KGCW', 'KYBM', 'KYBC', 'KYBW', 'KYMC', 'KYMW',
+ 'KYCW', 'KBMC', 'KBMW', 'KBCW', 'KMCW', 'RGYB', 'RGYM', 'RGYC',
+ 'RGYW', 'RGBM', 'RGBC', 'RGBW', 'RGMC', 'RGMW', 'RGCW', 'RYBM',
+ 'RYBC', 'RYBW', 'RYMC', 'RYMW', 'RYCW', 'RBMC', 'RBMW', 'RBCW',
+ 'RMCW', 'GYBM', 'GYBC', 'GYBW', 'GYMC', 'GYMW', 'GYCW', 'GBMC',
+ 'GBMW', 'GBCW', 'GMCW', 'YBMC', 'YBMW', 'YBCW', 'YMCW', 'BMCW',
+ 'KRKR', 'KKRR', 'KGKG', 'KKGG', 'KYKY', 'KKYY', 'KBKB', 'KKBB',
+ 'KMKM', 'KKMM', 'KCKC', 'KKCC', 'KWKW', 'KKWW', 'RGRG', 'RRGG',
+ 'RYRY', 'RRYY', 'RBRB', 'RRBB', 'RMRM', 'RRMM', 'RCRC', 'RRCC',
+ 'RWRW', 'RRWW', 'GYGY', 'GGYY', 'GBGB', 'GGBB', 'GMGM', 'GGMM',
+ 'GCGC', 'GGCC', 'GWGW', 'GGWW', 'YBYB', 'YYBB', 'YMYM', 'YYMM',
+ 'YCYC', 'YYCC', 'YWYW', 'YYWW', 'BMBM', 'BBMM', 'BCBC', 'BBCC',
+ 'BWBW', 'BBWW', 'MCMC', 'MMCC', 'MWMW', 'MMWW', 'CWCW', 'CCWW' );
+
+%colenc = ('K' => 0, 'B' => 1, 'G' => 2, 'C' => 3,
+ 'R' => 4, 'M' => 5, 'Y' => 6, 'W' => 7);
+
+print "DEPTH = 128;\n";
+print "WIDTH = 12;\n";
+print "ADDRESS_RADIX = HEX;\n";
+print "DATA_RADIX = HEX;\n";
+print "CONTENT\n";
+print "BEGIN\n";
+
+for ($i = 0; $i < 128; $i++) {
+ $n = 0;
+ for ($x = 0; $x < 4; $x++) {
+ $c = substr($coltbl[$i], $x, 1);
+ $c = $colenc{$c};
+ $n |= $c << (3*$x);
+ }
+ printf "%02X : %03X\n", $i, $n;
+}
+print "END;\n";
diff --git a/mega/fgcolrom.v b/mega/fgcolrom.v
new file mode 100644
index 0000000..aff9908
--- /dev/null
+++ b/mega/fgcolrom.v
@@ -0,0 +1,159 @@
+// megafunction wizard: %ROM: 1-PORT%
+// GENERATION: STANDARD
+// VERSION: WM1.0
+// MODULE: altsyncram
+
+// ============================================================
+// File Name: fgcolrom.v
+// Megafunction Name(s):
+// altsyncram
+//
+// Simulation Library Files(s):
+// altera_mf
+// ============================================================
+// ************************************************************
+// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
+//
+// 9.0 Build 235 06/17/2009 SP 2 SJ Web Edition
+// ************************************************************
+
+
+//Copyright (C) 1991-2009 Altera Corporation
+//Your use of Altera Corporation's design tools, logic functions
+//and other software and tools, and its AMPP partner logic
+//functions, and any output files from any of the foregoing
+//(including device programming or simulation files), and any
+//associated documentation or information are expressly subject
+//to the terms and conditions of the Altera Program License
+//Subscription Agreement, Altera MegaCore Function License
+//Agreement, or other applicable license agreement, including,
+//without limitation, that your use is for the sole purpose of
+//programming logic devices manufactured by Altera and sold by
+//Altera or its authorized distributors. Please refer to the
+//applicable agreement for further details.
+
+
+// synopsys translate_off
+`timescale 1 ps / 1 ps
+// synopsys translate_on
+module fgcolrom (
+ address,
+ clock,
+ q);
+
+ input [6:0] address;
+ input clock;
+ output [11:0] q;
+`ifndef ALTERA_RESERVED_QIS
+// synopsys translate_off
+`endif
+ tri1 clock;
+`ifndef ALTERA_RESERVED_QIS
+// synopsys translate_on
+`endif
+
+ wire [11:0] sub_wire0;
+ wire [11:0] q = sub_wire0[11:0];
+
+ altsyncram altsyncram_component (
+ .clock0 (clock),
+ .address_a (address),
+ .q_a (sub_wire0),
+ .aclr0 (1'b0),
+ .aclr1 (1'b0),
+ .address_b (1'b1),
+ .addressstall_a (1'b0),
+ .addressstall_b (1'b0),
+ .byteena_a (1'b1),
+ .byteena_b (1'b1),
+ .clock1 (1'b1),
+ .clocken0 (1'b1),
+ .clocken1 (1'b1),
+ .clocken2 (1'b1),
+ .clocken3 (1'b1),
+ .data_a ({12{1'b1}}),
+ .data_b (1'b1),
+ .eccstatus (),
+ .q_b (),
+ .rden_a (1'b1),
+ .rden_b (1'b1),
+ .wren_a (1'b0),
+ .wren_b (1'b0));
+ defparam
+ altsyncram_component.clock_enable_input_a = "BYPASS",
+ altsyncram_component.clock_enable_output_a = "BYPASS",
+ altsyncram_component.init_file = "data/fgcol.mif",
+ altsyncram_component.intended_device_family = "Cyclone II",
+ altsyncram_component.lpm_hint = "ENABLE_RUNTIME_MOD=NO",
+ altsyncram_component.lpm_type = "altsyncram",
+ altsyncram_component.numwords_a = 128,
+ altsyncram_component.operation_mode = "ROM",
+ altsyncram_component.outdata_aclr_a = "NONE",
+ altsyncram_component.outdata_reg_a = "UNREGISTERED",
+ altsyncram_component.widthad_a = 7,
+ altsyncram_component.width_a = 12,
+ altsyncram_component.width_byteena_a = 1;
+
+
+endmodule
+
+// ============================================================
+// CNX file retrieval info
+// ============================================================
+// Retrieval info: PRIVATE: ADDRESSSTALL_A NUMERIC "0"
+// Retrieval info: PRIVATE: AclrAddr NUMERIC "0"
+// Retrieval info: PRIVATE: AclrByte NUMERIC "0"
+// Retrieval info: PRIVATE: AclrOutput NUMERIC "0"
+// Retrieval info: PRIVATE: BYTE_ENABLE NUMERIC "0"
+// Retrieval info: PRIVATE: BYTE_SIZE NUMERIC "8"
+// Retrieval info: PRIVATE: BlankMemory NUMERIC "0"
+// Retrieval info: PRIVATE: CLOCK_ENABLE_INPUT_A NUMERIC "0"
+// Retrieval info: PRIVATE: CLOCK_ENABLE_OUTPUT_A NUMERIC "0"
+// Retrieval info: PRIVATE: Clken NUMERIC "0"
+// Retrieval info: PRIVATE: IMPLEMENT_IN_LES NUMERIC "0"
+// Retrieval info: PRIVATE: INIT_FILE_LAYOUT STRING "PORT_A"
+// Retrieval info: PRIVATE: INIT_TO_SIM_X NUMERIC "0"
+// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
+// Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
+// Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
+// Retrieval info: PRIVATE: MAXIMUM_DEPTH NUMERIC "0"
+// Retrieval info: PRIVATE: MIFfilename STRING "data/fgcol.mif"
+// Retrieval info: PRIVATE: NUMWORDS_A NUMERIC "128"
+// Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
+// Retrieval info: PRIVATE: RegAddr NUMERIC "1"
+// Retrieval info: PRIVATE: RegOutput NUMERIC "0"
+// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
+// Retrieval info: PRIVATE: SingleClock NUMERIC "1"
+// Retrieval info: PRIVATE: UseDQRAM NUMERIC "0"
+// Retrieval info: PRIVATE: WidthAddr NUMERIC "7"
+// Retrieval info: PRIVATE: WidthData NUMERIC "12"
+// Retrieval info: PRIVATE: rden NUMERIC "0"
+// Retrieval info: CONSTANT: CLOCK_ENABLE_INPUT_A STRING "BYPASS"
+// Retrieval info: CONSTANT: CLOCK_ENABLE_OUTPUT_A STRING "BYPASS"
+// Retrieval info: CONSTANT: INIT_FILE STRING "data/fgcol.mif"
+// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone II"
+// Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
+// Retrieval info: CONSTANT: LPM_TYPE STRING "altsyncram"
+// Retrieval info: CONSTANT: NUMWORDS_A NUMERIC "128"
+// Retrieval info: CONSTANT: OPERATION_MODE STRING "ROM"
+// Retrieval info: CONSTANT: OUTDATA_ACLR_A STRING "NONE"
+// Retrieval info: CONSTANT: OUTDATA_REG_A STRING "UNREGISTERED"
+// Retrieval info: CONSTANT: WIDTHAD_A NUMERIC "7"
+// Retrieval info: CONSTANT: WIDTH_A NUMERIC "12"
+// Retrieval info: CONSTANT: WIDTH_BYTEENA_A NUMERIC "1"
+// Retrieval info: USED_PORT: address 0 0 7 0 INPUT NODEFVAL address[6..0]
+// Retrieval info: USED_PORT: clock 0 0 0 0 INPUT VCC clock
+// Retrieval info: USED_PORT: q 0 0 12 0 OUTPUT NODEFVAL q[11..0]
+// Retrieval info: CONNECT: @address_a 0 0 7 0 address 0 0 7 0
+// Retrieval info: CONNECT: q 0 0 12 0 @q_a 0 0 12 0
+// Retrieval info: CONNECT: @clock0 0 0 0 0 clock 0 0 0 0
+// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
+// Retrieval info: GEN_FILE: TYPE_NORMAL fgcolrom.v TRUE
+// Retrieval info: GEN_FILE: TYPE_NORMAL fgcolrom.inc FALSE
+// Retrieval info: GEN_FILE: TYPE_NORMAL fgcolrom.cmp FALSE
+// Retrieval info: GEN_FILE: TYPE_NORMAL fgcolrom.bsf TRUE
+// Retrieval info: GEN_FILE: TYPE_NORMAL fgcolrom_inst.v TRUE
+// Retrieval info: GEN_FILE: TYPE_NORMAL fgcolrom_bb.v TRUE
+// Retrieval info: GEN_FILE: TYPE_NORMAL fgcolrom_waveforms.html TRUE
+// Retrieval info: GEN_FILE: TYPE_NORMAL fgcolrom_wave*.jpg FALSE
+// Retrieval info: LIB_FILE: altera_mf