Archive for May, 2009
Last weekend, I spent some time to understand why C16 tape emulation was not completely working in MESS.
Since Commodore tape fixes were my first serious contributions to MESS and since C64, C128 and Vic20 tapes were already perfectly working, I had been a bit disappointed when my attempt to fix C16 never produced any result.
I mean, launching C16 in MESS, you were able to load games from cassettes and to play these games. But for some reason the motor was not correctly turned off.
Similarly, recording BASIC programs on tape was not working: the cassette drive was going on and on even after the BASIC routine had printed on screen that saving was finished.
It took me half an hour to spot the mistake in the previous implementation. As a result:
after saving a program….
…you can reload it…
…and it runs (thinking back, it could have been funnier to make the program write “Hora” 😉 )!
Not very exciting, you will probably think. But I’m really satisfied to have moved MESS one step closer to perfect tape emulation for Commodore drivers!
No luck with PET cassettes, unfortunately. Those still remain in my TODO list and might be fixed sometimes in the future…
In the meanwhile, a lot of skeleton drivers have been included in MESS and Curt Coder has done astounding progresses on my barely sketched Kyocera driver. You can now fully enjoy Olivetti M10, Tandy TRS Model 100, NEC PC8201A and Tandy Model 200 (and even some of their successors), by compiling the current svn source! Or you can wait for MESS 0.132…
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  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 , I launched emulation in MESS and…
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.
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!
Thanks again to Tafoid for the report: without his testing, we could have noticed the regression in 2012 😉
 either because no one uses MESS, or because users stick with older versions rather than file a bugzilla report (depending on the case)
 Juergen’s code is very solid even years after it’s been originally written