<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://oldwiki.cpcwiki.eu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dingo</id>
		<title>CPCWiki - THE Amstrad CPC encyclopedia! - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://oldwiki.cpcwiki.eu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dingo"/>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php/Special:Contributions/Dingo"/>
		<updated>2026-08-28T10:01:08Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Comparing_C64_to_CPC&amp;diff=97454</id>
		<title>Comparing C64 to CPC</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Comparing_C64_to_CPC&amp;diff=97454"/>
				<updated>2017-03-09T06:13:11Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: /* Comparing Amstrad Plus and C64 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Comparing CPC and C64 ==&lt;br /&gt;
&lt;br /&gt;
* The C64 was released in 1982, the CPC released in 1984.&lt;br /&gt;
&lt;br /&gt;
* The C64 was designed to be connected to a television (PAL: 50Hz, NTSC: 60Hz). The CPC was designed to be connected to an Amstrad GT65 green screen or CTM640/644 colour monitor.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a dedicated separate tape player. The CPC464 has a dedicated tape player built in, or for CPC664 and CPC6128 any tape player could be used with a suitable lead.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a palette of 16 colours. The Amstrad has a palette of 27 colours.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a 1.0MHz 6510 CPU (a 6502 based CPU design). The CPC has a 4.0Mhz [[Z80]] CPU.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a programmable raster interrupt. You can define the line at which the interrupt will be triggered and you can do this multiple times during a frame. The CPC has 6 &amp;quot;raster&amp;quot; interrupts at fixed positions through the 50Hz frame.&lt;br /&gt;
&lt;br /&gt;
* The C64 has 50Hz and 60Hz variants (for regions where PAL and NTSC are used). The CPC is 50Hz only.&lt;br /&gt;
&lt;br /&gt;
* The C64's color RAM, SID, VIC and other hardware can be made visible within  the 6510's memory space. Access to them is done using normal memory read/write operations. All access to the CPC's hardware is done using the Z80's special I/O instructions (IN/OUT).&lt;br /&gt;
&lt;br /&gt;
* The C64 has two resolutions: high and multi-colour. The pixel sizes are compareable to Amstrad's mode 1 and mode 0. The Amstrad has 3 display resolutions: low, medium and high. The high resolution on the CPC is higher than the C64's.&lt;br /&gt;
&lt;br /&gt;
* The C64 has character and bitmap based modes. The CPC modes are all bitmapped.&lt;br /&gt;
&lt;br /&gt;
* The C64 has pixel-by-pixel hardware scrolling in both the horizontal and vertical. The CPC has hardware scrolling. Using R5 of the CRTC and Rupture demo technique pixel-by-pixel scrolling in the vertical direction can be achieved. Using R3 of the CRTC 1 byte at a time in the horizontal is possible (which equates to 2 pixels in mode 0, 4 in mode 1, and 8 in mode 2).&lt;br /&gt;
&lt;br /&gt;
* The C64 has the SID [[ASIC]] sound chip. The CPC has the [[AY-3-8912]] [[COTS]] sound chip.&lt;br /&gt;
&lt;br /&gt;
* The C64 has the VIC [[ASIC]] video chip. The CPC has the [[COTS]] [[6845 CRTC]] and an [[ASIC]] Gate-Array.&lt;br /&gt;
&lt;br /&gt;
* The C64 tape loading is done through interrupts so is not intensive on the CPU. The CPC tape loading is very intensive on the CPU.&lt;br /&gt;
&lt;br /&gt;
* The C64 communicates with the disc drive through a wired serial connection. This means loading from disc is slow unless a special loader is used. The CPC's disc interface uses a [[COTS]] [[NEC765]] disc controller and uses byte-by-byte data transfer so is much quicker.&lt;br /&gt;
&lt;br /&gt;
* The C64 can easily play music while loading from tape or disc and do other graphical effects at the same time. The CPC can play music during tape or disc loading but it's more processor intensive and is restricted to no other effects when this is done.&lt;br /&gt;
&lt;br /&gt;
* The CPC can do overscan and any pixels can be shown here, the C64 can do it but it's more processor intensive and only sprites can be displayed in this area. (The C64 can open the lower and upper border with much less processor time, it takes much more time to open the side borders).&lt;br /&gt;
&lt;br /&gt;
==Palette comparison==&lt;br /&gt;
&lt;br /&gt;
Amstrad has a palette of 27 colours formed by mixing 0, &amp;quot;half&amp;quot; or &amp;quot;full&amp;quot; of R,G,B. The colours are vibrant.&lt;br /&gt;
The Amstrad's palette however is lacking in browns and greys. The colours themselves are consistent between machines.&lt;br /&gt;
&lt;br /&gt;
The C64 has a palette of 16 colours. The colours were chosen by the designers. It has a couple of greys and some browns.&lt;br /&gt;
The colours appear different on NTSC and PAL due to the way these transmit their colour signals, and in addition the colour is not always the same between machines.&lt;br /&gt;
&lt;br /&gt;
Both have a good range of colours that can produce great pictures.&lt;br /&gt;
&lt;br /&gt;
==Comparison of the SID and AY-3-8912==&lt;br /&gt;
&lt;br /&gt;
SID:&lt;br /&gt;
&lt;br /&gt;
* 3 tone channels&lt;br /&gt;
* 4 waveform types (sawtooth, triangle, pulse, noise), selectable per channel&lt;br /&gt;
* Ring-Modulation&lt;br /&gt;
* Programmable filter&lt;br /&gt;
* Programmable hardware envelopes on any channel&lt;br /&gt;
&lt;br /&gt;
AY:&lt;br /&gt;
&lt;br /&gt;
* 3 tone channels (square waveforms only)&lt;br /&gt;
* 1 noise channel&lt;br /&gt;
* 1 hardware envelope (with programmable waveform)&lt;br /&gt;
* the volume for each channel can be set or controlled by the hardware envelope.&lt;br /&gt;
* The mixer can be used to enable/disable tone output for each channel, enable noise or hardware envelope on a channel.&lt;br /&gt;
The SID sound chip is more powerful than the AY sound chip.&lt;br /&gt;
&lt;br /&gt;
== Comparing Amstrad Plus and C64 ==&lt;br /&gt;
&lt;br /&gt;
* The C64 was released in 1982, the Plus released in 1990.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a palette of 16 colours. The Plus has a palette of 4096 colours.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a 1.0MHz 6510 CPU (a 6502 based CPU with I/O ports based at location &amp;amp;0000 and &amp;amp;0001). The Plus has a 4.0Mhz Z80 CPU.&lt;br /&gt;
&lt;br /&gt;
* Both the C64 and Plus have pixel-by-pixel hardware scrolling both in the horizontal and vertical.&lt;br /&gt;
&lt;br /&gt;
* Both the C64 and Plus have programmable raster interrupts. e.g. you can set whichline of the display an interrupt can occur on.&lt;br /&gt;
&lt;br /&gt;
* Both have [[ASIC]] video chips: the C64 has the VIC video chip. The Plus has the AMS40489 ASIC.&lt;br /&gt;
&lt;br /&gt;
== Sprite Comparisons ==&lt;br /&gt;
&lt;br /&gt;
C64:&lt;br /&gt;
* The C64 has 8 hardware sprites.&lt;br /&gt;
* Each sprite can be one of two resolutions: high resolution or multicolour.&lt;br /&gt;
* The sprites use the same palette as the main screen. You can define 1 unique colour for each sprite. In multicolour mode 2 colours are shared between each sprite.&lt;br /&gt;
* The priority of sprite-to-sprite is fixed. Sprite 0 has a higher priority than sprite 8.&lt;br /&gt;
* The pixel size in high resolution is comparable to CPC's mode 1. Each pixel can be either  transparent OR a colour unique for each sprite. The pixel size in multicolour is comparable to CPC's mode 0 and each pixel can be transparent or 1 of the other 3 colours.&lt;br /&gt;
* Each sprite can be magnified in height.&lt;br /&gt;
* Sprite data is fetched from main RAM.&lt;br /&gt;
&lt;br /&gt;
Amstrad CPC:&lt;br /&gt;
&lt;br /&gt;
* Amstrad CPC doesn't have hardware sprites. All sprites must be drawn and erased using the CPU. It is therefore slower to draw sprites on the CPC.&lt;br /&gt;
&lt;br /&gt;
Amstrad Plus:&lt;br /&gt;
&lt;br /&gt;
(Plus features must be enabled first before sprites can be used)&lt;br /&gt;
&lt;br /&gt;
* The Plus has 16 hardware sprites.&lt;br /&gt;
* The sprites have their own seperate palette of 16 colours chosen out of 4096 colours.&lt;br /&gt;
* The priority of sprite-to-sprite is fixed. &lt;br /&gt;
* Each sprite can be unmagnified (mode 2 resolution), x2 (mode 1 resolution) or x4 (mode 0 resolution). They can also be magnified in height.&lt;br /&gt;
* Sprite data is stored in on-board ASIC RAM.&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=COTS&amp;diff=97453</id>
		<title>COTS</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=COTS&amp;diff=97453"/>
				<updated>2017-03-09T06:08:50Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''[[COTS]]''' stands for '''Commercial Off-The-Shelf''' and means any component that is freely available and/or well-documented.&lt;br /&gt;
&lt;br /&gt;
== IC ==&lt;br /&gt;
Especially in Integrated Circuit (IC) chips, it is the contrary to [[ASIC]], &amp;quot;Application-Specific IC&amp;quot; that are custom-built. [[COTS]] components normally are mass-produced in higher numbers and, therefore, cost-effective.&lt;br /&gt;
&lt;br /&gt;
As supply chains for chip manufacture were all out-sourced to South East Asia, where Red China uses massive government subsidies and workers live in barracks, many former chip manufacturers in the EU/USA went out of business as customers (like &amp;quot;Apple&amp;quot;) discontinued their domestic-built manufacture and relocated to Red China. This makes costs for creating ASIC chips much more prohibitive, reserving it to the biggest companies; many chip designers (ARM Assoc., ex-Acorn) now are &amp;quot;No-Fab&amp;quot;, meaning they just sell the designs and specifications to other companies.&lt;br /&gt;
&lt;br /&gt;
[[CPLD]] and [[FPGA]] re-programmable chips have alleviated this, so designers can use IPs or &amp;quot;Softcores&amp;quot;, Instruction set Processors, to attain ASIC capabilities; as reprogrammable chips now are available to the hobbyist market, discontinued chips can be simulated by those chips.&lt;br /&gt;
&lt;br /&gt;
== CPC ==&lt;br /&gt;
The Amstrad CPC does not make heavy use of ASICs; the [[MSX]] series, however, holds the pole-position as it is exclusively constructed using [[COTS]] component so many manufacturers could build them. Commodore, instead, acquired MOS technologies and relied heavily on ASIC chips for all their product lines apart from the IBM PC/XT/AT-compatibles.&lt;br /&gt;
&lt;br /&gt;
The CPC uses those [[COTS]] chips:&lt;br /&gt;
* Zilog [[Z80]] CPU&lt;br /&gt;
* General Instruments [[AY-3-8912]] [[PSG]], also built by Yamaha as the [[Ym2149]], as sound chip (also used in the [[MSX]] platform)&lt;br /&gt;
* Motorola [[6845 CRTC]]; however, the different manufactures use by Amstrad cause incompatibilities, and it was combined to a Gate Array [[ASIC]]. In later generations (cost-down CPC and CPD+), this chip was integrated into an Amstrad ASIC.&lt;br /&gt;
* NEC [[765 FDC]] as Floppy controller&lt;br /&gt;
* NEC [[8255 PPI chip]] as Programmable Peripheral Interface (PIO)&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=COTS&amp;diff=97452</id>
		<title>COTS</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=COTS&amp;diff=97452"/>
				<updated>2017-03-09T06:08:10Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: Created page with &amp;quot;'''COTS''' stands for '''Commercial Off-The-Shelf''' and means any component that is freely available and/or well-documented.  == IC == Especially in Integrated Circui...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''[[COTS]]''' stands for '''[[Commercial Off-The-Shelf]]''' and means any component that is freely available and/or well-documented.&lt;br /&gt;
&lt;br /&gt;
== IC ==&lt;br /&gt;
Especially in Integrated Circuit (IC) chips, it is the contrary to [[ASIC]], &amp;quot;Application-Specific IC&amp;quot; that are custom-built. [[COTS]] components normally are mass-produced in higher numbers and, therefore, cost-effective.&lt;br /&gt;
&lt;br /&gt;
As supply chains for chip manufacture were all out-sourced to South East Asia, where Red China uses massive government subsidies and workers live in barracks, many former chip manufacturers in the EU/USA went out of business as customers (like &amp;quot;Apple&amp;quot;) discontinued their domestic-built manufacture and relocated to Red China. This makes costs for creating ASIC chips much more prohibitive, reserving it to the biggest companies; many chip designers (ARM Assoc., ex-Acorn) now are &amp;quot;No-Fab&amp;quot;, meaning they just sell the designs and specifications to other companies.&lt;br /&gt;
&lt;br /&gt;
[[CPLD]] and [[FPGA]] re-programmable chips have alleviated this, so designers can use IPs or &amp;quot;Softcores&amp;quot;, Instruction set Processors, to attain ASIC capabilities; as reprogrammable chips now are available to the hobbyist market, discontinued chips can be simulated by those chips.&lt;br /&gt;
&lt;br /&gt;
== CPC ==&lt;br /&gt;
The Amstrad CPC does not make heavy use of ASICs; the [[MSX]] series, however, holds the pole-position as it is exclusively constructed using [[COTS]] component so many manufacturers could build them. Commodore, instead, acquired MOS technologies and relied heavily on ASIC chips for all their product lines apart from the IBM PC/XT/AT-compatibles.&lt;br /&gt;
&lt;br /&gt;
The CPC uses those [[COTS]] chips:&lt;br /&gt;
* Zilog [[Z80]] CPU&lt;br /&gt;
* General Instruments [[AY-3-8912]] [[PSG]], also built by Yamaha as the [[Ym2149]], as sound chip (also used in the [[MSX]] platform)&lt;br /&gt;
* Motorola [[6845 CRTC]]; however, the different manufactures use by Amstrad cause incompatibilities, and it was combined to a Gate Array [[ASIC]]. In later generations (cost-down CPC and CPD+), this chip was integrated into an Amstrad ASIC.&lt;br /&gt;
* NEC [[765 FDC]] as Floppy controller&lt;br /&gt;
* NEC [[8255 PPI chip]] as Programmable Peripheral Interface (PIO)&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=6845_CRTC&amp;diff=97451</id>
		<title>6845 CRTC</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=6845_CRTC&amp;diff=97451"/>
				<updated>2017-03-09T05:43:15Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: Redirected page to CRTC&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CRTC]]&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Comparing_C64_to_CPC&amp;diff=97450</id>
		<title>Comparing C64 to CPC</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Comparing_C64_to_CPC&amp;diff=97450"/>
				<updated>2017-03-09T05:20:18Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Comparing CPC and C64 ==&lt;br /&gt;
&lt;br /&gt;
* The C64 was released in 1982, the CPC released in 1984.&lt;br /&gt;
&lt;br /&gt;
* The C64 was designed to be connected to a television (PAL: 50Hz, NTSC: 60Hz). The CPC was designed to be connected to an Amstrad GT65 green screen or CTM640/644 colour monitor.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a dedicated separate tape player. The CPC464 has a dedicated tape player built in, or for CPC664 and CPC6128 any tape player could be used with a suitable lead.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a palette of 16 colours. The Amstrad has a palette of 27 colours.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a 1.0MHz 6510 CPU (a 6502 based CPU design). The CPC has a 4.0Mhz [[Z80]] CPU.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a programmable raster interrupt. You can define the line at which the interrupt will be triggered and you can do this multiple times during a frame. The CPC has 6 &amp;quot;raster&amp;quot; interrupts at fixed positions through the 50Hz frame.&lt;br /&gt;
&lt;br /&gt;
* The C64 has 50Hz and 60Hz variants (for regions where PAL and NTSC are used). The CPC is 50Hz only.&lt;br /&gt;
&lt;br /&gt;
* The C64's color RAM, SID, VIC and other hardware can be made visible within  the 6510's memory space. Access to them is done using normal memory read/write operations. All access to the CPC's hardware is done using the Z80's special I/O instructions (IN/OUT).&lt;br /&gt;
&lt;br /&gt;
* The C64 has two resolutions: high and multi-colour. The pixel sizes are compareable to Amstrad's mode 1 and mode 0. The Amstrad has 3 display resolutions: low, medium and high. The high resolution on the CPC is higher than the C64's.&lt;br /&gt;
&lt;br /&gt;
* The C64 has character and bitmap based modes. The CPC modes are all bitmapped.&lt;br /&gt;
&lt;br /&gt;
* The C64 has pixel-by-pixel hardware scrolling in both the horizontal and vertical. The CPC has hardware scrolling. Using R5 of the CRTC and Rupture demo technique pixel-by-pixel scrolling in the vertical direction can be achieved. Using R3 of the CRTC 1 byte at a time in the horizontal is possible (which equates to 2 pixels in mode 0, 4 in mode 1, and 8 in mode 2).&lt;br /&gt;
&lt;br /&gt;
* The C64 has the SID [[ASIC]] sound chip. The CPC has the [[AY-3-8912]] [[COTS]] sound chip.&lt;br /&gt;
&lt;br /&gt;
* The C64 has the VIC [[ASIC]] video chip. The CPC has the [[COTS]] [[6845 CRTC]] and an [[ASIC]] Gate-Array.&lt;br /&gt;
&lt;br /&gt;
* The C64 tape loading is done through interrupts so is not intensive on the CPU. The CPC tape loading is very intensive on the CPU.&lt;br /&gt;
&lt;br /&gt;
* The C64 communicates with the disc drive through a wired serial connection. This means loading from disc is slow unless a special loader is used. The CPC's disc interface uses a [[COTS]] [[NEC765]] disc controller and uses byte-by-byte data transfer so is much quicker.&lt;br /&gt;
&lt;br /&gt;
* The C64 can easily play music while loading from tape or disc and do other graphical effects at the same time. The CPC can play music during tape or disc loading but it's more processor intensive and is restricted to no other effects when this is done.&lt;br /&gt;
&lt;br /&gt;
* The CPC can do overscan and any pixels can be shown here, the C64 can do it but it's more processor intensive and only sprites can be displayed in this area. (The C64 can open the lower and upper border with much less processor time, it takes much more time to open the side borders).&lt;br /&gt;
&lt;br /&gt;
==Palette comparison==&lt;br /&gt;
&lt;br /&gt;
Amstrad has a palette of 27 colours formed by mixing 0, &amp;quot;half&amp;quot; or &amp;quot;full&amp;quot; of R,G,B. The colours are vibrant.&lt;br /&gt;
The Amstrad's palette however is lacking in browns and greys. The colours themselves are consistent between machines.&lt;br /&gt;
&lt;br /&gt;
The C64 has a palette of 16 colours. The colours were chosen by the designers. It has a couple of greys and some browns.&lt;br /&gt;
The colours appear different on NTSC and PAL due to the way these transmit their colour signals, and in addition the colour is not always the same between machines.&lt;br /&gt;
&lt;br /&gt;
Both have a good range of colours that can produce great pictures.&lt;br /&gt;
&lt;br /&gt;
==Comparison of the SID and AY-3-8912==&lt;br /&gt;
&lt;br /&gt;
SID:&lt;br /&gt;
&lt;br /&gt;
* 3 tone channels&lt;br /&gt;
* 4 waveform types (sawtooth, triangle, pulse, noise), selectable per channel&lt;br /&gt;
* Ring-Modulation&lt;br /&gt;
* Programmable filter&lt;br /&gt;
* Programmable hardware envelopes on any channel&lt;br /&gt;
&lt;br /&gt;
AY:&lt;br /&gt;
&lt;br /&gt;
* 3 tone channels (square waveforms only)&lt;br /&gt;
* 1 noise channel&lt;br /&gt;
* 1 hardware envelope (with programmable waveform)&lt;br /&gt;
* the volume for each channel can be set or controlled by the hardware envelope.&lt;br /&gt;
* The mixer can be used to enable/disable tone output for each channel, enable noise or hardware envelope on a channel.&lt;br /&gt;
The SID sound chip is more powerful than the AY sound chip.&lt;br /&gt;
&lt;br /&gt;
== Comparing Amstrad Plus and C64 ==&lt;br /&gt;
&lt;br /&gt;
* The C64 was released in 1982, the Plus released in 1990.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a palette of 16 colours. The Plus has a palette of 4096 colours.&lt;br /&gt;
&lt;br /&gt;
* The C64 has a 1.0MHz 6510 CPU (a 6502 based CPU with I/O ports based at location &amp;amp;0000 and &amp;amp;0001). The Plus has a 4.0Mhz Z80 CPU.&lt;br /&gt;
&lt;br /&gt;
* Both the C64 and Plus have pixel-by-pixel hardware scrolling both in the horizontal and vertical.&lt;br /&gt;
&lt;br /&gt;
* Both the C64 and Plus have programmable raster interrupts. e.g. you can set whichline of the display an interrupt can occur on.&lt;br /&gt;
&lt;br /&gt;
* Both have [[ASIC]] video chips: the C64 has the VIC video chip. The Plus has the ASIC.&lt;br /&gt;
&lt;br /&gt;
== Sprite Comparisons ==&lt;br /&gt;
&lt;br /&gt;
C64:&lt;br /&gt;
* The C64 has 8 hardware sprites.&lt;br /&gt;
* Each sprite can be one of two resolutions: high resolution or multicolour.&lt;br /&gt;
* The sprites use the same palette as the main screen. You can define 1 unique colour for each sprite. In multicolour mode 2 colours are shared between each sprite.&lt;br /&gt;
* The priority of sprite-to-sprite is fixed. Sprite 0 has a higher priority than sprite 8.&lt;br /&gt;
* The pixel size in high resolution is comparable to CPC's mode 1. Each pixel can be either  transparent OR a colour unique for each sprite. The pixel size in multicolour is comparable to CPC's mode 0 and each pixel can be transparent or 1 of the other 3 colours.&lt;br /&gt;
* Each sprite can be magnified in height.&lt;br /&gt;
* Sprite data is fetched from main RAM.&lt;br /&gt;
&lt;br /&gt;
Amstrad CPC:&lt;br /&gt;
&lt;br /&gt;
* Amstrad CPC doesn't have hardware sprites. All sprites must be drawn and erased using the CPU. It is therefore slower to draw sprites on the CPC.&lt;br /&gt;
&lt;br /&gt;
Amstrad Plus:&lt;br /&gt;
&lt;br /&gt;
(Plus features must be enabled first before sprites can be used)&lt;br /&gt;
&lt;br /&gt;
* The Plus has 16 hardware sprites.&lt;br /&gt;
* The sprites have their own seperate palette of 16 colours chosen out of 4096 colours.&lt;br /&gt;
* The priority of sprite-to-sprite is fixed. &lt;br /&gt;
* Each sprite can be unmagnified (mode 2 resolution), x2 (mode 1 resolution) or x4 (mode 0 resolution). They can also be magnified in height.&lt;br /&gt;
* Sprite data is stored in on-board ASIC RAM.&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=ASIC&amp;diff=97449</id>
		<title>ASIC</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=ASIC&amp;diff=97449"/>
				<updated>2017-03-09T04:47:07Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Application-Specific Integrated Circuit''' (ASIC)&lt;br /&gt;
&lt;br /&gt;
An '''ASIC''' is an especially manufactured custom chip designed to fulfill special functions.&lt;br /&gt;
&lt;br /&gt;
The main reason is to perform special tasks or combine different electronic components into a single Integrated Circuit (chip). This chip is not commonly available ([[COTS]]), but has to be ordered as a genuine part, prices dictated by the seller.&lt;br /&gt;
&lt;br /&gt;
After a seller goes out of business or stops supporting a product line, before IPs (Instruction set Processors) like [[CPLD]] or [[FPGA]], they essentially became unavailable. [[Commodore_64#ICs|Commodore]] used a plethora of ASICs in their machines (VIC, SID, PAULA,......); [[MSX]] or the [[IBM PC]]/XT/AT were the opposite in using only [[COTS]] components, making it easy for third parties to offer parts (or to re-build and repair the computers for as long as the COTS chip was still available or a backwards-compatible component exists).&lt;br /&gt;
&lt;br /&gt;
==Amstrad Custom chips==&lt;br /&gt;
&lt;br /&gt;
The Amstrad CPC used one custom chip: the video [[Gate Array]] (also called VGA – no connection with the Video PC standard).&lt;br /&gt;
&lt;br /&gt;
Latter [[CPC]] cost down series included a &amp;quot;pre-ASIC&amp;quot;-called ASIC to merge the VGA and the [[CRTC]].&lt;br /&gt;
&lt;br /&gt;
The Amstrad [[Plus]] included a &amp;quot;second heart&amp;quot; simply referred as the ASIC.&lt;br /&gt;
&lt;br /&gt;
 CPC+ ASIC's part number is 40489&lt;br /&gt;
&lt;br /&gt;
==Emulated chips==&lt;br /&gt;
&lt;br /&gt;
CPC+ ASIC emulates the following chips :&lt;br /&gt;
&lt;br /&gt;
* [[CRTC]] 6845&lt;br /&gt;
* [[Gate Array]]&lt;br /&gt;
* [[PAL16L8|PAL]] (128K RAM paging)&lt;br /&gt;
* [[8255 PPI]]&lt;br /&gt;
* Printer Port Data and Strobe&lt;br /&gt;
* Floppy Motor enable [[flip-flop]], Floppy Address decoding (FDC chip Select)&lt;br /&gt;
&lt;br /&gt;
==New features==&lt;br /&gt;
&lt;br /&gt;
This Amstrad Plus ASIC performs many additional features that the old CPC series couldn't: the &amp;quot;Plus Features&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Hardware Sprites.&lt;br /&gt;
*Soft scrolling (in complement with register 12&amp;amp;13 of the CRTC)&lt;br /&gt;
*Screen splitting &lt;br /&gt;
*Programmable and vectorised interrupts&lt;br /&gt;
*DMA sound channels&lt;br /&gt;
*Specific ROM switching&lt;br /&gt;
&lt;br /&gt;
== Known Flaws==&lt;br /&gt;
&lt;br /&gt;
The Amstrad Plus ASIC improved a lot of the old CPC's capability.&lt;br /&gt;
Yet this was a bit flawed.&lt;br /&gt;
&lt;br /&gt;
*Despite removing some tasks from the CPU ([[Z80]]), ASIC registers are mapped onto memory from #4000 to #7FFF range prior to other type of memory (RAM or ROM). That means this memory range is not accessible when ASIC registers are paged.&lt;br /&gt;
&lt;br /&gt;
*PPI emulation is not correct as the original 8255 does not need validation. On ASIC emulation, this validation is needed so some programs written for &amp;quot;old CPCs&amp;quot; will not be able to get keyboard state.&lt;br /&gt;
&lt;br /&gt;
*Z80 IM2 mode is bugged. In this mode, the Z80 I register gives the high word for vector table. ASIC gives the low word from IVR and the devices that generate interrupt (raster and DMAs channels). ASIC generates sometimes a bad values and the raster interrupt routine is called instead of DMA0 routine. The reasons of this bug are not known.&lt;br /&gt;
&lt;br /&gt;
*There is a conflict between programmable interrupts and some CRTC settings (line screen split). That will cause the RAM refresh to stop and the memory content will be quickly corrupted causing machine crash.&lt;br /&gt;
&lt;br /&gt;
*Reducing horizontal blanking could cause another internal conflict when using DMA lists. In the worst case, this conflict can cause irreversible damage to the ASIC.&lt;br /&gt;
&lt;br /&gt;
*Original CPC colors emulation is not correct.&lt;br /&gt;
&lt;br /&gt;
==Internal Links==&lt;br /&gt;
&lt;br /&gt;
*[[Arnold V specs]]&lt;br /&gt;
*[[Arnold V Specs Revised]]&lt;br /&gt;
*[[Programming:Unlocking ASIC]]&lt;br /&gt;
*[[B-ASIC]]&lt;br /&gt;
&lt;br /&gt;
*[[CRTC]]&lt;br /&gt;
*[[Gate Array]]&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Application-specific_integrated_circuit ASIC at Wikipedia]&lt;br /&gt;
General information on ASICs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://www.cpctech.org.uk/docs/arn5new.html Asic and Plus features at Unofficial CPC ressources 1.4]&lt;br /&gt;
*[http://www.cpctech.org.uk/docs/arnold5a.html Asic and Plus features at Unofficial CPC ressources 1.5]&lt;br /&gt;
*[http://www.cpctech.org.uk/docs/cpcplus.html Extra Plus Hardware Information]&lt;br /&gt;
&lt;br /&gt;
[[Category:CPC Plus|*]][[Category:Electronic Component]][[Category:Programming]][[Category:Datasheet]][[Category:Graphic]]&lt;br /&gt;
[[Category:Stub]][[Category:CPC Internal Components]]&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Commodore_64&amp;diff=97448</id>
		<title>Commodore 64</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Commodore_64&amp;diff=97448"/>
				<updated>2017-03-09T04:42:47Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: /* The C64 family */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Commodore64.jpg|320px|right]]&lt;br /&gt;
''This entry is copied from english Wikipedia''&lt;br /&gt;
&lt;br /&gt;
The '''Commodore 64''' is an 8-bit home computer introduced by Commodore International in January 1982. Volume production started in the spring of 1982, with machines being released on to the market in August at a price of US $595.Preceded by the Commodore VIC-20 and Commodore MAX Machine, the C64 features 64KB (65,536 bytes) of memory with sound and graphics performance that were superior to IBM-compatible computers of that time. It is commonly known as the '''C64''' or '''C=64''' (after the graphic logo on the case) and occasionally as the '''CBM 64''' (for '''C'''ommodore '''B'''usiness '''M'''achines), or '''VIC-64'''. It has also been affectionately nicknamed the &amp;quot;breadbox&amp;quot; and &amp;quot;bullnose&amp;quot; due to the shape and color of the first version of its casing.&lt;br /&gt;
&lt;br /&gt;
During the C64's lifetime, sales totaled between 12.5 and 17 million units, making it the best-selling single personal computer model of all time. For a substantial period of time (1983–1986), the C64 dominated the market with between 30% and 40% share and 2 million units sold per year, outselling the IBM PC clones, Apple Inc. computers, and Atari 8-bit family computers. Sam Tramiel, a former Atari president and the son of Commodore's founder, said in a 1989 interview &amp;quot;When I was at Commodore we were building 400,000 C64s a month for a couple of years.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Part of its success was because it was sold in retail stores instead of electronics stores. Commodore produced many of its parts in-house to control supplies and cost. It is sometimes compared to the Ford Model-T automobile for its role in bringing a new technology to middle-class households via creative mass-production.&lt;br /&gt;
&lt;br /&gt;
Approximately 10,000 commercial software titles were made for the Commodore 64 including development tools, office productivity applications, and games. Various C64 emulators allow anyone with a modern computer, or a compatible game console, to run these programs today. The machine is also credited with popularizing the computer demoscene|demo scene. The C64 is still used today by some computer hobbyists&lt;br /&gt;
&lt;br /&gt;
[[Image:C64 startup animiert.gif|260px|left|thumb|The Commodore 64 startup screen]]&lt;br /&gt;
&lt;br /&gt;
In Europe, the primary competitors to the C64 were the British-built [[ZX Spectrum|Sinclair ZX Spectrum]], BBC Micro computer and the [[CPC|Amstrad CPC 464]]. In the UK, the Spectrum had been released a few months ahead of the C64, and was selling for less than half the price. The Spectrum quickly became the market leader and Commodore had an uphill struggle against the Spectrum as it could not rely on undercutting the competition. The C64 debuted at £399 in early 1983, while the Spectrum cost £175. The C64 would later rival the Spectrum in popularity in the latter half of the 1980s, eventually outliving the Spectrum, which was discontinued in December 1990.&lt;br /&gt;
&lt;br /&gt;
Despite a few attempts by Commodore to discontinue the C64 in favor of other, higher priced machines, constant demand made its discontinuation a hard task. By 1988, Commodore was selling 1.5 million C64s worldwide. Although demand for the C64 dropped off in the US by 1990, it continued to be popular in the UK and other European countries. In the end, economics, not obsolescence, sealed the C64's fate. In March 1994, at CeBIT in Hanover|Hanover, Germany, Commodore announced that the C64 would be finally discontinued in 1995. Commodore stated that the C64's 1541 |disk drive was more expensive to manufacture than the C64 itself. Although Commodore had planned to discontinue the C64 by 1995, the company filed for bankruptcy a month later, in April 1994.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The C64 family===&lt;br /&gt;
[[Image:CommodoreMAX isolated.png|250px|Commodore MAX Machine (1982)|thumb]]&lt;br /&gt;
[[Image:Sx-64 build crop.jpg|150px|250px|Commodore SX-64 (1984)|thumb]]&lt;br /&gt;
[[Image:Commodore64GamesSystem.png|250px|Commodore 64 Games System &amp;quot;C64GS&amp;quot; (1990)|thumb]]&lt;br /&gt;
&lt;br /&gt;
1982: Commodore released the Commodore MAX Machine in Japan. It is called the Ultimax in the US, and VC-10 in Germany. The MAX was intended to be a game console with limited computing capability, and was based on a very cut-down version of the hardware family later used in the C64. The MAX was discontinued months after its introduction, because of poor sales in Japan.&lt;br /&gt;
&lt;br /&gt;
1983 saw Commodore attempt to compete with the Apple II's hold on the U.S. education market with the [[Educator 64]], essentially a C64 and monochrome monitor in a PET case. Schools preferred the all-in-one metal construction of the PET over the standard C64's separate components, which could be easily damaged, vandalized or stolen.&lt;br /&gt;
&lt;br /&gt;
In 1984, Commodore released the SX-64, a portable version of the C64. The SX-64 has the distinction of being the first ''full-color'' portable computer. The base unit featured a CRT and an integrated 1541 floppy disk drive. The SX-64 did not have a cassette connector.&lt;br /&gt;
&lt;br /&gt;
Commodore, specifically two designers; Fred Bowen and Bil Herd, were  determined to avoid the problems of the Plus/4, making sure that the eventual successors to the C64—the Commodore 128 and 128D computers (1985)—were as good as, and fully compatible with the original, as well as offering a host of improvements (such as a structured BASIC with graphics and sound commands, 80-column display capability, and full CP/M compatibility). The decision to make the Commodore 128 compatible with the C64 was made quietly by Bowen and Herd , software and hardware designers respectively, without the knowledge or approval by the management in the post Jack Tramiel era.  The designers were careful not to reveal their decision until the project was too far along to be challenged or changed and still make the impending Consumer Electronics Show (CES) show in Las Vegas.  Upon learning that the C128 was designed to be compatible with the C64, Commodore’s marketing department independently announced that the C128 would be 100% compatible with the C64, thereby raising the bar for C64 support.&lt;br /&gt;
&lt;br /&gt;
[[Image:C64c system.jpg|thumb|left|Commodore 64C with 1541-II floppy disk drive and 1084S monitor displaying television-compatible S-video]]&lt;br /&gt;
&lt;br /&gt;
In 1986, Commodore released the Commodore 64C (C64C) computer, which was functionally identical to the original, but whose exterior design was remodeled in the sleeker style of the Commodore 128 and other contemporary design trends. The modifications to the C64 line were more than skin deep in the C64C with new versions of the SID, VIC and I/O chips being deployed—with the core voltage reduced from 12 V to 9 V. In the United States, the C64C was often bundled with the third-party GEOS GUI-based operating system. The Commodore 1541 disk drive received a matching face-lift resulting in the 1541c. Later a smaller, sleeker 1541-II model was introduced along with the 800KB 3.5-inch capable 1581.&lt;br /&gt;
&lt;br /&gt;
In 1990, the C64 was re-released in the form of a game console, called the C64 Games System (C64GS). A simple modification to the C64C's motherboard was made to orient the cartridge connector to a vertical position. This allowed cartridges to be inserted from above. A modified ROM replaced the BASIC interpreter with a boot screen to inform the user to insert a cartridge. It was designed to rival the Nintendo Entertainment System and the Sega Master System but it suffered from very low sales compared to its rivals and it was another commercial failure for Commodore, and it was never released outside of Europe.&lt;br /&gt;
&lt;br /&gt;
In 1990, an advanced successor to the C64, the Commodore 65 (also known as the &amp;quot;C64DX&amp;quot;), was prototyped, but the project was canceled by Commodore's chairman Irving Gould in 1991. The C65's specifications were very good for an 8-bit computer. For example, it could display 256 colors on screen, while OCS based Amigas could only display 64 in HalfBrite mode (32 colors and half-bright transformations); the HAM mode on the Amiga allowed all 4096 colors of the 12 bit color system, but it was awkward to use and had restrictions on color combinations between adjacent pixels. Although no specific reason was given for the C65's cancellation, it would have competed in the marketplace with Commodore's lower end Amigas and the CDTV.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
[[Image:C64 IKPlus.png|thumb|Screenshot of ''International Karate +'']]&lt;br /&gt;
&lt;br /&gt;
At the time of its introduction, the C64's graphics and sound capabilities were rivaled only by the Atari 8-bit family. This was at a time when most IBM PCs and compatibles had text-only display adapter cards, monochrome monitors, and sound consisting of squeaks and beeps from the built-in tiny, low-quality speaker.&lt;br /&gt;
&lt;br /&gt;
The C64 is often credited with starting the computer subculture known as the demoscene. The C64 lost its top position among demo coders when the 16-bit Commodore Amiga and Atari ST were released in 1985, however it still remained a very popular platform for demo coding up to the early 90s&lt;br /&gt;
&lt;br /&gt;
It is still being actively used as a demo machine , especially for music (its sound chi] even being used in special sound cards for PCs, and the Elektron SidStation synthesizer). Unfortunately, the differences between PAL and NTSC C64s caused compatibility problems between U.S./Canadian C64s and those from most other countries. The vast majority of demos run only on PAL machines.&lt;br /&gt;
&lt;br /&gt;
Even though it was released in 1982, the C64 was still a strong competitor to the later consoles Nintendo Entertainment System and Sega Master System] thanks to its by-then established software base.&lt;br /&gt;
&lt;br /&gt;
During the 1980s, the Commodore 64 was used to run numerous Bulletin Board Systems using software packages such as Bizarre 64, Blue Board and Color 64, often with sysop-made modifications. These boards often were used to distribute cracked software.&lt;br /&gt;
&lt;br /&gt;
===BASIC===&lt;br /&gt;
[[Image:Simons Basic Splash Screen.gif|thumb|right|The Simons' BASIC start-up screen. Note the altered background and text colours (vs the ordinary C64 blue tones), and the 8KB reduction of available BASIC program memory due to the address space used by the cartridge.]]&lt;br /&gt;
&lt;br /&gt;
As was common for machines of the time, the C64 incorporated a ROM based version of the BASIC programming language. Commodore BASIC 2.0 was used instead of the more advanced BASIC 4.0 from the PET series, since its users were not expected to need the disk-oriented enhancements of BASIC 4.0. &amp;quot;The choice of BASIC 2.0 instead of 4.0 was made with some soul-searching, not just at random. The typical user of a C64 is not expected to need the direct disk commands as much as other extensions, and the amount of memory to be committed to BASIC was to be limited. We chose to leave expansion space for color and sound extensions instead of the disk features. As a result, you will have to handle the disk in the more cumbersome manner of the 'old days'.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The version of BASIC was limited and did not include commands for sound or graphics manipulation, instead users had to use the &amp;quot;POKE&amp;quot; command to access the graphics and sound chip registers directly. In order to provide extended commands including graphics and sound Commodore produced two different cartridge-based extension to BASIC 2.0 — Simons' BASIC and Super Expander 64.&lt;br /&gt;
&lt;br /&gt;
===Alternative operating systems===&lt;br /&gt;
A number of third party operating systems have been developed for the C64.&lt;br /&gt;
[[Image:GeOS Commodore 64.gif|thumb|GEOS for the Commodore 64]]&lt;br /&gt;
&lt;br /&gt;
As well as the original GEOS, two third-party GEOS-compatible operating systems have been written: Wheels and GEOS megapatch. Both of these require hardware upgrades to the original C64.&lt;br /&gt;
&lt;br /&gt;
Several other operating systems are or have been available, including WiNGS OS, the Unix-like LUnix, operated from a command-line, and the embedded systems OS Contiki, with full GUI. Other less well known OSes include ACE, Asterix, DOS/65 and GeckOS.&lt;br /&gt;
&lt;br /&gt;
A version of CP/M was released, but this required the addition of an external Z80 processor to the expansion bus, so is not considered a true C64 OS. Furthermore, the Z80 processor was underclocked to be compatible with the C64's memory bus, so performance was poor compared to other CP/M implementations. C64 CP/M and C128 CP/M both suffered a lack of software: although most commercial CP/M software would technically run on these systems, software media was incompatible between platforms. The low usage of CP/M on Commodores meant that software houses saw no need to invest in mastering versions for the Commodore filesystem. The Commodore 1571 disk drive was made compatible with a wide variety of disk formats to eliminate this weakness.&lt;br /&gt;
&lt;br /&gt;
===Networking software===&lt;br /&gt;
[[Image:Qlink-mainmenu.png|thumb|Quantum Link main menu]]&lt;br /&gt;
&lt;br /&gt;
Quantum Link (or Q-Link) was a U.S. and Canadian online service for Commodore 64 and 128 personal computers that operated from November 5, 1985 to November 1, 1994. It was operated by Quantum Computer Services of Vienna, Virginia, which in October 1991 changed its name to America Online, and continues to operate its AOL service for the IBM PC and Apple Macintosh today. Q-Link was a modified version of the PlayNET system, which Control Video Corporation (CVC, later renamed Quantum Computer Services) licensed.&lt;br /&gt;
&lt;br /&gt;
The Quantum Link networking service became America Online which became AOL-Time Warner which was then contracted to AOL.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
===CPU and memory===&lt;br /&gt;
&lt;br /&gt;
The C64 uses an 8-bit MOS Technology 6510 microprocessor. This is a close derivative of the 6502 with an added 6-bit internal I/O port that in the C64 is used for two purposes: to bank-switch the machine's ROM in and out of the processor's address space, and to operate the datasette tape recorder.&lt;br /&gt;
&lt;br /&gt;
The C64 has 64B of RAM, of which 38kB are available to built-in Commodore BASIC 2.0.&lt;br /&gt;
&lt;br /&gt;
===Graphics===&lt;br /&gt;
[[Image:Mayhem in monsterland mini.gif|right|frame|In-game sprite of Mayhem in Monsterland]]&lt;br /&gt;
&lt;br /&gt;
The graphics chip, VIC-II, features 16 colors, eight hardware sprites per scanline (enabling up to 112 sprites per PAL screen), scrolling capabilities, and two bitmap graphics modes. The standard text mode features 40 columns, like most Commodore PET models; the built in character encoding is not standard ASCII but PETSCII, an extended form of ASCII-1963.&lt;br /&gt;
&lt;br /&gt;
Most screen shots show borders around the screen, which is a feature of the VIC-II chip. By utilising interrupts to reset various hardware registers on precise timings it was possible to place graphics within the borders and thus utilise the full screen.&lt;br /&gt;
&lt;br /&gt;
===Sound===&lt;br /&gt;
&lt;br /&gt;
The sound chip, SID, has three channels, each with its own ADSR envelope generator, ring modulation and filter capabilities. It was designed by Bob Yannes, who would later co-found synthesizer company Ensoniq. Yannes criticized other contemporary computer sound chips as &amp;quot;primitive, obviously... designed by people who knew nothing about music&amp;quot;. Often the game music became a hit of its own among C64 users. Well-known composers and programmers of game music on the C64 are Rob Hubbard, David Whittaker, Chris Hulsbeck, Ben Daglish, Martin Galway among many others. Due to the chip's limitation to three channels, chords are played as arpeggios typically, coining the C64's characteristic lively sound. It was also possible to continuously update the master volume with sampled data to enable the playback of 4-bit digitized audio. As of 2008 it even became possible to play 4 channel 8 bit audio samples, 2 SID channels and still use filtering. &lt;br /&gt;
&lt;br /&gt;
There are two versions of the SID chip, the 6581 and the 8580. The MOS Technology 6581 was used in all of the original &amp;quot;breadbox&amp;quot; C64s, the early versions of the C64C and the Commodore 128. The 6581 was replaced with the MOS Technology 8580 in 1987. The 6581 sound quality is a little more crisp, and many Commodore 64 fans prefer its sound. The main difference between the 6581 and the 8580 is the supply voltage. The 6581 uses a 12 volt supply, the 8580, a nine volt supply. A modification can be made to use the 6581 in a C64C board (which uses the nine volt chip).&lt;br /&gt;
&lt;br /&gt;
The SID chip has a distinctive sound which retained a following of devotees to such a degree, that a number of audio enthusiasts and companies have designed SID-based products as add-ons for the C64, x86 PCs and standalone or MIDI music devices such as the Elektron SidStation. These devices use chips taken from excess stock, or removed from used computers.&lt;br /&gt;
&lt;br /&gt;
In 2007, Timbaland's extensive use of the SidStation led to the 2007 Timbaland plagiarism controversy around his tracks ''Block Party'' and ''Do It'' (written for Nelly Furtado).&lt;br /&gt;
&lt;br /&gt;
===Hardware revisions===&lt;br /&gt;
Cost reduction was the driving force behind the C64's motherboard revisions. Reducing manufacturing costs was vitally important to Commodore's survival during the price war and leaner years of the 16-bit era. The C64's original (NMOS based) motherboard would go through two major redesigns, (and numerous sub-revisions) exchanging positions of the VIC-II, SID and PLA chips. Initially, a large portion of the cost was eliminated by reducing the number of discrete components, such as diodes and resistors, which enabled the use of a smaller printed circuit board.&lt;br /&gt;
&lt;br /&gt;
[[Image:C64motherboard.jpg|thumb|right|350px|An early C64 motherboard (Rev A PAL 1982).]]&lt;br /&gt;
[[Image:C64Cmotherboard.jpg|thumb|right|350px|A C64C motherboard (&amp;quot;C64E&amp;quot; Rev B PAL 1992).]]&lt;br /&gt;
&lt;br /&gt;
====ICs====&lt;br /&gt;
The VIC-II was manufactured with 5 micrometre] NMOS technology and was clocked at either 17.73447MHz (PAL) or 14.31818MHz (NTSC). Internally, the clock was divided down to generate the dot clock (about 8MHz) and the two-phase system clocks (about 1MHz; the exact pixel and system clock speeds are slightly different between NTSC and PAL machines). At such high clock rates, the chip generated a lot of heat, forcing MOS Technology to use a ceramic [[Dual in-line package|DIL package]] (called a &amp;quot;CERDIP&amp;quot;). The ceramic package was more expensive, but it dissipated heat more effectively than plastic.&lt;br /&gt;
&lt;br /&gt;
After a redesign in 1983, the VIC-II was encased in a plastic Dual Inline Package, which reduced costs substantially, but it did not totally eliminate the heat problem. Without a ceramic package, the VIC-II required the use of a heat sink. To avoid extra cost, the metal RF shielding doubled as the heat sink for the VIC, although not all units shipped with this type of shielding. Most C64s in Europe shipped with a cardboard RF shield, coated with a layer of metal foil. The effectiveness of the cardboard was highly questionable, and worse still it acted as an insulator, blocking airflow which trapped heat generated by the SID, VIC, and PLA chips.&lt;br /&gt;
&lt;br /&gt;
The SID was manufactured using NMOS at 7 and in some areas 6 micrometers. The prototype SID and some very early production models featured a ceramic Dual Inline Package, but unlike the VIC-II, these are extremely rare as the SID was encased in plastic when production started in early 1982.&lt;br /&gt;
&lt;br /&gt;
====Motherboard====&lt;br /&gt;
In 1986, Commodore released the last revision to the classic C64 motherboard. It was otherwise identical to the 1984 design, except for the two 64 kilobit * 4 bit DRAM chips that replaced the original eight 64 kilobit * 1 bit ICs.&lt;br /&gt;
&lt;br /&gt;
After the release of the C64C, MOS Technology began to reconfigure the C64's chipset to use HMOS production technology. The main benefit of using HMOS was that it required less voltage to drive the IC, which consequently generates less heat. This enhanced the overall reliability of the SID and VIC-II. The new chipset was re-numbered to 85xx in order to reflect the change to HMOS.&lt;br /&gt;
&lt;br /&gt;
In 1987 Commodore released C64Cs with a totally redesigned motherboard commonly known as a &amp;quot;short board&amp;quot;. The new board used the new HMOS chipset, featuring a new 64-pin PLA chip. The new &amp;quot;SuperPLA&amp;quot;, as it was dubbed, integrated many discrete components and TTL chips. In the last revision of the C64C motherboard, the 2114 color RAM was integrated into the SuperPLA.&lt;br /&gt;
&lt;br /&gt;
===Power supply===&lt;br /&gt;
The C64 used an external power supply. This saved space within the computer's case. The 1541-II and 1581 disk drives, along with various third-party clones, also came with their own external power supply &amp;quot;bricks&amp;quot;. These power supplies were notorious for failing over time. Many lasted less than two years and had to be replaced. Commodore later changed the design, however the new version was also prone to failure. It has been speculated that these supplies failed due to voltage regulator overheating. They were entirely encapsulated within an epoxy resin, a poor conductor of heat and impossible to repair. As of 2010, many Commodore 64 owners use home-made power supplies, often using separate 5 volt DC and 9 volt AC power supplies, wired to a common plug that attaches to the Commodore 64.&lt;br /&gt;
&lt;br /&gt;
===Specifications ===&lt;br /&gt;
====Internal hardware====&lt;br /&gt;
*Microprocessor CPU:&lt;br /&gt;
**MOS Technology 6510|MOS Technology 6510/8500 (the 6510/8500 being a modified 6502 with an integrated 6-bit I/O port)&lt;br /&gt;
**Clock speed: 0.985 MHz (PAL) or 1.023 MHz (NTSC)&lt;br /&gt;
*Video: MOS Technology VIC-II 6567/8562 (NTSC), 6569/8565 (PAL)&lt;br /&gt;
**16 colors&lt;br /&gt;
**Text mode: 40*25 characters; 256 user-defined chars (8*8 pixels, or 4*8 in multicolor mode); 4-bit color RAM defines foreground color&lt;br /&gt;
**Bitmap modes: 320*200 (2 unique colors in each 8*8 pixel block), 160*200 (3 unique colors + 1 common color in each 4*8 block)&lt;br /&gt;
**8 hardware sprites of 24*21 pixels (12*21 in multicolor mode)&lt;br /&gt;
**Smooth scrolling, raster interrupts&lt;br /&gt;
*Sound: MOS Technology 6581/8580 SID&lt;br /&gt;
**3-channel synthesizer with programmable ADSR envelope&lt;br /&gt;
**8 octaves&lt;br /&gt;
**4 waveforms per audio channel: triangle, sawtooth, variable pulse, noise&lt;br /&gt;
**Oscillator synchronization, ring modulation&lt;br /&gt;
**Programmable filter: high pass, low pass, band pass, notch filter&lt;br /&gt;
*Input/Output: Two 6526 Complex Interface Adapters&lt;br /&gt;
**16 bit parallel I/O&lt;br /&gt;
**8 bit serial I/O&lt;br /&gt;
**24-hours (AM/PM) Time of Day clock (TOD), with programmable alarm clock&lt;br /&gt;
**16 bit interval timers&lt;br /&gt;
*RAM:&lt;br /&gt;
**64kB, of which 38kB (minus 1 byte) were available for BASIC programs&lt;br /&gt;
**512 bytes color RAM (memory allocated for screen color data storage) &lt;br /&gt;
**Expandable to 320kB with Commodore 1764 256kB RAM Expansion Unit (REU); although only 64kB directly accessible; REU mostly intended for GEOS. REUs of 128kB and 512kB, originally designed for the C128, were also available, but required the user to buy a stronger power supply from some third party supplier; with the 1764 this was included. Creative Micro Designs also produced a 2MB REU for the C64 and C128, called the 1750 XL. The technology actually supported up to 16MB, but 2MB was the biggest one officially made. Expansions of up to 16MB were also possible via the CMD SuperCPU.&lt;br /&gt;
*ROM:&lt;br /&gt;
**20kB (9kB BASIC 2.0; 7kB Kernel; 4kB character generator, providing two 2kB character sets)&lt;br /&gt;
&lt;br /&gt;
====I/O ports and power supply====&lt;br /&gt;
[[Image:C64 Interfaces.jpg|thumb|right|300px|Commodore 64 ports (from left: Cartridge, RF-adj, RF, A/V, 488, Tape, User + Joy1, Joy2, Power)]]&lt;br /&gt;
&lt;br /&gt;
*I/O ports:&lt;br /&gt;
**Cartridge expansion slot (slot for edge connector with 6510 CPU address/data bus lines and control signals, as well as GND and voltage pins; used for program modules and memory expansions, among others)&lt;br /&gt;
**Integrated RF modulator antenna output via a RCA connector. The used channel could be adjusted from number 36 with the potentiometer to the left.&lt;br /&gt;
**8-pin DIN connector containing composite video output, separate Y/C outputs and sound input/output. Beware that this is the 270° (horseshoe) version of the plug, not the 360° circular version. Also note that some early C64 units use a 5-pin DIN connector that carries composite video and luminance signals, but lacks a chroma signal.&lt;br /&gt;
**Serial bus (serial version of IEEE-488, 6-pin DIN plug) for CBM printers and disk drives&lt;br /&gt;
**PET-type Commodore Datassette 300 baud tape interface (edge connector with digital cassette motor/read/write/key-sense signals, Ground and +5V DC lines. The cassette motor is controlled by a +5V DC signal from the 6502 CPU. The 9 V AC input is transformed into unregulated 6.36 V DC which is used to actually power the cassette motor.&lt;br /&gt;
**User port (edge connector with TTL-level signals, for modems etc.; byte-parallel signals which can be used to drive third-party parallel printers, among other things, 17 logic signals, 7 Ground and voltage pins, including 9V AC)&lt;br /&gt;
**2 * screwless DE9M game controller ports (compatible with Atari 2600 controllers), each supporting five digital inputs and two analog inputs. Available peripherals included digital joysticks, analog paddles, a light pen, the Commodore 1351 mouse, and the unique KoalaPad.&lt;br /&gt;
&lt;br /&gt;
*Power supply:&lt;br /&gt;
**5V DC and 9VAC from an external &amp;quot;power brick&amp;quot;, attached to a 7-pin female DIN-connector on the computer&lt;br /&gt;
&lt;br /&gt;
====Comparison====&lt;br /&gt;
*[[Comparing C64 to CPC]]&lt;br /&gt;
&lt;br /&gt;
====Peripherals====&lt;br /&gt;
&amp;lt;gallery widths=&amp;quot;160px&amp;quot; heights=&amp;quot;120px&amp;quot; perrow=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
Image:Commodore 1541 front cropped.jpg|Commodore 1541 Floppy Drive, 1st model.&lt;br /&gt;
Image:Commodore 1541 white.jpg|Commodore 1541C Floppy Drive, 2nd model.&lt;br /&gt;
Image:C64-IMG 5372.jpg|Commodore 1541-II Floppy Drive, 3rd model.&lt;br /&gt;
Image:Commodore-Datassette.jpg|Commodore 1530 Datasette&lt;br /&gt;
Image:Commodore Matrixdrucker MPS-802.jpg|Commodore MPS-802 Dot-matrix Printer&lt;br /&gt;
Image:CommodoreVICModem.jpg|Commodore VIC-Modem&lt;br /&gt;
Image:Commodore blockomaus.jpg|Commodore Mouse&lt;br /&gt;
Image:Commodore_1702_(made_by_JVC)_front.jpg|Commodore 1702 video monitor&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Non CPC Computers]]&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=ASIC&amp;diff=97447</id>
		<title>ASIC</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=ASIC&amp;diff=97447"/>
				<updated>2017-03-09T04:35:22Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: a bit expanded. Q: Is there a software or HDL emulation of the &amp;quot;Amstrad ASIC&amp;quot; and the &amp;quot;VGA&amp;quot;?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Application-Specific Integrated Circuit''' (ASIC)&lt;br /&gt;
&lt;br /&gt;
An '''ASIC''' is an especially manufactured custom chip designed to fulfill special functions.&lt;br /&gt;
&lt;br /&gt;
The main reason is to perform special tasks or combine different electronic components into a single Integrated Circuit (chip). This chip is not commonly available ([[COTS]]), but has to be ordered as a genuine part, prices dictated by the seller.&lt;br /&gt;
&lt;br /&gt;
After a seller goes out of business or stops supporting a product line, before IPs (Instruction set Processors) like [[CPLD]] or [[FPGA]], they essentially became unavailable. Commodore used a plethora of ASICs in their machines (VIC, SID, PAULA,......); [[MSX]] or the [[IBM PC]]/XT/AT were the opposite in using only [[COTS]] components, making it easy for third parties to offer parts (or to re-build and repair the computers for as long as the COTS chip was still available or a backwards-compatible component exists).&lt;br /&gt;
&lt;br /&gt;
==Amstrad Custom chips==&lt;br /&gt;
&lt;br /&gt;
The Amstrad CPC used one custom chip: the video [[Gate Array]] (also called VGA – no connection with the Video PC standard).&lt;br /&gt;
&lt;br /&gt;
Latter [[CPC]] cost down series included a &amp;quot;pre-ASIC&amp;quot;-called ASIC to merge the VGA and the [[CRTC]].&lt;br /&gt;
&lt;br /&gt;
The Amstrad [[Plus]] included a &amp;quot;second heart&amp;quot; simply referred as the ASIC.&lt;br /&gt;
&lt;br /&gt;
 CPC+ ASIC's part number is 40489&lt;br /&gt;
&lt;br /&gt;
==Emulated chips==&lt;br /&gt;
&lt;br /&gt;
CPC+ ASIC emulates the following chips :&lt;br /&gt;
&lt;br /&gt;
* [[CRTC]] 6845&lt;br /&gt;
* [[Gate Array]]&lt;br /&gt;
* [[PAL16L8|PAL]] (128K RAM paging)&lt;br /&gt;
* [[8255 PPI]]&lt;br /&gt;
* Printer Port Data and Strobe&lt;br /&gt;
* Floppy Motor enable [[flip-flop]], Floppy Address decoding (FDC chip Select)&lt;br /&gt;
&lt;br /&gt;
==New features==&lt;br /&gt;
&lt;br /&gt;
This Amstrad Plus ASIC performs many additional features that the old CPC series couldn't: the &amp;quot;Plus Features&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Hardware Sprites.&lt;br /&gt;
*Soft scrolling (in complement with register 12&amp;amp;13 of the CRTC)&lt;br /&gt;
*Screen splitting &lt;br /&gt;
*Programmable and vectorised interrupts&lt;br /&gt;
*DMA sound channels&lt;br /&gt;
*Specific ROM switching&lt;br /&gt;
&lt;br /&gt;
== Known Flaws==&lt;br /&gt;
&lt;br /&gt;
The Amstrad Plus ASIC improved a lot of the old CPC's capability.&lt;br /&gt;
Yet this was a bit flawed.&lt;br /&gt;
&lt;br /&gt;
*Despite removing some tasks from the CPU ([[Z80]]), ASIC registers are mapped onto memory from #4000 to #7FFF range prior to other type of memory (RAM or ROM). That means this memory range is not accessible when ASIC registers are paged.&lt;br /&gt;
&lt;br /&gt;
*PPI emulation is not correct as the original 8255 does not need validation. On ASIC emulation, this validation is needed so some programs written for &amp;quot;old CPCs&amp;quot; will not be able to get keyboard state.&lt;br /&gt;
&lt;br /&gt;
*Z80 IM2 mode is bugged. In this mode, the Z80 I register gives the high word for vector table. ASIC gives the low word from IVR and the devices that generate interrupt (raster and DMAs channels). ASIC generates sometimes a bad values and the raster interrupt routine is called instead of DMA0 routine. The reasons of this bug are not known.&lt;br /&gt;
&lt;br /&gt;
*There is a conflict between programmable interrupts and some CRTC settings (line screen split). That will cause the RAM refresh to stop and the memory content will be quickly corrupted causing machine crash.&lt;br /&gt;
&lt;br /&gt;
*Reducing horizontal blanking could cause another internal conflict when using DMA lists. In the worst case, this conflict can cause irreversible damage to the ASIC.&lt;br /&gt;
&lt;br /&gt;
*Original CPC colors emulation is not correct.&lt;br /&gt;
&lt;br /&gt;
==Internal Links==&lt;br /&gt;
&lt;br /&gt;
*[[Arnold V specs]]&lt;br /&gt;
*[[Arnold V Specs Revised]]&lt;br /&gt;
*[[Programming:Unlocking ASIC]]&lt;br /&gt;
*[[B-ASIC]]&lt;br /&gt;
&lt;br /&gt;
*[[CRTC]]&lt;br /&gt;
*[[Gate Array]]&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Application-specific_integrated_circuit ASIC at Wikipedia]&lt;br /&gt;
General information on ASICs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://www.cpctech.org.uk/docs/arn5new.html Asic and Plus features at Unofficial CPC ressources 1.4]&lt;br /&gt;
*[http://www.cpctech.org.uk/docs/arnold5a.html Asic and Plus features at Unofficial CPC ressources 1.5]&lt;br /&gt;
*[http://www.cpctech.org.uk/docs/cpcplus.html Extra Plus Hardware Information]&lt;br /&gt;
&lt;br /&gt;
[[Category:CPC Plus|*]][[Category:Electronic Component]][[Category:Programming]][[Category:Datasheet]][[Category:Graphic]]&lt;br /&gt;
[[Category:Stub]][[Category:CPC Internal Components]]&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=FPGA&amp;diff=97446</id>
		<title>FPGA</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=FPGA&amp;diff=97446"/>
				<updated>2017-03-09T04:25:47Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: expanded a bit.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FPGA (field-programmable gate array)&lt;br /&gt;
&lt;br /&gt;
This is a reprogrammable [[COTS]] Instruction set Processor (IP). It consists of a re-programmable (&amp;quot;FP&amp;quot;) Gate Array (GA), i.e. a [[FET]] (Field-Effect Transistor) array where the transistors can be set by the FET Gate to &amp;quot;conduct&amp;quot; or &amp;quot;resist&amp;quot;. This can flexibly simulate many different logical ICs.&lt;br /&gt;
&lt;br /&gt;
== FPGA basics ==&lt;br /&gt;
You know what a &amp;quot;truth table&amp;quot; is ? Here a example :&amp;lt;br /&amp;gt;&lt;br /&gt;
'''XOR''' truth table :&lt;br /&gt;
 A B | C&lt;br /&gt;
 0 0 | 0&lt;br /&gt;
 0 1 | 1&lt;br /&gt;
 1 0 | 1&lt;br /&gt;
 1 1 | 0&lt;br /&gt;
&lt;br /&gt;
In a truth table you have got eg. 2 input wires, and 1 output wires.&lt;br /&gt;
&lt;br /&gt;
A FPGA is programmed by a LUT (Look-Up Table) that has to be loaded into volatile memory at power-up. In a FPGA LUT you have got 10,000,000,000,000,000 input/output wires.&lt;br /&gt;
&lt;br /&gt;
As it is complex to feed the table values, special languages (HDL - Hardware Description Language) are used to feed them : [[VHDL]] (and -blech!!!- verilog)&lt;br /&gt;
&lt;br /&gt;
The Gate Array (GA) in Amstrad graphics is an [[ASIC]].&lt;br /&gt;
&lt;br /&gt;
== CPLD ==&lt;br /&gt;
[[CPLD]] are re-programmable IPs that are faster and non-volatile; however, they are not as versatile as FPGAs, so FPGAs offer more possibilities closed to CPLDs. They consist of AND- and OR-matrices that can be connected to a signal or the inverted signal (NOT); those [[minterm]]s can construct all other logical equasions (to the boundaries of the chip).&lt;br /&gt;
&lt;br /&gt;
Common CPLDs are made by Atheros (now part of Intel) and Altera.&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=VHDL&amp;diff=97445</id>
		<title>VHDL</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=VHDL&amp;diff=97445"/>
				<updated>2017-03-09T03:52:58Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: Expanded; Ada explained (perhaps better to move it into an article of its own); CPLD; Standards&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VHDL (very high-level hardware description language)&lt;br /&gt;
&lt;br /&gt;
This is an electronic language having electronic behaviour. You can implement what you want numerical electronic schematics (you can also draw them and translate then into VHDL)&lt;br /&gt;
&lt;br /&gt;
Its syntax does looks like and is derived from the Ada language family. It differs from computer langage as its first instruction does generaly look like :&lt;br /&gt;
 if rising_edge(clock) then&lt;br /&gt;
  output_wire &amp;lt;= input_wire xor 1;&lt;br /&gt;
 end if;&lt;br /&gt;
&lt;br /&gt;
All instructions are run at the same time/edge. Next values being computed from previous values. The time an output value takes to be affected by an input value is called &amp;quot;delta-time&amp;quot;. Like in &amp;quot;This cannot run !, you forgotten that it takes 4 delta-time to cross this 4 components !!!&amp;quot;. There is a difference between delta-time and number of clock edges, as certain components are using rising_edge and others falling_edge. delta-time is just about vocabulary speaking, it is the time between the action is launched and then takes effect outside. In order to understood this concept, better is to play using &amp;quot;testbench&amp;quot; programs, showing sequence diagrams.&lt;br /&gt;
&lt;br /&gt;
You can also have local registered values, using affectation operator &amp;quot;:=&amp;quot;, without delta-time (at once) :&lt;br /&gt;
 output_wire_mem := input_wire xor 1;&lt;br /&gt;
 output_wire_mem := output_wire_mem xor 1;&lt;br /&gt;
 output_wire &amp;lt;= output_wire_mem;&lt;br /&gt;
&lt;br /&gt;
== Application ==&lt;br /&gt;
VHDL can be synthetised (compiled) into IP (Instruction set Processor) chips like [[CPLD]] and [[FPGA]] chips, apart from generating a [[netlist]] for [[ASIC]] building. &lt;br /&gt;
&lt;br /&gt;
Two families of [[FPGA]] chips exists : Xilinx (Diligent starter-kits are really fun and instructive) and Altera (cheaper). You cannot really compare them, units are not the same between them...&lt;br /&gt;
&lt;br /&gt;
[[CPLD]]s are faster and do not need to re-load their instructions at power-up, but do not offer the flexibility of FPGAs. An Intel 386 has been simulated on a CPLD (Complex Programmable Logic Device). Two common families are Atheros (now Intel) and Altera.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Characteristics ==&lt;br /&gt;
VHDL is more strict than Verilog, Verilog is more C language like. Verilog seems more used in America and VHDL in Europe. But you can plug their components together using drawn schematics.&lt;br /&gt;
&lt;br /&gt;
In order to use the same language concepts in Hardware Description (HDL - Hardware Description Language) and Software development, SystemC was also developed and standardised. There are, however, boni in using VHDL and Ada as development languages from the same family.&lt;br /&gt;
&lt;br /&gt;
Alas, VHDL to-date lacks exception handling, apart from the Assert-pragma.&lt;br /&gt;
&lt;br /&gt;
=== Standardisation ===&lt;br /&gt;
VHDL is standardised in IEEE Std 1076 and its substandards. Parts fo them are also part of IEC standard 61691 &amp;quot;Behavioural Languages&amp;quot;:&lt;br /&gt;
* IEEE Std 1076.1 VHDL Language Reference Manual = IEC 61691-1-1&lt;br /&gt;
* IEEE Std 1076.2 VHDL Mathematical Packages = IEC 61691-3-2&lt;br /&gt;
* IEEE Std 1076.3 VHDL Synthesis Packages = IEC 61691-3-3&lt;br /&gt;
* IEEE Std 1076.4 VITAL ASIC = IEC 61691-5&lt;br /&gt;
* IEEE Std 1076.5 VHDL Register Transfer Level Synthesis&lt;br /&gt;
* IEEE Std 1076.6 VHDL Analog and Mixed-Signal Extensions = IEC 61691-6&lt;br /&gt;
&lt;br /&gt;
IEC 61691 is a standard for Behavioural Languages (Hardware Design Languages):&lt;br /&gt;
* IEC 61691-1-1 VHDL LRM = IEEE Std 1076.1&lt;br /&gt;
* IEC 61691-2 VHDL Multilogic System for Model Interoperability&lt;br /&gt;
* IEC 61691-3-2: Mathematical Operation in VHDL&lt;br /&gt;
* IEC 61691-3-3: Synthesis in VHDL&lt;br /&gt;
* IEC 61691-4 Verilog HDL&lt;br /&gt;
* IEC 61691-5 VITAL ASIC = IEEE Std 1076.4&lt;br /&gt;
* IEC 61691-6 VHDL Analog and Mixed-Signal Extensions = IEEE Std 1076.6&lt;br /&gt;
* IEC 61691-7 SystemC LRM&lt;br /&gt;
&lt;br /&gt;
=== Ada language family ===&lt;br /&gt;
Ada (iterations Ada83, Ada95, Ada2005 and Ada2012) offers strict typing and is a higher-level language much like PL/I and [[PL/M]] (the HLL used for programming [[CP/M]]); requirements to strictly adhere to standards kept it from forking into countless libraries and frameworks like C and Java. Exception handling (alas, NOT yet implemented in VHDL) and the ASSERT pragma (standard since Ada2005, implemented into VHDL) offer safety constraints. It came out of a 'ricain Department of Defence (DoD) concourse as the winner in 1976 and is an open standard from the start.&lt;br /&gt;
&lt;br /&gt;
Ada became notorious after the ARIANE-5 self-destructed on her maiden voyage; however, it was human failure on the part of a programmer. After it was proven that variable type constraints could not be exceeded by the ARIANE-4, constraint checks were switched off to make the code faster. ARIADNE-5 however, designed as a carrier platform for the cancelled HERMES space shuttle project, was considerably heavier and values DID overflow; however, the programmers re-used ARIADNE-4 code without switching constraint checks (which would have prevented the accident) back on.&lt;br /&gt;
&lt;br /&gt;
The US En Route Air Traffic Control system however in 2009 was completed using Ada2005 under budget and ahead of schedule [http://www.iaeng.org/publication/IMECS2009/IMECS2009_pp1095-1099.pdf due to Ada05's engineering capabilities].&lt;br /&gt;
&lt;br /&gt;
Detrimental to Ada's widespread use in the FLOSS (Free/Libre Open Source Software) community are its &amp;quot;evilness&amp;quot; as a DoD standard and its &amp;quot;differentness&amp;quot; as a Wirthean language (akin to educational PASCAL) for C/C++-programmers; however, [http://www.cs.uni.edu/~mccormic/4740/guide-c2ada.pdf these differences DO address common C/C++ design flaws, so it can be considered an &amp;quot;acquired taste&amp;quot;]. Strongly typed, it tends to display faults (&amp;quot;hidden&amp;quot; points of failure) more often into direct errors (the compiler stops) rather than to allow them to manifest themselves as failures (system stops working suddenly).&lt;br /&gt;
&lt;br /&gt;
Apart from ARIANE rockets and Air Traffic Control systems, it is also used in airplanes, medical technology, the PANAVIA Tornado, the Eurofighter Typhoon, Eurocopter Tigre and NH-90 systems, and about any mission-critical system a simple reboot on failure is no option. Since Ada95, there are Object Oriented addition to Ada. A superset of Ada called SPARK that can be compiled in normal Ada compilers (the extra instructions are inside comments) is for highly verified code; AdaDoc in Ada2012 offers a JavaDoc-like Documentation generation system.&lt;br /&gt;
&lt;br /&gt;
The [http://www.kuhmann.com/Cromemco/Cromemco%20CS250.htm Cromemco CR-250 Motorola 68000 S-100] machine was in widespread use as USAF Mission Support System (1986-1990), so a CP/M Ada83 compiler should be available.&lt;br /&gt;
&lt;br /&gt;
* [http://www.makewithada.org/ Make with Ada programming competition]&lt;br /&gt;
* [http://adahome.com/ AdaHome - Home of the Brave Ada Programmers]&lt;br /&gt;
* [http://ada-europe.org Ada Europe]&lt;br /&gt;
== Tools ==&lt;br /&gt;
IDE :&lt;br /&gt;
* Xilinx webpack&lt;br /&gt;
* Quartus web edition (Altera)&lt;br /&gt;
&lt;br /&gt;
Development starter-kit :&lt;br /&gt;
* [http://store.digilentinc.com/ Diligent] (instructive - really nice for learning)&lt;br /&gt;
* [http://www.lextronic.fr/ Lextronic] - fr&lt;br /&gt;
&lt;br /&gt;
Final platform (can be also used to develop) :&lt;br /&gt;
* [[FPGAmstrad]] on MiST-board &lt;br /&gt;
** [http://www.amedia-computer.com Amedia Computer] - fr&lt;br /&gt;
&lt;br /&gt;
== Books ==&lt;br /&gt;
* Conception de circuits en VHDL et VHDL-AMS / Principes et méthodologie / Collection POLYTECH / Cépaduès-éditions / D. HOUZET L. BARRANDON&lt;br /&gt;
* VHDL-AMS / Applications et enjeux industiels / Cours et exercices corrigés / 2e et 3e cycles écoles d'ingénieurs/ DUNOD / Yannick Hervé&lt;br /&gt;
&lt;br /&gt;
VHDL-AMS is theorical, it is about using an analog version of VHDL not running in FPGA. But VHDL-AMS books does cover also VHDL (if an author of book does understand VHDL-AMS, sure he does understand VHDL perfectly.....)&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Dust_Covers&amp;diff=97364</id>
		<title>Dust Covers</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Dust_Covers&amp;diff=97364"/>
				<updated>2017-03-04T03:04:48Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: /* History */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:CPC History]]&lt;br /&gt;
Dust Covers are especially molded plastic or wrapper covers to protect the CPC from dust when switched off. Some people think they have been the most useless hardware add-on ever produced for CPC computers. These accessories have been advertised to &amp;quot;protect&amp;quot; the CPC's dust-resistant ''sealed membrane keyboard'', or even its ''vacuum-based monitor'' against dust.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
Although being completely useless, dust covers have been (in germany, at least) almost more popular than [[Digital Joysticks|joysticks]]. Whereas, it had to be a ''real'' dust cover - one needed to buy it (using old newspapers or worn T-shirts would have been déclassé).&lt;br /&gt;
&lt;br /&gt;
Today, Dust Covers are more or less unknown. But, they have left some scars: Many people still feel irrationally guilty when exposing computer hardware to dust. The dust cover phenomenon (eighties) can be compared with the hype for equally useless ''mouse pads'' (nineties), ''protective foils'' for LCD screens (first decade of 21st century), and ''sliced bread'' (thirties).&lt;br /&gt;
&lt;br /&gt;
On a more serious note, mouse pads ''were'' a boon prior to all mouses being optical because ball mouses ''do'' tend to be a PITA on polished surfaces. (Nowadays, mats are used to protect the polished surface from scratches by them); and dust covers not hindering air flow are on the wish list of any home-server admin, especially those who have experienced dust fires in long-running servers.&lt;br /&gt;
&lt;br /&gt;
In the 1980, many computers were not put in living rooms, but (childrens') bedrooms, attics, basements or even workshops to control wood- or metal-working hardware. Those places tended to be prone to much dust, and the computer was only on for a few hours a day. Consumer products quite often were prone to mechanical jams due to dust, so especially in professional workshops, covers were regularly used. Industry DP was often so prohibitively expensive that home computers - quite often the C64, but the CPC offered a Z80 and CP/M as a boon - popped up in the most curious places (eg. a C64 was used to control the water supply of a German commune in the mid-80s).&lt;br /&gt;
&lt;br /&gt;
Of course, dish towels ''were'' used; however, in 1987 a [[CPC 6128]] with [[GT64/GT65|GT65]] cost DM1.500,-, not counting the [[Schneider RS232 Interface]] often necessary for controlling applications, plus application-specific sensors and actors - on 2% inflation for 30 years and in €uro, that would be 1500*1,02^30 / 1,95583 = ~€1.390,-. About DM20,- for a molded dust cover that did cover the machine better really did not weigh that much considering those dimensions.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Dust-cover-for-6128-keyboard.JPG|CPC 6128 with Dust Cover&lt;br /&gt;
Image:Keyboard membrane 1.jpg|Sealed 100% dust-resistant 6128 keyboard membrane&lt;br /&gt;
Image:Data Media Advert (CPC International 08-85, page 2).jpg|Advert&lt;br /&gt;
Image:Data Media Advert (CPC International 12-85, page 103).jpg|Advert&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Legal Status ==&lt;br /&gt;
&lt;br /&gt;
There are no known laws against producing, distributing, or even using dust covers. However, users are likely to lose their precious warranty if a computer catches fire because of covering its ventilation holes after forgetting to switch off the power-supply. Fortunately, the dust cover users never realized that dilemma, otherwise they'd have probably died from a heart-attack when trying to find a solultion to the question: Risk the warranty, or risk the dust?&lt;br /&gt;
&lt;br /&gt;
As users were often technically savvy, however, that dilemma did occur quite seldom (probably only in metal workshops where the metal-working machine was controlled by CPC when producing metal dust), as the computers were covered only when switched off.&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Dust_Covers&amp;diff=97363</id>
		<title>Dust Covers</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Dust_Covers&amp;diff=97363"/>
				<updated>2017-03-04T03:02:36Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:CPC History]]&lt;br /&gt;
Dust Covers are especially molded plastic or wrapper covers to protect the CPC from dust when switched off. Some people think they have been the most useless hardware add-on ever produced for CPC computers. These accessories have been advertised to &amp;quot;protect&amp;quot; the CPC's dust-resistant ''sealed membrane keyboard'', or even its ''vacuum-based monitor'' against dust.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
Although being completely useless, dust covers have been (in germany, at least) almost more popular than [[Digital Joysticks|joysticks]]. Whereas, it had to be a ''real'' dust cover - one needed to buy it (using old newspapers or worn T-shirts would have been déclassé).&lt;br /&gt;
&lt;br /&gt;
Today, Dust Covers are more or less unknown. But, they have left some scars: Many people still feel irrationally guilty when exposing computer hardware to dust. The dust cover phenomenon (eighties) can be compared with the hype for equally useless ''mouse pads'' (nineties), ''protective foils'' for LCD screens (first decade of 21st century), and ''sliced bread'' (thirties).&lt;br /&gt;
&lt;br /&gt;
On a more serious note, mouse pads ''were'' a boon prior to all mouses being optical because ball mouses ''do'' tend to be a PITA on polished surfaces. (Nowadays, mats are used to protect the polished surface from scratches by them); and dust covers not hindering air flow are on the wish list of any home-server admin, especially those who have experienced dust fires in long-running servers.&lt;br /&gt;
&lt;br /&gt;
In the 1980, many computers were not put in living rooms, but (childrens') bedrooms, attics, basements or even workshops to control wood- or metal-working hardware. Those places tended to be prone to much dust, and the computer was only on for a few hours a day. Consumer products quite often were prone to mechanical jams due to dust, so especially in professional workshops, covers were regularly used. Industry DP was often so prohibitively expensive that home computers - quite often the C64, but the CPC offered a Z80 and CP/M as a boon - popped up in the most curious places (eg. a C64 was used to control the water supply of a German commune in the mid-80s).&lt;br /&gt;
&lt;br /&gt;
Of course, dish towels ''were'' used; however, in 1987 a [[CPC 6128]] with [[GT64/GT65|GT65]] cost DM1.500,-, not counting the [[Schneider RS-232]] interface often necessary for controlling applications, plus application-specific sensors and actors - on 2% inflation for 30 years and in €uro, that would be 1500*1,02^30 / 1,95583 = ~€1.390,-. About DM20,- for a molded dust cover that did cover the machine better really did not weigh that much considering those dimensions.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Dust-cover-for-6128-keyboard.JPG|CPC 6128 with Dust Cover&lt;br /&gt;
Image:Keyboard membrane 1.jpg|Sealed 100% dust-resistant 6128 keyboard membrane&lt;br /&gt;
Image:Data Media Advert (CPC International 08-85, page 2).jpg|Advert&lt;br /&gt;
Image:Data Media Advert (CPC International 12-85, page 103).jpg|Advert&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Legal Status ==&lt;br /&gt;
&lt;br /&gt;
There are no known laws against producing, distributing, or even using dust covers. However, users are likely to lose their precious warranty if a computer catches fire because of covering its ventilation holes after forgetting to switch off the power-supply. Fortunately, the dust cover users never realized that dilemma, otherwise they'd have probably died from a heart-attack when trying to find a solultion to the question: Risk the warranty, or risk the dust?&lt;br /&gt;
&lt;br /&gt;
As users were often technically savvy, however, that dilemma did occur quite seldom (probably only in metal workshops where the metal-working machine was controlled by CPC when producing metal dust), as the computers were covered only when switched off.&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Dust_Covers&amp;diff=97362</id>
		<title>Dust Covers</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Dust_Covers&amp;diff=97362"/>
				<updated>2017-03-04T03:00:07Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: Ahem... THAT fad really was not THAT useless, considering the workshops and basements where the computers stood.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:CPC History]]&lt;br /&gt;
Dust Covers are especially molded plastic or wrapper covers to protect the CPC from dust when switched off. Some people think they have been the most useless hardware add-on ever produced for CPC computers. These accessories have been advertised to &amp;quot;protect&amp;quot; the CPC's dust-resistant ''sealed membrane keyboard'', or even its ''vacuum-based monitor'' against dust.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
Although being completely useless, dust covers have been (in germany, at least) almost more popular than [[Digital Joysticks|joysticks]]. Whereas, it had to be a ''real'' dust cover - one needed to buy it (using old newspapers or worn T-shirts would have been déclassé).&lt;br /&gt;
&lt;br /&gt;
Today, Dust Covers are more or less unknown. But, they have left some scars: Many people still feel irrationally guilty when exposing computer hardware to dust. The dust cover phenomenon (eighties) can be compared with the hype for equally useless ''mouse pads'' (nineties), ''protective foils'' for LCD screens (first decade of 21st century), and ''sliced bread'' (thirties).&lt;br /&gt;
&lt;br /&gt;
On a more serious note, mouse pads ''were'' a boon prior to all mouses being optical because ball mouses ''do'' tend to be a PITA on polished surfaces. (Nowadays, mats are used to protect the polished surface from scratches by them); and dust covers not hindering air flow are on the wish list of any home-server admin, especially those who have experienced dust fires in long-running servers.&lt;br /&gt;
&lt;br /&gt;
In the 1980, many computers were not put in living rooms, but (childrens') bedrooms, attics, basements or even workshops to control wood- or metal-working hardware. Those places tended to be prone to much dust, and the computer was only on for a few hours a day. Consumer products quite often were prone to mechanical jams due to dust, so especially in professional workshops, covers were regularly used. Industry DP was often so prohibitively expensive that home computers - quite often the C64, but the CPC offered a Z80 and CP/M as a boon - popped up in the most curious places (eg. a C64 was used to control the water supply of a German commune in the mid-80s).&lt;br /&gt;
&lt;br /&gt;
Of course, dish towels ''were'' used; however, in 1987 a [[CPC 6128]] with [[GT 65]] cost DM1.500,-, not counting the [[Schneider RS-232]] interface often necessary for controlling applications, plus application-specific sensors and actors - on 2% inflation for 30 years and in €uro, that would be 1500*1,02^30 / 1,95583 = ~€1.390,-. About DM20,- for a molded dust cover that did cover the machine better really did not weigh that much considering those dimensions.&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Dust-cover-for-6128-keyboard.JPG|CPC 6128 with Dust Cover&lt;br /&gt;
Image:Keyboard membrane 1.jpg|Sealed 100% dust-resistant 6128 keyboard membrane&lt;br /&gt;
Image:Data Media Advert (CPC International 08-85, page 2).jpg|Advert&lt;br /&gt;
Image:Data Media Advert (CPC International 12-85, page 103).jpg|Advert&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Legal Status ==&lt;br /&gt;
&lt;br /&gt;
There are no known laws against producing, distributing, or even using dust covers. However, users are likely to lose their precious warranty if a computer catches fire because of covering its ventilation holes after forgetting to switch off the power-supply. Fortunately, the dust cover users never realized that dilemma, otherwise they'd have probably died from a heart-attack when trying to find a solultion to the question: Risk the warranty, or risk the dust?&lt;br /&gt;
&lt;br /&gt;
As users were often technically savvy, however, that dilemma did occur quite seldom (probably only in metal workshops where the metal-working machine was controlled by CPC when producing metal dust), as the computers were covered only when switched off.&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Z80&amp;diff=97361</id>
		<title>Z80</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Z80&amp;diff=97361"/>
				<updated>2017-03-04T02:29:03Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: /* Part numbers used in the Amstrad CPC during its lifetime */ VERY spotty. Can't find the wikisyntax to link to en.wikipedia for eZ80 etc..&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[image:Z80A.jpg|thumb|Zilog Z80A]]&lt;br /&gt;
Microprocessor from Zilog, which is used in the Amstrad CPC Computers. The Z80/Z80A was a very popular microprocessor, used in a great variety of home computers and appliances as far-fetched as satellites. It was even used in the Commodore C128 as a secondary processor in order to achieve [[CP/M]] compatibility.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
The Z80 microprocessor is an 8 bit [[CPU]] with a 16 bit address bus capable of direct access to 64k of memory space. It has a language of 252 root instructions and with the reserved 4 bytes as prefixes, access to an additional 308 instructions. The Z80 was modelled after the [[8080]] and contains the seventy-eight 8080 opcodes as a subset to its language. &lt;br /&gt;
&lt;br /&gt;
Programming features include an accumulator and six 8-bit registers that can be paired as three 16-bit registers. In addition to the general registers, a stack pointer, program counter, and two index (memory pointer) registers are provided. While not in the same league as the Intel 80x86 or the [[Motorola 68000]] series, the Z80 is extremely useful for low cost control applications. One of the more useful features of the Z80 is the built-in refresh circuitry for ease of design with DRAMs. &lt;br /&gt;
&lt;br /&gt;
The Z80 comes in a 40 pin DIP package. It has been manufactured in A, B, and C models, differing only in maximum clock speed. It also has been manufactured as a stand-alone microcontroller with various configurations of on-chip RAM and EPROM.&lt;br /&gt;
&lt;br /&gt;
== Part numbers used in the Amstrad CPC during its lifetime ==&lt;br /&gt;
&lt;br /&gt;
The Z80 CPU has been manufactured by others, and various Z80s have been used in the construction of the CPC during its lifetime.&lt;br /&gt;
&lt;br /&gt;
* SGS Z8400AB1&lt;br /&gt;
* ST Z8400AB1&lt;br /&gt;
* ZILOG Z8400APS&lt;br /&gt;
* ZILOG Z0840004PSC&lt;br /&gt;
&lt;br /&gt;
=== modern incarnatinons ===&lt;br /&gt;
{{stub}}&lt;br /&gt;
&lt;br /&gt;
Apart from surplus/new Z80-clones that are quite easy to find, many emulations depend on software implementations of the Z80:&lt;br /&gt;
&lt;br /&gt;
* The [[T80]] is a [[VHDL|VHDL]] implementation of the Z80 and Z80A, finished in 2002 on [[OpenCores|OpenCores]]&lt;br /&gt;
* [[arnold]] uses [[InkZ80]], written in C++ (apart from the author-designed C simulation)&lt;br /&gt;
* On OpenCores, there is also a [[Verilog|Verilog]] implementation of the Z80.&lt;br /&gt;
&lt;br /&gt;
[[Zilog]] itself offers the [[eZ80|eZ80]] processor, a new, 50MHz design. Kits now have reached a less-than-prohibitive price range and may be available without a business.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Z80 - undocumented opcodes]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
&lt;br /&gt;
== Weblinks ==&lt;br /&gt;
&lt;br /&gt;
*[[Zilog]] [http://www.zilog.com]&lt;br /&gt;
*[http://www.z80.info/z80cs.htm Computer Systems based on Z80 Family]&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Z80 The Z80 processor on Wikipedia]&lt;br /&gt;
&lt;br /&gt;
== Opcodes ==&lt;br /&gt;
&lt;br /&gt;
Check the end of the document for explanations of abbreviations used below. &lt;br /&gt;
&lt;br /&gt;
=== Alfabethical list ===&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|''Mnemonic''||''Clock''||''Size''||''SZHPNC''||''Opcode''||''Description||''Notes''&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot; &lt;br /&gt;
|ADC A, r||4||1||rowspan=5|*** V0 *||88 + rb||rowspan=5|Add with Carry||rowspan=5|A = A + s + CY &lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADC A, N||7||2||CE XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADC A, (HL)||7||1||8E&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADC A, (IX + N)||19||3||DD 8E XX  &lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADC A, (IY + N)||19||3||FD 8E XX  &lt;br /&gt;
|-&lt;br /&gt;
|ADC HL, BC||15||2||rowspan=4|**? V0 *||ED 4A||rowspan=4|Add with Carry||rowspan=4|HL = HL + ss + CY &lt;br /&gt;
|-&lt;br /&gt;
|ADC HL, DE||15||2||ED 5A&lt;br /&gt;
|-&lt;br /&gt;
|ADC HL, HL||15||2||ED 6A &lt;br /&gt;
|-&lt;br /&gt;
|ADC HL, SP||15||2||ED 7A&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADD A, r||4||1||rowspan=5|*** V0 *||80 + rb||rowspan=5|Add (8-bit)||rowspan=5|A = A + s &lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADD A, N||7||2||C6 XX  &lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADD A, (HL)||7||1||86&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADD A, (IX + N)||19||3||DD 86 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADD A, (IY + N)||19||3||FD 86 XX&lt;br /&gt;
|-&lt;br /&gt;
|ADD HL, BC||11||1||rowspan=4|--?- 0 *||09||rowspan=4|Add (16-bit)||rowspan=4|HL = HL + ss &lt;br /&gt;
|-&lt;br /&gt;
|ADD HL, DE||11||1||19&lt;br /&gt;
|-&lt;br /&gt;
|ADD HL, HL||11||1||29&lt;br /&gt;
|-&lt;br /&gt;
|ADD HL, SP||11||1||39&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADD IX, BC||15||2||rowspan=4|--?- 0 *||DD 09||rowspan=4|Add (IX register)||rowspan=4|IX = IX + pp &lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADD IX, DE||15||2||DD 19&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADD IX, IX||15||2||DD 29&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|ADD IX, SP||15||2||DD 39&lt;br /&gt;
|- &lt;br /&gt;
|ADD IY, BC||15||2||rowspan=4|--?- 0 *||FD 09||rowspan=4|Add (IY register)||rowspan=4|IY = IY + rr&lt;br /&gt;
|-&lt;br /&gt;
|ADD IY, ||15||2||FD 19&lt;br /&gt;
|-&lt;br /&gt;
|ADD IY, IY||15||2||FD 29&lt;br /&gt;
|-&lt;br /&gt;
|ADD IY, SP||15||2||FD 39&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|AND r||4||1||rowspan=5|***P00||A0+rb||rowspan=5|Logical AND||rowspan=5|A=A&amp;amp;s&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|AND N||7||2||E6 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|AND (HL)||7||1||A6&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|AND (IX+N)||19||3||DD A6 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|AND (IY+N)||19||3||FD A6 XX&lt;br /&gt;
|-&lt;br /&gt;
|BIT b,r||8||2||rowspan=4|?*1?0-||CB 40+8*b+rb||rowspan=4|Test Bit||rowspan=4|m&amp;amp;{2^b}&lt;br /&gt;
|-&lt;br /&gt;
|BIT b,(HL)||12||2||CB 46+8*b&lt;br /&gt;
|-&lt;br /&gt;
|BIT b,(IX+N)||20||4||DD CB XX 46+8*b&lt;br /&gt;
|-&lt;br /&gt;
|BIT b,(IY+N)||20||4||FD CB XX 46+8*b&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|CALL NN||17||3||------||CD XX XX||Unconditional Call||-(SP)=PC,PC=nn&lt;br /&gt;
|-&lt;br /&gt;
|CALL C,NN||17/1||3||rowspan=8|------||DC XX XX||rowspan=8|Conditional Call||If Carry = 1&lt;br /&gt;
|-&lt;br /&gt;
|CALL NC,NN||17/1||3||D4 XX XX||If carry = 0&lt;br /&gt;
|-&lt;br /&gt;
|CALL M,NN||17/1||3||FC XX XX||If Sign = 1 (negative)&lt;br /&gt;
|-&lt;br /&gt;
|CALL P,NN||17/1||3||F4 XX XX||If Sign = 0 (positive)&lt;br /&gt;
|-&lt;br /&gt;
|CALL Z,NN||17/1||3||CC XX XX||If Zero = 1 (ans.=0)&lt;br /&gt;
|-&lt;br /&gt;
|CALL NZ,NN||17/1||3||C4 XX XX||If Zero = 0 (non-zero)&lt;br /&gt;
|-&lt;br /&gt;
|CALL PE,NN||17/1||3||EC XX XX||If Parity = 1 (even)&lt;br /&gt;
|-&lt;br /&gt;
|CALL PO,NN||17/1||3||E4 XX XX||If Parity = 0 (odd)&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|CCF||4||1||--?-0*||3F||Complement Carry Flag||CY=~CY&lt;br /&gt;
|-&lt;br /&gt;
|CP r||4||1||rowspan=5|***V1*||B8+rb||rowspan=5|Compare||rowspan=5|Compare A-s&lt;br /&gt;
|-&lt;br /&gt;
|CP N||7||2||FE XX&lt;br /&gt;
|-&lt;br /&gt;
|CP (HL)||7||1||BE&lt;br /&gt;
|-&lt;br /&gt;
|CP (IX+N)||19||3||DD BE XX&lt;br /&gt;
|-&lt;br /&gt;
|CP (IY+N)||19||3||FD BE XX&lt;br /&gt;
|-&lt;br /&gt;
|CPD||16||2||****1-||ED A9||Compare and Decrement||A-(HL),HL=HL-1,BC=BC-1&lt;br /&gt;
|-&lt;br /&gt;
|CPDR||21/1||2||****1-||ED B9||Compare, Dec., Repeat||CPD till A=(HL)or BC=0&lt;br /&gt;
|-&lt;br /&gt;
|CPI||16||2||****1-||ED A1||Compare and Increment||A-(HL),HL=HL+1,BC=BC-1&lt;br /&gt;
|-&lt;br /&gt;
|CPIR||21/1||2||****1-||ED B1||Compare, Inc., Repeat||CPI till A=(HL)or BC=0&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|CPL||4||1||--1-1-||2F||Complement||A=~A&lt;br /&gt;
|-&lt;br /&gt;
|DAA||4||1||***P-*||27||Decimal Adjust Acc.||A=BCD format (dec.)&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|DEC A||4||1||rowspan=10|***V1-||3D||rowspan=10|Decrement (8-bit)||rowspan=10|s=s-1&lt;br /&gt;
|- &lt;br /&gt;
|DEC B||4||1||05&lt;br /&gt;
|- &lt;br /&gt;
|DEC C||4||1||0D&lt;br /&gt;
|- &lt;br /&gt;
|DEC D||4||1||15&lt;br /&gt;
|- &lt;br /&gt;
|DEC E||4||1||1D&lt;br /&gt;
|- &lt;br /&gt;
|DEC H||4||1||25&lt;br /&gt;
|- &lt;br /&gt;
|DEC L||4||2||2D&lt;br /&gt;
|- &lt;br /&gt;
|DEC (HL)||11||1||35&lt;br /&gt;
|- &lt;br /&gt;
|DEC (IX+N)||23||3||DD 35 XX&lt;br /&gt;
|- &lt;br /&gt;
|DEC (IY+N)||23||3||FD 35 XX&lt;br /&gt;
|-&lt;br /&gt;
|DEC BC||6||1||rowspan=4|------||0B||rowspan=4|Decrement (16-bit)||rowspan=4|ss=ss-1&lt;br /&gt;
|-&lt;br /&gt;
|DEC DE||6||1||1B&lt;br /&gt;
|-&lt;br /&gt;
|DEC HL||6||1||2B&lt;br /&gt;
|-&lt;br /&gt;
|DEC SP||6||1||3B&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|DEC IX||10||2||rowspan=2|------||DD 2B||rowspan=2|Decrement||rowspan=2|xx=xx-1&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|DEC IY||10||2||FD 2B&lt;br /&gt;
|-&lt;br /&gt;
|DI||4||1||------||F3||Disable Interrupts||&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|DJNZ $+2||13/8||1||------||10||Dec., Jump Non-Zero||B=B-1 till B=0&lt;br /&gt;
|-&lt;br /&gt;
|EI||4||1||------||FB||Enable Interrupts||&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|EX (SP),HL||19||1||rowspan=5|------||E3||rowspan=5|Exchange||(SP)&amp;lt;-&amp;gt;HL&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|EX (SP),IX||23||2||DD E3||(SP)&amp;lt;-&amp;gt;xx&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|EX (SP),IY||23||2||FD E3||&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|EX AF,AF'||4||1||08||AF&amp;lt;-&amp;gt;AF'&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|EX DE,HL||4||1||EB||DE&amp;lt;-&amp;gt;HL&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|EXX||4||1||------||D9||Exchange||qq&amp;lt;-&amp;gt;qq' (except AF)&lt;br /&gt;
|-&lt;br /&gt;
|HALT||4||1||------||76||Halt||&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|IM 0||8||2||rowspan=3|------||ED 46||rowspan=3|Interrupt Mode ||rowspan=3|(n=0,1,2)&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|IM 1||8||2||ED 56&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|IM 2||8||2||ED 5E&lt;br /&gt;
|- &lt;br /&gt;
|IN A,(N)||11||2||------||DB XX||Input||A=(n)&lt;br /&gt;
|-&lt;br /&gt;
|IN (C)||12||2||***P0-||ED 70||Input*||(Unsupported)&lt;br /&gt;
|-&lt;br /&gt;
|IN A,(C)||12||2||rowspan=7|***P0-||ED 78||rowspan=7|Input||rowspan=7|r=(C)&lt;br /&gt;
|-&lt;br /&gt;
|IN B,(C)||12||2||ED 40&lt;br /&gt;
|-&lt;br /&gt;
|IN C,(C)||12||2||ED 48&lt;br /&gt;
|-&lt;br /&gt;
|IN D,(C)||12||2||ED 50&lt;br /&gt;
|-&lt;br /&gt;
|IN E,(C)||12||2||ED 58&lt;br /&gt;
|-&lt;br /&gt;
|IN H,(C)||12||2||ED 60&lt;br /&gt;
|-&lt;br /&gt;
|IN L,(C)||12||2||ED 68&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC A||4||1||rowspan=7|***V0-||3C||rowspan=7|Increment (8-bit)||rowspan=7|r=r+1&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC B||4||1||04&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC C||4||1||0C&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC D||4||1||14&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC E||4||1||1C&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC H||4||1||24&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC L||4||1||2C&lt;br /&gt;
|- &lt;br /&gt;
|INC BC||6||1||rowspan=4|------||03||rowspan=4|Increment (16-bit)||rowspan=4|ss=ss+1&lt;br /&gt;
|-&lt;br /&gt;
|INC DE||6||1||13&lt;br /&gt;
|-&lt;br /&gt;
|INC HL||6||1||23&lt;br /&gt;
|-&lt;br /&gt;
|INC SP||6||1||33&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC IX||10||2||rowspan=2|------||DD 23||rowspan=2|Increment||rowspan=2|xx=xx+1&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC IY||10||2||FD 23&lt;br /&gt;
|-&lt;br /&gt;
|INC (HL)||11||1||***V0-||34||Increment (indirect)||(HL)=(HL)+1&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC (IX+N)||23||3||rowspan=2|***V0-||DD 34 XX||rowspan=2|Increment||rowspan=2|(xx+d)=(xx+d)+1&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|INC (IY+N)||23||3||FD 34 XX&lt;br /&gt;
|-&lt;br /&gt;
|IND||16||2||?*??1-||ED AA||Input and Decrement||(HL)=(C),HL=HL-1,B=B-1&lt;br /&gt;
|-&lt;br /&gt;
|INDR||21/1||2||?1??1-||ED BA||Input, Dec., Repeat||IND till B=0&lt;br /&gt;
|-&lt;br /&gt;
|INI||16||2||?*??1-||ED A2||Input and Increment||(HL)=(C),HL=HL+1,B=B-1&lt;br /&gt;
|-&lt;br /&gt;
|INIR||21/1||2||?1??1-||ED B2||Input, Inc., Repeat||INI till B=0&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|JP NN||10||3||rowspan=4|------||C3 XX XX||rowspan=4|Unconditional Jump||PC=nn&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|JP (HL)||4||1||E9||PC=(HL)&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|JP (IX)||8||2||DD E9||rowspan=2|PC=(xx)&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|JP (IY)||8||2||FD E9&lt;br /&gt;
|- &lt;br /&gt;
|JP C,$NN||10/1||3||rowspan=8|------||DA XX XX||rowspan=8|Conditional Jump||If Carry = 1&lt;br /&gt;
|-&lt;br /&gt;
|JP NC,$NN||10/1||3||D2 XX XX||If Carry = 0&lt;br /&gt;
|-&lt;br /&gt;
|JP M,$NN||10/1||3||FA XX XX||If Sign = 1 (negative)&lt;br /&gt;
|-&lt;br /&gt;
|JP P,$NN||10/1||3||F2 XX XX||If Sign = 0 (positive)&lt;br /&gt;
|-&lt;br /&gt;
|JP Z,$NN||10/1||3||CA XX XX||If Zero = 1 (ans.= 0)&lt;br /&gt;
|-&lt;br /&gt;
|JP NZ,$NN||10/1||3||C2 XX XX||If Zero = 0 (non-zero)&lt;br /&gt;
|-&lt;br /&gt;
|JP PE,$NN||10/1||3||EA XX XX||If Parity = 1 (even)&lt;br /&gt;
|-&lt;br /&gt;
|JP PO,$NN||10/1||3||E2 XX XX||If Parity = 0 (odd)&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|JR $N+2||12||2||------||18 XX||Relative Jump||PC=PC+e&lt;br /&gt;
|- &lt;br /&gt;
|JR C,$N+2||12/7||2||rowspan=4|------||38 XX||rowspan=4|Cond. Relative Jump||rowspan=4|If cc JR(cc=C,NC,NZ,Z)&lt;br /&gt;
|-&lt;br /&gt;
|JR NC,$N+2||12/7||2||30 XX&lt;br /&gt;
|-&lt;br /&gt;
|JR Z,$N+2||12/7||2||28 XX&lt;br /&gt;
|-&lt;br /&gt;
|JR NZ,$N+2||12/7||2||20 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD I,A||9||2||rowspan=2|------||ED 47||rowspan=2|Load*||rowspan=2|dst=src&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD R,A||9||2||ED 4F&lt;br /&gt;
|- &lt;br /&gt;
|LD A,I||9||2||rowspan=2|**0*0-||ED 57||rowspan=2|Load*||rowspan=2|dst=src&lt;br /&gt;
|-&lt;br /&gt;
|LD A,R||9||2||ED 5F&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD A,r||4||1||rowspan=38|------||78+rb||rowspan=38|Load (8-bit)||rowspan=38|dst=src&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD A,N||7||2||3E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD A,(BC)||7||1||0A&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD A,(DE)||7||1||1A&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD A,(HL)||7||1||7E&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD A,(IX+N)||19||3||DD 7E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD A,(IY+N)||19||3||FD 7E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD A,(NN)||13||3||3A XX XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD B,r||4||1||40+rb&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD B,N||7||2||06 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD B,(HL)||7||1||46&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD B,(IX+N)||19||3||DD 46 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD B,(IY+N)||19||3||FD 46 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD C,r||4||1||48+rb&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD C,N||7||2||0E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD C,(HL)||7||1||4E&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD C,(IX+N)||19||3||DD 4E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD C,(IY+N)||19||3||FD 4E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD D,r||4||1||50+rb&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD D,N||7||2||16 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD D,(HL)||7||1||56&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD D,(IX+N)||19||3||DD 56 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD D,(IY+N)||19||3||FD 56 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD E,r||4||1||58+rb&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD E,N||7||2||1E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD E,(HL)||7||1||5E&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD E,(IX+N)||19||3||DD 5E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD E,(IY+N)||19||3||FD 5E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD H,r||4||1||60+rb&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD H,N||7||2||26 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD H,(HL)||7||1||66&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD H,(IX+N)||19||3||DD 66 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD H,(IY+N)||19||3||FD 66 XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD L,r||4||1||68+rb&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD L,N||7||2||2E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD L,(HL)||7||1||6E&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD L,(IX+N)||19||3||DD 6E XX&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot;&lt;br /&gt;
|LD L,(IY+N)||19||3||FD 6E XX&lt;br /&gt;
|- &lt;br /&gt;
|LD BC,(NN)||20||4||rowspan=15|------||ED 4B XX XX ||rowspan=15|Load (16-bit)||rowspan=15|dst=src&lt;br /&gt;
|- &lt;br /&gt;
|LD BC,NN||10||3||01 XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD DE,(NN)||20||4||ED 5B XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD DE,NN||10||3||11 XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD HL,(NN)||20||3||2A XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD HL,NN||10||3||21 XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD SP,(NN)||20||4||ED 7B XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD SP,HL||6||1||F9&lt;br /&gt;
|- &lt;br /&gt;
|LD SP,IX||10||2||DD F9&lt;br /&gt;
|- &lt;br /&gt;
|LD SP,IY||10||2||FD F9&lt;br /&gt;
|- &lt;br /&gt;
|LD SP,NN||10||3||31 XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD IX,(NN)||20||4||DD 2A XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD IX,NN||14||4||DD 21 XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD IY,(NN)||20||4||FD 2A XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD IY,NN||14||4||FD 21 XX XX&lt;br /&gt;
|- &lt;br /&gt;
|LD (HL),r||7||1||rowspan=15|------||70+rb||rowspan=15|Load (Indirect)||rowspan=15|dst=src&lt;br /&gt;
|-&lt;br /&gt;
|LD (HL),N||10||2||36 XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (BC),A||7||1||02&lt;br /&gt;
|-&lt;br /&gt;
|LD (DE),A||7||1||12&lt;br /&gt;
|-&lt;br /&gt;
|LD (NN),A||13||3||32 XX XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (NN),BC||20||4||ED 43 XX XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (NN),DE||20||4||ED 53 XX XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (NN),HL||16||3||22 XX XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (NN),IX||20||4||DD 22 XX XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (NN),IY||20||4||FD 22 XX XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (NN),SP||20||4||ED 73 XX XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (IX+N),r||19||3||DD 70+rb XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (IX+N),N||19||4||DD 36 XX XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (IY+N),r||19||3||FD 70+rb XX&lt;br /&gt;
|-&lt;br /&gt;
|LD (IY+N),N||19||4||FD 36 XX XX&lt;br /&gt;
|-&lt;br /&gt;
|LDD||16||2||--0*0-||ED A8||Load and Decrement||(DE)=(HL),HL=HL-1,#&lt;br /&gt;
|-&lt;br /&gt;
|LDDR||21/1||2||--000-||ED B8||Load, Dec., Repeat||LDD till BC=0&lt;br /&gt;
|-&lt;br /&gt;
|LDI||16||2||--0*0-||ED A0||Load and Increment||(DE)=(HL),HL=HL+1,#&lt;br /&gt;
|-&lt;br /&gt;
|LDIR||21/1||2||--000-||ED B0||Load, Inc., Repeat||LDI till BC=0&lt;br /&gt;
|-&lt;br /&gt;
|NEG||8||2||***V1*||ED 44||Negate||A=-A&lt;br /&gt;
|-&lt;br /&gt;
|NOP||4||1||------||00||No Operation||&lt;br /&gt;
|-&lt;br /&gt;
|OR r||4||1||rowspan=5|***P00||B0+rb||rowspan=5|Logical inclusive OR||rowspan=5|A=Avs&lt;br /&gt;
|-&lt;br /&gt;
|OR N||7||2||F6 XX&lt;br /&gt;
|-&lt;br /&gt;
|OR (HL)||7||1||B6&lt;br /&gt;
|-&lt;br /&gt;
|OR (IX+N)||19||3||DD B6 XX&lt;br /&gt;
|-&lt;br /&gt;
|OR (IY+N)||19||3||FD B6 XX&lt;br /&gt;
|-&lt;br /&gt;
|OUT (N),A||11||2||rowspan=9|------||D3 XX||Output||(n)=A&lt;br /&gt;
|-&lt;br /&gt;
|OUT (C),0||12||2||ED 71||Output*||(Unsupported)&lt;br /&gt;
|-&lt;br /&gt;
|OUT (C),A||12||2||ED 79||rowspan=7|Output||rowspan=7|(C)=r&lt;br /&gt;
|-&lt;br /&gt;
|OUT (C),B||12||2||ED 41&lt;br /&gt;
|-&lt;br /&gt;
|OUT (C),C||12||2||ED 49&lt;br /&gt;
|-&lt;br /&gt;
|OUT (C),D||12||2||ED 51&lt;br /&gt;
|-&lt;br /&gt;
|OUT (C),E||12||2||ED 59&lt;br /&gt;
|-&lt;br /&gt;
|OUT (C),H||12||2||ED 61&lt;br /&gt;
|-&lt;br /&gt;
|OUT (C),L||12||2||ED 69&lt;br /&gt;
|-&lt;br /&gt;
|OUTD||16||2||?*??1-||ED AB||Output and Decrement||(C)=(HL),HL=HL-1,B=B-1&lt;br /&gt;
|-&lt;br /&gt;
|OTDR||21/1||2||?1??1-||ED BB||Output, Dec., Repeat||OUTD till B=0&lt;br /&gt;
|-&lt;br /&gt;
|OUTI||16||2||?*??1-||ED A3||Output and Increment||(C)=(HL),HL=HL+1,B=B-1&lt;br /&gt;
|-&lt;br /&gt;
|OTIR||21/1||2||?1??1-||ED B3||Output, Inc., Repeat||OUTI till B=0&lt;br /&gt;
|-&lt;br /&gt;
|POP AF||10||1||rowspan=4|------||F1||rowspan=4|Pop||rowspan=4|qq=(SP)+&lt;br /&gt;
|-&lt;br /&gt;
|POP BC||10||1||C1&lt;br /&gt;
|-&lt;br /&gt;
|POP DE||10||1||D1&lt;br /&gt;
|-&lt;br /&gt;
|POP HL||10||1||E1&lt;br /&gt;
|-&lt;br /&gt;
|POP IX||14||2||rowspan=2|------||DD E1||rowspan=2|Pop||rowspan=2|xx=(SP)+&lt;br /&gt;
|-&lt;br /&gt;
|POP IY||14||2||FD E1&lt;br /&gt;
|-&lt;br /&gt;
|PUSH AF||11||1||rowspan=4|------||F5||rowspan=4|Push||rowspan=4|(SP)=qq&lt;br /&gt;
|-&lt;br /&gt;
|PUSH BC||11||1||C5&lt;br /&gt;
|-&lt;br /&gt;
|PUSH DE||11||1||D5&lt;br /&gt;
|-&lt;br /&gt;
|PUSH HL||11||1||E5&lt;br /&gt;
|-&lt;br /&gt;
|PUSH IX||15||2||rowspan=2|------||DD E5||rowspan=2|Push||rowspan=2|-(SP)=xx&lt;br /&gt;
|-&lt;br /&gt;
|PUSH IY||15||2||FD E5|&lt;br /&gt;
|-&lt;br /&gt;
|RES b,r||8||2||rowspan=4|------||CB 80+8*b+rb||rowspan=4|Reset bit||rowspan=4|m=m&amp;amp;{~2^b}&lt;br /&gt;
|-&lt;br /&gt;
|RES b,(HL)||15||2||CB 86+8*b&lt;br /&gt;
|-&lt;br /&gt;
|RES b,(IX+N)||23||4||DD CB XX 86+8*b&lt;br /&gt;
|-&lt;br /&gt;
|RES b,(IY+N)||23||4||FD CB XX 86+8*b&lt;br /&gt;
|-&lt;br /&gt;
|RET||10||1||rowspan=9|------||C9||Return||PC=(SP)+&lt;br /&gt;
|-&lt;br /&gt;
|RET C||11/5||1||D8||rowspan=8|Conditional Return||If Carry = 1&lt;br /&gt;
|-&lt;br /&gt;
|RET NC||11/5||1||D0||If Carry = 0&lt;br /&gt;
|-&lt;br /&gt;
|RET M||11/5||1||F8||If Sign = 1 (negative)&lt;br /&gt;
|-&lt;br /&gt;
|RET P||11/5||1||F0||If Sign = 0 (positive)&lt;br /&gt;
|-&lt;br /&gt;
|RET Z||11/5||1||C8||If Zero = 1 (ans.=0)&lt;br /&gt;
|-&lt;br /&gt;
|RET NZ||11/5||1||C0||If Zero = 0 (non-zero)&lt;br /&gt;
|-&lt;br /&gt;
|RET PE||11/5||1||E8||If Parity = 1 (even)&lt;br /&gt;
|-&lt;br /&gt;
|RET PO||11/5||1||E0||If Parity = 0 (odd)&lt;br /&gt;
|-&lt;br /&gt;
|RET||10||1||------||C9||Return||PC=(SP)+&lt;br /&gt;
|-&lt;br /&gt;
|RET C||11/5||1||rowspan=8|------||D8||rowspan=8|Conditional Return||If Carry = 1&lt;br /&gt;
|-&lt;br /&gt;
|RET NC||11/5||1||D0||If Carry = 0&lt;br /&gt;
|-&lt;br /&gt;
|RET M||11/5||1||F8||If Sign = 1 (negative)&lt;br /&gt;
|-&lt;br /&gt;
|RET P||11/5||1||F0||If Sign = 0 (positive)&lt;br /&gt;
|-&lt;br /&gt;
|RET Z||11/5||1||C8||If Zero = 1 (ans.=0)&lt;br /&gt;
|-&lt;br /&gt;
|RET NZ||11/5||1||C0||If Zero = 0 (non-zero)&lt;br /&gt;
|-&lt;br /&gt;
|RET PE||11/5||1||E8||If Parity = 1 (even)&lt;br /&gt;
|-&lt;br /&gt;
|RET PO||11/5||1||E0||If Parity = 0 (odd)&lt;br /&gt;
|-&lt;br /&gt;
|RETI||14||2||------||ED 4D||Return from Interrupt||PC=(SP)+&lt;br /&gt;
|-&lt;br /&gt;
|RETN||14||2||------||ED 45||Return from NMI||PC=(SP)+&lt;br /&gt;
|-&lt;br /&gt;
|RLA||4||1||--0-0*||17||Rotate Left Acc.||A={CY,A}&amp;lt;-&lt;br /&gt;
|-&lt;br /&gt;
|RL r||8||2||rowspan=4|**0P0*||CB 10+rb||rowspan=4|Rotate Left||rowspan=4|m={CY,m}&amp;lt;-&lt;br /&gt;
|-&lt;br /&gt;
|RL (HL)||15||2||CB 16&lt;br /&gt;
|-&lt;br /&gt;
|RL (IX+N)||23||4||DD CB XX 16&lt;br /&gt;
|-&lt;br /&gt;
|RL (IY+N)||23||4||FD CB XX 16&lt;br /&gt;
|-&lt;br /&gt;
|RLCA||4||1||--0-0*||07||Rotate Left Cir. Acc.||A=A&amp;lt;-&lt;br /&gt;
|-&lt;br /&gt;
|RLC r||8||2||rowspan=4|**0P0*||CB 00+rb||rowspan=4|Rotate Left Circular||rowspan=4|m=m&amp;lt;-&lt;br /&gt;
|-&lt;br /&gt;
|RLC (HL)||15||2||CB 06&lt;br /&gt;
|-&lt;br /&gt;
|RLC (IX+N)||23||4||DD CB XX 06&lt;br /&gt;
|-&lt;br /&gt;
|RLC (IY+N)||23||4||FD CB XX 06&lt;br /&gt;
|-&lt;br /&gt;
|RLD||18||2||**0P0-||ED 6F||Rotate Left 4 bits||{A,(HL)}={A,(HL)}&amp;lt;- ##&lt;br /&gt;
|-&lt;br /&gt;
|RRA||4||1||--0-0*||1F||Rotate Right Acc.||A=-&amp;gt;{CY,A}&lt;br /&gt;
|-&lt;br /&gt;
|RR r||8 ||2||rowspan=4|**0P0*||CB 18+rb||rowspan=4|Rotate Right||rowspan=4|m=-&amp;gt;{CY,m}&lt;br /&gt;
|-&lt;br /&gt;
|RR (HL)||15||2||CB 1E&lt;br /&gt;
|-&lt;br /&gt;
|RR (IX+N)||23||4||DD CB XX 1E&lt;br /&gt;
|-&lt;br /&gt;
|RR (IY+N)||23||4||FD CB XX 1E&lt;br /&gt;
|-&lt;br /&gt;
|RRCA||4||1||--0-0*||0F||Rotate Right Cir.Acc.||A=-&amp;gt;A&lt;br /&gt;
|-&lt;br /&gt;
|RRC r||8||2||rowspan=4|**0P0*||CB 08+rb||rowspan=4|Rotate Right Circular||rowspan=4|m=-&amp;gt;m&lt;br /&gt;
|-&lt;br /&gt;
|RRC (HL)||15||2||CB 0E&lt;br /&gt;
|-&lt;br /&gt;
|RRC (IX+N)||23||4||DD CB XX 0E&lt;br /&gt;
|-&lt;br /&gt;
|RRC (IY+N)||23||4||FD CB XX 0E&lt;br /&gt;
|-&lt;br /&gt;
|RRD||18||2||**0P0-||ED 67||Rotate Right 4 bits||{A,(HL)}=-&amp;gt;{A,(HL)} ##&lt;br /&gt;
|-&lt;br /&gt;
|RST 0||11||1||rowspan=8|------||C7||rowspan=8|Restart||rowspan=8|(p=0H,8H,10H,...,38H)&lt;br /&gt;
|-&lt;br /&gt;
|RST 08H||11||1||CF&lt;br /&gt;
|-&lt;br /&gt;
|RST 10H||11||1||D7&lt;br /&gt;
|-&lt;br /&gt;
|RST 18H||11||1||DF&lt;br /&gt;
|-&lt;br /&gt;
|RST 20H||11||1||E7&lt;br /&gt;
|-&lt;br /&gt;
|RST 28H||11||1||EF&lt;br /&gt;
|-&lt;br /&gt;
|RST 30H||11||1||F7&lt;br /&gt;
|-&lt;br /&gt;
|RST 38H||11||1||FF&lt;br /&gt;
|-&lt;br /&gt;
|SBC r||4||1||rowspan=5|***V1*||98+rb|| rowspan=5|Subtract with Carry|| rowspan=5|A=A-s-CY&lt;br /&gt;
|-&lt;br /&gt;
|SBC A,N||7||2||DE XX&lt;br /&gt;
|-&lt;br /&gt;
|SBC (HL)||7||1||9E&lt;br /&gt;
|-&lt;br /&gt;
|SBC A,(IX+N)||19||3||DD 9E XX&lt;br /&gt;
|-&lt;br /&gt;
|SBC A,(IY+N)||19||3||FD 9E XX&lt;br /&gt;
|-&lt;br /&gt;
|SBC HL,BC||15||2||rowspan=4|**?V1*||ED 42||rowspan=4|Subtract with Carry||rowspan=4|HL=HL-ss-CY&lt;br /&gt;
|-&lt;br /&gt;
|SBC HL,DE||15||2||ED 52&lt;br /&gt;
|-&lt;br /&gt;
|SBC HL,HL||15||2||ED 62&lt;br /&gt;
|-&lt;br /&gt;
|SBC HL,SP||15||2||ED 72&lt;br /&gt;
|-&lt;br /&gt;
|SCF||4||1||--0-01||37||Set Carry Flag||CY=1&lt;br /&gt;
|-&lt;br /&gt;
|SET b,r||8||2||rowspan=4|------||CB C0+8*b+rb||rowspan=4|Set bit||rowspan=4|m=mv{2^b}&lt;br /&gt;
|-&lt;br /&gt;
|SET b,(HL)||15||2||CB C6+8*b&lt;br /&gt;
|-&lt;br /&gt;
|SET b,(IX+N)||23||4||DD CB XX C6+8*b&lt;br /&gt;
|-&lt;br /&gt;
|SET b,(IY+N)||23||4||FD CB XX C6+8*b&lt;br /&gt;
|-&lt;br /&gt;
|SLA r||8||2||rowspan=4|**0P0*||CB 20+rb||rowspan=4|Shift Left Arithmetic||rowspan=4|m=m*2&lt;br /&gt;
|-&lt;br /&gt;
|SLA (HL)||15||2||CB 26&lt;br /&gt;
|-&lt;br /&gt;
|SLA (IX+N)||23||4||DD CB XX 26&lt;br /&gt;
|-&lt;br /&gt;
|SLA (IY+N)||23||4||FD CB XX 26&lt;br /&gt;
|-&lt;br /&gt;
|SRA r||8||2||rowspan=4|**0P0*||CB 28+rb||rowspan=4|Shift Right Arith.||rowspan=4|m=m/2&lt;br /&gt;
|-&lt;br /&gt;
|SRA (HL)||15||2||CB 2E&lt;br /&gt;
|-&lt;br /&gt;
|SRA (IX+N)||23||4||DD CB XX 2E&lt;br /&gt;
|-&lt;br /&gt;
|SRA (IY+N)||23||4||FD CB XX 2E&lt;br /&gt;
|-&lt;br /&gt;
|SLL r||8||2||rowspan=4|**0P0*||CB 30+rb||rowspan=4|Shift Left Logical*||rowspan=4|m={0,m,CY}&amp;lt;-&lt;br /&gt;
(SLL Instructions&lt;br /&gt;
are unsupported)&lt;br /&gt;
|-&lt;br /&gt;
|SLL (HL)||15||2||CB 36&lt;br /&gt;
|-&lt;br /&gt;
|SLL (IX+N)||23||4||DD CB XX 36&lt;br /&gt;
|-&lt;br /&gt;
|SLL (IY+N)||23||4||FD CB XX 36&lt;br /&gt;
|-&lt;br /&gt;
|SRL r||8||2||rowspan=4|**0P0*||CB 38+rb||rowspan=4|Shift Right Logical||rowspan=4|m=-&amp;gt;{0,m,CY}&lt;br /&gt;
|-&lt;br /&gt;
|SRL (HL)||15||2||CB 3E&lt;br /&gt;
|-&lt;br /&gt;
|SRL (IX+N)||23||4||DD CB XX 3E&lt;br /&gt;
|-&lt;br /&gt;
|SRL (IY+N)||23||4||FD CB XX 3E&lt;br /&gt;
|-&lt;br /&gt;
|SUB r||4||1||rowspan=5|***V1*||90+rb||rowspan=5|Subtract||rowspan=5|A=A-s&lt;br /&gt;
|-&lt;br /&gt;
|SUB N||7||2||D6 XX&lt;br /&gt;
|-&lt;br /&gt;
|SUB (HL)||7||1||96&lt;br /&gt;
|-&lt;br /&gt;
|SUB (IX+N)||19||3||DD 96 XX&lt;br /&gt;
|-&lt;br /&gt;
|SUB (IY+N)||19||3||FD 96 XX&lt;br /&gt;
|-&lt;br /&gt;
|XOR r||4||1||rowspan=5|***P00||A8+rb||rowspan=5|Logical Exclusive OR||rowspan=5|A=Axs&lt;br /&gt;
|-&lt;br /&gt;
|XOR N||7||2||EE XX&lt;br /&gt;
|-&lt;br /&gt;
|XOR (HL)||7||1||AE&lt;br /&gt;
|-&lt;br /&gt;
|XOR (IX+N)||19||3||DD AE XX&lt;br /&gt;
|-&lt;br /&gt;
|XOR (IY+N)||19||3||FD AE XX&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sorted by opcode ===&lt;br /&gt;
&lt;br /&gt;
=== Ordered by function ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]][[Category:Programming]][[Category:Datasheet]][[Category:CPC Internal Components]]&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=FPGAmstrad&amp;diff=97360</id>
		<title>FPGAmstrad</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=FPGAmstrad&amp;diff=97360"/>
				<updated>2017-03-04T02:19:27Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: /* Instruction timing */ wikilink - todo: VHDL (and -blech!!!- verilog)-codes for 'strad Chips (Z80 family, AY/YM, ...)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:FPGAmstrad_cc2.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is a VHDL version of Amstrad CPC 6128 running on FPGA starter-kit NEXYS2 500k-gates from Digilent.&lt;br /&gt;
A starter-kit is a board made for learning FPGA, so it is a standard FPGA development board.&lt;br /&gt;
&lt;br /&gt;
Please refer to [[http://github.com/mist-devel/mist-board/wiki/CoreDocAmstrad MiST-board CoreDocAmstrad]] for the final user version, running on MiST-board platform.&lt;br /&gt;
&lt;br /&gt;
Some games running on it : 1942 1943, 3D grand prix, A view to a kill, Action Fighter, animated strip poker, Antiriad, Arachnaphobia, Arkanoid, Arkanoid Revenge of Doh, Asphalt, Axiens, Barbarian MH, Barbarian PA, Barbarian II, Battleships, Bomb Jack I and II, Boulder Dash, Bruce Lee, Bubble Ghost, Buggy Boy, Bully's Sporting Darts, Cauldron I and II, Chase HQ, Chicken Chase, Classic Axiens, Classic Invaders, Crazy Cars, Crazy Snake, Dan Dare I II and III, Dizzy 7, Donkey Kong, Double Dragon I and II, Druid, E-Motion, Exolon, Express, Fruity Frank, Ghost'n'Goblins, Golden Axe, Gryzor, Heart Land, Hold-up, Hyper bowl, Ikari Warriors, Impossible Mission, Invasion of the Zombie Monsters, Iron Lord, Killapede, Klax64, Laser Squad, Light Force, Locomotion, Lode Runner, Macadam Bumper, Mange-Cailloux, Mario Bros, Maze Mania, P47, POP-UP, Prince of Persia, Prohibition, Realm, Rebel Star, Rick Dangerous I and II, R-Typeee, Rock Raid, Rogue, Rygar, Salamander, Sapiens, Shinobi, Sim City, Sorcery, Spectra, Spherica, Spin Dizzy, Star Ranger, Star Quake, Star Wars, Strider II, Super Ski, Superkid In Space, Tank Command, Tempest, Tetris 95, The Duct, The Empire Strikes Back, Trail Blazer, Trakers, Turbo Tortoise, Turrican I and II, Venoms, Victory Road, Vixen, WEC Le Mans, West Bank, Wizard's Lair, Word Cup Challenge, Word Series Baseball, Xevious, Xor, Zolyx.&lt;br /&gt;
----&lt;br /&gt;
[[File:ghostngoblins.jpg]]&lt;br /&gt;
&lt;br /&gt;
== How to assemble it  ==&lt;br /&gt;
&lt;br /&gt;
'''You need:''' &lt;br /&gt;
&lt;br /&gt;
*a &amp;quot;NEXYS2 500kgates&amp;quot; starter kit from Diligent [[http://www.digilentinc.com/Products/Detail.cfm?Prod=NEXYS2]] (1200kgates should be better for future version =&amp;gt; in fact I choosen NEXYS4, it is same RAM inside) also in France : [[http://www.lextronic.fr/]] or in Germany : [[http://www.trenz-electronic.de/]]&lt;br /&gt;
*a &amp;quot;PMODSD&amp;quot; module for reading sdcard [[http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,401,513&amp;amp;Prod=PMOD-SD]] &lt;br /&gt;
*an alimentation (cause they don't give it with starter kit) [[http://www.digilentinc.com/Products/Catalog.cfm?NavPath=2,393&amp;amp;Cat=3#DTSWPS]] &lt;br /&gt;
*optionally a DIGILENT USB JTAG (normally starter kit can be programmed directly by usb, but I don't have tested this way) [[http://www.digilentinc.com/Products/Detail.cfm?Prod=JTAG-USB]] &lt;br /&gt;
*a 4GB SDCARD (no more), I have exactly a &amp;quot;SDHC 4GB class4 Verbatim&amp;quot; &lt;br /&gt;
*the binary of this project (candidate 002) : source+500k-gates binary [[http://yunyunaof.free.fr/BuildYourOwnZ80Computer_amstrad_vhdl_002_repack.zip]] ; 1200k-gates binary [[http://yunyunAoF.free.fr/amstrad_switch_z80_vga_sd_orion_candidate_002_1200k_binary.zip]]&lt;br /&gt;
*several ROM files:&amp;amp;nbsp;OS6128.ROM BASIC1-1.ROM AMSDOS.ROM (from JavaCPC[[http://sourceforge.net/projects/javacpc/]]);&amp;amp;nbsp;MAXAM.ROM[[http://www.cpcwiki.eu/index.php/MAXAM#Download]] &lt;br /&gt;
*one or more DSK files :&amp;amp;nbsp;TEMPEST.DSK[[http://www.cpcgamereviews.com/t/index2.html#tempest]] ARKANOID.DSK[[http://www.cpcgamereviews.com/a/index7.html#arkanoid]] FRUITY.DSK[[http://www.cpcgamereviews.com/f/index7.html#fruity_frank]] BRUCELEE.DSK[[http://www.cpcgamereviews.com/b/index12.html#bruce_lee]] CHASEHQ.DSK[[http://www.cpcgamereviews.com/c/index4.html#chase_hq]] WIZLAIR.DSK[[http://www.cpcgamereviews.com/w/index4.html#wizards_lair]] XEVIOUS.DSK[[http://www.cpcgamereviews.com/x/index.html#xevious]] BOULDER.DSK[[http://www.cpcgamereviews.com/b/index10.html#boulder_dash]] CLASSIC_AXIENS.DSK[[http://www.cpcgamereviews.com/c/index6.html#classic_axiens]] CLASSIC_INVADERS.DSK[[http://www.cpcgamereviews.com/c/index6.html#classic_invaders]] GRYZOR.DSK[[http://www.romnation.net/srv/roms/3452/amstrad/Gryzor-UK-1987.html]] PRINCE.DSK[[http://www.cpcgamereviews.com/p/index7.html#prince_of_persia]] BUGGY.DSK[[http://www.cpcgamereviews.com/b/index13.html#buggy_boy]] TRAIL.DSK[[http://www.cpcgamereviews.com/t/index9.html#trailblazer]] P47.DSK[[http://www.cpcgamereviews.com/p/index3.html#p-47_the_freedom_fighter]] SUPER_SKI.DSK[[http://www.cpcgamereviews.com/s/index24.html#super_ski]] ACTION_FIGHTER.DSK[[http://www.cpcgamereviews.com/a/index.html#action_fighter]]&lt;br /&gt;
&lt;br /&gt;
A package that contains minimum set of ROM and DSK for filling simply sdcard [[http://yunyunAoF.free.fr/OS6128_BASIC1-1_AMSDOS_MAXAM.zip]] (OS6128, BASIC1-1, AMSDOS, MAXAM)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; '''You have to:''' &lt;br /&gt;
&lt;br /&gt;
*program FPGA with the binary file &amp;quot;amstrad_switch_z80_vga_sd.bit&amp;quot; of this project, for it I use Digilent Adept software and my USB JTAG cable &lt;br /&gt;
*format your 4GB SDCARD in FAT32 4096 byte allocation size &lt;br /&gt;
*copy ROM and DSK on SDCARD &lt;br /&gt;
*plug PMODSD on slot JC1 of starter kit, and set all 8 switches to 0 &lt;br /&gt;
*plug VGA, and turn on starter kit&lt;br /&gt;
&lt;br /&gt;
[[File:FPGAmstrad_minimal_plug.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''You can:''' &lt;br /&gt;
&lt;br /&gt;
*plug a PS/2 keyboard, and type &amp;quot;cat&amp;quot; &lt;br /&gt;
*increment switch to select another disk at boot, if screen became RED, it's that binary value done by switches is too big, leds are doing a small animation when a disk is correctly loaded &lt;br /&gt;
*plug principal joystick on slot JB1 (Vcc 3.3v is common) &lt;br /&gt;
*plug another joystick on slot JA1 (Vcc 3.3v is common)&lt;br /&gt;
*plug a jack on slot JD1, one at upper GND plug, and second wire at next plug, just at left of it (if it was 3.3v Vcc, choose the right one instead)&lt;br /&gt;
&lt;br /&gt;
[[File:FPGAmstrad_sound_plug.jpg]]&lt;br /&gt;
&lt;br /&gt;
Wires are plugs at upper part of pmod D.&lt;br /&gt;
&lt;br /&gt;
From bottom to upper: [nothing: Vcc 3.3v] [blue: GND] [red: sound]&lt;br /&gt;
&lt;br /&gt;
Sure you can connect a jack...&lt;br /&gt;
&lt;br /&gt;
And two joysticks.&lt;br /&gt;
On pmod B: bottom is (both) 3.3v, so joystick's common, next is (both) GND (not used), and others are joystick connections, to test manually :)&lt;br /&gt;
&lt;br /&gt;
[[File:FPGAmstrad.jpg]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
==Video==&lt;br /&gt;
http://www.youtube.com/watch?v=Z8FB_eIy8LY&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Last news  about this project ==&lt;br /&gt;
In September 2016, FPGAmstrad does use external RAM as RAM+VRAM, no more &amp;quot;LowerVRAM/UpperVRAM&amp;quot; switches to select in OSD menu.&lt;br /&gt;
&lt;br /&gt;
[[File:Fpgamstrad jocker batdemo.png|thumbnail|Using 64K of VRAM...]]&lt;br /&gt;
&lt;br /&gt;
In August 2016, FPGAmstrad does pass some arnoldemu's testbench : PPI PSG CPCTEST.&lt;br /&gt;
&lt;br /&gt;
In February 2016, FPGAmstrad has a TV mode (original signal)&lt;br /&gt;
&lt;br /&gt;
In September 2016, FPGAmstrad has write access on both disk drives, and can change dsk.&lt;br /&gt;
&lt;br /&gt;
In March 2015, FPGAmstrad is stable on MiST-board, please refer to [http://github.com/mist-devel/mist-board/wiki/CoreDocAmstrad MiST-board CoreDocAmstrad] and [http://code.google.com/p/mist-board/source/browse/#svn/trunk/bin/cores/amstrad mist-board amstrad bin core]&lt;br /&gt;
&lt;br /&gt;
In December 2014, FPGAmstrad is stable on NEXYS4, WIP, BOOTLOADER improved, VRAM improved (with BORDER colors !), RAM relaxed, no more timeout in keyboard key-press, Ghouls 'n' Ghosts, Macadam, a lot more to do. 14% of platform is used.&lt;br /&gt;
&lt;br /&gt;
In November 2014, I bought MIST board, with two pro joysticks.&lt;br /&gt;
&lt;br /&gt;
In September 2014, I bought NEXYS4, more powerfull than NEXYS2, with same external RAM, internal mini-sd, no PS/2 (it is a pmod option)... I have some patchs to make (MSB FAT32 offset). I would like to make a USB snifer also with it (usb to ethernet (wireshark))&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Contact  ==&lt;br /&gt;
&lt;br /&gt;
I am Freemac, my IRL name is Renaud Hélias.&lt;br /&gt;
&lt;br /&gt;
You can contact me by mail to renaudhelias @t gmail d0t com, if you have questions about assembling this project.&lt;br /&gt;
&lt;br /&gt;
Follow me on [http://plus.google.com/u/0/102709294612470681079 my google plus account]!&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Tests done  ==&lt;br /&gt;
&lt;br /&gt;
Great games that are running properly are listed at top of page.&lt;br /&gt;
&lt;br /&gt;
===On MiST-board CoreAmstrad version===&lt;br /&gt;
Games that doesn't run are :&lt;br /&gt;
*'''ACPC_logon_system.dsk''': text scrolling lag. This demo will be used for horizontal ink calibration (when I’ll buy a luxurious FPGA platform... I need in fact 224KB of internal RAM to do it), and CRTC overcounts.&lt;br /&gt;
*'''commando.dsk''': pixels that should be deleted are not deleted (only VRAM &amp;amp;C000-FFFF seems used)&lt;br /&gt;
*'''split ink demo.dsk''': (from cpcrulez) : may help about ink raster calibration.&lt;br /&gt;
*'''Sultan's Maze.dsk''': does need the right part of keyboard (F0-F9 are used for directions in this game)&lt;br /&gt;
*'''Orion Primes.dsk''': does display &amp;quot;secteurs entrelacés&amp;quot; - &amp;quot;vérifiez votre copie&amp;quot;, a FDC problem.&lt;br /&gt;
*'''Batman_Forever.dsk''': some problem during flying chip demo part, and several rupture showing ghost lines around Vcc=0.&lt;br /&gt;
*'''30YMD.dsk''': in Benediction demo, at bottom some time you see some ghosts of central animation (too many HSync per screen ?)&lt;br /&gt;
*'''arkanoid2.dsk''': don't run in r005.8.13, but fine in r005.8.13e (experimental fork)&lt;br /&gt;
*'''trailblazer.dsk''': no more &amp;quot;raster&amp;quot; problem since r005.5, it's now perfect ! Palette heuristic offset (done for unlocking Batman Forever Demo) has a small effect in left (squares are not separated by a black line in first column)&lt;br /&gt;
*'''imperial_mahjong.dsk''': modern EXA/EXA2 resolution not passing my color pallet heuristic :p&lt;br /&gt;
*'''rtypeee.dsk''': at begin of presentation, a draw of &amp;quot;jack plug&amp;quot; is done in a strange video mode, more than 200 pixels of height !, see  [http://cpc.sylvestre.org/musee/musee_flipping_lace.html flipping lace]&lt;br /&gt;
*'''S&amp;amp;Koh.dsk''': LOGON SYSTEM, black screen in r005.8.4... damn&lt;br /&gt;
*'''Pinball_Dreams__PREVIEW.DSK''': Does run in experimental/ versions r005.8.9.2 and r005.9.11e (experimental forked version of r005.9.11 using flag FPGAmstrad_amstrad_motherboard.vhdl.HACK_Z80=false). Does freeze in !experimental versions when background music is special (not long classic background music) and you press two buttons (left/right flipper keys) at the same time.&lt;br /&gt;
&lt;br /&gt;
'''Arkanoid.dsk''' stars use rupture address (changing address several time during display of one image), it is now supported on &amp;quot;candidate 001&amp;quot; version of FPGAmstrad. Run better in r005.9.11e than in r005.9.11.&lt;br /&gt;
&lt;br /&gt;
'''Gryzor''' and '''Prince of Percia''' use rupture ink/mode (changing ink and mode during display of one image), it is now supported on &amp;quot;candidate 002&amp;quot; version of FPGAmstrad&lt;br /&gt;
&lt;br /&gt;
Gryzor is really sensitive to Amstrad general stability : do press esc at start menu does activate music during game, if no music, FPGAmstrad is in an instable version (last known stable version r003.8)&lt;br /&gt;
&lt;br /&gt;
'''Crazycars2.dsk''' first car image use 32KB of VRAM, it is now supported on &amp;quot;candidate 001&amp;quot; version of FPGAmstrad. &lt;br /&gt;
&lt;br /&gt;
'''Ghouls'n'Ghost.dsk''' / '''Ecole.dsk''' does need RAM write when writing in ROM (RAM is beside ROM, hard to emulate with asynchronous SDRAM controler, MiST does use a hacked synchronous RAM done for that)&lt;br /&gt;
&lt;br /&gt;
'''moktar.dsk''' / '''super_cauldron.dsk''' does run fine since r004.8.1.1.&lt;br /&gt;
&lt;br /&gt;
'''CPC Aventure''' does run fine since r005.2 (message about turning disk now displayed)&lt;br /&gt;
&lt;br /&gt;
'''prehistorik.dsk''' does run fine since r005.2 (key can now be pressed in intro demo)&lt;br /&gt;
&lt;br /&gt;
'''Sim City''' and '''Hero Quest''' run fine since r005.2 (it was about &amp;quot;key always pressed&amp;quot;), but does need a hard boot (not quick reset keyboard key), certainly a small problem of component init state.&lt;br /&gt;
&lt;br /&gt;
A lot of demos don't pass in NEXYS4 FPGAmstrad's version (I need to implement back the SDRAM hacked in MiST board FPGAmstrad version). [http://cpcrulez.fr/Scene_Demos/index.php CPCRULES demos] is a cool ressource as it contains simple dsk formats.&lt;br /&gt;
&lt;br /&gt;
'''crazycar.dsk''' does use lowerVRAM=00 (&amp;amp;0000-3FFF and &amp;amp;C000-FFFF area for VRAM)&lt;br /&gt;
&lt;br /&gt;
'''crazycar2.dsk''' does use lowerVRAM=10 (&amp;amp;8000-BFFF and &amp;amp;C000-FFFF area for VRAM) while overscan presentation, and lowerVRAM=00 (&amp;amp;0000-3FFF and &amp;amp;C000-FFFF area for VRAM) during play. Run fine since r005.7&lt;br /&gt;
&lt;br /&gt;
'''buggyboy.dsk''': I found one dsk running correctly and another not : problem on this last one is about turning left/right effect : the car continues straight (it seems a prototype bad version)&lt;br /&gt;
&lt;br /&gt;
'''superski.dsk''' : don't forget to disable autofire, in jump, do press fire+up or down.&lt;br /&gt;
&lt;br /&gt;
'''protext.rom''': All right since r004 (before, in edit mode, if I pressed continuously one key, it did write ten letter and freeze/crash. Do note that a number is incremented in live at top right, so this is a complex software, good for keyboard vector stability tests)&lt;br /&gt;
&lt;br /&gt;
'''atomdriv.dsk''': unlocked since r004.5 (the game and music did freeze (ROM unplugged shall return xFF))&lt;br /&gt;
&lt;br /&gt;
'''rtypeee.dsk''': unlocked since r004.7. Does use special read FDC cmd, with BOT different of EOT (begin of track/end of track), so reading several 512 bytes blocks in one FDC command only.&lt;br /&gt;
&lt;br /&gt;
'''Arkanoid Revenge of Doh''' and '''Asphalt''' are two games that doesn't support ROM extensions : Doh starts to show small bad layers, and Asphalt does crash and reset before main menu... if you add another gadget ROM.&lt;br /&gt;
&lt;br /&gt;
'''antiriad.dsk''': no keyboard/joystick between r004.5 and r004.7. By adding pull-up at r004.5 I lost this game, by implementing a better PPI in r004.8 this game run fine : Antiriad is back !&lt;br /&gt;
&lt;br /&gt;
'''-circles.dsk''': this demo freeze does since r004.8 (PPI border effect ?) and is back since r005.5, it was nice to calibrate SOUND clock : I did generate 8 candidates of synchronizing this clock (1MHz from 4MHz : 1100 0110 0011 1001, and 0.5 deltas : 1100i, 0110i, 0011i, 1001i), only one does not freeze -circles... so I release r005.5 candidate. This demo is a great one around calibrating Yamaha clock. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Nigel Mansell's Grand Prix.dsk''': Only one race track seems ok : Monaco (Brazil track does not start). Unclassified : this disk bug also with other emulators, certainly a bad dsk dump here, TOSEC version of Nigel Mansell does run fine (but some legendary traces of &amp;quot;SK bit purpose&amp;quot; needed by here (in FDC, setting SK does jump deleted disk tracks), perhaps to investigate)&lt;br /&gt;
&lt;br /&gt;
'''saboteur2.dsk''': run fine since r005.5 (nice music and then freeze problem), it was about Yamaha clock generator (generated by Gatearray, versus WAIT_n added in short Z80 instruction to let them during all 4 clocks (Z80 in Amstrad does use 4T or 8T instructions (WAIT_n does insert missing T)). Does freeze at welcome since r005.8.7. Back since r005.8.10.&lt;br /&gt;
&lt;br /&gt;
'''tetris95.dsk''' : bad in r005.8.9.2 (4 beep while breaking 3 lines (instead of 3 beep while breaking 3 lines), was correct in r005.8.4. Back since r005.8.10.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Game !! Welcome !! Title !! Game&lt;br /&gt;
|-&lt;br /&gt;
| CrazyCar2 ||  || 1011 || 0011&lt;br /&gt;
|-&lt;br /&gt;
| One ||  || 0111 || 0011&lt;br /&gt;
|-&lt;br /&gt;
| Scarabus ||  || 0111 || 0011&lt;br /&gt;
|-&lt;br /&gt;
| Ace ||  ||  || 0010&lt;br /&gt;
|-&lt;br /&gt;
| Tintin || 0111 || 1011 || 0111&lt;br /&gt;
|-&lt;br /&gt;
| Devil's Crown  ||  || 0001 || 0011&lt;br /&gt;
|-&lt;br /&gt;
| Mach 3  || 0111 || 0111 || 0110&lt;br /&gt;
|-&lt;br /&gt;
| Paranoia (1994)  ||  || 1011 || 0001&lt;br /&gt;
|-&lt;br /&gt;
| World Class Rugby  || 1011 || 0001 || 0001&lt;br /&gt;
|-&lt;br /&gt;
| Miam Cobra  ||  ||  || 1001&lt;br /&gt;
|-&lt;br /&gt;
| Galivan  ||  ||  || 0001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''XOR.dsk''' does use lowerVRAM=01 (&amp;amp;4000-7FFF and &amp;amp;C000-FFFF area for VRAM)&lt;br /&gt;
&lt;br /&gt;
TODO :&lt;br /&gt;
&lt;br /&gt;
*To test also : [http://www.speccy.pl/archive/prod.php?id=335 Unlimited Bobs (Dr.Piotr).dsk] demo.&lt;br /&gt;
&lt;br /&gt;
== Effort done  ==&lt;br /&gt;
&lt;br /&gt;
=== Instruction timing ===&lt;br /&gt;
I tested instruction timing of [[T80]] compare to instruction timing of JavaCPC emulator. I deduce synchronization of Z80 with CRTC on M1 signal by WAIT_n insertion in order to have a multiple of 4 Tstates per instruction. I deduce also one WAIT_n inserted during MEM_WR operation (yes I log testbench T80, I’m crazy)&lt;br /&gt;
&lt;br /&gt;
I just made a test bench log of T80 (log of instruction's M1, and first M1 coming after knowing that I send a lot of NOP after my instruction), and compare it to a JavaCPC timing array. Some instructions was not tested (interrupt wait, and special timing (instructions with change timing)), but all others passed correctly.&lt;br /&gt;
&lt;br /&gt;
==== Instruction timing : currently in r008.5.14 ====&lt;br /&gt;
In GA, I do use begin of edge for IO_ACK instead of state.&lt;br /&gt;
&lt;br /&gt;
M1 reached same time of IO_ACK are ignored (not M1) in WAIT_n generator.&lt;br /&gt;
&lt;br /&gt;
MEM_WR has an OSD menu choice to switch between &amp;quot;quick&amp;quot; and &amp;quot;slow&amp;quot;, &amp;quot;slow&amp;quot; mode does insert ONE WAIT_n during detection of MEM_WR. This switch exists because somes games are running in &amp;quot;slow&amp;quot; mode and others in &amp;quot;quick&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
==== Instruction timing : talk about r008.5.14 ====&lt;br /&gt;
&lt;br /&gt;
In fact it exists several instruction making MEM_wr, and adding each one ONE WAIT_n does result in different case of synchronization.&lt;br /&gt;
&lt;br /&gt;
[http://www.cpcwiki.eu/forum/emulators/cpc-z80-timing/ CPC Z80 timing]&lt;br /&gt;
&lt;br /&gt;
If it's about managing GA reading pixels, perhaps not only M1 signal are synchronized but also the MEM_RD and MEM_WR accesses at another offset.&lt;br /&gt;
&lt;br /&gt;
[http://amstrad.eu/modules/newbb/viewtopic.php?post_id=24592 Timings instructions Z80 sur CPC]&lt;br /&gt;
&lt;br /&gt;
If interruption r52 is regular, even while making a continues MEM_WR, interruption (int&amp;lt;='1') shall be taken into account above WAIT_n insertions ?&lt;br /&gt;
&lt;br /&gt;
In Z80 sequence diagram, an IO_ACK(+M1) is preceded by M1 (single)&lt;br /&gt;
&lt;br /&gt;
cpctest.dsk -Timing Instruction- is different while using mode &amp;quot;MEM_WR=slow&amp;quot; and &amp;quot;MEM_WR=quick&amp;quot;. Strangly better using &amp;quot;MEM_WR=quick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Current version is using &amp;quot;Z80_HACK=true&amp;quot; (parameter set during compilation), that shunt Z80.WAIT_n entry, Z80.clock is slow down during theses WAIT_n. It's the only current way I succeed in slowing down enough Timing Instruction for unlocking Saboteur 2 game.&lt;br /&gt;
&lt;br /&gt;
Key games here are : Saboteur 2 (run fine with &amp;quot;MEM_WR=slow&amp;quot;, does freeze with &amp;quot;MEM_WR=quick&amp;quot;) and Arkanoid II (run fine with &amp;quot;MEM_WR=quick&amp;quot;, too slow using &amp;quot;MEM_WR=slow&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[http://www.cpcwiki.eu/forum/programming/cpc-z80-commands-and-how-long-they-take/40/ CPC Z80 Commands and how long they take...]&lt;br /&gt;
&lt;br /&gt;
=== Test of a real Zilog 80 ===&lt;br /&gt;
[[File:Z80fx2bb.jpg]]&lt;br /&gt;
Code name : Z80fx2bb, real Z80@2MHz (instead of 4MHz) on fx2bb extension card.&lt;br /&gt;
&lt;br /&gt;
For it I plug all wires simply from 1 to 40. Some wires are cut, some are Vcc, others GND. Z80 output are directly connected, Z80 input are pull-up with red-red-red resistors (I like red), Z80 is powered 5v (pmod can give 5v using jumper). In fact z80 is so old component that powering it 5v do output 3.3v.&lt;br /&gt;
&lt;br /&gt;
In fact the only difference between T80 of opencore and real Z80 is that T80 run on rising_edge, and Z80 run during low state. Test past with little modification of sequencer forcing it do nothing during low state of z80, resulting a downclock (memory is too overclocked with this sequencer modification), perhaps using buffer on address bus and data bus could solve this detail... but as it runs for me it is not a problem.&lt;br /&gt;
&lt;br /&gt;
==== TODO : Z80 testbench ====&lt;br /&gt;
&lt;br /&gt;
[http://www.cpc-power.com/index.php?page=detail&amp;amp;num=12883 CPC-Power Z80 FULL TEST (UK) (2012) - UTILITAIRE]&lt;br /&gt;
&lt;br /&gt;
Some errors detected in r005.8.4 (test done by Philippe D.)&lt;br /&gt;
&lt;br /&gt;
[http://www.winape.net/download/plustest.zip WinAPE plustest.zip (including Instruction and Interrupt timing tests)]&lt;br /&gt;
&lt;br /&gt;
=== Alignment of HSYNC Interrupt ===&lt;br /&gt;
Interrupt are respected since version &amp;quot;candidate 001&amp;quot; of FPGAmstrad.&lt;br /&gt;
&lt;br /&gt;
[[File:JavaCPC_running_norecess.jpg]]&lt;br /&gt;
&lt;br /&gt;
JavaCPC running norecess's &amp;quot;using-interrupts&amp;quot; code [[http://norecess.cpcscene.net/using-interrupts.html]]&lt;br /&gt;
&lt;br /&gt;
It could be interesting to test this asm code on next version of FPGAmstrad.&lt;br /&gt;
==== TODO : arnoldemu testbench - cpctest ====&lt;br /&gt;
[http://www.cpcwiki.eu/forum/emulators/amstrad-cpc-%27acid%27-test/ forum : amstrad cpc &amp;quot;acid&amp;quot; test] =&amp;gt; ''I have uploaded updated tests :  [http://cpctech.cpc-live.com/test.zip http://cpctech.cpc-live.com/test.zip]''&lt;br /&gt;
&lt;br /&gt;
Tests done here : ppi/psg/cpctest.&lt;br /&gt;
&lt;br /&gt;
[[File:arnoldemu_testbench_CPCTEST-r005-6.png]]&lt;br /&gt;
&lt;br /&gt;
In r005.6, I reach successfully some arnoldemu tests to calibrate more efficiently HSYNC interrupt : ppi.bin, psg.bin, cpctest.bin.&lt;br /&gt;
&lt;br /&gt;
Games unlocked by r005.6 : Sigma7, Pac-land, Golden Tail.&lt;br /&gt;
&lt;br /&gt;
In r005.8, Prehistorik is running fine.&lt;br /&gt;
&lt;br /&gt;
In r005.8.4, arnoldemu testbench &amp;quot;cpctest&amp;quot; does fail :/&lt;br /&gt;
&lt;br /&gt;
In r005.8.7, arnoldemu testbench &amp;quot;cpctest&amp;quot; is OK&lt;br /&gt;
&lt;br /&gt;
In r005.8.14 version, using default mode &amp;quot;MEM_wr:quick&amp;quot;, is OK. And Prehistorik II is running fine.&lt;br /&gt;
&lt;br /&gt;
===== TODO : arnoldemu testbench - crtctest =====&lt;br /&gt;
Adding choice of CRTC 0 or 1 on OSD, and passing this test could be great.&lt;br /&gt;
&lt;br /&gt;
=== ram_palette ===&lt;br /&gt;
VRAM contains 800x300 amstrad pixels (VZoom x2), displayed VGA 800x600@72Hz with fix regular border at 768×576 and fix inside border at 768×544.&lt;br /&gt;
&lt;br /&gt;
* simple_GateArrayInterrupt.vhd (GA to VRAM) parameters : VRAM_Hoffset/VRAM_Voffset&lt;br /&gt;
* aZRaEL_vram2vgaAmstradMiaow.vhd (VRAM to VGA) parameters : H_BEGIN/H_END/V_BEGIN/V_END (theorical fixed values)&lt;br /&gt;
To calibrate : VRAM_Hoffset++ does offset one char left. VRAM_Voffset++ does offset one line up. On display H_BEGIN does begin to scan lines of VRAM. But V_BEGIN does not enter in consideration here : vertical=0 does begin to scan columns of VRAM.&lt;br /&gt;
&lt;br /&gt;
In original CPC, top border has 1/2 char more than bottom border. I used Batman Forever default welcome/calibration screen to calibrate VRAM offsets.&lt;br /&gt;
&lt;br /&gt;
RAM_palette contains the ink list and the mode for each line of VRAM, sampled at horizontal middle of 800x600 screen, and used at begin of each line.&lt;br /&gt;
&lt;br /&gt;
=== Sniffing of a real Amstrad ===&lt;br /&gt;
[[File: cpc_plus_m1.jpg]]&lt;br /&gt;
Code name: Raptor&lt;br /&gt;
&lt;br /&gt;
I listen to some wires of my Amstrad CPC 6128 plus, but I can't access VSYNC/HSYNC output of CRTC, so I have to buy another model in order to do this test. In fact you can listen at clock of Amstrad and transmit it to FPGA DCM component, resulting a accelerated clock sequence, that's it, with FPGA DCM you can overclock output Amstrad clock signal in order to insert more operations, I use this tip for listening signals and save them inside starter kit asynchronous RAM (write, stop write, write, stop write... I’m a perfectionist paranoid...) &lt;br /&gt;
&lt;br /&gt;
You can power Amstrad CPC using extension port, applying 5v. By doing it, power down button of Amstrad doesn’t run. Using this way you reach a common 5v power between starter-kit and Amstrad. I connected wires from extension port directly to FPGA, as they are used just for listening.&lt;br /&gt;
&lt;br /&gt;
=== ROM and RAM extension ===&lt;br /&gt;
&lt;br /&gt;
In r004, you have more RAM +512KB, and you can add ROMs.&lt;br /&gt;
* LowerROM has .eZZ file extension&lt;br /&gt;
* UpperROM has .e00 ot eFF file extension (hexa)&lt;br /&gt;
&lt;br /&gt;
In r005.4, I add another UpperROM set : .f00 to .fFF file extension (hexa). If you press &amp;quot;space&amp;quot; during a reset_key (&amp;quot;page up&amp;quot; key), upperROM files used range from .f00 to .fFF instead of ranging from .e00 to .eFF. LowerROM .eZZ file extension is still used in both case.&lt;br /&gt;
&lt;br /&gt;
=== Sound output ===&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
&lt;br /&gt;
Using a simple PWM, data is entered at a certain speed, the PWM clock speed.&lt;br /&gt;
&lt;br /&gt;
If you simulate a constant PWM output signal at middle range of voltage (state just between 0V and 5V : 2.5V), it results an alternance of 0V and 5V, that result in a noise sound. In Arkanoid, this defect make some continues sounds instead of silents...&lt;br /&gt;
&lt;br /&gt;
My idea is generating a sound having a frequency upper than dog ultra sound, while I want to simulate a constant 2.5V.&lt;br /&gt;
&lt;br /&gt;
For this I do use two clocks entries in my PWM : one about data entry, and another about algorithm execution.&lt;br /&gt;
&lt;br /&gt;
This result a high quality sound output (in addition to this nice [http://www.fpgaarcade.com/library.htm Yamaha sound chip from fpgaarcade])&lt;br /&gt;
&lt;br /&gt;
==== Stereo sound output ====&lt;br /&gt;
[[File:STarKos1 21 FPGAmstrad_800x600.png|none|STarKos 1.21 running on FPGAmstrad]]&lt;br /&gt;
&lt;br /&gt;
Sound chip was modified in order to get channel A+B at left, and channel B+C at right.&lt;br /&gt;
It was tested OK using [http://www.grimware.org/doku.php/documentations/software/starkos/start STarKos 1.21] sound tracker (track &amp;quot;Carpet&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
=== DONE: Another disk selector ===&lt;br /&gt;
&lt;br /&gt;
In first version of FPGAmstrad (NEXYS2) I used switches for disk selection. As final FPGA platform doesn't have any switches set, I have to add an BASIC instruction for it, something like &amp;quot;OUT &amp;amp;CAFE,disk_number&amp;quot; could be fine.&lt;br /&gt;
&lt;br /&gt;
Since FPGAmstrad in NEXYS4, disk selection is done from keyboard, using &amp;quot;OUT &amp;amp;CAFE,disk_number&amp;quot; instruction.&lt;br /&gt;
A reset key was added also.&lt;br /&gt;
&amp;quot;PRINT INP(&amp;amp;CAFE)&amp;quot; does print current disk selected number.&lt;br /&gt;
&lt;br /&gt;
==== DONE : A advanced dsk drive ====&lt;br /&gt;
&lt;br /&gt;
Done on r004, I added also a second Drive in order to copy easily files from one disk to another.&lt;br /&gt;
&lt;br /&gt;
Irregular sector size ok.&lt;br /&gt;
&lt;br /&gt;
You just have to select Drive A or B from OSD before selecting another dsk file.&lt;br /&gt;
&lt;br /&gt;
Write is done directly on sdcard dsk file, so you can save games, and write texts...&lt;br /&gt;
&lt;br /&gt;
You can now change disk without reset. And then play games using several disks.&lt;br /&gt;
&lt;br /&gt;
[http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/fdc-floppy-t80ds-detection/ CPCWiki forum - Amstrad CPC hardware - FDC floppy t80ds detection] : talk about FDC in MiST-board CoreAmstrad.&lt;br /&gt;
&lt;br /&gt;
==== DONE : A advanced FDC (with write access and more) ====&lt;br /&gt;
Since r004 &amp;quot;mecashark&amp;quot;, the FDC implementation has write access !&lt;br /&gt;
&lt;br /&gt;
==== UNDONE : FAT32 fragmented files support ====&lt;br /&gt;
Since advanced FDC, dsk files have to be defragmented. Only ROMs are safe with a not defragemented sdcard...&lt;br /&gt;
&lt;br /&gt;
==== TODO : SNAP DSK ====&lt;br /&gt;
Add an option in OSD MENU : &amp;quot;SNAP DSK&amp;quot;. Does create a copy of current disk in current drive into &amp;quot;SNAP[number].DSK&amp;quot;. Heuristic for number : file count (at boot, incremented at each snap dsk done)&lt;br /&gt;
&lt;br /&gt;
=== TODO : A X/Y input ===&lt;br /&gt;
&lt;br /&gt;
I want to work also on screen-pen entry, is there a manner to detect an analog X/Y as pen or gun ? YES : [http://java.cpc-live.com/gx4000.php Markus Hohmann] does it, he implements the lightgun on JavaCPC-GX4000 using mouse :)&lt;br /&gt;
&lt;br /&gt;
http://cpcrulez.fr/hardware-pistolet-magnum_light_phaser_ACPC.htm&lt;br /&gt;
&lt;br /&gt;
register 11,12 and 13 ?&lt;br /&gt;
&lt;br /&gt;
=== DONE: A SCART output ===&lt;br /&gt;
&lt;br /&gt;
In order to plug FPGAmstrad on TV, and help debugging. And also to test a simple scan-doubler.&lt;br /&gt;
&lt;br /&gt;
r005c17 : experimental version, original signal TV output is running fine, with OSD menu. Have to add a flag in mist.ini instead of using OSD menu.&lt;br /&gt;
scan-doubler doesn't run ok in mode 2, and has strange offset with Arkanoid (vertical display games), so it unvalidated : only original TV output will be added to r004 in r005.&lt;br /&gt;
&lt;br /&gt;
r005 : VGA 60H/TV 50Hz.&lt;br /&gt;
&lt;br /&gt;
==== TODO : A SCART output with border ====&lt;br /&gt;
&lt;br /&gt;
Original output signal has no border, I have to implement the original border in TV mode.&lt;br /&gt;
&lt;br /&gt;
Priority: HIGH! (asked by Markus Hohmann)&lt;br /&gt;
&lt;br /&gt;
==== DONE : move SCART parameter into mist.ini ====&lt;br /&gt;
Doing like in other cores : do use the global &amp;quot;scandoubler&amp;quot; option in mist.ini to switch between VGA and TV mode.&lt;br /&gt;
&lt;br /&gt;
==== TODO : mix SCART H and V sync into HV sync (sort of C sync) ====&lt;br /&gt;
[http://github.com/mist-devel/mist-binaries/issues/35 Amstrad CPC core · Issue #35 · mist-devel-mist-binaries · GitHub] :&lt;br /&gt;
 SCART TVs expect a composite sync. The VGAs vsync is connected the SCART pin used to detect a RGB signal and is constantly driven high. A TV will not cope with a video signal with separate H and V sync.&lt;br /&gt;
 Bu tit's usually sufficient to xor hsync and vsync to get a csync acceptable for many TVs.&lt;br /&gt;
So something like this&lt;br /&gt;
 Vsync=1;&lt;br /&gt;
 Hsync=old_Vsync xor old_Hsync;&lt;br /&gt;
See if another core already succeed in generating a 50Hz SCART 15khz RGBS output...&lt;br /&gt;
&lt;br /&gt;
=== DONE : CRTC1 ===&lt;br /&gt;
r004.8 : a better CRTC/Gateway implementation, following better JEmu (JavaCPC) one... but it is a CRTC1 (but a better ONE)&lt;br /&gt;
Some bugs came from PPI also (keyboard bugs in particular), solved in r004.8&lt;br /&gt;
&lt;br /&gt;
==== DONE : CRTC0 ====&lt;br /&gt;
CRTC0 seems the best one, some demo does cry when detecting a poor CRTC1 (CRTC1 seem a low cost version of CRTC0). I have to implement a CRTC0 instead of my current CRTC1...&lt;br /&gt;
&lt;br /&gt;
In fact CRTC1 is the best one. CRTC2 is the low cost version. CRTC0 did appears before CRTC1.&lt;br /&gt;
&lt;br /&gt;
Done in r005.8.14. Detected as CRTC0 by WakeUp! - &amp;quot;Enjoy the show&amp;quot; message displayed.&lt;br /&gt;
&lt;br /&gt;
==== DONE : CRTC1 detection ====&lt;br /&gt;
I don't remember exactly, but in r005.8.4, one of &amp;quot;Midline Process&amp;quot;/&amp;quot;From Scratch&amp;quot;/&amp;quot;Pheelone&amp;quot; demo does crash due to a &amp;quot;CRTC1 needed&amp;quot; message : my CRTC1 seems not detected as a true CRTC1... If's &amp;quot;From Scratch&amp;quot; that does display this message in fact.&lt;br /&gt;
&lt;br /&gt;
Done in r005.8.14 : Still Rising (Vanity) demo can be launched, better using &amp;quot;MEM_WR:slow&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
[http://quasar.cpcscene.net/doku.php?id=coding:test_crtc Test CRTC - Quasar Net]&lt;br /&gt;
&lt;br /&gt;
=== TODO : Interlaced scanlines ===&lt;br /&gt;
&lt;br /&gt;
Interlaced scanline is an effect existing in CRTC (register R8) used by Wolfenstrad demo&lt;br /&gt;
Seen also at begin of '''R-Typeee.dsk''' (&amp;quot;stereo soundtrack&amp;quot; message's picture), and seem also used in a lot of recent demos as &amp;quot;flipping lace&amp;quot; effect.&lt;br /&gt;
&lt;br /&gt;
Scanline is also used just at begin of '''Pinball_Dreams__PREVIEW.DSK''' (eagle draw) - in fact I've got a doubt here, it seems more about a problem of HSYNC edge choice of alignement here.&lt;br /&gt;
&lt;br /&gt;
[http://cpc.sylvestre.org/technique/technique_identifier_crtc.html Les Sucres en Morceaux - Amstrad CPC - Identifier les CRTC]&lt;br /&gt;
 OUT &amp;amp;BC00,8&lt;br /&gt;
 OUT &amp;amp;BD00,3&lt;br /&gt;
&lt;br /&gt;
[http://quasar.cpcscene.net/doku.php?id=coding:test_crtc Test CRTC - Quasar Net]&lt;br /&gt;
 L'écran passe en 100Hz, les registres 4 et 7 doivent être doublés pour retomber sur 50Hz&lt;br /&gt;
&lt;br /&gt;
=== DONE : Scanlines ===&lt;br /&gt;
Here effect is about simulating CRT (not CRTC.R8) original screen. There is several way to implement it.&lt;br /&gt;
Here, truly one line out of two is 1/2 darker. By visual effect this result in &amp;quot;a thin full black horizontal line&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:FGPAmstrad cc withoutScanlines.png|thumbnail]]&lt;br /&gt;
[[File:FGPAmstrad cc withScanlines.png|thumbnail]]&lt;br /&gt;
&lt;br /&gt;
=== DONE : Monochrome option ===&lt;br /&gt;
Add an option to turn screen into green monochrome mode (in mode TV and in mode VGA)&lt;br /&gt;
&lt;br /&gt;
done in r005.8.9.2 (Soleil Vert demo)&lt;br /&gt;
[[File:Soleil vert CoreAmstrad.png|thumbnail]]&lt;br /&gt;
&lt;br /&gt;
[http://cpc.sylvestre.org/technique/technique_coul1.html Les Sucres en Morceaux - Couleurs - 1 - Les couleurs du CPC]&lt;br /&gt;
&lt;br /&gt;
==== TODO : Monochrome OSD ====&lt;br /&gt;
&lt;br /&gt;
Could be great having the OSD in monochrome when monochrome is selected and scanlined when scanline is selected&lt;br /&gt;
&lt;br /&gt;
=== TODO : Ethernet ===&lt;br /&gt;
Integration of &amp;quot;ethernec.v&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== TODO : arnoldemu's testbench fdctest ===&lt;br /&gt;
arnoldemu's testbench to pass : test/fdctest/fdctest/fdctest.dsk&lt;br /&gt;
&lt;br /&gt;
Contains the DFC &amp;quot;SK bit&amp;quot; test.&lt;br /&gt;
&lt;br /&gt;
Have also to fix theses &amp;quot;Bad Command&amp;quot; responses from fdc (it seems that when you don't reach a track, you have to send back the current track instead of this &amp;quot;Bad Command&amp;quot; signal). Test : 30YMD demo, &amp;quot;disk change&amp;quot; message not running correctly, &amp;quot;another disk inserted&amp;quot; is not detected in this demo.&lt;br /&gt;
&lt;br /&gt;
=== TODO : github migration ===&lt;br /&gt;
Have to migrate source-code repository from renaudhelias github to mist-devel github. And also update each url in head of source-code files...&lt;br /&gt;
&lt;br /&gt;
=== PPI ===&lt;br /&gt;
Problematic here : Keyboard detection versus VSYNC signal versus interrupt cycle.&lt;br /&gt;
&lt;br /&gt;
==== DONE : A better PIO ====&lt;br /&gt;
&lt;br /&gt;
I'm looking after a great implementation of PIO, in original schematic of Amstrad, keyboard (output, not input) is mapped behind Yahama chip behind PIO.&lt;br /&gt;
In some emulators, keyboard is mapped directly behind PIO.&lt;br /&gt;
In original schematic, PIO is the only one component having a low state reset (0), I think that imply a 0 value as state init of internal components variable. Data bus of Z80 seems having a pull-up state (read 1 when nothing is plugged), for example a unplugged ROM does respond xFF in data-bus.&lt;br /&gt;
&lt;br /&gt;
Update : arnoldemu's testbench PPI passed.&lt;br /&gt;
&lt;br /&gt;
==== TODO : Yamaha clock ====&lt;br /&gt;
In r005.5 I build the Yamaha clock from GA. Unlocking &amp;quot;Saboteur 2&amp;quot; game.&lt;br /&gt;
&lt;br /&gt;
Yamaha clock is generated by GA.&lt;br /&gt;
&lt;br /&gt;
Yamaha clock (YM2149_linmix_AmstradStereo.vhd) is used only for &amp;quot;sound algorithm&amp;quot;, not for setting/getting registers (registers are set using &amp;quot;BDIR BC2 BC1&amp;quot; wires), so I have to overclock the setting/getting register clock to simulate the original behaviour...&lt;br /&gt;
==== DONE : PPI clock ====&lt;br /&gt;
PPI in original schematic does not have clock ! So I have to overclock this one to simulate the original behaviour...&lt;br /&gt;
&lt;br /&gt;
Overclocked at 16MHz.&lt;br /&gt;
&lt;br /&gt;
=== TODO : a better border heuristic ===&lt;br /&gt;
Using winape testbench (plustest), test 2 does show somes problems while border does go out of screen, negative border does hide line itself.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Agile method ==&lt;br /&gt;
&lt;br /&gt;
This project results of a experiment applying Agile method.&lt;br /&gt;
Finally this project has taken 5 months. The result is a standalone platform that can run several games of Amstrad.&lt;br /&gt;
Normally, I had to dedicate 2 months on this project, but as result was so great, I continue to a standalone and better version.&lt;br /&gt;
&lt;br /&gt;
This project was done for my father birthday, so sorry that I can't deliver it yet :^)&lt;br /&gt;
&lt;br /&gt;
One day perhaps I'll write one book, or write a lot of wiki page by there, presenting step by step this adventure :)&lt;br /&gt;
&lt;br /&gt;
But I want really to validate project before doing it. So it will stand a few I think.&lt;br /&gt;
&lt;br /&gt;
=== Minimal Amstrad Architecture: Build your own Z80 Amstrad Computer ===&lt;br /&gt;
I explain here my first great experiment, having Amstrad saying hello :)&lt;br /&gt;
==== First schematic: Z80+RAM+ROM  ====&lt;br /&gt;
&lt;br /&gt;
Z80 can address from 0x0000 to 0xFFFF.&lt;br /&gt;
&lt;br /&gt;
RAM is from 0x0000 to 0xFFFF.&lt;br /&gt;
&lt;br /&gt;
You have lower and upper ROM, so starting at address 0x0000 you put OS464.ROM, and at address xC000 you put BASIC1-0.ROM.&lt;br /&gt;
&lt;br /&gt;
*When Z80 do READ MEMORY, you read ROM &lt;br /&gt;
*When Z80 do WRITE MEMORY, you write RAM &lt;br /&gt;
*When Z80 do WRITE IO, you do nothing &lt;br /&gt;
*When Z80 do READ IO, you response it DATA=0x00&lt;br /&gt;
&lt;br /&gt;
When you run this schematic on FPGA, RAM changes!&lt;br /&gt;
&lt;br /&gt;
==== Second schematic RAM+VGA ====&lt;br /&gt;
With JavaCPC, when you snapshoot, and hex edit result file, you see RAM content starting at a certain address.&lt;br /&gt;
&lt;br /&gt;
Do &amp;quot;paper 2&amp;quot;, &amp;quot;cls&amp;quot; on JavaCPC, the screen became RED, and then save a snapshoot, you can see that last part (from 0xC000 to 0xFFFF) had change from a lot of 0x00 into a lot of 0xFF&lt;br /&gt;
&lt;br /&gt;
So last part of RAM is used for video (it's shown on Quasar [[http://quasar.cpcscene.com/doku.php]] and other legend websites...)&lt;br /&gt;
&lt;br /&gt;
For making my VGA module, I take a look at UNIX &amp;quot;modeline&amp;quot; command that give us all timing for VGA signals, and it run :)&lt;br /&gt;
&lt;br /&gt;
After having a VGA module displaying a RED screen (yeah!), I made it scanning last part of RAM (from 0xC000 to 0xFFFF), and I solved the puzzle.&lt;br /&gt;
&lt;br /&gt;
[[File:crtc_puzzle.jpg]]&lt;br /&gt;
&lt;br /&gt;
RAM contain lines of 0xFF, each finishing by 0x00, but lines are not in great order&lt;br /&gt;
&lt;br /&gt;
==== Third schematic Z80+ROM+RAM+VGA  ====&lt;br /&gt;
&lt;br /&gt;
Goal is: RAM empty at startup, VGA displays hello after run. &lt;br /&gt;
&lt;br /&gt;
So you put the two last schematics together and tadam... got a problem. &lt;br /&gt;
&lt;br /&gt;
The problem is that two components are accessing RAM in the same time: the Z80 and the VGA, so you had to make a sequencer. A sequencer is simply a counter fed by a clock: 00, 01, 10, 11. And you manage work task like this: &lt;br /&gt;
&lt;br /&gt;
*00 RAM WRITE start from Z80 &lt;br /&gt;
*01 RAM WRITE end from Z80 &lt;br /&gt;
*10 RAM READ start from VGA &lt;br /&gt;
*11 RAM READ end from VGA&lt;br /&gt;
&lt;br /&gt;
You plug sequencer(1) on z80 clock and not(sequencer(1)) on VGA...but another problem appears: VGA uses 25MHz speed for scanning RAM. So Z80 has to use same speed xD &lt;br /&gt;
&lt;br /&gt;
To solve this problem you can use a special RAM done for this problem, a RAM that you can WRITE at a certain speed, and READ at another speed, this magic component is called '''ramb16_s16_s16'''. Note that they have no problem to write simultaneously on two RAM components, so that you can dump video RAM content using starter kit RAM, and you can display VGA using FPGA internal '''ramb16_s16_s16''' RAM.&lt;br /&gt;
&lt;br /&gt;
[[File:build_your_own_z80_amstrad_computer.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== First and Second schematics video ====&lt;br /&gt;
http://www.youtube.com/watch?v=9Y-RvYMxnbE&lt;br /&gt;
&lt;br /&gt;
Here I do program FPGA with a serial port RAM filler (homemade), and then I do upload ROMs (sooo long, you can show several blue progress bars), and then I do program FPGA first schematic : Z80+RAM+ROM, executing it, and then I do program second schematic : VGA is plugged on FPGA platform and does display &amp;quot;Ready&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Just about the &amp;quot;RAM filler&amp;quot;, filling a RAM with data is perhaps the more important thing* about using FPGA platforms, do just remember that a RAM does keep its content as long as voltage is entered on it. So you can program FPGA without erasing RAM content. So you can program three FPGA programs : one for filling RAM, one for running a program using RAM, one for dumping RAM. Here I did use a serial transmit, but in fact, in last versions of FPGAmstrad, I do use a SDCARD with a homemade bootloader (filling RAM from SDCARD content)&lt;br /&gt;
&lt;br /&gt;
I did use also Mock components, in first version of FPGAmstrad, FPGA platforms was too small, so I could have FPGAmstrad only with cool sound and low graphics, or else FPGAmstrad with cool graphics and no sound. Both using 100% of this old FPGA platform. A Mock component is a fake component, an empty one, just telling back &amp;quot;I'm OK, please thrust me I do exist&amp;quot; to others components trying to communicate with me (it's a entity with same in out ports as original but using constant output values)&lt;br /&gt;
&lt;br /&gt;
* * [[http://cpcwiki.eu/index.php/FPGAmstrad#RAM_dump #RAM_dump]]&lt;br /&gt;
&lt;br /&gt;
==== Third schematic Z80+ROM+RAM+VGA video ====&lt;br /&gt;
http://www.youtube.com/watch?v=w_wifI-bRJc&lt;br /&gt;
&lt;br /&gt;
=== The three main FPGAmstrad schematics ===&lt;br /&gt;
==== FPGAmstrad_bootloader_sd schematic ====&lt;br /&gt;
After having a first running Amstrad, I had to turn it into as standalone version. In fact before this step Amstrad ROM was put into RAM using serial port ([[#RAM_dump]]), it was slow, and Amstrad ROM was lost when I unplug electricity.&lt;br /&gt;
&lt;br /&gt;
Bootloader FAT32 SDCARD is the only component playing with sdcard. Its tasks, all launched at boot, are:&lt;br /&gt;
&lt;br /&gt;
- deploying ROM file on physical RAM&lt;br /&gt;
&lt;br /&gt;
- deploying Nth DSK file on physical RAM, N being the binary number selected by 8 switches&lt;br /&gt;
&lt;br /&gt;
===== State machine =====&lt;br /&gt;
Both component of Bootloader, it is to say SPI_MASTER and SDRAM_FAT32_LOADER components, does use several state-machine, one state-machine per process, each process communicating with another one using &amp;quot;MASTER/SLAVE&amp;quot; : the master state-machine does ask a slave to do something, and slave does notify master when its task is finished.&lt;br /&gt;
&lt;br /&gt;
Theses state-machine does use led debug : an integer contain the state of state machine, and this integer is displayed on 8 leds so you know where you are, it's for that I add several crash state in order to understand why and where component crash. In MiST-board, this is displayed on the five 7-segment I added in OSD, I add also a input in order to select one or another state machine.&lt;br /&gt;
&lt;br /&gt;
==== FPGAmstrad_amstrad_video schematic ====&lt;br /&gt;
&lt;br /&gt;
===== VGA =====&lt;br /&gt;
&lt;br /&gt;
The main component of this schematic is called aZRaEL_vram2vgaAmstradMiaow, due to my first experimentation about drawing a picture on VGA screen.&lt;br /&gt;
&lt;br /&gt;
VGA display component use same parameters than unix '''modeline''' command, that's all you need, with that parameters you can display something on VGA at the frequency/resolution you choose.&lt;br /&gt;
&lt;br /&gt;
[[File:aZRaEL_RAM_test_ok_zoom4_decal64_inv.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:aZRaEL_test_vram2vga.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== VRAM to VGA =====&lt;br /&gt;
RAM and VGA does not use the same frequency. I add between them a magical VRAM having two clock entries and solving this problem automatically.&lt;br /&gt;
&lt;br /&gt;
The magic RAM in FPGA, getting two clock entries, is not as magical as I was thinking : in fact it does solve clock equations using the clock manager (DCM) and BUFG components (saying phase is freedom between input and output). If you want a set of clock synchronized do not add a BUFG in one of its wires. If you don't care about synchronize of two clocks, just add it and then it will help to solve finer and greater the clock manager equations of DCM while compiling.&lt;br /&gt;
&lt;br /&gt;
If you seem interested about strange clocks generated during last step of FPGA compile, do look after &amp;quot;time constraints file&amp;quot; and &amp;quot;timing closure&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== FPGAmstrad_amstrad_motherboard schematic ====&lt;br /&gt;
This is the core part of FPGAmstrad, it does represent the motherboard schematic of Amstrad, it was aligned to JavaCPC source code.&lt;br /&gt;
&lt;br /&gt;
I fill this schematic component per component, comparing behaviour to JavaCPC components.&lt;br /&gt;
&lt;br /&gt;
JavaCPC is developed in Java, and Java is so cool (Java is better computer language ever, and VHDL is better FPGA language ever =P)&lt;br /&gt;
&lt;br /&gt;
I tickle JavaCPC in order to compare its components to my ones.&lt;br /&gt;
===== Emulator Architecture =====&lt;br /&gt;
  while (¡stop_emulation)&lt;br /&gt;
  {&lt;br /&gt;
    executeCPU(cycles_to_execute);&lt;br /&gt;
    generateInterrupts();&lt;br /&gt;
    emulateGraphics();&lt;br /&gt;
    emulateSound();&lt;br /&gt;
    emulateOtherSoftware();&lt;br /&gt;
    timeSincronization();&lt;br /&gt;
  }&lt;br /&gt;
  Figura 2. Basic Emulator Algorithm.&lt;br /&gt;
Extracted from the book [[http://www.scribd.com/doc/53571848/27/Appendix-A-Space-Invaders-i8080-tutorial]],&lt;br /&gt;
&lt;br /&gt;
Using this way, emulators reach a better running time. They don't need to implement the system-bus architecture[[http://en.wikipedia.org/wiki/System_bus]] (CONTROL DATA ADDRESS) crossing Von Neumann architecture[[http://en.wikipedia.org/wiki/John_von_Neumann]] (CU ALU MEM IO).&lt;br /&gt;
&lt;br /&gt;
===== Component Architecture =====&lt;br /&gt;
&lt;br /&gt;
Java is an object language, so having new, set, get, for each of its objects. &lt;br /&gt;
&lt;br /&gt;
A Component Architecture in object language has a special cycle life&amp;amp;nbsp;: &lt;br /&gt;
&lt;br /&gt;
*Build all components (new new new new new) &lt;br /&gt;
*Plug all components together (set set set set set) &lt;br /&gt;
*Run a main component.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Main component is Z80 on JavaCPC. In fact, JavaCPC's Z80 is already configured in order to run each instruction with a certain timing : a timing already synchronized with CRTC (each instruction takes 4 Tstates or 8 Tstates, Z80@4MHz CRTC@16bit@1MHz so drawing 8 colored pixels on mode 1 takes 4 Tstates)&lt;br /&gt;
&lt;br /&gt;
My main component is [[#Clock_sequence]] &lt;br /&gt;
&lt;br /&gt;
In real Amstrad, main component is GateArray. &lt;br /&gt;
&lt;br /&gt;
The fact of choosing Z80 as main component just respects the emulation architecture.&lt;br /&gt;
&lt;br /&gt;
===== Java debug mode =====&lt;br /&gt;
&lt;br /&gt;
You can run JavaCPC on debug mode in Eclipse, and insert breakpoints.&lt;br /&gt;
&lt;br /&gt;
It's useful for listening wires, and cut them. You can in live pause debug, cut a function and continue run.&lt;br /&gt;
&lt;br /&gt;
===== Cut a wire, cut a function =====&lt;br /&gt;
&lt;br /&gt;
Wire are done for sending message, a message in programming is a function call.&lt;br /&gt;
&lt;br /&gt;
When we cut a input wire, we generally plug it to GND or Vcc. &lt;br /&gt;
&lt;br /&gt;
For cutting a function, you have to insert a cut on it. A cut it's a return. You can insert a (very bad) forcing cut as:&lt;br /&gt;
  if (1==1) return 0;&lt;br /&gt;
everywhere. So function is ended at this moment and next lines became death code. It exists quality code program for checking death code, because it's generally a bug of development, normally we put code in comment.&lt;br /&gt;
&lt;br /&gt;
It is the way I used in order to induce JavaCPC, comparing it with my project.&lt;br /&gt;
&lt;br /&gt;
=== Clock sequence ===&lt;br /&gt;
When we have to make several components to communicate in a perfect timing, making a sequencer is a nice approach : &amp;quot;It is now your turn to do something&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Clock sequence : first try (prototype) ====&lt;br /&gt;
Original Gatearray of Amstrad is a sequencer (counter plugged with a clock), it manage synchronization between video card and z80 and memory access.&lt;br /&gt;
&lt;br /&gt;
Historically there is a link between CU of CU/ALU, and... control bus and... how making your own sequencer. But I will say no more in order to not disturb these text part xD&lt;br /&gt;
&lt;br /&gt;
Whatever, I made my own sequencer here in form of a bus of 4 wires called CLK4. CLK4 execute a simple repetitive sequence like 0001 0010 0011... CLK4(3), the last wire is directly connected to Z80 clock entry. Component not using explicit CLK4 as clock entry are generally using a not(CLK4(3)) entry, in order to do operation not as same time than z80.&lt;br /&gt;
&lt;br /&gt;
Real Amstrad use buffer memory in front of each address and data access, and real z80 is clock low state active. Normally if you follow datasheet of z80 you know how to map memory following CU comportment. Or you do as Amstrad, saying that z80 CU sucks, I create my own sequencer, managing all my memories access, alternating CRTC work and z80 work with little synchronization, insert by the way more pixels that can support my small CRTC...&lt;br /&gt;
&lt;br /&gt;
How to use a sequence in VHDL :&lt;br /&gt;
 if rising_edge(master_clk) then&lt;br /&gt;
 &lt;br /&gt;
  if seq=&amp;quot;00&amp;quot; then&lt;br /&gt;
 &lt;br /&gt;
  elsif seq=&amp;quot;01&amp;quot; then&lt;br /&gt;
 &lt;br /&gt;
  elsif seq=&amp;quot;10&amp;quot; then&lt;br /&gt;
 &lt;br /&gt;
  else&lt;br /&gt;
 &lt;br /&gt;
  end if&lt;br /&gt;
 &lt;br /&gt;
 end if&lt;br /&gt;
&lt;br /&gt;
What not to do :&lt;br /&gt;
 if rising_edge(seq[0]) then&lt;br /&gt;
 &lt;br /&gt;
 end if&lt;br /&gt;
Because that can auto-generate bad unwanted sub-clocks...&lt;br /&gt;
&lt;br /&gt;
==== Clock sequence : under time constraints (quality) ====&lt;br /&gt;
In fact, it's better to create you clock sequencer wiring each CLK and not(CLK) directly from DCM, in this case you enter in time constraints norm, and then rules/checks are done on every _edge instruction. Choosing only one sort of _edge (rising or falling) seems better also. Using that way you just have more &amp;quot;bad compiling error&amp;quot; shown, helping you creating a better code (more stable/quality).&lt;br /&gt;
&lt;br /&gt;
Clock sequence using a counter plugged with a clock was in fact a bad practice (but running fine in my first versions of FPGAmstrad as I'm a good blind developer), because output are not under clock constraint : just think about that a &amp;quot;not&amp;quot; component added just after a clock wire is a Time Constraints bad practice... destroying &amp;quot;time constraint&amp;quot; solver (the one telling you when your clock domains are bad (and why), &amp;quot;time constraint&amp;quot; is last step of FPGA compiling process, it is a important step about quality, it shall be respected (generaly in a very last development effort, I shall say in a deploy effort))&lt;br /&gt;
&lt;br /&gt;
==== Clock sequence : mirror VRAM (performance) ====&lt;br /&gt;
In order to get a better external RAM performance, and getting more luck about porting my project into others FPGA platform, I do now use a &amp;quot;Mirror VRAM&amp;quot; : external is just used by Z80 read and write (no more clock sequence finally ^^'). And a write in video RAM zone (like &amp;quot;poke &amp;amp;C000,255&amp;quot;) does just write also in another parallel RAM, a FPGA internal RAM, that I call VRAM, this VRAM can be written at a certain speed and read at another for VGA purpose (FPGA internal RAM can be used like that)&lt;br /&gt;
&lt;br /&gt;
=== USB joystick ===&lt;br /&gt;
Before learning final platform and its embedded controlers (USB joystick with a controler, is just 7 wires : left right up down buttonX buttonY buttonZ), and after having destroyed 12 collector original joysticks during tests... I did some research about simply connecting a modern USB joystick into FPGA. It was a part of my Agile Method run, I worked about two months on it.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=5BERbI2kyfM&lt;br /&gt;
&lt;br /&gt;
==== Sniffing USB frames ====&lt;br /&gt;
USB uses two wires in order to transmit frames, green and white, each with two logical values: 0v and 5v.&lt;br /&gt;
&lt;br /&gt;
Let's plug a joystick on PC, if you listen at its two wires, you can sniff a USB transmission. Finally you can save it for example on RAM.&lt;br /&gt;
&lt;br /&gt;
These two wires can be traduced into one with four states: 00 01 10 11.&lt;br /&gt;
&lt;br /&gt;
One of this states is sleep state, in fact it depends on USB mode you use.&lt;br /&gt;
===== USB mode: USB1 or USB2; low speed, full speed or high speed =====&lt;br /&gt;
For sampling, I speed up five times the saving speed on RAM. I succeed sampling an USB1 transmission: &amp;quot;Logitech dual action USB joystick&amp;quot;, and an USB2: &amp;quot;Sony PS3 USB joystick&amp;quot;. PS3 joystick is not stable enough with my FPGA, but Logitech joystick is correct.&lt;br /&gt;
&lt;br /&gt;
http://github.com/renaudhelias/CoreAmstrad/blob/master/BuildYourOwnZ80Computer/USB_logitech.vhd&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=2zEp1tHroBs&lt;br /&gt;
&lt;br /&gt;
http://github.com/renaudhelias/CoreAmstrad/blob/master/BuildYourOwnZ80Computer/USB_ps3.vhd&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=fh4v4OXridc&lt;br /&gt;
&lt;br /&gt;
USB is just a state machine (welcome how are you today, show me your state, show me your state, show me your state....), encoding (have to read USB manual), you can use some usb snifer software to decode them. Snifer software does not show low level message (ack ko ok) but does show the high level message (ones that show that a button is pressed or not)&lt;br /&gt;
&lt;br /&gt;
As it is just encoding, you can capture signals and show that they differ only when you do unpress or press a button.&lt;br /&gt;
&lt;br /&gt;
===== pull up and pull down =====&lt;br /&gt;
If you respect USB protocol, you have to plug some pull-up and pull-down resistors and some capacitors. But as I am a bad electrician, I just simulate then in VHDL, they are important because they cause USB speed negotiations. You also have an electronic mechanism in order to detect presence of joystick plug, I don't care about it.&lt;br /&gt;
&lt;br /&gt;
For reaching which wire you have to pull-up or pull-down, here the tips :&lt;br /&gt;
*For slave (ideal for sniffing) : just take your USB1 joystick without plug it, just supply it (+5v red, 0v black), and test while-black and green-black with voltmeter, if you have got 5v then put a VHDL pull-up, and if you have got 0v then put a VHDL pull-down.&lt;br /&gt;
*For master (ideal for creating a mini-host) : just take your PC USB1 port, and test while-black and green-black with voltmeter, if you have got 5v then put a VHDL pull-up, and if you have got 0v then put a VHDL pull-down. Normally you result two pull-down.&lt;br /&gt;
&lt;br /&gt;
==== Synchronize, decode and check USB frames ====&lt;br /&gt;
One time sample is done, it is not readable. In fact USB frames are synchronized (they started with a certain synchronization pattern), encoded (NRZI), and checked (CRC). CRC type depends on frame length. Encoding is done for synchronization optimization.&lt;br /&gt;
&lt;br /&gt;
Then using USB HID manual, you can understand type of frames, and author of them, and remark that the author alternate: USB master (PC) or USB slave (joystick)&lt;br /&gt;
&lt;br /&gt;
You can use some &amp;quot;USB sniffer software&amp;quot; in order to understand more easily some frames contain, but they generally don't give all frame, and full frame.&lt;br /&gt;
&lt;br /&gt;
[http://www.usb.org/developers/whitepapers/crcdes.pdf great crc check example in perl - offered by www.usb.org]&lt;br /&gt;
&lt;br /&gt;
==== Build a minimum USB master frames state-machine ====&lt;br /&gt;
Let's just plug a USB joystick on FPGA, directly, permanently, thinking about minimum coding size : we can't implement full HID USB protocol on FPGA ^^'&lt;br /&gt;
&lt;br /&gt;
Objective here is to build a minimum state-machine graph, having for transaction between state a &amp;quot;frame transmission&amp;quot;. It is normal on USB protocol to have error of transmission, so you have also to put &amp;quot;error frame transmission&amp;quot; on the graph.&lt;br /&gt;
&lt;br /&gt;
At stabilization, you finally switch between two states, one sending a certain frame that contains at different offset simply certain values of joystick button.&lt;br /&gt;
&lt;br /&gt;
At start, some frames are employed for &amp;quot;next frame description&amp;quot;, they can generally be ignored, as our USB architecture is fixed and minimal (one USB joystick, that's all)&lt;br /&gt;
&lt;br /&gt;
==== go further with USB sniffer ====&lt;br /&gt;
&lt;br /&gt;
A better way to snif USB could be generation of TCP/IP packets encapsuling USB packets, and to record them directly on PC from a RJ45 plug, using this way I could save more than 10 seconds of information transmission (RAM size is limited on FPGA platfoms)&lt;br /&gt;
&lt;br /&gt;
[[File:Usb-paf.png|thumbnail]]&lt;br /&gt;
&lt;br /&gt;
http://www.ulule.com/usb-paf (unfunded) =&amp;gt; but MiST-board final platform does offer USB pro competition Joystick compatibility &amp;lt;3 &amp;lt;3 &amp;lt;3&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Platforms ==&lt;br /&gt;
=== Why NEXYS2 500kgates starter kit ===&lt;br /&gt;
==== Xilinx schematics ====&lt;br /&gt;
Xilinx webpack software permit drawing schematics as book schematics, My point of view is : &amp;quot;For programming a FPGA, you draw a schematic as old books and just press one button. Each component on this schematic can be edited, in a language called VHDL&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
My source code is not Altera compatible because of schematics drawn, but webpack can export vhdl code from schematics if you want.&lt;br /&gt;
&lt;br /&gt;
==== RAM dump  ====&lt;br /&gt;
&lt;br /&gt;
A starter kit that contains a RAM component, that you can dump separaly : you can change schematics without loosing RAM content ! - and so write a schematic for dump only ;)&lt;br /&gt;
&lt;br /&gt;
While power is on you can: &lt;br /&gt;
&lt;br /&gt;
*programming FPGA with a program/schematics done for filling RAM &lt;br /&gt;
*press reset button &lt;br /&gt;
*programming FPGA with a program/schematics done for using RAM &lt;br /&gt;
*press reset button &lt;br /&gt;
*programming FPGA with a program/schematics done for reading RAM &lt;br /&gt;
*press reset button&lt;br /&gt;
&lt;br /&gt;
My own made program does it with poor serial port, so for dumping all RAM content it takes about 3 hours, and for dumping Amstrad RAM part it is about 15 minutes.&lt;br /&gt;
&lt;br /&gt;
On [[http://www.digilentinc.com/Products/Detail.cfm?Prod=NEXYS2 Diligent NEXYS2 official page]], you can download a &amp;quot;Onboard Memory controller reference design&amp;quot; that contains explanation and VHDL source code about dumping on RAM/ROM of NEXYS2 directly from PC (usb port). I didn't tested this yet, but it is certainly a nicer approach :P&lt;br /&gt;
&lt;br /&gt;
==== FPGA internal RAM size ====&lt;br /&gt;
It's to know that a FPGA chip contain 45KB internal RAM (360Kb for NEXYS2 500k-gates, and 504Kb for 1200k-gates) so you can't insert a dsk inside. This internal RAM is already used in part by T80 (z80 from opencores), by the soundchip, and for special RAM '''ramb16_s16_s16''' (RAM with two different speed one for writing another for reading, in fact two RAM with a common part) that I use for VGA mode.&lt;br /&gt;
&lt;br /&gt;
==== VHDL components size ====&lt;br /&gt;
T80 (z80 processor) take 100kgates&lt;br /&gt;
&lt;br /&gt;
Yamaha sound chip (from fpgaarcade) take 50kgates&lt;br /&gt;
&lt;br /&gt;
InterruptGenerator + VGA mode take 50kgates&lt;br /&gt;
&lt;br /&gt;
Bootloader (for standalone) take about 120kgates (FAT32 protocol, SPI protocol, DSK protocol)&lt;br /&gt;
&lt;br /&gt;
Actually the project take about 99.9% of 500kgates. But I think that TV mode will take a lower size. A bigger size shall be great for Amstrad CPC Plus version, if JavaCPC evolve, and then if I evolve ;)&lt;br /&gt;
&lt;br /&gt;
=== Why MiST-board final platform ===&lt;br /&gt;
==== Final version of FPGAmstrad ====&lt;br /&gt;
[http://github.com/mist-devel/mist-board/wiki/CoreDocAmstrad MiST-board : CoreDocAmstrad]&lt;br /&gt;
==== Altera schematics ====&lt;br /&gt;
Altera does also permit drawing schematics. I love schematics, my top file -gluing components- is sure a drawn schematic.&lt;br /&gt;
==== USB competition-pro Joystick ====&lt;br /&gt;
my favorite one &amp;lt;3&lt;br /&gt;
==== SDCARD entry robust ====&lt;br /&gt;
SDCARD player is nice built. It is not destroyed after 30 insertions.&lt;br /&gt;
It is also easy to program FPGA : I just have to put my files into a SDCARD, and it runs, that's all.&lt;br /&gt;
==== Metal case ====&lt;br /&gt;
It's a true final platform.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== MiST-board - Core Developer's Notes ==&lt;br /&gt;
Here, you'll find all the Amstrad MiST Core development strategy : deployment of FPGAmstrad project on this lovely MiST-board final FPGA platform.&lt;br /&gt;
&lt;br /&gt;
You'll find also the Amstrad MiST Core source code.&lt;br /&gt;
&lt;br /&gt;
Goto [http://github.com/mist-devel/mist-board/wiki/CoreDocAmstrad MiST-board : CoreDocAmstrad] if you want to test final version of CoreAmstrad running on MiST-board platform (a final-user platform)&lt;br /&gt;
&lt;br /&gt;
=== From Xilinx to Altera schematics ===&lt;br /&gt;
For me, global schematics are really important, for developing and for deploying.&lt;br /&gt;
A schematic developed in order to be comparable to original documentation schematic is nice. FPGAmstrad is composed of 3 schematics :&lt;br /&gt;
  * amstrad_motherboard : comparable to original Amstrad schematic.&lt;br /&gt;
  * amstrad_video : does manage a true VGA output, using a internal VRAM.&lt;br /&gt;
  * bootloader_sd : sdcard bootloader, in order to load ROM and dsk at boot, from sdcard.&lt;br /&gt;
&lt;br /&gt;
As Xilinx schematics are not compatible with Altera, I do generate &amp;quot;vhf&amp;quot; files, and rename them :&lt;br /&gt;
  * FPGAmstrad_amstrad_motherboard.vhd&lt;br /&gt;
  * FPGAmstrad_amstrad_video.vhd&lt;br /&gt;
  * FPGAmstrad_bootloader_sd.vhd&lt;br /&gt;
&lt;br /&gt;
And then I make a global schematic in Altera, that contains the previous components, and several MiST-board controlers :&lt;br /&gt;
  * FPGAmstrad_amstrad_motherboard.vhd&lt;br /&gt;
  * FPGAmstrad_amstrad_video.vhd&lt;br /&gt;
  * FPGAmstrad_bootloader_sd.vhd&lt;br /&gt;
  * sdcard.v&lt;br /&gt;
  * user_io.v&lt;br /&gt;
  * data_io.v&lt;br /&gt;
  * sdram.v&lt;br /&gt;
  * osd.v&lt;br /&gt;
&lt;br /&gt;
I create then a main clock component, generating all clocks I want even the not clocks (a good practice, while using &amp;quot;time constraints&amp;quot;),&lt;br /&gt;
I also add some adapters, about wire/bus range solving :&lt;br /&gt;
  * MIST_SDRAM.vhd : each SDRAM has a different RAM bus size&lt;br /&gt;
  * MIST_DQM.vhd : just a small wiring helper&lt;br /&gt;
  * MIST_RGB.vhd : each VGA output has different count of colors&lt;br /&gt;
  * MIST_STATUS.vhd : mapping status wires&lt;br /&gt;
  * CONF_STR.vhd : generating OSD parameter&lt;br /&gt;
&lt;br /&gt;
=== Xilinx to Altera ===&lt;br /&gt;
While generating vhf files from Xilinx Schematics, a lot of small components have to be adapted :&lt;br /&gt;
  * INV component became 'not' instruction&lt;br /&gt;
  * AND2 component became 'and' instruction&lt;br /&gt;
  * OR2 component became 'or instruction&lt;br /&gt;
  * GND component became '0' value&lt;br /&gt;
  * VCC component became '1' value&lt;br /&gt;
The internal RAM, sync and async (with one or two clocks) are to adapt, I use mem_altera_gen.vhd for this purpose.&lt;br /&gt;
&lt;br /&gt;
=== Special things done during deploy ===&lt;br /&gt;
&lt;br /&gt;
sdram.v is personalized in order to solve address **after** the write or read event. It is due to Amstrad that permit writing in RAM hidden inside ROM : if I read I read ROM, if I write I write RAM.&lt;br /&gt;
&lt;br /&gt;
sdram.v is also personalized in order having a clkref lower than 4MHz.&lt;br /&gt;
&lt;br /&gt;
=== RAM optimization ===&lt;br /&gt;
&lt;br /&gt;
Some efforts done about internal RAM.&lt;br /&gt;
&lt;br /&gt;
As I could not do enter my 32KB VRAM, I used a 16KB+8KB+4KB VRAM, to display the 640x480 output, scanning my 800x600 VRAM : bottom of my VRAM is useless for a 640x480 display.&lt;br /&gt;
&lt;br /&gt;
At this step, I have 0KB of internal RAM free. Now let's do appear 16KB more in order to deploy fully my FPGAmstrad project !&lt;br /&gt;
&lt;br /&gt;
RAM inferred : [in Altera reg is inferred into RAM-block](http://quartushelp.altera.com/13.0/mergedProjects/hdl/vlog/vlog_file_dir_ram.htm) ([http://quartushelp.altera.com/13.0/mergedProjects/hdl/vlog/vlog_file_dir.htm more]), so a reg written like this :&lt;br /&gt;
 reg [7:0] dir_entry_reg [31:0]&lt;br /&gt;
became RAM-block.&lt;br /&gt;
&lt;br /&gt;
In data_io.v : dir_entry_reg does use /**synthesis noprune**/ in order to be not unwired. If I remove output dir_entry_d, RAM-block is inferred. If I let output dir_entry_d, LOGIC-block is inferred.&lt;br /&gt;
&lt;br /&gt;
So I removed output dir_entry_d and set :&lt;br /&gt;
 (* ramstyle = &amp;quot;logic&amp;quot; *) reg [7:0] dir_entry_reg [31:0] /* synthesis noprune */;&lt;br /&gt;
So I continue winning my 1KB internal RAM-block (here 256 Bytes was needed and turn into inferred LOGIC-block)&lt;br /&gt;
&lt;br /&gt;
In sdcard.v&lt;br /&gt;
 reg [7:0] buffer [511:0];&lt;br /&gt;
is a big reg and really important one (speaking to ARM SPI !), so I let it inferring into RAM-block.&lt;br /&gt;
But about cid and csd I does :&lt;br /&gt;
 (* ramstyle = &amp;quot;logic&amp;quot; *) reg [7:0] cid [15:0];&lt;br /&gt;
 (* ramstyle = &amp;quot;logic&amp;quot; *) reg [7:0] csd [15:0];&lt;br /&gt;
Winning 2KB of internal RAM for this small 128Bytes reg :)&lt;br /&gt;
&lt;br /&gt;
In VRAM_Palette, I had 16KB. But in fact a raster line is a 2+16+1 RAM palette line, so each line I store 19KB, so in fact 19*600/2=5700 bytes (800x600 VRAM in fact thruly 800x300). So only a 8KB RAM palette only was needed in FPGAmstrad project finally.&lt;br /&gt;
&lt;br /&gt;
At this step I won 10KB of internal RAM (I need 6KB more to succeed in my full FPGAmstrad deployment)&lt;br /&gt;
&lt;br /&gt;
I can nibble 2KB more at end of RAM palette, that's what I does.&lt;br /&gt;
&lt;br /&gt;
Now I have 12KB of internal RAM free :)&lt;br /&gt;
&lt;br /&gt;
And 4KB in VRAM :&lt;br /&gt;
 800x600=100*300=30KB full&lt;br /&gt;
 800x480=100*240=24000 24000-16384=7616&amp;lt;8KB=8192&lt;br /&gt;
so VRAM with a start vertical offset can be composed of 16KB+8KB only. So I won my last 4KB here.&lt;br /&gt;
&lt;br /&gt;
I did patch my simple_GateArrayInterrupt component by parametering vertical offset :&lt;br /&gt;
&lt;br /&gt;
 GA_interrupt : simple_GateArrayInterrupt&lt;br /&gt;
		generic map (VRAM_Voffset=&amp;gt;38*8-30*8-4*8+4  +0      +15) -- MiST +15 ?&lt;br /&gt;
&lt;br /&gt;
I also patched my aZRaEL_vram2vgaAmstradMiaow component by parametering vertical offset :&lt;br /&gt;
&lt;br /&gt;
  XLXI_476 : aZRaEL_vram2vgaAmstradMiaow&lt;br /&gt;
		generic map (VOFFSET_NEGATIF =&amp;gt;0, -- MiST 0&lt;br /&gt;
		VOFFSET_PALETTE=&amp;gt;0) -- MiST 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now I can use my 16KB free RAM in VRAM double buffer. Reaching a full FGPAmstrad project deploy on MiST-board, unlocking others games : it is what is done in realise 002 of Amstrad core. I tested ChaseHQ does now run fine.&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
=== FPGAmstrad source code (Xilinx)===&lt;br /&gt;
The project binary downloadable on [[#How_to_assemble_it]] section contains in fact source code and the binary file (.bit)&lt;br /&gt;
&lt;br /&gt;
This is a simple zip of project folder.&lt;br /&gt;
&lt;br /&gt;
The project was done using '''Xilinx webpack'''&lt;br /&gt;
&lt;br /&gt;
It contains some direct drawn schematics, and VHDL components&lt;br /&gt;
&lt;br /&gt;
=== MiST-board CoreAmstrad source code (Altera) ===&lt;br /&gt;
[http://github.com/renaudhelias/CoreAmstrad MiST-board CoreAmstrad source code]&lt;br /&gt;
&lt;br /&gt;
Compiling OK in Quartus II 13.0 (Altera IDE), and a few in ISE Design Suite 14.7 (Xilinx IDE) - I have to report back some modifications from my deploy platform(Altera MiST-board) to my dev platform (Xilinx NEXYS4 from Digilent Inc.)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Schematics ==&lt;br /&gt;
&lt;br /&gt;
I explode the main schematic into a task by component, so the schematic is big.&lt;br /&gt;
&lt;br /&gt;
Starter kit use only one RAM physical component for RAM ROM and DSK alignment, so I had to manage accesses (it is possible in fact because Z80 is a sequential processor)&lt;br /&gt;
&lt;br /&gt;
My clock take 4 wires, in fact it exists a clock sequence [[#Clock_sequence]] (during 1 z80 tic, I do several things)&lt;br /&gt;
&lt;br /&gt;
RAM is done for being dump, comparable to JavaCPC snapshoots.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
sound chip is [http://www.fpgaarcade.com/library.htm ym2149 fpgaarcade] one, patched, and repatched in order to get stereo sound.&lt;br /&gt;
&lt;br /&gt;
PPI chip is [http://www.cpcwiki.eu/index.php/VHDL_implementation_of_the_8255_PIO 8255 CPCWiki] one, patched.&lt;br /&gt;
&lt;br /&gt;
PWM chip is [http://www.fpga4fun.com/PWM_DAC.html PWM_DAC fpga4fun] one, patched in order to get high sound quality (my PWM has two clocks in entry)&lt;br /&gt;
&lt;br /&gt;
== And thanks ==&lt;br /&gt;
&lt;br /&gt;
Certainly first thanks to [http://java.cpc-live.com Markus Hohmann], for having programmed a Java version of CPC, I love Java and VHDL, so this project comes from this Java Amstrad emulator.&lt;br /&gt;
&lt;br /&gt;
Secondary Steve Ciarca, author of &amp;quot;Build your own Z80 computer&amp;quot; (1981), so nice book.&lt;br /&gt;
&lt;br /&gt;
Then the author of the VHDL version of Yamaha sound chip : [http://www.fpgaarcade.com/library.htm fpgaarcade]. And [http://opencores.org/project,t80 opencores] for the Z80 (T80)...&lt;br /&gt;
&lt;br /&gt;
And websites that give access to so much old Amstrad resources like :&lt;br /&gt;
* [http://cpcwiki.eu/ CPCWiki] :) ''the Amstrad community''&lt;br /&gt;
* [http://quasar.cpcscene.com Quasar Net] fr ''lost legends''&lt;br /&gt;
* [http://www.grimware.org Grimware] ''lost schematics knowledge''&lt;br /&gt;
* [http://cpcrulez.fr/ CPCRULEZ] fr ''assembler and legends''&lt;br /&gt;
* [http://www.genesis8bit.fr/ Genesis8] fr ''games news''&lt;br /&gt;
* [http://www.amstradtoday.com/ Amstrad TODAY] fr ''a nice link list''&lt;br /&gt;
* [http://pushnpop.net Push'n'Pop] ''lost FDC knowledge''&lt;br /&gt;
&lt;br /&gt;
And more :&lt;br /&gt;
* [http://www.cpcgamereviews.com CPC GAMES REVIEWS] ''large illustrated dsk image database''&lt;br /&gt;
* [http://java.cpc-live.com JavaCPC emulator] ''Markus Hohmann''&lt;br /&gt;
* [http://www.cpcmania.com CPCMANIA] ''plug Amstrad on TV''&lt;br /&gt;
* [http://bellaminettes.com Bellaminettes] fr ''Artist drawer -nice girls- from ACBM magazine - Les puces informatiques - Sasfepu''&lt;br /&gt;
&lt;br /&gt;
=== Others tricks ===&lt;br /&gt;
If you aren't ready yet, here somes experiments (youtube) on real Amstrad :&lt;br /&gt;
* [http://www.youtube.com/watch?v=XKl93DmX9gk Test of SCART (TV) on Amstrad CPC 6128 +]&lt;br /&gt;
* [http://www.youtube.com/watch?v=XPmeyDbSwUI Test of external 3.5 disk on Amstrad CPC 6128 +]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;br /&gt;
[[Category:Emulator]]&lt;br /&gt;
[[Category:Non CPC Computers]]&lt;br /&gt;
[[Category:Clones]]&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Gate_Array&amp;diff=97359</id>
		<title>Gate Array</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Gate_Array&amp;diff=97359"/>
				<updated>2017-03-04T02:12:57Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: /* To calculate the colour value */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Gate Array &lt;br /&gt;
&lt;br /&gt;
Also designated as Video gate Array (VGA, not to be confused with IBM PC compatible graphic card spec).&lt;br /&gt;
&lt;br /&gt;
== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
The gate array is a specially designed chip exclusively for use in the Amstrad CPC and was designed by Amstrad plc. &lt;br /&gt;
&lt;br /&gt;
In the CPC+ system, the functions of the Gate-Array are integrated into a single [[ASIC|ASIC]]. When the ASIC is &amp;quot;locked&amp;quot;, the extra features are not available and the ASIC operates the same as the Gate-Array in the CPC allowing programs written for the CPC to work on the Plus without modification. The ASIC must be &amp;quot;un-locked&amp;quot; to access the new features. &lt;br /&gt;
&lt;br /&gt;
In the [[KC Compact]] system, the functions of the Gate-Array are &amp;quot;emulated&amp;quot; in TTL chips, [[CIO Overview|CIO]], and its color translation EPROM.&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;cost-down&amp;quot; version of the CPC6128, the functions of the Gate-Array are integrated into a ASIC. &lt;br /&gt;
&lt;br /&gt;
The Gate Array is described here is the one found in a standard CPC.&lt;br /&gt;
&lt;br /&gt;
== What does it do? ==&lt;br /&gt;
&lt;br /&gt;
The Gate Array is responsible for the display (colour palette, resolution, horizontal and vertical sync), interrupt generation and memory arrangement. &lt;br /&gt;
&lt;br /&gt;
== Controlling the Gate Array  ==&lt;br /&gt;
&lt;br /&gt;
The gate array is controlled by I/O. The gate array is selected when bit 15 of the I/O port address is set to &amp;quot;0&amp;quot; and bit 14 of the I/O port address is set to &amp;quot;1&amp;quot;. The values of the other bits are ignored. However, to avoid conflict with other devices in the system, these bits should be set to &amp;quot;1&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The recommended I/O port address is &amp;amp;amp;7Fxx. &lt;br /&gt;
&lt;br /&gt;
The function to be performed is selected by writing data to the Gate-Array, bit 7 and 6 of the data define the function selected (see table below). It is not possible to read from the Gate-Array. &lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
|''Data Bit 7''||''Data Bit 6''||''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Select pen&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || Select colour for selected pen&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || Select screen mode, ROM configuration and interrupt control&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || RAM Memory Management (note 1)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Note  =====&lt;br /&gt;
&lt;br /&gt;
This function is not available in the Gate-Array, but is performed by a device at the same I/O port address location. In the CPC464, CPC664 and KC compact, this function is performed in a memory-expansion (e.g. Dk'Tronics 64K RAM Expansion), if this expansion is not present then the function is not available. In the CPC6128, this function is performed by a [[PAL16L8|PAL]] located on the main PCB, or a memory-expansion. In the 464+ and 6128+ this function is performed by the ASIC or a memory expansion. Please read the document on RAM management for more information.&lt;br /&gt;
&lt;br /&gt;
== Register 0 - Palette Index (Pen selection) ==&lt;br /&gt;
&lt;br /&gt;
When bit 7 and bit 6 are set to &amp;quot;0&amp;quot;, the remaining bits determine which pen is to have its colour changed. When bit 4 is set to &amp;quot;0&amp;quot;, bits 3 to 0 define which pen is to be selected. When bit 4 is set to &amp;quot;1&amp;quot;, the value contained in bits 3-0 is ignored and the border is selected. &lt;br /&gt;
&lt;br /&gt;
The pen remains selected until another is chosen. &lt;br /&gt;
&lt;br /&gt;
Each mode has a fixed number of pens. Mode 0 has 16 pens, mode 1 has 4 pens and mode 2 has 2 pens. &lt;br /&gt;
&lt;br /&gt;
=== Summary  ===&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 0 || rowspan=&amp;quot;2&amp;quot; | Gate Array function &amp;quot;Pen Selection&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 0 &lt;br /&gt;
|-&lt;br /&gt;
| 5 || - || not used&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 1 || Select border&lt;br /&gt;
|-&lt;br /&gt;
| 3 || x || rowspan=&amp;quot;4&amp;quot; | Ignored&lt;br /&gt;
|-&lt;br /&gt;
| 2 || x&lt;br /&gt;
|-&lt;br /&gt;
| 1 || x&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 0 || rowspan=&amp;quot;2&amp;quot; | Gate Array function &amp;quot;Pen Selection&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 5 || - || not used&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 0 || Select pen&lt;br /&gt;
|-&lt;br /&gt;
| 3 || x || rowspan=&amp;quot;4&amp;quot; | Pen number&lt;br /&gt;
|-&lt;br /&gt;
| 2 || x&lt;br /&gt;
|-&lt;br /&gt;
| 1 || x&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Register 1 - Palette Data (Colour selection) ==&lt;br /&gt;
&lt;br /&gt;
Once the pen has been selected its colour can then be changed. Bits 4 to 0 specify the hardware colour number from the hardware colour palette. &lt;br /&gt;
&lt;br /&gt;
Even though there is provision for 32 colours, only 27 are possible. The remaining colours are duplicates of those already in the colour palette. &lt;br /&gt;
&lt;br /&gt;
=== Summary  ===&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 0 || rowspan=&amp;quot;2&amp;quot; | Gate Array function &amp;quot;Colour selection&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 5 || - || not used&lt;br /&gt;
|-&lt;br /&gt;
| 4 || x || rowspan=&amp;quot;5&amp;quot; | Colour number x&lt;br /&gt;
|-&lt;br /&gt;
| 3 || x &lt;br /&gt;
|-&lt;br /&gt;
| 2 || x &lt;br /&gt;
|-&lt;br /&gt;
| 1 || x&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Register 2 - Select screen mode and ROM configuration ==&lt;br /&gt;
&lt;br /&gt;
This is a general purpose register responsible for the [[Video modes|screen mode]] and the ROM configuration. &lt;br /&gt;
&lt;br /&gt;
=== Screen mode selection  ===&lt;br /&gt;
&lt;br /&gt;
The function of bits 1 and 0 is to define the screen mode. The settings for bits 1 and 0 and the corresponding screen mode are given in the table below. &lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit 1'' || ''Bit 0'' || ''Screen mode''&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Mode 0, 160x200 resolution, 16 colours&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || Mode 1, 320x200 resolution, 4 colours&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || Mode 2, 640x200 resolution, 2 colours&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || Mode 3, 160x200 resolution, 4 colours (undocumented)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Mode 3 is not official. From the combinations possible, we can see that 4 modes can be defined, although the Amstrad only has 3. Mode 3 is similar to mode 0, because it has the same resolution, but it is limited to only 4 colours. Mode 3 is not supported by the [[KC Compact]] (which outputs black in Mode 3).&lt;br /&gt;
&lt;br /&gt;
Mode changing is synchronised with HSYNC. If the mode is changed, it will take effect from the next HSYNC.&lt;br /&gt;
&lt;br /&gt;
=== ROM configuration selection  ===&lt;br /&gt;
&lt;br /&gt;
Bit 2 is used to enable or disable the lower ROM area. The lower ROM area occupies memory addresses &amp;amp;amp;0000-&amp;amp;amp;3fff and is used to access the operating system ROM. When the lower ROM area is is enabled, reading from &amp;amp;amp;0000-&amp;amp;amp;3FFF will return data in the ROM. When a value is written to &amp;amp;amp;0000-&amp;amp;amp;3FFF, it will be written to the RAM underneath the RAM. When it is disabled, data read from &amp;amp;amp;0000-&amp;amp;amp;3FFF will return the data in the RAM. &lt;br /&gt;
&lt;br /&gt;
Similarly, bit 3 controls enabling or disabling of the upper ROM area. The upper ROM area occupies memory addressess &amp;amp;amp;C000-&amp;amp;amp;FFFF and is BASIC or any expansion ROMs which may be plugged into a ROM board/box. See the document on [[Upper ROM Bank Number|upper rom selection]] for more details. When the upper ROM area enabled, reading from &amp;amp;amp;c000-&amp;amp;amp;ffff, will return data in the ROM. When data is written to &amp;amp;amp;c000-&amp;amp;amp;FFFF, it will be written to the RAM at the same address as the ROM. When the upper ROM area is disabled, and data is read from &amp;amp;amp;c000-&amp;amp;amp;ffff it will be the data in the RAM. &lt;br /&gt;
&lt;br /&gt;
Bit 4 controls the interrupt generation. It can be used to delay interrupts. See the document on interrupt generation for more information. &lt;br /&gt;
&lt;br /&gt;
=== Summary  ===&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 1 || rowspan=&amp;quot;2&amp;quot; | Gate Array function&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 0 &lt;br /&gt;
|-&lt;br /&gt;
| 5 || - || not used&lt;br /&gt;
|-&lt;br /&gt;
| 4 || x || Interrupt generation control&lt;br /&gt;
|-&lt;br /&gt;
| 3 || x || 1=Upper ROM area disable, 0=Upper ROM area enable&lt;br /&gt;
|-&lt;br /&gt;
| 2 || x || 1=Lower ROM area disable, 0=Lower ROM area enable&lt;br /&gt;
|-&lt;br /&gt;
| 1 || x || rowspan=&amp;quot;2&amp;quot; | Screen Mode slection&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Register 3 - RAM Banking ==&lt;br /&gt;
&lt;br /&gt;
This register exists only in CPCs with 128K RAM (like the CPC 6128, or CPCs with [[Standard Memory Expansions]]). Note: In the CPC 6128, the register is a separate PAL that assists the Gate Array chip.&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 1 || rowspan=&amp;quot;2&amp;quot; | Gate Array function 3&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 1 &lt;br /&gt;
|-&lt;br /&gt;
| 5 || b || rowspan=&amp;quot;3&amp;quot; |64K bank number (0..7); always 0 on an unexpanded CPC6128, 0-7 on [[Standard Memory Expansions]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || b&lt;br /&gt;
|-&lt;br /&gt;
| 3 || b&lt;br /&gt;
|-&lt;br /&gt;
| 2 || x || rowspan=&amp;quot;3&amp;quot; | RAM Config (0..7)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || x&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The 3bit RAM Config value is used to access the second 64K of the total 128K RAM that is built into the CPC 6128 or the additional 64K-512K of standard memory expansions. These contain up to eight 64K ram banks, which are selected with bit 3-5. A standard CPC 6128 only contains bank 0. Normally the register is set to 0, so that only the first 64K RAM are used (identical to the CPC 464 and 664 models). The register can be used to select between the following eight predefined configurations only:&lt;br /&gt;
&lt;br /&gt;
  -Address-     0      1      2      3      4      5      6      7&lt;br /&gt;
  0000-3FFF   RAM_0  RAM_0  RAM_4  RAM_0  RAM_0  RAM_0  RAM_0  RAM_0&lt;br /&gt;
  4000-7FFF   RAM_1  RAM_1  RAM_5  RAM_3  RAM_4  RAM_5  RAM_6  RAM_7&lt;br /&gt;
  8000-BFFF   RAM_2  RAM_2  RAM_6  RAM_2  RAM_2  RAM_2  RAM_2  RAM_2&lt;br /&gt;
  C000-FFFF   RAM_3  RAM_7  RAM_7  RAM_7  RAM_3  RAM_3  RAM_3  RAM_3&lt;br /&gt;
&lt;br /&gt;
The Video RAM is always located in the first 64K, VRAM is in no way affected by this register.&lt;br /&gt;
&lt;br /&gt;
== Programming the Gate Array - Examples  ==&lt;br /&gt;
&lt;br /&gt;
Defining the colours, &amp;lt;br&amp;gt;Setting pen 0 to Bright White. &lt;br /&gt;
&amp;lt;pre&amp;gt;LD BC,7F00&amp;amp;nbsp;;Gate Array port&lt;br /&gt;
LD A,%00000000+0&amp;amp;nbsp;;Pen number (and Gate Array function)&lt;br /&gt;
OUT (C),A&amp;amp;nbsp;;Send pen number&lt;br /&gt;
LD A,%01000000+11&amp;amp;nbsp;;Pen colour (and Gate Array function)&lt;br /&gt;
OUT (C),A&amp;amp;nbsp;;Send it&lt;br /&gt;
RET&lt;br /&gt;
&lt;br /&gt;
Setting the mode and ROM configuration, &lt;br /&gt;
Mode 2, upper and lower ROM disabled.&lt;br /&gt;
&lt;br /&gt;
LD BC,7F00&amp;amp;nbsp;;Gate array port&lt;br /&gt;
LD A,%10000000+%00001110&amp;amp;nbsp;;Mode and ROM selection (and Gate Array function)&lt;br /&gt;
OUT (C),A&amp;amp;nbsp;;Send it&lt;br /&gt;
RET&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
&lt;br /&gt;
The hardware colour number is different to the colour range used by the firmware, so a conversion chart is provided for the corresponding firmware/hardware colour values and the corresponding colour name. &lt;br /&gt;
&lt;br /&gt;
=== Note ===&lt;br /&gt;
&lt;br /&gt;
The firmware keeps track of the colours it is using. Every VSYNC (assuming interrupts are enabled) the firmware sets the colours. This enables the user to have flashing colours. If the user selects a new colour using the gate array, the new colour will flash temporarily and then return to its original colour. This is due to the firmware resetting the colour. When using the firmware, use its routines to select the colour, and the colour will remain.&lt;br /&gt;
&lt;br /&gt;
Example: [For whatever reason, this example does NOT refer to the above firmware stuff]&lt;br /&gt;
&amp;lt;pre&amp;gt;ld bc,7f00+1&amp;amp;nbsp;;Gate array function (set pen)&lt;br /&gt;
;and pen number&lt;br /&gt;
out (c),c&lt;br /&gt;
ld bc,7f00&amp;amp;nbsp;;41 &lt;br /&gt;
;Gate array function (set colour)&lt;br /&gt;
;and colour number&lt;br /&gt;
out (c),c&lt;br /&gt;
ret&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Palette R,G,B definitions ==&lt;br /&gt;
&lt;br /&gt;
There are 27 colours which are generated from red, green and blue mixed in different quantities. There are 3 levels of red, 3 levels of green and 3 levels of blue, and these can be thought of as off/no colour, half-on/half-colour, and on/full-colour. &lt;br /&gt;
&lt;br /&gt;
To display a CPC image you will need to use a analogue monitor with a composite sync. &lt;br /&gt;
&lt;br /&gt;
=== Palette sorted by Hardware Colour Numbers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ''Hardware Number||Firmware Number|| ''Colour Name'' &lt;br /&gt;
| ''R&amp;amp;nbsp;%'' || ''G&amp;amp;nbsp;%'' || ''B&amp;amp;nbsp;%'' || ''Colour''&lt;br /&gt;
|-&lt;br /&gt;
|  0 (40h) || 13   || White         || 50|| 50|| 50|| bgcolor=&amp;quot;#808080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  1 (41h) || (13) || White         || 50|| 50|| 50|| bgcolor=&amp;quot;#808080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  2 (42h) || 19   || Sea Green     ||  0||100|| 50|| bgcolor=&amp;quot;#00ff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  3 (43h) || 25   || Pastel Yellow ||100||100|| 50|| bgcolor=&amp;quot;#ffff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  4 (44h) || 1    || Blue          ||  0||  0|| 50|| bgcolor=&amp;quot;#000080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  5 (45h) || 7    || Purple        ||100||  0|| 50|| bgcolor=&amp;quot;#ff0080&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|  6 (46h) || 10   || Cyan          ||  0|| 50|| 50|| bgcolor=&amp;quot;#008080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  7 (47h) || 16   || Pink          ||100|| 50|| 50|| bgcolor=&amp;quot;#ff8080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  8 (48h) || (7)  || Purple        ||100||  0|| 50|| bgcolor=&amp;quot;#ff0080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  9 (49h) || (25) || Pastel Yellow ||100||100|| 50|| bgcolor=&amp;quot;#ffff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 10 (4Ah) || 24   || Bright Yellow ||100||100||  0|| bgcolor=&amp;quot;#ffff00&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 11 (4Bh) || 26   || Bright White  ||100||100||100|| bgcolor=&amp;quot;#ffffff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 12 (4Ch) || 6    || Bright Red    ||100||  0||  0|| bgcolor=&amp;quot;#ff0000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 13 (4Dh) || 8    || Bright Magenta||100||  0||100|| bgcolor=&amp;quot;#ff00ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 14 (4Eh) || 15   || Orange        ||100|| 50||  0|| bgcolor=&amp;quot;#ff8000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 15 (4Fh) || 17   || Pastel Magenta||100|| 50||100|| bgcolor=&amp;quot;#ff80ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 16 (50h) || (1)  || Blue          ||  0||  0|| 50|| bgcolor=&amp;quot;#000080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 17 (51h) || (19) || Sea Green     ||  0||100|| 50|| bgcolor=&amp;quot;#00ff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 18 (52h) || 18   || Bright Green  ||  0||100||  0|| bgcolor=&amp;quot;#00ff00&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 19 (53h) || 20   || Bright Cyan   ||  0||100||100|| bgcolor=&amp;quot;#00ffff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 20 (54h) || 0    || Black         ||  0||  0||  0|| bgcolor=&amp;quot;#000000&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| 21 (55h) || 2    || Bright Blue   ||  0||  0||100|| bgcolor=&amp;quot;#0000ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 22 (56h) || 9    || Green         ||  0|| 50||  0|| bgcolor=&amp;quot;#008000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 23 (57h) || 11   || Sky Blue      ||  0|| 50||100|| bgcolor=&amp;quot;#0080ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 24 (58h) || 4    || Magenta       || 50||  0|| 50|| bgcolor=&amp;quot;#800080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 25 (59h) || 22   || Pastel Green  || 50||100|| 50|| bgcolor=&amp;quot;#80ff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 26 (5Ah) || 21   || Lime          || 50||100||  0|| bgcolor=&amp;quot;#80ff00&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 27 (5Bh) || 23   || Pastel Cyan   || 50||100||100|| bgcolor=&amp;quot;#80ffff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 28 (5Ch) || 3    || Red           || 50||  0||  0|| bgcolor=&amp;quot;#800000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 29 (5Dh) || 5    || Mauve         || 50||  0||100|| bgcolor=&amp;quot;#8000ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 30 (5Eh) || 12   || Yellow        || 50|| 50||  0|| bgcolor=&amp;quot;#808000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 31 (5Fh) || 14   || Pastel Blue   || 50|| 50||100|| bgcolor=&amp;quot;#8080ff&amp;quot; | &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Palette sorted by Firmware Colour Numbers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ''Firmware Number'' || ''Hardware Number'' || ''Colour Name'' &lt;br /&gt;
| ''R&amp;amp;nbsp;%'' || ''G&amp;amp;nbsp;%'' || ''B&amp;amp;nbsp;%'' || ''Colour''&lt;br /&gt;
|-&lt;br /&gt;
| 0|| 54h          ||Black          ||  0||  0||  0||bgcolor=&amp;quot;#000000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 1|| 44h (or 50h) ||Blue           ||  0||  0|| 50||bgcolor=&amp;quot;#000080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 2|| 55h          ||Bright Blue    ||  0||  0||100||bgcolor=&amp;quot;#0000ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 3|| 5Ch          ||Red            || 50||  0||  0||bgcolor=&amp;quot;#800000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 4|| 58h          ||Magenta        || 50||  0|| 50||bgcolor=&amp;quot;#800080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 5|| 5Dh          ||Mauve          || 50||  0||100||bgcolor=&amp;quot;#8000ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 6|| 4Ch          ||Bright Red     ||100||  0||  0||bgcolor=&amp;quot;#ff0000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 7|| 45h (or 48h) ||Purple         ||100||  0|| 50||bgcolor=&amp;quot;#ff0080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 8|| 4Dh          ||Bright Magenta ||100||  0||100||bgcolor=&amp;quot;#ff00ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 9|| 56h          ||Green          ||  0|| 50||  0||bgcolor=&amp;quot;#008000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|10|| 46h          ||Cyan           ||  0|| 50|| 50||bgcolor=&amp;quot;#008080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|11|| 57h          ||Sky Blue       ||  0|| 50||100||bgcolor=&amp;quot;#0080ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|12|| 5Eh          ||Yellow         || 50|| 50||  0||bgcolor=&amp;quot;#808000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|13|| 40h (or 41h) ||White          || 50|| 50|| 50||bgcolor=&amp;quot;#808080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|14|| 5Fh          ||Pastel Blue    || 50|| 50||100||bgcolor=&amp;quot;#8080ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|15|| 4Eh          ||Orange         ||100|| 50||  0||bgcolor=&amp;quot;#ff8000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|16|| 47h          ||Pink           ||100|| 50|| 50||bgcolor=&amp;quot;#ff8080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|17|| 4Fh          ||Pastel Magenta ||100|| 50||100||bgcolor=&amp;quot;#ff80ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|18|| 52h          ||Bright Green   ||  0||100||  0||bgcolor=&amp;quot;#00ff00&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|19|| 42h (or 51h) ||Sea Green      ||  0||100|| 50||bgcolor=&amp;quot;#00ff80&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|20|| 53h          ||Bright Cyan    ||  0||100||100||bgcolor=&amp;quot;#00ffff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|21|| 5Ah          ||Lime           || 50||100||  0||bgcolor=&amp;quot;#80ff00&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|22|| 59h          ||Pastel Green   || 50||100|| 50||bgcolor=&amp;quot;#80ff80&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|23|| 5Bh          ||Pastel Cyan    || 50||100||100||bgcolor=&amp;quot;#80ffff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|24|| 4Ah          ||Bright Yellow  ||100||100||  0||bgcolor=&amp;quot;#ffff00&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|25|| 43h (or 49h) ||Pastel Yellow  ||100||100|| 50||bgcolor=&amp;quot;#ffff80&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|26|| 4Bh          ||Bright White   ||100||100||100||bgcolor=&amp;quot;#ffffff&amp;quot;|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Intensities ===&lt;br /&gt;
&lt;br /&gt;
The 0%, 50%, and 100% values in the above tables are &amp;quot;should-be&amp;quot; values. However, the real hardware doesn't exactly match that intensities. The actual intensities depend on the luminance mixing (R,G,B tied together via resistors), on chipset (classic CPC, or newer ASIC ones), and on the load applied by external hardware (Monitor, or TV set).&lt;br /&gt;
* [[CPC Palette]] - some more details&lt;br /&gt;
&lt;br /&gt;
=== To calculate the colour value ===&lt;br /&gt;
&lt;br /&gt;
'''Red''' &lt;br /&gt;
&lt;br /&gt;
0% =&amp;amp;gt; do not add anything &lt;br /&gt;
&lt;br /&gt;
50% =&amp;amp;gt; add 3 &lt;br /&gt;
&lt;br /&gt;
100% =&amp;amp;gt; add 6 &lt;br /&gt;
&lt;br /&gt;
'''Green''' &lt;br /&gt;
&lt;br /&gt;
0% =&amp;amp;gt; do not add anything &lt;br /&gt;
&lt;br /&gt;
50% =&amp;amp;gt; add 9 &lt;br /&gt;
&lt;br /&gt;
100% =&amp;amp;gt; add 18 &lt;br /&gt;
&lt;br /&gt;
'''Blue''' &lt;br /&gt;
&lt;br /&gt;
0% =&amp;amp;gt; do not add anything &lt;br /&gt;
&lt;br /&gt;
50% =&amp;amp;gt; add 1 &lt;br /&gt;
&lt;br /&gt;
100% =&amp;amp;gt; add 2 &lt;br /&gt;
&lt;br /&gt;
=== Green Screen Colours ===&lt;br /&gt;
&lt;br /&gt;
On a green screen (where all colours are shades of green), the colours (in the software/firmware colours), are in order of increasing intensity. Black is very dark, and white is bright green, and colour 13 is a medium green. (Thanks to [[Mark Rison|Mark Rison]] for this information)&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:40010_am2_metal.jpg|40010 GA Metal Layer&lt;br /&gt;
Image:40010_am2_acid.jpg|40010 GA with Metal Layer removed&lt;br /&gt;
Image:40226_am4_metal.jpg|40226 PreASIC Metal Layer&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Gate Array and ASIC Pin-Outs]]&lt;br /&gt;
&lt;br /&gt;
*[[Video modes]] : for other informations on colours and pixels.&lt;br /&gt;
&lt;br /&gt;
*[[CRTC]] : the other video stuff.&lt;br /&gt;
*[[ASIC]] : for Plus users&lt;br /&gt;
&lt;br /&gt;
*[[Synchronising with the CRTC and display]] : technical details on the relationship between Gate Array and CRTC.&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]][[Category:Programming]][[Category:Datasheet]][[Category:Graphic]][[Category:CPC Internal Components]][[Category:Electronic Component]]&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Gate_Array&amp;diff=97358</id>
		<title>Gate Array</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Gate_Array&amp;diff=97358"/>
				<updated>2017-03-04T02:12:12Z</updated>
		
		<summary type="html">&lt;p&gt;Dingo: /* Palette R,G,B definitions */ BE; subtitle&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Gate Array &lt;br /&gt;
&lt;br /&gt;
Also designated as Video gate Array (VGA, not to be confused with IBM PC compatible graphic card spec).&lt;br /&gt;
&lt;br /&gt;
== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
The gate array is a specially designed chip exclusively for use in the Amstrad CPC and was designed by Amstrad plc. &lt;br /&gt;
&lt;br /&gt;
In the CPC+ system, the functions of the Gate-Array are integrated into a single [[ASIC|ASIC]]. When the ASIC is &amp;quot;locked&amp;quot;, the extra features are not available and the ASIC operates the same as the Gate-Array in the CPC allowing programs written for the CPC to work on the Plus without modification. The ASIC must be &amp;quot;un-locked&amp;quot; to access the new features. &lt;br /&gt;
&lt;br /&gt;
In the [[KC Compact]] system, the functions of the Gate-Array are &amp;quot;emulated&amp;quot; in TTL chips, [[CIO Overview|CIO]], and its color translation EPROM.&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;cost-down&amp;quot; version of the CPC6128, the functions of the Gate-Array are integrated into a ASIC. &lt;br /&gt;
&lt;br /&gt;
The Gate Array is described here is the one found in a standard CPC.&lt;br /&gt;
&lt;br /&gt;
== What does it do? ==&lt;br /&gt;
&lt;br /&gt;
The Gate Array is responsible for the display (colour palette, resolution, horizontal and vertical sync), interrupt generation and memory arrangement. &lt;br /&gt;
&lt;br /&gt;
== Controlling the Gate Array  ==&lt;br /&gt;
&lt;br /&gt;
The gate array is controlled by I/O. The gate array is selected when bit 15 of the I/O port address is set to &amp;quot;0&amp;quot; and bit 14 of the I/O port address is set to &amp;quot;1&amp;quot;. The values of the other bits are ignored. However, to avoid conflict with other devices in the system, these bits should be set to &amp;quot;1&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
The recommended I/O port address is &amp;amp;amp;7Fxx. &lt;br /&gt;
&lt;br /&gt;
The function to be performed is selected by writing data to the Gate-Array, bit 7 and 6 of the data define the function selected (see table below). It is not possible to read from the Gate-Array. &lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
|''Data Bit 7''||''Data Bit 6''||''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Select pen&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || Select colour for selected pen&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || Select screen mode, ROM configuration and interrupt control&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || RAM Memory Management (note 1)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Note  =====&lt;br /&gt;
&lt;br /&gt;
This function is not available in the Gate-Array, but is performed by a device at the same I/O port address location. In the CPC464, CPC664 and KC compact, this function is performed in a memory-expansion (e.g. Dk'Tronics 64K RAM Expansion), if this expansion is not present then the function is not available. In the CPC6128, this function is performed by a [[PAL16L8|PAL]] located on the main PCB, or a memory-expansion. In the 464+ and 6128+ this function is performed by the ASIC or a memory expansion. Please read the document on RAM management for more information.&lt;br /&gt;
&lt;br /&gt;
== Register 0 - Palette Index (Pen selection) ==&lt;br /&gt;
&lt;br /&gt;
When bit 7 and bit 6 are set to &amp;quot;0&amp;quot;, the remaining bits determine which pen is to have its colour changed. When bit 4 is set to &amp;quot;0&amp;quot;, bits 3 to 0 define which pen is to be selected. When bit 4 is set to &amp;quot;1&amp;quot;, the value contained in bits 3-0 is ignored and the border is selected. &lt;br /&gt;
&lt;br /&gt;
The pen remains selected until another is chosen. &lt;br /&gt;
&lt;br /&gt;
Each mode has a fixed number of pens. Mode 0 has 16 pens, mode 1 has 4 pens and mode 2 has 2 pens. &lt;br /&gt;
&lt;br /&gt;
=== Summary  ===&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 0 || rowspan=&amp;quot;2&amp;quot; | Gate Array function &amp;quot;Pen Selection&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 0 &lt;br /&gt;
|-&lt;br /&gt;
| 5 || - || not used&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 1 || Select border&lt;br /&gt;
|-&lt;br /&gt;
| 3 || x || rowspan=&amp;quot;4&amp;quot; | Ignored&lt;br /&gt;
|-&lt;br /&gt;
| 2 || x&lt;br /&gt;
|-&lt;br /&gt;
| 1 || x&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 0 || rowspan=&amp;quot;2&amp;quot; | Gate Array function &amp;quot;Pen Selection&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 5 || - || not used&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 0 || Select pen&lt;br /&gt;
|-&lt;br /&gt;
| 3 || x || rowspan=&amp;quot;4&amp;quot; | Pen number&lt;br /&gt;
|-&lt;br /&gt;
| 2 || x&lt;br /&gt;
|-&lt;br /&gt;
| 1 || x&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Register 1 - Palette Data (Colour selection) ==&lt;br /&gt;
&lt;br /&gt;
Once the pen has been selected its colour can then be changed. Bits 4 to 0 specify the hardware colour number from the hardware colour palette. &lt;br /&gt;
&lt;br /&gt;
Even though there is provision for 32 colours, only 27 are possible. The remaining colours are duplicates of those already in the colour palette. &lt;br /&gt;
&lt;br /&gt;
=== Summary  ===&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 0 || rowspan=&amp;quot;2&amp;quot; | Gate Array function &amp;quot;Colour selection&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 5 || - || not used&lt;br /&gt;
|-&lt;br /&gt;
| 4 || x || rowspan=&amp;quot;5&amp;quot; | Colour number x&lt;br /&gt;
|-&lt;br /&gt;
| 3 || x &lt;br /&gt;
|-&lt;br /&gt;
| 2 || x &lt;br /&gt;
|-&lt;br /&gt;
| 1 || x&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Register 2 - Select screen mode and ROM configuration ==&lt;br /&gt;
&lt;br /&gt;
This is a general purpose register responsible for the [[Video modes|screen mode]] and the ROM configuration. &lt;br /&gt;
&lt;br /&gt;
=== Screen mode selection  ===&lt;br /&gt;
&lt;br /&gt;
The function of bits 1 and 0 is to define the screen mode. The settings for bits 1 and 0 and the corresponding screen mode are given in the table below. &lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit 1'' || ''Bit 0'' || ''Screen mode''&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || Mode 0, 160x200 resolution, 16 colours&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || Mode 1, 320x200 resolution, 4 colours&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || Mode 2, 640x200 resolution, 2 colours&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || Mode 3, 160x200 resolution, 4 colours (undocumented)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Mode 3 is not official. From the combinations possible, we can see that 4 modes can be defined, although the Amstrad only has 3. Mode 3 is similar to mode 0, because it has the same resolution, but it is limited to only 4 colours. Mode 3 is not supported by the [[KC Compact]] (which outputs black in Mode 3).&lt;br /&gt;
&lt;br /&gt;
Mode changing is synchronised with HSYNC. If the mode is changed, it will take effect from the next HSYNC.&lt;br /&gt;
&lt;br /&gt;
=== ROM configuration selection  ===&lt;br /&gt;
&lt;br /&gt;
Bit 2 is used to enable or disable the lower ROM area. The lower ROM area occupies memory addresses &amp;amp;amp;0000-&amp;amp;amp;3fff and is used to access the operating system ROM. When the lower ROM area is is enabled, reading from &amp;amp;amp;0000-&amp;amp;amp;3FFF will return data in the ROM. When a value is written to &amp;amp;amp;0000-&amp;amp;amp;3FFF, it will be written to the RAM underneath the RAM. When it is disabled, data read from &amp;amp;amp;0000-&amp;amp;amp;3FFF will return the data in the RAM. &lt;br /&gt;
&lt;br /&gt;
Similarly, bit 3 controls enabling or disabling of the upper ROM area. The upper ROM area occupies memory addressess &amp;amp;amp;C000-&amp;amp;amp;FFFF and is BASIC or any expansion ROMs which may be plugged into a ROM board/box. See the document on [[Upper ROM Bank Number|upper rom selection]] for more details. When the upper ROM area enabled, reading from &amp;amp;amp;c000-&amp;amp;amp;ffff, will return data in the ROM. When data is written to &amp;amp;amp;c000-&amp;amp;amp;FFFF, it will be written to the RAM at the same address as the ROM. When the upper ROM area is disabled, and data is read from &amp;amp;amp;c000-&amp;amp;amp;ffff it will be the data in the RAM. &lt;br /&gt;
&lt;br /&gt;
Bit 4 controls the interrupt generation. It can be used to delay interrupts. See the document on interrupt generation for more information. &lt;br /&gt;
&lt;br /&gt;
=== Summary  ===&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 1 || rowspan=&amp;quot;2&amp;quot; | Gate Array function&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 0 &lt;br /&gt;
|-&lt;br /&gt;
| 5 || - || not used&lt;br /&gt;
|-&lt;br /&gt;
| 4 || x || Interrupt generation control&lt;br /&gt;
|-&lt;br /&gt;
| 3 || x || 1=Upper ROM area disable, 0=Upper ROM area enable&lt;br /&gt;
|-&lt;br /&gt;
| 2 || x || 1=Lower ROM area disable, 0=Lower ROM area enable&lt;br /&gt;
|-&lt;br /&gt;
| 1 || x || rowspan=&amp;quot;2&amp;quot; | Screen Mode slection&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Register 3 - RAM Banking ==&lt;br /&gt;
&lt;br /&gt;
This register exists only in CPCs with 128K RAM (like the CPC 6128, or CPCs with [[Standard Memory Expansions]]). Note: In the CPC 6128, the register is a separate PAL that assists the Gate Array chip.&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|-&lt;br /&gt;
| ''Bit'' || ''Value'' || ''Function''&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 1 || rowspan=&amp;quot;2&amp;quot; | Gate Array function 3&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 1 &lt;br /&gt;
|-&lt;br /&gt;
| 5 || b || rowspan=&amp;quot;3&amp;quot; |64K bank number (0..7); always 0 on an unexpanded CPC6128, 0-7 on [[Standard Memory Expansions]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || b&lt;br /&gt;
|-&lt;br /&gt;
| 3 || b&lt;br /&gt;
|-&lt;br /&gt;
| 2 || x || rowspan=&amp;quot;3&amp;quot; | RAM Config (0..7)&lt;br /&gt;
|-&lt;br /&gt;
| 1 || x&lt;br /&gt;
|-&lt;br /&gt;
| 0 || x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The 3bit RAM Config value is used to access the second 64K of the total 128K RAM that is built into the CPC 6128 or the additional 64K-512K of standard memory expansions. These contain up to eight 64K ram banks, which are selected with bit 3-5. A standard CPC 6128 only contains bank 0. Normally the register is set to 0, so that only the first 64K RAM are used (identical to the CPC 464 and 664 models). The register can be used to select between the following eight predefined configurations only:&lt;br /&gt;
&lt;br /&gt;
  -Address-     0      1      2      3      4      5      6      7&lt;br /&gt;
  0000-3FFF   RAM_0  RAM_0  RAM_4  RAM_0  RAM_0  RAM_0  RAM_0  RAM_0&lt;br /&gt;
  4000-7FFF   RAM_1  RAM_1  RAM_5  RAM_3  RAM_4  RAM_5  RAM_6  RAM_7&lt;br /&gt;
  8000-BFFF   RAM_2  RAM_2  RAM_6  RAM_2  RAM_2  RAM_2  RAM_2  RAM_2&lt;br /&gt;
  C000-FFFF   RAM_3  RAM_7  RAM_7  RAM_7  RAM_3  RAM_3  RAM_3  RAM_3&lt;br /&gt;
&lt;br /&gt;
The Video RAM is always located in the first 64K, VRAM is in no way affected by this register.&lt;br /&gt;
&lt;br /&gt;
== Programming the Gate Array - Examples  ==&lt;br /&gt;
&lt;br /&gt;
Defining the colours, &amp;lt;br&amp;gt;Setting pen 0 to Bright White. &lt;br /&gt;
&amp;lt;pre&amp;gt;LD BC,7F00&amp;amp;nbsp;;Gate Array port&lt;br /&gt;
LD A,%00000000+0&amp;amp;nbsp;;Pen number (and Gate Array function)&lt;br /&gt;
OUT (C),A&amp;amp;nbsp;;Send pen number&lt;br /&gt;
LD A,%01000000+11&amp;amp;nbsp;;Pen colour (and Gate Array function)&lt;br /&gt;
OUT (C),A&amp;amp;nbsp;;Send it&lt;br /&gt;
RET&lt;br /&gt;
&lt;br /&gt;
Setting the mode and ROM configuration, &lt;br /&gt;
Mode 2, upper and lower ROM disabled.&lt;br /&gt;
&lt;br /&gt;
LD BC,7F00&amp;amp;nbsp;;Gate array port&lt;br /&gt;
LD A,%10000000+%00001110&amp;amp;nbsp;;Mode and ROM selection (and Gate Array function)&lt;br /&gt;
OUT (C),A&amp;amp;nbsp;;Send it&lt;br /&gt;
RET&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
&lt;br /&gt;
The hardware colour number is different to the colour range used by the firmware, so a conversion chart is provided for the corresponding firmware/hardware colour values and the corresponding colour name. &lt;br /&gt;
&lt;br /&gt;
=== Note ===&lt;br /&gt;
&lt;br /&gt;
The firmware keeps track of the colours it is using. Every VSYNC (assuming interrupts are enabled) the firmware sets the colours. This enables the user to have flashing colours. If the user selects a new colour using the gate array, the new colour will flash temporarily and then return to its original colour. This is due to the firmware resetting the colour. When using the firmware, use its routines to select the colour, and the colour will remain.&lt;br /&gt;
&lt;br /&gt;
Example: [For whatever reason, this example does NOT refer to the above firmware stuff]&lt;br /&gt;
&amp;lt;pre&amp;gt;ld bc,7f00+1&amp;amp;nbsp;;Gate array function (set pen)&lt;br /&gt;
;and pen number&lt;br /&gt;
out (c),c&lt;br /&gt;
ld bc,7f00&amp;amp;nbsp;;41 &lt;br /&gt;
;Gate array function (set colour)&lt;br /&gt;
;and colour number&lt;br /&gt;
out (c),c&lt;br /&gt;
ret&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Palette R,G,B definitions ==&lt;br /&gt;
&lt;br /&gt;
There are 27 colours which are generated from red, green and blue mixed in different quantities. There are 3 levels of red, 3 levels of green and 3 levels of blue, and these can be thought of as off/no colour, half-on/half-colour, and on/full-colour. &lt;br /&gt;
&lt;br /&gt;
To display a CPC image you will need to use a analogue monitor with a composite sync. &lt;br /&gt;
&lt;br /&gt;
=== Palette sorted by Hardware Colour Numbers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ''Hardware Number||Firmware Number|| ''Colour Name'' &lt;br /&gt;
| ''R&amp;amp;nbsp;%'' || ''G&amp;amp;nbsp;%'' || ''B&amp;amp;nbsp;%'' || ''Colour''&lt;br /&gt;
|-&lt;br /&gt;
|  0 (40h) || 13   || White         || 50|| 50|| 50|| bgcolor=&amp;quot;#808080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  1 (41h) || (13) || White         || 50|| 50|| 50|| bgcolor=&amp;quot;#808080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  2 (42h) || 19   || Sea Green     ||  0||100|| 50|| bgcolor=&amp;quot;#00ff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  3 (43h) || 25   || Pastel Yellow ||100||100|| 50|| bgcolor=&amp;quot;#ffff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  4 (44h) || 1    || Blue          ||  0||  0|| 50|| bgcolor=&amp;quot;#000080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  5 (45h) || 7    || Purple        ||100||  0|| 50|| bgcolor=&amp;quot;#ff0080&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|  6 (46h) || 10   || Cyan          ||  0|| 50|| 50|| bgcolor=&amp;quot;#008080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  7 (47h) || 16   || Pink          ||100|| 50|| 50|| bgcolor=&amp;quot;#ff8080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  8 (48h) || (7)  || Purple        ||100||  0|| 50|| bgcolor=&amp;quot;#ff0080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
|  9 (49h) || (25) || Pastel Yellow ||100||100|| 50|| bgcolor=&amp;quot;#ffff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 10 (4Ah) || 24   || Bright Yellow ||100||100||  0|| bgcolor=&amp;quot;#ffff00&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 11 (4Bh) || 26   || Bright White  ||100||100||100|| bgcolor=&amp;quot;#ffffff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 12 (4Ch) || 6    || Bright Red    ||100||  0||  0|| bgcolor=&amp;quot;#ff0000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 13 (4Dh) || 8    || Bright Magenta||100||  0||100|| bgcolor=&amp;quot;#ff00ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 14 (4Eh) || 15   || Orange        ||100|| 50||  0|| bgcolor=&amp;quot;#ff8000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 15 (4Fh) || 17   || Pastel Magenta||100|| 50||100|| bgcolor=&amp;quot;#ff80ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 16 (50h) || (1)  || Blue          ||  0||  0|| 50|| bgcolor=&amp;quot;#000080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 17 (51h) || (19) || Sea Green     ||  0||100|| 50|| bgcolor=&amp;quot;#00ff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 18 (52h) || 18   || Bright Green  ||  0||100||  0|| bgcolor=&amp;quot;#00ff00&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 19 (53h) || 20   || Bright Cyan   ||  0||100||100|| bgcolor=&amp;quot;#00ffff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 20 (54h) || 0    || Black         ||  0||  0||  0|| bgcolor=&amp;quot;#000000&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| 21 (55h) || 2    || Bright Blue   ||  0||  0||100|| bgcolor=&amp;quot;#0000ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 22 (56h) || 9    || Green         ||  0|| 50||  0|| bgcolor=&amp;quot;#008000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 23 (57h) || 11   || Sky Blue      ||  0|| 50||100|| bgcolor=&amp;quot;#0080ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 24 (58h) || 4    || Magenta       || 50||  0|| 50|| bgcolor=&amp;quot;#800080&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 25 (59h) || 22   || Pastel Green  || 50||100|| 50|| bgcolor=&amp;quot;#80ff80&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 26 (5Ah) || 21   || Lime          || 50||100||  0|| bgcolor=&amp;quot;#80ff00&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 27 (5Bh) || 23   || Pastel Cyan   || 50||100||100|| bgcolor=&amp;quot;#80ffff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 28 (5Ch) || 3    || Red           || 50||  0||  0|| bgcolor=&amp;quot;#800000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 29 (5Dh) || 5    || Mauve         || 50||  0||100|| bgcolor=&amp;quot;#8000ff&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 30 (5Eh) || 12   || Yellow        || 50|| 50||  0|| bgcolor=&amp;quot;#808000&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| 31 (5Fh) || 14   || Pastel Blue   || 50|| 50||100|| bgcolor=&amp;quot;#8080ff&amp;quot; | &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Palette sorted by Firmware Colour Numbers ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ''Firmware Number'' || ''Hardware Number'' || ''Colour Name'' &lt;br /&gt;
| ''R&amp;amp;nbsp;%'' || ''G&amp;amp;nbsp;%'' || ''B&amp;amp;nbsp;%'' || ''Colour''&lt;br /&gt;
|-&lt;br /&gt;
| 0|| 54h          ||Black          ||  0||  0||  0||bgcolor=&amp;quot;#000000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 1|| 44h (or 50h) ||Blue           ||  0||  0|| 50||bgcolor=&amp;quot;#000080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 2|| 55h          ||Bright Blue    ||  0||  0||100||bgcolor=&amp;quot;#0000ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 3|| 5Ch          ||Red            || 50||  0||  0||bgcolor=&amp;quot;#800000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 4|| 58h          ||Magenta        || 50||  0|| 50||bgcolor=&amp;quot;#800080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 5|| 5Dh          ||Mauve          || 50||  0||100||bgcolor=&amp;quot;#8000ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 6|| 4Ch          ||Bright Red     ||100||  0||  0||bgcolor=&amp;quot;#ff0000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 7|| 45h (or 48h) ||Purple         ||100||  0|| 50||bgcolor=&amp;quot;#ff0080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 8|| 4Dh          ||Bright Magenta ||100||  0||100||bgcolor=&amp;quot;#ff00ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| 9|| 56h          ||Green          ||  0|| 50||  0||bgcolor=&amp;quot;#008000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|10|| 46h          ||Cyan           ||  0|| 50|| 50||bgcolor=&amp;quot;#008080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|11|| 57h          ||Sky Blue       ||  0|| 50||100||bgcolor=&amp;quot;#0080ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|12|| 5Eh          ||Yellow         || 50|| 50||  0||bgcolor=&amp;quot;#808000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|13|| 40h (or 41h) ||White          || 50|| 50|| 50||bgcolor=&amp;quot;#808080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|14|| 5Fh          ||Pastel Blue    || 50|| 50||100||bgcolor=&amp;quot;#8080ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|15|| 4Eh          ||Orange         ||100|| 50||  0||bgcolor=&amp;quot;#ff8000&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|16|| 47h          ||Pink           ||100|| 50|| 50||bgcolor=&amp;quot;#ff8080&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|17|| 4Fh          ||Pastel Magenta ||100|| 50||100||bgcolor=&amp;quot;#ff80ff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|18|| 52h          ||Bright Green   ||  0||100||  0||bgcolor=&amp;quot;#00ff00&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|19|| 42h (or 51h) ||Sea Green      ||  0||100|| 50||bgcolor=&amp;quot;#00ff80&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|20|| 53h          ||Bright Cyan    ||  0||100||100||bgcolor=&amp;quot;#00ffff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|21|| 5Ah          ||Lime           || 50||100||  0||bgcolor=&amp;quot;#80ff00&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|22|| 59h          ||Pastel Green   || 50||100|| 50||bgcolor=&amp;quot;#80ff80&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|23|| 5Bh          ||Pastel Cyan    || 50||100||100||bgcolor=&amp;quot;#80ffff&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|24|| 4Ah          ||Bright Yellow  ||100||100||  0||bgcolor=&amp;quot;#ffff00&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|25|| 43h (or 49h) ||Pastel Yellow  ||100||100|| 50||bgcolor=&amp;quot;#ffff80&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
|26|| 4Bh          ||Bright White   ||100||100||100||bgcolor=&amp;quot;#ffffff&amp;quot;|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Intensities ===&lt;br /&gt;
&lt;br /&gt;
The 0%, 50%, and 100% values in the above tables are &amp;quot;should-be&amp;quot; values. However, the real hardware doesn't exactly match that intensities. The actual intensities depend on the luminance mixing (R,G,B tied together via resistors), on chipset (classic CPC, or newer ASIC ones), and on the load applied by external hardware (Monitor, or TV set).&lt;br /&gt;
* [[CPC Palette]] - some more details&lt;br /&gt;
&lt;br /&gt;
=== To calculate the colour value ===&lt;br /&gt;
&lt;br /&gt;
'''Red''' &lt;br /&gt;
&lt;br /&gt;
0% =&amp;amp;gt; do not add anything &lt;br /&gt;
&lt;br /&gt;
50% =&amp;amp;gt; add 3 &lt;br /&gt;
&lt;br /&gt;
100% =&amp;amp;gt; add 6 &lt;br /&gt;
&lt;br /&gt;
'''Green''' &lt;br /&gt;
&lt;br /&gt;
0% =&amp;amp;gt; do not add anything &lt;br /&gt;
&lt;br /&gt;
50% =&amp;amp;gt; add 9 &lt;br /&gt;
&lt;br /&gt;
100% =&amp;amp;gt; add 18 &lt;br /&gt;
&lt;br /&gt;
'''Blue''' &lt;br /&gt;
&lt;br /&gt;
0% =&amp;amp;gt; do not add anything &lt;br /&gt;
&lt;br /&gt;
50% =&amp;amp;gt; add 1 &lt;br /&gt;
&lt;br /&gt;
100% =&amp;amp;gt; add 2 &lt;br /&gt;
&lt;br /&gt;
=== Green Screen Colours ==0&lt;br /&gt;
&lt;br /&gt;
On a green screen (where all colours are shades of green), the colours (in the software/firmware colours), are in order of increasing intensity. Black is very dark, and white is bright green, and colour 13 is a medium green. (Thanks to [[Mark Rison|Mark Rison]] for this information)&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:40010_am2_metal.jpg|40010 GA Metal Layer&lt;br /&gt;
Image:40010_am2_acid.jpg|40010 GA with Metal Layer removed&lt;br /&gt;
Image:40226_am4_metal.jpg|40226 PreASIC Metal Layer&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Gate Array and ASIC Pin-Outs]]&lt;br /&gt;
&lt;br /&gt;
*[[Video modes]] : for other informations on colours and pixels.&lt;br /&gt;
&lt;br /&gt;
*[[CRTC]] : the other video stuff.&lt;br /&gt;
*[[ASIC]] : for Plus users&lt;br /&gt;
&lt;br /&gt;
*[[Synchronising with the CRTC and display]] : technical details on the relationship between Gate Array and CRTC.&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]][[Category:Programming]][[Category:Datasheet]][[Category:Graphic]][[Category:CPC Internal Components]][[Category:Electronic Component]]&lt;/div&gt;</summary>
		<author><name>Dingo</name></author>	</entry>

	</feed>