etabeta's playground

MESS & MAME wip

I love it when a plan comes together!

without comments

Quite often, drivers which are not actively maintained in MAME/MESS suffer of unexpected regressions when some new functionality is added to MAME core. In the case of MESS drivers, similar regressions are seldom immediately reported [1] and it becomes harder and harder to fix them.

Atari 400/800 floppy disks are a good example of this. In the development cycle between 0.129 and 0.130, PIA emulation was converted to use the MAME device framework. Unfortunately, atari.c and related drivers in MESS were strictly entangled with MAME sources, making hard to understand which functions were used by the various components… As a result, the serial communications between computer and floppy drive got lost in the conversion. But no one realized this fact for months!

A couple of weeks ago, cleaning up a bit the MAME side of Atari emulation (used for Max-A-Flex) from MESS specific code, I noticed that there was a function in atarifdc.c which was not used anywhere. Having no clue about its original use, and being without Atari floppy disks to test floppy emulation, I simply decided to ignore it…

Finally, a couple of days ago, Tafoid pointed out that floppy disks were broken in Atari 400 & 800. And he also found out that the breakage had happened after MESS 0.129.

I studied the source and it turned out that the unused function in atarifdc.c (the one I had noticed in the cleaning up process) should not had been unused at all!! Indeed, it was needed to allow communications between the computer and the floppies.

Checking the source changes made when PIA emulation was updated, I found out where the function was required (in the PIA interface for a400 & a800) and I added it back.

Quite sure that I had solved the problem [2], I launched emulation in MESS and…

a800_1

 

What!?!

 

I spent half a day debugging the floppy code with no success, then I decided to try MESS 0.129 and the result was the same… Boot errors and nothing more.

 

WHAT!?!

 

Wasn’t floppy emulation supposed to work in 0.129?

I was really puzzled, until Tafoid told me he was able to use floppies after my fix… Then, I understood: I was using a broken .atr image in my testing!!! LOL!

Google was my friend and, after few minutes, I was finally able to verify that the floppy emulation was indeed fixed!

a800_3

a800_2

Hooray!

Thanks again to Tafoid for the report: without his testing, we could have noticed the regression in 2012 😉

[1] either because no one uses MESS, or because users stick with older versions rather than file a bugzilla report (depending on the case)
[2] Juergen’s code is very solid even years after it’s been originally written

Written by etabeta

May 1st, 2009 at 11:01 am

Posted in MESS

Leave a Reply

You must be logged in to post a comment.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close