![]() |
|
|
|
#1
|
|||
|
|||
|
I decided to do a simple app as my first PSP program, a calender. So far it's not done but -- I do have most of it done. However I'm coming across a problem when i run it on my PSP. I have it set so when you press the right button on the psp, it goes to the next month and displays the image. Well at first it was scrolling through all the months and looping 3 times and stoped at december. I fixed that and lowered it so it only did 3 months till i got it fixed. It was then obvious i had done if(osl_keys->held.right). I then changed it too if(osl_keys->pressed.right). Now when i start up and just press right it stays on feb and does't move. Here's my code for the calender part -- I have tried changing the timer around and calling the method at the very end of the if statement so it's not in each if -- but none have worked.
Quote:
Quote:
Spoiler: Any help appreciated, Even if Brick bitches me out.
__________________
Fat PSP: 1.50 OFW --> 2.80 OFW --> 3.50 OFW --> 3.80 OFW --> 3.90 OFW --> Pandora --> 3.71 m33 --> 3.90 m33 --> 4.01 m33 --> 5.00 m33-3 Slim psp: 3.90 OFW --> Pandora --> Brick(Somehow?) --> DC v7 --> Still brick --> DC v7 format flash1 --> DC v5 --> 3.90 m33 --> 5.00m33-3 |
|
#2
|
|||
|
|||
|
You're a funny gguy...
BTW , if that "PSPHacker#%" is me , change it to "PSPF@cker#%" KTHX. Good luck , because i don't see anyone to actually bother. Spoiler: |
|
#3
|
|||
|
|||
|
Then why have this part of the forums?
__________________
Fat PSP: 1.50 OFW --> 2.80 OFW --> 3.50 OFW --> 3.80 OFW --> 3.90 OFW --> Pandora --> 3.71 m33 --> 3.90 m33 --> 4.01 m33 --> 5.00 m33-3 Slim psp: 3.90 OFW --> Pandora --> Brick(Somehow?) --> DC v7 --> Still brick --> DC v7 format flash1 --> DC v5 --> 3.90 m33 --> 5.00m33-3 |
|
#4
|
|||
|
|||
|
When you're asking for help, don't start the drama , its the 3rd time you do this.
Yes , you will get flamed if you start saying that you're going to create a MMORG in ... 6 years and then you seem to have no idea about advanced concepts. Yes , you will also get flamed by everyone if .... [insert kerWin's case] ... Anyway , i will help you this time , but when you're asking for help , don't trigger flames/and or drama. It seems that PSPF@cker is absolutely right , you need to learn the basics. You don't know anything about arrays and pointers/structures .................................... Code:
//You're using C i guess...
static TMonth MonthTable align(16) [MONTH_COUNT] =
{
TMonth("January",1,getImageFromCache("January.PNG")) ,
TMonth("February",2,getImageFromCache("February.PNG")) , ...lalalaaa
};
//Then , you do :
if(monthChanged)
{
++activeMonthInex;
if(activeMonthInex > MONTH_COUNT - 1)
activeMonthInex = 0;
activeMonthPointer = (MonthTable + activeMonthInex);
}
oslStartDrawing();
oslCls();
if(activeMonthPointer)
oslDrawImage(activeMonthPointer->imagePtr);
oslEndDrawing();
oslSyncFrame();
Feature-less version : Code:
//You're using C i guess...
static OSL_IMAGE* MonthTable align(16) [MONTH_COUNT] =
{
getImageFromCache("January.PNG") ,
getImageFromCache("February.PNG") , ...lalalaaa
};
//Then , you do :
if(monthChanged)
{
++activeMonthInex;
if(activeMonthInex > MONTH_COUNT - 1)
activeMonthInex = 0;
activeMonthPointer = (MonthTable + activeMonthInex);
}
oslStartDrawing();
oslCls();
if(activeMonthPointer)
oslDrawImage(activeMonthPointer);
oslEndDrawing();
oslSyncFrame();
Code:
preloadResources()
{
//safe-load resources
buffer align(16) [ 128 ];
for(int i = 0; i < MONTH_COUNT; i++)
{
strcpy(buffer,(MonthTable + i)->string);
strcat(buffer,".png");
(MonthTable + i)->imagePtr = loadImage(buffer);
}
//MOAAREEE
}
Last edited by Brick; 11-04-2009 at 10:12 PM. |
|
#5
|
|||
|
|||
|
Quote:
I do indeed know about pointers, I don't quite understand why I would use them in this case.. It seems very unnessessary for a simple concenpt that I'm doing. But thanks. I guess I'll change it up.
__________________
Fat PSP: 1.50 OFW --> 2.80 OFW --> 3.50 OFW --> 3.80 OFW --> 3.90 OFW --> Pandora --> 3.71 m33 --> 3.90 m33 --> 4.01 m33 --> 5.00 m33-3 Slim psp: 3.90 OFW --> Pandora --> Brick(Somehow?) --> DC v7 --> Still brick --> DC v7 format flash1 --> DC v5 --> 3.90 m33 --> 5.00m33-3 Last edited by gunman121; 11-05-2009 at 07:07 PM. |
|
#6
|
||||
|
||||
|
for people to ask questions minus the attitude?
i skimmed over the code, there is something wrong... i hate the way you place your brackets.
__________________
http://levoneprojects.net23.net/
![]() ++rep me if i helped you please. Ahh, shit. Stupidity is on the rise again. went legit Oct. 31, 09' piracy is wrong, please don't do it. |
|
#7
|
|||
|
|||
|
My comment was being sarcastic >_<.
What do you think pspjoke, do you see my problem?
__________________
Fat PSP: 1.50 OFW --> 2.80 OFW --> 3.50 OFW --> 3.80 OFW --> 3.90 OFW --> Pandora --> 3.71 m33 --> 3.90 m33 --> 4.01 m33 --> 5.00 m33-3 Slim psp: 3.90 OFW --> Pandora --> Brick(Somehow?) --> DC v7 --> Still brick --> DC v7 format flash1 --> DC v5 --> 3.90 m33 --> 5.00m33-3 |
|
#8
|
||||
|
||||
|
Quote:
EDIT: ok im seeing some stuff i don't like and some stuff im unsure about cause i don't know how you have it set up to call good initially. idk if this is your problem tho. Code:
int good(int timer)
{
timer = timer + 1;
oslReadKeys();
if(osl_keys->pressed.right)
{
if(timer == 0 )
{
timer = 1;
}
if(timer == 1 )
{
oslStartDrawing();
oslCls();
oslDrawImage(caljan);
oslEndDrawing();
oslSyncFrame();
good(timer);
}
if(timer == 2 )
{
oslStartDrawing();
oslCls();
oslDrawImage(calfeb);
oslEndDrawing();
oslSyncFrame();
good(timer);
}
if(timer == 3 )
{
oslStartDrawing();
oslCls();
oslDrawImage(calmar);
oslEndDrawing();
oslSyncFrame();
good(timer);
}
}
}
don't do this... im assuming you don't have good being called in a loop because you thought a recursive function would suffice, but idk. anyway remove all the calls to good from good and throw the one and only call to good in a loop. for example. Code:
int good(int& timer)
{
timer = timer + 1;
oslReadKeys();
if(osl_keys->pressed.right)
{
if(timer == 0 )
{
timer = 1;
}
if(timer == 1 )
{
oslStartDrawing();
oslCls();
oslDrawImage(caljan);
oslEndDrawing();
oslSyncFrame();
}
if(timer == 2 )
{
oslStartDrawing();
oslCls();
oslDrawImage(calfeb);
oslEndDrawing();
oslSyncFrame();
}
if(timer == 3 )
{
oslStartDrawing();
oslCls();
oslDrawImage(calmar);
oslEndDrawing();
oslSyncFrame();
}
}
}
int main()
{
int timer = 0;
while(true)
good(timer);
return 0;
}
NOTE: that the example code wont compile for obvious reasons. (a lot of un-declared vars)
__________________
http://levoneprojects.net23.net/
![]() ++rep me if i helped you please. Ahh, shit. Stupidity is on the rise again. went legit Oct. 31, 09' piracy is wrong, please don't do it. Last edited by pspjoke; 11-04-2009 at 07:29 PM. |
|
#9
|
|||
|
|||
|
Yeah I had tried moving that around before, but still no luck. Hmm.
__________________
Fat PSP: 1.50 OFW --> 2.80 OFW --> 3.50 OFW --> 3.80 OFW --> 3.90 OFW --> Pandora --> 3.71 m33 --> 3.90 m33 --> 4.01 m33 --> 5.00 m33-3 Slim psp: 3.90 OFW --> Pandora --> Brick(Somehow?) --> DC v7 --> Still brick --> DC v7 format flash1 --> DC v5 --> 3.90 m33 --> 5.00m33-3 |
|
#10
|
|||
|
|||
|
Quote:
Spoiler: Quote:
If you really don't know how the library works , seriously , its a serious issue. BTW,Its common sense , BUT , that preload function will load every single month picture into memory and you don't want that but the active month. AND,what kind of calendar application is this without dynamic content?.......... |
![]() |
|
|
|||
|
|||
|
|
| Thread Tools | |
| Display Modes | |
|
|