diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/ReadMe.txt b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/ReadMe.txt
new file mode 100644
index 00000000..1af441c9
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/ReadMe.txt
@@ -0,0 +1,17 @@
+Traverse USA by Dar (darfpga@aol.fr) (16/03/2019)
+
+Port to MiST
+
+TRAVERSE.ROM is required at the root of the SD-Card.
+
+Creating in Windows:
+copy /B zr1-0.m3 + zr1-5.l3 + zr1-6a.k3 + zr1-7.j3 TRAVERSE.ROM
+
+Creating in Linux:
+cat zr1-0.m3 zr1-5.l3 zr1-6a.k3 zr1-7.j3 > TRAVERSE.ROM
+
+Some ROM files contain different names, like:
+zippyrac.000
+zippyrac.005
+zippyrac.006
+zippyrac.007
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/Release/TraverseUSA_MiST.rbf b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/Release/TraverseUSA_MiST.rbf
new file mode 100644
index 00000000..e2930c8a
Binary files /dev/null and b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/Release/TraverseUSA_MiST.rbf differ
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/TraverseUSA_MiST.qpf b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/TraverseUSA_MiST.qpf
new file mode 100644
index 00000000..d0c46139
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/TraverseUSA_MiST.qpf
@@ -0,0 +1,31 @@
+# -------------------------------------------------------------------------- #
+#
+# Copyright (C) 2017 Intel Corporation. All rights reserved.
+# Your use of Intel 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 Intel Program License
+# Subscription Agreement, the Intel Quartus Prime License Agreement,
+# the Intel 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 Intel and sold by Intel or its
+# authorized distributors. Please refer to the applicable
+# agreement for further details.
+#
+# -------------------------------------------------------------------------- #
+#
+# Quartus Prime
+# Version 17.0.1 Build 598 06/07/2017 SJ Standard Edition
+# Date created = 04:04:47 October 16, 2017
+#
+# -------------------------------------------------------------------------- #
+
+QUARTUS_VERSION = "17.0"
+DATE = "04:04:47 October 16, 2017"
+
+# Revisions
+
+PROJECT_REVISION = "TraverseUSA_MiST"
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/TraverseUSA_MiST.qsf b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/TraverseUSA_MiST.qsf
new file mode 100644
index 00000000..66fc4b2b
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/TraverseUSA_MiST.qsf
@@ -0,0 +1,181 @@
+# -------------------------------------------------------------------------- #
+#
+# 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
+# (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.
+#
+# -------------------------------------------------------------------------- #
+#
+# Quartus II 32-bit
+# Version 13.1.4 Build 182 03/12/2014 SJ Web Edition
+# Date created = 21:22:13 June 04, 2019
+#
+# -------------------------------------------------------------------------- #
+#
+# Notes:
+#
+# 1) The default values for assignments are stored in the file:
+# TraverseUSA_assignment_defaults.qdf
+# If this file doesn't exist, see file:
+# assignment_defaults.qdf
+#
+# 2) Altera recommends that you do not modify this file. This
+# file is updated automatically by the Quartus II software
+# and any changes you make may be lost or overwritten.
+#
+# -------------------------------------------------------------------------- #
+
+# Project-Wide Assignments
+# ========================
+set_global_assignment -name PROJECT_CREATION_TIME_DATE "21:22:13 JUNE 04, 2019"
+set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
+set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:rtl/build_id.tcl"
+
+# Pin & Location Assignments
+# ==========================
+set_location_assignment PIN_7 -to LED
+set_location_assignment PIN_54 -to CLOCK_27
+set_location_assignment PIN_144 -to VGA_R[5]
+set_location_assignment PIN_143 -to VGA_R[4]
+set_location_assignment PIN_142 -to VGA_R[3]
+set_location_assignment PIN_141 -to VGA_R[2]
+set_location_assignment PIN_137 -to VGA_R[1]
+set_location_assignment PIN_135 -to VGA_R[0]
+set_location_assignment PIN_133 -to VGA_B[5]
+set_location_assignment PIN_132 -to VGA_B[4]
+set_location_assignment PIN_125 -to VGA_B[3]
+set_location_assignment PIN_121 -to VGA_B[2]
+set_location_assignment PIN_120 -to VGA_B[1]
+set_location_assignment PIN_115 -to VGA_B[0]
+set_location_assignment PIN_114 -to VGA_G[5]
+set_location_assignment PIN_113 -to VGA_G[4]
+set_location_assignment PIN_112 -to VGA_G[3]
+set_location_assignment PIN_111 -to VGA_G[2]
+set_location_assignment PIN_110 -to VGA_G[1]
+set_location_assignment PIN_106 -to VGA_G[0]
+set_location_assignment PIN_136 -to VGA_VS
+set_location_assignment PIN_119 -to VGA_HS
+set_location_assignment PIN_65 -to AUDIO_L
+set_location_assignment PIN_80 -to AUDIO_R
+set_location_assignment PIN_105 -to SPI_DO
+set_location_assignment PIN_88 -to SPI_DI
+set_location_assignment PIN_126 -to SPI_SCK
+set_location_assignment PIN_127 -to SPI_SS2
+set_location_assignment PIN_91 -to SPI_SS3
+set_location_assignment PIN_13 -to CONF_DATA0
+set_location_assignment PLL_1 -to "pll:pll|altpll:altpll_component"
+set_location_assignment PIN_49 -to SDRAM_A[0]
+set_location_assignment PIN_44 -to SDRAM_A[1]
+set_location_assignment PIN_42 -to SDRAM_A[2]
+set_location_assignment PIN_39 -to SDRAM_A[3]
+set_location_assignment PIN_4 -to SDRAM_A[4]
+set_location_assignment PIN_6 -to SDRAM_A[5]
+set_location_assignment PIN_8 -to SDRAM_A[6]
+set_location_assignment PIN_10 -to SDRAM_A[7]
+set_location_assignment PIN_11 -to SDRAM_A[8]
+set_location_assignment PIN_28 -to SDRAM_A[9]
+set_location_assignment PIN_50 -to SDRAM_A[10]
+set_location_assignment PIN_30 -to SDRAM_A[11]
+set_location_assignment PIN_32 -to SDRAM_A[12]
+set_location_assignment PIN_83 -to SDRAM_DQ[0]
+set_location_assignment PIN_79 -to SDRAM_DQ[1]
+set_location_assignment PIN_77 -to SDRAM_DQ[2]
+set_location_assignment PIN_76 -to SDRAM_DQ[3]
+set_location_assignment PIN_72 -to SDRAM_DQ[4]
+set_location_assignment PIN_71 -to SDRAM_DQ[5]
+set_location_assignment PIN_69 -to SDRAM_DQ[6]
+set_location_assignment PIN_68 -to SDRAM_DQ[7]
+set_location_assignment PIN_86 -to SDRAM_DQ[8]
+set_location_assignment PIN_87 -to SDRAM_DQ[9]
+set_location_assignment PIN_98 -to SDRAM_DQ[10]
+set_location_assignment PIN_99 -to SDRAM_DQ[11]
+set_location_assignment PIN_100 -to SDRAM_DQ[12]
+set_location_assignment PIN_101 -to SDRAM_DQ[13]
+set_location_assignment PIN_103 -to SDRAM_DQ[14]
+set_location_assignment PIN_104 -to SDRAM_DQ[15]
+set_location_assignment PIN_58 -to SDRAM_BA[0]
+set_location_assignment PIN_51 -to SDRAM_BA[1]
+set_location_assignment PIN_85 -to SDRAM_DQMH
+set_location_assignment PIN_67 -to SDRAM_DQML
+set_location_assignment PIN_60 -to SDRAM_nRAS
+set_location_assignment PIN_64 -to SDRAM_nCAS
+set_location_assignment PIN_66 -to SDRAM_nWE
+set_location_assignment PIN_59 -to SDRAM_nCS
+set_location_assignment PIN_33 -to SDRAM_CKE
+set_location_assignment PIN_43 -to SDRAM_CLK
+
+set_global_assignment -name FAMILY "Cyclone III"
+set_global_assignment -name DEVICE EP3C25E144C8
+set_global_assignment -name TOP_LEVEL_ENTITY TraverseUSA_MiST
+set_global_assignment -name ORIGINAL_QUARTUS_VERSION 13.1
+set_global_assignment -name LAST_QUARTUS_VERSION 13.1
+set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
+set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
+set_global_assignment -name DEVICE_FILTER_PIN_COUNT 144
+set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 8
+set_global_assignment -name ENABLE_CONFIGURATION_PINS OFF
+set_global_assignment -name ENABLE_NCE_PIN OFF
+set_global_assignment -name ENABLE_BOOT_SEL_PIN OFF
+set_global_assignment -name CYCLONEIII_CONFIGURATION_SCHEME "PASSIVE SERIAL"
+set_global_assignment -name USE_CONFIGURATION_DEVICE OFF
+set_global_assignment -name CRC_ERROR_OPEN_DRAIN OFF
+set_global_assignment -name FORCE_CONFIGURATION_VCCIO ON
+set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "3.3-V LVTTL"
+set_global_assignment -name RESERVE_DATA1_AFTER_CONFIGURATION "USE AS REGULAR IO"
+set_global_assignment -name RESERVE_FLASH_NCE_AFTER_CONFIGURATION "USE AS REGULAR IO"
+set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -rise
+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
+set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "NO HEAT SINK WITH STILL AIR"
+set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)"
+set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS ON
+set_global_assignment -name SMART_RECOMPILE ON
+set_global_assignment -name TIMEQUEST_DO_CCPP_REMOVAL ON
+set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
+set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
+set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
+set_global_assignment -name GENERATE_RBF_FILE ON
+set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION "USE AS REGULAR IO"
+set_global_assignment -name RESERVE_DATA0_AFTER_CONFIGURATION "USE AS REGULAR IO"
+set_global_assignment -name RESERVE_DCLK_AFTER_CONFIGURATION "USE AS REGULAR IO"
+set_global_assignment -name QIP_FILE rtl/pll_mist.qip
+set_global_assignment -name SYSTEMVERILOG_FILE rtl/YM2149.sv
+set_global_assignment -name VERILOG_FILE rtl/data_io.v
+set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdram.sv
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_spr_rgb_lut.vhd
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_spr_palette.vhd
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_spr_bit3.vhd
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_spr_bit2.vhd
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_spr_bit1.vhd
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_sound.vhd
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_chr_palette.vhd
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_chr_bit3.vhd
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_chr_bit2.vhd
+set_global_assignment -name VHDL_FILE rtl/proms/travusa_chr_bit1.vhd
+set_global_assignment -name VHDL_FILE rtl/rtl_T80/T80.vhd
+set_global_assignment -name VHDL_FILE rtl/rtl_T80/T80se.vhd
+set_global_assignment -name VHDL_FILE rtl/rtl_T80/T80_Reg.vhd
+set_global_assignment -name VHDL_FILE rtl/rtl_T80/T80_Pack.vhd
+set_global_assignment -name VHDL_FILE rtl/rtl_T80/T80_MCode.vhd
+set_global_assignment -name VHDL_FILE rtl/rtl_T80/T80_ALU.vhd
+set_global_assignment -name SYSTEMVERILOG_FILE rtl/TraverseUSA_MiST.sv
+set_global_assignment -name VHDL_FILE rtl/traverse_usa.vhd
+set_global_assignment -name VHDL_FILE rtl/moon_patrol_sound_board.vhd
+set_global_assignment -name VHDL_FILE rtl/gen_ram.vhd
+set_global_assignment -name VHDL_FILE rtl/dac.vhd
+set_global_assignment -name VHDL_FILE rtl/cpu68.vhd
+set_global_assignment -name VHDL_FILE rtl/cpu09l_128.vhd
+set_global_assignment -name VERILOG_FILE rtl/build_id.v
+set_global_assignment -name QIP_FILE ../../../common/mist/mist.qip
+set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
\ No newline at end of file
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/TraverseUSA_MiST.sdc b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/TraverseUSA_MiST.sdc
new file mode 100644
index 00000000..fca44902
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/TraverseUSA_MiST.sdc
@@ -0,0 +1,137 @@
+## Generated SDC file "vectrex_MiST.out.sdc"
+
+## 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.
+
+
+## VENDOR "Altera"
+## PROGRAM "Quartus II"
+## VERSION "Version 13.1.0 Build 162 10/23/2013 SJ Web Edition"
+
+## DATE "Sun Jun 24 12:53:00 2018"
+
+##
+## DEVICE "EP3C25E144C8"
+##
+
+# Clock constraints
+
+# Automatically constrain PLL and other generated clocks
+derive_pll_clocks -create_base_clocks
+
+# Automatically calculate clock uncertainty to jitter and other effects.
+derive_clock_uncertainty
+
+# tsu/th constraints
+
+# tco constraints
+
+# tpd constraints
+
+#**************************************************************
+# Time Information
+#**************************************************************
+
+set_time_format -unit ns -decimal_places 3
+
+
+
+#**************************************************************
+# Create Clock
+#**************************************************************
+
+create_clock -name {SPI_SCK} -period 41.666 -waveform { 20.8 41.666 } [get_ports {SPI_SCK}]
+
+#**************************************************************
+# Create Generated Clock
+#**************************************************************
+
+
+#**************************************************************
+# Set Clock Latency
+#**************************************************************
+
+
+
+#**************************************************************
+# Set Clock Uncertainty
+#**************************************************************
+
+#**************************************************************
+# Set Input Delay
+#**************************************************************
+
+set_input_delay -add_delay -clock_fall -clock [get_clocks {CLOCK_27}] 1.000 [get_ports {CLOCK_27}]
+set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {CONF_DATA0}]
+set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_DI}]
+set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_SCK}]
+set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_SS2}]
+set_input_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_SS3}]
+
+set_input_delay -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] -max 6.4 [get_ports SDRAM_DQ[*]]
+set_input_delay -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] -min 3.2 [get_ports SDRAM_DQ[*]]
+
+#**************************************************************
+# Set Output Delay
+#**************************************************************
+
+set_output_delay -add_delay -clock_fall -clock [get_clocks {SPI_SCK}] 1.000 [get_ports {SPI_DO}]
+set_output_delay -add_delay -clock_fall -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[1]}] 1.000 [get_ports {AUDIO_L}]
+set_output_delay -add_delay -clock_fall -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[1]}] 1.000 [get_ports {AUDIO_R}]
+set_output_delay -add_delay -clock_fall -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] 1.000 [get_ports {LED}]
+set_output_delay -add_delay -clock_fall -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] 1.000 [get_ports {VGA_*}]
+
+set_output_delay -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] -max 1.5 [get_ports {SDRAM_D* SDRAM_A* SDRAM_BA* SDRAM_n* SDRAM_CKE}]
+set_output_delay -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] -min -0.8 [get_ports {SDRAM_D* SDRAM_A* SDRAM_BA* SDRAM_n* SDRAM_CKE}]
+set_output_delay -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] -max 1.5 [get_ports {SDRAM_CLK}]
+set_output_delay -clock [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] -min -0.8 [get_ports {SDRAM_CLK}]
+
+#**************************************************************
+# Set Clock Groups
+#**************************************************************
+
+set_clock_groups -asynchronous -group [get_clocks {SPI_SCK}] -group [get_clocks {pll|altpll_component|auto_generated|pll1|clk[*]}]
+
+#**************************************************************
+# Set False Path
+#**************************************************************
+
+
+
+#**************************************************************
+# Set Multicycle Path
+#**************************************************************
+
+set_multicycle_path -to {VGA_*[*]} -setup 2
+set_multicycle_path -to {VGA_*[*]} -hold 1
+
+set_multicycle_path -from [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {pll|altpll_component|auto_generated|pll1|clk[1]}] -setup 2
+set_multicycle_path -from [get_clocks {pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {pll|altpll_component|auto_generated|pll1|clk[1]}] -hold 1
+
+#**************************************************************
+# Set Maximum Delay
+#**************************************************************
+
+
+
+#**************************************************************
+# Set Minimum Delay
+#**************************************************************
+
+
+
+#**************************************************************
+# Set Input Transition
+#**************************************************************
+
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/linux32/duplicate_byte b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/linux32/duplicate_byte
new file mode 100755
index 00000000..f1dff2e9
Binary files /dev/null and b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/linux32/duplicate_byte differ
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/linux32/make_travusa_proms.sh b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/linux32/make_travusa_proms.sh
new file mode 100755
index 00000000..de70348c
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/linux32/make_travusa_proms.sh
@@ -0,0 +1,34 @@
+#!/bin/sh -x
+
+cat zippyrac.000 zippyrac.005 zippyrac.006 zippyrac.007 > travusa_cpu.bin
+./make_vhdl_prom travusa_cpu.bin travusa_cpu.vhd
+
+./make_vhdl_prom zippyrac.001 travusa_chr_bit1.vhd
+./make_vhdl_prom mr8.3c travusa_chr_bit2.vhd
+./make_vhdl_prom mr9.3a travusa_chr_bit3.vhd
+
+./make_vhdl_prom mmi6349.ij travusa_chr_palette.vhd
+
+./make_vhdl_prom zippyrac.008 travusa_spr_bit1.vhd
+./make_vhdl_prom zippyrac.009 travusa_spr_bit2.vhd
+./make_vhdl_prom zippyrac.010 travusa_spr_bit3.vhd
+
+./make_vhdl_prom tbp24s10.3 travusa_spr_palette.vhd
+./make_vhdl_prom tbp18s.2 travusa_spr_rgb_lut.vhd
+
+./make_vhdl_prom mr10.1a travusa_sound.vhd
+
+#rem zr1-0.m3 CRC(be066c0a)
+#rem zr1-5.l3 CRC(145d6b34)
+#rem zr1-6a.k3 CRC(e1b51383)
+#rem zr1-7.j3 CRC(85cd1a51)
+#rem mr10.1a CRC(a02ad8a0)
+#rem zippyrac.001 CRC(aa8994dd)
+#rem mr8.3c CRC(3a046dd1)
+#rem mr9.3a CRC(1cc3d3f4)
+#rem zr1-8.n3 CRC(3e2c7a6b)
+#rem zr1-9.l3 CRC(13be6a14)
+#rem zr1-10.k3 CRC(6fcc9fdb)
+#rem mmi6349.ij CRC(c9724350)
+#rem tbp18s.2 CRC(a1130007)
+#rem tbp24s10.3 CRC(76062638)
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/linux32/make_vhdl_prom b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/linux32/make_vhdl_prom
new file mode 100755
index 00000000..a71da100
Binary files /dev/null and b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/linux32/make_vhdl_prom differ
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win32/duplicate_byte.exe b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win32/duplicate_byte.exe
new file mode 100644
index 00000000..9e205c62
Binary files /dev/null and b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win32/duplicate_byte.exe differ
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win32/make_travusa_proms.bat b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win32/make_travusa_proms.bat
new file mode 100644
index 00000000..ed0a1203
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win32/make_travusa_proms.bat
@@ -0,0 +1,32 @@
+copy /B zr1-0.m3 + zr1-5.l3 + zr1-6a.k3 + zr1-7.j3 travusa_cpu.bin
+make_vhdl_prom travusa_cpu.bin travusa_cpu.vhd
+
+make_vhdl_prom zippyrac.001 travusa_chr_bit1.vhd
+make_vhdl_prom mr8.3c travusa_chr_bit2.vhd
+make_vhdl_prom mr9.3a travusa_chr_bit3.vhd
+
+make_vhdl_prom mmi6349.ij travusa_chr_palette.vhd
+
+make_vhdl_prom zr1-8.n3 travusa_spr_bit1.vhd
+make_vhdl_prom zr1-9.l3 travusa_spr_bit2.vhd
+make_vhdl_prom zr1-10.k3 travusa_spr_bit3.vhd
+
+make_vhdl_prom tbp24s10.3 travusa_spr_palette.vhd
+make_vhdl_prom tbp18s.2 travusa_spr_rgb_lut.vhd
+
+make_vhdl_prom mr10.1a travusa_sound.vhd
+
+rem zr1-0.m3 CRC(be066c0a)
+rem zr1-5.l3 CRC(145d6b34)
+rem zr1-6a.k3 CRC(e1b51383)
+rem zr1-7.j3 CRC(85cd1a51)
+rem mr10.1a CRC(a02ad8a0)
+rem zippyrac.001 CRC(aa8994dd)
+rem mr8.3c CRC(3a046dd1)
+rem mr9.3a CRC(1cc3d3f4)
+rem zr1-8.n3 CRC(3e2c7a6b)
+rem zr1-9.l3 CRC(13be6a14)
+rem zr1-10.k3 CRC(6fcc9fdb)
+rem mmi6349.ij CRC(c9724350)
+rem tbp18s.2 CRC(a1130007)
+rem tbp24s10.3 CRC(76062638)
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win32/make_vhdl_prom.exe b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win32/make_vhdl_prom.exe
new file mode 100644
index 00000000..7dd3525d
Binary files /dev/null and b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win32/make_vhdl_prom.exe differ
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win64/duplicate_byte.exe b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win64/duplicate_byte.exe
new file mode 100644
index 00000000..425e9082
Binary files /dev/null and b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win64/duplicate_byte.exe differ
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win64/make_travusa_proms.bat b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win64/make_travusa_proms.bat
new file mode 100644
index 00000000..ed0a1203
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win64/make_travusa_proms.bat
@@ -0,0 +1,32 @@
+copy /B zr1-0.m3 + zr1-5.l3 + zr1-6a.k3 + zr1-7.j3 travusa_cpu.bin
+make_vhdl_prom travusa_cpu.bin travusa_cpu.vhd
+
+make_vhdl_prom zippyrac.001 travusa_chr_bit1.vhd
+make_vhdl_prom mr8.3c travusa_chr_bit2.vhd
+make_vhdl_prom mr9.3a travusa_chr_bit3.vhd
+
+make_vhdl_prom mmi6349.ij travusa_chr_palette.vhd
+
+make_vhdl_prom zr1-8.n3 travusa_spr_bit1.vhd
+make_vhdl_prom zr1-9.l3 travusa_spr_bit2.vhd
+make_vhdl_prom zr1-10.k3 travusa_spr_bit3.vhd
+
+make_vhdl_prom tbp24s10.3 travusa_spr_palette.vhd
+make_vhdl_prom tbp18s.2 travusa_spr_rgb_lut.vhd
+
+make_vhdl_prom mr10.1a travusa_sound.vhd
+
+rem zr1-0.m3 CRC(be066c0a)
+rem zr1-5.l3 CRC(145d6b34)
+rem zr1-6a.k3 CRC(e1b51383)
+rem zr1-7.j3 CRC(85cd1a51)
+rem mr10.1a CRC(a02ad8a0)
+rem zippyrac.001 CRC(aa8994dd)
+rem mr8.3c CRC(3a046dd1)
+rem mr9.3a CRC(1cc3d3f4)
+rem zr1-8.n3 CRC(3e2c7a6b)
+rem zr1-9.l3 CRC(13be6a14)
+rem zr1-10.k3 CRC(6fcc9fdb)
+rem mmi6349.ij CRC(c9724350)
+rem tbp18s.2 CRC(a1130007)
+rem tbp24s10.3 CRC(76062638)
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win64/make_vhdl_prom.exe b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win64/make_vhdl_prom.exe
new file mode 100644
index 00000000..1e5618bf
Binary files /dev/null and b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/binaries/win64/make_vhdl_prom.exe differ
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/TraverseUSA_MiST.sv b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/TraverseUSA_MiST.sv
new file mode 100644
index 00000000..ea204645
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/TraverseUSA_MiST.sv
@@ -0,0 +1,275 @@
+//============================================================================
+// Arcade: TraverseUSA
+//
+// DarFPGA's core ported to MiST by (C) 2019 Szombathelyi György
+//
+// 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 TraverseUSA_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,
+
+ output [12:0] SDRAM_A,
+ inout [15:0] SDRAM_DQ,
+ output SDRAM_DQML,
+ output SDRAM_DQMH,
+ output SDRAM_nWE,
+ output SDRAM_nCAS,
+ output SDRAM_nRAS,
+ output SDRAM_nCS,
+ output [1:0] SDRAM_BA,
+ output SDRAM_CLK,
+ output SDRAM_CKE
+);
+
+`include "rtl/build_id.v"
+
+localparam CONF_STR = {
+ "TRAVERSE;;",
+ "O2,Rotate Controls,Off,On;",
+ "O34,Scanlines,Off,25%,50%,75%;",
+ "O5,Units,MP,Km;",
+ "O6,Freeze,Disable,Enable;",
+ "O7,Game name,Traverse USA,Zippyrace;",
+ "O8,Demo mode,Off,On;",
+ "O9,Test mode,Off,On;",
+ "T0,Reset;",
+ "V,v1.0.",`BUILD_DATE
+};
+
+assign LED = 1;
+
+wire clk_sys, clk_aud;
+wire pll_locked;
+pll_mist pll(
+ .inclk0(CLOCK_27),
+ .areset(0),
+ .c0(clk_sys),
+ .c1(clk_aud),
+ .locked(pll_locked)
+ );
+
+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 [10:0] audio;
+wire hs, vs;
+wire blankn;
+wire [2:0] g,b;
+wire [1:0] r;
+
+wire [14:0] cart_addr;
+wire [15:0] sdram_do;
+wire cart_rd;
+wire ioctl_downl;
+wire [7:0] ioctl_index;
+wire ioctl_wr;
+wire [24:0] ioctl_addr;
+wire [7:0] ioctl_dout;
+
+data_io data_io (
+ .clk_sys ( clk_sys ),
+ .SPI_SCK ( SPI_SCK ),
+ .SPI_SS2 ( SPI_SS2 ),
+ .SPI_DI ( SPI_DI ),
+ .ioctl_download( ioctl_downl ),
+ .ioctl_index ( ioctl_index ),
+ .ioctl_wr ( ioctl_wr ),
+ .ioctl_addr ( ioctl_addr ),
+ .ioctl_dout ( ioctl_dout )
+);
+
+assign SDRAM_CLK = clk_sys;
+
+sdram cart
+(
+ .*,
+ .init ( ~pll_locked ),
+ .clk ( clk_sys ),
+ .wtbt ( 2'b00 ),
+ .dout ( sdram_do ),
+ .din ( {ioctl_dout, ioctl_dout} ),
+ .addr ( ioctl_downl ? ioctl_addr : cart_addr ),
+ .we ( ioctl_downl & ioctl_wr ),
+ .rd ( !ioctl_downl & cart_rd ),
+ .ready()
+);
+
+reg reset = 1;
+reg rom_loaded = 0;
+always @(posedge clk_sys) begin
+ reg ioctl_downlD;
+ ioctl_downlD <= ioctl_downl;
+
+ if (ioctl_downlD & ~ioctl_downl) rom_loaded <= 1;
+ reset <= status[0] | buttons[1] | ~rom_loaded;
+end
+
+//Coinage_B(7-4) / Cont. play(3) / Fuel consumption(2) / Fuel lost when collision (1-0)
+wire [7:0] dip1 = 8'hff;
+//Diag(7) / Demo(6) / Zippy(5) / Freeze (4) / M-Km(3) / Coin mode (2) / Cocktail(1) / Flip(0)
+wire [7:0] dip2 = { ~status[9], ~status[8], ~status[7], ~status[6], ~status[5], 3'b110 };
+
+// Traverse_usa
+traverse_usa traverse_usa (
+ .clock_36 ( clk_sys ),
+ .clock_0p895 ( clk_aud ),
+ .reset ( status[0] | buttons[1] ),
+
+ .video_r ( r ),
+ .video_g ( g ),
+ .video_b ( b ),
+ .video_hs ( hs ),
+ .video_vs ( vs ),
+ .video_blankn ( blankn ),
+
+ .audio_out ( audio ),
+
+ .cpu_rom_addr ( cart_addr ),
+ .cpu_rom_do ( sdram_do[7:0] ),
+ .cpu_rom_rd ( cart_rd ),
+
+ .dip_switch_1 ( dip1 ),
+ .dip_switch_2 ( dip2 ),
+
+ .start2 ( btn_two_players ),
+ .start1 ( btn_one_player ),
+ .coin1 ( btn_coin ),
+
+ .right1 ( m_right ),
+ .left1 ( m_left ),
+ .brake1 ( m_down ),
+ .accel1 ( m_up ),
+
+ .right2 ( m_right ),
+ .left2 ( m_left ),
+ .brake2 ( m_down ),
+ .accel2 ( m_up )
+);
+
+mist_video #(.COLOR_DEPTH(3), .SD_HCNT_WIDTH(10)) mist_video(
+ .clk_sys ( clk_sys ),
+ .SPI_SCK ( SPI_SCK ),
+ .SPI_SS3 ( SPI_SS3 ),
+ .SPI_DI ( SPI_DI ),
+ .R ( blankn ? {r, r[1] } : 0 ),
+ .G ( blankn ? g : 0 ),
+ .B ( blankn ? b : 0 ),
+ .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]} ),
+ .scandoubler_disable( scandoublerD ),
+ .scanlines ( status[4:3] ),
+ .ypbpr ( ypbpr )
+ );
+
+user_io #(
+ .STRLEN(($size(CONF_STR)>>3)))
+user_io(
+ .clk_sys (clk_sys ),
+ .conf_str (CONF_STR ),
+ .SPI_CLK (SPI_SCK ),
+ .SPI_SS_IO (CONF_DATA0 ),
+ .SPI_MISO (SPI_DO ),
+ .SPI_MOSI (SPI_DI ),
+ .buttons (buttons ),
+ .switches (switches ),
+ .scandoubler_disable (scandoublerD ),
+ .ypbpr (ypbpr ),
+ .key_strobe (key_strobe ),
+ .key_pressed (key_pressed ),
+ .key_code (key_code ),
+ .joystick_0 (joystick_0 ),
+ .joystick_1 (joystick_1 ),
+ .status (status )
+ );
+
+wire dac_o;
+assign AUDIO_L = dac_o;
+assign AUDIO_R = dac_o;
+
+dac #(
+ .C_bits(11))
+dac(
+ .clk_i(clk_aud),
+ .res_n_i(1),
+ .dac_i(audio),
+ .dac_o(dac_o)
+ );
+
+// 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 key_pressed;
+wire [7:0] key_code;
+wire key_strobe;
+
+always @(posedge clk_sys) begin
+ if(key_strobe) begin
+ case(key_code)
+ 'h75: btn_up <= key_pressed; // up
+ 'h72: btn_down <= key_pressed; // down
+ 'h6B: btn_left <= key_pressed; // left
+ 'h74: btn_right <= key_pressed; // right
+ 'h76: btn_coin <= key_pressed; // ESC
+ 'h05: btn_one_player <= key_pressed; // F1
+ 'h06: btn_two_players <= key_pressed; // F2
+ 'h14: btn_fire3 <= key_pressed; // ctrl
+ 'h11: btn_fire2 <= key_pressed; // alt
+ 'h29: btn_fire1 <= key_pressed; // Space
+ endcase
+ end
+end
+
+endmodule
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/YM2149.sv b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/YM2149.sv
new file mode 100644
index 00000000..eae73bb3
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/YM2149.sv
@@ -0,0 +1,329 @@
+//
+// Copyright (c) MikeJ - Jan 2005
+// Copyright (c) 2016-2018 Sorgelig
+//
+// 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.
+//
+
+
+// BDIR BC MODE
+// 0 0 inactive
+// 0 1 read value
+// 1 0 write value
+// 1 1 set address
+//
+
+module YM2149
+(
+ input CLK, // Global clock
+ input CE, // PSG Clock enable
+ input RESET, // Chip RESET (set all Registers to '0', active hi)
+ input BDIR, // Bus Direction (0 - read , 1 - write)
+ input BC, // Bus control
+ input A8,
+ input A9_L,
+ input [7:0] DI, // Data In
+ output [7:0] DO, // Data Out
+ output [7:0] CHANNEL_A, // PSG Output channel A
+ output [7:0] CHANNEL_B, // PSG Output channel B
+ output [7:0] CHANNEL_C, // PSG Output channel C
+
+ input SEL,
+ input MODE,
+
+ output [5:0] ACTIVE,
+
+ input [7:0] IOA_in,
+ output [7:0] IOA_out,
+
+ input [7:0] IOB_in,
+ output [7:0] IOB_out
+);
+
+assign ACTIVE = ~ymreg[7][5:0];
+assign IOA_out = ymreg[7][6] ? ymreg[14] : 8'hff;
+assign IOB_out = ymreg[7][7] ? ymreg[15] : 8'hff;
+
+reg [7:0] addr;
+reg [7:0] ymreg[16];
+wire cs = !A9_L & A8;
+
+// Write to PSG
+reg env_reset;
+always @(posedge CLK) begin
+ if(RESET) begin
+ ymreg <= '{default:0};
+ ymreg[7] <= '1;
+ addr <= '0;
+ env_reset <= 0;
+ end else begin
+ env_reset <= 0;
+ if(cs & BDIR) begin
+ if(BC) addr <= DI;
+ else if(!addr[7:4]) begin
+ ymreg[addr[3:0]] <= DI;
+ env_reset <= (addr == 13);
+ end
+ end
+ end
+end
+
+// Read from PSG
+assign DO = dout;
+reg [7:0] dout;
+always_comb begin
+ dout = 8'hFF;
+ if(cs & ~BDIR & BC & !addr[7:4]) begin
+ case(addr[3:0])
+ 0: dout = ymreg[0];
+ 1: dout = ymreg[1][3:0];
+ 2: dout = ymreg[2];
+ 3: dout = ymreg[3][3:0];
+ 4: dout = ymreg[4];
+ 5: dout = ymreg[5][3:0];
+ 6: dout = ymreg[6][4:0];
+ 7: dout = ymreg[7];
+ 8: dout = ymreg[8][4:0];
+ 9: dout = ymreg[9][4:0];
+ 10: dout = ymreg[10][4:0];
+ 11: dout = ymreg[11];
+ 12: dout = ymreg[12];
+ 13: dout = ymreg[13][3:0];
+ 14: dout = ymreg[7][6] ? ymreg[14] : IOA_in;
+ 15: dout = ymreg[7][7] ? ymreg[15] : IOB_in;
+ endcase
+ end
+end
+
+reg ena_div;
+reg ena_div_noise;
+
+// p_divider
+always @(posedge CLK) begin
+ reg [3:0] cnt_div;
+ reg noise_div;
+
+ if(CE) begin
+ ena_div <= 0;
+ ena_div_noise <= 0;
+ if(!cnt_div) begin
+ cnt_div <= {SEL, 3'b111};
+ ena_div <= 1;
+
+ noise_div <= (~noise_div);
+ if (noise_div) ena_div_noise <= 1;
+ end else begin
+ cnt_div <= cnt_div - 1'b1;
+ end
+ end
+end
+
+
+reg [2:0] noise_gen_op;
+
+// p_noise_gen
+always @(posedge CLK) begin
+ reg [16:0] poly17;
+ reg [4:0] noise_gen_cnt;
+
+ if(CE) begin
+ if (ena_div_noise) begin
+ if (!ymreg[6][4:0] || noise_gen_cnt >= ymreg[6][4:0] - 1'd1) begin
+ noise_gen_cnt <= 0;
+ poly17 <= {(poly17[0] ^ poly17[2] ^ !poly17), poly17[16:1]};
+ end else begin
+ noise_gen_cnt <= noise_gen_cnt + 1'd1;
+ end
+ noise_gen_op <= {3{poly17[0]}};
+ end
+ end
+end
+
+wire [11:0] tone_gen_freq[1:3];
+assign tone_gen_freq[1] = {ymreg[1][3:0], ymreg[0]};
+assign tone_gen_freq[2] = {ymreg[3][3:0], ymreg[2]};
+assign tone_gen_freq[3] = {ymreg[5][3:0], ymreg[4]};
+
+reg [3:1] tone_gen_op;
+
+//p_tone_gens
+always @(posedge CLK) begin
+ integer i;
+ reg [11:0] tone_gen_cnt[1:3];
+
+ if(CE) begin
+ // looks like real chips count up - we need to get the Exact behaviour ..
+
+ for (i = 1; i <= 3; i = i + 1) begin
+ if(ena_div) begin
+ if (tone_gen_freq[i]) begin
+ if (tone_gen_cnt[i] >= (tone_gen_freq[i] - 1'd1)) begin
+ tone_gen_cnt[i] <= 0;
+ tone_gen_op[i] <= ~tone_gen_op[i];
+ end else begin
+ tone_gen_cnt[i] <= tone_gen_cnt[i] + 1'd1;
+ end
+ end else begin
+ tone_gen_op[i] <= ymreg[7][i];
+ tone_gen_cnt[i] <= 0;
+ end
+ end
+ end
+ end
+end
+
+reg env_ena;
+wire [15:0] env_gen_comp = {ymreg[12], ymreg[11]} ? {ymreg[12], ymreg[11]} - 1'd1 : 16'd0;
+
+//p_envelope_freq
+always @(posedge CLK) begin
+ reg [15:0] env_gen_cnt;
+
+ if(CE) begin
+ env_ena <= 0;
+ if(ena_div) begin
+ if (env_gen_cnt >= env_gen_comp) begin
+ env_gen_cnt <= 0;
+ env_ena <= 1;
+ end else begin
+ env_gen_cnt <= (env_gen_cnt + 1'd1);
+ end
+ end
+ end
+end
+
+reg [4:0] env_vol;
+
+wire is_bot = (env_vol == 5'b00000);
+wire is_bot_p1 = (env_vol == 5'b00001);
+wire is_top_m1 = (env_vol == 5'b11110);
+wire is_top = (env_vol == 5'b11111);
+
+always @(posedge CLK) begin
+ reg env_hold;
+ reg env_inc;
+
+ // envelope shapes
+ // C AtAlH
+ // 0 0 x x \___
+ //
+ // 0 1 x x /___
+ //
+ // 1 0 0 0 \\\\
+ //
+ // 1 0 0 1 \___
+ //
+ // 1 0 1 0 \/\/
+ // ___
+ // 1 0 1 1 \
+ //
+ // 1 1 0 0 ////
+ // ___
+ // 1 1 0 1 /
+ //
+ // 1 1 1 0 /\/\
+ //
+ // 1 1 1 1 /___
+
+ if(env_reset | RESET) begin
+ // load initial state
+ if(!ymreg[13][2]) begin // attack
+ env_vol <= 5'b11111;
+ env_inc <= 0; // -1
+ end else begin
+ env_vol <= 5'b00000;
+ env_inc <= 1; // +1
+ end
+ env_hold <= 0;
+ end
+ else if(CE) begin
+ if (env_ena) begin
+ if (!env_hold) begin
+ if (env_inc) env_vol <= (env_vol + 5'b00001);
+ else env_vol <= (env_vol + 5'b11111);
+ end
+
+ // envelope shape control.
+ if(!ymreg[13][3]) begin
+ if(!env_inc) begin // down
+ if(is_bot_p1) env_hold <= 1;
+ end else if (is_top) env_hold <= 1;
+ end else if(ymreg[13][0]) begin // hold = 1
+ if(!env_inc) begin // down
+ if(ymreg[13][1]) begin // alt
+ if(is_bot) env_hold <= 1;
+ end else if(is_bot_p1) env_hold <= 1;
+ end else if(ymreg[13][1]) begin // alt
+ if(is_top) env_hold <= 1;
+ end else if(is_top_m1) env_hold <= 1;
+ end else if(ymreg[13][1]) begin // alternate
+ if(env_inc == 1'b0) begin // down
+ if(is_bot_p1) env_hold <= 1;
+ if(is_bot) begin
+ env_hold <= 0;
+ env_inc <= 1;
+ end
+ end else begin
+ if(is_top_m1) env_hold <= 1;
+ if(is_top) begin
+ env_hold <= 0;
+ env_inc <= 0;
+ end
+ end
+ end
+ end
+ end
+end
+
+reg [5:0] A,B,C;
+always @(posedge CLK) begin
+ A <= {MODE, ~((ymreg[7][0] | tone_gen_op[1]) & (ymreg[7][3] | noise_gen_op[0])) ? 5'd0 : ymreg[8][4] ? env_vol[4:0] : { ymreg[8][3:0], ymreg[8][3]}};
+ B <= {MODE, ~((ymreg[7][1] | tone_gen_op[2]) & (ymreg[7][4] | noise_gen_op[1])) ? 5'd0 : ymreg[9][4] ? env_vol[4:0] : { ymreg[9][3:0], ymreg[9][3]}};
+ C <= {MODE, ~((ymreg[7][2] | tone_gen_op[3]) & (ymreg[7][5] | noise_gen_op[2])) ? 5'd0 : ymreg[10][4] ? env_vol[4:0] : {ymreg[10][3:0], ymreg[10][3]}};
+end
+
+wire [7:0] volTable[64] = '{
+ //YM2149
+ 8'h00, 8'h01, 8'h01, 8'h02, 8'h02, 8'h03, 8'h03, 8'h04,
+ 8'h06, 8'h07, 8'h09, 8'h0a, 8'h0c, 8'h0e, 8'h11, 8'h13,
+ 8'h17, 8'h1b, 8'h20, 8'h25, 8'h2c, 8'h35, 8'h3e, 8'h47,
+ 8'h54, 8'h66, 8'h77, 8'h88, 8'ha1, 8'hc0, 8'he0, 8'hff,
+
+ //AY8910
+ 8'h00, 8'h00, 8'h03, 8'h03, 8'h04, 8'h04, 8'h06, 8'h06,
+ 8'h0a, 8'h0a, 8'h0f, 8'h0f, 8'h15, 8'h15, 8'h22, 8'h22,
+ 8'h28, 8'h28, 8'h41, 8'h41, 8'h5b, 8'h5b, 8'h72, 8'h72,
+ 8'h90, 8'h90, 8'hb5, 8'hb5, 8'hd7, 8'hd7, 8'hff, 8'hff
+};
+
+assign CHANNEL_A = volTable[A];
+assign CHANNEL_B = volTable[B];
+assign CHANNEL_C = volTable[C];
+
+endmodule
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/YM2149_linmix_sep.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/YM2149_linmix_sep.vhd
new file mode 100644
index 00000000..6ed2498a
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/YM2149_linmix_sep.vhd
@@ -0,0 +1,574 @@
+-- changes for seperate audio outputs and enable now enables cpu access as well
+--
+-- A simulation model of YM2149 (AY-3-8910 with bells on)
+
+-- Copyright (c) MikeJ - Jan 2005
+--
+-- 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 support@fpgaarcade.com
+--
+-- Revision list
+--
+-- version 001 initial release
+--
+-- Clues from MAME sound driver and Kazuhiro TSUJIKAWA
+--
+-- These are the measured outputs from a real chip for a single Isolated channel into a 1K load (V)
+-- vol 15 .. 0
+-- 3.27 2.995 2.741 2.588 2.452 2.372 2.301 2.258 2.220 2.198 2.178 2.166 2.155 2.148 2.141 2.132
+-- As the envelope volume is 5 bit, I have fitted a curve to the not quite log shape in order
+-- to produced all the required values.
+-- (The first part of the curve is a bit steeper and the last bit is more linear than expected)
+--
+-- NOTE, this component uses LINEAR mixing of the three analogue channels, and is only
+-- accurate for designs where the outputs are buffered and not simply wired together.
+-- The ouput level is more complex in that case and requires a larger table.
+
+library ieee;
+ use ieee.std_logic_1164.all;
+ use ieee.std_logic_arith.all;
+ use ieee.std_logic_unsigned.all;
+
+entity YM2149 is
+ port (
+ -- data bus
+ I_DA : in std_logic_vector(7 downto 0);
+ O_DA : out std_logic_vector(7 downto 0);
+ O_DA_OE_L : out std_logic;
+ -- control
+ I_A9_L : in std_logic;
+ I_A8 : in std_logic;
+ I_BDIR : in std_logic;
+ I_BC2 : in std_logic;
+ I_BC1 : in std_logic;
+ I_SEL_L : in std_logic;
+
+ O_AUDIO : out std_logic_vector(7 downto 0);
+ O_CHAN : out std_logic_vector(1 downto 0);
+ -- port a
+ I_IOA : in std_logic_vector(7 downto 0);
+ O_IOA : out std_logic_vector(7 downto 0);
+ O_IOA_OE_L : out std_logic;
+ -- port b
+ I_IOB : in std_logic_vector(7 downto 0);
+ O_IOB : out std_logic_vector(7 downto 0);
+ O_IOB_OE_L : out std_logic;
+
+ ENA : in std_logic; -- clock enable for higher speed operation
+ RESET_L : in std_logic;
+ CLK : in std_logic -- note 6 Mhz
+ );
+end;
+
+architecture RTL of YM2149 is
+ type array_16x8 is array (0 to 15) of std_logic_vector( 7 downto 0);
+ type array_3x12 is array (1 to 3) of std_logic_vector(11 downto 0);
+
+ signal cnt_div : std_logic_vector(3 downto 0) := (others => '0');
+ signal cnt_div_t1 : std_logic_vector(3 downto 0);
+ signal noise_div : std_logic := '0';
+ signal ena_div : std_logic;
+ signal ena_div_noise : std_logic;
+ signal poly17 : std_logic_vector(16 downto 0) := (others => '0');
+
+ -- registers
+ signal addr : std_logic_vector(7 downto 0);
+ signal busctrl_addr : std_logic;
+ signal busctrl_we : std_logic;
+ signal busctrl_re : std_logic;
+
+ signal reg : array_16x8;
+ signal env_reset : std_logic;
+ signal ioa_inreg : std_logic_vector(7 downto 0);
+ signal iob_inreg : std_logic_vector(7 downto 0);
+
+ signal noise_gen_cnt : std_logic_vector(4 downto 0);
+ signal noise_gen_op : std_logic;
+ signal tone_gen_cnt : array_3x12 := (others => (others => '0'));
+ signal tone_gen_op : std_logic_vector(3 downto 1) := "000";
+
+ signal env_gen_cnt : std_logic_vector(15 downto 0);
+ signal env_ena : std_logic;
+ signal env_hold : std_logic;
+ signal env_inc : std_logic;
+ signal env_vol : std_logic_vector(4 downto 0);
+
+ signal tone_ena_l : std_logic;
+ signal tone_src : std_logic;
+ signal noise_ena_l : std_logic;
+ signal chan_vol : std_logic_vector(4 downto 0);
+
+ signal dac_amp : std_logic_vector(7 downto 0);
+begin
+ -- cpu i/f
+ p_busdecode : process(I_BDIR, I_BC2, I_BC1, addr, I_A9_L, I_A8)
+ variable cs : std_logic;
+ variable sel : std_logic_vector(2 downto 0);
+ begin
+ -- BDIR BC2 BC1 MODE
+ -- 0 0 0 inactive
+ -- 0 0 1 address
+ -- 0 1 0 inactive
+ -- 0 1 1 read
+ -- 1 0 0 address
+ -- 1 0 1 inactive
+ -- 1 1 0 write
+ -- 1 1 1 read
+ busctrl_addr <= '0';
+ busctrl_we <= '0';
+ busctrl_re <= '0';
+
+ cs := '0';
+ if (I_A9_L = '0') and (I_A8 = '1') and (addr(7 downto 4) = "0000") then
+ cs := '1';
+ end if;
+
+ sel := (I_BDIR & I_BC2 & I_BC1);
+ case sel is
+ when "000" => null;
+ when "001" => busctrl_addr <= '1';
+ when "010" => null;
+ when "011" => busctrl_re <= cs;
+ when "100" => busctrl_addr <= '1';
+ when "101" => null;
+ when "110" => busctrl_we <= cs;
+ when "111" => busctrl_addr <= '1';
+ when others => null;
+ end case;
+ end process;
+
+ p_oe : process(busctrl_re)
+ begin
+ -- if we are emulating a real chip, maybe clock this to fake up the tristate typ delay of 100ns
+ O_DA_OE_L <= not (busctrl_re);
+ end process;
+
+ --
+ -- CLOCKED
+ --
+ p_waddr : process(RESET_L, CLK)
+ begin
+ -- looks like registers are latches in real chip, but the address is caught at the end of the address state.
+ if (RESET_L = '0') then
+ addr <= (others => '0');
+ elsif rising_edge(CLK) then
+ if (ENA = '1') then
+ if (busctrl_addr = '1') then
+ addr <= I_DA;
+ end if;
+ end if;
+ end if;
+ end process;
+
+ p_wdata : process(RESET_L, CLK)
+ begin
+ if (RESET_L = '0') then
+ reg <= (others => (others => '0'));
+ env_reset <= '1';
+ elsif rising_edge(CLK) then
+ if (ENA = '1') then
+ env_reset <= '0';
+ if (busctrl_we = '1') then
+ case addr(3 downto 0) is
+ when x"0" => reg(0) <= I_DA;
+ when x"1" => reg(1) <= I_DA;
+ when x"2" => reg(2) <= I_DA;
+ when x"3" => reg(3) <= I_DA;
+ when x"4" => reg(4) <= I_DA;
+ when x"5" => reg(5) <= I_DA;
+ when x"6" => reg(6) <= I_DA;
+ when x"7" => reg(7) <= I_DA;
+ when x"8" => reg(8) <= I_DA;
+ when x"9" => reg(9) <= I_DA;
+ when x"A" => reg(10) <= I_DA;
+ when x"B" => reg(11) <= I_DA;
+ when x"C" => reg(12) <= I_DA;
+ when x"D" => reg(13) <= I_DA; env_reset <= '1';
+ when x"E" => reg(14) <= I_DA;
+ when x"F" => reg(15) <= I_DA;
+ when others => null;
+ end case;
+ end if;
+ end if;
+ end if;
+ end process;
+
+ p_rdata : process(busctrl_re, addr, reg, ioa_inreg, iob_inreg)
+ begin
+ O_DA <= (others => '0'); -- 'X'
+ if (busctrl_re = '1') then -- not necessary, but useful for putting 'X's in the simulator
+ case addr(3 downto 0) is
+ when x"0" => O_DA <= reg(0) ;
+ when x"1" => O_DA <= "0000" & reg(1)(3 downto 0) ;
+ when x"2" => O_DA <= reg(2) ;
+ when x"3" => O_DA <= "0000" & reg(3)(3 downto 0) ;
+ when x"4" => O_DA <= reg(4) ;
+ when x"5" => O_DA <= "0000" & reg(5)(3 downto 0) ;
+ when x"6" => O_DA <= "000" & reg(6)(4 downto 0) ;
+ when x"7" => O_DA <= reg(7) ;
+ when x"8" => O_DA <= "000" & reg(8)(4 downto 0) ;
+ when x"9" => O_DA <= "000" & reg(9)(4 downto 0) ;
+ when x"A" => O_DA <= "000" & reg(10)(4 downto 0) ;
+ when x"B" => O_DA <= reg(11);
+ when x"C" => O_DA <= reg(12);
+ when x"D" => O_DA <= "0000" & reg(13)(3 downto 0);
+ when x"E" => if (reg(7)(6) = '0') then -- input
+ O_DA <= ioa_inreg;
+ else
+ O_DA <= reg(14); -- read output reg
+ end if;
+ when x"F" => if (Reg(7)(7) = '0') then
+ O_DA <= iob_inreg;
+ else
+ O_DA <= reg(15);
+ end if;
+ when others => null;
+ end case;
+ end if;
+ end process;
+ --
+ p_divider : process
+ begin
+ wait until rising_edge(CLK);
+ -- / 8 when SEL is high and /16 when SEL is low
+ if (ENA = '1') then
+ ena_div <= '0';
+ ena_div_noise <= '0';
+ if (cnt_div = "0000") then
+ cnt_div <= (not I_SEL_L) & "111";
+ ena_div <= '1';
+
+ noise_div <= not noise_div;
+ if (noise_div = '1') then
+ ena_div_noise <= '1';
+ end if;
+ else
+ cnt_div <= cnt_div - "1";
+ end if;
+ end if;
+ end process;
+
+ p_noise_gen : process
+ variable noise_gen_comp : std_logic_vector(4 downto 0);
+ variable poly17_zero : std_logic;
+ begin
+ wait until rising_edge(CLK);
+ if (reg(6)(4 downto 0) = "00000") then
+ noise_gen_comp := "00000";
+ else
+ noise_gen_comp := (reg(6)(4 downto 0) - "1");
+ end if;
+
+ poly17_zero := '0';
+ if (poly17 = "00000000000000000") then poly17_zero := '1'; end if;
+
+ if (ENA = '1') then
+ if (ena_div_noise = '1') then -- divider ena
+
+ if (noise_gen_cnt >= noise_gen_comp) then
+ noise_gen_cnt <= "00000";
+ poly17 <= (poly17(0) xor poly17(2) xor poly17_zero) & poly17(16 downto 1);
+ else
+ noise_gen_cnt <= (noise_gen_cnt + "1");
+ end if;
+ end if;
+ end if;
+ end process;
+ noise_gen_op <= poly17(0);
+
+ p_tone_gens : process
+ variable tone_gen_freq : array_3x12;
+ variable tone_gen_comp : array_3x12;
+ begin
+ wait until rising_edge(CLK);
+ -- looks like real chips count up - we need to get the Exact behaviour ..
+ tone_gen_freq(1) := reg(1)(3 downto 0) & reg(0);
+ tone_gen_freq(2) := reg(3)(3 downto 0) & reg(2);
+ tone_gen_freq(3) := reg(5)(3 downto 0) & reg(4);
+ -- period 0 = period 1
+ for i in 1 to 3 loop
+ if (tone_gen_freq(i) = x"000") then
+ tone_gen_comp(i) := x"000";
+ else
+ tone_gen_comp(i) := (tone_gen_freq(i) - "1");
+ end if;
+ end loop;
+
+ if (ENA = '1') then
+ for i in 1 to 3 loop
+ if (ena_div = '1') then -- divider ena
+
+ if (tone_gen_cnt(i) >= tone_gen_comp(i)) then
+ tone_gen_cnt(i) <= x"000";
+ tone_gen_op(i) <= not tone_gen_op(i);
+ else
+ tone_gen_cnt(i) <= (tone_gen_cnt(i) + "1");
+ end if;
+ end if;
+ end loop;
+ end if;
+ end process;
+
+ p_envelope_freq : process
+ variable env_gen_freq : std_logic_vector(15 downto 0);
+ variable env_gen_comp : std_logic_vector(15 downto 0);
+ begin
+ wait until rising_edge(CLK);
+ env_gen_freq := reg(12) & reg(11);
+ -- envelope freqs 1 and 0 are the same.
+ if (env_gen_freq = x"0000") then
+ env_gen_comp := x"0000";
+ else
+ env_gen_comp := (env_gen_freq - "1");
+ end if;
+
+ if (ENA = '1') then
+ env_ena <= '0';
+ if (ena_div = '1') then -- divider ena
+ if (env_gen_cnt >= env_gen_comp) then
+ env_gen_cnt <= x"0000";
+ env_ena <= '1';
+ else
+ env_gen_cnt <= (env_gen_cnt + "1");
+ end if;
+ end if;
+ end if;
+ end process;
+
+ p_envelope_shape : process(env_reset, reg, CLK)
+ variable is_bot : boolean;
+ variable is_bot_p1 : boolean;
+ variable is_top_m1 : boolean;
+ variable is_top : boolean;
+ begin
+ -- envelope shapes
+ -- C AtAlH
+ -- 0 0 x x \___
+ --
+ -- 0 1 x x /___
+ --
+ -- 1 0 0 0 \\\\
+ --
+ -- 1 0 0 1 \___
+ --
+ -- 1 0 1 0 \/\/
+ -- ___
+ -- 1 0 1 1 \
+ --
+ -- 1 1 0 0 ////
+ -- ___
+ -- 1 1 0 1 /
+ --
+ -- 1 1 1 0 /\/\
+ --
+ -- 1 1 1 1 /___
+ if (env_reset = '1') then
+ -- load initial state
+ if (reg(13)(2) = '0') then -- attack
+ env_vol <= "11111";
+ env_inc <= '0'; -- -1
+ else
+ env_vol <= "00000";
+ env_inc <= '1'; -- +1
+ end if;
+ env_hold <= '0';
+
+ elsif rising_edge(CLK) then
+ is_bot := (env_vol = "00000");
+ is_bot_p1 := (env_vol = "00001");
+ is_top_m1 := (env_vol = "11110");
+ is_top := (env_vol = "11111");
+
+ if (ENA = '1') then
+ if (env_ena = '1') then
+ if (env_hold = '0') then
+ if (env_inc = '1') then
+ env_vol <= (env_vol + "00001");
+ else
+ env_vol <= (env_vol + "11111");
+ end if;
+ end if;
+
+ -- envelope shape control.
+ if (reg(13)(3) = '0') then
+ if (env_inc = '0') then -- down
+ if is_bot_p1 then env_hold <= '1'; end if;
+ else
+ if is_top then env_hold <= '1'; end if;
+ end if;
+ else
+ if (reg(13)(0) = '1') then -- hold = 1
+ if (env_inc = '0') then -- down
+ if (reg(13)(1) = '1') then -- alt
+ if is_bot then env_hold <= '1'; end if;
+ else
+ if is_bot_p1 then env_hold <= '1'; end if;
+ end if;
+ else
+ if (reg(13)(1) = '1') then -- alt
+ if is_top then env_hold <= '1'; end if;
+ else
+ if is_top_m1 then env_hold <= '1'; end if;
+ end if;
+ end if;
+
+ elsif (reg(13)(1) = '1') then -- alternate
+ if (env_inc = '0') then -- down
+ if is_bot_p1 then env_hold <= '1'; end if;
+ if is_bot then env_hold <= '0'; env_inc <= '1'; end if;
+ else
+ if is_top_m1 then env_hold <= '1'; end if;
+ if is_top then env_hold <= '0'; env_inc <= '0'; end if;
+ end if;
+ end if;
+
+ end if;
+ end if;
+ end if;
+ end if;
+ end process;
+
+ p_chan_mixer : process(cnt_div, reg, tone_gen_op)
+ begin
+ tone_ena_l <= '1'; tone_src <= '1';
+ noise_ena_l <= '1'; chan_vol <= "00000";
+ case cnt_div(1 downto 0) is
+ when "00" =>
+ tone_ena_l <= reg(7)(0); tone_src <= tone_gen_op(1); chan_vol <= reg(8)(4 downto 0);
+ noise_ena_l <= reg(7)(3);
+ when "01" =>
+ tone_ena_l <= reg(7)(1); tone_src <= tone_gen_op(2); chan_vol <= reg(9)(4 downto 0);
+ noise_ena_l <= reg(7)(4);
+ when "10" =>
+ tone_ena_l <= reg(7)(2); tone_src <= tone_gen_op(3); chan_vol <= reg(10)(4 downto 0);
+ noise_ena_l <= reg(7)(5);
+ when "11" => null; -- tone gen outputs become valid on this clock
+ when others => null;
+ end case;
+ end process;
+
+ p_op_mixer : process
+ variable chan_mixed : std_logic;
+ variable chan_amp : std_logic_vector(4 downto 0);
+ begin
+ wait until rising_edge(CLK);
+ if (ENA = '1') then
+
+ chan_mixed := (tone_ena_l or tone_src) and (noise_ena_l or noise_gen_op);
+
+ chan_amp := (others => '0');
+ if (chan_mixed = '1') then
+ if (chan_vol(4) = '0') then
+ if (chan_vol(3 downto 0) = "0000") then -- nothing is easy ! make sure quiet is quiet
+ chan_amp := "00000";
+ else
+ chan_amp := chan_vol(3 downto 0) & '1'; -- make sure level 31 (env) = level 15 (tone)
+ end if;
+ else
+ chan_amp := env_vol(4 downto 0);
+ end if;
+ end if;
+
+ dac_amp <= x"00";
+ case chan_amp is
+ when "11111" => dac_amp <= x"FF";
+ when "11110" => dac_amp <= x"D9";
+ when "11101" => dac_amp <= x"BA";
+ when "11100" => dac_amp <= x"9F";
+ when "11011" => dac_amp <= x"88";
+ when "11010" => dac_amp <= x"74";
+ when "11001" => dac_amp <= x"63";
+ when "11000" => dac_amp <= x"54";
+ when "10111" => dac_amp <= x"48";
+ when "10110" => dac_amp <= x"3D";
+ when "10101" => dac_amp <= x"34";
+ when "10100" => dac_amp <= x"2C";
+ when "10011" => dac_amp <= x"25";
+ when "10010" => dac_amp <= x"1F";
+ when "10001" => dac_amp <= x"1A";
+ when "10000" => dac_amp <= x"16";
+ when "01111" => dac_amp <= x"13";
+ when "01110" => dac_amp <= x"10";
+ when "01101" => dac_amp <= x"0D";
+ when "01100" => dac_amp <= x"0B";
+ when "01011" => dac_amp <= x"09";
+ when "01010" => dac_amp <= x"08";
+ when "01001" => dac_amp <= x"07";
+ when "01000" => dac_amp <= x"06";
+ when "00111" => dac_amp <= x"05";
+ when "00110" => dac_amp <= x"04";
+ when "00101" => dac_amp <= x"03";
+ when "00100" => dac_amp <= x"03";
+ when "00011" => dac_amp <= x"02";
+ when "00010" => dac_amp <= x"02";
+ when "00001" => dac_amp <= x"01";
+ when "00000" => dac_amp <= x"00";
+ when others => null;
+ end case;
+
+ cnt_div_t1 <= cnt_div;
+ end if;
+ end process;
+
+ p_audio_output : process(RESET_L, CLK)
+ begin
+ if (RESET_L = '0') then
+ O_AUDIO <= (others => '0');
+ O_CHAN <= (others => '0');
+ elsif rising_edge(CLK) then
+
+ if (ENA = '1') then
+ O_AUDIO <= dac_amp(7 downto 0);
+ O_CHAN <= cnt_div_t1(1 downto 0);
+ end if;
+ end if;
+ end process;
+
+ p_io_ports : process(reg)
+ begin
+ O_IOA <= reg(14);
+ O_IOA_OE_L <= not reg(7)(6);
+ O_IOB <= reg(15);
+ O_IOB_OE_L <= not reg(7)(7);
+ end process;
+
+ p_io_ports_inreg : process
+ begin
+ wait until rising_edge(CLK);
+ if (ENA = '1') then -- resync
+ ioa_inreg <= I_IOA;
+ iob_inreg <= I_IOB;
+ end if;
+ end process;
+end architecture RTL;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/build_id.tcl b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/build_id.tcl
new file mode 100644
index 00000000..938515d8
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/build_id.tcl
@@ -0,0 +1,35 @@
+# ================================================================================
+#
+# Build ID Verilog Module Script
+# Jeff Wiencrot - 8/1/2011
+#
+# Generates a Verilog module that contains a timestamp,
+# from the current build. These values are available from the build_date, build_time,
+# physical_address, and host_name output ports of the build_id module in the build_id.v
+# Verilog source file.
+#
+# ================================================================================
+
+proc generateBuildID_Verilog {} {
+
+ # Get the timestamp (see: http://www.altera.com/support/examples/tcl/tcl-date-time-stamp.html)
+ set buildDate [ clock format [ clock seconds ] -format %y%m%d ]
+ set buildTime [ clock format [ clock seconds ] -format %H%M%S ]
+
+ # Create a Verilog file for output
+ set outputFileName "rtl/build_id.v"
+ set outputFile [open $outputFileName "w"]
+
+ # Output the Verilog source
+ puts $outputFile "`define BUILD_DATE \"$buildDate\""
+ puts $outputFile "`define BUILD_TIME \"$buildTime\""
+ close $outputFile
+
+ # Send confirmation message to the Messages window
+ post_message "Generated build identification Verilog module: [pwd]/$outputFileName"
+ post_message "Date: $buildDate"
+ post_message "Time: $buildTime"
+}
+
+# Comment out this line to prevent the process from automatically executing when the file is sourced:
+generateBuildID_Verilog
\ No newline at end of file
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/cpu09l_128.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/cpu09l_128.vhd
new file mode 100644
index 00000000..12039bde
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/cpu09l_128.vhd
@@ -0,0 +1,5906 @@
+--===========================================================================--
+-- --
+-- Synthesizable 6809 instruction compatible VHDL CPU core --
+-- --
+--===========================================================================--
+--
+-- File name : cpu09l.vhd
+--
+-- Entity name : cpu09
+--
+-- Purpose : 6809 instruction compatible CPU core written in VHDL
+-- with Last Instruction Cycle, bus available, bus status,
+-- and instruction fetch signals.
+-- Not cycle compatible with the original 6809 CPU
+--
+-- Dependencies : ieee.std_logic_1164
+-- ieee.std_logic_unsigned
+--
+-- Author : John E. Kent
+--
+-- Email : dilbert57@opencores.org
+--
+-- Web : http://opencores.org/project,system09
+--
+-- Description : VMA (valid memory address) is hight whenever a valid memory
+-- access is made by an instruction fetch, interrupt vector fetch
+-- or a data read or write otherwise it is low indicating an idle
+-- bus cycle.
+-- IFETCH (instruction fetch output) is high whenever an
+-- instruction byte is read i.e. the program counter is applied
+-- to the address bus.
+-- LIC (last instruction cycle output) is normally low
+-- but goes high on the last cycle of an instruction.
+-- BA (bus available output) is normally low but goes high while
+-- waiting in a Sync instruction state or the CPU is halted
+-- i.e. a DMA grant.
+-- BS (bus status output) is normally low but goes high during an
+-- interrupt or reset vector fetch or the processor is halted
+-- i.e. a DMA grant.
+--
+-- Copyright (C) 2003 - 2010 John Kent
+--
+-- 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 3 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, see .
+--
+--===========================================================================--
+-- --
+-- Revision History --
+-- --
+--===========================================================================--
+--
+-- Version 0.1 - 26 June 2003 - John Kent
+-- Added extra level in state stack
+-- fixed some calls to the extended addressing state
+--
+-- Version 0.2 - 5 Sept 2003 - John Kent
+-- Fixed 16 bit indexed offset (was doing read rather than fetch)
+-- Added/Fixed STY and STS instructions.
+-- ORCC_STATE ANDed CC state rather than ORed it - Now fixed
+-- CMPX Loaded ACCA and ACCB - Now fixed
+--
+-- Version 1.0 - 6 Sep 2003 - John Kent
+-- Initial release to Open Cores
+-- reversed clock edge
+--
+-- Version 1.1 - 29 November 2003 John kent
+-- ACCA and ACCB indexed offsets are 2's complement.
+-- ALU Right Mux now sign extends ACCA & ACCB offsets
+-- Absolute Indirect addressing performed a read on the
+-- second byte of the address rather than a fetch
+-- so it formed an incorrect address. Now fixed.
+--
+-- Version 1.2 - 29 November 2003 John Kent
+-- LEAX and LEAY affect the Z bit only
+-- LEAS and LEAU do not affect any condition codes
+-- added an extra ALU control for LEA.
+--
+-- Version 1.3 - 12 December 2003 John Kent
+-- CWAI did not work, was missed a PUSH_ST on calling
+-- the ANDCC_STATE. Thanks go to Ghassan Kraidy for
+-- finding this fault.
+--
+-- Version 1.4 - 12 December 2003 John Kent
+-- Missing cc_ctrl assignment in otherwise case of
+-- lea_state resulted in cc_ctrl being latched in
+-- that state.
+-- The otherwise statement should never be reached,
+-- and has been fixed simply to resolve synthesis warnings.
+--
+-- Version 1.5 - 17 january 2004 John kent
+-- The clear instruction used "alu_ld8" to control the ALU
+-- rather than "alu_clr". This mean the Carry was not being
+-- cleared correctly.
+--
+-- Version 1.6 - 24 January 2004 John Kent
+-- Fixed problems in PSHU instruction
+--
+-- Version 1.7 - 25 January 2004 John Kent
+-- removed redundant "alu_inx" and "alu_dex'
+-- Removed "test_alu" and "test_cc"
+-- STD instruction did not set condition codes
+-- JMP direct was not decoded properly
+-- CLR direct performed an unwanted read cycle
+-- Bogus "latch_md" in Page2 indexed addressing
+--
+-- Version 1.8 - 27 January 2004 John Kent
+-- CWAI in decode1_state should increment the PC.
+-- ABX is supposed to be an unsigned addition.
+-- Added extra ALU function
+-- ASR8 slightly changed in the ALU.
+--
+-- Version 1.9 - 20 August 2005
+-- LSR8 is now handled in ASR8 and ROR8 case in the ALU,
+-- rather than LSR16. There was a problem with single
+-- operand instructions using the MD register which is
+-- sign extended on the first 8 bit fetch.
+--
+-- Version 1.10 - 13 September 2005
+-- TFR & EXG instructions did not work for the Condition Code Register
+-- An extra case has been added to the ALU for the alu_tfr control
+-- to assign the left ALU input (alu_left) to the condition code
+-- outputs (cc_out).
+--
+-- Version 1.11 - 16 September 2005
+-- JSR ,X should not predecrement S before calculating the jump address.
+-- The reason is that JSR [0,S] needs S to point to the top of the stack
+-- to fetch a valid vector address. The solution is to have the addressing
+-- mode microcode called before decrementing S and then decrementing S in
+-- JSR_STATE. JSR_STATE in turn calls PUSH_RETURN_LO_STATE rather than
+-- PUSH_RETURN_HI_STATE so that both the High & Low halves of the PC are
+-- pushed on the stack. This adds one extra bus cycle, but resolves the
+-- addressing conflict. I've also removed the pre-decement S in
+-- JSR EXTENDED as it also calls JSR_STATE.
+--
+-- Version 1.12 - 6th June 2006
+-- 6809 Programming reference manual says V is not affected by ASR, LSR and ROR
+-- This is different to the 6800. CLR should reset the V bit.
+--
+-- Version 1.13 - 7th July 2006
+-- Disable NMI on reset until S Stack pointer has been loaded.
+-- Added nmi_enable signal in sp_reg process and nmi_handler process.
+--
+-- Version 1.14 - 11th July 2006
+-- 1. Added new state to RTI called rti_entire_state.
+-- This state tests the CC register after it has been loaded
+-- from the stack. Previously the current CC was tested which
+-- was incorrect. The Entire Flag should be set before the
+-- interrupt stacks the CC.
+-- 2. On bogus Interrupts, int_cc_state went to rti_state,
+-- which was an enumerated state, but not defined anywhere.
+-- rti_state has been changed to rti_cc_state so that bogus interrupt
+-- will perform an RTI after entering that state.
+-- 3. Sync should generate an interrupt if the interrupt masks
+-- are cleared. If the interrupt masks are set, then an interrupt
+-- will cause the the PC to advance to the next instruction.
+-- Note that I don't wait for an interrupt to be asserted for
+-- three clock cycles.
+-- 4. Added new ALU control state "alu_mul". "alu_mul" is used in
+-- the Multiply instruction replacing "alu_add16". This is similar
+-- to "alu_add16" except it sets the Carry bit to B7 of the result
+-- in ACCB, sets the Zero bit if the 16 bit result is zero, but
+-- does not affect The Half carry (H), Negative (N) or Overflow (V)
+-- flags. The logic was re-arranged so that it adds md or zero so
+-- that the Carry condition code is set on zero multiplicands.
+-- 5. DAA (Decimal Adjust Accumulator) should set the Negative (N)
+-- and Zero Flags. It will also affect the Overflow (V) flag although
+-- the operation is undefined. It's anyones guess what DAA does to V.
+--
+-- Version 1.15 - 25th Feb 2007 - John Kent
+-- line 9672 changed "if Halt <= '1' then" to "if Halt = '1' then"
+-- Changed sensitivity lists.
+--
+-- Version 1.16 - 5th February 2008 - John Kent
+-- FIRQ interrupts should take priority over IRQ Interrupts.
+-- This presumably means they should be tested for before IRQ
+-- when they happen concurrently.
+--
+-- Version 1.17 - 18th February 2008 - John Kent
+-- NMI in CWAI should mask IRQ and FIRQ interrupts
+--
+-- Version 1.18 - 21st February 2008 - John Kent
+-- Removed default register settings in each case statement
+-- and placed them at the beginning of the state sequencer.
+-- Modified the SYNC instruction so that the interrupt vector(iv)
+-- is not set unless an unmasked FIRQ or IRQ is received.
+--
+-- Version 1.19 - 25th February 2008 - John Kent
+-- Enumerated separate states for FIRQ/FAST and NMIIRQ/ENTIRE
+-- Enumerated separate states for MASKI and MASKIF states
+-- Removed code on BSR/JSR in fetch cycle
+--
+-- Version 1.20 - 8th October 2011 - John Kent
+-- added fetch output which should go high during the fetch cycle
+--
+-- Version 1.21 - 8th October 2011 - John Kent
+-- added Last Instruction Cycle signal
+-- replaced fetch with ifetch (instruction fetch) signal
+-- added ba & bs (bus available & bus status) signals
+--
+-- Version 1.22 - 2011-10-29 John Kent
+-- The halt state isn't correct.
+-- The halt state is entered into from the fetch_state
+-- It returned to the fetch state which may re-run an execute cycle
+-- on the accumulator and it won't necessarily be the last instruction cycle
+-- I've changed the halt state to return to the decode1_state
+--
+-- Version 1.23 - 2011-10-30 John Kent
+-- sample halt in the change_state process if lic is high (last instruction cycle)
+--
+-- Version 1.24 - 2011-11-01 John Kent
+-- Handle interrupts in change_state process
+-- Sample interrupt inputs on last instruction cycle
+-- Remove iv_ctrl and implement iv (interrupt vector) in change_state process.
+-- Generate fic (first instruction cycle) from lic (last instruction cycle)
+-- and use it to complete the dual operand execute cycle before servicing
+-- halt or interrupts requests.
+-- rename lic to lic_out on the entity declaration so that lic can be tested internally.
+-- add int_firq1_state and int_nmirq1_state to allow for the dual operand execute cycle
+-- integrated nmi_ctrl into change_state process
+-- Reduces the microcode state stack to one entry (saved_state)
+-- imm16_state jumps directly to the fetch_state
+-- pull_return_lo states jumps directly to the fetch_state
+-- duplicate andcc_state as cwai_state
+-- rename exg1_state as exg2 state and duplicate tfr_state as exg1_state
+--
+-- Version 1.25 - 2011-11-27 John Kent
+-- Changed the microcode for saving registers on an interrupt into a microcode subroutine.
+-- Removed SWI servicing from the change state process and made SWI, SWI2 & SWI3
+-- call the interrupt microcode subroutine.
+-- Added additional states for nmi, and irq for interrupt servicing.
+-- Added additional states for nmi/irq, firq, and swi interrupts to mask I & F flags.
+--
+-- Version 1.26 - 2013-03-18 John Kent
+-- pre-initialized cond_true variable to true in state sequencer
+-- re-arranged change_state process slightly
+--
+-- Version 1.27 - 2015-05-30 John Kent
+-- Added test in state machine for masked IRQ and FIRQ in Sync_state.
+--
+-- Version 1.28 - 2015-05-30 John Kent.
+-- Moved IRQ and FIRQ test from state machine to the state sequencer Sync_state.
+--
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_unsigned.all;
+
+entity cpu09 is
+ port (
+ clk : in std_logic; -- E clock input (falling edge)
+ rst : in std_logic; -- reset input (active high)
+ vma : out std_logic; -- valid memory address (active high)
+ lic_out : out std_logic; -- last instruction cycle (active high)
+ ifetch : out std_logic; -- instruction fetch cycle (active high)
+ opfetch : out std_logic; -- opcode fetch (active high)
+ ba : out std_logic; -- bus available (high on sync wait or DMA grant)
+ bs : out std_logic; -- bus status (high on interrupt or reset vector fetch or DMA grant)
+ addr : out std_logic_vector(15 downto 0); -- address bus output
+ rw : out std_logic; -- read not write output
+ data_out : out std_logic_vector(7 downto 0); -- data bus output
+ data_in : in std_logic_vector(7 downto 0); -- data bus input
+ irq : in std_logic; -- interrupt request input (active high)
+ firq : in std_logic; -- fast interrupt request input (active high)
+ nmi : in std_logic; -- non maskable interrupt request input (active high)
+ halt : in std_logic; -- halt input (active high) grants DMA
+ hold : in std_logic -- hold input (active high) extend bus cycle
+ );
+end cpu09;
+
+architecture rtl of cpu09 is
+
+ constant EBIT : integer := 7;
+ constant FBIT : integer := 6;
+ constant HBIT : integer := 5;
+ constant IBIT : integer := 4;
+ constant NBIT : integer := 3;
+ constant ZBIT : integer := 2;
+ constant VBIT : integer := 1;
+ constant CBIT : integer := 0;
+
+ --
+ -- Interrupt vector modifiers
+ --
+ constant RST_VEC : std_logic_vector(2 downto 0) := "111";
+ constant NMI_VEC : std_logic_vector(2 downto 0) := "110";
+ constant SWI_VEC : std_logic_vector(2 downto 0) := "101";
+ constant IRQ_VEC : std_logic_vector(2 downto 0) := "100";
+ constant FIRQ_VEC : std_logic_vector(2 downto 0) := "011";
+ constant SWI2_VEC : std_logic_vector(2 downto 0) := "010";
+ constant SWI3_VEC : std_logic_vector(2 downto 0) := "001";
+ constant RESV_VEC : std_logic_vector(2 downto 0) := "000";
+
+ type state_type is (-- Start off in Reset
+ reset_state,
+ -- Fetch Interrupt Vectors (including reset)
+ vect_lo_state, vect_hi_state, vect_idle_state,
+ -- Fetch Instruction Cycle
+ fetch_state,
+ -- Decode Instruction Cycles
+ decode1_state, decode2_state, decode3_state,
+ -- Calculate Effective Address
+ imm16_state,
+ indexed_state, index8_state, index16_state, index16_2_state,
+ pcrel8_state, pcrel16_state, pcrel16_2_state,
+ indexaddr_state, indexaddr2_state,
+ postincr1_state, postincr2_state,
+ indirect_state, indirect2_state, indirect3_state,
+ extended_state,
+ -- single ops
+ single_op_read_state,
+ single_op_exec_state,
+ single_op_write_state,
+ -- Dual op states
+ dual_op_read8_state, dual_op_read16_state, dual_op_read16_2_state,
+ dual_op_write8_state, dual_op_write16_state,
+ --
+ sync_state, halt_state, cwai_state,
+ --
+ andcc_state, orcc_state,
+ tfr_state,
+ exg_state, exg1_state, exg2_state,
+ lea_state,
+ -- Multiplication
+ mul_state, mulea_state, muld_state,
+ mul0_state, mul1_state, mul2_state, mul3_state,
+ mul4_state, mul5_state, mul6_state, mul7_state,
+ -- Branches
+ lbranch_state, sbranch_state,
+ -- Jumps, Subroutine Calls and Returns
+ jsr_state, jmp_state,
+ push_return_hi_state, push_return_lo_state,
+ pull_return_hi_state, pull_return_lo_state,
+ -- Interrupt cycles
+ int_nmi_state, int_nmi1_state,
+ int_irq_state, int_irq1_state,
+ int_firq_state, int_firq1_state,
+ int_entire_state, int_fast_state,
+ int_pcl_state, int_pch_state,
+ int_upl_state, int_uph_state,
+ int_iyl_state, int_iyh_state,
+ int_ixl_state, int_ixh_state,
+ int_dp_state,
+ int_accb_state, int_acca_state,
+ int_cc_state,
+ int_cwai_state,
+ int_nmimask_state, int_firqmask_state, int_swimask_state, int_irqmask_state,
+ -- Return From Interrupt
+ rti_cc_state, rti_entire_state,
+ rti_acca_state, rti_accb_state,
+ rti_dp_state,
+ rti_ixl_state, rti_ixh_state,
+ rti_iyl_state, rti_iyh_state,
+ rti_upl_state, rti_uph_state,
+ rti_pcl_state, rti_pch_state,
+ -- Push Registers using SP
+ pshs_state,
+ pshs_pcl_state, pshs_pch_state,
+ pshs_upl_state, pshs_uph_state,
+ pshs_iyl_state, pshs_iyh_state,
+ pshs_ixl_state, pshs_ixh_state,
+ pshs_dp_state,
+ pshs_acca_state, pshs_accb_state,
+ pshs_cc_state,
+ -- Pull Registers using SP
+ puls_state,
+ puls_cc_state,
+ puls_acca_state, puls_accb_state,
+ puls_dp_state,
+ puls_ixl_state, puls_ixh_state,
+ puls_iyl_state, puls_iyh_state,
+ puls_upl_state, puls_uph_state,
+ puls_pcl_state, puls_pch_state,
+ -- Push Registers using UP
+ pshu_state,
+ pshu_pcl_state, pshu_pch_state,
+ pshu_spl_state, pshu_sph_state,
+ pshu_iyl_state, pshu_iyh_state,
+ pshu_ixl_state, pshu_ixh_state,
+ pshu_dp_state,
+ pshu_acca_state, pshu_accb_state,
+ pshu_cc_state,
+ -- Pull Registers using UP
+ pulu_state,
+ pulu_cc_state,
+ pulu_acca_state, pulu_accb_state,
+ pulu_dp_state,
+ pulu_ixl_state, pulu_ixh_state,
+ pulu_iyl_state, pulu_iyh_state,
+ pulu_spl_state, pulu_sph_state,
+ pulu_pcl_state, pulu_pch_state );
+
+ type st_type is (reset_st, push_st, idle_st );
+ type iv_type is (latch_iv, swi3_iv, swi2_iv, firq_iv, irq_iv, swi_iv, nmi_iv, reset_iv);
+ type addr_type is (idle_ad, fetch_ad, read_ad, write_ad, pushu_ad, pullu_ad, pushs_ad, pulls_ad, int_hi_ad, int_lo_ad );
+ type dout_type is (cc_dout, acca_dout, accb_dout, dp_dout,
+ ix_lo_dout, ix_hi_dout, iy_lo_dout, iy_hi_dout,
+ up_lo_dout, up_hi_dout, sp_lo_dout, sp_hi_dout,
+ pc_lo_dout, pc_hi_dout, md_lo_dout, md_hi_dout );
+ type op_type is (reset_op, fetch_op, latch_op );
+ type pre_type is (reset_pre, fetch_pre, latch_pre );
+ type cc_type is (reset_cc, load_cc, pull_cc, latch_cc );
+ type acca_type is (reset_acca, load_acca, load_hi_acca, pull_acca, latch_acca );
+ type accb_type is (reset_accb, load_accb, pull_accb, latch_accb );
+ type dp_type is (reset_dp, load_dp, pull_dp, latch_dp );
+ type ix_type is (reset_ix, load_ix, pull_lo_ix, pull_hi_ix, latch_ix );
+ type iy_type is (reset_iy, load_iy, pull_lo_iy, pull_hi_iy, latch_iy );
+ type sp_type is (reset_sp, latch_sp, load_sp, pull_hi_sp, pull_lo_sp );
+ type up_type is (reset_up, latch_up, load_up, pull_hi_up, pull_lo_up );
+ type pc_type is (reset_pc, latch_pc, load_pc, pull_lo_pc, pull_hi_pc, incr_pc );
+ type md_type is (reset_md, latch_md, load_md, fetch_first_md, fetch_next_md, shiftl_md );
+ type ea_type is (reset_ea, latch_ea, load_ea, fetch_first_ea, fetch_next_ea );
+ type left_type is (cc_left, acca_left, accb_left, dp_left,
+ ix_left, iy_left, up_left, sp_left,
+ accd_left, md_left, pc_left, ea_left );
+ type right_type is (ea_right, zero_right, one_right, two_right,
+ acca_right, accb_right, accd_right,
+ md_right, md_sign5_right, md_sign8_right );
+ type alu_type is (alu_add8, alu_sub8, alu_add16, alu_sub16, alu_adc, alu_sbc,
+ alu_and, alu_ora, alu_eor,
+ alu_tst, alu_inc, alu_dec, alu_clr, alu_neg, alu_com,
+ alu_lsr16, alu_lsl16,
+ alu_ror8, alu_rol8, alu_mul,
+ alu_asr8, alu_asl8, alu_lsr8,
+ alu_andcc, alu_orcc, alu_sex, alu_tfr, alu_abx,
+ alu_seif, alu_sei, alu_see, alu_cle,
+ alu_ld8, alu_st8, alu_ld16, alu_st16, alu_lea, alu_nop, alu_daa );
+
+ signal op_code: std_logic_vector(7 downto 0);
+ signal pre_code: std_logic_vector(7 downto 0);
+ signal acca: std_logic_vector(7 downto 0);
+ signal accb: std_logic_vector(7 downto 0);
+ signal cc: std_logic_vector(7 downto 0);
+ signal cc_out: std_logic_vector(7 downto 0);
+ signal dp: std_logic_vector(7 downto 0);
+ signal xreg: std_logic_vector(15 downto 0);
+ signal yreg: std_logic_vector(15 downto 0);
+ signal sp: std_logic_vector(15 downto 0);
+ signal up: std_logic_vector(15 downto 0);
+ signal ea: std_logic_vector(15 downto 0);
+ signal pc: std_logic_vector(15 downto 0);
+ signal md: std_logic_vector(15 downto 0);
+ signal left: std_logic_vector(15 downto 0);
+ signal right: std_logic_vector(15 downto 0);
+ signal out_alu: std_logic_vector(15 downto 0);
+ signal iv: std_logic_vector(2 downto 0);
+ signal nmi_req: std_logic;
+ signal nmi_ack: std_logic;
+ signal nmi_enable: std_logic;
+ signal fic: std_logic; -- first instruction cycle
+ signal lic: std_logic; -- last instruction cycle
+
+ signal state: state_type;
+ signal next_state: state_type;
+ signal return_state: state_type;
+ signal saved_state: state_type;
+ signal st_ctrl: st_type;
+ signal iv_ctrl: iv_type;
+ signal pc_ctrl: pc_type;
+ signal ea_ctrl: ea_type;
+ signal op_ctrl: op_type;
+ signal pre_ctrl: pre_type;
+ signal md_ctrl: md_type;
+ signal acca_ctrl: acca_type;
+ signal accb_ctrl: accb_type;
+ signal ix_ctrl: ix_type;
+ signal iy_ctrl: iy_type;
+ signal cc_ctrl: cc_type;
+ signal dp_ctrl: dp_type;
+ signal sp_ctrl: sp_type;
+ signal up_ctrl: up_type;
+ signal left_ctrl: left_type;
+ signal right_ctrl: right_type;
+ signal alu_ctrl: alu_type;
+ signal addr_ctrl: addr_type;
+ signal dout_ctrl: dout_type;
+
+
+begin
+
+----------------------------------
+--
+-- State machine stack
+--
+----------------------------------
+--state_stack_proc: process( clk, hold, state_stack, st_ctrl,
+-- return_state, fetch_state )
+state_stack_proc: process( clk, st_ctrl, return_state )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case st_ctrl is
+ when reset_st =>
+ saved_state <= fetch_state;
+ when push_st =>
+ saved_state <= return_state;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+----------------------------------
+--
+-- Interrupt Vector control
+--
+----------------------------------
+--
+int_vec_proc: process( clk, iv_ctrl )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case iv_ctrl is
+ when reset_iv =>
+ iv <= RST_VEC;
+ when nmi_iv =>
+ iv <= NMI_VEC;
+ when swi_iv =>
+ iv <= SWI_VEC;
+ when irq_iv =>
+ iv <= IRQ_VEC;
+ when firq_iv =>
+ iv <= FIRQ_VEC;
+ when swi2_iv =>
+ iv <= SWI2_VEC;
+ when swi3_iv =>
+ iv <= SWI3_VEC;
+ when others =>
+ null;
+ end case;
+ end if; -- hold
+ end if; -- clk
+end process;
+
+----------------------------------
+--
+-- Program Counter Control
+--
+----------------------------------
+
+--pc_reg: process( clk, pc_ctrl, hold, pc, out_alu, data_in )
+pc_reg: process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case pc_ctrl is
+ when reset_pc =>
+ pc <= (others=>'0');
+ when load_pc =>
+ pc <= out_alu(15 downto 0);
+ when pull_lo_pc =>
+ pc(7 downto 0) <= data_in;
+ when pull_hi_pc =>
+ pc(15 downto 8) <= data_in;
+ when incr_pc =>
+ pc <= pc + 1;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+----------------------------------
+--
+-- Effective Address Control
+--
+----------------------------------
+
+--ea_reg: process( clk, ea_ctrl, hold, ea, out_alu, data_in, dp )
+ea_reg: process( clk )
+begin
+
+ if clk'event and clk = '0' then
+ if hold= '0' then
+ case ea_ctrl is
+ when reset_ea =>
+ ea <= (others=>'0');
+ when fetch_first_ea =>
+ ea(7 downto 0) <= data_in;
+ ea(15 downto 8) <= dp;
+ when fetch_next_ea =>
+ ea(15 downto 8) <= ea(7 downto 0);
+ ea(7 downto 0) <= data_in;
+ when load_ea =>
+ ea <= out_alu(15 downto 0);
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- Accumulator A
+--
+--------------------------------
+--acca_reg : process( clk, acca_ctrl, hold, out_alu, acca, data_in )
+acca_reg : process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case acca_ctrl is
+ when reset_acca =>
+ acca <= (others=>'0');
+ when load_acca =>
+ acca <= out_alu(7 downto 0);
+ when load_hi_acca =>
+ acca <= out_alu(15 downto 8);
+ when pull_acca =>
+ acca <= data_in;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- Accumulator B
+--
+--------------------------------
+--accb_reg : process( clk, accb_ctrl, hold, out_alu, accb, data_in )
+accb_reg : process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case accb_ctrl is
+ when reset_accb =>
+ accb <= (others=>'0');
+ when load_accb =>
+ accb <= out_alu(7 downto 0);
+ when pull_accb =>
+ accb <= data_in;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- X Index register
+--
+--------------------------------
+--ix_reg : process( clk, ix_ctrl, hold, out_alu, xreg, data_in )
+ix_reg : process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case ix_ctrl is
+ when reset_ix =>
+ xreg <= (others=>'0');
+ when load_ix =>
+ xreg <= out_alu(15 downto 0);
+ when pull_hi_ix =>
+ xreg(15 downto 8) <= data_in;
+ when pull_lo_ix =>
+ xreg(7 downto 0) <= data_in;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- Y Index register
+--
+--------------------------------
+--iy_reg : process( clk, iy_ctrl, hold, out_alu, yreg, data_in )
+iy_reg : process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case iy_ctrl is
+ when reset_iy =>
+ yreg <= (others=>'0');
+ when load_iy =>
+ yreg <= out_alu(15 downto 0);
+ when pull_hi_iy =>
+ yreg(15 downto 8) <= data_in;
+ when pull_lo_iy =>
+ yreg(7 downto 0) <= data_in;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- S stack pointer
+--
+--------------------------------
+--sp_reg : process( clk, sp_ctrl, hold, sp, out_alu, data_in, nmi_enable )
+sp_reg : process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case sp_ctrl is
+ when reset_sp =>
+ sp <= (others=>'0');
+ nmi_enable <= '0';
+ when load_sp =>
+ sp <= out_alu(15 downto 0);
+ nmi_enable <= '1';
+ when pull_hi_sp =>
+ sp(15 downto 8) <= data_in;
+ when pull_lo_sp =>
+ sp(7 downto 0) <= data_in;
+ nmi_enable <= '1';
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- U stack pointer
+--
+--------------------------------
+--up_reg : process( clk, up_ctrl, hold, up, out_alu, data_in )
+up_reg : process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case up_ctrl is
+ when reset_up =>
+ up <= (others=>'0');
+ when load_up =>
+ up <= out_alu(15 downto 0);
+ when pull_hi_up =>
+ up(15 downto 8) <= data_in;
+ when pull_lo_up =>
+ up(7 downto 0) <= data_in;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- Memory Data
+--
+--------------------------------
+--md_reg : process( clk, md_ctrl, hold, out_alu, data_in, md )
+md_reg : process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case md_ctrl is
+ when reset_md =>
+ md <= (others=>'0');
+ when load_md =>
+ md <= out_alu(15 downto 0);
+ when fetch_first_md => -- sign extend md for branches
+ md(15 downto 8) <= data_in(7) & data_in(7) & data_in(7) & data_in(7) &
+ data_in(7) & data_in(7) & data_in(7) & data_in(7) ;
+ md(7 downto 0) <= data_in;
+ when fetch_next_md =>
+ md(15 downto 8) <= md(7 downto 0);
+ md(7 downto 0) <= data_in;
+ when shiftl_md =>
+ md(15 downto 1) <= md(14 downto 0);
+ md(0) <= '0';
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+
+----------------------------------
+--
+-- Condition Codes
+--
+----------------------------------
+
+--cc_reg: process( clk, cc_ctrl, hold, cc_out, cc, data_in )
+cc_reg: process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case cc_ctrl is
+ when reset_cc =>
+ cc <= "11010000"; -- set EBIT, FBIT & IBIT
+ when load_cc =>
+ cc <= cc_out;
+ when pull_cc =>
+ cc <= data_in;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+----------------------------------
+--
+-- Direct Page register
+--
+----------------------------------
+
+--dp_reg: process( clk, dp_ctrl, hold, out_alu, dp, data_in )
+dp_reg: process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case dp_ctrl is
+ when reset_dp =>
+ dp <= (others=>'0');
+ when load_dp =>
+ dp <= out_alu(7 downto 0);
+ when pull_dp =>
+ dp <= data_in;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+
+----------------------------------
+--
+-- op code register
+--
+----------------------------------
+
+--op_reg: process( clk, op_ctrl, hold, op_code, data_in )
+op_reg: process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case op_ctrl is
+ when reset_op =>
+ op_code <= "00010010";
+ when fetch_op =>
+ op_code <= data_in;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+
+----------------------------------
+--
+-- pre byte op code register
+--
+----------------------------------
+
+--pre_reg: process( clk, pre_ctrl, hold, pre_code, data_in )
+pre_reg: process( clk )
+begin
+ if clk'event and clk = '0' then
+ if hold = '0' then
+ case pre_ctrl is
+ when reset_pre =>
+ pre_code <= (others=>'0');
+ when fetch_pre =>
+ pre_code <= data_in;
+ when others =>
+ null;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- state machine
+--
+--------------------------------
+
+--change_state: process( clk, rst, state, hold, next_state )
+change_state: process( clk )
+begin
+ if clk'event and clk = '0' then
+ if rst = '1' then
+ fic <= '0';
+ nmi_ack <= '0';
+ state <= reset_state;
+ elsif hold = '0' then
+ fic <= lic;
+ --
+ -- nmi request is not cleared until nmi input goes low
+ --
+ if (nmi_req = '0') and (nmi_ack='1') then
+ nmi_ack <= '0';
+ end if;
+
+ if (nmi_req = '1') and (nmi_ack = '0') and (state = int_nmimask_state) then
+ nmi_ack <= '1';
+ end if;
+
+ if lic = '1' then
+ if halt = '1' then
+ state <= halt_state;
+
+ -- service non maskable interrupts
+ elsif (nmi_req = '1') and (nmi_ack = '0') then
+ state <= int_nmi_state;
+ --
+ -- FIRQ & IRQ are level sensitive
+ --
+ elsif (firq = '1') and (cc(FBIT) = '0') then
+ state <= int_firq_state;
+
+ elsif (irq = '1') and (cc(IBIT) = '0') then
+ state <= int_irq_state;
+ --
+ -- Version 1.27 2015-05-30
+ -- Exit sync_state on masked interrupt.
+ --
+ -- Version 1.28 2015-05-30
+ -- Move this code to the state sequencer
+ -- near line 5566.
+ --
+ -- elsif (state = sync_state) and ((firq = '1') or (irq = '1'))then
+ -- state <= fetch_state;
+ --
+ else
+ state <= next_state;
+ end if; -- halt, nmi, firq, irq
+ else
+ state <= next_state;
+ end if; -- lic
+ end if; -- reset/hold
+ end if; -- clk
+end process;
+
+------------------------------------
+--
+-- Detect Edge of NMI interrupt
+--
+------------------------------------
+
+--nmi_handler : process( clk, rst, nmi, nmi_ack, nmi_req, nmi_enable )
+nmi_handler : process( rst, clk )
+begin
+ if rst='1' then
+ nmi_req <= '0';
+ elsif clk'event and clk='0' then
+ if (nmi='1') and (nmi_ack='0') and (nmi_enable='1') then
+ nmi_req <= '1';
+ else
+ if (nmi='0') and (nmi_ack='1') then
+ nmi_req <= '0';
+ end if;
+ end if;
+ end if;
+end process;
+
+
+----------------------------------
+--
+-- Address output multiplexer
+--
+----------------------------------
+
+addr_mux: process( addr_ctrl, pc, ea, up, sp, iv )
+begin
+ ifetch <= '0';
+ vma <= '1';
+ case addr_ctrl is
+ when fetch_ad =>
+ addr <= pc;
+ rw <= '1';
+ ifetch <= '1';
+ when read_ad =>
+ addr <= ea;
+ rw <= '1';
+ when write_ad =>
+ addr <= ea;
+ rw <= '0';
+ when pushs_ad =>
+ addr <= sp;
+ rw <= '0';
+ when pulls_ad =>
+ addr <= sp;
+ rw <= '1';
+ when pushu_ad =>
+ addr <= up;
+ rw <= '0';
+ when pullu_ad =>
+ addr <= up;
+ rw <= '1';
+ when int_hi_ad =>
+ addr <= "111111111111" & iv & "0";
+ rw <= '1';
+ when int_lo_ad =>
+ addr <= "111111111111" & iv & "1";
+ rw <= '1';
+ when others =>
+ addr <= "1111111111111111";
+ rw <= '1';
+ vma <= '0';
+ end case;
+end process;
+
+--------------------------------
+--
+-- Data Bus output
+--
+--------------------------------
+dout_mux : process( dout_ctrl, md, acca, accb, dp, xreg, yreg, sp, up, pc, cc )
+begin
+ case dout_ctrl is
+ when cc_dout => -- condition code register
+ data_out <= cc;
+ when acca_dout => -- accumulator a
+ data_out <= acca;
+ when accb_dout => -- accumulator b
+ data_out <= accb;
+ when dp_dout => -- direct page register
+ data_out <= dp;
+ when ix_lo_dout => -- X index reg
+ data_out <= xreg(7 downto 0);
+ when ix_hi_dout => -- X index reg
+ data_out <= xreg(15 downto 8);
+ when iy_lo_dout => -- Y index reg
+ data_out <= yreg(7 downto 0);
+ when iy_hi_dout => -- Y index reg
+ data_out <= yreg(15 downto 8);
+ when up_lo_dout => -- U stack pointer
+ data_out <= up(7 downto 0);
+ when up_hi_dout => -- U stack pointer
+ data_out <= up(15 downto 8);
+ when sp_lo_dout => -- S stack pointer
+ data_out <= sp(7 downto 0);
+ when sp_hi_dout => -- S stack pointer
+ data_out <= sp(15 downto 8);
+ when md_lo_dout => -- alu output
+ data_out <= md(7 downto 0);
+ when md_hi_dout => -- alu output
+ data_out <= md(15 downto 8);
+ when pc_lo_dout => -- low order pc
+ data_out <= pc(7 downto 0);
+ when pc_hi_dout => -- high order pc
+ data_out <= pc(15 downto 8);
+ end case;
+end process;
+
+----------------------------------
+--
+-- Left Mux
+--
+----------------------------------
+
+left_mux: process( left_ctrl, acca, accb, cc, dp, xreg, yreg, up, sp, pc, ea, md )
+begin
+ case left_ctrl is
+ when cc_left =>
+ left(15 downto 8) <= "00000000";
+ left(7 downto 0) <= cc;
+ when acca_left =>
+ left(15 downto 8) <= "00000000";
+ left(7 downto 0) <= acca;
+ when accb_left =>
+ left(15 downto 8) <= "00000000";
+ left(7 downto 0) <= accb;
+ when dp_left =>
+ left(15 downto 8) <= "00000000";
+ left(7 downto 0) <= dp;
+ when accd_left =>
+ left(15 downto 8) <= acca;
+ left(7 downto 0) <= accb;
+ when md_left =>
+ left <= md;
+ when ix_left =>
+ left <= xreg;
+ when iy_left =>
+ left <= yreg;
+ when sp_left =>
+ left <= sp;
+ when up_left =>
+ left <= up;
+ when pc_left =>
+ left <= pc;
+ when others =>
+-- when ea_left =>
+ left <= ea;
+ end case;
+end process;
+
+----------------------------------
+--
+-- Right Mux
+--
+----------------------------------
+
+right_mux: process( right_ctrl, md, acca, accb, ea )
+begin
+ case right_ctrl is
+ when ea_right =>
+ right <= ea;
+ when zero_right =>
+ right <= "0000000000000000";
+ when one_right =>
+ right <= "0000000000000001";
+ when two_right =>
+ right <= "0000000000000010";
+ when acca_right =>
+ if acca(7) = '0' then
+ right <= "00000000" & acca(7 downto 0);
+ else
+ right <= "11111111" & acca(7 downto 0);
+ end if;
+ when accb_right =>
+ if accb(7) = '0' then
+ right <= "00000000" & accb(7 downto 0);
+ else
+ right <= "11111111" & accb(7 downto 0);
+ end if;
+ when accd_right =>
+ right <= acca & accb;
+ when md_sign5_right =>
+ if md(4) = '0' then
+ right <= "00000000000" & md(4 downto 0);
+ else
+ right <= "11111111111" & md(4 downto 0);
+ end if;
+ when md_sign8_right =>
+ if md(7) = '0' then
+ right <= "00000000" & md(7 downto 0);
+ else
+ right <= "11111111" & md(7 downto 0);
+ end if;
+ when others =>
+-- when md_right =>
+ right <= md;
+ end case;
+end process;
+
+----------------------------------
+--
+-- Arithmetic Logic Unit
+--
+----------------------------------
+
+alu: process( alu_ctrl, cc, left, right, out_alu, cc_out )
+variable valid_lo, valid_hi : boolean;
+variable carry_in : std_logic;
+variable daa_reg : std_logic_vector(7 downto 0);
+begin
+
+ case alu_ctrl is
+ when alu_adc | alu_sbc |
+ alu_rol8 | alu_ror8 =>
+ carry_in := cc(CBIT);
+ when alu_asr8 =>
+ carry_in := left(7);
+ when others =>
+ carry_in := '0';
+ end case;
+
+ valid_lo := left(3 downto 0) <= 9;
+ valid_hi := left(7 downto 4) <= 9;
+
+ --
+ -- CBIT HBIT VHI VLO DAA
+ -- 0 0 0 0 66 (!VHI : hi_nybble>8)
+ -- 0 0 0 1 60
+ -- 0 0 1 1 00
+ -- 0 0 1 0 06 ( VHI : hi_nybble<=8)
+ --
+ -- 0 1 1 0 06
+ -- 0 1 1 1 06
+ -- 0 1 0 1 66
+ -- 0 1 0 0 66
+ --
+ -- 1 1 0 0 66
+ -- 1 1 0 1 66
+ -- 1 1 1 1 66
+ -- 1 1 1 0 66
+ --
+ -- 1 0 1 0 66
+ -- 1 0 1 1 60
+ -- 1 0 0 1 60
+ -- 1 0 0 0 66
+ --
+ -- 66 = (!VHI & !VLO) + (CBIT & HBIT) + (HBIT & !VHI) + (CBIT & !VLO)
+ -- = (CBIT & (HBIT + !VLO)) + (!VHI & (HBIT + !VLO))
+ -- = (!VLO & (CBIT + !VHI)) + (HBIT & (CBIT + !VHI))
+ -- 60 = (CBIT & !HBIT & VLO) + (!HBIT & !VHI & VLO)
+ -- = (!HBIT & VLO & (CBIT + !VHI))
+ -- 06 = (!CBIT & VHI & (!VLO + VHI)
+ -- 00 = (!CBIT & !HBIT & VHI & VLO)
+ --
+ if (cc(CBIT) = '0') then
+ -- CBIT=0
+ if( cc(HBIT) = '0' ) then
+ -- HBIT=0
+ if valid_lo then
+ -- lo <= 9 (no overflow in low nybble)
+ if valid_hi then
+ -- hi <= 9 (no overflow in either low or high nybble)
+ daa_reg := "00000000";
+ else
+ -- hi > 9 (overflow in high nybble only)
+ daa_reg := "01100000";
+ end if;
+ else
+ -- lo > 9 (overflow in low nybble)
+ --
+ -- since there is already an overflow in the low nybble
+ -- you need to make room in the high nybble for the low nybble carry
+ -- so compare the high nybble with 8 rather than 9
+ -- if the high nybble is 9 there will be an overflow on the high nybble
+ -- after the decimal adjust which means it will roll over to an invalid BCD digit
+ --
+ if( left(7 downto 4) <= 8 ) then
+ -- hi <= 8 (overflow in low nybble only)
+ daa_reg := "00000110";
+ else
+ -- hi > 8 (overflow in low and high nybble)
+ daa_reg := "01100110";
+ end if;
+ end if;
+ else
+ -- HBIT=1 (overflow in low nybble)
+ if valid_hi then
+ -- hi <= 9 (overflow in low nybble only)
+ daa_reg := "00000110";
+ else
+ -- hi > 9 (overflow in low and high nybble)
+ daa_reg := "01100110";
+ end if;
+ end if;
+ else
+ -- CBIT=1 (carry => overflow in high nybble)
+ if ( cc(HBIT) = '0' )then
+ -- HBIT=0 (half carry clear => may or may not be an overflow in the low nybble)
+ if valid_lo then
+ -- lo <=9 (overflow in high nybble only)
+ daa_reg := "01100000";
+ else
+ -- lo >9 (overflow in low and high nybble)
+ daa_reg := "01100110";
+ end if;
+ else
+ -- HBIT=1 (overflow in low and high nybble)
+ daa_reg := "01100110";
+ end if;
+ end if;
+
+ case alu_ctrl is
+ when alu_add8 | alu_inc |
+ alu_add16 | alu_adc | alu_mul =>
+ out_alu <= left + right + ("000000000000000" & carry_in);
+ when alu_sub8 | alu_dec |
+ alu_sub16 | alu_sbc =>
+ out_alu <= left - right - ("000000000000000" & carry_in);
+ when alu_abx =>
+ out_alu <= left + ("00000000" & right(7 downto 0)) ;
+ when alu_and =>
+ out_alu <= left and right; -- and/bit
+ when alu_ora =>
+ out_alu <= left or right; -- or
+ when alu_eor =>
+ out_alu <= left xor right; -- eor/xor
+ when alu_lsl16 | alu_asl8 | alu_rol8 =>
+ out_alu <= left(14 downto 0) & carry_in; -- rol8/asl8/lsl16
+ when alu_lsr16 =>
+ out_alu <= carry_in & left(15 downto 1); -- lsr16
+ when alu_lsr8 | alu_asr8 | alu_ror8 =>
+ out_alu <= "00000000" & carry_in & left(7 downto 1); -- ror8/asr8/lsr8
+ when alu_neg =>
+ out_alu <= right - left; -- neg (right=0)
+ when alu_com =>
+ out_alu <= not left;
+ when alu_clr | alu_ld8 | alu_ld16 | alu_lea =>
+ out_alu <= right; -- clr, ld
+ when alu_st8 | alu_st16 | alu_andcc | alu_orcc | alu_tfr =>
+ out_alu <= left;
+ when alu_daa =>
+ out_alu <= left + ("00000000" & daa_reg);
+ when alu_sex =>
+ if left(7) = '0' then
+ out_alu <= "00000000" & left(7 downto 0);
+ else
+ out_alu <= "11111111" & left(7 downto 0);
+ end if;
+ when others =>
+ out_alu <= left; -- nop
+ end case;
+
+ --
+ -- carry bit
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_adc =>
+ cc_out(CBIT) <= (left(7) and right(7)) or
+ (left(7) and not out_alu(7)) or
+ (right(7) and not out_alu(7));
+ when alu_sub8 | alu_sbc =>
+ cc_out(CBIT) <= ((not left(7)) and right(7)) or
+ ((not left(7)) and out_alu(7)) or
+ (right(7) and out_alu(7));
+ when alu_add16 =>
+ cc_out(CBIT) <= (left(15) and right(15)) or
+ (left(15) and not out_alu(15)) or
+ (right(15) and not out_alu(15));
+ when alu_sub16 =>
+ cc_out(CBIT) <= ((not left(15)) and right(15)) or
+ ((not left(15)) and out_alu(15)) or
+ (right(15) and out_alu(15));
+ when alu_ror8 | alu_lsr16 | alu_lsr8 | alu_asr8 =>
+ cc_out(CBIT) <= left(0);
+ when alu_rol8 | alu_asl8 =>
+ cc_out(CBIT) <= left(7);
+ when alu_lsl16 =>
+ cc_out(CBIT) <= left(15);
+ when alu_com =>
+ cc_out(CBIT) <= '1';
+ when alu_neg | alu_clr =>
+ cc_out(CBIT) <= out_alu(7) or out_alu(6) or out_alu(5) or out_alu(4) or
+ out_alu(3) or out_alu(2) or out_alu(1) or out_alu(0);
+ when alu_mul =>
+ cc_out(CBIT) <= out_alu(7);
+ when alu_daa =>
+ if ( daa_reg(7 downto 4) = "0110" ) then
+ cc_out(CBIT) <= '1';
+ else
+ cc_out(CBIT) <= '0';
+ end if;
+ when alu_andcc =>
+ cc_out(CBIT) <= left(CBIT) and cc(CBIT);
+ when alu_orcc =>
+ cc_out(CBIT) <= left(CBIT) or cc(CBIT);
+ when alu_tfr =>
+ cc_out(CBIT) <= left(CBIT);
+ when others =>
+ cc_out(CBIT) <= cc(CBIT);
+ end case;
+ --
+ -- Zero flag
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_sub8 |
+ alu_adc | alu_sbc |
+ alu_and | alu_ora | alu_eor |
+ alu_inc | alu_dec |
+ alu_neg | alu_com | alu_clr |
+ alu_rol8 | alu_ror8 | alu_asr8 | alu_asl8 | alu_lsr8 |
+ alu_ld8 | alu_st8 | alu_sex | alu_daa =>
+ cc_out(ZBIT) <= not( out_alu(7) or out_alu(6) or out_alu(5) or out_alu(4) or
+ out_alu(3) or out_alu(2) or out_alu(1) or out_alu(0) );
+ when alu_add16 | alu_sub16 | alu_mul |
+ alu_lsl16 | alu_lsr16 |
+ alu_ld16 | alu_st16 | alu_lea =>
+ cc_out(ZBIT) <= not( out_alu(15) or out_alu(14) or out_alu(13) or out_alu(12) or
+ out_alu(11) or out_alu(10) or out_alu(9) or out_alu(8) or
+ out_alu(7) or out_alu(6) or out_alu(5) or out_alu(4) or
+ out_alu(3) or out_alu(2) or out_alu(1) or out_alu(0) );
+ when alu_andcc =>
+ cc_out(ZBIT) <= left(ZBIT) and cc(ZBIT);
+ when alu_orcc =>
+ cc_out(ZBIT) <= left(ZBIT) or cc(ZBIT);
+ when alu_tfr =>
+ cc_out(ZBIT) <= left(ZBIT);
+ when others =>
+ cc_out(ZBIT) <= cc(ZBIT);
+ end case;
+
+ --
+ -- negative flag
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_sub8 |
+ alu_adc | alu_sbc |
+ alu_and | alu_ora | alu_eor |
+ alu_rol8 | alu_ror8 | alu_asr8 | alu_asl8 | alu_lsr8 |
+ alu_inc | alu_dec | alu_neg | alu_com | alu_clr |
+ alu_ld8 | alu_st8 | alu_sex | alu_daa =>
+ cc_out(NBIT) <= out_alu(7);
+ when alu_add16 | alu_sub16 |
+ alu_lsl16 | alu_lsr16 |
+ alu_ld16 | alu_st16 =>
+ cc_out(NBIT) <= out_alu(15);
+ when alu_andcc =>
+ cc_out(NBIT) <= left(NBIT) and cc(NBIT);
+ when alu_orcc =>
+ cc_out(NBIT) <= left(NBIT) or cc(NBIT);
+ when alu_tfr =>
+ cc_out(NBIT) <= left(NBIT);
+ when others =>
+ cc_out(NBIT) <= cc(NBIT);
+ end case;
+
+ --
+ -- Interrupt mask flag
+ --
+ case alu_ctrl is
+ when alu_andcc =>
+ cc_out(IBIT) <= left(IBIT) and cc(IBIT);
+ when alu_orcc =>
+ cc_out(IBIT) <= left(IBIT) or cc(IBIT);
+ when alu_tfr =>
+ cc_out(IBIT) <= left(IBIT);
+ when alu_seif | alu_sei =>
+ cc_out(IBIT) <= '1';
+ when others =>
+ cc_out(IBIT) <= cc(IBIT); -- interrupt mask
+ end case;
+
+ --
+ -- Half Carry flag
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_adc =>
+ cc_out(HBIT) <= (left(3) and right(3)) or
+ (right(3) and not out_alu(3)) or
+ (left(3) and not out_alu(3));
+ when alu_andcc =>
+ cc_out(HBIT) <= left(HBIT) and cc(HBIT);
+ when alu_orcc =>
+ cc_out(HBIT) <= left(HBIT) or cc(HBIT);
+ when alu_tfr =>
+ cc_out(HBIT) <= left(HBIT);
+ when others =>
+ cc_out(HBIT) <= cc(HBIT);
+ end case;
+
+ --
+ -- Overflow flag
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_adc =>
+ cc_out(VBIT) <= (left(7) and right(7) and (not out_alu(7))) or
+ ((not left(7)) and (not right(7)) and out_alu(7));
+ when alu_sub8 | alu_sbc =>
+ cc_out(VBIT) <= (left(7) and (not right(7)) and (not out_alu(7))) or
+ ((not left(7)) and right(7) and out_alu(7));
+ when alu_add16 =>
+ cc_out(VBIT) <= (left(15) and right(15) and (not out_alu(15))) or
+ ((not left(15)) and (not right(15)) and out_alu(15));
+ when alu_sub16 =>
+ cc_out(VBIT) <= (left(15) and (not right(15)) and (not out_alu(15))) or
+ ((not left(15)) and right(15) and out_alu(15));
+ when alu_inc =>
+ cc_out(VBIT) <= ((not left(7)) and left(6) and left(5) and left(4) and
+ left(3) and left(2) and left(1) and left(0));
+ when alu_dec | alu_neg =>
+ cc_out(VBIT) <= (left(7) and (not left(6)) and (not left(5)) and (not left(4)) and
+ (not left(3)) and (not left(2)) and (not left(1)) and (not left(0)));
+-- 6809 Programming reference manual says
+-- V not affected by ASR, LSR and ROR
+-- This is different to the 6800
+-- John Kent 6th June 2006
+-- when alu_asr8 =>
+-- cc_out(VBIT) <= left(0) xor left(7);
+-- when alu_lsr8 | alu_lsr16 =>
+-- cc_out(VBIT) <= left(0);
+-- when alu_ror8 =>
+-- cc_out(VBIT) <= left(0) xor cc(CBIT);
+ when alu_lsl16 =>
+ cc_out(VBIT) <= left(15) xor left(14);
+ when alu_rol8 | alu_asl8 =>
+ cc_out(VBIT) <= left(7) xor left(6);
+--
+-- 11th July 2006 - John Kent
+-- What DAA does with V is anyones guess
+-- It is undefined in the 6809 programming manual
+--
+ when alu_daa =>
+ cc_out(VBIT) <= left(7) xor out_alu(7) xor cc(CBIT);
+-- CLR resets V Bit
+-- John Kent 6th June 2006
+ when alu_and | alu_ora | alu_eor | alu_com | alu_clr |
+ alu_st8 | alu_st16 | alu_ld8 | alu_ld16 | alu_sex =>
+ cc_out(VBIT) <= '0';
+ when alu_andcc =>
+ cc_out(VBIT) <= left(VBIT) and cc(VBIT);
+ when alu_orcc =>
+ cc_out(VBIT) <= left(VBIT) or cc(VBIT);
+ when alu_tfr =>
+ cc_out(VBIT) <= left(VBIT);
+ when others =>
+ cc_out(VBIT) <= cc(VBIT);
+ end case;
+
+ case alu_ctrl is
+ when alu_andcc =>
+ cc_out(FBIT) <= left(FBIT) and cc(FBIT);
+ when alu_orcc =>
+ cc_out(FBIT) <= left(FBIT) or cc(FBIT);
+ when alu_tfr =>
+ cc_out(FBIT) <= left(FBIT);
+ when alu_seif =>
+ cc_out(FBIT) <= '1';
+ when others =>
+ cc_out(FBIT) <= cc(FBIT);
+ end case;
+
+ case alu_ctrl is
+ when alu_andcc =>
+ cc_out(EBIT) <= left(EBIT) and cc(EBIT);
+ when alu_orcc =>
+ cc_out(EBIT) <= left(EBIT) or cc(EBIT);
+ when alu_tfr =>
+ cc_out(EBIT) <= left(EBIT);
+ when alu_see =>
+ cc_out(EBIT) <= '1';
+ when alu_cle =>
+ cc_out(EBIT) <= '0';
+ when others =>
+ cc_out(EBIT) <= cc(EBIT);
+ end case;
+end process;
+
+------------------------------------
+--
+-- state sequencer
+--
+------------------------------------
+process( state, saved_state,
+ op_code, pre_code,
+ cc, ea, md, iv, fic, halt,
+ nmi_req, firq, irq, lic )
+variable cond_true : boolean; -- variable used to evaluate coditional branches
+begin
+ cond_true := (1=1);
+ ba <= '0';
+ bs <= '0';
+ lic <= '0';
+ opfetch <= '0';
+ iv_ctrl <= latch_iv;
+ -- Registers preserved
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ dp_ctrl <= latch_dp;
+ ix_ctrl <= latch_ix;
+ iy_ctrl <= latch_iy;
+ up_ctrl <= latch_up;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ ea_ctrl <= latch_ea;
+ op_ctrl <= latch_op;
+ pre_ctrl <= latch_pre;
+ -- ALU Idle
+ left_ctrl <= pc_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ -- Bus idle
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= cc_dout;
+ -- Next State Fetch
+ st_ctrl <= idle_st;
+ return_state <= fetch_state;
+ next_state <= fetch_state;
+
+ case state is
+ when reset_state => -- released from reset
+ -- reset the registers
+ iv_ctrl <= reset_iv;
+ op_ctrl <= reset_op;
+ pre_ctrl <= reset_pre;
+ cc_ctrl <= reset_cc;
+ acca_ctrl <= reset_acca;
+ accb_ctrl <= reset_accb;
+ dp_ctrl <= reset_dp;
+ ix_ctrl <= reset_ix;
+ iy_ctrl <= reset_iy;
+ up_ctrl <= reset_up;
+ sp_ctrl <= reset_sp;
+ pc_ctrl <= reset_pc;
+ ea_ctrl <= reset_ea;
+ md_ctrl <= reset_md;
+ st_ctrl <= reset_st;
+ next_state <= vect_hi_state;
+
+ --
+ -- Jump via interrupt vector
+ -- iv holds interrupt type
+ -- fetch PC hi from vector location
+ --
+ when vect_hi_state =>
+ -- fetch pc low interrupt vector
+ pc_ctrl <= pull_hi_pc;
+ addr_ctrl <= int_hi_ad;
+ bs <= '1';
+ next_state <= vect_lo_state;
+
+ --
+ -- jump via interrupt vector
+ -- iv holds vector type
+ -- fetch PC lo from vector location
+ --
+ when vect_lo_state =>
+ -- fetch the vector low byte
+ pc_ctrl <= pull_lo_pc;
+ addr_ctrl <= int_lo_ad;
+ bs <= '1';
+ next_state <= fetch_state;
+
+ when vect_idle_state =>
+ --
+ -- Last Instruction Cycle for SWI, SWI2 & SWI3
+ --
+ if op_code = "00111111" then
+ lic <= '1';
+ end if;
+ next_state <= fetch_state;
+
+ --
+ -- Here to fetch an instruction
+ -- PC points to opcode
+ --
+ when fetch_state =>
+ -- fetch the op code
+ opfetch <= '1';
+ op_ctrl <= fetch_op;
+ pre_ctrl <= fetch_pre;
+ ea_ctrl <= reset_ea;
+ -- Fetch op code
+ addr_ctrl <= fetch_ad;
+ -- Advance the PC to fetch next instruction byte
+ pc_ctrl <= incr_pc;
+ next_state <= decode1_state;
+
+ --
+ -- Here to decode instruction
+ -- and fetch next byte of intruction
+ -- whether it be necessary or not
+ --
+ when decode1_state =>
+ -- fetch first byte of address or immediate data
+ ea_ctrl <= fetch_first_ea;
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= fetch_ad;
+ case op_code(7 downto 4) is
+ --
+ -- direct single op (2 bytes)
+ -- 6809 => 6 cycles
+ -- cpu09 => 5 cycles
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 ea_hi=dp / ea_lo=(pc) / pc=pc+1
+ -- 3 md_lo=(ea) / pc=pc
+ -- 4 alu_left=md / md=alu_out / pc=pc
+ -- 5 (ea)=md_lo / pc=pc
+ --
+ -- Exception is JMP
+ -- 6809 => 3 cycles
+ -- cpu09 => 3 cycles
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 ea_hi=dp / ea_lo=(pc) / pc=pc+1
+ -- 3 pc=ea
+ --
+ when "0000" =>
+ -- advance the PC
+ pc_ctrl <= incr_pc;
+
+ case op_code(3 downto 0) is
+ when "1110" => -- jmp
+ next_state <= jmp_state;
+
+ when "1111" => -- clr
+ next_state <= single_op_exec_state;
+
+ when others =>
+ next_state <= single_op_read_state;
+
+ end case;
+
+ -- acca / accb inherent instructions
+ when "0001" =>
+ case op_code(3 downto 0) is
+ --
+ -- Page2 pre byte
+ -- pre=(pc) / pc=pc+1
+ -- op=(pc) / pc=pc+1
+ --
+ when "0000" => -- page2
+ opfetch <= '1';
+ op_ctrl <= fetch_op;
+ -- advance pc
+ pc_ctrl <= incr_pc;
+ next_state <= decode2_state;
+
+ --
+ -- Page3 pre byte
+ -- pre=(pc) / pc=pc+1
+ -- op=(pc) / pc=pc+1
+ --
+ when "0001" => -- page3
+ opfetch <= '1';
+ op_ctrl <= fetch_op;
+ -- advance pc
+ pc_ctrl <= incr_pc;
+ next_state <= decode3_state;
+
+ --
+ -- nop - No operation ( 1 byte )
+ -- 6809 => 2 cycles
+ -- cpu09 => 2 cycles
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 decode
+ --
+ when "0010" => -- nop
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- sync - halt execution until an interrupt is received
+ -- interrupt may be NMI, IRQ or FIRQ
+ -- program execution continues if the
+ -- interrupt is asserted for 3 clock cycles
+ -- note that registers are not pushed onto the stack
+ -- CPU09 => Interrupts need only be asserted for one clock cycle
+ --
+ when "0011" => -- sync
+ next_state <= sync_state;
+
+ --
+ -- lbra -- long branch (3 bytes)
+ -- 6809 => 5 cycles
+ -- cpu09 => 4 cycles
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 md_hi=sign(pc) / md_lo=(pc) / pc=pc+1
+ -- 3 md_hi=md_lo / md_lo=(pc) / pc=pc+1
+ -- 4 pc=pc+md
+ --
+ when "0110" =>
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ next_state <= lbranch_state;
+
+ --
+ -- lbsr - long branch to subroutine (3 bytes)
+ -- 6809 => 9 cycles
+ -- cpu09 => 6 cycles
+ -- 1 op=(pc) /pc=pc+1
+ -- 2 md_hi=sign(pc) / md_lo=(pc) / pc=pc+1 / sp=sp-1
+ -- 3 md_hi=md_lo / md_lo=(pc) / pc=pc+1
+ -- 4 (sp)= pc_lo / sp=sp-1 / pc=pc
+ -- 5 (sp)=pc_hi / pc=pc
+ -- 6 pc=pc+md
+ --
+ when "0111" =>
+ -- pre decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ next_state <= lbranch_state;
+
+ --
+ -- Decimal Adjust Accumulator
+ --
+ when "1001" => -- daa
+ left_ctrl <= acca_left;
+ right_ctrl <= accb_right;
+ alu_ctrl <= alu_daa;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- OR Condition Codes
+ --
+ when "1010" => -- orcc
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ next_state <= orcc_state;
+
+ --
+ -- AND Condition Codes
+ --
+ when "1100" => -- andcc
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ next_state <= andcc_state;
+
+ --
+ -- Sign Extend
+ --
+ when "1101" => -- sex
+ left_ctrl <= accb_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_sex;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- Exchange Registers
+ --
+ when "1110" => -- exg
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ next_state <= exg_state;
+
+ --
+ -- Transfer Registers
+ --
+ when "1111" => -- tfr
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ next_state <= tfr_state;
+
+ when others =>
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+
+ --
+ -- Short branch conditional
+ -- 6809 => always 3 cycles
+ -- cpu09 => always = 3 cycles
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 md_hi=sign(pc) / md_lo=(pc) / pc=pc+1 / test cc
+ -- 3 if cc tru pc=pc+md else pc=pc
+ --
+ when "0010" => -- branch conditional
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ next_state <= sbranch_state;
+
+ --
+ -- Single byte stack operators
+ -- Do not advance PC
+ --
+ when "0011" =>
+ --
+ -- lea - load effective address (2+ bytes)
+ -- 6809 => 4 cycles + addressing mode
+ -- cpu09 => 4 cycles + addressing mode
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 md_lo=(pc) / pc=pc+1
+ -- 3 calculate ea
+ -- 4 ix/iy/sp/up = ea
+ --
+ case op_code(3 downto 0) is
+ when "0000" | -- leax
+ "0001" | -- leay
+ "0010" | -- leas
+ "0011" => -- leau
+ -- advance PC
+ pc_ctrl <= incr_pc;
+ st_ctrl <= push_st;
+ return_state <= lea_state;
+ next_state <= indexed_state;
+
+ --
+ -- pshs - push registers onto sp stack
+ -- 6809 => 5 cycles + registers
+ -- cpu09 => 3 cycles + registers
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 ea_lo=(pc) / pc=pc+1
+ -- 3 if ea(7 downto 0) != "00000000" then sp=sp-1
+ -- 4 if ea(7) = 1 (sp)=pcl, sp=sp-1
+ -- 5 if ea(7) = 1 (sp)=pch
+ -- if ea(6 downto 0) != "0000000" then sp=sp-1
+ -- 6 if ea(6) = 1 (sp)=upl, sp=sp-1
+ -- 7 if ea(6) = 1 (sp)=uph
+ -- if ea(5 downto 0) != "000000" then sp=sp-1
+ -- 8 if ea(5) = 1 (sp)=iyl, sp=sp-1
+ -- 9 if ea(5) = 1 (sp)=iyh
+ -- if ea(4 downto 0) != "00000" then sp=sp-1
+ -- 10 if ea(4) = 1 (sp)=ixl, sp=sp-1
+ -- 11 if ea(4) = 1 (sp)=ixh
+ -- if ea(3 downto 0) != "0000" then sp=sp-1
+ -- 12 if ea(3) = 1 (sp)=dp
+ -- if ea(2 downto 0) != "000" then sp=sp-1
+ -- 13 if ea(2) = 1 (sp)=accb
+ -- if ea(1 downto 0) != "00" then sp=sp-1
+ -- 14 if ea(1) = 1 (sp)=acca
+ -- if ea(0 downto 0) != "0" then sp=sp-1
+ -- 15 if ea(0) = 1 (sp)=cc
+ --
+ when "0100" => -- pshs
+ -- advance PC
+ pc_ctrl <= incr_pc;
+ next_state <= pshs_state;
+
+ --
+ -- puls - pull registers of sp stack
+ -- 6809 => 5 cycles + registers
+ -- cpu09 => 3 cycles + registers
+ --
+ when "0101" => -- puls
+ -- advance PC
+ pc_ctrl <= incr_pc;
+ next_state <= puls_state;
+
+ --
+ -- pshu - push registers onto up stack
+ -- 6809 => 5 cycles + registers
+ -- cpu09 => 3 cycles + registers
+ --
+ when "0110" => -- pshu
+ -- advance PC
+ pc_ctrl <= incr_pc;
+ next_state <= pshu_state;
+
+ --
+ -- pulu - pull registers of up stack
+ -- 6809 => 5 cycles + registers
+ -- cpu09 => 3 cycles + registers
+ --
+ when "0111" => -- pulu
+ -- advance PC
+ pc_ctrl <= incr_pc;
+ next_state <= pulu_state;
+
+ --
+ -- rts - return from subroutine
+ -- 6809 => 5 cycles
+ -- cpu09 => 4 cycles
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 decode op
+ -- 3 pc_hi = (sp) / sp=sp+1
+ -- 4 pc_lo = (sp) / sp=sp+1
+ --
+ when "1001" =>
+ next_state <= pull_return_hi_state;
+
+ --
+ -- ADD accb to index register
+ -- *** Note: this is an unsigned addition.
+ -- does not affect any condition codes
+ -- 6809 => 3 cycles
+ -- cpu09 => 2 cycles
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 alu_left=ix / alu_right=accb / ix=alu_out / pc=pc
+ --
+ when "1010" => -- abx
+ lic <= '1';
+ left_ctrl <= ix_left;
+ right_ctrl <= accb_right;
+ alu_ctrl <= alu_abx;
+ ix_ctrl <= load_ix;
+ next_state <= fetch_state;
+
+ --
+ -- Return From Interrupt
+ --
+ when "1011" => -- rti
+ next_state <= rti_cc_state;
+
+ --
+ -- CWAI
+ --
+ when "1100" => -- cwai #$
+ -- pre decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- increment pc
+ pc_ctrl <= incr_pc;
+ next_state <= cwai_state;
+
+ --
+ -- MUL Multiply
+ --
+ when "1101" => -- mul
+ next_state <= mul_state;
+
+ --
+ -- SWI Software Interrupt
+ --
+ when "1111" => -- swi
+ -- predecrement SP
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ iv_ctrl <= swi_iv;
+ st_ctrl <= push_st;
+ return_state <= int_swimask_state;
+ next_state <= int_entire_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+ --
+ -- Accumulator A Single operand
+ -- source = acca, dest = acca
+ -- Do not advance PC
+ -- Typically 2 cycles 1 bytes
+ -- 1 opcode fetch
+ -- 2 post byte fetch / instruction decode
+ -- Note that there is no post byte
+ -- so do not advance PC in decode cycle
+ -- Re-run opcode fetch cycle after decode
+ --
+ when "0100" => -- acca single op
+ left_ctrl <= acca_left;
+ case op_code(3 downto 0) is
+
+ when "0000" => -- neg
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_neg;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when "0011" => -- com
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_com;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when "0100" => -- lsr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_lsr8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when "0110" => -- ror
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_ror8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when "0111" => -- asr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asr8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when "1000" => -- asl
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asl8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when "1001" => -- rol
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_rol8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when "1010" => -- dec
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_dec;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when "1011" => -- undefined
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ acca_ctrl <= latch_acca;
+ cc_ctrl <= latch_cc;
+
+ when "1100" => -- inc
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_inc;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when "1101" => -- tst
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ acca_ctrl <= latch_acca;
+ cc_ctrl <= load_cc;
+
+ when "1110" => -- jmp (not defined)
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ acca_ctrl <= latch_acca;
+ cc_ctrl <= latch_cc;
+
+ when "1111" => -- clr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_clr;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+
+ when others =>
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ acca_ctrl <= latch_acca;
+ cc_ctrl <= latch_cc;
+
+ end case;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- Single Operand accb
+ -- source = accb, dest = accb
+ -- Typically 2 cycles 1 bytes
+ -- 1 opcode fetch
+ -- 2 post byte fetch / instruction decode
+ -- Note that there is no post byte
+ -- so do not advance PC in decode cycle
+ -- Re-run opcode fetch cycle after decode
+ --
+ when "0101" =>
+ left_ctrl <= accb_left;
+ case op_code(3 downto 0) is
+ when "0000" => -- neg
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_neg;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when "0011" => -- com
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_com;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when "0100" => -- lsr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_lsr8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when "0110" => -- ror
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_ror8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when "0111" => -- asr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asr8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when "1000" => -- asl
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asl8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when "1001" => -- rol
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_rol8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when "1010" => -- dec
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_dec;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when "1011" => -- undefined
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ accb_ctrl <= latch_accb;
+ cc_ctrl <= latch_cc;
+
+ when "1100" => -- inc
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_inc;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when "1101" => -- tst
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ accb_ctrl <= latch_accb;
+ cc_ctrl <= load_cc;
+
+ when "1110" => -- jmp (undefined)
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ accb_ctrl <= latch_accb;
+ cc_ctrl <= latch_cc;
+
+ when "1111" => -- clr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_clr;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+
+ when others =>
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ accb_ctrl <= latch_accb;
+ cc_ctrl <= latch_cc;
+ end case;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- Single operand indexed
+ -- Two byte instruction so advance PC
+ -- EA should hold index offset
+ --
+ when "0110" => -- indexed single op
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ st_ctrl <= push_st;
+
+ case op_code(3 downto 0) is
+ when "1110" => -- jmp
+ return_state <= jmp_state;
+
+ when "1111" => -- clr
+ return_state <= single_op_exec_state;
+
+ when others =>
+ return_state <= single_op_read_state;
+
+ end case;
+ next_state <= indexed_state;
+
+ --
+ -- Single operand extended addressing
+ -- three byte instruction so advance the PC
+ -- Low order EA holds high order address
+ --
+ when "0111" => -- extended single op
+ -- increment PC
+ pc_ctrl <= incr_pc;
+ st_ctrl <= push_st;
+
+ case op_code(3 downto 0) is
+ when "1110" => -- jmp
+ return_state <= jmp_state;
+
+ when "1111" => -- clr
+ return_state <= single_op_exec_state;
+
+ when others =>
+ return_state <= single_op_read_state;
+
+ end case;
+ next_state <= extended_state;
+
+ when "1000" => -- acca immediate
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+
+ case op_code(3 downto 0) is
+ when "0011" | -- subd #
+ "1100" | -- cmpx #
+ "1110" => -- ldx #
+ next_state <= imm16_state;
+
+ --
+ -- bsr offset - Branch to subroutine (2 bytes)
+ -- 6809 => 7 cycles
+ -- cpu09 => 5 cycles
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 md_hi=sign(pc) / md_lo=(pc) / sp=sp-1 / pc=pc+1
+ -- 3 (sp)=pc_lo / sp=sp-1
+ -- 4 (sp)=pc_hi
+ -- 5 pc=pc+md
+ --
+ when "1101" => -- bsr
+ -- pre decrement SP
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ --
+ st_ctrl <= push_st;
+ return_state <= sbranch_state;
+ next_state <= push_return_lo_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1001" => -- acca direct
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- subd
+ "1100" | -- cmpx
+ "1110" => -- ldx
+ next_state <= dual_op_read16_state;
+
+ when "0111" => -- sta direct
+ next_state <= dual_op_write8_state;
+
+ --
+ -- jsr direct - Jump to subroutine in direct page (2 bytes)
+ -- 6809 => 7 cycles
+ -- cpu09 => 5 cycles
+ -- 1 op=(pc) / pc=pc+1
+ -- 2 ea_hi=0 / ea_lo=(pc) / sp=sp-1 / pc=pc+1
+ -- 3 (sp)=pc_lo / sp=sp-1
+ -- 4 (sp)=pc_hi
+ -- 5 pc=ea
+ --
+ when "1101" => -- jsr direct
+ -- pre decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ --
+ st_ctrl <= push_st;
+ return_state <= jmp_state;
+ next_state <= push_return_lo_state;
+
+
+ when "1111" => -- stx direct
+ -- idle ALU
+ left_ctrl <= ix_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= latch_sp;
+ next_state <= dual_op_write16_state;
+
+ when others =>
+ next_state <= dual_op_read8_state;
+
+ end case;
+
+ when "1010" => -- acca indexed
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- subd
+ "1100" | -- cmpx
+ "1110" => -- ldx
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= indexed_state;
+
+ when "0111" => -- staa ,x
+ st_ctrl <= push_st;
+ return_state <= dual_op_write8_state;
+ next_state <= indexed_state;
+
+ when "1101" => -- jsr ,x
+ -- DO NOT pre decrement SP
+ st_ctrl <= push_st;
+ return_state <= jsr_state;
+ next_state <= indexed_state;
+
+ when "1111" => -- stx ,x
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= indexed_state;
+
+ when others =>
+ st_ctrl <= push_st;
+ return_state <= dual_op_read8_state;
+ next_state <= indexed_state;
+
+ end case;
+
+ when "1011" => -- acca extended
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- subd
+ "1100" | -- cmpx
+ "1110" => -- ldx
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= extended_state;
+
+ when "0111" => -- staa >
+ st_ctrl <= push_st;
+ return_state <= dual_op_write8_state;
+ next_state <= extended_state;
+
+ when "1101" => -- jsr >extended
+ -- DO NOT pre decrement sp
+ st_ctrl <= push_st;
+ return_state <= jsr_state;
+ next_state <= extended_state;
+
+ when "1111" => -- stx >
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= extended_state;
+
+ when others =>
+ st_ctrl <= push_st;
+ return_state <= dual_op_read8_state;
+ next_state <= extended_state;
+
+ end case;
+
+ when "1100" => -- accb immediate
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- addd #
+ "1100" | -- ldd #
+ "1110" => -- ldu #
+ next_state <= imm16_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1101" => -- accb direct
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- addd
+ "1100" | -- ldd
+ "1110" => -- ldu
+ next_state <= dual_op_read16_state;
+
+ when "0111" => -- stab direct
+ next_state <= dual_op_write8_state;
+
+ when "1101" => -- std direct
+ next_state <= dual_op_write16_state;
+
+ when "1111" => -- stu direct
+ next_state <= dual_op_write16_state;
+
+ when others =>
+ next_state <= dual_op_read8_state;
+
+ end case;
+
+ when "1110" => -- accb indexed
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- addd
+ "1100" | -- ldd
+ "1110" => -- ldu
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= indexed_state;
+
+ when "0111" => -- stab indexed
+ st_ctrl <= push_st;
+ return_state <= dual_op_write8_state;
+ next_state <= indexed_state;
+
+ when "1101" => -- std indexed
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= indexed_state;
+
+ when "1111" => -- stu indexed
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= indexed_state;
+
+ when others =>
+ st_ctrl <= push_st;
+ return_state <= dual_op_read8_state;
+ next_state <= indexed_state;
+
+ end case;
+
+ when "1111" => -- accb extended
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- addd
+ "1100" | -- ldd
+ "1110" => -- ldu
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= extended_state;
+
+ when "0111" => -- stab extended
+ st_ctrl <= push_st;
+ return_state <= dual_op_write8_state;
+ next_state <= extended_state;
+
+ when "1101" => -- std extended
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= extended_state;
+
+ when "1111" => -- stu extended
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= extended_state;
+
+ when others =>
+ st_ctrl <= push_st;
+ return_state <= dual_op_read8_state;
+ next_state <= extended_state;
+ end case;
+ --
+ -- not sure why I need this
+ --
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+
+ --
+ -- Here to decode prefix 2 instruction
+ -- and fetch next byte of intruction
+ -- whether it be necessary or not
+ --
+ when decode2_state =>
+ -- fetch first byte of address or immediate data
+ ea_ctrl <= fetch_first_ea;
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= fetch_ad;
+ case op_code(7 downto 4) is
+ --
+ -- lbcc -- long branch conditional
+ -- 6809 => branch 6 cycles, no branch 5 cycles
+ -- cpu09 => always 5 cycles
+ -- 1 pre=(pc) / pc=pc+1
+ -- 2 op=(pc) / pc=pc+1
+ -- 3 md_hi=sign(pc) / md_lo=(pc) / pc=pc+1
+ -- 4 md_hi=md_lo / md_lo=(pc) / pc=pc+1
+ -- 5 if cond pc=pc+md else pc=pc
+ --
+ when "0010" =>
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ next_state <= lbranch_state;
+
+ --
+ -- Single byte stack operators
+ -- Do not advance PC
+ --
+ when "0011" =>
+ case op_code(3 downto 0) is
+ when "1111" => -- swi 2
+ -- predecrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ iv_ctrl <= swi2_iv;
+ st_ctrl <= push_st;
+ return_state <= vect_hi_state;
+ next_state <= int_entire_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+
+ when "1000" => -- acca immediate
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- cmpd #
+ "1100" | -- cmpy #
+ "1110" => -- ldy #
+ next_state <= imm16_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1001" => -- acca direct
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- cmpd <
+ "1100" | -- cmpy <
+ "1110" => -- ldy <
+ next_state <= dual_op_read16_state;
+
+ when "1111" => -- sty <
+ next_state <= dual_op_write16_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1010" => -- acca indexed
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- cmpd ,ind
+ "1100" | -- cmpy ,ind
+ "1110" => -- ldy ,ind
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= indexed_state;
+
+ when "1111" => -- sty ,ind
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= indexed_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+
+ when "1011" => -- acca extended
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- cmpd <
+ "1100" | -- cmpy <
+ "1110" => -- ldy <
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= extended_state;
+
+ when "1111" => -- sty >
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= extended_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1100" => -- accb immediate
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- undef #
+ "1100" | -- undef #
+ "1110" => -- lds #
+ next_state <= imm16_state;
+
+ when others =>
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1101" => -- accb direct
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- undef <
+ "1100" | -- undef <
+ "1110" => -- lds <
+ next_state <= dual_op_read16_state;
+
+ when "1111" => -- sts <
+ next_state <= dual_op_write16_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1110" => -- accb indexed
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- undef ,ind
+ "1100" | -- undef ,ind
+ "1110" => -- lds ,ind
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= indexed_state;
+
+ when "1111" => -- sts ,ind
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= indexed_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1111" => -- accb extended
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- undef >
+ "1100" | -- undef >
+ "1110" => -- lds >
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= extended_state;
+
+ when "1111" => -- sts >
+ st_ctrl <= push_st;
+ return_state <= dual_op_write16_state;
+ next_state <= extended_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+ --
+ -- Here to decode instruction
+ -- and fetch next byte of intruction
+ -- whether it be necessary or not
+ --
+ when decode3_state =>
+ ea_ctrl <= fetch_first_ea;
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= fetch_ad;
+ dout_ctrl <= md_lo_dout;
+ case op_code(7 downto 4) is
+ --
+ -- Single byte stack operators
+ -- Do not advance PC
+ --
+ when "0011" =>
+ case op_code(3 downto 0) is
+ when "1111" => -- swi3
+ -- predecrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ iv_ctrl <= swi3_iv;
+ st_ctrl <= push_st;
+ return_state <= vect_hi_state;
+ next_state <= int_entire_state;
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+
+ when "1000" => -- acca immediate
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- cmpu #
+ "1100" | -- cmps #
+ "1110" => -- undef #
+ next_state <= imm16_state;
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+
+ when "1001" => -- acca direct
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- cmpu <
+ "1100" | -- cmps <
+ "1110" => -- undef <
+ next_state <= dual_op_read16_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1010" => -- acca indexed
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- cmpu ,X
+ "1100" | -- cmps ,X
+ "1110" => -- undef ,X
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= indexed_state;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+
+ end case;
+
+ when "1011" => -- acca extended
+ -- increment the pc
+ pc_ctrl <= incr_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- cmpu >
+ "1100" | -- cmps >
+ "1110" => -- undef >
+ st_ctrl <= push_st;
+ return_state <= dual_op_read16_state;
+ next_state <= extended_state;
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+
+ --
+ -- here if ea holds low byte
+ -- Direct
+ -- Extended
+ -- Indexed
+ -- read memory location
+ --
+ when single_op_read_state =>
+ -- read memory into md
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= read_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= single_op_exec_state;
+
+ when single_op_exec_state =>
+ case op_code(3 downto 0) is
+ when "0000" => -- neg
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_neg;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when "0011" => -- com
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_com;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when "0100" => -- lsr
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_lsr8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when "0110" => -- ror
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_ror8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when "0111" => -- asr
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asr8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when "1000" => -- asl
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asl8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when "1001" => -- rol
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_rol8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when "1010" => -- dec
+ left_ctrl <= md_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_dec;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when "1011" => -- undefined
+ lic <= '1';
+ next_state <= fetch_state;
+ when "1100" => -- inc
+ left_ctrl <= md_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_inc;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when "1101" => -- tst
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= load_cc;
+ lic <= '1';
+ next_state <= fetch_state;
+ when "1110" => -- jmp
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_ld16;
+ pc_ctrl <= load_pc;
+ lic <= '1';
+ next_state <= fetch_state;
+ when "1111" => -- clr
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_clr;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= single_op_write_state;
+ when others =>
+ lic <= '1';
+ next_state <= fetch_state;
+ end case;
+ --
+ -- single operand 8 bit write
+ -- Write low 8 bits of ALU output
+ -- EA holds address
+ -- MD holds data
+ --
+ when single_op_write_state =>
+ -- write ALU low byte output
+ addr_ctrl <= write_ad;
+ dout_ctrl <= md_lo_dout;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- here if ea holds address of low byte
+ -- read memory location
+ --
+ when dual_op_read8_state =>
+ -- read first data byte from ea
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= read_ad;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- Here to read a 16 bit value into MD
+ -- pointed to by the EA register
+ -- The first byte is read
+ -- and the EA is incremented
+ --
+ when dual_op_read16_state =>
+ -- increment the effective address
+ left_ctrl <= ea_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ -- read the high byte of the 16 bit data
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= read_ad;
+ next_state <= dual_op_read16_2_state;
+
+ --
+ -- here to read the second byte
+ -- pointed to by EA into MD
+ --
+ when dual_op_read16_2_state =>
+ -- read the low byte of the 16 bit data
+ md_ctrl <= fetch_next_md;
+ addr_ctrl <= read_ad;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- 16 bit Write state
+ -- EA hold address of memory to write to
+ -- Advance the effective address in ALU
+ -- decode op_code to determine which
+ -- register to write
+ --
+ when dual_op_write16_state =>
+ -- increment the effective address
+ left_ctrl <= ea_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ -- write the ALU hi byte at ea
+ addr_ctrl <= write_ad;
+ if op_code(6) = '0' then
+ case op_code(3 downto 0) is
+ when "1111" => -- stx / sty
+ case pre_code is
+ when "00010000" => -- page 2 -- sty
+ dout_ctrl <= iy_hi_dout;
+ when others => -- page 1 -- stx
+ dout_ctrl <= ix_hi_dout;
+ end case;
+ when others =>
+ dout_ctrl <= md_hi_dout;
+ end case;
+ else
+ case op_code(3 downto 0) is
+ when "1101" => -- std
+ dout_ctrl <= acca_dout; -- acca is high byte of ACCD
+ when "1111" => -- stu / sts
+ case pre_code is
+ when "00010000" => -- page 2 -- sts
+ dout_ctrl <= sp_hi_dout;
+ when others => -- page 1 -- stu
+ dout_ctrl <= up_hi_dout;
+ end case;
+ when others =>
+ dout_ctrl <= md_hi_dout;
+ end case;
+ end if;
+ next_state <= dual_op_write8_state;
+
+ --
+ -- Dual operand 8 bit write
+ -- Write 8 bit accumulator
+ -- or low byte of 16 bit register
+ -- EA holds address
+ -- decode opcode to determine
+ -- which register to apply to the bus
+ -- Also set the condition codes here
+ --
+ when dual_op_write8_state =>
+ if op_code(6) = '0' then
+ case op_code(3 downto 0) is
+ when "0111" => -- sta
+ dout_ctrl <= acca_dout;
+ when "1111" => -- stx / sty
+ case pre_code is
+ when "00010000" => -- page 2 -- sty
+ dout_ctrl <= iy_lo_dout;
+ when others => -- page 1 -- stx
+ dout_ctrl <= ix_lo_dout;
+ end case;
+ when others =>
+ dout_ctrl <= md_lo_dout;
+ end case;
+ else
+ case op_code(3 downto 0) is
+ when "0111" => -- stb
+ dout_ctrl <= accb_dout;
+ when "1101" => -- std
+ dout_ctrl <= accb_dout; -- accb is low byte of accd
+ when "1111" => -- stu / sts
+ case pre_code is
+ when "00010000" => -- page 2 -- sts
+ dout_ctrl <= sp_lo_dout;
+ when others => -- page 1 -- stu
+ dout_ctrl <= up_lo_dout;
+ end case;
+ when others =>
+ dout_ctrl <= md_lo_dout;
+ end case;
+ end if;
+ -- write ALU low byte output
+ addr_ctrl <= write_ad;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- 16 bit immediate addressing mode
+ --
+ when imm16_state =>
+ -- increment pc
+ pc_ctrl <= incr_pc;
+ -- fetch next immediate byte
+ md_ctrl <= fetch_next_md;
+ addr_ctrl <= fetch_ad;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- md & ea holds 8 bit index offset
+ -- calculate the effective memory address
+ -- using the alu
+ --
+ when indexed_state =>
+ --
+ -- decode indexing mode
+ --
+ if md(7) = '0' then
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ right_ctrl <= md_sign5_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ next_state <= saved_state;
+
+ else
+ case md(3 downto 0) is
+ when "0000" => -- ,R+
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ left_ctrl <= sp_left;
+ end case;
+ --
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ next_state <= postincr1_state;
+
+ when "0001" => -- ,R++
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ next_state <= postincr2_state;
+
+ when "0010" => -- ,-R
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ ix_ctrl <= load_ix;
+ when "01" =>
+ left_ctrl <= iy_left;
+ iy_ctrl <= load_iy;
+ when "10" =>
+ left_ctrl <= up_left;
+ up_ctrl <= load_up;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ sp_ctrl <= load_sp;
+ end case;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ ea_ctrl <= load_ea;
+ next_state <= saved_state;
+
+ when "0011" => -- ,--R
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ ix_ctrl <= load_ix;
+ when "01" =>
+ left_ctrl <= iy_left;
+ iy_ctrl <= load_iy;
+ when "10" =>
+ left_ctrl <= up_left;
+ up_ctrl <= load_up;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ sp_ctrl <= load_sp;
+ end case;
+ right_ctrl <= two_right;
+ alu_ctrl <= alu_sub16;
+ ea_ctrl <= load_ea;
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ when "0100" => -- ,R (zero offset)
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ when "0101" => -- ACCB,R
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ right_ctrl <= accb_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ when "0110" => -- ACCA,R
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ right_ctrl <= acca_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ when "0111" => -- undefined
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ when "1000" => -- offset8,R
+ md_ctrl <= fetch_first_md; -- pick up 8 bit offset
+ addr_ctrl <= fetch_ad;
+ pc_ctrl <= incr_pc;
+ next_state <= index8_state;
+
+ when "1001" => -- offset16,R
+ md_ctrl <= fetch_first_md; -- pick up first byte of 16 bit offset
+ addr_ctrl <= fetch_ad;
+ pc_ctrl <= incr_pc;
+ next_state <= index16_state;
+
+ when "1010" => -- undefined
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ --
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ when "1011" => -- ACCD,R
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ right_ctrl <= accd_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ when "1100" => -- offset8,PC
+ -- fetch 8 bit offset
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= fetch_ad;
+ pc_ctrl <= incr_pc;
+ next_state <= pcrel8_state;
+
+ when "1101" => -- offset16,PC
+ -- fetch offset
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= fetch_ad;
+ pc_ctrl <= incr_pc;
+ next_state <= pcrel16_state;
+
+ when "1110" => -- undefined
+ case md(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ when others =>
+-- when "1111" => -- [,address]
+ -- advance PC to pick up address
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= fetch_ad;
+ pc_ctrl <= incr_pc;
+ next_state <= indexaddr_state;
+ end case;
+ end if;
+
+ -- load index register with ea plus one
+ when postincr1_state =>
+ left_ctrl <= ea_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ case md(6 downto 5) is
+ when "00" =>
+ ix_ctrl <= load_ix;
+ when "01" =>
+ iy_ctrl <= load_iy;
+ when "10" =>
+ up_ctrl <= load_up;
+ when others =>
+ -- when "11" =>
+ sp_ctrl <= load_sp;
+ end case;
+ -- return to previous state
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ -- load index register with ea plus two
+ when postincr2_state =>
+ -- increment register by two (address)
+ left_ctrl <= ea_left;
+ right_ctrl <= two_right;
+ alu_ctrl <= alu_add16;
+ case md(6 downto 5) is
+ when "00" =>
+ ix_ctrl <= load_ix;
+ when "01" =>
+ iy_ctrl <= load_iy;
+ when "10" =>
+ up_ctrl <= load_up;
+ when others =>
+ -- when "11" =>
+ sp_ctrl <= load_sp;
+ end case;
+ -- return to previous state
+ if md(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+ --
+ -- ea = index register + md (8 bit signed offset)
+ -- ea holds post byte
+ --
+ when index8_state =>
+ case ea(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ -- ea = index reg + md
+ right_ctrl <= md_sign8_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ -- return to previous state
+ if ea(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ -- fetch low byte of 16 bit indexed offset
+ when index16_state =>
+ -- advance pc
+ pc_ctrl <= incr_pc;
+ -- fetch low byte
+ md_ctrl <= fetch_next_md;
+ addr_ctrl <= fetch_ad;
+ next_state <= index16_2_state;
+
+ -- ea = index register + md (16 bit offset)
+ -- ea holds post byte
+ when index16_2_state =>
+ case ea(6 downto 5) is
+ when "00" =>
+ left_ctrl <= ix_left;
+ when "01" =>
+ left_ctrl <= iy_left;
+ when "10" =>
+ left_ctrl <= up_left;
+ when others =>
+ -- when "11" =>
+ left_ctrl <= sp_left;
+ end case;
+ -- ea = index reg + md
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ -- return to previous state
+ if ea(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+ --
+ -- pc relative with 8 bit signed offest
+ -- md holds signed offset
+ --
+ when pcrel8_state =>
+ -- ea = pc + signed md
+ left_ctrl <= pc_left;
+ right_ctrl <= md_sign8_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ -- return to previous state
+ if ea(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ -- pc relative addressing with 16 bit offset
+ -- pick up the low byte of the offset in md
+ -- advance the pc
+ when pcrel16_state =>
+ -- advance pc
+ pc_ctrl <= incr_pc;
+ -- fetch low byte
+ md_ctrl <= fetch_next_md;
+ addr_ctrl <= fetch_ad;
+ next_state <= pcrel16_2_state;
+
+ -- pc relative with16 bit signed offest
+ -- md holds signed offset
+ when pcrel16_2_state =>
+ -- ea = pc + md
+ left_ctrl <= pc_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ -- return to previous state
+ if ea(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ -- indexed to address
+ -- pick up the low byte of the address
+ -- advance the pc
+ when indexaddr_state =>
+ -- advance pc
+ pc_ctrl <= incr_pc;
+ -- fetch low byte
+ md_ctrl <= fetch_next_md;
+ addr_ctrl <= fetch_ad;
+ next_state <= indexaddr2_state;
+
+ -- indexed to absolute address
+ -- md holds address
+ -- ea hold indexing mode byte
+ when indexaddr2_state =>
+ -- ea = md
+ left_ctrl <= pc_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ ea_ctrl <= load_ea;
+ -- return to previous state
+ if ea(4) = '0' then
+ next_state <= saved_state;
+ else
+ next_state <= indirect_state;
+ end if;
+
+ --
+ -- load md with high byte of indirect address
+ -- pointed to by ea
+ -- increment ea
+ --
+ when indirect_state =>
+ -- increment ea
+ left_ctrl <= ea_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ ea_ctrl <= load_ea;
+ -- fetch high byte
+ md_ctrl <= fetch_first_md;
+ addr_ctrl <= read_ad;
+ next_state <= indirect2_state;
+ --
+ -- load md with low byte of indirect address
+ -- pointed to by ea
+ -- ea has previously been incremented
+ --
+ when indirect2_state =>
+ -- fetch high byte
+ md_ctrl <= fetch_next_md;
+ addr_ctrl <= read_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= indirect3_state;
+ --
+ -- complete idirect addressing
+ -- by loading ea with md
+ --
+ when indirect3_state =>
+ -- load ea with md
+ left_ctrl <= ea_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ ea_ctrl <= load_ea;
+ -- return to previous state
+ next_state <= saved_state;
+
+ --
+ -- ea holds the low byte of the absolute address
+ -- Move ea low byte into ea high byte
+ -- load new ea low byte to for absolute 16 bit address
+ -- advance the program counter
+ --
+ when extended_state => -- fetch ea low byte
+ -- increment pc
+ pc_ctrl <= incr_pc;
+ -- fetch next effective address bytes
+ ea_ctrl <= fetch_next_ea;
+ addr_ctrl <= fetch_ad;
+ -- return to previous state
+ next_state <= saved_state;
+
+ when lea_state => -- here on load effective address
+ -- load index register with effective address
+ left_ctrl <= pc_left;
+ right_ctrl <= ea_right;
+ alu_ctrl <= alu_lea;
+ case op_code(3 downto 0) is
+ when "0000" => -- leax
+ cc_ctrl <= load_cc;
+ ix_ctrl <= load_ix;
+ when "0001" => -- leay
+ cc_ctrl <= load_cc;
+ iy_ctrl <= load_iy;
+ when "0010" => -- leas
+ sp_ctrl <= load_sp;
+ when "0011" => -- leau
+ up_ctrl <= load_up;
+ when others =>
+ null;
+ end case;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- jump to subroutine
+ -- sp=sp-1
+ -- call push_return_lo_state to save pc
+ -- return to jmp_state
+ --
+ when jsr_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- call push_return_state
+ st_ctrl <= push_st;
+ return_state <= jmp_state;
+ next_state <= push_return_lo_state;
+
+ --
+ -- Load pc with ea
+ -- (JMP)
+ --
+ when jmp_state =>
+ -- load PC with effective address
+ left_ctrl <= pc_left;
+ right_ctrl <= ea_right;
+ alu_ctrl <= alu_ld16;
+ pc_ctrl <= load_pc;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- long branch or branch to subroutine
+ -- pick up next md byte
+ -- md_hi = md_lo
+ -- md_lo = (pc)
+ -- pc=pc+1
+ -- if a lbsr push return address
+ -- continue to sbranch_state
+ -- to evaluate conditional branches
+ --
+ when lbranch_state =>
+ pc_ctrl <= incr_pc;
+ -- fetch the next byte into md_lo
+ md_ctrl <= fetch_next_md;
+ addr_ctrl <= fetch_ad;
+ -- if lbsr - push return address
+ -- then continue on to short branch
+ if op_code = "00010111" then
+ st_ctrl <= push_st;
+ return_state <= sbranch_state;
+ next_state <= push_return_lo_state;
+ else
+ next_state <= sbranch_state;
+ end if;
+
+ --
+ -- here to execute conditional branch
+ -- short conditional branch md = signed 8 bit offset
+ -- long branch md = 16 bit offset
+ --
+ when sbranch_state =>
+ left_ctrl <= pc_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ -- Test condition for branch
+ if op_code(7 downto 4) = "0010" then -- conditional branch
+ case op_code(3 downto 0) is
+ when "0000" => -- bra
+ cond_true := (1 = 1);
+ when "0001" => -- brn
+ cond_true := (1 = 0);
+ when "0010" => -- bhi
+ cond_true := ((cc(CBIT) or cc(ZBIT)) = '0');
+ when "0011" => -- bls
+ cond_true := ((cc(CBIT) or cc(ZBIT)) = '1');
+ when "0100" => -- bcc/bhs
+ cond_true := (cc(CBIT) = '0');
+ when "0101" => -- bcs/blo
+ cond_true := (cc(CBIT) = '1');
+ when "0110" => -- bne
+ cond_true := (cc(ZBIT) = '0');
+ when "0111" => -- beq
+ cond_true := (cc(ZBIT) = '1');
+ when "1000" => -- bvc
+ cond_true := (cc(VBIT) = '0');
+ when "1001" => -- bvs
+ cond_true := (cc(VBIT) = '1');
+ when "1010" => -- bpl
+ cond_true := (cc(NBIT) = '0');
+ when "1011" => -- bmi
+ cond_true := (cc(NBIT) = '1');
+ when "1100" => -- bge
+ cond_true := ((cc(NBIT) xor cc(VBIT)) = '0');
+ when "1101" => -- blt
+ cond_true := ((cc(NBIT) xor cc(VBIT)) = '1');
+ when "1110" => -- bgt
+ cond_true := ((cc(ZBIT) or (cc(NBIT) xor cc(VBIT))) = '0');
+ when "1111" => -- ble
+ cond_true := ((cc(ZBIT) or (cc(NBIT) xor cc(VBIT))) = '1');
+ when others =>
+ null;
+ end case;
+ end if;
+ if cond_true then
+ pc_ctrl <= load_pc;
+ end if;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- push return address onto the S stack
+ --
+ -- (sp) = pc_lo
+ -- sp = sp - 1
+ --
+ when push_return_lo_state =>
+ -- decrement the sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write PC low
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= push_return_hi_state;
+
+ --
+ -- push program counter hi byte onto the stack
+ -- (sp) = pc_hi
+ -- sp = sp
+ -- return to originating state
+ --
+ when push_return_hi_state =>
+ -- write pc hi bytes
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= pc_hi_dout;
+ next_state <= saved_state;
+
+ --
+ -- RTS pull return address from stack
+ --
+ when pull_return_hi_state =>
+ -- increment the sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read pc hi
+ pc_ctrl <= pull_hi_pc;
+ addr_ctrl <= pulls_ad;
+ next_state <= pull_return_lo_state;
+
+ when pull_return_lo_state =>
+ -- increment the SP
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read pc low
+ pc_ctrl <= pull_lo_pc;
+ addr_ctrl <= pulls_ad;
+ dout_ctrl <= pc_lo_dout;
+ --
+ lic <= '1';
+ next_state <= fetch_state;
+
+ when andcc_state =>
+ -- AND CC with md
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_andcc;
+ cc_ctrl <= load_cc;
+ --
+ lic <= '1';
+ next_state <= fetch_state;
+
+ when orcc_state =>
+ -- OR CC with md
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_orcc;
+ cc_ctrl <= load_cc;
+ --
+ lic <= '1';
+ next_state <= fetch_state;
+
+ when tfr_state =>
+ -- select source register
+ case md(7 downto 4) is
+ when "0000" =>
+ left_ctrl <= accd_left;
+ when "0001" =>
+ left_ctrl <= ix_left;
+ when "0010" =>
+ left_ctrl <= iy_left;
+ when "0011" =>
+ left_ctrl <= up_left;
+ when "0100" =>
+ left_ctrl <= sp_left;
+ when "0101" =>
+ left_ctrl <= pc_left;
+ when "1000" =>
+ left_ctrl <= acca_left;
+ when "1001" =>
+ left_ctrl <= accb_left;
+ when "1010" =>
+ left_ctrl <= cc_left;
+ when "1011" =>
+ left_ctrl <= dp_left;
+ when others =>
+ left_ctrl <= md_left;
+ end case;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_tfr;
+ -- select destination register
+ case md(3 downto 0) is
+ when "0000" => -- accd
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ when "0001" => -- ix
+ ix_ctrl <= load_ix;
+ when "0010" => -- iy
+ iy_ctrl <= load_iy;
+ when "0011" => -- up
+ up_ctrl <= load_up;
+ when "0100" => -- sp
+ sp_ctrl <= load_sp;
+ when "0101" => -- pc
+ pc_ctrl <= load_pc;
+ when "1000" => -- acca
+ acca_ctrl <= load_acca;
+ when "1001" => -- accb
+ accb_ctrl <= load_accb;
+ when "1010" => -- cc
+ cc_ctrl <= load_cc;
+ when "1011" => --dp
+ dp_ctrl <= load_dp;
+ when others =>
+ null;
+ end case;
+ --
+ lic <= '1';
+ next_state <= fetch_state;
+
+ when exg_state =>
+ -- save destination register
+ case md(3 downto 0) is
+ when "0000" =>
+ left_ctrl <= accd_left;
+ when "0001" =>
+ left_ctrl <= ix_left;
+ when "0010" =>
+ left_ctrl <= iy_left;
+ when "0011" =>
+ left_ctrl <= up_left;
+ when "0100" =>
+ left_ctrl <= sp_left;
+ when "0101" =>
+ left_ctrl <= pc_left;
+ when "1000" =>
+ left_ctrl <= acca_left;
+ when "1001" =>
+ left_ctrl <= accb_left;
+ when "1010" =>
+ left_ctrl <= cc_left;
+ when "1011" =>
+ left_ctrl <= dp_left;
+ when others =>
+ left_ctrl <= md_left;
+ end case;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_tfr;
+ ea_ctrl <= load_ea;
+ -- call tranfer microcode
+ next_state <= exg1_state;
+
+ when exg1_state =>
+ -- select source register
+ case md(7 downto 4) is
+ when "0000" =>
+ left_ctrl <= accd_left;
+ when "0001" =>
+ left_ctrl <= ix_left;
+ when "0010" =>
+ left_ctrl <= iy_left;
+ when "0011" =>
+ left_ctrl <= up_left;
+ when "0100" =>
+ left_ctrl <= sp_left;
+ when "0101" =>
+ left_ctrl <= pc_left;
+ when "1000" =>
+ left_ctrl <= acca_left;
+ when "1001" =>
+ left_ctrl <= accb_left;
+ when "1010" =>
+ left_ctrl <= cc_left;
+ when "1011" =>
+ left_ctrl <= dp_left;
+ when others =>
+ left_ctrl <= md_left;
+ end case;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_tfr;
+ -- select destination register
+ case md(3 downto 0) is
+ when "0000" => -- accd
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ when "0001" => -- ix
+ ix_ctrl <= load_ix;
+ when "0010" => -- iy
+ iy_ctrl <= load_iy;
+ when "0011" => -- up
+ up_ctrl <= load_up;
+ when "0100" => -- sp
+ sp_ctrl <= load_sp;
+ when "0101" => -- pc
+ pc_ctrl <= load_pc;
+ when "1000" => -- acca
+ acca_ctrl <= load_acca;
+ when "1001" => -- accb
+ accb_ctrl <= load_accb;
+ when "1010" => -- cc
+ cc_ctrl <= load_cc;
+ when "1011" => --dp
+ dp_ctrl <= load_dp;
+ when others =>
+ null;
+ end case;
+ next_state <= exg2_state;
+
+ when exg2_state =>
+ -- restore destination
+ left_ctrl <= ea_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_tfr;
+ -- save as source register
+ case md(7 downto 4) is
+ when "0000" => -- accd
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ when "0001" => -- ix
+ ix_ctrl <= load_ix;
+ when "0010" => -- iy
+ iy_ctrl <= load_iy;
+ when "0011" => -- up
+ up_ctrl <= load_up;
+ when "0100" => -- sp
+ sp_ctrl <= load_sp;
+ when "0101" => -- pc
+ pc_ctrl <= load_pc;
+ when "1000" => -- acca
+ acca_ctrl <= load_acca;
+ when "1001" => -- accb
+ accb_ctrl <= load_accb;
+ when "1010" => -- cc
+ cc_ctrl <= load_cc;
+ when "1011" => --dp
+ dp_ctrl <= load_dp;
+ when others =>
+ null;
+ end case;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ when mul_state =>
+ -- move acca to md
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ md_ctrl <= load_md;
+ next_state <= mulea_state;
+
+ when mulea_state =>
+ -- move accb to ea
+ left_ctrl <= accb_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ ea_ctrl <= load_ea;
+ next_state <= muld_state;
+
+ when muld_state =>
+ -- clear accd
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_ld8;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ next_state <= mul0_state;
+
+ when mul0_state =>
+ -- if bit 0 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ if ea(0) = '1' then
+ right_ctrl <= md_right;
+ else
+ right_ctrl <= zero_right;
+ end if;
+ alu_ctrl <= alu_mul;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ md_ctrl <= shiftl_md;
+ next_state <= mul1_state;
+
+ when mul1_state =>
+ -- if bit 1 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ if ea(1) = '1' then
+ right_ctrl <= md_right;
+ else
+ right_ctrl <= zero_right;
+ end if;
+ alu_ctrl <= alu_mul;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ md_ctrl <= shiftl_md;
+ next_state <= mul2_state;
+
+ when mul2_state =>
+ -- if bit 2 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ if ea(2) = '1' then
+ right_ctrl <= md_right;
+ else
+ right_ctrl <= zero_right;
+ end if;
+ alu_ctrl <= alu_mul;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ md_ctrl <= shiftl_md;
+ next_state <= mul3_state;
+
+ when mul3_state =>
+ -- if bit 3 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ if ea(3) = '1' then
+ right_ctrl <= md_right;
+ else
+ right_ctrl <= zero_right;
+ end if;
+ alu_ctrl <= alu_mul;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ md_ctrl <= shiftl_md;
+ next_state <= mul4_state;
+
+ when mul4_state =>
+ -- if bit 4 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ if ea(4) = '1' then
+ right_ctrl <= md_right;
+ else
+ right_ctrl <= zero_right;
+ end if;
+ alu_ctrl <= alu_mul;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ md_ctrl <= shiftl_md;
+ next_state <= mul5_state;
+
+ when mul5_state =>
+ -- if bit 5 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ if ea(5) = '1' then
+ right_ctrl <= md_right;
+ else
+ right_ctrl <= zero_right;
+ end if;
+ alu_ctrl <= alu_mul;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ md_ctrl <= shiftl_md;
+ next_state <= mul6_state;
+
+ when mul6_state =>
+ -- if bit 6 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ if ea(6) = '1' then
+ right_ctrl <= md_right;
+ else
+ right_ctrl <= zero_right;
+ end if;
+ alu_ctrl <= alu_mul;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ md_ctrl <= shiftl_md;
+ next_state <= mul7_state;
+
+ when mul7_state =>
+ -- if bit 7 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ if ea(7) = '1' then
+ right_ctrl <= md_right;
+ else
+ right_ctrl <= zero_right;
+ end if;
+ alu_ctrl <= alu_mul;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ md_ctrl <= shiftl_md;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- Enter here on pushs
+ -- ea holds post byte
+ --
+ when pshs_state =>
+ -- decrement sp if any registers to be pushed
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ -- idle address
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= cc_dout;
+ if ea(7 downto 0) = "00000000" then
+ sp_ctrl <= latch_sp;
+ else
+ sp_ctrl <= load_sp;
+ end if;
+ if ea(7) = '1' then
+ next_state <= pshs_pcl_state;
+ elsif ea(6) = '1' then
+ next_state <= pshs_upl_state;
+ elsif ea(5) = '1' then
+ next_state <= pshs_iyl_state;
+ elsif ea(4) = '1' then
+ next_state <= pshs_ixl_state;
+ elsif ea(3) = '1' then
+ next_state <= pshs_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshs_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshs_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshs_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshs_pcl_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write pc low
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= pshs_pch_state;
+
+ when pshs_pch_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(6 downto 0) = "0000000" then
+ sp_ctrl <= latch_sp;
+ else
+ sp_ctrl <= load_sp;
+ end if;
+ -- write pc hi
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= pc_hi_dout;
+ if ea(6) = '1' then
+ next_state <= pshs_upl_state;
+ elsif ea(5) = '1' then
+ next_state <= pshs_iyl_state;
+ elsif ea(4) = '1' then
+ next_state <= pshs_ixl_state;
+ elsif ea(3) = '1' then
+ next_state <= pshs_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshs_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshs_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshs_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+
+ when pshs_upl_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write pc low
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= up_lo_dout;
+ next_state <= pshs_uph_state;
+
+ when pshs_uph_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(5 downto 0) = "000000" then
+ sp_ctrl <= latch_sp;
+ else
+ sp_ctrl <= load_sp;
+ end if;
+ -- write pc hi
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= up_hi_dout;
+ if ea(5) = '1' then
+ next_state <= pshs_iyl_state;
+ elsif ea(4) = '1' then
+ next_state <= pshs_ixl_state;
+ elsif ea(3) = '1' then
+ next_state <= pshs_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshs_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshs_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshs_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshs_iyl_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write iy low
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= iy_lo_dout;
+ next_state <= pshs_iyh_state;
+
+ when pshs_iyh_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(4 downto 0) = "00000" then
+ sp_ctrl <= latch_sp;
+ else
+ sp_ctrl <= load_sp;
+ end if;
+ -- write iy hi
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= iy_hi_dout;
+ if ea(4) = '1' then
+ next_state <= pshs_ixl_state;
+ elsif ea(3) = '1' then
+ next_state <= pshs_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshs_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshs_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshs_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshs_ixl_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write ix low
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= ix_lo_dout;
+ next_state <= pshs_ixh_state;
+
+ when pshs_ixh_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(3 downto 0) = "0000" then
+ sp_ctrl <= latch_sp;
+ else
+ sp_ctrl <= load_sp;
+ end if;
+ -- write ix hi
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= ix_hi_dout;
+ if ea(3) = '1' then
+ next_state <= pshs_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshs_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshs_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshs_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshs_dp_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(2 downto 0) = "000" then
+ sp_ctrl <= latch_sp;
+ else
+ sp_ctrl <= load_sp;
+ end if;
+ -- write dp
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= dp_dout;
+ if ea(2) = '1' then
+ next_state <= pshs_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshs_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshs_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshs_accb_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(1 downto 0) = "00" then
+ sp_ctrl <= latch_sp;
+ else
+ sp_ctrl <= load_sp;
+ end if;
+ -- write accb
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= accb_dout;
+ if ea(1) = '1' then
+ next_state <= pshs_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshs_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshs_acca_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(0) = '1' then
+ sp_ctrl <= load_sp;
+ else
+ sp_ctrl <= latch_sp;
+ end if;
+ -- write acca
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= acca_dout;
+ if ea(0) = '1' then
+ next_state <= pshs_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshs_cc_state =>
+ -- idle sp
+ -- write cc
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= cc_dout;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- enter here on PULS
+ -- ea hold register mask
+ --
+ when puls_state =>
+ if ea(0) = '1' then
+ next_state <= puls_cc_state;
+ elsif ea(1) = '1' then
+ next_state <= puls_acca_state;
+ elsif ea(2) = '1' then
+ next_state <= puls_accb_state;
+ elsif ea(3) = '1' then
+ next_state <= puls_dp_state;
+ elsif ea(4) = '1' then
+ next_state <= puls_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= puls_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= puls_uph_state;
+ elsif ea(7) = '1' then
+ next_state <= puls_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when puls_cc_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read cc
+ cc_ctrl <= pull_cc;
+ addr_ctrl <= pulls_ad;
+ if ea(1) = '1' then
+ next_state <= puls_acca_state;
+ elsif ea(2) = '1' then
+ next_state <= puls_accb_state;
+ elsif ea(3) = '1' then
+ next_state <= puls_dp_state;
+ elsif ea(4) = '1' then
+ next_state <= puls_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= puls_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= puls_uph_state;
+ elsif ea(7) = '1' then
+ next_state <= puls_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when puls_acca_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read acca
+ acca_ctrl <= pull_acca;
+ addr_ctrl <= pulls_ad;
+ if ea(2) = '1' then
+ next_state <= puls_accb_state;
+ elsif ea(3) = '1' then
+ next_state <= puls_dp_state;
+ elsif ea(4) = '1' then
+ next_state <= puls_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= puls_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= puls_uph_state;
+ elsif ea(7) = '1' then
+ next_state <= puls_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when puls_accb_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read accb
+ accb_ctrl <= pull_accb;
+ addr_ctrl <= pulls_ad;
+ if ea(3) = '1' then
+ next_state <= puls_dp_state;
+ elsif ea(4) = '1' then
+ next_state <= puls_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= puls_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= puls_uph_state;
+ elsif ea(7) = '1' then
+ next_state <= puls_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when puls_dp_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read dp
+ dp_ctrl <= pull_dp;
+ addr_ctrl <= pulls_ad;
+ if ea(4) = '1' then
+ next_state <= puls_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= puls_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= puls_uph_state;
+ elsif ea(7) = '1' then
+ next_state <= puls_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when puls_ixh_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- pull ix hi
+ ix_ctrl <= pull_hi_ix;
+ addr_ctrl <= pulls_ad;
+ next_state <= puls_ixl_state;
+
+ when puls_ixl_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read ix low
+ ix_ctrl <= pull_lo_ix;
+ addr_ctrl <= pulls_ad;
+ if ea(5) = '1' then
+ next_state <= puls_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= puls_uph_state;
+ elsif ea(7) = '1' then
+ next_state <= puls_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when puls_iyh_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- pull iy hi
+ iy_ctrl <= pull_hi_iy;
+ addr_ctrl <= pulls_ad;
+ next_state <= puls_iyl_state;
+
+ when puls_iyl_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read iy low
+ iy_ctrl <= pull_lo_iy;
+ addr_ctrl <= pulls_ad;
+ if ea(6) = '1' then
+ next_state <= puls_uph_state;
+ elsif ea(7) = '1' then
+ next_state <= puls_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when puls_uph_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- pull up hi
+ up_ctrl <= pull_hi_up;
+ addr_ctrl <= pulls_ad;
+ next_state <= puls_upl_state;
+
+ when puls_upl_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read up low
+ up_ctrl <= pull_lo_up;
+ addr_ctrl <= pulls_ad;
+ if ea(7) = '1' then
+ next_state <= puls_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when puls_pch_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- pull pc hi
+ pc_ctrl <= pull_hi_pc;
+ addr_ctrl <= pulls_ad;
+ next_state <= puls_pcl_state;
+
+ when puls_pcl_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read pc low
+ pc_ctrl <= pull_lo_pc;
+ addr_ctrl <= pulls_ad;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- Enter here on pshu
+ -- ea holds post byte
+ --
+ when pshu_state =>
+ -- decrement up if any registers to be pushed
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(7 downto 0) = "00000000" then
+ up_ctrl <= latch_up;
+ else
+ up_ctrl <= load_up;
+ end if;
+ -- write idle bus
+ if ea(7) = '1' then
+ next_state <= pshu_pcl_state;
+ elsif ea(6) = '1' then
+ next_state <= pshu_spl_state;
+ elsif ea(5) = '1' then
+ next_state <= pshu_iyl_state;
+ elsif ea(4) = '1' then
+ next_state <= pshu_ixl_state;
+ elsif ea(3) = '1' then
+ next_state <= pshu_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshu_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshu_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshu_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+ --
+ -- push PC onto U stack
+ --
+ when pshu_pcl_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ up_ctrl <= load_up;
+ -- write pc low
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= pshu_pch_state;
+
+ when pshu_pch_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(6 downto 0) = "0000000" then
+ up_ctrl <= latch_up;
+ else
+ up_ctrl <= load_up;
+ end if;
+ -- write pc hi
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= pc_hi_dout;
+ if ea(6) = '1' then
+ next_state <= pshu_spl_state;
+ elsif ea(5) = '1' then
+ next_state <= pshu_iyl_state;
+ elsif ea(4) = '1' then
+ next_state <= pshu_ixl_state;
+ elsif ea(3) = '1' then
+ next_state <= pshu_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshu_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshu_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshu_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshu_spl_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ up_ctrl <= load_up;
+ -- write sp low
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= sp_lo_dout;
+ next_state <= pshu_sph_state;
+
+ when pshu_sph_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(5 downto 0) = "000000" then
+ up_ctrl <= latch_up;
+ else
+ up_ctrl <= load_up;
+ end if;
+ -- write sp hi
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= sp_hi_dout;
+ if ea(5) = '1' then
+ next_state <= pshu_iyl_state;
+ elsif ea(4) = '1' then
+ next_state <= pshu_ixl_state;
+ elsif ea(3) = '1' then
+ next_state <= pshu_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshu_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshu_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshu_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshu_iyl_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ up_ctrl <= load_up;
+ -- write iy low
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= iy_lo_dout;
+ next_state <= pshu_iyh_state;
+
+ when pshu_iyh_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(4 downto 0) = "00000" then
+ up_ctrl <= latch_up;
+ else
+ up_ctrl <= load_up;
+ end if;
+ -- write iy hi
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= iy_hi_dout;
+ if ea(4) = '1' then
+ next_state <= pshu_ixl_state;
+ elsif ea(3) = '1' then
+ next_state <= pshu_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshu_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshu_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshu_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshu_ixl_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ up_ctrl <= load_up;
+ -- write ix low
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= ix_lo_dout;
+ next_state <= pshu_ixh_state;
+
+ when pshu_ixh_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(3 downto 0) = "0000" then
+ up_ctrl <= latch_up;
+ else
+ up_ctrl <= load_up;
+ end if;
+ -- write ix hi
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= ix_hi_dout;
+ if ea(3) = '1' then
+ next_state <= pshu_dp_state;
+ elsif ea(2) = '1' then
+ next_state <= pshu_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshu_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshu_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshu_dp_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(2 downto 0) = "000" then
+ up_ctrl <= latch_up;
+ else
+ up_ctrl <= load_up;
+ end if;
+ -- write dp
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= dp_dout;
+ if ea(2) = '1' then
+ next_state <= pshu_accb_state;
+ elsif ea(1) = '1' then
+ next_state <= pshu_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshu_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshu_accb_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(1 downto 0) = "00" then
+ up_ctrl <= latch_up;
+ else
+ up_ctrl <= load_up;
+ end if;
+ -- write accb
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= accb_dout;
+ if ea(1) = '1' then
+ next_state <= pshu_acca_state;
+ elsif ea(0) = '1' then
+ next_state <= pshu_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshu_acca_state =>
+ -- decrement up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ if ea(0) = '0' then
+ up_ctrl <= latch_up;
+ else
+ up_ctrl <= load_up;
+ end if;
+ -- write acca
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= acca_dout;
+ if ea(0) = '1' then
+ next_state <= pshu_cc_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pshu_cc_state =>
+ -- idle up
+ -- write cc
+ addr_ctrl <= pushu_ad;
+ dout_ctrl <= cc_dout;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- enter here on PULU
+ -- ea hold register mask
+ --
+ when pulu_state =>
+ -- idle UP
+ -- idle bus
+ if ea(0) = '1' then
+ next_state <= pulu_cc_state;
+ elsif ea(1) = '1' then
+ next_state <= pulu_acca_state;
+ elsif ea(2) = '1' then
+ next_state <= pulu_accb_state;
+ elsif ea(3) = '1' then
+ next_state <= pulu_dp_state;
+ elsif ea(4) = '1' then
+ next_state <= pulu_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= pulu_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= pulu_sph_state;
+ elsif ea(7) = '1' then
+ next_state <= pulu_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pulu_cc_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read cc
+ cc_ctrl <= pull_cc;
+ addr_ctrl <= pullu_ad;
+ if ea(1) = '1' then
+ next_state <= pulu_acca_state;
+ elsif ea(2) = '1' then
+ next_state <= pulu_accb_state;
+ elsif ea(3) = '1' then
+ next_state <= pulu_dp_state;
+ elsif ea(4) = '1' then
+ next_state <= pulu_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= pulu_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= pulu_sph_state;
+ elsif ea(7) = '1' then
+ next_state <= pulu_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pulu_acca_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read acca
+ acca_ctrl <= pull_acca;
+ addr_ctrl <= pullu_ad;
+ if ea(2) = '1' then
+ next_state <= pulu_accb_state;
+ elsif ea(3) = '1' then
+ next_state <= pulu_dp_state;
+ elsif ea(4) = '1' then
+ next_state <= pulu_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= pulu_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= pulu_sph_state;
+ elsif ea(7) = '1' then
+ next_state <= pulu_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pulu_accb_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read accb
+ accb_ctrl <= pull_accb;
+ addr_ctrl <= pullu_ad;
+ if ea(3) = '1' then
+ next_state <= pulu_dp_state;
+ elsif ea(4) = '1' then
+ next_state <= pulu_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= pulu_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= pulu_sph_state;
+ elsif ea(7) = '1' then
+ next_state <= pulu_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pulu_dp_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read dp
+ dp_ctrl <= pull_dp;
+ addr_ctrl <= pullu_ad;
+ if ea(4) = '1' then
+ next_state <= pulu_ixh_state;
+ elsif ea(5) = '1' then
+ next_state <= pulu_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= pulu_sph_state;
+ elsif ea(7) = '1' then
+ next_state <= pulu_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pulu_ixh_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read ix hi
+ ix_ctrl <= pull_hi_ix;
+ addr_ctrl <= pullu_ad;
+ next_state <= pulu_ixl_state;
+
+ when pulu_ixl_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read ix low
+ ix_ctrl <= pull_lo_ix;
+ addr_ctrl <= pullu_ad;
+ if ea(5) = '1' then
+ next_state <= pulu_iyh_state;
+ elsif ea(6) = '1' then
+ next_state <= pulu_sph_state;
+ elsif ea(7) = '1' then
+ next_state <= pulu_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pulu_iyh_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read iy hi
+ iy_ctrl <= pull_hi_iy;
+ addr_ctrl <= pullu_ad;
+ next_state <= pulu_iyl_state;
+
+ when pulu_iyl_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read iy low
+ iy_ctrl <= pull_lo_iy;
+ addr_ctrl <= pullu_ad;
+ if ea(6) = '1' then
+ next_state <= pulu_sph_state;
+ elsif ea(7) = '1' then
+ next_state <= pulu_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pulu_sph_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read sp hi
+ sp_ctrl <= pull_hi_sp;
+ addr_ctrl <= pullu_ad;
+ next_state <= pulu_spl_state;
+
+ when pulu_spl_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read sp low
+ sp_ctrl <= pull_lo_sp;
+ addr_ctrl <= pullu_ad;
+ if ea(7) = '1' then
+ next_state <= pulu_pch_state;
+ else
+ lic <= '1';
+ next_state <= fetch_state;
+ end if;
+
+ when pulu_pch_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- pull pc hi
+ pc_ctrl <= pull_hi_pc;
+ addr_ctrl <= pullu_ad;
+ next_state <= pulu_pcl_state;
+
+ when pulu_pcl_state =>
+ -- increment up
+ left_ctrl <= up_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ up_ctrl <= load_up;
+ -- read pc low
+ pc_ctrl <= pull_lo_pc;
+ addr_ctrl <= pullu_ad;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- pop the Condition codes
+ --
+ when rti_cc_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read cc
+ cc_ctrl <= pull_cc;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_entire_state;
+
+ --
+ -- Added RTI cycle 11th July 2006 John Kent.
+ -- test the "Entire" Flag
+ -- that has just been popped off the stack
+ --
+ when rti_entire_state =>
+ --
+ -- The Entire flag must be recovered from the stack
+ -- before testing.
+ --
+ if cc(EBIT) = '1' then
+ next_state <= rti_acca_state;
+ else
+ next_state <= rti_pch_state;
+ end if;
+
+ when rti_acca_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read acca
+ acca_ctrl <= pull_acca;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_accb_state;
+
+ when rti_accb_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read accb
+ accb_ctrl <= pull_accb;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_dp_state;
+
+ when rti_dp_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read dp
+ dp_ctrl <= pull_dp;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_ixh_state;
+
+ when rti_ixh_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read ix hi
+ ix_ctrl <= pull_hi_ix;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_ixl_state;
+
+ when rti_ixl_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read ix low
+ ix_ctrl <= pull_lo_ix;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_iyh_state;
+
+ when rti_iyh_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read iy hi
+ iy_ctrl <= pull_hi_iy;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_iyl_state;
+
+ when rti_iyl_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read iy low
+ iy_ctrl <= pull_lo_iy;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_uph_state;
+
+
+ when rti_uph_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read up hi
+ up_ctrl <= pull_hi_up;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_upl_state;
+
+ when rti_upl_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read up low
+ up_ctrl <= pull_lo_up;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_pch_state;
+
+ when rti_pch_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- pull pc hi
+ pc_ctrl <= pull_hi_pc;
+ addr_ctrl <= pulls_ad;
+ next_state <= rti_pcl_state;
+
+ when rti_pcl_state =>
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- pull pc low
+ pc_ctrl <= pull_lo_pc;
+ addr_ctrl <= pulls_ad;
+ lic <= '1';
+ next_state <= fetch_state;
+
+ --
+ -- here on NMI interrupt
+ -- Complete execute cycle of the last instruction.
+ -- If it was a dual operand instruction
+ --
+ when int_nmi_state =>
+ next_state <= int_nmi1_state;
+
+ -- Idle bus cycle
+ when int_nmi1_state =>
+ -- pre decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ iv_ctrl <= nmi_iv;
+ st_ctrl <= push_st;
+ return_state <= int_nmimask_state;
+ next_state <= int_entire_state;
+
+ --
+ -- here on IRQ interrupt
+ -- Complete execute cycle of the last instruction.
+ -- If it was a dual operand instruction
+ --
+ when int_irq_state =>
+ next_state <= int_irq1_state;
+
+ -- pre decrement the sp
+ -- Idle bus cycle
+ when int_irq1_state =>
+ -- pre decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ iv_ctrl <= irq_iv;
+ st_ctrl <= push_st;
+ return_state <= int_irqmask_state;
+ next_state <= int_entire_state;
+
+ --
+ -- here on FIRQ interrupt
+ -- Complete execution cycle of the last instruction
+ -- if it was a dual operand instruction
+ --
+ when int_firq_state =>
+ next_state <= int_firq1_state;
+
+ -- Idle bus cycle
+ when int_firq1_state =>
+ -- pre decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ iv_ctrl <= firq_iv;
+ st_ctrl <= push_st;
+ return_state <= int_firqmask_state;
+ next_state <= int_fast_state;
+
+ --
+ -- CWAI entry point
+ -- stack pointer already pre-decremented
+ -- mask condition codes
+ --
+ when cwai_state =>
+ -- AND CC with md
+ left_ctrl <= md_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_andcc;
+ cc_ctrl <= load_cc;
+ st_ctrl <= push_st;
+ return_state <= int_cwai_state;
+ next_state <= int_entire_state;
+
+ --
+ -- wait here for an interrupt
+ --
+ when int_cwai_state =>
+ if (nmi_req = '1') then
+ iv_ctrl <= nmi_iv;
+ next_state <= int_nmimask_state;
+ --
+ -- FIRQ & IRQ are level sensitive
+ --
+ elsif (firq = '1') and (cc(FBIT) = '0') then
+ iv_ctrl <= firq_iv;
+ next_state <= int_firqmask_state;
+
+ elsif (irq = '1') and (cc(IBIT) = '0') then
+ iv_ctrl <= irq_iv;
+ next_state <= int_irqmask_state;
+ else
+ next_state <= int_cwai_state;
+ end if;
+
+ --
+ -- State to mask I Flag and F Flag (NMI)
+ --
+ when int_nmimask_state =>
+ alu_ctrl <= alu_seif;
+ cc_ctrl <= load_cc;
+ next_state <= vect_hi_state;
+
+ --
+ -- State to mask I Flag and F Flag (FIRQ)
+ --
+ when int_firqmask_state =>
+ alu_ctrl <= alu_seif;
+ cc_ctrl <= load_cc;
+ next_state <= vect_hi_state;
+
+
+ --
+ -- State to mask I Flag and F Flag (SWI)
+ --
+ when int_swimask_state =>
+ alu_ctrl <= alu_seif;
+ cc_ctrl <= load_cc;
+ next_state <= vect_hi_state;
+
+ --
+ -- State to mask I Flag only (IRQ)
+ --
+ when int_irqmask_state =>
+ alu_ctrl <= alu_sei;
+ cc_ctrl <= load_cc;
+ next_state <= vect_hi_state;
+
+ --
+ -- set Entire Flag on SWI, SWI2, SWI3 and CWAI, IRQ and NMI
+ -- before stacking all registers
+ --
+ when int_entire_state =>
+ -- set entire flag
+ alu_ctrl <= alu_see;
+ cc_ctrl <= load_cc;
+ next_state <= int_pcl_state;
+
+ --
+ -- clear Entire Flag on FIRQ
+ -- before stacking all registers
+ --
+ when int_fast_state =>
+ -- clear entire flag
+ alu_ctrl <= alu_cle;
+ cc_ctrl <= load_cc;
+ next_state <= int_pcl_state;
+
+ when int_pcl_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write pc low
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= int_pch_state;
+
+ when int_pch_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write pc hi
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= pc_hi_dout;
+ if cc(EBIT) = '1' then
+ next_state <= int_upl_state;
+ else
+ next_state <= int_cc_state;
+ end if;
+
+ when int_upl_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write up low
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= up_lo_dout;
+ next_state <= int_uph_state;
+
+ when int_uph_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write ix hi
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= up_hi_dout;
+ next_state <= int_iyl_state;
+
+ when int_iyl_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write ix low
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= iy_lo_dout;
+ next_state <= int_iyh_state;
+
+ when int_iyh_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write ix hi
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= iy_hi_dout;
+ next_state <= int_ixl_state;
+
+ when int_ixl_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write ix low
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= ix_lo_dout;
+ next_state <= int_ixh_state;
+
+ when int_ixh_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write ix hi
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= ix_hi_dout;
+ next_state <= int_dp_state;
+
+ when int_dp_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write accb
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= dp_dout;
+ next_state <= int_accb_state;
+
+ when int_accb_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write accb
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= accb_dout;
+ next_state <= int_acca_state;
+
+ when int_acca_state =>
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= one_right;
+ alu_ctrl <= alu_sub16;
+ sp_ctrl <= load_sp;
+ -- write acca
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= acca_dout;
+ next_state <= int_cc_state;
+
+ when int_cc_state =>
+ -- write cc
+ addr_ctrl <= pushs_ad;
+ dout_ctrl <= cc_dout;
+ next_state <= saved_state;
+
+ --
+ -- According to the 6809 programming manual:
+ -- If an interrupt is received and is masked
+ -- or lasts for less than three cycles, the PC
+ -- will advance to the next instruction.
+ -- If an interrupt is unmasked and lasts
+ -- for more than three cycles, an interrupt
+ -- will be generated.
+ -- Note that I don't wait 3 clock cycles.
+ -- John Kent 11th July 2006
+ --
+ when sync_state =>
+ lic <= '1';
+ ba <= '1';
+ --
+ -- Version 1.28 2015-05-30
+ -- Exit sync_state on interrupt.
+ -- If the interrupts are active
+ -- they will be caught in the state_machine process
+ -- and the interrupt service routine microcode will be executed.
+ -- Masked interrupts will exit the sync_state.
+ -- Moved from the state_machine process to the state_sequencer process
+ --
+ if (firq = '1') or (irq = '1') then
+ next_state <= fetch_state;
+ else
+ next_state <= sync_state;
+ end if;
+
+ when halt_state =>
+ --
+ -- 2011-10-30 John Kent
+ -- ba & bs should be high
+ ba <= '1';
+ bs <= '1';
+ if halt = '1' then
+ next_state <= halt_state;
+ else
+ next_state <= fetch_state;
+ end if;
+
+ end case;
+
+--
+-- Ver 1.23 2011-10-30 John Kent
+-- First instruction cycle might be
+-- fetch_state
+-- halt_state
+-- int_nmirq_state
+-- int_firq_state
+--
+ if fic = '1' then
+ --
+ case op_code(7 downto 6) is
+ when "10" => -- acca
+ case op_code(3 downto 0) is
+ when "0000" => -- suba
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ when "0001" => -- cmpa
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ when "0010" => -- sbca
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sbc;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ when "0011" =>
+ case pre_code is
+ when "00010000" => -- page 2 -- cmpd
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= load_cc;
+ when "00010001" => -- page 3 -- cmpu
+ left_ctrl <= up_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= load_cc;
+ when others => -- page 1 -- subd
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ end case;
+ when "0100" => -- anda
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_and;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ when "0101" => -- bita
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_and;
+ cc_ctrl <= load_cc;
+ when "0110" => -- ldaa
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ when "0111" => -- staa
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= load_cc;
+ when "1000" => -- eora
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_eor;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ when "1001" => -- adca
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_adc;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ when "1010" => -- oraa
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ora;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ when "1011" => -- adda
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ when "1100" =>
+ case pre_code is
+ when "00010000" => -- page 2 -- cmpy
+ left_ctrl <= iy_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= load_cc;
+ when "00010001" => -- page 3 -- cmps
+ left_ctrl <= sp_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= load_cc;
+ when others => -- page 1 -- cmpx
+ left_ctrl <= ix_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= load_cc;
+ end case;
+ when "1101" => -- bsr / jsr
+ null;
+ when "1110" => -- ldx
+ case pre_code is
+ when "00010000" => -- page 2 -- ldy
+ left_ctrl <= iy_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ cc_ctrl <= load_cc;
+ iy_ctrl <= load_iy;
+ when others => -- page 1 -- ldx
+ left_ctrl <= ix_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ cc_ctrl <= load_cc;
+ ix_ctrl <= load_ix;
+ end case;
+ when "1111" => -- stx
+ case pre_code is
+ when "00010000" => -- page 2 -- sty
+ left_ctrl <= iy_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= load_cc;
+ when others => -- page 1 -- stx
+ left_ctrl <= ix_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= load_cc;
+ end case;
+ when others =>
+ null;
+ end case;
+ when "11" => -- accb dual op
+ case op_code(3 downto 0) is
+ when "0000" => -- subb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ accb_ctrl <= load_accb;
+ when "0001" => -- cmpb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ when "0010" => -- sbcb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sbc;
+ cc_ctrl <= load_cc;
+ accb_ctrl <= load_accb;
+ when "0011" => -- addd
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ when "0100" => -- andb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_and;
+ cc_ctrl <= load_cc;
+ accb_ctrl <= load_accb;
+ when "0101" => -- bitb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_and;
+ cc_ctrl <= load_cc;
+ when "0110" => -- ldab
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld8;
+ cc_ctrl <= load_cc;
+ accb_ctrl <= load_accb;
+ when "0111" => -- stab
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= load_cc;
+ when "1000" => -- eorb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_eor;
+ cc_ctrl <= load_cc;
+ accb_ctrl <= load_accb;
+ when "1001" => -- adcb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_adc;
+ cc_ctrl <= load_cc;
+ accb_ctrl <= load_accb;
+ when "1010" => -- orab
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ora;
+ cc_ctrl <= load_cc;
+ accb_ctrl <= load_accb;
+ when "1011" => -- addb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add8;
+ cc_ctrl <= load_cc;
+ accb_ctrl <= load_accb;
+ when "1100" => -- ldd
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ when "1101" => -- std
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= load_cc;
+ when "1110" => -- ldu
+ case pre_code is
+ when "00010000" => -- page 2 -- lds
+ left_ctrl <= sp_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ cc_ctrl <= load_cc;
+ sp_ctrl <= load_sp;
+ when others => -- page 1 -- ldu
+ left_ctrl <= up_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ cc_ctrl <= load_cc;
+ up_ctrl <= load_up;
+ end case;
+ when "1111" =>
+ case pre_code is
+ when "00010000" => -- page 2 -- sts
+ left_ctrl <= sp_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= load_cc;
+ when others => -- page 1 -- stu
+ left_ctrl <= up_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= load_cc;
+ end case;
+ when others =>
+ null;
+ end case;
+ when others =>
+ null;
+ end case;
+
+ end if; -- first instruction cycle (fic)
+ lic_out <= lic;
+end process;
+
+end rtl;
+
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/cpu68.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/cpu68.vhd
new file mode 100644
index 00000000..016bd9a9
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/cpu68.vhd
@@ -0,0 +1,3963 @@
+--===========================================================================--
+--
+-- S Y N T H E Z I A B L E CPU68 C O R E
+--
+-- www.OpenCores.Org - December 2002
+-- This core adheres to the GNU public license
+--
+-- File name : cpu68.vhd
+--
+-- Purpose : Implements a 6800 compatible CPU core with some
+-- additional instructions found in the 6801
+--
+-- Dependencies : ieee.Std_Logic_1164
+-- ieee.std_logic_unsigned
+--
+-- Author : John E. Kent
+--
+--===========================================================================----
+--
+-- Revision History:
+--
+-- Date: Revision Author
+-- 22 Sep 2002 0.1 John Kent
+--
+-- 30 Oct 2002 0.2 John Kent
+-- made NMI edge triggered
+--
+-- 30 Oct 2002 0.3 John Kent
+-- more corrections to NMI
+-- added wai_wait_state to prevent stack overflow on wai.
+--
+-- 1 Nov 2002 0.4 John Kent
+-- removed WAI states and integrated WAI with the interrupt service routine
+-- replace Data out (do) and Data in (di) register with a single Memory Data (md) reg.
+-- Added Multiply instruction states.
+-- run ALU and CC out of CPU module for timing measurements.
+--
+-- 3 Nov 2002 0.5 John Kent
+-- Memory Data Register was not loaded on Store instructions
+-- SEV and CLV were not defined in the ALU
+-- Overflow Flag on NEG was incorrect
+--
+-- 16th Feb 2003 0.6 John Kent
+-- Rearranged the execution cycle for dual operand instructions
+-- so that occurs during the following fetch cycle.
+-- This allows the reduction of one clock cycle from dual operand
+-- instruction. Note that this also necessitated re-arranging the
+-- program counter so that it is no longer incremented in the ALU.
+-- The effective address has also been re-arranged to include a
+-- separate added. The STD (store accd) now sets the condition codes.
+--
+-- 28th Jun 2003 0.7 John Kent
+-- Added Hold and Halt signals. Hold is used to steal cycles from the
+-- CPU or add wait states. Halt puts the CPU in the inactive state
+-- and is only honoured in the fetch cycle. Both signals are active high.
+--
+-- 9th Jan 2004 0.8 John Kent
+-- Clear instruction did an alu_ld8 rather than an alu_clr, so
+-- the carry bit was not cleared correctly.
+-- This error was picked up by Michael Hassenfratz.
+--
+
+library ieee;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.STD_LOGIC_ARITH.ALL;
+use IEEE.STD_LOGIC_UNSIGNED.ALL;
+
+entity cpu68 is
+ port (
+ clk: in std_logic;
+ rst: in std_logic;
+ rw: out std_logic;
+ vma: out std_logic;
+ address: out std_logic_vector(15 downto 0);
+ data_in: in std_logic_vector(7 downto 0);
+ data_out: out std_logic_vector(7 downto 0);
+ hold: in std_logic;
+ halt: in std_logic;
+ irq: in std_logic;
+ nmi: in std_logic;
+ test_alu: out std_logic_vector(15 downto 0);
+ test_cc: out std_logic_vector(7 downto 0)
+ );
+end;
+
+architecture CPU_ARCH of cpu68 is
+
+ constant SBIT : integer := 7;
+ constant XBIT : integer := 6;
+ constant HBIT : integer := 5;
+ constant IBIT : integer := 4;
+ constant NBIT : integer := 3;
+ constant ZBIT : integer := 2;
+ constant VBIT : integer := 1;
+ constant CBIT : integer := 0;
+
+ type state_type is (reset_state, fetch_state, decode_state,
+ extended_state, indexed_state, read8_state, read16_state, immediate16_state,
+ write8_state, write16_state,
+ execute_state, halt_state, error_state,
+ mul_state, mulea_state, muld_state,
+ mul0_state, mul1_state, mul2_state, mul3_state,
+ mul4_state, mul5_state, mul6_state, mul7_state,
+ jmp_state, jsr_state, jsr1_state,
+ branch_state, bsr_state, bsr1_state,
+ rts_hi_state, rts_lo_state,
+ int_pcl_state, int_pch_state,
+ int_ixl_state, int_ixh_state,
+ int_cc_state, int_acca_state, int_accb_state,
+ int_wai_state, int_mask_state,
+ rti_state, rti_cc_state, rti_acca_state, rti_accb_state,
+ rti_ixl_state, rti_ixh_state,
+ rti_pcl_state, rti_pch_state,
+ pula_state, psha_state, pulb_state, pshb_state,
+ pulx_lo_state, pulx_hi_state, pshx_lo_state, pshx_hi_state,
+ vect_lo_state, vect_hi_state );
+ type addr_type is (idle_ad, fetch_ad, read_ad, write_ad, push_ad, pull_ad, int_hi_ad, int_lo_ad );
+ type dout_type is (md_lo_dout, md_hi_dout, acca_dout, accb_dout, ix_lo_dout, ix_hi_dout, cc_dout, pc_lo_dout, pc_hi_dout );
+ type op_type is (reset_op, fetch_op, latch_op );
+ type acca_type is (reset_acca, load_acca, load_hi_acca, pull_acca, latch_acca );
+ type accb_type is (reset_accb, load_accb, pull_accb, latch_accb );
+ type cc_type is (reset_cc, load_cc, pull_cc, latch_cc );
+ type ix_type is (reset_ix, load_ix, pull_lo_ix, pull_hi_ix, latch_ix );
+ type sp_type is (reset_sp, latch_sp, load_sp );
+ type pc_type is (reset_pc, latch_pc, load_ea_pc, add_ea_pc, pull_lo_pc, pull_hi_pc, inc_pc );
+ type md_type is (reset_md, latch_md, load_md, fetch_first_md, fetch_next_md, shiftl_md );
+ type ea_type is (reset_ea, latch_ea, add_ix_ea, load_accb_ea, inc_ea, fetch_first_ea, fetch_next_ea );
+ type iv_type is (reset_iv, latch_iv, swi_iv, nmi_iv, irq_iv );
+ type nmi_type is (reset_nmi, set_nmi, latch_nmi );
+ type left_type is (acca_left, accb_left, accd_left, md_left, ix_left, sp_left );
+ type right_type is (md_right, zero_right, plus_one_right, accb_right );
+ type alu_type is (alu_add8, alu_sub8, alu_add16, alu_sub16, alu_adc, alu_sbc,
+ alu_and, alu_ora, alu_eor,
+ alu_tst, alu_inc, alu_dec, alu_clr, alu_neg, alu_com,
+ alu_inx, alu_dex, alu_cpx,
+ alu_lsr16, alu_lsl16,
+ alu_ror8, alu_rol8,
+ alu_asr8, alu_asl8, alu_lsr8,
+ alu_sei, alu_cli, alu_sec, alu_clc, alu_sev, alu_clv, alu_tpa, alu_tap,
+ alu_ld8, alu_st8, alu_ld16, alu_st16, alu_nop, alu_daa );
+
+ signal op_code: std_logic_vector(7 downto 0);
+ signal acca: std_logic_vector(7 downto 0);
+ signal accb: std_logic_vector(7 downto 0);
+ signal cc: std_logic_vector(7 downto 0);
+ signal cc_out: std_logic_vector(7 downto 0);
+ signal xreg: std_logic_vector(15 downto 0);
+ signal sp: std_logic_vector(15 downto 0);
+ signal ea: std_logic_vector(15 downto 0);
+ signal pc: std_logic_vector(15 downto 0);
+ signal md: std_logic_vector(15 downto 0);
+ signal left: std_logic_vector(15 downto 0);
+ signal right: std_logic_vector(15 downto 0);
+ signal out_alu: std_logic_vector(15 downto 0);
+ signal iv: std_logic_vector(1 downto 0);
+ signal nmi_req: std_logic;
+ signal nmi_ack: std_logic;
+
+ signal state: state_type;
+ signal next_state: state_type;
+ signal pc_ctrl: pc_type;
+ signal ea_ctrl: ea_type;
+ signal op_ctrl: op_type;
+ signal md_ctrl: md_type;
+ signal acca_ctrl: acca_type;
+ signal accb_ctrl: accb_type;
+ signal ix_ctrl: ix_type;
+ signal cc_ctrl: cc_type;
+ signal sp_ctrl: sp_type;
+ signal iv_ctrl: iv_type;
+ signal left_ctrl: left_type;
+ signal right_ctrl: right_type;
+ signal alu_ctrl: alu_type;
+ signal addr_ctrl: addr_type;
+ signal dout_ctrl: dout_type;
+ signal nmi_ctrl: nmi_type;
+
+
+begin
+
+----------------------------------
+--
+-- Address bus multiplexer
+--
+----------------------------------
+
+addr_mux: process( clk, addr_ctrl, pc, ea, sp, iv )
+begin
+ case addr_ctrl is
+ when idle_ad =>
+ address <= "1111111111111111";
+ vma <= '0';
+ rw <= '1';
+ when fetch_ad =>
+ address <= pc;
+ vma <= '1';
+ rw <= '1';
+ when read_ad =>
+ address <= ea;
+ vma <= '1';
+ rw <= '1';
+ when write_ad =>
+ address <= ea;
+ vma <= '1';
+ rw <= '0';
+ when push_ad =>
+ address <= sp;
+ vma <= '1';
+ rw <= '0';
+ when pull_ad =>
+ address <= sp;
+ vma <= '1';
+ rw <= '1';
+ when int_hi_ad =>
+ address <= "1111111111111" & iv & "0";
+ vma <= '1';
+ rw <= '1';
+ when int_lo_ad =>
+ address <= "1111111111111" & iv & "1";
+ vma <= '1';
+ rw <= '1';
+ when others =>
+ address <= "1111111111111111";
+ vma <= '0';
+ rw <= '1';
+ end case;
+end process;
+
+--------------------------------
+--
+-- Data Bus output
+--
+--------------------------------
+dout_mux : process( clk, dout_ctrl, md, acca, accb, xreg, pc, cc )
+begin
+ case dout_ctrl is
+ when md_hi_dout => -- alu output
+ data_out <= md(15 downto 8);
+ when md_lo_dout =>
+ data_out <= md(7 downto 0);
+ when acca_dout => -- accumulator a
+ data_out <= acca;
+ when accb_dout => -- accumulator b
+ data_out <= accb;
+ when ix_lo_dout => -- index reg
+ data_out <= xreg(7 downto 0);
+ when ix_hi_dout => -- index reg
+ data_out <= xreg(15 downto 8);
+ when cc_dout => -- condition codes
+ data_out <= cc;
+ when pc_lo_dout => -- low order pc
+ data_out <= pc(7 downto 0);
+ when pc_hi_dout => -- high order pc
+ data_out <= pc(15 downto 8);
+ when others =>
+ data_out <= "00000000";
+ end case;
+end process;
+
+
+----------------------------------
+--
+-- Program Counter Control
+--
+----------------------------------
+
+pc_mux: process( clk, pc_ctrl, pc, out_alu, data_in, ea, hold )
+variable tempof : std_logic_vector(15 downto 0);
+variable temppc : std_logic_vector(15 downto 0);
+begin
+ case pc_ctrl is
+ when add_ea_pc =>
+ if ea(7) = '0' then
+ tempof := "00000000" & ea(7 downto 0);
+ else
+ tempof := "11111111" & ea(7 downto 0);
+ end if;
+ when inc_pc =>
+ tempof := "0000000000000001";
+ when others =>
+ tempof := "0000000000000000";
+ end case;
+
+ case pc_ctrl is
+ when reset_pc =>
+ temppc := "1111111111111110";
+ when load_ea_pc =>
+ temppc := ea;
+ when pull_lo_pc =>
+ temppc(7 downto 0) := data_in;
+ temppc(15 downto 8) := pc(15 downto 8);
+ when pull_hi_pc =>
+ temppc(7 downto 0) := pc(7 downto 0);
+ temppc(15 downto 8) := data_in;
+ when others =>
+ temppc := pc;
+ end case;
+
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ pc <= pc;
+ else
+ pc <= temppc + tempof;
+ end if;
+ end if;
+end process;
+
+----------------------------------
+--
+-- Effective Address Control
+--
+----------------------------------
+
+ea_mux: process( clk, ea_ctrl, ea, out_alu, data_in, accb, xreg, hold )
+variable tempind : std_logic_vector(15 downto 0);
+variable tempea : std_logic_vector(15 downto 0);
+begin
+ case ea_ctrl is
+ when add_ix_ea =>
+ tempind := "00000000" & ea(7 downto 0);
+ when inc_ea =>
+ tempind := "0000000000000001";
+ when others =>
+ tempind := "0000000000000000";
+ end case;
+
+ case ea_ctrl is
+ when reset_ea =>
+ tempea := "0000000000000000";
+ when load_accb_ea =>
+ tempea := "00000000" & accb(7 downto 0);
+ when add_ix_ea =>
+ tempea := xreg;
+ when fetch_first_ea =>
+ tempea(7 downto 0) := data_in;
+ tempea(15 downto 8) := "00000000";
+ when fetch_next_ea =>
+ tempea(7 downto 0) := data_in;
+ tempea(15 downto 8) := ea(7 downto 0);
+ when others =>
+ tempea := ea;
+ end case;
+
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ ea <= ea;
+ else
+ ea <= tempea + tempind;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- Accumulator A
+--
+--------------------------------
+acca_mux : process( clk, acca_ctrl, out_alu, acca, data_in, hold )
+begin
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ acca <= acca;
+ else
+ case acca_ctrl is
+ when reset_acca =>
+ acca <= "00000000";
+ when load_acca =>
+ acca <= out_alu(7 downto 0);
+ when load_hi_acca =>
+ acca <= out_alu(15 downto 8);
+ when pull_acca =>
+ acca <= data_in;
+ when others =>
+-- when latch_acca =>
+ acca <= acca;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- Accumulator B
+--
+--------------------------------
+accb_mux : process( clk, accb_ctrl, out_alu, accb, data_in, hold )
+begin
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ accb <= accb;
+ else
+ case accb_ctrl is
+ when reset_accb =>
+ accb <= "00000000";
+ when load_accb =>
+ accb <= out_alu(7 downto 0);
+ when pull_accb =>
+ accb <= data_in;
+ when others =>
+-- when latch_accb =>
+ accb <= accb;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- X Index register
+--
+--------------------------------
+ix_mux : process( clk, ix_ctrl, out_alu, xreg, data_in, hold )
+begin
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ xreg <= xreg;
+ else
+ case ix_ctrl is
+ when reset_ix =>
+ xreg <= "0000000000000000";
+ when load_ix =>
+ xreg <= out_alu(15 downto 0);
+ when pull_hi_ix =>
+ xreg(15 downto 8) <= data_in;
+ when pull_lo_ix =>
+ xreg(7 downto 0) <= data_in;
+ when others =>
+-- when latch_ix =>
+ xreg <= xreg;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- stack pointer
+--
+--------------------------------
+sp_mux : process( clk, sp_ctrl, out_alu, hold )
+begin
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ sp <= sp;
+ else
+ case sp_ctrl is
+ when reset_sp =>
+ sp <= "0000000000000000";
+ when load_sp =>
+ sp <= out_alu(15 downto 0);
+ when others =>
+-- when latch_sp =>
+ sp <= sp;
+ end case;
+ end if;
+ end if;
+end process;
+
+--------------------------------
+--
+-- Memory Data
+--
+--------------------------------
+md_mux : process( clk, md_ctrl, out_alu, data_in, md, hold )
+begin
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ md <= md;
+ else
+ case md_ctrl is
+ when reset_md =>
+ md <= "0000000000000000";
+ when load_md =>
+ md <= out_alu(15 downto 0);
+ when fetch_first_md =>
+ md(15 downto 8) <= "00000000";
+ md(7 downto 0) <= data_in;
+ when fetch_next_md =>
+ md(15 downto 8) <= md(7 downto 0);
+ md(7 downto 0) <= data_in;
+ when shiftl_md =>
+ md(15 downto 1) <= md(14 downto 0);
+ md(0) <= '0';
+ when others =>
+-- when latch_md =>
+ md <= md;
+ end case;
+ end if;
+ end if;
+end process;
+
+
+----------------------------------
+--
+-- Condition Codes
+--
+----------------------------------
+
+cc_mux: process( clk, cc_ctrl, cc_out, cc, data_in, hold )
+begin
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ cc <= cc;
+ else
+ case cc_ctrl is
+ when reset_cc =>
+ cc <= "11000000";
+ when load_cc =>
+ cc <= cc_out;
+ when pull_cc =>
+ cc <= data_in;
+ when others =>
+-- when latch_cc =>
+ cc <= cc;
+ end case;
+ end if;
+ end if;
+end process;
+
+----------------------------------
+--
+-- interrupt vector
+--
+----------------------------------
+
+iv_mux: process( clk, iv_ctrl, hold )
+begin
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ iv <= iv;
+ else
+ case iv_ctrl is
+ when reset_iv =>
+ iv <= "11";
+ when nmi_iv =>
+ iv <= "10";
+ when swi_iv =>
+ iv <= "01";
+ when irq_iv =>
+ iv <= "00";
+ when others =>
+ iv <= iv;
+ end case;
+ end if;
+ end if;
+end process;
+
+----------------------------------
+--
+-- op code fetch
+--
+----------------------------------
+
+op_fetch: process( clk, data_in, op_ctrl, op_code, hold )
+begin
+ if clk'event and clk = '0' then
+ if hold = '1' then
+ op_code <= op_code;
+ else
+ case op_ctrl is
+ when reset_op =>
+ op_code <= "00000001"; -- nop
+ when fetch_op =>
+ op_code <= data_in;
+ when others =>
+-- when latch_op =>
+ op_code <= op_code;
+ end case;
+ end if;
+ end if;
+end process;
+
+----------------------------------
+--
+-- Left Mux
+--
+----------------------------------
+
+left_mux: process( left_ctrl, acca, accb, xreg, sp, pc, ea, md )
+begin
+ case left_ctrl is
+ when acca_left =>
+ left(15 downto 8) <= "00000000";
+ left(7 downto 0) <= acca;
+ when accb_left =>
+ left(15 downto 8) <= "00000000";
+ left(7 downto 0) <= accb;
+ when accd_left =>
+ left(15 downto 8) <= acca;
+ left(7 downto 0) <= accb;
+ when ix_left =>
+ left <= xreg;
+ when sp_left =>
+ left <= sp;
+ when others =>
+-- when md_left =>
+ left <= md;
+ end case;
+end process;
+----------------------------------
+--
+-- Right Mux
+--
+----------------------------------
+
+right_mux: process( right_ctrl, data_in, md, accb, ea )
+begin
+ case right_ctrl is
+ when zero_right =>
+ right <= "0000000000000000";
+ when plus_one_right =>
+ right <= "0000000000000001";
+ when accb_right =>
+ right <= "00000000" & accb;
+ when others =>
+-- when md_right =>
+ right <= md;
+ end case;
+end process;
+
+----------------------------------
+--
+-- Arithmetic Logic Unit
+--
+----------------------------------
+
+mux_alu: process( alu_ctrl, cc, left, right, out_alu, cc_out )
+variable valid_lo, valid_hi : boolean;
+variable carry_in : std_logic;
+variable daa_reg : std_logic_vector(7 downto 0);
+begin
+
+ case alu_ctrl is
+ when alu_adc | alu_sbc |
+ alu_rol8 | alu_ror8 =>
+ carry_in := cc(CBIT);
+ when others =>
+ carry_in := '0';
+ end case;
+
+ valid_lo := left(3 downto 0) <= 9;
+ valid_hi := left(7 downto 4) <= 9;
+
+ if (cc(CBIT) = '0') then
+ if( cc(HBIT) = '1' ) then
+ if valid_hi then
+ daa_reg := "00000110";
+ else
+ daa_reg := "01100110";
+ end if;
+ else
+ if valid_lo then
+ if valid_hi then
+ daa_reg := "00000000";
+ else
+ daa_reg := "01100000";
+ end if;
+ else
+ if( left(7 downto 4) <= 8 ) then
+ daa_reg := "00000110";
+ else
+ daa_reg := "01100110";
+ end if;
+ end if;
+ end if;
+ else
+ if ( cc(HBIT) = '1' )then
+ daa_reg := "01100110";
+ else
+ if valid_lo then
+ daa_reg := "01100000";
+ else
+ daa_reg := "01100110";
+ end if;
+ end if;
+ end if;
+
+ case alu_ctrl is
+ when alu_add8 | alu_inc |
+ alu_add16 | alu_inx |
+ alu_adc =>
+ out_alu <= left + right + ("000000000000000" & carry_in);
+ when alu_sub8 | alu_dec |
+ alu_sub16 | alu_dex |
+ alu_sbc | alu_cpx =>
+ out_alu <= left - right - ("000000000000000" & carry_in);
+ when alu_and =>
+ out_alu <= left and right; -- and/bit
+ when alu_ora =>
+ out_alu <= left or right; -- or
+ when alu_eor =>
+ out_alu <= left xor right; -- eor/xor
+ when alu_lsl16 | alu_asl8 | alu_rol8 =>
+ out_alu <= left(14 downto 0) & carry_in; -- rol8/asl8/lsl16
+ when alu_lsr16 | alu_lsr8 =>
+ out_alu <= carry_in & left(15 downto 1); -- lsr
+ when alu_ror8 =>
+ out_alu <= "00000000" & carry_in & left(7 downto 1); -- ror
+ when alu_asr8 =>
+ out_alu <= "00000000" & left(7) & left(7 downto 1); -- asr
+ when alu_neg =>
+ out_alu <= right - left; -- neg (right=0)
+ when alu_com =>
+ out_alu <= not left;
+ when alu_clr | alu_ld8 | alu_ld16 =>
+ out_alu <= right; -- clr, ld
+ when alu_st8 | alu_st16 =>
+ out_alu <= left;
+ when alu_daa =>
+ out_alu <= left + ("00000000" & daa_reg);
+ when alu_tpa =>
+ out_alu <= "00000000" & cc;
+ when others =>
+ out_alu <= left; -- nop
+ end case;
+
+ --
+ -- carry bit
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_adc =>
+ cc_out(CBIT) <= (left(7) and right(7)) or
+ (left(7) and not out_alu(7)) or
+ (right(7) and not out_alu(7));
+ when alu_sub8 | alu_sbc =>
+ cc_out(CBIT) <= ((not left(7)) and right(7)) or
+ ((not left(7)) and out_alu(7)) or
+ (right(7) and out_alu(7));
+ when alu_add16 =>
+ cc_out(CBIT) <= (left(15) and right(15)) or
+ (left(15) and not out_alu(15)) or
+ (right(15) and not out_alu(15));
+ when alu_sub16 =>
+ cc_out(CBIT) <= ((not left(15)) and right(15)) or
+ ((not left(15)) and out_alu(15)) or
+ (right(15) and out_alu(15));
+ when alu_ror8 | alu_lsr16 | alu_lsr8 | alu_asr8 =>
+ cc_out(CBIT) <= left(0);
+ when alu_rol8 | alu_asl8 =>
+ cc_out(CBIT) <= left(7);
+ when alu_lsl16 =>
+ cc_out(CBIT) <= left(15);
+ when alu_com =>
+ cc_out(CBIT) <= '1';
+ when alu_neg | alu_clr =>
+ cc_out(CBIT) <= out_alu(7) or out_alu(6) or out_alu(5) or out_alu(4) or
+ out_alu(3) or out_alu(2) or out_alu(1) or out_alu(0);
+ when alu_daa =>
+ if ( daa_reg(7 downto 4) = "0110" ) then
+ cc_out(CBIT) <= '1';
+ else
+ cc_out(CBIT) <= '0';
+ end if;
+ when alu_sec =>
+ cc_out(CBIT) <= '1';
+ when alu_clc =>
+ cc_out(CBIT) <= '0';
+ when alu_tap =>
+ cc_out(CBIT) <= left(CBIT);
+ when others => -- carry is not affected by cpx
+ cc_out(CBIT) <= cc(CBIT);
+ end case;
+ --
+ -- Zero flag
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_sub8 |
+ alu_adc | alu_sbc |
+ alu_and | alu_ora | alu_eor |
+ alu_inc | alu_dec |
+ alu_neg | alu_com | alu_clr |
+ alu_rol8 | alu_ror8 | alu_asr8 | alu_asl8 | alu_lsr8 |
+ alu_ld8 | alu_st8 =>
+ cc_out(ZBIT) <= not( out_alu(7) or out_alu(6) or out_alu(5) or out_alu(4) or
+ out_alu(3) or out_alu(2) or out_alu(1) or out_alu(0) );
+ when alu_add16 | alu_sub16 |
+ alu_lsl16 | alu_lsr16 |
+ alu_inx | alu_dex |
+ alu_ld16 | alu_st16 | alu_cpx =>
+ cc_out(ZBIT) <= not( out_alu(15) or out_alu(14) or out_alu(13) or out_alu(12) or
+ out_alu(11) or out_alu(10) or out_alu(9) or out_alu(8) or
+ out_alu(7) or out_alu(6) or out_alu(5) or out_alu(4) or
+ out_alu(3) or out_alu(2) or out_alu(1) or out_alu(0) );
+ when alu_tap =>
+ cc_out(ZBIT) <= left(ZBIT);
+ when others =>
+ cc_out(ZBIT) <= cc(ZBIT);
+ end case;
+
+ --
+ -- negative flag
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_sub8 |
+ alu_adc | alu_sbc |
+ alu_and | alu_ora | alu_eor |
+ alu_rol8 | alu_ror8 | alu_asr8 | alu_asl8 | alu_lsr8 |
+ alu_inc | alu_dec | alu_neg | alu_com | alu_clr |
+ alu_ld8 | alu_st8 =>
+ cc_out(NBIT) <= out_alu(7);
+ when alu_add16 | alu_sub16 |
+ alu_lsl16 | alu_lsr16 |
+ alu_ld16 | alu_st16 | alu_cpx =>
+ cc_out(NBIT) <= out_alu(15);
+ when alu_tap =>
+ cc_out(NBIT) <= left(NBIT);
+ when others =>
+ cc_out(NBIT) <= cc(NBIT);
+ end case;
+
+ --
+ -- Interrupt mask flag
+ --
+ case alu_ctrl is
+ when alu_sei =>
+ cc_out(IBIT) <= '1'; -- set interrupt mask
+ when alu_cli =>
+ cc_out(IBIT) <= '0'; -- clear interrupt mask
+ when alu_tap =>
+ cc_out(IBIT) <= left(IBIT);
+ when others =>
+ cc_out(IBIT) <= cc(IBIT); -- interrupt mask
+ end case;
+
+ --
+ -- Half Carry flag
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_adc =>
+ cc_out(HBIT) <= (left(3) and right(3)) or
+ (right(3) and not out_alu(3)) or
+ (left(3) and not out_alu(3));
+ when alu_tap =>
+ cc_out(HBIT) <= left(HBIT);
+ when others =>
+ cc_out(HBIT) <= cc(HBIT);
+ end case;
+
+ --
+ -- Overflow flag
+ --
+ case alu_ctrl is
+ when alu_add8 | alu_adc =>
+ cc_out(VBIT) <= (left(7) and right(7) and (not out_alu(7))) or
+ ((not left(7)) and (not right(7)) and out_alu(7));
+ when alu_sub8 | alu_sbc =>
+ cc_out(VBIT) <= (left(7) and (not right(7)) and (not out_alu(7))) or
+ ((not left(7)) and right(7) and out_alu(7));
+ when alu_add16 =>
+ cc_out(VBIT) <= (left(15) and right(15) and (not out_alu(15))) or
+ ((not left(15)) and (not right(15)) and out_alu(15));
+ when alu_sub16 | alu_cpx =>
+ cc_out(VBIT) <= (left(15) and (not right(15)) and (not out_alu(15))) or
+ ((not left(15)) and right(15) and out_alu(15));
+ when alu_inc =>
+ cc_out(VBIT) <= ((not left(7)) and left(6) and left(5) and left(4) and
+ left(3) and left(2) and left(1) and left(0));
+ when alu_dec | alu_neg =>
+ cc_out(VBIT) <= (left(7) and (not left(6)) and (not left(5)) and (not left(4)) and
+ (not left(3)) and (not left(2)) and (not left(1)) and (not left(0)));
+ when alu_asr8 =>
+ cc_out(VBIT) <= left(0) xor left(7);
+ when alu_lsr8 | alu_lsr16 =>
+ cc_out(VBIT) <= left(0);
+ when alu_ror8 =>
+ cc_out(VBIT) <= left(0) xor cc(CBIT);
+ when alu_lsl16 =>
+ cc_out(VBIT) <= left(15) xor left(14);
+ when alu_rol8 | alu_asl8 =>
+ cc_out(VBIT) <= left(7) xor left(6);
+ when alu_tap =>
+ cc_out(VBIT) <= left(VBIT);
+ when alu_and | alu_ora | alu_eor | alu_com |
+ alu_st8 | alu_st16 | alu_ld8 | alu_ld16 |
+ alu_clv =>
+ cc_out(VBIT) <= '0';
+ when alu_sev =>
+ cc_out(VBIT) <= '1';
+ when others =>
+ cc_out(VBIT) <= cc(VBIT);
+ end case;
+
+ case alu_ctrl is
+ when alu_tap =>
+ cc_out(XBIT) <= cc(XBIT) and left(XBIT);
+ cc_out(SBIT) <= left(SBIT);
+ when others =>
+ cc_out(XBIT) <= cc(XBIT) and left(XBIT);
+ cc_out(SBIT) <= cc(SBIT);
+ end case;
+
+ test_alu <= out_alu;
+ test_cc <= cc_out;
+end process;
+
+------------------------------------
+--
+-- Detect Edge of NMI interrupt
+--
+------------------------------------
+
+nmi_handler : process( clk, rst, nmi, nmi_ack )
+begin
+ if clk'event and clk='0' then
+ if hold = '1' then
+ nmi_req <= nmi_req;
+ else
+ if rst='1' then
+ nmi_req <= '0';
+ else
+ if (nmi='1') and (nmi_ack='0') then
+ nmi_req <= '1';
+ else
+ if (nmi='0') and (nmi_ack='1') then
+ nmi_req <= '0';
+ else
+ nmi_req <= nmi_req;
+ end if;
+ end if;
+ end if;
+ end if;
+ end if;
+end process;
+
+------------------------------------
+--
+-- Nmi mux
+--
+------------------------------------
+
+nmi_mux: process( clk, nmi_ctrl, nmi_ack, hold )
+begin
+ if clk'event and clk='0' then
+ if hold = '1' then
+ nmi_ack <= nmi_ack;
+ else
+ case nmi_ctrl is
+ when set_nmi =>
+ nmi_ack <= '1';
+ when reset_nmi =>
+ nmi_ack <= '0';
+ when others =>
+-- when latch_nmi =>
+ nmi_ack <= nmi_ack;
+ end case;
+ end if;
+ end if;
+end process;
+
+------------------------------------
+--
+-- state sequencer
+--
+------------------------------------
+process( state, op_code, cc, ea, irq, nmi_req, nmi_ack, hold, halt )
+ begin
+ case state is
+ when reset_state => -- released from reset
+ -- reset the registers
+ op_ctrl <= reset_op;
+ acca_ctrl <= reset_acca;
+ accb_ctrl <= reset_accb;
+ ix_ctrl <= reset_ix;
+ sp_ctrl <= reset_sp;
+ pc_ctrl <= reset_pc;
+ ea_ctrl <= reset_ea;
+ md_ctrl <= reset_md;
+ iv_ctrl <= reset_iv;
+ nmi_ctrl <= reset_nmi;
+ -- idle the ALU
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= reset_cc;
+ -- idle the bus
+ dout_ctrl <= md_lo_dout;
+ addr_ctrl <= idle_ad;
+ next_state <= vect_hi_state;
+
+ --
+ -- Jump via interrupt vector
+ -- iv holds interrupt type
+ -- fetch PC hi from vector location
+ --
+ when vect_hi_state =>
+ -- default the registers
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ md_ctrl <= latch_md;
+ ea_ctrl <= latch_ea;
+ iv_ctrl <= latch_iv;
+ -- idle the ALU
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ -- fetch pc low interrupt vector
+ pc_ctrl <= pull_hi_pc;
+ addr_ctrl <= int_hi_ad;
+ dout_ctrl <= pc_hi_dout;
+ next_state <= vect_lo_state;
+ --
+ -- jump via interrupt vector
+ -- iv holds vector type
+ -- fetch PC lo from vector location
+ --
+ when vect_lo_state =>
+ -- default the registers
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ md_ctrl <= latch_md;
+ ea_ctrl <= latch_ea;
+ iv_ctrl <= latch_iv;
+ -- idle the ALU
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ -- fetch the vector low byte
+ pc_ctrl <= pull_lo_pc;
+ addr_ctrl <= int_lo_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= fetch_state;
+
+ --
+ -- Here to fetch an instruction
+ -- PC points to opcode
+ -- Should service interrupt requests at this point
+ -- either from the timer
+ -- or from the external input.
+ --
+ when fetch_state =>
+ case op_code(7 downto 4) is
+ when "0000" |
+ "0001" |
+ "0010" | -- branch conditional
+ "0011" |
+ "0100" | -- acca single op
+ "0101" | -- accb single op
+ "0110" | -- indexed single op
+ "0111" => -- extended single op
+ -- idle ALU
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+
+ when "1000" | -- acca immediate
+ "1001" | -- acca direct
+ "1010" | -- acca indexed
+ "1011" => -- acca extended
+ case op_code(3 downto 0) is
+ when "0000" => -- suba
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0001" => -- cmpa
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0010" => -- sbca
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sbc;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0011" => -- subd
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0100" => -- anda
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_and;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0101" => -- bita
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_and;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0110" => -- ldaa
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0111" => -- staa
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1000" => -- eora
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_eor;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1001" => -- adca
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_adc;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1010" => -- oraa
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ora;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1011" => -- adda
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1100" => -- cpx
+ left_ctrl <= ix_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_cpx;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1101" => -- bsr / jsr
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1110" => -- lds
+ left_ctrl <= sp_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= load_sp;
+ when "1111" => -- sts
+ left_ctrl <= sp_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ end case;
+ when "1100" | -- accb immediate
+ "1101" | -- accb direct
+ "1110" | -- accb indexed
+ "1111" => -- accb extended
+ case op_code(3 downto 0) is
+ when "0000" => -- subb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0001" => -- cmpb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0010" => -- sbcb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_sbc;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0011" => -- addd
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0100" => -- andb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_and;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0101" => -- bitb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_and;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0110" => -- ldab
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "0111" => -- stab
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1000" => -- eorb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_eor;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1001" => -- adcb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_adc;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1010" => -- orab
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ora;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1011" => -- addb
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1100" => -- ldd
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1101" => -- std
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when "1110" => -- ldx
+ left_ctrl <= ix_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_ld16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= load_ix;
+ sp_ctrl <= latch_sp;
+ when "1111" => -- stx
+ left_ctrl <= ix_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ when others =>
+ left_ctrl <= accb_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ end case;
+ when others =>
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ end case;
+ md_ctrl <= latch_md;
+ -- fetch the op code
+ op_ctrl <= fetch_op;
+ ea_ctrl <= reset_ea;
+ addr_ctrl <= fetch_ad;
+ dout_ctrl <= md_lo_dout;
+ iv_ctrl <= latch_iv;
+ if halt = '1' then
+ pc_ctrl <= latch_pc;
+ nmi_ctrl <= latch_nmi;
+ next_state <= halt_state;
+ -- service non maskable interrupts
+ elsif (nmi_req = '1') and (nmi_ack = '0') then
+ pc_ctrl <= latch_pc;
+ nmi_ctrl <= set_nmi;
+ next_state <= int_pcl_state;
+ -- service maskable interrupts
+ else
+ --
+ -- nmi request is not cleared until nmi input goes low
+ --
+ if(nmi_req = '0') and (nmi_ack='1') then
+ nmi_ctrl <= reset_nmi;
+ else
+ nmi_ctrl <= latch_nmi;
+ end if;
+ --
+ -- IRQ is level sensitive
+ --
+ if (irq = '1') and (cc(IBIT) = '0') then
+ pc_ctrl <= latch_pc;
+ next_state <= int_pcl_state;
+ else
+ -- Advance the PC to fetch next instruction byte
+ pc_ctrl <= inc_pc;
+ next_state <= decode_state;
+ end if;
+ end if;
+ --
+ -- Here to decode instruction
+ -- and fetch next byte of intruction
+ -- whether it be necessary or not
+ --
+ when decode_state =>
+ -- fetch first byte of address or immediate data
+ ea_ctrl <= fetch_first_ea;
+ addr_ctrl <= fetch_ad;
+ dout_ctrl <= md_lo_dout;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ iv_ctrl <= latch_iv;
+ case op_code(7 downto 4) is
+ when "0000" =>
+ md_ctrl <= fetch_first_md;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ case op_code(3 downto 0) is
+ when "0001" => -- nop
+ left_ctrl <= accd_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ when "0100" => -- lsrd
+ left_ctrl <= accd_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_lsr16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ when "0101" => -- lsld
+ left_ctrl <= accd_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_lsl16;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ ix_ctrl <= latch_ix;
+ when "0110" => -- tap
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_tap;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ when "0111" => -- tpa
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_tpa;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ when "1000" => -- inx
+ left_ctrl <= ix_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_inx;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= load_ix;
+ when "1001" => -- dex
+ left_ctrl <= ix_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_dex;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= load_ix;
+ when "1010" => -- clv
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_clv;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ when "1011" => -- sev
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_sev;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ when "1100" => -- clc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_clc;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ when "1101" => -- sec
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_sec;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ when "1110" => -- cli
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_cli;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ when "1111" => -- sei
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_sei;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ end case;
+ next_state <= fetch_state;
+ -- acca / accb inherent instructions
+ when "0001" =>
+ md_ctrl <= fetch_first_md;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ left_ctrl <= acca_left;
+ right_ctrl <= accb_right;
+ case op_code(3 downto 0) is
+ when "0000" => -- sba
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ when "0001" => -- cba
+ alu_ctrl <= alu_sub8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ when "0110" => -- tab
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= load_accb;
+ when "0111" => -- tba
+ alu_ctrl <= alu_ld8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ when "1001" => -- daa
+ alu_ctrl <= alu_daa;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ when "1011" => -- aba
+ alu_ctrl <= alu_add8;
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_acca;
+ accb_ctrl <= latch_accb;
+ when others =>
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ end case;
+ next_state <= fetch_state;
+ when "0010" => -- branch conditional
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ -- increment the pc
+ pc_ctrl <= inc_pc;
+ case op_code(3 downto 0) is
+ when "0000" => -- bra
+ next_state <= branch_state;
+ when "0001" => -- brn
+ next_state <= fetch_state;
+ when "0010" => -- bhi
+ if (cc(CBIT) or cc(ZBIT)) = '0' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "0011" => -- bls
+ if (cc(CBIT) or cc(ZBIT)) = '1' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "0100" => -- bcc/bhs
+ if cc(CBIT) = '0' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "0101" => -- bcs/blo
+ if cc(CBIT) = '1' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "0110" => -- bne
+ if cc(ZBIT) = '0' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "0111" => -- beq
+ if cc(ZBIT) = '1' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "1000" => -- bvc
+ if cc(VBIT) = '0' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "1001" => -- bvs
+ if cc(VBIT) = '1' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "1010" => -- bpl
+ if cc(NBIT) = '0' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "1011" => -- bmi
+ if cc(NBIT) = '1' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "1100" => -- bge
+ if (cc(NBIT) xor cc(VBIT)) = '0' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "1101" => -- blt
+ if (cc(NBIT) xor cc(VBIT)) = '1' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "1110" => -- bgt
+ if (cc(ZBIT) or (cc(NBIT) xor cc(VBIT))) = '0' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when "1111" => -- ble
+ if (cc(ZBIT) or (cc(NBIT) xor cc(VBIT))) = '1' then
+ next_state <= branch_state;
+ else
+ next_state <= fetch_state;
+ end if;
+ when others =>
+ next_state <= fetch_state;
+ end case;
+ --
+ -- Single byte stack operators
+ -- Do not advance PC
+ --
+ when "0011" =>
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ pc_ctrl <= latch_pc;
+ case op_code(3 downto 0) is
+ when "0000" => -- tsx
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= load_ix;
+ sp_ctrl <= latch_sp;
+ next_state <= fetch_state;
+ when "0001" => -- ins
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= load_sp;
+ next_state <= fetch_state;
+ when "0010" => -- pula
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= load_sp;
+ next_state <= pula_state;
+ when "0011" => -- pulb
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= load_sp;
+ next_state <= pulb_state;
+ when "0100" => -- des
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= load_sp;
+ next_state <= fetch_state;
+ when "0101" => -- txs
+ left_ctrl <= ix_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= load_sp;
+ next_state <= fetch_state;
+ when "0110" => -- psha
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ next_state <= psha_state;
+ when "0111" => -- pshb
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ next_state <= pshb_state;
+ when "1000" => -- pulx
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= load_sp;
+ next_state <= pulx_hi_state;
+ when "1001" => -- rts
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= load_sp;
+ next_state <= rts_hi_state;
+ when "1010" => -- abx
+ left_ctrl <= ix_left;
+ right_ctrl <= accb_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= load_ix;
+ sp_ctrl <= latch_sp;
+ next_state <= fetch_state;
+ when "1011" => -- rti
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= load_sp;
+ next_state <= rti_cc_state;
+ when "1100" => -- pshx
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ next_state <= pshx_lo_state;
+ when "1101" => -- mul
+ left_ctrl <= acca_left;
+ right_ctrl <= accb_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ next_state <= mul_state;
+ when "1110" => -- wai
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ next_state <= int_pcl_state;
+ when "1111" => -- swi
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ next_state <= int_pcl_state;
+ when others =>
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ next_state <= fetch_state;
+ end case;
+ --
+ -- Accumulator A Single operand
+ -- source = Acc A dest = Acc A
+ -- Do not advance PC
+ --
+ when "0100" => -- acca single op
+ md_ctrl <= fetch_first_md;
+ accb_ctrl <= latch_accb;
+ pc_ctrl <= latch_pc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ left_ctrl <= acca_left;
+ case op_code(3 downto 0) is
+ when "0000" => -- neg
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_neg;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when "0011" => -- com
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_com;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when "0100" => -- lsr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_lsr8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when "0110" => -- ror
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_ror8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when "0111" => -- asr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asr8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when "1000" => -- asl
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asl8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when "1001" => -- rol
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_rol8;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when "1010" => -- dec
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_dec;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when "1011" => -- undefined
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ acca_ctrl <= latch_acca;
+ cc_ctrl <= latch_cc;
+ when "1100" => -- inc
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_inc;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when "1101" => -- tst
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ acca_ctrl <= latch_acca;
+ cc_ctrl <= load_cc;
+ when "1110" => -- jmp
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ acca_ctrl <= latch_acca;
+ cc_ctrl <= latch_cc;
+ when "1111" => -- clr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_clr;
+ acca_ctrl <= load_acca;
+ cc_ctrl <= load_cc;
+ when others =>
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ acca_ctrl <= latch_acca;
+ cc_ctrl <= latch_cc;
+ end case;
+ next_state <= fetch_state;
+ --
+ -- single operand acc b
+ -- Do not advance PC
+ --
+ when "0101" =>
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ pc_ctrl <= latch_pc;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ left_ctrl <= accb_left;
+ case op_code(3 downto 0) is
+ when "0000" => -- neg
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_neg;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when "0011" => -- com
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_com;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when "0100" => -- lsr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_lsr8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when "0110" => -- ror
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_ror8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when "0111" => -- asr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asr8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when "1000" => -- asl
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asl8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when "1001" => -- rol
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_rol8;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when "1010" => -- dec
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_dec;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when "1011" => -- undefined
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ accb_ctrl <= latch_accb;
+ cc_ctrl <= latch_cc;
+ when "1100" => -- inc
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_inc;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when "1101" => -- tst
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ accb_ctrl <= latch_accb;
+ cc_ctrl <= load_cc;
+ when "1110" => -- jmp
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ accb_ctrl <= latch_accb;
+ cc_ctrl <= latch_cc;
+ when "1111" => -- clr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_clr;
+ accb_ctrl <= load_accb;
+ cc_ctrl <= load_cc;
+ when others =>
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ accb_ctrl <= latch_accb;
+ cc_ctrl <= latch_cc;
+ end case;
+ next_state <= fetch_state;
+ --
+ -- Single operand indexed
+ -- Two byte instruction so advance PC
+ -- EA should hold index offset
+ --
+ when "0110" => -- indexed single op
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= inc_pc;
+ next_state <= indexed_state;
+ --
+ -- Single operand extended addressing
+ -- three byte instruction so advance the PC
+ -- Low order EA holds high order address
+ --
+ when "0111" => -- extended single op
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= inc_pc;
+ next_state <= extended_state;
+
+ when "1000" => -- acca immediate
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= inc_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- subdd #
+ "1100" | -- cpx #
+ "1110" => -- lds #
+ next_state <= immediate16_state;
+ when "1101" => -- bsr
+ next_state <= bsr_state;
+ when others =>
+ next_state <= fetch_state;
+ end case;
+
+ when "1001" => -- acca direct
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ pc_ctrl <= inc_pc;
+ case op_code(3 downto 0) is
+ when "0111" => -- staa direct
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1111" => -- sts direct
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write16_state;
+ when "1101" => -- jsr direct
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= fetch_first_md;
+ next_state <= jsr_state;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= fetch_first_md;
+ next_state <= read8_state;
+ end case;
+
+ when "1010" => -- acca indexed
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= inc_pc;
+ next_state <= indexed_state;
+
+ when "1011" => -- acca extended
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= inc_pc;
+ next_state <= extended_state;
+
+ when "1100" => -- accb immediate
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= inc_pc;
+ case op_code(3 downto 0) is
+ when "0011" | -- addd #
+ "1100" | -- ldd #
+ "1110" => -- ldx #
+ next_state <= immediate16_state;
+ when others =>
+ next_state <= fetch_state;
+ end case;
+
+ when "1101" => -- accb direct
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ pc_ctrl <= inc_pc;
+ case op_code(3 downto 0) is
+ when "0111" => -- stab direct
+ left_ctrl <= accb_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1101" => -- std direct
+ left_ctrl <= accd_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write16_state;
+ when "1111" => -- stx direct
+ left_ctrl <= ix_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write16_state;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= fetch_first_md;
+ next_state <= read8_state;
+ end case;
+
+ when "1110" => -- accb indexed
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= inc_pc;
+ next_state <= indexed_state;
+
+ when "1111" => -- accb extended
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- increment the pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= inc_pc;
+ next_state <= extended_state;
+
+ when others =>
+ md_ctrl <= fetch_first_md;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ -- idle the pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= latch_pc;
+ next_state <= fetch_state;
+ end case;
+
+ when immediate16_state =>
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ op_ctrl <= latch_op;
+ iv_ctrl <= latch_iv;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment pc
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= inc_pc;
+ -- fetch next immediate byte
+ md_ctrl <= fetch_next_md;
+ addr_ctrl <= fetch_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= fetch_state;
+ --
+ -- ea holds 8 bit index offet
+ -- calculate the effective memory address
+ -- using the alu
+ --
+ when indexed_state =>
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ -- calculate effective address from index reg
+ -- index offest is not sign extended
+ ea_ctrl <= add_ix_ea;
+ -- idle the bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ -- work out next state
+ case op_code(7 downto 4) is
+ when "0110" => -- single op indexed
+ md_ctrl <= latch_md;
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ case op_code(3 downto 0) is
+ when "1011" => -- undefined
+ next_state <= fetch_state;
+ when "1110" => -- jmp
+ next_state <= jmp_state;
+ when others =>
+ next_state <= read8_state;
+ end case;
+ when "1010" => -- acca indexed
+ case op_code(3 downto 0) is
+ when "0111" => -- staa
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1101" => -- jsr
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= latch_md;
+ next_state <= jsr_state;
+ when "1111" => -- sts
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write16_state;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= latch_md;
+ next_state <= read8_state;
+ end case;
+ when "1110" => -- accb indexed
+ case op_code(3 downto 0) is
+ when "0111" => -- stab direct
+ left_ctrl <= accb_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1101" => -- std direct
+ left_ctrl <= accd_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write16_state;
+ when "1111" => -- stx direct
+ left_ctrl <= ix_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write16_state;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= latch_md;
+ next_state <= read8_state;
+ end case;
+ when others =>
+ md_ctrl <= latch_md;
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ next_state <= fetch_state;
+ end case;
+ --
+ -- ea holds the low byte of the absolute address
+ -- Move ea low byte into ea high byte
+ -- load new ea low byte to for absolute 16 bit address
+ -- advance the program counter
+ --
+ when extended_state => -- fetch ea low byte
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ -- increment pc
+ pc_ctrl <= inc_pc;
+ -- fetch next effective address bytes
+ ea_ctrl <= fetch_next_ea;
+ addr_ctrl <= fetch_ad;
+ dout_ctrl <= md_lo_dout;
+ -- work out the next state
+ case op_code(7 downto 4) is
+ when "0111" => -- single op extended
+ md_ctrl <= latch_md;
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ case op_code(3 downto 0) is
+ when "1011" => -- undefined
+ next_state <= fetch_state;
+ when "1110" => -- jmp
+ next_state <= jmp_state;
+ when others =>
+ next_state <= read8_state;
+ end case;
+ when "1011" => -- acca extended
+ case op_code(3 downto 0) is
+ when "0111" => -- staa
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1101" => -- jsr
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= latch_md;
+ next_state <= jsr_state;
+ when "1111" => -- sts
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write16_state;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= latch_md;
+ next_state <= read8_state;
+ end case;
+ when "1111" => -- accb extended
+ case op_code(3 downto 0) is
+ when "0111" => -- stab
+ left_ctrl <= accb_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1101" => -- std
+ left_ctrl <= accd_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write16_state;
+ when "1111" => -- stx
+ left_ctrl <= ix_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ next_state <= write16_state;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= latch_md;
+ next_state <= read8_state;
+ end case;
+ when others =>
+ md_ctrl <= latch_md;
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ next_state <= fetch_state;
+ end case;
+ --
+ -- here if ea holds low byte (direct page)
+ -- can enter here from extended addressing
+ -- read memory location
+ -- note that reads may be 8 or 16 bits
+ --
+ when read8_state => -- read data
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ --
+ addr_ctrl <= read_ad;
+ dout_ctrl <= md_lo_dout;
+ case op_code(7 downto 4) is
+ when "0110" | "0111" => -- single operand
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= fetch_first_md;
+ ea_ctrl <= latch_ea;
+ next_state <= execute_state;
+
+ when "1001" | "1010" | "1011" => -- acca
+ case op_code(3 downto 0) is
+ when "0011" | -- subd
+ "1110" | -- lds
+ "1100" => -- cpx
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= fetch_first_md;
+ -- increment the effective address in case of 16 bit load
+ ea_ctrl <= inc_ea;
+ next_state <= read16_state;
+-- when "0111" => -- staa
+-- left_ctrl <= acca_left;
+-- right_ctrl <= zero_right;
+-- alu_ctrl <= alu_st8;
+-- cc_ctrl <= latch_cc;
+-- md_ctrl <= load_md;
+-- ea_ctrl <= latch_ea;
+-- next_state <= write8_state;
+-- when "1101" => -- jsr
+-- left_ctrl <= acca_left;
+-- right_ctrl <= zero_right;
+-- alu_ctrl <= alu_nop;
+-- cc_ctrl <= latch_cc;
+-- md_ctrl <= latch_md;
+-- ea_ctrl <= latch_ea;
+-- next_state <= jsr_state;
+-- when "1111" => -- sts
+-- left_ctrl <= sp_left;
+-- right_ctrl <= zero_right;
+-- alu_ctrl <= alu_st16;
+-- cc_ctrl <= latch_cc;
+-- md_ctrl <= load_md;
+-- ea_ctrl <= latch_ea;
+-- next_state <= write16_state;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= fetch_first_md;
+ ea_ctrl <= latch_ea;
+ next_state <= fetch_state;
+ end case;
+
+ when "1101" | "1110" | "1111" => -- accb
+ case op_code(3 downto 0) is
+ when "0011" | -- addd
+ "1100" | -- ldd
+ "1110" => -- ldx
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= fetch_first_md;
+ -- increment the effective address in case of 16 bit load
+ ea_ctrl <= inc_ea;
+ next_state <= read16_state;
+-- when "0111" => -- stab
+-- left_ctrl <= accb_left;
+-- right_ctrl <= zero_right;
+-- alu_ctrl <= alu_st8;
+-- cc_ctrl <= latch_cc;
+-- md_ctrl <= load_md;
+-- ea_ctrl <= latch_ea;
+-- next_state <= write8_state;
+-- when "1101" => -- std
+-- left_ctrl <= accd_left;
+-- right_ctrl <= zero_right;
+-- alu_ctrl <= alu_st16;
+-- cc_ctrl <= latch_cc;
+-- md_ctrl <= load_md;
+-- ea_ctrl <= latch_ea;
+-- next_state <= write16_state;
+-- when "1111" => -- stx
+-- left_ctrl <= ix_left;
+-- right_ctrl <= zero_right;
+-- alu_ctrl <= alu_st16;
+-- cc_ctrl <= latch_cc;
+-- md_ctrl <= load_md;
+-- ea_ctrl <= latch_ea;
+-- next_state <= write16_state;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= fetch_first_md;
+ ea_ctrl <= latch_ea;
+ next_state <= execute_state;
+ end case;
+ when others =>
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= fetch_first_md;
+ ea_ctrl <= latch_ea;
+ next_state <= fetch_state;
+ end case;
+
+ when read16_state => -- read second data byte from ea
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ -- idle the effective address
+ ea_ctrl <= latch_ea;
+ -- read the low byte of the 16 bit data
+ md_ctrl <= fetch_next_md;
+ addr_ctrl <= read_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= fetch_state;
+ --
+ -- 16 bit Write state
+ -- write high byte of ALU output.
+ -- EA hold address of memory to write to
+ -- Advance the effective address in ALU
+ --
+ when write16_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ -- increment the effective address
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ ea_ctrl <= inc_ea;
+ -- write the ALU hi byte to ea
+ addr_ctrl <= write_ad;
+ dout_ctrl <= md_hi_dout;
+ next_state <= write8_state;
+ --
+ -- 8 bit write
+ -- Write low 8 bits of ALU output
+ --
+ when write8_state =>
+ -- default registers
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- idle the ALU
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ -- write ALU low byte output
+ addr_ctrl <= write_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= fetch_state;
+
+ when jmp_state =>
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- load PC with effective address
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= load_ea_pc;
+ -- idle the bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= fetch_state;
+
+ when jsr_state => -- JSR
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write pc low
+ addr_ctrl <= push_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= jsr1_state;
+
+ when jsr1_state => -- JSR
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write pc hi
+ addr_ctrl <= push_ad;
+ dout_ctrl <= pc_hi_dout;
+ next_state <= jmp_state;
+
+ when branch_state => -- Bcc
+ -- default registers
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- calculate signed branch
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ pc_ctrl <= add_ea_pc;
+ -- idle the bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= fetch_state;
+
+ when bsr_state => -- BSR
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write pc low
+ addr_ctrl <= push_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= bsr1_state;
+
+ when bsr1_state => -- BSR
+ -- default registers
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write pc hi
+ addr_ctrl <= push_ad;
+ dout_ctrl <= pc_hi_dout;
+ next_state <= branch_state;
+
+ when rts_hi_state => -- RTS
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment the sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- read pc hi
+ pc_ctrl <= pull_hi_pc;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= pc_hi_dout;
+ next_state <= rts_lo_state;
+
+ when rts_lo_state => -- RTS1
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- idle the ALU
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ -- read pc low
+ pc_ctrl <= pull_lo_pc;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= fetch_state;
+
+ when mul_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- move acca to md
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st16;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= load_md;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= mulea_state;
+
+ when mulea_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ md_ctrl <= latch_md;
+ -- idle ALU
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ -- move accb to ea
+ ea_ctrl <= load_accb_ea;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= muld_state;
+
+ when muld_state =>
+ -- default
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ md_ctrl <= latch_md;
+ -- clear accd
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_ld8;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= mul0_state;
+
+ when mul0_state =>
+ -- default
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- if bit 0 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ if ea(0) = '1' then
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ else
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ end if;
+ md_ctrl <= shiftl_md;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= mul1_state;
+
+ when mul1_state =>
+ -- default
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- if bit 1 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ if ea(1) = '1' then
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ else
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ end if;
+ md_ctrl <= shiftl_md;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= mul2_state;
+
+ when mul2_state =>
+ -- default
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- if bit 2 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ if ea(2) = '1' then
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ else
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ end if;
+ md_ctrl <= shiftl_md;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= mul3_state;
+
+ when mul3_state =>
+ -- default
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- if bit 3 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ if ea(3) = '1' then
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ else
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ end if;
+ md_ctrl <= shiftl_md;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= mul4_state;
+
+ when mul4_state =>
+ -- default
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- if bit 4 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ if ea(4) = '1' then
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ else
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ end if;
+ md_ctrl <= shiftl_md;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= mul5_state;
+
+ when mul5_state =>
+ -- default
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- if bit 5 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ if ea(5) = '1' then
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ else
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ end if;
+ md_ctrl <= shiftl_md;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= mul6_state;
+
+ when mul6_state =>
+ -- default
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- if bit 6 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ if ea(6) = '1' then
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ else
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ end if;
+ md_ctrl <= shiftl_md;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= mul7_state;
+
+ when mul7_state =>
+ -- default
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- if bit 7 of ea set, add accd to md
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_add16;
+ if ea(7) = '1' then
+ cc_ctrl <= load_cc;
+ acca_ctrl <= load_hi_acca;
+ accb_ctrl <= load_accb;
+ else
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ end if;
+ md_ctrl <= shiftl_md;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= fetch_state;
+
+ when execute_state => -- execute single operand instruction
+ -- default
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ case op_code(7 downto 4) is
+ when "0110" | -- indexed single op
+ "0111" => -- extended single op
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ iv_ctrl <= latch_iv;
+ ea_ctrl <= latch_ea;
+ -- idle the bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ left_ctrl <= md_left;
+ case op_code(3 downto 0) is
+ when "0000" => -- neg
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_neg;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "0011" => -- com
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_com;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "0100" => -- lsr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_lsr8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "0110" => -- ror
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_ror8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "0111" => -- asr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asr8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1000" => -- asl
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_asl8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1001" => -- rol
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_rol8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1010" => -- dec
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_dec;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1011" => -- undefined
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= latch_md;
+ next_state <= fetch_state;
+ when "1100" => -- inc
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_inc;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when "1101" => -- tst
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_st8;
+ cc_ctrl <= load_cc;
+ md_ctrl <= latch_md;
+ next_state <= fetch_state;
+ when "1110" => -- jmp
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= latch_md;
+ next_state <= fetch_state;
+ when "1111" => -- clr
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_clr;
+ cc_ctrl <= load_cc;
+ md_ctrl <= load_md;
+ next_state <= write8_state;
+ when others =>
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ md_ctrl <= latch_md;
+ next_state <= fetch_state;
+ end case;
+
+ when others =>
+ left_ctrl <= accd_left;
+ right_ctrl <= md_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ ea_ctrl <= latch_ea;
+ -- idle the bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= fetch_state;
+ end case;
+
+ when psha_state =>
+ -- default registers
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write acca
+ addr_ctrl <= push_ad;
+ dout_ctrl <= acca_dout;
+ next_state <= fetch_state;
+
+ when pula_state =>
+ -- default registers
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- idle sp
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= latch_sp;
+ -- read acca
+ acca_ctrl <= pull_acca;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= acca_dout;
+ next_state <= fetch_state;
+
+ when pshb_state =>
+ -- default registers
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write accb
+ addr_ctrl <= push_ad;
+ dout_ctrl <= accb_dout;
+ next_state <= fetch_state;
+
+ when pulb_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- idle sp
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= latch_sp;
+ -- read accb
+ accb_ctrl <= pull_accb;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= accb_dout;
+ next_state <= fetch_state;
+
+ when pshx_lo_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write ix low
+ addr_ctrl <= push_ad;
+ dout_ctrl <= ix_lo_dout;
+ next_state <= pshx_hi_state;
+
+ when pshx_hi_state =>
+ -- default registers
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write ix hi
+ addr_ctrl <= push_ad;
+ dout_ctrl <= ix_hi_dout;
+ next_state <= fetch_state;
+
+ when pulx_hi_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- pull ix hi
+ ix_ctrl <= pull_hi_ix;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= ix_hi_dout;
+ next_state <= pulx_lo_state;
+
+ when pulx_lo_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- idle sp
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= latch_sp;
+ -- read ix low
+ ix_ctrl <= pull_lo_ix;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= ix_lo_dout;
+ next_state <= fetch_state;
+
+ --
+ -- return from interrupt
+ -- enter here from bogus interrupts
+ --
+ when rti_state =>
+ -- default registers
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- idle address bus
+ cc_ctrl <= latch_cc;
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= cc_dout;
+ next_state <= rti_cc_state;
+
+ when rti_cc_state =>
+ -- default registers
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ sp_ctrl <= load_sp;
+ -- read cc
+ cc_ctrl <= pull_cc;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= cc_dout;
+ next_state <= rti_accb_state;
+
+ when rti_accb_state =>
+ -- default registers
+ acca_ctrl <= latch_acca;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- read accb
+ accb_ctrl <= pull_accb;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= accb_dout;
+ next_state <= rti_acca_state;
+
+ when rti_acca_state =>
+ -- default registers
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- read acca
+ acca_ctrl <= pull_acca;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= acca_dout;
+ next_state <= rti_ixh_state;
+
+ when rti_ixh_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- read ix hi
+ ix_ctrl <= pull_hi_ix;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= ix_hi_dout;
+ next_state <= rti_ixl_state;
+
+ when rti_ixl_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- read ix low
+ ix_ctrl <= pull_lo_ix;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= ix_lo_dout;
+ next_state <= rti_pch_state;
+
+ when rti_pch_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- increment sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_add16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- pull pc hi
+ pc_ctrl <= pull_hi_pc;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= pc_hi_dout;
+ next_state <= rti_pcl_state;
+
+ when rti_pcl_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- idle sp
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= latch_sp;
+ -- pull pc low
+ pc_ctrl <= pull_lo_pc;
+ addr_ctrl <= pull_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= fetch_state;
+
+ --
+ -- here on interrupt
+ -- iv register hold interrupt type
+ --
+ when int_pcl_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write pc low
+ addr_ctrl <= push_ad;
+ dout_ctrl <= pc_lo_dout;
+ next_state <= int_pch_state;
+
+ when int_pch_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write pc hi
+ addr_ctrl <= push_ad;
+ dout_ctrl <= pc_hi_dout;
+ next_state <= int_ixl_state;
+
+ when int_ixl_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write ix low
+ addr_ctrl <= push_ad;
+ dout_ctrl <= ix_lo_dout;
+ next_state <= int_ixh_state;
+
+ when int_ixh_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write ix hi
+ addr_ctrl <= push_ad;
+ dout_ctrl <= ix_hi_dout;
+ next_state <= int_acca_state;
+
+ when int_acca_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write acca
+ addr_ctrl <= push_ad;
+ dout_ctrl <= acca_dout;
+ next_state <= int_accb_state;
+
+
+ when int_accb_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write accb
+ addr_ctrl <= push_ad;
+ dout_ctrl <= accb_dout;
+ next_state <= int_cc_state;
+
+ when int_cc_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- decrement sp
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_sub16;
+ cc_ctrl <= latch_cc;
+ sp_ctrl <= load_sp;
+ -- write cc
+ addr_ctrl <= push_ad;
+ dout_ctrl <= cc_dout;
+ nmi_ctrl <= latch_nmi;
+ --
+ -- nmi is edge triggered
+ -- nmi_req is cleared when nmi goes low.
+ --
+ if nmi_req = '1' then
+ iv_ctrl <= nmi_iv;
+ next_state <= vect_hi_state;
+ else
+ --
+ -- IRQ is level sensitive
+ --
+ if (irq = '1') and (cc(IBIT) = '0') then
+ iv_ctrl <= irq_iv;
+ next_state <= int_mask_state;
+ else
+ case op_code is
+ when "00111110" => -- WAI (wait for interrupt)
+ iv_ctrl <= latch_iv;
+ next_state <= int_wai_state;
+ when "00111111" => -- SWI (Software interrupt)
+ iv_ctrl <= swi_iv;
+ next_state <= vect_hi_state;
+ when others => -- bogus interrupt (return)
+ iv_ctrl <= latch_iv;
+ next_state <= rti_state;
+ end case;
+ end if;
+ end if;
+
+ when int_wai_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ op_ctrl <= latch_op;
+ ea_ctrl <= latch_ea;
+ -- enable interrupts
+ left_ctrl <= sp_left;
+ right_ctrl <= plus_one_right;
+ alu_ctrl <= alu_cli;
+ cc_ctrl <= load_cc;
+ sp_ctrl <= latch_sp;
+ -- idle bus
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= cc_dout;
+ if (nmi_req = '1') and (nmi_ack='0') then
+ iv_ctrl <= nmi_iv;
+ nmi_ctrl <= set_nmi;
+ next_state <= vect_hi_state;
+ else
+ --
+ -- nmi request is not cleared until nmi input goes low
+ --
+ if (nmi_req = '0') and (nmi_ack='1') then
+ nmi_ctrl <= reset_nmi;
+ else
+ nmi_ctrl <= latch_nmi;
+ end if;
+ --
+ -- IRQ is level sensitive
+ --
+ if (irq = '1') and (cc(IBIT) = '0') then
+ iv_ctrl <= irq_iv;
+ next_state <= int_mask_state;
+ else
+ iv_ctrl <= latch_iv;
+ next_state <= int_wai_state;
+ end if;
+ end if;
+
+ when int_mask_state =>
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- Mask IRQ
+ left_ctrl <= sp_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_sei;
+ cc_ctrl <= load_cc;
+ sp_ctrl <= latch_sp;
+ -- idle bus cycle
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= vect_hi_state;
+
+ when halt_state => -- halt CPU.
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- do nothing in ALU
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ -- idle bus cycle
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ if halt = '1' then
+ next_state <= halt_state;
+ else
+ next_state <= fetch_state;
+ end if;
+
+ when others => -- error state halt on undefine states
+ -- default
+ acca_ctrl <= latch_acca;
+ accb_ctrl <= latch_accb;
+ ix_ctrl <= latch_ix;
+ sp_ctrl <= latch_sp;
+ pc_ctrl <= latch_pc;
+ md_ctrl <= latch_md;
+ iv_ctrl <= latch_iv;
+ op_ctrl <= latch_op;
+ nmi_ctrl <= latch_nmi;
+ ea_ctrl <= latch_ea;
+ -- do nothing in ALU
+ left_ctrl <= acca_left;
+ right_ctrl <= zero_right;
+ alu_ctrl <= alu_nop;
+ cc_ctrl <= latch_cc;
+ -- idle bus cycle
+ addr_ctrl <= idle_ad;
+ dout_ctrl <= md_lo_dout;
+ next_state <= error_state;
+ end case;
+end process;
+
+--------------------------------
+--
+-- state machine
+--
+--------------------------------
+
+change_state: process( clk, rst, state, hold )
+begin
+ if clk'event and clk = '0' then
+ if rst = '1' then
+ state <= reset_state;
+ elsif hold = '1' then
+ state <= state;
+ else
+ state <= next_state;
+ end if;
+ end if;
+end process;
+ -- output
+
+end CPU_ARCH;
+
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/dac.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/dac.vhd
new file mode 100644
index 00000000..47b2185e
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/dac.vhd
@@ -0,0 +1,48 @@
+-------------------------------------------------------------------------------
+--
+-- 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;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/data_io.v b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/data_io.v
new file mode 100644
index 00000000..4ca9518c
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/data_io.v
@@ -0,0 +1,115 @@
+//
+// data_io.v
+//
+// data_io for the MiST board
+// http://code.google.com/p/mist-board/
+//
+// Copyright (c) 2014 Till Harbaum
+//
+// This source file 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 3 of the License, or
+// (at your option) any later version.
+//
+// This source file 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, see .
+//
+///////////////////////////////////////////////////////////////////////
+
+module data_io
+(
+ input clk_sys,
+ input SPI_SCK,
+ input SPI_SS2,
+ input SPI_DI,
+
+ // ARM -> FPGA download
+ output reg ioctl_download = 0, // signal indicating an active download
+ output reg [7:0] ioctl_index, // menu index used to upload the file
+ output ioctl_wr,
+ output reg [24:0] ioctl_addr,
+ output reg [7:0] ioctl_dout
+);
+
+/////////////////////////////// DOWNLOADING ///////////////////////////////
+
+reg [7:0] data_w;
+reg [24:0] addr_w;
+reg rclk = 0;
+
+localparam UIO_FILE_TX = 8'h53;
+localparam UIO_FILE_TX_DAT = 8'h54;
+localparam UIO_FILE_INDEX = 8'h55;
+
+// data_io has its own SPI interface to the io controller
+always@(posedge SPI_SCK, posedge SPI_SS2) begin
+ reg [6:0] sbuf;
+ reg [7:0] cmd;
+ reg [4:0] cnt;
+ reg [24:0] addr;
+
+ if(SPI_SS2) cnt <= 0;
+ else begin
+ rclk <= 0;
+
+ // don't shift in last bit. It is evaluated directly
+ // when writing to ram
+ if(cnt != 15) sbuf <= { sbuf[5:0], SPI_DI};
+
+ // increase target address after write
+ if(rclk) addr <= addr + 1'd1;
+
+ // count 0-7 8-15 8-15 ...
+ if(cnt < 15) cnt <= cnt + 1'd1;
+ else cnt <= 8;
+
+ // finished command byte
+ if(cnt == 7) cmd <= {sbuf, SPI_DI};
+
+ // prepare/end transmission
+ if((cmd == UIO_FILE_TX) && (cnt == 15)) begin
+ // prepare
+ if(SPI_DI) begin
+ addr <= 0;
+ ioctl_download <= 1;
+ end else begin
+ addr_w <= addr;
+ ioctl_download <= 0;
+ end
+ end
+
+ // command 0x54: UIO_FILE_TX
+ if((cmd == UIO_FILE_TX_DAT) && (cnt == 15)) begin
+ addr_w <= addr;
+ data_w <= {sbuf, SPI_DI};
+ rclk <= 1;
+ end
+
+ // expose file (menu) index
+ if((cmd == UIO_FILE_INDEX) && (cnt == 15)) ioctl_index <= {sbuf, SPI_DI};
+ end
+end
+
+assign ioctl_wr = |ioctl_wrd;
+reg [1:0] ioctl_wrd;
+
+always@(negedge clk_sys) begin
+ reg rclkD, rclkD2;
+
+ rclkD <= rclk;
+ rclkD2 <= rclkD;
+ ioctl_wrd<= {ioctl_wrd[0],1'b0};
+
+ if(rclkD & ~rclkD2) begin
+ ioctl_dout <= data_w;
+ ioctl_addr <= addr_w;
+ ioctl_wrd <= 2'b11;
+ end
+end
+
+endmodule
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/gen_ram.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/gen_ram.vhd
new file mode 100644
index 00000000..f1a95608
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/gen_ram.vhd
@@ -0,0 +1,84 @@
+-- -----------------------------------------------------------------------
+--
+-- Syntiac's generic VHDL support files.
+--
+-- -----------------------------------------------------------------------
+-- Copyright 2005-2008 by Peter Wendrich (pwsoft@syntiac.com)
+-- http://www.syntiac.com/fpga64.html
+--
+-- Modified April 2016 by Dar (darfpga@aol.fr)
+-- http://darfpga.blogspot.fr
+-- Remove address register when writing
+--
+-- -----------------------------------------------------------------------
+--
+-- gen_rwram.vhd
+--
+-- -----------------------------------------------------------------------
+--
+-- generic ram.
+--
+-- -----------------------------------------------------------------------
+
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+use IEEE.numeric_std.ALL;
+
+-- -----------------------------------------------------------------------
+
+entity gen_ram is
+ generic (
+ dWidth : integer := 8;
+ aWidth : integer := 10
+ );
+ port (
+ clk : in std_logic;
+ we : in std_logic;
+ addr : in std_logic_vector((aWidth-1) downto 0);
+ d : in std_logic_vector((dWidth-1) downto 0);
+ q : out std_logic_vector((dWidth-1) downto 0)
+ );
+end entity;
+
+-- -----------------------------------------------------------------------
+
+architecture rtl of gen_ram is
+ subtype addressRange is integer range 0 to ((2**aWidth)-1);
+ type ramDef is array(addressRange) of std_logic_vector((dWidth-1) downto 0);
+ signal ram: ramDef;
+
+ signal rAddrReg : std_logic_vector((aWidth-1) downto 0);
+ signal qReg : std_logic_vector((dWidth-1) downto 0);
+begin
+-- -----------------------------------------------------------------------
+-- Signals to entity interface
+-- -----------------------------------------------------------------------
+-- q <= qReg;
+
+-- -----------------------------------------------------------------------
+-- Memory write
+-- -----------------------------------------------------------------------
+ process(clk)
+ begin
+ if rising_edge(clk) then
+ if we = '1' then
+ ram(to_integer(unsigned(addr))) <= d;
+ end if;
+ end if;
+ end process;
+
+-- -----------------------------------------------------------------------
+-- Memory read
+-- -----------------------------------------------------------------------
+process(clk)
+ begin
+ if rising_edge(clk) then
+-- qReg <= ram(to_integer(unsigned(rAddrReg)));
+-- rAddrReg <= addr;
+---- qReg <= ram(to_integer(unsigned(addr)));
+ q <= ram(to_integer(unsigned(addr)));
+ end if;
+ end process;
+--q <= ram(to_integer(unsigned(addr)));
+end architecture;
+
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/moon_patrol_sound_board.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/moon_patrol_sound_board.vhd
new file mode 100644
index 00000000..126fe870
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/moon_patrol_sound_board.vhd
@@ -0,0 +1,424 @@
+---------------------------------------------------------------------------------
+-- Moon patrol sound board by Dar (darfpga@aol.fr)
+-- http://darfpga.blogspot.fr
+---------------------------------------------------------------------------------
+-- gen_ram.vhd
+-- Copyright 2005-2008 by Peter Wendrich (pwsoft@syntiac.com)
+-- http://www.syntiac.com/fpga64.html
+---------------------------------------------------------------------------------
+-- cpu68 - Version 9th Jan 2004 0.8
+-- 6800/01 compatible CPU core
+-- GNU public license - December 2002 : John E. Kent
+---------------------------------------------------------------------------------
+-- Educational use only
+-- Do not redistribute synthetized file with roms
+-- Do not redistribute roms whatever the form
+-- Use at your own risk
+---------------------------------------------------------------------------------
+-- Version 0.0 -- 24/11/2017 --
+-- initial version
+---------------------------------------------------------------------------------
+
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_unsigned.all;
+use ieee.numeric_std.all;
+
+entity moon_patrol_sound_board is
+port(
+ clock_E : in std_logic; -- 3.58 Mhz/4
+ areset : in std_logic;
+
+ select_sound : in std_logic_vector(7 downto 0);
+ audio_out : out std_logic_vector(11 downto 0);
+
+ dbg_cpu_addr : out std_logic_vector(15 downto 0)
+);
+end moon_patrol_sound_board;
+
+architecture struct of moon_patrol_sound_board is
+ component YM2149
+ port (
+ CLK : in std_logic;
+ CE : in std_logic;
+ RESET : in std_logic;
+ A8 : in std_logic := '1';
+ A9_L : in std_logic := '0';
+ BDIR : in std_logic; -- Bus Direction (0 - read , 1 - write)
+ BC : in std_logic; -- Bus control
+ DI : in std_logic_vector(7 downto 0);
+ DO : out std_logic_vector(7 downto 0);
+ CHANNEL_A : out std_logic_vector(7 downto 0);
+ CHANNEL_B : out std_logic_vector(7 downto 0);
+ CHANNEL_C : out std_logic_vector(7 downto 0);
+
+ SEL : in std_logic;
+ MODE : in std_logic;
+
+ ACTIVE : out std_logic_vector(5 downto 0);
+
+ IOA_in : in std_logic_vector(7 downto 0);
+ IOA_out : out std_logic_vector(7 downto 0);
+
+ IOB_in : in std_logic_vector(7 downto 0);
+ IOB_out : out std_logic_vector(7 downto 0)
+ );
+ end component;
+
+ signal reset : std_logic := '1';
+ signal reset_cnt : integer range 0 to 1000000 := 1000000;
+
+ signal cpu_addr : std_logic_vector(15 downto 0);
+ signal cpu_di : std_logic_vector( 7 downto 0);
+ signal cpu_do : std_logic_vector( 7 downto 0);
+ signal cpu_rw : std_logic;
+ signal cpu_irq : std_logic;
+ signal cpu_nmi : std_logic;
+
+ signal irqraz_cs : std_logic;
+ signal irqraz_we : std_logic;
+
+ signal wram_cs : std_logic;
+ signal wram_we : std_logic;
+ signal wram_do : std_logic_vector( 7 downto 0);
+
+ signal rom_cs : std_logic;
+ signal rom_do : std_logic_vector( 7 downto 0);
+
+ signal ay1_chan_a : std_logic_vector(7 downto 0);
+ signal ay1_chan_b : std_logic_vector(7 downto 0);
+ signal ay1_chan_c : std_logic_vector(7 downto 0);
+ signal ay1_do : std_logic_vector(7 downto 0);
+ signal ay1_audio : std_logic_vector(9 downto 0);
+ signal ay1_port_b_do : std_logic_vector(7 downto 0);
+
+ signal ay2_chan_a : std_logic_vector(7 downto 0);
+ signal ay2_chan_b : std_logic_vector(7 downto 0);
+ signal ay2_chan_c : std_logic_vector(7 downto 0);
+ signal ay2_do : std_logic_vector(7 downto 0);
+ signal ay2_audio : std_logic_vector(9 downto 0);
+
+ signal ports_cs : std_logic;
+ signal ports_we : std_logic;
+
+ signal port1_bus : std_logic_vector(7 downto 0);
+ signal port1_data : std_logic_vector(7 downto 0);
+ signal port1_ddr : std_logic_vector(7 downto 0);
+ signal port1_in : std_logic_vector(7 downto 0);
+
+ signal port2_bus : std_logic_vector(7 downto 0);
+ signal port2_data : std_logic_vector(7 downto 0);
+ signal port2_ddr : std_logic_vector(7 downto 0);
+ signal port2_in : std_logic_vector(7 downto 0);
+
+ signal adpcm_cs : std_logic;
+ signal adpcm_we : std_logic;
+ signal adpcm_0_di : std_logic_vector(3 downto 0);
+
+ signal select_sound_r : std_logic_vector(7 downto 0);
+
+ signal audio : std_logic_vector(12 downto 0);
+
+ type t_step_size is array(0 to 48) of integer range 0 to 1552;
+ constant step_size : t_step_size := (
+ 16, 17, 19, 21, 23, 25, 28, 31,
+ 34, 37, 41, 45, 50, 55, 60, 66,
+ 73, 80, 88, 97, 107, 118, 130, 143,
+ 157, 173, 190, 209, 230, 253, 279, 307,
+ 337, 371, 408, 449, 494, 544, 598, 658,
+ 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552);
+
+ type t_delta_step is array(0 to 7) of integer range -1 to 8;
+ constant delta_step : t_delta_step := (-1,-1,-1,-1,2,4,6,8);
+
+ signal adpcm_vclk : std_logic := '0';
+ signal adpcm_signal : integer range -16384 to 16383 := 0;
+
+-- adpcm algorithm (4bits) [no pcm here]
+--
+-- val : input value 3bits (0 - 7 : b2b1b0)
+-- sign : input value sign (4th bit : 0=>sign=1 ,1=>sign=-1)
+--
+-- step : internal data, init = 0
+-- signal : output value, init = 0;
+--
+-- for each new val (and sign) :
+-- |
+-- | step_size = 16*1.1^(step)
+-- | delta = sign * (step_size/8 + step_size/4*b0 + step_size/2*b1 + step_size*b2)
+-- | signal = signal + delta
+-- | step = step + delta_step(val)
+-- |
+-- | signal is then limited between -2048..2047
+-- | step is then limited between 0..48
+
+begin
+
+dbg_cpu_addr <= cpu_addr;
+
+-- cs
+wram_cs <= '1' when cpu_addr(15 downto 7) = X"00"&'1' else '0'; -- 0080-00FF
+ports_cs <= '1' when cpu_addr(15 downto 4) = X"000" else '0'; -- 0000-000F
+adpcm_cs <= '1' when cpu_addr(14 downto 11) = "0001" else '0'; -- 0800-0FFF / 8800-8FFF
+irqraz_cs <= '1' when cpu_addr(14 downto 12) = "001" else '0'; -- 1000-1FFF / 9000-9FFF
+rom_cs <= '1' when cpu_addr(14 downto 12) = "111" else '0'; -- 7000-7FFF / F000-FFFF
+
+-- write enables
+wram_we <= '1' when cpu_rw = '0' and wram_cs = '1' else '0';
+ports_we <= '1' when cpu_rw = '0' and ports_cs = '1' else '0';
+adpcm_we <= '1' when cpu_rw = '0' and adpcm_cs = '1' else '0';
+irqraz_we <= '1' when cpu_rw = '0' and irqraz_cs = '1' else '0';
+
+-- mux cpu in data between roms/io/wram
+cpu_di <=
+ wram_do when wram_cs = '1' else
+ port1_ddr when ports_cs = '1' and cpu_addr(3 downto 0) = X"0" else
+ port2_ddr when ports_cs = '1' and cpu_addr(3 downto 0) = X"1" else
+ port1_in when ports_cs = '1' and cpu_addr(3 downto 0) = X"2" else
+ port2_in when ports_cs = '1' and cpu_addr(3 downto 0) = X"3" else
+ rom_do when rom_cs = '1' else X"55";
+
+process (clock_E)
+begin
+ if rising_edge(clock_E) then
+ reset <= '0';
+ if reset_cnt /= 0 then
+ reset_cnt <= reset_cnt - 1;
+ reset <= '1';
+ end if;
+ if areset = '1' then
+ reset_cnt <= 1000000;
+ end if;
+ end if;
+end process;
+
+-- irq to cpu
+process (reset, clock_E)
+begin
+ if reset='1' then
+ cpu_irq <= '0';
+ select_sound_r(7) <= '1';
+ elsif rising_edge(clock_E) then
+ select_sound_r <= select_sound;
+ if select_sound_r(7) = '0' then
+ cpu_irq <= '1';
+ end if;
+ if irqraz_we = '1' then
+ cpu_irq <= '0';
+ end if;
+ end if;
+end process;
+
+-- cpu nmi
+cpu_nmi <= adpcm_vclk;
+
+-- 6803 ports 1 and 2 (only)
+process (reset, clock_E)
+begin
+ if reset='1' then
+ port1_ddr <= (others=>'0'); -- port1 set as input
+ port1_data <= (others=>'0'); -- port1 data set to 0
+ port2_ddr <= ("11100000"); -- port2 bit 7 to 5 should always remain output to simulate mode data
+ port2_data <= ("01000000"); -- port2 data bit 7 to 5 set to 2 (for mode 2 at start up)
+ elsif rising_edge(clock_E) then
+ if ports_cs = '1' and ports_we = '1' then
+ if cpu_addr(3 downto 0) = X"0" then port1_ddr <= cpu_do; end if;
+ if cpu_addr(3 downto 0) = X"1" then port2_ddr <= cpu_do and "11100000"; end if;
+ if cpu_addr(3 downto 0) = X"2" then port1_data <= cpu_do; end if;
+ if cpu_addr(3 downto 0) = X"3" then port2_data <= cpu_do; end if;
+ end if;
+ end if;
+end process;
+
+port1_in <= (port1_bus and not(port1_ddr)) or (port1_data and port1_ddr);
+port2_in <= (port2_bus and not(port2_ddr)) or (port2_data and port2_ddr);
+
+-- port1 bus mux
+port1_bus <= ay1_do when port2_data(4) = '0' else
+ ay2_do when port2_data(3) = '0' else X"FF";
+
+-- port2 bus
+port2_bus <= X"FF";
+
+
+-- latch adpcm (msm5205) data in
+process (reset, clock_E)
+begin
+ if reset='1' then
+ adpcm_0_di <= (others=>'0');
+ elsif rising_edge(clock_E) then
+ if adpcm_cs = '1' and adpcm_we = '1' then
+ if cpu_addr(1) = '0' then adpcm_0_di <= cpu_do(3 downto 0); end if;
+ end if;
+ end if;
+end process;
+
+-- adcpm clocks and computation -- make 24kHz and vclk 8/6/4kHz
+adpcm_clocks : process(clock_E, ay1_port_b_do)
+ variable clock_div_a : integer range 0 to 148 := 0;
+ variable clock_div_b : integer range 0 to 5 := 0;
+ variable step : integer range 0 to 48;
+ variable step_n : integer range -1 to 48+8;
+ variable sz : integer range 0 to 1552;
+ variable dn : integer range -32768 to 32767;
+ variable adpcm_signal_n : integer range -32768 to 32767;
+begin
+ if rising_edge(clock_E) then
+ if clock_div_a = 37 then -- 24kHz
+ clock_div_a := 0;
+
+ case ay1_port_b_do(3 downto 2) is
+ when "00" => if clock_div_b = 5 then clock_div_b := 0; else clock_div_b := clock_div_b +1; end if; -- 4kHz
+ when "01" => if clock_div_b = 2 then clock_div_b := 0; else clock_div_b := clock_div_b +1; end if; -- 8kHz
+ when "10" => if clock_div_b = 3 then clock_div_b := 0; else clock_div_b := clock_div_b +1; end if; -- 6kHz
+ when others => null;
+ end case;
+
+ if clock_div_b = 0 then adpcm_vclk <= '1'; else adpcm_vclk <= '0'; end if;
+ else
+ clock_div_a := clock_div_a + 1;
+ end if;
+
+ if ay1_port_b_do(0) = '1' then
+ step := 0;
+ adpcm_signal <= 0;
+ else
+
+ if clock_div_b = 0 then
+ case clock_div_a is
+
+ when 0 => -- it's time to get new nibble (adpcm_0_di)
+
+ sz := step_size(step);
+ dn := sz/8;
+ if adpcm_0_di(0) = '1' then dn := dn + sz/4; end if;
+ if adpcm_0_di(1) = '1' then dn := dn + sz/2; end if;
+ if adpcm_0_di(2) = '1' then dn := dn + sz ; end if;
+
+ if adpcm_0_di(3) = '1' then
+ dn := -dn;
+ end if;
+
+ step_n := step + delta_step(to_integer(unsigned(adpcm_0_di(2 downto 0))));
+
+ when 4 =>
+
+ adpcm_signal_n := adpcm_signal + dn;
+
+ if step_n > 48 then step := 48; else step := step_n; end if;
+ if step_n < 0 then step := 0; else step := step_n; end if;
+
+ when 8 =>
+
+ if adpcm_signal_n > 2040 then adpcm_signal <= 2040; else adpcm_signal <= adpcm_signal_n; end if;
+ if adpcm_signal_n < -2040 then adpcm_signal <= -2040; else adpcm_signal <= adpcm_signal_n; end if;
+
+ when others => null;
+
+ end case;
+ end if;
+
+ end if;
+ end if;
+end process;
+
+-- audio mux
+audio <= ("000"&ay1_audio) + ("000"&ay2_audio) + ('0'&std_logic_vector(to_unsigned((adpcm_signal)+2048,12)));
+audio_out <= audio(12 downto 1);
+
+-- microprocessor 6800/01/03
+main_cpu : entity work.cpu68
+port map(
+ clk => clock_E, -- E clock input (falling edge)
+ rst => reset, -- reset input (active high)
+ rw => cpu_rw, -- read not write output
+ vma => open, -- valid memory address (active high)
+ address => cpu_addr, -- address bus output
+ data_in => cpu_di, -- data bus input
+ data_out => cpu_do, -- data bus output
+ hold => '0', -- hold input (active high) extend bus cycle
+ halt => '0', -- halt input (active high) grants DMA
+ irq => cpu_irq, -- interrupt request input (active high)
+ nmi => cpu_nmi, -- non maskable interrupt request input (active high)
+ test_alu => open,
+ test_cc => open
+);
+
+-- cpu program rom
+cpu_prog_rom : entity work.travusa_sound
+port map(
+ clk => clock_E,
+ addr => cpu_addr(11 downto 0),
+ data => rom_do
+);
+
+-- cpu wram
+cpu_ram : entity work.gen_ram
+generic map( dWidth => 8, aWidth => 7)
+port map(
+ clk => clock_E,
+ we => wram_we,
+ addr => cpu_addr(6 downto 0),
+ d => cpu_do,
+ q => wram_do
+);
+
+ ay83910_inst1: YM2149
+ port map (
+ CLK => clock_E,
+ CE => '1',
+ RESET => reset,
+ A8 => '1',
+ A9_L => port2_data(4),
+ BDIR => port2_data(0),
+ BC => port2_data(2),
+ DI => port1_data,
+ DO => ay1_do,
+ CHANNEL_A => ay1_chan_a,
+ CHANNEL_B => ay1_chan_b,
+ CHANNEL_C => ay1_chan_c,
+
+ SEL => '0',
+ MODE => '1',
+
+ ACTIVE => open,
+
+ IOA_in => select_sound_r,
+ IOA_out => open,
+
+ IOB_in => (others => '0'),
+ IOB_out => ay1_port_b_do
+ );
+
+ ay1_audio <= "0000000000" + ay1_chan_a + ay1_chan_b + ay1_chan_c;
+
+ ay83910_inst2: YM2149
+ port map (
+ CLK => clock_E,
+ CE => '1',
+ RESET => reset,
+ A8 => '1',
+ A9_L => port2_data(3),
+ BDIR => port2_data(0),
+ BC => port2_data(2),
+ DI => port1_data,
+ DO => ay2_do,
+ CHANNEL_A => ay2_chan_a,
+ CHANNEL_B => ay2_chan_b,
+ CHANNEL_C => ay2_chan_c,
+
+ SEL => '0',
+ MODE => '1',
+
+ ACTIVE => open,
+
+ IOA_in => (others => '0'),
+ IOA_out => open,
+
+ IOB_in => (others => '0'),
+ IOB_out => open
+ );
+
+ ay2_audio <= "0000000000" + ay2_chan_a + ay2_chan_b + ay2_chan_c;
+
+end struct;
\ No newline at end of file
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/pll_mist.ppf b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/pll_mist.ppf
new file mode 100644
index 00000000..f2b387ff
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/pll_mist.ppf
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/pll_mist.qip b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/pll_mist.qip
new file mode 100644
index 00000000..d4720390
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/pll_mist.qip
@@ -0,0 +1,4 @@
+set_global_assignment -name IP_TOOL_NAME "ALTPLL"
+set_global_assignment -name IP_TOOL_VERSION "13.1"
+set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "pll_mist.vhd"]
+set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "pll_mist.ppf"]
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/pll_mist.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/pll_mist.vhd
new file mode 100644
index 00000000..d34f8803
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/pll_mist.vhd
@@ -0,0 +1,397 @@
+-- megafunction wizard: %ALTPLL%
+-- GENERATION: STANDARD
+-- VERSION: WM1.0
+-- MODULE: altpll
+
+-- ============================================================
+-- File Name: pll_mist.vhd
+-- Megafunction Name(s):
+-- altpll
+--
+-- Simulation Library Files(s):
+-- altera_mf
+-- ============================================================
+-- ************************************************************
+-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
+--
+-- 13.1.4 Build 182 03/12/2014 SJ Web Edition
+-- ************************************************************
+
+
+--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
+--(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_mist IS
+ PORT
+ (
+ areset : IN STD_LOGIC := '0';
+ inclk0 : IN STD_LOGIC := '0';
+ c0 : OUT STD_LOGIC ;
+ c1 : OUT STD_LOGIC ;
+ locked : OUT STD_LOGIC
+ );
+END pll_mist;
+
+
+ARCHITECTURE SYN OF pll_mist 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_VECTOR (1 DOWNTO 0);
+ SIGNAL sub_wire6_bv : BIT_VECTOR (0 DOWNTO 0);
+ SIGNAL sub_wire6 : 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;
+ 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;
+ self_reset_on_loss_lock : 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);
+ locked : OUT STD_LOGIC
+ );
+ END COMPONENT;
+
+BEGIN
+ sub_wire6_bv(0 DOWNTO 0) <= "0";
+ sub_wire6 <= To_stdlogicvector(sub_wire6_bv);
+ sub_wire3 <= sub_wire0(0);
+ sub_wire1 <= sub_wire0(1);
+ c1 <= sub_wire1;
+ locked <= sub_wire2;
+ c0 <= sub_wire3;
+ sub_wire4 <= inclk0;
+ sub_wire5 <= sub_wire6(0 DOWNTO 0) & sub_wire4;
+
+ altpll_component : altpll
+ GENERIC MAP (
+ bandwidth_type => "AUTO",
+ clk0_divide_by => 30,
+ clk0_duty_cycle => 50,
+ clk0_multiply_by => 41,
+ clk0_phase_shift => "0",
+ clk1_divide_by => 2475,
+ clk1_duty_cycle => 50,
+ clk1_multiply_by => 82,
+ clk1_phase_shift => "0",
+ compensate_clock => "CLK0",
+ inclk0_input_frequency => 37037,
+ intended_device_family => "Cyclone III",
+ lpm_hint => "CBX_MODULE_PREFIX=pll_mist",
+ 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_USED",
+ 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_UNUSED",
+ port_clk3 => "PORT_UNUSED",
+ 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",
+ self_reset_on_loss_lock => "OFF",
+ width_clock => 5
+ )
+ PORT MAP (
+ areset => areset,
+ inclk => sub_wire5,
+ clk => sub_wire0,
+ locked => sub_wire2
+ );
+
+
+
+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 "30"
+-- Retrieval info: PRIVATE: DIV_FACTOR1 NUMERIC "2475"
+-- Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
+-- Retrieval info: PRIVATE: DUTY_CYCLE1 STRING "50.00000000"
+-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE0 STRING "36.900002"
+-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE1 STRING "0.894545"
+-- 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: LVDS_PHASE_SHIFT_UNIT1 STRING "deg"
+-- 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: MULT_FACTOR0 NUMERIC "41"
+-- Retrieval info: PRIVATE: MULT_FACTOR1 NUMERIC "82"
+-- Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
+-- Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "36.86400000"
+-- Retrieval info: PRIVATE: OUTPUT_FREQ1 STRING "0.89500000"
+-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "0"
+-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE1 STRING "0"
+-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
+-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT1 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_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: 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_mist.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: 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_CLKENA0 STRING "0"
+-- Retrieval info: PRIVATE: USE_CLKENA1 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 "30"
+-- Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
+-- Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "41"
+-- Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
+-- Retrieval info: CONSTANT: CLK1_DIVIDE_BY NUMERIC "2475"
+-- Retrieval info: CONSTANT: CLK1_DUTY_CYCLE NUMERIC "50"
+-- Retrieval info: CONSTANT: CLK1_MULTIPLY_BY NUMERIC "82"
+-- Retrieval info: CONSTANT: CLK1_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_USED"
+-- 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: @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: 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: c1 0 0 0 0 @clk 0 0 1 1
+-- Retrieval info: CONNECT: locked 0 0 0 0 @locked 0 0 0 0
+-- Retrieval info: GEN_FILE: TYPE_NORMAL pll_mist.vhd TRUE
+-- Retrieval info: GEN_FILE: TYPE_NORMAL pll_mist.ppf TRUE
+-- Retrieval info: GEN_FILE: TYPE_NORMAL pll_mist.inc FALSE
+-- Retrieval info: GEN_FILE: TYPE_NORMAL pll_mist.cmp FALSE
+-- Retrieval info: GEN_FILE: TYPE_NORMAL pll_mist.bsf FALSE
+-- Retrieval info: GEN_FILE: TYPE_NORMAL pll_mist_inst.vhd FALSE
+-- Retrieval info: LIB_FILE: altera_mf
+-- Retrieval info: CBX_MODULE_PREFIX: ON
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_bit1.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_bit1.vhd
new file mode 100644
index 00000000..89678cad
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_bit1.vhd
@@ -0,0 +1,534 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_chr_bit1 is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(12 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_chr_bit1 is
+ type rom is array(0 to 8191) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",
+ X"40",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"02",
+ X"02",X"02",X"02",X"02",X"02",X"02",X"02",X"02",X"02",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"10",X"10",X"08",X"08",X"10",X"10",X"20",X"20",X"10",X"10",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"30",X"30",X"30",X"30",X"30",
+ X"30",X"30",X"30",X"30",X"38",X"30",X"20",X"00",X"00",X"00",X"10",X"10",X"10",X"10",X"10",X"00",
+ X"00",X"00",X"00",X"C0",X"C0",X"00",X"00",X"00",X"00",X"00",X"48",X"FC",X"48",X"24",X"7E",X"24",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"38",X"44",X"82",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"82",X"44",X"38",X"00",X"80",X"40",X"20",X"10",X"08",X"04",X"02",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"16",X"0E",X"00",X"00",X"00",
+ X"00",X"00",X"16",X"0E",X"00",X"00",X"16",X"0E",X"00",X"F8",X"FC",X"26",X"22",X"26",X"FC",X"F8",
+ X"00",X"FE",X"FE",X"92",X"92",X"92",X"FE",X"6C",X"00",X"38",X"7C",X"C6",X"82",X"82",X"C6",X"44",
+ X"00",X"FE",X"FE",X"82",X"82",X"C6",X"7C",X"38",X"00",X"FE",X"FE",X"92",X"92",X"92",X"82",X"80",
+ X"00",X"FE",X"FE",X"12",X"12",X"12",X"12",X"02",X"00",X"38",X"7C",X"C6",X"82",X"92",X"F2",X"F2",
+ X"00",X"FE",X"FE",X"10",X"10",X"10",X"FE",X"FE",X"00",X"82",X"82",X"FE",X"FE",X"82",X"82",X"00",
+ X"00",X"40",X"C0",X"80",X"80",X"80",X"7E",X"7E",X"00",X"FE",X"FE",X"30",X"78",X"EC",X"C6",X"82",
+ X"00",X"FE",X"FE",X"80",X"80",X"80",X"80",X"80",X"00",X"FE",X"FE",X"1C",X"38",X"1C",X"FE",X"FE",
+ X"00",X"FE",X"FE",X"1C",X"38",X"70",X"FE",X"FE",X"00",X"7C",X"FE",X"82",X"82",X"82",X"FE",X"7C",
+ X"00",X"FE",X"FE",X"22",X"22",X"22",X"3E",X"1C",X"00",X"7C",X"FE",X"82",X"A2",X"C2",X"7E",X"FC",
+ X"00",X"FE",X"FE",X"22",X"62",X"F2",X"DE",X"9C",X"00",X"4C",X"DE",X"92",X"92",X"96",X"F4",X"60",
+ X"00",X"02",X"02",X"FE",X"FE",X"02",X"02",X"00",X"00",X"7E",X"FE",X"80",X"80",X"80",X"FE",X"7E",
+ X"00",X"1E",X"3E",X"70",X"E0",X"70",X"3E",X"1E",X"00",X"FE",X"FE",X"70",X"38",X"70",X"FE",X"FE",
+ X"00",X"C6",X"EE",X"7C",X"38",X"7C",X"EE",X"C6",X"00",X"0E",X"1E",X"F0",X"F0",X"1E",X"0E",X"00",
+ X"00",X"C6",X"E6",X"F6",X"DE",X"CE",X"C6",X"00",X"00",X"1E",X"04",X"1A",X"00",X"1C",X"04",X"18",
+ X"84",X"58",X"20",X"10",X"08",X"F4",X"22",X"C0",X"3C",X"42",X"99",X"A5",X"A5",X"91",X"42",X"3C",
+ X"00",X"1E",X"04",X"08",X"04",X"1E",X"00",X"90",X"40",X"20",X"10",X"08",X"04",X"F2",X"20",X"C0",
+ X"F8",X"80",X"80",X"00",X"80",X"00",X"F0",X"48",X"48",X"F0",X"00",X"80",X"00",X"00",X"00",X"00",
+ X"F8",X"80",X"80",X"00",X"80",X"00",X"38",X"40",X"80",X"40",X"38",X"80",X"00",X"00",X"00",X"00",
+ X"F8",X"20",X"20",X"F8",X"00",X"70",X"88",X"88",X"70",X"00",X"78",X"80",X"80",X"78",X"00",X"80",
+ X"90",X"A8",X"A8",X"40",X"00",X"08",X"F8",X"08",X"80",X"00",X"00",X"F8",X"80",X"80",X"00",X"80",
+ X"70",X"88",X"88",X"00",X"F8",X"20",X"20",X"F8",X"00",X"F8",X"00",X"80",X"00",X"00",X"00",X"00",
+ X"1F",X"02",X"04",X"1F",X"00",X"10",X"03",X"04",X"1C",X"04",X"13",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"07",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"C0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"AA",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"EA",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"E0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"38",X"7C",X"C2",X"82",X"86",X"7C",X"38",X"00",X"80",X"84",X"FE",X"FE",X"80",X"80",X"00",
+ X"00",X"CC",X"E6",X"F2",X"B2",X"BA",X"9E",X"8C",X"00",X"40",X"C2",X"92",X"9A",X"9E",X"F6",X"62",
+ X"00",X"30",X"38",X"2C",X"26",X"FE",X"FE",X"20",X"00",X"4E",X"CE",X"8A",X"8A",X"FA",X"70",X"00",
+ X"00",X"78",X"FC",X"96",X"92",X"92",X"F2",X"60",X"00",X"06",X"06",X"E2",X"F2",X"1A",X"0E",X"06",
+ X"00",X"6C",X"9E",X"9A",X"B2",X"B2",X"EC",X"60",X"00",X"0C",X"9E",X"92",X"92",X"D2",X"7E",X"3C",
+ X"00",X"40",X"C0",X"80",X"80",X"80",X"FE",X"7E",X"00",X"7E",X"FE",X"80",X"80",X"80",X"FE",X"7E",
+ X"00",X"FE",X"FE",X"1C",X"38",X"1C",X"FE",X"FE",X"00",X"FE",X"FE",X"22",X"22",X"22",X"3E",X"1C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"40",X"20",X"20",X"20",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"E3",X"C1",X"C1",X"C1",X"C3",X"E3",X"E7",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"3F",X"3F",X"1F",X"0F",X"07",X"47",X"E3",X"73",X"E3",X"E3",X"B3",
+ X"F7",X"E7",X"4F",X"1F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FD",X"F3",X"E0",X"E0",X"E2",X"C2",
+ X"C7",X"C3",X"CB",X"CF",X"CF",X"E5",X"E5",X"E5",X"E1",X"E0",X"F0",X"F8",X"FC",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"73",X"34",X"37",X"43",X"81",X"80",X"00",X"00",X"FF",X"FE",X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",
+ X"FF",X"3F",X"3F",X"43",X"81",X"80",X"00",X"00",X"FF",X"FE",X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",
+ X"0F",X"03",X"01",X"00",X"00",X"80",X"A1",X"BF",X"FC",X"FC",X"FC",X"FC",X"FE",X"FF",X"FF",X"FF",
+ X"0F",X"03",X"01",X"00",X"00",X"80",X"E1",X"FF",X"FC",X"FC",X"FC",X"FC",X"FE",X"FF",X"FF",X"FF",
+ X"DC",X"DC",X"9C",X"DC",X"DE",X"DF",X"1F",X"BF",X"06",X"20",X"20",X"20",X"00",X"00",X"00",X"00",
+ X"0E",X"17",X"1F",X"1E",X"1F",X"0F",X"0F",X"07",X"07",X"05",X"03",X"03",X"03",X"03",X"03",X"03",
+ X"03",X"03",X"03",X"03",X"07",X"07",X"06",X"0E",X"0C",X"15",X"1D",X"19",X"1B",X"1B",X"1B",X"2B",
+ X"3B",X"3B",X"3B",X"19",X"1D",X"1C",X"1E",X"0E",X"0C",X"0E",X"0E",X"06",X"0E",X"0E",X"0E",X"0E",
+ X"FF",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",
+ X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7F",X"7F",X"3F",X"BF",X"BF",X"BF",X"9F",X"DF",X"DF",X"9F",X"DF",X"DF",X"DF",X"DF",X"1F",X"BF",
+ X"BF",X"BF",X"3F",X"7F",X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"F3",X"F4",X"F7",X"F7",X"F7",X"F7",X"F7",X"F7",X"F2",X"F9",X"FC",X"FE",X"FE",X"FE",X"FE",X"FE",
+ X"FC",X"FD",X"FD",X"FD",X"F9",X"FA",X"FB",X"FB",X"73",X"F4",X"E7",X"EF",X"CF",X"DF",X"9B",X"8D",
+ X"BF",X"BF",X"BF",X"BF",X"BF",X"BF",X"BE",X"AF",X"9F",X"DF",X"DF",X"CB",X"ED",X"EF",X"EF",X"E7",
+ X"F0",X"F0",X"F0",X"F0",X"C0",X"F0",X"F0",X"70",X"F0",X"F8",X"F8",X"E8",X"D8",X"FC",X"FC",X"7C",
+ X"B4",X"F8",X"F8",X"F8",X"F8",X"F8",X"E8",X"F0",X"F0",X"F0",X"E0",X"E0",X"C0",X"C0",X"C0",X"80",
+ X"80",X"80",X"80",X"80",X"80",X"40",X"C0",X"C0",X"C0",X"C0",X"C0",X"A0",X"E0",X"E0",X"E0",X"F0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"F0",X"F0",X"F8",X"FC",X"FC",X"FE",X"FE",X"FF",X"FF",X"FF",X"FD",X"F9",X"79",X"1D",X"3D",X"2F",
+ X"DF",X"9E",X"DC",X"DC",X"DC",X"DC",X"1E",X"BE",X"FF",X"3F",X"3F",X"43",X"80",X"80",X"00",X"00",
+ X"FC",X"FC",X"FC",X"FC",X"FE",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"3D",X"1C",X"0C",X"06",X"06",X"06",X"0E",X"1A",X"BF",X"BE",X"3C",X"7C",X"7C",X"7C",X"7E",X"FE",
+ X"FF",X"3F",X"3F",X"43",X"81",X"80",X"00",X"00",X"FC",X"FC",X"FC",X"FC",X"FE",X"FF",X"FF",X"FF",
+ X"F0",X"90",X"D0",X"F0",X"10",X"F0",X"F0",X"F0",X"07",X"03",X"01",X"00",X"00",X"40",X"C1",X"C5",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FE",X"FE",X"70",X"38",X"70",X"FE",X"FE",
+ X"00",X"FE",X"FE",X"10",X"10",X"10",X"FE",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"F8",X"E0",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FC",
+ X"F0",X"F0",X"60",X"60",X"C0",X"80",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"6F",X"3F",X"1F",X"17",X"1F",X"3F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FE",X"F0",X"C0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"1F",X"03",X"00",X"80",X"C0",X"E0",X"00",X"00",X"00",X"00",X"80",X"C0",X"60",X"F0",
+ X"FE",X"FF",X"FF",X"FF",X"7D",X"3F",X"3F",X"FF",X"0F",X"00",X"00",X"01",X"E1",X"03",X"C6",X"EC",
+ X"F0",X"F0",X"E0",X"E0",X"C0",X"80",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FE",X"E7",X"E7",X"E3",X"E0",X"F0",X"F8",X"FC",X"FE",X"FF",X"FF",X"87",X"0F",
+ X"1F",X"3F",X"03",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"E0",X"FF",X"FF",X"7F",X"3F",X"1F",
+ X"1F",X"74",X"F0",X"C1",X"E1",X"C3",X"8F",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"F3",X"F1",X"E1",X"DF",X"FF",X"FF",X"FF",X"7F",X"FF",X"BF",X"FF",X"FF",X"FF",X"CF",X"83",X"80",
+ X"00",X"40",X"60",X"F0",X"FC",X"FE",X"FC",X"FE",X"3F",X"03",X"01",X"A0",X"F8",X"38",X"58",X"DC",
+ X"DE",X"CF",X"87",X"07",X"1F",X"FF",X"FF",X"FF",X"0F",X"0F",X"0F",X"1F",X"1F",X"1F",X"3F",X"3F",
+ X"7F",X"1F",X"0F",X"07",X"03",X"03",X"01",X"00",X"00",X"00",X"01",X"01",X"01",X"03",X"03",X"07",
+ X"0C",X"08",X"08",X"1E",X"1F",X"1F",X"30",X"21",X"00",X"FE",X"FE",X"92",X"92",X"92",X"82",X"80",
+ X"00",X"FE",X"FE",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"82",X"FE",X"FE",X"82",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"3F",X"FC",X"E0",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"FF",X"FF",X"FF",X"FF",X"E7",X"42",X"00",
+ X"FF",X"FF",X"F8",X"00",X"00",X"00",X"00",X"00",X"FE",X"E0",X"00",X"00",X"00",X"00",X"01",X"07",
+ X"F3",X"38",X"C0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"07",X"7F",X"FF",X"FF",
+ X"04",X"03",X"FB",X"FF",X"FF",X"FB",X"FC",X"E0",X"FF",X"FF",X"FF",X"FF",X"F8",X"E0",X"20",X"20",
+ X"80",X"00",X"00",X"03",X"07",X"0F",X"1F",X"1F",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"3F",X"FF",X"FE",X"FC",X"E0",X"80",X"01",X"03",X"0F",X"1F",X"FF",X"FF",X"FF",X"FE",X"F8",X"F8",
+ X"FC",X"E0",X"E0",X"80",X"80",X"00",X"00",X"00",X"F8",X"C8",X"08",X"0B",X"37",X"F7",X"F7",X"F7",
+ X"00",X"00",X"3F",X"FF",X"FF",X"F2",X"C0",X"00",X"3F",X"FE",X"FC",X"C0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"7F",X"FF",
+ X"E0",X"00",X"00",X"00",X"1F",X"FF",X"FF",X"FF",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"07",X"3F",X"FC",X"E0",X"00",X"00",X"01",X"0F",X"7F",
+ X"FF",X"FF",X"F8",X"C0",X"00",X"00",X"00",X"00",X"00",X"01",X"0F",X"3F",X"F8",X"E0",X"80",X"00",
+ X"03",X"0F",X"3F",X"FF",X"FE",X"F8",X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"03",X"0F",X"3E",
+ X"F8",X"E0",X"80",X"00",X"03",X"0F",X"3F",X"FF",X"FE",X"F8",X"E0",X"80",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"0F",X"3E",X"F8",X"E0",X"80",X"00",X"0E",X"1F",X"3F",X"1F",X"3F",X"7F",X"6F",X"1F",
+ X"00",X"03",X"1F",X"FE",X"F0",X"80",X"00",X"00",X"07",X"3F",X"FF",X"FF",X"FC",X"E0",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"07",X"7F",X"FC",X"C0",X"00",X"00",X"01",X"1F",X"FF",X"FF",X"FF",X"F0",
+ X"00",X"03",X"0F",X"7E",X"F8",X"C0",X"00",X"00",X"07",X"7F",X"FF",X"FF",X"FC",X"C0",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"03",X"1F",X"FE",X"F0",X"80",X"00",X"00",X"07",X"3F",X"FF",X"FF",X"FC",
+ X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"7F",
+ X"C0",X"00",X"00",X"00",X"1F",X"FF",X"FF",X"FF",X"70",X"38",X"B8",X"DC",X"FC",X"F8",X"FC",X"FC",
+ X"00",X"01",X"1F",X"FF",X"F0",X"00",X"00",X"00",X"07",X"7F",X"FF",X"FF",X"FC",X"C0",X"00",X"00",
+ X"00",X"00",X"00",X"01",X"7F",X"FF",X"C0",X"00",X"00",X"00",X"1F",X"FF",X"FF",X"FF",X"F0",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"1F",X"FF",X"F0",X"00",X"00",X"00",X"07",X"FF",X"FF",X"FF",X"FC",
+ X"FF",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"3F",X"FC",X"E0",X"00",X"00",X"00",X"00",X"00",
+ X"F8",X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"3F",X"FF",X"E0",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"0F",X"1E",X"38",X"70",X"E0",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"07",X"0E",X"0C",X"1C",X"18",X"18",X"18",
+ X"18",X"18",X"18",X"18",X"18",X"1C",X"1F",X"0F",X"00",X"00",X"00",X"00",X"03",X"0F",X"3F",X"FF",
+ X"FE",X"78",X"60",X"00",X"00",X"00",X"00",X"00",X"80",X"E0",X"FC",X"3E",X"07",X"03",X"01",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"C0",X"E0",X"60",X"70",X"70",X"30",X"38",X"18",X"18",
+ X"1C",X"0C",X"0C",X"0C",X"0C",X"0C",X"0C",X"0C",X"00",X"00",X"00",X"00",X"00",X"00",X"07",X"FF",
+ X"FC",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"3F",X"3F",X"3D",X"18",X"01",X"0F",X"06",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"FE",X"FF",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"10",X"FF",X"1F",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"80",X"F8",X"FF",X"0F",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"C0",X"F8",X"7F",X"0F",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"E0",X"F8",X"3E",
+ X"C0",X"E0",X"70",X"38",X"1C",X"0E",X"07",X"1E",X"C0",X"E0",X"70",X"38",X"1C",X"0E",X"FF",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"F0",X"7C",X"1F",X"07",X"00",X"00",X"00",X"00",
+ X"00",X"80",X"FF",X"FF",X"00",X"00",X"00",X"00",X"07",X"00",X"03",X"0F",X"7E",X"F8",X"C0",X"00",
+ X"0F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"E0",X"F8",X"3E",X"0F",X"03",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"80",X"E0",X"F0",X"3C",X"1E",X"07",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"80",X"C0",X"F0",X"78",X"1E",X"0F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",
+ X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"E0",X"70",X"38",X"1C",X"0E",X"07",X"03",
+ X"F4",X"70",X"40",X"E0",X"A0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",
+ X"3E",X"FF",X"FF",X"FC",X"E0",X"00",X"00",X"00",X"00",X"01",X"0F",X"FF",X"FF",X"FF",X"F8",X"80",
+ X"00",X"00",X"00",X"00",X"1F",X"FF",X"FF",X"FF",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"07",X"FF",X"FF",X"FF",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"1F",
+ X"00",X"00",X"01",X"03",X"07",X"0F",X"1F",X"3E",X"7C",X"38",X"10",X"00",X"00",X"00",X"00",X"00",
+ X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"07",X"3F",X"FC",
+ X"3F",X"1F",X"00",X"60",X"E0",X"C0",X"80",X"00",X"E0",X"F8",X"E0",X"80",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"03",X"3F",X"FE",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"3F",X"FE",X"E0",
+ X"00",X"20",X"9C",X"83",X"A0",X"F8",X"FF",X"E1",X"80",X"FE",X"FF",X"FF",X"FF",X"00",X"00",X"00",
+ X"00",X"00",X"E0",X"E0",X"E0",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"3E",
+ X"00",X"00",X"00",X"C1",X"33",X"03",X"01",X"20",X"0F",X"7F",X"F8",X"80",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"3F",X"FE",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"3F",X"FE",X"E0",X"00",X"00",X"00",X"00",X"00",X"E0",X"E0",X"F0",X"F0",X"F8",X"F8",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"0F",X"7F",X"FF",X"FF",X"F8",X"C0",X"00",X"00",
+ X"40",X"00",X"00",X"01",X"01",X"00",X"00",X"00",X"FE",X"E0",X"07",X"3F",X"FF",X"FF",X"FC",X"E0",
+ X"03",X"3F",X"FE",X"E0",X"03",X"1F",X"FF",X"FF",X"FE",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"03",X"3F",X"FE",X"E0",X"01",X"0F",X"FF",X"FF",X"FF",X"F8",X"80",X"00",X"00",X"00",
+ X"70",X"70",X"FC",X"FC",X"FF",X"7F",X"7F",X"07",X"00",X"07",X"7F",X"FF",X"FF",X"FC",X"C0",X"00",
+ X"00",X"00",X"00",X"03",X"FF",X"FF",X"FF",X"FE",X"00",X"00",X"00",X"00",X"00",X"01",X"0F",X"7F",
+ X"78",X"78",X"78",X"7B",X"33",X"A7",X"AF",X"FC",X"00",X"00",X"00",X"07",X"3F",X"FF",X"FF",X"FC",
+ X"FF",X"FE",X"30",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"07",X"3F",X"FF",X"7F",X"7C",
+ X"20",X"F0",X"F0",X"F8",X"F8",X"E0",X"80",X"00",X"00",X"00",X"80",X"80",X"00",X"00",X"00",X"00",
+ X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"7C",X"F8",X"F0",X"E0",X"C0",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"01",X"00",X"00",X"00",X"00",X"01",X"E3",X"83",X"87",X"C7",X"5E",X"1E",X"7C",
+ X"B0",X"D8",X"D8",X"5E",X"4E",X"6F",X"EF",X"E7",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"E0",
+ X"CF",X"FF",X"F8",X"00",X"00",X"00",X"07",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FD",X"F9",X"7B",X"31",X"10",X"00",X"00",X"00",X"F7",X"F7",X"F7",X"F7",X"F0",X"60",X"20",X"00",
+ X"E0",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"02",X"22",X"12",
+ X"39",X"7F",X"7F",X"FF",X"FE",X"FE",X"FD",X"FF",X"C0",X"80",X"1E",X"7E",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"30",X"78",X"7C",X"FC",X"41",X"E9",X"27",X"33",X"FD",X"7B",X"3B",X"7B",
+ X"FB",X"F1",X"FB",X"F3",X"FB",X"FF",X"FD",X"FD",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"07",X"FC",X"FE",X"FF",X"FF",X"FF",X"FE",X"F4",X"F8",
+ X"E9",X"1C",X"12",X"04",X"05",X"03",X"03",X"01",X"FE",X"7C",X"FF",X"79",X"33",X"C7",X"FF",X"FD",
+ X"EF",X"5F",X"1F",X"BF",X"FF",X"ED",X"C0",X"F1",X"FE",X"EF",X"DF",X"3E",X"EC",X"B0",X"7C",X"E8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"B8",X"04",X"71",X"39",X"10",X"00",X"00",X"00",
+ X"E0",X"48",X"1C",X"F7",X"F8",X"6E",X"00",X"00",X"C0",X"00",X"60",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"07",X"3F",X"FF",X"FF",X"FC",X"E0",X"00",X"39",X"FF",X"FF",X"E0",X"00",X"00",X"00",
+ X"FF",X"FF",X"FC",X"F0",X"80",X"00",X"00",X"00",X"01",X"01",X"03",X"1F",X"7F",X"FF",X"FF",X"FF",
+ X"80",X"00",X"01",X"07",X"3F",X"FF",X"FF",X"FC",X"43",X"DF",X"BF",X"BF",X"BC",X"80",X"C0",X"41",
+ X"00",X"00",X"00",X"00",X"11",X"1F",X"1F",X"7F",X"F8",X"E0",X"C0",X"00",X"01",X"0F",X"7F",X"FF",
+ X"FF",X"F8",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"7F",X"FF",X"FF",X"C0",X"00",
+ X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"FE",X"FE",X"22",X"62",X"F2",X"DE",X"9C",X"00",X"70",X"F8",X"A8",X"A8",X"B8",X"B0",X"00",
+ X"08",X"7C",X"FC",X"88",X"C8",X"40",X"00",X"F6",X"F6",X"00",X"00",X"F8",X"F8",X"20",X"38",X"18",
+ X"00",X"70",X"F8",X"A8",X"A8",X"B8",X"B0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"7F",X"FF",X"C0",
+ X"00",X"00",X"01",X"1F",X"FF",X"F0",X"00",X"00",X"0F",X"3E",X"F8",X"E0",X"00",X"00",X"00",X"00",
+ X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"00",X"00",X"00",X"03",X"0F",X"3E",X"F8",X"E0",X"0F",X"3E",X"F8",X"E0",X"80",X"00",X"00",X"00",
+ X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"3F",X"07",X"3F",X"FC",X"E0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"3F",X"3F",X"00",X"00",X"00",X"00",X"03",X"3F",X"FF",X"FF",
+ X"0F",X"1F",X"3E",X"FC",X"F8",X"F0",X"E0",X"80",X"E0",X"C0",X"C0",X"40",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"03",X"0F",X"07",X"03",X"07",X"08",X"38",X"F8",X"F0",X"F0",X"F0",X"E0",X"E0",
+ X"FE",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"0F",X"1F",X"3E",X"FC",X"F8",X"F0",X"FF",X"FF",
+ X"E0",X"C0",X"C0",X"42",X"03",X"03",X"FF",X"FF",X"00",X"00",X"00",X"00",X"80",X"E0",X"F8",X"FE",
+ X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"03",X"03",X"02",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"FF",X"FF",X"FF",X"F8",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",
+ X"7F",X"7F",X"7F",X"3F",X"3F",X"3F",X"3F",X"1F",X"1F",X"1F",X"1F",X"0F",X"0F",X"0F",X"0F",X"07",
+ X"F0",X"F0",X"F0",X"F0",X"F8",X"F8",X"F8",X"F8",X"FC",X"FC",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FC",X"F9",X"F3",X"67",X"6F",X"7F",X"3F",X"3E",X"10",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"04",X"04",X"07",X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",X"FE",X"FE",
+ X"FF",X"FF",X"FC",X"80",X"00",X"00",X"00",X"00",X"3C",X"FC",X"FF",X"FF",X"FF",X"FF",X"07",X"03",
+ X"00",X"C2",X"E7",X"FF",X"FF",X"FF",X"FF",X"FF",X"40",X"70",X"F9",X"FF",X"FF",X"FF",X"CF",X"03",
+ X"40",X"70",X"F1",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",
+ X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"01",X"01",X"03",X"1F",X"3F",X"3F",X"3F",X"3F",
+ X"03",X"9F",X"FF",X"FF",X"FC",X"C0",X"C0",X"C1",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"1F",
+ X"CF",X"FF",X"FF",X"FF",X"F8",X"E0",X"E0",X"E0",X"1F",X"1F",X"1F",X"0F",X"0F",X"0F",X"0F",X"07",
+ X"F0",X"F0",X"F0",X"F0",X"F8",X"F8",X"F8",X"F8",X"07",X"07",X"07",X"03",X"03",X"03",X"03",X"01",
+ X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",X"FE",X"FE",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",
+ X"7F",X"7F",X"7F",X"3F",X"3F",X"3F",X"3F",X"1F",X"C0",X"C0",X"C0",X"C0",X"E0",X"E0",X"E0",X"E0",
+ X"1F",X"1F",X"1F",X"0F",X"0F",X"0F",X"0F",X"07",X"F0",X"F0",X"F0",X"F0",X"F8",X"F8",X"F8",X"F8",
+ X"07",X"07",X"07",X"03",X"03",X"03",X"03",X"01",X"80",X"00",X"00",X"00",X"00",X"3F",X"FF",X"FF",
+ X"C1",X"E7",X"FF",X"FF",X"FF",X"FE",X"F0",X"00",X"00",X"00",X"01",X"7F",X"FF",X"FF",X"FF",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"3F",X"FF",X"FF",X"FF",X"FF",X"80",X"00",X"00",X"00",
+ X"00",X"0F",X"FF",X"FF",X"FF",X"F8",X"00",X"00",X"00",X"00",X"01",X"0F",X"0F",X"7F",X"7F",X"FF",
+ X"FE",X"FC",X"F8",X"00",X"00",X"00",X"03",X"1F",X"FF",X"FF",X"FE",X"F0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"0F",X"8F",X"FF",X"FF",X"FF",X"FE",X"F0",X"00",
+ X"00",X"00",X"01",X"07",X"3F",X"FF",X"FF",X"FC",X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"08",X"08",X"9F",X"FF",X"FF",X"FF",X"FF",X"80",X"00",X"00",X"01",
+ X"0F",X"3F",X"FF",X"FF",X"F8",X"E0",X"00",X"00",X"00",X"01",X"01",X"03",X"0F",X"3F",X"FF",X"FF",
+ X"FE",X"FC",X"F8",X"00",X"03",X"0F",X"7F",X"FF",X"FE",X"F8",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"0D",X"3F",X"FF",X"FF",X"FE",X"F0",X"80",X"00",X"03",X"1F",X"7F",X"FF",X"FE",X"F0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"13",X"3F",X"FF",X"FF",X"FE",X"F8",X"E0",X"80",X"00",X"07",X"1F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"55",X"FF",X"55",X"FF",X"55",X"FF",X"FF",
+ X"FF",X"55",X"FF",X"55",X"FF",X"55",X"FF",X"FF",X"FC",X"4E",X"FF",X"4B",X"FF",X"4F",X"FF",X"FF",
+ X"00",X"00",X"00",X"80",X"F8",X"80",X"80",X"00",X"FF",X"FD",X"FF",X"55",X"FF",X"55",X"FF",X"FF",
+ X"FF",X"FD",X"FF",X"F5",X"FF",X"F5",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"00",X"00",X"00",X"E0",X"F8",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"B9",X"FF",X"B9",X"FF",X"B9",X"FF",X"B9",X"B9",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"38",X"7C",X"FC",X"FC",X"7C",X"7C",X"38",X"FF",X"FF",X"FF",X"7F",X"7F",X"00",X"68",X"04",
+ X"FE",X"FF",X"FE",X"FF",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FE",X"FD",X"F8",X"F5",X"FF",X"55",
+ X"78",X"DB",X"00",X"5B",X"00",X"5B",X"00",X"00",X"20",X"40",X"2E",X"40",X"2E",X"40",X"3E",X"9F",
+ X"00",X"00",X"00",X"00",X"00",X"60",X"C0",X"80",X"6B",X"07",X"7F",X"7C",X"F8",X"80",X"80",X"00",
+ X"E0",X"E0",X"E0",X"00",X"00",X"00",X"00",X"00",X"FF",X"4D",X"FC",X"4A",X"FE",X"4C",X"FC",X"4A",
+ X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"FE",X"4C",X"FC",X"4A",X"FE",X"4C",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"4D",X"FC",X"4A",X"FE",X"4C",X"FF",X"FF",
+ X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"00",X"FF",X"FF",X"55",X"FF",X"FF",X"55",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"24",X"FF",X"24",X"FF",X"24",X"FF",X"FF",
+ X"FF",X"92",X"FF",X"92",X"FF",X"92",X"FF",X"FF",X"FF",X"FF",X"FF",X"F6",X"BE",X"BF",X"FB",X"FF",
+ X"FE",X"FE",X"DE",X"F6",X"FE",X"DC",X"00",X"00",X"00",X"00",X"00",X"F6",X"BE",X"EA",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"FA",X"BE",X"F6",X"00",X"00",X"00",X"00",X"00",X"00",X"78",X"00",
+ X"F8",X"F8",X"E0",X"E0",X"E0",X"E0",X"E0",X"F8",X"00",X"FE",X"F6",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"FE",X"FE",X"00",X"00",X"00",X"00",X"00",X"D6",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"20",X"70",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"4F",X"FF",X"4B",X"FF",X"4F",X"FF",X"FF",
+ X"FC",X"4C",X"FC",X"48",X"FE",X"4C",X"FF",X"FF",X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",
+ X"FE",X"FC",X"F0",X"F0",X"E0",X"E0",X"C0",X"FF",X"FF",X"4D",X"FC",X"4A",X"FE",X"4C",X"FC",X"48",
+ X"B8",X"78",X"37",X"F0",X"00",X"00",X"00",X"00",X"FE",X"4C",X"FC",X"4A",X"FE",X"4C",X"FF",X"FF",
+ X"FF",X"FC",X"FF",X"24",X"FF",X"24",X"FF",X"FF",X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FC",X"FF",X"F4",X"FF",X"E4",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"60",X"C0",X"80",
+ X"FF",X"FF",X"FF",X"55",X"FF",X"55",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FB",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FB",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"0F",X"F1",X"FF",X"82",X"7C",X"B9",X"D7",X"FF",X"FF",X"01",X"FF",X"FE",X"45",X"B9",X"D7",
+ X"55",X"FF",X"FF",X"01",X"FE",X"45",X"B9",X"D7",X"00",X"00",X"F0",X"0F",X"F2",X"7D",X"2A",X"D7",
+ X"00",X"00",X"00",X"F0",X"38",X"FF",X"B8",X"F8",X"00",X"00",X"00",X"00",X"00",X"FF",X"00",X"00",
+ X"FF",X"FF",X"03",X"05",X"0E",X"0F",X"00",X"00",X"2D",X"D5",X"BB",X"01",X"FF",X"F0",X"00",X"00",
+ X"29",X"D5",X"BB",X"01",X"FF",X"00",X"00",X"00",X"29",X"D5",X"BB",X"01",X"FF",X"00",X"00",X"00",
+ X"2A",X"D7",X"82",X"7F",X"F0",X"00",X"00",X"00",X"03",X"B7",X"03",X"B5",X"03",X"B7",X"03",X"FF",
+ X"FE",X"FF",X"00",X"DB",X"00",X"DB",X"00",X"FF",X"00",X"B6",X"03",X"B5",X"03",X"B7",X"03",X"FF",
+ X"FF",X"4F",X"FF",X"49",X"FF",X"4F",X"FF",X"49",X"FF",X"92",X"FF",X"92",X"FF",X"92",X"FF",X"FF",
+ X"FC",X"4C",X"FC",X"4A",X"FC",X"4C",X"FF",X"FF",X"FF",X"4F",X"FF",X"4B",X"FF",X"4F",X"FF",X"FF",
+ X"FE",X"FF",X"F0",X"FB",X"E0",X"EB",X"C0",X"FF",X"00",X"6D",X"00",X"6D",X"00",X"6D",X"00",X"FF",
+ X"FF",X"FF",X"00",X"AA",X"00",X"AA",X"00",X"FF",X"FF",X"FC",X"FF",X"F4",X"FF",X"E4",X"FF",X"FF",
+ X"FF",X"24",X"FF",X"24",X"FF",X"24",X"FF",X"FF",X"00",X"00",X"80",X"F0",X"FF",X"F0",X"80",X"00",
+ X"00",X"00",X"00",X"10",X"1F",X"F0",X"80",X"00",X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"DB",X"00",X"DB",X"00",X"DB",X"00",X"FF",X"FF",X"FC",X"FF",X"24",X"FF",X"24",X"FF",X"FF",
+ X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"55",X"FF",X"FF",X"55",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"04",X"06",X"07",X"17",X"07",X"07",X"FE",X"FC",X"00",X"00",X"8F",X"FF",X"FF",X"FF",
+ X"00",X"00",X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"04",X"8F",X"FF",X"FF",X"FD",X"FD",X"FF",
+ X"07",X"FF",X"FF",X"E1",X"80",X"20",X"48",X"F0",X"E0",X"F8",X"F0",X"B8",X"10",X"00",X"00",X"00",
+ X"07",X"47",X"D7",X"DC",X"7C",X"78",X"60",X"40",X"FF",X"FF",X"FF",X"7F",X"0F",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FB",X"03",X"01",X"00",X"FF",X"FF",X"F9",X"F1",X"E1",X"E0",X"F0",X"58",
+ X"E0",X"F0",X"C8",X"40",X"20",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0F",X"09",X"04",X"05",X"05",X"05",X"05",X"01",
+ X"00",X"80",X"83",X"01",X"04",X"04",X"48",X"48",X"00",X"1C",X"62",X"81",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"20",X"C0",X"80",X"40",X"50",X"00",X"C0",X"C0",X"00",X"C0",X"C5",X"05",X"C5",
+ X"48",X"44",X"44",X"44",X"08",X"18",X"40",X"40",X"00",X"00",X"E0",X"40",X"E0",X"00",X"C0",X"60",
+ X"30",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"00",X"E0",X"80",X"00",X"E0",X"80",X"00",
+ X"00",X"00",X"00",X"00",X"81",X"62",X"1C",X"00",X"00",X"00",X"03",X"07",X"07",X"0E",X"0C",X"0C",
+ X"00",X"E0",X"F8",X"FE",X"0F",X"07",X"03",X"03",X"0E",X"0E",X"0E",X"CE",X"C8",X"08",X"C8",X"CE",
+ X"01",X"02",X"03",X"03",X"01",X"01",X"01",X"00",X"08",X"C8",X"C8",X"0C",X"CC",X"C4",X"08",X"0C",
+ X"01",X"01",X"01",X"03",X"03",X"02",X"01",X"03",X"00",X"00",X"C0",X"20",X"00",X"C0",X"A0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"0E",X"07",X"07",X"03",X"00",X"00",X"00",
+ X"03",X"07",X"0F",X"FE",X"F9",X"E0",X"19",X"F8",X"00",X"40",X"A0",X"00",X"E0",X"00",X"E0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C1",X"01",X"C3",X"03",X"06",X"07",X"0C",X"0F",
+ X"91",X"F0",X"20",X"E1",X"40",X"C0",X"80",X"80",X"E0",X"00",X"C0",X"20",X"C0",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"00",X"B0",X"00",X"00",X"00",X"00",X"18",
+ X"00",X"01",X"03",X"07",X"0C",X"1B",X"10",X"00",X"07",X"FB",X"FC",X"0F",X"FD",X"FD",X"78",X"00",
+ X"00",X"00",X"D0",X"94",X"DC",X"EC",X"78",X"3C",X"01",X"18",X"1C",X"0C",X"0E",X"0E",X"0F",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"07",X"0C",X"0F",X"0F",X"6F",X"07",X"07",X"6F",
+ X"18",X"00",X"9C",X"0E",X"6F",X"1F",X"0F",X"0F",X"0F",X"6F",X"6F",X"0F",X"6F",X"6F",X"0F",X"6F",
+ X"1F",X"5F",X"0F",X"AF",X"0F",X"0F",X"0F",X"0F",X"00",X"60",X"90",X"10",X"90",X"60",X"00",X"00",
+ X"0F",X"0F",X"9F",X"0E",X"0C",X"98",X"00",X"18",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"0F",X"0E",X"0E",X"0C",X"1C",X"19",X"01",X"30",X"F0",X"20",X"20",X"C0",X"C0",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"08",X"08",X"04",X"04",X"04",X"08",X"00",
+ X"00",X"00",X"01",X"01",X"05",X"08",X"0D",X"4F",X"40",X"80",X"80",X"C0",X"00",X"00",X"00",X"F0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0E",X"0A",X"40",X"0E",X"00",X"0E",X"4C",
+ X"FC",X"FF",X"FF",X"FF",X"FA",X"F7",X"F6",X"FB",X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"10",X"04",X"00",X"00",X"00",X"00",X"00",X"00",X"0E",X"0A",X"00",X"0E",X"0C",X"00",X"07",
+ X"FF",X"FF",X"FE",X"FE",X"FC",X"F0",X"E0",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"EE",X"CC",X"04",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"FF",X"FF",X"00",X"00",X"00",X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"3F",X"0F",X"03",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"C0",X"70",X"1C",X"FF",X"FF",X"FF",X"FF",X"FF",X"01",X"00",X"C0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"1C",X"07",X"01",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"C0",X"F0",X"FC",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"7F",
+ X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"3F",X"E0",X"E0",X"E0",X"F0",X"F0",X"F0",X"F0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F0",X"F0",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",
+ X"FF",X"FF",X"CF",X"83",X"83",X"83",X"83",X"83",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"0F",X"0F",
+ X"EC",X"FC",X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",X"E3",X"E3",X"E3",X"E3",X"E3",X"E3",X"E3",X"E3",
+ X"0F",X"0F",X"0F",X"0F",X"07",X"07",X"07",X"07",X"FE",X"FE",X"FE",X"FE",X"FF",X"FF",X"9F",X"07",
+ X"FB",X"CF",X"83",X"83",X"83",X"83",X"83",X"E7",X"07",X"07",X"03",X"03",X"03",X"03",X"03",X"03",
+ X"00",X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"07",X"07",X"07",X"07",X"C7",X"C7",X"C7",X"C7",
+ X"01",X"01",X"01",X"FF",X"FF",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"80",X"E0",X"F0",X"F0",X"7E",X"7E",X"7E",X"7E",X"7E",X"7E",X"7E",X"7E",
+ X"70",X"70",X"70",X"F0",X"F0",X"70",X"70",X"70",X"7E",X"1E",X"06",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"F0",X"F0",X"70",X"10",X"00",X"00",X"00",X"C0",X"C0",X"C0",X"FF",X"FF",X"C0",X"C0",X"C0",
+ X"C7",X"C7",X"C7",X"C7",X"F7",X"9F",X"07",X"07",X"07",X"07",X"07",X"CF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"3F",X"0F",X"03",X"00",X"00",X"00",X"00",X"FF",X"00",X"00",X"C0",X"C0",X"F0",X"FF",X"00",
+ X"FF",X"30",X"FC",X"3F",X"00",X"3F",X"C0",X"00",X"FF",X"00",X"0F",X"F0",X"30",X"1C",X"07",X"00",
+ X"FF",X"0C",X"07",X"01",X"00",X"00",X"00",X"00",X"FF",X"F0",X"FC",X"FF",X"00",X"00",X"00",X"00",
+ X"FF",X"03",X"00",X"FF",X"00",X"00",X"00",X"00",X"FF",X"38",X"0E",X"03",X"00",X"00",X"00",X"00",
+ X"FF",X"0C",X"07",X"01",X"00",X"C0",X"F0",X"FC",X"FF",X"C0",X"F0",X"FC",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F3",X"E0",X"E0",X"E0",X"E0",X"E0",X"F8",X"F8",
+ X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"FE",X"F3",X"E0",X"E0",X"E0",X"E0",X"E0",X"F9",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"80",X"60",X"00",X"C1",X"FF",X"00",X"00",X"00",X"07",X"10",X"1C",X"1F",X"1F",
+ X"00",X"40",X"40",X"40",X"60",X"60",X"60",X"70",X"70",X"70",X"78",X"78",X"78",X"7C",X"7C",X"7C",
+ X"7E",X"7E",X"7E",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"C0",X"C0",X"C0",X"E0",X"E0",X"E0",X"F0",
+ X"F0",X"F0",X"F8",X"F8",X"F8",X"FC",X"FC",X"FC",X"FE",X"FE",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"01",X"01",X"03",X"03",X"03",X"03",X"03",X"03",X"07",X"07",X"07",X"07",X"07",X"07",X"0F",X"0F",
+ X"0F",X"0F",X"0F",X"0F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",
+ X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"1F",X"1F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FE",
+ X"07",X"07",X"07",X"07",X"07",X"07",X"03",X"01",X"FE",X"FE",X"7E",X"7C",X"3C",X"1C",X"1C",X"08",
+ X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"70",X"70",X"70",X"30",X"30",X"F0",X"F0",X"F0",
+ X"7E",X"1E",X"06",X"00",X"00",X"FF",X"FF",X"FF",X"F0",X"F0",X"F0",X"F0",X"F0",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"10",X"40",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"18",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"03",X"0E",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0E",X"1C",X"10",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"10",X"70",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"03",X"0F",X"1E",X"18",X"10",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"0E",X"1E",X"7C",
+ X"F8",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7E",X"F8",X"F0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"C0",X"C0",X"C0",X"C0",
+ X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FE",X"FC",X"F0",X"E0",X"80",X"00",X"00",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FC",X"0F",X"1F",X"7F",X"FF",X"FE",X"F8",X"F0",X"C0",
+ X"00",X"00",X"00",X"01",X"03",X"07",X"07",X"07",X"07",X"06",X"04",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"08",X"10",X"40",X"80",X"00",X"00",
+ X"02",X"0E",X"1C",X"30",X"20",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"60",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1E",X"38",X"30",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0C",X"1C",X"7C",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",
+ X"03",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"02",X"0E",X"1E",X"7E",X"FE",X"FC",X"F0",X"E0",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"7F",X"7E",X"7C",X"70",X"60",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"18",X"20",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"02",X"0E",X"18",X"10",X"00",X"02",X"0E",X"1C",X"70",X"60",X"00",X"00",X"00",
+ X"40",X"C0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1E",X"78",X"F0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"10",X"70",X"F0",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"1E",X"1C",X"10",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"10",
+ X"F0",X"F0",X"F0",X"F0",X"E0",X"80",X"00",X"00",X"FF",X"FE",X"FC",X"F0",X"E0",X"80",X"00",X"00",
+ X"01",X"03",X"07",X"07",X"07",X"07",X"07",X"04",X"00",X"02",X"08",X"10",X"00",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"08",X"00",X"0C",X"1C",X"70",X"E0",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",
+ X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",
+ X"C0",X"C0",X"C0",X"00",X"00",X"00",X"00",X"00",X"1F",X"7E",X"7C",X"70",X"60",X"00",X"00",X"00",
+ X"00",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"00",X"02",X"00",X"10",X"00",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"0C",X"18",X"30",X"00",X"00",X"08",X"18",X"70",X"E0",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"0C",X"1C",X"7C",X"FC",X"00",X"00",X"00",X"08",X"18",X"78",X"F8",X"F8",
+ X"0F",X"0F",X"0F",X"0F",X"0E",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"00",
+ X"10",X"60",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"0E",X"1E",X"78",X"F0",X"C0",
+ X"0F",X"0E",X"0C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"1C",X"7C",X"F8",X"F0",X"C0",
+ X"00",X"00",X"01",X"03",X"0F",X"1F",X"1F",X"1C",X"18",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"02",X"00",X"10",X"20",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"08",X"18",X"70",X"40",X"00",X"00",X"10",X"70",X"E0",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"00",X"00",X"00",X"00",X"08",X"18",X"78",X"F0",X"C0",
+ X"0F",X"1E",X"1C",X"10",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"10",X"70",X"F0",X"F0",X"C0",
+ X"08",X"18",X"78",X"F8",X"F8",X"F8",X"F0",X"C0",X"00",X"00",X"01",X"03",X"0F",X"1F",X"3F",X"3F",
+ X"00",X"00",X"04",X"10",X"20",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"18",X"70",X"40",
+ X"00",X"00",X"00",X"00",X"01",X"03",X"07",X"04",X"00",X"00",X"00",X"00",X"10",X"70",X"F0",X"C0",
+ X"0F",X"1E",X"7C",X"70",X"60",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"C0",X"C0",X"C0",
+ X"03",X"07",X"07",X"07",X"06",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",X"80",
+ X"FF",X"FF",X"10",X"08",X"08",X"04",X"04",X"04",X"04",X"04",X"04",X"08",X"08",X"10",X"20",X"C0",
+ X"00",X"00",X"00",X"10",X"70",X"F0",X"F0",X"F0",X"1F",X"7F",X"FF",X"FF",X"FE",X"F8",X"F0",X"C0",
+ X"10",X"70",X"F0",X"F0",X"F0",X"F0",X"F0",X"C0",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"10",X"70",X"F0",X"03",X"FE",X"E0",X"00",X"00",X"00",X"00",X"00",
+ X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0C",X"C0",X"F1",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"60",X"F8",X"FC",X"FC",X"FE",X"FF",X"FB",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",
+ X"3F",X"3F",X"3F",X"3F",X"3E",X"38",X"30",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"03",X"07",X"07",X"07",X"07",X"07",X"07",X"06",X"04",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"D0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"C5",X"F8",X"E0",X"C0",X"C0",X"DF",X"FF",X"FF",X"70",X"38",X"B8",X"DC",X"FC",X"F8",X"FC",X"FC",
+ X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"8F",X"FF",X"FF",X"FF",X"FD",X"FF",X"00",X"00",X"00",X"80",X"E0",X"F0",X"F8",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"E7",X"F3",X"C9",X"40",X"20",X"00",X"00",X"00",
+ X"80",X"E0",X"F8",X"70",X"38",X"10",X"00",X"00",X"00",X"1C",X"62",X"81",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"81",X"62",X"1C",X"00",X"00",X"E0",X"F8",X"FE",X"0F",X"07",X"03",X"03",
+ X"01",X"02",X"03",X"03",X"01",X"01",X"01",X"00",X"01",X"01",X"01",X"03",X"03",X"02",X"01",X"03",
+ X"03",X"07",X"0F",X"FE",X"F9",X"E0",X"19",X"F8",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"40",X"80",X"80",X"C0",X"00",X"00",X"00",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"EE",X"CC",X"04",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"1F",X"3F",X"3F",X"7F",X"7F",X"7F",X"7F",
+ X"00",X"F8",X"E4",X"F4",X"F2",X"FA",X"FA",X"FA",X"7F",X"7F",X"3F",X"0F",X"0D",X"00",X"00",X"00",
+ X"FA",X"FA",X"BA",X"3A",X"10",X"10",X"00",X"00",X"00",X"00",X"04",X"7E",X"00",X"00",X"3C",X"42",
+ X"00",X"64",X"42",X"52",X"4C",X"00",X"3C",X"42",X"00",X"2E",X"4A",X"4A",X"32",X"00",X"3C",X"42",
+ X"00",X"02",X"62",X"1A",X"06",X"00",X"3C",X"42",X"7E",X"00",X"3C",X"42",X"42",X"3C",X"00",X"3C",
+ X"42",X"3C",X"00",X"3C",X"42",X"42",X"3C",X"00",X"42",X"42",X"3C",X"00",X"3C",X"42",X"42",X"3C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"08",X"00",X"00",X"00",X"00",X"00",X"08",X"5B",X"7F",
+ X"00",X"00",X"07",X"1F",X"38",X"00",X"58",X"FC",X"00",X"00",X"00",X"80",X"C0",X"40",X"00",X"30",
+ X"18",X"18",X"30",X"B0",X"B0",X"30",X"70",X"70",X"7F",X"FF",X"FF",X"FD",X"7C",X"78",X"FA",X"F2",
+ X"F8",X"D0",X"45",X"0F",X"1F",X"1E",X"3C",X"3C",X"18",X"0C",X"C4",X"E0",X"30",X"10",X"00",X"00",
+ X"71",X"79",X"78",X"7A",X"3E",X"3E",X"2C",X"0C",X"F3",X"F3",X"E1",X"61",X"70",X"20",X"20",X"20",
+ X"18",X"39",X"33",X"13",X"01",X"21",X"60",X"E0",X"F0",X"E0",X"F8",X"F0",X"FC",X"F0",X"A0",X"00",
+ X"0C",X"0D",X"0F",X"0B",X"03",X"01",X"01",X"00",X"02",X"06",X"06",X"03",X"93",X"9B",X"9F",X"C9",
+ X"A7",X"33",X"10",X"02",X"01",X"00",X"00",X"00",X"24",X"FE",X"CC",X"00",X"C0",X"E0",X"70",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"07",X"07",X"1F",X"7F",X"F3",X"C0",X"C0",X"80",X"08",
+ X"C0",X"F0",X"F8",X"3E",X"0F",X"07",X"03",X"21",X"00",X"00",X"00",X"00",X"80",X"E0",X"F0",X"B8",
+ X"06",X"06",X"07",X"0F",X"0E",X"0E",X"0C",X"0C",X"00",X"01",X"00",X"00",X"08",X"00",X"40",X"01",
+ X"00",X"08",X"00",X"00",X"20",X"02",X"00",X"00",X"1C",X"1C",X"0E",X"46",X"06",X"07",X"03",X"03",
+ X"0E",X"0E",X"0E",X"0C",X"0C",X"0E",X"06",X"07",X"00",X"00",X"10",X"00",X"00",X"02",X"20",X"00",
+ X"08",X"00",X"40",X"00",X"00",X"12",X"00",X"00",X"87",X"0F",X"0F",X"0F",X"47",X"07",X"07",X"0E",
+ X"07",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"C7",X"EF",X"FF",X"78",X"00",X"00",
+ X"40",X"00",X"90",X"F8",X"FC",X"7E",X"1F",X"03",X"0E",X"8E",X"0E",X"1C",X"3C",X"78",X"F0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"28",X"28",X"11",X"00",X"00",X"40",X"40",X"40",X"20",X"0F",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"10",X"80",X"E0",X"03",X"07",X"07",X"0F",X"0F",X"0F",X"19",X"0C",
+ X"FF",X"FF",X"FF",X"EF",X"47",X"1F",X"BE",X"0C",X"F8",X"F8",X"FC",X"FC",X"FC",X"F4",X"29",X"78",
+ X"04",X"36",X"E9",X"E3",X"F3",X"F1",X"F8",X"F8",X"04",X"61",X"F0",X"F2",X"FB",X"F9",X"7D",X"FF",
+ X"F8",X"FC",X"9C",X"38",X"18",X"50",X"24",X"CC",X"78",X"11",X"0F",X"03",X"01",X"20",X"00",X"18",
+ X"5F",X"17",X"87",X"1F",X"FF",X"0F",X"01",X"00",X"F8",X"FC",X"FE",X"FE",X"CE",X"84",X"C0",X"70",
+ X"00",X"00",X"01",X"00",X"20",X"20",X"10",X"03",X"00",X"00",X"00",X"00",X"40",X"42",X"00",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"00",X"07",X"4F",X"1D",X"3F",X"7F",X"4F",X"6B",X"E6",
+ X"FF",X"FF",X"FF",X"CF",X"C0",X"F1",X"07",X"3F",X"00",X"40",X"70",X"60",X"70",X"7E",X"77",X"7F",
+ X"F0",X"7A",X"38",X"BC",X"BC",X"9D",X"DC",X"7E",X"83",X"C0",X"61",X"63",X"70",X"3F",X"3F",X"0F",
+ X"3F",X"4E",X"FA",X"78",X"79",X"F2",X"FE",X"F8",X"7E",X"37",X"31",X"18",X"5C",X"07",X"11",X"00",
+ X"03",X"82",X"FF",X"7D",X"30",X"18",X"C3",X"7E",X"FC",X"24",X"34",X"FC",X"1C",X"79",X"C0",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"80",X"00",X"20",X"70",X"FE",X"7F",X"1F",X"0F",X"0B",
+ X"00",X"00",X"00",X"00",X"00",X"E0",X"C0",X"E0",X"80",X"80",X"9F",X"C7",X"21",X"18",X"00",X"00",
+ X"41",X"E0",X"F8",X"FF",X"FF",X"7F",X"1F",X"07",X"D0",X"00",X"00",X"00",X"80",X"E0",X"F8",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"38",X"39",X"31",X"38",X"3E",X"3F",X"1F",
+ X"FC",X"7E",X"1B",X"20",X"28",X"04",X"80",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"47",X"41",X"00",X"00",X"01",X"01",X"08",X"08",X"70",X"F0",X"60",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"03",X"00",X"01",X"03",X"03",X"07",X"3F",X"FF",X"FF",X"FF",X"C0",X"80",X"00",X"00",
+ X"80",X"E0",X"F8",X"FC",X"7E",X"1F",X"03",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",
+ X"06",X"0E",X"7C",X"7C",X"7C",X"FC",X"F8",X"F8",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"07",X"03",X"03",X"03",X"03",X"01",X"01",X"80",X"C0",X"C0",X"C0",X"C0",X"E0",X"E0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",X"07",X"06",X"00",X"00",X"00",
+ X"01",X"01",X"61",X"F1",X"61",X"01",X"01",X"01",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",
+ X"FF",X"BF",X"9C",X"83",X"A0",X"F8",X"FF",X"E1",X"FE",X"FE",X"00",X"C1",X"33",X"03",X"01",X"20",
+ X"0F",X"EF",X"E0",X"F0",X"F0",X"F8",X"F8",X"F8",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"20",
+ X"FF",X"FF",X"00",X"00",X"01",X"00",X"20",X"10",X"FF",X"FF",X"7F",X"FF",X"FE",X"FE",X"FD",X"FF",
+ X"E7",X"83",X"1E",X"7E",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"30",X"78",X"7C",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FD",X"F9",X"7B",X"31",X"10",X"00",X"FF",X"FF",
+ X"F7",X"F7",X"F7",X"F7",X"F0",X"60",X"2F",X"8F",X"E0",X"C0",X"80",X"00",X"00",X"00",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"B8",X"04",X"71",X"39",X"10",X"00",X"C2",X"E7",
+ X"E0",X"48",X"1C",X"F7",X"F8",X"6E",X"11",X"7F",X"C0",X"00",X"60",X"00",X"00",X"00",X"FF",X"FF");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_bit2.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_bit2.vhd
new file mode 100644
index 00000000..dfca9c74
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_bit2.vhd
@@ -0,0 +1,534 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_chr_bit2 is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(12 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_chr_bit2 is
+ type rom is array(0 to 8191) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"B0",X"B8",X"A8",X"E8",X"68",X"00",X"00",X"08",X"7C",X"FC",X"88",X"C8",X"40",X"00",
+ X"00",X"00",X"F8",X"F8",X"08",X"F8",X"F0",X"00",X"60",X"F0",X"90",X"F0",X"7C",X"FC",X"00",X"00",
+ X"00",X"00",X"F8",X"F8",X"20",X"38",X"18",X"00",X"60",X"F0",X"90",X"F0",X"7C",X"FC",X"00",X"00",
+ X"00",X"08",X"7C",X"FC",X"88",X"C8",X"40",X"00",X"00",X"FC",X"FC",X"10",X"F0",X"E0",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"38",X"7C",X"C2",X"82",X"86",X"7C",X"38",X"00",X"80",X"84",X"FE",X"FE",X"80",X"80",X"00",
+ X"00",X"CC",X"E6",X"F2",X"B2",X"BA",X"9E",X"8C",X"00",X"40",X"C2",X"92",X"9A",X"9E",X"F6",X"62",
+ X"00",X"30",X"38",X"2C",X"26",X"FE",X"FE",X"20",X"00",X"4E",X"CE",X"8A",X"8A",X"FA",X"70",X"00",
+ X"00",X"78",X"FC",X"96",X"92",X"92",X"F2",X"60",X"00",X"06",X"06",X"E2",X"F2",X"1A",X"0E",X"06",
+ X"00",X"6C",X"9E",X"9A",X"B2",X"B2",X"EC",X"60",X"00",X"0C",X"9E",X"92",X"92",X"D2",X"7E",X"3C",
+ X"00",X"00",X"00",X"44",X"44",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"40",X"C0",X"80",X"80",X"80",X"FE",X"7E",X"00",X"7E",X"FE",X"80",X"80",X"80",X"FE",X"7E",
+ X"00",X"FE",X"FE",X"1C",X"38",X"1C",X"FE",X"FE",X"00",X"FE",X"FE",X"22",X"22",X"22",X"3E",X"1C",
+ X"FF",X"FF",X"F3",X"3E",X"00",X"FF",X"FF",X"00",X"FF",X"FF",X"F9",X"67",X"00",X"9F",X"FF",X"00",
+ X"3F",X"9F",X"9B",X"8E",X"00",X"DC",X"BF",X"00",X"FC",X"FE",X"CE",X"72",X"00",X"FE",X"F8",X"00",
+ X"FF",X"FF",X"F3",X"C9",X"81",X"00",X"0C",X"5C",X"1C",X"0C",X"89",X"80",X"C4",X"E1",X"E9",X"FF",
+ X"7F",X"3F",X"1F",X"57",X"23",X"03",X"81",X"85",X"A0",X"B0",X"F0",X"F8",X"78",X"EA",X"E8",X"B0",
+ X"F0",X"E1",X"41",X"03",X"03",X"07",X"8F",X"3F",X"FC",X"E0",X"C0",X"80",X"84",X"4F",X"0F",X"0F",
+ X"07",X"03",X"0B",X"8F",X"8F",X"45",X"05",X"05",X"81",X"A0",X"80",X"C0",X"E0",X"E4",X"F8",X"FE",
+ X"E7",X"C3",X"81",X"29",X"39",X"7C",X"7C",X"5E",X"F6",X"F6",X"FE",X"FE",X"FE",X"FE",X"FA",X"FE",
+ X"FF",X"FF",X"FF",X"FF",X"FD",X"FD",X"FF",X"FF",X"FF",X"FB",X"F9",X"FD",X"FF",X"FF",X"FF",X"FF",
+ X"03",X"C4",X"C7",X"BF",X"19",X"30",X"00",X"00",X"FF",X"FF",X"FF",X"FC",X"FC",X"FC",X"FE",X"FE",
+ X"FF",X"FF",X"CF",X"BF",X"19",X"30",X"00",X"00",X"3F",X"1F",X"1F",X"1C",X"3C",X"7C",X"FE",X"FE",
+ X"3F",X"7F",X"19",X"30",X"00",X"00",X"21",X"3F",X"FC",X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",X"FE",
+ X"3F",X"7F",X"19",X"30",X"00",X"80",X"E1",X"FF",X"FC",X"FC",X"FC",X"FC",X"FE",X"FF",X"FF",X"FF",
+ X"CC",X"C4",X"84",X"C4",X"C2",X"C3",X"03",X"87",X"21",X"1F",X"1B",X"0E",X"00",X"DC",X"BF",X"00",
+ X"0E",X"17",X"1F",X"1E",X"1F",X"0F",X"0F",X"07",X"07",X"05",X"03",X"03",X"03",X"03",X"03",X"03",
+ X"03",X"03",X"03",X"03",X"07",X"07",X"06",X"0E",X"0C",X"14",X"1C",X"18",X"18",X"18",X"18",X"28",
+ X"38",X"38",X"38",X"18",X"1C",X"1C",X"1E",X"0E",X"0C",X"0E",X"0E",X"06",X"0E",X"0E",X"0E",X"0E",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"1F",X"17",X"03",X"83",X"83",X"87",X"87",X"CF",X"CF",X"87",X"C7",X"C7",X"C3",X"C3",X"03",X"87",
+ X"87",X"8F",X"0F",X"0F",X"1F",X"1F",X"0F",X"0F",X"3F",X"1F",X"1F",X"1F",X"3F",X"7F",X"FF",X"FF",
+ X"FF",X"7F",X"3F",X"3F",X"3F",X"7F",X"7F",X"3F",X"3F",X"1F",X"1F",X"0F",X"0F",X"0F",X"2F",X"3F",
+ X"83",X"C4",X"C7",X"E7",X"E7",X"A7",X"87",X"87",X"82",X"C1",X"C0",X"C0",X"E8",X"F8",X"F8",X"F8",
+ X"F0",X"E1",X"E1",X"E1",X"E1",X"C2",X"C3",X"83",X"03",X"04",X"07",X"0F",X"0F",X"1F",X"1B",X"0D",
+ X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3E",X"2F",X"1F",X"1F",X"1F",X"0B",X"0D",X"0F",X"0F",X"07",
+ X"F0",X"F0",X"F0",X"F0",X"C0",X"F0",X"F0",X"70",X"F0",X"F8",X"F8",X"E8",X"D8",X"FC",X"FC",X"7C",
+ X"B4",X"F8",X"F8",X"F8",X"F8",X"F8",X"E8",X"F0",X"F0",X"F0",X"E0",X"E0",X"C0",X"C0",X"C0",X"80",
+ X"80",X"80",X"80",X"80",X"80",X"40",X"C0",X"C0",X"C0",X"C0",X"C0",X"A0",X"E0",X"E0",X"E0",X"F0",
+ X"FE",X"FE",X"FF",X"FF",X"FF",X"FE",X"FE",X"FF",X"FE",X"FE",X"FC",X"FC",X"FC",X"FE",X"FE",X"FE",
+ X"FF",X"FF",X"FE",X"FE",X"FC",X"FC",X"FC",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"BF",X"9F",X"DF",X"FF",
+ X"80",X"20",X"E0",X"70",X"F8",X"F8",X"FC",X"FC",X"7E",X"7E",X"7C",X"F8",X"68",X"0C",X"0C",X"0E",
+ X"CF",X"87",X"C7",X"C4",X"C0",X"C0",X"02",X"86",X"FC",X"E0",X"C2",X"BC",X"18",X"30",X"00",X"00",
+ X"FC",X"7C",X"3C",X"3C",X"3E",X"7F",X"7F",X"3F",X"30",X"7C",X"18",X"30",X"00",X"00",X"00",X"00",
+ X"3E",X"1E",X"0A",X"00",X"00",X"00",X"00",X"00",X"87",X"8F",X"0F",X"0C",X"1C",X"1C",X"0E",X"0E",
+ X"FF",X"FF",X"C3",X"BD",X"19",X"30",X"00",X"00",X"FC",X"7C",X"3C",X"3C",X"3E",X"7F",X"7F",X"3F",
+ X"00",X"80",X"C0",X"E0",X"00",X"E0",X"E0",X"E0",X"37",X"7F",X"19",X"30",X"00",X"00",X"01",X"05",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FE",
+ X"F0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FE",X"F8",X"C0",X"00",X"00",X"00",
+ X"E0",X"C0",X"40",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F8",X"E0",
+ X"80",X"C7",X"EF",X"E7",X"EF",X"CF",X"9E",X"80",X"FF",X"FC",X"E0",X"80",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FC",X"F0",X"80",X"00",X"C0",X"1C",X"7E",X"FE",X"FE",X"FE",X"FE",X"FE",
+ X"FE",X"FF",X"1F",X"03",X"00",X"80",X"C0",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E2",X"FF",X"FE",X"FE",X"7C",X"3C",X"39",X"FB",X"0F",X"00",X"00",X"00",X"60",X"00",X"00",X"90",
+ X"E0",X"C0",X"C0",X"80",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FE",X"FC",X"F1",X"F7",X"7F",X"3F",
+ X"81",X"CF",X"E7",X"F2",X"E7",X"E7",X"E3",X"E0",X"F0",X"F8",X"F8",X"E0",X"FC",X"FF",X"87",X"00",
+ X"1F",X"3F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"03",X"FE",X"7E",X"3E",X"1C",
+ X"19",X"10",X"30",X"C1",X"81",X"02",X"0C",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"37",X"E0",X"06",
+ X"F3",X"F1",X"E1",X"DF",X"FF",X"FF",X"FF",X"7F",X"7F",X"1F",X"7F",X"7F",X"7F",X"4F",X"03",X"00",
+ X"00",X"00",X"00",X"C0",X"E0",X"E8",X"FC",X"FE",X"3C",X"03",X"01",X"20",X"78",X"30",X"10",X"10",
+ X"D8",X"CC",X"86",X"00",X"03",X"FF",X"3E",X"00",X"F7",X"F7",X"F7",X"E1",X"E8",X"EE",X"CF",X"DE",
+ X"80",X"E7",X"F3",X"F9",X"FD",X"FC",X"FE",X"FF",X"FF",X"FF",X"FE",X"FE",X"FE",X"FC",X"FD",X"F9",
+ X"F0",X"F0",X"F0",X"E0",X"E8",X"EE",X"C0",X"C0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"F8",X"FE",X"F7",X"FB",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F3",X"3B",X"FB",X"FB",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"03",X"37",X"F7",
+ X"00",X"04",X"07",X"7F",X"FF",X"FD",X"7F",X"7F",X"0F",X"7F",X"7B",X"3B",X"BF",X"9F",X"DF",X"DF",
+ X"00",X"00",X"00",X"00",X"01",X"03",X"07",X"0F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"6E",X"EE",X"E7",X"F7",X"37",
+ X"E7",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"09",X"15",X"74",X"F6",
+ X"00",X"00",X"00",X"1F",X"FB",X"DD",X"BF",X"FF",X"00",X"1F",X"53",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"0F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"07",X"3F",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"07",X"1F",X"7F",X"FF",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"1F",X"7F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",
+ X"07",X"1F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"01",X"07",X"1F",X"7F",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"01",X"07",X"1F",X"7F",X"FF",X"0E",X"1B",X"39",X"10",X"09",X"01",X"04",X"00",
+ X"00",X"00",X"00",X"01",X"0F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"03",X"1F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"3F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0F",
+ X"00",X"00",X"00",X"01",X"07",X"3F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"03",X"3F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"0F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"30",X"18",X"18",X"0C",X"54",X"80",X"AC",X"04",
+ X"00",X"00",X"00",X"00",X"0F",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"03",X"3F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"3F",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"0F",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"07",X"1F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"01",X"07",X"0F",X"1F",X"3F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"07",X"07",X"07",
+ X"07",X"07",X"07",X"07",X"07",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"F8",X"FC",X"FE",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"C0",X"C0",X"E0",X"E0",
+ X"E0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"01",X"04",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"F0",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"80",X"F0",X"FE",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",
+ X"00",X"00",X"80",X"C0",X"E0",X"F0",X"F8",X"E0",X"00",X"00",X"80",X"C0",X"E0",X"F0",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"E0",X"F8",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"F8",X"FF",X"FC",X"F0",X"80",X"00",X"00",X"00",
+ X"F0",X"FC",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"C0",X"F0",X"FC",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"E0",X"F8",X"FC",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"80",X"E0",X"F0",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"E0",X"F0",X"F8",X"FC",
+ X"10",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"00",X"00",X"0F",X"1F",X"1F",X"3F",X"7F",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"1F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"1F",
+ X"00",X"60",X"FC",X"FF",X"FF",X"FF",X"DF",X"A1",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"C0",X"F0",X"F0",X"88",X"04",X"00",X"00",X"07",X"7F",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"01",X"1F",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"C0",X"00",X"60",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F0",X"80",X"00",X"00",X"07",X"3F",X"FF",X"FF",
+ X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"1F",X"F8",X"C0",X"00",X"00",X"03",X"1F",
+ X"00",X"00",X"01",X"1F",X"FF",X"FF",X"FF",X"FF",X"01",X"0F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"01",X"1F",X"FF",X"FF",X"00",X"00",X"00",X"07",X"7F",X"FF",X"FF",X"FF",
+ X"06",X"01",X"01",X"60",X"00",X"18",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"3F",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"30",X"00",X"00",X"00",X"02",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"00",X"01",X"CF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"83",
+ X"00",X"00",X"20",X"A0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"01",X"01",X"00",X"00",X"00",X"00",X"70",X"F8",X"F0",X"F0",X"C0",X"40",X"18",X"00",
+ X"00",X"00",X"00",X"00",X"04",X"08",X"01",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"60",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"21",X"80",X"40",X"00",X"00",X"00",X"00",
+ X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"12",X"7A",X"7C",
+ X"38",X"6C",X"42",X"00",X"30",X"68",X"C1",X"C1",X"00",X"00",X"1E",X"72",X"F9",X"A8",X"00",X"06",
+ X"00",X"00",X"00",X"00",X"30",X"78",X"2C",X"04",X"7D",X"FD",X"7F",X"FC",X"FC",X"78",X"78",X"F8",
+ X"80",X"C0",X"80",X"80",X"40",X"00",X"00",X"00",X"03",X"07",X"0E",X"1A",X"08",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"04",X"84",X"C0",X"41",X"01",X"02",X"00",X"00",
+ X"E8",X"1C",X"12",X"04",X"04",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"03",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"EF",X"FE",X"C0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FE",X"FE",X"FF",X"FF",X"E7",X"FF",X"FE",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"BF",X"2F",X"6E",X"78",X"00",X"00",X"40",X"40",
+ X"FF",X"FF",X"FF",X"FF",X"EF",X"E7",X"16",X"70",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FC",X"EE",X"FE",X"C0",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"FF",X"FF",X"00",X"01",X"07",X"1F",X"FF",X"FF",X"FF",X"FF",
+ X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"07",X"1F",X"00",X"01",X"07",X"1F",X"7F",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"1F",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"C0",X"C0",X"C0",X"E0",X"E0",X"E0",
+ X"F0",X"F0",X"F0",X"F8",X"F8",X"F8",X"FC",X"FC",X"FE",X"FE",X"FE",X"FE",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"C0",X"C0",X"E0",X"F0",X"FC",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"EF",X"EF",X"EB",X"EF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FB",X"FB",X"FB",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FB",X"FB",X"B3",X"D7",X"F7",X"03",X"01",X"00",
+ X"FF",X"FF",X"FF",X"BF",X"7D",X"FB",X"FE",X"00",X"BF",X"9F",X"DF",X"DF",X"DF",X"87",X"01",X"00",
+ X"BF",X"BF",X"F6",X"FC",X"F9",X"83",X"3F",X"7F",X"7F",X"7F",X"7F",X"7F",X"3F",X"1F",X"0F",X"07",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"07",X"07",X"03",X"03",X"03",X"03",X"03",X"03",
+ X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"FE",X"FE",X"FF",X"FF",X"C0",X"FF",X"FF",X"FF",
+ X"FF",X"7F",X"7E",X"78",X"00",X"C0",X"C0",X"C0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"C0",X"80",X"80",X"80",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"80",X"80",X"80",X"80",X"80",X"80",X"C0",X"C0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"C0",X"C0",X"C0",X"C0",X"E0",X"E0",X"E0",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"F0",X"F0",X"F0",X"F0",X"F8",X"F8",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F8",X"F8",X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"3F",X"7F",X"77",X"6F",X"7C",X"60",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F7",X"F3",X"FB",X"9B",X"FA",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"F3",X"FE",X"7C",
+ X"78",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"77",X"37",X"BC",X"A0",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"F7",X"F7",X"F3",X"3B",X"FB",X"FA",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FE",X"FE",X"FE",X"FF",X"F3",X"FF",X"7C",
+ X"78",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FC",X"EF",X"6F",X"7C",X"60",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"ED",X"ED",X"E7",X"F4",X"70",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"55",X"FF",X"55",X"FF",X"55",X"FF",X"FF",
+ X"FF",X"55",X"FF",X"55",X"FF",X"55",X"FF",X"00",X"FC",X"4A",X"FF",X"4B",X"FD",X"4B",X"FC",X"00",
+ X"00",X"00",X"00",X"80",X"F8",X"80",X"00",X"00",X"01",X"01",X"FF",X"55",X"FF",X"55",X"FF",X"FF",
+ X"01",X"01",X"0F",X"05",X"1F",X"15",X"3F",X"00",X"00",X"00",X"FF",X"55",X"FF",X"55",X"FF",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"E0",X"B8",X"EF",X"01",X"00",X"0F",X"04",X"1F",X"04",X"3F",X"00",
+ X"B9",X"EF",X"B9",X"EF",X"B9",X"E7",X"00",X"00",X"FF",X"92",X"FF",X"92",X"FF",X"92",X"FF",X"00",
+ X"00",X"10",X"38",X"38",X"38",X"38",X"10",X"00",X"00",X"00",X"00",X"80",X"80",X"F8",X"FC",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"60",X"00",X"00",X"01",X"03",X"07",X"0F",X"FF",X"55",
+ X"87",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"F8",X"C0",X"80",X"D1",X"BF",X"D1",X"BF",X"C1",X"60",
+ X"00",X"00",X"80",X"C0",X"E0",X"80",X"00",X"00",X"FC",X"F8",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"4A",X"FF",X"4B",X"FD",X"4B",X"FF",X"4B",
+ X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"00",X"FD",X"4B",X"FF",X"4B",X"FD",X"4B",X"FC",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"4A",X"FF",X"4B",X"FD",X"4B",X"FC",X"00",
+ X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"00",X"00",X"55",X"FF",X"FF",X"55",X"FF",X"00",
+ X"E0",X"E0",X"E0",X"00",X"00",X"00",X"00",X"00",X"FF",X"24",X"FF",X"24",X"FF",X"24",X"FF",X"00",
+ X"FF",X"92",X"FF",X"92",X"FF",X"92",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"03",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"F8",X"80",
+ X"FF",X"07",X"07",X"07",X"07",X"07",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",
+ X"A0",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"4A",X"FF",X"4B",X"FD",X"4B",X"FC",X"00",
+ X"FC",X"4A",X"FF",X"49",X"FD",X"4B",X"FC",X"00",X"01",X"01",X"FF",X"55",X"FF",X"55",X"FF",X"FF",
+ X"FF",X"55",X"FF",X"55",X"FF",X"55",X"FF",X"FF",X"FF",X"55",X"FF",X"55",X"FF",X"55",X"FF",X"00",
+ X"01",X"01",X"0F",X"05",X"1F",X"15",X"3F",X"00",X"FC",X"4A",X"FF",X"4B",X"FD",X"4B",X"FF",X"49",
+ X"F8",X"F8",X"FF",X"F8",X"F0",X"00",X"00",X"00",X"FD",X"4B",X"FF",X"4B",X"FD",X"4B",X"FC",X"00",
+ X"01",X"00",X"FF",X"24",X"FF",X"24",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"00",X"0F",X"04",X"1F",X"04",X"3F",X"00",X"00",X"00",X"80",X"C0",X"E0",X"80",X"00",X"00",
+ X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"55",X"FF",X"55",X"FF",X"55",X"FF",X"FF",X"00",X"55",X"FF",X"55",X"FF",X"55",X"FF",X"00",
+ X"FF",X"55",X"FF",X"55",X"FF",X"55",X"FF",X"00",X"01",X"01",X"FF",X"55",X"FF",X"55",X"FF",X"FF",
+ X"F5",X"FF",X"FF",X"FF",X"FF",X"FE",X"FF",X"FF",X"55",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"55",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"F0",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"F0",X"F8",X"FF",X"F8",X"F8",X"00",X"00",X"00",X"00",X"00",X"2A",X"00",X"00",
+ X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"F0",X"00",X"00",X"FC",X"48",X"FC",X"4A",X"FC",X"48",X"FC",X"00",
+ X"01",X"00",X"FF",X"24",X"FF",X"24",X"FF",X"00",X"FC",X"4A",X"FF",X"4B",X"FD",X"4B",X"FC",X"00",
+ X"00",X"B2",X"03",X"B5",X"01",X"B3",X"03",X"B5",X"00",X"6D",X"00",X"6D",X"00",X"6D",X"00",X"00",
+ X"00",X"B2",X"03",X"B5",X"01",X"B3",X"00",X"00",X"01",X"B3",X"03",X"B5",X"01",X"B3",X"00",X"00",
+ X"01",X"00",X"0F",X"04",X"1F",X"04",X"3F",X"00",X"FF",X"92",X"FF",X"92",X"FF",X"92",X"FF",X"00",
+ X"00",X"00",X"FF",X"55",X"FF",X"55",X"FF",X"00",X"00",X"03",X"00",X"0B",X"00",X"1B",X"00",X"00",
+ X"00",X"DB",X"00",X"DB",X"00",X"DB",X"00",X"00",X"00",X"00",X"80",X"E0",X"E0",X"00",X"00",X"00",
+ X"00",X"00",X"80",X"E0",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"24",X"FF",X"24",X"FF",X"24",X"FF",X"00",X"00",X"03",X"00",X"DB",X"00",X"DB",X"00",X"00",
+ X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"01",X"03",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"AA",X"00",X"00",X"AA",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"FF",X"FF",X"FF",X"ED",X"FC",X"FC",X"00",X"00",X"00",X"00",X"8F",X"E7",X"75",X"00",
+ X"00",X"00",X"1F",X"E1",X"FC",X"CE",X"E3",X"F8",X"00",X"00",X"81",X"E0",X"70",X"30",X"30",X"11",
+ X"03",X"FD",X"80",X"00",X"00",X"00",X"00",X"C0",X"20",X"B8",X"90",X"00",X"00",X"00",X"00",X"00",
+ X"FC",X"BC",X"28",X"23",X"83",X"87",X"9F",X"BF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"60",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"11",X"00",X"00",X"80",X"40",X"60",X"10",X"08",
+ X"40",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"10",X"10",X"12",X"0A",X"1A",X"1A",X"1A",X"18",
+ X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"0C",X"12",X"1A",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"10",X"10",X"10",X"10",X"10",X"12",X"1A",X"1A",
+ X"80",X"A0",X"20",X"20",X"30",X"20",X"80",X"B0",X"00",X"06",X"E9",X"46",X"E0",X"0F",X"C8",X"60",
+ X"00",X"00",X"00",X"28",X"00",X"10",X"54",X"10",X"CF",X"09",X"E6",X"80",X"0F",X"ED",X"88",X"00",
+ X"1E",X"08",X"1E",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"04",X"08",X"08",X"01",X"12",X"12",
+ X"E0",X"18",X"06",X"01",X"F0",X"08",X"04",X"04",X"10",X"10",X"10",X"10",X"14",X"14",X"14",X"10",
+ X"06",X"05",X"04",X"04",X"02",X"02",X"02",X"03",X"14",X"14",X"14",X"12",X"12",X"1A",X"16",X"12",
+ X"02",X"02",X"02",X"04",X"04",X"05",X"06",X"04",X"E0",X"F0",X"38",X"D8",X"F8",X"38",X"58",X"38",
+ X"00",X"00",X"00",X"00",X"00",X"40",X"90",X"A8",X"12",X"11",X"18",X"18",X"1C",X"1F",X"0F",X"0F",
+ X"04",X"08",X"F0",X"01",X"06",X"1F",X"E6",X"07",X"F8",X"B8",X"58",X"F8",X"18",X"F8",X"18",X"38",
+ X"48",X"00",X"D0",X"00",X"F0",X"00",X"E0",X"40",X"1E",X"1E",X"1C",X"1C",X"19",X"18",X"03",X"00",
+ X"46",X"07",X"C7",X"06",X"87",X"03",X"01",X"00",X"19",X"F8",X"38",X"D8",X"38",X"F0",X"E0",X"00",
+ X"20",X"80",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"07",
+ X"00",X"01",X"03",X"47",X"6C",X"3B",X"70",X"00",X"07",X"FB",X"FF",X"0D",X"FF",X"FF",X"79",X"00",
+ X"00",X"C0",X"E0",X"E4",X"E4",X"F4",X"F8",X"70",X"07",X"06",X"07",X"03",X"03",X"03",X"03",X"01",
+ X"00",X"00",X"3F",X"3F",X"DF",X"DF",X"0F",X"E0",X"30",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",
+ X"00",X"00",X"08",X"38",X"1C",X"38",X"08",X"00",X"01",X"00",X"01",X"01",X"01",X"01",X"01",X"01",
+ X"F8",X"00",X"FC",X"FE",X"FF",X"FF",X"FF",X"FF",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FE",X"FD",X"FB",X"02",X"FB",X"00",X"00",X"40",X"80",X"60",X"80",X"00",X"F0",
+ X"01",X"03",X"03",X"03",X"03",X"07",X"07",X"07",X"D2",X"F5",X"E6",X"ED",X"CA",X"CA",X"89",X"89",
+ X"00",X"80",X"60",X"00",X"80",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"02",X"07",X"0F",
+ X"00",X"00",X"02",X"06",X"06",X"0F",X"0F",X"4F",X"A0",X"70",X"70",X"20",X"80",X"C0",X"80",X"F0",
+ X"00",X"00",X"00",X"00",X"08",X"1C",X"1C",X"08",X"1F",X"11",X"15",X"5F",X"11",X"1F",X"11",X"53",
+ X"F0",X"EC",X"D8",X"D8",X"B4",X"A8",X"A8",X"B4",X"00",X"00",X"00",X"C0",X"F0",X"F8",X"F8",X"C0",
+ X"00",X"06",X"03",X"00",X"00",X"00",X"00",X"00",X"1F",X"11",X"35",X"3F",X"71",X"73",X"FF",X"07",
+ X"B8",X"D8",X"DC",X"EC",X"F0",X"F0",X"F4",X"FC",X"00",X"00",X"00",X"08",X"1C",X"1C",X"08",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"F0",X"18",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"01",X"03",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"E1",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"C0",X"F0",X"FC",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"FF",X"3F",X"0F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"C0",X"F0",X"FC",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",
+ X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"9F",X"9F",X"9F",X"8F",X"CF",X"CF",X"CF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"80",X"80",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"CF",X"CF",X"C7",X"E7",X"E7",X"E7",X"E7",X"E7",
+ X"FF",X"FF",X"CF",X"E3",X"FB",X"FB",X"FB",X"FB",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"F0",X"F0",
+ X"E3",X"F3",X"F3",X"F3",X"F3",X"F3",X"F1",X"F9",X"DB",X"C3",X"C3",X"C3",X"C3",X"C3",X"C3",X"C3",
+ X"F0",X"F0",X"F0",X"F0",X"F8",X"F8",X"F8",X"F8",X"F9",X"F9",X"F9",X"F9",X"F8",X"FC",X"9C",X"C4",
+ X"C3",X"C3",X"E3",X"FB",X"FB",X"FB",X"FB",X"FF",X"F8",X"F8",X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",
+ X"FF",X"FF",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"F4",X"F4",X"F4",X"F6",X"B6",X"86",X"86",X"86",
+ X"FE",X"FE",X"FE",X"FF",X"FF",X"FE",X"FE",X"FE",X"FF",X"FF",X"FF",X"FF",X"0F",X"03",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"80",X"E0",X"FF",X"FF",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",
+ X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"7F",X"1F",X"07",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"F8",X"F8",X"F8",X"FF",X"FF",X"FF",X"FF",X"FF",X"3F",X"3F",X"3F",X"1F",X"1F",X"3F",X"3F",X"3F",
+ X"86",X"87",X"87",X"87",X"87",X"87",X"C7",X"F6",X"F6",X"F6",X"F6",X"FC",X"FC",X"FC",X"FC",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"00",X"C0",X"00",X"3C",X"8E",X"E0",X"00",
+ X"FF",X"0F",X"E3",X"38",X"00",X"FF",X"00",X"00",X"FF",X"C0",X"FF",X"00",X"0F",X"03",X"00",X"00",
+ X"FF",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"70",X"1C",X"FF",X"00",X"00",X"00",X"00",
+ X"01",X"FC",X"FF",X"FF",X"00",X"00",X"00",X"00",X"E0",X"3F",X"0F",X"03",X"00",X"00",X"00",X"00",
+ X"FF",X"03",X"00",X"00",X"00",X"C0",X"F0",X"FC",X"FF",X"C0",X"F0",X"FC",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F3",X"F8",X"FE",X"FE",X"FE",X"FE",X"F6",X"F0",
+ X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F8",X"FE",X"FE",X"FE",X"FE",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"8F",X"63",X"00",X"01",X"07",X"FF",X"FF",X"FF",X"C7",X"F0",X"FC",X"FC",X"FC",
+ X"FF",X"BF",X"BF",X"BF",X"9F",X"9F",X"9F",X"8F",X"8F",X"8F",X"87",X"87",X"87",X"83",X"83",X"83",
+ X"81",X"81",X"81",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"3F",X"3F",X"3F",X"1F",X"1F",X"1F",X"0F",
+ X"0F",X"0F",X"07",X"07",X"07",X"03",X"03",X"03",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"3F",X"3F",X"3F",X"3F",X"1F",X"1F",X"1F",X"1F",
+ X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",
+ X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",
+ X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",X"FE",X"07",X"07",X"87",X"87",X"C7",X"E7",X"E7",X"F7",
+ X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F8",X"F8",X"F8",X"F8",X"F8",X"78",X"78",X"F8",
+ X"7F",X"1F",X"07",X"FF",X"FF",X"00",X"00",X"00",X"F8",X"F8",X"F8",X"7F",X"1F",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"0F",X"0F",X"0F",X"07",X"07",X"07",X"07",X"03",X"03",X"03",X"03",X"01",X"01",X"01",X"01",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"3F",X"0F",X"03",X"00",X"3F",X"0F",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"04",X"00",X"20",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"00",X"00",X"60",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"10",X"70",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"60",X"E0",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"0C",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"60",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",
+ X"0F",X"1E",X"7C",X"F0",X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7E",X"FC",X"F0",X"E0",X"80",X"00",X"00",
+ X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FC",X"03",X"0F",X"1F",X"3F",X"3E",X"38",X"30",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"08",X"18",X"78",X"F8",X"F8",X"F8",X"F0",X"E0",X"80",X"00",X"00",
+ X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"FC",X"1F",X"7F",X"FF",X"FF",X"FE",X"F8",X"F0",X"C0",
+ X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"00",X"00",X"04",X"00",X"20",X"00",X"00",X"00",
+ X"01",X"00",X"00",X"40",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1C",
+ X"18",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"C0",X"C0",
+ X"00",X"00",X"00",X"01",X"03",X"03",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",
+ X"1C",X"7C",X"FC",X"F0",X"E0",X"80",X"00",X"00",X"03",X"0F",X"1F",X"7F",X"FE",X"F8",X"F0",X"C0",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"04",X"00",X"40",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"01",X"00",X"00",X"60",X"C0",X"01",X"00",X"00",X"00",X"80",X"80",X"00",X"00",
+ X"38",X"20",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"01",X"03",X"0F",X"0F",X"0C",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"60",X"E0",X"E0",X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"0F",
+ X"0F",X"0E",X"0C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"08",X"18",X"78",X"F8",X"F8",X"F8",X"00",X"00",X"04",X"00",X"60",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"04",X"03",X"02",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"78",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",
+ X"0E",X"1E",X"7C",X"F0",X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"3C",
+ X"38",X"20",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",X"00",X"00",
+ X"7F",X"7E",X"7C",X"70",X"60",X"00",X"00",X"00",X"00",X"00",X"0C",X"00",X"60",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"03",X"02",X"00",X"40",X"C0",X"03",X"06",X"04",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"02",X"0E",X"1C",X"78",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"0C",X"1C",X"7C",X"F0",X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7C",
+ X"00",X"00",X"01",X"03",X"03",X"03",X"03",X"00",X"00",X"01",X"03",X"07",X"07",X"07",X"07",X"04",
+ X"10",X"70",X"F0",X"F0",X"F0",X"F0",X"F0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"0C",
+ X"08",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"00",X"00",X"00",X"00",
+ X"00",X"10",X"70",X"F0",X"E0",X"80",X"00",X"00",X"01",X"03",X"03",X"03",X"02",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"60",X"E0",X"E0",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"7F",X"7C",X"78",X"60",X"40",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"02",X"0E",X"1E",X"7E",X"FE",X"00",X"00",X"0C",X"00",X"40",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"03",X"06",X"00",X"00",X"80",X"03",X"0E",X"0C",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"1C",X"00",X"01",X"03",X"07",X"06",X"00",X"00",X"00",
+ X"00",X"00",X"60",X"E0",X"E0",X"80",X"00",X"00",X"01",X"03",X"0F",X"0F",X"0E",X"08",X"00",X"00",
+ X"07",X"07",X"07",X"07",X"06",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"C0",
+ X"00",X"02",X"08",X"00",X"40",X"80",X"00",X"00",X"00",X"00",X"01",X"03",X"06",X"00",X"00",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"18",X"00",X"01",X"03",X"0F",X"0E",X"08",X"00",X"00",
+ X"00",X"00",X"00",X"80",X"80",X"80",X"00",X"00",X"01",X"03",X"0F",X"1F",X"3E",X"38",X"30",X"00",
+ X"00",X"08",X"18",X"78",X"F8",X"F8",X"F0",X"C0",X"0F",X"1F",X"7F",X"7F",X"7E",X"78",X"70",X"40",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"03",X"0F",X"0F",X"0F",X"0F",X"0F",X"0C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"0F",X"0F",X"0F",X"0E",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"03",X"0F",X"0F",X"0F",X"0F",X"02",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"FF",X"FC",
+ X"00",X"00",X"10",X"70",X"F0",X"F0",X"F0",X"F0",X"C0",X"F1",X"F3",X"FF",X"F3",X"FD",X"F1",X"FD",
+ X"00",X"60",X"78",X"FC",X"7C",X"FE",X"7F",X"7F",X"00",X"00",X"00",X"00",X"00",X"02",X"0E",X"1E",
+ X"7F",X"FF",X"FF",X"FF",X"FE",X"F8",X"F0",X"C0",X"7E",X"FE",X"FE",X"FE",X"FE",X"F8",X"F0",X"C0",
+ X"40",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"08",X"18",X"78",X"F8",X"F8",X"F8",X"F8",X"F8",X"F0",X"E0",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"F0",X"B1",X"AD",X"A1",X"80",X"00",X"0E",X"3F",X"D5",
+ X"FE",X"7E",X"7C",X"3C",X"38",X"BF",X"FF",X"55",X"30",X"18",X"18",X"0C",X"54",X"80",X"AC",X"04",
+ X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"8F",X"C4",X"60",X"30",X"30",X"11",X"00",X"00",X"00",X"00",X"E0",X"30",X"18",X"CC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"41",X"81",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"A0",X"B8",X"10",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"E0",X"18",X"06",X"01",X"F0",X"08",X"64",X"94",
+ X"06",X"E5",X"54",X"E4",X"02",X"A2",X"52",X"03",X"F2",X"02",X"F2",X"64",X"F4",X"05",X"66",X"94",
+ X"64",X"08",X"F0",X"01",X"06",X"1F",X"E6",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"80",X"01",X"03",X"03",X"81",X"C0",X"80",X"F0",X"00",X"00",X"80",X"80",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"C2",X"F7",X"FF",X"FA",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F1",X"F3",X"1B",X"09",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"20",X"20",X"40",X"40",X"40",X"40",
+ X"00",X"18",X"3C",X"3C",X"7E",X"7E",X"7E",X"7E",X"40",X"40",X"00",X"30",X"12",X"1F",X"07",X"00",
+ X"7E",X"7E",X"3E",X"BE",X"D8",X"D8",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"5B",X"7F",
+ X"00",X"00",X"07",X"1F",X"38",X"00",X"58",X"FC",X"00",X"00",X"00",X"80",X"C0",X"40",X"00",X"30",
+ X"00",X"00",X"00",X"80",X"80",X"00",X"00",X"00",X"7F",X"FF",X"FF",X"FD",X"7C",X"78",X"FA",X"F2",
+ X"F8",X"D0",X"45",X"0F",X"1F",X"1E",X"3C",X"3C",X"18",X"0C",X"C4",X"E0",X"30",X"10",X"00",X"00",
+ X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"F3",X"F3",X"E1",X"61",X"70",X"20",X"20",X"20",
+ X"18",X"39",X"33",X"13",X"01",X"21",X"60",X"E0",X"F0",X"E0",X"F8",X"F0",X"FC",X"F0",X"A0",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"06",X"06",X"03",X"13",X"1B",X"0B",X"01",
+ X"A7",X"33",X"10",X"02",X"01",X"00",X"00",X"00",X"24",X"FE",X"CC",X"00",X"C0",X"E0",X"70",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"3F",X"3F",X"7F",X"F7",
+ X"00",X"00",X"00",X"C0",X"F0",X"F8",X"FC",X"DE",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",
+ X"01",X"01",X"00",X"00",X"01",X"01",X"03",X"03",X"FF",X"FE",X"FF",X"FF",X"F7",X"FF",X"BF",X"FE",
+ X"FF",X"F7",X"FF",X"FF",X"DF",X"FD",X"FF",X"FF",X"E0",X"E0",X"F0",X"B8",X"F8",X"F8",X"FC",X"FC",
+ X"01",X"01",X"01",X"03",X"03",X"01",X"01",X"00",X"FF",X"FF",X"EF",X"FF",X"FF",X"FD",X"DF",X"FF",
+ X"F7",X"FF",X"BF",X"FF",X"FF",X"ED",X"FF",X"FF",X"78",X"F0",X"F0",X"F0",X"B8",X"F8",X"F8",X"F0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"38",X"10",X"00",X"00",X"00",X"00",
+ X"BF",X"FF",X"6F",X"07",X"03",X"01",X"00",X"00",X"F0",X"70",X"F0",X"E0",X"C0",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"10",X"18",X"18",X"00",X"00",X"00",X"00",X"20",X"20",X"00",X"0F",X"65",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"E0",X"00",X"01",X"03",X"03",X"01",X"00",X"06",X"33",
+ X"FF",X"B8",X"FF",X"FF",X"FD",X"FF",X"7F",X"FF",X"38",X"F8",X"2C",X"8C",X"C4",X"E8",X"F0",X"F0",
+ X"7A",X"78",X"77",X"5F",X"0E",X"6E",X"27",X"07",X"FF",X"FF",X"FF",X"FD",X"FC",X"5E",X"EE",X"FC",
+ X"F8",X"FC",X"FC",X"FC",X"FC",X"BC",X"D8",X"30",X"07",X"0E",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FF",X"7F",X"E2",X"00",X"00",X"00",X"00",X"00",X"04",X"0E",X"1A",X"36",X"7E",X"3C",X"00",
+ X"00",X"00",X"00",X"00",X"10",X"10",X"00",X"00",X"00",X"00",X"00",X"60",X"20",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"07",X"0E",X"0F",X"1F",X"3B",X"17",X"1F",
+ X"EF",X"F7",X"7F",X"3F",X"FF",X"FF",X"FF",X"FF",X"00",X"40",X"70",X"F8",X"7C",X"7E",X"7B",X"5F",
+ X"0F",X"C5",X"F7",X"73",X"53",X"72",X"33",X"01",X"61",X"33",X"9E",X"9C",X"8F",X"C0",X"FF",X"FF",
+ X"DF",X"BF",X"0F",X"8F",X"86",X"6C",X"E0",X"F0",X"01",X"08",X"0E",X"07",X"03",X"00",X"00",X"00",
+ X"EF",X"7D",X"00",X"82",X"CF",X"E7",X"3C",X"00",X"B0",X"D8",X"C8",X"00",X"E1",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"03",X"3B",X"7F",X"00",X"00",X"50",X"F8",X"FF",X"FF",X"F7",X"F6",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"E0",X"7F",X"7F",X"7F",X"3F",X"1F",X"07",X"01",X"00",
+ X"CE",X"E3",X"F8",X"FC",X"EF",X"FF",X"FD",X"FF",X"C0",X"E0",X"C0",X"00",X"80",X"80",X"F8",X"F0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"DE",X"D7",X"F0",X"F0",X"F8",X"FE",X"73",X"7F",
+ X"BC",X"FE",X"FC",X"5E",X"14",X"00",X"80",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"3E",X"1F",X"07",X"01",X"00",X"00",X"00",X"00",X"70",X"F0",X"E0",X"F0",X"20",X"00",X"00",X"00",
+ X"00",X"00",X"03",X"07",X"0F",X"1F",X"1F",X"3F",X"07",X"FF",X"FF",X"F0",X"C0",X"80",X"00",X"00",
+ X"80",X"E0",X"F8",X"3C",X"7E",X"1F",X"0F",X"0F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",
+ X"3E",X"7E",X"0C",X"0C",X"0C",X"1C",X"18",X"18",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"07",X"03",X"03",X"03",X"03",X"00",X"00",X"80",X"C0",X"C0",X"C0",X"C0",X"E0",X"60",X"60",
+ X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",
+ X"00",X"60",X"FC",X"FF",X"FF",X"FF",X"DF",X"A1",X"00",X"00",X"00",X"C0",X"F0",X"F0",X"88",X"04",
+ X"00",X"00",X"00",X"00",X"C0",X"00",X"60",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"10",X"78",X"7E",X"38",X"6C",X"42",X"00",X"30",X"68",X"C1",X"C1",
+ X"00",X"00",X"1E",X"72",X"F9",X"A8",X"00",X"06",X"00",X"00",X"00",X"00",X"30",X"78",X"2C",X"04",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"60",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",
+ X"40",X"21",X"80",X"40",X"00",X"00",X"0F",X"8F",X"80",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"C2",X"E7",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"11",X"7F",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_bit3.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_bit3.vhd
new file mode 100644
index 00000000..02b5cb85
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_bit3.vhd
@@ -0,0 +1,534 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_chr_bit3 is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(12 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_chr_bit3 is
+ type rom is array(0 to 8191) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"80",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"00",X"00",
+ X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"00",X"00",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"00",X"00",
+ X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"00",X"00",X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",X"00",X"00",
+ X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F8",X"02",X"F8",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"00",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"3F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"1F",X"40",X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"BF",X"3F",X"7F",X"7F",X"7F",X"01",X"81",X"FF",X"81",X"01",X"7F",X"7F",X"7F",X"01",X"81",
+ X"FF",X"01",X"01",X"E3",X"C7",X"E3",X"01",X"01",X"FF",X"01",X"01",X"DD",X"DD",X"DD",X"C1",X"E3",
+ X"FF",X"FF",X"F3",X"3E",X"00",X"00",X"00",X"00",X"FF",X"FF",X"F9",X"67",X"00",X"00",X"00",X"00",
+ X"3F",X"9F",X"9B",X"8E",X"00",X"00",X"00",X"00",X"FD",X"FE",X"CE",X"72",X"00",X"00",X"01",X"03",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"1C",X"1C",X"0C",X"08",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"A0",X"B0",X"F0",X"F8",X"78",X"E8",X"E8",X"B0",
+ X"F0",X"E0",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"0F",X"0F",X"0F",
+ X"07",X"03",X"0B",X"0F",X"0F",X"05",X"05",X"05",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"C4",X"C7",X"BF",X"1F",X"3F",X"0F",X"0F",X"00",X"01",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"C0",X"BC",X"1E",X"3F",X"0F",X"0F",X"00",X"01",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"3F",X"7F",X"1F",X"3F",X"0F",X"0F",X"27",X"3F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"30",X"7C",X"1E",X"3F",X"0F",X"0F",X"06",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"C0",X"C0",X"80",X"C0",X"C0",X"C0",X"00",X"80",X"27",X"1F",X"1B",X"0E",X"00",X"00",X"00",X"00",
+ X"CE",X"D7",X"DF",X"DE",X"DF",X"CF",X"EF",X"E7",X"F7",X"F5",X"F3",X"FB",X"FB",X"FB",X"FB",X"FB",
+ X"FB",X"FB",X"FB",X"F3",X"F7",X"F7",X"E6",X"EE",X"CC",X"D4",X"DC",X"D8",X"D8",X"D8",X"98",X"A8",
+ X"B8",X"B8",X"B8",X"98",X"DC",X"DC",X"DE",X"CE",X"EC",X"EE",X"EE",X"E6",X"EE",X"EE",X"EE",X"EE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"80",X"80",X"80",X"80",X"C0",X"C0",X"80",X"C0",X"C0",X"C0",X"C0",X"00",X"80",
+ X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"04",X"07",X"07",X"07",X"07",X"07",X"07",X"02",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"01",X"01",X"01",X"02",X"03",X"03",X"03",X"04",X"07",X"0F",X"0F",X"1F",X"1B",X"0D",
+ X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3E",X"2F",X"1F",X"1F",X"1F",X"0B",X"0D",X"0F",X"0F",X"07",
+ X"F7",X"F7",X"F7",X"F7",X"C7",X"F7",X"F7",X"77",X"F3",X"FB",X"FB",X"EB",X"D9",X"FD",X"FD",X"7D",
+ X"B5",X"F9",X"FB",X"FB",X"FB",X"FB",X"EB",X"F3",X"F7",X"F7",X"E7",X"EF",X"CF",X"DF",X"DF",X"9F",
+ X"BF",X"BF",X"BF",X"BF",X"9F",X"5F",X"DF",X"DF",X"DF",X"DF",X"CF",X"AF",X"EF",X"EF",X"E7",X"F7",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7F",X"DF",X"1F",X"8F",X"07",X"07",X"03",X"03",X"81",X"81",X"81",X"01",X"11",X"11",X"31",X"21",
+ X"C0",X"81",X"C3",X"C0",X"C0",X"C0",X"00",X"80",X"00",X"C0",X"C0",X"BC",X"1E",X"3F",X"0F",X"0F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"7C",X"1E",X"3F",X"0F",X"0F",X"06",X"00",
+ X"03",X"03",X"07",X"07",X"07",X"07",X"0F",X"1F",X"80",X"81",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"C0",X"BC",X"1E",X"3F",X"0F",X"0F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"37",X"7F",X"1F",X"3F",X"0F",X"0F",X"07",X"05",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"3F",X"3F",X"7F",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"6F",X"38",X"10",X"10",X"10",X"30",X"61",X"7F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"3F",X"E3",X"81",X"01",X"01",X"01",X"01",X"01",
+ X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"60",X"F0",
+ X"1C",X"00",X"01",X"01",X"01",X"03",X"06",X"04",X"00",X"00",X"00",X"01",X"81",X"03",X"C7",X"7F",
+ X"1F",X"3F",X"3F",X"7F",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"01",X"03",X"0E",X"08",X"80",X"C0",
+ X"7E",X"30",X"18",X"0C",X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"1E",X"03",X"00",X"00",X"0F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"60",X"FC",X"01",X"01",X"01",X"03",
+ X"06",X"64",X"C0",X"00",X"60",X"C1",X"83",X"FE",X"00",X"00",X"00",X"00",X"00",X"C8",X"1F",X"F9",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"A0",X"80",X"80",X"80",X"80",X"80",X"80",
+ X"80",X"C0",X"E0",X"30",X"1C",X"16",X"00",X"00",X"03",X"00",X"00",X"80",X"80",X"08",X"48",X"CC",
+ X"06",X"03",X"01",X"07",X"1C",X"00",X"C1",X"FF",X"08",X"08",X"08",X"1E",X"17",X"11",X"30",X"21",
+ X"7F",X"18",X"0C",X"06",X"02",X"03",X"01",X"00",X"00",X"00",X"01",X"01",X"01",X"03",X"02",X"06",
+ X"0C",X"08",X"08",X"1E",X"17",X"11",X"30",X"21",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"07",X"01",X"08",X"04",X"00",X"00",X"00",
+ X"00",X"00",X"07",X"FF",X"FF",X"FF",X"FF",X"FF",X"01",X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"0C",X"C4",X"04",X"04",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FC",X"C8",X"08",
+ X"FF",X"FF",X"FC",X"80",X"00",X"06",X"80",X"80",X"F0",X"80",X"84",X"C4",X"40",X"60",X"20",X"20",
+ X"7F",X"FF",X"FF",X"FF",X"FE",X"FC",X"F8",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"03",X"1F",X"7F",X"FF",X"FF",X"FE",X"F8",X"F0",X"91",X"11",X"18",X"08",X"C8",
+ X"18",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"07",X"3F",X"FF",X"FF",X"FE",X"EA",X"8B",X"09",
+ X"FF",X"FF",X"FF",X"E0",X"04",X"22",X"40",X"00",X"FF",X"E0",X"AC",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"11",X"24",X"46",X"6F",X"76",X"FE",X"FB",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"E0",X"E0",X"F0",X"A8",X"7C",X"52",X"FA",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FE",X"FB",X"FF",X"FF",X"FF",X"FF",X"7F",X"1F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"EE",X"BC",X"FC",X"F8",X"F8",X"F0",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"C0",X"E0",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"60",X"FC",X"FF",X"FF",X"FF",X"FF",X"E1",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"01",X"03",X"C7",X"F7",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F0",X"F0",X"F8",X"F8",X"3C",X"FC",X"9C",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"70",X"70",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"40",X"01",X"03",X"03",X"03",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"9F",X"FF",X"E7",X"FC",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"CD",X"FD",X"FF",X"FF",X"FD",X"FD",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F8",X"F8",X"DC",X"5C",X"7C",X"FC",X"F0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"01",X"00",X"00",X"00",X"00",X"7F",X"9F",X"7F",X"FF",X"FF",X"7F",X"E7",X"FF",
+ X"FE",X"F8",X"FF",X"FF",X"FB",X"F7",X"FE",X"FD",X"00",X"00",X"00",X"00",X"C0",X"C0",X"F0",X"F0",
+ X"01",X"0F",X"FF",X"FF",X"FF",X"FF",X"F8",X"00",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"9F",X"FF",X"FF",X"FF",X"7B",X"39",X"00",X"00",X"BF",X"DE",X"7F",X"BF",X"FF",X"F8",X"F0",X"70",
+ X"70",X"F0",X"E0",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"11",X"79",X"7F",
+ X"01",X"13",X"BD",X"FF",X"CF",X"97",X"3E",X"3E",X"D8",X"FC",X"E0",X"8D",X"06",X"57",X"FF",X"F9",
+ X"00",X"00",X"00",X"00",X"80",X"80",X"D0",X"F8",X"7E",X"FE",X"7E",X"FF",X"FF",X"7F",X"7F",X"FF",
+ X"7F",X"3F",X"7F",X"7F",X"BF",X"FF",X"FF",X"FF",X"FC",X"F8",X"F1",X"E5",X"F7",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F8",X"7A",X"3F",X"BE",X"FE",X"FD",X"FF",X"FE",
+ X"EF",X"1F",X"13",X"07",X"07",X"0F",X"0F",X"07",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FC",X"FC",X"FE",X"FF",X"FF",X"FF",X"FE",X"FC",
+ X"0F",X"07",X"02",X"01",X"03",X"01",X"00",X"00",X"FF",X"FF",X"FF",X"FB",X"FB",X"B9",X"3D",X"18",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"EE",X"80",X"F8",X"F0",X"E0",X"E0",X"80",X"00",X"00",X"00",
+ X"FF",X"FF",X"F8",X"C0",X"00",X"00",X"00",X"00",X"00",X"10",X"01",X"3F",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"00",X"00",X"18",X"00",X"01",X"FF",
+ X"FF",X"FF",X"FE",X"F8",X"C0",X"00",X"00",X"00",X"00",X"90",X"91",X"87",X"FF",X"FF",X"BF",X"BE",
+ X"00",X"00",X"00",X"00",X"10",X"18",X"09",X"8F",X"3F",X"7F",X"FF",X"FF",X"FE",X"F0",X"80",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"11",X"01",X"3F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"F0",X"F0",X"F0",X"F0",X"F8",X"F8",X"F8",X"F8",X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FE",X"FC",X"F8",X"F0",X"F0",X"F0",X"F4",X"F0",X"E0",X"E0",X"E0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"04",X"04",X"04",X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",X"FE",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"04",X"4C",X"28",X"08",X"FC",X"FE",X"FF",
+ X"00",X"00",X"00",X"40",X"82",X"04",X"01",X"FF",X"40",X"60",X"20",X"20",X"20",X"78",X"FE",X"FF",
+ X"40",X"40",X"01",X"03",X"07",X"7F",X"FF",X"FF",X"7F",X"7F",X"7F",X"7F",X"3F",X"3F",X"3F",X"3F",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",
+ X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"01",X"01",X"00",X"00",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"80",X"81",X"87",X"FF",X"FF",X"FF",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"F0",X"C0",X"C0",X"C0",X"E0",X"E0",X"E0",X"E0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"F0",X"F0",X"F0",X"F0",X"F8",X"F8",X"F8",X"F8",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FC",X"FC",X"FC",X"FC",X"FE",X"FE",X"FE",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"C0",X"C0",X"C0",X"C0",X"E0",X"E0",X"E0",X"E0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F0",X"F0",X"F0",X"F0",X"F8",X"F8",X"F8",X"F8",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"C0",X"00",X"00",
+ X"C0",X"80",X"88",X"90",X"83",X"9F",X"FF",X"FF",X"FF",X"FF",X"FE",X"80",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"0C",X"04",X"64",X"05",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"F0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"01",X"83",
+ X"87",X"0F",X"FF",X"FF",X"FF",X"FF",X"FC",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"88",X"C8",X"43",X"5F",X"FF",X"FF",
+ X"FF",X"FF",X"FE",X"F8",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"08",X"08",X"0C",X"C4",X"04",X"05",X"FF",X"BF",X"BF",X"BF",X"BE",
+ X"F0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"00",X"0C",X"00",X"83",
+ X"87",X"0F",X"FF",X"FF",X"FC",X"F0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"10",X"90",X"83",X"9F",X"FF",X"FF",X"FF",X"FC",X"E0",X"80",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"12",X"12",X"18",X"0B",X"8F",X"3F",X"FF",X"FF",X"FF",X"F8",X"E0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"03",X"05",X"00",X"00",X"02",X"04",X"03",X"FF",
+ X"FF",X"FF",X"FF",X"7F",X"07",X"7F",X"FF",X"FF",X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FC",X"F0",X"F0",X"E0",X"E0",X"C0",X"FF",X"FF",X"FF",X"00",X"AA",X"00",X"AA",X"00",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"1F",X"47",X"10",X"FE",X"FF",X"F0",X"FB",X"E0",X"FB",X"C0",X"FF",
+ X"00",X"10",X"00",X"10",X"00",X"18",X"B9",X"B9",X"00",X"6D",X"00",X"6D",X"00",X"6D",X"00",X"FF",
+ X"FF",X"C7",X"83",X"83",X"83",X"83",X"C7",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"07",X"03",X"07",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"9F",X"FF",X"FF",X"FE",X"FC",X"F8",X"F0",X"00",X"00",
+ X"78",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"3F",X"7F",X"2E",X"40",X"2E",X"40",X"3E",X"9F",
+ X"FF",X"FF",X"7F",X"3F",X"1F",X"7F",X"FF",X"FF",X"03",X"07",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"03",X"05",X"00",X"00",X"02",X"04",X"00",X"00",
+ X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"FF",X"02",X"04",X"00",X"00",X"02",X"04",X"03",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"05",X"00",X"00",X"02",X"04",X"03",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"07",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"87",X"FF",
+ X"07",X"FF",X"E7",X"E7",X"E7",X"E7",X"E7",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"DF",X"8F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"03",X"05",X"00",X"00",X"02",X"04",X"03",X"FF",
+ X"03",X"07",X"03",X"01",X"03",X"07",X"03",X"FF",X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",
+ X"FE",X"FC",X"F0",X"F0",X"E0",X"E0",X"C0",X"FF",X"03",X"07",X"03",X"01",X"03",X"07",X"03",X"01",
+ X"EF",X"FF",X"E8",X"FF",X"FF",X"FF",X"FF",X"FF",X"03",X"07",X"03",X"01",X"03",X"07",X"03",X"FF",
+ X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FE",X"FC",X"F0",X"F0",X"E0",X"E0",X"C0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"AA",X"00",X"AA",X"00",X"AA",X"00",X"00",X"FF",X"AA",X"00",X"AA",X"00",X"AA",X"00",X"FF",
+ X"00",X"AA",X"00",X"AA",X"00",X"AA",X"00",X"FF",X"FE",X"FE",X"00",X"AA",X"00",X"AA",X"00",X"00",
+ X"FA",X"FF",X"FF",X"FF",X"FF",X"FE",X"FF",X"FF",X"AA",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"EF",X"F8",X"EF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"03",X"05",X"00",X"00",X"02",X"04",X"03",X"FF",
+ X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"FF",X"03",X"07",X"03",X"01",X"03",X"07",X"03",X"FF",
+ X"03",X"07",X"03",X"01",X"03",X"07",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",
+ X"03",X"05",X"00",X"00",X"00",X"04",X"03",X"FF",X"03",X"07",X"03",X"01",X"03",X"07",X"03",X"FF",
+ X"FE",X"FC",X"F0",X"F0",X"E0",X"E0",X"C0",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",
+ X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"FF",X"FE",X"FC",X"F0",X"F0",X"E0",X"E0",X"C0",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"7F",X"1F",X"1F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"03",X"01",X"00",X"12",X"03",X"03",X"FF",X"FF",X"FF",X"FF",X"70",X"18",X"8A",X"FF",
+ X"FF",X"FF",X"E0",X"1E",X"03",X"31",X"1C",X"07",X"FF",X"FF",X"7E",X"1F",X"8F",X"CF",X"CF",X"EE",
+ X"FC",X"02",X"7F",X"FF",X"FF",X"FF",X"FF",X"3F",X"DF",X"47",X"6F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"03",X"43",X"D7",X"DF",X"7F",X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"9F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"EE",X"FF",X"FF",X"7F",X"BF",X"9F",X"EF",X"F7",
+ X"BF",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",
+ X"01",X"03",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"1F",X"19",X"14",X"05",X"15",X"15",X"15",X"11",
+ X"1F",X"9C",X"9B",X"11",X"14",X"04",X"48",X"48",X"FF",X"1F",X"63",X"81",X"00",X"0C",X"12",X"1A",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"10",X"D0",X"D0",X"10",X"D0",X"D5",X"15",X"D5",
+ X"48",X"44",X"44",X"44",X"08",X"18",X"40",X"40",X"00",X"06",X"09",X"06",X"00",X"0F",X"08",X"00",
+ X"3F",X"0F",X"0F",X"07",X"07",X"03",X"03",X"03",X"0F",X"09",X"06",X"00",X"0F",X"0D",X"08",X"00",
+ X"1E",X"08",X"1E",X"00",X"81",X"62",X"1C",X"C1",X"00",X"00",X"03",X"07",X"07",X"0F",X"1E",X"1E",
+ X"00",X"E0",X"F8",X"FE",X"FF",X"0F",X"07",X"07",X"1A",X"16",X"1E",X"DE",X"DC",X"1C",X"DC",X"D2",
+ X"05",X"06",X"07",X"07",X"03",X"03",X"03",X"00",X"1C",X"DC",X"DC",X"1E",X"DE",X"D6",X"1A",X"1E",
+ X"03",X"03",X"03",X"07",X"07",X"06",X"05",X"07",X"FF",X"1F",X"0F",X"0F",X"0F",X"0E",X"0C",X"0C",
+ X"FF",X"FF",X"FF",X"FF",X"0F",X"47",X"93",X"AB",X"1E",X"1F",X"17",X"17",X"1B",X"1C",X"0F",X"09",
+ X"07",X"0F",X"FF",X"FE",X"F8",X"E4",X"1C",X"FC",X"0C",X"0C",X"0C",X"08",X"08",X"0C",X"0C",X"0C",
+ X"4B",X"03",X"D3",X"07",X"F7",X"07",X"EF",X"4F",X"DF",X"13",X"DF",X"17",X"1E",X"1F",X"0C",X"0F",
+ X"94",X"F4",X"24",X"E4",X"44",X"C2",X"81",X"84",X"0D",X"0C",X"0E",X"0F",X"0F",X"17",X"E7",X"0F",
+ X"2F",X"8F",X"5F",X"1F",X"FF",X"FF",X"FF",X"FF",X"07",X"07",X"07",X"07",X"FF",X"FF",X"40",X"18",
+ X"01",X"02",X"04",X"08",X"13",X"04",X"0B",X"10",X"FF",X"07",X"00",X"F3",X"01",X"01",X"84",X"78",
+ X"03",X"09",X"DC",X"9A",X"DA",X"EA",X"7C",X"3D",X"06",X"00",X"03",X"00",X"01",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"31",X"D7",X"11",X"00",X"E0",X"0B",X"01",X"00",X"27",X"52",X"27",X"00",X"00",
+ X"FF",X"FF",X"7F",X"7F",X"1F",X"7B",X"4F",X"77",X"00",X"00",X"00",X"00",X"60",X"00",X"00",X"60",
+ X"07",X"07",X"63",X"91",X"00",X"E0",X"50",X"E0",X"00",X"60",X"60",X"00",X"60",X"60",X"00",X"60",
+ X"00",X"A0",X"50",X"00",X"F0",X"00",X"F0",X"60",X"FF",X"FF",X"9F",X"1F",X"9F",X"6F",X"9F",X"FF",
+ X"F0",X"00",X"60",X"90",X"60",X"01",X"02",X"00",X"FF",X"FF",X"BF",X"3F",X"7F",X"9F",X"7F",X"0F",
+ X"00",X"00",X"00",X"01",X"00",X"03",X"00",X"06",X"E2",X"01",X"04",X"C4",X"22",X"23",X"65",X"65",
+ X"0F",X"FF",X"7F",X"9F",X"7F",X"3F",X"BF",X"FF",X"30",X"08",X"08",X"04",X"04",X"04",X"08",X"00",
+ X"E6",X"EF",X"7E",X"7E",X"3E",X"3F",X"1F",X"1F",X"9F",X"0E",X"0C",X"08",X"98",X"FC",X"FF",X"FF",
+ X"FF",X"FF",X"7F",X"7F",X"77",X"E3",X"C3",X"C3",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F3",X"E3",X"C7",X"C1",X"81",X"82",X"81",X"80",X"E7",X"FF",X"FF",X"7D",X"58",X"50",X"50",X"41",
+ X"00",X"10",X"04",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"20",X"60",X"60",X"00",X"07",
+ X"81",X"C7",X"C2",X"E0",X"F0",X"F1",X"F7",X"FF",X"9F",X"3F",X"7F",X"F7",X"E3",X"C3",X"C3",X"E7",
+ X"01",X"01",X"03",X"03",X"03",X"07",X"07",X"07",X"F3",X"F8",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"F0",X"F0",X"18",X"C8",X"E0",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FE",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"3F",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"80",X"E0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"1F",X"C7",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"3F",X"0F",X"03",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"FC",X"3F",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"C0",X"F0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"7F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"80",X"80",X"80",X"80",X"C0",X"C0",X"C0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"C0",X"C0",X"E0",X"E0",X"E0",X"E0",X"E0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"0F",X"0F",
+ X"E0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F8",X"DB",X"C3",X"C3",X"C3",X"C3",X"C3",X"C3",X"C3",
+ X"0F",X"0F",X"0F",X"0F",X"07",X"07",X"07",X"07",X"F8",X"F8",X"F8",X"F8",X"F8",X"FC",X"FC",X"FC",
+ X"C3",X"F3",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"07",X"07",X"03",X"03",X"03",X"03",X"03",X"03",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"FC",X"FC",X"FE",X"B6",X"86",X"86",X"86",
+ X"01",X"01",X"01",X"00",X"00",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"F0",X"FC",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",
+ X"78",X"78",X"78",X"38",X"38",X"78",X"78",X"78",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"7F",X"1F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"86",X"87",X"87",X"87",X"87",X"E7",X"FF",X"FE",X"FE",X"FE",X"FE",X"FC",X"FC",X"FC",X"FC",X"F8",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"FF",X"FF",X"3F",X"3F",X"8E",X"E0",X"FF",
+ X"00",X"CF",X"E3",X"38",X"FF",X"FF",X"00",X"FF",X"00",X"FF",X"FF",X"00",X"CF",X"E3",X"F8",X"FF",
+ X"00",X"F3",X"F8",X"FE",X"FF",X"FF",X"FF",X"FF",X"00",X"0F",X"03",X"00",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"FC",X"FF",X"00",X"FF",X"FF",X"FF",X"FF",X"00",X"C7",X"F1",X"FC",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"F3",X"F8",X"FE",X"FF",X"FF",X"FF",X"FF",X"00",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",
+ X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"36",X"30",
+ X"30",X"30",X"30",X"30",X"30",X"30",X"30",X"3C",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",
+ X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"00",X"00",X"F0",X"7C",X"FF",X"3E",X"00",X"FF",X"00",X"00",X"3F",X"1E",X"1F",X"1C",X"1C",
+ X"FF",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",
+ X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1C",X"1C",X"0C",X"0C",X"0C",X"0C",X"0C",X"0C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"04",X"04",X"04",X"04",X"04",X"04",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"78",X"78",X"78",X"F8",X"F8",X"78",X"78",X"F8",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"7F",X"1F",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"01",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"01",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"1F",X"3F",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FD",X"03",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"3F",X"0E",X"0C",X"00",X"0C",X"02",X"0E",X"02",
+ X"FF",X"BF",X"BF",X"3F",X"BF",X"3F",X"BE",X"BE",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"3F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"0F",X"1F",X"7F",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"4E",X"52",X"5E",X"7F",X"FF",X"F1",X"C0",X"2A",
+ X"3F",X"BF",X"BF",X"FF",X"FF",X"60",X"00",X"AA",X"40",X"E0",X"E0",X"F0",X"A8",X"7C",X"52",X"FA",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"70",X"3B",X"9F",X"CF",X"CF",X"EE",X"FF",X"FF",X"FF",X"FF",X"1F",X"CF",X"E7",X"33",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"BE",X"7E",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"5F",X"47",X"EF",X"FF",X"FF",X"FF",X"FF",X"FF",X"1F",X"63",X"81",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"81",X"62",X"1C",X"C1",X"00",X"E0",X"F8",X"FE",X"FF",X"0F",X"67",X"97",
+ X"05",X"E6",X"57",X"E7",X"03",X"A3",X"53",X"00",X"F3",X"03",X"F3",X"67",X"F7",X"06",X"65",X"97",
+ X"67",X"0F",X"FF",X"FE",X"F8",X"E4",X"1C",X"FC",X"FF",X"FF",X"77",X"47",X"03",X"43",X"47",X"77",
+ X"9F",X"0E",X"0C",X"08",X"98",X"FC",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"77",X"E3",X"C3",X"C3",
+ X"E7",X"FF",X"FF",X"7D",X"58",X"50",X"50",X"41",X"9F",X"3F",X"7F",X"F7",X"E3",X"C3",X"C3",X"E7",
+ X"F0",X"F0",X"18",X"C8",X"E0",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",X"09",X"0D",X"00",X"0E",
+ X"00",X"00",X"18",X"18",X"3C",X"3C",X"3C",X"3C",X"05",X"0E",X"40",X"4B",X"2D",X"20",X"18",X"00",
+ X"3C",X"3C",X"7C",X"7C",X"3C",X"3C",X"18",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"0D",X"0F",X"0C",X"1C",X"B9",X"BF",X"FF",X"F7",X"A0",X"80",
+ X"38",X"F0",X"F0",X"C0",X"C7",X"FF",X"A7",X"03",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"C0",
+ X"1F",X"1F",X"3F",X"3E",X"3E",X"3F",X"7F",X"7F",X"80",X"00",X"00",X"02",X"83",X"87",X"05",X"0D",
+ X"07",X"2F",X"BA",X"F0",X"E0",X"E1",X"C3",X"C3",X"E0",X"F0",X"38",X"18",X"C0",X"E0",X"C0",X"F4",
+ X"7E",X"7E",X"7F",X"7F",X"3F",X"3F",X"2F",X"0F",X"0C",X"0C",X"1E",X"9E",X"8F",X"DF",X"DF",X"DD",
+ X"E7",X"C6",X"CC",X"EC",X"FE",X"DE",X"9B",X"19",X"0E",X"1F",X"07",X"0C",X"00",X"08",X"5C",X"F0",
+ X"0F",X"0F",X"0F",X"0B",X"03",X"01",X"01",X"00",X"FD",X"F9",X"F9",X"FC",X"EC",X"E4",X"F4",X"E8",
+ X"58",X"CC",X"EF",X"FD",X"7E",X"3B",X"39",X"08",X"D8",X"00",X"30",X"98",X"00",X"00",X"80",X"C0",
+ X"00",X"00",X"00",X"00",X"01",X"02",X"02",X"04",X"07",X"18",X"60",X"80",X"00",X"00",X"00",X"00",
+ X"C0",X"30",X"08",X"06",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"60",X"10",X"08",
+ X"04",X"04",X"04",X"08",X"08",X"08",X"08",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"04",X"02",X"02",X"02",X"01",X"01",X"01",
+ X"08",X"08",X"08",X"08",X"08",X"08",X"04",X"04",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"02",
+ X"04",X"02",X"02",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"87",X"78",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"80",X"60",X"1C",X"03",X"02",X"02",X"02",X"04",X"04",X"08",X"10",X"E0",
+ X"00",X"00",X"00",X"00",X"10",X"38",X"38",X"11",X"00",X"00",X"40",X"60",X"60",X"20",X"0F",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"10",X"80",X"E0",X"03",X"07",X"07",X"0F",X"0F",X"0F",X"1F",X"3F",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F8",X"F8",X"FC",X"FC",X"FC",X"FC",X"F9",X"F8",
+ X"7E",X"7E",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"F8",X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",X"7F",X"1F",X"0F",X"03",X"01",X"20",X"00",X"18",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"0F",X"01",X"00",X"F8",X"FC",X"FE",X"FE",X"FE",X"FE",X"FC",X"70",
+ X"00",X"00",X"01",X"00",X"30",X"30",X"10",X"03",X"00",X"00",X"00",X"60",X"60",X"42",X"00",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"00",X"07",X"4F",X"1F",X"3F",X"7F",X"7F",X"7F",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"40",X"70",X"F8",X"7C",X"7E",X"7F",X"7F",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"E3",X"F3",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FE",X"FE",X"F8",X"7F",X"3F",X"3F",X"1F",X"5F",X"07",X"11",X"00",
+ X"EF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7E",X"FC",X"FC",X"FC",X"FC",X"FD",X"F9",X"C0",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"C0",X"20",X"18",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"03",X"07",X"0E",X"1C",X"1C",X"38",X"00",X"E0",X"80",X"00",X"3F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"F0",X"F8",X"FC",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"39",X"71",X"73",X"73",X"73",X"E3",X"E7",X"E7",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"FE",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",
+ X"E7",X"E7",X"E7",X"E7",X"E7",X"E7",X"E7",X"E7",X"FF",X"FF",X"F9",X"F8",X"F9",X"FF",X"FF",X"FF",
+ X"FF",X"FF",X"9F",X"0F",X"9F",X"FF",X"FF",X"FF",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",
+ X"00",X"60",X"FC",X"FF",X"FF",X"FF",X"FF",X"E1",X"01",X"01",X"03",X"C7",X"F7",X"FF",X"FF",X"FF",
+ X"F0",X"F0",X"F8",X"F8",X"3C",X"FC",X"9C",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",X"70",X"70",
+ X"00",X"00",X"00",X"01",X"03",X"13",X"7B",X"7F",X"01",X"13",X"BD",X"FF",X"CF",X"97",X"3E",X"3E",
+ X"D8",X"FC",X"E0",X"8D",X"06",X"57",X"FF",X"F9",X"00",X"00",X"00",X"00",X"80",X"80",X"D0",X"F8",
+ X"01",X"01",X"01",X"00",X"00",X"00",X"FF",X"FF",X"9F",X"FF",X"FF",X"FF",X"7B",X"39",X"FF",X"FF",
+ X"BF",X"DE",X"7F",X"BF",X"FF",X"F8",X"FF",X"FF",X"70",X"F0",X"E0",X"C0",X"80",X"00",X"FF",X"FF",
+ X"0F",X"07",X"02",X"01",X"03",X"01",X"FF",X"FF",X"FF",X"FF",X"FF",X"FB",X"FB",X"B9",X"FF",X"FF",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F8",X"F0",X"E0",X"E0",X"80",X"00",X"FF",X"FF");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_palette.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_palette.vhd
new file mode 100644
index 00000000..1324cf03
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_chr_palette.vhd
@@ -0,0 +1,54 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_chr_palette is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(8 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_chr_palette is
+ type rom is array(0 to 511) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"00",X"05",X"07",X"A6",X"F0",X"B8",X"C0",X"E2",X"00",X"FF",X"FF",X"00",X"00",X"00",X"07",X"F8",
+ X"5B",X"FF",X"27",X"28",X"20",X"00",X"9A",X"E8",X"EC",X"FF",X"27",X"28",X"20",X"00",X"9A",X"E8",
+ X"00",X"FF",X"C0",X"A6",X"03",X"E0",X"F8",X"E7",X"00",X"C0",X"E5",X"FF",X"B7",X"07",X"04",X"63",
+ X"00",X"F0",X"E3",X"FF",X"B7",X"07",X"A7",X"60",X"00",X"FF",X"18",X"07",X"EC",X"B8",X"E3",X"88",
+ X"E0",X"FF",X"5B",X"F8",X"04",X"20",X"9B",X"00",X"5B",X"5B",X"FF",X"C0",X"EC",X"00",X"C7",X"FF",
+ X"E0",X"FF",X"5B",X"FF",X"00",X"00",X"38",X"00",X"5B",X"FF",X"5B",X"FF",X"EC",X"00",X"3F",X"00",
+ X"B8",X"00",X"E0",X"F8",X"05",X"E2",X"C0",X"80",X"B8",X"FF",X"5B",X"F8",X"04",X"20",X"9B",X"00",
+ X"F8",X"00",X"B8",X"98",X"EC",X"00",X"00",X"00",X"5B",X"FF",X"B8",X"98",X"EC",X"00",X"60",X"E2",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_sound.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_sound.vhd
new file mode 100644
index 00000000..7bd83583
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_sound.vhd
@@ -0,0 +1,278 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_sound is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(11 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_sound is
+ type rom is array(0 to 4095) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"76",X"BD",X"59",X"10",X"5B",X"00",X"5C",X"01",X"5D",X"0D",X"53",X"00",X"12",X"41",X"08",X"12",
+ X"42",X"08",X"12",X"43",X"08",X"12",X"44",X"08",X"12",X"45",X"08",X"12",X"46",X"08",X"5C",X"0A",
+ X"5D",X"09",X"12",X"47",X"08",X"12",X"48",X"08",X"12",X"49",X"08",X"12",X"4A",X"08",X"12",X"50",
+ X"08",X"12",X"55",X"08",X"12",X"5A",X"08",X"12",X"5F",X"08",X"12",X"64",X"08",X"12",X"69",X"08",
+ X"12",X"6C",X"08",X"12",X"70",X"08",X"12",X"75",X"08",X"12",X"7A",X"08",X"59",X"00",X"5C",X"00",
+ X"77",X"02",X"FF",X"66",X"B9",X"6D",X"14",X"6E",X"0A",X"FE",X"F0",X"74",X"FE",X"F0",X"74",X"FE",
+ X"F0",X"C3",X"FE",X"F0",X"C3",X"FE",X"F0",X"74",X"FE",X"F0",X"74",X"FE",X"F0",X"C3",X"FE",X"F0",
+ X"C3",X"FE",X"F1",X"10",X"42",X"77",X"43",X"00",X"45",X"01",X"69",X"0E",X"6A",X"0E",X"04",X"DD",
+ X"30",X"6A",X"0E",X"69",X"0E",X"02",X"9F",X"30",X"42",X"86",X"69",X"0E",X"6A",X"0E",X"04",X"7A",
+ X"30",X"42",X"77",X"69",X"0E",X"6A",X"0E",X"04",X"7A",X"30",X"42",X"86",X"69",X"0E",X"6A",X"0E",
+ X"04",X"3E",X"30",X"42",X"8E",X"69",X"0E",X"6A",X"0E",X"04",X"3E",X"30",X"42",X"9F",X"69",X"0E",
+ X"6A",X"0E",X"04",X"1C",X"30",X"42",X"77",X"69",X"0E",X"6A",X"0E",X"04",X"1C",X"30",X"69",X"0E",
+ X"6A",X"0E",X"FD",X"42",X"86",X"69",X"0E",X"6A",X"0E",X"45",X"02",X"04",X"16",X"30",X"42",X"B3",
+ X"69",X"0E",X"6A",X"0E",X"04",X"16",X"30",X"42",X"96",X"69",X"0E",X"6A",X"0E",X"45",X"01",X"04",
+ X"A9",X"30",X"42",X"86",X"69",X"0E",X"6A",X"0E",X"04",X"A9",X"30",X"42",X"96",X"69",X"0E",X"6A",
+ X"0E",X"04",X"65",X"30",X"42",X"9F",X"69",X"0E",X"6A",X"0E",X"04",X"65",X"30",X"42",X"B3",X"69",
+ X"0E",X"6A",X"0E",X"04",X"3E",X"30",X"42",X"86",X"69",X"0E",X"6A",X"0E",X"04",X"3E",X"30",X"FD",
+ X"42",X"B3",X"43",X"00",X"69",X"0E",X"44",X"CE",X"45",X"02",X"2A",X"0E",X"30",X"42",X"77",X"69",
+ X"0E",X"2A",X"0E",X"30",X"42",X"6A",X"69",X"0E",X"44",X"38",X"2A",X"0E",X"30",X"42",X"77",X"69",
+ X"0E",X"2A",X"0E",X"30",X"42",X"59",X"69",X"0E",X"44",X"DD",X"45",X"01",X"2A",X"0E",X"30",X"42",
+ X"6A",X"69",X"0E",X"2A",X"0E",X"30",X"42",X"77",X"69",X"0E",X"44",X"38",X"45",X"02",X"2A",X"0E",
+ X"30",X"42",X"6A",X"69",X"0E",X"44",X"CE",X"2A",X"0E",X"30",X"42",X"9F",X"69",X"0E",X"44",X"7D",
+ X"2A",X"0E",X"30",X"42",X"6A",X"69",X"0E",X"2A",X"0E",X"30",X"42",X"5E",X"69",X"0E",X"44",X"FC",
+ X"45",X"01",X"2A",X"0E",X"30",X"42",X"6A",X"69",X"0E",X"2A",X"0E",X"30",X"42",X"4F",X"69",X"0E",
+ X"44",X"A9",X"2A",X"0E",X"30",X"42",X"5E",X"69",X"0E",X"2A",X"0E",X"30",X"42",X"6A",X"69",X"0E",
+ X"44",X"FC",X"2A",X"0E",X"30",X"42",X"9F",X"69",X"0E",X"44",X"7D",X"45",X"02",X"2A",X"0E",X"30",
+ X"42",X"77",X"69",X"0E",X"44",X"DD",X"45",X"01",X"2A",X"0E",X"30",X"42",X"9F",X"69",X"0E",X"2A",
+ X"0E",X"30",X"42",X"86",X"69",X"0E",X"44",X"7A",X"2A",X"0E",X"30",X"42",X"77",X"69",X"0E",X"2A",
+ X"0E",X"30",X"42",X"86",X"69",X"0E",X"44",X"65",X"2A",X"0E",X"30",X"42",X"8E",X"69",X"0E",X"2A",
+ X"0E",X"30",X"42",X"9F",X"69",X"0E",X"44",X"51",X"2A",X"0E",X"30",X"42",X"77",X"69",X"0E",X"2A",
+ X"0E",X"30",X"42",X"4F",X"69",X"0E",X"44",X"3E",X"2A",X"0E",X"30",X"42",X"4F",X"69",X"0E",X"2A",
+ X"0E",X"30",X"67",X"02",X"66",X"B9",X"44",X"1C",X"2A",X"0E",X"30",X"42",X"4F",X"69",X"0E",X"2A",
+ X"0E",X"30",X"44",X"0C",X"2A",X"0E",X"30",X"69",X"0E",X"2A",X"0E",X"30",X"69",X"0E",X"44",X"FD",
+ X"45",X"00",X"2A",X"0E",X"30",X"69",X"0E",X"2A",X"0E",X"30",X"FE",X"F0",X"59",X"66",X"B9",X"43",
+ X"00",X"45",X"02",X"69",X"0E",X"6A",X"0E",X"6C",X"14",X"6D",X"14",X"6E",X"14",X"FE",X"F2",X"C4",
+ X"FE",X"F2",X"C4",X"FE",X"F3",X"09",X"FE",X"F3",X"09",X"FE",X"F3",X"50",X"FE",X"F3",X"50",X"44",
+ X"7A",X"45",X"01",X"69",X"0E",X"6A",X"0E",X"02",X"D4",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"96",
+ X"30",X"44",X"A9",X"69",X"0E",X"6A",X"0E",X"02",X"D4",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"8E",
+ X"30",X"44",X"DD",X"69",X"0E",X"6A",X"0E",X"02",X"D4",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"86",
+ X"30",X"44",X"FC",X"69",X"0E",X"6A",X"0E",X"02",X"D4",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"7E",
+ X"30",X"44",X"7A",X"69",X"0E",X"6A",X"0E",X"02",X"D4",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"7E",
+ X"30",X"44",X"2C",X"69",X"0E",X"6A",X"0E",X"02",X"D4",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"8E",
+ X"30",X"44",X"1C",X"69",X"0E",X"6A",X"0E",X"02",X"D4",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"86",
+ X"30",X"44",X"EE",X"69",X"0E",X"6A",X"0E",X"02",X"D4",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"8E",
+ X"30",X"FE",X"F2",X"2D",X"44",X"38",X"45",X"02",X"69",X"0E",X"6A",X"0E",X"02",X"8E",X"30",X"69",
+ X"0E",X"6A",X"0E",X"02",X"8E",X"30",X"44",X"DD",X"45",X"01",X"69",X"0E",X"6A",X"0E",X"02",X"77",
+ X"30",X"69",X"0E",X"6A",X"0E",X"02",X"8E",X"30",X"44",X"7A",X"69",X"0E",X"6A",X"0E",X"02",X"5E",
+ X"30",X"69",X"0E",X"6A",X"0E",X"02",X"8E",X"30",X"44",X"DD",X"69",X"0E",X"6A",X"0E",X"02",X"77",
+ X"30",X"69",X"0E",X"6A",X"0E",X"02",X"8E",X"30",X"FD",X"44",X"7D",X"45",X"02",X"69",X"0E",X"6A",
+ X"0E",X"02",X"9F",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"9F",X"30",X"44",X"16",X"69",X"0E",X"6A",
+ X"0E",X"02",X"86",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"9F",X"30",X"44",X"A9",X"45",X"01",X"69",
+ X"0E",X"6A",X"0E",X"02",X"6A",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"9F",X"30",X"44",X"16",X"45",
+ X"02",X"69",X"0E",X"6A",X"0E",X"02",X"86",X"30",X"69",X"0E",X"6A",X"0E",X"02",X"9F",X"30",X"FD",
+ X"44",X"CE",X"45",X"02",X"69",X"0E",X"6A",X"0E",X"02",X"B3",X"30",X"69",X"0E",X"6A",X"0E",X"02",
+ X"B3",X"30",X"44",X"38",X"69",X"0E",X"6A",X"0E",X"02",X"8E",X"30",X"69",X"0E",X"6A",X"0E",X"02",
+ X"B3",X"30",X"44",X"DD",X"45",X"01",X"69",X"0E",X"6A",X"0E",X"02",X"77",X"30",X"69",X"0E",X"6A",
+ X"0E",X"02",X"B3",X"30",X"44",X"38",X"45",X"02",X"69",X"0E",X"6A",X"0E",X"02",X"8E",X"30",X"69",
+ X"0E",X"6A",X"0E",X"02",X"B3",X"30",X"FD",X"66",X"B9",X"43",X"00",X"45",X"02",X"69",X"0E",X"6A",
+ X"0E",X"6C",X"14",X"6D",X"14",X"6E",X"14",X"FE",X"F3",X"AD",X"FE",X"F3",X"A7",X"42",X"77",X"45",
+ X"01",X"69",X"0E",X"6A",X"0E",X"04",X"DD",X"30",X"42",X"5E",X"45",X"02",X"69",X"0E",X"6A",X"0E",
+ X"04",X"16",X"30",X"42",X"59",X"69",X"0E",X"6A",X"0E",X"04",X"38",X"30",X"42",X"54",X"69",X"0E",
+ X"6A",X"0E",X"04",X"58",X"30",X"42",X"4F",X"69",X"0E",X"6A",X"0E",X"04",X"7D",X"30",X"42",X"59",
+ X"69",X"0E",X"6A",X"0E",X"04",X"38",X"30",X"42",X"5E",X"69",X"0E",X"6A",X"0E",X"04",X"16",X"30",
+ X"42",X"6A",X"45",X"01",X"69",X"0E",X"6A",X"0E",X"04",X"FC",X"30",X"FD",X"76",X"BB",X"55",X"00",
+ X"54",X"70",X"5A",X"10",X"5B",X"00",X"5C",X"08",X"1D",X"09",X"E0",X"5A",X"00",X"77",X"04",X"FF",
+ X"76",X"BD",X"52",X"20",X"53",X"00",X"19",X"0F",X"60",X"59",X"00",X"77",X"06",X"FF",X"76",X"BD",
+ X"52",X"7F",X"53",X"00",X"19",X"0F",X"30",X"19",X"00",X"90",X"19",X"0F",X"30",X"19",X"00",X"90",
+ X"19",X"0F",X"30",X"19",X"00",X"90",X"52",X"2F",X"19",X"0F",X"70",X"59",X"00",X"77",X"06",X"FF",
+ X"66",X"F8",X"48",X"10",X"49",X"00",X"4B",X"00",X"4C",X"0A",X"20",X"9F",X"00",X"20",X"20",X"5E",
+ X"00",X"20",X"20",X"9F",X"00",X"20",X"20",X"A8",X"00",X"20",X"20",X"64",X"00",X"20",X"20",X"A8",
+ X"00",X"20",X"20",X"B3",X"00",X"20",X"20",X"6A",X"00",X"20",X"20",X"B3",X"00",X"20",X"42",X"77",
+ X"43",X"00",X"6D",X"10",X"69",X"0F",X"20",X"BD",X"00",X"40",X"67",X"02",X"20",X"9F",X"00",X"20",
+ X"20",X"8E",X"00",X"20",X"0D",X"09",X"20",X"20",X"86",X"00",X"80",X"67",X"07",X"FF",X"66",X"FC",
+ X"6C",X"14",X"6D",X"14",X"FE",X"F4",X"CB",X"02",X"1C",X"20",X"40",X"8E",X"68",X"0F",X"29",X"0F",
+ X"20",X"40",X"7E",X"42",X"51",X"68",X"0F",X"29",X"0F",X"40",X"40",X"8E",X"68",X"0F",X"29",X"0F",
+ X"20",X"FE",X"F4",X"CB",X"42",X"FC",X"29",X"0F",X"20",X"29",X"0F",X"20",X"42",X"DD",X"29",X"0F",
+ X"40",X"42",X"C1",X"68",X"0F",X"29",X"0F",X"20",X"FE",X"F4",X"94",X"40",X"6A",X"41",X"00",X"42",
+ X"A9",X"43",X"01",X"68",X"0F",X"29",X"0F",X"40",X"40",X"8E",X"68",X"0F",X"29",X"0F",X"20",X"40",
+ X"7E",X"42",X"51",X"68",X"0F",X"29",X"0F",X"40",X"40",X"77",X"68",X"0F",X"29",X"0F",X"20",X"42",
+ X"1C",X"29",X"0F",X"20",X"FD",X"FE",X"F4",X"94",X"66",X"F8",X"68",X"0F",X"49",X"10",X"4A",X"10",
+ X"4B",X"00",X"4C",X"10",X"6C",X"14",X"FE",X"F5",X"0F",X"FE",X"F5",X"0F",X"67",X"07",X"FF",X"20",
+ X"6A",X"00",X"30",X"20",X"7E",X"00",X"30",X"20",X"8E",X"00",X"30",X"20",X"6A",X"00",X"60",X"FD",
+ X"76",X"BB",X"5A",X"0F",X"55",X"00",X"54",X"58",X"14",X"50",X"04",X"14",X"59",X"04",X"14",X"57",
+ X"04",X"14",X"5F",X"04",X"14",X"56",X"04",X"14",X"55",X"04",X"14",X"59",X"04",X"14",X"56",X"04",
+ X"14",X"5A",X"04",X"14",X"57",X"04",X"14",X"50",X"04",X"14",X"5C",X"04",X"14",X"59",X"04",X"14",
+ X"57",X"04",X"14",X"53",X"04",X"14",X"5C",X"04",X"14",X"58",X"04",X"5A",X"00",X"77",X"04",X"FF",
+ X"76",X"BB",X"55",X"00",X"54",X"38",X"5A",X"0F",X"14",X"36",X"04",X"14",X"38",X"04",X"14",X"36",
+ X"04",X"14",X"3A",X"04",X"14",X"33",X"04",X"14",X"37",X"04",X"14",X"3F",X"04",X"14",X"36",X"04",
+ X"14",X"38",X"04",X"14",X"3C",X"04",X"14",X"34",X"04",X"14",X"39",X"04",X"14",X"3F",X"04",X"14",
+ X"35",X"04",X"14",X"3D",X"04",X"14",X"38",X"04",X"14",X"33",X"04",X"14",X"3F",X"04",X"5A",X"00",
+ X"77",X"04",X"FF",X"76",X"AF",X"59",X"10",X"5C",X"01",X"5D",X"0D",X"16",X"1E",X"01",X"16",X"1D",
+ X"01",X"16",X"1C",X"01",X"16",X"1B",X"01",X"16",X"1A",X"01",X"16",X"19",X"01",X"16",X"18",X"01",
+ X"16",X"17",X"01",X"16",X"16",X"01",X"16",X"15",X"01",X"16",X"14",X"01",X"16",X"13",X"01",X"16",
+ X"12",X"01",X"16",X"11",X"01",X"16",X"10",X"01",X"5B",X"A1",X"5C",X"07",X"5D",X"09",X"16",X"0F",
+ X"01",X"16",X"FE",X"01",X"16",X"0D",X"01",X"16",X"0C",X"01",X"16",X"0B",X"01",X"16",X"0A",X"01",
+ X"16",X"09",X"01",X"16",X"08",X"01",X"16",X"07",X"01",X"16",X"06",X"01",X"16",X"05",X"01",X"16",
+ X"04",X"01",X"16",X"03",X"01",X"16",X"02",X"01",X"16",X"01",X"01",X"56",X"00",X"59",X"00",X"5B",
+ X"00",X"5C",X"00",X"5D",X"00",X"77",X"B8",X"FF",X"76",X"BB",X"55",X"00",X"54",X"70",X"5A",X"10",
+ X"5B",X"00",X"5C",X"10",X"1D",X"09",X"E0",X"5A",X"00",X"77",X"04",X"FF",X"6C",X"14",X"6D",X"14",
+ X"6E",X"0A",X"42",X"DD",X"43",X"01",X"4A",X"10",X"46",X"00",X"4B",X"00",X"4C",X"04",X"66",X"9C",
+ X"FE",X"F6",X"46",X"47",X"BF",X"FF",X"40",X"9F",X"41",X"00",X"42",X"D4",X"43",X"00",X"68",X"0F",
+ X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"40",
+ X"FD",X"42",X"65",X"43",X"01",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",
+ X"09",X"15",X"40",X"EE",X"42",X"3E",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",
+ X"0D",X"09",X"15",X"40",X"E1",X"42",X"2C",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",
+ X"15",X"0D",X"09",X"15",X"40",X"D4",X"42",X"1C",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",
+ X"09",X"15",X"0D",X"09",X"15",X"40",X"BD",X"42",X"FD",X"43",X"00",X"68",X"0F",X"69",X"0F",X"0D",
+ X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",X"15",X"40",X"B3",X"42",X"EE",X"68",X"0F",X"69",X"0F",
+ X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",X"15",X"40",X"A8",X"42",X"E1",X"68",X"0F",X"69",
+ X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",X"15",X"40",X"9F",X"42",X"D4",X"68",X"0F",
+ X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",X"15",X"40",X"7E",X"42",X"B3",X"68",
+ X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",X"15",X"40",X"77",X"42",X"9F",
+ X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",X"15",X"40",X"70",X"42",
+ X"96",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",X"15",X"40",X"6A",
+ X"42",X"8E",X"69",X"0F",X"68",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",X"15",X"40",
+ X"5E",X"42",X"7E",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",X"15",
+ X"40",X"59",X"42",X"77",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",X"09",
+ X"15",X"40",X"54",X"42",X"70",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",X"0D",
+ X"09",X"15",X"40",X"4F",X"42",X"6A",X"68",X"0F",X"69",X"0F",X"0D",X"09",X"15",X"0D",X"09",X"15",
+ X"0D",X"09",X"15",X"FD",X"66",X"F8",X"68",X"0F",X"49",X"10",X"4A",X"10",X"4B",X"00",X"4C",X"10",
+ X"20",X"9F",X"00",X"30",X"20",X"BD",X"00",X"18",X"20",X"EE",X"00",X"48",X"20",X"BD",X"00",X"48",
+ X"20",X"9F",X"00",X"48",X"20",X"77",X"00",X"90",X"20",X"5E",X"00",X"30",X"20",X"6A",X"00",X"18",
+ X"20",X"77",X"00",X"48",X"20",X"BD",X"00",X"48",X"20",X"A8",X"00",X"48",X"20",X"9F",X"00",X"90",
+ X"20",X"9F",X"00",X"24",X"20",X"9F",X"00",X"24",X"20",X"5E",X"00",X"60",X"20",X"6A",X"00",X"18",
+ X"20",X"77",X"00",X"48",X"20",X"7E",X"00",X"90",X"20",X"8E",X"00",X"24",X"20",X"7E",X"00",X"24",
+ X"20",X"77",X"00",X"48",X"20",X"77",X"00",X"48",X"20",X"9F",X"00",X"48",X"20",X"EE",X"00",X"90",
+ X"FE",X"F7",X"80",X"46",X"10",X"66",X"C7",X"48",X"10",X"49",X"10",X"4A",X"10",X"4B",X"00",X"4C",
+ X"0A",X"0D",X"09",X"20",X"67",X"38",X"FF",X"80",X"88",X"08",X"80",X"80",X"80",X"80",X"00",X"81",
+ X"80",X"80",X"90",X"80",X"04",X"41",X"FF",X"8C",X"D7",X"24",X"0A",X"E8",X"08",X"29",X"80",X"22",
+ X"E0",X"81",X"51",X"CC",X"0B",X"42",X"00",X"58",X"A9",X"EA",X"02",X"51",X"29",X"A9",X"BC",X"91",
+ X"27",X"38",X"9A",X"B9",X"0B",X"17",X"03",X"8A",X"C0",X"80",X"00",X"00",X"49",X"B0",X"00",X"60",
+ X"D9",X"0A",X"40",X"00",X"58",X"AA",X"CA",X"15",X"21",X"29",X"AA",X"CE",X"01",X"17",X"08",X"98",
+ X"A8",X"8A",X"15",X"21",X"9A",X"B8",X"00",X"92",X"10",X"7A",X"A0",X"00",X"40",X"E8",X"08",X"28",
+ X"01",X"59",X"9C",X"BA",X"27",X"01",X"29",X"A9",X"CC",X"02",X"37",X"09",X"89",X"B8",X"98",X"26",
+ X"38",X"AA",X"A8",X"08",X"83",X"14",X"3F",X"90",X"80",X"4A",X"98",X"00",X"00",X"02",X"79",X"9D",
+ X"99",X"34",X"02",X"19",X"B9",X"FB",X"12",X"53",X"0A",X"99",X"D8",X"A1",X"27",X"18",X"9A",X"A0",
+ X"09",X"13",X"05",X"0D",X"90",X"00",X"3C",X"80",X"18",X"80",X"02",X"79",X"BB",X"AA",X"72",X"82",
+ X"2A",X"A9",X"FA",X"12",X"43",X"0A",X"9A",X"D9",X"91",X"47",X"09",X"8A",X"90",X"8A",X"32",X"14",
+ X"9C",X"90",X"80",X"3B",X"00",X"5B",X"80",X"02",X"79",X"D8",X"98",X"50",X"83",X"09",X"AB",X"F8",
+ X"14",X"12",X"89",X"9A",X"CB",X"02",X"57",X"88",X"99",X"98",X"89",X"32",X"31",X"AE",X"80",X"80",
+ X"18",X"00",X"5C",X"80",X"02",X"3C",X"C0",X"A2",X"30",X"06",X"0A",X"9E",X"B0",X"25",X"03",X"8A",
+ X"9A",X"DA",X"12",X"72",X"89",X"9B",X"90",X"A0",X"61",X"39",X"9C",X"88",X"00",X"00",X"04",X"0D",
+ X"08",X"03",X"2E",X"90",X"A3",X"10",X"07",X"89",X"AC",X"B1",X"43",X"04",X"8A",X"9C",X"D8",X"12",
+ X"71",X"98",X"9A",X"98",X"91",X"52",X"19",X"9C",X"88",X"09",X"30",X"16",X"AB",X"00",X"03",X"2F",
+ X"88",X"82",X"00",X"87",X"89",X"BA",X"B1",X"71",X"02",X"99",X"9B",X"F0",X"12",X"50",X"89",X"9B",
+ X"8A",X"82",X"72",X"09",X"AB",X"80",X"0A",X"50",X"13",X"CA",X"80",X"04",X"9B",X"00",X"00",X"01",
+ X"07",X"1B",X"E9",X"A3",X"50",X"12",X"9A",X"AF",X"A0",X"25",X"30",X"A9",X"9C",X"8B",X"12",X"72",
+ X"89",X"9B",X"80",X"A1",X"58",X"40",X"C9",X"80",X"04",X"B8",X"01",X"88",X"00",X"17",X"8B",X"B9",
+ X"B7",X"10",X"21",X"9A",X"9F",X"A1",X"24",X"30",X"A9",X"AD",X"9A",X"22",X"72",X"8A",X"9B",X"08",
+ X"B3",X"50",X"48",X"C9",X"08",X"02",X"A0",X"05",X"B8",X"00",X"07",X"8C",X"98",X"95",X"00",X"11",
+ X"99",X"AF",X"91",X"41",X"20",X"A9",X"9D",X"A0",X"13",X"71",X"99",X"9B",X"08",X"A3",X"43",X"2A",
+ X"DA",X"00",X"00",X"81",X"07",X"B8",X"80",X"00",X"00",X"00",X"01",X"F7",X"F7",X"01",X"80",X"00",
+ X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",
+ X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",
+ X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",
+ X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"01",X"F4",X"8D",X"F4",X"8D",X"F4",
+ X"8D",X"F3",X"FC",X"F4",X"10",X"F6",X"18",X"F0",X"00",X"F4",X"1E",X"F5",X"20",X"F5",X"60",X"F0",
+ X"53",X"F5",X"A3",X"F4",X"8E",X"F4",X"40",X"F6",X"2C",X"F4",X"F8",X"F7",X"74",X"F7",X"E3",X"F2",
+ X"1D",X"F3",X"97",X"F4",X"8D",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"8E",X"00",X"FF",X"BD",X"FC",X"7A",X"86",X"BF",X"C6",X"07",X"BD",X"FC",X"BA",X"86",X"13",
+ X"C6",X"0F",X"BD",X"FC",X"BA",X"BD",X"FC",X"8F",X"7F",X"90",X"00",X"0F",X"BD",X"FB",X"C8",X"96",
+ X"BC",X"2B",X"07",X"BD",X"FE",X"C3",X"86",X"FF",X"97",X"BC",X"0E",X"CE",X"00",X"00",X"DF",X"D1",
+ X"96",X"80",X"26",X"0B",X"DE",X"84",X"D6",X"8C",X"BD",X"FD",X"BE",X"DF",X"84",X"97",X"80",X"7C",
+ X"00",X"D2",X"96",X"81",X"26",X"0B",X"DE",X"86",X"D6",X"8D",X"BD",X"FD",X"BE",X"DF",X"86",X"97",
+ X"81",X"7C",X"00",X"D2",X"96",X"82",X"26",X"0B",X"DE",X"88",X"D6",X"8E",X"BD",X"FD",X"BE",X"DF",
+ X"88",X"97",X"82",X"7C",X"00",X"D2",X"96",X"83",X"26",X"0B",X"DE",X"8A",X"D6",X"8F",X"BD",X"FD",
+ X"BE",X"DF",X"8A",X"97",X"83",X"96",X"A8",X"27",X"08",X"7F",X"00",X"A8",X"C6",X"08",X"BD",X"FD",
+ X"1C",X"96",X"A9",X"27",X"08",X"7F",X"00",X"A9",X"C6",X"09",X"BD",X"FD",X"1C",X"96",X"AA",X"27",
+ X"08",X"7F",X"00",X"AA",X"C6",X"0A",X"BD",X"FD",X"1C",X"96",X"AB",X"27",X"08",X"7F",X"00",X"AB",
+ X"C6",X"18",X"BD",X"FD",X"35",X"96",X"AC",X"27",X"08",X"7F",X"00",X"AC",X"C6",X"19",X"BD",X"FD",
+ X"35",X"96",X"AD",X"27",X"08",X"7F",X"00",X"AD",X"C6",X"1A",X"BD",X"FD",X"35",X"96",X"BE",X"16",
+ X"9A",X"D8",X"0F",X"97",X"D8",X"54",X"24",X"09",X"D6",X"CB",X"C1",X"02",X"26",X"03",X"5C",X"D7",
+ X"BC",X"C6",X"0F",X"BD",X"FC",X"C0",X"7E",X"FA",X"9B",X"96",X"C1",X"B7",X"08",X"01",X"96",X"C2",
+ X"B7",X"08",X"02",X"7C",X"00",X"BD",X"96",X"BF",X"4C",X"97",X"BF",X"44",X"24",X"32",X"DE",X"C3",
+ X"09",X"27",X"1E",X"DF",X"C3",X"DE",X"C7",X"A6",X"00",X"44",X"44",X"44",X"44",X"97",X"C1",X"DE",
+ X"C5",X"09",X"27",X"15",X"DF",X"C5",X"DE",X"C9",X"A6",X"00",X"44",X"44",X"44",X"44",X"97",X"C2",
+ X"3B",X"86",X"01",X"9A",X"BE",X"97",X"BE",X"20",X"E6",X"86",X"02",X"9A",X"BE",X"97",X"BE",X"3B",
+ X"96",X"C7",X"81",X"A0",X"25",X"09",X"DE",X"C7",X"A6",X"00",X"97",X"C1",X"08",X"DF",X"C7",X"96",
+ X"C9",X"81",X"A0",X"25",X"09",X"DE",X"C9",X"A6",X"00",X"97",X"C2",X"08",X"DF",X"C9",X"96",X"BF",
+ X"84",X"0E",X"26",X"CC",X"7C",X"00",X"C0",X"3B",X"96",X"C0",X"27",X"41",X"7A",X"00",X"C0",X"BD",
+ X"FC",X"19",X"96",X"80",X"27",X"06",X"4C",X"27",X"03",X"7A",X"00",X"80",X"96",X"81",X"27",X"06",
+ X"4C",X"27",X"03",X"7A",X"00",X"81",X"96",X"82",X"27",X"06",X"4C",X"27",X"03",X"7A",X"00",X"82",
+ X"96",X"83",X"27",X"06",X"4C",X"27",X"03",X"7A",X"00",X"83",X"CE",X"00",X"06",X"A6",X"AD",X"27",
+ X"09",X"4A",X"26",X"04",X"6C",X"A7",X"A6",X"B3",X"A7",X"AD",X"09",X"26",X"F0",X"39",X"C6",X"17",
+ X"96",X"BB",X"8A",X"B1",X"97",X"BB",X"7E",X"FC",X"C0",X"96",X"D9",X"98",X"DA",X"27",X"13",X"96",
+ X"D9",X"97",X"DA",X"27",X"E9",X"C6",X"17",X"96",X"BB",X"8A",X"BE",X"84",X"BE",X"97",X"BB",X"BD",
+ X"FC",X"C0",X"DE",X"DC",X"96",X"DB",X"91",X"DC",X"27",X"2F",X"2A",X"08",X"09",X"09",X"09",X"09",
+ X"09",X"7E",X"FC",X"47",X"C6",X"0A",X"3A",X"DF",X"DC",X"96",X"D9",X"27",X"C0",X"D6",X"09",X"D4",
+ X"7F",X"3A",X"DF",X"D5",X"96",X"D5",X"C6",X"11",X"BD",X"FC",X"C0",X"96",X"D6",X"C6",X"10",X"BD",
+ X"FC",X"C0",X"86",X"0F",X"C6",X"18",X"7E",X"FC",X"C0",X"7F",X"00",X"D9",X"39",X"B7",X"90",X"00",
+ X"C6",X"0E",X"BD",X"FD",X"02",X"84",X"3F",X"97",X"BC",X"3B",X"CE",X"FF",X"FF",X"DF",X"00",X"C6",
+ X"4F",X"08",X"86",X"00",X"A7",X"80",X"08",X"5A",X"26",X"FA",X"86",X"13",X"97",X"D8",X"39",X"BD",
+ X"FC",X"A5",X"86",X"BF",X"97",X"BB",X"C6",X"FF",X"D7",X"82",X"D7",X"B1",X"D7",X"B2",X"D7",X"B3",
+ X"C6",X"17",X"7E",X"FC",X"C0",X"86",X"BF",X"97",X"BA",X"C6",X"FF",X"D7",X"80",X"D7",X"81",X"D7",
+ X"AE",X"D7",X"AF",X"D7",X"B0",X"C6",X"07",X"7E",X"FC",X"C0",X"7C",X"00",X"BD",X"20",X"04",X"0F",
+ X"7F",X"00",X"BD",X"37",X"36",X"C1",X"10",X"2A",X"19",X"86",X"0D",X"97",X"03",X"D7",X"02",X"C6",
+ X"08",X"D7",X"03",X"5C",X"32",X"97",X"02",X"96",X"BD",X"27",X"FC",X"D7",X"03",X"5A",X"D7",X"03",
+ X"33",X"39",X"86",X"15",X"97",X"03",X"C4",X"0F",X"D7",X"02",X"C6",X"10",X"20",X"E3",X"37",X"20",
+ X"E4",X"37",X"86",X"15",X"97",X"03",X"C4",X"0F",X"D7",X"02",X"C6",X"14",X"20",X"0D",X"C1",X"10",
+ X"2A",X"EF",X"37",X"86",X"0D",X"97",X"03",X"D7",X"02",X"C6",X"0C",X"4F",X"97",X"03",X"97",X"00",
+ X"D7",X"03",X"96",X"02",X"5F",X"D7",X"03",X"5A",X"D7",X"00",X"33",X"39",X"0F",X"BD",X"FD",X"02",
+ X"C6",X"09",X"7F",X"00",X"BD",X"84",X"1F",X"81",X"10",X"2A",X"08",X"4A",X"81",X"07",X"2B",X"03",
+ X"BD",X"FC",X"EE",X"0E",X"39",X"0F",X"BD",X"FC",X"F1",X"C6",X"11",X"20",X"E5",X"17",X"84",X"0F",
+ X"81",X"08",X"2A",X"08",X"A6",X"94",X"AB",X"98",X"A7",X"94",X"20",X"67",X"CB",X"38",X"DE",X"CD",
+ X"A6",X"05",X"36",X"DE",X"D1",X"AB",X"94",X"A7",X"94",X"32",X"2B",X"0C",X"24",X"02",X"6C",X"98",
+ X"BD",X"FC",X"BF",X"5C",X"A6",X"94",X"20",X"4B",X"25",X"F6",X"6A",X"98",X"20",X"F2",X"6F",X"8C",
+ X"DE",X"CD",X"C1",X"A0",X"2B",X"02",X"08",X"08",X"08",X"08",X"08",X"C1",X"C0",X"2B",X"08",X"17",
+ X"84",X"0F",X"81",X"08",X"2B",X"01",X"08",X"86",X"01",X"39",X"DF",X"CD",X"DE",X"D1",X"6A",X"90",
+ X"27",X"DC",X"C1",X"A0",X"2A",X"10",X"C4",X"1F",X"A6",X"94",X"36",X"DE",X"CD",X"A6",X"03",X"BD",
+ X"FC",X"BF",X"0E",X"32",X"08",X"39",X"C1",X"C0",X"2A",X"93",X"A6",X"90",X"44",X"A6",X"94",X"25",
+ X"02",X"A6",X"98",X"C4",X"1F",X"BD",X"FC",X"BF",X"0E",X"DE",X"CD",X"A6",X"04",X"39",X"26",X"CA",
+ X"DF",X"CD",X"E6",X"00",X"2A",X"03",X"7E",X"FE",X"75",X"C4",X"3F",X"C1",X"20",X"2A",X"11",X"A6",
+ X"01",X"BD",X"FC",X"BF",X"0E",X"E6",X"00",X"08",X"08",X"58",X"2B",X"E4",X"A6",X"00",X"08",X"39",
+ X"C4",X"1F",X"17",X"84",X"0F",X"26",X"31",X"A6",X"01",X"97",X"CE",X"A6",X"02",X"97",X"CD",X"BD",
+ X"FE",X"B6",X"DC",X"CD",X"04",X"DD",X"CD",X"E6",X"00",X"C4",X"1F",X"5C",X"5C",X"BD",X"FE",X"B6",
+ X"7C",X"00",X"CE",X"26",X"03",X"7C",X"00",X"CD",X"BD",X"FE",X"B6",X"CB",X"07",X"86",X"09",X"BD",
+ X"FC",X"C0",X"0E",X"E6",X"00",X"08",X"20",X"BF",X"80",X"08",X"2B",X"29",X"DD",X"CF",X"84",X"03",
+ X"C1",X"30",X"2B",X"02",X"8B",X"03",X"16",X"A6",X"01",X"CE",X"00",X"00",X"3A",X"D6",X"CF",X"C1",
+ X"04",X"2A",X"0B",X"A6",X"B4",X"A7",X"AE",X"DE",X"CD",X"D6",X"D0",X"7E",X"FD",X"CF",X"A7",X"B4",
+ X"DE",X"CD",X"7E",X"FD",X"D5",X"4C",X"27",X"17",X"5C",X"C1",X"10",X"2A",X"09",X"96",X"BA",X"A4",
+ X"01",X"97",X"BA",X"7E",X"FD",X"D1",X"96",X"BB",X"A4",X"01",X"97",X"BB",X"7E",X"FD",X"D1",X"C1",
+ X"10",X"2A",X"09",X"96",X"BA",X"AA",X"01",X"97",X"BA",X"7E",X"FD",X"D1",X"96",X"BB",X"AA",X"01",
+ X"97",X"BB",X"7E",X"FD",X"D1",X"C1",X"F0",X"2A",X"17",X"A6",X"01",X"EE",X"02",X"3C",X"DE",X"D1",
+ X"E7",X"8C",X"4C",X"A7",X"90",X"32",X"A7",X"94",X"32",X"A7",X"98",X"DE",X"CD",X"86",X"01",X"39",
+ X"5C",X"27",X"12",X"DE",X"D1",X"5C",X"26",X"10",X"DC",X"CD",X"A7",X"9C",X"E7",X"A0",X"DE",X"CD",
+ X"EE",X"01",X"86",X"01",X"39",X"86",X"FF",X"39",X"A6",X"9C",X"E6",X"A0",X"DD",X"CD",X"DE",X"CD",
+ X"08",X"08",X"08",X"86",X"01",X"39",X"96",X"CE",X"BD",X"FC",X"BF",X"5C",X"96",X"CD",X"BD",X"FC",
+ X"C0",X"5C",X"39",X"26",X"0E",X"BD",X"FC",X"7A",X"7F",X"00",X"D9",X"CE",X"0F",X"00",X"DF",X"DC",
+ X"7E",X"FC",X"8F",X"81",X"0E",X"2B",X"03",X"7E",X"FF",X"0F",X"97",X"CB",X"96",X"D8",X"8A",X"01",
+ X"16",X"C4",X"FE",X"D7",X"D8",X"C6",X"0F",X"BD",X"FC",X"C0",X"86",X"05",X"7F",X"00",X"BD",X"D6",
+ X"BD",X"27",X"FC",X"4A",X"26",X"F6",X"D6",X"CB",X"58",X"58",X"CE",X"F9",X"77",X"3A",X"3C",X"EE",
+ X"00",X"DF",X"C7",X"38",X"EE",X"02",X"DF",X"C3",X"96",X"BE",X"84",X"02",X"97",X"BE",X"39",X"16",
+ X"58",X"CE",X"F9",X"9F",X"3A",X"EE",X"00",X"81",X"10",X"2B",X"21",X"27",X"6F",X"81",X"16",X"2A",
+ X"1C",X"D6",X"82",X"5C",X"27",X"06",X"91",X"A6",X"27",X"02",X"2A",X"10",X"97",X"A6",X"DF",X"88",
+ X"7F",X"00",X"82",X"7F",X"00",X"8E",X"C6",X"B8",X"DA",X"BB",X"D7",X"BB",X"39",X"81",X"18",X"27",
+ X"26",X"81",X"1A",X"2A",X"11",X"DF",X"8A",X"97",X"A7",X"7F",X"00",X"83",X"7F",X"00",X"8F",X"86",
+ X"BE",X"9A",X"BB",X"97",X"BB",X"39",X"81",X"20",X"2A",X"1E",X"3C",X"36",X"BD",X"FC",X"7A",X"7F",
+ X"00",X"D9",X"BD",X"FC",X"8F",X"32",X"38",X"DF",X"84",X"97",X"A4",X"7F",X"00",X"80",X"7F",X"00",
+ X"8C",X"86",X"BE",X"9A",X"BA",X"97",X"BA",X"39",X"81",X"22",X"2A",X"03",X"7E",X"FF",X"67",X"80",
+ X"20",X"97",X"DB",X"39",X"81",X"0E",X"26",X"08",X"7F",X"00",X"D9",X"39",X"86",X"03",X"97",X"DC",
+ X"86",X"0C",X"97",X"DB",X"86",X"01",X"97",X"D9",X"39",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FA",X"80",X"FA",X"80",X"FA",X"80",X"FA",X"80",X"FC",X"6D",X"FA",X"80",X"FB",X"59",X"FA",X"80");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_bit1.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_bit1.vhd
new file mode 100644
index 00000000..cb329a7b
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_bit1.vhd
@@ -0,0 +1,534 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_spr_bit1 is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(12 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_spr_bit1 is
+ type rom is array(0 to 8191) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"3F",X"7F",X"7F",X"7F",X"7F",X"3E",X"19",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"19",X"3E",X"7F",X"7F",X"7F",X"7F",X"3F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"C1",X"C1",X"C1",X"C1",X"C0",X"C0",X"E0",X"E0",X"E1",X"F7",X"FF",X"FF",X"1F",X"08",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"83",X"03",X"FF",X"FF",X"FC",X"0A",X"00",X"00",
+ X"00",X"00",X"08",X"1F",X"FF",X"FF",X"F7",X"E1",X"E0",X"E0",X"C0",X"C0",X"C1",X"C1",X"C1",X"C1",
+ X"00",X"00",X"0A",X"FC",X"FF",X"FF",X"03",X"83",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"87",X"87",X"87",X"87",X"87",X"CF",X"FF",X"FF",X"3F",X"F9",X"F8",X"FE",X"3E",X"0C",X"00",X"00",
+ X"80",X"80",X"80",X"80",X"80",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"07",X"03",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"01",X"1F",X"0C",X"6D",X"DF",X"CF",X"FF",X"F7",X"E7",X"03",X"00",X"00",X"01",X"01",X"00",
+ X"FE",X"BE",X"3C",X"28",X"80",X"C0",X"80",X"03",X"03",X"27",X"7F",X"FF",X"F8",X"FF",X"87",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"E0",X"FC",X"FE",X"FE",X"FE",X"BA",X"80",X"F0",X"F0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"07",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"BC",X"FE",X"FE",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"07",X"03",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"01",X"1F",X"0C",X"6D",X"DF",X"CF",X"FF",X"F7",X"E7",X"03",X"00",X"00",X"01",X"01",X"00",
+ X"FC",X"FC",X"78",X"50",X"80",X"C0",X"80",X"03",X"07",X"0F",X"7F",X"FF",X"F8",X"FF",X"87",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"E0",X"FC",X"FE",X"FE",X"FE",X"BA",X"80",X"F0",X"F0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"07",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"60",X"F8",X"FC",X"FC",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"03",X"07",X"07",X"03",X"01",X"03",X"06",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1B",X"3B",X"C9",X"8E",X"FE",X"FC",X"EF",X"EF",X"57",X"11",X"07",X"0F",X"0F",X"1E",X"18",X"00",
+ X"A0",X"00",X"00",X"00",X"00",X"00",X"10",X"7E",X"FE",X"FF",X"BF",X"2D",X"C1",X"F0",X"3C",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"07",X"3F",X"7F",X"7F",X"7F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"C0",X"E0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"03",X"07",X"07",X"03",X"01",X"03",X"06",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"3E",X"CA",X"8E",X"FE",X"FC",X"EF",X"EF",X"57",X"11",X"07",X"0F",X"0F",X"1C",X"19",X"00",
+ X"40",X"00",X"00",X"00",X"00",X"00",X"30",X"7E",X"FE",X"FF",X"BF",X"2D",X"C1",X"F0",X"3C",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0E",X"3F",X"7F",X"7F",X"7F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"C0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"2D",X"7F",X"4C",X"9E",X"9E",X"9E",X"9E",X"9E",X"9E",X"9E",X"9E",X"4C",X"7F",X"2D",X"00",
+ X"00",X"00",X"80",X"80",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"80",X"80",X"00",X"00",
+ X"00",X"12",X"7F",X"33",X"61",X"61",X"61",X"61",X"61",X"61",X"61",X"61",X"33",X"7F",X"12",X"00",
+ X"00",X"00",X"80",X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"00",X"80",X"00",X"00",
+ X"01",X"01",X"01",X"01",X"02",X"02",X"03",X"03",X"01",X"01",X"03",X"03",X"01",X"00",X"00",X"00",
+ X"E0",X"14",X"3E",X"F6",X"E4",X"04",X"44",X"E0",X"E0",X"E0",X"E0",X"C0",X"80",X"40",X"C0",X"C0",
+ X"00",X"01",X"01",X"01",X"02",X"02",X"03",X"03",X"01",X"01",X"03",X"03",X"01",X"00",X"00",X"00",
+ X"F0",X"14",X"9E",X"F6",X"E4",X"04",X"44",X"E0",X"E0",X"E0",X"E0",X"C0",X"80",X"40",X"C0",X"C0",
+ X"FF",X"FF",X"FF",X"7F",X"0F",X"0C",X"08",X"00",X"00",X"03",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"07",X"03",X"81",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FE",X"FE",X"E1",X"05",X"64",X"7C",X"26",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"08",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"26",X"7C",X"64",X"05",X"E1",X"FE",X"FE",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",
+ X"FE",X"FE",X"FE",X"E1",X"05",X"64",X"7C",X"26",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"20",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"26",X"7C",X"64",X"05",X"E1",X"FE",X"FE",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",
+ X"0E",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"0B",X"1F",X"1F",X"1F",X"1F",X"1F",
+ X"00",X"00",X"00",X"00",X"00",X"E0",X"F8",X"F0",X"F0",X"F0",X"E0",X"E0",X"E0",X"F0",X"F8",X"70",
+ X"7F",X"FF",X"FF",X"DB",X"E1",X"30",X"82",X"67",X"7A",X"FC",X"3C",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"C0",X"C0",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"37",X"7F",X"7E",X"FF",X"FF",X"7F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"E0",
+ X"7F",X"FF",X"FF",X"DB",X"E1",X"30",X"82",X"67",X"7A",X"FC",X"3C",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"C0",X"C0",X"80",X"80",X"00",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"1F",X"0F",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"F0",X"F0",X"F8",X"E0",X"80",X"00",X"00",X"60",X"20",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"33",X"3F",X"0F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"0F",X"3F",X"33",X"01",
+ X"00",X"40",X"80",X"80",X"C0",X"F0",X"80",X"80",X"80",X"80",X"F0",X"C0",X"80",X"80",X"40",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"40",X"40",X"01",X"40",X"F1",X"E3",X"E3",X"E3",X"E3",X"F1",X"40",X"01",X"40",X"40",X"00",
+ X"00",X"00",X"20",X"E0",X"60",X"F0",X"F8",X"E0",X"E0",X"F8",X"F0",X"60",X"E0",X"20",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"08",X"0E",X"1C",X"3C",X"3C",X"1C",X"0E",X"08",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"10",X"70",X"30",X"70",X"F0",X"F0",X"70",X"30",X"70",X"10",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"0F",X"0F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"08",X"9C",X"1C",X"38",X"1C",X"9C",X"08",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"08",X"18",X"30",X"18",X"08",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"04",X"04",X"00",X"06",X"0F",X"3F",X"7F",X"7F",X"7F",X"7F",X"3F",X"0F",X"06",X"00",X"04",X"04",
+ X"00",X"0C",X"0F",X"03",X"8F",X"1E",X"1E",X"1E",X"1F",X"1F",X"0F",X"83",X"0F",X"0C",X"00",X"00",
+ X"40",X"C0",X"E0",X"E0",X"F0",X"D0",X"C0",X"C0",X"C0",X"F0",X"F0",X"E0",X"E0",X"60",X"20",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"07",X"0F",X"0F",X"07",X"01",X"07",X"00",X"00",X"00",
+ X"1F",X"1F",X"0F",X"1B",X"13",X"57",X"FF",X"FF",X"FF",X"FF",X"FF",X"F8",X"18",X"1C",X"1C",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"0F",
+ X"FC",X"FC",X"FC",X"FC",X"E4",X"C1",X"C1",X"81",X"82",X"80",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"C0",X"80",X"00",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"70",X"F8",X"C8",X"01",X"01",X"01",X"01",X"F3",X"F9",X"F9",X"FC",
+ X"00",X"00",X"00",X"00",X"30",X"78",X"F8",X"FC",X"F8",X"E0",X"E0",X"E0",X"E0",X"C0",X"D0",X"F0",
+ X"0F",X"07",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F8",X"F0",X"F0",X"EC",X"7E",X"5F",X"73",X"7D",X"FF",X"E6",X"60",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",X"0F",X"0F",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"E7",X"FF",
+ X"FC",X"FC",X"FE",X"FE",X"7E",X"FE",X"DE",X"8C",X"00",X"00",X"01",X"03",X"07",X"1C",X"38",X"00",
+ X"00",X"00",X"00",X"00",X"1E",X"3E",X"FF",X"FF",X"FB",X"F1",X"E0",X"C0",X"F0",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"00",X"E0",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"E0",X"60",X"20",
+ X"7F",X"FF",X"FF",X"7F",X"1F",X"0F",X"07",X"01",X"00",X"00",X"01",X"04",X"06",X"03",X"01",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"04",X"2E",X"2E",X"2E",X"3E",X"1E",X"1F",X"1F",X"1F",X"0F",X"1E",X"3E",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FC",X"F8",X"70",X"06",X"8F",X"FF",X"7F",X"3F",X"1B",X"0C",X"04",X"00",X"00",X"00",X"00",
+ X"18",X"30",X"00",X"00",X"00",X"C0",X"E0",X"E0",X"F0",X"F0",X"70",X"78",X"70",X"20",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"30",X"F8",X"38",X"00",X"38",X"7C",X"FC",X"FC",X"FE",X"FE",X"FE",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"38",X"38",X"18",
+ X"C7",X"CF",X"6F",X"27",X"23",X"30",X"3F",X"3F",X"3F",X"2F",X"2F",X"07",X"01",X"03",X"07",X"0F",
+ X"F8",X"F8",X"F0",X"E0",X"86",X"06",X"06",X"0C",X"18",X"80",X"80",X"80",X"80",X"80",X"80",X"00",
+ X"00",X"00",X"19",X"3F",X"3F",X"0F",X"0F",X"0F",X"1F",X"1F",X"0F",X"0F",X"07",X"81",X"80",X"80",
+ X"7C",X"F8",X"F8",X"F0",X"E0",X"E0",X"B0",X"9C",X"9E",X"8E",X"F0",X"F8",X"F8",X"F8",X"F8",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"1E",X"3E",X"7E",X"7C",X"FE",X"FE",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"06",X"1B",X"3D",X"7C",X"7C",X"7C",X"7E",X"7F",X"7F",X"3F",X"03",X"01",
+ X"E0",X"70",X"38",X"00",X"00",X"07",X"07",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"3F",X"37",X"01",
+ X"18",X"18",X"18",X"58",X"F8",X"F0",X"F0",X"F0",X"B0",X"B0",X"B0",X"80",X"80",X"E0",X"E0",X"E0",
+ X"10",X"10",X"10",X"19",X"0F",X"03",X"87",X"C7",X"E7",X"F7",X"F3",X"FA",X"E8",X"C4",X"C8",X"C0",
+ X"20",X"E0",X"E0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F1",X"23",X"03",X"03",X"16",X"1C",X"18",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"41",X"E2",X"E7",X"F7",X"7C",X"08",
+ X"00",X"00",X"00",X"00",X"60",X"40",X"C0",X"80",X"82",X"06",X"04",X"CC",X"E8",X"F8",X"D0",X"30",
+ X"00",X"00",X"01",X"01",X"03",X"03",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"C7",X"E3",X"F3",X"F3",X"F3",X"F3",X"F3",X"E7",X"FF",X"1F",X"0E",X"06",X"02",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"80",X"C0",X"E0",X"E0",X"E0",X"E0",X"31",X"1F",X"0F",X"0F",X"3F",X"7F",
+ X"1C",X"0C",X"80",X"80",X"C0",X"60",X"31",X"15",X"1F",X"0E",X"06",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"E0",X"FE",X"F0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"07",X"0E",X"0C",X"18",X"01",X"07",X"1C",X"70",X"E0",X"20",X"20",X"B0",X"B8",X"BC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"1F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"17",X"07",X"04",X"00",X"00",X"00",X"00",X"00",
+ X"2C",X"3E",X"3E",X"3E",X"C7",X"E5",X"E5",X"C6",X"02",X"02",X"02",X"00",X"00",X"00",X"00",X"00",
+ X"02",X"02",X"00",X"00",X"00",X"00",X"80",X"80",X"C0",X"40",X"60",X"20",X"00",X"00",X"00",X"00",
+ X"E7",X"E7",X"C7",X"C7",X"C3",X"83",X"83",X"83",X"81",X"C1",X"C1",X"01",X"00",X"00",X"00",X"00",
+ X"80",X"80",X"80",X"C0",X"C0",X"C0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E8",X"F8",X"7C",X"7C",X"36",
+ X"03",X"06",X"0C",X"18",X"18",X"11",X"11",X"10",X"18",X"78",X"70",X"18",X"08",X"08",X"6C",X"F6",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"A0",X"38",X"38",X"18",X"08",X"00",X"00",X"00",X"00",X"00",
+ X"3F",X"3F",X"3F",X"3F",X"3F",X"1F",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E1",X"E1",X"E1",X"E0",X"F0",X"FC",X"F8",X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"03",X"03",X"1F",X"3F",
+ X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"60",X"E0",X"E0",X"E0",X"E1",
+ X"FF",X"FF",X"FF",X"FF",X"3E",X"CE",X"CF",X"1E",X"FC",X"FC",X"FE",X"47",X"03",X"02",X"00",X"00",
+ X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"40",X"C0",X"C3",X"80",X"00",X"01",X"03",X"00",X"00",X"18",X"18",X"70",X"F9",X"FF",X"FF",
+ X"00",X"00",X"00",X"FC",X"FE",X"FE",X"CE",X"3C",X"70",X"00",X"00",X"00",X"00",X"C0",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"3F",X"7F",X"7F",X"7F",X"7F",X"3E",X"18",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"18",X"3E",X"7F",X"7F",X"7F",X"7F",X"3F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"C1",X"C1",X"C1",X"C1",X"C0",X"C0",X"E0",X"E0",X"E1",X"F7",X"FF",X"FF",X"1F",X"48",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"83",X"03",X"FF",X"FF",X"FC",X"08",X"00",X"00",
+ X"00",X"00",X"48",X"1F",X"FF",X"FF",X"F7",X"E1",X"E0",X"E0",X"C0",X"C0",X"C1",X"C1",X"C1",X"C1",
+ X"00",X"00",X"08",X"FC",X"FF",X"FF",X"03",X"83",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"87",X"87",X"87",X"87",X"87",X"CF",X"FF",X"FF",X"3F",X"F9",X"F8",X"FE",X"3E",X"8C",X"00",X"00",
+ X"80",X"80",X"80",X"80",X"80",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"03",X"00",X"00",X"01",X"03",X"03",X"03",X"01",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"40",X"00",X"00",X"00",
+ X"00",X"00",X"03",X"07",X"0F",X"00",X"00",X"00",X"60",X"20",X"20",X"20",X"20",X"60",X"60",X"60",
+ X"00",X"00",X"80",X"C0",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FF",X"9F",X"07",X"03",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"1F",X"F7",X"E1",X"F8",X"FE",X"3F",X"0F",X"03",X"00",X"00",
+ X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FE",X"FE",
+ X"C0",X"FC",X"FF",X"FF",X"F7",X"E3",X"C3",X"C1",X"81",X"81",X"03",X"03",X"07",X"07",X"07",X"0F",
+ X"FC",X"FC",X"F8",X"F8",X"F8",X"FC",X"7C",X"67",X"FF",X"FF",X"FF",X"3F",X"0F",X"07",X"03",X"00",
+ X"3C",X"3C",X"3C",X"78",X"78",X"78",X"F8",X"F0",X"F8",X"F0",X"20",X"20",X"C0",X"80",X"00",X"00",
+ X"C0",X"F8",X"FE",X"3F",X"0F",X"C7",X"F7",X"FE",X"FF",X"FF",X"FF",X"FF",X"FE",X"FE",X"FC",X"FC",
+ X"00",X"00",X"00",X"80",X"F8",X"FC",X"FC",X"70",X"F2",X"FE",X"FE",X"1E",X"1E",X"1F",X"1E",X"1C",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"03",X"07",X"07",X"03",X"03",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"DF",X"1F",X"10",X"10",X"00",
+ X"01",X"03",X"03",X"07",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"07",X"03",X"03",
+ X"FF",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"7F",X"7F",X"C7",X"80",X"80",X"00",X"00",X"80",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"06",X"07",X"07",X"03",X"03",X"03",X"01",X"01",X"01",
+ X"00",X"00",X"10",X"10",X"3F",X"FF",X"7F",X"7F",X"F0",X"E0",X"E0",X"E0",X"B0",X"BF",X"BF",X"FF",
+ X"F8",X"F8",X"F8",X"FC",X"7F",X"79",X"60",X"30",X"18",X"0F",X"07",X"03",X"00",X"00",X"00",X"00",
+ X"0F",X"0F",X"0F",X"0F",X"0F",X"DF",X"FF",X"3F",X"1E",X"FC",X"F1",X"FB",X"7F",X"7C",X"00",X"00",
+ X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",
+ X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"0F",X"1F",X"3F",X"7F",X"7F",X"FF",X"FE",X"F8",
+ X"04",X"0E",X"00",X"02",X"07",X"3F",X"FF",X"DF",X"FF",X"FF",X"FF",X"FF",X"FF",X"9F",X"0F",X"0F",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"EF",X"EF",X"66",X"F1",X"FF",X"FF",X"FE",X"60",X"00",X"00",
+ X"88",X"F8",X"F8",X"F8",X"F8",X"98",X"98",X"F8",X"F0",X"E0",X"C0",X"80",X"00",X"00",X"00",X"00",
+ X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FF",
+ X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"08",X"08",X"08",X"08",X"08",X"08",
+ X"00",X"3F",X"FF",X"6F",X"EF",X"E6",X"F1",X"FF",X"FF",X"FE",X"FE",X"FC",X"FC",X"FE",X"FE",X"FE",
+ X"38",X"FC",X"F8",X"F8",X"98",X"98",X"F8",X"F8",X"18",X"08",X"08",X"08",X"08",X"08",X"08",X"08",
+ X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"F0",X"F8",X"CE",X"47",X"61",X"3F",X"1F",X"0F",X"03",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",
+ X"03",X"0F",X"3F",X"7F",X"FF",X"FF",X"FD",X"F0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FD",X"CC",X"1E",X"3F",X"CF",X"00",
+ X"87",X"80",X"80",X"80",X"C0",X"E0",X"F8",X"F8",X"F8",X"E8",X"E8",X"B0",X"70",X"E0",X"80",X"00",
+ X"FC",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"A8",X"78",X"C8",X"80",X"80",X"00",X"00",X"80",X"80",X"87",X"87",X"87",X"87",X"87",X"87",X"87",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C7",X"1F",X"0D",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"FC",X"F8",X"E8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",X"0F",X"0F",X"04",X"06",X"03",X"01",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"07",X"0F",X"0F",X"0E",X"0E",X"0E",X"0E",
+ X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"DF",X"7F",X"3B",X"F7",X"E7",X"7F",X"00",X"00",
+ X"C3",X"C3",X"C3",X"C0",X"C0",X"C0",X"E0",X"F8",X"F8",X"E8",X"E8",X"F8",X"F0",X"E0",X"00",X"00",
+ X"00",X"00",X"00",X"19",X"07",X"1B",X"7F",X"FF",X"FF",X"FF",X"FF",X"9F",X"1F",X"1F",X"1F",X"1F",
+ X"00",X"00",X"18",X"FC",X"F8",X"E8",X"E8",X"F8",X"E0",X"C0",X"80",X"C0",X"C0",X"C3",X"C3",X"C3",
+ X"33",X"73",X"73",X"73",X"73",X"73",X"73",X"73",X"7B",X"7F",X"27",X"31",X"1F",X"07",X"00",X"00",
+ X"F0",X"F3",X"F3",X"F3",X"F3",X"F3",X"F0",X"FC",X"FC",X"F8",X"FC",X"FC",X"F8",X"F0",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"1F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F8",X"FC",X"F8",X"FC",X"F0",
+ X"00",X"00",X"01",X"03",X"06",X"06",X"06",X"06",X"06",X"06",X"06",X"06",X"03",X"01",X"00",X"00",
+ X"1C",X"7E",X"FC",X"3E",X"3C",X"38",X"39",X"39",X"39",X"39",X"38",X"3C",X"3E",X"FC",X"7E",X"1C",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"1C",X"7E",X"DE",X"9C",X"98",X"99",X"99",X"98",X"9C",X"DE",X"7E",X"1C",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"0E",X"1E",X"36",X"34",X"34",X"34",X"34",X"36",X"1E",X"06",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"06",X"0A",X"0A",X"0A",X"0A",X"06",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"80",X"80",X"80",X"80",X"80",X"80",X"C0",X"40",X"4C",X"4F",X"6F",X"6F",X"2F",X"2F",X"07",X"03",
+ X"08",X"08",X"08",X"08",X"08",X"08",X"08",X"08",X"0C",X"0E",X"CF",X"FF",X"FF",X"FF",X"FF",X"FE",
+ X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"7F",X"E7",X"FF",X"FE",X"FC",X"00",X"00",
+ X"FE",X"FF",X"FF",X"FF",X"FF",X"CF",X"0E",X"0C",X"08",X"08",X"08",X"08",X"08",X"08",X"08",X"08",
+ X"00",X"00",X"FC",X"FE",X"FF",X"E7",X"7F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",
+ X"E0",X"E0",X"E0",X"FF",X"FF",X"FF",X"E0",X"60",X"60",X"7F",X"7F",X"7F",X"70",X"FE",X"FE",X"7F",
+ X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"80",
+ X"7F",X"FF",X"FF",X"7F",X"60",X"60",X"60",X"7F",X"7F",X"FF",X"E0",X"E0",X"E0",X"FF",X"FF",X"FF",
+ X"80",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"03",
+ X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FE",
+ X"03",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",
+ X"FE",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1C",X"3E",X"63",X"5D",X"5D",X"5D",X"5D",X"63",X"3E",X"1C",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1C",X"3E",X"7F",X"7D",X"41",X"41",X"6D",X"7F",X"3E",X"1E",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1C",X"3E",X"65",X"45",X"51",X"59",X"49",X"6D",X"3E",X"1C",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1C",X"3E",X"6B",X"41",X"55",X"5D",X"49",X"6B",X"3E",X"1C",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1C",X"3E",X"7B",X"41",X"41",X"4B",X"63",X"73",X"3E",X"1C",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1C",X"3E",X"73",X"51",X"55",X"45",X"45",X"7F",X"3E",X"1C",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1C",X"3E",X"7B",X"51",X"55",X"55",X"41",X"63",X"3E",X"1C",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1E",X"3E",X"4F",X"47",X"51",X"59",X"5F",X"4F",X"3E",X"1C",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1C",X"3E",X"6B",X"51",X"55",X"55",X"45",X"6B",X"3E",X"1C",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"1C",X"3E",X"63",X"41",X"55",X"55",X"45",X"6F",X"3E",X"1C",X"00",X"00",X"00",
+ X"07",X"0C",X"1B",X"1B",X"1B",X"0C",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"30",X"D8",X"D8",X"D8",X"30",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"0C",X"1E",X"1E",X"1E",X"0E",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"38",X"78",X"78",X"38",X"70",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"08",X"1E",X"18",X"19",X"0C",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"10",X"38",X"F8",X"98",X"30",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"0C",X"19",X"1C",X"19",X"0C",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"30",X"98",X"F8",X"98",X"30",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"0C",X"18",X"1C",X"1C",X"0C",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"F0",X"18",X"98",X"38",X"70",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"0C",X"19",X"18",X"1F",X"0C",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"30",X"F8",X"38",X"38",X"30",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"0C",X"19",X"1C",X"1F",X"0C",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"30",X"98",X"18",X"98",X"30",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"1E",X"1E",X"1C",X"19",X"08",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"70",X"78",X"F8",X"D8",X"10",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"0C",X"19",X"1C",X"1B",X"0C",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"30",X"D8",X"38",X"98",X"30",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"0C",X"19",X"18",X"19",X"0C",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"30",X"F8",X"38",X"98",X"30",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"20",X"14",X"5C",X"0F",X"1B",X"77",X"94",X"20",X"84",X"10",X"42",X"90",X"05",X"20",X"0A",X"00",
+ X"00",X"00",X"00",X"00",X"E0",X"00",X"00",X"00",X"00",X"80",X"12",X"40",X"08",X"21",X"00",X"88",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0A",X"20",X"05",X"90",X"42",X"10",X"84",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"88",X"00",X"21",X"08",X"40",X"12",X"80",X"00",
+ X"20",X"68",X"F0",X"90",X"18",X"98",X"F0",X"50",X"00",X"00",X"20",X"00",X"00",X"00",X"00",X"40",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"00",X"00",X"00",X"00",X"00",X"20",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"1F",X"3F",X"7F",X"7F",X"E0",X"E0",X"E0",X"F0",X"FF",X"7F",X"7F",X"3F",
+ X"00",X"00",X"00",X"00",X"F0",X"F8",X"F8",X"FC",X"3C",X"1C",X"1C",X"1C",X"F8",X"F8",X"F0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"7F",X"FF",X"FF",X"7F",X"30",X"20",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FC",X"FC",X"FC",X"F8",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"1E",X"3F",X"7F",X"FF",X"E7",X"E3",X"E3",X"F1",X"F9",X"F8",X"78",X"30",
+ X"00",X"00",X"00",X"00",X"0C",X"1C",X"9C",X"9C",X"DC",X"DC",X"FC",X"FC",X"FC",X"FC",X"7C",X"18",
+ X"00",X"00",X"00",X"00",X"1C",X"3E",X"7F",X"FF",X"EF",X"E7",X"E7",X"F6",X"F8",X"F8",X"78",X"30",
+ X"00",X"00",X"00",X"00",X"70",X"F8",X"FC",X"FC",X"3C",X"1C",X"1C",X"1C",X"3C",X"78",X"70",X"60",
+ X"02",X"82",X"92",X"92",X"92",X"FE",X"FE",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"70",X"F8",X"88",X"88",X"88",X"FE",X"FE",X"00",X"FE",X"FE",X"70",X"38",X"70",X"FE",X"FE",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"E0",X"F0",X"1E",X"1E",X"F0",X"E0",X"00",X"00",X"80",X"80",X"FE",X"FE",X"80",X"80",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0E",X"1F",X"1F",X"3F",X"3F",X"3F",X"3F",X"1F",X"3F",X"3F",X"3F",X"1F",X"07",X"07",X"03",X"01",
+ X"6C",X"7E",X"FE",X"FE",X"FC",X"FC",X"FE",X"FF",X"FF",X"FF",X"FE",X"FC",X"FC",X"FC",X"F8",X"B0",
+ X"E0",X"F8",X"FE",X"FF",X"FF",X"E7",X"40",X"00",X"40",X"E7",X"FF",X"FF",X"FE",X"F8",X"E0",X"40",
+ X"00",X"00",X"00",X"80",X"E0",X"F8",X"FE",X"3F",X"FE",X"F8",X"E0",X"80",X"00",X"00",X"00",X"00",
+ X"40",X"00",X"40",X"E7",X"FF",X"FF",X"FE",X"F8",X"E0",X"40",X"E0",X"FF",X"FF",X"FF",X"E0",X"40",
+ X"FE",X"3F",X"FE",X"F8",X"E0",X"80",X"00",X"00",X"00",X"02",X"07",X"FF",X"FF",X"FF",X"07",X"02",
+ X"00",X"00",X"01",X"07",X"1F",X"7F",X"FC",X"7F",X"1F",X"47",X"E1",X"F8",X"FE",X"FF",X"FF",X"E7",
+ X"1F",X"7F",X"FF",X"FF",X"F7",X"72",X"70",X"72",X"F7",X"FF",X"FF",X"7F",X"1F",X"87",X"E2",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"78",X"FF",X"FF",X"FF",X"78",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",X"0F",X"CF",X"0F",X"06",X"00",X"02",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"0F",X"1F",X"1F",X"0F",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"18",X"38",X"38",X"10",X"30",X"EF",X"FE",X"FE",X"FE",X"FE",X"EF",X"30",X"10",X"38",X"38",X"18",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"0F",X"1F",X"3F",X"0F",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"18",X"38",X"38",X"10",X"30",X"EF",X"FE",X"FE",X"FE",X"FE",X"EF",X"30",X"10",X"38",X"38",X"18",
+ X"00",X"00",X"00",X"18",X"3C",X"7E",X"FE",X"FE",X"FE",X"FE",X"7E",X"3C",X"18",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"7C",X"7F",X"7F",X"7F",X"7F",X"7C",X"00",X"00",X"00",X"00",X"00",
+ X"0D",X"1F",X"1F",X"0F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"EE",X"FE",X"FE",X"FE",X"7E",X"7F",X"7F",X"73",X"30",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7C",X"FC",X"FE",X"FE",X"7E",X"3E",X"FC",X"FC",X"18",X"01",X"03",X"3F",X"70",X"70",X"E0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"7E",X"FF",X"FF",X"FF",X"FD",X"FC",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F7",X"41",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"07",X"07",X"03",X"09",X"03",X"06",
+ X"00",X"00",X"00",X"00",X"00",X"06",X"0E",X"2E",X"7C",X"78",X"F8",X"F7",X"FF",X"FF",X"FF",X"FF",
+ X"FE",X"8C",X"00",X"00",X"81",X"07",X"1F",X"3F",X"7B",X"38",X"70",X"60",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"E0",X"FE",X"FE",X"FF",X"FF",X"FB",X"FD",X"3C",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"3C",X"7E",X"7E",X"7F",X"3F",X"9F",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"17",X"07",X"03",X"01",X"03",X"06",
+ X"00",X"00",X"00",X"00",X"00",X"06",X"0E",X"2E",X"7C",X"78",X"F8",X"F7",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"0F",X"1F",X"3F",X"0F",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"18",X"38",X"38",X"10",X"30",X"ED",X"FB",X"FB",X"FB",X"FB",X"ED",X"30",X"10",X"38",X"38",X"18",
+ X"00",X"00",X"00",X"30",X"78",X"FC",X"FC",X"FC",X"FC",X"FC",X"FC",X"78",X"30",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"7C",X"7F",X"7F",X"7F",X"7F",X"7C",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"0F",X"1F",X"5F",X"0F",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"18",X"38",X"38",X"10",X"30",X"ED",X"FB",X"FB",X"FB",X"FB",X"ED",X"30",X"10",X"38",X"38",X"18",
+ X"00",X"00",X"00",X"30",X"7C",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"7C",X"30",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"7C",X"7F",X"7F",X"7F",X"7F",X"7C",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"0F",X"1F",X"1F",X"0F",X"01",X"07",X"0C",X"00",
+ X"00",X"18",X"39",X"3B",X"33",X"A3",X"E1",X"EC",X"FF",X"FF",X"FF",X"FF",X"FF",X"3E",X"38",X"18",
+ X"00",X"00",X"F0",X"FC",X"FE",X"FE",X"FE",X"FE",X"FE",X"FC",X"D8",X"80",X"00",X"01",X"0F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"1E",X"7F",X"7F",X"7F",X"F9",X"F0",X"FC",X"FC",
+ X"38",X"70",X"60",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"13",X"06",X"0C",X"00",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"D8",X"CE",X"47",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"0D",X"1F",X"1F",X"4F",
+ X"00",X"00",X"00",X"00",X"00",X"19",X"3B",X"3F",X"B3",X"E1",X"E4",X"EF",X"FF",X"FF",X"FF",X"F9",
+ X"00",X"00",X"01",X"07",X"3F",X"3F",X"78",X"38",X"70",X"60",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7F",X"FB",X"F1",X"C0",X"FC",X"FC",X"00",X"00",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"F0",X"F8",X"FC",X"FE",X"FE",X"FE",X"FE",X"DC",X"8C",X"88",X"88",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"7E",X"7E",X"7F",
+ X"03",X"26",X"0C",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"D8",X"CE",X"47",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"0D",X"1F",X"3F",X"0F",
+ X"00",X"00",X"00",X"00",X"00",X"19",X"3B",X"3B",X"B3",X"E1",X"E4",X"EF",X"FF",X"FF",X"FF",X"F9",
+ X"00",X"00",X"01",X"07",X"3F",X"3F",X"78",X"38",X"70",X"60",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7F",X"FB",X"F1",X"C0",X"FC",X"FC",X"00",X"00",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"F0",X"FC",X"FE",X"FF",X"FF",X"FF",X"FF",X"DE",X"8E",X"8C",X"88",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"7E",X"7E",X"7F",
+ X"00",X"00",X"00",X"07",X"07",X"0F",X"1F",X"07",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"30",X"11",X"31",X"FD",X"FF",X"FF",X"FF",X"FF",X"FD",X"31",X"11",X"30",X"30",X"10",X"00",X"00",
+ X"00",X"00",X"E0",X"F0",X"F8",X"F8",X"F8",X"F8",X"F0",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"FC",X"FF",X"FF",X"FF",X"FF",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"38",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"0F",X"0F",X"1F",X"5F",X"0F",X"0F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"38",X"12",X"33",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"33",X"12",X"38",X"38",X"18",X"00",X"00",
+ X"00",X"00",X"C0",X"E0",X"F0",X"F0",X"F0",X"F0",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"FC",X"FF",X"FF",X"FF",X"FF",X"FC",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"38",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"01",X"01",X"0F",X"1F",X"1F",X"0F",X"01",X"07",X"0C",X"00",X"00",X"00",X"00",
+ X"3F",X"3F",X"BF",X"FF",X"DF",X"CF",X"FF",X"FE",X"FC",X"DE",X"7E",X"38",X"18",X"00",X"00",X"00",
+ X"E0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F1",X"61",X"43",X"07",X"1F",X"3F",X"1C",X"38",X"30",X"00",
+ X"00",X"00",X"00",X"00",X"3E",X"FF",X"FF",X"FF",X"F9",X"F0",X"FC",X"FC",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"3B",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"01",X"01",X"07",X"0F",X"0F",X"17",X"01",X"01",X"03",X"06",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"DF",X"CF",X"FF",X"F6",X"E4",X"E2",X"61",X"20",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"F0",X"F0",X"F0",X"E0",X"70",X"61",X"01",X"03",X"04",X"1F",X"1F",X"3C",X"1C",X"38",X"30",
+ X"00",X"00",X"1E",X"FE",X"FF",X"FF",X"FB",X"C1",X"40",X"7C",X"FC",X"C0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"3B",X"3F",X"BF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"E0",X"F0",
+ X"01",X"01",X"01",X"01",X"0F",X"1F",X"1F",X"0F",X"41",X"03",X"06",X"0C",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"DF",X"CF",X"FF",X"FF",X"FE",X"99",X"C0",X"C0",X"40",X"00",X"00",X"00",X"00",X"00",
+ X"F8",X"F8",X"F8",X"F8",X"F0",X"30",X"21",X"01",X"03",X"04",X"1F",X"1F",X"3C",X"1C",X"38",X"30",
+ X"00",X"00",X"1E",X"FF",X"FF",X"FF",X"F9",X"C0",X"40",X"7C",X"FC",X"C0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"39",X"3D",X"BF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"F0",X"F8",
+ X"00",X"00",X"00",X"00",X"0C",X"1F",X"1F",X"0F",X"0F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0C",X"1C",X"14",X"10",X"BB",X"FF",X"FE",X"FE",X"DE",X"CE",X"60",X"20",X"70",X"70",X"30",X"00",
+ X"00",X"00",X"00",X"18",X"3C",X"7E",X"FE",X"FE",X"FE",X"FE",X"7E",X"3C",X"18",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"7C",X"7E",X"7F",X"7F",X"7F",X"7D",X"FC",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"5B",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"0F",X"2F",X"07",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0C",X"1C",X"3C",X"78",X"78",X"F8",X"F7",X"EF",X"3F",X"FF",X"FF",
+ X"FE",X"CC",X"80",X"00",X"01",X"07",X"1F",X"1F",X"7B",X"38",X"70",X"60",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"E0",X"FE",X"FE",X"FF",X"FF",X"FB",X"FD",X"3C",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"3C",X"7E",X"7E",X"7F",X"3F",X"9F",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1D",X"1C",X"0C",X"04",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"3F",X"1F",X"07",X"03",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"10",X"18",X"1C",X"1C",X"1D",
+ X"7F",X"7F",X"6F",X"6F",X"6D",X"6D",X"2F",X"4F",X"67",X"73",X"73",X"37",X"5F",X"7F",X"7F",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"47",X"63",X"70",X"78",X"3C",X"1C",X"6E",X"77",X"7F",X"7F",X"1F",X"43",X"60",X"78",X"7C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"78",X"7C",X"7E",X"3F",X"1F",X"47",X"63",X"78",X"7C",X"7D",X"7D",X"6D",X"6D",X"7D",X"7D",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"6F",X"6D",X"6D",X"6F",X"6F",X"6F",X"6F",X"7D",X"7D",X"3D",X"5D",X"65",X"71",X"70",X"30",X"58",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"08",X"0C",X"0F",X"4F",X"6F",X"7F",X"7D",X"7D",X"7F",X"6F",X"6F",X"7F",X"7D",X"3F",X"1F",X"4F",
+ X"F0",X"90",X"80",X"80",X"E0",X"F0",X"F0",X"F0",X"F0",X"90",X"80",X"80",X"80",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"10",X"98",X"9E",X"9F",X"9F",X"8F",X"97",X"91",X"80",X"80",X"80",X"80",X"80",X"C0",X"F0",X"F0",
+ X"1F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"3F",X"1F",X"07",X"03",X"00",X"00",X"00",
+ X"9F",X"9F",X"8F",X"87",X"01",X"00",X"10",X"18",X"1E",X"9F",X"9F",X"8F",X"87",X"01",X"00",X"00",
+ X"E3",X"E3",X"E3",X"E3",X"E3",X"E3",X"23",X"03",X"03",X"03",X"C0",X"E0",X"F8",X"FD",X"FF",X"3F",
+ X"00",X"00",X"00",X"90",X"98",X"9C",X"9C",X"9C",X"1C",X"1C",X"9C",X"9C",X"9C",X"9C",X"9C",X"9E",
+ X"FF",X"7F",X"3F",X"1F",X"0F",X"07",X"03",X"C1",X"E0",X"F8",X"FC",X"FF",X"FF",X"FF",X"E7",X"E3",
+ X"E0",X"F0",X"F3",X"F3",X"B3",X"BB",X"BF",X"BF",X"9F",X"9F",X"9F",X"9F",X"8F",X"87",X"03",X"01",
+ X"00",X"00",X"00",X"F0",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"80",X"A0",X"B0",X"B0",X"B0",X"B0",X"B0",X"F0",X"F0",X"F0",X"F0",X"90",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"90",X"80",X"80",X"80",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"A0",X"80",X"80",X"40",X"D0",X"D0",X"D0",X"D0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"F0",X"F0",X"F0",X"B0",X"80",X"80",X"80",X"80",X"00",X"00",X"00",X"00",X"80",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"F0",X"F0",X"F0",X"F0",X"F0",X"80",X"80",X"80",X"80",X"C0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"39",X"38",X"38",X"38",X"18",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E7",X"F7",X"F7",X"7F",X"3F",X"3F",X"1F",X"0F",X"0F",X"07",X"03",X"03",X"01",X"00",X"00",X"00",
+ X"00",X"0C",X"0E",X"0E",X"2E",X"32",X"30",X"38",X"3C",X"3C",X"3E",X"3F",X"3F",X"3F",X"3B",X"3B",
+ X"FB",X"7F",X"3F",X"8F",X"C7",X"F1",X"F8",X"7E",X"3F",X"0F",X"07",X"01",X"06",X"87",X"C7",X"C7",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"CF",X"C7",X"F3",X"FB",X"7F",X"3F",X"8F",X"C7",X"F1",X"F8",X"FE",X"FF",X"CF",X"C7",X"F3",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"C0",X"E0",X"F0",X"78",X"38",X"1C",X"EE",X"FF",X"FF",X"FF",X"0F",X"80",X"C0",X"F0",X"F8",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E6",X"E7",X"E7",X"E3",X"E0",X"E0",X"E0",X"60",X"60",X"20",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"C0",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"06",X"06",X"06",X"C6",X"E6",X"F6",X"F6",X"36",X"1E",X"0E",X"0E",X"0E",X"06",X"06",X"26",X"E6",
+ X"FF",X"7F",X"3F",X"0F",X"07",X"01",X"00",X"00",X"40",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",
+ X"0E",X"06",X"06",X"06",X"06",X"06",X"06",X"C6",X"E6",X"F6",X"F6",X"36",X"16",X"06",X"06",X"06",
+ X"03",X"03",X"03",X"83",X"C3",X"F1",X"F8",X"FE",X"FF",X"FF",X"EF",X"E7",X"E7",X"E7",X"F7",X"FF",
+ X"06",X"06",X"06",X"06",X"06",X"06",X"06",X"06",X"86",X"C6",X"E6",X"F6",X"78",X"3C",X"1C",X"0E",
+ X"C3",X"C3",X"C3",X"C3",X"43",X"03",X"03",X"03",X"03",X"01",X"00",X"02",X"03",X"03",X"03",X"03",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"06",X"06",X"06",X"06",
+ X"00",X"00",X"00",X"02",X"03",X"03",X"03",X"03",X"03",X"83",X"C3",X"C3",X"C3",X"C1",X"C0",X"C2",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0C",X"3F",X"FF",X"FF",X"FF",X"FF",X"FC",X"3C",X"1C",X"04",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FC",X"7C",X"7C",X"6C",X"6C",X"7C",X"7C",X"3C",X"18",X"00",X"60",X"FC",X"FC",X"FC",X"FC",X"9C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7F",X"F7",X"E3",X"FB",X"FD",X"7D",X"3F",X"DF",X"EF",X"FF",X"FC",X"3C",X"1F",X"C7",X"E3",X"F8",
+ X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"80",X"80",X"80",
+ X"40",X"60",X"78",X"7C",X"7D",X"FD",X"ED",X"ED",X"FD",X"7D",X"7F",X"FF",X"EF",X"FF",X"FC",X"7C",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"00");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_bit2.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_bit2.vhd
new file mode 100644
index 00000000..bc771f52
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_bit2.vhd
@@ -0,0 +1,534 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_spr_bit2 is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(12 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_spr_bit2 is
+ type rom is array(0 to 8191) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"3C",X"3F",X"3F",X"3F",X"1F",X"07",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"07",X"1F",X"3F",X"3F",X"3F",X"3C",X"20",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"41",X"41",X"41",X"41",X"40",X"40",X"60",X"20",X"21",X"17",X"FE",X"FF",X"FF",X"E8",X"E0",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"83",X"03",X"07",X"FF",X"FF",X"0F",X"07",X"00",
+ X"00",X"E0",X"E8",X"FF",X"FF",X"FE",X"17",X"21",X"20",X"60",X"40",X"40",X"41",X"41",X"41",X"41",
+ X"00",X"07",X"0F",X"FF",X"FF",X"07",X"03",X"83",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"83",X"83",X"83",X"83",X"83",X"C7",X"F7",X"FF",X"1F",X"3F",X"FE",X"FE",X"FE",X"EC",X"E0",X"00",
+ X"80",X"80",X"80",X"80",X"80",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"01",X"13",X"19",X"78",X"D0",X"08",X"1B",X"77",X"C5",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FF",X"FF",X"FF",X"3F",X"3F",X"7E",X"FC",X"FC",X"D8",X"80",X"00",X"00",X"3F",X"07",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"02",X"02",X"82",X"80",X"F0",X"F0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"04",X"04",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"1C",X"38",X"BC",X"7E",X"3E",X"BE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"01",X"13",X"19",X"78",X"D0",X"08",X"1B",X"77",X"C5",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FF",X"FF",X"FF",X"77",X"3F",X"7E",X"FC",X"F8",X"F0",X"80",X"00",X"00",X"3F",X"07",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"02",X"02",X"82",X"80",X"F0",X"F0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"04",X"04",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"38",X"70",X"F8",X"7C",X"3E",X"BE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"06",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"37",X"FF",X"38",X"31",X"33",X"63",X"C7",X"0D",X"0E",X"08",X"01",X"01",X"02",X"00",X"00",
+ X"E0",X"F0",X"F0",X"F8",X"F8",X"F0",X"E0",X"80",X"00",X"01",X"01",X"21",X"C1",X"F0",X"3C",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"07",X"3F",X"47",X"43",X"7B",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"C0",X"80",X"80",X"80",X"C0",X"C0",X"E0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"06",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"37",X"FF",X"38",X"31",X"33",X"63",X"C7",X"0D",X"0E",X"08",X"01",X"01",X"00",X"01",X"00",
+ X"E0",X"F0",X"F0",X"F0",X"F0",X"E0",X"C0",X"80",X"00",X"01",X"01",X"21",X"C1",X"F0",X"3C",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"07",X"0F",X"3F",X"47",X"43",X"7B",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"00",X"00",X"00",X"80",X"80",X"C0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"12",X"00",X"33",X"61",X"61",X"61",X"61",X"61",X"61",X"61",X"61",X"33",X"00",X"12",X"00",
+ X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"00",X"00",
+ X"00",X"2D",X"00",X"4C",X"9E",X"9E",X"9E",X"9E",X"9E",X"9E",X"9E",X"9E",X"4C",X"00",X"2D",X"00",
+ X"00",X"00",X"00",X"80",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"80",X"00",X"00",X"00",
+ X"01",X"00",X"00",X"00",X"03",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"01",X"00",X"00",
+ X"80",X"40",X"30",X"08",X"18",X"F8",X"B8",X"18",X"18",X"18",X"18",X"30",X"70",X"B0",X"20",X"00",
+ X"00",X"00",X"01",X"00",X"03",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"01",X"00",X"00",
+ X"30",X"40",X"80",X"08",X"18",X"F8",X"B8",X"18",X"18",X"18",X"18",X"30",X"70",X"B0",X"20",X"00",
+ X"1F",X"FF",X"FF",X"7F",X"0F",X"0F",X"0F",X"07",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"F8",X"F8",X"FC",X"FC",X"7C",X"3E",X"8E",X"CE",X"E7",X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"0E",X"0E",X"0E",X"01",X"19",X"98",X"80",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"08",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"80",X"98",X"19",X"01",X"0E",X"0E",X"0E",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",
+ X"0E",X"0E",X"0E",X"01",X"19",X"98",X"80",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"20",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"80",X"98",X"19",X"01",X"0E",X"0E",X"0E",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",
+ X"0F",X"03",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"CF",X"CF",X"DF",X"FE",X"FC",X"FA",X"7F",X"3F",X"07",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"0B",X"1F",X"1F",X"0F",X"03",X"13",
+ X"00",X"00",X"00",X"00",X"70",X"F9",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"F7",X"EF",
+ X"81",X"01",X"03",X"03",X"01",X"0C",X"0E",X"87",X"82",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"C0",X"C0",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"0C",X"3E",X"DE",X"FD",X"FB",X"FB",X"F6",X"C0",X"80",X"80",X"00",X"00",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"60",X"60",X"00",X"80",X"C0",
+ X"81",X"01",X"03",X"03",X"01",X"0C",X"0E",X"87",X"82",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"C0",X"C0",X"80",X"80",X"00",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"1F",X"0F",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"E7",X"FB",X"FD",X"7C",X"78",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"C0",X"E1",X"9B",X"3C",X"24",X"24",X"24",X"24",X"3C",X"9B",X"E1",X"C0",X"C0",X"00",
+ X"00",X"40",X"80",X"80",X"C0",X"70",X"00",X"00",X"00",X"00",X"70",X"C0",X"80",X"80",X"40",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"70",X"76",X"6F",X"FE",X"FD",X"FD",X"FD",X"FD",X"FE",X"6F",X"76",X"70",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"20",X"F0",X"D8",X"40",X"40",X"D8",X"F0",X"20",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"03",X"0E",X"0F",X"1F",X"3F",X"3F",X"1F",X"0F",X"0E",X"03",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"90",X"B0",X"A0",X"40",X"40",X"A0",X"B0",X"90",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"03",X"07",X"0F",X"0F",X"03",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"C0",X"B0",X"EC",X"F4",X"E0",X"F4",X"EC",X"B0",X"C0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"08",X"1E",X"3C",X"1E",X"08",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"07",X"07",X"07",X"0F",X"3F",X"7F",X"7F",X"7F",X"7F",X"3F",X"0F",X"07",X"07",X"07",X"01",
+ X"80",X"D0",X"B0",X"78",X"F6",X"EE",X"E8",X"E8",X"E9",X"EF",X"F6",X"F8",X"70",X"B0",X"C0",X"80",
+ X"00",X"00",X"20",X"60",X"F0",X"10",X"00",X"00",X"00",X"30",X"F0",X"60",X"20",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"07",X"00",X"00",X"00",
+ X"1F",X"17",X"07",X"03",X"00",X"00",X"00",X"00",X"81",X"86",X"20",X"E0",X"01",X"17",X"1F",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"07",X"0F",X"0F",X"0F",
+ X"FF",X"FF",X"FF",X"BF",X"3F",X"3E",X"3E",X"7E",X"78",X"38",X"70",X"E0",X"C0",X"80",X"00",X"00",
+ X"60",X"40",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"38",X"38",X"B8",X"F8",X"FC",X"FE",X"FE",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"40",X"E0",X"60",X"40",X"00",X"40",X"40",X"80",X"00",X"10",X"30",
+ X"0C",X"06",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"82",X"82",X"02",X"83",X"01",X"00",X"00",X"00",X"A0",X"F9",X"7F",X"0F",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"05",X"01",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"FF",X"FF",X"FE",X"FC",X"FB",X"60",X"00",X"00",
+ X"C0",X"80",X"00",X"00",X"06",X"0C",X"0C",X"06",X"20",X"40",X"00",X"40",X"F0",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F8",X"FC",X"FD",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",
+ X"00",X"A0",X"E4",X"64",X"62",X"70",X"38",X"1F",X"0F",X"07",X"03",X"03",X"01",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"20",X"20",X"20",X"30",X"10",X"10",X"1C",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FE",X"FC",X"F8",X"70",X"00",X"66",X"30",X"18",X"0C",X"04",X"00",X"00",X"00",X"00",
+ X"E0",X"C0",X"00",X"00",X"00",X"00",X"00",X"20",X"70",X"D0",X"40",X"40",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"30",X"18",X"3C",X"0E",X"3F",X"7F",X"7F",X"7F",X"7F",X"7F",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"00",X"C0",X"E0",
+ X"3F",X"3F",X"3F",X"3F",X"3F",X"2F",X"20",X"30",X"34",X"22",X"20",X"01",X"01",X"03",X"02",X"00",
+ X"FC",X"FC",X"F0",X"E0",X"F0",X"F8",X"38",X"10",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"00",
+ X"00",X"00",X"18",X"30",X"38",X"30",X"30",X"72",X"62",X"64",X"70",X"70",X"78",X"78",X"7C",X"7C",
+ X"40",X"C0",X"00",X"00",X"00",X"00",X"00",X"0C",X"06",X"0E",X"76",X"FE",X"FE",X"FE",X"FE",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"20",X"60",X"40",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"01",X"02",X"03",X"07",X"03",X"31",X"78",X"78",X"78",X"7E",X"7F",X"7F",X"3F",X"03",X"01",
+ X"FF",X"7F",X"7F",X"3F",X"0F",X"00",X"00",X"00",X"00",X"00",X"06",X"0F",X"0F",X"09",X"00",X"00",
+ X"F8",X"D8",X"D8",X"98",X"38",X"30",X"30",X"30",X"30",X"30",X"30",X"00",X"00",X"00",X"00",X"00",
+ X"CF",X"CF",X"CF",X"86",X"81",X"9C",X"B8",X"F8",X"F8",X"F8",X"FC",X"FD",X"FF",X"FF",X"FF",X"FF",
+ X"20",X"60",X"40",X"C0",X"80",X"00",X"00",X"50",X"78",X"7C",X"FC",X"FC",X"FC",X"E8",X"E0",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"41",X"E2",X"C6",X"C6",X"E4",X"C6",
+ X"00",X"00",X"00",X"00",X"60",X"40",X"C0",X"80",X"82",X"06",X"04",X"0C",X"08",X"18",X"10",X"30",
+ X"01",X"00",X"01",X"01",X"03",X"03",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F7",X"FF",X"C7",X"C3",X"C3",X"E3",X"E3",X"E3",X"C3",X"C7",X"FF",X"1F",X"0F",X"07",X"03",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",
+ X"00",X"01",X"03",X"07",X"07",X"C7",X"E7",X"A7",X"87",X"C7",X"87",X"C3",X"80",X"E3",X"F7",X"F7",
+ X"40",X"10",X"7E",X"7E",X"3F",X"1F",X"0E",X"06",X"1E",X"0E",X"16",X"DC",X"DC",X"EC",X"FC",X"78",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"E0",X"F0",X"F0",X"60",X"81",X"C7",X"DC",X"F0",X"C0",X"C0",X"C0",X"40",X"C0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"1F",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"17",X"07",X"07",X"03",X"03",X"03",X"01",X"01",
+ X"CF",X"C5",X"C6",X"DA",X"C3",X"E1",X"61",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"E0",X"00",X"00",X"00",X"00",X"80",X"80",X"C0",X"40",X"60",X"20",X"00",X"00",X"00",X"00",
+ X"FB",X"FB",X"FB",X"F9",X"FD",X"FD",X"FC",X"FC",X"FE",X"FE",X"FE",X"9E",X"9D",X"8E",X"CE",X"C7",
+ X"80",X"80",X"80",X"C0",X"C0",X"C0",X"E0",X"E0",X"60",X"60",X"60",X"60",X"40",X"80",X"80",X"C0",
+ X"00",X"00",X"00",X"00",X"08",X"10",X"10",X"10",X"10",X"00",X"00",X"00",X"00",X"30",X"70",X"FA",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"38",X"38",X"18",X"08",X"00",X"00",X"00",X"00",X"00",
+ X"3F",X"3F",X"3F",X"3F",X"3F",X"1F",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FE",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FE",X"ED",X"C7",X"03",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"03",X"03",X"03",X"1F",X"3F",
+ X"00",X"00",X"00",X"01",X"0F",X"1F",X"3F",X"7F",X"FF",X"FF",X"DF",X"FF",X"FF",X"FF",X"FF",X"FE",
+ X"64",X"4C",X"48",X"78",X"B0",X"08",X"0F",X"86",X"04",X"00",X"00",X"80",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"80",X"C0",X"BF",X"6F",X"F6",X"D4",X"E0",X"F0",X"E0",X"E0",X"80",X"19",X"3F",X"27",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"3C",X"3F",X"3F",X"3F",X"1B",X"03",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"1B",X"3F",X"3F",X"3F",X"3C",X"20",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"41",X"41",X"41",X"41",X"40",X"40",X"60",X"20",X"21",X"17",X"FE",X"FF",X"FF",X"F8",X"F0",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"83",X"03",X"07",X"FF",X"FF",X"0B",X"03",X"00",
+ X"00",X"F0",X"F8",X"FF",X"FF",X"FE",X"17",X"21",X"20",X"60",X"40",X"40",X"41",X"41",X"41",X"41",
+ X"00",X"03",X"0B",X"FF",X"FF",X"07",X"03",X"83",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"83",X"83",X"83",X"83",X"83",X"C7",X"F7",X"FF",X"1F",X"3F",X"FE",X"FE",X"FE",X"FC",X"F0",X"00",
+ X"80",X"80",X"80",X"80",X"80",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"C0",X"C0",X"C0",X"C0",X"C0",X"40",X"00",X"00",X"00",
+ X"00",X"00",X"03",X"03",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"B0",X"FC",X"FF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"02",X"02",X"02",X"82",X"E2",X"FA",X"FF",X"FF",X"FF",X"3F",X"0D",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",X"1F",X"F7",X"E1",X"C0",X"F8",X"3E",X"0F",X"03",X"01",X"01",
+ X"3F",X"3F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"03",X"02",X"02",
+ X"F8",X"FC",X"7F",X"1F",X"37",X"62",X"43",X"C1",X"81",X"81",X"01",X"01",X"05",X"05",X"05",X"0D",
+ X"FC",X"FC",X"F8",X"F8",X"F8",X"FC",X"7C",X"66",X"C3",X"FF",X"FF",X"FF",X"FF",X"7F",X"1B",X"00",
+ X"1C",X"1C",X"1C",X"38",X"38",X"38",X"78",X"F0",X"E0",X"F0",X"20",X"20",X"C0",X"80",X"C0",X"C0",
+ X"C3",X"FB",X"3F",X"0F",X"07",X"C7",X"F6",X"FE",X"FF",X"FF",X"FF",X"FF",X"FE",X"FE",X"FC",X"FC",
+ X"00",X"C0",X"F0",X"F0",X"F8",X"FC",X"7C",X"3C",X"BE",X"FE",X"FE",X"0E",X"0E",X"0C",X"0E",X"0C",
+ X"0E",X"0E",X"0E",X"0E",X"0D",X"0D",X"0D",X"03",X"07",X"07",X"03",X"02",X"00",X"00",X"00",X"00",
+ X"9F",X"80",X"80",X"80",X"80",X"80",X"C0",X"C0",X"80",X"80",X"C0",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"0F",X"0E",X"06",X"02",X"02",X"02",X"02",X"02",X"02",X"03",X"03",X"03",X"07",X"0F",X"0F",
+ X"FF",X"3F",X"3F",X"3F",X"3F",X"3F",X"3F",X"7F",X"7F",X"C7",X"80",X"80",X"00",X"00",X"80",X"60",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"07",X"07",X"0F",X"0F",X"0F",X"0F",X"0F",X"0F",
+ X"00",X"00",X"00",X"00",X"2F",X"FF",X"FF",X"F0",X"C0",X"E0",X"E0",X"A0",X"30",X"3F",X"3F",X"FF",
+ X"F8",X"F8",X"F8",X"FC",X"7F",X"79",X"60",X"30",X"18",X"0F",X"07",X"03",X"00",X"00",X"00",X"00",
+ X"04",X"04",X"04",X"0C",X"08",X"DF",X"FF",X"3F",X"1B",X"F3",X"F1",X"FB",X"7F",X"7F",X"3F",X"00",
+ X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",
+ X"04",X"04",X"04",X"04",X"04",X"04",X"04",X"04",X"04",X"04",X"04",X"04",X"04",X"04",X"04",X"04",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"0F",X"1C",X"38",X"78",X"78",X"F8",X"F8",X"F8",
+ X"00",X"00",X"03",X"03",X"07",X"3F",X"FF",X"FF",X"08",X"0C",X"04",X"04",X"04",X"04",X"04",X"04",
+ X"01",X"01",X"07",X"3F",X"F7",X"EF",X"EF",X"EF",X"E6",X"F1",X"FF",X"FF",X"FF",X"FF",X"BF",X"00",
+ X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"E0",X"C0",X"F8",X"F8",X"F8",X"F0",X"00",
+ X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",
+ X"F7",X"F7",X"F7",X"F7",X"F7",X"F7",X"F7",X"F7",X"F7",X"F7",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",
+ X"00",X"37",X"EF",X"EF",X"EF",X"E6",X"F1",X"FF",X"07",X"00",X"00",X"00",X"01",X"03",X"03",X"03",
+ X"00",X"E0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"10",X"00",X"70",X"F0",X"F0",X"F0",X"F0",X"F0",
+ X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"F0",X"F8",X"CE",X"47",X"61",X"3F",X"1F",X"0F",X"03",X"01",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",
+ X"03",X"0E",X"38",X"70",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",X"E0",
+ X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"C3",X"8E",X"FD",X"FD",X"3C",X"7E",X"3F",X"FF",X"F7",
+ X"FF",X"F8",X"F8",X"F8",X"F8",X"78",X"78",X"F8",X"F8",X"F8",X"F8",X"B0",X"70",X"E0",X"F8",X"F0",
+ X"FC",X"8E",X"C3",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",X"40",
+ X"B8",X"78",X"C8",X"00",X"18",X"38",X"78",X"F8",X"F8",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",X"7D",X"3D",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F0",X"F0",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",X"0F",X"0F",X"04",X"06",X"03",X"01",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"06",X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",
+ X"08",X"08",X"08",X"08",X"08",X"08",X"08",X"09",X"D7",X"7F",X"3F",X"E7",X"E7",X"7F",X"3D",X"00",
+ X"7B",X"7B",X"7B",X"78",X"78",X"78",X"38",X"F8",X"F8",X"F8",X"F8",X"F8",X"F0",X"E0",X"F8",X"00",
+ X"00",X"00",X"00",X"01",X"07",X"1F",X"7F",X"D7",X"09",X"08",X"08",X"08",X"08",X"08",X"08",X"08",
+ X"00",X"00",X"00",X"F0",X"F8",X"F8",X"F8",X"F8",X"E0",X"18",X"38",X"78",X"78",X"7B",X"7B",X"7B",
+ X"31",X"71",X"71",X"71",X"71",X"71",X"71",X"71",X"79",X"7C",X"27",X"31",X"1F",X"07",X"03",X"00",
+ X"1C",X"1F",X"1F",X"1F",X"1F",X"1F",X"1C",X"0C",X"3C",X"FC",X"FC",X"FC",X"F8",X"F0",X"BC",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"07",X"0C",X"19",X"31",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F8",X"FC",X"FC",X"3C",X"00",
+ X"00",X"00",X"01",X"03",X"06",X"06",X"06",X"06",X"06",X"06",X"06",X"06",X"03",X"01",X"00",X"00",
+ X"1C",X"7E",X"FE",X"0E",X"02",X"06",X"07",X"07",X"07",X"07",X"06",X"02",X"0E",X"FE",X"7E",X"1C",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"1C",X"7E",X"CE",X"82",X"86",X"87",X"87",X"86",X"82",X"CE",X"7E",X"1C",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"0E",X"1E",X"36",X"36",X"36",X"36",X"36",X"36",X"1E",X"06",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"06",X"0A",X"0A",X"0A",X"0A",X"06",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"C0",X"C0",X"E0",X"A0",X"A0",X"B0",X"D0",X"40",X"4C",X"5F",X"7D",X"7C",X"3D",X"2F",X"07",X"03",
+ X"00",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"03",X"C0",X"F8",X"FF",X"FF",X"FF",X"FE",
+ X"00",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"80",X"18",X"7C",X"00",X"00",X"00",X"00",
+ X"FE",X"FF",X"FF",X"FF",X"F8",X"C0",X"03",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",
+ X"00",X"00",X"00",X"00",X"7C",X"18",X"80",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",
+ X"FF",X"FF",X"FF",X"E0",X"E0",X"E0",X"FF",X"7F",X"7F",X"60",X"60",X"60",X"7F",X"FF",X"FF",X"7F",
+ X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"80",
+ X"7F",X"FE",X"FE",X"70",X"7F",X"7F",X"7F",X"60",X"60",X"E0",X"FF",X"FF",X"FF",X"E0",X"E0",X"E0",
+ X"80",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"03",
+ X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"FE",
+ X"03",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",
+ X"FE",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",X"FF",X"FF",X"FF",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"1C",X"22",X"22",X"22",X"22",X"1C",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"3E",X"3E",X"12",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"1A",X"3A",X"2E",X"26",X"36",X"12",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"14",X"3E",X"2A",X"22",X"36",X"14",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"04",X"3E",X"3E",X"34",X"1C",X"0C",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0C",X"2E",X"2A",X"3A",X"3A",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"04",X"2E",X"2A",X"2A",X"3E",X"1C",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"30",X"38",X"2E",X"26",X"20",X"30",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"14",X"2E",X"2A",X"2A",X"3A",X"14",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"1C",X"3E",X"2A",X"2A",X"3A",X"10",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"04",X"04",X"04",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"20",X"20",X"20",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"80",X"80",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"07",X"01",X"07",X"06",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"E0",X"C0",X"00",X"60",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"06",X"03",X"06",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"60",X"00",X"60",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"07",X"03",X"03",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"E0",X"60",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"06",X"07",X"00",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"00",X"C0",X"C0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"06",X"03",X"00",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"60",X"E0",X"60",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"01",X"03",X"06",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"80",X"80",X"00",X"20",X"E0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"06",X"03",X"04",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"20",X"C0",X"60",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"03",X"06",X"07",X"06",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"C0",X"00",X"C0",X"60",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"22",X"1C",X"00",X"02",X"02",X"02",X"3C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"2A",X"2A",X"12",X"00",X"1C",X"22",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"22",X"1C",X"00",X"2A",X"2A",X"3E",X"00",X"30",X"0C",X"02",X"0C",X"30",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"04",X"2A",X"2A",X"12",X"00",X"1E",X"24",X"24",X"1E",X"00",X"2E",X"2A",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"12",X"00",X"3C",X"02",X"02",X"3C",X"00",X"1C",X"22",X"22",X"1C",X"00",X"3E",X"08",X"08",X"3E",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"3E",X"08",X"10",X"3E",X"00",X"1C",X"22",X"22",X"1C",X"00",X"20",X"3E",X"20",X"04",X"2A",X"2A",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"22",X"22",X"1C",X"00",X"3E",X"00",X"3E",X"08",X"08",X"3E",X"00",X"22",X"22",X"1C",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"1C",X"22",X"22",X"1C",X"00",X"2E",X"2A",X"22",X"1C",X"00",X"1E",X"24",X"24",X"1E",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"02",X"00",X"3E",X"08",X"10",X"3E",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"30",X"08",X"0E",X"08",X"30",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"20",X"14",X"5C",X"0F",X"1B",X"77",X"94",X"20",X"84",X"10",X"42",X"90",X"05",X"20",X"0A",X"00",
+ X"00",X"00",X"00",X"00",X"E0",X"00",X"00",X"00",X"00",X"80",X"12",X"40",X"08",X"21",X"00",X"88",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0A",X"20",X"05",X"90",X"42",X"10",X"84",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"88",X"00",X"21",X"08",X"40",X"12",X"80",X"00",
+ X"20",X"68",X"F0",X"90",X"18",X"98",X"F0",X"50",X"00",X"00",X"20",X"00",X"00",X"00",X"00",X"40",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"00",X"00",X"00",X"00",X"00",X"20",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"3F",X"7F",X"7F",X"E0",X"C0",X"C0",X"C0",X"E0",X"7F",X"7F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"E0",X"F0",X"F0",X"38",X"18",X"18",X"18",X"38",X"F0",X"F0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"FF",X"FF",X"7F",X"20",X"20",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"F8",X"F8",X"F8",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"3C",X"7E",X"FF",X"E7",X"C3",X"C3",X"C1",X"E1",X"F0",X"70",X"30",
+ X"00",X"00",X"00",X"00",X"00",X"18",X"18",X"18",X"18",X"98",X"98",X"D8",X"F8",X"F8",X"78",X"18",
+ X"00",X"00",X"00",X"00",X"00",X"38",X"7D",X"FF",X"EF",X"C6",X"C6",X"C6",X"E0",X"F0",X"70",X"30",
+ X"00",X"00",X"00",X"00",X"00",X"E0",X"F0",X"F8",X"38",X"18",X"18",X"18",X"38",X"78",X"70",X"60",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0E",X"1F",X"1F",X"3F",X"3F",X"3F",X"3F",X"1F",X"3F",X"3F",X"3F",X"1F",X"07",X"07",X"03",X"01",
+ X"6C",X"7E",X"FE",X"FE",X"FC",X"FC",X"FE",X"FF",X"FF",X"FF",X"FE",X"FC",X"FC",X"FC",X"F8",X"B0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"01",X"01",X"01",X"01",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"1E",X"3F",X"29",X"00",X"00",X"40",X"00",X"00",X"00",X"00",X"40",X"00",X"00",X"29",X"3F",X"1E",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"01",X"01",X"21",X"01",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"1E",X"3F",X"29",X"00",X"00",X"40",X"00",X"00",X"00",X"00",X"40",X"00",X"00",X"29",X"3F",X"1E",
+ X"00",X"C0",X"F0",X"FC",X"FF",X"7F",X"FF",X"87",X"87",X"FF",X"7F",X"FF",X"FC",X"F0",X"C0",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"81",X"81",X"81",X"81",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"50",X"7C",X"3F",X"03",X"01",X"00",X"00",X"00",X"00",
+ X"7C",X"8C",X"86",X"F7",X"7F",X"3F",X"FF",X"7F",X"FF",X"FE",X"FC",X"C0",X"80",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"01",X"01",X"01",X"01",X"FC",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"38",X"1E",X"07",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"03",X"06",
+ X"00",X"00",X"00",X"00",X"00",X"07",X"0F",X"0A",X"40",X"40",X"80",X"80",X"00",X"C0",X"D0",X"70",
+ X"3F",X"7F",X"FF",X"FF",X"7E",X"F8",X"E0",X"5F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"00",X"00",X"00",X"01",X"01",X"E3",X"FD",X"3C",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"C0",X"F0",X"38",X"1C",X"3C",X"46",X"42",X"7B",X"3F",X"9F",X"7F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"10",X"00",X"00",X"00",X"03",X"06",
+ X"00",X"00",X"00",X"00",X"00",X"07",X"0F",X"0A",X"40",X"40",X"80",X"80",X"00",X"C0",X"D0",X"70",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"01",X"01",X"21",X"01",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"3F",X"28",X"01",X"01",X"41",X"03",X"02",X"02",X"03",X"41",X"01",X"01",X"28",X"3F",X"1F",
+ X"80",X"C0",X"F0",X"FC",X"FF",X"FF",X"FF",X"1F",X"1F",X"FF",X"FF",X"FF",X"FC",X"F0",X"C0",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"81",X"81",X"81",X"81",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"01",X"01",X"41",X"01",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"3F",X"28",X"01",X"01",X"41",X"03",X"02",X"02",X"03",X"41",X"01",X"01",X"28",X"3F",X"1F",
+ X"80",X"C0",X"F0",X"FC",X"FF",X"FF",X"FF",X"1F",X"1F",X"FF",X"FF",X"FF",X"FC",X"F0",X"C0",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"81",X"81",X"81",X"81",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"00",X"01",X"07",X"0C",X"00",
+ X"00",X"1F",X"3F",X"2A",X"02",X"03",X"01",X"04",X"03",X"00",X"40",X"C0",X"80",X"29",X"3F",X"1F",
+ X"00",X"C0",X"F0",X"3C",X"1E",X"DF",X"FF",X"FF",X"FF",X"7F",X"77",X"7F",X"FF",X"FE",X"F0",X"C3",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"81",X"81",X"81",X"01",X"00",X"FC",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"13",X"06",X"0C",X"00",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"00",X"41",
+ X"00",X"00",X"00",X"00",X"00",X"1F",X"3E",X"2E",X"03",X"01",X"04",X"03",X"00",X"40",X"E8",X"BE",
+ X"EF",X"FF",X"FE",X"F8",X"C1",X"DF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"81",X"03",X"01",X"40",X"FC",X"FC",X"00",X"00",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"F0",X"38",X"1C",X"DE",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"77",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"81",
+ X"03",X"26",X"0C",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"20",X"01",
+ X"00",X"00",X"00",X"00",X"00",X"1F",X"3E",X"2A",X"03",X"01",X"04",X"03",X"00",X"40",X"E8",X"BE",
+ X"EF",X"FF",X"FE",X"F8",X"C1",X"DF",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"81",X"03",X"01",X"40",X"FC",X"FC",X"00",X"00",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"F0",X"3C",X"1E",X"DF",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",X"77",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"81",
+ X"00",X"00",X"00",X"07",X"01",X"01",X"11",X"01",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"21",X"01",X"01",X"5D",X"3F",X"21",X"21",X"3F",X"5D",X"01",X"01",X"21",X"36",X"17",X"03",X"00",
+ X"E0",X"F8",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FE",X"F8",X"E0",X"E0",X"60",X"C0",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"1F",X"3E",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"60",X"E0",
+ X"00",X"00",X"00",X"0F",X"01",X"01",X"41",X"01",X"0F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"2B",X"03",X"03",X"5F",X"3F",X"21",X"21",X"3F",X"5F",X"03",X"03",X"2B",X"3D",X"1E",X"03",X"00",
+ X"E0",X"F8",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FE",X"F8",X"E0",X"C0",X"C0",X"80",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"1F",X"3E",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"60",X"E0",
+ X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"00",X"01",X"07",X"0C",X"00",X"00",X"00",X"00",
+ X"3F",X"23",X"21",X"3D",X"1F",X"0F",X"1B",X"43",X"C3",X"81",X"29",X"3E",X"1F",X"00",X"00",X"00",
+ X"EE",X"FF",X"FF",X"FF",X"FF",X"FF",X"EE",X"DE",X"BC",X"F8",X"E0",X"C3",X"80",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"7C",X"FC",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"1F",X"3F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",
+ X"01",X"01",X"01",X"01",X"00",X"00",X"10",X"01",X"01",X"03",X"06",X"00",X"00",X"00",X"00",X"00",
+ X"21",X"3D",X"1F",X"0F",X"5B",X"63",X"E3",X"85",X"0E",X"03",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"CF",X"9E",X"FE",X"FC",X"F8",X"E3",X"EF",X"40",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"03",X"01",X"40",X"7C",X"FC",X"C0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"1F",X"3F",X"3F",X"23",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"E0",X"FC",
+ X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"01",X"41",X"03",X"06",X"0C",X"00",X"00",X"00",X"00",
+ X"21",X"3D",X"1F",X"0D",X"59",X"69",X"F9",X"9E",X"0F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"EF",X"DE",X"FE",X"FC",X"F8",X"E3",X"EF",X"40",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"00",X"40",X"7C",X"FC",X"C0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"1F",X"3F",X"3D",X"23",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"E0",X"F0",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"0F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"1F",X"15",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"50",X"7F",X"3F",X"00",
+ X"C0",X"E0",X"FC",X"FF",X"FF",X"7F",X"FF",X"87",X"87",X"FF",X"7F",X"FC",X"F8",X"F0",X"80",X"00",
+ X"00",X"00",X"00",X"00",X"80",X"80",X"81",X"81",X"81",X"81",X"FC",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1C",X"0E",X"07",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0C",X"1F",X"17",X"40",X"40",X"80",X"80",X"00",X"00",X"28",X"38",
+ X"3F",X"3F",X"7F",X"FF",X"FE",X"F8",X"E0",X"5F",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"80",X"80",X"00",X"00",X"00",X"01",X"01",X"E3",X"FD",X"3C",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"F0",X"78",X"1C",X"3C",X"46",X"42",X"7B",X"3F",X"9F",X"7F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"E0",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"EF",X"E7",X"E3",X"E3",X"E2",
+ X"80",X"80",X"90",X"90",X"92",X"92",X"D0",X"B0",X"98",X"8C",X"8C",X"C8",X"A0",X"80",X"80",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"E0",X"B8",X"9C",X"8F",X"87",X"C3",X"E3",X"91",X"88",X"80",X"80",X"E0",X"BC",X"9F",X"87",X"83",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"87",X"83",X"81",X"C0",X"E0",X"B8",X"9C",X"87",X"83",X"82",X"82",X"92",X"92",X"82",X"82",X"C0",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"80",X"80",X"80",X"90",X"90",X"90",X"90",X"82",X"82",X"C2",X"A2",X"9A",X"8E",X"8F",X"CF",X"A7",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"F0",X"F8",X"FC",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"EF",X"67",X"61",X"60",X"60",X"70",X"60",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"60",X"60",X"70",X"78",X"FE",X"FF",X"EF",X"E7",X"E1",X"60",X"60",X"70",X"78",X"FE",X"FF",X"FF",
+ X"1C",X"1C",X"1C",X"1C",X"1C",X"1C",X"DC",X"FC",X"FC",X"FC",X"3F",X"1F",X"07",X"02",X"00",X"C0",
+ X"FF",X"FF",X"FF",X"6F",X"67",X"63",X"63",X"63",X"E3",X"E3",X"63",X"63",X"63",X"63",X"63",X"61",
+ X"00",X"80",X"C0",X"E0",X"F0",X"F8",X"FC",X"3E",X"1F",X"07",X"03",X"00",X"00",X"00",X"18",X"1C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"60",X"60",X"60",X"60",X"70",X"78",X"FC",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7F",X"7C",X"58",X"70",X"40",X"80",X"00",X"00",X"00",X"00",
+ X"FE",X"FC",X"F8",X"E0",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"40",X"70",X"78",X"7C",X"7F",X"7F",X"FF",X"FF",X"FF",X"7F",X"7F",X"7F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"E0",X"F8",X"FC",X"FE",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"C6",X"C7",X"C7",X"C7",X"E7",X"F7",X"FE",X"FC",X"F8",X"F0",X"C0",X"80",X"00",X"00",X"00",X"00",
+ X"18",X"08",X"08",X"80",X"C0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"F3",X"F1",X"F1",X"D1",X"CD",X"CF",X"C7",X"C3",X"C3",X"C1",X"C0",X"C0",X"C0",X"C4",X"C4",
+ X"04",X"80",X"C0",X"70",X"38",X"0E",X"07",X"81",X"C0",X"F0",X"F8",X"FE",X"F9",X"78",X"38",X"38",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"30",X"38",X"0C",X"04",X"80",X"C0",X"70",X"38",X"0E",X"07",X"01",X"00",X"30",X"38",X"0C",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"3F",X"1F",X"0F",X"87",X"C7",X"E3",X"11",X"00",X"00",X"00",X"F0",X"7F",X"3F",X"0F",X"07",X"01",
+ X"00",X"80",X"C0",X"F0",X"F8",X"FC",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"E0",X"F8",X"FC",X"FE",X"FF",X"FF",X"7F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F9",X"F9",X"F9",X"39",X"19",X"09",X"09",X"C9",X"E1",X"F1",X"F0",X"F0",X"F0",X"E0",X"C0",X"00",
+ X"00",X"80",X"C0",X"F0",X"F8",X"F8",X"F0",X"E0",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F1",X"F9",X"F9",X"F9",X"F9",X"F9",X"F9",X"39",X"19",X"09",X"09",X"C9",X"E9",X"F9",X"F9",X"F9",
+ X"FC",X"FC",X"FC",X"7C",X"3C",X"0E",X"07",X"01",X"00",X"00",X"10",X"18",X"18",X"18",X"08",X"00",
+ X"F0",X"F8",X"F8",X"F9",X"F9",X"F9",X"F9",X"F9",X"79",X"39",X"19",X"09",X"87",X"C3",X"E3",X"F1",
+ X"00",X"00",X"00",X"00",X"80",X"E0",X"F0",X"F8",X"FC",X"FE",X"FF",X"FD",X"FC",X"FC",X"FC",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"83",X"83",X"93",X"93",X"83",X"83",X"C3",X"E7",X"FF",X"9F",X"03",X"03",X"03",X"00",X"60",
+ X"80",X"C0",X"E0",X"F8",X"FC",X"FE",X"FF",X"FE",X"FC",X"F8",X"E0",X"C0",X"80",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"E0",X"38",X"1C",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_bit3.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_bit3.vhd
new file mode 100644
index 00000000..5c9aa7f2
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_bit3.vhd
@@ -0,0 +1,534 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_spr_bit3 is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(12 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_spr_bit3 is
+ type rom is array(0 to 8191) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",X"40",X"C0",X"D0",X"CC",X"C1",X"47",X"07",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",
+ X"00",X"07",X"47",X"C1",X"C0",X"C0",X"C0",X"40",X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"3E",X"3E",X"3E",X"3E",X"3F",X"3F",X"1F",X"1F",X"1E",X"08",X"01",X"00",X"E0",X"E0",X"E0",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"40",X"30",X"00",X"7C",X"FC",X"F8",X"00",X"03",X"07",X"07",X"00",
+ X"00",X"E0",X"E0",X"E0",X"00",X"01",X"08",X"1E",X"1F",X"1F",X"3F",X"3F",X"3E",X"3E",X"3E",X"3E",
+ X"00",X"07",X"07",X"03",X"00",X"F8",X"FC",X"7C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7C",X"7C",X"7C",X"7C",X"7C",X"38",X"08",X"00",X"E0",X"C0",X"01",X"01",X"C0",X"E0",X"E0",X"00",
+ X"40",X"40",X"40",X"40",X"40",X"C0",X"40",X"C0",X"80",X"80",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"38",X"7D",X"73",X"63",X"3C",X"00",X"00",X"00",
+ X"07",X"07",X"07",X"01",X"60",X"C4",X"1C",X"1C",X"78",X"DA",X"5C",X"8F",X"07",X"01",X"01",X"00",
+ X"C0",X"C1",X"C3",X"C7",X"07",X"07",X"62",X"10",X"00",X"C0",X"C0",X"E0",X"E7",X"FF",X"9F",X"0F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",X"06",X"02",X"C2",X"F8",X"F8",X"F0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"04",X"04",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"40",X"00",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"38",X"7D",X"73",X"63",X"3C",X"00",X"00",X"00",
+ X"07",X"07",X"07",X"01",X"60",X"C4",X"1C",X"1C",X"78",X"DA",X"5C",X"8F",X"07",X"01",X"01",X"00",
+ X"C2",X"83",X"87",X"8F",X"07",X"0F",X"46",X"24",X"00",X"C0",X"C0",X"E0",X"E7",X"FF",X"9F",X"0F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",X"06",X"02",X"C2",X"F8",X"F8",X"F0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"04",X"04",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"40",X"02",X"82",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"08",X"38",X"7C",X"F9",X"E3",X"C7",X"78",X"00",X"00",X"00",X"00",X"00",
+ X"7C",X"3C",X"C6",X"00",X"09",X"3F",X"74",X"D0",X"AA",X"6E",X"7C",X"7F",X"3F",X"1F",X"1C",X"07",
+ X"00",X"10",X"00",X"C0",X"E0",X"80",X"00",X"00",X"02",X"03",X"41",X"31",X"D9",X"F8",X"3C",X"EC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"38",X"44",X"40",X"78",X"7C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"08",X"38",X"7C",X"F9",X"E3",X"C7",X"78",X"00",X"00",X"00",X"00",X"00",
+ X"78",X"38",X"C4",X"00",X"09",X"3F",X"74",X"D0",X"AA",X"6E",X"7C",X"7F",X"3F",X"1D",X"1D",X"07",
+ X"20",X"30",X"10",X"80",X"C0",X"80",X"00",X"00",X"02",X"03",X"41",X"31",X"D9",X"F8",X"3C",X"EC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"38",X"44",X"40",X"78",X"7C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"7F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"7F",X"00",X"00",
+ X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",
+ X"00",X"00",X"7F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"7F",X"00",X"00",
+ X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",
+ X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"01",X"00",X"00",X"00",
+ X"80",X"A4",X"FE",X"0E",X"1C",X"3C",X"7C",X"F8",X"F8",X"F8",X"F8",X"D0",X"90",X"50",X"C0",X"C0",
+ X"00",X"00",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"01",X"00",X"00",X"00",
+ X"30",X"A4",X"EE",X"0E",X"1C",X"3C",X"7C",X"F8",X"F8",X"F8",X"F8",X"D0",X"90",X"50",X"C0",X"C0",
+ X"00",X"E0",X"E0",X"70",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F8",X"F8",X"FC",X"7C",X"7C",X"3E",X"0E",X"0E",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"5F",X"5F",X"7E",X"29",X"07",X"E6",X"FE",X"E6",X"82",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"FE",X"80",X"C0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"82",X"E6",X"FE",X"E6",X"07",X"29",X"7E",X"5F",X"5F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"C0",X"80",X"FE",X"FF",
+ X"5F",X"5F",X"7E",X"29",X"07",X"E6",X"FE",X"E6",X"82",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"FC",X"80",X"C0",X"C0",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"82",X"E6",X"FE",X"E6",X"07",X"29",X"7E",X"5F",X"5F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"C0",X"80",X"FC",X"FE",
+ X"0C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"0F",X"1F",X"1E",X"3C",X"3A",X"3F",X"1F",X"07",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",X"0C",X"1C",X"1C",X"0C",X"00",X"10",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"07",X"0F",X"0F",X"0F",X"1F",X"1F",X"1F",X"0F",X"07",X"0F",
+ X"8B",X"0B",X"0F",X"07",X"05",X"00",X"82",X"E7",X"FB",X"FD",X"3C",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"F8",X"D8",X"E0",X"F0",X"F8",X"7C",X"3E",X"9E",X"8F",X"25",X"17",X"0E",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"0C",X"3E",X"DE",X"FD",X"FB",X"FB",X"F7",X"C7",X"83",X"80",X"03",X"05",X"85",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"C0",X"E0",
+ X"8B",X"0B",X"0F",X"07",X"05",X"00",X"82",X"E7",X"FB",X"FD",X"3C",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"F8",X"D8",X"E0",X"F0",X"F8",X"7C",X"3C",X"9E",X"8E",X"2E",X"1C",X"00",X"00",X"00",X"00",
+ X"1C",X"1C",X"0E",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"0F",X"0F",X"07",X"07",X"03",X"01",X"00",X"60",X"20",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"C3",X"CF",X"FE",X"9C",X"3F",X"27",X"27",X"27",X"27",X"3F",X"9C",X"FE",X"CF",X"C3",X"01",
+ X"00",X"20",X"70",X"70",X"20",X"F0",X"FE",X"FF",X"FF",X"FE",X"F0",X"20",X"70",X"70",X"20",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"40",X"40",X"06",X"0F",X"0E",X"1D",X"1D",X"1D",X"1D",X"0E",X"0F",X"06",X"40",X"40",X"00",
+ X"00",X"00",X"20",X"78",X"D8",X"80",X"F8",X"7F",X"7F",X"F8",X"80",X"D8",X"78",X"20",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"13",X"33",X"33",X"13",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"10",X"A8",X"C8",X"B0",X"5F",X"5F",X"B0",X"C8",X"A8",X"10",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"0C",X"0C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"38",X"62",X"F8",X"EF",X"F8",X"62",X"38",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"06",X"2F",X"06",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"04",X"04",X"00",X"00",X"00",X"30",X"70",X"70",X"70",X"70",X"30",X"00",X"00",X"00",X"04",X"04",
+ X"00",X"10",X"33",X"7F",X"77",X"EE",X"E8",X"E8",X"E9",X"EF",X"F7",X"7F",X"73",X"30",X"00",X"00",
+ X"40",X"C0",X"D8",X"98",X"00",X"D0",X"FE",X"FE",X"FE",X"F0",X"00",X"98",X"D8",X"60",X"20",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"78",X"7F",X"7F",X"3F",X"00",X"00",
+ X"1F",X"1F",X"0F",X"1B",X"10",X"10",X"90",X"B0",X"31",X"16",X"30",X"F8",X"D8",X"9C",X"1C",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"0F",
+ X"C3",X"C3",X"C3",X"83",X"03",X"23",X"23",X"67",X"42",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"6C",X"58",X"F0",X"C0",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"70",X"F8",X"F8",X"38",X"38",X"38",X"38",X"0C",X"86",X"C6",X"C3",
+ X"00",X"00",X"00",X"00",X"30",X"58",X"E8",X"7C",X"5C",X"1E",X"5F",X"43",X"93",X"3B",X"32",X"36",
+ X"3C",X"1E",X"0F",X"07",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"18",X"30",X"30",X"A0",X"E0",X"40",X"40",X"40",X"E0",X"E0",X"60",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"78",X"70",X"70",X"38",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"47",X"4F",
+ X"F3",X"F3",X"F1",X"F1",X"61",X"01",X"01",X"03",X"0F",X"1F",X"3E",X"FC",X"FF",X"7F",X"39",X"00",
+ X"C0",X"80",X"00",X"00",X"06",X"0C",X"0D",X"07",X"27",X"4F",X"07",X"73",X"FB",X"33",X"86",X"FC",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"00",X"E1",X"F3",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"C0",X"E0",X"E0",X"E0",
+ X"60",X"E0",X"E4",X"64",X"02",X"00",X"00",X"00",X"00",X"00",X"02",X"07",X"07",X"03",X"01",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"30",X"70",X"78",X"78",X"78",X"70",X"70",X"70",X"70",X"70",X"33",X"30",X"00",X"07",X"1E",X"30",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"03",X"06",X"8C",X"F8",X"F0",X"C0",X"E6",X"F0",X"DC",X"4F",X"65",X"31",X"1F",X"0F",X"07",
+ X"F8",X"F0",X"00",X"00",X"00",X"00",X"00",X"20",X"70",X"D0",X"D0",X"F8",X"F0",X"E0",X"80",X"00",
+ X"00",X"00",X"00",X"00",X"30",X"F8",X"38",X"00",X"38",X"7C",X"7C",X"7C",X"7C",X"7C",X"39",X"01",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"38",X"F8",X"F8",
+ X"F0",X"F0",X"70",X"38",X"7C",X"EF",X"E0",X"B0",X"B4",X"A2",X"A0",X"89",X"DD",X"FF",X"7E",X"3F",
+ X"70",X"00",X"00",X"00",X"76",X"FE",X"3E",X"1C",X"18",X"00",X"00",X"00",X"80",X"80",X"80",X"00",
+ X"01",X"01",X"18",X"3F",X"39",X"00",X"00",X"02",X"02",X"04",X"00",X"40",X"40",X"C0",X"E0",X"E0",
+ X"C0",X"00",X"30",X"00",X"C0",X"E0",X"30",X"1C",X"1E",X"0E",X"70",X"F8",X"F8",X"F8",X"F8",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"1E",X"3E",X"7E",X"70",X"E0",X"E0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"04",X"32",X"7B",X"7B",X"7B",X"7F",X"7F",X"7E",X"3C",X"00",X"00",
+ X"00",X"00",X"40",X"3F",X"0F",X"00",X"00",X"00",X"00",X"00",X"06",X"0F",X"0F",X"39",X"07",X"01",
+ X"64",X"46",X"C2",X"82",X"02",X"02",X"02",X"02",X"02",X"46",X"4C",X"7C",X"F8",X"E0",X"80",X"E0",
+ X"00",X"00",X"00",X"00",X"01",X"1C",X"38",X"38",X"18",X"08",X"0C",X"05",X"07",X"03",X"02",X"02",
+ X"20",X"60",X"40",X"C0",X"C0",X"68",X"28",X"78",X"78",X"7D",X"BF",X"9F",X"1F",X"3E",X"3C",X"64",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"41",X"E2",X"E6",X"F6",X"7C",X"00",
+ X"02",X"07",X"07",X"0E",X"6E",X"5C",X"DC",X"B8",X"BA",X"76",X"74",X"2C",X"08",X"18",X"10",X"30",
+ X"00",X"00",X"01",X"01",X"03",X"03",X"03",X"03",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"07",X"FB",X"DC",X"CC",X"EC",X"EC",X"EC",X"CC",X"D8",X"F0",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"03",X"07",X"87",X"C7",X"E7",X"E7",X"E7",X"E7",X"37",X"1F",X"08",X"03",X"07",X"07",
+ X"40",X"13",X"FF",X"FF",X"FF",X"7F",X"3F",X"17",X"1F",X"0E",X"06",X"00",X"00",X"00",X"00",X"00",
+ X"78",X"F0",X"E0",X"C0",X"00",X"E0",X"FE",X"FE",X"FE",X"7C",X"F8",X"F0",X"60",X"00",X"00",X"00",
+ X"00",X"C3",X"E7",X"FF",X"FF",X"7E",X"8D",X"DF",X"DF",X"F3",X"D0",X"D0",X"D8",X"4F",X"C7",X"C3",
+ X"00",X"00",X"00",X"F8",X"0C",X"C6",X"E6",X"E6",X"C6",X"8E",X"1C",X"3C",X"F8",X"F0",X"EC",X"9C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0E",X"1C",X"3C",X"3C",X"3C",X"38",X"38",X"38",X"10",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"15",X"37",X"3B",X"C3",X"E3",X"E3",X"C1",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F3",X"E3",X"F1",X"F8",X"FC",X"3E",X"9E",X"CF",X"E7",X"F7",X"F3",X"EB",X"63",X"33",X"1E",X"00",
+ X"18",X"18",X"38",X"38",X"3C",X"7C",X"7C",X"7C",X"7E",X"3E",X"3E",X"1E",X"1F",X"1F",X"3F",X"3F",
+ X"67",X"77",X"53",X"0B",X"23",X"33",X"1E",X"18",X"18",X"18",X"18",X"1C",X"3E",X"FF",X"FF",X"F7",
+ X"03",X"07",X"0E",X"1E",X"1E",X"1E",X"1F",X"1E",X"1F",X"1F",X"6F",X"07",X"07",X"07",X"03",X"09",
+ X"00",X"00",X"00",X"00",X"00",X"18",X"98",X"00",X"00",X"E0",X"F0",X"F8",X"FC",X"3E",X"9E",X"CF",
+ X"38",X"38",X"38",X"38",X"38",X"1C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1E",X"1E",X"1E",X"1F",X"0F",X"03",X"07",X"0F",X"0E",X"0D",X"07",X"03",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"1C",X"38",
+ X"00",X"00",X"00",X"01",X"00",X"00",X"03",X"07",X"0F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1E",
+ X"67",X"4F",X"4F",X"7F",X"FF",X"07",X"00",X"99",X"FB",X"FF",X"FF",X"C7",X"03",X"02",X"00",X"00",
+ X"20",X"80",X"C0",X"F0",X"FC",X"FE",X"7F",X"1F",X"86",X"80",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"40",X"C0",X"C3",X"BF",X"6F",X"F7",X"D7",X"E0",X"F0",X"E0",X"E0",X"84",X"18",X"3C",X"24",
+ X"00",X"00",X"00",X"FC",X"FE",X"FE",X"CE",X"3C",X"70",X"00",X"00",X"00",X"00",X"20",X"70",X"70",
+ X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"00",X"00",X"40",X"C0",X"D0",X"CC",X"C1",X"43",X"03",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",
+ X"00",X"03",X"43",X"C1",X"C0",X"C0",X"C0",X"40",X"00",X"00",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"3E",X"3E",X"3E",X"3E",X"3F",X"3F",X"1F",X"1F",X"1E",X"08",X"01",X"00",X"E0",X"F0",X"F0",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"40",X"30",X"00",X"7C",X"FC",X"F8",X"00",X"03",X"03",X"03",X"00",
+ X"00",X"F0",X"F0",X"E0",X"00",X"01",X"08",X"1E",X"1F",X"1F",X"3F",X"3F",X"3E",X"3E",X"3E",X"3E",
+ X"00",X"03",X"03",X"03",X"00",X"F8",X"FC",X"7C",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7C",X"7C",X"7C",X"7C",X"7C",X"38",X"08",X"00",X"E0",X"C0",X"01",X"01",X"C0",X"F0",X"F0",X"00",
+ X"40",X"40",X"40",X"40",X"40",X"C0",X"40",X"C0",X"80",X"80",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"03",X"03",X"02",X"02",X"07",X"07",X"06",X"06",X"06",X"02",X"02",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"40",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"07",X"0C",X"1C",X"1C",X"20",X"20",X"20",X"60",X"40",X"40",X"40",X"C0",X"80",X"80",X"80",
+ X"00",X"00",X"30",X"3C",X"1F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"60",X"F8",X"3C",X"0C",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"F0",X"F0",X"F0",X"F4",X"F4",X"E2",X"08",X"1E",X"3F",X"07",X"01",X"00",X"00",X"01",X"01",
+ X"C0",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",
+ X"38",X"00",X"00",X"00",X"08",X"1D",X"3C",X"3E",X"7E",X"7E",X"FC",X"FC",X"F8",X"F8",X"F8",X"F0",
+ X"03",X"03",X"07",X"07",X"07",X"03",X"83",X"99",X"3C",X"00",X"00",X"C0",X"F0",X"78",X"18",X"00",
+ X"E2",X"E2",X"E2",X"C6",X"C4",X"C4",X"84",X"0C",X"18",X"08",X"18",X"10",X"30",X"60",X"00",X"00",
+ X"03",X"03",X"C1",X"F0",X"F8",X"38",X"09",X"01",X"00",X"00",X"00",X"00",X"01",X"01",X"03",X"03",
+ X"00",X"C0",X"F0",X"70",X"00",X"00",X"82",X"C3",X"41",X"01",X"01",X"F1",X"F1",X"F3",X"F1",X"F3",
+ X"0E",X"0E",X"0E",X"0E",X"0C",X"0C",X"0C",X"00",X"00",X"00",X"00",X"09",X"0F",X"07",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"90",X"FF",X"FF",X"00",
+ X"0E",X"0C",X"0D",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",X"0C",X"0C",
+ X"00",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"80",X"80",X"38",X"7F",X"7F",X"FF",X"FF",X"7F",X"1F",
+ X"00",X"00",X"00",X"00",X"01",X"03",X"00",X"00",X"00",X"00",X"0C",X"0C",X"0C",X"0E",X"0E",X"0E",
+ X"00",X"00",X"7F",X"FF",X"D0",X"00",X"00",X"0F",X"3F",X"1F",X"1F",X"5F",X"CF",X"C0",X"C0",X"00",
+ X"07",X"07",X"07",X"03",X"00",X"06",X"1F",X"0F",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F8",X"F8",X"F8",X"F0",X"F0",X"20",X"00",X"C0",X"E5",X"0F",X"0E",X"04",X"00",X"03",X"3F",X"00",
+ X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",X"07",
+ X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",X"07",X"07",X"07",X"07",X"07",X"07",
+ X"04",X"0E",X"0F",X"05",X"00",X"00",X"00",X"20",X"F0",X"F0",X"F8",X"F8",X"F8",X"F8",X"F8",X"F8",
+ X"01",X"01",X"00",X"00",X"0E",X"1F",X"1F",X"1F",X"9F",X"0E",X"00",X"00",X"01",X"9F",X"BF",X"00",
+ X"FE",X"FE",X"EE",X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",X"1C",X"38",X"78",X"F8",X"F8",X"F0",X"00",
+ X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",X"03",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",
+ X"00",X"0E",X"1F",X"9F",X"1F",X"1F",X"0E",X"00",X"00",X"01",X"01",X"03",X"03",X"03",X"03",X"03",
+ X"38",X"1C",X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",X"EE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"0F",X"07",X"31",X"38",X"1E",X"00",X"00",X"00",X"00",X"01",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"01",X"07",X"0F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",X"1F",
+ X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"00",X"01",X"03",X"03",X"F3",X"E1",X"C0",X"30",X"F7",
+ X"FF",X"FE",X"FE",X"FE",X"FE",X"7E",X"7E",X"36",X"86",X"C6",X"C6",X"CE",X"8C",X"18",X"78",X"F0",
+ X"03",X"01",X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",
+ X"C6",X"86",X"36",X"7E",X"7E",X"FE",X"FE",X"FE",X"FE",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C1",X"E3",X"F3",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"8C",X"CE",X"C6",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"03",X"01",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"01",
+ X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"20",X"81",X"C5",X"18",X"18",X"00",X"3D",X"00",
+ X"7F",X"7F",X"7F",X"7E",X"7E",X"7E",X"3E",X"1E",X"86",X"C6",X"C6",X"86",X"0C",X"18",X"F8",X"00",
+ X"00",X"00",X"00",X"18",X"18",X"05",X"01",X"20",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",X"F0",
+ X"00",X"00",X"18",X"0C",X"86",X"C6",X"C6",X"86",X"1E",X"3E",X"7E",X"7E",X"7E",X"7F",X"7F",X"7F",
+ X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",X"0E",X"06",X"02",X"18",X"0E",X"00",X"00",X"03",X"00",
+ X"1E",X"1F",X"1F",X"1F",X"1F",X"1F",X"1E",X"0E",X"02",X"32",X"32",X"02",X"06",X"0C",X"BC",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"02",X"06",X"0E",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",X"06",X"32",X"32",X"02",X"0E",
+ X"00",X"00",X"00",X"00",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"01",X"00",X"00",X"00",X"00",
+ X"02",X"0D",X"0D",X"C1",X"C3",X"C7",X"C7",X"C7",X"C7",X"C7",X"C7",X"C3",X"C1",X"0D",X"0D",X"02",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"02",X"05",X"25",X"63",X"67",X"67",X"67",X"67",X"63",X"25",X"05",X"02",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"03",X"09",X"0B",X"0B",X"0B",X"0B",X"09",X"03",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"05",X"05",X"05",X"05",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"7F",X"7F",X"7F",X"3F",X"3F",X"3F",X"1F",X"0F",X"0F",X"1F",X"1F",X"1F",X"1F",X"0F",X"07",X"00",
+ X"FF",X"FB",X"FB",X"FB",X"FB",X"FB",X"FB",X"FB",X"FB",X"FD",X"FF",X"FF",X"FF",X"FF",X"03",X"00",
+ X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"83",X"FE",X"FC",X"00",X"00",
+ X"00",X"03",X"FF",X"FF",X"FF",X"FF",X"FD",X"FB",X"FB",X"FB",X"FB",X"FB",X"FB",X"FB",X"FB",X"F8",
+ X"00",X"00",X"FC",X"FE",X"83",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"FF",X"3F",
+ X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"70",X"3E",X"1E",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"1E",X"3E",X"70",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"20",X"00",X"40",X"00",X"00",X"00",X"80",X"20",X"84",X"10",X"42",X"90",X"05",X"20",X"0A",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"12",X"40",X"08",X"21",X"00",X"88",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0A",X"20",X"05",X"90",X"42",X"10",X"84",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"88",X"00",X"21",X"08",X"40",X"12",X"80",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"00",X"00",X"00",X"00",X"40",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"40",X"00",X"00",X"00",X"00",X"00",X"20",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0F",X"1F",X"3F",X"3F",X"7F",X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",X"FF",X"7F",X"7F",X"3F",
+ X"F8",X"FC",X"FC",X"FE",X"FE",X"FE",X"FE",X"FE",X"FC",X"FC",X"FC",X"FC",X"F8",X"F8",X"F0",X"E0",
+ X"00",X"00",X"00",X"00",X"3F",X"7F",X"7F",X"3F",X"7F",X"FF",X"FF",X"7F",X"30",X"20",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"FE",X"FE",X"FE",X"FC",X"FC",X"FC",X"FC",X"F8",X"00",X"00",X"00",X"00",
+ X"0F",X"1F",X"3F",X"7F",X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",X"F9",X"F9",X"F8",X"78",X"30",
+ X"06",X"8E",X"CE",X"CE",X"EE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"FC",X"FC",X"FC",X"7C",X"18",
+ X"0E",X"1F",X"3F",X"7F",X"7F",X"7F",X"7F",X"FF",X"FF",X"FF",X"FF",X"F6",X"F8",X"F8",X"78",X"30",
+ X"38",X"7C",X"FE",X"FE",X"FE",X"FE",X"FE",X"FE",X"3C",X"3C",X"3C",X"3C",X"3C",X"78",X"70",X"60",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"04",X"0C",X"0E",X"1E",X"3D",X"3F",X"17",X"0F",X"2F",X"3F",X"19",X"03",X"03",X"03",X"01",
+ X"00",X"00",X"60",X"F0",X"70",X"F0",X"E0",X"E6",X"C7",X"B3",X"F0",X"F0",X"F8",X"F8",X"F0",X"B0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"E0",X"40",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FF",X"07",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"40",X"00",X"40",X"E0",X"FF",X"FF",X"FF",X"E0",X"40",X"03",X"0F",X"1F",X"7F",X"FC",X"FF",X"FF",
+ X"00",X"00",X"00",X"00",X"FE",X"FF",X"FF",X"3F",X"FE",X"F8",X"F0",X"C0",X"02",X"07",X"FF",X"FF",
+ X"40",X"E0",X"F8",X"FC",X"FE",X"FF",X"EF",X"47",X"03",X"47",X"EF",X"FF",X"FE",X"FC",X"F8",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"02",X"87",X"FF",X"FF",X"FF",X"87",X"03",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"70",X"E0",X"E0",X"70",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"10",X"10",X"30",X"60",X"21",X"61",X"61",X"21",X"60",X"30",X"10",X"10",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"70",X"E0",X"E0",X"70",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"10",X"10",X"30",X"60",X"21",X"61",X"61",X"21",X"60",X"30",X"10",X"10",X"00",X"00",
+ X"00",X"00",X"00",X"84",X"C3",X"F1",X"F9",X"81",X"81",X"F9",X"F1",X"C3",X"84",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"87",X"8D",X"8D",X"87",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"60",X"E0",X"F0",X"CC",X"60",X"30",X"0F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"20",X"60",X"61",X"21",X"61",X"40",X"60",X"A0",X"00",X"00",X"00",X"01",X"00",X"00",X"00",X"00",
+ X"70",X"88",X"80",X"F1",X"F9",X"F1",X"E3",X"03",X"87",X"0E",X"3C",X"C0",X"F0",X"70",X"E0",X"C0",
+ X"00",X"00",X"00",X"00",X"80",X"80",X"86",X"0D",X"0D",X"07",X"03",X"FF",X"FE",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"09",X"04",X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"80",X"C8",X"8C",X"07",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"38",X"38",X"34",X"1A",X"13",X"0F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"0C",X"18",X"18",X"30",X"20",X"E0",X"A0",X"00",
+ X"01",X"03",X"07",X"1F",X"7E",X"F8",X"E0",X"7F",X"7F",X"3E",X"73",X"61",X"00",X"00",X"00",X"00",
+ X"E0",X"E0",X"00",X"06",X"0C",X"0D",X"07",X"E7",X"FF",X"FE",X"36",X"CC",X"78",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"38",X"44",X"C0",X"F8",X"FC",X"F8",X"71",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"18",X"38",X"38",X"34",X"12",X"13",X"0F",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"0C",X"18",X"18",X"30",X"20",X"E0",X"A0",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"70",X"E0",X"E0",X"70",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"10",X"11",X"31",X"63",X"27",X"66",X"66",X"27",X"63",X"31",X"11",X"10",X"00",X"00",
+ X"00",X"00",X"10",X"8C",X"87",X"C3",X"E3",X"03",X"03",X"E3",X"C3",X"87",X"8C",X"10",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"87",X"8D",X"8D",X"87",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"0F",X"70",X"E0",X"E0",X"70",X"0F",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"10",X"11",X"31",X"63",X"27",X"66",X"66",X"27",X"63",X"31",X"11",X"10",X"00",X"00",
+ X"00",X"00",X"10",X"8C",X"83",X"C1",X"E1",X"01",X"01",X"E1",X"C1",X"83",X"8C",X"10",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"87",X"8D",X"8D",X"87",X"80",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"60",X"F0",X"FF",X"C7",X"6C",X"3F",
+ X"00",X"00",X"01",X"12",X"36",X"27",X"27",X"67",X"63",X"20",X"60",X"E0",X"B0",X"D1",X"C0",X"80",
+ X"00",X"00",X"C0",X"20",X"00",X"C1",X"E1",X"C1",X"81",X"03",X"07",X"0F",X"8F",X"1E",X"30",X"E3",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"86",X"8D",X"8D",X"87",X"07",X"0F",X"FF",X"FF",
+ X"38",X"70",X"60",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FE",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F7",X"DF",X"DE",X"66",X"3B",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"10",X"98",X"CF",X"87",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"60",X"F1",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"02",X"12",X"37",X"67",X"67",X"23",X"20",X"70",X"D0",X"80",
+ X"0F",X"3F",X"FE",X"F8",X"C1",X"FF",X"7B",X"39",X"70",X"60",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"87",X"07",X"0F",X"7F",X"FF",X"FF",X"7B",X"9B",X"EE",X"1C",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"C0",X"20",X"00",X"C0",X"E1",X"C1",X"81",X"03",X"03",X"07",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"86",X"8C",X"8D",
+ X"E7",X"FF",X"DE",X"67",X"39",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"10",X"98",X"CF",X"87",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"60",X"F1",
+ X"00",X"00",X"00",X"00",X"00",X"01",X"02",X"16",X"37",X"67",X"67",X"23",X"20",X"70",X"D0",X"80",
+ X"0F",X"3F",X"FE",X"F8",X"C1",X"FF",X"7B",X"39",X"70",X"60",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"87",X"07",X"0F",X"7F",X"FF",X"FF",X"7B",X"9B",X"EE",X"1C",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"C0",X"20",X"00",X"C0",X"E0",X"C0",X"80",X"01",X"01",X"03",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"86",X"8C",X"8D",
+ X"00",X"00",X"00",X"07",X"38",X"70",X"70",X"38",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"10",X"10",X"30",X"7C",X"3E",X"60",X"60",X"3E",X"7C",X"30",X"10",X"10",X"00",X"00",X"00",X"00",
+ X"20",X"38",X"1E",X"0F",X"07",X"07",X"07",X"07",X"0F",X"1E",X"38",X"20",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"07",X"0D",X"0D",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"0F",X"70",X"E0",X"E0",X"70",X"0F",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"10",X"10",X"30",X"7C",X"3E",X"60",X"60",X"3E",X"7C",X"30",X"10",X"10",X"00",X"00",X"00",X"00",
+ X"60",X"78",X"3E",X"1F",X"0F",X"0F",X"0F",X"0F",X"1F",X"3E",X"78",X"60",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"07",X"0D",X"0D",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"60",X"F0",X"FF",X"C7",X"6C",X"3F",X"00",X"00",X"00",
+ X"1C",X"22",X"20",X"3C",X"7E",X"7C",X"38",X"60",X"F0",X"90",X"90",X"C0",X"80",X"00",X"00",X"00",
+ X"0E",X"0F",X"0F",X"0F",X"0F",X"0F",X"0E",X"1E",X"3C",X"78",X"30",X"3F",X"1C",X"38",X"30",X"00",
+ X"00",X"00",X"00",X"00",X"06",X"0D",X"0D",X"07",X"07",X"0F",X"7F",X"FF",X"FE",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"10",X"38",X"7F",X"71",X"67",X"6F",X"66",X"30",X"1F",X"00",X"00",
+ X"60",X"7C",X"3E",X"3C",X"78",X"50",X"C0",X"80",X"90",X"4C",X"6F",X"6F",X"C3",X"83",X"00",X"00",
+ X"0F",X"0F",X"0F",X"0F",X"1F",X"0F",X"1E",X"3E",X"3C",X"7B",X"E3",X"FF",X"FF",X"FD",X"38",X"30",
+ X"00",X"00",X"06",X"0C",X"0D",X"07",X"07",X"3F",X"FF",X"FF",X"FF",X"FB",X"33",X"86",X"FC",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"1C",X"22",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"71",X"FF",X"E3",X"CE",X"DE",X"CC",X"61",X"3F",X"00",
+ X"60",X"7C",X"3E",X"3C",X"78",X"50",X"C0",X"80",X"10",X"0C",X"8F",X"CF",X"C7",X"83",X"00",X"00",
+ X"07",X"07",X"07",X"07",X"0F",X"0F",X"1E",X"1E",X"1C",X"7B",X"E3",X"FF",X"FD",X"FC",X"38",X"30",
+ X"00",X"00",X"06",X"0D",X"0D",X"07",X"07",X"3F",X"C7",X"7F",X"FF",X"F3",X"86",X"FC",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"1C",X"22",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"06",
+ X"00",X"00",X"00",X"00",X"70",X"E0",X"E0",X"70",X"3E",X"0F",X"03",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"01",X"11",X"30",X"20",X"61",X"61",X"01",X"41",X"E1",X"21",X"20",X"00",X"00",X"00",
+ X"00",X"00",X"8C",X"C7",X"C3",X"F1",X"F9",X"81",X"81",X"F9",X"F1",X"C0",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"80",X"86",X"8D",X"8D",X"87",X"83",X"FF",X"FC",X"00",X"00",X"00",X"00",
+ X"08",X"07",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"80",X"D0",X"88",X"0C",X"06",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"30",X"70",X"70",X"78",X"26",X"20",X"11",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"08",X"08",X"18",X"18",X"30",X"20",X"30",X"10",X"00",
+ X"01",X"03",X"07",X"0F",X"3E",X"F8",X"E0",X"5F",X"7F",X"3B",X"71",X"60",X"00",X"00",X"00",X"00",
+ X"80",X"80",X"00",X"06",X"0C",X"0D",X"07",X"E7",X"FF",X"3E",X"CC",X"78",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"38",X"44",X"C0",X"F8",X"FC",X"F8",X"71",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"01",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"C0",X"E0",X"F8",X"3C",X"1F",X"07",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"04",X"06",X"07",X"07",X"03",X"03",X"03",
+ X"00",X"00",X"10",X"10",X"02",X"12",X"10",X"10",X"18",X"0C",X"07",X"0F",X"07",X"07",X"03",X"81",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"18",X"1C",X"0F",X"07",X"03",X"01",X"11",X"08",X"00",X"00",X"00",X"1C",X"1F",X"07",X"03",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"07",X"03",X"01",X"00",X"00",X"18",X"1C",X"07",X"03",X"02",X"02",X"12",X"12",X"02",X"02",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"0C",X"05",X"01",X"10",X"10",X"10",X"10",X"02",X"02",X"00",X"00",X"18",X"0C",X"06",X"0E",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"08",X"0C",X"0F",X"0F",X"0F",X"07",X"01",X"00",X"02",X"02",X"02",X"02",X"00",X"00",X"00",X"08",
+ X"70",X"10",X"00",X"00",X"60",X"F0",X"F0",X"F0",X"70",X"10",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E7",X"67",X"61",X"60",X"60",X"60",X"70",X"50",X"00",X"00",X"00",X"80",X"80",X"C0",X"F0",X"F0",
+ X"80",X"F8",X"FC",X"FC",X"3C",X"1C",X"04",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"60",X"20",X"00",X"00",X"04",X"86",X"C7",X"E7",X"E1",X"60",X"60",X"00",X"00",X"00",X"C4",X"E6",
+ X"18",X"18",X"18",X"18",X"08",X"00",X"80",X"C0",X"F0",X"F8",X"3E",X"1F",X"07",X"03",X"00",X"00",
+ X"80",X"E4",X"E6",X"67",X"67",X"23",X"03",X"43",X"63",X"63",X"63",X"63",X"63",X"63",X"63",X"61",
+ X"03",X"01",X"00",X"00",X"00",X"30",X"38",X"3E",X"1F",X"07",X"03",X"00",X"00",X"00",X"18",X"18",
+ X"60",X"70",X"F3",X"F3",X"33",X"23",X"20",X"60",X"60",X"60",X"60",X"20",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"F0",X"FF",X"FF",X"7F",X"07",X"00",X"00",X"00",X"E0",X"20",X"03",X"03",X"03",
+ X"00",X"00",X"00",X"80",X"A0",X"B0",X"B0",X"B0",X"30",X"30",X"70",X"70",X"70",X"70",X"10",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"70",X"70",X"70",X"70",X"70",X"70",X"70",X"70",X"70",X"70",X"10",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"60",X"20",X"00",X"00",X"60",X"F0",X"F0",X"F0",X"70",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"F0",X"F0",X"F0",X"70",X"70",X"60",X"20",X"00",X"00",X"40",X"E0",X"E0",X"E0",X"60",X"60",X"60",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"F0",X"F0",X"F0",X"70",X"70",X"00",X"00",X"00",X"80",X"C0",X"E0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"06",X"06",X"06",X"02",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"18",X"08",X"08",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"03",X"01",X"00",X"00",X"0C",X"0F",X"07",X"03",X"03",X"01",X"00",X"00",X"00",X"04",X"04",
+ X"04",X"80",X"80",X"30",X"38",X"0E",X"07",X"01",X"80",X"C0",X"C0",X"E0",X"F1",X"70",X"38",X"38",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"03",
+ X"00",X"30",X"38",X"0C",X"04",X"00",X"00",X"30",X"38",X"0E",X"07",X"01",X"00",X"30",X"38",X"0C",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"3C",X"1E",X"0E",X"07",X"07",X"23",X"11",X"00",X"00",X"00",X"30",X"3C",X"3E",X"0F",X"07",X"01",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"20",X"30",X"38",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"E0",X"E1",X"E1",X"E0",X"E0",X"E0",X"E0",X"60",X"60",X"20",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"C0",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"C1",X"F1",X"F9",X"39",X"19",X"09",X"01",X"C1",X"C1",X"41",X"80",X"C0",X"C0",X"C0",X"E0",X"E0",
+ X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",
+ X"C1",X"C1",X"C1",X"C1",X"C1",X"F1",X"F9",X"39",X"19",X"09",X"01",X"C1",X"C1",X"C1",X"C1",X"C1",
+ X"80",X"A0",X"B0",X"3C",X"3C",X"0E",X"07",X"01",X"00",X"00",X"10",X"18",X"18",X"18",X"08",X"00",
+ X"00",X"00",X"00",X"01",X"81",X"C1",X"E1",X"F1",X"79",X"39",X"18",X"09",X"07",X"83",X"C3",X"C1",
+ X"C0",X"C0",X"C0",X"C0",X"C0",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"00",X"80",X"80",X"80",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"C0",X"C0",X"C0",X"C0",X"C0",X"C0",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"FC",X"FF",X"3F",X"1F",X"07",X"03",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"03",X"83",X"83",X"13",X"13",X"83",X"82",X"C0",X"C0",X"FF",X"9F",X"03",X"03",X"03",X"00",X"40",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"63",X"73",X"63",X"63",X"61",X"61",X"23",X"13",X"03",X"03",X"00",X"C0",X"E3",X"3B",X"1F",X"07",
+ X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"00",X"00",X"80",X"80",X"80",
+ X"40",X"60",X"78",X"7C",X"7D",X"3D",X"0D",X"05",X"11",X"11",X"13",X"13",X"03",X"03",X"00",X"40",
+ X"00",X"00",X"00",X"00",X"00",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"80",X"00");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_palette.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_palette.vhd
new file mode 100644
index 00000000..2b7c12e4
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_palette.vhd
@@ -0,0 +1,38 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_spr_palette is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(7 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_spr_palette is
+ type rom is array(0 to 255) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"00",X"01",X"02",X"03",X"04",X"05",X"06",X"07",X"00",X"02",X"08",X"01",X"03",X"05",X"04",X"07",
+ X"00",X"06",X"05",X"0A",X"02",X"04",X"0B",X"00",X"00",X"04",X"09",X"0A",X"01",X"06",X"05",X"00",
+ X"00",X"03",X"07",X"04",X"00",X"00",X"00",X"00",X"00",X"09",X"0A",X"04",X"05",X"0C",X"03",X"07",
+ X"00",X"01",X"08",X"02",X"03",X"05",X"04",X"07",X"00",X"02",X"08",X"06",X"03",X"05",X"04",X"07",
+ X"00",X"06",X"08",X"02",X"03",X"05",X"04",X"07",X"00",X"08",X"08",X"01",X"03",X"05",X"04",X"07",
+ X"00",X"02",X"08",X"01",X"03",X"05",X"04",X"07",X"00",X"07",X"02",X"08",X"04",X"05",X"01",X"03",
+ X"00",X"06",X"02",X"08",X"04",X"05",X"01",X"07",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"04",X"02",X"03",X"04",X"05",X"06",X"07",X"00",X"07",X"02",X"03",X"04",X"05",X"06",X"07",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_rgb_lut.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_rgb_lut.vhd
new file mode 100644
index 00000000..e74e14cc
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/proms/travusa_spr_rgb_lut.vhd
@@ -0,0 +1,24 @@
+library ieee;
+use ieee.std_logic_1164.all,ieee.numeric_std.all;
+
+entity travusa_spr_rgb_lut is
+port (
+ clk : in std_logic;
+ addr : in std_logic_vector(4 downto 0);
+ data : out std_logic_vector(7 downto 0)
+);
+end entity;
+
+architecture prom of travusa_spr_rgb_lut is
+ type rom is array(0 to 31) of std_logic_vector(7 downto 0);
+ signal rom_data: rom := (
+ X"00",X"C0",X"F8",X"2F",X"01",X"07",X"38",X"FF",X"D8",X"98",X"88",X"5A",X"9C",X"00",X"00",X"00",
+ X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00",X"00");
+begin
+process(clk)
+begin
+ if rising_edge(clk) then
+ data <= rom_data(to_integer(unsigned(addr)));
+ end if;
+end process;
+end architecture;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80.vhd
new file mode 100644
index 00000000..2fd8f9f5
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80.vhd
@@ -0,0 +1,1175 @@
+--------------------------------------------------------------------------------
+-- ****
+-- T80(c) core. Attempt to finish all undocumented features and provide
+-- accurate timings.
+-- Version 350.
+-- Copyright (c) 2018 Sorgelig
+-- Test passed: ZEXDOC, ZEXALL, Z80Full(*), Z80memptr
+-- (*) Currently only SCF and CCF instructions aren't passed X/Y flags check as
+-- correct implementation is still unclear.
+--
+-- ****
+-- 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 301 parity flag is just parity for 8080, also overflow for Z80, by Sean Riddle
+-- Ver 300 started tidyup.
+--
+-- MikeJ March 2005
+-- Latest version from www.fpgaarcade.com (original www.opencores.org)
+--
+-- ****
+-- Z80 compatible microprocessor core
+--
+-- 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
+-- 0210 : Fixed wait and halt
+-- 0211 : Fixed Refresh addition and IM 1
+-- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test
+-- 0232 : Removed refresh address output for Mode > 1 and added DJNZ M1_n fix by Mike Johnson
+-- 0235 : Added clock enable and IM 2 fix by Mike Johnson
+-- 0237 : Changed 8080 I/O address output, added IntE output
+-- 0238 : Fixed (IX/IY+d) timing and 16 bit ADC and SBC zero flag
+-- 0240 : Added interrupt ack fix by Mike Johnson, changed (IX/IY+d) timing and changed flags in GB mode
+-- 0242 : Added I/O wait, fixed refresh address, moved some registers to RAM
+-- 0247 : Fixed bus req/ack cycle
+--
+
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+use IEEE.STD_LOGIC_UNSIGNED.all;
+
+entity T80 is
+ generic(
+ Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
+ IOWait : integer := 0; -- 0 => 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;
+ out0 : in std_logic := '0'; -- 0 => OUT(C),0, 1 => OUT(C),255
+ REG : out std_logic_vector(211 downto 0); -- IFF2, IFF1, IM, IY, HL', DE', BC', IX, HL, DE, BC, PC, SP, R, I, F', A', F, A
+
+ DIRSet : in std_logic := '0';
+ DIR : in std_logic_vector(211 downto 0) := (others => '0') -- IFF2, IFF1, IM, IY, HL', DE', BC', IX, HL, DE, BC, PC, SP, R, I, F', A', F, A
+ );
+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 aZI : std_logic_vector(2 downto 0) := "110";
+
+ -- Registers
+ signal ACC, F : std_logic_vector(7 downto 0);
+ signal Ap, Fp : std_logic_vector(7 downto 0);
+ signal I : std_logic_vector(7 downto 0);
+ signal R : unsigned(7 downto 0);
+ signal SP, PC : unsigned(15 downto 0);
+
+ signal RegDIH : std_logic_vector(7 downto 0);
+ signal RegDIL : std_logic_vector(7 downto 0);
+ signal RegBusA : std_logic_vector(15 downto 0);
+ signal RegBusB : std_logic_vector(15 downto 0);
+ signal RegBusC : std_logic_vector(15 downto 0);
+ signal RegAddrA_r : std_logic_vector(2 downto 0);
+ signal RegAddrA : std_logic_vector(2 downto 0);
+ signal RegAddrB_r : std_logic_vector(2 downto 0);
+ signal RegAddrB : std_logic_vector(2 downto 0);
+ signal RegAddrC : std_logic_vector(2 downto 0);
+ signal RegWEH : std_logic;
+ signal RegWEL : std_logic;
+ signal Alternate : std_logic;
+
+ -- Help Registers
+ signal WZ : std_logic_vector(15 downto 0); -- MEMPTR register
+ signal IR : std_logic_vector(7 downto 0); -- Instruction register
+ signal ISet : std_logic_vector(1 downto 0); -- Instruction set selector
+ signal RegBusA_r : std_logic_vector(15 downto 0);
+
+ signal ID16 : signed(15 downto 0);
+ signal Save_Mux : std_logic_vector(7 downto 0);
+
+ signal TState : unsigned(2 downto 0);
+ signal MCycle : std_logic_vector(2 downto 0);
+ signal IntE_FF1 : std_logic;
+ signal IntE_FF2 : std_logic;
+ signal Halt_FF : std_logic;
+ signal BusReq_s : std_logic := '0';
+ signal BusAck : std_logic := '0';
+ signal ClkEn : std_logic;
+ signal NMI_s : std_logic;
+ signal IStatus : std_logic_vector(1 downto 0);
+
+ signal DI_Reg : std_logic_vector(7 downto 0);
+ signal T_Res : std_logic;
+ signal XY_State : std_logic_vector(1 downto 0);
+ signal Pre_XY_F_M : std_logic_vector(2 downto 0);
+ signal NextIs_XY_Fetch : std_logic;
+ signal XY_Ind : std_logic;
+ signal No_BTR : std_logic;
+ signal BTR_r : std_logic;
+ signal Auto_Wait : std_logic;
+ signal Auto_Wait_t1 : std_logic;
+ signal Auto_Wait_t2 : std_logic;
+ signal IncDecZ : std_logic;
+
+ -- ALU signals
+ signal BusB : std_logic_vector(7 downto 0);
+ signal BusA : std_logic_vector(7 downto 0);
+ signal ALU_Q : std_logic_vector(7 downto 0);
+ signal F_Out : std_logic_vector(7 downto 0);
+
+ -- Registered micro code outputs
+ signal Read_To_Reg_r : std_logic_vector(4 downto 0);
+ signal Arith16_r : std_logic;
+ signal Z16_r : std_logic;
+ signal ALU_Op_r : std_logic_vector(3 downto 0);
+ signal Save_ALU_r : std_logic;
+ signal PreserveC_r : std_logic;
+ signal MCycles : std_logic_vector(2 downto 0);
+
+ -- Micro code outputs
+ signal MCycles_d : std_logic_vector(2 downto 0);
+ signal TStates : std_logic_vector(2 downto 0);
+ signal IntCycle : std_logic;
+ signal NMICycle : std_logic;
+ signal Inc_PC : std_logic;
+ signal Inc_WZ : std_logic;
+ signal IncDec_16 : std_logic_vector(3 downto 0);
+ signal Prefix : std_logic_vector(1 downto 0);
+ signal Read_To_Acc : std_logic;
+ signal Read_To_Reg : std_logic;
+ signal Set_BusB_To : std_logic_vector(3 downto 0);
+ signal Set_BusA_To : std_logic_vector(3 downto 0);
+ signal ALU_Op : std_logic_vector(3 downto 0);
+ signal Save_ALU : std_logic;
+ signal PreserveC : std_logic;
+ signal Arith16 : std_logic;
+ signal Set_Addr_To : std_logic_vector(2 downto 0);
+ signal Jump : std_logic;
+ signal JumpE : std_logic;
+ signal JumpXY : std_logic;
+ signal Call : std_logic;
+ signal RstP : std_logic;
+ signal LDZ : std_logic;
+ signal LDW : std_logic;
+ signal LDSPHL : std_logic;
+ signal IORQ_i : std_logic;
+ signal Special_LD : std_logic_vector(2 downto 0);
+ signal ExchangeDH : std_logic;
+ signal ExchangeRp : std_logic;
+ signal ExchangeAF : std_logic;
+ signal ExchangeRS : std_logic;
+ signal I_DJNZ : std_logic;
+ signal I_CPL : std_logic;
+ signal I_CCF : std_logic;
+ signal I_SCF : std_logic;
+ signal I_RETN : std_logic;
+ signal I_BT : std_logic;
+ signal I_BC : std_logic;
+ signal I_BTR : std_logic;
+ signal I_RLD : std_logic;
+ signal I_RRD : std_logic;
+ signal I_RXDD : std_logic;
+ signal I_INRC : std_logic;
+ signal SetWZ : std_logic_vector(1 downto 0);
+ signal SetDI : std_logic;
+ signal SetEI : std_logic;
+ signal IMode : std_logic_vector(1 downto 0);
+ signal Halt : std_logic;
+ signal XYbit_undoc : std_logic;
+ signal DOR : std_logic_vector(127 downto 0);
+
+begin
+
+ REG <= IntE_FF2 & IntE_FF1 & IStatus & DOR & std_logic_vector(PC) & std_logic_vector(SP) & std_logic_vector(R) & I & Fp & Ap & F & ACC when Alternate = '0'
+ else IntE_FF2 & IntE_FF1 & IStatus & DOR(127 downto 112) & DOR(47 downto 0) & DOR(63 downto 48) & DOR(111 downto 64) &
+ std_logic_vector(PC) & std_logic_vector(SP) & std_logic_vector(R) & I & Fp & Ap & F & ACC;
+
+ mcode : work.T80_MCode
+ 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)
+ port map(
+ 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,
+ SetWZ => SetWZ,
+ SetDI => SetDI,
+ SetEI => SetEI,
+ IMode => IMode,
+ Halt => Halt,
+ NoRead => NoRead,
+ Write => Write,
+ XYbit_undoc => XYbit_undoc);
+
+ alu : work.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)
+ port map(
+ Arith16 => Arith16_r,
+ Z16 => Z16_r,
+ WZ => WZ,
+ XY_State=> XY_State,
+ 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;
+
+ T_Res <= '1' when TState = unsigned(TStates) else '0';
+
+ NextIs_XY_Fetch <= '1' when XY_State /= "00" and XY_Ind = '0' and
+ ((Set_Addr_To = aXY) or
+ (MCycle = "001" and IR = "11001011") or
+ (MCycle = "001" and IR = "00110110")) else '0';
+
+ Save_Mux <= BusB when ExchangeRp = '1' else
+ DI_Reg when Save_ALU_r = '0' else
+ ALU_Q;
+
+ process (RESET_n, CLK_n)
+ variable n : std_logic_vector(7 downto 0);
+ variable ioq : std_logic_vector(8 downto 0);
+ begin
+ if RESET_n = '0' then
+ PC <= (others => '0'); -- Program Counter
+ A <= (others => '0');
+ WZ <= (others => '0');
+ IR <= "00000000";
+ ISet <= "00";
+ XY_State <= "00";
+ IStatus <= "00";
+ MCycles <= "000";
+ DO <= "00000000";
+
+ ACC <= (others => '1');
+ F <= (others => '1');
+ Ap <= (others => '1');
+ Fp <= (others => '1');
+ I <= (others => '0');
+ R <= (others => '0');
+ SP <= (others => '1');
+ Alternate <= '0';
+
+ Read_To_Reg_r <= "00000";
+ Arith16_r <= '0';
+ BTR_r <= '0';
+ Z16_r <= '0';
+ ALU_Op_r <= "0000";
+ Save_ALU_r <= '0';
+ PreserveC_r <= '0';
+ XY_Ind <= '0';
+ I_RXDD <= '0';
+
+ elsif rising_edge(CLK_n) then
+
+ if DIRSet = '1' then
+ ACC <= DIR( 7 downto 0);
+ F <= DIR(15 downto 8);
+ Ap <= DIR(23 downto 16);
+ Fp <= DIR(31 downto 24);
+ I <= DIR(39 downto 32);
+ R <= unsigned(DIR(47 downto 40));
+ SP <= unsigned(DIR(63 downto 48));
+ PC <= unsigned(DIR(79 downto 64));
+ A <= DIR(79 downto 64);
+ IStatus <= DIR(209 downto 208);
+
+ elsif ClkEn = '1' then
+ ALU_Op_r <= "0000";
+ Save_ALU_r <= '0';
+ Read_To_Reg_r <= "00000";
+
+ MCycles <= MCycles_d;
+
+ if IMode /= "11" then
+ IStatus <= IMode;
+ end if;
+
+ Arith16_r <= Arith16;
+ PreserveC_r <= PreserveC;
+ if ISet = "10" and ALU_OP(2) = '0' and ALU_OP(0) = '1' and MCycle = "011" then
+ Z16_r <= '1';
+ else
+ Z16_r <= '0';
+ end if;
+
+ if MCycle = "001" and TState(2) = '0' then
+ -- MCycle = 1 and TState = 1, 2, or 3
+
+ if TState = 2 and Wait_n = '1' then
+ if Mode < 2 then
+ A(7 downto 0) <= std_logic_vector(R);
+ A(15 downto 8) <= I;
+ R(6 downto 0) <= R(6 downto 0) + 1;
+ end if;
+
+ if Jump = '0' and Call = '0' and NMICycle = '0' and IntCycle = '0' and not (Halt_FF = '1' or Halt = '1') then
+ PC <= PC + 1;
+ end if;
+
+ if IntCycle = '1' and IStatus = "01" then
+ IR <= "11111111";
+ elsif Halt_FF = '1' or (IntCycle = '1' and IStatus = "10") or NMICycle = '1' then
+ IR <= "00000000";
+ else
+ IR <= DInst;
+ end if;
+
+ ISet <= "00";
+ if Prefix /= "00" then
+ if Prefix = "11" then
+ if IR(5) = '1' then
+ XY_State <= "10";
+ else
+ XY_State <= "01";
+ end if;
+ else
+ if Prefix = "10" then
+ XY_State <= "00";
+ XY_Ind <= '0';
+ end if;
+ ISet <= Prefix;
+ end if;
+ else
+ XY_State <= "00";
+ XY_Ind <= '0';
+ end if;
+ end if;
+
+ else
+ -- either (MCycle > 1) OR (MCycle = 1 AND TState > 3)
+
+ if MCycle = "110" then
+ XY_Ind <= '1';
+ if Prefix = "01" then
+ ISet <= "01";
+ end if;
+ end if;
+
+ if T_Res = '1' then
+ BTR_r <= (I_BT or I_BC or I_BTR) and not No_BTR;
+ if Jump = '1' then
+ A(15 downto 8) <= DI_Reg;
+ A(7 downto 0) <= WZ(7 downto 0);
+ PC(15 downto 8) <= unsigned(DI_Reg);
+ PC(7 downto 0) <= unsigned(WZ(7 downto 0));
+ elsif JumpXY = '1' then
+ A <= RegBusC;
+ PC <= unsigned(RegBusC);
+ elsif Call = '1' or RstP = '1' then
+ A <= WZ;
+ PC <= unsigned(WZ);
+ elsif MCycle = MCycles and NMICycle = '1' then
+ A <= "0000000001100110";
+ PC <= "0000000001100110";
+ elsif MCycle = "011" and IntCycle = '1' and IStatus = "10" then
+ A(15 downto 8) <= I;
+ A(7 downto 0) <= WZ(7 downto 0);
+ PC(15 downto 8) <= unsigned(I);
+ PC(7 downto 0) <= unsigned(WZ(7 downto 0));
+ else
+ case Set_Addr_To is
+ when aXY =>
+ if XY_State = "00" then
+ A <= RegBusC;
+ else
+ if NextIs_XY_Fetch = '1' then
+ A <= std_logic_vector(PC);
+ else
+ A <= WZ;
+ end if;
+ end if;
+ when aIOA =>
+ if Mode = 3 then
+ -- Memory map I/O on GBZ80
+ A(15 downto 8) <= (others => '1');
+ elsif Mode = 2 then
+ -- Duplicate I/O address on 8080
+ A(15 downto 8) <= DI_Reg;
+ else
+ A(15 downto 8) <= ACC;
+ end if;
+ A(7 downto 0) <= DI_Reg;
+ WZ <= (ACC & DI_Reg) + "1";
+ when aSP =>
+ A <= std_logic_vector(SP);
+ when aBC =>
+ if Mode = 3 and IORQ_i = '1' then
+ -- Memory map I/O on GBZ80
+ A(15 downto 8) <= (others => '1');
+ A(7 downto 0) <= RegBusC(7 downto 0);
+ else
+ A <= RegBusC;
+ if SetWZ = "01" then
+ WZ <= RegBusC + "1";
+ end if;
+ if SetWZ = "10" then
+ WZ(7 downto 0) <= RegBusC(7 downto 0) + "1";
+ WZ(15 downto 8) <= ACC;
+ end if;
+ end if;
+ when aDE =>
+ A <= RegBusC;
+ if SetWZ = "10" then
+ WZ(7 downto 0) <= RegBusC(7 downto 0) + "1";
+ WZ(15 downto 8) <= ACC;
+ end if;
+ when aZI =>
+ if Inc_WZ = '1' then
+ A <= std_logic_vector(unsigned(WZ) + 1);
+ else
+ A(15 downto 8) <= DI_Reg;
+ A(7 downto 0) <= WZ(7 downto 0);
+ if SetWZ = "10" then
+ WZ(7 downto 0) <= WZ(7 downto 0) + "1";
+ WZ(15 downto 8) <= ACC;
+ end if;
+ end if;
+ when others =>
+ A <= std_logic_vector(PC);
+ end case;
+ end if;
+
+ if SetWZ = "11" then
+ WZ <= std_logic_vector(ID16);
+ end if;
+
+ Save_ALU_r <= Save_ALU;
+ ALU_Op_r <= ALU_Op;
+
+ if I_CPL = '1' then
+ -- CPL
+ ACC <= not ACC;
+ F(Flag_Y) <= not ACC(5);
+ F(Flag_H) <= '1';
+ F(Flag_X) <= not ACC(3);
+ F(Flag_N) <= '1';
+ end if;
+ if I_CCF = '1' then
+ -- CCF
+ F(Flag_C) <= not F(Flag_C);
+ F(Flag_Y) <= ACC(5);
+ F(Flag_H) <= F(Flag_C);
+ F(Flag_X) <= ACC(3);
+ F(Flag_N) <= '0';
+ end if;
+ if I_SCF = '1' then
+ -- SCF
+ F(Flag_C) <= '1';
+ F(Flag_Y) <= ACC(5);
+ F(Flag_H) <= '0';
+ F(Flag_X) <= ACC(3);
+ F(Flag_N) <= '0';
+ end if;
+ end if;
+
+ if (TState = 2 and I_BTR = '1' and IR(0) = '1') or (TState = 1 and I_BTR = '1' and IR(0) = '0') then
+ ioq := ('0' & DI_Reg) + ('0' & std_logic_vector(ID16(7 downto 0)));
+ F(Flag_N) <= DI_Reg(7);
+ F(Flag_C) <= ioq(8);
+ F(Flag_H) <= ioq(8);
+ ioq := (ioq and x"7") xor ('0'&BusA);
+ F(Flag_P) <= not (ioq(0) xor ioq(1) xor ioq(2) xor ioq(3) xor ioq(4) xor ioq(5) xor ioq(6) xor ioq(7));
+ end if;
+
+ if TState = 2 and Wait_n = '1' then
+ if ISet = "01" and MCycle = "111" then
+ IR <= DInst;
+ end if;
+ if JumpE = '1' then
+ PC <= unsigned(signed(PC) + signed(DI_Reg));
+ WZ <= std_logic_vector(signed(PC) + signed(DI_Reg));
+ elsif Inc_PC = '1' then
+ PC <= PC + 1;
+ end if;
+ if BTR_r = '1' then
+ PC <= PC - 2;
+ end if;
+ if RstP = '1' then
+ WZ <= (others =>'0');
+ WZ(5 downto 3) <= IR(5 downto 3);
+ end if;
+ end if;
+ if TState = 3 and MCycle = "110" then
+ WZ <= std_logic_vector(signed(RegBusC) + signed(DI_Reg));
+ end if;
+
+ if MCycle = "011" and TState = 4 and No_BTR = '0' then
+ if I_BT = '1' or I_BC = '1' then
+ WZ <= std_logic_vector(PC)-"1";
+ end if;
+ end if;
+
+ if (TState = 2 and Wait_n = '1') or (TState = 4 and MCycle = "001") then
+ if IncDec_16(2 downto 0) = "111" then
+ if IncDec_16(3) = '1' then
+ SP <= SP - 1;
+ else
+ SP <= SP + 1;
+ end if;
+ end if;
+ end if;
+
+ if LDSPHL = '1' then
+ SP <= unsigned(RegBusC);
+ end if;
+ if ExchangeAF = '1' then
+ Ap <= ACC;
+ ACC <= Ap;
+ Fp <= F;
+ F <= Fp;
+ end if;
+ if ExchangeRS = '1' then
+ Alternate <= not Alternate;
+ end if;
+ end if;
+
+ if TState = 3 then
+ if LDZ = '1' then
+ WZ(7 downto 0) <= DI_Reg;
+ end if;
+ if LDW = '1' then
+ WZ(15 downto 8) <= DI_Reg;
+ end if;
+
+ if Special_LD(2) = '1' then
+ case Special_LD(1 downto 0) is
+ when "00" =>
+ ACC <= I;
+ F(Flag_P) <= IntE_FF2;
+ F(Flag_S) <= I(7);
+
+ if I = x"00" then
+ F(Flag_Z) <= '1';
+ else
+ F(Flag_Z) <= '0';
+ end if;
+
+ F(Flag_Y) <= I(5);
+ F(Flag_H) <= '0';
+ F(Flag_X) <= I(3);
+ F(Flag_N) <= '0';
+
+
+ when "01" =>
+ ACC <= std_logic_vector(R);
+ F(Flag_P) <= IntE_FF2;
+ F(Flag_S) <= R(7);
+
+ if R = x"00" then
+ F(Flag_Z) <= '1';
+ else
+ F(Flag_Z) <= '0';
+ end if;
+
+ F(Flag_Y) <= R(5);
+ F(Flag_H) <= '0';
+ F(Flag_X) <= R(3);
+ F(Flag_N) <= '0';
+
+ when "10" =>
+ I <= ACC;
+ when others =>
+ R <= unsigned(ACC);
+ end case;
+ end if;
+ end if;
+
+ if (I_DJNZ = '0' and Save_ALU_r = '1') or ALU_Op_r = "1001" then
+ if Mode = 3 then
+ F(6) <= F_Out(6);
+ F(5) <= F_Out(5);
+ F(7) <= F_Out(7);
+ if PreserveC_r = '0' then
+ F(4) <= F_Out(4);
+ end if;
+ else
+ F(7 downto 1) <= F_Out(7 downto 1);
+ if PreserveC_r = '0' then
+ F(Flag_C) <= F_Out(0);
+ end if;
+ end if;
+ end if;
+ if T_Res = '1' and I_INRC = '1' then
+ F(Flag_H) <= '0';
+ F(Flag_N) <= '0';
+ F(Flag_X) <= DI_Reg(3);
+ F(Flag_Y) <= DI_Reg(5);
+ if DI_Reg(7 downto 0) = "00000000" then
+ F(Flag_Z) <= '1';
+ else
+ F(Flag_Z) <= '0';
+ end if;
+ F(Flag_S) <= DI_Reg(7);
+ F(Flag_P) <= not (DI_Reg(0) xor DI_Reg(1) xor DI_Reg(2) xor DI_Reg(3) xor
+ DI_Reg(4) xor DI_Reg(5) xor DI_Reg(6) xor DI_Reg(7));
+ end if;
+
+ if TState = 1 and Auto_Wait_t1 = '0' then
+ -- Keep D0 from M3 for RLD/RRD (Sorgelig)
+ I_RXDD <= I_RLD or I_RRD;
+ if I_RXDD='0' then
+ DO <= BusB;
+ end if;
+ if I_RLD = '1' then
+ DO(3 downto 0) <= BusA(3 downto 0);
+ DO(7 downto 4) <= BusB(3 downto 0);
+ end if;
+ if I_RRD = '1' then
+ DO(3 downto 0) <= BusB(7 downto 4);
+ DO(7 downto 4) <= BusA(3 downto 0);
+ end if;
+ end if;
+
+ if T_Res = '1' then
+ Read_To_Reg_r(3 downto 0) <= Set_BusA_To;
+ Read_To_Reg_r(4) <= Read_To_Reg;
+ if Read_To_Acc = '1' then
+ Read_To_Reg_r(3 downto 0) <= "0111";
+ Read_To_Reg_r(4) <= '1';
+ end if;
+ end if;
+
+ if TState = 1 and I_BT = '1' then
+ F(Flag_X) <= ALU_Q(3);
+ F(Flag_Y) <= ALU_Q(1);
+ F(Flag_H) <= '0';
+ F(Flag_N) <= '0';
+ end if;
+ if TState = 1 and I_BC = '1' then
+ n := ALU_Q - ("0000000" & F_Out(Flag_H));
+ F(Flag_X) <= n(3);
+ F(Flag_Y) <= n(1);
+ end if;
+ if I_BC = '1' or I_BT = '1' then
+ F(Flag_P) <= IncDecZ;
+ end if;
+
+ if (TState = 1 and Save_ALU_r = '0' and Auto_Wait_t1 = '0') or
+ (Save_ALU_r = '1' and ALU_OP_r /= "0111") then
+ case Read_To_Reg_r is
+ when "10111" =>
+ ACC <= Save_Mux;
+ when "10110" =>
+ DO <= Save_Mux;
+ when "11000" =>
+ SP(7 downto 0) <= unsigned(Save_Mux);
+ when "11001" =>
+ SP(15 downto 8) <= unsigned(Save_Mux);
+ when "11011" =>
+ F <= Save_Mux;
+ when others =>
+ end case;
+ if XYbit_undoc='1' then
+ DO <= ALU_Q;
+ end if;
+ end if;
+ end if;
+ end if;
+ end process;
+
+---------------------------------------------------------------------------
+--
+-- BC('), DE('), HL('), IX and IY
+--
+---------------------------------------------------------------------------
+ process (CLK_n)
+ begin
+ if rising_edge(CLK_n) then
+ if ClkEn = '1' then
+ -- Bus A / Write
+ RegAddrA_r <= Alternate & Set_BusA_To(2 downto 1);
+ if XY_Ind = '0' and XY_State /= "00" and Set_BusA_To(2 downto 1) = "10" then
+ RegAddrA_r <= XY_State(1) & "11";
+ end if;
+
+ -- Bus B
+ RegAddrB_r <= Alternate & Set_BusB_To(2 downto 1);
+ if XY_Ind = '0' and XY_State /= "00" and Set_BusB_To(2 downto 1) = "10" then
+ RegAddrB_r <= XY_State(1) & "11";
+ end if;
+
+ -- Address from register
+ RegAddrC <= Alternate & Set_Addr_To(1 downto 0);
+ -- Jump (HL), LD SP,HL
+ if (JumpXY = '1' or LDSPHL = '1') then
+ RegAddrC <= Alternate & "10";
+ end if;
+ if ((JumpXY = '1' or LDSPHL = '1') and XY_State /= "00") or (MCycle = "110") then
+ RegAddrC <= XY_State(1) & "11";
+ end if;
+
+ if I_DJNZ = '1' and Save_ALU_r = '1' and Mode < 2 then
+ IncDecZ <= F_Out(Flag_Z);
+ end if;
+ if (TState = 2 or (TState = 3 and MCycle = "001")) and IncDec_16(2 downto 0) = "100" then
+ if ID16 = 0 then
+ IncDecZ <= '0';
+ else
+ IncDecZ <= '1';
+ end if;
+ end if;
+
+ RegBusA_r <= RegBusA;
+ end if;
+ end if;
+ end process;
+
+ RegAddrA <=
+ -- 16 bit increment/decrement
+ Alternate & IncDec_16(1 downto 0) when (TState = 2 or
+ (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and XY_State = "00" else
+ XY_State(1) & "11" when (TState = 2 or
+ (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and IncDec_16(1 downto 0) = "10" else
+ -- EX HL,DL
+ Alternate & "10" when ExchangeDH = '1' and TState = 3 else
+ Alternate & "01" when ExchangeDH = '1' and TState = 4 else
+ -- Bus A / Write
+ RegAddrA_r;
+
+ RegAddrB <=
+ -- EX HL,DL
+ Alternate & "01" when ExchangeDH = '1' and TState = 3 else
+ -- Bus B
+ RegAddrB_r;
+
+ ID16 <= signed(RegBusA) - 1 when IncDec_16(3) = '1' else
+ signed(RegBusA) + 1;
+
+ process (Save_ALU_r, Auto_Wait_t1, ALU_OP_r, Read_To_Reg_r,
+ ExchangeDH, IncDec_16, MCycle, TState, Wait_n)
+ begin
+ RegWEH <= '0';
+ RegWEL <= '0';
+ if (TState = 1 and Save_ALU_r = '0' and Auto_Wait_t1 = '0') or
+ (Save_ALU_r = '1' and ALU_OP_r /= "0111") then
+ case Read_To_Reg_r is
+ when "10000" | "10001" | "10010" | "10011" | "10100" | "10101" =>
+ RegWEH <= not Read_To_Reg_r(0);
+ RegWEL <= Read_To_Reg_r(0);
+ when others =>
+ end case;
+ end if;
+
+ if ExchangeDH = '1' and (TState = 3 or TState = 4) then
+ RegWEH <= '1';
+ RegWEL <= '1';
+ end if;
+
+ if IncDec_16(2) = '1' and ((TState = 2 and Wait_n = '1' and MCycle /= "001") or (TState = 3 and MCycle = "001")) then
+ case IncDec_16(1 downto 0) is
+ when "00" | "01" | "10" =>
+ RegWEH <= '1';
+ RegWEL <= '1';
+ when others =>
+ end case;
+ end if;
+ end process;
+
+ process (Save_Mux, RegBusB, RegBusA_r, ID16,
+ ExchangeDH, IncDec_16, MCycle, TState, Wait_n)
+ begin
+ RegDIH <= Save_Mux;
+ RegDIL <= Save_Mux;
+
+ if ExchangeDH = '1' and TState = 3 then
+ RegDIH <= RegBusB(15 downto 8);
+ RegDIL <= RegBusB(7 downto 0);
+ end if;
+ if ExchangeDH = '1' and TState = 4 then
+ RegDIH <= RegBusA_r(15 downto 8);
+ RegDIL <= RegBusA_r(7 downto 0);
+ end if;
+
+ if IncDec_16(2) = '1' and ((TState = 2 and MCycle /= "001") or (TState = 3 and MCycle = "001")) then
+ RegDIH <= std_logic_vector(ID16(15 downto 8));
+ RegDIL <= std_logic_vector(ID16(7 downto 0));
+ end if;
+ end process;
+
+ Regs : work.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),
+ DOR => DOR,
+ DIRSet => DIRSet,
+ DIR => DIR(207 downto 80));
+
+---------------------------------------------------------------------------
+--
+-- Buses
+--
+---------------------------------------------------------------------------
+ process (CLK_n)
+ begin
+ if rising_edge(CLK_n) then
+ if ClkEn = '1' then
+ case Set_BusB_To is
+ when "0111" =>
+ BusB <= ACC;
+ when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" =>
+ if Set_BusB_To(0) = '1' then
+ BusB <= RegBusB(7 downto 0);
+ else
+ BusB <= RegBusB(15 downto 8);
+ end if;
+ when "0110" =>
+ BusB <= DI_Reg;
+ when "1000" =>
+ BusB <= std_logic_vector(SP(7 downto 0));
+ when "1001" =>
+ BusB <= std_logic_vector(SP(15 downto 8));
+ when "1010" =>
+ BusB <= "00000001";
+ when "1011" =>
+ BusB <= F;
+ when "1100" =>
+ BusB <= std_logic_vector(PC(7 downto 0));
+ when "1101" =>
+ BusB <= std_logic_vector(PC(15 downto 8));
+ when "1110" =>
+ if IR = x"71" and out0 = '1' then
+ BusB <= "11111111";
+ else
+ BusB <= "00000000";
+ end if;
+ when others =>
+ BusB <= "--------";
+ end case;
+
+ case Set_BusA_To is
+ when "0111" =>
+ BusA <= ACC;
+ when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" =>
+ if Set_BusA_To(0) = '1' then
+ BusA <= RegBusA(7 downto 0);
+ else
+ BusA <= RegBusA(15 downto 8);
+ end if;
+ when "0110" =>
+ BusA <= DI_Reg;
+ when "1000" =>
+ BusA <= std_logic_vector(SP(7 downto 0));
+ when "1001" =>
+ BusA <= std_logic_vector(SP(15 downto 8));
+ when "1010" =>
+ BusA <= "00000000";
+ when others =>
+ BusA <= "--------";
+ end case;
+ if XYbit_undoc='1' then
+ BusA <= DI_Reg;
+ BusB <= DI_Reg;
+ end if;
+ end if;
+ end if;
+ end process;
+
+---------------------------------------------------------------------------
+--
+-- Generate external control signals
+--
+---------------------------------------------------------------------------
+ process (RESET_n,CLK_n)
+ begin
+ if RESET_n = '0' then
+ RFSH_n <= '1';
+ elsif rising_edge(CLK_n) then
+ if DIRSet = '0' and CEN = '1' then
+ if MCycle = "001" and ((TState = 2 and Wait_n = '1') or TState = 3) then
+ RFSH_n <= '0';
+ else
+ RFSH_n <= '1';
+ end if;
+ end if;
+ end if;
+ end process;
+
+ MC <= std_logic_vector(MCycle);
+ TS <= std_logic_vector(TState);
+ DI_Reg <= DI;
+ HALT_n <= not Halt_FF;
+ BUSAK_n <= not (BusAck and RESET_n);
+ IntCycle_n <= not IntCycle;
+ IntE <= IntE_FF1;
+ IORQ <= IORQ_i;
+ Stop <= I_DJNZ;
+
+-------------------------------------------------------------------------
+--
+-- Main state machine
+--
+-------------------------------------------------------------------------
+ process (RESET_n, CLK_n)
+ variable OldNMI_n : std_logic;
+ begin
+ if RESET_n = '0' then
+ MCycle <= "001";
+ TState <= "000";
+ Pre_XY_F_M <= "000";
+ Halt_FF <= '0';
+ --BusAck <= '0';
+ NMICycle <= '0';
+ IntCycle <= '0';
+ IntE_FF1 <= '0';
+ IntE_FF2 <= '0';
+ No_BTR <= '0';
+ Auto_Wait_t1 <= '0';
+ Auto_Wait_t2 <= '0';
+ M1_n <= '1';
+ --BusReq_s <= '0';
+ NMI_s <= '0';
+ elsif rising_edge(CLK_n) then
+
+ if DIRSet = '1' then
+ IntE_FF2 <= DIR(211);
+ IntE_FF1 <= DIR(210);
+ else
+ if NMI_n = '0' and OldNMI_n = '1' then
+ NMI_s <= '1';
+ end if;
+ OldNMI_n := NMI_n;
+
+ if CEN = '1' then
+ BusReq_s <= not BUSRQ_n;
+ Auto_Wait_t2 <= Auto_Wait_t1;
+ if T_Res = '1' then
+ Auto_Wait_t1 <= '0';
+ Auto_Wait_t2 <= '0';
+ else
+ Auto_Wait_t1 <= Auto_Wait or IORQ_i;
+ end if;
+ No_BTR <= (I_BT and (not IR(4) or not F(Flag_P))) or
+ (I_BC and (not IR(4) or F(Flag_Z) or not F(Flag_P))) or
+ (I_BTR and (not IR(4) or F(Flag_Z)));
+ if TState = 2 then
+ if SetEI = '1' then
+ IntE_FF1 <= '1';
+ IntE_FF2 <= '1';
+ end if;
+ if I_RETN = '1' then
+ IntE_FF1 <= IntE_FF2;
+ end if;
+ end if;
+ if TState = 3 then
+ if SetDI = '1' then
+ IntE_FF1 <= '0';
+ IntE_FF2 <= '0';
+ end if;
+ end if;
+ if IntCycle = '1' or NMICycle = '1' then
+ Halt_FF <= '0';
+ end if;
+ if MCycle = "001" and TState = 2 and Wait_n = '1' then
+ M1_n <= '1';
+ end if;
+ if BusReq_s = '1' and BusAck = '1' then
+ else
+ BusAck <= '0';
+ if TState = 2 and Wait_n = '0' then
+ elsif T_Res = '1' then
+ if Halt = '1' then
+ Halt_FF <= '1';
+ end if;
+ if BusReq_s = '1' then
+ BusAck <= '1';
+ else
+ TState <= "001";
+ if NextIs_XY_Fetch = '1' then
+ MCycle <= "110";
+ Pre_XY_F_M <= MCycle;
+ if IR = "00110110" and Mode = 0 then
+ Pre_XY_F_M <= "010";
+ end if;
+ elsif (MCycle = "111") or (MCycle = "110" and Mode = 1 and ISet /= "01") then
+ MCycle <= std_logic_vector(unsigned(Pre_XY_F_M) + 1);
+ elsif (MCycle = MCycles) or No_BTR = '1' or (MCycle = "010" and I_DJNZ = '1' and IncDecZ = '1') then
+ M1_n <= '0';
+ MCycle <= "001";
+ IntCycle <= '0';
+ NMICycle <= '0';
+ if NMI_s = '1' and Prefix = "00" then
+ NMI_s <= '0';
+ NMICycle <= '1';
+ IntE_FF1 <= '0';
+ elsif IntE_FF1 = '1' and INT_n='0' and Prefix = "00" and SetEI = '0' then
+ IntCycle <= '1';
+ IntE_FF1 <= '0';
+ IntE_FF2 <= '0';
+ end if;
+ else
+ MCycle <= std_logic_vector(unsigned(MCycle) + 1);
+ end if;
+ end if;
+ else
+ if (Auto_Wait = '1' and Auto_Wait_t2 = '0') nor
+ (IOWait = 1 and IORQ_i = '1' and Auto_Wait_t1 = '0') then
+ TState <= TState + 1;
+ end if;
+ end if;
+ end if;
+ if TState = 0 then
+ M1_n <= '0';
+ end if;
+ end if;
+ end if;
+ end if;
+ end process;
+
+ Auto_Wait <= '1' when IntCycle = '1' and MCycle = "001" else '0';
+end;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_ALU.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_ALU.vhd
new file mode 100644
index 00000000..a9438aed
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_ALU.vhd
@@ -0,0 +1,376 @@
+--------------------------------------------------------------------------------
+-- ****
+-- T80(c) core. Attempt to finish all undocumented features and provide
+-- accurate timings.
+-- Version 350.
+-- Copyright (c) 2018 Sorgelig
+-- Test passed: ZEXDOC, ZEXALL, Z80Full(*), Z80memptr
+-- (*) Currently only SCF and CCF instructions aren't passed X/Y flags check as
+-- correct implementation is still unclear.
+--
+-- ****
+-- T80(b) core. In an effort to merge and maintain bug fixes ....
+--
+-- Ver 301 parity flag is just parity for 8080, also overflow for Z80, by Sean Riddle
+-- Ver 300 started tidyup
+-- MikeJ March 2005
+-- Latest version from www.fpgaarcade.com (original www.opencores.org)
+--
+-- ****
+-- Z80 compatible microprocessor core
+--
+-- 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 :
+--
+-- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test
+-- 0238 : Fixed zero flag for 16 bit SBC and ADC
+-- 0240 : Added GB operations
+-- 0242 : Cleanup
+-- 0247 : Cleanup
+--
+
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+
+entity T80_ALU is
+ 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;
+ WZ : in std_logic_vector(15 downto 0);
+ XY_State : in std_logic_vector(1 downto 0);
+ 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
+
+ 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);
+ else
+ B_i := unsigned(B);
+ end if;
+
+ Res_i := unsigned("0" & A & Carry_In) + unsigned("0" & B_i & "1");
+ Carry <= Res_i(A'length + 1);
+ Res <= std_logic_vector(Res_i(A'length downto 1));
+ end;
+
+ -- AddSub variables (temporary signals)
+ signal UseCarry : std_logic;
+ signal Carry7_v : std_logic;
+ signal Overflow_v : std_logic;
+ signal HalfCarry_v : std_logic;
+ signal Carry_v : std_logic;
+ signal Q_v : std_logic_vector(7 downto 0);
+
+ signal BitMask : std_logic_vector(7 downto 0);
+
+begin
+
+ with IR(5 downto 3) select BitMask <= "00000001" when "000",
+ "00000010" when "001",
+ "00000100" when "010",
+ "00001000" when "011",
+ "00010000" when "100",
+ "00100000" when "101",
+ "01000000" when "110",
+ "10000000" when others;
+
+ UseCarry <= not ALU_Op(2) and ALU_Op(0);
+ AddSub(BusA(3 downto 0), BusB(3 downto 0), ALU_Op(1), ALU_Op(1) xor (UseCarry and F_In(Flag_C)), Q_v(3 downto 0), HalfCarry_v);
+ AddSub(BusA(6 downto 4), BusB(6 downto 4), ALU_Op(1), HalfCarry_v, Q_v(6 downto 4), Carry7_v);
+ AddSub(BusA(7 downto 7), BusB(7 downto 7), ALU_Op(1), Carry7_v, Q_v(7 downto 7), Carry_v);
+
+ -- bug fix - parity flag is just parity for 8080, also overflow for Z80
+ process (Carry_v, Carry7_v, Q_v)
+ begin
+ if(Mode=2) then
+ OverFlow_v <= not (Q_v(0) xor Q_v(1) xor Q_v(2) xor Q_v(3) xor
+ Q_v(4) xor Q_v(5) xor Q_v(6) xor Q_v(7)); else
+ OverFlow_v <= Carry_v xor Carry7_v;
+ end if;
+ end process;
+
+ process (Arith16, ALU_OP, F_In, BusA, BusB, IR, Q_v, Carry_v, HalfCarry_v, OverFlow_v, BitMask, ISet, Z16, WZ, XY_State)
+ variable Q_t : std_logic_vector(7 downto 0);
+ variable DAA_Q : unsigned(8 downto 0);
+ begin
+ Q_t := "--------";
+ F_Out <= F_In;
+ DAA_Q := "---------";
+ case ALU_Op is
+ when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" | "0110" | "0111" =>
+ F_Out(Flag_N) <= '0';
+ F_Out(Flag_C) <= '0';
+ case ALU_OP(2 downto 0) is
+ when "000" | "001" => -- ADD, ADC
+ Q_t := Q_v;
+ F_Out(Flag_C) <= Carry_v;
+ F_Out(Flag_H) <= HalfCarry_v;
+ F_Out(Flag_P) <= OverFlow_v;
+ when "010" | "011" | "111" => -- SUB, SBC, CP
+ Q_t := Q_v;
+ F_Out(Flag_N) <= '1';
+ F_Out(Flag_C) <= not Carry_v;
+ F_Out(Flag_H) <= not HalfCarry_v;
+ F_Out(Flag_P) <= OverFlow_v;
+ when "100" => -- AND
+ Q_t(7 downto 0) := BusA and BusB;
+ F_Out(Flag_H) <= '1';
+ when "101" => -- XOR
+ Q_t(7 downto 0) := BusA xor BusB;
+ F_Out(Flag_H) <= '0';
+ when others => -- OR "110"
+ Q_t(7 downto 0) := BusA or BusB;
+ F_Out(Flag_H) <= '0';
+ end case;
+ if ALU_Op(2 downto 0) = "111" then -- CP
+ F_Out(Flag_X) <= BusB(3);
+ F_Out(Flag_Y) <= BusB(5);
+ else
+ F_Out(Flag_X) <= Q_t(3);
+ F_Out(Flag_Y) <= Q_t(5);
+ end if;
+ if Q_t(7 downto 0) = "00000000" then
+ F_Out(Flag_Z) <= '1';
+ if Z16 = '1' then
+ F_Out(Flag_Z) <= F_In(Flag_Z); -- 16 bit ADC,SBC
+ end if;
+ else
+ F_Out(Flag_Z) <= '0';
+ end if;
+ F_Out(Flag_S) <= Q_t(7);
+ case ALU_Op(2 downto 0) is
+ when "000" | "001" | "010" | "011" | "111" => -- ADD, ADC, SUB, SBC, CP
+ when others =>
+ F_Out(Flag_P) <= not (Q_t(0) xor Q_t(1) xor Q_t(2) xor Q_t(3) xor
+ Q_t(4) xor Q_t(5) xor Q_t(6) xor Q_t(7));
+ end case;
+ if Arith16 = '1' then
+ F_Out(Flag_S) <= F_In(Flag_S);
+ F_Out(Flag_Z) <= F_In(Flag_Z);
+ F_Out(Flag_P) <= F_In(Flag_P);
+ end if;
+ when "1100" =>
+ -- DAA
+ F_Out(Flag_H) <= F_In(Flag_H);
+ F_Out(Flag_C) <= F_In(Flag_C);
+ DAA_Q(7 downto 0) := unsigned(BusA);
+ DAA_Q(8) := '0';
+ if F_In(Flag_N) = '0' then
+ -- After addition
+ -- Alow > 9 or H = 1
+ if DAA_Q(3 downto 0) > 9 or F_In(Flag_H) = '1' then
+ if (DAA_Q(3 downto 0) > 9) then
+ F_Out(Flag_H) <= '1';
+ else
+ F_Out(Flag_H) <= '0';
+ end if;
+ DAA_Q := DAA_Q + 6;
+ end if;
+ -- new Ahigh > 9 or C = 1
+ if DAA_Q(8 downto 4) > 9 or F_In(Flag_C) = '1' then
+ DAA_Q := DAA_Q + 96; -- 0x60
+ end if;
+ else
+ -- After subtraction
+ if DAA_Q(3 downto 0) > 9 or F_In(Flag_H) = '1' then
+ if DAA_Q(3 downto 0) > 5 then
+ F_Out(Flag_H) <= '0';
+ end if;
+ DAA_Q(7 downto 0) := DAA_Q(7 downto 0) - 6;
+ end if;
+ if unsigned(BusA) > 153 or F_In(Flag_C) = '1' then
+ DAA_Q := DAA_Q - 352; -- 0x160
+ end if;
+ end if;
+ F_Out(Flag_X) <= DAA_Q(3);
+ F_Out(Flag_Y) <= DAA_Q(5);
+ F_Out(Flag_C) <= F_In(Flag_C) or DAA_Q(8);
+ Q_t := std_logic_vector(DAA_Q(7 downto 0));
+ if DAA_Q(7 downto 0) = "00000000" then
+ F_Out(Flag_Z) <= '1';
+ else
+ F_Out(Flag_Z) <= '0';
+ end if;
+ F_Out(Flag_S) <= DAA_Q(7);
+ F_Out(Flag_P) <= not (DAA_Q(0) xor DAA_Q(1) xor DAA_Q(2) xor DAA_Q(3) xor
+ DAA_Q(4) xor DAA_Q(5) xor DAA_Q(6) xor DAA_Q(7));
+ when "1101" | "1110" =>
+ -- RLD, RRD
+ Q_t(7 downto 4) := BusA(7 downto 4);
+ if ALU_Op(0) = '1' then
+ Q_t(3 downto 0) := BusB(7 downto 4);
+ else
+ Q_t(3 downto 0) := BusB(3 downto 0);
+ end if;
+ F_Out(Flag_H) <= '0';
+ F_Out(Flag_N) <= '0';
+ F_Out(Flag_X) <= Q_t(3);
+ F_Out(Flag_Y) <= Q_t(5);
+ if Q_t(7 downto 0) = "00000000" then
+ F_Out(Flag_Z) <= '1';
+ else
+ F_Out(Flag_Z) <= '0';
+ end if;
+ F_Out(Flag_S) <= Q_t(7);
+ F_Out(Flag_P) <= not (Q_t(0) xor Q_t(1) xor Q_t(2) xor Q_t(3) xor
+ Q_t(4) xor Q_t(5) xor Q_t(6) xor Q_t(7));
+ when "1001" =>
+ -- BIT
+ Q_t(7 downto 0) := BusB and BitMask;
+ F_Out(Flag_S) <= Q_t(7);
+ if Q_t(7 downto 0) = "00000000" then
+ F_Out(Flag_Z) <= '1';
+ F_Out(Flag_P) <= '1';
+ else
+ F_Out(Flag_Z) <= '0';
+ F_Out(Flag_P) <= '0';
+ end if;
+ F_Out(Flag_H) <= '1';
+ F_Out(Flag_N) <= '0';
+ if IR(2 downto 0) = "110" or XY_State /= "00" then
+ F_Out(Flag_X) <= WZ(11);
+ F_Out(Flag_Y) <= WZ(13);
+ else
+ F_Out(Flag_X) <= BusB(3);
+ F_Out(Flag_Y) <= BusB(5);
+ end if;
+ when "1010" =>
+ -- SET
+ Q_t(7 downto 0) := BusB or BitMask;
+ when "1011" =>
+ -- RES
+ Q_t(7 downto 0) := BusB and not BitMask;
+ when "1000" =>
+ -- ROT
+ case IR(5 downto 3) is
+ when "000" => -- RLC
+ Q_t(7 downto 1) := BusA(6 downto 0);
+ Q_t(0) := BusA(7);
+ F_Out(Flag_C) <= BusA(7);
+ when "010" => -- RL
+ Q_t(7 downto 1) := BusA(6 downto 0);
+ Q_t(0) := F_In(Flag_C);
+ F_Out(Flag_C) <= BusA(7);
+ when "001" => -- RRC
+ Q_t(6 downto 0) := BusA(7 downto 1);
+ Q_t(7) := BusA(0);
+ F_Out(Flag_C) <= BusA(0);
+ when "011" => -- RR
+ Q_t(6 downto 0) := BusA(7 downto 1);
+ Q_t(7) := F_In(Flag_C);
+ F_Out(Flag_C) <= BusA(0);
+ when "100" => -- SLA
+ Q_t(7 downto 1) := BusA(6 downto 0);
+ Q_t(0) := '0';
+ F_Out(Flag_C) <= BusA(7);
+ when "110" => -- SLL (Undocumented) / SWAP
+ if Mode = 3 then
+ Q_t(7 downto 4) := BusA(3 downto 0);
+ Q_t(3 downto 0) := BusA(7 downto 4);
+ F_Out(Flag_C) <= '0';
+ else
+ Q_t(7 downto 1) := BusA(6 downto 0);
+ Q_t(0) := '1';
+ F_Out(Flag_C) <= BusA(7);
+ end if;
+ when "101" => -- SRA
+ Q_t(6 downto 0) := BusA(7 downto 1);
+ Q_t(7) := BusA(7);
+ F_Out(Flag_C) <= BusA(0);
+ when others => -- SRL
+ Q_t(6 downto 0) := BusA(7 downto 1);
+ Q_t(7) := '0';
+ F_Out(Flag_C) <= BusA(0);
+ end case;
+ F_Out(Flag_H) <= '0';
+ F_Out(Flag_N) <= '0';
+ F_Out(Flag_X) <= Q_t(3);
+ F_Out(Flag_Y) <= Q_t(5);
+ F_Out(Flag_S) <= Q_t(7);
+ if Q_t(7 downto 0) = "00000000" then
+ F_Out(Flag_Z) <= '1';
+ else
+ F_Out(Flag_Z) <= '0';
+ end if;
+ F_Out(Flag_P) <= not (Q_t(0) xor Q_t(1) xor Q_t(2) xor Q_t(3) xor
+ Q_t(4) xor Q_t(5) xor Q_t(6) xor Q_t(7));
+ if ISet = "00" then
+ F_Out(Flag_P) <= F_In(Flag_P);
+ F_Out(Flag_S) <= F_In(Flag_S);
+ F_Out(Flag_Z) <= F_In(Flag_Z);
+ end if;
+ when others =>
+ null;
+ end case;
+ Q <= Q_t;
+ end process;
+end;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_MCode.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_MCode.vhd
new file mode 100644
index 00000000..f5312bd6
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_MCode.vhd
@@ -0,0 +1,2035 @@
+--------------------------------------------------------------------------------
+-- ****
+-- T80(c) core. Attempt to finish all undocumented features and provide
+-- accurate timings.
+-- Version 350.
+-- Copyright (c) 2018 Sorgelig
+-- Test passed: ZEXDOC, ZEXALL, Z80Full(*), Z80memptr
+-- (*) Currently only SCF and CCF instructions aren't passed X/Y flags check as
+-- correct implementation is still unclear.
+--
+-- ****
+-- 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 :
+--
+-- 0208 : First complete release
+-- 0211 : Fixed IM 1
+-- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test
+-- 0235 : Added IM 2 fix by Mike Johnson
+-- 0238 : Added NoRead signal
+-- 0238b: Fixed instruction timing for POP and DJNZ
+-- 0240 : Added (IX/IY+d) states, removed op-codes from mode 2 and added all remaining mode 3 op-codes
+-- 0240mj1 fix for HL inc/dec for INI, IND, INIR, INDR, OUTI, OUTD, OTIR, OTDR
+-- 0242 : Fixed I/O instruction timing, cleanup
+--
+
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+
+entity T80_MCode is
+ 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,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;
+ SetWZ : out std_logic_vector(1 downto 0);
+ 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";
+
+ function is_cc_true(
+ F : std_logic_vector(7 downto 0);
+ cc : bit_vector(2 downto 0)
+ ) return boolean is
+ begin
+ if Mode = 3 then
+ case cc is
+ when "000" => return F(Flag_S) = '0'; -- NZ
+ when "001" => return F(Flag_S) = '1'; -- Z
+ when "010" => return F(Flag_H) = '0'; -- NC
+ when "011" => return F(Flag_H) = '1'; -- C
+ when "100" => return false;
+ when "101" => return false;
+ when "110" => return false;
+ when "111" => return false;
+ end case;
+ else
+ case cc is
+ when "000" => return F(Flag_Z) = '0'; -- NZ
+ when "001" => return F(Flag_Z) = '1'; -- Z
+ when "010" => return F(Flag_C) = '0'; -- NC
+ when "011" => return F(Flag_C) = '1'; -- C
+ when "100" => return F(Flag_P) = '0'; -- PO
+ when "101" => return F(Flag_P) = '1'; -- PE
+ when "110" => return F(Flag_S) = '0'; -- P
+ when "111" => return F(Flag_S) = '1'; -- M
+ end case;
+ end if;
+ end;
+
+begin
+
+ 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);
+ variable IRB : bit_vector(7 downto 0);
+ begin
+ DDD := IR(5 downto 3);
+ SSS := IR(2 downto 0);
+ DPair := IR(5 downto 4);
+ IRB := to_bitvector(IR);
+
+ MCycles <= "001";
+ if MCycle = "001" then
+ TStates <= "100";
+ else
+ TStates <= "011";
+ end if;
+ Prefix <= "00";
+ Inc_PC <= '0';
+ Inc_WZ <= '0';
+ IncDec_16 <= "0000";
+ Read_To_Acc <= '0';
+ Read_To_Reg <= '0';
+ Set_BusB_To <= "0000";
+ Set_BusA_To <= "0000";
+ ALU_Op <= "0" & IR(5 downto 3);
+ Save_ALU <= '0';
+ PreserveC <= '0';
+ Arith16 <= '0';
+ IORQ <= '0';
+ Set_Addr_To <= aNone;
+ Jump <= '0';
+ JumpE <= '0';
+ JumpXY <= '0';
+ Call <= '0';
+ RstP <= '0';
+ LDZ <= '0';
+ LDW <= '0';
+ LDSPHL <= '0';
+ Special_LD <= "000";
+ ExchangeDH <= '0';
+ ExchangeRp <= '0';
+ ExchangeAF <= '0';
+ ExchangeRS <= '0';
+ I_DJNZ <= '0';
+ I_CPL <= '0';
+ I_CCF <= '0';
+ I_SCF <= '0';
+ I_RETN <= '0';
+ I_BT <= '0';
+ I_BC <= '0';
+ I_BTR <= '0';
+ I_RLD <= '0';
+ I_RRD <= '0';
+ I_INRC <= '0';
+ SetDI <= '0';
+ SetEI <= '0';
+ IMode <= "11";
+ Halt <= '0';
+ NoRead <= '0';
+ Write <= '0';
+ XYbit_undoc <= '0';
+ SetWZ <= "00";
+
+ case ISet is
+ when "00" =>
+
+------------------------------------------------------------------------------
+--
+-- Unprefixed instructions
+--
+------------------------------------------------------------------------------
+
+ case IRB is
+-- 8 BIT LOAD GROUP
+ when "01000000"|"01000001"|"01000010"|"01000011"|"01000100"|"01000101"|"01000111"
+ |"01001000"|"01001001"|"01001010"|"01001011"|"01001100"|"01001101"|"01001111"
+ |"01010000"|"01010001"|"01010010"|"01010011"|"01010100"|"01010101"|"01010111"
+ |"01011000"|"01011001"|"01011010"|"01011011"|"01011100"|"01011101"|"01011111"
+ |"01100000"|"01100001"|"01100010"|"01100011"|"01100100"|"01100101"|"01100111"
+ |"01101000"|"01101001"|"01101010"|"01101011"|"01101100"|"01101101"|"01101111"
+ |"01111000"|"01111001"|"01111010"|"01111011"|"01111100"|"01111101"|"01111111" =>
+ -- LD r,r'
+ Set_BusB_To(2 downto 0) <= SSS;
+ ExchangeRp <= '1';
+ Set_BusA_To(2 downto 0) <= DDD;
+ Read_To_Reg <= '1';
+ when "00000110"|"00001110"|"00010110"|"00011110"|"00100110"|"00101110"|"00111110" =>
+ -- LD r,n
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ Set_BusA_To(2 downto 0) <= DDD;
+ Read_To_Reg <= '1';
+ when others => null;
+ end case;
+ when "01000110"|"01001110"|"01010110"|"01011110"|"01100110"|"01101110"|"01111110" =>
+ -- LD r,(HL)
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ when 2 =>
+ Set_BusA_To(2 downto 0) <= DDD;
+ Read_To_Reg <= '1';
+ when others => null;
+ end case;
+ when "01110000"|"01110001"|"01110010"|"01110011"|"01110100"|"01110101"|"01110111" =>
+ -- LD (HL),r
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ Set_BusB_To(2 downto 0) <= SSS;
+ Set_BusB_To(3) <= '0';
+ when 2 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ when "00110110" =>
+ -- LD (HL),n
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ Set_Addr_To <= aXY;
+ Set_BusB_To(2 downto 0) <= SSS;
+ Set_BusB_To(3) <= '0';
+ when 3 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ when "00001010" =>
+ -- LD A,(BC)
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aBC;
+ when 2 =>
+ Read_To_Acc <= '1';
+ when others => null;
+ end case;
+ when "00011010" =>
+ -- LD A,(DE)
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aDE;
+ when 2 =>
+ Read_To_Acc <= '1';
+ when others => null;
+ end case;
+ when "00111010" =>
+ if Mode = 3 then
+ -- LDD A,(HL)
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ when 2 =>
+ Read_To_Acc <= '1';
+ IncDec_16 <= "1110";
+ when others => null;
+ end case;
+ else
+ -- LD A,(nn)
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ Inc_PC <= '1';
+ when 4 =>
+ Read_To_Acc <= '1';
+ when others => null;
+ end case;
+ end if;
+ when "00000010" =>
+ -- LD (BC),A
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aBC;
+ Set_BusB_To <= "0111";
+ SetWZ <= "10";
+ when 2 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ when "00010010" =>
+ -- LD (DE),A
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aDE;
+ Set_BusB_To <= "0111";
+ SetWZ <= "10";
+ when 2 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ when "00110010" =>
+ if Mode = 3 then
+ -- LDD (HL),A
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ Set_BusB_To <= "0111";
+ when 2 =>
+ Write <= '1';
+ IncDec_16 <= "1110";
+ when others => null;
+ end case;
+ else
+ -- LD (nn),A
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ SetWZ <= "10";
+ Inc_PC <= '1';
+ Set_BusB_To <= "0111";
+ when 4 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ end if;
+
+-- 16 BIT LOAD GROUP
+ when "00000001"|"00010001"|"00100001"|"00110001" =>
+ -- LD dd,nn
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ Read_To_Reg <= '1';
+ if DPAIR = "11" then
+ Set_BusA_To(3 downto 0) <= "1000";
+ else
+ Set_BusA_To(2 downto 1) <= DPAIR;
+ Set_BusA_To(0) <= '1';
+ end if;
+ when 3 =>
+ Inc_PC <= '1';
+ Read_To_Reg <= '1';
+ if DPAIR = "11" then
+ Set_BusA_To(3 downto 0) <= "1001";
+ else
+ Set_BusA_To(2 downto 1) <= DPAIR;
+ Set_BusA_To(0) <= '0';
+ end if;
+ when others => null;
+ end case;
+ when "00101010" =>
+ if Mode = 3 then
+ -- LDI A,(HL)
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ when 2 =>
+ Read_To_Acc <= '1';
+ IncDec_16 <= "0110";
+ when others => null;
+ end case;
+ else
+ -- LD HL,(nn)
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ Inc_PC <= '1';
+ LDW <= '1';
+ when 4 =>
+ Set_BusA_To(2 downto 0) <= "101"; -- L
+ Read_To_Reg <= '1';
+ Inc_WZ <= '1';
+ Set_Addr_To <= aZI;
+ when 5 =>
+ Set_BusA_To(2 downto 0) <= "100"; -- H
+ Read_To_Reg <= '1';
+ when others => null;
+ end case;
+ end if;
+ when "00100010" =>
+ if Mode = 3 then
+ -- LDI (HL),A
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ Set_BusB_To <= "0111";
+ when 2 =>
+ Write <= '1';
+ IncDec_16 <= "0110";
+ when others => null;
+ end case;
+ else
+ -- LD (nn),HL
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ Inc_PC <= '1';
+ LDW <= '1';
+ Set_BusB_To <= "0101"; -- L
+ when 4 =>
+ Inc_WZ <= '1';
+ Set_Addr_To <= aZI;
+ Write <= '1';
+ Set_BusB_To <= "0100"; -- H
+ when 5 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ end if;
+ when "11111001" =>
+ -- LD SP,HL
+ TStates <= "110";
+ LDSPHL <= '1';
+ when "11000101"|"11010101"|"11100101"|"11110101" =>
+ -- PUSH qq
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ TStates <= "101";
+ IncDec_16 <= "1111";
+ Set_Addr_TO <= aSP;
+ if DPAIR = "11" then
+ Set_BusB_To <= "0111";
+ else
+ Set_BusB_To(2 downto 1) <= DPAIR;
+ Set_BusB_To(0) <= '0';
+ Set_BusB_To(3) <= '0';
+ end if;
+ when 2 =>
+ IncDec_16 <= "1111";
+ Set_Addr_To <= aSP;
+ if DPAIR = "11" then
+ Set_BusB_To <= "1011";
+ else
+ Set_BusB_To(2 downto 1) <= DPAIR;
+ Set_BusB_To(0) <= '1';
+ Set_BusB_To(3) <= '0';
+ end if;
+ Write <= '1';
+ when 3 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ when "11000001"|"11010001"|"11100001"|"11110001" =>
+ -- POP qq
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aSP;
+ when 2 =>
+ IncDec_16 <= "0111";
+ Set_Addr_To <= aSP;
+ Read_To_Reg <= '1';
+ if DPAIR = "11" then
+ Set_BusA_To(3 downto 0) <= "1011";
+ else
+ Set_BusA_To(2 downto 1) <= DPAIR;
+ Set_BusA_To(0) <= '1';
+ end if;
+ when 3 =>
+ IncDec_16 <= "0111";
+ Read_To_Reg <= '1';
+ if DPAIR = "11" then
+ Set_BusA_To(3 downto 0) <= "0111";
+ else
+ Set_BusA_To(2 downto 1) <= DPAIR;
+ Set_BusA_To(0) <= '0';
+ end if;
+ when others => null;
+ end case;
+
+-- EXCHANGE, BLOCK TRANSFER AND SEARCH GROUP
+ when "11101011" =>
+ if Mode /= 3 then
+ -- EX DE,HL
+ ExchangeDH <= '1';
+ end if;
+ when "00001000" =>
+ if Mode = 3 then
+ -- LD (nn),SP
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ Inc_PC <= '1';
+ LDW <= '1';
+ Set_BusB_To <= "1000";
+ when 4 =>
+ Inc_WZ <= '1';
+ Set_Addr_To <= aZI;
+ Write <= '1';
+ Set_BusB_To <= "1001";
+ when 5 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ elsif Mode < 2 then
+ -- EX AF,AF'
+ ExchangeAF <= '1';
+ end if;
+ when "11011001" =>
+ if Mode = 3 then
+ -- RETI
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_TO <= aSP;
+ when 2 =>
+ IncDec_16 <= "0111";
+ Set_Addr_To <= aSP;
+ LDZ <= '1';
+ when 3 =>
+ Jump <= '1';
+ IncDec_16 <= "0111";
+ I_RETN <= '1';
+ SetEI <= '1';
+ when others => null;
+ end case;
+ elsif Mode < 2 then
+ -- EXX
+ ExchangeRS <= '1';
+ end if;
+ when "11100011" =>
+ if Mode /= 3 then
+ -- EX (SP),HL
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aSP;
+ when 2 =>
+ Read_To_Reg <= '1';
+ Set_BusA_To <= "0101";
+ Set_BusB_To <= "0101";
+ Set_Addr_To <= aSP;
+ LDZ <= '1';
+ when 3 =>
+ IncDec_16 <= "0111";
+ Set_Addr_To <= aSP;
+ TStates <= "100";
+ Write <= '1';
+ when 4 =>
+ Read_To_Reg <= '1';
+ Set_BusA_To <= "0100";
+ Set_BusB_To <= "0100";
+ Set_Addr_To <= aSP;
+ LDW <= '1';
+ when 5 =>
+ IncDec_16 <= "1111";
+ TStates <= "101";
+ Write <= '1';
+ when others => null;
+ end case;
+ end if;
+
+-- 8 BIT ARITHMETIC AND LOGICAL GROUP
+ when "10000000"|"10000001"|"10000010"|"10000011"|"10000100"|"10000101"|"10000111"
+ |"10001000"|"10001001"|"10001010"|"10001011"|"10001100"|"10001101"|"10001111"
+ |"10010000"|"10010001"|"10010010"|"10010011"|"10010100"|"10010101"|"10010111"
+ |"10011000"|"10011001"|"10011010"|"10011011"|"10011100"|"10011101"|"10011111"
+ |"10100000"|"10100001"|"10100010"|"10100011"|"10100100"|"10100101"|"10100111"
+ |"10101000"|"10101001"|"10101010"|"10101011"|"10101100"|"10101101"|"10101111"
+ |"10110000"|"10110001"|"10110010"|"10110011"|"10110100"|"10110101"|"10110111"
+ |"10111000"|"10111001"|"10111010"|"10111011"|"10111100"|"10111101"|"10111111" =>
+ -- ADD A,r
+ -- ADC A,r
+ -- SUB A,r
+ -- SBC A,r
+ -- AND A,r
+ -- OR A,r
+ -- XOR A,r
+ -- CP A,r
+ Set_BusB_To(2 downto 0) <= SSS;
+ Set_BusA_To(2 downto 0) <= "111";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ when "10000110"|"10001110"|"10010110"|"10011110"|"10100110"|"10101110"|"10110110"|"10111110" =>
+ -- ADD A,(HL)
+ -- ADC A,(HL)
+ -- SUB A,(HL)
+ -- SBC A,(HL)
+ -- AND A,(HL)
+ -- OR A,(HL)
+ -- XOR A,(HL)
+ -- CP A,(HL)
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ when 2 =>
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ Set_BusB_To(2 downto 0) <= SSS;
+ Set_BusA_To(2 downto 0) <= "111";
+ when others => null;
+ end case;
+ when "11000110"|"11001110"|"11010110"|"11011110"|"11100110"|"11101110"|"11110110"|"11111110" =>
+ -- ADD A,n
+ -- ADC A,n
+ -- SUB A,n
+ -- SBC A,n
+ -- AND A,n
+ -- OR A,n
+ -- XOR A,n
+ -- CP A,n
+ MCycles <= "010";
+ if MCycle = "010" then
+ Inc_PC <= '1';
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ Set_BusB_To(2 downto 0) <= SSS;
+ Set_BusA_To(2 downto 0) <= "111";
+ end if;
+ when "00000100"|"00001100"|"00010100"|"00011100"|"00100100"|"00101100"|"00111100" =>
+ -- INC r
+ Set_BusB_To <= "1010";
+ Set_BusA_To(2 downto 0) <= DDD;
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ PreserveC <= '1';
+ ALU_Op <= "0000";
+ when "00110100" =>
+ -- INC (HL)
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ when 2 =>
+ TStates <= "100";
+ Set_Addr_To <= aXY;
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ PreserveC <= '1';
+ ALU_Op <= "0000";
+ Set_BusB_To <= "1010";
+ Set_BusA_To(2 downto 0) <= DDD;
+ when 3 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ when "00000101"|"00001101"|"00010101"|"00011101"|"00100101"|"00101101"|"00111101" =>
+ -- DEC r
+ Set_BusB_To <= "1010";
+ Set_BusA_To(2 downto 0) <= DDD;
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ PreserveC <= '1';
+ ALU_Op <= "0010";
+ when "00110101" =>
+ -- DEC (HL)
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ when 2 =>
+ TStates <= "100";
+ Set_Addr_To <= aXY;
+ ALU_Op <= "0010";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ PreserveC <= '1';
+ Set_BusB_To <= "1010";
+ Set_BusA_To(2 downto 0) <= DDD;
+ when 3 =>
+ Write <= '1';
+ when others => null;
+ end case;
+
+-- GENERAL PURPOSE ARITHMETIC AND CPU CONTROL GROUPS
+ when "00100111" =>
+ -- DAA
+ Set_BusA_To(2 downto 0) <= "111";
+ Read_To_Reg <= '1';
+ ALU_Op <= "1100";
+ Save_ALU <= '1';
+ when "00101111" =>
+ -- CPL
+ I_CPL <= '1';
+ when "00111111" =>
+ -- CCF
+ I_CCF <= '1';
+ when "00110111" =>
+ -- SCF
+ I_SCF <= '1';
+ when "00000000" =>
+ if NMICycle = '1' then
+ -- NMI
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ TStates <= "101";
+ IncDec_16 <= "1111";
+ Set_Addr_To <= aSP;
+ Set_BusB_To <= "1101";
+ when 2 =>
+ Write <= '1';
+ IncDec_16 <= "1111";
+ Set_Addr_To <= aSP;
+ Set_BusB_To <= "1100";
+ when 3 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ elsif IntCycle = '1' then
+ -- INT (IM 2)
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ LDZ <= '1';
+ TStates <= "101";
+ IncDec_16 <= "1111";
+ Set_Addr_To <= aSP;
+ Set_BusB_To <= "1101";
+ when 2 =>
+ --TStates <= "100";
+ Write <= '1';
+ IncDec_16 <= "1111";
+ Set_Addr_To <= aSP;
+ Set_BusB_To <= "1100";
+ when 3 =>
+ --TStates <= "100";
+ Write <= '1';
+ when 4 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 5 =>
+ Jump <= '1';
+ when others => null;
+ end case;
+ else
+ -- NOP
+ end if;
+ when "01110110" =>
+ -- HALT
+ Halt <= '1';
+ when "11110011" =>
+ -- DI
+ SetDI <= '1';
+ when "11111011" =>
+ -- EI
+ SetEI <= '1';
+
+-- 16 BIT ARITHMETIC GROUP
+ when "00001001"|"00011001"|"00101001"|"00111001" =>
+ -- ADD HL,ss
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ NoRead <= '1';
+ ALU_Op <= "0000";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ Set_BusA_To(2 downto 0) <= "101";
+ case to_integer(unsigned(IR(5 downto 4))) is
+ when 0|1|2 =>
+ Set_BusB_To(2 downto 1) <= IR(5 downto 4);
+ Set_BusB_To(0) <= '1';
+ when others =>
+ Set_BusB_To <= "1000";
+ end case;
+ TStates <= "100";
+ Arith16 <= '1';
+ SetWZ <= "11";
+ when 3 =>
+ NoRead <= '1';
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ ALU_Op <= "0001";
+ Set_BusA_To(2 downto 0) <= "100";
+ case to_integer(unsigned(IR(5 downto 4))) is
+ when 0|1|2 =>
+ Set_BusB_To(2 downto 1) <= IR(5 downto 4);
+ when others =>
+ Set_BusB_To <= "1001";
+ end case;
+ Arith16 <= '1';
+ when others =>
+ end case;
+ when "00000011"|"00010011"|"00100011"|"00110011" =>
+ -- INC ss
+ TStates <= "110";
+ IncDec_16(3 downto 2) <= "01";
+ IncDec_16(1 downto 0) <= DPair;
+ when "00001011"|"00011011"|"00101011"|"00111011" =>
+ -- DEC ss
+ TStates <= "110";
+ IncDec_16(3 downto 2) <= "11";
+ IncDec_16(1 downto 0) <= DPair;
+
+-- ROTATE AND SHIFT GROUP
+ when "00000111"
+ -- RLCA
+ |"00010111"
+ -- RLA
+ |"00001111"
+ -- RRCA
+ |"00011111" =>
+ -- RRA
+ Set_BusA_To(2 downto 0) <= "111";
+ ALU_Op <= "1000";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+
+-- JUMP GROUP
+ when "11000011" =>
+ -- JP nn
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Inc_PC <= '1';
+ Jump <= '1';
+ LDW <= '1';
+ when others => null;
+ end case;
+ when "11000010"|"11001010"|"11010010"|"11011010"|"11100010"|"11101010"|"11110010"|"11111010" =>
+ if IR(5) = '1' and Mode = 3 then
+ case IRB(4 downto 3) is
+ when "00" =>
+ -- LD ($FF00+C),A
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aBC;
+ Set_BusB_To <= "0111";
+ when 2 =>
+ Write <= '1';
+ IORQ <= '1';
+ when others =>
+ end case;
+ when "01" =>
+ -- LD (nn),A
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ Inc_PC <= '1';
+ Set_BusB_To <= "0111";
+ when 4 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ when "10" =>
+ -- LD A,($FF00+C)
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aBC;
+ when 2 =>
+ Read_To_Acc <= '1';
+ IORQ <= '1';
+ when others =>
+ end case;
+ when "11" =>
+ -- LD A,(nn)
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ Inc_PC <= '1';
+ when 4 =>
+ Read_To_Acc <= '1';
+ when others => null;
+ end case;
+ end case;
+ else
+ -- JP cc,nn
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ LDW <= '1';
+ Inc_PC <= '1';
+ if is_cc_true(F, to_bitvector(IR(5 downto 3))) then
+ Jump <= '1';
+ end if;
+ when others => null;
+ end case;
+ end if;
+ when "00011000" =>
+ if Mode /= 2 then
+ -- JR e
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ when 3 =>
+ NoRead <= '1';
+ JumpE <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ end if;
+ when "00111000" =>
+ if Mode /= 2 then
+ -- JR C,e
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ if F(Flag_C) = '0' then
+ MCycles <= "010";
+ end if;
+ when 3 =>
+ NoRead <= '1';
+ JumpE <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ end if;
+ when "00110000" =>
+ if Mode /= 2 then
+ -- JR NC,e
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ if F(Flag_C) = '1' then
+ MCycles <= "010";
+ end if;
+ when 3 =>
+ NoRead <= '1';
+ JumpE <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ end if;
+ when "00101000" =>
+ if Mode /= 2 then
+ -- JR Z,e
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ if F(Flag_Z) = '0' then
+ MCycles <= "010";
+ end if;
+ when 3 =>
+ NoRead <= '1';
+ JumpE <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ end if;
+ when "00100000" =>
+ if Mode /= 2 then
+ -- JR NZ,e
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ if F(Flag_Z) = '1' then
+ MCycles <= "010";
+ end if;
+ when 3 =>
+ NoRead <= '1';
+ JumpE <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ end if;
+ when "11101001" =>
+ -- JP (HL)
+ JumpXY <= '1';
+ when "00010000" =>
+ if Mode = 3 then
+ I_DJNZ <= '1';
+ elsif Mode < 2 then
+ -- DJNZ,e
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ TStates <= "101";
+ I_DJNZ <= '1';
+ Set_BusB_To <= "1010";
+ Set_BusA_To(2 downto 0) <= "000";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ ALU_Op <= "0010";
+ when 2 =>
+ I_DJNZ <= '1';
+ Inc_PC <= '1';
+ when 3 =>
+ NoRead <= '1';
+ JumpE <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ end if;
+
+-- CALL AND RETURN GROUP
+ when "11001101" =>
+ -- CALL nn
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ IncDec_16 <= "1111";
+ Inc_PC <= '1';
+ TStates <= "100";
+ Set_Addr_To <= aSP;
+ LDW <= '1';
+ Set_BusB_To <= "1101";
+ when 4 =>
+ Write <= '1';
+ IncDec_16 <= "1111";
+ Set_Addr_To <= aSP;
+ Set_BusB_To <= "1100";
+ when 5 =>
+ Write <= '1';
+ Call <= '1';
+ when others => null;
+ end case;
+ when "11000100"|"11001100"|"11010100"|"11011100"|"11100100"|"11101100"|"11110100"|"11111100" =>
+ if IR(5) = '0' or Mode /= 3 then
+ -- CALL cc,nn
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Inc_PC <= '1';
+ LDW <= '1';
+ if is_cc_true(F, to_bitvector(IR(5 downto 3))) then
+ IncDec_16 <= "1111";
+ Set_Addr_TO <= aSP;
+ TStates <= "100";
+ Set_BusB_To <= "1101";
+ else
+ MCycles <= "011";
+ end if;
+ when 4 =>
+ Write <= '1';
+ IncDec_16 <= "1111";
+ Set_Addr_To <= aSP;
+ Set_BusB_To <= "1100";
+ when 5 =>
+ Write <= '1';
+ Call <= '1';
+ when others => null;
+ end case;
+ end if;
+ when "11001001" =>
+ -- RET
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ --TStates <= "101";
+ Set_Addr_TO <= aSP;
+ when 2 =>
+ IncDec_16 <= "0111";
+ Set_Addr_To <= aSP;
+ LDZ <= '1';
+ when 3 =>
+ Jump <= '1';
+ IncDec_16 <= "0111";
+ when others => null;
+ end case;
+ when "11000000"|"11001000"|"11010000"|"11011000"|"11100000"|"11101000"|"11110000"|"11111000" =>
+ if IR(5) = '1' and Mode = 3 then
+ case IRB(4 downto 3) is
+ when "00" =>
+ -- LD ($FF00+nn),A
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ Set_Addr_To <= aIOA;
+ Set_BusB_To <= "0111";
+ when 3 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ when "01" =>
+ -- ADD SP,n
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ ALU_Op <= "0000";
+ Inc_PC <= '1';
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ Set_BusA_To <= "1000";
+ Set_BusB_To <= "0110";
+ when 3 =>
+ NoRead <= '1';
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ ALU_Op <= "0001";
+ Set_BusA_To <= "1001";
+ Set_BusB_To <= "1110"; -- Incorrect unsigned !!!!!!!!!!!!!!!!!!!!!
+ when others =>
+ end case;
+ when "10" =>
+ -- LD A,($FF00+nn)
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ Set_Addr_To <= aIOA;
+ when 3 =>
+ Read_To_Acc <= '1';
+ when others => null;
+ end case;
+ when "11" =>
+ -- LD HL,SP+n -- Not correct !!!!!!!!!!!!!!!!!!!
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ Inc_PC <= '1';
+ LDW <= '1';
+ when 4 =>
+ Set_BusA_To(2 downto 0) <= "101"; -- L
+ Read_To_Reg <= '1';
+ Inc_WZ <= '1';
+ Set_Addr_To <= aZI;
+ when 5 =>
+ Set_BusA_To(2 downto 0) <= "100"; -- H
+ Read_To_Reg <= '1';
+ when others => null;
+ end case;
+ end case;
+ else
+ -- RET cc
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ if is_cc_true(F, to_bitvector(IR(5 downto 3))) then
+ Set_Addr_TO <= aSP;
+ else
+ MCycles <= "001";
+ end if;
+ TStates <= "101";
+ when 2 =>
+ IncDec_16 <= "0111";
+ Set_Addr_To <= aSP;
+ LDZ <= '1';
+ when 3 =>
+ Jump <= '1';
+ IncDec_16 <= "0111";
+ when others => null;
+ end case;
+ end if;
+ when "11000111"|"11001111"|"11010111"|"11011111"|"11100111"|"11101111"|"11110111"|"11111111" =>
+ -- RST p
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ TStates <= "101";
+ IncDec_16 <= "1111";
+ Set_Addr_To <= aSP;
+ Set_BusB_To <= "1101";
+ when 2 =>
+ Write <= '1';
+ IncDec_16 <= "1111";
+ Set_Addr_To <= aSP;
+ Set_BusB_To <= "1100";
+ when 3 =>
+ Write <= '1';
+ RstP <= '1';
+ when others => null;
+ end case;
+
+-- INPUT AND OUTPUT GROUP
+ when "11011011" =>
+ if Mode /= 3 then
+ -- IN A,(n)
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ Set_Addr_To <= aIOA;
+ when 3 =>
+ Read_To_Acc <= '1';
+ IORQ <= '1';
+ when others => null;
+ end case;
+ end if;
+ when "11010011" =>
+ if Mode /= 3 then
+ -- OUT (n),A
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ Set_Addr_To <= aIOA;
+ Set_BusB_To <= "0111";
+ when 3 =>
+ Write <= '1';
+ IORQ <= '1';
+ when others => null;
+ end case;
+ end if;
+
+------------------------------------------------------------------------------
+------------------------------------------------------------------------------
+-- MULTIBYTE INSTRUCTIONS
+------------------------------------------------------------------------------
+------------------------------------------------------------------------------
+
+ when "11001011" =>
+ if Mode /= 2 then
+ Prefix <= "01";
+ end if;
+
+ when "11101101" =>
+ if Mode < 2 then
+ Prefix <= "10";
+ end if;
+
+ when "11011101"|"11111101" =>
+ if Mode < 2 then
+ Prefix <= "11";
+ end if;
+
+ end case;
+
+ when "01" =>
+
+------------------------------------------------------------------------------
+--
+-- CB prefixed instructions
+--
+------------------------------------------------------------------------------
+
+ Set_BusA_To(2 downto 0) <= IR(2 downto 0);
+ Set_BusB_To(2 downto 0) <= IR(2 downto 0);
+
+ case IRB is
+ when "00000000"|"00000001"|"00000010"|"00000011"|"00000100"|"00000101"|"00000111"
+ |"00010000"|"00010001"|"00010010"|"00010011"|"00010100"|"00010101"|"00010111"
+ |"00001000"|"00001001"|"00001010"|"00001011"|"00001100"|"00001101"|"00001111"
+ |"00011000"|"00011001"|"00011010"|"00011011"|"00011100"|"00011101"|"00011111"
+ |"00100000"|"00100001"|"00100010"|"00100011"|"00100100"|"00100101"|"00100111"
+ |"00101000"|"00101001"|"00101010"|"00101011"|"00101100"|"00101101"|"00101111"
+ |"00110000"|"00110001"|"00110010"|"00110011"|"00110100"|"00110101"|"00110111"
+ |"00111000"|"00111001"|"00111010"|"00111011"|"00111100"|"00111101"|"00111111" =>
+ -- RLC r
+ -- RL r
+ -- RRC r
+ -- RR r
+ -- SLA r
+ -- SRA r
+ -- SRL r
+ -- SLL r (Undocumented) / SWAP r
+ 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)
+ -- RL (HL)
+ -- RRC (HL)
+ -- RR (HL)
+ -- SRA (HL)
+ -- SRL (HL)
+ -- SLA (HL)
+ -- SLL (HL) (Undocumented) / SWAP (HL)
+ MCycles <= "011";
+ 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 =>
+ end case;
+ when "01000000"|"01000001"|"01000010"|"01000011"|"01000100"|"01000101"|"01000111"
+ |"01001000"|"01001001"|"01001010"|"01001011"|"01001100"|"01001101"|"01001111"
+ |"01010000"|"01010001"|"01010010"|"01010011"|"01010100"|"01010101"|"01010111"
+ |"01011000"|"01011001"|"01011010"|"01011011"|"01011100"|"01011101"|"01011111"
+ |"01100000"|"01100001"|"01100010"|"01100011"|"01100100"|"01100101"|"01100111"
+ |"01101000"|"01101001"|"01101010"|"01101011"|"01101100"|"01101101"|"01101111"
+ |"01110000"|"01110001"|"01110010"|"01110011"|"01110100"|"01110101"|"01110111"
+ |"01111000"|"01111001"|"01111010"|"01111011"|"01111100"|"01111101"|"01111111" =>
+ -- BIT b,r
+ 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)
+ MCycles <= "010";
+ 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;
+ when "11000000"|"11000001"|"11000010"|"11000011"|"11000100"|"11000101"|"11000111"
+ |"11001000"|"11001001"|"11001010"|"11001011"|"11001100"|"11001101"|"11001111"
+ |"11010000"|"11010001"|"11010010"|"11010011"|"11010100"|"11010101"|"11010111"
+ |"11011000"|"11011001"|"11011010"|"11011011"|"11011100"|"11011101"|"11011111"
+ |"11100000"|"11100001"|"11100010"|"11100011"|"11100100"|"11100101"|"11100111"
+ |"11101000"|"11101001"|"11101010"|"11101011"|"11101100"|"11101101"|"11101111"
+ |"11110000"|"11110001"|"11110010"|"11110011"|"11110100"|"11110101"|"11110111"
+ |"11111000"|"11111001"|"11111010"|"11111011"|"11111100"|"11111101"|"11111111" =>
+ -- SET b,r
+ 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)
+ MCycles <= "011";
+ 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;
+ when "10000000"|"10000001"|"10000010"|"10000011"|"10000100"|"10000101"|"10000111"
+ |"10001000"|"10001001"|"10001010"|"10001011"|"10001100"|"10001101"|"10001111"
+ |"10010000"|"10010001"|"10010010"|"10010011"|"10010100"|"10010101"|"10010111"
+ |"10011000"|"10011001"|"10011010"|"10011011"|"10011100"|"10011101"|"10011111"
+ |"10100000"|"10100001"|"10100010"|"10100011"|"10100100"|"10100101"|"10100111"
+ |"10101000"|"10101001"|"10101010"|"10101011"|"10101100"|"10101101"|"10101111"
+ |"10110000"|"10110001"|"10110010"|"10110011"|"10110100"|"10110101"|"10110111"
+ |"10111000"|"10111001"|"10111010"|"10111011"|"10111100"|"10111101"|"10111111" =>
+ -- RES b,r
+ 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";
+ 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 case;
+
+ when others =>
+
+------------------------------------------------------------------------------
+--
+-- ED prefixed instructions
+--
+------------------------------------------------------------------------------
+
+ case IRB is
+ when "00000000"|"00000001"|"00000010"|"00000011"|"00000100"|"00000101"|"00000110"|"00000111"
+ |"00001000"|"00001001"|"00001010"|"00001011"|"00001100"|"00001101"|"00001110"|"00001111"
+ |"00010000"|"00010001"|"00010010"|"00010011"|"00010100"|"00010101"|"00010110"|"00010111"
+ |"00011000"|"00011001"|"00011010"|"00011011"|"00011100"|"00011101"|"00011110"|"00011111"
+ |"00100000"|"00100001"|"00100010"|"00100011"|"00100100"|"00100101"|"00100110"|"00100111"
+ |"00101000"|"00101001"|"00101010"|"00101011"|"00101100"|"00101101"|"00101110"|"00101111"
+ |"00110000"|"00110001"|"00110010"|"00110011"|"00110100"|"00110101"|"00110110"|"00110111"
+ |"00111000"|"00111001"|"00111010"|"00111011"|"00111100"|"00111101"|"00111110"|"00111111"
+
+
+ |"10000000"|"10000001"|"10000010"|"10000011"|"10000100"|"10000101"|"10000110"|"10000111"
+ |"10001000"|"10001001"|"10001010"|"10001011"|"10001100"|"10001101"|"10001110"|"10001111"
+ |"10010000"|"10010001"|"10010010"|"10010011"|"10010100"|"10010101"|"10010110"|"10010111"
+ |"10011000"|"10011001"|"10011010"|"10011011"|"10011100"|"10011101"|"10011110"|"10011111"
+ | "10100100"|"10100101"|"10100110"|"10100111"
+ | "10101100"|"10101101"|"10101110"|"10101111"
+ | "10110100"|"10110101"|"10110110"|"10110111"
+ | "10111100"|"10111101"|"10111110"|"10111111"
+ |"11000000"|"11000001"|"11000010"|"11000011"|"11000100"|"11000101"|"11000110"|"11000111"
+ |"11001000"|"11001001"|"11001010"|"11001011"|"11001100"|"11001101"|"11001110"|"11001111"
+ |"11010000"|"11010001"|"11010010"|"11010011"|"11010100"|"11010101"|"11010110"|"11010111"
+ |"11011000"|"11011001"|"11011010"|"11011011"|"11011100"|"11011101"|"11011110"|"11011111"
+ |"11100000"|"11100001"|"11100010"|"11100011"|"11100100"|"11100101"|"11100110"|"11100111"
+ |"11101000"|"11101001"|"11101010"|"11101011"|"11101100"|"11101101"|"11101110"|"11101111"
+ |"11110000"|"11110001"|"11110010"|"11110011"|"11110100"|"11110101"|"11110110"|"11110111"
+ |"11111000"|"11111001"|"11111010"|"11111011"|"11111100"|"11111101"|"11111110"|"11111111" =>
+ null; -- NOP, undocumented
+ when "01111110"|"01111111" =>
+ -- NOP, undocumented
+ null;
+-- 8 BIT LOAD GROUP
+ when "01010111" =>
+ -- LD A,I
+ Special_LD <= "100";
+ TStates <= "101";
+ when "01011111" =>
+ -- LD A,R
+ Special_LD <= "101";
+ TStates <= "101";
+ when "01000111" =>
+ -- LD I,A
+ Special_LD <= "110";
+ TStates <= "101";
+ when "01001111" =>
+ -- LD R,A
+ Special_LD <= "111";
+ TStates <= "101";
+-- 16 BIT LOAD GROUP
+ when "01001011"|"01011011"|"01101011"|"01111011" =>
+ -- LD dd,(nn)
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ Inc_PC <= '1';
+ LDW <= '1';
+ when 4 =>
+ Read_To_Reg <= '1';
+ if IR(5 downto 4) = "11" then
+ Set_BusA_To <= "1000";
+ else
+ Set_BusA_To(2 downto 1) <= IR(5 downto 4);
+ Set_BusA_To(0) <= '1';
+ end if;
+ Inc_WZ <= '1';
+ Set_Addr_To <= aZI;
+ when 5 =>
+ Read_To_Reg <= '1';
+ if IR(5 downto 4) = "11" then
+ Set_BusA_To <= "1001";
+ else
+ Set_BusA_To(2 downto 1) <= IR(5 downto 4);
+ Set_BusA_To(0) <= '0';
+ end if;
+ when others => null;
+ end case;
+ when "01000011"|"01010011"|"01100011"|"01110011" =>
+ -- LD (nn),dd
+ MCycles <= "101";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ Inc_PC <= '1';
+ LDZ <= '1';
+ when 3 =>
+ Set_Addr_To <= aZI;
+ Inc_PC <= '1';
+ LDW <= '1';
+ if IR(5 downto 4) = "11" then
+ Set_BusB_To <= "1000";
+ else
+ Set_BusB_To(2 downto 1) <= IR(5 downto 4);
+ Set_BusB_To(0) <= '1';
+ Set_BusB_To(3) <= '0';
+ end if;
+ when 4 =>
+ Inc_WZ <= '1';
+ Set_Addr_To <= aZI;
+ Write <= '1';
+ if IR(5 downto 4) = "11" then
+ Set_BusB_To <= "1001";
+ else
+ Set_BusB_To(2 downto 1) <= IR(5 downto 4);
+ Set_BusB_To(0) <= '0';
+ Set_BusB_To(3) <= '0';
+ end if;
+ when 5 =>
+ Write <= '1';
+ when others => null;
+ end case;
+ when "10100000" | "10101000" | "10110000" | "10111000" =>
+ -- LDI, LDD, LDIR, LDDR
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ IncDec_16 <= "1100"; -- BC
+ when 2 =>
+ Set_BusB_To <= "0110";
+ Set_BusA_To(2 downto 0) <= "111";
+ ALU_Op <= "0000";
+ Set_Addr_To <= aDE;
+ if IR(3) = '0' then
+ IncDec_16 <= "0110"; -- IX
+ else
+ IncDec_16 <= "1110";
+ end if;
+ when 3 =>
+ I_BT <= '1';
+ TStates <= "101";
+ Write <= '1';
+ if IR(3) = '0' then
+ IncDec_16 <= "0101"; -- DE
+ else
+ IncDec_16 <= "1101";
+ end if;
+ when 4 =>
+ NoRead <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ when "10100001" | "10101001" | "10110001" | "10111001" =>
+ -- CPI, CPD, CPIR, CPDR
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ IncDec_16 <= "1100"; -- BC
+ when 2 =>
+ Set_BusB_To <= "0110";
+ Set_BusA_To(2 downto 0) <= "111";
+ ALU_Op <= "0111";
+ Save_ALU <= '1';
+ PreserveC <= '1';
+ if IR(3) = '0' then
+ IncDec_16 <= "0110";
+ else
+ IncDec_16 <= "1110";
+ end if;
+ when 3 =>
+ NoRead <= '1';
+ I_BC <= '1';
+ TStates <= "101";
+ when 4 =>
+ NoRead <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ when "01000100"|"01001100"|"01010100"|"01011100"|"01100100"|"01101100"|"01110100"|"01111100" =>
+ -- NEG
+ Alu_OP <= "0010";
+ Set_BusB_To <= "0111";
+ Set_BusA_To <= "1010";
+ Read_To_Acc <= '1';
+ Save_ALU <= '1';
+ when "01000110"|"01001110"|"01100110"|"01101110" =>
+ -- IM 0
+ IMode <= "00";
+ when "01010110"|"01110110" =>
+ -- IM 1
+ IMode <= "01";
+ when "01011110"|"01110111" =>
+ -- IM 2
+ IMode <= "10";
+-- 16 bit arithmetic
+ when "01001010"|"01011010"|"01101010"|"01111010" =>
+ -- ADC HL,ss
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ NoRead <= '1';
+ ALU_Op <= "0001";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ Set_BusA_To(2 downto 0) <= "101";
+ case to_integer(unsigned(IR(5 downto 4))) is
+ when 0|1|2 =>
+ Set_BusB_To(2 downto 1) <= IR(5 downto 4);
+ Set_BusB_To(0) <= '1';
+ when others =>
+ Set_BusB_To <= "1000";
+ end case;
+ TStates <= "100";
+ SetWZ <= "11";
+ when 3 =>
+ NoRead <= '1';
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ ALU_Op <= "0001";
+ Set_BusA_To(2 downto 0) <= "100";
+ case to_integer(unsigned(IR(5 downto 4))) is
+ when 0|1|2 =>
+ Set_BusB_To(2 downto 1) <= IR(5 downto 4);
+ Set_BusB_To(0) <= '0';
+ when others =>
+ Set_BusB_To <= "1001";
+ end case;
+ when others =>
+ end case;
+ when "01000010"|"01010010"|"01100010"|"01110010" =>
+ -- SBC HL,ss
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 2 =>
+ NoRead <= '1';
+ ALU_Op <= "0011";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ Set_BusA_To(2 downto 0) <= "101";
+ case to_integer(unsigned(IR(5 downto 4))) is
+ when 0|1|2 =>
+ Set_BusB_To(2 downto 1) <= IR(5 downto 4);
+ Set_BusB_To(0) <= '1';
+ when others =>
+ Set_BusB_To <= "1000";
+ end case;
+ TStates <= "100";
+ SetWZ <= "11";
+ when 3 =>
+ NoRead <= '1';
+ ALU_Op <= "0011";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ Set_BusA_To(2 downto 0) <= "100";
+ case to_integer(unsigned(IR(5 downto 4))) is
+ when 0|1|2 =>
+ Set_BusB_To(2 downto 1) <= IR(5 downto 4);
+ when others =>
+ Set_BusB_To <= "1001";
+ end case;
+ when others =>
+ end case;
+ when "01101111" =>
+ -- RLD -- Read in M2, not M3! fixed by Sorgelig
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ when 2 =>
+ Read_To_Reg <= '1';
+ Set_BusB_To(2 downto 0) <= "110";
+ Set_BusA_To(2 downto 0) <= "111";
+ ALU_Op <= "1101";
+ Save_ALU <= '1';
+ when 3 =>
+ TStates <= "100";
+ I_RLD <= '1';
+ NoRead <= '1';
+ Set_Addr_To <= aXY;
+ when 4 =>
+ Write <= '1';
+ when others =>
+ end case;
+ when "01100111" =>
+ -- RRD -- Read in M2, not M3! fixed by Sorgelig
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aXY;
+ when 2 =>
+ Read_To_Reg <= '1';
+ Set_BusB_To(2 downto 0) <= "110";
+ Set_BusA_To(2 downto 0) <= "111";
+ ALU_Op <= "1110";
+ Save_ALU <= '1';
+ when 3 =>
+ TStates <= "100";
+ I_RRD <= '1';
+ NoRead <= '1';
+ Set_Addr_To <= aXY;
+ when 4 =>
+ Write <= '1';
+ when others =>
+ end case;
+ when "01000101"|"01001101"|"01010101"|"01011101"|"01100101"|"01101101"|"01110101"|"01111101" =>
+ -- RETI/RETN
+ MCycles <= "011";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_TO <= aSP;
+ when 2 =>
+ IncDec_16 <= "0111";
+ Set_Addr_To <= aSP;
+ LDZ <= '1';
+ when 3 =>
+ Jump <= '1';
+ IncDec_16 <= "0111";
+ LDW <= '1';
+ I_RETN <= '1';
+ when others => null;
+ end case;
+ when "01000000"|"01001000"|"01010000"|"01011000"|"01100000"|"01101000"|"01110000"|"01111000" =>
+ -- IN r,(C)
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aBC;
+ SetWZ <= "01";
+ when 2 =>
+ IORQ <= '1';
+ if IR(5 downto 3) /= "110" then
+ Read_To_Reg <= '1';
+ Set_BusA_To(2 downto 0) <= IR(5 downto 3);
+ end if;
+ I_INRC <= '1';
+ when others =>
+ end case;
+ when "01000001"|"01001001"|"01010001"|"01011001"|"01100001"|"01101001"|"01110001"|"01111001" =>
+ -- OUT (C),r
+ -- OUT (C),0
+ MCycles <= "010";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ Set_Addr_To <= aBC;
+ SetWZ <= "01";
+ Set_BusB_To(2 downto 0) <= IR(5 downto 3);
+ if IR(5 downto 3) = "110" then
+ Set_BusB_To(3) <= '1';
+ end if;
+ when 2 =>
+ Write <= '1';
+ IORQ <= '1';
+ when others =>
+ end case;
+ when "10100010" | "10101010" | "10110010" | "10111010" =>
+ -- INI, IND, INIR, INDR
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ TStates <= "101";
+ Set_Addr_To <= aBC;
+ Set_BusB_To <= "1010";
+ Set_BusA_To <= "0000";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ ALU_Op <= "0010";
+ SetWZ <= "11";
+ IncDec_16(3) <= IR(3);
+ when 2 =>
+ IORQ <= '1';
+ Set_BusB_To <= "0110";
+ Set_Addr_To <= aXY;
+ when 3 =>
+ if IR(3) = '0' then
+ IncDec_16 <= "0110";
+ else
+ IncDec_16 <= "1110";
+ end if;
+ Write <= '1';
+ I_BTR <= '1';
+ when 4 =>
+ NoRead <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ when "10100011" | "10101011" | "10110011" | "10111011" =>
+ -- OUTI, OUTD, OTIR, OTDR
+ MCycles <= "100";
+ case to_integer(unsigned(MCycle)) is
+ when 1 =>
+ TStates <= "101";
+ Set_Addr_To <= aXY;
+ Set_BusB_To <= "1010";
+ Set_BusA_To <= "0000";
+ Read_To_Reg <= '1';
+ Save_ALU <= '1';
+ ALU_Op <= "0010";
+ when 2 =>
+ Set_BusB_To <= "0110";
+ Set_Addr_To <= aBC;
+ SetWZ <= "11";
+ IncDec_16(3) <= IR(3);
+ when 3 =>
+ if IR(3) = '0' then
+ IncDec_16 <= "0110";
+ else
+ IncDec_16 <= "1110";
+ end if;
+ IORQ <= '1';
+ Write <= '1';
+ I_BTR <= '1';
+ when 4 =>
+ NoRead <= '1';
+ TStates <= "101";
+ when others => null;
+ end case;
+ end case;
+
+ end case;
+
+ if Mode = 1 then
+ if MCycle = "001" then
+-- TStates <= "100";
+ else
+ TStates <= "011";
+ end if;
+ end if;
+
+ if Mode = 3 then
+ if MCycle = "001" then
+-- TStates <= "100";
+ else
+ TStates <= "100";
+ end if;
+ end if;
+
+ if Mode < 2 then
+ if MCycle = "110" then
+ Inc_PC <= '1';
+ if Mode = 1 then
+ Set_Addr_To <= aXY;
+ TStates <= "100";
+ Set_BusB_To(2 downto 0) <= SSS;
+ Set_BusB_To(3) <= '0';
+ end if;
+ if IRB = "00110110" or IRB = "11001011" then
+ Set_Addr_To <= aNone;
+ end if;
+ end if;
+ if MCycle = "111" then
+ if Mode = 0 then
+ TStates <= "101";
+ end if;
+ if ISet /= "01" then
+ Set_Addr_To <= aXY;
+ end if;
+ Set_BusB_To(2 downto 0) <= SSS;
+ Set_BusB_To(3) <= '0';
+ if IRB = "00110110" or ISet = "01" then
+ -- LD (HL),n
+ Inc_PC <= '1';
+ else
+ NoRead <= '1';
+ end if;
+ end if;
+ end if;
+
+ end process;
+
+end;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_Pack.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_Pack.vhd
new file mode 100644
index 00000000..907db408
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_Pack.vhd
@@ -0,0 +1,228 @@
+-- ****
+-- 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
+
+ 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";
+
+ 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;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_Reg.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_Reg.vhd
new file mode 100644
index 00000000..e7e86454
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80_Reg.vhd
@@ -0,0 +1,152 @@
+--------------------------------------------------------------------------------
+-- ****
+-- T80(c) core. Attempt to finish all undocumented features and provide
+-- accurate timings.
+-- Version 350.
+-- Copyright (c) 2018 Sorgelig
+-- Test passed: ZEXDOC, ZEXALL, Z80Full(*), Z80memptr
+-- (*) Currently only SCF and CCF instructions aren't passed X/Y flags check as
+-- correct implementation is still unclear.
+--
+-- ****
+-- 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)
+--
+-- ****
+--
+-- T80 Registers, technology independent
+--
+-- Version : 0244
+--
+-- Copyright (c) 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/t51/
+--
+-- Limitations :
+--
+-- File history :
+--
+-- 0242 : Initial release
+--
+-- 0244 : Changed to single register file
+--
+
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+
+entity T80_Reg is
+ 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);
+ DOR : out std_logic_vector(127 downto 0);
+ DIRSet : in std_logic;
+ DIR : in std_logic_vector(127 downto 0)
+ );
+end T80_Reg;
+
+architecture rtl of T80_Reg is
+
+ type Register_Image is array (natural range <>) of std_logic_vector(7 downto 0);
+ signal RegsH : Register_Image(0 to 7);
+ signal RegsL : Register_Image(0 to 7);
+
+begin
+
+ process (Clk)
+ begin
+ if rising_edge(Clk) then
+ if DIRSet = '1' then
+ RegsL(0) <= DIR( 7 downto 0);
+ RegsH(0) <= DIR( 15 downto 8);
+
+ RegsL(1) <= DIR( 23 downto 16);
+ RegsH(1) <= DIR( 31 downto 24);
+
+ RegsL(2) <= DIR( 39 downto 32);
+ RegsH(2) <= DIR( 47 downto 40);
+
+ RegsL(3) <= DIR( 55 downto 48);
+ RegsH(3) <= DIR( 63 downto 56);
+
+ RegsL(4) <= DIR( 71 downto 64);
+ RegsH(4) <= DIR( 79 downto 72);
+
+ RegsL(5) <= DIR( 87 downto 80);
+ RegsH(5) <= DIR( 95 downto 88);
+
+ RegsL(6) <= DIR(103 downto 96);
+ RegsH(6) <= DIR(111 downto 104);
+
+ RegsL(7) <= DIR(119 downto 112);
+ RegsH(7) <= DIR(127 downto 120);
+ elsif CEN = '1' then
+ if WEH = '1' then
+ RegsH(to_integer(unsigned(AddrA))) <= DIH;
+ end if;
+ if WEL = '1' then
+ RegsL(to_integer(unsigned(AddrA))) <= DIL;
+ end if;
+ end if;
+ end if;
+ end process;
+
+ DOAH <= RegsH(to_integer(unsigned(AddrA)));
+ DOAL <= RegsL(to_integer(unsigned(AddrA)));
+ DOBH <= RegsH(to_integer(unsigned(AddrB)));
+ DOBL <= RegsL(to_integer(unsigned(AddrB)));
+ DOCH <= RegsH(to_integer(unsigned(AddrC)));
+ DOCL <= RegsL(to_integer(unsigned(AddrC)));
+ DOR <= RegsH(7) & RegsL(7) & RegsH(6) & RegsL(6) & RegsH(5) & RegsL(5) & RegsH(4) & RegsL(4) & RegsH(3) & RegsL(3) & RegsH(2) & RegsL(2) & RegsH(1) & RegsL(1) & RegsH(0) & RegsL(0);
+
+end;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80se.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80se.vhd
new file mode 100644
index 00000000..4fc90530
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/rtl_T80/T80se.vhd
@@ -0,0 +1,192 @@
+--
+-- Z80 compatible microprocessor core, synchronous top level with clock enable
+-- Different timing than the original z80
+-- Inputs needs to be synchronous and outputs may glitch
+--
+-- 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 :
+--
+-- 0208 : First complete release
+--
+-- 0210 : Fixed read with wait
+--
+-- 0211 : Fixed interrupt cycle
+--
+-- 0235 : Updated for T80 interface change
+--
+-- 0236 : Added T2Write generic
+--
+-- 0237 : Fixed T2Write with wait state
+--
+-- 0238 : Updated for T80 interface change
+--
+-- 0240 : Updated for T80 interface change
+--
+-- 0242 : Updated for T80 interface change
+--
+
+library IEEE;
+use IEEE.std_logic_1164.all;
+use IEEE.numeric_std.all;
+use IEEE.STD_LOGIC_UNSIGNED.all;
+
+entity T80se is
+ generic(
+ Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB
+ T2Write : integer := 1; -- 0 => WR_n active in T3, /=0 => WR_n active in T2
+ IOWait : integer := 1 -- 0 => Single cycle I/O, 1 => Std I/O cycle
+ );
+ port(
+ RESET_n : in std_logic;
+ CLK : in std_logic;
+ CEN : in std_logic := '1';
+ WAIT_n : in std_logic := '1';
+ INT_n : in std_logic := '1';
+ NMI_n : in std_logic := '1';
+ BUSRQ_n : in std_logic := '1';
+ 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;
+ OUT0 : in std_logic := '0'; -- 0 => OUT(C),0, 1 => OUT(C),255
+ 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 T80se;
+
+architecture rtl of T80se 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);
+
+begin
+
+ u0 : work.T80
+ generic map(
+ Mode => Mode,
+ IOWait => IOWait)
+ port map(
+ CEN => CEN,
+ 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,
+ A => A,
+ DInst => DI,
+ DI => DI_Reg,
+ DO => DO,
+ MC => MCycle,
+ TS => TState,
+ OUT0 => OUT0,
+ IntCycle_n => IntCycle_n
+ );
+
+ process (RESET_n, CLK)
+ begin
+ if RESET_n = '0' then
+ RD_n <= '1';
+ WR_n <= '1';
+ IORQ_n <= '1';
+ MREQ_n <= '1';
+ DI_Reg <= "00000000";
+ elsif rising_edge(CLK) then
+ if CEN = '1' then
+ RD_n <= '1';
+ WR_n <= '1';
+ IORQ_n <= '1';
+ MREQ_n <= '1';
+ if MCycle = 1 then
+ if TState = 1 or (TState = 2 and Wait_n = '0') then
+ RD_n <= not IntCycle_n;
+ MREQ_n <= not IntCycle_n;
+ IORQ_n <= IntCycle_n;
+ end if;
+ if TState = 3 then
+ MREQ_n <= '0';
+ end if;
+ else
+ if (TState = 1 or (TState = 2 and Wait_n = '0')) and NoRead = '0' and Write = '0' then
+ RD_n <= '0';
+ IORQ_n <= not IORQ;
+ MREQ_n <= IORQ;
+ end if;
+ if T2Write = 0 then
+ if TState = 2 and Write = '1' then
+ WR_n <= '0';
+ IORQ_n <= not IORQ;
+ MREQ_n <= IORQ;
+ end if;
+ else
+ if (TState = 1 or (TState = 2 and Wait_n = '0')) and Write = '1' then
+ WR_n <= '0';
+ IORQ_n <= not IORQ;
+ MREQ_n <= IORQ;
+ end if;
+ end if;
+ end if;
+ if TState = 2 and Wait_n = '1' then
+ DI_Reg <= DI;
+ end if;
+ end if;
+ end if;
+ end process;
+end;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/sdram.sv b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/sdram.sv
new file mode 100644
index 00000000..8f927d05
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/sdram.sv
@@ -0,0 +1,254 @@
+//
+// sdram.v
+//
+// Static RAM controller implementation using SDRAM MT48LC16M16A2
+//
+// Copyright (c) 2015,2016 Sorgelig
+//
+// Some parts of SDRAM code used from project:
+// http://hamsterworks.co.nz/mediawiki/index.php/Simple_SDRAM_Controller
+//
+// This source file 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 3 of the License, or
+// (at your option) any later version.
+//
+// This source file 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, see .
+//
+// ------------------------------------------
+//
+// v2.1 - Add universal 8/16 bit mode.
+//
+
+module sdram
+(
+ input init, // reset to initialize RAM
+ input clk, // clock ~100MHz
+ //
+ // SDRAM_* - signals to the MT48LC16M16 chip
+ inout reg [15:0] SDRAM_DQ, // 16 bit bidirectional data bus
+ output reg [12:0] SDRAM_A, // 13 bit multiplexed address bus
+ output reg SDRAM_DQML, // two byte masks
+ output reg SDRAM_DQMH, //
+ output reg [1:0] SDRAM_BA, // two banks
+ output SDRAM_nCS, // a single chip select
+ output SDRAM_nWE, // write enable
+ output SDRAM_nRAS, // row address select
+ output SDRAM_nCAS, // columns address select
+ output SDRAM_CKE, // clock enable
+ //
+ input [1:0] wtbt, // 16bit mode: bit1 - write high byte, bit0 - write low byte,
+ // 8bit mode: 2'b00 - use addr[0] to decide which byte to write
+ // Ignored while reading.
+ //
+ input [24:0] addr, // 25 bit address for 8bit mode. addr[0] = 0 for 16bit mode for correct operations.
+ output [15:0] dout, // data output to cpu
+ input [15:0] din, // data input from cpu
+ input we, // cpu requests write
+ input rd, // cpu requests read
+ output reg ready // dout is valid. Ready to accept new read/write.
+);
+
+assign SDRAM_nCS = command[3];
+assign SDRAM_nRAS = command[2];
+assign SDRAM_nCAS = command[1];
+assign SDRAM_nWE = command[0];
+assign SDRAM_CKE = cke;
+
+// no burst configured
+localparam BURST_LENGTH = 3'b000; // 000=1, 001=2, 010=4, 011=8
+localparam ACCESS_TYPE = 1'b0; // 0=sequential, 1=interleaved
+localparam CAS_LATENCY = 3'd2; // 2 for < 100MHz, 3 for >100MHz
+localparam OP_MODE = 2'b00; // only 00 (standard operation) allowed
+localparam NO_WRITE_BURST = 1'b1; // 0= write burst enabled, 1=only single access write
+localparam MODE = {3'b000, NO_WRITE_BURST, OP_MODE, CAS_LATENCY, ACCESS_TYPE, BURST_LENGTH};
+
+localparam sdram_startup_cycles= 14'd12100;// 100us, plus a little more, @ 100MHz
+localparam cycles_per_refresh = 14'd186; // (64000*36)/8192-1 Calc'd as (64ms @ 36MHz)/8192 rose
+localparam startup_refresh_max = 14'b11111111111111;
+
+// SDRAM commands
+localparam CMD_INHIBIT = 4'b1111;
+localparam CMD_NOP = 4'b0111;
+localparam CMD_ACTIVE = 4'b0011;
+localparam CMD_READ = 4'b0101;
+localparam CMD_WRITE = 4'b0100;
+localparam CMD_BURST_TERMINATE = 4'b0110;
+localparam CMD_PRECHARGE = 4'b0010;
+localparam CMD_AUTO_REFRESH = 4'b0001;
+localparam CMD_LOAD_MODE = 4'b0000;
+
+reg [13:0] refresh_count = startup_refresh_max - sdram_startup_cycles;
+reg [3:0] command = CMD_INHIBIT;
+reg cke = 0;
+reg [24:0] save_addr;
+reg [15:0] data;
+
+assign dout = save_addr[0] ? {data[7:0], data[15:8]} : {data[15:8], data[7:0]};
+typedef enum
+{
+ STATE_STARTUP,
+ STATE_OPEN_1,
+ STATE_WRITE,
+ STATE_READ,
+ STATE_IDLE, STATE_IDLE_1, STATE_IDLE_2, STATE_IDLE_3,
+ STATE_IDLE_4, STATE_IDLE_5, STATE_IDLE_6, STATE_IDLE_7
+} state_t;
+
+state_t state = STATE_STARTUP;
+
+always @(posedge clk) begin
+ reg old_we, old_rd;
+ reg [CAS_LATENCY:0] data_ready_delay;
+
+ reg [15:0] new_data;
+ reg [1:0] new_wtbt;
+ reg new_we;
+ reg new_rd;
+ reg save_we = 1;
+
+
+ command <= CMD_NOP;
+ refresh_count <= refresh_count+1'b1;
+
+ data_ready_delay <= {1'b0, data_ready_delay[CAS_LATENCY:1]};
+
+ if(data_ready_delay[0]) data <= SDRAM_DQ;
+
+ case(state)
+ STATE_STARTUP: begin
+ //------------------------------------------------------------------------
+ //-- This is the initial startup state, where we wait for at least 100us
+ //-- before starting the start sequence
+ //--
+ //-- The initialisation is sequence is
+ //-- * de-assert SDRAM_CKE
+ //-- * 100us wait,
+ //-- * assert SDRAM_CKE
+ //-- * wait at least one cycle,
+ //-- * PRECHARGE
+ //-- * wait 2 cycles
+ //-- * REFRESH,
+ //-- * tREF wait
+ //-- * REFRESH,
+ //-- * tREF wait
+ //-- * LOAD_MODE_REG
+ //-- * 2 cycles wait
+ //------------------------------------------------------------------------
+ cke <= 1;
+ SDRAM_DQ <= 16'bZZZZZZZZZZZZZZZZ;
+ SDRAM_DQML <= 1;
+ SDRAM_DQMH <= 1;
+ SDRAM_A <= 0;
+ SDRAM_BA <= 0;
+
+ // All the commands during the startup are NOPS, except these
+ if(refresh_count == startup_refresh_max-31) begin
+ // ensure all rows are closed
+ command <= CMD_PRECHARGE;
+ SDRAM_A[10] <= 1; // all banks
+ SDRAM_BA <= 2'b00;
+ end else if (refresh_count == startup_refresh_max-23) begin
+ // these refreshes need to be at least tREF (66ns) apart
+ command <= CMD_AUTO_REFRESH;
+ end else if (refresh_count == startup_refresh_max-15)
+ command <= CMD_AUTO_REFRESH;
+ else if (refresh_count == startup_refresh_max-7) begin
+ // Now load the mode register
+ command <= CMD_LOAD_MODE;
+ SDRAM_A <= MODE;
+ end
+
+ //------------------------------------------------------
+ //-- if startup is complete then go into idle mode,
+ //-- get prepared to accept a new command, and schedule
+ //-- the first refresh cycle
+ //------------------------------------------------------
+ if(!refresh_count) begin
+ state <= STATE_IDLE;
+ ready <= 1;
+ refresh_count <= 0;
+ end
+ end
+
+ STATE_IDLE_7: state <= STATE_IDLE_6;
+ STATE_IDLE_6: state <= STATE_IDLE_5;
+ STATE_IDLE_5: state <= STATE_IDLE_4;
+ STATE_IDLE_4: state <= STATE_IDLE_3;
+ STATE_IDLE_3: state <= STATE_IDLE_2;
+ STATE_IDLE_2: state <= STATE_IDLE_1;
+ STATE_IDLE_1: begin
+ SDRAM_DQ <= 16'bZZZZZZZZZZZZZZZZ;
+ state <= STATE_IDLE;
+ // mask possible refresh to reduce colliding.
+ if(refresh_count > cycles_per_refresh) begin
+ //------------------------------------------------------------------------
+ //-- Start the refresh cycle.
+ //-- This tasks tRFC (66ns), so 2 idle cycles are needed @ 36MHz
+ //------------------------------------------------------------------------
+ state <= STATE_IDLE_2;
+ command <= CMD_AUTO_REFRESH;
+ refresh_count <= refresh_count - cycles_per_refresh + 1'd1;
+ end
+ end
+
+ STATE_IDLE: begin
+ // Priority is to issue a refresh if one is outstanding
+ if(refresh_count > (cycles_per_refresh<<1)) state <= STATE_IDLE_1;
+ else if(new_rd | new_we) begin
+ new_we <= 0;
+ new_rd <= 0;
+ save_addr<= addr;
+ save_we <= new_we;
+ state <= STATE_OPEN_1;
+ command <= CMD_ACTIVE;
+ SDRAM_A <= addr[13:1];
+ SDRAM_BA <= addr[24:23];
+ end
+ end
+
+ // ACTIVE-to-READ or WRITE delay >20ns (1 cycle @ 36 MHz)(-75)
+ STATE_OPEN_1: begin
+ SDRAM_A <= {4'b0010, save_addr[22:14]};
+ SDRAM_DQML <= save_we & (new_wtbt ? ~new_wtbt[0] : save_addr[0]);
+ SDRAM_DQMH <= save_we & (new_wtbt ? ~new_wtbt[1] : ~save_addr[0]);
+ state <= save_we ? STATE_WRITE : STATE_READ;
+ end
+
+ STATE_READ: begin
+ state <= STATE_IDLE_5;
+ command <= CMD_READ;
+ SDRAM_DQ <= 16'bZZZZZZZZZZZZZZZZ;
+
+ // Schedule reading the data values off the bus
+ data_ready_delay[CAS_LATENCY] <= 1;
+ end
+
+ STATE_WRITE: begin
+ state <= STATE_IDLE_5;
+ command <= CMD_WRITE;
+ SDRAM_DQ <= new_wtbt ? new_data : {new_data[7:0], new_data[7:0]};
+ ready <= 1;
+ end
+ endcase
+
+ if(init) begin
+ state <= STATE_STARTUP;
+ refresh_count <= startup_refresh_max - sdram_startup_cycles;
+ end
+
+ old_we <= we;
+ old_rd <= rd;
+ if(we & ~old_we) {ready, new_we, new_data, new_wtbt} <= {1'b0, 1'b1, din, wtbt};
+ else
+ if((rd & ~old_rd) || (rd & old_rd & (save_addr != addr))) {ready, new_rd} <= {1'b0, 1'b1};
+
+end
+
+endmodule
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/traverse_usa.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/traverse_usa.vhd
new file mode 100644
index 00000000..2c0908ed
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/traverse_usa.vhd
@@ -0,0 +1,895 @@
+---------------------------------------------------------------------------------
+-- Traverse USA by Dar (darfpga@aol.fr) (16/03/2019)
+-- http://darfpga.blogspot.fr
+---------------------------------------------------------------------------------
+-- gen_ram.vhd & io_ps2_keyboard
+--------------------------------
+-- Copyright 2005-2008 by Peter Wendrich (pwsoft@syntiac.com)
+-- http://www.syntiac.com/fpga64.html
+---------------------------------------------------------------------------------
+-- T80/T80se - Version : 0247
+-----------------------------
+-- Z80 compatible microprocessor core
+-- Copyright (c) 2001-2002 Daniel Wallner (jesus@opencores.org)
+---------------------------------------------------------------------------------
+-- cpu68 - Version 9th Jan 2004 0.8
+-- 6800/01 compatible CPU core
+-- GNU public license - December 2002 : John E. Kent
+---------------------------------------------------------------------------------
+-- YM2149 (AY-3-8910)
+-- Copyright (c) MikeJ - Jan 2005
+---------------------------------------------------------------------------------
+-- Educational use only
+-- Do not redistribute synthetized file with roms
+-- Do not redistribute roms whatever the form
+-- Use at your own risk
+---------------------------------------------------------------------------------
+
+-- Features :
+-- Video : TV 15KHz mode only (atm)
+-- Coctail mode : OK
+-- Sound : OK
+
+-- Use with MAME roms from travusa.zip
+--
+-- Use make_travusa_proms.bat to build vhd file from binaries
+-- (CRC list included)
+
+-- Traverse USA (irem M52) Hardware caracteristics :
+--
+-- VIDEO : 1xZ80@3MHz CPU accessing its program rom, working ram,
+-- sprite data ram, I/O, sound board register and trigger.
+-- 32Kx8bits program rom
+--
+-- One char tile map 64x32 with H scrolling (32x32 visible)
+-- 8Kx24bits graphics rom 3bits/pixel
+-- 8colors per tile / 16 color sets
+-- rbg palette 128 colors 8bits : 2red 3green 3blue
+--
+-- 72 sprites / line, 16x16 with flip H/V
+-- (schematics seems too allow only 24 sprites / line with bank switch
+-- at mid screen. This doesn't allow showing all needed sprite)
+--
+-- 8Kx24bits graphics rom 3bits/pixel
+-- 8colors per sprite / 32 color sets among 16 colors;
+-- rbg palette 16 colors 8bits : 2red 3green 3blue
+--
+-- Working ram : 4Kx8bits
+-- Sprites data ram : 256x8bits
+-- Sprites line buffer rams : 1 scan line delay flip/flop 2x256x4bits
+--
+-- SOUND : 1x6803@3.58MHz CPU accessing its program rom, working ram, 2x-AY3-8910, 1xMSM5205
+-- 4Kx8bits program rom
+-- 128x8bits working ram
+--
+-- 1xAY-3-8910
+-- I/O to MSM5205 and command/trigger from video board.
+-- 3 sound channels
+--
+-- 1xAY-3-8910
+-- 3 sound channels
+--
+---------------------------------------------------------------------------------
+-- Schematics remarks :
+--
+-- Frame is 384 x 282 (H x V) which is too much lines for standard TV set (262.5 lines)
+-- This create a display artefact near end of frame since already entering composite
+-- sync egalisation pulses. Line number cannot be reduced since CPU need enough fly back
+-- time to update every sprites position. (Reducing line count will result in missing sprites)
+-- May be this can be achieved by increasing CPU clock speed (web site and MAME report 4Mhz)
+-- My M52-A schematic clearly shows 18.432/6.
+--
+-- => I give more CPU time to access sprite ram data by allowing CPU access as soon as video
+-- scanner V is outside the sprite zone i.e. outside the scroling part of screen (which
+-- depends on the flip screen state).
+--
+-- Moreover M52-B schematic doesn't show to allow seeking more than 24 sprites data per
+-- line from :
+-- - C820 to C87F for half upper screen (vertical)
+-- - C8A0 to C8FF for half lower screen (vertical)
+--
+-- But, at beginning of the game, during starting count downto, 5 cars are diplayed +
+-- moto + count down numbers. At least some sprite cars data comes not only from
+-- C820-C87F but also from C920 to C97F. Which involves at least 2 sprite data regions
+-- for the same half part of the screen (see cars numbered 0 and 3).
+--
+-- => I modify the sprite data address scanner to allow 3 regions to be scanned at each line
+-- (C820-C87F, C8A0-C8FF and C920-C97F). My first design was with a 12MHz master clock to
+-- allow 1 read and 1 write access to sprite line buffer ram at each pixel (6Mhz). This
+-- permit only one sprite data region to be scanned at each line. The master clock was
+-- increased from 12Mhz to 36Mhz and desing modified to allow 3 sprite data regions to be
+-- scanned at each line.
+--
+---------------------------------------------------------------------------------
+
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_unsigned.all;
+use ieee.numeric_std.all;
+
+entity traverse_usa is
+port(
+ clock_36 : in std_logic;
+ clock_0p895 : in std_logic;
+ reset : in std_logic;
+-- tv15Khz_mode : in std_logic;
+ video_r : out std_logic_vector(1 downto 0);
+ video_g : out std_logic_vector(2 downto 0);
+ video_b : out std_logic_vector(2 downto 0);
+ video_clk : out std_logic;
+ video_csync : out std_logic;
+ video_blankn : out std_logic;
+ video_hs : out std_logic;
+ video_vs : out std_logic;
+ audio_out : out std_logic_vector(10 downto 0);
+
+ cpu_rom_addr : out std_logic_vector(14 downto 0);
+ cpu_rom_do : in std_logic_vector( 7 downto 0);
+ cpu_rom_rd : out std_logic;
+
+ dip_switch_1 : in std_logic_vector(7 downto 0); -- Coinage_B(7-4) / Cont. play(3) / Fuel consumption(2) / Fuel lost when collision (1-0)
+ dip_switch_2 : in std_logic_vector(7 downto 0); -- Diag(7) / Demo(6) / Zippy(5) / Freeze (4) / M-Km(3) / Coin mode (2) / Cocktail(1) / Flip(0)
+
+ start2 : in std_logic;
+ start1 : in std_logic;
+ coin1 : in std_logic;
+
+ right1 : in std_logic;
+ left1 : in std_logic;
+ accel1 : in std_logic;
+ brake1 : in std_logic;
+
+ right2 : in std_logic;
+ left2 : in std_logic;
+ accel2 : in std_logic;
+ brake2 : in std_logic;
+
+ dbg_cpu_addr : out std_logic_vector(15 downto 0)
+ );
+end traverse_usa;
+
+architecture struct of traverse_usa is
+
+ signal reset_n: std_logic;
+ signal clock_36n : std_logic;
+ signal clock_cnt : std_logic_vector(3 downto 0) := "0000";
+
+ signal hcnt : std_logic_vector(8 downto 0) := '0'&x"00"; -- horizontal counter
+ signal vcnt : std_logic_vector(8 downto 0) := '0'&x"00"; -- vertical counter
+
+ signal hcnt_flip : std_logic_vector(8 downto 0);
+ signal vcnt_flip : std_logic_vector(8 downto 0);
+ signal hcnt_scrolled : std_logic_vector(8 downto 0);
+ signal hcnt_scrolled_flip : std_logic_vector(2 downto 0);
+
+ signal pix_ena : std_logic;
+
+ signal csync : std_logic;
+ signal hsync0 : std_logic;
+ signal hsync1 : std_logic;
+ signal hsync2 : std_logic;
+
+ signal hblank : std_logic;
+ signal vblank : std_logic;
+
+ signal cpu_ena : std_logic;
+
+ signal cpu_addr : std_logic_vector(15 downto 0);
+ signal cpu_di : std_logic_vector( 7 downto 0);
+ signal cpu_do : std_logic_vector( 7 downto 0);
+ signal cpu_wr_n : std_logic;
+ signal cpu_mreq_n : std_logic;
+ signal cpu_ioreq_n : std_logic;
+ signal cpu_irq_n : std_logic;
+ signal cpu_m1_n : std_logic;
+
+-- signal cpu_rom_do : std_logic_vector( 7 downto 0);
+
+ signal wram_we : std_logic;
+ signal wram_do : std_logic_vector( 7 downto 0);
+
+ signal flip : std_logic;
+ signal flip_int : std_logic;
+
+ signal chrram_addr: std_logic_vector(11 downto 0);
+ signal chrram_we : std_logic;
+ signal chrram_do : std_logic_vector(7 downto 0);
+ signal chrram_do_to_cpu : std_logic_vector( 7 downto 0);
+
+ signal scroll_x : std_logic_vector(8 downto 0) := (others=>'0');
+ signal apply_scroll : std_logic;
+
+ signal chr_code: std_logic_vector( 7 downto 0);
+ signal chr_attr: std_logic_vector( 7 downto 0);
+ signal chr_code_line : std_logic_vector(12 downto 0);
+ signal chr_flip_h : std_logic;
+
+ signal chr_graphx1_do : std_logic_vector(7 downto 0);
+ signal chr_graphx2_do : std_logic_vector(7 downto 0);
+ signal chr_graphx3_do : std_logic_vector(7 downto 0);
+ signal chr_color : std_logic_vector(3 downto 0);
+ signal chr_palette_addr : std_logic_vector(8 downto 0);
+ signal chr_palette_do : std_logic_vector(7 downto 0);
+
+ signal sprram_addr : std_logic_vector(9 downto 0);
+ signal sprram_we : std_logic;
+ signal sprram_do : std_logic_vector(7 downto 0);
+
+ signal cpu_has_spr_ram : std_logic;
+
+ signal spr_pix_ena : std_logic;
+ signal spr_hcnt : std_logic_vector(10 downto 0);
+ signal spr_posv, spr_posv_r : std_logic_vector( 7 downto 0);
+ signal spr_attr, spr_attr_r : std_logic_vector( 7 downto 0);
+ signal spr_code, spr_code_r : std_logic_vector( 7 downto 0);
+ signal spr_posh : std_logic_vector( 7 downto 0);
+
+ signal spr_vcnt : std_logic_vector( 7 downto 0);
+ signal spr_on_line : std_logic;
+ signal spr_on_line_r : std_logic;
+ signal spr_code_line : std_logic_vector(12 downto 0);
+ signal spr_line_cnt : std_logic_vector( 4 downto 0);
+ signal spr_graphx1_do : std_logic_vector( 7 downto 0);
+ signal spr_graphx2_do : std_logic_vector( 7 downto 0);
+ signal spr_graphx3_do : std_logic_vector( 7 downto 0);
+ signal spr_palette_addr : std_logic_vector( 7 downto 0);
+ signal spr_palette_do : std_logic_vector( 7 downto 0);
+ signal spr_pixels : std_logic_vector( 4 downto 0);
+ signal spr_rgb_lut_addr : std_logic_vector( 4 downto 0);
+ signal spr_rgb_lut_do : std_logic_vector( 7 downto 0);
+
+ signal spr_input_line_addr : std_logic_vector(7 downto 0);
+ signal spr_input_line_di : std_logic_vector(3 downto 0);
+ signal spr_input_line_do : std_logic_vector(3 downto 0);
+ signal spr_input_line_we : std_logic;
+
+ signal spr_output_line_addr : std_logic_vector(7 downto 0);
+ signal spr_output_line_di : std_logic_vector(3 downto 0);
+ signal spr_output_line_do : std_logic_vector(3 downto 0);
+ signal spr_output_line_we : std_logic;
+ signal spr_buffer_ram1_addr : std_logic_vector(7 downto 0);
+ signal spr_buffer_ram1_we : std_logic;
+ signal spr_buffer_ram1_di : std_logic_vector(3 downto 0);
+ signal spr_buffer_ram1_do : std_logic_vector(3 downto 0);
+ signal spr_buffer_ram2_addr : std_logic_vector(7 downto 0);
+ signal spr_buffer_ram2_we : std_logic;
+ signal spr_buffer_ram2_di : std_logic_vector(3 downto 0);
+ signal spr_buffer_ram2_do : std_logic_vector(3 downto 0);
+
+ signal sound_cmd : std_logic_vector( 7 downto 0);
+ signal audio : std_logic_vector(11 downto 0);
+
+ signal input_0 : std_logic_vector(7 downto 0);
+ signal input_1 : std_logic_vector(7 downto 0);
+ signal input_2 : std_logic_vector(7 downto 0);
+
+begin
+
+clock_36n <= not clock_36;
+reset_n <= not reset;
+
+-- debug
+process (reset, clock_36)
+begin
+ if rising_edge(clock_36) and cpu_ena ='1' and cpu_mreq_n ='0' then
+ dbg_cpu_addr <= cpu_addr;
+ end if;
+end process;
+
+-- make enables clock from 36MHz
+process (clock_36, reset)
+begin
+ if reset='1' then
+ clock_cnt <= "0000";
+ else
+ if rising_edge(clock_36) then
+ if clock_cnt = "1011" then
+ clock_cnt <= "0000";
+ else
+ clock_cnt <= clock_cnt + 1;
+ end if;
+ end if;
+ end if;
+end process;
+
+pix_ena <= '1' when clock_cnt = "0101" or clock_cnt = "1011" else '0'; -- (6MHz)
+cpu_ena <= '1' when clock_cnt = "1011" else '0'; -- (3MHz)
+
+-------------------
+-- Video scanner --
+-------------------
+-- hcnt [x080..x0FF-x100..x1FF] => 128+256 = 384 pixels, 384/6.144Mhz => 1 line is 62.5us (16.000KHz)
+-- vcnt [x0E6..x0FF-x100..x1FF] => 26+256 = 282 lines, 1 frame is 260 x 62.5us = 17.625ms (56.74Hz)
+
+process (reset, clock_36)
+begin
+ if reset='1' then
+ hcnt <= (others=>'0');
+ vcnt <= '0'&X"FC";
+ else
+ if rising_edge(clock_36) and pix_ena = '1'then
+ hcnt <= hcnt + 1;
+ if hcnt = '1'&x"FF" then
+ hcnt <= '0'&x"80";
+ vcnt <= vcnt + 1;
+ if vcnt = '1'&x"FF" then
+ vcnt <= '0'&x"E6"; -- from M52 schematics
+ end if;
+ end if;
+ end if;
+ end if;
+end process;
+
+flip <= flip_int xor dip_switch_2(0);
+hcnt_flip <= '0'&hcnt(7 downto 0) when flip ='1' else '0' & not hcnt(7 downto 0);
+vcnt_flip <= vcnt when flip ='1' else not vcnt;
+
+--------------------
+-- players inputs --
+--------------------
+input_0 <= "1111" & not coin1 & '1' & not start2 & not start1;
+input_1 <= not brake1 & '1' & not accel1 & "111" & not left1 & not right1;
+input_2 <= not brake2 & '1' & not accel2 & "111" & not left2 & not right2;
+
+------------------------------------------
+-- cpu data input with address decoding --
+------------------------------------------
+cpu_di <= cpu_rom_do when cpu_addr(15 downto 12) < X"8" else -- 0000-7FFF
+ chrram_do_to_cpu when cpu_addr(15 downto 12) = X"8" else -- 8000-8FFF
+ wram_do when cpu_addr(15 downto 12) = X"E" else -- E000-EFFF
+ input_0 when cpu_addr(15 downto 0) = X"D000" else -- D000
+ input_1 when cpu_addr(15 downto 0) = X"D001" else -- D001
+ input_2 when cpu_addr(15 downto 0) = X"D002" else -- D002
+ dip_switch_1 when cpu_addr(15 downto 0) = X"D003" else -- D003
+ dip_switch_2 when cpu_addr(15 downto 0) = X"D004" else -- D004
+ X"FF";
+
+------------------------------------------------------------------------
+-- Misc registers : interrupt, scroll, cocktail flip, sound trigger
+------------------------------------------------------------------------
+process (clock_36, reset)
+begin
+ if reset = '1' then
+ sound_cmd <= x"00";
+ elsif rising_edge(clock_36) then
+
+ if cpu_m1_n = '0' and cpu_ioreq_n = '0' then
+ cpu_irq_n <= '1';
+ else -- lauch irq and end of frame
+ if ((vcnt = 230 and flip = '0') or (vcnt = 448 and flip = '1')) and (hcnt = '0'&X"80") then
+ cpu_irq_n <= '0';
+ end if;
+ end if;
+
+ if cpu_wr_n = '0' and cpu_addr(15 downto 12) = X"9" then scroll_x(7 downto 0) <= cpu_do; end if;
+ if cpu_wr_n = '0' and cpu_addr(15 downto 12) = X"A" then scroll_x(8) <= cpu_do(0); end if;
+
+ if cpu_wr_n = '0' and cpu_addr(15 downto 0) = X"D000" then sound_cmd <= cpu_do; end if;
+ if cpu_wr_n = '0' and cpu_addr(15 downto 0) = X"D001" then flip_int <= cpu_do(0); end if;
+
+ end if;
+end process;
+
+------------------------------------------
+-- write enable to working ram from CPU --
+------------------------------------------
+wram_we <= '1' when cpu_wr_n = '0' and cpu_addr(15 downto 12) = X"E" else '0';
+
+----------------------
+--- sprite machine ---
+----------------------
+-- 3 regions sprite data scanner
+-- 080-1FF => C820-C87F
+-- 180-2FF => C8A0-C8FF
+-- 280-3FF => C920-C97F
+process (clock_36)
+begin
+ if rising_edge(clock_36) then
+ spr_pix_ena <= not spr_pix_ena; -- (18MHz)
+
+ if hcnt = '1'&x"FF" and pix_ena = '1' then -- synched with hcnt
+ spr_hcnt <= "000"&x"80";
+ spr_pix_ena <= '0';
+ else
+ if spr_pix_ena = '1' then
+ if spr_hcnt( 8 downto 0) = "1"&x"FF" then
+ spr_hcnt( 8 downto 0) <= '0'&x"80";
+ spr_hcnt(10 downto 9) <= spr_hcnt(10 downto 9) + '1';
+ else
+ spr_hcnt <= spr_hcnt + '1';
+ end if;
+ end if;
+ end if;
+ end if;
+end process;
+
+-- CPU allowed to access sprite data ram outside scrolling zone
+-- from x080 to x13F when not flipped (scrolling zone from x140 to x1FF)
+-- from x080 to x0FF and from x1C0 to x1FF when not flipped (scrolling zone from x100 to x1BF)
+-- within scrolling zone sprite data ram is accessed by sprite data scanner (spr_hcnt)
+
+cpu_has_spr_ram <= '1' when ( vcnt < '1'&x"3F" and flip = '0') or
+ ((vcnt > '1'&x"C0" or vcnt < '0'&x"FF") and flip = '1') else '0';
+
+sprram_we <= '1' when cpu_wr_n = '0' and cpu_addr(15 downto 11) = X"C"&"1" and cpu_has_spr_ram = '1' else '0';
+
+sprram_addr <= '0' & spr_hcnt(10 downto 4) & spr_hcnt(2 downto 1) when cpu_has_spr_ram = '0' else
+ cpu_addr(9 downto 0);
+
+
+-- latch current sprite data with respect to pixel and hcnt in relation with sprite data ram addressing
+process (clock_36)
+begin
+ if rising_edge(clock_36) then
+ if spr_pix_ena = '1' then
+ if spr_hcnt(2 downto 0) = "001" then spr_posv <= sprram_do ;end if;
+ if spr_hcnt(2 downto 0) = "011" then spr_attr <= sprram_do ;end if;
+ if spr_hcnt(2 downto 0) = "101" then spr_code <= sprram_do ;end if;
+ if spr_hcnt(2 downto 0) = "111" then
+ spr_posh <= sprram_do ;
+ spr_posv_r <= spr_posv;
+ spr_attr_r <= spr_attr;
+ spr_code_r <= spr_code;
+ end if;
+ end if;
+ end if;
+end process;
+
+-- compute sprite presence and graphics rom address w.r.t vertical position and v_flip (attr(7))
+-- sprite is also inhibited when outside scrolling zone (cpu_has_spr_ram)
+spr_vcnt <= vcnt_flip(7 downto 0) + spr_posv_r - 1 ;
+spr_on_line <= '1' when spr_vcnt(7 downto 4) = x"F" and cpu_has_spr_ram = '0' else '0';
+spr_line_cnt <= spr_vcnt(4 downto 0) xor (spr_attr_r(7) & spr_attr_r(7) & spr_attr_r(7) & spr_attr_r(7) & spr_attr_r(7));
+spr_code_line <= spr_code_r & (spr_attr_r(6) xor not spr_hcnt(3)) & spr_line_cnt(3 downto 0);
+
+-- get and serialise sprite graphics data and w.r.t enable (attr(5)) and h_flip (attr(6))
+-- and compute palette address from graphics bits and color set#
+with spr_attr_r(6 downto 5) select
+spr_palette_addr(0) <= spr_graphx1_do(to_integer(unsigned(not(spr_hcnt(2 downto 0))))) when "00",
+ spr_graphx1_do(to_integer(unsigned( (spr_hcnt(2 downto 0))))) when "10",
+ '0' when others;
+
+with spr_attr_r(6 downto 5) select
+spr_palette_addr(1) <= spr_graphx2_do(to_integer(unsigned(not(spr_hcnt(2 downto 0))))) when "00",
+ spr_graphx2_do(to_integer(unsigned( (spr_hcnt(2 downto 0))))) when "10",
+ '0' when others;
+
+with spr_attr_r(6 downto 5) select
+spr_palette_addr(2) <= spr_graphx3_do(to_integer(unsigned(not(spr_hcnt(2 downto 0))))) when "00",
+ spr_graphx3_do(to_integer(unsigned( (spr_hcnt(2 downto 0))))) when "10",
+ '0' when others;
+
+spr_palette_addr(7 downto 3) <= spr_attr_r(4 downto 0); -- color set#
+
+----------------------------------------------------
+-- manage read/write flip-flop sprite line buffer --
+----------------------------------------------------
+
+-- input buffer work at 36Mhz (read previous data before write)
+-- sprite data is written to input buffer when not already written (previous data differ from 0000)
+
+-- buffer data is written back to 0000 (cleared) after read from output buffer
+-- output buffer work at normal pixel speed (12Mhz since read previous data before clear)
+
+-- input/output buffers are swapped (fkip-flop) each other line
+
+process (clock_36)
+begin
+ if rising_edge(clock_36) then
+ if spr_pix_ena = '1' then
+
+ spr_on_line_r <= spr_on_line;
+
+ spr_pixels(3 downto 0) <= spr_palette_do(3 downto 0);
+ spr_pixels(4) <= spr_attr_r(4); -- not used !
+
+ -- write input buffer at the right place
+ if spr_hcnt(3 downto 0) = "1000" then
+ spr_input_line_addr <= spr_posh;
+ else
+ spr_input_line_addr <= spr_input_line_addr+1;
+ end if;
+
+ end if;
+
+ -- read output buffer w.r.t. flip screen (normal/reverse)
+ if pix_ena = '1' then
+ if hcnt < '1'&x"09" then
+ spr_output_line_addr <= X"00";
+ else
+ if flip = '0' then
+ spr_output_line_addr <= spr_output_line_addr+1;
+ else
+ spr_output_line_addr <= spr_output_line_addr-1;
+ end if;
+ end if;
+
+ end if;
+
+ -- demux output buffer (flip-flop)
+ if pix_ena = '0' then
+ if vcnt(0) = '1'then
+ spr_output_line_do <= spr_buffer_ram1_do;
+ else
+ spr_output_line_do <= spr_buffer_ram2_do;
+ end if;
+ end if;
+
+ end if;
+end process;
+
+-- read previous data from input buffer w.r.t. flip-flop
+spr_input_line_do <= spr_buffer_ram1_do when vcnt(0) = '0' else spr_buffer_ram2_do;
+
+-- feed input buffer
+spr_input_line_di <= spr_pixels(3 downto 0);
+-- keep write data if input buffer is clear
+spr_input_line_we <= '1' when spr_on_line_r = '1' and spr_pix_ena = '1' and spr_input_line_do = "0000" else '0';
+
+-- feed output buufer (clear)
+spr_output_line_di <= "0000";
+-- always clear just after read
+spr_output_line_we <= pix_ena;
+
+-- flip-flop input/output buffers
+spr_buffer_ram1_addr <= not(spr_input_line_addr) when vcnt(0) = '0' else spr_output_line_addr;
+spr_buffer_ram1_di <= spr_input_line_di when vcnt(0) = '0' else spr_output_line_di;
+spr_buffer_ram1_we <= spr_input_line_we when vcnt(0) = '0' else spr_output_line_we;
+
+spr_buffer_ram2_addr <= not(spr_input_line_addr) when vcnt(0) = '1' else spr_output_line_addr;
+spr_buffer_ram2_di <= spr_input_line_di when vcnt(0) = '1' else spr_output_line_di;
+spr_buffer_ram2_we <= spr_input_line_we when vcnt(0) = '1' else spr_output_line_we;
+
+-- feed sprite color lut with sprite output buffer
+spr_rgb_lut_addr <= '0' & spr_output_line_do;
+
+--------------------
+--- char machine ---
+--------------------
+-- compute scrolling zone and apply to horizontal scanner
+apply_scroll <= not(vcnt_flip(6) and vcnt_flip(7));
+hcnt_scrolled <= hcnt_flip + scroll_x when apply_scroll = '1' else hcnt_flip;
+hcnt_scrolled_flip <= hcnt_scrolled(2 downto 0) when flip = '1' else not (hcnt_scrolled(2 downto 0));
+
+-- compute ram tile address w.r.t horizontal scanner
+-- address char attr at pixel # 0
+-- address char code at pixel # 4
+-- give access to CPU for all other pixels
+with hcnt_scrolled_flip(2 downto 0) select
+chrram_addr <= vcnt_flip(7 downto 3) & hcnt_scrolled(8 downto 3) & '1' when "000",
+ vcnt_flip(7 downto 3) & hcnt_scrolled(8 downto 3) & '0' when "100",
+ cpu_addr(11 downto 0) when others;
+
+-- write enable to char tile ram from CPU
+chrram_we <= '1' when cpu_wr_n = '0' and cpu_addr(15 downto 12) = X"8" and hcnt_scrolled_flip(1 downto 0) /= "00" else '0';
+
+-- read char tile ram and manage char graphics
+process (clock_36)
+begin
+ if rising_edge(clock_36) then
+ -- latch ram tile output w.r.t to addressing scheme (attr/code/CPU)
+ if hcnt_scrolled_flip(2 downto 0) = "000" then
+ chr_attr <= chrram_do;
+ end if;
+ if hcnt_scrolled_flip(1 downto 0) /= "00" then
+ chrram_do_to_cpu <= chrram_do;
+ end if;
+ if hcnt_scrolled_flip(2 downto 0) = "100" then
+ chr_code <= chrram_do;
+ end if;
+
+ -- compute graphics rom address and delay char flip and color
+ if hcnt_scrolled_flip(2 downto 0) = "111" and pix_ena = '1' then
+ chr_code_line( 2 downto 0) <= vcnt_flip(2 downto 0) xor (chr_attr(4) & chr_attr(4) & chr_attr(4));
+ chr_code_line(10 downto 3) <= chr_code;
+ chr_code_line(12 downto 11) <= chr_attr(7) & chr_attr(6);
+ chr_flip_h <= chr_attr(5);
+ chr_color <= chr_attr(3 downto 0);
+ end if;
+
+ -- get and serialise char graphics data and w.r.t char flip
+ -- and compute palette address from graphics bits and color set#
+ if pix_ena = '1' then
+ chr_palette_addr(6 downto 3) <= chr_color;
+ chr_palette_addr(7) <= '0';
+ chr_palette_addr(8) <= '0';
+ if chr_flip_h = '0' then
+ chr_palette_addr(0) <= chr_graphx1_do(to_integer(unsigned(not(hcnt_scrolled(2 downto 0)))));
+ chr_palette_addr(1) <= chr_graphx2_do(to_integer(unsigned(not(hcnt_scrolled(2 downto 0)))));
+ chr_palette_addr(2) <= chr_graphx3_do(to_integer(unsigned(not(hcnt_scrolled(2 downto 0)))));
+ else
+ chr_palette_addr(0) <= chr_graphx1_do(to_integer(unsigned(hcnt_scrolled(2 downto 0))));
+ chr_palette_addr(1) <= chr_graphx2_do(to_integer(unsigned(hcnt_scrolled(2 downto 0))));
+ chr_palette_addr(2) <= chr_graphx3_do(to_integer(unsigned(hcnt_scrolled(2 downto 0))));
+ end if;
+
+ end if;
+ end if;
+end process;
+
+---------------------------
+-- mux char/sprite video --
+---------------------------
+process (clock_36)
+begin
+ if rising_edge(clock_36) then
+
+ if pix_ena = '1' then
+ -- always give priority to sprite when not 0000
+ -- except for char color #6 and #7 of color set#15
+ if spr_output_line_do /= "0000" and
+ (chr_palette_addr(6 downto 0) < "1111110") then
+ video_r <= spr_rgb_lut_do(7 downto 6);
+ video_g <= spr_rgb_lut_do(5 downto 3);
+ video_b <= spr_rgb_lut_do(2 downto 0);
+ else
+ video_r <= chr_palette_do(7 downto 6);
+ video_g <= chr_palette_do(5 downto 3);
+ video_b <= chr_palette_do(2 downto 0);
+ end if;
+ end if;
+
+ end if;
+end process;
+
+---------------------------------------------------------
+-- Sound board is same as Moon patrol (except CPU rom) --
+---------------------------------------------------------
+moon_patrol_sound_board : entity work.moon_patrol_sound_board
+port map(
+ clock_E => clock_0p895,
+ areset => reset,
+
+ select_sound => sound_cmd, -- not(key(1)) & sw(6 downto 0),
+ audio_out => audio,
+
+ dbg_cpu_addr => open --dbg_cpu_addr
+);
+
+
+audio_out <= audio(11 downto 1);
+
+----------------------------
+-- video syncs and blanks --
+----------------------------
+
+video_csync <= csync;
+
+process(clock_36)
+ constant hcnt_base : integer := 180;
+ variable hsync_cnt : std_logic_vector(8 downto 0);
+ variable vsync_cnt : std_logic_vector(3 downto 0);
+begin
+
+if rising_edge(clock_36) and pix_ena = '1' then
+
+ if hcnt = hcnt_base then
+ hsync_cnt := (others=>'0');
+ else
+ hsync_cnt := hsync_cnt + 1;
+ end if;
+
+ if hsync_cnt = 0 then hsync0 <= '0';
+ elsif hsync_cnt = 24 then hsync0 <= '1';
+ end if;
+
+ if hsync_cnt = 0 then hsync1 <= '0';
+ elsif hsync_cnt = 0+8 then hsync1 <= '1';
+ elsif hsync_cnt = 192 then hsync1 <= '0';
+ elsif hsync_cnt = 192+8 then hsync1 <= '1';
+ end if;
+
+ if hsync_cnt = 0 then hsync2 <= '0';
+ elsif hsync_cnt = 192-8 then hsync2 <= '1';
+ elsif hsync_cnt = 192 then hsync2 <= '0';
+ elsif hsync_cnt = 384-8 then hsync2 <= '1';
+ end if;
+
+ if hcnt = hcnt_base then
+ if vcnt = 238 then
+ vsync_cnt := X"0";
+ else
+ if vsync_cnt < X"F" then vsync_cnt := vsync_cnt + 1; end if;
+ end if;
+ end if;
+
+ if vsync_cnt = 0 then csync <= hsync1;
+ elsif vsync_cnt = 1 then csync <= hsync1;
+ elsif vsync_cnt = 2 then csync <= hsync1;
+ elsif vsync_cnt = 3 then csync <= hsync2;
+ elsif vsync_cnt = 4 then csync <= hsync2;
+ elsif vsync_cnt = 5 then csync <= hsync2;
+ elsif vsync_cnt = 6 then csync <= hsync1;
+ elsif vsync_cnt = 7 then csync <= hsync1;
+ elsif vsync_cnt = 8 then csync <= hsync1;
+ else csync <= hsync0;
+ end if;
+
+ -- hcnt : [128-511] 384 pixels
+ if hcnt = 128 then hblank <= '1';
+ elsif hcnt = 272 then hblank <= '0';
+ end if;
+
+ -- vcnt : [230-511] 282 lines
+ if vcnt = 230 then vblank <= '1';
+ elsif vcnt = 256 then vblank <= '0';
+ end if;
+
+ -- external sync and blank outputs
+ video_blankn <= not (hblank or vblank);
+--
+ video_hs <= hsync0;
+--
+ if vsync_cnt = 0 then video_vs <= '0';
+ elsif vsync_cnt = 2 then video_vs <= '1';
+ end if;
+--
+end if;
+end process;
+
+------------------------------
+-- components & sound board --
+------------------------------
+
+-- microprocessor Z80
+cpu : entity work.T80se
+generic map(Mode => 0, T2Write => 1, IOWait => 1)
+port map(
+ RESET_n => reset_n,
+ CLK => clock_36,
+ CEN => cpu_ena,
+ WAIT_n => '1',
+ INT_n => cpu_irq_n,
+ NMI_n => '1', --cpu_nmi_n,
+ BUSRQ_n => '1',
+ M1_n => cpu_m1_n,
+ MREQ_n => cpu_mreq_n,
+ IORQ_n => cpu_ioreq_n,
+ RD_n => open,
+ WR_n => cpu_wr_n,
+ RFSH_n => open,
+ HALT_n => open,
+ BUSAK_n => open,
+ A => cpu_addr,
+ DI => cpu_di,
+ DO => cpu_do
+);
+
+-- cpu program ROM 0x0000-0x7FFF
+--rom_cpu : entity work.travusa_cpu
+--port map(
+-- clk => clock_36n,
+-- addr => cpu_addr(14 downto 0),
+-- data => cpu_rom_do
+--);
+cpu_rom_addr <= cpu_addr(14 downto 0);
+cpu_rom_rd <= '1' when cpu_mreq_n = '0' and cpu_addr(15) = '0';
+
+-- working RAM 0xE000-0xEFFF
+wram : entity work.gen_ram
+generic map( dWidth => 8, aWidth => 12)
+port map(
+ clk => clock_36n,
+ we => wram_we,
+ addr => cpu_addr(11 downto 0),
+ d => cpu_do,
+ q => wram_do
+);
+
+-- char RAM 0x8000-0x8FFF
+chrram : entity work.gen_ram
+generic map( dWidth => 8, aWidth => 12)
+port map(
+ clk => clock_36n,
+ we => chrram_we,
+ addr => chrram_addr,
+ d => cpu_do,
+ q => chrram_do
+);
+
+-- sprite RAM 0xC800-0xCBFF
+sprite_ram : entity work.gen_ram
+generic map( dWidth => 8, aWidth => 10)
+port map(
+ clk => clock_36n,
+ we => sprram_we,
+ addr => sprram_addr,
+ d => cpu_do,
+ q => sprram_do
+);
+
+-- sprite line buffer 1
+sprlinebuf1 : entity work.gen_ram
+generic map( dWidth => 4, aWidth => 8)
+port map(
+ clk => clock_36n,
+ we => spr_buffer_ram1_we,
+ addr => spr_buffer_ram1_addr,
+ d => spr_buffer_ram1_di,
+ q => spr_buffer_ram1_do
+);
+
+-- sprite line buffer 2
+sprlinebuf2 : entity work.gen_ram
+generic map( dWidth => 4, aWidth => 8)
+port map(
+ clk => clock_36n,
+ we => spr_buffer_ram2_we,
+ addr => spr_buffer_ram2_addr,
+ d => spr_buffer_ram2_di,
+ q => spr_buffer_ram2_do
+);
+
+-- char graphics ROM 3E
+char_graphics_1 : entity work.travusa_chr_bit1
+port map(
+ clk => clock_36n,
+ addr => chr_code_line,
+ data => chr_graphx1_do
+);
+
+-- char graphics ROM 3E
+char_graphics_2 : entity work.travusa_chr_bit2
+port map(
+ clk => clock_36n,
+ addr => chr_code_line,
+ data => chr_graphx2_do
+);
+
+-- char graphics ROM 3E
+char_graphics_3 : entity work.travusa_chr_bit3
+port map(
+ clk => clock_36n,
+ addr => chr_code_line,
+ data => chr_graphx3_do
+);
+
+--char palette ROM
+char_palette : entity work.travusa_chr_palette
+port map(
+ clk => clock_36n,
+ addr => chr_palette_addr,
+ data => chr_palette_do
+);
+
+-- sprite graphics ROM 3N
+sprite_graphics_1 : entity work.travusa_spr_bit1
+port map(
+ clk => clock_36n,
+ addr => spr_code_line,
+ data => spr_graphx1_do
+);
+
+-- sprite graphics ROM 3L or 3M
+sprite_graphics_2 : entity work.travusa_spr_bit2
+port map(
+ clk => clock_36n,
+ addr => spr_code_line,
+ data => spr_graphx2_do
+);
+
+-- sprite graphics ROM 3K
+sprite_graphics3 : entity work.travusa_spr_bit3
+port map(
+ clk => clock_36n,
+ addr => spr_code_line,
+ data => spr_graphx3_do
+);
+
+-- sprite palette ROM 2H
+spr_palette: entity work.travusa_spr_palette
+port map(
+ clk => clock_36n,
+ addr => spr_palette_addr,
+ data => spr_palette_do
+);
+
+-- sprite rgb lut ROM 1F
+spr_rgb_lut: entity work.travusa_spr_rgb_lut
+port map(
+ clk => clock_36n,
+ addr => spr_rgb_lut_addr,
+ data => spr_rgb_lut_do
+);
+
+end struct;
\ No newline at end of file
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/traverse_usa_de10_lite.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/traverse_usa_de10_lite.vhd
new file mode 100644
index 00000000..471a19d8
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/traverse_usa_de10_lite.vhd
@@ -0,0 +1,363 @@
+---------------------------------------------------------------------------------
+-- DE10_lite Top level for Traverse USA by Dar (darfpga@aol.fr) (16/03/2019)
+-- http://darfpga.blogspot.fr
+---------------------------------------------------------------------------------
+-- Educational use only
+-- Do not redistribute synthetized file with roms
+-- Do not redistribute roms whatever the form
+-- Use at your own risk
+---------------------------------------------------------------------------------
+-- Use traverse_usa_de10_lite.sdc to compile (Timequest constraints)
+-- /!\
+-- Don't forget to set device configuration mode with memory initialization
+-- (Assignments/Device/Pin options/Configuration mode)
+---------------------------------------------------------------------------------
+--
+-- Main features :
+-- PS2 keyboard input @gpio pins 35/34 (beware voltage translation/protection)
+-- Audio pwm output @gpio pins 1/3 (beware voltage translation/protection)
+--
+-- Video : 15Khz only atm
+-- Cocktail mode : OK
+-- Sound : OK
+--
+-- For hardware schematic see my other project : NES.
+--
+-- Uses 1 pll for 36MHz and 3.58MHz generation from 50MHz
+--
+--
+-- Board key :
+-- 0 : reset game
+--
+-- Keyboard players inputs :
+--
+-- F3 : Add coin
+-- F2 : Start 2 players
+-- F1 : Start 1 player
+-- SPACE : Fire
+-- RIGHT arrow : turn right
+-- LEFT arrow : turn left
+-- UP arrow : speed up
+-- DOWN arrow : speed down
+--
+-- Other details : see traverse_usa.vhd
+-- For USB inputs and SGT5000 audio output see my other project: xevious_de10_lite
+---------------------------------------------------------------------------------
+
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.std_logic_unsigned.all;
+use ieee.numeric_std.all;
+
+library work;
+--use work.usb_report_pkg.all;
+
+entity traverse_usa_de10_lite is
+port(
+ max10_clk1_50 : in std_logic;
+-- max10_clk2_50 : in std_logic;
+-- adc_clk_10 : in std_logic;
+ ledr : out std_logic_vector(9 downto 0);
+ key : in std_logic_vector(1 downto 0);
+ sw : in std_logic_vector(9 downto 0);
+
+-- dram_ba : out std_logic_vector(1 downto 0);
+-- dram_ldqm : out std_logic;
+-- dram_udqm : out std_logic;
+-- dram_ras_n : out std_logic;
+-- dram_cas_n : out std_logic;
+-- dram_cke : out std_logic;
+-- dram_clk : out std_logic;
+-- dram_we_n : out std_logic;
+-- dram_cs_n : out std_logic;
+-- dram_dq : inout std_logic_vector(15 downto 0);
+-- dram_addr : out std_logic_vector(12 downto 0);
+
+ hex0 : out std_logic_vector(7 downto 0);
+ hex1 : out std_logic_vector(7 downto 0);
+ hex2 : out std_logic_vector(7 downto 0);
+ hex3 : out std_logic_vector(7 downto 0);
+-- hex4 : out std_logic_vector(7 downto 0);
+-- hex5 : out std_logic_vector(7 downto 0);
+
+ vga_r : out std_logic_vector(3 downto 0);
+ vga_g : out std_logic_vector(3 downto 0);
+ vga_b : out std_logic_vector(3 downto 0);
+ vga_hs : out std_logic;
+ vga_vs : out std_logic;
+
+-- gsensor_cs_n : out std_logic;
+-- gsensor_int : in std_logic_vector(2 downto 0);
+-- gsensor_sdi : inout std_logic;
+-- gsensor_sdo : inout std_logic;
+-- gsensor_sclk : out std_logic;
+
+-- arduino_io : inout std_logic_vector(15 downto 0);
+-- arduino_reset_n : inout std_logic;
+
+ gpio : inout std_logic_vector(35 downto 0)
+);
+end traverse_usa_de10_lite;
+
+architecture struct of traverse_usa_de10_lite is
+
+ signal clock_36 : std_logic;
+ signal clock_6 : std_logic;
+ signal clock_3p58: std_logic;
+ signal reset : std_logic;
+
+ signal clock_div : std_logic_vector(2 downto 0);
+
+-- signal max3421e_clk : std_logic;
+
+ signal r : std_logic_vector(1 downto 0);
+ signal g : std_logic_vector(2 downto 0);
+ signal b : std_logic_vector(2 downto 0);
+ signal csync : std_logic;
+ signal blankn : std_logic;
+
+ signal audio : std_logic_vector(10 downto 0);
+ signal pwm_accumulator : std_logic_vector(12 downto 0);
+
+ alias reset_n : std_logic is key(0);
+ alias ps2_clk : std_logic is gpio(35); --gpio(0);
+ alias ps2_dat : std_logic is gpio(34); --gpio(1);
+ alias pwm_audio_out_l : std_logic is gpio(1); --gpio(2);
+ alias pwm_audio_out_r : std_logic is gpio(3); --gpio(3);
+
+ signal kbd_intr : std_logic;
+ signal kbd_scancode : std_logic_vector(7 downto 0);
+ signal joyPCFRLDU : std_logic_vector(7 downto 0);
+-- signal keys_HUA : std_logic_vector(2 downto 0);
+
+-- signal start : std_logic := '0';
+-- signal usb_report : usb_report_t;
+-- signal new_usb_report : std_logic := '0';
+
+signal dbg_cpu_addr : std_logic_vector(15 downto 0);
+
+begin
+
+reset <= not reset_n;
+
+-- tv15Khz_mode <= sw();
+
+--arduino_io not used pins
+--arduino_io(7) <= '1'; -- to usb host shield max3421e RESET
+--arduino_io(8) <= 'Z'; -- from usb host shield max3421e GPX
+--arduino_io(9) <= 'Z'; -- from usb host shield max3421e INT
+--arduino_io(13) <= 'Z'; -- not used
+--arduino_io(14) <= 'Z'; -- not used
+
+-- Clock 36MHz for traverse_usa core, 3.58MHz for sound_board
+clocks : entity work.max10_pll_36p86M_3p58M
+port map(
+ inclk0 => max10_clk1_50,
+ c0 => clock_36,
+ c1 => clock_3p58,
+ locked => open --pll_locked
+);
+
+-- Traverse_usa
+traverse_usa : entity work.traverse_usa
+port map(
+ clock_36 => clock_36,
+ clock_3p58 => clock_3p58,
+ reset => reset,
+
+-- tv15Khz_mode => tv15Khz_mode,
+ video_r => r,
+ video_g => g,
+ video_b => b,
+ video_csync => csync,
+ video_blankn => blankn,
+ video_hs => open, --hsync, -- not tested
+ video_vs => open, --vsync, -- not tested
+ audio_out => audio,
+
+ dip_switch_1 => x"FF", -- Coinage_B(7-4) / Cont. play(3) / Fuel consumption(2) / Fuel lost when collision (1-0)
+ dip_switch_2 => x"FE", -- Diag(7) / Demo(6) / Zippy(5) / Freeze (4) / M-Km(3) / Coin mode (2) / Cocktail(1) / Flip(0)
+
+ start2 => joyPCFRLDU(7),
+ start1 => joyPCFRLDU(6),
+ coin1 => joyPCFRLDU(5),
+
+-- fire1 => joyPCFRLDU(4),
+ right1 => joyPCFRLDU(3),
+ left1 => joyPCFRLDU(2),
+ brake1 => joyPCFRLDU(1),
+ accel1 => joyPCFRLDU(0),
+
+-- fire2 => joyPCFRLDU(4),
+ right2 => joyPCFRLDU(3),
+ left2 => joyPCFRLDU(2),
+ brake2 => joyPCFRLDU(1),
+ accel2 => joyPCFRLDU(0),
+
+ dbg_cpu_addr => dbg_cpu_addr
+);
+
+-- adapt video to 4bits/color only
+vga_r <= r&"00" when blankn = '1' else "0000";
+vga_g <= g&'0' when blankn = '1' else "0000";
+vga_b <= b&'0' when blankn = '1' else "0000";
+
+-- synchro composite/ synchro horizontale
+vga_hs <= csync;
+-- vga_hs <= csync when tv15Khz_mode = '1' else hsync;
+-- commutation rapide / synchro verticale
+vga_vs <= '1';
+-- vga_vs <= '1' when tv15Khz_mode = '1' else vsync;
+
+--sound_string <= "00" & audio & "000" & "00" & audio & "000";
+
+-- get scancode from keyboard
+process (reset, clock_36)
+begin
+ if reset='1' then
+ clock_div <= "000";
+ clock_6 <= '0';
+ else
+ if rising_edge(clock_36) then
+ if clock_div = "101" then
+ clock_div <= "000";
+ clock_6 <= not clock_6;
+ else
+ clock_div <= clock_div + '1';
+ end if;
+ end if;
+ end if;
+end process;
+
+keyboard : entity work.io_ps2_keyboard
+port map (
+ clk => clock_6, -- synchrounous clock with core
+ kbd_clk => ps2_clk,
+ kbd_dat => ps2_dat,
+ interrupt => kbd_intr,
+ scancode => kbd_scancode
+);
+
+-- translate scancode to joystick
+joystick : entity work.kbd_joystick
+port map (
+ clk => clock_6, -- synchrounous clock with core
+ kbdint => kbd_intr,
+ kbdscancode => std_logic_vector(kbd_scancode),
+ joyPCFRLDU => joyPCFRLDU
+);
+
+-- usb host for max3421e arduino shield (modified)
+
+--max3421e_clk <= clock_11;
+--usb_host : entity work.usb_host_max3421e
+--port map(
+-- clk => max3421e_clk,
+-- reset => reset,
+-- start => start,
+--
+-- usb_report => usb_report,
+-- new_usb_report => new_usb_report,
+--
+-- spi_cs_n => arduino_io(10),
+-- spi_clk => arduino_io(13),
+-- spi_mosi => arduino_io(11),
+-- spi_miso => arduino_io(12)
+--);
+
+-- usb keyboard report decoder
+
+--keyboard_decoder : entity work.usb_keyboard_decoder
+--port map(
+-- clk => max3421e_clk,
+--
+-- usb_report => usb_report,
+-- new_usb_report => new_usb_report,
+--
+-- joyBCPPFRLDU => joyBCPPFRLDU
+--);
+
+-- usb joystick decoder (konix drakkar wireless)
+
+--joystick_decoder : entity work.usb_joystick_decoder
+--port map(
+-- clk => max3421e_clk,
+--
+-- usb_report => usb_report,
+-- new_usb_report => new_usb_report,
+--
+-- joyBCPPFRLDU => open --joyBCPPFRLDU
+--);
+
+-- debug display
+
+--ledr(8 downto 0) <= joyBCPPFRLDU;
+--
+h0 : entity work.decodeur_7_seg port map(dbg_cpu_addr( 3 downto 0),hex0);
+h1 : entity work.decodeur_7_seg port map(dbg_cpu_addr( 7 downto 4),hex1);
+h2 : entity work.decodeur_7_seg port map(dbg_cpu_addr(11 downto 8),hex2);
+h3 : entity work.decodeur_7_seg port map(dbg_cpu_addr(15 downto 12),hex3);
+--h4 : entity work.decodeur_7_seg port map(usb_report(to_integer(unsigned(sw))+0)(3 downto 0),hex4);
+--h5 : entity work.decodeur_7_seg port map(usb_report(to_integer(unsigned(sw))+0)(7 downto 4),hex5);
+
+-- audio for sgtl5000
+
+--sample_data <= "00" & audio & "000" & "00" & audio & "000";
+
+-- Clock 1us for ym_8910
+
+--p_clk_1us_p : process(max10_clk1_50)
+--begin
+-- if rising_edge(max10_clk1_50) then
+-- if cnt_1us = 0 then
+-- cnt_1us <= 49;
+-- clk_1us <= '1';
+-- else
+-- cnt_1us <= cnt_1us - 1;
+-- clk_1us <= '0';
+-- end if;
+-- end if;
+--end process;
+
+-- sgtl5000 (teensy audio shield on top of usb host shield)
+
+--e_sgtl5000 : entity work.sgtl5000_dac
+--port map(
+-- clock_18 => clock_18,
+-- reset => reset,
+-- i2c_clock => clk_1us,
+--
+-- sample_data => sample_data,
+--
+-- i2c_sda => arduino_io(0), -- i2c_sda,
+-- i2c_scl => arduino_io(1), -- i2c_scl,
+--
+-- tx_data => arduino_io(2), -- sgtl5000 tx
+-- mclk => arduino_io(4), -- sgtl5000 mclk
+--
+-- lrclk => arduino_io(3), -- sgtl5000 lrclk
+-- bclk => arduino_io(6), -- sgtl5000 bclk
+--
+-- -- debug
+-- hex0_di => open, -- hex0_di,
+-- hex1_di => open, -- hex1_di,
+-- hex2_di => open, -- hex2_di,
+-- hex3_di => open, -- hex3_di,
+--
+-- sw => sw(7 downto 0)
+--);
+
+-- pwm sound output
+
+process(clock_3p58) -- use same clock as pooyan_sound_board
+begin
+ if rising_edge(clock_3p58) then
+ pwm_accumulator <= std_logic_vector(unsigned('0' & pwm_accumulator(11 downto 0)) + unsigned(audio & "00"));
+ end if;
+end process;
+
+pwm_audio_out_l <= pwm_accumulator(12);
+pwm_audio_out_r <= pwm_accumulator(12);
+
+
+end struct;
diff --git a/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/ym_2149_linmix.vhd b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/ym_2149_linmix.vhd
new file mode 100644
index 00000000..b0573a80
--- /dev/null
+++ b/Arcade_MiST/IremM52 Hardware/TraverseUSA_MiST/rtl/ym_2149_linmix.vhd
@@ -0,0 +1,645 @@
+--
+-- A simulation model of YM2149 (AY-3-8910 with bells on)
+
+-- Copyright (c) MikeJ - Jan 2005
+--
+-- 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 support@fpgaarcade.com
+--
+-- Revision list
+--
+-- version 001 initial release
+--
+-- Clues from MAME sound driver and Kazuhiro TSUJIKAWA
+--
+-- These are the measured outputs from a real chip for a single Isolated channel into a 1K load (V)
+-- vol 15 .. 0
+-- 3.27 2.995 2.741 2.588 2.452 2.372 2.301 2.258 2.220 2.198 2.178 2.166 2.155 2.148 2.141 2.132
+-- As the envelope volume is 5 bit, I have fitted a curve to the not quite log shape in order
+-- to produced all the required values.
+-- (The first part of the curve is a bit steeper and the last bit is more linear than expected)
+--
+-- NOTE, this component uses LINEAR mixing of the three analogue channels, and is only
+-- accurate for designs where the outputs are buffered and not simply wired together.
+-- The ouput level is more complex in that case and requires a larger table.
+
+library ieee;
+ use ieee.std_logic_1164.all;
+ use ieee.std_logic_arith.all;
+ use ieee.std_logic_unsigned.all;
+
+entity YM2149 is
+ port (
+ -- data bus
+ I_DA : in std_logic_vector(7 downto 0);
+ O_DA : out std_logic_vector(7 downto 0);
+ O_DA_OE_L : out std_logic;
+ -- control
+ I_A9_L : in std_logic;
+ I_A8 : in std_logic;
+ I_BDIR : in std_logic;
+ I_BC2 : in std_logic;
+ I_BC1 : in std_logic;
+ I_SEL_L : in std_logic;
+
+ O_AUDIO : out std_logic_vector(7 downto 0);
+ -- port a
+ I_IOA : in std_logic_vector(7 downto 0);
+ O_IOA : out std_logic_vector(7 downto 0);
+ O_IOA_OE_L : out std_logic;
+ -- port b
+ I_IOB : in std_logic_vector(7 downto 0);
+ O_IOB : out std_logic_vector(7 downto 0);
+ O_IOB_OE_L : out std_logic;
+
+ ENA : in std_logic; -- clock enable for higher speed operation
+ RESET_L : in std_logic;
+ CLK : in std_logic -- note 6 Mhz
+ );
+end;
+
+architecture RTL of YM2149 is
+ type array_16x8 is array (0 to 15) of std_logic_vector(7 downto 0);
+ type array_3x12 is array (1 to 3) of std_logic_vector(11 downto 0);
+
+ signal cnt_div : std_logic_vector(3 downto 0) := (others => '0');
+ signal noise_div : std_logic := '0';
+ signal ena_div : std_logic;
+ signal ena_div_noise : std_logic;
+ signal poly17 : std_logic_vector(16 downto 0) := (others => '0');
+
+ -- registers
+ signal addr : std_logic_vector(7 downto 0);
+ signal busctrl_addr : std_logic;
+ signal busctrl_we : std_logic;
+ signal busctrl_re : std_logic;
+
+ signal reg : array_16x8 ; --:= (
+-- "00000000", -- R0 Period Tone A 8bits lsb
+-- "00000100", -- R1 Period Tone A 4bits msb
+-- "00000000", -- R2 Period Tone B 8bits lsb
+-- "00000010", -- R3 Period Tone B 4bits msb
+-- "00000000", -- R4 Period Tone C 8bits lsb
+-- "00000001", -- R5 Period Tone C 4bits msb
+-- "00001000", -- R6 Period Noise 5bits
+-- "00111000", -- R7 Mixer Noise CBA 3bits, Tone CBA 3bits
+-- "00000111", -- R8 Amplitude A Mode 1bit, Level 4bits
+-- "00000111", -- R9 Amplitude B Mode 1bit, Level 4bits
+-- "00000111", -- R10 Amplitude C Mode 1bit, Level 4bits
+-- "00000000", -- R11 Period Enveloppe 8bits lsb
+-- "00000000", -- R12 Period Enveloppe 8bits msb
+-- "00000000", -- R13 Shape Enveloppe 4bits
+-- "00000000", -- R14 Port A
+-- "00000000" -- R15 Port B
+-- );
+
+ signal env_reset : std_logic;
+ signal ioa_inreg : std_logic_vector(7 downto 0);
+ signal iob_inreg : std_logic_vector(7 downto 0);
+
+ signal noise_gen_cnt : std_logic_vector(4 downto 0);
+ signal noise_gen_op : std_logic;
+ signal tone_gen_cnt : array_3x12 := (others => (others => '0'));
+ signal tone_gen_op : std_logic_vector(3 downto 1) := "000";
+
+ signal env_gen_cnt : std_logic_vector(15 downto 0);
+ signal env_ena : std_logic;
+ signal env_hold : std_logic;
+ signal env_inc : std_logic;
+ signal env_vol : std_logic_vector(4 downto 0);
+
+ signal tone_ena_l : std_logic;
+ signal tone_src : std_logic;
+ signal noise_ena_l : std_logic;
+ signal chan_vol : std_logic_vector(4 downto 0);
+
+ signal dac_amp : std_logic_vector(7 downto 0);
+ signal audio_mix : std_logic_vector(9 downto 0);
+ signal audio_final : std_logic_vector(9 downto 0);
+begin
+ -- cpu i/f
+ p_busdecode : process(I_BDIR, I_BC2, I_BC1, addr, I_A9_L, I_A8)
+ variable cs : std_logic;
+ variable sel : std_logic_vector(2 downto 0);
+ begin
+ -- BDIR BC2 BC1 MODE
+ -- 0 0 0 inactive
+ -- 0 0 1 address
+ -- 0 1 0 inactive
+ -- 0 1 1 read
+ -- 1 0 0 address
+ -- 1 0 1 inactive
+ -- 1 1 0 write
+ -- 1 1 1 read
+ busctrl_addr <= '0';
+ busctrl_we <= '0';
+ busctrl_re <= '0';
+
+ cs := '0';
+ if (I_A9_L = '0') and (I_A8 = '1') and (addr(7 downto 4) = "0000") then
+ cs := '1';
+ end if;
+
+ sel := (I_BDIR & I_BC2 & I_BC1);
+ case sel is
+ when "000" => null;
+ when "001" => busctrl_addr <= '1';
+ when "010" => null;
+ when "011" => busctrl_re <= cs;
+ when "100" => busctrl_addr <= '1';
+ when "101" => null;
+ when "110" => busctrl_we <= cs;
+ when "111" => busctrl_addr <= '1';
+ when others => null;
+ end case;
+ end process;
+
+ p_oe : process(busctrl_re)
+ begin
+ -- if we are emulating a real chip, maybe clock this to fake up the tristate typ delay of 100ns
+ O_DA_OE_L <= not (busctrl_re);
+ end process;
+
+ --
+ -- CLOCKED
+ --
+ p_waddr : process
+ begin
+ ---- looks like registers are latches in real chip, but the address is caught at the end of the address state.
+ wait until rising_edge(CLK);
+
+ if (RESET_L = '0') then
+ addr <= (others => '0');
+ else
+ if (busctrl_addr = '1') then
+ addr <= I_DA;
+ end if;
+ end if;
+ end process;
+
+ p_wdata : process
+ begin
+ ---- looks like registers are latches in real chip, but the address is caught at the end of the address state.
+ wait until rising_edge(CLK);
+ env_reset <= '0';
+
+ if (RESET_L = '0') then
+ reg <= (others => (others => '0'));
+ env_reset <= '1';
+ else
+ env_reset <= '0';
+ if (busctrl_we = '1') then
+ case addr(3 downto 0) is
+ when x"0" => reg(0) <= I_DA;
+ when x"1" => reg(1) <= I_DA;
+ when x"2" => reg(2) <= I_DA;
+ when x"3" => reg(3) <= I_DA;
+ when x"4" => reg(4) <= I_DA;
+ when x"5" => reg(5) <= I_DA;
+ when x"6" => reg(6) <= I_DA;
+ when x"7" => reg(7) <= I_DA;
+ when x"8" => reg(8) <= I_DA;
+ when x"9" => reg(9) <= I_DA;
+ when x"A" => reg(10) <= I_DA;
+ when x"B" => reg(11) <= I_DA;
+ when x"C" => reg(12) <= I_DA;
+ when x"D" => reg(13) <= I_DA; env_reset <= '1';
+ when x"E" => reg(14) <= I_DA;
+ when x"F" => reg(15) <= I_DA;
+ when others => null;
+ end case;
+ end if;
+ end if;
+ end process;
+
+ --
+ -- LATCHED, useful when emulating a real chip in circuit. Nasty as gated clock.
+ --
+-- p_waddr : process(reset_l, busctrl_addr)
+-- begin
+-- -- looks like registers are latches in real chip, but the address is caught at the end of the address state.
+-- if (RESET_L = '0') then
+-- addr <= (others => '0');
+-- elsif falling_edge(busctrl_addr) then -- yuk
+-- addr <= I_DA;
+-- end if;
+-- end process;
+--
+-- p_wdata : process(reset_l, busctrl_we, addr)
+-- begin
+-- if (RESET_L = '0') then
+-- reg <= (others => (others => '0'));
+-- elsif falling_edge(busctrl_we) then
+-- case addr(3 downto 0) is
+-- when x"0" => reg(0) <= I_DA;
+-- when x"1" => reg(1) <= I_DA;
+-- when x"2" => reg(2) <= I_DA;
+-- when x"3" => reg(3) <= I_DA;
+-- when x"4" => reg(4) <= I_DA;
+-- when x"5" => reg(5) <= I_DA;
+-- when x"6" => reg(6) <= I_DA;
+-- when x"7" => reg(7) <= I_DA;
+-- when x"8" => reg(8) <= I_DA;
+-- when x"9" => reg(9) <= I_DA;
+-- when x"A" => reg(10) <= I_DA;
+-- when x"B" => reg(11) <= I_DA;
+-- when x"C" => reg(12) <= I_DA;
+-- when x"D" => reg(13) <= I_DA;
+-- when x"E" => reg(14) <= I_DA;
+-- when x"F" => reg(15) <= I_DA;
+-- when others => null;
+-- end case;
+-- end if;
+--
+-- env_reset <= '0';
+-- if (busctrl_we = '1') and (addr(3 downto 0) = x"D") then
+-- env_reset <= '1';
+-- end if;
+-- end process;
+
+ --
+ -- END LATCHED
+ --
+
+ p_rdata : process(busctrl_re, addr, reg)
+ begin
+ O_DA <= (others => '0'); -- 'X'
+ if (busctrl_re = '1') then -- not necessary, but useful for putting 'X's in the simulator
+ case addr(3 downto 0) is
+ when x"0" => O_DA <= reg(0) ;
+ when x"1" => O_DA <= "0000" & reg(1)(3 downto 0) ;
+ when x"2" => O_DA <= reg(2) ;
+ when x"3" => O_DA <= "0000" & reg(3)(3 downto 0) ;
+ when x"4" => O_DA <= reg(4) ;
+ when x"5" => O_DA <= "0000" & reg(5)(3 downto 0) ;
+ when x"6" => O_DA <= "000" & reg(6)(4 downto 0) ;
+ when x"7" => O_DA <= reg(7) ;
+ when x"8" => O_DA <= "000" & reg(8)(4 downto 0) ;
+ when x"9" => O_DA <= "000" & reg(9)(4 downto 0) ;
+ when x"A" => O_DA <= "000" & reg(10)(4 downto 0) ;
+ when x"B" => O_DA <= reg(11);
+ when x"C" => O_DA <= reg(12);
+ when x"D" => O_DA <= "0000" & reg(13)(3 downto 0);
+ when x"E" => if (reg(7)(6) = '0') then -- input
+ O_DA <= ioa_inreg;
+ else
+ O_DA <= reg(14); -- read output reg
+ end if;
+ when x"F" => if (Reg(7)(7) = '0') then
+ O_DA <= iob_inreg;
+ else
+ O_DA <= reg(15);
+ end if;
+ when others => null;
+ end case;
+ end if;
+ end process;
+ --
+ p_divider : process
+ begin
+ wait until rising_edge(CLK);
+ -- / 8 when SEL is high and /16 when SEL is low
+ if (ENA = '1') then
+ ena_div <= '0';
+ ena_div_noise <= '0';
+ if (cnt_div = "0000") then
+ cnt_div <= (not I_SEL_L) & "111";
+ ena_div <= '1';
+
+ noise_div <= not noise_div;
+ if (noise_div = '1') then
+ ena_div_noise <= '1';
+ end if;
+ else
+ cnt_div <= cnt_div - "1";
+ end if;
+ end if;
+ end process;
+
+ p_noise_gen : process
+ variable noise_gen_comp : std_logic_vector(4 downto 0);
+ variable poly17_zero : std_logic;
+ begin
+ wait until rising_edge(CLK);
+
+ if (reg(6)(4 downto 0) = "00000") then
+ noise_gen_comp := "00000";
+ else
+ noise_gen_comp := (reg(6)(4 downto 0) - "1");
+ end if;
+
+ poly17_zero := '0';
+ if (poly17 = "00000000000000000") then poly17_zero := '1'; end if;
+
+ if (ENA = '1') then
+
+ if (ena_div_noise = '1') then -- divider ena
+
+ if (noise_gen_cnt >= noise_gen_comp) then
+ noise_gen_cnt <= "00000";
+ poly17 <= (poly17(0) xor poly17(2) xor poly17_zero) & poly17(16 downto 1);
+ else
+ noise_gen_cnt <= (noise_gen_cnt + "1");
+ end if;
+ end if;
+ end if;
+ end process;
+ noise_gen_op <= poly17(0);
+
+ p_tone_gens : process
+ variable tone_gen_freq : array_3x12;
+ variable tone_gen_comp : array_3x12;
+ begin
+ wait until rising_edge(CLK);
+
+ -- looks like real chips count up - we need to get the Exact behaviour ..
+ tone_gen_freq(1) := reg(1)(3 downto 0) & reg(0);
+ tone_gen_freq(2) := reg(3)(3 downto 0) & reg(2);
+ tone_gen_freq(3) := reg(5)(3 downto 0) & reg(4);
+ -- period 0 = period 1
+ for i in 1 to 3 loop
+ if (tone_gen_freq(i) = x"000") then
+ tone_gen_comp(i) := x"000";
+ else
+ tone_gen_comp(i) := (tone_gen_freq(i) - "1");
+ end if;
+ end loop;
+
+ if (ENA = '1') then
+ for i in 1 to 3 loop
+ if (ena_div = '1') then -- divider ena
+
+ if (tone_gen_cnt(i) >= tone_gen_comp(i)) then
+ tone_gen_cnt(i) <= x"000";
+ tone_gen_op(i) <= not tone_gen_op(i);
+ else
+ tone_gen_cnt(i) <= (tone_gen_cnt(i) + "1");
+ end if;
+ end if;
+ end loop;
+ end if;
+ end process;
+
+ p_envelope_freq : process
+ variable env_gen_freq : std_logic_vector(15 downto 0);
+ variable env_gen_comp : std_logic_vector(15 downto 0);
+ begin
+ wait until rising_edge(CLK);
+ env_gen_freq := reg(12) & reg(11);
+ -- envelope freqs 1 and 0 are the same.
+ if (env_gen_freq = x"0000") then
+ env_gen_comp := x"0000";
+ else
+ env_gen_comp := (env_gen_freq - "1");
+ end if;
+
+ if (ENA = '1') then
+ env_ena <= '0';
+ if (ena_div = '1') then -- divider ena
+ if (env_gen_cnt >= env_gen_comp) then
+ env_gen_cnt <= x"0000";
+ env_ena <= '1';
+ else
+ env_gen_cnt <= (env_gen_cnt + "1");
+ end if;
+ end if;
+ end if;
+ end process;
+
+ p_envelope_shape : process(env_reset, CLK)
+ variable is_bot : boolean;
+ variable is_bot_p1 : boolean;
+ variable is_top_m1 : boolean;
+ variable is_top : boolean;
+ begin
+ -- envelope shapes
+ -- C AtAlH
+ -- 0 0 x x \___
+ --
+ -- 0 1 x x /___
+ --
+ -- 1 0 0 0 \\\\
+ --
+ -- 1 0 0 1 \___
+ --
+ -- 1 0 1 0 \/\/
+ -- ___
+ -- 1 0 1 1 \
+ --
+ -- 1 1 0 0 ////
+ -- ___
+ -- 1 1 0 1 /
+ --
+ -- 1 1 1 0 /\/\
+ --
+ -- 1 1 1 1 /___
+ if (env_reset = '1') then
+ -- load initial state
+ if (reg(13)(2) = '0') then -- attack
+ env_vol <= "11111";
+ env_inc <= '0'; -- -1
+ else
+ env_vol <= "00000";
+ env_inc <= '1'; -- +1
+ end if;
+ env_hold <= '0';
+
+ elsif rising_edge(CLK) then
+ is_bot := (env_vol = "00000");
+ is_bot_p1 := (env_vol = "00001");
+ is_top_m1 := (env_vol = "11110");
+ is_top := (env_vol = "11111");
+
+ if (ENA = '1') then
+ if (env_ena = '1') then
+ if (env_hold = '0') then
+ if (env_inc = '1') then
+ env_vol <= (env_vol + "00001");
+ else
+ env_vol <= (env_vol + "11111");
+ end if;
+ end if;
+
+ -- envelope shape control.
+ if (reg(13)(3) = '0') then
+ if (env_inc = '0') then -- down
+ if is_bot_p1 then env_hold <= '1'; end if;
+ else
+ if is_top then env_hold <= '1'; end if;
+ end if;
+ else
+ if (reg(13)(0) = '1') then -- hold = 1
+ if (env_inc = '0') then -- down
+ if (reg(13)(1) = '1') then -- alt
+ if is_bot then env_hold <= '1'; end if;
+ else
+ if is_bot_p1 then env_hold <= '1'; end if;
+ end if;
+ else
+ if (reg(13)(1) = '1') then -- alt
+ if is_top then env_hold <= '1'; end if;
+ else
+ if is_top_m1 then env_hold <= '1'; end if;
+ end if;
+ end if;
+
+ elsif (reg(13)(1) = '1') then -- alternate
+ if (env_inc = '0') then -- down
+ if is_bot_p1 then env_hold <= '1'; end if;
+ if is_bot then env_hold <= '0'; env_inc <= '1'; end if;
+ else
+ if is_top_m1 then env_hold <= '1'; end if;
+ if is_top then env_hold <= '0'; env_inc <= '0'; end if;
+ end if;
+ end if;
+
+ end if;
+ end if;
+ end if;
+ end if;
+ end process;
+
+ p_chan_mixer : process(cnt_div, reg, tone_gen_op)
+ begin
+ tone_ena_l <= '1'; tone_src <= '1';
+ noise_ena_l <= '1'; chan_vol <= "00000";
+ case cnt_div(1 downto 0) is
+ when "00" =>
+ tone_ena_l <= reg(7)(0); tone_src <= tone_gen_op(1); chan_vol <= reg(8)(4 downto 0);
+ noise_ena_l <= reg(7)(3);
+ when "01" =>
+ tone_ena_l <= reg(7)(1); tone_src <= tone_gen_op(2); chan_vol <= reg(9)(4 downto 0);
+ noise_ena_l <= reg(7)(4);
+ when "10" =>
+ tone_ena_l <= reg(7)(2); tone_src <= tone_gen_op(3); chan_vol <= reg(10)(4 downto 0);
+ noise_ena_l <= reg(7)(5);
+ when "11" => null; -- tone gen outputs become valid on this clock
+ when others => null;
+ end case;
+ end process;
+
+ p_op_mixer : process
+ variable chan_mixed : std_logic;
+ variable chan_amp : std_logic_vector(4 downto 0);
+ begin
+ wait until rising_edge(CLK);
+ if (ENA = '1') then
+
+ chan_mixed := (tone_ena_l or tone_src) and (noise_ena_l or noise_gen_op);
+
+ chan_amp := (others => '0');
+ if (chan_mixed = '1') then
+ if (chan_vol(4) = '0') then
+ if (chan_vol(3 downto 0) = "0000") then -- nothing is easy ! make sure quiet is quiet
+ chan_amp := "00000";
+ else
+ chan_amp := chan_vol(3 downto 0) & '1'; -- make sure level 31 (env) = level 15 (tone)
+ end if;
+ else
+ chan_amp := env_vol(4 downto 0);
+ end if;
+ end if;
+
+ dac_amp <= x"00";
+ case chan_amp is
+ when "11111" => dac_amp <= x"FF";
+ when "11110" => dac_amp <= x"D9";
+ when "11101" => dac_amp <= x"BA";
+ when "11100" => dac_amp <= x"9F";
+ when "11011" => dac_amp <= x"88";
+ when "11010" => dac_amp <= x"74";
+ when "11001" => dac_amp <= x"63";
+ when "11000" => dac_amp <= x"54";
+ when "10111" => dac_amp <= x"48";
+ when "10110" => dac_amp <= x"3D";
+ when "10101" => dac_amp <= x"34";
+ when "10100" => dac_amp <= x"2C";
+ when "10011" => dac_amp <= x"25";
+ when "10010" => dac_amp <= x"1F";
+ when "10001" => dac_amp <= x"1A";
+ when "10000" => dac_amp <= x"16";
+ when "01111" => dac_amp <= x"13";
+ when "01110" => dac_amp <= x"10";
+ when "01101" => dac_amp <= x"0D";
+ when "01100" => dac_amp <= x"0B";
+ when "01011" => dac_amp <= x"09";
+ when "01010" => dac_amp <= x"08";
+ when "01001" => dac_amp <= x"07";
+ when "01000" => dac_amp <= x"06";
+ when "00111" => dac_amp <= x"05";
+ when "00110" => dac_amp <= x"04";
+ when "00101" => dac_amp <= x"03";
+ when "00100" => dac_amp <= x"03";
+ when "00011" => dac_amp <= x"02";
+ when "00010" => dac_amp <= x"02";
+ when "00001" => dac_amp <= x"01";
+ when "00000" => dac_amp <= x"00";
+ when others => null;
+ end case;
+
+ if (cnt_div(1 downto 0) = "10") then
+ audio_mix <= (others => '0');
+ audio_final <= audio_mix;
+ else
+ audio_mix <= audio_mix + ("00" & dac_amp);
+ end if;
+
+ if (RESET_L = '0') then
+ O_AUDIO(7 downto 0) <= "00000000";
+ else
+ if (audio_final(9) = '0') then
+ O_AUDIO(7 downto 0) <= audio_final(8 downto 1);
+ else -- clip
+ O_AUDIO(7 downto 0) <= x"FF";
+ end if;
+ end if;
+ end if;
+ end process;
+
+ p_io_ports : process(reg)
+ begin
+ O_IOA <= reg(14);
+
+ O_IOA_OE_L <= not reg(7)(6);
+ O_IOB <= reg(15);
+ O_IOB_OE_L <= not reg(7)(7);
+ end process;
+
+ p_io_ports_inreg : process
+ begin
+ wait until rising_edge(CLK);
+ ioa_inreg <= I_IOA;
+ iob_inreg <= I_IOB;
+ end process;
+end architecture RTL;