Browse Source

Ready for release

James Bowman 6 years ago
parent
commit
77dda3a981
4 changed files with 894 additions and 866 deletions
  1. 24 2
      GD2.cpp
  2. 1 0
      GD2.h
  3. 867 862
      converted-assets/speedo_assets.h
  4. 2 2
      publish.py

+ 24 - 2
GD2.cpp

@@ -199,6 +199,27 @@ void Bitmap::fromfile(const char* filename)
   defaults(RGB565);
 }
 
+static const PROGMEM uint8_t bpltab[] = {
+/* 0  ARGB1555  */ 0,
+/* 1  L1        */ 4,
+/* 2  L4        */ 2,
+/* 3  L8        */ 1,
+/* 4  RGB332    */ 1,
+/* 5  ARGB2     */ 1,
+/* 6  ARGB4     */ 0,
+/* 7  RGB565    */ 0,
+/* 8  PALETTED  */ 1,
+/* 9  TEXT8X8   */ 0,
+/* 10 TEXTVGA   */ 0,
+/* 11 BARGRAPH  */ 1,
+/* 12           */ 0,
+/* 13           */ 0,
+/* 14           */ 0,
+/* 15           */ 0,
+/* 16           */ 0,
+/* 17 L2        */ 3
+};
+
 void Bitmap::defaults(uint8_t f)
 {
   source = GD.loadptr;
@@ -206,13 +227,14 @@ void Bitmap::defaults(uint8_t f)
   handle = -1;
   center.x = size.x / 2;
   center.y = size.y / 2;
-  GD.loadptr += 2UL * size.x * size.y;
+  GD.loadptr += ((size.x << 1) >> pgm_read_byte_near(bpltab + f))  * size.y;
 }
 
 void Bitmap::setup(void)
 {
   GD.BitmapSource(source);
-  GD.BitmapLayout(format, 2 * size.x, size.y);
+  int bpl = (size.x << 1) >> pgm_read_byte_near(bpltab + format);
+  GD.BitmapLayout(format, bpl, size.y);
   GD.BitmapSize(NEAREST, BORDER, BORDER, size.x, size.y);
 }
 

+ 1 - 0
GD2.h

@@ -858,6 +858,7 @@ typedef struct {
 #define TEXT8X8              9
 #define TEXTVGA              10
 #define BARGRAPH             11
+#define L2                   17
 
 #define NEAREST              0
 #define BILINEAR             1

File diff suppressed because it is too large
+ 867 - 862
converted-assets/speedo_assets.h


+ 2 - 2
publish.py

@@ -11,8 +11,8 @@ inventory = {
     '3.Peripherals' : "sketch tilt noisy song",
     '4.Utilities'   : "viewer radarchart selftest",
     '5.Demos'       : "cobra jnr kenney sprites widgets",
-    '6.Games'       : "nightstrike chess invaders8080 frogger chip8",
-    '7.GD3'         : "movie cube2 wifi",
+    '6.Games'       : "nightstrike chess frogger",
+    '7.GD3'         : "movie cube2",
 }
 
 import zipfile

Some files were not shown because too many files changed in this diff