gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > Idea: DS play time tracker

#144389 - Davey - Thu Nov 01, 2007 1:48 pm

I figured something which records how long you've played games for (like a mini-Xfire)? I don't know if this is possible, but it would be awesome.

[Tetris]: 26 hours 13 minutes
[Mario Kart]: 4 hours 6 minutes
[Age of Empires - Age of Kings]: 7 hours 48 minutes
[Sim City]: 0 hours 10 minutes
[Homebrew Game Name Here]: 76 hours 1 minute

[Total]: 114 hours 8 minutes

Any feedback would be appreciated.

[Here's some feedback: Specific titles are appreciated. -- Subject Fairy]

#144392 - Lick - Thu Nov 01, 2007 2:07 pm

You write it!
_________________
http://licklick.wordpress.com

#144393 - Davey - Thu Nov 01, 2007 2:12 pm

Yeah that would be possible, since I don't do coding these days and was never any good at it anyway.

#144395 - simonjhall - Thu Nov 01, 2007 2:29 pm

Excel spreadsheet?
_________________
Big thanks to everyone who donated for Quake2

#144397 - Davey - Thu Nov 01, 2007 3:40 pm

I was simply putting forward an idea. Not asking anyone to code it. I wanted to see some feedback of what it would be like having something like that as a DS application.

And since this seemed like the right forum to put it in, well..

Next time I shaln't bother if all I get is sarky remarks.

#144398 - simonjhall - Thu Nov 01, 2007 4:14 pm

Sorry, that was actually a serious suggestion!
You'd also be able to graph and categorise stuff, to see what kind of things you play the most etc... Writing a bespoke bit of software when something else is available takes time away from actually playing the games ;-)
_________________
Big thanks to everyone who donated for Quake2

#144400 - Tikker - Thu Nov 01, 2007 4:24 pm

you'd have to have something that could constantly run in the background while you're playing

taking up resources

#144410 - sonny_jim - Thu Nov 01, 2007 6:59 pm

It would probably be possible by rewriteing the flashcart firmware but seeing as talking about commercial roms is frowned upon here I don't see this as a useful discussion. Maybe it would be more suited to the forums at scdev?

#144413 - zzo38computer - Thu Nov 01, 2007 7:38 pm

Since commercial DS game cards all use the same ARM7 code (or maybe a different version of it), you could load it in ARM7 code and you need a SLOT-2 device with switches and stuff so that it saved it automatically. I have posted a message on here a long time ago about ARM7 hacking to run custom ARM7 code and use the ARM9 code from the DS game card, but not this specifically. This could just be a idea it is used for. Another idea would be to use this kind of ARM7 hacking to add a function to act as the DEBUG button to see if any games use it.
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.

#144514 - HyperHacker - Sat Nov 03, 2007 3:30 am

The real problem I see with this idea is that you'd need a reliable way to hook into both commercial and homebrew games to keep track of how long they ran, and a place to store that information. Using the filesystem means your added-in routine is going to be pretty big, and using anything flash-based (filesystem, firmware, etc) risks wearing it out. Hooking commercial games isn't too difficult, but I imagine homebrew, having much less standardization and restrictions and the ability to use your own ARM7 binaries, would be a lot harder. In any case a routine that you add into a compiled binary at runtime has to be very small (so as to fit into available memory) and use very little CPU power (so as not to lag the game), needs a reliable hook, and may set off anti-hacking mechanisms in the game or cause unexpected side effects.

The idea of hacking official ARM7 binaries to be able to trigger the debug button at will is a nice one, but it's not really on topic in this thread, and anyway it probably only does anything if the game is running on a debug system. You could make them think they are (there's an SWI call that tells if they are or not), but then they'll expect to have 8MB of RAM to work with. Anyway any functions that would use the debugging hardware are probably removed from final builds. Better to make/modify a decent emulator to emulate the button, SWI call, and extra RAM.
_________________
I'm a PSP hacker now, but I still <3 DS.

#144532 - Dan2552 - Sat Nov 03, 2007 3:04 pm

weren't there some plans to get some kind of nitrohax things into the DS firmware space?

Get rid of pictochat + dsdownload play for a bit more space, you can keep them using the firmware NDS file on your flashcard.

Couldn't somekind of nitrohax thing simply add a minute played of your last game and maybe save to a certain part of the firmware or even the flashcard if possible?

Homebrew games could simply just have the code built right in, if the developer decides to want it.

#144540 - HyperHacker - Sat Nov 03, 2007 5:25 pm

There was mention of trying to fit it into the firmware, but there's not much free space in there and hacking the firmware is apparently not easy. It'd be more feasible with a homebrew firmware. Still, writing to flash every minute isn't very good.
_________________
I'm a PSP hacker now, but I still <3 DS.

#144549 - simonjhall - Sat Nov 03, 2007 6:36 pm

Well I guess if you're going to be hacking an ARM7 binary you're gonna have to be playing from something that allows you to play romz, right?

