Tuesday 16 April 2024

THEC64 is currently unavailable in the UK

The popular THEC64 Classic edition, with its working keyboard, is reported as unavailable in the UK and North America

I have pondered the future of THEC64 platform, especially with Retro Games Ltd (RGL) being behind this modern days Commodore C64 clone, along with THEA500 Mini (Amiga-based) and THE400 Mini (Atari 400/800/XE/XL based) consoles. The latter is competing in what I see as the same space as THEC64. Thankfully, THEC64 Mini is still readily available, and you may find new units in the UK for under £40.00p. So, what is going on?

My conjecture on this is that THEC64 classic is no longer economically viable to produce. Inflation has devalued the British Pound Sterling and US Dollar, with THEC64 typically retailing at around £119.99p - £129.99p, whereas THEA500 Mini's initial retail price point was £119.99p, and THE400 Mini is a penny shy of £100. We know that the world is fraught with dangers now, and some would argue on the verge of another World War, and that has increased shipping costs. All models of THEC64 (along with all of RGL's products) are manufactured in China, and for us in what is called "the West", our Governments have been somewhat hostile, or let's say unfriendly to the one place that we've exported nearly all of our manufacturing to. Not a great plan, one might say.

In my view, THEC64, or more specifically, THEC64 with the latest firmware, is very good value at its typical price point when compared to the other machines from RGL; for about the same price as THEA500 Mini (at least when THEA500 Mini is not discounted), you get essentially a fully working computer that mimics and emulates not just the famous C64, but also the VIC-20, and one that may boot straight to classic mode just like a real C64 or VIC-20. It has 64 built in games, which were nearly all pretty well recieved from the computer press of the 1980s and early 1990s, and more free games when upgraded, and it includes a much improved microswitched joystick that to me feels authentic.

But if you can put up with a non-working keyboard, or providing your own keyboard, and you have a better solution to THEJoystick included with THEC64 Mini, then THEC64 Mini is a steal at the moment. I regularly see it online and in Game stores retailing at under £40.00p. So what you have a keyboard that isn't correctly mapped? And who cares about playing VIC-20 games anyway? We all know that the C64 is where it's at, right? So, for the time being, and I would say the foreseeable future, if you want THEC64 then it's a Mini you'll have to purchase. Although, I don't know the availability of the Mini in North America, but it's certainly available in Europe.

Wednesday 3 April 2024

Some context to my time at Retro Gamer magazine

In issue 257, Shaun Bebbington answered some questions about his time at Retro Gamer magazine

Retro Gamer is for me a long way in the past now. One may be wondering how come I've stopped writing for RG? It may seem to some people that (when I stopped writing for RG) I was trying to diss other people's work and big up my own. That was Chris Boyo's opinion anyway back around 2006 or so, when I was no longer being published by the then Imagine Publishing printed matter periodical.

For those of you who have procured issue 257 of the aforementioned publication, you may have enjoyed the look back at the history of said magazine, and likely skimmed over the Q&A which features yours truly. In any case, it was truncated from my original answers, which were sent to me via email to answer at my leisure (except for the deadline). I guess the old saying that behind every good writer is a great editor shines true here. Either Martyn Carroll (who sent me the questions to answer), or Darran Jones (who is the current editor of Retro Gamer) cut out a lot of the guff, primarily for space but to better fit into the feature, which is presented in an A5 sized booklet.

