THE COMMODORE 128: THE FIXED AND UPGRADED C64 (PART 3)   Leave a comment

THE COMMODORE 128: THE FIXED AND UPGRADED COMMODORE 64 (PART 3)

C1281My Commodore 128

Based on my research, it seems that Commodore BASIC V2 on the C64 is such a load of crap that it’s probably easier to learn 6502 Assembly Language! Of course, the problem with that may be trying to think like a computer, as well as yet again trying to remember lots of numbers representing memory locations. At least these are in hexadecimal, though, which may make it easier. Based on things I’ve heard about programming in 6502 Assembly Language on Atari 8 bit computers, people usually use a file with a long list of EQU equate directives, to replace the numbers with meaningful official Atari names for the various routines. I haven’t seen this approach on the C64 yet, so I don’t know if it’s used at all. Of course, the Atari range of computers could be programmed in Atari BASIC, although users required POKEs and PEEKs to use the Player Missile Graphics or sprites.

AFAIK, just about every Commodore 64 magazine which wasn’t only about games said that Commodore BASIC V2 was poor, old fashioned, Neanderthal, etc, as well as having listings and/or ads for “Extended BASICs”, to supply the missing commands.

I think that a lot of the problems with the Commodore 64 are due to misdirection, meaning a similar technique to that used by magicians so that people don’t notice how their tricks work. I was told by the BBC with their big computer literacy campaign on TV as well as books, access to BBC Micro computers, etc that all computers used the language BASIC and that you had to learn that language. I think there was a similar message around the World (e.g. in Compute! magazine in the USA available to download on http://www.archive.com , as well as COMputer magazine in Denmark which you can download from http://awesome.commodore.me/ then click on Downloads/Magazine). Apart from this, I heard that I should later learn Assembly Language/Machine Code, but start by incorporating some Machine Code routines into my programs. In spite of this, I recently heard that Apple ][ programs were often or even mostly written in Applesoft BASIC. I also heard that Logo was an easier language with a different attitude to BASIC. I read later on in 1984 that it was actually an amazing, underestimated language which was based on Lisp and a good alternative to BASIC. I was drooling over a Logo demo at the 64 Software Centre in London, where I bought a copy of Turbo BASIC, because I realised I needed an extended BASIC and felt that was all I could afford (i.e. £14.99?). Unfortunately, Commodore Logo was disk only, but to write commercial programs in Logo, you’d need a compiler or a runtime version of Logo, otherwise the programs could only be used by people with a copy of Logo. I never heard about any Logo compiler or runtime version for the Commodore 64. I’ve just bought a copy of Commodore 64 Logo from eBay, so I’ll make a post about how amazing it is soon and show you why the Commodore 64 and MOST computers should have come with Logo built in instead of BASIC!

1541IIFDDMy Commodore 1541 II disk drive which I could never afford in 1984-1985

The famous “Rotating Squares” program, as used in classic Doctor Who on the TARDIS console screen to represent the time vortex used logical colour switching, to create an effect like a flashing neon sign. I can’t find the original listing for this at the moment. Logical colour switching means that although your colours are numbered 0-15, each numbered colour can be ANY actual colour available in your palette, so by changing the actual colours of these numbered colours, you can produce animation. The BBC Micro used the 6845 video chip, allowing each pixel to be a different colour from its neighbours, called “individual pixel clarity”. I was able to recreate this animation effect on an Amstrad CPC, using the knowledge gained from the BASIC conversion course in “MSX User” magazine, because it used the same 6845 graphics chip and Amstrad’s Locomotive BASIC also had this colour switching facility. I’m not sure if this is possible with the VIC-II chip, because although the Commodore 64 has colours numbered 0-15, these colours are fixed, at least in Commodore BASIC V2. Looking at the Commodore BASIC V7 graphics commands with their colour “sources” parameters, I’m beginning to think that option may exist. Perhaps this effect could be simulated if a fast enough routine could be developed. Unfortunately, this would probably need to be in Machine Code, especially as the Commodore 64 is much slower than the Atari 8 bit and the BBC Micro.

I’ve recently read old ads from 1984 and 1985 about extended BASICs or other languages such as Video BASIC 64 by Adamsoft, as well as White Lightning and Machine Lightning by Oasis, SCOPE by ISP, and ACOS+ by Melbourne House, which all claimed to be able to produce stand alone programs. I didn’t read about most of these when I owned a Commodore 64, because by the time ads for them appeared I’d totally given up on the Commodore 64 and no longer bothered to read magazines about it. Unfortunately, buyers of these programs would probably only have had the documentation that came with them to learn these languages from. White Lightning and Machine Lightning also claimed to be FORTH type languages. FORTH isn’t like BASIC and the whole idea of FORTH is to write your own extensions. As for the software “Game Maker”, which left Commodore 64 owners with only 4K and didn’t involve programming, it sounded ridiculous to me! I thought I had 64K, then I was told I only had 38K, then finally to have this reduced to 4K and not be able to program it at all was like cheating or beyond a joke to me!

The Commodore 128 also seems to be the beginning of a new look, as well as technology which became associated with the Amiga range of computers. Commodore not only abandoned the C64 “breadbox” casing, but also developed or adopted new video signals and monitors called RGBi, standing for Red Green Blue intensity, which was somehow compatible with CGA, although the original Amiga had 4,096 colours. The RGBi signal was output by a new additional video chip in the C128 called the VDC, although the Commodore 128 also included the VIC-II chip. Unfortunately, Commodore BASIC V7 had no commands to support the VDC chip, then Walrusoft brought out an improved BASIC called BASIC 8 to make use of the VDC! Commodore also brought out a mouse for the C128, which looked identical to the original Amiga mouse widely called a “tank mouse”. The 128K RAM used a technique called “bank switching”, also used by Amstrad and some others, where because only a total of 64K RAM could be seen by the 8 bit 8502 CPU at any one time, the 128 was divided into banks of RAM which were only seen when they needed to be. I’ve read that there were only 2 banks of 64K, but several different memory configurations. The maximum RAM on the C128 could have been 512K or even 1Mb! They also supplied CP/M Plus with this computer or at least with versions that incorporated a disk drive, and/or with disk drives designed for it. Having 128K and CP/M Plus were both things it shared with the Amstrad CPC6128 computer, which also came out in 1985. That computer uses bank switching by switching out a 16K bank, then switching in one of the other 16K banks, but at the moment I’m not sure how the C128 does it.

I think it would have been a great idea if the Commodore 128 had come out some time before 1985 or even in 1982 instead of the Commodore 64. It seems to be a case of missing the boat. It ended up being overshadowed not only by the Amiga, but also by the Commodore 64 not being discontinued, which should have happened in or before 1985. Unfortunately, the C128 ceased production in 1989, although the Commodore 64 continued until 1994, when Commodore went bust.

I’ve finally come to the conclusion that various Commodore 64 magazines, as well as Commodore themselves should have given people the clear message that Commodore BASIC V2 is only suitable for writing text based programs, like a pocket calculator only with text labels, or text only adventure games. It can easily produce coloured text by inserting control codes into PRINT statements, but that’s all. They could have heavily promoted either Simons’ BASIC or the Super Expander 64 as an essential piece of software with reader discounts. One of these cartridges could have been bundled with the C64 to increase their market share. When it comes to writing programs that use graphics and/or sound it’s easier to use 6502/6510 Assembly Language than Commodore BASIC V2. I think this means that the magazines should have promoted Assembly Language and Assemblers more heavily as well. Not only that, but by using 6502 Assembler, you can draw on a mass of information written for other 6502 based computers, such as the Apple ][, Atari 8 bit, Acorn Atom/BBC/Electron, Tangerine Microtan 65, Tangerine Oric 1/Oric Atmos, or non specific books about programming the 6502 wherever this kind of CPU may be embedded. The differences between those computers summed up are whereabouts in RAM to place your Assembly Language/Machine Code programs, the ASCII/ATASCII/PETSCII codes for specific alphanumeric characters, where is the screen memory located, and if you use any ROM based routines, then the addresses of these routines will be different on different computers, so you have to look them up and replace them. I have never seen or heard of any third party books about Simons’ BASIC, Scope, ACOS+, Video BASIC 64, White Lightning, or Machine Lightning. After reading the manuals, you were probably on your own. One ad I read recently which I don’t remember reading ever before was for some C64 software called “Sinclair Spectrum Simulator”. I think I would have bought this if I’d seen it advertised. Then I’d have been able to read and use a whole load of books and magazines about Sinclair Spectrum BASIC, which hardly used any POKEs or PEEKs compared to Commodore BASIC V2. I recently had a fantasy of reading an ad about it while sitting near my Dad in the living room, shouting out the details in amazement, seeing my chance to be free of Commodore BASIC V2 and into the Spectrum marketplace, then having meetings with Spectrum owners to retype my Sinclair Spectrum BASIC listings into their computers, because I seriously doubt that these programs saved by a C64 compatible data recorder would have been compatible with the Spectrum.

Embroidery1The output of the Embroidery program below

INPUT magazine Issue No. 3 more or less wrote off Commodore BASIC V2 when it came to graphics, by saying that it would be very difficult to get it to do a patchwork or a embroidery design like the Sinclair Spectrum, BBC Micro, and Acorn Electron. Later on, they featured listings in Simons’ BASIC. It produced a constantly changing and evolving pattern you could watch for ages! Here’s that program converted by me from BBC BASIC into Commodore BASIC V7. I used the SCALE command to make the Commodore 128 use the same cartesian coordinates as the BBC Micro instead of converting them.

10 COLOR 4,3
20 GRAPHIC 3,1:COLOR 0,1:SCHCLR
30 SCALE 1,1279,1023
40 FOR N=1 TO 1279 STEP 88
50 C=INT(RND(1)*15+1):COLOR 1,C
60 IF C<2 THEN 50
70 DRAW 1,1,1 TO N,1023
80 DRAW 1,1279,1 TO 1279-N,1023
90 DRAW 1,1,1023 TO N,0
100 DRAW 1,1279,1023 TO 1279-N,4
110 NEXT N
120 GOTO 40

Embroidery2Screenshot of the Embroidery program later on in its run

Unfortunately, this program shows the limitations of the Commodore VIC-II chip. In hires mode GRAPHIC 1 (320×200) it soon starts to suffer from attributes or artefacts where the lines in each 8×8 pixel square change to the same colour, the same as on the Sinclair Spectrum. This is with a scaled step size of 88 in line 40 and worse if the step size is reduced. It even happens in the lores multicolour GRAPHIC 3 (160×200) mode, which I assume occurs whenever a line is drawn through any 8×8 pixel square that already contains 3 lines each of a different colour. So far, I haven't seen any display from the higher resolution VDC chip, because I haven't yet bought the right kind of monitor lead. I wouldn't be able to program it without BASIC 8, though. I own an Amiga compatible Commodore monitor, which I think is compatible with the C128, but I've also seen 3 ended leads which plug into both VIC-II and VDC outputs, then feed these to a SCART plug which can be connected to a TV. I think the display from these is only mono, though. More news about this when I get a suitable lead, as well as a new computer desk or trolley to put it all onto!

BorderFlash1A flashing border program in 6502 Assembly Language made easy, thanks to the C128 MONITOR program

Before I go, I should point out that it’s fairly easy to make the screen border flash and ripple with the short listing on screen in the pic above. It’s partly due to not synchronising with the screen refresh rate, otherwise the screen would just change colour 50 or 60 times per second. If you click on the pic above once, you’ll get an enlarged version, then once more for an even bigger enlargement, but here’s a listing anyway.

LDA #$00
STA $D020
INC $D020
JSR $FFE1
BEQ $1810
JMP $1805
BRK

I should point out that $D020 is 53280 in decimal (i.e. border colour memory location) and $FFE1 is a ROM routine I think is called STOPIN, which allows the user to break out of the program just by pressing the RUN STOP key (like ESC on other computers), instead of pressing RUN STOP and RESTORE, which resets the computer, including colours and variables, although your program would still be intact in RAM. TMR didn’t seem to understand this!

So, to sum up, the Commodore 128 was everything the Commodore 64 SHOULD have been!

Advertisements

Posted November 4, 2013 by C64hater in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: