Musings of a Fondue

Tag: Python

Intel 8080 Emulator

I started down this journey a bit randomly. I was researching how the Game Boy uses memory bank switching when I came across this video1 in which the author attempts to emulate the Game Boy. Since the Game Boy’s CPU is a hybrid of the Intel 8080 and Zilog Z80 processors, they start out by implementing the 8080’s instructions. Though my initial intent was to learn about memory bank switching, seeing this inspired me to set off and create an 8080 emulator.

I lucked out in my choice to emulate the 8080. It turns out that retro CPUs are orders of magnitude simpler to understand than modern ones and that the 8080 is one of the earliest. As a byproduct of this simplicity, their documentation are detailed while remaining reasonable in size (i.e. readable). (Contrast the less than 300 pages of the 8080 User’s Manual with the almost 5000 pages of Intel’s current 64 and IA-32 Developer’s Manual!)

Nand to Tetris - Part 1 of 2

I finished the first half of the course.

And here’s a video of what my implementation looks like in action.

It can run programs! Albeit very slowly. The demo above is vastly sped up. In realtime, it took about 37 minutes to run.

The code for the emulator is on Github.

My First Flask App

I was trying to get a project I had done earlier up and running on this blog. (Click the picture to see it in action.)

The project relied on a CGI file written in Python being executed by the server.

I first tried a simple upload of my files to Heroku hoping that everything would just automagically work… ha! Of course it didn’t work. What follows is the series of adventures it took to get it working.

Blender X Python

Did you know Blender uses Python?!

I had created a shape on Blender and wanted to export its vertices for use in another program. Not sure how to go about it, I Googled for ideas and came across this StackExchange answer.

It was a small Python script that did just that. And, I understood it!? And even tweaked it!

Automation With Sikuli

I had used BB Flashback to record a scene I was interested in animating. However, the program doesn’t come with a way to export several images at once. You have to export each one individually.

I had done this before for about 200 images and it was a never again experience! Through the magic of Google and StackOverflow, I came across Sikuli.

Speed Test - Raspberry PI

We were having some problems with consistent internet speed. I wanted to see how it varied over time by gathering a week’s worth of data and visualizing it with D3.

One option was to manually run the speed tests periodically. A more sane option, was to have a program do this.

I didn’t want to leave my computer forever on to accomplish this. And there was a Raspberry Pi sitting unused, that could stay running for days on end happily. So Pi it was.

But how to write such a program?