<?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=Fano</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=Fano"/>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php/Special:Contributions/Fano"/>
		<updated>2026-08-28T10:01:32Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88905</id>
		<title>Programming:Keyboard redefinition</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88905"/>
				<updated>2014-01-15T20:14:06Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Key redefinition library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key redefinition library ==&lt;br /&gt;
&lt;br /&gt;
This is a little library to allow you to scan keyboard, test keys and redefine them.Functions are explained in source code.&lt;br /&gt;
&lt;br /&gt;
Keycodes returned by GetPressed and used for IsPressed/GetMask are the same than firmware keycodes (you know the one you have on disc plate on CPC 664/6128)&lt;br /&gt;
&lt;br /&gt;
For performance , it is possible to compute directly offset and mask in keyboard buffer with GetMask function.This is usefull for game as IsPressed function can be considered as slow.&lt;br /&gt;
&lt;br /&gt;
As SHIFT or CONTROL status can be a problem , you can inhibate them using IgnoreSHITFCTRL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;simple keyboard module&lt;br /&gt;
;no extra functions , just scan and locate a key&lt;br /&gt;
;no char buffer , no antibounce, ect...&lt;br /&gt;
;SJASM syntax&lt;br /&gt;
&lt;br /&gt;
MODULE key&lt;br /&gt;
		&lt;br /&gt;
;do a complete key scan and store it at (HL)&lt;br /&gt;
;altered : AF - BC - DE&lt;br /&gt;
&lt;br /&gt;
Scan&lt;br /&gt;
 push HL&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F40e&lt;br /&gt;
 ld E,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F6c0&lt;br /&gt;
 ld D,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld C,0 &lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F792&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld A,#40&lt;br /&gt;
 ld C,#4A&lt;br /&gt;
.loop&lt;br /&gt;
 ld B,D&lt;br /&gt;
 out (C),A&lt;br /&gt;
 ld B,E&lt;br /&gt;
 ini&lt;br /&gt;
 inc A&lt;br /&gt;
 cp C&lt;br /&gt;
 jr c,.loop&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C &lt;br /&gt;
 pop HL&lt;br /&gt;
 ret&lt;br /&gt;
&lt;br /&gt;
;check if there is a key is down at (HL)&lt;br /&gt;
;only the first key found is returned&lt;br /&gt;
;return carry is a key is down&lt;br /&gt;
;return key code in A : key code = (line*8)+bit&lt;br /&gt;
;returned code is the same than system&lt;br /&gt;
;altered : AF - BC&lt;br /&gt;
&lt;br /&gt;
GetPressed		&lt;br /&gt;
 push HL		&lt;br /&gt;
 ld C,10&lt;br /&gt;
.loop_col		&lt;br /&gt;
 ld B,8		&lt;br /&gt;
 ld A,(HL++)&lt;br /&gt;
.loop_bit		&lt;br /&gt;
 rla		&lt;br /&gt;
 jr nc,.pressed		&lt;br /&gt;
 djnz .loop_bit				&lt;br /&gt;
 dec C		&lt;br /&gt;
 jr nz,.loop_col		&lt;br /&gt;
 or A ;no key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret&lt;br /&gt;
.pressed		&lt;br /&gt;
 dec C		&lt;br /&gt;
 ld A,9		&lt;br /&gt;
 sub C		&lt;br /&gt;
 add A	;*2		&lt;br /&gt;
 add A	;*4		&lt;br /&gt;
 add A	;*8		&lt;br /&gt;
 dec B		&lt;br /&gt;
 or B	;add bit		&lt;br /&gt;
 scf	;key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;check if a key is pressed&lt;br /&gt;
;A = key code		&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;return key state in carry&lt;br /&gt;
;altered AF - DE - B&lt;br /&gt;
&lt;br /&gt;
IsPressed	&lt;br /&gt;
 push HL	&lt;br /&gt;
 push AF ; keep bit	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld E,A	&lt;br /&gt;
 ld D,0&lt;br /&gt;
 add HL,DE&lt;br /&gt;
;so we get the address&lt;br /&gt;
 pop AF&lt;br /&gt;
 and 7&lt;br /&gt;
 inc A&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,(HL)&lt;br /&gt;
;get line&lt;br /&gt;
.loop&lt;br /&gt;
 rra ;get bit in carry&lt;br /&gt;
 djnz .loop&lt;br /&gt;
 ccf	;reverse bit&lt;br /&gt;
 pop HL&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;compute offset and mask for a key&lt;br /&gt;
;A = key code&lt;br /&gt;
;return offset in C and mask in B&lt;br /&gt;
;altered AF - BC&lt;br /&gt;
&lt;br /&gt;
GetMask	&lt;br /&gt;
 ld B,A&lt;br /&gt;
;get offset	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld C,A &lt;br /&gt;
;get mask	&lt;br /&gt;
 ld A,B	&lt;br /&gt;
 and %00000111	&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,1	&lt;br /&gt;
 jr z,.done&lt;br /&gt;
.loop	&lt;br /&gt;
 add A	&lt;br /&gt;
 djnz .loop&lt;br /&gt;
.done	&lt;br /&gt;
 ld B,A	&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;erase SHIFT and CONTROL status&lt;br /&gt;
;used when that can be a problem , like with IsPressed&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;altered : AF&lt;br /&gt;
&lt;br /&gt;
IgnoreSHITFCTRL		&lt;br /&gt;
 push HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 ld A,(HL)	&lt;br /&gt;
 or %10100000	&lt;br /&gt;
 ld (HL),A	&lt;br /&gt;
 pop HL	&lt;br /&gt;
 ret				&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ENDMODULE&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88900</id>
		<title>Programming:Keyboard redefinition</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88900"/>
				<updated>2014-01-15T08:57:43Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Key redefinition library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key redefinition library ==&lt;br /&gt;
&lt;br /&gt;
This is a little library to allow you to scan keyboard, test keys and redefine them.Functions are explained in source code.&lt;br /&gt;
&lt;br /&gt;
Keycodes returned by GetPressed and used for IsPressed/GetMask are the same than firmware keycodes (you know the one you have on disc plate on CPC 664/6128)&lt;br /&gt;
&lt;br /&gt;
For performance , it is possible to compute directly offset and mask in keyboard buffer with GetMask function.This is usefull for game as IsPressed function can be considered as slow.&lt;br /&gt;
&lt;br /&gt;
As SHIFT or CONTROL status can be a problem , you can inhibate them using IgnoreSHITFCTRL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;simple keyboard module&lt;br /&gt;
;no extra functions , just scan and locate a key&lt;br /&gt;
;no char buffer , no antibounce, ect...&lt;br /&gt;
;SJASM syntax&lt;br /&gt;
&lt;br /&gt;
MODULE key&lt;br /&gt;
		&lt;br /&gt;
;do a complete key scan and store it at (HL)&lt;br /&gt;
;altered : AF - BC - DE&lt;br /&gt;
&lt;br /&gt;
Scan&lt;br /&gt;
 push HL&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F40e&lt;br /&gt;
 ld E,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F6c0&lt;br /&gt;
 ld D,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld C,0 &lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F792&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld A,#40&lt;br /&gt;
 ld C,#4A&lt;br /&gt;
.loop&lt;br /&gt;
 ld B,D&lt;br /&gt;
 out (C),A&lt;br /&gt;
 ld B,E&lt;br /&gt;
 ini&lt;br /&gt;
 inc A&lt;br /&gt;
 cp C&lt;br /&gt;
 jr c,.loop&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C &lt;br /&gt;
 pop HL&lt;br /&gt;
 ret&lt;br /&gt;
&lt;br /&gt;
;check if there is a key is down at (HL)&lt;br /&gt;
;only the first key found is returned&lt;br /&gt;
;return carry is a key is down&lt;br /&gt;
;return key code in A : key code = (line*8)+bit&lt;br /&gt;
;returned code is the same than system&lt;br /&gt;
;altered : AF - BC&lt;br /&gt;
&lt;br /&gt;
GetPressed		&lt;br /&gt;
 push HL		&lt;br /&gt;
 ld C,10.loop_col		&lt;br /&gt;
 ld B,8		&lt;br /&gt;
 ld A,(HL++).loop_bit		&lt;br /&gt;
 rla		jr nc,.pressed		&lt;br /&gt;
 djnz .loop_bit				&lt;br /&gt;
 dec C		&lt;br /&gt;
 jr nz,.loop_col		&lt;br /&gt;
 or A ;no key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret&lt;br /&gt;
.pressed		&lt;br /&gt;
 dec C		&lt;br /&gt;
 ld A,9		&lt;br /&gt;
 sub C		&lt;br /&gt;
 add A	;*2		&lt;br /&gt;
 add A	;*4		&lt;br /&gt;
 add A	;*8		&lt;br /&gt;
 dec B		&lt;br /&gt;
 or B	;add bit		&lt;br /&gt;
 scf	;key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;check if a key is pressed&lt;br /&gt;
;A = key code		&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;return key state in carry&lt;br /&gt;
;altered AF - DE - B&lt;br /&gt;
&lt;br /&gt;
IsPressed	&lt;br /&gt;
 push HL	&lt;br /&gt;
 push AF ; keep bit	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld E,A	&lt;br /&gt;
 ld D,0&lt;br /&gt;
 add HL,DE&lt;br /&gt;
;so we get the address&lt;br /&gt;
 pop AF&lt;br /&gt;
 and 7&lt;br /&gt;
 inc A&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,(HL)&lt;br /&gt;
;get line&lt;br /&gt;
.loop&lt;br /&gt;
 rra ;get bit in carry&lt;br /&gt;
djnz .loop&lt;br /&gt;
 ccf	;reverse bit&lt;br /&gt;
 pop HL&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;compute offset and mask for a key&lt;br /&gt;
;A = key code&lt;br /&gt;
;return offset in C and mask in B&lt;br /&gt;
;altered AF - BC&lt;br /&gt;
&lt;br /&gt;
GetMask	&lt;br /&gt;
 ld B,A&lt;br /&gt;
;get offset	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld C,A &lt;br /&gt;
;get mask	&lt;br /&gt;
 ld A,B	&lt;br /&gt;
 and %00000111	&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,1	&lt;br /&gt;
 jr z,.done&lt;br /&gt;
.loop	&lt;br /&gt;
 add A	&lt;br /&gt;
 djnz .loop&lt;br /&gt;
.done	&lt;br /&gt;
 ld B,A	&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;erase SHIFT and CONTROL status&lt;br /&gt;
;used when that can be a problem , like with IsPressed&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;altered : AF&lt;br /&gt;
&lt;br /&gt;
IgnoreSHITFCTRL		&lt;br /&gt;
 push HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 ld A,(HL)	&lt;br /&gt;
 or %10100000	&lt;br /&gt;
 ld (HL),A	&lt;br /&gt;
 pop HL	&lt;br /&gt;
 ret				&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ENDMODULE&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88899</id>
		<title>Programming:Keyboard redefinition</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88899"/>
				<updated>2014-01-15T08:24:48Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Key redefinition library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key redefinition library ==&lt;br /&gt;
&lt;br /&gt;
This is a little library to allow you to scan keyboard, test keys and redefine them.Functions are explained in source code.&lt;br /&gt;
&lt;br /&gt;
Keycodes returned by GetPressed and used for IsPressed/GetMask are the same than firmware keycodes (you know the one you have on disc plate on CPC 664/6128)&lt;br /&gt;
&lt;br /&gt;
For performance , it is possible to compute directly offset and mask in keyboard buffer with GetMask function.This is usefull for game as IsPressed function can be considered as slow.&lt;br /&gt;
&lt;br /&gt;
As SHIFT or CONTROL status can be a problem , you can inhibate them using IgnoreSHITFCTRL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;simple keyboard module&lt;br /&gt;
;no extra functions , just scan and locate a key&lt;br /&gt;
;no char buffer , no antibounce, ect...&lt;br /&gt;
;SJASM syntax&lt;br /&gt;
&lt;br /&gt;
MODULE key&lt;br /&gt;
		&lt;br /&gt;
;do a complete key scan and store it at (HL)&lt;br /&gt;
;altered : AF - BC - DE&lt;br /&gt;
&lt;br /&gt;
Scan&lt;br /&gt;
 push HL&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F40e&lt;br /&gt;
 ld E,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F6c0&lt;br /&gt;
 ld D,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld C,0 &lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F792&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld A,#40&lt;br /&gt;
 ld C,#4A&lt;br /&gt;
.loop&lt;br /&gt;
 ld B,D&lt;br /&gt;
 out (C),A&lt;br /&gt;
 ld B,E&lt;br /&gt;
 ini&lt;br /&gt;
 inc A&lt;br /&gt;
 cp C&lt;br /&gt;
 jr c,.loop&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C &lt;br /&gt;
 pop HL&lt;br /&gt;
 ret&lt;br /&gt;
&lt;br /&gt;
;check if there is a key is down at (HL);only the first key found is returned&lt;br /&gt;
;return carry is a key is down&lt;br /&gt;
;return key code in A : key code = (line*8)+bit&lt;br /&gt;
;returned code is the same than system&lt;br /&gt;
;altered : AF - BC&lt;br /&gt;
&lt;br /&gt;
GetPressed		&lt;br /&gt;
 push HL		&lt;br /&gt;
 ld C,10.loop_col		&lt;br /&gt;
 ld B,8		&lt;br /&gt;
 ld A,(HL++).loop_bit		&lt;br /&gt;
 rla		jr nc,.pressed		&lt;br /&gt;
 djnz .loop_bit				&lt;br /&gt;
 dec C		&lt;br /&gt;
 jr nz,.loop_col		&lt;br /&gt;
 or A ;no key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret&lt;br /&gt;
.pressed		&lt;br /&gt;
 dec C		&lt;br /&gt;
 ld A,9		&lt;br /&gt;
 sub C		&lt;br /&gt;
 add A	;*2		&lt;br /&gt;
 add A	;*4		&lt;br /&gt;
 add A	;*8		&lt;br /&gt;
 dec B		&lt;br /&gt;
 or B	;add bit		&lt;br /&gt;
 scf	;key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;check if a key is pressed&lt;br /&gt;
;A = key code		&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;return key state in carry&lt;br /&gt;
;altered AF - DE - B&lt;br /&gt;
&lt;br /&gt;
IsPressed	&lt;br /&gt;
 push HL	&lt;br /&gt;
 push AF ; keep bit	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld E,A	ld D,0&lt;br /&gt;
 add HL,DE&lt;br /&gt;
;so we get the address&lt;br /&gt;
pop AF&lt;br /&gt;
;now get the&lt;br /&gt;
 and 7&lt;br /&gt;
 inc A&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,(HL)&lt;br /&gt;
;get line&lt;br /&gt;
.loop&lt;br /&gt;
 rra ;get bit in carry&lt;br /&gt;
djnz .loop&lt;br /&gt;
 ccf	;reverse bit&lt;br /&gt;
 pop HL&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;compute offset and mask for a key&lt;br /&gt;
;A = key code&lt;br /&gt;
;return offset in C and mask in B&lt;br /&gt;
;altered AF - BC&lt;br /&gt;
&lt;br /&gt;
GetMask	&lt;br /&gt;
 ld B,A&lt;br /&gt;
;get offset	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld C,A &lt;br /&gt;
;get mask	&lt;br /&gt;
 ld A,B	&lt;br /&gt;
 and %00000111	&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,1	&lt;br /&gt;
 jr z,.done&lt;br /&gt;
.loop	&lt;br /&gt;
 add A	&lt;br /&gt;
 djnz .loop&lt;br /&gt;
.done	&lt;br /&gt;
 ld B,A	&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;erase SHIFT and CONTROL status&lt;br /&gt;
;used when that can be a problem , like with IsPressed&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;altered : AF&lt;br /&gt;
&lt;br /&gt;
IgnoreSHITFCTRL		&lt;br /&gt;
 push HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 ld A,(HL)	&lt;br /&gt;
 or %10100000	&lt;br /&gt;
 ld (HL),A	&lt;br /&gt;
 pop HL	&lt;br /&gt;
 ret				&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ENDMODULE&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88898</id>
		<title>Programming:Keyboard redefinition</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88898"/>
				<updated>2014-01-15T08:24:29Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Key redefinition library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key redefinition library ==&lt;br /&gt;
&lt;br /&gt;
This is a little library to allow you to scan keyboard, test keys and redefine them.Functions are explained in source code.&lt;br /&gt;
&lt;br /&gt;
Keycodes returned by GetPressed and used for IsPressed/GetMask are the same than firmware keycodes (you know the one you have on disc plate on CPC 664/6128)&lt;br /&gt;
&lt;br /&gt;
For performance , it is possible to compute directly offset and mask in keyboard buffer with GetMask function.This is usefull for game as IsPressed function can be considered as slow.&lt;br /&gt;
&lt;br /&gt;
As SHIFT or CONTROL status can be a control , you can inhibate them using IgnoreSHITFCTRL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;simple keyboard module&lt;br /&gt;
;no extra functions , just scan and locate a key&lt;br /&gt;
;no char buffer , no antibounce, ect...&lt;br /&gt;
;SJASM syntax&lt;br /&gt;
&lt;br /&gt;
MODULE key&lt;br /&gt;
		&lt;br /&gt;
;do a complete key scan and store it at (HL)&lt;br /&gt;
;altered : AF - BC - DE&lt;br /&gt;
&lt;br /&gt;
Scan&lt;br /&gt;
 push HL&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F40e&lt;br /&gt;
 ld E,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F6c0&lt;br /&gt;
 ld D,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld C,0 &lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F792&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld A,#40&lt;br /&gt;
 ld C,#4A&lt;br /&gt;
.loop&lt;br /&gt;
 ld B,D&lt;br /&gt;
 out (C),A&lt;br /&gt;
 ld B,E&lt;br /&gt;
 ini&lt;br /&gt;
 inc A&lt;br /&gt;
 cp C&lt;br /&gt;
 jr c,.loop&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C &lt;br /&gt;
 pop HL&lt;br /&gt;
 ret&lt;br /&gt;
&lt;br /&gt;
;check if there is a key is down at (HL);only the first key found is returned&lt;br /&gt;
;return carry is a key is down&lt;br /&gt;
;return key code in A : key code = (line*8)+bit&lt;br /&gt;
;returned code is the same than system&lt;br /&gt;
;altered : AF - BC&lt;br /&gt;
&lt;br /&gt;
GetPressed		&lt;br /&gt;
 push HL		&lt;br /&gt;
 ld C,10.loop_col		&lt;br /&gt;
 ld B,8		&lt;br /&gt;
 ld A,(HL++).loop_bit		&lt;br /&gt;
 rla		jr nc,.pressed		&lt;br /&gt;
 djnz .loop_bit				&lt;br /&gt;
 dec C		&lt;br /&gt;
 jr nz,.loop_col		&lt;br /&gt;
 or A ;no key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret&lt;br /&gt;
.pressed		&lt;br /&gt;
 dec C		&lt;br /&gt;
 ld A,9		&lt;br /&gt;
 sub C		&lt;br /&gt;
 add A	;*2		&lt;br /&gt;
 add A	;*4		&lt;br /&gt;
 add A	;*8		&lt;br /&gt;
 dec B		&lt;br /&gt;
 or B	;add bit		&lt;br /&gt;
 scf	;key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;check if a key is pressed&lt;br /&gt;
;A = key code		&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;return key state in carry&lt;br /&gt;
;altered AF - DE - B&lt;br /&gt;
&lt;br /&gt;
IsPressed	&lt;br /&gt;
 push HL	&lt;br /&gt;
 push AF ; keep bit	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld E,A	ld D,0&lt;br /&gt;
 add HL,DE&lt;br /&gt;
;so we get the address&lt;br /&gt;
pop AF&lt;br /&gt;
;now get the&lt;br /&gt;
 and 7&lt;br /&gt;
 inc A&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,(HL)&lt;br /&gt;
;get line&lt;br /&gt;
.loop&lt;br /&gt;
 rra ;get bit in carry&lt;br /&gt;
djnz .loop&lt;br /&gt;
 ccf	;reverse bit&lt;br /&gt;
 pop HL&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;compute offset and mask for a key&lt;br /&gt;
;A = key code&lt;br /&gt;
;return offset in C and mask in B&lt;br /&gt;
;altered AF - BC&lt;br /&gt;
&lt;br /&gt;
GetMask	&lt;br /&gt;
 ld B,A&lt;br /&gt;
;get offset	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld C,A &lt;br /&gt;
;get mask	&lt;br /&gt;
 ld A,B	&lt;br /&gt;
 and %00000111	&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,1	&lt;br /&gt;
 jr z,.done&lt;br /&gt;
.loop	&lt;br /&gt;
 add A	&lt;br /&gt;
 djnz .loop&lt;br /&gt;
.done	&lt;br /&gt;
 ld B,A	&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;erase SHIFT and CONTROL status&lt;br /&gt;
;used when that can be a problem , like with IsPressed&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;altered : AF&lt;br /&gt;
&lt;br /&gt;
IgnoreSHITFCTRL		&lt;br /&gt;
 push HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 ld A,(HL)	&lt;br /&gt;
 or %10100000	&lt;br /&gt;
 ld (HL),A	&lt;br /&gt;
 pop HL	&lt;br /&gt;
 ret				&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ENDMODULE&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88897</id>
		<title>Programming:Keyboard redefinition</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88897"/>
				<updated>2014-01-15T08:21:09Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Key redefinition library ==&lt;br /&gt;
&lt;br /&gt;
This is a little library to allow you to scan keyboard, test keys and redefine them.Functions are explained in source code.&lt;br /&gt;
&lt;br /&gt;
Keycodes returned by GetPressed and IsPressed are the same than firmware keycodes (you know the one you have on disc plate on CPC 664/6128)&lt;br /&gt;
&lt;br /&gt;
For performance , it is possible to compute directly offset and mask in keyboard buffer with GetMask function.This is usefull for game as IsPressed function can be considered as slow.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;simple keyboard module&lt;br /&gt;
;no extra functions , just scan and locate a key&lt;br /&gt;
;no char buffer , no antibounce, ect...&lt;br /&gt;
;SJASM syntax&lt;br /&gt;
&lt;br /&gt;
MODULE key&lt;br /&gt;
		&lt;br /&gt;
;do a complete key scan and store it at (HL)&lt;br /&gt;
;altered : AF - BC - DE&lt;br /&gt;
&lt;br /&gt;
Scan&lt;br /&gt;
 push HL&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F40e&lt;br /&gt;
 ld E,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F6c0&lt;br /&gt;
 ld D,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld C,0 &lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F792&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld A,#40&lt;br /&gt;
 ld C,#4A&lt;br /&gt;
.loop&lt;br /&gt;
 ld B,D&lt;br /&gt;
 out (C),A&lt;br /&gt;
 ld B,E&lt;br /&gt;
 ini&lt;br /&gt;
 inc A&lt;br /&gt;
 cp C&lt;br /&gt;
 jr c,.loop&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C &lt;br /&gt;
 pop HL&lt;br /&gt;
 ret&lt;br /&gt;
&lt;br /&gt;
;check if there is a key is down at (HL);only the first key found is returned&lt;br /&gt;
;return carry is a key is down&lt;br /&gt;
;return key code in A : key code = (line*8)+bit&lt;br /&gt;
;returned code is the same than system&lt;br /&gt;
;altered : AF - BC&lt;br /&gt;
&lt;br /&gt;
GetPressed		&lt;br /&gt;
 push HL		&lt;br /&gt;
 ld C,10.loop_col		&lt;br /&gt;
 ld B,8		&lt;br /&gt;
 ld A,(HL++).loop_bit		&lt;br /&gt;
 rla		jr nc,.pressed		&lt;br /&gt;
 djnz .loop_bit				&lt;br /&gt;
 dec C		&lt;br /&gt;
 jr nz,.loop_col		&lt;br /&gt;
 or A ;no key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret&lt;br /&gt;
.pressed		&lt;br /&gt;
 dec C		&lt;br /&gt;
 ld A,9		&lt;br /&gt;
 sub C		&lt;br /&gt;
 add A	;*2		&lt;br /&gt;
 add A	;*4		&lt;br /&gt;
 add A	;*8		&lt;br /&gt;
 dec B		&lt;br /&gt;
 or B	;add bit		&lt;br /&gt;
 scf	;key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;check if a key is pressed&lt;br /&gt;
;A = key code		&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;return key state in carry&lt;br /&gt;
;altered AF - DE - B&lt;br /&gt;
&lt;br /&gt;
IsPressed	&lt;br /&gt;
 push HL	&lt;br /&gt;
 push AF ; keep bit	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld E,A	ld D,0&lt;br /&gt;
 add HL,DE&lt;br /&gt;
;so we get the address&lt;br /&gt;
pop AF&lt;br /&gt;
;now get the&lt;br /&gt;
 and 7&lt;br /&gt;
 inc A&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,(HL)&lt;br /&gt;
;get line&lt;br /&gt;
.loop&lt;br /&gt;
 rra ;get bit in carry&lt;br /&gt;
djnz .loop&lt;br /&gt;
 ccf	;reverse bit&lt;br /&gt;
 pop HL&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;compute offset and mask for a key&lt;br /&gt;
;A = key code&lt;br /&gt;
;return offset in C and mask in B&lt;br /&gt;
;altered AF - BC&lt;br /&gt;
&lt;br /&gt;
GetMask	&lt;br /&gt;
 ld B,A&lt;br /&gt;
;get offset	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld C,A &lt;br /&gt;
;get mask	&lt;br /&gt;
 ld A,B	&lt;br /&gt;
 and %00000111	&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,1	&lt;br /&gt;
 jr z,.done&lt;br /&gt;
.loop	&lt;br /&gt;
 add A	&lt;br /&gt;
 djnz .loop&lt;br /&gt;
.done	&lt;br /&gt;
 ld B,A	&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;erase SHIFT and CONTROL status&lt;br /&gt;
;used when that can be a problem , like with IsPressed&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;altered : AF&lt;br /&gt;
&lt;br /&gt;
IgnoreSHITFCTRL		&lt;br /&gt;
 push HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 ld A,(HL)	&lt;br /&gt;
 or %10100000	&lt;br /&gt;
 ld (HL),A	&lt;br /&gt;
 pop HL	&lt;br /&gt;
 ret				&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ENDMODULE&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Source_Codes&amp;diff=88896</id>
		<title>Source Codes</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Source_Codes&amp;diff=88896"/>
				<updated>2014-01-15T08:15:05Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Keyboard */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Programming]]&lt;br /&gt;