I thought I'd publish here the full unedited Q&A (including my usual typos and grammatical mistakes) as it may be of interest to you, dear reader, or provide more context. So, without further ado, here is Martyn's questions and my not so sequent answers.

  1. Can you sum up what it was like working on Retro Gamer as a staff writer?

    Shaun Bebbington: Retro Gamer was my first office job and I didn’t go to University as, I suspect, many or most of the people at Live Publishing did. There were things that I didn’t know about nor how to do. Office politics is one thing that I didn’t know about, and triangulating one’s sources was something that I didn’t know how to do, as two examples.

    It was pretty good at the start, though I didn’t and still don’t drive, so getting to a place called Adlington in Cheshire wasn’t so easy as there was no direct public transportation route from Crewe. I somehow made it work in the beginning, but as Matt Mabe lived in Sandbach, and he was kind enough to pick me up from Sandbach station which simplified the journey.

    Things started to go down hill quickly as I was out of my depth. I wasn't a gamer. Not really. I was much more interested in hardware and non-entertainment software, and had a passing interest in programming, but people were still making software for many of the 8-bit machines that I loved and grew up with, so I wanted to write about those new games.

    Although I was only there for nine months, and most people don’t know that I contributed anything to Retro Gamer, I have had a small but significant influence on the magazine and I think retro gaming in general in this sense: that people now take new software for these antiquated 8-bit machines much more seriously, especially entertainment software.

  2. Which of your features are you most proud of?

    SB: Due to the back story and insane deadline, working full time for Social Services and breaking the limitations of Windows Notepad on my Windows 98SE PC, it is the feature in issue two about Commodore computers and the companies history.

    I was asked to write 10 pages, more than I’ve ever written before or since for any publication, and I was paid £500 for it, more than I’ve been paid for any freelance before or since. Martyn gave me a deadline of several weeks. This became two weeks as Retro Gamer issue one had done really well, and the intended quarterly publication was going monthly because no one knew how much money you could make from retro gaming nerds I guess. This was an all waking hours job, and some of the work had to be re-written because Notepad couldn’t save that many characters and I didn’t realise its limitations. I had to start using Microsoft WordPad to finish the feature, and I discovered something called "Rich Text Format" too. It was very lucky that I had already been reading up about the history of Commodore Computers for a number of years before hand, otherwise I wouldn’t have made that insane deadline at all.

  3. What's your favourite anecdote from your time on the mag?

    SB: The brightest pub in the world was not far from the office. This pub was so bright that the owners thought it was necessary to have all of the lights switched on even on the most sunny of sunny days. We’d often go for a quick half and some food, and Dan Whitehead was about the funniest person in the company. So no specific stories, just some good memories.

    Tony was another funny guy, but lacked the intelligence of Dan, so he didn’t know it. He was a bit of an alpha male as I remember, and would say some random nonsense to make himself look good, and he didn’t seem to know what he was talking about much of the time. I was unorganised, but him trying to organise anything was something to watch. He also got his 15 minutes of fame by being interviewed on some Satellite TV show or something about the magazine. I wisely stayed out of the way as I probably would have said all of the wrong things.

  4. What are your thoughts on RG still in print 20 years on?

    SB: It’s pretty amazing - even to me - that there are still printed matter computering magazines in 2024, but I guess if you are a retro gamer, you don’t want to be reading PDFs or something, you want a physical periodical that informs and delights in equal measures. Retro Gamer must be doing some of that.

  5. Finally, no-one believes me, so can you confirm to readers that a lot of your in-house features were indeed written on a Commodore 128?

    SB: Of course. I had a Commodore 128, with GEOS, well it was the Click Here Software’s Wheels upgrade, a CMD FD-2000 and Commodore 1581 disk drive. Oh, and a CMD RAMLink and SuperCPU. Because of Commodore’s over-engineered way its computers would talk to its disk drive, and read from/write to the disk media (a legacy of Chuck Peddle from the Commodore PET), it meant that a Commodore C64, or even a VIC-20 could read and write MS-Dos formatted 3.5” disks. I could write my articles on a VIC-20 if I wanted to, and yes there would have been a simple word processor to do that. In fact I think I still have a VIC-20 word processor.

    Clearly the C128, with its 80 columns screen and fast serial bus, along with some GEOS tools like geoDos, meant that I could write my articles in geoWrite and transfer them to my PC, and back again. And despite the comments at the time, GEOS did have a spell checker. What caught me out, and again this shows how out of my depth I was, was that I trusted the Windows spell check without proofing my own work. I had no strategies to proof my own work then, something which took me some time to learn how to do. As I recall, Andre Baune’s name was "corrected" by Microsoft’s spell checker to Buchane. I made a lot of junior mistakes like that back then, much to Martyn's frustration I suspect. Thankfully, I'm not a writer anymore, nor have any aspirations to be one again.

As a side note, some of the above answers were interspersed with a conversation I had with Martyn via Facebook Messenger when finally published in RG (I will not be publishing said conversation). In the Messenger conversation, I provided some context around who made RG a success. I know, because I was there, that it was Martyn and Matt Mabe (Art Editor) who were driving the magazine. I, like all of the freelancers, were just along for the ride, even though many people, including many of the freelancers, tried to claim RG as their own, and tried to say it was because of them that the magazine was a success.

One might notice in this Q&A that I didn't have a lot to say to this question "What are your thoughts on RG still in print 20 years on?" I don't often think about the magazine, nor that time in my life. The only real thing of substance I had to say is that I think printed matter computer magazines shouldn't exist in 2024.

I have held the assumption that RG isn't the sort of magazine that would interest someone like me, and I haven't purchased an issue, until 257 at least, for many years. And reading through issue 257 to some degree, I know now that it isn't a magazine for me at all. It is reflective of its readership, so I suspect that it had a very different reader 18 or 20 years ago than now. Not that I'm trying to diss RG to big up my own work of course. As for a magazine (or in this case a fanzine) I would 100% recommend, it has to be FREEZE64 available at freeze64.com.

Finally, more keen eyed readers may know that, although I have no aspirations to be a writer again, I have been published since 2020 in Popular Retro; this wasn't to kick start a career in writing, but simply as a favour to Retro Games Ltd and to other people who have helped me out over the years. I may be published again, but only on that basis, or as one may have guessed, the occasional blog post here.

Thursday 11 January 2024

THE400 Mini - The Atari 400 platform recreated. My initial thoughts.

Retro Games Ltd (RGL) have partnered with PLAION to bring the wonderful world of the Atari 400, 800, 5200 and XE/XL range to life in a now famous mini form factor. THE400 Mini using modern days connections like HDMI and USB, will soon be available (and may be pre-ordered now) in "console" form.

The famous Atari 400, along with its "more serious" and compatible 800 model, were initially announced in December 1978 by Atari to follow up on its successful 2600 Video Computer System. It offered many advanced features for a personal computer of that era, and eventually launched to retail in October 1979. Until then, Commodore, Apple and Radio Shack had been slogging it out for dominance in this fast growing personal computer market. Atari entering this fight was significant, and the 400 model was pretty formidable, especially when it came to computer graphics.

Offering high resolution graphics of up to 320 x 192 pixels, utilising hardware sprites, and having a palette of 128 colours, all through a standard television set, meant that this computer was going to be good for playing video games. And its 40 x 24 character display made it equally good for the applications of the day. Being powered by the popular 6502 Central Processing Unit (CPU) at 1.8Mhz, which [in raw Mhz] was faster than both Commodore's and Apple's offerings (I won't compare this to the Radio Shack's TRS-80 as comparing a 6502-based processor to a Z80-based processor is folly). From 1980 through to around 1986, the Atari 8-bit computer range had some seriously good entertainment software produced for it, by then upcoming and staple video game developers like Activision, Epyx, Datasoft, and Atari itself.

From around 1986, the Atari 8-bit personal computer platform began to fade, even with improvements made to the compatible XE and XL range, which could display 256 colours and had a few more graphics modes. Commodore, with its C64, largely won the home computer war, and this model wouldn't die until around 1992. Remember that the C64 competed against (in many ways) more technically capable machines like the Commodore Amiga or Atari ST for over half of its commercial life. To still be a relevant in 1990 was quite a feat.

What I find most interesting about the announcement of THE400 Mini is its price point. And I'm taking nothing away from its perfect replica form factor.

THE400 Mini will be pre-loaded with 25 licensed games, and will provide a way to load your own legally purchased or public domain software by "side-loading" tape, disk or cartridge images. Knowing RGL as I do, I'm certain that it will support THE400 through firmware updates based on user feedback, so you will be able to buy with some confidence. I note that other "Mini" console producers do not offer this. Releasing a new firmware update is timely and costly, and provides RGL with no additional revenue.

I think the promised feature to "rewind" your gameplay by up to 40 seconds is interesting, and I guess this may be more convenient than the "saved game states" on THEC64 or THEA500 Mini. It is the price point of £99.99 that I think makes THEC64 Mini and even THEC64 Classic, or THEVIC20 (if you can find one) look very good value indeed.

THEC64 Mini launched at £69.99, and included 64 licensed games. It has since had several firmware updates, adding more games of varying quality to the carousel. Like THE400, THEC64 allows you to side-load any tape, disk, or cartridge images of software that you own. It includes one joystick and all the necessary cables to get you started. Although some will say that the joystick included with THEC64 Mini wasn't good quality, the joystick included with THE400 won't be worth £30 more. So, THE400 has more USB ports, but THEC64 Mini can use a cheap USB extender. One thing I don't know is if THE400 will include a decent USB power adapter, but looking at both THEC64 Mini and THEA500 Mini, it is likely that it will not, though it may require lower power consumption and/or not run so hot as some versions of THEC64 Mini.

THEC64 Classic and THEVIC20 launched at £119.99 (some sources say £109.99), which included an improved joystick (especially on THEVIC20), with a fully working and correctly mapped keyboard, more USB ports and a USB power adapter, and all of the necessary cables to get you started. All firmware updates to THEC64 Mini also work on THEC64 Classic, and THEVIC20. So, you legally have over 64 games if you have the latest firmware version, and many good features that some C64 fans will love, like being able to emulate the Commodore Ram Expansion Unit (REU), or the ability to play four-player adapter games, like Bomb Mania, from Protovision.

Aside from entertainment software, you have much more choice of other types of software too. I could write many pages just about the GEOS operating system, which by itself had all kinds of productivity, utilities and so on. The Commodore C64's library of games alone certainly exceeds the cumulative totals of all models of the Atari 8-bit personal computer range. And THEC64 Classic can also play VIC-20 games too. A lazy estimate is that owners or THEC64 Classic and THEVIC20 will have at least 10,000 software titles to pick from. As you might have guessed, these are not that difficult to find these days, and even after the commercial demise of the C64, there has still been lots of software released for it considering that it was a commercially dead platform for at least 15 years after 1992.

Could this therefore be a sign that THEC64 platform is about to be discontinued? Or will hard-nosed consumers simply make a cold decision that, because many games on the Atari 400/800/XE/XL had comparable versions on either the C64 or the VIC-20, or both, that THEC64 Classic or Mini is simply better value? If the latter is the case, this may mean that THEC64 has, at least, another year at retail in it.

