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 

Help for a noob

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



Joined: 03 Jan 2006
Posts: 10

PostPosted: Tue Jan 03, 2006 9:33 am    Post subject: Help for a noob Reply with quote

Hi, I'm quite new to this and im having some problems with the screen not clearing the cursor im blitting to it. Can someone please guide me in the right direction?
Code:
int main() {
      SceCtrlData pad;
      
      pspDebugScreenInit();
      SetupCallbacks();
      initGraphics();
      
      int cursorx = 480/2;
      int cursory = 272/2;
      int cursorxstep = 3;
      int cursorystep = 3;
      
      char buffer[200];
      char buffer2[200];
        Image* cursor;
      Image* bg;
      sprintf(buffer, "cursor.png");
      sprintf(buffer2, "bg.png");
        cursor = loadImage(buffer);
      bg = loadImage(buffer2);
         while(1) {
            blitAlphaImageToScreen(0 ,0 ,480 , 272, bg, 0, 0);

            sceCtrlReadBufferPositive(&pad, 1);
            if (pad.Buttons & PSP_CTRL_UP){
               cursory = cursory - cursorystep;
            }
            if (pad.Buttons & PSP_CTRL_DOWN){
               cursory = cursory + cursorystep;
            }
            if (pad.Buttons & PSP_CTRL_LEFT){
               cursorx = cursorx - cursorxstep;
            }
            if (pad.Buttons & PSP_CTRL_RIGHT){
               cursorx = cursorx + cursorxstep;
            }
            if (pad.Buttons & PSP_CTRL_CROSS){
               sceKernelExitGame();
            }

            if (cursorx < 0) cursorx=0;
            if (cursorx > 480) cursorx=480;
            if (cursory < 0) cursory=0;
            if (cursory > 272) cursory=272;

            blitImageToImage(0 ,0 ,9 , 12, cursor, cursorx, cursory, bg);
            sceDisplayWaitVblankStart();
            flipScreen();
         }
      pspDebugScreenClear();
      sceKernelSleepThread();
      return 0;
}
Back to top
View user's profile Send private message
TheMan



Joined: 03 Jan 2006
Posts: 10

PostPosted: Wed Jan 04, 2006 5:42 am    Post subject: Reply with quote

NVM figured it out
Back to top
View user's profile Send private message
ronniebeck



Joined: 04 Jan 2006
Posts: 4

PostPosted: Wed Jan 04, 2006 2:50 pm    Post subject: Reply with quote

On the topic of helping a noob, can some one tell me what I am doing wrong here?

Code:
[rony@kehlstein fileio]$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/pspdev/psp/sdk/lib   main.o -lpspumd -lpspkernel -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o fileio.elf
main.o: In function `fileSize':
main.c:(.text+0x16c): undefined reference to `sceIoGetStat'
collect2: ld returned 1 exit status
make: *** [fileio.elf] Error 1
[rony@kehlstein fileio]$
Back to top
View user's profile Send private message MSN Messenger
JoshDB



Joined: 05 Oct 2005
Posts: 87

PostPosted: Thu Jan 05, 2006 2:16 am    Post subject: Reply with quote

Try looking at your makefile for missing libraries
Back to top
View user's profile Send private message Send e-mail AIM Address
MikeDX



Joined: 19 Oct 2005
Posts: 30

PostPosted: Thu Jan 05, 2006 4:07 am    Post subject: Reply with quote

A more sensible option would just be to replace sceIoGetStat with sceIoGetstat

check the makefiles indeed... tsk.
Back to top
View user's profile Send private message
JoshDB



Joined: 05 Oct 2005
Posts: 87

PostPosted: Thu Jan 05, 2006 9:48 am    Post subject: Reply with quote

Hey, I'm a n00b here too... My problem is usually in the Makefile, so I just try to help ( :
Back to top
View user's profile Send private message Send e-mail AIM Address
TheMan



Joined: 03 Jan 2006
Posts: 10

PostPosted: Fri Jan 06, 2006 1:54 am    Post subject: Reply with quote

Another question that somebody might be able to help me with; I remember hearing from someone that you can warp images or do things to images, for example like fading or shrinking/expanding it.
Does anybody know how I would be able to fade an image, with just code?
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