Aira Force 0.9.1 is faster and noisier
With this release, Aira Force 0.9.1 features:
- Amiga audio DMA emulation
- Experimental audio out (use at your own risk)
- Emulator optimisations
- macOS Universal Binaries
- Other bits and bobs
Thank you to Didier Malenfant for his help with this release, and to all users for continual testing and feedback. It is much appreciated. And thanks to EAB and EmuDev Discord - emulators make emulators.
Full changelist at bottom of page.
Audio DMA
This is added to improve compatibility. Many games wait for the Amiga audio DMA block finished interrupt to fire before continuing.
The classic example is Magnetic Field's Super Cars I and II title sequence. The code triggers a big orchestral stab sample and then waits for the notification that the sample has finished playing before continuing to load the game.
Now that Audio DMA is implemented, the emulator generates this interrupt and the games are playable. This also fixes: Agony, B.C.Kid, Blood Money, Prince of Persia, Projectyle, New Zealand Story, and others.
Audio channel state machines
The Paula audio channel state machines are quite interesting and well documented.
Audio channel state can be seen in the Amiga window. Audio can be recorded using the Emulator menu (check output for file location).
To rip a sample. Pause with F5 (or Start on your controller) and use the relevant channel's AUDxLC and AUDxLEN values in the Save Memory dialogue. Note: AUDxLEN is in words (2 bytes). I'll add a more convenient UI for this in the future.
Audio out
This is very work-in-progress, but can work with a little patience. It is disabled by default, use --host-audio command line arg to enable.
Audio is sampled from the audio channels at 48000 Hz real time, then resampled from PAL 50Hz to whatever your primary display refresh rate is. My monitor is 60 Hz, so I hear everything 60/50 higher than intended. Sorry about this. At least the scrolling is smooth.
- Only tested on Windows
- Select your OS primary audio device (left-click sound icon in system tray before launch)
- Must launch with the --host-audio command line argument
- Check the audio settings in the Host window
- Tweak the resampling delta in the Host window to minimise audio clipping and lag (keep that queue size low). Approx -700 works for me.
- Ensure vsync is enabled in Host window
- Boogie
- Mixer in Host Window
Performance optimisations
I managed to improve performance by about 25%. This is enough to make a few more games playable.
My main test cases were not very scientific:
- Kickstart 1.3 "strap screen"
- 32-colour lores bitmap sample (Batman)
- Dan/Anarchy Lemmings intro
- Prestige chaos zoomer intro
The DMA overlay shows the bitplane DMA accesses in Batman - many of these per frame. The left image shows the DMA overlay for the intro in the middle. You can see that the Amiga's DMA is getting quite a workout.
I profiled at 3 levels: Timers in Host window to display the host frame time and time to emulate a frame. Visual Studio Performance Profiler (free) was used for function level samping. Intel® VTune™ (free) was used better identify bottlenecks at the hardware level (memory, caches, instruction caches etc).
Profiling was performed with vsync disabled (host window checkbox). This ensures that the profiler is not wasting time profiling sync points between frames, or CPU and GPU. It also unlocks the frame rate, which is a handy turbo feature.
Embarassingly, I haven't had time to optimise the floppy drive simulation yet (see function list above). That motor rotation speed is certainly accurate anyway! I have been educated in the concept of emulator schedulers recently, and hope this technique will help here.
Most modern software uses big data so optimisations focus on effective cache utilisation. This emulator uses a very tight kernel updating CPU and custom hardware. The data is small, so the caches are hot and it becomes an exercise in instruction level optimisation. Very old school!
Optimisations included:
- Packing data structures to maximise cache hit rate
- Use simplest possible counters to trigger periodic logic
- Converting long if... else if ... else if .. chains to switch statments. This lets the compiler generate jump tables, which can be more efficient. Improved DMA performance.
- Removing repeated calculations from Denise video out loop e.g. extract BPU, hires, dual playfield, playfield priority values from BPLCONx registers
- Moving conditionals out of calls into calling code e.g. don't call Denise in VBLANK rather than return from Denise in VBLANK
- Converting naive polling state machines (switch statements) to event driven e.g. copper and audio channel state machines
- Converting per-system cycle functions to bus-cycle functions i.e. half beam counter tick rate.
I also spent time optimising the debug build of the tool until it ran at < 16.67 ms (60 FPS) on my PC. This is a big help for day to day work.
macOS Universal Binaries
Thanks to Didier Malenfant for making me aware that it is possible to generate a single macOS bundle containing both Intel and Apple Silicon (ARM) binaries. And bigger thanks for making this happen for this release, as well as codesigning the binaries and and notarizing the installer. I wonder if there is an equivalent required for Windows ARM...
Full changelog
- Add: Amiga audio DMA
- Add: Amiga (Paula) audio hardware registers
- Add: Amiga audio channel state machines
- Add: Audio recording options in Emulator menu
- Add: Experimental audio out
- sync to video method with resampling
- enable with --host-audio command line argument
- Add: macOS package universal binaries by Didier Malenfant
- Bundle contains Intel + Apple silicon binaries (Aira, ira, vasm, vlink)
- Binaries are codesigned and installer is notarized
- Add: Window > Set size menu options (handy for recording)
- Add: Amiga Window Audio section
- Add: Host window
- Add: Audio mixer (host window)
- Add: Options to enable/disable all breakpoints
- Add: Amiga VHPOSW register
- Improve: cancelled open file dialogue flow
- Improve: Audio logging
- Improve: Emulator performance
- Improve: Video window scaling range (including minification)
- Improve: Remember inserted ADF
- Improve: 68000 timing (Bcc, BSR, BRA, RTS, RTE, and interrupt processing)
- Fix: Vsync option (host window). Use as turbo on fast host.
- Fix: Debugger vblank detection (could miss frames due to blitter nasty)
- Fix: Emulator now only captures keyboard if mouse captured
- Fix: CPU access to slow RAM base address did not require the bus
Please let me know if you have any feedback.
Files
Get Aira Force
Aira Force
Advanced/Amiga Interactive ReAssembler and emulator
Status | In development |
Category | Tool |
Author | howprice |
Tags | Amiga, assembler, assembly-language, debugger, disassembler, Emulator, Graphical User Interface (GUI), Retro, reverse-engineering, User Interface (UI) |
Languages | English |
More posts
- Aira Force 0.9.0 released22 days ago
- Emulator update62 days ago
- Aira Force 0.8 releasedSep 05, 2024
- Aira Force 0.7.6 now availableJul 12, 2024
- Updated Windows 0.7.5 packagesJul 07, 2024
Leave a comment
Log in with itch.io to leave a comment.