<?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=SyX</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=SyX"/>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php/Special:Contributions/SyX"/>
		<updated>2026-08-29T17:07:20Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Playcity_examples.zip&amp;diff=98124</id>
		<title>File:Playcity examples.zip</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Playcity_examples.zip&amp;diff=98124"/>
				<updated>2017-05-13T14:49:57Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: SyX uploaded a new version of File:Playcity examples.zip&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Test_sfx.zip&amp;diff=98123</id>
		<title>File:Test sfx.zip</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Test_sfx.zip&amp;diff=98123"/>
				<updated>2017-05-13T14:49:05Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: SyX uploaded a new version of File:Test sfx.zip&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=98122</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=98122"/>
				<updated>2017-05-13T13:50:54Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: Undo revision 98121 by SyX (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:PlayCity.jpg|thumb|320px|]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with these features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts. Also used by [[FutureOS]].&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reset before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making it easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Information===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), its 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO2) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow using the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F) in the YMZ. The registers are write only.&lt;br /&gt;
&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! CTC !! CTC Out (MHz) !! YMZ (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| $1 || 2,00 || 1,00 || = CPC&lt;br /&gt;
|-&lt;br /&gt;
| $2 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| $3 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| $4 || 3,50 || 1,75 || = ZX&lt;br /&gt;
|-&lt;br /&gt;
| $5 || 3,60 || 1,80 || ~ MSX&lt;br /&gt;
|-&lt;br /&gt;
| $6 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| $7 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| $8 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $9 || 3,78 || 1,89 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $A || 3,80 || 1,90 ||&lt;br /&gt;
|-&lt;br /&gt;
| $B || 3,82 || 1,91 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $C || 3,83 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $D || 3,85 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $E || 3,86 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $F || 3,87 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
| $0 || 3,98 || 1,99 || ~ ST&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || 4,00 || 2,00 || = ST&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PlayCity coding tips==&lt;br /&gt;
Interesting tips or &amp;quot;magic tricks&amp;quot; using the board should be documented here. If the code is long, you must put in other wiki page and link it here.&lt;br /&gt;
===PlayCity detection===&lt;br /&gt;
We are going to use the NMI interrupt generator to check if our program is running in a CPC with a PlayCity board.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; PlayCity check&lt;br /&gt;
; (c) 2013 SyX&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
; Constantes&lt;br /&gt;
CTC_TIM1            EQU $F881       ; Channel 1 (I: Cursor CRTC | O: NMI) &lt;br /&gt;
CTC_START_TIMER256  EQU %00110111&lt;br /&gt;
CTC_STOP_CHANNEL    EQU %00000011&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; NOTE: The lower ROM must be disabled before to run this code.&lt;br /&gt;
check_playcity&lt;br /&gt;
    ; Disable interrupts&lt;br /&gt;
    DI&lt;br /&gt;
    &lt;br /&gt;
    ; Install NMI handler&lt;br /&gt;
    LD   A,$C3                  ; JP $xxxx&lt;br /&gt;
    LD   HL,nmi_interrupt&lt;br /&gt;
    LD   ($0066),A&lt;br /&gt;
    LD   ($0067),HL&lt;br /&gt;
&lt;br /&gt;
    ; Initialize playcity variable to 0&lt;br /&gt;
    XOR  A&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Wait VBlank&lt;br /&gt;
    LD   B,$F5&lt;br /&gt;
.wait_vbl&lt;br /&gt;
    IN   A,(C)&lt;br /&gt;
    RRA&lt;br /&gt;
    JR   NC,.wait_vbl&lt;br /&gt;
    &lt;br /&gt;
    ; Initialize CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   HL,32                  ; 32 scanlines&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_START_TIMER256&lt;br /&gt;
    OUT  (C),A                  ; Enable Timer &lt;br /&gt;
    OUT  (C),L                  ; Set new time constant&lt;br /&gt;
&lt;br /&gt;
    ; Extra delay&lt;br /&gt;
    LD   IX,33 * 4 - 1          ; Wait 33 scanlines&lt;br /&gt;
    CALL wait_scanlines_ix&lt;br /&gt;
   &lt;br /&gt;
    LD   A,(playcity)&lt;br /&gt;
    OR   A&lt;br /&gt;
    JR   NZ,.playcity_detected&lt;br /&gt;
    ; No PlayCity detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
.playcity_detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
nmi_interrupt&lt;br /&gt;
    PUSH BC&lt;br /&gt;
    PUSH AF&lt;br /&gt;
&lt;br /&gt;
    ; Change playcity variable&lt;br /&gt;
    LD   A,$FF&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Disable CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_STOP_CHANNEL&lt;br /&gt;
    OUT  (C),A                  ; Disable Timer &lt;br /&gt;
&lt;br /&gt;
    POP  AF&lt;br /&gt;
    POP  BC&lt;br /&gt;
    EI&lt;br /&gt;
    RETN&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; Wait scanlines&lt;br /&gt;
; INPUT:&lt;br /&gt;
;   IX: Scanlines to wait * 4 - 1&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
wait_scanlines_ix&lt;br /&gt;
    DEFS 5,0                                ; (5) &lt;br /&gt;
&lt;br /&gt;
.loop_wait_scanlines_ix                      &lt;br /&gt;
    DEFS 6                                  ; (6)&lt;br /&gt;
    DEC  IX                                 ; (3)&lt;br /&gt;
    LD   A,IXH                              ; (2)&lt;br /&gt;
    OR   IXL                                ; (2)&lt;br /&gt;
    JR   NZ,.loop_wait_scanlines_ix         ; (2/3)&lt;br /&gt;
                                            ; Total loop --&amp;gt; 16 * (IX - 1) + 15&lt;br /&gt;
    RET                                     ; (3)&lt;br /&gt;
                                            ; Total Routine --&amp;gt; 64 * SCANLINES&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
playcity&lt;br /&gt;
    DEFS 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;br /&gt;
&lt;br /&gt;
Another example, in [[File:test_sfx.zip]] you will find a 3 channels SFX player, you can choose the sound chip to be used by the player.&lt;br /&gt;
 &lt;br /&gt;
== Software Supporting PlayCity ==&lt;br /&gt;
&lt;br /&gt;
*[[Software_Supporting_PlayCity|List of software supporting the board.]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FutureOS]]&lt;br /&gt;
[[Category:Music and sound]]&lt;br /&gt;
[[Category:Peripherals]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=98121</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=98121"/>
				<updated>2017-05-13T13:39:25Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:PlayCity.jpg|thumb|320px|]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with these features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts. Also used by [[FutureOS]].&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reset before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making it easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Information===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), its 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO2) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow using the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F) in the YMZ. The registers are write only.&lt;br /&gt;
