English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 12 November 2020, 11:30   #1
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
hide and seek uaenative.library

I use WinUAE 4.4.0 (july 2020)

configuration a: 68000 KS1.3 512K chip 0 fast
configuration b: 68000 KS1.3 512K chip 0 fast dh1 pointing on a directory, not bootable
configuration a and b have the use native code checked.

with the configuration a, I can't do nothing with uaenative.library, not present.
on configuration b, I can use uaenative.library, (and also use the $00f0ffc0 entry point)

My questions:
1) Why the fact of adding a disk permit to use the uaenative.library ? (and permit also the $00f0ffc0 entry point)
2) The uaenative.library has version 1.00 in configuration b, but 4.00 with 68060 KS3.1.4 2M chip 32M fast, various disks, why version differs ?


Many thanks,
Keep cool, stay at home until Spring
Gilloo is offline  
Old 18 November 2020, 10:51   #2
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
uae.resource, uaenative.library and the 0x00f0ffxx traps are only present when at least one harddisk is defined, and not only when use native code option is set.

Toni ? is it by design or this workaround is official ?
Thanks.
Gilloo is offline  
Old 18 November 2020, 11:34   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,567
Basically they exists if UAE boot rom is enabled = at least one UAE expansion is enabled. Currently there is no option to "force" enable it.

Enabled native code option can't (anymore) enable UAE boot ROM because it would break backwards compatibility if someone have native option enabled without UAE expansions. For example it would be bad when using basic A500 config because amount of RAM would change and weird devices would get added and it would get reported as emulation bug.
Toni Wilen is offline  
Old 19 November 2020, 22:50   #4
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
Hi Toni, Hi Frode

in the latest winuae
found here
https://github.com/tonioni/WinUAE

uaenative.cpp we got this :

struct uni {
uni_long d1;
uni_long d2;
uni_long d3;
uni_long d4;
uni_long d5;
uni_long d6;
uni_long d7;
uni_long a1;
uni_long a2;
uni_long a3;
uni_long a4;
uni_long a5;
uni_long a7;

#if UNI_VERSION >= 2
// add new struct entries for version 2 here
#endif

#ifdef CPUEMU_0 // UAE
uni_long result;
uni_long error;
uni_ulong function;
uni_ulong library;
void *native_function;
void *uaevar_compat;
int flags;
uaecptr task;
#endif
};


and in the uni_common.h found here
https://github.com/FrodeSolheim/uni-sdk

struct uni {
uni_long uni_version;
uni_long result;
uni_long error;
uni_long d1;
uni_long d2;
uni_long d3;
uni_long d4;
uni_long d5;
uni_long d6;
uni_long d7;
uni_long a1;
uni_long a2;
uni_long a3;
uni_long a4;
uni_long a5;
uni_long a7;
uni_resolve_function resolve;
uni_get_uae_string_function get_uae_string;
#if UNI_VERSION >= 2
// add new struct entries for version 2 here
#endif
#if UNI_VERSION >= 3
// add new struct entries for version 3 here
#endif
// etc...

#ifdef CPUEMU_0 // UAE
uni_ulong function;
uni_ulong library;
void *native_function;
void *uaevar_compat;
int flags;
uaecptr task;
#endif
};

The two versions of struct uni don't match and that explains why my uaenative tests are catastrophic
So where is the sdk to make an official .dll using uaenative for WinUAE ?
Thanks
Gilloo is offline  
Old 20 November 2020, 19:00   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 24,567
I don't know. I didn't create it. I have never used it.

FS-UAE also uses exact same (first) header.

EDIT: so I guess sdk was updated but UAE side was never updated? Frode probably knows more.

Last edited by Toni Wilen; 20 November 2020 at 19:13.
Toni Wilen is offline  
Old 22 November 2020, 21:24   #6
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 218
So I took uni_common.h from the WinUAE source code
and make a .dll

extern "C" UNIAPI int (*uni_version)() = NULL ;
extern "C" UNIAPI int(*uni_resolve)(uni_long ptr) = NULL;
extern "C" UNIAPI const char *(*uni_uae_version)() = NULL;

// UNI_DEFINE_LIBRARY(1, NULL);
extern "C" UNIAPI int UNICALL uni_init(void)
{
if (uni_version() < UNI_MIN_VERSION)
{
return UNI_ERROR_INTERFACE_TOO_OLD ;
}

// other things

return 0 ;
}

//----------------------------------------------------------------
extern "C" UNIAPI uni_long UNICALL hello_world (struct uni *uni)
{
uni_char *data = ((uni_char *)uni_resolve(UNI_LONG_PARAM(a1))) ;
uni_long data_len = UNI_LONG_PARAM(d1) ;

snprintf ((char *)data, data_len, "Hello World!\nBest regards, %s",
uni_uae_version() ) ;
return 42;
}


The 3 first function pointers are set by the opening of the uaenative.library.
uni_resolve translates amiga addresses into Windows addresses.
This was what I was trying to do in 2012 without success, now it's working !
Don't rejoice too quickly, I may find some bugs
Thanks

Last edited by Gilloo; 23 November 2020 at 10:58. Reason: poor english
Gilloo is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about uaenative.library thellier support.FS-UAE 5 19 July 2016 14:42
Coding for uaenative.library ? thellier support.WinUAE 1 10 June 2016 20:03
Seek and Destroy keyboard psampaio support.FS-UAE 1 01 April 2016 19:03
Hardfile tried to seek out of bounds Leandro Jardim support.WinUAE 9 11 October 2011 18:27
Landing in Seek'n'Destroy Charon support.Games 4 12 April 2006 03: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 13:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.06633 seconds with 15 queries