Start

heckmeck!

Nerd content and
cringe since 1999
Alexander Grupe
Losso/AttentionWhore

May 2024

Blog

2024-04

It warms my heart to see that the regional storm warnings on TV are not advertised by some ugly scrolltext or some “fancy” website link, but a good old warning sign referencing the corresponding Teletext page.

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… :)

No, not the Raspberry Pi-based spam blocker, but a case of insidious trolling:

Screenshot: /r/programming/

This specific Reddit user obviously uses the digits of π as their username – so far, so common.

It is only if you have taken some wrong turns in your life and have memorized the first 21 digits of π for fun that you will be appalled to notice that the last two digits are wrong! And you’re stuck with that – the user in question will know very well what they did, and it is way too nerdy to rant about…

Well played! :)

PS: If you only know as many π digits as your 1984 pocket calculator, you might still “enjoy” the opening sequence of Pi, the movie:

A nice Teletext artwork appears. On closer look, you wonder: Wait, how is that possible?

Sounds familiar? Yes, of course it does! Let’s dive into Teletext’s hold mode!

previous next close
eie