It is currently Sat May 25, 2013 2:01 am

All times are UTC - 6 hours [ DST ]




Author Message
 Post subject: Re: Latest DaedalusX64 rev 594
PostPosted: Fri Nov 12, 2010 4:29 pm 
Founder
Founder
User avatar

Joined: Tue Nov 04, 2008 5:07 pm
Posts: 2906
psppwner300 wrote:
lupus wrote:
My timezone is +2. Daedalus incorrect show me time when i press "home" button. XMB time -7:29, time in Daedalus menu - 5:29. But savestate's time and date writes correctly.

Daedalus won't import any timezone as of right now and that's why the time is always incorrect.



Mmm I just gave a fast poke to the code, looks like the issue is that you guys used the time lib, why not retrieve the time from the psp?



_________________
Image

<Salvy>WTF Kirby is invisible on latest rev?!
<Dougamer>Hmmm
<Dougamer>I'll "aquire" kirby and check...
20 minutes later...
<Salvy>Kirby looks ok on default settings Dougamer?
<Dougamer>still... "aquiring" it Salvy...
Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 594
PostPosted: Fri Nov 12, 2010 4:45 pm 
Founder
Founder
User avatar

Joined: Tue Nov 04, 2008 5:07 pm
Posts: 2906
I don't feel really well to code.... damn pain killers make me dizzy.. anyways I fixed it so now it retrieves the time from the psp rather than relying on libc.
This version should be better and simpler.

EDIT : Also I noticed battery lifetime sets to 0 when charging, we should show "charging" or something else there.

void battery_infos()
{   
   pspTime psptime;
   sceRtcGetCurrentClockLocalTime(&psptime);
   
   s32 bat = scePowerGetBatteryLifePercent();
   s32 batteryLifeTime = scePowerGetBatteryLifeTime();
   
   if (scePowerIsBatteryExist())
   {
      const u32 black   =   0x00000000;   //  Black..
      const u32 white =   0xffffffff;   //  White..
      
      pspDebugScreenSetXY(0, 0);      // Allign to the left, becareful not touch the edges
      pspDebugScreenSetBackColor( black );
      pspDebugScreenSetTextColor( white );
      pspDebugScreenPrintf("Batt: %d%% %0.2fV %dC", bat, (float) scePowerGetBatteryVolt() / 1000.0f, scePowerGetBatteryTemp());
      pspDebugScreenPrintf(" | %2dh%2dm", batteryLifeTime / 60, batteryLifeTime - 60 * (batteryLifeTime / 60));
      pspDebugScreenPrintf(" | %d:%d.%d", psptime.hour, psptime.minutes, psptime.seconds);
   }
}



_________________
Image

<Salvy>WTF Kirby is invisible on latest rev?!
<Dougamer>Hmmm
<Dougamer>I'll "aquire" kirby and check...
20 minutes later...
<Salvy>Kirby looks ok on default settings Dougamer?
<Dougamer>still... "aquiring" it Salvy...
Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 594
PostPosted: Fri Nov 12, 2010 10:55 pm 
Founder
Founder
User avatar

Joined: Tue Nov 04, 2008 5:07 pm
Posts: 2906
Changed it to use intrafont to make it professional looking.

Image

EDIT : forgot to post the code, can you commit all this Corn? You can change size, position etc if you want.

#include "../Graphics/intraFont/intraFont.h"

// Load font... errg we should use the one in DrawText.cpp - otherwise font won't be unloaded etc
intraFont* ltn8  = intraFontLoad( "flash0:/font/ltn8.pgf", INTRAFONT_CACHE_ASCII);

void battery_infos()
{   
   //const u32 black   =   0x00000000;   
   const u32 white =   0xffffffff;   

   pspTime time;
   sceRtcGetCurrentClockLocalTime(&time);
   
   s32 bat = scePowerGetBatteryLifePercent();
   s32 batteryLifeTime = scePowerGetBatteryLifeTime();
   
   if (scePowerIsBatteryExist())
   {

      intraFontSetStyle(ltn8, 1.2f,white,0,0);   // change 1.2f to either increase or decrease text (1.0f) is default size
      intraFontPrintf(ltn8, 15, 190, "Time             %d:%02d%c%02d ", time.hour, time.minutes, (time.seconds&1?':':' '), time.seconds);
      intraFontPrintf(ltn8, 15, 210, "Battery        %d%% %0.2fV %dC", bat, (f32) scePowerGetBatteryVolt() / 1000.0f, scePowerGetBatteryTemp());
      intraFontPrintf(ltn8, 15, 230, "Remaining    2dh%2dm", batteryLifeTime / 60, batteryLifeTime - 60 * (batteryLifeTime / 60));
      
   }
}


PS : Make sure to call it from IPauseScreen::Render() not Update().



_________________
Image

<Salvy>WTF Kirby is invisible on latest rev?!
<Dougamer>Hmmm
<Dougamer>I'll "aquire" kirby and check...
20 minutes later...
<Salvy>Kirby looks ok on default settings Dougamer?
<Dougamer>still... "aquiring" it Salvy...
Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 594
PostPosted: Fri Nov 12, 2010 11:17 pm 
Slayer
Slayer
User avatar

Joined: Wed Jul 08, 2009 9:20 pm
Posts: 284
Hey thanks Salv-E I didn't know you were going to do all that! Wait I'll add the charging status then I'll leave the code for Corn to commit.

Edit: Never mind...C++ gives me a mackerel load of errors like 'variable x was not declared in this scope' even though I made sure that battery_infos was called from Render in PauseScreen.cpp (put it on the first line of code, maybe putting it in a different place might affect it?).


Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 594
PostPosted: Sat Nov 13, 2010 12:32 am 
Founder
Founder
User avatar

Joined: Tue Nov 04, 2008 5:07 pm
Posts: 2906
psppwner300 wrote:
Hey thanks Salv-E I didn't know you were going to do all that! Wait I'll add the charging status then I'll leave the code for Corn to commit.

Edit: Never mind...C++ gives me a mackerel load of errors like 'variable x was not declared in this scope' even though I made sure that battery_infos was called from Render in PauseScreen.cpp (put it on the first line of code, maybe putting it in a different place might affect it?).


Yep C++ is a huge pain for me as well, that's why I don't like working on our GUI at all, anyways Corn already did it, works really nicely.
Here's the code with my changes merged http://codepad.org/zk6xwRhI

If you post the full error log, I can tell you what's wrong :P



_________________
Image

<Salvy>WTF Kirby is invisible on latest rev?!
<Dougamer>Hmmm
<Dougamer>I'll "aquire" kirby and check...
20 minutes later...
<Salvy>Kirby looks ok on default settings Dougamer?
<Dougamer>still... "aquiring" it Salvy...
Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 594
PostPosted: Sat Nov 13, 2010 12:41 am 
Slayer
Slayer
User avatar

