Views: 6,702,920 Homepage | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search 03-29-24 10:23 AM
Guest:

0 users reading Firmware factory reset | 1 bot

Main - General - Firmware factory reset Hide post layouts | New reply


Nicknine
Posted on 02-19-21 05:49 PM Link | #3321
On a real DS, it is possible to reset firmware to factory default and bring up the initial setup screen ("Before you begin...") again by removing the battery for a minute and putting it back in. Is there a way to simulate this on an emulator with a firmware ROM?
I've tried zeroing out the last 0x600 bytes in firmware ROM (that's where user settings are stored) but that's not quite it, it brings up "System settings have been lost" screen.

Arisotura
Posted on 02-19-21 06:20 PM (rev. 2 of 02-19-21 06:20 PM) Link | #3322
dunno how that works. I doubt the user settings actually get lost (they're stored in the same memory as the firmware code, so that'd suck big time)

I think it's a flag in the RTC or something in the like. (as far as removing the battery to reset settings is concerned. dunno about the factory-reset part)

____________________
Kuribo64

Nicknine
Posted on 02-19-21 06:38 PM (rev. 2 of 02-19-21 08:35 PM) Link | #3323
Posted by Arisotura
dunno how that works. I doubt the user settings actually get lost (they're stored in the same memory as the firmware code, so that'd suck big time)

I think it's a flag in the RTC or something in the like. (as far as removing the battery to reset settings is concerned. dunno about the factory-reset part)


Hmm, RTC, that's what Desmume dev suggested as well. How does DS store clock? Unix timestamp or something else? Where does melonDS handle it? I can try playing with the code to make it return 0 or other possible sentinel values to see if it triggers initial setup.

EDIT: Here it is: https://github.com/Arisotura/melonDS/blob/master/src/RTC.cpp. From the looks of it, DS returns time in the same structure as GC, counting from Jan 1 2000.

Arisotura
Posted on 02-19-21 08:44 PM (rev. 2 of 02-19-21 08:49 PM) Link | #3325
yup, that's it -- there might be some 'time lost' bit in the status regs.

edit- yeah that's bit7 in status register 1, probably

____________________
Kuribo64

Nicknine
Posted on 02-19-21 09:36 PM (rev. 5 of 02-19-21 09:44 PM) Link | #3327
That was it! I've set bit 7 on status register 1 in the code and it brought up that screen.

[image]

Now I wonder if there's a nice way to implement this on user side in some way...

Nicknine
Posted on 02-19-21 10:51 PM (rev. 4 of 02-20-21 12:20 AM) Link | #3329
Do we know what clean, fresh from the store firmware ROM looks like? I'm guessing the last 0x600 bytes are filled with 0x00 or 0xFF.

EDIT: Doesn't seem like it, filling user area with 0xFF brings up "System settings have been lost" screen even with RTC power lost flag. It probably contains default settings for the region then?


Main - General - Firmware factory reset Hide post layouts | New reply

Page rendered in 0.032 seconds. (2048KB of memory used)
MySQL - queries: 27, rows: 86/86, time: 0.018 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.