libpspnet_adhoc.a broken ???

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
gr8dane
Posts: 16
Joined: Thu Aug 18, 2005 11:10 am

libpspnet_adhoc.a broken ???

Post by gr8dane »

Hi all,

I hope somebody can shed some light on this. I am fooling around with adhoc stuff and had previously been running in kernel mode and doing my own stubs and fixups for adhoc functions. This all works wonderful.

I would however like to use the adhoc lib instead, partly in the hopes that I could now run in user mode.

The following code, using the following makefile gives me a 0x80020001 error when I try and execute my elf or eboot file file.

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <pspkernel.h>

PSP_MODULE_INFO&#40;"Simple Sample", 0, 1, 1&#41;;
PSP_MAIN_THREAD_ATTR&#40;THREAD_ATTR_USER&#41;;

int sceNetAdhocInit&#40;void&#41;;

void NetworkInit&#40;void&#41;
&#123;
	int ret=sceNetAdhocInit&#40;&#41;;
&#125;

int main&#40;void&#41;
&#123;
	NetworkInit&#40;&#41;;

	for&#40;;;&#41;
	&#123;
	&#125;

    //Exit program
    sceKernelExitGame&#40;&#41;;

    return 0;
&#125;
with this makefile

Code: Select all

PSPSDK = $&#40;shell psp-config --pspsdk-path&#41;
PSPLIBSDIR = $&#40;PSPSDK&#41;/..
TARGET = adhoc
EXTRA_TARGETS = EBOOT.PBP
OBJS = main.o
LIBS = -lpspnet_adhoc
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

include $&#40;PSPSDK&#41;/lib/build.mak
When the line:

Code: Select all

	int ret=sceNetAdhocInit&#40;&#41;;
is removed from the source the elf file does not give the 0x80020001 error!

Before you jump all over me here.. I know this code will do nothing sensible at all and would probably just crash. I just included the minimum code to replicate the unusable elf/eboot file.

I have the latest SDK, I just rebuild it as of today 07/17/06.

Does anybody have any idea why this would cause a 0x80020001 error?

Any help is greatly appreciated.

Thanks

- gr8dane
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Yes well it is a bug in pspsdk of sorts, the adhoc libs were not set to late binding so it would fail to load the module. Fixed it now.
gr8dane
Posts: 16
Joined: Thu Aug 18, 2005 11:10 am

Post by gr8dane »

Thank you TyRaNiD for the quick fix. Works like a charm!
Post Reply