Lease this WebApp and get rid of the ads.
Andreas Eversberg
Mercenary 2 and 3 with OpenGL
Sun Feb 18, 2018 03:25

Many years ago I asked for the source code of MDDClone. My goal was to add OpenGL support for Mercenary 2 and 3 with increased resolution and frame rate. Later I wanted to improve graphics.

I wonder how MDDClone was made. Is it a result of reverse engineering the way the game works and a complete re-write? Or is most of the game code emulated (or recompiled) from 68000 binary? Or is it something in between?

I divide the Game in three parts:
- Graphic routines to render the 'universe'.
- IO routines to get input from keyboard and access the disk for saving/restoring game states.
- Game routines to handle the game play.

I want to replace the original graphics routines by OpenGL, so they would run faster and would be independent from the Amiga's resolution.

I don't want to add any graphical feature, except for rendering speed and resolution. Many years I thought about how to improve the graphics, but finally I decided to leave it as it is. Adding features to the graphics would destroy the spirit of the game in my opinion.

    • Re: Mercenary 2 and 3 with OpenGLAndreas Eversberg, Sat Feb 24 03:38
      Instead of rewriting the game or using MDDClone, I tried this approach: I compiled an m68k emulator source code together with some SDL code and the game binary. I let the emulator execute the machine ... more
      • Making progressAndreas Eversberg, Sat Feb 24 09:59
        Image is good (filtered in this case), now sound....
        • WowEnjo, Sat Feb 24 10:07
          Nice one. How did you do it in a nutshell? Did you dissasemble the binary?
          • Re: WowAndreas Eversberg, Sat Feb 24 11:04
            Hi Enjo, I made an old disassembly back in the late 90's. I used it to reverse-engineer the code. In my current work I use the binary only and let it interpret with the CPU emulation. I found the... more
            • Re: WowEnjo, Sun Feb 25 01:40
              Interesting. Aren't there any noticeable slowdowns due to emulation?
              • Re: WowAndreas Eversberg, Sun Feb 25 12:15
                A few thousand emulated instructions per frame is not much for a modern CPU. Paul did the rendering very efficient. planar2chunky with 320x200 and sound re-sampling is not a big deal also.
    • Re: Mercenary 2 and 3 with OpenGLsparkynz74, Sun Feb 18 23:38
      Good luck with that Andreas. I have tried and tried to get a response from the MDDClone author but he never answered. After that I decided to try disassembling the Amiga version of Mercenary and... more
      • Re: Mercenary 2 and 3 with OpenGLEnjo, Mon Feb 19 22:48
        "I reckon it would be good to have the option of wireframe or simple filled polygons to had some solidity to it." As far as I remember, the game data contains the vertices only, without any... more
    • Re: Mercenary 2 and 3 with OpenGLEnjo, Sun Feb 18 23:30
      The goal you're trying to achieve is on my long term todo list. MMDClone is a result of reverse engineering at first. Then the routines were packed in more or less OOD C++, still having many inline... more
      • Re: Mercenary 2 and 3 with OpenGLsparkynz74, Sun Feb 18 23:42
        Enjo, isn't is just as easy to rewrite the whole game engine in your favourite language (C++) and load the Amiga binary data into memory. Then you can just access the various parts of the Amiga... more
        • Separation of conceptsEnjo, Mon Feb 19 22:51
          The data is available almost in cleartext, so no - a memory dump wouldn't be reasonable, at least for me. But through a clear separation of concepts, it will be easier to renew the old routines into... more
  • Click here to receive daily updates