Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
About how PCSX2 stores images in memory
#1
I am considering trying to make a patch to fix the black lines in SC3 at resolutions above native and not 1200 by XXXX

I posted a bit on this in another thread but specifically I had this idea:

I will pause SC3 for a static image and use a color picker to pick out a pixel.

I want to use cheat engine to find this pixel in PCSX2 memory.

How is it stored? RGB, ARGB, BGRA, RGBA, HSV, etc? Specifically if I had a pixel RGB(128, 43, 245), EXACTLY how would it appear in memory? Probably in hex right? But what order. If you can tell me for that exact example, that will teach me what I need to know.

Since the black line divides the screen into sections I want to make a cheat that moves each section a few pixels left and aligns the whole thing.

Is this even possible?
[Image: ov4]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply

Sponsored links

#2
not likely, that is from resolution issues, not from how PCSX2 is handling it
Reply
#3
(10-31-2013, 11:09 AM)Saiki Wrote: not likely, that is from resolution issues, not from how PCSX2 is handling it

It doesn't matter. If I can access the raw image data I can move it however I like... I think... here let me show you what I mean... BRB.
[Image: ov4]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply
#4
Okay here it is in 6x normally:

[Image: 1_zpsbd1cec92.png]

It's divided into 10 sections.

Here I used paint.net to move the first section 2 pixels left and the rest 4:
[Image: 2_zps94ab6b8d.png]
[Image: ov4]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply
#5
I just woke up and had a DUR moment. I wrote that at 4:25 AM lol.

That crap is gonna be in graphics memory most likely, it still should be possible as I've proven the pixels just need to be moved. But it's probably not fixable in a simple patch, unless it's possible to somehow view the contents of a GPU memory. IDK if it's possible to alter the content of GPU memory on the fly either.

Or, well, it should be in main memory on certain IGP without dedicated. At least that could prove the theory...

Hmmm.
[Image: ov4]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply
#6
With the lines being at a fixed location, you could just make a shader for it.
[Image: nbKSK.jpg]
Reply
#7
(10-31-2013, 09:11 PM)KrossX Wrote: With the lines being at a fixed location, you could just make a shader for it.

True, but it's not just lines, as my image shows, the sections are actually just separated.

Or am I misunderstanding what you meant?
[Image: ov4]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply
#8
It means, that ideally, you could come up with a general formula so that the output matches that of your paint.net result.
[Image: nbKSK.jpg]
Reply
#9
(10-31-2013, 09:24 PM)KrossX Wrote: It means, that ideally, you could come up with a general formula so that the output matches that of your paint.net result.

At least at 6x(I haven't checked others yet, section two needs to move 2 pixels left. The rest after it need 2 more pixels.
Moving section 2 left two leaves a gap of four between 2 and 3. Moving section 3 left four leaves a gap of 6 between 3 and 4. ETC.

Move section 2 left by two
move section 3 left by four
move section 4 left by six

So the formula is

pixels to move = (section_number*2)-2

For 6x.

Can you straight up move pixels in a shader like that(no experience with shaders!)?
[Image: ov4]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply
#10
Move pixels... hmm... nope, but you can sample from another position. For example:

vec2 pos; // current position
vec3 color; // color output

// pass through, no changes.
color = sampler(texture, pos);

So you cannot move pixels, but you can do something like this:

if(pos.x > section4) pos.x += 6.0;
else if(pos.x > section3) pos.x += 4.0;
else if(pos.x > section2) pos.x += 2.0;

// no longer pass through, as it will sample from a different position.
color = sampler(texture, pos);
[Image: nbKSK.jpg]
Reply




Users browsing this thread: 1 Guest(s)