All of this means, at least to me, that THE400's success is in the balance, although I'm sure that many people will be pre-ordering this right now. RGL already have a product that will fit many gamers who were around from ~1981 through to the early 1990s - or those people who don't want to mess around with a Raspberry Pi and spend time configuring it with this or that emulator. The Atari 400/800/XE/XL was only a significant player for about half the 1980s, with the 5200 model only really a footnote in all of this. The VIC-20 was significant from 1980-1984, and the C64 from 1982 through to the end of that decade. But is the Atari name enough to carry this new product? And will it at least sell as well as THEC64 Mini when you are paying more to get less? Time will tell.

A side note to this is that it kind of reminds me of when Commodore launched its Plus/4 model in 1984: the Plus/4 was too similar to the C64 in many ways but without a better sound chip, and although it could display more colours, it could not do hardware sprites like the C64, and did not use the most common joystick type. Okay, so the Plus/4 was meant for a different market, to compete at the low end with the Sinclair/Timex machines, but somehow it ended up launching at $299USD. By the time of its launch, the C64 was certainly no more expensive than this, and had already started to have a second user market, and had a vaster software library. It all sounds too familar.

But all of this said, I'll probably be purchasing THE400 Mini myself because it looks like a lovingly created Mini console with a beautiful aesthetic. Because I guess a fool and his money really is easily parted.

Edited by Mike Mee. Many thanks for your help Mike.

Monday 13 March 2023

Learning Assembly and Hello World.

Hello World takes 30 lines of assembly?

Recently, I saw a programming meme on the BookFace so-called Social Media platform. It read "Ok ima Learn Assembly [sic] Damn Hello World is 30 lines" with an accompanying boxer first ready to fight, and then the said boxer taking a break with a water bottle.

Cards on the table, I am not a professional in any assembly language. I would say that I am most knowledgeable in Z80, and know enough in 6502 and MIPs to get by. And because I've not done any Z80 for a while (nor any other assembly for that matter), I'm a bit rusty with it. But I couldn't think how in Z80, or in 6502, or in MIPs, a Hello World program would take 30 lines of assembly. It may take 30 bytes, or words, but that's not the same. If you were learning assembly, you wouldn't be entering a program byte by byte (or word by word). That wasn't even a good idea 35 years ago.

So sure was I about this that I posted an example in 6502 with the target platform being the Commodore C64. My first try, although flawed, was 7 lines of assembly and 12 bytes of data. Whilst it worked fine to output 'HELLO WORLD' to the C64 screen (at 1024), it had a flaw that I didn't realise (as I didn't test the code before I posted it). It was only after testing that I realised the mistake, and posted a follow up which corrected my initial bug.

Some notes before I continue. For this example, I am using an online assembler found at nurpax.github.io/c64jasm-browser but other assemblers are available; if you want to try these examples on real hardware then I would recommend Turbo Macro Pro - some examples of how to use this are shown on Robin Harbron's excellent 8 Bit Show and Tell Youtube channel here. I recommend Robin's tutorials as he goes in to way more depth than I will be here.

Let's start from the dumbest example and work through it. In doing so, we may discover the elusive 30 lines of code issue highlighted by the meme.

* = $c000 ; Start address, call with
          ; SYS 49152 from C64 BASIC
    lda #$48 ; 'H'
    jsr $ffd2 ; Kernal CHROUT call
    lda #$45 ; 'E'
    jsr $ffd2
    lda #$4c ; 'L'
    jsr $ffd3
    lda #$4c ; 'L'
    jsr $ffd2
    lda #$4f ; 'O'
    jsr $ffd2
    lda #$20 ; ' '
    jsr $ffd2
    lda #$57 ; 'W'
    jsr $ffd2
    lda #$4f ; 'O'
    jsr $ffd2
    lda #$52 ; 'R'
    jsr $ffd2
    lda #$4c ; 'L'
    jsr $ffd2
    lda #$44 ; 'D'
    jsr $ffd2
    rts
  

As already stated, this is a dumb example, and we get to 24 lines.

It is using the C64 Kernal to output each character to the screen, so whilst this has some advantages, in that when you call this with SYS 49152 it will output from the next cursor position, and your code returns you back to BASIC cleanly on the rts instruction, it isn't necessarily the best way to do things. As an aside, this will also work on other Commodore machines, certainly the VIC-20 and C128 in native mode, and probably all other Commodore 8-bits including the PET as long as you relocate the code to somewhere where there is free memory available to store it.

Using the Kernal may be slower than handling things yourself, and using the CHROUT in particular means that you cannot easily write to the whole screen, as when you get to the last screen position (on the C64 this is 2023, or $07e7 in hexadecimal) and output there with a jsr $ffd2, your screen will scroll either one or two lines, and therefore the top one or two lines will disappear. If you limited your text to 999 characters maximum, or outputted to a specific screen area then this might be useful, but you'd also have to use the Kernal to position the cursor correctly before writing to the screen, which again may be cumbersome in some instances.

