 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Sun Jan 21, 2007 11:38 pm Post subject: |
|
|
| Code: | var.test = '0x'+IntToHex(var.pixel, 6)
if (var.test == "0x003CAD") then |
should be
| Code: | | if (var.pixel == 0x003CAD) then |
You only need to convert it to a string to display it. |
|
| Back to top |
|
 |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Sun Jan 21, 2007 11:42 pm Post subject: |
|
|
| By the way, you can call almost any windows DLL functions from GlovePIE, not just GetDC, ReleaseDC, and GetPixel. Even DLL functions you write yourself. |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Mon Jan 22, 2007 12:32 am Post subject: |
|
|
Ha! I see...
| Code: | // draw red pixel when left mouse button is down
if (Mouse.LeftButton) then
var.hdc = USER32.DLL.GetDC(NULL)
var.pixel = GDI32.DLL.SetPixel(var.hdc, Int(mouse.CursorPosX), Int(mouse.CursorPosY), 0x000000FF)
USER32.DLL.ReleaseDC(NULL, Int(var.hdc))
debug = '0x'+IntToHex(var.pixel, 6)
end if | It's too bad I have no Windows programming experience and I can't think of anything cool to do with this stuff. Right now I'm going through some gigantic Windows API reference thing and waiting for something to pop out at me. |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Mon Jan 22, 2007 12:46 am Post subject: |
|
|
Okay, this may be a fool's errand, but I'm looking at this function called ReadProcessMemory that (surprise) allows you to read memory from a specified process. Most emulators I've messed with have had a built in cheat search that allows you to check the rom's memory and see how certain values change, usually giving you the address of the memory.
Now, say I'm doing a cheat search on Street Fighter 2 on ZSNES and I find that a certain piece of memory changes to 3F whenever I do a dragon punch. If I know the value to look for and the address in ZSNES, is there any way to use that information and call that ReadProcessMemory function from within GlovePIE to check to see if that bit of memory has changed? If so it would supplant that GetPixel method you showed me and allow for some very, very crazy things. |
|
| Back to top |
|
 |
TylerK

Joined: 18 Dec 2006 Posts: 384 Location: Springfield, IL
Digg It |
Posted: Mon Jan 22, 2007 3:27 am Post subject: |
|
|
| Good god, that GetPixel method works wonders! I've been combing through NES games, adding rumble support where possible. So far I have scripts for Excitebike, Mega Man, T&C Surf Design, Dr. Mario, and Little Nemo. The only problem is they'd require the user to be using VirtuaNES at a resolution of 1024x768. Other emulators running at the same resolution could still work, but I haven't tried it. Still pretty awesome though. |
|
| Back to top |
|
 |
torrobinson
Joined: 22 Jan 2007 Posts: 7
Digg It |
Posted: Mon Jan 22, 2007 4:49 am Post subject: |
|
|
Thanks for letting me know about this program! I've been messing around with it for about 2 and a half hours now
It took me that long to get my wiimote to rumble when Zone Alarm's "traffic" bar goes to the top. Using that program is hard for me  |
|
| Back to top |
|
 |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Mon Jan 22, 2007 6:11 am Post subject: |
|
|
The problem with ReadProcessMemory is that you are accessing the emulator's memory rather than the ROM's.
Basically using ReadProcessMemory would be like doing a cheat search on the emulator itself.
But you would need the exact same version of the emulator, and ReadProcessMemory will only really work for global variables that the emulator stores. The ROM's memory, and anything else that is loaded dynamically, would be loaded into a different memory address each time, so you wouldn't be able to find it.
I don't think it is worth the effort.
| TylerK wrote: | Okay, this may be a fool's errand, but I'm looking at this function called ReadProcessMemory that (surprise) allows you to read memory from a specified process. Most emulators I've messed with have had a built in cheat search that allows you to check the rom's memory and see how certain values change, usually giving you the address of the memory.
Now, say I'm doing a cheat search on Street Fighter 2 on ZSNES and I find that a certain piece of memory changes to 3F whenever I do a dragon punch. If I know the value to look for and the address in ZSNES, is there any way to use that information and call that ReadProcessMemory function from within GlovePIE to check to see if that bit of memory has changed? If so it would supplant that GetPixel method you showed me and allow for some very, very crazy things. |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|