RSSAmplifier

Blog

(untitled)

Recent content on

stefan.arentz.caRSS feed ↗32 posts

Latest posts

An Ode to Sad Mac

Here is a more official build of the Sad Mac screen saver that I wrote last year. It is now properly code-signed and should install and run without any permission issues on macOS 10.12 and newer - Download SadMac-1.3.zip SadMac-1.3.zip (Screen Saver) github.com/st3fan/SadMacScreenSaver (Source Code) Most of my professional and personal work is Open Source. You can find many projects at…

Screen Savers

I recently wrote three small screen savers for macOS. That was a ton of fun. There is something therapeutic about it. I am making them all available as open source. Let me know what you think. Sad mac This one is an ode to the classic Mac. The Sad Mac would show up if it’s internal hardware test failed. Like when you had a bad RAM chip. Code-wise it is a very basic screen saver actually.

EWM Update: Let's Get Cookin'!

Building on top of the Lua integration work that I landed recently in EWM, my Apple ][+ emulator, here are two small improvements and a fun use case to show those off. New Lua Callbacks First, I have added two callbacks that let you intercept key presses. Not emulated presses, but EWM application key downs and ups. This means that you can now trigger scripts by connecting them to a key…

EWM Update: Lua Integration

After an almost eight month interruption by mostly work and life in general, I am finally, and happily, back here writing about something new I added to EWM, my Apple II+ emulator. I always thought it would be interesting to integrate a scripting language in the emulator, so that you can write little (or big) hacks to modify the behaviour of not just the emulator but also the software it runs.

EWM Update: Bootloader

I just landed a patch that adds a bootloader to EWM. Now when you start it without telling it what specific machine to emulate, you will see the following: There is no support for a Character ROM that has lowercase so you have to be a little creative when you use the Github link in it. Or maybe I should make the link clickable? This is most likely how the Raspberry Pi edition of EWM will start.

EWM Update: Optimizing Memory Access

I landed a little patch to optimize memory access to the first two pages of memory: the zero page and the stack. The struct cpu_t now keeps pointers to the memory areas where these pages are kept, so operations on them can access the memory directly instead of going through the memory abstraction. The speedup is specially noticable on the Raspberry Pi Zero: Before pi@raspberrypi:~/Projects/ewm/src…

EWM Update: Small Things

Here is an overview of some small improvements I made this week. It has been hard to find quality time to work on this project so I am not going as fast as during the Christmas break. Blink that cursor The Apple 1 emulation in EWM now blinks the cursor. I did not know that it blinked until I saw some videos on YouTube. I probably got the frequency wrong.

EWM Update: Raspberry Pi Zero

It has been difficult to find the time to hack on EWM since I went back to work. Busy busy. But I did manage to make some small improvements to better support the Raspberry Pi Zero. The Raspberry Pi Zero is a tiny single board computer with a 1 GHz single-core ARMv6 CPU, 512MB RAM and HDMI and USB connections. They are cheap, around $7 CAD plus shipping, and are capable of running Linux.

EWM Update: Linux Support

Emulated Woz Machine, my Apple 1 / Apple ][+ emulator now runs succesfully on Linux. Here is a screenshot of it running on Ubuntu 16.04.1. This was not very difficult to get going. Using SDL 2.0 to abstract everything screen, keyboard and event loop related was a good call. I wrote this emulator in portable C, using just SDL and POSIX APIs. There were just a few small compilation issues that I had…

EWM Update: Boot Loader

EWM supports multiple machine profiles. Currently the Apple 1, Replica 1 and the Apple ][+. You can start an emulator with a specific machine profile easily from the command line: ewm one --model=replica1 ewm two --model=apple2plus --drive1=choplifter.dsk This is useful, but I think there is probably a more common case where people start the emulator by double clicking or tapping an app icon or…

EWM Update: Illegal Instructions

Today I found out that ProDOS 2.4.1 crashes in my Apple ][+ emulator. Very early on when booting a disk, even before it displays the welcome screen. This is odd because ProDOS 2.4.1 is supposed to be compatible with any Apple II model that has 64KB of RAM. After some sleuthing I figured out what is happening here. The big hint is what the emulator prints: CPU: Exited because of unimplemented…

EWM Update: Status Bar

I’ve been making some more progress on my Apple 1 / Apple ][+ emulator. One thing I just finished is a status bar at the bottom of the screen that shows up when you hit Command-I. It shows the emulated CPU speed and disk activity. The status bar is using the same character set as the Apple ][+. If you are interested in playing around with my emulator, you can find the project at github.

EWM Update: Joystick Support

Finished initial Joystick support for my emulator. Works pretty well with the XBox 360 Wireless controller. This is where using SDL is paying off. It has nice abstractions for finding game controllers and joysticks. Choplifter is very playable. Also tried Hard Hat Mack and Ms Pac-man. Strangely Cider Spider does not work at all. Not sure what is going on there yet. I’m thinking I should…

EWM Update: Replica 1

I have been posting a lot of pictures and movies of the progress that I’ve been making with my Apple ][+ emulator. That is going pretty well, but the project actually started as an Apple 1 emulator. And I have to admin that I have been neglecting that part. So here is some progress on the Apple 1 side. I just finished a native terminal, using the same character generator as the Apple ][+.

EWM Update: Hi-Res Color

Making some progress with color. I don’t think the colors are completely right. And other emulators show more solid colors instead of the stripey fills. So I have to figure out what is going on there. Getting there! And how about this one: If you are interested in playing around with my emulator, you can find the project at github.com/st3fan/ewm. Most of my professional and personal work is…

EWM Update: FPS = Frogs Per Second

So here is something funny. I added support for (monochrome) hires graphics to my emulator last week. It worked, but was too slow to play for example Frogger. I thought my ‘renderer’ was too simple. I’m simply putting pixels on the screen with FillRect(), which SDL maps to OpenGL primitives. So that is a lot of calls. I started writing a little rendering benchmark so that I could…

EWM Update: Color & Monochrome

The emulator now has the option to switch between color and monochrome support with the --color command line option. Only green is supported for monochrome, but I plan to support all the common colors like white, amber and scanline emulation.. Yes, the colors are not right, and there is outstanding work to make colors look more solid and follow NTSC display rules. It is still weird for me to see…

EWM Update: Frogger & Karateka

Things are moving fast now. Monochrome Hi-Res support. The horizontal line in the Frogger screen is probably a typo in the table that I have to list the base addresses of lines of the HGR pages. This is how I remember the Apple ][+ - everything in monochrome. Except that we had a Monitor ///, which was green. So I’ll have to make some options for monochrome color selection I think.

EWM Update: ProDOS Boots!

I found a quiet spot at the airport (SFO) and resolved my Language Card issues. ProDOS 1.0.1 boots now! The best explanation of the Language Card and memory architecture was actually in Understanding the Apple II by James Sather. What a fantastic reference that is. I should really try to find a hard copy. If you are interested in playing around with my emulator, you can find the project at github.

EWM Update: Language Card

The beginnings of Apple Language Card support are there for a glorious total of 64KB of (bankswitched) RAM. This means that DOS 3.3 can now load Integer BASIC into the card and you can run Integer BASIC programs from disk. ProDOS 1.0.1 however complains about ‘Unable to execute basic system’. That will require some debugging on the travel weekend with way too many hours at airports. If…

EWM Update: Lo-Res Graphics

I’m slightly surprised that I am still hacking on this side project. Usually life and actual work get in the way or drain the energy to levels where I don’t want to write much code at home. But here we are .. I now have an Apple ][+ with 48 K RAM, disk controller, text and lo-res graphics pretty much implemented. See two screenshots of the COLOR DEMOSOFT app from the DOS 3.

EWM Update: Parsing the original Character ROM

So far I’ve been using the Apple2Forever TrueType Font to render text modes. These look nice but are not really original for an emulator. So I wrote some code to parse the original Apple ][+ Character ROM and turn those characters into SDL compatible bitmaps. The ROM format is very simple, one line of the character bitmap per byte. Seven bytes per character. Later I will add color variation,…

EWM Update: Disk Progress

Here is some Disk ][ progress I made. The code that I finished on the weekend frustratingly did not work. It had just one weird bug in it, which truncated ‘raw’ tracks by 16 bytes. I think this threw off the disk firmware because it could not correctly synchronize. One line fix after I correctly diagnosed it this evening. Big inspiration for this code is the Open Source Apple2JS…

EWM Update: BASIC Prompt

Here we go. The font rendering is a bit weird. Not sure what happened there. But it boots, it tries to beep (no speaker emulation though) and then it is mostly usable. What is next? A Disk ][ implementation? If you are interested in playing around with my emulator, you can find the project at github.com/st3fan/ewm. Most of my professional and personal work is Open Source. You can find many…

EWM Update: It Boots!

Ok that escalated quickly. I have a ‘game loop’ in SDL now and some basic rendering of text page 1. It boots! With a BASIC prompt! And I can type random stuff that results in a ?SYNTAX ERROR so something good must be happening. For some reason it thinks that the forward slash is being typed continuously. Not sure what is happening there. I am probably not understanding correctly how…

EWM Update: ][ELPPA

May not seem like much, but here is a little milestone for my emulator. It is booting up as an Apple ][+, printing APPLE ][ (in reverse) and then printing ABCDEF? and OUT OF MEMORY ERROR followed by a ] prompt. I have a lot of work to do, but this is promising. I hope to have a decent SDL-based (OS X, Linux, Windows) version done by the end of the year that can boot a DOS 3.

