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; Ive had to resort to Lua, but ya im trying... Dont like it as it messes with my C syntax, ...
-
02-01-2007, 07:54 AM #2671words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Ive had to resort to Lua, but ya im trying... Dont like it as it messes with my C syntax, but its all good i guess.

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-01-2007, 09:17 AM #2672QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- Cape Town, South Africa
- Beiträge
- 714
- Points
- 5.795
- Level
- 49
- Downloads
- 0
- Uploads
- 0
Whenever I look at Lua code, the lack of semi-colons just jumps at me...
Zitat von SG57
-
02-01-2007, 10:24 AM #2673Heroes never die

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

any suggestions?
-
02-01-2007, 11:18 AM #2674QJ Gamer Silver
- Registriert seit
- Aug 2006
- Ort
- The Matrix
- Beiträge
- 1.090
- Points
- 8.002
- Level
- 60
- Downloads
- 0
- Uploads
- 0
dl all auto makes again in the cygwin setup
-= Double Post =-
mine freezes at thatCode:[email protected] ~/psptoolchain $ ./toolchain.sh --19:13:07-- ftp://ftp.gnu.org/pub/gnu/binutils/binutils-2.16.1.tar.gz => `binutils-2.16.1.tar.gz' Resolving ftp.gnu.org... 199.232.41.7 Connecting to ftp.gnu.org|199.232.41.7|:21... connected. Logging in as anonymous ...
Geändert von CoolRaccoon (02-01-2007 um 11:18 AM Uhr) Grund: Automerged Doublepost
http://i28.tinypic.com/1znoljt.png
lolololololol - Reach 100,000 Gamerscore
-
02-01-2007, 01:18 PM #2675QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von coolguy5678
im exactly the same way. i just can't do it.
-
02-01-2007, 03:16 PM #2676likes kittens....awww....
- Registriert seit
- Sep 2006
- Ort
- Detroit
- Beiträge
- 628
- Points
- 6.975
- Level
- 55
- Downloads
- 0
- Uploads
- 0
this is what im trying to do but it doesn't work you try it.
Zitat von MaTiAz
Code:#include <pspdisplay.h> #include <pspctrl.h> #include <pspkernel.h> #include <pspdebug.h> #include <pspgu.h> #include <png.h> #include <stdio.h> #include "graphics.h" PSP_MODULE_INFO("Image Display Program", 0, 1, 1); int main() { initGraphics(); Image* Wallpaper = "wall.png"; blitAlphaImageToScreen(0, 0, 480, 272, Wallpaper, 0, 0); flipScreen(); sceKernelDelayThread(3000000); if (Wallpaper!=NULL) freeImage(Wallpaper); sceKernelExitGame(); return 0; }
-
02-01-2007, 03:30 PM #2677words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
I wrote a tutorial how to get around that error at psp-programming.com.
Search through all the names of the threads ive created over there, and you should find it. I havent made too many over there, so....
-= Double Post =-
guy above me - you need to load the image properly:
I believe that would workCode:Image *Wallpaper = loadImage("image.png");Geändert von SG57 (02-01-2007 um 05:48 PM Uhr) Grund: Automerged Doublepost

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-01-2007, 05:00 PM #2678QJ Gamer Green
- Registriert seit
- Dec 2006
- Ort
- main();
- Beiträge
- 1.071
- Points
- 11.300
- Level
- 70
- Downloads
- 0
- Uploads
- 0
lol Ijmage....
Zitat von SG57
Code:Image *Wallpaper = loadImage("image.png");
-
02-01-2007, 05:48 PM #2679words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Wow... troll much?

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-02-2007, 07:37 AM #2680Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
how do you write to a file white hex edit
for example to offset -> 962c??
-
02-02-2007, 10:52 AM #2681Developer

- Registriert seit
- Feb 2006
- Ort
- Norway
- Beiträge
- 384
- Points
- 5.359
- Level
- 47
- Downloads
- 0
- Uploads
- 0
fseek(file, 0x962c, SEEK_SET);
Zitat von hallo007
If I backup my entire cygwin folder, reformat my computer then copy the cygwin folder back would cygwin work then? Or does it rely on some registry keys or other files or something that are created on instalation?
-
02-02-2007, 01:08 PM #2682QJ Gamer Silver
- Registriert seit
- Aug 2006
- Ort
- The Matrix
- Beiträge
- 1.090
- Points
- 8.002
- Level
- 60
- Downloads
- 0
- Uploads
- 0
sorry, but i need to post this:
WAHOO!!!!!!! CYGWIN JUST INSTALLED DA PSPTOOLCHAIN!!!!!!
[/sorry]http://i28.tinypic.com/1znoljt.png
lolololololol - Reach 100,000 Gamerscore
-
02-02-2007, 01:41 PM #2683Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
now its readed and how do you write then?
Zitat von Waterbottle
for example at that ligne stands P.H.O.T.O
and i want it I.M.A.G.E
-
02-02-2007, 01:58 PM #2684Developer

