29 August 2016, 17:38 | #1 |
Posts: n/a
|
Best way to write native code?
Long time lurker, new member here. Thanks for FS-UAE, it's an amazing piece of software.
Enough kissing up though, I have a question about writing native code libraries. I've looked at the uni-sdk and that seems good for a lot of tasks, but is there a way to call back into 68k code with it? Also, does the emulation continue to run while my native code is running or does it pause? Is the old complicated way of writing native code still the best way? What are the limitations there? Thanks |
31 August 2016, 21:52 | #2 | ||||
FS-UAE Developer
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
|
Quote:
Fair enough Quote:
Quote:
(If you call into uaenative.library more directly, e.g. via assembly, you can also choose to run the native code synchrously, pausing the UAE emulation until the native code returns. You can also pass more parameters via registers this way. The Amiga-side UNI C header presents simplified functionality, because in many cases you are better off using a struct to pass complex arguments). Quote:
* The old way is WinUAE-only. * It only works with 32-bit code, it isn't 64-bit safe. * It gives you access to the WinUAE hwnd object (though this can be added to the new native code system if needed). The uaenative.library hasn't really changed since the initial release, mostly since it hasn't (as far as I know) seen any real usage. The interface will not be extended until there is a known use-case for it |
||||
01 September 2016, 11:24 | #3 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
I am starting to think that native support should use hardware level emulated board to make it much much easier to support in any Amiga compatible OS. No need for annoying UAE traps.
It can be normal Z2 or Z3 autoconfig board, that you find using usual library calls, then allocate it, for example by reading from single IO address, you get back offset to your IO region. (or null if nothing available). Write commands to some IO region, you get back something. Free the board when not needed anymore. |
02 September 2016, 18:53 | #4 |
Registered User
Join Date: Sep 2011
Location: Paris/France
Posts: 278
|
Hello
>native support should use hardware level emulated board Nice :-) is it planned for a next release ;-) soon ? :-) BTW @Frode : native.library should be enhanced to be usable with OS4/WinUAE-ppc ... Keep on the good works Alain |
02 September 2016, 19:53 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
|
OS4 support can become either really tricky or really slow because there is no 1:1 address mapping. Logical address sent to native side is useless under OS4.
Slow would equal "indirect" trap system where "bounce buffer" is needed, instead of directly using some memory address (which is not going to work because logical address won't be same as physical), data is first copied to hardware board address (because it is hardware board, it has logical == physical mapping), then "other side" can read it. And vice versa. Obviously it is much slower than direct access. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
native x86 code in WinUAE? | Falk | support.WinUAE | 20 | 21 January 2023 18:30 |
FS-UAE Native Code? | jdog320 | support.FS-UAE | 2 | 26 July 2016 11:03 |
Native (UAE) DataTypes | Roland007 | request.UAE Wishlist | 5 | 11 February 2013 05:44 |
How about Native Client? | mc6809e | request.UAE Wishlist | 20 | 05 February 2012 12:49 |
3D code and/or internet code for Blitz Basic 2.1 | EdzUp | Retrogaming General Discussion | 0 | 10 February 2002 11:40 |
|
|