Showing posts with label Commodore PET. Show all posts
Showing posts with label Commodore PET. Show all posts

30 June 2019

NOW FLIP, FLOP AND FLY [183]



The Sinclair ZX80 launched in 1980 as the first complete home computer available for under £100 – it also sold in kit form for £79.95. It may have been a breakthrough, with both the ZX80 and its successor, the ZX81, introducing home computing to millions in the UK, but that £100 price was achieved through compromise that leaves it little more than that first step. Infamously, it only had one kilobyte (1024 bytes) of RAM, when other computers came with at least four times that amount. Its central processor, a Zilog Z80, also generated the video display, meaning the press of a key caused interference with the picture. The keys themselves were flat, requiring you to press through a membrane to the motherboard itself. When the ZX81 was introduced in 1981, a “slow” mode fixed the flickering screen, and £20 was knocked off the price, but if you wanted more than 1K of RAM, you had to buy an expansion pack, required for most games. (By the way, 1024 bytes is the space needed to hold this paragraph, including spaces.)
The limitations of the ZX80 led to arguments that it cannot really be called a computer, even for 1980. However, comparing it against the “1977 Trinity” - the Commodore PET 2001, the Apple II, and the Tandy TRS-80 Model I all launched in 1977 – the ZX80 holds up reasonably well. The ZX80 could only produce a monochrome display, but only the Apple II was capable of colour. All of the computers have no lowercase text option except for the PET, but you cannot mix them with capitals, with only an either/or option for all text. Only the PET and Apple II had sound, a simple speaker to produce beeps, and only the Apple II had the built-in instructions to load programs from a floppy disc – the others would need to be expanded first.



The main contention over the ZX80 is the implementation of the programming language BASIC, short for Beginner’s All-Purpose Symbolic Instruction Code. This language overlays the assembly code that is being fed to the processor, and is much easier to learn - even people who never used an old computer know what a BASIC program looks like:

10 PRINT “HELLO”

20 GOTO 10

RUN

The Apple II and PET computers, like most at the time, would license their versions of BASIC from Microsoft, but Sinclair would employ a software company, Nine Tiles, to write their BASIC. However, the chip that would hold it in the computer was to be only 4 kilobytes in size, restricting the number of commands it could hold. Shortcuts to the commands it had were laid across the keyboard, reducing the space in RAM needed to hold programs, but one strange result of Sinclair’s BASIC was that the ZX80 could not calculate decimal points.
You would expect a computer to divide 5 by 4 and give you 1.25, or divide 20,000 by 10,001 and give you 1.9998. In both cases, the answer given by the ZX80 is just the integer “1”, making you wonder why you didn’t just buy a scientific calculator from Hewlett-Packard instead. The instruction manual doesn’t help this: it is named “A course in Basic Programming,” cementing that this computer is only your first step into computers, but pages 36-38 provides a program for completing long division on your ZX80 to produce an answer with decimal points, like you were using pen and paper anyway.
What the ZX80 missed was the ability to run floating-point arithmetic, which is a way of calculating very large numbers. Basically (which is the right word to use here), floating-point arithmetic as used by a computer notes that the decimal point can be placed anywhere within a number, and you can use an exponent to determine where the point should lie. One answer we wanted earlier, “1.25”, can be written as 125 x 10-2 – this is because we moved the decimal point two places to the right. We could also express it as 12500000 x 10-8, if that proves more useful to a computer.

Before processor clock speeds and numbers of cores became the standard for how fast a computer is, it was previously how many floating-point operations per second, or FLOPS, it can complete – for 1980, tens of thousands of FLOPS is the standard, whereas an iPhone XS can do a billion FLOPS at least. However, if your computer can do none at all, is it really a computer?
Then again, do you need them? One kilobyte of RAM is not enough to do many things, let alone produce a display full of text, but you can make games – the software company Psion, known later for their personal organisers, fit Chess into 1K, minus a couple of rules. I have also seen the BASIC program for a type of Space Invaders game, made mostly of “PRINT” commands to draw the ships, and “LET” commands to apply values to them. Applying logic to the ZX80 is fine, and the reason most games for the ZX81 required more memory was because the games themselves were more elaborate. A popular early computing project was the “TV Typewriter” of 1973, which existed only to put text on screen, with homebrew projects adding memory chips and BASIC to them, and the ZX80, with its motherboard of mostly logic chips, can be seen as an extension of that.
Of course, the ZX81 added floating-point arithmetic to their BASIC in 1981, with the success of the ZX80 having validated the idea of cheap home computing. However, now that I know the Tandy TRS-80’s original BASIC chip was a public-domain version that had floating-point arithmetic added to it, while still fitting into the same 4K that Sinclair had, it makes me wonder why Sinclair didn’t do that in the first place – the ZX80 was inspired by Clive Sinclair’s daughter playing on her TRS-80, so it would have been worth a further look.

04 June 2018

TELL ME ALL THE THINGS YOU WANT TO DO [112]



The Atari 2600 games console was originally named the VCS, for “Video Computer System,” when it launched in 1977, and “VCS” is the name given to the neo-2600 that Atari – now probably about the fifth company to have used that name – will launch in 2019, having raised $2 million in its first day of crowdfunding and pre-orders.
The new VCS evocates the ridged black plastic and woodgrain design of the original console, except using real wood this time, while the voice-activated, Linux-based system with ARM processor is expected to play high-end PC games, along with the original 2600’s games, in addition to streaming video services.
In other words, the new VCS is a standard modern computer, but in a box designed to make you feel nostalgic for a forty-year old machine whose abilities were so limited, and so notorious for how it was programmed, it may make those that did program those games want to throw it against a wall.

Put simply, a computer will usually have a “frame buffer,” driving the display, with its own dedicated memory to store each frame before it is sent out. However, computer memory was very expensive in 1977, with the latest new home machines, like the Apple II and Commodore PET, offering only 4 kilobytes (4096 bytes) of RAM – this was also the capacity of the 2600’s game cartridges. In order to reduce the cost of the 2600 as much as possible, only 128 bytes of RAM were made available for all the variables of your game, and no frame buffer was provided at all. Making the most efficient use of the available space will also involve writing each byte in assembly language, using hexadecimal code, to be read directly by the processor.

What are you supposed to do? The answer is you have to tell the machine what to draw on each individual line of the picture you see on your TV screen. This uses only 20 bits (2.5 bytes) of the RAM each time a line is drawn, but you have to keep it going, and time your program correctly, or otherwise your picture falls apart. Furthermore, you can only draw the left-hand side of the screen, with the 2600’s Television Interface Adaptor (TIA) chip enabling you to copy or flip it to the right side. The TIA, also responsible for the sound and reading the instructions given by joysticks and paddles, also provides the two on-screen player sprites, two “missiles,” and one “ball” to make your game – when the most people have played at home is “Pong,” that really is all you needed.


In time, people knew how to exploit the opportunities created by “racing the beam,” attempting to create more detail on screen by timing each line to draw multiples of sprites before the end of each line is reached – this means the bank of alien spaceships required for “Space Invaders” to work became possible, and the release of the most dynamic game yet for the 2600 caused sales of the system to explode. Atari’s own search for producing the best backgammon game that ran “bank switching” between different chips, allowing for bigger, more complicated games, and 1982’s “Pitfall!,” one of the most advanced games for the 2600, was created to make use of a realistic running man that programmer David Crane had made three years earlier.
The Atari 2600 was finally withdrawn from sale in 1992 – as there was no exclusive deals to produce games, and no copy protection in the cartridges, anyone could produce a game for the machine, so nobody stopped. Even now, homebrew programmers continue to see the restricted nature of the 2600 as a challenge, most notably a version of “Halo” written by Ed Fries, who led the team at Microsoft that created the first Xbox console.

This is a very simplified version of how the Atari 2600 works, but when you then look up the story about the debacle over the “E.T. The Extra Terrestrial” game, it becomes clear that the programmer Howard Scott Warshaw needed longer than the five and a half weeks given to him to make something more refined.