Nippur72 vs "raid on fort knox"

Basic and Machine Language

Moderator: Moderators

User avatar
nippur72
de Lagash
Posts: 405
Joined: Thu Sep 07, 2006 8:35 am

Nippur72 vs "raid on fort knox"

Postby nippur72 » Mon Dec 11, 2006 6:20 am

This weekend I did something maniacal:

I disassembled the whole cartdrige "Raid on fort knox" !!!

(don't tell me I am crazy, I already know that)

I did it for the fun of it, and indeed it was a rewarding experience.

At first, everything was obscure and meaningless, I didn't even know what was code and what was data, but at the end of the process every single byte was assigned to a purpose. It was challenging, I had to "enter" the head of the original programmer and see thru his eyes. So I labeled and commented the whole code, giving it a second life! I wonder if the original source code is lost or is in the hands of the original developer or perhaps in the hands of what remains of Commodore ltd.

Well, I just had to share this with someone. Thank you for listening.

And, in case you are wondering, "Raid on fort knox" was the first game I ever played on the Vic20, at the time when I didn't have a tape recorder and a friend borrowed me his cartdrige. It is one my favourite games along with Trout, Paratroopers and 3d silicon fish.

Now I will try to convert it for the unexpanded Vic but I'm not sure because there is just not enough memory left (definable characters waste 2Kram).

User avatar
Boray
Musical Smurf
Posts: 4026
Joined: Mon May 03, 2004 10:47 am

Postby Boray » Mon Dec 11, 2006 7:15 am

Wow! You must have a total lack of lazyness! That is something I amdire.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)

User avatar
Mike
Herr VC
Posts: 3017
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Postby Mike » Mon Dec 11, 2006 8:18 am

Lately, I did the same with a BASIC extension, and a floppy-speeder. Nippur72, you pinned the nail on the head, when you said:
So I labeled and commented the whole code, giving it a second life!

With the re-built source code at hands, one can easily relocate the code, and/or combine it with other programs. IMHO, the most prominent problem is to find "hidden" pointers. For example, when a variable jump is pushed as return address onto the stack, and then executed as RTS.

I've written two C Programs, that - from a disassembly - extract jump-targets within the program's range, and then substitute them with labels. What tools do you use?

Michael

User avatar
nippur72
de Lagash
Posts: 405
Joined: Thu Sep 07, 2006 8:35 am

Postby nippur72 » Mon Dec 11, 2006 8:35 am

I've written two C Programs, that - from a disassembly - extract jump-targets within the program's range, and then substitute them with labels. What tools do you use?


I did that manually. The program had only one indirect jump via the stack, done in a "clean" way--that is reading addresses from a table and pushing in the stack. In that respect it was easy.

The main problem for me was distinguishing between code and data. I used the "da65" disassembler where you can mark each segment as data, code or else. So I start with everything marked as code, iterating the disassembling process until all data is found.

I also have converted the strict 6502 assembler into the "pseudo" assembler I use with my "asmproc" tools (asm with do...whiles and if..thens)

User avatar
Jeff-20
Denial Founder
Posts: 5451
Joined: Wed Dec 31, 1969 6:00 pm

Postby Jeff-20 » Mon Dec 11, 2006 1:11 pm

We would love an explication. I've always admired that games smooth motion.

User avatar
nippur72
de Lagash
Posts: 405
Joined: Thu Sep 07, 2006 8:35 am

Postby nippur72 » Tue Dec 12, 2006 2:24 am

We would love an explication. I've always admired that games smooth motion.


explication about the smooth motion? Well, everything is precalculated and already put in the definable character area. There are two shapes: the "man" and the "guard", each one spanning on two characters when they move, and they can have 4 different movements (cardinal directions). And each of these has 8 different "shift" positions for smooth movement, so in total:

2 x 2 x 4 x 8 = 128 characters

With some other spare shape, definable characters are 2048 bytes and placed at 5120, making it very difficult to convert for the unexpanded vic.

On the 8K ROM there is some space left, and I wonder why they didn't add additional mazes (there are only two and they are very similar).

eslapion
ultimate expander
Posts: 4332
Joined: Fri Jun 23, 2006 7:50 pm
Location: Canada
Occupation: 8bit addict

Postby eslapion » Tue Dec 12, 2006 6:43 pm

nippur72 wrote:On the 8K ROM there is some space left, and I wonder why they didn't add additional mazes (there are only two and they are very similar).


There is your opportunity to create "Raid on Fort Knox II" :wink:

User avatar
Jeff-20
Denial Founder
Posts: 5451
Joined: Wed Dec 31, 1969 6:00 pm

Postby Jeff-20 » Tue Dec 12, 2006 7:34 pm

It would be very easy with your disassembly to create a new version! Maybe even a graphic change or new mazes. You wouldn't have to change any of the routine codes. I think it would be a very fun project!
remember "Coke Wins!" on the Atari 2600?

User avatar
nippur72
de Lagash
Posts: 405
Joined: Thu Sep 07, 2006 8:35 am

Postby nippur72 » Wed Dec 13, 2006 9:13 am

uhm.... and what do you prefer

1) having it run on block 5 as cartdrige image

or

2) having it run on normal memory expansion (relocated with video at 1024)

please vote :)

User avatar
Mike
Herr VC
Posts: 3017
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Postby Mike » Wed Dec 13, 2006 9:29 am

nippur72 wrote:2) having it run on normal memory expansion (relocated with video at 1024)

I'd just like to remind you, that the VIC-chip can only access internal RAM. So 1024 as address for the screen would be out of the question. Or did you mean 4096 as it's the case for 8K or more expansion?

Ideally you should make the game runnable with LOAD and RUN, i.e. preface it with a line like below:

Code: Select all

2006 SYS 4622

Greetings,

Michael

User avatar
nippur72
de Lagash
Posts: 405
Joined: Thu Sep 07, 2006 8:35 am

Postby nippur72 » Wed Dec 13, 2006 10:32 am

sorry, I meant 4096 as in normal 8K expansion :roll: :oops:

Mobsie
Vic 20 Drifter
Posts: 31
Joined: Mon Apr 26, 2004 7:51 am

Re: Nippur72 vs "raid on fort knox"

Postby Mobsie » Thu Nov 12, 2015 4:54 am

Great!
Best Regards,
Mike


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 4 guests