Seite 9 von 340 ErsteErste 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 59 109 ... LetzteLetzte
Zeige Ergebnis 241 bis 270 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; Maybe by the library for handling png files. I was testing it with a custom background that somebody made for ...

  
  1. #241
    Art
    Art ist offline
    Bush Programmer
    Points: 60.149, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    3.658
    Points
    60.149
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Maybe by the library for handling png files.
    I was testing it with a custom background that somebody made for my last program.
    http://tn3-2.deviantart.com/fs10/300...by_innercy.png
    that's about as complicated as a 480x272 png file can get.
    There isn't a hardware limitation that prevents the file from working because it can be
    used as an icon background.
    maybe it's the png.h library...


    Geändert von Art (05-12-2006 um 08:11 PM Uhr)

  2. #242
    QJ Gamer Green
    Points: 6.450, Level: 52
    Level completed: 50%, Points required for next Level: 100
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    Indiana
    Beiträge
    389
    Points
    6.450
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    I believe when I was testing the PNG limitations I was able to load a PNG into memory about 2x the size of the screen and then scroll it around. But any bigger than that would crash. Plus, if you use libpng and try to draw off the viewable area it will crash. So you have to use it to only draw the part of the image that is currently viewable on the 480x272 you have in front of you.

    Don't know if that helps you at all, but it may.

    To find out what pspgu.h does, just open it and read it =)

    unix command:

    Code:
    nano -w  /usr/local/pspdev/psp/sdk/include/pspgu.h
    will open it in an editor where it is on my system. But to the best of my knowledge, pspgu is a "graphic utility" library enabling you to do various graphics techniques on the PSP hardware.

    Happy Coding!
    [URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL]

  3. #243
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    yay... rotation is in there also, its just the whole GU library functionality is a little weird like how you have to intiate it, use all those special arguments, etc.

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  4. #244
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Ok guys,
    Im trying to compile my code, and Cygwin tells me this:

    Code:
    make: *** No rule to make target 'graphics.o', needed by 'Question.elf'. Stop.
    Heres my makefile:

    Code:
    TARGET = Question
    OBJS = main.o graphics.o framebuffer.o callback.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpsppower -lpng -lz -lm
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = Question
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    Any help is appreciated.


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  5. #245
    Developer
    Points: 7.058, Level: 55
    Level completed: 54%, Points required for next Level: 92
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    408
    Points
    7.058
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Put graphics.c in your project folder. Make sure graphics.h, framebuffer.c and framebuffer.h are in there while you're at it.

  6. #246
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Cheers! It works


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  7. #247
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Ok sorry for the double post, I have this code:

    Code:
    if(paddata.Buttons & PSP_CTRL_START) {
    break;
    }
    It compiles fine, but when I press start, it doesnt exit the program.


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  8. #248
    Developer
    Points: 7.058, Level: 55
    Level completed: 54%, Points required for next Level: 92
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    408
    Points
    7.058
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    That isn't enough information. The break will exit the current for or while loop but without seeing more code I can't tell you where this will put you.

  9. #249
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    //Question
    
    /*
                  Question game?
                  Created by kozine
    */
    
    #include <pspdebug.h>
    #include <pspkernel.h>
    #include <pspctrl.h>
    #include <pspdisplay.h>
    #include <stdio.h>
    
    #include "callback.c"
    #include "graphics.h"
    
    PSP_MODULE_INFO("PSP Question", 0, 1, 1);
    
    //Define pspDebugScreenPrintf to printf
    #define printf pspDebugScreenPrintf
    
    #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
    
    int main() {
        //Set controller variable
    	SceCtrlData paddata;
        pspDebugScreenInit();
        SetupCallbacks();
        initGraphics();
        Color red = RGB(255, 0, 0);
        Color blue = RGB(0, 0, 255);
        
        for(;;) {
    //Read control input
    sceCtrlReadBufferPositive(&paddata, 1);
       printTextScreen(10, 20, "Hey F34R! How old am I?", red);
        printTextScreen(10, 50, "Cross: 10", blue);
        printTextScreen(10, 60, "Circle: 20", blue);
        printTextScreen(10, 70, "Triangle: 13", blue);
        printTextScreen(10, 80, "Square: 16", blue);
        printTextScreen(10, 200, "Press the button responding to your answer", red);
        printTextScreen(10, 210, "and see if you are wrong or right!", red);
        flipScreen();
        
        if(paddata.Buttons & PSP_CTRL_CROSS) {
                           
                           printTextScreen(10, 125, "Wrong! The answer is 13! Press R to exit!", red);
                           }
                           
        if(paddata.Buttons & PSP_CTRL_CIRCLE) {
                           
                           printTextScreen(10, 125, "Wrong! The answer is 13! Press R to exit!", red);
                           }
                           
        if(paddata.Buttons & PSP_CTRL_TRIANGLE) {
                           
                           printTextScreen(10, 125, "Correct! Well done, you know my age! Press R to exit", red);
                           }
        
        if(paddata.Buttons & PSP_CTRL_SQUARE) {
                           
                           printTextScreen(10, 125, "Wrong! The answer is 13! Press R to exit!", red);
                           }
                           
        if(paddata.Buttons & PSP_CTRL_START) {
                           break;
                           }
    }
    sceKernelSleepThread();
    return 0;
    }


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  10. #250
    Developer
    Points: 7.058, Level: 55
    Level completed: 54%, Points required for next Level: 92
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    408
    Points
    7.058
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Try replacing sceKernelSleepThread() with sceKernelExitGame().

  11. #251
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    still doesnt work :S Its weird.


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  12. #252
    Developer
    Points: 7.058, Level: 55
    Level completed: 54%, Points required for next Level: 92
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    408
    Points
    7.058
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Do the other buttons work? I don't see any obvious problems that would prevent it from finishing, but you might try replacing the for(;;) with a while(1). It shouldn't make a difference as far as I know.

  13. #253
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Yea all the other buttons work fine.


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  14. #254
    Developer
    Points: 7.058, Level: 55
    Level completed: 54%, Points required for next Level: 92
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    408
    Points
    7.058
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    It works fine on my 1.5 when I used sceKernelExitGame(). What firmware are you trying this on?

  15. #255
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Im running 2.6 firmware.


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  16. #256
    TheMarioKarters
    Guest

    Standard

    Zitat Zitat von Samstag
    It works fine on my 1.5 when I used sceKernelExitGame(). What firmware are you trying this on?
    That's why it won't work on 2.6

  17. #257
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Also, just thought id add... if you plan on making a question game...its best to have either an array of questions that u can keep track of better and have it easier tell whether they guessed right or wrong (via a bool ex: if Q3guess != answer3 then WRONG! } else { CORRECT } )

    Ask around for how to exit out of a 2.6 type program... but why would the KernelSleepThread work while the KernelExitGame wouldnt... unless it didnt work and just returned to nothing...

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  18. #258
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Thanks for the info

    Its not a question game its just a mate told me to do it to proove I know at least some C. lol.


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  19. #259
    Developer
    Points: 7.058, Level: 55
    Level completed: 54%, Points required for next Level: 92
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    408
    Points
    7.058
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TheMarioKarters
    Zitat Zitat von Samstag
    It works fine on my 1.5 when I used sceKernelExitGame(). What firmware are you trying this on?
    That's why it won't work on 2.6
    Stick to Lua. Thats not a function that requires kernel access.

    What version of Eloader are you using? The same function worked fine in 2.0 from the Tiff exploit, but I haven't used that since version .08 or so and I haven't kept up with 2.0+ programming. It's possible that you'll need to exit differently under 2.6.

  20. #260
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Im using the newsest Eload.


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  21. #261
    Developer
    Points: 7.058, Level: 55
    Level completed: 54%, Points required for next Level: 92
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    408
    Points
    7.058
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Ok sorry I can't find any information about 2.6 requiring a different exit method. Yuo could try using sceKernelExitThread() instead of sceKernelExitGame(). Others you might experiment with:

    sceKernelExitDeleteThread ()
    _sceKernelExitThread() // note the preceding underscore

    Hopefully one of those will work. Or try removing that line entirely and see if that changes anything.

  22. #262
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    yes... try just 'breaking' the loop, then returning 0 of the main porgram... it should quit on its own...

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  23. #263
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Hey... I need a favor for someone to throw together for im busy... I need a basic I/O FileBrowser... I could make one with enough time... but this application im making takes a tad long... This app will make those LUA users who want to hide there LUA Scripts very easy... I am putting Danzeffs OSK in right now... I still have some bugs to work out, that is why im asking for a very very basic I/O Debug Text Filebrowser... Simple /\ = back, X = Execute (action) I will do the rest after that... So basically im asking for a function that will print out a Filebrowser via a function.. that way i wont have to copy and pate the whole thing into my code... just call teh function...

    Thx and as i said... i could do it, and itd be good for me info wise, but im working on getting all the bugs worked out of this first, and if i could get the Filebrowser (basic I/O debug printing) id be very happy and get this LUA coders dream out there...

    Please someone take the time to through this together fori have not the time... Atleast not enough to finish my app up quickly and this...

    Thx a ton and ill add u to the credits... And ill fill u in on the info about the app via PM... ill even let you see the source if you wish...

    Thx a ton u guyz (community)

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  24. #264
    QJ Gamer Green
    Points: 25.223, Level: 95
    Level completed: 88%, Points required for next Level: 127
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    4.289
    Points
    25.223
    Level
    95
    Downloads
    0
    Uploads
    0

    Standard

    Search these forums for 'stripped file browser' or if that doesn't work 'stripped filebrowser' it should be a thread in the development forum, with no replies, although I downloaded what that guy posted.
    QJ loads way 2 slow & the theme is ugly as hell, gone are the glory days

  25. #265
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    I know I serached but he took his download down =(


    Do you have it Soccer? If you do I'll be very happy =)

    P.S. Soccer, want to try it out after im done? So far so good... I have basic input for the filename via 'Enter the Filename Path' and if its in the smae directory then you enter the name... if not then you enter ms0:/ and junk =(

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  26. #266
    Points: 4.067, Level: 40
    Level completed: 59%, Points required for next Level: 83
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    6
    Points
    4.067
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    can some one tell me the best way to start programming in c/c++ language

  27. #267
    Developer
    Points: 12.360, Level: 72
    Level completed: 78%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Isle of Wight
    Beiträge
    491
    Points
    12.360
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    I suggest going to www.psp-programming.com and going to the tuts section. Its where I am learning it from and its a great help


    PM me for a sig like this!

    http://dspspforums.com/forums/index.php SIGN UP NOW!

  28. #268
    QJ Gamer Green
    Points: 6.450, Level: 52
    Level completed: 50%, Points required for next Level: 100
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    Indiana
    Beiträge
    389
    Points
    6.450
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    A good way to quit a game in any version is inside your controller function, call quit();.

    then write a quit(); function that does what you need.. it's easier to keep track of things, At least for me...
    [URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL]

  29. #269
    Points: 4.067, Level: 40
    Level completed: 59%, Points required for next Level: 83
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    6
    Points
    4.067
    Level
    40
    Downloads
    0
    Uploads
    0

    Thumbs up

    thanks the tutorials are great

  30. #270
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Is there a way to cut images in the "graphics.h library" (or whatever you should call it...). Cause that would make things easier when you animate stuff ( then you could have just 1 image that you could split instead of haveing 6 separate images).

    Thanks in advance!


 
Seite 9 von 340 ErsteErste 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 59 109 ... LetzteLetzte

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 .