Sunday, February 12, 2006

 

Enhancing games using specialized drivers

Some really great classics have been produced for the MSX system. Take for example the Nemesis saga, or Knightmare. All fantastic games, but they did reveal a very important technical shortcoming of the MSX(1) system: The inability to create colourful graphics and having a smooth scroll.
So the MSX1 gamers just had to settle with jerky background scrolling. Although the gameplay was still fantastic, it did influence the whole experience.

So, what would be cooler than be able to replay those exact same games using emulation, but with a specialed driver which makes the games' backgrounds scroll smoothly?
That's exactly what I've been working on.

The idea is to separate the background rendering and the sprite rendering, and introduce a pixel offset for the playfield.
In Knightmare, I found a memory location which seems to keep track of the vertical background position, which I use to sync the pixel offset with. When that value in RAM changes, the pixel offset is reset to 0, otherwise it's increased every 8 frames. So, 64 frames are needed to 'blend' from one background scroll position to the next.
One thing I had to take care of; the pixel offset only had to be updated when the memory location was changing so in the end the code looks something like this:

vdp.renderBackground();
mem_old = mem;
mem = RAM[background_pos];
if (mem_old != mem) {
timer = 0;
scroll = 0;
}
timer++;
if (timer < 64) { // stop scrolling when the background pos. isn't updated
scroll++;
}
updateBackgroundPosition(scroll / 8);

In Knightmare, it works a treat and the background scrolls as smoothly as a baby's bum in the new specialized driver.

In the Nemesis games however, things are more complicated.
For example, there are the background stars which do scroll smoothly in the originals. Actually, it's a trick, but they are part of the background so if I start implementing the smooth scroll on top of that, the background stars don't move so great anymore.

The answer is to patch the rom to make the stars scroll jerky, together with the rest of the background.
Today an MSX user (BiFi) mailed me with patched roms of the whole nemesis saga where he disabled the trick of smoothly moving the background stars!

There are however more hurdles to overcome... More later.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?