The Notorious Death Of Doommlord The Legend

March 19, 2013 Leave a comment

feanor's mud gossip

I continue to work my way through the box of old Commodore 64 floppy disks that I recently uncovered in the loft.  A number of the disks are barely readable and I’ve been employing a number of tactics to retrieve the files.

Although the disks don’t appear too dirty it’s clear that in some cases multiple passes of the drive head over the disk surfaces have been successful in scouring through the muck and reaching the data.  Of course that muck has to go somewhere and some of it inevitably ends up on the head.

The 'Thumb' Technique

The ‘Thumb’ Technique

I have therefore also taken the opportunity to carefully clean the heads with isopropanol alcohol a couple of times during the process.  Some of the disks that at first attempt would not even give up their directories are now yielding recoverable data.

For some of the more stubborn files I’ve employed a further technical solution, judicious use of my thumb.  At the first sign of problems when attempting to read a file, usually disk thrashing, I push the disk up in the drive with my thumb and this will often allow the read to continue.

I still have a few files that seem unrecoverable, however I may try multiple passes with Starcommander running on my PC as a last throw of the dice.  Fortunately the surfaces of the disks are not, at least to the naked eye, deteriorating too much.

Modem Internals

Modem Internals & Dirty Contacts

Some of the files are of the .SEQ variety and these are tied in to the built-in editor of the Commodore Communications Modem which was required to connect to Compunet.

Initially my model of this modem was not working correctly so I was unable to view the files.

However Crys over at the Compunet Facebook Group suggested cleaning the contacts on the modem with a pencil eraser.  This did the trick and on reconnecting the modem to the 128 (forcing it in to 64 mode) I was greeted by the Compunet Terminal boot up page.

Recovering Files

Recovering Files

Typing ‘Help’ brings up the list of available built-in commands:-

  • EDITOR
  • CONNECT
  • CNLOAD
  • CNSAVE
  • HELP
  • OFF

EDITOR, unsurprisingly launches the on or off line editor for creating, storing and uploading pages.  CONNECT, also self-explanatory, will request the required phone number and dial Compunet.  CNLOAD will if I remember correctly restore your last saved session and connect to Compunet.  CNSAVE creates the CNLOAD file which contains the link software that would otherwise have to be downloaded on each connection.  As yet I can’t remember what OFF does although I assume it turns off the modem and restores the 64 to its normal boot state.

Compunet Chess Tournament

Compunet Chess Tournament

Launching the editor allowed me to load up and start browsing through the collection of saved files I’d recovered.  Most of the pages were related to M.U.D. including back ups of my M.U.D. gossip page and some in-game logs.

There were also some Compunet e-mails many of which were chess games I was participating in.

Chess Game In Progress

Chess Game In Progress

Games could be played via e-mail by sending a graphical representation of the board to your opponent including your latest move, they would in turn edit the file with their move and send it back and so on.  There was an ongoing tournament and some of the players were very good indeed.

An Incoming E-mail

An Incoming E-mail

Once I’d reached Wizard in M.U.D. I spent a fair amount of time just socialising with other wizards within the game and watching other players.  It was possible to log your sessions for viewing later and it occurred to me it would be quite fun to produce a weekly round-up of the goings on within the game, hence Feanor’s Mud Gossip.

One particular ‘scandal’ revolved around the death of Doommlord the Legend.  Legend status was one level shy of becoming wizard and achieving immortality.  To get to such a level required many hours of play, and at £1.75/hour it was not a minor investment.

The death of a legend was pretty upsetting for the player involved, fortunately I only endured it once.

Feanor's Mud Gossip

Feanor’s Mud Gossip

In this case added intrigue was born from the suspicion of foul play.  Doommlord was a murderer, and a very successful one at that, there were many players out for his blood.  I happened to be snooping on Doommlord (you receive their game feed as well as your own) when he met his bloody end.

Weakened by a fight with a strangely powerful skeleton, Doommlord was set upon by two or three other players.  It seems likely that an immortal ‘frigged’ the skeleton.

UCAT

UCAT

This involved changing the statistics of the mobile (in-player character) to make them a lot stronger than usual.

Anyway, to cut a long story short I’ve included a video of the game log below.  I appreciate this will be of limited interest but you never know, an ex-player may chance upon it one day.  Further below I’ve also added a video showing the 64 with the Compunet modem attached and a video of files being loaded into the editor.

Compunet – Log On To The Live One

March 15, 2013 8 comments

cnet10

I recently discovered a box of 5.25″ floppy disks which had been in storage since the mid Eighties and wrote about how I’d recovered some data from one of them which turned out to be computer studies project I’d been working on at school in 1985.  That was one disk in a box of ten or twelve others, others which were unlabelled and I assumed blank.

Commodore Modem Settings

Commodore Modem Settings

However whilst recently using my Commodore 128D something, somewhere, deep in my mind prompted me to insert one of the disks into the 1571 drive and type LOAD”$”,8.  When I was subsequently greeted with a LOADING prompt I became quite excited.  Nervously I typed LIST and was greeted by a directory of various files, mostly related to Compunet.

Back in 1983/4 Commodore UK helped initiate Compunet, a UK specific dial-up interactive service hosted originally on a DEC 10. It was with retrospect an astonishingly ground breaking initiative.  An online community where users could create their own areas, upload content and have that content voted on by other users.  Content could even be priced, downloaded and paid for.  There were also popular online games and chat rooms.

Classic Compunet Setup

Classic Compunet Setup

The vast majority of users accessed Compunet with a Commodore 64 and Commodore Communications Modem, the latter of which contained a built-in text and low resolution graphic editor.  These allowed you to create content offline before uploading, thus saving on expensive phone charges.  Latterly the service would also see users logging on with Amigas and even Atari STs.

While some users had cool handles, youngsters such as myself who relied on their parents to set up their accounts ended up with anonymous handles like TBAH1, my Father’s initials. I believe you could pick something more memorable for an additional charge.

The Compunet Server

The Compunet Server

There were originally three subscription choices, Basic, Standard and Gold ranging in price from £7.50 to £15.00 per quarter.  Access to the system was free of charge between 6 pm and 8 am although you still had to factor in your BT phone bill which typically ran at around £0.60 per hour.  Access to online games such as M.U.D. cost an additional £1.75/hour.

As many of the users were like myself teenagers, this led to some interesting family discussions when the phone bill arrived.

