RachelB
She/Her
Player (129)
Joined: 12/3/2011
Posts: 1579
Np, glad you got it working.
Post subject: IMPORTANT INFO ABOUT RECOVERING DTM FILES IF DOLPHIN CRASHES
Active player (335)
Joined: 1/19/2010
Posts: 383
Location: Texas
So I TASed an area in Resident Evil 4 for about 2 hours, just to manipulate some item drops. The moment I finally manipulate the drop I need, Dolphin crashed! However, I realized that if you go to the "statesaves" folder in the "user" folder, whichever state that you last saved to, look at that DTM file with that savestate number, and it contains the button presses before the crash. Idk if this is common knowledge among Wii-TASers, but good info regardless. Example: 1. TASing, savestate5 2. Dolphin crashes 3. Go to User->Statesaves->G4BJ08.s05.dtm is your button file This saved my sanity for yet another day, and hope it will yours.
RachelB
She/Her
Player (129)
Joined: 12/3/2011
Posts: 1579
There's a message saying it saved the .dtm every time you save a state :P
Active player (335)
Joined: 1/19/2010
Posts: 383
Location: Texas
rog wrote:
There's a message saying it saved the .dtm every time you save a state :P
I perceived it as saving the savestate, although it says ".dtm". My PC didn't recognize them as Dolphin files though; I had to manually go in and say "open with Dolphin" for them to be recognized. Initially it looks like "G4BJ0X.s0X" with the .s0X being the file extension of the savestates, but either adding .dtm or saying "open with Dolphin" fixed that. So the dtm files have an extension in the file name, but it wasn't that file type. It just confused me is all, as I was seeing two copies of what appeared to be the same file in the folder. :p BTW, when trying the "export recording" option is what causes Dolphin to crash on me sometimes. Is there a way to look at the buffer(s) or memory that Dolphin is using to remember the button presses, without saving a dtm file? This way if Dolphin crashes we can recover that data if we hadn't done a savestate.
Active player (322)
Joined: 1/15/2012
Posts: 343
Hi ! I have a desynch... on a Wii Game. So yeah, I found this, but as you can see the Wii section is in to-do. And when I open my .dtm file, I got this : http://image.noelshack.com/fichiers/2012/24/1339755796-HEx.png ... So I can see the game ID and... uh... that's about it... Does somebody have any information about how to read (and edit) this file ? Thanks.
Joined: 3/20/2009
Posts: 87
I'm not sure if this is 100% correct but I think Wii DTM files store the USB frames sent by the controller. At offset 0x100, the frames are stored this way: The first byte is the number of bytes in the frame, followed by the frame. Repeat until the end of the file. Unfortunately, I think USB frames are sent at 100Hz instead of 60Hz (I'll have to double check in the source), so any hexing of this will be very, VERY difficult.
Active player (322)
Joined: 1/15/2012
Posts: 343
Hmmm, and if I redo the level where it desyncs with the EXACT same number of frame, and then copy/paste those frames ? Also, it seems like I need to remove one frame... but of course, Dolphin puts an error. I guess it's because the new number of frame doesn't correspond to the one in the file. Where can I find it ? (At the beginning I guess but... :p ) EDIT: Never mind, I found where the number of frame is. Still give me an error hehe
Post subject: Any interest in a dtm editor?
Joined: 12/31/2009
Posts: 174
Is anybody interested in a dtm editor? I'm working on a simple python library for modifying dtm files or even creating them from scratch. It is currently low-level so the data in each frame isn't deciphered (yet). At the moment, the library can unpack the header data from a dtm file into a more user-friendly form which can be packed into binary data to be written to a dtm (same or new, doesn't matter). The library also breaks up all the frames into a list so you can move, copy, delete, modify, or add frames. The library can of course write the frames to a dtm file. There is also basic integrity checking (input count is accurate, right file type, last frame isn't incomplete, etc). I probably won't create a gui for this but I will try to add useful shortcuts to make it easier on people new to Python interpreter. I'll upload it once it reaches a more complete form along with a tutorial.
Soig
He/Him
Skilled player (1515)
Joined: 12/4/2010
Posts: 252
How to edit DTM with hex editor? I want to add some frames with no input. But I don't know how to add them. And it seems that DTM recording has bug? For example, I input on frame 1813. But when playback, DTM input on frame 1810. How to deal with it? (I use 3.5-228. And my computer can't run newer version. Because my computer has some problems, it can't run 64-bit version. And 32-bit newer version need OpenAL32.dll. So 3.5-228 is the final version for me.)
Emulator Coder, Skilled player (1112)
Joined: 5/1/2010
Posts: 1217
Soig wrote:
How to edit DTM with hex editor? I want to add some frames with no input. But I don't know how to add them.
Gamecube controller or Wiimote? Also, if wiimote, which input type is the game using? How "empty" frames are added actually differs between the two (since format of input is different). Here are the docs about DTM: Wiki: DTM
Soig
He/Him
Skilled player (1515)
Joined: 12/4/2010
Posts: 252
Wiimote. Input type? What is it?
Emulator Coder, Skilled player (1112)
Joined: 5/1/2010
Posts: 1217
Soig wrote:
Wiimote. Input type? What is it?
Is this New Super Mario Bros Wii? If it is, looks like the game is using type 0xA1 0x35 (I checked the submitted movie file). Each frame (except first very few ones) is 0x18 (24) bytes in length and starts with (17 A1 35). The next two bytes are buttons and then there are three bytes of acceleration data. Final 16 bytes would be extension data, but it seems that all frames have 3E E8 22 9C F8 6D 00 00 00 00 00 00 00 00 00 00 If you add frames, remember to update the frame count in DTM header (Wiki: DTM). More detailed description about format of the data: http://wiibrew.org/wiki/Wiimote#0x35:_Core_Buttons_and_Accelerometer_with_16_Extension_Bytes
Soig
He/Him
Skilled player (1515)
Joined: 12/4/2010
Posts: 252
It helps me a lot. Thank you very much.
RachelB
She/Her
Player (129)
Joined: 12/3/2011
Posts: 1579
Soig wrote:
newer version need OpenAL32.dll. So 3.5-228 is the final version for me.)
You need to install OpenAL, whcih can be found at http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx
Post subject: help: desyncs at title screen / solved: enable default gfx
Joined: 3/18/2006
Posts: 971
Location: Great Britain
My DTM desyncs at the title screen. I gave up and went back to an old dolphin version edit: Woohoo. I fixed the immediate desync by enabling the default 'hacks' + other things in the graphics settings. No DTM editing required here.
Experienced player (583)
Joined: 1/27/2011
Posts: 427
Location: Oregon
Alright, I'm really, really trying to understand this .dtm editing but I can't find any information on the web that starts at square one. It jumps straight into the unsigned hexidecimals and boolean strings! I don't know anything about all this terminology. I downloaded HxD and opened the .dtm, but I have no clue what I'm supposed to be looking at. I'm sure there's alot involved so can anyone tell me where I can start to learn this stuff? It would really help with my MM9 TAS. For a specific question, I'm looking for my rerecord count. I'm told it's a 32 bit unsigned integer at offset 0x02D. Using my best reasoning skills, I'm guessing that means it's here: So does that mean my rerecord count is 8914, or do I have to convert "00 00 00 00 00 00 00 00 00 00 00 00 00 89 14 00" into decimal format, or am I looking in the completely wrong place? Thanks for any help.
Emulator Coder, Skilled player (1112)
Joined: 5/1/2010
Posts: 1217
diggidoyo wrote:
For a specific question, I'm looking for my rerecord count. I'm told it's a 32 bit unsigned integer at offset 0x02D. Using my best reasoning skills, I'm guessing that means it's here: <snip screenshot>
Correct.
diggidoyo wrote:
So does that mean my rerecord count is 8914, or do I have to convert "00 00 00 00 00 00 00 00 00 00 00 00 00 89 14 00" into decimal format, or am I looking in the completely wrong place?
32-bits means 8 hex digits (4 pairs). Also the rerecord count is little endian, so the pairs have to be swapped. So 32-bit integer starting at 0x02D reads as 0x00001489. Now, that is in base-16. Converting to base 10 yields 5257. So 5257 rerecords.