Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Couchpotato4life
  1. spleenharvester's Avatar
    CrackBerry Newbie

    Posts
    3 Posts
    Thread AuthorThread Author   #1  

    Default Mega Drive Emulators other than DGEN?

    Hey all,

    DGEN works superbly for me... except for the save and load function. most of the time it just gives me "Couldn't save to slot 0!" or "Couldn't load slot 0!". It does work, however, every once in a blue moon.

    I'm getting a bit tired of having to restart the game each time I come to play.

    Does anyone know how to get DGEN working? Or any alternative Mega Drive emulators?

    Thankyou all!

    EDIT: Found what looks to be the source code on Github if anyone has any ideas.

    Code:
    // Save/load states
    // It is externed from your implementation to change the current slot
    // (I know this is a hack :)
    int slot = 0;
    void md_save(md& megad)
    {
    	FILE *save;
    	char file[64];
    
    	if (((size_t)snprintf(file,
    			      sizeof(file),
    			      "%s.gs%d",
    			      megad.romname,
    			      slot) >= sizeof(file)) ||
    	    ((save = dgen_fopen("saves", file, DGEN_WRITE)) == NULL)) {
    		snprintf(temp, sizeof(temp),
    			 "Couldn't save state to slot %d!", slot);
    		pd_message(temp);
    		return;
    	}
    	megad.export_gst(save);
    	fclose(save);
    	snprintf(temp, sizeof(temp), "Saved state to slot %d.", slot);
    	pd_message(temp);
    }
    
    void md_load(md& megad)
    {
    	FILE *load;
    	char file[64];
    
    	if (((size_t)snprintf(file,
    			      sizeof(file),
    			      "%s.gs%d",
    			      megad.romname,
    			      slot) >= sizeof(file)) ||
    	    ((load = dgen_fopen("saves", file, DGEN_READ)) == NULL)) {
    		snprintf(temp, sizeof(temp),
    			 "Couldn't load state from slot %d!", slot);
    		pd_message(temp);
    		return;
    	}
    	megad.import_gst(load);
    	fclose(load);
    	snprintf(temp, sizeof(temp), "Loaded state from slot %d.", slot);
    	pd_message(temp);
    }
  2. Couchpotato4life's Avatar
    CrackBerry Newbie

    Posts
    3 Posts
    Global Posts
    6 Global Posts
    #2  

    Default

    Sorry for adding no value to the conversation since I can't help. I am just a beginner at programming but I found it interesting to see a snippet of the code as to how these emulators work. So thank you.
    spleenharvester likes this.

Similar Threads

  1. Replies: 0
    Last Post: 11-14-2009, 10:47 PM
  2. Weather Application other than On Demand????
    By jerenluken in forum BlackBerry OS Apps
    Replies: 14
    Last Post: 12-26-2007, 01:06 PM
  3. any other software other than DM??
    By cmozaeko in forum BlackBerry Pearl 81xx
    Replies: 6
    Last Post: 12-17-2007, 06:27 AM
  4. Replies: 1
    Last Post: 11-18-2007, 12:37 AM
  5. How to use email on network other than original configured for phone..?
    By andy5128 in forum General BlackBerry Discussion
    Replies: 1
    Last Post: 08-26-2007, 10:42 AM

Posting Permissions