Jump to content

Haze WIP


Robert

Recommended Posts

Simple Bugs..

It amazes me sometimes how much users of MAME moan and complain about certain bugs, when if they simply put a fraction of the effort they do complaining into trying to fix the bug then they’d almost certainly be able to fix it.

 

Mysterious Stones has been broken since around MAME 0.77u2. There are a few bad tiles near the start of the first levels, and by the 2nd level it’s apparently unplayable.

 

I took a quick glance at the vidhrdw/mystston.c file in MAME and saw the following code.

 

 

WRITE8_HANDLER( mystston_videoram_w )

{

    if (videoram[offset] != data)

    {

        videoram[offset] = data;

        tilemap_mark_tile_dirty(fg_tilemap, offset & 0×3ff);

    }

}

 

WRITE8_HANDLER( mystston_videoram2_w )

{

    if (videoram[offset] != data)

    {

        mystston_videoram2[offset] = data;

        tilemap_mark_tile_dirty(bg_tilemap, offset & 0×1ff);

    }

}

 

 

the error stands out a mile, even if you’re not a programmer an error like that shouldn’t be too hard to fix. The mystston_videoram2_w handler is broken. As an optimization the code is meant to check if the contents of videoram is the same as the value being written to it, and then only write it if it isn’t the same. The mystston_videoram2_w handler is checking the wrong video ram. The bug was obviously introduced as the result of a simple copy & paste error.

 

fixing the bug simply involved changing

 

if (videoram[offset] != data)

 

 

to

 

if (mystston_videoram2[offset] != data)

 

 

in WRITE8_HANDLER( mystston_videoram2_w )

 

A _very_ simple one line fix. The source is available so people can make fixes like this.

>> Before and After pictures HERE.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...