Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //put this code to get snprintf easily
- #include <sys/dbg.h>
- CDECL int _sys_printf(char* format, ...);
- #define printf _sys_printf
- CDECL int _sys_sprintf(char* buffer, char* format, ...);
- #define sprintf _sys_sprintf
- CDECL int _sys_snprintf(char* buffer, int size, char* format, ...);
- #define snprintf _sys_snprintf
- //the call function, pretty much completely eliminates the need to create an opd struct and define a function in the eboot
- template <typename T>
- __ALWAYS_INLINE T (*call(unsigned int address, unsigned int toc = TOC))(...) {
- volatile opd_s opd = {address,toc};
- T(*func)(...) = (T(*)(...))&opd;
- return func;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement