Start

heckmeck!

Nerd content and
cringe since 1999
Alexander Grupe
Losso/AttentionWhore

I had long given up the idea of extending an existing Amiga emulator with realtime inspection features to my liking. Native C/C++ and the accompanying dependency hell isn’t my forte…

Now modern web technologies, of all things, can finally make this happen for me!

Here, I’m using vAmigaWeb and added a little realtime memory monitor (the black and white area at the bottom). Even with a naïve implementation (plotting pixel by pixel), the emulator doesn’t bat an eye and keeps running smoothly! Awesome.

main.cpp:

extern "C" u16 wasm_peek16(u32 addr) {
       return wrapper->amiga->mem.spypeek16<ACCESSOR_CPU>(addr);
}

JavaScript:

wasm_peek16 = Module.cwrap('wasm_peek16', 'number', ['number']);

value = wasm_peek16(addr);

This is all thanks to the work of Dirk Hoffmann (vAmiga, vAmigaNet), mithrendal (vAmigaWeb), and all the contributors! Also, Web Assembly, emscripten, LLVM.

Let’s see what comes out of this. With full access to the emulator, nifty things are possible!

  • Live heatmap of chip mem and fast mem (similar to WinUAE’s vh feature)
  • Sub-frame tracing (watch memory updates as they happen)
  • Identify code hot-spots (i.e. effect routines; utilizing vAmiga’s builtin debugging and disassembly functions)
  • Trace and visualize blit operations

WinUAE is still great, of course. It’s not WinUAE’s fault that I lack the patience and knowledge to go through a Visual Studio build setup. Also, in a C/C++ Windows environment, I wouldn’t even know where to begin if I were to add an extra output window.

PS: Amiga emulation in the browser isn’t new, and the vAmiga web ports have also been around for a while. The olde ScriptedAmigaEmulator (written in plain JavaScript) feels a bit sluggish in comparison, though. Also, the folks over at flashtro.com have been using a vAmiga variant to cleverly integrate their Amiga intros for ages, and it’s awesome.

PPS: When writing this, I forgot to add the proper path for the video preview image, hacking.jpg. By chance, there already was an old file of that exact name in the document root, lying around for at least 20 years… :)

previous next close
eie