ts2068 technical manual - mame progetto-snaps · ts2068 technical manual this is the second edition...

178
TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on the original blue manual released by Timex Computer Corp. shortly before it folded. Aside from a page renumbering and some sections that were added in the second edition, there is not a lot of difference between the two. This doc was captured using Adobe Acrobat 3.0, the only software I could find that did a half-decent job. There are still numerous errors where Acrobat got confused, but I'm too lazy to fix them. Alvin 05/10/98 aralbrec@concentric. net

Upload: others

Post on 02-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TS2068 Technical Manual

This is the second edition of the manual published by Time DesignsMagazine (now defunct). It is based on the original blue manualreleased by Timex Computer Corp. shortly before it folded. Aside froma page renumbering and some sections that were added in the secondedition, there is not a lot of difference between the two.

This doc was captured using Adobe Acrobat 3.0, the only software I couldfind that did a half-decent job. There are still numerous errors whereAcrobat got confused, but I'm too lazy to fix them.

Alvin 05/10/98aralbrec@concentric. net

Page 2: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TIMEX SINCLAIR 2068PERSONAL COLOR COMPUTER

TECHNICAL REFERENCE MANUAL

Prepared by

V. C. Corcoranand

M. H. Branigin

TIMEX COMPUTER CORPORATIONWaterbury CT 06720

o May 1984S e c o n d Edition P r i n t i n g

P u b l i s h e d E x c l u s i v e l y b y :

TIME DESIGNS MAGAZINE CO.COLTON, OREGON 97017

@ JANUARY 1986

Page 3: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

PREFACE

This manual is dedicated to the many individuals associatedwith the Timex Computer Corporation in the development andproduction of the TS2068. Our special thanks to Nan Parsonswho prepared the TS2068 Schematic and other drawings usedin this manual.

While every effort has been made to make this documentcomplete and accurate, use of the technical informationcontained herein is at user's sole risk. The Timex Corp. orits affiliates, and Time Designs Magazine Company assume noresponsibility or liability for the safety or performanceof any product manufactured relying on the technical datacontained herein, or any liability, loss, damage, orexpense sustained by reason of any claim that such productsinfringe any patent or other industrial property right.

The Second Edition of this Technical Manual has been re-edited by Tim Woods. Special thanks to Bob Orrfelt and DaveClifford for technical assistance.

If you would like to receive information on a magazine andother publications for the Timex Sinclair 2068, direct yourinquiry to: Time Designs Magazine Company, 29722 Hult Rd.,Colton,, OR 97017.

Tlmex Slnclair 2068 Technical Manual (2nd Edition), Copy r i gh t 1986 by the Tlme DesignsMagazine Company . Reproduction of this document in whole or in part by any means wi thoutexp ressed w r i t t en permission f rom Tlme Designs, Is prohibited by law.

This manual was pr inted by Toad’l Litho Printing and Composition, Oregon Ci ty , OR 97045.

Page 4: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TARLE OF CONTENTS

1.0

1.1

2.0

2.1

2.2

2.3

2.4

3.0

3.1

INTRODUCTION 1

TS 2068 Overview 1

1.1.1 Hardware Overview1.1.2 System Software Overview1.1.3 Cartridge Software Overview

HARDWARE GUIDE 7

Major Hardware Functions 7

2.1.1 AC Adapter2.1.2 Voltage Regulation2.1.3 Z80A CPU2.1.4 ROM2.1.5 32K RAM2.1.6 Programmable Sound Generator2.1.7 Joystick Port2.1.8 Control Logic2.1.9 Keyboard2.1.10 16K Video Display RAM2.1.11 Video Generation2.1.12 Cassette I/O2.1.13 Port Map

Schematic (see inside back cover and Appendix D)

Unit Absolute Ratings 53

Interfaces and Connectors 53

2.4.12.4.22.4.32.4.42.4.52.4.62.4.72.4.8

System Bus Connector - PlCartridge Connector - J4Cassette I/OJoystickComposite Monitor OutputRF OutputKeyboard Interface Connector - J9AC Adapter Power Plug

SYSTEM SOFTWARE GUIDE 65

Identifier 65

Page 5: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE OF CONTENTS

(continued)

3.2 ROM Organization and Services 65

3.2.1 Home ROM

3.2.1.1 Fixed Entry Points3.2.1.2 BASIC AROS Support3.2.1.3 General

3.2.2 Extension ROM

3.2.2.1 Fixed Entry Points3.2.2.2 General3.2.2.3 Video Mode Change Service3.2.2.4 Extension ROM Interface Routine

3.3 RAM Organization and Services 72

3.3.1 System Variables3.3.2 System Configuration Table3.3.3 Machine Stack3.3.4 OS RAM Routines

3.3.4.1 RAM Interruption Handler3.3.4.2 RAM Service Routines3.3.4.3 Function Dispatcher

4.0 SYSTEM I/O GUIDE 91

4.1 I/O Channels 91

4.1.1 Keyboard4.1.2 Video Screen4.1.3 2040 Dot Matrix Printer

4.2 Cassette Tape 1024.3 Joysticks 1044.4 Software Generated Sound (BEEP) 1054.5 Programmable Sound Chip (SOUND) 105

5.0 ADVANCED CONCEPTS 106

5.1 Cartridge Software/Hardware 106

5.2 Advanced Video Modes 117

5.3 Other 125

Page 6: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE OF CONTENTS

(continued)

6.0 KNOWN "BUGS" AND CORRECTIONS 126

6.1 LROS and Machine Code AROS 1266.2 Machine Code AROS 1266.3 BASIC AROS 127

:*9Video Mode Change Service 127

6.6 OS General RAM Routines 134129

APPENDICES

Appendix A - System ROM Maps/OS RAM Module 136Appendix B - System Variables Definition File 150Appendix C - Application Development Library 158

C-l 64-Column ModeC-Z 80-Column Modec-3 40-Column Modec-4 Dual Screen Modec-5 Sprites

Appendix D - 288

D-l TS2068 PCB Assembly DrawingD-2 TS2068 Parts ListD-3 TS2068 Schematic Diagram

Appendix E - Expansion Buss Comparisons 295Appendix F - Modifications for EPROMs 296

Page 7: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE NO.

LIST OF FIGURES

TITLE

1.1-1 TS 2068 Block Diagram1.1-2 Memory Configuration1.1-3 RAM Mapping1.1-4 System Initialization Flowchart

2.1.3-1 CPU Timing2.1.3-2 Op Code Fetch Timing2.1.3-3 Memory Read/Write Timing2.1.3-4 I/O Read/Write Timing2.1.3-5 Interrupt Request/Ack.Cycle2.1.4-1 Rework for EPROM's2.1.6-1 PSG Register Block Diagram2.1.6-2 Tone Period Registers2.1.6-3 Noise Period Register2.1.6-4 Mixer Control-I/O Enable Reg.2.1.6-5 D/A Converter Signal Generation2.1.6-6 Amplitude Control Registers2.1.6-7 Variable Amplitude Control2.1.6-8 Envelope Period Registers2.1.6-9 Envelope Shape/Cycle Control Reg.2.1.6-10 Envelope Generator Output2.1.6-11 Envelope Generator Output Detail2.1.7-1 Joystick Port Operation2.1.8-1 Bank Selection Logic2.1.8-2 Video RAM Address Generation2.1.9-1 Keyboard Schematic2.1.10-l Video RAM Data Organization2.1.11-1 Composite Video Signal

2.4.1-1

2.4.1-22.4.1-32.4.2-l

2.4.2-22.4.4-l2.4.8-l

3.2.2-l Ext.ROM Interruption Fielder3.2.2-2 Ext.ROM Interface Routine

4.1.1-14.1.1-2

4.1.2-14.1.2-24.2-l4.3-l

Pl Mating Connector MechanicalRequirements

Pl Signal LayoutRGB Monitor Connection SchematicJ4 Mating Connector Mechanical

RequirementsJ4 Signal LayoutJoystick ConnectorAC Adapter Plug

Keyboard Mode ControlKeyboard Support Routines

FlowchartsStandard Character Table LocationsScreen Row/Column DesignationsTape Header FormatsJoystick Data Format

Page 8: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

LIST OF FIGURES(continued)

FIGURE NO. TITLE

5.1-1 EPROM Cartridge Board Schematic5.1-2 Ctdg.Bd.Component Side Artwork5.1-3 Ctdg.Bd.Solder Side Artwork5.1-4 EPROM Cartridge Bd. Solder Mask

6.5-l6.5-26.5-3

TABLE NO.

2-l

2.1.6-12.1.6-2

2.1.8-1

2.1.13-1

2.4.1-1

2.4.1-2

2.4.2-l J4 Signal Definitions

2.4.2-2 J4 Signal ElectricalCharacteristics

2.4.4-l

3.2.2-l

3.3.4-l OS RAM Service Routines

3.3.4-2 Function Dispatcher Services

GET STATUS CorrectionsPUT-WORD CorrectionsBANK ENABLE and RESTORE STATUS

Corrections-

LIST OF TABLES

TITLE

Z80A Control Signals

PSG I/O Enable Truth TablePSG I/O Port Truth Table

SCLD I/O Pin Function Definitions

I/O Port Map

Pl Signal Definitions

Pl Signal ElectricalCharacteristics

Joystick Connector SignalAssignment

Inputs to Video Mode ChangeService

Page 9: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

1.0 INTRODUCTION

This manual provides detailed technical information on the TimexSinclair 2068 Personal Color Computer. In conjunction with the TS2068User Manual, it is intended to assist the reader in understanding the

programming techniquesarchitecture, hardware and software features,and I/O techniques pertaining to the TS2068.

1.1 TS2068 Overview

1.1.1 Hardware Overview

Figure 1.1-1 is a block diagram ofmajor functional componentsconnections. These components are:

Control Logic - SCLD (Standard CellCPU - Z80A Microprocessor

the TS2068 showing theand their logical

Logic Device)

RA!!ROM

- 48K Random Access Memory- 24K System Read-Only Memory

(16K plus 8K Extension)

System Bus ConnectorCartridge ConnectorSound Generator/SpeakerVideo CircuitsCassette READ/WRITEJoystick Connectors

The TS2068 Cartridge Connector provides for the plug-inof cartridges containing programmed ROM's with up to 64Kof addressable memory. The full 64K is not normallyutilized (e.g., due to need for access to RAM for themachine stack). See Section 5.1 for details.

Figure 1.1-2 shows the standard TS2068 memoryconfiguration comprised of the Home Bank, the ROMExtension Bank and the Dock (Cartridge) Bank. Thismemory is selectable as eight 8K 'chunks' with the HomeBank being enabled by default, i.e., any chunk notselected in the Extension or Dock Bank is automaticallyenabled in the Home Bank.

Memory selection and I/O are controlled via the I/Oports. These topics are covered in detail in latersections.

Page 10: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 1.1-1

TS 2068 SYSTEM BLOCK DIAGRAM

r-l-l16K

[” R A M

I r KEYBOARD MATRIX A8-A15 1

QwNK

I

6

5

4

3

2

I

0

14.112 wLHZ T

ADDRESSFFFFH

AoeeN

BooeN

6OMlN

4Mw

2oww

FIGURE l.i-2

TS 2068 STANDARD MEMORY CONFIGURATION

RAM

RAM

RAY

48KRAM

AAY

RAYr/

ROMi 16K

ROM

ROY

ROY

ROM

ROYBROM__..

ROM

HOWBANK EXTENSJON BANK CARTIttOWi(BANK *255) (BANK -254) (DOCK)

UP TO 64K‘Full 64K l ddr.s&ng *PM..not normally utlllrad.So. S4ctlon 5.1

2

Page 11: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

1.1.2 System Software Overview

The TS2068 System Software resides in the Home ROM, theExtension ROM, and dedicated RAM. It supports thefollowing functions:

- System Initialization

- BASIC Interpreter (including BASIC cartridge support)

- BASIC I/O for Standard Peripherals

o keyboardo video screeno 2040 32-col. dot matrix printero cassette tapeo joystickso software generated sound (BEEP)o programmable sound chip (SOUND)

- Video Mode Change Service

- Interruption Servicing (Z80 Int. Mode 1)

- Bank Switching/Data Transfer Services

- Function Dispatcher (provides access to selected systemroutines via a Service Code input)

In addition, portions of the Home Bank RAM are used forthe machine stack, the BASIC system variables, thePrinter Buffer and the Display Files. Figure 1.1-3 showsthe standard mapping of the Home Bank RAM and the mappingnecessary when the second display file is to be used withthe BASIC interpreter still functional. The Video ModeChange Service routine makes these memory modifications.Note that there is no direct support of the seconddisplay file via BASIC or in the system ROM I/O routines.

Figure 1.1-4 is a Flowchart of the System Initializationprocess.

3

Page 12: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

P-RAYI

RAYTOF

SlNEMoSluBoT

WOIUCSFE-Llr(E

VA%4PRtx

CKAMSAllsRw

664ol-f

626&l6owH5CO.H56oeH

4oa.H

FIGURE 1.1-3

STANDARD MAPPING OF

HOME BANK RAM

wo

(MACHI)(E UmE VARIARLESIOS R*LwIEw COtx

yIcn*IE srAu-SrSlEY VARIABLES

PRINTER BUFFER

MSPUV~l

A) 1 Dhpby Fk

OS RAu-aEsmEwr cool!MACMNE STACU

tzu:

(UACWE COOE VA-9

06PLArFLE2

SVSTEY VA-S-R BUFFER

DfsFuV F&E 1

F-RAY1

8F6caMOFTCoIlRAMTOP

STUEUBSlUROfWORKSPE-LINEVARS

CEESARSRUF71uH

4

Page 13: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

SET MAX. ADDRESS

=(R*YToPl

SET -NEW- FLAG

SAVE (P-RAM),

~lJDCl.(PIP) 6(RASP)

I

FIGURE 1.1-4

SYSTEM INITIALIZATION

POWER ON

(lJDG).tPIP) 6

WC. PP. LL RASP I

HITIALIZE SVSTEM

VARIABLES

I HITIALIZLCHANS/STREAYS I

la PRIN,,;, B U F F E R 1

I COPY OS RAM

CODE TO CHUNK 3 t -’

To BASIC AROS

Suppor t Cd*

JWil

5

Page 14: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

1.1.3 Cartridge Software Overview

The TS2068 supports two basic types of Cartridge orROM-Oriented Software designated as LROS (LanguageROM-Oriented Software) and AROS (Application ROM-OrientedSoftware) which pluq into the cartridge connector. Theyare identified via overhead bytes at Location 0 for anLROS or 32768 (8000H) for an AROS. The fundamentaldifference is that an LROS contains 280 machine code inmemory chunk 0 and is in total control of the TS2068hardware including the RESTART implementation andInterruption Mode setting and handling, while an AROS isdependent on the System ROM or an LROS for thesefunctions if needed. An AROS written in BASIC, which mayalso include machine code accessed via the USR function,is supported from the System ROM BASIC Interpreter and ismapped beginning in memory chunk 4. An AROS may also bewritten entirely in Z80 machine code. An AROS written inany other high-level language would require an LROSsupporting that language and would have to be integratedwith the LROS in a single cartridge.

See Sections 3.2.1.2, BASIC AROS Support and 5.1,Cartridge Software/Hardware, for additional details.

6

Page 15: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.0 HARDWARE GUIDE

2.1 Description of Major Hardware Functions

Figure 1.1-1 shows a simplified block diagram of the TS2068. Thefollowing functional units are described in the followingsections:

SECTION FUNCTIONAL UNIT

2.1.1 AC Adapter2.1.2 Voltage Regulation2.1.3 Z-80A CPU2.1.3.1 Address Bus2.1.3.2 Data Bus2.1.3.3 Control Signals2.1.3.4 OP Code Fetch2.1.3.S Memory READ/WRITE2.1.3.6 I/O READ/WRITE2.1.3.7 Maskable Interruption2.1.3.8 Non-Maskable Interruption (NMI)2.1.4 ROM2.1.5 32K RAM2.1.6 Sound Generator2.1.7 Joystick Port2.1.8 Control Logic2.1.8.1 Bank Selection Logic2.1.8.2 Z80 Clock Generator2.1.8.3 Display File Access2.1.8.4 Interruption Generation2.1.9 Keyboard2.1.10 16K Video Display RAM2.1.11 Video Generation2.1.11.1 Composite Video2.1.11.2 RF Modulator2.1.12 Cassette I/O2.1.13 Port Map

Page 16: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.1 AC Adapter

The AC Adapter transforms 117V AC (Nominal) to filteredDC via a step down transformer, full-wave bridgerectifier, and filter capacitor to supply from 14 to 25volts at 1 amp over the AC voltage variation range of 105to 130 V AC. Transformer isolation exceeds 1500 volts.

AC 60Hz_ _

2.1.2 Voltage Regulation

Unregulated DC from the AC Adapter is supplied forregulation through a bi-filar torroidal inductor whichreduces conducted line emanation for FCC compliance andthrough the power-ON/OFF switch located on the left sideof the TS2068. This switch voltage is supplied to theSystem Bus Connector (see Section 2.4) and for regulationto the +12 V regulator and the +5 V regulator.Characteristics are as follows:

SUPPLY VOLTAGE RANGE CURRENT RANGE

5V 4.75 - 5.25V 200ma - 1.0 A12v 11.5 - 12.5V 20ma - lOOma

>

)14 to 25v REGULATOR

DC b

+20v

+5v

+12v

GND ,

Page 17: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

The 12V regulator is a 78L12 series5V regulator is a switching supplycircuit.

2.1.3 Z-80A CPU

The Z-80A CPU of the TS2068 operates

,

at a clock frequency

regulator while theutilizing the 78S40

of 3.53 MHz. Primary features of this CPU are:

158 instructionsDual register setTwo index registersOn-chip refresh logic

The Z-80 CPU executes instructions by proceeding througha sequence of operations that include:

a) instruction Op code fetchingb) READ or WRITE memoryc) READ or WRITE I/Od) Acknowledge an interruption

The basic clock period is referred to as a T time orstate and three or more T states make up a machinecycle. In the TS2068, each T-time is approximately 283nanoseconds (2.83 X 10-7 seconds). Figure 2.1.3-1illustrates the basic timing.

FIGURE 2.1.3-1

BASIC CPU TIMING EXAMPLE

f 1 12 ‘3 14 ‘1 12 13 11

Page 18: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.3.1

2.1.3.2

2.1.3.3

2.1.3.4

2.1.3.5

Address Bus

Output from the Z-80 are 16-bits of addressinformation, A0 - A15, which are high-activetri-state signals and address for memory dataand I/O device exchanges.

Data Bus

These input/output signals from the Z-80, DO -D7, constitute an 8-bit bi-directional,high-active, tri-state data bus used for dataexchanges with memory and I/O devices.

Control Bus

Associated with the Z-80 are 13 control lineswhich are provided by or used by the Z-80 tocontrol system operation. These signals aredetailed in Table 2-l.

Op Code Fetch

The timing during an Ml cycle (OP Code Fetch)is shown in Figure 2.1.3-2. At the beginningof the Ml cycle the PC (Program Counter) isplaced onto the address bus, then one-halfclock time later the /MREQ signal goes activeindicating that the memory address is stable.The signal is activated to indicate thatmemory read data should be gated onto the databus. At the rising clock edge during the T3state, the CPU samples the data on the data busand deactivates the /RD and /MREQ signals.During the T3 and T4 states, the CPU decodesand executes the fetched instruction and theCPU places on the lower 7 bits of the addressbus a memory refresh address and activates the/RFSH signal indicating a refresh read is tobegin when /MREQ is activated.

Memory READ/WRITE

Memory read or write cycles other than Op CodeFetches are 3 clock periods long with the /MREQand R[T signals used as in the fetch cycle.During a write cycle them signal is activatedwhen the write data is stable on the data bus.The address and data bus contents remain stablefor one-half T state after the m signal goesactive. Figure 2.1.3-3 illustrates.

10

Page 19: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.1.3-2

INSTRUCTION OP CODE FETCH

WI)T

iii

DO - 07

Rii

FIGURE 2.1.3-3

MEMORY READ OR WRITE CYCLES

- wlmwv R*rd C*d* * Mmor* WlllC Cvclr *

‘ 1 72 ‘3 ‘ 1 72 ‘3

Q ti ‘\ r’ 47 (7

i-A0 = Al5 I MEMOAV ADDR I MEMOR V ADDR

I I I

11

Page 20: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.3.6 I/O READ/WRITE

During I/O operations RJl?Q and Kb or l?R areactivated on the leading edge of the T2 clockand a single Wait state is automaticallyinserted as illustrated in Figure 2.1.3-4. Thel?lJ and m signals are used to enable data fromthe addressed port onto the data bus and to, onthe rising edge of AR, clock data to the I/Oport, respectively. Note that external I/O maystretch the activation period of the $fX'i' lineto extend the I/O cycles.

FIGURE 2.1.3-4

INPUT OR OUTPUT CYCLES

A 0 -Al

WR

>

WflUCvclr

OATA OW -

l Inserted bv 280 CPU

12

Page 21: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

INTERRUPT REQUEST / ACKNOWLEDGE CYCLE

2.1.3.7 Maskable Interruption

When enabled by software, whenactive and when RisT is activeedge of the last clock of anymaskable interruption occurs

-BITsRb is notat the risinginstruction, a

during thesubsequent Ml cycle, as illustrated in Figure2.1.3-5.

FIGURE 2.1.3-5

DATA BUS------_ -_~-__-~_----l--_--l_____I_____

WAIT __,----_.----_.-----m----m--_-

G Mode 0

In Interruption Mode 0, the interrupting I/Odevice places any instruction on the data busduring the Imactivation and the CPU executesthat instruction. The RESTART instruction iscommonly used for this purpose. m willautomatically set Interruption Mode 0.

In Interruption Mode 1, the CPU executes aRESTART to Location 0038H. This is the modenormally used by the TS 2068 software.

In Interruption Mode 2, the CPU concatenatesthe 8-bit argument, which must be a E-byteboundary address, with the 8-bit I Registercontents to form a 16-bit pointer to a memorytable entry containing the 16-bit serviceroutine address the first byte in the table

13

Page 22: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

being the low order portion of the address.Once the interrupting device supplies the lowerportion of the pointer (for concatenation), theCPU automatically pushes the PC onto the stack,obtains the starting address from the table,and does a jump to that address. 19 clockperiods are required to complete this sequence.

2.1.3.8 Non-Maskable Interruption (NMI)

A pulse on the m input to the Z80 sets theinternal latch which is tested by the CPU atthe end of each instruction. The NMI haspriority over the maskable interruption and itsreponse is identical to the maskableinterruption (Mode 1) except that the calllocation is 0066H instead of 0038H.

NOTES: 1. The NMI is not used by the TS2068.

2. Comments in the ROM listingclaiming to "mask the NMI” viathe DI instruction areincorrect. The DI instructionmasks only the maskableinterruption.

14

Page 23: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2-1

Z-80 CONTROL SIGNALS

ACRONYM

SYSTEM CONTROL

MR~Q

IORQ

m-

RI-SH

DEFINITION

Machine Cycle 1 - Output, active low. Thissiqnal indicates that the current machine cycleis-the OP code fetch cycle. During executionof instructions having a 2-byte OP code, thissignal is enerated as each OP code byte isfetched. 19e is also used with Imto indicatean interrupt acknowledge cycle.

Memory Request - Tri-state output, active low.This signal indicates that the Address Busholds a valid address for a memory read orwrite operation.

I/O Request - Tri-state output, active low.This signal indicates that the lower half ofthe Address Bus holds a valid I/O address foran I/O read or write operation. This signal isalso used with li!l- in connection withacknowledging an interruption, indicating thatan interrupt response vector can be placed onthe data bus. I/O operations never occurduring Ml-time.

Memory Read - Tri-state output, active low.Tm indicates that the CPU wants toread data from memory or an I/O device. Theaddressed memory or device should use thissignal to gate the requested data onto the CPUdata bus.

Memory Write - Tri-state output, active low.This signal indicates that the CPU data busholds valid data to be stored in the addressedmemory or I/O device.

Refresh - output, active low. This signalindicates that the lower 7 bits of the AddressBus contain a refresh address for dynamicmemories and the current.7 signal should beused to do a refresh read to all dynamicmemories. A7 is a logic zero and the upper 8bits of the Address Bus contain the contents ofthe I Register.

15

Page 24: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2-1

Z80 CONTROL SIGNALS(continued)

CPU CONTROL

ACRONYM 'DEFINITION

Halt State - Output, active low. This signalindicates that the CPU has executed a HALTinstruction. CPU operations are suspendeduntil a Non-Maskable or a Maskable Interruption(with the mask enabled) occurs. While halted,the CPU executes NOP's to maintain memoryrefresh.

WAIT Wait - Input, active low. This signalindScates to the CPU that the addressed memoryor I/O device is not ready for a datatransfer. The CPU will continue to enter waitstates as long as this signal is active. Thisallows for synchronization of the CPU toexternal devices of varying speeds.

Interrupt Request - Input, active low. Thissignal is generated by external devices and ishonored at the end of the current instructionif the interrupt is not masked by the softwareand if the m signal is not active. Whenthe CPU accepts theacknowledge signal is sentof the next instructiontime). There are threeselectable by the software.

interruption, anout at the beginningcycle Cm at Mlinterruption modes

Non-Maskable Interruption - Input, negativeedge triggered. This signal has a higherpriority than mand is always recognized atthe end of the current instruction (cannot bemasked). The CPU is forced to restart tolocation 0066H with the program counter savedin the external stack. NOTE: The NMI is notused in the TS2068 ROM software design.

16

Page 25: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2-1

Z80 CONTROL SIGNALS(continued)

ACRONYM DEFINITION

RESET Reset - Input, active low. This signal forces-program counter to zero and initializes theCPU. Address and data buses go to their highimpedance state and control output signals totheir inactive state. No refresh occurs.Initialization includes: Disable the interruptenable flip-flop and set Register I, Register Rand the Interrupt Mode all to Zero.

CPU BUS CONTROL m Bus Request - Input, active low. This signalis used to request the CPU address bus, databus and tri-state output control signals to qoto a high impedance state permitting otherdevices to control these buses. The CPU setsthese buses to a high impedance state at thetermination of the current Machine cycle.