My own experience of Compunet consisted largely of creating and uploading artwork as Spock and playing M.U.D. as Feanor for which I created a M.U.D. Gossip page (or the Technicolour Yawn page as my good friend Urbancamo (DEW2) once referred to it!)  After many hours playing M.U.D. at the aforementioned £1.75/hour I reached the penultimate status of Wizard and achieved immortality.

diary

My Compunet Usage Log

The ultimate status was of course reserved for the Arch Wizards, responsible for running and moderating the game.  The two I can remember were Roy and JohnK, the latter of which sent me my Wizard’s Pack which contained amongst other things, full maps of the game which I still have.

Classic 80's Look

Classic 80′s Look

As I worked my way through the floppy disks it was a pleasant surprise to find some remnants of my M.U.D. Gossip page and some old artwork.  The disks were understandably flaky and many files were unreadable.  Frustratingly the artwork I was able to recover was mostly work in progress, however I’ve included some here for nostalgia.

My weapon of choice was Vidcom64 which I bought on Compunet for the princely sum of £4.50.  Initially I was forced to use either the cursor keys or joystick to draw with.  This meant slow progress to say the least.  I eventually cobbled together enough pennies to buy a second-hand Koala Pad which at least allowed a moderate amount of freehand drawing.

Drawn With Vidcom64

Drawn With Vidcom64

After uploading several pictures I was approached to create the artwork for the loading screens of a couple of games.

Unfortunately immaturity and general apathy prevented me from meeting the required deadlines so there ended my career as an 8-bit artist before it had even started.

My M.U.D. Gossip page was quite popular with fellow players.  Once I’d made Wizard I’d log on and monitor an evening’s session, jotting down notes of new players, those who’d achieved a new rank and of course those who’d had been killed.  At the end of the week I would upload a round-up of events for all to read and hopefully vote on.

Compunet Guide

Compunet Guide

I also found a number of demos while working my way through the floppy disks.  The demo scene was a huge part of Compunet and every new release was eagerly anticipated.  Some of the hacks on display were frankly extraordinary,  I’m sure that even the creators of the 64 were astonished by some of the tricks these guys pulled off.  Many of the people involved were head hunted and went on to have careers in the video games industry.

Perhaps inevitably given the inexorable rise of the Internet Compunet ceased trading in 1993.  Somewhat ironically there’s a Facebook group for ex Compunet users. It was here that I learnt the rather depressing fact that some of the original disks and tapes on which Compunet resided were still in existence as late as 2008 at which point they were apparently thrown away.

Work In Progress

Work In Progress

This made me quite angry, not with any particular individual, but with the circumstance.  When you read about the latter-day exploits of Jason Scott and the Archive Team you have to wonder why at no point did anyone in a position to do so stop and think, we really need to try to recover and preserve this stuff.

I have some more files to look at, a number of them are I believe pages I created with the Commodore Modem’s built-in editor, and some are presumably other pages that I’d downloaded.  I did manage to find my original modem, however it doesn’t appear to working correctly so I’m going to try to locate a working model and see what else I can recover.

Old Disk Contents

Searching Old Disks

I’ve pulled together a few resources for those interested in further reading.  There is of course a Wikipedia article which goes in to further detail and there is also Mike Berry’s excellent 64apocalypse site which is as far as I can tell the most comprehensive single online resource covering Compunet.

Richard Bartle, co-creator of M.U.D. has some interesting articles on his site, not least of which is this one.  A good article from the January ’85 edition of Your Commodore can be found here.  You can play M.U.D. here.

There’s a bio of Nick Green here, the main man behind Compunet.  Another interesting article can be found here.  I’ve also scanned in some literature that may be of interest:-

Compunet GuideCompunet GuideCompunet LetterCompunet LetterMud Gossip NotesCommodore Communications Modemcn12Commodore Communications ModemCompunet BillCompunet GuideCompunet GuideCompunet GuideCompunet GuideCompunet GuideCompunet Guide

Categories: Commodore Tags: ,

Commodore 128D, Flyer & Iffy Jiffy

March 12, 2013 3 comments

_1040145

Despite having bought it over a year ago, my Commodore 128D has not found its way onto my workbench as often as I’d intended. There are two specific reasons for this, the built in 1571 disk drive is temperamental to say the least and the fan that cools the machine’s power supply is not only noisy but cursed with a tedious whine.

Commodore Flyer

Commodore Flyer

Using the 128D therefore has been an exercise in irritation and frustration when it should be an enjoyable experience given the unit’s multiple computing personalities, a Commodore 128, 64 and CP/M capable machine all rolled into one.

I then became aware of the Commodore Flyer.  This superb piece of kit acts as an internet modem and disk drive emulator, thus allowing me to forget about the flaky 1571 and transfer software into the 128D at my heart’s content.

I ordered a Flyer  from Retroswitch and it arrived promptly from the States.  It’s a really nicely engineered solution and I was quickly up and running, updating the firmware and pulling down disk images from the Commodore Online cloud service that I’d previously set up.

Flyer Telnet Client

Flyer Telnet Client

The guys over at Retroswitch have also written a Telnet client which works with the Flyer, although it will only run on a C64 or 128 in C64 mode.  I loaded this up and pointed it at my BBS.  It’s a little rough around the edges but it worked well enough for me to log in and check my mail, pretty cool with a C64!

As the Flyer is JiffyDOS compatible and the standard Commodore serial transfer rate is so woefully slow I decided to order a JiffyDOS upgrade kit for the C128D.  On arrival this consisted of two chips, one to replace the kernel on the main board and one for the 1571 drive.

Once the kit had arrived I headed over to Jim Brain’s site and downloaded the installation instructions for the C128D.  However it soon became apparent these instructions were meant for the C128DCR (cost reduced) model which differs considerably from the C128D internally.

JiffyDOS Kit

JiffyDOS Kit

I hunted around but couldn’t find installation instructions for my machine so I decided to trust my instincts and see if I could locate the relevant chips myself.

The drive chip was pretty obvious, being the only socketed chip of the correct size on the drive’s daughter card.  Mine was labelled as a 310654-03.  I gently prized it out with a flathead screwdriver and popped in the replacement.

I then discovered what I presumed was the 128′s Kernel chip, labelled as a 318020-03.  Again I replaced the original chip with the new replacement, reassembled the case and powered on.

JiffyDOS On The 128D

JiffyDOS On The 128D

