Seite 298 von 340 ErsteErste ... 198 248 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 ... LetzteLetzte
Zeige Ergebnis 8.911 bis 8.940 von 10174

C/C++ Programming Help Thread

This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Depends if you have enabled double buffering or not. Code: void oslInitGfx(int pixelFormat, int bDoubleBuffer); 0 for single or 1 ...

  
  1. #8911
    QJ Gamer Bronze
    Points: 8.045, Level: 60
    Level completed: 48%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Ort
    Australia
    Beiträge
    659
    Points
    8.045
    Level
    60
    Downloads
    0
    Uploads
    0

    Standard

    Depends if you have enabled double buffering or not.
    Code:
    void oslInitGfx(int pixelFormat, int bDoubleBuffer);
    0 for single or 1 four double buffering for bDoubleBuffer



  2. #8912
    QJ Gamer Blue
    Points: 5.672, Level: 48
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 32,0%

    Registriert seit
    Dec 2007
    Ort
    Netherlands
    Beiträge
    148
    Points
    5.672
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Hi,

    I want to print an image onto my screen this is my code:
    Code:
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include "callbacks.h"
    #include "graphics.h"
    
    PSP_MODULE_INFO("ufosample", 0, 1, 1);
    //PSP_HEAP_SIZE_MAX();
    
    #define printf pspDebugScreenPrintf 
    #define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
    
    int ufoX = 0;
    int ufoY = 0;
    
    int main() {
        pspDebugScreenInit();
        SetupCallbacks();
        initGraphics();
        
        Image *ufo;
        ufo = loadImage("ufo.png");
        
        if(!ufo) {
                 printf("You'r version of the sample is incomplete!");
                 sceKernelDelayThread(100000);
                 sceKernelExitGame();
        } else {
    
        sceDisplayWaitVblankStart();
        
        blitAlphaImageToScreen(0 ,0 ,583 , 83, ufo, ufoX, ufoY);
        flipScreen();         
        
        }
        
        sceKernelSleepThread();
        return 0;
    }
    Code:
    TARGET = sample
    OBJS = main.o graphics.o framebuffer.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpng -lz -lm
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = sample
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    But everytime i try it on my PSP it says thhe sample is incomplete.
    But im sure my ufo.png is in the same directory as my eboot.pbp?

    Can someone please help me?
    :Punk:

  3. #8913
    QJ Gamer Bronze
    Points: 5.304, Level: 46
    Level completed: 77%, Points required for next Level: 46
    Overall activity: 0%

    Registriert seit
    May 2007
    Ort
    Ireland
    Beiträge
    56
    Points
    5.304
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Try uncommenting PSP_HEAP_SIZE_MAX();

  4. #8914
    QJ Gamer Blue
    Points: 5.672, Level: 48
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 32,0%

    Registriert seit
    Dec 2007
    Ort
    Netherlands
    Beiträge
    148
    Points
    5.672
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Nope, don't work either.
    [SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
    [i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]

  5. #8915
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von basfreak Beitrag anzeigen
    Hi,

    I want to print an image onto my screen this is my code:
    Code:
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include "callbacks.h"
    #include "graphics.h"
    
    PSP_MODULE_INFO("ufosample", 0, 1, 1);
    //PSP_HEAP_SIZE_MAX();
    
    #define printf pspDebugScreenPrintf 
    #define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
    
    int ufoX = 0;
    int ufoY = 0;
    
    int main() {
        pspDebugScreenInit();
        SetupCallbacks();
        initGraphics();
        
        Image *ufo;
        ufo = loadImage("ufo.png");
        
        if(!ufo) {
                 printf("You'r version of the sample is incomplete!");
                 sceKernelDelayThread(100000);
                 sceKernelExitGame();
        } else {
    
        sceDisplayWaitVblankStart();
        
        blitAlphaImageToScreen(0 ,0 ,583 , 83, ufo, ufoX, ufoY);
        flipScreen();         
        
        }
        
        sceKernelSleepThread();
        return 0;
    }
    Code:
    TARGET = sample
    OBJS = main.o graphics.o framebuffer.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpng -lz -lm
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = sample
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    But everytime i try it on my PSP it says thhe sample is incomplete.
    But im sure my ufo.png is in the same directory as my eboot.pbp?

    Can someone please help me?
    :Punk:
    The graphics library you're using doesn't support interlaced .PNG files. Make sure that it's not interlaced.

  6. #8916
    QJ Gamer Blue
    Points: 5.672, Level: 48
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 32,0%

    Registriert seit
    Dec 2007
    Ort
    Netherlands
    Beiträge
    148
    Points
    5.672
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Nope isn't interlaced :S
    [SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
    [i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]

  7. #8917
    Points: 2.307, Level: 29
    Level completed: 5%, Points required for next Level: 143
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Aug 2008
    Beiträge
    3
    Points
    2.307
    Level
    29
    Downloads
    0
    Uploads
    0

    Standard

    over my head lol

  8. #8918
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    blitAlphaImageToScreen(0 ,0 ,583 , 83, ufo, ufoX, ufoY);
    Is the 583 argument an error?

    The maximum size of a texture you can load is 512x512 using graphics.c.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  9. #8919
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    IWN! irc, NAO! have question
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  10. #8920
    QJ Gamer Blue
    Points: 5.672, Level: 48
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 32,0%

    Registriert seit
    Dec 2007
    Ort
    Netherlands
    Beiträge
    148
    Points
    5.672
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Of course! forgot to scale my ufo down, but still doesn't work.
    Arggg... going crazy!
    [SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
    [i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]

  11. #8921
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever Beitrag anzeigen
    IWN! irc, NAO! have question
    I'm at work mate, no IRC.

    PM me if you need.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  12. #8922
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    ARG, alright guess i'll have to ask via forum
    anywho, trying to get adhoc into one of my games, and i'm having a problem with sceNetAdhocctlAddHandler
    it works fine under 4.01, and it had worked under 3.40, however one of my psp's is running 3.90 and it keeps returning error's
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  13. #8923
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    What's the error it returns?

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  14. #8924
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    it's returning < 0
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  15. #8925
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Obviously ;)

    The exact error number would help. Use 0x%08X as the format string for printf() or whatever.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  16. #8926
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    0x8002013A
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  17. #8927
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Helped on IRC after all ;)

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  18. #8928
    QJ Gamer Green
    Points: 4.092, Level: 40
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    508
    Points
    4.092
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Alright, I've been doing some research, and I can't seem to find out how to remap the buttons (ex. Analog up = triangle). If someone could tell me of a method of how to do it, which I'm pretty sure uses button masking, what are the values for the buttons, and would it be the same values as while looking at a memory editor, every game has a controller address. (ex. Square is 0x8000).
    I gone and made that one power spoofer and that gay cheat device.

  19. #8929
    QJ Gamer Bronze
    Points: 5.583, Level: 48
    Level completed: 17%, Points required for next Level: 167
    Overall activity: 0%

    Registriert seit
    May 2007
    Beiträge
    127
    Points
    5.583
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von NoEffex Beitrag anzeigen
    Alright, I've been doing some research, and I can't seem to find out how to remap the buttons (ex. Analog up = triangle). If someone could tell me of a method of how to do it, which I'm pretty sure uses button masking, what are the values for the buttons, and would it be the same values as while looking at a memory editor, every game has a controller address. (ex. Square is 0x8000).
    uh.. can you not just do something like

    Code:
    uint32_t MyButtonAbstractUnderwear(uint32_t button)
    {
        uint32_t nb = 0;
    
        if((button & BTN_TRIANGLE) != 0) nb |= BTN_ANALOGUE_UP;
        ....
    
        return nb;
    }
    type deal..

    etc
    -- Code Monkey : Sarien, Fishguts, Cracks and Crevices --

    "Did IQ's just drop sharply while I was away?" (Ripley)

  20. #8930
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    You need to hook the button reading functions (sceCtrl*) and replace them with your own.

    I'm not aware of your skill level, but it's not really a task for someone with little programming knowledge or who's not used to hooking functions.

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  21. #8931
    QJ Gamer Silver
    Points: 8.475, Level: 62
    Level completed: 9%, Points required for next Level: 275
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Perth, Scotland
    Beiträge
    1.094
    Points
    8.475
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Insert_Witty_Name Beitrag anzeigen
    You need to hook the button reading functions (sceCtrl*) and replace them with your own.

    I'm not aware of your skill level, but it's not really a task for someone with little programming knowledge or who's not used to hooking functions.
    Also the fact that if this is used in the VSH it could cause problems with the vshctrl hook (Assuming its sceCtrlReadBufferPositive ).

  22. #8932
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    crt0_prx.c:(.text+0x1f8): undefined reference to `pspDebugScreenPprintf'/usr/local/pspdev/psp/sdk/lib/libpspdebug.a(pspDebugScreenPrintf.o): In function
    `pspDebugScreenPrintf':/home/Owner/source/psptoolchain/build/pspsdk/src/debug/scr_printf.c:403: undefin
    ed reference to `vsnprintf'
    I get that when I try to use pspDebugScreenPrintf()

    Code:
    pspDebugScreenPrintf("%-14s: %d%% (%02dh%02dm)     \n", "Charge", scePowerGetBatteryLifePercent(), batteryLifeTime/60, batteryLifeTime-(batteryLifeTime/60*60));
    That's how I used it.

  23. #8933
    QJ Gamer Green
    Points: 4.092, Level: 40
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    508
    Points
    4.092
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    I have the same exact problem. The only difference is that I'm trying to load up the psp's keyboard, yet it will not compile because of the printf errors. Same as QJ's,

  24. #8934
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Anti-QuickJay Beitrag anzeigen
    Code:
    crt0_prx.c:(.text+0x1f8): undefined reference to `pspDebugScreenPprintf'/usr/local/pspdev/psp/sdk/lib/libpspdebug.a(pspDebugScreenPrintf.o): In function
    `pspDebugScreenPrintf':/home/Owner/source/psptoolchain/build/pspsdk/src/debug/scr_printf.c:403: undefin
    ed reference to `vsnprintf'
    I get that when I try to use pspDebugScreenPrintf()

    Code:
    pspDebugScreenPrintf("%-14s: %d%% (%02dh%02dm)     \n", "Charge", scePowerGetBatteryLifePercent(), batteryLifeTime/60, batteryLifeTime-(batteryLifeTime/60*60));
    That's how I used it.
    I guess you're linking against KERNEL_LIBC? In that case you can't use pspDebugScreenPrintf for the sole reason that it depends on vsnprintf from varargs, which isn't in kernel libc. You'd have to create a macro to wrap the variable arguments into a sprintf like that:
    Code:
       #define pspDebugScreenPrintf(...) { char buf[256]; sprintf(buf,__VA_ARGS__); pspDebugScreenPuts( buf ); }
    If you have lines that may exceed the 256 chars increase the buf.
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  25. #8935
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Yea I was thanx alot for the help Rapheal.

  26. #8936
    QJ Gamer Green
    Points: 4.092, Level: 40
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    508
    Points
    4.092
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    So, in that conclusion, it would not be possible(or require a lot of bs) to load the sce keyboard...Ex.
    Code:
    pspDebugKbInit(buffer);
    because that whole thing is a printf whore.

  27. #8937
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von NoEffex Beitrag anzeigen
    So, in that conclusion, it would not be possible(or require a lot of bs) to load the sce keyboard...Ex.
    Code:
    pspDebugKbInit(buffer);
    because that whole thing is a printf whore.
    You could recompile pspdebug.a with the macro I posted. With that it should work. Just don't define the macro inside scr_printf.c or pspdebug.h.
    -=Double Post Merge =-
    I just noticed, there's already a special kernel mode printf function in pspdebug:
    pspDebugScreenKprintf

    So Anti-Quickjay you can just use that function instead and NoEffex, you still have to recompile pspdebug, but can just put this define at the top of pspdebugkb.c:
    Code:
    #define pspDebugScreenPrintf pspDebugScreenKprintf
    Geändert von Raphael (08-20-2008 um 12:24 AM Uhr) Grund: Automerged Doublepost
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  28. #8938
    QJ Gamer Green
    Points: 4.092, Level: 40
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Beiträge
    508
    Points
    4.092
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Raphael Beitrag anzeigen
    You could recompile pspdebug.a with the macro I posted. With that it should work. Just don't define the macro inside scr_printf.c or pspdebug.h.
    -=Double Post Merge =-
    I just noticed, there's already a special kernel mode printf function in pspdebug:
    pspDebugScreenKprintf

    So Anti-Quickjay you can just use that function instead and NoEffex, you still have to recompile pspdebug, but can just put this define at the top of pspdebugkb.c:
    Code:
    #define pspDebugScreenPrintf pspDebugScreenKprintf
    Thanks, I just went ahead and grabbed the thing out of the pspsdk source, since my thing is ever-so-open-source, I don't think many people will be able to compile if I do otherwise. Nevertheless, thank you very much.
    EDIT: It requires snprintf, which is not available with the kernel crap. Is there a macro available to emulate what it does?
    Geändert von NoEffex (08-20-2008 um 01:39 AM Uhr)

  29. #8939
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von NoEffex Beitrag anzeigen
    Thanks, I just went ahead and grabbed the thing out of the pspsdk source, since my thing is ever-so-open-source, I don't think many people will be able to compile if I do otherwise. Nevertheless, thank you very much.
    EDIT: It requires snprintf, which is not available with the kernel crap. Is there a macro available to emulate what it does?
    pspDebugScreenKprintf requires snprintf? You sure you have the right code? :) pspDebugScreenKprintf only uses prnt, which is a kernel function, so it *really should* work.
    Else you're open to use my previous macro that uses sprintf (not snprintf).
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  30. #8940
    QJ Gamer Blue
    Points: 5.672, Level: 48
    Level completed: 61%, Points required for next Level: 78
    Overall activity: 32,0%

    Registriert seit
    Dec 2007
    Ort
    Netherlands
    Beiträge
    148
    Points
    5.672
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von basfreak Beitrag anzeigen
    Hi,

    I want to print an image onto my screen this is my code:
    Code:
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include "callbacks.h"
    #include "graphics.h"
    
    PSP_MODULE_INFO("ufosample", 0, 1, 1);
    //PSP_HEAP_SIZE_MAX();
    
    #define printf pspDebugScreenPrintf 
    #define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
    
    int ufoX = 0;
    int ufoY = 0;
    
    int main() {
        pspDebugScreenInit();
        SetupCallbacks();
        initGraphics();
        
        Image *ufo;
        ufo = loadImage("ufo.png");
        
        if(!ufo) {
                 printf("You'r version of the sample is incomplete!");
                 sceKernelDelayThread(100000);
                 sceKernelExitGame();
        } else {
    
        sceDisplayWaitVblankStart();
        
        blitAlphaImageToScreen(0 ,0 ,583 , 83, ufo, ufoX, ufoY);
        flipScreen();         
        
        }
        
        sceKernelSleepThread();
        return 0;
    }
    Code:
    TARGET = sample
    OBJS = main.o graphics.o framebuffer.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpng -lz -lm
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = sample
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    But everytime i try it on my PSP it says thhe sample is incomplete.
    But im sure my ufo.png is in the same directory as my eboot.pbp?

    Can someone please help me?
    :Punk:
    Anyone??
    please?
    [SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
    [i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:15 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .