Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Jan Waclawek
02/21/10 05:06
Read: 2714 times

Msg Score: +1
 +1 Informative
#173380 - Snake on SBC
I attempted to create a small videogame, using the SBC.

The "graphical capabilities" of HD44780-compatible 16x02 LCD module are rather limited by the max. 8 custom characters, and this severely influences the game. To preserve the snake's integrity, as soon as the 8 character is consumed for the snake's "body", "food" and "poison" start to disappear. The challenge is thus to try to keep a longer snake within less than 8 characters, to allow for more "food" to be generated. This turned out to be maybe more fun than the "standard" snake! :-)

Control is through UART - in my setup, I used a serial terminal set to 19200 baud; the controlling keys are 'j','k','l','i' for left/down/right/up. Those who want to test their ability to think relatively may try also to use 'q' and 'w' for relative turns. I believe it is easy to adopt the game to be controlled from buttons or the matrix keyboard which came with the SBC.

I've used a P89C51RD2 in 12-clock mode at 22.1184MHz, but as the hex is less than 8kB long so that this should run on any vanilla 8052. Of course it is not necessary to have the SBC - any '51 board with the LCD module will do.

Compiled by SDCC, but I am confident that it could by ported to Keil or other '51 C compiler quite easily.

SDCC throws a couple of warnings (including the famous Evelyn one :-) ), but those I believe are results of bugs in SDCC - I've filed respective bugreports already.

I would be very happy if anybody would try and reproduce the game on his setup, and report back here.



List of 7 messages in thread
Snake on SBC        Jan Waclawek      02/21/10 05:06      
   As a C noob...      Robert Revens      02/21/10 07:09      
      C-hatred      Jan Waclawek      02/21/10 07:18      
   upgrade      Jan Waclawek      02/21/10 08:44      
      8 bit LCD      Jez Smith      02/21/10 09:12      
         LCD, 4 vs 8 bit      Jan Waclawek      02/21/10 13:32      
   add a cast here?      Frieder Ferlemann      02/21/10 15:18      

Back to Subject List