Archive for November 2015

Julian Assange and The C64   1 comment

Julian Assange and The C64

JulianAssange1

Julian Assange

 

(Unfortunately, WordPress have just forced me to use a new editor for this post. I’ve been struggling with this for several minutes now, so I apologise for any formatting errors! The previews seem to have a pic and a video missing!)

After TMR of the blog C64CrapDebunk mentioned in his post https://c64crapdebunk.wordpress.com/2015/11/11/what-tinfoil-hat-the-authors-forgotten-his/ that even Wikileaks founder and hacker Julian Assange owned a C64 which he seemed to have no trouble programming, I did a search for “Julian Assange” and “Commodore 64” or C64, and here’s what I found.

Here’s an excerpt from the book The Most Dangerous Man In The World: The Inside Story On Julian Assange And Wikileaks”

First of all I should point out that Julian’s Mum’s name is supposed to be Christine, and he was allegedly born in 1971, but has often refused to give his age to reporters. Of course, I haven’t seen any hard evidence to support this. He could be an alien using a cover story for all I know!

Heres’s a quote from page 10…

One of the many houses Christine rented while they were on the run happened to be across the road from an electronics shop. At just eleven years old, Assange was already showing extraordinary mathematical capabilities. He would go to the shop and write programs on its Commodore 64. One of the first mass produced computers, the Commodore 64 was the model T Ford of its day. He sharpened his skills, unravelling well-known programs and discovering how they were written”.

Unfortunately, I haven’t got time to read the whole book before I’m evicted, so I can’t comment on the rest of it, but the passage above seems quite conclusive. You can read more on https://books.google.co.uk/books?id=oo0P3ckGOoQC&pg=PA15&lpg=PA15&dq=%2B%22Julian+Assange%22+%2B%22Commodore+64%22&source=bl&ots=Hs0wz9vkvZ&sig=N-I5NipS9njWBbLAlU8UMEMutBQ&hl=en&sa=X&ved=0ahUKEwj9mrvs3LbJAhWEThQKHd1mCSwQ6AEIPjAE#v=onepage&q=%2B%22Julian%20Assange%22%20%2B%22Commodore%2064%22&f=false

So there you go. Julian Assange is a maths whiz, which I’ve already suggested that someone would need to be to program the C64! Not only that, but he was given a lot of access to the Commodore 64 not long after it came out before buying one. Perhaps the Commodore 64 was the only computer that particular electronics shop had in stock.

Apart from this, it seems the family was on the run, so he was living on the edge, and his Mum was an artist. My Mum ran two shops instead, so this may be another influential factor.

After reading this, my eviction was delayed again, so I did another search and found out from http://edition.cnn.com/2010/LIVING/12/01/assange.profile/ that Julian Assange’s Mum didn’t buy him a C64 until 1987, when he was allegedly 16. Why didn’t she buy him an Amiga A500 instead?! I’m shocked. Another crucially important factor is whether or not he had a disk drive to go with the C64 from the beginning, but this doesn’t seem to be mentioned.

After this stage in his life, Julian Assange is credited on websites with doing lots of hacking using his C64. To get online in the days before the Internet was widely available, people needed some “comms” software to make their computer handle the same protocols used by other computers. This meant that widely different computers were using a common language to connect and share data. Surprise, surprise, this wasn’t Commodore BASIC V2, or even 6502 Assembly Language/Machine Code! With the Internet different computers still need to use the standard protocols, although not the same ones used by classic software on classic computers.

A C64 connects to an old school BBS

 

I think what Julian Assange would have used was some software using Hayes Modem commands, which I remember started with AT and got me onto a lot of “BBS” or Bulletin Board Systems where the protocol was usually 8N1, meaning 8 bits, no parity, one stop bit, instead of the more advanced Internet TCP/IP which I’m just reading an explanation of in “The Real Hacker’s Handbook” by “Dr. K”. Further investigation reveals that some Hayes modem commands are listed on https://en.wikipedia.org/wiki/Hayes_command_set , such as ATDT<number> to dial a number, ATA by another computer to answer you, and ATH to hang up. There are lots of other commands, but none of them involve using 5 digit numbers, following by numbers from 0-255 like in Commodore BASIC V2 on the C64. Of course, hackers called lots of phone numbers, but these could be stored in their software instead of having to remember them all.

