Hacking Nintendont

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,207
Country
Canada
I'm having a weird little problem.

My disc of Metroid Prime 2 has french language script, it works just fine with nintendont since a good while.
But here is the thing. I got a BC wii, nintendont works and loads my game from disc. If I launch it with memcard emulation ON (that was my save used on WiiU) the game loads in french.
But if I use my real Memory card, my current save loads the game in english only, even though I set the language to french, while with MC emu ON it worked.

Anyone knows why this happens to me? I'm not being picky, I actually don't care, but this is weird still :P
 

FIX94

Former Staff
Former Staff
Joined
Dec 3, 2009
Messages
7,284
Trophies
0
Age
29
Location
???
XP
11,238
Country
Germany
Anyone knows why this happens to me? I'm not being picky, I actually don't care, but this is weird still :P

simple, memcard emulation does include emulation of the so called SRAM which contains language and video mode information. oh BTW probably tomorrow I'll release a new nintendont version with widescreen patches for both ocarina of time and majoras mask ;)
 

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,184
Trophies
2
XP
33,715
Country
Mexico
simple, memcard emulation does include emulation of the so called SRAM which contains language and video mode information. oh BTW probably tomorrow I'll release a new nintendont version with widescreen patches for both ocarina of time and majoras mask ;)
I can die at peace now.
 

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,207
Country
Canada
simple, memcard emulation does include emulation of the so called SRAM which contains language and video mode information. oh BTW probably tomorrow I'll release a new nintendont version with widescreen patches for both ocarina of time and majoras mask ;)

Is there a way to for such SRAM being forced with language if REAL MC is used? My gamecube is US so I can't changes languages in BIOS, which is stupid since some of my games actually has french script :P
 

ole

Well-Known Member
Newcomer
Joined
Apr 12, 2015
Messages
76
Trophies
0
Age
39
XP
354
Country
Norway
you just need to use the "devkitpro installer" and use the included "Build" file to compile everything, its simple.


Thank you.

Replaced
Code:
                if(*((u8*)buffer+6) == 0)
                {
                    stat->controller = C_CC;
                    //dbgprintf("Connected Classic Controller\n");
                }
                else
                {
                    stat->controller = C_CCP;
                    //dbgprintf("Connected Classic Controller Pro\n");
                }

With this dirty trick
Code:
 if(*((u8*)buffer+6) == 0)
{
stat->controller = C_CCP;
//dbgprintf("Connected Classic Controller Pro\n");
}
else
{
stat->controller = C_CCP;
//dbgprintf("Connected Classic Controller Pro\n");
}

I can share the boot.dol if its okey and if anyone want it.

But are all those ID verified original/3. party "Classic controller" and that not some of those are only 3.party "Classic Pro controller"?
 

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,207
Country
Canada
Thank you.

Replaced
Code:
                if(*((u8*)buffer+6) == 0)
                {
                    stat->controller = C_CC;
                    //dbgprintf("Connected Classic Controller\n");
                }
                else
                {
                    stat->controller = C_CCP;
                    //dbgprintf("Connected Classic Controller Pro\n");
                }

With this dirty trick
Code:
                if(*((u8*)buffer+6) == 0)
                {
                    stat->controller = C_CC;
                    //dbgprintf("Connected Classic Controller\n");
                }
                else
                {
                    stat->controller = C_CCP;
                    //dbgprintf("Connected Classic Controller Pro\n");
                }

I can share the boot.dol if its okey and if anyone want it.

I don't see what you changed :wacko:
 

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,184
Trophies
2
XP
33,715
Country
Mexico
Thank you.

Replaced
Code:
                if(*((u8*)buffer+6) == 0)
                {
                    stat->controller = C_CC;
                    //dbgprintf("Connected Classic Controller\n");
                }
                else
                {
                    stat->controller = C_CCP;
                    //dbgprintf("Connected Classic Controller Pro\n");
                }

