jumprun_tile als packed struct für mehr Speicher.
authorWintermate <wintermute@hannover.ccc.de>
Tue, 22 Oct 2013 12:10:51 +0000 (14:10 +0200)
committerWintermate <wintermute@hannover.ccc.de>
Tue, 22 Oct 2013 12:10:51 +0000 (14:10 +0200)
badge/jumpnrun/tiles.h
badge/main.c

index efc0161..8e47800 100644 (file)
@@ -22,7 +22,7 @@ enum {
 typedef struct jumpnrun_tile_position {
   int16_t x;
   int8_t  y;
-} jumpnrun_tile_position;
+} __attribute__((packed)) jumpnrun_tile_position;
 
 typedef struct jumpnrun_tile_type {
   uint8_t      lethal_sides;
@@ -32,7 +32,7 @@ typedef struct jumpnrun_tile_type {
 typedef struct jumpnrun_tile {
   jumpnrun_tile_position pos;
   uint8_t                type;
-} jumpnrun_tile;
+} __attribute__((packed)) jumpnrun_tile;
 
 typedef struct jumpnrun_tile_range {
   uint16_t first;
index a712686..265093b 100644 (file)
@@ -183,6 +183,20 @@ void rbInit() {
 
 #endif
 
+void usbmode(void) {
+    badge_framebuffer fb = { { { 0 } } };
+
+    badge_framebuffer_render_text(&fb, 23, 30, "USB-Modus");
+/*
+    badge_framebuffer_render_number(&fb, 23, 50, sizeof(jumpnrun_tile));
+    badge_framebuffer_render_number(&fb, 33, 50, sizeof(jumpnrun_item));
+    badge_framebuffer_render_number(&fb, 48, 50, sizeof(jumpnrun_enemy));
+*/
+    badge_framebuffer_flush(&fb);
+    usbMSCInit();
+    for(;;);
+}
+
 /**************************************************************************/
 /*!
     Main program entry point.  After reset, normal code execution will
@@ -209,12 +223,7 @@ int main(void)
   f_mount(0, &fs);
 
   if(badge_input_raw() & BADGE_EVENT_KEY_DOWN) {
-    badge_framebuffer fb = { { { 0 } } };
-
-    fb.data[0][0] = badge_framebuffer_render_text(&fb, 23, 30, "USB-Modus");
-    badge_framebuffer_flush(&fb);
-    usbMSCInit();
-    for(;;);
+    usbmode();
   }
 
   badge_event_start();
This page took 0.026754 seconds and 4 git commands to generate.