Post subject: DSbot: Homebrew app for dsm replays
Experienced player (670)
Joined: 11/23/2013
Posts: 2206
Location: Guatemala
So I came with this stupid idea... how about we make an homebrew app for the DS that can replay dsm movies? Or a device or some flashcard thingy... I know it sounds dumb but I just wanted to share this idea.
Here, my YouTube channel: http://www.youtube.com/user/dekutony
BigBoct
He/Him
Editor
Joined: 8/9/2007
Posts: 1692
Location: Tiffin/Republic, OH
It's not a bad idea in theory; the question is whether Desmume's emulation accuracy is good enough that the DSMs would sync on the hardware.
Previous Name: boct1584
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Would it be even possible? The game would run natively on the system, and the input would have to be somehow fed to it... I suppose that depending on how the DS's OS is designed, this could be achieved with some device driver or custom OS (but it would, of course, require for the OS to be hacked. Depending on how well the DS is designed this can range all the way from trivial to almost impossible.)
Editor, Player (68)
Joined: 1/18/2008
Posts: 663
Who is "we?" Do it and post about it. Otherwise this is nonsensical discussion.
true on twitch - lsnes windows builds 20230425 - the date this site is buried
endrift
Any
Emulator Coder
Joined: 12/14/2014
Posts: 161
Warp wrote:
Would it be even possible? The game would run natively on the system, and the input would have to be somehow fed to it... I suppose that depending on how the DS's OS is designed, this could be achieved with some device driver or custom OS (but it would, of course, require for the OS to be hacked. Depending on how well the DS is designed this can range all the way from trivial to almost impossible.)
DS games don't run in a mode that really has an operating system to speak of. It's pretty close to bare metal. Input is read by talking to memory-mapped I/O registers directly. This isn't possible to change or hook without hardware modifications.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
In modern architectures, if the system is running in protected mode, an application accessing I/O registers or ports directly can be intercepted, and something else done in between. (Basically what happens is that when the program tries to access those registers or ports, the CPU throws an exception and jumps to a predefined location, where the OS or your custom code can do something else, such as return some predefined results.) I do not know if the DS supports or runs in this kind of protected mode. From your description it could well be that it doesn't. (The power button of the DS returns to the home screen, but it might just act as a soft reset button...)
endrift
Any
Emulator Coder
Joined: 12/14/2014
Posts: 161
Warp wrote:
(The power button of the DS returns to the home screen, but it might just act as a soft reset button...)
It only does this on the 3DS. The original DS just shuts off, i.e. a hard reset. While the ARM processors in the DS do have protection modes, I'm under the impression that they aren't really used as they would be in an OS until the 3DS. The DS itself is still pretty bare-bones from the firmware side. Moreover, these registers are explicitly meant to be used from game code, so trapping on those registers A) wouldn't make sense to be a thing to be explicitly supported and B) would trap into the reset vector, which, if the DS is anything like the GBA, is in memory that can't be written. The most feasible approach, actually, would be to hook the input processing routine, but that would need to be determined per game, and injected into the ROM either via an Action Replay-like system or via a flash cart with a modified ROM. But doing any sort of processing, especially, say, buffering input off of a high-latency device such as an SD card in the flashcart, could dramatically alter timings, thus potentially changing if the TAS would actually sync. So even if it can be done, it would break timings. But the only real way to do it would be to patch the ROMs with per-game patches.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
endrift wrote:
Warp wrote:
(The power button of the DS returns to the home screen, but it might just act as a soft reset button...)
It only does this on the 3DS. The original DS just shuts off, i.e. a hard reset.
The DS turns off only if you keep the power button pressed. If you press it briefly, it returns to the home screen. (But as said, this might just be the equivalent of a soft reset. I think the game/program that was running is terminated.)
endrift
Any
Emulator Coder
Joined: 12/14/2014
Posts: 161
Hmm, I haven't had an original model DS in years. The Lite has a switch instead of a button so it doesn't work quite the same. It's probably a soft reset, then, as you said.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Warp wrote:
The DS turns off only if you keep the power button pressed. If you press it briefly, it returns to the home screen. (But as said, this might just be the equivalent of a soft reset. I think the game/program that was running is terminated.)
If there are games that are known to crash then it might be easy to find out if the soft reset is handled by the game.