A more pertinent point here is that if you were actually going to learn assembly, you would not write any assembly like this. Aside from the relative slowness of calling to the Kernal CHROUT, you also have repeating code as almost every other line is a jsr $ffd2, and one of the lda instructions is not necessary at all. In the above example, it loads the 'L' character in HELLO twice before calling the CHROUT routine twice; a small efficiency here is to simply load the L character value once and call the CHROUT routine twice. But even then, doing things this way isn't how you would learn assembly. In assembly, you would set up a conditional loop to read from an area in memory where each byte of the data is stored with your message (HELLO WORLD), and then iterate the loop until your condition to terminate it is met, and output each byte to your display. Based on the CHROUT example above, let's have a look how one might do this.

* = $c000
    lda #$00 ; Set Accumulator to zero
    ldx #$00 ; Set the X register to zero
    lda $c01b,x ; Start of loop, reads the
                ;data to the Xth byte
    cmp #$00 ; Have we hit our terminator yet?
    beq *+9 ; If so, branch ahead 9 bytes
    jsr $ffd2 ; CHROUT
    inx ; Increment the X index
    jmp $c004 ; Jump back to the start of our loop
    rts ; Return to BASIC
* = $c01b ; Data at $c01b
    ; The data is split into multiple lines as
    ; putting it on a single line does not work
    ; well on the Blogger platform as the text
    ; overflows the design boundary and looks ugly
    !byte $48, $45, $4c, $4c
    !byte $4f, $20, $57, $4f
    !byte $52, $4c, $44, 0
  

Now that looks better, and we're definitely not near the 30 lines supposed in the meme, more like 12 if the data bytes are written on a single line.

A few cautionary notes here. Firstly, whilst I am not using labels, they are very useful and make your development easier to manage, and allows any assembly program room to grow, as the labels will move as your code gets longer or shorter. I don't use them as the online assembler linked above gives me an instant disassembly of the program as I type it, so I am able to correct my assembly code as necessary. But for convenience, I have set the start of the code to $c000 (SYS 49152 as already mentioned), and the data to be stored from $c01b.

We have a much nicer example now, but there are still some things to improve: firstly, we have at least one line of unnecessary assembly: cmp #$00. This means we want to compare an absolute value (zero) with the current value in the Accumulator (A). Before this comparison we have loaded a value into A with lda $c01b,x. This is taking a byte from memory location $c01b offset by the current value of X. On our first iteration, this takes in the value $48, as the X register is zero, and therefore so is the offset. Our comparison is false, and the beq *+9 (branch if equals +9 bytes) does not happen. We then increment the X register with inx and jump back to the start of the loop with jmp $c004. And so the next iteration will load A from memory location $c01b offset by 1, and so on until X is 11 and our zero terminator condition is met. And once the condition is met, it branches 9 bytes ahead to the rts instruction, returning back to BASIC.

You may add more PETSCII bytes to the data block from $c01b as long as you don't have more than 255 bytes of data in the block including the zero terminator. For reference, the C64 character codes are here.

We are explicitly comparing the current memory contents to a zero value; in 6502 we don't need to do this. This is because when loading a value into the Accumulator, either directly, or by reading a memory address, it will set the zero flag if A happens to be zero. As the zero flag is set, we may do a $beq *+9 without the preceding cmp #$00 because a branch instruction will test against the zero flag unless you explicitly tell it not to. If our terminator had a value of 255 ($ff in hexadecimal), we would need to do a cmp #$ff statement before the branch instruction. By using an absolute value of zero as a terminator, we have saved one line of assembly, and two bytes.

This isn't the only improvement that we may make here; at the start of our example above, we load the Accumulator with an absolute value of zero (lda #$00), and then do the same with the X register. But to save another two bytes, we don't need to initialise A to zero; we only need to initialise the X register to zero as that is being used as our offset. As we have saved two byte, the jmp $c004 needs repointing as the start of the loop has moved up in memory by two byte. With these improvements, let's have a look at our new assembly listing.

* = $c000
    ldx #$00
    lda $c01b,x
    beq *+9
    jsr $ffd2
    inx
    jmp $c002
    rts
* = $c01b 
    !byte $48, $45, $4c, $4c
    !byte $4f, $20, $57, $4f
    !byte $52, $4c, $44, 0
  

Surely now we're done. The code itself is now pretty efficient. But we can still save one byte in our main loop. Remember that the zero flag is set if you write something to the Accumulator that equates to zero? The same principle applies to the X and Y registers. After we call the CHROUT routine with jsr $ffd2, we then increment the value in X with inx. The first time this happens, X will of course hold a value of 1, and we know that X will never be zero as we only have 12 data bytes including the terminator. This means that the zero flag is never set by the X register in our example, so we may use the branch instruction again instead of jmp $c002. It is only possible to branch 127 bytes back in your code, or 128 bytes forward in your code. Our code is small, and the loop beginning at $c002 will only be 9 bytes back from a branch if not equals instruction that we're adding. This saves one more byte from our code! Therefore, our rts line, to get us back to BASIC, is one byte lower in memory and the beq *+9 needs repointing too. Let's have a look at our final version with this optimisation:

