There is no "if" in Assembly

If there was, it would be spelled "Assemblify", which is now the name of your next startup.

So, the cool thing about Assembly is that whenever you perform an instruction, the CPU runs a bunch of comparisons automatically! They are stored in "condition flags", which you can use to branch (goto) or do other stuff if the right conditions are met.

[more...]

Assembly tricks for fast bounds checking

I came across a cute little trick while looking to optimize my physics routine in Magicore Anomala.

In the routine, I need to check if each object is inbounds, and deactivate it if it goes out of bounds. Pretty typical situation, and we'd probably see it written as something like this:

[more...]

Getting clever with the Amiga blitter

Magicore Anomala is powered largely by the Amiga's blitter, allowing me to quickly clear the screen and draw hundreds of objects every frame at a full 60fps. It runs in parallel with the CPU and excels at copying or manipulating large blocks of data.

But the blitter goes above and beyond the functionality of simply hauling bits around. You can shift, mask, and logically combine up to three independent sources anywhere in shared memory.

Today I'll show you how Magicore uses the copper and blitter to convert and copy a 24-bit RGB color palette into the Amiga's 12-bit color registers, every frame, using zero CPU cycles.

[more...]

Performant data structures for bullet hell

One interesting challenge when coding the game engine for Magicore Anomala is figuring out the ideal data structures for different scene objects.

Since we're on a 7MHz CPU and need to process hundreds of objects per frame, every CPU cycle counts. Here are the requirements for the bullet objects:

[more...]

CSS-only scrollable navigation bar with dynamic "more" arrow

I recently redesigned the Team Salvato website, moving it away from WordPress (thank goodness!) and into a static site generator, which I feel is appropriate for the content it serves.

(I reused a lot of it for this website, because I'm too lazy to come up with something different!)

When thinking about a mobile layout, I decided that I didn't want the typical "hamburger menu" icon, because I was never a fan of those myself—I'm not sure why, but I always feel a bit bothered for site navigation to be hidden from me until I expand the menu (which inevitably takes up nearly the entire viewport).

So, I decided it would be nice to have the same navigation bar as on desktop, but with the ability to scroll it left and right.

[more...]