summaryrefslogtreecommitdiffstats
path: root/software/pong3/pong3.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/pong3/pong3.c')
-rw-r--r--software/pong3/pong3.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/software/pong3/pong3.c b/software/pong3/pong3.c
index 59530cb..aba6ae6 100644
--- a/software/pong3/pong3.c
+++ b/software/pong3/pong3.c
@@ -43,17 +43,22 @@ update_gpu (int x, int y, int bat0, int bat1)
static void
show_score (int score)
{
+ // int to seven segment lookup: MSB dp g f e d c b a LSB
const uint8_t lookup[10] =
{ 0x3F, 0x6, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x7, 0x7F, 0x6F };
+
uint8_t ss = 0;
+ // show negative with DP
if (score < 0)
{
ss |= 0x80;
score = -score;
}
+
if (score > 9)
score = 9;
+
ss |= lookup[score];
pio_write (ss);
@@ -69,9 +74,7 @@ load_sprite (void)
const unsigned int n = sizeof (sprite) / sizeof (uint16_t);
unsigned int i;
- // RRR GGG BBB
- // set the sprite color 111 010 000 - orange
- gpu_write (GPU_REG_SPRITE_COLOUR, 0x01D0);
+ gpu_write (GPU_REG_SPRITE_COLOUR, GPU_RGB(7,2,0));
// squirt the bromium logo into the sprite
for (i = 0; i < n; ++i)