Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Wednesday, June 11, 2014

Abandoned Farmhouse Adventure now in Google Play Store

Back in April 2012, I wrote a text adventure game  as an experiment to try out the CC65 C compiler on the Briel Replica 1 computer  (an Apple 1 replica). Because it was written in C, it also ran under Linux, and any platform that supported a reasonable C compiler. I also ported it  to the Briel Altair 8800 computer running CP/M using the BDS C compiler.

When the Raspberry Pi store opened, I packaged it and submitted it as one of the first applications in the Raspberry Pi store.

Later, I made a GUI version using the Qt Toolkit , which is portable to a number of platforms. I intend to release the Qt version into the Raspberry Pi store, but have not gotten around to doing that yet.

With Qt now supporting Android, I tried building it for Android to run on a tablet, and it worked almost flawlessly without any changes. I made a few small tweaks for Android, and packaged it for the Google Play store. It is now available as a free Android application.

Android Version of The Abandoned Farmhouse Adventure
I doubt that any application before has run on an Apple 1, CP/M, Linux desktop, Raspberry Pi, and Android tablet - devices that span almost 40 years of computing and differences in computing power of several thousand times.

Monday, January 14, 2013

More About the Abandoned Farmhouse Adventure


I mentioned here earlier that I ported my Abandoned Farmhouse Adventure  game to the Raspberry Pi and got it into the Pi Store as a free download. Here are some more details about the game and how it was developed for people that may be interested.

The program was written in the C programming language, consisting of just over 800 lines of source code. I originally wrote it in March 2012 as a game for the Replica 1 Computer, a replica of the first computer, the Apple 1, offered by Apple Computer in 1976.

The Briel Replica 1 Computer
On the Replica 1 it was compiled using the CC65 compiler which supports the 8-bit 6502 microprocessor used by the Replica 1 (and Apple 1). It took me a few evenings and weekend mornings to design and write the game. The game had to fit within the hardware constraints of the Replica 1: a one MHz 8-bit processor with only a few kilobytes of memory and only text output.

I did most testing of the game on a Linux desktop system using the GNU gcc compiler, as it was faster and easier to build and debug than on the Replica 1.

The game was announced on the Briel Computers forum and made available to any Replica 1 or Apple 1 computer users who wanted to try it.

I've been following the Raspberry Pi since it's early development. With the announcement of the Raspberry Pi store, I thought it would be fun to get an application in the new store. The adventure game was already running on Linux so getting it on the Linux-based Raspberry Pi should be straightforward. Porting it to the Raspberry Pi involved adding lower case text (the Apple 1 could only display upper case text). I also removed some code that was specific to the CC65 compiler. Most of the work was figuring out how to publish an application in the Raspberry Pi app store, and waiting for it to pass through the application approval process.

Screen Shot Of The Game
For people trying the game, I won't give a solution or any spoilers, but here are a few hints. I suggest drawing out a map on a piece of paper and making notes as you play the game. Pay attention to any messages, like needing food or water, as these will soon become important in the game. Not all items in the game are necessarily needed to solve it; some may be red herrings. The game will take some time to solve. Keep at it. If you get frustrated, set it aside for a while and you may think of some new insight into how to solve it.

I would really like to hear from you if you solved the game, or even if you played it but did not complete it yet. As I write this the game has had 361 downloads but no one has actually reported completing the game. I don't think I made it too hard, but it is difficult as the developer to stand back and assess how challenging the game is.

I have been planning to make a version of the games with a Qt-based graphical user interface on it, which would be less like a retro text adventure game but more playable by people accustomed to modern GUIs.

Early Prototype of GUI Version of the Game
The game is open source and published under an Apache license. The source code can be found here. You are free to share, port, or modify the game subject to the terms of the Apache license. If you are really stuck solving the game and are at all fluent in C code, you could look at the source code to get some hints. Much of the code is data-driven and could be used to implement an entirely different adventure just by changing the map, strings, and some of the logic that handles special actions.

Finally, the farm described here is based on a real farmhouse where my father lived many years ago, right down to the layout of most of the rooms. And I also have a grandson who was almost three years old at the time I wrote this. It is interesting to think that in a few years he may come across this game in which he appears and maybe play it.

Monday, December 31, 2012

Grab Bag: Raspberry Pi Case and App Store