- Registriert seit
- Feb 2006
- Ort
- Norway
- Beiträge
- 384
- Points
- 5.359
- Level
- 47
- Downloads
- 0
- Uploads
- 0
fwrite... Theres no difference to writing normally, just move to the position in the file then write normally.
Zitat von hallo007
-
02-03-2007, 06:01 AM #2685Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
@waterbottle thnx
they just reinstalled cygwin and its still not working:s
Zitat von hallo007
-
02-03-2007, 12:13 PM #2686words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
hallo - your english is atrocious. Bad programming comes from poor typing skills, and your demonstrating very poor typing skills..
The past tense of 'read' is 'read'... Why take the energy and time to type something that is unneeded, in this case the 'ed'... Also, i suggest you GOOGLE! next time... Most of your questions are NOT PSP specific, there fore youd find an immense amount of information on the first page of a google search.
Your problem, automake isnt installing correctly, or even at all, during installation. Choose a different, more reliable mirror. I use the ftp from redhat mirror.
Also, is piracy so important to you that you need to bookmark a torrent search engine , and blatantly show it off?
One more thing - its a called 'cropping'... Might want to look it up.
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-03-2007, 02:08 PM #2687QJ Gamer Bronze

- Registriert seit
- Jul 2006
- Beiträge
- 90
- Points
- 4.912
- Level
- 44
- Downloads
- 0
- Uploads
- 0
um if you looked at his screenshot, it's sort of obvious that his main language isn't english. You really shouldn't criticize other people, especially when your own post contains just as many grammatical errors.
-
02-03-2007, 03:44 PM #2688words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Ok. Please, point out as many grammacical errors in my last post, to his.
Also, quit going off topic, atleast my post gave him an idea of how to fix his problem.
On Topic:
YOu may also consider using the PSPDevWin32 Intsaller if all elsefails, but it has a predefined set of libraries you can use, but its a last resort if cygwin + toolchain on your pc just dont want to mix
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-03-2007, 04:04 PM #2689QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
SG, enough criticism. I never know this side of you. Also, it's not YOu, it's You. Also, it's not grammacical error, it's grammatical. So stop criticizing, for it is not very hard to criticize you.
Zitat von SG57
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
02-03-2007, 11:31 PM #2690words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
super - Good point, my bad, sorry for typing too fast as my bid on ebay for a PSP just got outbid and was ending soon, so I accidentally capitalized the 'O' in 'You'. Really proves a point ;) As for grammatical and grammacical, my spelling isnt perfect, Ill admit that, but you atleast knew what I was saying, as my words were structured in a readable fashion, where as
"now its readed and how do you write then?
for example at that ligne stands P.H.O.T.O"
Is very hard, atleast for me, to make out... What is ligne (edit - just googled it and it turns out ligne is the french word for line, and is the name of a river ;) are you french hallo?) - it cant be a typo as 'g' is too far from 'n' and too far from 'i'... Im not bashing hallo for his broken english, rather hoping next time, he'll run his post through a [insert his native language] -> english converter, in hopes itll produce somewhat better results... Sorry if that came out wrong last time, or this time, its just that Ive seen many posts by hallo concerning programming, and his problem is almost always grammar (be it punctuation or spelling). So ya, sorry about earlier, little tense having to get only 8 hours asleep on the weekend :Argh:
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-04-2007, 04:27 AM #2691Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
no i am dutch ;)
-= Double Post =-
is there already a way found to load usb on 2.8+??Geändert von hallo007 (02-04-2007 um 04:27 AM Uhr) Grund: Automerged Doublepost
-
02-05-2007, 08:14 PM #2692words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
If the normal way doesnt work, than search around for a 2.8+ app that has it. Also, to dev for 2.8+ dont you need that special SDK built for custom firmware?
I have a little question. Ive made my own particle engine, and im proud of it. Now, I want the color of each particle to intensify when overlapping another, so i was thinking something like:
PUESDO CODE:
That should make it a more intense WHITE color when 2 particles overlap, and when they dont, it should dull out to the default particle color... Im doubting itll work, so im posting here. Does anyone have a good idea as to what i could do if this method doesnt work?Code:for i=0 to max_particles { for j=0 to max_particles { if i != j { // so you dontcompare one particle with itself if particle[i].x == particle[j].x and particle[i].y == particle[j].y { particle[i].red = particle[i].green = particle[i].blue = particle[j].red = particle[j].green = particle[j].blue += 3 } else if (particle[i].red > default_color_value) { particle[i].red = particle[i].green = particle[i].blue = particle[j].red = particle[j].green = particle[j].blue -= 3 } } } }
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-06-2007, 06:36 AM #2693QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
Don't do this. It's hard to manage and slow as hell.
Just use additive blending when drawing your particles. Depending on your render API, use sceGuBlendMode(GU_ADD, GU_FIX, GU_FIX, 0xFFFFFFFF, 0xFFFFFFFF) or the GL equvialent, or in software mode when drawing, just do something like that (pseudocode):
The ADDRGB macro depends on your other macros for getting channels from a color and mixing the channels back into a color type, plus the MIN macro which returns the smaller of the two parameters (prevents color component overflow). There are tricks with LUTs to do that color addition very quickly (2 shifts, 2 and, 1 add, 1 table lookup). If you're interested LMK.Code:#define ADDRGB( C1, C2 ) RGBA( MIN(255,A(C1)+A(C2)), MIN(255,R(C1)+R(C2)), MIN(255, G(C1)+G(C2)), MIN(255,B(C1)+B(C2)) ) function putpixel( x, y, color ) { *(FRAMEBUFFER+x+y*LINE_SIZE) = ADDRGB(*(FRAMEBUFFER+x+y*LINE_SIZE), color); }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.
-
02-06-2007, 08:23 AM #2694Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
the last SDK sample was for 2.71
Zitat von SG57
and i dont know any app's except the recovery:s
-
02-07-2007, 01:10 PM #2695Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
will this work ?? Is there a better way?
Code:char addline[200]=current_selection; FILE * prx; prx = fopen ("flash0:/kd/pspcnf_game.txt" , "r"); fseek(prx,SEEK_END , 0); fwrite(addline, sizeof(addline[0]), sizeof(addline)/sizeof(addline[0]), prx); fclose(prx);
-
02-07-2007, 03:17 PM #2696QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
http://www.cplusplus.com/fopen
Read that site and especially the opening modes.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.
-
02-07-2007, 06:18 PM #2697QJ Gamer Blue
- Registriert seit
- Jan 2007
- Ort
- U.S.
- Beiträge
- 405
- Points
- 7.014
- Level
- 55
- Downloads
- 0
- Uploads
- 0
Someone please help. I am trying to install the psptoolchain so I entered this into cygwin: ./toolchain.sh and get this error: "ERROR: Please make sure you have 'automake' installed. Any help will be appreciated, thanks.
-
02-07-2007, 06:43 PM #2698words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Reinstall the toolchain (more specifically 'automake' package) from a more reliable mirror. I persobally have used the FTP redhat mirror.
Raphael - Im using Lua (only until my PSP comes in the mail) so I can't use pointers, nor the shift operator (please correect me if im wrong... seriosuly! pllllleeeasee... id love to have these). Im sure there are work arounds, but Ill just wait for my PSP to arrive and get back to using PSPGL (i might move to the GU, but OpenGL is so portable, i can codeo n PC and quite quickly port it to work on the PSP)
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-08-2007, 03:22 AM #2699QJ Gamer Blue
- Registriert seit
- Jan 2007
- Ort
- U.S.
- Beiträge
- 405
- Points
- 7.014
- Level
- 55
- Downloads
- 0
- Uploads
- 0
I used http://ps2dev.org/psp/Tools/Toolchain/, is there a better place?
-
02-08-2007, 08:58 AM #2700QJ Gamer Silver

- Registriert seit
- Jan 2006
- Ort
- Germany
- Beiträge
- 926
- Points
- 14.087
- Level
- 77
- Downloads
- 0
- Uploads
- 0
There's no shift arithmetic involved in my code, unless you thought about the RGB macros. However, shifts are nothing else than multiplys or divides, depending on shift direction.
ie (x << 1 == x * 2) && (x >> 1 == x / 2). For every bit you shift, you divide/multiply by another 2, so shifting by 3 would mean mult/div by 8 (2^3).
So you can rewrite those macros into functions that do the conversion with multiplies.
For the pointer code, that was just a shortcut pseudo code for your actual PUTPIXEL/GETPIXEL function or whatever you use.Code:function RGB(r,g,b) return r*65536 + g*256 + b;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.


LinkBack URL
About LinkBacks
Mit Zitat antworten
should know how to do this

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