Jump to content


Photo

Drmd Loosing Its Savestates...


32 replies to this topic

#16 miq01

miq01

    GP32 Hardcore

  • GP32 Hardcore
  • PipPipPipPip
  • 259 posts
  • Location:Barcelona, Catalonia

Posted 12 December 2005 - 04:59 PM

To flush to a file use this its exactly what you want and the normal thing to do when you really need to make sure a file is written now!! rather than when the app closes its a very under used function but applications where data integrity is vital will normaly call it after every write.

Nice... I'll try that.

#17 white

white

    Member

  • Members
  • PipPip
  • 15 posts
  • Location:Aberystwyth, Wales

Posted 12 December 2005 - 05:49 PM

To flush to a file use this its exactly what you want and the normal thing to do when you really need to make sure a file is written now!! rather than when the app closes its a very under used function but applications where data integrity is vital will normaly call it after every write.

Nice... I'll try that.

View Post


fclose() will perform fflush() automatically - so your buffered data will be written to the file system. However, that's not the problem - what you really need to do is call sync() after fclose(), which causes all filesystems to flush their writeback caches to the physical device.

http://seth.positivi.../man.cgi/2/sync

is a link to the man page, but it's just void sync(void); and can be found in unistd.h

#18 white

white

    Member

  • Members
  • PipPip
  • 15 posts
  • Location:Aberystwyth, Wales

Posted 12 December 2005 - 05:55 PM

To flush to a file use this its exactly what you want and the normal thing to do when you really need to make sure a file is written now!! rather than when the app closes its a very under used function but applications where data integrity is vital will normaly call it after every write.

Nice... I'll try that.

View Post


fclose() will perform fflush() automatically - so your buffered data will be written to the file system. However, that's not the problem - what you really need to do is call sync() after fclose(), which causes all filesystems to flush their writeback caches to the physical device.

http://seth.positivi.../man.cgi/2/sync

is a link to the man page, but it's just void sync(void); and can be found in unistd.h

View Post


Oh, forgot to mention that you can download a .gpu script which will do the same thing. Just run it after leaving your emulator and before switching off the gp2x and your savestate will be fine.

http://www.gp32x.com...showtopic=22938

#19 Quiest

Quiest

    I like turtles!

  • GP Guru
  • 3062 posts
  • Gender:Male
  • Location:Dteuschland ;)
  • Interests:Bla. Blabla. Blablabla. Blablablabla. Do you really have to read every crap?

Posted 12 December 2005 - 06:05 PM

Sweet, thanks!

#20 TwoHeadedBoy

TwoHeadedBoy

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 384 posts
  • Gender:Male
  • Location:Liverpool, UK

Posted 12 December 2005 - 06:27 PM

Hallelujah, I go away for a couple of days and come back to find DrMD ready!
Just downloaded it now, gonna have some fun. Will also have to change my sig :P

#21 Guest_Reesy_*

Guest_Reesy_*
  • Guests

Posted 12 December 2005 - 07:00 PM

Thanks for all the advice, sync() will now be appearing in a DrMD near you. I might get chance to fix this and a couple of other bugs tonight. I'll let you all know ;)

#22 Quiest

Quiest

    I like turtles!

  • GP Guru
  • 3062 posts
  • Gender:Male
  • Location:Dteuschland ;)
  • Interests:Bla. Blabla. Blablabla. Blablablabla. Do you really have to read every crap?

Posted 12 December 2005 - 08:38 PM

You didn`t fix the flickering menu yet, no? Just asking because you said it`s much work... :)

#23 Guest_Reesy_*

Guest_Reesy_*
  • Guests

Posted 12 December 2005 - 08:52 PM

Nah I haven't implemented quad buffering in 16bit mode yet, in fact I've not touch DrMD since the last release. I was suffering a bit of burnout so I've had a couple of days off. Might get some stuff done though :)

#24 miq01

miq01

    GP32 Hardcore

  • GP32 Hardcore
  • PipPipPipPip
  • 259 posts
  • Location:Barcelona, Catalonia

Posted 12 December 2005 - 09:53 PM

fclose() will perform fflush() automatically - so your buffered data will be written to the file system. However, that's not the problem - what you really need to do is call sync() after fclose(), which causes all filesystems to flush their writeback caches to the physical device.

Just to confirm that it works. I opened Tilematch, played for one minute, saved my score, and immediately after that, I turned GP2X off without quitting. After starting again, that score was there. Thanks!

#25 God Ginrai

God Ginrai

    Godmaster

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 3514 posts

Posted 12 December 2005 - 10:38 PM

Heya guys,

I'm having trouble with DrMD. I am launching a rom ( for instance, Sonic3), playing a tad, then making a savestate ( L+R to go back in menu, i select "save state", choose slot0, menu says slot is used, perfect, fine).

I can then load it just fine, it works flawlessly.

However, sometimes, when i load back DrMD, it says that no savestate is used... i know somebody which had the same bug, all savestates disappearing.

I have trouble reproducing it though ( sorry reeesy, can't give you more info).

Anyone else has the very same problems ?

View Post


First off, why are you using Savestates with Sonic 3? I'm pretty sure that ROM can save onto itself, no save state required. (If it's not a dirty rom that is)

#26 Guest_Reesy_*

Guest_Reesy_*
  • Guests

Posted 12 December 2005 - 10:41 PM

Because you would have the same problem. I never use sync(), so even after saving a sram file, if you switch the gp2x before linux decides to actually write the file to disk you will be buggered.

I've just tested sync and it looks like it fixes the problem. I'll release another version a bit later then you lot can do your worst to it :)

#27 triton

triton

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 489 posts

Posted 13 December 2005 - 04:51 AM

i hope you can get to fixing the menu thing sometime soon, it gets very distracting, and the savestate thing, i lost my save for gunstar heroes because of that :( had the game almost beat too. but drmd is simply awesome and keep up the great work man! if i had any money i would donate some to ya!

#28 Tetedeiench

Tetedeiench

    GP32 User

  • Members
  • PipPipPip
  • 73 posts

Posted 13 December 2005 - 06:14 AM

Heya guys,

I'm having trouble with DrMD. I am launching a rom ( for instance, Sonic3), playing a tad, then making a savestate ( L+R to go back in menu, i select "save state", choose slot0, menu says slot is used, perfect, fine).

I can then load it just fine, it works flawlessly.

However, sometimes, when i load back DrMD, it says that no savestate is used... i know somebody which had the same bug, all savestates disappearing.

I have trouble reproducing it though ( sorry reeesy, can't give you more info).

Anyone else has the very same problems ?

View Post


First off, why are you using Savestates with Sonic 3? I'm pretty sure that ROM can save onto itself, no save state required. (If it's not a dirty rom that is)

View Post


Because i'd rather loose a sonic3 savestate than a Story of thor :D that's the reason why :)

I'm happy this is fixed :)

#29 white

white

    Member

  • Members
  • PipPip
  • 15 posts
  • Location:Aberystwyth, Wales

Posted 13 December 2005 - 09:26 AM

Because you would have the same problem.  I never use sync(), so even after saving a sram file, if you switch the gp2x before linux decides to actually write the file to disk you will be buggered.

I've just tested sync and it looks like it fixes the problem.  I'll release another version a bit later then you lot can do your worst to it :)

View Post


I think we ought to put a reminder to call sync() after fclose() somewhere in the development help docs...

#30 Tetedeiench

Tetedeiench

    GP32 User

  • Members
  • PipPipPip
  • 73 posts

Posted 13 December 2005 - 10:49 AM

Reesy, the new DrMD version is solving the problem... working great great great !

Love you :)



Reply to this topic