Lease this WebApp and get rid of the ads.
Re: Mercenary 2 and 3 with OpenGL
Sat Feb 24, 2018 03:38
2a01:170:1096:1:127b:44ff:fea1:a8ce

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 code until it reaches the loop where the game waits for vertical blank (swap buffers).
Then I skip that loop and trigger interrupt.
I use the captured chip registers to get copper list with color and bitplane pointers.
I convert the bitplanes from planar to chunky and feed the image into an OpenGL texture.
This is still much of a hack, but here is the result: http://download.eversberg.eu/mercenary-hack/firsthack.png

  • Mercenary 2 and 3 with OpenGLAndreas Eversberg, Sun Feb 18 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... more
    • Re: Mercenary 2 and 3 with OpenGL — Andreas Eversberg, Sat Feb 24 03:38
      • 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