Zeige Ergebnis 9.001 bis 9.030 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; Where does it belong?...
-
08-29-2008, 11:30 PM #9001QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Where does it belong?
[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
08-30-2008, 01:36 AM #9002lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
When you download oslib it should come with a .bat file that will install it.
IIRC you had to edit it to install in the right drive as it installed in D. So normally you would change it to install it to C:\pathToSdk
-
08-30-2008, 06:38 AM #9003QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Ok, dont know where i downloaded it. Can someone post a good link?
[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
08-30-2008, 07:01 AM #9004
Use Google. Seriously you will find it easily just search oslib.
My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-30-2008, 07:02 AM #9005QJ Gamer Platinum
- Registriert seit
- Feb 2006
- Ort
- National Front Disco
- Beiträge
- 13.057
- Points
- 66.627
- Level
- 100
- Downloads
- 0
- Uploads
- 0
-
08-30-2008, 07:10 AM #9006Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
-
08-30-2008, 07:34 AM #9007My Releases:
---------------------------------------------------
[URL="http://forums.qj.net/showthread.php?t=145654"]ROFLFlasher[/URL]
[URL="http://forums.qj.net/showthread.php?t=144892"]DTS MGS Edition[/URL]
[URL="http://forums.qj.net/showthread.php?t=143735"]Arkanoid Deluxe Beta[/URL]
[URL="http://forums.qj.net/showthread.php?p=2144700#post2144700"]SAVIOR![/URL]
-
08-30-2008, 07:48 AM #9008QJ Gamer Blue
Achievements:
- Registriert seit
- Aug 2008
- Beiträge
- 6
- Points
- 2.316
- Level
- 29
- Downloads
- 0
- Uploads
- 0
harlo.. new here
hi hi :)
those guys at psp-hacks forum ignored me... T.T I am moving here for good... WOOO!
They didn't seem to answer any of my questions at all no replies.. anyway not a ranting thread lolz.
Have been using OSLIB for awhile, this is my first psp homebrew >.< don't laugh :ROFL:
Anyway.. how lag is 4.810 for the benchmark test inside Oslib version 2?

I am currently making a ragdoll style game. Because I suck at drawing so much, drawing so many frames to just make 1 character move is too much for me... Gonna have tons and tons of them. But the bad thing is psp's limitation. Not sure if it could take it though.

made that character through body parts, the parts are attached to body points. The parts rotate as well that is why it is lagging.
So my question will be is 4.810 lag? And why does it crash when I mirror the image horizontally? It can mirror if I don't rotate the images but crash if I mirror it. mirroring them vertically after or before rotation has no problem though... I wonder if OSLIB is buggy...
if it is that laggy and buggy, should i stop using OSLIB and start programming in its own c++ language using graphics.h?
-
08-30-2008, 08:58 AM #9009QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
What do you mean by 4.810 lag? FPS?
And don't switch from OSLib to graphics.c/h, your program will get even slower.
-
08-30-2008, 09:15 AM #9010QJ Gamer Blue
Achievements:
- Registriert seit
- Aug 2008
- Beiträge
- 6
- Points
- 2.316
- Level
- 29
- Downloads
- 0
- Uploads
- 0
because oslib has a benchmarkshow();
something like that. but i am not too sure if it is frames per second of anything like that. It says if it goes beyond 16 then 60 fps is impossible
-
08-30-2008, 09:29 AM #9011QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
ehm...:
Spoiler for spoiler:Geändert von Moose (08-30-2008 um 12:58 PM Uhr) Grund: Fixed spoiler
[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
08-30-2008, 12:51 PM #9012words 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
Monkit I assure you it isn't an Oslib problem, you'll need to post some code, it'd help if you could debug it with PSPLink and trace it back to the exact line causing the crash...

...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
-
08-30-2008, 02:14 PM #9013QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
That's a compilation error, SG.
-
08-30-2008, 03:07 PM #9014Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
Looks like you need to link -lmmio.

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
08-30-2008, 11:44 PM #9015QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Hmm.. There isnt anything wrong with this code isnt it?
Code:#include <pspkernel.h> #include <pspdebug.h> #include <pspctrl.h> #include <psppower.h> PSP_MODULE_INFO("HelloWorld", 0, 1, 0); PSP_HEAP_SIZE_MAX(); int main() { SceCtrlData pad; sceCtrlReadBufferPositive(&pad, 1); //int statement = (pad.Buttons & PSP_CTRL_SQUARE) && (pad.Buttons & PSP_CTRL_TRIANGLE); if(pad.Buttons & PSP_CTRL_SQUARE) { //dosomething } else { //dosomething } sceKernelSleepThread(); return 0; }(PRX)Code:TARGET = LockedUP OBJS = main.o CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) BUILD_PRX = 1 PSP_FW_VERSION = 401 LIBDIR = LDFLAGS = STDLIBS= -lpspsdk -lpspctrl -lpsppower LIBS=$(STDLIBS)$(YOURLIBS) EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = LockedUP PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak
But why does it crash?[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
08-31-2008, 12:28 AM #9016
It doesn't look like you've created the threads.
-
08-31-2008, 12:45 AM #9017QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
You mean the callback stuff?
[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
08-31-2008, 06:45 AM #9018I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
What he means is that you can't just put BUILD_PRX=1 in your Makefile and use the same code. Some of the code has to be tweaked so it will actually function as a PRX. Google how to make one, and you should find a tutorial. It isn't that much harder, but there are a few key components that you need.

-
08-31-2008, 09:00 AM #9019QJ Gamer Blue
Achievements:
- Registriert seit
- Aug 2008
- Beiträge
- 6
- Points
- 2.316
- Level
- 29
- Downloads
- 0
- Uploads
- 0
I don't know how to use psplink

But i placed oslDebug(); between each line to figure out what went wrong.
And I found that OSlib cannot draw horizontal mirrored images whose center X, Center Y and angle is not 0.
I did this, it works. but if you change the angle or centerX or centerY, they crash at the drawing part. You can mirror but unable to draw it out. It is mirroring the tile.Code:oslSetImageTileSize(TileSet,DrawX,DrawY,Set_W-Set_Fix,Set_H-Set_Fix); if(FacingRight == false) { oslDebug("centerX = %d, centerY = %d, angle = %d", TileSet->centerX, TileSet->centerY,TileSet->angle); oslDebug("attempt to make center back to origin"); TileSet->centerX=0; TileSet->centerY=0; TileSet->angle=0; oslDebug("Current centerX = %d, centerY = %d, angle = %d", TileSet->centerX, TileSet->centerY,TileSet->angle); oslDebug("Mirroring TileSet next"); oslMirrorImageH(TileSet); oslDebug("mirror completed, testing draw mirror next, hope it works"); oslDrawImage(TileSet);}
The whole engine works perfectly fine, able to move left, right, up, down and buttons and stuff. But if I just try to mirror horizontally the TileSet when its center is not 0 and angle is not 0, it crashes upon drawing. Mirror vertical has no problems though.
could I send you the cpp file and help me do a psplink check? :humped: still think it is with oslib though.Geändert von Monkit (08-31-2008 um 11:23 AM Uhr)
-
08-31-2008, 02:23 PM #9020I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
So, I found this random number function, but it doesn't seem to work. It always puts out the same number. Any ideas? :ROFL:
Code:int getRandomNumber() { return 3; }
-
08-31-2008, 02:51 PM #9021
- Registriert seit
- Apr 2008
- Beiträge
- 47
- Points
- 2.658
- Level
- 31
- Downloads
- 0
- Uploads
- 0
Is the number a random integer between 2 and 4 exclusive?
Try this one, it'll be more random within that range:
XDCode:int getRandomNumber() { return (rand() % 1) + 3; }
-
08-31-2008, 06:37 PM #9022QJ Gamer Blue
Achievements:
- Registriert seit
- Aug 2008
- Beiträge
- 26
- Points
- 2.426
- Level
- 29
- Downloads
- 0
- Uploads
- 0
Hey, can someone post a screen shot function?
-
08-31-2008, 07:08 PM #9023OMFG

- Registriert seit
- Jul 2005
- Ort
- Toronto
- Beiträge
- 2.814
- Points
- 19.453
- Level
- 88
- Downloads
- 0
- Uploads
- 0
Make sure you put a loop around your button input, otherwise it will just run through it once and then sleep the thread. You also haven't declared your callbacks, so pressing the HOME button will do nothing.
-=Double Post Merge =-
The only real difference is that when making a prx, the default stack is something like only 64kb. He addressed this though by making the default heap size to max.Geändert von Slasher (08-31-2008 um 07:10 PM Uhr) Grund: Automerged Doublepost
-
08-31-2008, 09:42 PM #9024QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
I've got it working already.
@above, I want it to be jst once on starup, like the recovery menu ;)[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
09-01-2008, 06:47 AM #9025I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
-
09-01-2008, 07:04 AM #9026QJ Gamer Bronze
- Registriert seit
- Nov 2007
- Ort
- Finland
- Beiträge
- 846
- Points
- 5.309
- Level
- 46
- Downloads
- 0
- Uploads
- 0
-
09-01-2008, 07:27 AM #9027QJ Gamer Bronze

- Registriert seit
- Sep 2006
- Ort
- france
- Beiträge
- 170
- Points
- 6.359
- Level
- 52
- Downloads
- 0
- Uploads
- 0
you have your answer don't you? if it goes beyond 16 it's lagging, but oslib lets you configure frameskip so even at that point it's ok, 30fps is not bad.
I think that this number is the time in ms that your frame is taking to complete:
1000/60 = 16.666...
the 4.8 you have is really low you're not even close to a lag point.
-
09-01-2008, 07:58 AM #9028QJ Gamer Silver
- Registriert seit
- Sep 2006
- Ort
- Perth, Scotland
- Beiträge
- 1.094
- Points
- 8.475
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Code:int GetRandom(int min, int max) { SceKernelUtilsMt19937Context ctx; u32 tick = sceKernelGetSystemTimeLow(); sceKernelUtilsMt19937Init(&ctx, (u32)tick); return ((min + sceKernelUtilsMt19937UInt(&ctx)) % div); }
-
09-01-2008, 08:03 AM #9029QJ Gamer Blue
Achievements:
- Registriert seit
- Aug 2008
- Beiträge
- 6
- Points
- 2.316
- Level
- 29
- Downloads
- 0
- Uploads
- 0
anyone can help mi fix the tiling->mirror->centreX&Y->rotate and will not crash problem?
if can't then would:
compare to using tileset and cutting out all the tiles into 35x35 images and frequent loading and unloading them (.png), which one will have a better effect on the speed of the homebrew? (1 tileset compared to 7 images, or maybe even 14)
-
09-01-2008, 12:51 PM #9030QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Bad. You are initialising the random number generator every time you call GetRandom. This will give you skewed numbers and depending on what the Init function call does, expensive especially if called multiple times per frame.
In addition:
div is undeclared and the logic is incorrect in getting a number between min and max.Code:return ((min + sceKernelUtilsMt19937UInt(&ctx)) % div);
Edit: Warning, untested code:
Code:class RandomNumberGenerator { public: explicit RandomNumberGenerator( u32 seed ) { sceKernelUtilsMt19937Init( &m_MtContext, seed ); } s32 GetNumber( s32 min, s32 max ) { if( min >= max ) { return min; } s32 difference = max - min + 1; s32 randNum = static_cast<s32>( sceKernelUtilsMt19937UInt(&m_MtContext) % difference); return (randNum + min); } private: SceKernelUtilsMt19937Context m_MtContext; }; int main() { // General PSP initialisation stuff // RandomNumberGenerator randomNumberGenerator( sceKernelGetSystemTimeLow() ); while( some_flag ) { randomNumberGenerator.GetNumber( 0, 10 ); randomNumberGenerator.GetNumber( 1, 10 ); } }Geändert von yaustar (09-01-2008 um 01:06 PM Uhr)
[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]


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