Hacking Understanding and changing Snes VC RPX settings

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,221
Trophies
2
XP
34,423
Country
Mexico
Anyway, here's a basic guide:
Run rpl2elf on the dumped .rpx.
Open the elf in a hex editor and search for 392003563860(hex)
Replace the 0356 part with 0280
Search again for 043838E0078090(hex) and replace the 0438 with 01E0 and the 0780 with 0280
Convert back to rpx by running in the sdk tools folder:
set CAFE_ROOT=../../../
makerpl64 -f -z8 -old -s name.elf

Copy back to sd card and run with loadiine.
Done!
Great!
@the_randomizer if you can, please add that info to the OP, please! :P

I'll also include this link just for reference:
https://gbatemp.net/threads/tutorial-how-to-decompress-and-repack-rpx-rpl-files.399934/
If you can add that one to the OP too, that'd be great.
 
  • Like
Reactions: the_randomizer

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,221
Trophies
2
XP
34,423
Country
Mexico
Okay so I just tried doing this with a Vessel.rpx file for a N64 VC title (Donkey Kong 64) and I got no results for the HEX values posted.
@shutterbug2000 I'm interested in knowing the procedure to finding such values in IDA Pro, along with what function is the one that modifies the video output's resolution. Like GX2SetTvSomething or whatever and how that translates to HEX.

I'm really digging this. :P
 

the_randomizer

The Temp's official fox whisperer
OP
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
Okay so I just tried doing this with a Vessel.rpx file for a N64 VC title (Donkey Kong 64) and I got no results for the HEX values posted.
@shutterbug2000 I'm interested in knowing the procedure to finding such values in IDA Pro, along with what function is the one that modifies the video output's resolution. Like GX2SetTvSomething or whatever and how that translates to HEX.

I'm really digging this. :P

So far the values only seem to reflect Snes games (for the most part, should be similar). N64 games are a different beast, but this should be achievable :P
 

shutterbug2000

Cubic NINJHAX!
Member
Joined
Oct 11, 2014
Messages
1,088
Trophies
0
Age
29
XP
4,878
Country
United States
Okay so I just tried doing this with a Vessel.rpx file for a N64 VC title (Donkey Kong 64) and I got no results for the HEX values posted.
@shutterbug2000 I'm interested in knowing the procedure to finding such values in IDA Pro, along with what function is the one that modifies the video output's resolution. Like GX2SetTvSomething or whatever and how that translates to HEX.

I'm really digging this. :P

I have a few N64 VC games. I'll dump one using ddd and take a look.
 
  • Like
Reactions: the_randomizer

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,221
Trophies
2
XP
34,423
Country
Mexico
So far the values only seem to reflect Snes games (for the most part, should be similar). N64 games are a different beast, but this should be achievable :P
Yeah I thought so.
I think the closest VC titles to achieve this are NES and GBA, since I think all of those include the game within the RPX/ELF file.
I have a few N64 VC games. I'll dump one using ddd and take a look.
Neat!
Let me know if you need anything from my side, I have at least one VC backup of each console in case you need any. :)
 
  • Like
Reactions: the_randomizer

the_randomizer

The Temp's official fox whisperer
OP
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
Yeah I thought so.
I think the closest VC titles to achieve this are NES and GBA, since I think all of those include the game within the RPX/ELF file.

Neat!
Let me know if you need anything from my side, I have at least one VC backup of each console in case you need any. :)

Converted more games over, I think changing the resolution/aspect actually added minuscule filtering, but it looks a lot better :P
 
  • Like
Reactions: ShadowOne333

shutterbug2000

Cubic NINJHAX!
Member
Joined
Oct 11, 2014
Messages
1,088
Trophies
0
Age
29
XP
4,878
Country
United States
Yeah I thought so.
I think the closest VC titles to achieve this are NES and GBA, since I think all of those include the game within the RPX/ELF file.

Neat!
Let me know if you need anything from my side, I have at least one VC backup of each console in case you need any. :)

Testing out N64 now, those look to be even simpler then SNES :blink:
 
  • Like
Reactions: the_randomizer

arse

Well-Known Member
Newcomer
Joined
Sep 23, 2015
Messages
91
Trophies
0
Age
36
XP
176
Country
After some work(and nearly ruining the gamepad screen because of flickering) I present:
baCHnm5.jpg

Nice that you're getting somewhere, but...those who ruin games intended to be played in 4:3 by stretching them to shit are the kind of people who live in my personal ideal of hell.
 

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,221
Trophies
2
XP
34,423
Country
Mexico
Nice that you're getting somewhere, but...those who ruin games intended to be played in 4:3 by stretching them to shit are the kind of people who live in my personal ideal of hell.
Save those comments, please.
This is the start of a hell of a good way to fuck around with Nintendo's official emulators and add some customization to the mix.
Not only to change the aspect ratio, but also to other aspects of it, like bilinear filter toggle and also hopefully a way to remove the gamma correction that darkens the overall image.
I personally hate 4:3 with black bars on the sides., but Nintendo stupidly made the assumption that all VC titles (specifically N64) were mandatory 4:3, and that's not true because some do offer a nice 16:9 aspect ratio (Widescreen) option like DK64.

Testing out N64 now, those look to be even simpler then SNES :blink:
Yeah luckily the RPX files for those are way smaller. :)
Good luck, mate!
It's nice to see someone got the hang of these files. :D
 
  • Like
Reactions: the_randomizer

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,221
Trophies
2
XP
34,423
Country
Mexico
Yeah, it's because the files don't contain the rom aswell as the code.
Yeah. :P
Only N64 and DS titles seem to do this, maybe because the size of those games would be too much to include into a single RPX file?
Who knows.

I'm only unsure about how GBA games are stored, I think they're also included in the RPX but better safe than sorry. :P

EDIT:
Well they seem to have small RPX files too, like <2MB.
So it seems those fall into the N64 and DS category.
The Roms seem to be in the alldata.bin file.
 
Last edited by ShadowOne333,
  • Like
Reactions: the_randomizer

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,221
Trophies
2
XP
34,423
Country
Mexico
"Progress"
eT6gPZK.jpg

It stretches, but doesn't position properly, so it wraps around the screen.
Ah so perhaps those N64 rpx have some function related to position in X and Y like the configuration_cafe.json file for the DS titles.
Code:
  "screen": [
  {
  "source": "upper",
  "rotation": 0,
  "size": "928 696",
  "target": "tv",
  "position": "176 12"
  },
  {
  "source": "lower",
  "rotation": 0,
  "size": "640 480",
  "target": "drc",
  "position": "106 0"
  }

Wild guess from my part goes into modifying only the X position for it in order have the image output in the correct position.

Edit:
The position in X might be something like 107 (0x6B) or 106 (0x6A) since both the lower screen of the DS and the SNES resolution don't change that much, at least I think they're being output in the same way for both. Anything between 64 and 70 might be the value of the position in the RPX, it might not be that far away from the same offset for the aspect ratio. I don't think anything above 0x70 could be possible.
 
Last edited by ShadowOne333,

the_randomizer

The Temp's official fox whisperer
OP
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
Awesome, love seeing all this progress for VC games, I have some more Snes games to convert, I plan on converting all the ones that I dumped and plan on dumping more. As for N64 games, well hopefully it won't be terribly hard to figure out :P
 

the_randomizer

The Temp's official fox whisperer
OP
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
If you want to, you can also inject more games :P.

I actually have no idea on how to inject games for Snes, that part I never understood :P I have more Snes games I can dump with DDD, but as far as RPX injection, no idea :lol: Any
luck with the N64 games or Snes filtering? I think the command is called GX2InitSamplerXYFilter and GX2InitSamplerZMFilter.
 

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,218
Country
Canada
I actually have no idea on how to inject games for Snes, that part I never understood :P I have more Snes games I can dump with DDD, but as far as RPX injection, no idea :lol: Any
luck with the N64 games or Snes filtering? I think the command is called GX2InitSamplerXYFilter and GX2InitSamplerZMFilter.
You just need t convert to elf, retrieve the rom in the file, and replace it with another one, repach as rpx, done :)
 
  • Like
Reactions: the_randomizer

the_randomizer

The Temp's official fox whisperer
OP
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
You just need t convert to elf, retrieve the rom in the file, and replace it with another one, repach as rpx, done :)

But that's just it, how do I "retrieve" the ROM? I have no idea where to look, convert what to ELF? The SFC/SMC file? I am so confused, please explain :wacko::blink:

What do I convert?
How do I retrieve the ROM from the file?
How do I know what to do?

There's no tutorial for this, so I guess I'll wait till someone explains the process.
 
Last edited by the_randomizer,

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,221
Trophies
2
XP
34,423
Country
Mexico
But that's just it, how do I "retrieve" the ROM? I have no idea where to look, convert what to ELF? The SFC/SMC file? I am so confused, please explain :wacko::blink:

What do I convert?
How do I retrieve the ROM from the file?
How do I know what to do?

There's no tutorial for this, so I guess I'll wait till someone explains the process.
  • Convert the RPX file of a legit SNES VC dump to ELF.
  • Download the ROM of the legit SNES VC dump for reference.
  • Open both the ELF and the downloaded ROM in a HEX editor.
    From the ROM, grab the first row of HEX values (if the first row is mostly zeroes, go to address 0x200 and grab that one, the ROM should be headerless in order to grab the very first row) and do a search for those values in the ELF file, you should get a result. That's the location of the ROM in the ELF file.
  • Starting from the location you found where the ROM starts, start going down taking into account the size of the original ROM. For example, if the original ROM is only 1MB in size, select the entire values starting from were the ROM starts in the ELF file until you select up to 0x0FFFFF bytes. If it's 2 MB then it should be up to 0x1FFFFF, 3 MB is 0x2FFFFF, etc. Remember that if the ROM of the VC dump is of a game of 1MB in size, you can only inject another 1MB game into it, no 2MB or more since it will crash.
  • Now simply get the ROM you want to inject that matches the size in MB of the original VC dump and replace the whole HEX values of the ROM you want to inject from the HEX editor and paste them where the original VC ROM was in the ELf file.
That's it.
 
Last edited by ShadowOne333,

the_randomizer

The Temp's official fox whisperer
OP
Member
Joined
Apr 29, 2011
Messages
31,284
Trophies
2
Age
38
Location
Dr. Wahwee's castle
XP
18,969
Country
United States
  • Convert the RPX file of a legit SNES VC dump to ELF.
  • Download the ROM of the legit SNES VC dump for reference.
  • Open both the ELF and the downloaded ROM in a HEX editor.
    From the ROM, grab the first row of HEX values (if the first row is mostly zeroes, go to address 0x200 and grab that one, the ROM should be headerless in order to grab the very first row) and do a search for those values in the ELF file, you should get a result. That's the location of the ROM in the ELF file.
  • Starting from the location you found where the ROM starts, start going down taking into account the size of the original ROM. For example, if the original ROM is only 1MB in size, select the entire values starting from were the ROM starts in the ELF file until you select up to 0x0FFFFF bytes. If it's 2 MB then it should be up to 0x1FFFFF, 3 MB is 0x2FFFFF, etc. Remember that if the ROM of the VC dump is of a game of 1MB in size, you can only inject another 1MB game into it, no 2MB or more since it will crash.
  • Now simply get the ROM you want to inject that matches the size in MB of the original VC dump and replace the whole HEX values of the ROM you want to inject from the HEX editor and paste them where the original VC ROM was in the ELf file.
That's it.

Well, I found another method that Vinscool taught me, I take the offset of the beginning of the ROM I want to inject, open up the Elf of an existing VC game, and pretty much highlight that, then I copy the offset of the game I'm injecting and pretty much replace it in the elf, as long as it doesn't exceed the size. In this case, I used Kirby Dream Land 3 as it's 4 MB, then used Power Rangers the Movie, which is 1.5 MB, and oddly enough, it works perfectly. But don't get me wrong, both methods are useful and I thank you both :P

Edit: Some games are very picky about the aspect ratio fix, I'll need to look into why games don't do it right away, but injection seems to be working great :P

Chrono Trigger, Final Fantasy VI (uncensored edition), etc :D

Edit 2: They will work, you just have to be extremely meticulous in double checking every single line of code that you replace and edit.
 
Last edited by the_randomizer,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    DinohScene @ DinohScene: get a used series X?