[Claritin Clear!] Importing Vars from export modules
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
[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?
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.
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: Select all
int GetMyDumbVar(void)
{
return myDumbVar;
}
void SetMyDumbVar(int val)
{
myDumbVar = val;
}
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
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.
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
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
But yah feel free :P
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
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. [ but why? ]. I am afraid my effort is futile.
Let me know if it is suppozd to work. :)
Thanks.