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 

[Claritin Clear!] Importing Vars from export modules

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



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sat Sep 15, 2007 11:56 pm    Post subject: [Claritin Clear!] Importing Vars from export modules Reply with quote

What would I use in place of IMPORT_FUNC?

Checked pspimport.s, it only lets you import functions...

EDIT 1:
======
Will using libsFindExportAddrByNid to find the real address and creating a pointer to it work?


Last edited by KickinAezz on Mon Sep 17, 2007 8:57 am; edited 8 times in total
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Sep 16, 2007 7:35 am    Post subject: Reply with quote

As I understand it, you don't. Importing variables isn't supported right now. The way to handle that is to make accessor functions. If you have a variable called myDumbVar, access it by making functions like
Code:
int GetMyDumbVar(void)
{
    return myDumbVar;
}

void SetMyDumbVar(int val)
{
    myDumbVar = val;
}
Back to top
View user's profile Send private message AIM Address
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sun Sep 16, 2007 7:48 am    Post subject: Reply with quote

I would definately do such basic things if it was my module.

but I was referring to FW modules like Vshmain, which happens to export one of its vars, which I am curious to play around with.
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Sun Sep 16, 2007 10:31 am    Post subject: Reply with quote

but not supported in PSPSDK currently tho thats what he means
accesor functions is all you can do for now and there is no loss if you just inline the calls
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sun Sep 16, 2007 11:35 am    Post subject: Reply with quote

dot_blank wrote:
but not supported in PSPSDK currently tho thats what he means
accesor functions is all you can do for now and there is no loss if you just inline the calls

oh! Hope to see some progress in future. Meanwhile,

[Q] Will that libsFind... func work? coz, it returns 0 as address.

[Q] And what did u mean by inline something?
Becz what u said wasnt clear.
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Mon Sep 17, 2007 4:43 am    Post subject: Reply with quote

^above
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Sep 17, 2007 5:20 am    Post subject: Reply with quote

As has been said a couple times now, you cannot import variables. It's just not in the SDK. For your OWN stuff, you use accessor functions and make them inline for no loss in speed (or very little loss). If you wish to add importing variables to the SDK, feel free.
Back to top
View user's profile Send private message AIM Address
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Mon Sep 17, 2007 5:28 am    Post subject: Reply with quote

J.F. wrote:
As has been said a couple times now, you cannot import variables. It's just not in the SDK. For your OWN stuff, you use accessor functions and make them inline for no loss in speed (or very little loss). If you wish to add importing variables to the SDK, feel free.
psss... :(
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Mon Sep 17, 2007 5:32 am    Post subject: Reply with quote

1 last thing, wont that function work either?

and I ve asked this several times too. No one specifically said anything.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Mon Sep 17, 2007 5:53 am    Post subject: Reply with quote

It isn't strictly a simple change to the SDK it requires slightly more complex changes to the actual toolchain. From what I recall an import entry for variables contains a list of fixups for the use in the code to point to the correct data. You might be able to get a lazy implementation by hard coding a single pointer reference but that is kinda nasty.

But yah feel free :P
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Mon Sep 17, 2007 6:14 am    Post subject: Reply with quote

TyRaNiD wrote:
You might be able to get a lazy implementation by hard coding a single pointer reference but that is kinda nasty.
But yah feel free :P

Last last thing. You dint actually say if it would work. [I reported that I got a 0 as the addr] [ but why? ]. I am afraid my effort is futile.
Let me know if it is suppozd to work. :)

Thanks.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Mon Sep 17, 2007 7:04 am    Post subject: Reply with quote

Well libs find probably wont work without modification only because it probably doesn't look for variables :) You _should_ be able to write something which does what you want it to in theory using similar code. Never found any of the variables anything exports to be obviously useful :)
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