Invader's Revenge reverse-engineering

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
bennorth
Posts: 4
Joined: Sat Oct 11, 2025 11:48 am

Invader's Revenge reverse-engineering

Post by bennorth »

Hi,

Thanks to XRoar's Ciaran for pointing me to this site. Great to see all the active development going on with the Dragon, software and hardware. I had one when I was young (some time ago now...) and it was a very important part of how I properly got into computers and programming. Recently I thought it would be a fun project to do a bit of reverse engineering on one of the games I used to play, Invader's Revenge (Ken Kalish). In case it's of interest to anyone here, there's a write-up along with my commented disassembly, and a recreation in an educational coding system I'm working on, here: Invader's Revenge reverse engineering.

Ben.
User avatar
robcfg
Posts: 1658
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Invader's Revenge reverse-engineering

Post by robcfg »

Hi Ben, welcome to the Dragon Archive!

You've done a remarkable job with the reverse engineering of Invader's Revenge. I like specially the comments, the different coloured blocks and how you show the embedded graphics.

How do you create such visualization?

Cheers,
Rob
lcurtisboyle
Posts: 28
Joined: Thu Nov 05, 2020 9:47 pm

Re: Invader's Revenge reverse-engineering

Post by lcurtisboyle »

I haven't had time to go through much of your source yet, but I did want to mention a bug - when you are selecting your speed, it allows the "R" key to be selected, rather than a number. This causes the game to run very slow, but still play. It really drags out the sound effects, so you can hear each individual pitch rather than altogether as a sound effect.
bennorth
Posts: 4
Joined: Sat Oct 11, 2025 11:48 am

Re: Invader's Revenge reverse-engineering

Post by bennorth »

robcfg wrote: Thu Oct 16, 2025 11:28 am You've done a remarkable job with the reverse engineering of Invader's Revenge. I like specially the comments, the different coloured blocks and how you show the embedded graphics. How do you create such visualization?
Thanks for your kind words! I'm glad you like it. The final HTML output is generated by a fragile collection of scripts, starting with disassembly produced by f9dasm. The f9dasm disassembler takes the binary machine code and also a file of directives, which is where I wrote the comments, told it which bits of the binary were code and which were data; that kind of thing. I put some special comments in like %%GFX 2, which means that this block of data represents a piece of Dragon 32 graphics two bytes (so eight pixels) wide. There is then a Python program which reads in f9dasm's output and emits HTML. Part of that is decoding the graphics data and generating an inline PNG, done by code in make_img.py as used in the main script here. This is all strung together with a shell script which juggles various intermediate files. Another shell script renders the markdown for the write-up, and gathers all the other bits and pieces needed for the final presentation. As I say, not very elegant, but it did the job.

The whole thing took longer than I meant it to, but it was fun so I think that's OK!
bennorth
Posts: 4
Joined: Sat Oct 11, 2025 11:48 am

Re: Invader's Revenge reverse-engineering

Post by bennorth »

lcurtisboyle wrote: Fri Oct 17, 2025 5:41 pm I haven't had time to go through much of your source yet, but I did want to mention a bug - when you are selecting your speed, it allows the "R" key to be selected, rather than a number. This causes the game to run very slow, but still play. It really drags out the sound effects, so you can hear each individual pitch rather than altogether as a sound effect.
Aha, thanks for the info. I did notice that the "R" key was handled specially, but didn't dig deep enough into the consequences for the speed selection. Looking at the code now (end of the subroutine I've called Sub_QueryShotsSpeed), I think I see what's going on. I'll update the disassembly, and note "World Of Dragon user lcurtisboyle" as the source of the observation, if that's OK?
Alastair
Posts: 690
Joined: Fri Jul 18, 2008 11:33 pm

Re: Invader's Revenge reverse-engineering

Post by Alastair »

Ben, I'm surprised that L. Curtis Boyle did not mention it but he interviewed Ken Kalish some (over 21) years ago. You can read his interview at http://www.lcurtisboyle.com/nitros9/interview.html, part of the interview specifically mentions Invader's Revenge.
User avatar
robcfg
Posts: 1658
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Invader's Revenge reverse-engineering

Post by robcfg »

Hi Ben,

Thank you for the nice explanation of your setup!

Isn't programming a fragile collection of scripts? :mrgreen:

I'll be taking a look and see if I manage to generate some good looking html like yours.

Cheers,
Rob
bennorth
Posts: 4
Joined: Sat Oct 11, 2025 11:48 am

Re: Invader's Revenge reverse-engineering

Post by bennorth »

Alastair wrote: Mon Oct 27, 2025 8:35 pm Ben, I'm surprised that L. Curtis Boyle did not mention it but he interviewed Ken Kalish some (over 21) years ago. You can read his interview at http://www.lcurtisboyle.com/nitros9/interview.html, part of the interview specifically mentions Invader's Revenge.
Oh yes! I completely failed to notice the username. I have indeed read the great interview with Ken Kalish. I swapped emails with L. Curtis Boyle to ask whether he was able to contact Ken Kalish, but alas not.
Post Reply