&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the left channels and port '''$F988''' for the right channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the left channels and port '''$F888''' for the right channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! CTC !! CTC Out (MHz) !! YMZ (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| $1 || 2,00 || 1,00 || = CPC&lt;br /&gt;
|-&lt;br /&gt;
| $2 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| $3 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| $4 || 3,50 || 1,75 || = ZX&lt;br /&gt;
|-&lt;br /&gt;
| $5 || 3,60 || 1,80 || ~ MSX&lt;br /&gt;
|-&lt;br /&gt;
| $6 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| $7 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| $8 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $9 || 3,78 || 1,89 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $A || 3,80 || 1,90 ||&lt;br /&gt;
|-&lt;br /&gt;
| $B || 3,82 || 1,91 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $C || 3,83 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $D || 3,85 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $E || 3,86 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $F || 3,87 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
| $0 || 3,98 || 1,99 || ~ ST&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || 4,00 || 2,00 || = ST&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PlayCity coding tips==&lt;br /&gt;
Interesting tips or &amp;quot;magic tricks&amp;quot; using the board should be documented here. If the code is long, you must put in other wiki page and link it here.&lt;br /&gt;
===PlayCity detection===&lt;br /&gt;
We are going to use the NMI interrupt generator to check if our program is running in a CPC with a PlayCity board.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; PlayCity check&lt;br /&gt;
; (c) 2013 SyX&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
; Constantes&lt;br /&gt;
CTC_TIM1            EQU $F881       ; Channel 1 (I: Cursor CRTC | O: NMI) &lt;br /&gt;
CTC_START_TIMER256  EQU %00110111&lt;br /&gt;
CTC_STOP_CHANNEL    EQU %00000011&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; NOTE: The lower ROM must be disabled before to run this code.&lt;br /&gt;
check_playcity&lt;br /&gt;
    ; Disable interrupts&lt;br /&gt;
    DI&lt;br /&gt;
    &lt;br /&gt;
    ; Install NMI handler&lt;br /&gt;
    LD   A,$C3                  ; JP $xxxx&lt;br /&gt;
    LD   HL,nmi_interrupt&lt;br /&gt;
    LD   ($0066),A&lt;br /&gt;
    LD   ($0067),HL&lt;br /&gt;
&lt;br /&gt;
    ; Initialize playcity variable to 0&lt;br /&gt;
    XOR  A&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Wait VBlank&lt;br /&gt;
    LD   B,$F5&lt;br /&gt;
.wait_vbl&lt;br /&gt;
    IN   A,(C)&lt;br /&gt;
    RRA&lt;br /&gt;
    JR   NC,.wait_vbl&lt;br /&gt;
    &lt;br /&gt;
    ; Initialize CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   HL,32                  ; 32 scanlines&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_START_TIMER256&lt;br /&gt;
    OUT  (C),A                  ; Enable Timer &lt;br /&gt;
    OUT  (C),L                  ; Set new time constant&lt;br /&gt;
&lt;br /&gt;
    ; Extra delay&lt;br /&gt;
    LD   IX,33 * 4 - 1          ; Wait 33 scanlines&lt;br /&gt;
    CALL wait_scanlines_ix&lt;br /&gt;
   &lt;br /&gt;
    LD   A,(playcity)&lt;br /&gt;
    OR   A&lt;br /&gt;
    JR   NZ,.playcity_detected&lt;br /&gt;
    ; No PlayCity detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
.playcity_detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
nmi_interrupt&lt;br /&gt;
    PUSH BC&lt;br /&gt;
    PUSH AF&lt;br /&gt;
&lt;br /&gt;
    ; Change playcity variable&lt;br /&gt;
    LD   A,$FF&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Disable CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_STOP_CHANNEL&lt;br /&gt;
    OUT  (C),A                  ; Disable Timer &lt;br /&gt;
&lt;br /&gt;
    POP  AF&lt;br /&gt;
    POP  BC&lt;br /&gt;
    EI&lt;br /&gt;
    RETN&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; Wait scanlines&lt;br /&gt;
; INPUT:&lt;br /&gt;
;   IX: Scanlines to wait * 4 - 1&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
wait_scanlines_ix&lt;br /&gt;
    DEFS 5,0                                ; (5) &lt;br /&gt;
&lt;br /&gt;
.loop_wait_scanlines_ix                      &lt;br /&gt;
    DEFS 6                                  ; (6)&lt;br /&gt;
    DEC  IX                                 ; (3)&lt;br /&gt;
    LD   A,IXH                              ; (2)&lt;br /&gt;
    OR   IXL                                ; (2)&lt;br /&gt;
    JR   NZ,.loop_wait_scanlines_ix         ; (2/3)&lt;br /&gt;
                                            ; Total loop --&amp;gt; 16 * (IX - 1) + 15&lt;br /&gt;
    RET                                     ; (3)&lt;br /&gt;
                                            ; Total Routine --&amp;gt; 64 * SCANLINES&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
playcity&lt;br /&gt;
    DEFS 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;br /&gt;
&lt;br /&gt;
Another example, in [[File:test_sfx.zip]] you will find a 3 channels SFX player, you can choose the sound chip to be used by the player.&lt;br /&gt;
 &lt;br /&gt;
== Software Supporting PlayCity ==&lt;br /&gt;
&lt;br /&gt;
*[[Software_Supporting_PlayCity|List of software supporting the board.]]&lt;br /&gt;
&lt;br /&gt;
[[Category:FutureOS]]&lt;br /&gt;
[[Category:Music and sound]]&lt;br /&gt;
[[Category:Peripherals]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=91574</id>
		<title>Software Supporting PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=91574"/>
				<updated>2014-11-04T00:35:02Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
All the software that supports the [[PlayCity]] expansion board is listed in this page for giving it better visibility.&lt;br /&gt;
&lt;br /&gt;
It's interesting to explain in a few sentences which features of the board the software is using and if you need to press any key or select a menu option to enable these special features. Of course, if the graphical side is improved, then don't be shy and add a few screenshots for catching the eye of future users of your software.&lt;br /&gt;
==Emulators==&lt;br /&gt;
===JavaCPC===&lt;br /&gt;
[[JavaCPC]] emulates sound part.&lt;br /&gt;
===MESS===&lt;br /&gt;
[[MESS]] emulates the 2xYMZs and the CTC lets you set YMZs clock, NMIs and Cursor Interrupts. In this moment only lacks of the support of daisy chain setup to acknowledge IRQs for using the normal timer/counter interrupts.&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:mess_playcity.jpg|Enabling PlayCity&lt;br /&gt;
File:mess_music.jpg|Playing Music&lt;br /&gt;
File:mess_rasters.jpg|NMI Rasters&lt;br /&gt;
File:mess_cursor.jpg|NMI CRTC Cursor&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
==Games==&lt;br /&gt;
===Cyber Chicken===&lt;br /&gt;
[[Cyber Chicken]] is using the YMZ chips.&lt;br /&gt;
{{#ev:youtube|0O7ejXpf1zM|300}}&lt;br /&gt;
&lt;br /&gt;
==Music Players==&lt;br /&gt;
===ReSeT #10===&lt;br /&gt;
ReSeT #10 ([[File:Playcity_examples.zip|ReSeT #10]]) is a music disk with a few PT3 Turbo Sound songs.&lt;br /&gt;
===SymAmp===&lt;br /&gt;
[[SymAmp]] for [[SymbOS]] (using the YMZ chips for playing 6 channel PT3 Turbosound modules){{#ev:youtube|B8-MoO1VJx4|300}}&lt;br /&gt;
[[Category:Games]]&lt;br /&gt;
[[Category:Music and sound]]&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Mess_playcity.jpg&amp;diff=91572</id>
		<title>File:Mess playcity.jpg</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Mess_playcity.jpg&amp;diff=91572"/>
				<updated>2014-11-04T00:33:04Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Mess_rasters.jpg&amp;diff=91573</id>
		<title>File:Mess rasters.jpg</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Mess_rasters.jpg&amp;diff=91573"/>
				<updated>2014-11-04T00:33:04Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Mess_music.jpg&amp;diff=91571</id>
		<title>File:Mess music.jpg</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Mess_music.jpg&amp;diff=91571"/>
				<updated>2014-11-04T00:33:03Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Mess_cursor.jpg&amp;diff=91570</id>
		<title>File:Mess cursor.jpg</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Mess_cursor.jpg&amp;diff=91570"/>
				<updated>2014-11-04T00:33:01Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=91565</id>
		<title>Software Supporting PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=91565"/>
				<updated>2014-11-03T18:26:48Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
All the software that supports the [[PlayCity]] expansion board is listed in this page for giving it better visibility.&lt;br /&gt;
&lt;br /&gt;
It's interesting to explain in a few sentences which features of the board the software is using and if you need to press any key or select a menu option to enable these special features. Of course, if the graphical side is improved, then don't be shy and add a few screenshots for catching the eye of future users of your software.&lt;br /&gt;
==Emulators==&lt;br /&gt;
===JavaCPC===&lt;br /&gt;
[[JavaCPC]] emulates sound part.&lt;br /&gt;
===MESS===&lt;br /&gt;
[[MESS]] emulates the 2xYMZs and the CTC lets you set YMZs clock, NMIs and Cursor Interrupts. In this moment only lacks of the support of daisy chain setup to acknowledge IRQs for using the normal timer/counter interrupts.&lt;br /&gt;
&lt;br /&gt;
==Games==&lt;br /&gt;
===Cyber Chicken===&lt;br /&gt;
[[Cyber Chicken]] is using the YMZ chips.&lt;br /&gt;
{{#ev:youtube|0O7ejXpf1zM|300}}&lt;br /&gt;
&lt;br /&gt;
==Music Players==&lt;br /&gt;
===ReSeT #10===&lt;br /&gt;
ReSeT #10 ([[File:Playcity_examples.zip|ReSeT #10]]) is a music disk with a few PT3 Turbo Sound songs.&lt;br /&gt;
===SymAmp===&lt;br /&gt;
[[SymAmp]] for [[SymbOS]] (using the YMZ chips for playing 6 channel PT3 Turbosound modules){{#ev:youtube|B8-MoO1VJx4|300}}&lt;br /&gt;
[[Category:Games]]&lt;br /&gt;
[[Category:Music and sound]]&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=91564</id>
		<title>Software Supporting PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=91564"/>
				<updated>2014-11-03T14:29:08Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
All the software that supports the [[PlayCity]] expansion board is listed in this page for giving it better visibility.&lt;br /&gt;
&lt;br /&gt;
It's interesting to explain in a few sentences which features of the board the software is using and if you need to press any key or select a menu option to enable these special features. Of course, if the graphical side is improved, then don't be shy and add a few screenshots for catching the eye of future users of your software.&lt;br /&gt;
==Emulators==&lt;br /&gt;
===JavaCPC===&lt;br /&gt;
[[JavaCPC]] emulates sound part.&lt;br /&gt;
===MESS===&lt;br /&gt;
[[MESS]] emulates PlayCity fully. The 2xYMZs and the CTC lets you set YMZs clock, NMIs, Cursor Interrupts and timer/counter interrupts.&lt;br /&gt;
&lt;br /&gt;
==Games==&lt;br /&gt;
===Cyber Chicken===&lt;br /&gt;
[[Cyber Chicken]] is using the YMZ chips.&lt;br /&gt;
{{#ev:youtube|0O7ejXpf1zM|300}}&lt;br /&gt;
&lt;br /&gt;
==Music Players==&lt;br /&gt;
===ReSeT #10===&lt;br /&gt;
ReSeT #10 ([[File:Playcity_examples.zip|ReSeT #10]]) is a music disk with a few PT3 Turbo Sound songs.&lt;br /&gt;
===SymAmp===&lt;br /&gt;
[[SymAmp]] for [[SymbOS]] (using the YMZ chips for playing 6 channel PT3 Turbosound modules){{#ev:youtube|B8-MoO1VJx4|300}}&lt;br /&gt;
[[Category:Games]]&lt;br /&gt;
[[Category:Music and sound]]&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=91541</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=91541"/>
				<updated>2014-10-31T14:22:01Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:PlayCity.jpg|thumb|320px|]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with the next features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO2) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F) in the YMZ.&lt;br /&gt;
&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! CTC !! CTC Out (MHz) !! YMZ (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| $1 || 2,00 || 1,00 || = CPC&lt;br /&gt;
|-&lt;br /&gt;
| $2 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| $3 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| $4 || 3,50 || 1,75 || = ZX&lt;br /&gt;
|-&lt;br /&gt;
| $5 || 3,60 || 1,80 || ~ MSX&lt;br /&gt;
|-&lt;br /&gt;
| $6 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| $7 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| $8 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $9 || 3,78 || 1,89 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $A || 3,80 || 1,90 ||&lt;br /&gt;
|-&lt;br /&gt;
| $B || 3,82 || 1,91 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $C || 3,83 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $D || 3,85 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $E || 3,86 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $F || 3,87 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
| $0 || 3,98 || 1,99 || ~ ST&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || 4,00 || 2,00 || = ST&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PlayCity coding tips==&lt;br /&gt;
Interesting tips or &amp;quot;magic tricks&amp;quot; using the board should be documented here. If the code is long, you must put in other wiki page and link it here.&lt;br /&gt;
===PlayCity detection===&lt;br /&gt;
We are going to use the NMI interrupt generator to check if our program is running in a CPC with a PlayCity board.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; PlayCity check&lt;br /&gt;
; (c) 2013 SyX&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
; Constantes&lt;br /&gt;
CTC_TIM1            EQU $F881       ; Channel 1 (I: Cursor CRTC | O: NMI) &lt;br /&gt;
CTC_START_TIMER256  EQU %00110111&lt;br /&gt;
CTC_STOP_CHANNEL    EQU %00000011&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; NOTE: The lower ROM must be disabled before to run this code.&lt;br /&gt;
check_playcity&lt;br /&gt;
    ; Disable interrupts&lt;br /&gt;
    DI&lt;br /&gt;
    &lt;br /&gt;
    ; Install NMI handler&lt;br /&gt;
    LD   A,$C3                  ; JP $xxxx&lt;br /&gt;
    LD   HL,nmi_interrupt&lt;br /&gt;
    LD   ($0066),A&lt;br /&gt;
    LD   ($0067),HL&lt;br /&gt;
&lt;br /&gt;
    ; Initialize playcity variable to 0&lt;br /&gt;
    XOR  A&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Wait VBlank&lt;br /&gt;
    LD   B,$F5&lt;br /&gt;
.wait_vbl&lt;br /&gt;
    IN   A,(C)&lt;br /&gt;
    RRA&lt;br /&gt;
    JR   NC,.wait_vbl&lt;br /&gt;
    &lt;br /&gt;
    ; Initialize CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   HL,32                  ; 32 scanlines&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_START_TIMER256&lt;br /&gt;
    OUT  (C),A                  ; Enable Timer &lt;br /&gt;
    OUT  (C),L                  ; Set new time constant&lt;br /&gt;
&lt;br /&gt;
    ; Extra delay&lt;br /&gt;
    LD   IX,33 * 4 - 1          ; Wait 33 scanlines&lt;br /&gt;
    CALL wait_scanlines_ix&lt;br /&gt;
   &lt;br /&gt;
    LD   A,(playcity)&lt;br /&gt;
    OR   A&lt;br /&gt;
    JR   NZ,.playcity_detected&lt;br /&gt;
    ; No PlayCity detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
.playcity_detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
nmi_interrupt&lt;br /&gt;
    PUSH BC&lt;br /&gt;
    PUSH AF&lt;br /&gt;
&lt;br /&gt;
    ; Change playcity variable&lt;br /&gt;
    LD   A,$FF&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Disable CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_STOP_CHANNEL&lt;br /&gt;
    OUT  (C),A                  ; Disable Timer &lt;br /&gt;
&lt;br /&gt;
    POP  AF&lt;br /&gt;
    POP  BC&lt;br /&gt;
    EI&lt;br /&gt;
    RETN&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; Wait scanlines&lt;br /&gt;
; INPUT:&lt;br /&gt;
;   IX: Scanlines to wait * 4 - 1&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
wait_scanlines_ix&lt;br /&gt;
    DEFS 5,0                                ; (5) &lt;br /&gt;
&lt;br /&gt;
.loop_wait_scanlines_ix                      &lt;br /&gt;
    DEFS 6                                  ; (6)&lt;br /&gt;
    DEC  IX                                 ; (3)&lt;br /&gt;
    LD   A,IXH                              ; (2)&lt;br /&gt;
    OR   IXL                                ; (2)&lt;br /&gt;
    JR   NZ,.loop_wait_scanlines_ix         ; (2/3)&lt;br /&gt;
                                            ; Total loop --&amp;gt; 16 * (IY - 1) + 15&lt;br /&gt;
    RET                                     ; (3)&lt;br /&gt;
                                            ; Total Routine --&amp;gt; 64 * SCANLINES&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
playcity&lt;br /&gt;
    DEFS 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;br /&gt;
&lt;br /&gt;
Another example, in [[File:test_sfx.zip]] you will find a 3 channels SFX player, you can choose the sound chip to be used by the player.&lt;br /&gt;
 &lt;br /&gt;
== Software Supporting PlayCity ==&lt;br /&gt;
&lt;br /&gt;
*[[Software_Supporting_PlayCity|List of software supporting the board.]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Peripherals]][[Category:Music and sound]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90688</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90688"/>
				<updated>2014-08-27T18:25:24Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:PlayCity.jpg|thumb|320px|]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with the next features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
[[File:PlayCity.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO2) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F) in the YMZ.&lt;br /&gt;
&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! CTC !! CTC Out (MHz) !! YMZ (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| $1 || 2,00 || 1,00 || = CPC&lt;br /&gt;
|-&lt;br /&gt;
| $2 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| $3 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| $4 || 3,50 || 1,75 || = ZX&lt;br /&gt;
|-&lt;br /&gt;
| $5 || 3,60 || 1,80 || ~ MSX&lt;br /&gt;
|-&lt;br /&gt;
| $6 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| $7 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| $8 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $9 || 3,78 || 1,89 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $A || 3,80 || 1,90 ||&lt;br /&gt;
|-&lt;br /&gt;
| $B || 3,82 || 1,91 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $C || 3,83 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $D || 3,85 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $E || 3,86 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $F || 3,87 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
| $0 || 3,98 || 1,99 || ~ ST&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || 4,00 || 2,00 || = ST&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PlayCity coding tips==&lt;br /&gt;
Interesting tips or &amp;quot;magic tricks&amp;quot; using the board should be documented here. If the code is long, you must put in other wiki page and link it here.&lt;br /&gt;
===PlayCity detection===&lt;br /&gt;
We are going to use the NMI interrupt generator to check if our program is running in a CPC with a PlayCity board.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; PlayCity check&lt;br /&gt;
; (c) 2013 SyX&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
; Constantes&lt;br /&gt;
CTC_TIM1            EQU $F881       ; Channel 1 (I: Cursor CRTC | O: NMI) &lt;br /&gt;
CTC_START_TIMER256  EQU %00110111&lt;br /&gt;
CTC_STOP_CHANNEL    EQU %00000011&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; NOTE: The lower ROM must be disabled before to run this code.&lt;br /&gt;
check_playcity&lt;br /&gt;
    ; Disable interrupts&lt;br /&gt;
    DI&lt;br /&gt;
    &lt;br /&gt;
    ; Install NMI handler&lt;br /&gt;
    LD   A,$C3                  ; JP $xxxx&lt;br /&gt;
    LD   HL,nmi_interrupt&lt;br /&gt;
    LD   ($0066),A&lt;br /&gt;
    LD   ($0067),HL&lt;br /&gt;
&lt;br /&gt;
    ; Initialize playcity variable to 0&lt;br /&gt;
    XOR  A&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Wait VBlank&lt;br /&gt;
    LD   B,$F5&lt;br /&gt;
.wait_vbl&lt;br /&gt;
    IN   A,(C)&lt;br /&gt;
    RRA&lt;br /&gt;
    JR   NC,.wait_vbl&lt;br /&gt;
    &lt;br /&gt;
    ; Initialize CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   HL,32                  ; 32 scanlines&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_START_TIMER256&lt;br /&gt;
    OUT  (C),A                  ; Enable Timer &lt;br /&gt;
    OUT  (C),L                  ; Set new time constant&lt;br /&gt;
&lt;br /&gt;
    ; Extra delay&lt;br /&gt;
    LD   IX,33 * 4 - 1          ; Wait 33 scanlines&lt;br /&gt;
    CALL wait_scanlines_ix&lt;br /&gt;
   &lt;br /&gt;
    LD   A,(playcity)&lt;br /&gt;
    OR   A&lt;br /&gt;
    JR   NZ,.playcity_detected&lt;br /&gt;
    ; No PlayCity detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
.playcity_detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
nmi_interrupt&lt;br /&gt;
    PUSH BC&lt;br /&gt;
    PUSH AF&lt;br /&gt;
&lt;br /&gt;
    ; Change playcity variable&lt;br /&gt;
    LD   A,$FF&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Disable CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_STOP_CHANNEL&lt;br /&gt;
    OUT  (C),A                  ; Disable Timer &lt;br /&gt;
&lt;br /&gt;
    POP  AF&lt;br /&gt;
    POP  BC&lt;br /&gt;
    EI&lt;br /&gt;
    RETN&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; Wait scanlines&lt;br /&gt;
; INPUT:&lt;br /&gt;
;   IX: Scanlines to wait * 4 - 1&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
wait_scanlines_ix&lt;br /&gt;
    DEFS 5,0                                ; (5) &lt;br /&gt;
&lt;br /&gt;
.loop_wait_scanlines_ix                      &lt;br /&gt;
    DEFS 6                                  ; (6)&lt;br /&gt;
    DEC  IX                                 ; (3)&lt;br /&gt;
    LD   A,IXH                              ; (2)&lt;br /&gt;
    OR   IXL                                ; (2)&lt;br /&gt;
    JR   NZ,.loop_wait_scanlines_ix         ; (2/3)&lt;br /&gt;
                                            ; Total loop --&amp;gt; 16 * (IY - 1) + 15&lt;br /&gt;
    RET                                     ; (3)&lt;br /&gt;
                                            ; Total Routine --&amp;gt; 64 * SCANLINES&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
playcity&lt;br /&gt;
    DEFS 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;br /&gt;
&lt;br /&gt;
Another example, in [[File:test_sfx.zip]] you will find a 3 channels SFX player, you can choose the sound chip to be used by the player.&lt;br /&gt;
 &lt;br /&gt;
== Software Supporting PlayCity ==&lt;br /&gt;
[[Software_Supporting_PlayCity|List of software supporting the board.]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Test_sfx.zip&amp;diff=90674</id>
		<title>File:Test sfx.zip</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Test_sfx.zip&amp;diff=90674"/>
				<updated>2014-08-26T13:47:01Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90673</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90673"/>
				<updated>2014-08-26T13:46:20Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with the next features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
[[File:PlayCity.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO2) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F) in the YMZ.&lt;br /&gt;
&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! CTC !! CTC Out (MHz) !! YMZ (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| $1 || 2,00 || 1,00 || = CPC&lt;br /&gt;
|-&lt;br /&gt;
| $2 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| $3 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| $4 || 3,50 || 1,75 || = ZX&lt;br /&gt;
|-&lt;br /&gt;
| $5 || 3,60 || 1,80 || ~ MSX&lt;br /&gt;
|-&lt;br /&gt;
| $6 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| $7 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| $8 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $9 || 3,78 || 1,89 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $A || 3,80 || 1,90 ||&lt;br /&gt;
|-&lt;br /&gt;
| $B || 3,82 || 1,91 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $C || 3,83 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $D || 3,85 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $E || 3,86 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $F || 3,87 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
| $0 || 3,98 || 1,99 || ~ ST&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || 4,00 || 2,00 || = ST&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PlayCity coding tips==&lt;br /&gt;
Interesting tips or &amp;quot;magic tricks&amp;quot; using the board should be documented here. If the code is long, you must put in other wiki page and link it here.&lt;br /&gt;
===PlayCity detection===&lt;br /&gt;
We are going to use the NMI interrupt generator to check if our program is running in a CPC with a PlayCity board.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; PlayCity check&lt;br /&gt;
; (c) 2013 SyX&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
; Constantes&lt;br /&gt;
CTC_TIM1            EQU $F881       ; Channel 1 (I: Cursor CRTC | O: NMI) &lt;br /&gt;
CTC_START_TIMER256  EQU %00110111&lt;br /&gt;
CTC_STOP_CHANNEL    EQU %00000011&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; NOTE: The lower ROM must be disabled before to run this code.&lt;br /&gt;
check_playcity&lt;br /&gt;
    ; Disable interrupts&lt;br /&gt;
    DI&lt;br /&gt;
    &lt;br /&gt;
    ; Install NMI handler&lt;br /&gt;
    LD   A,$C3                  ; JP $xxxx&lt;br /&gt;
    LD   HL,nmi_interrupt&lt;br /&gt;
    LD   ($0066),A&lt;br /&gt;
    LD   ($0067),HL&lt;br /&gt;
&lt;br /&gt;
    ; Initialize playcity variable to 0&lt;br /&gt;
    XOR  A&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Wait VBlank&lt;br /&gt;
    LD   B,$F5&lt;br /&gt;
.wait_vbl&lt;br /&gt;
    IN   A,(C)&lt;br /&gt;
    RRA&lt;br /&gt;
    JR   NC,.wait_vbl&lt;br /&gt;
    &lt;br /&gt;
    ; Initialize CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   HL,32                  ; 32 scanlines&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_START_TIMER256&lt;br /&gt;
    OUT  (C),A                  ; Enable Timer &lt;br /&gt;
    OUT  (C),L                  ; Set new time constant&lt;br /&gt;
&lt;br /&gt;
    ; Extra delay&lt;br /&gt;
    LD   IX,33 * 4 - 1          ; Wait 33 scanlines&lt;br /&gt;
    CALL wait_scanlines_ix&lt;br /&gt;
   &lt;br /&gt;
    LD   A,(playcity)&lt;br /&gt;
    OR   A&lt;br /&gt;
    JR   NZ,.playcity_detected&lt;br /&gt;
    ; No PlayCity detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
.playcity_detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
nmi_interrupt&lt;br /&gt;
    PUSH BC&lt;br /&gt;
    PUSH AF&lt;br /&gt;
&lt;br /&gt;
    ; Change playcity variable&lt;br /&gt;
    LD   A,$FF&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Disable CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_STOP_CHANNEL&lt;br /&gt;
    OUT  (C),A                  ; Disable Timer &lt;br /&gt;
&lt;br /&gt;
    POP  AF&lt;br /&gt;
    POP  BC&lt;br /&gt;
    EI&lt;br /&gt;
    RETN&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; Wait scanlines&lt;br /&gt;
; INPUT:&lt;br /&gt;
;   IX: Scanlines to wait * 4 - 1&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
wait_scanlines_ix&lt;br /&gt;
    DEFS 5,0                                ; (5) &lt;br /&gt;
&lt;br /&gt;
.loop_wait_scanlines_ix                      &lt;br /&gt;
    DEFS 6                                  ; (6)&lt;br /&gt;
    DEC  IX                                 ; (3)&lt;br /&gt;
    LD   A,IXH                              ; (2)&lt;br /&gt;
    OR   IXL                                ; (2)&lt;br /&gt;
    JR   NZ,.loop_wait_scanlines_ix         ; (2/3)&lt;br /&gt;
                                            ; Total loop --&amp;gt; 16 * (IY - 1) + 15&lt;br /&gt;
    RET                                     ; (3)&lt;br /&gt;
                                            ; Total Routine --&amp;gt; 64 * SCANLINES&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
playcity&lt;br /&gt;
    DEFS 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;br /&gt;
&lt;br /&gt;
Another example, in [[File:test_sfx.zip]] you will find a 3 channels SFX player, you can choose the sound chip to be used by the player.&lt;br /&gt;
 &lt;br /&gt;
== Software Supporting PlayCity ==&lt;br /&gt;
[[Software_Supporting_PlayCity|List of software supporting the board.]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90558</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90558"/>
				<updated>2014-08-21T15:24:19Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with the next features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
[[File:PlayCity.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO2) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! CTC !! CTC Out (MHz) !! YMZ (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| $1 || 2,00 || 1,00 || = CPC&lt;br /&gt;
|-&lt;br /&gt;
| $2 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| $3 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| $4 || 3,50 || 1,75 || = ZX&lt;br /&gt;
|-&lt;br /&gt;
| $5 || 3,60 || 1,80 || ~ MSX&lt;br /&gt;
|-&lt;br /&gt;
| $6 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| $7 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| $8 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $9 || 3,78 || 1,89 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $A || 3,80 || 1,90 ||&lt;br /&gt;
|-&lt;br /&gt;
| $B || 3,82 || 1,91 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $C || 3,83 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $D || 3,85 || 1,92 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $E || 3,86 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| $F || 3,87 || 1,93 ||&lt;br /&gt;
|-&lt;br /&gt;
| $0 || 3,98 || 1,99 || ~ ST&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || 4,00 || 2,00 || = ST&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==PlayCity coding tips==&lt;br /&gt;
Interesting tips or &amp;quot;magic tricks&amp;quot; using the board should be documented here. If the code is long, you must put in other wiki page and link it here.&lt;br /&gt;
===PlayCity detection===&lt;br /&gt;
We are going to use the NMI interrupt generator to check if our program is running in a CPC with a PlayCity board.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; PlayCity check&lt;br /&gt;
; (c) 2013 SyX&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
; Constantes&lt;br /&gt;
CTC_TIM1            EQU $F881       ; Channel 1 (I: Cursor CRTC | O: NMI) &lt;br /&gt;
CTC_START_TIMER256  EQU %00110111&lt;br /&gt;
CTC_STOP_CHANNEL    EQU %00000011&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; NOTE: The lower ROM must be disabled before to run this code.&lt;br /&gt;
check_playcity&lt;br /&gt;
    ; Disable interrupts&lt;br /&gt;
    DI&lt;br /&gt;
    &lt;br /&gt;
    ; Install NMI handler&lt;br /&gt;
    LD   A,$C3                  ; JP $xxxx&lt;br /&gt;
    LD   HL,nmi_interrupt&lt;br /&gt;
    LD   ($0066),A&lt;br /&gt;
    LD   ($0067),HL&lt;br /&gt;
&lt;br /&gt;
    ; Initialize playcity variable to 0&lt;br /&gt;
    XOR  A&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Wait VBlank&lt;br /&gt;
    LD   B,$F5&lt;br /&gt;
.wait_vbl&lt;br /&gt;
    IN   A,(C)&lt;br /&gt;
    RRA&lt;br /&gt;
    JR   NC,.wait_vbl&lt;br /&gt;
    &lt;br /&gt;
    ; Initialize CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   HL,32                  ; 32 scanlines&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_START_TIMER256&lt;br /&gt;
    OUT  (C),A                  ; Enable Timer &lt;br /&gt;
    OUT  (C),L                  ; Set new time constant&lt;br /&gt;
&lt;br /&gt;
    ; Extra delay&lt;br /&gt;
    LD   IX,33 * 4 - 1          ; Wait 33 scanlines&lt;br /&gt;
    CALL wait_scanlines_ix&lt;br /&gt;
   &lt;br /&gt;
    LD   A,(playcity)&lt;br /&gt;
    OR   A&lt;br /&gt;
    JR   NZ,.playcity_detected&lt;br /&gt;
    ; No PlayCity detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
.playcity_detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
nmi_interrupt&lt;br /&gt;
    PUSH BC&lt;br /&gt;
    PUSH AF&lt;br /&gt;
&lt;br /&gt;
    ; Change playcity variable&lt;br /&gt;
    LD   A,$FF&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Disable CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_STOP_CHANNEL&lt;br /&gt;
    OUT  (C),A                  ; Disable Timer &lt;br /&gt;
&lt;br /&gt;
    POP  AF&lt;br /&gt;
    POP  BC&lt;br /&gt;
    EI&lt;br /&gt;
    RETN&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; Wait scanlines&lt;br /&gt;
; INPUT:&lt;br /&gt;
;   IX: Scanlines to wait * 4 - 1&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
wait_scanlines_ix&lt;br /&gt;
    DEFS 5,0                                ; (5) &lt;br /&gt;
&lt;br /&gt;
.loop_wait_scanlines_ix                      &lt;br /&gt;
    DEFS 6                                  ; (6)&lt;br /&gt;
    DEC  IX                                 ; (3)&lt;br /&gt;
    LD   A,IXH                              ; (2)&lt;br /&gt;
    OR   IXL                                ; (2)&lt;br /&gt;
    JR   NZ,.loop_wait_scanlines_ix         ; (2/3)&lt;br /&gt;
                                            ; Total loop --&amp;gt; 16 * (IY - 1) + 15&lt;br /&gt;
    RET                                     ; (3)&lt;br /&gt;
                                            ; Total Routine --&amp;gt; 64 * SCANLINES&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
playcity&lt;br /&gt;
    DEFS 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;br /&gt;
&lt;br /&gt;
== Software Supporting PlayCity ==&lt;br /&gt;
[[Software_Supporting_PlayCity|List of software supporting the board.]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Speccy_Port&amp;diff=90532</id>
		<title>Speccy Port</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Speccy_Port&amp;diff=90532"/>
				<updated>2014-08-20T12:50:06Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;[[Image:Vs.png]]&amp;lt;/center&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
A '''Speccy Port''' or '''Spectrum port''' is the name given to a game which has been converted directly from the Sinclair Spectrum with little or no changes to the Amstrad CPC. &lt;br /&gt;
&lt;br /&gt;
Mostly the Amstrad version ended up fairing worse than the original Spectrum version with the following results:&lt;br /&gt;
* Less colours&lt;br /&gt;
* Slower gameplay&lt;br /&gt;
&lt;br /&gt;
These facts are not true for all &amp;quot;Spectrum Ports&amp;quot; because some ended up decent.&lt;br /&gt;
&lt;br /&gt;
There is anger from Amstrad users in general, because they feel that if more time had had been taken on the Amstrad version, we could have had a version that used the abilities of the Amstrad better, looked better, perhaps sounded better, and played as well or better than the Spectrum version.&lt;br /&gt;
&lt;br /&gt;
On a more positive tone, those speccy ports had the merit to exist, or else Amstrad would have a smaller games catalogue.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that Spectrum ports also existed on [[MSX]], [[Enterprise]] 64/128,[[Thomson]] MO/TO, [[SAM Coupé]] and [[Commodore 64|C64]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How these should have looked==&lt;br /&gt;
&lt;br /&gt;
This section shows games which were made specifically for the Amstrad's abilities or Spectrum ports that were done correctly.&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Amstrad games done well, and how these games could have looked if more care was taken.&lt;br /&gt;
&lt;br /&gt;
The following list shows how a game can be done right using the cpc capabilities. These do not necessarily share any Spectrum code, and are not necessarily recoloured from the Spectrum:&lt;br /&gt;
&lt;br /&gt;
* Renegade&lt;br /&gt;
* Gryzor&lt;br /&gt;
* Xyphoes Fantasy&lt;br /&gt;
* [[Head Over Heels]]&lt;br /&gt;
&lt;br /&gt;
Some CPC games share similarities with the Spectrum version, and probably share a lot of code, yet are in mode 0 (16 colours, lowest resolution). [[Ocean]] made a lot lilke and thanks to a more professional graphic treatment (compared to many other British companies) and actually good porting tactics this produced some of the finest CPC games.&lt;br /&gt;
&lt;br /&gt;
Those games are examples:&lt;br /&gt;
&lt;br /&gt;
*'''Robocop'''&lt;br /&gt;
*'''Chase HQ'''&lt;br /&gt;
&lt;br /&gt;
Some of the games in the list below use mode 1 but fully supported the 2bpp re-coding of graphics done right (by a human, not by an automatic method) and hence got properly coloured backgrounds and sprites.&lt;br /&gt;
&lt;br /&gt;
*'''Shadow of the Beast'''&lt;br /&gt;
*'''Midnight Resistance'''&lt;br /&gt;
*'''Wec le Mans'''&lt;br /&gt;
&lt;br /&gt;
=Reasons for a Spectrum Port=&lt;br /&gt;
&lt;br /&gt;
The [[ZX Spectrum]] shared similar hardware with the Amstrad CPC (see Machine comparisons).&lt;br /&gt;
&lt;br /&gt;
The Spectrum was very popular and with the CPC having a much smaller market share, it made sense to develop the Spectrum version first and to save on time and money, the Spectrum code, music and graphics were re-used.   (A typical port to the Amstrad is said to have been done in 3 days so was financially good).&lt;br /&gt;
&lt;br /&gt;
This phenomenon was more prominent in the UK, where the Speccy was the dominant machine. In other markets, such as France or Spain, where the CPC was very popular, games were coded from scratch for the CPC, often using an [[Atari|Atari ST]] for  [[Games Crossdev|Cross Development]]&lt;br /&gt;
&lt;br /&gt;
= Machine comparisons =&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*The Spectrum 48K was released in the UK in 1982 and was the successor of the ZX80/ZX81 with upgraded graphics and config (RAM/ROM). The Amstrad CPC464 was released in the UK in 1984 and was a Z80 based computer with AY sound and a simplified yet upgraded custom IBM PC CGA display for Video.&lt;br /&gt;
&lt;br /&gt;
*Spectrum 48K sold for £99. The CPC464 with Green Screen monitor sold for £299 and with colour monitor for £399. One selling point was that the Amstrad needed only 1 plug, and that you didn't need to use the family television to use it. Also the Spectrum 48k wasn't supplied with any monitor nor storage device. &lt;br /&gt;
&lt;br /&gt;
* The Spectrum was designed to be used with a television, the Amstrad was designed to be used with and was sold with either a green screen or colour monitor. &lt;br /&gt;
&lt;br /&gt;
* Amstrad's monitors include the powersupply for the Amstrad CPC. A &amp;quot;TV connection + power supply&amp;quot; solution was also available : [[Amstrad MP1/MP2 modulator]]&lt;br /&gt;
&lt;br /&gt;
* The Spectrum was sold as a games machine, the Amstrad was sold more as a multi purpose machine (in the UK anyway).&lt;br /&gt;
&lt;br /&gt;
* The Amstrad's BASIC and firmware are said to be better than the Spectrum's BASIC and OS functions.&lt;br /&gt;
&lt;br /&gt;
====CPU, RAM and basic Hardware====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Spectrum 48K machine has 48K RAM, approx 6.5k of this is screen. The Amstrad CPC464 and 664 have 64K ram, approx 16K of this is screen.&lt;br /&gt;
&lt;br /&gt;
*Latter Spectrum were supplied with 128K RAM (Spectrum 128, +2 and +3) and Amstrad CPC6128 was supplied with 128K RAM too (same amount of RAM used by Video as earlier machines)&lt;br /&gt;
&lt;br /&gt;
*Spectrum and Amstrad both have a Z80 CPU.&lt;br /&gt;
&lt;br /&gt;
* The CPU runs at a similar speed (3.5Mhz in Spectrum, 4Mhz in Amstrad) (Note, both systems do not run at optimum speed due to waits inserted by the video hardware).&lt;br /&gt;
&lt;br /&gt;
*The Spectrum 48k can't do double buffering in hardware (the later 128K machines can), the Amstrad could from the start. On the Amstrad and Spectrum 128K you can use hardware double buffering, but then you need to sacrific twice as much video ram (e.g. For Amstrad: 2 x 16K).&lt;br /&gt;
&lt;br /&gt;
*The Spectrum has 1 interrupt per 50Hz frame, the Amstrad has 6 in fixed locations through the frame.&lt;br /&gt;
&lt;br /&gt;
*Neither have hardware sprites, therefore you have to use the CPU to both draw and erase the sprites.&lt;br /&gt;
&lt;br /&gt;
*Amstrad has hardware scrolling, Spectrum does not.&lt;br /&gt;
&lt;br /&gt;
* The Spectrum 48 didn't come with a joystick port, you had to buy one. There was two variants, Sinclair and Kempston, thankfully the hardware was cheap and easy to obtain, and both were well supported by software. The Amstrad came with a joystick port built in.&lt;br /&gt;
&lt;br /&gt;
* The original Sinclair ZX Spectrums didn't come with a tape player, you had to buy one. The Amstrad CPC464 had a tape player built in, however neither the CPC664 or CPC6128 had a tape player built in, you had to buy one if you wanted to use tape based software with them. &lt;br /&gt;
&lt;br /&gt;
* Later Amstrad's ZX Spectrums (+2 and +3...) had in-built storage devices as they shared the common Amstrad CPC design.&lt;br /&gt;
&lt;br /&gt;
* Both the Spectrum and Amstrad had to use the CPU for loading or saving on cassette. The Spectrum ROM loader used the border colours to indicate loading (especially the use of striped bars in the border to indicate each data bit) a small block for a header, and then loaded the program with one larger block. The checksum/error detection was done using XOR. The Amstrad's ROM loader used many smaller blocks (so you could rewind if there was an error), it indicated loading progress with text that updated on the display, and used the better CRC for error detection. However, if the loading messages were turned off, you didn't have any indication of loading progress.&lt;br /&gt;
&lt;br /&gt;
* The Spectrum 48K's keyboard was made from rubber, the CPC had a proper keyboard. The later Spectrum's had proper keyboards too.&lt;br /&gt;
&lt;br /&gt;
* The Amstrad had connections for printer, stereo sound output and expansion. It had an internal speaker, with volume control. The Spectrum 48K had connections for tape player, TV aerial and expansion. It had an internal piezo electric buzzer, the volume of which couldn't be controlled.&lt;br /&gt;
  &lt;br /&gt;
* The Amstrad could control the cassette motor, turning it on and off under software control to pause loading of software. The Spectrum didn't have this, you had to manually stop and play the tape.&lt;br /&gt;
&lt;br /&gt;
* The Amstrad had function/numeric keys. Only the later Spectrums (+2 and +3) had these.&lt;br /&gt;
&lt;br /&gt;
* Later Spectrums (+2 and +3) had a RS232/Midi port, the CPC didn't have this. If you wanted this on the CPC, you needed to buy extra hardware.&lt;br /&gt;
&lt;br /&gt;
====Video====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Spectrum and Amstrad both have a '''bitmapped''' display.&lt;br /&gt;
&lt;br /&gt;
*while''' ZX spectrum''' has a quite '''basic 1bpp character based colour display''', '''Amstrad CPC''' can be considered an '''upgraded CGA display minus the Character based text modes''' (with a 16colours modes such as the Tandy's own custom &amp;quot;CGA&amp;quot; had... and a differently logic based palette), with a range or 4bpp low resolution, 2bpp square resolution and 1bpp high resolution Attribute free video display.&lt;br /&gt;
&lt;br /&gt;
*'''They have a similar screen size.'''  But '''Amstrad CPC''' actually produces smaller pixels in it's &amp;quot;equivalent&amp;quot; video mode (mode 1). The normal display resolution on the Amstrad CPC is '''320x200''' (mode 1) while '''ZX Spectrum''' produces &amp;quot;only&amp;quot;  '''256x192''' pixels. Amstrad's screen can be reduced in size to match the Spectrum's (256x192, in Mode1) but then the actual display window is quite smaller than on a spectrum (on the same monitor) and has a larger border because the generated pixels are slightly smaller.&lt;br /&gt;
&lt;br /&gt;
*The size and aspect of the pixels in the Spectrum's bitmapped display are comparable to the pixels in Amstrad's mode 1 bitmapped display in that both produce approximately square pixels.&lt;br /&gt;
&lt;br /&gt;
*The '''Spectrum''''s '''video ram''' takes approx '''6K'''. &lt;br /&gt;
&lt;br /&gt;
*The '''Amstrad CPC''''s '''video ram''' takes '''16K''' (approx 12K when screen is reduced to Speccie's resolution).&lt;br /&gt;
&lt;br /&gt;
*The '''Spectrum''' has a fixed '''palette of 15 colours''' (8 colours with bright versions of each making 15 in total - LIGHT black is still black). &lt;br /&gt;
&lt;br /&gt;
* The Amstrad has 3 different [[Video modes|Video Modes]]. Mode 0 is 160x200 with 16 colours, mode 1 is 320x200 with 4 colours, mode 2 is 640x200 with 2 colours. All are bitmapped. The Spectrum only has 1 video mode, 256x192 which is bitmapped.&lt;br /&gt;
&lt;br /&gt;
*'''Amstrad CPC''' has a '''palette of 27 colours.''' In mode 0 you can choose 16 of these, in mode 1 you can choose 4 of these, in mode 2 you can choose 2 of these. The Amstrad's palette includes equivalent colours that match closely the Spectrum's colours.&lt;br /&gt;
&lt;br /&gt;
*The Spectrum's screen is &amp;quot;attribute&amp;quot; based. Each 8x8 cell can be assigned a background and foreground colour (and both colours must either be non-bright or bright). There is also the choice to flash the colours in each cell (the flash is a fixed rate and alternates between paper/pen and pen/paper).  This colouring results in &amp;quot;attribute/colour clash&amp;quot; on the Spectrum. The Amstrad's screen doesn't have this, and there is no restriction on how the colours can be placed.&lt;br /&gt;
&lt;br /&gt;
* The colours of each 8x8 &amp;quot;attribute&amp;quot; cell is defined by a block of ram following the Spectrum's bitmapped screen, each byte represents one cell and each byte defines paper colour, pen colour, flash enabled and bright enabled. The colours for the pens on the Amstrad are defined by writing to the Gate-Array's palette I/O registers. The pens are read from the pixel data and the resulting colour is looked up in the palette registers.&lt;br /&gt;
&lt;br /&gt;
*The '''Spectrum''' can display all '''15 colours on the screen.'''. With limitations (2 colours per 8x8pix squares...)&lt;br /&gt;
&lt;br /&gt;
* The Amstrad can only reproduce the attributes and 15 colours at the same time as shown by the Spectrum by using Amstrad's 16 colour mode, mode 0. However, this has wider pixels (approx 2x1 ratio) and a lower horizontal resolution. If the CPC's mode 1 resolution is chosen, it is not possible because only 4 colours can be chosen. &lt;br /&gt;
&lt;br /&gt;
* On the Amstrad the 6 raster interrupts allow palette colours to be changed allowing more than the theorical amount but this is also with limitations. This technique was commonly used in Speccy ports.&lt;br /&gt;
&lt;br /&gt;
*Normally Spectrum graphics is stored in 2 colours, which means 8 pixels for each byte. In Amstrad mode 1, each byte defines 4 pixels. So for the same graphics you often need twice the RAM on the Amstrad. (This is a case where graphics without transparency are used). If transparency is used, then the amount of data can be the same.&lt;br /&gt;
&lt;br /&gt;
* The Amstrad's screen size and position can be reprogrammed, the Spectrum's screen size and position is fixed. It is possible to program the Amstrad's screen to use the entire monitor display area (at the expensive of approx. 22K of video ram being used).&lt;br /&gt;
&lt;br /&gt;
====Sound====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Spectrum (128K model and later) and Amstrad both have an AY-3-8912 sound chip. (1.7Mhz clock for AY in spectrum, 1.0Mhz clock for AY in Amstrad). &lt;br /&gt;
&lt;br /&gt;
*Spectrum 48K had a 1-bit beeper sound. Playing sounds through the beeper is very CPU intensive. The Amstrad doesn't have a beeper. The only way to simulate the beeper sound would be to convert it to AY sound.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE: Sinclair Research (the Spectrum's manufacturer) was acquired by Amstrad after the Spectrum 128K had been made. '''&lt;br /&gt;
&lt;br /&gt;
Amstrad then improved the build quality and enhanced the Spectrum's design. The result was that the Spectrum +2, which was closer in looks and build to the CPC464/6128 (same kind of compact keyboard as CPC6128, but built-in &amp;quot;Datacorder&amp;quot;). The Spectrum +3 was also quite similar to the Amstrad CPC6128 because both had a internal 3&amp;quot; drive. So the Spectrum became closer in design to the CPC. However, the overall hardware of the Spectrum didn't change, the graphics were the same, the sound was the same, but those later Spectrum's had built in joysticks, built in cassette or disc, connections for printer etc, just like the CPC, but almost all of which the Amstrad had starting with the CPC464.&lt;br /&gt;
&lt;br /&gt;
===Disc drive===&lt;br /&gt;
&lt;br /&gt;
The Spectrum didn't have an official floppy disc interface so there were different interfaces.&lt;br /&gt;
In Russia the Betadisk interface is common, this used a WD1793 disc controller and 3.5&amp;quot; discs. This interface is incompatible with the Amstrad's.&lt;br /&gt;
&lt;br /&gt;
When Amstrad designed the +3, the used a similar disc interface to the Amstrad.&lt;br /&gt;
&lt;br /&gt;
The Amstrad designed Spectrum +3 has the following in common with the CPC6128:&lt;br /&gt;
* same disc media (3&amp;quot;)&lt;br /&gt;
* same disc controller (NEC765 compatible)&lt;br /&gt;
* the floppy controller is polled for data transfer&lt;br /&gt;
* Similar disc format (CP/M based)&lt;br /&gt;
&lt;br /&gt;
However, the Spectrum+3 uses a different DOS than the Amstrad CPC6128. This means that the functions for reading/writing files are different on the Spectrum compared to the CPC.&lt;br /&gt;
&lt;br /&gt;
The Spectrum's DOS is more powerful than the CPC's. It can read CPC discs, Spectrum +3 and PCW discs easily. In order for the Amstrad to read Spectrum and PCW discs, it needs to have a special XDPB (Expanded Disc Parameter Block) configuration installed.&lt;br /&gt;
&lt;br /&gt;
The Spectrum +3's DOS is based on the disc functions in Locoscript the CPC's DOS is AMSDOS. The Spectrum's DOS was developed after the CPCs, so clearly they saw the weakness in the CPC's DOS design and improved it.&lt;br /&gt;
&lt;br /&gt;
===Consequences of a Spectrum Port===&lt;br /&gt;
&lt;br /&gt;
====Disc Loading====&lt;br /&gt;
&lt;br /&gt;
The Spectrum +3's disc interface had a design that was close to the Amstrad CPC6128's. This meant that disc loading software that used the disc interface directly could be modified easily to be used on the CPC. There are disc versions of the Alkatraz, Hexagon and Speedlock loaders common to both the CPC and Spectrum.&lt;br /&gt;
&lt;br /&gt;
However, the method for accessing the DOS is different.&lt;br /&gt;
&lt;br /&gt;
The good thing is that both shared good disc interfaces, so a disc loading system on the Spectrum, if ported to the CPC would not be a bad thing.&lt;br /&gt;
&lt;br /&gt;
====Tape Loading====&lt;br /&gt;
&lt;br /&gt;
Both the Spectrum and Amstrad had a similar method for loading or saving on cassette. For both it is CPU intensive and for both the method of representing the 1 or 0 bits is the same. &lt;br /&gt;
&lt;br /&gt;
Some CPC games used a modified Spectrum tape loader (extracted from the Spectrum's ROM and modified for the Amstrad's hardware). &lt;br /&gt;
&lt;br /&gt;
Sometimes the Spectrum loader was modified for the CPC without exact knowledge of how it worked, this resulted in some games with bad loaders that either didn't check for errors, or which didn't work in some circumstances. This lead to unreliable loading. &lt;br /&gt;
&lt;br /&gt;
Loaders like this were used in a variety of games, not limited to Speccy Ports.&lt;br /&gt;
&lt;br /&gt;
Two good loaders that appeared on both systems are Alkatraz and Speedlock. Both were reliable and fast.&lt;br /&gt;
&lt;br /&gt;
The Amstrad's ROM loader was a bit better than the Spectrum's ROM loader because it had CRC error checking, compared to XOR based checksum and block based loading (so you could rewind and try a block again) compared to a single load.&lt;br /&gt;
&lt;br /&gt;
Consequences for porting to CPC:&lt;br /&gt;
&lt;br /&gt;
*If the loader was modified for CPC without good knowledge the loading would be unreliable. (e.g. errors are not detected, timings are bad, edge detection is dodgy).&lt;br /&gt;
&lt;br /&gt;
*On the good side, the Spectrum utilised the border to indicate both the stage of loading (indicated by different colours used in the border) and the loading progress, so a modified loader for CPC would also indicate loading progress. If messages were turned off in the Amstrad ROM loader you didn't have any indication of loading progress.&lt;br /&gt;
&lt;br /&gt;
Examples of loaders common to both Amstrad and Spectrum:&lt;br /&gt;
* Speedlock (commonly used by Ocean).&lt;br /&gt;
* Alkatraz (commonly used by US Gold).&lt;br /&gt;
&lt;br /&gt;
Spectrum loader ported to Amstrad:&lt;br /&gt;
* Aliens (UK version, original release).&lt;br /&gt;
&lt;br /&gt;
====Colours====&lt;br /&gt;
&lt;br /&gt;
The Spectrum palette (15 colours, bright at bottom):&lt;br /&gt;
&lt;br /&gt;
[[image:ZXSpectrum_palette.png|Spectrum palette (from wikipedia)]]&lt;br /&gt;
&lt;br /&gt;
The Amstrad palette (27 colours):&lt;br /&gt;
&lt;br /&gt;
[[image:AmstradCPC_palette.png|Amstrad palette (from wikipedia)]]&lt;br /&gt;
&lt;br /&gt;
A comparison of the palettes in CPC palette:&lt;br /&gt;
&lt;br /&gt;
[[image:CPC_Speccy_palette_comparison.png|Comparison of the palettes ]]&lt;br /&gt;
&lt;br /&gt;
From the comparison you can see that the Amstrad can reproduce the Spectrum's colours well, and its additional colours can provide extra shades and some colours the Spectrum can't show (e.g. orange).&lt;br /&gt;
&lt;br /&gt;
Consequences for porting to CPC:&lt;br /&gt;
* If the game was ported directly using only the Spectrum colours then the Amstrad version would have similar colours, when more appropiate colour's from it's palette could be used.&lt;br /&gt;
&lt;br /&gt;
What they should do for CPC:&lt;br /&gt;
* Recolour the graphics using the Amstrad's palette to improve the look.&lt;br /&gt;
&lt;br /&gt;
====Colour Clash====&lt;br /&gt;
&lt;br /&gt;
The cell based colouring used on the Spectrum has its disadvantages. [[image:clash.png|right|thumb|Colour clashing in Knight Tyme. Observe the appearance of the character sprite as it merges with the background. (Background colours have priority here in this game.)]]&lt;br /&gt;
&lt;br /&gt;
When moving a sprite over a background, or a sprite over another sprite, and if both have colours you have to decide which colours take priority. &lt;br /&gt;
&lt;br /&gt;
It is not possible to have all the colours together because of the colour limitation within each 8x8 cell. &lt;br /&gt;
&lt;br /&gt;
This then means that the graphics with a lower priority then takes on the colour of the higher priority graphics.&lt;br /&gt;
&lt;br /&gt;
If a sprite's colours takes priority, and it moves with pixel by pixel movement, as soon as it enters a new cell, the background will take on it's colours. The colour clash seems to extend furthur than the sprite. This is down to the 8x8 cell colouring.&lt;br /&gt;
&lt;br /&gt;
The 6 raster interrupts on the CPC can be used to change the colours on the screen. You can redefine all the available colours, e.g. each interrupt you could re-program all the 4 available colours in mode 1. This can be done to increase the number of colours visible.&lt;br /&gt;
However, while there are more visible colours, each region is still limited to the number of available colours (e.g. limited to 4 colours in mode 1). &lt;br /&gt;
&lt;br /&gt;
If a sprite passes between two raster interrupt regions it will suffer from a form of colour clash, where the part in the new region takes the colours from that region, and the part in the old region remains in the colours from that region.&lt;br /&gt;
&lt;br /&gt;
Various ports use the raster interrupts, but how they chose to use them differs.&lt;br /&gt;
&lt;br /&gt;
'''Possible resolutions on Spectrum:'''&lt;br /&gt;
* Remove colour from the display so that background and sprites use the same colours, clash is eliminated but the game is monocolour..&lt;br /&gt;
* Move sprites in cell based movements. The colours still take priority but the clash is less of a problem.&lt;br /&gt;
* Add a black border around the sprites. Clash occurs, but because of the border it is not/less seen.&lt;br /&gt;
&lt;br /&gt;
'''Consequences for porting to CPC:'''&lt;br /&gt;
* If colour priority, colour clash exists: CPC version has the colour clash simulated which is unnecessary.&lt;br /&gt;
* If 2 colours are used and colour clash eliminated: CPC version lacks colour, same as Spectrum&lt;br /&gt;
* If cell based movement is done, then CPC version has the same movement whereas it could be pixel perfect on CPC.&lt;br /&gt;
* If black border is used, CPC has the unnecessary black border.&lt;br /&gt;
* The CPC can't replicate the Spectrum's colour attribute system, this means a game converted to Amstrad's mode 1 has even less colours than the Spectrum version. The CPC version then has 4 colours, compared to up to 15 possible colours on the Spectrum.&lt;br /&gt;
&lt;br /&gt;
'''What should be done on CPC:'''&lt;br /&gt;
* Recolour and redesign the graphics appropiately for the CPC in either mode 1 or mode 0.&lt;br /&gt;
* Use the Amstrad interrupts and change the colours multiple times each frame, this will give each region (between each interrupt) it's own colours increasing the number of colours on screen. Each region is 52 scanlines in height, and the whole screen in width. Note that the colours must be set for each region for each frame to maintain them, and that the pixels within each region are still limited to 4 colours in mode 1. The colour regions like this are ideal for having different colours for the HUD and for the main game area. This can be a CPU intensive technique.&lt;br /&gt;
&lt;br /&gt;
Examples of colour clash ported to the CPC:&lt;br /&gt;
(These examples show colour clash implemented on the CPC in the same way as the spectrum would show it)&lt;br /&gt;
* Bionic Commando&lt;br /&gt;
&lt;br /&gt;
Examples of attribute based colour system ported to CPC:&lt;br /&gt;
* Badlands&lt;br /&gt;
&lt;br /&gt;
Examples of games with little colour because attribute colours have been removed:&lt;br /&gt;
* Peter Pack Rat&lt;br /&gt;
&lt;br /&gt;
Examples of using raster interrupts to increase colours:&lt;br /&gt;
* Pacmania and Black Tiger (main play area remains 2 colours)&lt;br /&gt;
* Strider 4 colours in game area, 4 colours in status panel.&lt;br /&gt;
* Super Wonder Boy (Monochrome background and monochrome sprites)&lt;br /&gt;
* [[Deflektor]] (main play area has one set of colours, status panel has another set)&lt;br /&gt;
&lt;br /&gt;
====Sound====&lt;br /&gt;
&lt;br /&gt;
There is 1 sound source on 48K spectrums: it's beeper, and 2 sources of sound on 128K spectrums: beeper and AY.&lt;br /&gt;
&lt;br /&gt;
Beeper sound is simple. The spectrum has a speaker which you can turn on/off through a I/O port on the Spectrum's ULA. To make different sounds, you turn it on and off at different rates, all under control of the CPU. Speaker sound is CPU intenstive because the timing is all done through the CPU and delay loops. The consequence on the Spectrum is that not many games have beeper music during the game, and those that do are often staccato like (e.g. Manic Miner) (the game takes some time to update, then some time for sound, and this repeats). If the sound was made for the Spectrum beeper, this would need to be converted to AY sound for the CPC, the result would not be exactly the same.&lt;br /&gt;
&lt;br /&gt;
Sound written for the AY in the Spectrum can't be ported directly because it would be out of tune, this is down to the difference in master clock given to the AY (1.7Mhz on Spectrum, 1.0Mhz on Amstrad). The music would need to be altered. When this is done, the music is almost the same.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that mostly the 128K version of Spectrum games had AY tunes, because the 128K model of the Spectrum is when the AY was introduced.&lt;br /&gt;
&lt;br /&gt;
Consequences for porting to CPC:&lt;br /&gt;
* No sound (if beeper only sound and it's not translated)&lt;br /&gt;
* Sound out of tune on CPC (if AY sound without some conversion)&lt;br /&gt;
* Sound is beeper like and staccato when it could be AY &amp;quot;native&amp;quot;&lt;br /&gt;
&lt;br /&gt;
What they should do for the CPC:&lt;br /&gt;
* Compose the tune for CPC&lt;br /&gt;
* For AY sounds, convert the music/effects to the CPC's AY master clock so that it is in tune (the tune may loose some of it's accuracy if this is done, especially regarding the hardware envelopes and noise, and this means the sound will not be exactly the same, but is much more acceptable).&lt;br /&gt;
&lt;br /&gt;
Examples of Spectrum Beeper sound converted to AY:&lt;br /&gt;
* Knightmare&lt;br /&gt;
* Last Ninja 2&lt;br /&gt;
* Super Hang On&lt;br /&gt;
&lt;br /&gt;
====Graphics====&lt;br /&gt;
&lt;br /&gt;
The Spectrum's graphics use 1 bit per pixel to define them. Each byte defines 8 pixels. The colour of each pixel is then defined by the attribute system.&lt;br /&gt;
&lt;br /&gt;
The attribute &amp;quot;ram&amp;quot; define the background colour (where a bit is 0), a foreground colour (where a bit is 1), if the dark variant of the colours should be used, or if the colours should flash at a fixed rate.&lt;br /&gt;
&lt;br /&gt;
If the background is a single colour, the sprites can be ORed on. If shading is to be used a mask is often stored with the pixels. The mask is used to remove or retain (depending on the mask type) pixels on the screen. The final result on the screen is the result of the mask then the sprite pixels.&lt;br /&gt;
&lt;br /&gt;
On the Amstrad, the number of bits to define a pixel, the number of colours that can be used, and the width of the pixels is different for each mode. &lt;br /&gt;
* Mode 0 uses 4 bits for each pixel. Each byte defines 2 pixels. 16 colours can be used without restriction. Wide pixels. This is lower resolution than the spectrum.&lt;br /&gt;
* Mode 1 uses 2 bits for each pixel. Each byte defines 4 pixels.  4 colours can be used without restriction. Pixels the same size as the spectrum.&lt;br /&gt;
* Mode 2 uses 1 bit for each pixel. Each byte defines 8 pixels. 2 colours can be used without restrictions. Pixels are thinner than the spectrum. This is higher resolution.&lt;br /&gt;
&lt;br /&gt;
Consequences:&lt;br /&gt;
* The pixel data and colours are stored in a different way than the CPC, so some conversion must be done before the graphics can be used. Either the graphics are remade, or often converted through some automatic process.&lt;br /&gt;
&lt;br /&gt;
The following sections describe possible ways to handle the graphics on the Amstrad.&lt;br /&gt;
&lt;br /&gt;
====Techniques used for Graphics====&lt;br /&gt;
&lt;br /&gt;
=====Graphics with transparency=====&lt;br /&gt;
&lt;br /&gt;
A common way to do this is on the Spectrum is to store 1 byte of mask, followed by 1 byte of pixel data, and to repeat this for the width of the sprite divided by 8. (Each byte representing a 8 pixel wide single line slice of the sprite).&lt;br /&gt;
&lt;br /&gt;
If we consider a sprite which is 16x16. Each byte contains 8 pixels. 2 bytes would be needed for pixel data and 2 bytes for mask. The total storage space required would be (2+2)*8 = 32 bytes.&lt;br /&gt;
&lt;br /&gt;
If we consider mode 1 on the Amstrad, and we used the same representation, we could freely use 4 colours for the sprites. The Amstrad would also need 2 times the ram space to store the data, because in mode 1 there is half the number of pixels per byte.&lt;br /&gt;
So, each byte contains 4 pixels. 4 bytes would be needed for pixel data and 4 for mask: (4+4)*8 = 64 bytes.&lt;br /&gt;
&lt;br /&gt;
However, if we sacrifice 1 colour, so we have 1 pen which is fully transparent and 3 for opaque sprite colours then we don't need the mask to be stored this way. The mask is common for all sprites and we could store this as a single 256 byte array. We would still need 4 bytes for the pixel data but the result now is: 4*8 = 32 bytes. The same weight as the Spectrum.&lt;br /&gt;
&lt;br /&gt;
Mode 2 is generally not used for games on the Amstrad because of it's lack of colour. The pixels in this mode are half as wide as the Spectrum's. If the Spectrum data was used directly, which it could be, then the sprites would be half the width of the Spectrum's. We would still be forced to store mask and pixels the same as on the Spectrum, and to maintain the same resolution we would need to double up each pixel, effectively magnifying it in the width by 2. The result would be twice the size of the Spectrum data.&lt;br /&gt;
&lt;br /&gt;
If mode 0 is used, we could either store a mask and byte, as for the Spectrum, or more commonly we use pen 0 for full transparent and leave the other 15 pens to define the sprite. We could then use half the number of pixels horizontally and lower resolution too. Each byte now contains 2 pixels. The sprite is 8x16 now = (8/2)*16 = 64 bytes. So again twice the size.&lt;br /&gt;
&lt;br /&gt;
Therefore, depending on the representation, this would determine how much ram is consumed on the Amstrad.&lt;br /&gt;
&lt;br /&gt;
The best it seems is to go for mode 1, and use a common mask table, with 3 colours per sprite.&lt;br /&gt;
&lt;br /&gt;
The situation is different if you consider tiles, here we don't need a mask.&lt;br /&gt;
&lt;br /&gt;
For the spectrum a 8x16 tile: (8/8)x16 = 16 bytes.&lt;br /&gt;
&lt;br /&gt;
CPC mode 1: (8/4)x16 = 32 bytes&lt;br /&gt;
&lt;br /&gt;
CPC mode 0: (4/2)x16 = 32 bytes&lt;br /&gt;
&lt;br /&gt;
CPC mode 2: (8/8)x16 = 16 bytes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So we show that some games could be recoloured and still use about the same amount of data as the Spectrum.&lt;br /&gt;
&lt;br /&gt;
Examples of games probably ported from the Spectrum (the use a Spectrum sized screen), in mode 1 and recoloured:&lt;br /&gt;
* HeroQuest&lt;br /&gt;
* [[Head Over Heels]]&lt;br /&gt;
* Shadow of the Beast&lt;br /&gt;
&lt;br /&gt;
Examples of games where re colouring could have been done:&lt;br /&gt;
* [[Pacmania]]&lt;br /&gt;
&lt;br /&gt;
=====Real-Time Conversion of Spectrum graphics=====&lt;br /&gt;
&lt;br /&gt;
A common way to get the Speccy game running on the CPC was to perform real-time conversion of Spectrum graphics.&lt;br /&gt;
&lt;br /&gt;
* Graphics are stored on the Amstrad in the same format as on the Spectrum (2 colour, 1BPP)&lt;br /&gt;
* Amstrad's mode 1 is used to maintain the same pixel resolution.&lt;br /&gt;
* A routine converts the graphics on-demand, while the game is running, into the form that is displayed for the screen.&lt;br /&gt;
&lt;br /&gt;
Needless to say, this enabled the port without the use of additional graphics artists, so it was cheaper.&lt;br /&gt;
&lt;br /&gt;
Disadvantages:&lt;br /&gt;
* This process takes a lot more CPU power compared to the Spectrum version, because in addition to drawing and erasing the sprites, the pixel data must also be converted at the same time. &lt;br /&gt;
* This resulted in a slower game.&lt;br /&gt;
* Amstrad version had less colours (often as little as 2 colours)&lt;br /&gt;
&lt;br /&gt;
Advantages:&lt;br /&gt;
* Pixel data took less RAM compared to storing it in Amstrad's mode 1 form, so could run on a 64K Ram machine (CPC464 and CPC664).&lt;br /&gt;
&lt;br /&gt;
=====Mode 1 and screen dimensions=====&lt;br /&gt;
&lt;br /&gt;
Amstrad's mode 1 is the closest mode which compares with the Spectrum's graphical abilities.&lt;br /&gt;
&lt;br /&gt;
The pixels are almost the same size. The CPCs screen dimensions can be reprogrammed to re-create the Spectrum's 256x192 resolution.&lt;br /&gt;
&lt;br /&gt;
However, the CPC has a different &amp;quot;pixel clock&amp;quot; compared to the Spectrum. The CPC was designed for a 320x200 display instead of a 256x192 display and in fact the the pixels are smaller on the screen when you compare mode 1 (the closest equivalent on the CPC) to the Spectrum.&lt;br /&gt;
&lt;br /&gt;
So when the screen is reprogrammed, you end up with a larger border on the CPC.&lt;br /&gt;
&lt;br /&gt;
This (the larger border) led to the false argument that the CPC's resolution was inferior to the Spectrum one although the amount of pixels on the screen is EXACTLY the same.&lt;br /&gt;
&lt;br /&gt;
There are advantages to reprogramming the screen dimension to match the Spectrum's.&lt;br /&gt;
* Graphics/levels would not need to be designed for a wider screen (320 compared to 256)&lt;br /&gt;
* For the Amstrad, a 320x200 screen normally takes 16K, but when reduced in size it takes 12K.&lt;br /&gt;
&lt;br /&gt;
====Original consequences (under construction)====&lt;br /&gt;
&lt;br /&gt;
The Amstrad CPC was one of the best 8-bit computers of its time in terms of graphical capabilities. But those advanced capabilities had an impact on CPU resources. &lt;br /&gt;
As so many games were ported from the Spectrum, a machine with decidedly lower visual specs, the Amstrad range could hardly benefit from its main advantage while lack of optimization meant that aspects as scroll or playing area fared even worse than the Spectrum versions. You have to remember that Spectrum had less resources taken by Video RAM, so could handle animation or scrolling more easily. It is also a misconception to believe the screen was downsized in those games to gain processor resources. It was only done to use the Speccy graphics more easily, and we can doubt the code was (re-)designed so such a screen reduction would even gain CPU resources.&lt;br /&gt;
&lt;br /&gt;
Interestingly, games in Mode 1 could have been good despite the lack of colours, if only those colours were used properly more often.&lt;br /&gt;
&lt;br /&gt;
Most of them got their graphic totally unchanged, displaying some kind of colour attributes &amp;quot;artifacts&amp;quot;, a tell-tale sign of a Speccy port.&lt;br /&gt;
&lt;br /&gt;
On the other hand, as mentioned before, those games weren't always bad. Games with no need of scrolling and with re-coded graphics could actually be good.&lt;br /&gt;
&lt;br /&gt;
=Lists of speccy ports=&lt;br /&gt;
Note: these lists are by no means comprehensive, they just include the most high-profile releases.&lt;br /&gt;
&lt;br /&gt;
=='''Computer originals Hits'''==&lt;br /&gt;
(most of them ended up being decent) :&lt;br /&gt;
&lt;br /&gt;
*[[H.A.T.E Hostile All Terrain Encounter]]&lt;br /&gt;
*Highway encounter&lt;br /&gt;
*Lotus turbo Esprit challenge&lt;br /&gt;
*Fighting Warrior&lt;br /&gt;
*Vendetta&lt;br /&gt;
*Hard Drivin' &lt;br /&gt;
*Way of the Tiger&lt;br /&gt;
*Last Ninja2 &lt;br /&gt;
*Myth, history in the making&lt;br /&gt;
*Saboteur I&lt;br /&gt;
*Saboteur II &lt;br /&gt;
*SWIV &lt;br /&gt;
*Shadow of the beast&lt;br /&gt;
&lt;br /&gt;
The numerous CodeMaster or Hewson games are not listed. Many of them were cheap budget Speccy games to begin with, and were quite well ported or remained good...&lt;br /&gt;
&lt;br /&gt;
=='''Well known franchises'''==&lt;br /&gt;
*Scooby Doo&lt;br /&gt;
*Thundercats.&lt;br /&gt;
*MASK 3 : Venom Strike Back &lt;br /&gt;
*Airwolf 2&lt;br /&gt;
*Batman: The Caped Crusader&lt;br /&gt;
&lt;br /&gt;
=='''Adult games'''==&lt;br /&gt;
*Sabrina &lt;br /&gt;
*Samantha fox strip poker.&lt;br /&gt;
*Strip poker II&lt;br /&gt;
&lt;br /&gt;
=='''Movie Franchises'''==&lt;br /&gt;
*Indianna Jones 3 action game.&lt;br /&gt;
*Back to the future 2 (half of the parts were Speccy Port)&lt;br /&gt;
*Big Trouble In Little China&lt;br /&gt;
&lt;br /&gt;
=='''Arcade hits'''==&lt;br /&gt;
*[[R-Type]] &lt;br /&gt;
*[[Pac-Mania]]&lt;br /&gt;
*Salamander&lt;br /&gt;
*Dragon Breed&lt;br /&gt;
*Scramble spirit&lt;br /&gt;
*[[Black Tiger]] - [[Black Tiger CPC-Spectrum Comparison]]&lt;br /&gt;
*Strider&lt;br /&gt;
*Bionic Commando&lt;br /&gt;
*Super Wonderboy&lt;br /&gt;
*Double Dragon 3&lt;br /&gt;
*Super Hang-On&lt;br /&gt;
*Enduro Racer&lt;br /&gt;
*Toobin'&lt;br /&gt;
*Xybots&lt;br /&gt;
*Pit fighter&lt;br /&gt;
*Cabal&lt;br /&gt;
*Street Fighter]&lt;br /&gt;
*Karnov&lt;br /&gt;
*Dynasty Wars&lt;br /&gt;
*Gauntlet 3&lt;br /&gt;
*Midnight resistance&lt;br /&gt;
&lt;br /&gt;
=='''Best known speccy ports'''==&lt;br /&gt;
&lt;br /&gt;
All those games are frequently used in 8bit wars style videos and reviews, hence they have served as a counter-argument to the CPC's superior abilities. Those games were well known hits ported on pretty much all computers of their time and therefore constituted the very basis of comparison between most systems of the era.&lt;br /&gt;
&lt;br /&gt;
*Shadow of the beast&lt;br /&gt;
*Myth, history in the making &lt;br /&gt;
*Gauntlet 3&lt;br /&gt;
*SWIV &lt;br /&gt;
*R-Type &lt;br /&gt;
*PacMania&lt;br /&gt;
*Salamander&lt;br /&gt;
*Dragon Breed&lt;br /&gt;
*Scramble spirit&lt;br /&gt;
*Black Tiger&lt;br /&gt;
*Strider&lt;br /&gt;
*Bionic Commando&lt;br /&gt;
*SuperWonderboy&lt;br /&gt;
*Double Dragon3&lt;br /&gt;
*Super Hang-On&lt;br /&gt;
*Enduro Racer&lt;br /&gt;
*Toobin&lt;br /&gt;
*Xybots&lt;br /&gt;
*Pit fighter&lt;br /&gt;
*Cabal&lt;br /&gt;
*Last Ninja2 &lt;br /&gt;
*Thundercats.&lt;br /&gt;
*Hard Drivin'&lt;br /&gt;
*Sabrina&lt;br /&gt;
*Samantha fox strip poker.&lt;br /&gt;
*Strip Poker II&lt;br /&gt;
*Airwolf 2&lt;br /&gt;
*Indianna Jones 3 action game.&lt;br /&gt;
*Back to the future 2&lt;br /&gt;
*Vendetta&lt;br /&gt;
&lt;br /&gt;
=The 3 levels of Speccy porting=&lt;br /&gt;
&lt;br /&gt;
Of course the level of porting could greatly depend on whatever strategy the programmers/graphists used to port the original Spectrum game.&lt;br /&gt;
&lt;br /&gt;
*A monochrome game could remain monochrome or be recolored for the CPC, or only parts of it (only sprites or Tiles but not both - mostly only sprites.)&lt;br /&gt;
*A colored game with design-wise graphics (character based design) could be the exact same yet with even less colours.&lt;br /&gt;
*Or Tiles/sprites could simply be completely well re-done/re-drawn, even in Mode 0 sometimes.&lt;br /&gt;
&lt;br /&gt;
==Rushed and Lazy==&lt;br /&gt;
&lt;br /&gt;
The game is exactly as on the Spectrum, even displaying graphical artifacts as Colour attributes and/or monochrome display for the game's window but not always the HUD, which may even often feature extra colours thanks to Raster colour changes, yet this doesn't really help to see what happens on the game's window.&lt;br /&gt;
&lt;br /&gt;
Also sprites may display Transparency/translucency with background's colour (=colour clash), a typical Spectrum &amp;quot;feature&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Probably achieved by using almost the exact Spectrum code and emulating the Spectrum attributes on the CPC.&lt;br /&gt;
&lt;br /&gt;
Examples : &lt;br /&gt;
*'''PacMania'''&lt;br /&gt;
[[File:Pacmania title.png]]&lt;br /&gt;
[[File:Pac04.png]]&lt;br /&gt;
&lt;br /&gt;
Typical example, yet it managed to be a nice game despite this. The title screen and HUD shows the color attributes and were almost completely unchanged, yet with less colours on screen than the Speccy version.&lt;br /&gt;
&lt;br /&gt;
Ironically, the game manages to display 6 colours in the 4 colours Mode1 - yet the game's area remains completely monochromatic (coded in 1 bit) and colour attributes artifacts are still present.&lt;br /&gt;
&lt;br /&gt;
*'''[[Black Tiger]]''': Same as PacMania&lt;br /&gt;
*'''Super Hang On''' : graphics Transparency/translucency&lt;br /&gt;
*'''Enduro Racer''' : same as Super Hang On, even more displayed as Sprites more often cross the different colored parts of the screen (while jumping)&lt;br /&gt;
*'''Bionic Commando''' : there are even inverted/negative colored sprites&lt;br /&gt;
*'''Sabrina''' : same as Bionic commando&lt;br /&gt;
*'''Gauntlet 3''' : HUD is properly recolored (3 shades) but in-game window is monochrome (1bit coded sprites and tiles)&lt;br /&gt;
*'''R-type''' : Monochrome background while sprites still are &amp;quot;coloured&amp;quot; as with Colour attributes, hence even featuring less colours than original Spectrum game, while the entire screen still displays more than the only 4 Mode1 colours...(HUD raster trick). This game was done in 3 weeks by only one man, who simply emulated the speccy stuff on CPC. Given that the Spectrum game was a great release the CPC port is not too bad.&lt;br /&gt;
&lt;br /&gt;
An special mention must go for '''Mevlut &amp;quot;Speccy&amp;quot; Dinc''', one of the worst offenders with nightmares as '''Big Trouble In Little China''', '''Enduro Racer''', '''Hammerfist''', '''Knightmare''', '''Last Ninja 2''', '''Last Ninja 2 Remix''', '''Prodigy''', '''Super Hang-On''' and '''Time Machine'''.&lt;br /&gt;
&lt;br /&gt;
==Semi-lazy==&lt;br /&gt;
&lt;br /&gt;
Well redone graphically, but not always as would actually be needed. &lt;br /&gt;
&lt;br /&gt;
Examples :&lt;br /&gt;
*'''HeroQuest''':  still has monochrome feeling (2 blue shades being used) while actually being properly 2 bit re-coded. Ditherings  use 3-colour gradients instead of the Spectrum's 2, and the grey adds a feeling of more colour.&lt;br /&gt;
*'''Strider''' has recoloured sprites, displaying no attributes, but Backgrounds remains monochrome, and the game is sluggish (because the CPU must still convert 1bpp graphics into 2bpp), yet the HUD+Raster trick enable a 6 colours displayed on screen and the HUD looks good.&lt;br /&gt;
*'''Shadow of the Beast''': No real 3-4 coloured ditherings or even additional colours thanks to dithering the 2 medium colours together in many graphics (exteriors or for many sprites), yet the square Spectrum attributes are not displayed, while the Spectrum version remains monochrome (in game window, not HUD) in order to simply avoid Colour clashes. Would have needed more development time and a real CPC version.&lt;br /&gt;
&lt;br /&gt;
==Good Job==&lt;br /&gt;
Those games are often more to be seen as proper Cross-Dev.&lt;br /&gt;
&lt;br /&gt;
Graphics, despite sharing a common ancestry, are well redone, and take into account the Amstrad power. Sometimes those games are not that well ported, yet their concept and gameplay are such that this is not that important: the game is simply too good to be annoyed by such detail as the use of Mode1, and they were still sufficiently re-done.&lt;br /&gt;
&lt;br /&gt;
*[[Head Over Heels]]&lt;br /&gt;
*[[Deflektor]]&lt;br /&gt;
*'''Switchblade''': the GX4000 cartridge version displays extra features such as large vertical ditherings in a lot of Red shades (sky) or PLUS Hardware sprites &amp;quot;patches&amp;quot; as extra coloured tiles. This is more than enough to get a properly coloured feeling.&lt;br /&gt;
&lt;br /&gt;
Some Speccy ports &amp;quot;done right&amp;quot; may also use Mode 0 instead of Mode 1, hence being graphically fully CPC (yet tiles or sprites are still comparable in dimensions). The result may vary from awful (the code is not optimised enough for CPC) to great (a well optimised Z80 game management engine with a different and accurate/efficient graphic display engine). This can be seen in '''Space Gun''': Mode 0 and even PLUS features, yet the attribute-designed-unmasked sprites remain, in a sluggish game.&lt;br /&gt;
&lt;br /&gt;
=Techniques used=&lt;br /&gt;
&lt;br /&gt;
==Monochromatic playfield and Sprite Masks==&lt;br /&gt;
&lt;br /&gt;
Having a monochrome playfield on ZX Spectrum is a common way to have no colour clashes - simply because there are no colours to clash! Also, most of those games then had masked sprites. This meant that each set of sprites had another &amp;quot;sprite set&amp;quot; for the mask, being actually 2x1bpp (bit per pixel) sets of data.&lt;br /&gt;
&lt;br /&gt;
Some games coders actually used this to get the Sprites coded in 2bpp and used one of the 4 inks in mode1 to be the mask. This then took up almsot no more RAM used by data than the original (concerning masked Graphics). As a result some of those speccy ports have sprites in another colour than the background, which is actually better in terms of playability/look.&lt;br /&gt;
&lt;br /&gt;
An example of this is '''Super wonder boy''' which could have even used one more colour for the sprites, but didn't.&lt;br /&gt;
&lt;br /&gt;
Needless to say, the Background Tiles and Letter fonts were still in 1bpp converted in real time so the CPU had no rest and such games weren't faster nor that much better looking.&lt;br /&gt;
&lt;br /&gt;
On the other hand, some games, despite having such Masked sprite totaling 2bpp had absolutely no sprite re-code at all (although this could have easily been prevented). '''Black Tiger''' is such a case.&lt;br /&gt;
&lt;br /&gt;
Nevertheless, those games had one advantage : the smooth movement of sprites.&lt;br /&gt;
&lt;br /&gt;
'''Examples :''' &lt;br /&gt;
&lt;br /&gt;
*Batman: The Caped Crusader&lt;br /&gt;
&lt;br /&gt;
Decently ported, As it use the 2bpp for the sprites in full potential. The sprites use 3 colours and the background 2 colours, including colour the unused by sprites, this make a poor background but the differently coloured sprites enable a better visibility.&lt;br /&gt;
&lt;br /&gt;
*Strider : like Batman: The Caped Crusader... sprites use 3 colours and background 2... the difference in used inks give the sprites some extra visibility.&lt;br /&gt;
&lt;br /&gt;
Strider also features some raster effect to get the HUD with extra colours, yet this certainly slow down the game a bit..&lt;br /&gt;
&lt;br /&gt;
*Super wonderboy (wonderboy2) : poor port... the sprites use only 2 colours while they could actually use 3 with no extra effort but some graphical job.&lt;br /&gt;
Yet compaired to spectrum version, the CPC version manage to have the sprite more visible thanks to their different ink.&lt;br /&gt;
&lt;br /&gt;
==Masked Backgrounds==&lt;br /&gt;
&lt;br /&gt;
Some (rare) games actually used a mask for the Bakcground tiles too. This explains why they could be fully recoded with no notable additional weight for the data. Such games are often Isometric games and are considered among the good speccy ports (or actual Cross-Dev).&lt;br /&gt;
&lt;br /&gt;
'''Examples :'''&lt;br /&gt;
&lt;br /&gt;
*'''Heroquest''': the Background tiles are also in 3 colours. Yet there is a really poor use of the mask colour.&lt;br /&gt;
*'''Head over Heels''': yet the colours are better used than in Heroquest. If you look carefully, there are 2 kind of &amp;quot;background&amp;quot; elements. &lt;br /&gt;
**Real non-masked Background (floor, walls) which use  the full 4 colours, &lt;br /&gt;
**and masked elements such as Sprites, Doors, Platforms... which are 3 colours only.&lt;br /&gt;
&lt;br /&gt;
==Unmasked games and CPC colour clashes==&lt;br /&gt;
This category includes some of the worse examples, since actual Spectrum deficiencies were ported to the CPC.&lt;br /&gt;
&lt;br /&gt;
*'''Bionic Commando'''&lt;br /&gt;
*'''Enduro Racer'''&lt;br /&gt;
&lt;br /&gt;
==Attribute/Character based Sprites and Animation==&lt;br /&gt;
&lt;br /&gt;
The cell based colouring used on the Spectrum has it's disadvantages. &lt;br /&gt;
&lt;br /&gt;
When moving a sprite over a background, or a sprite over another sprite, and if both have colours you have to decide which colours take priority. &lt;br /&gt;
&lt;br /&gt;
It is not possible to have all the colours together because of the colour limitation within each 8x8 cell. &lt;br /&gt;
&lt;br /&gt;
The problem then comes down to is that the graphics with a lower priority then takes the colour of the higher priority graphics. &lt;br /&gt;
&lt;br /&gt;
Such games had no smooth movement of sprites. The sprite moved &amp;quot;character per character&amp;quot;. As such the sprites are often unmasked, being not really more than &amp;quot;tile-mapped&amp;quot;. This meant the sprites had to actually fill the character tile or there would be artifacts introduced for the unmasked character's corner.&lt;br /&gt;
&lt;br /&gt;
This was a &amp;quot;good&amp;quot; other way to get rid of Attributes Clashes and having actual &amp;quot;colours&amp;quot; on ZX Spectrum. But some speccy ports were then emulating the attribute system, which can be quite bad because CPC in Mode1 has half the colours the Speccy has.&lt;br /&gt;
&lt;br /&gt;
*'''R-Type''' : the background has a smooth scrolling while the sprites are fixed character grid based.&lt;br /&gt;
&lt;br /&gt;
*'''Space gun''': this game was even released for Amstrad PLUS... Although coming very late in the CPC era is not really good and was probably rushed to the release. &lt;br /&gt;
&lt;br /&gt;
Yet the Character based engine enabled enormous sprites - but lacked smooth movement. Such a technique was actually used for quite a fair amount of Mode0 games. This is not &amp;quot;Speccy port&amp;quot; but it is good to to mention, as it was a common game design technique for both machines.&lt;br /&gt;
&lt;br /&gt;
*'''AMC (Astro Marines corps)''' : speccy version has no attribute clashes and is great. Amstrad version is in Mode0, feature multiscroll effect and remains fast.&lt;br /&gt;
&lt;br /&gt;
*'''Satan''' : this one is like R-Type, but the sprite layer is masked, so the game is monocolour on Spectrum. Still the Character system for the sprite has the advantage of giving good speed. The CPC version is fully in Mode0 and great, still the engine is clearly shared with speccy.&lt;br /&gt;
&lt;br /&gt;
==Rasters==&lt;br /&gt;
A common cheat was to get some Raster interrupt colour change so you could argue that the game is actually displaying more than 4 colours on screen while being Mode1. This is only to mimic some sort or Raster based Colours attributes yet is actually not a clever move in some way as getting some raster interrupt may take lots of CPU cycles. Also, despite the game displaying more than the allowed colours on screen, the playing area was still monochrome. In the end, all this did was getting the game even slower.&lt;br /&gt;
&lt;br /&gt;
On the other hand this could also be done right:&lt;br /&gt;
*'''Deflektor''' : Raster done right.&lt;br /&gt;
*'''Strider''' : Raster done right. (useless but good looking)&lt;br /&gt;
*'''Thundercats''' : (though there are more playing area colours)&lt;br /&gt;
*'''R-Type'''&lt;br /&gt;
*'''PacMania'''&lt;br /&gt;
*'''Black Tiger'''&lt;br /&gt;
&lt;br /&gt;
Many (if not all) of those games can actually run faster just by getting rid of CPU-wasting rasters.&lt;br /&gt;
&lt;br /&gt;
Providing a game had to deal with 1bpp to 2 bpp conversion, Software Sprites and Scrolling and complicated gameplay, adding some Raster interrupt to the equation is a really bad move and a good way to waste even more CPU time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Games| ]][[Category:Programming]][[Category:Games Programming]][[Category:CrossDev]][[Category:CPC History]][[Category:Non CPC Computers]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming_methods_used_in_games&amp;diff=90279</id>
		<title>Programming methods used in games</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming_methods_used_in_games&amp;diff=90279"/>
				<updated>2014-07-24T13:02:32Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This section describes specific programming methods which are used in games and the games that use them.&lt;br /&gt;
&lt;br /&gt;
=== Sampled Sound ===&lt;br /&gt;
&lt;br /&gt;
Sampled music:&lt;br /&gt;
* Prehistorik 2&lt;br /&gt;
* Xyphoes Fantasy&lt;br /&gt;
&lt;br /&gt;
The sampled speech is often stored as 4-bit values with 2 values packed into each byte. Each value is sent to one of the AY volume registers at a fixed rate.&lt;br /&gt;
&lt;br /&gt;
Sampled speech:&lt;br /&gt;
* Chase HQ &lt;br /&gt;
* Bad Dudes vs Dragon Ninja&lt;br /&gt;
* Robocop&lt;br /&gt;
&lt;br /&gt;
=== Rasters ===&lt;br /&gt;
&lt;br /&gt;
[[Rasters]] is a colour changing effect.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
Zynaps.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Double Buffer  ===&lt;br /&gt;
&lt;br /&gt;
Most good CPC games use the hardware double buffer technique in order to display sprites and/or to scroll the play area smoothly. &lt;br /&gt;
&lt;br /&gt;
In particular, two memory areas (instead of one) are reserved for the screen ram. &lt;br /&gt;
&lt;br /&gt;
In each frame, one of the two screens is displayed while the other is not visible but is drawn to. After the draw is done, the screens are exchanged using the hardware, so that the previously invisible one is now visible and the previously visible one is invisible.&lt;br /&gt;
&lt;br /&gt;
The exchange is done using the hardware specifically by changing the screen-offset, Reg 12 and 13 of the [[CRTC|CRTC]]). &lt;br /&gt;
&lt;br /&gt;
This process is repeated. &lt;br /&gt;
&lt;br /&gt;
The big advantage of this technique is that we can use a whole frame (or more) machine-time for our code (with no problems that arise when we alter screen ram at the same time the electron beam displays it on the monitor such as tearing or flickering). &lt;br /&gt;
&lt;br /&gt;
However, page flipping eats up a lot of memory area (which is crucial especially for 64Kb machines). This explains why a lot of games can have small game-areas&amp;amp;nbsp;!&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
Pac-Man Emulator&lt;br /&gt;
&lt;br /&gt;
=== Scrolling ===&lt;br /&gt;
&lt;br /&gt;
The following types of scroll are used:&lt;br /&gt;
&lt;br /&gt;
1. The player controls a character on the screen. When the character is moved the screen scrolls but the character remains in the same position on the screen. If they get to the edge of the map, they may walk up to the sides of the screen. If they walk back the other way when they reach a particular point on the screen it starts to scroll again and they remain in the same position.&lt;br /&gt;
&lt;br /&gt;
2. The player controls a character on the screen. When the character is moved towards the edges of the screen, the scroll moves a whole screen in width or height. The character is now on the opposite side. e.g. the character moves left, the screen scrolls by a whole screen width, the character is now on the right. The screen only scrolls when they get close to the sides.&lt;br /&gt;
&lt;br /&gt;
3. The screen always scrolls. The player controls a character who is either static or moves freely around the screen.&lt;br /&gt;
&lt;br /&gt;
=== Parallax/Multi Layer Scroll===&lt;br /&gt;
&lt;br /&gt;
Parallax or Multi Layer Scroll is an effect where there are 2 layers of tiles which scroll, one has priority over the other and often they move at different scroll rates.&lt;br /&gt;
&lt;br /&gt;
For example, the following games have parallax or multi layer scroll:&lt;br /&gt;
&lt;br /&gt;
* Wizard Willy&lt;br /&gt;
* Teenage Mutant Hero Turtles&lt;br /&gt;
* Astro Marine Corps (AMC)&lt;br /&gt;
* Turrican I and II&lt;br /&gt;
* Shadow Dancer &lt;br /&gt;
&lt;br /&gt;
==== Software Scrolling ====&lt;br /&gt;
&lt;br /&gt;
The screen is scrolled using the CPU only. This can be done by moving the data on the screen, or re-drawing it in a different position to give the illusion of scrolling.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
* Robocop&lt;br /&gt;
* Batman the Movie.&lt;br /&gt;
&lt;br /&gt;
==== Hardware Scrolling  ====&lt;br /&gt;
&lt;br /&gt;
Hardware scrolling is performed by changing the CRTC registers R12 and R13 to define the start address of the screen. The display is automatically wrapped at 16K, so continuous incrementation of these values will scroll the screen and wrap around. The code must then update the display for new graphics. &lt;br /&gt;
&lt;br /&gt;
The scrolling is in CRTC character sizes. &lt;br /&gt;
* 1 CRTC char horizontally is 2 bytes of RAM at a time which corresponds to 4 mode 0 pixels, 8 mode 1 pixels or 16 mode 2 pixels.&lt;br /&gt;
* The height of a CRTC char is defined by CRTC Register 9 (Max Raster), which is normally set to 7. Resulting in 8 scanlines per character.&lt;br /&gt;
&lt;br /&gt;
Horizontal scrolling can be made smoother by using R3 (Hsync Width), in addition to using R12 and R13 and makes the scrolling effectively half a CRTC char (therefore 2 mode 0 pixels, 4 mode 1 pixels or 8 mode 2 pixels). This can be done by changing the HSYNC width values between 5 and 6. The movement is an effect of how the monitor handles the HSYNC. This effect works well on Amstrad monitors, doesn't work on modern TFT screens and produces a black and white image on a MP-2 modulator because of the adjusted HSYNC timing. &lt;br /&gt;
&lt;br /&gt;
Vertical scrolling can be made smoother by using R5 (Vertical Adjust). This works on all monitors.&lt;br /&gt;
&lt;br /&gt;
More recent games (e.g. Prehistorik 2, Super Cauldron) use the rupture technique when doing vertical scroll to ensure the display is a constant number of scan lines in height, and so the refresh rate is always the same. &lt;br /&gt;
&lt;br /&gt;
Older games adjust R5 and don't use rupture (e.g. LED Storm, Legend of Kage), the time for a frame therefore varies by up to 7 extra scan-lines. This means the VSYNC to the monitor also varies in position by up to 7 extra scan-lines, and the stability of the image is then dependent on how the monitor handles the VSYNC. &lt;br /&gt;
&lt;br /&gt;
If the game uses a status panel, there are 2 ways to handle this.&lt;br /&gt;
# Redraw the panel when the screen is scrolled to compensate for it.&lt;br /&gt;
# Use rupture technique, the panel is in a different part of RAM and will not be affected by the scroll.&lt;br /&gt;
&lt;br /&gt;
This following is an incomplete list of games using hardware scrolling. From this list it can be seen that hardware scrolling has been used from 1984 :&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ''Title'' &lt;br /&gt;
| ''Year'' &lt;br /&gt;
| ''Vertical'' &lt;br /&gt;
| ''Horizontal'' &lt;br /&gt;
| ''R3'' &lt;br /&gt;
| ''R5'' &lt;br /&gt;
| ''Confirmed''&lt;br /&gt;
|-&lt;br /&gt;
| [[3D Stunt Rider]] &lt;br /&gt;
| 1985&lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Action Force]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[The Amazing Shrinking Man|Amazing Shrinking Man (The)]] &lt;br /&gt;
| 1986 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No&lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Anarchy]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Axys: The Last Battle]] &lt;br /&gt;
| 1991 &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[BMX Kidz]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| No&lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Bob Morane Science Fiction]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Boulder Dash]] &lt;br /&gt;
| 1984&lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Builderland]] &lt;br /&gt;
| 1991 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Canadair]] &lt;br /&gt;
| 1987&lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Cyborgs]] &lt;br /&gt;
| 1991 &lt;br /&gt;
| Yes&lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[DJ Puff's Volcanic Eruption]] &lt;br /&gt;
| 1992&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Doctor Who and the Mines of Terror]] &lt;br /&gt;
| 1986 &lt;br /&gt;
| Yes&lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Edge Grinder]] &lt;br /&gt;
|  &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
| Yes &lt;br /&gt;
| No&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Energy Warrior]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[FlySpy]] &lt;br /&gt;
| 1986 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Fusion 2]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Glen Hoddle Soccer]] &lt;br /&gt;
| 1985&lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Gothic]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Ghosts 'n' Goblins]] &lt;br /&gt;
| 1986 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Ghouls 'n' Ghosts]] &lt;br /&gt;
| 1989 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Into The Eagle's Nest]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes&lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Jinks]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Killer Cobra]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Led Storm]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Legend of Kage]] &lt;br /&gt;
| 1986 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Leviathan]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Diagonal &lt;br /&gt;
| scroll! &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Le 5eme Axe]] &lt;br /&gt;
| 1985 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Mission Genocide]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Monty Python's Flying Circus]] &lt;br /&gt;
| 1990 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Octoplex]] &lt;br /&gt;
| 1989 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| Yes(?) &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Out of This World]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Paraplane]] &lt;br /&gt;
| 1992 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Plate-Forme]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| No&lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Prehistorik 2]] &lt;br /&gt;
| 1992 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Prohibition]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Rastan]] &lt;br /&gt;
| 1987&lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Realm!]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
|-&lt;br /&gt;
| [[Star Sabre]] &lt;br /&gt;
| 2007&lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[The Return of the Jedi|Return of the Jedi (The)]] &lt;br /&gt;
| 1989 &lt;br /&gt;
| Diagonal &lt;br /&gt;
| scroll! &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Rick Dangerous 2]] &lt;br /&gt;
| 1990 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Rig Attack]] &lt;br /&gt;
| 1985&lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Rockford]] &lt;br /&gt;
| 1988&lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Roland on the Ropes]] &lt;br /&gt;
| 1984 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[The Sentinel|Sentinel (The)]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Skate Ball]] &lt;br /&gt;
| 1989 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Skateboard Kidz]] &lt;br /&gt;
| 1988&lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Skate Rock]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Skate Wars]] &lt;br /&gt;
| 1990 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Sly Spy Secret Agent]] &lt;br /&gt;
| 1990 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Star Avenger]] &lt;br /&gt;
| 1984 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Street Machine]] &lt;br /&gt;
| 1986 &lt;br /&gt;
| Yes&lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Striker in the Crypts of Trogan]] &lt;br /&gt;
| 1992 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Super Cauldron]] &lt;br /&gt;
| 1992 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Titan]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[T.L.L. - Tornado Low Level|Tornado Low Level]] &lt;br /&gt;
| 1985 &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Top Level]]&lt;br /&gt;
|  &lt;br /&gt;
| Yes&lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| [[Ultima Ratio]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Vector Ball]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| Diagonal &lt;br /&gt;
| scroll! &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Vikings (The)]] &lt;br /&gt;
| 1986 &lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Warhawk]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Wonderboy]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Xeno]] &lt;br /&gt;
| 1986 &lt;br /&gt;
| No &lt;br /&gt;
| Yes &lt;br /&gt;
| No &lt;br /&gt;
| No &lt;br /&gt;
| Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Rupture (or splitscreen)  ===&lt;br /&gt;
&lt;br /&gt;
A CRTC programming technique used to split the screen into more than one block vertically. &lt;br /&gt;
&lt;br /&gt;
The sizes of each block are defined using CRTC register R4. Vsync is turned off in all but one block (by setting CRTC R7 to a value larger than R4).&lt;br /&gt;
The start address of each block can be changed using CRTC registers R12 and R13.&lt;br /&gt;
&lt;br /&gt;
This allows each block to reference different ram or to hardware scroll one block while another is static.&lt;br /&gt;
&lt;br /&gt;
This method requires careful timing for the CRTC register updates, it also needs testing on all CRTC because there are differences of when each will accept and use the values programmed. However, the result can be made to work on all with more simple ruptures. Care must also be taken to ensure the timings are setup for a 50Hz screen.&lt;br /&gt;
&lt;br /&gt;
It is worth noting that some monitors are more tolerant to longer or shorter frames so the result may appear correctly on them and not on others.&lt;br /&gt;
In addition some games may have been programmed and tested on only 1 CRTC type so may not work on others.&lt;br /&gt;
&lt;br /&gt;
Wonderboy sets R4 every frame to the same value - reason unknown. But it doesn't use Rupture, because if this code is removed it works fine.&lt;br /&gt;
&lt;br /&gt;
This is a an incomplete list of games that use this technique, but according to this list the earliest games used this technique was 1987:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;FCK__ShowTableBorders&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| ''Title'' &lt;br /&gt;
| ''Year'' &lt;br /&gt;
| ''Confirmed''&lt;br /&gt;
|-&lt;br /&gt;
| [[Action Force|Action Force]] &lt;br /&gt;
| 1988 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Axys: The Last Battle|Axys]] &lt;br /&gt;
| 1991 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Dynamic Duo|Dynamic Duo]] &lt;br /&gt;
| 1988&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[DJ Puff's Volcanic Eruption]] &lt;br /&gt;
| 1992&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Energy Warrior|Energy Warrior]] &lt;br /&gt;
| 1987&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Enlightenment: Druid 2|Enlightenment: Druid 2]] &lt;br /&gt;
| 1988&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Grell and Falla|Grell and Falla]] &lt;br /&gt;
| 1992&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Mission Genocide|Mission Genocide]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Octoplex|Octoplex]] &lt;br /&gt;
| 1989 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Prehistorik 2|Prehistorik 2]] &lt;br /&gt;
| 1992 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Rastan]] &lt;br /&gt;
| 1987&lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
| [[Rockford]] &lt;br /&gt;
| 1988&lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
| [[Skate Ball|Skate Ball]] &lt;br /&gt;
| 1989 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Skatewars|Skatewars]] &lt;br /&gt;
| 1989 &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Skateboard Kidz|Skateboard Kidz]]&lt;br /&gt;
| 1988&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Snowstrike|Snowstrike]] &lt;br /&gt;
| 1990&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[Storm Warrior|Storm Warrior]] &lt;br /&gt;
| 1989&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Super Cauldron|Super Cauldron]] &lt;br /&gt;
| 1992 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Turrican|Turrican]] &lt;br /&gt;
| 1990 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
| [[Twin World (Ubi Soft)|Twin World (Ubi Soft)]] &lt;br /&gt;
| 1990 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Usagi Yojimbo|Usagi Yojimbo]] &lt;br /&gt;
| 1988&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Warhawk|Warhawk]] &lt;br /&gt;
| 1987 &lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Xyphoes Fantasy|Xyphoes Fantasy]] &lt;br /&gt;
| 1991&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Firmware==&lt;br /&gt;
&lt;br /&gt;
The following games are known to use firmware functions. This probably explains why they are poor. If the programmer had used the hardware directly they would have lots more cycles free which they could have used to make the game better.&lt;br /&gt;
&lt;br /&gt;
This list is not exhaustive.&lt;br /&gt;
&lt;br /&gt;
*Xevious&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90210</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90210"/>
				<updated>2014-07-13T14:37:13Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with the next features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
[[File:PlayCity schematic.png]]&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val are not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;br /&gt;
==PlayCity coding tips==&lt;br /&gt;
Interesting tips or &amp;quot;magic tricks&amp;quot; using the board should be documented here. If the code is long, you must put in other wiki page and link it here.&lt;br /&gt;
===PlayCity detection===&lt;br /&gt;
We are going to use the NMI interrupt generator to check if our program is running in a CPC with a PlayCity board.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; PlayCity check&lt;br /&gt;
; (c) 2013 SyX&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
; Constantes&lt;br /&gt;
CTC_TIM1            EQU $F881       ; Channel 1 (I: Cursor CRTC | O: NMI) &lt;br /&gt;
CTC_START_TIMER256  EQU %00110111&lt;br /&gt;
CTC_STOP_CHANNEL    EQU %00000011&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; NOTE: The lower ROM must be disabled before to run this code.&lt;br /&gt;
check_playcity&lt;br /&gt;
    ; Disable interrupts&lt;br /&gt;
    DI&lt;br /&gt;
    &lt;br /&gt;
    ; Install NMI handler&lt;br /&gt;
    LD   A,$C3                  ; JP $xxxx&lt;br /&gt;
    LD   HL,nmi_interrupt&lt;br /&gt;
    LD   ($0066),A&lt;br /&gt;
    LD   ($0067),HL&lt;br /&gt;