''This article contains source codes and programming examples. You may also have a look at''&lt;br /&gt;
* [[Programming software]]&lt;br /&gt;
* [[BIOS Functions]]&lt;br /&gt;
* [[Technical documentation]]s&lt;br /&gt;
* [[Locomotive BASIC]]&lt;br /&gt;
* [[Type Ins]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assembler ==&lt;br /&gt;
*[[Z80_-_undocumented_opcodes|Z80 - undocumented opcodes]]&lt;br /&gt;
*[[Where to learn?]]&lt;br /&gt;
&lt;br /&gt;
== Algorithms ==&lt;br /&gt;
*[[Programming:Bubble sort|Bubble sort]]&lt;br /&gt;
*[[Programming:CPC OS floating point routines|CPC OS floating point routines]]&lt;br /&gt;
*[[Programming:CRC16|CRC16]]&lt;br /&gt;
*[[Programming:CRC32|CRC32]]&lt;br /&gt;
*[[Programming:Integer Division|Integer Division]]&lt;br /&gt;
*[[Programming:Integer Multiplication|Integer Multiplication]]&lt;br /&gt;
*[[Programming:Logarithm|Logarithm]]&lt;br /&gt;
*[[Programming:Ultrafast Multiplication|Ultrafast Multiplication]] by [[Prodatron]]&lt;br /&gt;
*[[Programming:Fast Square Root|Fast Square Root]]&lt;br /&gt;
*[[Programming:Fast 16 bit Square Root|Fast 16 bit Square Root]] by [[User:Executioner|Executioner]]&lt;br /&gt;
*[[Programming:Filling memory with a byte|Filling memory with a byte]]&lt;br /&gt;
*[[Programming:Square Root|Square Root]]&lt;br /&gt;
*[[Programming:Precalculated square|Precalculated square]]&lt;br /&gt;
*[[Programming:Random Number Generator|Random Number Generator]]&lt;br /&gt;
*[[Programming:Reverse A|Reverse A]]&lt;br /&gt;
*[[Programming:Quicksort|Quicksort]]&lt;br /&gt;
*[[Programming:Sin/Cos calculation|Sin/Cos calculation]]&lt;br /&gt;
&lt;br /&gt;
== CP/M ==&lt;br /&gt;
*[[Programming:A simple 'Hello World' program for CP/M using BDOS|A simple 'Hello World' program for CP/M using BDOS]]&lt;br /&gt;
*[[Programming:A simple 'Hello World' program for CP/M using BIOS|A simple 'Hello World' program for CP/M using BIOS]]&lt;br /&gt;
*[[Programming:Executing firmware functions from within CP/M 2.1|Executing firmware functions from within CP/M 2.1]]&lt;br /&gt;
*[[Programming:Executing firmware functions from within CP/M 2.1 or CP/M plus|Executing firmware functions from within CP/M 2.1 or CP/M plus]]&lt;br /&gt;
*[[Programming:Executing firmware functions from within CP/M 2.1|Executing firmware functions from within CP/M 2.1]]&lt;br /&gt;
*[[Programming:Executing firmware functions from within CP/M plus|Executing firmware functions from within CP/M plus]]&lt;br /&gt;
&lt;br /&gt;
== CPC Plus ==&lt;br /&gt;
*[[Amstrad CPC plus sprite format]]&lt;br /&gt;
*[[Programming:Convert CPC sprites to Plus hardware sprites|Convert CPC sprites to Plus hardware sprites]]&lt;br /&gt;
*[[Sprites Multiplexing]]&lt;br /&gt;
*[[Programming:CPC Plus Hardware Sprites|Hardware sprites]]&lt;br /&gt;
*[[Programming:CPC Plus Horizontal scroll|Horizontal scroll]]&lt;br /&gt;
*[[Programming:CPC Plus RLE Hardware Sprites|RLE hardware sprites]]&lt;br /&gt;
*[[Programming:CPC Plus Screen Splitting|Screen splitting]]&lt;br /&gt;
*[[Programming:CPC Plus Vertical scroll|Vertical scroll]]&lt;br /&gt;
*[[Operation of Z80 interrupt mode 0 in the CPC plus design]]&lt;br /&gt;
*[[Programming:Simple Raster Example 2 (uses CPC plus features)|Simple Raster Example 1 (uses CPC plus features)]]&lt;br /&gt;
*[[Programming:Simple Raster Example 3 (uses CPC plus features)|Simple Raster Example 2 (uses CPC plus features)]]&lt;br /&gt;
*[[Programming:Unlocking ASIC|Unlocking ASIC]]&lt;br /&gt;
&lt;br /&gt;
== Devices ==&lt;br /&gt;
*[[Programming:CPC Booster|CPC Booster]]&lt;br /&gt;
*[[Programming:Digiblaster|Digiblaster]]&lt;br /&gt;
*[[Programming:Program to save the ROM of the Multiface 2|Program to save the ROM of the Multiface 2]]&lt;br /&gt;
*[[Programming:SYMBiFACE II|SYMBiFACE II]]&lt;br /&gt;
&lt;br /&gt;
== File access ==&lt;br /&gt;
*[[Programming:An example to read a file byte-by-byte|An example to read a file byte-by-byte]]&lt;br /&gt;
*[[Programming:An example to write a file byte-by-byte|An example to write a file byte-by-byte]]&lt;br /&gt;
*[[Programming:A simple file copier using firmware functions (copies byte-by-byte)|A simple file copier using firmware functions (copies byte-by-byte)]]&lt;br /&gt;
*[[Programming:Loading a file|Loading a file]]&lt;br /&gt;
*[[Programming:Saving a file|Saving a file]]&lt;br /&gt;
*[[Programming:Unlocking a protected basic file|Unlocking a protected basic file]]&lt;br /&gt;
*[[Programming:Undo delete of file|Undo delete of file]]&lt;br /&gt;
&lt;br /&gt;
== Floppy disk ==&lt;br /&gt;
*[[Programming:A simple disc copier using BDOS functions|A simple disc copier using BDOS functions]]&lt;br /&gt;
*[[Programming:A simple disc formatter using BDOS functions|A simple disc formatter using BDOS functions]]&lt;br /&gt;
*[[Programming:An example loader|An example loader]]&lt;br /&gt;
*[[Programming:Catalog a disc and retrieve a directory|Catalog a disc and retrieve a directory]]&lt;br /&gt;
*[[Programming:Detecting an Amstrad or Vortex disc controler|Detecting an Amstrad or Vortex disc controler]]&lt;br /&gt;
*[[Programming:Formatting a track on a disc|Formatting a track on a disc]]&lt;br /&gt;
*[[Programming:Reading a sector from a disc|Reading a sector from a disc]]&lt;br /&gt;
*[[Programming:Reading and writing the boot sector of a SYSTEM/VENDOR disc|Reading and writing the boot sector of a SYSTEM/VENDOR disc]]&lt;br /&gt;
*[[Programming:Writing a sector to disc|Writing a sector to disc]]&lt;br /&gt;
&lt;br /&gt;
== Graphics ==&lt;br /&gt;
*[[Programming:Display a 8-bit number in binary|Display a 8-bit number in binary]]&lt;br /&gt;
*[[Programming:Display a 8-bit number in hex|Display a 8-bit number in hex]]&lt;br /&gt;
*[[Programming:Display a byte as a 3-digit decimal number|Display a byte as a 3-digit decimal number]]&lt;br /&gt;
*[[Programming:Display and update Scores|Display and update Scores]]&lt;br /&gt;
*[[Programming:Distorting the screen using register 2 of the CRTC (Horizontal Sync Position)|Distorting the screen using register 2 of the CRTC (Horizontal Sync Position)]]&lt;br /&gt;
*[[Programming:Fast plot|Fast plot]]&lt;br /&gt;
*[[Programming:Fast Sprites|Fast Sprites]] by [[User:Executioner|Executioner]]&lt;br /&gt;
*[[Programming:Fast Textoutput|Fast Textoutput]] by [[Prodatron]]&lt;br /&gt;
*[[Programming:Hardware scrolling|Hardware Scrolling]] by [[User:Executioner|Executioner]]&lt;br /&gt;
*[[Programming:Hardware scrolling 2|Hardware Scrolling 2]]&lt;br /&gt;
*[[Programming:Hardware scrolling the screen horizontally byte-by-byte using the CRTC|Hardware scrolling the screen horizontally byte-by-byte using the CRTC]]&lt;br /&gt;
*[[Programming:Hardware scrolling the screen using the CRTC|Hardware scrolling the screen using the CRTC]]&lt;br /&gt;
*[[Programming:Next / previous line calculation|Next / previous line calculation]]&lt;br /&gt;
*[[Programming:Overscan|Overscan]]&lt;br /&gt;
*[[Programming:Plotting a sprite using character matrices|Plotting a sprite using character matrices]]&lt;br /&gt;
*[[Mode 4 (two bitplane emulation)| 4th Mode of CPCs: Plotting sprites on 2 bitplanes]]&lt;br /&gt;
*[[Screen refresh rate|Set the screen refresh rate]]&lt;br /&gt;
*[[Programming:Simple Raster Example 1|Simple Raster Example]]&lt;br /&gt;
*[[Programming:Simple Split Raster Example 1|Simple Split Raster Example]]&lt;br /&gt;
*[[Synchronising with the CRTC and display]]&lt;br /&gt;
*[[CRTC change colour (fill) test with precise timing]] by [[User:Matahari|Matahari]]&lt;br /&gt;
*[[256 byte Overscan MEGATEXT Intro - (features 50Hz fullscreen scroll)]] by [[User:Matahari|Matahari]]&lt;br /&gt;
&lt;br /&gt;
== Interrupts ==&lt;br /&gt;
* [[Reliable use of interrupt mode 2 on the CPC]]&lt;br /&gt;
&lt;br /&gt;
== Keyboard ==&lt;br /&gt;
*[[Programming:Keyboard scanning|Keyboard scanning]]&lt;br /&gt;
*[[Programming:Keyboard_redefinition|Keyboard redefinition]]&lt;br /&gt;
&lt;br /&gt;
== Other routines ==&lt;br /&gt;
*[[Programming:An example boot sector (executed with rsx command CPM)|An example boot sector (executed with rsx command CPM)]]&lt;br /&gt;
*[[Programming:An example to define a RSX|An example to define a RSX]]&lt;br /&gt;
*[[Programming:Calling a RSX from outside of BASIC|Calling a RSX from outside of BASIC]]&lt;br /&gt;
*[[Programming:Dumping the data of BASIC or AMSDOS or an expansion rom|Dumping the data of BASIC or AMSDOS or an expansion rom]]&lt;br /&gt;
*[[Programming:Dumping the data of the lower rom|Dumping the data of the lower rom]]&lt;br /&gt;
&lt;br /&gt;
== Sound ==&lt;br /&gt;
*[[How to access the PSG via PPI]]&lt;br /&gt;
*[[Programming:Tutorial - Understanding the fundamentals of BASIC SOUND and the Firmware SOUND QUEUE|Tutorial - Understanding the fundamentals of BASIC SOUND and the Firmware SOUND QUEUE]]&lt;br /&gt;
*[[Programming:Source code to show 0x0ff is always returned when reading PSG port B|Source code to show 0x0ff is always returned when reading PSG port B]]&lt;br /&gt;
*[[Programming:Source code to show it is possible to store data in PSG register 14 and 15 (port A and port B)|Source code to show it is possible to store data in PSG register 14 and 15 (port A and port B)]]&lt;br /&gt;
*[[Programming:Source code to show it is possible to store data in PSG register 14 and 15 even if the port has been set to input|Source code to show it is possible to store data in PSG register 14 and 15 even if the port has been set to input]]&lt;br /&gt;
*[[Programming:Source code to show that some registers always return 0 in some bits|Source code to show that some registers always return 0 in some bits]]&lt;br /&gt;
*[[Programming:Source code to show that when a port is read in output mode; the data read will be ANDed with the inputs to that port|Source code to show that when a port is read in output mode; the data read will be ANDed with the inputs to that port]]&lt;br /&gt;
&lt;br /&gt;
== Cross Development ==&lt;br /&gt;
*[[Programming:Cross Development|Cross Development]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Source code]]&lt;br /&gt;
&lt;br /&gt;
== General Notes ==&lt;br /&gt;
&lt;br /&gt;
* Memory range for programs is &amp;amp;0040-&amp;amp;a700. This avoids firmware and memory allocated by AMSDOS disc ROM.&lt;br /&gt;
This is safe for the purpose of loading and being compatible with the firmware.&lt;br /&gt;
After loading, if you disable the firmware, you can re-use the firmware areas as you want, but you need to do everything yourself (scanning keyboard, drawing, sound etc).If you need to use these areas, a common thing to do is to load most into the safe area, some into the screen, and relocate it after loading.&lt;br /&gt;
* Programs on cassette and disc have a header that define the load address, length and execution address.&lt;br /&gt;
&lt;br /&gt;
In Pasmo assembler use the &amp;quot;end&amp;quot; mnemonic to define the label which is the execution address and use &amp;quot;--amsdos&amp;quot; to put an AMSDOS header on it.&lt;br /&gt;
&lt;br /&gt;
* Basic programs start at &amp;amp;170.&lt;br /&gt;
* Firmware uses interrupt mode 1 of the Z80 (interrupts jump to &amp;amp;0038)&lt;br /&gt;
* Lowest place you can LOAD a binary file to with BASIC is &amp;amp;389 e.g.:&lt;br /&gt;
&lt;br /&gt;
 openout&amp;quot;d&amp;quot;&lt;br /&gt;
 memory &amp;lt;address&amp;gt;-1&lt;br /&gt;
 closeout&lt;br /&gt;
 load &amp;quot;code&amp;quot;,&amp;lt;address&amp;gt;&lt;br /&gt;
 call &amp;lt;exec&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Screen is normally at &amp;amp;c000-&amp;amp;ffff. (It can be changed using firmware, or using CRTC R12/R13)&lt;br /&gt;
*Stack is normally at &amp;amp;c000 and goes down.&lt;br /&gt;
*Extra registers (BC', AF', HL', DE' are reserved by the firmware). Avoid if you are using firmware functions.&lt;br /&gt;
*Lower rom (containing OS) can be paged into memory between &amp;amp;0000-&amp;amp;3fff.&lt;br /&gt;
*Upper rom is selectable, examples are BASIC and AMSDOS. They can be paged into memory between &amp;amp;c000-&amp;amp;ffff.&lt;br /&gt;
*From basic, a game is run with:&lt;br /&gt;
&lt;br /&gt;
 RUN&amp;quot;&amp;lt;filename&amp;gt;&lt;br /&gt;
&lt;br /&gt;
keep it in the safe memory ranges and it'll run from cassette and disc.&lt;br /&gt;
*Screen is normally 40 crtc chars wide (CRTC R1=40), 25 crtc chars tall (CRTC R6=25). 8 scan lines per char (R9=7). Firmware functions assume this.&lt;br /&gt;
*Screen is bitmapped. You must draw/erase your own sprites and text.&lt;br /&gt;
*Firmware refreshes the palette every 50th of a second, so you need to turn off the firmware and use the hardware directly, or set the colours using firmware.&lt;br /&gt;
*Firmware can be &amp;quot;turned off&amp;quot;, by disabling lower ROM, redirecting interrupts and not calling firmware functions.&lt;br /&gt;
*Screen can be resized the same as the Spectrum. Provided you do not use hardware scrolling, this gives you extra space although because of the layout of the screen, it's not continuous, it's in 8 seperate blocks, but it's enough to store data and code.&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88895</id>
		<title>Programming:Keyboard redefinition</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_redefinition&amp;diff=88895"/>
				<updated>2014-01-15T08:14:14Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: Created page with &amp;quot;&amp;lt;pre&amp;gt; ;simple keyboard module ;no extra functions , just scan and locate a key ;no char buffer , no antibounce, ect... ;SJASM syntax  MODULE key 		 ;do a complete key scan and...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
;simple keyboard module&lt;br /&gt;
;no extra functions , just scan and locate a key&lt;br /&gt;
;no char buffer , no antibounce, ect...&lt;br /&gt;
;SJASM syntax&lt;br /&gt;
&lt;br /&gt;
MODULE key&lt;br /&gt;
		&lt;br /&gt;
;do a complete key scan and store it at (HL)&lt;br /&gt;
;altered : AF - BC - DE&lt;br /&gt;
&lt;br /&gt;
Scan&lt;br /&gt;
 push HL&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F40e&lt;br /&gt;
 ld E,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F6c0&lt;br /&gt;
 ld D,B&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld C,0 &lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld BC,#F792&lt;br /&gt;
 out (C),C&lt;br /&gt;
 ld A,#40&lt;br /&gt;
 ld C,#4A&lt;br /&gt;
.loop&lt;br /&gt;
 ld B,D&lt;br /&gt;
 out (C),A&lt;br /&gt;
 ld B,E&lt;br /&gt;
 ini&lt;br /&gt;
 inc A&lt;br /&gt;
 cp C&lt;br /&gt;
 jr c,.loop&lt;br /&gt;
 ld BC,#F782&lt;br /&gt;
 out (C),C &lt;br /&gt;
 pop HL&lt;br /&gt;
 ret&lt;br /&gt;
&lt;br /&gt;
;check if there is a key is down at (HL);only the first key found is returned&lt;br /&gt;
;return carry is a key is down&lt;br /&gt;
;return key code in A : key code = (line*8)+bit&lt;br /&gt;
;returned code is the same than system&lt;br /&gt;
;altered : AF - BC&lt;br /&gt;
&lt;br /&gt;
GetPressed		&lt;br /&gt;
 push HL		&lt;br /&gt;
 ld C,10.loop_col		&lt;br /&gt;
 ld B,8		&lt;br /&gt;
 ld A,(HL++).loop_bit		&lt;br /&gt;
 rla		jr nc,.pressed		&lt;br /&gt;
 djnz .loop_bit				&lt;br /&gt;
 dec C		&lt;br /&gt;
 jr nz,.loop_col		&lt;br /&gt;
 or A ;no key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret&lt;br /&gt;
.pressed		&lt;br /&gt;
 dec C		&lt;br /&gt;
 ld A,9		&lt;br /&gt;
 sub C		&lt;br /&gt;
 add A	;*2		&lt;br /&gt;
 add A	;*4		&lt;br /&gt;
 add A	;*8		&lt;br /&gt;
 dec B		&lt;br /&gt;
 or B	;add bit		&lt;br /&gt;
 scf	;key found !		&lt;br /&gt;
 pop HL		&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;check if a key is pressed&lt;br /&gt;
;A = key code		&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;return key state in carry&lt;br /&gt;
;altered AF - DE - B&lt;br /&gt;
&lt;br /&gt;
IsPressed	&lt;br /&gt;
 push HL	&lt;br /&gt;
 push AF ; keep bit	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld E,A	ld D,0&lt;br /&gt;
 add HL,DE&lt;br /&gt;
;so we get the address&lt;br /&gt;
pop AF&lt;br /&gt;
;now get the&lt;br /&gt;
 and 7&lt;br /&gt;
 inc A&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,(HL)&lt;br /&gt;
;get line&lt;br /&gt;
.loop&lt;br /&gt;
 rra ;get bit in carry&lt;br /&gt;
djnz .loop&lt;br /&gt;
 ccf	;reverse bit&lt;br /&gt;
 pop HL&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
;compute offset and mask for a key&lt;br /&gt;
;A = key code&lt;br /&gt;
;return offset in C and mask in B&lt;br /&gt;
;altered AF - BC&lt;br /&gt;
&lt;br /&gt;
GetMask	&lt;br /&gt;
 ld B,A&lt;br /&gt;
;get offset	&lt;br /&gt;
 and %01111000	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 rrca	&lt;br /&gt;
 ld C,A &lt;br /&gt;
;get mask	&lt;br /&gt;
 ld A,B	&lt;br /&gt;
 and %00000111	&lt;br /&gt;
 ld B,A&lt;br /&gt;
 ld A,1	&lt;br /&gt;
 jr z,.done&lt;br /&gt;
.loop	&lt;br /&gt;
 add A	&lt;br /&gt;
 djnz .loop&lt;br /&gt;
.done	&lt;br /&gt;
 ld B,A	&lt;br /&gt;
 ret	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;erase SHIFT and CONTROL status&lt;br /&gt;
;used when that can be a problem , like with IsPressed&lt;br /&gt;
;HL = 10 byte array scanned with Scan function&lt;br /&gt;
;altered : AF&lt;br /&gt;
&lt;br /&gt;
IgnoreSHITFCTRL		&lt;br /&gt;
 push HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 inc HL	&lt;br /&gt;
 ld A,(HL)	&lt;br /&gt;
 or %10100000	&lt;br /&gt;
 ld (HL),A	&lt;br /&gt;
 pop HL	&lt;br /&gt;
 ret				&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ENDMODULE&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_main_fr&amp;diff=87555</id>
		<title>CTC-AY SDK main fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_main_fr&amp;diff=87555"/>
				<updated>2013-07-12T05:43:15Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Outils */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&amp;lt;big&amp;gt;'''Documentation du System Development Kit pour le CTC-AY'''&amp;lt;/big&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Attention : Cette page est en construction actuellement, les spécifications pouvant être changées à tout moment.&lt;br /&gt;
&lt;br /&gt;
Warning: this page is under construction so it is only avaible actually for french language (english translation will follow).&lt;br /&gt;
&lt;br /&gt;
===Avant propos===&lt;br /&gt;
&lt;br /&gt;
Le SDK du CTC-AY a pour but de faciliter le développement de produits pour le CTC-AY, principalement sous forme de cartouches totalement autonomes du fimware d'origine du CPC. Il se constitue d'outils et de bibliothèques de fonctions écrites en assembleur. Les bibliothèques visent à prendre en charge le matériel d'origine du CPC et celui du CTC-AY.&lt;br /&gt;
Ce SDK est orienté cross développement via un PC. Les outils PC sont disponibles et testés sous Windows XP et Windows 7 mais devraient fonctionner sans difficulté sous Windows 95/98.&lt;br /&gt;
Les bibliothèques sont au format source de Sjasm qui est l'assembleur choisi pour ce SDK. Moyennant une adaptation de la syntaxe, il est possible de les utiliser avec un autre cross assembleur.&lt;br /&gt;
&lt;br /&gt;
===Prise en charge de la CPC Booster+===&lt;br /&gt;
&lt;br /&gt;
Certains outils nécessitent l'extension CPC Booster+. Elle est même fortement recommandée pour transférer les données dans la cartouche sans avoir recours à d'autres supports. De plus, le BIOS fourni dans les cartouches intègre un moniteur permettant de tracer l'exécution d'un programme via la CPC Booster+.&lt;br /&gt;
La configuration des modules BlueTooth est également prise en charge de manière automatique pour les firmware LINVOR(HC06) et une console permettant une configuration manuelle est disponible pour les autres firmwares (HC05).&lt;br /&gt;
&lt;br /&gt;
===Outils===&lt;br /&gt;
&lt;br /&gt;
* BIOS&lt;br /&gt;
* Utilitaire de transfert CPC Booster+&lt;br /&gt;
* Configuration automatique BlueTooth (modules Linvor)&lt;br /&gt;
* Console de configuration manuelle BlueTooth (autre modules)&lt;br /&gt;
* Moniteur NMI&lt;br /&gt;
&lt;br /&gt;
===Bibliothèques===&lt;br /&gt;
&lt;br /&gt;
*[[CTC-AY_SDK_libCTC_fr|CTC]] (ctc.asm) &lt;br /&gt;
*CPC Booster+ (booster.asm)&lt;br /&gt;
*Couleurs (color.asm)&lt;br /&gt;
*Strings (string.asm)&lt;br /&gt;
*Clavier (keyboard_simple.asm , keyboard_advanced.asm)&lt;br /&gt;
&lt;br /&gt;
===Programmes d'exemple===&lt;br /&gt;
&lt;br /&gt;
*Redéfinition de touches (redef_key.asm)&lt;br /&gt;
*Prise en charge avancée du clavier Scancodes/SHIFT/CONTROL/CAPSLOCK (key_advanced.asm)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87552</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87552"/>
				<updated>2013-07-11T16:37:09Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliothèque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
*string chaîne de caractères&lt;br /&gt;
&lt;br /&gt;
===Description brève du CTC===&lt;br /&gt;
&lt;br /&gt;
Le CTC est composé de 4 canaux possédant chacun 1 compteur interne et 1 registre contenant une constante. Chaque canal est configurable en mode 'counter' ou en mode 'timer'.&lt;br /&gt;
&lt;br /&gt;
En mode counter , le compteur interne est décrémenté à chaque signal sur sa ligne d'entrée. Quand ce compteur atteint zéro , un signal est envoyé sur sa ligne de sortie et une interruption est déclenchée si l'utilisateur l'a configurée. Le compteur interne est rechargé avec la constante et le décompte reprend.&lt;br /&gt;
&lt;br /&gt;
En mode timer , le compteur interne est décrémenté toutes les 64 ou 256 impulsions d'horloge selon la configuration soit 16 ou 64µs pour une fréquence de 4Mhz. Quand ce compteur atteint zéro , un signal est envoyé sur sa ligne de sortie et une interruption est déclenchée si l'utilisateur l'a configurée. Le compteur interne est rechargé avec la constante et le décompte reprend.&lt;br /&gt;
&lt;br /&gt;
Pour plus d'informations sur le fonctionnement exact du CTC , se référer à la documentation Zilog :[[File:Z80ctc.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Connexions des lignes du CTC sur le CTC-AY===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Canal || signal en entrée || signal en sortie || utilisation typique&lt;br /&gt;
|-&lt;br /&gt;
| 0 || horloge 4Mhz || YMZ || fréquence des YMZ&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CRTC cursor || Z80 NMI || NMI localisé&lt;br /&gt;
|-&lt;br /&gt;
| 2 || horloge 4Mhz || canal 3 || compteur 8/16bits&lt;br /&gt;
|-&lt;br /&gt;
| 3 || canal 2 || sans sortie || compteur 8/16bits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
Valeurs définies :&lt;br /&gt;
*CTC.freq_CPC&lt;br /&gt;
*CTC.freq_ZX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartNMI'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre le canal 1 pour déclencher une interruption NMI à l'adresse CRTC indiquée.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI&lt;br /&gt;
Sans paramètre , le CTC est configuré pour produire l'interruption non masquable à l'adresse indiquée par les registres 14 et 15 du CRTC. Les registres de début et de fin de curseur (registres 10 et 11 du CRTC) doivent être correctement configurés avant l'usage de CTC_StartNMI.&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI d/r/(rr)/(ii),d/r/(rr)/(ii)&lt;br /&gt;
Le premier paramètre correspond à la partie haute de l'adresse CRTC à laquelle l'interruption non masquable doit se produire , la deuxième à la partie basse. Les paramètres peuvent être une valeur immédiate, un registre 8 bits (D,E,H,L) ou une référence à un registre 16bits ou d'index. La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartNMI (DE++),(DE)&lt;br /&gt;
&lt;br /&gt;
*CTC_StarNMI dd&lt;br /&gt;
Le paramètre correspond à l'adresse CRTC 16bits complète.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_CreateIntTable'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Crée une table de vecteurs et crée une fonction d'initialisation pour cette table en mode IM2. Néanmoins cette fonction ne change ni l'état des interruptions , ni le mode de gestion des interruptions du Z80. C'est à la charge de l'utilisateur de la bibliothèque d'exécuter les instructions &amp;quot;EI&amp;quot; et &amp;quot;IM2&amp;quot; ensuite.&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_CreateIntTable string,b,bb,bb,bb,bb&lt;br /&gt;
Le premier paramètre est le nom qui sera donné à la table crée.Deux étiquettes sont crées lors du processus, nom_de_la_table.table est l'adresse de la table elle même , nom_de_la_table.set est la fonction qui configure le Z80 et le CTC pour utiliser cette table.&lt;br /&gt;
&lt;br /&gt;
Le deuxième paramètre est la partie haute de l'adresse de la table sachant que celle ci s'étend de (partie_haute*256)-10.La mémoire sera remplie de la valeur 0 entre l'adresse d'assemblage actuelle et l'adresse de la table.&lt;br /&gt;
&lt;br /&gt;
Les quatre derniers paramètres correspondent respectivement aux vecteurs d'interruption des canaux 0,1,2 et 3 du CTC et à celui du Gate Array.&lt;br /&gt;
&lt;br /&gt;
Example : CTC_CreateIntTable matable,#10,#1000,#2000,#3000,#4000,#5000&lt;br /&gt;
&lt;br /&gt;
Crée deux étiquettes nommées &amp;quot;matable.table&amp;quot; et &amp;quot;matable.set&amp;quot;.A l'adresse #00F6 se trouve la table qui se décompose de la façon suivante :&lt;br /&gt;
&lt;br /&gt;
*0x00F6:0x00 - Adresse basse du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F7:0x10 - Adresse haute du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F8:0x00 - Adresse basse du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00F9:0x20 - Adresse haute du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00FA:0x00 - Adresse basse du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FB:0x30 - Adresse haute du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FC:0x00 - Adresse basse du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FD:0x40 - Adresse haute du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FE:0x00 - Octet d'alignement &lt;br /&gt;
&lt;br /&gt;
*0x00FF:0x00 - Adresse basse du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
*0x0100:0x50 - Adresse haute du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartTimer16'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un compteur 16bits en utilisant des canaux 2 et 3 du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartTimer16 dd,d&lt;br /&gt;
Le premier paramètre indique la constante à charger dans le compteur interne des canaux 2 (partie haute) et 3 (partie basse) du CTC. La valeur 0 dans la partie haut ou basse correspond à 256 (0x100) pour la partie correspondante. Le temps écoulé en fonction de ce paramètre est le suivant : (partie_haute(dd)-1)*(partie_basse(dd)-1)*64µs&lt;br /&gt;
&lt;br /&gt;
Le second paramètre est un drapeau qui indique si une interruption doit être générée quand le compteur interne du canal 3 arrive à zéro. Les valeurs acceptées sont :&lt;br /&gt;
&lt;br /&gt;
*CTC.int : une interruption est générée quand le compteur interne du canal 3 est à zéro&lt;br /&gt;
*CTC_noint : aucune interruption générée&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87551</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87551"/>
				<updated>2013-07-11T16:36:05Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliothèque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
*string chaîne de caractères&lt;br /&gt;
&lt;br /&gt;
===Description brève du CTC===&lt;br /&gt;
&lt;br /&gt;
Le CTC est composé de 4 canaux possédant chacun 1 compteur interne et 1 registre contenant une constante. Chaque canal est configurable en mode 'counter' ou en mode 'timer'.&lt;br /&gt;
&lt;br /&gt;
En mode counter , le compteur interne est décrémenté à chaque signal sur sa ligne d'entrée. Quand ce compteur atteint zéro , un signal est envoyé sur sa ligne de sortie et une interruption est déclenchée si l'utilisateur l'a configurée. Le compteur interne est rechargé avec la constante et le décompte reprend.&lt;br /&gt;
&lt;br /&gt;
En mode timer , le compteur interne est décrémenté toutes les 64 ou 256 impulsions d'horloge selon la configuration soit 16 ou 64µs pour une fréquence de 4Mhz. Quand ce compteur atteint zéro , un signal est envoyé sur sa ligne de sortie et une interruption est déclenchée si l'utilisateur l'a configurée. Le compteur interne est rechargé avec la constante et le décompte reprend.&lt;br /&gt;
&lt;br /&gt;
Pour plus d'informations sur le fonctionnement exact du CTC , se référer à la documentation Zilog :[[File:Z80ctc.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Connexions des lignes du CTC sur le CTC-AY===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Canal || signal en entrée || signal en sortie || utilisation typique&lt;br /&gt;
|-&lt;br /&gt;
| 0 || horloge 4Mhz || YMZ || fréquence des YMZ&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CRTC cursor || Z80 NMI || NMI localisé&lt;br /&gt;
|-&lt;br /&gt;
| 2 || horloge 4Mhz || canal 3 || compteur 8/16bits&lt;br /&gt;
|-&lt;br /&gt;
| 3 || canal 2 || sans sortie || compteur 8/16bits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
Valeurs définies :&lt;br /&gt;
*CTC.freq_CPC&lt;br /&gt;
*CTC.freq_ZX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartNMI'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre le canal 1 pour déclencher une interruption NMI à l'adresse CRTC indiquée.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI&lt;br /&gt;
Sans paramètre , le CTC est configuré pour produire l'interruption non masquable à l'adresse indiquée par les registres 14 et 15 du CRTC. Les registres de début et de fin de curseur (registres 10 et 11 du CRTC) doivent être correctement configurés avant l'usage de CTC_StartNMI.&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI d/r/(rr)/(ii),d/r/(rr)/(ii)&lt;br /&gt;
Le premier paramètre correspond à la partie haute de l'adresse CRTC à laquelle l'interruption non masquable doit se produire , la deuxième à la partie basse. Les paramètres peuvent être une valeur immédiate, un registre 8 bits (D,E,H,L) ou une référence à un registre 16bits ou d'index. La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartNMI (DE++),(DE)&lt;br /&gt;
&lt;br /&gt;
*CTC_StarNMI dd&lt;br /&gt;
Le paramètre correspond à l'adresse CRTC 16bits complète.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_CreateIntTable'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Crée une table de vecteurs et crée une fonction d'initialisation pour cette table en mode IM2. Néanmoins cette fonction ne change ni l'état des interruptions , ni le mode de gestion des interruptions du Z80. C'est à la charge de l'utilisateur de la bibliothèque d'exécuter les instructions &amp;quot;EI&amp;quot; et &amp;quot;IM2&amp;quot; ensuite.&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_CreateIntTable string,b,bb,bb,bb,bb&lt;br /&gt;
Le premier paramètre est le nom qui sera donné à la table crée.Deux étiquettes sont crées lors du processus, nom_de_la_table.table est l'adresse de la table elle même , nom_de_la_table.set est la fonction qui configure le Z80 et le CTC pour utiliser cette table.&lt;br /&gt;
&lt;br /&gt;
Le deuxième paramètre est la partie haute de l'adresse de la table sachant que celle ci s'étend de (partie_haute*256)-10.La mémoire sera remplie de la valeur 0 entre l'adresse d'assemblage actuelle et l'adresse de la table.&lt;br /&gt;
&lt;br /&gt;
Les quatre derniers paramètres correspondent respectivement aux vecteurs d'interruption des canaux 0,1,2 et 3 du CTC et à celui du Gate Array.&lt;br /&gt;
&lt;br /&gt;
Example : CTC matable,#10,#1000,#2000,#3000,#4000,#5000&lt;br /&gt;
&lt;br /&gt;
Crée deux étiquettes nommées &amp;quot;matable.table&amp;quot; et &amp;quot;matable.set&amp;quot;.A l'adresse #00F6 se trouve la table qui se décompose de la façon suivante :&lt;br /&gt;
&lt;br /&gt;
*0x00F6:0x00 - Adresse basse du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F7:0x10 - Adresse haute du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F8:0x00 - Adresse basse du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00F9:0x20 - Adresse haute du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00FA:0x00 - Adresse basse du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FB:0x30 - Adresse haute du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FC:0x00 - Adresse basse du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FD:0x40 - Adresse haute du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FE:0x00 - Octet d'alignement &lt;br /&gt;
&lt;br /&gt;
*0x00FF:0x00 - Adresse basse du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
*0x0100:0x50 - Adresse haute du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartTimer16'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un compteur 16bits en utilisant des canaux 2 et 3 du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartTimer16 dd,d&lt;br /&gt;
Le premier paramètre indique la constante à charger dans le compteur interne des canaux 2 (partie haute) et 3 (partie basse) du CTC. La valeur 0 dans la partie haut ou basse correspond à 256 (0x100) pour la partie correspondante. Le temps écoulé en fonction de ce paramètre est le suivant : (partie_haute(dd)-1)*(partie_basse(dd)-1)*64µs&lt;br /&gt;
&lt;br /&gt;
Le second paramètre est un drapeau qui indique si une interruption doit être générée quand le compteur interne du canal 3 arrive à zéro. Les valeurs acceptées sont :&lt;br /&gt;
&lt;br /&gt;
*CTC.int : une interruption est générée quand le compteur interne du canal 3 est à zéro&lt;br /&gt;
*CTC_noint : aucune interruption générée&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87550</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87550"/>
				<updated>2013-07-11T13:32:45Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Description brève du CTC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliothèque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
*string chaîne de caractères&lt;br /&gt;
&lt;br /&gt;
===Description brève du CTC===&lt;br /&gt;
&lt;br /&gt;
Le CTC est composé de 4 canaux possédant chacun 1 compteur interne et 1 registre contenant une constante. Chaque canal est configurable en mode 'counter' ou en mode 'timer'.&lt;br /&gt;
&lt;br /&gt;
En mode counter , le compteur interne est décrémenté à chaque signal sur sa ligne d'entrée. Quand ce compteur atteint zéro , un signal est envoyé sur sa ligne de sortie et une interruption est déclenchée si l'utilisateur l'a configurée. Le compteur interne est rechargé avec la constante et le décompte reprend.&lt;br /&gt;
&lt;br /&gt;
En mode timer , le compteur interne est décrémenté toutes les 64 ou 256 impulsions d'horloge selon la configuration soit 16 ou 64µs pour une fréquence de 4Mhz. Quand ce compteur atteint zéro , un signal est envoyé sur sa ligne de sortie et une interruption est déclenchée si l'utilisateur l'a configurée. Le compteur interne est rechargé avec la constante et le décompte reprend.&lt;br /&gt;
&lt;br /&gt;
Pour plus d'informations sur le fonctionnement exact du CTC , se référer à la documentation Zilog :[[File:Z80ctc.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Connexions des lignes du CTC sur le CTC-AY===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Canal || signal en entrée || signal en sortie || utilisation typique&lt;br /&gt;
|-&lt;br /&gt;
| 0 || horloge 4Mhz || YMZ || fréquence des YMZ&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CRTC cursor || Z80 NMI || NMI localisé&lt;br /&gt;
|-&lt;br /&gt;
| 2 || horloge 4Mhz || canal 3 || compteur 8/16bits&lt;br /&gt;
|-&lt;br /&gt;
| 3 || canal 2 || sans sortie || compteur 8/16bits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
Valeurs définies :&lt;br /&gt;
*CTC.freq_CPC&lt;br /&gt;
*CTC.freq_ZX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartNMI'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre le canal 1 pour déclencher une interruption NMI à l'adresse CRTC indiquée.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI&lt;br /&gt;
Sans paramètre , le CTC est configuré pour produire l'interruption non masquable à l'adresse indiquée par les registres 14 et 15 du CRTC. Les registres de début et de fin de curseur (registres 10 et 11 du CRTC) doivent être correctement configurés avant l'usage de CTC_StartNMI.&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI d/r/(rr)/(ii),d/r/(rr)/(ii)&lt;br /&gt;
Le premier paramètre correspond à la partie haute de l'adresse CRTC à laquelle l'interruption non masquable doit se produire , la deuxième à la partie basse. Les paramètres peuvent être une valeur immédiate, un registre 8 bits (D,E,H,L) ou une référence à un registre 16bits ou d'index. La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartNMI (DE++),(DE)&lt;br /&gt;
&lt;br /&gt;
*CTC_StarNMI dd&lt;br /&gt;
Le paramètre correspond à l'adresse CRTC 16bits complète.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
***CTC_CreateIntTable***&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Crée une table de vecteurs et crée une fonction d'initialisation pour cette table en mode IM2. Néanmoins cette fonction ne change ni l'état des interruptions , ni le mode de gestion des interruptions du Z80. C'est à la charge de l'utilisateur de la bibliothèque d'exécuter les instructions &amp;quot;EI&amp;quot; et &amp;quot;IM2&amp;quot; ensuite.&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_CreateIntTable string,b,bb,bb,bb,bb&lt;br /&gt;
Le premier paramètre est le nom qui sera donné à la table crée.Deux étiquettes sont crées lors du processus, nom_de_la_table.table est l'adresse de la table elle même , nom_de_la_table.set est la fonction qui configure le Z80 et le CTC pour utiliser cette table.&lt;br /&gt;
&lt;br /&gt;
Le deuxième paramètre est la partie haute de l'adresse de la table sachant que celle ci s'étend de (partie_haute*256)-10.La mémoire sera remplie de la valeur 0 entre l'adresse d'assemblage actuelle et l'adresse de la table.&lt;br /&gt;
&lt;br /&gt;
Les quatre derniers paramètres correspondent respectivement aux vecteurs d'interruption des canaux 0,1,2 et 3 du CTC et à celui du Gate Array.&lt;br /&gt;
&lt;br /&gt;
Example : CTC matable,#10,#1000,#2000,#3000,#4000,#5000&lt;br /&gt;
&lt;br /&gt;
Crée deux étiquettes nommées &amp;quot;matable.table&amp;quot; et &amp;quot;matable.set&amp;quot;.A l'adresse #00F6 se trouve la table qui se décompose de la façon suivante :&lt;br /&gt;
&lt;br /&gt;
*0x00F6:0x00 - Adresse basse du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F7:0x10 - Adresse haute du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F8:0x00 - Adresse basse du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00F9:0x20 - Adresse haute du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00FA:0x00 - Adresse basse du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FB:0x30 - Adresse haute du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FC:0x00 - Adresse basse du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FD:0x40 - Adresse haute du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FE:0x00 - Octet d'alignement &lt;br /&gt;
&lt;br /&gt;
*0x00FF:0x00 - Adresse basse du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
*0x0100:0x50 - Adresse haute du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartTimer16'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un compteur 16bits en utilisant des canaux 2 et 3 du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartTimer16 dd,d&lt;br /&gt;
Le premier paramètre indique la constante à charger dans le compteur interne des canaux 2 (partie haute) et 3 (partie basse) du CTC. La valeur 0 dans la partie haut ou basse correspond à 256 (0x100) pour la partie correspondante. Le temps écoulé en fonction de ce paramètre est le suivant : (partie_haute(dd)-1)*(partie_basse(dd)-1)*64µs&lt;br /&gt;
&lt;br /&gt;
Le second paramètre est un drapeau qui indique si une interruption doit être générée quand le compteur interne du canal 3 arrive à zéro. Les valeurs acceptées sont :&lt;br /&gt;
&lt;br /&gt;
*CTC.int : une interruption est générée quand le compteur interne du canal 3 est à zéro&lt;br /&gt;
*CTC_noint : aucune interruption générée&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87549</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87549"/>
				<updated>2013-07-11T13:30:00Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Bibliotheque de prise en charge du CTC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliothèque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
*string chaîne de caractères&lt;br /&gt;
&lt;br /&gt;
===Description brève du CTC===&lt;br /&gt;
&lt;br /&gt;
Le CTC est composé de 4 canaux possédant chacun 1 compteur interne et 1 registre contenant une constante. Chaque canal est configurable en mode 'counter' ou en mode 'timer'.&lt;br /&gt;
&lt;br /&gt;
En mode counter , le compteur interne est décrémenté à chaque signal sur sa ligne d'entrée. Quand ce compteur atteint zéro , un signal est envoyé sur sa ligne de sortie et une interruption est déclenchée si l'utilisateur l'a configuré. Le compteur interne est rechargé avec la constante et le décompte reprend.&lt;br /&gt;
&lt;br /&gt;
En mode timer , le compteur interne est décrémenté toutes les 64 ou 256 impulsions d'horloge selon la configuration soit 16 ou 64µs pour une fréquence de 4Mhz. Quand ce compteur atteint zéro , un signal est envoyé sur sa ligne de sortie et une interruption est déclenchée si l'utilisateur l'a configuré. Le compteur interne est rechargé avec la constante et le décompte reprend.&lt;br /&gt;
&lt;br /&gt;
Pour plus d'informations sur le fonctionnement exact du CTC , se référer à la documentation Zilog :[[File:Z80ctc.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Connexions des lignes du CTC sur le CTC-AY===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Canal || signal en entrée || signal en sortie || utilisation typique&lt;br /&gt;
|-&lt;br /&gt;
| 0 || horloge 4Mhz || YMZ || fréquence des YMZ&lt;br /&gt;
|-&lt;br /&gt;
| 1 || CRTC cursor || Z80 NMI || NMI localisé&lt;br /&gt;
|-&lt;br /&gt;
| 2 || horloge 4Mhz || canal 3 || compteur 8/16bits&lt;br /&gt;
|-&lt;br /&gt;
| 3 || canal 2 || sans sortie || compteur 8/16bits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
Valeurs définies :&lt;br /&gt;
*CTC.freq_CPC&lt;br /&gt;
*CTC.freq_ZX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartNMI'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre le canal 1 pour déclencher une interruption NMI à l'adresse CRTC indiquée.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI&lt;br /&gt;
Sans paramètre , le CTC est configuré pour produire l'interruption non masquable à l'adresse indiquée par les registres 14 et 15 du CRTC. Les registres de début et de fin de curseur (registres 10 et 11 du CRTC) doivent être correctement configurés avant l'usage de CTC_StartNMI.&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI d/r/(rr)/(ii),d/r/(rr)/(ii)&lt;br /&gt;
Le premier paramètre correspond à la partie haute de l'adresse CRTC à laquelle l'interruption non masquable doit se produire , la deuxième à la partie basse. Les paramètres peuvent être une valeur immédiate, un registre 8 bits (D,E,H,L) ou une référence à un registre 16bits ou d'index. La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartNMI (DE++),(DE)&lt;br /&gt;
&lt;br /&gt;
*CTC_StarNMI dd&lt;br /&gt;
Le paramètre correspond à l'adresse CRTC 16bits complète.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
***CTC_CreateIntTable***&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Crée une table de vecteurs et crée une fonction d'initialisation pour cette table en mode IM2. Néanmoins cette fonction ne change ni l'état des interruptions , ni le mode de gestion des interruptions du Z80. C'est à la charge de l'utilisateur de la bibliothèque d'exécuter les instructions &amp;quot;EI&amp;quot; et &amp;quot;IM2&amp;quot; ensuite.&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_CreateIntTable string,b,bb,bb,bb,bb&lt;br /&gt;
Le premier paramètre est le nom qui sera donné à la table crée.Deux étiquettes sont crées lors du processus, nom_de_la_table.table est l'adresse de la table elle même , nom_de_la_table.set est la fonction qui configure le Z80 et le CTC pour utiliser cette table.&lt;br /&gt;
&lt;br /&gt;
Le deuxième paramètre est la partie haute de l'adresse de la table sachant que celle ci s'étend de (partie_haute*256)-10.La mémoire sera remplie de la valeur 0 entre l'adresse d'assemblage actuelle et l'adresse de la table.&lt;br /&gt;
&lt;br /&gt;
Les quatre derniers paramètres correspondent respectivement aux vecteurs d'interruption des canaux 0,1,2 et 3 du CTC et à celui du Gate Array.&lt;br /&gt;
&lt;br /&gt;
Example : CTC matable,#10,#1000,#2000,#3000,#4000,#5000&lt;br /&gt;
&lt;br /&gt;
Crée deux étiquettes nommées &amp;quot;matable.table&amp;quot; et &amp;quot;matable.set&amp;quot;.A l'adresse #00F6 se trouve la table qui se décompose de la façon suivante :&lt;br /&gt;
&lt;br /&gt;
*0x00F6:0x00 - Adresse basse du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F7:0x10 - Adresse haute du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F8:0x00 - Adresse basse du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00F9:0x20 - Adresse haute du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00FA:0x00 - Adresse basse du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FB:0x30 - Adresse haute du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FC:0x00 - Adresse basse du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FD:0x40 - Adresse haute du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FE:0x00 - Octet d'alignement &lt;br /&gt;
&lt;br /&gt;
*0x00FF:0x00 - Adresse basse du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
*0x0100:0x50 - Adresse haute du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartTimer16'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un compteur 16bits en utilisant des canaux 2 et 3 du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartTimer16 dd,d&lt;br /&gt;
Le premier paramètre indique la constante à charger dans le compteur interne des canaux 2 (partie haute) et 3 (partie basse) du CTC. La valeur 0 dans la partie haut ou basse correspond à 256 (0x100) pour la partie correspondante. Le temps écoulé en fonction de ce paramètre est le suivant : (partie_haute(dd)-1)*(partie_basse(dd)-1)*64µs&lt;br /&gt;
&lt;br /&gt;
Le second paramètre est un drapeau qui indique si une interruption doit être générée quand le compteur interne du canal 3 arrive à zéro. Les valeurs acceptées sont :&lt;br /&gt;
&lt;br /&gt;
*CTC.int : une interruption est générée quand le compteur interne du canal 3 est à zéro&lt;br /&gt;
*CTC_noint : aucune interruption générée&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Z80ctc.pdf&amp;diff=87548</id>
		<title>File:Z80ctc.pdf</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Z80ctc.pdf&amp;diff=87548"/>
				<updated>2013-07-11T13:27:51Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: Z80 CTC datasheet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Z80 CTC datasheet&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87547</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87547"/>
				<updated>2013-07-11T12:56:03Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
*string chaîne de caractères&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
Valeurs définies :&lt;br /&gt;
*CTC.freq_CPC&lt;br /&gt;
*CTC.freq_ZX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartNMI'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre le canal 1 pour déclencher une interruption NMI à l'adresse CRTC indiquée.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI&lt;br /&gt;
Sans paramètre , le CTC est configuré pour produire l'interruption non masquable à l'adresse indiquée par les registres 14 et 15 du CRTC. Les registres de début et de fin de curseur (registres 10 et 11 du CRTC) doivent être correctement configurés avant l'usage de CTC_StartNMI.&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI d/r/(rr)/(ii),d/r/(rr)/(ii)&lt;br /&gt;
Le premier paramètre correspond à la partie haute de l'adresse CRTC à laquelle l'interruption non masquable doit se produire , la deuxième à la partie basse. Les paramètres peuvent être une valeur immédiate, un registre 8 bits (D,E,H,L) ou une référence à un registre 16bits ou d'index. La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartNMI (DE++),(DE)&lt;br /&gt;
&lt;br /&gt;
*CTC_StarNMI dd&lt;br /&gt;
Le paramètre correspond à l'adresse CRTC 16bits complète.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
***CTC_CreateIntTable***&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Crée une table de vecteurs et crée une fonction d'initialisation pour cette table en mode IM2. Néanmoins cette fonction ne change ni l'état des interruptions , ni le mode de gestion des interruptions du Z80. C'est à la charge de l'utilisateur de la bibliothèque d'exécuter les instructions &amp;quot;EI&amp;quot; et &amp;quot;IM2&amp;quot; ensuite.&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_CreateIntTable string,b,bb,bb,bb,bb&lt;br /&gt;
Le premier paramètre est le nom qui sera donné à la table crée.Deux étiquettes sont crées lors du processus, nom_de_la_table.table est l'adresse de la table elle même , nom_de_la_table.set est la fonction qui configure le Z80 et le CTC pour utiliser cette table.&lt;br /&gt;
&lt;br /&gt;
Le deuxième paramètre est la partie haute de l'adresse de la table sachant que celle ci s'étend de (partie_haute*256)-10.La mémoire sera remplie de la valeur 0 entre l'adresse d'assemblage actuelle et l'adresse de la table.&lt;br /&gt;
&lt;br /&gt;
Les quatre derniers paramètres correspondent respectivement aux vecteurs d'interruption des canaux 0,1,2 et 3 du CTC et à celui du Gate Array.&lt;br /&gt;
&lt;br /&gt;
Example : CTC matable,#10,#1000,#2000,#3000,#4000,#5000&lt;br /&gt;
&lt;br /&gt;
Crée deux étiquettes nommées &amp;quot;matable.table&amp;quot; et &amp;quot;matable.set&amp;quot;.A l'adresse #00F6 se trouve la table qui se décompose de la façon suivante :&lt;br /&gt;
&lt;br /&gt;
*0x00F6:0x00 - Adresse basse du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F7:0x10 - Adresse haute du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F8:0x00 - Adresse basse du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00F9:0x20 - Adresse haute du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00FA:0x00 - Adresse basse du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FB:0x30 - Adresse haute du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FC:0x00 - Adresse basse du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FD:0x40 - Adresse haute du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FE:0x00 - Octet d'alignement &lt;br /&gt;
&lt;br /&gt;
*0x00FF:0x00 - Adresse basse du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
*0x0100:0x50 - Adresse haute du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartTimer16'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un compteur 16bits en utilisant des canaux 2 et 3 du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartTimer16 dd,d&lt;br /&gt;
Le premier paramètre indique la constante à charger dans le compteur interne des canaux 2 (partie haute) et 3 (partie basse) du CTC. La valeur 0 dans la partie haut ou basse correspond à 256 (0x100) pour la partie correspondante. Le temps écoulé en fonction de ce paramètre est le suivant : (partie_haute(dd)-1)*(partie_basse(dd)-1)*64µs&lt;br /&gt;
&lt;br /&gt;
Le second paramètre est un drapeau qui indique si une interruption doit être générée quand le compteur interne du canal 3 arrive à zéro. Les valeurs acceptées sont :&lt;br /&gt;
&lt;br /&gt;
*CTC.int : une interruption est générée quand le compteur interne du canal 3 est à zéro&lt;br /&gt;
*CTC_noint : aucune interruption générée&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87546</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87546"/>
				<updated>2013-07-11T12:55:05Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
