Releases: michalsc/Emu68
Release list
Emu68 1.1 alpha.1
This is the alpha pre-release of Emu68 1.1
Emu68 1.1 is a next step in evolution of Emu68 providing significant speed boost, faster boot times, better usage of JIT cache, big portion of bug fixing and code restructuring improving code maintenance. Below you will find short summary of most important changes or improvements. Probably there are some things which I forgot here, there were simply way too many changes in over 500 commits.
PiStorm16
Emu68 1.1 is the first version officially supporting the new family of PIStorm devices - PiStorm16. The PiStorm16 devices are based on the same FPGA family as the PiStorm32lite, improving maintainability of the FPGA code base, improved performance and easier firmware updates. The first member of this family is PiStorm16 for Amiga 600 computers using Raspberry Pi Compute Module 4.
Better code generation
Emu68 1.1 has slightly improved code generation - better loading of immediates, shorter code paths, improved exit points from the JIT blocks and much much more. The changes under the hood give rather subtle improvement of the performance but were important from my point of view in order to allow e.g. debugging of the generated code, where I analyze side by side m68k and aarch64 output.
MDIO and PCI improvements
These changes come from @rondoval - a very welcomed programmer who contributes to Emu68 with several improvements and new drivers - e.g. xHCI driver for Pi4, wired ethernet for Pi4/CM4 and GIC400. Many thanks to @rondoval for his amazing work! The changes mentioned here are necessary improvements to Emu68 allowing his drivers to work correctly. Not only that, they open possibilities for other drivers in the future.
Classic PiStorm flashing
This is the change provided by @captain-amygdala the creator of PiStorm himself. This change allows one to write flash of classic PiStorm directly from Emu68. No need to run linux on raspberry first just in order to flash the CPLD. Many big thanks Claude for this contribution!
New Zorro3 board
With Emu68 1.0 every single driver or support library for Emu68 was put on a separate Zorro 3 card. Due to the way autoconfig mechanism work, this wasted approximately 16 MB of address space (RAM) for every Zorro 3 card. Now, all drivers and support libraries are put together in a single Zorro3 card, saving space and allowing to use less restrictive compiler flags for the libraries.
No need for 2GB memory limit
Even if AmigaOS cannot use memory above 2GB, Emu68 can. Therefore, the memory limit set previously in config.txt is not necessary anymore. If the Raspberry Pi has more than 2GB of RAM, part of the memory above 2GB will be used for JIT caches and internal Emu68 needs, giving you even more free RAM to AmigaOS.
Source code cleanup
In 1.1 branch the source code of Emu68 is being intensively reworked. The code has been cleaned up, slowly moving to a point where e.g. a C to C++ transition for the whole code base is possible. Don't be scared - actually the C++ here allows for even cleaner code and does not have any negative impact on performance.
Overlays
Instead of adding more and more keywords to the codline.txt, making it very hard to maintain, Emu68 1.1 introduces the concept of device tree overlays known e.g. from Linux. One can load given device tree overlay from the config.txt file and configure it on load through well-defined parameters. Currently three overlay objects are provided: unicam (for framethrower), diagnostic (for triggering buptest or memory benchmark) and emu68 (for adjusting JIT parameters for Emu68 on boot). Once 1.1 will reach final stage release, the cmdline.txt will be declared obsolete and support for it will eventually be removed in further Emu68 versions. Details on usage of overlays will be given soon.
4-way set associative JIT cache
The JIT cache got a small but significant upgrade. Apart from a large hash table for JIT which was used since very beginning, Emu68 contains now an additional 4-way set associative JIT cache with 128 sets. The cache provides faster lookup for the JIT blocks which associates only the m68k entry address with corresponding aarch64 entry address. This cache is enabled when CPU Instruction Caches are active and is fully transparent to AmigaOS. Depending on the code, this may give speed boosts from 0% up to 20-30%. Some prominent examples benefiting from this new caches are some First-Person 3D games such as Heretic II.
JIT Dumpster
This is the second very significant change. In Emu68 1.0, when CPU instruction cache was flushed, all the JIT translated blocks were flushed too and had to be recompiled again when necessary. This was a big waste of CPU resources especially for the bits and pieces of code which were not changed at all between cache flushes. And that happens rather frequently, since every executable loaded by AmigaOS forces ful cache flush upon load. Users of Macintosh emulators, such as Shapeshifter or Fusion suffered even more since there the operating system is flushing caches rather periodically (sometimes 10 times per second or faster).
Now, with Emu68 1.1 it is different. The translated blocks remain in cache and can be reused after a short verification of a fingerprint and crc32 checksum. This change results in much better usage of JIT cache, significantly improved boot time (up to 2x speedup) and huge improvement in case of Apple emulators, where operating system boot is not few times faster and the system is much more responsive.
PowerPC
The last significant change, although not enabled yet by default. One of unused AArch64 cores can be now used to run a "brother" of Emu68 - second independent instance which, instead of m68k code, translates PowerPC code to AArch64. This is currently a work-in-progress subproject written in C++ and as such is not yet enabled nor usable, but it is already there in the Emu68 binary. Once completed, it will provide WarpOS-like support library allowing you to run warpos binaries PPC code on Emu68.
Bugfixes
Finally, Emu68 contains a huge pile of bugfixes. Some of them related to the gcc compiler of choice - new gcc versions are more fragile against the hacks used in Emu68 previously. Other bugfixes repair issues which were present in Emu68 since the very beginning.
WARNING!
- This version of Emu68 requires VideoCore.card version 1.5, which will be available as downloadable file within this release. VideoCore.card version 1.5 is not compatible with Emu68 1.0 and, therefore, is not yet available in Emu68-tools package.
- Framethrower users are advised to use the unicam overlay instead of enabling framethrower through cmdline.txt. Add following line to config.txt in order to activate the Framethrower and turn it on on boot:
dtoverlay=unicam,boot,smooth
the parameter boot is the same as previously used unicam.boot in cmdline.txt, the smooth option is the same as unicam.smooth from cmdline.txt.
SECOND WARNING
This is an alpha-quality pre-release. It is stable for me and is stable for people who were testing it already. Nevertheless, expect to have some issues or instabilities with it. If you decide to test it, please report the issues here, on GitHub.
THIRD WARNING
The file names have changed now:
Emu68-pistorm-classic.zip - this is the archive for classic (A500, A1000, A2000) PiStorm based on CPLD
Emu68-pistorm.zip - this is the archive for PiStorm32lite and for PiStorm16
Emu68-raspi.zip - you don't want to use that one unless you want to play with bare-metal m68k based raspberry pi :)
Emu68 1.0.7
Emu68 1.0.7
This is the (hopefully) last iteration of the Emu68 1.0.x series before moving on to 1.1 and beyond. It is a quick-fix release required for all Framethrower users running the classic PiStorm.
unicam.resource fixes
The unicam.resource generates a display list for the VideoCore chip. This display list is written directly into the MMIO area and therefore cannot be subject to Emu68 instruction fusing. Writes to MMIO add an extra NOP, which prevents Emu68 from performing fusing. This resolves an issue where visual artifacts appeared when using the Framethrower.
TLSF memory allocator fixes
There were bugs in the TLSF memory allocator, which is used internally by Emu68. These could eventually lead to memory leaks and, more importantly, memory corruption. The TLSF allocator has now been fixed and is in sync with the upcoming 1.1 release.
Imporant notice
This version of Emu68 builds correctly with gcc-11 but may produce broken or non-functional binaries when compiled with gcc-13 or newer. This is due to violations of strict aliasing rules in a few places.
Emu68 1.0.6
Emu68 1.0 marks the first stable release in the 1.0 series. Starting with this version, all users are encouraged to use only official releases. Nightly builds should be avoided unless absolutely necessary. Version 1.0 includes all the changes from RC1, RC2, and RC3, along with additional fixes and improvements.
Version v1.0.0
Improved 68000 Bus Handling on PiStorm Classic
Signals on the 68000 data bus during byte writes now expose 8-bit data on both the low and high nibbles. While this may not be critical in most cases, it could resolve issues with some older or faulty code.
Optimized 64-Bit Immediate Loads
Emu68 now emits sequences of immediate loads (in 16-bit portions) when writing to a 64-bit register. This replaces the previous method of PC-relative memory fetching, which may significantly improve performance on modern CPUs.
Better HashTable Fetch Alignment
The hash table for translated code is now better aligned, reducing the number of ARM instructions per fetch. Since the hash table is a performance-critical part of the JIT loop, this change could result in noticeable speed improvements.
Fast Page Zero
When the fast_page_zero option is set in cmdline.txt, the first 4K of RAM is mapped to ARM memory. This can improve performance in cases where moving the VBR to FastRAM isnβt an option.
CRC32 Calculation Fix
In previous versions, the CRC32 checksum for M68k code blocks did not account for the last M68k instruction, which could lead to errors when self-modifying code detection was enabled. This has now been fixed.
eMMC/MicroSD Driver Corrections
The drivers for eMMC and microSD in Emu68 tools have been fixed to prevent devices from disappearing at boot.
Main JIT Loop Rewritten in C & Dead Code Removal
Though there is no measurable performance impact, the main JIT loop has been rewritten from AArch64 assembly to C, improving maintainability. Additionally, dead code and AArch32 remnants have been removed.
Version v1.0.1
LhA Tool Fix
The LhA tool sometimes accesses non-owned memory, reading from the uppermost portion of the 4GB address space. This fix fills the memory with a random pattern, preventing crashes and performance issues.
Version v1.0.2
Updated unicam.resource
The unicam.resource has been updated to the latest version, required for the current version of the VideoCore P96 driver, which would otherwise crash.
Version v1.0.3
Buptest & Kickstart Issue Fixes
An issue with Kickstart and buptest failing to work properly has been resolved. The problem stemmed from buptest using PiStorm functions reserved for later stages of Emu68's startup. This has been replaced with lower-level PiStorm access functions.
Zorro III Disable Option
A new option, z3_disable, has been added to cmdline.txt that allows users to completely disable all Emu68 Z3 boards in the system. Use this option only if you understand its implications, as it will disable microSD, unicam, device tree functionality, and other Emu68 features.
Version v1.0.4
SCSI Command Fixes in SDHC and eMMC Drivers
Both drivers now clear the SCSI status flag when a command succeeds and set it appropriately upon failure. This fixes issues with the PFS filesystem when used in direct SCSI mode (PDS\3 DOS drive type).
Version v1.0.5
Mediator fixes
PiStorm32lite version of Emu68 contains updated FPGA firmware which should solve some issues with Mediator in Amiga.
Genet ethernet driver
If Pi4/CM4 is detected, GPIO pins for RGMII interface are configured properly so that the Genet SANA II network driver should work.
The Genet driver is eventually working on classic pistorm too, but there is no guarantee on that since Pi4/CM4 are officially not supported on classic PiStorm models.
Version v1.0.5.1
Changed version of RaspberryPi firmware files. The ones from master branch were crashing Emu68. This version seems to work.
Version v1.0.6
Fixes for genet.device for classic PiStorm (A500/A600/A2000/A1000).
Emu68 1.0 Release Candidate 3
Emu68 1.0 Release Candidate 3 is the last RC before final 1.0 version. It contains all fixes from RC1 and RC2. Additionally it contains several changes and fixes improving performance of old games and demos:
Blitwait
The BlitWait option allows the user to force Emu68 to do more fine-grained waits before writting several blitter-sensitive registers. Normally, the software which is using blitter should wait until it completed the operation, but in some cases the demo coders assumed that m68k is slow enough to not waist time for waiting. Such games and/or demos require the blitwait option activated either through cmdline.txt or with help of EmuControl to operate properly.
Ability to add EmuControl parameters to Emu68 globally
With this release user can pass the EmuControl command line options, like e.g. DBF ICNT=1 CCRD=0 directly to cmdline.txt file and thus making them global. This, in combination with eventually disabled CPU caches, allows one to run demos like the "State of the Art" directly from floppy, without WHDLoad.
RGB to HDMI Passthrough
This feature requires small external hardware (work in Progress or A500, A600, A1200, A2000) which sends the digital RGB data through the camera interface to raspberry directly. IN combination with new unicam.resource (embedded in kernel) and new VideoCore/Emu68-VC4 driver (available in new nightly build of Emu68-tools) this allows to display the RGB signal from Amiga on the HDMI. The unicam.resource allows one to enable this feature on boot already, new VideoCore driver allows one to easily switch between RGB and RTG modes on the same screen.
Options for cmdline.txt will be described in manuals and updated on final release. For now, please visit our discord channels for details.
Emu68 1.0 Release Candidate 2
Emu68 1.0 Release Candidate 2 contains all fixes from RC1. Additionally it contains two changes improving the support for old games and demos massively:
Updated instruction cache
The instruction cache used for translation of m68k to aarch64 code as well as to verify already translated code has been improved. The writes to chip memory automatically invalidate it, there are less flushes of the instruction cache during operation of Emu68.
Slow DBF
A special hack is added to make DBF busy loops in form of:
move.w #delay, Dn
loop: dbf Dn, loopoperating with reasonable speed. Until now such kind of loops was way to fast on Emu68 and this rendered many old games or demos unusable or misbehaving. The special handling of DBF busy loops can be enabled in cmdline.txt file by adding a dbf_slowdown keyword, or during operation of Emu68 using the EmuControl tool.
Emu68 1.0 Release Candidate
Emu68 1.0 Release Candidate 1 contains all fixes from Beta2.1 and much more:
Updated BFxxx
The bitfield instructions operating on memory are not optimized to use as little memory accesses as possible. There are still corner cases which will do more traffic than necessary, but they are now very limited. The bitfield instructions will fetch byte/word/long word/quad word instead of always working on quad words.
Better write to CHIPSET registers
After a write to memory area belonging to Amiga chipset, a byte read from ROM is issued. This improves stability of some old games/demos which never assumed to be running on m68k which is that fast. A read from ROM gives Paula enough time to complete the interrupt acknowledgment properly
IPL filter
Emu68 filters the IPL lines and recognizes an IPL change if and only if two subsequent IPL reads (which are roughly 400 nanoseconds away) give the same result. Improves many games or demos which suffered from spurious interrupts.
Write buffer removed
The write buffer was my experiment introduced quite long time ago - it featured a write combining to subsequent byte/word locations as long as they would finally result in a longword write cycle. It worked relatively well in most cases, but failed miserably in some others. Since this was just a dirty hack, it has been removed now.
CCR optimizer scan depth
The number of m68k opcodes which are scanned in-advance during m68k to arm translation for elimination of CCR flag updates is now adjustable. Use EmuControl version 1.3 for that (nightly build from 23. Sept. 2023 or newer)
Sponsors
The list of sponsors, listed alphabetically, is now embedded in Emu68 binary and is available by reading emu68/support property.
Emu68 - beta 2.1 (hotfix)
This is a hotfix for Emu68 beta 2. Actually it does not deserve the "hotfix" name, as it introduces many important improvements:
- CCR fixes. Beta 2 has changed internal handling of CCR, but unfortunately added several bugs due to the change. Beta 2.1 fixes all these problems, improving compatibility with m68k software.
- Fixed fusing of MOVE instructions. Until now there were few corner cases where fusing of subsequent MOVE.L instructions resulted in wrong behavior of generated code. Thanks to Paraj this issues are solved now and fusing of MOVE.L instructions works without (hopefully) any bugs.
- Added temporal instruction cache working on CHIP memory during JIT translation process. This greatly improves the translation itself, since not only the translator itself accesses instruction stream, but also CCR optimizer and CRC32 calculator.
- Added optional slowdown of code executed from CHIP memory. This might be important for old games and/or demos which rely on CPU busyloops
- Removed code inlining feature on 24-bit memory to reduce the need of crawling through the CHIP memory. Greatly improves the performance of demos/games where instruction cache is set to checksumming mode.
The Beta 2.1 is recommended for all PiStorm users. Per default the firmware is used in two-slot mode. By adding one_slot option to cmdline.txt one can force the single-slot operation. This is not recommended for Pi3 users.
Emu68 - beta 2
This is second beta release of Emu68 with focus on PiStorm and PiStorm32lite devices. In case of the latter the version is based on a 2-slot firmware for Efinix FPGA, which dramatically reduces write latency in case of continous writing to the CHIP memory of Amiga. This beta covers over one year of hard work on both Emu68 and PiStorm as well as thousands of hours of testing done by volounteers. The stability and compatibility improved drastically during this time, we have also introduced the PiStorm32lite for Amiga 1200. The performance improved not so greatly since it was very high already.
As with nightlies and previous beta release - please make sure you download version matching your pistorm! This time in order to avoid mistakes the Rasberry Pi standalone version is not released as a binary file, since this one is missing a suitable operating system.
Emu68 - beta version
This is beta release of Emu68. The integer part is passing cputests with exception of MOVEC without any issues. Currently the trace debug modes are not working yet, same applies to MMU. The FPU is operable but has few not yet solved issues resulting in few glitches in games/demos.
PiStorm users - please make sure you have picked PiStorm designated binaries!
nightly
Delete old nightly before pushing new one