The first thing I noticed was that the 1571 was not springing in to life as it usually does on boot.  However the 128 screen came up and there indeed JiffyDOS V6.01 (C) 1989 CMD was displayed.  However there was no flashing cursor.  I decided to completely disconnect the internal 1571 and try again.  This time everything appeared to be working fine.  A quick test using the Flyer to download a program from the cloud server saw an increase in speed from 45 to under 8 seconds, very nice.

I decided to replace the original drive chip and try again with the 1571 reconnected.  Again, no cursor without a Runstop/Restore and even then no joy with either the Flyer or the 1571.  Incidentally the C64 mode was working, but with no JiffyDOS support.

Concerned that in my haste I’d installed the chips in the wrong sockets I headed over to the excellent Lemon64 forum.  There I learnt from the always helpful and knowledgeable members that the 128D requires the same set of chips as the plain C128.  The chips I had were intended for the C128 DCR which is unfortunately also known as the 128D in America, despite being very different from the real European 128D.  As with the C128 the 128D requires replacement chips for both the 128 & 64 Kernel, I believe these are combined on the 128DCR.  Fortunately the original vendor has agreed to send me the correct chips at no extra charge.

Replacement Fan

Replacement Fan

Somewhat disheartened for now I removed the JiffyDOS chips and replaced the originals.  As if that wasn’t irritating enough, when I rebooted the machine I was greeted with a black screen in 128 mode.

I consulted R Carlsen’s excellent document on common c128 faults and decided to swap the 6526′s in the U1 and U4 sockets.  However on closer inspection it looks to me as though a previous poor repair to the U4 socket was a possible cause and it looked unlikely I’d be able to remove the chip without causing further damage.  There’s melting to the actual socket, presumably from a soldering iron and some less than expert soldering to the board.  I’m guessing that all that levering out and replacing of chips in the nearby U35 socket has damaged what was already a rather tenuous repair.

New Fan Installed

New Fan Installed

While I had the case apart I took the opportunity to address the other issue with the 128D, the deeply irritating fan noise.  I found a replacement fan that purported to be silent and quickly replaced the original, which is mounted on the underside of the power supply.  On restarting the reassembled machine there was a considerable improvement.  Silent no, considerable quieter and less whiny, definitely.

So for now I have what is essentially a rather bulky Commodore 64.  I may attempt a repair, although I do have a flat C128, which rather ironically doesn’t work in C64 mode.

Still a Commodore 64 was exactly what I needed as I’d recently found a box of old Commodore 64 floppy disks in the loft…

Categories: Commodore 128D, Computers Tags: ,

@Retrochallenge – World’s Latest Homework

January 27, 2013 2 comments

yahtscore

Picture the scene, it’s a hot summer’s day in 1985, Frankie by Sister Sledge tops the singles chart, Filofaxes are the new big thing, and I’m at school sat in front of a BBC Model B trying in vain to finish my Computer Studies project before the term ends, a computer version of the dice game Yahtzee.  To my right David is putting the finishing touches to his military magazine database, on my left Simon is entertaining most of the class with his Hungry Horace goes Skiing clone.

How It Used To Look

How It Used To Look

Behind me, dreamy Donna and her friend Jackie are arguing over which band is best, Duran Duran or Wham and across the class Nick is throwing Jeff’s school bag out of the second floor window while Mark (Urbancamo) distracts the teacher Mr Rigby.  Only a few days until the end of term and the summer holidays.

Faced by the choice of finishing my code or intervening in the Duran Duran/Wham debate, I choose the later, if only to spend more time with Donna.  So I type SAVE”YAHTZEE” for the last time, remove the disk from the drive and throw it into my Adidas school bag.

28 years later at the beginning of January this year I found the aforementioned disk whilst digging around in the loft and miraculously managed to recover the contents.  My Retrochallenge was therefore decided, to try and finish Yahtzee.

Roll & Hold Toggle

Roll & Hold Toggle

Since the last update I’ve managed to eliminate the need to jump out of Mode 7 to display the dice by building the graphical representation of each die using Sixels.

Although I’ve lost the roundness of the dots and the squareness of the dice and I still prefer the end result plus it gives a more consistent feel to the overall aesthetic of the program.

Using this mode has also allowed me to improve the layout by placing the dice horizontally, label them more clearly and fit in more text where necessary.  Here’s a list of improvements made since my last entry:-

  • Graphics updated to Mode 7
  • Dice properly labelled and numbered
  • Hold/Roll toggle selection
  • Option to amend Hold/Toggle choices
  • Option to skip 2nd and 3rd rolls
  • Current round displayed
  • Used GET$ to remove unwanted question marks

Everything seems to be working correctly and although I might be tempted to tinker a little more I think Yahtzee is finally at a stage where I could submit it as finished coursework and hope to improve upon the ‘C’ I was originally graded.

Given that I started this code 28 years ago I confess it is a tad late.  If Mr Rigby, our put upon Computer Studies teacher is indeed still alive (his nickname was Rigamortis) then I hope he won’t give me a detention for what is presumably the world’s latest homework.  I’ve included the finished code and a short video of it in action below.

_1040123

MMC Solid State Drive

I’ve also received the MMC solid state disk drive that I ordered.  This great little device hooks up to the BBC’s user port and makes the transfer of files back and forth between the PC and BBC via SD cards relatively simple.

Currently the unit is dangling around on the end of its ribbon cable but it does come supplied with the parts needed to fit it inside the BBC’s case.  I have to make a decision however on whether I want to attempt to cut a whole in the case to allow card changes to be made without the need to open the old girl up.

Here is the final Yahtzee code, if you’re still out there Mr Rigby, let me know what you think and I’m sorry it’s late:-

 10 REM YAHTZEE BY RETROCOSM
 20 REM RETROCHALLENGE 2013 WINTER WARMUP
 30 REM DEFINE VARIABLES
 40 CONE=0:CTWO=0:CTHREE=0:CFOUR=0
 50 P=0:Q=0:SC=0:ST=0:Y=0:C=0
 60 JUMP=0:RSCORE=0:SORTED=0:ROUND=1
 70 DIM Q$(5):DIM A(5):DIM V(5):DIM D(5)
 80 IF RND(-TIME)
 90 REM START SCREEN
 100 CLS:MODE 7
 110 PRINT:PRINT:PRINT
 120 PRINTCHR$(141);CHR$(131)" YAHTZEE"
 130 PRINTCHR$(141);CHR$(130)" YAHTZEE"
 140 PRINT:PRINT:PRINT
 150 PRINTCHR$(132)" By Retrocosm.net"
 160 PRINT:PRINT:PRINT:PRINT
 170 PRINTCHR$(129)" Press Any Key"
 180 LET B$=GET$:IF B$="" THEN 150
 190 CLS
 200 PRINT:PRINT:PRINT
 210 PRINTCHR$(132)"Instructions(Y/N)"
 220 PRINT:PRINT
 230 LET A$=GET$
 240 IF A$="Y" THEN 2000
 250 IF A$<>"N" THEN 190
 260 CLS
 270 PRINT:PRINT
 280 PRINTCHR$(132)"Please Enter Your Name"
 290 PRINT:INPUT NAME$
 300 PRINT:PRINT"THANK YOU"
 310 CLS
 320 PRINTCHR$(141);CHR$(131)" YAHTZEE"
 330 PRINTCHR$(141);CHR$(130)" YAHTZEE"
 340 PRINTCHR$(141);CHR$(129)" ======="
 350 PRINTCHR$(141);CHR$(129)" ======="
 360 PRINT:PRINT:PRINT
 370 PRINTCHR$(132)"Player One Is ";CHR$(129);CHR$(136);NAME$
 380 PRINT:PRINT:PRINT
 390 PRINT CHR$(129)"Press Any Key To Play"
 400 LET B$=GET$:IF B$="" THEN 370
 500
 510
 520 PRINT:PRINT
 530 CLS
 540 REM RANDOMISE & PRINT DICE
 550 FOR L=0 TO 4
 560 PRINT TAB(L*8,3);CHR$(132)"ROLL"
 570 LET Z=INT(RND(1)*6)+1:LET V(L+1)=Z
 580 ON Z GOSUB 1000,1020,1040,1060,1080,1100
 590 PRINT TAB(L*8,10);CHR$(132)"DIE ";L+1
 595 PRINT TAB(0,1);CHR$(131)"Round ";ROUND
 600 NEXT L
 610 C=1
 620 FOR F=0 TO 4
 630 PRINT TAB(0,12);CHR$(129);"Hold Die ";F+1;" (Y/N) "
 640 LET A$=GET$
 650 IF A$="Y" THEN LET A(F+1)=1 ELSE A(F+1)=0
 660 IF A$="Y" THEN PRINT TAB(F*8,3);CHR$(129)"HOLD"
 670 IF A$="N" THEN PRINT TAB(F*8,3);CHR$(131)"ROLL"
 680 NEXT F
 690 PRINT TAB(0,12);CHR$(132);"Roll(R) Go Back(B) Finish(F)"
 700 LET C$=GET$
 710 IF C$="R" THEN 730
 715 IF C$="F" THEN C=2:GOTO 870
 720 IF C$="B" THEN 620 ELSE 690
 730 FOR F=1 TO 5
 740 LET Z=INT(RND(1)*6)+1
 750 IF A(F)=0 THEN LET V(F)=Z
 760 NEXT F
 770 CLS
 780 FOR L=0 TO 4
 785 PRINT TAB(0,1);CHR$(131)"Round ";ROUND
 790 PRINT TAB(L*8,3);CHR$(132)"ROLL"
 800 PRINT TAB(L*8,10);CHR$(132)"DIE ";L+1
 805 IF SORTED=1 THEN PRINT TAB(L*8,3);CHR$(132)" "
 810 ON V(L+1) GOSUB 1000,1020,1040,1060,1080,1100
 820 NEXT L
 830 IF C=2 THEN GOTO 860
 840 LET C=C+1
 850 GOTO 620
 860 IF SORTED=1 GOTO 920
 870 PRINT TAB(0,12);CHR$(129);"Any Key To Sort "
 880 LET A$=GET$
 890 REM SORT DICE
 900 PROCsort
 910 IF SORTED=1 GOTO 780
 920 PROCreadice
 930 PROCscores
 940 ROUND=ROUND+1
 950 IF ROUND=6 THEN GOTO 2310
 960 GOTO 520
 1000 PROCone
 1010 RETURN
 1020 PROCtwo
 1030 RETURN
 1040 PROCthree
 1050 RETURN
 1060 PROCfour
 1070 RETURN
 1080 PROCfive
 1090 RETURN
 1100 PROCsix
 1110 RETURN
 2000 REM SHOW INSTRUCTIONS
 2010 CLS
 2020 PRINT:PRINT:PRINT CHR$(129)"YAHTZEE INSTRUCTIONS"
 2030 PRINT:PRINT CHR$(131)"Yahtzee is a simulated dice throwing"
 2040 PRINT CHR$(131)"game for one player."
 2050 PRINT CHR$(131)"The player shakes his dice."
 2060 PRINT CHR$(131)"After shaking you may pick up any"
 2070 PRINT CHR$(131)"amount of the dice you wish and shake"
 2080 PRINT CHR$(131)"again until you are satisfied with"
 2090 PRINT CHR$(131)"your score.You may do this twice after"
 2100 PRINT CHR$(131)"your first shake."
 2110 PRINT:PRINT:PRINT CHR$(132)"Press Any Key"
 2120 LET B$=GET$:IF B$="" THEN 1130
 2130 CLS
 2140 PRINT:PRINT:PRINT CHR$(129)"YAHTZEE SCORING"
 2150 PRINT:PRINT CHR$(131)"Points are awarded for getting certain"
 2160 PRINT CHR$(131)"amounts and patterns on the dice."
 2170 PRINT CHR$(131)"For example runs, sets or pairs"
 2180 PRINT:PRINT:PRINT CHR$(132)"Press any key to play"
 2190 LET B$=GET$:IF B$="" THEN 2190
 2200 GOTO 260
 2300 REM PRINT FINAL SCORE
 2310 CLS:PRINT:PRINT CHR$(132);"Final Score"
 2320 PRINT:PRINT CHR$(129);"After 5 Goes You Have A Score Of";CHR$(136);RSCORE
 2330 PROCsound
 2340 PRINT:PRINT CHR$(131);"Play Again(Y/N)":PRINT
 2350 LET Y$=GET$
 2360 IF Y$="Y" THEN 2390
 2370 IF Y$<>"N" THEN 2300
 2380 GOTO 2410
 2390 RESTORE
 2400 RUN
 2410 CLS
 2420 PRINT:PRINT CHR$(131);"Goodbye, Thank You For Playing Yahtzee."
 2430 END
 4000 DEFPROCsound
 4100 SOUND 1,-15,97,10
 4200 SOUND 1,-15,105,10
 4300 SOUND 1,-15,89,10
 4400 SOUND 1,-15,41,10
 4500 SOUND 1,-15,69,20
 4600 ENDPROC
 5000 DEFPROCone
 5010 PRINT TAB(L*8,5);CHR$151;CHR$255;CHR$255;CHR$255;CHR$255;CHR$255;CHR$255;CHR$159
 5020 PRINT TAB(L*8,6);CHR$151;CHR$255;CHR$255;CHR$191;CHR$239;CHR$255;CHR$255;CHR$159
 5030 PRINT TAB(L*8,7);CHR$151;CHR$255;CHR$255;CHR$253;CHR$254;CHR$255;CHR$255;CHR$159
 5035 PRINT TAB(L*8,8);CHR$151;CHR$255;CHR$255;CHR$255;CHR$255;CHR$255;CHR$255;CHR$159
 5040 ENDPROC
 5050 DEFPROCtwo
 5060 PRINT TAB(L*8,5);CHR$151;CHR$255;CHR$255;CHR$255;CHR$255;CHR$191;CHR$239;CHR$159
 5070 PRINT TAB(L*8,6);CHR$151;CHR$255;CHR$255;CHR$255;CHR$255;CHR$253;CHR$254;CHR$159
 5080 PRINT TAB(L*8,7);CHR$151;CHR$191;CHR$239;CHR$255;CHR$255;CHR$255;CHR$255;CHR$159
 5085 PRINT TAB(L*8,8);CHR$151;CHR$253;CHR$254;CHR$255;CHR$255;CHR$255;CHR$255;CHR$159
 5090 ENDPROC
 5100 DEFPROCthree
 5110 PRINT TAB(L*8,5);CHR$151;CHR$255;CHR$255;CHR$255;CHR$255;CHR$191;CHR$239;CHR$159
 5120 PRINT TAB(L*8,6);CHR$151;CHR$255;CHR$255;CHR$191;CHR$239;CHR$253;CHR$254;CHR$159
 5130 PRINT TAB(L*8,7);CHR$151;CHR$191;CHR$239;CHR$253;CHR$254;CHR$255;CHR$255;CHR$159
 5135 PRINT TAB(L*8,8);CHR$151;CHR$253;CHR$254;CHR$255;CHR$255;CHR$255;CHR$255;CHR$159
 5140 ENDPROC
 5150 DEFPROCfour
 5160 PRINT TAB(L*8,5);CHR$151;CHR$191;CHR$239;CHR$255;CHR$255;CHR$191;CHR$239;CHR$159
 5170 PRINT TAB(L*8,6);CHR$151;CHR$253;CHR$254;CHR$255;CHR$255;CHR$253;CHR$254;CHR$159
 5180 PRINT TAB(L*8,7);CHR$151;CHR$191;CHR$239;CHR$255;CHR$255;CHR$191;CHR$239;CHR$159
 5185 PRINT TAB(L*8,8);CHR$151;CHR$253;CHR$254;CHR$255;CHR$255;CHR$253;CHR$254;CHR$159
 5190 ENDPROC
 5200 DEFPROCfive
 5210 PRINT TAB(L*8,5);CHR$151;CHR$191;CHR$239;CHR$255;CHR$255;CHR$191;CHR$239;CHR$159
 5220 PRINT TAB(L*8,6);CHR$151;CHR$253;CHR$254;CHR$191;CHR$239;CHR$253;CHR$254;CHR$159
 5230 PRINT TAB(L*8,7);CHR$151;CHR$191;CHR$239;CHR$253;CHR$254;CHR$191;CHR$239;CHR$159
 5235 PRINT TAB(L*8,8);CHR$151;CHR$253;CHR$254;CHR$255;CHR$255;CHR$253;CHR$254;CHR$159
 5240 ENDPROC
 5250 DEFPROCsix
 5260 PRINT TAB(L*8,5);CHR$151;CHR$191;CHR$239;CHR$255;CHR$255;CHR$191;CHR$239;CHR$159
 5270 PRINT TAB(L*8,6);CHR$151;CHR$189;CHR$238;CHR$255;CHR$255;CHR$189;CHR$238;CHR$159
 5280 PRINT TAB(L*8,7);CHR$151;CHR$189;CHR$238;CHR$255;CHR$255;CHR$189;CHR$238;CHR$159
 5285 PRINT TAB(L*8,8);CHR$151;CHR$253;CHR$254;CHR$255;CHR$255;CHR$253;CHR$254;CHR$159
 5290 ENDPROC
 6000 DEFPROCsort
 6010 FOR PASS=1 TO 5
 6020 FOR SORT=1 TO 4
 6030 ST=V(SORT+1)
 6040 IF V(SORT)<V(SORT+1) THEN ST=V(SORT)
 6050 IF V(SORT)<V(SORT+1) THEN V(SORT)=V(SORT+1)
 6060 V(SORT+1)=ST
 6070 NEXT SORT
 6080 NEXT PASS
 6090 SORTED=1
 6100 ENDPROC
 7000 DEFPROCreadice
 7010 CONE=0:CTWO=0:CTHREE=0:CFOUR=0
 7020 SORTED=0:JUMP=0
 7030 FOR I=1 TO 4
 7040 IF V(1)=V(I+1) THEN CONE=CONE+1 ELSE JUMP=(I+1)
 7050 IF JUMP>0 THEN I=4
 7060 REM
 7070 NEXT I
 7080 K=JUMP:JUMP=0
 7090 IF K>4 THEN GOTO 7260
 7100 FOR I=K TO 4
 7110 IF V(I)=V(I+1) THEN CTWO=CTWO+1 ELSE JUMP=(I+1)
 7120 IF JUMP>0 THEN I=4
 7130 REM
 7140 NEXT I
 7150 Q=JUMP:JUMP=0
 7160 IF Q>4 THEN GOTO 7260
 7170 FOR I=Q TO 4
 7180 IF V(I)=V(I+1) THEN CTHREE=CTHREE+1 ELSE JUMP=(I+1)
 7190 IF JUMP>0 THEN I=4
 7200 NEXT I
 7210 T=JUMP:JUMP=0
 7220 IF T>4 THEN GOTO 7260
 7230 FOR I=T TO 4
 7240 IF V(I)=V(I+1) THEN CFOUR=CFOUR+1 ELSE I=4
 7250 NEXT I
 7260 ENDPROC
 8000 DEFPROCscores
 8010 PRINT:PRINT
 8020 SC=0:CHK=CONE+CTWO+CTHREE+CFOUR
 8030 IF CONE=4 THEN SC=100:PRINTCHR$(129);"YAHTZEE! "
 8040 IF CONE=3 OR CTWO=3 THEN SC=75:PRINTCHR$(129);"FOUR OF A KIND "
 8050 IF CONE=2 AND CTWO=1 THEN SC=50:PRINTCHR$(129);"FULL HOUSE "
 8060 IF CONE=1 AND CTWO=2 THEN SC=50:PRINTCHR$(129);"FULL HOUSE "
 8070 IF CONE=2 AND CTWO=0 THEN SC=40:PRINTCHR$(129);"THREE OF A KIND "
 8080 IF CTWO=2 AND CONE<1 THEN SC=40:PRINTCHR$(129);"THREE OF A KIND "
 8090 IF CTHREE=2 THEN SC=40:PRINTCHR$(129);"THREE OF A KIND "
 8100 IF CONE=1 AND CTWO=1 THEN SC=30:PRINTCHR$(129);"TWO PAIRS "
 8110 IF CONE=1 AND CTHREE=1 THEN SC=30:PRINTCHR$(129);"TWO PAIRS "
 8120 IF CTWO=1 AND CTHREE=1 THEN SC=30:PRINTCHR$(129);"TWO PAIRS "
 8130 IF CHK=1 THEN SC=20:PRINTCHR$(129);"ONE PAIR "
 8140 IF CHK=0 AND V(1)=6 AND V(5)=2 THEN SC=30:PRINTCHR$(129);"HIGH RUN "
 8150 IF CHK=0 AND V(1)=5 AND V(5)=1 THEN SC=30:PRINTCHR$(129);"LOW RUN "
 8160 IF SC=0 PRINTCHR$(129);"NO SCORE "
 8170 PRINT:PRINTCHR$(131);"SCORE ";CHR$(136);SC:PRINT
 8180 RSCORE=RSCORE+SC
 8190 PRINTCHR$(132);"Running Score ";RSCORE
 8200 PRINT:PRINTCHR$(129);"Any Key To Continue"
 8210 LET B$=GET$:IF B$="" THEN 8210
 8220 CONE=0:CTWO=0:CTHREE=0:CFOUR=0
 8230 ENDPROC

