View Single Post
Old 29 December 2013, 09:09   #17
Toni Wilen
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,552
Originally Posted by FrodeSolheim View Post
Example C code, Amiga side:

char data[64];
int library = uni_load_library("hello_world_library");
int function = uni_get_function(library, "hello_world");
uni_call_1(function, UNI_SYNCHRONOUS, &data);
/* data now contains the string "Hello, World!" */
This is exactly what I meant and wanted! Real and transparent API, with possibility to validate at least part of parameters, not some "lets pass random registers that goes to specifically prepared x86 code, if even one thing is wrong, everything blows up"


Patching loadlibrary and friends is ugly (trying to merge too different worlds) but there could be virtual standard amiga library (added by UAE boot rom if virtual calls are allowed) that has above functions, all other "nice to have" helper functions, and helper data in library data area and so on. Also no need for Amiga side assembly code, all Amiga compilers support library calls directly if required header files are included.

Version check would be also become automatic, just increase library version number when needed.
Toni Wilen is online now  
Page generated in 0.03958 seconds with 10 queries