Modules/USB - Working on USB support again
[tpg/acess2.git] / AcessNative / ld-acess_src / binary.c
index d3dee99..3ae8d7f 100644 (file)
@@ -96,7 +96,7 @@ void *Binary_LoadLibrary(const char *Name)
 {
        char    *path;
        void    *ret;
-        int    (*entry)(int,char*[],char**) = NULL;
+        int    (*entry)(void *,int,char*[],char**) = NULL;
 
        // Find File
        path = Binary_LocateLibrary(Name);
@@ -108,6 +108,7 @@ void *Binary_LoadLibrary(const char *Name)
        }
 
        ret = Binary_Load(path, (uintptr_t*)&entry);
+       printf("LOADED '%s' to %p (Entry=%p)\n", path, ret, entry);
        free(path);
        
        #if DEBUG
@@ -118,7 +119,7 @@ void *Binary_LoadLibrary(const char *Name)
                #if DEBUG
                printf("Calling '%s' entry point %p\n", Name, entry);
                #endif
-               entry(0, argv, NULL);
+               entry(ret, 0, argv, NULL);
        }
 
        return ret;
@@ -239,7 +240,7 @@ int Binary_GetSymbol(const char *SymbolName, uintptr_t *Value)
                }
        }
        
-       // TODO: Search list of loaded binaries
+       // Search list of loaded binaries
        for(bin = gLoadedBinaries; bin; bin = bin->Next)
        {
                if( !bin->Ready )       continue;

UCC git Repository :: git.ucc.asn.au