sceRtcGetTick

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

Moderators: cheriff, TyRaNiD

Post Reply
AllSystemGo
Posts: 26
Joined: Sat Jun 02, 2007 1:15 am

sceRtcGetTick

Post by AllSystemGo »

Can anyone help me out on how to make the sceRtcGetTick return something other then 0

Here is my code

Code: Select all

void AlarmManager::Save()
{
	ofstream writefile;
	list<Alarm*> alarms;
	u64 *CurTick = NULL;
	pspTime CurTime;
	
	list<Alarm*>&#58;&#58;iterator iter;
	writefile.open&#40;"data/file/Alarms.dat"&#41;;
	
	for &#40;iter = Alarms.begin&#40;&#41;; iter != Alarms.end&#40;&#41;; iter++&#41;
	&#123;
		CurTime = &#40;*iter&#41;->GetTime&#40;&#41;;
		sceRtcGetTick&#40;&CurTime, CurTick&#41;;

		writefile << &#40;*iter&#41;->GetRepeat&#40;&#41; << "|" << &#40;*iter&#41;->GetSound&#40;&#41;.size&#40;&#41; << "|" << &#40;*iter&#41;->GetSound&#40;&#41;
				  << "|" << &#40;*iter&#41;->GetAllowSnooze&#40;&#41; << "|" << &#40;*iter&#41;->GetLabel&#40;&#41;.size&#40;&#41; << "|" << &#40;*iter&#41;->GetLabel&#40;&#41;
				  << "|" << CurTick << "|" << &#40;*iter&#41;->GetTime&#40;&#41;.day << endl;
		alarms.push_back&#40;*iter&#41;;
	&#125;
	writefile.close&#40;&#41;;
&#125;
So basically all I get in my file is 0 and just for test I did sned GetTime().day and I get the current day.

Cheers!!!
Nevermind, found it

Code: Select all

void AlarmManager&#58;&#58;Save&#40;&#41;
&#123;
	ofstream writefile;
	list<Alarm*> alarms;
	&#91;b&#93;u64 CurTick;&#91;/b&#93;
	pspTime CurTime;
	
	list<Alarm*>&#58;&#58;iterator iter;
	writefile.open&#40;"data/file/Alarms.dat"&#41;;
	
	for &#40;iter = Alarms.begin&#40;&#41;; iter != Alarms.end&#40;&#41;; iter++&#41;
	&#123;
		CurTime = &#40;*iter&#41;->GetTime&#40;&#41;;
		sceRtcGetTick&#40;&CurTime, &#91;b&#93;&CurTick&#91;/b&#93;&#41;;

		writefile << &#40;*iter&#41;->GetRepeat&#40;&#41; << "|" << &#40;*iter&#41;->GetSound&#40;&#41;.size&#40;&#41; << "|" << &#40;*iter&#41;->GetSound&#40;&#41;
				  << "|" << &#40;*iter&#41;->GetAllowSnooze&#40;&#41; << "|" << &#40;*iter&#41;->GetLabel&#40;&#41;.size&#40;&#41; << "|" << &#40;*iter&#41;->GetLabel&#40;&#41;
				  << "|" << CurTick << "|" << &#40;*iter&#41;->GetTime&#40;&#41;.day << endl;
		alarms.push_back&#40;*iter&#41;;
	&#125;
	writefile.close&#40;&#41;;
&#125;
Thanks
Post Reply