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; Zitat von Auraomega Where did you find that error? The only errors I know of start 0x800 2 ... Anyway, ...
-
11-14-2007, 05:00 PM #6871It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Errors that start with 0x8002 are sce errors, whereas errors that start with 0x8001 are libc errors. I just looked through sys/errno.h. Take away the 0x8001 and then convert to decimal, and you'll see a lot of defines there. Just match them up.
Zitat von Auraomega
By the way, now that you have dev status, I think you can change the default color of your post in your cp so you don't have to do it with every post.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
11-15-2007, 09:40 AM #6872I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Odd, I don't appear to have that, which is a pain. Oh well, and its a matter of habit to still colour my font

But seriously, my code still isn't working and I'm just wondering if its because I'm trying to rename something in flash0? I could copy, the file and then delete the original, but that would be long winded, and its easy to run into problems I believe.
-Aura
-
11-15-2007, 10:47 AM #6873It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
You were probably looking in the wrong place for the color options. It's here: http://forums.qj.net/profile.php?do=editoptions near the bottom.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
11-15-2007, 12:59 PM #6874I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Sorry, I know about that, I mean I couldn't find the errno.h file, infact I don't appear to have the sys folder

-Aura
-= Double Post =-
Ignore that, I've actually found it, it wasn't with the includes in the libc folder as I assumed.Geändert von Auraomega (11-15-2007 um 01:01 PM Uhr) Grund: Automerged Doublepost
-
11-15-2007, 01:01 PM #6875It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
There are a mess of include folders. Specifically, it's /usr/local/pspdev/psp/include/sys/errno.h
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
11-17-2007, 10:40 AM #6876QJ Gamer Blue
- Registriert seit
- Feb 2007
- Ort
- Florida
- Beiträge
- 214
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Would anyone happen to know the maxium heigth (spelling?) and width possible for an .png image using Oslib?
-
11-17-2007, 10:43 AM #6877Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
512 x 512 i would say
-
11-17-2007, 11:53 AM #6878I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Trying to load a module with my KMode stuff in, but I'm getting error 0x8002013B - SCE_KERNEL_ERROR_LIBRARY_ FOUND - what normally causes this error?
-Aura
-
11-17-2007, 12:03 PM #6879
How do you set flags with preprocessor macros so that you can choose which version of the code you want to compile?
For example:
I could just use #define and replace it with either PSP or WIN32, but does that need to be set to a specific value, or does that not matter?Code:#ifdef PSP // PSP-specific code here #endif #ifdef WIN32 // Windows specific code here #endif
GameSnooper - Random drawing of gaming news
The 32 Bit Shell - My development blog (also includes gaming oddities)
-
11-18-2007, 05:25 AM #6880QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- Cape Town, South Africa
- Beiträge
- 714
- Points
- 5.795
- Level
- 49
- Downloads
- 0
- Uploads
- 0
The value doesn't matter. In fact, you don't even have to give it a value. You can just say "#define PSP", for example.
-
11-18-2007, 05:34 AM #6881Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
i have a quick question. in OpenGL, is a negative z value mean youre moving into or backwards in the screen? my frustum culling may be screwing up cause of this..
--------------------------------------------------------------------------------------
-
11-18-2007, 05:46 AM #6882QJ Gamer Silver
- Registriert seit
- Feb 2007
- Ort
- Melbourne, Australia
- Beiträge
- 1.773
- Points
- 8.717
- Level
- 62
- My Mood
-
- Downloads
- 0
- Uploads
- 0
i would think backwards...
WHA!?
-
11-18-2007, 06:37 AM #6883I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Is it possible to load a module from a buffer in usermode?
-Aura
-
11-18-2007, 07:35 AM #6884QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
I am trying to read through the user memory and find out which addresses are equal to '140', then write the memory addresses to a file. This is within a PRX that is run during a game.
I know there's something wrong because it freezes the game but what is the problem?Code:int main_thread(SceSize args, void *argp) { sceKernelDelayThread(3000000); SceUID fd; SceCtrlData pad; int i; int health = 140; int *address; while(1) { sceCtrlPeekBufferPositive(&pad, 1); if(pad.Buttons & PSP_CTRL_LTRIGGER) { if(pad.Buttons & PSP_CTRL_RTRIGGER) { break; } } sceDisplayWaitVblankStart(); } fd = sceIoOpen("ms0:/output.txt", PSP_O_CREAT|PSP_O_WRONLY|PSP_O_TRUNC, 0777); for(i = 0x08800000; i <= 0x0A000000; i += 0x00000001) { address = (void*)i; if(*address == health) { sceIoWrite(fd, (int*)address, (SceSize)sizeof(int*)); } sceDisplayWaitVblankStart(); } sceIoClose(fd); sceKernelSleepThread(); return 0; }...Just Returned To The Scene...
-
11-18-2007, 09:55 AM #6885Developer

