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 Archaemic Why modify file? Code: void load_file(const char *file) { int namelen = strlen(file) if(strcasecmp(file+namelen-4,".pbp")==0) { /*Load eboot*/; ...
-
08-26-2007, 12:33 PM #6241QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- USA SC/NC
- Beiträge
- 699
- Points
- 5.712
- Level
- 48
- Downloads
- 0
- Uploads
- 0
My mistake. Thats a much better method than what I posted
Zitat von Archaemic
[CODE]Random Facts:
irc://irc.malloc.us #wtf #**********
[/CODE]
[SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]
-
08-26-2007, 02:34 PM #6242I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Argh, thats so simple... I was expecting something complex...
Zitat von Archaemic
Well anyway, I was using strrchr when I was crashing, I guess I'll take another look at using it.
-Aura
Ok, I have my code sort of working, I can drop down a directory as long as its not to the root, when I try and go from, say, ms0:/PSP to ms0: I get error 80010016 because its trying to access ms0:^û?.Geändert von Auraomega (08-26-2007 um 03:28 PM Uhr)
-
08-26-2007, 05:15 PM #6243It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Sounds like you don't have a string properly terminated to me.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
08-26-2007, 05:18 PM #6244
Back a while ago I wrote a simple memory stick file browser, its in the source code repository at psp-programming. It's not very well written or commented but maybe worth a look as it was capable of going up and down directories.
Zitat von Auraomega
Yeah I agree, make sure the last character of the string is a null char.Sounds like you don't have a string properly terminated to me.
-
08-27-2007, 06:56 AM #6245I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Sorry, I sorted that problem last night, but I've been having various problems with the net so I've not been able to change my post.
Thanks anyway
-Aura
How would I go about loading an EBOOT or a prx, when I have no idea what memory its going to be in. I've tried using sceKernelLoadModule and starting it, but at that point I crash. When using the SDK version, I can't choose between kernel and user, it has to be one or the other and I was wondering if there was a simple solution to get around that?Geändert von Auraomega (08-27-2007 um 10:28 AM Uhr)
-
08-28-2007, 05:59 AM #6246Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
is it possible to write a function that when you set your psp in stand-by , it automaticly wake up after an hour or something?
-
08-28-2007, 08:06 AM #6247QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- Cape Town, South Africa
- Beiträge
- 714
- Points
- 5.795
- Level
- 49
- Downloads
- 0
- Uploads
- 0
Yes, not sure how though. Time Baby uses "Adrahils's alarm library", whatever that is.
-
08-28-2007, 08:25 AM #6248Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
no time baby doesnt wake up , just tested it
-= Double Post =-
was wrong , you are suposed to press select to activate itGeändert von hallo007 (08-28-2007 um 08:46 AM Uhr) Grund: Automerged Doublepost
-
08-28-2007, 09:34 AM #6249I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
You could do a psudo stand-by...
Zitat von hallo007
Disable all the buttons, turn off the screen, underclock the PSP, turn off the volume etc etc, then using the time library, add 1 hour to that and tell it to undo everything, clock the PSP at 222mhz again or what ever.
If you want to be REALLY cleaver, I think you can also turn off the power LED, I'm not sure though as it always crashed when I attempted...
-Aura
-
08-28-2007, 11:46 AM #6250QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
or maybe he can ask where to find alarm library
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-28-2007, 01:51 PM #6251Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
I dont want to make a alarm , I just looking to get the psp out of standby
-
08-28-2007, 02:04 PM #6252QJ Gamer Bronze

- Registriert seit
- Jun 2006
- Beiträge
- 144
- Points
- 7.047
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Well, the alarm is actually what wakes it up from standby and executes any piece of code you need straight after. My lib does not do the sound, but just calls TimeBaby's alarm function when the PSP wakes up at a given time.
Zitat von hallo007
Adrahil - Software architect and specialist in Reverse Engineering.
Spoiler for Guilt of a Dev:
Spoiler for me:
-
08-29-2007, 01:53 AM #6253Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
k , thnx
This code should let the psp load the registry files from ms0:/ but it doesn't work
any suggestions?Code:PSP_MODULE_INFO("test", 0x1000, 1, 1); int mainThread(SceSize argc, void* argv) { sceIoUnassign("flash1:"); sceIoAssign("flash1:","msstor0p1:","fatms0:",IOASSIGN_RDWR,NULL,0); sceKernelSleepThread(); return 0; } int module_start(SceSize args, void *argp) { SceUID thid; thid = sceKernelCreateThread("MainThread", mainThread, 0x18, 0x1000, 0, NULL); if (thid >= 0) sceKernelStartThread(thid, args, argp); return 0; } int module_stop(void) { return 0; }
-
08-29-2007, 04:19 AM #6254QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
lol you thought it was for alarms only :)
Zitat von hallo007
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-29-2007, 04:43 PM #6255
Alright, I need help (if you would, please)..
This is my code:
The first time I run the code, it will bring up one of the two menus if I put either 1 or 2 in.Code:cout << "What would you like to do?\n1: Make a teleport\n2: Make some text appear on screen\nSimply type in the number of the option you want and hit Enter!" << endl; cin >> menu; getchar();
Now, if I then bring up the menu, output a code, and then try to type 1 or 2 again to bring up the menu, it simply closes my window :S
Anyone help? (I'm running this on my PC, btw.)Atheist, because I just won't believe in what doesn't show itself to me.
-
08-29-2007, 05:41 PM #6256QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
1. Post the full code.
2. Learn how to use the debugger to source problems. The program may have crashed or there is a logic loop problem where an exit condition is given.
http://www.gamedev.net/reference/art...rticle2322.asp[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]
-
08-29-2007, 05:44 PM #6257QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Why post computer C++ code on a PSP coding forum? There are plenty of big coding forums out there.
Example:
http://www.cpplc.net/forum/index.php
-
08-29-2007, 05:47 PM #6258
Cus I <3 QJ. :P
And it isn't that much of a difference when talking about my problem.Atheist, because I just won't believe in what doesn't show itself to me.
-
08-29-2007, 06:50 PM #6259.info

- Registriert seit
- Jun 2006
- Ort
- ACT, Australia
- Beiträge
- 1.674
- Points
- 15.395
- Level
- 80
- Downloads
- 0
- Uploads
- 0
I've just installed the PSPSDK and cygwin and successfully compiled a helloworld, but when i try to compile the PRX sample i get this error:
EDIT: NVM, fixed it.
Zitat von Error
Geändert von Yongobongo (08-29-2007 um 07:32 PM Uhr)
-
08-29-2007, 08:49 PM #6260
People will be willing to help if you show a bit of code, without it no one will know what you prob is.
Zitat von Durka Durka Mahn
-
08-29-2007, 11:31 PM #6261QJ Gamer Bronze

- Registriert seit
- Jun 2006
- Beiträge
- 144
- Points
- 7.047
- Level
- 55
- Downloads
- 0
- Uploads
- 0
hallo007: It does not work because the flash devices are blacklisted from reassignment.
Adrahil - Software architect and specialist in Reverse Engineering.
Spoiler for Guilt of a Dev:
Spoiler for me:
-
08-30-2007, 04:05 PM #6262I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I decided to try learning how to hook functions today after putting it off for ages. I've been looking at the apiHook.c file from the PSPLink source, I'm no good at reading others source codes, and I don't think I understand any of it, or how any of it actually works.
Is there any simple peices of code out there, in which all it does is hook a single function? If not, can someone do a "Hook for dummies" sort set of instructions for me, because there seems very limited help from what I've found on internet.
Your perfect chance to treat me like a total moron and get thanked for it :ROFL:
-Aura
-
08-31-2007, 02:23 AM #6263Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
I need the argumetns for assign "disc0:/"
what's dev2 and dev3 for disc0:/???Code:/** * Assigns one IO device to another (I guess) * @param dev1 - The device name to assign. * @param dev2 - The block device to assign from. * @param dev3 - The filesystem device to mape the block device to dev1 * @param mode - Read/Write mode. One of IoAssignPerms. * @param unk1 - Unknown, set to NULL. * @param unk2 - Unknown, set to 0. * @return < 0 on error. * * @par Example: Reassign flash0 in read/write mode. * @code * sceIoUnassign("flash0"); * sceIoAssign("flash0", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0); * @endcode * */ int sceIoAssign(const char *dev1, const char *dev2, const char *dev3, int mode, void* unk1, long unk2);
-
08-31-2007, 03:46 AM #6264.info

- Registriert seit
- Jun 2006
- Ort
- ACT, Australia
- Beiträge
- 1.674
- Points
- 15.395
- Level
- 80
- Downloads
- 0
- Uploads
- 0
Is it possible to blit images in the VSH?
I'm trying to use
but it won't work in the VSH, it just shows a white boxCode:blitAlphaImageToScreen(0, 0, height, width, Image*, posX, posY);

Or is there some way i should do it with the GU?
Sorry if i sound nooby, i only started C a couple of days ago
-
08-31-2007, 04:58 AM #6265Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
use pspjunkie's DSX
-
08-31-2007, 05:57 AM #6266QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
that doesnt have function for image blitting
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-31-2007, 06:04 AM #6267Avada Kedavra

- Registriert seit
- May 2007
- Ort
- Spain
- Beiträge
- 703
- Points
- 6.813
- Level
- 54
- Downloads
- 0
- Uploads
- 0
Vshblitter.
-
08-31-2007, 06:04 AM #6268Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
it has a function for blitting image DATA , hasnt it?
-
08-31-2007, 06:25 AM #6269QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
from read me:
"At the current point in time,
DSX has the ability to draw text to the screen and draw simple shapes."[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-31-2007, 06:35 AM #6270Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
then I was wrong


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