ROM Hack CTRPluginFramework - Blank Plugin - Now with Action Replay

dpad_5678

Ape weak on own. Ape strong in unity.
Member
Joined
Nov 19, 2015
Messages
2,219
Trophies
1
XP
2,880
Country
United States
If I'm understanding this right, this is an existing cheat that gets the offset for the inventory from the pointer stored in 0x08B4080 and then writes the Item ID for Coin Gun (0x389) to the first item slot (0xA14). You want to instead write an Item ID 1 value higher, so 0x38A, is that right? If I understood that right the code would just be:
Code:
if (cheatEnabled[4]){
        offset = READU32(offset + 0x08B4080);
        WRITEU32(offset + 0xA14, 0x38A);
        offset = 0;
        data = 0;
}

You don't even have to use hex, it only uses hex because I assume they copied the code from a GateWay cheat. So you could also write this:

Code:
if (cheatEnabled[4]){
        offset = READU32(offset + 0x08B4080);
        WRITEU32(offset + 0xA14, 906);
        offset = 0;
        data = 0;
}

The data value at the bottom is set to 0 at the end of the cheat because the original GateWay cheat ended with D2000000 00000000 which is a terminator code. Officially it seems like you'd actually want this:

Code:
if (cheatEnabled[4]){
        offset = READU32(offset + 0x08B4080);
        data = 1;
        WRITEU32(offset + 0xA14, 0x389 + data);
        offset = 0;
        data = 0;
}

All the above examples all do the exact same thing.
Thank you for your help! Essentially, I'm trying to use READU32 to grab the current item ID from the first item slot like you described, add one (1), and rewrite the new value back.
 

dpad_5678

Ape weak on own. Ape strong in unity.
Member
Joined
Nov 19, 2015
Messages
2,219
Trophies
1
XP
2,880
Country
United States
If I'm understanding this right, this is an existing cheat that gets the offset for the inventory from the pointer stored in 0x08B4080 and then writes the Item ID for Coin Gun (0x389) to the first item slot (0xA14). You want to instead write an Item ID 1 value higher, so 0x38A, is that right? If I understood that right the code would just be:
Code:
if (cheatEnabled[4]){
        offset = READU32(offset + 0x08B4080);
        WRITEU32(offset + 0xA14, 0x38A);
        offset = 0;
        data = 0;
}

You don't even have to use hex, it only uses hex because I assume they copied the code from a GateWay cheat. So you could also write this:

Code:
if (cheatEnabled[4]){
        offset = READU32(offset + 0x08B4080);
        WRITEU32(offset + 0xA14, 906);
        offset = 0;
        data = 0;
}

The data value at the bottom is set to 0 at the end of the cheat because the original GateWay cheat ended with D2000000 00000000 which is a terminator code. Officially it seems like you'd actually want this:

Code:
if (cheatEnabled[4]){
        offset = READU32(offset + 0x08B4080);
        data = 1;
        WRITEU32(offset + 0xA14, 0x389 + data);
        offset = 0;
        data = 0;
}

All the above examples all do the exact same thing.


I know this code in itself doesn't work, but this is about what I'm aiming for:


Code:
if (cheatEnabled[4]){
        if (getKey() == BUTTON_DU){
        offset = READU32(offset + 0x08B4080);
        data = READU32(0x08B4080);                   //Read value of first item slot into data
        data += 1;                                               //Next item (+1 to the ID)
        WRITEU32(offset + 0xA14, data);              //Write it back to the slot
        offset = 0;
        data = 0;
        }
}
 

DocKlokMan

Plugin Dev
Member
Joined
Apr 20, 2007
Messages
3,009
Trophies
2
Age
36
XP
4,571
Country
United States
I know this code in itself doesn't work, but this is about what I'm aiming for:


Code:
if (cheatEnabled[4]){
        if (getKey() == BUTTON_DU){
        offset = READU32(offset + 0x08B4080);
        data = READU32(0x08B4080);                   //Read value of first item slot into data
        data += 1;                                               //Next item (+1 to the ID)
        WRITEU32(offset + 0xA14, data);              //Write it back to the slot
        offset = 0;
        data = 0;
        }
}
Super close:

Code:
if (cheatEnabled[4]) {
    if (getKey() == BUTTON_DU) {                        // If D-Pad Up is pressed
        offset = READU32(0x08B4080);                    // Get inventory pointer
        data = READU32(offset + 0xA14) + 1;             // Get current item in slot 1 then +1
        WRITEU32(offset + 0xA14, data);                 // Write it back to the slot
        offset = 0;                                     // Reset offset to 0 for next cheat
        data = 0;                                       // Reset data to 0 for next cheat
    }
}
There is an issue with this though. This code runs multiple times per second because the 3DS processes these functions quickly. One press of the button may increase the amount by more than one because it runs multiple times while you have the button pressed. There's no real good simple way to fix this. You can also add a decrement option too:

Code:
if (cheatEnabled[4]) {
    offset = READU32(0x08B4080);                        // Get inventory pointer
    data = READU32(offset + 0xA14);                     // Get current value of slot 1
    if (getKey() == BUTTON_DU) {                        // If D-Pad Up is pressed    
        data += 1;                                      // Increase by 1
    }
    if (getKey() == BUTTON_DD) {                        // If D-Pad Down is pressed
        data -= 1;                                      // Decrease by 1
    }
    WRITEU32(offset + 0xA14, data);                     // Write it back to the slot
    offset = 0;                                         // Reset offset to 0 for next cheat
    data = 0;                                           // Reset data to 0 for next cheat
}
 
Last edited by DocKlokMan,
  • Like
Reactions: dpad_5678

dpad_5678

Ape weak on own. Ape strong in unity.
Member
Joined
Nov 19, 2015
Messages
2,219
Trophies
1
XP
2,880
Country
United States
Super close:

Code:
if (cheatEnabled[4]) {
    if (getKey() == BUTTON_DU) {                        // If D-Pad Up is pressed
        offset = READU32(0x08B4080);                    // Get inventory pointer
        data = READU32(offset + 0xA14) + 1;             // Get current item in slot 1 then +1
        WRITEU32(offset + 0xA14, data);                 // Write it back to the slot
        offset = 0;                                     // Reset offset to 0 for next cheat
        data = 0;                                       // Reset data to 0 for next cheat
    }
}
There is an issue with this though. This code runs multiple times per second because the 3DS processes these functions quickly. One press of the button may increase the amount by more than one because it runs multiple times while you have the button pressed. There's no real good simple way to fix this. You can also add a decrement option too:

Code:
if (cheatEnabled[4]) {
    offset = READU32(0x08B4080);                        // Get inventory pointer
    data = READU32(offset + 0xA14);                     // Get current value of slot 1
    if (getKey() == BUTTON_DU) {                        // If D-Pad Up is pressed   
        data += 1;                                      // Increase by 1
    }
    if (getKey() == BUTTON_DD) {                        // If D-Pad Down is pressed
        data -= 1;                                      // Decrease by 1
    }
    WRITEU32(offset + 0xA14, data);                     // Write it back to the slot
    offset = 0;                                         // Reset offset to 0 for next cheat
    data = 0;                                           // Reset data to 0 for next cheat
}
It worked! Thank you so much for your help!
 

MrHaqs

Well-Known Member
Newcomer
Joined
Jun 12, 2016
Messages
97
Trophies
0
Age
21
Location
Home
XP
219
Country
United Kingdom
@Nanquitas noticed a problem with the plugin loader. found out that because its always enabled on boot, even after disabling it and booting ntr selector for mode3 it basically re-enables it and crashes the system like it would if you left it on for the regular ntr selector.

this needs fixing asap cuz cheap guys like me cant afford the new3ds.
thanks alooot
 

Wii8461

Well-Known Member
Newcomer
Joined
Aug 9, 2015
Messages
63
Trophies
0
XP
683
Country
Chad
Is there any conditional 8-bit codes?

Also @Nanquitas
Is there anyway to fix the ctrpfdata.bin from corrupting? It corrupts if the game crashes while the menu is saving the settings. Like if I adjust a value that crashes it, then I leave the menu.
Could you make a ctrpfdata.bin backup file maybe? So if the first one corrupts, you can load the backup?
 

violentthot

Member
Newcomer
Joined
Jun 5, 2017
Messages
13
Trophies
0
Age
38
XP
62
Country
United States
How do.i get the action replay to work the pre-made stuff works but the action repay part does not.
I just want to make a few codes for games I play personally.
On the note how to u use multi updater to update this?
 

Nanquitas

Well-Known Member
OP
Member
Joined
Sep 29, 2015
Messages
2,345
Trophies
0
Age
30
Location
South of France :)
XP
3,336
Country
France
@Nanquitas noticed a problem with the plugin loader. found out that because its always enabled on boot, even after disabling it and booting ntr selector for mode3 it basically re-enables it and crashes the system like it would if you left it on for the regular ntr selector.

this needs fixing asap cuz cheap guys like me cant afford the new3ds.
thanks alooot
Without you can't use it for Mode3 games... Use another Luma3DS to load NTR. ;)


Is there any conditional 8-bit codes?