I was ordering some electronic parts from Jameco recently and I notice they now carry an inexpensive Raspberry Pi case, so I ordered one. The case is made by Bud Industries. It is a simple design with only two (identical) plastic pieces that go together. It's a little big, but has the benefit of allowing lots of ventilation and it will probably have room for some of the available expansion boards or a ribbon cable connector to the GPIO pins.


Raspberry Pi Case
Recently I was digging through my junk box looking for a specific chip and realized I don't have very many TTL chips. I like electronics grab bags, and Jameco sells a number of different ones, so I also picked up their 100 Piece TTL Semiconductor Grab Bag. I just started sorting them but it looks like I got quite a good assortment of devices. They say it can contain surface mount parts as well as through hole but my grab bag only included DIP packages, which is great.

100 TTL Chips
The Raspberry Pi foundation recently opened an application store, for both paid and free apps. So I ported a small text adventure game that I wrote in C, originally for my Apple 1 replica, and packaged it for the Raspberry Pi store. It is a free download and you can get it from here.  I think the game is quite challenging and I encourage you to try it out if you have a Raspberry Pi. I'm also working on a graphical version that will use the Qt toolkit.

Tuesday, December 18, 2012

Raspberry Pi Radiation Monitor


Some time ago built this Geiger counter kit. Details are in this Youtube video. I originally hooked it up via a serial port to a Linux desktop system running an Apache web server and wrote a simple shell script that displayed the current radiation level. Recently I moved it over to a Raspberry Pi.

The serial port uses the AdaFruit FTDI friend to convert the 3.3V level serial port on the Geiger counter to a USB serial device.

My son recently wrote some Python code to generate a nicer looking web page that includes a graph.
It uses the RGraph library.

I then made a little C program that reads the radiation data from the serial port, and writes it out in CSV format so it can be easily parsed by the Python code that generates the graphs. A cron job updates the web page every hour with the latest data.

Here is a picture of the hardware setup using a Raspberry Pi as the attached computer which is running the Apache web server:



And here is a closer shot of the Geiger counter:


Here is an image of a typical web page:


And here are some items that I use for testing the Geiger counter that are slightly radioactive: a couple of buttons made from glass that is coloured with Uranium:


If the system is active and I am not otherwise using the Raspberry Pi for something else, you can see the graph at this URL.

Wednesday, November 21, 2012

Arduino and GertBoard


The Arduino compatible microcontroller on the GertBoard is a nice feature that allows you to run most Arduino programs or "sketches" as they are called. They are written in a simplified subset of the C/C++ programming language. The Arduino chip has on-board digital and analog input/output pins and is more suited to real-time control than the Raspberry Pi which is running Linux, because you have full control of the chip for running your code. Under Linux, many processes are typically running and can preempt your device control program. The Arduino programs reside in flash memory so they are non-volatile and they start up in a fraction of a second from power on. The main limitations of the Arduino are that it can only run small programs, a few kilobytes in size, and it doesn't have a full operating system with features like a complete file system.

The work is all done by an Atmel ATmega 328 chip running at 12MHz. A special version of the "avrdude" program is available which allows the chip to be programmed from the Raspberry Pi's SPI bus on the GPIO port. The Arduino IDE, which runs fine on the Raspberry Pi, can then compile and upload programs to the Atmega chip.

Raspberry Pi and GertBoard

It provides 14 digital and 6 analog input/output pins. I ran several Arduino sketches which exercised the analog and digital inputs and outputs as well as the serial port. Remember these are in addition to the input/output ports of the GertBoard itself.

The Atmega chip on the GertBoard should be compatible with many Arduino programs but it is not directly compatible with Arduino shields (add-on boards) because it has a different hardware form factor, and it runs at 3.3V levels rather than the 5V logic of standard Arduinos.

Now, with all these capabilities, I have to think of a good hardware project.

Sunday, November 18, 2012

Testing The GertBoard


I was in Berlin, Germany this week to attend the Qt Developer Days conference Europe where I gave a talk on Qt and Raspberry Pi. I'll be giving the same talk at Qt Developer Days North America in Santa Clara, California from December 5 to 7, 2012.

Now that I am back home the the GertBoard has been assembled and is confirmed to be working.

Assembled GertBoard

I ran the included programs that exercise the pushbuttons, LEDs, open collectot drivers, PWM motor controller, A/D converter, and D/A converter.

