forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pspSdkGetK1 "bug"

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Wed May 31, 2006 10:16 pm    Post subject: pspSdkGetK1 "bug" Reply with quote

I don't know if it's really a bug or if it's done on purpose, anyways i comment it here.

I can use the pspSdkSetK1 without problems, but with pspSdkGetK1 i always get a undefined reference in the linker.
Looking at the sources of k1set.S, the problem is easy to find:

Code:

   set noreorder
   .set noat

   .global pspSdkSetK1
   .ent    pspSdkSetK1

pspSdkSetK1:
   move $v0, $k1
   jr    $ra
   move $k1, $a0

   .end pspSdkSetK1

   .global pspSdkGetK1
   .ent    pspSdkGetK1

   jr   $ra
   move $v0, $k1

   .end    pspSdkGetK1


The label "pspSdkGetK1:" is missing.
It should be:

Code:

   set noreorder
   .set noat

   .global pspSdkSetK1
   .ent    pspSdkSetK1

pspSdkSetK1:
   move $v0, $k1
   jr    $ra
   move $k1, $a0

   .end pspSdkSetK1

   .global pspSdkGetK1
   .ent    pspSdkGetK1
pspSdkGetK1:   ### Label missing ###

   jr   $ra
   move $v0, $k1

   .end    pspSdkGetK1
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Thu Jun 01, 2006 2:20 am    Post subject: Reply with quote

Aye a bug me thinks, I probably threw that into pspsdk and never bothered to actually check it worked cause psplink has its own version. Of course in general it doesn't get used alot and when it does you probably more likely to abitrarily set it to 0 and get the return from SetK1 anyway. Ill fix it ;)
Back to top
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Thu Jun 01, 2006 6:56 am    Post subject: Reply with quote

TyRaNiD wrote:
Aye a bug me thinks, I probably threw that into pspsdk and never bothered to actually check it worked cause psplink has its own version. Of course in general it doesn't get used alot and when it does you probably more likely to abitrarily set it to 0 and get the return from SetK1 anyway. Ill fix it ;)


Well, i'm actually doing the contrary, setting the k1 to 1 :D
I know it's something unusual, but it's the only way i've found to use the net functions from a kernel prx.
Anyways, the getK1 is not essential, i just tried to use it for doing some debug and i found that bug.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Thu Jun 01, 2006 7:37 am    Post subject: Reply with quote

Really setting it to 1 makes a difference ? For one thing user threads I think are indicated by 0x10 and as the net libs are direct link and not through syscalls it shouldn't make a difference anyway. Still who knows ;)
Back to top
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Thu Jun 01, 2006 8:31 am    Post subject: Reply with quote

Ok i get confused. i am experiencing weirds thing. Some things that didn't work before (crash)are working now.
I think i need some holidays :)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group