| View previous topic :: View next topic |
| Author |
Message |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sat Sep 15, 2007 11:56 pm Post subject: [Claritin Clear!] Importing Vars from export modules |
|
|
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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sun Sep 16, 2007 7:35 am Post subject: |
|
|
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 |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sun Sep 16, 2007 7:48 am Post subject: |
|
|
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 |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Sun Sep 16, 2007 10:31 am Post subject: |
|
|
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 |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sun Sep 16, 2007 11:35 am Post subject: |
|
|
| 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 |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Mon Sep 17, 2007 4:43 am Post subject: |
|
|
| ^above |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Mon Sep 17, 2007 5:20 am Post subject: |
|
|
| 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 |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Mon Sep 17, 2007 5:28 am Post subject: |
|
|
| 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 |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Mon Sep 17, 2007 5:32 am Post subject: |
|
|
1 last thing, wont that function work either?
and I ve asked this several times too. No one specifically said anything. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Mon Sep 17, 2007 5:53 am Post subject: |
|
|
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 |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Mon Sep 17, 2007 6:14 am Post subject: |
|
|
| 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 |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Mon Sep 17, 2007 7:04 am Post subject: |
|
|
| 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 |
|
 |
|