- Registriert seit
- Jul 2005
- Ort
- Germany
- Beiträge
- 237
- Points
- 12.055
- Level
- 72
- Downloads
- 0
- Uploads
- 0
http://www.evl.uic.edu/ralph/508S98/coordinates.html
Zitat von Grimfate126
-
11-18-2007, 10:25 AM #6886It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Bus error. Replace += 0x00000001 with += 0x00000004
Zitat von JaSo PsP
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
11-18-2007, 11:48 AM #6887QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
still, it's not finding any memory locations that hold the value 140
...Just Returned To The Scene...
-
11-18-2007, 11:48 AM #6888Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
.set noreorder
#include "pspstub.s"
STUB_START "NandDumper",0x40090000,0 x00010005
STUB_FUNC 0x9EDD6EE1,readBlock
STUB_END
what's wrong with this?
Code:psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -fno-exceptions -fno-rtti -c -o main.o main.cpp psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -fno-exceptions -fno-rtti -c -o io.o io.cpp psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o NandDumper.o NandDumper.S psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib main.o io.o NandDumper.o -lpsppower -lstdc++ -lpsprtc -lpspnand_driver -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o powersample.elf io.o: In function `dumpNand()': io.cpp:(.text+0x1b8): undefined reference to `readBlock(unsigned long, unsigned char*)'
-
11-18-2007, 01:09 PM #6889The Unique Developer

