forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Calling functions from another source file, help please

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sg57



Joined: 14 Oct 2005
Posts: 154

PostPosted: Mon Jan 30, 2006 8:39 am    Post subject: Calling functions from another source file, help please Reply with quote

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
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Mon Jan 30, 2006 12:48 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
HaQue



Joined: 25 Nov 2005
Posts: 91
Location: Adelaide, Australia

PostPosted: Mon Jan 30, 2006 1:09 pm    Post subject: Reply with quote

I think it should be:

in game.c :
Code:
#include game.h


in main.c:
Code:
#include game.h


or

in main.c :
Code:
#include game.c


in game.c :
Code:
#include game.h


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
View user's profile Send private message Send e-mail Visit poster's website
sg57



Joined: 14 Oct 2005
Posts: 154

PostPosted: Mon Jan 30, 2006 1:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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