* = $c000
    ldx #$00
    lda $c01b,x
    beq *+8
    jsr $ffd2
    inx
    bne *-9 ; We know that the zero flag
            ; is not set as we have incremented
            ; the X register by 1 and also we
            ; are not reading in 256 bytes of data.
            ; When the X register is 255 ($ff) and
            ; is incremented, it wraps around to
            ; zero. This same rules apply to
            ; the Y register.
    rts
* = $c01b 
    !byte $48, $45, $4c, $4c
    !byte $4f, $20, $57, $4f
    !byte $52, $4c, $44, 0
  

So there you go, we have a small and efficient hello world example in assembly, starting from a dumb example. I was going to go onto writing this to screen RAM at $0400 hexadecimal, or 1024 decimal, but this blog post is already long enough just covering the points that I wanted to, so I'll leave writing directly to the screen RAM for my next blogger update.

Thanks to Robin of 8 Bit Show and Tell mentioned above, and the other feedback I got from Mastodon. I received some very helpful comments about this blog post which has improved it. Note that we are able to make small and tight loops like this on the C64 with the CHROUT Kernal routine because this call preserves the Accumulator, X and Y values for us. Other Kernal calls may not do this, and will therefore require additional logic to track these values. But this is for a future blog. I've enjoyed re-acquainting myself with some 6502 again, and I'm glad it makes more sense now than it did the last time I looked at it.

If you don't want to wait for the next update, a really good C64 resource is available here, and there are plenty of 6502 resources just a few clicks away.

Sunday 4 December 2022

What advice would I give newer and junior developers?

Over 10 years ago, I began a career transfer from an adult support worker (or whatever that role is called now, a care assistant in old money) to one in Computer Science. I knew on beginning my Degree in Enterprise Computing, a programme that I attended thanks to Manchester Metropolitan University (MMU), that what I wanted to do with the rest of my life was software development. Through the course, I discovered that my two best classes were Programming, and Business Studies and management. My least favourite and consistently poor results fell into the Database and Structured Query Language (SQL) side of things.