- Registriert seit
- Oct 2006
- Ort
- Canada
- Beiträge
- 1.059
- Points
- 7.101
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Would you mind, uh making a .h header file for you function? :|
Zitat von hallo007
Malloc.Us Network Administrator
Decryption of the Encrypted
You are the unseen, the unstoppable and in power of your code. The God of your software.
-
11-18-2007, 01:21 PM #6890Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
I did that
Code:#ifndef IO_H #define IO_H ... extern int readBlock(u32 page, u8 *buffer); ... #endif
-
11-18-2007, 05:09 PM #6891It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Are you sure it's stored as a word and not something shorter, like a halfword or byte?
Zitat von JaSo PsP
Try putting it back to +=1 (or ++) and changing int* to char*pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
11-19-2007, 09:38 AM #6892QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Hmm, so I could search for 4 chars at once to make an integer? I don't think the health in Coded Arms Contagion is going to be stored in 1 byte?
Zitat von Archaemic
...Just Returned To The Scene...
-
11-19-2007, 12:20 PM #6893
DSX Help
Hi, is somebody here using DSX to display stuff on the XMB?
I'm currently working on a plugin, and am finding that it's flickering a bit. Also, it's conflicting with some items on the XMB, such as video and browser.
Does anyone know how to fix that?
CheersPlaco23
Why not donate and become part of this selected list?Spoiler for Wanna see my Apps?:Spoiler for Donators:
-
11-19-2007, 12:38 PM #6894Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
I am still stuck here:s
Zitat von hallo007
-
11-19-2007, 12:40 PM #6895It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Well, try a halfword search then.
Zitat von JaSo PsP
(Notice the optimizations I made; it'll take forever if you are constantly waiting for VBlank--that is, it'll take 38 hours to search through all of your memory. Suboptimal. I also removed the = in the <= as that would still be causing a crash. Also, asynchronous writing will speed it up too. I don't know if this is how async works on the PSP, though)Code:int main_thread(SceSize args, void *argp) { sceKernelDelayThread(3000000); SceUID fd; SceCtrlData pad; int i; u16 health = 140; u16 *address; while(1) { sceCtrlReadBufferPositive(&pad, 1); if(pad.Buttons & PSP_CTRL_LTRIGGER) { if(pad.Buttons & PSP_CTRL_RTRIGGER) { break; } } } fd = sceIoOpen("ms0:/output.txt", PSP_O_CREAT|PSP_O_WRONLY|PSP_O_TRUNC, 0777); for(i = 0x08800000; i < 0x0A000000; i += sizeof(health)) { address = (u16*)i; if(*address == health) { sceIoWriteAsync(fd, i, (SceSize)sizeof(i)); } } sceIoWaitAsync(fd, 0); sceIoClose(fd); sceKernelSleepThread(); return 0; }pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
11-19-2007, 01:21 PM #6896
- Registriert seit
- Nov 2007
- Ort
- PSP-Development
- Beiträge
- 11
- Points
- 2.935
- Level
- 33
- Downloads
- 0
- Uploads
- 0
Zitat von placo23
using dsx and no flickering here.
and yeh in 3.52 the browser is broken while running a vsh dsx prx. on 3.71 it kills the video function here.
you could end your prx with 0 or unload the prx while loading the net modules. i just added a button press to end my dsx prx before using the browser. not the best way but it works fine for me.
-
11-19-2007, 02:18 PM #6897QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
That totally crashes it as apposed to just not doing anything like before..
Zitat von Archaemic
...Just Returned To The Scene...
-
11-19-2007, 03:03 PM #6898It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Okay...that probably means that I got the alignment of a halfword wrong. Try running it in PSPLink or something to see what errors.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
11-19-2007, 03:06 PM #6899QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
Actually reflecting on the code given rather than stupid copy&pasting would be a wise choice sometimes.sceIoWriteAsync(fd, i, (SceSize)sizeof(i));
PS: Async IO on PSP only allows one async op at a time, so a second sceIoWrite call will just fail if the first one is still pending.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.
-
11-19-2007, 04:56 PM #6900It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Okay, already did that with that post. All I copied and pasted was the function names, NOT the arguments. You'll see I changed a lot of things. All I did wrong was forget what arguments sceIoWriteAsync took. I thought he was trying to write the address, and I momentarily forgot that it took a pointer and not something like printf takes. Writing the contents of the address would be pretty pointless because we already know it would be 140 if the match succeeds.
Zitat von Raphael
Anyway, I didn't know how the PSP's async worked, so here's the fixed code:
Code:int main_thread(SceSize args, void *argp) { sceKernelDelayThread(3000000); SceUID fd; SceCtrlData pad; int i; u8 health = 140; u8 *address; while(1) { sceCtrlReadBufferPositive(&pad, 1); if(pad.Buttons & PSP_CTRL_LTRIGGER) { if(pad.Buttons & PSP_CTRL_RTRIGGER) { break; } } } fd = sceIoOpen("ms0:/output.txt", PSP_O_CREAT|PSP_O_WRONLY|PSP_O_TRUNC, 0777); for(i = 0x08800000; i < 0x0A000000; ++i) { address = (u8*)i; if(*address == health) { sceIoWrite(fd, &i, (SceSize)sizeof(i)); } } sceIoClose(fd); sceKernelSleepThread(); return 0; }Geändert von Archaemic (11-19-2007 um 05:08 PM Uhr)
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ


LinkBack URL
About LinkBacks
Mit Zitat antworten


Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum