-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LUA Readdword, CPU string being ignored #2
Comments
Thanks for bringing this to our attention, will take a look when I get a chance. A lot of the Lua utilities are "legacy" code from the original spike of pcsx2-rr https://github.com/pocokhc/pcsx2-1.4.0-rr/releases if you get a chance, can you see if the feature works as expected on the latest release there, that way it will be obvious if this was the fault of a refactor along the way or if this was always broken. |
LUA doesn't seem to work at all for me in that version. At least, the following code doesn't seem to do anything. I click Start and nothing happens. function draw() emu.registerbefore(draw) |
Ah ok, well glad to hear that its working more than it isnt! Perhaps just a simple bug, or it never even worked in the first place. I assume that the values should correspond to whatever is in PCSX2's debug window? |
I'm not 100% sure what you mean, so I'll clarify to be sure we mean the same thing. When I open the Debugger window and go to 0x795978 with "r5900" selected, I get 0x42C80000 (float, 100.0, current HP of Kratos in God of War, reading floats is a side issue, reading it as DWORD is a first step). This is what I'm trying to read with memory.readdword(0x795978, "r5900") If I click "r3000", I get the hex representation of whatever is displaying in decimal form on the screen. The above code is returning the valid answer for memory.readdword(0x795978, "r3000") In the below code segment of LuaFunctions: static int memory_readdword(lua_State *L) It would seem that cpu is not properly being assigned the "r5900" argument. This is just an assumption as I've run into some issues compiling it myself that I haven't worked through yet. Let me know what other information you need. |
Yup, the issue was around that code. The I believe we are on the same page and I was able to reproduce and fix your problem, but take a look at these screenshots and let me know if I'm correct. There should definitely be some added functions for dealing with floats / doubles, and it would be nice if there could be a small sample lua script. I wasn't able to get |
There was some sort of sample LUA that handled GUI drawing already in the LUA folder, so I'd just taken out the shape-drawing stuff and repurposed the text-drawing lines. I can get you the exact script I used in about 7 hours if you still need it. The above image does appear to be showing the expected behaviour, which I would be unable to reproduce with my current build. |
changes released https://github.com/xTVaser/pcsx2-rr/releases/tag/rr-1.0.1 give it a try and close the issue if the problem is correctly resolved. |
I should be able to confirm and close in about 4 hours. |
The same script now returns different (assumed correct) results. Closing. |
PCSX2 version:
1.4.0
local m = memory.readdword(0x795978, "r5900");
It is returning the value at 0x795978 on the R3000 regardless of the string entered.
The text was updated successfully, but these errors were encountered: