Post subject: [SOLVED] swap a .PJM movie to a tasproj - bk2 movie ?
Joined: 3/23/2015
Posts: 11
Location: FRANCE
Hi ! i was looking to swtching emulator for my TAS, i was on psxjin (for PSX TAS) but its deprecated, so i will try to continue my work on Bizhawk. so i have a .PJM file and i want to open it in the tas studio in bizhawk .. how to do it ? you will help me a lot !! :) thanks a lot for your help :)
Editor, Experienced player (854)
Joined: 5/2/2015
Posts: 696
Location: France
Currently, there is no way AFAIK to convert a .jin movie to a .tasproj file. You can still continue TASing on PSXjin, even if it is deprecated, by asking to be in the list of continuances.
Joined: 3/23/2015
Posts: 11
Location: FRANCE
okay thats a good news, thanks to you but i will cry ... psxjin is less convinient than Bizhawk. i need a issue beacause i dont want to remake 2 month of work ... :( :( :( :( :(
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Here's the movie file format... maybe someone can convert it?
Post subject: PSX>BK2 Input Converter v0.01
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
PSXjin's PJM and the Input Log inside BizHawk's BK2 are both in text format. This should make it relatively easy to convert between them. The PJM input layout for Player 1 goes:
|Square|Cross|Circle|Triangle|R1|L1|R2|L2|Left|Down|Right|Up|Start|Select|
While the BK2 input layout for Player 1 goes:
|Up|Down|Left|Right|Select|Start|Square|Triangle|Circle|Cross|L1|R1|L2|R2|L3|R3|MODE|
I should be able to write you a small Java program that can convert the input data over. EDIT: I have completed the converter tool, and it works for both 1-player and 2-player PJMs! Here is an executable .jar file, and here is the source code in case you want to compile it yourself for whatever reason. Here's how to use it: 1: Name your PJM file "convert.pjm" and place it in the same folder as PJMConverter.jar. 2: Double-click on PJMConverter.jar. As long as you have Java installed, it will quickly convert your file into an Input Log.txt, which will appear in the same folder. Open this file. 3: Create a new movie in BizHawk while running your game if you haven't already, then Stop Recording. 4: Open the BK2 as an archive. (If using 7-Zip to open it, go to Tools>Options>Folders and set the working folder to Current.) 5. Open the archive's Input Log.txt, delete everything and copy-and-paste the entire Input Log.txt file that was generated by the program there. 6. Save the text file and close it as well as the BK2 archive. You now have a converted BK2! I don't know anything about Tastudio, but it's probably easy to convert it to *.tasproj once you have your working bk2.
Joined: 3/23/2015
Posts: 11
Location: FRANCE
first : many thanks to try to help me, you're awsome ! but there a probleme with your javascript i think, the input log converted make a error in bizhawk when i loaded it.... your code is very nice but im a noob on java (i hate it.....) if you have the same program on c# i have Vstudio for rewrite it :) for convert a BK2 to a Tasproj its easy :) many thanks dude ! :) --------EDIT--------- for comparason with the two type of files : an original input log (random input)
|    1,...|  128,  128,  128,  128,..........l......|
|    1,...|  128,  128,  128,  128,..........l......|
|    1,...|  128,  128,  128,  128,..........l......|
|    1,...|  128,  128,  128,  128,..........l......|
|    1,...|  128,  128,  128,  128,..........l......|
|    1,...|  128,  128,  128,  128,..........l......|
|    1,...|  128,  128,  128,  128,..........l......|
|    1,...|  128,  128,  128,  128,U................|
|    1,...|  128,  128,  128,  128,U................|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,...........r.....|
|    1,...|  128,  128,  128,  128,...........r.....|
|    1,...|  128,  128,  128,  128,...R.............|
|    1,...|  128,  128,  128,  128,...R.............|
|    1,...|  128,  128,  128,  128,...R.............|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,...R.............|
|    1,...|  128,  128,  128,  128,...R.............|
|    1,...|  128,  128,  128,  128,.........X.......|
|    1,...|  128,  128,  128,  128,.........X.......|
|    1,...|  128,  128,  128,  128,......Q..........|
|    1,...|  128,  128,  128,  128,......Q..........|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,........O........|
|    1,...|  128,  128,  128,  128,........O........|
|    1,...|  128,  128,  128,  128,.......T.........|
|    1,...|  128,  128,  128,  128,.......T.........|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.............R...|
|    1,...|  128,  128,  128,  128,.............R...|
and the input converted from a pjm

|   1,...|..............|..............|
|   1,...|.D............|..............|
|   1,...|.D............|..............|
|   1,...|..............|..............|
|   1,...|.D............|..............|
|   1,...|.D............|..............|
|   1,...|..............|..............|
|   1,...|.D............|..............|
|   1,...|.D............|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|..............|..............|
|   1,...|..............|..............|
|   1,...|..............|..............|
|   1,...|..............|..............|
|   1,...|..............|..............|
|   1,...|U.............|..............|
|   1,...|U.............|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|.........X....|..............|
|   1,...|.........X....|..............|
|   1,...|..............|..............|
|   1,...|.D............|..............|
|   1,...|.D............|..............|
|   1,...|..............|..............|
|   1,...|.D............|..............|
|   1,...|.D............|..............|
|   1,...|..............|..............|
|   1,...|.D............|..............|
|   1,...|.D............|..............|
|   1,...|.D............|..............||
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
there's already a system for importing other emulator movie files into bizhawk, and even a stub for PJM (labeled "todo"). So if you can do c#, you can get the c# and make that converter, especially since there are many examples for other platforms.already
Post subject: PJM>BK2 Input Converter v0.2
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
You're welcome! Ah, okay, it seems your BK2's SyncSettings are set to DualShock Controller, while my script was outputting to the more compact Gamepad input. DualShock is the default for BizHawk, so my converter now defaults to DualShock too. If you want to output to Gamepad in the future, just name your file "convert_pad.pjm" instead. (If and when we integrate this into BizHawk, the program can read the user's PSX Options to determine the controller used automatically.) I also fixed the input bugs by replacing the parser string operations with some nice, clean character arrays. The script now supports 1 and 2 players, DualShock or not! Here is the v0.2 version, and here is the source code again. Thank you for testing the last one and reporting results; I would appreciate if you could do the same with this one. One strange thing I noticed is that your BizHawk/computer seems to output " 1" as the disc number instead of "-1". I don't know why that's happening, but I guess we'll see if it happens this time too. Thanks zeromus, I'd be happy to help write the converter into BizHawk. I don't currently know C#, but I should be able to learn the handful of commands needed to port it over. Maybe BALIST0N could even help me if he already knows C#.
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
disc number -1 and 1 are kind of equivalent. i think i may have bugfixed this at some point. -1 means "the exact disc is not set, but if there's only one disc, it must be that one." 0 means no disc is inserted. I didn't intend for anyone to see -1. Don't know what it's doing right now. The way the method for switching discs interacts with the movie system in bizhawk is less than ideal, but it does work and thats good enough for now.
Joined: 3/23/2015
Posts: 11
Location: FRANCE
THANKS A LOOOOOOT !!! i will try this fast ! i edit the new input log converted via notepad++ (remplace function -1 to 1 easy !) i give news early ! _______________EDIT______________ 18:21 PM(France) : almost perfect, but its seems the problem is again from the input converted .. input : original from tasproj - bk2
LogKey:#Disc Select|Open|Close|Reset|#P1 LStick X|P1 LStick Y|P1 RStick X|P1 RStick Y|P1 Up|P1 Down|P1 Left|P1 Right|P1 Select|P1 Start|P1 Square|P1 Triangle|P1 Circle|P1 Cross|P1 L1|P1 R1|P1 L2|P1 R2|P1 L3|P1 R3|P1 MODE|

|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,UDLRsSQTOXlrLR<>M|  // <-- full input 
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.................|
input file(converted from pjm) :
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|



the "|..............|" is too much  i think 
and dots after 128, is normaly 17 (17 buttons)
(-1 : i fix the prombelm w\ notepad ;) )
the PJM input method : (full input)

#XO^1234LDRUSs|..............|0|
SO ! i have start a C# code EXE, my friend in my school try a .PHP program (yes really its possible) and i have asked to my teacher to help me , he makes python code ! (devlopper studing is soooo cool ) too much people helping me haha I want to say thanks to you guys :) i promise you to finish this F°°°°°°° TAS _ _ _ _ _ _ P.S : sorry for my ugly english
Joined: 3/23/2015
Posts: 11
Location: FRANCE
NEWS ! a little info for help :) input replacement : (positions after '128, ' ) pjm to bk2 : positions 1 --> 6 2 --> 10 3 --> 9 4 --> 8 5 --> 11 6 --> 13 7 --> 12 8 --> 14 9 --> 3 10 --> 2 11 --> 4 12 --> 1 13 --> 6 14 --> 5 pjm to bk2 also # = Q (square) ; ^ = T (triangle) 1 = l | 2 = L | 3 = r | 4 = R | and after add ' ...| ' to have 17 inputs :)))))
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
BALIST0N wrote:
almost perfect, but its seems the problem is again from the input converted ... input file(converted from pjm) :
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|
|   -1,...|..............|..............|
This is correct: it's the standard BK2 Input Log code for a 2 players, no DualShock (Standard Controller) PJM. Your PJM should also have two lines of 13 dots. Here's an example of how that converted BK2 would look like when filled with input:
|   -1,...|UDLRsSQTOXlrLR|UDLRsSQTOXlrLR|
|   -1,...|..............|..............|
A PJM with DualShock input will include two more dots (for a total of 16) for L3 and R3 respectively, and numbers for each axis of each joystick. I had support for it halfway implemented, and unfortunately I left the code at home, but I will upload it when I get back in several hours. If you need the positions of PJM and BK2 input, I included a table of it in my v0.2 code posted above (around line 200). Hope it helps! I'll help out with the C# once I've added support for all features of the PJM (reset and disc changes are next on my list). zeromus: Good to know, I'll go ahead and change it to 1.
Joined: 3/23/2015
Posts: 11
Location: FRANCE
IT WORKS IT WORKS !!!! GOOD NEWS !!! my input file is greatly generated AND WORKS into the TASstudio .... almost ! you can now stop everything for all of you guyz a want to say a huge thanks to help me ! P.S : a stub of code from the worked input log.txt :
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.D...............|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,...R.............|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.......T.........|
|    1,...|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.......T.........|
topic marked as solved :)
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
Well, that was fast. Can you share your code? I can implement the extended PJM support I've been working on tonight and we (or I, if you're not interested) can implement it into BizHawk.
Joined: 3/23/2015
Posts: 11
Location: FRANCE
oh dude i will disapoint you ... i have use a easier way for it, i have edited all with notepad++ (replace, insert etccc ...) but your Javascript convert right, but its the form ( with dots etcc) who was not good and make errors .. :/ but if you need something for help im here and with big smile
Post subject: PJM>BK2 Input Converter v0.3
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
Oh, I see. Then congratulations on getting your BK2 working, and I'm glad my script was able to help you! Actually, I would still like your help if you don't mind. I want to generate the correct number of dots every time, and I think my new code might do that currently, but I'd like you to test it again. Here's the newest jar file and here's the newest source. I studied and tested the PJM format more closely, and as a result, this version includes full support for loading DualShock PJMs, as well as PJM Disc Changes, Resets, and Disc Tray Open/Close. It can also input from and output to both the Standard and DualShock controller input layouts now. Here's an example of an input PJM:
..............||0|
#XO^1234LDRUSs||2|
.............s||0|
.....2......S.||2|
..............||0|
And the resulting BK2 (note the Disc Open/Close and Disc Change):
|    1,...|  128,  128,  128,  128,.................|
|    1,.!.|  128,  128,  128,  128,UDLRsSQTOXlrLR...|
|    1,...|  128,  128,  128,  128,....s............|
|    2,..!|  128,  128,  128,  128,.....S....l......|
|    2,...|  128,  128,  128,  128,.................|
There are eight different kinds of tests you could run if you want:
                |                          Output                         |
    |   Input   |   DualShock "convert.pjm"  |  Gamepad "convert_pad.pjm" |
    |  1P GPad  |      (Pass, 17 dots)       |      (Pass, 14 dots)       |
    |  1P DuSh  |      (Pass, 17 dots)       |      (Pass, 14 dots)       |
    |  2P GPad  |    (Pass, 17 * 2 dots)     |    (Pass, 14 * 2 dots)     |
    |  2P DuSh  |    (Pass, 17 * 2 dots)     |    (Pass, 14 * 2 dots)     |
Thank you! Also, did you say earlier you started converting this script to C#? That was the code I thought you had completed, I apologize for the misunderstanding.
Joined: 3/23/2015
Posts: 11
Location: FRANCE
ALRIGHT ! no problem my friend ! its nice to have also converted the Disc change inputs :) so after converting (with the v0.3) i have tested it and ....... CONGRATS YOUR CONVERTER IS WORKING PERFECTLY no need to edit the inputlog converted, TASstudio recognize the input perfectly with no shift frames. convert.pjm : (line 1127 to 1137)
...........U..|..............|0|
...........U..|..............|0|
.X............|..............|0|
..............|..............|0|
.X............|..............|0|
.X............|..............|0|
..............|..............|0|
.........D....|..............|0|
.........D....|..............|0|
..............|..............|0|
.........D....|..............|0|
inputlog .txt (converted from the pjm, line 1127 to 1137) :
|    1,...|  128,  128,  128,  128,U................|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,U................|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.........X.......|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.................|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.........X.......|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.........X.......|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.................|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.D...............|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.D...............|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.................|  128,  128,  128,  128,.................|
|    1,...|  128,  128,  128,  128,.D...............|  128,  128,  128,  128,.................|
_________________________________________________________________ and next inputlog.txt (from convert_pad.pjm,line 1127 to 1137)
|    1,...|U.............|..............|
|    1,...|U.............|..............|
|    1,...|.........X....|..............|
|    1,...|..............|..............|
|    1,...|.........X....|..............|
|    1,...|.........X....|..............|
|    1,...|..............|..............|
|    1,...|.D............|..............|
|    1,...|.D............|..............|
|    1,...|..............|..............|
|    1,...|.D............|..............|
but this format with no pad doesn't work... i dont know why but i think bizhawk doesn't support "no pad" type input .... :// so what's next ? :))))
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
BALIST0N wrote:
so after converting (with the v0.3) i have tested it and ....... CONGRATS YOUR CONVERTER IS WORKING PERFECTLY
That's great news! Thank you for testing! :) One small thing, I got the order wrong for the Open/Close/Reset characters. It has been fixed in PJMConverter 0.3.1 (source here).
BALIST0N wrote:
but this format with no pad doesn't work... i dont know why but i think bizhawk doesn't support "no pad" type input .... ://
I believe you have to go to the PSX Menu (next to File, Config, Tools), select Controller Settings and change the controller type to Gamepad. Then start a new movie and paste the input in. It's not required to use Gamepad instead of DualShock, but it's your choice.
BALIST0N wrote:
so what's next ? :))))
Next, I want to convert the Java code to C# so it can be integrated into BizHawk. I will have to learn the basics of C# and look over BizHawk's Import Movies code first so I will know how to write it in. Do you already know C#? If you do, maybe you could start converting the code over while I learn the language.
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 775
Is this possible with pcsx movies?
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
It should be, and it would be pretty easy to write a PXM Converter if it has a text-based format too.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 775
So is it possible to convert binary data into Bizhawk text data?
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Player (75)
Joined: 8/26/2015
Posts: 70
Yes, and not even that hard. I'm currently working on something similar that can easily be adapted to it. A prototype should be ready in a couple of days; prod me if I don't post it.
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 775
AdituV wrote:
Yes, and not even that hard. I'm currently working on something similar that can easily be adapted to it. A prototype should be ready in a couple of days; prod me if I don't post it.
Cool. I hope to fix that missing ring in the failed Abe's Oddysee 100% TAS soon. I will look forward to it.
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Joined: 3/23/2015
Posts: 11
Location: FRANCE
ah yeah the new converter works ! "no pad" and pad version I did not know we could switch intro different controler mode :) so, for integrating, its possible, but I am a beginner in programing and I 've never done JS i mean i can understand your code but to tranlate this into c# there is the problem ... but your code is so nice to read ! (many comments, clear functions etcc) I think can help you but not much, i have basics into c# : objets, class, loops and tests.. if you want add me on skype and we can try to make this :) (i say to you, my english is verrrrry bad)