Hi, little help with pads
Posted: Fri Feb 08, 2008 2:52 am
Hi,
I am new on the forums, and i was compiling some programs, and now i want to use my multitap, but for any reason my ps2 freezes probably on the padInit(0) function...
I simply got the code prom the svn end made some modifications (changed printf for scr_printf, adding the needed libs and linkings of course, but the problem is with the rom0:XPADMAN and rom0:XSIO2MAN.
I load my programs using one of the new versions on uLE (that comes with Thunder PRO II, a chip that have launchelf installed)
Here is the includes:
these are the includes
here is the part that I modified (reset iop and set the scr_printf())
Anf finally, this is the Makefile:
And one more thing: i want to ask you how can I build the latest ps2sdk (jul/2007) using thw win32 precompiled toolchain available in ps2dev site?
I cannot build the envoriment directly from the script in mingw or msys because my internet is 56k. And so i only want to know how I can compile the latest ps2sdk. I only have to enter the ps2sdk dir and type make -f Makefile?
Or this don't work if i am using the win32 toolchain?
Thanks for the help!
I am new on the forums, and i was compiling some programs, and now i want to use my multitap, but for any reason my ps2 freezes probably on the padInit(0) function...
I simply got the code prom the svn end made some modifications (changed printf for scr_printf, adding the needed libs and linkings of course, but the problem is with the rom0:XPADMAN and rom0:XSIO2MAN.
I load my programs using one of the new versions on uLE (that comes with Thunder PRO II, a chip that have launchelf installed)
Here is the includes:
Code: Select all
#include <tamtypes.h>
#include <kernel.h>
#include <sifrpc.h>
#include <loadfile.h>
#include <stdio.h>
#include <string.h>
#include <iopcontrol.h>
#include <debug.h>
#include <iopheap.h>
#include <libcdvd.h>
#include "graph_registers.h"
#include "libpad.h"
#include "libmtap.h"
here is the part that I modified (reset iop and set the scr_printf())
Code: Select all
scr_printf("Resetting IOP\n");
cdInit(CDVD_INIT_EXIT);
SifExitIopHeap();
SifLoadFileExit();
SifExitRpc();
SifIopReset("rom0:UDNL rom0:EELOADCNF", 0);
while (SifIopSync()) ;//even resetting the iop i got the same result
u32 i;
struct padButtonStatus buttons;
u32 paddata;
u32 old_pad[2][4];
u32 new_pad[2][4];
s32 ret;
SifInitRpc(0);
init_scr();
scr_printf("libmtap sample");
if((argc == 2) && (strncmp(argv[1], "free", 4) == 0))
{
scr_printf(" - Using PS2SDK freesio2.irx, freemtap.irx and freepad.irx modules.\n");
loadmodules(1);
}
else
{
scr_printf(" - Using ROM XSIO2MAN, XMTAP and XPADMAN modules.\n");
scr_printf("Start this sample with 'free' as an argument to load freesio2.irx, freemtap.irx and freepad.irx\n");
scr_printf("Example: ps2client execee host:mtap_sample.elf free\n"); // right after this message the ps2 freezes
loadmodules(0);
}
Code: Select all
EE_BIN = mtap_sample.elf
EE_OBJS = mtap_sample.o
EE_LIBS = -lpad -lc -ldebug -lmtap -lcdvd
all: $(EE_BIN)
clean:
rm -f *.elf *.o *.a
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal
I cannot build the envoriment directly from the script in mingw or msys because my internet is 56k. And so i only want to know how I can compile the latest ps2sdk. I only have to enter the ps2sdk dir and type make -f Makefile?
Or this don't work if i am using the win32 toolchain?
Thanks for the help!