View Single Post
Old 30 December 2013, 14:35   #29
FS-UAE Developer

FrodeSolheim's Avatar
Join Date: Dec 2011
Location: Førde, Norway
Age: 38
Posts: 3,545
Yes, byteswapping macros would still be needed in many cases. And perhaps it could even be a bit confusing for users when to use byte-swapping macros or not.

About UAE-generated Amiga-side stub libraries, they may not be *that* useful. Depending on how the native function definitions look like, a simple python script could instead be written to create a .c/.h and/or assembly stub library for the Amiga if one wants that. This requires that the low-level arguments passing details are fixed (my original plan) instead of possibly being changeable (details hidden by a UAE-provided caller helper library).

With register argument passing we can exploit the fact that C allows variable argument list (with cdecl calling convention), so we can still pass arguments as function arguments on the native side if people like that better than accessing everything via the uni struct, i.e:
UNIAPI void UNICALL add_numbers(struct uni *uni, uni_u32 c,
uni_u32 s, uni_u32 l, uni_u32 result)
as long as they are passed in the right order in the registers. (If the function is not decorated with some kind of prototype string, you'd still need to resolve Amiga pointer arguments like in the earlier examples).

Last edited by FrodeSolheim; 30 December 2013 at 14:56.
FrodeSolheim is offline  
Page generated in 0.04122 seconds with 11 queries