My conclusion from reading some of this book is that people can program the Commodore 64 if they’re good at maths and have an IQ of over 170, like Julian Assange. This may be a higher IQ than Bill Gates, who has even written BASIC dialects just for processors, such as the 6502, and possibly the Z80 as well before anyone even built a computer to go round them. I don’t know how this is possible, but with an IQ of 170 this makes me think Julian Assange could do the same, or write an operating system, so I rest my case.

It’s a pity I haven’t got time to read the whole book The Most Dangerous Man In The World: The Inside Story On Julian Assange And Wikileaks”, because I might die soon of eviction. This has now been further delayed to sometime in January 2016, though.

So to sum up, it’s no real surprise that Julian Assange could find out how to program the Commodore 64, but I want to know how someone with an average or even below average IQ could have discovered how to program it, apart from creating exclusively text based programs.

This blog has no means of funding, I’m actually quite skint or broke, and my life is in danger from eviction by a property speculator, probably taking place in January 2016. If you’d like to make a donation, please send me an email on paul.londoner@gmail.com , then I’ll tell you how to do that.

Posted November 30, 2015 by C64hater in Uncategorized

OH THAT WOULD BE VERY DIFFICULT! – PART 3   Leave a comment

OH THAT WOULD BE VERY DIFFICULT! – PART 3

After my previous revelations about moving and controlling sprites in Part 2 of this series, as well as detecting and reacting to the fire button or space bar, here’s an explanation about how the program actually works. For this it makes sense to use the same video and pics as in the lat installment of this series.

Don’t forget that I may not be able to carry on writing this blog much longer, because of reasons which will be revealed later in this post.

Meanwhile, my opponent TMR of the blog http://c64crapdebunk.wordpress.com has degenerated into creating demos for the Amstrad CPC computers as seen in his post https://c64crapdebunk.wordpress.com/2015/11/09/release-notes-hdm-clone/ ! Obviously, this is totally irrelevant. For people trying to defend the C64, they can only do this by programming the C64, showing other people how to program the C64, or an easy way how other people could have learnt how to program the C64. Learning how to program an Amstrad CPC has nothing to do with learning how to program a C64. The Amstrad CPC range of computers has over 150 BASIC commands, while the C64 has only about 72 BASIC commands. The Amstrad CPC computers came with a nice thick manual, bigger than the “Commodore 64 Programmers’ Reference Guide” mainly about Amstrad Locomotive BASIC, as well as the parts of the system, but not about Z80 Assembly Language/Machine Code.

Of course, this latest program with the caption “Oh, that would be very difficult!” (i.e. detecting and acting on sprite collisions on other computers compared with the C64) is in the amazing MSX2 BASIC or MSX BASIC 2.0. This is an astounding, extended 32K BASIC (compared with the totally crappy 8K Commodore BASIC V2), which is descended from GW-BASIC under MS-DOS, as well as Tandy Extended Color BASIC Level 3 and the 16K Dragon BASIC. It is a later version than or an upgrade to Microsoft BASIC V4.5. This version of BASIC still uses line numbers. They only started to be abolished in BASIC dialects such as its descendants AmigaBASIC and Microsoft BASIC for the original Apple MacIntosh, QBASIC for MS-DOS, as well as the unstable and a bit crap ST BASIC by Metacomco on the Atari ST commisioned by the evil miser Jack Tramiel. The Amiga started off with the similar AbasiC, also by Metacomco, but the post Tramiel era Commodore soon bundled the Amiga with AmigaBASIC by Microsoft instead. The program has had its lines constantly renumbered using the RENUM command, which of course doesn’t exist in Commodore BASIC V2, or even in Atari BASIC. If you want to program in MSX BASIC, MSX2 BASIC, or even a later version, then I recommend the emulator OpenMSX, which has a few versions, including one or two for the Raspberry Pi computer. Try the links below. 

http://openmsx.org/

http://misapuntesde.com/post.php?id=382

http://www.emulator-zone.com/doc.php/msx/

As for what any of the program would be in Z80 Assembly Language, you don’t need to worry about that. You learn in a high level language, namely MSX BASIC, or another reasonable BASIC, including commands for colour, graphics, and sound. With any MSX or MSX2 computer the lucky buyer received a manual branded by the manufacturer about the standard MSX BASIC, or standard MSX2 BASIC, not about Z80 Asssembly Language/Machine Code. After learning the fundamental principles of programming, then they may have liked to take things further by delving into Assembly Language/Machine Code, possibly starting off by incorporating some routines listed in books or magazines.

By now you should be all be familiar with BASIC commands such as PRINT, GOTO, GOSUB, INPUT, REM and RETURN, which even appeared in Commodore BASIC V2. There are lots of REM statements, but I’ll just confirm below what lines these cover, then explain in detail further down in this post what’s happening.

Lines 10-150 are to set up the screen display and the sprites.

Lines 160-350 make up the main game loop

Lines 360-520 are the sprite collision routine

Lines 530-620 plot the stars and print “Oh that would be very difficult!” on the graphics screen

Lines 630-650 are the sprite definitions

Lines 660-800 allow the user to select between joystick and keyboard control, where the cursor keys and the space bar automatically replace the joystick controls under MSX BASIC right from version 1.0.

As the program has been automatically renumbered in increments of ten and has lines numbered from 10 to 800, this tells us that it consists of 80 lines. There are a lot of REM statements on lines with commands, which have been left from the development of the program, because it’s still in development.

If you own one of the first generation MSX computers with MSX BASIC 1.0, then you’ll have to make a few changes to get a version of this program to run on your computer. You’ll have to replace SCREEN 7,3 with SCREEN 2,3 as well as deleting all occurences of COLOR=(N,R,G,B), SET BEEP N. The horizontal screen coordinates will also have to be divided by two in order to reduce their range from 0-511 to 0-255.

Program listing screen 1

Program listing screen 1

Lines 10-150 work as follows. Line 20 turns on the 32 column SCREEN 1 mode, sets the width to the maximum of 32 columns using WIDTH 32, turns off the function key display with KEY OFF, sets white text on a black background with COLOR 15,0,0 , then prints the message “SPRITE GAME DEMO” in the middle of the screen, before a GOSUB 660 to select joystick or keyboard control, from where it executes a RETURN and goes into the hires (512×256 with individual pixel clarity meaning no “attributes”/colour bleed) SCREEN 7, much better than the limited SCREEN 2 (256×192 with 16 colours and 8×1 attributes), which was the best the original version of MSX could do. The SCREEN command has several parameters, including mode, sprite size, key click, baud rate, and printer option . In this example SCREEN 7,3 means SCREEN 7 with the largest expanded sprites possible, meaning 16×16 pixels enlarged to 32×32. COLOR=(N,R,G,B) redefines the standard colour selected by the value of N as one of the total of 512 colours available in MSX2 defined by the values of R, G, and B. A FOR…NEXT loop reads values for S from the DATA statements. S is then referred to in line 60 the sequence S$=S$+CHR$(S) to build up a sprite definition. Once this has all been read in, it’s assigned in line 70 by SPRITE$(0)=S$. The same thing happens in lines 80 and 90 but with T$ and SPRITE$(1)=T$, as well as in lines 100 and 110 with U$ where SPRITE$(2)=U$. Line 120 uses PUT SPRITE(2) to position a missile sprite and just leave it there. This sprite doesn’t move at all. Line 140 ON STICK(N) GOSUB 750 means GOSUB 750 when the joystick or cursor keys are detected, but this hasn’t been activated with STICK ON.

Program listing screen 2

Program listing screen 2

Lines 160-350 is the main game loop. Here we turn on interrupts for the sprites and joystick fire button or space bar,, using the commands SPRITE ON and STRIG(N) ON. The joystick or cursor keys are checked using STICK(N) for the values 3 for right or 7 for left, but the interrupt command STICK ON isn’t used, only appearing after a few REM statements, then The Master’s Doric Greek column shaped TARDIS sprite is moved left or right accordingly. A FOR… NEXT loop runs from line 260-340. This uses the command PUT SPRITE in line 290 to move The Doctor’s TARDIS sprite from left to right across the screen, while line 310 uses another PUT SPRITE to move The Master’s TARDIS sprite left or right according to the latest input from the joystick or cursor keys. Line 350 says GOTO 170, which takes us back to the beginning of the main loop.

Program listing screen 3

Program listing screen 3

Lines 360-520 are the sprite collision routine, which isn’t actually being used in this version of the program. It’s only listed here because this is an edited version of the previous programs I’ve posted videos of, and it’s all ready for when I want to use it again. It starts with SPRITE OFF to turn sprite collision detection off. Lines 380, 390, and 400 each use COLOR=(1,R,G,B) to redefine colour 1, so this would make that colour change rapidly if this subroutine was called. Line 410 uses the SOUND command to control the 8910 Programmable Sound Generator’s (PSG) registers to produce a sound effect, which is used by the PLAY “<string>” command in line 420.

Program listing screen 4

Program listing screen 4

Lines 530-620 plot the stars and print “OH, THAT WOULD BE VERY DIFFICULT!” on a graphics screen. The command used to plot the stars is PSET(x,y),colour in a FOR…NEXT loop. A Commodore 64 fanatic might try printing asterisks or full stops at random positions on the text screen and pretend it didn’t matter that they were only character graphics. Printing text on a graphics screen is also quite easy in MSX BASIC, only requiring an OPEN “grp:” AS #1 command, before the command PSET(X,Y) to position the graphics cursor, followed by PRINT#1,”OH, THAT WOULD BE VERY DIFFICULT!” I have no idea how anyone could do this in Commodore BASIC V2 on the C64, but it would obviously be even more difficult than making two sprites bounce off each other! On the Commodore 128 under Commodore BASIC V7, as well as the Super Expander 64 cartridge, this is done with the CHAR command.

Program listing screen 5

Program listing screen 5

Lines 630-650 are the sprite definitions, listed here in hexadecimal numbers. It would also be possible to use binary, or decimal numbers instead, but Commodore BASIC V2 can only define them in decimal numbers. You should notice that each of these lines is up to 256 characters long, although the crappy Commodore BASIC V2 lines can only be up to 80 characters long.

Program listing screen 6

Program listing screen 6

Lines 660-800 allow the user to select between joystick and keyboard control, where the cursor keys and the space bar automatically replace the joystick controls under MSX BASIC. The user’s input to select this is handled by the INKEY$ command, which in this case has no real advantage over the ancient GET$ as used in Commodore BASIC V2 on the C64. It assigns the value of the variable N to be used in subsequent STICK(N) and STRIG(N) commands. If the user presses 1 then N=0 which means keyboard control, but if they press 2 then N=1 which means joystick control. That and the STICK(N) and STRIG(N) commands are all there is to it!

So, I’m feeling really pleased with myself now that I’ve finally managed to post and explain a program about the simple building blocks of a game. I now plan to quickly take things further while I still can.

Unfortunately, I’m being evicted from my flat by a nasty property speculator! At the moment, I’m just waiting for a letter telling me when the Bailiffs will come to carry out my eviction.

I live in London. Landlords have made things a lot more difficult for people in London now, causing what they call a “housing bubble”, so I’m worried I may never get another flat to live in. I am a city dweller and can’t bear to live anywhere except a city, but even if I did agree to move to a smaller town, I don’t know if I’d succeed, or how depressing my life would be there. I’ve visited Birmingham, which is definitely a major city, a few times recently, but didn’t find out anything about renting a flat there. All of this means I could die soon.

So far, I have viewed only one flat, which was tiny, like a Bed and Breakfast, as well as having a shared kitchen. Even if I find a new flat, there’s some kind of conspiracy to force me into a studio flat, meaning no seperate bedroom, usually just a shower instead of a bath, and it may not even be near a tube station. Depending on the size of the flat, I could be forced to throw away a lot of my belongings. I could arrive there with a removal van containing all my stuff, then find that half of my belongings won’t fit in to the new flat, and they get left on the pavement or in the communal area, which would be a disaster. One trick here is to pack the most important stuff last, so that it gets unloaded first. This or, something even more disastrous, could mean me losing my MSX2, Commodore 128, Atari 800XL, Atari 65XE, and/or two Amiga computers and a Commodore monitor! I’m actually hoping that the large widescreen CRT Philips TV I used for my last MSX2 video will blow out soon, so I don’t have to transport it anywhere. This is if I actually get a new flat, which I may not. My blog has no funding and I haven’t got enough money to ensure that I can get into a new flat, so things are touch and go.

That’s all for now! Look out for another post quite soon. It could even be the grand finale of the series “Drawing The Line”!!

This blog has no means of funding, I’m actually quite skint or broke, and my life is in danger from eviction by a property speculator, probably taking place in January 2016. If you’d like to make a donation, please send me an email on paul.londoner@gmail.com , then I’ll tell you how to do that.

Posted November 11, 2015 by C64hater in Uncategorized

WHAT GRAPHICS SCREEN?! I’M A COMMODORE PET!!   Leave a comment

WHAT GRAPHICS SCREEN?! I’M A COMMODORE PET!!

C64GRerror

The coloured blocks are an error message!

Getting back to another important subject now, while my next article in the series “Oh, that would be VERY difficult!”, which explains how the program works, is nearing completion with about 1,000 words typed already. TMR has made a stupid debunk of my last post, ignoring the fact that MSX BASIC is totally superior to Commodore BASIC V2, so I won’t waste my time de debunking it. I plan to make a few posts which will create a spectacular finale on this blog soon, because my life is in danger! Lots of other people’s lives are in danger as well. It’s all to do with some nasty people trying to make more money. If I could do a bit of White Hat hacking, then that would save my life, but that’s something I never managed to get into, probably because of how the C64 fiasco damaged my confidence, as well as my Dad saying “You’re not plugging any MODEM into my PHONE!!” If I manage to survive, then the next few posts could turn out to be a cliffhanger or lead to some even more spectacular revelations instead of a finale, though.

This post is about a problem and listing previously mentioned in “Debunking ‘What’s That Coming over the Hill?’” Previously I thought I should tell you about an amazing sequence of Commodore 64 POKEs I’ve found, which can return the C64 from the graphics screen to the text screen without clearing it, so that users can read an error message printed as a series of coloured blocks when a graphics program crashes! I found these POKEs in “The Home Computer Advanced Course” published in 1984 by Orbis which followed on from “The Home Computer Course”, but had no publicity saying things like “Want to draw graphics on the Commodore 64? Want to stop colours bleeding on the Spectrum? Want to play polyphonic music on the Electron? Then you need to read this!”, so that was why I didn’t read it in 1984-1985. I’m not sure if it includes programs to do those things on the Spectrum and Electron, because I’ve been concentrating on the fairly mind blowing Commodore 64 sections and I haven’t found the whole set of magazines anyway. I recently spoke to a former Spectrum user who said something like he tried to or actually did overcome the Spectrum attribute colour bleed using Z80 Assembly Language. Some people have actually succeeded in doing this, but I’m not sure when they did it. Back in 1984 I even got the impression “The Home Computer Advanced Course” may be in generic BASIC running on all home computers, without using graphics or sound. This obviously means that it was pure luck that any Commodore 64 owners read this magazine instead of spending their money on another dedicated Commodore magazine, or another book claiming to solve all their C64 problems instead.

