To recap - for this year's summer Retrochallenge, I want to write 9 games - 3 each on 3 different platform/language combinations. Two of the nine are complete! And with a recent time extension granted by our illustrious organizer, I might just get all 9 done.
This blog post documents Craps on the Atari 800, using the X-Forth language.
X-Forth is a derivative of figForth, but intends to be more compatible with the ANSI Forth standard. However, it's not completely ANSI-compatible yet. This means it can take some digging and trial and error to figure out which Forth words are implemented, and whether their behavior is figForth or ANSI. While there is no manual, there are a couple of sample programs that helped me riddle this all out.
I'd like to go more into details on some of the things I learned, but while I go write the deep-dive, here's a video demo of the program, and the source code. Note that neither are incredibly impressive. There is no color, sound or graphics - weird for a game on the Atari. Right now, it's all text. However, when you look at how a Forth program is unpacked - words within words, culminating in atomic definitions - it won't be hard to modify the program in a modular fashion to get some more exciting UI implemented.
Here's the video:
And here's the source code:
( RC-CRAPS for Atari 800/X-Forth )
( Version 0.1 )
( Licensed under Creative Commons )
( BY-NC-SA 3.0 )
( By Earl Evans )
( www.retrobits.com )
( for Retrochallenge SC 2014! )
( TO-DO: )
( Add graphics and sound! )
( Find better psuedo-random )
( number generator. )
( Make input routines more )
( bulletproof, perhaps with )
( assembly-language words. )
125 EMIT ( Clear screen )
CR
." RC-CRAPS for Atari 800/X-Forth." CR
." Version 0.1"
." Licensed under Creative Commons" CR
." creativecommons.org/licenses/" CR
." by-nc-sa/3.0/" CR CR
." RANDOM word courtesy of" CR
." James M. Reneau, Ph.D. via Creative" CR
." Commons at:" CR
." www.renejm.net/" CR
." 6502FIGForthHandyRandom" CR
CR
." Initializing variables"
1000 VARIABLE BANKROLL
0 VARIABLE BET
21 CONSTANT NAME-LEN
-1 VARIABLE PLAYER NAME-LEN ALLOT
PLAYER NAME-LEN 32 FILL
0 VARIABLE POINT
0 VARIABLE SEEDHIGH
0 VARIABLE SEEDLOW
0 VARIABLE RANDOMSEED
0 VARIABLE RANDOMKICK
CR
." Loading Utility Functions"
: WAITKEY ( -- )
( Waits for a keypress )
KEY DROP ;
: CLS ( -- )
( Clears the Atari screen )
125 EMIT ;
: PRINT ( addr -- )
( Prints chars starting at )
( addr until reaches null )
( Better than TYPE, which )
( outputs the nulls and )
( other junk in the string )
( area. )
BEGIN DUP C@ 0= IF
DROP 1
ELSE
DUP C@ EMIT 1 + 0 THEN
UNTIL
;
: POKEY-RND ( -- n )
( Gets a psuedo random value )
( from the Atari 800 POKEY )
( chip, leaves on stack. )
53770 C@
;
CR
." Loading RANDOM"
: RANDOM ( M -- N )
( RETURN A RANDOM INTEGER FROM 0 TO M-1 )
( NOT VERY GOOD AND WILL CYCLE FOR VALUES )
( - WORKS OK WITH 100, AND 10)
( BY JAMES RENEAU - 2012-05-12 )
( - LICENSED UNDER CREATIVE COMMONS A-NC-SA )
RANDOMSEED @
67 * 103 + ABS 16383 MOD
DUP RANDOMSEED !
RANDOMKICK @
101 + ABS 16383 MOD
DUP RANDOMKICK !
+ SWAP MOD
;
CR
." Loading ASK-NAME"
: ASK-NAME ( -- )
( Asks for player name, places in PLAYER )
CR ." Please enter your name: "
PLAYER NAME-LEN EXPECT
;
CR
." Loading ASK-YN"
: ASK-YN ( -- n )
( Asks yes or no, if y or Y leaves 1 on
( the stack, 0 otherwise )
KEY DUP 89 = SWAP 121 = OR IF 1 ELSE 0 THEN
;
CR
." Loading ASK-BET"
: ASK-BET ( -- n )
( Asks for a bet amount 1 - 50, leaves )
( on stack )
CR ." Enter bet: "
QUERY BL WORD HERE NUMBER DROP SWAP DROP
BET !
;
CR
." Loading GET-RN"
: GET-RN ( -- n )
( Leaves random number 1 to 6 on stack )
6 RANDOM 1 +
;
CR
." Loading SHOW-HELP"
: SHOW-HELP ( -- )
( Displays help for playing the game )
CLS
." Make a bet $1-$50." CR
." Throw the first roll." CR
." 7 or 11 wins. 2 or 3 loses." CR
." 12 pushes." CR CR
." Any other roll becomes your 'point'." CR
." Roll until you get your point (win)" CR
." or get a 7 (lose)." CR CR
." Press any key to continue..."
WAITKEY
CLS
;
CR
." Loading INTRO"
: INTRO ( -- )
( Provides an intro to the game )
CLS CR
." Welcome to RC-CRAPS version 0.1!" CR
." Would you like instructions (Y/N)? "
ASK-YN IF SHOW-HELP THEN
;
CR
." Loading ROLL"
: ROLL ( -- n )
( One roll of the dice, leaves )
( dice total on stack )
CR
." Press any key to roll dice..."
WAITKEY
GET-RN GET-RN
CR ." You rolled " DUP . ." + " SWAP DUP . ." = " + DUP .
POINT @ DUP 0= IF
DROP
ELSE
CR ." You are trying for a " .
THEN
;
CR
." Loading CHECK-WIN"
: CHECK-WIN ( n -- n )
( Expects total of latest roll )
( on the stack. Leaves a code )
( on the stack of 0=roll again, )
( 1=win, 2=loss, 3=tie. )
POINT @ 0= IF ( First roll )
DUP 7 = SWAP DUP 11 = ROT OR IF ( win )
DROP 1
ELSE DUP 2 = SWAP DUP 3 = ROT OR IF ( loss )
DROP 2
ELSE DUP 12 = IF ( tie )
DROP 3
ELSE POINT ! 0 THEN THEN THEN ( roll again )
ELSE ( not the first roll )
DUP POINT @ = IF ( win )
DROP 1
ELSE DUP 7 = IF ( loss )
DROP 2
ELSE DROP 0 THEN THEN ( roll again )
THEN
;
CR
." Loading PLAY-ROUND"
: PLAY-ROUND ( -- n )
( Plays a round of the game )
( Leaves 1 on the stack for )
( another round, or 0 on the )
( stack to quit. )
ASK-BET
0 POINT ! ( Set initial "point" to zero )
BEGIN
ROLL CHECK-WIN
DUP 0= IF
CR ." Roll again!"
ELSE DUP 1 = IF
CR ." You win!"
BANKROLL @ BET @ + BANKROLL !
ELSE DUP 2 = IF
CR ." You lose!"
BANKROLL @ BET @ - BANKROLL !
ELSE DUP 3 = IF
CR ." Boxcars - no win or loss!"
THEN THEN THEN THEN
UNTIL
CR ." Your bankroll is: $" BANKROLL @ .
CR ." Play again (Y/N)? "
ASK-YN 0= IF 1 ELSE 0 THEN
;
CR
." Loading PLAY-GAME"
: PLAY-GAME ( -- )
( Plays the entire game, exits )
( to OK when done )
POKEY-RND SEEDHIGH !
INTRO
POKEY-RND SEEDLOW !
ASK-NAME
POKEY-RND RANDOMKICK ! SEEDHIGH @ SEEDLOW @ * RANDOMSEED !
BEGIN PLAY-ROUND UNTIL
CR ." Thanks, " PLAYER PRINT
CR ." for playing RC-CRAPS!"
CR ." Your final bankroll was: $" BANKROLL @ . CR CR
;
CR
." RC-CRAPS load complete!" CR
." Type PLAY-GAME [return] to play." CR
CR
Monday, July 28, 2014
Monday, July 7, 2014
Well, that's random
Why random numbers?
In order to make a fun game of chance, you need random numbers. Dice rolls, card shuffles, or a roulette wheel are no fun if they're predictable.
Mommy, where do randoms come from?
There are mathematical formulas that can provide a stream of seemingly random numbers. These are called pseudo-random number generators, or PRNGs. You start off a PRNG with a truly random "seed" number, from which the PRNG derives a sequence of numbers. Although this sequence gives the appearance of being random, it is completely predictable - each time the PRNG is started with the same seed, it will produce the same resulting sequence of numbers.
It all starts with a seed...
Thus, the initial seed for a PRNG must be truly as random as possible. Computers are great at many things, but being unpredictable isn't one of them - so to get some randomness (or "entropy" as it's called in Information Theory), we need the human touch. In this case, quite literally.
For each of the platforms I'm using for my Retrochallenge entry (Atari 800, Epson PX-8, PDP-11/23+), I wanted to find a suitably fast-changing clock or register that could be used as a seed. To get this value at a random time, you ask the user to press a key to perform some action (e.g., get their initial bankroll - thanks Ian!). After their key press, a value is sampled from the high-speed clock and used as the seed value. As long as that clock is fast enough, then voila, there's your random number seed.
Harvesting the seed
The PX-8 was the most ideal. There is a 614.4 KHz clock that updates a rolling 16-bit register, the value of which can be read with from the BASIC "INP" function. This function reads values from Z80 I/O registers. Since 614.4 KHz will update the value more than 600,000 times per second, it is unlikely in the extreme that a user could predict when to press a key even if they wanted to.
The Atari 800 and PDP-11 were not as good, but still passable. Each have memory-mapped registers that update at 60 Hz. Typically called "ticks", these are internal clocks for the computer's functions. In the Atari, it's part of the ANTIC video chip, and for the PDP-11, it's a component of the line clock. Reading the value of minutes, seconds and ticks after a user key press should provide an ample source of randomness. On the PDP-11, there is a system library function, callable from Fortran, called "GTIM", that provides the current count of ticks. On the Atari, in Forth, the value can be read with "C@", the Forth equivalent of a one-byte PEEK function.
Now we have a seed, how 'bout some numbers?
PX-8 BASIC also has a PRNG built-in. You seed it with the "RANDOMIZE" statement, then use the RND function to get random numbers (fractions 0<=x<1). For Forth and Fortran, I need to provide the PRNGs; however, there are happily some good ones online.
So hey, pal, no counting cards in my RC casino!
In order to make a fun game of chance, you need random numbers. Dice rolls, card shuffles, or a roulette wheel are no fun if they're predictable.
Mommy, where do randoms come from?
There are mathematical formulas that can provide a stream of seemingly random numbers. These are called pseudo-random number generators, or PRNGs. You start off a PRNG with a truly random "seed" number, from which the PRNG derives a sequence of numbers. Although this sequence gives the appearance of being random, it is completely predictable - each time the PRNG is started with the same seed, it will produce the same resulting sequence of numbers.
It all starts with a seed...
Thus, the initial seed for a PRNG must be truly as random as possible. Computers are great at many things, but being unpredictable isn't one of them - so to get some randomness (or "entropy" as it's called in Information Theory), we need the human touch. In this case, quite literally.
For each of the platforms I'm using for my Retrochallenge entry (Atari 800, Epson PX-8, PDP-11/23+), I wanted to find a suitably fast-changing clock or register that could be used as a seed. To get this value at a random time, you ask the user to press a key to perform some action (e.g., get their initial bankroll - thanks Ian!). After their key press, a value is sampled from the high-speed clock and used as the seed value. As long as that clock is fast enough, then voila, there's your random number seed.
Harvesting the seed
The PX-8 was the most ideal. There is a 614.4 KHz clock that updates a rolling 16-bit register, the value of which can be read with from the BASIC "INP" function. This function reads values from Z80 I/O registers. Since 614.4 KHz will update the value more than 600,000 times per second, it is unlikely in the extreme that a user could predict when to press a key even if they wanted to.
The Atari 800 and PDP-11 were not as good, but still passable. Each have memory-mapped registers that update at 60 Hz. Typically called "ticks", these are internal clocks for the computer's functions. In the Atari, it's part of the ANTIC video chip, and for the PDP-11, it's a component of the line clock. Reading the value of minutes, seconds and ticks after a user key press should provide an ample source of randomness. On the PDP-11, there is a system library function, callable from Fortran, called "GTIM", that provides the current count of ticks. On the Atari, in Forth, the value can be read with "C@", the Forth equivalent of a one-byte PEEK function.
Now we have a seed, how 'bout some numbers?
PX-8 BASIC also has a PRNG built-in. You seed it with the "RANDOMIZE" statement, then use the RND function to get random numbers (fractions 0<=x<1). For Forth and Fortran, I need to provide the PRNGs; however, there are happily some good ones online.
So hey, pal, no counting cards in my RC casino!
Monday, June 30, 2014
Retrochallenge 2014 - Get Set
Now it's 11:37 PM Pacific Time, and the excitement is building on the West Coast of the US, where Retrochallenge 2014 is about to commence!
The computers are ready. But, alone, are they enough to stand up to the tests of character and strength that await them? Take heart, there is help from the sidelines.
The Raspberry Pi
Serving once again as a trusty virtual disk drive for the PX-8, the Raspberry Pi is ready to retrieve and store BASIC programs:
SIO2PC
Hey, the PX-8 isn't the only kid that gets to play with a virtual disk drive. The SIO2PC, a device which conveniently hooks an Atari 8-bit system to a modern PC, festooned with blinky lights, is standing by:
The Manuals
Books are the stuff of life, and the reference materials are also waiting in their corner. Here are, in no particular order, the Atari 800 "Purple Book", the KED editor (PDP-11) quick reference, and the Epson PX-8 BASIC Reference Guide:
Notice that nothing is powered on... No, my friends, that celebration comes in just a few minutes, as these digital animals are let out of their time-boxed cage! BWA HA HA HA HA HA.
Ha.
See you in the morning!
The computers are ready. But, alone, are they enough to stand up to the tests of character and strength that await them? Take heart, there is help from the sidelines.
The Raspberry Pi
Serving once again as a trusty virtual disk drive for the PX-8, the Raspberry Pi is ready to retrieve and store BASIC programs:
The Raspberry Pi wishes it was a PX-8 |
SIO2PC
Hey, the PX-8 isn't the only kid that gets to play with a virtual disk drive. The SIO2PC, a device which conveniently hooks an Atari 8-bit system to a modern PC, festooned with blinky lights, is standing by:
Tomorrow, these LEDs shall blink |
The Manuals
Books are the stuff of life, and the reference materials are also waiting in their corner. Here are, in no particular order, the Atari 800 "Purple Book", the KED editor (PDP-11) quick reference, and the Epson PX-8 BASIC Reference Guide:
Notice that nothing is powered on... No, my friends, that celebration comes in just a few minutes, as these digital animals are let out of their time-boxed cage! BWA HA HA HA HA HA.
Ha.
See you in the morning!
Retrochallenge 2014 - On Your Marks
It's 10:49 PM Pacific Time in Portland, Oregon. The temp is 74 degrees outside, and it's going to be a whopping 98 tomorrow. That's 36.6 Celsius, quite warm by any measure.
In just over an hour, this year's Retrochallenge will begin for those of us on the West Coast of the US. Much of the world has already started. Eclipsing the Olympics and even the current World Cup frenzy, the Retrochallenge is the ultimate test of strength, agility, and stamina.
OK, so, maybe that's over the top. However, I'm quite excited. In preparation, I've readied my systems. Here they are, in descending order of gross metric tonnage:
The PDP-11/23+
Weighing in at over 300 pounds (>136 kilos) is the PDP-11/23+. It's loaded with the venerable Fortran 77 compiler. I love to say venerable. I'm not even sure what it means. But it's impressive.
The Atari 800
Yes, this is the original Atari 800, packed with 1.79 MHz of raw 6502 power, and running the venerable Extended Fig-Forth.
The Epson PX-8
Last but not least (except in weight), the Epson PX-8 and BASIC in ROM stand ready to meet any challenge. It's sitting next to my Dell E6430, but they don't talk much. Generation gap.
I guess it's not venerable, but it is cute:
All this takes massive, Earth-shaking power to run:
(Do you think this is a fire hazard?)
These computers have accoutrements, which I will describe in the next blog post ("Get Set")!
I am shaking out the muscles, and getting ready for the sprint!
OK, so, maybe that's over the top. However, I'm quite excited. In preparation, I've readied my systems. Here they are, in descending order of gross metric tonnage:
The PDP-11/23+
Weighing in at over 300 pounds (>136 kilos) is the PDP-11/23+. It's loaded with the venerable Fortran 77 compiler. I love to say venerable. I'm not even sure what it means. But it's impressive.
The venerable PDP-11/23+ with venerable Fortran 77 |
The Atari 800
Yes, this is the original Atari 800, packed with 1.79 MHz of raw 6502 power, and running the venerable Extended Fig-Forth.
Atari 800 with Commodore monitor |
The Epson PX-8
Last but not least (except in weight), the Epson PX-8 and BASIC in ROM stand ready to meet any challenge. It's sitting next to my Dell E6430, but they don't talk much. Generation gap.
I guess it's not venerable, but it is cute:
The Epson PX-8 and Dell E6430, brothers from another mother |
All this takes massive, Earth-shaking power to run:
60 Hz and loving it |
(Do you think this is a fire hazard?)
These computers have accoutrements, which I will describe in the next blog post ("Get Set")!
I am shaking out the muscles, and getting ready for the sprint!
Friday, June 13, 2014
Retrochallenge Summer 2014
For my Retrochallenge Summer 2014 entry, I want to do a 3 x 3 game marathon.
3 games:
3 platforms - choice of:
Language choices:
Challenges:
So, super-duper success is all nine games (3 x 3) implemented, including graphics and sound applicable to the platform(s). Just barely crossing the finish line is one game on one platform. No games equals total loss and utter humiliation.
If you have suggestions on platforms or languages, let me know!
3 games:
- 21
- Craps
- Roulette
3 platforms - choice of:
- Commodore VIC-20
- Commodore 64
- Commodore 128
- Apple II
- Atari 800
- TRS-80 Model 100
- Epson PX-8
- PDP-11 with VT-100 terminal
Language choices:
- C
- Forth
- BASIC
Challenges:
- Will need a good pseudo random number generator (PRNG) and a good seed
- Will have to understand the I/O approaches for each of the three chosen platforms and languages
- Will have to decide which subset of rules for each of the games will be implemented
So, super-duper success is all nine games (3 x 3) implemented, including graphics and sound applicable to the platform(s). Just barely crossing the finish line is one game on one platform. No games equals total loss and utter humiliation.
If you have suggestions on platforms or languages, let me know!
Monday, May 26, 2014
Show 146 - Building a Modern Day Retrocomputer
Hi there!
In Show 146, I discuss building a modern computer styled after systems from days gone by. Here are some links from the episode:

This work is licensed under a Creative Commons Attribution 4.0 International License.
In Show 146, I discuss building a modern computer styled after systems from days gone by. Here are some links from the episode:
- Direct MP3 episode download
- Time Magazine - Fifty Years of BASIC
- PC World - The mainframe turns 50, or, why the IBM System/360 launch was the dawn of enterprise IT
- RCR Podcast #73 - BASIC and the IBM System/360 are discussed
- YouTube - Homebrew Computer Club Reunion, 2013
- The Complete Historically Brewed by David Greelish - available now in eBook!
- The FIGnition inFUZE SBC Kit
- Propellerpowered Pocket Mini Computer
- Some links for Parallax Propeller resources: Home Page, Forums, and Object Exchange.

This work is licensed under a Creative Commons Attribution 4.0 International License.
Friday, January 31, 2014
Retrochallenge Winter Warmup 2014 Success!
A few years ago, inspired by software disk drive emulators for the Epson PX-8 laptop computer, I set out to find a self-contained hardware/software combination that could serve as a portable drive. This would be a functional replacement for the PF-10 portable drive, which is unobtainium these days.
With the conclusion of this year's Retrochallenge Winter Warmup 2014, I'm quite a bit closer to the goal. The only thing missing is battery power, which I might be able to solve at some point.
Before going into gory details, here is a video of the drive emulator in action:
Now, the rest of the story...
HARDWARE
The Epson PX-8 is one of the first notebook computers. It's a gem. For a long time, they were still available (recently) brand-new in box. Alas, the distributor is now out of stock. I used the PX-8 back in the day, and worked on the support team for them at Epson. I did an entire podcast episode on this computer, so have a listen if you'd like to learn more.
The centerpiece of the drive emulator project is the Raspberry Pi - a $35 single board Linux computer. You can do a LOT of stuff with it. If this fine device has not made it onto your radar as yet, have a look at these links:
Raspberry Pi on Wikipedia
Raspberry Pi Official Site
Slapped on top of the Raspberry Pi is another key ingredient - the PiFace Control and Display (PiFaceCAD). It is a combination of things designed to help you control your Raspberry Pi without requiring the standard KVM (keyboard/video/mouse) setup. Here's a picture, with credit to the distributor, Element14:
It has a backlit 16x2 LCD display, 5 pushbuttons plus a rocker/button combo on the back, an infrared remote control reader (which I did not use), and a socket which attaches to the I/O pins on top of the Raspberry Pi. You can program all the functionality with Python, as well as do some things from C. I used Python, given it has good support for calls to the operating system.
To round out the hardware, I used a FTDI USB to RS232 converter as the serial port to connect the Raspberry Pi with the Epson PX-8. The final connection to the PX-8 required a custom cable, a mini DIN 8 to DB9. I will provide more info on this in a future post, and you can also find info on building such cables at Fred J. Kraan's site for the PX-8.
SOFTWARE
There are two key pieces of software, plus some configuration, involved in making this all work.
First, credit again to Fred J. Kraan for the vfloppy software, a disk drive emulator and set of associated disk image management utilities for the Epson PX-8. The software is updated from time to time, and not too long ago, switched to a new disk image format to make it compatible with a PX-8 emulator.
The vfloppy program is a command-line tool, so I needed to instrument it somehow to work with the PiFace CAD. Python was the natural choice for the "glue" logic to create a UI on the LCD screen, and launch the software with the disk image selected by the user. The "subprocess" module in Python permits the invocation of processes, and then control of those processes throughout their life cycle.
So, in short, I wrote a Python program to:
Writing the program wasn't the complete picture, however. The Raspberry Pi needed to run the program on boot-up. To accomplish this, I performed these steps:
I learned so much during this Retrochallenge, most notably about Python. I'll blog in a later post about some of the things I picked up (they're handy!).
Looking forward to the summer classic!
With the conclusion of this year's Retrochallenge Winter Warmup 2014, I'm quite a bit closer to the goal. The only thing missing is battery power, which I might be able to solve at some point.
Before going into gory details, here is a video of the drive emulator in action:
Now, the rest of the story...
HARDWARE
The Epson PX-8 is one of the first notebook computers. It's a gem. For a long time, they were still available (recently) brand-new in box. Alas, the distributor is now out of stock. I used the PX-8 back in the day, and worked on the support team for them at Epson. I did an entire podcast episode on this computer, so have a listen if you'd like to learn more.
The centerpiece of the drive emulator project is the Raspberry Pi - a $35 single board Linux computer. You can do a LOT of stuff with it. If this fine device has not made it onto your radar as yet, have a look at these links:
Raspberry Pi on Wikipedia
Raspberry Pi Official Site
Slapped on top of the Raspberry Pi is another key ingredient - the PiFace Control and Display (PiFaceCAD). It is a combination of things designed to help you control your Raspberry Pi without requiring the standard KVM (keyboard/video/mouse) setup. Here's a picture, with credit to the distributor, Element14:
It has a backlit 16x2 LCD display, 5 pushbuttons plus a rocker/button combo on the back, an infrared remote control reader (which I did not use), and a socket which attaches to the I/O pins on top of the Raspberry Pi. You can program all the functionality with Python, as well as do some things from C. I used Python, given it has good support for calls to the operating system.
To round out the hardware, I used a FTDI USB to RS232 converter as the serial port to connect the Raspberry Pi with the Epson PX-8. The final connection to the PX-8 required a custom cable, a mini DIN 8 to DB9. I will provide more info on this in a future post, and you can also find info on building such cables at Fred J. Kraan's site for the PX-8.
SOFTWARE
There are two key pieces of software, plus some configuration, involved in making this all work.
First, credit again to Fred J. Kraan for the vfloppy software, a disk drive emulator and set of associated disk image management utilities for the Epson PX-8. The software is updated from time to time, and not too long ago, switched to a new disk image format to make it compatible with a PX-8 emulator.
The vfloppy program is a command-line tool, so I needed to instrument it somehow to work with the PiFace CAD. Python was the natural choice for the "glue" logic to create a UI on the LCD screen, and launch the software with the disk image selected by the user. The "subprocess" module in Python permits the invocation of processes, and then control of those processes throughout their life cycle.
So, in short, I wrote a Python program to:
- Present a UI for the user to select a disk image
- Monitor the PiFaceCAD buttons for interaction
- Once an image was selected, run the vfloppy program and save the process ID
- When user pressed "SELECT", stop the vfloppy program, and permit a new image selection, running vfloppy again once selected
- Exit the program if "EXIT" is selected, and stop the vfloppy process
Writing the program wasn't the complete picture, however. The Raspberry Pi needed to run the program on boot-up. To accomplish this, I performed these steps:
- Created a new user on the Raspberry Pi
- Added that user to groups as necessary to permit access to the Pi's I/O (gpio, spi)
- Edited the user's startup shell script (~/.bashrc) to run the PF-2014 software on login
- Set the Pi to auto-login the new user
I learned so much during this Retrochallenge, most notably about Python. I'll blog in a later post about some of the things I picked up (they're handy!).
Looking forward to the summer classic!
Subscribe to:
Posts (Atom)