Seite 51 von 340 ErsteErste ... 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 101 151 ... LetzteLetzte
Zeige Ergebnis 1.501 bis 1.530 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; So can anyone explain why I can't rapidly shoot bullets?...

  
  1. #1501
    QJ Gamer Blue
    Points: 4.580, Level: 43
    Level completed: 15%, Points required for next Level: 170
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    145
    Points
    4.580
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    So can anyone explain why I can't rapidly shoot bullets?



  2. #1502
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    still not working
    still crashing , the hello world i wanne load works
    but the eboot loader doesnt:
    Code:
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <string.h>
    #include <psploadexec.h>
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #define printf pspDebugScreenPrintf
    PSP_MODULE_INFO("Hello World", 0, 1, 1);
    PSP_MAIN_THREAD_ATTR (0);//zeg de psp dat het programma kernel acces nodig heeft
    
    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
    
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
    
              sceKernelSleepThreadCB();
    
              return 0;
    }
    
    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
              int thid = 0;
    
              thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
              if(thid >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    }
    
    int load_Eboot_calculator(void)
    {
    struct SceKernelLoadExecParam calculator;
    char *path_calculator= "ms0:/PSP/GAME/HELLOWORLD/EBOOT.PBP"; /*geheugenplaats voor de naam van de eboot die je wilt laden*/
    const u32 Length_of_Eboot = strlen(path_calculator )+1;
    pspDebugInstallKprintfHandler (NULL);
    pspDebugInstallErrorHandler (NULL);
    calculator.args = Length_of_Eboot;
    calculator.argp = path_calculator;
    calculator.key = NULL;
    calculator.size = sizeof(calculator)+Length_of_Eboot;
    sceKernelLoadExec(path_calculator,&calculator);
    }
    
    int main()
    {
    pspDebugScreenInit();
    SetupCallbacks();    
    printf("press cross to load calculator");
    SceCtrlData pad;
    while(1) {
      sceCtrlReadBufferPositive(&pad, 1);
    if(pad.Buttons & PSP_CTRL_CROSS){
    load_Eboot_calculator();
    }
    }
    sceKernelSleepThread();
    return 0;
    
    }

  3. #1503
    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

    Because you haven't setup a system for mutiple bullets.

    See the tutorial at evilmana.com that I mentioned, the principals apply across any language.

    http://www.evilmana.com/tutorials/lu...et_bullets.php

    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

  4. #1504
    QJ Gamer Green
    Points: 6.697, Level: 53
    Level completed: 74%, Points required for next Level: 53
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    In The PSP
    Beiträge
    804
    Points
    6.697
    Level
    53
    Downloads
    0
    Uploads
    0

    Standard

    can anyone help me with my problem? thanks insomniac great tutorials
    Linux + Windows = Lindows FTW

  5. #1505
    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

    Sethis - Your problem is t hat you are making hte thread fall 'asleep' (aka stopping all processes besides HOME button). here ya go.

    Code:
    //counter - My second PSP Program
    /*
    	This program was created by ME on October 21 2006
    	It is a simple counter Application
    	thanks to http://www.psp-programming.com
    */ 
    
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspdisplay.h>
    #include <pspctrl.h>
    
    PSP_MODULE_INFO("Hello World", 0,1,1);
    
    #define poop pspDebugScreenPrintf 
    
    /* Exit callback */
    
    int exit_callback(int arg1, int arg2, void *common) {
    	sceKernelExitGame();
    	return 0; 
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
    	int cbid;
    
    	cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
    
    	sceKernelSleepThreadCB();
    
    	return 0;
    }
    
    /*Sets up the callback thread and returns its thread id */ 
    int SetupCallbacks(void) {
    	int thid = 0;
    
    	thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0,0,0);
    
    	if(thid >=0) {
    		sceKernelStartThread(thid, 0, 0);
    
    	}
    
    	return thid; 
    }
    
    
    int main()
    {
    
    //to end a line a semi colon is needed, not sure what these two blocks of code do...
    
    pspDebugScreenInit();
    SetupCallbacks();
    
    
    //this prinnts Hello World to the screen
    
    int counter = 0;
    int i = 0;
    SceCtrlData pad; 
    
    poop ("Press [X] to start the Timer");
    
    //this is to make the printf appear, becuase it will just erase without it
    
    // "while" represents a loop
    // the if = if statement in english. 
    while(1) {
             sceCtrlReadBufferPositive(&pad, 1);
    //break = break the loop
             if(pad.Buttons & PSP_CTRL_CROSS) {
             break;
              }
    }
    
    while(1) {
              sceCtrlReadBufferPositive(&pad, 1);
              if(pad.Buttons & PSP_CTRL_CIRCLE) {
                        break;
              }
    
              pspDebugScreenClear();
    
              poop("Press [O] To Stop the Timer\n");
              poop("Counter: %i", counter);
            
              counter++
    
              for(i=0; i<5; i++) {
                  sceDisplayWaitVblankStart();
              }
    }
    
    pspDebugScreenClear();
    
    poop("Counter Finished.");
    poop("Final Count: %i", counter);
    poop("\n\n\tPress L Trigger to exit.");
    
    while(1) {
              sceCtrlReadBufferPositive(&pad, 1);
              if(pad.Buttons & PSP_CTRL_LTRIGGER) {
                        break;
              }
    }
    
    sceKernelExitGame();
    return 0; 
    }

    ...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


  6. #1506
    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

    The line:

    Code:
    counter++
    Also needs a semi-colon at the end of it:

    Code:
    counter++;

    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

  7. #1507
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    any help with my issue?
    What did we think the world would look like in 2015?

    Zitat Zitat von Abe
    Either way, if you don't know, don't guess. Stick to answering questions about stuff you're qualified to answer, like Pokemon questions or something along those lines.
    http://forums.qj.net/501501-post26.html

  8. #1508
    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

    OK, I'm trying to compile a simple EBOOT runner, that will run a Hello World EBOOT. It compiles, but when I run it and press X, it does nothing. Anyone know what's wrong?

    Spoiler for Code:
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <string.h>
    #include <psploadexec.h>
    #include <pspdisplay.h>
    #include <pspctrl.h>

    #define printf pspDebugScreenPrintf

    PSP_MODULE_INFO("Eboot Runner", 0x1000, 1, 1);

    int exit_callback(int arg1, int arg2, void *common) {
    sceKernelExitGame();
    return 0;
    }

    int CallbackThread(SceSize args, void *argp) {
    int cbid;

    cbid = sceKernelCreateCallback(" Exit Callback", exit_callback, NULL);
    sceKernelRegisterExitCall back(cbid);

    sceKernelSleepThreadCB();

    return 0;
    }

    int SetupCallbacks(void) {
    int thid = 0;

    thid = sceKernelCreateThread("up date_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
    if(thid >= 0) {
    sceKernelStartThread(thid , 0, 0);
    }

    return thid;
    }

    int load_eboot(void) {
    struct SceKernelLoadExecParam eboot;
    char *ebootpath= "ms0:/PSP/GAME/Hello/EBOOT.PBP";
    const u32 Length_of_Eboot = strlen(ebootpath )+1;
    pspDebugInstallKprintfHan dler (NULL);
    pspDebugInstallErrorHandl er (NULL);
    eboot.args = Length_of_Eboot;
    eboot.argp = ebootpath;
    eboot.key = NULL;
    eboot.size = sizeof(eboot)+Length_of_E boot;
    sceKernelLoadExec(ebootpa th,&eboot);
    }

    int main() {
    pspDebugScreenInit();
    SetupCallbacks();
    SceCtrlData pad;
    printf("Press X to launch EBOOT");
    sceCtrlReadBufferPositive (&pad, 1);
    if(pad.Buttons & PSP_CTRL_CROSS){
    load_eboot();
    }
    sceKernelSleepThread();
    return 0;
    }

    Spoiler for Makefile:
    TARGET = runner
    OBJS = main.o

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

    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = EBOOT Runner

    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak

    Spoiler for Errors:
    $ make
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o main.o mai
    n.c
    main.c: In function 'load_eboot':
    main.c:50: warning: control reaches end of non-void function
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -L/usr/local/
    pspdev/psp/sdk/lib main.o -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk
    -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspus
    er -lpspkernel -o runner.elf
    psp-fixup-imports runner.elf
    psp-strip runner.elf -o runner_strip.elf
    pack-pbp EBOOT.PBP PARAM.SFO NULL \
    NULL NULL NULL \
    NULL runner_strip.elf NULL
    rm -f runner_strip.elf

  9. #1509
    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

    Wink

    Code:
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <string.h>
    #include <psploadexec.h>
    #include <pspdisplay.h>
    #include <pspctrl.h>
    
    #define printf pspDebugScreenPrintf
    
    PSP_MODULE_INFO("Eboot Runner", 0x1000, 1, 1);
    
    int exit_callback(int arg1, int arg2, void *common) {
    sceKernelExitGame();
    return 0;
    }
    
    int CallbackThread(SceSize args, void *argp) {
    int cbid;
    
    cbid = sceKernelCreateCallback(" Exit Callback", exit_callback, NULL);
    sceKernelRegisterExitCall back(cbid);
    
    sceKernelSleepThreadCB();
    
    return 0;
    }
    
    int SetupCallbacks(void) {
    int thid = 0;
    
    thid = sceKernelCreateThread("up date_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
    if(thid >= 0) {
    sceKernelStartThread(thid , 0, 0);
    }
    
    return thid;
    }
    
    int load_eboot(void) {
    struct SceKernelLoadExecParam eboot;
    char *ebootpath= "ms0:/PSP/GAME/Hello/EBOOT.PBP";
    const u32 Length_of_Eboot = strlen(ebootpath )+1;
    pspDebugInstallKprintfHan dler (NULL);
    pspDebugInstallErrorHandl er (NULL);
    eboot.args = Length_of_Eboot;
    eboot.argp = ebootpath;
    eboot.key = NULL;
    eboot.size = sizeof(eboot)+Length_of_E boot;
    sceKernelLoadExec(ebootpa th,&eboot);
    }
    
    int main() {
    pspDebugScreenInit();
    SetupCallbacks();
    SceCtrlData pad;
    printf("Press X to launch EBOOT");
    while(1) {
    sceCtrlReadBufferPositive (&pad, 1);
    if(pad.Buttons & PSP_CTRL_CROSS){
    load_eboot();
    }
    }
    sceKernelSleepThread();
    return 0;
    }
    Try that ;)

    ...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


  10. #1510
    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

    I seem to remember something about it needing to be a PRX.

    So code a kernel mode EBOOT to load a kernel mode PRX, from the PRX unload the boot EBOOT, then load the desired EBOOT.

    I could be mistaken, or thinking of something else.

    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

  11. #1511
    Points: 4.193, Level: 41
    Level completed: 22%, Points required for next Level: 157
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Arkhangelsk, Russia
    Beiträge
    21
    Points
    4.193
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Gah...

    Whats the code to make the psp wait for a set amount of time? I know I just saw it in here not to long ago but I cant seem to find it now. I've been using rediculicly long for loops as my wait function, but depending on what else I have it doing the for loop could be anywhere from 5000 to 80million to get it to wait just a few milliseconds...

    Something like sceKernelWait(time)?

  12. #1512
    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

    SG57, it still didn't work. I added the while loop, and it gave me the same warning as when I compiled without the while loop.

    Code:
    $ make
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o main.o mai
    n.c
    main.c: In function 'load_eboot':
    main.c:45: warning: control reaches end of non-void function
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/
    pspdev/psp/sdk/lib   main.o  -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk
    -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspus
    er -lpspkernel -o runner.elf
    psp-fixup-imports runner.elf
    psp-strip runner.elf -o runner_strip.elf
    pack-pbp EBOOT.PBP PARAM.SFO NULL  \
                    NULL NULL NULL  \
                    NULL  runner_strip.elf NULL
    rm -f runner_strip.elf

  13. #1513
    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

    Propel - read the tutorial on howto launch an eboot, as well as make your main function return a value...

    AKA, just add

    return 0;

    to the very bottom of your code, but still in the main functions brackets.

    ...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


  14. #1514
    QJ Gamer Blue
    Points: 4.073, Level: 40
    Level completed: 62%, Points required for next Level: 77
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Canada
    Beiträge
    70
    Points
    4.073
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von F.T.P.
    Gah...

    Whats the code to make the psp wait for a set amount of time? I know I just saw it in here not to long ago but I cant seem to find it now. I've been using rediculicly long for loops as my wait function, but depending on what else I have it doing the for loop could be anywhere from 5000 to 80million to get it to wait just a few milliseconds...

    Something like sceKernelWait(time)?

    sceKernelDelayThread(1000 000);

    will delay the thread in micro seconds, this will delay it for 1 second.

  15. #1515
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Propel
    SG57, it still didn't work. I added the while loop, and it gave me the same warning as when I compiled without the while loop.

    Code:
    $ make
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o main.o mai
    n.c
    main.c: In function 'load_eboot':
    main.c:45: warning: control reaches end of non-void function
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/
    pspdev/psp/sdk/lib   main.o  -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk
    -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspus
    er -lpspkernel -o runner.elf
    psp-fixup-imports runner.elf
    psp-strip runner.elf -o runner_strip.elf
    pack-pbp EBOOT.PBP PARAM.SFO NULL  \
                    NULL NULL NULL  \
                    NULL  runner_strip.elf NULL
    rm -f runner_strip.elf
    In this function: int load_eboot(void) , you are not returning an int.

  16. #1516
    Developer
    Points: 5.359, Level: 47
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Norway
    Beiträge
    384
    Points
    5.359
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von F.T.P.
    Gah...

    Whats the code to make the psp wait for a set amount of time? I know I just saw it in here not to long ago but I cant seem to find it now. I've been using rediculicly long for loops as my wait function, but depending on what else I have it doing the for loop could be anywhere from 5000 to 80million to get it to wait just a few milliseconds...

    Something like sceKernelWait(time)?
    sceDisplayWaitVBlank(); delays it for 1/60 second

    Or you could use
    sceKernelDelayThread(mirc oseconds)


  17. #1517
    Points: 4.193, Level: 41
    Level completed: 22%, Points required for next Level: 157
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Arkhangelsk, Russia
    Beiträge
    21
    Points
    4.193
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Hey, thanks alot you two! ;)

  18. #1518
    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 SG57
    Propel - read the tutorial on howto launch an eboot, as well as make your main function return a value...

    AKA, just add

    return 0;

    to the very bottom of your code, but still in the main functions brackets.
    Man, I'm too tired. How could I forget that.
    -= Double Post =-
    I compiled it with no errors, but it still doesn't work. WTF is wrong?!?!?
    Geändert von Propel (10-22-2006 um 03:11 PM Uhr) Grund: Automerged Doublepost

  19. #1519
    QJ Gamer Blue
    Points: 4.917, Level: 44
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    In a cave according to SG57 lol
    Beiträge
    273
    Points
    4.917
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    n00b Question time

    So the 2.8 TIFF games are created with C++?

  20. #1520
    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 ZeroMega
    n00b Question time

    So the 2.8 TIFF games are created with C++?
    Yeah, they're created with C. But if you are going to start developing, don't start with TIFF games, start with regular C coding and work your way up to TIFF.

  21. #1521
    QJ Gamer Blue
    Points: 4.917, Level: 44
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    In a cave according to SG57 lol
    Beiträge
    273
    Points
    4.917
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Propel
    Yeah, they're created with C. But if you are going to start developing, don't start with TIFF games, start with regular C coding and work your way up to TIFF.
    Ah I see, thanks a lot

    So what files do the C coding end up to be, and can you test them on your computer before they go on the PSP?

  22. #1522
    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 ZeroMega
    Ah I see, thanks a lot

    So what files do the C coding end up to be, and can you test them on your computer before they go on the PSP?
    When you compile them, they come out as EBOOTS, for regular homebrew, or sometimes PRXs, or a .BIN file for TIFF homebrew. And you can only test them if you have a mac, or a mac emulator. Then you can use the program by xart.

  23. #1523
    QJ Gamer Blue
    Points: 4.917, Level: 44
    Level completed: 84%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    In a cave according to SG57 lol
    Beiträge
    273
    Points
    4.917
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Propel
    When you compile them, they come out as EBOOTS, for regular homebrew, or sometimes PRXs, or a .BIN file for TIFF homebrew. And you can only test them if you have a mac, or a mac emulator. Then you can use the program by xart.
    Oh no, I don't have a Mac. >_<;

    Thanks though

  24. #1524
    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 ZeroMega
    Oh no, I don't have a Mac. >_<;

    Thanks though
    Neither do I, that's why I'm setting up a Mac OS 8 Emulator. I manged to get Mac OS X on my laptop, but it's not booting right.

  25. #1525
    QJ Gamer Blue
    Points: 4.580, Level: 43
    Level completed: 15%, Points required for next Level: 170
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    145
    Points
    4.580
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Okay I used a lib that Grimfate made for me on AIM and I tried to match it for my game but it still doesnt shoot:
    Spoiler for Lib:

    // THIS IS THE BARE CODE//
    // BY GRIMFATE126 //

    #define TRUE 1
    #define FALSE 0

    #define LEFT 1
    #define RIGHT 0

    class Bullet
    {
    public:
    int x;
    int y;
    int speed;
    int firing;

    Setup(int shoot_speed, int shoot_dir)

    };

    Bullet::Setup(int shoot_speed, int shoot_dir)
    {

    if (shoot_dir == LEFT) {
    x = ProtoX + 0; // YOU WILL HAVE TO EDIT THIS DEPENDING ON YOUR PLAYER//
    y = ProtoY + 0; // YOU WILL HAVE TO EDIT THIS DEPENDING ON YOUR PLAYER//
    } else if (shoot_dir == RIGHT) {
    x = MegaX + 0; // YOU WILL HAVE TO EDIT THIS DEPENDING ON YOUR PLAYER//
    y = MegaY + 0; // YOU WILL HAVE TO EDIT THIS DEPENDING ON YOUR PLAYER//
    }

    speed = shoot_speed; // THE SPEED OF THE BULLET //
    firing = TRUE;

    }




    // THE CODE TO USE IT//

    Bullet Pistol[9]; // THAT MAKES AN ARRAY WITH NINE BULLETS //
    int currentBullet = 0; // THE CURRENT BULLET BEING SHOT //
    int crossPressed = 0; // THIS WILL MAKE SURE YOU DONT SHOOT MULTIPLE BULLETS AT ONCE//


    // FUNCTION TO SHOOT BULLETS//

    void ShootBullets()
    {
    if (pad.Buttons & PSP_CTRL_RIGHT) {
    if (!crossPressed) {
    if (//check the direction of the player//) {
    Pistol[currentBullet].Setup(5, //the direction you want to shoot it//);
    } else if (//if the direction is the other one//) {
    Pistol[currentBullet].Setup(-5, //the direction you want to shoot it//);
    }

    if (pad.Buttons & PSP_CTRL_LEFT) {
    if (!crossPressed) {
    if (//check the direction of the player//) {
    Pistol[currentBullet].Setup(5, //the direction you want to shoot it//);
    } else if (//if the direction is the other one//) {
    Pistol[currentBullet].Setup(-5, //the direction you want to shoot it//);
    }
    }
    crossPressed = 1;
    } else {
    crossPressed = 0;
    }


    for (int a = 0, a < 10, a++) {
    if (Pistol[a].firing == TRUE) {
    Pistol[a].x += Pistol[a].Speed;
    blitAlphaImageToScreen(0 ,0 ,8,6,PelletImage,Pistol[a].x, Pistol[a].y)//width of the bullet// , // height of the bullet//, //name of the bullet//, Pistol[a].x, Pistol[a].y);
    }
    }


    // CHECK IF BULLET IS OUTSIDE OF SCREEN//

    for (int b = 0, b < 10, b++) {
    if (Pitsol[b].x > 480 || Pitsol[b].x < 0 || Pitsol[b].y > 272 || Pitsol[b].y < 0) {
    Pistol[b].firing = FALSE;
    Pistol[b].x = player_x + 0; // YOU WILL HAVE TO EDIT THIS DEPENDING ON YOUR PLAYER//
    Pistol[b].y = player_y + 0; // YOU WILL HAVE TO EDIT THIS DEPENDING ON YOUR PLAYER//
    }
    }

    for (int c = 0, c < 10, c--) {
    if (Pitsol[c].x > 480 || Pitsol[b].x < 0 || Pitsol[b].y > 272 || Pitsol[b].y < 0) {
    Pistol[c].firing = FALSE;
    Pistol[c].x = ProtoX + 0; // YOU WILL HAVE TO EDIT THIS DEPENDING ON YOUR PLAYER//
    Pistol[c].y = ProtoY + 0; // YOU WILL HAVE TO EDIT THIS DEPENDING ON YOUR PLAYER//
    }
    }


    }


    Spoiler for Main.Cpp:

    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspiofilemgr.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdlib.h>
    #include <string.h>
    #include <pspaudio.h>
    #include <pspaudiolib.h>
    #include <psppower.h>
    #include <psprtc.h>
    extern "C"
    {
    #include "graphics.h"
    }
    #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
    #define TRUE 1
    #define FALSE 0

    PSP_MODULE_INFO("MailasPr oduct", 0, 1, 1);

    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common) {
    sceKernelExitGame();
    return 0;
    }

    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
    int cbid;

    cbid = sceKernelCreateCallback(" Exit Callback", exit_callback, NULL);
    sceKernelRegisterExitCall back(cbid);

    sceKernelSleepThreadCB();

    return 0;
    }

    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
    int thid = 0;

    thid = sceKernelCreateThread("up date_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
    if(thid >= 0) {
    sceKernelStartThread(thid , 0, 0);
    }

    return thid;
    }

    //GLOBAL VARIABLES
    int main(void) {
    SetupCallbacks();
    initGraphics();

    SceCtrlData pad, lastpad;

    sceCtrlReadBufferPositive (&lastpad, 1);

    int MegaX = 27;
    int MegaY = 136;

    int ProtoX = 427;
    int ProtoY = 136;

    int megaPelX = 27;
    int megaPelY = MegaY;

    int shoot = 0;
    int currentBack = 0;


    Image* MegaImage;
    MegaImage = loadImage("./Images/M_Plat.png");

    Image* ProtoImage;
    ProtoImage = loadImage("./Images/P_Plat.png");

    Image* PelletImage;
    PelletImage = loadImage("./Images/pellet.png");

    Image* Background[3];
    Background[0] = loadImage("./Images/Backgrounds/Back1.png");
    Background[1] = loadImage("./Images/Backgrounds/Back2.png");
    Background[2] = loadImage("./Images/Backgrounds/Back3.png");

    while(1) {
    sceCtrlReadBufferPositive (&pad, 1);





    if(MegaY > (272 - 26))
    {
    MegaY = (272 - 26);
    }

    if(MegaY < 0)
    {
    MegaY = 0;
    }

    if(ProtoY > (272 - 26))
    {
    ProtoY = (272 - 26);
    }

    if(ProtoY < 0)
    {
    ProtoY = 0;
    }

    if(pad.Buttons & PSP_CTRL_RTRIGGER)
    {
    (currentBack < 2) ? currentBack++ : currentBack = 0;
    }

    if(pad.Buttons & PSP_CTRL_UP)
    {
    MegaY-=2;
    }

    if(pad.Buttons & PSP_CTRL_DOWN)
    {
    MegaY+=2;
    }

    if(pad.Buttons & PSP_CTRL_TRIANGLE)
    {
    ProtoY-=2;
    }

    if(pad.Buttons & PSP_CTRL_CROSS)
    {
    ProtoY+=2;
    }

    blitAlphaImageToScreen(0, 0, 480, 272, Background[currentBack], 0, 0);
    blitAlphaImageToScreen(0, 0, 33, 26, MegaImage, MegaX, MegaY);
    blitAlphaImageToScreen(0, 0, 24, 25, ProtoImage, ProtoX, ProtoY);

    sceDisplayWaitVblankStart ();
    flipScreen();

    }
    return 0;
    }

  26. #1526
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von hallo007
    still not working
    still crashing , the hello world i wanne load works
    but the eboot loader doesnt:
    Code:
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <string.h>
    #include <psploadexec.h>
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #define printf pspDebugScreenPrintf
    PSP_MODULE_INFO("Hello World", 0, 1, 1);
    PSP_MAIN_THREAD_ATTR (0);//zeg de psp dat het programma kernel acces nodig heeft
    
    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
    
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
    
              sceKernelSleepThreadCB();
    
              return 0;
    }
    
    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
              int thid = 0;
    
              thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
              if(thid >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    }
    
    int load_Eboot_calculator(void)
    {
    struct SceKernelLoadExecParam calculator;
    char *path_calculator= "ms0:/PSP/GAME/HELLOWORLD/EBOOT.PBP"; /*geheugenplaats voor de naam van de eboot die je wilt laden*/
    const u32 Length_of_Eboot = strlen(path_calculator )+1;
    pspDebugInstallKprintfHandler (NULL);
    pspDebugInstallErrorHandler (NULL);
    calculator.args = Length_of_Eboot;
    calculator.argp = path_calculator;
    calculator.key = NULL;
    calculator.size = sizeof(calculator)+Length_of_Eboot;
    sceKernelLoadExec(path_calculator,&calculator);
    }
    
    int main()
    {
    pspDebugScreenInit();
    SetupCallbacks();    
    printf("press cross to load calculator");
    SceCtrlData pad;
    while(1) {
      sceCtrlReadBufferPositive(&pad, 1);
    if(pad.Buttons & PSP_CTRL_CROSS){
    load_Eboot_calculator();
    }
    }
    sceKernelSleepThread();
    return 0;
    
    }
    still not fixed

  27. #1527
    Points: 4.037, Level: 40
    Level completed: 44%, Points required for next Level: 113
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Beiträge
    7
    Points
    4.037
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Here's a quick n' dirty one. In sceKernelCreateThread, is the stack size variable in KB or B or what?

    Thanks.

  28. #1528
    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

    jait - bytes. (80% sure)

    ...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


  29. #1529
    QJ Gamer Green
    Points: 6.697, Level: 53
    Level completed: 74%, Points required for next Level: 53
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    In The PSP
    Beiträge
    804
    Points
    6.697
    Level
    53
    Downloads
    0
    Uploads
    0

    Standard

    I was trying to write a program in which it displays hello world, and then loops until i press cross [X]. then i came to 1 piece of code in which i did not exactly understand it is this one

    Code:
     
    
    SetupCallbacks ();
    can anyone explain to me what this means? thanks

    edit - also what it does, thanks
    Linux + Windows = Lindows FTW

  30. #1530
    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 Sethis
    I was trying to write a program in which it displays hello world, and then loops until i press cross [X]. then i came to 1 piece of code in which i did not exactly understand it is this one

    Code:
     
    
    SetupCallbacks ();
    can anyone explain to me what this means? thanks

    edit - also what it does, thanks
    That's most likely referring to the exit callbacks. It's a chunk of code about 10 - 12 lines long, that allows your PSP's 'HOME' button to work when running the game.


 

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 .