@Retrochallenge – 28 Years Later

January 23, 2013 5 comments

Yahtzee Listing

Remember those halcyon days when you used to cycle excitedly to the local newsagent for the latest copy of your favourite computer magazine, rush home and spend three hours typing in a BASIC listing, fail to save it and then watch as your computer crashed due to an errant semi colon.

It's Been 28 Years

It’s Been 28 Years

Well I remember it especially vividly given that yesterday I spent an hour or so typing Yahtzee into my BBC Master.  That’s right, I took one for the team.  Unable to successfully transfer the code I’d worked on whilst waiting for the Master to arrive I opted for the manual option.

Jokes aside it was actually quite a pleasant experience.  The BBC keyboard is very responsive and the screen was actually pretty easy on my eyes (remembers hours playing M.U.D. on a C64 hooked up to a TV and the subsequent migraines.)

Of course editing the code is a tad more laborious on the BBC than with a modern editor but nevertheless I’ve continued to make improvements, mostly aesthetic.  I’ve banished the garish red dice and gone for more subtle black and white in a slightly less in your face graphics mode so everything’s a bit smaller.

Scores At Last

Scores At Last

I’ve also numbered the dice so it’s more obvious which ones you’re holding, realigned some of the text and cleared out a few other redundant lines of code.

I’ve also been looking at the possibility of using the Mode 7 – Teletext mode to render the dice.  I found a good resource here that covers Mode 7 and the Sixel graphical elements.  Incidentally Ceefax, the BBC’s text information service, introduced in 1974 was finally retired on the 23rd of October 2012 when the last remaining analogue TV symbol in the UK was switched off in Northern Ireland in favour of digital broadcasts.

