Seite 333 von 340 ErsteErste ... 233 283 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 LetzteLetzte
Zeige Ergebnis 9.961 bis 9.990 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; @yaustar I used the code that you posed and it worked. I have got a second counter based on the ...

  
  1. #9961
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    @yaustar

    I used the code that you posed and it worked. I have got a second counter based on the ticks.

    However...

    When i divide res by 1000, to get a millisecond counter, it goes ALOT slower, 1000 milliseconds pass in about 15 seconds, when 1000ms are supposed to be 1 second.


    ...Just Returned To The Scene...

  2. #9962
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    ah CRAP! i JUST realised WHY!

    It takes longer to loop thru the program than it does to pass one millisecond! And MS can only ever increase by one!

    I think i can figure this out...
    ...Just Returned To The Scene...

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

    aaaah you just discovered why you need to understand fps + timestepping..

    Fix Your Timestep! Gaffer on Games
    -- Code Monkey : Sarien, Fishguts, Cracks and Crevices --

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

  4. #9964
    Points: 1.580, Level: 22
    Level completed: 80%, Points required for next Level: 20
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Sep 2009
    Ort
    Nowhere
    Beiträge
    5
    Points
    1.580
    Level
    22
    Downloads
    0
    Uploads
    0

    Standard

    Ok, here's the biggest newb question yet, probably.
    I have Dev-c++ and just downloaded MinPSPSDK. Can someone tell me how to directly code and compile psp homebrew from the dev-c++ IDE please :)

  5. #9965
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    add the min psp sdk as an external compiler in the settings that is more of a dev c++ question than a psp programming one.
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  6. #9966
    Points: 1.580, Level: 22
    Level completed: 80%, Points required for next Level: 20
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Sep 2009
    Ort
    Nowhere
    Beiträge
    5
    Points
    1.580
    Level
    22
    Downloads
    0
    Uploads
    0

    Standard

    Can't find any way to do that .
    Added directories in Compiler options but it (obviously) didn't work.

  7. #9967
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    okay, I know this isn't much of a C/C++ question, but can someone point me to some MIPS Assembly tutorials?

  8. #9968
    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 mootjeuh Beitrag anzeigen
    okay, I know this isn't much of a C/C++ question, but can someone point me to some MIPS Assembly tutorials?
    Tutorial? doubts.
    It's not something usually given as a tutorial, it's way too straightforward to tutor. You can get mnemonic definitions from a reference set (easily googled). Basically, you need to know how a processor operates to understand assembler language.

  9. #9969
    QJ Gamer Green
    Points: 3.217, Level: 35
    Level completed: 12%, Points required for next Level: 133
    Overall activity: 0%

    Registriert seit
    Aug 2009
    Ort
    Moon
    Beiträge
    146
    Points
    3.217
    Level
    35
    My Mood
    Cool
    Downloads
    0
    Uploads
    0

    Standard

    Why is it so damn difficult to set-up the psp programming environment.I downloaded mini blah blah blah, i have dev C++ and even tried to add SQL as an external compiler in dev c++ for other things and all i get are errors...its so frustrating. :ah)

  10. #9970
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    Zitat Zitat von atomic_boneman Beitrag anzeigen
    Why is it so damn difficult to set-up the psp programming environment.I downloaded mini blah blah blah, i have dev C++ and even tried to add SQL as an external compiler in dev c++ for other things and all i get are errors...its so frustrating. :ah)
    dude just use minPSPw

  11. #9971
    Developer and Tutor.
    Points: 8.736, Level: 62
    Level completed: 96%, Points required for next Level: 14
    Overall activity: 0%

    Registriert seit
    Jul 2007
    Ort
    Widnes, England
    Beiträge
    1.649
    Points
    8.736
    Level
    62
    My Mood
    Happy
    Downloads
    0
    Uploads
    0

    Standard

    lol how many times :P mot devs only require MinPSPW and you would only need the toolchain if you needed to add a custom library for some reason XD.
    ------ FaT3oYCG -----
    AKA Craig, call me what you want to It's your preference.
    My Website: http://www.modern-gamer.co.uk/

    Currently working on:
    (0) MediaGrab
    (0) PGE Gears Of War - On hold (Very large project).
    (0) PS???? -On Hold A tactical 2d side scrolling game involving AI and online multiplayer features. - Tile engine nearley finished (1 bug to fix).

  12. #9972
    Developer
    Points: 8.092, Level: 60
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Jul 2008
    Ort
    Grand Rapids! MI
    Beiträge
    125
    Points
    8.092
    Level
    60
    Downloads
    5
    Uploads
    2

    Standard

    Zitat Zitat von mootjeuh Beitrag anzeigen
    okay, I know this isn't much of a C/C++ question, but can someone point me to some MIPS Assembly tutorials?
    here is a intro from Central Connecticut State University it had a few tuts in it when i was skkimming through it

  13. #9973
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    Zitat Zitat von lilmnm Beitrag anzeigen
    here is a intro from Central Connecticut State University it had a few tuts in it when i was skkimming through it
    okay thanks
    new question, if I want to open a file and read it using the PSPSDK, should I do something like this:
    Code:
    SceUID file = sceIoOpen("file.txt", PSP_O_RDONLY, 0777);
    void *data;
    sceIoRead(file, data, sizeof(data));
    ?


    EDIT: nvm, I figured it out
    Geändert von mootjeuh (11-03-2009 um 04:02 AM Uhr)

  14. #9974
    QJ Gamer Blue
    Points: 1.766, Level: 24
    Level completed: 66%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Oct 2009
    Ort
    Romania
    Beiträge
    34
    Points
    1.766
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    Some questions:


    1. How do I get the FW version and motherboard version, and print them. I used sysparam sample and i want to print the FW and motherboard version.

    2.I`ve tryed a psp buttons test:

    Code:
    sceCtrlReadBufferPositive(&pad, 1); 
    
    		printf("Analog X = %d ", pad.Lx);
    		printf("Analog Y = %d \n", pad.Ly);
    
    		if (pad.Buttons != 0){
    			if (pad.Buttons & PSP_CTRL_SQUARE){
    				printf("Square pressed \n");
    			}
    			if (pad.Buttons & PSP_CTRL_TRIANGLE){
    				printf("Triangle pressed \n");
    			} 
    			if (pad.Buttons & PSP_CTRL_CIRCLE){
    				printf("Cicle pressed \n");
    			} 
    			if (pad.Buttons & PSP_CTRL_CROSS){
    				printf("Cross pressed \n");
    			} 
    
    			if (pad.Buttons & PSP_CTRL_UP){
    				printf("Up pressed \n");
    			} 
    			if (pad.Buttons & PSP_CTRL_DOWN){
    				printf("Down pressed \n");
    			} 
    			if (pad.Buttons & PSP_CTRL_LEFT){
    				printf("Left pressed \n");
    			} 
    			if (pad.Buttons & PSP_CTRL_RIGHT){
    				printf("Right pressed \n");
    			}      
    
    			if (pad.Buttons & PSP_CTRL_START){
    				printf("Start pressed \n");
    			}
    			if (pad.Buttons & PSP_CTRL_SELECT){
    				printf("Select pressed \n");
    			}
    			if (pad.Buttons & PSP_CTRL_LTRIGGER){
    				printf("L-trigger pressed \n");
    			}
    			if (pad.Buttons & PSP_CTRL_RTRIGGER){
    				printf("R-trigger pressed \n");
    			}      
    		}
    	}
    But i`ve added more from pspctrl.h
    ->
    Code:
    			if (pad.Buttons & PSP_CTRL_HOME){
    				printf("Ati apasat butonul 'HOME' \n");
    				}
    			if (pad.Buttons & PSP_CTRL_HOLD){
    				printf("Ati activat butonul 'HOLD' \n");
    			}
    			if (pad.Buttons & PSP_CTRL_NOTE ){
    				printf("Ati apasat butonul 'NOTE ' \n");
    			}
    			if (pad.Buttons & PSP_CTRL_SCREEN ){
    				printf("Ati apasat butonul 'SCREEN ' \n");
    			}
    			if (pad.Buttons & PSP_CTRL_VOLUP ){
    				printf("Ati apasat butonul 'VOLUME UP' \n");
    			}
    			if (pad.Buttons & PSP_CTRL_VOLDOWN ){
    				printf("Ati apasat butonul 'VOLUME DOWN' \n");
    			}
    			if (pad.Buttons & PSP_CTRL_WLAN_UP ){
    				printf("Ati activat butonul de activare 'WLAN' \n");
    			}
    			if (pad.Buttons & PSP_CTRL_REMOTE ){
    				printf("Unitatea UMD functioneaza. Aveti un UMD inserat.\n");
    			}
    			if (pad.Buttons & PSP_CTRL_MS ){
    				printf("Aveti introdus un card in PSP-ul dvs.\n");
    			}
    I`ve know that WLAN_UP, MS and REMOTE don`t work, BUT, how do i make HOME BUTTON,SCREEN and other added work? Becouse they do they standard function (Home->Exit homebrew).

  15. #9975
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    does anyone know if there's a graphics.c version of Danzeff's OSK ? coz I really don't understand SDL...
    help is greatly appreciated

  16. #9976
    Points: 1.431, Level: 21
    Level completed: 31%, Points required for next Level: 69
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Nov 2009
    Ort
    Hamburg, Germany
    Beiträge
    5
    Points
    1.431
    Level
    21
    Downloads
    0
    Uploads
    0

    Standard

    hello, how i can add more fields to an array at runtime
    (for example, i've an array (char* Array[3]; Array[1] = "Bla", Array[2] = "Bla2" etc.)) and i want to add more fields (so that Array[3] gets for example 7 extra fields but that it does not overwrite Array[1] and Array[2]).
    Geändert von fasa123 (11-28-2009 um 04:56 PM Uhr)

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

    Zitat Zitat von fasa123 Beitrag anzeigen
    hello, how i can add more fields to an array at runtime
    (for example, i've an array (char* Array[3]; Array[1] = "Bla", Array[2] = "Bla2" etc.)) and i want to add more fields (so that Array[3] gets for example 7 extra fields but that it does not overwrite Array[1] and Array[2]).
    if your using c, or even c++, than u can use realloc(IIRC), however if your using c++'s, new and delete statements, than you would need to dump the array to a temporary array, delete the old one, than re-size it and dump your old array back into your new one(this is assuming that you already understand dynamic arrays), this is because realloc only works with it's friends malloc and free, and is not cross compatible between the two
    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

  18. #9978
    Points: 1.431, Level: 21
    Level completed: 31%, Points required for next Level: 69
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Nov 2009
    Ort
    Hamburg, Germany
    Beiträge
    5
    Points
    1.431
    Level
    21
    Downloads
    0
    Uploads
    0

    Standard

    i tried it with using new (Array = new int[10]) but when i compile the compiler says that the new statement is undefined oO
    And how can i look if i'm using c or c++?

  19. #9979
    QJ Gamer Blue
    Points: 1.799, Level: 24
    Level completed: 99%, Points required for next Level: 1
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Aug 2009
    Ort
    N/A
    Beiträge
    38
    Points
    1.799
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    You're asking us how to know in what language(s) you are programming ( "How can I look if I'm using Lua or Python ?"... ).

    Anyway in C++, you have std::string for this use.

  20. #9980
    Points: 1.431, Level: 21
    Level completed: 31%, Points required for next Level: 69
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Nov 2009
    Ort
    Hamburg, Germany
    Beiträge
    5
    Points
    1.431
    Level
    21
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Kode Beitrag anzeigen
    You're asking us how to know in what language(s) you are programming ( "How can I look if I'm using Lua or Python ?"... ).
    I mean c and c++ looks very same and so i do not knew this. now i found out, that if the file ending is cpp that it is c++ and if its just c than it c

    Zitat Zitat von Kode Beitrag anzeigen
    Anyway in C++, you have std::string for this use.
    that was not my question.. i mean the new statement, for example a = new int[5]
    and i found that new & delete is only in c++

    PS:
    How can i create a new thread, that delays itselfs for a certain time and then calls another viod.
    Geändert von fasa123 (11-29-2009 um 05:09 AM Uhr)

  21. #9981
    QJ Gamer Blue
    Points: 1.954, Level: 26
    Level completed: 54%, Points required for next Level: 46
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Feb 2009
    Beiträge
    2
    Points
    1.954
    Level
    26
    Downloads
    0
    Uploads
    0

    Standard

    Hey,
    can someone advice me which library is best for work with OpenType fonts?

    Thanks.
    kweensey

  22. #9982
    QJ Gamer Blue
    Points: 1.799, Level: 24
    Level completed: 99%, Points required for next Level: 1
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Aug 2009
    Ort
    N/A
    Beiträge
    38
    Points
    1.799
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von fasa123 Beitrag anzeigen
    I mean c and c++ looks very same and so i do not knew this. now i found out, that if the file ending is cpp that it is c++ and if its just c than it c
    Hum... C libraries can be used in C++, and then ? In order to program, you have to know in what language you are doing it...
    ( and programming in C++ is really not like programming in C )

    Zitat Zitat von fasa123 Beitrag anzeigen
    that was not my question.. i mean the new statement, for example a = new int[5]
    and i found that new & delete is only in c++
    I was obviously talking about your first post ;)

    Zitat Zitat von fasa123 Beitrag anzeigen
    How can i create a new thread, that delays itselfs for a certain time and then calls another viod.
    The thread's function should just... call sceKernelDelayThread, and then run another function (or thread) ?

  23. #9983
    Points: 1.431, Level: 21
    Level completed: 31%, Points required for next Level: 69
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Nov 2009
    Ort
    Hamburg, Germany
    Beiträge
    5
    Points
    1.431
    Level
    21
    Downloads
    0
    Uploads
    0

    Standard

    When i call sceKernelDelayThread the psp hangs for the indicated milliseconds
    Geändert von fasa123 (11-29-2009 um 10:41 AM Uhr)

  24. #9984
    QJ Gamer Blue
    Points: 1.799, Level: 24
    Level completed: 99%, Points required for next Level: 1
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Aug 2009
    Ort
    N/A
    Beiträge
    38
    Points
    1.799
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    delays itselfs for a certain time
    Is that not what you want ?
    Its argument is a time in microseconds ( 1000 * millisecond_time ).

  25. #9985
    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

    i think, if i understand from what i read is that he wants the core of the game to continue running, than spawn a thread at a certain time, but not interrupt the game, if so he needs to look into creating timers
    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

  26. #9986
    QJ Gamer Blue
    Points: 1.799, Level: 24
    Level completed: 99%, Points required for next Level: 1
    Overall activity: 0%
    Achievements:
    First 1000 Experience Points

    Registriert seit
    Aug 2009
    Ort
    N/A
    Beiträge
    38
    Points
    1.799
    Level
    24
    Downloads
    0
    Uploads
    0

    Standard

    Oh, that's not that hard :)

    A simple idea (it works, but it's perhaps not the best) is to use the timestamp (time or sceKernelLibcTime, it doesn't matter) and your ellapsed_time = new_time - old_time. Implementing pause is not hard either.

  27. #9987
    QJ Gamer Gold
    Points: 13.372, Level: 75
    Level completed: 31%, Points required for next Level: 278
    Overall activity: 0%

    Registriert seit
    Nov 2008
    Ort
    CAD
    Beiträge
    693
    Points
    13.372
    Level
    75
    Downloads
    19
    Uploads
    4

    Standard

    does anyone know how to clear the ram ?

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

    I'm sure this could be simplified:
    Code:
    	lonwork = limit_left;
    	latwork = limit_top;
    	while (lonwork < displon) {lonwork = lonwork + zoom; xxx++;}
    	while (latwork > displat) {latwork = latwork - zoom; yyy++;}
    I just have a block.
    It's all about incrementing xxx and yyy the correct number of times.
    Any ideas?

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

    Got his sorted NVM.

    Art 1 QJ 0

  30. #9990
    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

    Hi Guys,
    Actually, I'm stuck on the second line...

    The first while loop can be replaced with this:
    Code:
    float temp;
    temp = displon - limit_left;
    xxx = temp / zoom;
    I can't work out the second while loop.
    Any help appreciated.
    Cheers, Art.


 

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 .