Skip to content

NativeCall 1.8.0

Latest

Choose a tag to compare

@Sdursun Sdursun released this 22 Nov 19:15

NativeCall 1.8.0: kernels on the PC under WinUAE

nativecall.library 1.8 (md5 c3494aa71d3bc719e1bbca48d1dd99ea), hypervisor 8 (armstub md5
6e6cf204a40e4389dc900d3d76f6213a, unchanged since 1.7.0: no need to touch the SD card), WinUAE host DLL
nativecall-windows-x86-64.dll (md5 ef64a6638df0868c206fc33c72895ff0).

The same program now runs its kernels on the Pi's ARM cores, on the PC's x64 processor under WinUAE, or as
68k code on any other Amiga: one SDK, one kernel source, one 68k binary.

New

  • WinUAE x64 backend: without the hypervisor, library 1.8 runs kernels on the PC through WinUAE's
    uaenative.library and a host DLL in WinUAE's plugins folder. nc_run_mp and nc_start_mp use a thread
    pool (all logical processors but one). Crashes, stack overflows and endless loops end the call with
    NC_ST_FAULT / NC_ST_TIMEOUT and WinUAE goes on; the log, fault details (with a backtrace) and statistics
    work as on the Pi. NCLog STATS and NCStatus say "WinUAE x64".
  • SDK: NC_X64 := 1 builds a module's kernels for the PC as well, without a C library (8 to 12 KB), and
    embeds them in the program next to the .narm. v1.7.0 binaries run on the PC too, unchanged, with their
    .nx64 next to them.
  • Byte order: the PC is little-endian. Parameter structures are converted by the compiler; plain arrays in
    68k memory use NC_GET16/32/F and NC_PUT16/32/F, which are plain accesses on the Pi (the .narm modules
    of all examples are byte for byte those of 1.7.0).
  • nc_now_us reads the PC's clock under WinUAE (the emulation's own clocks miss the time a kernel runs);
    nc_addr_ok accepts all of the Amiga's RAM there.

Fixes

  • mp3demo BENCH reported "No MP3 sound found" for files shorter than SECONDS (20 by default).
  • Projects that build their 68k side themselves: regenerate <prefix>_image.c (nc make narm); it now also
    holds the x64 module.

Measured under WinUAE (6.1 beta, 68060 JIT, a PC with 24 logical processors)

1280x720 WinUAE 68k PC, 1 thread PC, 23 threads gain (compute)
filterdemo 4.9 fps 59.7 fps 420.7 fps 129.6x
nbodydemo 13.7 fps 147.2 fps 693.2 fps 103.9x
raydemo 1.9 fps 16.7 fps 147.0 fps 96.5x
mandeldemo (Miter/s) 57.5 8146 142x

mandeldemo 640x480, the unchanged v1.7.0 binary: 58.5 Miter/s on WinUAE's 68k JIT, 6044 on the PC (103x).
On the A1200, library 1.8 gives the 1.7.0 figures (raydemo 18.4x on three cores, ncdemo 198 to 205 fps).

Tested

  • A1200 (PiStorm32-lite, Pi 4 8 GB, Emu68 1.1.0-beta.1), library 1.8: all ten examples built by GCC and by
    VBCC, hello with every test, and the v1.7.0 binaries.
  • WinUAE 6.1 beta 22/23: every hello test on the PC, a kernel recursing without end (caught on the emulation
    thread and on the pool), bench, mp3demo BENCH and an nbodydemo step compared with the 68k, the graphics
    demos at 1280x720, the programs without any .nx64 file next to them.
  • ./build.sh from a clean clone gives the 47 files of binaries/ byte for byte.

Not tested: other WinUAE versions or PCs, other Pi 4 RAM sizes on hardware. WinUAE 6.1 beta resets now and then
on a 640x480 AGA screen fed with WriteChunkyPixels, with or without NativeCall: use an RTG screen there.

Installing

  • Pi: nothing changes on the SD card. Replace nativecall.library in LIBS:, then Avail FLUSH or restart.
  • WinUAE: copy binaries/WinUAE/nativecall-windows-x86-64.dll to WinUAE's plugins folder, turn on
    Settings > Host > Miscellaneous > Allow native code, copy nativecall.library to LIBS:.

Assets: NativeCall-1.8.0.zip (source, SDK, and binaries/ built by ./build.sh), NativeCall.pdf,
SHA256SUMS.txt.