12 November 2020, 10:30 | #1 |
Registered User
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 287
|
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 |
18 November 2020, 09:51 | #2 |
Registered User
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 287
|
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. |
18 November 2020, 10:34 | #3 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
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. |
19 November 2020, 21:50 | #4 |
Registered User
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 287
|
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 |
20 November 2020, 18:00 | #5 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
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 18:13. |
22 November 2020, 20:24 | #6 |
Registered User
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 287
|
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 09:58. Reason: poor english |
06 March 2021, 14:08 | #7 |
Registered User
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 287
|
Now I use uaenative.library (and I like it!) I would need to simulate a ReplyMsg() in a dll written in C / C ++ that goes through the uaenative.library.
But I do not know how to do. Have you any ideas ? |
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 13:42 |
Coding for uaenative.library ? | thellier | support.WinUAE | 1 | 10 June 2016 19:03 |
Seek and Destroy keyboard | psampaio | support.FS-UAE | 1 | 01 April 2016 18:03 |
Hardfile tried to seek out of bounds | Leandro Jardim | support.WinUAE | 9 | 11 October 2011 17:27 |
Landing in Seek'n'Destroy | Charon | support.Games | 4 | 12 April 2006 02:45 |
|
|