EWM Update: Apple 1 Progress & Booting the Apple ][+ ROM

Here is some more progress with my 6502 / Apple1 emulator. Lots of fixes and features .. I forgot to implement some instructions, SEC, SED, SEI. Oopsie. Now I can load ROMs from disk, detect invalid instructions. I implemented APIs to register memory (RAM, ROM, IO) regions. There is now basic interrupt support, although the Apple 1 does not use those at all. The screenshot shows the emulator with…

EWM Update: Hello World

Made some good progress with my 6502 / Apple I emulator. It now runs the WOZ Monitor succesfully. Here is a screenshot of the virtual Apple I booting up, and me entering and running a little Hello World program. (In a terminal window with the Apple2Forever Font). It is not entirely clear what happens after the final RTS of an entered program though. So the emulator simply stops. (Also note the low…

Emulated Woz Machine

Two years ago in 2014 I put together a half complete barely functioning emulator for the Apple 1. I called this project Emulated Woz Machine, an ode to the brilliant Steve Wozniak. I found some new energy to continue working on this project. To kick it off I wrote a small patch and also started filing issues for things that need to happen to turn this project into something bigger than just a…

Christmas Break Project

Over the Christmas break I put together a small side project to emulate an Apple 1. I grew up with an Apple ][+, which has the same CPU. It was fun to look back at 6502 assembly language. The Apple 1 is a remarkable machine. Open source did not formally exist in 1976, but in the true hacker spirit, everything about the Apple 1 was well documented and publicly available. It came with instructions…

Finding your way home with Clojure

Learning a new technology is much more fun when you actually have a mission. So I decided to make a little web app that can show the departure times of streetcars in Toronto. This is possible because the City of Toronto has made the NextBus API available as part of its Open Data initiative, which provides info about routes, stop locations and arrival time predictions. You can see the end result in…

Signing AWS Requests With Your Arduino

TL;DR Are you nervous when you include that Amazon Web Services secret key in a config file? Fear no more. With this weekend hack you can turn your Arduino Due into a device that securely stores your AWS credentials and let it sign AWS API requests. Introduction In the industry a device like this is commonly known as a Hardware Security Module; an appliance (or PCI card) that manages your keys…