English Amiga Board


Go Back   English Amiga Board > Support > support.FS-UAE

 
 
Thread Tools
Old 21 June 2016, 10:43   #1
thellier
Registered User
 
Join Date: Sep 2011
Location: Paris/France
Posts: 174
Question about uaenative.library

Hello Frode
Could you explain a few how works uaenative.library ?
Many Thanks

In uaenative.h I just can found:

uae_u32 uaenative_open_library(TrapContext *context, int flags);
uae_u32 uaenative_get_function(TrapContext *context, int flags);
uae_u32 uaenative_call_function(TrapContext *context, int flags);
uae_u32 uaenative_close_library(TrapContext *context, int flags);
void *uaenative_get_uaevar(void);
void uaenative_install ();
const TCHAR **uaenative_get_library_dirs(void);

But it dont say how is obtained the TrapContext pointer ? nor what do the 3 latests functions


Alain Thellier - Wazp3D

Last edited by FrodeSolheim; 01 July 2016 at 20:56.
thellier is offline  
AdSense AdSense  
Old 01 July 2016, 20:48   #2
FrodeSolheim
FS-UAE Developer

FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 37
Posts: 3,427
Hi, the uaenative.h header file you found is for internal use in UAE, these functions are not (directly) called from the Amiga side (you're not going to use TrapContext at all).

Instead, take a lot at:
https://github.com/FrodeSolheim/uni-sdk

This project includes the correct/necessary header files, as well as an example with:
- a host-native library written in C++,
- an Amiga program calling into the the host-native library

Last edited by FrodeSolheim; 01 July 2016 at 21:30.
FrodeSolheim is offline  
Old 18 July 2016, 16:13   #3
thellier
Registered User
 
Join Date: Sep 2011
Location: Paris/France
Posts: 174
Hello
Thanks Frode for your help

But all your code seems to be for the 68k OS3
In fact I want to do is a Wazp3D for WinUAE/OS4 PPC
So I will also need an OS4 "interface" to call the uaenative.library the OS4 way

Also in your code it is unclear "how to deal with the parameters / 68k registers"
I mean if we are running a ppc Wazp3D.library on a ppc cpu (in WINUAE of course)

Alain
thellier is offline  
Old 19 July 2016, 11:07   #4
Hypex
Registered User

 
Join Date: May 2015
Location: Australia
Posts: 55
Unless things have changed this may be because the PPC emulation doesn't have the same hooks as the 68K emulation does. Perhaps it wasn't thought to be that important. After all, I read that the PPC emulation in UAE was a side effect left over from needing to execute a PPC accelerator ROM to initialise a SCSI chip, so not intended to be a feature.

All it would need is, like the 68K hooks, is an illegal or undefined instruction to act as a trap instruction to signal a jump into native host code. Similar to how OS4 uses a 68K trap instruction to jump into native code. As used in a hybrid 68K library. It's all done pretty much the same to my knowledge.
Hypex is offline  
Old 19 July 2016, 13:08   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,552
Things have changed.
Toni Wilen is online now  
Old 19 July 2016, 13:42   #6
thellier
Registered User
 
Join Date: Sep 2011
Location: Paris/France
Posts: 174
In fact what is needed is something like that :


struct UaeNativeIFace
{
struct InterfaceData Data;

uint32 APICALL (*Obtain)(struct UaeNativeIFace *Self);
uint32 APICALL (*Release)(struct UaeNativeIFace *Self);
void APICALL (*Expunge)(struct UaeNativeIFace *Self);
struct Interface * APICALL (*Clone)(struct UaeNativeIFace *Self);

struct UaeNativeLibrary *APICALL (*OpenNativeLibrary)(struct UaeNativeIFace *Self,UBYTE *libName, ULONG version);
void *APICALL (*CloseNativeLibrary)(struct NativeLibrary *library);
struct NativeFunction *APICALL (*FindNativeFunction)(struct NativeLibrary *library,UBYTE *funcName);
LONG *APICALL (*CallNativeFunction)(struct NativeFunction *function,struct uni *parameters);

};
thellier is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding for uaenative.library ? thellier support.WinUAE 1 10 June 2016 19:03
Merry Christmas Frode tlosm support.FS-UAE 2 26 December 2014 21:17
Frode....Favorite list? isamu support.FS-UAE 2 08 August 2014 02:15
Dos.library question. Thorham Coders. General 2 11 January 2011 21:03
Some question about graphics.library lowlevels Sonic Coders. General 3 28 July 2010 11:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06236 seconds with 13 queries