CoCo fun

Hi All,

This post was spurred on because I was replying to a comment today where someone was asking for my z80 to 6809 program and the link was dead.  I updated the link to the latest version I could find on my computer.  After replying to him I thought I might as well make this little post.

It’s been almost 1.5 years since I’ve posted anything here but life has been treating me like a baby treats diapers and I lost interest in using my CoCo.  But lately I’ve been playing a little with some of my old 6809 code and enjoying it.  I hope it continues to be fun and I have something useful to post here for the CoCo community in the future.  I guess we’ll see.

For those that are wondering about my Defender conversion, it was at a point that it would play weirdly and crash randomly.  I remember fighting with the code for hours and hours but couldn’t figure out why it was doing the things it was.  I think I needed to improve the emulation of the scanline location code too, at least I remember doing a lot of thinking about that code back then.  Anyways it will be a long time until I’m back into the CoCo enough to look at that code again.  But maybe one day…

I hope all my CoCo friends are well,



This entry was posted in Uncategorized. Bookmark the permalink.

6 Responses to CoCo fun

  1. Mark McDougall says:

    Hi Glen! Was doing a write-up on my Knight Lore transcode and referenced your Pacman project so that got me thinking about Defender, where you got to, and what you’re up to these days.

    Can certainly understand your situation; it’s been 12 months since I did anything at all myself, and I didn’t do much of consequence in the preceding 12 months either. For me, Real Life has intervened with a young family and whatever spare time I have had has been directed instead towards other apects of my retro gaming hobby.

    In any case, good to see a recent post, and hope one day you find yourself motivated and able to continue with Defender. That would be one hell of an achievement on the Coco3!


    • nowhereman999 says:

      Hi Mark,

      Sorry, I did read you post after you wrote it but I didn’t reply at the time. Thanks for taking the time to comment. Lately I’ve been having some fun CoCo coding again and I’m starting work on getting my Space Invaders transcode to work without having to rotate the monitor. As usual it’s way more work than it looks like it would be but I’m still having fun with it. It’s been a good way to get my coding chops going again and after Space Invaders I might look at Defender again. I hate leaving things undone but it was a bugger to try and figure out the weirdness it was doing as I’m sure you understand how these things can be.

      I hope all is well with you and your family,

      • Mark McDougall says:

        Hi Glen,

        No worries on the response, totally get it! I’ve done it to others myself!

        Family is well, thanks. And yours?

        Interesting to read you’re rotating Space Invaders. I got about half-way through the rotation by converting the graphics and patching the code, but then had an idea that maybe there was enough grunt on the 6809 to rotate on-the-fly. So I changed course and got a fair way through that as well, until I decided that it just wasn’t going to fly, so changed tack again back to the first method. Unfortunately soon after I lost focus again and haven’t revisited it since. But it was on my to-do list!!!

        My last CoCo3 project was Asteroids – completed the transcode and was in the process of optimising the graphics rendering. Again I lost focus and that’s pretty much the last of any sort of retro development I’ve done for almost 2 years now.

        With the new year I’ve (yet again) evaluated what I wanted to achieve in this arena and having recently acquired a MiSTer I think I’ll probably focus on some FPGA implementations in the near future. That means Coco3 projects will have to stay on the shelf for a while longer yet. If I had more time I’d like to finish off Asteroids, and release a cartridge for Lode Runner. Although I do have a few more CoCo3 projects in mind, I must admit that I’d probably look at transcoding for another platform before I returned to the CoCo3. Too many projects, too little time!

        Anyway, good luck on the SI rotation – will be interested to know which way you went with it! I’m assuming you’re simply moving the score/credits over to one side of the screen? Another game on the same hardware I think would be well worth the effort is Lunar Rescue…


  2. nowhereman999 says:

    Hi Mark,

    I’m glad to hear the family is well, kids are doing great thanks.

    Ha, it’s good to hear from someone who’s gone through the same things I am with Space Invaders. I totally thought the same things, working out that swapping on the fly might be the way to go but decided it would be fastest to create new compiled sprites and put them on the screen by translating where Space Invaders thinks it’s on the screen. I’ve worked out the screen positions for all the graphics and have it display most of the first frame of demo game. I have the players scores on the side at the top and there is room for the high score along the top middle of the screen. After a few seconds after the demo starts things are falling apart and I’m not sure what I did to cause it, I know it’s probably something simple that I missed or something little bug but those are always so frustrating for me. It’s always two steps forward one step back. I also have to figure out the collision detection for the aliens and the player. As you know it’s way simpler with the screen rotated.

    I find working on these transcodes kind of like someone would treat restoration of an old piece of art. I want the code to be exactly the same as possible, but there is a fine line between using the same code translated to the 6809 and re-writing a piece of code to do the same thing. Especially as you know the z80 16bit values are stored in little-endian. So far i’ve kept Space Invaders simple and stored and retrieved the data the same as the original z80 code did then I would flip the bytes so the 6809 could handle it. Trying to keep the data in the exact same location in RAM and the code as similar to the original as possible. As I’m toying with the idea of getting it to run on a CoCo 1/2 I might have to go through the code and make changes to the reading and storing of the data to speed things up. Also since I’m already doing a recalculation of where space invaders thinks it’s drawing the graphics it would be faster to re-write the code to move the Aliens on the screen. But then it gets to the point that it’s becoming more my version of the game then the original and although I would do my best to make it identical there is a difference and I would prefer to not introduce my own version of routines. I hope that all makes sense. On top of that it’s better that I figure this out now, before I get too much further in the rotation process. Or maybe I should just leave the code the way it is and see how fast I can get it on the CoCo 1/2 later after I have a CoCo 3 version working. I think for now, I’m going to fix my last bug and just keep on working though a version for the CoCo 3.

    I do remember seeing some progress to your Asteroids transcode. It was looking amazing although from what I remember it wasn’t using the super hi-res graphics screens (maybe the CoCo isn’t up to it), but still to see “The Real” Asteroids on a CoCo was so friggin cool! I wanted to work on Asteroids myself since I’ve never programmed the 6502 and it would be a great reason to learn the CPU and Asteroids is definitely one of my all time favourite games.

    Since you mentioned you will probably be moving on to working on other hardware before returning the CoCo if you have time then maybe one day if you don’t mind, and I totally understand if you do because it’s your baby (just like if someone asked me to finish Defender, although I do plan to go back to it at some point), but maybe I could look at your code and maybe finish the graphics engine. I do find getting graphics as optimized as possible on the CoCo hardware is one of the most enjoyable parts of doing these transcodes. If not no worries at all my friend, I might just fight through my own transcode one day way way down the road…

    Thanks for the tip on Lunar Rescue, I don’t remember playing this as a kid but I watched some videos on it and you can definitely see it’s the same hardware as Space Invaders. The game looks quite cool, a neat cross between Space Invaders and Galaxian especially since it came out in 1979.

    Take care,

    • Mark McDougall says:

      Hah, totally get where you’re coming from on the “where to draw the line issue” and had the same dilemma several times. I too prefer to keep the data values in the same (relative) location in memory, and in the same format unless it absolutely doesn’t make sense.

      I wasn’t averse to changing the endiantity for values strictly used as 16-bit numbers though. I saw that as part of the adaptation for the target CPU, rather than ‘changing’ the original code. I also see pure low-level rendering code as fair game, because you’re not changing anything at all to do with gameplay or look, and it’s usually a significant point of optimisation, especially if the display hardware architecture/layout is quite different.

      It’s been a long time, but IIRC my on-the-fly rotation used the original rendering code to write to a (non-rotated) off-screen buffer, then called a routine to ‘blit & rotate’ a rectangle to the CoCo3 display. That meant all the original collision-detection routines would work without change, plus a single rotate routine was sufficient. But slow.

      And just like you, I got half-way through the (other method of) rotation by storing pre-rotated sprites (for want of a better word) and then something suddenly broke and all went to hell. I don’t recall the exact details and I think I tried to back out the last changes… I’ll have to revisit it at some point.

      I will have to think about your offer on Asteroids. Yes it’s my ‘baby’ which probably doesn’t bother me as much as the feeling that I ‘failed’ if I don’t complete it myself. Really there’s just a bunch of handle-cranking to be done; hand-compiled sprite routines which will fill most of available memory by my calculations. Then again, I do have other plans for the 6809 core which I’d like to work on as well… so I might be persuaded…

      As for Lunar Rescue – there was a version for the TRS-80 Model I/III called “Meteor Mission II” which was widely regarded as one of the system’s best games and certainly one of my favourites. Many, many years ago I patched Space Invaders to run on the TRS-80 Model 4 (with success up to a point) and had Lunar Rescue also running in “screen scrape” mode but never persued it any further.

      After a few years off I’ve suddenly got a few projects that I’d like to crack open again… but not enough time to tackle them all. I’ve just bought a MiSTer and the intention was to port my Irem M62 games across to that, then look at a few more of my other cores (including Coco1/2), then work on a few new cores (Namco ND1, Gauntlet), then finish off the CoCo stuff, then look at reverse-engineering Xevious and doing a 68K/C transcode… I need to retire… 😉

      • nowhereman999 says:

        Hi Mark,

        It’s so nice to hear from someone else who’s completed a transcode of Space Invaders. These transcodes are a pretty solitary job and usually there is no-one you can discuss it with. Not that we have gotten into the details much it’s just really cool to hear from someone who has gone through the code and made a 6809 transfer! I never even thought of the first method of rotating the space invaders screen. Neat idea, but yeah I think it would be too slow…

        No worries about the Asteroids thing, don’t give it a second thought. I completely understand how you feel as I would feel the same if I gave someone my Defender code and they finished it. I would feel somehow I failed my project. It’s just when you mentioned Asteroids the thought of working on it, got me excited and if I didn’t ask you about it I would never have known. One day I may do my own transcode of the game it’s such a classic the CoCo needs to have it done. It would be a big learning process for me from the 6502 CPU and the vector graphics, but I would enjoy learning. At this point in my life though I don’t seem to be able to find the dedicated time I need to work on the code, especially when debugging. When I get deep into debugging code it’s like you’re in another world and any interruption from the real world takes me right out of it and I have to start again. I know my brain isn’t working as good as it was, when I was a puppy when coding/debugging was so easy. Or maybe that’s just how I remember it because it was so much fun. But I do find some time here and there to play with the code.

        I hope you find more time for your projects and have fun!


Leave a Reply

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

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

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s