The software

Ethersex logo

I decided to use the excellent but strangely named Ethersex framework to run the show. Ethersex consists of an uIP-based TCP/IP-stack paired with a bunch of services and protocols: it has webservers, syslog-clients, even OpenVPN-support can be compiled into the binary. This is coupled with a nice menu system so you can easily select what features you want.

The special sauce I added to support the arcade machine consists of 2 modules. Both add so-called ecmds to Ethersex: commands you can send to the AVR over the serial port, a telnet connection or using a HTTP request.

The first module is a hardware driver called z80interface. It is written with the hardware I made in mind, and it knows how to take over the Z80s bus and read or write a byte to the main memory. It has no knowledge of the code or memory map of the Z80; in theory, you could use this module plus the hardware on any machine built around a Z80. With some modifications, it probably even works on other 8-bit CPUs too.

The second module is called arcade1943, and does the things specific to the 1943 arcade machine: it is aware of e.g. highscore memory locations, where the video RAM lives and ascii-to-tile mappings. Most of the work it does automatically and in a routine called every second: the routine will read the highscores and if they are changed, copy them to the internal EEPROM, so they can be copied back to main memory if the machine reboots. This routine will also check if there's a message queued to be written to memory, and if so, it will write it out on the 4th line from the bottom. That way, the machine can be used to display relevant information from all over the world... or it can be used to taunt that player trying to beat your highscore when you're not in the space. Its also used to display the IP the machine gets, so there's no need to connect a serial terminal to the machine to find out its address.

The interface to Twitter is done using a Linux-server in the hackerspace running a small script. Periodically, it checks the current high scores using the HTTP server running on the AVR, When they are changed, a tweet is sent. Goez

« Prev 4 Next »

© 2006-2022 Sprite_tm - Contact