CODING ★ HACKER ONLY: Cassette capers ★

Read the Tape Data's Whitout the System|The Amstrad User)Clefs1 19 Logiciel Interne Table CassetteClefs1 32 Blocs de Controle - CassetteTurbo save speed for cassette users
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

The section that brings out the CPC's darkest secrets to light. If you don't understand what's written here, bad luck. You'll get no explanation, for this is where the hackers hang out.

Cassette capers

The cassette deck included with the 464 (external device required with 664/6128 machines) outputs a square-wave signal of approximately 5 volts amplitude. Such a signal can be processed by the multi-functional 8255 parallel interface chip.

The 8255 contains 24 input/output bits. These bits may be programmed in two blocks of 12 bits. To make matters simple think of the chip as having three 8-bit ports (A, B and C). Fort A gives input and output, port B input only and port C output only.

We are only interested in the chips cassette control feature:

  • Port A - input/output (address &F4C0)
  • Port B - input only (address &F500)
    • Bit 7 used to read cassette data,
  • Port C - output only (address &F600)
    • Bit 5 used for writing to cassette.
    • Bit 4 turns motor on or off.

A write-only control register (located at &F700) determines whether a bit sunt to port C is either 0 or 1. The bits sent to &F700 do the following:

  • bit 7 must be zero
  • bits 6-4 not used
  • bits 3-1 determine which bit of port C is affected
  • bit 0 determines the nature of the bit sunt to port C

 
Uses and abuses

Like most ICs in the Amstrad, maximum use is made of 8255. its uses include operating the keyboard and sound chip , testing the vertical sync of the CRTC, checking that the printer is ready to receive data and by detecting the position of a jumper it generates either a 50Hz or 60Hz picture. It even decides which of the 10-odd names will appear on power up (that is, Amstrad , Schneider, Arnold, Awa and so on). Another of the 8255's major functions is reading; and writing bit-sized cassette deck data.


Practical ports

Confused? Try the following in Basic

OUT &F700,9

or in Z80 assembler 

LD BC,&F7C9
OUT (C),C

You should have heard the cassette motor start up. If you convert 9 to binary you get 00001001. Bit 0 is set. This means that the bit sent to port C will also be set (1). The 3rd bit is also set which tells us that bit 4 of port C will be affected. To switch off the cassette motor issue an OUT &F700,8 - try and work out why it works.

Another method of switching on the motor (or rather setting bit 4 of port C is OUT &F60D, 16.

Get to grips with this manner of switching on and off the cassette motor as next month we shall go one step further - cassette reading and writing.

TAU

CPCrulez[Content Management System] v8.7-desktop/cache
Page créée en 070 millisecondes et consultée 467 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.