Kevin Vance - Porting MegaZeux to the DS now has two subprojects: Handling "out…

Entries | Archive | Friends | Friends' Friends | User Info

08:36 pm

Saturday, September 1st, 2007
Previous Entry Share Next Entry
Tags, ,

Porting MegaZeux to the DS now has two subprojects:
  1. Handling "out of memory" errors: old versions of MegaZeux used to do this, but not anymore. After the executable is loaded into RAM, there is only ~3MB left for the game. This makes it very easy to run out of memory when playing newer MZX games or those that have many/large sound effects and music.

    Fixing this requires auditing 232 malloc() and realloc() calls. Of what I've looked at so far, only the audio subsystem seems to check for memory errors, and only about half the time.

    I'm doing this in a separate branch from the DS port. Since it benefits anyone else doing a "small device" port, I'd like to get it merged into MZX proper.

  2. Making use of DS memory expansion cards: another couple megs from your SuperCard or Opera RAM card will fix those out of memory errors. There's already a library for accessing the various different models, but that's the easy part. You still can't do 8-bit accesses, so any code that uses the extra RAM will have to be modified. If your slot-2 device does both FAT and RAM, you can't read from the filesystem directly into extended memory either.

These projects are not required for a simple test version that can only play Caverns, since the protection unit will simply cause a crash when you run out of memory.

More pressing is the fact that saving the saving your game causes filesystem corruption :P

Link )Reply )