Archive for November 2014

DEBUNKING TMR’S “PI FOR TEA”   Leave a comment

DEBUNKING TMR’S “PI FOR TEA”

raspberry-pi-model-b-plus-case-800x533A Raspberry Pi Model B with one of the many types of cases, available in various colours

TMR of the Commodore 64 bootlicking blog http://www.c64crapdebunk.wordpress.com had the cheek to try and debunk my previous article about the rebirth of programming on the Raspberry Pi computer, in his post “Pi for tea” https://c64crapdebunk.wordpress.com/2014/11/26/pi-for-tea/ , so here’s what I think of that!

Of course, all computers of the “home computer boom” in the 1980’s were designed to make a profit, but Commodore were more miserly, ruthless, and extortionate than other manufacturers by refusing to incorporate a custom version of BASIC in the Commodore 64 or VIC-20 computers to support their hardware. Other manufacturers, such as Acorn, Atari, and Sinclair, created or commissioned their own dialects of BASIC, while Tandy, Dragon, and MSX were happy to pay Microsoft for a version of their BASIC customised for their computers. Commodore made even more profit with a double whammy of selling cartridges such as Simons’ BASIC (by David Simons) and the Super Expander 64 (by Commodore), which contained commands that should have been built in, but couldn’t produce stand alone programs which would run on other C64’s without one of these cartridges inserted. Simons’ BASIC cost £50 in Britain during 1984, while the C64 itself cost about £199.

As for my “body of work” since selling the C64, that’s another matter. I started out on the Amstrad CPC664 by doing things such as trying to draw a portrait of someone in BASIC, which certainly isn’t possible in C64 BASIC, as well as experimenting with the language LOGO. I suffered a big blow to my confidence as explained in the second paragraph following this one. Not only that, but this blog is about programming, so I would actually have to show you some programming techniques which enable you to program something interesting, amusing or useful in a particular dialect of BASIC, in Z80 Assembler, 6502 Assembler, or 68000 Assembler, instead of just showing you a video of something, then claiming I’d programmed it. TMR has posted very little about programming in his blog, in spite of claiming that it’s easy. Of course, you should start any program by making a flowchart of what you want it to do.

ToshibaBestBitsToshiba’s “best bits” ad from 1984

The Amstrad CPC664, my second computer, seemed to have all the best bits of most other computers on the market at the time. It had 64K RAM, the same graphics chip as the BBC Micro giving it individual pixel clarity instead of colour bleed or colour attributes, advanced BASIC with more commands than BBC BASIC, including very powerful SOUND and ENVELOPE commands to control its AY-3-8912 3 channel sound chip, a built in speaker to avoid interference, interrupts from BASIC, a palette of 27 colours, a monitor and a disk drive included in the package, a stylish keyboard with MSX style diamond shaped keys in a cluster, as well as a copy of CP/M 2.2 with the LOGO programming language. Likewise, Toshiba claimed that MSX computers, in particular their HX10 model, had the best features of other computers, with 64K RAM, a cassette interface, two joystick ports, a built in PSU, 16 colours, 73 full stroke keys, a cartridge slot, a printer interface, sound output through the TV, and a separate 16K video memory. Unfortunately, they also made the mistake of claiming that its 32 sprites were more than any other non MSX computer, although this feature was shared by other computers using the same or compatible video chip, such as the Texas Instruments TI99/4A, Memotech MTX, and Tatung Einstein.

Unfortunately for me, soon after the CPC664’s release Amstrad showed the CPC6128 at the CES, then dealers and developers in Britain demanded to have this machine ASAP. Amstrad’s response was to quietly release the CPC6128 earlier than planned, in September 1985, without an announcement before this, as well as to discontinue the CPC664 instead of reducing its price or discontinuing the CPC464 with its built in cassette drive. This was a big blow to my confidence! The Spectravideo X’Press was one of many MSX computers on the market, so this may have been why it didn’t get the attention it deserved.

TMR also had the cheek to claim…

“since the C64 had at least the same percentage of its user base programming as the machines mentioned by the author, that equates to more programmers too”

Of course, I have no idea where he gets this information from, or what type of programming they were doing.

NOOBSinstallA Raspberry Pi OS installation in progress, selected from the NOOBS SD card image file

