Instant syscall implementation (C)
14 posts
• Page 2 of 2 • 1, 2
- aapman55
- Senior Member
-
- Posts: 66
- Joined: Sun Apr 15, 2012 4:00 pm
- Calculators: Casio fx-9860G
Re: Instant syscall implementation (C)
ha thanks, it works.
So if i want to have a couple of syscalls using different number of input parameters. I could use more typedefs with another name?
typedef int(*sc_ipi)(int);
typedef int(*sc_ipi2)(int,int);
So if i want to have a couple of syscalls using different number of input parameters. I could use more typedefs with another name?
typedef int(*sc_ipi)(int);
typedef int(*sc_ipi2)(int,int);
- aapman55
- Senior Member
-
- Posts: 66
- Joined: Sun Apr 15, 2012 4:00 pm
- Calculators: Casio fx-9860G
Re: Instant syscall implementation (C)
ok my last dumb question of today.
In order to use
i think i still need to define some variables and functions like the OSVersionAsInt().
But i couldnt find how to call this function.
In order to use
- Code: Select all
short*APP_EnableRestart(){
short*pEnableRestartFlag;
switch ( OSVersionAsInt() ){
case 0x01020000: case 0x01030000: pEnableRestartFlag = (short*)0x88006970; break;
case 0x01040000: case 0x01050000: case 0x01051000: pEnableRestartFlag = (short*)0x88006974; break;
case 0x01100000: case 0x01110000: pEnableRestartFlag = (short*)0x88006CC4; break;
case 0x02000000: pEnableRestartFlag = (short*)0x8800773C; break;
default : pEnableRestartFlag = 0;
}
if ( pEnableRestartFlag ) *pEnableRestartFlag = 1;
return pEnableRestartFlag;
}
i think i still need to define some variables and functions like the OSVersionAsInt().
But i couldnt find how to call this function.
Re: Instant syscall implementation (C)
From Simon's docs:
- Code: Select all
int OSVersionAsInt(void)
{
unsigned char mainversion;
unsigned char minorversion;
unsigned short release;
unsigned short build;
GlibGetOSVersionInfo(&mainversion, &minorversion, &release, &build); //GlibGetOSVersionInfo = syscall 0x0015
return ((mainversion << 24) & 0xFF000000) | ((minorversion << 16) & 0x00FF0000) | (release & 0x0000FFFF);
}
14 posts
• Page 2 of 2 • 1, 2
Return to Tutorials & Code Snippets
Who is online
Users browsing this forum: No registered users and 2 guests