 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
sg57
Joined: 14 Oct 2005 Posts: 154
|
Posted: Mon Jan 30, 2006 8:39 am Post subject: Calling functions from another source file, help please |
|
|
ok, i have all my functions listed in a c source file called game.c and my main program in main.c, i have #included my game.c, i have made a header file but dont kno what to put in it hres what i put
| Code: | #ifndef GAME_H
#define GAME_H
int game();
#endif
|
in my game.c i have the function game(),
now when i call them from my main.c program, it doesnt give me an error but it does give me a blck screen when i try to run them on my psp nad hten 5 seconds later my psp shuts off, so could someone help me out here? o and also, i added game.o to the makefile |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Mon Jan 30, 2006 12:48 pm Post subject: |
|
|
You've probably got it right, but the reason it's doing that is because something you did in game() is crashing/locking up the PSP and the watchdog is shutting it down.
Jim _________________ http://www.dbfinteractive.com |
|
| Back to top |
|
 |
HaQue
Joined: 25 Nov 2005 Posts: 91 Location: Adelaide, Australia
|
Posted: Mon Jan 30, 2006 1:09 pm Post subject: |
|
|
I think it should be:
in game.c :
in main.c:
or
in main.c :
in game.c :
oh and game.o to the makefile, as you said, in both instances.
otherwise, post the main and game files (just the includes part)...
let us know the outcome, this would help others as well.
HaQue _________________ www.smartwave-wireless.com |
|
| Back to top |
|
 |
sg57
Joined: 14 Oct 2005 Posts: 154
|
Posted: Mon Jan 30, 2006 1:18 pm Post subject: |
|
|
HaQue thanks for your pep talk a while bakc, im seriously starting to get hings now, like at pspupdates, i learned how to make a menu with serious booleans going on, but i got it my 2nd try only because i forgot to blit the pointing image, anyway back on subject,
ok, it wasnt the game.c Jim, becuase i renamed it to main.c in another older and complied it fine with no error but i still ge thte black screen so maybe itll be that i dunno, im gonna keep trying tho and if it doesnt work ill try HaQues way
EDIT
ok i have got it working now, turned out my lucky guesing when it comes to header files and function geussing calling made it work, turns out the way i had mine the entire time worked, it was as jim said my game.c had an error but it wasnat coding error lol it was the name of thebackround so i fixed it its all cool now, atleast i now kno how to erpeat the entire game nwo thanksguyz |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|