&lt;br /&gt;
    ; Initialize playcity variable to 0&lt;br /&gt;
    XOR  A&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Wait VBlank&lt;br /&gt;
    LD   B,$F5&lt;br /&gt;
.wait_vbl&lt;br /&gt;
    IN   A,(C)&lt;br /&gt;
    RRA&lt;br /&gt;
    JR   NC,.wait_vbl&lt;br /&gt;
    &lt;br /&gt;
    ; Initialize CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   HL,32                  ; 32 scanlines&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_START_TIMER256&lt;br /&gt;
    OUT  (C),A                  ; Enable Timer &lt;br /&gt;
    OUT  (C),L                  ; Set new time constant&lt;br /&gt;
&lt;br /&gt;
    ; Extra delay&lt;br /&gt;
    LD   IX,33 * 4 - 1          ; Wait 33 scanlines&lt;br /&gt;
    CALL wait_scanlines_ix&lt;br /&gt;
   &lt;br /&gt;
    LD   A,(playcity)&lt;br /&gt;
    OR   A&lt;br /&gt;
    JR   NZ,.playcity_detected&lt;br /&gt;
    ; No PlayCity detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
.playcity_detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
nmi_interrupt&lt;br /&gt;
    PUSH BC&lt;br /&gt;
    PUSH AF&lt;br /&gt;
&lt;br /&gt;
    ; Change playcity variable&lt;br /&gt;
    LD   A,$FF&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Disable CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_STOP_CHANNEL&lt;br /&gt;
    OUT  (C),A                  ; Disable Timer &lt;br /&gt;
&lt;br /&gt;
    POP  AF&lt;br /&gt;
    POP  BC&lt;br /&gt;
    EI&lt;br /&gt;
    RETN&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; Wait scanlines&lt;br /&gt;
; INPUT:&lt;br /&gt;
;   IX: Scanlines to wait * 4 - 1&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
wait_scanlines_ix&lt;br /&gt;
    DEFS 5,0                                ; (5) &lt;br /&gt;
&lt;br /&gt;
.loop_wait_scanlines_ix                      &lt;br /&gt;
    DEFS 6                                  ; (6)&lt;br /&gt;
    DEC  IX                                 ; (3)&lt;br /&gt;
    LD   A,IXH                              ; (2)&lt;br /&gt;
    OR   IXL                                ; (2)&lt;br /&gt;
    JR   NZ,.loop_wait_scanlines_ix         ; (2/3)&lt;br /&gt;
                                            ; Total loop --&amp;gt; 16 * (IY - 1) + 15&lt;br /&gt;
    RET                                     ; (3)&lt;br /&gt;
                                            ; Total Routine --&amp;gt; 64 * SCANLINES&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
playcity&lt;br /&gt;
    DEFS 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;br /&gt;
&lt;br /&gt;
== Software Supporting PlayCity ==&lt;br /&gt;
[[Software_Supporting_PlayCity|List of software supporting the board.]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90209</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90209"/>
				<updated>2014-07-13T14:33:52Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with the next features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
[[File:PlayCity schematic.png]]&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val are not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;br /&gt;
==More Coding Examples==&lt;br /&gt;
Interesting tricks using the board should be docummented here. If the code is long, you must put in other wiki page and link it here.&lt;br /&gt;
===PlayCity detection===&lt;br /&gt;
We are going to use the NMI interrupt generator to check if our program is running in a CPC with a PlayCity board.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; PlayCity check&lt;br /&gt;
; (c) 2013 SyX&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
; Constantes&lt;br /&gt;
CTC_TIM1            EQU $F881       ; Channel 1 (I: Cursor CRTC | O: NMI) &lt;br /&gt;
CTC_START_TIMER256  EQU %00110111&lt;br /&gt;
CTC_STOP_CHANNEL    EQU %00000011&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; NOTE: The lower ROM must be disabled before to run this code.&lt;br /&gt;
check_playcity&lt;br /&gt;
    ; Disable interrupts&lt;br /&gt;
    DI&lt;br /&gt;
    &lt;br /&gt;
    ; Install NMI handler&lt;br /&gt;
    LD   A,$C3                  ; JP $xxxx&lt;br /&gt;
    LD   HL,nmi_interrupt&lt;br /&gt;
    LD   ($0066),A&lt;br /&gt;
    LD   ($0067),HL&lt;br /&gt;
&lt;br /&gt;
    ; Initialize playcity variable to 0&lt;br /&gt;
    XOR  A&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Wait VBlank&lt;br /&gt;
    LD   B,$F5&lt;br /&gt;
.wait_vbl&lt;br /&gt;
    IN   A,(C)&lt;br /&gt;
    RRA&lt;br /&gt;
    JR   NC,.wait_vbl&lt;br /&gt;
    &lt;br /&gt;
    ; Initialize CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   HL,32                  ; 32 scanlines&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_START_TIMER256&lt;br /&gt;
    OUT  (C),A                  ; Enable Timer &lt;br /&gt;
    OUT  (C),L                  ; Set new time constant&lt;br /&gt;
&lt;br /&gt;
    ; Extra delay&lt;br /&gt;
    LD   IX,33 * 4 - 1          ; Wait 33 scanlines&lt;br /&gt;
    CALL wait_scanlines_ix&lt;br /&gt;
   &lt;br /&gt;
    LD   A,(playcity)&lt;br /&gt;
    OR   A&lt;br /&gt;
    JR   NZ,.playcity_detected&lt;br /&gt;
    ; No PlayCity detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
.playcity_detected&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
    .&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
nmi_interrupt&lt;br /&gt;
    PUSH BC&lt;br /&gt;
    PUSH AF&lt;br /&gt;
&lt;br /&gt;
    ; Change playcity variable&lt;br /&gt;
    LD   A,$FF&lt;br /&gt;
    LD   (playcity),A&lt;br /&gt;
&lt;br /&gt;
    ; Disable CTC timer 1 (NMI generator)&lt;br /&gt;
    LD   BC,CTC_TIM1&lt;br /&gt;
    LD   A,CTC_STOP_CHANNEL&lt;br /&gt;
    OUT  (C),A                  ; Disable Timer &lt;br /&gt;
&lt;br /&gt;
    POP  AF&lt;br /&gt;
    POP  BC&lt;br /&gt;
    EI&lt;br /&gt;
    RETN&lt;br /&gt;
&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
; Wait scanlines&lt;br /&gt;
; INPUT:&lt;br /&gt;
;   IX: Scanlines to wait * 4 - 1&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
wait_scanlines_ix&lt;br /&gt;
    DEFS 5,0                                ; (5) &lt;br /&gt;
&lt;br /&gt;
.loop_wait_scanlines_ix                      &lt;br /&gt;
    DEFS 6                                  ; (6)&lt;br /&gt;
    DEC  IX                                 ; (3)&lt;br /&gt;
    LD   A,IXH                              ; (2)&lt;br /&gt;
    OR   IXL                                ; (2)&lt;br /&gt;
    JR   NZ,.loop_wait_scanlines_ix         ; (2/3)&lt;br /&gt;
                                            ; Total loop --&amp;gt; 16 * (IY - 1) + 15&lt;br /&gt;
    RET                                     ; (3)&lt;br /&gt;
                                            ; Total Routine --&amp;gt; 64 * SCANLINES&lt;br /&gt;
; ---------------------------------------------------------------------------&lt;br /&gt;
playcity&lt;br /&gt;
    DEFS 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;br /&gt;
&lt;br /&gt;
== Software Supporting PlayCity ==&lt;br /&gt;
[[Software_Supporting_PlayCity|List of software supporting the board.]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Peripheral_Soft_Reset&amp;diff=90208</id>
		<title>Peripheral Soft Reset</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Peripheral_Soft_Reset&amp;diff=90208"/>
				<updated>2014-07-12T16:44:55Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Port F8FFh is a documented, but rarely known I/O address, used by the standard BIOS functions MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h). These functions are usually executed when starting a binary program with RUN&amp;quot;FILENAME.BIN&amp;quot;, both functions do issue an &amp;quot;OUT [F8FFh],FFh&amp;quot;. This feature is intended to allow Peripherals to re-initialize themselves when needed. From the official [[SOFT158]] specs:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;All expansion peripherals should be reset when an output is performed to I/O channel #F8FF. In particular a peripheral that generates interrupts must not generate an interrupt until it is re-initialised after such an output has been performed.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Most or all peripherals (including Amstrad's own [[DDI-1]]) aren't following that suggestion, and usually there is no need to do so. There may be a few special cases there hardware could take use of it, such like interrupt generating devices, especially if they do access formerly allocated memory.&lt;br /&gt;
&lt;br /&gt;
== Avoid this ==&lt;br /&gt;
&lt;br /&gt;
* Software should never write to (or even read from) Port F8FFh. That might cause connected Peripherals to reset themselves.&lt;br /&gt;
&lt;br /&gt;
* Hardware should not perform any actions (other than the intended Soft Reset action) upon accessing Port F8FFh. Eg. producing hardware that formats the disc on write to Port F8FFh would be no good. This applies also on incompletely decoded addresses, eg. formatting on write to Port F8F0h, but also mirroring that action to F8FFh.&lt;br /&gt;
&lt;br /&gt;
* When intentionally using the feature, be sure to have the port fully decoded. Ie. do not re-initialize your hardware on writes to other 'nearby' ports like F8EFh ([[Schneider RS232 Interface]]).&lt;br /&gt;
&lt;br /&gt;
== Known Hardware ==&lt;br /&gt;
&lt;br /&gt;
The Soft Reset feature is useful (initialize hardware expansions), but no used a lot, the [[PlayCity]] is the only hardware expansion using intentionally this feature (though when reverse engineering things by only examining the software drivers one may easily miss its presence, since the OUT [F8FFh] is issued by the BIOS, not by the driver).&lt;br /&gt;
&lt;br /&gt;
Aside the [[PlayCity]], the other known hardware that is (maybe unintentionally) using Port F8FFh is [[CPCISA by Yarek]]. &lt;br /&gt;
&lt;br /&gt;
Moreover, there are probably various devices that do not directly use Port F8FFh, but that do react to the OUT because of incomplete port decoding. For example, the [[ACU Real Time Clock (DIY)]] decodes only A10,A4,A3 of its Port FBFFh, and so, it will also react to OUT [F8FFh],FFh.&lt;br /&gt;
&lt;br /&gt;
== Offical Specs ==&lt;br /&gt;
&lt;br /&gt;
* [[Media:S158ap12.pdf|SOFT 158 Appendix 12 (XII) (The Hardware)]] - general info on Port F8FFh (page 3)&lt;br /&gt;
* [[Media:S968ap13.pdf|SOFT 968 Appendix 13 (XIII) (Hints Tips and Workarounds)]] - info on Port F8FFh and interrupts (page 7)&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=90198</id>
		<title>Software Supporting PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=90198"/>
				<updated>2014-07-10T20:02:48Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All the software that supports the [[PlayCity]] expansion board is listed in this page for giving it better visibility.&lt;br /&gt;
&lt;br /&gt;
It's interesting to explain in a few sentences which features of the board the software is using and if you need to press any key or select a menu option to enable these special features. Of course, if the graphical side is improved, then don't be shy and add a few screenshots for catching the eye of future users of your software.&lt;br /&gt;
&lt;br /&gt;
== Cyber Chicken ==&lt;br /&gt;
* [[Cyber Chicken]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90197</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90197"/>
				<updated>2014-07-10T20:01:59Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with the next features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
[[File:PlayCity schematic.png]]&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val are not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;br /&gt;
&lt;br /&gt;
== Software Supporting PlayCity ==&lt;br /&gt;
[[Software_Supporting_PlayCity|List of software supporting the board.]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=90196</id>
		<title>Software Supporting PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Software_Supporting_PlayCity&amp;diff=90196"/>
				<updated>2014-07-10T20:00:36Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: Created page with &amp;quot;All the software that supports the PlayCity expansion board is listed in this page for giving it better visibility.  It's interesting to explain in a few sentences which featu...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All the software that supports the PlayCity expansion board is listed in this page for giving it better visibility.&lt;br /&gt;
&lt;br /&gt;
It's interesting to explain in a few sentences which features of the board the software is using and if you need to press any key or select a menu option to enable these special features. Of course, if the graphical side is improved, then don't be shy and add a few screenshots for catching the eye of future users of your software.&lt;br /&gt;
&lt;br /&gt;
== Cyber Chicken ==&lt;br /&gt;
* [[Cyber Chicken]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90172</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90172"/>
				<updated>2014-07-09T18:49:45Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with the next features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
[[File:PlayCity schematic.png]]&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val are not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90171</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90171"/>
				<updated>2014-07-09T18:27:11Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
The PlayCity is a CPC expansion with the next features:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
[[File:PlayCity schematic.png]]&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val aree not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Peripherals&amp;diff=90170</id>
		<title>Peripherals</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Peripherals&amp;diff=90170"/>
				<updated>2014-07-09T18:24:51Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''You can also check the Category : Peripherals for a complete list of CPCwiki pages on the matter.'''&lt;br /&gt;
&lt;br /&gt;
* [[I/O Port Summary]]&lt;br /&gt;
&lt;br /&gt;
''Please try to keep things in alphabetical order.''&lt;br /&gt;
&lt;br /&gt;
== Built-in Peripherals ==&lt;br /&gt;
&lt;br /&gt;
=== Built-in Chipset ===&lt;br /&gt;
&lt;br /&gt;
* [[765 FDC]] - Floppy Disc Controller&lt;br /&gt;
* [[8255]] - PIO - I/O controller&lt;br /&gt;
* [[Arnold V Specs Revised]] - Arnold V (CPC+) Technical Specification&lt;br /&gt;
* [[AY-3-8912]] - Sound chip / keyboard controller&lt;br /&gt;
* [[CRTC]] - Video chip&lt;br /&gt;
* [[Gate Array]] - Custom chip (frequency generation, colors, bank switching)&lt;br /&gt;
* [[Power Supply for CPC and CPC plus]]&lt;br /&gt;
* [[Printer Port]]&lt;br /&gt;
&lt;br /&gt;
=== Built-in connectors: pinout ===&lt;br /&gt;
&lt;br /&gt;
* [[Connector:2nd disc drive (CPC664, CPC6128, CPC6128+)|2nd disc drive (CPC664, CPC6128, CPC6128+)]]&lt;br /&gt;
* [[Connector:Analogue joystick (CPC Plus only)|Analogue joystick (CPC Plus only)]]&lt;br /&gt;
* [[Connector:Aux socket (CPC Plus only)|Aux socket (CPC Plus only)]] (Lightgun)&lt;br /&gt;
* [[Connector:Cartridge Slot (CPC Plus only)|Cartridge Slot (CPC Plus only)]]&lt;br /&gt;
* [[Connector:Cassette recorder|Cassette recorder]]&lt;br /&gt;
* [[Connector:Digital joystick|Digital joystick]]&lt;br /&gt;
* [[Connector:Expansion port|Expansion port]]&lt;br /&gt;
* [[Connector:Monitor|Monitor]]&lt;br /&gt;
* [[Connector:Printer port|Printer port]]&lt;br /&gt;
* [[Connector:Stereo sound|Stereo sound]]&lt;br /&gt;
&lt;br /&gt;
=== Built-in Firmware ===&lt;br /&gt;
&lt;br /&gt;
* [[BIOS Functions]]&lt;br /&gt;
* [[Locomotive BASIC]] (reference for BASIC commands, functions and error messages)&lt;br /&gt;
* [[Technical information about Locomotive BASIC]] (encoding of BASIC programs in memory)&lt;br /&gt;
&lt;br /&gt;
== Data transfer ==&lt;br /&gt;
&lt;br /&gt;
=== Modems ===&lt;br /&gt;
&lt;br /&gt;
* [[Commstar v21/23 modem]] ([[PACE]])&lt;br /&gt;
* [[Data Research CH301S modem]] (greek company)&lt;br /&gt;
* [[Digitelec DTL 2000/2100 Modem]]&lt;br /&gt;
* [[EPTA modem]] (sold by Greek mag ΕΠΤΑ)&lt;br /&gt;
* [[KDS Communicator 104]] (connects directly to expansion port) ([[KDS Electronics]])&lt;br /&gt;
* [[Mini-Max Modem|KDS Mini-Max Modem]] (connects via RS232 interface) ([[KDS Electronics]])&lt;br /&gt;
* [[MicroLink Dual-Speed Modem]] ([[MicroLink]]) [[File:Microlink.pdf|Mircolink Manual]] and [[File:Micronet.pdf|Micronet manual]], provided by ''Spookspring''&lt;br /&gt;
* [[MicroLink Multi-Speed Modem]] ([[MicroLink]])&lt;br /&gt;
* [[Cirkit_Prestel_Link_Amstrad_Interface]] (acoustic coupler bundled with [[Cirkit serial interface]]) ([[Cirkit]])&lt;br /&gt;
* [[Schneider BTX Modul]] (for German Bildschirmtext) ([[Schneider]])&lt;br /&gt;
* [[Loritel]] (for french Minitel) ([[Loriciel|Loriciels]])&lt;br /&gt;
&lt;br /&gt;
=== Serial Interfaces ===&lt;br /&gt;
&lt;br /&gt;
* ([[RS232|overview of RS232 interfaces]])&lt;br /&gt;
* [[Aleste 520EX]] (a CPC clone with built-in RS232, intended for serial mouse) ([[Patisonic]])&lt;br /&gt;
* [[AMSSIO]] (four different versions) (RS232 interface) (DIY) (Martin Zacho)&lt;br /&gt;
* [[Amstrad Serial Interface]] ([[Amstrad]])&lt;br /&gt;
* [[Cirkit serial interface]] ([[Cirkit]])&lt;br /&gt;
* Cirkit twin-port serial interface (resold by [[Microstyle]])&lt;br /&gt;
* [[CPC Booster|CPC Booster/CPC Booster+]] (modern multifunction expansion, including RS232)&lt;br /&gt;
* [[CPCI RS232 Interface]] (DIY) ([[CPC Schneider International Sonderheft]])&lt;br /&gt;
* [[Data Media Disc System]] (disc drive with built-in RS232 interface) ([[Data Media]])&lt;br /&gt;
* [[KDS Electronics Serial Interface|KDS Serial Interface]] ([[KDS Electronics]])&lt;br /&gt;
* [[Panda Electronics Communications Interface Unit]] (dual RS232 plus 8bit printer port) (Panda Electronics Ltd)&lt;br /&gt;
* [[RS-232 para Amstrad]] ([[MHT Ingenieros]])&lt;br /&gt;
* [[SCA CPC Prolink]] ([[SCA Products]])&lt;br /&gt;
* [[Schneider RS232 Interface]] ([[Schneider]])&lt;br /&gt;
* [[Schneiderware V/24 Interface]] (DIY) ([[CPC Schneider International]])&lt;br /&gt;
* [[Simple RS232 for Printer usage]] (DIY) (one-directional, transmit only)&lt;br /&gt;
* [[Spectre Comms Serial Interface]] with Cage Comms software ([[Spectre Communications Ltd]])&lt;br /&gt;
* [[Vortex Disc Drives]] (disc drive/interface with optional RS232 port) ([[Vortex Computersysteme]])&lt;br /&gt;
* [[Z80-SIO dual ports RS232 interface for CPC (French)]] (DIY) (Philippe Lebel)&lt;br /&gt;
* [[Dual RS232]] ([[Timatic Systems]])&lt;br /&gt;
&lt;br /&gt;
=== Teletext ===&lt;br /&gt;
&lt;br /&gt;
* [[Teletext adaptor]] ([[Microtext Ltd.]])&lt;br /&gt;
* [[Volex TTX 2000a|Volex TTX 2000a Teletext-Telesoftware Adaptor]] (Volex Electronics)&lt;br /&gt;
&lt;br /&gt;
=== Others ===&lt;br /&gt;
&lt;br /&gt;
* [[CPC Booster|CPC Booster/CPC Booster+]]&lt;br /&gt;
* [[Virtual Net 96]] ([[Wizcat]])&lt;br /&gt;
* [[Red Box]] ([[General Information Systems]])&lt;br /&gt;
* [[CPC-ENet|CPC Ethernet Card]] ([[rpalmer]])&lt;br /&gt;
&lt;br /&gt;
== Digitizer / Scanner ==&lt;br /&gt;
&lt;br /&gt;
* [[ARA Video Digitizer]] ([[Jagot &amp;amp; Leon]])&lt;br /&gt;
* [[Electric Studio C6]] ([[Electric Studio]])&lt;br /&gt;
* [[Dart Scanner for DMP-Printers]] (the optics are attached to the printer head) ([[Dart Electronics]])&lt;br /&gt;
* [[Omni-Reader]] (Oberon International) (scanner with text recognition) (advert on ACU 1-1987, page 83)&lt;br /&gt;
* [[VIDI digitizer]] ([[Rombo Productions]])&lt;br /&gt;
&lt;br /&gt;
== Drives ==&lt;br /&gt;
&lt;br /&gt;
=== Disc Drives ===&lt;br /&gt;
&lt;br /&gt;
* [[3½&amp;quot; &amp;amp; 5¼&amp;quot; Disk Drives]]&lt;br /&gt;
* [[Amstrad Disk Drive|Amstrad DDI-1 / FD-1 Disk Drive]] ([[Amstrad]])&lt;br /&gt;
* [[Cumana 3&amp;quot; Disk Drive]] ([[Cumana]])&lt;br /&gt;
* [[Data Media Disc System]] ([[Data Media]])&lt;br /&gt;
* [[Jasmin AM5D 5 &amp;quot;1/4 floppy drive]]&lt;br /&gt;
* [[KDS 5¼&amp;quot; Disc Drive]] ([[KDS Electronics]])&lt;br /&gt;
* [[TIMDISC 5¼&amp;quot; 2nd Disc Drive]] ([[Timatic Systems]])&lt;br /&gt;
* [[F1|Vortex Disc Drives]] ([[Vortex Computersysteme|Vortex]])&lt;br /&gt;
* [[Four floppy drives with Amstrad disc interface]]&lt;br /&gt;
&lt;br /&gt;
=== Exotic Drives ===&lt;br /&gt;
&lt;br /&gt;
* [[Codemasters CD]] (loads games from Audio CD via joystick port) ([[Codemasters]])&lt;br /&gt;
* [[Draysoft Doubler]] (external tape input, for tape-to-tape transfers) ([[Evesham Micros]])&lt;br /&gt;
&lt;br /&gt;
=== Hard Disc Drives ===&lt;br /&gt;
&lt;br /&gt;
* [[CPC-IDE]] (modern) (discontinued prototype)&lt;br /&gt;
* [[Dobbertin Harddisc]] ([[Dobbertin]])&lt;br /&gt;
* [[IDE8255]] internal/extrernal IDE/CF interface ([[Yarek]])&lt;br /&gt;
* [[SYMBiFACE II]] (modern) (IDE and various other features)&lt;br /&gt;
* [[Vortex Winchester Drive]] ([[Vortex Computersysteme|Vortex]])&lt;br /&gt;
* [[IDE/8255]] external IDE Interface ([[rpalmer]])&lt;br /&gt;
&lt;br /&gt;
=== Drive Emulators ===&lt;br /&gt;
&lt;br /&gt;
* [[HxC Floppy Emulator]]&lt;br /&gt;
* [[SDiskEmul]]&lt;br /&gt;
* [[TFE Floppy Emulator]]&lt;br /&gt;
* [[VDrive]]&lt;br /&gt;
&lt;br /&gt;
== Hardware debuggers/Hacking devices ==&lt;br /&gt;
&lt;br /&gt;
* [[Action Replay]] (whatever snapshot) ([[Datel Electronics]])&lt;br /&gt;
* [[Disc Wizard]] (whatever snapshot) ([[Evesham Micros]])&lt;br /&gt;
* [[Hackit|Hackit / Le Hacker]] (allows to view RAM at 0040h..AF00h) ([[Siren Software]])&lt;br /&gt;
* [[Mirage Imager]] (RAM-only snapshot) (Mirage Microcomputer Limited)&lt;br /&gt;
* [[Multiface II]] (RAM-and-I/O snapshot) ([[Romantic Robot]])&lt;br /&gt;
* [[PDS development system]] (old devkit been used for commercial games) (PD Systems/Andy Glaister)&lt;br /&gt;
* [[RAM7 Cartridge Hacker]] (for CPC+/GX4000 cartridges) ([[RAM7]])&lt;br /&gt;
* [[Transtape]] (whatever snapshot) (Hard Micro)&lt;br /&gt;
&lt;br /&gt;
== Input devices ==&lt;br /&gt;
&lt;br /&gt;
=== Joysticks ===&lt;br /&gt;
&lt;br /&gt;
* [[Analog Joysticks]] (CPC Plus only)&lt;br /&gt;
* [[Digital Joysticks]]&lt;br /&gt;
* [[Amstrad JY-1/JY-2 joysticks]]&lt;br /&gt;
* [[Joystick Y-cables]]&lt;br /&gt;
&lt;br /&gt;
=== Light-Guns ===&lt;br /&gt;
&lt;br /&gt;
* [[Gunstick]] ([[MHT Ingenieros]])&lt;br /&gt;
* [[Amstrad Magnum Phaser|Magnum Light Phaser]] ([[Amstrad]] and [[Trojan]])&lt;br /&gt;
* [[Trojan Light Phazer]] ([[Trojan]]) (CPC+)&lt;br /&gt;
* [[Loriciel Phaser (West Phaser)|West Phaser]] ([[Loriciel]])&lt;br /&gt;
&lt;br /&gt;
=== Light-Pens ===&lt;br /&gt;
&lt;br /&gt;
* [[Amstrad LP-1 light pen]] (Amstrad/Amsoft/Trojan) aka Trojan CAD-Master Lightpen (Trojan)&lt;br /&gt;
* [[ASS Light-Pen]] ([[ASS]])&lt;br /&gt;
* [[Dart Light Pen]] ([[Dart Electronics]])&lt;br /&gt;
* [[Datapen]] ([[Datapen Microtechnology Ltd]])&lt;br /&gt;
* [[dk'tronics Lightpen|Dk'tronics Light Pen]] ([[Dk'tronics]])&lt;br /&gt;
* [[Happy Computer Light Pen]] (DIY from german magazine)&lt;br /&gt;
* [[Light Pen Professional / Mark II (Electric Studio)|Light Pen Professional / Mark II]] ([[Electric Studio]])&lt;br /&gt;
* [[Lindy Light Pen]] ([[Lindy]])&lt;br /&gt;
&lt;br /&gt;
=== Mouse ===&lt;br /&gt;
&lt;br /&gt;
* [[AMX Mouse]] (Advanced Memory Systems)&lt;br /&gt;
* [[PS2Mouse|AMX Compatible PS/2 and USB Mouse Adapter]] (DIY)&lt;br /&gt;
* [[Atari-ST mouse adapter]] (DIY) ([[Schneider Magazin]])&lt;br /&gt;
* [[dk'tronics Mouse Interface|Dk'tronics Mouse Interface]] ([[Dk'tronics]])&lt;br /&gt;
* [[CPC-Mousepack 2.0]] (Gerdes/Centaur/Reis-ware/ASS)&lt;br /&gt;
* [[Electric Studio Mouse]] ([[Electric Studio]])&lt;br /&gt;
* [[GEOS mouse|GEOS mouse]] ([[Commodore 64|C64]])&lt;br /&gt;
* [[Genius mouse]] ([[Datel Electronics]])&lt;br /&gt;
* [[Kempston Mouse]] (Kempston)&lt;br /&gt;
* [[Marconi|Marconi trackball]]&lt;br /&gt;
* [[Serial RS232 Mouse]]&lt;br /&gt;
* [[SYMBiFACE II:PS/2 mouse|PS/2 mouse]] of [[SYMBiFACE II]]&lt;br /&gt;
* [[Wireless mouse (DIY)]] (what is this?) (added 19 August 2006 by CPCLER)&lt;br /&gt;
&lt;br /&gt;
=== Others ===&lt;br /&gt;
&lt;br /&gt;
* [[CPCKey|Attaching an AT keyboard to the CPC]]&lt;br /&gt;
* [[Grafpad II]] (Hegotron/British Micro/Grafsales)&lt;br /&gt;
* [[Graphiscop II]] (M.M.C.)&lt;br /&gt;
* [[Keyboard Membrane Repair/Replacement Guide|Keyboard Repair/Replacement]]&lt;br /&gt;
&lt;br /&gt;
== Memory expansions / ROM boxes ==&lt;br /&gt;
&lt;br /&gt;
=== Memory Expansions / RAM discs ===&lt;br /&gt;
&lt;br /&gt;
* ([[Standard Memory Expansions]])&lt;br /&gt;
* [[CPC4MB| CPC4MB - 4 MB memory expansion]] ([[Yarek]])&lt;br /&gt;
* [[c't 512 KB internal RAM expansion]] (DIY) (c't magazine)&lt;br /&gt;
* [[Data Media Memory Expansion]] ([[Data Media]])&lt;br /&gt;
* [[Dk'tronics memory expansion‎|Dk'tronics Memory Expansion and Silicon Disc]] ([[Dk'tronics]])&lt;br /&gt;
* [[Dobbertin Memory Expansion]] ([[Dobbertin]]) - 64 KB to 512 KB RAM&lt;br /&gt;
* [[Inicron RAM-Box]] (Inicron) - 512 KB RAM&lt;br /&gt;
* [[Otten &amp;amp; Fecht 1 MB RAM-Disc]] ([[Otten/Fecht]])&lt;br /&gt;
* [[Phoenix M64]] - 64 KB RAM&lt;br /&gt;
* [[RAM BOX]] 512 KB memory expansion&lt;br /&gt;
* [[RAM7 2MB memory expansion]] ([[RAM7]]) - 2 MB RAM&lt;br /&gt;
* [[SYMBiFACE II]] - 512 KB RAM&lt;br /&gt;
* [[Vortex Expansions RAM card]] ([[Vortex Computersysteme|Vortex]]) - 512 KB RAM&lt;br /&gt;
&lt;br /&gt;
=== ROM Box / ROM Board ===&lt;br /&gt;
&lt;br /&gt;
* [[ACU Romboard (DIY)|ACU Romboard]] (DIY) ([[Phil Craven]]/[[Amstrad Computer User|ACU]])&lt;br /&gt;
* [[ACU Romchanger]] (DIY) ([[Phil Craven]]/[[Amstrad Computer User|ACU]]) - a CPC6128 ROM (BIOS v3, BASIC v1.1) upgrade for the CPC464&lt;br /&gt;
* [[AD1 ROM Cartridge]] ([[Arnor]])&lt;br /&gt;
* [[AMRAM]] ([[Silicon Systems]])&lt;br /&gt;
* [[AMRAM2]] ([[Silicon Systems]])&lt;br /&gt;
* [[Amstrad ROM Expander]] (DIY) (Practical Electronics/Simon Dean)&lt;br /&gt;
* [[Britannia ROM Board]] aka ROM Plus ([[Britannia Software Ltd]])&lt;br /&gt;
* [[Cirkit HX-RX1 Rom Expansion Card]] ([[Cirkit]]) (what is this?) (added  3 September 2006 by Torn) (also listed on [[Hwlist from retroisle]])&lt;br /&gt;
* [[CPC.Flash]] internal/external 4MB ROM upgrade ([[Yarek]])&lt;br /&gt;
* [[CPC GX4000-Multi EPROM Cartridge]] Use a GX cartridge for modified ROM software&lt;br /&gt;
* [[Dobbertin EPROM 224]] ([[Dobbertin]])&lt;br /&gt;
* [[Fleet EPROM Programmer|Fleet EPROM Programmer]] (F.Kup and Fleet Microsystems Ltd.)&lt;br /&gt;
* [[FO-DOS|FO-DOS Cartridge]] - a CPC6128 ROM (BIOS v3, BASIC v1.1) upgrade for the CPC464 ([[Duchet Computers]])&lt;br /&gt;
* [[Honeysoft ROM Board]] ([[HoneySoft]])&lt;br /&gt;
* [[Inicron ROM-RAM-Box]] (Inicron)&lt;br /&gt;
* [[KDS Sideways ROM Board]] ([[KDS Electronics]])&lt;br /&gt;
* [[Maplin ROM Box]] ([[Maplin]])&lt;br /&gt;
* [[MegaFlash]] (DIY - Bryce) 512 KB ROM simulator using Flash, in-system programmable&lt;br /&gt;
* [[MegaROM]] (DIY - Bryce) 128K / 256K ROMBoard&lt;br /&gt;
* [[Microgenic ROM Board]] ([[Microgenic Systems]])&lt;br /&gt;
* [[Microgenic EPROM Programmer]] ([[Microgenic Systems]])&lt;br /&gt;
* [[Microstyle RAMROM]] ([[Microstyle]])&lt;br /&gt;
* [[Microstyle ROM Board Xtra]] ([[Microstyle]])&lt;br /&gt;
* [[POKROM]] (DIY) (Electronique Radio Plans, issue 517)&lt;br /&gt;
* [[Ramcard 128]] (a ROM emulator) ([[RAM7]])&lt;br /&gt;
* [[Rombo Rombox]] ([[Rombo Productions]])&lt;br /&gt;
* [[Schneiderware EPROM Burner]] (DIY) ([[CPC Schneider International]])&lt;br /&gt;
* [[Schneiderware Pseudo ROM]] (DIY) ([[CPC Schneider International]])&lt;br /&gt;
* [[Sideways ram]] (Paul Townsend)&lt;br /&gt;
* [[SuperPower ROM Box]] ([[Micro Power Ltd.]])&lt;br /&gt;
* [[Universeller EPROM Programmer 4004]] ([[Dobbertin]])&lt;br /&gt;
* [[X-ROM]] Eprom programmer and ROM Board ([[Timatic Systems]])&lt;br /&gt;
&lt;br /&gt;
== Monitors ==&lt;br /&gt;
* Computers [[monitor_compatible|compatible]] with Amstrad Monitors&lt;br /&gt;
* [[CM14|Amstrad CM14]] Colour Monitor (for CPC Plus)&lt;br /&gt;
* [[CTM640/CTM644|Amstrad CTM640/CTM644]] Color Monitor (for CPC 464/664/6128)&lt;br /&gt;
* [[GT64/GT65|Amstrad GT64/GT65]] Green Monitor (for CPC 464/664/6128)&lt;br /&gt;
* [[MM12|Amstrad MM12]] Monochrome Monitor (for CPC Plus)&lt;br /&gt;
* [[Amstrad MP1/MP2 modulator]]&lt;br /&gt;
* [[Amstrad MPV 001 modulator]] (Spanish MP1)&lt;br /&gt;
* [[MP2F|Amstrad MP-2F Scart Adapter]] (French MP2)&lt;br /&gt;
* [[MP-3|Amstrad MP-3 TV Tuner for CTM 644]]&lt;br /&gt;
* [[MPS Modulator]] Modulator made in Greece from MPS&lt;br /&gt;
* [[Dk'tronics TV Tuner]] ([[Dk'tronics]]) (similar to MP-3)&lt;br /&gt;
* [[Screenvision TV Tuner]] (Screens Microcomputers &amp;amp; Electronics Ltd.) (similar to MP-3)&lt;br /&gt;
* CPCI HF-modulator (CPC Schneider International 11/1986, Page 78ff. Someone please scan it, my issue lacks those pages!)&lt;br /&gt;
* [[TV SCART cable]] (DIY)&lt;br /&gt;
* [[LCD And Plasma TV Solution]] (DIY)&lt;br /&gt;
* [[Videomaster]] Modulator made in 1993 by Campursoft&lt;br /&gt;
&lt;br /&gt;
== Multi function expansions ==&lt;br /&gt;
&lt;br /&gt;
* [[CPC Booster|CPC Booster/CPC Booster+]]&lt;br /&gt;
* [[CPCISA by Yarek]] ([[Yarek]])&lt;br /&gt;
* [[CPCMax!]]&lt;br /&gt;
* [[CPCX]]&lt;br /&gt;
* [[Full Expandable Interface]] ([[Timatic Systems]])&lt;br /&gt;
* [[PlayCity]]&lt;br /&gt;
* [[SYMBiFACE II]]&lt;br /&gt;
&lt;br /&gt;
== Printers ==&lt;br /&gt;
&lt;br /&gt;
* ([[8bit Printer Ports]])&lt;br /&gt;
* ([[Amstrad Printers]])&lt;br /&gt;
* [[DMP1]] printer ([[Amstrad]]) ([[Seikosha]] Unihammer printer)&lt;br /&gt;
* [[DMP2000]] printer ([[Amstrad]]/[[Schneider]]) ([[Epson]]-compatible 9-pin printer)&lt;br /&gt;
* [[DMP2160]] printer ([[Amstrad]]/[[Schneider]]) (fast version of DMP2000)&lt;br /&gt;
* [[DMP3000]] printer ([[Amstrad]]/[[Schneider]]) (gray PC-version of DMP2000 with more ROM/RAM and IBM charset)&lt;br /&gt;
* [[DMP3160]] printer ([[Amstrad]]/[[Schneider]]) (fast version of DMP3000)&lt;br /&gt;
* [[DMP3250]]di printer ([[Amstrad]]) (dual interface version of DMP3160) (centronics + RS232)&lt;br /&gt;
* [[DMP4000]] printer ([[Amstrad]]/[[Schneider]]) ([[Epson]]-compatible 9-pin 16&amp;quot; wide printer)&lt;br /&gt;
* [[LD6000]] laser printer ([[Amstrad GmbH]]) (re-badgered Sharp printer, for German market only)&lt;br /&gt;
* [[LQ3500]](di) printer ([[Amstrad]]/[[Schneider]]) ([[Epson]]-compatible 24-pin printer)&lt;br /&gt;
* [[LQ5000]]di printer ([[Amstrad]]) ([[Epson]]-compatible 24-pin 16&amp;quot; wide printer)&lt;br /&gt;
* [[Robotron 6313|EuroPrint FT80X, Robotron 6313, Präsident 6320]] (east German)&lt;br /&gt;
* [[NLQ401|Schneider NLQ401]] ([[Schneider]]) (custom 9-pin printer, German counterpart of the DMP1)&lt;br /&gt;
* [[Star Printers]] (Star Micronics Co., Ltd.)&lt;br /&gt;
&lt;br /&gt;
== Real Time Clocks ==&lt;br /&gt;
&lt;br /&gt;
* [[ACU Real Time Clock (DIY)|ACU Real Time Clock]] (DIY) (without year counter) ([[Amstrad Computer User|ACU]])&lt;br /&gt;
* [[Aleste 520EX]] (a CPC clone with built-in RTC) ([[Patisonic]])&lt;br /&gt;
* [[Real Time Clock|CPCI Real Time Clock]] (DIY) ([[CPC Schneider International Sonderheft]])&lt;br /&gt;
* [[Dk'tronics Real Time Clock]] ([[Dk'tronics]])&lt;br /&gt;
* [[Dobbertin Smart Watch]] (the RTC itself is inserted like a ROM) ([[Dobbertin]])&lt;br /&gt;
* [[Schneiderware Real Time Clock]] (DIY) ([[CPC Schneider International]])&lt;br /&gt;
* [[SYMBiFACE_II:Realtime_clock|Realtime Clock]] of [[SYMBiFACE_II]] (modern RTC with bugged century counter)&lt;br /&gt;
&lt;br /&gt;
== Synthesizer, sampler and music related ==&lt;br /&gt;
&lt;br /&gt;
* [[Amdrum]] (Playback) ([[Cheetah]])&lt;br /&gt;
* [[Amstrad SSA-1 Speech Synthesizer]] (Speech) ([[Amstrad]])&lt;br /&gt;
* [[CPC Booster|CPC Booster/CPC Booster+]] (Stereo Sampling/Playback) ([[Antitec]]/[[Dirty Minds]])&lt;br /&gt;
* [[Datel Digital Sound Sampler]]/[[Datel Electronics]]&lt;br /&gt;
* [[Digiblaster]] (Playback) (DIY) (8bit DAC on printer port) ([[CPC Amstrad International]])&lt;br /&gt;
* [[Digivox sampler]] (EMM)&lt;br /&gt;
* [[Dk'tronics Speech Synthesizer]] (Speech) ([[Dk'tronics]])&lt;br /&gt;
* [[DHCP MIDI Interface]] (DHCP Electronics)&lt;br /&gt;
* [[EMR MIDI Interface]] (MIDI) ([[EMR|ElectroMusic Research]])&lt;br /&gt;
* [[FuturePlayer]] (modern MP3 playback, max 128kbps) (Hard: Dr.Zed, Soft: TFM)&lt;br /&gt;
* [[Maestro]] (Amplifier/Speakers) (Vanguard Leisure Ltd.)&lt;br /&gt;
* [[Magic Sound Board]] for [[Aleste 520EX]] (four channel DMA playback) ([[Patisonic]])&lt;br /&gt;
* [[Mini Interface for connection to MK5 MIDI Keyboard]] ([[Cheetah]])&lt;br /&gt;
* [[Music Machine]] (Sampling/Playback/MIDI) ([[Ram Electronics]])&lt;br /&gt;
* [[MHT Speech Synthesizer]] (Speech) ([[MHT Ingenieros]])&lt;br /&gt;
* [[Silicon Systems MIDI Interface]] ([[Silicon Systems]]) (what is this?) (added 3 September 2006 by Torn) (also listed on [[Hwlist from retroisle]])&lt;br /&gt;
* [[Sound Blaster]] (Amplifier/Speakers) ([[Siren Software]]&lt;br /&gt;
* [[Soundplayer]] (many different versions exist) (Playback) ([[Futurs']])&lt;br /&gt;
* [[TechniMusique Synthetiseur Musical|TMPI musical synthesizer]] (12 voices) ([[TechniMusique]])&lt;br /&gt;
* [[TMPI speech synthesizer]] (Speech) ([[TechniMusique]])&lt;br /&gt;
* [[Unconventional use of hardware to produce sounds]]&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
&lt;br /&gt;
* 64 Kb Printer Buffer (DIY) (what is this?) (added 19 August 2006 by CPCLER)&lt;br /&gt;
* [[Ambug|Ambug Robot]] (DIY) ([[Magenta Electronics Ltd.]])&lt;br /&gt;
* [[Amstore]] (network with 20MB harddisk) (Northern Computers)&lt;br /&gt;
* [[Amstrad Autofire Interface and Combined Mouse Interface|Amstrad Autofire Interface and Combined Mouse Interface]] (Unknown firm??)&lt;br /&gt;
* Amstrad Expansion System Part 2 ([[Maplin]]) - appeared in Project book 19 (for Part 1 see [[Maplin ROM Box]])&lt;br /&gt;
* [[Amstrad CT-1 Radio/Alarm-Clock]] ([[Amstrad]])&lt;br /&gt;
* [[CPCISA by Yarek|CPCISA]] ([[Yarek]])&lt;br /&gt;
* [[Data Media Printerinterface]] (printer splitter for connecting 2 or 3 software-selectable printers to the CPC) ([[Data Media]])&lt;br /&gt;
* [[DCP Interpacks]] (DCP Microdevelopments)&lt;br /&gt;
* [[Dust Covers]]&lt;br /&gt;
* [[Fischertechnik Interface]] for use with the [[Fischertechnik Trainingsrobot]], the [[Fischertechnik Plotter/Scanner]], and the [[Fischertechnik Computing Experimental]] kit.&lt;br /&gt;
* [[HDCPC]] (what is this?) (added 21 August 2006 by 85.218.166.50) (according to [[Dobbertin Harddisc|this page]], HDCPC is a modern IDE harddisk interace, but it's unknown who developed that thing?)&lt;br /&gt;
* [[Jagot &amp;amp; Leon Interface Cards]] ([[Jagot &amp;amp; Leon]])&lt;br /&gt;
* [[KDS Power Controller]] (a box with eight relays) ([[KDS Electronics]])&lt;br /&gt;
* [[Kersten PC Emulator]]&lt;br /&gt;
* [[Maplins 8bit Input Port]] ([[Maplin]]) (among others for use with Maplin's Weather Satellite Decoder)&lt;br /&gt;
* [[Maplin ROM Box|Maplins 6x8bit Input/Output Port]] ([[Maplin]]) (an extension to Maplin's &amp;quot;Rombox&amp;quot; project)&lt;br /&gt;
* [[Maplins Weather Satellite Receiver]] ([[Maplin]])&lt;br /&gt;
* [[Oktett]] (multimeter/oscilloscope) ([[Otten/Fecht]])&lt;br /&gt;
* [[Peripheral Soft Reset]] (System BIOS Feature for Peripherals)&lt;br /&gt;
* [[Schneiderware]] (a series of [[ECB Bus]] based DIY projects that were released in [[CPC Schneider International]] magazine)&lt;br /&gt;
* [[Split Extension Connector|Cheetah Marketing Split Extension Connector]] ([[Cheetah]])&lt;br /&gt;
* Teleterminal 300s (reportedly &amp;quot;simulates&amp;quot; rs232; connects to printer port; for use with acoustic coupler, see review in CPCI 8-1985, page 55-56)&lt;br /&gt;
* [[Slomo]] A device to reduce the execution speed of the Amstrad CPC (also available for other machines) by [[Nidd Valley Micro Products]], Ltd. (UK)&lt;br /&gt;
&lt;br /&gt;
Some further (unsorted) peripherals are found here: [[Hwlist from retroisle]]. More DIYs are listed on [[Happy Computer (Schneider Sonderheft)]] (those german magazine articles aren't yet scanned).&lt;br /&gt;
&lt;br /&gt;
[[Category:Peripherals| ]][[Category:Hardware|*]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=I/O_Port_Summary&amp;diff=90169</id>
		<title>I/O Port Summary</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=I/O_Port_Summary&amp;diff=90169"/>
				<updated>2014-07-09T18:21:36Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of all known I/O ports of the Amstrad CPC, including all [[Peripherals]]. For a list showing only the built-in standard addresses see [[Default I/O Port Summary]].&lt;br /&gt;
&lt;br /&gt;
== I/O Port Summary ==&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|'''I/O'''||'''Decoded as'''||'''Port'''||'''Read'''||'''Write''' &lt;br /&gt;
|-&lt;br /&gt;
|#1C00||%x0xxxx00 xxxxxxxx||[[Dk'tronics Lightpen]] faulty mirror of #BCXX [[CRTC]] Index|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#1F00||%x0xxxx11 xxxxxxxx||[[Dk'tronics Lightpen]] faulty mirror of #BFXX [[CRTC]] Data In|| Read || -&lt;br /&gt;
|-&lt;br /&gt;
|#78XX||?||[[CPC4MB|4Mb Memory extension]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#79XX||?||[[CPC4MB|4Mb Memory extension]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7AXX||?||[[CPC4MB|4Mb Memory extension]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7BXX||?||[[CPC4MB|4Mb Memory extension]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7CXX||?||[[CPC4MB|4Mb Memory extension]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7CXX||%0xxxxx00 xxxxxxxx||[[Aleste 520EX]] RAM Mapper page 0 (extended &amp;quot;Gate Array 3&amp;quot;)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7DXX||?||[[CPC4MB|4Mb Memory extension]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7DXX||%0xxxxx01 xxxxxxxx||[[Aleste 520EX]] RAM Mapper page 1 (extended &amp;quot;Gate Array 3&amp;quot;)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7EXX||?||[[CPC4MB|4Mb Memory extension]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7EXX||%0xxxxx10 xxxxxxxx||[[Aleste 520EX]] RAM Mapper page 2 (extended &amp;quot;Gate Array 3&amp;quot;)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7FXX||?||[[CPC4MB|4Mb Memory extension]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7FXX||%0xxxxx11 xxxxxxxx||[[Aleste 520EX]] RAM Mapper page 3 (extended &amp;quot;Gate Array 3&amp;quot;)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7FXX||?||[[Dk'tronics memory expansion]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7FXX||?||[[Dobbertin Memory Expansion]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7FXX||%01xxxxxx xxxxxxxx||[[Gate Array]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#7FXX||%0xxxxxxx xxxxxxxx||[[PAL16L8]] extension to [[Gate Array]] for 128K RAM banking||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#BCXX||%x0xxxx00 xxxxxxxx||6845 [[CRTC]] Index|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#BDXX||%x0xxxx01 xxxxxxxx||6845 [[CRTC]] Data Out|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#BEXX||%x0xxxx10 xxxxxxxx||6845 [[CRTC]] Status (as far as supported)||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#BFXX||%x0xxxx11 xxxxxxxx||6845 [[CRTC]] Data In (as far as supported)||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#DFXX||%xx0xxxxx xxxxxxxx||[[Upper ROM Bank Number]] (as decoded within CPC664, CPC6128, 464+, 6128+, decoding in ROM expansions may be different)|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#ECXX||%xxx0xx00 xxxxxxxx||[[KC Compact]] CIO Port B (timer)|| Read ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#EDXX||%xxx0xx01 xxxxxxxx||[[KC Compact]] CIO Port C (timer)|| Read ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#EEXX||%xxx0xx10 xxxxxxxx||[[KC Compact]] CIO Control|| Read ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#EEXX||%xxx0xxx0 xxxxxxxx||[[Aleste 520EX]] USART 8251 (RS232/Mouse) Data|| Read ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#EFXX||%xxx0xx11 xxxxxxxx||[[KC Compact]] CIO Port A (Bi-drectional [[Printer Port]])|| Read ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#EFXX||%xxx0xxx1 xxxxxxxx||[[Aleste 520EX]] USART 8251 (RS232/Mouse) Control/Status|| Read ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#EFXX||%xxx0xxxx xxxxxxxx||[[Printer Port]]|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F0E0||?||[[Draysoft Doubler]] External Tape Data Input (Bit5)||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#F4XX||%xxxx0x00 xxxxxxxx||[[8255]] PIO Port A ([[PSG]] Data)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F5XX||%xxxx0x01 xxxxxxxx||[[8255]] PIO Port B (Vsync,[[Printer Port|PrnBusy]],Tape,etc.)||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#F6XX||%xxxx0x10 xxxxxxxx||[[8255]] PIO Port C (KeybRow,Tape,[[PSG]] Control)|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F7XX||%xxxx0x11 xxxxxxxx||[[8255]] PIO Control-Register|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F880-#F88F||%1111 1000 1000 xxxx||[[PlayCity]] Expansion (CTC #F880-F883, YMZ Right #F884 and YMZ Left #F888)|| - || Write &lt;br /&gt;
|-&lt;br /&gt;
|#F890-#F8AF||%1111 1000 10xx xxxx||[[ACME]] WIP Expansion|| ? || ? &lt;br /&gt;
|-&lt;br /&gt;
|#F8B0||?||[[VIDI digitizer|Vidi-CPC Video-Digitiser]], CRTC Index||?||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8B1||?||[[VIDI digitizer|Vidi-CPC Video-Digitiser]], CRTC Data||?||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8DC||?||[[CPCI RS232 Interface|CPCI Serial Interface]] MC6850 Control/Status||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8DD||?||[[CPCI RS232 Interface|CPCI Serial Interface]] MC6850 Data||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E0||?||[[DHCP MIDI Interface]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E0||%11111000 11100000||[[Schneider RS232 Interface]] Z80-STI Indirect Data Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E1||%11111000 11100001||[[Schneider RS232 Interface]] Z80-STI General Purpose I/O Data Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E2||%11111000 11100010||[[Schneider RS232 Interface]] Z80-STI Interrupt Pending Register B (unused)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E2||?||[[Universeller EPROM Programmer 4004|Dobbertin Eprommer 4003]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#F8E3||%11111000 11100011||[[Schneider RS232 Interface]] Z80-STI Interrupt Pending Register A (unused)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E3||?||[[Universeller EPROM Programmer 4004|Dobbertin Eprommer 4003]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#F8E4||%11111000 11100100||[[Schneider RS232 Interface]] Z80-STI Interrupt in-Service Register B (unused)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E4||?||[[Universeller EPROM Programmer 4004|Dobbertin Eprommer 4003]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#F8E5||%11111000 11100101||[[Schneider RS232 Interface]] Z80-STI Interrupt in-Service Register A (unused)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E6||%11111000 11100110||[[Schneider RS232 Interface]] Z80-STI Interrupt Mask Register B (unused)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E6||?||Port A - [[IDE8255]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#F8E7||%11111000 11100111||[[Schneider RS232 Interface]] Z80-STI Interrupt Mask Register A (unused)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E7||?||Port C - [[IDE8255]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#F8E8||%11111000 11101000||[[Schneider RS232 Interface]] Z80-STI Indirect Index and Interrupt Vector Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E8||?||[[Music Machine]] Interrupt Sel|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8E9||%11111000 11101001||[[Schneider RS232 Interface]] Z80-STI Timers A and B Control Register (unused)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8EA||%11111000 11101010||[[Schneider RS232 Interface]] Z80-STI Timer B Data Register (unused)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8EB||%11111000 11101011||[[Schneider RS232 Interface]] Z80-STI Timer A Data Register (unused)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8EC||%11111000 11101100||[[Schneider RS232 Interface]] Z80-STI USART Control Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8EC||?||[[Music Machine]] ACIA Control|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8ED||?||[[Music Machine]] ACIA Data Write|| - || Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8ED||%11111000 11101101||[[Schneider RS232 Interface]] Z80-STI Receiver Status Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8EE||?||[[Music Machine]] ACIA Status||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#F8EE||%11111000 11101110||[[Schneider RS232 Interface]] Z80-STI Transmitter Status Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8EF||%11111000 11101111||[[Schneider RS232 Interface]] Z80-STI USART Data Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8EF||?||[[Music Machine]] ACIA Data Read||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#F8FX||%xxxxx0xx 1111NNNx||[[Maplins 8bit Input Port]] and [[Maplins Weather Satellite Receiver]]||Read|| -&lt;br /&gt;
|-&lt;br /&gt;
|#F8F0||?||[[Music Machine]] DAC Write|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8F2||?||[[EMR MIDI Interface]]|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8F2||?||[[Universeller EPROM Programmer 4004|Dobbertin Eprommer 4003]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|#F8F2||?||[[EMR MIDI Interface]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8F4||?||[[Music Machine]] ADC Read||Read|| - &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|#F8F5||?||[[ARA Video Digitizer]] - Read Sync Signal (bit0)||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#F8F8||?||[[Music Machine]] ADC Start|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8FF||%1111100x 111xxxxx||[[CPCISA by Yarek|CPCISA control port]]|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F8FF||N/A||[[Peripheral Soft Reset]] (MC_BOOT_PROGRAM and MC_START_PROGRAM do OUT [F8FF],FF)|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F980 - #F98F||%1111 1001 1000 xxxx||[[PlayCity]] (YMZ Right #F984 and YMZ Left #F988)|| - || Write&lt;br /&gt;
|-&lt;br /&gt;
|#F990 - #F9AF||%1111 1001 10xx xxxx||[[ACME]] WIP Expansion|| ? || ?&lt;br /&gt;
|-&lt;br /&gt;
|#F9B0||?||[[VIDI digitizer|Vidi-CPC Video-Digitiser]], Config (W) and Capture Data (R)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F9DC||?||[[Panda Electronics Communications Interface Unit]] PPI Port A - 8bit Printer data||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F9DD||?||[[Panda Electronics Communications Interface Unit]] PPI Port B - 8bit general purpose I/O port||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F9DE||?||[[Panda Electronics Communications Interface Unit]] PPI Port C - Handshake (bit0=Strobe.out, Bit5=Busy.in)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F9DF||?||[[Panda Electronics Communications Interface Unit]] PPI Control - 8bit Printer data|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F9E6||?||Port B - [[IDE8255]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#F9E7||?||RS Port - [[IDE8255]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#F9F5||?||[[ARA Video Digitizer]] - Reset 10bit Config Value|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F9F7||?||[[Grafpad II|Hegotron grafpad II]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#F9FC - #F9FE||?||[[Otten &amp;amp; Fecht 1 MB RAM-Disc]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#F9FF||?||[[Grafpad II|Hegotron grafpad II]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#FA7E||%xxxxx0x0 0xxxxxxx||Floppy Motor Control (for [[765 FDC]])|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FABC||%xxxxx0x0 10xxxx00||[[Aleste 520EX]] EXTPORT with CS53: Forward PPI Port A to 8253 Timer 0|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FABD||%xxxxx0x0 10xxxx01||[[Aleste 520EX]] EXTPORT with CS53: Forward PPI Port A to 8253 Timer 1|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FABE||%xxxxx0x0 10xxxx10||[[Aleste 520EX]] EXTPORT with CS53: Forward PPI Port A to 8253 Timer 2|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FABF||%xxxxx0x0 10xxxx11||[[Aleste 520EX]] EXTPORT with CS53: Forward PPI Port A to 8253 Control|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FABF||%xxxxx0x0 10xxxxxx||[[Aleste 520EX]] EXTPORT (config for internal hardware)|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FADC||?||[[Amstrad Serial Interface]] Z80-SIO / DART port A Data Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FADC||?||[[RS-232 para Amstrad|MHT Ingenieros RS232 para Amstrad]] 8251 USART data|| Read || Write&lt;br /&gt;
|-&lt;br /&gt;
|#FADD||?||[[Amstrad Serial Interface]] Z80-SIO / DART port A Control Reg.||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FADD||?||[[RS-232 para Amstrad|MHT Ingenieros RS232 para Amstrad]] 8251 USART control/status|| Read || Write&lt;br /&gt;
|-&lt;br /&gt;
|#FADE||?||[[Amstrad Serial Interface]] Z80-SIO / DART port B Data Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FADF||?||[[Amstrad Serial Interface]] Z80-SIO / DART port B Control Reg.||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FADF||?||[[Cirkit serial interface]] 8251 UART data register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FAE6||?||Port A - [[IDE8255]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#FAE7||?||Port C - [[IDE8255]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#FAEE||?||[[Amstrad SSA-1 Speech Synthesizer]] (faulty mirror used by included RSX driver)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FAEF||?||[[Kempston Mouse]] - Mouse Buttons||Read||-&lt;br /&gt;
|-&lt;br /&gt;
|#FAF5||?||[[ARA Video Digitizer]] - Read Capture Data||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#FAF5||?||[[ARA Video Digitizer]] - Increment 10bit Config Value|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FB7E||%xxxxx0x1 0xxxxxx0||[[765 FDC]] (internal) Status Register||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#FB7F||%xxxxx0x1 0xxxxxx1||[[765 FDC]] (internal) Data Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBBD||?||Ram select mode [[Vortex Expansions RAM card|Vortex SP512]]||?||Write &lt;br /&gt;
|-&lt;br /&gt;
|#FBDC||?||[[Amstrad Serial Interface]] 8253 Timer counter 0||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBDC||?||[[RS-232 para Amstrad|MHT Ingenieros RS232 para Amstrad]] 8253 timer 0 (transmit baudrate)|| Read || Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBDD||?||[[Amstrad Serial Interface]] 8253 Timer counter 1||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBDD||?||[[RS-232 para Amstrad|MHT Ingenieros RS232 para Amstrad]] 8253 timer 1 (receive baudrate)|| Read || Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBDE||?||[[Amstrad Serial Interface]] 8253 Timer counter 2||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBDE||?||[[RS-232 para Amstrad|MHT Ingenieros RS232 para Amstrad]] 8253 timer 2 (used as 1ms timer)|| Read || Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBDF||?||[[Amstrad Serial Interface]] 8253 Timer Modus Select|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBDF||?||[[RS-232 para Amstrad|MHT Ingenieros RS232 para Amstrad]] 8253 timer 0-2 control|| - || Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBDF||?||[[Cirkit serial interface]] 8251 UART status/control register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBxx+0||?||CPCI [[Real Time Clock]] Index (DIY)||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBxx+1||?||CPCI [[Real Time Clock]] Data (DIY)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE0||?||[[Dk'tronics Real Time Clock]] - Z80 PIO Port A Data (HD146818P RTC Data bus)|| Read || Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE0||?||[[Dobbertin Harddisc]] Data Port||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE1||?||[[Dk'tronics Real Time Clock]] - Z80 PIO Port B Data (General Purpose 8bit I/O Port)|| Read || Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE1||?||[[Dobbertin Harddisc]] Status, Reset||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE2||?||[[Dk'tronics Real Time Clock]] - Z80 PIO Port A Control||?|| Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE2||?||[[Dobbertin Harddisc]] Select, Configuration||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE3||?||[[Dk'tronics Real Time Clock]] - Z80 PIO Port B Control||?|| Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE3||?||[[Dobbertin Harddisc]] DMA, Interrupt||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE4||?||[[Dobbertin Harddisc]] Reset||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE6||?||Port B - [[IDE8255]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#FBE7||?||RS Port - [[IDE8255]]||?||?&lt;br /&gt;
|-&lt;br /&gt;
|#FBE7||?||[[ACU Real Time Clock (DIY)]] Z80-PIO Data In/Out Port A ||Read||Write &lt;br /&gt;
|-&lt;br /&gt;
|#FBE8||?||[[Dk'tronics Real Time Clock]] &amp;quot;4bit latch&amp;quot; (details unknown)|| ? || Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE8||?||[[KDS_Electronics_Serial_Interface|KDS RS232]] 8253 Timer0 (RX Clock)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBE9||?||[[KDS_Electronics_Serial_Interface|KDS RS232]] 8253 Timer1 (TX Clock)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBEA||?||[[KDS_Electronics_Serial_Interface|KDS RS232]] 8253 Timer2 (not used)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBEB||?||[[KDS_Electronics_Serial_Interface|KDS RS232]] 8253 Timer Control||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBEC||?||[[KDS_Electronics_Serial_Interface|KDS RS232]] 6850 (reversed bit-order) Control||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBEC||?||[[PDS development system]] Z80 PIO Port A Data (8bit data to/from PC)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBED||?||[[KDS_Electronics_Serial_Interface|KDS RS232]] 6850 (reversed bit-order) TX Data||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBED||?||[[PDS development system]] Z80 PIO Port B Data (handshake to/from PC)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBEE||?||[[PDS development system]] Z80 PIO Port A Control||?||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBEE||?||[[Amstrad SSA-1 Speech Synthesizer]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBEE||?||[[Kempston Mouse]] - 8bit X position||Read||-&lt;br /&gt;
|-&lt;br /&gt;
|#FBEE||?||[[KDS_Electronics_Serial_Interface|KDS RS232]] 6850 (reversed bit-order) Status||Read||-&lt;br /&gt;
|-&lt;br /&gt;
|#FBEF||?||[[PDS development system]] Z80 PIO Port B Control||?||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBEF||?||[[Kempston Mouse]] - 8bit Y position||Read||-&lt;br /&gt;
|-&lt;br /&gt;
|#FBEF||?||[[KDS_Electronics_Serial_Interface|KDS RS232]] 6850 (reversed bit-order) RX Data||Read||-&lt;br /&gt;
|-&lt;br /&gt;
|#FBEF||?||[[ACU Real Time Clock (DIY)]] Z80-PIO Data In/Out Port B ||Read||Write &lt;br /&gt;
|-&lt;br /&gt;
|#FBF0 - #FBFF||?||[[Otten &amp;amp; Fecht 1 MB RAM-Disc]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBF0||%xxxx1011 1111xxxx||[[AMRAM2]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBF0||%xxxxx011 1111xxx0||[[AMSSIO]] Serial Interface MC6850 Control/Status Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBF1||%xxxxx011 1111xxx1||[[AMSSIO]] Serial Interface MC6850 Data Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBF5||?||[[ARA Video Digitizer]] - Invoke Video Capture|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBF6||?||[[Vortex Disc Drives]] 765 FDC (Vortex,ext) Status Register||Read|| - &lt;br /&gt;
|-&lt;br /&gt;
|#FBF7||?||[[Vortex Disc Drives]] 765 FDC (Vortex,ext) Data Register||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBF7||?||[[ACU Real Time Clock (DIY)]] Z80-PIO Configure Port A ||Read||Write &lt;br /&gt;
|-&lt;br /&gt;
|#FBF8||%11111011 11111000||[[8bit Printer Port (Amstrad Action)]] Strobe/Busy||Read||Write &lt;br /&gt;
|-&lt;br /&gt;
|#FBF9||%11111011 11111001||[[8bit Printer Port (Amstrad Action)]] Data|| - ||Write &lt;br /&gt;
|-&lt;br /&gt;
|#FBFE||?||[[Amstrad Magnum Phaser|Magnum Light Phaser]]||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBFE||?||[[Dart Scanner for DMP-Printers]]||Read||?&lt;br /&gt;
|-&lt;br /&gt;
|#FBFE||?||[[Dk'tronics Speech Synthesizer]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBFE||?||[[TMPI speech synthesizer]] Data Register ||||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FBFF||?||[[TMPI speech synthesizer]] Command/Status Register ||Read||Write &lt;br /&gt;
|-&lt;br /&gt;
|#FBFF||?||[[ACU Real Time Clock (DIY)]] Z80-PIO Configure Port B ||Read||Write &lt;br /&gt;
|-&lt;br /&gt;
|#FC00 - #FDFF||%1111110x xxxxxxxx||[[CPCISA by Yarek|CPCISA]] 16bits mode high byte latch||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FC5C||?||[[Z80-SIO dual ports RS232 interface for CPC (French)|French DIY Dual Port RS232]] - Baudrate Selection|| - ||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FC7C||?||[[Z80-SIO dual ports RS232 interface for CPC (French)|French DIY Dual Port RS232]] - Z80-SIO Channel A Data||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FC7D||?||[[Z80-SIO dual ports RS232 interface for CPC (French)|French DIY Dual Port RS232]] - Z80-SIO Channel A Control/Status||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FC7E||?||[[Z80-SIO dual ports RS232 interface for CPC (French)|French DIY Dual Port RS232]] - Z80-SIO Channel B Data||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FC7F||?||[[Z80-SIO dual ports RS232 interface for CPC (French)|French DIY Dual Port RS232]] - Z80-SIO Channel B Control/Status||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FCE6||?||Port A - [[IDE8255]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FCE7||?||Port C - [[IDE8255]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FD00 - #FD3F||%11111101 00xxxxxx||[[Programming:SYMBiFACE_II|SYMBiFACE II]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FDE6||?||Port B - [[IDE8255]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FDE7||?||RS Port - [[IDE8255]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FE00 - #FFFF||%1111111x xxxxxxxx||[[CPCISA by Yarek|CPCISA]] I/O access (low byte)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FEE6||?||Port A - [[IDE8255]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FEE7||?||Port C - [[IDE8255]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FEE8||%11111110 1110100x||[[Multiface II]] - Enable Multiface II ROM/RAM||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FEEA||%11111110 1110110x||[[Multiface II]] - Disable Multiface II ROM/RAM||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FEF0 - #FEF7||%11111110 11110xxx||[[CPC-CompactFlash]] - IDE registers||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FFXX||%11111111 xxxxxxxx||[[CPC Booster]] (XX=#00..#28 are used now)||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FFXX||%11111111 xxxxxxxx||[[Amdrum]] (unsigned 8bit DAC)||-||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FFE6||?||Port B - [[IDE8255]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|#FFE7||?||RS Port - [[IDE8255]]||Read||Write&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Memory Mapped I/O Ports ==&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|'''Mem'''||'''Decoded as'''||'''Port'''||'''Read'''||'''Write''' &lt;br /&gt;
|-&lt;br /&gt;
|#4000-7FFF||%01xxxxxx xxxxxxxx||[[ASIC]] - CPC+/GX4000 registers|| Read || Write&lt;br /&gt;
|-&lt;br /&gt;
|#????||%11xxxxxx xxxxxxx1||[[Dobbertin Smart Watch]] data read (D0=data)|| Read || -&lt;br /&gt;
|-&lt;br /&gt;
|#????||%11xxxxxx xxxxxDx0||[[Dobbertin Smart Watch]] data write (A2=data)|| Read || -&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== More Ports ==&lt;br /&gt;
&lt;br /&gt;
Some more I/O addresses (which aren't included in the above list yet) are here:&lt;br /&gt;
* [[Schneiderware Summary]]&lt;br /&gt;
&lt;br /&gt;
== Other I/O Ports ==&lt;br /&gt;
&lt;br /&gt;
A number of peripherals connect to the joystick/printer ports, and so, they do not include &amp;quot;own&amp;quot; I/O addresses. This includes hardware ''other than joysticks/printers'' - for example, mice, robots, audio devices, and simple network adapters. For a more complete list, see corresponding sections on [[Digital Joysticks|Digital Joystick]] and [[Printer Port]] pages.&lt;br /&gt;
&lt;br /&gt;
Aside from I/O addresses, there are some other important I/O signals, for example: [[NMI]] or [[External Interrupt|INT]].&lt;br /&gt;
&lt;br /&gt;
== CPCISA ports for ISA cards ==&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|''Device''||''PC I/O range''||''CPCISA high''||''CPCISA low'' &lt;br /&gt;
|-&lt;br /&gt;
|IDE1||1F0h..1F7h||#FDF0..#FDF7||#FFF0..#FFF7&lt;br /&gt;
|-&lt;br /&gt;
|IDE2||170h..177h||#FD70..#FD77||#FF70..#FF77&lt;br /&gt;
|-&lt;br /&gt;
|Joystick||201h..201h||#FC01..#FC01||#FE01..#FE01&lt;br /&gt;
|-&lt;br /&gt;
|Ethernet||210h..21Fh||#FC10..#FC1F||#FE10..#FE1F&lt;br /&gt;
|-&lt;br /&gt;
|Sound Blaster||220h..23Fh||#FC20..#FC3F||#FE20..#FE3F&lt;br /&gt;
|-&lt;br /&gt;
|LPT2||278h..27Fh||#FC78..#FC7F||#FE78..#FE7F&lt;br /&gt;
|-&lt;br /&gt;
|COM1||2F8h..2FFh||#FCF8..#FCFF||#FEF8..#FEFF&lt;br /&gt;
|-&lt;br /&gt;
|MIDI'||300h..301h||#FD00..#FD01||#FF00..#FF01&lt;br /&gt;
|-&lt;br /&gt;
|MIDI||330h..331h||#FD30..#FD31||#FF30..#FF31&lt;br /&gt;
|-&lt;br /&gt;
|Sound control||370h..371h||#FD70..#FD71||#FF70..#FF71&lt;br /&gt;
|-&lt;br /&gt;
|FDC1||372h..377h||#FD72..#FD77||#FF72..#FF77&lt;br /&gt;
|-&lt;br /&gt;
|LPT1||378h..37Fh||#FD78..#FD7F||#FF78..#FF7F&lt;br /&gt;
|-&lt;br /&gt;
|Sound AD-LIB||388h..38Bh||#FD88..#FD8B||#FF88..#FF8B&lt;br /&gt;
|-&lt;br /&gt;
|VGA||3B0h..3BBh||#FDB0..#FDBB||#FFB0..#FFBB&lt;br /&gt;
|-&lt;br /&gt;
|LPT3||3BCh..3BFh||#FDBC..#FDBF||#FFBC..#FFBF&lt;br /&gt;
|-&lt;br /&gt;
|VGA||3C0h..3DFh||#FDC0..#FDCF||#FFC0..#FFCF&lt;br /&gt;
|-&lt;br /&gt;
|FDC1||3F2h..3F7h||#FDF2..#FDF7||#FFF2..#FFF7&lt;br /&gt;
|-&lt;br /&gt;
|COM1||3F8h..3FFh||#FDF8..#FDFF||#FFF8..#FFFF&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== CPCISA ports for ISA motherboard ==&lt;br /&gt;
&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|''Device''||''PC I/O range''||''CPCISA high''||''CPCISA low'' &lt;br /&gt;
|-&lt;br /&gt;
|DMA||000h..00Fh||#FC00..#FC0F||#FE00..#FE0F&lt;br /&gt;
|-&lt;br /&gt;
|interrupt||020h..03Fh||#FC20..#FC3F||#FE20..#FE3F&lt;br /&gt;
|-&lt;br /&gt;
|counter||040h..05Fh||#FC40..#FC5F||#FE40..#FE5F&lt;br /&gt;
|-&lt;br /&gt;
|keyboard||060h..067h||#FC60..#FC67||#FE60..#FE67&lt;br /&gt;
|-&lt;br /&gt;
|RTC||070h..071h||#FC70..#FC71||#FE70..#FE71&lt;br /&gt;
|-&lt;br /&gt;
|DMA||080h..08Fh||#FC80..#FC8F||#FE80..#FE8F&lt;br /&gt;
|-&lt;br /&gt;
|DMA||0C0h..0DFh||#FCC0..#FCDF||#FEC0..#FEDF&lt;br /&gt;
|-&lt;br /&gt;
|interrupt||0A0h..0BFh||#FCA0..#FCBF||#FEA0..#FEBF&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]] [[Category:Stub]][[Category:CPC Internal Components]][[Category:Hardware]][[Category:Electronic Component]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Peripherals&amp;diff=90168</id>
		<title>Peripherals</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Peripherals&amp;diff=90168"/>
				<updated>2014-07-09T18:20:37Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''You can also check the Category : Peripherals for a complete list of CPCwiki pages on the matter.'''&lt;br /&gt;
&lt;br /&gt;
* [[I/O Port Summary]]&lt;br /&gt;
&lt;br /&gt;
''Please try to keep things in alphabetical order.''&lt;br /&gt;
&lt;br /&gt;
== Built-in Peripherals ==&lt;br /&gt;
&lt;br /&gt;
=== Built-in Chipset ===&lt;br /&gt;
&lt;br /&gt;
* [[765 FDC]] - Floppy Disc Controller&lt;br /&gt;
* [[8255]] - PIO - I/O controller&lt;br /&gt;
* [[Arnold V Specs Revised]] - Arnold V (CPC+) Technical Specification&lt;br /&gt;
* [[AY-3-8912]] - Sound chip / keyboard controller&lt;br /&gt;
* [[CRTC]] - Video chip&lt;br /&gt;
* [[Gate Array]] - Custom chip (frequency generation, colors, bank switching)&lt;br /&gt;
* [[Power Supply for CPC and CPC plus]]&lt;br /&gt;
* [[Printer Port]]&lt;br /&gt;
&lt;br /&gt;
=== Built-in connectors: pinout ===&lt;br /&gt;
&lt;br /&gt;
* [[Connector:2nd disc drive (CPC664, CPC6128, CPC6128+)|2nd disc drive (CPC664, CPC6128, CPC6128+)]]&lt;br /&gt;
* [[Connector:Analogue joystick (CPC Plus only)|Analogue joystick (CPC Plus only)]]&lt;br /&gt;
* [[Connector:Aux socket (CPC Plus only)|Aux socket (CPC Plus only)]] (Lightgun)&lt;br /&gt;
* [[Connector:Cartridge Slot (CPC Plus only)|Cartridge Slot (CPC Plus only)]]&lt;br /&gt;
* [[Connector:Cassette recorder|Cassette recorder]]&lt;br /&gt;
* [[Connector:Digital joystick|Digital joystick]]&lt;br /&gt;
* [[Connector:Expansion port|Expansion port]]&lt;br /&gt;
* [[Connector:Monitor|Monitor]]&lt;br /&gt;
* [[Connector:Printer port|Printer port]]&lt;br /&gt;
* [[Connector:Stereo sound|Stereo sound]]&lt;br /&gt;
&lt;br /&gt;
=== Built-in Firmware ===&lt;br /&gt;
&lt;br /&gt;
* [[BIOS Functions]]&lt;br /&gt;
* [[Locomotive BASIC]] (reference for BASIC commands, functions and error messages)&lt;br /&gt;
* [[Technical information about Locomotive BASIC]] (encoding of BASIC programs in memory)&lt;br /&gt;
&lt;br /&gt;
== Data transfer ==&lt;br /&gt;
&lt;br /&gt;
=== Modems ===&lt;br /&gt;
&lt;br /&gt;
* [[Commstar v21/23 modem]] ([[PACE]])&lt;br /&gt;
* [[Data Research CH301S modem]] (greek company)&lt;br /&gt;
* [[Digitelec DTL 2000/2100 Modem]]&lt;br /&gt;
* [[EPTA modem]] (sold by Greek mag ΕΠΤΑ)&lt;br /&gt;
* [[KDS Communicator 104]] (connects directly to expansion port) ([[KDS Electronics]])&lt;br /&gt;
* [[Mini-Max Modem|KDS Mini-Max Modem]] (connects via RS232 interface) ([[KDS Electronics]])&lt;br /&gt;
* [[MicroLink Dual-Speed Modem]] ([[MicroLink]]) [[File:Microlink.pdf|Mircolink Manual]] and [[File:Micronet.pdf|Micronet manual]], provided by ''Spookspring''&lt;br /&gt;
* [[MicroLink Multi-Speed Modem]] ([[MicroLink]])&lt;br /&gt;
* [[Cirkit_Prestel_Link_Amstrad_Interface]] (acoustic coupler bundled with [[Cirkit serial interface]]) ([[Cirkit]])&lt;br /&gt;
* [[Schneider BTX Modul]] (for German Bildschirmtext) ([[Schneider]])&lt;br /&gt;
* [[Loritel]] (for french Minitel) ([[Loriciel|Loriciels]])&lt;br /&gt;
&lt;br /&gt;
=== Serial Interfaces ===&lt;br /&gt;
&lt;br /&gt;
* ([[RS232|overview of RS232 interfaces]])&lt;br /&gt;
* [[Aleste 520EX]] (a CPC clone with built-in RS232, intended for serial mouse) ([[Patisonic]])&lt;br /&gt;
* [[AMSSIO]] (four different versions) (RS232 interface) (DIY) (Martin Zacho)&lt;br /&gt;
* [[Amstrad Serial Interface]] ([[Amstrad]])&lt;br /&gt;
* [[Cirkit serial interface]] ([[Cirkit]])&lt;br /&gt;
* Cirkit twin-port serial interface (resold by [[Microstyle]])&lt;br /&gt;
* [[CPC Booster|CPC Booster/CPC Booster+]] (modern multifunction expansion, including RS232)&lt;br /&gt;
* [[CPCI RS232 Interface]] (DIY) ([[CPC Schneider International Sonderheft]])&lt;br /&gt;
* [[Data Media Disc System]] (disc drive with built-in RS232 interface) ([[Data Media]])&lt;br /&gt;
* [[KDS Electronics Serial Interface|KDS Serial Interface]] ([[KDS Electronics]])&lt;br /&gt;
* [[Panda Electronics Communications Interface Unit]] (dual RS232 plus 8bit printer port) (Panda Electronics Ltd)&lt;br /&gt;
* [[RS-232 para Amstrad]] ([[MHT Ingenieros]])&lt;br /&gt;
* [[SCA CPC Prolink]] ([[SCA Products]])&lt;br /&gt;
* [[Schneider RS232 Interface]] ([[Schneider]])&lt;br /&gt;
* [[Schneiderware V/24 Interface]] (DIY) ([[CPC Schneider International]])&lt;br /&gt;
* [[Simple RS232 for Printer usage]] (DIY) (one-directional, transmit only)&lt;br /&gt;
* [[Spectre Comms Serial Interface]] with Cage Comms software ([[Spectre Communications Ltd]])&lt;br /&gt;
* [[Vortex Disc Drives]] (disc drive/interface with optional RS232 port) ([[Vortex Computersysteme]])&lt;br /&gt;
* [[Z80-SIO dual ports RS232 interface for CPC (French)]] (DIY) (Philippe Lebel)&lt;br /&gt;
* [[Dual RS232]] ([[Timatic Systems]])&lt;br /&gt;
&lt;br /&gt;
=== Teletext ===&lt;br /&gt;
&lt;br /&gt;
* [[Teletext adaptor]] ([[Microtext Ltd.]])&lt;br /&gt;
* [[Volex TTX 2000a|Volex TTX 2000a Teletext-Telesoftware Adaptor]] (Volex Electronics)&lt;br /&gt;
&lt;br /&gt;
=== Others ===&lt;br /&gt;
&lt;br /&gt;
* [[CPC Booster|CPC Booster/CPC Booster+]]&lt;br /&gt;
* [[Virtual Net 96]] ([[Wizcat]])&lt;br /&gt;
* [[Red Box]] ([[General Information Systems]])&lt;br /&gt;
* [[CPC-ENet|CPC Ethernet Card]] ([[rpalmer]])&lt;br /&gt;
&lt;br /&gt;
== Digitizer / Scanner ==&lt;br /&gt;
&lt;br /&gt;
* [[ARA Video Digitizer]] ([[Jagot &amp;amp; Leon]])&lt;br /&gt;
* [[Electric Studio C6]] ([[Electric Studio]])&lt;br /&gt;
* [[Dart Scanner for DMP-Printers]] (the optics are attached to the printer head) ([[Dart Electronics]])&lt;br /&gt;
* [[Omni-Reader]] (Oberon International) (scanner with text recognition) (advert on ACU 1-1987, page 83)&lt;br /&gt;
* [[VIDI digitizer]] ([[Rombo Productions]])&lt;br /&gt;
&lt;br /&gt;
== Drives ==&lt;br /&gt;
&lt;br /&gt;
=== Disc Drives ===&lt;br /&gt;
&lt;br /&gt;
* [[3½&amp;quot; &amp;amp; 5¼&amp;quot; Disk Drives]]&lt;br /&gt;
* [[Amstrad Disk Drive|Amstrad DDI-1 / FD-1 Disk Drive]] ([[Amstrad]])&lt;br /&gt;
* [[Cumana 3&amp;quot; Disk Drive]] ([[Cumana]])&lt;br /&gt;
* [[Data Media Disc System]] ([[Data Media]])&lt;br /&gt;
* [[Jasmin AM5D 5 &amp;quot;1/4 floppy drive]]&lt;br /&gt;
* [[KDS 5¼&amp;quot; Disc Drive]] ([[KDS Electronics]])&lt;br /&gt;
* [[TIMDISC 5¼&amp;quot; 2nd Disc Drive]] ([[Timatic Systems]])&lt;br /&gt;
* [[F1|Vortex Disc Drives]] ([[Vortex Computersysteme|Vortex]])&lt;br /&gt;
* [[Four floppy drives with Amstrad disc interface]]&lt;br /&gt;
&lt;br /&gt;
=== Exotic Drives ===&lt;br /&gt;
&lt;br /&gt;
* [[Codemasters CD]] (loads games from Audio CD via joystick port) ([[Codemasters]])&lt;br /&gt;
* [[Draysoft Doubler]] (external tape input, for tape-to-tape transfers) ([[Evesham Micros]])&lt;br /&gt;
&lt;br /&gt;
=== Hard Disc Drives ===&lt;br /&gt;
&lt;br /&gt;
* [[CPC-IDE]] (modern) (discontinued prototype)&lt;br /&gt;
* [[Dobbertin Harddisc]] ([[Dobbertin]])&lt;br /&gt;
* [[IDE8255]] internal/extrernal IDE/CF interface ([[Yarek]])&lt;br /&gt;
* [[SYMBiFACE II]] (modern) (IDE and various other features)&lt;br /&gt;
* [[Vortex Winchester Drive]] ([[Vortex Computersysteme|Vortex]])&lt;br /&gt;
* [[IDE/8255]] external IDE Interface ([[rpalmer]])&lt;br /&gt;
&lt;br /&gt;
=== Drive Emulators ===&lt;br /&gt;
&lt;br /&gt;
* [[HxC Floppy Emulator]]&lt;br /&gt;
* [[SDiskEmul]]&lt;br /&gt;
* [[TFE Floppy Emulator]]&lt;br /&gt;
* [[VDrive]]&lt;br /&gt;
&lt;br /&gt;
== Hardware debuggers/Hacking devices ==&lt;br /&gt;
&lt;br /&gt;
* [[Action Replay]] (whatever snapshot) ([[Datel Electronics]])&lt;br /&gt;
* [[Disc Wizard]] (whatever snapshot) ([[Evesham Micros]])&lt;br /&gt;
* [[Hackit|Hackit / Le Hacker]] (allows to view RAM at 0040h..AF00h) ([[Siren Software]])&lt;br /&gt;
* [[Mirage Imager]] (RAM-only snapshot) (Mirage Microcomputer Limited)&lt;br /&gt;
* [[Multiface II]] (RAM-and-I/O snapshot) ([[Romantic Robot]])&lt;br /&gt;
* [[PDS development system]] (old devkit been used for commercial games) (PD Systems/Andy Glaister)&lt;br /&gt;
* [[RAM7 Cartridge Hacker]] (for CPC+/GX4000 cartridges) ([[RAM7]])&lt;br /&gt;
* [[Transtape]] (whatever snapshot) (Hard Micro)&lt;br /&gt;
&lt;br /&gt;
== Input devices ==&lt;br /&gt;
&lt;br /&gt;
=== Joysticks ===&lt;br /&gt;
&lt;br /&gt;
* [[Analog Joysticks]] (CPC Plus only)&lt;br /&gt;
* [[Digital Joysticks]]&lt;br /&gt;
* [[Amstrad JY-1/JY-2 joysticks]]&lt;br /&gt;
* [[Joystick Y-cables]]&lt;br /&gt;
&lt;br /&gt;
=== Light-Guns ===&lt;br /&gt;
&lt;br /&gt;
* [[Gunstick]] ([[MHT Ingenieros]])&lt;br /&gt;
* [[Amstrad Magnum Phaser|Magnum Light Phaser]] ([[Amstrad]] and [[Trojan]])&lt;br /&gt;
* [[Trojan Light Phazer]] ([[Trojan]]) (CPC+)&lt;br /&gt;
* [[Loriciel Phaser (West Phaser)|West Phaser]] ([[Loriciel]])&lt;br /&gt;
&lt;br /&gt;
=== Light-Pens ===&lt;br /&gt;
&lt;br /&gt;
* [[Amstrad LP-1 light pen]] (Amstrad/Amsoft/Trojan) aka Trojan CAD-Master Lightpen (Trojan)&lt;br /&gt;
* [[ASS Light-Pen]] ([[ASS]])&lt;br /&gt;
* [[Dart Light Pen]] ([[Dart Electronics]])&lt;br /&gt;
* [[Datapen]] ([[Datapen Microtechnology Ltd]])&lt;br /&gt;
* [[dk'tronics Lightpen|Dk'tronics Light Pen]] ([[Dk'tronics]])&lt;br /&gt;
* [[Happy Computer Light Pen]] (DIY from german magazine)&lt;br /&gt;
* [[Light Pen Professional / Mark II (Electric Studio)|Light Pen Professional / Mark II]] ([[Electric Studio]])&lt;br /&gt;
* [[Lindy Light Pen]] ([[Lindy]])&lt;br /&gt;
&lt;br /&gt;
=== Mouse ===&lt;br /&gt;
&lt;br /&gt;
* [[AMX Mouse]] (Advanced Memory Systems)&lt;br /&gt;
* [[PS2Mouse|AMX Compatible PS/2 and USB Mouse Adapter]] (DIY)&lt;br /&gt;
* [[Atari-ST mouse adapter]] (DIY) ([[Schneider Magazin]])&lt;br /&gt;
* [[dk'tronics Mouse Interface|Dk'tronics Mouse Interface]] ([[Dk'tronics]])&lt;br /&gt;
* [[CPC-Mousepack 2.0]] (Gerdes/Centaur/Reis-ware/ASS)&lt;br /&gt;
* [[Electric Studio Mouse]] ([[Electric Studio]])&lt;br /&gt;
* [[GEOS mouse|GEOS mouse]] ([[Commodore 64|C64]])&lt;br /&gt;
* [[Genius mouse]] ([[Datel Electronics]])&lt;br /&gt;
* [[Kempston Mouse]] (Kempston)&lt;br /&gt;
* [[Marconi|Marconi trackball]]&lt;br /&gt;
* [[Serial RS232 Mouse]]&lt;br /&gt;
* [[SYMBiFACE II:PS/2 mouse|PS/2 mouse]] of [[SYMBiFACE II]]&lt;br /&gt;
* [[Wireless mouse (DIY)]] (what is this?) (added 19 August 2006 by CPCLER)&lt;br /&gt;
&lt;br /&gt;
=== Others ===&lt;br /&gt;
&lt;br /&gt;
* [[CPCKey|Attaching an AT keyboard to the CPC]]&lt;br /&gt;
* [[Grafpad II]] (Hegotron/British Micro/Grafsales)&lt;br /&gt;
* [[Graphiscop II]] (M.M.C.)&lt;br /&gt;
* [[Keyboard Membrane Repair/Replacement Guide|Keyboard Repair/Replacement]]&lt;br /&gt;
&lt;br /&gt;
== Memory expansions / ROM boxes ==&lt;br /&gt;
&lt;br /&gt;
=== Memory Expansions / RAM discs ===&lt;br /&gt;
&lt;br /&gt;
* ([[Standard Memory Expansions]])&lt;br /&gt;
* [[CPC4MB| CPC4MB - 4 MB memory expansion]] ([[Yarek]])&lt;br /&gt;
* [[c't 512 KB internal RAM expansion]] (DIY) (c't magazine)&lt;br /&gt;
* [[Data Media Memory Expansion]] ([[Data Media]])&lt;br /&gt;
* [[Dk'tronics memory expansion‎|Dk'tronics Memory Expansion and Silicon Disc]] ([[Dk'tronics]])&lt;br /&gt;
* [[Dobbertin Memory Expansion]] ([[Dobbertin]]) - 64 KB to 512 KB RAM&lt;br /&gt;
* [[Inicron RAM-Box]] (Inicron) - 512 KB RAM&lt;br /&gt;
* [[Otten &amp;amp; Fecht 1 MB RAM-Disc]] ([[Otten/Fecht]])&lt;br /&gt;
* [[Phoenix M64]] - 64 KB RAM&lt;br /&gt;
* [[RAM BOX]] 512 KB memory expansion&lt;br /&gt;
* [[RAM7 2MB memory expansion]] ([[RAM7]]) - 2 MB RAM&lt;br /&gt;
* [[SYMBiFACE II]] - 512 KB RAM&lt;br /&gt;
* [[Vortex Expansions RAM card]] ([[Vortex Computersysteme|Vortex]]) - 512 KB RAM&lt;br /&gt;
&lt;br /&gt;
=== ROM Box / ROM Board ===&lt;br /&gt;
&lt;br /&gt;
* [[ACU Romboard (DIY)|ACU Romboard]] (DIY) ([[Phil Craven]]/[[Amstrad Computer User|ACU]])&lt;br /&gt;
* [[ACU Romchanger]] (DIY) ([[Phil Craven]]/[[Amstrad Computer User|ACU]]) - a CPC6128 ROM (BIOS v3, BASIC v1.1) upgrade for the CPC464&lt;br /&gt;
* [[AD1 ROM Cartridge]] ([[Arnor]])&lt;br /&gt;
* [[AMRAM]] ([[Silicon Systems]])&lt;br /&gt;
* [[AMRAM2]] ([[Silicon Systems]])&lt;br /&gt;
* [[Amstrad ROM Expander]] (DIY) (Practical Electronics/Simon Dean)&lt;br /&gt;
* [[Britannia ROM Board]] aka ROM Plus ([[Britannia Software Ltd]])&lt;br /&gt;
* [[Cirkit HX-RX1 Rom Expansion Card]] ([[Cirkit]]) (what is this?) (added  3 September 2006 by Torn) (also listed on [[Hwlist from retroisle]])&lt;br /&gt;
* [[CPC.Flash]] internal/external 4MB ROM upgrade ([[Yarek]])&lt;br /&gt;
* [[CPC GX4000-Multi EPROM Cartridge]] Use a GX cartridge for modified ROM software&lt;br /&gt;
* [[Dobbertin EPROM 224]] ([[Dobbertin]])&lt;br /&gt;
* [[Fleet EPROM Programmer|Fleet EPROM Programmer]] (F.Kup and Fleet Microsystems Ltd.)&lt;br /&gt;
* [[FO-DOS|FO-DOS Cartridge]] - a CPC6128 ROM (BIOS v3, BASIC v1.1) upgrade for the CPC464 ([[Duchet Computers]])&lt;br /&gt;
* [[Honeysoft ROM Board]] ([[HoneySoft]])&lt;br /&gt;
* [[Inicron ROM-RAM-Box]] (Inicron)&lt;br /&gt;
* [[KDS Sideways ROM Board]] ([[KDS Electronics]])&lt;br /&gt;
* [[Maplin ROM Box]] ([[Maplin]])&lt;br /&gt;
* [[MegaFlash]] (DIY - Bryce) 512 KB ROM simulator using Flash, in-system programmable&lt;br /&gt;
* [[MegaROM]] (DIY - Bryce) 128K / 256K ROMBoard&lt;br /&gt;
* [[Microgenic ROM Board]] ([[Microgenic Systems]])&lt;br /&gt;
* [[Microgenic EPROM Programmer]] ([[Microgenic Systems]])&lt;br /&gt;
* [[Microstyle RAMROM]] ([[Microstyle]])&lt;br /&gt;
* [[Microstyle ROM Board Xtra]] ([[Microstyle]])&lt;br /&gt;
* [[POKROM]] (DIY) (Electronique Radio Plans, issue 517)&lt;br /&gt;
* [[Ramcard 128]] (a ROM emulator) ([[RAM7]])&lt;br /&gt;
* [[Rombo Rombox]] ([[Rombo Productions]])&lt;br /&gt;
* [[Schneiderware EPROM Burner]] (DIY) ([[CPC Schneider International]])&lt;br /&gt;
* [[Schneiderware Pseudo ROM]] (DIY) ([[CPC Schneider International]])&lt;br /&gt;
* [[Sideways ram]] (Paul Townsend)&lt;br /&gt;
* [[SuperPower ROM Box]] ([[Micro Power Ltd.]])&lt;br /&gt;
* [[Universeller EPROM Programmer 4004]] ([[Dobbertin]])&lt;br /&gt;
* [[X-ROM]] Eprom programmer and ROM Board ([[Timatic Systems]])&lt;br /&gt;
&lt;br /&gt;
== Monitors ==&lt;br /&gt;
* Computers [[monitor_compatible|compatible]] with Amstrad Monitors&lt;br /&gt;
* [[CM14|Amstrad CM14]] Colour Monitor (for CPC Plus)&lt;br /&gt;
* [[CTM640/CTM644|Amstrad CTM640/CTM644]] Color Monitor (for CPC 464/664/6128)&lt;br /&gt;
* [[GT64/GT65|Amstrad GT64/GT65]] Green Monitor (for CPC 464/664/6128)&lt;br /&gt;
* [[MM12|Amstrad MM12]] Monochrome Monitor (for CPC Plus)&lt;br /&gt;
* [[Amstrad MP1/MP2 modulator]]&lt;br /&gt;
* [[Amstrad MPV 001 modulator]] (Spanish MP1)&lt;br /&gt;
* [[MP2F|Amstrad MP-2F Scart Adapter]] (French MP2)&lt;br /&gt;
* [[MP-3|Amstrad MP-3 TV Tuner for CTM 644]]&lt;br /&gt;
* [[MPS Modulator]] Modulator made in Greece from MPS&lt;br /&gt;
* [[Dk'tronics TV Tuner]] ([[Dk'tronics]]) (similar to MP-3)&lt;br /&gt;
* [[Screenvision TV Tuner]] (Screens Microcomputers &amp;amp; Electronics Ltd.) (similar to MP-3)&lt;br /&gt;
* CPCI HF-modulator (CPC Schneider International 11/1986, Page 78ff. Someone please scan it, my issue lacks those pages!)&lt;br /&gt;
* [[TV SCART cable]] (DIY)&lt;br /&gt;
* [[LCD And Plasma TV Solution]] (DIY)&lt;br /&gt;
* [[Videomaster]] Modulator made in 1993 by Campursoft&lt;br /&gt;
&lt;br /&gt;
== Multi function expansions ==&lt;br /&gt;
&lt;br /&gt;
* [[CPC Booster|CPC Booster/CPC Booster+]]&lt;br /&gt;
* [[SYMBiFACE II]]&lt;br /&gt;
* [[CPCMax!]]&lt;br /&gt;
* [[CPCISA by Yarek]] ([[Yarek]])&lt;br /&gt;
* [[CPCX]]&lt;br /&gt;
* [[Full Expandable Interface]] ([[Timatic Systems]])&lt;br /&gt;
* [[PlayCity]]&lt;br /&gt;
&lt;br /&gt;
== Printers ==&lt;br /&gt;
&lt;br /&gt;
* ([[8bit Printer Ports]])&lt;br /&gt;
* ([[Amstrad Printers]])&lt;br /&gt;
* [[DMP1]] printer ([[Amstrad]]) ([[Seikosha]] Unihammer printer)&lt;br /&gt;
* [[DMP2000]] printer ([[Amstrad]]/[[Schneider]]) ([[Epson]]-compatible 9-pin printer)&lt;br /&gt;
* [[DMP2160]] printer ([[Amstrad]]/[[Schneider]]) (fast version of DMP2000)&lt;br /&gt;
* [[DMP3000]] printer ([[Amstrad]]/[[Schneider]]) (gray PC-version of DMP2000 with more ROM/RAM and IBM charset)&lt;br /&gt;
* [[DMP3160]] printer ([[Amstrad]]/[[Schneider]]) (fast version of DMP3000)&lt;br /&gt;
* [[DMP3250]]di printer ([[Amstrad]]) (dual interface version of DMP3160) (centronics + RS232)&lt;br /&gt;
* [[DMP4000]] printer ([[Amstrad]]/[[Schneider]]) ([[Epson]]-compatible 9-pin 16&amp;quot; wide printer)&lt;br /&gt;
* [[LD6000]] laser printer ([[Amstrad GmbH]]) (re-badgered Sharp printer, for German market only)&lt;br /&gt;
* [[LQ3500]](di) printer ([[Amstrad]]/[[Schneider]]) ([[Epson]]-compatible 24-pin printer)&lt;br /&gt;
* [[LQ5000]]di printer ([[Amstrad]]) ([[Epson]]-compatible 24-pin 16&amp;quot; wide printer)&lt;br /&gt;
* [[Robotron 6313|EuroPrint FT80X, Robotron 6313, Präsident 6320]] (east German)&lt;br /&gt;
* [[NLQ401|Schneider NLQ401]] ([[Schneider]]) (custom 9-pin printer, German counterpart of the DMP1)&lt;br /&gt;
* [[Star Printers]] (Star Micronics Co., Ltd.)&lt;br /&gt;
&lt;br /&gt;
== Real Time Clocks ==&lt;br /&gt;
&lt;br /&gt;
* [[ACU Real Time Clock (DIY)|ACU Real Time Clock]] (DIY) (without year counter) ([[Amstrad Computer User|ACU]])&lt;br /&gt;
* [[Aleste 520EX]] (a CPC clone with built-in RTC) ([[Patisonic]])&lt;br /&gt;
* [[Real Time Clock|CPCI Real Time Clock]] (DIY) ([[CPC Schneider International Sonderheft]])&lt;br /&gt;
* [[Dk'tronics Real Time Clock]] ([[Dk'tronics]])&lt;br /&gt;
* [[Dobbertin Smart Watch]] (the RTC itself is inserted like a ROM) ([[Dobbertin]])&lt;br /&gt;
* [[Schneiderware Real Time Clock]] (DIY) ([[CPC Schneider International]])&lt;br /&gt;
* [[SYMBiFACE_II:Realtime_clock|Realtime Clock]] of [[SYMBiFACE_II]] (modern RTC with bugged century counter)&lt;br /&gt;
&lt;br /&gt;
== Synthesizer, sampler and music related ==&lt;br /&gt;
&lt;br /&gt;
* [[Amdrum]] (Playback) ([[Cheetah]])&lt;br /&gt;
* [[Amstrad SSA-1 Speech Synthesizer]] (Speech) ([[Amstrad]])&lt;br /&gt;
* [[CPC Booster|CPC Booster/CPC Booster+]] (Stereo Sampling/Playback) ([[Antitec]]/[[Dirty Minds]])&lt;br /&gt;
* [[Datel Digital Sound Sampler]]/[[Datel Electronics]]&lt;br /&gt;
* [[Digiblaster]] (Playback) (DIY) (8bit DAC on printer port) ([[CPC Amstrad International]])&lt;br /&gt;
* [[Digivox sampler]] (EMM)&lt;br /&gt;
* [[Dk'tronics Speech Synthesizer]] (Speech) ([[Dk'tronics]])&lt;br /&gt;
* [[DHCP MIDI Interface]] (DHCP Electronics)&lt;br /&gt;
* [[EMR MIDI Interface]] (MIDI) ([[EMR|ElectroMusic Research]])&lt;br /&gt;
* [[FuturePlayer]] (modern MP3 playback, max 128kbps) (Hard: Dr.Zed, Soft: TFM)&lt;br /&gt;
* [[Maestro]] (Amplifier/Speakers) (Vanguard Leisure Ltd.)&lt;br /&gt;
* [[Magic Sound Board]] for [[Aleste 520EX]] (four channel DMA playback) ([[Patisonic]])&lt;br /&gt;
* [[Mini Interface for connection to MK5 MIDI Keyboard]] ([[Cheetah]])&lt;br /&gt;
* [[Music Machine]] (Sampling/Playback/MIDI) ([[Ram Electronics]])&lt;br /&gt;
* [[MHT Speech Synthesizer]] (Speech) ([[MHT Ingenieros]])&lt;br /&gt;
* [[Silicon Systems MIDI Interface]] ([[Silicon Systems]]) (what is this?) (added 3 September 2006 by Torn) (also listed on [[Hwlist from retroisle]])&lt;br /&gt;
* [[Sound Blaster]] (Amplifier/Speakers) ([[Siren Software]]&lt;br /&gt;
* [[Soundplayer]] (many different versions exist) (Playback) ([[Futurs']])&lt;br /&gt;
* [[TechniMusique Synthetiseur Musical|TMPI musical synthesizer]] (12 voices) ([[TechniMusique]])&lt;br /&gt;
* [[TMPI speech synthesizer]] (Speech) ([[TechniMusique]])&lt;br /&gt;
* [[Unconventional use of hardware to produce sounds]]&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
&lt;br /&gt;
* 64 Kb Printer Buffer (DIY) (what is this?) (added 19 August 2006 by CPCLER)&lt;br /&gt;
* [[Ambug|Ambug Robot]] (DIY) ([[Magenta Electronics Ltd.]])&lt;br /&gt;
* [[Amstore]] (network with 20MB harddisk) (Northern Computers)&lt;br /&gt;
* [[Amstrad Autofire Interface and Combined Mouse Interface|Amstrad Autofire Interface and Combined Mouse Interface]] (Unknown firm??)&lt;br /&gt;
* Amstrad Expansion System Part 2 ([[Maplin]]) - appeared in Project book 19 (for Part 1 see [[Maplin ROM Box]])&lt;br /&gt;
* [[Amstrad CT-1 Radio/Alarm-Clock]] ([[Amstrad]])&lt;br /&gt;
* [[CPCISA by Yarek|CPCISA]] ([[Yarek]])&lt;br /&gt;
* [[Data Media Printerinterface]] (printer splitter for connecting 2 or 3 software-selectable printers to the CPC) ([[Data Media]])&lt;br /&gt;
* [[DCP Interpacks]] (DCP Microdevelopments)&lt;br /&gt;
* [[Dust Covers]]&lt;br /&gt;
* [[Fischertechnik Interface]] for use with the [[Fischertechnik Trainingsrobot]], the [[Fischertechnik Plotter/Scanner]], and the [[Fischertechnik Computing Experimental]] kit.&lt;br /&gt;
* [[HDCPC]] (what is this?) (added 21 August 2006 by 85.218.166.50) (according to [[Dobbertin Harddisc|this page]], HDCPC is a modern IDE harddisk interace, but it's unknown who developed that thing?)&lt;br /&gt;
* [[Jagot &amp;amp; Leon Interface Cards]] ([[Jagot &amp;amp; Leon]])&lt;br /&gt;
* [[KDS Power Controller]] (a box with eight relays) ([[KDS Electronics]])&lt;br /&gt;
* [[Kersten PC Emulator]]&lt;br /&gt;
* [[Maplins 8bit Input Port]] ([[Maplin]]) (among others for use with Maplin's Weather Satellite Decoder)&lt;br /&gt;
* [[Maplin ROM Box|Maplins 6x8bit Input/Output Port]] ([[Maplin]]) (an extension to Maplin's &amp;quot;Rombox&amp;quot; project)&lt;br /&gt;
* [[Maplins Weather Satellite Receiver]] ([[Maplin]])&lt;br /&gt;
* [[Oktett]] (multimeter/oscilloscope) ([[Otten/Fecht]])&lt;br /&gt;
* [[Peripheral Soft Reset]] (System BIOS Feature for Peripherals)&lt;br /&gt;
* [[Schneiderware]] (a series of [[ECB Bus]] based DIY projects that were released in [[CPC Schneider International]] magazine)&lt;br /&gt;
* [[Split Extension Connector|Cheetah Marketing Split Extension Connector]] ([[Cheetah]])&lt;br /&gt;
* Teleterminal 300s (reportedly &amp;quot;simulates&amp;quot; rs232; connects to printer port; for use with acoustic coupler, see review in CPCI 8-1985, page 55-56)&lt;br /&gt;
* [[Slomo]] A device to reduce the execution speed of the Amstrad CPC (also available for other machines) by [[Nidd Valley Micro Products]], Ltd. (UK)&lt;br /&gt;
&lt;br /&gt;
Some further (unsorted) peripherals are found here: [[Hwlist from retroisle]]. More DIYs are listed on [[Happy Computer (Schneider Sonderheft)]] (those german magazine articles aren't yet scanned).&lt;br /&gt;
&lt;br /&gt;
[[Category:Peripherals| ]][[Category:Hardware|*]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90167</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90167"/>
				<updated>2014-07-09T18:18:01Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
[[File:PlayCity schematic.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val aree not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:PlayCity_schematic.png&amp;diff=90166</id>
		<title>File:PlayCity schematic.png</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:PlayCity_schematic.png&amp;diff=90166"/>
				<updated>2014-07-09T18:16:18Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90165</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90165"/>
				<updated>2014-07-09T18:04:14Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Write the introduction text...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val aree not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;br /&gt;
==Downloads==&lt;br /&gt;
In [[File:playcity_examples.zip]], you will find more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90164</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90164"/>
				<updated>2014-07-09T18:03:04Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Write the introduction text...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val aree not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;br /&gt;
==Downloads==&lt;br /&gt;
You will find [[File:playcity_examples.zip|here]] more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90163</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90163"/>
				<updated>2014-07-09T17:59:49Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Write the introduction text...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val aree not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;br /&gt;
==Downloads==&lt;br /&gt;
You will find [[playcity_examples.zip|'''here''']] more examples with full sources of using the CTC, a customized arkos player that let you play songs using an external YMZ and the ReSeT party demo disk that includes a CPC version of the PT3 Turbo Sound player (6 channels song format).&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Playcity_examples.zip&amp;diff=90162</id>
		<title>File:Playcity examples.zip</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Playcity_examples.zip&amp;diff=90162"/>
				<updated>2014-07-09T17:51:53Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MsUpload&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90161</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90161"/>
				<updated>2014-07-09T15:35:35Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Write the introduction text...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy!&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val were not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90160</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90160"/>
				<updated>2014-07-09T15:02:55Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Write the introduction text...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slot.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port '''$F8FF'''. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
'''MC_BOOT_PROGRAM''' and '''MC_START_PROGRAM''' (vectors $BD13 and $BD16), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val were not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90159</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90159"/>
				<updated>2014-07-09T14:57:09Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Write the introduction text...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Phaser]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val were not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90158</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90158"/>
				<updated>2014-07-09T14:56:27Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
Write the introduction text...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHT PEN/GUN connector.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
== Light Pen/Gun connector ==&lt;br /&gt;
For making easier to adapt Light Pens/Guns from other systems or new ones, we added a 4 pins connector to the board. The connections are labeled in the board as VCC (+5V), TR (Trigger or D7), LS (Light Sensor) and GND.&lt;br /&gt;
&lt;br /&gt;
Making the system compatible with [[Amstrad_Magnum_Phaser|Amstrad Magnum Pasher]] games, the most accuracy light gun system for CPC.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val were not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90157</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90157"/>
				<updated>2014-07-09T14:43:34Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* 6 audio channels sound with programmable frequency (stereo line out and speaker mono mix in).&lt;br /&gt;
&lt;br /&gt;
* 4 counter/timer channels for programmable interrupt (including NMI).&lt;br /&gt;
* IM2 vectorized interrupt support.&lt;br /&gt;
* Raster lines interrupt support.&lt;br /&gt;
* CRTC hardware CURSOR interrupt support.&lt;br /&gt;
* The LIGHTPEN pin is rooted to a 4 pins connector for plugging compatible hardware through an adapter.&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val were not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90156</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90156"/>
				<updated>2014-07-09T14:36:46Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels interfaced directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the PlayCity board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The PlayCity board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val were not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90155</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90155"/>
				<updated>2014-07-09T14:34:20Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. You can get full information in the CTC datasheet ([[File:Z80ctc.pdf]]). &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the CTC-AY board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The CTC-AY board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val were not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90154</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90154"/>
				<updated>2014-07-09T14:32:36Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. You can get full information in the official [[File:Z80ctc.pdf|Zilog CTC datasheet]]. &lt;br /&gt;
&lt;br /&gt;
The first thing&lt;br /&gt;
to consider is how those channels are linked to the CTC-AY board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The CTC-AY board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val were not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90153</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90153"/>
				<updated>2014-07-09T14:22:55Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. The first thing&lt;br /&gt;
to consider is how those channels are linked to the CTC-AY board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The CTC-AY board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;br /&gt;
'''Informations''': The rows without a CTC Val were not tested. It may be needed to configure the CTC channel 0 with &amp;quot;falling edge&amp;quot; instead of&lt;br /&gt;
&amp;quot;rising edges&amp;quot;.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90152</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90152"/>
				<updated>2014-07-09T14:20:05Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. The first thing&lt;br /&gt;
to consider is how those channels are linked to the CTC-AY board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The CTC-AY board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly the same than the [[PSG]], only remember there is not PSG I/O registers ($0E-$0F9) in the YMZ.&lt;br /&gt;
===Coding Examples===&lt;br /&gt;
====YMZ Initialization====&lt;br /&gt;
'''YMZ_SELECT''', select a YMZ register. Use the port '''$F984''' for the right channels and port '''$F988''' for the left channels.&lt;br /&gt;
&lt;br /&gt;
'''YMZ_WRITE''', write a byte in the selected register. Use the port '''$F884''' for the right channels and port '''$F888''' for the left channels.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Initialization of the YMZ registers&lt;br /&gt;
LD A,$D&lt;br /&gt;
.loop_init_ymz&lt;br /&gt;
LD BC,YMZ_SELECT&lt;br /&gt;
OUT (C),A ; Register&lt;br /&gt;
LD BC,YMZ_WRITE&lt;br /&gt;
CP 7&lt;br /&gt;
JR NZ,.send_zero&lt;br /&gt;
LD A,$3F ; Noise and Tone disabled&lt;br /&gt;
OUT (C),A ; Write in YMZ R7&lt;br /&gt;
LD A,6&lt;br /&gt;
JR .loop_init_ymz&lt;br /&gt;
.send_zero&lt;br /&gt;
OUT (C),0 ; Write 0 in the selected YMZ register&lt;br /&gt;
DEC A&lt;br /&gt;
JP P,.loop_init_ymz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===CTC/YMZ Useful Values===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! 4/N !! CTC Val !! CTC OUT (MHz) !! YMZ Div (MHz) !! Computer&lt;br /&gt;
|-&lt;br /&gt;
| 1 || $01 || 2,00 || 1,00 || CPC&lt;br /&gt;
|-&lt;br /&gt;
| 2 || || 2,67 || 1,33 ||&lt;br /&gt;
|-&lt;br /&gt;
| 3  ||$02 || 3,00 || 1,50 ||&lt;br /&gt;
|-&lt;br /&gt;
| 4 || || 3,20 || 1,60 ||&lt;br /&gt;
|-&lt;br /&gt;
| 5 || $03 || 3,33 || 1,67 ||&lt;br /&gt;
|-&lt;br /&gt;
| 6 || || 3,43 || 1,71 ||&lt;br /&gt;
|-&lt;br /&gt;
| 7 || $04 || 3,50 || 1,75 || ZX&lt;br /&gt;
|-&lt;br /&gt;
| 8 || || 3,56 || 1,78 || MSX&lt;br /&gt;
|-&lt;br /&gt;
| 9 || $05 || 3,60 || 1,80 ||&lt;br /&gt;
|-&lt;br /&gt;
| 10 || || 3,64 || 1,82 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || $06 || 3,67 || 1,83 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || || 3,69 || 1,85 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || $07 || 3,71 || 1,86 ||&lt;br /&gt;
|-&lt;br /&gt;
| 14 || || 3,73 || 1,87 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || $08 || 3,75 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || || 3,76 || 1,88 ||&lt;br /&gt;
|-&lt;br /&gt;
| ... || ... || ... || ... ||&lt;br /&gt;
|-&lt;br /&gt;
| 256 || $00 || 3,98 || 1,99 ||&lt;br /&gt;
|-&lt;br /&gt;
| UNSET || || 4,00 || 2,00 || ST&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90151</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90151"/>
				<updated>2014-07-09T14:04:35Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connections)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. The first thing&lt;br /&gt;
to consider is how those channels are linked to the CTC-AY board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The CTC-AY board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;br /&gt;
They are exactly than the [[PSG]]&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90150</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90150"/>
				<updated>2014-07-09T13:58:19Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connexions)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. The first thing&lt;br /&gt;
to consider is how those channels are linked to the CTC-AY board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;br /&gt;
==Audio Channels==&lt;br /&gt;
===Informations===&lt;br /&gt;
The CTC-AY board is populated with two AY compatible soundchips, adding 6 stereo channels. The YMZ294 eliminate the I/O port&lt;br /&gt;
and improve the CPU interface through /CS, /WR control signals and a 8-bit data bus. Each sound chip can be directly&lt;br /&gt;
programmed using two dedicated I/O ports for registers and data. No initialization code is required.&lt;br /&gt;
&lt;br /&gt;
By default, the YMZs are clocked at 4 MHz but run internaly at 2 MHz. So, they will sound like an Atari ST, while you don't change&lt;br /&gt;
the frequency by reprograming the CTC Channel 0.&lt;br /&gt;
===YMZ294 Registers===&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90149</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90149"/>
				<updated>2014-07-09T13:56:37Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connexions)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. The first thing&lt;br /&gt;
to consider is how those channels are linked to the CTC-AY board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 0 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set both YMZ294 clocks to sound like the CPC AY-3-8912&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
LD HL,$7F01&lt;br /&gt;
OUT (C),H ; $7F = Clock generator&lt;br /&gt;
OUT (C),L  ; $01 = CPC AY&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 in timer mode (prescalar 256 and set new time constant)&lt;br /&gt;
LD H,%10110111 ; Timer mode and preescalar 256&lt;br /&gt;
LD L,1 ; Time constant&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
OUT (C),H  ; Enable Timer&lt;br /&gt;
OUT (C),L ; Set new time constant&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Channel 2/3 example====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Start CTC channel 2 and 3 in 16-bit counter mode&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD HL,32768 ; Timer constant&lt;br /&gt;
LD A,%11110111 ; Counter mode&lt;br /&gt;
OUT (C),A ; Enable Timer 2&lt;br /&gt;
OUT (C),L ; Set new time constant (lower byte)&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Enable Timer 3&lt;br /&gt;
OUT (C),H ; Set new time constant (high byte)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Stop CTC channel 2 and 3 (16 bit mode)&lt;br /&gt;
LD BC,$F882&lt;br /&gt;
LD A,%00000011&lt;br /&gt;
OUT (C),A ; Disable Timer 2&lt;br /&gt;
INC BC&lt;br /&gt;
OUT (C),A ; Disable Timer 3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Don't forget to use RETN for NMI handlers as well as RETI for normal interrupt handlers. In other case, the Z80 CPU will not&lt;br /&gt;
aknowledge the next interrupt properly.&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90148</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90148"/>
				<updated>2014-07-09T13:53:05Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connexions)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. The first thing&lt;br /&gt;
to consider is how those channels are linked to the CTC-AY board.&lt;br /&gt;
====Channel 0 ($F880)====&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
====Channel 1 ($F881)====&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
====Channel 2/3 ($F882/$F883)====&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
====Vector interrupts====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Set Vector lower byte to 0&lt;br /&gt;
LD BC,$F880&lt;br /&gt;
OUT (C),0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90147</id>
		<title>PlayCity</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=PlayCity&amp;diff=90147"/>
				<updated>2014-07-09T13:46:40Z</updated>
		
		<summary type="html">&lt;p&gt;SyX: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
'''Thank you very much for supporting our product!'''&lt;br /&gt;
&lt;br /&gt;
By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for&lt;br /&gt;
Amstrad and Schneider CPC 464/664/6128 range of computers.&lt;br /&gt;
&lt;br /&gt;
Its most important features are:&lt;br /&gt;
* Raster programmable interrupts with CURSOR and NMI support&lt;br /&gt;
* Six stereo audio channels with programmable frequency&lt;br /&gt;
* General purpose counters and timers&lt;br /&gt;
&lt;br /&gt;
==Hardware Installation==&lt;br /&gt;
* Power OFF your Amstrad / Schneider CPC.&lt;br /&gt;
* Attach the PlayCity board to one free MotherX4 slog.&lt;br /&gt;
* Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connexions)&lt;br /&gt;
&lt;br /&gt;
==Peripheral Soft Reset==&lt;br /&gt;
All expansion peripherals should be reset when an output is performed to I/O port $F8FF. &lt;br /&gt;
&lt;br /&gt;
Used by the standard BIOS functions&lt;br /&gt;
MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.&lt;br /&gt;
&lt;br /&gt;
The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.&lt;br /&gt;
&lt;br /&gt;
==Counter/Timer Circuit==&lt;br /&gt;
===Informations===&lt;br /&gt;
The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. The first thing&lt;br /&gt;
to consider is how those channels are linked to the CTC-AY board.&lt;br /&gt;
===Channel 0 ($F880)===&lt;br /&gt;
The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger&lt;br /&gt;
(TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.&lt;br /&gt;
===Channel 1 ($F881)===&lt;br /&gt;
The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output&lt;br /&gt;
(ZC/TO1) is connected to the NMI pin of the Z80.&lt;br /&gt;
Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a&lt;br /&gt;
timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of&lt;br /&gt;
scanlines to wait before to send an NMI.&lt;br /&gt;
===Channel 2/3 ($F882/$F883)===&lt;br /&gt;
The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz&lt;br /&gt;
system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit&lt;br /&gt;
counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.&lt;br /&gt;
===Coding examples===&lt;br /&gt;
Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown&lt;br /&gt;
automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be&lt;br /&gt;
specified; the CTC internally generates an unique vector for each channel.&lt;br /&gt;
Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts.&lt;br /&gt;
Vector interrupts&lt;/div&gt;</summary>
		<author><name>SyX</name></author>	</entry>

	</feed>