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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/21/10 12:06
Read: times


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

http://www.youtube.com/watch?v=pCx6SKWVDkw
http://www.youtube.com/watch?v=6XF6x49gVPE
http://www.efton.sk/misc/snake.zip

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 8052.com 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.

Enjoy!

Jan


List of 7 messages in thread
TopicAuthorDate
Snake on 8052.com SBC            01/01/70 00:00      
   As a C noob...            01/01/70 00:00      
      C-hatred            01/01/70 00:00      
   upgrade            01/01/70 00:00      
      8 bit LCD            01/01/70 00:00      
         LCD, 4 vs 8 bit            01/01/70 00:00      
   add a cast here?            01/01/70 00:00      

Back to Subject List