Whilst I kept writing through University and beyond (exclusively through the pages of Micro Mart at that point), it became very obvious that in order to progress as a developer, [software development] had to be the main focus in my life, so writing became much less important to me. I had a good technical grounding in programming languages thanks to MMU but especially due to an unexpected almost full year at the University of Derby Games Programming course (this was due to Government funding cuts thanks to a certain coalition of chaos that I won't mention further).

At Derby I had covered a lot of C and Visual C++, some MIPs, Java for Android and some other languages. Being focused on entertainment rather than application software meant a whole lot more programming but no database theory, management or SQL. I did make the point that SQL will become more important even in the games programming world, something that at least one of my lecturers acknowledged. How else are you going to store all of that data for all of those online games?

Anyway, I started as an web application developer thanks to an Internship. After about one year, I had my first job proper at a company in Wolverhampton. I was taken on as a Junior Developer and as a content writer. Our primary technology was a LAMP sort of stack; that being Linux, Apache, MySql (or MariaDB) and PHP. We were running a version of Magento version 1.7.1, and had some front-end CSS compilers that apparently made front-end development more easier, though I've always thought that the benefits of something like SASS has very marginal benefits over straight CSS. That aside, in each new role I undertook from there, I learnt a lot. So what sort of advice would I give now to junior developers? Or someone inspiring to change career to become a developer?

The first thing I'd say is that there is never a bad time to learn something new. Although not everyone is suited for a role as a software developer, like not everyone can be a Nurse, nor a Doctor, if you have a logical mind and you are able to break down problems to small manageable chunks, and you don't mind learning how to debug then this could be for you.

But as a developer, what issues might you come across? I've found that being a developer is often quite different than programming alone. As a developer, you usually need to work collaboratively, and conform to certain standards and expectations. And whilst you should be given some slack as a junior, your work will still need to be maintainable and scale as necessary.

In my first job proper, the so-called senior developer made two critical mistakes that were even apparent to me after just over one year in the industry; firstly, the version of Magento that we were using was core hacked, meaning that we couldn't easily upgrade it.

My senior colleague developed a service that would produce JSON for pricing data; this data could move up and down every second based on current market prices. Whilst his service was perfectly good, and served the website well, I had developed an iPhone and Android application that was dependent on it.

Shortly after this application was released, he decided to change the API to deliver a different JSON structure. That would have been fine in other circumstances, but he made these changes without consulting anyone else, and whilst he was able to fix the website JavaScript charts that consumed it, he didn't inform me of the changes and therefore my application had been rendered useless. This happened during the last few weeks of my time there, and I had no way to update the application quickly or easily, and he didn't understand the application to fix it as some of it was Objective C and he refused to work outside of his conform zone which rapidly became the PHP framework Laravel.

As a developer, no matter how senior you think you are, or you become, do not make unilateral changes by yourself. Consult others first, especially those people in your team. And if you make a mistake, admit it. The sooner you do, the sooner it can be fixed. Other developers making unilateral changes has caught me out on other occasions too. One server change cost me well over 1 week of debugging because this change wasn't announced to anyone. This change was unnecessary and on a development server, although making such a change without agreement on a production server might have caused even more headaches!

My final piece of advice is to never assume that you know everything, and do not assume that just because you know something that everyone else in your team has that same knowledge. I've done presentations that I never expected to; one was why computers do not divide by zero, and another was about the difference between scalar values and objects. I have a small advantage over many of my younger colleagues in that I grew up programming, and many of the computer magazines that I'd buy growing up would be aimed at teaching children like myself computer programming too. So concepts like Integers and Boolean values, loops, branches and conditionals are kind of second nature to me even if the terminology may have changed. But even good people with good degrees may not have such a good grounding in programming principles even if they're perfectly good developers otherwise.

I've learnt a lot from my colleagues over the years too. As one of my lecturers once said to me, if you're not learning as a developer, you'll soon be obsolete.

Saturday 26 November 2022

BMC64 is free, so how much does it cost?

This sounds like a bit of a stupid question. How can something free cost any money? The reason that I ask this is because I was speaking on a Discord chat group recently and a common statement that people make is that the Bare Metal Commodore 64 (BMC64) emulator is a better thing than THEC64 and THEC64 Mini. Of course, such a solution that one could build oneself would be better in many ways. One could presumably customise all of the settings to enhance the user experience, including I assume choosing which SID chip to emulate, or even have two SID chips emulated, and so on. On THEC64 platform, one doesn't have nearly as much control, not without hacking anyway.

Another reason for BMC64 being better [than THEC64 platform] is that it is free. I was specifically thinking of BMC64 kits that one may purchase when I made the point that THEC64 has likely sold a lot more units than these kits. The counter argument was that BMC64 is just software that one could install on a Raspberry Pi, so it's free like a Linux operating system is free. But how much would one need to spend to use BMC64?

If you're reading this and you've already made an investment in a Raspberry Pi then you may stop reading here; BMC64 isn't going to cost you any more money than you've already spent. But what if you don't already own a Raspberry Pi, and want a dedicated piece of kit just for Commodore C64 software? Is THEC64 or Mini a good solution compared to something for free?

Well let's look at costings for a BMC64 solution first. Assuming that BMC64 will run on any Raspberry Pi currently available, you're probably looking at spending around £30 - £40 GBP for the cheapest Pi, which I assume has the lowest specification. So we'll say £30 with postage. And then of course you'll want a keyboard, so there's another £10 - £15. And if you don't mind playing games with a keyboard rather than a controller or joystick, that's it. It's then just the time it takes to set up. So, you're looking at spending between £40 and £55 for this option, and that's if you don't already have a spare USB keyboard lying around. That's good value, but it's certainly not costing £0.

Like for like, THEC64 Mini is currently for sale here in the UK via Game outlets for around £40, at least in my local store in the West Midlands. Okay, so you don't have a keyboard included with the Mini, but do have a controller. I know THEC64 Mini joystick isn't the best version, but it's still a fair comparison for the cheapest BMC64 option. Set up time for THEC64 Mini is usually no more than a few minutes, whereas BMC64 may vary depending on how much one wants to configure. THEC64 Mini does include 64 games to get started with, and all of these are licensed games. THEC64 Mini has a custom housing, fewer USB ports and no included PSU. It requires a 5V 1amp USB charger, which will be another £5 - £10. Both solutions allow you to add your own software, but THEC64 platform is limited to USB 2 flash drives formatted to FAT32, though this is more than adequate for C64 games.

THEC64 Mini is nicely packaged. I genuinely had a warm fuzzy feeling when I initially opened my first THEC64 Mini. The guys at Retro Games Ltd did a really good job with the industrial design and packaging. I won't have that same feeling opening the packaging for a Raspberry Pi, but this may be different for you.

The suggestion in the chat wasn't for this cheap option, but to consider a Raspberry Pi 4000, as that includes a keyboard and a mouse. This is currently around £100 in the UK. How does that compare to THEC64 Classic?

THEC64 is currently retailing in the UK for around £120, it is housed in a stylist casing which matches the size of the most common C64 casing in the UK, and includes a fully functioning and properly mapped keyboard with a joystick controller. Again, everything on THEC64 is fully licensed, and the bundled joystick is much better than the THEC64 Mini joystick. At £120, this isn't costing significantly more than a Pi 4000 solution.

So whilst one may save some money with a Raspberry Pi, is BMC64 a better solution? Well that depends on what you mean by better. THEC64 and Mini work out of the box, and THEC64 has a fully mapped keyboard with a pretty accurate casing, and both run at 50 or 60FPS like the original hardware (depending on your region or what you're used to), and with no sound drift nor frame skipping like on some emulators especially running on lower specification hardware. There is an issue on some modern displays if you specifically want a 50Hz refresh rate, but I assume that this will be the case for a Pi anyway.

Whilst THEC64 emulation is more limited than with a BMC64, those things that are missing [from THEC64] are very marginal use cases. For most people who just want to play games, THEC64 is pretty good. If you are a more serious user and more invested in the C64 platform then BMC64 is very likely a more suitable option. It isn't for everyone though, like Linux isn't for everyone either.

This reminds me of the arguments that people used to have (maybe still do) between Microsoft Windows and Linux.

Linux is free, and yet you still need to spend about the same money as a Windows-installed PC to run it. Also, I've never known anyone to actually pay for a copy of Windows by itself as this cost is usually included with the computer, and that cost isn't necessarily significantly cheaper without a Windows installation. And more serious computer users probably want to build their own system anyway, and make their own choices of operating systems and other software installations.

So I don't own a BMC64 (or any bare metal emulator) solution, and at this point spending some money to get one isn't for me. I have got to an age now were I want things to work out of the box, rather than using my time with various customisations and setting, and wasting my time with any trouble shooting for when things go wrong. I already did that in the 1990s and early to mid 2000s with my Commodore C64 and C128 and all of the Creative Micro Designs hardware that I was using.

THEC64, regardless of what faults that it may or may not have, works. It's actually well supported and has seen regular updates for it, though I suspect that v1.6.1 will be the last firmware update for THEC64 as the remaining missing features, such as using a custom Kernal or emulating more than one drive, are very marginal use cases that most people who want to play classic games won't care that much about. Again, your experiences may differ here. Maybe it's essential that you have a custom Kernal installed, or have two SID chips emulated, for instance.

On that note, I'm off to play a few games of the absolute classic Wizball, and ponder the meaning of life, the universe, and everything.

Sunday 20 November 2022

Noel's Retro Lab bench mark test - we have a new leader

Noel's Retro Lab is a popular YouTube Channel that discusses many computers and related hardware. One thing I like about this channel is the detail Noel goes in to especially when repairing 8 and 16-bit personal computers. He gives a good overview of the hardware, and usually runs a BASIC bench mark as a way to compare one machine to another. This bench mark program is as follows:


10 FOR i=1 TO 10
20 s=0
30 FOR j=1 TO 1000
40 s=s+j
50 NEXT j
60 PRINT ".";
70 NEXT i
80 PRINT s

Noel has been adding the results (in seconds) for each machine that he has run this program on, and many of his friends and followers have contributed to this. You may see system-by-system comparisons in a Google Sheet here.

Until today, the fastest system has been the ZX Specrum Next, though it needs to be running at 28Mhz, and use Integers rather than floating point variables. It completes in 5 seconds, and for a BASIC interpreter on a Z80 computer that is pretty quick.

As I'd set up my Commodore C128D-Cr again yesterday, which has a CMD SuperCPU, RAMLink, FD2000, a Commodore 1581 and an Ultimate 1541 II attached to it (or the U1541 II alternates with the RAMLink due to compatibility issues with the two devices) I decided to try the aforementioned bench mark symbolic listing to see the results on my power system. I first tried it in C128 80 columns mode, and found that it was faster than 5 seconds (at least with BASIC or FULL optimisation enabled) - so I'd need a reliable way to time it accurately.

All variants of Commodore 8-bit BASIC have a TI$ system variable. This will tell you the number of seconds since you switched your computer on (by default) and may be set to the current time in HHMMSS format. Related to this is the TI system variable, which counts the 60ths of a second since the computer was switched on (by default), and is reset if the TI$ system variable is set to midnight. So I did a typical thing for Commodore BASIC bench marking by adding the following BASIC lines:


0 TI$="000000"
80 PRINT S:PRINT"SECONDS"TI/60,"JIFFIES"TI

At its fastest, and in C128 BASIC 7 and 80 columns mode, the bench mark completed in about 3.2 seconds with either BASIC or FULL optimisation mode set. I therefore knew that C64 BASIC 2 would be faster than this.

You may see the results on my official Twitter feed, but a heads up: in C64 mode the fastest result is under 2 seconds.

I'm now going to try this same bench marking on my Ultimate 64 at 48Mhz. I expect that the results to be under 1 second. I may optimise the U64 further to see if I can get this bench mark to run in under half a second without optimising the BASIC listing.

One thing to note about bench marking is that you may get misleading results that may or may not fit your personal agenda. I saw a YouTube video on how the Turbo Chameleon [TC] is faster than the SuperCPU. And yet, at the time of writing at least, the TC doesn't have a Doom port. Not in its C64 emulation anyway.