Zeige Ergebnis 9.391 bis 9.420 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; @slicer4ever Thanks I shall take a look at it...
-
12-25-2008, 04:31 AM #9391QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- The Netherlands
- Beiträge
- 330
- Points
- 3.567
- Level
- 37
- Downloads
- 0
- Uploads
- 0
@slicer4ever
Thanks I shall take a look at it
[spoiler=My Releases So Far]
PSP_Operator v2.0 Final (and earlier; stopped with this one)
Mario's Road v2.0 (working on 2.5:D)
UMD_Operator v0.0.2 (and earlier; stopped with this one)
PSP-Quiz v0.1 (working on v0.2 already:D)
[/spoiler]
-
12-25-2008, 05:05 AM #9392QJ Gamer Blue
- Registriert seit
- Nov 2007
- Beiträge
- 29
- Points
- 2.981
- Level
- 33
- Downloads
- 0
- Uploads
- 0
I haven't done anything for psp in a long time, and thus, i forgot basically anything.
So, as i'm learning from the basics i've got some problems.
so, i have Test.txt which looks like this -
And then, in code -Code:7 3 2 2
And what i see?Code:int w=0,h=0,x=0,y=0; SceUID file = sceIoOpen("Test.txt", IOASSIGN_RDONLY, 0777); sceIoRead(file, &w,sizeof(int)); sceIoRead(file, &h,sizeof(int)); sceIoRead(file, &x,sizeof(int)); sceIoRead(file, &y,sizeof(int)); oslPrintf("\n %d \n %d \n %d \n %d \n",w,h,x,y);
Change from sizeof to 1 gives another set of strange numbers.Code:856296754 221383281 168635938 589505315
So, how do i fix it?
-
12-25-2008, 06:05 AM #9393QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- The Netherlands
- Beiträge
- 330
- Points
- 3.567
- Level
- 37
- Downloads
- 0
- Uploads
- 0
Yo guys i'm back with a new question:P I want to use a ICON0.png for my eboot so I put the icon0 in the folder of the main.c and makefile and added this line to the makefile:
#PSP_EBOOT_ICON = ICON0.PNG
But when I compile and i put the eboot on my psp i see the standard ICON0.png. What am I doing wrong?[spoiler=My Releases So Far]
PSP_Operator v2.0 Final (and earlier; stopped with this one)
Mario's Road v2.0 (working on 2.5:D)
UMD_Operator v0.0.2 (and earlier; stopped with this one)
PSP-Quiz v0.1 (working on v0.2 already:D)
[/spoiler]
-
12-25-2008, 07:33 AM #9394QJ Gamer Silver
- Registriert seit
- Sep 2006
- Ort
- Perth, Scotland
- Beiträge
- 1.094
- Points
- 8.475
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Remove the '#'.
-
12-25-2008, 02:19 PM #9395I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
-
12-25-2008, 02:26 PM #9396QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- The Netherlands
- Beiträge
- 330
- Points
- 3.567
- Level
- 37
- Downloads
- 0
- Uploads
- 0
Oke
[spoiler=My Releases So Far]
PSP_Operator v2.0 Final (and earlier; stopped with this one)
Mario's Road v2.0 (working on 2.5:D)
UMD_Operator v0.0.2 (and earlier; stopped with this one)
PSP-Quiz v0.1 (working on v0.2 already:D)
[/spoiler]
-
12-25-2008, 10:12 PM #9397xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
[SPOILER]
[/SPOILER]Code:#include <pspkernel.h> #include <pspdebug.h> #include <psppower.h> #include <pspkerneltypes.h> #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> #include <pspthreadman.h> #include <pspdisplay.h> #include <pspctrl.h> #include <string.h> #include <pspsdk.h> #include <pspgu.h> #include <png.h> #include <pspidstorage.h> #include <string.h> extern int ReadKey(int key, char *buffer); extern int WriteKey(int key, char *buffer); extern int CreateKey(int key); extern int DeleteKey(int key); extern void dump(); /* Exit callback */ int exit_callback(int arg1, int arg2, void *common) { sceKernelExitGame(); return 0; } /* Callback thread */ int CallbackThread(SceSize args, void *argp) { int cbid; cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL); sceKernelRegisterExitCallback(cbid); sceKernelSleepThreadCB(); return 0; } /* Sets up the callback thread and returns its thread id */ int SetupCallbacks(void) { int thid = 0; thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0); if(thid >= 0) { sceKernelStartThread(thid, 0, 0); } return thid; } int check_mobo(void) { int mobo; char buffer[512]; ReadKey(0x0100, buffer); mobo = buffer[0x03f]; ReadKey(0x0050, buffer); mobo = (mobo << 8) | buffer[0x021]; return mobo; } void refresh() { pspDebugScreenClear(); get_info(); } void get_info() { printf("*******************Motherboard/IdStorage Info***********************\n"); switch (check_mobo()) { case 0x0101: printf("test identifies the motherboard as a TA-079/81\n"); break; case 0x0202: printf("test identifies the motherboard as a TA-082/86\n"); break; case 0x0303: printf("test PSP identifies the motherboard as a TA-085\n"); break; default: printf("IdStorage seems to be corrupt, please use DC8 to make a new one!\n"); break; } printf("\n********************************************************************\n"); } int main() { pspDebugScreenInit(); SetupCallbacks(); SceCtrlData pad; sceCtrlReadBufferPositive(&pad, 1); SceUID idmod = pspSdkLoadStartModule("ms0:/seplugins/idstorage.prx", PSP_MEMORY_PARTITION_KERNEL); if ((idmod < 0)) { pspDebugScreenClear(); printf(" Error 0x%08X loading/starting idstorage.prx\nPlease make sure it is located at <ms0:/seplugins>/!!\n", idmod); sceKernelDelayThread(3*1000*1000); sceKernelExitGame(); } else { refresh(); } while(1) { sceCtrlReadBufferPositive(&pad, 1); if(pad.Buttons & PSP_CTRL_CROSS) { refresh(); } if(pad.Buttons & PSP_CTRL_SQUARE) { pspDebugScreenClear(); printf("Exiting to xmb in 2 seconds....\n\nPlease wait for the XMB to load."); sceKernelDelayThread(2000000); sceKernelExitGame(); } if(pad.Buttons & PSP_CTRL_TRIANGLE) { } if(pad.Buttons & PSP_CTRL_CIRCLE) { } } sceKernelSleepThread(); return 0; }
plz help, using check_mobo always returns error, but im sure my idstorage is fine!...
!~SlasheR~!
-
12-25-2008, 11:05 PM #9398QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
why don't you just print out the check_mobo() function on several psp's, and see what it's returning as
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
-
12-26-2008, 11:04 AM #9399QJ Gamer Green
- Registriert seit
- May 2008
- Ort
- The Netherlands
- Beiträge
- 330
- Points
- 3.567
- Level
- 37
- Downloads
- 0
- Uploads
- 0
Is it possible to disable the gameboot screen with a piece of code?
If yes; where can I find this?[spoiler=My Releases So Far]
PSP_Operator v2.0 Final (and earlier; stopped with this one)
Mario's Road v2.0 (working on 2.5:D)
UMD_Operator v0.0.2 (and earlier; stopped with this one)
PSP-Quiz v0.1 (working on v0.2 already:D)
[/spoiler]
-
12-26-2008, 11:46 AM #9400
I'd decrypt the game loader, use "prxtool --elfout FILE.prx > FILE.elf", stick it in a disassembler, find where it loads gameboot.pmf or whatever, then branch over it(beq $zero, $zero, 0xADDYTOGOTO or j 0xADDYTOGOTO), requires some asm knowledge. Then find the exact address, then do something like
*((unsigned int*)((unsigned int)ADDRESS)) = 0xASMVALUEOFBRANCHORJ;I gone and made that one power spoofer and that gay cheat device.
-
12-26-2008, 11:48 AM #9401Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
I'd hook the function that loads the gameboot and replace it with a function that loads a dummy gameboot (0 bytes)
-
12-26-2008, 02:54 PM #9402QJ Gamer Blue
- Registriert seit
- Nov 2007
- Beiträge
- 29
- Points
- 2.981
- Level
- 33
- Downloads
- 0
- Uploads
- 0
Don't want to be insistent mcuh, but can somebody help me with my problem on the previous page?
http://forums.qj.net/showthread.php?...=1#post2141464
Link to the post.
-
12-26-2008, 03:58 PM #9403xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
-
12-26-2008, 05:35 PM #9404QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
sendspace.com, just print out the results i'll give u the results from my 2 phats
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
-
12-26-2008, 07:32 PM #9405xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Fix It PSP = http://www.sendspace.com/file/9gu8vg
Still in early stages :-)
!~SlasheR~!
-
12-26-2008, 09:32 PM #9406
I gone and made that one power spoofer and that gay cheat device.
-
12-27-2008, 01:28 AM #9407QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Or patch the fileIoOpen function and check if it loads gameboot.pmf, like this:
Look at hellcats wallpaper changer source for patching functions.Code:patchedFileIoOpen(char[500] fileName) { char[500] file; if(fileName == "flash0:/resources/bla/bla/gameboot.pmf") { file = "ms0:/gameboot.pmf"; originalFileIoOpen(file); } else { originalFileIoOpen(fileName); } }[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
12-27-2008, 06:06 AM #9408QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
Currently playing around with .mp3 loading/playing using pspmp3.h. Most of my .mp3's play fine however sceMp3Decode returns 0x80671103 when playing some. Anyone know of the cause of this?
-
12-27-2008, 06:13 PM #9409xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
i dont know, try to look in the sdk docs to see if its listed there :)
-=Double Post Merge =-
is there a function to get the tachyon, pommel and the rest of the things??
the guys at ps2dev.org = :Argh:
!~SlasheR~!Geändert von slasher101 (12-27-2008 um 07:52 PM Uhr) Grund: Automerged Doublepost
-
12-27-2008, 11:20 PM #9410QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
12-27-2008, 11:37 PM #9411QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
slasher, i keep getting an error saying that it can't find the idstorage.prx, u seem to want it on the ms so i pulled it out of flash and placed it where your program said to place it, but it still wouldn't load
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
-
12-28-2008, 01:42 AM #9412xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
srry need to fix that
place fixitpsp.prx in ms0:/seplugins/
then it will work,
thx for testing it =)
!~SlasheR~!
-
12-28-2008, 01:46 AM #9413QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
i did do that, and it wasn't asking for fixitpsp.prx, but for idstorage.prx to be in ms0:/seplugins/, even after placing idstorage.prx in their it still failed
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
-
12-28-2008, 12:15 PM #9414I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I'm begining to get a tad annoyed at some code I've written, I'm trying to compile a prx but it fails with an error which doesn't make sense:
Code:int module_start(SceSize args, void *argp) { ... return 0; } int module_stop(void) { return 0; }Code:# Define the exports for the prx PSP_BEGIN_EXPORTS # These four lines are mandatory (although you can add other functions like module_stop) # syslib is a psynonym for the single mandatory export. PSP_EXPORT_START(syslib, 0, 0x8000) PSP_EXPORT_FUNC_HASH(module_start) PSP_EXPORT_VAR_HASH(module_info) PSP_EXPORT_END PSP_EXPORT_START(flashPatch, 0, 0x0) PSP_EXPORT_END PSP_END_EXPORTS
The error is:Code:TARGET = patch OBJS = main.o INCDIR = CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) BUILD_PRX = 1 PRX_EXPORTS = exports.exp USE_KERNEL_LIBC=0 USE_KERNEL_LIBS=0 LIBDIR = LDFLAGS = -mno-crt0 -nostartfiles PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak
I've had this before, but whats really strange is I copied the exports, makefile and removed the functions from a compiling prx to test, I got the same error, yet I can compile prxs fine without that error in other cases. Is there something simple I'm missing?/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/bin/ld: warning: cannot find
entry symbol module_start; defaulting to 0000000000000000
exports.o:(.rodata.sceRes ident+0x8): undefined reference to `module_start'
collect2: ld returned 1 exit status
-Aura
-
12-28-2008, 02:09 PM #9415xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
@slicer i know it asks for idstorage.prx but you have to place fixitpsp.prx ~NOT~ idstorage, if it still doesnt work it cant load it for some reason
!~SlasheR~!Geändert von slasher101 (12-28-2008 um 02:23 PM Uhr)
-
12-28-2008, 03:02 PM #9416QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
i know, i've done both in that folder, but it won't load, sorry, your probably going to need to borrow your friend's phat and see if this well even work for phats(don't see why not, but you never know)
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
-
12-28-2008, 03:53 PM #9417xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
yep ok =),
ive been playing around a bit and found this peice of code compiles but...
nothing gets shown on screen at runtime
plz helpCode:// Hello World - My First App for the PSP /* This program was created by (Your Name Here) on (Date Here) It is a simple "Hello World" Application. */ #include <pspkernel.h> #include <pspdebug.h> #include <pspctrl.h> #define printf pspDebugScreenPrintf #define settextcolor pspDebugScreenSetTextColor #define setbackcolor pspDebugScreenSetBackColor #define clearscreen pspDebugScreenClear PSP_MODULE_INFO("Scroller", 0, 1, 5); /* Exit callback */ int exit_callback(int arg1, int arg2, void *common) { sceKernelExitGame(); return 0; } /* Callback thread */ int CallbackThread(SceSize args, void *argp) { int cbid; cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL); sceKernelRegisterExitCallback(cbid); sceKernelSleepThreadCB(); return 0; } /* Sets up the callback thread and returns its thread id */ int SetupCallbacks(void) { int thid = 0; thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0); if(thid >= 0) { sceKernelStartThread(thid, 0, 0); } return thid; } void fixtext(int at) { pspDebugScreenClear(); if(at==1) { settextcolor(0x00FF0000); printf("1\n"); settextcolor(0x000000FF); printf("2\n3"); } else if(at==2) { settextcolor(0x000000FF); printf("1\n"); settextcolor(0x00FF0000); printf("2\n"); settextcolor(0x000000FF); printf("3"); } else if (at==3) { settextcolor(0x000000FF); printf("1\n2\n"); settextcolor(0x00FF0000); printf("3"); } } int main() { pspDebugScreenInit(); SetupCallbacks(); SceCtrlData pad; int at = 1; sceCtrlReadBufferPositive(&pad, 1); pspDebugScreenSetTextColor(0x00FF0000); while(1) { if(pad.Buttons & PSP_CTRL_UP) { at += 1; fixtext(at); } if(pad.Buttons & PSP_CTRL_DOWN) { at -= 1; fixtext(at); } } sceKernelSleepThread(); return 0; }
!~SlasheR~!
-
12-28-2008, 05:08 PM #9418I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
No delays, you're running through that loop probably 200 times before you remove your finger, thus thats + or - 200. You have no delay/checks to allow you to stop pressing the button, nor do you have any limits (I.E. at = 4 which isn't supported).
-Aura
EDIT:
Also, your method is going to get you seriously bogged down with code if you add lots of possibilities, something like this would be preferable:
notice how the code would be significantly smaller? It makes stuff like this easier to search through, because believe me, when you have files with over 5000 lines of code seeing a function like yours becomes annoyingCode:void fixtext(int at) { for(int loop = AT_MIN; loop < AT_MAX; loop++) { if(loop == at) { settextcolor(0x00FF0000); } else { settextcolor(0x000000FF); } printf("%i"\n, loop); /* or if you are using non-integer values as options use if statements or switches (although I dislike switches as people commonly forget the break and mess up their code) if(loop == 1) { printf("option 1\n"); } if(loop == 2) { printf("option 2\n"); } */ } }
-Aura
-
12-28-2008, 05:14 PM #9419xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
thanks and how would i fix it?
and as for your prob
Code:PSP_EXPORT_START(flashPatch, 0, 0x0) PSP_EXPORT_FUNC(something_HERE) PSP_EXPORT_END
-
12-28-2008, 05:17 PM #9420I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Check my post for some shortening code bits...
Search on here for lastpad methods, or you could use sceKernelDelayThread(int delay); although that method still leaves chance for an exceptionally slooooooow person to still hit the button.
My question was about a function defined already, its asking for module_start which is define in both the source and the exports already. Re-read the post to see my problem.
-Aura


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