With this dirty trick
Code:
                if(*((u8*)buffer+6) == 0)
                {
                    stat->controller = C_CC;
                    //dbgprintf("Connected Classic Controller\n");
                }
                else
                {
                    stat->controller = C_CCP;
                    //dbgprintf("Connected Classic Controller Pro\n");
                }

I can share the boot.dol if its okey and if anyone want it.
?
There is no change in the code O.O
What dirty trick?
 

ole

Well-Known Member
Newcomer
Joined
Apr 12, 2015
Messages
76
Trophies
0
Age
39
XP
354
Country
Norway
I don't see what you changed :wacko:

?
There is no change in the code O.O
What dirty trick?


The copy from my VM to main OS didnt go as planned and it didnt copy the new lines, I have edited my original post.

I even edited the post before you posted your replies if you watch at the timestamp :)
 
  • Like
Reactions: Margen67

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,207
Country
Canada
The copy from my VM to main OS didnt go as planned and it didnt copy the new lines, I have edited my original post.

I even edited the post before you posted your replies if you watch at the timestamp :)

I see now. Removing the "if" would have done the same though :)
 
  • Like
Reactions: Margen67

ole

Well-Known Member
Newcomer
Joined
Apr 12, 2015
Messages
76
Trophies
0
Age
39
XP
354
Country
Norway
I see now. Removing the "if" would have done the same though :)


But one thing Im interested is finding out what the ID for my Classic pro controller is, I could of course do it the hard way by compiling multiple version with all of them missing one of the Classic controller IDs..
Then I could remove that one and still keep other Classic controller operative.
 

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,207
Country
Canada
But one thing Im interested is finding out what the ID for my Classic pro controller is, I could of course do it the hard way by compiling multiple version with all of them missing one of the Classic controller IDs..
Then I could remove that one and still keep other Classic controller operative.

Yeah, but I don't know how you can get the ID :P



Back to my previous problem, I found a quick workaround. using Open Sram Language Modifier, I can set the values, then launch my game in wanted language with MC emu OFF :)
If anything from this homebrew could be implemented in nintendont, that would be cool :)
 
  • Like
Reactions: Margen67

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,207
Country
Canada
Baten Kaitos eternal wing and the lost ocean do not like its language being forced :P

IMG_20150525_184850.jpg


All text looks like that.
Updated Wiki.
 
  • Like
Reactions: Margen67

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,207
Country
Canada
Yeah, but I don't know how you can get the ID :P



Back to my previous problem, I found a quick workaround. using Open Sram Language Modifier, I can set the values, then launch my game in wanted language with MC emu OFF :)
If anything from this homebrew could be implemented in nintendont, that would be cool :)


Here is the entire source code. It looks very simple to do.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gccore.h>
 
#ifdef HW_RVL
    #include <wiiuse/wpad.h>
#endif
 
#define VERSION 5
 
/*
Sram Flags info
 
bit(s)    Description
7        ? (=0)
6          ? (=0)
5          ? (=1)
4          ? (=0)
3          ? (=1)
2          0: mono 1: stereo
1          ? (=0)
0          ? (=0)
 
*/
#define SRAM_AUDIOBIT 2
 
#define SRAM_ENGLISH 0
#define SRAM_GERMAN 1
#define SRAM_FRENCH 2
#define SRAM_SPANISH 3
#define SRAM_ITALIAN 4
#define SRAM_DUTCH 5
 
extern syssram* __SYS_LockSram();
extern syssramex* __SYS_LockSramEx();
extern u32 __SYS_UnlockSram(u32 write);
extern u32 __SYS_UnlockSramEx(u32 write);
 
void SYS_SetSramLang(u8 lang)
{
  u32 write;
  syssram *sram;
 
  write = 0;
  sram = __SYS_LockSram();
  if(sram->lang != lang) {
      sram->lang = lang;
      write = 1;
  }
  __SYS_UnlockSram(write);
}
 
u8 SYS_GetSramLang()
{
  u8 lang;
  syssram *sram;
 
  lang = 0;
  sram = __SYS_LockSram();
  lang = sram->lang;
  __SYS_UnlockSram(0);
  return lang;
}
 
 
void SYS_SetSramFlags(u8 flags)
{
  u32 write;
  syssram *sram;
 
  write = 0;
  sram = __SYS_LockSram();
  if(sram->flags != flags) {
      sram->flags = flags;
      write = 1;
  }
  __SYS_UnlockSram(write);
}
 
u8 SYS_GetSramFlags()
{
  u8 flags;
  syssram *sram;
 
  flags = 0;
  sram = __SYS_LockSram();
  flags = sram->flags;
  __SYS_UnlockSram(0);
  return flags;
}
 
//callbacks
 
int reboot=0, shutdown=0;
 
void __Sys_ResetCallback(void)
{
    /* Reboot console */
    reboot=1;
}
void __Sys_PowerCallback(void)
{
    /* Poweroff console */
    shutdown=1;
}
void __Wpad_PowerCallback(s32 chan)
{
    /* Poweroff console */
    shutdown=1;
}
 
void Shutdown()
{
SYS_ResetSystem(SYS_POWEROFF, 0, 0);
}
 
void Reboot()
{
if (*(u32*)0x80001800) exit(0);
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
}
 
 
 
static void *xfb = NULL;
static GXRModeObj *rmode = NULL;
 
