PSP

Questions about programming languages and debugging
Post Reply
bubzuru
.net coder
.net coder
Posts: 700
Joined: 17 Apr 2007, 16:00
17
Contact:

PSP

Post by bubzuru »

today i made my first psp homebrew :lol:
you can get it here http://booboo.pcriot.com/brew/alog_test/alog_test.rar
allz it does is checks your analog to see if it is broke
it's coded in c using the Os library :) if you would like the source just ask :D

NOTE : to install just copy the folder to
X:\PSP\GAME\ and then run from the xmb :wink:

shamir
Computer Manager
Computer Manager
Posts: 853
Joined: 01 Mar 2007, 17:00
17
Location: NY
Contact:

Post by shamir »

good job bubzuru, can I have the source, bro. :wink:

bubzuru
.net coder
.net coder
Posts: 700
Joined: 17 Apr 2007, 16:00
17
Contact:

Post by bubzuru »

shamir wrote:good job bubzuru, can I have the source, bro. :wink:
sure :)
here is main.c

Code: Select all

#include <oslib/oslib.h>

PSP_MODULE_INFO("OSLib app", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int main() {
    
    oslInit(0);
    oslInitGfx(OSL_PF_8888, 1);
    oslInitConsole();
    oslReadKeys();
    oslStartDrawing();

    oslPrintf("Welcome to Bubzurus joystick tester\n\nPress any button to continue");
    oslSyncFrame();
    oslWaitKey();
    
    
    while (!osl_quit)
    {
        
        oslStartDrawing();
        oslReadKeys();
        oslCls();
   
         if(osl_keys->pressed.start){
         oslEndGfx();
         oslQuit();
         }
        
        
        oslPrintf_xy(10,10,"this Program will Check To See If Your joystick is Broke :D");
        oslPrintf_xy(10,30,"You Can Press Start At Any Time To Exit");
        
        oslPrintf_xy(70,100,"Your joystick's X : %d",osl_keys->analogX);
        oslPrintf_xy(70,110,"Your joystick's Y : %d",osl_keys->analogY);
        
        
        if (osl_keys->analogX == 0 && osl_keys->analogY == 0){
        oslPrintf_xy(70,140,":D Your joystick Is Fine !!");
        }else{
        oslPrintf_xy(70,140,"Sorry Your joystick Is Broke");
        }
        
        oslEndDrawing();
        oslSyncFrame();       
    }
    
    
    oslEndGfx();
    oslQuit();
    return 0;
    }
and here is the Makefile

Code: Select all

TARGET = Analog_Tester
OBJS = main.o  

INCDIR = 
CFLAGS = -G4 -Wall -O2 
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz \
  -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)


EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Analog_Tester
PSP_EBOOT_ICON = ICON0.png


PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
you can use cygwin to compile this
but you must have pspsdk & OSlib installed :wink:

also if you just want to test this on your psp and don't
have cygwin and the library's you can get the compiled
version here http://booboo.pcriot.com/brew/alog_test/alog_test.rar

Post Reply