Linus Torvalds from Finland is the creator of the operating system Linux, which is based on a kernel, meaning collection of routines, he wrote to work in a similar way to UNIX or MINIX. The first computer he used was a Commodore VIC-20, but this was his Grandfather’s computer, not his own. It’s quite likely that his Grandfather didn’t have a clue what he was doing when he bought a VIC-20. Apart from this, there was poor availability and distribution of computers and software in Finland. Linus started programming the VIC-20, because it was difficult to get software, and it was all he had access to. The Commodore VIC-20 was crap for having only a 20 column display, using a graphics chip that Commodore had failed to find a market for, and most of all for using Commodore BASIC V2 recycled from the Commodore PET range of computers. It was bad, but not as complicated as the Commodore 64 which succeeded it. It’s quite significant that when Linus Torvalds got his first computer, using money he’d saved up, meaning that his parents had no say in the decision, he rejected the obvious C64 upgrade path and chose a Sinclair QL instead of the Commodore 64 which was very popular in Finland. In an interview he also said that he had considered buying an Acorn Archimedes as well, but he couldn’t find one in Finland. It seems he didn’t like mail order, so when he saw a Sinclair QL in a shop, he decided that was the computer for him. He wrote some software for it, claiming this was because there wasn’t much software available for it in Finland, but actually there wasn’t much software available for it in Britain either, although it attracted a fanatical fanbase, inspiring hobbyists to continue to produce more software, upgraded QL computers such as the GST Thor, as well as newer computers based on the QL from http://www.q40.de/ , but with 68040 and 68060 processors. https://www.youtube.com/watch?v=05pgVwzAZ6k&list=PLF9306B719037CED1

What these the Sinclair QL and Acorn Archimedes computers had in common were that both Acorn and Sinclair were based in Cambridge, England, both came with an advanced BASIC, influenced by Pascal, and both were internally 32 bit. Later, in 1991, Linus Torvalds bought an 80386 based PC, which represented a break from his previous programming in BASIC, 6502 Assembler, and 68000 Assembler. It was on this 386 PC that he started to use MINIX, a small clone of UNIX, used to teach students how UNIX worked. He used MINIX as the basis of Linux.

So, I think that’s all I need to say about TMR’s latest debunk. Look out for some more information about programming in the near future!

Advertisements

Posted November 27, 2014 by C64hater in Uncategorized

PROGRAMMING ON THE RASPBERRY PI: THE RETURN OF CAMBRIDGE STYLE COMPUTING   2 comments

PROGRAMMING ON THE RASPBERRY PI: THE RETURN OF CAMBRIDGE STYLE COMPUTING

RaspberryPi_Logo
The Raspberry Pi logo

This blog is about programming in general, specifically how the Commodore 64 prevented me and millions of other would be programmers from creating any programs which used colour, graphics, or sound, apart from coloured text. These would be programmers either gave up and just played games, bought a package to produce very restricted or limited games, such as “Game Maker” by Activision, “Shoot ’em Up Construction Kit” by Sensible Software/Outlaw, or sold the C64 and bought another computer. Here’s a post which is about how to do programming, but not on the C64.

Finally, in 2012, a computer called the Raspberry Pi was released. This is a computer produced not for profit, linked to Cambridge, with a large range of free open source software. The Commodore C64 culprit Jack Tramiel (the one who laid down the specs, but reused Commodore BASIC V2 for it) must be turning in his grave by now!

Technology has now moved far beyond the situation in 1984, when there was a clear division between home computers and business computers, where owners of “home computers” were usually stuck with whatever dialect of BASIC the manufacturer of their computer built in on ROM or Machine Code/Assembly Language, apart from other Copyrighted languages such as the extended BASICs Turbo BASIC and UltraBASIC on the C64, which couldn’t produce stand alone programs. Also, there seemed to be no books written about most extended BASICs, apart from their accompanying manuals. The vast majority of books written about programming the Commodore 64 were in Commodore BASIC V2 with lots of PEEKs and POKEs, AND 32 OR 8, etc, etc. Business computer users had a choice of languages they could load from disk on their systems running CP/M or MS-DOS, while home computers, largely cassette based, had no such choice. The filthy, lying “The A-Z of Personal Computers” described this as “Cassette OS” but actually it was a ROM based OS and different on each manufacturer’s computers, while “business computers” often just had a “bootstrap program” on ROM which told them to start up by trying to load whatever software was on the disk in their drive if any disk was present and if it was bootable.

SVI-738triThe portable Spectravideo SVI-738 X’Press MSX

