ROM Hack CTRPluginFramework - Blank Plugin - Now with Action Replay

  • Thread starter Thread starter Nanquitas
  • Start date Start date
  • Views Views 832,627
  • Replies Replies 1,472
  • Likes Likes 100
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.
 
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;
        }
}
 
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
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!
 
@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
 
I think you can just install a normal build of Luma to solve that, then just load the NTR when needed.
 
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?
 
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 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
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
 
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.
 
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,
As well the github says these items(luma with plug in support and actionreplay) can be updated with multi updater.

This is no longer possible due to recent events on githubs doing, multiupdater will no longer work for things that are hosted on github.
 
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
 
@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 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.
 
@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