//---------------------------------------------------------------------------------
int main(int argc, char **argv) {
//---------------------------------------------------------------------------------
 
    u8 language, flags;
    char srambuff[64];
    syssram *sram;
    syssramex *sramex;
 
    // Initialise the video system
    VIDEO_Init();
 
    //set callbacks
    SYS_SetResetCallback(__Sys_ResetCallback);
 
    PAD_Init();
#ifdef HW_RVL
    SYS_SetPowerCallback(__Sys_PowerCallback);
    // This function initialises the attached controllers
    WPAD_Init();
    WPAD_SetIdleTimeout(60);
    WPAD_SetPowerButtonCallback(__Wpad_PowerCallback);
#endif
 
    // Obtain the preferred video mode from the system
    // This will correspond to the settings in the Wii menu
    rmode = VIDEO_GetPreferredMode(NULL);
 
    // Allocate memory for the display in the uncached region
    xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
 
    // Initialise the console, required for printf
    console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
 
    // Set up the video registers with the chosen mode
    VIDEO_Configure(rmode);
 
    // Tell the video hardware where our display memory is
    VIDEO_SetNextFramebuffer(xfb);
 
    // Make the display visible
    VIDEO_SetBlack(FALSE);
 
    // Flush the video register changes to the hardware
    VIDEO_Flush();
 
    // Wait for Video setup to complete
    VIDEO_WaitVSync();
    if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
 
again:
    // The console understands VT terminal escape codes
    // This positions the cursor on row 2, column 0
    // we can use variables for this with format codes too
    // e.g. printf ("\x1b[%d;%dH", row, column );
    printf("\x1b[2;0H");
 
 
    printf("\tOpen Sram Language Modifier v%d by suloku\n\n", VERSION);
 
    printf("Current Sram language: ");
 
    language = SYS_GetSramLang();
 
    switch (language){
        case SRAM_ENGLISH:
            printf("\x1b[32;1mEnglish        \n\n");
            break;
        case SRAM_GERMAN:
            printf("\x1b[32;1mGerman          \n\n");
            break;
        case SRAM_FRENCH:
            printf("\x1b[32;1mFrench          \n\n");
            break;
        case SRAM_SPANISH:
            printf("\x1b[32;1mSpanish        \n\n");
            break;
        case SRAM_ITALIAN:
            printf("\x1b[32;1mItalian        \n\n");
            break;
        case SRAM_DUTCH:
            printf("\x1b[32;1mDutch          \n\n");
            break;
        default:
            printf("\x1b[31;1mSomething went wrong");
            break;
    }
 
    printf("\x1b[37;1m");
 
    printf("Current audio flag: ");
    flags = SYS_GetSramFlags();
    if ( ( flags & (1 << SRAM_AUDIOBIT) ) ){
        printf("\x1b[31;1mStereo\n");
    }else{
        printf("\x1b[31;1mMono  \n");
    }
 
    printf("\x1b[37;1m");
 
#ifdef HW_RVL
    printf("Press DOWN/Z to toogle between MONO and STEREO\n\n");
 
    printf("Press one of the following to change the Sram language:\n");    printf("\t\t\t");
    printf(" A : English  \t\t\t");
    printf(" B : German    \n"); printf("\t\t\t");
    printf("-/Y: French    \t\t\t");
    printf("+/X: Spanish  \n"); printf("\t\t\t");
    printf("1/R: Italian  \t\t\t");
    printf("2/L: Dutch    \n\n");
    printf("\x1b[31;1mWarning! \x1b[37;1mIf you launch your gamecube game from the wii's disk channel sram will be reset to default! Please use an alternative loading method.\n\n");
    printf("Press HOME/START to exit\n\n");
#else
    printf("Press Z to toogle between MONO and STEREO\n\n");
 
    printf("Press one of the following to change the Sram language:\n"); printf("\t\t\t");
    printf("A: English  \t\t\t");
    printf("B: German    \n"); printf("\t\t\t");
    printf("Y: French    \t\t\t");
    printf("X: Spanish  \n"); printf("\t\t\t");
    printf("R: Italian  \t\t\t");
    printf("L: Dutch    \n\n");
    printf("Press START to exit\n\n");
#endif
 
    //should use the sizeof versions, but in current libogc git (27 aug 2012)
    //syssramex->flash_id is declared as u16 and it is u8, resulting in
    //syssramex structure being 46 bytes instead of 44 (full sram being 64 bytes)
    sram = __SYS_LockSram();
    //memcpy(srambuff, sram, sizeof(syssram));
    memcpy(srambuff, sram, 20);
    __SYS_UnlockSram(0);
 
    sramex = __SYS_LockSramEx();
    //memcpy(srambuff+sizeof(syssram), sramex, sizeof(sissramex));
    memcpy(srambuff+20, sramex, 44);
    __SYS_UnlockSramEx(0);
 
    int i;
    printf("SRAM Hex View\n\n");
    printf("    \t\t 0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F\n");
    for (i=0;i<64;i++){
 
        if( (i%16) == 0 )
            printf("\n0x%d0h\t\t", i/16);
     
        if (i==0x12){
            printf("\x1b[32;1m%02X  ", srambuff[i]);
            printf("\x1b[37;1m");
 
        }else if (i==0x13){
            printf("\x1b[31;1m%02X  ", srambuff[i]);
            printf("\x1b[37;1m");
        }else{
            printf("%02X  ", srambuff[i]);
        }
 
    }
 
 
 
    while(1) { 
        PAD_ScanPads();
        u32 pressedgc = PAD_ButtonsDown(0);
 
#ifdef HW_RVL
 
        // Call WPAD_ScanPads each loop, this reads the latest controller states
        WPAD_ScanPads();
 
        // WPAD_ButtonsDown tells us which buttons were pressed in this loop
        // this is a "one shot" state which will not fire again until the button has been released
        u32 pressed = WPAD_ButtonsDown(0);
#endif
 
        if ( pressedgc & PAD_BUTTON_A
    #ifdef HW_RVL
            || pressed & WPAD_BUTTON_A
    #endif
        )
            SYS_SetSramLang(SRAM_ENGLISH);
        if ( pressedgc & PAD_BUTTON_B
    #ifdef HW_RVL
            || pressed & WPAD_BUTTON_B
    #endif
        )
            SYS_SetSramLang(SRAM_GERMAN);
        if ( pressedgc & PAD_BUTTON_Y
    #ifdef HW_RVL
            || pressed & WPAD_BUTTON_MINUS
    #endif
        )
            SYS_SetSramLang(SRAM_FRENCH);
        if ( pressedgc & PAD_BUTTON_X
    #ifdef HW_RVL
            || pressed & WPAD_BUTTON_PLUS
    #endif
        )
            SYS_SetSramLang(SRAM_SPANISH);
        if ( pressedgc & PAD_TRIGGER_R
    #ifdef HW_RVL
            || pressed & WPAD_BUTTON_1
    #endif
        )
            SYS_SetSramLang(SRAM_ITALIAN);
        if ( pressedgc & PAD_TRIGGER_L
    #ifdef HW_RVL
            || pressed & WPAD_BUTTON_2
    #endif
        )
            SYS_SetSramLang(SRAM_DUTCH);
     
        if ( pressedgc & PAD_TRIGGER_Z
    #ifdef HW_RVL
            || pressed & WPAD_BUTTON_DOWN
    #endif
        ){
            flags ^= 1 << SRAM_AUDIOBIT;
            SYS_SetSramFlags(flags);
        }
 
        // We return to the launcher application via exit
        if ( reboot || pressedgc & PAD_BUTTON_START
    #ifdef HW_RVL
            || pressed & WPAD_BUTTON_HOME
    #endif
        ) Reboot();
 
        if (shutdown)
            Shutdown();
     
 
        if ( pressedgc
    #ifdef HW_RVL
            || pressed
    #endif
        ) goto again;
 
        // Wait for the next frame
        VIDEO_WaitVSync();
    }
 
    return 0;
}
FIX94 do you think you could look at it, if you want to? I'm not very good at this, and I don't know how to add this change SRAM parameter to be usable only if MC emu is OFF and being used according the language config.
Edit: sorry for triple posting, that wasn't intentionnal :(
 
  • Like
Reactions: Margen67

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,207
Country
Canada
are you sure the ntsc version of the game even has the language your forcing it too? just because the pal version has doesnt mean its also on the ntsc one.

I confirm it doesn't have french support :P

As long the game is loaded in english, it's fine :)
 
  • Like
Reactions: Margen67

sonictopfan

Well-Known Member
Member
Joined
Mar 2, 2010
Messages
2,701
Trophies
1
XP
1,929
Country
I think we are just fine with the already supported formats.
Otherwise we will end up asking for .000-.094 compressed file formats. XD

Give the man a break. :P
I bet whatever plans he has for Nintendont in the future after this will be amazing for sure. :)
You know I didn't ask for .000 format, there's a difference between "lol, saving 3KB" and "saving 1,200MB" some games like Luigi's Mansion and Wario World are around 200MB (some games are even smaller) I don't see why I should waste 1,500MB on a game that's less than 200MB when I can save that space.

Anyway it was only a suggestion as it's been mentioned a few times before in this thread that it can be done, if it's stated to not be doable or could cause more crashes then I'm fine with what we have!
 

Etheboss

Official LULWUT supporter
Member
Joined
Feb 24, 2009
Messages
2,445
Trophies
0
Location
Around somewhere
XP
851
Country
Netherlands
Before this discussion derailes let me remind all that this is an opensource project, everyone that feels like picking up the challenge can ask access to the source from the current devs and add whatever they want...or copy the source and make a mod...

So in my opinion asking is not a problem and i think if it is asked without addressing a current dev noone will be triggered to give a remark either..
 

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,184
Trophies
2
XP
33,715
Country
Mexico
You know I didn't ask for .000 format, there's a difference between "lol, saving 3KB" and "saving 1,200MB" some games like Luigi's Mansion and Wario World are around 200MB (some games are even smaller) I don't see why I should waste 1,500MB on a game that's less than 200MB when I can save that space.

Anyway it was only a suggestion as it's been mentioned a few times before in this thread that it can be done, if it's stated to not be doable or could cause more crashes then I'm fine with what we have!
Hey I was just joking around. :P
I am aware of the space that some of those games could save. Luigi's Mansion is around 180MB or so, quite a lot compared to the 1.4GB of the mini-disc.

Just don't take it too harshly. :P
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: Or Genesis.