Things started to change in 1985, when the Amstrad CPC664, as well as the portable Spectravideo SVI-738 X’Press MSX were released, each aimed at “home users” and equipped with a built in disk drive! Unfortunately, neither of these computers sold many units, because the Amstrad CPC664 was replaced by the CPC6128 after 4 months, while the Spectravideo SVI-738 X’Press suffered from distribution problems. Even so, the CPC664 was the predecessor of the CPC6128, while the Spectravideo SVI-738 X’Press was an MSX1 computer dubbed by some journalists as “MSX 1.5”, due to its built in disk drive, and Yamaha V9938 VDP video chip, enabling an 80 column display. This type of design in the same shaped case as the CPC664 had been used before by the Pied Piper computer, as advertised in the disgusting “The A-Z of Personal Computers”, but the Pied Piper computer was aimed at business users. Amstrad supplied the CPC664 with the ROM based Locomotive BASIC V1.1 and AMSDOS, as well as CP/M 2.2 complete with the language Digital Research LOGO on disk, although sadly CP/M 2.2 usually didn’t support graphics and DR LOGO is the only exception to this which I’ve seen. Spectravideo supplied the SVI-738 X’Press with both MSX BASIC 1.0 and MSX Disk BASIC on ROM, as well as MSX-DOS and CP/M 2.2 on disks. MSX-DOS could run CP/M software, but used MS-DOS type commands and MS-DOS formatted floppy disks. Also in 1985, the Atari ST and Amiga computers were released, with built in disk drives, but these were initially too expensive for “home users” and didn’t have much software available, although they could emulate the IBM PC up to a point.

raspberry_pi_model_b_rev2_13The basic Raspberry Pi Model B computer, which allows users to choose their own case, keyboard, and mouse

I’m proud to tell you that, apart from several classic computers, I also own a Raspberry Pi computer! I was fascinated to see the first news about the planned release of the Raspberry Pi in an edition of the TV series BBC Click in 2011 or 2012, before its release in 2012. The people behind the project include Dave “Elite” Braben, who learnt to program in BASIC and 6502 Assembler on an upgraded Acorn Atom, creating 3D vector graphics, before moving on to a BBC Micro. This experience enabled him to learn to program in 6502/6510 Assembler on the C64, but if he’d started out on a C64 I think he’d probably have given up. I don’t know if he ever used the crappy Commodore BASIC V2 on the C64 at all, apart from LOAD “filename”,8 , SAVE “filename”,8 , RUN and the totally insane LOAD”$”,8 followed by LIST instead of CAT, DIR, or FILES. The Raspberry Pi project is about encouraging people to study programming again. Dave Braben mentioned in an interview about the Raspberry Pi project a lot of the same attitude as that behind the original BBC Micro and Sinclair ZX Spectrum computers. The whole project has links to Cambridge and the attitude surrounding that area where lots of groups in the early 1980’s were struggling to make the best BASIC possible, incorporating features from Pascal, instead of reusing a 1977 BASIC like Jack Tramiel did with the Commodore 64. The situation immediately before the Raspberry Pi launched was that most people had forgotten about or never even done any programming, thanks to the lack of any programming language being supplied with PCs or Macs, the lack of any real alternative to PCs or Macs, although Linux was an alternative OS, and the emphasis on the Internet, telecommunications, “comms”, or “telecomputing” as it used to be called, to the virtual exclusion of any other activities on a computer. To compute means to work things out, not to communicate! Computer or IT classes ended up just teaching people how to use popular Microsoft Windows software such as Excel, Word, and Powerpoint. Technology has moved on, so the Raspberry Pi seems to only have a bootstrap program on ROM, which loads the file kernal.img from SD card, so users certainly aren’t stuck with just one or two built in or Copyrighted programming languages. Due to the influence of the prototype Xerox Star, the short lived Apple Lisa in 1983-1984, the original amazing Apple MacIntosh released in 1984, as well as the magnificent, multitasking Amiga released in 1985 (all user interfaces which were copied by Digital Research GEM, Microsoft Windows, and Linux), computers nowadays are expected to use a WIMP or GUI interface where users point and click with a mouse, so that’s the normal setup for an OS on the Raspberry Pi, although there are image files that have been created to boot straight into an emulation of the amazing Atari 8 bit or the marvellous MSX2 and MSX2+ computers, greeting the user with an Atari BASIC “READY” or MSX BASIC “Ok” prompt. Of course, I’m looking forward to a Star Trek: The Next Generation style voice control and something like the touch sensitive LCARS Menu interface.

