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 

(plugin) sceRtcGetCurrentClockLocalTime problem

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



Joined: 07 Jan 2007
Posts: 26

PostPosted: Sat Aug 11, 2007 11:46 pm    Post subject: (plugin) sceRtcGetCurrentClockLocalTime problem Reply with quote

I have a code in my program...

Code:
pspTime cTime;
int errCode = sceRtcGetCurrentClockLocalTime(&cTime);


which works perfectly as an EBOOT.PBP. But when I've tried it as a plugin, it does not work. If I remove that code, the plugin works fine. Could it be that the rtc module is not yet loaded when the plugins run? What can I do to run it as soon as the PSP starts (vsh plugin)?

Update: It seems that other rtc.prx functions does not work too. If the said rtc function is removed, the plugin works perfect, but if added, succeeding plugin process is not working as if the plugin was terminated prematurely. I've tried to load and start rtc.prx module manually and still rtc functions does not work properly. :(
Back to top
View user's profile Send private message
kururin



Joined: 05 Jul 2006
Posts: 36

PostPosted: Sun Aug 12, 2007 9:55 am    Post subject: Reply with quote

Your problem is very simple.
You are using the rtc library, which is an user mode library, and in 3.XX kernel modules cannot use user functions.

The solution is to change this in the makefile:

from:
-lpsprtc

to:
-lpsprtc_driver
Back to top
View user's profile Send private message
Slash



Joined: 07 Jan 2007
Posts: 26

PostPosted: Sun Aug 12, 2007 12:59 pm    Post subject: Reply with quote

kururin wrote:
Your problem is very simple.
You are using the rtc library, which is an user mode library, and in 3.XX kernel modules cannot use user functions.

The solution is to change this in the makefile:

from:
-lpsprtc

to:
-lpsprtc_driver


Thanks a lot! I love you! Lol. :D

EDIT: One problem though, the timezone does not work. The date/time given is the time with the timezone of 0.
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Mon Aug 13, 2007 9:24 am    Post subject: Reply with quote

http://forums.ps2dev.org/viewtopic.php?t=3587&highlight=timezone

Shine shows you haow to get timezone from sysparams,
and adjust it yourself.
Back to top
View user's profile Send private message
Slash



Joined: 07 Jan 2007
Posts: 26

PostPosted: Tue Aug 14, 2007 11:32 am    Post subject: Reply with quote

Art wrote:
http://forums.ps2dev.org/viewtopic.php?t=3587&highlight=timezone

Shine shows you haow to get timezone from sysparams,
and adjust it yourself.


Thanks alot but I'm having a trouble compiling it. The program compiles fine but if I add the tzset(), it gives me an error...

Code:
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_sbrk.o): In function `_sbrk':../../../../../../newlib/libc/sys/psp/libcglue.c:524: undefined reference to `sceKernelMaxFreeMemSize'
collect2: ld returned 1 exit status
make: *** [timezone_sampler.elf] Error 1


Makefile:
Code:
TARGET = timezone_sampler
OBJS = main.o exports.o

BUILD_PRX = 1

USE_KERNEL_LIBS = 1

PRX_EXPORTS = exports.exp

CFLAGS = -O2 -G0 -Wall
ASFLAGS = $(CFLAGS)

LIBS = -lpspkernel -lpsprtc_driver -lpsplibc -lpsputility
LDFLAGS = -nostartfiles

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


Include files:
Code:
#include <pspkernel.h>
#include <psprtc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
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