*string chaîne de caractères&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
Valeurs définies :&lt;br /&gt;
*CTC.freq_CPC&lt;br /&gt;
*CTC.freq_ZX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartNMI'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre le canal 1 pour déclencher une interruption NMI à l'adresse CRTC indiquée.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI&lt;br /&gt;
Sans paramètre , le CTC est configuré pour produire l'interruption non masquable à l'adresse indiquée par les registres 14 et 15 du CRTC. Les registres de début et de fin de curseur (registres 10 et 11 du CRTC) doivent être correctement configurés avant l'usage de CTC_StartNMI.&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI d/r/(rr)/(ii),d/r/(rr)/(ii)&lt;br /&gt;
Le premier paramètre correspond à la partie haute de l'adresse CRTC à laquelle l'interruption non masquable doit se produire , la deuxième à la partie basse. Les paramètres peuvent être une valeur immédiate, un registre 8 bits (D,E,H,L) ou une référence à un registre 16bits ou d'index. La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartNMI (DE++),(DE)&lt;br /&gt;
&lt;br /&gt;
*CTC_StarNMI dd&lt;br /&gt;
Le paramètre correspond à l'adresse CRTC 16bits complète.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
***CTC_CreateIntTable***&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Crée une table de vecteurs et crée une fonction d'initialisation pour cette table en mode IM2. Néanmoins cette fonction ne change ni l'état des interruptions , ni le mode de gestion des interruptions du Z80. C'est à la charge de l'utilisateur de la bibliothèque d'exécuter les instructions &amp;quot;EI&amp;quot; et &amp;quot;IM2&amp;quot; ensuite.&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_CreateIntTable string,b,bb,bb,bb,bb&lt;br /&gt;
Le premier paramètre est le nom qui sera donné à la table crée.Deux étiquettes sont crées lors du processus, nom_de_la_table.table est l'adresse de la table elle même , nom_de_la_table.set est la fonction qui configure le Z80 et le CTC pour utiliser cette table.&lt;br /&gt;
&lt;br /&gt;
Le deuxième paramètre est la partie haute de l'adresse de la table sachant que celle ci s'étend de (partie_haute*256)-10.La mémoire sera remplie de la valeur 0 entre l'adresse d'assemblage actuelle et l'adresse de la table.&lt;br /&gt;
&lt;br /&gt;
Les quatre derniers paramètres correspondent respectivement aux vecteurs d'interruption des canaux 0,1,2 et 3 du CTC et à celui du Gate Array.&lt;br /&gt;
&lt;br /&gt;
Example : CTC matable,#10,#1000,#2000,#3000,#4000,#5000&lt;br /&gt;
&lt;br /&gt;
Crée deux étiquettes nommées &amp;quot;matable.table&amp;quot; et &amp;quot;matable.set&amp;quot;.A l'adresse #00F6 se trouve la table qui se décompose de la façon suivante :&lt;br /&gt;
&lt;br /&gt;
*0x00F6:0x00 - Adresse basse du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F7:0x10 - Adresse haute du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F8:0x00 - Adresse basse du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00F9:0x20 - Adresse haute du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00FA:0x00 - Adresse basse du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FB:0x30 - Adresse haute du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FC:0x00 - Adresse basse du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FD:0x40 - Adresse haute du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FE:0x00 - Octet d'alignement &lt;br /&gt;
&lt;br /&gt;
*0x00FF:0x00 - Adresse basse du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
*0x0100:0x50 - Adresse haute du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartTimer16'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un compteur 16bits en utilisant des canaux 2 et 3 du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartTimer16 dd,d&lt;br /&gt;
Le premier paramètre indique la constante à charger dans le compteur interne des canaux 2 (partie haute) et 3 (partie basse) du CTC. La valeur 0 dans la partie haut ou basse correspond à 256 (0x100) pour la partie correspondante. Le temps écoulé en fonction de ce paramètre est le suivant : (partie_haute(dd)-1)*(partie_basse(dd)-1)*64µs&lt;br /&gt;
&lt;br /&gt;
Le second paramètre est un drapeaux qui indique si une interruption doit être générée quand le compteur interne du canal 3 arrive à zéro. Les valeurs acceptées sont :&lt;br /&gt;
&lt;br /&gt;
*CTC.int : une interruption est générée quand le compteur interne du canal 3 est à zéro&lt;br /&gt;
*CTC_noint : aucune interruption générée&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87545</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87545"/>
				<updated>2013-07-11T12:35:52Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
*string chaîne de caractères&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartNMI'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre le canal 1 pour déclencher une interruption NMI à l'adresse CRTC indiquée.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI&lt;br /&gt;
Sans paramètre , le CTC est configuré pour produire l'interruption non masquable à l'adresse indiquée par les registres 14 et 15 du CRTC. Les registres de début et de fin de curseur (registres 10 et 11 du CRTC) doivent être correctement configurés avant l'usage de CTC_StartNMI.&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI d/r/(rr)/(ii),d/r/(rr)/(ii)&lt;br /&gt;
Le premier paramètre correspond à la partie haute de l'adresse CRTC à laquelle l'interruption non masquable doit se produire , la deuxième à la partie basse. Les paramètres peuvent être une valeur immédiate, un registre 8 bits (D,E,H,L) ou une référence à un registre 16bits ou d'index. La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartNMI (DE++),(DE)&lt;br /&gt;
&lt;br /&gt;
*CTC_StarNMI dd&lt;br /&gt;
Le paramètre correspond à l'adresse CRTC 16bits complète.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
***CTC_CreateIntTable***&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Crée une table de vecteurs et crée une fonction d'initialisation pour cette table en mode IM2. Néanmoins cette fonction ne change ni l'état des interruptions , ni le mode de gestion des interruptions du Z80. C'est à la charge de l'utilisateur de la bibliothèque d'exécuter les instructions &amp;quot;EI&amp;quot; et &amp;quot;IM2&amp;quot; ensuite.&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_CreateIntTable string,b,bb,bb,bb,bb&lt;br /&gt;
Le premier paramètre est le nom qui sera donné à la table crée.Deux étiquettes sont crées lors du processus, nom_de_la_table.table est l'adresse de la table elle même , nom_de_la_table.set est la fonction qui configure le Z80 et le CTC pour utiliser cette table.&lt;br /&gt;
&lt;br /&gt;
Le deuxième paramètre est la partie haute de l'adresse de la table sachant que celle ci s'étend de (partie_haute*256)-10.La mémoire sera remplie de la valeur 0 entre l'adresse d'assemblage actuelle et l'adresse de la table.&lt;br /&gt;
&lt;br /&gt;
Les quatre derniers paramètres correspondent respectivement aux vecteurs d'interruption des canaux 0,1,2 et 3 du CTC et à celui du Gate Array.&lt;br /&gt;
&lt;br /&gt;
Example : CTC matable,#10,#1000,#2000,#3000,#4000,#5000&lt;br /&gt;
&lt;br /&gt;
Crée deux étiquettes nommées &amp;quot;matable.table&amp;quot; et &amp;quot;matable.set&amp;quot;.A l'adresse #00F6 se trouve la table qui se décompose de la façon suivante :&lt;br /&gt;
&lt;br /&gt;
*0x00F6:0x00 - Adresse basse du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F7:0x10 - Adresse haute du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F8:0x00 - Adresse basse du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00F9:0x20 - Adresse haute du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00FA:0x00 - Adresse basse du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FB:0x30 - Adresse haute du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FC:0x00 - Adresse basse du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FD:0x40 - Adresse haute du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FE:0x00 - Octet d'alignement &lt;br /&gt;
&lt;br /&gt;
*0x00FF:0x00 - Adresse basse du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
*0x0100:0x50 - Adresse haute du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartTimer16'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un compteur 16bits en utilisant des canaux 2 et 3 du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartTimer16 dd,d&lt;br /&gt;
Le premier paramètre indique la constante à charger dans le compteur interne des canaux 2 (partie haute) et 3 (partie basse) du CTC. La valeur 0 dans la partie haut ou basse correspond à 256 (0x100) pour la partie correspondante. Le temps écoulé en fonction de ce paramètre est le suivant : (partie_haute(dd)-1)*(partie_basse(dd)-1)*64µs&lt;br /&gt;
&lt;br /&gt;
Le second paramètre est un drapeaux qui indique si une interruption doit être générée quand le compteur interne du canal 3 arrive à zéro. Les valeurs acceptées sont :&lt;br /&gt;
&lt;br /&gt;
*CTC.int : une interruption est générée quand le compteur interne du canal 3 est à zéro&lt;br /&gt;
*CTC_noint : aucune interruption générée&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87544</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87544"/>
				<updated>2013-07-11T12:01:00Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
*string chaîne de caractères&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&lt;br /&gt;
CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartNMI'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre le canal 1 pour déclencher une interruption NMI à l'adresse CRTC indiquée.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI&lt;br /&gt;
Sans paramètre , le CTC est configuré pour produire l'interruption non masquable à l'adresse indiquée par les registres 14 et 15 du CRTC. Les registres de début et de fin de curseur (registres 10 et 11 du CRTC) doivent être correctement configurés avant l'usage de CTC_StartNMI.&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI d/r/(rr)/(ii),d/r/(rr)/(ii)&lt;br /&gt;
Le premier paramètre correspond à la partie haute de l'adresse CRTC à laquelle l'interruption non masquable doit se produire , la deuxième à la partie basse. Les paramètres peuvent être une valeur immédiate, un registre 8 bits (D,E,H,L) ou une référence à un registre 16bits ou d'index. La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartNMI (DE++),(DE)&lt;br /&gt;
&lt;br /&gt;
*CTC_StarNMI dd&lt;br /&gt;
Le paramètre correspond à l'adresse CRTC 16bits complète.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
!!!CTC_CreateIntTable!!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Crée une table de vecteurs et crée une fonction d'initialisation pour cette table en mode IM2. Néanmoins cette fonction ne change ni l'état des interruptions , ni le mode de gestion des interruptions du Z80. C'est à la charge de l'utilisateur de la bibliothèque d'exécuter les instructions &amp;quot;EI&amp;quot; et &amp;quot;IM2&amp;quot; ensuite.&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_CreateIntTable string,b,bb,bb,bb,bb&lt;br /&gt;
Le premier paramètre est le nom qui sera donné à la table crée.Deux étiquettes sont crées lors du processus, nom_de_la_table.table est l'adresse de la table elle même , nom_de_la_table.set est la fonction qui configure le Z80 et le CTC pour utiliser cette table.&lt;br /&gt;
&lt;br /&gt;
Le deuxième paramètre est la partie haute de l'adresse de la table sachant que celle ci s'étend de (partie_haute*256)-10.La mémoire sera remplie de la valeur 0 entre l'adresse d'assemblage actuelle et l'adresse de la table.&lt;br /&gt;
&lt;br /&gt;
Les quatre derniers paramètres correspondent respectivement aux vecteurs d'interruption des canaux 0,1,2 et 3 du CTC et à celui du Gate Array.&lt;br /&gt;
&lt;br /&gt;
Example : CTC matable,#10,#1000,#2000,#3000,#4000,#5000&lt;br /&gt;
&lt;br /&gt;
Crée deux étiquettes nommées &amp;quot;matable.table&amp;quot; et &amp;quot;matable.set&amp;quot;.A l'adresse #00F6 se trouve la table qui se décompose de la façon suivante :&lt;br /&gt;
&lt;br /&gt;
*0x00F6:0x00 - Adresse basse du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F7:0x10 - Adresse haute du vecteur d'interruption du canal 0&lt;br /&gt;
&lt;br /&gt;
*0x00F8:0x00 - Adresse basse du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00F9:0x20 - Adresse haute du vecteur d'interruption du canal 1&lt;br /&gt;
&lt;br /&gt;
*0x00FA:0x00 - Adresse basse du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FB:0x30 - Adresse haute du vecteur d'interruption du canal 2&lt;br /&gt;
&lt;br /&gt;
*0x00FC:0x00 - Adresse basse du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FD:0x40 - Adresse haute du vecteur d'interruption du canal 3&lt;br /&gt;
&lt;br /&gt;
*0x00FE:0x00 - Octet d'alignement &lt;br /&gt;
&lt;br /&gt;
*0x00FF:0x00 - Adresse basse du vecteur d'interruption du Gate Array&lt;br /&gt;
&lt;br /&gt;
*0x0100:0x50 - Adresse haute du vecteur d'interruption du Gate Array&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87543</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87543"/>
				<updated>2013-07-11T11:30:03Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartNMI'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre le canal 0 pour déclencher une interruption NMI à l'adresse CRTC indiquée.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles :&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI&lt;br /&gt;
Sans paramètre , le CTC est configuré pour produire l'interruption non masquable à l'adresse indiquée par les registres 14 et 15 du CRTC. Les registres de début et de fin de curseur (registres 10 et 11 du CRTC) doivent être correctement configurés avant l'usage de CTC_StartNMI.&lt;br /&gt;
&lt;br /&gt;
*CTC_StartNMI d/r/(rr)/(ii),d/r/(rr)/(ii)&lt;br /&gt;
Le premier paramètre correspond à la partie haute de l'adresse CRTC à laquelle l'interruption non masquable doit se produire , la deuxième à la partie basse. Les paramètres peuvent être une valeur immédiate, un registre 8 bits (D,E,H,L) ou une référence à un registre 16bits ou d'index. La pré/post imcrémentation/décrementation est possible dans ce cas.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartNMI (DE++),(DE)&lt;br /&gt;
&lt;br /&gt;
*CTC_StarNMI dd&lt;br /&gt;
Le paramètre correspond à l'adresse CRTC 16bits complète.&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87542</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87542"/>
				<updated>2013-07-11T11:12:46Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StopChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arrête un des canaux du CTC.&lt;br /&gt;
Le paramètre correspond à un des canaux du CTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_StopChannel d (defaut 0)&lt;br /&gt;
&lt;br /&gt;
En cas d'omission du paramètre, c'est le canal 0 qui est arrêté, ce qui a pour effet de fixer la fréquence des deux YM à 2Mhz (Atari ST)&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87541</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87541"/>
				<updated>2013-07-11T11:06:45Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargée dans le compteur du canalinterne immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal interne atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87540</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87540"/>
				<updated>2013-07-11T11:06:06Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM. &lt;br /&gt;
Si le paramètre est omis, c'est la fréquence du CPC qui est choisie par défaut.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC.&lt;br /&gt;
Le premier paramètre correspond au canal choisi, le deuxième aux drapeaux affectant ce canal et le troisième à une constante de temps qui sera chargé dans le compteur du canal immédiatement, puis à chaque fois que ce compteur arrivera à zéro.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : Canal 0&lt;br /&gt;
*ctc.chan1 : Canal 1&lt;br /&gt;
*ctc.chan2 : Canal 2&lt;br /&gt;
*ctc.chan3 : Canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et en partie combinables pour les drapeaux :&lt;br /&gt;
*ctc.int : Une interruption est déclenchée quand le compteur du canal atteint 0&lt;br /&gt;
*ctc.counter : Le canal est en mode counter&lt;br /&gt;
*ctc.timer : Le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : Choisi une échelle de temps de 64µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.prescale16 : Choisi une échelle de temps de 16µs pour le canal ''(mode timer uniquement)''&lt;br /&gt;
*ctc.reset : Redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront chargés à la suite en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donné sous la forme d'une valeur immédiate. Les deux suivants seront chargés en (rr) ou (ii). Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les deux premiers paramètres sont des valeurs immédiates. Le troisième peut être donné sous la forme d'une valeur immédiate, d'un registre 8 bits ou d'une référence à un registre 16bits ou d'index.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87537</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87537"/>
				<updated>2013-07-11T10:18:23Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM.Si le paramètre est omis, c'est la fréquence du CPC qui est automatiquement choisie.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC , le premier paramètre correspond au canal choisi , le second aux drapeaux affectant ce canal et le troisième à la valeur du compteur du canal.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : canal 0&lt;br /&gt;
*ctc.chan1 : canal 1&lt;br /&gt;
*ctc.chan2 : canal 2&lt;br /&gt;
*ctc.chan3 : canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et combinables en partie pour les drapeaux :&lt;br /&gt;
*ctc.int : une interruption est déclenchée quand le compteur du canal atteint 0&lt;br /&gt;
*ctc.counter : le canal est en mode counter&lt;br /&gt;
*ctc.timer : le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : choisi une échelle de temps de 64µs pour le canal (mode timer uniquement)&lt;br /&gt;
*ctc.prescale16 : choisi une échelle de temps de 16µs pour le canal (mode timer uniquement)&lt;br /&gt;
*ctc.reset : redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront charges à la suite en (rr) ou (ii).Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donnée sous forme de valeur immédiate.Les deux derniers seront chargés à la suite en (rr) ou (ii).Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les premiers et second paramètres sont des valeurs immédiates.Les troisième peut être donné sous forme de valeur immédiate , registre 8 bits ou une référence à un registre 16bits ou d'index&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87536</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87536"/>
				<updated>2013-07-11T10:07:18Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM.Si le paramètre est omis, c'est la fréquence du CPC qui est automatiquement choisie.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC , le premier paramètre correspond au canal choisi , le second aux drapeaux affectant ce canal et le troisième à la valeur du compteur du canal.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : canal 0&lt;br /&gt;
*ctc.chan1 : canal 1&lt;br /&gt;
*ctc.chan2 : canal 2&lt;br /&gt;
*ctc.chan3 : canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et combinables en partie pour les drapeaux :&lt;br /&gt;
*ctc.int : une interruption est déclenchée quand le compteur du canal atteint 0&lt;br /&gt;
*ctc.counter : le canal est en mode counter&lt;br /&gt;
*ctc.timer : le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : choisi une échelle de temps de 64µs pour le canal (mode timer uniquement)&lt;br /&gt;
*ctc.prescale16 : choisi une échelle de temps de 16µs pour le canal (mode timer uniquement)&lt;br /&gt;
*ctc.reset : redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront charges à la suite en (rr) ou (ii).Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donnée sous forme de valeur immédiate.Les deux derniers seront chargés à la suite en (rr) ou (ii).Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les premiers et second paramètres sont des valeurs immédiates.Les troisième peut être donné sous forme de valeur immédiate , registre 8 bits ou une référence à un registre 16bits ou d'index&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_main_fr&amp;diff=87535</id>
		<title>CTC-AY SDK main fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_main_fr&amp;diff=87535"/>
				<updated>2013-07-11T09:40:49Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Bibliothèques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&amp;lt;big&amp;gt;'''Documentation du System Development Kit pour le CTC-AY'''&amp;lt;/big&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Attention : Cette page est en construction actuellement, les spécifications pouvant être changées à tout moment.&lt;br /&gt;
&lt;br /&gt;
Warning: this page is under construction so it is only avaible actually for french language (english translation will follow).&lt;br /&gt;
&lt;br /&gt;
===Avant propos===&lt;br /&gt;
&lt;br /&gt;
Le SDK du CTC-AY a pour but de faciliter le développement de produits pour le CTC-AY, principalement sous forme de cartouches totalement autonomes du fimware d'origine du CPC. Il se constitue d'outils et de bibliothèques de fonctions écrites en assembleur. Les bibliothèques visent à prendre en charge le matériel d'origine du CPC et celui du CTC-AY.&lt;br /&gt;
Ce SDK est orienté cross développement via un PC. Les outils PC sont disponibles et testés sous Windows XP et Windows 7 mais devraient fonctionner sans difficulté sous Windows 95/98.&lt;br /&gt;
Les bibliothèques sont au format source de Sjasm qui est l'assembleur choisi pour ce SDK. Moyennant une adaptation de la syntaxe, il est possible de les utiliser avec un autre cross assembleur.&lt;br /&gt;
&lt;br /&gt;
===Prise en charge de la CPC Booster+===&lt;br /&gt;
&lt;br /&gt;
Certains outils nécessitent l'extension CPC Booster+. Elle est même fortement recommandée pour transférer les données dans la cartouche sans avoir recours à d'autres supports. De plus, le BIOS fourni dans les cartouches intègre un moniteur permettant de tracer l'exécution d'un programme via la CPC Booster+.&lt;br /&gt;
La configuration des modules BlueTooth est également prise en charge de manière automatique pour les firmware LINVOR(HC06) et une console permettant une configuration manuelle est disponible pour les autres firmwares (HC05).&lt;br /&gt;
&lt;br /&gt;
===Outils===&lt;br /&gt;
&lt;br /&gt;
* BIOS&lt;br /&gt;
* Utilitaire de transfert CPC Booster+&lt;br /&gt;
* Configuration automatique BlueTooth (modules Linvor)&lt;br /&gt;
* Console de configuration manuelle BlueTooth (autre modules) &lt;br /&gt;
&lt;br /&gt;
===Bibliothèques===&lt;br /&gt;
&lt;br /&gt;
*[[CTC-AY_SDK_libCTC_fr|CTC]] (ctc.asm) &lt;br /&gt;
*CPC Booster+ (booster.asm)&lt;br /&gt;
*Couleurs (color.asm)&lt;br /&gt;
*Strings (string.asm)&lt;br /&gt;
*Clavier (keyboard_simple.asm , keyboard_advanced.asm)&lt;br /&gt;
&lt;br /&gt;
===Programmes d'exemple===&lt;br /&gt;
&lt;br /&gt;
*Redéfinition de touches (redef_key.asm)&lt;br /&gt;
*Prise en charge avancée du clavier Scancodes/SHIFT/CONTROL/CAPSLOCK (key_advanced.asm)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87534</id>
		<title>CTC-AY SDK libCTC fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_libCTC_fr&amp;diff=87534"/>
				<updated>2013-07-11T09:38:43Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: Created page with &amp;quot;===Bibliotheque de prise en charge du CTC===  Localisation : lib/ctc.asm  Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configurat...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Bibliotheque de prise en charge du CTC===&lt;br /&gt;
&lt;br /&gt;
Localisation : lib/ctc.asm&lt;br /&gt;
&lt;br /&gt;
Cette bibliothèque est composée de macros ainsi que de définitions des drapeaux pour la configuration du CTC.&lt;br /&gt;
&lt;br /&gt;
Rappel des abréviations :&lt;br /&gt;
*d valeur 8 bits (0-0xFF)&lt;br /&gt;
*dd valeur 16 bits (0-0xFFFF)&lt;br /&gt;
*r registre 8 bits (A,B,C,D,E,H,L)&lt;br /&gt;
*rr registre 16 bits (HL/BC/DE)&lt;br /&gt;
*ii registre d'index (IX/IY)&lt;br /&gt;
&lt;br /&gt;
===Macros===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_SetYM'''&lt;br /&gt;
&lt;br /&gt;
Configure la fréquence des deux YM.Si le paramètre est omis, c'est la fréquence du CPC qui est automatiquement choisie.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage :&lt;br /&gt;
*CTC_SetYM d (défaut : 1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''CTC_StartChannel'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Démarre un des canaux du CTC , le premier paramètre correspond au canal choisi , le second aux drapeaux affectant ce canal et le troisième à la valeur de délai du canal.&lt;br /&gt;
&lt;br /&gt;
Les canaux sont définis par les valeurs suivantes :&lt;br /&gt;
*ctc.chan0 : canal 0&lt;br /&gt;
*ctc.chan1 : canal 1&lt;br /&gt;
*ctc.chan2 : canal 2&lt;br /&gt;
*ctc.chan3 : canal 3&lt;br /&gt;
&lt;br /&gt;
Les valeurs suivantes sont possibles et combinables en partie pour les drapeaux :&lt;br /&gt;
*ctc.int : une interruption est déclenchée quand le compteur du canal atteint 0&lt;br /&gt;
*ctc.counter : le canal est en mode counter&lt;br /&gt;
*ctc.timer : le canal est en mode timer&lt;br /&gt;
*ctc.prescale256 : choisi une échelle de temps de 64µs pour le canal (mode timer uniquement)&lt;br /&gt;
*ctc.prescale16 : choisi une échelle de temps de 16µs pour le canal (mode timer uniquement)&lt;br /&gt;
*ctc.reset : redémarre le canal avant de le mettre en route.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usages possibles : &lt;br /&gt;
*CTC_StartChannel rr/ii&lt;br /&gt;
&lt;br /&gt;
les paramètres seront charges à la suite en (rr) ou (ii).Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel HL++&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,rr&lt;br /&gt;
&lt;br /&gt;
Le premier paramètre est donnée sous forme de valeur immédiate.Les deux derniers seront chargés à la suite en (rr) ou (ii).Il est possible d'ajouter un post ou un pré incrément/décrement pour incrément/décrementer rr/ii.&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan2,HL++&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*CTC_StartChannel d,d,d/r/(rr)/(ii)&lt;br /&gt;
&lt;br /&gt;
Les premiers et second paramètres sont des valeurs immédiates.Les troisième peut être donné sous forme de valeur immédiate , registre 8 bits ou une référence à un registre 16bits ou d'index&lt;br /&gt;
&lt;br /&gt;
Exemple : CTC_StartChannel ctc.chan.3,ctc.int | ctc.timer | ctc.prescale256 | ctc.reset, (HL)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_main_fr&amp;diff=87531</id>
		<title>CTC-AY SDK main fr</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=CTC-AY_SDK_main_fr&amp;diff=87531"/>
				<updated>2013-07-11T08:55:34Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: Created page with &amp;quot;===&amp;lt;big&amp;gt;'''Documentation du System Development Kit pour le CTC-AY'''&amp;lt;/big&amp;gt;===  Attention : Cet page est en construction actuellement , les spécifications pouvant être chang...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===&amp;lt;big&amp;gt;'''Documentation du System Development Kit pour le CTC-AY'''&amp;lt;/big&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
Attention : Cet page est en construction actuellement , les spécifications pouvant être changées à tout moment.&lt;br /&gt;
&lt;br /&gt;
Warning : this page is actually under construction so it is only avaible actually for french language (English translation will follow)&lt;br /&gt;
&lt;br /&gt;
===Avant propos===&lt;br /&gt;
&lt;br /&gt;
Le SDK du CTC-AY a pour but de faciliter le développement de produits pour le CTC-AY, principalement sous forme de cartouches totalement autonomes du fimware d'origine du CPC.Il se constitue d'outils et de bibliothèques de fonctions écrites en assembleur.Les bibliothèques visent à prendre en charge le matériel d'origine du CPC et celui du CTC-AY.&lt;br /&gt;
Ce SDK est orienté cross développement via un PC.Les outils PC sont disponibles et testés sous Windows XP et Windows 7 mais devraient fonctionner dans difficulté sous Windows 95/98.&lt;br /&gt;
Les bibliothèques sont au format source de Sjasm qui est l'assembleur choisi pour ce SDK.Moyennant une adaptation de la syntaxe , il est possible de les utiliser avec un autre cross assembleur.&lt;br /&gt;
&lt;br /&gt;
===Prise en Charge de la CPCbooster+===&lt;br /&gt;
&lt;br /&gt;
Certains outils nécessitent l'extension CPCbooster.Elle est même fortement recommandée pour transférer les données dans la cartouche sans avoir à passer avec le recours d'un autre support.De plus , le BIOS fourni dans les cartouches intègre un moniteur permettant de tracer l'exécution d'un programme via la CPCbooster+.&lt;br /&gt;
La configuration modules série BlueTooth eventuellement ajoutés à la CPCbooster+ est également prise en charge de manière automatique pour les modules à firmware LINVOR(HC06) et une console permettant la configuration manuelle est disponible pour les autres firmwares (HC05).&lt;br /&gt;
&lt;br /&gt;
===Outils===&lt;br /&gt;
&lt;br /&gt;
* BIOS&lt;br /&gt;
* Utilitaire de transfert CPCbooster+&lt;br /&gt;
* Utilitaire de transfert par disquette (en développement)&lt;br /&gt;
* Configuration automatique BlueTooth (modules Linvor)&lt;br /&gt;
* Console de configuration BlueTooth (autre modules) &lt;br /&gt;
&lt;br /&gt;
===Bibliothèques===&lt;br /&gt;
&lt;br /&gt;
*CTC (ctc.asm)&lt;br /&gt;
*CPCbooster+ (booster.asm)&lt;br /&gt;
*Couleurs (color.asm)&lt;br /&gt;
*Strings (string.asm)&lt;br /&gt;
*Clavier (keyboard_simple.asm , keyboard_advanced.asm)&lt;br /&gt;
&lt;br /&gt;
===Programmes d'exemple==&lt;br /&gt;
&lt;br /&gt;
*Redéfinition de touches (redef_key.asm)&lt;br /&gt;
*Prise en charge avancée du clavier Scancodes/SHIFT/CONTROL/CAPSLOCK (key_advanced.asm)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_scanning&amp;diff=87527</id>
		<title>Programming:Keyboard scanning</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_scanning&amp;diff=87527"/>
				<updated>2013-07-09T19:04:49Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Computing key code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Hardware scancode table ==&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|'''Bit:&amp;lt;br&amp;gt;Line''' || '''7''' || '''6''' || '''5''' || '''4''' || '''3''' || '''2''' || '''1''' || '''0'''&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;40''' || F Dot || ENTER || F3 || F6 || F9 || CURDOWN || CURRIGHT || CURUP&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;41''' || F0 || F2 || F1 || F5 || F8 || F7 || COPY || CURLEFT&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;42''' || CONTROL || \  || SHIFT || F4 || ] || RETURN || [ || CLR&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;43''' || . || / || : || ; || P || @ || - || ^&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;44''' || , || M || K || L || I || O || 9 || 0&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;45''' || SPACE || N || J || H || Y || U || 7 || 8&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;46''' || V || B || F || G (Joy2 fire) || T (Joy2 right) || R (Joy2 left) || 5 (Joy2 down)|| 6 (Joy 2 up)&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;47''' || X || C || D || S || W || E || 3 || 4&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;48''' || Z || CAPSLOCK || A || TAB || Q || ESC || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;49''' || DEL || Joy 1 Fire 3 (CPC only) || Joy 1 Fire 2 ||Joy1 Fire 1||Joy1 right||Joy1 left||Joy1 down||Joy1 up&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computing key code ==&lt;br /&gt;
&lt;br /&gt;
System key codes (codes that are writted on the top of the disc drive on 664/6128 or in the CPC user manual) can be computed with the formula : (Line*8)+bit&lt;br /&gt;
&lt;br /&gt;
Example : for key SHIFT , Line = 2 , bit = 5 so (2*8)+5 = 21&lt;br /&gt;
&lt;br /&gt;
== Keyboard clash ==&lt;br /&gt;
&lt;br /&gt;
This is the name of the phenomenon when a &amp;quot;ghost&amp;quot; or &amp;quot;phantom&amp;quot; key is generated when you press some combinations of keys.&lt;br /&gt;
It is caused by the design of the keyboard hardware. It has been tested and confirmed that keyboard clash doesn't occur on an English CPC664 keyboard.&lt;br /&gt;
&lt;br /&gt;
For example, pressing Q,A,P will also generate :.&lt;br /&gt;
&lt;br /&gt;
The ':' key is the &amp;quot;ghost&amp;quot; key.&lt;br /&gt;
&lt;br /&gt;
The problem is much bigger in 2 player games.&lt;br /&gt;
&lt;br /&gt;
It is possible to avoid or minimize the problem by carefully choosing the controls. The problem also occurs when using digital joysticks because these are part of the keyboard matrix.&lt;br /&gt;
&lt;br /&gt;
If you visualize a rectangle in the keyboard matrix above, where 3 of the corners are 3 keys you have pressed. Then the key in the fourth corner will also be pressed this is the &amp;quot;ghost&amp;quot; key.&lt;br /&gt;
&lt;br /&gt;
On Plus it is possible to avoid it mostly by having one player on analogue joystick and the other on keyboard/digital joystick.&lt;br /&gt;
&lt;br /&gt;
== One line scanning routine ==&lt;br /&gt;
&lt;br /&gt;
This is a routine which scans one line of the keyboard directly. It is approximately 8% faster than the firmware routine and doesn't enable interrupts.&lt;br /&gt;
&lt;br /&gt;
'''Input:''' A = ''line (&amp;amp;amp;40 - &amp;amp;amp;49)''&lt;br /&gt;
&lt;br /&gt;
'''Output:''' A = ''hardware keyboard value''&lt;br /&gt;
&lt;br /&gt;
'''Destroyed:''' BC&lt;br /&gt;
&amp;lt;pre&amp;gt;LD A,kbdline ; from 0 to 9 with bdir/bc1=01&lt;br /&gt;
LD BC,#F782 ; PPI port A out /C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
LD BC,#F40E ; Select Ay reg 14 on ppi port A &lt;br /&gt;
OUT (C),C &lt;br /&gt;
LD BC,#F6CO ; This value is an AY index (R14) &lt;br /&gt;
OUT (C),C &lt;br /&gt;
OUT (C),0 ; Validate!!&lt;br /&gt;
LD BC,#F792 ; PPI port A in/C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
DEC B &lt;br /&gt;
OUT (C),A ; Send KbdLine on reg 14 AY through ppi port A&lt;br /&gt;
LD B,#F4 ; Read ppi port A &lt;br /&gt;
IN A,(C) ; e.g. AY R14 (AY port A) &lt;br /&gt;
LD BC,#F782 ; PPI port A out / C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
DEC B ; Reset PPI Write &lt;br /&gt;
OUT (C),0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now check for the value from the table e.g. with''''bit x,A''''and a condition e.g.''''jp z,xxxx''''or''''call z,xxxx''''&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* Bit = 0: Key is pressed&lt;br /&gt;
* Bit = 1: Key is not pressed&lt;br /&gt;
&lt;br /&gt;
== Complete keyboard scanning routine ==&lt;br /&gt;
&lt;br /&gt;
This routine scans the complete keyboard and writes all key status bits in a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
keymap  ds 10  ;map with 10*8 = 80 key status bits (bit=0 key is pressed)&lt;br /&gt;
&lt;br /&gt;
keyscan di              ;1 ##%%## C P C   VERSION ##%%##&lt;br /&gt;
        ld hl,keymap    ;3&lt;br /&gt;
        ld bc,#f782     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f40e     ;3&lt;br /&gt;
        ld e,b          ;1&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f6c0     ;3&lt;br /&gt;
        ld d,b          ;1&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld c,0          ;2&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f792     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld a,#40        ;2&lt;br /&gt;
        ld c,#4a        ;2 44&lt;br /&gt;
loop    ld b,d          ;1&lt;br /&gt;
        out (c),a       ;4 select line&lt;br /&gt;
        ld b,e          ;1&lt;br /&gt;
        ini             ;5 read bits and write into KEYMAP&lt;br /&gt;
        inc a           ;1&lt;br /&gt;
        cp c            ;1&lt;br /&gt;
        jr c,loop       ;2/3 9*16+1*15=159&lt;br /&gt;
        ld bc,#f782     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ei              ;1 8 =211 microseconds&lt;br /&gt;
        ret&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Developing programs that use joystick ==&lt;br /&gt;
&lt;br /&gt;
In the CPC world it is more common that a game supports both keyboard and digital joystick for those users who don't own joysticks.&lt;br /&gt;
In addition, it is also nice if the keys could be redefined but that is not necessary.&lt;br /&gt;
&lt;br /&gt;
There are some common keyboard configurations used:&lt;br /&gt;
&lt;br /&gt;
* '''Cursor keys &amp;amp; SPACE''' - This configuration is often used and is great for the CPC6128 and Plus and playing using emulators. This is '''not''' good for CPC 464 and 664 (which have uncomfortably arranged cursor keys)&lt;br /&gt;
&lt;br /&gt;
* '''Q,A,O,P,SPACE''' - (Q up, A down, O left, P right, SPACE fire) This is a good solution, and it's a sort of standard (used by many games). It is best for english QWERTY keyboards, on french AZERTY it'd be A-Q-O-P (but because the decoding of the keys is done in software, normally by the OS, the bits in the keyboard matrix are actually the same).&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]][[Category:CPC Internal Components]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_scanning&amp;diff=87526</id>
		<title>Programming:Keyboard scanning</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_scanning&amp;diff=87526"/>
				<updated>2013-07-09T19:03:50Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Hardware scancode table ==&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|'''Bit:&amp;lt;br&amp;gt;Line''' || '''7''' || '''6''' || '''5''' || '''4''' || '''3''' || '''2''' || '''1''' || '''0'''&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;40''' || F Dot || ENTER || F3 || F6 || F9 || CURDOWN || CURRIGHT || CURUP&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;41''' || F0 || F2 || F1 || F5 || F8 || F7 || COPY || CURLEFT&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;42''' || CONTROL || \  || SHIFT || F4 || ] || RETURN || [ || CLR&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;43''' || . || / || : || ; || P || @ || - || ^&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;44''' || , || M || K || L || I || O || 9 || 0&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;45''' || SPACE || N || J || H || Y || U || 7 || 8&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;46''' || V || B || F || G (Joy2 fire) || T (Joy2 right) || R (Joy2 left) || 5 (Joy2 down)|| 6 (Joy 2 up)&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;47''' || X || C || D || S || W || E || 3 || 4&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;48''' || Z || CAPSLOCK || A || TAB || Q || ESC || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;49''' || DEL || Joy 1 Fire 3 (CPC only) || Joy 1 Fire 2 ||Joy1 Fire 1||Joy1 right||Joy1 left||Joy1 down||Joy1 up&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Computing key code ==&lt;br /&gt;
&lt;br /&gt;
System key codes (codes that are writted on the top of the disc drive on 664/6128 or in the CPC user manual) can be computed with the formula : (Line*8)+bit&lt;br /&gt;
example : for key SHIFT , Line = 2 , bit = 5 so (2*8)+5 = 21&lt;br /&gt;
&lt;br /&gt;
== Keyboard clash ==&lt;br /&gt;
&lt;br /&gt;
This is the name of the phenomenon when a &amp;quot;ghost&amp;quot; or &amp;quot;phantom&amp;quot; key is generated when you press some combinations of keys.&lt;br /&gt;
It is caused by the design of the keyboard hardware. It has been tested and confirmed that keyboard clash doesn't occur on an English CPC664 keyboard.&lt;br /&gt;
&lt;br /&gt;
For example, pressing Q,A,P will also generate :.&lt;br /&gt;
&lt;br /&gt;
The ':' key is the &amp;quot;ghost&amp;quot; key.&lt;br /&gt;
&lt;br /&gt;
The problem is much bigger in 2 player games.&lt;br /&gt;
&lt;br /&gt;
It is possible to avoid or minimize the problem by carefully choosing the controls. The problem also occurs when using digital joysticks because these are part of the keyboard matrix.&lt;br /&gt;
&lt;br /&gt;
If you visualize a rectangle in the keyboard matrix above, where 3 of the corners are 3 keys you have pressed. Then the key in the fourth corner will also be pressed this is the &amp;quot;ghost&amp;quot; key.&lt;br /&gt;
&lt;br /&gt;
On Plus it is possible to avoid it mostly by having one player on analogue joystick and the other on keyboard/digital joystick.&lt;br /&gt;
&lt;br /&gt;
== One line scanning routine ==&lt;br /&gt;
&lt;br /&gt;
This is a routine which scans one line of the keyboard directly. It is approximately 8% faster than the firmware routine and doesn't enable interrupts.&lt;br /&gt;
&lt;br /&gt;
'''Input:''' A = ''line (&amp;amp;amp;40 - &amp;amp;amp;49)''&lt;br /&gt;
&lt;br /&gt;
'''Output:''' A = ''hardware keyboard value''&lt;br /&gt;
&lt;br /&gt;
'''Destroyed:''' BC&lt;br /&gt;
&amp;lt;pre&amp;gt;LD A,kbdline ; from 0 to 9 with bdir/bc1=01&lt;br /&gt;
LD BC,#F782 ; PPI port A out /C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
LD BC,#F40E ; Select Ay reg 14 on ppi port A &lt;br /&gt;
OUT (C),C &lt;br /&gt;
LD BC,#F6CO ; This value is an AY index (R14) &lt;br /&gt;
OUT (C),C &lt;br /&gt;
OUT (C),0 ; Validate!!&lt;br /&gt;
LD BC,#F792 ; PPI port A in/C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
DEC B &lt;br /&gt;
OUT (C),A ; Send KbdLine on reg 14 AY through ppi port A&lt;br /&gt;
LD B,#F4 ; Read ppi port A &lt;br /&gt;
IN A,(C) ; e.g. AY R14 (AY port A) &lt;br /&gt;
LD BC,#F782 ; PPI port A out / C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
DEC B ; Reset PPI Write &lt;br /&gt;
OUT (C),0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now check for the value from the table e.g. with''''bit x,A''''and a condition e.g.''''jp z,xxxx''''or''''call z,xxxx''''&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* Bit = 0: Key is pressed&lt;br /&gt;
* Bit = 1: Key is not pressed&lt;br /&gt;
&lt;br /&gt;
== Complete keyboard scanning routine ==&lt;br /&gt;
&lt;br /&gt;
This routine scans the complete keyboard and writes all key status bits in a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
keymap  ds 10  ;map with 10*8 = 80 key status bits (bit=0 key is pressed)&lt;br /&gt;
&lt;br /&gt;
keyscan di              ;1 ##%%## C P C   VERSION ##%%##&lt;br /&gt;
        ld hl,keymap    ;3&lt;br /&gt;
        ld bc,#f782     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f40e     ;3&lt;br /&gt;
        ld e,b          ;1&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f6c0     ;3&lt;br /&gt;
        ld d,b          ;1&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld c,0          ;2&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f792     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld a,#40        ;2&lt;br /&gt;
        ld c,#4a        ;2 44&lt;br /&gt;
loop    ld b,d          ;1&lt;br /&gt;
        out (c),a       ;4 select line&lt;br /&gt;
        ld b,e          ;1&lt;br /&gt;
        ini             ;5 read bits and write into KEYMAP&lt;br /&gt;
        inc a           ;1&lt;br /&gt;
        cp c            ;1&lt;br /&gt;
        jr c,loop       ;2/3 9*16+1*15=159&lt;br /&gt;
        ld bc,#f782     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ei              ;1 8 =211 microseconds&lt;br /&gt;
        ret&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Developing programs that use joystick ==&lt;br /&gt;
&lt;br /&gt;
In the CPC world it is more common that a game supports both keyboard and digital joystick for those users who don't own joysticks.&lt;br /&gt;
In addition, it is also nice if the keys could be redefined but that is not necessary.&lt;br /&gt;
&lt;br /&gt;
There are some common keyboard configurations used:&lt;br /&gt;
&lt;br /&gt;
* '''Cursor keys &amp;amp; SPACE''' - This configuration is often used and is great for the CPC6128 and Plus and playing using emulators. This is '''not''' good for CPC 464 and 664 (which have uncomfortably arranged cursor keys)&lt;br /&gt;
&lt;br /&gt;
* '''Q,A,O,P,SPACE''' - (Q up, A down, O left, P right, SPACE fire) This is a good solution, and it's a sort of standard (used by many games). It is best for english QWERTY keyboards, on french AZERTY it'd be A-Q-O-P (but because the decoding of the keys is done in software, normally by the OS, the bits in the keyboard matrix are actually the same).&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]][[Category:CPC Internal Components]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming_methods_used_in_games&amp;diff=87080</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=87080"/>
				<updated>2013-04-13T14:37:25Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Hardware Scrolling */&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;
=== 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;
&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;
| Yes &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;
| [[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;
| [[Ultima Ratio|Ultima Ratio]] &lt;br /&gt;
| 1987 &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>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_scanning&amp;diff=70727</id>
		<title>Programming:Keyboard scanning</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_scanning&amp;diff=70727"/>
				<updated>2011-11-22T20:06:09Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Hardware scancode table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Hardware scancode table ==&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|'''Bit:&amp;lt;br&amp;gt;Line''' || '''7''' || '''6''' || '''5''' || '''4''' || '''3''' || '''2''' || '''1''' || '''0'''&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;40''' || F Dot || ENTER || F3 || F6 || F9 || CURDOWN || CURRIGHT || CURUP&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;41''' || F0 || F2 || F1 || F5 || F8 || F7 || COPY || CURLEFT&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;42''' || CONTROL || \  || SHIFT || F4 || ] || RETURN || [ || CLR&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;43''' || . || / || : || ; || P || @ || - || ^&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;44''' || , || M || K || L || I || O || 9 || 0&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;45''' || SPACE || N || J || H || Y || U || 7 || 8&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;46''' || V || B || F || G (Joy2 fire) || T (Joy2 right) || R (Joy2 left) || 5 (Joy2 down)|| 6 (Joy 2 up)&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;47''' || X || C || D || S || W || E || 3 || 4&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;48''' || Z || CAPSLOCK || A || TAB || Q || ESC || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;49''' || DEL || Joy 1 Fire 3 (CPC only) || Joy 1 Fire 2 ||Joy1 Fire 1||Joy1 right||Joy1 left||Joy1 down||Joy1 up&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Keyboard clash ==&lt;br /&gt;
&lt;br /&gt;
This is the name of the phenomenon when a &amp;quot;ghost&amp;quot; or &amp;quot;phantom&amp;quot; key is generated when you press some combinations of keys.&lt;br /&gt;
It is caused by the design of the keyboard hardware. It has been tested and confirmed that keyboard clash doesn't occur on an English CPC664 keyboard.&lt;br /&gt;
&lt;br /&gt;
For example, pressing Q,A,P will also generate :.&lt;br /&gt;
&lt;br /&gt;
The ':' key is the &amp;quot;ghost&amp;quot; key.&lt;br /&gt;
&lt;br /&gt;
The problem is much bigger in 2 player games.&lt;br /&gt;
&lt;br /&gt;
It is possible to avoid or minimize the problem by carefully choosing the controls. The problem also occurs when using digital joysticks because these are part of the keyboard matrix.&lt;br /&gt;
&lt;br /&gt;
If you visualize a rectangle in the keyboard matrix above, where 3 of the corners are 3 keys you have pressed. Then the key in the fourth corner will also be pressed this is the &amp;quot;ghost&amp;quot; key.&lt;br /&gt;
&lt;br /&gt;
On Plus it is possible to avoid it mostly by having one player on analogue joystick and the other on keyboard/digital joystick.&lt;br /&gt;
&lt;br /&gt;
== One line scanning routine ==&lt;br /&gt;
&lt;br /&gt;
This is a routine which scans one line of the keyboard directly. It is approximately 8% faster than the firmware routine and doesn't enable interrupts.&lt;br /&gt;
&lt;br /&gt;
'''Input:''' A = ''line (&amp;amp;amp;40 - &amp;amp;amp;49)''&lt;br /&gt;
&lt;br /&gt;
'''Output:''' A = ''hardware keyboard value''&lt;br /&gt;
&lt;br /&gt;
'''Destroyed:''' BC&lt;br /&gt;
&amp;lt;pre&amp;gt;LD A,kbdline ; from 0 to 9 with bdir/bc1=01&lt;br /&gt;
LD BC,#F782 ; PPI port A out /C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
LD BC,#F40E ; Select Ay reg 14 on ppi port A &lt;br /&gt;
OUT (C),C &lt;br /&gt;
LD BC,#F6CO ; This value is an AY index (R14) &lt;br /&gt;
OUT (C),C &lt;br /&gt;
OUT (C),0 ; Validate!!&lt;br /&gt;
LD BC,#F792 ; PPI port A in/C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
DEC B &lt;br /&gt;
OUT (C),A ; Send KbdLine on reg 14 AY through ppi port A&lt;br /&gt;
LD B,#F4 ; Read ppi port A &lt;br /&gt;
IN A,(C) ; e.g. AY R14 (AY port A) &lt;br /&gt;
LD BC,#F782 ; PPI port A out / C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
DEC B ; Reset PPI Write &lt;br /&gt;
OUT (C),0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now check for the value from the table e.g. with''''bit x,A''''and a condition e.g.''''jp z,xxxx''''or''''call z,xxxx''''&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* Bit = 0: Key is pressed&lt;br /&gt;
* Bit = 1: Key is not pressed&lt;br /&gt;
&lt;br /&gt;
== Complete keyboard scanning routine ==&lt;br /&gt;
&lt;br /&gt;
This routine scans the complete keyboard and writes all key status bits in a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
keymap  ds 10  ;map with 10*8 = 80 key status bits (bit=0 key is pressed)&lt;br /&gt;
&lt;br /&gt;
keyscan di              ;1 ##%%## C P C   VERSION ##%%##&lt;br /&gt;
        ld hl,keymap    ;3&lt;br /&gt;
        ld bc,#f782     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f40e     ;3&lt;br /&gt;
        ld e,b          ;1&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f6c0     ;3&lt;br /&gt;
        ld d,b          ;1&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld c,0          ;2&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f792     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld a,#40        ;2&lt;br /&gt;
        ld c,#4a        ;2 44&lt;br /&gt;
loop    ld b,d          ;1&lt;br /&gt;
        out (c),a       ;4 select line&lt;br /&gt;
        ld b,e          ;1&lt;br /&gt;
        ini             ;5 read bits and write into KEYMAP&lt;br /&gt;
        inc a           ;1&lt;br /&gt;
        cp c            ;1&lt;br /&gt;
        jr c,loop       ;2/3 9*16+1*15=159&lt;br /&gt;
        ld bc,#f782     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ei              ;1 8 =211 microseconds&lt;br /&gt;
        ret&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Developing programs that use joystick ==&lt;br /&gt;
&lt;br /&gt;
In the CPC world it is more common that a game supports both keyboard and digital joystick for those users who don't own joysticks.&lt;br /&gt;
In addition, it is also nice if the keys could be redefined but that is not necessary.&lt;br /&gt;
&lt;br /&gt;
There are some common keyboard configurations used:&lt;br /&gt;
&lt;br /&gt;
* '''Cursor keys &amp;amp; SPACE''' - This configuration is often used and is great for the CPC6128 and Plus and playing using emulators. This is '''not''' good for CPC 464 and 664 (which have uncomfortably arranged cursor keys)&lt;br /&gt;
&lt;br /&gt;
* '''Q,A,O,P,SPACE''' - (Q up, A down, O left, P right, SPACE fire) This is a good solution, and it's a sort of standard (used by many games). It is best for english QWERTY keyboards, on french AZERTY it'd be A-Q-O-P (but because the decoding of the keys is done in software, normally by the OS, the bits in the keyboard matrix are actually the same).&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]][[Category:CPC Internal Components]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_scanning&amp;diff=70726</id>
		<title>Programming:Keyboard scanning</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:Keyboard_scanning&amp;diff=70726"/>
				<updated>2011-11-22T20:03:00Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Hardware scancode table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Hardware scancode table ==&lt;br /&gt;
{|{{Prettytable|width: 700px; font-size: 2em;}}&lt;br /&gt;
|'''Bit:&amp;lt;br&amp;gt;Line''' || '''7''' || '''6''' || '''5''' || '''4''' || '''3''' || '''2''' || '''1''' || '''0'''&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;40''' || F Dot || ENTER || F3 || F6 || F9 || CURDOWN || CURRIGHT || CURUP&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;41''' || F0 || F2 || F1 || F5 || F8 || F7 || COPY || CURLEFT&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;42''' || CONTROL || \  || SHIFT || F4 || ] || RETURN || [ || CLR&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;43''' || . || / || : || ; || P || @ || - || ^&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;44''' || , || M || K || L || I || O || 9 || 0&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;45''' || SPACE || N || J || H || Y || U || 7 || 8&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;46''' || V || B || F || G (Joy2 fire) || T (Joy2 right) || R (Joy2 left) || 5 (Joy2 down)|| 6 (Joy 2 up)&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;47''' || X || C || D || S || W || E || 3 || 4&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;48''' || Z || CAPSLOCK || A || TAB || Q || ESC || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
|'''&amp;amp;49''' || DEL || - || Joy 1 Fire 2 ||Joy1 Fire 1||Joy1 right||Joy1 left||Joy1 down||Joy1 up&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Keyboard clash ==&lt;br /&gt;
&lt;br /&gt;
This is the name of the phenomenon when a &amp;quot;ghost&amp;quot; or &amp;quot;phantom&amp;quot; key is generated when you press some combinations of keys.&lt;br /&gt;
It is caused by the design of the keyboard hardware. It has been tested and confirmed that keyboard clash doesn't occur on an English CPC664 keyboard.&lt;br /&gt;
&lt;br /&gt;
For example, pressing Q,A,P will also generate :.&lt;br /&gt;
&lt;br /&gt;
The ':' key is the &amp;quot;ghost&amp;quot; key.&lt;br /&gt;
&lt;br /&gt;
The problem is much bigger in 2 player games.&lt;br /&gt;
&lt;br /&gt;
It is possible to avoid or minimize the problem by carefully choosing the controls. The problem also occurs when using digital joysticks because these are part of the keyboard matrix.&lt;br /&gt;
&lt;br /&gt;
If you visualize a rectangle in the keyboard matrix above, where 3 of the corners are 3 keys you have pressed. Then the key in the fourth corner will also be pressed this is the &amp;quot;ghost&amp;quot; key.&lt;br /&gt;
&lt;br /&gt;
On Plus it is possible to avoid it mostly by having one player on analogue joystick and the other on keyboard/digital joystick.&lt;br /&gt;
&lt;br /&gt;
== One line scanning routine ==&lt;br /&gt;
&lt;br /&gt;
This is a routine which scans one line of the keyboard directly. It is approximately 8% faster than the firmware routine and doesn't enable interrupts.&lt;br /&gt;
&lt;br /&gt;
'''Input:''' A = ''line (&amp;amp;amp;40 - &amp;amp;amp;49)''&lt;br /&gt;
&lt;br /&gt;
'''Output:''' A = ''hardware keyboard value''&lt;br /&gt;
&lt;br /&gt;
'''Destroyed:''' BC&lt;br /&gt;
&amp;lt;pre&amp;gt;LD A,kbdline ; from 0 to 9 with bdir/bc1=01&lt;br /&gt;
LD BC,#F782 ; PPI port A out /C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
LD BC,#F40E ; Select Ay reg 14 on ppi port A &lt;br /&gt;
OUT (C),C &lt;br /&gt;
LD BC,#F6CO ; This value is an AY index (R14) &lt;br /&gt;
OUT (C),C &lt;br /&gt;
OUT (C),0 ; Validate!!&lt;br /&gt;
LD BC,#F792 ; PPI port A in/C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
DEC B &lt;br /&gt;
OUT (C),A ; Send KbdLine on reg 14 AY through ppi port A&lt;br /&gt;
LD B,#F4 ; Read ppi port A &lt;br /&gt;
IN A,(C) ; e.g. AY R14 (AY port A) &lt;br /&gt;
LD BC,#F782 ; PPI port A out / C out &lt;br /&gt;
OUT (C),C &lt;br /&gt;
DEC B ; Reset PPI Write &lt;br /&gt;
OUT (C),0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now check for the value from the table e.g. with''''bit x,A''''and a condition e.g.''''jp z,xxxx''''or''''call z,xxxx''''&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* Bit = 0: Key is pressed&lt;br /&gt;
* Bit = 1: Key is not pressed&lt;br /&gt;
&lt;br /&gt;
== Complete keyboard scanning routine ==&lt;br /&gt;
&lt;br /&gt;
This routine scans the complete keyboard and writes all key status bits in a map.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
keymap  ds 10  ;map with 10*8 = 80 key status bits (bit=0 key is pressed)&lt;br /&gt;
&lt;br /&gt;
keyscan di              ;1 ##%%## C P C   VERSION ##%%##&lt;br /&gt;
        ld hl,keymap    ;3&lt;br /&gt;
        ld bc,#f782     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f40e     ;3&lt;br /&gt;
        ld e,b          ;1&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f6c0     ;3&lt;br /&gt;
        ld d,b          ;1&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld c,0          ;2&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld bc,#f792     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ld a,#40        ;2&lt;br /&gt;
        ld c,#4a        ;2 44&lt;br /&gt;
loop    ld b,d          ;1&lt;br /&gt;
        out (c),a       ;4 select line&lt;br /&gt;
        ld b,e          ;1&lt;br /&gt;
        ini             ;5 read bits and write into KEYMAP&lt;br /&gt;
        inc a           ;1&lt;br /&gt;
        cp c            ;1&lt;br /&gt;
        jr c,loop       ;2/3 9*16+1*15=159&lt;br /&gt;
        ld bc,#f782     ;3&lt;br /&gt;
        out (c),c       ;4&lt;br /&gt;
        ei              ;1 8 =211 microseconds&lt;br /&gt;
        ret&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Developing programs that use joystick ==&lt;br /&gt;
&lt;br /&gt;
In the CPC world it is more common that a game supports both keyboard and digital joystick for those users who don't own joysticks.&lt;br /&gt;
In addition, it is also nice if the keys could be redefined but that is not necessary.&lt;br /&gt;
&lt;br /&gt;
There are some common keyboard configurations used:&lt;br /&gt;
&lt;br /&gt;
* '''Cursor keys &amp;amp; SPACE''' - This configuration is often used and is great for the CPC6128 and Plus and playing using emulators. This is '''not''' good for CPC 464 and 664 (which have uncomfortably arranged cursor keys)&lt;br /&gt;
&lt;br /&gt;
* '''Q,A,O,P,SPACE''' - (Q up, A down, O left, P right, SPACE fire) This is a good solution, and it's a sort of standard (used by many games). It is best for english QWERTY keyboards, on french AZERTY it'd be A-Q-O-P (but because the decoding of the keys is done in software, normally by the OS, the bits in the keyboard matrix are actually the same).&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]][[Category:CPC Internal Components]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=User:Fano&amp;diff=68387</id>
		<title>User:Fano</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=User:Fano&amp;diff=68387"/>
				<updated>2011-06-21T09:07:00Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Programmer , occasional graphist and hacker.&lt;br /&gt;
&lt;br /&gt;
==Completed==&lt;br /&gt;
[[Rick dangerous 128+]] (2009)&lt;br /&gt;
&lt;br /&gt;
==Prototyped==&lt;br /&gt;
Project [[Wildfire]] (2009-201?)&lt;br /&gt;
&lt;br /&gt;
6Ktris : 3rd place on Speed Coding at Atari Connection 2011.&lt;br /&gt;
&lt;br /&gt;
==In progress (estimated release)==&lt;br /&gt;
[[R-Type]] 128K (2011)&lt;br /&gt;
&lt;br /&gt;
Greenfields 64K (2011)&lt;br /&gt;
&lt;br /&gt;
6Ktris (2011)&lt;br /&gt;
&lt;br /&gt;
==Tools==&lt;br /&gt;
My CPC toolkit for Windows (2009)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=6_MHz_CPC&amp;diff=68328</id>
		<title>6 MHz CPC</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=6_MHz_CPC&amp;diff=68328"/>
				<updated>2011-06-12T15:20:56Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Advanced testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 6 MHz CPC is a DIY hardware modification which allows to run the [[CPC6128]] with a CPU speed of 6 MHz instead of the usual 4 MHz.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Technic ==&lt;br /&gt;
The 16 MHz crystal of the CPC is replaced by a 24 MHz crystal. Both crystals should kept on the main board, but a switch (2 lines at least, better 3) selects between them. You have to select the CPU and bus speed before you switch on the CPC. Switching the speed while the system is switched on is not advised.&lt;br /&gt;
None of the authors of this article is responsible for danger on your CPC, in case you try to use this DIY.&lt;br /&gt;
&lt;br /&gt;
== Advantages ==&lt;br /&gt;
* Z80 runs with 6 MHz&lt;br /&gt;
* Bus runs with 6 MHz&lt;br /&gt;
* FDC is 50% faster&lt;br /&gt;
* Disc formats with 50% more sectors can be used&lt;br /&gt;
* Sound is better, since PSG runs more quick&lt;br /&gt;
* Games run more fluid&lt;br /&gt;
&lt;br /&gt;
== Disadvantages ==&lt;br /&gt;
* Not every hardware expansion is able to work with the 6 MHz bus speed&lt;br /&gt;
* FDC can't read old disc formats any longer&lt;br /&gt;
* Sound must be reprogrammed&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
* A lot of games run well with 6 MHz. For example: Nebulus, StarFox, Starstrike and others.&lt;br /&gt;
* There is a 6 MHz version of FutureOS&lt;br /&gt;
&lt;br /&gt;
== Advanced testing ==&lt;br /&gt;
* Only horizontal timing of the CRTC is affected.In order to get a stable image , you need to program register 0 at 95 (96 characters line) and Register 2 at 61 (centering for 40 characters default)&lt;br /&gt;
* Pixels pitch is 66,7% of their original pitch.Theses pictures show this fact (320*200 mode 1 pixels with black border)&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:12062011055.JPG|Original CPC @16Mhz&lt;br /&gt;
Image:12062011054.JPG|Overclocked CPC @24Mhz&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
* This speed improvement is 16.66667%.This has been tested with this simple program :&lt;br /&gt;
&lt;br /&gt;
10 i = 0&lt;br /&gt;
&lt;br /&gt;
20 after 500 goto 100&lt;br /&gt;
&lt;br /&gt;
25 cls&lt;br /&gt;
&lt;br /&gt;
30 i = i +1&lt;br /&gt;
&lt;br /&gt;
40 ? i&lt;br /&gt;
&lt;br /&gt;
50 goto 30&lt;br /&gt;
&lt;br /&gt;
100 end&lt;br /&gt;
&lt;br /&gt;
Score is 258 on normal CPC versus 301 on 24Mhz CPC.&lt;br /&gt;
&lt;br /&gt;
(Theses results can be subject to discussion as we are not sure interrupts timing is not affected)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:DIY]][[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=6_MHz_CPC&amp;diff=68327</id>
		<title>6 MHz CPC</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=6_MHz_CPC&amp;diff=68327"/>
				<updated>2011-06-12T15:08:22Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Advanced testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 6 MHz CPC is a DIY hardware modification which allows to run the [[CPC6128]] with a CPU speed of 6 MHz instead of the usual 4 MHz.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Technic ==&lt;br /&gt;
The 16 MHz crystal of the CPC is replaced by a 24 MHz crystal. Both crystals should kept on the main board, but a switch (2 lines at least, better 3) selects between them. You have to select the CPU and bus speed before you switch on the CPC. Switching the speed while the system is switched on is not advised.&lt;br /&gt;
None of the authors of this article is responsible for danger on your CPC, in case you try to use this DIY.&lt;br /&gt;
&lt;br /&gt;
== Advantages ==&lt;br /&gt;
* Z80 runs with 6 MHz&lt;br /&gt;
* Bus runs with 6 MHz&lt;br /&gt;
* FDC is 50% faster&lt;br /&gt;
* Disc formats with 50% more sectors can be used&lt;br /&gt;
* Sound is better, since PSG runs more quick&lt;br /&gt;
* Games run more fluid&lt;br /&gt;
&lt;br /&gt;
== Disadvantages ==&lt;br /&gt;
* Not every hardware expansion is able to work with the 6 MHz bus speed&lt;br /&gt;
* FDC can't read old disc formats any longer&lt;br /&gt;
* Sound must be reprogrammed&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
* A lot of games run well with 6 MHz. For example: Nebulus, StarFox, Starstrike and others.&lt;br /&gt;
* There is a 6 MHz version of FutureOS&lt;br /&gt;
&lt;br /&gt;
== Advanced testing ==&lt;br /&gt;
* Only horizontal timing of the CRTC is affected.In order to get a stable image , you need to program register 0 at 95 (96 characters line) and Register 2 at 61 (centering for 40 characters default)&lt;br /&gt;
* Pixels pitch is 66,7% of their original pitch.Theses pictures show this fact (320*200 mode 1 pixels with black border)&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:12062011055.JPG|Original CPC @16Mhz&lt;br /&gt;
Image:12062011054.JPG|Overclocked CPC @24Mhz&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
* This speed improvement is 16.66667%.This has been tested with this simple program :&lt;br /&gt;
&lt;br /&gt;
10 i = 0&lt;br /&gt;
&lt;br /&gt;
20 after 500 goto 100&lt;br /&gt;
&lt;br /&gt;
25 cls&lt;br /&gt;
&lt;br /&gt;
30 i = i +1&lt;br /&gt;
&lt;br /&gt;
40 ? i&lt;br /&gt;
&lt;br /&gt;
50 goto 30&lt;br /&gt;
&lt;br /&gt;
100 end&lt;br /&gt;
&lt;br /&gt;
Score is 258 on normal CPC versus 301 on 24Mhz CPC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:DIY]][[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=6_MHz_CPC&amp;diff=68326</id>
		<title>6 MHz CPC</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=6_MHz_CPC&amp;diff=68326"/>
				<updated>2011-06-12T15:02:07Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 6 MHz CPC is a DIY hardware modification which allows to run the [[CPC6128]] with a CPU speed of 6 MHz instead of the usual 4 MHz.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Technic ==&lt;br /&gt;
The 16 MHz crystal of the CPC is replaced by a 24 MHz crystal. Both crystals should kept on the main board, but a switch (2 lines at least, better 3) selects between them. You have to select the CPU and bus speed before you switch on the CPC. Switching the speed while the system is switched on is not advised.&lt;br /&gt;
None of the authors of this article is responsible for danger on your CPC, in case you try to use this DIY.&lt;br /&gt;
&lt;br /&gt;
== Advantages ==&lt;br /&gt;
* Z80 runs with 6 MHz&lt;br /&gt;
* Bus runs with 6 MHz&lt;br /&gt;
* FDC is 50% faster&lt;br /&gt;
* Disc formats with 50% more sectors can be used&lt;br /&gt;
* Sound is better, since PSG runs more quick&lt;br /&gt;
* Games run more fluid&lt;br /&gt;
&lt;br /&gt;
== Disadvantages ==&lt;br /&gt;
* Not every hardware expansion is able to work with the 6 MHz bus speed&lt;br /&gt;
* FDC can't read old disc formats any longer&lt;br /&gt;
* Sound must be reprogrammed&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
* A lot of games run well with 6 MHz. For example: Nebulus, StarFox, Starstrike and others.&lt;br /&gt;
* There is a 6 MHz version of FutureOS&lt;br /&gt;
&lt;br /&gt;
== Advanced testing ==&lt;br /&gt;
* Only horizontal timing of the CRTC is affected.In order to get a stable image , you need to program register 0 at 95 (96 characters line) and Register 2 at 61 (centering for 40 characters default)&lt;br /&gt;
* Pixels pitch is 66,7% of their original pitch.Theses pictures show this fact (320*240 mode 1 pixels with black border)&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:12062011055.JPG|Original CPC @16Mhz&lt;br /&gt;
Image:12062011054.JPG|Overclocked CPC @24Mhz&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
* This speed improvement is 16.66667%.This has been tested with this simple program :&lt;br /&gt;
&lt;br /&gt;
10 i = 0&lt;br /&gt;
&lt;br /&gt;
20 after 500 goto 100&lt;br /&gt;
&lt;br /&gt;
25 cls&lt;br /&gt;
&lt;br /&gt;
30 i = i +1&lt;br /&gt;
&lt;br /&gt;
40 ? i&lt;br /&gt;
&lt;br /&gt;
50 goto 30&lt;br /&gt;
&lt;br /&gt;
100 end&lt;br /&gt;
&lt;br /&gt;
Score is 258 on normal CPC versus 301 on 24Mhz CPC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:DIY]][[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:12062011054.JPG&amp;diff=68325</id>
		<title>File:12062011054.JPG</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:12062011054.JPG&amp;diff=68325"/>
				<updated>2011-06-12T14:52:04Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: CPC at 24Mhz&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CPC at 24Mhz&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:12062011055.JPG&amp;diff=68324</id>
		<title>File:12062011055.JPG</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:12062011055.JPG&amp;diff=68324"/>
				<updated>2011-06-12T14:47:37Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: Original 16Mhz CPC&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Original 16Mhz CPC&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=User:Fano&amp;diff=66037</id>
		<title>User:Fano</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=User:Fano&amp;diff=66037"/>
				<updated>2010-12-26T10:55:45Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Planned */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Programmer , occasional graphist and hacker.&lt;br /&gt;
&lt;br /&gt;
==Completed==&lt;br /&gt;
[[Rick dangerous 128+]] (2009)&lt;br /&gt;
&lt;br /&gt;
==Prototyped==&lt;br /&gt;
Project [[Wildfire]] (2009-201?)&lt;br /&gt;
&lt;br /&gt;
==Planned==&lt;br /&gt;
[[R-Type]] 128K (2011)&lt;br /&gt;
&lt;br /&gt;
Greenfields 64K (2011)&lt;br /&gt;
&lt;br /&gt;
==Tools==&lt;br /&gt;
My CPC toolkit for Windows (2009)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=User:Fano&amp;diff=66036</id>
		<title>User:Fano</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=User:Fano&amp;diff=66036"/>
				<updated>2010-12-26T09:16:38Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Planned */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Programmer , occasional graphist and hacker.&lt;br /&gt;
&lt;br /&gt;
==Completed==&lt;br /&gt;
[[Rick dangerous 128+]] (2009)&lt;br /&gt;
&lt;br /&gt;
==Prototyped==&lt;br /&gt;
Project [[Wildfire]] (2009-201?)&lt;br /&gt;
&lt;br /&gt;
==Planned==&lt;br /&gt;
[[R-Type]] 128K (2011)&lt;br /&gt;
&lt;br /&gt;
==Tools==&lt;br /&gt;
My CPC toolkit for Windows (2009)&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=R-Type&amp;diff=65875</id>
		<title>R-Type</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=R-Type&amp;diff=65875"/>
				<updated>2010-12-22T17:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* The Game */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Rtype cover.jpg|thumb|200px|R-Type game cover]]&lt;br /&gt;
&lt;br /&gt;
R-Type is a classical and cult Shoot'em up  ported from the famous IREM's arcade game with the same name, released in 1987. &lt;br /&gt;
&lt;br /&gt;
It was ported on almost every computer of the era. And was released on Amstrad CPC in 1988.&lt;br /&gt;
&lt;br /&gt;
And despite being good, it remains an awfull [[Speccy Port]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''You make one little mistake in your life and the internet will never let you live it down....'''''&lt;br /&gt;
&lt;br /&gt;
'''''Electric Dreams / Activision gave me 21 days to do the port. I wish i had the time to do a nice mode 0 port with new graphics, but alas it was never to be.'''''&lt;br /&gt;
&lt;br /&gt;
''Keith A Goodyer at CPCwiki forum, 02/25/2010 ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Game's Informations==&lt;br /&gt;
&lt;br /&gt;
Company : Electric Dreams&lt;br /&gt;
&lt;br /&gt;
Original game by : Bob PAPE&lt;br /&gt;
&lt;br /&gt;
CPC version programmed/ported by : Keith A. GOODYER&lt;br /&gt;
&lt;br /&gt;
Graphics by : MAK COMPUTER GRAPHICS, VIDEO IMAGES&lt;br /&gt;
&lt;br /&gt;
Sound effects by : Richard STEVENSON&lt;br /&gt;
&lt;br /&gt;
==The Fluff==&lt;br /&gt;
&lt;br /&gt;
*The mission : defend the human race against the BYDO threat.&lt;br /&gt;
*The weapon : the R-9 spacefighter, equiped with &amp;quot;the Force&amp;quot;, a fragment of Bydo flesh.&lt;br /&gt;
*The game : R-Type.&lt;br /&gt;
&lt;br /&gt;
Blast off and strike the evil Bydo empire!&lt;br /&gt;
&lt;br /&gt;
==The Game==&lt;br /&gt;
&lt;br /&gt;
Considered nowadays as a classical horizontal shooter, R-Type introduced two revolutionnary concepts in gameplay :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Extra module named &amp;quot;Force&amp;quot; that can be docked on front or behind the player ship.&lt;br /&gt;
*Loaded shot named &amp;quot;Beam&amp;quot;.When you are loading the Beam , its power grows but you can not shot (except additionnal missiles)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mastery of theses features is required if you want to master the game itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If not the first , R-Type was one of the first to introduce features like specific &amp;quot;super&amp;quot; enemies at end of each level called &amp;quot;Boss&amp;quot; , the well known  giant battleship or destructibles levels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With gorgeous &amp;quot;Gigerish&amp;quot; graphics , unforgetable soundtrack , perfect gameplay and innovant level design , R-Type became a legend of the video game.There are a lot of clones and sequels , a lot of shooters got inspiration from this game.&lt;br /&gt;
&lt;br /&gt;
==The Port==&lt;br /&gt;
&lt;br /&gt;
As said above, R-Type on CPC was a Speccy port.&lt;br /&gt;
&lt;br /&gt;
Yet because the spectrum version was perhaps one of the best in the 8 bit area (and many say the best speccy game ever), the Amstrad version remained playable, fun, yet so disapointing... and by far inferior to the Spectrum's one.&lt;br /&gt;
&lt;br /&gt;
It is well known the Amstrad R-Type is perhaps the worst version ever, yet this game remains good.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Animation was a bit sluggish, lacked the smooth moves and precision.&lt;br /&gt;
&lt;br /&gt;
Scrolling was a bit saccaded.&lt;br /&gt;
&lt;br /&gt;
Backgrounds were mono-coloured (a classical Speccy port feature) despite the Mode 1 screen displaying 5 colours...(maybe six...sometimes ?)&lt;br /&gt;
&lt;br /&gt;
As usual, a Raster is included, just for nothing !&lt;br /&gt;
&lt;br /&gt;
Sprites managed to feature a bit more colours, yet were afflicted by pseudo colour attributes : 8x8 pixels tiles were 1 bit coded, but sprites could feature different inks. &lt;br /&gt;
&lt;br /&gt;
Sprites were not masked too, as unmasked sprites were a trick to avoid Colour Clashes on ZX spectrum...&lt;br /&gt;
&lt;br /&gt;
Thanksfully, it still features no colour clashes.&lt;br /&gt;
&lt;br /&gt;
*Comment from Arnoldemu: I looked at the code to discover why R-Type was like this.&lt;br /&gt;
Double buffer is not used, screen is located from &amp;amp;0040. &amp;amp;5800 even has attribute data just like on a real spectrum. &amp;amp;7800 has a copy of the attribute data (maybe double buffered so colours can be changed and then updated quickly). Screen is only updated where necessary. I think the same programmer worked on both the Spectrum and Amstrad version. Ok, start with the Spectrum version, remove some colours because the cpc can only display 4 colours in mode 1 (without using raster tricks), now use 90% Spectrum code and convert graphics at runtime into CPC form colouring them as you do this. The result is R-type. This explains all.. it explains why the colours are bad and why the game is so slow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''It is also to notice that the speccy version was itself ported (graphically) from the Atari ST version.'''&lt;br /&gt;
&lt;br /&gt;
Yet the bad part : it came to Amstrad CPC from the AtariST, but stoped a byte at the Speccy before...&lt;br /&gt;
&lt;br /&gt;
==The good Aspects==&lt;br /&gt;
&lt;br /&gt;
As said the Spectrum version was good.&lt;br /&gt;
&lt;br /&gt;
The main reason was because it was so close and faithfull to the Arcade version (the original).&lt;br /&gt;
&lt;br /&gt;
* In graphics : the fine square pixels (Mode 1) allows fine details.&lt;br /&gt;
* In Gameplay : most enemies patterns were closely respected.&lt;br /&gt;
&lt;br /&gt;
As a result, even the humble Amstrad version was very close to the Arcade, at least in gameplay (even sometimes more than the c64 version).&lt;br /&gt;
&lt;br /&gt;
Also the Amstrad version did include good sound effects too... yet they were too few (and no real music).&lt;br /&gt;
&lt;br /&gt;
It is also notable that the game was quite voluminous, as it included the full 8 levels... and very challenging too.&lt;br /&gt;
&lt;br /&gt;
Last but not least, the intro screen was in Mode0 and quite nice.&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Rtype.png|Intro screen&lt;br /&gt;
Image:rtype_lvl1.png|Level 1&lt;br /&gt;
Image:Rtype1.png|Level 8&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good exemple of pure fail:&lt;br /&gt;
*mono colour backgrounds&lt;br /&gt;
*unmasked sprites.&lt;br /&gt;
*colour attributes.&lt;br /&gt;
&lt;br /&gt;
Yet the original design were faithfully ported and still awesome.&lt;br /&gt;
&lt;br /&gt;
==The Cure==&lt;br /&gt;
&lt;br /&gt;
[[File:RType original level 2 Cpc.gif|800px]]&lt;br /&gt;
&lt;br /&gt;
Original Level 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Level2 plus.bmp|800px]]&lt;br /&gt;
&lt;br /&gt;
Level 2 mock-up, redesigned by MacDeath.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Rtype128k_stage2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Stage 2 map from upcoming 128k version by Easter Egg.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Carnivac games-r type-mode0.png]]&lt;br /&gt;
&lt;br /&gt;
Mode 0 mock-up, courtesy of Carnivac Games.&lt;br /&gt;
&lt;br /&gt;
== Game map == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;R-Type game map&amp;quot;&amp;gt;&lt;br /&gt;
image:rtype map.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Longplay videos==&lt;br /&gt;
&lt;br /&gt;
source : Youtube.&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|t2Vo8dbBJig|300}}&lt;br /&gt;
{{#ev:youtube|G3UWCzzk2To|300}}&lt;br /&gt;
{{#ev:youtube|CmnBO8j7IQY|300}}&lt;br /&gt;
{{#ev:youtube|uxMz7EEDzjQ|300}}&lt;br /&gt;
{{#ev:youtube|Db2MPcuFwn4|300}}&lt;br /&gt;
{{#ev:youtube|oGbL5Da9NE8|300}}&lt;br /&gt;
{{#ev:youtube|arINXwvGdzQ|300}}&lt;br /&gt;
{{#ev:youtube|biTJY89DT0s|300}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*{{CPCPower|1848}}&lt;br /&gt;
*[http://www.irem.co.jp/e/official/r/index.html Official R-Type page at Irem web site]&lt;br /&gt;
*[http://www.sitedesteph.freesurf.fr/rtype/index.php A good site in French]&lt;br /&gt;
*{{EnWiki}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Games]]&lt;br /&gt;
[[Category:Games 1988]]&lt;br /&gt;
[[Category:Video contents]]&lt;br /&gt;
[[Category:Shoot them Up]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=R-Type&amp;diff=65871</id>
		<title>R-Type</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=R-Type&amp;diff=65871"/>
				<updated>2010-12-22T12:28:23Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* The Game */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Rtype cover.jpg|thumb|200px|R-Type game cover]]&lt;br /&gt;
&lt;br /&gt;
R-Type is a classical and cult Shoot'em up  ported from the famous IREM's arcade game with the same name, released in 1987. &lt;br /&gt;
&lt;br /&gt;
It was ported on almost every computer of the era. And was released on Amstrad CPC in 1988.&lt;br /&gt;
&lt;br /&gt;
And despite being good, it remains an awfull [[Speccy Port]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''You make one little mistake in your life and the internet will never let you live it down....'''''&lt;br /&gt;
&lt;br /&gt;
'''''Electric Dreams / Activision gave me 21 days to do the port. I wish i had the time to do a nice mode 0 port with new graphics, but alas it was never to be.'''''&lt;br /&gt;
&lt;br /&gt;
''Keith A Goodyer at CPCwiki forum, 02/25/2010 ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Game's Informations==&lt;br /&gt;
&lt;br /&gt;
Company : Electric Dreams&lt;br /&gt;
&lt;br /&gt;
Original game by : Bob PAPE&lt;br /&gt;
&lt;br /&gt;
CPC version programmed/ported by : Keith A. GOODYER&lt;br /&gt;
&lt;br /&gt;
Graphics by : MAK COMPUTER GRAPHICS, VIDEO IMAGES&lt;br /&gt;
&lt;br /&gt;
Sound effects by : Richard STEVENSON&lt;br /&gt;
&lt;br /&gt;
==The Fluff==&lt;br /&gt;
&lt;br /&gt;
*The mission : defend the human race against the BYDO threat.&lt;br /&gt;
*The weapon : the R-9 spacefighter, equiped with &amp;quot;the Force&amp;quot;, a fragment of Bydo flesh.&lt;br /&gt;
*The game : R-Type.&lt;br /&gt;
&lt;br /&gt;
Blast off and strike the evil Bydo empire!&lt;br /&gt;
&lt;br /&gt;
==The Game==&lt;br /&gt;
&lt;br /&gt;
Considered noway days as a classical horizontal shooter, R-Type introduced two revolutionnary concepts in gameplay :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Extra module named &amp;quot;Force&amp;quot; that can be docked on front or behind the player ship.&lt;br /&gt;
*Loaded shot named &amp;quot;Beam&amp;quot;.When you are loading the Beam , its power grows but you can not shot (except additionnal missiles)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mastery of theses features is required if you want to master the game itself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If not the first , R-Type was one of the first to introduce features like specific &amp;quot;super&amp;quot; enemies at end of each level called &amp;quot;Boss&amp;quot; , the well known  giant battleship or destructibles levels.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With gorgeous &amp;quot;Gigerish&amp;quot; graphics , unforgetable soundtrack , perfect gameplay and innovant level design , R-Type became a legend of the wideo game.There are a lot of clones and sequels , a lot of shooters got inspiration from this game.&lt;br /&gt;
&lt;br /&gt;
==The Port==&lt;br /&gt;
&lt;br /&gt;
As said above, R-Type on CPC was a Speccy port.&lt;br /&gt;
&lt;br /&gt;
Yet because the spectrum version was perhaps one of the best in the 8 bit area (and many say the best speccy game ever), the Amstrad version remained playable, fun, yet so disapointing... and by far inferior to the Spectrum's one.&lt;br /&gt;
&lt;br /&gt;
It is well known the Amstrad R-Type is perhaps the worst version ever, yet this game remains good.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Animation was a bit sluggish, lacked the smooth moves and precision.&lt;br /&gt;
&lt;br /&gt;
Scrolling was a bit saccaded.&lt;br /&gt;
&lt;br /&gt;
Backgrounds were mono-coloured (a classical Speccy port feature) despite the Mode 1 screen displaying 5 colours...(maybe six...sometimes ?)&lt;br /&gt;
&lt;br /&gt;
As usual, a Raster is included, just for nothing !&lt;br /&gt;
&lt;br /&gt;
Sprites managed to feature a bit more colours, yet were afflicted by pseudo colour attributes : 8x8 pixels tiles were 1 bit coded, but sprites could feature different inks. &lt;br /&gt;
&lt;br /&gt;
Sprites were not masked too, as unmasked sprites were a trick to avoid Colour Clashes on ZX spectrum...&lt;br /&gt;
&lt;br /&gt;
Thanksfully, it still features no colour clashes.&lt;br /&gt;
&lt;br /&gt;
*Comment from Arnoldemu: I looked at the code to discover why R-Type was like this.&lt;br /&gt;
Double buffer is not used, screen is located from &amp;amp;0040. &amp;amp;5800 even has attribute data just like on a real spectrum. &amp;amp;7800 has a copy of the attribute data (maybe double buffered so colours can be changed and then updated quickly). Screen is only updated where necessary. I think the same programmer worked on both the Spectrum and Amstrad version. Ok, start with the Spectrum version, remove some colours because the cpc can only display 4 colours in mode 1 (without using raster tricks), now use 90% Spectrum code and convert graphics at runtime into CPC form colouring them as you do this. The result is R-type. This explains all.. it explains why the colours are bad and why the game is so slow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''It is also to notice that the speccy version was itself ported (graphically) from the Atari ST version.'''&lt;br /&gt;
&lt;br /&gt;
Yet the bad part : it came to Amstrad CPC from the AtariST, but stoped a byte at the Speccy before...&lt;br /&gt;
&lt;br /&gt;
==The good Aspects==&lt;br /&gt;
&lt;br /&gt;
As said the Spectrum version was good.&lt;br /&gt;
&lt;br /&gt;
The main reason was because it was so close and faithfull to the Arcade version (the original).&lt;br /&gt;
&lt;br /&gt;
* In graphics : the fine square pixels (Mode 1) allows fine details.&lt;br /&gt;
* In Gameplay : most enemies patterns were closely respected.&lt;br /&gt;
&lt;br /&gt;
As a result, even the humble Amstrad version was very close to the Arcade, at least in gameplay (even sometimes more than the c64 version).&lt;br /&gt;
&lt;br /&gt;
Also the Amstrad version did include good sound effects too... yet they were too few (and no real music).&lt;br /&gt;
&lt;br /&gt;
It is also notable that the game was quite voluminous, as it included the full 8 levels... and very challenging too.&lt;br /&gt;
&lt;br /&gt;
Last but not least, the intro screen was in Mode0 and quite nice.&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Rtype.png|Intro screen&lt;br /&gt;
Image:rtype_lvl1.png|Level 1&lt;br /&gt;
Image:Rtype1.png|Level 8&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good exemple of pure fail:&lt;br /&gt;
*mono colour backgrounds&lt;br /&gt;
*unmasked sprites.&lt;br /&gt;
*colour attributes.&lt;br /&gt;
&lt;br /&gt;
Yet the original design were faithfully ported and still awesome.&lt;br /&gt;
&lt;br /&gt;
==The Cure==&lt;br /&gt;
&lt;br /&gt;
[[File:RType original level 2 Cpc.gif|800px]]&lt;br /&gt;
&lt;br /&gt;
Original Level 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Level2 plus.bmp|800px]]&lt;br /&gt;
&lt;br /&gt;
Level 2 mock-up, redesigned by MacDeath.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Rtype128k_stage2.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Stage 2 map from upcoming 128k version by Easter Egg.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Carnivac games-r type-mode0.png]]&lt;br /&gt;
&lt;br /&gt;
Mode 0 mock-up, courtesy of Carnivac Games.&lt;br /&gt;
&lt;br /&gt;
== Game map == &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;R-Type game map&amp;quot;&amp;gt;&lt;br /&gt;
image:rtype map.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Longplay videos==&lt;br /&gt;
&lt;br /&gt;
source : Youtube.&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|t2Vo8dbBJig|300}}&lt;br /&gt;
{{#ev:youtube|G3UWCzzk2To|300}}&lt;br /&gt;
{{#ev:youtube|CmnBO8j7IQY|300}}&lt;br /&gt;
{{#ev:youtube|uxMz7EEDzjQ|300}}&lt;br /&gt;
{{#ev:youtube|Db2MPcuFwn4|300}}&lt;br /&gt;
{{#ev:youtube|oGbL5Da9NE8|300}}&lt;br /&gt;
{{#ev:youtube|arINXwvGdzQ|300}}&lt;br /&gt;
{{#ev:youtube|biTJY89DT0s|300}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
&lt;br /&gt;
*{{CPCPower|1848}}&lt;br /&gt;
*[http://www.irem.co.jp/e/official/r/index.html Official R-Type page at Irem web site]&lt;br /&gt;
*[http://www.sitedesteph.freesurf.fr/rtype/index.php A good site in French]&lt;br /&gt;
*{{EnWiki}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Games]]&lt;br /&gt;
[[Category:Games 1988]]&lt;br /&gt;
[[Category:Video contents]]&lt;br /&gt;
[[Category:Shoot them Up]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Rtype_lvl1.png&amp;diff=65864</id>
		<title>File:Rtype lvl1.png</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Rtype_lvl1.png&amp;diff=65864"/>
				<updated>2010-12-21T12:42:27Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: uploaded a new version of &amp;amp;quot;File:Rtype lvl1.png&amp;amp;quot;: (alien was cut)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Rtype_lvl1.png&amp;diff=65863</id>
		<title>File:Rtype lvl1.png</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Rtype_lvl1.png&amp;diff=65863"/>
				<updated>2010-12-21T12:40:27Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: uploaded a new version of &amp;amp;quot;File:Rtype lvl1.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Xcontra&amp;diff=63155</id>
		<title>Xcontra</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Xcontra&amp;diff=63155"/>
				<updated>2010-11-17T12:47:50Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''XContra'' is a playable preview by [[Face Hugger]] released in 1994. It is based on the game ''Contra'', which was known as ''Gryzor'' on the Amstrad CPC. The game itself was never finished.&lt;br /&gt;
&lt;br /&gt;
The game features nice, colourful graphics and excellent sideways scrolling, although it is not possible to kill any of the monsters that appear on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;Screenshots&amp;quot;&amp;gt;&lt;br /&gt;
Image:XCONTRA screenshot 1.gif|&lt;br /&gt;
Image:XCONTRA screenshot 2.gif|&lt;br /&gt;
Image:XCONTRA screenshot 3.gif|&amp;lt;center&amp;gt;Mario is the guest star&amp;lt;/center&amp;gt;&lt;br /&gt;
Image:XCONTRA screenshot 5.gif|&amp;lt;center&amp;gt;A nice large animated end-of-level monster&amp;lt;/center&amp;gt;&lt;br /&gt;
Image:XCONTRA screenshot 4.gif|&amp;lt;center&amp;gt;A 'bug' in the last level!&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source Code==&lt;br /&gt;
&lt;br /&gt;
Source code from [[Face Hugger]]&lt;br /&gt;
&lt;br /&gt;
[[media:XContra.zip]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Demos]][[Category:Demos 1994]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:XContra.zip&amp;diff=63154</id>
		<title>File:XContra.zip</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:XContra.zip&amp;diff=63154"/>
				<updated>2010-11-17T12:42:24Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: Source code for the Xcontra game prototype&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Source code for the Xcontra game prototype&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Guide_on_how_to_connect_a_3.5%22_drive_to_a_CPC6128/664&amp;diff=63125</id>
		<title>Guide on how to connect a 3.5&quot; drive to a CPC6128/664</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Guide_on_how_to_connect_a_3.5%22_drive_to_a_CPC6128/664&amp;diff=63125"/>
				<updated>2010-11-11T09:42:28Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Errors at this point */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Guide to hook up a 3.5&amp;quot; pc drive to your Amstrad CPC 6128 or 664 (For non-techy people like me).'''&amp;lt;br&amp;gt; You can also check out another guide [[Guide on how to connect a 3.5 | here]]&lt;br /&gt;
&lt;br /&gt;
This guide is for people who own 6128/664 cpc's that has the 34 pin EDGE connector type interfaces. I know that people in the UK and DK has the Edge connectors.&lt;br /&gt;
&lt;br /&gt;
People in Germany use the CENTRONICS type connectors also some of the cpc PLUS range use Centronics. Centronics users need a different kind of cable. &lt;br /&gt;
&lt;br /&gt;
== What you need (minimum requirements)==&lt;br /&gt;
&lt;br /&gt;
- a pc 3.5&amp;quot; floppy drive &lt;br /&gt;
- a old style pc floppy cable &lt;br /&gt;
- a paperclip or a small piece of wire &lt;br /&gt;
- a powersource for the drive &lt;br /&gt;
- a 3.5&amp;quot; floppy disc &lt;br /&gt;
&lt;br /&gt;
Suggest u also get: &lt;br /&gt;
&lt;br /&gt;
- pins &amp;amp; jumpers or maybe some real switches. &lt;br /&gt;
- tape &lt;br /&gt;
&lt;br /&gt;
== The Cable ==&lt;br /&gt;
&lt;br /&gt;
By some amazing luck the 6128/664 use the exact same floppy-connector as a old 5.25&amp;quot; pc floppy drive. So all you need to connect up is a old style pc floppy cable that has both the old style 5.25&amp;quot; large edge connector and new style 3.5&amp;quot; small pc floppy connector. &lt;br /&gt;
Hardest part is probably to get one of these cables as they havnt really been used in years. If you have a 486 pc or older, try peeking inside to see if it has one of these cables, then you can easily borrow and replace it with a new style cable. &lt;br /&gt;
&lt;br /&gt;
Looks like so: &lt;br /&gt;
&lt;br /&gt;
[[Image:BelkinFloppy1.JPG|400px]]&lt;br /&gt;
 &lt;br /&gt;
But let give you a hand. BELKIN still sells this cable, I got mine locally but this one looks like its the one:&lt;br /&gt;
&lt;br /&gt;
http://www.amazon.co.uk/Belkin-Universa ... 36&amp;amp;sr=8-16&lt;br /&gt;
&lt;br /&gt;
This is the 5 connector one, but a 3 connector one may also work if it has the right &lt;br /&gt;
kind/amount of connectors. &lt;br /&gt;
&lt;br /&gt;
== The pc 3.5&amp;quot; Floppy drive ==&lt;br /&gt;
&lt;br /&gt;
So far all the 3.5&amp;quot; drives ive tested all worked. The question is if you want a drive that is both compatible with 720kb floppies AND 1.44mb floppies. &lt;br /&gt;
All drives SEEM to work flawlessly with 720kb floppies .. but for some reason .. you get a LOT of read errors with SOME drives when you insert a 1.44mb floppy? &lt;br /&gt;
&lt;br /&gt;
Quick fix: Use 720kb floppies only. 720kb floppies are hard to get, so just make some yourself from 1.44 floppies. Tape over the little &amp;quot;High Density&amp;quot; hole in the top left (both sides). That way the drive will think the floppy is 720kb only and act accordingly. Works Great. &lt;br /&gt;
&lt;br /&gt;
[[Image:Floppies1.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Slow fix ===&lt;br /&gt;
&lt;br /&gt;
find a drive that works with both size of floppies. &lt;br /&gt;
I say: a old TEAC FD-235HF drive works with both size floppies. &lt;br /&gt;
Hearsay from other sites: Alps &amp;amp; Mitsumi drives MAY work fully. &lt;br /&gt;
One way or the other i use the tape mod on all my 1.44mb floppies because it makes them compatible with all the drives i have. &lt;br /&gt;
&lt;br /&gt;
=== Paperclip &amp;amp; more ===&lt;br /&gt;
&lt;br /&gt;
All you really need is one piece of paperclip (the metal kind) to be able to make a single short on the floppy cable, but it would probably be better to get some proper pins and jumpers or some real small wires. Also if you wanna do some really fansy stuff, you might wanna get at least 3 paperclips/wires/pins/jumpers. (se later) &lt;br /&gt;
Motherboard pins are usually sold in long rows where you can break of smaller parts, like a set of 2 pins, then use normal pc jumpers on em to quickly set on/off. &lt;br /&gt;
&lt;br /&gt;
[[Image:PinsJumpers1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
== Powersource == &lt;br /&gt;
&lt;br /&gt;
You need to power the 3.5&amp;quot; floppy drive somehow. A normal pc powersupply will do this quite nicely but there are &amp;quot;complications&amp;quot;. A modern powersupply dosnt turn fully on unless it detects a motherboard is present. &lt;br /&gt;
There is 3 possible solutions to this problem:&lt;br /&gt;
&lt;br /&gt;
1. drag a whole pc up next to your amstrad so u can power the floppy that way. &lt;br /&gt;
&lt;br /&gt;
2. use another way to power the floppy. &lt;br /&gt;
&lt;br /&gt;
3. cheat a modern pc powersupply to think a motherboard is present. Fooling a modern powersupply isnt really that hard .. all &lt;br /&gt;
u need is to connect the GREEN wire (ready signal) with one of the BLACK wires (ground). This works with both the 20 pin powersupplys and the newer 24 pin ones. Here is a shot of my 20 pin one: &lt;br /&gt;
&lt;br /&gt;
[[Image:Psu20pin1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
Connected the green pin 14 wire with the black pin 13 wire. Note that i used pin 13 just because it was right next to pin 14 .. but any other black wire will work just as well. &lt;br /&gt;
The newer 24 pin powersupply can be fixed just like that, but note that the green wire is pin 16 on the 24 pin one. So a possible setup on the 24 pin setup could be green pin 16 connected with black pin 15.&lt;br /&gt;
&lt;br /&gt;
=== More about powersupply pin layout here ===&lt;br /&gt;
&lt;br /&gt;
20pin: http://www.hardwarebook.info/ATX_Power_Supply &lt;br /&gt;
24pin: http://www.hardwarebook.info/ATX_v2.2_Power_Supply &lt;br /&gt;
&lt;br /&gt;
Note that VERY old powersupplies USED to turn on fully by themselves, so if u have a REALLY old pc u can see if it works. &lt;br /&gt;
&lt;br /&gt;
=== Setting it all up ===&lt;br /&gt;
&lt;br /&gt;
All u do is basicly the same as if you would hook up a FD1 drive to a cpc 6128. No soldering or disassembly required. Just hook up the cable to the DRIVE connetor on the Amstrad and the Floppy drive to the next edge connector on the cable. &lt;br /&gt;
Pretty hard to get it wrong as the edge connector only fits one way and usually the same is said the floppy connector. BUT .. there IS a few floppy drives that have the pins upside down, so u might need to twist the cable around once .. most likely not tho. &lt;br /&gt;
&lt;br /&gt;
[[Image:CableOn1.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
Note that this type of pc cable usually has some internally twisted cables .. make sure the CPC/PC does NOT have the twisted bit between them.&lt;br /&gt;
&lt;br /&gt;
[[Image:IMGP1639 50%.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
You can process the same way with only 1 drive 3&amp;quot;5 and 5&amp;quot;1/4 connectors , you can use the 3&amp;quot;5 connector before the edge card connector instead.&lt;br /&gt;
&lt;br /&gt;
=== Setting the READY signal ===&lt;br /&gt;
&lt;br /&gt;
Last thing you need to do is set the ready signal. This is done by connecting pin 33 and 34. Its the last 2 pins on the cable. Use a bend paperclip or a small wire to short the 2 pins like so (Marked in WHITE): &lt;br /&gt;
&lt;br /&gt;
[[Image:CableClose1.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
Thats it. Now u SHOULD have a fully working 3.5&amp;quot; B drive. &lt;br /&gt;
&lt;br /&gt;
1. Power on the floppy first. &lt;br /&gt;
&lt;br /&gt;
2. Then turn on the cpc.&lt;br /&gt;
&lt;br /&gt;
=== Errors at this point ===&lt;br /&gt;
&lt;br /&gt;
- You turn on the cpc but get a blank/rolling screen? '''Most likely the pc cable connector needs to be flipped over (pins are upside down)'''. &lt;br /&gt;
&lt;br /&gt;
Type &amp;quot;|B&amp;quot; to change to drive B in basic (where ø is the rsx char). A simple CAT will show if the disc/drive works.&lt;br /&gt;
&lt;br /&gt;
=== Other Errors at this point ===&lt;br /&gt;
&lt;br /&gt;
- Bad Command? Floppy drive detected by cpc but is not powered. Recheck your powersupply is connected and working. - You turn on the cpc and both drives act-as-one .. and the floppy light is constantly on? Most likely you didnt short pin 33 &amp;amp;amp; 34 .. is the paperclip/wire loose? .. or did you accidentally short pin 1 &amp;amp;amp; 2 instead? Try moving the paperclip to the other end of the connector. - Read error on drive? Disc hasnt been formatted yet? Use software like Discology to quickly format drive B .. or to quicky copy a disc from A to B .. or make a test floppy on pc (see transfer bit later). - Disc is write protected error? Make sure the write tab on the disc is down (move tab down on right side of disc).&lt;br /&gt;
&lt;br /&gt;
== Two heads (OPTIONAL) ==&lt;br /&gt;
&lt;br /&gt;
Ok, everything is working so far? Want to do some more advanced stuff like using 2 sides on your floppy? &lt;br /&gt;
&lt;br /&gt;
Easy enough .. right now your floppy is using head 1 (aka side 1).. if you also connect pin 31 and 32 it will change to side/head 2. Remove the short again to get back to side/head 1. &lt;br /&gt;
I must admit that i myself only use one side/head because i cant be bother with the switching sides/heads. But it might be worth it if you buy one of them fansy on/off switches from a electronics shop. &lt;br /&gt;
Pin 31&amp;amp;32 is marked in RED on picture.&lt;br /&gt;
&lt;br /&gt;
== Making floppy primary drive(OPTIONAL) ==&lt;br /&gt;
&lt;br /&gt;
Donno if you have ever tried running software straight from a B drive, but it usually sucks badly (software freeze up). Wouldnt it be nice to if you could turn drive B into drive A (and A into B)? Connect up pin 11 &amp;amp; 12 while the drive is on to do the drive switcheroo. Marked in BLUE (sixth pair of pins from top). &lt;br /&gt;
Make sure to remove the short after you have turned off the whole thing (or you will get a drives-act-as-one error on next bootup). So you will have to set the 11/12 pin each time you wanna do the drive switching .. This one however seems quite usefull .. off to the shop to get a switch  &lt;br /&gt;
&lt;br /&gt;
Another closeup of all 3 pairs of pins without doodlin: &lt;br /&gt;
&lt;br /&gt;
[[Image:SuperClose1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
== And up and running ==&lt;br /&gt;
&lt;br /&gt;
[[Image:AllUpAndRunning1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
Transfering software between CPC and PC: &lt;br /&gt;
&lt;br /&gt;
Yup, a pc can read and write those 3.5&amp;quot; Amstrad formatted floppies. There is a handfull of pc utilities that can read/write to the floppies. &lt;br /&gt;
&lt;br /&gt;
I suggest getting CPCDiskXP by Oscar Sanchez from http://www.cpcmania.com/ &lt;br /&gt;
&lt;br /&gt;
It reads a 1 side in about 100 seconds (with verify) .. and writing back 1 side takes about 25 second Runs in Windows XP/Vista using a nice lowlevel driver that you might recognise from Amiga- and Atari ST-discs reading pc tools. &lt;br /&gt;
Note that you can only use floppies from a INTERNAL floppy drive (a usb one wont work). &lt;br /&gt;
Seems to me that only the Amstrad is picky about if u use 1.44mb or 720kb floppies .. the pc has no such troubles, so ANY floppy drive may work on pc (from my experience). Also the tape-down-1.44-to-720-floppy-fix works on pc too. &lt;br /&gt;
&lt;br /&gt;
== Things that pop'ed into my head reading up on all this == &lt;br /&gt;
&lt;br /&gt;
Using a whole pc to power the floppy is getting annoing and uncompfy, so my brain has been thinking in overdrive to come up with a solution. &lt;br /&gt;
&lt;br /&gt;
1. use a normal external-IDE-HDD-USB-enclosure to power the drive .. All you need it the enclosure (with its powersupply) .. then fit a Y-split cable (a IDE-power to Floppy-power one). This is possible if u can find the Y-split cable: &lt;br /&gt;
&lt;br /&gt;
[[Image:Ycable1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
2. use a usb-floppy drive .. dissassemble it and hook it up to pc or Wii or xbox 360 or pc or .. Donno if this is possible .. or if you need yet another type of Y-cable or other. Would look nice with one of them slimline usb-drives. &lt;br /&gt;
&lt;br /&gt;
3. Not a tech wizz at all, but all u need to power a floppy is 5V ?? or do you also need the 12V too? Anyways, a couple of batteries on row might do that easy-ish. &lt;br /&gt;
&lt;br /&gt;
== Worries and what not ==&lt;br /&gt;
&lt;br /&gt;
What if i hook something up wrong will my Amstrad break? Nah, dont think so, I mean I did EVERYTHING wrong at least twice and both 6128 &amp;amp;amp; 664 is still alive and running. Also I tried a LOT of things myself before with a FD1 cable and such. Still we are talking about electronics and all that, so do be carefull, and dont forget that everything should fit nicely .. no reason to force anything. OMG OMG my precius 20+ year old gem of a Amstrad just blew up in my face, will you takes full responsibility and buy me a new one? Eh?, sure i will .. not.&lt;br /&gt;
&lt;br /&gt;
== FAQ == &lt;br /&gt;
&lt;br /&gt;
Q: Can I use a FD1 cable to connect a 3.5&amp;quot; floppy drive? &lt;br /&gt;
&lt;br /&gt;
A: In theory yes, but its hard to set the ready signal. Connecting pin 33&amp;amp;34 is probably best done on the drive itself with a small piece of wire/metal. People who can solder will know how to fix the cable itself tho. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can i hook up a 3.5&amp;quot; to a cpc 464 like this? &lt;br /&gt;
&lt;br /&gt;
A: No. Hooking up a 3.5&amp;quot; isnt possible without some serious soldering and you also need that DDI interface. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can i use a 3.5&amp;quot; on a 6128+ ? &lt;br /&gt;
&lt;br /&gt;
A: Sure you can, but u need to make a cable that fits the the Centronics connector and since the pins is a bit upside down with the 6128+ its a bit more on the technical side. Look here for more: &lt;br /&gt;
&lt;br /&gt;
http://www.pcwking1.netfirms.com/helpage34.html &lt;br /&gt;
http://genesis8.free.fr/amstrad/faq/ &lt;br /&gt;
http://www.zettweb.com/semiconductors/h ... drive.html &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: I got one of those german Schneider 6128 with Centronics connector? &lt;br /&gt;
&lt;br /&gt;
A: Sure, but just like 6128+ its a bit more technical and need a special interface/cable made.&lt;br /&gt;
&lt;br /&gt;
Look here:&lt;br /&gt;
&lt;br /&gt;
http://www.amstrad-cpc.de/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: The floppy drive isnt registered at all .. not even getting errors? &lt;br /&gt;
&lt;br /&gt;
A: Try cleaning the connector on the Amstrad. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can I use those odd format discs on the 3.5&amp;quot; ? &lt;br /&gt;
&lt;br /&gt;
A: 41 track &amp;amp; other Amstrad formats works fine. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can i use the fully 720kb on the floppy? &lt;br /&gt;
&lt;br /&gt;
A: You need a special rom like Parados to replace Amsdos to do that. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can i use a 3.5&amp;quot; floppy drive internally in my 6128/664? &lt;br /&gt;
&lt;br /&gt;
A: Well, sure but u need to make another special cable bacause the real internal cable is a lot smaller than the usual pc floppy cable. Also you will need a power converter cable if u want to power the floppy from the inside. If you do use it internally you wont have to set the &amp;quot;primary&amp;quot; pin 11 &amp;amp; 12 as it is already primary. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Thanks goes to == &lt;br /&gt;
&lt;br /&gt;
- [[Executioner]], [[UKmarkh]], [[JMD]], [[Wanderer]], [[Zeropolis79]], [[Gryzor]] and [[Ptr]] for great help and contributions to the guide. &lt;br /&gt;
&lt;br /&gt;
- Everybody in the [http://cpczone.net Cpczone.net] forums for putting up with my rantings &lt;br /&gt;
&lt;br /&gt;
- Anyone online who i stole info from&lt;br /&gt;
&lt;br /&gt;
== Sorry About ==&lt;br /&gt;
&lt;br /&gt;
I may have made a few assumtions .. especially about the floppy compatability based on from my own experiences and such. If im wrong let me know  &lt;br /&gt;
&lt;br /&gt;
My eeiiieenglish isnt the most fluid and correct spelled and all that, but is readable I hope. &lt;br /&gt;
&lt;br /&gt;
== Links to other sites about 3.5&amp;quot; floppy drive hookup ==&lt;br /&gt;
[[Guide on how to connect a 3.5]] Another local guide&lt;br /&gt;
&lt;br /&gt;
http://www.cpcmania.com/ (Spanish &amp;amp; English) &lt;br /&gt;
&lt;br /&gt;
http://www.phenixinformatique.com/secti ... e&amp;amp;artid=67 (French) &lt;br /&gt;
&lt;br /&gt;
http://www.amstradtoday.com/elements/up ... cteur2.htm (French) &lt;br /&gt;
&lt;br /&gt;
http://www.terra.es/personal/diegovp/ (Spanish) &lt;br /&gt;
&lt;br /&gt;
http://usuarios.lycos.es/putusoft/emucpc/softwaree.htm (Spanish) &lt;br /&gt;
&lt;br /&gt;
== Great sources about anything CPC (including 3.5&amp;quot; connecting) ==&lt;br /&gt;
&lt;br /&gt;
http://genesis8.free.fr/amstrad/faq/index.php or &lt;br /&gt;
&lt;br /&gt;
http://www.faqs.org/faqs/amstrad8bit-faq/ (English/French/Dutch/German/Spanish) &lt;br /&gt;
&lt;br /&gt;
http://www.cpcwiki.eu/index.php/Techni ... umentation (English) &lt;br /&gt;
&lt;br /&gt;
http://www.amstrad-cpc.de/ (German) &lt;br /&gt;
&lt;br /&gt;
== Tools to read CPC floppies on pc ==&lt;br /&gt;
&lt;br /&gt;
CPCDiskXP: http://www.cpcmania.com/&lt;br /&gt;
 &lt;br /&gt;
ManageDsk: http://amstrad.cpc.free.fr/download.php ... es&amp;amp;sortby= &lt;br /&gt;
&lt;br /&gt;
22DISK: http://www.znode51.de/specials/22disk/ &lt;br /&gt;
&lt;br /&gt;
ReadDSK/WriteDSK: http://www.julien-nevo.com/arkos/tools.html &lt;br /&gt;
&lt;br /&gt;
CDPRead/CDPWrite: http://www.caprice32.cybercube.com/downloads.php &lt;br /&gt;
&lt;br /&gt;
'''Cholo'''&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:Peripherals]] [[Category:DIY]][[Category:DATA Storage]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Guide_on_how_to_connect_a_3.5%22_drive_to_a_CPC6128/664&amp;diff=63124</id>
		<title>Guide on how to connect a 3.5&quot; drive to a CPC6128/664</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Guide_on_how_to_connect_a_3.5%22_drive_to_a_CPC6128/664&amp;diff=63124"/>
				<updated>2010-11-11T09:40:46Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: /* Setting it all up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Guide to hook up a 3.5&amp;quot; pc drive to your Amstrad CPC 6128 or 664 (For non-techy people like me).'''&amp;lt;br&amp;gt; You can also check out another guide [[Guide on how to connect a 3.5 | here]]&lt;br /&gt;
&lt;br /&gt;
This guide is for people who own 6128/664 cpc's that has the 34 pin EDGE connector type interfaces. I know that people in the UK and DK has the Edge connectors.&lt;br /&gt;
&lt;br /&gt;
People in Germany use the CENTRONICS type connectors also some of the cpc PLUS range use Centronics. Centronics users need a different kind of cable. &lt;br /&gt;
&lt;br /&gt;
== What you need (minimum requirements)==&lt;br /&gt;
&lt;br /&gt;
- a pc 3.5&amp;quot; floppy drive &lt;br /&gt;
- a old style pc floppy cable &lt;br /&gt;
- a paperclip or a small piece of wire &lt;br /&gt;
- a powersource for the drive &lt;br /&gt;
- a 3.5&amp;quot; floppy disc &lt;br /&gt;
&lt;br /&gt;
Suggest u also get: &lt;br /&gt;
&lt;br /&gt;
- pins &amp;amp; jumpers or maybe some real switches. &lt;br /&gt;
- tape &lt;br /&gt;
&lt;br /&gt;
== The Cable ==&lt;br /&gt;
&lt;br /&gt;
By some amazing luck the 6128/664 use the exact same floppy-connector as a old 5.25&amp;quot; pc floppy drive. So all you need to connect up is a old style pc floppy cable that has both the old style 5.25&amp;quot; large edge connector and new style 3.5&amp;quot; small pc floppy connector. &lt;br /&gt;
Hardest part is probably to get one of these cables as they havnt really been used in years. If you have a 486 pc or older, try peeking inside to see if it has one of these cables, then you can easily borrow and replace it with a new style cable. &lt;br /&gt;
&lt;br /&gt;
Looks like so: &lt;br /&gt;
&lt;br /&gt;
[[Image:BelkinFloppy1.JPG|400px]]&lt;br /&gt;
 &lt;br /&gt;
But let give you a hand. BELKIN still sells this cable, I got mine locally but this one looks like its the one:&lt;br /&gt;
&lt;br /&gt;
http://www.amazon.co.uk/Belkin-Universa ... 36&amp;amp;sr=8-16&lt;br /&gt;
&lt;br /&gt;
This is the 5 connector one, but a 3 connector one may also work if it has the right &lt;br /&gt;
kind/amount of connectors. &lt;br /&gt;
&lt;br /&gt;
== The pc 3.5&amp;quot; Floppy drive ==&lt;br /&gt;
&lt;br /&gt;
So far all the 3.5&amp;quot; drives ive tested all worked. The question is if you want a drive that is both compatible with 720kb floppies AND 1.44mb floppies. &lt;br /&gt;
All drives SEEM to work flawlessly with 720kb floppies .. but for some reason .. you get a LOT of read errors with SOME drives when you insert a 1.44mb floppy? &lt;br /&gt;
&lt;br /&gt;
Quick fix: Use 720kb floppies only. 720kb floppies are hard to get, so just make some yourself from 1.44 floppies. Tape over the little &amp;quot;High Density&amp;quot; hole in the top left (both sides). That way the drive will think the floppy is 720kb only and act accordingly. Works Great. &lt;br /&gt;
&lt;br /&gt;
[[Image:Floppies1.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Slow fix ===&lt;br /&gt;
&lt;br /&gt;
find a drive that works with both size of floppies. &lt;br /&gt;
I say: a old TEAC FD-235HF drive works with both size floppies. &lt;br /&gt;
Hearsay from other sites: Alps &amp;amp; Mitsumi drives MAY work fully. &lt;br /&gt;
One way or the other i use the tape mod on all my 1.44mb floppies because it makes them compatible with all the drives i have. &lt;br /&gt;
&lt;br /&gt;
=== Paperclip &amp;amp; more ===&lt;br /&gt;
&lt;br /&gt;
All you really need is one piece of paperclip (the metal kind) to be able to make a single short on the floppy cable, but it would probably be better to get some proper pins and jumpers or some real small wires. Also if you wanna do some really fansy stuff, you might wanna get at least 3 paperclips/wires/pins/jumpers. (se later) &lt;br /&gt;
Motherboard pins are usually sold in long rows where you can break of smaller parts, like a set of 2 pins, then use normal pc jumpers on em to quickly set on/off. &lt;br /&gt;
&lt;br /&gt;
[[Image:PinsJumpers1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
== Powersource == &lt;br /&gt;
&lt;br /&gt;
You need to power the 3.5&amp;quot; floppy drive somehow. A normal pc powersupply will do this quite nicely but there are &amp;quot;complications&amp;quot;. A modern powersupply dosnt turn fully on unless it detects a motherboard is present. &lt;br /&gt;
There is 3 possible solutions to this problem:&lt;br /&gt;
&lt;br /&gt;
1. drag a whole pc up next to your amstrad so u can power the floppy that way. &lt;br /&gt;
&lt;br /&gt;
2. use another way to power the floppy. &lt;br /&gt;
&lt;br /&gt;
3. cheat a modern pc powersupply to think a motherboard is present. Fooling a modern powersupply isnt really that hard .. all &lt;br /&gt;
u need is to connect the GREEN wire (ready signal) with one of the BLACK wires (ground). This works with both the 20 pin powersupplys and the newer 24 pin ones. Here is a shot of my 20 pin one: &lt;br /&gt;
&lt;br /&gt;
[[Image:Psu20pin1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
Connected the green pin 14 wire with the black pin 13 wire. Note that i used pin 13 just because it was right next to pin 14 .. but any other black wire will work just as well. &lt;br /&gt;
The newer 24 pin powersupply can be fixed just like that, but note that the green wire is pin 16 on the 24 pin one. So a possible setup on the 24 pin setup could be green pin 16 connected with black pin 15.&lt;br /&gt;
&lt;br /&gt;
=== More about powersupply pin layout here ===&lt;br /&gt;
&lt;br /&gt;
20pin: http://www.hardwarebook.info/ATX_Power_Supply &lt;br /&gt;
24pin: http://www.hardwarebook.info/ATX_v2.2_Power_Supply &lt;br /&gt;
&lt;br /&gt;
Note that VERY old powersupplies USED to turn on fully by themselves, so if u have a REALLY old pc u can see if it works. &lt;br /&gt;
&lt;br /&gt;
=== Setting it all up ===&lt;br /&gt;
&lt;br /&gt;
All u do is basicly the same as if you would hook up a FD1 drive to a cpc 6128. No soldering or disassembly required. Just hook up the cable to the DRIVE connetor on the Amstrad and the Floppy drive to the next edge connector on the cable. &lt;br /&gt;
Pretty hard to get it wrong as the edge connector only fits one way and usually the same is said the floppy connector. BUT .. there IS a few floppy drives that have the pins upside down, so u might need to twist the cable around once .. most likely not tho. &lt;br /&gt;
&lt;br /&gt;
[[Image:CableOn1.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
Note that this type of pc cable usually has some internally twisted cables .. make sure the CPC/PC does NOT have the twisted bit between them.&lt;br /&gt;
&lt;br /&gt;
[[Image:IMGP1639 50%.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
You can process the same way with only 1 drive 3&amp;quot;5 and 5&amp;quot;1/4 connectors , you can use the 3&amp;quot;5 connector before the edge card connector instead.&lt;br /&gt;
&lt;br /&gt;
=== Setting the READY signal ===&lt;br /&gt;
&lt;br /&gt;
Last thing you need to do is set the ready signal. This is done by connecting pin 33 and 34. Its the last 2 pins on the cable. Use a bend paperclip or a small wire to short the 2 pins like so (Marked in WHITE): &lt;br /&gt;
&lt;br /&gt;
[[Image:CableClose1.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
Thats it. Now u SHOULD have a fully working 3.5&amp;quot; B drive. &lt;br /&gt;
&lt;br /&gt;
1. Power on the floppy first. &lt;br /&gt;
&lt;br /&gt;
2. Then turn on the cpc.&lt;br /&gt;
&lt;br /&gt;
=== Errors at this point ===&lt;br /&gt;
&lt;br /&gt;
- You turn on the cpc but get a blank/rolling screen? Most likely the pc cable connector needs to be flipped over (pins are upside down). &lt;br /&gt;
&lt;br /&gt;
Type &amp;quot;|B&amp;quot; to change to drive B in basic (where ø is the rsx char). A simple CAT will show if the disc/drive works. &lt;br /&gt;
&lt;br /&gt;
=== Other Errors at this point ===&lt;br /&gt;
&lt;br /&gt;
- Bad Command? Floppy drive detected by cpc but is not powered. Recheck your powersupply is connected and working. - You turn on the cpc and both drives act-as-one .. and the floppy light is constantly on? Most likely you didnt short pin 33 &amp;amp;amp; 34 .. is the paperclip/wire loose? .. or did you accidentally short pin 1 &amp;amp;amp; 2 instead? Try moving the paperclip to the other end of the connector. - Read error on drive? Disc hasnt been formatted yet? Use software like Discology to quickly format drive B .. or to quicky copy a disc from A to B .. or make a test floppy on pc (see transfer bit later). - Disc is write protected error? Make sure the write tab on the disc is down (move tab down on right side of disc).&lt;br /&gt;
&lt;br /&gt;
== Two heads (OPTIONAL) ==&lt;br /&gt;
&lt;br /&gt;
Ok, everything is working so far? Want to do some more advanced stuff like using 2 sides on your floppy? &lt;br /&gt;
&lt;br /&gt;
Easy enough .. right now your floppy is using head 1 (aka side 1).. if you also connect pin 31 and 32 it will change to side/head 2. Remove the short again to get back to side/head 1. &lt;br /&gt;
I must admit that i myself only use one side/head because i cant be bother with the switching sides/heads. But it might be worth it if you buy one of them fansy on/off switches from a electronics shop. &lt;br /&gt;
Pin 31&amp;amp;32 is marked in RED on picture.&lt;br /&gt;
&lt;br /&gt;
== Making floppy primary drive(OPTIONAL) ==&lt;br /&gt;
&lt;br /&gt;
Donno if you have ever tried running software straight from a B drive, but it usually sucks badly (software freeze up). Wouldnt it be nice to if you could turn drive B into drive A (and A into B)? Connect up pin 11 &amp;amp; 12 while the drive is on to do the drive switcheroo. Marked in BLUE (sixth pair of pins from top). &lt;br /&gt;
Make sure to remove the short after you have turned off the whole thing (or you will get a drives-act-as-one error on next bootup). So you will have to set the 11/12 pin each time you wanna do the drive switching .. This one however seems quite usefull .. off to the shop to get a switch  &lt;br /&gt;
&lt;br /&gt;
Another closeup of all 3 pairs of pins without doodlin: &lt;br /&gt;
&lt;br /&gt;
[[Image:SuperClose1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
== And up and running ==&lt;br /&gt;
&lt;br /&gt;
[[Image:AllUpAndRunning1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
Transfering software between CPC and PC: &lt;br /&gt;
&lt;br /&gt;
Yup, a pc can read and write those 3.5&amp;quot; Amstrad formatted floppies. There is a handfull of pc utilities that can read/write to the floppies. &lt;br /&gt;
&lt;br /&gt;
I suggest getting CPCDiskXP by Oscar Sanchez from http://www.cpcmania.com/ &lt;br /&gt;
&lt;br /&gt;
It reads a 1 side in about 100 seconds (with verify) .. and writing back 1 side takes about 25 second Runs in Windows XP/Vista using a nice lowlevel driver that you might recognise from Amiga- and Atari ST-discs reading pc tools. &lt;br /&gt;
Note that you can only use floppies from a INTERNAL floppy drive (a usb one wont work). &lt;br /&gt;
Seems to me that only the Amstrad is picky about if u use 1.44mb or 720kb floppies .. the pc has no such troubles, so ANY floppy drive may work on pc (from my experience). Also the tape-down-1.44-to-720-floppy-fix works on pc too. &lt;br /&gt;
&lt;br /&gt;
== Things that pop'ed into my head reading up on all this == &lt;br /&gt;
&lt;br /&gt;
Using a whole pc to power the floppy is getting annoing and uncompfy, so my brain has been thinking in overdrive to come up with a solution. &lt;br /&gt;
&lt;br /&gt;
1. use a normal external-IDE-HDD-USB-enclosure to power the drive .. All you need it the enclosure (with its powersupply) .. then fit a Y-split cable (a IDE-power to Floppy-power one). This is possible if u can find the Y-split cable: &lt;br /&gt;
&lt;br /&gt;
[[Image:Ycable1.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
2. use a usb-floppy drive .. dissassemble it and hook it up to pc or Wii or xbox 360 or pc or .. Donno if this is possible .. or if you need yet another type of Y-cable or other. Would look nice with one of them slimline usb-drives. &lt;br /&gt;
&lt;br /&gt;
3. Not a tech wizz at all, but all u need to power a floppy is 5V ?? or do you also need the 12V too? Anyways, a couple of batteries on row might do that easy-ish. &lt;br /&gt;
&lt;br /&gt;
== Worries and what not ==&lt;br /&gt;
&lt;br /&gt;
What if i hook something up wrong will my Amstrad break? Nah, dont think so, I mean I did EVERYTHING wrong at least twice and both 6128 &amp;amp;amp; 664 is still alive and running. Also I tried a LOT of things myself before with a FD1 cable and such. Still we are talking about electronics and all that, so do be carefull, and dont forget that everything should fit nicely .. no reason to force anything. OMG OMG my precius 20+ year old gem of a Amstrad just blew up in my face, will you takes full responsibility and buy me a new one? Eh?, sure i will .. not.&lt;br /&gt;
&lt;br /&gt;
== FAQ == &lt;br /&gt;
&lt;br /&gt;
Q: Can I use a FD1 cable to connect a 3.5&amp;quot; floppy drive? &lt;br /&gt;
&lt;br /&gt;
A: In theory yes, but its hard to set the ready signal. Connecting pin 33&amp;amp;34 is probably best done on the drive itself with a small piece of wire/metal. People who can solder will know how to fix the cable itself tho. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can i hook up a 3.5&amp;quot; to a cpc 464 like this? &lt;br /&gt;
&lt;br /&gt;
A: No. Hooking up a 3.5&amp;quot; isnt possible without some serious soldering and you also need that DDI interface. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can i use a 3.5&amp;quot; on a 6128+ ? &lt;br /&gt;
&lt;br /&gt;
A: Sure you can, but u need to make a cable that fits the the Centronics connector and since the pins is a bit upside down with the 6128+ its a bit more on the technical side. Look here for more: &lt;br /&gt;
&lt;br /&gt;
http://www.pcwking1.netfirms.com/helpage34.html &lt;br /&gt;
http://genesis8.free.fr/amstrad/faq/ &lt;br /&gt;
http://www.zettweb.com/semiconductors/h ... drive.html &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: I got one of those german Schneider 6128 with Centronics connector? &lt;br /&gt;
&lt;br /&gt;
A: Sure, but just like 6128+ its a bit more technical and need a special interface/cable made.&lt;br /&gt;
&lt;br /&gt;
Look here:&lt;br /&gt;
&lt;br /&gt;
http://www.amstrad-cpc.de/ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: The floppy drive isnt registered at all .. not even getting errors? &lt;br /&gt;
&lt;br /&gt;
A: Try cleaning the connector on the Amstrad. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can I use those odd format discs on the 3.5&amp;quot; ? &lt;br /&gt;
&lt;br /&gt;
A: 41 track &amp;amp; other Amstrad formats works fine. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can i use the fully 720kb on the floppy? &lt;br /&gt;
&lt;br /&gt;
A: You need a special rom like Parados to replace Amsdos to do that. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Q: Can i use a 3.5&amp;quot; floppy drive internally in my 6128/664? &lt;br /&gt;
&lt;br /&gt;
A: Well, sure but u need to make another special cable bacause the real internal cable is a lot smaller than the usual pc floppy cable. Also you will need a power converter cable if u want to power the floppy from the inside. If you do use it internally you wont have to set the &amp;quot;primary&amp;quot; pin 11 &amp;amp; 12 as it is already primary. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Thanks goes to == &lt;br /&gt;
&lt;br /&gt;
- [[Executioner]], [[UKmarkh]], [[JMD]], [[Wanderer]], [[Zeropolis79]], [[Gryzor]] and [[Ptr]] for great help and contributions to the guide. &lt;br /&gt;
&lt;br /&gt;
- Everybody in the [http://cpczone.net Cpczone.net] forums for putting up with my rantings &lt;br /&gt;
&lt;br /&gt;
- Anyone online who i stole info from&lt;br /&gt;
&lt;br /&gt;
== Sorry About ==&lt;br /&gt;
&lt;br /&gt;
I may have made a few assumtions .. especially about the floppy compatability based on from my own experiences and such. If im wrong let me know  &lt;br /&gt;
&lt;br /&gt;
My eeiiieenglish isnt the most fluid and correct spelled and all that, but is readable I hope. &lt;br /&gt;
&lt;br /&gt;
== Links to other sites about 3.5&amp;quot; floppy drive hookup ==&lt;br /&gt;
[[Guide on how to connect a 3.5]] Another local guide&lt;br /&gt;
&lt;br /&gt;
http://www.cpcmania.com/ (Spanish &amp;amp; English) &lt;br /&gt;
&lt;br /&gt;
http://www.phenixinformatique.com/secti ... e&amp;amp;artid=67 (French) &lt;br /&gt;
&lt;br /&gt;
http://www.amstradtoday.com/elements/up ... cteur2.htm (French) &lt;br /&gt;
&lt;br /&gt;
http://www.terra.es/personal/diegovp/ (Spanish) &lt;br /&gt;
&lt;br /&gt;
http://usuarios.lycos.es/putusoft/emucpc/softwaree.htm (Spanish) &lt;br /&gt;
&lt;br /&gt;
== Great sources about anything CPC (including 3.5&amp;quot; connecting) ==&lt;br /&gt;
&lt;br /&gt;
http://genesis8.free.fr/amstrad/faq/index.php or &lt;br /&gt;
&lt;br /&gt;
http://www.faqs.org/faqs/amstrad8bit-faq/ (English/French/Dutch/German/Spanish) &lt;br /&gt;
&lt;br /&gt;
http://www.cpcwiki.eu/index.php/Techni ... umentation (English) &lt;br /&gt;
&lt;br /&gt;
http://www.amstrad-cpc.de/ (German) &lt;br /&gt;
&lt;br /&gt;
== Tools to read CPC floppies on pc ==&lt;br /&gt;
&lt;br /&gt;
CPCDiskXP: http://www.cpcmania.com/&lt;br /&gt;
 &lt;br /&gt;
ManageDsk: http://amstrad.cpc.free.fr/download.php ... es&amp;amp;sortby= &lt;br /&gt;
&lt;br /&gt;
22DISK: http://www.znode51.de/specials/22disk/ &lt;br /&gt;
&lt;br /&gt;
ReadDSK/WriteDSK: http://www.julien-nevo.com/arkos/tools.html &lt;br /&gt;
&lt;br /&gt;
CDPRead/CDPWrite: http://www.caprice32.cybercube.com/downloads.php &lt;br /&gt;
&lt;br /&gt;
'''Cholo'''&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:Peripherals]] [[Category:DIY]][[Category:DATA Storage]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:IMGP1639_50%25.jpg&amp;diff=63123</id>
		<title>File:IMGP1639 50%.jpg</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:IMGP1639_50%25.jpg&amp;diff=63123"/>
				<updated>2010-11-11T09:33:23Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: Same with simple cable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Same with simple cable&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Color_Lines&amp;diff=47499</id>
		<title>Color Lines</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Color_Lines&amp;diff=47499"/>
				<updated>2010-07-01T11:41:12Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: reworked page from game documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Color Lines is a puzzle game based on “Lines”, a PC game by Oleg Demin.&lt;br /&gt;
The objective is simple; survive as long as possible, and achieve a high score!&lt;br /&gt;
Underneath the simplistic gameplay is a game that will fray your nerves and eat&lt;br /&gt;
into your free time.&lt;br /&gt;
&lt;br /&gt;
Color Lines offers a large amount of music tracks from Tom &amp;amp; Jerry and a lot of skins from various authors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Rules for classic challenge mode==&lt;br /&gt;
&lt;br /&gt;
The computer places three coloured pawns randomly on the game board.&lt;br /&gt;
&lt;br /&gt;
The computer chooses three new pawns at random, and displays them in the&lt;br /&gt;
&amp;quot;Preview&amp;quot; area of the status panel on the right of the screen. These pawns&lt;br /&gt;
will be placed on the board during the next turn.&lt;br /&gt;
&lt;br /&gt;
The cursor is displayed, and the player moves it and selects one of the pawns&lt;br /&gt;
to move. You must move a pawn during each turn; you cannot pass.&lt;br /&gt;
&lt;br /&gt;
If you move a pawn and a line of at least five pawns of the same colour has not&lt;br /&gt;
been created, then the turn is finished.&lt;br /&gt;
&lt;br /&gt;
If a horizontal, vertical or diagonal line of at least five pawns of the same&lt;br /&gt;
colour is created after moving a pawn, the computer removes the pawns from the&lt;br /&gt;
board and calculates the points that you have scored.&lt;br /&gt;
You can then move another pawn.&lt;br /&gt;
&lt;br /&gt;
In order to move a pawn, a clear path to the new square must exist. In other&lt;br /&gt;
words, the pawn must be able to move to its new location, from square to&lt;br /&gt;
square, without any other pawns blocking its path. If the pawn cannot be moved,&lt;br /&gt;
the cursor flashes and the computer emits a beep.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Gallery  ==&lt;br /&gt;
&lt;br /&gt;
''&amp;lt;br&amp;gt;''&amp;lt;gallery&amp;gt; caption=&amp;quot;Color Lines screen shots&amp;quot;&amp;gt;&lt;br /&gt;
Image:cl_title.png|Title screen (Eldrik)&lt;br /&gt;
Image:Cl_menu.png|Main menu (Eldrik)&lt;br /&gt;
Image:Cl_sly.png|The gorgeous &amp;quot;Rollmops&amp;quot; skin by SuperSly&lt;br /&gt;
Image:Cl_zenith.png|Funny &amp;quot;Ghosts Inside&amp;quot; skin by Zenith&lt;br /&gt;
Image:Color_lines_package.jpg|Full package (contains 3&amp;quot; and 3&amp;quot;5 disk)&lt;br /&gt;
Image:Color lines front.jpg|Box&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Credits==&lt;br /&gt;
*Code, music and sound effects: Tom et Jerry / GPA&lt;br /&gt;
&lt;br /&gt;
*Main graphics: Eldrik / GPA&lt;br /&gt;
&lt;br /&gt;
*Beta testing: Eldrik / GPA, SuperSly / Les Sucres en Morceaux&lt;br /&gt;
&lt;br /&gt;
*Proofreading of English instructions: Nicholas Campbell&lt;br /&gt;
&lt;br /&gt;
*Cover and stickers: Lobo and Kukulcan&lt;br /&gt;
&lt;br /&gt;
==Skin List and Authors==&lt;br /&gt;
&lt;br /&gt;
*1)  DIX HELL / CED&lt;br /&gt;
*2)  PURPLE WAVE / CED&lt;br /&gt;
*3)  RUST IN PEACE / ELDRIK&lt;br /&gt;
*4)  GAMMA RAY / ELDRIK&lt;br /&gt;
*5)  POWERSLAVE / ELDRIK&lt;br /&gt;
*6)  SANCTUARIUM /   ELDRIK&lt;br /&gt;
*7)  BRICKS / FANO&lt;br /&gt;
*8)  CHAOS / MAC DEATH&lt;br /&gt;
*9)  AUTUMN   FLAVOUR /NORI&lt;br /&gt;
*A)  SECRET GARDEN / NORI&lt;br /&gt;
*B)  LOST GALAXIES / PAPY   CPC&lt;br /&gt;
*C)  RIGOR MORTIS / REX&lt;br /&gt;
*D)  ROLLMOPS / SUPERSLY&lt;br /&gt;
*E)  SPARKLING / VOXFREAX&lt;br /&gt;
*F)  RAINBOW / WINNER&lt;br /&gt;
*G)  GHOST INSIDE /   ZENITH&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
&lt;br /&gt;
Official page : http://tj.gpa.free.fr/&lt;br /&gt;
&lt;br /&gt;
==Extra notes==&lt;br /&gt;
On a 128Kio CPC , there will be no extra loading.A physical distribution has been sold at AMSTRAD EXPO (25-27 June 2010).&lt;br /&gt;
&lt;br /&gt;
This page has been made from game documentation.&lt;br /&gt;
&lt;br /&gt;
Package images from Genesis8.&lt;br /&gt;
&lt;br /&gt;
[[Category:Games]] [[Category:Games_2010]]&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=File:Color_lines_front.jpg&amp;diff=47498</id>
		<title>File:Color lines front.jpg</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=File:Color_lines_front.jpg&amp;diff=47498"/>
				<updated>2010-07-01T11:37:21Z</updated>
		
		<summary type="html">&lt;p&gt;Fano: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fano</name></author>	</entry>

	</feed>