Reverse engineered C64 Mercenary

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
IMDS
Posts: 10
Joined: Mon Apr 29, 2019 10:36 pm 0

Reverse engineered C64 Mercenary

Post by IMDS »

Hello.

I originally started on this a few years ago and after working on it on and off for years I've finally got a version of the Mercenary for the C64 disassembled and the basics reverse engineered!

The code assembles with 64TASS runs with SYS 16384 and starts after the intro just before crashing into the planet.

The sound is a bit knackered but the actual game should be fully playable.

Hopefully its of interest to some of you and if anyone has any questions I'll try and answer.

Let me know if anyone is interested in working on an eventual complete reverse engineer.

Thanks, Ian.
IMDS
Posts: 10
Joined: Mon Apr 29, 2019 10:36 pm 0

Re: Reverse engineered C64 Mercenary

Post by IMDS »

Having trouble adding the attachment so the code is at

https://github.com/Ian-McG-1970/c64/tree/main/Mercenary (Novagen) Disassembly V10

Let me know if there are any problems getting access.

Thanks, Ian.
User avatar
TheHighlander
Baa!
Baa!
Posts: 56
Joined: Wed Jun 22, 2022 10:24 pm 0
Location: The Netherlands

Re: Reverse engineered C64 Mercenary

Post by TheHighlander »

I'm getting this when I click the link..

The main branch of c64 does not contain the path Mercenary.
User avatar
TheHighlander
Baa!
Baa!
Posts: 56
Joined: Wed Jun 22, 2022 10:24 pm 0
Location: The Netherlands

Re: Reverse engineered C64 Mercenary

Post by TheHighlander »

Heh...I just had a look at your github.
It looks as though you are using folders for code versioning. The point of git IS code versioning. Which means that if you want to work on a specific version of your code you create what is called a "branch". You can switch between these branches at will and git will restore the version of your code of the branch you pick.

I searched several folders but I couldn't really find any actual code, bar a list of variable definitions.

Mercenary is a fantastic piece of code. It pushes the C64 to do things it doesn't appear to be meant to do, so it'd be interesting to have a proper look at the code. It would be even better if the assemble was ACME style. Then you could use C64Studio do to source code debugging which is a really powerful tool if you're reverse engineering of such an iconic game.
IMDS
Posts: 10
Joined: Mon Apr 29, 2019 10:36 pm 0

Re: Reverse engineered C64 Mercenary

Post by IMDS »

Obviously something went a bit wrong.

If you look at

https://github.com/Ian-McG-1970/c64

There are multiple versions of the disassembly with the latest being

Mercenary (Novagen) Disassembly V11

Containing file

m_0140_cfff_v35.tas

If there are still problems Ill include the file when I get a chance.
IMDS
Posts: 10
Joined: Mon Apr 29, 2019 10:36 pm 0

Re: Reverse engineered C64 Mercenary

Post by IMDS »

hopefully source file is attached and to compile just needs renamed from .txt to .tas
Attachments
m_0140_cfff_v35_tas.txt
(371.32 KiB) Downloaded 122 times
IMDS
Posts: 10
Joined: Mon Apr 29, 2019 10:36 pm 0

Re: Reverse engineered C64 Mercenary

Post by IMDS »

I think it's reasonably well documented - for me anyway.

The maths routines are identified (log conversion, sin and cos calculations, rotations, multiplication, division, perspective, etc).

The object draw routines documented (draw object, draw line, draw point, etc).

The object definitions have been found (the 64 objects that can be interacted with).

The ground structures have been found (256 structures shown on the map (bridges, airports, buildings etc) there are 256 objects but many are duplicated).
he main game loop is shown and the game plays all the way through.

The horizon calculation has been found and needs more understanding.

The roads still need documented and the structure drawing shares a load of code with the object drawing.

The underground rooms need found (they are treated as structures).

The Benson processing and actual adventure part of the game has hardly been looked at.

I would like to reverse engineer the whole game but it's takes a long time to do!

Any help would be appreciated and if anyone would like to document it to the same level as Mark Moxon has already done with Elite / Aviator / Revs then that would be excellent!
User avatar
TheHighlander
Baa!
Baa!
Posts: 56
Joined: Wed Jun 22, 2022 10:24 pm 0
Location: The Netherlands

Re: Reverse engineered C64 Mercenary

Post by TheHighlander »

I've seen Mark's Elite which is amazing. Another example of a complex game that pushed the envelope.

Thanks for the copy of that disassembly. Might have a closer look at that.
Post Reply