Setup For Testing Motor Control
 Next up is to try the Arduino compatible microcontroller. I hope to make some videos of some programs running and post them on YouTube.

Testing the GertBoard and Raspberry Pi on the Bench

Friday, November 9, 2012

GertBoard Assembled

Soldering of the GertBoard kit took an evening, taking my time and examining all parts and solder joints carefully. I found the SMT parts were quite easy to solder -- my only worry was that I would lose some of them!

Assembled GertBoard (less ICs)

I've now completed the assembly and just have to insert the ICs before being ready to give it the initial "smoke test". Unfortunately it will have to wait a week until I am back from the Qt Developer Days conference in Germany where, among other things, I will be giving a presentation on Qt and the Raspberry Pi.

Thursday, November 8, 2012

GertBoard Kit Arrived


After several months of waiting I finally received my GertBoard kit. The GertBoard is an input/output expansion board for the Raspberry Pi.

Parts Included In GertBoard Kit

PCB Before Installing Components
It is shipped as a kit, although this is likely to change soon. It requires a significant number of parts, including some surface mount parts, so it is somewhat challenging to assemble.

So far I have reviewed the assembly instructions and confirmed that I have all the parts. In preparation, I did some practice soldering of some surface mount parts on some bare PCB. That went well so I am ready to start assembly.

SMT Soldering Practice

I'll post more here on my progress.

Saturday, October 6, 2012

First Raspberry Pi Hardware Hacking


I did a little hardware hacking with the Raspberry Pi board.  It has some GPIO pins on a connector that can be used for hardware expansion. I bought two low cost kits from AdaFruit that make it easier to use the GPIO port.

The Pi Cobbler kit  provides a connector to the GPIO port and a ribbon cable that goes to a small breakout board that can plug into a solderless breadboard. It has all the pins nicely labelled. Below are a couple of pictures of my assembled board connected to a Raspberry Pi.

Pi Cobbler Plugged in to a mini Solderless Breadboard


Pi Cobbler Connected to Raspberry Pi Driving an LED

The Prototyping Pi Plate kit is a board which plugs onto the Raspberry Pi, similar to an Arduino Shield, that provides access to the GPIO pins via terminal blocks and provides a prototyping area for circuitry. I also purchased a mini solderless breadboard which can fit on the Pi Plate. A couple of pictures are shown below.
Pi Plate Mounted on Raspberry Pi
Driving an LED

Both kits went together easily in about 15 to 20 minutes with a little soldering. So far I have only had time to run simple programs to flash an LED driven by one of the GPIO lines (both shell script and C language versions). You can find lots of documentation and programming examples at this link.

I'm still waiting to receive my Gertboard, which is a more sophisticated input/output board for the Raspberry Pi that provides buffered input and output circuity and analog to digital and digital to analog converters. It also has an Arduino compatible chip on it.

Sunday, August 12, 2012

Replica 1 Quick Reference, Apple 1 on the Raspberry Pi, and the return of IMSAI


Earlier I made a one page reference of useful addresses for the Replica 1. I've extended that into a more comprehensive four page quick reference. You can download it from here. That directory also has some documents I wrote like a summary of the 65C02 and 65816 processors and some errata for Apple 1 manuals.




I recently got a Raspberry Pi board. This is a very small (credit card sized), low cost ($35) embedded desktop computer that can run Linux. For fun I compiled the POM1 Apple 1 Emulator on it. It ran quite well although it was a little slow on the Raspberry Pi's 600MHz ARM CPU. I've ordered a hardware expansion board for the Raspberry Pi called the Gertboard and plan to use if for some hardware experiments.




I've started playing with the Propeller CPU on the Replica 1. It is quite an amazing chip - 8 CPUs with shared memory, a built-in high level language interpreter as well as machine language, and hardware I/O ports. It can even generate video (which it does for the Replica 1). I'll have more to say here as I explore it further.




I'm looking forward to getting the Apple Cassette Interface when Briel computers starts shipping them. It sounds like big things are in store for Briel Computers. Vince Briel is planning to purchase the assets
of IMSAI computer. They were one of the first home computer manufacturers (along with Altair) and a portion of the company was still in business. He is hoping to restart a project they had to introduce a new replica of the original IMSAI 8080 computer.