From 549bc32d822958a635c32f2fdd34f0395c34e50c Mon Sep 17 00:00:00 2001 From: Matt Kohls Date: Fri, 8 Mar 2019 02:10:49 -0500 Subject: Prepping to make ball a sprite --- bounce.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/bounce.cpp b/bounce.cpp index 97f009f..6f5e66a 100644 --- a/bounce.cpp +++ b/bounce.cpp @@ -27,6 +27,50 @@ const uint16_t SCREEN_HEIGHT = 100; const uint16_t POSX = 10; const uint16_t POSY = 10; +// Sprite Data +const uint16_t BALL_SIZE = 15; // Number of lines in sprite + +/* Line data + * + * 2x: + * 00000000 00000000 | 0x0000 + * 00000000 00000000 | 0x0000 + * + * 00000011 10000000 | 0x0380 + * 00000000 00000000 | 0x0000 + * + * 00001111 11100000 | 0x0FE0 + * 00000000 00000000 | 0x0000 + * + * 2x: + * 00011111 11110000 | 0x1FF0 + * 00000000 00000000 | 0x0000 + * 3x: + * 00111111 11111000 | 0x3FF8 + * 00000000 00000000 | 0x0000 + * + */ + +// This should get placed in chip memory by compiler +__chip WORD ballSprite[] = { 0x0000, 0x0000, + 0x0000, 0x0000, + 0x0000, 0x0380, + 0x0000, 0x0FE0, + 0x0000, 0x1FF0, + 0x0000, 0x1FF0, + 0x0000, 0x3FF8, + 0x0000, 0x3FF8, + 0x0000, 0x3FF8, + 0x0000, 0x1FF0, + 0x0000, 0x1FF0, + 0x0000, 0x0FE0, + 0x0000, 0x0380, + 0x0000, 0x0000, + 0x0000, 0x0000 }; + +WORD ballColors[] = { 0x0000, 0x00F0, 0x0F00 }; + + /** * WindowPos * Keeps track of window position -- cgit v1.2.3