I originally heard on the weekly technology series BBC Click that the Raspberry Pi was going to be supplied with the programming languages BBC BASIC, Python, and Ruby installed on SD card. I had never even heard of Python or Ruby before this. Later on, I was pleased to hear that some versions of classic BASIC interpreters, or emulators such as Sinclair Spectrum BASIC were being produced, as well as emulator packages including Atari, Oric, the Apple ][, and MSX BASIC. This makes the Raspberry Pi an ideal platform for programming!

To recap, the Raspberry Pi looks on whichever SD card has been inserted into its slot for a file called kernel.img. It considers this file to be its operating system, no matter what instructions are contained in it. This gets round criticisms of other computers such as it not being possible to bypass their operating systems and “take control” of them. Even Linux OS “gets in the way”. The Raspberry Pi usually runs one or another distro of Linux, but it can just as easily run a very simple program whenever necessary, such as to flash some LED lights, written in ARM Assembler or “hit the metal” for whatever reason, instead of going through an OS. The Raspberry Pi has fairly standard hardware, although four models (A,B, A+, and B+) have now been produced, so programmers don’t have to guess which graphics or sound cards may have been fitted, which would each require their own drivers under MS Windows, Mac OSX, or even Linux. The differences between these models are just the amount of RAM (256K or 512K), whether or not they have an Ethernet port, which size SD card they take, and how many GPIO expansion pins they have.

The Raspberry Pi is marketed mainly for teaching programming, so that’s what most users should be doing with it. It seems that nearly all the software used on it was already available under Linux, but it’s been organised into a syllabus of software that people may never have heard of before. The approved distro is Raspbian with languages such as the pre installed Python, which seems like a simplified interpreted C mixed with BASIC, Scratch, which is a package that can easily create animations and games using built in sprites under mouse and keyboard control using a set of program blocks that can be put together, Wolfram/Mathematica, which seems to be a mixture of yet another object orientated C type language, as well as having access to a database of general knowledge about the World we live in and powerful single commands. For example, I bet Wolfram knows without being told that when Tony Blair was in the House of Commons his left foot was also there, but with most other programming languages the programmer would have to tell them that Tony Blair was a person, who Tony Blair is, and that wherever people in general go, their left feet are sure to follow, unless it was told specifically that Tony Blair’s left foot had been amputated. http://blog.stephenwolfram.com/2014/02/starting-to-demo-the-wolfram-language/ There’s also the software Sonic Pi for inputting and playing “little tunes” like I was desperate to do on my C64. Users can also install Brandy BASIC, a BBC BASIC clone, which may be capable of running all the classic BBC BASIC programs from the BBC Micro, as well as later BBC BASIC V programs from the Acorn Archimedes. The Raspberry Pi even has its own version of RISC-OS which made its début on the classic Acorn Archimedes computer, including BBC BASIC V. Another freely available language is FUZE BASIC, which is part of an electronics project kit, but can be used without buying the kit, based on BBC BASIC and Sinclair Spectrum BASIC, with some extended commands added. http://www.fuze.co.uk/

The Raspberry Pi, with an ARM processor running at 700-900Mhz is far more powerful than 8 bit “home computers” such as the Sinclair Spectrum, BBC Micro, Amstrad CPC, or Atari, while even the Acorn Archimedes computers used ARM processors which only ran at about 8-25Mhz. It can also be used to view Internet websites and HD video, but not Flash because there’s no version of Flash for the ARM processor.

Years ago, I started to learn C on my Amstrad CPC664. It was touted as an amazing language capable of producing programs which would run on any computer that had a C compiler available for it, including the IBM PC and clones, Apple MacIntosh, Amiga, and Atari ST. Unfortunately, I soon found out that the programming techniques I was learning lacked any use of colour, graphics, or sound, which would only be introduced in header files of extended routines, after a considerable amount of time studying C, so it seemed as bad as trying to program on the Commodore 64, plus the complication of correctly placing lots of curly brackets and semicolons, as well as passing parameters to pointers, so I eventually gave up trying to learn C. Python has a widely used library of commands in the popular free extension pygame (which is written about so much it’s more or less standard), which soon enables users to program colour, graphics and sound, unlike in Commodore BASIC V2 on the C64 or C and so far I haven’t seen any curly brackets, or semicolons!

Scratch1The Scratch programming language interface

It seems that Scratch is the easiest programming language available for the Raspberry Pi. It’s by MIT and shows similarities to LOGO, such as the graphics origin in the middle of the screen, a pen down option, and turtle graphics, but including multiple sprites (as in Terrapin LOGO for the Atari 8 bit and C64), a collection of sound effects, as well as backgrounds, controlled by LEGO type building blocks of commands split into several categories for building simple animations and even games, so I’ll be telling you more about Scratch, as well as Python soon!

That’s all for now!

Posted November 25, 2014 by C64hater in Uncategorized