Old & New

Old & New

When running Yahtzee on the actual Beeb rather than the emulator the previously reported issue with the lack of randomness of the dice throws has resolved itself.

Presumably the random number generator is now being correctly seeded and is as random as such computer generated things can be.

@Retrochallenge – Kinda Working

January 20, 2013 1 comment

yahtzee1

I knew it would be a mistake to get involved in any sort of coding project alongside Urbancamo.  He released his flash new code in about 3 seconds flat while I was still trying to work out what my original variables do, and apparently for quite a few of them that’s absolutely nothing.

Still I think I’ve almost completely debugged Yahtzee now (see below), removed all unnecessary code and generally cleaned things up a bit.  I’ve been using Textedit on the Mac and copy and pasting it into BeebEm for testing.  Hopefully this coming week I’ll be able to transfer it over to the Master and run and edit it on a real machine.

I don’t think my approach to coding has changed a great deal since I was fifteen, it’s an interesting approach if nothing else.  Perhaps most importantly it works, although I have the distinct impression that I rely on five lines of code where someone who knew what they were doing would achieve the same result in one.

I’ve written a couple of new procedures, one to sort the dice and one to score the player’s final throw.  The scoring system is currently my own invention, if time permits I shall try to achieve something closer to the original game.

There is currently one fatal and moderately hilarious flaw to the program, specifically that the random number generator generates the same numbers every game.  Therefore whenever you load and run a new game you will always roll the same dice.  Bit of an issue really in a dice rolling game.

I don’t know at this stage whether the bug is in my code or in the way the BBC generates random numbers, the former seems more likely although I can’t for the life of me find it.  Further investigation is clearly required.

Here’s the code as it stands now, you can copy and paste it directly into BeebEm and it should run:-

