Menu

0.70.2b release info, increase in available memory

I figure I'll break this one into a timeline, seeing as there was only a single day of development between 0.70.1b and 0.70.2b:

- I received some more reports of more games that were verified working in older versions of MAMEoX that didn't work in 0.70.1b.
- Started looking (again) into ways to free up more memory.
- During my search, I tried merging all the various driver code/data/bss/const sections into one section per driver. I tested it, and realized that apparently it had actually hurt the amount of memory available.
- This prompted me to look into why concatenating sections would use up so much more memory. During testing, I found that unloading the driver sections did _nothing_.
- Started wondering why that was, realized that you could theoretically have more than one section on a single page in RAM. Therefore there would have to be refcounting to ensure that you didn't free up a page just because one of the sections within it were free'd.
- Realized that MAMEoX immediately loads all the driver sections, even though they should be preloaded when the XBE is booted up. This sets the refcount on _every_ driver to 2, so they don't get unloaded.
- Took out the call to load the sections, watched memory go from 32 megs free to 50 megs free.
- Jumped up and down
- Enabled code to sectionize CPU's
- Tested Golden Axe 2 (xdelusion's post reminded me that I used to play and enjoy Golden Axe at a bowling alley when I was a kid. The fact that it didn't work, but had worked in the past prompted me to do all this testing). GA2 failed.
- Debugged trying to figure out WTF was wrong. Found out that I was unloading the CPU section just before I loaded it, but after some initialization was done by MAME. Therefore, anything malloc'd by the CPU code was free'd back to the heap and invalidated, causing everything to go to hell.
- Fixed it by incrementing the refcount of the used CPU's before unloading the unused CPUs
- Tested in debug mode, works fine.
- Started a build in retail mode, got some food.
- Tested GA2, and some other titles in Retail mode (removing the code to load the driver sections was what broke the 0.66b release). Seemed to work fine, so I made a release.
- Release mode crashed just like 0.66b did, so I looked at all of the optimization options trying to figure out what could be wrong. Tried turning off String Pooling, as I figured it could cause additional dependencies between XBE sections. Tested, and this seems to be the case.

So there you have it. 0.70.2b should increase the number of working games, and should eliminate most of the reports of games working in older versions of MAMEoX that don't work today (keep them coming if you find them though).

The plan right now is to do some testing over the weekend and release on Monday. If anybody has the inclination, please grab the latest off of CVS and let me know if you see problems.

Posted by Erik Abair 2003-06-20

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.