Joined: Wed Jul 08, 2009 9:20 pm
Posts: 284
Local modifications found
psp-g++ -I/SDK/include -I./SDK/include -I. -Ic:/pspsdk/psp/sdk/include -O2 -G0 -DNDEBUG -Wall -MD -ffast-math -fsingle-precision-constant  -fno-exceptions -fno-rtti -iquote./Source/SysPSP/Include -iquote./Source/Config/Release -iquote./Source -iquote./Source/SysPSP -D_PSP_FW_VERSION=500   -c -o Source/SysPSP/UI/PauseScreen.o Source/SysPSP/UI/PauseScreen.cpp
In file included from Source/SysPSP/UI/PauseScreen.cpp:40:
./Source/SysPSP/Utility/Batteryinfos.h: In function 'void battery_infos()':
./Source/SysPSP/Utility/Batteryinfos.h:42: error: 'pspTime' was not declared in this scope
./Source/SysPSP/Utility/Batteryinfos.h:42: error: expected `;' before 'time'
./Source/SysPSP/Utility/Batteryinfos.h:43: error: 'sceRtcGetCurrentClockLocalTime' was not declared in this scope
./Source/SysPSP/Utility/Batteryinfos.h:52: error: request for member 'hour' in 'time', which is of non-class type 'time_t ()(time_t*)'
./Source/SysPSP/Utility/Batteryinfos.h:52: error: request for member 'minutes' in 'time', which is of non-class type 'time_t ()(time_t*)'
./Source/SysPSP/Utility/Batteryinfos.h:52: error: request for member 'seconds' in 'time', which is of non-class type 'time_t ()(time_t*)'
./Source/SysPSP/Utility/Batteryinfos.h:52: error: request for member 'seconds' in 'time', which is of non-class type 'time_t ()(time_t*)'
"make": *** [Source/SysPSP/UI/PauseScreen.o] Error 1

I put battery_infos on line 269 in PauseScreen.cpp; right in the middle.


Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 594
PostPosted: Sat Nov 13, 2010 12:53 am 
Founder
Founder
User avatar

Joined: Tue Nov 04, 2008 5:07 pm
Posts: 2906
Opps you forgot a lib #include <psprtc.h> also make sure to remove time_t thing completely



_________________
Image

<Salvy>WTF Kirby is invisible on latest rev?!
<Dougamer>Hmmm
<Dougamer>I'll "aquire" kirby and check...
20 minutes later...
<Salvy>Kirby looks ok on default settings Dougamer?
<Dougamer>still... "aquiring" it Salvy...
Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 594
PostPosted: Sat Nov 13, 2010 1:24 am 
Slayer
Slayer
User avatar

Joined: Wed Jul 08, 2009 9:20 pm
Posts: 284
Haha I got it to compile. The charging status is implemented; here is my complete code:
#include <time.h>
#include <pspdebug.h>
#include <psppower.h>
#include <psputils.h>
#include <psputility_sysparam.h>
#include <psprtc.h>
#include "../Graphics/intraFont/intraFont.h"

#ifndef BATTERY_INFOS_H
#define BATTERY_INFOS_H

// Load font... errg we should use the one in DrawText.cpp - otherwise font won't be unloaded etc
intraFont* ltn8  = intraFontLoad( "flash0:/font/ltn8.pgf", INTRAFONT_CACHE_ASCII);

///////////////////////////////////////////////////////////////////////////////
//Battery info Salvy6735 / psppwner300 / Corn                                  //
///////////////////////////////////////////////////////////////////////////////

void battery_infos()
{   
   //const u32 black   =   0x00000000;   
   const u32 white =   0xffffffff;   

   pspTime time;
   sceRtcGetCurrentClockLocalTime(&time);
   
   s32 bat = scePowerGetBatteryLifePercent();
   s32 batteryLifeTime = scePowerGetBatteryLifeTime();
   
   if (scePowerIsBatteryExist())
   {

      intraFontSetStyle(ltn8, 0.8f,white,0,0);   // change 1.2f to either increase or decrease text (1.0f) is default size
      intraFontPrintf(ltn8, 15, 195, "Time:             %d:%02d%c%02d ", time.hour, time.minutes, (time.seconds&1?':':' '), time.seconds);
     intraFontPrintf(ltn8, 15, 215, "Battery:        %d%% %0.2fV %dC", bat, (f32) scePowerGetBatteryVolt() / 1000.0f, scePowerGetBatteryTemp());
   }
   
   if(scePowerIsBatteryCharging())
      {
      intraFontPrintf(ltn8, 15, 235, "Charging...");
      }
      else
      {
      intraFontPrintf(ltn8, 15, 235, "Remaining:    2dh%2dm", batteryLifeTime / 60, batteryLifeTime - 60 * (batteryLifeTime / 60));
      }
}
///////////////////////////////////////////////////////////////////////////////
//                                                          //
///////////////////////////////////////////////////////////////////////////////
#endif // BATTERY_INFOS_H

I tried to make the charge status a little more animated, so it'd be like: 'Charging', then the next second 'Charging.', the next 'Charging..' and so forth but obviously C++ wouldn't let me.


Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 595
PostPosted: Sat Nov 13, 2010 12:19 pm 
DX64 Site Staff
DX64 Site Staff
User avatar

Joined: Sat Dec 19, 2009 3:21 pm
Posts: 586
Updated to revision 595.



_________________
Add me on XboxLIVE: bdacanay
Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 596
PostPosted: Sat Nov 13, 2010 4:15 pm 
DX64 Site Staff
DX64 Site Staff
User avatar

Joined: Sat Dec 19, 2009 3:21 pm
Posts: 586
Updated to Revision 596.



_________________
Add me on XboxLIVE: bdacanay
Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 596
PostPosted: Sun Nov 14, 2010 2:15 am 
Knight
Knight
User avatar

Joined: Fri Nov 14, 2008 1:29 am
Posts: 110
Location: Crimea, Ukraine
Guys, what about confirmation of deleting rom?


Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 596
PostPosted: Sun Nov 14, 2010 2:23 am 
Global NintendoKing
Global NintendoKing

Joined: Mon Jun 22, 2009 5:38 pm
Posts: 1605
Location: California,USA
lupus wrote:
Guys, what about confirmation of deleting rom?

That's up to psppwner as he implemented it.



_________________
http://www.youtube.com/watch?feature=iv ... ion_224945
NL WEST DIVISION CHAMPIONS!
Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 596
PostPosted: Sun Nov 14, 2010 3:06 am 
Knight
Knight
User avatar

Joined: Fri Nov 14, 2008 1:29 am
Posts: 110
Location: Crimea, Ukraine
Yesterday i press "select" to test this function and goldeneye was deleted without any confirmation. Rev 595.


Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 596
PostPosted: Sun Nov 14, 2010 7:44 am 
Slayer
Slayer
User avatar

Joined: Wed Jul 08, 2009 9:20 pm
Posts: 284
lupus wrote:
Guys, what about confirmation of deleting rom?

Thank you for your request. However, making a confirmation to delete a ROM will add fairly a lot of unnecessary code. I will add it only if you really think it's useful.


Offline
 Profile  
 
 Post subject: Re: Latest DaedalusX64 rev 596
PostPosted: Sun Nov 14, 2010 12:44 pm 
Wanderer
Wanderer

Joined: Sat May 09, 2009 6:46 pm
Posts: 40
Is it just me or is the background flicker back on Paper Mario?


Offline
 Profile  
 
Display posts from previous:  Sort by  

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users


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 post attachments in this forum

Search for:
Jump to:  

cron