Home

PCW hardware information - John Elliott`s homepage

image

Contents

1. 7 4 3 58256 Port e E SCAMark2Interface lees LocoLimkanterf ce uu SERE CLIE SUE I MES PCWLinkit cA 6 rte Sk ee ee Reed IS BU PRESE TER A Prototype serial interface 8 Floppy drives 8 1 8 2 8 3 The floppy controller and other ports o oo Floppy drive support Floppy controller probe ooa a 8 3 1 Detect floppy controller type 832 Detect drive 0 00 N 10 11 12 13 Hard drives 9 1 CirtechGem 2s 9 1 1 CirttechGem ATA 9 1 2 Cirtech Insyder Hardpak 92 ASDPCWHDIO PCWHD20 rss 9 3 Other hard drives wee Re HU ie e s Keyboard 10 1 Keyboard matrix 10 2 Keyboard Links Roe RR D 10 3 Keyboard Joystick s 10 4 1 10 4 1 Wire protocol 5 tee M S Pointing Devices AMX Mouse usos gene sve e adt dx RUD s 11 2 Kempston Mouse 0 002 eee ee eee 11 3 Keymouse cs s epu ww wa weed dup dee ee SURE 11 4 Electric Studio light pen Joysticks 12 1 Keyboard joystick s 12 2 Kempstoninterface s ar e a
2. LL Mestesttio ss LE RISCIS se automatically _ 0 a 878 4 Parity enabled a Parity even J Bp ii 2 3 for 1 15 2 7 a ok ee Ps po i Newed E so aioe RS tse TL a 678 Only on channel POnly on channel B 7 1 2 CPS8256 Centronics port The Centronics port described in section 6 4 returns its status in register 0 of Channel B The STROBE signal is controlled by bit 7 of register 5 what the DART thinks is DTR and the BUSY signal shows up in bit 5 CTS of register 0 7 1 3 CPS8256 Serial port The serial port is connected to Channel A of the DART To check if the port can output read register 0 of Channel A If you are using software handshaking check bit 2 Transmit buffer empty and wait until it s nonzero If you are using hardware handshaking check bit 5 Clear to Send when this goes to 1 read register 1 until bit O All Sent is 1 Then to output write the correct byte to the data channel To read from the port in non interrupt mode Ifhardware handshaking is enabled check bit 0 of register 0 RX character avail able and if it s 0 raise DTR set bit 7 of register 5 Wait until bit 0 of register 0 becomes 1 Read the character from the DART data channel If hardware handshaking is in use drop To set transmit baud rate send 36h to port E7h and two b
3. The last four bytes contain controller status in bits 6 and 7 Bits 0 5 of each byte are used by analogy with the two joystick entries to provide keyboard combinations that may be useful as joysticks 21 3FFCh KP Enter Space Exit FI F2 F3 F4 3FFEh Shift Space WRP QEO ZXCV ASDF me m E p qe err ver er omm 3FFFh Update Ticker Shift Space W R P QE OT BNM HJKL DD A on e ooa a 2m 3FFCh gives an inverted T pattern centred on F1 If link LK2 is present it will also respond to a W A D X diamond with S as Fire 1 and Shift as Fire 2 3FFDh maps to the numeric keypad 3FFDh bit 6 reports the state of the Shift Lock LED 1 if lit else 0 3FFDh bit 7 is 0 if LK2 is present 1 if not 3FFEh maps ASDFGHJ to up ZXCVBNM to down QEO L lt to left WRP gt 2 to right Space to Fire 1 Shift to Fire 2 3FFEh bit 6 is 1 if LK1 is present 0 if not However if LK1 is present the keyboard enters a self test mode and transmits test patterns rather than these flags 3FFEh bit 7 is 1 if LK3 is present 0 if not 3FFFh maps HJKL lt gt to up BNM 1 2 to down QEO ADZC to left WRP SFXV to right Space to Fire 1 Shift to Fire 2 3FFFh bit 6 toggles with each update from the keyboard to the PCW 3FFFh bit 7 is 1 if the keyboard is currently transmitting its state to the PCW 0 if it is scanning its keys If no keyboard is present all 16 bytes of the memory map are zero
4. AB 86 0E data OE data OE data 02 00 21 times 80 04 C0 00 print a line of graphics in the ESC L graphics mode The AB 86 starts printing and moves the head 134 9 125 ticks to the right The commands starting OE are the graphics columns spaced 12 ticks apart The 21 02 00 commands and the 80 04 move the head 130 ticks to the right of the last column and the C0 00 moves it a further 11 ticks Combined with the lead in on the next line this leaves the head ready to print under the first unprinted column of this line 6 1 4 PCW matrix printer fonts Although it is not strictly part of the hardware specification the memory layout used by the dot matrix printer fonts under CP M and LocoScript 1 is described in Appendix A 6 2 PCW9512 printer controller Unlike most of the other ports the 9512 printer controller decodes its I O address as more than just 8 bits and is thus accessed at I O addresses 0OFCh 01FCh and OOFDh The bits returned by IN OFDh are 7 if the printer can accept commands 0 if commands can t be sent to it Usually 0 The interrupt handler checks this bit but the significance of it is unclear 1 if the printer is idle O if it s executing a command On dot matrix PCWs this bit is always 0 1 Awassemsiobei Ps Unknown 3 printer has caused an inierupt 0 Lif bytes be read from the controller else 0 The controller is accessed by
5. 12 3 12 4 Cascadeinterface a Dose xe AUR RU er RA 12 5 DKTr nicsanterfaCe seceta 9e DU Pe edu eR Sound Generators 13 1 DKTronics sound Dot matrix printer fonts A The character width table A2 The NLQr font s cubo deos a a T he EUR o a b sos A3 The dratt as ev erp ee a e EA A 4 Some worked examples 0 A 4 1 NLQ Character 0 using BIOS 1 15 A 4 2 Draft Character 0 using BIOS 1 15 A 4 3 Repetition of columns Character 62 using BIOS 1 4 A 5 Matrix fonts in 1220 5 1 PS widths table ll o e ALD 2 NEO font manie a b eae ebd exte sw ea AOS Dratttonet sea ld a eA ea EN Se aA SS AU 780 COde zu xXx a Rae uS eb A 6 Matrix fonts in 1331 A 7 Matrix fonts in 140 19 19 19 20 20 21 21 22 23 23 23 24 24 24 24 25 25 25 25 25 25 26 26 27 27 B The LocoLink wire protocol 33 B 1 Basicconcepts es Gac Potone onum rs 33 1 1 Bit mapping at the PC end 33 B2 Linkidl z cR e e SS e ee a Eu hg lade 33 BS Sending 2 5 eu Rep oe we age EU e E RR RE 33 3 1 S endingabyte 2 5 a 33 B 3 2 Sendingapacket 2 o
6. 3 BUTof sbyei0 3 3 Bi7aknowedgd 3 End of packet slave deduces this from byte count End of packet acknowledged w Master listening slave not listening This would seem to imply that packets must strictly alternate since at the end of a conversation the other computer is now the one listening 35 B 6 Startup sequence The first packet exchange is as follows Additional bytes 02h 20h 31h Master program name optional Oth 1Fh OBh Slave program name optional In both of these packets the program name may or may not be present The other bytes must be exactly as given or a link failed to start error will occur The PCW 16 version expects a different packet exchange Additional bytes B 7 While the link is running The master now either Hangs up the link This is done by sending a packet of type 22h to which the slave does not reply Sends a command packet This has a type of 39h and is 1 15 bytes long It represents a DOS function call only a subset of calls are supported The data bytes in the packet are Presumably longer versions of this packet would also contain SI DI and BP Most function calls don t need to pass parameters and so just send a 1 byte packet For ex ample call OEh log in drive doesn t bother to send a drive number since a LocoLink slave computer provides only one disc drive Once the command has been sent the slave will send back one
7. 490 MEI NN OR 04 A 0 00 0 00 A 40 00 880 40 gap 00 Which gives us the following two patterns one from the first set of bytes 3000000000020030 0 0400808180808480 0 Ho and one from the second 2414040404004034 4 0004050406040080 0 29 d HEHEH god If we take a row from the second pattern then the first and so on then the letter appears A 4 2 Draft Character 0 using BIOS 1 15 In the draft table the first two words are 0157h 015Ch Adding these to the base of the font gives 6948h and 694Dh so the bytes between 6948h and 694Ch inclusive are the pattern for character 0 The bytes are 05 OE 97 C7 92 01 and these expand to 05 gt patt 5 0x20 OE gt patt 14 0x54 97 gt patt 23 0x55 blank column first C7 patt 71 0x56 blank column first 92 gt patt 18 0x38 blank column first 01 gt patt 1 0x40 and translated to a bitmap these are 30 A 4 3 Repetition of columns Character 62 using BIOS 1 4 This character is number 62 So 124 bytes from the start of the offset table we find the two words 02B3h 02B5h Thus we know the character description fits in 2 bytes and starts 02B3h bytes from the start of the font The two bytes found there are 7Dh repeat 5 times 0Ah pattern Entry OAh in the pattern table is 14h so the character is for
8. for which I have no program ming information Timatic Winchester Expansion Box A Seagate ST225 connected through a SASI interface ACC Hard Disc No information available Vortex System 2000 A Miniscribe 8450 XT connected through a SCSI interface Cirtech Diamond An earlier version of the Gem but based on a SCSI interface rather than IDE Among its features was the ability to connect up to seven PCWs to a single drive taking advantage of the ability of the SCSI bus to support multiple controllers Cirtech Flash Drive A solid state boot device which connects to the expansion port and boots the PCW from a Flash ROM 10 Keyboard The keyboard appears as a memory mapped device at 3FFOh 3FFFh in memory block 3 The first 12 bytes give the status of pressed keys xh 3 s gt 91 8 9 v G Tr 1 53 o s 3r Z A mb o Sop 2 1_ Dd Firei TI Fire TI Right T1 Left TI Down JI Up Jie 12 Fire 72 Right 12 Left 12 Down 12 Up Using the key numbering scheme in the PCW manual e Keys 0 71 correspond to bit n mod 8 of byte n 8 of the map Key 72 corresponds to bit 7 of byte 9 Keys 73 80 correspond to bits 0 7 of byte 10 The entries marked J1 and J2 are for keyboard joysticks see below
9. 10 1 Keyboard matrix The physical layout of the keyboard matrix is given in the service manual ea 1 3 ee I LOE jue pac pex G T J epe od NE epi OE RR EE Pa A Ta Se 2 1_ FE Ak i Fire Ii Fire7 TI Right TI Left TI Down WI Up Ppa i Fre Y 32 Fire 2 7 Right 12 Left 2 Down 2 Up 22 10 2 Keyboard Links The keyboard has three option links By default they are all disconnected LK1 If connected puts the keyboard into a test mode in which it repeatedly sends various patterns of data to the PCW The Shift Lock LED will be constantly lit or more accurately blinking faster than you can see LK2 If connected pressing Shift does not cancel Shift Lock Also enables W A D X joystick and resets bit 7 of byte 3FFDh LK3 If connected sets bit 7 of byte 3FFEh Has no other effects 10 3 Keyboard Joystick s The key numbering scheme on the PCW exactly matches the memory map until the gap at key 72 It also exactly matches the keyboard matrix schematic in the PCW95 12 service manual until key 72 As shown above the keyboard schematic has entries in its matrix table for one or two joysticks Existing PCWs have no provision for connecting a joystick to the keyboard but the PC1512 does This may have been how the joystick s on AN
10. 2 Detect drive type If a 9256 style controller was found separate checks are then done on each drive to see whether they are 3 5 or not The test is performed once on drive 0 and once on drive 2 The test on drive 2 will return results that are valid for drive 1 for some strange reason 1 Start disc motors 2 Recalibrate the drive ie move the head to track 0 3 Send SENSE DRIVE STATUS to the drive 4 If the Track 0 bit is not set For drive 0 If the read only bit is set the drive is 3 Otherwise it is 3595 For drive 2 The drive does not exist 5 If the Track 0 bit is set Turn off the disc motors and wait for them to stop Send SENSE DRIVE STATUS to the drive again If Track 0 is set the drive is 3 Otherwise it is 3 5 9 Hard drives JOYCE does not emulate real PCW hard drives so this information is not verified 91 Cirtech Gem Physically the Gem drive at least the one I have is a Seagate ST351A X IDE drive jumpered for XT mode If the jumpers are set for AT mode it is possible to connect it to a modern PC and access the data at a sector level Jumper settings for the ST351A X can be found Dell s website http support euro dell com support edocs dta 18814 00000003 htm In XTA mode the drive has four registers mimicking an XT hard drive controller On the PCW they can be found at ports OA8h to OABh The information below is adapted from the Interrupt List entry f
11. means that the video controller will display pixel line 8 at the top of the screen essentially scrolling up by 8 pixels F7h output Bits 6 and 7 of this port are used If bit 7 is set then the screen will display in inverse video black on green white If bit 6 is set then the screen is displayed otherwise it will be blank F8h output This port is used for various purposes but the two which are video related are OUT F8h 8 Disable the video controller External hardware TV modulator must drive the screen OUT F8h 7 Enable the video controller F8h input The bits that concern the video controller here are bit 6 Frame flyback this is set while the screen is not being drawn bit 4 60Hz PCW only the top 200 lines of the screen will be visible 4 20 The Roller RAM The Roller RAM is treated as an array of 256 little endian words Each word is a coded pointer to the screen bitmap for this line formed 115 14 13 12 11 10 9 8 7 16 5 1413 2110 offset T6 The top 3 bits give the memory block number Bits 0 12 give the offset of the line within the block However it would take 14 bits to span a 16k block and there are only 13 left So to convert bits 0 12 into the address of a screen line you have to use a formula such as address offset amp 7 2 offset amp Ox1FF8 Once you have the address of a screen line it consists of 90 bytes at intervals 8 apart so a line would be stored i
12. of the following packets Success Type is 50h Packet length is 0 8 bytes its payload is the values for AX BX CX DX low byte first Error Type is 67h Packet length is 2 bytes the first is the DOS error number see INT 21h function 59h and the second is 0 Request data Used where the corresponding DOS function would pass data using a pointer or DMA The packet type is 7Eh and length is 2 bytes The first byte is 11h to ask for an FCB 80h to ask for a filename and the second is the maximum number of bytes to transfer The master will reply to this with a packet of type 95h containing the requested data 36 Return data Used where the corresponding DOS function expects data to be passed to it by a pointer or DMA The packet type is OACh the first byte may be a type code and the remainder contains the data The master will reply to this with a OC3h packet the first byte of which is OACh The slave can also send a OADh packet which must be acknowledged by a 0C3h packet the first byte of which is OADh Once the slave has sent a success or error packet 50h or 67h the master can send another command packet or hangup packet Command packets supported by LocoLink PCW 2 02 are Parameters in initial packet Additional transfers o esdicbd Save returns disc label if found 13h deeedichbl 16h create disc abel Xm rename di
13. sectors would have SPT 5 17 85 while the field at offset 1Ah would hold 17 Three bits of the options byte are used Bit 7 Set to load CP M by default clear to load LocoScript by default Hold the ALT key when booting to load the other OS Bit 4 Set if this is a Gem 2 mirrorred system In this configuration sectors are read from drive 1 the main drive and written to both drive 1 the main drive and drive 0 the backup drive Hold the B key when booting to disable mirroring and boot from the backup drive Bit 0 Set if a splash screen is present Working through the fields in order C 1 The boot programs table This table contains a list of boot programs Each entry is five bytes long 0 Byte 8 bit checksum of the first 512 bytes of the EMS EMT file Offset of boot program from start of table Length of boot program The end of the table is indicated by a boot program with offset 0 If the checksum of the first 512 bytes of the EMS EMT file does not match any of the entries in the table the boot ROM will give a single beep and refuse to execute it If a matching boot program is found it will be copied to ODOOOh and run with the following parameters HL length of HDRIVER FID HDRIVER FID will be in memory at ODOOOh length of boot program e C boot program number 1 based The selected EMS EMT file will be in memory from 0000h up 38 The task of the boot program is to inject the HDRIVER F
14. sending two byte commands The first byte specifies the command and the second contains any required data To send a command 1 Wait until IN OOFDh bit 1 is zero 2 OUT 01 FCh command byte 3 OUT 00FCh data byte If the command returns data then to read back the data do 1 Wait until IN OOFDh bit 0 is 1 2 Read data from IN 00FCh To read the status of the printer do an IN 01FCh twice in succession If the values read don t match repeat until they do The bits in the byte returned are Printer failed 6 Noprinter 5 5 Ribbon present 4 Paper present 3 Cover down Bail bar in Controller failed 0 The PCW9512 schematic shows printer signals for SEL HOM CAR HOM SHIF and PSIF but whether any of these corresponds to bit 0 or indeed bits 7 6 and 1 of this port is not known Daisywheel commands should be treated as big endian words The first 4 bits define the command the remaining 12 bits are the parameter If the first 4 bits are 0 then the next 4 bits define a different type of command and the last 8 bits are the parameter First byte Second byte Effect Returns High 4 bits Low 4 bits Prepare to output character nothing Followed by 4xxx 7xxx Reset interrupt flag nothing cation inert hands Ih 24h 25h Initialise controller This 15 Oif OK the first command sent The PCW9512 BIOS does not send these codes Bits 12 9 are impression Output specified
15. to need this When transmitting its state the controller sends a 17 keycode packet The first word is byte OFh with the top bit set to 1 then bytes 0 OEh then byte OFh again with the top bit set to 0 11 Pointing Devices 11 1 AMX Mouse This mouse appears at ports OAO0h 0A3h The interface is built around an 8255 PPI 0A0h port A gives vertical movement low nibble number of moves up high number of moves down 1 port B gives horizontal movement low nibble number of moves right high number of moves left 0A2h port C Input gives button state in bottom 3 bits These are 0 if the button is pressed else 1 Bit 0 is the left button Bit 1 is middle Bit 2 is right Output Stop Press writes OFFh followed by 0 presumably to reset the counters 0A3h PPI mode Stop Press writes 93h at startup Basic I O mode ports A and B input port C low 4 bits input high 4 bits output If at startup the value read from port 0A2h is 10h Stop Press switches to accessing the AMX mouse through ports 80h 83h Possibly this is to detect an ASD hard drive and avoid a conflict 11 2 Kempston Mouse This mouse appears at ports ODOh OD4h 0DOh gives X position 0 255 The same value can also be read from 0D2h OD1h gives Y position 0 255 The same value can also be read from 0D3h 0D4h gives button state in bottom 2 bits Zero if the button is pressed else 1 Bit O is left bit 1 is right Other bits are 1 24 11 3 Keym
16. ID image into the loaded EMS EMT file so that it boots from the hard drive rather than the floppy The version of the bootloader that I have studied can do this to six variants of the CP M EMS file and 64 variants of the LocoScript EMS file C 2 The HDRIVER FID image This is an exact copy of the HDRIVER FID used to access the hard drive when booting from floppy C 3 The splash screen This is a 720x146 bitmap It is stored as 19 rows each containing 90 8x8 character cells The first row should be blank because it is used to draw the 55 scanlines above and below the picture 39
17. PCW Hardware John Elliott October 24 2012 Abstract This document describes what I have found out about the hardware of the Am strad PCW in the course of writing JOYCE Some of this has been deduced by me a lot has come from other sources Contents 1 General principles 2 Boot ROM 3 RAM and paging 3 1 3 2 PCW extended paging mode CPC standard paging 4 Thescreen 4 1 4 2 VO potis 6 ores hes mE REGE EE EN SEE BES The Roller RAM LAVAL RT aE 5 Interrupts 5 1 5 2 5 3 54 Timieranterrupts fis vou ee dew ge em e RR Floppy controller interrupts llle Serial port interrupts 1 6 Printer ports 6 1 6 2 6 3 6 4 6 5 PCW8256 8512 9256 10 printer controller VO ports A Beli Bee E 6 1 2 Printer commands 6 1 3 Example command sequences 6 14 PCW PCW9512 printer controller PCWO9512 PAR pott tee e gm o e CPS8256 CEN port af Aa ee KE S Sa s Standalone CEN port lees 7 Communications interfaces 7 1 7 2 7 3 7 4 7 5 CPS8256 eese amp Eh ie NPCs er 7 41 Z80 DART registers 7 1 CPS8256
18. ROBE line 7 Communications interfaces 7 1 CPS8256 The CPS8256 is based on a Z80 DART and an 8253 timer Ports are as follows Por DART Channel A data DART Channel A control DART Channel B data DART Channel B control E4 8253 counter 0 8253 counter 1 8253 write mode word To write a value to a DART register other than register 0 send the register number and then the value to the control port Elh or E3h To read a register send the register number to the control port and then do an IN on that port To read write DART register 0 just read or write the value to port Elh or E3h When writing the bottom 3 bits of the value must be 0 otherwise one of the other regsters would be selected 7 1 4 Z80 DART registers The Z80 DART registers are numbered 0 to 5 Many of the bits in these registers are not used by the CPS8256 2 Transmit buferempy Mustbe sei Command 34 Ring indicator Comma 5 Command s Nowa 7 Bek Nt sed Ale _Extintenable Transmit int enable 2 Status affects vector 3 Notused _Receive int mode Parity error Receive int mode 5 Receive overrun WaiReady on RT Framing error WaiReady foncion 7 Notused WaiVReady enable 3 mempret _Interruptvector 3 9 Receive enable pu
19. T were to have been implemented My guess is that in the original ANT design the keyboard matrix and the table in memory matched When the PCW keyboard was created the membrane was re designed to move the now redundant joysticks to the end of the layout and the key board controller microcode rewritten to swap bytes 9 and 10 bits 0 6 so their positions in the memory map didn t change 10 4 Physical connection 5v GND Data Clock The pinout above shows the keyboard socket on the PCW seen from the outside of the case The voltages used for signalling appear to be less than TTL normal though the PCW9512 and probably the other models can take signals at TTL levels without apparent harm 23 10 4 1 Wire protocol By default the data and clock lines are high To send a bit the keyboard drives the data line low or high pulls the clock line low and then a little later returns them both to high Exact timings are unknown though the PCW motherboard seems happy to accept timings similar to those used by the PC1512 keyboard set data wait for Sus set clock wait for Sus return both lines to high wait for 405 A keycode is 12 bits long with the most significant bit first The first four bits are the offset in the memory map 0 OFh and the last eight bits are the value to be placed into memory at that address The PCW keyboard toggles the DATA line twice before sending each word but the gate array at the PCW end doesn t seem
20. a a 34 B RECCIWING Rar uses d Id VIN EM E 34 4 1 Receivingabyte leen 34 4 2 Receiving packet 35 Bid Examples ae a ssp at REA NS 35 B 6 Startupsequence p osean p aa a 36 B 7 While the link 15 running 36 C The Gem Drive System Track 37 C 1 boot programs table 38 C2 The HDRIVER FIDimage eee 39 C3 Thesplash scre en ti e Rp ERE po de ee d 39 1 General principles The PCW s I O is for the most part conducted using the Z80 s IN and OUT instruc tions rather than memory mapped I O In nearly all cases only the bottom 8 bits of the port number are decoded and so ports are specified with 2 digit identifiers eg port FOh not port OOFOh 2 Boot ROM Most of this information is derived from Jacob Nevins description of the boot process with disassembly at http www chiark greenend org uk jacobn cpm pcwboot html The PCW has no separate boot ROM Instead on startup instruction fetches return a stream of bytes irrespective of address This stream is 778 bytes long and generates a 256 byte boot program at the start of memory addresses 0002h 0101h The last two bytes of the instruction stream D3 F8 write 0 end of boot sequence to port OF8h The next instruction fetch will then be from address 0002h the start of the boot program There are
21. ame name If a LocoLink interface is connected to both the expansion and parallel ports of a PCW9512 and bytes are sent to port OFEh the bits in the parallel port change as follows Value written Value read Bno Bic JOYCE v2 1 0 contains support for the slave end of a LocoLink connection The communications protocol used by the LocoLink interface is described in Ap pendix B 7 4 PCW Linkit The PCW Linkit interface is a similar device to the LocoLink a 2 bit communication channel except that both ends connect to PCW expansion ports It appears at port OFFh The values are carried by the two low bits of the port the value read by one PCW is the binary inverse of the value written by the other PCW The communications protocol used is not known 7 5 Prototype serial interface The original PCW specification mentions that the prototype PCW had a serial interface based on the Intersil IM6403 UART Its data register was at address OFEh for both input and output and its status register at OF9h input only JOYCE does not emulate this interface 8 Floppy drives The PCW floppy controller is the uPD765A run in non DMA mode The FDC main status register is at I O port its data register is at O1h 8 1 The floppy controller and other ports The System Control port OF8h has five commands which affect the floppy controller 02 If the floppy controller interrupts the Z80 gets an NMI 03 If the floppy contr
22. character 2 for low 5 for medium 9 for high Always preceded by a nothing Bits 0 7 are pin number on wheel 01 command Not sent by the PCW9512 BIOS Distance in z55ths of an inch Move left Distance in of an inch Distance in of an inch Feed paper forwards SSS Unkmown nothing Distance in of an inch Feed paper backwards SSCS Unmows nothing 6 3 PCW9512 PAR port The PAR port is part of the PCW95 12 printer controller and is controlled by commands 2 get status and 4 write byte to PAR The status byte gives the values of the following Centronics lines 6 BUSY 9 AlwaysiT So to do output wait until bit 6 goes to 0 and then write the data using command 4 Since the 9512 hardware supports the Centronics ACK signal it is possible for a 9512 to act as the master computer in a LocoLink conversation see section 7 3 6 4 CPS8256 CEN port The CPS8256 CEN port is at E3h To read its status write 10h to port E3h Then read port E3h bit 5 is set if the printer is ready To write data write the character to port E8h Then send the following bytes to port E3h 5 E8h 5 68h These will toggle the STROBE line 6 5 Standalone CEN port The standalone CEN port is at ports 84h 87h The status is read from IN 84h Bit O is1 if the printer is busy O if it s ready To write a byte write it to port 87h then to port 85h then to port 87h again The two writes to port 87h toggle the ST
23. commands are sent to this port except during a reset 6 1 2 Printer commands Printer commands are a multiple of 2 bytes long Commands which are longer than two bytes end with the two bytes C0 00 Parameters use a vertical resolution of gin the horizontal resolution depends on the speed the motor is running at but is either quin In the following descriptions the unit of horizontal measure is called the tick 00 00 First initialisation command sent to port OFCh during boot up possibly does a self test A4 nn Line feed by 3epinches Used only for feeds of iin and less ie n lt 12 Not followed by a C0 00 command A8 nn A9 nn AA nn AB nn Move the print head and print a line Bits 0 and 1 of the command byte give the print head speed and direction bit 0 If set print head moves to the right else left bit 1 If set print head moves at half speed If not full speed The second byte of the command says by how many ticks the head should move in the direction of travel before the first output is printed The PCW matrix driver assumes that the head will actually move by 9 fewer ticks this may be because the motor can t start instantly This command is then followed by a number of data commands These are of two kinds to print or to move the head by a specified number of ticks The command to print a column is treated as a 16 bit big endian word with the following bitfields Bits 15 12 are 0 Bits 11 9 giv
24. controller 6 11 I O ports The PCW uses two I O ports to communicate with the printer controller ports OFCh and OFDh OFCh appears to be used to initialise the controller while OFDh controls the printer itself FCh input returns a controller error number The PCW XBIOS only reads this when the controller reports an error see bit 0 of port FDh Values that can be returned are 0 Underrun 1 Printer RAM fault 3 Bad command 5 Print error OF8h Normal operation no error If this port returns any other value then No printer is displayed as an error FCh output is used to send commands to the printer controller Each command is a multiple of 2 bytes long The meaning of the commands sent to ports FCh and FDh appears to be the same but commands are only written to port FCh while the printer is being reset FDh input returns the status of the printer The meanings of the bits are as follows Bail bar 1 if it s in O if out If 0 printer is executing command If 1 printer has finished 5 Always 0 for daisywheel PCWs it s 1 when the PCW is booted E so this bit can be used to test the printer type n P n if print head is at left margin else 1 Sheet feeder present Paper sensor 1 if paper is present else 0 If 0 ready commands can be sent to port FDh If 1 busy they can t 0 If 1 controller fault see IN OFCh FDh output is used to send commands to the printer All printer
25. d configuration the main drive is drive 1 ie jumpered as slave and the backup drive is drive 0 ie jumpered as master 9 1 1 Cirtech Gem ATA I ve also seen but not really studied a Gem drive based on a Conner Peripherals CP3024 which is ATA rather than The ATA registers would be mapped at OA8h OAFh 0A8h Data 0A9h Error Features OAAh Sector count OABh Sector number 0ACh Cylinder low OADh Cylinder high OAEh Drive Head OAFh Status Command with the interface presumably converting between the 16 bit transfers expected by the drive and the 8 bit transfers done by the Z80 9 1 2 Cirtech Insyder Hardpak These are pretty much Gem drives in different form factors the Insyder is fitted in side a PCW9512 and the Hardpak includes a 2 5 hard drive in the interface box Presumably they would use the same register interface as the Gem 9 2 ASD PCWHD10 PCWHD20 I haven t seen one of these drives so this information comes from disassembling the driver ASD FID The drive uses an ATA interface and appears to make 8 bit transfers The registers are 0A0h Data OAIh Error Features 0A2h Sector count 0A3h Sector number 0A4h Cylinder low 0A5h Cylinder high 0A6h Drive Head 0A7h Status Command The review in 8000 Plus says that the ASD drive can have 1 6 partitions but the driver I have doesn t support this 20 9 3 Other hard drives 8000 Plus has also reviewed several other hard drives
26. d then reset channel B To read the clock Send the command DOh 0 e Send the command D1h the next 4 bytes read will be hours minutes days months BCD Send the command DOh 5 The clock will return 3 bytes The first is the year BCD I suspect the others are day and month again which we ignore To write to the clock Send the command DOh 20h Send the command DOh hours minutes days months all BCD Or Send the command DOh 5 Send the command DOh year day month BCD 7 3 LocoLink interface LocoLink is used to connect the PCW to the parallel port of another computer The supplied software acts as a file server slave in LocoLink terminology so that the other computer the master normally a PC though software also existed allowing a PCW9512 to do it and the PCW16 is supposed to have built in LocoLink support could read or write files Although the LocoLink interface connects to the parallel port it acts as a serial de vice using only 4 wires two each way This is so that it can support non bidirectional parallel ports On a PCW with the interface the LocoLink appears at address OFEh The port behaves as follows Cit Input meaning Output meaning o Damo BUSY 1 At the other end of parallel cable the two Data lines correspond to the first two data lines in the parallel port BUSY and ACK correspond to the Centronics pins of the s
27. e Then take the two bytes at that offset for the first and second pass 7Bh The two bytes after this code are printed on the first and second pass 7Ch 7Fh Repeat the next pattern byte 79h times putting a blank column before the second and subsequent repetitions A 5 3 Draft font The draft font is at offset 1181h in MATRIX STD Its offsets table is again 225 words long offsets are based on the font address like in CP M 5 4 Z80 code The first 11Ah bytes of MATRIX STD are the Z80 code that generates font bitmaps Again this seems to suggest that alternative fonts were planned the people designing the characters would have been able to use any code they liked to generate them Very similar code is used under CP M The entry point is at the beginning of MATRIX STD and takes the following pa rameters character BC address of this routine MATRIX STD must be prepared to be loaded anywhere in me DE address of a byte to which character width should be written On return the registers should be character BC address of the code that generates the character bitmaps PS width of character stored DE 1 entry DE HL corrupt All other registers and flags preserved The character bitmap generation code will then be called with A character BC address of this routine DE address of 24 byte buffer in which to store the generated character bitmap H OFFh for NLQ else draft Bit O of L is O fo
28. e the column spacing 0 is 5 ticks 1 is 6 ticks 7 is 12 ticks Bits 8 0 are to fire the pins Bit 8 is the bottom pin bit 0 is the top The other type of command moves the head These are normally at the end to put the print head in the right place for the next row The bit pattern for this type of command is Bits 15 13 are 1 0 0 so this command is between 80h and 9Fh Bits 12 0 are the number If the low 8 bits are add 256 This means the commands in increasing numerical order are 80 01 80 02 80 FF 80 00 81 01 etc Finally the command ends C0 00 End of command This moves the head a further 11 ticks in the direction of travel because the motor can t stop instantly either AC nn Line feed by 56 inches If nn is 0 feed 256 To feed more than that pass further commands where bits 15 13 are 1 0 0 and bits 12 0 are the encoded number to feed eg AC 30 92 00 C0 00 This command is also terminated by a C0 00 end sequence B8 00 Reset printer Moves the print head to the left margin C0 00 end of command sequence 6 1 3 Example command sequences 00 00 A4 01 A9 CO B8 00 sent to port OFCh as initialisation sequence The A9 CO pair is sent if the print head is against the left margin after the initial reset this ensures that wherever the head was its ability to move has been tested 0 00 B8 00 sent to port OFCh as printer reset sequence AC 3D C0 00 line feed at 6 lines inch
29. egister As mentioned above the joystick port is register OEh A Dot matrix printer fonts The PCW dot matrix fonts are stored in three tables in Bank 2 The addresses and sizes of these tables differ from CP M version to CP M version you can use LPTSFONT to discover where the fonts are for a given CP M version Known font addresses are CP M version 1 1 1 2 1 4 5E28h 1 12 1 14 1 15 SEBDh There are three consecutive tables of font data A 1 Thecharacter width table This is always 64 bytes long and used for spacing the characters when proportional mode is selected To get the width for character n read byte lt gt 2 the high nibble will be for the even numbered character 0 2 4 and the low nibble for the odd numbered one 1 3 5 A 2 The NLQ font The font starts with a table the character offset table containing 129 words Each word has the following bitwise structure Bit 15 The character has a descender print it on the bottom 8 pins rather than the top 8 Bits 14 12 Space to put at the left of this character Bits 11 0 Offset of the specification of this character from the start of the font The last entry gives the offset of the first byte after the font This means that for any character the size of its description can be found by taking offset char 1 offset char In the standard fonts offset 128 also gives the offset of the start of the draft font from the start of the NLQ font 2 l
30. end 1 Send one byte the packet type Send one byte number of following bytes can be 0 for none Send any following bytes Send two bytes the checksum CRC of the packet Wait until the value received goes from 3 to 1 Send 3 Wait until the value received goes from 1 to 3 Send 2 Receiving Receiving a byte Bytes are only received as part of packets see below Wait until the value sent by the other end becomes 2 or 3 The low bit of the value gives bit 7 of the byte being read Send 3 Wait until the value sent becomes 0 or 1 This gives bit 6 of the byte being read Send 1 Wait until the value sent becomes 2 or 3 This gives bit 5 of the byte being read Send 3 and so on until all the bits have been read 34 B 4 2 Receiving a packet To receive a packet Wait until the value sent by the other end changes from 3 to 0 Send 3 Wait until the value sent by the other end changes from 0 to 1 Send 1 Receive two bytes see above The first is the packet type and the second is the number of additional bytes that follow Receive the additional bytes if any Receive the 2 byte checksum CRC Wait for the value sent by the other end to go from 0 or 1 bit 0 of the last byte to 3 Send 3 Wait for the value sent by the other end to go from 3 to 2 B 5 Example Here the master sends a packet to the slave 3 3 Msserreadyiotansmitbys Save ready to receive bytes 3
31. his character from the start of the font The last entry gives the offset of the first byte after the font Fonts can use memory up to and including 6BFFh After the character offset table is a pattern table Each entry in it is a single byte since draft mode only prints one pass The least significant bit corresponds to the top pin The length of the pattern table isn t that important but in the standard fonts it can be deduced simply by subtracting 258 from the offset of character 0 After that we have the character descriptions As mentioned above for each char acter its description is from offset char to offset char 1 An entry is a stream of bytes If the top bit is set it means Leave a blank column before printing this column The values of the low 7 bits are 00h 79h This is an offset into the pattern table The bit pattern for the next column is the byte at that offset 7Ah 7Fh Repeat the next pattern byte 78h times putting a blank column before the second and subsequent repetitions note that unlike the NLQ print there is no literal bitmap type 28 A 4 Some worked examples 41 NLQ Character 0 using BIOS 1 15 Looking in the NLQ table the first 2 entries are 01F6h 0209h The character bytes between those offsets 60F3h 6106h are all values in hex 2E 14 15 03 08 1A 08 7A 01 44 08 4C 08 36 20 OA 2B 02 82 Le Fiat pate Secon pa CE a o o EET o NEC MEN 40 p 49 1 BEES MER
32. ire button is depressed Bit 0 1 if the joystick is pushed down 12 4 Cascade interface The Cascade joystick interface also appears at OEOh The Head over Heels driver for this joystick doesn t work with a Spectravideo interface it uses these bits Bit 7 0 if the fire button is pressed Bit 6 Ignored Bit 5 Ignored Bit 4 0 if the joystick is pushed up Bit 3 Ignored Bit 2 0 if the joystick is pushed down Bit 1 O if the joystick is pushed to the right Bit 0 0 if the joystick is pushed to the left 12 5 DKTronics interface The DKTronics interface appears to be one register on a larger chip To read it write OEh to port OAAh and then read port A9h The use of register OEh and the presence of a DKTronics sound driver in Head Over Heels suggests that the chip may be an AY 3 8912 or similar sound generator Head Over Heels uses these bits of the value that it reads Bit 7 Ignored Bit 6 O if the fire button is pressed Bit 5 O if the joystick is pushed up Bit 4 O if the joystick is pushed down Bit 3 O if the joystick is pushed to the right Bit 2 O if the joystick is pushed to the left Bit 1 Ignored Bit 0 Ignored 26 13 Sound Generators 13 1 DKTronics sound generator According to posts on www amstrad es if I read Google Translate aright this interface is based on an AY 3 8912 accessed using the following ports A9 Read currently selected register AA Select register AB Write currently selected r
33. med with the blank columns inserted automatically A 5 Matrix fonts in LocoScript 1 20 The fonts are stored in the file MATRIX STD on the boot disc in the same order as in CP M The data start at an offset of 01 1Ah from the start of the file LocoScript 1 is able to print 224 characters numbers 0 127 and 160 255 These are stored as a single block of bitmaps in MATRIX STD which subtracts 32 from character codes above 160 to create its internal character index The design of MATRIX STD as a separate file seems to imply that other dot matrix fonts could be loaded in LocoScript 1 However the only alternative LS1 fonts I ve seen in Digita International s Supertype simply patch the existing MATRIX STD file Note that later versions of LocoScript 1 v1 30 use the same font format but different file formats see below A 5 1 PS widths table There are 224 characters rather than 128 so the PS widths table is 112 bytes long A 5 2 NLQ font Since there are 224 characters the offsets table is 225 words long The offsets to characters start at 0 ie what must be added is the address of the character description table not the address of the font itself The offset table is at 18Ah in the file and the character description table is at 442h The character description bytes are almost the same as in CP M but the special values of the low 7 bits are slightly different 31 00h 7Ah Multiply by 2 to get an offset into the pattern tabl
34. n bytes 0 8 16 24 32 This allows 8 lines to be interleaved for ease of printing text 5 Interrupts Various peripherals can generate interrupts When checking the source of an interrupt PCW CP M checks in the order FDC timer other peripherals 5 1 Timer interrupts The timer interrupts 300 times a second It also increments a counter which can be read from the bottom 4 bits of port F4h The counter goes from 0 15 and stays at 15 having got there Reading the counter resets it This allows PCW system software to compensate for missed timer interrupts On interrupt it reads the counter and if it is more than then it knows some interrupts have been missed If it is 0 then the timer did not interrupt the interrupt must be from a different source 5 2 Floppy controller interrupts The floppy controller can be programmed to send a normal interrupt or a non maskable interrupt NMI on completing a command See Section 8 1 If the floppy controller has tried to interrupt regardless of whether it is set to pro duce an NMI a normal interrupt or nothing at all then bit 5 of the value read from port F8h will be 1 Otherwise it will be 0 5 3 Serial port interrupts The CPS8256 interface see section 7 1 can be programmed to generate interrupts 5 4 Daisywheel interrupts The daisywheel printer see section 6 2 can be programmed to interrupt when it has finished a command 6 Printer ports 6 1 PCW8256 8512 9256 10 printer
35. oller interrupts the Z80 gets a normal interrupt If the Z80 has disabled interrupts the interrupt line stays high until the Z80 enables them again 17 04 Floppy controller interrupts are ignored 05 Set the floppy controller s Terminal count which aborts a data transfer 06 Clear the floppy controller s terminal count 8 2 Floppy drive support PCW operating systems support two floppy drives connected to the controller as drives 0 and 1 On a PCW 8256 8512 or 9512 commands for drives 2 and 3 are sent to drives 0 and 1 ie the drive number is not completely decoded On a PCW 9256 9512 or 10 commands for drive 2 appear to go to drive 1 except that the drive is always ready even when the motor isn t running As far as I can see from the schematic selecting drive 3 selects both drives simultaneously 8 3 Floppy controller probe Versions of LocoScript and CP M written after the PCW9256 was released contain code to discover what sort of PCW is in use 8256 8512 9512 or 9256 95124 10 The code then detects whether 3 5 disc drives are in use The test is done in two stages 8 3 1 Detect floppy controller type 1 Stop disc motors 2 Send SENSE DRIVE STATUS for drive 0 to the disc controller until it reports drive 0 is not ready 3 Send SENSE DRIVE STATUS for drive 2 On an 8256 8512 or 9512 this returns the same status as drive 0 ie not ready But on a 9256 9512 or 10 it returns a status of ready 8 3
36. or ports 0320h 0323h which is where the reg isters appear on a PC For full programming information see the IBM PC technical reference pages 1 187 to 1 201 0AS8h Data register 0A9h When read controller status When written Reset controller OAAh When read controller DIP switches When written Generate controller select pulse OABh When written DMA and interrupt mask not used on the PCW In addition the Gem interface has a 4k boot ROM It would appear that on initial startup memory accesses with A7 reset go to the boot ROM while memory accesses with A7 set go to the PCW mainboard So the 4k ROM is mapped into memory from 0000 007 0100 017F 0200 027F 1F00 1F7F The first thing the GEM boot rom does is to mimic the normal PCW boot process by copying the standard boot image section 2 into memory It does this by repeated memory reads from address 80h so with A7 set until the sequence D3 F8 OUT OF8h A is encountered Then it executes its own write to that port to switch to normal execution and copies itself into RAM While the ROM is paged in all I O port accesses use 16 bit I O OUT C A style with the top 8 bits of the address set to 80h The first instruction after the boot ROM has been copied into RAM is IN A 0A9h with A 0 Presumably this I O read with the top 8 bits of the address all 0 pages the boot ROM out The format of the Gem drive boot track is documented in Appendix C In a Gem 2 mirrore
37. ouse The Keymouse connects between the PCW and the keyboard It uses the same mech anism as the keyboard to appear as a memory mapped device replacing four of the keyboard joystick bytes 3FFBh Bits 6 0 horizontal movement counter Bit 7 Middle mouse button pressed 3FFCh Bits 7 6 high bits of vertical movement counter 3FFDh Bits 4 0 low bits of vertical movement counter 3FFEh Bit 7 Left button Bit 6 Right button 11 4 Electric Studio light pen The lightpen appears at ports OA6h and 0A7h The method it uses to encode its position is not known 12 Joysticks 12 1 Keyboard joystick s These are described in section 10 3 12 2 Kempston interface The Kempston interface is visible at port OFh It appears to have the same bit assign ments as the Spectrum version of the interface Bits 7 5 Ignored Bit 4 1 if the fire button is pressed Bit 3 1 if the joystick is pushed down Bit 2 1 if the joystick is pushed up Bit 1 1 if the joystick is pushed left Bit 0 1 if the joystick is pushed right 12 3 Spectravideo interface The Spectravideo joystick interface appears at OEOh so it cannot be used at the same time as a CPS8256 interface The values it returns are Bit 7 Always 0 If nothing is present on this port 1 is returned Bit 6 Ignored Bit 5 Ignored Bit 4 1 if the joystick is pushed to the right 25 Bit 3 1 if the joystick is pushed up Bit 2 1 if the joystick is pushed to the left Bit 1 1 if the f
38. protocol in these terms For PCW to parallel communications ACK is the high bit of the number and BUSY is the low bit B 1 1 Bit mapping at the PC end On a PC parallel port these lines are swapped over BUSY appears on bit 7 and on bit and the sense of is inverted it s 1 if the PCW is sending 0 and vice versa Additionally when output is being made the STROBE line must be raised and then lowered otherwise the LocoLink interface does not detect the changed values B 2 Link idle When the link initially starts the slave sends 2 and the master sends 3 In the protocol described below this means that the slave is listening for the first packet B 3 Sending B 3 1 Sending a byte Note Bytes must only be sent in packets see below Wait until the value sent by the other end goes from 3 to 1 Send 2 or 3 depending whether bit 7 of the byte is 1 or 0 Wait until the value sent by the other end goes from 1 to 3 Send 0 or 1 depending whether bit 6 of the byte is 1 or 0 Wait until the value sent by the other end goes from 3 to 1 33 B 3 2 Send 2 or 3 depending whether bit 5 of the byte is 1 or 0 and so on until all the bits of the byte have been sent Sending a packet Before sending a packet the value sent by the other end should be 2 It may also be 3 if so send 3 and wait for it to change to 2 B 4 B 4 1 Note Send 0 Wait until the value received goes from 2 to 3 S
39. r pass 1 1 for pass 2 or vice versa On return the registers should be BC IX corrupt DE incremented by number of bytes written to the buffer All other registers and flags preserved A 6 Matrix fonts in LocoScript v1 31 The MATRIX STD file in this version of LocoScript has a 128 byte header so 80h needs to be added to all offsets 32 A 7 Matrix fonts in LocoScript v1 40 This version of LocoScript doesn t have a MATRIX STD file Instead it has a PRINTER JOY The format of the data is the same but 1D40h needs to be added to all offsets B LocoLink wire protocol The description of the LocoLink protocol is derived from examination of the slave program LLINK202 EMS The protocol appears to be symmetrical ie the master and the slave go through the same steps to transmit a packet However it s easier to see what is going on at the slave end where the LocoLink interface presents the data directly to the CPU than at the master end where the parallel port interface gets slightly in the way see section B 1 1 The PCW16 version of LocoLink appears to use a later protocol which works slightly differently These differences will be noted in the text B 1 Basic concepts LocoLink works with two wires in each direction each computer can control the values of two and read the values of the other two The values taken together form a two bit number 0 3 and it s most convenient to describe the
40. s can be in one slot at once memory writes go to one and reads to the other io L0 lock to ead unused Block to writ This method only allows access to the first 128k of memory which is another good reason why no PCW programs use it There is an additional port used in CPC paging port F4h output The value written to this is interpreted as follows EE lock C000 FFFF lock 8000 BFFF lock 4000 7FFF lock 0 unused If a memory range is set as locked then the block to read bits are ignored memory is read from the block to write 4 The screen The screen is a 720x256 array of pixels each pixel twice as high as it is wide The video controller can fetch the screen data from anywhere in the bottom 128k of RAM see port F5h below 4 1 T O ports The following ports are used by the video controller FSh output sets the address of the Roller RAM within the bottom 128k of memory The Roller RAM is a 512 byte table whose format is given in section 4 2 The value written to this port can be interpreted as follows Bits a Bed T3 I2 L1 T9 e g to move the Roller RAM to offset 3200h in memory block 4 write the value 10011001 binary 99h to port F5h 1 Arnold Number Two F6h output sets the vertical origin of the screen The value written to it specifies which line of the Roller RAM corresponds to the top line of the screen So OUT OF6h 8
41. scabel creme directory OO 3Ah removdiedoy OO Master sends new directory mele 3E deefie 3m maie melle 3m set file pointer 43h 4i Slave returns current directory 4Eh find first file AL search attribute Master sends search path aL dii If successful slave returns find file data 35 Sm sWge mesamp 3B eei C The Gem Drive System Track The first track of the Gem drive contains a boot image which is loaded and executed by the 4k boot ROM The hard drive setup program provided with the drive will write this when asked to repartition the drive or update the boot loader On the utilities diskette it is stored in a file called HD SYS The boot image starts with a header corresponding to the MBR on an IBM formatted hard drive 37 Options byte 8 bit checksum of bytes 0 22h Note that the SPT field in the DPB at offset 9 gives sectors per cylinder while the Sectors per track at offset 1 Ah really does give sectors per track For example a Gem drive with 5 heads and 17
42. t http www seasip demon co uk Cpm software amstrad html gt 27 After the character offset table is a pattern table Each entry in it is two bytes long the high byte is printed on the first pass and the low byte on the second or vice versa The high byte is drawn slightly above the low one anyway The least significant bit corresponds to the top pin The length of the pattern table isn t that important but in the standard fonts it can be deduced simply by subtracting 258 from the offset of character 0 After that we have the character descriptions As mentioned above for each char acter its description is from offset char to offset char 1 An entry is a stream of bytes If the top bit is set it means Leave a blank column before printing this column The values of the low 7 bits are 00h 79h Multiply by 2 to get an offset into the pattern table Then take the two bytes at that offset for the first and second pass 7Ah The two bytes after this code are printed on the first and second pass 7Bh 7Fh Repeat the next pattern byte 79h times putting a blank column before the second and subsequent repetitions A 3 The draft font As with the NLQ font the draft font starts with a character offset table in which every word is formed Bit 15 The character has a descender print it on the bottom 8 pins rather than the top 8 Bits 14 12 Space to put at the left of this character Bits 11 0 Offset of the specification of t
43. two known boot programs one for dot matrix PCWs and one for daisy wheel PCWs They are identical except for two bytes the code used to check if the boot sector is valid and another byte which has presumably been altered so the checksum comes out the same 3 RAM and paging The PCW memory is divided into blocks of 16k A PCW8256 has 16 blocks while a fully upgraded 2Mb PCW has 128 The processor can only address 64k at a time the I O ports FOh F3h are used to select which blocks it sees where F0h controls what the processor sees at 0000h 3FFFh Fih controls what the processor sees at 4000h 7FFFh F2h controls what the processor sees at 8000h BFFFh F3h controls what the processor sees at CO00h FFFFh 3 1 PCW extended paging mode Usually values written to the memory management ports have bit 7 set and the other 7 bits set to the block number Bits Bis O 7 6 5 4 3 2 1 0 block number for example block 4 could be selected into memory at 8000h by an OUT 0F2h 84h If the block number is out of range then the top bits will be ignored so attempting to select block 24 on a 256k computer would actually select block 8 3 0 CPC standard paging mode This paging mode is not used by any CP M or LocoScript software except perhaps the memory tester RAMTEST COM It is present because the PCW was based on a never built design for ANT a successor to the CPC range If CPC paging mode is used then two block
44. ytes encoded rate to port E4h To set the receive baud rate send 76h to port E7h and the two bytes to port E5h The encoded rate is 125000 send the high byte first then the low byte 7 2 SCA Mark 2 Interface The SCA interface is programmed in the same way as the CPS8256 except that there s also a Real Time Clock fitted The RTC is not emulated in JOYCE so this information has not been verified use it at your own risk To read a byte from the RTC Set channel A DTR Reset channel B For each bit Unset channel A DTR read the channel B Ring Indicator and set channel A DTR The bit obtained should be complemented The first bit read is bit 7 of the byte the last is bit 0 To write a byte to the RTC Set channel A DTR For each bit if it s a 1 then reset channel B If it s a zero set channel B RTS Then reset and set channel A DTR Finally unset channel A DTR reset channel B read a single bit from the channel B Ring Indicator and set channel A DTR again To send an RTC command start the command Unset channel A DTR reset channel B set channel B RTS then set channel A DTR Send the command bytes using the write code above Read any result bytes using the read code above For all result bytes except the last Reset channel B set channel B RTS unset channel A DTR set channel A DTR and then reset channel B again Finally set channel B RTS set channel A DTR unset channel A DTR an

Download Pdf Manuals

image

Related Search

Related Contents

Franke CR 910 M WH 60+  GJクラシックドアミラー取扱説明書  セキスイ 施工・取説 No.16 ペットシャワーロング  The Audit Plan – template user guide    Integra® Miltex®  ServiceNews  T-Lite Lightkit User Manual  Manual - Absolute Acoustics  Ecommerce Help Manual (1 of 3)  

Copyright © All rights reserved.
Failed to retrieve file