1
0
mirror of https://github.com/Gehstock/Mist_FPGA.git synced 2026-04-14 23:38:05 +00:00

New Core TripleDrawPoker, move Birdy back to Beta

This commit is contained in:
Marcel
2019-03-11 18:22:22 +01:00
parent 7c6ae51d93
commit b767fd4979
72 changed files with 6192 additions and 4455 deletions

View File

@@ -1,11 +1,11 @@
---------------------------------------------------------------------------------
--
-- Arcade: Birdiy port to MiST by Gehstock
-- 02 March 2019
-- Arcade: TripleDrawPoker port to MiST by Gehstock
-- 11 Mar 2019
--
---------------------------------------------------------------------------------
-- A simulation model of Pacman hardware
-- Copyright (c) MikeJ - January 2006
-- A simulation model of Galaxian hardware
-- Copyright(c) 2004 Katsumi Degawa
---------------------------------------------------------------------------------
--
-- Only controls and OSD are rotated on Video output.
@@ -13,15 +13,11 @@
--
-- Keyboard inputs :
--
-- ESC : Coin
-- F2 : Start 2 players
-- F1 : Start 1 player
-- UP,DOWN,LEFT,RIGHT arrows : Movements
-- F2 : Coin + Start 2 players
-- F1 : Coin + Start 1 player
-- SPACE : Select
-- ARROW KEYS : Movements
--
-- Joystick support.
--
---------------------------------------------------------------------------------
WIP

View File

@@ -1,6 +1,6 @@
# -------------------------------------------------------------------------- #
#
# Copyright (C) 1991-2014 Altera Corporation
# Copyright (C) 1991-2013 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
@@ -17,15 +17,14 @@
# -------------------------------------------------------------------------- #
#
# Quartus II 64-Bit
# Version 13.1.4 Build 182 03/12/2014 SJ Web Edition
# Date created = 22:14:32 March 02, 2019
# Version 13.1.0 Build 162 10/23/2013 SJ Web Edition
# Date created = 21:51:58 January 08, 2018
#
# -------------------------------------------------------------------------- #
QUARTUS_VERSION = "13.1"
DATE = "22:14:32 March 02, 2019"
DATE = "21:51:58 January 08, 2018"
# Revisions
PROJECT_REVISION = "Birdiy"
PROJECT_REVISION = "Pacman"
PROJECT_REVISION = "TripleDrawPoker"

View File

@@ -1,6 +1,6 @@
# -------------------------------------------------------------------------- #
#
# Copyright (C) 1991-2013 Altera Corporation
# Copyright (C) 1991-2014 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
@@ -17,15 +17,15 @@
# -------------------------------------------------------------------------- #
#
# Quartus II 64-Bit
# Version 13.1.0 Build 162 10/23/2013 SJ Web Edition
# Date created = 17:05:52 November 20, 2017
# Version 13.1.4 Build 182 03/12/2014 SJ Web Edition
# Date created = 18:15:04 March 11, 2019
#
# -------------------------------------------------------------------------- #
#
# Notes:
#
# 1) The default values for assignments are stored in the file:
# Birdiy_assignment_defaults.qdf
# TripleDrawPoker_assignment_defaults.qdf
# If this file doesn't exist, see file:
# assignment_defaults.qdf
#
@@ -46,6 +46,38 @@ set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL
set_global_assignment -name SMART_RECOMPILE ON
set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:rtl/build_id.tcl"
set_global_assignment -name SYSTEMVERILOG_FILE rtl/TripleDrawPoker_MiST.sv
set_global_assignment -name VHDL_FILE rtl/tripledrawpoker.vhd
set_global_assignment -name VHDL_FILE rtl/mc_stars.vhd
set_global_assignment -name VHDL_FILE rtl/mc_sound_vco.vhd
set_global_assignment -name VHDL_FILE rtl/mc_sound_a.vhd
set_global_assignment -name VHDL_FILE rtl/mc_missile.vhd
set_global_assignment -name VHDL_FILE rtl/mc_logic.vhd
set_global_assignment -name VHDL_FILE rtl/mc_ld_pls.vhd
set_global_assignment -name VHDL_FILE rtl/mc_inport.vhd
set_global_assignment -name VHDL_FILE rtl/mc_hv_count.vhd
set_global_assignment -name VHDL_FILE rtl/mc_col_pal.vhd
set_global_assignment -name VHDL_FILE rtl/mc_bram.vhd
set_global_assignment -name VHDL_FILE rtl/mc_adec.vhd
set_global_assignment -name VHDL_FILE rtl/mc_video.vhd
set_global_assignment -name VHDL_FILE rtl/sine_package.vhd
set_global_assignment -name VHDL_FILE rtl/cpu/T80sed.vhd
set_global_assignment -name VHDL_FILE rtl/cpu/T80as.vhd
set_global_assignment -name VHDL_FILE rtl/cpu/T80_Reg.vhd
set_global_assignment -name VHDL_FILE rtl/cpu/T80_Pack.vhd
set_global_assignment -name VHDL_FILE rtl/cpu/T80_MCode.vhd
set_global_assignment -name VHDL_FILE rtl/cpu/T80_ALU.vhd
set_global_assignment -name VHDL_FILE rtl/cpu/T80.vhd
set_global_assignment -name VHDL_FILE rtl/spram.vhd
set_global_assignment -name VHDL_FILE rtl/sprom.vhd
set_global_assignment -name VHDL_FILE rtl/dpram.vhd
set_global_assignment -name VHDL_FILE rtl/pll.vhd
set_global_assignment -name SYSTEMVERILOG_FILE rtl/video_mixer.sv
set_global_assignment -name VERILOG_FILE rtl/scandoubler.v
set_global_assignment -name VERILOG_FILE rtl/osd.v
set_global_assignment -name VERILOG_FILE rtl/mist_io.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/hq2x.sv
set_global_assignment -name VHDL_FILE rtl/dac.vhd
# Pin & Location Assignments
# ==========================
@@ -83,15 +115,18 @@ set_location_assignment PLL_1 -to "pll:pll|altpll:altpll_component"
# Classic Timing Assignments
# ==========================
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS OFF
# Analysis & Synthesis Assignments
# ================================
set_global_assignment -name FAMILY "Cyclone III"
set_global_assignment -name TOP_LEVEL_ENTITY Birdiy
set_global_assignment -name TOP_LEVEL_ENTITY TripleDrawPoker_MiST
set_global_assignment -name DEVICE_FILTER_PIN_COUNT 144
set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 8
set_global_assignment -name SAVE_DISK_SPACE OFF
set_global_assignment -name DEVICE_FILTER_PACKAGE TQFP
# Fitter Assignments
# ==================
@@ -129,8 +164,8 @@ set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -fall
set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -rise
set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -fall
# --------------------
# start ENTITY(Pacman)
# ----------------------------------
# start ENTITY(TripleDrawPoker_MiST)
# start DESIGN_PARTITION(Top)
# ---------------------------
@@ -144,28 +179,6 @@ set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -
# end DESIGN_PARTITION(Top)
# -------------------------
# end ENTITY(Pacman)
# ------------------
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
set_global_assignment -name SYSTEMVERILOG_FILE rtl/Birdiy.sv
set_global_assignment -name VHDL_FILE rtl/pacman.vhd
set_global_assignment -name VHDL_FILE rtl/pacman_vram_addr.vhd
set_global_assignment -name VHDL_FILE rtl/pacman_video.vhd
set_global_assignment -name VHDL_FILE rtl/pacman_audio.vhd
set_global_assignment -name VHDL_FILE rtl/sprom.vhd
set_global_assignment -name VHDL_FILE rtl/dpram.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80_Reg.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80_Pack.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80_MCode.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80_ALU.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80.vhd
set_global_assignment -name VHDL_FILE rtl/T80/T80sed.vhd
set_global_assignment -name VERILOG_FILE rtl/osd.v
set_global_assignment -name VERILOG_FILE rtl/mist_io.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/hq2x.sv
set_global_assignment -name VHDL_FILE rtl/dac.vhd
set_global_assignment -name QIP_FILE rtl/pll.qip
set_global_assignment -name SYSTEMVERILOG_FILE rtl/video_mixer.sv
set_global_assignment -name VERILOG_FILE rtl/scandoubler.v
# end ENTITY(TripleDrawPoker_MiST)
# --------------------------------
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

View File

@@ -1,51 +1,54 @@
{ "" "" "" "Variable or input pin \"data_b\" is defined but never used." { } { } 0 287013 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Found combinational loop of 47 nodes" { } { } 0 332125 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "LOCKED port on the PLL is not properly connected on instance \"pll_hdmi:pll_hdmi\|pll_hdmi_0002:pll_hdmi_inst\|altera_pll:altera_pll_i\|general\[0\].gpll\". The LOCKED port on the PLL should be connected when the FBOUTCLK port is connected. Although it is unnecessary to connect the LOCKED signal, any logic driven off of an output clock of the PLL will not know when the PLL is locked and ready." { } { } 0 21300 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Net \"soc_system:soc_system\|soc_system_Video_Output:video_output\|alt_vip_cvo_core:cvo_core\|genlock_enable_sync1\[1\]\" is missing source, defaulting to GND" { } { } 0 12110 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Inferred RAM node \"zxspectrum:emu\|mist_io:mist_io\|ps2_kbd_fifo_rtl_0\" from synchronous design logic. Pass-through logic has been added to match the read-during-write behavior of the original design." { } { } 0 276020 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Inferred RAM node \"zxspectrum:emu\|mist_io:mist_io\|ps2_mouse_fifo_rtl_0\" from synchronous design logic. Pass-through logic has been added to match the read-during-write behavior of the original design." { } { } 0 276020 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "No destination clock period was found satisfying the set_net_delay assignment from \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|h_sync_polarity_reg\}\]\" to \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|vid_h_sync_polarity\}\]\". This assignment will be ignored." { } { } 0 17897 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "No destination clock period was found satisfying the set_net_delay assignment from \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|v_sync_polarity_reg\}\]\" to \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|vid_v_sync_polarity\}\]\". This assignment will be ignored." { } { } 0 17897 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "No destination clock period was found satisfying the set_net_delay assignment from \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|interlaced_field_reg\[*\]\}\]\" to \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|vid_interlaced_field\[*\]\}\]\". This assignment will be ignored." { } { } 0 17897 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Some pins have incomplete I/O assignments. Refer to the I/O Assignment Warnings report for details" { } { } 0 15714 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "55 hierarchies have connectivity warnings - see the Connectivity Checks report folder" { } { } 0 12241 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Inferred RAM node \"emu:emu\|mister_io:mister_io\|ps2_kbd_fifo_rtl_0\" from synchronous design logic. Pass-through logic has been added to match the read-during-write behavior of the original design." { } { } 0 276020 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Inferred RAM node \"emu:emu\|mister_io:mister_io\|ps2_mouse_fifo_rtl_0\" from synchronous design logic. Pass-through logic has been added to match the read-during-write behavior of the original design." { } { } 0 276020 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Verilog HDL or VHDL warning at de10_top.v(97): object \"io_win\" assigned a value but never read" { } { } 0 10036 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Verilog HDL or VHDL warning at de10_top.v(102): object \"io_sdd\" assigned a value but never read" { } { } 0 10036 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Overwriting existing clock: vip\|hps\|fpga_interfaces\|clocks_resets\|h2f_user0_clk" { } { } 0 332043 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Variable or input pin \"data_a\" is defined but never used." { } { } 0 287013 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 169085 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 174073 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 332174 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 13009 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 21300 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "alt_vip_cvo_mode_banks" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "hps_sdram_pll.sv" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "alt_vip_common_frame_counter.v" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "hps_sdram_p0_acv_hard_memphy.v" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "hps_sdram_p0_acv_ldc.v" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "hps_sdram_p0_acv_hard_io_pads.v" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "altera_mem_if_hard_memory_controller_top_cyclonev.sv" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "genlock_enable_sync" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "u_calculate_mode" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "genlock_enable" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "reset_value" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_pll_video:pll_video\|altera_pll:altera_pll_i\|general\[0\].gpll" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "alt_vip_cvo_core.sdc" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "alt_vip_packet_transfer.sdc" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "hps_sdram_p0.sdc" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "alt_vip_common_dc_mixed_widths_fifo.sdc" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "altera_mem_if_hhp_qseq_synth_top" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_vip_vout:vip_vout\|alt_vip_cvo_core:cvo_core\|genlock_enable_sync1" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_vip_fb:vip_fb\|alt_vip_packet_transfer:pkt_trans_rd\|alt_vip_packet_transfer_read_proc:READ_BLOCK.read_proc_instance\|alt_vip_common_fifo2:output_msg_queue\|scfifo:scfifo_component\|scfifo_scd1:auto_generated\|a_dpfifo_e471:dpfifo\|altsyncram_ums1:FIFOram\|q_b" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_Video_Input:video_input\|alt_vip_cvi_core:cvi_core\|alt_vip_cvi_write_fifo_buffer:write_fifo_buffer" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_Frame_Buffer:frame_buffer\|alt_vip_packet_transfer:pkt_trans_rd" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "soc_system_hps_fpga_interfaces.sdc" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "soc_system_HPS_fpga_interfaces.sdc" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "RST" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "alt_vip_scaler_alg_core" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "cvo_core" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "vip_HPS_fpga_interfaces.sdc" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "alt_vip_dil_vof_scheduler.sdc" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "alt_vip_dil_scheduler.sdc" { } { } 0 9999 "" 0 0 "Design Software" 0 -1 0 ""}
{ "" "" "" "Variable or input pin \"data_b\" is defined but never used." { } { } 0 287013 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Found combinational loop of 47 nodes" { } { } 0 332125 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "LOCKED port on the PLL is not properly connected on instance \"pll_hdmi:pll_hdmi\|pll_hdmi_0002:pll_hdmi_inst\|altera_pll:altera_pll_i\|general\[0\].gpll\". The LOCKED port on the PLL should be connected when the FBOUTCLK port is connected. Although it is unnecessary to connect the LOCKED signal, any logic driven off of an output clock of the PLL will not know when the PLL is locked and ready." { } { } 0 21300 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Net \"soc_system:soc_system\|soc_system_Video_Output:video_output\|alt_vip_cvo_core:cvo_core\|genlock_enable_sync1\[1\]\" is missing source, defaulting to GND" { } { } 0 12110 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Inferred RAM node \"zxspectrum:emu\|mist_io:mist_io\|ps2_kbd_fifo_rtl_0\" from synchronous design logic. Pass-through logic has been added to match the read-during-write behavior of the original design." { } { } 0 276020 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Inferred RAM node \"zxspectrum:emu\|mist_io:mist_io\|ps2_mouse_fifo_rtl_0\" from synchronous design logic. Pass-through logic has been added to match the read-during-write behavior of the original design." { } { } 0 276020 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "No destination clock period was found satisfying the set_net_delay assignment from \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|h_sync_polarity_reg\}\]\" to \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|vid_h_sync_polarity\}\]\". This assignment will be ignored." { } { } 0 17897 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "No destination clock period was found satisfying the set_net_delay assignment from \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|v_sync_polarity_reg\}\]\" to \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|vid_v_sync_polarity\}\]\". This assignment will be ignored." { } { } 0 17897 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "No destination clock period was found satisfying the set_net_delay assignment from \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|interlaced_field_reg\[*\]\}\]\" to \"\[get_keepers \{soc_system\|video_output\|cvo_core\|mode_banks\|vid_interlaced_field\[*\]\}\]\". This assignment will be ignored." { } { } 0 17897 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Some pins have incomplete I/O assignments. Refer to the I/O Assignment Warnings report for details" { } { } 0 15714 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "55 hierarchies have connectivity warnings - see the Connectivity Checks report folder" { } { } 0 12241 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Inferred RAM node \"emu:emu\|mister_io:mister_io\|ps2_kbd_fifo_rtl_0\" from synchronous design logic. Pass-through logic has been added to match the read-during-write behavior of the original design." { } { } 0 276020 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Inferred RAM node \"emu:emu\|mister_io:mister_io\|ps2_mouse_fifo_rtl_0\" from synchronous design logic. Pass-through logic has been added to match the read-during-write behavior of the original design." { } { } 0 276020 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Verilog HDL or VHDL warning at de10_top.v(97): object \"io_win\" assigned a value but never read" { } { } 0 10036 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Verilog HDL or VHDL warning at de10_top.v(102): object \"io_sdd\" assigned a value but never read" { } { } 0 10036 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Overwriting existing clock: vip\|hps\|fpga_interfaces\|clocks_resets\|h2f_user0_clk" { } { } 0 332043 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Variable or input pin \"data_a\" is defined but never used." { } { } 0 287013 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "Clock multiplexers are found and protected" { } { } 0 19016 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 169085 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 174073 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 332174 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 13009 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 21300 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 169177 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "*" { } { } 0 169203 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "alt_vip_cvo_mode_banks" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "hps_sdram_pll.sv" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "alt_vip_common_frame_counter.v" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "hps_sdram_p0_acv_hard_memphy.v" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "hps_sdram_p0_acv_ldc.v" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "hps_sdram_p0_acv_hard_io_pads.v" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "altera_mem_if_hard_memory_controller_top_cyclonev.sv" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "genlock_enable_sync" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "u_calculate_mode" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "genlock_enable" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "reset_value" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_pll_video:pll_video\|altera_pll:altera_pll_i\|general\[0\].gpll" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "alt_vip_cvo_core.sdc" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "alt_vip_packet_transfer.sdc" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "hps_sdram_p0.sdc" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "alt_vip_common_dc_mixed_widths_fifo.sdc" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "altera_mem_if_hhp_qseq_synth_top" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_vip_vout:vip_vout\|alt_vip_cvo_core:cvo_core\|genlock_enable_sync1" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_vip_fb:vip_fb\|alt_vip_packet_transfer:pkt_trans_rd\|alt_vip_packet_transfer_read_proc:READ_BLOCK.read_proc_instance\|alt_vip_common_fifo2:output_msg_queue\|scfifo:scfifo_component\|scfifo_scd1:auto_generated\|a_dpfifo_e471:dpfifo\|altsyncram_ums1:FIFOram\|q_b" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_Video_Input:video_input\|alt_vip_cvi_core:cvi_core\|alt_vip_cvi_write_fifo_buffer:write_fifo_buffer" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "soc_system:soc_system\|soc_system_Frame_Buffer:frame_buffer\|alt_vip_packet_transfer:pkt_trans_rd" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "soc_system_hps_fpga_interfaces.sdc" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "soc_system_HPS_fpga_interfaces.sdc" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "RST" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "alt_vip_scaler_alg_core" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "cvo_core" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "vip_HPS_fpga_interfaces.sdc" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "alt_vip_dil_vof_scheduler.sdc" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}
{ "" "" "" "alt_vip_dil_scheduler.sdc" { } { } 0 9999 "" 0 0 "Quartus II" 0 -1 0 ""}

View File

@@ -0,0 +1,193 @@
//============================================================================
// Arcade: Catacomb
//
// Port to MiSTer
// Copyright (C) 2017 Sorgelig
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//============================================================================
module Pisces
(
output LED,
output [5:0] VGA_R,
output [5:0] VGA_G,
output [5:0] VGA_B,
output VGA_HS,
output VGA_VS,
output AUDIO_L,
output AUDIO_R,
input SPI_SCK,
output SPI_DO,
input SPI_DI,
input SPI_SS2,
input SPI_SS3,
input CONF_DATA0,
input CLOCK_27
);
`include "rtl\build_id.v"
localparam CONF_STR = {
"Pisces;;",
"O2,Rotate Controls,Off,On;",
"O34,Scanlines,Off,25%,50%,75%;",
"T6,Reset;",
"V,v1.20.",`BUILD_DATE
};
assign LED = 1;
assign AUDIO_R = AUDIO_L;
wire clk_24, clk_18, clk_12, clk_6;
wire pll_locked;
pll pll(
.inclk0(CLOCK_27),
.areset(0),
.c0(clk_24),
.c1(clk_18),
.c2(clk_12),
.c3(clk_6)
);
wire [31:0] status;
wire [1:0] buttons;
wire [1:0] switches;
wire [7:0] joystick_0;
wire [7:0] joystick_1;
wire scandoublerD;
wire ypbpr;
wire [10:0] ps2_key;
wire [7:0] audio_a, audio_b;
wire [10:0] audio = {1'b0, audio_b, 2'b0} + {3'b0, audio_a};
wire hs, vs;
wire hb, vb;
wire blankn = ~(hb | vb);
wire [2:0] r,g,b;
galaxian catacomb(
.W_CLK_18M(clk_18),
.W_CLK_12M(clk_12),
.W_CLK_6M(clk_6),
.I_RESET(status[0] | status[6] | buttons[1]),
.P1_CSJUDLR({btn_coin,btn_one_player,m_fire,m_up,m_down,m_left,m_right}),
.P2_CSJUDLR({1'b0, btn_two_players,m_fire,m_up,m_down,m_left,m_right}),
.W_R(r),
.W_G(g),
.W_B(b),
.W_H_SYNC(hs),
.W_V_SYNC(vs),
.HBLANK(hb),
.VBLANK(vb),
.W_SDAT_A(audio_a),
.W_SDAT_B(audio_b)
);
video_mixer video_mixer(
.clk_sys(clk_24),
.ce_pix(clk_6),
.ce_pix_actual(clk_6),
.SPI_SCK(SPI_SCK),
.SPI_SS3(SPI_SS3),
.SPI_DI(SPI_DI),
.R(blankn ? r : "000"),
.G(blankn ? g : "000"),
.B(blankn ? b : "000"),
.HSync(hs),
.VSync(vs),
.VGA_R(VGA_R),
.VGA_G(VGA_G),
.VGA_B(VGA_B),
.VGA_VS(VGA_VS),
.VGA_HS(VGA_HS),
.rotate({1'b1,status[2]}),
.scandoublerD(scandoublerD),
.scanlines(scandoublerD ? 2'b00 : status[4:3]),
.ypbpr(ypbpr),
.ypbpr_full(1),
.line_start(0),
.mono(0)
);
mist_io #(
.STRLEN(($size(CONF_STR)>>3)))
mist_io(
.clk_sys (clk_24 ),
.conf_str (CONF_STR ),
.SPI_SCK (SPI_SCK ),
.CONF_DATA0 (CONF_DATA0 ),
.SPI_SS2 (SPI_SS2 ),
.SPI_DO (SPI_DO ),
.SPI_DI (SPI_DI ),
.buttons (buttons ),
.switches (switches ),
.scandoublerD (scandoublerD ),
.ypbpr (ypbpr ),
.ps2_key (ps2_key ),
.joystick_0 (joystick_0 ),
.joystick_1 (joystick_1 ),
.status (status )
);
dac #(
.msbi_g(15))
dac(
.clk_i(clk_24),
.res_n_i(1),
.dac_i({audio,5'd0}),
.dac_o(AUDIO_L)
);
// Rotated Normal
wire m_up = ~status[2] ? btn_left | joystick_0[1] | joystick_1[1] : btn_up | joystick_0[3] | joystick_1[3];
wire m_down = ~status[2] ? btn_right | joystick_0[0] | joystick_1[0] : btn_down | joystick_0[2] | joystick_1[2];
wire m_left = ~status[2] ? btn_down | joystick_0[2] | joystick_1[2] : btn_left | joystick_0[1] | joystick_1[1];
wire m_right = ~status[2] ? btn_up | joystick_0[3] | joystick_1[3] : btn_right | joystick_0[0] | joystick_1[0];
wire m_fire = btn_fire1 | joystick_0[4] | joystick_1[4];
wire m_bomb = btn_fire2 | joystick_0[5] | joystick_1[5];
reg btn_one_player = 0;
reg btn_two_players = 0;
reg btn_left = 0;
reg btn_right = 0;
reg btn_down = 0;
reg btn_up = 0;
reg btn_fire1 = 0;
reg btn_fire2 = 0;
reg btn_fire3 = 0;
reg btn_coin = 0;
wire pressed = ps2_key[9];
wire [7:0] code = ps2_key[7:0];
always @(posedge clk_24) begin
reg old_state;
old_state <= ps2_key[10];
if(old_state != ps2_key[10]) begin
case(code)
'h75: btn_up <= pressed; // up
'h72: btn_down <= pressed; // down
'h6B: btn_left <= pressed; // left
'h74: btn_right <= pressed; // right
'h76: btn_coin <= pressed; // ESC
'h05: btn_one_player <= pressed; // F1
'h06: btn_two_players <= pressed; // F2
'h14: btn_fire3 <= pressed; // ctrl
'h11: btn_fire2 <= pressed; // alt
'h29: btn_fire1 <= pressed; // Space
endcase
end
end
endmodule

View File

@@ -0,0 +1,3 @@
:10000000C007FF000007FFC0003F07C000173FC048
:1000100000C73FC000383FC0003F17C00007F8C00E
:00000001FF

View File

@@ -0,0 +1,129 @@
:1000000000000000000000000103070F1F3F7FFFFA
:10001000FF7F3F1F0F070301F0F8FCFCFCF8F0E046
:10002000E0F0F8FCFCFCF8F0C080000000000000EC
:10003000030100000000000000000000000080C07C
:10004000000000000000010300006070787C6E6713
:1000500000006070787C7E7F00001C1E1F0F070769
:100060007F7773717070700087C7E7FFFF7E3C0079
:100070000000000000000000000000000000000080
:100080000000000000000000000000000000000070
:10009000000018387870707100000C0E0F0707C749
:1000A000FFE0E0FEFEFEE0E0FF07077F7F7F07073F
:1000B0000000000000000000000000000000000040
:1000C000FFE0E0E6E6E6E7E7FF0707676767E7E7E1
:1000D000000E0F0F0F0F0E0E00000080C0E0F07832
:1000E0006E6E7F7F7F6E6E003C1EFFFFFF00000084
:1000F0000000000000000000000000000000000000
:1001000000000000000000000000000000000000EF
:1001100000001839797971710000FFFFFFC7C7C768
:10012000FFE0E0E7E7E7E7FFC7C7C7C7C78700000B
:1001300000000000000000000000000000000000BF
:10014000FF0707FFFFFFFFFF0000000000000000A7
:1001500000001F3F7F7B71710000FCFEFFEFC7C7EF
:100160000707E7E7C70F1FFFC7C7C7C7CF8E0C003A
:10017000000000000000000000000000000000007F
:10018000E0E0E7E7E3F0F8FF000000000000000017
:10019000000000000060787E00001F1F1F07070797
:1001A0007F1F07010000000087E7FFFF7F1F00009F
:1001B000000000000000000000000000000000003F
:1001C000000000000000000000000000000000002F
:1001D00000001E3F7F7B717100003CFEFFEFC7C730
:1001E0007171717B7F3F1E00C7C7C7EFFFFE3C00E8
:1001F00000000000000000000000000000000000FF
:1002000000000000000000000000000000000000EE
:10021000000018387971717100007CFEFFEFC7C7CC
:10022000717171787F3F1F00C7C7C7EFFFFEFC00E9
:1002300000000000000000000000000000000000BE
:1002400000000000000000000000000000000000AE
:10025000003F3F3F00001F3F00FFFFFF0000FEFF89
:100260003F3838383F3F1F00FF070707FFFFFE00FA
:10027000000000000000000000000000000000007E
:10028000000000000000000000000000000000006E
:10029000000C1C3C383838380000000707070707F7
:1002A0003C3F1F0F0000000007FFFFFF0707000093
:1002B000000000000000000000000000000000003E
:1002C000000000000000000000000000000000002E
:1002D00000003F7F7F7870700000FEFFFF0F07E790
:1002E000717B7F7F3F1E3C38E7CFFFFFFE000000A1
:1002F00000000000000000000000000000000000FE
:1003000000000000000000000000000000000000ED
:1003100000607F7F7F6301030003FFFFFFC3E0F006
:10032000076F7E7C78706000FB3F1F0F07030000A3
:1003300000000000000000000000000000000000BD
:1003400000000000000000000000000000000000AD
:10035000607C7F7F67070606000000C0F0FC3F1F3F
:10036000060607677F7F7C601F3FFCF0C00000002F
:10037000000000000000000000000000000000007D
:10038000000000000000000000000000000000006D
:10039000000000000000000000000000000000005D
:1003A000000000000000000000000000000000004D
:1003B000000000000000000000000000000000003D
:1003C000000000000000000000000000000000002D
:1003D0000103070F1F3F7FFF0080C0E0F0F8FCFE25
:1003E000FF7F3F1F0F070301FEFCF8F0E0C0800015
:1003F00083432418182442818142241818244383FB
:10040000C1C2241818244281814224181824C2C170
:100410008142241818244281814224181800008146
:1004200081000000000000818100000000000081C8
:100430008000001818244281C080000000000000E5
:1004400003010000000000000000000000000000A8
:10045000000000000000000000000000000000009C
:10046000000000000000000000000000000080C04C
:100470000000000000000103C08000000000000038
:100480000301000000000000000000000000000068
:10049000000000000000000000000000000000005C
:1004A000000000000000000000000000000000004C
:1004B000000000000000000000000000000000003C
:1004C000000000000000000000000000000080C0EC
:1004D0000000000000000103C080000000000000D8
:1004E0000301000000000000000000000000000008
:1004F00000000000000000000000000000000000FC
:1005000000000000000000000000000000000000EB
:100510000000000000000000C0800000000000009B
:100520000301000000000000C08000000000000087
:10053000030100000000000000000000000080C077
:1005400000000000000001030000000000000000A7
:10055000000000000000000000000000000000009B
:100560000000000000000000C0800000000000004B
:100570000301000000000000000000000000000077
:10058000000000000000000000000000000000006B
:10059000000000000000000000000000000000005B
:1005A000000000000000000000000000000000004B
:1005B000000000000000000000000000000000003B
:1005C000000000000000000000000000000080C0EB
:1005D000000000000000010300000000000080C0D7
:1005E00000000000000001031F1F03070F1D18007B
:1005F000F8F8181818F8F000001F1F191919181822
:1006000000F8F89898981818001F1F18181C0F0762
:1006100000F8F8181838F0E0FFFFFFFFFFFFFFFFBA
:10062000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA
:10063000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA
:10064000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA
:10065000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA
:10066000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A
:10067000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A
:10068000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A
:10069000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A
:1006A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A
:1006B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A
:1006C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A
:1006D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2A
:1006E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1A
:1006F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A
:10070000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9
:10071000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9
:10072000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9
:10073000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9
:10074000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9
:10075000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9
:10076000FFFFFFFFFFFFFFFFFFFFE7DBDBDBFFFF1D
:10077000FFE0E0E6E6E6E0F1FF0707676767078F5F
:10078000FFFFFFFFFFFFFFFFFFE0E0E6E6E6E7E732
:10079000FF0707676767E7E7FFFFFFE0E0FFFFFF8F
:1007A000FFE7E70707E7E7FFFFE0E0E7E7E3F0F849
:1007B000FF0707E7E7C70F1FFFE0E0FEFEFEE0E0F0
:1007C000FF0F07676767070FFFE0E0E7E7E7E7FF6F
:1007D000FF0707FFFFFFFFFF000000000000000011
:1007E0000000000000000000000000000000000009
:1007F00000000000000000000000000000000000F9
:00000001FF

View File

@@ -0,0 +1,129 @@
:10000000FFFFFFFFFFFFFFFFFEFCF8F0E0C08000F6
:100010000080C0E0F0F8FCFE0F07030303070F1F8A
:100020001F0F07030303070FFFFFFFFFFFFFFFFF84
:10003000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0
:10004000FFFFFFFFFFFFFFFFFFFF9F8F8783919859
:10005000FFFF9F8F87838180FFFFE3E1E0F0F8F8E7
:1000600080888C8E8F8F8FFF783818000081C3FFB7
:10007000FFFF9F8F87838180FFFFE3E1E0F0F8F8C7
:1000800080888C8E8F8F8FFF783818000081C3FF97
:10009000FFFFE7C7878F8F8EFFFFF3F1F0F8F83887
:1000A000C09F1F0101011F1F03F9F8808080F8F82D
:1000B000FFFFE7C7878F8F8EFFFFF3F1F0F8F83867
:1000C000001F1F191919181800F8F898989818188F
:1000D000FFF1F0F0F0F0F1F1FFFFFF7F3F1F0F871E
:1000E00091918080809191FFC3E1000000FFFFFFAC
:1000F000FFF1F0F0F0F0F1F1FFFFFF7F3F1F0F87FE
:1001000091918080809191FFC3E1000000FFFFFF8B
:10011000FFFFE7C686868E8EFFFF00000038383866
:10012000001F1F1818181800383838383878FFFFA3
:10013000FFFFE7C686868E8EFFFF00000038383846
:1001400000F8F80000000000383838383878FFFF31
:10015000FFFFE0C080848E8EFFFF0301001038385F
:10016000F8F8181838F0E103383838383071F3FFF0
:10017000FFFFE0C080848E8EFFFF0301001038383F
:100180001F1F18181C0F87C0383838383071F3FF1C
:10019000FFFFFFFFFF9F8781FFFFE0E0E0F8F8F837
:1001A00080E0F8FEFFFFFFFF7818000080E0FFFF0F
:1001B000FFFFFFFFFF9F8781FFFFE0E0E0F8F8F817
:1001C00080E0F8FEFFFFFFFF7818000080E0FFFFEF
:1001D000FFFFE1C080848E8EFFFFC301001038381E
:1001E0008E8E8E8480C0E1FF383838100001C3FF46
:1001F000FFFFE1C080848E8EFFFFC30100103838FE
:100200008E8E8E8480C0E1FF383838100001C3FF25
:10021000FFFFE7C7868E8E8EFFFF83010010383800
:100220008E8E8E8780C0E0FF38383810000103FFC3
:10023000FFFFE7C7868E8E8EFFFF830100103838E0
:100240008E8E8E8780C0E0FF38383810000103FFA3
:10025000FFC0C0C0FFFFE0C0FF000000FFFF0100C3
:10026000C0C7C7C7C0C0E0FF00F8F8F8000001FF32
:10027000FFC0C0C0FFFFE0C0FF000000FFFF0100A3
:10028000C0C7C7C7C0C0E0FF00F8F8F8000001FF12
:10029000FFF3E3C3C7C7C7C7FFFFFFF8F8F8F8F8D5
:1002A000C3C0E0F0FFFFFFFFF8000000F8F8FFFF19
:1002B000FFF3E3C3C7C7C7C7FFFFFFF8F8F8F8F8B5
:1002C000C3C0E0F0FFFFFFFFF8000000F8F8FFFFF9
:1002D000FFFFC08080878F8FFFFF010000F0F818BC
:1002E0008E848080C0E1C3C71830000001FFFFFF8B
:1002F000FFFFC08080878F8FFFFF010000F0F8189C
:100300008E848080C0E1C3C71830000001FFFFFF6A
:10031000FF9F8080809CFEFCFFFC0000003C1F0FC4
:10032000F8908183878F9FFF04C0E0F0F8FCFFFF07
:10033000FF9F8080809CFEFCFFFC0000003C1F0FA4
:10034000F8908183878F9FFF04C0E0F0F8FCFFFFE7
:100350009F83808098F8F9F9FFFFFF3F0F03C0E00B
:10036000F9F9F8988080839FE0C0030F3FFFFFFFFB
:100370009F83808098F8F9F9FFFFFF3F0F03C0E0EB
:10038000F9F9F8988080839FE0C0030F3FFFFFFFDB
:10039000F0E0C0C0C0603800FF7F3F1F0F070301BF
:1003A000003860C0C0C0E0F00103070F1F3F7FFFAF
:1003B000F8F0E0E060303800FF7F3F3F4F870301F7
:1003C00000383060E0E0F0F80103874F3F3F7FFFE7
:1003D000FEFCF8F0E0C08000FF7F3F1F0F07030125
:1003E0000080C0E0F0F8FCFE0103070F1F3F7FFF15
:1003F00067BDDB6666DBBD6666BDDB6666DBBD676B
:10040000E6BDDB6666DBBD6666BDDB6666DBBDE65C
:1004100066BDDB6666DBBD6666BDDB66007E7A7A3E
:10042000427A5A7E7E4E666A6A664E7E5E7E7E4264
:100430007E5E7E0066DBBD66FFE0E0FEFEFEE0E085
:10044000FF07077F7F7F0707FFF0E0E7E7E7E0F0C0
:10045000FF0F07E7E7E7070FFFE0E0E7E7E7E7FF62
:10046000FF0707FFFFFFFFFFE0E0E7E7E3F0F8FF2C
:100470000707E7E7C70F1FFFFFF0E0E7E7E7E3F352
:10048000FF0F07E7E7E7C7CFFFE0E0FEFEFEE0E093
:10049000FF0F07676767070FFFE0E0FFFCF8E0E08A
:1004A000FF07071F3FFF0707FFF0E0E7E7E7E3F37A
:1004B000FF0F07E7E7E7C7CFFFE0E0E6E6E6E7E79D
:1004C000FF0707676767E7E7FFE0E0E7E7E7E7FFC2
:1004D000FF0707FFFFFFFFFFFFE3E3E6E6E6E0F0CD
:1004E000FF0F07676767C7CFFFFFFFE0E0FFFFFF72
:1004F000FFE7E70707E7E7FFE0E0FEFEFEE0E0FFDB
:100500000F07676767070FFFE0E0FFFCF8E0E0FF19
:1005100007071F3FFF0707FFFFE0E0E7E7E3F0F80B
:10052000FF0707E7E7C70F1FFFE0E0E6E6E6E0F1B9
:10053000FF0707676767078FFFFFFFE0E0FFFFFF29
:10054000FFE7E70707E7E7FFFFE0E0E7E7E7E7E7C1
:10055000FF0707FFFFFFFFFFF0E0E7E7E7E3F3FF39
:100560000F07E7E7E7C7CFFFFFFFF0E0E7E7E7E4C4
:10057000FFFF0F07E7E7E7E7E0F0FFE0E0FEFEFE42
:10058000C7CFFF0F07676767E0E0FFE0E0FFFFFE10
:10059000070FFF07078F1F3FFFFFE0E0FFE0E0E6E8
:1005A0001F8F0707FF070767E6E6E0F1FFE0E0E7D8
:1005B0006767078FFF0707FFE7E7E7FFE0E0E6E68B
:1005C000FFFFFFFF07076767E6E7E7FFFFFFFFFFA4
:1005D00067E7E7FFFFFFFFFFE0E0FCF9F1E3E7FF7C
:1005E00007073F1F8FC7E7FFE0E0FCF8F0E2E7FFF7
:1005F0000707E7E7E7070FFFFFE0E0E6E6E6E7E7E4
:10060000FF0707676767E7E7FFE0E0E7E7E3F0F882
:10061000FF0707E7E7C70F1FFFC399BDBDBD99C31C
:10062000FFFFFFBB81BFFFFFFF9B89ADADADA1B356
:10063000FFDD9DB5B5B581C9FFCFC7D3D9DD81DF5A
:10064000FFD195B5B5B585CFFFC391B5B5B585CF0C
:10065000FFFDBD9DCDE5F1F9FFCB81B5B5B581CBF2
:10066000FFF3A1ADADAD89C3FF87D3D9DDD9D38762
:10067000FF81B5B5B5B581CBFFC399BDBDBD99DBD4
:10068000FF81BDBDBDBD99C3FF81B5B5B5B5BDBDCC
:10069000FF81F5F5F5F5FDFDFFC399BDBDADA98B56
:1006A000FF81F7F7F7F7F781FFFFFFBD81BDFFFF80
:1006B000FFCF9FBFBFBF9FC1FF819FCFE7D399BD32
:1006C000FF81BFBFBFBFBFBFFF81F3E7CFE7F381AC
:1006D000FF81F9F3E7CF9F81FFC399BDBDBD99C3EA
:1006E000FF81EDEDEDEDE1F3FFC399BDADCD99A334
:1006F000FF81EDEDED8DA1B3FFDB91B5A5AD89DBFC
:10070000FFFDFDFD81FDFDFDFFC19FBFBFBF9FC17F
:10071000FFF1C79FBF9FC7F1FFC19FCFE7CF9FC129
:10072000FFBD99CBE7D399BDFFF9F3E78FE7F3F965
:10073000FFBD9D8DA5B1B9BDFFFFFFFFFFFFFFFF0F
:100740008000000000000000010000000000000028
:100750000000000000000080000000000000000118
:100760000000000000000000C3BD7E7E7E7EBDC391
:10077000C09F1F1919191F0E03F9F8989898F8705F
:10078000FFFFFFFFFFFFFFFF001F1F1919191818B8
:1007900000F8F898989818180000001F1F0080C0F3
:1007A000001818F8F8181903C09F1F18181C0F0715
:1007B00003F9F8181838F0E0001F1F0101011F1F8E
:1007C00000F0F8989898F8F0001F1F18181898C0B3
:1007D00000F8F80000000103000000000000000025
:1007E0000000000000000000000000000000000009
:1007F00000000000000000000000000000000000F9
:00000001FF

View File

@@ -0,0 +1,769 @@
:10000000ED56310044C37B00E5C5F5040CC3710017
:10001000856F3001247EC9FFE5B7ED52E1C928287C
:10002000E5772310FCE1C9ADE187856F303C1839D5
:100030004700FD36410028E1C3290BD5F5BE300548
:1000400016005F1919235E2356EBF1D1E9A7C8E525
:10005000D5C506004F09EB09411B2B1ABE20021023
:10006000F879C1D1E1C9C32708247E23666FE977F7
:10007000230DC26F0010F8F1C1E1C9FD218E4021AE
:1000800084001804CDBC00E9F3CD6C0A0100041112
:100090000040AFCD7B0A12130D20FB10F6CD3507C3
:1000A000CDDD02CD8E04CD2E06CDFC15CDC20228AD
:1000B000073805CDC1081803CDBA08E9F5181CD5D5
:1000C000E5FDE5D12102007D21000019360021481F
:1000D0000019EB3D20F2CDAE0EE1D13A4540E608E5
:1000E0002006CDAE0228D8AFCDA901CDF000F1C9D0
:1000F000FDE5E5D5C5F5010200414FFDE5D1AFC5F0
:1001000021020019010704480600CF21020019CF7F
:1001100021480019EBC110E7FDE5D1413A4A4021E1
:100120000100197779903C210000197721480019C6
:10013000EB0520E8CDDF1841FDE5D1FDE5AF21015C
:100140000019BE282E210100193579903C210000AC
:100150001977D5FDE1C5CD2A03CD9628C12101002F
:10016000197EA7200E79903CD5FDE1C5CD2A03CD9F
:10017000D011C121480019EB10C3D1D5AF412101E5
:100180000019BE20C021480019EB10F2FDE1411119
:10019000480079903CCD1506FD1910F6CD350BCDF4
:1001A000D310F1C1D1E1FDE1C9E5C5F54F06FF1856
:1001B0000BCD1508CDAE02CD58120600CD810A2810
:1001C000F00C0D20166FCDAE02BD38E5CD150845FB
:1001D000CD8F0210FB7D214540CBE66FF17DC1E163
:1001E000C9E5F52145403A3D40E603FE03200F7E78
:1001F000E640283CD5118E40CD4703D11832FE0190
:10020000202E7EE630FE302027CBA6D5C5214440E7
:10021000ED5BCA12010201CDFC087AC610573A45BF
:1002200040E6023E20280401200079CDCC0BC1D14C
:10023000CD6504F1E1C9F5CD7A082814E5214540E2
:10024000CB5E200BCD52023D20FACBE6CD3F1CE128
:10025000F1C9E5D5C5F5114440214540CB562813D9
:100260001AFE993804CBCE1821CB4E2004CBCE18E1
:1002700019CB8E7EE6013C471A802730023E991248
:100280004FAF90274779B8D4C108F1C1D1E1C9E592
:10029000F52144403A4540E60128057EFE993003A9
:1002A000CDBA087EA72803D6012777F1E1C93A44E1
:1002B00040A7C03A4540E604C83A4540E602C8AF08
:1002C00037C9C54F3A454047E608200E78E6012079
:1002D0000578E6042003371801AF79C1C9F5AF32BC
:1002E00044403E01CDF00A3E02200CCDF00A20032E
:1002F000AF180F3E01180BCDF00A20043E0418027F
:100300003E083245403E06CDF00A28083A4540F600
:1003100080324540F1C9E5214540CBE6CBEEE1C94D
:10032000E5214540CBA6CBAEE1C9E5F5214540CB63
:100330007E280C3DE60128070602CD2B0B1805068A
:1003400001CD350BF1E1C9C50102004121000019C1
:100350007EA7282F3D4FD5C521020019EB010200D1
:100360000901070478CDDC03C12817C5060021CE9A
:100370001209097E23666F010704EBCDFC08C1CD8D
:10038000A81DD121480019EB10C2C1C9F5BE302FFC
:10039000C5D5E5EB210000FDE5C1094F7EA7281C6E
:1003A000EB06000909234E2346110200FDE5E11981
:1003B0001107047A545DCDC103CDD210E1D1C1F152
:1003C000C9A7C8E5D5C5F5F50A8E2712031323E39F
:1003D00025E3C2C803E1E17CC1D1E1C9A7C8E5D5E5
:1003E000C5F50E00471ABE282E0CC54F46C5E6F0CF
:1003F0004F78E6F0B9C1792810C610274FC5E60F2F
:100400004F78E60FB9C179280CE6F04779E60FC6B8
:100410000127E60FB012C1132310CA79C1A778C112
:10042000D1E1C9E5214540CBF6E1C9E5214540CB05
:10043000B6E1C9F5A7282CE5D5C5470E00218E40A9
:1004400011020019C5EB060021CE1209097E2366B0
:100450006F010704EBCDFC0811480019C10C10E432
:10046000C1D1E1F1C9213D4034237E3CFE3C381C22
:100470003600237E3CFE3C38133600237E3CFE3C97
:10048000380A3600237E3CFE183801AF77C9E5F5FF
:10049000213D40AF772377237723772377F1E1C995
:1004A000213D40235E2356237E23666F3A3D40C99B
:1004B000F5C54F7EA72838D5E547237E23A1BE2367
:1004C0002008235E235623231809BE201A23232342
:1004D0005E235623C54E2346237E23E5666FEBCD70
:1004E000E20BE123C118041109001910CEE1D1C1BA
:1004F000F1C9F57EA72823C5D5E547232323235E2D
:100500002356232323C54E2346237E23E5666FEB24
:10051000CDE20BE1C110E4E1D1C1F1C9E5C54FB7AE
:10052000CD2C051FFE6430F8B9C1E1C9E5D52A48D4
:10053000405E23563EF1CD93057BC6195F7ACE36D9
:10054000772B73D1E1C9E52A48403636233623E1BB
:10055000C9E5C5F5424B110000CB38791F4F300378
:10056000EB19EB29B0C25905F1C1E1C9F5C57C2FE2
:10057000477D2F4F032100003E11E5093001E3E1E3
:10058000CB13CB12CB15CB143DC27A05CB1CCB1DA4
:10059000C1F1C9E5F5EB110000B71F3003EB19EB12
:1005A00029B7C29A05F1E1C9E5C5F5FDE5C121020A
:1005B0000009EB01070478010A0004CD4D00380E54
:1005C000D511090019D10D20F210F004182E050BD9
:1005D00078B1281BD5E5E56069110900CD510542C8
:1005E0004BD121090019092BEB092BEDB8E1D1EB17
:1005F000010704480600EDB0CD0B07BFC178C1E18B
:10060000C9E5D5C52ACC12EB2A4640010704CDFC2A
:1006100008C1D1E1C9D5C5F5ED5B4640CDA805209F
:1006200009CD2A03CD1B19CD0B07F1C1D1C9E5D5E1
:10063000C5F521044801FC03CDF906210048BE2080
:100640002E010200210448060A116600794EB928DD
:10065000110C0D284B1910F5010004210048AFCFF3
:10066000182823224640210248224840C3F406AFFE
:10067000CD7B0AC608210048010501180577BE2078
:10068000322310F90D20F6A720E6210448010200CC
:100690007123224640210248224840CD4605184E8B
:1006A0007723224640210248224840CD3616CD0B02
:1006B000071841218458016600CDF9060102002186
:1006C0008058BE20143A8458B9200E2185582246FD
:1006D00040214240224840181B218058066AAFE75B
:1006E0002184587123224640214240224840CD3681
:1006F00016CD0B07F1C1D1E1C9E5C53EA5040C1823
:100700000286230D20FB10F9C1E1C9E5C5F52A4693
:100710004001004CB7ED4221044801FC033806219A
:100720008458016600CDF90601FCFF0977F1C1E1AB
:10073000C92A4640C9E5C5F5010480210058AFE744
:1007400006087C80670D20F63EFFED47773E20CD02
:10075000BD09CD350BCD730ACDE11ACD1508CD13EA
:100760000C20D5F1C1E1C9E5C5F52100400620AF57
:10077000E73EFC3221403E1C322040212240061040
:10078000AFE73232403EFE3234403E0C323340F16D
:10079000C1E1C9210040114058012000EDB02122E3
:1007A000401CEDA01CEDA01CEDA01CEDA01CEDA0BC
:1007B0001CEDA01CEDA01CEDA01CEDA01CEDA01CD0
:1007C000EDA01CEDA01CEDA01CEDA01CEDA01C7E5E
:1007D00012C9E5C5F521204006004E3E1C912811A6
:1007E000CB3FCB3F361C210440090E0470093D204D
:1007F000FB3A3240A720033230402133404E3E0CBA
:1008000091280ECB3F360C212440097023233D2034
:10081000FAF1C1E1C9F53A0078ED57A7200176CD8C
:10082000D207CDE101F1C9E5D5C5F5CD6C0ACD936F
:1008300007CD3602CDC908CDEC1ACD5108CD730ACB
:10084000F1C1D1E1ED45C54F7BB2A14F7BA2B1C152
:10085000C93A3A405F3A006057323A403A3C40CD9C
:100860004608323C403A39405F3A006857323940D6
:100870003A3B40CD4608323B40C9E5C521354001F1
:10088000000278CD160B280C7EF68077FEA1302270
:100890003C77181E7EA7281ACBBECB7F2014FE0201
:1008A000380EFE21300A0C3A37403C2803323740DC
:1008B00036002310CD79A7C1E1C9F5AF320570F13B
:1008C000C9F53EFF320570F1C93A3840A72819FE34
:1008D000103810D610323840C03E04323840AF32A3
:1008E0000360C93D323840C93A3740A7C83D323766
:1008F000403E403238403EFF320360C9E5D5C5F581
:1009000079878787825778A7792011A728617AC6C7
:10091000F8573E30CDCC0B0D2855183EA728497A04
:10092000C6F8577EE60FC630CDCC0B0D283A7AC6F6
:10093000F8577EE6F00F0F0F0F280FC630CDCC0B07
:100940000D2829CD75092812180DCD7509280FC657
:1009500030CDCC0B0D28152310C57AC6F8573E2094
:10096000CDCC0B0D20F41807AFBE20032310F9C126
:1009700078C1D1E1C9E5C54FAF180423BE200210EC
:10098000FA79C1E1C9E5D5C54F4787878782577A8C
:10099000D60857D5EB210A00CD6C057DC630EBD1CA
:1009A000CDCC0B7DB4280410E6180D05280A7AD6A4
:1009B00008573E20CDCC0BBF79C1D1E1C9E5D5C5E3
:1009C000F521B2124F0600094E210050711101505D
:1009D00001FF03EDB0CD6707F1C1D1E1C9E5D5F560
:1009E000C5CB38CB38CB38287ECB39CB39CB39285F
:1009F00076D521B212856F3001247EF5CDAE0BF194
:100A00001600E55977231D20FBE11E201910F3D1B4
:100A10003A2140C604E63C284E0F0FC1C5F578B711
:100A20001F82C6162F5779B71F83C6F85F78C61086
:100A30004779C6104F210040F1F57A96E56F78CBE3
:100A40003F85E1232323B830197B96E56F79CB3FAF
:100A500085E1B9300DE5D5C5CD960EC1D1E12B2B81
:100A60002B2B23F13D20D2C1F1D1E1C9F5AF3201E9
:100A700070F1C9F53EFF320170F1C9F53A0078F125
:100A8000C93A3B40E60120093A3B40E602C83E0233
:100A9000C93E01C9F5E53D203021D50A3A3C405711
:100AA000A62320157AA620151E00237AA62012233D
:100AB0007AA620111600E1F1C91E0118ED1EFF18DB
:100AC000E9160118F116FF18ED21D90A3A3B4057F3
:100AD0003A3C4018CB80200804402008043D2808F8
:100AE0003A3B40E6103E02C93A3C40E6103E01C99E
:100AF000E5C5F5E6074FFE0330053A006818033AEE
:100B000000704779210E0BD7A0C178C1E1C9004020
:100B10008001020408003D28083A0060E6023E0217
:100B2000C93A0060E6013E01C9ED4DF5AF320770EC
:100B3000320670F1C9F53EFF320770320670F1C916
:100B40000405C8E5C56779E6F80F0F6F7C2658776E
:100B50002C2C10FBC1E1C9E5E6F80F0F6F26587E7B
:100B6000E1C9E5C54C210058062071232310FBC1C3
:100B7000E1C9E5C5F56F26002901DB15097E23666D
:100B80006F7ECB6F2018D5E61F3C471658237EE6B4
:100B9000F80F0F3C5F7EE6071210F2D1180CE60743
:100BA0000620210158772C2C10FBF1C1E1C97AE60F
:100BB000F86F2600542929CB3BCB3BCB3B19114086
:100BC0005019C9E5D5CDAE0B7ED1E1C9E5D5F521EA
:100BD000B212856F3001247EF5CDAE0BF177F1D1E5
:100BE000E1C9E5D5C5F5AFB92824B82821E5CDAED2
:100BF0000BD1C5E5D51A11B212835F3001141A77F3
:100C000011200019D11310ECE123C10D20E4F1C132
:100C1000D1E1C9E5D5C54F21BC1A460405280E23EC
:100C20005E235623DD1AA623BE00000000AFED4769
:100C300079C1D1E1C9E5D5C5F529010D13094E23C7
:100C4000460AE603214F0CCD3B00F1C1D1E1C904B6
:100C50003D0D580C0F0DF40C696023462BCB7E28FC
:100C60001978E6073C4F1F2F3C835F78E6F80F0F9B
:100C70000F3C471F2F3C8257180C78CB38CB38CB12
:100C80003804E6073C4F7E23E5E6180F0F0FEF9779
:100C90000CAD0CC40CDD0CCDAE0BD1131A160059E3
:100CA000E577231D20FBE11E201910F3C9CDAE0B03
:100CB000D1131A112000E5C5773C1910FBC1E123BF
:100CC0000D20F3C9CDAE0BD1E5C5131A777DC62033
:100CD0006F30012410F4C1E1230D20ECC9CDAE0B1F
:100CE000D1131A11E0FFE5C5773D1910FBC1E123CF
:100CF0000D20F3C90ACB7F20021D1DCB772001AF49
:100D0000213240772B3EFC93772B3EF09277C9211E
:100D100033407E23BEC80ACB7F28021D1DCB772817
:100D2000067EC6027718042B7E3535212240856F5A
:100D30003001243EF09277233EFC9377C921204076
:100D40007E23BEC80ACB7F28097AD608577BD608EF
:100D50005F0ACB7728067EC6047718072B7EC6FC71
:100D600077C604210040856F3001247AC61E2F7794
:100D700023030A77230B0AE6380F0F0F772373C973
:100D8000E5D5C5F529010D13094E23460AE60321D1
:100D90009A0DCD3B00F1C1D1E1C9044B0EA30D0C5E
:100DA0000EF10D696023462BCB7E281978E6073CAF
:100DB0004F1F2F3C835F78E6F80F0F0F3C471F2F24
:100DC0003C8257180C78CB38CB38CB3804E6073C3C
:100DD0004F21B2127DC6206F3001247EF5CDAE0BBF
:100DE000F1160059E577231D20FBE11E201910F3B1
:100DF000C90AE68028021D1D2131403EFC93BEC079
:100E00002B3EF09296C07723772377C90AE6802895
:100E1000021D1D3A34404FC602CB3FC8473EFC93EB
:100E20005F3EF09257212240BE2328042310F9C9C7
:100E30007BBE7A20F779D6023234400600EB2122BD
:100E400040097E127023137E1270C969607AC61E33
:100E50002F57CB7E2807C608577BC6F85F234E3A2C
:100E60002140C604E6FCC80F0F472B7EE6380F0F63
:100E70000FF52100407ABE23201579BE2011237E74
:100E8000E3BCE323200B7BBE2007CD960E18052381
:100E9000232310E1F1C9EB2121407ED60477C60758
:100EA0004F0600210040090E04EDB82371C9E5C5C5
:100EB000F5210000225F40CDB5123E01CD37293E1D
:100EC00000CD5811FD3402CD732CCD2C05CDAE02D2
:100ED0002033CD242ECD1508CDAE022028CDBA2149
:100EE0003E01CD2717CD090F214E10CDF2040E0182
:100EF000CDD310CDAE02200DCD1910CDAE02200500
:100F00000E01CDD011F1C1E1C9E5D5C5F521530FD1
:100F1000111018010916CDE20B21155811430F01CC
:100F20002C01CD150879E61FFE1F20031A1377CD7B
:100F3000AE0220050B78B120E9CDB5123601F1C122
:100F4000D1E1C90204050102040501020405010200
:100F500004050144455349474E204C414253204922
:100F60004E432021203139383320202020202020DA
:100F70002020202020202020202020202020205041
:100F8000484F4E4520203430382020373438203721
:100F9000363032202053414E544120434C4152417F
:100FA0002043414C4946202020202054484F4D41A9
:100FB00053204155544F4D415449435320494E43CA
:100FC0002020202020202020202020202020202021
:100FD0002020202020202020464F5220414D5553D4
:100FE000454D454E54204F4E4C5920202020202066
:100FF00020202020202020202020202020202020F1
:101000002020202020545249504C45204452415722
:1010100020504F4B4552202020E5C5F506783E0074
:10102000214E10CDF204CD15084FCDAE02201B7914
:101030003C10F306783E00214E10CDB004CD1508CB
:101040004FCDAE022004793C10F0F1C1E1C9011F7F
:10105000000F5A10961003144020202042452041D2
:10106000204249472057494E4E45522020202020FB
:101070002020202020202020202020202020202070
:10108000202020545249504C452044524157205072
:101090004F4B45522020202020202020202020209F
:1010A0002020202020202020202020202020202040
:1010B0002020202020202020202020202020202030
:1010C0002020202020202020202020202020202020
:1010D0002020C9E5D5C5F50D28083E01CD3304CD46
:1010E00058113E04CD720B2144111140200101140E
:1010F000CDE20B0605113000CD3107C5010704CD47
:10110000FC08CDB911010900097AC6785701070416
:10111000CDFC08CDB9117AD67857CD810A20223E70
:101120002DCDFA267BD6085F01090009C110CCCD70
:10113000810A20053E78CDFA26CDE81AF1C1D1E129
:10114000C9C118F5414C4C2054494D4520484947E8
:10115000482053434F524553E5D5C5F53D280E3A37
:101160008C40FE02202CFDE5E1114800191102001F
:101170001901070411E8A0CDFC0821971111F0A86E
:10118000010106CDE20B219D1111F80001011CCDDA
:10119000E20BF1C1D1E1C9504F494E5453504C417B
:1011A000594552204F4E45202020202020202050FD
:1011B0004C415945522054574FE5D5C5F50104001F
:1011C000097AC64057010105CDE20BF1C1D1E1C951
:1011D000E5C5F5CDB512CDEA1106783E00CDB004D7
:1011E000CD15083C10F7F1C1E1C90D21F811C83D3A
:1011F000210412C8213812C9011F000F1B1224122A
:1012000001094840011F000F101224120114482048
:10121000504C41594552204F4E452047414D4520A5
:101220004F56455220202020202020202020202002
:101230002020202020202020011F000F44122412F3
:1012400001144820504C415945522054574F2047D3
:10125000414D45204F564552E5D5C5F504052803B7
:10126000CDB5120C0D2015FE012011218A12114856
:1012700028010112CDE20BF1C1D1E1C9219C12116B
:101280004808010119CDE20B18ED50524553532087
:10129000504C415945522053544152545052455399
:1012A000532031204F52203220504C41594552207A
:1012B0005354415254D5C5F50150E01108003E2069
:1012C000CDDD09CD1508F1C1D1C900C8E858E80045
:1012D000E800E7ED00000000000000000000000052
:1012E0000000C3C4C5C6C7C8C9CACBCC0000000033
:1012F000000000CDCECFD0D1D2D3D4D5D6D7D8D937
:10130000DADBDCDDDEDFE0E1E2E3E4E5E67B13A748
:1013100013BB13CF13E313F7130B141F143314472A
:10132000145B146F1483149714911300007B13B192
:1013300013C513D913ED130114151429143D1451B9
:1013400014651479148D14A114E314F71401150F06
:10135000151D15291535153F1553155B156B157B97
:10136000158B159B15AB15B715C315CF15C714D520
:1013700014B914AB14ED1449156315511CE7E7E7D4
:10138000E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7ED
:10139000E7511C8082828182828282838485868258
:1013A0008282827E82827F5119056A6C07006B6D92
:1013B000005119056E7007006F71005119050A0C74
:1013C00007000B0D005119050E1007000F110051F9
:1013D0001905123C0700133D00511905164007007E
:1013E0001741005119051A1C07001B1D0051190552
:1013F0001E2007001F2100511905223C070023254C
:1014000000511905264007002729005119052A3CDB
:1014100007002B2D005119052E4007002F310051D8
:1014200019053234070033350051190536380700E5
:101430003739005119053A3C07003B3D0051190569
:101440003E4007003F410051190542440700434513
:1014500000511905464807004749005119054A4CF3
:1014600007004B4D005119054E5007004F510051D8
:1014700019055254070053550051190556580700D5
:101480005759005119055A5C07005B5D0051190559
:101490005E6007005F6100511905626407006365C3
:1014A0000051190566680700676900511A000000BD
:1014B000000072740006737508511A0000000000E5
:1014C00076780006777908511A00000000000102C2
:1014D0000006030408511A00000000007A7C000690
:1014E0007B7D08511987898B8D888A8C8E511914C0
:1014F0001824301519282C5119E8ECECEAE9ECEC29
:10150000EB51298F919395979990929496989A512F
:1015100029E8ECECECECEAE9ECECECECEB51219B8F
:101520009D9FA18D9C9EA0A28E5121E8ECECECEA3F
:10153000E9ECECECEB5119A3979199A498929A518C
:1015400019E8ECECEAE9ECECEB5119F5F1F7F9F6F6
:10155000F2F8FA5111A597A7A698A85111E8ECEA5C
:10156000E9ECEB5111EEF1F3EFF2F45131ADAFB123
:10157000B3B5B7B9AEB0B2B4B6B8BA5131E8ECEC65
:10158000ECECECEAE9ECECECECECEB51318F89A9FA
:10159000A99795A7908AAAAA9896A85131E8ECEC49
:1015A000ECECECEAE9ECECECECECEB5121A58B9FDC
:1015B000ABBBA68CA0ACBC5121E8ECECECEAE9ECAE
:1015C000ECECEB512105BDBFC10706BEC0C20851FE
:1015D00021E8ECECECEAE9ECECECEBE515E615E9DE
:1015E00015F315F6152101EAF2089199A1A9B1B9EF
:1015F000C1C9D101151D041119212935E5D5C5F53C
:101600003E20CDBD09CD2516CD6116CD1603211F77
:1016100016010106110090CDE20BF1C1D1E1C943E1
:101620005245444954F53E05CDF00A3E0528023E98
:101630000A324A40F1C9E5D5C5F53E0ACD3107EB7E
:10164000215816010400EDB0215C16010500EDB033
:101650003D20EDF1C1D1E1C900500000504F4B4594
:1016600052F53E00CD720BCD7716CDEB163E00CD78
:101670002717CD5818F1C9E5D5C5F53E01CD720B38
:1016800011F008219D1601011ACDE20BCDD116FDF6
:101690007E37CD3304CDB716F1C1D1E1C9504F49E2
:1016A0004E5453202020424553542047414D45205D
:1016B000202048414E4453E5D5C5CD0106CD310724
:1016C0000104000911E060010105CDE20BC1D1E187
:1016D000C9E5D5F5FDE5E1110100196E26002311DC
:1016E000E8B83E02CD8509F1D1E1C9E5D5C5F5FDE2
:1016F000E5E11106001906243E00772310FCF1C134
:10170000D1E1C90100000002000000040000000750
:1017100000000010000000200000004000000070E9
:1017200000000000020000E5D5C5F5CD31184F3EA0
:1017300002CD720BFD7E2AFE0920020E0079FDE526
:10174000E1012A00094E0600119008215117C33B00
:1017500000025617E21701090E216417CDE20BF1C2
:10176000C1D1E1C950414952202020202020202011
:1017700020203220504149522020202020202020AB
:1017800033204F462041204B494E442020205354C3
:10179000524149474854202020202020464C555390
:1017A0004820202020202020202046554C4C204836
:1017B0004F5553452020202034204F462041204BB8
:1017C000494E442020205354524149474854204612
:1017D0004C555348524F59414C20464C5553482084
:1017E000202021641778B9C5CC231801010ECDE261
:1017F0000B010E0009473E08835F78C13CFE0920BB
:10180000E579FE09CA5F17211018CD3B00C35F17A9
:1018100009DB1D0D1E551EAA1E061F681FD21F4480
:1018200020BD20E5F57987212558856F3600F1E147
:10183000C9E5D5C5F53E091190A0FDE5E101060019
:1018400009010704CDFC08473E08835F78010400C6
:101850003D20EDF1C1D1E1C9E5D5C5F5FDE5E101D9
:101860002B00091160100605CD77183E28825723FA
:1018700010F6F1C1D1E1C9E5D5C5F57E47E60F4FB8
:1018800078E6200FB16F2600CD350C3E00B1281749
:10189000FE0E281321300078E6300F0F0F0F856FF2
:1018A0003E10835FCD350CF1C1D1E1C9E5D5C5F559
:1018B000CDA0043E05855FD63C38032418017B6F1C
:1018C000228A40F1C1D1E1C9E5D5C5F5CDA004ED2D
:1018D0005B8A4097ED523801AFC178C1D1E1C9FDB3
:1018E000E5E5D5C5F5CDFC15CD150879328C40CD93
:1018F000EB16FDE5E111020019EB211719010400B7
:10190000EDB0114800FD193DCD150820E2CD2304AE
:10191000F1C1D1E1FDE1C910000000E5D5C5F5CD6B
:101920003921CDAC18FD7032CDB512CD6319EBCD98
:10193000111A1118503E0501751ACDC818281CCD72
:101940003921CD201ACD2D1ACD901ACD150828EAAF
:101950003D20E43E3CCDFA26CDB512CD0B07F1C1BA
:10196000D1E1C9E5D5C5F50D281221FD193D2803A2
:1019700021071A11504801010ACDE20B218D1911DE
:10198000280001041CCDE20BF1C1D1E1C954484546
:10199000204A4F59535449434B20414E4420464915
:1019A000524520425554544F4E454E5445522059AD
:1019B0004F5552204E414D45205553494E4720200A
:1019C000202020202041204E4557204849474820CC
:1019D00053434F524520202020202020202020202B
:1019E00020434F4E47524154554C4154494F4E535A
:1019F00020594F55525320495320202020504C410C
:101A0000594552204F4E45504C415945522054574C
:101A10004FE5C506040E207110FDCD0B07C1E1C9CD
:101A2000C5F50A77010101CDE20BF1C1C9E5D5F594
:101A30003E00FDB6342805FD35341827FD7E32CD35
:101A4000940A3E00B2281CCD531DCDAC18CD0B0717
:101A5000FD3634141528100BC5E111751ADF30035B
:101A6000018F1AF1D1E1C903C5E1118F1ADF38F3F3
:101A700001751A18EE4142434445464748494A4BCE
:101A80004C4D4E4F505152535455565758595A2059
:101A9000C5F53E00FDB6352806FD3535AF1819FDF4
:101AA0007E32CDDD0A2811CD361DCDAC18FD363580
:101AB0001423F53E088257F1C178C1C909002F00EF
:101AC00000402F3F3FC02F3F3E802F3F3DC02F3F64
:101AD0003B402F3F37402F3F2F802F3F1F402F3F4E
:101AE00000F5AF324B40F1C9CDE11AC9F5C501FF90
:101AF000003A4B40A72838D5E5111E41F51A1321AD
:101B00003E1BCD3B00201F214B4035F1FE01281725
:101B10001BC5D56F260029294D446B62232323233F
:101B2000EDB0D1C11804F11313133D20CFE1D179E9
:101B3000320078783206680F320768C1F1C90C1F8D
:101B40001C1F1C1F1C1F1C1F1C1F1C1F1C1F1C1FBD
:101B50001C1F1C2F1C2F1CD5C5F54FA7280BFD7E65
:101B600000A720052123411835211E413A4B40A7EB
:101B7000280B4779110400BE30071910FA71EB18D1
:101B800017281A79EB68260029294D44195D542B32
:101B9000131313EDB82377EB214B4034EB23F1C142
:101BA000D1C9E5A728044F1A180E131AFEFF2819E9
:101BB000070707E6073C4F1AE61F21001C856F3018
:101BC00001240DAF3C794E0603E1C9E5A728073D86
:101BD00028214F1A1811131AFEFF281A070707E6C3
:101BE0000721F81BD74F1AE61F21001C856F300113
:101BF00024794E060204E1C9574C41362B20150AC0
:101C00000C1A27333E49535D666F777F868D939913
:101C10009FA5AAAFB3B7BCBFC3C6CACDD0D2FFEB96
:101C20007E235E2356CDA21B722B732B77EBC9EB61
:101C30007E235E2356CDCB1B722B732B77EBC9E52E
:101C4000D5F53E00CD571B11531C3600237323726C
:101C5000F1D1E1C92C7073B5FFE5D5F53E03CD5741
:101C60001B116D1C360023732372F1D1E1C9606131
:101C700062637EFFE5D5F53E03CD571B11881C3608
:101C80000023732372F1D1E1C9626364657EFFE5CD
:101C9000D5F53E03CD571B11A31C360023732372C9
:101CA000F1D1E1C9646566677EFFE5D5F53E03CDF8
:101CB000571B11BE1C360023732372F1D1E1C96694
:101CC0006768697EFFE5D5F53A4B40B7200E3E07C1
:101CD000CD571B11DF1C360023732372F1D1E1C9EC
:101CE000FE808283FFE5D5F53E02CD571B11F91C1E
:101CF000360023732372F1D1E1C9403E40FFE5D5A0
:101D0000F53E01CD571B11121D360023732372F1CE
:101D1000D1E1C99E858687BEFFE5D5F53E06CD5744
:101D20001B112D1D360023732372F1D1E1C99E6D65
:101D30006C6B6A6968FFE5D5F53E04CD571B114A07
:101D40001D360023732372F1D1E1C9BE68696A6B45
:101D50006C5EFFE5D5F53E05CD571B11671D3600BE
:101D600023732372F1D1E1C9BE8CBEFFE5D5F53EE8
:101D700009CD571B11801D360023732372F1D1E169
:101D8000C9A0A1A2A3A4A5A6A7FFE5D5F53E08CDAD
:101D9000571B119E1D360023732372F1D1E1C9A791
:101DA000A6A5A4A3A2A1A0FFC9E5D5F5CDE81A3E3A
:101DB0000ACD571B11C01D360023732372F1D1E1E8
:101DC000C9F4F5F1EEEEF0CCE8E9E5E2E2E4C0E8D2
:101DD000E9E5E2E2E4E2E2C0DECCFFE5D5F53E0B68
:101DE000CD571B11F21D360023732372011E00F123
:101DF000D1E1C9CCE7E8E9C5E9C5E9E585E5F1F355
:101E0000F4F5F1F3F5F5F0D3D1F5ECD1FFE5D5F527
:101E10003E0BCD571B11241E360023732372013C49
:101E200000F1D1E1C9CCE7E8E9C5E9C5E9E585E517
:101E3000F1F3F4F5F1F3F5F5F0D3D1F5ECD1E7E8F2
:101E4000E9C5E9C5E9E585C5EEECEBEEF1F5F5F39D
:101E5000F1EE93D3FFE5D5F53E0BCD571B116C1E6C
:101E6000360023732372012D00F1D1E1C9CCE7E8DC
:101E7000E9C5E9C5E9E585E5F1F3F4F5F1F3F5F533
:101E8000F0D3D1F5ECD1E7E8E9C5E9C5E9E585C5C9
:101E9000EEECEBEEF1F5F5F3F1EE93D3E7E8E9C5FF
:101EA000E9C5E9E585E5F1F3F4FFE5D5F53E0BCDB0
:101EB000571B11C11E360023732372016400F1D138
:101EC000E1C9CCE7E8E9C5E9C5E9E585E5F1F3F461
:101ED000F5F1F3F5F5F0D3D1F5ECD1E7E8E9C5E993
:101EE000C5E9E585C5EEECEBEEF1F5F5F3F1EE9322
:101EF000D3E7E8E9C5E9C5E9E585E5F1F3F4F5F1EE
:101F0000F3F5F5F0D3FFE5D5F53E0BCD571B111DCD
:101F10001F360023732372017800F1D1E1C9CCE7A9
:101F2000E8E9C5E9C5E9E585E5F1F3F4F5F1F3F58F
:101F3000F5F0D3D1F5ECD1E7E8E9C5E9C5E9E585E8
:101F4000C5EEECEBEEF1F5F5F3F1EE93D3E7E8E94E
:101F5000C5E9C5E9E585E5F1F3F4F5F1F3F5F5F04B
:101F6000D3D1E9E0D1F1F3FFE5D5F53E0BCD571B19
:101F7000117F1F360023732372018C00F1D1E1C958
:101F8000CCE7E8E9C5E9C5E9E585E5F1F3F4F5F164
:101F9000F3F5F5F0D3D1F5ECD1E7E8E9C5E9C5E90A
:101FA000E585C5EEECEBEEF1F5F5F3F1EE93D3E755
:101FB000E8E9C5E9C5E9E585E5F1F3F4F5F1F3F5FF
:101FC000F5F0D3D1E9E0D1F1F3F5F1F3F5F5F1F363
:101FD000F1FFE5D5F53E0BCD571B11E91F36002368
:101FE00073237201A000F1D1E1C9CCE7E8E9C5E9AA
:101FF000C5E9E585E5F1F3F4F5F1F3F5F5F0D3D1B5
:10200000F5ECD1E7E8E9C5E9C5E9E585C5EEECEB16
:10201000EEF1F5F5F3F1EE93D3E7E8E9C5E9C5E9AB
:10202000E585E5F1F3F4F5F1F3F5F5F0D3D1E9E069
:10203000D1F1F3F5F1F3F5F5F1F3F1F5F1F3F5F590
:10204000F1F3F1FFE5D5F53E0BCD571B115B2036C3
:10205000002373237201B400F1D1E1C9CCE7E8E9B0
:10206000C5E9C5E9E585E5F1F3F4F5F1F3F5F5F03A
:10207000D3D1F5ECD1E7E8E9C5E9C5E9E585C5EED9
:10208000ECEBEEF1F5F5F3F1EE93D3E7E8E9C5E912
:10209000C5E9E585E5F1F3F4F5F1F3F5F5F0D3D114
:1020A000E9E0D1F1F3F5F1F3F5F5F1F3F1F5F1F341
:1020B000F5F5F1F3F1F5F1F3F5F5F0D3FFE5D5F52D
:1020C0003E0BCD571B11D42036002373237201C859
:1020D00000F1D1E1C9CCE7E8E9C5E9C5E9E585E565
:1020E000F1F3F4F5F1F3F5F5F0D3D1F5ECD1E7E840
:1020F000E9C5E9C5E9E585C5EEECEBEEF1F5F5F3EB
:10210000F1EE93D3E7E8E9C5E9C5E9E585E5F1F343
:10211000F4F5F1F3F5F5F0D3D1E9E0D1F1F3F5F110
:10212000F3F5F5F1F3F1F5F1F3F5F5F1F3F1F5F17F
:10213000F3F5F5F0D391D1E7FFE5D5F53A4B40B78C
:10214000200E3E0BCD571B115321360023732372F3
:10215000F1D1E1C9D0CCECF7F5F4F2D0EEEEEBE939
:10216000E7E9EBEEEEF0F2F4D58EDECE8ED0F2D0D3
:10217000F2F0F2D0F7D5F7F5F7F5F010CE8ED0F2F9
:10218000D0F2F0D0F0F0CBF0EFF0D290F0DEEECE67
:102190008ED0F2D0F2F0F2D0F7D5F7F5F5F7EC8C5F
:1021A000CCF4ECF7D5F7F5F7F5F0F0F2F0EEEED071
:1021B000F0F0CEF0EEEED0899EFFCDDC21CD1E22D8
:1021C000CD4322CDA622CDC022CDDE22CDEB22CD25
:1021D000F822CDCF22CD1023CD2323C9E5D5C5F5D7
:1021E000FD363900FD363A00FD363B00FD363C0039
:1021F000FDE5E101390009EBFDE5E1012B000906F0
:10220000047EE60F4FC523E57EE60FB920031A3C96
:10221000122310F4E1C11310E8F1C1D1E1C9E5C501
:10222000F5FD363D00FDE5E1012B00097EE6F04FAE
:102230000604237EE6F0B9200610F7FD363DFFF1D7
:10224000C1E1C9E5C5F5FD363E00FDE5E1012B0024
:1022500009CD7922FE01200B3E02CD8F223E0128BE
:10226000023E0906043CFE0E300BCD8F22200610E4
:10227000F4FD363EFFF1C1E1C9E5C57EE60F4F062C
:1022800004237EE60FB930014F10F679C1E1C9E5AC
:10229000C5F506054F7EE60FB928062310F73E0167
:1022A000B7C178C1E1C9F5FD362A093E01CD4A23FF
:1022B000B7280BFE023E0020023E01FD772AF1C93D
:1022C000F53E02CD4A23B72804FD362A02F1C9F5AE
:1022D0003E03CD4A23B72804FD362A06F1C9F5FD91
:1022E0007E3E3C2004FD362A03F1C9F5FD7E3D3CCF
:1022F0002004FD362A04F1C9F53E02CD4A23B72851
:102300000D3E01CD4A23FE022004FD362A05F1C907
:10231000F5FD7E3E3C200AFD7E3D3C2004FD362A34
:1023200007F1C9E5C5F5FD7E2AFE072019FDE5E1A7
:10233000012B00093E01CD8F22200B3E0DCD8F22B7
:102340002004FD362A08F1C1E1C9E5C5FDE5E1013A
:10235000390009010004BE20010C2310F979C1E104
:10236000C9E5D5C5F5CDAC1821D02311E42301145E
:1023700000CD282ACD4F2A3E08328D40FD3636004A
:10238000FD364000FD363300FD3646003E00CDC828
:10239000182823CD882ACDF02ACD7B28200621BB02
:1023A00023CDEF2BCD15083C67CD2C057CFD6E367B
:1023B0002C20DBCD252CF1C1D1E1C90A4A24772498
:1023C000A424D124FE242B25492470254924242E1D
:1023D000F8A81E001E001E001E001E002000220085
:1023E00024000000F92303240D24172421242B2486
:1023F000F8233524F8233F2400010F00091E001F95
:10240000004010010F00091E001F004038010F009E
:10241000091E001F004060010F00091E001F004040
:1024200088010F00091E001F0040B0010F000920A5
:102430000021002810010F0009220023002860015C
:102440000F00092400250028B0C9E5F53E01FDB6BE
:102450003FFD773FFD364100213400226140216D70
:1024600024227540CD4F2ACD361DF1E1C9010F0060
:102470000934001F004010E5F53E02FDB63FFD7730
:102480003FFD364100213400226340219A24227707
:1024900040CD4F2ACD361DF1E1C9010F00093400AE
:1024A0001F004038E5F53E04FDB63FFD773FFD36A1
:1024B000410021340022654021C724227940CD4FBC
:1024C0002ACD361DF1E1C9010F000934001F00407B
:1024D00060E5F53E08FDB63FFD773FFD3641002142
:1024E000340022674021F424227B40CD4F2ACD3690
:1024F0001DF1E1C9010F000934001F004088E5F516
:102500003E10FDB63FFD773FFD36410021340022ED
:102510006940212125227D40CD4F2ACD361DF1E194
:10252000C9010F000934001F0040B0E5D5C5215C8A
:1025300025116140010A00EDB021662511754001A9
:102540000A00EDB0FD363F00FD7E473C2004FD361D
:1025500041FFCD4F2ACD531DC1D1E1C91E001E0040
:102560001E001E001E00F92303240D24172421241D
:10257000FD363F1FFD3636FFFD364100C9F5FD7EB5
:102580002AFE09C48825F1C9E5D5C5F5CDAC18CD1D
:10259000BB27FD363600FD363301FD36460021E50A
:1025A0002511ED25010800CD282ACD4F2A3E00CD6A
:1025B000C8182823CD882ACDF02ACD7B28200621D3
:1025C000DC25CDEF2BCD15083C67CD2C057CFD6EB1
:1025D000362C20DBCD252CF1C1D1E1C9040A26100F
:1025E000260A260B26500028002A000000F525F6B2
:1025F00025F525002600010F000928002900403894
:10260000010F00092A002B004088C9FD3636FFC99A
:10261000E5D5C5F5CDAC18CD9D26CD252CCDCA264A
:10262000217926118126010800CD282ACD4F2AFDC7
:10263000363301FD363600FD3646003E00CDC81863
:102640002829CD882ACDF02ACD7B28200621702686
:10265000CDEF2BCD15083C67CD2C057CFD6E362CBF
:1026600020DBCD252CCDB326CD5818F1C1D1E1C941
:10267000040A2603270A260B2750002E002C0000F0
:1026800000F5258926F5259326010F00092E002F38
:10269000004038010F00092C002D004088E5D5C509
:1026A000FDE5E1112B0019114D40010500EDB0C110
:1026B000D1E1C9E5D5C5FDE5E1112B0019EB214DAF
:1026C00040010500EDB0C1D1E1C9C5F5FD7E3FFD7A
:1026D000363F00CD592EFD773FFD362D0ECD5818D3
:1026E000CD2C054FE60F28F8FE0E30F479E63FCDED
:1026F000D42E28ECFD772DF1C1C9F5CD15083D206C
:10270000FAF1C9F53E00CD1327F1C9F53E20CD13EE
:1027100027F1C9F5CD5818CD2B273E78CD882ACD85
:1027200015083D20F7FD3636FFF1C9E5D5C5F54F53
:10273000FD7E2DE620B9FDE5E111420019281B06BA
:102740000436002310FB217427112850010108CD05
:10275000E20BCD8A1DF1C1D1E1C9444D545D3E0467
:10276000CDC103217C2711284001010BCDE20BCD07
:102770006C1D18E157494E204C4F535457494E2079
:10278000444F55424C4544E5D5C5F5FD7E2AFE092A
:102790002813FDE5E111420019E53E000604BE23C1
:1027A000200810FAE1F1C1D1E1C9FDE5E101020023
:1027B00009C1545D3E04CDC10318EAE5D5C5F5FD58
:1027C000E5E111420019EBFDE5E101060009FD7E9E
:1027D0002A07074F060009010400EDB0F1C1D1E15D
:1027E000C9E5C5F5CDA91DCDB512CD012806783EA8
:1027F00000CDB004CD15083C10F7CDB512F1C1E104
:10280000C90D210F28C83D213328C8215F28C901DF
:102810001F000F1B282728010C4840504C415945E8
:1028200052205245414459202020202020202020A1
:10283000202020011F000F3F284F28011048305052
:102840004C41594552204F4E452052454144592054
:102850002020202020202020202020202020200197
:102860001F000F6B284F2801104830504C4159452C
:10287000522054574F205245414459C5F5FD7E46DC
:102880003C280F06FFFD7E32CDDD0A28020600FD42
:102890007046C178C1C9D5C5F5CDF828CD3729CD49
:1028A0009529CDC8182842CDBA213E01CD2717CD94
:1028B0006123CDC8182832CDBA213E01CD27177A21
:1028C000FD464104FD364700FD36410028E13E014A
:1028D000CD2717CD7D25CDC818280ECD8727FD7EA5
:1028E00037CD33043E64CDFA26CD78292804F1C1D2
:1028F000D1C9FD36010018F6E5D5C5F52119290D18
:1029000028092123293D2803212D2911F8480101F7
:102910000ACDE20BF1C1D1E1C920202020202020E6
:10292000202020504C41594552204F4E45504C419B
:102930005945522054574FE5D5C5FD363500FD3673
:102940003400FD363800FD3641FFFD3647FFFD36C9
:102950003F00FD7032FD7737214D40225D40214D13
:1029600040114E40010A003600EDB0CD592ECD3356
:1029700004CD6116C1D1E1C9E5C5F5FDE5E101026E
:1029800000093E000604BE20072310FAFD3633027C
:10299000C178C1E1C9E5F5CDAC18CD732CCDE127E7
:1029A0003E02328D4021FD2911032A010600CD2867
:1029B0002ACD4F2A3E00328940FD363301FD36369E
:1029C00000FD364600CDC8182829CD882ACDF02A2A
:1029D000CD3D2ACD7B28200621F629CDEF2B67CDD2
:1029E0002C057CCD15083CCD7829FD6E362C20D5E4
:1029F000CD252CF1E1C903F32C732C242E60002685
:102A0000002400092A0A2A142A00010F00092600BE
:102A100027004038010F0009240025004060010F05
:102A20000009360036004038E5D5C5D5115F40C5F0
:102A3000EDB0C1E1117540EDB0C1D1E1C9E5F53EA0
:102A400000FDB6352006210A2A227740F1E1C9E5CA
:102A5000D5C5F5215F401140107E230602E5230E07
:102A60000507DC7C2AF53E288257F10D20F3D11AA8
:102A7000112810E510E9E1F1C1D1E1C9D55E235675
:102A800023E3EBCD350CE1C9E5D5C5F5217540CD86
:102A9000C51CFD7E33875F1600197E23666FF1CD5E
:102AA000372CF53E03CD720B21C52A1118200101E8
:102AB00013CDE20B21D82A111010010118CDE20B21
:102AC000F1C1D1E1C953454C4543542043484F49D6
:102AD0004345205553494E474A4F59535449434B58
:102AE00020414E44204649524520425554544F4EB1
:102AF000D5F53E00FDB6342805FD3534181B215FA1
:102B000040FD7E32CD940A3E00B22010B3201F1843
:102B100008CD4F2A3E14FD7734F1D1C97A07380722
:102B20003E00CD402B18EA3E01CD402B18E37B0739
:102B300038073E01CD962B18D83E00CD962B18D1E4
:102B4000E5D5C5F50FFD7E333826FE0501000538B5
:102B50000301050A3CB8200179CDD32B20F6CDE83E
:102B60001ACD191DFD364600CDAC18FD773318215E
:102B7000FE0501FF0438030104093DB9200178CDA9
:102B8000D32B20F6CDE81ACD191DFD364600FD7772
:102B900033F1C1D1E1C9C5F50F381DFD7E333E09C2
:102BA000FE0A302CCDD32B2027CDE81ACD191DFDE0
:102BB000364600FD77331818FD7E33D6053811CD23
:102BC000D32B200CCDE81ACD191DCDAC18FD7733D1
:102BD000F1C1C9E5C5F5FE05380323D6053C477E9E
:102BE0000710FD3E0038023E01B7C178C1E1C9E5DA
:102BF000F53E00FDB6352805FD35351825FD7E323C
:102C0000CDDD0A3E002818CDE81ACDAC183E00CD27
:102C1000882AFD7E33CD3B003E0AFD77353EFFFD21
:102C20007738F1E1C9D5C5F50150C01110103E202B
:102C3000CDDD09F1C1D1C9E5D5C5F54F7EA7282E57
:102C400047237E23A1BE232008235E235623231877
:102C500009BE20142323235E2356237E23E5666FBB
:102C6000EBCD350CE12318041107001910D4F1C184
:102C7000D1E1C9E5D5F5211E2A227740CD932CCD8F
:102C800031183E00FDBE083804F1D1E1C9F1D1E1AF
:102C9000C3242EF5FD7E383CCAA32C3E0032894069
:102CA000C3D62CFD7E02E60FC2D62C3A8940E6013F
:102CB000CAD62CFD7E02E6F0C2F42C3A8940E60228
:102CC000CAF42CFD7E03E60FC23A2D3A8940E60491
:102CD000CA3A2DC3802D3A8940F60132894021EF4E
:102CE0002CCDE92D210317CDBE2DCD591CF1C901E5
:102CF000000000C93A8940F6023289403E0ACDFA06
:102D00002621122DCDE92D21162DCDBE2DCD741CE1
:102D1000F1C9100000001000000020000000400079
:102D2000000070000000000100000002000000042C
:102D3000000000070000002000003A8940F604323D
:102D400089403E0ACDFA2621582DCDE92D215C2D52
:102D5000CDBE2DCD8F1CF1C9000100000001000087
:102D60000002000000040000000700000010000046
:102D70000020000000400000007000000000020081
:102D80003E0ACDFA2621962DCDE92D219A2DCDBED4
:102D90002DCDAA1CF1C90010000000100000002079
:102DA0000000004000000070000000000100000072
:102DB0000200000004000000070000002000E5D52C
:102DC000C5F5E5FDE5E111060019EB6B62C13E09B1
:102DD000F53E04CDC10303030303232323235D54E2
:102DE000F13D20ECF1C1D1E1C9E5D5C5F5E5FDE541
:102DF000E101020009EB424BE13E04CD092EFD7ECC
:102E000037CD3304F1C1D1E1C9A7C8E5D5C5F5F582
:102E1000970A9E2712031323E325E320F4E1E17CC4
:102E2000C1D1E1C9E5D5C5F5215F403A8D40874F55
:102E3000060009113500732372CD4F2A3E00CD27BD
:102E400017FD3636FFCD592ECD772ECDA02ECDFED7
:102E50001CCD5818F1C1D1E1C9E5C5F5FD7E3FFD96
:102E6000E5E1012B000906050F380236002310F8B2
:102E7000CD5818F1C1E1C9E5C5F5FD7E3FFDE5E19D
:102E8000012B000906050F3810360ECD5818CDE578
:102E90001C0E1ECD15080D20FA2310EAF1C1E1C960
:102EA000E5D5C5F5FD7E3FFDE5E1012B00095D544B
:102EB00006050FF53815CD2C054FE60F28F8FE0E48
:102EC00030F479E63FCDD42E28EC1213F110E3F163
:102ED000C1D1E1C9E5C5F5214D40060EBE23280D3F
:102EE00010FA2A5D407723225D403E01B7C178C1C8
:102EF000E1C9000000000000000000000000000028
:102F00003F3F3F3F3F3F3F3FFFFF3F3F3F3F3F3F51
:102F10003F7F3F3F3F3F3F3F3F3F3F3F3F3F3F3F81
:102F20007FFFFF3FFFFFFF3F3F3FFFFFFF7F3F3F31
:102F3000FF3FBFFFBF3F3F3F3F3FFFFFFFFFFFFFA1
:102F4000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91
:102F5000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF81
:102F6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF71
:102F7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF61
:102F8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF51
:102F9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF41
:102FA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF31
:102FB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF21
:102FC000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11
:102FD000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01
:102FE000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1
:102FF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1
:00000001FF

View File

@@ -0,0 +1,192 @@
//============================================================================
// Arcade: Catacomb
//
// Port to MiSTer
// Copyright (C) 2017 Sorgelig
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//============================================================================
module TripleDrawPoker_MiST(
output LED,
output [5:0] VGA_R,
output [5:0] VGA_G,
output [5:0] VGA_B,
output VGA_HS,
output VGA_VS,
output AUDIO_L,
output AUDIO_R,
input SPI_SCK,
output SPI_DO,
input SPI_DI,
input SPI_SS2,
input SPI_SS3,
input CONF_DATA0,
input CLOCK_27
);
`include "rtl\build_id.v"
localparam CONF_STR = {
"TriDraPo;;",
"O2,Rotate Controls,Off,On;",
"O34,Scanlines,Off,25%,50%,75%;",
"T6,Reset;",
"V,v1.20.",`BUILD_DATE
};
assign LED = 1;
assign AUDIO_R = AUDIO_L;
wire clk_24, clk_18, clk_12, clk_6;
wire pll_locked;
pll pll(
.inclk0(CLOCK_27),
.areset(0),
.c0(clk_24),
.c1(clk_18),
.c2(clk_12),
.c3(clk_6)
);
wire [31:0] status;
wire [1:0] buttons;
wire [1:0] switches;
wire [7:0] joystick_0;
wire [7:0] joystick_1;
wire scandoublerD;
wire ypbpr;
wire [10:0] ps2_key;
wire [7:0] audio_a, audio_b;
wire [10:0] audio = {1'b0, audio_b, 2'b0} + {3'b0, audio_a};
wire hs, vs;
wire hb, vb;
wire blankn = ~(hb | vb);
wire [2:0] r,g,b;
tripledrawpoker tripledrawpoker(
.W_CLK_18M(clk_18),
.W_CLK_12M(clk_12),
.W_CLK_6M(clk_6),
.I_RESET(status[0] | status[6] | buttons[1]),
.P1_CSJUDLR({btn_coin,1'b0,m_left,m_right,m_fire,m_down,1'b0,m_up}),
.P2_CSJUDLR({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,btn_two_players,btn_one_player}),
.W_R(r),
.W_G(g),
.W_B(b),
.W_H_SYNC(hs),
.W_V_SYNC(vs),
.HBLANK(hb),
.VBLANK(vb),
.W_SDAT_A(audio_a),
.W_SDAT_B(audio_b)
);
video_mixer video_mixer(
.clk_sys(clk_24),
.ce_pix(clk_6),
.ce_pix_actual(clk_6),
.SPI_SCK(SPI_SCK),
.SPI_SS3(SPI_SS3),
.SPI_DI(SPI_DI),
.R(blankn ? r : "000"),
.G(blankn ? g : "000"),
.B(blankn ? b : "000"),
.HSync(hs),
.VSync(vs),
.VGA_R(VGA_R),
.VGA_G(VGA_G),
.VGA_B(VGA_B),
.VGA_VS(VGA_VS),
.VGA_HS(VGA_HS),
.rotate({1'b1,status[2]}),
.scandoublerD(scandoublerD),
.scanlines(scandoublerD ? 2'b00 : status[4:3]),
.ypbpr(ypbpr),
.ypbpr_full(1),
.line_start(0),
.mono(0)
);
mist_io #(
.STRLEN(($size(CONF_STR)>>3)))
mist_io(
.clk_sys (clk_24 ),
.conf_str (CONF_STR ),
.SPI_SCK (SPI_SCK ),
.CONF_DATA0 (CONF_DATA0 ),
.SPI_SS2 (SPI_SS2 ),
.SPI_DO (SPI_DO ),
.SPI_DI (SPI_DI ),
.buttons (buttons ),
.switches (switches ),
.scandoublerD (scandoublerD ),
.ypbpr (ypbpr ),
.ps2_key (ps2_key ),
.joystick_0 (joystick_0 ),
.joystick_1 (joystick_1 ),
.status (status )
);
dac #(
.msbi_g(15))
dac(
.clk_i(clk_24),
.res_n_i(1),
.dac_i({audio,5'd0}),
.dac_o(AUDIO_L)
);
// Rotated Normal
wire m_up = ~status[2] ? btn_left | joystick_0[1] | joystick_1[1] : btn_up | joystick_0[3] | joystick_1[3];
wire m_down = ~status[2] ? btn_right | joystick_0[0] | joystick_1[0] : btn_down | joystick_0[2] | joystick_1[2];
wire m_left = ~status[2] ? btn_down | joystick_0[2] | joystick_1[2] : btn_left | joystick_0[1] | joystick_1[1];
wire m_right = ~status[2] ? btn_up | joystick_0[3] | joystick_1[3] : btn_right | joystick_0[0] | joystick_1[0];
wire m_fire = btn_fire1 | joystick_0[4] | joystick_1[4];
wire m_bomb = btn_fire2 | joystick_0[5] | joystick_1[5];
reg btn_one_player = 0;
reg btn_two_players = 0;
reg btn_left = 0;
reg btn_right = 0;
reg btn_down = 0;
reg btn_up = 0;
reg btn_fire1 = 0;
reg btn_fire2 = 0;
reg btn_fire3 = 0;
reg btn_coin = 0;
wire pressed = ps2_key[9];
wire [7:0] code = ps2_key[7:0];
always @(posedge clk_24) begin
reg old_state;
old_state <= ps2_key[10];
if(old_state != ps2_key[10]) begin
case(code)
'h75: btn_up <= pressed; // up
'h72: btn_down <= pressed; // down
'h6B: btn_left <= pressed; // left
'h74: btn_right <= pressed; // right
'h76: btn_coin <= pressed; // ESC
'h05: btn_one_player <= pressed; // F1
'h06: btn_two_players <= pressed; // F2
'h14: btn_fire3 <= pressed; // ctrl
'h11: btn_fire2 <= pressed; // alt
'h29: btn_fire1 <= pressed; // Space
endcase
end
end
endmodule

View File

@@ -0,0 +1,2 @@
`define BUILD_DATE "190311"
`define BUILD_TIME "181510"

View File

@@ -2,6 +2,9 @@
-- T80(b) core. In an effort to merge and maintain bug fixes ....
--
--
-- Ver 303 add undocumented DDCB and FDCB opcodes by TobiFlex 20.04.2010
-- Ver 302 fixed IO cycle timing, tested thanks to Alessandro.
-- Ver 301 parity flag is just parity for 8080, also overflow for Z80, by Sean Riddle
-- Ver 300 started tidyup. Rmoved some auto_wait bits from 0247 which caused problems
--
-- MikeJ March 2005
@@ -84,52 +87,52 @@ use work.T80_Pack.all;
entity T80 is
generic(
Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle
Flag_C : integer := 0;
Flag_N : integer := 1;
Flag_P : integer := 2;
Flag_X : integer := 3;
Flag_H : integer := 4;
Flag_Y : integer := 5;
Flag_Z : integer := 6;
Flag_S : integer := 7
Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle
Flag_C : integer := 0;
Flag_N : integer := 1;
Flag_P : integer := 2;
Flag_X : integer := 3;
Flag_H : integer := 4;
Flag_Y : integer := 5;
Flag_Z : integer := 6;
Flag_S : integer := 7
);
port(
RESET_n : in std_logic;
CLK_n : in std_logic;
CEN : in std_logic;
WAIT_n : in std_logic;
INT_n : in std_logic;
NMI_n : in std_logic;
BUSRQ_n : in std_logic;
M1_n : out std_logic;
IORQ : out std_logic;
NoRead : out std_logic;
Write : out std_logic;
RFSH_n : out std_logic;
HALT_n : out std_logic;
BUSAK_n : out std_logic;
A : out std_logic_vector(15 downto 0);
DInst : in std_logic_vector(7 downto 0);
DI : in std_logic_vector(7 downto 0);
DO : out std_logic_vector(7 downto 0);
MC : out std_logic_vector(2 downto 0);
TS : out std_logic_vector(2 downto 0);
IntCycle_n : out std_logic;
IntE : out std_logic;
Stop : out std_logic
RESET_n : in std_logic;
CLK_n : in std_logic;
CEN : in std_logic;
WAIT_n : in std_logic;
INT_n : in std_logic;
NMI_n : in std_logic;
BUSRQ_n : in std_logic;
M1_n : out std_logic;
IORQ : out std_logic;
NoRead : out std_logic;
Write : out std_logic;
RFSH_n : out std_logic;
HALT_n : out std_logic;
BUSAK_n : out std_logic;
A : out std_logic_vector(15 downto 0);
DInst : in std_logic_vector(7 downto 0);
DI : in std_logic_vector(7 downto 0);
DO : out std_logic_vector(7 downto 0);
MC : out std_logic_vector(2 downto 0);
TS : out std_logic_vector(2 downto 0);
IntCycle_n : out std_logic;
IntE : out std_logic;
Stop : out std_logic
);
end T80;
architecture rtl of T80 is
constant aNone : std_logic_vector(2 downto 0) := "111";
constant aBC : std_logic_vector(2 downto 0) := "000";
constant aDE : std_logic_vector(2 downto 0) := "001";
constant aXY : std_logic_vector(2 downto 0) := "010";
constant aIOA : std_logic_vector(2 downto 0) := "100";
constant aSP : std_logic_vector(2 downto 0) := "101";
constant aNone : std_logic_vector(2 downto 0) := "111";
constant aBC : std_logic_vector(2 downto 0) := "000";
constant aDE : std_logic_vector(2 downto 0) := "001";
constant aXY : std_logic_vector(2 downto 0) := "010";
constant aIOA : std_logic_vector(2 downto 0) := "100";
constant aSP : std_logic_vector(2 downto 0) := "101";
constant aZI : std_logic_vector(2 downto 0) := "110";
-- Registers
@@ -249,6 +252,7 @@ architecture rtl of T80 is
signal SetEI : std_logic;
signal IMode : std_logic_vector(1 downto 0);
signal Halt : std_logic;
signal XYbit_undoc : std_logic;
begin
@@ -264,81 +268,83 @@ begin
Flag_Z => Flag_Z,
Flag_S => Flag_S)
port map(
IR => IR,
ISet => ISet,
MCycle => MCycle,
F => F,
NMICycle => NMICycle,
IntCycle => IntCycle,
MCycles => MCycles_d,
TStates => TStates,
Prefix => Prefix,
Inc_PC => Inc_PC,
Inc_WZ => Inc_WZ,
IncDec_16 => IncDec_16,
Read_To_Acc => Read_To_Acc,
Read_To_Reg => Read_To_Reg,
Set_BusB_To => Set_BusB_To,
Set_BusA_To => Set_BusA_To,
ALU_Op => ALU_Op,
Save_ALU => Save_ALU,
PreserveC => PreserveC,
Arith16 => Arith16,
Set_Addr_To => Set_Addr_To,
IORQ => IORQ_i,
Jump => Jump,
JumpE => JumpE,
JumpXY => JumpXY,
Call => Call,
RstP => RstP,
LDZ => LDZ,
LDW => LDW,
LDSPHL => LDSPHL,
Special_LD => Special_LD,
ExchangeDH => ExchangeDH,
ExchangeRp => ExchangeRp,
ExchangeAF => ExchangeAF,
ExchangeRS => ExchangeRS,
I_DJNZ => I_DJNZ,
I_CPL => I_CPL,
I_CCF => I_CCF,
I_SCF => I_SCF,
I_RETN => I_RETN,
I_BT => I_BT,
I_BC => I_BC,
I_BTR => I_BTR,
I_RLD => I_RLD,
I_RRD => I_RRD,
I_INRC => I_INRC,
SetDI => SetDI,
SetEI => SetEI,
IMode => IMode,
Halt => Halt,
NoRead => NoRead,
Write => Write);
IR => IR,
ISet => ISet,
MCycle => MCycle,
F => F,
NMICycle => NMICycle,
IntCycle => IntCycle,
XY_State => XY_State,
MCycles => MCycles_d,
TStates => TStates,
Prefix => Prefix,
Inc_PC => Inc_PC,
Inc_WZ => Inc_WZ,
IncDec_16 => IncDec_16,
Read_To_Acc => Read_To_Acc,
Read_To_Reg => Read_To_Reg,
Set_BusB_To => Set_BusB_To,
Set_BusA_To => Set_BusA_To,
ALU_Op => ALU_Op,
Save_ALU => Save_ALU,
PreserveC => PreserveC,
Arith16 => Arith16,
Set_Addr_To => Set_Addr_To,
IORQ => IORQ_i,
Jump => Jump,
JumpE => JumpE,
JumpXY => JumpXY,
Call => Call,
RstP => RstP,
LDZ => LDZ,
LDW => LDW,
LDSPHL => LDSPHL,
Special_LD => Special_LD,
ExchangeDH => ExchangeDH,
ExchangeRp => ExchangeRp,
ExchangeAF => ExchangeAF,
ExchangeRS => ExchangeRS,
I_DJNZ => I_DJNZ,
I_CPL => I_CPL,
I_CCF => I_CCF,
I_SCF => I_SCF,
I_RETN => I_RETN,
I_BT => I_BT,
I_BC => I_BC,
I_BTR => I_BTR,
I_RLD => I_RLD,
I_RRD => I_RRD,
I_INRC => I_INRC,
SetDI => SetDI,
SetEI => SetEI,
IMode => IMode,
Halt => Halt,
NoRead => NoRead,
Write => Write,
XYbit_undoc => XYbit_undoc);
alu : T80_ALU
generic map(
Mode => Mode,
Flag_C => Flag_C,
Flag_N => Flag_N,
Flag_P => Flag_P,
Flag_X => Flag_X,
Flag_H => Flag_H,
Flag_Y => Flag_Y,
Flag_Z => Flag_Z,
Flag_S => Flag_S)
Mode => Mode,
Flag_C => Flag_C,
Flag_N => Flag_N,
Flag_P => Flag_P,
Flag_X => Flag_X,
Flag_H => Flag_H,
Flag_Y => Flag_Y,
Flag_Z => Flag_Z,
Flag_S => Flag_S)
port map(
Arith16 => Arith16_r,
Z16 => Z16_r,
ALU_Op => ALU_Op_r,
IR => IR(5 downto 0),
ISet => ISet,
BusA => BusA,
BusB => BusB,
F_In => F,
Q => ALU_Q,
F_Out => F_Out);
Arith16 => Arith16_r,
Z16 => Z16_r,
ALU_Op => ALU_Op_r,
IR => IR(5 downto 0),
ISet => ISet,
BusA => BusA,
BusB => BusB,
F_In => F,
Q => ALU_Q,
F_Out => F_Out);
ClkEn <= CEN and not BusAck;
@@ -700,6 +706,9 @@ begin
F <= Save_Mux;
when others =>
end case;
if XYbit_undoc='1' then
DO <= ALU_Q;
end if;
end if;
end if;
@@ -829,21 +838,21 @@ begin
Regs : T80_Reg
port map(
Clk => CLK_n,
CEN => ClkEn,
WEH => RegWEH,
WEL => RegWEL,
AddrA => RegAddrA,
AddrB => RegAddrB,
AddrC => RegAddrC,
DIH => RegDIH,
DIL => RegDIL,
DOAH => RegBusA(15 downto 8),
DOAL => RegBusA(7 downto 0),
DOBH => RegBusB(15 downto 8),
DOBL => RegBusB(7 downto 0),
DOCH => RegBusC(15 downto 8),
DOCL => RegBusC(7 downto 0));
Clk => CLK_n,
CEN => ClkEn,
WEH => RegWEH,
WEL => RegWEL,
AddrA => RegAddrA,
AddrB => RegAddrB,
AddrC => RegAddrC,
DIH => RegDIH,
DIL => RegDIL,
DOAH => RegBusA(15 downto 8),
DOAL => RegBusA(7 downto 0),
DOBH => RegBusB(15 downto 8),
DOBL => RegBusB(7 downto 0),
DOCH => RegBusC(15 downto 8),
DOCL => RegBusC(7 downto 0));
---------------------------------------------------------------------------
--
@@ -903,6 +912,10 @@ begin
when others =>
BusB <= "--------";
end case;
if XYbit_undoc='1' then
BusA <= DI_Reg;
BusB <= DI_Reg;
end if;
end if;
end if;
end process;

View File

@@ -82,30 +82,30 @@ entity T80_ALU is
Flag_S : integer := 7
);
port(
Arith16 : in std_logic;
Z16 : in std_logic;
ALU_Op : in std_logic_vector(3 downto 0);
IR : in std_logic_vector(5 downto 0);
ISet : in std_logic_vector(1 downto 0);
BusA : in std_logic_vector(7 downto 0);
BusB : in std_logic_vector(7 downto 0);
F_In : in std_logic_vector(7 downto 0);
Q : out std_logic_vector(7 downto 0);
F_Out : out std_logic_vector(7 downto 0)
Arith16 : in std_logic;
Z16 : in std_logic;
ALU_Op : in std_logic_vector(3 downto 0);
IR : in std_logic_vector(5 downto 0);
ISet : in std_logic_vector(1 downto 0);
BusA : in std_logic_vector(7 downto 0);
BusB : in std_logic_vector(7 downto 0);
F_In : in std_logic_vector(7 downto 0);
Q : out std_logic_vector(7 downto 0);
F_Out : out std_logic_vector(7 downto 0)
);
end T80_ALU;
architecture rtl of T80_ALU is
procedure AddSub(A : std_logic_vector;
B : std_logic_vector;
Sub : std_logic;
Carry_In : std_logic;
signal Res : out std_logic_vector;
signal Carry : out std_logic) is
procedure AddSub(A : std_logic_vector;
B : std_logic_vector;
Sub : std_logic;
Carry_In : std_logic;
signal Res : out std_logic_vector;
signal Carry : out std_logic) is
variable B_i : unsigned(A'length - 1 downto 0);
variable Res_i : unsigned(A'length + 1 downto 0);
variable B_i : unsigned(A'length - 1 downto 0);
variable Res_i : unsigned(A'length + 1 downto 0);
begin
if Sub = '1' then
B_i := not unsigned(B);

View File

@@ -2,6 +2,8 @@
-- T80(b) core. In an effort to merge and maintain bug fixes ....
--
--
-- Ver 303 add undocumented DDCB and FDCB opcodes by TobiFlex 20.04.2010
-- Ver 302 fixed IO cycle timing, tested thanks to Alessandro.
-- Ver 300 started tidyup
-- MikeJ March 2005
-- Latest version from www.fpgaarcade.com (original www.opencores.org)
@@ -90,71 +92,73 @@ entity T80_MCode is
Flag_S : integer := 7
);
port(
IR : in std_logic_vector(7 downto 0);
ISet : in std_logic_vector(1 downto 0);
MCycle : in std_logic_vector(2 downto 0);
F : in std_logic_vector(7 downto 0);
NMICycle : in std_logic;
IntCycle : in std_logic;
MCycles : out std_logic_vector(2 downto 0);
TStates : out std_logic_vector(2 downto 0);
Prefix : out std_logic_vector(1 downto 0); -- None,BC,ED,DD/FD
Inc_PC : out std_logic;
Inc_WZ : out std_logic;
IncDec_16 : out std_logic_vector(3 downto 0); -- BC,DE,HL,SP 0 is inc
Read_To_Reg : out std_logic;
Read_To_Acc : out std_logic;
Set_BusA_To : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI/DB,A,SP(L),SP(M),0,F
Set_BusB_To : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI,A,SP(L),SP(M),1,F,PC(L),PC(M),0
ALU_Op : out std_logic_vector(3 downto 0);
IR : in std_logic_vector(7 downto 0);
ISet : in std_logic_vector(1 downto 0);
MCycle : in std_logic_vector(2 downto 0);
F : in std_logic_vector(7 downto 0);
NMICycle : in std_logic;
IntCycle : in std_logic;
XY_State : in std_logic_vector(1 downto 0);
MCycles : out std_logic_vector(2 downto 0);
TStates : out std_logic_vector(2 downto 0);
Prefix : out std_logic_vector(1 downto 0); -- None,CB,ED,DD/FD
Inc_PC : out std_logic;
Inc_WZ : out std_logic;
IncDec_16 : out std_logic_vector(3 downto 0); -- BC,DE,HL,SP 0 is inc
Read_To_Reg : out std_logic;
Read_To_Acc : out std_logic;
Set_BusA_To : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI/DB,A,SP(L),SP(M),0,F
Set_BusB_To : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI,A,SP(L),SP(M),1,F,PC(L),PC(M),0
ALU_Op : out std_logic_vector(3 downto 0);
-- ADD, ADC, SUB, SBC, AND, XOR, OR, CP, ROT, BIT, SET, RES, DAA, RLD, RRD, None
Save_ALU : out std_logic;
PreserveC : out std_logic;
Arith16 : out std_logic;
Set_Addr_To : out std_logic_vector(2 downto 0); -- aNone,aXY,aIOA,aSP,aBC,aDE,aZI
IORQ : out std_logic;
Jump : out std_logic;
JumpE : out std_logic;
JumpXY : out std_logic;
Call : out std_logic;
RstP : out std_logic;
LDZ : out std_logic;
LDW : out std_logic;
LDSPHL : out std_logic;
Special_LD : out std_logic_vector(2 downto 0); -- A,I;A,R;I,A;R,A;None
ExchangeDH : out std_logic;
ExchangeRp : out std_logic;
ExchangeAF : out std_logic;
ExchangeRS : out std_logic;
I_DJNZ : out std_logic;
I_CPL : out std_logic;
I_CCF : out std_logic;
I_SCF : out std_logic;
I_RETN : out std_logic;
I_BT : out std_logic;
I_BC : out std_logic;
I_BTR : out std_logic;
I_RLD : out std_logic;
I_RRD : out std_logic;
I_INRC : out std_logic;
SetDI : out std_logic;
SetEI : out std_logic;
IMode : out std_logic_vector(1 downto 0);
Halt : out std_logic;
NoRead : out std_logic;
Write : out std_logic
Save_ALU : out std_logic;
PreserveC : out std_logic;
Arith16 : out std_logic;
Set_Addr_To : out std_logic_vector(2 downto 0); -- aNone,aXY,aIOA,aSP,aBC,aDE,aZI
IORQ : out std_logic;
Jump : out std_logic;
JumpE : out std_logic;
JumpXY : out std_logic;
Call : out std_logic;
RstP : out std_logic;
LDZ : out std_logic;
LDW : out std_logic;
LDSPHL : out std_logic;
Special_LD : out std_logic_vector(2 downto 0); -- A,I;A,R;I,A;R,A;None
ExchangeDH : out std_logic;
ExchangeRp : out std_logic;
ExchangeAF : out std_logic;
ExchangeRS : out std_logic;
I_DJNZ : out std_logic;
I_CPL : out std_logic;
I_CCF : out std_logic;
I_SCF : out std_logic;
I_RETN : out std_logic;
I_BT : out std_logic;
I_BC : out std_logic;
I_BTR : out std_logic;
I_RLD : out std_logic;
I_RRD : out std_logic;
I_INRC : out std_logic;
SetDI : out std_logic;
SetEI : out std_logic;
IMode : out std_logic_vector(1 downto 0);
Halt : out std_logic;
NoRead : out std_logic;
Write : out std_logic;
XYbit_undoc : out std_logic
);
end T80_MCode;
architecture rtl of T80_MCode is
constant aNone : std_logic_vector(2 downto 0) := "111";
constant aBC : std_logic_vector(2 downto 0) := "000";
constant aDE : std_logic_vector(2 downto 0) := "001";
constant aXY : std_logic_vector(2 downto 0) := "010";
constant aIOA : std_logic_vector(2 downto 0) := "100";
constant aSP : std_logic_vector(2 downto 0) := "101";
constant aZI : std_logic_vector(2 downto 0) := "110";
constant aNone : std_logic_vector(2 downto 0) := "111";
constant aBC : std_logic_vector(2 downto 0) := "000";
constant aDE : std_logic_vector(2 downto 0) := "001";
constant aXY : std_logic_vector(2 downto 0) := "010";
constant aIOA : std_logic_vector(2 downto 0) := "100";
constant aSP : std_logic_vector(2 downto 0) := "101";
constant aZI : std_logic_vector(2 downto 0) := "110";
function is_cc_true(
F : std_logic_vector(7 downto 0);
@@ -188,7 +192,7 @@ architecture rtl of T80_MCode is
begin
process (IR, ISet, MCycle, F, NMICycle, IntCycle)
process (IR, ISet, MCycle, F, NMICycle, IntCycle, XY_State)
variable DDD : std_logic_vector(2 downto 0);
variable SSS : std_logic_vector(2 downto 0);
variable DPair : std_logic_vector(1 downto 0);
@@ -249,6 +253,7 @@ begin
Halt <= '0';
NoRead <= '0';
Write <= '0';
XYbit_undoc <= '0';
case ISet is
when "00" =>
@@ -1162,7 +1167,6 @@ begin
MCycles <= "011";
case to_integer(unsigned(MCycle)) is
when 1 =>
TStates <= "101";
Set_Addr_TO <= aSP;
when 2 =>
IncDec_16 <= "0111";
@@ -1294,6 +1298,7 @@ begin
when 3 =>
Read_To_Acc <= '1';
IORQ <= '1';
TStates <= "100"; -- MIKEJ should be 4 for IO cycle
when others => null;
end case;
end if;
@@ -1309,6 +1314,7 @@ begin
when 3 =>
Write <= '1';
IORQ <= '1';
TStates <= "100"; -- MIKEJ should be 4 for IO cycle
when others => null;
end case;
end if;
@@ -1364,10 +1370,29 @@ begin
-- SRA r
-- SRL r
-- SLL r (Undocumented) / SWAP r
if MCycle = "001" then
ALU_Op <= "1000";
Read_To_Reg <= '1';
Save_ALU <= '1';
if XY_State="00" then
if MCycle = "001" then
ALU_Op <= "1000";
Read_To_Reg <= '1';
Save_ALU <= '1';
end if;
else
-- R/S (IX+d),Reg, undocumented
MCycles <= "011";
XYbit_undoc <= '1';
case to_integer(unsigned(MCycle)) is
when 1 | 7=>
Set_Addr_To <= aXY;
when 2 =>
ALU_Op <= "1000";
Read_To_Reg <= '1';
Save_ALU <= '1';
Set_Addr_To <= aXY;
TStates <= "100";
when 3 =>
Write <= '1';
when others => null;
end case;
end if;
when "00000110"|"00010110"|"00001110"|"00011110"|"00101110"|"00111110"|"00100110"|"00110110" =>
-- RLC (HL)
@@ -1401,9 +1426,23 @@ begin
|"01110000"|"01110001"|"01110010"|"01110011"|"01110100"|"01110101"|"01110111"
|"01111000"|"01111001"|"01111010"|"01111011"|"01111100"|"01111101"|"01111111" =>
-- BIT b,r
if MCycle = "001" then
Set_BusB_To(2 downto 0) <= IR(2 downto 0);
ALU_Op <= "1001";
if XY_State="00" then
if MCycle = "001" then
Set_BusB_To(2 downto 0) <= IR(2 downto 0);
ALU_Op <= "1001";
end if;
else
-- BIT b,(IX+d), undocumented
MCycles <= "010";
XYbit_undoc <= '1';
case to_integer(unsigned(MCycle)) is
when 1 | 7=>
Set_Addr_To <= aXY;
when 2 =>
ALU_Op <= "1001";
TStates <= "100";
when others => null;
end case;
end if;
when "01000110"|"01001110"|"01010110"|"01011110"|"01100110"|"01101110"|"01110110"|"01111110" =>
-- BIT b,(HL)
@@ -1425,10 +1464,29 @@ begin
|"11110000"|"11110001"|"11110010"|"11110011"|"11110100"|"11110101"|"11110111"
|"11111000"|"11111001"|"11111010"|"11111011"|"11111100"|"11111101"|"11111111" =>
-- SET b,r
if MCycle = "001" then
ALU_Op <= "1010";
Read_To_Reg <= '1';
Save_ALU <= '1';
if XY_State="00" then
if MCycle = "001" then
ALU_Op <= "1010";
Read_To_Reg <= '1';
Save_ALU <= '1';
end if;
else
-- SET b,(IX+d),Reg, undocumented
MCycles <= "011";
XYbit_undoc <= '1';
case to_integer(unsigned(MCycle)) is
when 1 | 7=>
Set_Addr_To <= aXY;
when 2 =>
ALU_Op <= "1010";
Read_To_Reg <= '1';
Save_ALU <= '1';
Set_Addr_To <= aXY;
TStates <= "100";
when 3 =>
Write <= '1';
when others => null;
end case;
end if;
when "11000110"|"11001110"|"11010110"|"11011110"|"11100110"|"11101110"|"11110110"|"11111110" =>
-- SET b,(HL)
@@ -1455,11 +1513,31 @@ begin
|"10110000"|"10110001"|"10110010"|"10110011"|"10110100"|"10110101"|"10110111"
|"10111000"|"10111001"|"10111010"|"10111011"|"10111100"|"10111101"|"10111111" =>
-- RES b,r
if MCycle = "001" then
ALU_Op <= "1011";
Read_To_Reg <= '1';
Save_ALU <= '1';
if XY_State="00" then
if MCycle = "001" then
ALU_Op <= "1011";
Read_To_Reg <= '1';
Save_ALU <= '1';
end if;
else
-- RES b,(IX+d),Reg, undocumented
MCycles <= "011";
XYbit_undoc <= '1';
case to_integer(unsigned(MCycle)) is
when 1 | 7=>
Set_Addr_To <= aXY;
when 2 =>
ALU_Op <= "1011";
Read_To_Reg <= '1';
Save_ALU <= '1';
Set_Addr_To <= aXY;
TStates <= "100";
when 3 =>
Write <= '1';
when others => null;
end case;
end if;
when "10000110"|"10001110"|"10010110"|"10011110"|"10100110"|"10101110"|"10110110"|"10111110" =>
-- RES b,(HL)
MCycles <= "011";
@@ -1801,6 +1879,7 @@ begin
when 1 =>
Set_Addr_To <= aBC;
when 2 =>
TStates <= "100"; -- MIKEJ should be 4 for IO cycle
IORQ <= '1';
if IR(5 downto 3) /= "110" then
Read_To_Reg <= '1';
@@ -1821,6 +1900,7 @@ begin
Set_BusB_To(3) <= '1';
end if;
when 2 =>
TStates <= "100"; -- MIKEJ should be 4 for IO cycle
Write <= '1';
IORQ <= '1';
when others =>
@@ -1838,6 +1918,7 @@ begin
Save_ALU <= '1';
ALU_Op <= "0010";
when 2 =>
TStates <= "100"; -- MIKEJ should be 4 for IO cycle
IORQ <= '1';
Set_BusB_To <= "0110";
Set_Addr_To <= aXY;
@@ -1880,6 +1961,7 @@ begin
else
IncDec_16 <= "1110"; -- mikej
end if;
TStates <= "100"; -- MIKEJ should be 4 for IO cycle
IORQ <= '1';
Write <= '1';
I_BTR <= '1';

View File

@@ -0,0 +1,220 @@
-- ****
-- T80(b) core. In an effort to merge and maintain bug fixes ....
--
--
-- Ver 303 add undocumented DDCB and FDCB opcodes by TobiFlex 20.04.2010
-- Ver 300 started tidyup
-- MikeJ March 2005
-- Latest version from www.fpgaarcade.com (original www.opencores.org)
--
-- ****
--
-- Z80 compatible microprocessor core
--
-- Version : 0242
--
-- Copyright (c) 2001-2002 Daniel Wallner (jesus@opencores.org)
--
-- 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.
--
-- The latest version of this file can be found at:
-- http://www.opencores.org/cvsweb.shtml/t80/
--
-- Limitations :
--
-- File history :
--
library IEEE;
use IEEE.std_logic_1164.all;
package T80_Pack is
component T80
generic(
Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle
Flag_C : integer := 0;
Flag_N : integer := 1;
Flag_P : integer := 2;
Flag_X : integer := 3;
Flag_H : integer := 4;
Flag_Y : integer := 5;
Flag_Z : integer := 6;
Flag_S : integer := 7
);
port(
RESET_n : in std_logic;
CLK_n : in std_logic;
CEN : in std_logic;
WAIT_n : in std_logic;
INT_n : in std_logic;
NMI_n : in std_logic;
BUSRQ_n : in std_logic;
M1_n : out std_logic;
IORQ : out std_logic;
NoRead : out std_logic;
Write : out std_logic;
RFSH_n : out std_logic;
HALT_n : out std_logic;
BUSAK_n : out std_logic;
A : out std_logic_vector(15 downto 0);
DInst : in std_logic_vector(7 downto 0);
DI : in std_logic_vector(7 downto 0);
DO : out std_logic_vector(7 downto 0);
MC : out std_logic_vector(2 downto 0);
TS : out std_logic_vector(2 downto 0);
IntCycle_n : out std_logic;
IntE : out std_logic;
Stop : out std_logic
);
end component;
component T80_Reg
port(
Clk : in std_logic;
CEN : in std_logic;
WEH : in std_logic;
WEL : in std_logic;
AddrA : in std_logic_vector(2 downto 0);
AddrB : in std_logic_vector(2 downto 0);
AddrC : in std_logic_vector(2 downto 0);
DIH : in std_logic_vector(7 downto 0);
DIL : in std_logic_vector(7 downto 0);
DOAH : out std_logic_vector(7 downto 0);
DOAL : out std_logic_vector(7 downto 0);
DOBH : out std_logic_vector(7 downto 0);
DOBL : out std_logic_vector(7 downto 0);
DOCH : out std_logic_vector(7 downto 0);
DOCL : out std_logic_vector(7 downto 0)
);
end component;
component T80_MCode
generic(
Mode : integer := 0;
Flag_C : integer := 0;
Flag_N : integer := 1;
Flag_P : integer := 2;
Flag_X : integer := 3;
Flag_H : integer := 4;
Flag_Y : integer := 5;
Flag_Z : integer := 6;
Flag_S : integer := 7
);
port(
IR : in std_logic_vector(7 downto 0);
ISet : in std_logic_vector(1 downto 0);
MCycle : in std_logic_vector(2 downto 0);
F : in std_logic_vector(7 downto 0);
NMICycle : in std_logic;
IntCycle : in std_logic;
XY_State : in std_logic_vector(1 downto 0);
MCycles : out std_logic_vector(2 downto 0);
TStates : out std_logic_vector(2 downto 0);
Prefix : out std_logic_vector(1 downto 0); -- None,BC,ED,DD/FD
Inc_PC : out std_logic;
Inc_WZ : out std_logic;
IncDec_16 : out std_logic_vector(3 downto 0); -- BC,DE,HL,SP 0 is inc
Read_To_Reg : out std_logic;
Read_To_Acc : out std_logic;
Set_BusA_To : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI/DB,A,SP(L),SP(M),0,F
Set_BusB_To : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI,A,SP(L),SP(M),1,F,PC(L),PC(M),0
ALU_Op : out std_logic_vector(3 downto 0);
-- ADD, ADC, SUB, SBC, AND, XOR, OR, CP, ROT, BIT, SET, RES, DAA, RLD, RRD, None
Save_ALU : out std_logic;
PreserveC : out std_logic;
Arith16 : out std_logic;
Set_Addr_To : out std_logic_vector(2 downto 0); -- aNone,aXY,aIOA,aSP,aBC,aDE,aZI
IORQ : out std_logic;
Jump : out std_logic;
JumpE : out std_logic;
JumpXY : out std_logic;
Call : out std_logic;
RstP : out std_logic;
LDZ : out std_logic;
LDW : out std_logic;
LDSPHL : out std_logic;
Special_LD : out std_logic_vector(2 downto 0); -- A,I;A,R;I,A;R,A;None
ExchangeDH : out std_logic;
ExchangeRp : out std_logic;
ExchangeAF : out std_logic;
ExchangeRS : out std_logic;
I_DJNZ : out std_logic;
I_CPL : out std_logic;
I_CCF : out std_logic;
I_SCF : out std_logic;
I_RETN : out std_logic;
I_BT : out std_logic;
I_BC : out std_logic;
I_BTR : out std_logic;
I_RLD : out std_logic;
I_RRD : out std_logic;
I_INRC : out std_logic;
SetDI : out std_logic;
SetEI : out std_logic;
IMode : out std_logic_vector(1 downto 0);
Halt : out std_logic;
NoRead : out std_logic;
Write : out std_logic;
XYbit_undoc : out std_logic
);
end component;
component T80_ALU
generic(
Mode : integer := 0;
Flag_C : integer := 0;
Flag_N : integer := 1;
Flag_P : integer := 2;
Flag_X : integer := 3;
Flag_H : integer := 4;
Flag_Y : integer := 5;
Flag_Z : integer := 6;
Flag_S : integer := 7
);
port(
Arith16 : in std_logic;
Z16 : in std_logic;
ALU_Op : in std_logic_vector(3 downto 0);
IR : in std_logic_vector(5 downto 0);
ISet : in std_logic_vector(1 downto 0);
BusA : in std_logic_vector(7 downto 0);
BusB : in std_logic_vector(7 downto 0);
F_In : in std_logic_vector(7 downto 0);
Q : out std_logic_vector(7 downto 0);
F_Out : out std_logic_vector(7 downto 0)
);
end component;
end;

View File

@@ -0,0 +1,283 @@
------------------------------------------------------------------------------
-- t80as.vhd : The non-tristate signal edition of t80a.vhd
--
-- 2003.2.7 non-tristate modification by Tatsuyuki Satoh
--
-- 1.separate 'D' to 'DO' and 'DI'.
-- 2.added 'DOE' to 'DO' enable signal.(data direction)
-- 3.MREQ_n,IORQ_n,RD_n,WR_n,RFSH_n,A doesn't become the condition of 'Z'.
--
-- There is a mark of "--AS" in all the change points.
--
------------------------------------------------------------------------------
--
-- Z80 compatible microprocessor core, asynchronous top level
--
-- Version : 0247
--
-- Copyright (c) 2001-2002 Daniel Wallner (jesus@opencores.org)
--
-- 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.
--
-- The latest version of this file can be found at:
-- http://www.opencores.org/cvsweb.shtml/t80/
--
-- Limitations :
--
-- File history :
--
-- 0208 : First complete release
--
-- 0211 : Fixed interrupt cycle
--
-- 0235 : Updated for T80 interface change
--
-- 0238 : Updated for T80 interface change
--
-- 0240 : Updated for T80 interface change
--
-- 0242 : Updated for T80 interface change
--
-- 0247 : Fixed bus req/ack cycle
--
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
use work.T80_Pack.all;
entity T80as is
generic(
Mode : integer := 0 -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
);
port(
RESET_n : in std_logic;
CLK_n : in std_logic;
WAIT_n : in std_logic;
INT_n : in std_logic;
NMI_n : in std_logic;
BUSRQ_n : in std_logic;
M1_n : out std_logic;
MREQ_n : out std_logic;
IORQ_n : out std_logic;
RD_n : out std_logic;
WR_n : out std_logic;
RFSH_n : out std_logic;
HALT_n : out std_logic;
BUSAK_n : out std_logic;
A : out std_logic_vector(15 downto 0);
--AS-- D : inout std_logic_vector(7 downto 0)
--AS>>
DI : in std_logic_vector(7 downto 0);
DO : out std_logic_vector(7 downto 0);
DOE : out std_logic
--<<AS
);
end T80as;
architecture RTL of T80as is
signal CEN : std_logic;
signal Reset_s : std_logic;
signal IntCycle_n : std_logic;
signal IORQ : std_logic;
signal NoRead : std_logic;
signal Write : std_logic;
signal MREQ : std_logic;
signal MReq_Inhibit : std_logic;
signal Req_Inhibit : std_logic;
signal RD : std_logic;
signal MREQ_n_i : std_logic;
signal IORQ_n_i : std_logic;
signal RD_n_i : std_logic;
signal WR_n_i : std_logic;
signal RFSH_n_i : std_logic;
signal BUSAK_n_i : std_logic;
signal A_i : std_logic_vector(15 downto 0);
--AS-- signal DO : std_logic_vector(7 downto 0);
signal DI_Reg : std_logic_vector (7 downto 0); -- Input synchroniser
signal Wait_s : std_logic;
signal MCycle : std_logic_vector(2 downto 0);
signal TState : std_logic_vector(2 downto 0);
begin
CEN <= '1';
BUSAK_n <= BUSAK_n_i;
MREQ_n_i <= not MREQ or (Req_Inhibit and MReq_Inhibit);
RD_n_i <= not RD or Req_Inhibit;
--AS-- MREQ_n <= MREQ_n_i when BUSAK_n_i = '1' else 'Z';
--AS-- IORQ_n <= IORQ_n_i when BUSAK_n_i = '1' else 'Z';
--AS-- RD_n <= RD_n_i when BUSAK_n_i = '1' else 'Z';
--AS-- WR_n <= WR_n_i when BUSAK_n_i = '1' else 'Z';
--AS-- RFSH_n <= RFSH_n_i when BUSAK_n_i = '1' else 'Z';
--AS-- A <= A_i when BUSAK_n_i = '1' else (others => 'Z');
--AS-- D <= DO when Write = '1' and BUSAK_n_i = '1' else (others => 'Z');
--AS>>
MREQ_n <= MREQ_n_i;
IORQ_n <= IORQ_n_i;
RD_n <= RD_n_i;
WR_n <= WR_n_i;
RFSH_n <= RFSH_n_i;
A <= A_i;
DOE <= Write when BUSAK_n_i = '1' else '0';
--<<AS
process (RESET_n, CLK_n)
begin
if RESET_n = '0' then
Reset_s <= '0';
elsif CLK_n'event and CLK_n = '1' then
Reset_s <= '1';
end if;
end process;
u0 : T80
generic map(
Mode => Mode,
IOWait => 1)
port map(
CEN => CEN,
M1_n => M1_n,
IORQ => IORQ,
NoRead => NoRead,
Write => Write,
RFSH_n => RFSH_n_i,
HALT_n => HALT_n,
WAIT_n => Wait_s,
INT_n => INT_n,
NMI_n => NMI_n,
RESET_n => Reset_s,
BUSRQ_n => BUSRQ_n,
BUSAK_n => BUSAK_n_i,
CLK_n => CLK_n,
A => A_i,
-- DInst => D,
DInst => DI,
DI => DI_Reg,
DO => DO,
MC => MCycle,
TS => TState,
IntCycle_n => IntCycle_n);
process (CLK_n)
begin
if CLK_n'event and CLK_n = '0' then
Wait_s <= WAIT_n;
if TState = "011" and BUSAK_n_i = '1' then
--AS-- DI_Reg <= to_x01(D);
--AS>>
DI_Reg <= to_x01(DI);
--<<AS
end if;
end if;
end process;
process (Reset_s,CLK_n)
begin
if Reset_s = '0' then
WR_n_i <= '1';
elsif CLK_n'event and CLK_n = '1' then
WR_n_i <= '1';
if TState = "001" then -- To short for IO writes !!!!!!!!!!!!!!!!!!!
WR_n_i <= not Write;
end if;
end if;
end process;
process (Reset_s,CLK_n)
begin
if Reset_s = '0' then
Req_Inhibit <= '0';
elsif CLK_n'event and CLK_n = '1' then
if MCycle = "001" and TState = "010" then
Req_Inhibit <= '1';
else
Req_Inhibit <= '0';
end if;
end if;
end process;
process (Reset_s,CLK_n)
begin
if Reset_s = '0' then
MReq_Inhibit <= '0';
elsif CLK_n'event and CLK_n = '0' then
if MCycle = "001" and TState = "010" then
MReq_Inhibit <= '1';
else
MReq_Inhibit <= '0';
end if;
end if;
end process;
process(Reset_s,CLK_n)
begin
if Reset_s = '0' then
RD <= '0';
IORQ_n_i <= '1';
MREQ <= '0';
elsif CLK_n'event and CLK_n = '0' then
if MCycle = "001" then
if TState = "001" then
RD <= IntCycle_n;
MREQ <= IntCycle_n;
IORQ_n_i <= IntCycle_n;
end if;
if TState = "011" then
RD <= '0';
IORQ_n_i <= '1';
MREQ <= '1';
end if;
if TState = "100" then
MREQ <= '0';
end if;
else
if TState = "001" and NoRead = '0' then
RD <= not Write;
IORQ_n_i <= not IORQ;
MREQ <= not IORQ;
end if;
if TState = "011" then
RD <= '0';
IORQ_n_i <= '1';
MREQ <= '0';
end if;
end if;
end if;
end process;
end;

View File

@@ -74,65 +74,65 @@ use work.T80_Pack.all;
entity T80sed is
port(
RESET_n : in std_logic;
CLK_n : in std_logic;
CLKEN : in std_logic;
WAIT_n : in std_logic;
INT_n : in std_logic;
NMI_n : in std_logic;
BUSRQ_n : in std_logic;
M1_n : out std_logic;
MREQ_n : out std_logic;
IORQ_n : out std_logic;
RD_n : out std_logic;
WR_n : out std_logic;
RFSH_n : out std_logic;
HALT_n : out std_logic;
BUSAK_n : out std_logic;
A : out std_logic_vector(15 downto 0);
DI : in std_logic_vector(7 downto 0);
DO : out std_logic_vector(7 downto 0)
RESET_n : in std_logic;
CLK_n : in std_logic;
CLKEN : in std_logic;
WAIT_n : in std_logic;
INT_n : in std_logic;
NMI_n : in std_logic;
BUSRQ_n : in std_logic;
M1_n : out std_logic;
MREQ_n : out std_logic;
IORQ_n : out std_logic;
RD_n : out std_logic;
WR_n : out std_logic;
RFSH_n : out std_logic;
HALT_n : out std_logic;
BUSAK_n : out std_logic;
A : out std_logic_vector(15 downto 0);
DI : in std_logic_vector(7 downto 0);
DO : out std_logic_vector(7 downto 0)
);
end T80sed;
architecture rtl of T80sed is
signal IntCycle_n : std_logic;
signal NoRead : std_logic;
signal Write : std_logic;
signal IORQ : std_logic;
signal DI_Reg : std_logic_vector(7 downto 0);
signal MCycle : std_logic_vector(2 downto 0);
signal TState : std_logic_vector(2 downto 0);
signal IntCycle_n : std_logic;
signal NoRead : std_logic;
signal Write : std_logic;
signal IORQ : std_logic;
signal DI_Reg : std_logic_vector(7 downto 0);
signal MCycle : std_logic_vector(2 downto 0);
signal TState : std_logic_vector(2 downto 0);
begin
u0 : T80
generic map(
Mode => 0,
IOWait => 1)
Mode => 0,
IOWait => 1)
port map(
CEN => CLKEN,
M1_n => M1_n,
IORQ => IORQ,
NoRead => NoRead,
Write => Write,
RFSH_n => RFSH_n,
HALT_n => HALT_n,
WAIT_n => Wait_n,
INT_n => INT_n,
NMI_n => NMI_n,
RESET_n => RESET_n,
BUSRQ_n => BUSRQ_n,
BUSAK_n => BUSAK_n,
CLK_n => CLK_n,
A => A,
DInst => DI,
DI => DI_Reg,
DO => DO,
MC => MCycle,
TS => TState,
IntCycle_n => IntCycle_n);
CEN => CLKEN,
M1_n => M1_n,
IORQ => IORQ,
NoRead => NoRead,
Write => Write,
RFSH_n => RFSH_n,
HALT_n => HALT_n,
WAIT_n => Wait_n,
INT_n => INT_n,
NMI_n => NMI_n,
RESET_n => RESET_n,
BUSRQ_n => BUSRQ_n,
BUSAK_n => BUSAK_n,
CLK_n => CLK_n,
A => A,
DInst => DI,
DI => DI_Reg,
DO => DO,
MC => MCycle,
TS => TState,
IntCycle_n => IntCycle_n);
process (RESET_n, CLK_n)
begin

View File

@@ -0,0 +1,71 @@
-------------------------------------------------------------------------------
--
-- Delta-Sigma DAC
--
-- $Id: dac.vhd,v 1.1 2005/10/25 21:09:42 arnim Exp $
--
-- Refer to Xilinx Application Note XAPP154.
--
-- This DAC requires an external RC low-pass filter:
--
-- dac_o 0---XXXXX---+---0 analog audio
-- 3k3 |
-- === 4n7
-- |
-- GND
--
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity dac is
generic (
msbi_g : integer := 11
);
port (
clk_i : in std_logic;
res_n_i : in std_logic;
dac_i : in std_logic_vector(msbi_g downto 0);
dac_o : out std_logic
);
end dac;
library ieee;
use ieee.numeric_std.all;
architecture rtl of dac is
signal DACout_q : std_logic;
signal DeltaAdder_s,
SigmaAdder_s,
SigmaLatch_q,
DeltaB_s : unsigned(msbi_g+2 downto 0);
begin
DeltaB_s(msbi_g+2 downto msbi_g+1) <= SigmaLatch_q(msbi_g+2) &
SigmaLatch_q(msbi_g+2);
DeltaB_s(msbi_g downto 0) <= (others => '0');
DeltaAdder_s <= unsigned('0' & '0' & dac_i) + DeltaB_s;
SigmaAdder_s <= DeltaAdder_s + SigmaLatch_q;
seq: process (clk_i, res_n_i)
begin
if res_n_i = '0' then
SigmaLatch_q <= to_unsigned(2**(msbi_g+1), SigmaLatch_q'length);
DACout_q <= '0';
elsif clk_i'event and clk_i = '1' then
SigmaLatch_q <= SigmaAdder_s;
DACout_q <= SigmaLatch_q(msbi_g+2);
end if;
end process seq;
dac_o <= DACout_q;
end rtl;

View File

@@ -0,0 +1,75 @@
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.altera_mf_components.all;
entity dpram is
generic (
addr_width_g : integer := 8;
data_width_g : integer := 8
);
PORT
(
address_a : IN STD_LOGIC_VECTOR (addr_width_g-1 DOWNTO 0);
address_b : IN STD_LOGIC_VECTOR (addr_width_g-1 DOWNTO 0);
clock_a : IN STD_LOGIC := '1';
clock_b : IN STD_LOGIC ;
data_a : IN STD_LOGIC_VECTOR (data_width_g-1 DOWNTO 0);
data_b : IN STD_LOGIC_VECTOR (data_width_g-1 DOWNTO 0);
enable_a : IN STD_LOGIC := '1';
enable_b : IN STD_LOGIC := '1';
wren_a : IN STD_LOGIC := '0';
wren_b : IN STD_LOGIC := '0';
q_a : OUT STD_LOGIC_VECTOR (data_width_g-1 DOWNTO 0);
q_b : OUT STD_LOGIC_VECTOR (data_width_g-1 DOWNTO 0)
);
END dpram;
ARCHITECTURE SYN OF dpram IS
BEGIN
altsyncram_component : altsyncram
GENERIC MAP (
address_reg_b => "CLOCK1",
clock_enable_input_a => "NORMAL",
clock_enable_input_b => "NORMAL",
clock_enable_output_a => "BYPASS",
clock_enable_output_b => "BYPASS",
indata_reg_b => "CLOCK1",
intended_device_family => "Cyclone V",
lpm_type => "altsyncram",
numwords_a => 2**addr_width_g,
numwords_b => 2**addr_width_g,
operation_mode => "BIDIR_DUAL_PORT",
outdata_aclr_a => "NONE",
outdata_aclr_b => "NONE",
outdata_reg_a => "UNREGISTERED",
outdata_reg_b => "UNREGISTERED",
power_up_uninitialized => "FALSE",
read_during_write_mode_port_a => "NEW_DATA_NO_NBE_READ",
read_during_write_mode_port_b => "NEW_DATA_NO_NBE_READ",
widthad_a => addr_width_g,
widthad_b => addr_width_g,
width_a => data_width_g,
width_b => data_width_g,
width_byteena_a => 1,
width_byteena_b => 1,
wrcontrol_wraddress_reg_b => "CLOCK1"
)
PORT MAP (
address_a => address_a,
address_b => address_b,
clock0 => clock_a,
clock1 => clock_b,
clocken0 => enable_a,
clocken1 => enable_b,
data_a => data_a,
data_b => data_b,
wren_a => wren_a,
wren_b => wren_b,
q_a => q_a,
q_b => q_b
);
END SYN;

View File

@@ -0,0 +1,442 @@
------------------------------------------------------------------------------
-- FPGA GALAXIAN
--
-- Version downto 2.50
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important not
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-- 2004- 4-30 galaxian modify by K.DEGAWA
-- 2004- 5- 6 first release.
-- 2004- 8-23 Improvement with T80-IP.
-- 2004- 9-22 The problem which missile didn't sometimes come out from was improved.
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
--use work.pkg_galaxian.all;
entity galaxian is
port(
W_CLK_18M : in std_logic;
W_CLK_12M : in std_logic;
W_CLK_6M : in std_logic;
P1_CSJUDLR : in std_logic_vector(6 downto 0);
P2_CSJUDLR : in std_logic_vector(6 downto 0);
I_RESET : in std_logic;
W_R : out std_logic_vector(2 downto 0);
W_G : out std_logic_vector(2 downto 0);
W_B : out std_logic_vector(2 downto 0);
HBLANK : out std_logic;
VBLANK : out std_logic;
W_H_SYNC : out std_logic;
W_V_SYNC : out std_logic;
W_SDAT_A : out std_logic_vector( 7 downto 0);
W_SDAT_B : out std_logic_vector( 7 downto 0);
O_CMPBL : out std_logic
);
end;
architecture RTL of galaxian is
-- CPU ADDRESS BUS
signal W_A : std_logic_vector(15 downto 0) := (others => '0');
-- CPU IF
signal W_CPU_CLK : std_logic := '0';
signal W_CPU_MREQn : std_logic := '0';
signal W_CPU_NMIn : std_logic := '0';
signal W_CPU_RDn : std_logic := '0';
signal W_CPU_RFSHn : std_logic := '0';
signal W_CPU_WAITn : std_logic := '0';
signal W_CPU_WRn : std_logic := '0';
signal W_CPU_WR : std_logic := '0';
signal W_RESETn : std_logic := '0';
-------- H and V COUNTER -------------------------
signal W_C_BLn : std_logic := '0';
signal W_C_BLnX : std_logic := '0';
signal W_C_BLXn : std_logic := '0';
signal W_H_BL : std_logic := '0';
signal W_H_SYNC_int : std_logic := '0';
signal W_V_BLn : std_logic := '0';
signal W_V_BL2n : std_logic := '0';
signal W_V_SYNC_int : std_logic := '0';
signal W_H_CNT : std_logic_vector(8 downto 0) := (others => '0');
signal W_V_CNT : std_logic_vector(7 downto 0) := (others => '0');
-------- CPU RAM ----------------------------
signal W_CPU_RAM_DO : std_logic_vector(7 downto 0) := (others => '0');
-------- ADDRESS DECDER ----------------------
signal W_BD_G : std_logic := '0';
signal W_CPU_RAM_CS : std_logic := '0';
signal W_CPU_RAM_RD : std_logic := '0';
-- signal W_CPU_RAM_WR : std_logic := '0';
signal W_CPU_ROM_CS : std_logic := '0';
signal W_DIP_OE : std_logic := '0';
signal W_H_FLIP : std_logic := '0';
signal W_DRIVER_WE : std_logic := '0';
signal W_OBJ_RAM_RD : std_logic := '0';
signal W_OBJ_RAM_RQ : std_logic := '0';
signal W_OBJ_RAM_WR : std_logic := '0';
signal W_PITCH : std_logic := '0';
signal W_SOUND_WE : std_logic := '0';
signal W_STARS_ON : std_logic := '0';
signal W_STARS_OFFn : std_logic := '0';
signal W_SW0_OE : std_logic := '0';
signal W_SW1_OE : std_logic := '0';
signal W_V_FLIP : std_logic := '0';
signal W_VID_RAM_RD : std_logic := '0';
signal W_VID_RAM_WR : std_logic := '0';
signal W_WDR_OE : std_logic := '0';
--------- INPORT -----------------------------
signal W_SW_DO : std_logic_vector( 7 downto 0) := (others => '0');
--------- VIDEO -----------------------------
signal W_VID_DO : std_logic_vector( 7 downto 0) := (others => '0');
----- DATA I/F -------------------------------------
signal W_CPU_ROM_DO : std_logic_vector( 7 downto 0) := (others => '0');
signal W_CPU_ROM_DOB : std_logic_vector( 7 downto 0) := (others => '0');
signal W_BDO : std_logic_vector( 7 downto 0) := (others => '0');
signal W_BDI : std_logic_vector( 7 downto 0) := (others => '0');
signal W_CPU_RAM_CLK : std_logic := '0';
signal W_VOL1 : std_logic := '0';
signal W_VOL2 : std_logic := '0';
signal W_FIRE : std_logic := '0';
signal W_HIT : std_logic := '0';
signal W_FS : std_logic_vector( 2 downto 0) := (others => '0');
signal blx_comb : std_logic := '0';
signal W_1VF : std_logic := '0';
signal W_256HnX : std_logic := '0';
signal W_8HF : std_logic := '0';
signal W_DAC_A : std_logic := '0';
signal W_DAC_B : std_logic := '0';
signal W_MISSILEn : std_logic := '0';
signal W_SHELLn : std_logic := '0';
signal W_MS_D : std_logic := '0';
signal W_MS_R : std_logic := '0';
signal W_MS_G : std_logic := '0';
signal W_MS_B : std_logic := '0';
signal new_sw : std_logic_vector( 2 downto 0) := (others => '0');
signal in_game : std_logic_vector( 1 downto 0) := (others => '0');
signal ROM_D : std_logic_vector( 7 downto 0) := (others => '0');
signal rst_count : std_logic_vector( 3 downto 0) := (others => '0');
signal W_COL : std_logic_vector( 2 downto 0) := (others => '0');
signal W_STARS_B : std_logic_vector( 1 downto 0) := (others => '0');
signal W_STARS_G : std_logic_vector( 1 downto 0) := (others => '0');
signal W_STARS_R : std_logic_vector( 1 downto 0) := (others => '0');
signal W_VID : std_logic_vector( 1 downto 0) := (others => '0');
signal W_VIDEO_B : std_logic_vector( 2 downto 0) := (others => '0');
signal W_VIDEO_G : std_logic_vector( 2 downto 0) := (others => '0');
signal W_VIDEO_R : std_logic_vector( 2 downto 0) := (others => '0');
signal W_WAV_A0 : std_logic_vector(18 downto 0) := (others => '0');
signal W_WAV_A1 : std_logic_vector(18 downto 0) := (others => '0');
signal W_WAV_A2 : std_logic_vector(18 downto 0) := (others => '0');
signal W_WAV_D0 : std_logic_vector( 7 downto 0) := (others => '0');
signal W_WAV_D1 : std_logic_vector( 7 downto 0) := (others => '0');
signal W_WAV_D2 : std_logic_vector( 7 downto 0) := (others => '0');
signal W_DAC : std_logic_vector( 3 downto 0) := (others => '0');
signal gfx_bank : std_logic;
begin
mc_vid : entity work.MC_VIDEO
port map(
I_CLK_18M => W_CLK_18M,
I_CLK_12M => W_CLK_12M,
I_CLK_6M => W_CLK_6M,
I_H_CNT => W_H_CNT,
I_V_CNT => W_V_CNT,
I_H_FLIP => W_H_FLIP,
I_V_FLIP => W_V_FLIP,
I_V_BLn => W_V_BLn,
I_C_BLn => W_C_BLn,
I_A => W_A(9 downto 0),
I_OBJ_SUB_A => "000",
I_BD => W_BDI,
I_OBJ_RAM_RQ => W_OBJ_RAM_RQ,
I_OBJ_RAM_RD => W_OBJ_RAM_RD,
I_OBJ_RAM_WR => W_OBJ_RAM_WR,
I_VID_RAM_RD => W_VID_RAM_RD,
I_VID_RAM_WR => W_VID_RAM_WR,
I_DRIVER_WR => W_DRIVER_WE,
I_BANK => gfx_bank,
O_C_BLnX => W_C_BLnX,
O_8HF => W_8HF,
O_256HnX => W_256HnX,
O_1VF => W_1VF,
O_MISSILEn => W_MISSILEn,
O_SHELLn => W_SHELLn,
O_BD => W_VID_DO,
O_VID => W_VID,
O_COL => W_COL
);
cpu : entity work.T80as
port map (
RESET_n => W_RESETn,
CLK_n => W_CPU_CLK,
WAIT_n => W_CPU_WAITn,
INT_n => '1',
NMI_n => W_CPU_NMIn,
BUSRQ_n => '1',
MREQ_n => W_CPU_MREQn,
RD_n => W_CPU_RDn,
WR_n => W_CPU_WRn,
RFSH_n => W_CPU_RFSHn,
A => W_A,
DI => W_BDO,
DO => W_BDI,
M1_n => open,
IORQ_n => open,
HALT_n => open,
BUSAK_n => open,
DOE => open
);
mc_cpu_ram : entity work.MC_CPU_RAM
port map (
I_CLK => W_CPU_RAM_CLK,
I_ADDR => W_A(9 downto 0),
I_D => W_BDI,
I_WE => W_CPU_WR,
I_OE => W_CPU_RAM_RD,
O_D => W_CPU_RAM_DO
);
mc_adec : entity work.MC_ADEC
port map(
I_CLK_12M => W_CLK_12M,
I_CLK_6M => W_CLK_6M,
I_CPU_CLK => W_CPU_CLK,
I_RSTn => W_RESETn,
I_CPU_A => W_A,
I_CPU_D => W_BDI(0),
I_MREQn => W_CPU_MREQn,
I_RFSHn => W_CPU_RFSHn,
I_RDn => W_CPU_RDn,
I_WRn => W_CPU_WRn,
I_H_BL => W_H_BL,
I_V_BLn => W_V_BLn,
O_WAITn => W_CPU_WAITn,
O_NMIn => W_CPU_NMIn,
O_CPU_ROM_CS => W_CPU_ROM_CS,
O_CPU_RAM_RD => W_CPU_RAM_RD,
-- O_CPU_RAM_WR => W_CPU_RAM_WR,
O_CPU_RAM_CS => W_CPU_RAM_CS,
O_OBJ_RAM_RD => W_OBJ_RAM_RD,
O_OBJ_RAM_WR => W_OBJ_RAM_WR,
O_OBJ_RAM_RQ => W_OBJ_RAM_RQ,
O_VID_RAM_RD => W_VID_RAM_RD,
O_VID_RAM_WR => W_VID_RAM_WR,
O_SW0_OE => W_SW0_OE,
O_SW1_OE => W_SW1_OE,
O_DIP_OE => W_DIP_OE,
O_WDR_OE => W_WDR_OE,
O_DRIVER_WE => W_DRIVER_WE,
O_SOUND_WE => W_SOUND_WE,
O_PITCH => W_PITCH,
O_H_FLIP => W_H_FLIP,
O_V_FLIP => W_V_FLIP,
O_BD_G => W_BD_G,
O_STARS_ON => W_STARS_ON
);
-- active high buttons
mc_inport : entity work.MC_INPORT
port map (
I_COIN1 => P1_CSJUDLR(6),
I_COIN2 => P2_CSJUDLR(6),
I_1P_START => P1_CSJUDLR(5),
I_2P_START => P2_CSJUDLR(5),
I_1P_SH => P1_CSJUDLR(4),
I_2P_SH => P2_CSJUDLR(4),
I_1P_LE => P1_CSJUDLR(1),
I_2P_LE => P2_CSJUDLR(1),
I_1P_RI => P1_CSJUDLR(0),
I_2P_RI => P2_CSJUDLR(0),
I_SW0_OE => W_SW0_OE,
I_SW1_OE => W_SW1_OE,
I_DIP_OE => W_DIP_OE,
O_D => W_SW_DO
);
mc_hv : entity work.MC_HV_COUNT
port map(
I_CLK => W_CLK_6M,
I_RSTn => W_RESETn,
O_H_CNT => W_H_CNT,
O_H_SYNC => W_H_SYNC_int,
O_H_BL => W_H_BL,
O_V_CNT => W_V_CNT,
O_V_SYNC => W_V_SYNC_int,
O_V_BL2n => W_V_BL2n,
O_V_BLn => W_V_BLn,
O_C_BLn => W_C_BLn
);
mc_col_pal : entity work.MC_COL_PAL
port map(
I_CLK_12M => W_CLK_12M,
I_CLK_6M => W_CLK_6M,
I_VID => W_VID,
I_COL => W_COL,
I_C_BLnX => W_C_BLnX,
O_C_BLXn => W_C_BLXn,
O_STARS_OFFn => W_STARS_OFFn,
O_R => W_VIDEO_R,
O_G => W_VIDEO_G,
O_B => W_VIDEO_B
);
mc_stars : entity work.MC_STARS
port map (
I_CLK_18M => W_CLK_18M,
I_CLK_6M => W_CLK_6M,
I_H_FLIP => W_H_FLIP,
I_V_SYNC => W_V_SYNC_int,
I_8HF => W_8HF,
I_256HnX => W_256HnX,
I_1VF => W_1VF,
I_2V => W_V_CNT(1),
I_STARS_ON => W_STARS_ON,
I_STARS_OFFn => W_STARS_OFFn,
O_R => W_STARS_R,
O_G => W_STARS_G,
O_B => W_STARS_B,
O_NOISE => open
);
mc_sound_a : entity work.MC_SOUND_A
port map(
I_CLK_12M => W_CLK_12M,
I_CLK_6M => W_CLK_6M,
I_H_CNT1 => W_H_CNT(1),
I_BD => W_BDI,
I_PITCH => W_PITCH,
I_VOL1 => W_VOL1,
I_VOL2 => W_VOL2,
O_SDAT => W_SDAT_A,
O_DO => open
);
--------- ROM -------------------------------------------------------
mc_roms : entity work.sprom
generic map (
init_file => "./ROM/prog.hex",
widthad_a => 14,
width_a => 8)
port map (
address => W_A(13 downto 0),
clock => W_CLK_12M,
q => W_CPU_ROM_DO
);
-------- VIDEO -----------------------------
blx_comb <= not ( W_C_BLXn and W_V_BL2n );
W_V_SYNC <= not W_V_SYNC_int;
W_H_SYNC <= not W_H_SYNC_int;
O_CMPBL <= W_C_BLnX;
-- MISSILE => Yellow ;
-- SHELL => White ;
W_MS_D <= not (W_MISSILEn and W_SHELLn);
W_MS_R <= not blx_comb and W_MS_D;
W_MS_G <= not blx_comb and W_MS_D;
W_MS_B <= not blx_comb and W_MS_D and not W_SHELLn ;
W_R <= W_VIDEO_R or (W_STARS_R & "0") or (W_MS_R & W_MS_R & "0");
W_G <= W_VIDEO_G or (W_STARS_G & "0") or (W_MS_G & W_MS_G & "0");
W_B <= W_VIDEO_B or (W_STARS_B & "0") or (W_MS_B & W_MS_B & "0");
process(W_CLK_6M)
begin
if rising_edge(W_CLK_6M) then
HBLANK <= not W_C_BLXn;
VBLANK <= not W_V_BL2n;
end if;
end process;
----- CPU I/F -------------------------------------
W_CPU_CLK <= W_H_CNT(0);
W_CPU_RAM_CLK <= W_CLK_12M and W_CPU_RAM_CS;
W_CPU_ROM_DOB <= W_CPU_ROM_DO when W_CPU_ROM_CS = '1' else (others=>'0');
W_RESETn <= not I_RESET;
W_BDO <= W_SW_DO or W_VID_DO or W_CPU_RAM_DO or W_CPU_ROM_DOB ;
W_CPU_WR <= not W_CPU_WRn;
new_sw <= (W_FS(2) or W_FS(1) or W_FS(0)) & W_HIT & W_FIRE;
process(W_CPU_CLK, I_RESET)
begin
if (I_RESET = '1') then
rst_count <= (others => '0');
elsif rising_edge( W_CPU_CLK) then
if ( rst_count /= x"f") then
rst_count <= rst_count + 1;
end if;
end if;
end process;
----- Parts 9L ---------
process(W_CLK_12M, I_RESET)
begin
if (I_RESET = '1') then
W_FS <= (others=>'0');
W_HIT <= '0';
W_FIRE <= '0';
W_VOL1 <= '0';
W_VOL2 <= '0';
elsif rising_edge(W_CLK_12M) then
if (W_SOUND_WE = '1') then
case(W_A(2 downto 0)) is
when "000" => W_FS(0) <= W_BDI(0);
when "001" => W_FS(1) <= W_BDI(0);
when "010" => W_FS(2) <= W_BDI(0);
when "011" => W_HIT <= W_BDI(0);
-- when "100" => UNUSED <= W_BDI(0);
when "101" => W_FIRE <= W_BDI(0);
when "110" => W_VOL1 <= W_BDI(0);
when "111" => W_VOL2 <= W_BDI(0);
when others => null;
end case;
end if;
end if;
end process;
----- Parts 9M ---------
process(W_CLK_12M, I_RESET)
begin
if (I_RESET = '1') then
W_DAC <= (others=>'0');
elsif rising_edge(W_CLK_12M) then
if (W_DRIVER_WE = '1') then
case(W_A(2 downto 0)) is
-- next 4 outputs go off board via ULN2075 buffer
-- when "000" => 1P START <= W_BDI(0);
-- when "001" => 2P START <= W_BDI(0);
when "010" => gfx_bank <= W_BDI(0);
-- when "011" => COIN CTR <= W_BDI(0);
when "100" => W_DAC(0) <= W_BDI(0); -- 1M
when "101" => W_DAC(1) <= W_BDI(0); -- 470K
when "110" => W_DAC(2) <= W_BDI(0); -- 220K
when "111" => W_DAC(3) <= W_BDI(0); -- 100K
when others => null;
end case;
end if;
end if;
end process;
-------------------------------------------------------------------------------
end RTL;

View File

@@ -0,0 +1,251 @@
---------------------------------------------------------------------
-- FPGA GALAXIAN ADDRESS DECDER
--
-- Version : 2.01
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-- 2004- 4-30 galaxian modify by K.DEGAWA
-- 2004- 5- 6 first release.
-- 2004- 8-23 Improvement with T80-IP.
---------------------------------------------------------------------
--
--GALAXIAN Address Map
--
-- Address Item(R..read-mode W..wight-mode) Parts
--0000 - 1FFF CPU-ROM..R ( 7H or 7K )
--2000 - 3FFF CPU-ROM..R ( 7L )
--4000 - 47FF CPU-RAM..RW ( 7N & 7P )
--5000 - 57FF VID-RAM..RW
--5800 - 5FFF OBJ-RAM..RW
--6000 - SW0..R LAMP......W
--6800 - SW1..R SOUND.....W
--7000 - DIP..R
--7001 NMI_ON....W
--7004 STARS_ON..W
--7006 H_FLIP....W
--7007 V-FLIP....W
--7800 WDR..R PITCH.....W
--
--W MODE
--6000 1P START
--6001 2P START
--6002 COIN LOCKOUT
--6003 COIN COUNTER
--6004 - 6007 SOUND CONTROL(OSC)
--
--6800 SOUND CONTROL(FS1)
--6801 SOUND CONTROL(FS2)
--6802 SOUND CONTROL(FS3)
--6803 SOUND CONTROL(HIT)
--6805 SOUND CONTROL(SHOT)
--6806 SOUND CONTROL(VOL1)
--6807 SOUND CONTROL(VOL2)
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity MC_ADEC is
port (
I_CLK_12M : in std_logic;
I_CLK_6M : in std_logic;
I_CPU_CLK : in std_logic;
I_RSTn : in std_logic;
I_CPU_A : in std_logic_vector(15 downto 0);
I_CPU_D : in std_logic;
I_MREQn : in std_logic;
I_RFSHn : in std_logic;
I_RDn : in std_logic;
I_WRn : in std_logic;
I_H_BL : in std_logic;
I_V_BLn : in std_logic;
O_WAITn : out std_logic;
O_NMIn : out std_logic;
O_CPU_ROM_CS : out std_logic;
O_CPU_RAM_RD : out std_logic;
O_CPU_RAM_WR : out std_logic;
O_CPU_RAM_CS : out std_logic;
O_OBJ_RAM_RD : out std_logic;
O_OBJ_RAM_WR : out std_logic;
O_OBJ_RAM_RQ : out std_logic;
O_VID_RAM_RD : out std_logic;
O_VID_RAM_WR : out std_logic;
O_SW0_OE : out std_logic;
O_SW1_OE : out std_logic;
O_DIP_OE : out std_logic;
O_WDR_OE : out std_logic;
O_DRIVER_WE : out std_logic;
O_SOUND_WE : out std_logic;
O_PITCH : out std_logic;
O_H_FLIP : out std_logic;
O_V_FLIP : out std_logic;
O_BD_G : out std_logic;
O_STARS_ON : out std_logic
);
end;
architecture RTL of MC_ADEC is
signal W_8E1_Q : std_logic_vector(3 downto 0) := (others => '0');
signal W_8E2_Q : std_logic_vector(3 downto 0) := (others => '0');
signal W_8P_Q : std_logic_vector(7 downto 0) := (others => '0');
signal W_8N_Q : std_logic_vector(7 downto 0) := (others => '0');
signal W_8M_Q : std_logic_vector(7 downto 0) := (others => '0');
signal W_9N_Q : std_logic_vector(7 downto 0) := (others => '0');
signal W_NMI_ONn : std_logic := '0';
-------- CPU WAITn ----------------------------------------------
-- signal W_6S1_Q : std_logic := '0';
signal W_6S1_Qn : std_logic := '0';
-- signal W_6S2_Qn : std_logic := '0';
signal W_V_BL : std_logic := '0';
begin
W_NMI_ONn <= W_9N_Q(1); -- galaxian
-- O_WAITn <= '1' ; -- No Wait
O_WAITn <= W_6S1_Qn;
process(I_CPU_CLK, I_V_BLn)
begin
if (I_V_BLn = '0') then
-- W_6S1_Q <= '0';
W_6S1_Qn <= '1';
elsif rising_edge(I_CPU_CLK) then
-- W_6S1_Q <= not (I_H_BL or W_8P_Q(2));
W_6S1_Qn <= I_H_BL or W_8P_Q(2);
end if;
end process;
-- process(I_CPU_CLK)
-- begin
-- if falling_edge(I_CPU_CLK) then
-- W_6S2_Qn <= not W_6S1_Q;
-- end if;
-- end process;
-------- CPU NMIn -----------------------------------------------
W_V_BL <= not I_V_BLn;
process(W_V_BL, W_NMI_ONn)
begin
if (W_NMI_ONn = '0') then
O_NMIn <= '1';
elsif rising_edge(W_V_BL) then
O_NMIn <= '0';
end if;
end process;
-------------------------------------------------------------------
u_8e1 : entity work.LOGIC_74XX139
port map (
I_G => I_MREQn,
I_Sel(1) => I_CPU_A(15),
I_Sel(0) => I_CPU_A(14),
O_Q => W_8E1_Q
);
---------- CPU_ROM CS 0000 - 3FFF ---------------------------
u_8e2 : entity work.LOGIC_74XX139
port map (
I_G => I_RDn,
I_Sel(1) => W_8E1_Q(0),
I_Sel(0) => I_CPU_A(13),
O_Q => W_8E2_Q
);
O_CPU_ROM_CS <= not (W_8E2_Q(0) and W_8E2_Q(1) ) ; -- 0000 - 3FFF
-------------------------------------------------------------------
-- ADDRESS
-- W_8E1_Q[0] = 0000 - 3FFF ---- CPU_ROM_USE
-- W_8E1_Q[1] = 4000 - 7FFF ---- GALAXIAN USE *1
-- W_8E1_Q[2] = 8000 - BFFF ---- MOONCREST USE
-- W_8E1_Q[3] = C000 - FFFF
u_8p : entity work.LOGIC_74XX138
port map (
I_G1 => I_RFSHn,
I_G2a => W_8E1_Q(1), -- <= *1
I_G2b => W_8E1_Q(1), -- <= *1
I_Sel => I_CPU_A(13 downto 11),
O_Q => W_8P_Q
);
u_8n : entity work.LOGIC_74XX138
port map (
I_G1 => '1',
I_G2a => I_RDn,
I_G2b => W_8E1_Q(1), -- <= *1
I_Sel => I_CPU_A(13 downto 11),
O_Q => W_8N_Q
);
u_8m : entity work.LOGIC_74XX138
port map (
-- I_G1 => W_6S2_Qn,
I_G1 => '1', -- No Wait
I_G2a => I_WRn,
I_G2b => W_8E1_Q(1), -- <= *1
I_Sel => I_CPU_A(13 downto 11),
O_Q => W_8M_Q
);
O_BD_G <= not (W_8E1_Q(0) and W_8P_Q(0));
O_OBJ_RAM_RQ <= not W_8P_Q(3);
O_CPU_RAM_CS <= not (W_8N_Q(0) and W_8M_Q(0));
O_WDR_OE <= not W_8N_Q(7);
O_DIP_OE <= not W_8N_Q(6);
O_SW1_OE <= not W_8N_Q(5);
O_SW0_OE <= not W_8N_Q(4);
O_OBJ_RAM_RD <= not W_8N_Q(3);
O_VID_RAM_RD <= not W_8N_Q(2);
-- UNUSED <= not W_8N_Q(1);
O_CPU_RAM_RD <= not W_8N_Q(0);
O_PITCH <= not W_8M_Q(7);
-- STARS_ON_ENA <= not W_8M_Q(6);
O_SOUND_WE <= not W_8M_Q(5);
O_DRIVER_WE <= not W_8M_Q(4);
O_OBJ_RAM_WR <= not W_8M_Q(3);
O_VID_RAM_WR <= not W_8M_Q(2);
-- UNUSED <= not W_8M_Q(1);
O_CPU_RAM_WR <= not W_8M_Q(0);
----- Parts 9N ---------
process(I_CLK_12M, I_RSTn)
begin
if (I_RSTn = '0') then
W_9N_Q <= (others => '0');
elsif rising_edge(I_CLK_12M) then
if (W_8M_Q(6) = '0') then
case I_CPU_A(2 downto 0) is
when "000" => W_9N_Q(0) <= I_CPU_D;
when "001" => W_9N_Q(1) <= I_CPU_D;
when "010" => W_9N_Q(2) <= I_CPU_D;
when "011" => W_9N_Q(3) <= I_CPU_D;
when "100" => W_9N_Q(4) <= I_CPU_D;
when "101" => W_9N_Q(5) <= I_CPU_D;
when "110" => W_9N_Q(6) <= I_CPU_D;
when "111" => W_9N_Q(7) <= I_CPU_D;
when others => null;
end case;
end if;
end if;
end process;
O_STARS_ON <= W_9N_Q(4);
O_H_FLIP <= W_9N_Q(6);
O_V_FLIP <= W_9N_Q(7);
end RTL;

View File

@@ -0,0 +1,182 @@
------------------------------------------------------------------------------
-- FPGA MOONCRESTA & GALAXIAN
-- FPGA BLOCK RAM I/F (XILINX SPARTAN)
--
-- Version : 2.50
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-- mc_col_rom(6L) added by k.Degawa
--
-- 2004- 5- 6 first release.
-- 2004- 8-23 Improvement with T80-IP. K.Degawa
-- 2004- 9-18 added Xilinx Device K.Degawa
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
-- mc_top.v use
entity MC_CPU_RAM is
port (
I_CLK : in std_logic;
I_ADDR : in std_logic_vector(9 downto 0);
I_D : in std_logic_vector(7 downto 0);
I_WE : in std_logic;
I_OE : in std_logic;
O_D : out std_logic_vector(7 downto 0)
);
end;
architecture RTL of MC_CPU_RAM is
signal W_D : std_logic_vector(7 downto 0) := (others => '0');
begin
O_D <= W_D when I_OE ='1' else (others=>'0');
ram_inst : work.spram generic map(10,8)
port map
(
address => I_ADDR,
clock => I_CLK,
data => I_D,
wren => I_WE,
q => W_D
);
end RTL;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
-- mc_video.v use
entity MC_OBJ_RAM is
port(
I_CLKA : in std_logic := '0';
I_WEA : in std_logic := '0';
I_CEA : in std_logic := '0';
I_ADDRA : in std_logic_vector(7 downto 0);
I_DA : in std_logic_vector(7 downto 0);
O_DA : out std_logic_vector(7 downto 0);
I_CLKB : in std_logic := '0';
I_WEB : in std_logic := '0';
I_CEB : in std_logic := '0';
I_ADDRB : in std_logic_vector(7 downto 0);
I_DB : in std_logic_vector(7 downto 0);
O_DB : out std_logic_vector(7 downto 0)
);
end;
architecture RTL of MC_OBJ_RAM is
begin
ram_inst : work.dpram generic map(8,8)
port map
(
clock_a => I_CLKA,
address_a => I_ADDRA,
data_a => I_DA,
q_a => O_DA,
enable_a => I_CEA,
wren_a => I_WEA,
clock_b => I_CLKB,
address_b => I_ADDRB,
data_b => I_DB,
q_b => O_DB,
enable_b => I_CEB,
wren_b => I_WEB
);
end RTL;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
-- mc_video.v use
entity MC_VID_RAM is
port (
I_CLKA : in std_logic := '0';
I_WEA : in std_logic := '0';
I_CEA : in std_logic := '0';
I_ADDRA : in std_logic_vector(9 downto 0);
I_DA : in std_logic_vector(7 downto 0);
O_DA : out std_logic_vector(7 downto 0);
I_CLKB : in std_logic := '0';
I_WEB : in std_logic := '0';
I_CEB : in std_logic := '0';
I_ADDRB : in std_logic_vector(9 downto 0);
I_DB : in std_logic_vector(7 downto 0);
O_DB : out std_logic_vector(7 downto 0)
);
end;
architecture RTL of MC_VID_RAM is
begin
ram_inst : work.dpram generic map(10,8)
port map
(
clock_a => I_CLKA,
address_a => I_ADDRA,
data_a => I_DA,
q_a => O_DA,
enable_a => I_CEA,
wren_a => I_WEA,
clock_b => I_CLKB,
address_b => I_ADDRB,
data_b => I_DB,
q_b => O_DB,
enable_b => I_CEB,
wren_b => I_WEB
);
end RTL;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
-- mc_video.v use
entity MC_LRAM is
port (
I_CLK : in std_logic;
I_ADDR : in std_logic_vector(7 downto 0);
I_D : in std_logic_vector(4 downto 0);
I_WE : in std_logic;
O_Dn : out std_logic_vector(4 downto 0)
);
end;
architecture RTL of MC_LRAM is
signal W_D : std_logic_vector(4 downto 0) := (others => '0');
begin
O_Dn <= not W_D;
ram_inst : work.dpram generic map(8,5)
port map
(
clock_a => I_CLK,
address_a => I_ADDR,
data_a => I_D,
wren_a => not I_WE,
clock_b => not I_CLK,
address_b => I_ADDR,
data_b => (others => '0'),
q_b => W_D,
enable_b => '1',
wren_b => '0'
);
end RTL;

View File

@@ -0,0 +1,85 @@
-----------------------------------------------------------------------
-- FPGA MOONCRESTA CLOCK GEN
--
-- Version : 1.00
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-----------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity CLOCKGEN is
port (
CLKIN_IN : in std_logic;
RST_IN : in std_logic;
--
O_CLK_24M : out std_logic;
O_CLK_18M : out std_logic;
O_CLK_12M : out std_logic;
O_CLK_06M : out std_logic
);
end;
architecture RTL of CLOCKGEN is
signal state : std_logic_vector(1 downto 0) := (others => '0');
signal ctr1 : std_logic_vector(1 downto 0) := (others => '0');
signal ctr2 : std_logic_vector(2 downto 0) := (others => '0');
signal CLKFB_IN : std_logic := '0';
signal CLK0_BUF : std_logic := '0';
signal CLKFX_BUF : std_logic := '0';
signal CLK_72M : std_logic := '0';
signal I_DCM_LOCKED : std_logic := '0';
begin
dcm_inst : DCM_SP
generic map (
CLKFX_MULTIPLY => 9,
CLKFX_DIVIDE => 4,
CLKIN_PERIOD => 31.25
)
port map (
CLKIN => CLKIN_IN,
CLKFB => CLKFB_IN,
RST => RST_IN,
CLK0 => CLK0_BUF,
CLKFX => CLKFX_BUF,
LOCKED => I_DCM_LOCKED
);
BUFG0 : BUFG port map (I=> CLK0_BUF, O => CLKFB_IN);
BUFG1 : BUFG port map (I=> CLKFX_BUF, O => CLK_72M);
O_CLK_06M <= ctr2(2);
O_CLK_12M <= ctr2(1);
O_CLK_24M <= ctr2(0);
O_CLK_18M <= ctr1(1);
-- generate all clocks, 36Mhz, 18Mhz, 24Mhz, 12Mhz and 6Mhz
process(CLK_72M)
begin
if rising_edge(CLK_72M) then
if (I_DCM_LOCKED = '0') then
state <= "00";
ctr1 <= (others=>'0');
ctr2 <= (others=>'0');
else
ctr1 <= ctr1 + 1;
case state is
when "00" => state <= "01"; ctr2 <= ctr2 + 1;
when "01" => state <= "10"; ctr2 <= ctr2 + 1;
when "10" => state <= "00";
when "11" => state <= "00";
when others => null;
end case;
end if;
end if;
end process;
end RTL;

View File

@@ -0,0 +1,83 @@
-------------------------------------------------------------------------------
-- FPGA MOONCRESTA COLOR-PALETTE
--
-- Version : 2.00
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-- 2004- 9-18 added Xilinx Device. K.Degawa
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
-- use ieee.numeric_std.all;
--library UNISIM;
-- use UNISIM.Vcomponents.all;
entity MC_COL_PAL is
port (
I_CLK_12M : in std_logic;
I_CLK_6M : in std_logic;
I_VID : in std_logic_vector(1 downto 0);
I_COL : in std_logic_vector(2 downto 0);
I_C_BLnX : in std_logic;
O_C_BLXn : out std_logic;
O_STARS_OFFn : out std_logic;
O_R : out std_logic_vector(2 downto 0);
O_G : out std_logic_vector(2 downto 0);
O_B : out std_logic_vector(2 downto 0)
);
end;
architecture RTL of MC_COL_PAL is
--- Parts 6M --------------------------------------------------------
signal W_COL_ROM_DO : std_logic_vector(7 downto 0) := (others => '0');
signal W_6M_DI : std_logic_vector(6 downto 0) := (others => '0');
signal W_6M_DO : std_logic_vector(6 downto 0) := (others => '0');
signal W_6M_CLR : std_logic := '0';
begin
W_6M_DI <= I_COL(2 downto 0) & I_VID(1 downto 0) & not (I_VID(0) or I_VID(1)) & I_C_BLnX;
W_6M_CLR <= W_6M_DI(0) or W_6M_DO(0);
O_C_BLXn <= W_6M_DI(0) or W_6M_DO(0);
O_STARS_OFFn <= W_6M_DO(1);
--always@(posedge I_CLK_6M or negedge W_6M_CLR)
process(I_CLK_6M, W_6M_CLR)
begin
if (W_6M_CLR = '0') then
W_6M_DO <= (others => '0');
elsif rising_edge(I_CLK_6M) then
W_6M_DO <= W_6M_DI;
end if;
end process;
--- COL ROM --------------------------------------------------------
--wire W_COL_ROM_OEn = W_6M_DO[1];
crom : entity work.sprom
generic map (
init_file => "./ROM/col.hex",
widthad_a => 5,
width_a => 8)
port map (
address => W_6M_DO(6 downto 2),
clock => I_CLK_12M,
q => W_COL_ROM_DO
);
--- VID OUT --------------------------------------------------------
O_R <= W_COL_ROM_DO(2 downto 0);
O_G <= W_COL_ROM_DO(5 downto 3);
O_B <= W_COL_ROM_DO(7 downto 6) & "0";
end;

View File

@@ -0,0 +1,145 @@
-----------------------------------------------------------------------
-- FPGA MOONCRESTA H & V COUNTER
--
-- Version : 2.00
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-- 2004- 9-22
-----------------------------------------------------------------------
-- MoonCrest hv_count
-- H_CNT 0 - 255 , 384 - 511 Total 384 count
-- V_CNT 0 - 255 , 504 - 511 Total 264 count
-------------------------------------------------------------------------------------------
-- H_CNT[0], H_CNT[1], H_CNT[2], H_CNT[3], H_CNT[4], H_CNT[5], H_CNT[6], H_CNT[7], H_CNT[8],
-- 1 H 2 H 4 H 8 H 16 H 32 H 64 H 128 H 256 H
-------------------------------------------------------------------------------------------
-- V_CNT[0], V_CNT[1], V_CNT[2], V_CNT[3], V_CNT[4], V_CNT[5], V_CNT[6], V_CNT[7]
-- 1 V 2 V 4 V 8 V 16 V 32 V 64 V 128 V
-------------------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity MC_HV_COUNT is
port(
I_CLK : in std_logic;
I_RSTn : in std_logic;
O_H_CNT : out std_logic_vector(8 downto 0);
O_H_SYNC : out std_logic;
O_H_BL : out std_logic;
O_V_BL2n : out std_logic;
O_V_CNT : out std_logic_vector(7 downto 0);
O_V_SYNC : out std_logic;
O_V_BLn : out std_logic;
O_C_BLn : out std_logic
);
end;
architecture RTL of MC_HV_COUNT is
signal H_CNT : std_logic_vector(8 downto 0) := (others => '0');
signal V_CNT : std_logic_vector(8 downto 0) := (others => '0');
signal H_SYNC : std_logic := '0';
signal H_CLK : std_logic := '0';
signal H_BL : std_logic := '0';
signal V_BLn : std_logic := '0';
signal V_BL2n : std_logic := '0';
begin
--------- H_COUNT ----------------------------------------
process(I_CLK)
begin
if rising_edge(I_CLK) then
if (H_CNT = 255) then
H_CNT <= std_logic_vector(to_unsigned(384, H_CNT'length));
else
H_CNT <= H_CNT + 1 ;
end if;
end if;
end process;
O_H_CNT <= H_CNT;
--------- H_SYNC ----------------------------------------
H_CLK <= H_CNT(4);
process(H_CLK, H_CNT(8))
begin
if (H_CNT(8) = '0') then
H_SYNC <= '0';
elsif rising_edge(H_CLK) then
H_SYNC <= (not H_CNT(6) ) and H_CNT(5);
end if;
end process;
O_H_SYNC <= H_SYNC;
--------- H_BL ------------------------------------------
process(I_CLK)
begin
if rising_edge(I_CLK) then
if H_CNT = 387 then
H_BL <= '1';
elsif H_CNT = 503 then
H_BL <= '0';
end if;
end if;
end process;
O_H_BL <= H_BL;
--------- V_COUNT ----------------------------------------
process(H_SYNC, I_RSTn)
begin
if (I_RSTn = '0') then
V_CNT <= (others => '0');
elsif rising_edge(H_SYNC) then
if (V_CNT = 255) then
V_CNT <= std_logic_vector(to_unsigned(504, V_CNT'length));
else
V_CNT <= V_CNT + 1 ;
end if;
end if;
end process;
O_V_CNT <= V_CNT(7 downto 0);
O_V_SYNC <= V_CNT(8);
--------- V_BLn ------------------------------------------
process(H_SYNC)
begin
if rising_edge(H_SYNC) then
if V_CNT(7 downto 0) = 239 then
V_BLn <= '0';
elsif V_CNT(7 downto 0) = 15 then
V_BLn <= '1';
end if;
end if;
end process;
process(H_SYNC)
begin
if rising_edge(H_SYNC) then
if V_CNT(7 downto 0) = 239 then
V_BL2n <= '0';
elsif V_CNT(7 downto 0) = 16 then
V_BL2n <= '1';
end if;
end if;
end process;
O_V_BLn <= V_BLn;
O_V_BL2n <= V_BL2n;
------- C_BLn ------------------------------------------
O_C_BLn <= V_BLn and (not H_CNT(8));
end;

View File

@@ -0,0 +1,86 @@
-----------------------------------------------------------------------
-- FPGA MOONCRESTA INPORT
--
-- Version : 1.01
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-- 2004-4-30 galaxian modify by K.DEGAWA
-----------------------------------------------------------------------
-- DIP SW 0 1 2 3 4 5
-----------------------------------------------------------------
-- COIN CHUTE
-- 1 COIN/1 PLAY 1'b0 1'b0
-- 2 COIN/1 PLAY 1'b1 1'b0
-- 1 COIN/2 PLAY 1'b0 1'b1
-- FREE PLAY 1'b1 1'b1
-- BOUNS
-- 1'b0 1'b0
-- 1'b1 1'b0
-- 1'b0 1'b1
-- 1'b1 1'b1
-- LIVES
-- 2 1'b0
-- 3 1'b1
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity MC_INPORT is
port (
I_COIN1 : in std_logic; -- active high
I_COIN2 : in std_logic; -- active high
I_1P_SH : in std_logic; -- active high
I_1P_LE : in std_logic; -- active high
I_1P_RI : in std_logic; -- active high
I_1P_UP : in std_logic; -- active high
I_1P_DW : in std_logic; -- active high
I_1P_START : in std_logic; -- active high
I_2P_START : in std_logic; -- active high
I_SW0_OE : in std_logic;
I_SW1_OE : in std_logic;
I_DIP_OE : in std_logic;
O_D : out std_logic_vector(7 downto 0)
);
end;
architecture RTL of MC_INPORT is
constant W_TABLE : std_logic := '0'; -- UP = 0;
constant W_TEST : std_logic := '0';
constant W_SERVICE : std_logic := '0';
signal W_SW0_DO : std_logic_vector(7 downto 0) := (others => '0');
signal W_SW1_DO : std_logic_vector(7 downto 0) := (others => '0');
signal W_DIP_DO : std_logic_vector(7 downto 0) := (others => '0');
begin
W_SW0_DO <= x"00" when I_SW0_OE = '0' else I_1P_UP & "0" & I_1P_DW & I_1P_SH & I_1P_RI & I_1P_LE & I_COIN2 & I_COIN1;
W_SW1_DO <= x"00" when I_SW1_OE = '0' else "010000" & I_2P_START & I_1P_START;
W_DIP_DO <= x"00" when I_DIP_OE = '0' else "00001010";
O_D <= W_SW0_DO or W_SW1_DO or W_DIP_DO ;
-- W_SW0_DO <= x"00" when I_SW0_OE = '0' else I_1P_UP & I_1P_DW & W_TABLE & I_1P_SH & I_1P_RI & I_1P_LE & I_1P_UP & I_COIN1;
-- W_SW1_DO <= x"00" when I_SW1_OE = '0' else "01" & "0" & "0" & "0" & "0" & I_2P_START & I_1P_START;
-- W_DIP_DO <= x"00" when I_DIP_OE = '0' else "00001010";
-- O_D <= W_SW0_DO or W_SW1_DO or W_DIP_DO ;
-- W_SW0_DO <= x"00" when I_SW0_OE = '0' else W_SERVICE & W_TEST & W_TABLE & I_1P_SH & I_1P_RI & I_1P_LE & I_COIN2 & I_COIN1;
-- W_SW1_DO <= x"00" when I_SW1_OE = '0' else "010" & I_2P_SH & I_2P_RI & I_2P_LE & I_2P_START & I_1P_START;
-- W_DIP_DO <= x"00" when I_DIP_OE = '0' else "00001010";
-- O_D <= W_SW0_DO or W_SW1_DO or W_DIP_DO ;
end RTL;

View File

@@ -0,0 +1,115 @@
-------------------------------------------------------------------------------
-- FPGA MOONCRESTA VIDEO-LD_PLS_GEN
--
-- Version : 2.00
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-- 2004- 9-22 The problem where missile sometimes didn't come out was fixed.
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity MC_LD_PLS is
port (
I_CLK_6M : in std_logic;
I_H_CNT : in std_logic_vector(8 downto 0);
I_3D_DI : in std_logic;
O_LDn : out std_logic;
O_CNTRLDn : out std_logic;
O_CNTRCLRn : out std_logic;
O_COLLn : out std_logic;
O_VPLn : out std_logic;
O_OBJDATALn : out std_logic;
O_MLDn : out std_logic;
O_SLDn : out std_logic
);
end;
architecture RTL of MC_LD_PLS is
signal W_4C1_Q : std_logic_vector(3 downto 0) := (others => '0');
signal W_4C2_Q : std_logic_vector(3 downto 0) := (others => '0');
signal W_4C1_Q3 : std_logic := '0';
signal W_4C2_B : std_logic := '0';
signal W_4D1_G : std_logic := '0';
signal W_4D1_Q : std_logic_vector(3 downto 0) := (others => '0');
signal W_4D2_Q : std_logic_vector(3 downto 0) := (others => '0');
signal W_5C_Q : std_logic := '0';
signal W_HCNT : std_logic := '0';
begin
O_LDn <= W_4D1_G;
O_CNTRLDn <= W_4D1_Q(2);
O_CNTRCLRn <= W_4D1_Q(0);
O_COLLn <= W_4D2_Q(2);
O_VPLn <= W_4D2_Q(0);
O_OBJDATALn <= W_4C1_Q(2);
O_MLDn <= W_4C2_Q(0);
O_SLDn <= W_4C2_Q(1);
W_4D1_G <= not (I_H_CNT(0) and I_H_CNT(1) and I_H_CNT(2));
W_HCNT <= not (I_H_CNT(6) and I_H_CNT(5) and I_H_CNT(4) and I_H_CNT(3));
-- Parts 4D
u_4d1 : entity work.LOGIC_74XX139
port map(
I_G => W_4D1_G,
I_Sel(1) => I_H_CNT(8),
I_Sel(0) => I_H_CNT(3),
O_Q =>W_4D1_Q
);
u_4d2 : entity work.LOGIC_74XX139
port map(
I_G => W_5C_Q,
I_Sel(1) => I_H_CNT(2),
I_Sel(0) => I_H_CNT(1),
O_Q => W_4D2_Q
);
-- Parts 4C
u_4c1 : entity work.LOGIC_74XX139
port map(
I_G => W_4D2_Q(1),
I_Sel(1) => I_H_CNT(8),
I_Sel(0) => I_H_CNT(3),
O_Q => W_4C1_Q
);
u_4c2 : entity work.LOGIC_74XX139
port map(
I_G => W_4D1_Q(3),
I_Sel(1) => W_4C2_B,
I_Sel(0) => W_HCNT,
O_Q => W_4C2_Q
);
process(I_CLK_6M)
begin
if falling_edge(I_CLK_6M) then
W_5C_Q <= I_H_CNT(0);
end if;
end process;
-- 2004-9-22 added
process(I_CLK_6M)
begin
if rising_edge(I_CLK_6M) then
W_4C1_Q3 <= W_4C1_Q(3);
end if;
end process;
process(W_4C1_Q3)
begin
if rising_edge(W_4C1_Q3) then
W_4C2_B <= I_3D_DI;
end if;
end process;
end RTL;

View File

@@ -0,0 +1,92 @@
-------------------------------------------------------------------------------
-- FPGA MOONCRESTA LOGIC IP MODULE
--
-- Version : 1.00
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
-------------------------------------------------------------------------------
-- 74xx138
-- 3-to-8 line decoder
-------------------------------------------------------------------------------
entity LOGIC_74XX138 is
port (
I_G1 : in std_logic;
I_G2a : in std_logic;
I_G2b : in std_logic;
I_Sel : in std_logic_vector(2 downto 0);
O_Q : out std_logic_vector(7 downto 0)
);
end logic_74xx138;
architecture RTL of LOGIC_74XX138 is
signal I_G : std_logic_vector(2 downto 0) := (others => '0');
begin
I_G <= I_G1 & I_G2a & I_G2b;
xx138 : process(I_G, I_Sel)
begin
if(I_G = "100" ) then
case I_Sel is
when "000" => O_Q <= "11111110";
when "001" => O_Q <= "11111101";
when "010" => O_Q <= "11111011";
when "011" => O_Q <= "11110111";
when "100" => O_Q <= "11101111";
when "101" => O_Q <= "11011111";
when "110" => O_Q <= "10111111";
when "111" => O_Q <= "01111111";
when others => null;
end case;
else
O_Q <= (others => '1');
end if;
end process;
end RTL;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
-------------------------------------------------------------------------------
-- 74xx139
-- 2-to-4 line decoder
-------------------------------------------------------------------------------
entity LOGIC_74XX139 is
port (
I_G : in std_logic;
I_Sel : in std_logic_vector(1 downto 0);
O_Q : out std_logic_vector(3 downto 0)
);
end;
architecture RTL of LOGIC_74XX139 is
begin
xx139 : process (I_G, I_Sel)
begin
if I_G = '0' then
case I_Sel is
when "00" => O_Q <= "1110";
when "01" => O_Q <= "1101";
when "10" => O_Q <= "1011";
when "11" => O_Q <= "0111";
when others => null;
end case;
else
O_Q <= "1111";
end if;
end process;
end RTL;

View File

@@ -0,0 +1,107 @@
--------------------------------------------------------------------------------
---- FPGA MOONCRESTA VIDEO-MISSILE
----
---- Version : 2.00
----
---- Copyright(c) 2004 Katsumi Degawa , All rights reserved
----
---- Important !
----
---- This program is freeware for non-commercial use.
---- The author does not guarantee this program.
---- You can use this at your own risk.
----
---- 2004- 9-22 The problem which missile didn't sometimes come out from was improved.
--------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity MC_MISSILE is
port(
I_CLK_6M : in std_logic;
I_CLK_18M : in std_logic;
I_C_BLn_X : in std_logic;
I_MLDn : in std_logic;
I_SLDn : in std_logic;
I_HPOS : in std_logic_vector (7 downto 0);
O_MISSILEn : out std_logic;
O_SHELLn : out std_logic
);
end;
architecture RTL of MC_MISSILE is
signal W_45R_Q : std_logic_vector (7 downto 0) := (others => '0');
signal W_45S_Q : std_logic_vector (7 downto 0) := (others => '0');
signal W_5P1_Q : std_logic := '0';
signal W_5P2_Q : std_logic := '0';
signal W_5P1_CLK : std_logic := '0';
signal W_5P2_CLK : std_logic := '0';
begin
O_MISSILEn <= W_5P1_CLK;
O_SHELLn <= W_5P2_CLK;
-- missile counter
process(I_CLK_6M)
begin
if falling_edge(I_CLK_6M) then
if (I_MLDn = '0') then
W_45R_Q <= I_HPOS;
else
if (I_C_BLn_X = '1') then
W_45R_Q <= W_45R_Q + 1;
if (W_45R_Q(7 downto 2) = "111111") and W_5P1_Q = '1' then
W_5P1_CLK <= '0';
else
W_5P1_CLK <= '1';
end if;
end if;
end if;
end if;
end process;
-- shell counter
process(I_CLK_6M)
begin
if falling_edge(I_CLK_6M) then
if(I_SLDn = '0') then
W_45S_Q <= I_HPOS;
else
if(I_C_BLn_X = '1') then
W_45S_Q <= W_45S_Q + 1;
if (W_45S_Q(7 downto 2) = "111111") and W_5P2_Q = '1' then
W_5P2_CLK <= '0';
else
W_5P2_CLK <= '1';
end if;
end if;
end if;
end if;
end process;
-- Standard D-type flip-flop with D input tied low, async active
-- low preset (I_MLDn) and clock active on rising edge (W_5P1_CLK)
process(W_5P1_CLK, I_MLDn)
begin
if (I_MLDn = '0') then
W_5P1_Q <= '1';
elsif rising_edge(W_5P1_CLK) then
W_5P1_Q <= '0';
end if;
end process;
-- Standard D-type flip-flop with D input tied low, async active
-- low preset (I_SLDn) and clock active on rising edge (W_5P2_CLK)
process(W_5P2_CLK, I_SLDn)
begin
if (I_SLDn = '0') then
W_5P2_Q <= '1';
elsif rising_edge(W_5P2_CLK) then
W_5P2_Q <= '0';
end if;
end process;
end RTL;

View File

@@ -0,0 +1,117 @@
------------------------------------------------------------------------------
-- FPGA MOONCRESTA SOUND I/F
--
-- Version : 1.00
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
use IEEE.std_logic_arith.all;
entity MC_SOUND_A is
port (
I_CLK_12M : in std_logic;
I_CLK_6M : in std_logic;
I_H_CNT1 : in std_logic;
I_BD : in std_logic_vector(7 downto 0);
I_PITCH : in std_logic;
I_VOL1 : in std_logic;
I_VOL2 : in std_logic;
O_SDAT : out std_logic_vector(7 downto 0);
O_DO : out std_logic_vector(3 downto 0)
);
end;
architecture RTL of MC_SOUND_A is
signal W_PITCH : std_logic := '0';
signal W_89K_LDn : std_logic := '0';
signal W_89K_Q : std_logic_vector(7 downto 0) := (others => '0');
signal W_89K_LDATA : std_logic_vector(7 downto 0) := (others => '0');
signal W_6T_Q : std_logic_vector(3 downto 0) := (others => '0');
signal W_SDAT0 : std_logic_vector(7 downto 0) := (others => '0');
signal W_SDAT2 : std_logic_vector(7 downto 0) := (others => '0');
signal W_SDAT3 : std_logic_vector(7 downto 0) := (others => '0');
begin
O_DO <= W_6T_Q;
process (I_CLK_12M)
begin
if rising_edge(I_CLK_12M) then
W_PITCH <= I_PITCH;
if (W_89K_Q = x"ff") then
W_89K_LDn <= '0' ;
else
W_89K_LDn <= '1' ;
end if;
end if;
end process;
-- Parts 9J
process (W_PITCH)
begin
if falling_edge(W_PITCH) then
W_89K_LDATA <= I_BD;
end if;
end process;
process (I_H_CNT1)
begin
if rising_edge(I_H_CNT1) then
if (W_89K_LDn = '0') then
W_89K_Q <= W_89K_LDATA;
else
W_89K_Q <= W_89K_Q + 1;
end if;
end if;
end process;
process (W_89K_LDn)
begin
if falling_edge(W_89K_LDn) then
W_6T_Q <= W_6T_Q + 1;
end if;
end process;
process (I_CLK_6M)
begin
if rising_edge(I_CLK_6M) then
O_SDAT <= (x"14" + W_SDAT3) + (W_SDAT0 + W_SDAT2);
if W_6T_Q(0)='1' then
W_SDAT0 <= x"2a";
else
W_SDAT0 <= (others => '0');
end if;
if W_6T_Q(2)='1' then
if I_VOL1 = '1' then
W_SDAT2 <= x"69";
else
W_SDAT2 <= x"39";
end if;
else
W_SDAT2 <= (others => '0');
end if;
if (W_6T_Q(3)='1') and (I_VOL2 = '1') then
W_SDAT3 <= x"48" ;
else
W_SDAT3 <= (others => '0');
end if;
end if;
end process;
end;

View File

@@ -0,0 +1,253 @@
--------------------------------------------------------------------------------
---- FPGA MOONCRESTA WAVE SOUND
----
---- Version : 1.00
----
---- Copyright(c) 2004 Katsumi Degawa , All rights reserved
----
---- Important !
----
---- This program is freeware for non-commercial use.
---- The author does no guarantee this program.
---- You can use this at your own risk.
----
--------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
--pragma translate_off
-- use ieee.std_logic_textio.all;
-- use std.textio.all;
--pragma translate_on
entity MC_SOUND_B is
port(
I_CLK1 : in std_logic; -- 6MHz
I_RSTn : in std_logic;
I_SW : in std_logic_vector( 2 downto 0);
I_DAC : in std_logic_vector( 3 downto 0);
I_FS : in std_logic_vector( 2 downto 0);
O_SDAT : out std_logic_vector( 7 downto 0)
);
end;
architecture RTL of MC_SOUND_B is
constant sample_time : integer := 557; -- sample time : 557 = 11025Hz, 557/2 = 22050Hz
constant fire_cnt : std_logic_vector(15 downto 0) := x"2000";
constant hit_cnt : std_logic_vector(15 downto 0) := x"2000";
signal sample : std_logic_vector(10 downto 0) := (others => '0');
signal sample_pls : std_logic := '0';
signal s0_trg_ff : std_logic_vector( 1 downto 0) := (others => '0');
signal s0_trg : std_logic := '0';
signal s1_trg_ff : std_logic_vector( 1 downto 0) := (others => '0');
signal s1_trg : std_logic := '0';
signal fire_addr : std_logic_vector(15 downto 0) := (others => '0');
signal hit_addr : std_logic_vector(15 downto 0) := (others => '0');
signal WAV_D0 : std_logic_vector( 7 downto 0) := (others => '0');
signal WAV_D1 : std_logic_vector( 7 downto 0) := (others => '0');
signal W_VCO1_STEP: std_logic_vector( 7 downto 0) := (others => '0');
signal W_VCO2_STEP: std_logic_vector( 7 downto 0) := (others => '0');
signal W_VCO3_STEP: std_logic_vector( 7 downto 0) := (others => '0');
signal W_VCO1_OUT : std_logic_vector( 7 downto 0) := (others => '0');
signal W_VCO2_OUT : std_logic_vector( 7 downto 0) := (others => '0');
signal W_VCO3_OUT : std_logic_vector( 7 downto 0) := (others => '0');
signal VCO_CTR : std_logic_vector(24 downto 0) := (others => '0');
signal SDAT : std_logic_vector(10 downto 0) := (others => '0');
begin
-- ideally we should divide by 5 because this is the sum of 5 channels
-- but in practice we divide by 4 and just clip sounds that are too loud.
O_SDAT <= SDAT(9 downto 2) when SDAT(10) = '0' else (others=>'1'); -- clip overrange sounds
process(I_CLK1)
begin
if rising_edge(I_CLK1) then
SDAT <= ("000" & W_VCO3_OUT) + ( ( ("000" & W_VCO2_OUT) + ("000" & W_VCO1_OUT) ) + ( ("000" & WAV_D0) + ("000" & WAV_D1) ) );
end if;
end process;
process(I_CLK1, I_RSTn)
begin
if (I_RSTn = '0') then
sample <= (others => '0');
sample_pls <= '0';
elsif rising_edge(I_CLK1) then
if (sample = sample_time - 1) then
sample <= (others => '0');
sample_pls <= '1';
else
sample <= sample + 1;
sample_pls <= '0';
end if;
end if;
end process;
------------- FIRE SOUND ------------------------------------------
mc_roms_fire : entity work.GAL_FIR
port map (
CLK => I_CLK1,
ADDR => fire_addr(12 downto 0),
DATA => WAV_D0
);
process(I_CLK1, I_RSTn)
begin
if (I_RSTn = '0') then
s0_trg_ff <= (others => '0');
s0_trg <= '0';
elsif rising_edge(I_CLK1) then
s0_trg_ff(0) <= I_SW(0);
s0_trg_ff(1) <= s0_trg_ff(0);
s0_trg <= not s0_trg_ff(1) and s0_trg_ff(0);
end if;
end process;
process(I_CLK1, I_RSTn)
begin
if (I_RSTn = '0') then
fire_addr <= fire_cnt;
elsif rising_edge(I_CLK1) then
if (s0_trg = '1') then
fire_addr <= (others => '0');
else
if(sample_pls = '1') then
if(fire_addr <= fire_cnt) then
fire_addr <= fire_addr + 1;
else
fire_addr <= fire_addr ;
end if;
end if;
end if;
end if;
end process;
------------- HIT SOUND ------------------------------------------
mc_roms_hit : entity work.GAL_HIT
port map (
CLK => I_CLK1,
ADDR => hit_addr(12 downto 0),
DATA => WAV_D1
);
process(I_CLK1, I_RSTn)
begin
if (I_RSTn = '0') then
s1_trg_ff <= (others => '0');
s1_trg <= '0';
elsif rising_edge(I_CLK1) then
s1_trg_ff(0) <= I_SW(1);
s1_trg_ff(1) <= s1_trg_ff(0);
s1_trg <= not s1_trg_ff(1) and s1_trg_ff(0);
end if;
end process;
process(I_CLK1, I_RSTn)
begin
if (I_RSTn = '0') then
hit_addr <= hit_cnt;
elsif rising_edge(I_CLK1) then
if (s1_trg = '1') then
hit_addr <= (others => '0');
else
if (sample_pls = '1') then
if (hit_addr <= hit_cnt) then
hit_addr <= hit_addr + 1 ;
else
hit_addr <= hit_addr ;
end if;
end if;
end if;
end if;
end process;
--------------- EFFECT SOUND ---------------------------------------
-- 9R modulator voltage generator based on DAC value
process(I_CLK1, I_RSTn)
begin
if (I_RSTn = '0') then
VCO_CTR <= (others=>'0');
elsif rising_edge(I_CLK1) then
VCO_CTR <= VCO_CTR + (not I_DAC);
end if;
end process;
-- modulator frequency lookup tables for the three VCOs
process(I_CLK1, I_RSTn)
begin
if (I_RSTn = '0') then
elsif rising_edge(I_CLK1) then
case VCO_CTR(23 downto 19) is
when "00000" => W_VCO1_STEP <= x"2A"; W_VCO2_STEP <= x"3A"; W_VCO3_STEP <= x"54";
when "00001" => W_VCO1_STEP <= x"29"; W_VCO2_STEP <= x"39"; W_VCO3_STEP <= x"53";
when "00010" => W_VCO1_STEP <= x"29"; W_VCO2_STEP <= x"38"; W_VCO3_STEP <= x"52";
when "00011" => W_VCO1_STEP <= x"28"; W_VCO2_STEP <= x"37"; W_VCO3_STEP <= x"50";
when "00100" => W_VCO1_STEP <= x"28"; W_VCO2_STEP <= x"37"; W_VCO3_STEP <= x"4F";
when "00101" => W_VCO1_STEP <= x"27"; W_VCO2_STEP <= x"36"; W_VCO3_STEP <= x"4E";
when "00110" => W_VCO1_STEP <= x"27"; W_VCO2_STEP <= x"35"; W_VCO3_STEP <= x"4D";
when "00111" => W_VCO1_STEP <= x"26"; W_VCO2_STEP <= x"34"; W_VCO3_STEP <= x"4C";
when "01000" => W_VCO1_STEP <= x"25"; W_VCO2_STEP <= x"33"; W_VCO3_STEP <= x"4A";
when "01001" => W_VCO1_STEP <= x"25"; W_VCO2_STEP <= x"33"; W_VCO3_STEP <= x"49";
when "01010" => W_VCO1_STEP <= x"24"; W_VCO2_STEP <= x"32"; W_VCO3_STEP <= x"48";
when "01011" => W_VCO1_STEP <= x"24"; W_VCO2_STEP <= x"31"; W_VCO3_STEP <= x"47";
when "01100" => W_VCO1_STEP <= x"23"; W_VCO2_STEP <= x"30"; W_VCO3_STEP <= x"46";
when "01101" => W_VCO1_STEP <= x"23"; W_VCO2_STEP <= x"2F"; W_VCO3_STEP <= x"44";
when "01110" => W_VCO1_STEP <= x"22"; W_VCO2_STEP <= x"2F"; W_VCO3_STEP <= x"43";
when "01111" => W_VCO1_STEP <= x"21"; W_VCO2_STEP <= x"2E"; W_VCO3_STEP <= x"42";
when "10000" => W_VCO1_STEP <= x"21"; W_VCO2_STEP <= x"2D"; W_VCO3_STEP <= x"41";
when "10001" => W_VCO1_STEP <= x"20"; W_VCO2_STEP <= x"2C"; W_VCO3_STEP <= x"40";
when "10010" => W_VCO1_STEP <= x"20"; W_VCO2_STEP <= x"2B"; W_VCO3_STEP <= x"3F";
when "10011" => W_VCO1_STEP <= x"1F"; W_VCO2_STEP <= x"2B"; W_VCO3_STEP <= x"3D";
when "10100" => W_VCO1_STEP <= x"1F"; W_VCO2_STEP <= x"2A"; W_VCO3_STEP <= x"3C";
when "10101" => W_VCO1_STEP <= x"1E"; W_VCO2_STEP <= x"29"; W_VCO3_STEP <= x"3B";
when "10110" => W_VCO1_STEP <= x"1E"; W_VCO2_STEP <= x"28"; W_VCO3_STEP <= x"3A";
when "10111" => W_VCO1_STEP <= x"1D"; W_VCO2_STEP <= x"28"; W_VCO3_STEP <= x"39";
when "11000" => W_VCO1_STEP <= x"1C"; W_VCO2_STEP <= x"27"; W_VCO3_STEP <= x"37";
when "11001" => W_VCO1_STEP <= x"1C"; W_VCO2_STEP <= x"26"; W_VCO3_STEP <= x"36";
when "11010" => W_VCO1_STEP <= x"1B"; W_VCO2_STEP <= x"25"; W_VCO3_STEP <= x"35";
when "11011" => W_VCO1_STEP <= x"1B"; W_VCO2_STEP <= x"24"; W_VCO3_STEP <= x"34";
when "11100" => W_VCO1_STEP <= x"1A"; W_VCO2_STEP <= x"24"; W_VCO3_STEP <= x"33";
when "11101" => W_VCO1_STEP <= x"1A"; W_VCO2_STEP <= x"23"; W_VCO3_STEP <= x"32";
when "11110" => W_VCO1_STEP <= x"19"; W_VCO2_STEP <= x"22"; W_VCO3_STEP <= x"30";
when "11111" => W_VCO1_STEP <= x"18"; W_VCO2_STEP <= x"21"; W_VCO3_STEP <= x"2F";
when others => null;
end case;
end if;
end process;
-- 8R VCO 240Hz - 140Hz (8)
mc_vco1 : entity work.MC_SOUND_VCO
port map (
I_CLK => I_CLK1,
I_RSTn => I_RSTn,
I_FS => I_FS(0),
I_STEP => W_VCO1_STEP,
O_WAV => W_VCO1_OUT
);
-- 8S VCO 330Hz - 190Hz (11)
mc_vco2 : entity work.MC_SOUND_VCO
port map (
I_CLK => I_CLK1,
I_RSTn => I_RSTn,
I_FS => I_FS(1),
I_STEP => W_VCO2_STEP,
O_WAV => W_VCO2_OUT
);
-- 8T VCO 480Hz - 270Hz (16)
mc_vco3 : entity work.MC_SOUND_VCO
port map (
I_CLK => I_CLK1,
I_RSTn => I_RSTn,
I_FS => I_FS(2),
I_STEP => W_VCO3_STEP,
O_WAV => W_VCO3_OUT
);
end RTL;

View File

@@ -0,0 +1,49 @@
--------------------------------------------------------------------------------
---- FPGA VCO
--------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
use work.sine_package.all;
-- O_CLK = (I_CLK / 2^20) * I_STEP
entity MC_SOUND_VCO is
port(
I_CLK : in std_logic;
I_RSTn : in std_logic;
I_FS : in std_logic;
I_STEP : in std_logic_vector( 7 downto 0);
O_WAV : out std_logic_vector( 7 downto 0)
);
end;
architecture RTL of MC_SOUND_VCO is
signal VCO1_CTR : std_logic_vector(19 downto 0) := (others => '0');
signal sine : std_logic_vector(14 downto 0) := (others => '0');
begin
O_WAV <= sine(14 downto 7);
process(I_CLK, I_RSTn)
begin
if (I_RSTn = '0') then
VCO1_CTR <= (others=>'0');
elsif rising_edge(I_CLK) then
if I_FS = '1' then
VCO1_CTR <= VCO1_CTR + I_STEP;
case VCO1_CTR(19 downto 18) is
when "00" =>
sine <= "100000000000000" + std_logic_vector( to_signed(get_table_value( VCO1_CTR(17 downto 11)), 15));
when "01" =>
sine <= "100000000000000" + std_logic_vector( to_signed(get_table_value( not VCO1_CTR(17 downto 11)), 15));
when "10" =>
sine <= "100000000000000" + std_logic_vector(-to_signed(get_table_value( VCO1_CTR(17 downto 11)), 15));
when "11" =>
sine <= "100000000000000" + std_logic_vector(-to_signed(get_table_value( not VCO1_CTR(17 downto 11)), 15));
when others => null;
end case;
end if;
end if;
end process;
end RTL;

View File

@@ -0,0 +1,90 @@
------------------------------------------------------------------------------
-- FPGA MOONCRESTA STARS
--
-- Version : 2.00
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important !
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity MC_STARS is
port (
I_CLK_18M : in std_logic;
I_CLK_6M : in std_logic;
I_H_FLIP : in std_logic;
I_V_SYNC : in std_logic;
I_8HF : in std_logic;
I_256HnX : in std_logic;
I_1VF : in std_logic;
I_2V : in std_logic;
I_STARS_ON : in std_logic;
I_STARS_OFFn : in std_logic;
O_R : out std_logic_vector(1 downto 0);
O_G : out std_logic_vector(1 downto 0);
O_B : out std_logic_vector(1 downto 0);
O_NOISE : out std_logic
);
end;
architecture RTL of MC_STARS is
signal CLK_1C : std_logic := '0';
signal W_2D_Qn : std_logic := '0';
signal W_3B : std_logic := '0';
signal noise : std_logic := '0';
signal W_2A : std_logic := '0';
signal W_4P : std_logic := '0';
signal CLK_1AB : std_logic := '0';
signal W_1AB_Q : std_logic_vector(15 downto 0) := (others => '0');
signal W_1C_Q : std_logic_vector( 1 downto 0) := (others => '0');
begin
O_R <= (W_1AB_Q( 9) & W_1AB_Q (8) ) when (W_2A = '0' and W_4P = '0') else (others => '0');
O_G <= (W_1AB_Q(11) & W_1AB_Q(10) ) when (W_2A = '0' and W_4P = '0') else (others => '0');
O_B <= (W_1AB_Q(13) & W_1AB_Q(12) ) when (W_2A = '0' and W_4P = '0') else (others => '0');
CLK_1C <= not (I_CLK_18M and (not I_CLK_6M )and (not I_V_SYNC) and I_256HnX);
CLK_1AB <= not (CLK_1C or (not (I_H_FLIP or W_1C_Q(1))));
W_3B <= W_2D_Qn xor W_1AB_Q(4);
W_2A <= '0' when (W_1AB_Q(7 downto 0) = x"ff") else '1';
W_4P <= not (( I_8HF xor I_1VF ) and W_2D_Qn and I_STARS_OFFn);
O_NOISE <= noise ;
process(I_2V)
begin
if rising_edge(I_2V) then
noise <= W_2D_Qn;
end if;
end process;
process(CLK_1C, I_V_SYNC)
begin
if(I_V_SYNC = '1') then
W_1C_Q <= (others => '0');
elsif rising_edge(CLK_1C) then
W_1C_Q <= W_1C_Q(0) & '1';
end if;
end process;
process(CLK_1AB, I_STARS_ON)
begin
if(I_STARS_ON = '0') then
W_1AB_Q <= (others => '0');
W_2D_Qn <= '1';
elsif rising_edge(CLK_1AB) then
W_1AB_Q <= W_1AB_Q(14 downto 0) & W_3B;
W_2D_Qn <= not W_1AB_Q(15);
end if;
end process;
end RTL;

View File

@@ -0,0 +1,440 @@
--------------------------------------------------------------------------------
---- FPGA GALAXIAN VIDEO
----
---- Version : 2.50
----
---- Copyright(c) 2004 Katsumi Degawa , All rights reserved
----
---- Important !
----
---- This program is freeware for non-commercial use.
---- The author does not guarantee this program.
---- You can use this at your own risk.
----
---- 2004- 4-30 galaxian modify by K.DEGAWA
---- 2004- 5- 6 first release.
---- 2004- 8-23 Improvement with T80-IP.
---- 2004- 9-22 The problem where missile sometimes didn't come out was fixed.
--------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
-- H_CNT(0), H_CNT(1), H_CNT(2), H_CNT(3), H_CNT(4), H_CNT(5), H_CNT(6), H_CNT(7), H_CNT(8),
-- 1 H 2 H 4 H 8 H 16 H 32H 64 H 128 H 256 H
-------------------------------------------------------------------------------------------
-- V_CNT(0), V_CNT(1), V_CNT(2), V_CNT(3), V_CNT(4), V_CNT(5), V_CNT(6), V_CNT(7)
-- 1 V 2 V 4 V 8 V 16 V 32 V 64 V 128 V
-------------------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity MC_VIDEO is
port(
I_CLK_18M : in std_logic;
I_CLK_12M : in std_logic;
I_CLK_6M : in std_logic;
I_H_CNT : in std_logic_vector(8 downto 0);
I_V_CNT : in std_logic_vector(7 downto 0);
I_H_FLIP : in std_logic;
I_V_FLIP : in std_logic;
I_V_BLn : in std_logic;
I_C_BLn : in std_logic;
I_A : in std_logic_vector(9 downto 0);
I_BD : in std_logic_vector(7 downto 0);
I_OBJ_SUB_A : in std_logic_vector(2 downto 0);
I_OBJ_RAM_RQ : in std_logic;
I_OBJ_RAM_RD : in std_logic;
I_OBJ_RAM_WR : in std_logic;
I_VID_RAM_RD : in std_logic;
I_VID_RAM_WR : in std_logic;
I_DRIVER_WR : in std_logic;
I_BANK : in std_logic;
O_C_BLnX : out std_logic;
O_8HF : out std_logic;
O_256HnX : out std_logic;
O_1VF : out std_logic;
O_MISSILEn : out std_logic;
O_SHELLn : out std_logic;
O_BD : out std_logic_vector(7 downto 0);
O_VID : out std_logic_vector(1 downto 0);
O_COL : out std_logic_vector(2 downto 0)
);
end;
architecture RTL of MC_VIDEO is
signal WB_LDn : std_logic := '0';
signal WB_CNTRLDn : std_logic := '0';
signal WB_CNTRCLRn : std_logic := '0';
signal WB_COLLn : std_logic := '0';
signal WB_VPLn : std_logic := '0';
signal WB_OBJDATALn : std_logic := '0';
signal WB_MLDn : std_logic := '0';
signal WB_SLDn : std_logic := '0';
signal W_3D : std_logic := '0';
signal W_LDn : std_logic := '0';
signal W_CNTRLDn : std_logic := '0';
signal W_CNTRCLRn : std_logic := '0';
signal W_COLLn : std_logic := '0';
signal W_VPLn : std_logic := '0';
signal W_OBJDATALn : std_logic := '0';
signal W_MLDn : std_logic := '0';
signal W_SLDn : std_logic := '0';
signal W_VID : std_logic_vector( 1 downto 0) := (others => '0');
signal W_COL : std_logic_vector( 2 downto 0) := (others => '0');
signal W_H_POSI : std_logic_vector( 7 downto 0) := (others => '0');
signal W_OBJ_D : std_logic_vector( 7 downto 0) := (others => '0');
signal W_2M_Q : std_logic_vector( 7 downto 0) := (others => '0');
signal W_6K_Q : std_logic_vector( 2 downto 0) := (others => '0');
signal W_6P_Q : std_logic_vector( 6 downto 0) := (others => '0');
signal W_45T_Q : std_logic_vector( 7 downto 0) := (others => '0');
signal reg_2KL : std_logic_vector( 7 downto 0) := (others => '0');
signal reg_2HJ : std_logic_vector( 7 downto 0) := (others => '0');
signal W_RV : std_logic_vector( 1 downto 0) := (others => '0');
signal W_RC : std_logic_vector( 2 downto 0) := (others => '0');
signal W_O_OBJ_ROM_A : std_logic_vector(10 downto 0) := (others => '0');
signal W_VID_RAM_A : std_logic_vector(11 downto 0) := (others => '0');
signal W_VID_RAM_AA : std_logic_vector(11 downto 0) := (others => '0');
signal W_VID_RAM_AB : std_logic_vector(11 downto 0) := (others => '0');
signal C_2HJ : std_logic_vector( 1 downto 0) := (others => '0');
signal C_2KL : std_logic_vector( 1 downto 0) := (others => '0');
signal W_CD : std_logic_vector( 2 downto 0) := (others => '0');
signal W_1M : std_logic_vector( 3 downto 0) := (others => '0');
signal W_3L_A : std_logic_vector( 3 downto 0) := (others => '0');
signal W_3L_B : std_logic_vector( 3 downto 0) := (others => '0');
signal W_3L_Y : std_logic_vector( 3 downto 0) := (others => '0');
signal W_LRAM_DI : std_logic_vector( 4 downto 0) := (others => '0');
signal W_LRAM_DO : std_logic_vector( 4 downto 0) := (others => '0');
signal W_1H_D : std_logic_vector( 7 downto 0) := (others => '0');
signal W_1K_D : std_logic_vector( 7 downto 0) := (others => '0');
signal W_LRAM_A : std_logic_vector( 7 downto 0) := (others => '0');
-- signal W_OBJ_RAM_A : std_logic_vector( 7 downto 0) := (others => '0');
signal W_OBJ_RAM_AB : std_logic_vector( 7 downto 0) := (others => '0');
signal W_OBJ_RAM_D : std_logic_vector( 7 downto 0) := (others => '0');
signal W_OBJ_RAM_DOA : std_logic_vector( 7 downto 0) := (others => '0');
signal W_OBJ_RAM_DOB : std_logic_vector( 7 downto 0) := (others => '0');
signal W_OBJ_ROM_A : std_logic_vector( 7 downto 0) := (others => '0');
signal W_OBJ_ROM_AB : std_logic_vector( 7 downto 0) := (others => '0');
signal W_VF_CNT : std_logic_vector( 7 downto 0) := (others => '0');
signal W_VID_RAM_D : std_logic_vector( 7 downto 0) := (others => '0');
signal W_VID_RAM_DI : std_logic_vector( 7 downto 0) := (others => '0');
signal W_VID_RAM_DOA : std_logic_vector( 7 downto 0) := (others => '0');
signal W_VID_RAM_DOB : std_logic_vector( 7 downto 0) := (others => '0');
signal W_HF_CNT : std_logic_vector( 7 downto 0) := (others => '0');
signal W_45N_Q : std_logic_vector( 7 downto 0) := (others => '0');
signal W_6J_Q : std_logic_vector( 3 downto 0) := (others => '0');
signal W_6J_DA : std_logic_vector( 3 downto 0) := (others => '0');
signal W_6J_DB : std_logic_vector( 3 downto 0) := (others => '0');
signal W_256HnX : std_logic := '0';
signal W_2N : std_logic := '0';
signal W_45T_CLR : std_logic := '0';
signal W_C_BLnX : std_logic := '0';
signal W_H_FLIP1 : std_logic := '0';
signal W_H_FLIP2 : std_logic := '0';
signal W_H_FLIP1X : std_logic := '0';
signal W_H_FLIP2X : std_logic := '0';
signal W_LRAM_AND : std_logic := '0';
signal W_RAW0 : std_logic := '0';
signal W_RAW1 : std_logic := '0';
signal W_RAW_OR : std_logic := '0';
signal W_SRCLK : std_logic := '0';
signal W_SRLD : std_logic := '0';
signal W_VID_RAM_CS : std_logic := '0';
signal W_CLK_6Mn : std_logic := '0';
begin
ld_pls : entity work.MC_LD_PLS
port map(
I_CLK_6M => I_CLK_6M,
I_H_CNT => I_H_CNT,
I_3D_DI => W_3D,
O_LDn => WB_LDn,
O_CNTRLDn => WB_CNTRLDn,
O_CNTRCLRn => WB_CNTRCLRn,
O_COLLn => WB_COLLn,
O_VPLn => WB_VPLn,
O_OBJDATALn => WB_OBJDATALn,
O_MLDn => WB_MLDn,
O_SLDn => WB_SLDn
);
obj_ram : entity work.MC_OBJ_RAM
port map(
I_CLKA => I_CLK_12M,
I_ADDRA => I_A(7 downto 0),
I_WEA => I_OBJ_RAM_WR,
I_CEA => I_OBJ_RAM_RQ,
I_DA => I_BD,
O_DA => W_OBJ_RAM_DOA,
I_CLKB => I_CLK_12M,
I_ADDRB => W_OBJ_RAM_AB,
I_WEB => '0',
I_CEB => '1',
I_DB => x"00",
O_DB => W_OBJ_RAM_DOB
);
lram : entity work.MC_LRAM
port map(
I_CLK => I_CLK_18M,
I_ADDR => W_LRAM_A,
I_WE => W_CLK_6Mn,
I_D => W_LRAM_DI,
O_Dn => W_LRAM_DO
);
missile : entity work.MC_MISSILE
port map(
I_CLK_18M => I_CLK_18M,
I_CLK_6M => I_CLK_6M,
I_C_BLn_X => W_C_BLnX,
I_MLDn => W_MLDn,
I_SLDn => W_SLDn,
I_HPOS => W_H_POSI,
O_MISSILEn => O_MISSILEn,
O_SHELLn => O_SHELLn
);
vid_ram : entity work.MC_VID_RAM
port map (
I_CLKA => I_CLK_12M,
I_ADDRA => I_A(9 downto 0),
I_DA => W_VID_RAM_DI,
I_WEA => I_VID_RAM_WR,
I_CEA => W_VID_RAM_CS,
O_DA => W_VID_RAM_DOA,
I_CLKB => I_CLK_12M,
I_ADDRB => W_VID_RAM_A(9 downto 0),
I_DB => x"00",
I_WEB => '0',
I_CEB => '1',
O_DB => W_VID_RAM_DOB
);
k_rom : entity work.sprom
generic map (
init_file => "./ROM/h.hex",
widthad_a => 11,
width_a => 8)
port map (
address => W_O_OBJ_ROM_A,
clock => I_CLK_12M,
q => W_1K_D
);
h_rom : entity work.sprom
generic map (
init_file => "./ROM/k.hex",
widthad_a => 11,
width_a => 8)
port map (
address => W_O_OBJ_ROM_A,
clock => I_CLK_12M,
q => W_1H_D
);
-----------------------------------------------------------------------------------
process(I_CLK_12M)
begin
if falling_edge(I_CLK_12M) then
W_LDn <= WB_LDn;
W_CNTRLDn <= WB_CNTRLDn;
W_CNTRCLRn <= WB_CNTRCLRn;
W_COLLn <= WB_COLLn;
W_VPLn <= WB_VPLn;
W_OBJDATALn <= WB_OBJDATALn;
W_MLDn <= WB_MLDn;
W_SLDn <= WB_SLDn;
end if;
end process;
W_CLK_6Mn <= not I_CLK_6M;
W_6J_DA <= I_H_FLIP & W_HF_CNT(7) & W_HF_CNT(3) & I_H_CNT(2);
W_6J_DB <= W_OBJ_D(6) & ( W_HF_CNT(3) and I_H_CNT(1) ) & I_H_CNT(2) & I_H_CNT(1);
W_6J_Q <= W_6J_DB when I_H_CNT(8) = '1' else W_6J_DA;
W_H_FLIP1 <= (not I_H_CNT(8)) and I_H_FLIP;
W_HF_CNT(7 downto 3) <= not I_H_CNT(7 downto 3) when W_H_FLIP1 = '1' else I_H_CNT(7 downto 3);
W_VF_CNT <= not I_V_CNT when I_V_FLIP = '1' else I_V_CNT;
O_8HF <= W_HF_CNT(3);
O_1VF <= W_VF_CNT(0);
W_H_FLIP2 <= W_6J_Q(3);
-- Parts 4F,5F
W_OBJ_RAM_AB <= "0" & I_H_CNT(8) & W_6J_Q(2) & W_HF_CNT(6 downto 4) & W_6J_Q(1 downto 0);
-- W_OBJ_RAM_A <= W_OBJ_RAM_AB when I_OBJ_RAM_RQ = '0' else I_A(7 downto 0) ;
process(I_CLK_12M)
begin
if rising_edge(I_CLK_12M) then
W_H_POSI <= W_OBJ_RAM_DOB;
end if;
end process;
W_OBJ_RAM_D <= W_OBJ_RAM_DOA when I_OBJ_RAM_RD = '1' else (others => '0');
-- Parts 4L
process(W_OBJDATALn)
begin
if rising_edge(W_OBJDATALn) then
W_OBJ_D <= W_H_POSI;
end if;
end process;
-- Parts 4,5N
W_45N_Q <= W_VF_CNT + W_H_POSI;
W_3D <= '0' when W_45N_Q = x"FF" else '1';
process(W_VPLn, I_V_BLn)
begin
if (I_V_BLn = '0') then
W_2M_Q <= (others => '0');
elsif rising_edge(W_VPLn) then
W_2M_Q <= W_45N_Q;
end if;
end process;
W_2N <= I_H_CNT(8) and W_OBJ_D(7);
W_1M <= W_2M_Q(3 downto 0) xor (W_2N & W_2N & W_2N & W_2N);
W_VID_RAM_CS <= I_VID_RAM_RD or I_VID_RAM_WR;
W_VID_RAM_DI <= I_BD when I_VID_RAM_WR = '1' else (others => '0');
W_VID_RAM_AA <= (not ( W_2M_Q(7) and W_2M_Q(6) and W_2M_Q(5) and W_2M_Q(4))) & (not W_VID_RAM_CS) & "0000000000"; -- I_A(9:0)
W_VID_RAM_AB <= "00" & W_2M_Q(7 downto 4) & W_1M(3) & W_HF_CNT(7 downto 3);
W_VID_RAM_A <= W_VID_RAM_AB when I_C_BLn = '1' else W_VID_RAM_AA;
W_VID_RAM_D <= W_VID_RAM_DOA when I_VID_RAM_RD = '1' else (others => '0');
---- VIDEO DATA OUTPUT --------------
O_BD <= W_OBJ_RAM_D or W_VID_RAM_D;
W_SRLD <= not (W_LDn or W_VID_RAM_A(11));
W_OBJ_ROM_AB <= W_OBJ_D(5 downto 0) & W_1M(3) & (W_OBJ_D(6) xor I_H_CNT(3));
W_OBJ_ROM_A <= W_OBJ_ROM_AB when I_H_CNT(8) = '1' else W_VID_RAM_DOB;
W_O_OBJ_ROM_A <= W_OBJ_ROM_A & W_1M(2 downto 0);
-----------------------------------------------------------------------------------
W_3L_A <= reg_2HJ(7) & reg_2KL(7) & "1" & W_SRLD;
W_3L_B <= reg_2HJ(0) & reg_2KL(0) & W_SRLD & "1";
W_3L_Y <= W_3L_B when W_H_FLIP2X = '1' else W_3L_A; -- (3)=RAW1,(2)=RAW0
C_2HJ <= W_3L_Y(1 downto 0);
C_2KL <= W_3L_Y(1 downto 0);
W_RAW0 <= W_3L_Y(2);
W_RAW1 <= W_3L_Y(3);
W_SRCLK <= I_CLK_6M;
-------- PARTS 2KL ----------------------------------------------
process(W_SRCLK)
begin
if rising_edge(W_SRCLK) then
case(C_2KL) is
when "00" => reg_2KL <= reg_2KL;
when "10" => reg_2KL <= reg_2KL(6 downto 0) & "0";
when "01" => reg_2KL <= "0" & reg_2KL(7 downto 1);
when "11" => reg_2KL <= W_1K_D;
when others => null;
end case;
end if;
end process;
-------- PARTS 2HJ ----------------------------------------------
process(W_SRCLK)
begin
if rising_edge(W_SRCLK) then
case(C_2HJ) is
when "00" => reg_2HJ <= reg_2HJ;
when "10" => reg_2HJ <= reg_2HJ(6 downto 0) & "0";
when "01" => reg_2HJ <= "0" & reg_2HJ(7 downto 1);
when "11" => reg_2HJ <= W_1H_D;
when others => null;
end case;
end if;
end process;
------- SHT2 -----------------------------------------------------
-- Parts 6K
process(W_COLLn)
begin
if rising_edge(W_COLLn) then
W_6K_Q <= W_H_POSI(2 downto 0);
end if;
end process;
-- Parts 6P
process(I_CLK_6M)
begin
if rising_edge(I_CLK_6M) then
if (W_LDn = '0') then
W_6P_Q <= W_H_FLIP2 & W_H_FLIP1 & I_C_BLn & (not I_H_CNT(8)) & W_6K_Q(2 downto 0);
else
W_6P_Q <= W_6P_Q;
end if;
end if;
end process;
W_H_FLIP2X <= W_6P_Q(6);
W_H_FLIP1X <= W_6P_Q(5);
W_C_BLnX <= W_6P_Q(4);
W_256HnX <= W_6P_Q(3);
W_CD <= W_6P_Q(2 downto 0);
O_256HnX <= W_256HnX;
O_C_BLnX <= W_C_BLnX;
W_45T_CLR <= W_CNTRCLRn or W_256HnX ;
process(I_CLK_6M, W_45T_CLR)
begin
if (W_45T_CLR = '0') then
W_45T_Q <= (others => '0');
elsif rising_edge(I_CLK_6M) then
if (W_CNTRLDn = '0') then
W_45T_Q <= W_H_POSI;
else
W_45T_Q <= W_45T_Q + 1;
end if;
end if;
end process;
W_LRAM_A <= (not W_45T_Q) when W_H_FLIP1X = '1' else W_45T_Q;
process(I_CLK_6M)
begin
if falling_edge(I_CLK_6M) then
W_RV <= W_LRAM_DO(1 downto 0);
W_RC <= W_LRAM_DO(4 downto 2);
end if;
end process;
W_LRAM_AND <= not (not ((W_LRAM_A(4) or W_LRAM_A(5)) or (W_LRAM_A(6) or W_LRAM_A(7))) or W_256HnX );
W_RAW_OR <= W_RAW0 or W_RAW1 ;
W_VID(0) <= not (not (W_RAW0 and W_RV(1)) and W_RV(0));
W_VID(1) <= not (not (W_RAW1 and W_RV(0)) and W_RV(1));
W_COL(0) <= not (not (W_RAW_OR and W_CD(0) and W_RC(1) and W_RC(2)) and W_RC(0));
W_COL(1) <= not (not (W_RAW_OR and W_CD(1) and W_RC(2) and W_RC(0)) and W_RC(1));
W_COL(2) <= not (not (W_RAW_OR and W_CD(2) and W_RC(0) and W_RC(1)) and W_RC(2));
O_VID <= W_VID;
O_COL <= W_COL;
W_LRAM_DI(0) <= W_LRAM_AND and W_VID(0);
W_LRAM_DI(1) <= W_LRAM_AND and W_VID(1);
W_LRAM_DI(2) <= W_LRAM_AND and W_COL(0);
W_LRAM_DI(3) <= W_LRAM_AND and W_COL(1);
W_LRAM_DI(4) <= W_LRAM_AND and W_COL(2);
end RTL;

View File

@@ -0,0 +1,451 @@
-- megafunction wizard: %ALTPLL%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altpll
-- ============================================================
-- File Name: pll.vhd
-- Megafunction Name(s):
-- altpll
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 13.1.0 Build 162 10/23/2013 SJ Web Edition
-- ************************************************************
--Copyright (C) 1991-2013 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.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.all;
ENTITY pll IS
PORT
(
areset : IN STD_LOGIC := '0';
inclk0 : IN STD_LOGIC := '0';
c0 : OUT STD_LOGIC ;
c1 : OUT STD_LOGIC ;
c2 : OUT STD_LOGIC ;
c3 : OUT STD_LOGIC
);
END pll;
ARCHITECTURE SYN OF pll IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (4 DOWNTO 0);
SIGNAL sub_wire1 : STD_LOGIC ;
SIGNAL sub_wire2 : STD_LOGIC ;
SIGNAL sub_wire3 : STD_LOGIC ;
SIGNAL sub_wire4 : STD_LOGIC ;
SIGNAL sub_wire5 : STD_LOGIC ;
SIGNAL sub_wire6 : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL sub_wire7_bv : BIT_VECTOR (0 DOWNTO 0);
SIGNAL sub_wire7 : STD_LOGIC_VECTOR (0 DOWNTO 0);
COMPONENT altpll
GENERIC (
bandwidth_type : STRING;
clk0_divide_by : NATURAL;
clk0_duty_cycle : NATURAL;
clk0_multiply_by : NATURAL;
clk0_phase_shift : STRING;
clk1_divide_by : NATURAL;
clk1_duty_cycle : NATURAL;
clk1_multiply_by : NATURAL;
clk1_phase_shift : STRING;
clk2_divide_by : NATURAL;
clk2_duty_cycle : NATURAL;
clk2_multiply_by : NATURAL;
clk2_phase_shift : STRING;
clk3_divide_by : NATURAL;
clk3_duty_cycle : NATURAL;
clk3_multiply_by : NATURAL;
clk3_phase_shift : STRING;
compensate_clock : STRING;
inclk0_input_frequency : NATURAL;
intended_device_family : STRING;
lpm_hint : STRING;
lpm_type : STRING;
operation_mode : STRING;
pll_type : STRING;
port_activeclock : STRING;
port_areset : STRING;
port_clkbad0 : STRING;
port_clkbad1 : STRING;
port_clkloss : STRING;
port_clkswitch : STRING;
port_configupdate : STRING;
port_fbin : STRING;
port_inclk0 : STRING;
port_inclk1 : STRING;
port_locked : STRING;
port_pfdena : STRING;
port_phasecounterselect : STRING;
port_phasedone : STRING;
port_phasestep : STRING;
port_phaseupdown : STRING;
port_pllena : STRING;
port_scanaclr : STRING;
port_scanclk : STRING;
port_scanclkena : STRING;
port_scandata : STRING;
port_scandataout : STRING;
port_scandone : STRING;
port_scanread : STRING;
port_scanwrite : STRING;
port_clk0 : STRING;
port_clk1 : STRING;
port_clk2 : STRING;
port_clk3 : STRING;
port_clk4 : STRING;
port_clk5 : STRING;
port_clkena0 : STRING;
port_clkena1 : STRING;
port_clkena2 : STRING;
port_clkena3 : STRING;
port_clkena4 : STRING;
port_clkena5 : STRING;
port_extclk0 : STRING;
port_extclk1 : STRING;
port_extclk2 : STRING;
port_extclk3 : STRING;
width_clock : NATURAL
);
PORT (
areset : IN STD_LOGIC ;
clk : OUT STD_LOGIC_VECTOR (4 DOWNTO 0);
inclk : IN STD_LOGIC_VECTOR (1 DOWNTO 0)
);
END COMPONENT;
BEGIN
sub_wire7_bv(0 DOWNTO 0) <= "0";
sub_wire7 <= To_stdlogicvector(sub_wire7_bv);
sub_wire4 <= sub_wire0(2);
sub_wire3 <= sub_wire0(0);
sub_wire2 <= sub_wire0(3);
sub_wire1 <= sub_wire0(1);
c1 <= sub_wire1;
c3 <= sub_wire2;
c0 <= sub_wire3;
c2 <= sub_wire4;
sub_wire5 <= inclk0;
sub_wire6 <= sub_wire7(0 DOWNTO 0) & sub_wire5;
altpll_component : altpll
GENERIC MAP (
bandwidth_type => "AUTO",
clk0_divide_by => 9,
clk0_duty_cycle => 50,
clk0_multiply_by => 8,
clk0_phase_shift => "0",
clk1_divide_by => 3,
clk1_duty_cycle => 50,
clk1_multiply_by => 2,
clk1_phase_shift => "0",
clk2_divide_by => 9,
clk2_duty_cycle => 50,
clk2_multiply_by => 4,
clk2_phase_shift => "0",
clk3_divide_by => 9,
clk3_duty_cycle => 50,
clk3_multiply_by => 2,
clk3_phase_shift => "0",
compensate_clock => "CLK0",
inclk0_input_frequency => 37037,
intended_device_family => "Cyclone III",
lpm_hint => "CBX_MODULE_PREFIX=pll",
lpm_type => "altpll",
operation_mode => "NORMAL",
pll_type => "AUTO",
port_activeclock => "PORT_UNUSED",
port_areset => "PORT_USED",
port_clkbad0 => "PORT_UNUSED",
port_clkbad1 => "PORT_UNUSED",
port_clkloss => "PORT_UNUSED",
port_clkswitch => "PORT_UNUSED",
port_configupdate => "PORT_UNUSED",
port_fbin => "PORT_UNUSED",
port_inclk0 => "PORT_USED",
port_inclk1 => "PORT_UNUSED",
port_locked => "PORT_UNUSED",
port_pfdena => "PORT_UNUSED",
port_phasecounterselect => "PORT_UNUSED",
port_phasedone => "PORT_UNUSED",
port_phasestep => "PORT_UNUSED",
port_phaseupdown => "PORT_UNUSED",
port_pllena => "PORT_UNUSED",
port_scanaclr => "PORT_UNUSED",
port_scanclk => "PORT_UNUSED",
port_scanclkena => "PORT_UNUSED",
port_scandata => "PORT_UNUSED",
port_scandataout => "PORT_UNUSED",
port_scandone => "PORT_UNUSED",
port_scanread => "PORT_UNUSED",
port_scanwrite => "PORT_UNUSED",
port_clk0 => "PORT_USED",
port_clk1 => "PORT_USED",
port_clk2 => "PORT_USED",
port_clk3 => "PORT_USED",
port_clk4 => "PORT_UNUSED",
port_clk5 => "PORT_UNUSED",
port_clkena0 => "PORT_UNUSED",
port_clkena1 => "PORT_UNUSED",
port_clkena2 => "PORT_UNUSED",
port_clkena3 => "PORT_UNUSED",
port_clkena4 => "PORT_UNUSED",
port_clkena5 => "PORT_UNUSED",
port_extclk0 => "PORT_UNUSED",
port_extclk1 => "PORT_UNUSED",
port_extclk2 => "PORT_UNUSED",
port_extclk3 => "PORT_UNUSED",
width_clock => 5
)
PORT MAP (
areset => areset,
inclk => sub_wire6,
clk => sub_wire0
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ACTIVECLK_CHECK STRING "0"
-- Retrieval info: PRIVATE: BANDWIDTH STRING "1.000"
-- Retrieval info: PRIVATE: BANDWIDTH_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: BANDWIDTH_FREQ_UNIT STRING "MHz"
-- Retrieval info: PRIVATE: BANDWIDTH_PRESET STRING "Low"
-- Retrieval info: PRIVATE: BANDWIDTH_USE_AUTO STRING "1"
-- Retrieval info: PRIVATE: BANDWIDTH_USE_PRESET STRING "0"
-- Retrieval info: PRIVATE: CLKBAD_SWITCHOVER_CHECK STRING "0"
-- Retrieval info: PRIVATE: CLKLOSS_CHECK STRING "0"
-- Retrieval info: PRIVATE: CLKSWITCH_CHECK STRING "0"
-- Retrieval info: PRIVATE: CNX_NO_COMPENSATE_RADIO STRING "0"
-- Retrieval info: PRIVATE: CREATE_CLKBAD_CHECK STRING "0"
-- Retrieval info: PRIVATE: CREATE_INCLK1_CHECK STRING "0"
-- Retrieval info: PRIVATE: CUR_DEDICATED_CLK STRING "c0"
-- Retrieval info: PRIVATE: CUR_FBIN_CLK STRING "c0"
-- Retrieval info: PRIVATE: DEVICE_SPEED_GRADE STRING "8"
-- Retrieval info: PRIVATE: DIV_FACTOR0 NUMERIC "9"
-- Retrieval info: PRIVATE: DIV_FACTOR1 NUMERIC "3"
-- Retrieval info: PRIVATE: DIV_FACTOR2 NUMERIC "9"
-- Retrieval info: PRIVATE: DIV_FACTOR3 NUMERIC "9"
-- Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
-- Retrieval info: PRIVATE: DUTY_CYCLE1 STRING "50.00000000"
-- Retrieval info: PRIVATE: DUTY_CYCLE2 STRING "50.00000000"
-- Retrieval info: PRIVATE: DUTY_CYCLE3 STRING "50.00000000"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE0 STRING "24.000000"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE1 STRING "18.000000"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE2 STRING "12.000000"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE3 STRING "6.000000"
-- Retrieval info: PRIVATE: EXPLICIT_SWITCHOVER_COUNTER STRING "0"
-- Retrieval info: PRIVATE: EXT_FEEDBACK_RADIO STRING "0"
-- Retrieval info: PRIVATE: GLOCKED_COUNTER_EDIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: GLOCKED_FEATURE_ENABLED STRING "0"
-- Retrieval info: PRIVATE: GLOCKED_MODE_CHECK STRING "0"
-- Retrieval info: PRIVATE: GLOCK_COUNTER_EDIT NUMERIC "1048575"
-- Retrieval info: PRIVATE: HAS_MANUAL_SWITCHOVER STRING "1"
-- Retrieval info: PRIVATE: INCLK0_FREQ_EDIT STRING "27.000"
-- Retrieval info: PRIVATE: INCLK0_FREQ_UNIT_COMBO STRING "MHz"
-- Retrieval info: PRIVATE: INCLK1_FREQ_EDIT STRING "100.000"
-- Retrieval info: PRIVATE: INCLK1_FREQ_EDIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_COMBO STRING "MHz"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
-- Retrieval info: PRIVATE: INT_FEEDBACK__MODE_RADIO STRING "1"
-- Retrieval info: PRIVATE: LOCKED_OUTPUT_CHECK STRING "0"
-- Retrieval info: PRIVATE: LONG_SCAN_RADIO STRING "1"
-- Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE STRING "Not Available"
-- Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE_DIRTY NUMERIC "0"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT0 STRING "deg"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT1 STRING "ps"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT2 STRING "ps"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT3 STRING "ps"
-- Retrieval info: PRIVATE: MIG_DEVICE_SPEED_GRADE STRING "Any"
-- Retrieval info: PRIVATE: MIRROR_CLK0 STRING "0"
-- Retrieval info: PRIVATE: MIRROR_CLK1 STRING "0"
-- Retrieval info: PRIVATE: MIRROR_CLK2 STRING "0"
-- Retrieval info: PRIVATE: MIRROR_CLK3 STRING "0"
-- Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "8"
-- Retrieval info: PRIVATE: MULT_FACTOR1 NUMERIC "2"
-- Retrieval info: PRIVATE: MULT_FACTOR2 NUMERIC "4"
-- Retrieval info: PRIVATE: MULT_FACTOR3 NUMERIC "2"
-- Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
-- Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "24.00000000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ1 STRING "18.00000000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ2 STRING "12.00000000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ3 STRING "6.00000000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "0"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE1 STRING "0"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE2 STRING "0"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE3 STRING "0"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT1 STRING "MHz"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT2 STRING "MHz"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT3 STRING "MHz"
-- Retrieval info: PRIVATE: PHASE_RECONFIG_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: PHASE_RECONFIG_INPUTS_CHECK STRING "0"
-- Retrieval info: PRIVATE: PHASE_SHIFT0 STRING "0.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT1 STRING "0.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT2 STRING "0.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT3 STRING "0.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT_STEP_ENABLED_CHECK STRING "0"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT0 STRING "deg"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT1 STRING "deg"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT2 STRING "deg"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT3 STRING "deg"
-- Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "1"
-- Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1"
-- Retrieval info: PRIVATE: PLL_ENHPLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_FASTPLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_FBMIMIC_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_LVDS_PLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_PFDENA_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_TARGET_HARCOPY_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PRIMARY_CLK_COMBO STRING "inclk0"
-- Retrieval info: PRIVATE: RECONFIG_FILE STRING "pll.mif"
-- Retrieval info: PRIVATE: SACN_INPUTS_CHECK STRING "0"
-- Retrieval info: PRIVATE: SCAN_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: SELF_RESET_LOCK_LOSS STRING "0"
-- Retrieval info: PRIVATE: SHORT_SCAN_RADIO STRING "0"
-- Retrieval info: PRIVATE: SPREAD_FEATURE_ENABLED STRING "0"
-- Retrieval info: PRIVATE: SPREAD_FREQ STRING "50.000"
-- Retrieval info: PRIVATE: SPREAD_FREQ_UNIT STRING "KHz"
-- Retrieval info: PRIVATE: SPREAD_PERCENT STRING "0.500"
-- Retrieval info: PRIVATE: SPREAD_USE STRING "0"
-- Retrieval info: PRIVATE: SRC_SYNCH_COMP_RADIO STRING "0"
-- Retrieval info: PRIVATE: STICKY_CLK0 STRING "1"
-- Retrieval info: PRIVATE: STICKY_CLK1 STRING "1"
-- Retrieval info: PRIVATE: STICKY_CLK2 STRING "1"
-- Retrieval info: PRIVATE: STICKY_CLK3 STRING "1"
-- Retrieval info: PRIVATE: SWITCHOVER_COUNT_EDIT NUMERIC "1"
-- Retrieval info: PRIVATE: SWITCHOVER_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: USE_CLK0 STRING "1"
-- Retrieval info: PRIVATE: USE_CLK1 STRING "1"
-- Retrieval info: PRIVATE: USE_CLK2 STRING "1"
-- Retrieval info: PRIVATE: USE_CLK3 STRING "1"
-- Retrieval info: PRIVATE: USE_CLKENA0 STRING "0"
-- Retrieval info: PRIVATE: USE_CLKENA1 STRING "0"
-- Retrieval info: PRIVATE: USE_CLKENA2 STRING "0"
-- Retrieval info: PRIVATE: USE_CLKENA3 STRING "0"
-- Retrieval info: PRIVATE: USE_MIL_SPEED_GRADE NUMERIC "0"
-- Retrieval info: PRIVATE: ZERO_DELAY_RADIO STRING "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: BANDWIDTH_TYPE STRING "AUTO"
-- Retrieval info: CONSTANT: CLK0_DIVIDE_BY NUMERIC "9"
-- Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "8"
-- Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
-- Retrieval info: CONSTANT: CLK1_DIVIDE_BY NUMERIC "3"
-- Retrieval info: CONSTANT: CLK1_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK1_MULTIPLY_BY NUMERIC "2"
-- Retrieval info: CONSTANT: CLK1_PHASE_SHIFT STRING "0"
-- Retrieval info: CONSTANT: CLK2_DIVIDE_BY NUMERIC "9"
-- Retrieval info: CONSTANT: CLK2_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK2_MULTIPLY_BY NUMERIC "4"
-- Retrieval info: CONSTANT: CLK2_PHASE_SHIFT STRING "0"
-- Retrieval info: CONSTANT: CLK3_DIVIDE_BY NUMERIC "9"
-- Retrieval info: CONSTANT: CLK3_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK3_MULTIPLY_BY NUMERIC "2"
-- Retrieval info: CONSTANT: CLK3_PHASE_SHIFT STRING "0"
-- Retrieval info: CONSTANT: COMPENSATE_CLOCK STRING "CLK0"
-- Retrieval info: CONSTANT: INCLK0_INPUT_FREQUENCY NUMERIC "37037"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altpll"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "NORMAL"
-- Retrieval info: CONSTANT: PLL_TYPE STRING "AUTO"
-- Retrieval info: CONSTANT: PORT_ACTIVECLOCK STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_ARESET STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_CLKBAD0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKBAD1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKLOSS STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKSWITCH STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CONFIGUPDATE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_FBIN STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_INCLK0 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_INCLK1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_LOCKED STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PFDENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASECOUNTERSELECT STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASEDONE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASESTEP STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASEUPDOWN STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PLLENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANACLR STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANCLK STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANCLKENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDATA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDATAOUT STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDONE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANREAD STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANWRITE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk0 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk2 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk4 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk5 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena4 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena5 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: WIDTH_CLOCK NUMERIC "5"
-- Retrieval info: USED_PORT: @clk 0 0 5 0 OUTPUT_CLK_EXT VCC "@clk[4..0]"
-- Retrieval info: USED_PORT: @inclk 0 0 2 0 INPUT_CLK_EXT VCC "@inclk[1..0]"
-- Retrieval info: USED_PORT: areset 0 0 0 0 INPUT GND "areset"
-- Retrieval info: USED_PORT: c0 0 0 0 0 OUTPUT_CLK_EXT VCC "c0"
-- Retrieval info: USED_PORT: c1 0 0 0 0 OUTPUT_CLK_EXT VCC "c1"
-- Retrieval info: USED_PORT: c2 0 0 0 0 OUTPUT_CLK_EXT VCC "c2"
-- Retrieval info: USED_PORT: c3 0 0 0 0 OUTPUT_CLK_EXT VCC "c3"
-- Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0"
-- Retrieval info: CONNECT: @areset 0 0 0 0 areset 0 0 0 0
-- Retrieval info: CONNECT: @inclk 0 0 1 1 GND 0 0 0 0
-- Retrieval info: CONNECT: @inclk 0 0 1 0 inclk0 0 0 0 0
-- Retrieval info: CONNECT: c0 0 0 0 0 @clk 0 0 1 0
-- Retrieval info: CONNECT: c1 0 0 0 0 @clk 0 0 1 1
-- Retrieval info: CONNECT: c2 0 0 0 0 @clk 0 0 1 2
-- Retrieval info: CONNECT: c3 0 0 0 0 @clk 0 0 1 3
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.ppf TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf
-- Retrieval info: CBX_MODULE_PREFIX: ON

View File

@@ -46,6 +46,17 @@ module scandoubler #(parameter LENGTH, parameter HALF_DEPTH)
output [DWIDTH:0] b_out
);
`define BITS_TO_FIT(N) ( \
N <= 2 ? 0 : \
N <= 4 ? 1 : \
N <= 8 ? 2 : \
N <= 16 ? 3 : \
N <= 32 ? 4 : \
N <= 64 ? 5 : \
N <= 128 ? 6 : \
N <= 256 ? 7 : \
N <= 512 ? 8 : \
N <=1024 ? 9 : 10 )
localparam DWIDTH = HALF_DEPTH ? 2 : 5;

View File

@@ -0,0 +1,152 @@
library ieee;
use ieee.std_logic_1164.all;
package sine_package is
subtype table_value_type is integer range 0 to 16383;
subtype table_index_type is std_logic_vector( 6 downto 0 );
function get_table_value (table_index: table_index_type) return table_value_type;
end;
package body sine_package is
function get_table_value (table_index: table_index_type) return table_value_type is
variable table_value: table_value_type;
begin
case table_index is
when "0000000" => table_value := 101;
when "0000001" => table_value := 302;
when "0000010" => table_value := 503;
when "0000011" => table_value := 703;
when "0000100" => table_value := 904;
when "0000101" => table_value := 1105;
when "0000110" => table_value := 1305;
when "0000111" => table_value := 1506;
when "0001000" => table_value := 1706;
when "0001001" => table_value := 1906;
when "0001010" => table_value := 2105;
when "0001011" => table_value := 2304;
when "0001100" => table_value := 2503;
when "0001101" => table_value := 2702;
when "0001110" => table_value := 2900;
when "0001111" => table_value := 3098;
when "0010000" => table_value := 3295;
when "0010001" => table_value := 3491;
when "0010010" => table_value := 3688;
when "0010011" => table_value := 3883;
when "0010100" => table_value := 4078;
when "0010101" => table_value := 4273;
when "0010110" => table_value := 4466;
when "0010111" => table_value := 4659;
when "0011000" => table_value := 4852;
when "0011001" => table_value := 5044;
when "0011010" => table_value := 5234;
when "0011011" => table_value := 5425;
when "0011100" => table_value := 5614;
when "0011101" => table_value := 5802;
when "0011110" => table_value := 5990;
when "0011111" => table_value := 6177;
when "0100000" => table_value := 6362;
when "0100001" => table_value := 6547;
when "0100010" => table_value := 6731;
when "0100011" => table_value := 6914;
when "0100100" => table_value := 7095;
when "0100101" => table_value := 7276;
when "0100110" => table_value := 7456;
when "0100111" => table_value := 7634;
when "0101000" => table_value := 7811;
when "0101001" => table_value := 7988;
when "0101010" => table_value := 8162;
when "0101011" => table_value := 8336;
when "0101100" => table_value := 8509;
when "0101101" => table_value := 8680;
when "0101110" => table_value := 8850;
when "0101111" => table_value := 9018;
when "0110000" => table_value := 9185;
when "0110001" => table_value := 9351;
when "0110010" => table_value := 9515;
when "0110011" => table_value := 9678;
when "0110100" => table_value := 9840;
when "0110101" => table_value := 10000;
when "0110110" => table_value := 10158;
when "0110111" => table_value := 10315;
when "0111000" => table_value := 10471;
when "0111001" => table_value := 10625;
when "0111010" => table_value := 10777;
when "0111011" => table_value := 10927;
when "0111100" => table_value := 11076;
when "0111101" => table_value := 11224;
when "0111110" => table_value := 11369;
when "0111111" => table_value := 11513;
when "1000000" => table_value := 11655;
when "1000001" => table_value := 11796;
when "1000010" => table_value := 11934;
when "1000011" => table_value := 12071;
when "1000100" => table_value := 12206;
when "1000101" => table_value := 12339;
when "1000110" => table_value := 12471;
when "1000111" => table_value := 12600;
when "1001000" => table_value := 12728;
when "1001001" => table_value := 12853;
when "1001010" => table_value := 12977;
when "1001011" => table_value := 13099;
when "1001100" => table_value := 13219;
when "1001101" => table_value := 13336;
when "1001110" => table_value := 13452;
when "1001111" => table_value := 13566;
when "1010000" => table_value := 13678;
when "1010001" => table_value := 13787;
when "1010010" => table_value := 13895;
when "1010011" => table_value := 14000;
when "1010100" => table_value := 14104;
when "1010101" => table_value := 14205;
when "1010110" => table_value := 14304;
when "1010111" => table_value := 14401;
when "1011000" => table_value := 14496;
when "1011001" => table_value := 14588;
when "1011010" => table_value := 14679;
when "1011011" => table_value := 14767;
when "1011100" => table_value := 14853;
when "1011101" => table_value := 14936;
when "1011110" => table_value := 15018;
when "1011111" => table_value := 15097;
when "1100000" => table_value := 15174;
when "1100001" => table_value := 15249;
when "1100010" => table_value := 15321;
when "1100011" => table_value := 15391;
when "1100100" => table_value := 15459;
when "1100101" => table_value := 15524;
when "1100110" => table_value := 15587;
when "1100111" => table_value := 15648;
when "1101000" => table_value := 15706;
when "1101001" => table_value := 15762;
when "1101010" => table_value := 15816;
when "1101011" => table_value := 15867;
when "1101100" => table_value := 15916;
when "1101101" => table_value := 15963;
when "1101110" => table_value := 16007;
when "1101111" => table_value := 16048;
when "1110000" => table_value := 16088;
when "1110001" => table_value := 16124;
when "1110010" => table_value := 16159;
when "1110011" => table_value := 16191;
when "1110100" => table_value := 16220;
when "1110101" => table_value := 16247;
when "1110110" => table_value := 16272;
when "1110111" => table_value := 16294;
when "1111000" => table_value := 16314;
when "1111001" => table_value := 16331;
when "1111010" => table_value := 16346;
when "1111011" => table_value := 16358;
when "1111100" => table_value := 16368;
when "1111101" => table_value := 16375;
when "1111110" => table_value := 16380;
when "1111111" => table_value := 16383;
when others => null;
end case;
return table_value;
end;
end;

View File

@@ -0,0 +1,55 @@
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.altera_mf_components.all;
ENTITY spram IS
generic (
addr_width_g : integer := 8;
data_width_g : integer := 8
);
PORT
(
address : IN STD_LOGIC_VECTOR (addr_width_g-1 DOWNTO 0);
clken : IN STD_LOGIC := '1';
clock : IN STD_LOGIC := '1';
data : IN STD_LOGIC_VECTOR (data_width_g-1 DOWNTO 0);
wren : IN STD_LOGIC ;
q : OUT STD_LOGIC_VECTOR (data_width_g-1 DOWNTO 0)
);
END spram;
ARCHITECTURE SYN OF spram IS
BEGIN
altsyncram_component : altsyncram
GENERIC MAP (
clock_enable_input_a => "NORMAL",
clock_enable_output_a => "BYPASS",
intended_device_family => "Cyclone V",
lpm_hint => "ENABLE_RUNTIME_MOD=NO",
lpm_type => "altsyncram",
numwords_a => 2**addr_width_g,
operation_mode => "SINGLE_PORT",
outdata_aclr_a => "NONE",
outdata_reg_a => "UNREGISTERED",
power_up_uninitialized => "FALSE",
read_during_write_mode_port_a => "NEW_DATA_NO_NBE_READ",
widthad_a => addr_width_g,
width_a => data_width_g,
width_byteena_a => 1
)
PORT MAP (
address_a => address,
clock0 => clock,
clocken0 => clken,
data_a => data,
wren_a => wren,
q_a => q
);
END SYN;

View File

@@ -0,0 +1,447 @@
------------------------------------------------------------------------------
-- FPGA TripleDrawPoker
--
-- Version downto 2.50
--
-- Copyright(c) 2004 Katsumi Degawa , All rights reserved
--
-- Important not
--
-- This program is freeware for non-commercial use.
-- The author does not guarantee this program.
-- You can use this at your own risk.
--
-- 2004- 4-30 galaxian modify by K.DEGAWA
-- 2004- 5- 6 first release.
-- 2004- 8-23 Improvement with T80-IP.
-- 2004- 9-22 The problem which missile didn't sometimes come out from was improved.
------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
--use work.pkg_galaxian.all;
entity tripledrawpoker is
port(
W_CLK_18M : in std_logic;
W_CLK_12M : in std_logic;
W_CLK_6M : in std_logic;
P1_CSJUDLR : in std_logic_vector(7 downto 0);
P2_CSJUDLR : in std_logic_vector(7 downto 0);
I_RESET : in std_logic;
W_R : out std_logic_vector(2 downto 0);
W_G : out std_logic_vector(2 downto 0);
W_B : out std_logic_vector(2 downto 0);
HBLANK : out std_logic;
VBLANK : out std_logic;
W_H_SYNC : out std_logic;
W_V_SYNC : out std_logic;
W_SDAT_A : out std_logic_vector( 7 downto 0);
W_SDAT_B : out std_logic_vector( 7 downto 0);
O_CMPBL : out std_logic
);
end;
architecture RTL of tripledrawpoker is
-- CPU ADDRESS BUS
signal W_A : std_logic_vector(15 downto 0) := (others => '0');
-- CPU IF
signal W_CPU_CLK : std_logic := '0';
signal W_CPU_MREQn : std_logic := '0';
signal W_CPU_NMIn : std_logic := '0';
signal W_CPU_RDn : std_logic := '0';
signal W_CPU_RFSHn : std_logic := '0';
signal W_CPU_WAITn : std_logic := '0';
signal W_CPU_WRn : std_logic := '0';
signal W_CPU_WR : std_logic := '0';
signal W_RESETn : std_logic := '0';
-------- H and V COUNTER -------------------------
signal W_C_BLn : std_logic := '0';
signal W_C_BLnX : std_logic := '0';
signal W_C_BLXn : std_logic := '0';
signal W_H_BL : std_logic := '0';
signal W_H_SYNC_int : std_logic := '0';
signal W_V_BLn : std_logic := '0';
signal W_V_BL2n : std_logic := '0';
signal W_V_SYNC_int : std_logic := '0';
signal W_H_CNT : std_logic_vector(8 downto 0) := (others => '0');
signal W_V_CNT : std_logic_vector(7 downto 0) := (others => '0');
-------- CPU RAM ----------------------------
signal W_CPU_RAM_DO : std_logic_vector(7 downto 0) := (others => '0');
-------- ADDRESS DECDER ----------------------
signal W_BD_G : std_logic := '0';
signal W_CPU_RAM_CS : std_logic := '0';
signal W_CPU_RAM_RD : std_logic := '0';
-- signal W_CPU_RAM_WR : std_logic := '0';
signal W_CPU_ROM_CS : std_logic := '0';
signal W_DIP_OE : std_logic := '0';
signal W_H_FLIP : std_logic := '0';
signal W_DRIVER_WE : std_logic := '0';
signal W_OBJ_RAM_RD : std_logic := '0';
signal W_OBJ_RAM_RQ : std_logic := '0';
signal W_OBJ_RAM_WR : std_logic := '0';
signal W_PITCH : std_logic := '0';
signal W_SOUND_WE : std_logic := '0';
signal W_STARS_ON : std_logic := '0';
signal W_STARS_OFFn : std_logic := '0';
signal W_SW0_OE : std_logic := '0';
signal W_SW1_OE : std_logic := '0';
signal W_V_FLIP : std_logic := '0';
signal W_VID_RAM_RD : std_logic := '0';
signal W_VID_RAM_WR : std_logic := '0';
signal W_WDR_OE : std_logic := '0';
--------- INPORT -----------------------------
signal W_SW_DO : std_logic_vector( 7 downto 0) := (others => '0');
--------- VIDEO -----------------------------
signal W_VID_DO : std_logic_vector( 7 downto 0) := (others => '0');
----- DATA I/F -------------------------------------
signal W_CPU_ROM_DO : std_logic_vector( 7 downto 0) := (others => '0');
signal W_CPU_ROM_DOB : std_logic_vector( 7 downto 0) := (others => '0');
signal W_BDO : std_logic_vector( 7 downto 0) := (others => '0');
signal W_BDI : std_logic_vector( 7 downto 0) := (others => '0');
signal W_CPU_RAM_CLK : std_logic := '0';
signal W_VOL1 : std_logic := '0';
signal W_VOL2 : std_logic := '0';
signal W_FIRE : std_logic := '0';
signal W_HIT : std_logic := '0';
signal W_FS : std_logic_vector( 2 downto 0) := (others => '0');
signal blx_comb : std_logic := '0';
signal W_1VF : std_logic := '0';
signal W_256HnX : std_logic := '0';
signal W_8HF : std_logic := '0';
signal W_DAC_A : std_logic := '0';
signal W_DAC_B : std_logic := '0';
signal W_MISSILEn : std_logic := '0';
signal W_SHELLn : std_logic := '0';
signal W_MS_D : std_logic := '0';
signal W_MS_R : std_logic := '0';
signal W_MS_G : std_logic := '0';
signal W_MS_B : std_logic := '0';
signal new_sw : std_logic_vector( 2 downto 0) := (others => '0');
signal in_game : std_logic_vector( 1 downto 0) := (others => '0');
signal ROM_D : std_logic_vector( 7 downto 0) := (others => '0');
signal rst_count : std_logic_vector( 3 downto 0) := (others => '0');
signal W_COL : std_logic_vector( 2 downto 0) := (others => '0');
signal W_STARS_B : std_logic_vector( 1 downto 0) := (others => '0');
signal W_STARS_G : std_logic_vector( 1 downto 0) := (others => '0');
signal W_STARS_R : std_logic_vector( 1 downto 0) := (others => '0');
signal W_VID : std_logic_vector( 1 downto 0) := (others => '0');
signal W_VIDEO_B : std_logic_vector( 2 downto 0) := (others => '0');
signal W_VIDEO_G : std_logic_vector( 2 downto 0) := (others => '0');
signal W_VIDEO_R : std_logic_vector( 2 downto 0) := (others => '0');
signal W_WAV_A0 : std_logic_vector(18 downto 0) := (others => '0');
signal W_WAV_A1 : std_logic_vector(18 downto 0) := (others => '0');
signal W_WAV_A2 : std_logic_vector(18 downto 0) := (others => '0');
signal W_WAV_D0 : std_logic_vector( 7 downto 0) := (others => '0');
signal W_WAV_D1 : std_logic_vector( 7 downto 0) := (others => '0');
signal W_WAV_D2 : std_logic_vector( 7 downto 0) := (others => '0');
signal W_DAC : std_logic_vector( 3 downto 0) := (others => '0');
signal gfx_bank : std_logic;
begin
mc_vid : entity work.MC_VIDEO
port map(
I_CLK_18M => W_CLK_18M,
I_CLK_12M => W_CLK_12M,
I_CLK_6M => W_CLK_6M,
I_H_CNT => W_H_CNT,
I_V_CNT => W_V_CNT,
I_H_FLIP => W_H_FLIP,
I_V_FLIP => W_V_FLIP,
I_V_BLn => W_V_BLn,
I_C_BLn => W_C_BLn,
I_A => W_A(9 downto 0),
I_OBJ_SUB_A => "000",
I_BD => W_BDI,
I_OBJ_RAM_RQ => W_OBJ_RAM_RQ,
I_OBJ_RAM_RD => W_OBJ_RAM_RD,
I_OBJ_RAM_WR => W_OBJ_RAM_WR,
I_VID_RAM_RD => W_VID_RAM_RD,
I_VID_RAM_WR => W_VID_RAM_WR,
I_DRIVER_WR => W_DRIVER_WE,
I_BANK => gfx_bank,
O_C_BLnX => W_C_BLnX,
O_8HF => W_8HF,
O_256HnX => W_256HnX,
O_1VF => W_1VF,
O_MISSILEn => W_MISSILEn,
O_SHELLn => W_SHELLn,
O_BD => W_VID_DO,
O_VID => W_VID,
O_COL => W_COL
);
cpu : entity work.T80as
port map (
RESET_n => W_RESETn,
CLK_n => W_CPU_CLK,
WAIT_n => W_CPU_WAITn,
INT_n => '1',
NMI_n => W_CPU_NMIn,
BUSRQ_n => '1',
MREQ_n => W_CPU_MREQn,
RD_n => W_CPU_RDn,
WR_n => W_CPU_WRn,
RFSH_n => W_CPU_RFSHn,
A => W_A,
DI => W_BDO,
DO => W_BDI,
M1_n => open,
IORQ_n => open,
HALT_n => open,
BUSAK_n => open,
DOE => open
);
mc_cpu_ram : entity work.MC_CPU_RAM
port map (
I_CLK => W_CPU_RAM_CLK,
I_ADDR => W_A(9 downto 0),
I_D => W_BDI,
I_WE => W_CPU_WR,
I_OE => W_CPU_RAM_RD,
O_D => W_CPU_RAM_DO
);
mc_adec : entity work.MC_ADEC
port map(
I_CLK_12M => W_CLK_12M,
I_CLK_6M => W_CLK_6M,
I_CPU_CLK => W_CPU_CLK,
I_RSTn => W_RESETn,
I_CPU_A => W_A,
I_CPU_D => W_BDI(0),
I_MREQn => W_CPU_MREQn,
I_RFSHn => W_CPU_RFSHn,
I_RDn => W_CPU_RDn,
I_WRn => W_CPU_WRn,
I_H_BL => W_H_BL,
I_V_BLn => W_V_BLn,
O_WAITn => W_CPU_WAITn,
O_NMIn => W_CPU_NMIn,
O_CPU_ROM_CS => W_CPU_ROM_CS,
O_CPU_RAM_RD => W_CPU_RAM_RD,
-- O_CPU_RAM_WR => W_CPU_RAM_WR,
O_CPU_RAM_CS => W_CPU_RAM_CS,
O_OBJ_RAM_RD => W_OBJ_RAM_RD,
O_OBJ_RAM_WR => W_OBJ_RAM_WR,
O_OBJ_RAM_RQ => W_OBJ_RAM_RQ,
O_VID_RAM_RD => W_VID_RAM_RD,
O_VID_RAM_WR => W_VID_RAM_WR,
O_SW0_OE => W_SW0_OE,
O_SW1_OE => W_SW1_OE,
O_DIP_OE => W_DIP_OE,
O_WDR_OE => W_WDR_OE,
O_DRIVER_WE => W_DRIVER_WE,
O_SOUND_WE => W_SOUND_WE,
O_PITCH => W_PITCH,
O_H_FLIP => W_H_FLIP,
O_V_FLIP => W_V_FLIP,
O_BD_G => W_BD_G,
O_STARS_ON => W_STARS_ON
);
-- active high buttons
mc_inport : entity work.MC_INPORT
port map (
I_COIN1 => P1_CSJUDLR(7),
I_COIN2 => P1_CSJUDLR(6),
I_1P_START => P2_CSJUDLR(0),
I_2P_START => P2_CSJUDLR(1),
I_1P_SH => P1_CSJUDLR(3),
-- I_2P_SH => P2_CSJUDLR(4),
I_1P_UP => P1_CSJUDLR(0),
-- I_2P_UP => P2_CSJUDLR(3),
I_1P_DW => P1_CSJUDLR(2),
-- I_2P_DW => P2_CSJUDLR(2),
I_1P_LE => P1_CSJUDLR(5),
-- I_2P_LE => P2_CSJUDLR(1),
I_1P_RI => P1_CSJUDLR(4),
-- I_2P_RI => P2_CSJUDLR(0),
I_SW0_OE => W_SW0_OE,
I_SW1_OE => W_SW1_OE,
I_DIP_OE => W_DIP_OE,
O_D => W_SW_DO
);
mc_hv : entity work.MC_HV_COUNT
port map(
I_CLK => W_CLK_6M,
I_RSTn => W_RESETn,
O_H_CNT => W_H_CNT,
O_H_SYNC => W_H_SYNC_int,
O_H_BL => W_H_BL,
O_V_CNT => W_V_CNT,
O_V_SYNC => W_V_SYNC_int,
O_V_BL2n => W_V_BL2n,
O_V_BLn => W_V_BLn,
O_C_BLn => W_C_BLn
);
mc_col_pal : entity work.MC_COL_PAL
port map(
I_CLK_12M => W_CLK_12M,
I_CLK_6M => W_CLK_6M,
I_VID => W_VID,
I_COL => W_COL,
I_C_BLnX => W_C_BLnX,
O_C_BLXn => W_C_BLXn,
O_STARS_OFFn => W_STARS_OFFn,
O_R => W_VIDEO_R,
O_G => W_VIDEO_G,
O_B => W_VIDEO_B
);
mc_stars : entity work.MC_STARS
port map (
I_CLK_18M => W_CLK_18M,
I_CLK_6M => W_CLK_6M,
I_H_FLIP => W_H_FLIP,
I_V_SYNC => W_V_SYNC_int,
I_8HF => W_8HF,
I_256HnX => W_256HnX,
I_1VF => W_1VF,
I_2V => W_V_CNT(1),
I_STARS_ON => W_STARS_ON,
I_STARS_OFFn => W_STARS_OFFn,
O_R => W_STARS_R,
O_G => W_STARS_G,
O_B => W_STARS_B,
O_NOISE => open
);
mc_sound_a : entity work.MC_SOUND_A
port map(
I_CLK_12M => W_CLK_12M,
I_CLK_6M => W_CLK_6M,
I_H_CNT1 => W_H_CNT(1),
I_BD => W_BDI,
I_PITCH => W_PITCH,
I_VOL1 => W_VOL1,
I_VOL2 => W_VOL2,
O_SDAT => W_SDAT_A,
O_DO => open
);
--------- ROM -------------------------------------------------------
mc_roms : entity work.sprom
generic map (
init_file => "./ROM/prog.hex",
widthad_a => 14,
width_a => 8)
port map (
address => W_A(13 downto 0),
clock => W_CLK_12M,
q => W_CPU_ROM_DO
);
-------- VIDEO -----------------------------
blx_comb <= not ( W_C_BLXn and W_V_BL2n );
W_V_SYNC <= not W_V_SYNC_int;
W_H_SYNC <= not W_H_SYNC_int;
O_CMPBL <= W_C_BLnX;
-- MISSILE => Yellow ;
-- SHELL => White ;
W_MS_D <= not (W_MISSILEn and W_SHELLn);
W_MS_R <= not blx_comb and W_MS_D;
W_MS_G <= not blx_comb and W_MS_D;
W_MS_B <= not blx_comb and W_MS_D and not W_SHELLn ;
W_R <= W_VIDEO_R or (W_STARS_R & "0") or (W_MS_R & W_MS_R & "0");
W_G <= W_VIDEO_G or (W_STARS_G & "0") or (W_MS_G & W_MS_G & "0");
W_B <= W_VIDEO_B or (W_STARS_B & "0") or (W_MS_B & W_MS_B & "0");
process(W_CLK_6M)
begin
if rising_edge(W_CLK_6M) then
HBLANK <= not W_C_BLXn;
VBLANK <= not W_V_BL2n;
end if;
end process;
----- CPU I/F -------------------------------------
W_CPU_CLK <= W_H_CNT(0);
W_CPU_RAM_CLK <= W_CLK_12M and W_CPU_RAM_CS;
W_CPU_ROM_DOB <= W_CPU_ROM_DO when W_CPU_ROM_CS = '1' else (others=>'0');
W_RESETn <= not I_RESET;
W_BDO <= W_SW_DO or W_VID_DO or W_CPU_RAM_DO or W_CPU_ROM_DOB ;
W_CPU_WR <= not W_CPU_WRn;
new_sw <= (W_FS(2) or W_FS(1) or W_FS(0)) & W_HIT & W_FIRE;
process(W_CPU_CLK, I_RESET)
begin
if (I_RESET = '1') then
rst_count <= (others => '0');
elsif rising_edge( W_CPU_CLK) then
if ( rst_count /= x"f") then
rst_count <= rst_count + 1;
end if;
end if;
end process;
----- Parts 9L ---------
process(W_CLK_12M, I_RESET)
begin
if (I_RESET = '1') then
W_FS <= (others=>'0');
W_HIT <= '0';
W_FIRE <= '0';
W_VOL1 <= '0';
W_VOL2 <= '0';
elsif rising_edge(W_CLK_12M) then
if (W_SOUND_WE = '1') then
case(W_A(2 downto 0)) is
when "000" => W_FS(0) <= W_BDI(0);
when "001" => W_FS(1) <= W_BDI(0);
when "010" => W_FS(2) <= W_BDI(0);
when "011" => W_HIT <= W_BDI(0);
-- when "100" => UNUSED <= W_BDI(0);
when "101" => W_FIRE <= W_BDI(0);
when "110" => W_VOL1 <= W_BDI(0);
when "111" => W_VOL2 <= W_BDI(0);
when others => null;
end case;
end if;
end if;
end process;
----- Parts 9M ---------
process(W_CLK_12M, I_RESET)
begin
if (I_RESET = '1') then
W_DAC <= (others=>'0');
elsif rising_edge(W_CLK_12M) then
if (W_DRIVER_WE = '1') then
case(W_A(2 downto 0)) is
-- next 4 outputs go off board via ULN2075 buffer
-- when "000" => 1P START <= W_BDI(0);
-- when "001" => 2P START <= W_BDI(0);
when "010" => gfx_bank <= W_BDI(0);
-- when "011" => COIN CTR <= W_BDI(0);
when "100" => W_DAC(0) <= W_BDI(0); -- 1M
when "101" => W_DAC(1) <= W_BDI(0); -- 470K
when "110" => W_DAC(2) <= W_BDI(0); -- 220K
when "111" => W_DAC(3) <= W_BDI(0); -- 100K
when others => null;
end case;
end if;
end if;
end process;
-------------------------------------------------------------------------------
end RTL;

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

@@ -1,253 +0,0 @@
//============================================================================
// Arcade: Birdiy
//
// Version for MiSTer
// Copyright (C) 2017 Sorgelig
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//============================================================================
module Birdiy(
output LED,
output [5:0] VGA_R,
output [5:0] VGA_G,
output [5:0] VGA_B,
output VGA_HS,
output VGA_VS,
output AUDIO_L,
output AUDIO_R,
input SPI_SCK,
output SPI_DO,
input SPI_DI,
input SPI_SS2,
input SPI_SS3,
input CONF_DATA0,
input CLOCK_27
);
`include "rtl\build_id.v"
localparam CONF_STR = {
"Birdiy;;",
"O1,Rack Test,off,on;",
"O2,Rotate Controls,Off,On;",
"O34,Scanlines,Off,25%,50%,75%;",
"T6,Reset;",
"V,v0.00.",`BUILD_DATE
};
assign LED = 1;
assign AUDIO_R = AUDIO_L;
wire clk_sys, clk_snd;
wire pll_locked;
pll pll(
.inclk0(CLOCK_27),
.areset(0),
.c0(clk_sys),
.locked(pll_locked)
);
reg ce_6m;
always @(posedge clk_sys) begin
reg [1:0] div;
div <= div + 1'd1;
ce_6m <= !div;
end
wire [31:0] status;
wire [1:0] buttons;
wire [1:0] switches;
wire [7:0] joystick_0;
wire [7:0] joystick_1;
wire scandoublerD;
wire ypbpr;
wire [10:0] ps2_key;
wire [7:0] audio;
wire hs, vs;
wire hb, vb;
wire blankn = ~(hb | vb);
wire [2:0] r,g;
wire [1:0] b;
pacmant pacmant(
.O_VIDEO_R(r),
.O_VIDEO_G(g),
.O_VIDEO_B(b),
.O_HSYNC(hs),
.O_VSYNC(vs),
.O_HBLANK(hb),
.O_VBLANK(vb),
.O_AUDIO(audio),
.I_JOYSTICK_A(~{m_fire,m_right,m_left,m_down,m_up}),
.I_JOYSTICK_B(~{m_fire,m_right,m_left,m_down,m_up}),
.I_SW({status[1], btn_two_players, btn_coin, status[1], btn_one_player}),
.RESET(status[0] | status[6] | buttons[1]),
.CLK(clk_sys),
.ENA_6(ce_6m)
);
video_mixer video_mixer(
.clk_sys(clk_sys),
.ce_pix(ce_6m),
.ce_pix_actual(ce_6m),
.SPI_SCK(SPI_SCK),
.SPI_SS3(SPI_SS3),
.SPI_DI(SPI_DI),
.R(blankn ? {r} : "000"),
.G(blankn ? {g} : "000"),
.B(blankn ? {b,b[1]} : "000"),
.HSync(hs),
.VSync(vs),
.VGA_R(VGA_R),
.VGA_G(VGA_G),
.VGA_B(VGA_B),
.VGA_VS(VGA_VS),
.VGA_HS(VGA_HS),
.rotate({1'b1,status[2]}),
.scandoublerD(scandoublerD),
.scanlines(scandoublerD ? 2'b00 : status[4:3]),
.ypbpr(ypbpr),
.ypbpr_full(1),
.line_start(0),
.mono(0)
);
mist_io #(
.STRLEN(($size(CONF_STR)>>3)))
mist_io(
.clk_sys (clk_sys ),
.conf_str (CONF_STR ),
.SPI_SCK (SPI_SCK ),
.CONF_DATA0 (CONF_DATA0 ),
.SPI_SS2 (SPI_SS2 ),
.SPI_DO (SPI_DO ),
.SPI_DI (SPI_DI ),
.buttons (buttons ),
.switches (switches ),
.scandoublerD (scandoublerD ),
.ypbpr (ypbpr ),
.ps2_key (ps2_key ),
.joystick_0 (joystick_0 ),
.joystick_1 (joystick_1 ),
.status (status )
);
dac #(
.C_bits(15))
dac(
.clk_i(clk_sys),
.res_n_i(1),
.dac_i({audio,audio}),
.dac_o(AUDIO_L)
);
// Rotated Normal
wire m_up = ~status[2] ? btn_left | joystick_0[1] | joystick_1[1] : btn_up | joystick_0[3] | joystick_1[3];
wire m_down = ~status[2] ? btn_right | joystick_0[0] | joystick_1[0] : btn_down | joystick_0[2] | joystick_1[2];
wire m_left = ~status[2] ? btn_down | joystick_0[2] | joystick_1[2] : btn_left | joystick_0[1] | joystick_1[1];
wire m_right = ~status[2] ? btn_up | joystick_0[3] | joystick_1[3] : btn_right | joystick_0[0] | joystick_1[0];
wire m_fire = btn_fire1 | joystick_0[4] | joystick_1[4];
wire m_bomb = btn_fire2 | joystick_0[5] | joystick_1[5];
reg btn_one_player = 0;
reg btn_two_players = 0;
reg btn_left = 0;
reg btn_right = 0;
reg btn_down = 0;
reg btn_up = 0;
reg btn_fire1 = 0;
reg btn_fire2 = 0;
reg btn_fire3 = 0;
reg btn_coin = 0;
wire pressed = ps2_key[9];
wire [7:0] code = ps2_key[7:0];
always @(posedge clk_sys) begin
reg old_state;
old_state <= ps2_key[10];
if(old_state != ps2_key[10]) begin
case(code)
'h75: btn_up <= pressed; // up
'h72: btn_down <= pressed; // down
'h6B: btn_left <= pressed; // left
'h74: btn_right <= pressed; // right
'h76: btn_coin <= pressed; // ESC
'h05: btn_one_player <= pressed; // F1
'h06: btn_two_players <= pressed; // F2
'h14: btn_fire3 <= pressed; // ctrl
'h11: btn_fire2 <= pressed; // alt
'h29: btn_fire1 <= pressed; // Space
endcase
end
end
endmodule
//wire m_up = status[2] ? kbjoy[6] | joystick_0[1] | joystick_1[1] : kbjoy[4] | joystick_0[3] | joystick_1[3];
//wire m_down = status[2] ? kbjoy[7] | joystick_0[0] | joystick_1[0] : kbjoy[5] | joystick_0[2] | joystick_1[2];
//wire m_left = status[2] ? kbjoy[5] | joystick_0[2] | joystick_1[2] : kbjoy[6] | joystick_0[1] | joystick_1[1];
//wire m_right = status[2] ? kbjoy[4] | joystick_0[3] | joystick_1[3] : kbjoy[7] | joystick_0[0] | joystick_1[0];
//TODO
/*
VIDEO_START_MEMBER(pacman_state,birdiy)
{
VIDEO_START_CALL_MEMBER( pacman );
m_xoffsethack = 0;
m_inv_spr = 1; // sprites are mirrored in X-axis compared to normal behaviour
}
void pacman_state::pacman_map(address_map &map)
{
//A lot of games don't have an a15 at the cpu. Generally only games with a cpu daughter board can access the full 32k of romspace.
map(0x0000, 0x3fff).mirror(0x8000).rom();
map(0x4000, 0x43ff).mirror(0xa000).ram().w(FUNC(pacman_state::pacman_videoram_w)).share("videoram");
map(0x4400, 0x47ff).mirror(0xa000).ram().w(FUNC(pacman_state::pacman_colorram_w)).share("colorram");
map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(pacman_state::pacman_read_nop)).nopw();
map(0x4c00, 0x4fef).mirror(0xa000).ram();
map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram");
map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(addressable_latch_device::write_d0));
map(0x5040, 0x505f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w));
map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2");
map(0x5070, 0x507f).mirror(0xaf00).nopw();
map(0x5080, 0x5080).mirror(0xaf3f).nopw();
map(0x50c0, 0x50c0).mirror(0xaf3f).w(m_watchdog, FUNC(watchdog_timer_device::reset_w));
map(0x5000, 0x5000).mirror(0xaf3f).portr("IN0");
map(0x5040, 0x5040).mirror(0xaf3f).portr("IN1");
map(0x5080, 0x5080).mirror(0xaf3f).portr("DSW1");
map(0x50c0, 0x50c0).mirror(0xaf3f).portr("DSW2");
}
void pacman_state::birdiy_map(address_map &map)
{
map(0x0000, 0x3fff).mirror(0x8000).rom();
map(0x4000, 0x43ff).mirror(0xa000).ram().w(FUNC(pacman_state::pacman_videoram_w)).share("videoram");
map(0x4400, 0x47ff).mirror(0xa000).ram().w(FUNC(pacman_state::pacman_colorram_w)).share("colorram");
// AM_RANGE(0x4800, 0x4bff) AM_MIRROR(0xa000) AM_READ(pacman_read_nop) AM_WRITENOP
map(0x4c00, 0x4fef).mirror(0xa000).ram();
map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram");
map(0x5000, 0x5007).mirror(0xaf38).w(m_mainlatch, FUNC(ls259_device::write_d0));
map(0x5080, 0x509f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w));
map(0x50a0, 0x50af).mirror(0xaf00).writeonly().share("spriteram2");
// AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP
// AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP
map(0x50c0, 0x50c0).mirror(0xaf3f).w(m_watchdog, FUNC(watchdog_timer_device::reset_w));
map(0x5000, 0x5000).mirror(0xaf3f).portr("IN0");
map(0x5040, 0x5040).mirror(0xaf3f).portr("IN1");
map(0x5080, 0x5080).mirror(0xaf3f).portr("DSW1");
map(0x50c0, 0x50c0).mirror(0xaf3f).portr("DSW2");
}*/

View File

@@ -1,217 +0,0 @@
-- ****
-- T80(b) core. In an effort to merge and maintain bug fixes ....
--
--
-- Ver 300 started tidyup
-- MikeJ March 2005
-- Latest version from www.fpgaarcade.com (original www.opencores.org)
--
-- ****
--
-- Z80 compatible microprocessor core
--
-- Version : 0242
--
-- Copyright (c) 2001-2002 Daniel Wallner (jesus@opencores.org)
--
-- 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.
--
-- The latest version of this file can be found at:
-- http://www.opencores.org/cvsweb.shtml/t80/
--
-- Limitations :
--
-- File history :
--
library IEEE;
use IEEE.std_logic_1164.all;
package T80_Pack is
component T80
generic(
Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle
Flag_C : integer := 0;
Flag_N : integer := 1;
Flag_P : integer := 2;
Flag_X : integer := 3;
Flag_H : integer := 4;
Flag_Y : integer := 5;
Flag_Z : integer := 6;
Flag_S : integer := 7
);
port(
RESET_n : in std_logic;
CLK_n : in std_logic;
CEN : in std_logic;
WAIT_n : in std_logic;
INT_n : in std_logic;
NMI_n : in std_logic;
BUSRQ_n : in std_logic;
M1_n : out std_logic;
IORQ : out std_logic;
NoRead : out std_logic;
Write : out std_logic;
RFSH_n : out std_logic;
HALT_n : out std_logic;
BUSAK_n : out std_logic;
A : out std_logic_vector(15 downto 0);
DInst : in std_logic_vector(7 downto 0);
DI : in std_logic_vector(7 downto 0);
DO : out std_logic_vector(7 downto 0);
MC : out std_logic_vector(2 downto 0);
TS : out std_logic_vector(2 downto 0);
IntCycle_n : out std_logic;
IntE : out std_logic;
Stop : out std_logic
);
end component;
component T80_Reg
port(
Clk : in std_logic;
CEN : in std_logic;
WEH : in std_logic;
WEL : in std_logic;
AddrA : in std_logic_vector(2 downto 0);
AddrB : in std_logic_vector(2 downto 0);
AddrC : in std_logic_vector(2 downto 0);
DIH : in std_logic_vector(7 downto 0);
DIL : in std_logic_vector(7 downto 0);
DOAH : out std_logic_vector(7 downto 0);
DOAL : out std_logic_vector(7 downto 0);
DOBH : out std_logic_vector(7 downto 0);
DOBL : out std_logic_vector(7 downto 0);
DOCH : out std_logic_vector(7 downto 0);
DOCL : out std_logic_vector(7 downto 0)
);
end component;
component T80_MCode
generic(
Mode : integer := 0;
Flag_C : integer := 0;
Flag_N : integer := 1;
Flag_P : integer := 2;
Flag_X : integer := 3;
Flag_H : integer := 4;
Flag_Y : integer := 5;
Flag_Z : integer := 6;
Flag_S : integer := 7
);
port(
IR : in std_logic_vector(7 downto 0);
ISet : in std_logic_vector(1 downto 0);
MCycle : in std_logic_vector(2 downto 0);
F : in std_logic_vector(7 downto 0);
NMICycle : in std_logic;
IntCycle : in std_logic;
MCycles : out std_logic_vector(2 downto 0);
TStates : out std_logic_vector(2 downto 0);
Prefix : out std_logic_vector(1 downto 0); -- None,BC,ED,DD/FD
Inc_PC : out std_logic;
Inc_WZ : out std_logic;
IncDec_16 : out std_logic_vector(3 downto 0); -- BC,DE,HL,SP 0 is inc
Read_To_Reg : out std_logic;
Read_To_Acc : out std_logic;
Set_BusA_To : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI/DB,A,SP(L),SP(M),0,F
Set_BusB_To : out std_logic_vector(3 downto 0); -- B,C,D,E,H,L,DI,A,SP(L),SP(M),1,F,PC(L),PC(M),0
ALU_Op : out std_logic_vector(3 downto 0);
-- ADD, ADC, SUB, SBC, AND, XOR, OR, CP, ROT, BIT, SET, RES, DAA, RLD, RRD, None
Save_ALU : out std_logic;
PreserveC : out std_logic;
Arith16 : out std_logic;
Set_Addr_To : out std_logic_vector(2 downto 0); -- aNone,aXY,aIOA,aSP,aBC,aDE,aZI
IORQ : out std_logic;
Jump : out std_logic;
JumpE : out std_logic;
JumpXY : out std_logic;
Call : out std_logic;
RstP : out std_logic;
LDZ : out std_logic;
LDW : out std_logic;
LDSPHL : out std_logic;
Special_LD : out std_logic_vector(2 downto 0); -- A,I;A,R;I,A;R,A;None
ExchangeDH : out std_logic;
ExchangeRp : out std_logic;
ExchangeAF : out std_logic;
ExchangeRS : out std_logic;
I_DJNZ : out std_logic;
I_CPL : out std_logic;
I_CCF : out std_logic;
I_SCF : out std_logic;
I_RETN : out std_logic;
I_BT : out std_logic;
I_BC : out std_logic;
I_BTR : out std_logic;
I_RLD : out std_logic;
I_RRD : out std_logic;
I_INRC : out std_logic;
SetDI : out std_logic;
SetEI : out std_logic;
IMode : out std_logic_vector(1 downto 0);
Halt : out std_logic;
NoRead : out std_logic;
Write : out std_logic
);
end component;
component T80_ALU
generic(
Mode : integer := 0;
Flag_C : integer := 0;
Flag_N : integer := 1;
Flag_P : integer := 2;
Flag_X : integer := 3;
Flag_H : integer := 4;
Flag_Y : integer := 5;
Flag_Z : integer := 6;
Flag_S : integer := 7
);
port(
Arith16 : in std_logic;
Z16 : in std_logic;
ALU_Op : in std_logic_vector(3 downto 0);
IR : in std_logic_vector(5 downto 0);
ISet : in std_logic_vector(1 downto 0);
BusA : in std_logic_vector(7 downto 0);
BusB : in std_logic_vector(7 downto 0);
F_In : in std_logic_vector(7 downto 0);
Q : out std_logic_vector(7 downto 0);
F_Out : out std_logic_vector(7 downto 0)
);
end component;
end;

View File

@@ -1,2 +0,0 @@
`define BUILD_DATE "190310"
`define BUILD_TIME "105929"

View File

@@ -1,48 +0,0 @@
-------------------------------------------------------------------------------
--
-- Delta-Sigma DAC
--
-- Refer to Xilinx Application Note XAPP154.
--
-- This DAC requires an external RC low-pass filter:
--
-- dac_o 0---XXXXX---+---0 analog audio
-- 3k3 |
-- === 4n7
-- |
-- GND
--
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity dac is
generic (
C_bits : integer := 10
);
port (
clk_i : in std_logic;
res_n_i : in std_logic;
dac_i : in std_logic_vector(C_bits-1 downto 0);
dac_o : out std_logic
);
end dac;
architecture rtl of dac is
signal sig_in: unsigned(C_bits downto 0);
begin
seq: process(clk_i, res_n_i)
begin
if res_n_i = '0' then
sig_in <= to_unsigned(2**C_bits, sig_in'length);
dac_o <= '0';
elsif rising_edge(clk_i) then
-- not dac_i(C_bits-1) effectively adds 0x8..0 to dac_i
--sig_in <= sig_in + unsigned(sig_in(C_bits) & (not dac_i(C_bits-1)) & dac_i(C_bits-2 downto 0));
sig_in <= sig_in + unsigned(sig_in(C_bits) & dac_i);
dac_o <= sig_in(C_bits);
end if;
end process seq;
end rtl;

View File

@@ -1,58 +0,0 @@
-------------------------------------------------------------------------------
-- $Id: dpram.vhd,v 1.1 2006/02/23 21:46:45 arnim Exp $
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity dpram is
generic (
addr_width_g : integer := 8;
data_width_g : integer := 8
);
port (
clk_a_i : in std_logic;
en_a_i : in std_logic;
we_i : in std_logic;
addr_a_i : in std_logic_vector(addr_width_g-1 downto 0);
data_a_i : in std_logic_vector(data_width_g-1 downto 0);
data_a_o : out std_logic_vector(data_width_g-1 downto 0);
clk_b_i : in std_logic;
addr_b_i : in std_logic_vector(addr_width_g-1 downto 0);
data_b_o : out std_logic_vector(data_width_g-1 downto 0)
);
end dpram;
library ieee;
use ieee.numeric_std.all;
architecture rtl of dpram is
type ram_t is array (natural range 2**addr_width_g-1 downto 0) of std_logic_vector(data_width_g-1 downto 0);
signal ram_q : ram_t;
begin
mem_a: process (clk_a_i)
begin
if rising_edge(clk_a_i) then
if we_i = '1' and en_a_i = '1' then
ram_q(to_integer(unsigned(addr_a_i))) <= data_a_i;
data_a_o <= data_a_i;
else
data_a_o <= ram_q(to_integer(unsigned(addr_a_i)));
end if;
end if;
end process mem_a;
mem_b: process (clk_b_i)
begin
if rising_edge(clk_b_i) then
data_b_o <= ram_q(to_integer(unsigned(addr_b_i)));
end if;
end process mem_b;
end rtl;

View File

@@ -1,672 +0,0 @@
--
-- A simulation model of Pacman hardware
-- Copyright (c) MikeJ - January 2006
--
-- 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 CODE 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.
--
-- You are responsible for any legal issues arising from your use of this code.
--
-- The latest version of this file can be found at: www.fpgaarcade.com
--
-- Email pacman@fpgaarcade.com
--
-- Revision list
--
-- version 005 Papilio release by Jack Gassett
-- version 004 spartan3e release
-- version 003 Jan 2006 release, general tidy up
-- version 002 optional vga scan doubler
-- version 001 initial release
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity pacmant is
port (
O_VIDEO_R : out std_logic_vector(2 downto 0);
O_VIDEO_G : out std_logic_vector(2 downto 0);
O_VIDEO_B : out std_logic_vector(1 downto 0);
O_HSYNC : out std_logic;
O_VSYNC : out std_logic;
O_HBLANK : out std_logic;
O_VBLANK : out std_logic;
--
O_AUDIO : out std_logic_vector(7 downto 0);
--
I_JOYSTICK_A : in std_logic_vector(4 downto 0);
I_JOYSTICK_B : in std_logic_vector(4 downto 0);
I_SW : in std_logic_vector(4 downto 0); -- active high
--
RESET : in std_logic;
CLK : in std_logic;
ENA_6 : in std_logic
);
end;
architecture RTL of pacmant is
-- timing
signal hcnt : std_logic_vector(8 downto 0) := "010000000"; -- 80
signal vcnt : std_logic_vector(8 downto 0) := "011111000"; -- 0F8
signal do_hsync : boolean;
signal hsync : std_logic;
signal vsync : std_logic;
signal hblank : std_logic;
signal vblank : std_logic := '1';
-- cpu
signal cpu_ena : std_logic;
signal cpu_m1_l : std_logic;
signal cpu_mreq_l : std_logic;
signal cpu_iorq_l : std_logic;
signal cpu_rd_l : std_logic;
signal cpu_rfsh_l : std_logic;
signal cpu_wait_l : std_logic;
signal cpu_int_l : std_logic;
signal cpu_nmi_l : std_logic;
signal cpu_busrq_l : std_logic;
signal cpu_addr : std_logic_vector(15 downto 0);
signal cpu_data_out : std_logic_vector(7 downto 0);
signal cpu_data_in : std_logic_vector(7 downto 0);
signal rom_data : std_logic_vector(7 downto 0);
signal sync_bus_cs_l : std_logic;
signal control_reg : std_logic_vector(7 downto 0);
--
signal vram_addr_ab : std_logic_vector(11 downto 0);
signal ab : std_logic_vector(11 downto 0);
signal sync_bus_db : std_logic_vector(7 downto 0);
signal sync_bus_r_w_l : std_logic;
signal sync_bus_wreq_l : std_logic;
signal sync_bus_stb : std_logic;
signal cpu_vec_reg : std_logic_vector(7 downto 0);
signal sync_bus_reg : std_logic_vector(7 downto 0);
signal vram_l : std_logic;
signal rams_data_out : std_logic_vector(7 downto 0);
-- more decode
signal wr0_l : std_logic;
signal wr1_l : std_logic;
signal wr2_l : std_logic;
signal iodec_out_l : std_logic;
signal iodec_wdr_l : std_logic;
signal iodec_in0_l : std_logic;
signal iodec_in1_l : std_logic;
signal iodec_dipsw_l : std_logic;
-- watchdog
signal watchdog_cnt : std_logic_vector(3 downto 0);
signal watchdog_reset_l : std_logic;
signal freeze : std_logic;
-- ip registers
signal button_in : std_logic_vector(14 downto 0);
signal button_debounced : std_logic_vector(14 downto 0);
signal in0_reg : std_logic_vector(7 downto 0);
signal in1_reg : std_logic_vector(7 downto 0);
signal dipsw_reg : std_logic_vector(7 downto 0);
signal joystick_reg : std_logic_vector(4 downto 0);
signal joystick_reg2 : std_logic_vector(4 downto 0);
begin
joystick_reg <= I_JOYSTICK_A;
joystick_reg2 <= I_JOYSTICK_B;
--
-- video timing
--
p_hvcnt : process
variable hcarry,vcarry : boolean;
begin
wait until rising_edge(clk);
if (ena_6 = '1') then
hcarry := (hcnt = "111111111");
if hcarry then
hcnt <= "010000000"; -- 080
else
hcnt <= hcnt +"1";
end if;
-- hcnt 8 on circuit is 256H_L
vcarry := (vcnt = "111111111");
if do_hsync then
if vcarry then
vcnt <= "011111000"; -- 0F8
else
vcnt <= vcnt +"1";
end if;
end if;
end if;
end process;
p_sync_comb : process(hcnt, vcnt)
begin
vsync <= not vcnt(8);
do_hsync <= (hcnt = "010101111"); -- 0AF
end process;
p_sync : process
begin
wait until rising_edge(clk);
if (ena_6 = '1') then
-- Timing hardware is coded differently to the real hw
-- to avoid the use of multiple clocks. Result is identical.
if (hcnt = "010010111") then -- 097
O_HBLANK <= '1';
elsif (hcnt = "010001111") then -- 08F
hblank <= '1';
elsif (hcnt = "011101111") then
hblank <= '0'; -- 0EF
O_HBLANK <= '0';
end if;
if do_hsync then
hsync <= '1';
elsif (hcnt = "011001111") then -- 0CF
hsync <= '0';
end if;
if do_hsync then
if (vcnt = "111101111") then -- 1EF
vblank <= '1';
elsif (vcnt = "100001111") then -- 10F
vblank <= '0';
end if;
end if;
end if;
end process;
--
-- cpu
--
p_cpu_wait_comb : process(freeze, sync_bus_wreq_l)
begin
cpu_wait_l <= '1';
if (freeze = '1') or (sync_bus_wreq_l = '0') then
cpu_wait_l <= '0';
end if;
end process;
p_irq_req_watchdog : process
variable rising_vblank : boolean;
begin
wait until rising_edge(clk);
if (ena_6 = '1') then
rising_vblank := do_hsync and (vcnt = "111101111"); -- 1EF
--rising_vblank := do_hsync; -- debug
-- interrupt 8c
if (control_reg(0) = '0') then
cpu_int_l <= '1';
elsif rising_vblank then -- 1EF
cpu_int_l <= '0';
end if;
-- watchdog 8c
-- note sync reset
if (reset = '1') then
watchdog_cnt <= "1111";
elsif (iodec_wdr_l = '0') then
watchdog_cnt <= "0000";
elsif rising_vblank and (freeze = '0') then
watchdog_cnt <= watchdog_cnt + "1";
end if;
watchdog_reset_l <= '1';
if (watchdog_cnt = "1111") then
watchdog_reset_l <= '0';
end if;
-- simulation
-- pragma translate_off
-- synopsys translate_off
watchdog_reset_l <= not reset; -- watchdog disable
-- synopsys translate_on
-- pragma translate_on
end if;
end process;
-- other cpu signals
cpu_busrq_l <= '1';
cpu_nmi_l <= '1';
p_cpu_ena : process(hcnt, ena_6)
begin
cpu_ena <= '0';
if (ena_6 = '1') then
cpu_ena <= hcnt(0);
end if;
end process;
u_cpu : entity work.T80sed
port map (
RESET_n => watchdog_reset_l,
CLK_n => clk,
CLKEN => cpu_ena,
WAIT_n => cpu_wait_l,
INT_n => cpu_int_l,
NMI_n => cpu_nmi_l,
BUSRQ_n => cpu_busrq_l,
M1_n => cpu_m1_l,
MREQ_n => cpu_mreq_l,
IORQ_n => cpu_iorq_l,
RD_n => cpu_rd_l,
WR_n => open,
RFSH_n => cpu_rfsh_l,
HALT_n => open,
BUSAK_n => open,
A => cpu_addr,
DI => cpu_data_in,
DO => cpu_data_out
);
--
-- primary addr decode
--
p_mem_decode_comb : process(cpu_rfsh_l, cpu_rd_l, cpu_mreq_l, cpu_addr)
begin
-- rom 0x0000 - 0x3FFF
-- syncbus 0x4000 - 0x7FFF
-- 7M
-- 7N
sync_bus_cs_l <= '1';
-- program_rom_cs_l <= '1';
if (cpu_mreq_l = '0') and (cpu_rfsh_l = '1') then
-- if (cpu_addr(14) = '0') and (cpu_rd_l = '0') then
-- program_rom_cs_l <= '0';
-- end if;
if (cpu_addr(14) = '1') then
sync_bus_cs_l <= '0';
end if;
end if;
end process;
--
-- sync bus custom ic
--
p_sync_bus_reg : process
begin
wait until rising_edge(clk);
if (ena_6 = '1') then
-- register on sync bus module that is used to store interrupt vector
if (cpu_iorq_l = '0') and (cpu_m1_l = '1') then
cpu_vec_reg <= cpu_data_out;
end if;
-- read holding reg
if (hcnt(1 downto 0) = "01") then
sync_bus_reg <= cpu_data_in;
end if;
end if;
end process;
p_sync_bus_comb : process(cpu_rd_l, sync_bus_cs_l, hcnt)
begin
-- sync_bus_stb is now an active low clock enable signal
sync_bus_stb <= '1';
sync_bus_r_w_l <= '1';
if (sync_bus_cs_l = '0') and (hcnt(1) = '0') then
if (cpu_rd_l = '1') then
sync_bus_r_w_l <= '0';
end if;
sync_bus_stb <= '0';
end if;
sync_bus_wreq_l <= '1';
if (sync_bus_cs_l = '0') and (hcnt(1) = '1') and (cpu_rd_l = '0') then
sync_bus_wreq_l <= '0';
end if;
end process;
--
-- vram addr custom ic
--
u_vram_addr : entity work.PACMAN_VRAM_ADDR
port map (
AB => vram_addr_ab,
H256_L => hcnt(8),
H128 => hcnt(7),
H64 => hcnt(6),
H32 => hcnt(5),
H16 => hcnt(4),
H8 => hcnt(3),
H4 => hcnt(2),
H2 => hcnt(1),
H1 => hcnt(0),
V128 => vcnt(7),
V64 => vcnt(6),
V32 => vcnt(5),
V16 => vcnt(4),
V8 => vcnt(3),
V4 => vcnt(2),
V2 => vcnt(1),
V1 => vcnt(0),
FLIP => control_reg(3)
);
p_ab_mux_comb : process(hcnt, cpu_addr, vram_addr_ab)
begin
--When 2H is low, the CPU controls the bus.
if (hcnt(1) = '0') then
ab <= cpu_addr(11 downto 0);
else
ab <= vram_addr_ab;
end if;
end process;
p_vram_comb : process(hcnt, cpu_addr, sync_bus_stb)
variable a,b : std_logic;
begin
a := not (cpu_addr(12) or sync_bus_stb);
b := hcnt(1) and hcnt(0);
vram_l <= not (a or b);
end process;
p_io_decode_comb : process(sync_bus_r_w_l, sync_bus_stb, ab, cpu_addr)
variable sel : std_logic_vector(2 downto 0);
variable dec : std_logic_vector(7 downto 0);
variable selb : std_logic_vector(1 downto 0);
variable decb : std_logic_vector(3 downto 0);
begin
-- WRITE
-- out_l 0x5000 - 0x503F control space
-- wr0_l 0x5040 - 0x504F sound
-- wr1_l 0x5050 - 0x505F sound
-- wr2_l 0x5060 - 0x506F sprite
-- 0x5080 - 0x50BF unused
-- wdr_l 0x50C0 - 0x50FF watchdog reset
-- READ
-- in0_l 0x5000 - 0x503F in port 0
-- in1_l 0x5040 - 0x507F in port 1
-- dipsw_l 0x5080 - 0x50BF dip switches
-- 7J
dec := "11111111";
sel := sync_bus_r_w_l & ab(7) & ab(6);
if (cpu_addr(12) = '1') and ( sync_bus_stb = '0') then
case sel is
when "000" => dec := "11111110";
when "001" => dec := "11111101";
when "010" => dec := "11111011";
when "011" => dec := "11110111";
when "100" => dec := "11101111";
when "101" => dec := "11011111";
when "110" => dec := "10111111";
when "111" => dec := "01111111";
when others => null;
end case;
end if;
iodec_out_l <= dec(0);
iodec_wdr_l <= dec(3);
iodec_in0_l <= dec(4);
iodec_in1_l <= dec(5);
iodec_dipsw_l <= dec(6);
-- 7M
decb := "1111";
selb := ab(5) & ab(4);
if (dec(1) = '0') then
case selb is
when "00" => decb := "1110";
when "01" => decb := "1101";
when "10" => decb := "1011";
when "11" => decb := "0111";
when others => null;
end case;
end if;
wr0_l <= decb(0);
wr1_l <= decb(1);
wr2_l <= decb(2);
end process;
p_control_reg : process
variable ena : std_logic_vector(7 downto 0);
begin
-- 8 bit addressable latch 7K
-- (made into register)
-- 0 interrupt ena
-- 1 sound ena
-- 2 not used
-- 3 flip
-- 4 1 player start lamp
-- 5 2 player start lamp
-- 6 coin lockout
-- 7 coin counter
wait until rising_edge(clk);
if (ena_6 = '1') then
ena := "00000000";
if (iodec_out_l = '0') then
case ab(2 downto 0) is
when "000" => ena := "00000001";
when "001" => ena := "00000010";
when "010" => ena := "00000100";
when "011" => ena := "00001000";
when "100" => ena := "00010000";
when "101" => ena := "00100000";
when "110" => ena := "01000000";
when "111" => ena := "10000000";
when others => null;
end case;
end if;
if (watchdog_reset_l = '0') then
control_reg <= (others => '0');
else
for i in 0 to 7 loop
if (ena(i) = '1') then
control_reg(i) <= cpu_data_out(0);
end if;
end loop;
end if;
end if;
end process;
p_db_mux_comb : process(hcnt, cpu_data_out, rams_data_out)
begin
-- simplified data source for video subsystem
-- only cpu or ram are sources of interest
if (hcnt(1) = '0') then
sync_bus_db <= cpu_data_out;
else
sync_bus_db <= rams_data_out;
end if;
end process;
p_cpu_data_in_mux_comb : process(cpu_addr, cpu_iorq_l, cpu_m1_l, sync_bus_wreq_l,
iodec_in0_l, iodec_in1_l, iodec_dipsw_l, cpu_vec_reg, sync_bus_reg, rom_data,
rams_data_out, in0_reg, in1_reg, dipsw_reg)
begin
-- simplifed again
if (cpu_iorq_l = '0') and (cpu_m1_l = '0') then
cpu_data_in <= cpu_vec_reg;
elsif (sync_bus_wreq_l = '0') then
cpu_data_in <= sync_bus_reg;
else
if (cpu_addr(15 downto 14) = "00") then -- ROM at 0000 - 3fff
cpu_data_in <= rom_data;
elsif (cpu_addr(15 downto 13) = "100") then -- ROM at 8000 - 9fff
cpu_data_in <= rom_data;
else
cpu_data_in <= rams_data_out;
if (iodec_in0_l = '0') then cpu_data_in <= in0_reg; end if;
if (iodec_in1_l = '0') then cpu_data_in <= in1_reg; end if;
if (iodec_dipsw_l = '0') then cpu_data_in <= dipsw_reg; end if;
end if;
end if;
end process;
u_rams : work.dpram generic map (12,8)
port map
(
clk_a_i => clk,
en_a_i => ena_6,
we_i => not sync_bus_r_w_l and not vram_l,
addr_a_i => ab(11 downto 0),
data_a_i => cpu_data_out, -- cpu only source of ram data
clk_b_i => clk,
addr_b_i => ab(11 downto 0),
data_b_o => rams_data_out
);
u_program_rom0 : entity work.sprom
generic map (
init_file => "./roms/prog.hex",
widthad_a => 14,
width_a => 8)
port map (
address => cpu_addr(13 downto 0),
clock => clk,
q => rom_data
);
-- video subsystem
--
u_video : entity work.PACMAN_VIDEO
port map (
I_HCNT => hcnt,
I_VCNT => vcnt,
--
I_AB => ab,
I_DB => sync_bus_db,
--
I_HBLANK => hblank,
I_VBLANK => vblank,
I_FLIP => control_reg(3),
I_WR2_L => wr2_l,
--
O_RED => O_VIDEO_R,
O_GREEN => O_VIDEO_G,
O_BLUE => O_VIDEO_B,
--
ENA_6 => ena_6,
CLK => clk
);
O_HSYNC <= hSync;
O_VSYNC <= vSync;
--O_HBLANK <= hblank;
O_VBLANK <= vblank;
--
--
-- audio subsystem
--
u_audio : entity work.PACMAN_AUDIO
port map (
I_HCNT => hcnt,
--
I_AB => ab,
I_DB => sync_bus_db,
--
I_WR1_L => wr1_l,
I_WR0_L => wr0_l,
I_SOUND_ON => control_reg(1),
--
O_AUDIO => O_AUDIO,
ENA_6 => ena_6,
CLK => clk
);
button_in(9 downto 5) <= I_SW(4 downto 0);
button_in(4 downto 0) <= joystick_reg(4 downto 0);
button_in(14 downto 10) <= joystick_reg2(4 downto 0);
button_debounced <= button_in;
--button_debounced Arcade MegaWing Location
-- 8 RIGHT PushButton
-- 7 DOWN PushButton
-- 6 UP PushButton
-- 5 LEFT PushButton
-- 4 Fire Joystick
-- 3 RIGHT Joystick
-- 2 LEFT Joystick
-- 1 DOWN Joystick
-- 0 UP Joystick
p_input_registers : process
begin
wait until rising_edge(clk);
if (ena_6 = '1') then
-- on is low
in0_reg(7) <= '0'; -- IPT_SERVICE1
in0_reg(6) <= not button_debounced(7); -- coin2
in0_reg(5) <= not button_debounced(7); -- coin1
in0_reg(4) <= not button_debounced(9); -- "Rack Test (Cheat)"
in0_reg(3) <= button_debounced(1); -- p1 down
in0_reg(2) <= button_debounced(3); -- p1 right
in0_reg(1) <= button_debounced(2); -- p1 left
in0_reg(0) <= button_debounced(0); -- p1 up
in1_reg(7) <= '1'; -- unused
in1_reg(6) <= not button_debounced(8); -- start2 RIGHT PushButton
in1_reg(5) <= not button_debounced(5); -- start1 LEFT PushButton
in1_reg(4) <= not button_debounced(6); -- Service Mode
in1_reg(3) <= button_debounced(11); -- p2 down
in1_reg(2) <= button_debounced(13); -- p2 right
in1_reg(1) <= button_debounced(12); -- p2 left
in1_reg(0) <= button_debounced(10); -- p2 up
-- on is low
freeze <= '0';
dipsw_reg(7) <= '1'; -- Stop Screen
dipsw_reg(5) <= '1'; -- Unused
dipsw_reg(5) <= '1'; -- Skip Screen
dipsw_reg(4) <= '0'; -- Cabinet
dipsw_reg(3 downto 2) <= "10"; -- Lives (3)
dipsw_reg(1 downto 0) <= "01"; -- cost (1 coin, 1 play)
end if;
end process;
end RTL;

View File

@@ -1,213 +0,0 @@
--
-- A simulation model of Pacman hardware
-- Copyright (c) MikeJ - January 2006
--
-- 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 CODE 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.
--
-- You are responsible for any legal issues arising from your use of this code.
--
-- The latest version of this file can be found at: www.fpgaarcade.com
--
-- Email pacman@fpgaarcade.com
--
-- Revision list
--
-- version 003 Jan 2006 release, general tidy up
-- version 002 added volume multiplier
-- version 001 initial release
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
library UNISIM;
entity PACMAN_AUDIO is
port (
I_HCNT : in std_logic_vector(8 downto 0);
--
I_AB : in std_logic_vector(11 downto 0);
I_DB : in std_logic_vector( 7 downto 0);
--
I_WR1_L : in std_logic;
I_WR0_L : in std_logic;
I_SOUND_ON : in std_logic;
--
O_AUDIO : out std_logic_vector(7 downto 0);
ENA_6 : in std_logic;
CLK : in std_logic
);
end;
architecture RTL of PACMAN_AUDIO is
signal addr : std_logic_vector(3 downto 0);
signal data : std_logic_vector(3 downto 0);
signal vol_ram_dout : std_logic_vector(3 downto 0);
signal frq_ram_dout : std_logic_vector(3 downto 0);
signal sum : std_logic_vector(5 downto 0);
signal accum_reg : std_logic_vector(5 downto 0);
signal rom3m_n : std_logic_vector(15 downto 0);
signal rom3m_w : std_logic_vector(3 downto 0);
signal rom3m : std_logic_vector(3 downto 0);
signal rom1m_addr : std_logic_vector(7 downto 0);
signal rom1m_data : std_logic_vector(7 downto 0);
begin
p_sel_com : process(I_HCNT, I_AB, I_DB, accum_reg)
begin
if (I_HCNT(1) = '0') then -- 2h,
addr <= I_AB(3 downto 0);
data <= I_DB(3 downto 0); -- removed invert
else
addr <= I_HCNT(5 downto 2);
data <= accum_reg(4 downto 1);
end if;
end process;
vol_ram : work.dpram generic map (4,4)
port map
(
clk_a_i => CLK,
en_a_i => ENA_6,
we_i => not I_WR1_L,
addr_a_i => addr(3 downto 0),
data_a_i => data,
clk_b_i => CLK,
addr_b_i => addr(3 downto 0),
data_b_o => vol_ram_dout
);
frq_ram : work.dpram generic map (4,4)
port map
(
clk_a_i => CLK,
en_a_i => ENA_6,
we_i => rom3m(1),
addr_a_i => addr(3 downto 0),
data_a_i => data,
clk_b_i => CLK,
addr_b_i => addr(3 downto 0),
data_b_o => frq_ram_dout
);
p_control_rom_comb : process(I_HCNT)
begin
rom3m_n <= x"0000"; rom3m_w <= x"0"; -- default assign
case I_HCNT(3 downto 0) is
when x"0" => rom3m_n <= x"0008"; rom3m_w <= x"0";
when x"1" => rom3m_n <= x"0000"; rom3m_w <= x"2";
when x"2" => rom3m_n <= x"1111"; rom3m_w <= x"0";
when x"3" => rom3m_n <= x"2222"; rom3m_w <= x"0";
when x"4" => rom3m_n <= x"0000"; rom3m_w <= x"0";
when x"5" => rom3m_n <= x"0000"; rom3m_w <= x"2";
when x"6" => rom3m_n <= x"1101"; rom3m_w <= x"0";
when x"7" => rom3m_n <= x"2242"; rom3m_w <= x"0";
when x"8" => rom3m_n <= x"0080"; rom3m_w <= x"0";
when x"9" => rom3m_n <= x"0000"; rom3m_w <= x"2";
when x"A" => rom3m_n <= x"1011"; rom3m_w <= x"0";
when x"B" => rom3m_n <= x"2422"; rom3m_w <= x"0";
when x"C" => rom3m_n <= x"0800"; rom3m_w <= x"0";
when x"D" => rom3m_n <= x"0000"; rom3m_w <= x"2";
when x"E" => rom3m_n <= x"0111"; rom3m_w <= x"0";
when x"F" => rom3m_n <= x"4222"; rom3m_w <= x"0";
when others => null;
end case;
end process;
p_control_rom_op_comb : process(I_HCNT, I_WR0_L, rom3m_n, rom3m_w)
begin
rom3m <= rom3m_w;
if (I_WR0_L = '1') then
case I_HCNT(5 downto 4) is
when "00" => rom3m <= rom3m_n( 3 downto 0);
when "01" => rom3m <= rom3m_n( 7 downto 4);
when "10" => rom3m <= rom3m_n(11 downto 8);
when "11" => rom3m <= rom3m_n(15 downto 12);
when others => null;
end case;
end if;
end process;
p_adder : process(vol_ram_dout, frq_ram_dout, accum_reg)
begin
-- 1K 4 bit adder
sum <= ('0' & vol_ram_dout & '1') + ('0' & frq_ram_dout & accum_reg(5));
end process;
p_accum_reg : process
begin
-- 1L
wait until rising_edge(CLK);
if (ENA_6 = '1') then
if (rom3m(3) = '1') then -- clear
accum_reg <= "000000";
elsif (rom3m(0) = '1') then -- rising edge clk
accum_reg <= sum(5 downto 1) & accum_reg(4);
end if;
end if;
end process;
p_rom_1m_addr_comb : process(accum_reg, frq_ram_dout)
begin
rom1m_addr(7 downto 5) <= frq_ram_dout(2 downto 0);
rom1m_addr(4 downto 0) <= accum_reg(4 downto 0);
end process;
audio_rom_1m : entity work.sprom
generic map (
init_file => "./roms/prom1.hex",
widthad_a => 8,
width_a => 8)
port map (
address => rom1m_addr,
clock => CLK,
q => rom1m_data
);
p_original_output_reg : process
begin
-- 2m used to use async clear
wait until rising_edge(CLK);
if (ENA_6 = '1') then
if (I_SOUND_ON = '0') then
O_AUDIO <= "00000000";
elsif (rom3m(2) = '1') then
O_AUDIO <= vol_ram_dout(3 downto 0) * rom1m_data(3 downto 0);
end if;
end if;
end process;
end architecture RTL;

View File

@@ -1,372 +0,0 @@
--
-- A simulation model of Pacman hardware
-- Copyright (c) MikeJ - January 2006
--
-- 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 CODE 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.
--
-- You are responsible for any legal issues arising from your use of this code.
--
-- The latest version of this file can be found at: www.fpgaarcade.com
--
-- Email pacman@fpgaarcade.com
--
-- Revision list
--
-- version 003 Jan 2006 release, general tidy up
-- version 001 initial release
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
library UNISIM;
entity PACMAN_VIDEO is
port (
I_HCNT : in std_logic_vector(8 downto 0);
I_VCNT : in std_logic_vector(8 downto 0);
--
I_AB : in std_logic_vector(11 downto 0);
I_DB : in std_logic_vector( 7 downto 0);
--
I_HBLANK : in std_logic;
I_VBLANK : in std_logic;
I_FLIP : in std_logic;
I_WR2_L : in std_logic;
--
O_RED : out std_logic_vector(2 downto 0);
O_GREEN : out std_logic_vector(2 downto 0);
O_BLUE : out std_logic_vector(1 downto 0);
ENA_6 : in std_logic;
CLK : in std_logic
);
end;
architecture RTL of PACMAN_VIDEO is
signal sprite_xy_ram_temp : std_logic_vector(7 downto 0);
signal dr : std_logic_vector(7 downto 0);
signal char_reg : std_logic_vector(7 downto 0);
signal char_sum_reg : std_logic_vector(3 downto 0);
signal char_match_reg : std_logic;
signal char_hblank_reg : std_logic;
signal char_hblank_reg_t1 : std_logic;
signal db_reg : std_logic_vector(7 downto 0);
signal xflip : std_logic;
signal yflip : std_logic;
signal obj_on : std_logic;
signal ca : std_logic_vector(12 downto 0);
signal char_rom_5ef_dout : std_logic_vector(7 downto 0);
signal shift_regl : std_logic_vector(3 downto 0);
signal shift_regu : std_logic_vector(3 downto 0);
signal shift_op : std_logic_vector(1 downto 0);
signal shift_sel : std_logic_vector(1 downto 0);
signal vout_obj_on : std_logic;
signal vout_yflip : std_logic;
signal vout_hblank : std_logic;
signal vout_db : std_logic_vector(4 downto 0);
signal cntr_ld : std_logic;
signal ra : std_logic_vector(7 downto 0);
signal sprite_ram_ip : std_logic_vector(3 downto 0);
signal sprite_ram_op : std_logic_vector(3 downto 0);
signal sprite_ram_addr : std_logic_vector(7 downto 0);
signal sprite_ram_addr_t1 : std_logic_vector(7 downto 0);
signal vout_obj_on_t1 : std_logic;
signal col_rom_addr : std_logic_vector(7 downto 0);
signal lut_4a : std_logic_vector(7 downto 0);
signal lut_4a_t1 : std_logic_vector(7 downto 0);
signal vout_hblank_t1 : std_logic;
signal sprite_ram_reg : std_logic_vector(3 downto 0);
signal video_out : std_logic_vector(7 downto 0);
signal video_op_sel : std_logic;
signal final_col : std_logic_vector(3 downto 0);
begin
-- ram enable is low when HBLANK_L is 0 (for sprite access) or
-- 2H is low (for cpu writes)
-- we can simplify this
dr <= not sprite_xy_ram_temp when I_HBLANK = '1' else "11111111"; -- pull ups on board
sprite_xy_ram : work.dpram generic map (4,8)
port map
(
clk_a_i => CLK,
en_a_i => ENA_6,
we_i => not I_WR2_L,
addr_a_i => I_AB(3 downto 0),
data_a_i => I_DB,
clk_b_i => CLK,
addr_b_i => I_AB(3 downto 0),
data_b_o => sprite_xy_ram_temp
);
p_char_regs : process
variable inc : std_logic;
variable sum : std_logic_vector(8 downto 0);
variable match : std_logic;
begin
wait until rising_edge (CLK);
if (I_HCNT(2 downto 0) = "011") and (ENA_6 = '1') then -- rising 4h
inc := (not I_HBLANK);
-- 1f, 2f
sum := (I_VCNT(7 downto 0) & '1') + (dr & inc);
-- 3e
match := '0';
if (sum(8 downto 5) = "1111") then
match := '1';
end if;
-- 1h
char_sum_reg <= sum(4 downto 1);
char_match_reg <= match;
char_hblank_reg <= I_HBLANK;
-- 4d
db_reg <= I_DB; -- character reg
end if;
end process;
p_flip_comb : process(char_hblank_reg, I_FLIP, db_reg)
begin
if (char_hblank_reg = '0') then
xflip <= I_FLIP;
yflip <= I_FLIP;
else
xflip <= db_reg(1);
yflip <= db_reg(0);
end if;
end process;
p_char_addr_comb : process(db_reg, I_HCNT,
char_match_reg, char_sum_reg, char_hblank_reg,
xflip, yflip)
begin
-- 2h, 4e
obj_on <= char_match_reg or I_HCNT(8); -- 256h not 256h_l
ca(12) <= char_hblank_reg;
ca(11 downto 6) <= db_reg(7 downto 2);
if (char_hblank_reg = '0') then
ca(5) <= db_reg(1);
ca(4) <= db_reg(0);
else
ca(5) <= char_sum_reg(3) xor xflip;
ca(4) <= I_HCNT(3);
end if;
ca(3) <= I_HCNT(2) xor yflip;
ca(2) <= char_sum_reg(2) xor xflip;
ca(1) <= char_sum_reg(1) xor xflip;
ca(0) <= char_sum_reg(0) xor xflip;
end process;
-- char roms
char_rom_5ef : entity work.sprom
generic map (
init_file => "./roms/gfx.hex",
widthad_a => 13,
width_a => 8)
port map (
address => ca,
clock => CLK,
q => char_rom_5ef_dout
);
p_char_shift : process
begin
-- 4 bit shift req
wait until rising_edge (CLK);
if (ENA_6 = '1') then
case shift_sel is
when "00" => null;
when "01" => shift_regu <= '0' & shift_regu(3 downto 1);
shift_regl <= '0' & shift_regl(3 downto 1);
when "10" => shift_regu <= shift_regu(2 downto 0) & '0';
shift_regl <= shift_regl(2 downto 0) & '0';
when "11" => shift_regu <= char_rom_5ef_dout(7 downto 4); -- load
shift_regl <= char_rom_5ef_dout(3 downto 0);
when others => null;
end case;
end if;
end process;
p_char_shift_comb : process(I_HCNT, vout_yflip, shift_regu, shift_regl)
variable ip : std_logic;
begin
ip := I_HCNT(0) and I_HCNT(1);
if (vout_yflip = '0') then
shift_sel(0) <= ip;
shift_sel(1) <= '1';
shift_op(0) <= shift_regl(3);
shift_op(1) <= shift_regu(3);
else
shift_sel(0) <= '1';
shift_sel(1) <= ip;
shift_op(0) <= shift_regl(0);
shift_op(1) <= shift_regu(0);
end if;
end process;
p_video_out_reg : process
begin
wait until rising_edge (CLK);
if (ENA_6 = '1') then
if (I_HCNT(2 downto 0) = "111") then
vout_obj_on <= obj_on;
vout_yflip <= yflip;
vout_hblank <= I_HBLANK;
vout_db(4 downto 0) <= I_DB(4 downto 0); -- colour reg
end if;
end if;
end process;
p_lut_4a_comb : process(vout_db, shift_op)
begin
col_rom_addr <= '0' & vout_db(4 downto 0) & shift_op(1 downto 0);
end process;
col_rom_4a : entity work.sprom
generic map (
init_file => "./roms/prom4.hex",
widthad_a => 8,
width_a => 8)
port map (
address => col_rom_addr,
clock => CLK,
q => lut_4a
);
cntr_ld <= '1' when (I_HCNT(3 downto 0) = "0111") and (vout_hblank='1' or vout_obj_on='0') else '0';
p_ra_cnt : process
begin
wait until rising_edge (CLK);
if (ENA_6 = '1') then
if (cntr_ld = '1') then
ra <= dr;
else
ra <= ra + "1";
end if;
end if;
end process;
sprite_ram_addr <= ra;
u_sprite_ram : work.dpram generic map (8,4)
port map
(
clk_a_i => CLK,
en_a_i => ENA_6,
we_i => vout_obj_on,
addr_a_i => sprite_ram_addr,
data_a_i => sprite_ram_ip,
clk_b_i => CLK,
addr_b_i => sprite_ram_addr,
data_b_o => sprite_ram_op
);
sprite_ram_reg <= sprite_ram_op when vout_obj_on_t1 = '1' else "0000";
video_op_sel <= '1' when not (sprite_ram_reg = "0000") else '0';
p_sprite_ram_ip_reg : process
begin
wait until rising_edge (CLK);
if (ENA_6 = '1') then
vout_obj_on_t1 <= vout_obj_on;
vout_hblank_t1 <= vout_hblank;
lut_4a_t1 <= lut_4a;
end if;
end process;
p_sprite_ram_ip_comb : process(vout_hblank_t1, video_op_sel, sprite_ram_reg, lut_4a_t1)
begin
-- 3a
if (vout_hblank_t1 = '0') then
sprite_ram_ip <= (others => '0');
else
if (video_op_sel = '1') then
sprite_ram_ip <= sprite_ram_reg;
else
sprite_ram_ip <= lut_4a_t1(3 downto 0);
end if;
end if;
end process;
p_video_op_comb : process(vout_hblank, I_VBLANK, video_op_sel, sprite_ram_reg, lut_4a)
begin
-- 3b
if (vout_hblank = '1') or (I_VBLANK = '1') then
final_col <= (others => '0');
else
if (video_op_sel = '1') then
final_col <= sprite_ram_reg; -- sprite
else
final_col <= lut_4a(3 downto 0);
end if;
end if;
end process;
col : entity work.sprom
generic map (
init_file => "./roms/col.hex",
widthad_a => 4,
width_a => 8)
port map (
address => final_col,
clock => CLK,
q => video_out
);
-- assign outputs
O_BLUE (1 downto 0) <= video_out(7 downto 6);
O_GREEN(2 downto 0) <= video_out(5 downto 3);
O_RED (2 downto 0) <= video_out(2 downto 0);
end architecture;

View File

@@ -1,273 +0,0 @@
--
-- A simulation model of Pacman hardware
-- Copyright (c) MikeJ & CarlW - January 2006
--
-- 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 CODE 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.
--
-- You are responsible for any legal issues arising from your use of this code.
--
-- The latest version of this file can be found at: www.fpgaarcade.com
--
-- Email pacman@fpgaarcade.com
--
-- Revision list
--
-- version 003 Jan 2006 release, general tidy up
-- version 001 initial release
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity X74_157 is
port (
Y : out std_logic_vector (3 downto 0);
B : in std_logic_vector (3 downto 0);
A : in std_logic_vector (3 downto 0);
G : in std_logic;
S : in std_logic
);
end;
architecture RTL of X74_157 is
begin
p_y_comb : process(S,G,A,B)
begin
for i in 0 to 3 loop
-- quad 2 line to 1 line mux (true logic)
if (G = '1') then
Y(i) <= '0';
else
if (S = '0') then
Y(i) <= A(i);
else
Y(i) <= B(i);
end if;
end if;
end loop;
end process;
end RTL;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity X74_257 is
port (
Y : out std_logic_vector (3 downto 0);
B : in std_logic_vector (3 downto 0);
A : in std_logic_vector (3 downto 0);
S : in std_logic
);
end;
architecture RTL of X74_257 is
signal ab : std_logic_vector (3 downto 0);
begin
Y <= ab; -- no tristate
p_ab : process(S,A,B)
begin
for i in 0 to 3 loop
if (S = '0') then
AB(i) <= A(i);
else
AB(i) <= B(i);
end if;
end loop;
end process;
end RTL;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity PACMAN_VRAM_ADDR is
port (
AB : out std_logic_vector (11 downto 0);
H256_L : in std_logic;
H128 : in std_logic;
H64 : in std_logic;
H32 : in std_logic;
H16 : in std_logic;
H8 : in std_logic;
H4 : in std_logic;
H2 : in std_logic;
H1 : in std_logic;
V128 : in std_logic;
V64 : in std_logic;
V32 : in std_logic;
V16 : in std_logic;
V8 : in std_logic;
V4 : in std_logic;
V2 : in std_logic;
V1 : in std_logic;
FLIP : in std_logic
);
end;
architecture RTL of PACMAN_VRAM_ADDR is
signal v128p : std_logic;
signal v64p : std_logic;
signal v32p : std_logic;
signal v16p : std_logic;
signal v8p : std_logic;
signal h128p : std_logic;
signal h64p : std_logic;
signal h32p : std_logic;
signal h16p : std_logic;
signal h8p : std_logic;
signal sel : std_logic;
signal y157 : std_logic_vector (11 downto 0);
component X74_157
port (
Y : out std_logic_vector (3 downto 0);
B : in std_logic_vector (3 downto 0);
A : in std_logic_vector (3 downto 0);
G : in std_logic;
S : in std_logic
);
end component;
component X74_257
port (
Y : out std_logic_vector (3 downto 0);
B : in std_logic_vector (3 downto 0);
A : in std_logic_vector (3 downto 0);
S : in std_logic
);
end component;
begin
p_vp_comb : process(FLIP, V8, V16, V32, V64, V128)
begin
v128p <= FLIP xor V128;
v64p <= FLIP xor V64;
v32p <= FLIP xor V32;
v16p <= FLIP xor V16;
v8p <= FLIP xor V8;
end process;
p_hp_comb : process(FLIP, H8, H16, H32, H64, H128)
begin
H128P <= FLIP xor H128;
H64P <= FLIP xor H64;
H32P <= FLIP xor H32;
H16P <= FLIP xor H16;
H8P <= FLIP xor H8;
end process;
p_sel : process(H16, H32, H64)
begin
sel <= not((H32 xor H16) or (H32 xor H64));
end process;
--p_oe257 : process(H2)
--begin
-- oe <= not(H2);
--end process;
U6 : X74_157
port map(
Y => y157(11 downto 8),
B(3) => '0',
B(2) => H4,
B(1) => h64p,
B(0) => h64p,
A => "1111",
G => '0',
S => sel
);
U5 : X74_157
port map(
Y => y157(7 downto 4),
B(3) => h64p,
B(2) => h64p,
B(1) => h8p,
B(0) => v128p,
A => "1111",
G => '0',
S => sel
);
U4 : X74_157
port map(
Y => y157(3 downto 0),
B(3) => v64p,
B(2) => v32p,
B(1) => v16p,
B(0) => v8p,
A(3) => H64,
A(2) => H32,
A(1) => H16,
A(0) => H4,
G => '0',
S => sel
);
U3 : X74_257
port map(
Y => AB(11 downto 8),
B(3) => '0',
B(2) => H4,
B(1) => v128p,
B(0) => v64p,
A => y157(11 downto 8),
S => H256_L
);
U2 : X74_257
port map(
Y => AB(7 downto 4),
B(3) => v32p,
B(2) => v16p,
B(1) => v8p,
B(0) => h128p,
A => y157(7 downto 4),
S => H256_L
);
U1 : X74_257
port map(
Y => AB(3 downto 0),
B(3) => h64p,
B(2) => h32p,
B(1) => h16p,
B(0) => h8p,
A => y157(3 downto 0),
S => H256_L
);
end RTL;

View File

@@ -1,4 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ALTPLL"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) "pll.v"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "pll.ppf"]

View File

@@ -1,320 +0,0 @@
// megafunction wizard: %ALTPLL%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altpll
// ============================================================
// File Name: pll.v
// Megafunction Name(s):
// altpll
//
// Simulation Library Files(s):
// altera_mf
// ============================================================
// ************************************************************
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
//
// 13.1.0 Build 162 10/23/2013 SJ Web Edition
// ************************************************************
//Copyright (C) 1991-2013 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 pll (
areset,
inclk0,
c0,
locked);
input areset;
input inclk0;
output c0;
output locked;
`ifndef ALTERA_RESERVED_QIS
// synopsys translate_off
`endif
tri0 areset;
`ifndef ALTERA_RESERVED_QIS
// synopsys translate_on
`endif
wire sub_wire0;
wire [4:0] sub_wire1;
wire [0:0] sub_wire5 = 1'h0;
wire locked = sub_wire0;
wire [0:0] sub_wire2 = sub_wire1[0:0];
wire c0 = sub_wire2;
wire sub_wire3 = inclk0;
wire [1:0] sub_wire4 = {sub_wire5, sub_wire3};
altpll altpll_component (
.areset (areset),
.inclk (sub_wire4),
.locked (sub_wire0),
.clk (sub_wire1),
.activeclock (),
.clkbad (),
.clkena ({6{1'b1}}),
.clkloss (),
.clkswitch (1'b0),
.configupdate (1'b0),
.enable0 (),
.enable1 (),
.extclk (),
.extclkena ({4{1'b1}}),
.fbin (1'b1),
.fbmimicbidir (),
.fbout (),
.fref (),
.icdrclk (),
.pfdena (1'b1),
.phasecounterselect ({4{1'b1}}),
.phasedone (),
.phasestep (1'b1),
.phaseupdown (1'b1),
.pllena (1'b1),
.scanaclr (1'b0),
.scanclk (1'b0),
.scanclkena (1'b1),
.scandata (1'b0),
.scandataout (),
.scandone (),
.scanread (1'b0),
.scanwrite (1'b0),
.sclkout0 (),
.sclkout1 (),
.vcooverrange (),
.vcounderrange ());
defparam
altpll_component.bandwidth_type = "AUTO",
altpll_component.clk0_divide_by = 9,
altpll_component.clk0_duty_cycle = 50,
altpll_component.clk0_multiply_by = 8,
altpll_component.clk0_phase_shift = "0",
altpll_component.compensate_clock = "CLK0",
altpll_component.inclk0_input_frequency = 37037,
altpll_component.intended_device_family = "Cyclone III",
altpll_component.lpm_hint = "CBX_MODULE_PREFIX=pll",
altpll_component.lpm_type = "altpll",
altpll_component.operation_mode = "NORMAL",
altpll_component.pll_type = "AUTO",
altpll_component.port_activeclock = "PORT_UNUSED",
altpll_component.port_areset = "PORT_USED",
altpll_component.port_clkbad0 = "PORT_UNUSED",
altpll_component.port_clkbad1 = "PORT_UNUSED",
altpll_component.port_clkloss = "PORT_UNUSED",
altpll_component.port_clkswitch = "PORT_UNUSED",
altpll_component.port_configupdate = "PORT_UNUSED",
altpll_component.port_fbin = "PORT_UNUSED",
altpll_component.port_inclk0 = "PORT_USED",
altpll_component.port_inclk1 = "PORT_UNUSED",
altpll_component.port_locked = "PORT_USED",
altpll_component.port_pfdena = "PORT_UNUSED",
altpll_component.port_phasecounterselect = "PORT_UNUSED",
altpll_component.port_phasedone = "PORT_UNUSED",
altpll_component.port_phasestep = "PORT_UNUSED",
altpll_component.port_phaseupdown = "PORT_UNUSED",
altpll_component.port_pllena = "PORT_UNUSED",
altpll_component.port_scanaclr = "PORT_UNUSED",
altpll_component.port_scanclk = "PORT_UNUSED",
altpll_component.port_scanclkena = "PORT_UNUSED",
altpll_component.port_scandata = "PORT_UNUSED",
altpll_component.port_scandataout = "PORT_UNUSED",
altpll_component.port_scandone = "PORT_UNUSED",
altpll_component.port_scanread = "PORT_UNUSED",
altpll_component.port_scanwrite = "PORT_UNUSED",
altpll_component.port_clk0 = "PORT_USED",
altpll_component.port_clk1 = "PORT_UNUSED",
altpll_component.port_clk2 = "PORT_UNUSED",
altpll_component.port_clk3 = "PORT_UNUSED",
altpll_component.port_clk4 = "PORT_UNUSED",
altpll_component.port_clk5 = "PORT_UNUSED",
altpll_component.port_clkena0 = "PORT_UNUSED",
altpll_component.port_clkena1 = "PORT_UNUSED",
altpll_component.port_clkena2 = "PORT_UNUSED",
altpll_component.port_clkena3 = "PORT_UNUSED",
altpll_component.port_clkena4 = "PORT_UNUSED",
altpll_component.port_clkena5 = "PORT_UNUSED",
altpll_component.port_extclk0 = "PORT_UNUSED",
altpll_component.port_extclk1 = "PORT_UNUSED",
altpll_component.port_extclk2 = "PORT_UNUSED",
altpll_component.port_extclk3 = "PORT_UNUSED",
altpll_component.self_reset_on_loss_lock = "OFF",
altpll_component.width_clock = 5;
endmodule
// ============================================================
// CNX file retrieval info
// ============================================================
// Retrieval info: PRIVATE: ACTIVECLK_CHECK STRING "0"
// Retrieval info: PRIVATE: BANDWIDTH STRING "1.000"
// Retrieval info: PRIVATE: BANDWIDTH_FEATURE_ENABLED STRING "1"
// Retrieval info: PRIVATE: BANDWIDTH_FREQ_UNIT STRING "MHz"
// Retrieval info: PRIVATE: BANDWIDTH_PRESET STRING "Low"
// Retrieval info: PRIVATE: BANDWIDTH_USE_AUTO STRING "1"
// Retrieval info: PRIVATE: BANDWIDTH_USE_PRESET STRING "0"
// Retrieval info: PRIVATE: CLKBAD_SWITCHOVER_CHECK STRING "0"
// Retrieval info: PRIVATE: CLKLOSS_CHECK STRING "0"
// Retrieval info: PRIVATE: CLKSWITCH_CHECK STRING "0"
// Retrieval info: PRIVATE: CNX_NO_COMPENSATE_RADIO STRING "0"
// Retrieval info: PRIVATE: CREATE_CLKBAD_CHECK STRING "0"
// Retrieval info: PRIVATE: CREATE_INCLK1_CHECK STRING "0"
// Retrieval info: PRIVATE: CUR_DEDICATED_CLK STRING "c0"
// Retrieval info: PRIVATE: CUR_FBIN_CLK STRING "c0"
// Retrieval info: PRIVATE: DEVICE_SPEED_GRADE STRING "8"
// Retrieval info: PRIVATE: DIV_FACTOR0 NUMERIC "9"
// Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
// Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE0 STRING "24.000000"
// Retrieval info: PRIVATE: EXPLICIT_SWITCHOVER_COUNTER STRING "0"
// Retrieval info: PRIVATE: EXT_FEEDBACK_RADIO STRING "0"
// Retrieval info: PRIVATE: GLOCKED_COUNTER_EDIT_CHANGED STRING "1"
// Retrieval info: PRIVATE: GLOCKED_FEATURE_ENABLED STRING "0"
// Retrieval info: PRIVATE: GLOCKED_MODE_CHECK STRING "0"
// Retrieval info: PRIVATE: GLOCK_COUNTER_EDIT NUMERIC "1048575"
// Retrieval info: PRIVATE: HAS_MANUAL_SWITCHOVER STRING "1"
// Retrieval info: PRIVATE: INCLK0_FREQ_EDIT STRING "27.000"
// Retrieval info: PRIVATE: INCLK0_FREQ_UNIT_COMBO STRING "MHz"
// Retrieval info: PRIVATE: INCLK1_FREQ_EDIT STRING "100.000"
// Retrieval info: PRIVATE: INCLK1_FREQ_EDIT_CHANGED STRING "1"
// Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_CHANGED STRING "1"
// Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_COMBO STRING "MHz"
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
// Retrieval info: PRIVATE: INT_FEEDBACK__MODE_RADIO STRING "1"
// Retrieval info: PRIVATE: LOCKED_OUTPUT_CHECK STRING "1"
// Retrieval info: PRIVATE: LONG_SCAN_RADIO STRING "1"
// Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE STRING "Not Available"
// Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE_DIRTY NUMERIC "0"
// Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT0 STRING "deg"
// Retrieval info: PRIVATE: MIG_DEVICE_SPEED_GRADE STRING "Any"
// Retrieval info: PRIVATE: MIRROR_CLK0 STRING "0"
// Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "8"
// Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
// Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "24.00000000"
// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "0"
// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
// Retrieval info: PRIVATE: PHASE_RECONFIG_FEATURE_ENABLED STRING "1"
// Retrieval info: PRIVATE: PHASE_RECONFIG_INPUTS_CHECK STRING "0"
// Retrieval info: PRIVATE: PHASE_SHIFT0 STRING "0.00000000"
// Retrieval info: PRIVATE: PHASE_SHIFT_STEP_ENABLED_CHECK STRING "0"
// Retrieval info: PRIVATE: PHASE_SHIFT_UNIT0 STRING "deg"
// Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0"
// Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "1"
// Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1"
// Retrieval info: PRIVATE: PLL_ENHPLL_CHECK NUMERIC "0"
// Retrieval info: PRIVATE: PLL_FASTPLL_CHECK NUMERIC "0"
// Retrieval info: PRIVATE: PLL_FBMIMIC_CHECK STRING "0"
// Retrieval info: PRIVATE: PLL_LVDS_PLL_CHECK NUMERIC "0"
// Retrieval info: PRIVATE: PLL_PFDENA_CHECK STRING "0"
// Retrieval info: PRIVATE: PLL_TARGET_HARCOPY_CHECK NUMERIC "0"
// Retrieval info: PRIVATE: PRIMARY_CLK_COMBO STRING "inclk0"
// Retrieval info: PRIVATE: RECONFIG_FILE STRING "pll.mif"
// Retrieval info: PRIVATE: SACN_INPUTS_CHECK STRING "0"
// Retrieval info: PRIVATE: SCAN_FEATURE_ENABLED STRING "1"
// Retrieval info: PRIVATE: SELF_RESET_LOCK_LOSS STRING "0"
// Retrieval info: PRIVATE: SHORT_SCAN_RADIO STRING "0"
// Retrieval info: PRIVATE: SPREAD_FEATURE_ENABLED STRING "0"
// Retrieval info: PRIVATE: SPREAD_FREQ STRING "50.000"
// Retrieval info: PRIVATE: SPREAD_FREQ_UNIT STRING "KHz"
// Retrieval info: PRIVATE: SPREAD_PERCENT STRING "0.500"
// Retrieval info: PRIVATE: SPREAD_USE STRING "0"
// Retrieval info: PRIVATE: SRC_SYNCH_COMP_RADIO STRING "0"
// Retrieval info: PRIVATE: STICKY_CLK0 STRING "1"
// Retrieval info: PRIVATE: SWITCHOVER_COUNT_EDIT NUMERIC "1"
// Retrieval info: PRIVATE: SWITCHOVER_FEATURE_ENABLED STRING "1"
// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
// Retrieval info: PRIVATE: USE_CLK0 STRING "1"
// Retrieval info: PRIVATE: USE_CLKENA0 STRING "0"
// Retrieval info: PRIVATE: USE_MIL_SPEED_GRADE NUMERIC "0"
// Retrieval info: PRIVATE: ZERO_DELAY_RADIO STRING "0"
// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
// Retrieval info: CONSTANT: BANDWIDTH_TYPE STRING "AUTO"
// Retrieval info: CONSTANT: CLK0_DIVIDE_BY NUMERIC "9"
// Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
// Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "8"
// Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
// Retrieval info: CONSTANT: COMPENSATE_CLOCK STRING "CLK0"
// Retrieval info: CONSTANT: INCLK0_INPUT_FREQUENCY NUMERIC "37037"
// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
// Retrieval info: CONSTANT: LPM_TYPE STRING "altpll"
// Retrieval info: CONSTANT: OPERATION_MODE STRING "NORMAL"
// Retrieval info: CONSTANT: PLL_TYPE STRING "AUTO"
// Retrieval info: CONSTANT: PORT_ACTIVECLOCK STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_ARESET STRING "PORT_USED"
// Retrieval info: CONSTANT: PORT_CLKBAD0 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_CLKBAD1 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_CLKLOSS STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_CLKSWITCH STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_CONFIGUPDATE STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_FBIN STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_INCLK0 STRING "PORT_USED"
// Retrieval info: CONSTANT: PORT_INCLK1 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_LOCKED STRING "PORT_USED"
// Retrieval info: CONSTANT: PORT_PFDENA STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_PHASECOUNTERSELECT STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_PHASEDONE STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_PHASESTEP STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_PHASEUPDOWN STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_PLLENA STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_SCANACLR STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_SCANCLK STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_SCANCLKENA STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_SCANDATA STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_SCANDATAOUT STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_SCANDONE STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_SCANREAD STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_SCANWRITE STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clk0 STRING "PORT_USED"
// Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clk2 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clk4 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clk5 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clkena0 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clkena1 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clkena2 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clkena3 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clkena4 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_clkena5 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_extclk0 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_extclk1 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_extclk2 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: PORT_extclk3 STRING "PORT_UNUSED"
// Retrieval info: CONSTANT: SELF_RESET_ON_LOSS_LOCK STRING "OFF"
// Retrieval info: CONSTANT: WIDTH_CLOCK NUMERIC "5"
// Retrieval info: USED_PORT: @clk 0 0 5 0 OUTPUT_CLK_EXT VCC "@clk[4..0]"
// Retrieval info: USED_PORT: areset 0 0 0 0 INPUT GND "areset"
// Retrieval info: USED_PORT: c0 0 0 0 0 OUTPUT_CLK_EXT VCC "c0"
// Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0"
// Retrieval info: USED_PORT: locked 0 0 0 0 OUTPUT GND "locked"
// Retrieval info: CONNECT: @areset 0 0 0 0 areset 0 0 0 0
// Retrieval info: CONNECT: @inclk 0 0 1 1 GND 0 0 0 0
// Retrieval info: CONNECT: @inclk 0 0 1 0 inclk0 0 0 0 0
// Retrieval info: CONNECT: c0 0 0 0 0 @clk 0 0 1 0
// Retrieval info: CONNECT: locked 0 0 0 0 @locked 0 0 0 0
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.ppf TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.inc FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.cmp FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL pll.bsf FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL pll_inst.v FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL pll_bb.v FALSE
// Retrieval info: LIB_FILE: altera_mf
// Retrieval info: CBX_MODULE_PREFIX: ON

View File

@@ -1,2 +0,0 @@
:10000000000766EF00F8EA6F003F00C938AAAFF6B4
:00000001FF

View File

@@ -1,513 +0,0 @@
:100000000000000000CCFFFF00000000EEFFFFFF3B
:10001000CCEEEEEEFFFFFFFFFFFFFFFFFFFFFFFF56
:10002000FFFFFFFF772288CCFFFF7711CCFFFFFF98
:1000300088CCEEEEEEEECC883377DFBFBFFF7733B0
:10004000FFBFFFFFFFFFFFFF3367CF9FFFFF773348
:100050002288CCCCEEEEFFFFEEFFFFFFFFFFFFFF9D
:10006000FFFF773311110000330000000000000093
:10007000CCEEFFFFFFFFFF77FFFFFFFFFFFFFF005B
:100080003F7FFFFFEEFFFFFF333333777777FFFFCD
:10009000FFFFFFFFEECC00CCFFFFFFFF7700EEFF7E
:1000A0000000000088FF9F3F0000000011111111A7
:1000B0000088CCEEEEFFFFFF00FF331111FF3FFF82
:1000C000CCEEFFFFFFFFFF77BFBFFF777733110055
:1000D000FFFFFFEEEECC88003377FFFFFFFFFFEE60
:1000E000FFFFFFFFFFFFCCCCFFFFFFFF7777DFDFD6
:1000F00088EEEEFFFFFFFFFFFFFFFFFFFFFF7733FD
:10010000FFFFFFFFEEEECC00FFFFFFFF777733002E
:10011000FFFFFFFFFFFFFFFF234757579FBFBFFFB3
:100120000000000033FF9FBF0000000000001133FB
:10013000EEFFFFFFFFFFFF77FFFFFFFFFFFF330033
:10014000FFFFFFFFFFFF77777733BB99DDCCEEFF33
:10015000000000000088FFFF00008888CCDDCCEEA6
:10016000000000000000000000000000000000EEA1
:100170001133777777333300000000000000000070
:10018000000000000000000000000000000088FFE8
:10019000FFFFFF3311111100FFFFFFCC888888009B
:1001A000000000FFFFFFFFFF000000FFBF7FFFFF19
:1001B000FFFF770000000000FF3300000000000098
:1001C000FF3388FFFFFFFFFF00CCFFFFFFFFFFFFB4
:1001D00000008888CCCCEEEECCFFFFFFFFFFFF775E
:1001E00000000000336747DF00000000CCEEEEEEB9
:1001F000FFFFFFFFFF330000FFFFFFFF11000000C4
:1002000000000000000000000000000000000000EE
:10021000000000BBBB000000000066FFFF6600009E
:10022000FFFFFF77FFFFFFFFFFFF33CCFFFFFFFF65
:10023000FFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFCD
:10024000FFFFFF00FFFFFFFFFFFFFFEEFFFFFFFFCE
:1002500099555533884422118855331100FF880081
:10026000FFFFFFFFFFFFCCFFFFFFFFFFFFFFFFFFD1
:10027000FFFFFFFF33CCFFFFFFFFFFFFCCFFFFFFC0
:10028000FFCC77FFCC77FFFFFFFFEEBBFFEEDDFF7C
:10029000FFFF44FFFFFFFFFFFF33EEFFFFFFFFFF06
:1002A000FFBBFFEEEE77BBFFFFFFFF33CCFFFFFF8F
:1002B000FFFFFFFFFFFFFFFFFFFFFFFFFF11FFFF3C
:1002C0000000EEDDDD000000000000000000000086
:1002D000050A050A050A050A8D8A8D8A8D8A8D8A86
:1002E0000000006666000000000000000000000042
:1002F00000000000000000000000EEDDDD00000056
:1003000088CC222266CC88003377CC88887733006B
:100310002222EEEE222200000000FFFF4400000037
:100320002222AAAAEEEE660066FFBB9999CC440091
:10033000CCEE22222266440088DDFFBB99880000B3
:1003400088EEEE888888880000FFFFCC66331100B5
:10035000CCEE22222266440011BBAAAAAAEEEE002D
:10036000CCEE222222EECC0000999999DD77330061
:10037000000000EEEE000000CCEEBB9988CCCC0073
:10038000CCEEAAAA2222CC0000669999BBFF660097
:1003900088CC66222222000077FF999999FF660097
:1003A000FFFFFFFFFFFFDDFFFFFFFFFFFFFF33FF4B
:1003B0007799EEFF77FFFFFFFF77BBCCFFFFFFFFD3
:1003C000FFFF00FFFFFFFFFFFFFF00FFFFFFFFFF3B
:1003D000FFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF2C
:1003E000FFFFFFFF66FFFFFFFFFFFFFF00FFFFFFB5
:1003F000C0C8D5FFFFD9C0803071F0F3F4F0713080
:10040000CC221155559922CC334488AAAA99443359
:10041000EEEE888888EEEE003377CC88CC77330018
:10042000CCEE222222EEEE0066FF999999FFFF00A2
:100430004466222266CC880044CC8888CC7733007E
:1004400088CC662222EEEE003377CC8888FFFF004E
:1004500022222222EEEE000088999999FFFF0000E7
:100460000000000000EEEE008899999999FFFF00C6
:10047000EEEE222266CC880099999988CC773300D9
:10048000EEEE000000EEEE00FFFF111111FFFF0085
:100490002222EEEE222200008888FFFF88880000DA
:1004A000CCEE222222664400FFFF00000000000084
:1004B0002266EECC88EEEE0088CC663311FFFF009A
:1004C00022222222EEEE000000000000FFFF0000CA
:1004D000EEEE008800EEEE00FFFF773377FFFF00BF
:1004E000EEEECC8800EEEE00FFFF113377FFFF0049
:1004F000CCEE222222EECC0077FF888888FF77009E
:100500000088888888EEEE0077FF888888FFFF00E3
:10051000AACCEEAA22EECC0077FF888888FF77006D
:100520002266EECC88EEEE0077FF998888FFFF0008
:10053000CCEE2222226644000055DD9999FF660028
:100540000000EEEE000000008888FFFF88880000B1
:10055000CCEE222222EECC00FFFF000000FFFF00C5
:100560000088CCEECC880000FFFF110011FFFF00D7
:10057000EEEECC88CCEEEE00FFFF113311FFFF0052
:1005800066EECC88CCEE6600CCEE773377EECC000E
:100590000000EEEE00000000EEFF1111FFEE000083
:1005A000222222AAEEEE6600CCEEFFBB99888800DC
:1005B00077DDFFFFFFFFFFFF88FFFFFFFFFFFFFF6C
:1005C000FFFF00FFFFFFFFFFFFFFCCFF00FFFFFF6C
:1005D000EE11FFFFFFFFFFFFFFFF88FFFFFFFFFFA1
:1005E000FFFFDDBBFFFFFFFF77FFFFFFCCFFFFFF3C
:1005F0000103050E050A050A88888888898B8D8E77
:100600000000000C1F3F7FFF000001010000000000
:10061000000000001F3F7FFF0000000003010000FA
:1006200000000000CCCCEE6E0404063FFFFFFFCFBD
:1006300000000000CCCCEE6E0103063FFFFFFFCFB1
:100640006EEEEEEEEECC88088F0F0F0F8F8FCF017E
:100650006EEEEEEEEECC88008F0F0F0F1F3F7F0087
:10066000DDFFFF77331100000000000000000000F4
:10067000DDFFEF6723010101000000000000000022
:100680000000113377FFFFDD0000000000000000D4
:100690000101012367EFFFDD000000000000000002
:1006A0000888CCEEEEEEEE6E01CF8F8F0F0F0F8F1E
:1006B0000088CCEEEEEEEE6E007F3F1F0F0F0F8F27
:1006C0006EEECCCC00000000CFFFFFFF3F0604041D
:1006D0006EEECCCC00000000CFFFFFFF3F06030111
:1006E000FF7F3F1F0C000000000000000101000020
:1006F000FF7F3F1F0000000000000103000000001A
:1007000080C0C0C0C080A6847654F0F0D4F6F078E3
:10071000C0E0E0E0E0C0D3860030765470705476DC
:100720001F0E0E0E0F0F0F060F0707070303010022
:100730001F0F0F0E0E0E0C0801010103070F0F070C
:10074000060F0F0F0E0E0E1F000103030707070F02
:10075000080C0E0E0E0F0F1F070F0F0703010101EC
:1007600084A680C0C0C0C08078F0F6D4F0F0547683
:1007700086D3C0E0E0E0E0C076547070547630007C
:10078000F098AE8E9F8E8E063122EEE22222EEF19E
:10079000F098AE8E9F8E8E06F1EE2222E2EE22318E
:1007A00006061F0E3AF870F0F0F0E0C1838383C0B4
:1007B0000606060E0E1C7C70F0F09006078F07A24E
:1007C000F070F83A0E1F0606C0838383C1E0F0F094
:1007D000707C1C0E0E060606A2078F070690F0F02E
:1007E000068E8E9F8EAE98F0F1EE2222E2EE22313E
:1007F000068E8E9F8EAE98F03122EEE22222EEF12E
:10080000100E0F0F8FA2F0F0C08307070632F0F032
:10081000F0F0A28F0F0F0E10F0F03206070783C022
:100820007255DDD55555DD72E0E0751C0E0E178052
:1008300072DD5555D5DD557280170E0E1C75E0E042
:100840002288448822884488DDEEBBEEDDEEBBEED4
:1008500000000000080C060B080C060B050A050A30
:10086000070A0C0800000000050A050A070A0C0820
:10087000070C000000000000050A070C080C060B1E
:1008800000000000011337360000000000000000E7
:10089000031F9393D3800000000003179B9BCA8023
:1008A00080C40AD632FCB67C938293C7395733038F
:1008B000B4B254BE7A54FABA37135636335732327A
:1008C0007CB6FC32D60AC48003335739C79382936F
:1008D000000080D393931F0380CA9B9B17030000E3
:1008E0003637130100000000000000000000000087
:1008F000DDEA556ABE5C3A370101010000000000E4
:100900000000000103173F3F00000000000000004E
:100910000000080C8ECECECE0000073FFFFFFFFF89
:10092000CECECE8E0C080000FFFFFFFF3F07000079
:100930003F3F17030100000000000000000000001E
:10094000050A050A85C2E1F0050A050A143870F0A7
:10095000F0E0C182050A050AF078341A050A050A92
:10096000141A343834787078050A050A050A050A1D
:10097000707870383438141A050A050A050A050A11
:10098000050A050A050A050A8582C1C2C1E0E1E03F
:10099000050A050A050A050AE1E0E1C2C1C285822D
:1009A000143870F0F078341A050A050A050A050AA9
:1009B000050A050A050A050A85C2E1F0F0E0C182D0
:1009C000050A050A0578F0F0050A050A050A34F05B
:1009D000050A050A050AC1F0050A050A05E0F0F056
:1009E000F0F0700A050A050AF038050A050A050A3A
:1009F000F0C2050A050A050AF0F0E10A050A050A2F
:100A0000051B377F77FFFFFF050A050A050A377FB9
:100A1000FFCC33FFEF8A050AFFFFFFDDBBFFEF8A44
:100A2000EF8A050A050A050A11FFEF8A050A050A79
:100A3000151B37B3F77FFFFF85C2F0F0F0F0C182DE
:100A4000EFCE8D82C1C2E1F0FFFFDDBB76FCF8F096
:100A5000FEDCBC3834787078151B373B674E8D0A46
:100A6000050A8DEE7799EEFF8DEEBBDDEEFFFFFF01
:100A7000FFFF77F7B73B151B85C2F0F0F0F0C1829E
:100A8000F0E0C1C2858ACDEEF0F8FC76BBDDFFFF59
:100A900077BBFFEE773B150A773B150A050A050A77
:100AA000050A050A050A8DEE050A050A8DEE77117D
:100AB000050A050A0D0603010D06030100000000EA
:100AC000C71F939313000000CFE4E7970A000000CC
:100AD0000000001393931FC70000000A97E7E4CFBC
:100AE00093829382D9E8D9E8111111110101010112
:100AF000373A5CBE6A55EADD0000000000010101E2
:100B0000FFFFFFFFFFFFFFFF151B373B777FFFFF57
:100B1000FEDCBC3834787078FFFFFFFFEFCE8D0A23
:100B2000151B373B777FFFFF050A050A050A050AF3
:100B3000FEFEFCFCBCF87078151B373B777FFFFF8F
:100B4000707870383438141AEFEECDCE8D8A050ADD
:100B5000EFEECDCE8D8A050A151B373B777FFFFF61
:100B6000050A050A050A050AEFEECDCE8D8A050AAB
:100B7000050A050A050A050A050A8D8ACDCEEFEE9B
:100B8000050A8D8ACDCEEFEEFFFF777F373B151B31
:100B9000FFFF777F373B151B050A050A050A050A83
:100BA000050A050A058ACDEE058ACDEEFFFFFFFF97
:100BB000FFFFFFFFFFFFFFFFFFFF777F373B151BA7
:100BC0007078703834B8DCFE058ACD66BBDDFFFF77
:100BD000141A343834787078050A8D8ACDCEEFEE49
:100BE0007078F8B8FCFCFEFEFFFF777F373B151BE3
:100BF00000000000000000008888888888888888B5
:100C00000000000080C0E0F000000000103070F034
:100C1000F0E0C08000000000F07030100000000024
:100C200010103030307070700000000000000000C4
:100C300070707030303010100000000000000000B4
:100C400000000000000000008080C0C0C0E0E0E0C4
:100C50000000000000000000E0E0E0C0C0C08080B4
:100C6000103070F0F0703010000000000000000044
:100C70000103070F0F070301888888888888888800
:100C8000000000000070F0F000000000000030F0F4
:100C9000000000000000C0F00000000000E0F0F0E4
:100CA000F0F0700000000000F030000000000000D4
:100CB000F0C0000000000000F0F0E00000000000C4
:100CC0000F0F0F0F0F8FCFEF0F8FCFEFFFFFFFFF34
:100CD000113377FFFFFFFFFF00000000113377FFA4
:100CE000FFFFFFFFFF773311FF7733110000000094
:100CF00000000000FFFFFFFFFFFFFFFFFFFFFFFF00
:100D0000FFFF11000000000077000000000000005D
:100D1000FFFFFFFFFF773311FFFFFF771100000098
:100D2000CCEEFFFFFF663311FF77331100000000A8
:100D300077DDFFFFFFFFFFFF88FFFFFFFFFFFFFFE4
:100D4000000000000011FFFF00000000000000771D
:100D5000113377EEDDBBFFFF0000001177FFFFFFCF
:100D6000113377FFFFFFBB7700000000113377FFDF
:100D7000FFFF77CCFF77CCFFFFDDEEFFBBEEFFFF81
:100D8000FFFFFFFFFF44FFFFFFFFFFFFFFEE33FF0B
:100D9000FFBB77EEEEFFBBFFFFFFFFCC33FFFFFF94
:100DA0001438F0F0F0F0341A8D8ACD567666773329
:100DB000058A8DCECD6667BBBBDDDDEE66BBFFFF72
:100DC000FFFFEEFFF7F3F1F0773B151A343870F0C0
:100DD0001438F0F0F0F8FCFE058ACD76BBFFFFFF7B
:100DE000FFFFFF3B050A050AF7B3C1C2C1E0E1E01E
:100DF000F0F0700A058ACD2AF0B8CDEEFF3B050A67
:100E0000EE8800000000000011FFEE8800000000E6
:100E1000FFCC33FFEE880000FFFFFFDDBBFFEE8855
:100E2000113377FF77FFFFFF00000000112277FFEB
:100E3000EECC8880C0C0E0F0FFFFDDBB76FCF8F0B0
:100E4000111133B3F777FFFF80C0F0F0F0F0C080EE
:100E5000FEDCB83030707070111133336644880096
:100E60007070703030B8DCFE008844663333111186
:100E7000FFFF77F7B333111180C0F0F0F0F0C080BE
:100E8000F0E0C0C08088CCEEF0F8FC76BBDDFFFF60
:100E900077BBFFEEFF773311FF77331100000000BF
:100EA000000088EE7799EEFF88EEBBDDEEFFFFFFD6
:100EB00000000000000088EE0000000088EE7711BE
:100EC0000000000088EEFFFF8888CC66773399CC5D
:100ED0000000000000000088000000000000CCFFBF
:100EE0009977FFCC00000000FFFFAA7777EECC884F
:100EF000EE00000000000000FFFF8800000000007E
:100F0000000088FFBFFFFFFF00003377CF9FBFBF08
:100F1000FFFFFFFFFFEECC00FF77111177FFFFFF10
:100F2000FFFFEECC00CCEEFFFFFFFFFF0077770066
:100F3000CCEEFFFFFFFF771177773333110000000E
:100F4000333399DDCCEEEEFFFF0077FFFFFFFFFFAD
:100F5000FF777733BB9988CCEEEEFFFFFFFF777703
:100F6000070A0C08000000008D8A8D8A8F8A8C8801
:100F700000000000080C060B888C8E8B8D8A8D8AF1
:100F80000000000080C060B080C060B050A050A0E1
:100F900070A0C0800000000050A050A070A0C080D1
:100FA0000103050E050A050A000000000103050EF5
:100FB000050A050A050A050A050A050A050A050AB9
:100FC0000000000000000000000000000000000021
:100FD0000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F21
:100FE000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F001
:100FF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01
:1010000000000000000000000000000000000000E0
:1010100000000000000000000000000000000000D0
:1010200000000000000000000000000000000000C0
:1010300000000000000000000000000000000000B0
:101040000000080C0E0E0E0E000000000000000054
:101050000000000103070F0F0000070F0F0F0F0F15
:101060000E0E0E0E0C080000000000000000000034
:101070000F0F0703010000000F0F0F0F0F070000F5
:101080000000080C0E0E0E0E000000000000000014
:101090000000000103070F050000070F0F0F0F0FDF
:1010A0000E0E0E0E0C0800000000000000000000F4
:1010B0000A0F0703010000000F070F0F0F070000C2
:1010C0000000080C060E0E0E0000000000000000DC
:1010D0000000000103070F050000070F0F0C0B05B0
:1010E0000E0E060E0C0800000000000000000000BC
:1010F0000A0F0703010000000E060F0F0F07000084
:101100000000080C060E0E0E00010008000400028C
:101110000A080401E0F070700000070F87C0C3C127
:101120000E0E060E0C080000040200000000000075
:101130005A0F0603010000000E060F0F0F070000F4
:1011400002060A0D070E0E06000000703010100097
:10115000010201F0F0F0F1F30800070FCFBFFFFF2D
:101160000A0E060E0C08000000010000020000003C
:10117000F75D3F0314103408FFDFE9E1C387040D76
:101180000D0B01840F8E8E8F000000783403010058
:10119000090003F0F0F0781E090C0CF0F0E1C397A1
:1011A0008E8BCD00CD0B070A00000000010000006F
:1011B000CFEFBB77330801037FFFFFFFFF0E0E0C5D
:1011C00000080C4AFDF0FDFB00000000000010705C
:1011D0000000112275F8F0F0000389EEFFFFF3F034
:1011E000F7FBFDF0FD4A0C08F07010000000000055
:1011F000F0F0F0F875221100F0F0F3FFFFEE890334
:1012000000070E0CFEFCFEFF0000000000000011B5
:101210000000112277DEDE9E0000CCEFFFFF7F7F13
:10122000FFFFFEFCFE0C0E07111100000000000085
:101230009E9EDEDE772211007F7F7FFFFFEFCC00D6
:101240000088CCEE2E0E0E0E6010701060000003B1
:101250000032F13376773F1FFFFCF3F5FDCFEFFD52
:101260008E8B0301010000000F000000060F0F0627
:101270001F01050109090101F8FD7F0E0C08080096
:101280004040E080FEFEF9FD000003010000000088
:101290000000000E0F03010120100077FFFFFFFF89
:1012A000FAFF7F2E0C0C0E0E0F0300000000000052
:1012B0000F1F3F1100000000EFEBE1EBCF03010037
:1012C000405020B8E6FBF1FB0000000000000000E9
:1012D00000080C0E0707131700000077FFFFFCFF44
:1012E000F5FF7F2E4C00000001070F0000000000FA
:1012F0003F7EFC7633000107BE8F878F0F0F0E0CE9
:101300000000000088CCEEEE0007008040F073B3D0
:10131000000E0F33FFFFFFFF00000CFFFFFFFFFF7A
:10132000EEEECC8800000000B373F04080000700B0
:10133000FFFFFFFF330F0E00FFFFFFFFFF0C00005A
:101340000E4A2CF0ACC888883333331100000000FB
:10135000BCBCDA691F270100A7A77FFFFFFF7F370B
:10136000000000000000000000000000000000007D
:1013700000000000000000003F6E4C08000000006C
:101380000C0C0C48B8205000777777230100000040
:10139000ADADA5D33F5F1301CFCFEFFFFBFDEEEE69
:1013A0000000000800000000000000000000000035
:1013B00000000000000000006E7F17010000000028
:1013C0000E0E1EACBCA89800333333110000000091
:1013D000BCBCDA691F270113A7A77FFFFFFFFFFF30
:1013E00000000000000000000000000001000000FC
:1013F0001313373F6E000000FFFFCC000000000019
:10140000080808806040A000FFFFFE5603010000AE
:101410005B5B5BB77FBF37378F8FCFEFF7EACCCC03
:1014200000000000080000000000000000000000B4
:101430001313010000000000CCEE7F170100000034
:10144000008888CCCCEEEEEE000000000000111108
:1014500001035676EFCFDEFE083EB6F67E3EB6F6C8
:10146000EEEEEECECE8E0E0C11110000000000004C
:10147000FFFFFFFF77331100FEFEFFFFFFFFFF01BD
:1014800000001010F01C1C0C010000000000000106
:101490000F77331133373F3F0088CCFFCF8F0F0FCB
:1014A0000C0C0C8000000000010000000000000196
:1014B0003F3F37321133770F874BADF0ECC88000D8
:1014C0000CEEFFFFFFFFFFFF0010000030000010D8
:1014D00001008040F04080000F13171F3F3F373757
:1014E000FFFFFFFFFFFFEE0C1000003000001000B8
:1014F000008040F04080000037373F3F1F17130F38
:101500002226B73F5F5FCE8C000000000013173F1C
:10151000000000111199BABB30274F5AD25EC7EFB5
:101520008C8ECEDFDF5F5F143F3F1F1F070300007D
:10153000CCCCCCEEFF7F0F076FEF6775FCDE0C00A5
:10154000000000084C4E2EC3000000000000000008
:101550000000013223237477604E9FA7A7BF9FDF4F
:101560008CC22ECE8C8800003377EFDF8FCF77339D
:1015700089EE3FCF4C6EEECCCFEFEFEF7F37000020
:10158000C1DB5BB75E4E9EBC00000003070F1F1F50
:101590000000004CEEEEEEEE000113745657F9FF1A
:1015A0002DD33FCE0C0000003F3F1F171703010053
:1015B000DF9F9FDFFF7F0F001ECFEF9FCF7F0E00CB
:1015C0000000080C0C0C864A0000010312010707FA
:1015D000000C0E874B0F0F0F04040D4B870F0FC32A
:1015E0000C0E0E860E0C0800070716030301000000
:1015F0001E2D1E874B0901002D1E1E0F1E2D0D00D6
:10160000000CC0C0000CC0C00000000000000000C2
:1016100000001133777F7F7F0225ADADAD2D2D0A00
:1016200000000000000000000000000000000000BA
:101630007F7F7F7777331100080808FFFFEEEE0009
:10164000000000000000000000000000000000009A
:10165000000011111111111177FFEECCCCCC8800D4
:1016600000000000000000006061070161610700E8
:101670001995B7B7B7A684080088CC888800000001
:10168000000CC0C0000CC0C0000000000000000042
:1016900000001133337777770225ADADADAD25EE80
:1016A000000000000000000000000000000000003A
:1016B0007F7F000000000000FFFF770000000000B7
:1016C000000000000000000000000000000000001A
:1016D0000000000000007F7F000000000077FFFF97
:1016E000C0C00C00C0C00C000000000000000000E2
:1016F0007777773333110000CE25ADADADAD250240
:1017000000000000000000000000000000000000D9
:101710007676F0F0F6FEF8BC80C0C0C0C08888883D
:1017200000000000000000000000000000000000B9
:101730008F8F8F0F0F070703888888080C0C0C0CFD
:101740000000000000000000000000000000000099
:1017500000010303070707070E0E0E0C0C0C080010
:101760000000000000000000000000000000000079
:10177000347076F6F0F073330080C0C0C0C08000D3
:101780000000000000000000000000000000000059
:10179000000000003043070700000000800C0C0C24
:1017A0000000000000000000000000000000000039
:1017B0008F8F0000000000000C0C000000000000F3
:1017C0000000000000000000000000000000000019
:1017D000000000000000FBFB00000000000084C0CF
:1017E00000000000000000000000000000000000F9
:1017F0007070733300000000C0C0C08000000000A3
:101800000040602038781C0C000000101247EFFFE9
:10181000080805D7B73F7FEF0808CCCFCFCFEFFF41
:101820001C1C1C7828A8C800FFFFFF777733110025
:10183000EFEFDFDFDFDFDF03FDFDFDFBFDFDFE1F63
:101840000000000028181C1C000000101247EFFFC9
:10185000050505D7B73F7FEF00008C8FCFCFEFFF97
:101860003C1C1C0808888800FFFFFF7777331100B5
:10187000EFDFDFBFBFBFBF03FDFDFDFBFBFDFE0FC5
:1018800000001098F89C9C8C010011337777FFFFC3
:101890000F7FEFCFCFEFFFFF0FCC7F3FD3A5ADADD5
:1018A0008C9C9CF898100000FFFF777733110001A3
:1018B000FFFFEFCFCFEF7F0FADADA5D33F7FCC0FB5
:1018C000000018D0F05CDECF0711001133BBFFFF22
:1018D0000FFFF1FFFFFFFFFF088CEFCFCFEFFFFF00
:1018E000CFDE5CF0D0180000FFFFBB331100110702
:1018F000FFFFFFFFFFF1FF0FFFFFEFCFCFEF8C08E0
:101900000C0C0C484040E050FFFFEF470301000083
:101910007878A5D32F5F13374F6FFFFFFBECEEFEF8
:101920004000000000000000000001010000000075
:101930007F7FFFFF7F7F1701EECCCC8888CCEE0E37
:101940000C0C0C4840302050FFFFEF470301000013
:10195000ADADA5D32F5F1301CFEFFFFFFBECEEFF83
:1019600040008888CCEEFF0F00000000000000005F
:101970000113131301000000FFFFFFFFFF7F0700AB
:10198000FFFFDDCCC8A830303F37233030010000E6
:10199000FFFF7F3F3F7F1317FFFFFFFFFFF8FFEEC3
:1019A00030000000000000000001131337377F0FE4
:1019B0007FFFFFFFFFEECC00CCCC8888000000004A
:1019C000FFFFDDCCD8B810103F37233030010000C6
:1019D000FFFF7F3F3F7F1313FFFFFFFFFFF8FFEE87
:1019E00010000088CCCCEE0E0000000000000000CB
:1019F0001301010100000000EEFFFFFF7F7F3703AE
:101A000000000000000000000000000000000000D6
:101A100000000000000000000000000000000000C6
:101A200000000000080C0C0E000000101247EFFF31
:101A3000080805D7B73F7FFF0808CCCFCFCFEFFF0F
:101A40000000000000000000000000000000000096
:101A50000000000000000000000000000000000086
:101A600000000000080C0C0E000000101247EFFFF1
:101A7000050505D7B73F7FFF00008C8FCFCFEFFF65
:101A80000E0E0C4828A8B870FFFFFF7777331100BF
:101A9000FFEFDFDFDFDFBF37FFFFFFFFFFFDFEFFF1
:101AA0005000000000000000000000010113370F8B
:101AB000377F7FFFFFFFFF4CFFFFEEEECCCC000037
:101AC0000E0E0E2C28A8B830FFFFFF7777331100D9
:101AD000FFFFFFDFDFDFDF13FFFFFFFFFBFDFEEE9A
:101AE000600000008888CC0C0000000000000000AE
:101AF0003737131313010000EEEEFFFFFFFF7F0FD8
:101B000000001010781C2C0C0000010356FEFFFF93
:101B10000F375F2FB7F578780FEEECFBFFFF6F4FB5
:101B20000C1C1C781020880CFFFFEF4712100000DF
:101B300078787D3FA7D713034F6FFFFFFBECFF0FB4
:101B400000001010781C1C0C0B11013074EFFFFF0B
:101B50000FFF7F3F3F7D78780CCCCCFBFFFF6F4FB2
:101B60000C0C0C482070A028FFFFEF470B0104006D
:101B700078787DF3E35F13074F6FFFFFFBECFF0FF8
:101B80000C0C0C484040E050FFFFEF470301000001
:101B90007878A5D32F5F13374F6FFFFFFBECEEFE76
:101BA0004000000000000000000001011313370F87
:101BB0007F7FFFFFFFFFEE0CEECCCC88880000009B
:101BC0000C0C0C48403020500F0F1E0703100C085F
:101BD0002D2D2DC3C32D03010F0F0F0F4B2C0E0FF7
:101BE000400008080C0E0F0F01020008010200005F
:101BF00001030303010000000F0F0F0F0F0F070079
:101C0000008888CCCCEEEEEE000000000000111140
:101C100010124767FEDECFEF80B63E7EF6B63E7E00
:101C2000EEEEEECECF8F010111110000000000009A
:101C3000FFFFFFFF77331100FEFEFFFFFFFFFF00F6
:101C4000008888CCCCEEEEEE000000000000111100
:101C500001035676EFCFDEFE083EB6F67E3EB6F6C0
:101C6000EEEEEECECE8E0E0C111100000000000044
:101C7000FFFFFFFF77331100FEFEFFFFFFFFFF01B5
:101C80000000000088888C8E00113317C3C31777BB
:101C900077FFFFFFFFFFFFFF88EEFFFFFFFFFFFF64
:101CA0008E8F8B89010200007717C3C31733110091
:101CB000FFFFFFFFFFFFFF77FFFFFFFFFFFFEE8844
:101CC0000000000088888E8E00001117C3C31777AC
:101CD0000077FFFFFFFFFFFF0088EEFFFFFFFFFF22
:101CE0008F8F8988000000007717C3C31711000089
:101CF000FFFFFFFFFFFF7700FFFFFFFFFFEE880002
:101D0000008888C4C42E2EA6000000000000111117
:101D100000315656ADAD1E1E00FA96874B5A968777
:101D2000A62E2EC44C4C8F0611110000000000009E
:101D30002D0F8F8F472311004B1E1E0F0F0FFF001B
:101D40000088884C4C2EA6A600000000000011114F
:101D500000315656ADAD1E1E00FA96965A5A968719
:101D6000A6A6A64E4E8E0C08111100000000000021
:101D70002D0F8F8F472311004B0F0F0F0F0FFF01F8
:101D80000000000000884C2E000000000033437467
:101D900000000033CF0FC33C000000CC3F0F870F83
:101DA0002E2E2E2E2FCF0302744347617611000092
:101DB0003CC30F69968F77000F870F69961FEE005F
:101DC0000000000000884C2E000000000033437427
:101DD00000000033CF0FC33C000000CC3F0F870F43
:101DE0002E2E2E2F4F8E0C0074434770671100006B
:101DF0003CC30FE13C8F77000F870F0FE11FEF000F
:101E000000008888888888880000332222222222C5
:101E10000000FF00000000000000FF0000000000C4
:101E2000888888888800000022222222330000004F
:101E300000000000FF00000000000000FF000000A4
:101E4000CC2222EE00EE44880000000000000000DA
:101E500000000000000000001122223300330000C7
:101E600000EE0022AAAAEE00000000000000000020
:101E70000000000000000000113300222222330085
:101E80000044446666EEEEEE000011111133333368
:101E900060690F9FF9690F9F00888888888888CCBF
:101EA000EEEEEECECE8E060C3333111100000000A4
:101EB000FFFFFFFFFF771100CCDDDDDDFFFFFF003F
:101EC000008888CCCCEEEEEE00000000000011117E
:101ED00010124767FEDECFEF80B63E7EF6B63E7E3E
:101EE000EEEEEECECE8E060C1111000000000000CA
:101EF000FFFFFFFF77331100FEFEFEFEFFFFFF0036
:101F000000000088CCCCEEEE17C3C3177711000099
:101F10009FC3C39FFFFF771188EEFFFFFFFFFFFF07
:101F2000EEEE66EECD8F0E000000000000003300E4
:101F3000000000000033FF007711001177FFEF0071
:101F40000000000088CCCCEE000017C3C317770058
:101F500000779FC3C39FFFFF0000CCFFFFFFFFFF81
:101F6000EEEEEEEECD8F0E0000000000000033001C
:101F70001100000011FFFF00FF330033FFFFEF00EF
:101F80000000000088CCCCEE0000003317C3C3175C
:101F9000000077FF9FC3C39F0000CCFFFFFFFFFF40
:101FA000EEEEEEEECD8F0E00770000000077110010
:101FB000FF11000077FFFF00FFFF0077FFFFEF003A
:101FC00000000088CCCCEEEE00000011337717C380
:101FD000000077FFFFFF9FC30000EEFFFFFFFFFF42
:101FE000EEEEEEEECD8F0E00C31777707711000086
:101FF000C39FFFF0FFFF7700FFFFFFF0FFFFEF0041
:00000001FF

File diff suppressed because it is too large Load Diff

View File

@@ -1,17 +0,0 @@
:1000000007090A0B0C0D0D0E0E0E0D0D0C0B0A0937
:1000100007050403020101000000010102030405B9
:10002000070C0E0E0D0B090A0B0B0A09060403053B
:1000300007090B0A08050403030405030100000275
:10004000070A0C0D0E0D0C0A070402010001020440
:10005000070B0D0E0D0B070301000103070E070030
:10006000070D0B080B0D09060B0E0C07090A0602FB
:10007000070C080405070200030805010306030135
:1000800000080F0701080E0702080D0703080C07F8
:1000900004080B0705080A070608090707080807E8
:1000A00007080609050A040B030C020D010E000FD8
:1000B000000F010E020D030C040B050A06090708C8
:1000C000000102030405060708090A0B0C0D0E0FB8
:1000D0000F0E0D0C0B0A09080706050403020100A8
:1000E000000102030405060708090A0B0C0D0E0F98
:1000F000000102030405060708090A0B0C0D0E0F88
:00000001FF

View File

@@ -1,17 +0,0 @@
:1000000000000000000F0B01000F0B03000F0B0F8F
:10001000000F0B07000F0B05000F0B0C000F0B0957
:1000200000050B07000B010900050B01000205018B
:1000300000020B0100050B09000C010700010C0F69
:10004000000F000B000C050F000F0B0E000F0B0D27
:100050000001090F00090C090009050F00050C0F2C
:100060000001070B000F0B00000F000B000B050930
:10007000000B0C02000B070900020B0000020B072B
:1000800000000000000F0B01000F0B03000F0B0F0F
:10009000000F0B07000F0B05000F0B0C000F0B09D7
:1000A00000050B07000B010900050B01000205010B
:1000B00000020B0100050B09000C010700010C0FE9
:1000C000000F000B000C050F000F0B0E000F0B0DA7
:1000D0000001090F00090C090009050F00050C0FAC
:1000E0000001070B000F0B00000F000B000B0509B0
:1000F000000B0C0F000B070900020B0000020B079E
:00000001FF

View File

@@ -1,82 +0,0 @@
module keyboard
(
input clk,
input reset,
input ps2_kbd_clk,
input ps2_kbd_data,
output reg[9:0] joystick
);
reg [11:0] shift_reg = 12'hFFF;
wire[11:0] kdata = {ps2_kbd_data,shift_reg[11:1]};
wire [7:0] kcode = kdata[9:2];
reg release_btn = 0;
reg [7:0] code;
reg input_strobe = 0;
always @(negedge clk) begin
reg old_reset = 0;
old_reset <= reset;
if(~old_reset & reset)begin
joystick <= 0;
end
if(input_strobe) begin
case(code)
'h16: joystick[1] <= ~release_btn; // 1
'h1E: joystick[2] <= ~release_btn; // 2
'h75: joystick[4] <= ~release_btn; // arrow up
'h72: joystick[5] <= ~release_btn; // arrow down
'h6B: joystick[6] <= ~release_btn; // arrow left
'h74: joystick[7] <= ~release_btn; // arrow right
'h29: joystick[0] <= ~release_btn; // Space
'h11: joystick[8] <= ~release_btn; // Left Alt
'h0d: joystick[9] <= ~release_btn; // Tab
'h76: joystick[3] <= ~release_btn; // Escape
endcase
end
end
always @(posedge clk) begin
reg [3:0] prev_clk = 0;
reg old_reset = 0;
reg action = 0;
old_reset <= reset;
input_strobe <= 0;
if(~old_reset & reset)begin
prev_clk <= 0;
shift_reg <= 12'hFFF;
end else begin
prev_clk <= {ps2_kbd_clk,prev_clk[3:1]};
if(prev_clk == 1) begin
if (kdata[11] & ^kdata[10:2] & ~kdata[1] & kdata[0]) begin
shift_reg <= 12'hFFF;
if (kcode == 8'he0) ;
// Extended key code follows
else if (kcode == 8'hf0)
// Release code follows
action <= 1;
else begin
// Cancel extended/release flags for next time
action <= 0;
release_btn <= action;
code <= kcode;
input_strobe <= 1;
end
end else begin
shift_reg <= kdata;
end
end
end
end
endmodule