Seite 233 von 340 ErsteErste ... 133 183 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 283 333 ... LetzteLetzte
Zeige Ergebnis 6.961 bis 6.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; Now I get an error when I compile LuaPlayer. I get Spoiler for Error : [email protected] ~/source/LuaPLayer $ make psp-gcc ...

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

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

    Standard

    Now I get an error when I compile LuaPlayer.
    I get
    Spoiler for Error:
    [email protected] ~/source/LuaPLayer
    $ make
    psp-gcc -I. -IC:/cygwin/usr/local/pspdev/psp/sdk/include -G0 -Wall -O0 -fno-stri
    ct-aliasing -mno-explicit-relocs -I/usr/local/include/freetype2 -I/usr/local/in
    clude -D_PSP_FW_VERSION=150 -L. -LC:/cygwin/usr/local/pspdev/psp/sdk/lib -specs
    =C:/cygwin/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-TC:/cygwin/usr/local/ps
    pdev/psp/sdk/lib/linkfile.prx src/graphics.o src/sound.o src/luaplayer.o src/u
    tility.o src/main.o src/framebuffer.o src/luacontrols.o src/luagraphics.o src/lu
    asound.o src/luatimer.o src/luasystem.o src/luawlan.o src/lua3d.o loadlib.o src/
    exports.o -llua -llualib -lpng -ljpeg -lz -lpspgum -lm -lmikmod -lmmio -L/usr/lo
    cal/lib -L/usr/local/lib -lfreetype -lz -lpsprtc -lpspaudiolib -lpspaudio -lpspu
    sb -lpspusbstor -lpsppower -lpspwlan -lpspgu -lpspdebug -lpsphprm_driver -lpspde
    bug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_
    apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o luaplayer.elf
    src/sound.o: In function `my_mikmod_error_handler( )':
    sound.cpp:(.text+0x1c): undefined reference to `_mm_critical'
    sound.cpp:(.text+0x20): undefined reference to `_mm_critical'
    sound.cpp:(.text+0x34): undefined reference to `_mm_errno'
    sound.cpp:(.text+0x38): undefined reference to `_mm_errno'
    sound.cpp:(.text+0x4c): undefined reference to `_mm_errno'
    sound.cpp:(.text+0x50): undefined reference to `_mm_errno'
    sound.cpp:(.text+0x58): undefined reference to `_mm_errmsg'
    sound.cpp:(.text+0x5c): undefined reference to `_mm_errmsg'
    src/sound.o: In function `initMikmod()':
    sound.cpp:(.text+0xa0): undefined reference to `_mm_RegisterErrorHandler '
    sound.cpp:(.text+0xa8): undefined reference to `MikMod_RegisterAllLoader s'
    sound.cpp:(.text+0xb0): undefined reference to `MikMod_RegisterAllDriver s'
    sound.cpp:(.text+0xbc): undefined reference to `md_mode'
    sound.cpp:(.text+0xc0): undefined reference to `md_mode'
    sound.cpp:(.text+0xc4): undefined reference to `md_reverb'
    sound.cpp:(.text+0xc8): undefined reference to `md_reverb'
    sound.cpp:(.text+0xd0): undefined reference to `md_pansep'
    sound.cpp:(.text+0xd4): undefined reference to `md_pansep'
    sound.cpp:(.text+0xdc): undefined reference to `md_volume'
    sound.cpp:(.text+0xe0): undefined reference to `md_volume'
    sound.cpp:(.text+0xe8): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0xec): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0xf4): undefined reference to `md_sndfxvolume'
    sound.cpp:(.text+0xf8): undefined reference to `md_sndfxvolume'
    sound.cpp:(.text+0x100): undefined reference to `MikMod_Init'
    sound.cpp:(.text+0x10c): undefined reference to `MikMod_SetNumVoices'
    sound.cpp:(.text+0x114): undefined reference to `Player_Start'
    src/sound.o: In function `unloadMikmod()':
    sound.cpp:(.text+0x158): undefined reference to `MikMod_FreeSong'
    sound.cpp:(.text+0x160): undefined reference to `Player_Stop'
    sound.cpp:(.text+0x168): undefined reference to `MikMod_Exit'
    src/sound.o: In function `stopAndUnloadMusic()':
    sound.cpp:(.text+0x190): undefined reference to `Player_Stop'
    sound.cpp:(.text+0x1a0): undefined reference to `MikMod_FreeSong'
    src/sound.o: In function `loadAndPlayMusicFile(cha r*, int)':
    sound.cpp:(.text+0x210): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x214): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x21c): undefined reference to `MikMod_LoadSong'
    sound.cpp:(.text+0x244): undefined reference to `Player_Start'
    src/sound.o: In function `musicPause()':
    sound.cpp:(.text+0x270): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x274): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x280): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x288): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x284): undefined reference to `Player_HandleTick'
    sound.cpp:(.text+0x28c): undefined reference to `Player_Stop'
    src/sound.o: In function `musicResume()':
    sound.cpp:(.text+0x2c0): undefined reference to `Player_Start'
    sound.cpp:(.text+0x2d4): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x2d8): undefined reference to `md_musicvolume'
    src/sound.o: In function `loadSound(char*)':
    sound.cpp:(.text+0x304): undefined reference to `WAV_LoadFN'
    src/sound.o: In function `unloadSound(SAMPLE*)':
    sound.cpp:(.text+0x334): undefined reference to `WAV_Free'
    src/sound.o: In function `stopSound(int)':
    sound.cpp:(.text+0x364): undefined reference to `Voice_Stop'
    src/sound.o: In function `setVoiceVolume(int, unsigned short)':
    sound.cpp:(.text+0x540): undefined reference to `Voice_SetVolume'
    src/sound.o: In function `setVoicePanning(int, unsigned long)':
    sound.cpp:(.text+0x590): undefined reference to `Voice_SetPanning'
    src/sound.o: In function `playSound(SAMPLE*)':
    sound.cpp:(.text+0x5d4): undefined reference to `MikMod_PlaySample'
    src/sound.o: In function `setVoiceFrequency(int, unsigned long)':
    sound.cpp:(.text+0x660): undefined reference to `Voice_SetFrequency'
    src/sound.o: In function `musicIsPlaying()':
    sound.cpp:(.text+0x688): undefined reference to `Player_Active'
    src/sound.o: In function `voiceIsPlaying(int)':
    sound.cpp:(.text+0x6b8): undefined reference to `Voice_Stopped'
    src/sound.o: In function `setMusicVolume(unsigned int)':
    sound.cpp:(.text+0x718): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x71c): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x720): undefined reference to `md_musicvolume'
    sound.cpp:(.text+0x724): undefined reference to `md_musicvolume'
    src/sound.o: In function `setSFXVolume(unsigned int)':
    sound.cpp:(.text+0x778): undefined reference to `md_sndfxvolume'
    sound.cpp:(.text+0x77c): undefined reference to `md_sndfxvolume'
    sound.cpp:(.text+0x780): undefined reference to `md_sndfxvolume'
    sound.cpp:(.text+0x784): undefined reference to `md_sndfxvolume'
    src/sound.o: In function `setReverb(unsigned int)':
    sound.cpp:(.text+0x7d8): undefined reference to `md_reverb'
    sound.cpp:(.text+0x7dc): undefined reference to `md_reverb'
    sound.cpp:(.text+0x7e0): undefined reference to `md_reverb'
    sound.cpp:(.text+0x7e4): undefined reference to `md_reverb'
    src/sound.o: In function `setPanSep(unsigned int)':
    sound.cpp:(.text+0x838): undefined reference to `md_pansep'
    sound.cpp:(.text+0x83c): undefined reference to `md_pansep'
    sound.cpp:(.text+0x840): undefined reference to `md_pansep'
    sound.cpp:(.text+0x844): undefined reference to `md_pansep'
    collect2: ld returned 1 exit status
    make: *** [luaplayer.elf] Error 1

    [email protected] ~/source/LuaPLayer
    $
    I am pretty sure I have both libmikmod and mikmodlib installed.



  2. #6962
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    It seems like you have faulty version of libmikmod installed, seeing as it finds libmikmod.a, but can't link with them. Are you sure you specified --host psp when you configured it?
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  3. #6963
    QJ Gamer Silver
    Points: 8.717, Level: 62
    Level completed: 89%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Ort
    Melbourne, Australia
    Beiträge
    1.773
    Points
    8.717
    Level
    62
    My Mood
    Amused
    Downloads
    0
    Uploads
    0

    Standard

    is there a tutorial anywhere to load externel PRXs? for 3.XX (or how to use wlanscan) :s?
    WHA!?

  4. #6964
    QJ Gamer Green
    Points: 8.459, Level: 62
    Level completed: 3%, Points required for next Level: 291
    Overall activity: 32,0%

    Registriert seit
    Apr 2007
    Beiträge
    886
    Points
    8.459
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    im having a strange problem where cygwin seems to be conflicting with USBhost. I recently formatted my PC but backed up my cygwin directory. at first when I copied the cygwin folder back over I had some problems but I ran cygwin setup.exe and alls well now. However USBhost functions no longer properly work. I can confirm this because when I first ran the cygwin.bat it only said bash-3.2$ but when I closed out usbhostfs.exe it works fine. Now usbhost connects and quickly disconnects

  5. #6965
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von vodkkaa
    im having a strange problem where cygwin seems to be conflicting with USBhost. I recently formatted my PC but backed up my cygwin directory. at first when I copied the cygwin folder back over I had some problems but I ran cygwin setup.exe and alls well now. However USBhost functions no longer properly work. I can confirm this because when I first ran the cygwin.bat it only said bash-3.2$ but when I closed out usbhostfs.exe it works fine. Now usbhost connects and quickly disconnects
    I have this problem from time to time, I've found that using a different USB port helps, every so often it ends up happening in the port I switched too, which means I am forced to switch back, its a pain, but if it helps, its worth it.

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

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

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

    Standard

    hey everyone,
    just a quick question, how would i go about having multiple instances of an object? i wanna have to of the same object onscreen but using different coordinates. thanks

  7. #6967
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Xsjado7
    hey everyone,
    just a quick question, how would i go about having multiple instances of an object? i wanna have to of the same object onscreen but using different coordinates. thanks
    Um...the only way not be able to make multiple instances is to have static fields...
    But something tells me you haven't abstracted the object into a class. Can we see your code?
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  8. #6968
    QJ Gamer Silver
    Points: 8.717, Level: 62
    Level completed: 89%, Points required for next Level: 33
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Ort
    Melbourne, Australia
    Beiträge
    1.773
    Points
    8.717
    Level
    62
    My Mood
    Amused
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von BigSanFrey
    is there a tutorial anywhere to load externel PRXs? for 3.XX (or how to use wlanscan) :s?
    I can load an external PRX just what should the PRX look like?

    E.G what should the functions be? like printf("XRFDF"); doesn't work :s?
    WHA!?

  9. #6969
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    All right, Using OSLIB, how would I get a different off Set of an image?
    im trying to use a tileset, and not sure how to go to the different tiles when blitting em'

    Thank you!
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  10. #6970
    Developer
    Points: 5.157, Level: 46
    Level completed: 4%, Points required for next Level: 193
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Beiträge
    726
    Points
    5.157
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von BlackShark
    All right, Using OSLIB, how would I get a different off Set of an image?
    im trying to use a tileset, and not sure how to go to the different tiles when blitting em'

    Thank you!
    I guess you just wanna use the function oslCreateImageTile()

    It's very easy to use. Tell me if you need an example.

    Cheers
    Placo23

    Spoiler for Wanna see my Apps?:
    Why not donate and become part of this selected list?
    Spoiler for Donators:
    DarkSeveN - 5.100.000
    --DylanDangles--2.000.000
    Zuiver - 100.000
    AlwaysAmiYumi - 10.338.63

  11. #6971
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    an example would help!
    what are the x2 and y2 for?
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

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

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

    Standard

    Zitat Zitat von Archaemic
    Um...the only way not be able to make multiple instances is to have static fields...
    But something tells me you haven't abstracted the object into a class. Can we see your code?
    Dont worry about, iv got it pretty much sorted now. one question, in LUA you can use functions globally for several different objects. e.g:

    Code:
    collision(object)
    {
    object.x;
    object.y;
    }
    and then if you put

    Code:
    collision(player);
    it would replace the words object with player

    my question is how would you do this in C? is it something like:

    Code:
    void collision(*char object)
    {
    object->x
    object->y
    }
    and then simply

    Code:
    collision(player)
    ?

    any help would be great, thanks

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

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

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

    Standard

    isnt a struct just used to group chars/ints together?

  15. #6975
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    It's used to group any type of data together.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

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

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

    Standard

    so how does that refer to my question?

    im not trying to group anything, i just want to know if my example would work or what i would have to change

  17. #6977
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Well, the syntax of your code suggested you were looking for structs.

    But anyway, function invocation is a bit more complex than substitution. If it's just substitution, it's called a macro. With function invocation, data is actually passed. For instance.

    Code:
    #define d(e) (e = 2)
    void a(int b) {
        b = 0;
    }
    int main() {
        int c = 1;
        a(c);
        if(c == 1) printf("This is what you will see.");
        else printf("This is not printed.");
        d(c);
        if(c == 2) printf("This is printed, though.");
        else printf("This still isn't printed.");
    
        return 0;
    }
    Try this code out. You'll see that the function a does absolutely nothing. Actually, that's not entirely true. It changes the value of b, which is the value of a copied into a local variable, which then falls out of scope, doing effectively nothing. However, because d is substituted into the function, the value of c changes after calling d. I highly discourage the use of macros. yaustar can give better reasons than I can for not using macros.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

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

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

    Standard

    thanks for the help. th reason is for asking is that iv got a function to check wether an object is at certain coordinates an i need to use the same code for alot of objects. for example:

    Code:
    if (line1->y > note1->y + notetop && line1->y < note1->y + notebottom) do something;
    thats one of my few functions that im going to be using several times with different objects and i want to just be able to easily substitute note for note2 and so on instead if typing the function a whole stack of times and just changing note to note2... each time. thats the best i can explain it. it would just save me a stack of time and make my code a lot lighter. also, ididnt mean to be looking for a struct that code was just, off the top of my head, what i thought it may be. thanks for the help so far

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

    For god's sake. You asked how to do this in C and using structs was the answer.
    Code:
    typedef struct _Line
    {
    	int mX;
    	int mY;
    } Line;
    
    typedef struct _Object
    {
    	int mX;
    	int mY;
    	int mWidth;
    	int mHeight;
    } Object;
    
    // Using direct copy of your function
    void function( Line * aLine, Object * aObject )
    {
    	if( NULL != aLine && NULL != aObject )
    	{
    		if( aLine->y > aObject->y + aObject->mWidth && aLine->y < aObject->y + aObject->mHeight )
    		{
    			// Do something
    		}
    	}
    }
    
    int main()
    {
    	Line someLine;
    	someLine->mX = 300;
    	someLine->mY = 200;
    	
    	Object someObject;
    	someObject->mX = 320;
    	someObject->mY = 200;
    	someObject->mWidth = 10;
    	someObject->mHeight = 20;
    	
    	Object someObject2;
    	someObject2->mX = 220;
    	someObject2->mY = 200;
    	someObject2->mWidth = 20;
    	someObject2->mHeight = 20;
    	
    	function( &someLine, &someObject );
    	function( &someLine, &someObject2 );
    	
    	return 0;
    }

  20. #6980
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega
    I'm having a problem adding 2 functions to an app, I want to launch in different kernels, so I've been using the SDK from the Hen C, but I also want to add the option to use the NoUMD for the newer firmwares, which the library included does not allow.

    I've tried using the newest library (from the 3.71 SDK), but this doesn't have the former function of changing loading kernels, I've tried adding both libraries to my app, but I get a string of errors, so my question is, is there another library that has both of these options on, and if not, is there any way I can link both libraries into the app without conflict?
    Anyone?
    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  21. #6981
    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

    Can i just ask you yaustar, what's the difference between defining a struct type like this:
    Code:
    typedef struct _Test
    {
        int h;
        char y;
    } Test;
    and this:

    Code:
    typedef struct
    {
        int h;
        char y;
    } Test;
    Thanx
    ...Just Returned To The Scene...

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

    Probably none. It is just the style I am used to.

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

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

    Standard

    Zitat Zitat von JaSo PsP
    Can i just ask you yaustar, what's the difference between defining a struct type like this:
    Code:
    typedef struct _Test
    {
        int h;
        char y;
    } Test;
    and this:

    Code:
    typedef struct
    {
        int h;
        char y;
    } Test;
    Thanx
    With the first you can also create a variable of that type by using the following:
    Code:
    struct _Type variable;
    BTW, you can even name it like that:
    Code:
    typedef struct Type
    {
       ...
    } Type;
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  24. #6984
    Developer
    Points: 3.206, Level: 35
    Level completed: 4%, Points required for next Level: 144
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Beiträge
    74
    Points
    3.206
    Level
    35
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar
    For god's sake. You asked how to do this in C and using structs was the answer.
    Code:
    typedef struct _Line
    {
        int mX;
        int mY;
    } Line;
    
    typedef struct _Object
    {
        int mX;
        int mY;
        int mWidth;
        int mHeight;
    } Object;
    
    // Using direct copy of your function
    void function( Line * aLine, Object * aObject )
    {
        if( NULL != aLine && NULL != aObject )
        {
            if( aLine->y > aObject->y + aObject->mWidth && aLine->y < aObject->y + aObject->mHeight )
            {
                // Do something
            }
        }
    }
    
    int main()
    {
        Line someLine;
        someLine->mX = 300;
        someLine->mY = 200;
        
        Object someObject;
        someObject->mX = 320;
        someObject->mY = 200;
        someObject->mWidth = 10;
        someObject->mHeight = 20;
        
        Object someObject2;
        someObject2->mX = 220;
        someObject2->mY = 200;
        someObject2->mWidth = 20;
        someObject2->mHeight = 20;
        
        function( &someLine, &someObject );
        function( &someLine, &someObject2 );
        
        return 0;
    }
    Small mistake: this wont compile, someLine is not pointer you'll get invalid type doing someLine->mX, either change to someLine.mX or Line *someLine (same with the others).
    PSP PRX LibDoc's Lives On!
    http://silverspring.lan.st/

    My new home:
    http://my.malloc.us/silverspring/

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

    Oops. My bad:
    Code:
    int main()
    {
        Line someLine;
        someLine.mX = 300;
        someLine.mY = 200;
        
        Object someObject;
        someObject.mX = 320;
        someObject.mY = 200;
        someObject.mWidth = 10;
        someObject.mHeight = 20;
        
        Object someObject2;
        someObject2.mX = 220;
        someObject2.mY = 200;
        someObject2.mWidth = 20;
        someObject2.mHeight = 20;
        
        function( &someLine, &someObject );
        function( &someLine, &someObject2 );
        
        return 0;
    }

  26. #6986
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    So I'm trying to write a plugin to grab savegame encryption keys (because keygrabber_v2 just isn't working for me...I even tried it with the WiFi switch on because I saw a reference to that in the source), but it just isn't loading. When I try to load it from a homebrew app, it loads and runs just fine. But not as a plugin. Here's my code (it's really hack-y, I've done a lot of stuff to get apiHook working without most of PSPLink's source...and I don't even know yet if it is working, or if I'm doing it right):
    Code:
    #include <pspiofilemgr.h>
    #include <psputility.h>
    #include <psploadcore.h>
    #include <pspmoduleinfo.h>
    #include "apihook.h"
    
    PSP_MODULE_INFO("uSEdown",0x1000, 0, 1);
    PSP_MAIN_THREAD_ATTR(0);
    
    static u32 sceUtilitySavedateInitStart_real = 0;
    
    int shprintf(const char *fmt, ...) {
    	return 0;
    }
    
    int sceUtilitySavedataInitStart_fake(SceUtilitySavedataParam *params) {
    	SceUID keyout = sceIoOpen("ms0:/key.bin",PSP_O_WRONLY|PSP_O_CREAT,0777);
    	if(keyout >= 0) {
    		sceIoWrite(keyout,((char*)params)+0x5DC, 16*sizeof(char));
    		sceIoClose(keyout);
    	}
    	return sceUtilitySavedataInitStart(params);
    }
    
    int module_start(SceSize args, void *argp) {
    	sceIoClose(sceIoOpen("ms0:/ack",PSP_O_WRONLY|PSP_O_CREAT,0777));
    	sceUtilitySavedateInitStart_real = apiHookByName(
    		sceKernelFindModuleByName("sceUtility_Driver")->modid,"sceUtility",
    		"sceUtilitySavedataInitStart",(void*)sceUtilitySavedataInitStart_fake);
    	return 0;
    }
    My exports file:
    Code:
    PSP_BEGIN_EXPORTS
    
    PSP_EXPORT_START(syslib, 0, 0x8000)
    PSP_EXPORT_FUNC_HASH(module_start)
    PSP_EXPORT_VAR_HASH(module_info)
    PSP_EXPORT_END
    
    PSP_END_EXPORTS
    and my Makefile:

    Code:
    OBJS = main.o apihook.o decodeaddr.o kmode.o libs.o util.o
    
    #CFLAGS = -G0 -O2 #Normal build
    CFLAGS = -G0 -g -Wall #Debug build
    LIBS = -lpsputility
    
    TARGET = usedown
    BUILD_PRX = 1
    PRX_EXPORTS = exports.exp
    
    USE_KERNEL_LIBS = 1
    USE_KERNEL_LIBC = 1
    LDFLAGS = -nostdlib -nodefaultlibs
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    I have no clue why it's not running. I've compared the source to several other plugins (e.g., keygrabber_v2 and music_plugin v0.55), but...I dunno.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

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

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

    Standard

    Code:
    return sceUtilitySavedataInitStart(params);
    Is there a reason why you recursively keep calling your own function?
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  28. #6988
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    I'm trying to call the original function, but I figured that might be what happens. ...I was going to change that call, but I forgot. Either way, that probably ISN'T why it's not loading.

    E] Corrected code that will hopefully run properly. I still don't think it'll launch, though. Let me try.

    Code:
    #include <pspiofilemgr.h>
    #include <psputility.h>
    #include <psploadcore.h>
    #include <pspmoduleinfo.h>
    #include "apihook.h"
    
    PSP_MODULE_INFO("uSEdown",0x1000, 0, 1);
    PSP_MAIN_THREAD_ATTR(0);
    
    typedef int (*SUSIS)(SceUtilitySavedataParam *params);
    static SUSIS sceUtilitySavedataInitStart_real = 0;
    
    int shprintf(const char *fmt, ...) {
    	return 0;
    }
    
    int sceUtilitySavedataInitStart_fake(SceUtilitySavedataParam *params) {
    	SceUID keyout = sceIoOpen("ms0:/key.bin",PSP_O_WRONLY|PSP_O_CREAT,0777);
    	if(keyout >= 0) {
    		sceIoWrite(keyout,((char*)params)+0x5DC, 16*sizeof(char));
    		sceIoClose(keyout);
    	}
    	return sceUtilitySavedataInitStart_real(params);
    }
    
    int module_start(SceSize args, void *argp) {
    	sceIoClose(sceIoOpen("ms0:/ack",PSP_O_WRONLY|PSP_O_CREAT,0777));
    	sceUtilitySavedataInitStart_real = (SUSIS) apiHookByName(sceKernelFindModuleByName(
    		"sceUtility_Driver")->modid,"sceUtility", "sceUtilitySavedataInitStart",
    		(void*)sceUtilitySavedataInitStart_fake);
    	return 0;
    }
    Well...hey! It launches now. Now to try and figure out why it's crashing (and there are all too many reasons it could be crashing...but it doesn't look like the stack breaking down.

    ...
    It'd probably just be a better use of my time to get keygrabber working instead of reinventing the wheel.

    So I figured out why keygrabber isn't grabbing the keys. It's not hooking the functions properly. That could do it.
    Geändert von Archaemic (11-28-2007 um 04:37 PM Uhr)
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

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

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

    Standard

    How come I get this error when I try to update my PSPSDK?

    $ ./toolchain.sh -p
    ./toolchain.sh: line 26: BUILD_SCRIPTS: bad array subscript
    ./toolchain.sh: line 26: : command not found
    ./toolchain.sh: line 26: BUILD_SCRIPTS: bad array subscript
    : Failed.

  30. #6990
    QJ Gamer Bronze
    Points: 5.402, Level: 47
    Level completed: 26%, Points required for next Level: 148
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    468
    Points
    5.402
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Anti-QuickJay
    How come I get this error when I try to update my PSPSDK?
    if all you want to do is update the pspsdk component do this -

    ./toolchain.sh 3 6


 

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:27 PM Uhr.

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