Strife
He/Him
Player (61)
Joined: 6/5/2017
Posts: 13
Location: France
Doc Skellington wrote:
Hello! I've made a new version of pocokhc's PCSX2-1.4.0-rr. You can find it here. Differences from v3.0:
    Lua scripts can now modify controllers' inputs; Lua engine does not automatically close when the end of the script is reached (thereby allowing data to be drawn each frame); A Virtual Pad (handles 2 controllers but not the multitap); Save/Load state to/from a file (does not generate a backup!);
Unlike gocha, I did not implement the possibilty to open multiple Lua scripts. Also, you must be warned that I'm not good at designing interfaces. Therefore, the Virtual Pad is (more than probably) not really ergonomic. I hope this can help you. And, please, don't hesitate to give some feedback ;)
Hey, that's some nice work. I've been trying to tinker with the 1.3 version of the pcsx2-rr with a limited knowledge of kapanese and even more limited knowledge of C++, to try and get the keyboard input of the CLR USB plugin to create a TAS of Typing of the Dead: Zombie Panic. If you think it's doeable, would you be willing to help? I don't have much time these days to learn how to code, and I would prefer to leave this to people that actually know how to code XD
Active player (257)
Joined: 8/12/2013
Posts: 185
Location: Belgium
Hello. Sorry for the (huge) delay. So, here is the conclusion: I can't do it, I'm sorry. I noticed that CLR USB writes to the RAM (iopMem->Main in the code) but I can't find a way to retrieve where or what it writes. And the functions that ask to read from the plugin always get the same values no matter which key I press. So, I tried to copy the RAM. Recording does not crash but playing the movie, yes (and it's a normal behaviour actually). My final idea is to create a fork of CLR_USB and add functions to communicate with the TAS part of PCSX2 but the emulator refuses to use the DLL I compile (even without modifying anything from the code's plugin) and I can't find any documentation on the web. I'm sorry, Strife. If you have any other ideas, please let me know ;).
New PCSX2-rr
Strife
He/Him
Player (61)
Joined: 6/5/2017
Posts: 13
Location: France
That's ok man, if you can't do it, I totally understand. I will go back to this TAS in a few years when we advance this emulation further XD or when we can either tas on dreamcast or on iOS. Thanks for trying doc, and good luck for the rest.
Strife
He/Him
Player (61)
Joined: 6/5/2017
Posts: 13
Location: France
Searching around for a while I found this code: https://github.com/TheLastRar/CLR-USB . Now I'm wondering how it's suppposed to be a plugin since there is no file that corresponds, but is it something interesting? I sincerely don't know since I can't read code so yeah. Have a good day y'all, going to tast GH3 Wii in my spare time.
Zupapa
He/Him
Player (119)
Joined: 3/4/2016
Posts: 62
Location: Brasil
One thing that bothers me in this new version is the frame advance, to use it you should be pressing the button all the time. It would be difficult to do the same as most emulators? Strife have you tried using USBQemu?
Active player (257)
Joined: 8/12/2013
Posts: 185
Location: Belgium
Hello! Strife: Yup, that's the plugin code (in VB.Net, if you want to know). And, for me, it doesn't produce what's supposed to. Good luck for your projects, too. Zupapa: Here is the new version with a repeated frame advance. If you use LilyPad, you have to set Keyboard API to RawInput (you can set it to DirectInput but, for some reasons I don't know, it disables the 0-9 keys). Sorry for the delay but I don't know anything about wxWidgets, so it took time to understand how to manipulate the events. Normally, the modification should not decrease the stability of the emulator, but if you find a bug with the keyboard shortcuts, please tell me ;). Also, I maybe won't be able to work on the emulator until January as I'll be abroad and my laptop has a limited memory. It will depend on what I'll need for the university. EDIT: I noticed that virtual pads were not working correctly. It is now fixed
New PCSX2-rr
Zupapa
He/Him
Player (119)
Joined: 3/4/2016
Posts: 62
Location: Brasil
Thanks for the update.
Rock
He/Him
Joined: 8/16/2017
Posts: 10
Location: Able CIty
Essentially, for normal gameplay the emulator works properly. But in the attempt to play while activating "New Record", the game stops working. No error appears, everything just hangs and the game doesn't continue. Am I doing something wrong?
Active player (257)
Joined: 8/12/2013
Posts: 185
Location: Belgium
Zupapa: My pleasure. Rock: May I ask you which game you're trying to record? And does it occur only for that game? Also, have you checked if it is not just that the emulator is paused? By default, the "p" key unpauses the emulator and the frame advance is on "space". I've added an automatic pause after the opening of a movie so it's probably just that ;). Important note (for everyone): DO NOT CREATE MOVIES for the moment. The movie files do NOT meet the TASvideos' requirements. It is my next task (and I don't know how long it will take).
New PCSX2-rr
Rock
He/Him
Joined: 8/16/2017
Posts: 10
Location: Able CIty
Doc Skellington wrote:
Zupapa: My pleasure. Rock: May I ask you which game you're trying to record? And does it occur only for that game? Also, have you checked if it is not just that the emulator is paused? By default, the "p" key unpauses the emulator and the frame advance is on "space". I've added an automatic pause after the opening of a movie so it's probably just that ;). Important note (for everyone): DO NOT CREATE MOVIES for the moment. The movie files do NOT meet the TASvideos' requirements. It is my next task (and I don't know how long it will take).
Apparently the game was just paused. Thanks. And don't worry, I just wanted to test with a quick game.
Active player (257)
Joined: 8/12/2013
Posts: 185
Location: Belgium
You're welcome. I wasn't worried. I just wanted to be sure that nobody would waste their time ;) The correct version is almost there.
New PCSX2-rr
Spikestuff
They/Them
Editor, Publisher, Expert player (2632)
Joined: 10/12/2011
Posts: 6436
Location: The land down under.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Active player (261)
Joined: 12/13/2016
Posts: 352
You got me excited for nothing.
Active player (257)
Joined: 8/12/2013
Posts: 185
Location: Belgium
Oh, I also got excited by seeing your post. Anyway, I won't be able to work until January (as I thought) but xTVaser (I don't know if they have an account here) is trying to add some new features. Once it will be done, the new version will come out (with a proper and TASvideos-friendly key movie file) ;). And once everything important is implemtend, we will maybe contact the emulator development team to merge our works.
New PCSX2-rr
gocha
Any
Emulator Coder, Former player
Joined: 6/21/2006
Posts: 401
Location: Japan, Nagoya
As I wrote to PCSX2 Forum, the development of my fork has been stopped for a half year, since I couldn't make the threading model between core and lua. Anyway, my source code is here: https://github.com/gocha/pcsx2/tree/lua-v1.4.0 I will have a look on DocSkellington's fork when I have a free time.
gocha wrote:
Hi. I am a coder who interested in adding TAS capabilities to PCSX2 emulator. A half year ago, I have implemented the very basic of Lua scripting engine. https://github.com/gocha/pcsx2/tree/lua-v1.4.0 TASVideos / Lua Scripting http://tasvideos.org/LuaScripting.html However, my motivation was lost rapidly since I was stuck in a problem. The problem is thread model between the emulation core and Lua. TASVideos emulators I know are single-thread, that can be achieved so naturally, but PCSX2 is a multi-thread emulator. Since I am not very familier with PCSX2 and its internal models, I have no idea how I should handle the communication between Lua and the emulation core (or how to integrate the Lua interpreter to the core thread). Script will run:
  1. When UI (or whatever a trigger) requests starting the script, the script will run immediately.
  2. When a script has registered some callbacks on step #1, they will be called by certain triggers. (e.g. on frame boundary, memory read, etc.)
  3. Additionally, most of TASVideos emulators have a co-routine style function: emu.frameadvance(). The function will stop the script execution temporary, then emulate the game for only 1 frame, then resume the script after the function call.
At present, my prototype can start a script from GUI, then the script will be executed on the UI thread. Of course, the emulation keeps running asynchronously while the script is running. I would be happy if someone teaches me an easy and smart idea for this or any hints. Moreover, I will be more happy if someone would code the rest of things. Thank you. https://forums.pcsx2.net/Thread-PCSX2-Lua-Development-Question-with-thread-model
I am usually available on Discord server or Twitter.
Active player (257)
Joined: 8/12/2013
Posts: 185
Location: Belgium
Hello! xTVaser has created a new fork directly from PCSX2. Please, from now on, see this GitHub repository. Also, we will try to follow PCSX2's updates. The latest release will be the last 1.4.0 release (it is available in case 1.5.x breaks a game).
New PCSX2-rr
Joined: 9/12/2014
Posts: 540
Location: Waterford, MI
Sweet! Just one problem, you can't hold down frame advance.. You have to mash it.. I tried this using the latest release.
Active player (257)
Joined: 8/12/2013
Posts: 185
Location: Belgium
Hello, For the frame advance trouble: you have to set Lilypad's Keyboard API to Raw Input. This information is now clearly written in the README (it wasn't before, don't worry).
New PCSX2-rr
Rock
He/Him
Joined: 8/16/2017
Posts: 10
Location: Able CIty
Hey guy... I've been testing v1.4.0-rr, and different from the previous version it gives a strange error. "Kbd Accelerator 'COMMAND' is mapped multiple times. 'Command States_LoadSlot0' is being replaced by 'States_LoadSlot1' 'Command States_LoadSlot1' is being replaced by 'States_LoadSlot2' 'Command States_LoadSlot2' is being replaced by 'States_LoadSlot3' 'Command States_LoadSlot3' is being replaced by 'States_LoadSlot4' 'Command States_LoadSlot4' is being replaced by 'States_LoadSlot5'" And beyond... The game doesn't open, it only has these messages repeatedly. Is the problem related to the savestate? Do not seem to have a configuration problem, at least everything is identical to the previous version. Could anyone help?
Zupapa
He/Him
Player (119)
Joined: 3/4/2016
Posts: 62
Location: Brasil
https://github.com/xTVaser/pcsx2-rr/releases Have you tried the latest version? If it does not work could you post a screenshot?
Rock
He/Him
Joined: 8/16/2017
Posts: 10
Location: Able CIty
Zupapa wrote:
https://github.com/xTVaser/pcsx2-rr/releases Have you tried the latest version? If it does not work could you post a screenshot?
This version works, thanks.
Joined: 9/12/2014
Posts: 540
Location: Waterford, MI
its getting closer A pull request on upstream pcsx2 to add tas tools. Tons of work has already been done, as seen in the changes tab.
Spikestuff
They/Them
Editor, Publisher, Expert player (2632)
Joined: 10/12/2011
Posts: 6436
Location: The land down under.
Well too bad the things that plague the emulator is that: - Is a hack. Any problems to Game X is resolved with a hack. - Software Mode (the mode we want) Operates like shite because... - It's deliberately underpowered (You have to hack, the hack to make it perform). - Inaccurate I'd rather wait for DobieStation to go full accuracy power running every game for the exclusives... or just use Dolphin for Game X or Game Y that's between the 2 platforms than dealing with a hack like PCSX2. Also, this was a thing that was only brought up back to them, after denying putting TAS emulators years ago cause the staff changed. Screw them.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Joined: 9/12/2014
Posts: 540
Location: Waterford, MI
Well, after 11 months, the pull request has been merged. Theres also linux support. Now, what do you mean by "hacks"?
Troye
He/They
Experienced player (943)
Joined: 4/27/2018
Posts: 66
I followed this PR for a couple of weeks before it was merged, and when I first saw it was I grabbed the latest binary to try it out. I had planned to do some specific movement in Tomb Raider Angel of Darkness, just for showcasing that a TAS is now "possible"- unfortunately the emulator wasn't on my side. First off the emulator is not user friendly at all- everything is scattered around and just doesn't feel "stable" At first I couldn't figure out how to use the savestate hotkeys properly (thought it would be a separate hotkey for each slot, but apparently there's one hotkey for saving in the "current slot", one for reloading from the "current slot" and the last for choosing the "current slot"- this had me mixing up slots quite often and honestly got me frustrated from the first 30 minutes. - There's some sort of fade in effect every time you reload a savestate- that was especially annoying when trying to skip the first FMVs and going through menus because every time I reloaded a savestate the screen would go blank (for the fade in effect)- I'd advance 1 frame to see if the FMV had started or not. I kept seeing a blank screen, advance 1 frame then save and reload sometimes. I kept seeing blank when the FMV wad actually running. Of course it went on until I reached about 2 seconds into the FMV before I realized what was happening- then I was taunted again by the menu which on has a fade in effect of its own which made it hell. - After getting through the menus and getting in-game the game played fine. Took me quite a bit of time to get about 20 seconds of gameplay (out of 2-3 minutes showcase) but I was done because the savestate system was just so frustrating. I try to replay the movie and, surprise: desync. About 5 seconds of gameplay went properly before a desync happened out of nowhere. I tried replaying the same movie from a savestate from after the desync spot and hit another desync after that... - I ended up just settling for the 5 seconds that actually worked- "time to dump a video"~ Woops "No."~ PCSX2 It crashed. Twice. After fighting with it for some time I ended up trying a lossless avi, and it worked. Kinda. It dumped audio and video into separate files- when joining these the audio wasn't in sync with the video. At that point I rage quit and deleted everything related to PCSX2. - Just wanted to share my experience with these new tools- and they are everything but useable.