Seite 49 von 340 ErsteErste ... 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 99 149 ... LetzteLetzte
Zeige Ergebnis 1.441 bis 1.470 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; Thank you! -= Double Post =- Am I such a loser in math? I call this function Code: void drawScrollableList(list_entry ...

  
  1. #1441
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Thank you!
    -= Double Post =-
    Am I such a loser in math? I call this function

    Code:
    void drawScrollableList(list_entry * list, int list_len, int selected, int selected_pos, int x, int y)
    {
    	int i, pos;
    	long scroll_height, scroll_pos;
    	int start = selected+1 - selected_pos;
    	int max_items = (list_len > 13) ? 13 : list_len;
    
    
    	// Draw List
    	for(pos=0,i==start; pos<max_items; i++,pos++)
    	{
    		if(i==selected)
    		{
    			blitImageToScreen(0, 0, 225, 20, img_highlight, x, y+pos*20);
    			printTextScreen(x+9, y+5+pos*20, list[i].label, RGB(255,255,255));
    		} else {
    			blitImageToScreen(0, 0, 6, 11, img_arrow, x+213, y+5+pos*20);
    			printTextScreen(x+9, y+5+pos*20, list[i].label, RGB(0,0,0));
    		}
    	}
    	[...]
    }
    with

    Code:
    	list_entry main_menu[5];
    	main_menu[0].label = "Music";
    	main_menu[1].label = "Videos";
    	main_menu[2].label = "Settings";
    	main_menu[3].label = "Shuffle Songs";
    	main_menu[4].label = "Now Playing";
    
    	drawScrollableList(main_menu, 5, 1, 2, 0, 6);
    To me, this should make start = 1+1-2 = 0, but he prints a list from item 1 (Videos) to 5 (cryptic chars). Why?
    -= Double Post =-
    This is crazy! I just changed the line
    Code:
    int start = selected+1 - selected_pos;
    to
    Code:
    int start = selected+1 - selected_pos-1;
    and he still prints that list from 1 to 5!
    -= Double Post =-
    ^^ an just in the momen I switched to the the IDE I saw it's

    i==start (=true=1)

    not

    i=start

    sorry for my stupid posts


    Geändert von Lukeson (10-20-2006 um 08:00 AM Uhr) Grund: Automerged Doublepost

  2. #1442
    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

    Code:
    $ make kxploit
    make: *** No rule to make target `graphics.o', needed by `hello.elf'.  Stop.
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include "graphics.h"

    #define printf pspDebugScreenPrintf
    PSP_MODULE_INFO("Image Display Program", 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;
    }
    int main()
    {
    char buffer[200];
    Image*menu;
    pspDebugScreenInit();
    SetupCallbacks();
    initGraphics();
    sprintf(buffer, "menu.png");
    menu = loadImage(buffer);
    }
    why is that????

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

    Your error is because you don't have graphics.c in the same directory as the rest of your files.

    Your code also will not display anything as is.

    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. #1444
    The Unique Developer
    Points: 7.101, Level: 55
    Level completed: 76%, Points required for next Level: 49
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Canada
    Beiträge
    1.059
    Points
    7.101
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    U have to add filpScreen();
    So your code will be:
    int main()
    {
    char buffer[200];
    Image*menu;
    pspDebugScreenInit();
    SetupCallbacks();
    initGraphics();
    sprintf(buffer, "menu.png");
    menu = loadImage(buffer);
    //You have loaded your Image But didn't show it ;)
    while (x < 480) {
    while (y < 272) {
    blitAlphaImageToScreen(0 ,0 ,32 , 32, menu, x, y);
    y += 32;
    }
    x += 32;
    y = 0;
    }flipScreen();
    }
    sceKernelSleepThread();
    return 0;
    }
    }
    Geändert von the unique warrior (10-20-2006 um 03:27 PM Uhr)

  5. #1445
    QJ Gamer Bronze
    Points: 4.305, Level: 41
    Level completed: 78%, Points required for next Level: 45
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    50
    Points
    4.305
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard tiff sdk

    how do u print something the the screan when u press X in the tiff sdk

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

    You shouldnt be coding using an SDK if you cant read a library =-\

    If you really want to print something, modify the Hello World tiff... No requests ;)

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


  7. #1447
    QJ Gamer Bronze
    Points: 4.305, Level: 41
    Level completed: 78%, Points required for next Level: 45
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    50
    Points
    4.305
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    You shouldnt be coding using an SDK if you cant read a library =-\

    If you really want to print something, modify the Hello World tiff... No requests ;)
    i know how to print something i just want it to happen when i press X

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

    ...Same as 1.5 dude...:

    if ( (SceCtrlData) _____ & PSP_CTRL_CROSS) {
    print
    }

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


  9. #1449
    QJ Gamer Bronze
    Points: 4.305, Level: 41
    Level completed: 78%, Points required for next Level: 45
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    50
    Points
    4.305
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    kk
    thancks

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

    another prob



    $ make kxploit
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o main.o mai
    n.c
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -L/usr/local/
    pspdev/psp/sdk/lib main.o -lpspgu -lpng -lz -lm -lpspdebug -lpspdisplay -lpspg
    e -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver
    -lpsputility -lpspuser -lpspkernel -o cpu
    psp-fixup-imports cpu
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -L/usr/local/
    pspdev/psp/sdk/lib main.o -lpspgu -lpng -lz -lm -lpspdebug -lpspdisplay -lpspg
    e -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver
    -lpsputility -lpspuser -lpspkernel -o tester.elf
    psp-fixup-imports tester.elf
    mkdir -p "cpu tester"
    psp-strip cpu tester.elf -o cpu tester/EBOOT.PBP
    Usage: psp-strip <option(s)> in-file(s)
    Removes symbols and sections from files
    The options are:
    -I --input-target=<bfdname> Assume input file is in format <bfdname>
    -O --output-target=<bfdname> Create an output file in format <bfdname>
    -F --target=<bfdname> Set both input and output format to <bfdname>

    -p --preserve-dates Copy modified/access timestamps to the output

    -R --remove-section=<name> Remove section <name> from the output
    -s --strip-all Remove all symbol and relocation information
    -g -S -d --strip-debug Remove all debugging symbols & sections
    --strip-unneeded Remove all symbols not needed by relocations
    --only-keep-debug Strip everything but the debug information
    -N --strip-symbol=<name> Do not copy symbol <name>
    -K --keep-symbol=<name> Only copy symbol <name>
    -w --wildcard Permit wildcard in symbol comparison
    -x --discard-all Remove all non-global symbols
    -X --discard-locals Remove any compiler-generated symbols
    -v --verbose List all object files modified
    -V --version Display this program's version number
    -h --help Display this output
    --info List object formats & architectures supported

    -o <file> Place stripped output into <file>
    psp-strip: supported targets: elf32-littlemips elf32-bigmips elf64-bigmips elf64
    -littlemips elf64-little elf64-big elf32-little elf32-big srec symbolsrec tekhex
    binary ihex
    make: *** [kxploit] Error 1
    yeah , yeah , i m back programming;)

  11. #1451
    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

    Your TARGET can only be one word.

    Code:
    TARGET = cpu tester
    Will not work.

    Code:
    TARGET = cputester
    Will work.

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

    k thnx
    -= Double Post =-
    new problem with usb

    #include <pspkernel.h>
    #include <pspdisplay.h>
    #include <pspusb.h>
    #include <pspusbstor.h>
    #include <string.h>
    // Defines
    #define printf pspDebugScreenPrintf

    // Functions
    int LoadStartModule(char *path)
    {
    u32 loadResult;
    u32 startResult;
    int status;

    loadResult = sceKernelLoadModule(path, 0, NULL);
    if (loadResult & 0x80000000) return -1;
    else
    startResult = sceKernelStartModule(load Result, 0, NULL, &status, NULL);

    if (loadResult != startResult) return -2;

    return 0;
    }

    void initUSB()
    {
    u32 retVal;

    LoadStartModule("flash0:/kd/semawm.prx");
    LoadStartModule("flash0:/kd/usbstor.prx");
    LoadStartModule("flash0:/kd/usbstormgr.prx");
    LoadStartModule("flash0:/kd/usbstorms.prx");
    LoadStartModule("flash0:/kd/usbstorboot.prx");

    retVal = sceUsbStart(PSP_USBBUS_DR IVERNAME, 0, 0);

    if (retVal != 0) {
    printf("Error starting USB Bus driver (0x%08X)\n", retVal);
    sceKernelSleepThread();
    }

    retVal = sceUsbStart(PSP_USBSTOR_D RIVERNAME, 0, 0);
    if (retVal != 0) {
    printf("Error starting USB Mass Storage driver (0x%08X)\n", retVal);
    sceKernelSleepThread();
    }

    retVal = sceUsbstorBootSetCapacity (0x800000);
    if (retVal != 0) {
    printf("Error setting capacity with USB Mass Storage driver (0x%08X)\n", retVal);
    sceKernelSleepThread();
    }

    retVal = 0;
    }

    void usbMode(const char* what)
    {
    u32 retVal;

    if (stricmp(what, "on")==0) {
    retVal = sceUsbActivate(0x1c8);
    }
    else if (stricmp(what, "off")==0) {
    retVal = sceUsbDeactivate(0);
    }
    }
    int main()
    {
    initUSB();//aanzetten
    usbMode("on");
    }
    isn't compilling because this errors
    $ make kxploit
    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 imageloader.elf
    main.o: In function `initUSB':
    main.c.text+0xb0): undefined reference to `sceUsbStart'
    main.c.text+0xd4): undefined reference to `sceUsbStart'
    main.c.text+0xec): undefined reference to `sceUsbstorBootSetCapacit y'
    main.o: In function `usbMode':
    main.c.text+0x18c): undefined reference to `sceUsbActivate'
    main.c.text+0x1bc): undefined reference to `sceUsbDeactivate'
    collect2: ld returned 1 exit status
    make: *** [imageloader.elf] Error 1
    Geändert von hallo007 (10-21-2006 um 04:53 AM Uhr) Grund: Automerged Doublepost

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

    Can you try renaming your .cpp with .c and see if that fixes any errors. I highly doubt it but the PSP libraries may be for just pure C and hve no support for C++ (ie #ifdef __cplusplus extern C { #endif )

    http://www.parashift.com/c++-faq-lit...c-and-cpp.html

  14. #1454
    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

    it is already main.c

    btw i just copied from the topic c examples;)

  15. #1455
    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

    Oh.. I thought the smileys were pp's . In that case, you are not linking to the libraries for the usb functions.

  16. #1456
    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

    As head_54us already stated you need to add -lpspusb -lpspusbstor to the LIBS line in your makefile.

    @head54_us: The SDK does support C++, by using exactly the same method you described.

    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

  17. #1457
    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

    id did that(if you mean in the makefile) already ;) not working

  18. #1458
    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

    Your output from cygwin says not:

    Code:
    -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk
    -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspus
    er -lpspkernel -o imageloader.elf
    I don't see either of the USB libraries there.

    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

  19. #1459
    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

    Hey everyone, im a total NOOOOB at programming, but i really wanna learn. So i started on a Hello World........which probably has over 20 errors. and when i try to compile with cygwin, it said that there is no kernal.h in its library.....but i did indeed install psptoochain. Anyways heres my code. can anyone help me thanks


    Code:
    //Hello World - My first PSP Program
    /*
    	This program was created by me on October 21 2006
    	It is a simple Hello World Application
    */ 
    
    #include <pspkernal.h>
    #include <pspdebug.h>
    
    PSP_MODLUE_INFO("Hello World", 0,1,1);
    
    #define printf pspDebugScreenPrintf 
    
    /* Exit callback */
    
    int exit_callback(int arg1, int arg2, void *common) {
    	sceKernalExitGame();
    	return 0; 
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
    	int cbid;
    
    	cbid = sceKernalCreateCallback("Exit Callback", exit_callback, NULL);
    
    	sceKernalSleepThreadCB();
    
    	return 0;
    }
    
    /*Sets up the callback thread and returns its thread id */ 
    int SetupCallbacks(void) {
    	int thid+ 0;
    
    	thid = sceKernalCreateThread("update_thread", CallbackThread, 0x11, 0xFA0,0,0);
    
    	if(thid >=0) {
    		sceKernalStartThread(thid, 0, 0);
    
    	}
    
    	return thid; 
    }
    
    
    //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
    
    
    printf("Hello World i AM HERE")
    
    //this is to make the printf appear, becuase it will just erase without it
    
    sceKernalSleepThread();
    
    return 0; 
    }
    Geändert von Sethis (10-21-2006 um 08:26 AM Uhr)
    Linux + Windows = Lindows FTW

  20. #1460
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    Could you post the exact output that cygwin gives you please?

    Hint: Right-click on cygwin's titlebar, select edit, select mark (the top choice), mark the text you want to copy, open up the titlebar menu again and select edit then copy. Now the text you marked is on your clipboard, so simply paste it here ;)


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  21. #1461
    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:
    PSP_MODLUE_INFO("Hello World", 0,1,1);
    Should be:

    Code:
    PSP_MODULE_INFO("Hello World", 0,1,1);
    Code:
    int thid+ 0;
    Should be:

    Code:
    int thid = 0;
    Code:
    printf("Hello World i AM HERE")
    Requires a semi-colon at the end:

    Code:
    printf("Hello World i AM HERE");
    All your references to kernal should be kernel

    You're also missing:

    Code:
    int main()
    {
    before your 'printf("Hello World i AM HERE")' line.

    There's probably more if I looked closer.

    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

  22. #1462
    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

    OMG HAHAH.....my spelling sucks poop......my bad.....cheesh kernEl... thanks.

    $ make kxploit
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -02-GO-Wall -c -o main.o main.
    c
    psp-gcc: unrecognized option '-02-GO-Wall'
    main.c:7:23: error: pspkernal.h: No such file or directory
    main.c:10: error: syntax error before string constant
    main.c:10: warning: data definition has no type or storage class
    main.c:22: error: syntax error before 'args'
    main.c: In function 'SetupCallbacks':
    main.c:34: error: syntax error before '+' token
    main.c:36: error: 'thid' undeclared (first use in this function)
    main.c:36: error: (Each undeclared identifier is reported only once
    main.c:36: error: for each function it appears in.)
    main.c: At top level:
    main.c:49: error: conflicting types for 'pspDebugScreenInit'
    /usr/local/pspdev/psp/sdk/include/pspdebug.h:32: error: previous declaration of
    'pspDebugScreenInit' was here
    main.c:49: warning: data definition has no type or storage class
    main.c:50: warning: data definition has no type or storage class
    main.c:55: error: syntax error before string constant
    main.c:59: warning: data definition has no type or storage class
    main.c:61: error: syntax error before 'return'
    make: *** [main.o] Error 1

    Thanks


    Edit after making those adjustments insomniac posted i got this in cygwin

    $ make kxploit
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -02-GO-Wall -c -o main.o main.
    c
    psp-gcc: unrecognized option '-02-GO-Wall'
    main.c:49: error: conflicting types for 'pspDebugScreenInit'
    /usr/local/pspdev/psp/sdk/include/pspdebug.h:32: error: previous declaration of
    'pspDebugScreenInit' was here
    main.c:49: warning: data definition has no type or storage class
    main.c:50: warning: data definition has no type or storage class
    make: *** [main.o] Error 1
    Linux + Windows = Lindows FTW

  23. #1463
    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:
    psp-gcc: unrecognized option '-02-GO-Wall'
    That line in your makefile should be:

    Code:
    -O2 -G0 -Wall
    That's (Letter)O 2, -G Zero, -Wall.

    You also need to make sure that the pspDebugScreenInit(); line and the SetupCallbacks(); line are AFTER the:

    Code:
    int main()
    {

    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

  24. #1464
    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

    THANK YOU IT COMPILED. and my psp actually sees it. can anyone please help me, i wanna print something to screen, and then like go to the next line when the sentence was unfinished like

    this. thanks
    Linux + Windows = Lindows FTW

  25. #1465
    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 can do something like this:

    Code:
    printf("This is line 1\nThis is line 2\nThis is line 3\n");
    Or even this:

    Code:
    printf("This is line 1\n");
    printf("This is line 2\n");
    printf("This is line 3\n");

    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

  26. #1466
    QJ Gamer Bronze
    Points: 4.305, Level: 41
    Level completed: 78%, Points required for next Level: 45
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    50
    Points
    4.305
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard print X

    sg57 when i do it is says error: ____ undeclared

    or something like that

  27. #1467
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    You have to replace ____ with an SceCtrlData struct you know... <_<


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  28. #1468
    QJ Gamer Bronze
    Points: 4.305, Level: 41
    Level completed: 78%, Points required for next Level: 45
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    50
    Points
    4.305
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von homer
    You have to replace ____ with an SceCtrlData struct you know... <_<
    whats a struct and wich one should i choose

  29. #1469
    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

    Insomniac, what does the n in 1/n, 2/n mean? trying it now. thhanks

    edit: does not work xD. any other suggestions?
    Linux + Windows = Lindows FTW

  30. #1470
    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 - '\n' character is *nix for 'carraige return' or 'newline'. so putting \n anywhere in a string when printingwill cause whatever is after that to go to the line below (approx. 10 pixels down...)

    psp-freak222 -
    Code:
    #include <pspctrl.h>
    
    ...
    
    SceCtrlData pad;
    
    ...
    
    if ( pad.Buttons & PSP_CTRL_CROSS) {
         print
    }

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



 

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 .