10 REM YAHTZEE BY RETROCOSM
20 REM RETROCHALLENGE WINTER WARMUP 2013
30 REM DEFINE VARIABLES
40 CONE=0:CTWO=0:CTHREE=0:CFOUR=0
50 P=0:Q=0:SC=0:ST=0:Y=0:C=0
60 JUMP=0:RSCORE=0:SORTED=0
70 DIM Q$(5):DIM A(5):DIM V(5):DIM D(5)
80
90 REM START SCREEN
100 CLS:MODE 7
110 PRINT:PRINT:PRINT
120 PRINTCHR$(141)" àÇYAHTZEE"
130 PRINTCHR$(141)" àÜYAHTZEE"
140 PRINT:PRINT:PRINT
150 PRINT" ÅBy Retrocosm"
160 PRINT:PRINT:PRINT:PRINT
170 PRINT" ÉPRESS ANY KEY"
180 LET B$=GET$:IF B$="" THEN 150
190 CLS
200 PRINT:PRINT:PRINT
210 PRINT"ÉINSTRUCTIONS(Y/N)"
220 PRINT:PRINT
230 INPUT A$
240 IF A$="Y" THEN 2000
250 IF A$<>"N" THEN 190
260 CLS
270 PRINT:PRINT
280 PRINT"ÑPLEASE ENTER YOUR NAME"
290 INPUT NAME$
300 PRINT:PRINT"ÅTHANKYOU"
310 CLS
320 PRINTCHR$(141);" ÖYAHTZEE"
330 PRINTCHR$(141);" ÇYAHTZEE"
340 PRINTCHR$(141);" Å======="
350 PRINTCHR$(141);" É======="
360 PRINT:PRINT:PRINT
370 PRINT"ÅPLAYER ONE IS ";NAME$
380 PRINT:PRINT:PRINT
390 PRINT"ÜPress any key to play"
400 LET B$=GET$:IF B$=""THEN 370
500 CLS:MODE 17:COLOUR 3
510
520 PRINT:PRINT
530 CLS
540 PROCcubes
600 REM Randomise Cubes
610 FOR L=1 TO 5
620 LET Z=INT(RND(1)*6)+1:LET V(L)=Z
630 ON Z GOSUB 1000,1020,1040,1060,1080,1100
640 PRINT
650 NEXT L
660 C=1:REM counter
670 FOR F=1 TO 5
680 PRINT TAB(0,25);"HOLD DIE ";F
690 INPUT A$
700 IF A$="Y" THEN LET A(F)=1
710 IF A$<>"Y" THEN LET A(F)=0
720 NEXT F
730 FOR F=1 TO 5
740 LET Z=INT(RND(1)*6)+1
750 IF A(F)=0 THEN LET V(F)=Z
760 NEXT F
780 CLS
790 FOR F=1 TO 5
800 PRINT
810 ON V(F) GOSUB 1000,1020,1040,1060,1080,1100
820 NEXT F
830 IF C=2 THEN GOTO 860
840 LET C=C+1
850 GOTO 670
860 IF SORTED=1 GOTO 920
870 PRINT TAB(0,25);"Any Key To Sort"
880 INPUT X
890 REM Sort Dice
900 PROCsort
910 IF SORTED=1 GOTO 780
920 PROCreadice
930 PROCscores
940 V=V+1
950 IF V=5 THEN GOTO 2310
960 GOTO 520
1000 PROCone
1010 RETURN
1020 PROCtwo
1030 RETURN
1040 PROCthree
1050 RETURN
1060 PROCfour
1070 RETURN
1080 PROCfive
1090 RETURN
1100 PROCsix
1110 RETURN
2000 REM SHOW INSTRUCTIONS
2010 CLS:MODE 7
2020 PRINT:PRINT:PRINT"ÅYAHTZEE INSTRUCTIONS"
2030 PRINT:PRINT"ÉYahtzee is a simulated dice throwing"
2040 PRINT"Égame for one player."
2050 PRINT"ÉThe player shakes his dice."
2060 PRINT"ÉAfter shaking you may pick up any"
2070 PRINT"Éamount of the dice you wish and shake"
2080 PRINT"Éagain until you are satisfied with"
2090 PRINT"Éyour score.You may do this twice after"
2100 PRINT"Éyour first shake."
2110 PRINT:PRINT:PRINT"ÑPRESS ANY KEY"
2120 LET B$=GET$:IF B$="" THEN 1130
2130 CLS
2140 PRINT:PRINT:PRINT"ÅYAHTZEE SCORING"
2150 PRINT:PRINT"ÉPoints are awarded for getting certain"
2160 PRINT"Éamounts and patterns on the dice."
2170 PRINT"ÉFor example Runs,Sets and Pairs"
2180 PRINT:PRINT:PRINT"ÑPress any key to play"
2190 LET B$=GET$:IF B$="" THEN 2190
2200 GOTO 260
2300 REM PRINT FINAL SCORE
2310 MODE 7:CLS:PRINT"ÅSCORES"
2320 PRINT:PRINT"ÉAfter 5 goes you have a score of ";RSCORE
2330 PROCsound
2340 PRINT:PRINT"ÑPlay Again(Y/N)":PRINT
2350 INPUT Y$
2360 IF Y$="Y" THEN 2390
2370 IF Y$<>"N" THEN 2300
2380 GOTO 2410
2390 RESTORE
2400 RUN
2410 CLS:MODE 7
2420 PRINT:PRINT"ÅGoodbye, thank you for playing."
2430 END
3000 DEFPROCcubes
3100 VDU 23,224,255,255,255,255,255,255,255,255
3200 VDU 23,225,255,255,231,195,195,231,255,255
3300 ENDPROC
4000 DEFPROCsound
4100 SOUND 1,-15,97,10
4200 SOUND 1,-15,105,10
4300 SOUND 1,-15,89,10
4400 SOUND 1,-15,41,10
4500 SOUND 1,-15,69,20
4600 ENDPROC
5000 DEFPROCone
5010 PRINTCHR$(224);CHR$(224);CHR$(224)
5020 PRINTCHR$(224);CHR$(225);CHR$(224)
5030 PRINTCHR$(224);CHR$(224);CHR$(224)
5040 ENDPROC
5050 DEFPROCtwo
5060 PRINTCHR$(225);CHR$(224);CHR$(224)
5070 PRINTCHR$(224);CHR$(224);CHR$(224)
5080 PRINTCHR$(224);CHR$(224);CHR$(225)
5090 ENDPROC
5100 DEFPROCthree
5110 PRINTCHR$(225);CHR$(224);CHR$(224)
5120 PRINTCHR$(224);CHR$(225);CHR$(224)
5130 PRINTCHR$(224);CHR$(224);CHR$(225)
5140 ENDPROC
5150 DEFPROCfour
5160 PRINTCHR$(225);CHR$(224);CHR$(225)
5170 PRINTCHR$(224);CHR$(224);CHR$(224)
5180 PRINTCHR$(225);CHR$(224);CHR$(225)
5190 ENDPROC
5200 DEFPROCfive
5210 PRINTCHR$(225);CHR$(224);CHR$(225)
5220 PRINTCHR$(224);CHR$(225);CHR$(224)
5230 PRINTCHR$(225);CHR$(224);CHR$(225)
5240 ENDPROC
5250 DEFPROCsix
5260 PRINTCHR$(225);CHR$(224);CHR$(225)
5270 PRINTCHR$(225);CHR$(224);CHR$(225)
5280 PRINTCHR$(225);CHR$(224);CHR$(225)
5290 ENDPROC
6000 DEFPROCsort
6010 FOR PASS=1 TO 5
6020 FOR SORT=1 TO 4
6030 ST=V(SORT+1)
6040 IF V(SORT)<V(SORT+1) THEN ST=V(SORT)
6050 IF V(SORT)<V(SORT+1) THEN V(SORT)=V(SORT+1)
6060 V(SORT+1)=ST
6070 NEXT SORT
6080 NEXT PASS
6090 SORTED=1
6100 ENDPROC
7000 DEFPROCreadice
7010 CONE=0:CTWO=0:CTHREE=0:CFOUR=0
7020 SORTED=0:JUMP=0
7030 FOR I=1 TO 4
7040 IF V(1)=V(I+1) THEN CONE=CONE+1 ELSE JUMP=(I+1)
7050 IF JUMP>0 THEN I=4
7060
7070 NEXT I
7080 K=JUMP:JUMP=0
7090 IF K>4 THEN GOTO 7260
7100 FOR I=K TO 4
7110 IF V(I)=V(I+1) THEN CTWO=CTWO+1 ELSE JUMP=(I+1)
7120 IF JUMP>0 THEN I=4
7130
7140 NEXT I
7150 Q=JUMP:JUMP=0
7160 IF Q>4 THEN GOTO 7260
7170 FOR I=Q TO 4
7180 IF V(I)=V(I+1) THEN CTHREE=CTHREE+1 ELSE JUMP=(I+1)
7190 IF JUMP>0 THEN I=4
7200 NEXT I
7210 T=JUMP:JUMP=0
7220 IF T>4 THEN GOTO 7260
7230 FOR I=T TO 4
7240 IF V(I)=V(I+1) THEN CFOUR=CFOUR+1 ELSE I=4
7250 NEXT I
7260 ENDPROC
8000 DEFPROCscores
8010 PRINT
8020 SC=0:CHK=CONE+CTWO+CTHREE+CFOUR
8030 IF CONE=4 THEN SC=100:PRINT"YAHTZEE"
8040 IF CONE=3 OR CTWO=3 THEN SC=75:PRINT"FOUR OF A KIND!"
8050 IF CONE=2 AND CTWO=1 THEN SC=50:PRINT"FULL HOUSE!"
8060 IF CONE=1 AND CTWO=2 THEN SC=50:PRINT"FULL HOUSE!"
8070 IF CONE=2 AND CTWO=0 THEN SC=40:PRINT"THREE OF A KIND"
8080 IF CTWO=2 AND CONE<1 THEN SC=40:PRINT"THREE OF A KIND"
8090 IF CTHREE=2 THEN SC=40:PRINT"THREE OF A KIND"
8100 IF CONE=1 AND CTWO=1 THEN SC=30:PRINT"TWO PAIRS"
8110 IF CONE=1 AND CTHREE=1 THEN SC=30:PRINT"TWO PAIRS"
8120 IF CTWO=1 AND CTHREE=1 THEN SC=30:PRINT"TWO PAIRS"
8130 IF CHK=1 THEN SC=20:PRINT"ONE PAIR"
8140 IF CHK=0 AND V(1)=6 AND V(5)=2 THEN SC=30:PRINT"HIGH RUN"
8150 IF CHK=0 AND V(1)=5 AND V(5)=1 THEN SC=30:PRINT"LOW RUN"
8160 IF SC=0 PRINT"No Score"
8170 PRINT:PRINT"Score-";SC:PRINT
8180 RSCORE=RSCORE+SC
8190 PRINT"Running Score-";RSCORE
8200 PRINT:PRINT"Any Key To Continue"
8210 LET B$=GET$:IF B$="" THEN 8210
8220 CONE=0:CTWO=0:CTHREE=0:CFOUR=0
8230 ENDPROC