This problem is caused by the Commodore 64 only having a version of Commodore PET BASIC built in. The Commodore PET has no graphics screen, so Commodore BASIC V2 doesn’t know what to do when there’s a error in a graphics program. It moronically prints an error message as coloured blocks on the graphics screen, not having a clue that the user can’t read this message and can’t easily return to the text screen without clearing the message by pressing RUN/STOP and RESTORE. Obviously, the C64 has no built in commands to define its function keys, so it would be very difficult to assign this sequence of POKEs to a function key. The trick is to type these commands in your program, but write it so that those lines are never executed when you RUN your program. When the program crashes and the coloured blocks appear, you can just type in direct mode GOTO [line number[ or of course G SHIFT O [line number] followed by RETURN. It may be best to put these commands in a one digit line number to cut the typing down to a minimum, as well as to isolate them from the rest of the program. The sequence of POKEs must end with STOP or END.

Here’s the listing from “Your 64” Issue No. 1 which caused the error. I must point out that before even running this program “Your 64” magazine said you must relocate BASIC by typing the following in direct mode…

POKE 642,64:POKE 44,64:POKE 16384,0:NEW

I think this is to lower the top of RAM available to BASIC. Users of other computers such as the Sinclair Spectrum and BBC Micro sometimes had to do this, but not to draw simple graphics. The technical reason for this on the C64 is because it’s crap!

10 POKE 53272,PEEK(53272) OR 8
20 POKE 53265,PEEK(53265) OR 32
30 FOR C=8192 TO 16191
40 POKE C,0:NEXT C
50 FOR C=1024 TO 2023
60 POKE C,22:NEXT C
70 X=160:Y=100
80 GOSUB 130
90 GET A$:IF A$=”” THEN 90
100 GOSUB 160
110 GET A$:IF A$=”” THEN 110
120 GOTO 80
130 GOSUB 190
140 POKE B,PEEK(B) OR M
150 RETURN
160 GOSUB 190
170 POKE B,PEEK(B) AND (255-M)
180 RETURN
190 B=8192*INT(Y/8)*320*INT(X/8)*8+(Y AND 7)
200 M=2^(7-(X AND 7)
210 RETURN

In line 200 the ^ appears as an up arrow in Commodore BASIC V2. When I first typed in this listing in 1984, I had already learnt that I must type in listings exactly as they appeared in print, as well as that different computers have different commands and syntax. I typed in the listing exactly as it appeared, then it cleared the graphics screen before crashing and printing some coloured blocks. I had no idea that the error was a missing right bracket at the end of line 200. I’m sure this happened to thousands or millions of other hapless victims of Jack Tramiel’s Commodore 64 con, whether it was from typing in this program, or another graphics program.

Let’s not forget the equivalent programs in MSX BASIC 1.0 and Amstrad’s Locomotive BASIC on their CPC computers.

MSX BASIC

10 SCREEN 2
20 PSET (128,96)
30 GOTO 30

AMSTRAD LOCOMOTIVE BASIC

10 MODE 1
20 PLOT(160,100)
30 GOTO 30

In MSX BASIC, line 30 stops the program from closing the graphics screen and returning to the text SCREEN 0, while in Amstrad Locomotive BASIC, it just stops the Ready prompt from reappearing. As Jack Tramiel originally bought his BASIC from Microsoft in 1977, if he’d agreed to carry on paying Microsoft for updated versions, then all C64 owners would have been able to type in and run something like the MSX BASIC listing above. Acorn Computers (as in BBC Micro and Electron), Memotech and other manufacturers didn’t buy their BASIC from Microsoft, but copied their syntax. This theoretical Commodore 64 BASIC could have been as follows, if the display modes were numbered as normal text=0, multicolour text=1, lores graphics=2, hires graphics=3.

10 SCREEN 3
20 PSET(160,100)
30 GOTO 30

The solution to finding the bug in the Commodore BASIC V2 program above is the following sequence of POKEs inserted somewhere in any graphics program. To use it, you just type GOTO 2 or G SHIFT O 2 in direct mode and press RETURN after the program crashes and prints coloured blocks on the screen.

1 GOTO 10:REM GOTO FIRST LINE NUMBER OF REST OF PROGRAM
2 POKE 53265,PEEK(53265) AND 223
3 POKE 53272,PEEK(53272) AND 240 OR 4
4 STOP

I found this amazing revelation in “The Home Computer Advanced Course” on page 338. It was part of a program to draw a few dotted lines. It came complete with a flowchart showing eight stages, including beginning and end, as well as two conditional branches. Even the title of this magazine could have put me and lots of other new computer owners off, because it’s called ADVANCED and because it followed on from the earlier “The Home Computer Course”, which started publication in 1983, before I had a computer, so that was why I didn’t buy the magazines in the first course.

Here’s a video showing this technique actually revealing the error message.

So, that’s it! “?Syntax error in 200” is the hidden message from way back in 1984!!

C64 error message revealed

The C64 error message is finally revealed!

Finally, here’s a video of the debugged program plotting and unploting a white pixel in the middle of a blue screen.

That’s all for now! The next part of the series “Oh, that would be VERY difficult!” will appear in a few days from now. Meanwhile, I think I’ll contact The Guinness Book of Records to tell them it took me about 29 years to find out how to draw a line across the C64 graphics screen AND that it took me about 31 years 6 months to find a way to read the error message in the pixel plotting “Your 64” program above!

 

This blog has no means of funding, I’m actually quite skint or broke, and my life is in danger from eviction by a property speculator, probably taking place in January 2016. If you’d like to make a donation, please send me an email on paul.londoner@gmail.com , then I’ll tell you how to do that.

Posted November 9, 2015 by C64hater in Uncategorized

OH, THAT WOULD BE VERY DIFFICULT! – PART 2   Leave a comment

OH, THAT WOULD BE VERY DIFFICULT! – PART 2

Program listing screen 1

Program listing screen 1

First of all, I should say hello and welcome to all the recent new visitors to this blog who have caused what WordPress call a spike in my ratings which they felt the need to send me an email about! I saw that I was getting a lot of visits from Poland, although I didn’t seem to get much attention from there before.

Program listing screen 2

Program listing screen 2

Following on from my first article in this series, after a lot of distractions, as well as my MSX2 computer power switch breaking down, then me getting it repaired, my camera phone wearing out or just getting corrupted, here’s the continuation. I took the pics and the video on my new Huawei Ascend Y330 Android 4.3 Jellybean based phone, because I’m on a tight budget, but if I had more money I wouldn’t buy an iPhone.

Program listing screen 3

Program listing screen 3

This is the latest version of the program I was writing in MSX2 BASIC or MSX BASIC V2.0, which has a few, but not that many, extra commands compared to MSX BASIC V1.0. These commands are mainly to do with the superior MSX2 hardware, but there are also a few other improvements, such as SET BEEP to change the standard BEEP sound which people may get a bit bored of to a choice of a few others, and SET PROMPT to change the standard “Ok” prompt to whatever the user decides, such as “Ready”, or in my case “MSX2”. The version numbers have nothing to do with Commodore BASIC V2 on the C64 or Commodore BASIC 3.5 on the Commodore 16, Commodore Plus/4 and the very rare Commodore 116. MSX BASIC V1.0 is Microsoft BASIC V4.5.

Program listing screen 4

Program listing screen 4

I should point out to you that due to me not making a flowchart before starting work on the original program, it has now grown into slightly hard to follow “spaghetti code”, which I’ve found is difficult to add anything to. A better designed, flowcharted program should have a number of separate subroutines, each clearly labelled with a REM statement, then a main game loop would be made up mostly of GOSUB commands, as well as, thanks to the advanced MSX BASIC, interrupt commands such as ON SPRITE, ON STICK, and ON STRIG. Interrupts are a limited form of multitasking for 8 bit computers, which were never properly explained by Commodore in their official manuals, instead waffling on about totally incomprehensible crap to do with “IRQs” and “raster interrupts”. Other commands used include SCREEN to select the display mode, SET BEEP to select a more interesting BEEP sound than the default, COLOR= to change some of the default colours, PSET to draw the stars, SPRITE$ to define sprites from DATA statements given here in hexadecimal, PUT SPRITE to position and move the sprites, SPRITE ON to turn collision detection on, SPRITE OFF to turn collision detection off, INKEY$ and IF THEN…ELSE to input whether joystick or keyboard will be used, OPEN “grp:” AS #1 and PRINT#1 to print text on the graphics screen. Of course, if there were any errors, then MSX2 as well as the first version MSX computers would return to the text screen and print the error clearly on the screen, while the Amstrad CPC computers can display text or graphics in any of their three display modes, but the Commodore 64 would stop and print an error message made up of coloured blocks on the graphics screen! A reference guide for MSX2 BASIC is on http://msx.hansotten.com/uploads/msxdocs/MSX-Basic-V2.pdf

This program has hardly anything in common with Commodore BASIC V2 on the C64, except that it uses line numbers, GOSUB commands, and variable names where only the first two letters are significant. It doesn’t contain any PEEK or POKE commands, which are needed for most colour except text, graphics, sound, and reading joysticks on the crappy Commodore 64.

Program listing screen 5

Program listing screen 5

I think the best way I can present this program to you at the moment is to show you the several screenshots of program listing, as well as the video taken on my new smartphone and a short explanation of what I was thinking when I wrote it, then leave you to try and work out how this has been achieved, before I give you a detailed explanation in the next part of this series.

I decided it was time to move past the original fundamental concept of detecting two sprites colliding, then bouncing off each other by showing what would come next as a simple building block of a game. I decided to design and display two more sprites to interact with The Doctor’s TARDIS sprite. These are, firstly from the classic series of Doctor Who, The Master’s TARDIS, with a working Chameleon circuit to change its appearance, disguised as a Doric Greek column, as seen in the stories “Logopolis” (Tom Baker’s finale) and “Castrovalva” (Peter Davison’s premiere). I added some kind of missile, which is a just a single red vertical bar, but in the story “Castrovalva” The Master’s TARDIS shoots some kind of beam or stars. I haven’t done anything with the missile in this version of the program, so at the moment it doesn’t move at all, but is just positioned to the right of the word “difficult” in the title.

The program asks the user to select keyboard or joystick input and responds to either of these by moving The Master’s TARDIS, as well as beeping if the fire button or space bar is pressed, but no missile is fired.

Program listing screen 6

Program listing screen 6

This program could be converted into Commodore BASIC V7 on the Commodore 128 without too much difficulty, but I have no idea how to convert it into Commodore BASIC V2 as on the C64. Commodore BASIC V7 commands whch would be used include GRAPHIC to set the display mode, SPRITE to set sprite colours priorities and expansion, MOVSPR to move sprites, COLLISION to handle how sprites collide, BUMP to find out which sprites have collided, COLOR to select one of only 16 colours compared with 512 colours on MSX2, and JOY to detect the joystick status including fire button. SPRDEF is used to bring up the sprite editor, then the defnition is saved into a file before being reloaded into a BASIC program. It seems that Commodore BASIC V7 has no commands for interrupts, unlike MSX BASIC or Amstrad’s Locomotive BASIC. I’m not sure if there’s any way to define the sprites using another command in combination with READ and DATA statements from within in a program, instead of using the built in sprite editor.

Finally, here’s a video showing this program running…

That’s all for now. In the next part of this series I plan to explain what has happened in this program, the problems with adding any more lines or commands to it, and I hope to present a flowchart of a slightly better program which does all this and more! Apart from this, I’ve also discovered some more secrets about drawing lines on the Commodore 64, as well as how to read an error message printed on the graphics screen!

This blog has no means of funding, I’m actually quite skint or broke, and my life is in danger from eviction by a property speculator, probably taking place in January 2016. If you’d like to make a donation, please send me an email on paul.londoner@gmail.com , then I’ll tell you how to do that.

Posted November 7, 2015 by C64hater in Uncategorized