Adding some code into the '7 binary to record play time wouldn't be too hard, and when you're done playing (and want to record the stats to disk or whatever) you could press some magic key combo which'll lock up the ARM7 program. However, as you do this you could pull a piece of code appended to the end of the rom, replacing the ARM7 program. This piece of code would be able to switch the flash card into disk mode (assuming it was a slot-2 card) and then mount the card's file system. You'd then save the stats and stay hung.

Sounds like an awful lot of work! Spread...sheet...
_________________
Big thanks to everyone who donated for Quake2

#144565 - Dan2552 - Sat Nov 03, 2007 10:06 pm

HyperHacker wrote:
There was mention of trying to fit it into the firmware, but there's not much free space in there and hacking the firmware is apparently not easy. It'd be more feasible with a homebrew firmware. Still, writing to flash every minute isn't very good.


Chishm was thinking of putting in the in-game back-light changer into the firmware.

The posts are scattered around in this thread:
Flashme v8

There's no reason to keep pictochat+ds download play in the firmware when theres a NDS file that includes them.

All would be needed is a counter of how many minutes have been played and a button combo to save the number to firmware or something.

I'm not saying it's easy. It's obviously not, and I really don't see this being made by anyone. But you can't just ignore the possibility.


Maybe even launch the game from nitrohax from your flashcard which does the same thing. I don't know is if there's RAM space for the counter and if it's possible to make it save the time played for each game anywhere in the firmware (especially without needing to flash just to do that)

#144576 - chishm - Sun Nov 04, 2007 2:56 am

Pen & paper. If you can remember to press a certain button combination just before turning off the game (to record the play time), then you can remember to write down the time on a piece of paper. It's significantly less work to implement, it doesn't need a PC handy (pfft spreadsheet :-p ), and it works with any game, including homebrew.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#144579 - tepples - Sun Nov 04, 2007 3:17 am

[pink-floyd]
Wii don't need no pen and paper.
Wii don't need no buttons pressed.
[/pink-floyd]

I think Wii just writes the app name to the flash every minute.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#144587 - HyperHacker - Sun Nov 04, 2007 6:02 am

simonjhall wrote:
Well I guess if you're going to be hacking an ARM7 binary you're gonna have to be playing from something that allows you to play romz, right?
Not necessarily.
_________________
I'm a PSP hacker now, but I still <3 DS.

#144589 - simonjhall - Sun Nov 04, 2007 12:02 pm

So how does that work then?
_________________
Big thanks to everyone who donated for Quake2

#144591 - Lick - Sun Nov 04, 2007 12:26 pm

Load homebrew, insert DS game (the card will be uninited), init the card, copy the binaries from card, hack the binaries, soft-reset to start game.

It's probably a easier said than done, since you have to deal with memory overlaps and not to mention the card initing.
_________________
http://licklick.wordpress.com

#144593 - simonjhall - Sun Nov 04, 2007 12:45 pm

W-how! Some people have a bit too much talent ;-)
_________________
Big thanks to everyone who donated for Quake2

#145563 - coolbho3000 - Sun Nov 18, 2007 4:21 am

Here is a simple solution to this problem. I'm not absolutely sure it will work, that is for you to decide.

Before a homebrew game is launched, the flashcart makes note of the current time and saves it in a temporary file. When the game is ended (via soft-reset) the flashcart then takes the difference between the saved time and the current time. The difference in time is then written in a record file, along with the title of the game.

This probably could be done for the Acekard RPG as the firmware is open source, although I'm not sure how it could be implemented into closed source cards. Maybe writing a shell?

However, owning an R4, I know that soft reset only works with commercial games. Why is this? Also, time will not be recorded using this method if the DS is turned off directly instead of soft resetting, which is a huge problem. I must ask, is it be possible to map the power button to soft reset?

#145566 - tepples - Sun Nov 18, 2007 5:12 am

coolbho3000 wrote:
However, owning an R4, I know that soft reset only works with commercial games. Why is this?

R4 firmware probably hooks some standardized code in NitroSDK.

Quote:
I must ask, is it be possible to map the power button to soft reset?

If this were possible, the DS firmware would have already done it. One of the biggest complaints when the DS first came out was the loss of power whenever the user leaves PictoChat, DS Download Play, or Settings. This behavior is still present in the Lite.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#145585 - coolbho3000 - Sun Nov 18, 2007 4:00 pm

However, do you think this is a practical solution, tepples? Is there any way to soft reset a homebrew?

#145591 - tepples - Sun Nov 18, 2007 4:54 pm

coolbho3000 wrote:
Is there any way to soft reset a homebrew?

Try searching for rebootlib.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#145612 - coolbho3000 - Mon Nov 19, 2007 1:44 am

I mean, soft reset as in the card firmware patches the .nds file.

#145616 - dantheman - Mon Nov 19, 2007 4:08 am

The Supercard DS is able to patch homebrew to soft-reset. I don't have one myself so I can't really test the compatibility, but I've heard it works decently.