@Retrochallenge – Heath Robinson

January 18, 2013 Leave a comment
CMOS Battery Pack

CMOS Battery Pack

I switched on the BBC Master this morning and was again greeted by the ‘This is not a language’ error.  I’d pretty much fully expected it given that I’d already assumed the CMOS battery pack was dead.

I opened the old girl up and located the pack.  Fortunately although it had leaked it was positioned such that it hadn’t caused any damage.

I don’t know whether it’s the original pack, it’s certainly pretty old, you don’t see Vidor (‘They last about a month longer’) batteries any more.  In fact you don’t see much that’s made in Britain any more but that’s another story.

There are several easily found guides to building a new pack.  I found this one to be very good.  It explains clearly that a resistor and diode are required within the assembly to inhibit the charging circuit intended for the Lithium cells that were originally fitted, also suggesting that my pack was indeed a replacement.

Leaking Batteries

Leaking Batteries

I’m learning quite quickly that there’s an impressive and very active community attached to the BBC and other Acorn models.

My wallet is also slightly concerned by the amount of mods that are available, I fear my Master will soon be sporting some interesting additions.

Hopefully aforementioned community won’t see the rather Heath Robinson replacement battery pack that I hacked together.  Short of parts to build a proper one and aware of the limited time left in this year’s Winter Warmup I’m afraid I resorted to copious amounts of insulating tape and reuse of the original resistor/diode assembly.

Quality Engineering

Quality Engineering

I include an image here for entertainment purposes only.  It works and will see me through the next few days until I can put something a little more professional together.

Of course all this diversionary stuff means I haven’t added any code to Yahtzee and I’m wondering whether subconsciously that’s kind of intentional.

Thanks also to other Retrochallenge participant Andrew Hazelden for pointing out that the formatting in the code I’d previously listed had gone awry.  This in turn led me to discover that there’s a WordPress shortcode you can wrap around code to preserve its formatting.

The original post has been duly amended.

Follow

Get every new post delivered to your Inbox.

Join 60 other followers