Also @Nanquitas
Is there anyway to fix the ctrpfdata.bin from corrupting? It corrupts if the game crashes while the menu is saving the settings. Like if I adjust a value that crashes it, then I leave the menu.
Could you make a ctrpfdata.bin backup file maybe? So if the first one corrupts, you can load the backup?
To do 8bits conditions you use 16bits ones with masks (mask the byte you don't want to check).

Yeah, the file corruption and crashs is being addressed in last alphas, an update will be released when it'll be ready. ;)


How do.i get the action replay to work the pre-made stuff works but the action repay part does not.
I just want to make a few codes for games I play personally.
On the note how to u use multi updater to update this?
I don't understand your message. If you have trouble understanding how the AR works, maybe you should check the video ?
 
  • Like
Reactions: Wii8461 and Vermil

violentthot

Member
Newcomer
Joined
Jun 5, 2017
Messages
13
Trophies
0
Age
38
XP
62
Country
United States
Sorry I'm having an issue with the action replay not loading but something like ultra sumo is working.
The path I have set is luma/ActionReplay/ActionRellay.plg
It doesn't load anything tho when I open a game.


As well the github says these items(luma with plug in support and actionreplay) can be updated with multi updater.
Just not understanding how to do that
 

Vermil

I don't need a SENPAI to notice me, Right SENPAI?
Member
Joined
Aug 21, 2017
Messages
298
Trophies
0
Age
25
Location
Nightcore -Rockefeller Street
XP
418
Country
Philippines
Sorry I'm having an issue with the action replay not loading but something like ultra sumo is working.
The path I have set is luma/ActionReplay/ActionRellay.plg
It doesn't load anything tho when I open a game.


As well the github says these items(luma with plug in support and actionreplay) can be updated with multi updater.
Just not understanding how to do that
I think you have a typo and your missing something : luma/ActionReplay/ActionRellay.plg
Try changing it into : luma/plugins/ActionReplay/ActionReplay.plg
And if you have a plugin from : luma/plugins/<Title ID>/plugin.plg , the plugin loader will use that instead of ActionReplay.plg from: luma/plugins/ActionReplay/ActionReplay.plg
And about the Multi-updater, I don't know about that one.
 

violentthot

Member
Newcomer
Joined
Jun 5, 2017
Messages
13
Trophies
0
Age
38
XP
62
Country
United States
I have the correct path set.
I may have to redownload the files and try again.

I think you have a typo and your missing something : luma/ActionReplay/ActionRellay.plg
Try changing it into : luma/plugins/ActionReplay/ActionReplay.plg
And if you have a plugin from : luma/plugins/<Title ID>/plugin.plg , the plugin loader will use that instead of ActionReplay.plg from: luma/plugins/ActionReplay/ActionReplay.plg
And about the Multi-updater, I don't know about that one.
 
Last edited by violentthot,

violentthot

Member
Newcomer
Joined
Jun 5, 2017
Messages
13
Trophies
0
Age
38
XP
62
Country
United States
Okay thanks for clearing that up for me.
I still cannot get the action replay to work for games that have no cheats.
I've followed everything to a tee
 

MrHaqs

Well-Known Member
Newcomer
Joined
Jun 12, 2016
Messages
97
Trophies
0
Age
21
Location
Home
XP
219
Country
United Kingdom
@Nanquitas I understand that but can't you make an option where you can change the default option of enabled or disabled on boot? That would be super useful. I like your port and it would be a pain in the ass to keep changing Luma. Oh and my Luma updater is bugged too so that's another problem in my end.
 
Last edited by MrHaqs,

Nanquitas

Well-Known Member
OP
Member
Joined
Sep 29, 2015
Messages
2,345
Trophies
0
Age
30
Location
South of France :)
XP
3,336
Country
France
@Nanquitas I understand that but can't you make an option where you can change the default option of enabled or disabled on boot? That would be super useful. I like your port and it would be a pain in the ass to keep changing Luma. Oh and my Luma updater is bugged too so that's another problem in my end.
No, the settings aren't persistent. So either you have an automatically enabled version that can load plugins on Mode3 games or you have a version with the plugin loader off by default and you won't be able to use it to load plugins on Mode3 games.
 

HollowedFear

Well-Known Member
Member
Joined
Dec 30, 2013
Messages
308
Trophies
0
Age
33
XP
462
Country
United States
@Nanquitas I understand that but can't you make an option where you can change the default option of enabled or disabled on boot? That would be super useful. I like your port and it would be a pain in the ass to keep changing Luma. Oh and my Luma updater is bugged too so that's another problem in my end.

You could easily setup something like https://github.com/derrekr/fastboot3DS to help you out, as it'll just be a simple button press to decide on which luma you want/need to use instead of having to switch out what luma you want/need to use.
 
  • Like
Reactions: MrHaqs

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    NinStar @ NinStar: I always thought that capcom shuffled the games in these collection, but apparently they are all...