-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
156 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef ME_H | ||
#define ME_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void foo_me(); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // ME_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#include <stdio.h> | ||
|
||
#include <pspkernel.h> | ||
#include <pspdebug.h> | ||
#include <pspdisplay.h> | ||
#include <pspkernel.h> | ||
|
||
#include <me.h> | ||
|
||
#define VERS 1 | ||
#define REVS 0 | ||
PSP_MODULE_INFO("FooME", 0, VERS, REVS); | ||
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU); | ||
|
||
static int exitRequest = 0; | ||
|
||
static int isRunning() | ||
{ | ||
return !exitRequest; | ||
} | ||
|
||
static int exitCallback(int arg1, int arg2, void *common) | ||
{ | ||
exitRequest = 1; | ||
return 0; | ||
} | ||
|
||
static int callbackThread(SceSize args, void *argp) | ||
{ | ||
int callbackID; | ||
|
||
callbackID = sceKernelCreateCallback("Exit Callback", exitCallback, NULL); | ||
sceKernelRegisterExitCallback(callbackID); | ||
|
||
sceKernelSleepThreadCB(); | ||
|
||
return 0; | ||
} | ||
|
||
static int setupExitCallback() | ||
{ | ||
int threadID = 0; | ||
|
||
threadID = sceKernelCreateThread("Callback Update Thread", callbackThread, 0x11, 0xFA0, THREAD_ATTR_USER, 0); | ||
|
||
if (threadID >= 0) | ||
{ | ||
sceKernelStartThread(threadID, 0, 0); | ||
} | ||
|
||
return threadID; | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
// basic init | ||
setupExitCallback(); | ||
|
||
foo_me(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <stdio.h> | ||
|
||
void foo_me() | ||
{ | ||
printf("static lib: FooME\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Define the exports for the prx | ||
PSP_BEGIN_EXPORTS | ||
|
||
# These four lines are mandatory (although you can add other functions like module_stop) | ||
# syslib is a psynonym for the single mandatory export. | ||
PSP_EXPORT_START(syslib, 0, 0x8000) | ||
PSP_EXPORT_FUNC(module_start) | ||
PSP_EXPORT_FUNC(module_stop) | ||
PSP_EXPORT_VAR(module_info) | ||
PSP_EXPORT_END | ||
|
||
PSP_END_EXPORTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <stdio.h> | ||
|
||
#include <pspkernel.h> | ||
|
||
#define VERS 1 | ||
#define REVS 0 | ||
PSP_MODULE_INFO("PSPME", PSP_MODULE_KERNEL, VERS, REVS); | ||
|
||
int main_thread(SceSize args, void *argp) | ||
{ | ||
printf("PSPME Module\n"); | ||
|
||
return 0; | ||
} | ||
|
||
/* Entry point */ | ||
int module_start(SceSize args, void *argp) | ||
{ | ||
int thid; | ||
|
||
thid = sceKernelCreateThread("template", main_thread, 7, 0x800, 0, NULL); | ||
if(thid >= 0) | ||
{ | ||
sceKernelStartThread(thid, args, argp); | ||
} | ||
return 0; | ||
} | ||
|
||
/* Module stop entry */ | ||
int module_stop(SceSize args, void *argp) | ||
{ | ||
return 0; | ||
} |