BUSAK Bus Acknowledge - Output, active low. Thissignal is used to indicate to the requestingdevice that the CPU has set its address, dataand control bus signals to a high impedancestate in response to BUSR5R

Figure 2.1.4-1

REWORK TO REPLACE ROM's with EPROM's

17

Page 26: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.4 ROM

The system includes both a 16K byte ROM and an 8K byteROM mapped into the address space as shown below.

3FFFh

(u16)16KROM

OOOOh ,4

1FFFh

OOOOh

HOME BANK EXPANSION BANK

Section 2.1.8.1 describes the selection of the Home Bankand Expansion Bank via the control logic.

The devices involved are a 23128 and a 2364 for the 16Kbyte (128K-bit) and the 8K byte (64K-bit) ROM'srespectively. Direct replacement of these devices with27128 and 2764 EPROM's is not possible since pins 1 and27 must be maintained in the high state for those devices(see schematic in Section 2.2). To replace U16 and U20with 27128 and 2764 EPROM's requires the rework shown inFigure 2.1.4-1.

(1) Cut input to pin 27 on each chip.

(2) Wire +5V to pins 1 and 27 on each chip to pull high.

If U20 is to be a 27128, then replace the RD input to pin26 with address Al3 from pin 26 on U16.

2.1.5 32K RAM (Address 8000-FFFFH)

The upper 32K of RAM is composed of four 200ns 4416's(16K x 4 dynamic RAMs).

18

Page 27: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.6 Sound Generator

The Programmable Sound Generator (GI 8912) is accessed via PortsOF5H (Address) and OF6H (Data). The basic registers in the PSGwhich produce the programmed sounds include:

Tone Generators: Produce the basic square wave tone frequenciesfor each channel (A, B, C).

Noise Generator: Produces a frequency modulated pseudo-randompulse width square wave output.

Mixers: Combine the outputs of the Tone Generators and the NoiseGenerator. One for each channel (A, B, C).

Amplitude Control: Provides the D/A Converters with either afixed or variable amplitude pattern. The fixed amplitude isunder direct CPU control; the variable amplitude is accomplishedby using the output of the Envelope Generator.

Envelope Generator: Produces an envelope pattern which can beused to amplitude modulate the output of each Mixer.

D/A Converters: The three D/A Converters each produce up to a16-level output signal as determined by the Amplitude Control.

An additional register is shown in the PSG Block Diagram (Figure2.1.6-l) which has nothing directly to do with the production ofsound -- this is the I/O Port (A). Data to/from the CPU may beread/written to/from the 8-bit I/O Port without affecting anyother function of the PSG. The TS 2068 uses the I/O Port toaccess the joysticks.

2.1.6.1 Tone Generator Control (Registers RO-R5)

The frequency of each square wave generated by the three ToneGenerators (one each for Channels A, B, and C) is obtained in thePSG by first counting down the input clock by 16, then by furthercounting down the result by the programed 12-bit Tone Periodvalue. Each 12-bit value is obtained in the PSG by combining thecontents of the relative Coarse and Fine Tune registers, asillustrated by Figure 2.1.6-2.

Note that the 12-bit value programed in the combined Coarse andFine Tune registers is a period value -- the higher the value inthe registers, the lower the resultant tone frequency.

Note also that due to the design technique used in the TonePeriod countdown, the lowest period value is 000000000001 (divideby 1) and the highest period value is 111111111111 (divide by4095).

19

Page 28: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.1.6-l

PSG REGISTER BLOCK DIAGRAM

R7 R7 X7 Enable IOB 1 IOA 1 C BI A C BI AR8 R8 RlO Ch.A Amplitude /f////////f////// M 1 L3 L2 Ll i LR9 R9 Rll Ch.B Amplitude ,///////////////// M 1 L3 L2 ,Ll 1 _ LR10 RA Rl2 Ch.C Amplitude I//////////////// M / L3 L2 1 Ll 1 LORll RB Rl3 Envelope I 8 Bit Fine Tune ER12 RC R14 Period 1 8 Bit Coarse Tune E

1 Envelope vlllllll~l~~~~~~~~~~///I I I IR13 RD R15 Shape/Cycle ~//////////r////////////iCONT.IATT. IALT. IHOLD

I/O Port AR14 RE Rl6 Data Store I 8 Bit Parallel I/O on Port A 4

FIGURE 2.1.6-2

12-BIT TONE PERIOD (TP) TO TONE GENERATOR

COARSE TUNE FINE TUNEREGISTER CHANNEL REGISTER

Rl A ROR3 R2R5 ! R4

B7 B6 B5 B41B3 B2 Bl BOI iB7 B6 B5 B4 B3 B2 Bl BO 1

I

\

TPll TPlO TP9 TP8 1 TP7 TP6 TP5 TP4 TP3 TP2 TPl TPo(

20

Page 29: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.6.1 (continued)

The equations describing the relationship between the desired output tonefrequency and the input clock frequency and Tone Period value are:

(a) fT = fCLOCK16TP

10

Where: fT =

fCLOCK =

Desired tone frequency

Input clock frequency

TP = Decimal equivalent of the Tone Period10 bits TPll to TPO

CT =10

Decimal equivalent of the Coarse Tuneregister bits B3 to BO (TPll to TP8)

FT =10

Decimal equivalent of the Fine Tuneregister bits B7 to BO (TP7 to TPO)

From the above equations, itfrom a low of:

(b) TP = 256CT + FT10 10

can be seen that the tone frequency can range

fCLOCK/65520 (wherein TP = 4095 )10 10

to a high of:

fCLOCK/16 (wherein TP = 1).10

The TS 2068 uses a 1.76475 MHZ input clock, so it can produce a range of 26.9Hz to 110 kHz.

21

Page 30: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.6.1 (continued)

To calculate the values for the contents of the Tone Period Coarse and FineTune registers, given the input clock and the desired output tone frequencies,we simply rearrange the above equations, yielding:

(a) TP = fCLOCK10 76

(b) CT + FT = TP10

Example 1: fT = 1 kHZ fCLOCKK = 1.76475 MHz6

TP = 1.76475x 1010 3

16(1x10 ) = 110.3

Substituting this result into equation (b):

CT +FT = 110.310

resulting in:

CT = 0 = 0000 (B3-BO)10 2

FT = 110 = 01101110 (B7-BO)10 10 2

Example 2: fT = 100 Hz fCLOCKK = 1.76475 MHz6

TP = 1.76475~1010 2 = 1103

16(1x10 )

Substituting this result into equation (b):

CT + FT = 110310 = 4 + 79/256

resulting in:

CT = 4 = 0100 (B3-BO)10 10 2

FT = 79 = 01001111 (B7-BO)10 10 2

2 2

Page 31: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.6.2 Noise Generator Control (Register R6)

The frequency of the noise source is obtained in the PSG by firstcounting down the input clock by 16, then by further countingdown the result by the programmed 5-bit Noise Period value. This5-bit value consists of the lower 5 bits (B4-BO) of Register R6as illustrated by Figure 2.1.6-3.

FIGURE 2.1.6-3

NOISE PERIOD REGISTER R6

1 B/ B6 BS 1 B4 B3 B2 Bl BO 1

NOT USED 5-BIT NOISE PERIOD (NP)TO NOISE GENERATOR

Note that the 5-bit value in R6 is a period value -- the higherthe value in the register, the lower the resultant noisefrequency. Note also that, as with the Tone Period, the lowestperiod value is 00001 (divide by 1); the highest period vam11111 (divide by 31 1.

10

The noise frequency equation is: fN = fCLOCK16 NP

10

Where: fN = Desired noise frequencyfCLOCK = Input clock frequencyNP = Decimal equivalent of the

10 Noise Period register bitsB4-B0.

From the above equation it can be seen that the noise frequencycan range from a low of fCLOCK/496 (wherein NP =31 )

10 10to a high of fCLOCK/16 (wherein NP = 1). Using a 1.76475 MHz

10clock, for example, would produce a range of noise frequenciesfrom 3.6 kHz to 110.3 kHz.

To calculate the value for the contents of the Noise Periodregister, given the input clock and the desired output noisefrequencies, we simply rearrange the above equation, yielding:

NP = fCLOCK/l6fN10

23

Page 32: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.6.3 Mixer Control I/O Enable (Register R7)

Register 7 is a multi-function Enable register which controls thethree Noise/Tone Mixers and the two general purpose I/O ports.

The Mixers, as previously described, combine the noise and tonefrequencies for each of the three channels. The determination ofcombining neither/either/both noise and tone frequencies on eachchannel is made by the state of bits B5 thru BO of R7.

The direction (input or output) of the two general purpose I/Oports (IOA and IOB) is determined by the state of bits B7 and B6of R7. Note that in the TS 2068 there is no second I/O Port B.

These functions are illustrated by Figure 2.1.6-4 and Tables2.1.6-l and 2.1.6-2 below.

FIGURE 2.1.6-4

MIXER CONTROL - I/O ENABLE REGISTER R7

1 87 1 6 1 BS 1 84 J 83 B2 1 Bl 1 BO 1

/ \I

85 84 B3

0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1

TABLE 2.1.6-1

I/O ENABLE TRUTH TABLE

LE TRUTH TABLt TONE ENABLE TRm TABLtNoise tnabled R/ BITS Tone tnabledon Channel B2 Bl BO on Channel

C B AC B -

A; :-

B AB -

- - A_ _ -

0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1

C AC ! -C - Ac - -

B AB -

A

24

Page 33: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.1.6-2

I/O PORT TRUTH TABLE

I R’ ET” I I/O Port StatusIOA

0 Input1 output

NOTE

Disabling noise and tone does not turn off a channel. Turning achannel off can only be accomplished by writing all zeroes into thecorresponding Amplitude Control register, R8, R9 or RlO (refer toParagraph 2.1.6.4).

2.1.6.4 Amplitude Control (Registers R8, R9, RlO)

The amplitudes of the signals generated by each of the three D/AConverters (one each for Channels A, B, and C) is determined bythe contents of the lower 5 bits (B4-BO) of Registers R8, R9 andRlO as illustrated by Figure 2.1.6-5.

FIGURE 2.1.6-5

D/A CONVERTER SIGNAL GENERATION

AMPLITUDE CONTROLREGISTER # CHANNEL

R8 AR9RlO :

I B’ B6 BS 1 B4 1 B3 B2 B1 B” -

USEDf

L2 Ll LO

Amplitude 4-Bit Fixed'Mode' Amplitude Level

2 5

Page 34: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.6.4 (continued)

The amplitude 'mode' (Bit M) selects either fixed level amplitude (M=O)or variable level amplitude (M=l). It follows then that Bits L3-LOdefining the value of a 'fixed' level amplitude, are only active whenM=O. When fixed level amplitude is selected, it is 'fixed' only in thesense that the amplitude level is under the direct control of thesystem processor (via bits L3-LO). Varying the amplitude when in this'fixed' amplitude mode requires in each instance the directintervention of the system processor via an address latch/write datasequence to modify the L3-LO data.

When M=l (select 'variable' level amplitudes), the amplitude of eachchannel is determined by the envelope pattern as defined by theEnvelope Generator's 4-bit output E3-EO (refer to Paragraph 2.1.6.5).

The amplitude 'mode' (Bit M) can be thought of as an 'envelope enable'bit, i.e. when M=O the envelope is not used, and when M=l the envelopeis enabled.

Figure 2.1.6-6 illustrates all combination of the 5-bit AmplitudeControl.

FIGURE 2.1.6-6

AMPLITUDE CONTROL REGISTERS

AMPLITUDE CONTROLREGISTER # CHANNEL

R8 AR9 BRlO C

E Amplitude Control\L3 :2 :1 Lb output

0 0 0 0 0 “0 0 0 0 The amplitude0 l *.* I... is fixed at 1 of0 . . . . . . . . 16 levels as0 . . . . . . . . determined by0o i i i i ii-ii

L3-LO.

1xXxX E3 E2 El EO The amplitude isvariable at 16

(X=Don't Care1 levels as deter-mined by theoutput of theEnvelope Gen.

*The all zeros code is used to turn a channel "off".

26

Page 35: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.6.4 (continued)

Figure 2.1.6-7 graphically illustrates a selection of variable level(envelope-controlled) amplitude where the 16 levels directly reflectthe output of the Envelope Generator. A fixed level amplitude wouldcorrespond to only one of the levels shown, with the level directlydetermined by the decimal equivalent of Bits L3-LO.

FIGURE 2.1.6-7

VARIABLE AMPLITUDE CONTROL

15

I.

13

12

\

Gtwwc AEPRESENTATI~N ofTHE DECIMAL VALUES OF THE

AMPLITUOE CONTROL OUTPUT

$1

IO9

0

(M=l)

CHANNEL ATMAXIMUMAMPLITUDE

2.1.6.5 Envelope Generator Control (Registers Rll, R12, R13)

To accomplish the generation of fairly complex envelope patterns,two independent methods of control are provided in the PSG;first, it is possible to vary the frequency of the envelope usingregisters Rll and R12; and second, the relative shape and cyclepattern of the envelope can be varied using register R13. Thefollowing paragraphs explain the details of the envelope controlfunctions, describing first the envelope period control and thenthe envelope shape/cycle control.

2.1.6.5.1 Envelope Period Control (Registers Rll, R12)

The frequency of the envelope is obtained in the PSG by firstcounting down the input clock by 256, then by further countingdown the result by the programed 16-bit Envelope Period value.This 16-bit value is obtained in the PSG by combining thecontents of the Envelope Coarse and Fine Tune registers, asillustrated by Figure 2.1.6-8.

27

Page 36: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.1.6-8

16-BIT ENVELOPE PERIOD (EP) TOENVELOPE GENERATOR

ENVELOPE ENVELOPECOARSE TUNE FINE TUNEREGISTER R12 REGISTER Rll

Note that the 16-bit value programmed in the combined Coarse andFine Tune registers is a period value - the higher the value inthe registers, the lower the resultant envelope frequency.

Note also that, as with the Tone Period, the lowest period valueis 000000000000001 (divide by 1); the highest p-value is1111111111111111 (divide by 65,535 ).

2 10

The envelope frequency equations are:

(a) fEE = fCLOCK256 EP

10

Where:::LOCKlEP =

10CT =

10FT =

10

(b) EP = 256 CT + FT10 10 10

Desired envelope frequencyInput clock frequencyDecimal equivalent of the EnvelopePeriod bits EP15-EPODecimal equivalent of the CoarseTune register bits 87-60 (EP15-EP8)Decimal equivalent of the FineTune register bits B7-BO (EP7-EPO)

From the above equation it can be seen that the envelope frequency canrange from a low of fCLOCK/16,766,960 ,. (wherein EP = 65,535 )

10 10to a high of fCLOCK/256 (wherein EP =l). Using a 1.76475 MHz clock,

10 10for example, would produce a range of envelope frequencies from 0.105Hz to 6893.6 Hz.

28

Page 37: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

To calculate the values for the contents of the Envelope Period Coarseand Fine Tune registers, given the input clock and the desired envelopefrequencies, we rearrange the above equations, yielding:

(a) EP = fCLOCK (b) CT + FT EP10 256fE

Example:

fE = 0.5 HzfCLOCK = 1.76475 MHz

6EP = 1.76475 x 10 = 13787

10 256(0 . 5)

Substituting this result into equation

CT + FT = 13787 = 53 + 219

10&=+

(b):

10 1 0 2 5 6 256256

CT = 53 = 00110101 (B7-BO)10 2

FT = 219 = 11011011 (87-80)10 2

2.1.6.5.2 Envelope Shape/Cycle Control (Register R13)

The Envelope Generator further counts down the envelope frequencyby 16, producing a 16-state per cycle envelope pattern as definedby its 4-bit counter output, E3-EO. The particular shape andcycle pattern of any desired envelope is accomplished bycontrolling the count pattern (count up/count down) of the 4-bitcounter and by defining a single-cycle or repeat-cycle pattern.This envelope shape/cycle control is contained in the lower 4bits (B3-BO) of register R13. Each of these 4 bits controls afunction in the envelope generator, as illustrated in Figure2.1.6-9.

29

Page 38: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.1.6-9

ENVELOPE SHAPE/CYCLE CONTROL REGISTER (R13)

[B7 86 B5 B41 I

\NOT USED/

82 Bl BO1

t -----3

--------- +'

L ______________ 3

Function\

HOLD

ALTERNATE

ATTACK

CONTINUE

/

ToEnvelopeGenerator

The definition of each function is as follows:

HOLD When set to logic "1", limits the envelope to one cycle, holdingthe last count of the envelope counter (E3-EO = either 0000 or1111, depending on whether the envelope counter was in countdownor countup mode respectively.

ALTERNATE When set to logic "l", the envelope counter reverses countdirection (up-down) after each cycle.

NOTE

ATTACK

When both the Hold bit and the Alternatebit are ones, the envelope counter is resetto its initial count before holding.

When set to logic "l", the envelope counter will count up(attack) from E3-EO = 0000 to E3-EO = 1111; when set to logic

o:oi.the envelope counter will count down (decay) from 1111 to

CONTINUE When set to logic "l", the cycle pattern will be as defined bythe Hold bit; when set to logic "O", the envelope generator willreset to 0000 after one cycle and hold at that count.

30

Page 39: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

To further describe the above functions, numerous charts of the binarycount sequence of E3-EO could be used, showing each combination ofHold, Alternate, Attack and Continue. However, since these outputs areused (when selected by the Amplitude Control registers) to amplitudemodulate the output of the Mixers, a better understanding of theireffect can be accomplished via a graphic representation of their valuefor each condition selected, as illustrated in Figures 2.1.6-10 and2.1.6-11.

FIGURE 2.1.6-10

ENVELOPE GENERATOR OUTPUT

R13I aa B2

cOk

1I

N

uE

0

0

I

I

I

I

1

,

t

,

.1I

2I

0

I

0

0

0

0

I

1

I

1

01 001A

1‘IEnNAt

e

X

X

0

0

I

I

0

0

1

1

GI*OMlC RLPACSEN?ATlOWc oi ENVELOPE CEWCn*TOA0 OUTPUT Ea EZ Cl EO.

X

X

0

REFER TO FIGURE 2.1.6-11I FOR OETAIC

0

0

EC IS fNt ENVCLOPZ PEaloo@un*1mM 0s OlrE CYCLE1

31

Page 40: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.1.6-11

DETAIL OF TWO CYCLES OF FIGURE 2.1.6-10

2.1.6.6 I/O Port Data Store (Register R14)

Register R14 functions as an intermediate data storage registerbetween the PSG/CPU data bus (DA7-DA0) and the I/O Port(IOA7-IOAO). This port is available for reading the joysticks.Using register R14 for the transfer of I/O data has no effect atall on sound generation.

To output data from the CPU bus to a peripheral device connectedto I/O Port A would require the following steps:

1. Latch address R7 (select Enable register)2. Write data to PSG (setting R7, B6=1)3. Latch address R14 (select IOA register)4. Write data to PSG (data to be output on I/O Port A)

To input data from I/O Port A to the CPU bus would require thefollowing:

Latch address R7 (select Enable register):: Write data to PSG (setting R7 B6=0)3. Latch address R14 (select IOA register)4. Read data from PSG (data from I/O Port A)

Note that once loaded with data in the output mode, the data willremain on the I/O port until changed either by loading different data,by applying a reset (grounding the Reset pin), or by switching to theinput mode.

32

Page 41: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

Note also that when in the input mode, the contents of register R14will follow the signals applied to the I/O port, However, transfer ofthis data to the CPU bus requires a "read" operation as described above.

2.1.7 Joystick Port Operation

The joystick port (Register 14 of the Sound Chip - Section2.1.6.6) is read via an IN-instruction directed at port F6H withselection of activating data from the left (player 1) or right(player 2) determined by Address bits 8 and 9 as shown in Figure2.1.7-1. In order to address Register 14, a OEH must be writtento port F5H (Sound Generator Address) prior to reading joystickdata. Section 4.4 describes the software sequence necessary tocontrol this hardware.

In the example of Figure 2.1.7-1, the joystick, shownschematically in the lower left of the drawing, is composed of amovable center stick which is pushed up to touch the up-contactand, therefore, electronically connects pin-8 to pin-l. In thisstate, a read of port F6H with address bit A8 high, causesactions as follows:

(1) Address A8 high turns on transistor Q8

I:;98 drives cable pin-8 lowThe movable center stick of the joystick in contact withthe up-contact results in a conductive path from cablepin-8 to cable pin-l.

(4) Pin-l low results in a 0 in bit position 0 of the I/Oregister via the isolation diode.

The various positions of the stick similarly result in variousbits being read from the I/O register.

Note that +5 volts and ground are available on the connector SO

+5V logic could be attached to the joystick port.

33

Page 42: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.1.7-l

JOYSTICK PORT OPERATION

:.: LEFT (Pla7.r lb

l JOYSTICK

::::::::::..:::l :. .

::i

:. 9876 i.: :: :: :: :. RaGnT (P1ay.c 2) ::. JOISTlCK :

: CONNECTOR:

:::. ..

: :: ::s4321;

1I

lzIt 108

107

F@17

34

Page 43: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.8 Control Logic

The control logic of the TS2068 is primarily a Standard CellLogic Device in a 68-pin JEDEC leaded carrier package andincludes the following major functions:

SECTION FUNCTION

2.1.8.12.1.8.22.1.8.3

2.1.8.4

Bank Selection LogicZ-80 Clock GenerationDisplay Timing, DMA Display File Access,Attribute Control, and Pixel Data Serial ShiftInterruption Generation

BEEP Output (See Section 2.1.13.2)CASSETTE I/O (See Section 2.1.12).

Additionally, Table 2.1.8-1 provides a description of thefunction of each SCLD I/O pin. See the System Schematic inAppendix D for pin numbering.

2.1.8.1 Bank Selection Logic

The TS2068 is a Z-80 based computer, therefore it candirectly address only 64K bytes of memory via its 16-bitaddress. Additionally, since the Z-80 has no relocationor indirection capability, the conventional technique ofextending the memory space available to the Z-80 is bankswitching. The TS2068 provides extended bank switchingby allowing selection of memory in 8K "chunks" which areidentified by bank number and chunk number as illustratedin Figure 2.1.8-1 for the internal bank selection logic.The externally sourced BT (Bank Enable) signal can beused by external logic to disable the internallycontrolled memories.

As shown in Figure 2.1.8-1:

(1) The cartridge is selected on a memory access with:

::Port FF bit 7 = 0The HSR at port F4h has a "1" in the bitselected by a decode of Address bitsA13-A15. and

C . E is high

causing activation of RDSCS (ROS ChipSelect).

35

Page 44: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

(2) The EXROM bank is selected on a memory access with:

;:Port FF bit 7 = 1The HSR at port F4H has a "1" in the bitselected by a decode of Address bits Al3- A15.

C. E’t! is high

causin the activation of- (Ext. ROMEnables

(3) The Home Bank is selected on a memory accesswith

a. The HSR at Port F4H has a "0" in the bitselected by a decode of Address bits Al3- A15.

b. B'l? is high.

causing the activation of the appropriateenable signal as detailed below.

To understand the details of the schematic, of Section 2.2 (Appendix D):

(1) SELECT CARTRIDGE of Figure 2.1.8-1 involves activating m toits low active state

(2) SELECT EXROM of Figure 2.1.8-l involves activating -to itslow active state

(3) SELECT HOME BANK of Figure 2.1.8-1 involves

a.

b.

C.

d.

Activating m to its low active state when A15=0 andA14=0Activating m to its low active state when Al+0 andA14-1Activating W to its low active state when Al5=1 andA14-0Activating 71As3 to its low active state when Al5=1 andA14=1.

3 6

Page 45: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.1.8-1

BANK SELECTION LOGIC

0

l *

.----_

._ - --_ ; ___ _

-----.HoRtLowT*L

ELECT MUSTER

t

Port F4h

PatFFbdt 7

Page 46: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.1.8-l

SCLD I/O PIN FUNCTION DEFINITIONS

DIRECTIONOF SCLD

SYMBOL NAME IN/OUT FUNCTION

AO-A7Al3-A15

DO-D7

Address Bus

Data Bus

KBO-KB4 Keyboard Outputs

A7R A7+Refresh

MAO-MA7 Muxed Adrs.Bus

Ts

OCPU

Tri-StateDisplayMemory Ctl.

Clock to CPU

ROMCS

RASl

In

In/Out

Address Bus lines Input from Z8OA

Data Bus inputs/outputs from/toZ80A through U9-74LS245 or inputsfrom display RAM (16K) - U6 and U7

In Inputs from 5 lines of keyboardmatrix - goes low at one of 8address line (active low)sequences on I/O Request

out To refresh and address 8th bitaddress line input of RAM memory(not display) of 32K of 4416RAM's (Home Bank 8000H to FFFFH)

out Display memory muxed address busand refresh

out Tri-State control for address anddata buffers when CPU is address-ing display memory at same timedisplay controller is addressingthe display memory

out CLK - Clock to Z80A CPU which isinterrupted to stop CPU when CPUwants to address display RAM atsame time as display controller

out To control read/write directionof 74LS245 Data Bus Buffer be-tween CPU and SCLD

out To activate the 16K Home ROM(first 16K) when memory selection(MS) is set to Home Bank

out To activate row address strobe fordisplay memory only during memoryread/write, refresh and displayread

ReadDirectionControl to

Home ROMChip Select

Row AddressStrobe #1

38

Page 47: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.1.8-1

SCLD I/O PIN FUNCTION DEFINITIONS(continued)

DIRECTIONOF SCLD

SYMBOL NAME IN/OUT FUNCTION

CASl

CASZ

CAS3

DRAMWE

MUX

V

v

rm

RR

Column Address out To activate column address strobeStrobe #l for display memory only (2nd 16K)

durinq memory read/write and

strobe

display read _

Column Address out To activate column addressStrobe #2 for Home Bank RAM (3rd 16K 1

Column Address out To activate column addressStrobe #3 for Home Bank RAM (4th 16K 1

strobe

Dynamic RAMWrite Enable

out

MUX Control of outRAM Address

Chroma Vector V out

Luminance V out

Read to CPU In

Write from CPU In

Memory Request In

I/O Request In

When active low, enables a writeinto the display RAM only

MUX control to 74LS157 (UlO & Ullto multiplex the row and columnaddresses to all dynamic RAM's

Color vector level for quadrature(R-Y) input to video modulator

Luminance (briqhtness) controllevel

CPU is reading from a memory orI/O location

CPU is writing to a memory or I/Olocation

CPU is requesting access to amemory location to read or write

CPU is requesting access to anI/O location to read or write

39

Page 48: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.1.8-l

SCLD I/O PIN FUNCTION DEFINITIONS(continued)

DIRECTIONOF SCLD

SYMBOL NAME IN/(JUT FUNCTION

Tape In

vcc

RoscS

SPKR/TAPEOUT

oc

BDIR

BCl

Refresh

Tape Input

Bank Enable

ExtensionROM Select

+5 Volt Power

Interrupt toCPU

ROS Chip Select

Speaker andTape Output

Clock "C"

Bus Directionto Sound Chip

Bus Control toSound Chip

In

In

In

out

In

out

out

out

out

out

out

CPU is generating a refreshaddress to refresh dynamic RAM's

Magnetic tape signal input

When active low, indicates thatinternal memory ’ disabled(Home, Extension aniSDock Banks)and an external memory is in use

Active low chip select signal forExtension ROM

Power (+5Vl input to SCLD

Interrupts CPU to handle keyboardstrobing and timer for PAUSE com-mand. Open drain N channel withinternal pull-up

ROM-Oriented Software (CartridgeBank) Chip Select

Digital output to magnetic tapeand to sound amplifier for speakeroutput

Clock for sound chip 81.764 MHz.

A bus direction control signal tothe PSG. When high the soundchip either receives a write toPSG or latches addresses from thedata bus

A bus control signal to the PSG.When high the sound chip eitheris read to data bus or latchesaddresses from the data bus

40

Page 49: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.1.8-1

SCLD I/O PIN FUNCTION DEFINITIONS(continued)

DIRECTIONOF SCLD

SYMBOL NAME IN/OUT FUNCTIONixc out OSCl'llator Out out Xtal Oscillator amplifier output

to drive crystal

OSC In Oscillator In In Xtal Oscillator amplifier inputto sense crystal signal

U Chroma Vector U out Color vector level for quadrature(B-Y) input to video modulator

GND Ground In Ground return of SCLD

u Buffered Clock out Buffered CPU clock to outside (Jl- connector)

R Red Color Output Out Produce color signals to RGBmonitor (TTL level)

G Green Coloroutput

out Produce color signals to RGBmonitor (TTL level)

B Blue Color out Produce color signals to RGBoutput monitor (TTL level)

41

Page 50: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.8.2 Z-80 Clock Generation

The oscillator circuit utilizes an AT-cut quartz crystalat 14.112 MHz. This oscillator feeds a divide by 4 chainto generate the 3.528 MHz clock for the CPU (0 CPU).This clock runs continuously except when the CPUaddresses the 16K bytes of RAM containing the videodisplay file at the same time the video display processorlogic requires access to that same RAM. For thiscontention case the CPU clock is stopped in the highstate until the video display processor access has beencompleted, then the CPU clock continues in its normalmanner.

2.1.8.3 Display File H/W Control and Timing

The 14.112 MHz oscillator is also used to drive thecounter chain deriving video timing. By dividing the14.112 MHz. signal by 896 a 15.75 KHz horizontal sweepfrequency is generated. The 15.75 KHz signal feeds ag-stage counter which counts from 0 to 106H (262 decimal)developing the 60.1145 Hz vertical sync. See Figure2.1.8-2.

During each horizontal scan the video display processoraccesses, in the standard video mode, 32 bytes of pixeldata plus 32 bytes of attributes by 32 memory accessesreading 2 bytes per access in RAM page mode, i.e. the loworder address bits are provided to the RAM once via RASactivation, then the data byte is read during the firstactivation of CAS and the attribute byte is read duringthe second activation of CAS. The page mode operation iscompleted by deactivating RAS. (See Fiq. 2.1.8-2.)

The accessed pixel data is serially shifted out to thevideo generation circuitry at a rate of 1 bit each 142nanoseconds (7.056 MHz) resulting in the need to fetch anew data/attribute pair each 1.134 microseconds duringthe horizontal scan time. The shifted out pixelinformation is used to control the selection of the 3paper color (pixel=0) or 3 ink color (pixel=1) bits to beqated out as the R, G, and B signals. When FLASH isenabled by the attribute byte, the INK and PAPER fieldinformation is swapped at the 1.879 Hz. flash rate. TheR, G, and B signals control the D-to-A converter whichgenerates the proper U, V, andToutputs for use by the1889 to create composite video.

The address information provided to the RAM's duri nq RASand CAS times is as shown in Figure 2.1.8-2. Thisaddress generation logic explains the non-sequentialnature of the video display as described in Section2.1.10.

42

Page 51: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.1.8-2

VIDEO DISPLAY PROCESSOR RAM ADDRESS GENERATION(Normal Video Mode)

DISPLAY PIXEL DATA ADDRESS

Address Bit: 15 14 13 12 11 l0 9 8 7 6 54321/0

Range= $flBRQMLKPONIHGFD4000H- \57FFH CASYA

/\ /Rk

DISPLAY ATTRIBUTE ADDRESS

Address Bit: 15 14 13 12 11 1 0 9 8 7 6 5 4 3 21JY

Range= ,ffl~ll~RQPONIHGFD5800H- \ v /L J5AFFH CAS 1B RAS

VIDEO TIMING COUNTER CHAIN

MSB LSB Y PIXELLINE LINE (8 Bit Group) COLUMN

s R-t) PON MLI( 1 H

t

1.764Counter MHz

60.1145 Hzlr

(14.112Vert.Sync. MHz/8)

43

Page 52: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.8.4 Interruption Generation (17 ms)

During the vertical blanking interval (once each 15.635ms) the SCLD, if enabled by the INTEN bit (Bit 6) of I/OPort FFH, activates the TiJT signal which directlyconnects to the m input to the 280. A CPU maskableinterruption can then occur, as described in Section2.1.3.7, if enabled.

2.1.9 Keyboard

The keyboard for the TS 2068 has forty-two (42) hard keys(typewriter style) with tactile feel utilizing anover-dead-center type of rubber spring pad and a carbon pill thathits the P.C. board, just under the keyboard, to short-out a pairof closely placed precious metal contacts. The read-out matrixis an eight by five cross point switching as shown in Figure2.1.9-1.

Each switch closure connects one of the eight high order addresslines (by going low through a diode) to one of the five inputlines to the SCLD (KBO through KB4).

Scanning is by software algorithm as described in Section 4.1.1.During the IN instruction, address bits AO-A7=FEH select theKeyboard I/O port while bits A8-A15 select the particular 5 keysto be sampled during the particular IN instruction execution.For example, an IN instruction directed at the keyboard I/O portwith address bit A8 low and A9-A15 high will supply O's on KBO,KBl, KB2, KB3, and/or KB4 if the CAP SHIFT, Z, X, C, and/or Vkeys are respectively denressed.

Note that when reading the I/ O port FEH, data bits D5-D7 are notpart of the keyboard information.

Section 2.4.7 details the connection of the keyboard to the mainP.C. board'.

2.1.10 16K Video Display RAM

The 16K-byte video display RAM, composed of two 4416's, isisolated from the Z80A CPU by the SCLD control logic and buffersto allow the video display processor to access pixel andattribute data from the display files independent of the CPU (seeSection 2.1.8.3).

The Video Display RAM is located in Chunks 2 and 3 of the HomeBank, beginning at 400DH and 600DH respectively. Figure 2.1.10-lillustrates the organization of the Primary Display File locatedat 4000H. The second display file utilizes the sameorganization. Based on the video mode set via Port FFH, thevideo hardware accesses the RAM for pixel data and attributecontrol information.

44

Page 53: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

Flgure 2.1 .9. KEYBOARD SCHEMATIC

I I I I

:- I

DATA B U S

45

Page 54: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIG. 2.1.10-lDISPLAY FILE ORGANIZATION (NORMAL MODE)

canL 10iI=C 3'K 4

5

32 BYTES 32 BYTESI. LINE 0 !LINE!

I 4oool 4o01401l- 4020 . . . . . . . I-

4100 4101:::::411F 4120.......413F4200 4201 ... ..421 F 4220.......423 F4300 4301 ... ..431 F 4320.......433 F4400 4401 ... ..441 F 4420.......443 F4500 4501 ... ..451 F 4520.......453 F

0 6 4600 4601 . . . ..461F 462O.......463F . . . . . . . . . . .7 4700 4701 . . . ..47lF 4720.......473F . . . . . . . . . . .

CHAR CHAR. . CHAR .POS. POS. POS.O/O O/l o/31

32 BYTES 32 BYTES

32 BYTESL I N E !

mto 40t1 ...... t41E0 41El .... ..41F F42E0 42El .... ..42F F43E0 43El .... ..43F F

.... ..44F F

.... ..45F F

.... ..46F F

.... ..47F FCHXR-POS. ’

7/o 7/l 7/31

03 RYTFC

32 BYTES 32 BYTES 32 BYTES_!V!!! !LrNE!5000 5001 Wll- 5um . . . . . . .5100 5101:::::51lF 5120.......51

. . . . . . . . . . . tu SW1

. . . . . . . . . . . 51E0 51Elcan

b ::

3P4

2 27

5200 5201 . . . ..521F 5220.......523F . . . . . . . . . . . 52E0 52El . . . . ..52FF5300 5301 . . . ..531F 5320.......533F . . . . . . . . . . . 53E0 53El . . . . ..53FF5400 5401 . . . ..541F 5420.......543F . . . . . . . . . . . 54E0 54El . . . . ..54FF5500 5501 . . . ..551F 5520.......553F . . . . . . . . . . . 55E0 55El . . . . ..55FF5600 5601 . . . ..56lF 5620.......563F . . . . . . . . . . . 56E0 56El . . . . ..56FF5700 5701 . . . ..571F 5720.......573F . . . . . . . . . . . 57E0 57El . . . . ..57FFCHAR-CH7iR. . CHAR . CHAR CHAR. . CHAR .

POS. POS. POS.8/O 8/l 8/31

POS. POS.15/o 15/l

POS.15/31

POS. POS. POS. POS. POS. POS.1610 16/l 16/31 23/O 23/l 23/31

ATTRIBUTE FILE:

2 1 5AOO..... 5AlF( 5A20.....5A3F15A40 . . . . . . . . . . . . . . . . . . . . . 5ADF(SAE0......5AFF]

4 6

Page 55: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.11 Video Generation

2.1.11.1 Composite Video

The U, V, annsignals from the SCLD are supplied to theLM1889 and associated circuitry to produce compositevideo and modulated RF. This circuitry produces colorvectors at approximately the following angles:

PHASE

BlueMagentaRedGreenCyanYellowReference

TS 2068 NTSC STANDARD(Degrees) (Degrees)

350 35064 62116 112242 240284 284170 170224 180

The Front Porch, Sync Pulse, Back Porch, and Color Burstportions of the composite video signal are illustrated inFigure 2.1.11-1. In proper adjustment the followingshould be observed:

Sync Pulse = 40 +/- 2 IRE unitsColor Burst = 35 to 45 IRE unitsColor Burst Freq. = 3.579545 MHz.+/-70 Hz

The following three facts may aid in understandingproblems with certain monitors.

1. The color burst is not synchronous with thewaveform since it is generated from the 3.579545MHz crystal and the waveform is derived from the14.112 MHz crystal. The result is observedripples at color boundaries, e.g. green tomagenta.

2. The color burst duration is 8 cycles whilestandard TV broadcast stations provide 9 cycles.This "short" burst is a problem for some monitors.

3. The color burst starts 6.4 microseconds from theleading edge of sync. Many monitors are designedto expect this start as early as 5.3microseconds, thus these monitors may not producecolor when attached to the TS 2068.

47

Page 56: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.1.11-1

COMPOSITE VIDEO SIGNALS

IRE

usec.

2.1.11.2 RF Modulator

The composite video information is used to AMmodulate the selected channel frequency via theLM1889 and associated Channel 2/3 tankcircuitry. The modulated output is filteredthrough the output filter network to reduceharmonic generation to comply with FCCrequirements. The RF circuitry is physicallycontained inside the RF-can at the rear leftcorner of the PCB (at the RF output jack). 75ohms is the output impedance.

48

Page 57: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.12 Cassette I/O

See Sections 2.1.13.2, 2.4.3 and 4.2.

2.1.13 Port Map

Table 2.1.13-1 summarizes the I/O addressing of ports utilized bythe TS 2068. Details of the data bits of each of these ports isprovided by the following sections.

2.1.13.1 Display Enhancement Control (Port FFH)

The display enhancement control register within the SCLDcontrols:

a) Selection of Enhanced Video Modes

b) Ink selection for 64-Column Mode

Cl

d)

Enable/Inhibit the 17 ms interruption to the Z80

Selection of Extension ROM or Cartridge (seeSection 2.1.8.1)

I r7 D6 1

64-Column ModeInk/Paper Selection Selection

000 - Black/White001 - Blue/Yellow010 - Red/Cyan011 - Magenta/Green100 - Green/Magenta101 - Cyan/Red110 - Yellow/Blue111 - White/Black

000 - Normal (PrimaryDisplay File)

001 - Second Display File010 - High Res. Graphics110 - 64-Column Mode

Other combinations mayproduce unpredictableresults.

(Inhibit 17 ms Interruption(0 to Enable)

EXROM/Cartridge Select(See 2.1.8.1)

Page 58: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.1.13-1

I/O PORT MAP

PORTADDRESS

(HtX1[DnrIMALl(BINARv)FUNCTION

Display Enhancement FFControl

255 11111111 R/W

Keyboard/Tape I/O FE 254 11111110 R/W

Reserved FD 253 11111101

Reserved FC 252 11111100

TS 2040,Printer FB 251 iiifioii

Sound Chip &Joystick Data F6 246 11110110 R/W

Sound Chip Address F5 245 11110101 W

Horizontal SelectRegister

F4 244 11110100 R/W 2.1.8.1

OPERATION REFERENCE

2.1.10, 2.1.13.1,3.2.2.3, 5.2

2.1.9, 2.1.13.2,2.4.3, 4.1.1, 4.2

R/W 2.1.13.3, 4.1.3

2.1.6, 2.1.7, 2.1.13.42.4.4, 4.3, 4.5

Same

2.1.13.2 Keyboard/Tape I/O (Port FEH)

Port FEH is used to input Keyboard and Tape data and tooutput Border color, Tape data, and Sound (BEEP) tones.

READ (IN)

I D’ I D6 I D5 I D4 D3 D2 Dl DO 14

KEYBOARD INPUT DATA(See 2.1.9)

/\ Not Used (Set to 0)

-TAPE INPUT (See 4.2)

50

Page 59: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

WRITE (OUT)

I D’ Db DS 1 f

hii3-Gv

I D3 I 02 Dl DO [

BORDER COLOR - 000 Black001 Blue010 Red011 Magenta100 Green101 Cyan

TAPE 110 YellowLOUTPUT 111 White(See 4.2)

I- SOUND (BEEP)OUT

2.1.13.3 TS 2040 Printer (Port 1XXXXOXX)

The TS 2040 Printer peripheral is written to and statusread from via OUT and IN instructions with Bit 7 = 1 andBit 2 = 0 (other bits are not decoded by the printer).

READ (IN)

I D’ I D6 1 Ds D4 D3 D2 Dl 1 Dq/

NOT%ED Ready for NextPixel

Printer Not-Configured

-Start ofPaper

WRITE (OUT)

I 3’! D6 Db D4 D3 1 D2 1 Dl 1 DO 11‘

NoT%SED I NOT USEDMotor Speed

Select - 0 = Fast1 = Slow

Motor ON/OFF0 = ON1 = OFF

Pixel to-Print - 0 = None

1 = Black

51

Page 60: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.1.13.4 Sound Chip & Joystick (Ports F5H and F6H)

Ports F5H and F6H are used to control and access theSound Generator and the Joysticks. Details of theregisters available via these ports is contained f nSections 2.1.6 and 2.1.7.

2.1.13.5 Horizontal Select Register (Port F4H)

The HSR addressed via Port F4H is used in the control ofthe Bank Switching logic as detailed fn Section 2.1.8.Each bit, when set, enables the corresponding 8K memory"chunk" in either the Dock Bank (Port FF, Bit 7=0) or theExtension ROM Bank (Port FF, Bit 7=1). The HSR must beset to all zeroes in order to enable the entf re Home Bank.

2.2 Schematic Diagram

Appendfx D contains a detailed schematic diagram of the TS 2068.

2.3 Unit Absolute Ratings

FUNCTION DESCRIPTION MIN MAX

TSVACTaVfn

Vfn (EAR)Vdc (IN)

Storage Temperature -40c +65C105v 130vAC Line Voltage

Operating Ambient TW O C 4 O cVoltage on any Logic -0.3v +5.3v

PinEAR input Peak AC -2.0v +5.0vInput DC Voltage 14.75V 26V

2.4 Interfaces and Connectors

The TS2068 has a number of specialized interfaces that areaccessible vi a the following connectors:

CONNECTOR TYPE LOCATION

System Bus 2X32 Card EdgeCartridge 2X18 Card EdgeMIC l/8" Mini PhoneEAR l/8" Mini PhonePlayer 1 Joystick 9-pin "D"Player 2 Joystick 9-pin "D"Monitor RCA PhonoTV RCA PhonoKeyboard 14-pin SIPAC Adapter

Right RearUnder TCC doorRearRearLeft SideRight SideRearRearInside-Left RearRear

52

Page 61: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.4.1 System Bus Connector - Pl

The TS2068 provides a 2 X 32 pin connector, which isdesignated as Pl, at the right rear corner of theconsole. The mechanical, functional, and electricalrequirements of the system buss connector are detailed inthe following tables and figures:

FIGURE/TABLE

Figure 2.4.1-1 Pl

Figure 2.4.1-2 Pl

Table 2.4.1 - 1 Pl

Table 2.4.1 - 2 Pl

TITLE

Mating Connector MechanicalRequirements

Signal Layout

Signal Definition

Signal ElectricalCharacteristics

FIGURE 2.4.1-1

Pl MATING CONNECTOR MECHANICAL

64 PIN CONNECTOR

REQUIREMENTS

SCALE: NONE

Page 62: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 63: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.4.1 - 1

Pl SIGNAL DEFINITION

PIN #

1A1B2A2B3A3B4A4B5A5B6A6B7A7B8A8B9A9B10A1OB11A11B12A12B13A13B14A14B15A15B16A16B17A17B18A18B19A19B20A20B21A21B22A22B23A23B24A24B25A25B26A26B27A27B28A

28B29A29B30A3 0 B31A31B32A32B

SIGNAL NAME DESCRIPTION

GNDGNDEARSPKR/TAPE OUTA7RB+15vD7+5vDZINNot UsedSlotSlotDOGNDDlGNDD2?jD6A0D5AlD3A2D4A3INTAl5BN)(IA14BHALTA13BffR.PQBA l 2iinip

A10YBBA9BUSARA8WAITA7BUSRQA6RESBTA5iiiA4RFSHBDZOUTEXROMRRoses

GSEBIOA5BUSISOSOUNDVIDEOGND

Signal GroundSignal GroundEAR InputSpeaker/Tape OutputRefresh Address Bit 7 Buffered+15 Volts DCData Bus Bit 7+5 VoltsDaisy In (Not Connected)______

Data Bus Bit 0Power GroundData Bus Bit 1Power GroundData Bus Bit 2CPU Clock (Inverted)Data Bus Bit 6Address Bus Bit 0Data Bus Bit 5Address Bus Bit 1Data Bus Bit 3Address Bus Bit 2Data Bus Bit 4Mdress Bus Bit 3Interrupt Bequest (Active Low)Address Bus Bit 15, BufferedNon-Maskable Int.(Active Low)Address Bus Bit 14, BufferedCPU HALT Indicator (Active Low)Address Bus Bit 13, BufferedMemory Request (Active Low),Bfrd.Address Bus Bit 12I/O Request (Active Low), Bfrd.Mdress Bus Bit 11Read (Active Low), BufferedMdrees Bus Bit 10Write (Active Low), BufferedMdress Bus Bit 9Bus Acknowledge (Active Low)Mdress Bus Bit 8CPU WAIT (Active Low)Mdresa Bus Bit 7Bus Request (Active Low)Address Bus Bit 6CPU Reset (Active Low)Address Bus Bit 5CPU Ml State (Active Low)Address Bus Bit 4Refresh (Active Low),BufferedDaisy Out (Not Connected)Extension ROM Enable (Active Low)Color Signal - RedROS Chip Select (Active Low)(Dock Bank Enable)Color Signal - GreenBank Enable (Active Low)Color Signal - Blue

Analog Sound Signal Output(O-5V)Composite Video Signal OutputSignal GroundSignal Ground

NOTE: All A Pins are on component side of boardAll B Pins are on non-component (soldering) side of board

55

Page 64: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE -2.4.1-2

Pl SIGNAL ELECTRICAL CHARACTERISTICS

____________ OUTPUTS FROM TS2068 _------e-m ________________ INPUTS TO TS2O68 _______-

CAPACITIVE INPUTLOADING V(OL) I(LOAD) V(OH) V(IL) V(IH) I IN (MAX) CAPACITIVE

MAX MAX MAX MIN MAX MIN LOADINGMNEMONIC (PF) VOLTS (MA) VOLTS VOLTS VOLTS uA MAX (PF)

A158A14BA13BA12AllA10A9A8A?A6A5A4A3A2AlA0A7RBIORQBWRB- -RFSHBEXROM- -ROSCS%OB

HiEBUSAKWAITHALTm-ii-mRGBVIDEODOD 1D2D3D4D5D6D7

30 0.5:o" 0.5

0.530 0.430 0.4

i: 8.:30 0:430 0.430 0.430 0.4:: 0.5

0.430 0.430 0.430 0.430 0.530 0.530 0.530 0.5:i 0.5

0.530 0.530 0.530 0.4_- --_30 0.4__ ---30 0.4-_ _--

1.81.81.8

;::

xi1:81.81.81.8

1'*!1:B1.81.80.35

121212

;:12121.8-me1.8-_-1.8___

2.42.42.42.424242.42.42.42.42.42.42.42.42.42.42.72.42.42.42.42.42.42.42.4

2.4---2.4

0 . 80.80.80.80.80.80.80.80.80.80.80.80.80.80.80.80.80.80.80.8

___0.80.80.80.8___0.80.80.8

2.02.0me-

__-2.02.02.02.0___2.02.02.0

1800180018001800180018001800180018001800180018001800180018001800___-

202020

________

2020

:i___--e-m___-____

40404074747476767272721272727298

120101010-___10101012_-101010

____________________________OpEN COLLECTOR WITH PULL-UP ____________________--------------

508-i

--- -_- -_-- -_50 ___ --_ -_-- __50 a:4

i*:1:s

?i2:4 -em --- ____ --

_______________ TO 75 ohm COAX __________________________________________________________30 x*: 1.8 2.4 0.8 2.0 20 120

:i 0:4 ;*i1:8

2'*:214

0.8 0.8 2.0 2.0 20 20 120 12030 0.8 2.0 120

:I: 8.: D:4 1.8 1.8 2.4 2.4 0.8 0.8 2.0 ;8 20 120 120

0":: 1.8 1.8 2.4 2.4 0.8 0.8 22:: 2.0 20 20 120 120SPKR/TAPE OUT 500 0":: 0.04 0.3-0.5 -__ -em _--- __EAR 15 1.6 2.4 +/- 1.3 +/- 5.0 ---- __SOUND 100 0 m-e 2.5 -0.3 t5.0 me-- __y!!& -- _-- --- w-m 0.8 2.0 --we 10

_~___~_~~_____~_~__~~~~~~~~~~~~~~~~~~~~~ 1 uF WITH 22OK PULL-UP _________________________--IOA5 -_ --- --- --- _-_ --- _--- __

56

Page 65: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.4.1.1 Attachment of an RGB Monitor

The TS 2068 provides via the Pl rear-edge connector theability to attach an RGB monitor for excellent pictureclarity and resolution. The TTL-level logic signalsappear directly on the rear-edge connector of the TS 2068-- the necessary synch signals can be derived from thesimple synch stripper/separator circuit described here.

The Schematic of Figure 2.4.1-3 shows the requiredconnections and electronics. Attachment is via the64-pin keyed Pl connector. Shielding should not normallybe required, but ferrite beads are recommended on eachwire to minimize EMI, TVI, etc.

Circuit Operation - Rl and the base-emitter junction ofQ l operate as a DC restoration circuit with currentflowing only when the composite video input signal fromconnector pin B31 is at the synch level. With the chargemaintained on Cl, Ql conducts only during the synch pulseinterval (not during the color burst time). During thisconduction interval, the composite synch signal appearsin inverted form on the collector of Ql. The Q2 stagesimply re-inverts the signal, providing at its collectora composite synch signal for the connected monitor.

To provide a separated Vertical synch pulse, R5 and C3filter the output of Ql to partially eliminate theHorizontal synch pulses which are shorter than theVertical synch pulses. The partially filtered invertedsignal is re-inverted by Q3, then R6 and C4 complete theelimination of the Horizontal synch pulses so that aseparate Vertical synch pulse is supplied for theattached monitor.

Signals R, G, and B from connector pins 827, 828, and B29can be supplied directly to the attached monitor.

COMPOSITE SYNCHTO MONITOR

u--ii-

FIGURE 2.4.1-3 01.03: 2N2QOT OR EQUAL

l svDc 02: PNPPPP OR EOUAL

rG.0 TO MONITOR

0 VERTICAL SYNCH

UTO MONITOR

c 4.033yF

027 CbRR

828 0 G G

e2s 08 B

; ]TO MONlTOR

57

Page 66: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.4.2 Cartridge Connector - J4

The TS2068 provides a 2 X 18 pin connector (designated J4on the schematic) under the door at the front right ofthe console. The table and figures listed below detailthe mechanical, functional, and electrical requirementsand limits of the J4 Cartridge Connector.

FIGURE/TABLE TITLE

Figure 2.4.2-1 J4 Mating PCB MechanicalRequirements

Figure 2.4.2-2 J4 Signal Layout

Table 2.4.2-l J4 Signal Definition

Table 2.4.2-2 J4 Signal ElectricalCharacteristics

58

Page 67: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 2.4.2-l

J4 MATING PCB MECHANICAL REQUIREMENTS

LONG F~YGLKS

NOTES: -_i c_aw\ PCBOAPO

1.6 .7F

(1) Circuit Board Material:FLGFN C62Cl/lA2A (94V-0)Copper 1 or 2 sides

(2) Contact Fingers: Min. 10millionth MIL-G - 45204 Gold over.00005 to .OOOlO inch low stressnickel.(3) Contact Fingers 2 and 36should be longer than otherfingers to latch-up when insertedwith power on.

FIGURE 2.4.2-2

J4 SIGNAL LAYOUT

(View from Front)

34

PIIz C O M PSIDE

13 5 7 9 11 13 YS 17 19 21 23 25 27 29 31 33 35

59

Page 68: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.4.2-l

J4 CONNECTOR SIGNAL DEFINITIONS

PIN # SIGNAL NAME1 A14B

3”4

z

;910111213141516171819

;:2223242526272829303132333435

+5vAl2A13BDOD7DlA002AlD6A2D5A3D3A15B

&

3

A8A7A9A6A10A5All

*

z!!

36 GND

DESCRIPTIONAddress Bus Bit 14, Buffered+5 volts DCAddress Bus Bit 12Address Bus Bit 13, BufferedData Bus Bit 0Data Bus Bit 7Data Bus Bit 1Address Bus Bit 0Data Bus Bit 2Address Bus Bit 1Data Bus Bit 6Address Bus Bit 2Data Bus Bit 5Address Bus Bit 3Data Bus Bit 3Address Bus Bit 15,BufferedData Bus Bit 4Memory Request (Active Low),Bfrd.I/O Request (Active Low),BufferedRefresh Address Bit 7, BufferedRead (Active Low), BufferedCPU Ml State (Active Low)Write (Active Low), BufferedAddress Bus Bit 8Address Bus Bit 7Address Bus Bit 9Address Bus Bit 6Address Bus Bit 10Address Bus Bit 5Address Bus Bit 11Address Bus Bit 4Refresh (Active Low), BufferedBank Enable (Active Low)Extension ROM Enable (Active Low)ROS Chip Select (Active Low)Gr6D;;k Bank Enable)

6 0

Page 69: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.4.2-2

J4 SIGNAL ELECTRICAL CHARACTERISTICS

____________ OUTPUTS FROM TS2068 ---------- ________________ INPUTS TO TS2068 ________

CAPACITIVE INPUTLOADING V(OL) I(L0AT.I) V(OH) I(LOAD)*V(IL) V(IH) I IN (MAX) CAPACITIVE

MAX MAX MAX MIN M I N MAX MIN LOADINGMNEMONIC (PF) VOLTS (MA) VOLTS (uA) VOLTS VOLTS uA MAX (PF)

A15BA14BA13BAl2AllA10A9A8A7A6A5A4A3A2AlA0A7RBROSCSg3B

IORQBiii%RFSHBEXROMiiiDOD1D2D3

D4D5D6D7

30 0.530 0.530 0.530 0.4

30::

i::

30 f?:30 0:430 0.430 0.430 0.430 0.430 0.430 0.4

:: K:i 0:4

0.530 0.530 0.530 0.5

3030 i::30 0.530 0.4

1.81.81.81.81.8

1.81.81.81.81.8

;*:118

A.8351:81.81.8

12121212121.8

30 0.430 0.430 0.4

30 0.430 0.430 0.430 0.4_- 5.25__ _-

1.81.81.8

1.8

::i1.8 2.4 0.8 2.0

300 4.75___ ___

2.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 I?2.72.4 102.4 102.4 102.4 102.4 102.4 102.4 102.4 10

2.4 0.82.4 0.8 i:82.4 0.8 2.02.4 0.8 2.0

2.4 0.8 2.02.4 0.82.4 0.8

15151515

1:1515

120120120120

120120120120

61

Page 70: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.4.3 Cassette I/O

The EAR and MIC connectors provided on the rear of theTS2068 are l/8" mini-phone jacks requiring l/8"mini-phone plugs as mating connectors.

The MIC output is filtered by a low-pass filter with abreakpoint of 2.5KHz and provides a signal output of 0.15to 0.67 V p-p.

The EAR input is filtered by a low-pass filter with abreakpoint of 23 KHz. Input voltaqes should be between4.0 and 10.0 V p-p.

2.4.4 Joystick

The joystick input connectors, oneTS2068 case, are standard D-pin "D"use with 5-switch type joysticks.

Connector layout and the function of

on each side of thetype connectors for

each pin is given inFigure 2.4.4-l and Table 2.4.4-1, respectively.

FIGURE 2.4.4-l

JOYSTICK CONNECTOR

62

Page 71: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 2.4.4-l

JOYSTICK CONNECTOR SIGNAL ASSIGNMENT

P/N SIGNAL NAME I/O PORT BIT FUNCTION

1

2

3

4

5

6

&

8 READ STROBE

9 GND

--_

RUTrON

5v

STICK UP

STICK DOWN

STICK LEFT

STICK RIGHT

not used

PUSH BUTTON

5 VOLT POWER

ADDRESS BIT 8 OR 9*

POWER GROUND

*When Address Bit 8 is high, the READ strobe to the left joystick isdriven low. When address Bit 9 is high, the READ strobe to the rightjoystick is driven low.

2.4.5 AC Adapter Power Plug

The AC Adapter provided with the TS 2068 provides unregulated DCto the unit as described in Section 2.1.1 Mechanical details ofthe plug which mates to the TS 2068 are shown below:

63

Page 72: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

2.4.6 Composite Monitor Output

The MONITOR output on the rear of the TS2068 provides a 1V p-p (+/- 20%) composite color video signal output to anRCA phono jack which is mated by a standard phono pluginto a 75 ohm coax cable. See Section 2.1.11.1.

2.4.7 RF Output

The TV output on the rear of the TS2068modulated color video signal on VHF Channel 23 as selected by the channel select switch on

provides aor Channelthe bottom

of the unit. Connection to the RCA phono jack outputshould be via a standard phono plug and 75 ohm coaxcable. See Section 2.1.11.2.

Channel frequencies provided are

Channel 2 55,250 +/-- 100 KHzChannel 3 61,250 +/-- 100 KHz

Output levels are less than 3 milliwatts as limited bythe Federal Communications Commission.

2.4.8 Keyboard Interface - J9 Connector

Located on the PCB inside the TS 2068 is a 14-pinsingle-in-line flex cable connector (AMP TRIO-MATE P/Nl-520315-4 or equivalent). Signals are as listed below:

PIN SIGNAL

0 GND1 KBO

3'KBlKB2

4 KB3

:KB4CR6/All

:CR7/A10CR8/A9

1:CR9/A12CRlO/Al3B

11 CRll/A812 CRl2/A14B13 CR13/A15B

Any modification to or replacement of the keyboard supplied mustconsider the following:

(1) Contact resistance less than 200 ohms.

(2) Bounce less than 10 ms.

(3) Capacitance per line less than 20 pF (0 or 1 keydepressed); less than 40 pF (more than 1 key depressed).

64

Page 73: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

3.0 SYSTEM SOFTWARE GUIDE

3.1 Identifier

Location 13 (13H) of the Home Bank ROM is used to identify therevision level of the System Software. The initial version isidentified by this location having a value of 255 (FFH). Anysubsequent versions will decrement this value by 1, e.g., thefirst revision would be identified by a value of 254 (FEH). Thisidentifier should be used to conditionally apply patches orexecute "work-arounds" identified as necessary with a particularversion of the System Software.

3.2 ROM Organization and Services

3.2.1 Home ROM

3.2.1.1 Fixed Entry Points

Home ROM Location 0 is the entry to the systeminitialization code upon power-up (Ref. Figure1.1-4). Locations 8 through 48 (8H through30H) are the Z80 RESTART entry points for thefollowing functions:

RESTART FUNCTION

8 ERROR - Error exit from BASIC(Address on Stack points to ErrorNumber)

15 WRCH - Write Character (Code inA) to Current Output Channel asestablished by SELECT (Address ofoutput routine pointed to bySystem Variable CURCHL). (SeeSection 4.0).

24 IGN SP - Return in A the currentsignificant character in theProgram Line (Address in SystemVariable CH ADD) skipping overspaces a n d- control charactersexcept End-of-Line (ODH=ENTER)

65

Page 74: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

32

40

48

NXT_IS - Like IGN SP but returnsin A the Next SignificantCharacter.

CALCTR - Entry to CalculatorRoutines .

COPYUP - Make room for BC Bytesof temporary workspace justbefore address in System VariableSTKBOT by copying up memorybetween there and the address inSTKEND, adjusting affectedpointers. Returns DE=lst Byte ofSpace; HL=Last.

Location 56 (38H) is the entry to service thehardware generated interruption which occursapproximately every l/60 of a second (16.67ms). Z80 Int. Mode 1 is used. Thisinterruption is used to scan the keyboard (callto routine UPD K - see Section 4.1.1). It isalso used to update the Frame Counter (3 bytespointed to by the System Variable FRAMES) usedby the RANDOMIZE instruction.

Location 102 (66H) is the entry point for theNMI interruption, but this interruption is notused in the TS2068 design. (See Section2.1.3.8 NMI Interruption.)

3.2.1.2 BASIC AROS Support

BASIC Application Cartridges are supported byspecial code in the Home ROM. A program lineis copied from the cartridge to a buffer in theHome RAM (ARSBUF) and is then executed fromthere by the BASIC Interpreter. When a READcommand is executed, the line containing theappropriate DATA statement is also copied fromthe cartridge to the RAM. The cartridge memoryis enabled only fur search and copy operationsfor both program lines and DATA statements, andwhen executing a USR function, otherwise theentire Home Bank is enabled while executing inthe BASIC Interpreter. There is no support forUser-Defined Functions which insert theexpanded definition parameters directly intothe program and then require search of theprogram area to find these parameters whenevera function is invoked.

See Section 5.1, Cartridge Software/Hardware,for additional details on BASIC AROS.

66

Page 75: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

3.2.1.3 General

The balance of the Home ROM contains the BASICInterpreter and standard I/O routines with theexception of the cassette I/O which is in theExtension ROM. The bit map table for thestandard character set is located at the end ofthe Home ROM from location 15616 to '16383(3DOOH to 3FFFH). The address of this tableminus 256 (lOOH) is contained in the SystemVariable CHARS (=3COOH).

The Home ROM routines accessible via theFunction Dispatcher are described in Table3.3.4-2. See Appendix A for the ROM Mapsgiving the ROM addresses of these routines.

3.2.2 Extension ROM

3.2.2.1 Fixed Entry Points

Extension ROM Location 0 contains code to passcontrol to the initialization code in the HomeROM. (Figure 1.1-4).

Extension ROM Location 56 (38H) is theinterruption fielder. Control is passed to theSystem RAM code (See Section 3.3.3) to bankswitch to the Home Bank and call theinterruption service routines after which thestate of the machine is restored and controlreturns to the interrupted process. Figure3.2.2-l shows the Extension ROM InterruptionFielder code.

3.2.2.2 General

The balance of the Extension ROM contains thefollowing major components:

- Final Phase of System Initialization(See Figure 1.1-4)

- Cassette tape I/O (see Section 4.2)

- Change Video Mode Service

- OS RAM routines including the FunctionDispatcher (copied to RAM at SystemInitialization) (see Section 3.3.3)

- Function Dispatcher Jump Table

67

Page 76: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 3.2.2-l

Extension ROM Interruption Fielder

LOCAT ION OBJECT CODE SOURCE CODE COMMENTS

00380039003A003D003E003F0041004200450046

F5F33AC25CA7002804FlC36EFAFlC3AE62

PUSHDILDANDNOPJRPOPJP

CHK3 POPJP

AF

A,(VIDMOD)A

Z,CHK3AFINT7AFINT3

Save AFDisable Ints.Test Vidmod

Vidmod=ORestore AFChunk 7 if Vidmod not 0Restore AFChunk 3 if Vidmod = 0

3.2.2.3 Video Mode Change Service

The routine CHNG VID takes as input a singlebyte in Register3 which designates the desiredvideo mode as shown in Table 3.2.2-1. Allnon-zero values involve access to the seconddisplay file located at 6000H-7AFFH. When themode change requires remapping of the RAM (seeFigure 1.1-3), the necessary relocation (BASICprogram, machine stack, OS RAM code, UDG area,etc.) and modifications (system variables, RAMcode internal addresses, stack pointer, etc.)are done by this service. The desired videomode is written to Port OFFH, Bits O-5, and theSystem Variable VIDMOD (5CC2H) is updated. Thesecond display file is cleared to zeros oninitial access (for Dual Screen Mode and HighResolution Graphics Mode, this results in ablack screen since 0 yields attributes of blackink on black paper). If there is not enoughfree memory to do the necessary remapping,Error 4, Out of Memory is given.

Access to this service via the FunctionDispatcher cannot be made consistently forvarious reasons. An Interface Routine is givenin Section 3.2.2.4, to be executed from theHome RAM, which provides access to the VideoMode Change Service as well as other ExtensionROM routines.

See Sections 4.1.2 and 5.2 for discussion ofvideo screen support software. See Section 6.4for details on known problems and correctionsrelated to the Video Mode Change Service.

68

Page 77: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

VALUE VIDEOIN A MODE

0

128(80H)

1

2

6

14(OEH)

22(16H)

30(lEH)

38(26H)

46(2EH)

54( 3 6 H )

62

TABLE 3.2.2-l

INPUT TO VIDEO MODE CHANGE SERVICE

Normal

DualScreen

DualScreen

High ResolutionGraphics

64-ColumnInk Paper

Black White

Blue Yellow

Red Cyan

Magenta Green

Green Magenta

Cyan Red

Yellow Blue

White Black(3EH)

NOTE 1: The areas of memory normally used for Attribute Bytes are notaccessed by the video hardware in this mode.

DESCRIPTION

Primary Display File Only(Close2nd Display File if Open)

Two Display Files Available.Primary Display File Active atScreen.

Two Display Files Available.Second Display File Active atScreen

Primary Display File containsdata for 256X192 pixels. SecondDisplay File contains 6144Attribute Bytes, each onecontrolling 8X1 pixels. NOTE 1.

The two display files are com-bined to provide a 64 column X24 line screen. Even columnsare derived from data in thePrimary Display File and oddcolumns from the 2nd DisplayFile.Bits 3-5 of the mode select theink color which determines thecomplementary paper color.The Flash and Bright Attributesare fixed at 0; the Border isfixed at the paper color.NOTE 1.

69

Page 78: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

3.2.2.4 Extension ROM Interface Routine

The Extension ROM routines W TAPE (Write fromRAM to Tape), R-TAPE (Read from Tape to RAM)(see Section 4.2) and CHNG VID (see Section3.2.2.2) may be of interest to the machine codeprogrammer. Because of a conflict with the useof the IX Register, the tape routines cannot besuccessfully accessed via the FunctionDispatcher. Because the Change Video ModeService may involve relocating the OS RAMroutines (including the Function Dispatcher),and for other reasons, it also cannot beconsistently accessed using the FunctionDispatcher. Figure 3.2.2-2 gives a sampleroutine, to be executed from the Home RAM,which can be used to bank switch to theExtension ROM and call directly to the desiredservice. Appendix A contains an Extension ROMMap giving the addresses of these and otherroutines.

70

Page 79: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

=OOFC=0068=OE8E=5CC2

0000’ 21 OOFC0003' cc 0020'0006' 18 17

0008’ 21 0068000B' cc 0020'OOOE' 18 OF

0010' 21 OE8E1313' F50014' CD 0020'

0017' F10018' FE 8000111' 20 03001C' 32 5CC2OOlF' 3A OOLC'0022' 03 FC0024' 00 FF0026' CB BF0028' 03 FFOOZA' F B0023' c9

002C' 0 0

0020' F3OOZE' F5OOZF' 00 FF0031' CB FF0033' 03 FF0035' D9 FC0437' 32 OOZC'0036' 3E 01003C' 03 F4003:' Fl033F' E9

FIGURE 3.2.2-2

EXTENSION ROM INTERFACE

123456789

1011121314151617181920212223242526272829

3:3233343s3637383940Cl424344454647484953545556575859606162636465

:R_lAPEW_TAPECHNG_VIDVIDMOD7:..

:READTP LO

CALLJR

::;WRITTP LO

CALLJR

:

t.CHGVID L D

PUSHCALL

:::::

..POPCPJRLO

EXIT LOOUTINRESOUTEIRET

:HSSAVE DEFB:IFRTN DI

PUSHINSETOUTINLDLDOUTPOPJP

:END

EQU OOFCHEQU 0068HEQU 0E8EHEQU 5CC2H

ROUTINE

HL,R_TAPEIFRTNEXIT

HL,W_TAPEIf RTNEXIT

HL,CHNG_VIDAFIFQTN

AF80HNZ,EXIT(VIDMOD),AA,(HSSAVE)(0F4H),AA,(0FFH)7,A(0FFH),A

0

AFA,(0FFH)7,A(0FFH),AA,(0F4H)(HSSAVE),AA,1(0F4H),AAF(HL)

;;;;;

;;

;;;

;;

;;

;;

;;

;;;;;

;;

;;;;;

EXTENSION R O M INTERFACE ROUTINEREAD TAPE ROUTINEWRITE TAPE ROUTINECHANGE VIDEO MODE ROUTINEVIDEO MODE SYSTEM VARIA8LE

CALL READTP WITH REGISTERS SETUP FOR R_TAPE ROUTINE

ADDRESS TO HLENABLE EXT./EXECUTE QTNRESTORE HOME BANK A N D R E T U R N

CALL WRITETP WITH REGISTERS SETUP FOR W_TAPE ROUTINE

ADDRESS TO HL

CALL CHGVID WITH DESIRED VIDEOMODE IN A

ADDRESS TO HLSAVE VIDEO MODE

COMPENSATE FOR 'BUG' I NCHNG_VID RTN.WHICH SETSVIDMOD=0 INSTEAD OF 80WHEN BOTH DISPLAY FILESARE OPEN

TEST VIDEO MODETEST IF 80

SET VIDMOD=80HGET PREV. HOR.SEL.RESTOREREAD PORT FFTURN OFF RCM SEL.

; SAVE HOR.SEL. (PORT OF4H)

; MASK INTERRUPTIONS; PRESERVE REG. A; EXT.ROM SELECT BIT; SEL. EXT.ROM

; HORIZONTAL SELECT FCR DOCK/EXT; SAVE: SELECT CHUNK 0 IN EXT.ROM;; RESTORE REG. A; EXECUTE TARGET ROUTINE AND: RETURN TO CALLER CF IFRTN

71

Page 80: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

3.3 RAM Organization and Services

3.3.1 System Variables

RAM beginning at 23552 (5COOH) is dedicated to the BASICSystem Variables as defined in Appendix D of the TS 2068User Manual and in Appendix B of this document. The areafrom the end of the defined variables (STRMNM - 23755(5CCB) ) to 24297 (5EE9H) is reserved for expansion ofthe System Variables, but is not used by the OperatingSystem in the current TS 2068.

3.3.2 System Configuration Table

The area from 24298 (5EEAH) to 24575 (5FFFH) is reservedfor the System Configuration Table (SYSCON). This tableis built at system initialization time and is comprisedof an 8 byte entry for AROS, a 4 byte entry for LROS,followed by eleven 24-byte entries for proposed expansionbanks and an End-of-Table marker. In the original TS2068 the actual usage of this table is limited to the 12bytes for software cartridge identification (see Section5.1 for details of the LROS and AROS Overhead Bytes).

3.3.3 Machine Stack

The TS 2068 reserves 512 (200H) bytes of RAM for theMachine Stack. The Machine Stack pointer is initializedto a value of 6200H (value also in System VariableMSTBOT); the pointer is decremented as items are pushedonto the stack (the pointer may also be modified directlyby software). While the area reserved for the stackextends to 6000H, there is no actual check made toenforce this limit.

Note that the Machine Stack is located in the same memoryarea as the second display file. The CHNG VID routinerelocates the stack to the memory area from OF7COH toOF8BFH, and modifies the Stack Pointer and MSTBOT(OF8COH), as well as other affected system variables,when initializing the second display file. (See Section3.2.2.3.)

3.3.4 OS RAM Routines

The code for the following Operating System functions iscopied from the Extension ROM to Chunk 3 of the RAM atSystem initialization time. Since this is in the samememory area as the second display file, this code must berelocated, along with the machine stack, if the seconddisplay file is to be used. The CHNG VID routine doesthe necessary relocation and modifications. (Section3.2.2.3.)

72

Page 81: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

Because this code is not in a fixed location, access tothe OS RAM routines is conditional on the current videomode. The standard technique employed is to test thevalue in the System Variable VIDMOD at location 23746(5CC2H). A zero indicates that the second display fileis not in use and that the OS RAM routines are thereforein Chunk 3; any non-zero value indicates that theroutines are in Chunk 7.

YOTE: This design implies that Chunks 2, 3 and 7 arealways enabled in the Home Bank RAM wheneverthe System ROM and/or RAM routines are beingused.

The OS RAM routines are contained in Module "Dispatch"which is included in Appendix A.

3.3.4.1 RAM Interruption Handler

Chunk 3 Entry: 62AEH

Chunk 7 Entry: FA6EH

The user must enter with bank status and Z80registers intact, with address from point ofinterruption on the stack.

The RA M interruption handler saves state,including memory selection, enables the HomeBank, updates the Frame Counter, calls thekeyboard scan routine in the Home ROM, restoresstate, and returns to the interrupted process.

The RAM Interruption handler is used wheneverthe interruption occurs while the Extension ROMis enabled, See Figure 3.2.2-1, Extension ROMInterruption Fielder. This same technique canhe used for interruption processing in anotherbank, e.g. if an LROS wanted to use thestandard system ROM keyboard scanning routines.

3.3.4.2 RAM Service Routines

Table 3.3.4-l lists the RAM service routineswhich are designed to facilitate communicationbetween memory banks. Those with Service Codesare accessible via the Function Dispatcher.

73

Page 82: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.4-l

OS RAM SERVICE ROUTINES

LABEL SERVICE COOE LOCATION DESCRIPTION(Decimal) . .

GET WORD 6316- -

PUT WORD 6336-

GET STATUS 14 6405

GET CHUNK- 644D FCOD

GET NUMBER 15 645E

BANK ENABLE - 6499

GOT0 BANK - 6572

CALL BANK - 65D0

FAD6

FAFB

FBC5

FClE

FC59

F032

FD90

Returns in HL the word from theaddress in HL in the bankspecified in B.

Writes the word in DE to theaddress in HL in the bankspecified in B.

Returns current memory selection(Horizontal Select byte - lowactive) in C for the bankspecified in B. Preserves Bank #in B for Home, Ext. or Dock.

Returns a single byte mask in Awith all bits 0 except the onecorresponding to the chunk forthe address in HL.

Returns in Reg. A the bank numbercurrently controlling the addressin HL .

Enables the memory selected(Horizontal Select byte - lowactive) in the specified bank.(Bank # in B; Mem.Sel.in C)

Transfers control to thespecified address after enablingthe memory selected in thespecified bank. Parameterspassed on stack by pushing targetaddress, then Bank #/Mem.Selectprior to calling GOT0 BANK.(Return address is discarded).

Like GOT0 BANK except savescurrent hankstatus, calls targetaddress, and restores statusprior to returning to user. Twoadditional parameters are passedon stack prior to doing call toCALL BANK. These are PRM OUT(16-bits) following by PRf~.fIbr[~~bits) as describedFunction Dispatcher.

74

Page 83: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.4-l

OS RAM SERVICE ROUTINES(continued)

LABEL SERVICE CODE LOCATION DESCRIPTION(Decimal)

XFER BYTES - 6722 FEE2 Copies n byte(s) from specifiedsource to specified destinationin either ascending or descendingorder. Source and destinationcan be in the same or differentbanks and can be in shadowingchunks, but neither source nordestination can pass a "chunk"(8K) boundary since only thechunks containing the startingsource and destination addressesare explicitly enabled.

Parameters passed on stack bypushing:

Source Bank/Dest.BankSource AddressDest. AddressLengthO/Direction:

(O=Asscending-l=Descending)

NOTE: See Appendix A for listing of these routines. See Section 6.0 forknown corrections to the routines.

75

Page 84: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

3.3.4.3 Function Dispatcher

Chunk 3 Entry: 62OOH

Chunk 7 Entry: F9COH

1.

The Function Dispatcher provides, a commoninterface to a number of system routines via aService Code and Jump Flag parameter passed onthe machine stack. Table 3.3.4-2 lists theroutines in Service Code order. Codes forroutines that are known to not be successfullyaccessible via the Function Dispatcher havebeen deleted (marked Reserved). However, thereis no guarantee that those on the list can beaccessed without problems. Some ROM routinesrequire data in a particular format, e.g. BASICfloating point number(s), both standard andspecial integer format, on the Calculator Stackwhich is located between (STKBOT) and (STKEND)(see Appendix C of the TS 2068 User Manual).An effort has been made to include informationon register usage and functionality, but someof the ROM routines are so tightly tied to theBASIC Interpreter that they would requireanalysis which is beyond the scope of thisdocument. These have been flagged with anAsterisk, but included in the list fordocumentation purposes only. Most of theroutines which are directly implementing aBASIC command or function have two differentaction sequences based on the INTPT Flag (Bit 7of FLAGS) which distinguishes syntax checking(Flag=O) from actual execution (Flag=l).

In order to use the Function Dispatcher, firstset up any memory and stack (both machineand/or calculator) locations as if invoking thedesired service directly. Then push theparameter(s) for the Dispatcher on the machinestack in the order outlined below. Finally,set up the registers as if invoking the desiredservice directly and call the Dispatcher basedon its current location (Chunk 3 if VIDMOD=O orChunk 7 if VIDMOD has a non-zero value).

PRM OUT 16 bits - Number of bytes of parameter databeing passed on the stack to the specifiedService (number of stack "pushes" * 2). Zeroif no parameters being passed. E.g., to pass 4bytes:

76

Page 85: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

LD HL,4PUSH HL

2.

3.

This parameter is passed to the Dispatcher onlyif the Jump Flag (SVC CODE) Bit 15) is notset. NOTE: This parameter refers to machinestack entries only, not to the Calculator Stack.

PRM IN 16 bits - Number of bytes of parameter data tobe passed back from the specified Service(number of stack "pushes" * 2). Zero if noparameters to be passed back.

This parameter is passed to the Dispatcher onlyif the Jump Flag (SVC CODE Bit 15) is not set.NOTE: This parameter-refers to machine stackentries only, not to the Calculator Stack.

SVC_CODE 16 bits - Bits O-14 identify the Service to beinvoked. Bit 15 (Jump Flag) is set if noreturn is desired (jump to Service rather thancall). Bit 15 is zero if return is desired.E.g, to call K SCAN using Service Code 136:

LD HL,136PUSH HL

or LD HL,88HPUSH HL

Addendum To TS 2068 Function Dispatcher Services:On page 84, COLOR and HIFLSH (service codes 85 and 86)cannot always be accessed through the Function Dis-patcher, due to resetting of the carry flag by the FD.COLOR may be accessed by setting the registers as de-scribed in the manual, and then coding CALL #23DE.HIFLSH can be accessed similarly by coding CALL #2410.

7 7

Page 86: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.4-2

TS 2068 FUNCTION DISPATCHER SERVICES

SERVICE SERVICE CODE1 - 13 (l-ODH)

DESCRIPTIONReserved

GET STATUS 14 (0EH)

GET NUMBER 15 (0FH)

UPD K

PARP

BEEP

K DUMP-

SENDTV

SETAT

ATTBYT

R ATTS

CLLHS

CLS

DUMPPR

16-24 (10-18H)

25 (19H)

26 (1AH)

27 (1BH)

28 (1CH)

29 (1DH)

30 (1EH)

31 (1FH)

32 (20H)

33 (21H)

34 (22H)

35 (23H)

Returns Memory Selection (LowActive) in C for Bank # in B

Returns Bank # in A for Addressin HL

Reserved

Process Keyboard Input (SeeSection 4.1 . 1 )

Generates DE+1 Cycles of a Tonehaving the Period 8N+236 to8N+246 T-States. HL=N. (See 4.4)

BEEP Command - processesparameters on Calculator Stack.Exits via PARP. (See 4.4)

COPY Command. Dumps PrimaryDisplay File to Printer. (See4.1.3)

Char.Output to Screen/Printer.Character Code in A. (See 4.1.2)

Set Print Position to value inB=Line N o . (O-23); C=Column

/:: (O-31)

Set Attribute Byte for DisplayFile Adrs. in HL using ATTR_T,MASK_T and P-FLAG.

Permanent Attribute Info. toTemporary Attribute Variables

Cl ear Lower Screen (PrimaryDisplay File)

Clear Entire Screen(PrimaryDisplay File)

Print/Clear Print Buffer. (See4.1.3)

78

Page 87: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.4-2

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICEPRSCAN

SERVICE CODE36 (24H)

D E S C R I P T I O NS d S (32 b t 1 t Printer.PyIel l?:Fa Addre!se:n Hyof Scans remaining in B (Y%r(See 4.1.3)

DESLUG 37 (25H) Remove Number Slugs from EditLine Buffer (Address in HL)

K NEW

INIT

38 (26H)

39 (27H)

NEW command. See Fig. 1.1-4

Initialize: DE=Maximum RAMAddress. A=0 for Power-On; = -1(FFH) for NEW. (See Fig.l.l-4)

INCH 40 (28H) Input Character to A fromcurrently Selected Channel.Returns NC if no input.

SELECT 41 (29H) Select Channel (Stream) - # inA. (See 4.1)

INSERT 42 (2AH) Insert BC Bytes before byte whoseaddress is in HL. Copies up allfrom HL to (STKEND) and updatesaffected system variables.Returns BC=O; DE=adrs.of lastbyte of inserted space;HL=adrs.of byte before first.

RESET

CLOSE 44 (2CH)

CLCHAN 45 (2DH)

OPEN 46 (2EH)

OPCHAN 47 (2FH)

43 (2BH) Reset Calculator Stack. Sets(STKEND) =(STKBOT)(MEM)=MEMBOT (5C92H).

and

CLOSE # Command. Channel # onCalculator Stack.

Close Channel. BC=Value fromSTRMS (Index into CHANS).

OPEN # Command. Channel # an4Device Spec. on Calculator Stack

Open Channel. Device Spec. onCalculator Stack. DE=pointerinto STRMS based on Ch.#.

(See 4.1 for more info. on OPENand CLOSE)

79

Page 88: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.4-2

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICECAT

SERVICE CODE48 (30H)

D E S C R I P T I O NCAT Command (Not Applicable)

ERASE 49 (31H) ERASE Comnand (Not Applicable)

FORMAT 50 (32H) FORMAT Command (Not Applicable)

MOVE 51 (33H) MOVE Command (Not Applicable)

FLASHA 52 (34H) Flash Char.in A to Screen.(Calls SENDTV; assumes LowerScreen selected. Used to FlashCursor.)

FIND L-

SUBL IN 54 (36H)

53 (35H) Find BASIC Program Line with thenumber in HL. If Line found,returns Z and Address of Line inHL, else returns NZ and HLcontains either address of linewith next larger line number orpoints to the Variables area ifthere is no larger line number.Requested Line No. returned in BCand Address of Preceding Line inDE (DE=HL if no preceding line).

Finds either the D'th statement(D=Statement #; E=O) or 1ststatement whose keyword tokenmatches E (D=O), in a linepointed to by HL. If the D'thstatement is found, returns Z andHL and (CH ADD) both point to 1byte before-statement. (If linecontains exactly D-l statements,then the next line counts as theD'th.). If match on E is found,then returns NZ,NC and both HLand (CH ADD) point to keyword. Dis decremented by the number ofstatements looked at (e.g. D= -2if two statements). If no matchon E then returns NZ,C with bothHL and (CH ADD) pointing t oEnd-of-Line byte (ODH).

80

Page 89: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.4-2

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICERECLEN

SERVICE CODE55 (3/H)

DESCRIPTIONReturns in BC the lenqth of therecord pointed to by HL. Sets DEto HL+BC. The record can be aprogram line, or a string ornumeric variable or array.

DELREC

PUT BC

SYNTAX

EXCUTE

FOR 60 (3CH)

STOP 61 (3DH)

NEXT

READ

DATA

RESTBC

RAND

56 (38H)

57 (39H)

58 (3AH)

59 (3BH)

62 (3EH)

63 (3FH)

64 (40H)

65 (41H)

66 (42H)

Delete record pointed to by HLhaving length BC from Program orVariables memory. Updatesaffected system variables.

Converts number in BC from binaryto ASCII and outputs to currentlyselected channel, If BC lessthan 0, outputs a 0.

Check syntax of command orprogram line in Edit Line Buffer(E LINE). ERR NR= -1 if noerrors, otherwisecontains ErrorNumber-l.

Execute command(s) from Edit Linebuffer.

FOR command. *

STOP command. Does RESTART 8with Error No. 9.

NEXT command. *

READ command. *

DATA statement.

RESTORE command

*

- Line No. in BC

RANDomize command. Sets seed forRandom Number Generator based onParameter on Calculator Stack.If parameter is non-zero, valueis loaded to SEED; if zero, valuein FRAMES is loaded to SEED.

Page 90: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.3-2

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICECON'T

SERVICE CODE67 (43H)

DESCRIPTIONCONT command. Loads values fromOLDPPC and OSPPC to NEWPPC andNSPPC and returns. Inside theBASIC Interpreter, this resultsin executing from Line No. inNEWPPC, Statement No. in NSPPC.

JUMP 68 (44H)

FIX Ul- 69 (45H)

FIX U

CLEAR

CLR BC

GO SUB

70 (46H)

71 (47H)

72 (48H)

73 (49H)

Jump to Line - Loads Line Numberfrom Calculator Stack to NEWPPCand sets NSPPC to 0 and returns.

Converts Floating Point number onCalculator Stack to a single byteunsigned binary value in A (usesFP2A). Does RESTART 8 for ErrorB if number out of range.

Converts Floating Point number onCalculator Stack to a 2-byteunsigned binary value in BC (usesFP2BC). Error B if number out ofrange.

CLEAR command. Processesparameter on Calculator Stack tovalue in BC for CLR BC.

Value in BC is new RAMTOP.Deletes Variables, clears screen,and Calculator Stack, etc.

GO SUB command. Inserts a 3-byteGO-SUB Block into the machinestack above the 2 most recententries. The Block consists ofcurrent Line No. (2 bytes) andStatement No. (1 byte) to be usedwhen RETURN is executed. Thencalls JUMP to process GO SUBparameter and returns. At returnto caller, machine stack consistsof top of stack at point GO SUBwas called, followed by 3-byteentry (Line No. MSB/Line No.LSB/Statement No.).

82

Page 91: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.3-Z

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICECHK SZ

SERVICE CODE74 (4AH)

DESCRIPTIONChecks if room for BC 80 (50H)bytes between (STK;ND) and(RAMTOP). Addition of 80 bytesis "left-over" from Spectrum toguarantee minimum machine stackwhere the stack was at the top ofRAM. Error 4 if not enough room.

RETURN

PAUSE

BREAK? 77 (4DH)

DEF

K LPR

K PRIN

P_SEQ

INPUT

75 (4BH)

76 (4CH)

78 (4EH)

79 (4FH)

80 (50H)

81 (51H)

82 (52H)

RETURN command. Retrieves mostrecent GO SUB Block from MachineStack (SP+4), loads data toNEWPPC and NSPPC and returns.Error 7 if MSB Line No.=3EH (Endof Stack Marker).

PAUSE command. Processesparameter on Calculator Stack toBC then waits BC frames or untilkey is depressed. (Uses HALTinstruction,must be enabled.;0

interruptions

Reads BREAK key. Returns NC if itis pressed and ON ERROR is notactive.

Define Function.*

LPRINT - Selects Channel 3 andprocesses items in LPRINTstatement for output via WRCH.

PRINT - Selects Channel 2 andprocesses items in PRINTstatement for output via WRCH(same code used for K_LPR).

Code used by K LPR and K PRIN toprocess output-data and controlsin BASIC statement (address in CHADD).

INPUT command. Selects Channel 1and processes I/O forKeyboard/Lower Screen using abuffer at (WORKSP) for input. *

83

Page 92: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.3-Z

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICE SERVICE CODE DESCRIPTIONI S E Q 83 (53H) Code used b- INPUT to process

input items a\d controls in BASICstatement (address in CH ADD).

NOTKB? 84 (54H) Returns Z if current channel isKeyboard/Lower Screen (devicespecification="K").

COLOR 85 (55H) Adjusts system variables ATTR T,MASK T and P FLAG for color codein D (0-9). Enter with C set toset Ink or NC set to set Paper.Error K if D is invalid.

HIFLSH

SCRMBL

PLOT 88 (58H)

PLOTBC 89 (59H)

GET XY-

86 (56H)

87 (57H)

90 (5AH)

Adjusts system variables (ATTR Tand MASK T) for Flash/Bright codein D (0,, 1 or 8) else Error K.Enter with C for Flash or NC forBright.

Returns in HL the primary displayfile address for the pixel withcoordinates in BC (B=Y;C=X).Returns in A the bit no (0-7)where O=lefthand o r mostsignificant bit. Error B if Y isgreater than 175.

PLOT command. Processes X/Yparameters on the CalculatorStack to BC for plotting of pixelvia PLOTBC.

Deals with pixel for coordinatesin BC (B=Y; C=X). Processesusing P FLAG for Inverse and Overattributes. Updates AttributeFile and sets COORDS=BC.

Converts a pair of numbers fromthe Calculator Stack to 2 singlebyte numbers. Top number goes toB and second to C. D=sign of Band E=sign of C (+l or -1). Usedby PLOT and other routines.

a4

Page 93: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.3-2

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICECIRCLE

SERVICE CODE91 (5BH)

DESCRIPTIONCIRCLE command. Calculatessuccessive plot positions fromthe parameters in the BASICstatement. *

DRAW

DRAW L

EXPRN 94 (5EH)

F SCRN 95 (5FH)

F ATTR

RND

F PI

92 (5CH)

93 (5DH)

96 (60H)

97 (61H)

98 (62H)

DRAW command. Calculatessuccessive plot positions fromthe parameters in the BASICstatement. *

Plots a straight line fromcurrent position (COORDS) basedon parameters from CalculatorStack (X,Y). *

Evaluates expression in BASICprogram line (CH ADD), puttingvalue on Calculator Stack. *

SCREEN$ function. Matches screenline/col. position (parameters onCalculator Stack) againststandard ASCII character set.Returns BC=O if no find. BC=land DE points to Char. Code byteif match found.

ATTR function. Returns attributebyte value controlling screenpixel position basedparameters on Calculator StaZ(X,Y).

RND function. Uses value in SEEDto generate a pseudo-randomnumber which is placed on theCalculator Stack (Floating Pointnumber).

PI function. Places value of PIon Calculator Stack.

85

Page 94: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.3-2

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICE SERVICE CODE DESCRIPTIONF INKY 99 (63H) INKEY$ function. Scans keyboard-

and puts character code byte in(WORKSP) if key detected. In anycase, pushes Regs. AEDCB ontoCalculator Stack - BC=O if noinput; =l if char. code stored;DE=address of char. code byte.

FIND N

PSHSTR

PAEDCB

LET

POPSTR

DIM

STKUSN

100 (64H)

101 (65H)

102 (66H)

103 (67H)

104 (68H)

105 (69H)

106 (6AH)

Find Variable. SearchesVariables area for match againstidentifier pointed to by CH ADD.Adjusts bit NO of FLAGS (Bit 6)for type (l=numeric; O=string).Also used to find formalparameters for User DefinedFunctions. *

Push String - Clears bit NO ofFLAGS and pushes Regs. AEDCB ontoCalculator Stack adjusting(STKNXT) upwards. DE containsaddress of string; BC containslength.

Same code as for PSHSTR butpreserves state of bit NO ofFLAGS (Bit 6).

LET command. Processes existingor creates new variables. *

Pop String - Pops end ofCalculator S t a c k ( (STKNXT)-1through (STKNXT)-5 ) to Regs.BCDEA, adjusting (STKNXT)downwards.

DIM statement. Creates orinitializes numeric or stringarrays. *

Stack Unsigned Number - inputs afloating point number onto theCalculator Stack from a seriesof ASCII characters addressed by(CH ADD). The first character isalready in Reg. A (either decimalpoint, binary token or digit).

a6

Page 95: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.3-2

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICESTK A

SERVICE CODE107 (6BH)

DESCRIPTIONl-byte unsigned integer in A totop of Calculator Stack (binaryto floating point). Loads 0 to Band A to C, then executes STK BC.

STK BC 108 (6CH)

ININT

FP2BC

FP2A

OUTPUT

SUB

109 (6DH)

110 (6EH)

111 (6FH)

112 (70H)

2-byte unsigned integer in BC totop of Calculator Stack (binaryto floating point).

Converts a series of ASCII digitspointed to by (CH ADD) into anunsigned floating point integeron the Calculator Stack. Firstcharacter is in A on entry.Terminates when non-digit found.

Pops top(floatingin BC,integer.negative.exceeded(65535).+65535.

of Calculator Stackpoint number) and putsrounded to nearest

Returns NZ if value isReturns C if number

maximum 2-byte valueRange: -65535 to

Pops top of Calculator Stack(floating point number) and putsin A, rounded to nearestinteger. Returns NZ if value isnegative. Returns C if numberexceeded maximum l-byte value(255). Range: -255 to +255.

outputs number on top ofCalculator Stack to currentlyselected channel via WRCH.(Converts from floating point toASCII.)

Full explanation of the following Calculator Routines is beyond thescope of this document.

113 (71H) Subtract floatingnumbers (HL) minusassumed to be (HL) +

point format

5(OE'*(DE)

.

87

Page 96: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TIMES

DIVIDETRUNC

INTDIV

INT

EXP

LN

ANGLE

1 2 0 (78H)

121 (79H)

122 (7AH)

123 (7BH)

124 (7CH)

88

TABLE 3.3.3-2

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICE SERVICE CODEADD 114 (72H)

MULT 115 (73H)

DESCRIPTIONAdd (HL) + (DE). See SUB.

Integer multiply HL * DE. ReturnsC if overflow.

116 (74H) Floating Point Multiply (HL) *(DE).

117 (75H)118 (76H)

Floating Point Divide (HL)/(DE).Truncates a floating point number(HL) towards zero to an integer.Assumes (DE) = (HL) + 5.

FLOAT 119 (77H) Converts number (HL) to floatingpoint format. Assumes HL pointsto an integer in 5-byte format.

Replaces top two numbers onCalculator Stack (X and Y) by XMod Y and the integer quotientINT (X/Y). Returns with DE andHL = Calc.Stack Pointers.

Replaces the top of theCalculator Stack by its integerpart. Returns with HL = top ofCalc. Stack and DE = next freespace.

Replaces the top of theCalculator Stack, X, by EXP(X).Returns with DE and HL =Calc.Stack Pointers.

Replaces the top of theCalculator Stack by its natruallogarithm. Returns DE and HL =Calc.Stack Pointers.

Replaces the top of theCalculator Stack (X) by Y where Yis greater than or equal to -1and less than or equal to +l andthe SIN X = SIN (PI/2 * Y).

Page 97: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.3-Z

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICE SERVICE CODE DESCRIPTIONcos 125 (7DH) Replaces h f

Calculator Sta:k bytoil& COOSINE.the

SIN 1 2 6 (7EH) Replaces the top of theCalculator Stack by its SINE.

TAN 127 (7FH) Replaces the top of theCalculator Stack by its TANGENT.

ATN 128 (80H) Replaces the top of theCalculator Stack by its inverseTANGENT.

ASN 129 (81H) Replaces the top of theCalculator Stack by its inverseSINE.

ACS 130 (82H) Replaces the top of theCalculator Stack by its inverseCOSINE.

ROOT 131 (83H) Replaces the top of theCalculator Stack by its SquareRoot.

TO THE 132 (84H) Replaces the top two numbers onthe Calculator Stack (X, Y) byx**y.

RDCH 133 (85H) Wait for character from currentlyselected channel (calls INCH).Returns character code in A. See4.1.1.

SENDCH 134 (86H) Write character whose code is inA to currently selected outputchannel. See 4.1.2.

WRCH 135 (87H) See 3.2.1.1, RESTART 16.

K-SCAN 136 (88H) Keyboard Scan. See 4.1.1

89

Page 98: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

TABLE 3.3.3-2

TS 2068 FUNCTION DISPATCHER SERVICES(continued)

SERVICEP LFT

SERVICE CODE137 (89H)

DESCRIPTIONBackspace. Sets current columnposition back 1 for selecteddevice. (System Variable updatedis S POSN, SPOSNL, or P POSN forScreen, Lower Screen or Printerrespectively.)

P RT-

P NL-

PUTMES

K CLS-

SCRL 142 (8EH)

F PNT- 143 (8FH)

DRAWLN

PUT LN-

138 (8AH)

139 (8BH)

140 (8CH)

141 (8DH)

144 (90H)

145 (91H)

Outputs a space to currentlyselected device.

End-of-Line. Sets currentposition to start of next line ifscreen, or outputs printer bufferif printer.

output message to currentlyselected device. DE points tobase of message table whichcontains variable length ASCIIcoded messages. The first byteof the table and the last byte ofeach message must have the mostsignificant bit set. Register Acontains the message number,numbered from 0 upwards.

CLS command. Executes both CLSand CLLHS.

Scrolls entire screen (primarydisplay file) up 1 line.

POINT function. Processes X,Yparameters from Calculator Stackto BC. Returns unsigned integervalue = 0 or 1 on CalculatorStack reflecting state of pixelat coordinates X/Y.

Same as DRAW L but enter with BCregister containing coordinates,B=Y and C=X.

Output Line Number as 4 digits,right aligned and space filled tocurrently selected outputchannel. HL points to MSB ofZ-byte Line Number.

90

Page 99: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

4.0 SYSTEM I/O GUIDE

4.1 I/O Channels

The TS 2068 software architecture supports up to 19 I/O Channelsor "Streams', numbered from -3 through 15. Those numbered lessthan 0 are "hidden" or reserved for system use; Channels 0 through15 are available for assignment via the OPEN # command which hasthe following format:

OPEN # n,s

where n is the Channel number (O-15) and s is the DeviceSpecification, e.g. "K" (keyboard), "S" (screen) or "P" (printer).

Channels 0 through 3 are initialized at power-on or execution of aNEW command to support the standard system devices and characterI/O functions as shown in Figure 4.1-1. Channels 4-15 areconsidered "Closed". You can re-assign the standard I/O, e.g.OPEN # 2,"P" will direct all PRINT and LIST commands to the 2040Printer instead of the screen. You can also assign Channels 4-15and then direct I/O by including the Channel number (or a variableequated to the channel number) in the I/O statement, e.g. PRINT #

AboveSupport for other than the standard system devices describedis not implemented in the original version of the TS 2068

and attempts to OPEN Channels or "Streams" using other than thestandard device specifications ("K", "S" or "P") will result in anerror message. One possibility for adding BASIC support for newdevices is to intercept the I/O error on OPEN and other commandssuch as CAT and FORMAT via ON ERR and interpret the BASIC programline using your own machine code routines.

Channel/ DeviceStream # Specification

-3RESERVED

-r

-2-101

P

"K" Keyboard/Lower Screen" s " Main Screen"R" RAM Write (not used)” K " Output to Lower Screen"K" INPUT command" s " PRINT/LIST commandsII IIP LPRINT/LLIST commands

FIGURE 4.1-1

Command/Function

91

Page 100: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

The Channel architecture is implemented by a number of tableslocated in both ROM and RAM.

A. STRMS STRMS is a 38 byte table (2 bytes for each of the 19 channels)located in the System Variables area beginning at 23568 (5C10H).It is initialized at power-on or NEW to the followinq values:

LOCATION VALUE

5ClO 0100 (Channel5c12 0600 (Channel5c14 0600 (Channel5C16 0100 (Channel5C18 0100 (Channel5ClA 0600 (Channel5ClC 1000 (Channel5ClE 0000 (Channel

5C34 0000 (Channel 15)

This table is accessed using ((Ch.# * 2) + 16H) as an index addedto 5COOH. The 2-byte value in the table is an index into theCHANS area of memory which contains the addresses of the I/Oroutines for the selected channel. If the 2-byte value is zero,the Channel is closed. The STRMS table is modified via the OPEN #and CLOSE # commands. When a Channel is OPENed, the devicespecification is used to obtain the 2-byte value to be inserted.This value is taken from the table STRMINIT in module EDIT of theHome ROM. When Channels 0 through 3 are CLOSEed, the values arerestored to those used at power-on time. All others are clearedto zero.

B. CHANS The CHANS System Variable at 23631 (5C4FH) contains the address ofa 21-byte table initialized at power-on or execution of a NEWcommand to support "stream" I/O to the four standard systemdevices ("K", "S", "R" and "P"). Each table entry is 5 bytes longand is indexed by the value obtained from the STRMS table added to(CHANS)-1. Each entry has the following format:

Output Routine Address 2 BytesInput Routine Address 2 BytesDevice Specification 1 Byte

This table is copied from CHINIT in module EDIT of the Home ROM.The last byte of the table contains an 80H which will immediatelyprecede the first line of the BASIC Program (PROG).

Whenever an I/O operation is performed, the appropriate Channel is"selected", i.e. its number is used as an index into STRMS toobtain the offset into the CHANS table. This offset is added to

92

Page 101: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

(CHANS)-1 and the resultant pointer is loaded into the SystemVariable CURCHL for use by the next character I/O operation(WRCH/RDCH). The device specification from CHANS is used to findand execute the initilization routine in SELTAB.

C. SELTAB The Select Table is located in the EDIT module of the Home ROM andcontains offsets to device dependent initialization routines forthe standard devices "K", "S" and "P".

D. SPEC T The Specification Table is located in the CHANS module of the HomeROM and contains offsets to device dependent OPEN routines for thestandard devices "K", "S" and "P". It is accessed whenever anOPEN # is executed.

E. CL TAB The Close Table is located in the CHANS module of the Home ROM andcontains offsets to device dependent CLOSE routines for thestandard system devices "K", "S" and "P". It is accessed whenevera CLOSE # is executed.

The following sections describe the standard system I/O devicessupported via Channel I/O.

4.1.1 Keyboard

The low-level routines supporting keyboard input areexecuted every l/60 of a second out of the InterruptionHandler (Location 56 (38H)). The controlling routine islabelled UPD K. This routine calls K SCAN to determine ifany key(s) are currently being depressed, controls thedebouncing and repeat algorithms, calls K BASE to determinethe Base Code, calls CHCODE to translate th e Base Code basedon Mode (e.g. "K", "G" or "E" Mode), and finally, stores theresultant keystroke code in LAST K and sets the flagKEYHIT. Figure 4.1.1-l illustrates the mode controlvariable and associated flags and Figure 4.1.1-2 containsflowcharts of the keyboard support routines.

The character input routine associated with Device Spec. "K"is labeled IN K. The entry address is obtained using thepointer in CURCHL when Channel 1 has been Selected and theCharacter I/O Input routines RDCH/INCH are executed. TheIN K routine tests the KEYHIT flag to detect the presence ofinput from the keyboard. When the KEYHIT flag=l, thecontents of LAST K are returned to the requestor.

93

Page 102: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 103: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 104: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 105: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 106: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

4.1.2 Video Screen

The TS 2068 system software supports I/O in the primarydisplay file only. See Section 2.1.10 for the displayfile organization. The screen, which is 32 columns X 24lines, is partitioned into two parts, the main or upperscreen (22 lines1 and the lower screen (2 lines). Thelower portion of the screen is used for output of systemmessages and to echo input from the keyboard of BASICcommands, BASIC program lines, or data. The lower screenexpands as needed for multi-line input, scrolling theentire screen upwards. The variable DF SZ reflects thenumber of lines in the lower screen (default=2).

Character output to the screen is done using the ChannelI/O described in Section 4.1 using device specification"K" for the lower screen and "S" for the upper screen.Each character is defined by an 8 X 8 group of pixels.The 8 bytes needed for each of the 133 characterssupported by the TS 2068 are located as shown in Figure4.1.2-1. Note that by constructing your own pixel dataand placing (base address-lOOH) into CHARS, you candefine your own character set.

Associated with each character position is an AttributeByte controlling the background (PAPER) color, theforeground (INK) color, the intensity (BRIGHT), andwhether the position is constant or alternates betweentrue and inverse video (FLASH). Two other "attributes",OVER and INVERSE, are implemented by software at the timethe character(s) are placed into the display file.

FIGURE 4.1.2-1

TS 2068 STANDARD CHARACTER TABLES

Character Set No.of Chars. Char.Codes

Standard 96 32-127(20-7FH)

Std.Graphics 16

User DefinedGraphics

21

128-143(80-8FH)

144-164(90-A4H)

Location

Home ROM(3D00-3FFFH)(Address-100Hin CHARS)

DynamicallyGenerated bySoftware

Home RAM(Address in

UDG)

98

Page 107: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

The screen output routine, SENDTV, is in Module IO 1 ofthe Home ROM. This routine is used for output to-boththe screen (upper and lower) and the dot matrix printer.The following sequence illustrates the major operationsinvolved in executing a PRINT "A" statement:

1. Channel 2 is Selected (normal assignment assumed)

loads CURCHL with pointer into CHANS area forChannel 2 (first 2 bytes are address of OutputRoutine - SENDTV).

clears printer and lower screen flags

sets ATTR T to values based on Am (current"permanent'" *attribute values are nsferred tothe system variable used by the screen outputroutine). If the PRINT statement containedtemporary attribute controls, they wouldoverride the settings established via Select.

2. The character code for "A" (65/41H) is placedin Register A and a RESTART 16 (10H) isexecuted (WRCH). This jumps to SENDCH inmodule EDIT of the Home ROM which oassescontrol to the SENDTV routine based on (CURCHL).

3. The registers are loaded from the SystemVariables with the current Row/Column position(S POSN) and Display File address (DF_CC) forthe main screen.

4. The character code is determined to be from thestandard character set so the registers areloaded with the address from CHARS and theoffset to the pixel pattern for "A" iscalculated using the character code X 8 (shiftleft 3 places).

5. The first pixel row (8X1) from the charactertable is copied to the display file. Thecharacter table address is incremented by 1 andthe display file address is incremented by 256(lOOH). The next pixel row (8X1) is copied tothe display file. This process is repeateduntil the 8 pixel rows have been copied.Masking of the data going into the display fileis done based on the flags from P FLAG thuscontrolling the OVER and INVERSE attributes.

6. The attribute. byte controlling the characterposition just written is updated based on thevalue in ATTR_T and other flags.

99

Page 108: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

7. The variables S POSN and DF CC are updated toreflect the nexfscreen position and return ismade from the WRCH operation.

In the above sequence, if the print position for the "A"had started a new line following the 22 lines of the mainscreen, the SCROLL? prompt would have been outputted tothe lower screen and, assuming a positive response, theupper screen would be scrolled up 1 line, a blank lineinserted at the bottom of the upper screen, and the "A"printed at the start of the new line.

Graphics I/O using pixel coordinates is supported in theprimary display file by the PLOT, DRAW and CIRCLEcommands. The Home R O M module GRAPHS contains the majorroutines which implement these commands. They arelimited to the 22 lines of the upper screen (256 X 176pixels).

Figure 4.1.2-2 shows the internal representation used todesignate row (line) and column positions. See Section2.1.10 for details on the organization of the DisplayPixel and Attribute Files. See Section 5.2 for detailson software support necessary for the advanced videomodes.

FIGURE 4.1.2-2

DISPLAY FILE ROW/COLUMN NOTATION

BASIC Parameters Internal Representation

Line/Row 0 24 (18H)1 23 (17H). . UPPER

21 3SCREEN

_________~-_________~~~~~~~~~~~~22 2 LOWER23 1 SCREEN

Column 0 33 (21H)1 32 (20H). .

31 2

100

Page 109: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

4.1.3 2040 Dot Matrix Printer

Character output to the 2040 Printer is handled by thesame routine used for the screen, SENDTV. When thePrinter Flag=l, set by initialization for device "P", thepixel data is written into the Print Buffer instead ofinto the Display File. There is no Attribute Byte. The"attributes" OVER and INVERSE which are softwarecontrolled can be active. Since the Print Buffer isalways precleared to zeros, OVER has no effect. INVERSEworks exactly as it does for the screen, i.e. INK pixelsare zero and PAPER pixels are 1.

The Print Buffer is located at 23296 (5B00H) and is 256(lOOH) bytes long, the data needed to print one line of32 characters, each character comprised of 8 bytes (8 X 8pixels/character). The buffer is cleared to zeros andthe flag PRLEFT set to zero at power-on time (orexecution of a NEW command). The PRLEFT flag is set to 1whenever pixel data is written to the buffer. This flagis used when exit is made from a program to print anyunprinted data prior to program termination. As thepixel data for a particular character is entered into thebuffer, the buffer address is incremented by 32 (20H);the sequential data in the buffer therefore represents 8complete scan lines of 32 characters. When the PrintBuffer is full, or upon processing an End-of-Line (ODH),or at program termination, the contents of the buffer arewritten to the Printer, the buffer is cleared and thePRLEFT F

PrinterrespondsAddresscombinat

ag is set to zero.

I/O is done via Port OFBH, but the Printerto any I/O Read/Write with Address Bit 7=1 andBit 2=0. Therefore, any Port providing thison, e.g. Ports OFA through OF8 and Ports OF3

through OF0 as well as others, will interface to thePrinter. See Section 2.1.13.3 for the bit definitionsfor Printer I/O. The pixel data is written to the deviceby the routine PRSCAN in module IO 2 of the Home ROMwhich outputs 1 scan line (32 bytes), one bit at a timeon each call to the routine.

There are two controlling routines for output to theprinter. DUMPPR is called from SENDTV based on bufferfull or End-of-Line control. This routine will callPRSCAN 8 times to output the 256 bytes of the PrintBuffer (8 scan lines). The other routine is K DUMP whichimplements the COPY command. This routine calls PRSCAN176 times to write the contents of the primary displayfile for the main screen to the printer (8 X 22). All ofthe low level print routines are in module IO_2 of theHome ROM.

1 0 1

Page 110: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

4.2 Cassette Tape

Tape I/O is done via Port OFEH. An I/O read of Port OFEH pullsin the cassette input on Bit 6. An I/O write of Port OFEH Bit 3controls the tape output with Bit 3 = 1 genrating a high outputand Bit 3 = 0 generating a low output.

Data is written to the tape under software control creating thefollowing frequencies and format:

Sync Pattern of 4032 cycles at 806.5 Hz. (5 sec.)

Header: 17 bytes of data identifying the following datablock as either Program, Number Array,Character Array, or Binary Code and containingother control information.

The header is written as Data, i.e. the MostSignificant Bit first in each byte, 1 cycle at2040 Hz. for a Zero and 1 cycle at 1020 Hz. fora One. The first byte is zero identifying theheader. The final byte is a Checksumcalculated by XOR of all preceding data bytes.

Software delay of approximately 835 milliseconds.

Sync Pattern of 1612 cycles at 806.5 Hz. (2 secs.)

Transition Pattern of 1 cycle at 2400 Hz.

Data Block: Written as Data (see above) with first byte= -1 (FFH) and a final Checksum byte.

Figure 4.2-l shows the header formats for the various types ofdata.

The routines used to actually write and read the tape (W TAPE andR TAPE) are in the TAPE Module of the Extension ROM (see map inAppendix A). They are accessible via the Extension ROM InterfaceRoutine listed in Figure 3.2.2-2. The general flow required towrite a header and data block is:

1. Call W TAPE with A=O. IX contains the addressof the header and DE contains the length.

2. Delay loop approximately 1 second.

3. Call W TAPE with A=FFH. IX contains theaddress of the data block and DE contains thelength.

102

Page 111: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

The R TAPE routine performs either a LOAD (transfers data fromtape to memory) or VERIFY (compare data from tape against data inmemory) operation, based on the status at entry: Carry Set forLoad and No Carry if Verify. As for the Write, A=Block Type (0for Header and -1 (FFH) for Data Block). IX contains the memoryaddress.

The tape routines return Carry=1 for successful completion and NoCarry for error or Break Key detected, Roth W TAPE and R TAPEexit via the routine W BORD which restores the Border color basedon bits 3-5 of the system variable BORDCR. If the Break Key isdetected during this exit routine, a RESTART 8 (ERROR) isexecuted.

NOTE: The write to Port OFEH in the exit routine restoring theBorder Color has hit 3 = 0. This creates a finaltransition on the tape followina a write ooeration. Thistransition is necessary in order to successfully readback the final data bit from some tape recordingdevices. If you are calling the W TAPE routine so as tobypass the normal exit path, you must perform this finalwrite to Port OFEH with Bit 3 = 0 within a similartimeframe.

Addendum to R TAPE routine: Register DE must contain thelength of the-block to be read (DE=17 for the Header,and DE=HDLEN for Data). See Fig. 4.2-l for a definitionof HDLEN.

103

Page 112: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE '4.2-l

TAPE HEADER FORMATS

HDLEN HDADD HDVARSHDTYPE(1) HDNAME(10) (LSB/MSB) (LSB/MSB) (LSB/MSB)

0 up to 10 Length of Starting Length of Pro-ASCII Chars. Program Line No. gram = Offset

+ Variables or 8000H to Variables)WI:' - E.G.: (VARS) - (PROG)

0500=Line 5or 0080H ifno Line No.

1 II Length LSB=OO N/A(=O)Field from MSB=Array IDData 7 . . . . . . . . . . . 0Structure 100

iASCiI'-'60H)

CHAR.ARRAY 2

CODE (BINARY) 3

Length LSB=OO N/A(=0)Field from MSB=Array IDData 7 . . . . . . . . . . . 0Structure 110

iASCiI'-'60H)

Length Address N/A (=O)Specified Specifiedin SAVE in SAVE

4.3 Joysticks

The two joysticks are controlled via Register 14 (I/O Port A) ofthe Programmable Sound Generator Chip (see Sections 2.1.6 and2.1.7). Address and data are passed via Ports OF5H and OF6Hrespectively. The joysticks are read by first addressingRegister 14 in the PSG by writing a 14 (OEH) to Port OF5H. Thedata is then read by executing an IN from Port OF6H, having theport address in 280 Register C and the joystick (player) numberin Register B (number = 1 or 2). Note that PSG Register 7, Bit 5is assumed to be zero, enabling I/O Port A for input. If youever use I/O Port A for output (R7,B6=1), you will want to clearBit 6 prior to any input operation,

104

Page 113: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

Sample routine:

GETJOY LD A,OEH Load A = 14OUT A,(0F5H) Address the joystick portLD B,playernoLD C,0F6H Data Port address to CIN A,(C) Joystick data to ACPL Complement to High ActiveAND 8FH Get significant bits

The data read is LOW ACTIVE, i.e. all bits = 1 (byte=FFH) whenthe stick is at center and the button is not depressed. Figure4.3-l shows the interpretation of the data byte.

FIGURE 4.3-l

JOYSTICK DATA

Bit 7 6

T e STICK UP

STICK DOWN

! LSTICK LEFT

iSTICK RIGHT

- NOT USED (Always '1')

BUTTON DEPRESSED

4.4 S/W Generated Sound (BEEP)

The BEEP command produces sound using the speaker by toggling Bit4 of I/O Port OFEH to generate a signal of a calculated frequencyand duration based on the command parameters. It uses theroutine PARP which takes as input two parameters, one definingthe period of the signal (HL) and the other defining the numberof cycles to be generated (DE) and outputs DE+1 cycles of a tonehaving the period 8N+236 to 8N+246 T-States where (HL) = N. Boththe BEEP and PARP routines are in the K SCAN module of the HomeROY. The PARP routine is also used to generate the keyboard"click" and the "raspberry" which can be varied by modifying thevalues in the system variables PIP (23609/5C39H) and RASP (236085C38H).

4.5 Sound Chip (SOUND)

The SOUND command writes the first parameter (register number) toPort OF5H (address to Programmable Sound Generator) and thesecond parameter (load data) to Port OF6H (data to PSG). Theprogram line is scanned for multiple parameter pairs andcontinues writing address/data pairs to the PSG until the end ofthe statement is reached. See Section 2.1.6 for details on thehardware of the PSG.

1 0 5

Page 114: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

5.0 Advanced Concepts

5.1 Cartridge Software/Hardware

5.1.1 LROS

An LROS is identified by the following overhead bytes:

Location Description

0000 Not Used

0001 Cartridge TypeOl=LROS

0002/0003 Starting Address (LSB/MSB)

Address to be jumped to afterOperating System initialization iscomplete. Order of bytes is as for aJP instruction.

0004 Memory Chunk Specification.Bits O-7 represent Chunks O-7respectively in the Dock Bank in lowactive format:

0 if in use1 if not in use

NOTE: When writing to the HorizontalSelect Register (Port F4H), theChunk Specification is HighActive

The Memory Chunk Specification is used to enable thespecified chunks in the Dock Bank prior to jumping to theaddress specified in Location 2 and 3. Control istransferred from the Initialization code in the Extension ROMvia the GOT0 BANK routine in Home Bank RAM Chunk 3, thereforeBit 3 of the Memory Chunk Specification must be set to 1 inorder for the transfer to be accomplished as designed (Chunk3 also contains the Machine Stack).

CAUTION: If Chunk 3 is marked for' use in the DockBank, then when the Memory Chunk Spec. is written toPort F4H by the Sank Enable code, execution willcontinue from that point in Chunk 3 in the Dock Bankwith the Stack Pointer addressing ROM.

An LROS is Z80 machine code and is in complete control of theTS 2068 hardware after transfer to the starting address hasbeen made. It can directly implement an application, or it

106

Page 115: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

can support multiple applications by implementing a languageother than BASIC. An AROS dependent on such an LROS wouldhave to be part of the same cartridge since there is only onecartridge connector.

Interruption Mode 1 has been set hy the TS 2068 andinterruptions are enahled prior to passing control to theLROS starting address, therefore the LROS must containappropriate code at location 56 (38H) to cover the case wherethe interruption occurs after Chunk 0 in the Dock Bank hasbeen enabled, hut before any action by the software cartridgeto disable the interruption has been taken. Once control istransferred, the LROS may then disable the standard TS 2068interruption by setting hit 6 of Port FFH, mask theinterruption by executing a DI instruction, or set adifferent Interruption Mode. It may change the location ofthe M a c h i n e Stack. It may also change the memory selectionhy writing to Port OF4H with each bit set to 1 for thecorresponding chunk to he enabled in the Dock Bank (highactive format) or 0 to he enabled in the Home Bank. Thus, anLROS may contain code in Chunk 3, hut it should be enabledafter the OS RAM code has finished execution.

Now that your LROS is in the driver's seat, you are on yourown! Some important points to remember when,, mapping yourDock Bank memory and doing bank switching are:

1. The Display RAM is in Home Bank Chunk.2 for the primarydisplay file and Chunk 3 for the second display file.This memory is accessed independently by the videohardware. The software only needs to enable it whenactually reading or writing it.

2. The Dock Bank and Extension ROM Bank are mutuallyexclusive since they share the Horizontal SelectRegister in Port F4H. You will need a routine in theHome Bank RAM to do any switching between the two. Youmust also be careful to have the appropriate Home BankChunks enabled which are referenced by the ExtensionROM code, e.g. the System Variables in Chunk 2 orpossibly the bank switching code in Chunk 3.

3. Some interesting switching routines can be constructedby having parallel code in shadowing chunks of memoryto take advantage of the "instant" switch in executionfrom one hank to another when the memory selection ismade. E.g., a routine in the Dock Bank ROM in Chunk 6could push a Home Bank address on the stack, write toPort F4H enabl inq Chunk 6 and any other desired chunksin the Home Bank (by deselecting them in the Dock), andhave code at the next sequential instruction address inHome Bank RAM Chunk 6 to continue the path. A Return

107

Page 116: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

instruction, for example, would pass control to theaddress on the stack. Code to switch memory back tothe Dock Bank could be mapped in a similar way.

4. If you plan to use any of the System software routines,unless you know otherwise it is probably necessary tomaintain the contents of Home Bank Chunks 2 and 3intact (and Chunk 7 if the OS RAM routines have beenrelocated). The system routines rely heavily on theSystem Variables and assume that any pointers in themare pointing to the Home Bank. See Section 3.3.4.1 fordetails on using the RAM Interruption Handler andSection 6.0 for known corrections when using System S/W.

5. If you design an LROS implementing a higher-levellanguage and want to support an AROS application, youmust design your own initialization code to detect thepresence of such an AROS. The TS 2068 will not lookfor the presence of an AROS if an LROS is present,therefore there will be no entry for the AROS in theSystem Configuration Table. Note that since there isonly one cartridge connector, such an AROS would alsohave to be integrated with the supporting LROS in asingle cartridge or cartridge board.

108

Page 117: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

5.1.2 AROS

An AROS is identified by the following overhead bytes

Location

32768(8000H)

32769(8001H)

32770/32771(8002/8003H)

32772(8004H)

32773(8005H)

32774/32775(8006/8007H)

Description

Language Type1 = BASIC [and machine code]2 = Machine code only

(Any other value will resultin Error S, Missing LROS)

Cartridge Type2 = AROS

Starting Address(LSB/MSB)BASIC AROS = Addrs. of First

Program Line

Machine Code AROS = Addrs. ofFirst Z80 Instruction

Memory Chunk SpecificationBits O-7 represent Chunks O-7respectively in the Dock Bankin low active format as follows:

0 if in use1 if not in use

NOTE: Bits O-3 must he set to 1for proper execution.

Autostart Specification0 = No Autostart1 = Autostart

Number of bytes of RAM to beReserved for Machine CodeVariables (LSB/MSB - OlOOH=l byte

Reserved; 0002H=512bytes Reserved.

5.1.2.1 BASIC AROS

A BASIC AROS is supported by special code in the SystemROM (Section 3.2.1.2). The portion of the cartridgecontaining BASIC program lines is restricted to theupper half of the memory space beginning at location32776 (8008H) in the Dock Bank. Support forUser-Defined Functions, which requires searching for

109

Page 118: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

the definition parameters within the program, is notimplemented. Also, because the support code interfacesdirectly to the bank switching code in.Home RAM Chunk 3(does not allow for it to be relocated to Chunk 7), aBASIC AROS cannot utilize the advanced video modes andalso execute BASIC program statements. If thecartridge contained machine code supporting advancedvideo modes, the TS 2068 would have to be returned to"Normal " video mode with the RAM mapped accordingly(see Figure 1.1-3) if control were to be returned tothe BASIC Interpreter USR code.

Since execution of the cartridge BASIC program is doneby copying program lines to a buffer in the Home BankRAM (ARSBUF), the most efficient cartridge execution isobtained by making program lines as large as possible,

making use of the multi-statement feature of thef;;eio68. The reverse is true concerning execution ofREAD commands. An entire DATA statement is copied tothe Home Rank RAM, but only the current item isaccessed. It therefore will be more efficient to notmake DATA statements excessively long. The BASICprogram lines appear in the cartridge in exactly thesame format used in the RAM, i.e. Line Number (2bytes), Length (2 bytes), Command Token, etc.terminated by an Enter (ODH). Numerical constantsappearing in a proqram line are followed by the CHR$(OEH) byte and 5-byt e floating point format describedin the User Manual (see Appendix C of the TS 2068 UserManual). The Variables area is built in the RAM(address in VARS) exactly as though the program were inthe RAM. All variables, including arrays, are built atthe time of program execution - there is no provisionfor copying or accessing ore-defined: variables from thecartridge, however, see Section 5.3.2. The lastprogram line must be followed by a terminator bytehaving the Most Significant Bit set (e.g. 8OH),otherwise the Interpreter cannot detect the end of theprogram.

A BASIC AROS may contain machine code accessed via theUSR function. If the machine code address is withinthe memory designated by the AROS Memory SelectSpecification as 'in use', the Dock Bank will beenabled, otherwise the machine code address is assumedto be in the Home Bank. (See Section 6.0 for detailson known problems i n this area of the code.)Obviously, once control is transferred to the machinecode in the AROS, the ball is now in your court. Youcould have additional machine code residing in thelower half of the Dock Bank memory space which you cannow switch in. You only have to know what you'reabout. If and when you are ready to go back to

110

Page 119: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

executing your BASIC program, you must enable ChunksO-3 in the Home Bank and have the stack and other HomeBank RAM in the proper state for return to the USRfunction code in the BASIC Interpreter, i.e. what itwas when the USR function passed control to you.

The Autostart feature begins execution out of the BASICAROS immediately after system initialization. If theAutostart parameter is zero, control will go to theBASIC Interpreter as if there were no cartridgeinstalled, althouqh internal flags have been set notingthat a BASIC AROS is present. The cartridge will bestarted when you execute a RUN or GOT0 Line Numbercommand.

The final parameter in the overhead bytes allows you toreserve RAM beginning in Chunk 3 at Location 26688(6840H) for machine code and/or machine codevariables. The designated number of bytes are reservedby the AROS support code prior to beginning programexecution. The AROS buffer (ARSBUF) begins immediatelyfollowing this reserved area (see Fig. 1.1-3). Notethat this area is part of the RAM that gets relocatedif the second display file is opened. Therefore accessto your machine code and/or variables should heconditional on the video mode rather than direct if youare going to be using the advanced video modes,. Thisreserved area begins at 31488 (7B00H) when the seconddisplay file is open. Remember -- use of the seconddisplay file and execution of BASIC program from thecartridge are mutually exclusive.

The standard technique of reserving space for machinecode by modifying RAMTOP could also be used to placemachine code/variables at the top of the Home BankRAM. If you place code above (RAMTOP) which is to beaccessed via the BASIC USR function, the affectedmemory chunk(s) cannot be marked as "in use" in thecartridge in the AROS Memory Selection Specification.

5.1.2.2 Machine Code AROS

A machine code AROS is similar to an LROS with theexception that it is dependent on the System ROM forinterruption handling if the interruption is enabled.This implies that Chunks O-3 are enabled in the HomeSank.

111

Page 120: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

The Autostart parameter should be set to 1 since if itis zero, control will be passed to the BASICInterpreter as if the cartridge were not present.There is no BASIC command to directly start executionof a Machine Code AROS.

Because of a "bug" in the Initialization code handlinga Machine Code AROS, the parameter specifying thenumber of bytes to be reserved for machine codevariables must be adjusted by adding 21 (15H) to theactual number of bytes needed. This preserves the 21byte CHANS area starting at 26688 (6840H). Thereserved area then starts at 26709 (6855H) (or 31488(7B15H) when the second display file is open). Accessto the variables should be conditional based on thevideo mode rather than direct if you plan to use theadvanced video modes. If you do not plan to utilizeany of the system software, you can disregard the aboveand "do your own thing" with the RAM.

See Section 6.0 for known corrections when using SystemS/W.

5.1.3 EPROM Cartridge Board Application

Figure 5.1-l provides the logic diagram for a pluggable EPROMcartridge board capable of configuring up to four 16K-byte(128K-bit) EPROM's of the 27128 type. The artwork for the PCboard implementing that logic diagram is provided in Figures5.1-2, 5.1-3 and 5.1-4 for the Component Side art, the SolderSide art, and the Solder Mask (one common mask for bothsides), respectively.

See Section 2.4.2 for mechanical details of the connectorportion of the PCB.

112

Page 121: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 122: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 123: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 124: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 125: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

5.2 Advanced Video Modes

The following sections describe the various video modesavailable on the TS 2068 and the major software supoortfunctions necessary. See Sections 3.2.2.3 and 3.2.2.4 fordetails on using the Video Mode Change Service. Appendix Ccontains descriptions and code listings for a number ofsoftware packages developed by Timex that support variousscreen modes and applications. Reference to these packagesshould aid in gaining an understanding of the softwaretechniques needed to support the video mode hardware.

The TS 2068 video mode hardware works out of two areas ofRAM, the primary display file at 4000H and the second displayfile at 6000H. Each area consists of 5912 (1BOOH) bytes usedfor pixel and/or attribute data based on the mode selectedvia bits O-5 of Port FFH. The pixel data area divides intothree blocks, each supporting 8 contiguous lines on thescreen. See Section 2.1.10 for details on organization ofthe display RAM. Because the two display files occupy thesame relative positions within their respective 8K Chunks, bysetting/clearing Address Bit 13 a software routine canaddress the corresponding location in each file:

Address B it 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00l0'0xxxxxxxxxxxxx1

4000 - 5AFFH (Bit 13 = 0)

Address Bitt 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00rO"xxxxxxxxxxxxxJ

6000 - 7AFFH (Bit13 = 1)

DFl

DF2

In order to display a character on the screen, 8 bytes ofpixel data must be entered into the display file, one foreach scan row. For a particular character position, the scanrows are 1OOH bytes apart. E.g, the 8 bytes of pixel datafor position Line O/Column 0 are located at 4000H, 4100H,4200H ,......,4700H. Since this is the first characterposition on the screen, its Attribute byte, in Normal Mode,is the first byte in the Attribute File which starts at58OOH. The 768 (300H) Attribute Bytes are in sequentialorder starting at position O/O through O/31,1/0 through l/31,and so forth, ending with 23/O through 23/31.

One method of determining the starting display file addressfor a particular line/column position is to build a tablecontaining the starting address of each of the 24 lines (2bytes per entry). Then construct an algorithm that takes the

117

Page 126: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

LINE #012.

789.

151617.

23

line number and forms an index by multiplying it by 2 (shiftleft 1), add the index to the base address of the table, andread out the display file address. The column position isthen simply an offset added to this address. By testingVIDMOD (23746 - 5CC2H) you can determine whether to set Bit13 for the second display file, e.g. because you are in anodd column in 64-column mode, or simply because you are usingthe second display file in dual screen mode.

The following example illustrates this method. The tableentries are in Hex:

INDEX024.

14(0EH)16(10H)18(12H).

30(1EH)32(2OH)34(22H)..

TABLELSB/MSB00 40 4000H =20 4340 40(+20H)(+20H)EO 4000 48 4800H =20 48(+20H)(+20H)EO 4800 50 5000H =20 50(+20H)(+20H)

Line 0 (Top of Screen)Line 1Line 2

Line 7 (End of Upper Block)Line 8 (Top of Middle Block)Line 9

Line 15(End of Middle Block)Line 16(Top of Bottom Block)Line 17

46(2EH).....EO 50 Line 23(End of Bottom Block)

Line 17, Column 23 (llH/17H) would yield a display fileaddress of 5020H + 17H = 5037H. If VIDMOD indicated thesecond display file was to be used, setting Bit 13 of theaddress would yield 7037H. If we were using 64-column mode,because the column is odd (Bit O=l) we would set Bit 13 ofthe starting line address getting 7020H, then divide thecolumn address by 2 (shift right 1) since there are only 32columns in each display file. This would give us an offsetof 11 (OBH) which added to the starting address results in adisplay file address of 702BH. Having the display fileaddress, we now insert the 8 bytes of pixel data for thecharacter desired, incrementing the display file address by100H between each write (this is easily done by simplyincrementing the upper register of the register paircontaining the address). The following routine is asimplified version illustrating this process. It assumesthat Reg. Pair DE contains the address of the desiredcharacter in the character table and that HL contains theaddress of the desired position in the display file.

118

Page 127: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

LD B,8 Set Scan CountLOOP LD A,(DE) Get pixel pattern

LD (HL),A Write to Display FileINC DE Next pixel Pattern byteINC H Next DF Position (+100H)DJNZ LOOP Continue for 8 Scan Rows

Finally, we must update the Attribute Byte controlling theupdated character position. The following sample algorithmwill formulate the Attribute File address given the addressof any of the scan rows of the character position. We willassume we have saved off the starting display file addressand now have it in Register Pair HL.

GETATT LD A,HRRCARRCARRCAAND 3OR 58HLD H,A

MSB of DF AddressShift right circularto get Bits 3&4 (Block #)to positions O&lClear other bitsOR in Attr.File Base Adrs.Update MSB

NOTE: The LSB is the same asfor the pixel data.

Using our first example, with a Display File address of5037H, the Attribute File address would be 5A37H. The secondexample was using 64-Column Mode which does not requireattribute file update (attributes determined by video modesetting).

See Section 5.2.2 for a sample algorithm to formulate thedisplay file address for X,Y pixel coordinates. The aboveroutine for calculating Attribute File address would besubstituted for the method used in the example if not workingin High Resolution Graphics mode.

In addition to data insertion, two major screen supportfunctions are scrolling and clearing the screen. Scrollingis done in the System ROM by copying the entire display filedata and attribute controls up one line position (Line 1 toLine 0, Line 2 to Line 1, etc.) and inserting a blank line atthe bottom. Numerous more elaborate scrolling techniques canbe implemented using various directions (up, down, left,

119

Page 128: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

right) and smaller areas or "windows" of the screen.Similarly, clearing the screen, which consists of writingzeros to the data file and updating the attribute bytes to auniform value, can be implemented on smaller sections of thescreen. The software packages in Appendix C contain examplesof such implementations.

5.2.1 Dual Screen Mode

In this mode the secondsecond independent screen

display file is used to provide ahaving the same data and attribute

organization as the orimary display file. By writing to PortFFH with Bits O-5 = 1 (Bit 0 set), the second display file isactivated at the video screen. Appendix C contains asoftware package supporting Dual Screen Mode., The softwarepackage uses the system variable VIDMOD to determine whichdisplay file is the target of the current operation. Specialvalues for VIDMOD have been defined to permit building of onedisplay file while the other is active at the screen so thata complete screen image is ready when the hardware mode ischanged. Copy and Exchange routines have been provided tomove data within and between the two display files. Thisenables the BASIC graphics commands like PLOT, CIRCLE andDRAW, which work only in the primary display file, to be usedto create screens which are then moved into the seconddisplay file.

Because the System ROM works only in the primary displayfile, y o u can come up with some unusual situations when youhave the second display file active at the screen and you areexecuting BASIC or using the System ROM routines. If a nerror occurs, for example, the error message will be placedinto the primary display file and the ROM will be waiting forinput from the keyboard to direct the next action, but all ofthis is invisible since you have the other display fileactive. The machine will appear to be "hung", but it is onlydoing its normal thing. Be prepared to enter a OUT 255,O toan invisible command line in order to switch the display backto the standard file!!! Don't forget to also set VIDMOD(POKE 23746,128) to keep things consistent inside the dualscreen support code.

5.2.2 High Resolution Graphics Hode

This mode is set by writing to Port OFFH with Bits O-5=2 (Bit1 set). In this mode, also called Extended Color Mode, thesecond display file is used to expand the number of Attributebytes from one for each 8 X 8 pixel group to one for each 8 X1 pixel group thus giving 32 X 192 positions within each ofwhich two colors plus Bright and Flash can be defined. Eachbyte of pixel data entered into the primary display file has

120

Page 129: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

its own Attribute byte in the corresponding location in thesecond display file, e.g. the byte written to Location 4000Hhas its Attribute byte at Location 6000H, the byte at 47FFH(last byte of last scan row in Line 7) has its Attribute byteat Location 67FFH, the byte at 57FFH (last byte of last scanrow in Line 23) has its Attribute byte at Location 77FFH.The routine writing data to the screen would therefore enterthe pixel data to the desired location and then set AddressBit 13 of the Primary Display File address and write thedesired attribute control byte to the resultant location. Ifnormal characters are being written to the screen in thismode, eight Attribute bytes must also be written, one foreach of the bytes defining the character. The same techniquewould be used for writing to both display files, i.e. foreach of the seven bytes entered after the first, the displayfile address would be incremented by 256 (lOOH).

The System ROM graphics commands (PLOT, DRAW and CIRCLE)place data into the Primary Display File and update theAttribute File associated with the standard video mode(5800H-5AFFH). In High Resolution Graphics Mode, thehardware does not access this area for attribute control,therefore its contents have no visible effect. If before orimmediately following execution of the BASIC graphicsoperation, you update the attribute control information inthe second display file, you could possibly take advantage ofthe System ROM graphics capability. Admittedly, this is nota simple operation in the case of circles or drawing diagonallines and it will be more efficient to develop codespecifically to support this video mode.

The following sample routine takes as input two single bytebinary digits representing the X and Y coordinates of a pixelposition on the screen. It formulates the display fileaddress of the byte containing the pixel, creates a patternor mask byte for the specified bit position, sets the bit inthe display file, and updates the attribute byte (HighResolution Graphics Mode assumed). This represents asimplified version of the approach used in the System ROMgraphics support routines PLOTBC and SCRMBL.

The two inputs are assumed to be as follows:

Reg. C = X Coordinate O-255 (0-FFH) going left to rightacross the screen.

Reg. B = Y Coordinate O-191 (0-BFH) going from bottom totop of the screen.

NOTE: This covers the full vertical range of 192 positions.

121

Page 130: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

The Y Coordinate is checked for valid range and reverseddirectionally so that 0 represents the top of the screen and191 represents the bottom. After this reversal, the twocoordinates represent the following values:

Y XBit (7 615 4 312 1 6 5 4

/312 1

I01

IBit17

I IO]

SCREEN LINE NO. SCAN ROW COLUMN BITBLOCK WITHIN WITHIN (O-31) (O-7)(O-2) BLOCK LINE (0-1FH)

(O-7) (O-7)

We first formulate the MSB of the display file address usingthe Block and Scan Line information in the Y Coordinate:

PLOTXY PUSHLDSUBJPLDANDRRARRARRALDLDANDORORLD

(SAVECO),BCA,191BC,ERRORB,AOCOH

H,A Save Block BitsA,B Y Coordinate07 Get Scan Row BitsH Combine Block and Scan Row40H Base Address of DF (4000H)H,A H = MSB of DF Address

Save coordinatesTest Y within range

Y coordinate beyond rangeY Coordinate now O=TopGet Block No. (O-2)Shift Bits to Pos. 3&4

Next we formulate the LSB of the display file address usingthe Line information from the Y Coordinate and the Columninformation from the X Coordinate:

LD A,CRLCARLCARLCA

AND OC7HLD L,ALD A,BAND 38HOR LRLCARLCALD L,A

Get X CoordinateAlign to Pick Up LineBits from YA=2 LS Bits Column/XXX/3 MSBits ColumnClear Bits 3-5Save A in LGet Y CoordinateGet Line BitsCombine with Col.BitsShift to Final PositionA=Line #/ColumnL = LSB Display File Addrs.

122

Page 131: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

Next we get the pixel position within the byte by taking thelast 3 bits of the X Coordinate and create a mask byte havingall bits zero except the addressed pixel. This mask is thenused to set the bit in the Display File. The address is setto Display File 2 to update the Attribute File (High Res.Graphics Mode is assumed to be active), and the‘ routine isfinished. The memory locations defined as ATTR and SAVECOare for illustration purposes only:

LDAND

LDINCLD

LOOP RRCADJNZORLDORLDLDLDPOPRET

A,C7

B,ABA,00000001B

LOOP(HL)A,20HH

??ATTR)(HL),ABC

Get Pixel PositionO=Leftmost (MSB);7=Rightmost (LSB)Use as Control CountB=l-8Bit MaskRotate Mask Bitto Proper PositionOR Bit into DF

Set Bit 13 for DF2HL = Attribute FileGet Attribute ByteUpdate Attribute FileOriginal X/Y to BC Regs.

Repetitive calls to this routine with the appropriate X/YCoordinate values will "draw" on the screen. The System ROMroutines for drawing lines and circles calculate thesuccessive X/Y Coordinate values and use common low-levelroutines similar to the above to place each pixel in thedisplay file.

5.2.3 64-Column Mode

In this mode, set by writing to Port OFFH with Bits O-2=6(Bits 1 and 2 set) and Bits 3-5 selecting ink color (0-7),the pixel data portions of the two display files are mergedby the hardware on an alternating column basis to produce64-columns across the screen. All even columns (0,2,4....62)are derived from the primary display file and all odd columns(1,3,5..... 63) are derived from the second display file.There are still 24 lines vertically from top to bottom. Theattributes are controlled by bits 3-5 written to Port FFHselecting one of eight ink/paper combinations. The Brightand Flash attributes are fixed at 0 and the Border is fixedto match the paper color. The Attribute Files in RAM at5800H-5AFFH (primary display file) and 7800H-7AFFH (seconddisplay file) are not utilized in this mode.

123

Page 132: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

Software supporting this mode must set up the display fileaddress for character insertion based on the column position(even=DFl; odd=DF2). When scrolling the screen (or a portionof it), any line of text on the screen requires the sameoperation to be done at the corresponding locations in eachdisplay file. This is also true to clear the screen (or aportion of it). To save a Screen on tape you must save twoCode files, one for each display file. The SAVE filenameSCREEN$ will work for the Primary Display File only. Youwill have to specifically SAVE the second display file via aSAVE filename CODE 24576,6144. Note also that because theBorder color is fixed by the video mode, you will not see theusual "stripes" during a tape operation.

Code to support an 80-column mode screen was developedutilizing the 64-column hardware mode and redefining thecharacter size to a 6 X 8 pixel group (there is really roomfor 84 characters if the full 256 pixel width is used).Since individual characters now can span the two displayfiles (e.g. 2 pixels in DFl and 4 in DF2) insertion of datainto the display files involves masking the 6-bit character(or portion thereof) with the 8 bits of data read/writtenfrom/to the display file.

Appendix C contains descriptions and code listings ofsoftware packages supporting 64 and 80-Column modes.

5.2.4 Other

Appendix C also contains software packages supporting thefollowing video screen features:

A. 40-Column Mode - utilizes the 6 X 8 character setdefined for 80-Column Mode in "normal" mode. May becombined with the Dual Screen package.

B. Sprites - supports movement of software-defined objectsand multi-directional screen scrolling services in thePrimary Display File. You must create the actual bitmap defining the shape of your sprite(s), but thispackage does the rest.

124

Page 133: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

5.3 Other Advanced Concepts

5.3.1 Interruption Fielding

For a machine code program executing in the Home RAM, you canintercept the 17 ms. interruption for your own purposes bypermanently enabling Chunk 0 in the Extension ROM Bank (writea 1 to Port OF4H and always have Bit 7 of Port OFFH = 1) andinserting at Location 25262 (62AE Hex) a branch to your owninterruption handler. (Or if VIDMOD is not zero, insert yourbranch instruction at Location 64110 (FA6EH).) By doing thisyou are forcing the interruption to branch to the RAM andthen bypassing the OS RAM Interruption Handler - see Sections3 7 3 1 and 3.3.3.1.. 7. 3. Because the Video Mode Change Serviceautomatically updates internal branch addresses in the OS RAMcode when it is relocated between Chunk 3 and Chunk 7, youprobably do not want to directly overlay the OS RAMInterruption Handler with your own code if you will be usingthe Video Mode service. Your branch instruction at 62AEH,however, will be copied unmodified to location FA6EH in Chunk7 and vice versa.

Note that this technique cannot be used if you are usingBASIC since then you must have Chunk 0 enabled in the HomeBank. It also cannot be used from a cartridge because thememory selection hardware (Port OF4H) is common to the Dockand Extension ROM Banks and can only enable one of them at agiven time as selected by Bit 7 of Port OFFH.

5.3.2 BASIC AROS Variables

In order to use pre-defined arrays and/or other BASICvariables, store them in the cartridge (possibly in the lowerhalf of the addressable space which is not usable for BASICprogram) and branch to a machine code routine via the USRfunction at the beginning of your BASIC AROS program. U s ethis routine to do the necessary memory selection and copyyour data from the cartridge to the RAM (address in VARS).Adjust the System Variables E LINE, WORKSP, STKBOT and STKENDto all point to the first free memory following your BASICvariables. Of course, all BASIC variables must conform tothe format expected by the BASIC Interpreter. In addition toBASIC structures, you can also store screen images andmachine code/variables in the cartridge for transfer to theRAM under your control. Consider using the XFER BYTESservice in the OS RAM.

-

125

Page 134: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

6.0 Known "BUGS" and Corrections

This section describes the known problems in the TS 2068 SystemSoftware and gives corrections or work-arounds where these havebeen defined.

6.1 LROS and Autostart Machine Code AROS

6.1.1 If you will be using the System ROM Keyboard routinesand accessing the input character code from systemvariable LAST K (5C08H), you must initialize the TS2068 to "L" mode by setting the system variable MODE at23617(5C41H) to zero and setting Bit 3 of FLAGS (23611-5C3BH) to 1. (The TS 2068 is in "K" mode when controlis passed from System Initialization to the Cartridge;Keyword Token codes will be placed in LAST K instead ofcharacter codes.

6.1.2 If you will be using the System ROM Calculator routines(RESTART 40 (28H) ) or any ROM routines that invokethem, you must initialize the System Variable YEM bydoing the following:

LD HL,5C92H Set HL=MEMBOTLD (5C68H),HL Initialize MEM

6.1.3 Chunk 3 must not be designated as "in use" by theCartridge Memory Selection Specification byte. Thiswill cause deselection of the bank switching code priorto completion of the transfer of control to thecartridge starting address. Once control has beentransferred, the cartridge code may then enable Chunk 3in the Dock Bank if desired. (See Section 5.1.)

6.1.4 No entry is made in the System Configuration Table foran RROS if an LROS is present. This means that an LROSdesigned to support either RAM based or cartridge basedapplications must include code for detection of an AROS.

6.2 Machine Code AROS

When setting the AROS Overhead parameter requesting RAM spacefor machine code variables, 21 + n bytes (15H + n) must berequested where n is the number of bytes needed. The machinelanguage variables area then starts at 6 8 5 5 H immediatelyfollowing the 21-byte CHANS area. (See Section 5.1.2.3.)NOTE: This does not apply to an AROS that contains bothBASIC and machine code.

126

Page 135: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

6.3 BASIC AROS

6.3.1 USR Function - When testing the USR address againstthe Cartridge Memory Selection byte to determine ifthe address is in the Home Bank or the Dock Bank, thewrong nibble is tested in the register thus a validcartridge address could be erroneously processed as aHome Bank address. Since the ROM code cannot becorrected, the machine code in the cartridge wouldhave to be moved to an address that does not cause aproblem.

6.3.2 FOR/NEXT - If the limit of the FOR statement hasalready been passed on its initial execution, (e.g.FOR A=1 TO 10 and A has been set to 12), control ispassed to the statement following the correspondingNEXT. In the AROS support code, the address of thisstatement is lost giving unpredictable results. Sincethe ROM code cannot be corrected, care must be takennot to use this technique in an AROS Cartridge.Normal usage of FOR/NEXT loops is not affected.

6.3.3 Advanced Video Modes - Because the BASIC AROS supportcode interfaces directly to the Bank Switching code inChunk 3 (does not access based on its relocatability),the second display file cannot be open when executingBASIC program from an AROS.

6.4 Video Mode Change Service

6.4.1 Available Memory Test - When the size of memory neededis calculated by adding the size of the second displayfile (6912 bytes or 1BOOH) to the memory now in use(address in System Variable STKEND), the code fails tocheck for overflow. Thus if the address in STKEND isgreater than 58623 (E4FFH), the fact that there is notenough free memory to open the second display filewill not be detected and the systen will "crash". Ifyour BASIC program and/or variables area ar e large,you may want to make this test yourself prior toinvoking the Video Mode Change Service in order toavoid this problem. The size of memory needed issubsequently tested against the contents of RAMTOP andif there is not sufficient space (value in RAMTOP isless than size needed), you will get Error 4, Out ofMemory.

127

Page 136: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

6.4.2 RAMTOP - When the machine stack and OS RAM code ismoved to Chunk 7, the User Defined Graphics area ismoved down in RAM by 2112 bytes (840H) to make roomfor the stack and OS RAM routines at the top ofmemory. The pointer in UDG is updated, however, thevalue in RAMTOP is not modified to insure that therelocated UDG area as well as the OS code and stackare protected from expansion of the BASIC program.You can avoid problems by setting RAMTOP via a CLEARcommand specifying an address no greater than 63255(F717H) prior to invoking the Video Mode ChangeService. This reserves space between RAMTOP and theend of memory of 2280 bytes (8E8H) utilized as:

168 bytes (A8H) User Defined Graphics (21 X 8)2112 bytes (840H) Machine Stack and OS Routines

-z!3u (st8Hl

Example: RAMTOP = 63255 (F717H)+ Reserved Area 2280 (08E8H)

-0

The software packages in Appendix C are writtenassuming that RAMTOP is set to 57343 (DFFFH) or lowerto protect the machine code which is loaded beginningat 57344 (E000H).

6.4.3 NEW Command - If you have used the Video Mode ChangeService to open the second display file and now wishto execute the NEW command, you should first returnthe computer to "normal" mode by calling the videomode service with A=zero. This returns the UserDefined Graphics and other RAM structures to theirnormal locations. If you don't do this, the UDG areawill remain in the alternate location and, if you havenot corrected RAMTOP as explained above, part or allof your UDG area could he cleared to zeros by the NEWcommand.

6.4.4 VIDMOD - When Mode 128 (80H) is designated foractivating the Primary Display File in Dual ScreenMode the System Variable VIDMOD at 23746 (5CC2H) isset to zero instead of to 128. This creates apotential problem if the 17 ms. interruption occursbefore VIDMOD can be corrected since the interruptionfielder will branch to Chunk 3 instead of to Chunk 7and Chunk 3 is now in use for the second displayfile. This problem is corrected by disabling theinterruption prior to calling the Video Mode ChangeService and setting VIDMOD to the correct value priorto re-enabling it. These corrections are included inthe Extension ROM Interface Routine in Figure 3.2.2-2.

128

Page 137: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

6.4.4

NOTE: On an initial access changing video mode fromnormal to Mode 128, the interruption is re-enabledwithin the Video Mode Change Service itself aftercopying the stack and other Chunk 3 data to Chunk 7.This cannot be corrected, but has not proven topresent a problem in actual use. At the point wherethe interruption is first enabled, the Chunk 3 code isstill intact allowing for correct processing of oneinterruption, and the path length from there to thepoint of correcting VIDMOD is apparently less than 17ms. The interruption is also re-enabled within theVideo Mode Change Service if you have applied thepatches for the BANK ENABLE and RESTORE STATUSroutines (Section 6.5.4) which are executed inconnection with inserting space into the RAM to openthe second display file. Again, this has not provento be a problem in actual use.

Interruption Inhibit - By setting Bit 6 of Port OFFHto a 1, the normal 17 ms. interruption generated fromthe SCLD to the Z80A CPU will be inhibited. When PortOFFH is written to by the Video Mode Change Service,Bit 6 is forced to zero. If you wish to inhibit thenormal interruption via this mechanism, and also planto use the Video Mode Change Service, it isrecommended that you first invoke the service to remapthe RAM and open the second display file, then set Bit6 of Port OFFH to inhibit the normal interruption andwrite your own routine(s) for subsequent changing ofthe video mode setting that do not involve remappingthe RAM. In this way you can maintain the value inBit 6.

6.5 OS RAM Routines

In patching the OS RAM routines, care must be taken not torelocate CALL and JP instructions since this affects themodification of the code when it is moved between Chunks 3and 7. All of the code containing actual addresses must bemodified to reflect the relocation and this is done using atable in the Extension ROM. Since the table cannot bechanged, none of these instructions can be moved. Also, anyCALL or JP instructions added must be modified by you whenthe code is relocated.

6.5.1 Function Dispatcher -For a variety of reasons such asconflict with use of the IX Register, incorrectentries in the ROM Function Dispatcher Jump Table,etc. some Service Codes have been deleted from theFunction Dispatcher table (Table 3.3.4-z). Inaddition, the following correction to the GET STATUSroutine' is required in order to successfully u t i l i z ethe Function Dispatcher from a cartridge.

129

Page 138: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

6.5.2 GET STATUS- Returns invalid memory selection statusfor-the Home Bank, ROM Extension and Dock. Thisresults in switching out of either the Home Bank orthe Dock when status is "restored". This affects useof the Function Dispatcher and GET WORD routines, andany other code using GET STATUS. Figure 6.5-l showsthe patches and additions necessary to correct thisroutine.

6.5.3 PUT WORD-overwritten

Write data passed in Reg. Pair DE isprior to use. Figure 6.5-2 shows

corrections.

6.5.4 BANK ENABLE and RESTORE STATUS-- -

If the 17 ms. interruption occurs during update of thememory selection hardware, it can cause the system tohang and RAM to be overwritten. This occurs when theinterruption happens in an interval when Port FF Bit 7is zero (thus selecting the Dock Bank) and Port F4 Bit0 is one (thus enabling Chunk 0 in the Dock Bank) andthere is no memory in Chunk 0 of the Dock Bank. Thiscan be true when there is no cartridge installed, orif the cartridge installed is an AROS. This problemis corrected by disabling or masking the interruptionwhile updating the memory selection hardware. Figure6.5-3 shows one implementation of this correction.

6.5.5 SAVE STATUS and RESTORE STATUS - The value of Port FFHwhich includes video mode and interruption inhibit aswell as Ext. ROM/Dock Select is saved and restored asa full 8-bits. Therefore any modification of thisport by code accessed between execution of SAVE STATUSand subsequent execution of RESTORE STATUS (erg. viaCALL BANK or use of the Function Dispatcher) is"undone". This is one reason the Video Mode ChangeService and some of the bank switching routines suchas BANK ENABLE cannot be meaningfully accessed via theFunction Dispatcher.

6.5.6 CALL BANK- Does not correctly retrieve the stackentry designating the count of parameters beingpassed. Memory is overwritten in the case where thiscount is not zero. This is corrected by settingLocation 6610H = 9 (POKE 26128,9). You only need toapply the correction once; it will be duplicated inChunk 7 if the code is relocated.

130

Page 139: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

*

*

*

*************

*

FIGURE 6.5-l

GET STATUS CORRECTIONS-

LOCATION OBJ. CODE SOURCE STATEMENT COMMENTS( HEX) (HEX)

6405640664076408640A640C640E641064116413

F5D578FEFE2824FEFF2837A72827

.. .. .. .

6430 0EFF6432 DBFF6434 E6806436 28126438 1808643A OEFF643C DBFF643E E6806440 20086442 DBF46444 2F6445 18026447 DBF4

6449644A644B644C

4FDl

Input: Bank # in B

Output: Bank # in B (Bank Status if Exp.Bank)Memory Selection in C(Low Active Format)

GET STATUS PUSH AF Save Regs.

GS EXT

GS DOCK

GETHS

GS HOME

GS XT0GS XT1

PUSHLDCPJRCPJRANDJR

.

.

.

.

LDINANDJRJRLDINANDJRINCPLJRIN

LDPOPPOPRET

DEA,B Get Bank #OFEH Test if Ext.(254)Z,GS EXTOFFH- Test if Home(255)Z,GS HOMEA Test if Dock (0)Z,GS DOCK

(Code for Expansion Banksnot applicable)

C,OFFH Assume noneA,(OFFH) Test if selected80HZ,GS XT1 Not activeGETHS Get Hor.SelectC,OFFH Assume noneA,(OFFH) Test if selected80HNZ,GS XT1 Not activeA,(0F4H) Get Hor.Select Reg.

Invert to Low ActiveGS XT0 ExitA,0F4H All bits set are not

active in Home BankC,A Memory Select to CDE Restore Regs.AF

Return

The asterisks mark the locations modified. See next page for list ofcorresponding POKE's for BASIC.

131

Page 140: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 6.5-l

GET STATUS CORRECTIONS

(continued)

From BASIC:

POKE 25610,40 (Location 640AH)POKE 25611,36POKE 25614,40 (Location 640EH)POKE 25615,55POKE 25617,40 (Location 6411H)POKE 25618,39POKE 25648,14 (Location 6430H)POKE 25649,255POKE 25650,219POKE 25651,255POKE 25652,230POKE 25653,128POKE 25654,40POKE 25655,18POKE 25656,24POKE 25657,8POKE 25658,14POKE 25659,255POKE 25660,219POKE 25661,255POKE 25662,230POKE 25663,128POKE 25664,32POKE 25665,8POKE 25666,219POKE 25667,244POKE 25668,47POKE 25669,24POKE 25670,2POKE 25671,219POKE 25672,244POKE 25673,79

132

Page 141: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 6.5-Z

PUT WORD CORRECTIONS

LOCATION OBJ.CODE SOURCE STATEMENT COMMENTS(HEX) EX)

Input: Data in DE, Address in HL, Bank # in B

6338633C633D634063416342634363466347634A634B634C634D63506351635263536354635563566359635A635B

F5c5CD5E64D5

2;CD0564C5CD4D642F424FCD9964Cl

;;

7';2BCO9964Cl

:;

PUSH AFPUT-WORDPUSH BCCALL GET NUMBERPUSH DE LD D,BLD B,ACALL GET-STATUSPUSH BCCALL GET CHUNKCPL LD

Fyi;:LL BANK ENABLEPOP BC POP DELD (HL),EINC HLLD (HL),DDEC HLCALL BANK ENABLEPOP BC POP AFRET

The asterisks mark the locations modified.

From BASIC:

POKE 25408,213POKE 25424,193POKE 25425,209POKE 25426,115POKE 25427,35POKE 25428,114POKE 25429,43

Save Regs.

Bank # of OwnerSave DataSave Target BankBank # of OwnerGet Bank StatusSave ItGet Bit MapSet High ActiveTarget Bank # toMemory Select ByteEnhl.Target Mem.Saved Bank StatusSaved DataWrite LSBIncrement Adrs.Write MSBRestore HLRestore Bank St.Restore Regs.

Return

NOTE: The corrections to GET-STATUS and BANK-ENABLE are also required.

133

Page 142: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

FIGURE 6.5-3

BANK ENABLE AND RESTORE STATUS CORRECTIONS-

From BASICBANK ENABLE: Location Object Code POKE Address Value

6499H 00 NOP 25753 0649DH F3 DI 25757 243651 CH FB EI 25884 251

RESTORE STATUS:-

654AH F3 DI 25930 2436570H FB EI 25968 251

In both cases, the Disable Interrupt and Enable Interrupt are being doneby deleting the preservation of the AF Registers (PUSH AF/POP AF). Ifyour code requires AF to be saved, you must do it prior to calling eitherof these routines or any other system routines that use them. Note alsothat if you already have the interruption masked when these routines areentered, it will be enabled when they are exitted. If this proves to bea problem, replace the Enable Interruption (EI) instruction with a NOPand do the enable at a more appropriate place in your own code.

6 . 5 . 6

6 . 5 . 7

GET NUMBER- Always returns the Dock Bank # for anymemory enabled in the ROM Extension. Unlikely to be aproblem because of limited use of the ROM Extension.

XFR BYTES- Improperly passes memory select byte forthe case where source and destination are in the samebank. This is corrected by setting Location 676AH =5FH (POKE 26474,951.

6.6 GENERAL

6.6.1 Pressing ENTER multiple times with an invalid tapecommand on the edit line (syntax error) causes thesystem to reset. This is due to overflowing the BankStatus Stack in RAM Chunk 3/7 due to the multiple callsto and from the Extension ROM via the Call Bank codewithout normal termination (the error causes-a RESTART8 to be executed out of Home ROM code called from theROM Extension). It shouldn't take anybody that manytries to get a tape command right, so this is not areal problem, but you may want to keep it in mind. Forany call made through the OS RAM services, you shouldhave a corresponding return to keep the structuresclean.

134

Page 143: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

6.6.2 ON ERR GOT0 - If a non-existent line number isspecified, followed by an error, the system will hang.The ROM code is in an endless loop trying to report theabsence of a valid error handler to the non-existenterror handler!!! On some errors, you will get anunexpected 0 OK termination showing the line number ofyour Error Handler. This is because some ROM routinestemporarily clear the INTPT Flag (Bit 7 of FLAGS).This flag is set to 0 when checking syntax and set to 1when executing; if an error is detected while theFlag=O, the error handler code is branched to but isnot executed.

6.6.3 Parameters to the SOUND command are not fullyvalidated, therefore you can specify a number beyondthe valid range for a given operation and not get anerror, for example, you can write a value greater than63 to the Enable Register (Reg.7), possibly changingthe I/O Port used for reading the joysticks from inputto output. If you specify a number larger than 255(FFH), only the least significant byte will be actuallywritten to the Programmable Sound Generator. Access toPSG Reg. 14 (IO-A) used for the Joysticks is also notprecluded via the SOUND command.

I f you experience difficulty in reading thejoystick(s), do a write to PSG Reg. 7 clearing Bit 6 to0 to guarantee that the joystick path is enabled forinput (see Section 4.3). This write can be done byexecuting a SOUND 7,63 (or any value less than 63).

The INTEGER function for (-65536) gives an incorrectresult of -1, and for other cases where the resultshould be -65536, it gives -lE-38. Since the ROM codecannot be changed, there is no correction.

6.6.4 If you respond to the SCROLL? message using multiplekeys such as Cap Shift/Z or Cap Shift/Symbol Shift, youwill get strange results like dumping of the Edit Linewith the "C" or "E cursor, display of ROM data, ormultiple scrolls. Stick to single key responses andyou won't have any problems!

6.6.5 When DELETE (Cap Shift/O) is held down to do deletionof characters in the Edit Line, sometimes it outputsthe DELETE Keyword instead (it should not do this inauto-repeat mode). This is especially noticeable whenthe input line is long. Since the ROM code cannot becorrected, you must try releasing and pressing theDELETE key at differing frequencies and you will beable to get past this "Bug".

135

Page 144: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

APPENDIX A

HOME ROM MAP

L I N K 1 . 7

LOAD MAPMODULE

BLOCKBASICKSCANIO_1I O_2EDITCHANSL ISTAROSSYNTAXSYNTWOGRAPHSEXPRNI DENTI NOUTSUMSCALCFUNCTSTAPEMSGCH_SET

GLOBAL

ACSODDHLNUM?ALP%?C\NGLEARGSARRAYAR_LNFIR_NXTASNATNATTBYTBEEPBORDERBREAK?C:ATCHGODECHINITC:HK_SZGIRGLEGLCHANCLEARCLELCLLHSC:LClSEGLPRC:LR_BGGLSC’LS_BC:OL I TMGOLCIURGONTGCISGP-ECCTRO

ClRIFIN LENDTH

ADDRESS

SGSE33D3%)4r51304B>B’.“El:?c’b3;c1517EA17FF;::C’4E3BFD0 7 1 004362 4 3 620092JGS03711lAA1FBB267913BElF36133FClBc\P139FCm35iF39OSEAO97F2:3c1423DElEE43BG316E83714

00009 2 2 702D90502Cl:318Cl&320 1 4 202D40190CWICI04B4024 1O41C03E9CJ3CJ 1032A0 4 3 7OlGE009303cK-l

MODIJLE

FUNGTSSUMSI DENTI DENTFUNGTSAROSGALGARC6AROSFUNCTSFUNGTSIO-1C’SGAN._SYNTWOSYNTAXSYNTWOKSCfiNEDiTSYNTAXGRAPHSCHANSSYNTAXEDITIO-1C:HANSI CL2SYNTCIXIO-1IO-1SYNTWOSYNTWOSYNTCIXFIUNCTSL I S TGALC

OOTGClEFDELREGDELEaYMDEL-DEDEL-C:DESLUGDE_HLD I 0 I T 7DIMDIVIDEDRAWDRCIWLNDR&W_LDUMPPRDYADICECHOE D I T - KEND?ENDSTTENDTEMERASEERR2ERR4ERRSERR6ERRBERRHERR0E x CUTEEXPEXPRNF I N D - LF IND_NFIX_UFI X-U1FLASH&FLC:ATFORFGRMATFP2AFPY’BC’F_I;TTRF_ I Nt?F - P IF_PNTF_!3C:RNGETALSET-ELGET-LNCET_XYC;rJ_‘:;l_lB,OR_GOLHIFLSHI NGHI N I N TINITINPUTINSTIN%INSERTI N TINTDIV

1750CbB7E174D0BFD0DODl&S‘3l:t[l9LFC:Q‘3JbE2hDB28132SlCl0F12’31 BDC511~: a3ClfiS2lB441 AB91 B4FI5D4lB?l1 FC:F07ClS56.c1F’Q2’::?E12:3D1 ADS3ADFL’S541 bD62C7Cl1 F2:31FlE16cm‘I-:&S&

1 G7S2’JGG319331601:3D72”F2,59ES216242:3:3E17CF2D.5413242,560lF?‘?23BG241[lllE1:::CtF9OD:3 1222B12B80AE712BB.3AGA.3ABB

SYNTAX5YNTCIXL I S TI o-2L I S TICI-2ICI-2L I S TI NOUTI DENTSIJMSGRCIPHSGRAPHSGRAPHSIO-2!;YNTCIXID-2ID-2SYNTAXSYNTAXSYNTAX!SYNTWOSYNTAXSYNTFIXIO-1?lJW!GYNTAXSYNTWOEDITSYNTC\xFUNCTSEXPRNL I S TI DENTSYNTAXSYNTAXL I S TSUrlSSYNTAXSYNTWDI NOUTI NQUTEXPRNEXPRNEXPRNGROPHSEXPRNARCSI DENTEDITGRAPHSSYNTbXSYNTWOSYNTWOEDITI NDUTEDITSYNTWOEDITI D - 2EDITFUNCTSFUNCTS

136

Page 145: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

INTPTTIN-KI _SEQ._lUMPK_BaSEK_CLSK,DUHPK-LISTK_.LLSTCI_LPRK-NEWK,PRINK_ScaNLCU2LDDELDHESLDTVCIJLE3LED18LED4LETLINENGL I S TLNLPOLS4LT22MOVEMULTNC-HI:NEGaTENEWNEWDEVNEXTNEXTCHNEXT-LNOTKB?NXT-HLOPcHaNOPENGPTNGOUTPUTPaEDCBPCIRPPCISSEMPC\USEPHLaFPLOTPLOTBCPLUG INPGPSTRPRSCaNPR_CURPR_TVZPSHSTRPUTPClTDIQPIJTMESPUT-BCPCIT_LNPUT_SRP_LFTP_NLF-RTP_5EQRfAMNGR9NDRKICHHECIDRECLEN

02BO132D31303ca:3O61a0055OE2FOEID2EBD176814El3B2E15ac1 a441 BBC25D934680077382DOD:3224D210550074165B23802C691465142cIlC4931a12E7493F32JB91FEBcJO4F2635263E09002FaFoa4a162D0 7 7 62E7O15C91lEA073F1788179515&l05340566(!?‘;4_ _317E377F1 ED41lCF1 I3971720

EXPRN10-ZSYNTl’GSYNTAXKSCaNIO_1I o-2L I S TL I S TSVNTWGEDITSVNTWGKSCaNEDITI NGUTTaPEWSG10-lBCISICEDITEDITI DENTL I S TL I S TFCINCTSL I S TSYNTaXSYNTaXSYNTWOSUMSBA!?IrCaiC

d

EDITSYNTWGSYNTAXBC)SICL I S TSYNTWOEXFRNCHaNSCHaNSSYNTaXI NGUTI DENTKSCaNSYNTWOSYNTbXBASICGRaPHsGRAPHSBCISICI DENTIO-2L I S TIO-1I DENTL I S TEDITIO-1L I S TL I S TL I S TIO-110-l10 t‘I’YNTWOCALC‘SYNTFIXEDITSYNTaXL I S T

WEPlGSZRESETHESTBCRETURNRNDROOM?ROOTRSETRSTSTRRATTSSCRL‘ZCRMBLSEkRCHSELECTSEL_HLSENDCH9ENDTVSEPRBTSETCClRSETTVCSET_aTSHIFTSINSKIPSKIPITSt. I CERSMINITSOUNDSRCHSCSTBOOLSTDE_SSTDE_USTKIJSNSTK,QSTK_aSTK-ECSTK_MSTOPSTRITOSTTVCUSUBSUBLINSUBLN 1SUMSLDSVNERRSYNTAXTaNTC_HLTEMlTEMlOTE?l6TEMP38TEMP39TERM?TEST0TIMESTOKENSTO-THETRCINCTVFUL?TV_COLUPD_KUSRRETWRCHXEVx_CALCX-T-HL

12CA1 ?4b* _II ECFI1 FD429B637683CC.5245413c18OS!3809392603136B123012481lED05003C8?09140914OSB233?C3BDO1 D2825692ElOllC121281.3743926314c314A3059lC5130E63OE93773lC59220FOSF333CE16FO16F333791 BED1 A273BF3007818821BEF1BEJ19EO19El21E739043489Ct@?S3C/>C35D3079023BB02El3882001031 lJ[l

134E1 c:c.3

EDITEDITSYNTaXSYNTaXEXPRNCCILCFUNCTSSYNTWOCHaNS10-lIO-1GRAPHSEDITEDITEDITEDITID_1TAPEMSG10-l10-l10-lSUMSFUNCTSSVNTaXSVNTWOI DENTEDITSYNTAXEDITCALCI NGUTI NOUTI NOUfSYNTAXI NOUTINOUTCaLcSYNTAXSVNTWOIO-1SUMSL I S TL I S TSIJMSSVNTaXSYNTCIXFUNCTSBasxcSYNTAXSYNTaXSVNTaXSYNTAXSYNTaXSYNTWOcaLcwflsx-BASIC.FIJNCTSSUMS10-lSYNTWOF%CAN._CALCBFISICI NGUTEDITEDIT

PROGRaM BLOCK -- 4000 B Y T E SENTRY: 0000

137

Page 146: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 147: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 148: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 149: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 150: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 151: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 152: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 153: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 154: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 155: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 156: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 157: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 158: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 159: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 160: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 161: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 162: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 163: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 164: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 165: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 166: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

APPENDIX C

The entirety of Appendix C (pages 158 to 287) has been excluded primarilybecause of its length and because of the poor print quality. My OCR softwarewould not accept it and including these pages as images would unacceptablyexpand the girth of this file.

Appendix C-1: Assembly source to support the 64 column modeAppendix C-2: Assembly source to support 80 columns in the 64 column modeAppendix C-3: Assembly source to support 40 columns in the 32 column modeAppendix C-4: Assembly source to support the dual screen modeAppendix C-5: Assembly source for sprite graphics in the 32 column mode

Much of this software is still bugged. Appendix C-5 was debugged andeventually released as "Sprites 2068" by a third party. Timex of Portugal alsoreleased "Basic 64" which supported 64, 80, 128 column text and BASICgraphics commands (CIRCLE, DRAW, etc.) in the 64 column mode, thoughwritten for the TC2048 and therefore must be run using a Spectrum emulatoron the TS2068. A third party released OS64 on cartridge, an expansion toBASIC that allowed it to operate in the 64 column mode.

Page 167: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

ae**rr*eICOOt1*1t.1.t*ae

. . ..C”.d

. . ..I-“.60318(St?a*01eac.1II,.

APPENDIX D

TS2068 PCB Assembly and Schematic Diagram

The following Appendix contains the PCB Assembly Drawing, thePCB Parts List, and PCB Schematic Diagram (a "fold-out" pagelocated just inside the back cover). The Table below containssome corrections to the Schematic Diagram.

***TS2068 PCB Schematic Diagram Corrections***

Page 34 of the Technical Manual shows pin 9 of the joystickports grounded as it should be. The traces were left off theTS2068 PCB.VRl: U3-33 goes to VRl/Q5Q4: Connect base to R55/R54Solder dots on horizontal lines below keyboard:

U12-4 to U3-65 (m)U12-5 to U3-66 (MTQ)

u5: U5-2 to U3-38 (A7R not A7RB)Pl: Pl-4B +15V (not -15V)u21:

288

Page 168: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 169: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

APPENDIX D

TS2068 PARTS LIST

COMPONENT QTYDESCRIPTION DESIGNATION PER ASSY COMMENTS

. . . (Fabrication and Artwork) REV 3A

CAP. 0.1 uf, Ceramic, Axial

TEMP Z5U

CAP. 0.01 uf, Ceramic,Axial

CAP. 0.001 uf, Ceramic, Axial

CAP. 0.047 uf, Ceramic, Axial

CAP. 20pf Ceramic Axial

CAP. 39pf Ceramic Axial

CAP. 43pf Ceramic Axial

CAP. 56pf Ceramic Axial

CAP. 75pf Ceramic Axial

CAP.120pf Ceramic Disc

CAP.470uf, 25V AL Electro-lytic Axial

CAP. 1 uf, 16V MIN AL Electro-lytic Axial

CAP. 47 uf, 16V MIN AL Elec-trolytic Axial or Radial

CAP. 1000 uf, 12V MIN ALElectrolytic Axial

CAP. 1000 pf, 50V MIN FILMMYLAR

CAP. 100 uf, 1OV MIN AL Elec-trolytic Axial

CAP. 6-50 pf, TRIMMER

CAP. 0.47 uf Ceramic Axial

CAP. 33 uf TANTALUM

C2,7,9,16,24,30 2 331,34,35,37,39,43

44,48,49,50,51,5253,54,55,56,57

C11,12,14,33,6162,68,69

C8,45,46,47

c10,15,74,75

C23

c20

Cl9

C25

C32

C59,63,64,65,7273

c3

c21

c41

c40

C36

C58,67

C5,18

C60

c71

290

8

-20 +80% or GMV

-20 +80% or GMVTEMP Z5U

-20 +80% or GMVTEMP Z5U-20 +80% or GMVTEMP Z5U-20 +80% or GMVTEMP Z5UNPO

NPO

NPO

NPO

-20 +80% or GMVTEMP Z5U

LOW ESR

+/- 20%

NPO

-20 +80% or GMVTEMP Z5U+/- 20%

Page 170: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

APPENDIX D

TS2068 PARTS LIST(continued)

COMPONENTDESCRIPTION DESIGNATION

. 68 pf Ceramic Axial c/o

CAP. 24 pf Ceramic Axial c29,27

CAP. 47 pf Ceramic Axial C28

RES. 300 OHM, 1/4W, +/-5%, CFRES. 200 OHM, 1/4W, +/-5%, CFRES. 100 OHM, 1/4W, +/-5%, CFRES. 240 OHM, 1/4W, +/-5%, CFRES. 68 OHM, 1/4W, +/-5%, CFRES. 680 OHM, 1/4W, +/-5%, CFRES. 390 OHM, 1/4W, +/-5%, CFRES. 1K OHM, 1/4W, +/-5%, CF

RES.1.5K OHM, 1/4W, +/-5%, CFRES.1.8K OHM, 1/4W, +/-5%, CFRES. 620 OHM, 1/4W, +/-5%, CFRES. 2K OHM, 1/4W, +/-5%, CFRES. 3K OHM, 1/4W, +/-5%, CFRES.2.2K OHM, 1/4W, +/-5%, CFRES. 110 OHM, 1/4W, +/-5%, CFRES. 510 OHM, 1/4W, +/-5%, CFRES.5.1K OHM, 1/4W, +/-5%, CFRES. 10K OHM, 1/4W, +/-5%, CFRES. 13K OHM, 1/4W, +/-5%, CFRES. 20K OHM, 1/4W, +/-5%, CFRES 62K OHM, 1/4W, +/-5%, CFRES.lOOK OHM, 1/4W, +/-5%, CFRES.220K OHM, 1/4W, +/-5%, CFRES. 75 OHM, 1/4W, +/-5%, CFRES.l.lOK OHM 1/4W, +/-l%, MFRES.3.32K OHM 1/4W, +/-l%, MFRES. 10K OHM. VARIABLE. LINEAR

R23R19,50,54,55R58R24,28,56,57

;:3 68R74'R11,33,34,35,3638,42,62R41R29,30R52R22R32R61R53R69R31Rl6,40,60,70R26,27R44,45R9,73R15,49R43R46,67R6R5VR1.2.3

RES. 330 OHM; 0.5W, +/-5%, CF R4 ’ rRES. 56 OHM, 1/4W, +/-5%, CF R65,71RES. 0.110 OHM, 3W, +/-5%, RlWire Wound

RES. 20 OHM, 1/4W, +/-5%, CF R63RES. 82 OHM, 1/4W, +/-5%, CF R64RES. 22 OHM, 1/4W, +/-5%, CF R66RES.680K OHM, 1/4W, +/-5%, CF R14RES. 47K OHM, 1/4W, +/-5%, CF R48RES.390K OHM, 1/4W, +/-5%, CF R72RES.6.8K OHM, 1/4W, +/-5%, CF R12

QTYPER ASSY COMMENTS

1 TEMP+Z5" 20 80% or GMV

2 -20 %+80%% or GMVTEMP Z5U

1 -20 +80% or GMVTEMP Z5U

1414

:

:

:111

:1

:2222121

;121

1111111

291

Page 171: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

APPENDIX D

TS2068 PARTS LIST(continued)

DESCRIPTIONDIODE lN4148

COMPONENTDESIGNATION

QTYPER ASSY

25COMMENTS

DIODE, Schottky lN5821 orequivalent

IC, UA 78S40 NPC, SwitchingRegulator

IC, SCLD

IC, LM1889N, Video Modulator

IC, 74LS244N

IC, TMS4416-15 (150NS) MOSDynamic RAM

IC, UA 78L12 Regulator

IC, 74LS245

IC,74LS157N

IC,TMS4416-20 (200NS) MOSDynamic RAM

IC,AY-3-8912, Sound Gen.andI/O Port

IC,23128 Mask ROM (16K X 8)

IC, CPU Z80A

IC, 2364 Mask ROM (8K X 8)

IC, 74LSOO

TRAN. PNP D43ClTRAN. PNP 2N2907TRAN. PNP 2N3904TRAN. PNP 2N2222

11,12,13,14,15,1617,18,19,20,21,2223,24,25,26,27,28

CR1

Ul

u3

u4

u5

U6,7

U8

u9,15

UlO,ll

U12,13,17,18

u14

U16

u19

u20

u21

QlQ3Q7,8Q5,4,2

1

1

2

2

2

4

1

292

Page 172: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

APPENDIX D

TS2068 PARTS LIST(continued)

COMPONENT QTYDESCRIPTION DESIGNATION PER ASSY COMMENTS

Filter(Bifiler) 2.2mh Ll 1

Inductor 230 uhInductor .33uh AxialInductor .12uh

Crystal Oscillator 14.112 MHz

Crystal Oscillator 3.579545MHz

Switch SPDT, Rocker

Switch Channel Select,SPDT Slide

Video Jack Insulation Pad

Jack, Right Angle RCA VideoJack

Jack, Mini Phone, EAR & MIC

Jack, COAX, DC Power, 2 l/2MM Pin

Jack, Phono

Connector,Cartridge 2 X 18Pin 0.1" Space

Connector,Flex Cable 14 Pin

L2L3,4L6,7

Yl

Y2

SW2

SW1

J7

J2,3

Jl

J8

J4

J9

2

1

1

1

1

Connector,Joystick 9-Pin Male J5,6 2(D Type)

Under J7

Monitor

Tape

Assembled toShield, R.F.

Key betweenContact 4&6

Keyboard

Joysticks

Shield, R.F. Button 1Shield, R.F. Top 1

Heat Sink HSl 1

Heat Sink Insulation Pad

293

Page 173: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

APPENDIX D

TS2068 PARTS LIST(continued)

DESCRIPTIONSocket, XC, 28 Pin

COMPONENT QTYDESIGNATION PER ASSY COMMENTS

2

Socket, IC, 40 Pin 1

Speaker, 45 OHM, Mylar Cone 1

Jumper Wire Wl, 2, 50 3

Ferrite Bead L5,8 2

PC Board Assembly,Daughter 1

294

Page 174: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on
Page 175: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

APPENDIX F

August 1985Bob Orrfelt

TS2068 MODIFICATIONS FOR EPROMS

There are a number of errors in the TS2068 Home ROM and the ExtensionROM. The errors can be corrected by using EPROMs. The followingmodifications are necessary:

ExtensionROM

Non-comnonent side of the pcb.0. Remove ROMs.1. Cut the trace between U20-26 and U20-272. Jumper pins 1 to 28 to 27 on each socket.

Component side of pcb.

3. Remove the two zero ohm resistors Wl and W2.4. Cut the trace just above and to the left of hole A.5. Add a jumper from hole A to the trace. This connects m to

U16 pin 22.6. Add a jumper from hole C to hole B. This connects ROMCS to

U16 pin 20.7. Use a 27128 (16K) EPROM for U16.8. Use a 2764 (8K) EPROM for U20.

296

Page 176: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

October 1985Bob Orrfelt

Proposed TS2068 Home ROM Corrections and Improvements

Optional turn an message.(Last. c h a r a c t e r a d d 80H)1118 P r o p e r t y of Bob1128 Orrfelt .........1138 ................1 1 3 8 ..

INT - 6 5 5 3 6 e t c . errors.33F1 F5

33F8 C3EF35

AF

:DNZ , 35E4H35EFH

35E2 181A35E4. F135E5 7735E6 2335E7 7335E8 2335E9 7235EA 2B35EB 2B35EC 2B35ED Dl35EE C9

35EF F135F0 2B35F1 369135F3 2 3g;; SE””35F7 18ED

LDINCLDINCJR

35FEHA F

297

Page 177: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on

NOTES

298

Page 178: TS2068 Technical Manual - MAME progetto-SNAPS · TS2068 Technical Manual This is the second edition of the manual published by Time Designs Magazine (now defunct). It is based on