pacman from dindinx
authorNathael Pajani <nathael.pajani@ed3l.fr>
Thu, 3 Jan 2019 22:11:29 +0000 (23:11 +0100)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Mon, 6 Feb 2023 01:09:25 +0000 (02:09 +0100)
14 files changed:
pacman/Makefile [new file with mode: 0644]
pacman/data.h [new file with mode: 0644]
pacman/image.h [new file with mode: 0644]
pacman/image.h0 [new file with mode: 0644]
pacman/image.h1 [new file with mode: 0644]
pacman/image.h2 [new file with mode: 0644]
pacman/image.h3 [new file with mode: 0644]
pacman/image.h4 [new file with mode: 0644]
pacman/image.h5 [new file with mode: 0644]
pacman/image.h6 [new file with mode: 0644]
pacman/image.h7 [new file with mode: 0644]
pacman/intermission-background.h [new file with mode: 0644]
pacman/main.c [new file with mode: 0644]
pacman/todo [new file with mode: 0644]

diff --git a/pacman/Makefile b/pacman/Makefile
new file mode 100644 (file)
index 0000000..41ae555
--- /dev/null
@@ -0,0 +1,21 @@
+# Makefile for apps
+
+MODULE = $(shell basename $(shell cd .. && pwd && cd -))
+NAME = $(shell basename $(CURDIR))
+
+# Add this to your ~/.vimrc in order to get proper function of :make in vim :
+# let $COMPILE_FROM_IDE = 1
+ifeq ($(strip $(COMPILE_FROM_IDE)),)
+       PRINT_DIRECTORY = --no-print-directory
+else
+       PRINT_DIRECTORY =
+       LANG = C
+endif
+
+.PHONY: $(NAME).bin
+$(NAME).bin:
+       @make -C ../../.. ${PRINT_DIRECTORY} NAME=$(NAME) MODULE=$(MODULE) apps/$(MODULE)/$(NAME)/$@
+
+clean mrproper:
+       @make -C ../../.. ${PRINT_DIRECTORY} $@
+
diff --git a/pacman/data.h b/pacman/data.h
new file mode 100644 (file)
index 0000000..016f99a
--- /dev/null
@@ -0,0 +1,1532 @@
+/****************************************************************************
+ *   apps/.*./data.h
+ *
+ * LPC1224/SSD1306 implementation of the famous pacman game
+ * graphic data file
+ *
+ * Copyright 2017 Nathael Pajani <nathael.pajani@ed3l.fr>
+ *
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *************************************************************************** */
+
+#ifndef DATA_H
+#define DATA_H
+
+enum FontEntries
+{
+  F_BLANK,
+
+  F_DIGIT_0,
+  F_DIGIT_1,
+  F_DIGIT_2,
+  F_DIGIT_3,
+  F_DIGIT_4,
+  F_DIGIT_5,
+  F_DIGIT_6,
+  F_DIGIT_7,
+  F_DIGIT_8,
+  F_DIGIT_9,
+
+  F_GHOST_STILL,
+  F_GHOST_LEFT,
+  F_GHOST_RIGHT,
+  F_GHOST_UP,
+  F_GHOST_DOWN,
+  F_GHOST_FRIGHTENED,
+  F_GHOST_MASK,
+  F_GHOST_EYES,
+
+  F_PACMAN_LEFT_0,
+  F_PACMAN_LEFT_1,
+  F_PACMAN_LEFT_2,
+  F_PACMAN_LEFT_3,
+  F_PACMAN_RIGHT_0,
+  F_PACMAN_RIGHT_1,
+  F_PACMAN_RIGHT_2,
+  F_PACMAN_RIGHT_3,
+  F_PACMAN_UP_0,
+  F_PACMAN_UP_1,
+  F_PACMAN_UP_2,
+  F_PACMAN_UP_3,
+  F_PACMAN_DOWN_0,
+  F_PACMAN_DOWN_1,
+  F_PACMAN_DOWN_2,
+  F_PACMAN_DOWN_3,
+
+  F_CHERRY,
+};
+
+static const uint8_t font[] =
+{
+  // Blank
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  // Digit0
+  // 0
+  0b00000000,
+  0b01111100,
+  0b11111110,
+  0b10110010,
+  0b10011010,
+  0b11111110,
+  0b01111100,
+  0b00000000,
+  // 1
+  0b00000000,
+  0b10000000,
+  0b10000100,
+  0b11111110,
+  0b11111110,
+  0b10000000,
+  0b10000000,
+  0b00000000,
+  // 2
+  0b00000000,
+  0b10000100,
+  0b11000110,
+  0b11100010,
+  0b10110010,
+  0b10011110,
+  0b10001100,
+  0b00000000,
+  // 3
+  0b00000000,
+  0b01000100,
+  0b11000110,
+  0b10010010,
+  0b10010010,
+  0b11111110,
+  0b01101100,
+  0b00000000,
+  // 4
+  0b00000000,
+  0b00110000,
+  0b00111000,
+  0b00101100,
+  0b11111110,
+  0b11111110,
+  0b00100000,
+  0b00000000,
+  // 5
+  0b00000000,
+  0b01001110,
+  0b11001110,
+  0b10001010,
+  0b10001010,
+  0b11111010,
+  0b01110010,
+  0b00000000,
+  // 6
+  0b00000000,
+  0b01111000,
+  0b11111100,
+  0b10010110,
+  0b10010010,
+  0b11110010,
+  0b01100000,
+  0b00000000,
+  // 7
+  0b00000000,
+  0b00000010,
+  0b11100010,
+  0b11110010,
+  0b00011010,
+  0b00001110,
+  0b00000110,
+  0b00000000,
+  // 8
+  0b00000000,
+  0b01101100,
+  0b11111110,
+  0b10010010,
+  0b10010010,
+  0b11111110,
+  0b01101100,
+  0b00000000,
+  // 9
+  0b00000000,
+  0b00001100,
+  0b10011110,
+  0b10010010,
+  0b11010010,
+  0b01111110,
+  0b00111100,
+  0b00000000,
+  // Still Ghost
+  0b01111100,
+  0b00111110,
+  0b01110111,
+  0b00111111,
+  0b01110111,
+  0b00111110,
+  0b01111100,
+  0b00000000,
+  // Left looking ghost
+  0b01111100,
+  0b00110110,
+  0b01111111,
+  0b00110111,
+  0b01111111,
+  0b00111110,
+  0b01111100,
+  0b00000000,
+  // Right looking ghost
+  0b01111100,
+  0b00111110,
+  0b01111111,
+  0b00110111,
+  0b01111111,
+  0b00110110,
+  0b01111100,
+  0b00000000,
+  // Up looking ghost
+  0b01111100,
+  0b00111110,
+  0b01111011,
+  0b00111111,
+  0b01111011,
+  0b00111110,
+  0b01111100,
+  0b00000000,
+  // Down looking ghost
+  0b01111100,
+  0b00111110,
+  0b01101111,
+  0b00111111,
+  0b01101111,
+  0b00111110,
+  0b01111100,
+  0b00000000,
+  // Frightened ghost
+  0b01111100,
+  0b00100010,
+  0b01001001,
+  0b00100001,
+  0b01001001,
+  0b00100010,
+  0b01111100,
+  0b00000000,
+  // Ghost mask
+  0b01111100,
+  0b00111110,
+  0b01111111,
+  0b00111111,
+  0b01111111,
+  0b00111110,
+  0b01111100,
+  0b00000000,
+  // Ghost eyes
+  0b00000000,
+  0b00011100,
+  0b00010100,
+  0b00011100,
+  0b00010100,
+  0b00011100,
+  0b00000000,
+  0b00000000,
+  
+  // Pacman
+  // Pacman left 0
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman left 1
+  0b00100100,
+  0b01100110,
+  0b11100111,
+  0b11100111,
+  0b11111111,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman left 2
+  0b00000000,
+  0b01000010,
+  0b11000011,
+  0b11100111,
+  0b11100111,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman left 3
+  0b00100100,
+  0b01100110,
+  0b11100111,
+  0b11100111,
+  0b11111111,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman right 0
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman right 1
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b11111111,
+  0b11100111,
+  0b11100111,
+  0b01100110,
+  0b00100100,
+  // Pacman right 2
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b11100111,
+  0b11100111,
+  0b11000011,
+  0b01000010,
+  0b00000000,
+  // Pacman right 3
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b11111111,
+  0b11100111,
+  0b11100111,
+  0b01100110,
+  0b00100100,
+  // Pacman up 0
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman up 1
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b11110000,
+  0b11110000,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman up 2
+  0b00111100,
+  0b01111110,
+  0b11111000,
+  0b11100000,
+  0b11100000,
+  0b11111000,
+  0b01111110,
+  0b00111100,
+  // Pacman up 3
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b11110000,
+  0b11110000,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman down 0
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman down 1
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b00001111,
+  0b00001111,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+  // Pacman down 2
+  0b00111100,
+  0b01111110,
+  0b00011111,
+  0b00000111,
+  0b00000111,
+  0b00011111,
+  0b01111110,
+  0b00111100,
+  // Pacman down 3
+  0b00111100,
+  0b01111110,
+  0b11111111,
+  0b00001111,
+  0b00001111,
+  0b11111111,
+  0b01111110,
+  0b00111100,
+
+  // Fruits
+  // Cherry
+  0b01100000,
+  0b11110000,
+  0b01101100,
+  0b00000010,
+  0b01100010,
+  0b11111001,
+  0b01100111,
+  0b00000001,
+
+};
+
+// "3D" isometric pacman (5 positions per direction, 4 directions, with mask)
+static const uint8_t pacmania_nw_01_mask[] =
+{
+  0b00000000,
+  0b00000000,
+  0b00111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00100000,
+  0b01110001,
+  0b01110011,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011
+};
+
+static const uint8_t pacmania_nw_01[] =
+{
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00111000,
+  0b11111100,
+  0b11001000,
+  0b11001010,
+  0b11101110,
+
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00100000,
+  0b00100001,
+  0b01110011,
+  0b01111011,
+
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011,
+  0b00000000
+};
+
+static const uint8_t pacmania_nw_02_mask[] =
+{
+  0b00000000,
+  0b01110000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+
+  0b00000000,
+  0b00000000,
+  0b00000001,
+  0b00100011,
+  0b01110111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011
+};
+
+static const uint8_t pacmania_nw_02[] =
+{
+  0b00000000,
+  0b00000000,
+  0b01110000,
+  0b11011000,
+  0b11001000,
+  0b11101000,
+  0b11111110,
+  0b11111110,
+
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00000001,
+  0b00100011,
+  0b00110111,
+  0b01111111,
+  0b01111111,
+
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011,
+  0b00000000
+};
+
+static const uint8_t pacmania_nw_03_mask[] =
+{
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+
+  0b00000000,
+  0b00000001,
+  0b00010011,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011
+};
+
+static const uint8_t pacmania_nw_03[] =
+{
+  0b00000000,
+  0b11000000,
+  0b10010000,
+  0b11001000,
+  0b11001100,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000000,
+  0b00000001,
+  0b00010011,
+  0b00110111,
+  0b00110111,
+  0b01111111,
+  0b01111111,
+
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011,
+  0b00000000
+};
+
+static const uint8_t pacmania_nw_04_mask[] =
+{
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+
+  0b00000001,
+  0b00000011,
+  0b00010111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011
+};
+
+static const uint8_t pacmania_nw_04[] =
+{
+  0b00000000,
+  0b11000000,
+  0b10010000,
+  0b11001000,
+  0b11111100,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000001,
+  0b00000011,
+  0b00010011,
+  0b00110111,
+  0b00110111,
+  0b01111111,
+  0b01111111,
+
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011,
+  0b00000000
+};
+
+static const uint8_t pacmania_nw_05_mask[] =
+{
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+
+  0b00000001,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011
+};
+
+static const uint8_t pacmania_nw_05[] =
+{
+  0b00000000,
+  0b11000000,
+  0b00110000,
+  0b11011000,
+  0b11111100,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000001,
+  0b00001011,
+  0b00010111,
+  0b00110111,
+  0b00110111,
+  0b01111111,
+  0b01111111,
+
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011,
+  0b00000000
+};
+
+static const uint8_t pacmania_se_01_mask[] =
+{
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00011111,
+  0b00001111,
+  0b00000011
+};
+
+static const uint8_t pacmania_se_01[] =
+{
+  0b00000000,
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+
+  0b11011110,
+  0b00011110,
+  0b00111100,
+  0b11001100,
+  0b10001000,
+  0b11110000,
+  0b11000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b00111111,
+  0b01111111,
+  0b01110111,
+
+  0b01110111,
+  0b01110111,
+  0b00110111,
+  0b00111011,
+  0b00011011,
+  0b00001101,
+  0b00000010,
+  0b00000000
+};
+
+static const uint8_t pacmania_se_02_mask[] =
+{
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111000,
+  0b11110000,
+  0b11000000,
+
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00011111,
+  0b00001101,
+  0b00000000
+};
+
+static const uint8_t pacmania_se_02[] =
+{
+  0b00000000,
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111100,
+  0b11111110,
+  0b11101110,
+
+  0b10001110,
+  0b10011110,
+  0b11100100,
+  0b11000100,
+  0b11111000,
+  0b11110000,
+  0b01000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b00111111,
+  0b01111111,
+  0b01110111,
+
+  0b01110111,
+  0b01110011,
+  0b00110011,
+  0b00110001,
+  0b00011001,
+  0b00001100,
+  0b00000000,
+  0b00000000
+};
+
+static const uint8_t pacmania_se_03_mask[] =
+{
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111000,
+  0b01110000,
+  0b00000000,
+
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00011100,
+  0b00000000,
+  0b00000000
+};
+
+static const uint8_t pacmania_se_03[] =
+{
+  0b00000000,
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111100,
+  0b11111110,
+  0b11101110,
+
+  0b10001110,
+  0b10011110,
+  0b11100100,
+  0b11000100,
+  0b11111000,
+  0b01110000,
+  0b00000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b00111111,
+  0b01110111,
+  0b01110011,
+
+  0b01100011,
+  0b01100001,
+  0b00100001,
+  0b00100000,
+  0b00011100,
+  0b00000000,
+  0b00000000,
+  0b00000000
+};
+
+static const uint8_t pacmania_se_04_mask[] =
+{
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b01111000,
+  0b00110000,
+  0b00000000,
+
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111110,
+  0b00011100,
+  0b00000000,
+  0b00000000
+};
+
+static const uint8_t pacmania_se_04[] =
+{
+  0b00000000,
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111100,
+  0b11110110,
+  0b11000110,
+
+  0b11001110,
+  0b11111010,
+  0b11110000,
+  0b01100100,
+  0b01111000,
+  0b00110000,
+  0b00000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b00111111,
+  0b01110111,
+  0b01100011,
+
+  0b01100001,
+  0b01100001,
+  0b00100000,
+  0b00100010,
+  0b00011100,
+  0b00000000,
+  0b00000000,
+  0b00000000
+};
+
+static const uint8_t pacmania_se_05_mask[] =
+{
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b00111110,
+  0b00011100,
+  0b00001000,
+  0b00000000,
+  0b00000000,
+
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111110,
+  0b00011100,
+  0b00000000,
+  0b00000000
+};
+
+static const uint8_t pacmania_se_05[] =
+{
+  0b00000000,
+  0b11000000,
+  0b11110000,
+  0b11111000,
+  0b11111100,
+  0b11111100,
+  0b11100110,
+  0b11000110,
+
+  0b01101110,
+  0b00111010,
+  0b00010000,
+  0b00011100,
+  0b00001000,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+
+  0b00000000,
+  0b00000011,
+  0b00001111,
+  0b00011111,
+  0b00111111,
+  0b00110011,
+  0b01100001,
+  0b01000000,
+
+  0b01000000,
+  0b01000000,
+  0b00100001,
+  0b00100010,
+  0b00011100,
+  0b00000000,
+  0b00000000,
+  0b00000000
+};
+
+// a 16x16 pacman for the intermission
+static const uint8_t big_pacman_0[] =
+{
+  0b11100000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  0b11111110,
+  0b11111100,
+  0b11111000,
+  0b11100000,
+
+  0b00000111,
+  0b00011111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+  0b11111111,
+
+  0b11111111,
+  0b11111111,
+  0b11111111,
+  0b01111111,
+  0b01111111,
+  0b00111111,
+  0b00011111,
+  0b00000111
+};
+
+static const uint8_t big_pacman_1[] =
+{
+  0b11100000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b11111111,
+  0b01111111,
+
+  0b01111111,
+  0b00111111,
+  0b00111111,
+  0b00011110,
+  0b00011110,
+  0b00001100,
+  0b00001000,
+  0b00000000,
+
+  0b00000111,
+  0b00011111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111111,
+  0b11111110,
+  
+  0b11111110,
+  0b11111100,
+  0b11111100,
+  0b01111000,
+  0b01111000,
+  0b00110000,
+  0b00010000,
+  0b00000000
+};
+
+static const uint8_t big_pacman_2[] =
+{
+  0b11100000,
+  0b11111000,
+  0b11111100,
+  0b11111110,
+  0b11111110,
+  0b11111111,
+  0b01111111,
+  0b00111111,
+  
+  0b00011111,
+  0b00001111,
+  0b00000111,
+  0b00000010,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+
+  0b00000111,
+  0b00011111,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b11111111,
+  0b11111110,
+  0b11111100,
+
+  0b11111000,
+  0b11110000,
+  0b11100000,
+  0b01000000,
+  0b00000000,
+  0b00000000,
+  0b00000000,
+  0b00000000
+};
+
+static const uint8_t big_ghost_0[] =
+{
+  0b00000000,
+  0b10000000,
+  0b11110000,
+  0b11111000,
+  0b00111100,
+  0b00011100,
+  0b10011110,
+  0b10111110,
+
+  0b11111110,
+  0b11111110,
+  0b00111100,
+  0b00011100,
+  0b10011000,
+  0b10110000,
+  0b10000000,
+  0b00000000,
+
+  0b00000000,
+  0b00111111,
+  0b01111111,
+  0b01111111,
+  0b00111110,
+  0b00011100,
+  0b00111101,
+  0b01111111,
+
+  0b01111111,
+  0b00111111,
+  0b00011110,
+  0b00111100,
+  0b01111101,
+  0b01111111,
+  0b00111111,
+  0b00000000
+};
+
+static const uint8_t big_ghost_1[] =
+{
+  0b00000000,
+  0b10000000,
+  0b11110000,
+  0b11111000,
+  0b00111100,
+  0b00011100,
+  0b10011110,
+  0b10111110,
+
+  0b11111110,
+  0b11111110,
+  0b00111100,
+  0b00011100,
+  0b10011000,
+  0b10110000,
+  0b10000000,
+  0b00000000,
+
+  0b00000000,
+  0b01111111,
+  0b00111111,
+  0b00011111,
+  0b00111110,
+  0b01111100,
+  0b01111101,
+  0b00011111,
+
+  0b00011111,
+  0b01111111,
+  0b01111110,
+  0b00111100,
+  0b00011101,
+  0b00111111,
+  0b01111111,
+  0b00000000
+};
+
+static const uint8_t big_frightened_ghost_0[] =
+{
+  0b00000000,
+  0b10000000,
+  0b01110000,
+  0b11001000,
+  0b10100100,
+  0b00100100,
+  0b11000010,
+  0b00000010,
+
+  0b11000010,
+  0b10100010,
+  0b00100100,
+  0b11000100,
+  0b00001000,
+  0b01110000,
+  0b10000000,
+  0b00000000,
+
+  0b00000000,
+  0b01111111,
+  0b00100000,
+  0b00010001,
+  0b00100010,
+  0b01000010,
+  0b01100001,
+  0b00010000,
+
+  0b00010001,
+  0b01100010,
+  0b01000010,
+  0b00100001,
+  0b00010000,
+  0b00100000,
+  0b01111111,
+  0b00000000
+};
+
+static const uint8_t big_frightened_ghost_1[] =
+{
+  0b00000000,
+  0b10000000,
+  0b01110000,
+  0b11001000,
+  0b10100100,
+  0b00100100,
+  0b11000010,
+  0b00000010,
+
+  0b11000010,
+  0b10100010,
+  0b00100100,
+  0b11000100,
+  0b00001000,
+  0b01110000,
+  0b10000000,
+  0b00000000,
+
+  0b00000000,
+  0b00111111,
+  0b01000000,
+  0b01000001,
+  0b00100010,
+  0b00010010,
+  0b00100001,
+  0b01000000,
+
+  0b01000001,
+  0b00100010,
+  0b00010010,
+  0b00100001,
+  0b01000000,
+  0b01000000,
+  0b00111111,
+  0b00000000
+};
+
+static const uint32_t walls_mask[] =
+{
+  0b11111111111111111111111111111111, //  0
+  0b11100000000000011000000000000111, //  1
+  0b11101111011111011011111011110111, //  2
+  0b11101111011111011011111011110111, //  3
+  0b11101111011111011011111011110111, //  4
+  0b11100000000000000000000000000111, //  5
+  0b11101111011011111111011011110111, //  6
+  0b11101111011011111111011011110111, //  7
+  0b11100000011000011000011000000111, //  8
+  0b11111111011111011011111011111111, //  9
+  0b11111111011111011011111011111111, // 10
+  0b11111111011000000000011011111111, // 11
+  0b11111111011011100111011011111111, // 12
+  0b11111111011010000001011011111111, // 13
+  0b00000000000010000001000000000000, // 14
+  0b11111111011011111111011011111111, // 15
+  0b11111111011011111111011011111111, // 16
+  0b11111111011000000000011011111111, // 17
+  0b11111111011011111111011011111111, // 18
+  0b11111111011011111111011011111111, // 19
+  0b11100000000000011000000000000111, // 20
+  0b11101111011111011011111011110111, // 21
+  0b11101111011111011011111011110111, // 22
+  0b11100011000000000000000011000111, // 23
+  0b11111011011011111111011011011111, // 24
+  0b11111011011011111111011011011111, // 25
+  0b11100000011000011000011000000111, // 26
+  0b11101111111111011011111111110111, // 27
+  0b11101111111111011011111111110111, // 28
+  0b11100000000000000000000000000111, // 29
+  0b11111111111111111111111111111111  // 30
+};
+
+static const uint32_t all_pills[] =
+{
+  0b00000000000000000000000000000000, //  0
+  0b00011111111111100111111111111000, //  1
+  0b00010000100000100100000100001000, //  2
+  0b00010000100000100100000100001000, //  3
+  0b00010000100000100100000100001000, //  4
+  0b00011111111111111111111111111000, //  5
+  0b00010000100100000000100100001000, //  6
+  0b00010000100100000000100100001000, //  7
+  0b00011111100111100111100111111000, //  8
+  0b00000000100000000000000100000000, //  9
+  0b00000000100000000000000100000000, // 10
+  0b00000000100000000000000100000000, // 11
+  0b00000000100000000000000100000000, // 12
+  0b00000000100000000000000100000000, // 13
+  0b00000000100000000000000100000000, // 14
+  0b00000000100000000000000100000000, // 15
+  0b00000000100000000000000100000000, // 16
+  0b00000000100000000000000100000000, // 17
+  0b00000000100000000000000100000000, // 18
+  0b00000000100000000000000100000000, // 19
+  0b00011111111111100111111111111000, // 20
+  0b00010000100000100100000100001000, // 21
+  0b00010000100000100100000100001000, // 22
+  0b00011100111111100111111100111000, // 23
+  0b00000100100100000000100100100000, // 24
+  0b00000100100100000000100100100000, // 25
+  0b00011111100111100111100111111000, // 26
+  0b00010000000000100100000000001000, // 27
+  0b00010000000000100100000000001000, // 28
+  0b00011111111111111111111111111000, // 29
+  0b00000000000000000000000000000000  // 30
+};
+
+#endif
+
diff --git a/pacman/image.h b/pacman/image.h
new file mode 100644 (file)
index 0000000..62a3791
--- /dev/null
@@ -0,0 +1,52 @@
+static const uint8_t image[763] =
+{
+  '\x05', '\x00', '\xfd', '\xfc', '\x02', '\xf9', '\x30', '\x05', '\xfc', '\xf9', '\x01', '\x01', '\xf9', '\x30', '\x05', '\xfd', '\xf9', 
+  '\x02', '\xfc', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\xf8', '\x07', '\x04', '\xff', 
+  '\xf8', '\x05', '\x00', '\xff', '\xf8', '\x0b', '\x04', '\xff', '\xf8', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', 
+  '\x00', '\xff', '\xf8', '\x0b', '\x04', '\xff', '\xf8', '\x05', '\x00', '\xff', '\xf8', '\x07', '\x04', '\xff', '\xf8', '\x04', '\x00', 
+  '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x01', '\x07', 
+  '\x02', '\xff', '\x01', '\x05', '\x00', '\xff', '\x01', '\x0b', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', '\x02', '\x02', 
+  '\x01', '\x05', '\x00', '\xff', '\x01', '\x0b', '\x02', '\xff', '\x01', '\x05', '\x00', '\xff', '\x01', '\x07', '\x02', '\xff', '\x01', 
+  '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', 
+  '\x18', '\x07', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfc', '\xf8', '\x04', '\x04', '\xf8', '\x05', '\x00', '\xff', '\x18', '\x06', 
+  '\x24', '\xfe', '\x44', '\x84', '\x01', '\x04', '\xfe', '\x84', '\x44', '\x06', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfc', '\xf8', 
+  '\x04', '\x04', '\xf8', '\x05', '\x00', '\xff', '\x18', '\x07', '\x24', '\xff', '\x18', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x05', '\x00', '\x05', '\x00', '\xfd', '\x3f', '\x40', '\x9f', '\x0e', '\xa0', '\xfd', '\x20', '\x40', '\x80', '\x04', '\x00', '\xfa', 
+  '\xff', '\x00', '\x00', '\x0f', '\x10', '\x20', '\x06', '\x40', '\xff', '\x80', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', 
+  '\x05', '\x00', '\xff', '\x80', '\x06', '\x40', '\xfa', '\x20', '\x10', '\x0f', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\x80', 
+  '\x40', '\x20', '\x0e', '\xa0', '\xfd', '\x9f', '\x40', '\x3f', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', 
+  '\x00', '\xfa', '\xff', '\x00', '\x00', '\xf0', '\x08', '\x04', '\x06', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', '\x02', 
+  '\x02', '\x01', '\x05', '\x00', '\xff', '\x01', '\x06', '\x02', '\xfa', '\x04', '\x08', '\xf0', '\x00', '\x00', '\xff', '\x04', '\x00', 
+  '\xfd', '\xff', '\x00', '\xff', '\x19', '\x00', '\x05', '\x00', '\x11', '\x50', '\xfd', '\x4f', '\x20', '\x1f', '\x04', '\x00', '\xfc', 
+  '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xfe', '\xfc', '\xfc', '\x05', '\x0c', '\x05', '\x08', '\x05', '\x0c', '\xfe', '\xfc', 
+  '\xfc', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x04', '\x00', '\xfd', '\x1f', '\x20', '\x4f', '\x11', '\x50', '\x05', 
+  '\x00', '\x05', '\x00', '\x11', '\xa0', '\xfd', '\x20', '\x40', '\x80', '\x04', '\x00', '\xfc', '\x80', '\x40', '\x40', '\x80', '\x05', 
+  '\x00', '\xfe', '\xff', '\xff', '\x15', '\x00', '\xfe', '\xff', '\xff', '\x05', '\x00', '\xfc', '\x80', '\x40', '\x40', '\x80', '\x04', 
+  '\x00', '\xfd', '\x80', '\x40', '\x20', '\x11', '\xa0', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', 
+  '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\x19', '\x03', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x04', 
+  '\x00', '\xfd', '\xff', '\x00', '\xff', '\x19', '\x00', '\x05', '\x00', '\xfd', '\xc0', '\x20', '\x90', '\x0e', '\x50', '\xfd', '\x4f', 
+  '\x20', '\x1f', '\x04', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xff', '\x18', '\x07', '\x24', '\xfa', '\x44', 
+  '\x84', '\x04', '\x04', '\x84', '\x44', '\x07', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x04', 
+  '\x00', '\xfd', '\x1f', '\x20', '\x4f', '\x0e', '\x50', '\xfd', '\x90', '\x20', '\xc0', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x04', '\x00', '\xff', '\x80', '\x07', '\x40', '\xff', '\x80', '\x05', '\x00', '\xff', '\x80', '\x0b', '\x40', '\xff', 
+  '\x80', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x80', '\x0b', '\x40', '\xff', '\x80', '\x05', 
+  '\x00', '\xff', '\x80', '\x07', '\x40', '\xff', '\x80', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', 
+  '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x01', '\x03', '\x02', '\xfb', '\x04', '\xf8', '\x00', '\x00', '\xff', '\x05', 
+  '\x00', '\xff', '\x01', '\x0b', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', '\x02', '\x02', '\x01', '\x05', '\x00', '\xff', 
+  '\x01', '\x0b', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfb', '\xff', '\x00', '\x00', '\xf8', '\x04', '\x03', '\x02', '\xff', '\x01', 
+  '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xc3', '\x03', '\x24', '\xff', 
+  '\x18', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xfc', '\xf8', '\x04', '\x04', '\xf8', '\x05', '\x00', 
+  '\xff', '\x18', '\x07', '\x24', '\xfa', '\x44', '\x84', '\x04', '\x04', '\x84', '\x44', '\x07', '\x24', '\xff', '\x18', '\x05', '\x00', 
+  '\xfc', '\xf8', '\x04', '\x04', '\xf8', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xff', '\x18', '\x03', 
+  '\x24', '\xfd', '\xc3', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x80', 
+  '\x0f', '\x40', '\xfa', '\x20', '\x1f', '\x00', '\x00', '\x1f', '\x20', '\x07', '\x40', '\xff', '\x80', '\x05', '\x00', '\xfc', '\xff', 
+  '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x80', '\x07', '\x40', '\xfa', '\x20', '\x1f', '\x00', '\x00', '\x1f', '\x20', '\x0f', 
+  '\x40', '\xff', '\x80', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x04', '\x00', '\xff', '\x01', '\x1f', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', '\x02', '\x02', '\x01', '\x05', '\x00', 
+  '\xff', '\x01', '\x1f', '\x02', '\xff', '\x01', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', 
+  '\x03', '\x04', '\x09', '\x67', '\x0a', '\xfd', '\x09', '\x04', '\x03', '\x05', '\x00', '\x7d', '\x00', '\x7d', '\x00'
+};
+static const uint16_t image_offsets[18] =
+{
+  0, 21, 74, 127, 189, 248, 295, 341, 383, 415, 472, 525, 586, 653, 708, 745, 759, 761
+};
diff --git a/pacman/image.h0 b/pacman/image.h0
new file mode 100644 (file)
index 0000000..c49ca0c
--- /dev/null
@@ -0,0 +1,52 @@
+static const uint8_t image0[763] =
+{
+  '\x05', '\x00', '\xfd', '\xfc', '\x02', '\xf9', '\x30', '\x05', '\xfc', '\xf9', '\x01', '\x01', '\xf9', '\x30', '\x05', '\xfd', '\xf9', 
+  '\x02', '\xfc', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\xf8', '\x07', '\x04', '\xff', 
+  '\xf8', '\x05', '\x00', '\xff', '\xf8', '\x0b', '\x04', '\xff', '\xf8', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', 
+  '\x00', '\xff', '\xf8', '\x0b', '\x04', '\xff', '\xf8', '\x05', '\x00', '\xff', '\xf8', '\x07', '\x04', '\xff', '\xf8', '\x04', '\x00', 
+  '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x01', '\x07', 
+  '\x02', '\xff', '\x01', '\x05', '\x00', '\xff', '\x01', '\x0b', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', '\x02', '\x02', 
+  '\x01', '\x05', '\x00', '\xff', '\x01', '\x0b', '\x02', '\xff', '\x01', '\x05', '\x00', '\xff', '\x01', '\x07', '\x02', '\xff', '\x01', 
+  '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', 
+  '\x18', '\x07', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfc', '\xf8', '\x04', '\x04', '\xf8', '\x05', '\x00', '\xff', '\x18', '\x06', 
+  '\x24', '\xfe', '\x44', '\x84', '\x01', '\x04', '\xfe', '\x84', '\x44', '\x06', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfc', '\xf8', 
+  '\x04', '\x04', '\xf8', '\x05', '\x00', '\xff', '\x18', '\x07', '\x24', '\xff', '\x18', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x05', '\x00', '\x05', '\x00', '\xfd', '\x3f', '\x40', '\x9f', '\x0e', '\xa0', '\xfd', '\x20', '\x40', '\x80', '\x04', '\x00', '\xfa', 
+  '\xff', '\x00', '\x00', '\x0f', '\x10', '\x20', '\x06', '\x40', '\xff', '\x80', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', 
+  '\x05', '\x00', '\xff', '\x80', '\x06', '\x40', '\xfa', '\x20', '\x10', '\x0f', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\x80', 
+  '\x40', '\x20', '\x0e', '\xa0', '\xfd', '\x9f', '\x40', '\x3f', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', 
+  '\x00', '\xfa', '\xff', '\x00', '\x00', '\xf0', '\x08', '\x04', '\x06', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', '\x02', 
+  '\x02', '\x01', '\x05', '\x00', '\xff', '\x01', '\x06', '\x02', '\xfa', '\x04', '\x08', '\xf0', '\x00', '\x00', '\xff', '\x04', '\x00', 
+  '\xfd', '\xff', '\x00', '\xff', '\x19', '\x00', '\x05', '\x00', '\x11', '\x50', '\xfd', '\x4f', '\x20', '\x1f', '\x04', '\x00', '\xfc', 
+  '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xfe', '\xfc', '\xfc', '\x05', '\x0c', '\x05', '\x08', '\x05', '\x0c', '\xfe', '\xfc', 
+  '\xfc', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x04', '\x00', '\xfd', '\x1f', '\x20', '\x4f', '\x11', '\x50', '\x05', 
+  '\x00', '\x05', '\x00', '\x11', '\xa0', '\xfd', '\x20', '\x40', '\x80', '\x04', '\x00', '\xfc', '\x80', '\x40', '\x40', '\x80', '\x05', 
+  '\x00', '\xfe', '\xff', '\xff', '\x15', '\x00', '\xfe', '\xff', '\xff', '\x05', '\x00', '\xfc', '\x80', '\x40', '\x40', '\x80', '\x04', 
+  '\x00', '\xfd', '\x80', '\x40', '\x20', '\x11', '\xa0', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', 
+  '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\x19', '\x03', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x04', 
+  '\x00', '\xfd', '\xff', '\x00', '\xff', '\x19', '\x00', '\x05', '\x00', '\xfd', '\xc0', '\x20', '\x90', '\x0e', '\x50', '\xfd', '\x4f', 
+  '\x20', '\x1f', '\x04', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xff', '\x18', '\x07', '\x24', '\xfa', '\x44', 
+  '\x84', '\x04', '\x04', '\x84', '\x44', '\x07', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x04', 
+  '\x00', '\xfd', '\x1f', '\x20', '\x4f', '\x0e', '\x50', '\xfd', '\x90', '\x20', '\xc0', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x04', '\x00', '\xff', '\x80', '\x07', '\x40', '\xff', '\x80', '\x05', '\x00', '\xff', '\x80', '\x0b', '\x40', '\xff', 
+  '\x80', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x80', '\x0b', '\x40', '\xff', '\x80', '\x05', 
+  '\x00', '\xff', '\x80', '\x07', '\x40', '\xff', '\x80', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', 
+  '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x01', '\x03', '\x02', '\xfb', '\x04', '\xf8', '\x00', '\x00', '\xff', '\x05', 
+  '\x00', '\xff', '\x01', '\x0b', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', '\x02', '\x02', '\x01', '\x05', '\x00', '\xff', 
+  '\x01', '\x0b', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfb', '\xff', '\x00', '\x00', '\xf8', '\x04', '\x03', '\x02', '\xff', '\x01', 
+  '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xc3', '\x03', '\x24', '\xff', 
+  '\x18', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xfc', '\xf8', '\x04', '\x04', '\xf8', '\x05', '\x00', 
+  '\xff', '\x18', '\x07', '\x24', '\xfa', '\x44', '\x84', '\x04', '\x04', '\x84', '\x44', '\x07', '\x24', '\xff', '\x18', '\x05', '\x00', 
+  '\xfc', '\xf8', '\x04', '\x04', '\xf8', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xff', '\x18', '\x03', 
+  '\x24', '\xfd', '\xc3', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x80', 
+  '\x0f', '\x40', '\xfa', '\x20', '\x1f', '\x00', '\x00', '\x1f', '\x20', '\x07', '\x40', '\xff', '\x80', '\x05', '\x00', '\xfc', '\xff', 
+  '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x80', '\x07', '\x40', '\xfa', '\x20', '\x1f', '\x00', '\x00', '\x1f', '\x20', '\x0f', 
+  '\x40', '\xff', '\x80', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x04', '\x00', '\xff', '\x01', '\x1f', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', '\x02', '\x02', '\x01', '\x05', '\x00', 
+  '\xff', '\x01', '\x1f', '\x02', '\xff', '\x01', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', 
+  '\x03', '\x04', '\x09', '\x67', '\x0a', '\xfd', '\x09', '\x04', '\x03', '\x05', '\x00', '\x7d', '\x00', '\x7d', '\x00'
+};
+static const uint16_t image_offsets0[18] =
+{
+  0, 21, 74, 127, 189, 248, 295, 341, 383, 415, 472, 525, 586, 653, 708, 745, 759, 761
+};
diff --git a/pacman/image.h1 b/pacman/image.h1
new file mode 100644 (file)
index 0000000..9d51a24
--- /dev/null
@@ -0,0 +1,50 @@
+static const uint8_t image1[714] =
+{
+  '\x05', '\x00', '\xfd', '\xfe', '\x01', '\xfc', '\x30', '\x02', '\xfc', '\xfc', '\x00', '\x00', '\xfc', '\x30', '\x02', '\xfd', '\xfc', 
+  '\x01', '\xfe', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\xfc', '\x07', '\x02', '\xff', 
+  '\xfc', '\x05', '\x00', '\xff', '\xfc', '\x0b', '\x02', '\xff', '\xfc', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', 
+  '\x00', '\xff', '\xfc', '\x0b', '\x02', '\xff', '\xfc', '\x05', '\x00', '\xff', '\xfc', '\x07', '\x02', '\xff', '\xfc', '\x04', '\x00', 
+  '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x07', '\x01', '\x07', 
+  '\x00', '\x0b', '\x01', '\x07', '\x00', '\xfe', '\x01', '\x01', '\x07', '\x00', '\x0b', '\x01', '\x07', '\x00', '\x07', '\x01', '\x05', 
+  '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x0c', 
+  '\x07', '\x12', '\xff', '\x0c', '\x05', '\x00', '\xfc', '\xfc', '\x02', '\x02', '\xfc', '\x05', '\x00', '\xff', '\x0c', '\x06', '\x12', 
+  '\xf8', '\x22', '\x42', '\x82', '\x02', '\x02', '\x82', '\x42', '\x22', '\x06', '\x12', '\xff', '\x0c', '\x05', '\x00', '\xfc', '\xfc', 
+  '\x02', '\x02', '\xfc', '\x05', '\x00', '\xff', '\x0c', '\x07', '\x12', '\xff', '\x0c', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x05', '\x00', '\x05', '\x00', '\xfd', '\x1f', '\x20', '\x4f', '\x0e', '\x50', '\xfd', '\x90', '\x20', '\xc0', '\x04', '\x00', '\xfa', 
+  '\xff', '\x00', '\x00', '\x07', '\x08', '\x10', '\x06', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', 
+  '\x05', '\x00', '\xff', '\xc0', '\x06', '\x20', '\xfa', '\x10', '\x08', '\x07', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xc0', 
+  '\x20', '\x90', '\x0e', '\x50', '\xfd', '\x4f', '\x20', '\x1f', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', 
+  '\x00', '\xfa', '\xff', '\x00', '\x00', '\xf8', '\x04', '\x02', '\x06', '\x01', '\x07', '\x00', '\xfe', '\x01', '\x01', '\x07', '\x00', 
+  '\x06', '\x01', '\xfa', '\x02', '\x04', '\xf8', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x19', '\x00', 
+  '\x05', '\x00', '\x11', '\x28', '\xfd', '\x27', '\x10', '\x0f', '\x04', '\x00', '\xfc', '\x0f', '\x10', '\x10', '\x0f', '\x05', '\x00', 
+  '\xfe', '\xfe', '\xfe', '\x05', '\x06', '\x05', '\x04', '\x05', '\x06', '\xfe', '\xfe', '\xfe', '\x05', '\x00', '\xfc', '\x0f', '\x10', 
+  '\x10', '\x0f', '\x04', '\x00', '\xfd', '\x0f', '\x10', '\x27', '\x11', '\x28', '\x05', '\x00', '\x05', '\x00', '\x11', '\x50', '\xfd', 
+  '\x90', '\x20', '\xc0', '\x04', '\x00', '\xfc', '\xc0', '\x20', '\x20', '\xc0', '\x05', '\x00', '\xfe', '\xff', '\xff', '\x15', '\x80', 
+  '\xfe', '\xff', '\xff', '\x05', '\x00', '\xfc', '\xc0', '\x20', '\x20', '\xc0', '\x04', '\x00', '\xfd', '\xc0', '\x20', '\x90', '\x11', 
+  '\x50', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', 
+  '\x00', '\x19', '\x01', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x19', 
+  '\x00', '\x05', '\x00', '\xfd', '\xe0', '\x10', '\xc8', '\x0e', '\x28', '\xfd', '\x27', '\x10', '\x0f', '\x04', '\x00', '\xfc', '\x0f', 
+  '\x10', '\x10', '\x0f', '\x05', '\x00', '\xff', '\x0c', '\x07', '\x12', '\xfa', '\x22', '\xc2', '\x02', '\x02', '\xc2', '\x22', '\x07', 
+  '\x12', '\xff', '\x0c', '\x05', '\x00', '\xfc', '\x0f', '\x10', '\x10', '\x0f', '\x04', '\x00', '\xfd', '\x0f', '\x10', '\x27', '\x0e', 
+  '\x28', '\xfd', '\xc8', '\x10', '\xe0', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\xc0', 
+  '\x07', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xff', '\xc0', '\x0b', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xfc', '\xff', '\x00', 
+  '\x00', '\xff', '\x05', '\x00', '\xff', '\xc0', '\x0b', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xff', '\xc0', '\x07', '\x20', '\xff', 
+  '\xc0', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', 
+  '\x03', '\x01', '\xfb', '\x02', '\xfc', '\x00', '\x00', '\xff', '\x06', '\x00', '\x0b', '\x01', '\x07', '\x00', '\xfe', '\x01', '\x01', 
+  '\x07', '\x00', '\x0b', '\x01', '\x06', '\x00', '\xfb', '\xff', '\x00', '\x00', '\xfc', '\x02', '\x03', '\x01', '\x05', '\x00', '\xfd', 
+  '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xe1', '\x03', '\x12', '\xff', '\x0c', '\x05', '\x00', 
+  '\xfc', '\x0f', '\x10', '\x10', '\x0f', '\x05', '\x00', '\xfc', '\xfc', '\x02', '\x02', '\xfc', '\x05', '\x00', '\xff', '\x0c', '\x07', 
+  '\x12', '\xfa', '\x22', '\xc2', '\x02', '\x02', '\xc2', '\x22', '\x07', '\x12', '\xff', '\x0c', '\x05', '\x00', '\xfc', '\xfc', '\x02', 
+  '\x02', '\xfc', '\x05', '\x00', '\xfc', '\x0f', '\x10', '\x10', '\x0f', '\x05', '\x00', '\xff', '\x0c', '\x03', '\x12', '\xfd', '\xe1', 
+  '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\xc0', '\x0f', '\x20', '\xfa', 
+  '\x10', '\x0f', '\x00', '\x00', '\x0f', '\x10', '\x07', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', 
+  '\x05', '\x00', '\xff', '\xc0', '\x07', '\x20', '\xfa', '\x10', '\x0f', '\x00', '\x00', '\x0f', '\x10', '\x0f', '\x20', '\xff', '\xc0', 
+  '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x1f', 
+  '\x01', '\x07', '\x00', '\xfe', '\x01', '\x01', '\x07', '\x00', '\x1f', '\x01', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', 
+  '\x00', '\x05', '\x00', '\xfd', '\x01', '\x02', '\x04', '\x67', '\x05', '\xfd', '\x04', '\x02', '\x01', '\x05', '\x00', '\x7d', '\x00'
+  
+};
+static const uint16_t image_offsets1[17] =
+{
+  0, 21, 74, 109, 172, 231, 272, 318, 360, 392, 449, 502, 549, 616, 671, 698, 712
+};
diff --git a/pacman/image.h2 b/pacman/image.h2
new file mode 100644 (file)
index 0000000..4747922
--- /dev/null
@@ -0,0 +1,46 @@
+static const uint8_t image2[650] =
+{
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xfe', '\x30', '\x01', '\xfc', '\xfe', '\x00', '\x00', '\xfe', '\x30', '\x01', '\xfd', '\xfe', 
+  '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x7e', '\x07', '\x81', '\xff', 
+  '\x7e', '\x05', '\x00', '\xff', '\x7e', '\x0b', '\x81', '\xff', '\x7e', '\x05', '\x00', '\xfc', '\x7f', '\x80', '\x80', '\x7f', '\x05', 
+  '\x00', '\xff', '\x7e', '\x0b', '\x81', '\xff', '\x7e', '\x05', '\x00', '\xff', '\x7e', '\x07', '\x81', '\xff', '\x7e', '\x04', '\x00', 
+  '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x67', '\x00', '\xfd', '\xff', '\x00', 
+  '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x06', '\x07', '\x09', '\xff', '\x06', 
+  '\x05', '\x00', '\xfc', '\xfe', '\x01', '\x01', '\xfe', '\x05', '\x00', '\xff', '\x06', '\x06', '\x09', '\xf8', '\x11', '\x21', '\xc1', 
+  '\x01', '\x01', '\xc1', '\x21', '\x11', '\x06', '\x09', '\xff', '\x06', '\x05', '\x00', '\xfc', '\xfe', '\x01', '\x01', '\xfe', '\x05', 
+  '\x00', '\xff', '\x06', '\x07', '\x09', '\xff', '\x06', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', 
+  '\xfd', '\x0f', '\x10', '\x27', '\x0e', '\x28', '\xfd', '\xc8', '\x10', '\xe0', '\x04', '\x00', '\xfa', '\xff', '\x00', '\x00', '\x03', 
+  '\x04', '\x08', '\x06', '\x90', '\xff', '\x60', '\x05', '\x00', '\xfc', '\x7f', '\x80', '\x80', '\x7f', '\x05', '\x00', '\xff', '\x60', 
+  '\x06', '\x90', '\xfa', '\x08', '\x04', '\x03', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xe0', '\x10', '\xc8', '\x0e', '\x28', 
+  '\xfd', '\x27', '\x10', '\x0f', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xfa', '\xff', '\x00', 
+  '\x00', '\xfc', '\x02', '\x01', '\x25', '\x00', '\xfa', '\x01', '\x02', '\xfc', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x19', '\x00', '\x05', '\x00', '\x11', '\x14', '\xfd', '\x13', '\x08', '\x07', '\x04', '\x00', '\xfc', '\x07', '\x08', 
+  '\x08', '\x07', '\x05', '\x00', '\xfe', '\xff', '\xff', '\x05', '\x03', '\x05', '\x02', '\x05', '\x03', '\xfe', '\xff', '\xff', '\x05', 
+  '\x00', '\xfc', '\x07', '\x08', '\x08', '\x07', '\x04', '\x00', '\xfd', '\x07', '\x08', '\x13', '\x11', '\x14', '\x05', '\x00', '\x05', 
+  '\x00', '\x11', '\x28', '\xfd', '\xc8', '\x10', '\xe0', '\x04', '\x00', '\xfc', '\xe0', '\x10', '\x10', '\xe0', '\x05', '\x00', '\xfe', 
+  '\xff', '\xff', '\x15', '\xc0', '\xfe', '\xff', '\xff', '\x05', '\x00', '\xfc', '\xe0', '\x10', '\x10', '\xe0', '\x04', '\x00', '\xfd', 
+  '\xe0', '\x10', '\xc8', '\x11', '\x28', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xfc', '\xff', 
+  '\x00', '\x00', '\xff', '\x29', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x19', 
+  '\x00', '\x05', '\x00', '\xfd', '\xf0', '\x08', '\xe4', '\x0e', '\x14', '\xfd', '\x13', '\x08', '\x07', '\x04', '\x00', '\xfc', '\x07', 
+  '\x08', '\x08', '\x07', '\x05', '\x00', '\xff', '\x06', '\x07', '\x09', '\xfa', '\x11', '\xe1', '\x01', '\x01', '\xe1', '\x11', '\x07', 
+  '\x09', '\xff', '\x06', '\x05', '\x00', '\xfc', '\x07', '\x08', '\x08', '\x07', '\x04', '\x00', '\xfd', '\x07', '\x08', '\x13', '\x0e', 
+  '\x14', '\xfd', '\xe4', '\x08', '\xf0', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x60', 
+  '\x03', '\x90', '\x01', '\x10', '\xff', '\xe0', '\x05', '\x00', '\xff', '\x60', '\x0b', '\x90', '\xff', '\x60', '\x05', '\x00', '\xfc', 
+  '\x7f', '\x80', '\x80', '\x7f', '\x05', '\x00', '\xff', '\x60', '\x0b', '\x90', '\xff', '\x60', '\x05', '\x00', '\xff', '\xe0', '\x01', 
+  '\x10', '\x03', '\x90', '\xff', '\x60', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x0b', '\x00', '\xfb', '\x01', '\xfe', '\x00', '\x00', '\xff', '\x41', '\x00', '\xfb', '\xff', '\x00', '\x00', '\xfe', 
+  '\x01', '\x0b', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xf0', '\x03', '\x09', 
+  '\xff', '\x06', '\x05', '\x00', '\xfc', '\x07', '\x08', '\x08', '\x07', '\x05', '\x00', '\xfc', '\xfe', '\x01', '\x01', '\xfe', '\x05', 
+  '\x00', '\xff', '\x06', '\x07', '\x09', '\xfa', '\x11', '\xe1', '\x01', '\x01', '\xe1', '\x11', '\x07', '\x09', '\xff', '\x06', '\x05', 
+  '\x00', '\xfc', '\xfe', '\x01', '\x01', '\xfe', '\x05', '\x00', '\xfc', '\x07', '\x08', '\x08', '\x07', '\x05', '\x00', '\xff', '\x06', 
+  '\x03', '\x09', '\xfd', '\xf0', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', 
+  '\x60', '\x0f', '\x90', '\xfa', '\x88', '\x87', '\x80', '\x80', '\x87', '\x88', '\x07', '\x90', '\xff', '\x60', '\x05', '\x00', '\xfc', 
+  '\x7f', '\x80', '\x80', '\x7f', '\x05', '\x00', '\xff', '\x60', '\x07', '\x90', '\xfa', '\x88', '\x87', '\x80', '\x80', '\x87', '\x88', 
+  '\x0f', '\x90', '\xff', '\x60', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', 
+  '\x7f', '\x67', '\x80', '\xfd', '\x7f', '\x00', '\xff', '\x05', '\x00', '\x06', '\x00', '\xff', '\x01', '\x69', '\x02', '\xff', '\x01', 
+  '\x06', '\x00', '\x7d', '\x00'
+};
+static const uint16_t image_offsets2[17] =
+{
+  0, 21, 74, 88, 151, 210, 242, 288, 330, 358, 415, 472, 502, 569, 624, 638, 648
+};
diff --git a/pacman/image.h3 b/pacman/image.h3
new file mode 100644 (file)
index 0000000..d8ef6fd
--- /dev/null
@@ -0,0 +1,49 @@
+static const uint8_t image3[710] =
+{
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x07', '\x80', '\x07', '\x00', '\x0b', '\x80', '\x06', '\x00', '\xfc', 
+  '\xff', '\x00', '\x00', '\xff', '\x06', '\x00', '\x0b', '\x80', '\x07', '\x00', '\x07', '\x80', '\x05', '\x00', '\xfd', '\xff', '\x00', 
+  '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x3f', '\x07', '\x40', '\xff', '\x3f', 
+  '\x05', '\x00', '\xff', '\x3f', '\x0b', '\x40', '\xff', '\x3f', '\x05', '\x00', '\xfc', '\x3f', '\x40', '\x40', '\x3f', '\x05', '\x00', 
+  '\xff', '\x3f', '\x0b', '\x40', '\xff', '\x3f', '\x05', '\x00', '\xff', '\x3f', '\x07', '\x40', '\xff', '\x3f', '\x04', '\x00', '\xfd', 
+  '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x07', '\x80', '\x07', '\x00', 
+  '\xfe', '\x80', '\x80', '\x07', '\x00', '\x17', '\x80', '\x07', '\x00', '\xfe', '\x80', '\x80', '\x07', '\x00', '\x07', '\x80', '\x05', 
+  '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x03', 
+  '\x07', '\x04', '\xff', '\x03', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x03', '\x06', '\x04', 
+  '\xf8', '\x08', '\x10', '\xe0', '\x00', '\x00', '\xe0', '\x10', '\x08', '\x06', '\x04', '\xff', '\x03', '\x05', '\x00', '\xfc', '\xff', 
+  '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x03', '\x07', '\x04', '\xff', '\x03', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x05', '\x00', '\x05', '\x00', '\xfd', '\x07', '\x08', '\x13', '\x0e', '\x14', '\xfd', '\xe4', '\x08', '\xf0', '\x04', '\x00', '\xfa', 
+  '\xff', '\x00', '\x00', '\x01', '\x02', '\x84', '\x06', '\x48', '\xff', '\x30', '\x05', '\x00', '\xfc', '\x3f', '\x40', '\x40', '\x3f', 
+  '\x05', '\x00', '\xff', '\x30', '\x06', '\x48', '\xfa', '\x84', '\x02', '\x01', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xf0', 
+  '\x08', '\xe4', '\x0e', '\x14', '\xfd', '\x13', '\x08', '\x07', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', 
+  '\x00', '\xfb', '\xff', '\x00', '\x00', '\xfe', '\x01', '\x04', '\x00', '\x07', '\x80', '\x05', '\x00', '\x07', '\x80', '\x04', '\x00', 
+  '\xfb', '\x01', '\xfe', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x19', '\x00', '\x05', '\x00', '\x11', 
+  '\x0a', '\xfd', '\x09', '\x04', '\x03', '\x04', '\x00', '\xfc', '\x03', '\x04', '\x04', '\x03', '\x05', '\x00', '\xfe', '\xff', '\xff', 
+  '\x15', '\x01', '\xfe', '\xff', '\xff', '\x05', '\x00', '\xfc', '\x03', '\x04', '\x04', '\x03', '\x04', '\x00', '\xfd', '\x03', '\x04', 
+  '\x09', '\x11', '\x0a', '\x05', '\x00', '\x05', '\x00', '\x11', '\x14', '\xfd', '\xe4', '\x08', '\xf0', '\x04', '\x00', '\xfc', '\xf0', 
+  '\x08', '\x08', '\xf0', '\x05', '\x00', '\xfe', '\x7f', '\x7f', '\x15', '\x60', '\xfe', '\x7f', '\x7f', '\x05', '\x00', '\xfc', '\xf0', 
+  '\x08', '\x08', '\xf0', '\x04', '\x00', '\xfd', '\xf0', '\x08', '\xe4', '\x11', '\x14', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x04', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x06', '\x00', '\x17', '\x80', '\x06', '\x00', '\xfc', '\xff', 
+  '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x19', '\x00', '\x05', '\x00', '\xfd', '\xf8', '\x04', '\xf2', 
+  '\x0e', '\x0a', '\xfd', '\x09', '\x04', '\x03', '\x04', '\x00', '\xfc', '\x03', '\x04', '\x04', '\x03', '\x05', '\x00', '\xff', '\x03', 
+  '\x07', '\x04', '\xfa', '\x08', '\xf0', '\x00', '\x00', '\xf0', '\x08', '\x07', '\x04', '\xff', '\x03', '\x05', '\x00', '\xfc', '\x03', 
+  '\x04', '\x04', '\x03', '\x04', '\x00', '\xfd', '\x03', '\x04', '\x09', '\x0e', '\x0a', '\xfd', '\xf2', '\x04', '\xf8', '\x05', '\x00', 
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x30', '\x03', '\x48', '\xff', '\x88', '\x00', '\x08', '\xff', 
+  '\xf0', '\x05', '\x00', '\xff', '\x30', '\x0b', '\x48', '\xff', '\x30', '\x05', '\x00', '\xfc', '\x3f', '\x40', '\x40', '\x3f', '\x05', 
+  '\x00', '\xff', '\x30', '\x0b', '\x48', '\xff', '\x30', '\x05', '\x00', '\xff', '\xf0', '\x00', '\x08', '\xff', '\x88', '\x03', '\x48', 
+  '\xff', '\x30', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\x7f', '\x03', 
+  '\x80', '\x06', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x06', '\x00', '\xfe', '\x80', '\x80', '\x07', '\x00', '\x17', '\x80', 
+  '\x07', '\x00', '\xfe', '\x80', '\x80', '\x06', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x06', '\x00', '\x03', '\x80', '\xfd', 
+  '\x7f', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xf8', '\x03', '\x04', '\xff', '\x03', '\x05', '\x00', 
+  '\xfc', '\x03', '\x04', '\x04', '\x03', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x03', '\x07', 
+  '\x04', '\xfa', '\x08', '\xf0', '\x00', '\x00', '\xf0', '\x08', '\x07', '\x04', '\xff', '\x03', '\x05', '\x00', '\xfc', '\xff', '\x00', 
+  '\x00', '\xff', '\x05', '\x00', '\xfc', '\x03', '\x04', '\x04', '\x03', '\x05', '\x00', '\xff', '\x03', '\x03', '\x04', '\xfd', '\xf8', 
+  '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x30', '\x0f', '\x48', '\xfa', 
+  '\x44', '\x43', '\x40', '\x40', '\x43', '\x44', '\x07', '\x48', '\xff', '\x30', '\x05', '\x00', '\xfc', '\x3f', '\x40', '\x40', '\x3f', 
+  '\x05', '\x00', '\xff', '\x30', '\x07', '\x48', '\xfa', '\x44', '\x43', '\x40', '\x40', '\x43', '\x44', '\x0f', '\x48', '\xff', '\x30', 
+  '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\x7f', '\x80', '\x3f', '\x67', '\x40', '\xfd', 
+  '\x3f', '\x80', '\x7f', '\x05', '\x00', '\x07', '\x00', '\x69', '\x01', '\x07', '\x00', '\x7d', '\x00'
+};
+static const uint16_t image_offsets3[17] =
+{
+  0, 37, 90, 126, 189, 248, 286, 328, 370, 402, 459, 520, 566, 633, 688, 702, 708
+};
diff --git a/pacman/image.h4 b/pacman/image.h4
new file mode 100644 (file)
index 0000000..cad8482
--- /dev/null
@@ -0,0 +1,52 @@
+static const uint8_t image4[752] =
+{
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x80', '\x07', '\x40', '\xff', '\x80', '\x05', '\x00', '\xff', 
+  '\x80', '\x0b', '\x40', '\xff', '\x80', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x80', '\x0b', 
+  '\x40', '\xff', '\x80', '\x05', '\x00', '\xff', '\x80', '\x07', '\x40', '\xff', '\x80', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x1f', '\x07', '\x20', '\xff', '\x1f', '\x05', 
+  '\x00', '\xff', '\x1f', '\x0b', '\x20', '\xff', '\x1f', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xff', 
+  '\x1f', '\x0b', '\x20', '\xff', '\x1f', '\x05', '\x00', '\xff', '\x1f', '\x07', '\x20', '\xff', '\x1f', '\x04', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x80', '\x07', '\x40', '\xff', 
+  '\x80', '\x05', '\x00', '\xfc', '\x80', '\x40', '\x40', '\x80', '\x05', '\x00', '\xff', '\x80', '\x17', '\x40', '\xff', '\x80', '\x05', 
+  '\x00', '\xfc', '\x80', '\x40', '\x40', '\x80', '\x05', '\x00', '\xff', '\x80', '\x07', '\x40', '\xff', '\x80', '\x04', '\x00', '\xfd', 
+  '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x01', '\x07', '\x02', 
+  '\xff', '\x01', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x01', '\x06', '\x02', '\xf8', '\x04', 
+  '\x08', '\xf0', '\x00', '\x00', '\xf0', '\x08', '\x04', '\x06', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', 
+  '\xff', '\x05', '\x00', '\xff', '\x01', '\x07', '\x02', '\xff', '\x01', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', 
+  '\x05', '\x00', '\xfd', '\x03', '\x04', '\x09', '\x0e', '\x0a', '\xfd', '\xf2', '\x04', '\xf8', '\x04', '\x00', '\xff', '\xff', '\x00', 
+  '\x00', '\xfe', '\x81', '\x42', '\x06', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', 
+  '\xff', '\x18', '\x06', '\x24', '\xfe', '\x42', '\x81', '\x00', '\x00', '\xff', '\xff', '\x04', '\x00', '\xfd', '\xf8', '\x04', '\xf2', 
+  '\x0e', '\x0a', '\xfd', '\x09', '\x04', '\x03', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xfc', 
+  '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\x07', '\xc0', '\x05', '\x80', '\x07', '\xc0', '\x05', '\x00', '\xfc', '\xff', '\x00', 
+  '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x19', '\x00', '\x05', '\x00', '\x11', '\x05', '\xfd', '\x04', '\x02', 
+  '\x01', '\x04', '\x00', '\xfc', '\x01', '\x02', '\x02', '\x01', '\x05', '\x00', '\xfe', '\xff', '\xff', '\x15', '\x00', '\xfe', '\xff', 
+  '\xff', '\x05', '\x00', '\xfc', '\x01', '\x02', '\x02', '\x01', '\x04', '\x00', '\xfd', '\x01', '\x02', '\x04', '\x11', '\x05', '\x05', 
+  '\x00', '\x05', '\x00', '\x11', '\x0a', '\xfd', '\xf2', '\x04', '\xf8', '\x04', '\x00', '\xfc', '\xf8', '\x04', '\x04', '\xf8', '\x05', 
+  '\x00', '\xfe', '\x3f', '\x3f', '\x15', '\x30', '\xfe', '\x3f', '\x3f', '\x05', '\x00', '\xfc', '\xf8', '\x04', '\x04', '\xf8', '\x04', 
+  '\x00', '\xfd', '\xf8', '\x04', '\xf2', '\x11', '\x0a', '\x05', '\x00', '\x19', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', 
+  '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x80', '\x17', '\x40', '\xff', '\x80', '\x05', '\x00', '\xfc', '\xff', 
+  '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x19', '\x00', '\x05', '\x00', '\xfd', '\xfc', '\x02', '\xf9', 
+  '\x0e', '\x05', '\xfd', '\x04', '\x02', '\x01', '\x04', '\x00', '\xfc', '\x01', '\x02', '\x02', '\x01', '\x05', '\x00', '\xff', '\x01', 
+  '\x07', '\x02', '\xfa', '\x04', '\xf8', '\x00', '\x00', '\xf8', '\x04', '\x07', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', 
+  '\x02', '\x02', '\x01', '\x04', '\x00', '\xfd', '\x01', '\x02', '\x04', '\x0e', '\x05', '\xfd', '\xf9', '\x02', '\xfc', '\x05', '\x00', 
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x18', '\x03', '\x24', '\xfb', '\x44', '\x84', '\x04', '\x04', 
+  '\xf8', '\x05', '\x00', '\xff', '\x18', '\x0b', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', 
+  '\x00', '\xff', '\x18', '\x0b', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfb', '\xf8', '\x04', '\x04', '\x84', '\x44', '\x03', '\x24', 
+  '\xff', '\x18', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\x3f', '\x03', 
+  '\x40', '\xff', '\x80', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xfc', '\x80', '\x40', '\x40', '\x80', 
+  '\x05', '\x00', '\xff', '\x80', '\x17', '\x40', '\xff', '\x80', '\x05', '\x00', '\xfc', '\x80', '\x40', '\x40', '\x80', '\x05', '\x00', 
+  '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x80', '\x03', '\x40', '\xfd', '\x3f', '\x00', '\xff', '\x05', '\x00', 
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xfc', '\x03', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\x01', '\x02', '\x02', '\x01', 
+  '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x01', '\x07', '\x02', '\xfa', '\x04', '\xf8', '\x00', 
+  '\x00', '\xf8', '\x04', '\x07', '\x02', '\xff', '\x01', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xfc', 
+  '\x01', '\x02', '\x02', '\x01', '\x05', '\x00', '\xff', '\x01', '\x03', '\x02', '\xfd', '\xfc', '\x00', '\xff', '\x05', '\x00', '\x05', 
+  '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x18', '\x0f', '\x24', '\xfa', '\x22', '\x21', '\x20', '\x20', '\x21', 
+  '\x22', '\x07', '\x24', '\xff', '\x18', '\x05', '\x00', '\xfc', '\x1f', '\x20', '\x20', '\x1f', '\x05', '\x00', '\xff', '\x18', '\x07', 
+  '\x24', '\xfa', '\x22', '\x21', '\x20', '\x20', '\x21', '\x22', '\x0f', '\x24', '\xff', '\x18', '\x04', '\x00', '\xfd', '\xff', '\x00', 
+  '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\x3f', '\x40', '\x9f', '\x67', '\xa0', '\xfd', '\x9f', '\x40', '\x3f', '\x05', '\x00', 
+  '\x7d', '\x00', '\x7d', '\x00'
+};
+static const uint16_t image_offsets4[17] =
+{
+  0, 53, 106, 158, 221, 280, 316, 358, 400, 436, 493, 554, 612, 679, 734, 748, 750
+};
diff --git a/pacman/image.h5 b/pacman/image.h5
new file mode 100644 (file)
index 0000000..1482da9
--- /dev/null
@@ -0,0 +1,50 @@
+static const uint8_t image5[722] =
+{
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\xc0', '\x07', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xff', 
+  '\xc0', '\x0b', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\xc0', '\x0b', 
+  '\x20', '\xff', '\xc0', '\x05', '\x00', '\xff', '\xc0', '\x07', '\x20', '\xff', '\xc0', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x0f', '\x07', '\x10', '\xff', '\x0f', '\x05', 
+  '\x00', '\xff', '\x0f', '\x0b', '\x10', '\xff', '\x0f', '\x05', '\x00', '\xfc', '\x0f', '\x10', '\x10', '\x0f', '\x05', '\x00', '\xff', 
+  '\x0f', '\x0b', '\x10', '\xff', '\x0f', '\x05', '\x00', '\xff', '\x0f', '\x07', '\x10', '\xff', '\x0f', '\x04', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\xc0', '\x07', '\x20', '\xff', 
+  '\xc0', '\x05', '\x00', '\xfc', '\xc0', '\x20', '\x20', '\xc0', '\x05', '\x00', '\xff', '\xc0', '\x17', '\x20', '\xff', '\xc0', '\x05', 
+  '\x00', '\xfc', '\xc0', '\x20', '\x20', '\xc0', '\x05', '\x00', '\xff', '\xc0', '\x07', '\x20', '\xff', '\xc0', '\x04', '\x00', '\xfd', 
+  '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x07', '\x01', '\x06', '\x00', 
+  '\xfb', '\xff', '\x00', '\x00', '\x7f', '\x80', '\x05', '\x00', '\x06', '\x01', '\xf8', '\x02', '\x04', '\xf8', '\x00', '\x00', '\xf8', 
+  '\x04', '\x02', '\x06', '\x01', '\x05', '\x00', '\xfb', '\x80', '\x7f', '\x00', '\x00', '\xff', '\x06', '\x00', '\x07', '\x01', '\x05', 
+  '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\x01', '\x02', '\x04', '\x0e', '\x05', '\xfd', '\xf9', 
+  '\x02', '\xfc', '\x04', '\x00', '\xfa', '\xff', '\x00', '\x00', '\x80', '\x40', '\x21', '\x06', '\x12', '\xff', '\x0c', '\x05', '\x00', 
+  '\xfc', '\x0f', '\x10', '\x10', '\x0f', '\x05', '\x00', '\xff', '\x0c', '\x06', '\x12', '\xfa', '\x21', '\x40', '\x80', '\x00', '\x00', 
+  '\xff', '\x04', '\x00', '\xfd', '\xfc', '\x02', '\xf9', '\x0e', '\x05', '\xfd', '\x04', '\x02', '\x01', '\x05', '\x00', '\x05', '\x00', 
+  '\x11', '\x80', '\xfd', '\x7f', '\x00', '\xff', '\x04', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xfe', '\xe0', 
+  '\xe0', '\x05', '\x60', '\x05', '\x40', '\x05', '\x60', '\xfe', '\xe0', '\xe0', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', 
+  '\x04', '\x00', '\xfd', '\xff', '\x00', '\x7f', '\x11', '\x80', '\x05', '\x00', '\x05', '\x00', '\x12', '\x02', '\xff', '\x01', '\x06', 
+  '\x00', '\xfe', '\x01', '\x01', '\x06', '\x00', '\xfe', '\xff', '\xff', '\x15', '\x00', '\xfe', '\xff', '\xff', '\x06', '\x00', '\xfe', 
+  '\x01', '\x01', '\x06', '\x00', '\xff', '\x01', '\x12', '\x02', '\x05', '\x00', '\x05', '\x00', '\x11', '\x05', '\xfd', '\xf9', '\x02', 
+  '\xfc', '\x04', '\x00', '\xfc', '\xfc', '\x02', '\x02', '\xfc', '\x05', '\x00', '\xfe', '\x1f', '\x1f', '\x15', '\x18', '\xfe', '\x1f', 
+  '\x1f', '\x05', '\x00', '\xfc', '\xfc', '\x02', '\x02', '\xfc', '\x04', '\x00', '\xfd', '\xfc', '\x02', '\xf9', '\x11', '\x05', '\x05', 
+  '\x00', '\x07', '\x00', '\x0f', '\x80', '\xfd', '\x7f', '\x00', '\xff', '\x04', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', 
+  '\x00', '\xff', '\xc0', '\x17', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', 
+  '\xff', '\x00', '\x7f', '\x0f', '\x80', '\x07', '\x00', '\x05', '\x00', '\xfd', '\xfe', '\x01', '\xfc', '\x0f', '\x02', '\xff', '\x01', 
+  '\x06', '\x00', '\xfe', '\x01', '\x01', '\x07', '\x00', '\x07', '\x01', '\xfa', '\x02', '\xfc', '\x00', '\x00', '\xfc', '\x02', '\x07', 
+  '\x01', '\x07', '\x00', '\xfe', '\x01', '\x01', '\x06', '\x00', '\xff', '\x01', '\x0f', '\x02', '\xfd', '\xfc', '\x01', '\xfe', '\x05', 
+  '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x0c', '\x03', '\x12', '\xfb', '\x22', '\xc2', '\x02', 
+  '\x02', '\xfc', '\x05', '\x00', '\xff', '\x0c', '\x0b', '\x12', '\xff', '\x0c', '\x05', '\x00', '\xfc', '\x0f', '\x10', '\x10', '\x0f', 
+  '\x05', '\x00', '\xff', '\x0c', '\x0b', '\x12', '\xff', '\x0c', '\x05', '\x00', '\xfb', '\xfc', '\x02', '\x02', '\xc2', '\x22', '\x03', 
+  '\x12', '\xff', '\x0c', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\x1f', 
+  '\x03', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xfc', '\xc0', '\x20', '\x20', 
+  '\xc0', '\x05', '\x00', '\xff', '\xc0', '\x17', '\x20', '\xff', '\xc0', '\x05', '\x00', '\xfc', '\xc0', '\x20', '\x20', '\xc0', '\x05', 
+  '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\xc0', '\x03', '\x20', '\xfd', '\x1f', '\x00', '\xff', '\x05', 
+  '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xfe', '\x03', '\x01', '\x07', '\x00', '\xfe', '\x01', '\x01', '\x06', '\x00', '\xfc', 
+  '\xff', '\x00', '\x00', '\xff', '\x06', '\x00', '\x07', '\x01', '\xfa', '\x02', '\xfc', '\x00', '\x00', '\xfc', '\x02', '\x07', '\x01', 
+  '\x06', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x06', '\x00', '\xfe', '\x01', '\x01', '\x07', '\x00', '\x03', '\x01', '\xfd', 
+  '\xfe', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x0c', '\x0f', '\x12', 
+  '\xff', '\x11', '\x01', '\x10', '\xff', '\x11', '\x07', '\x12', '\xff', '\x0c', '\x05', '\x00', '\xfc', '\x0f', '\x10', '\x10', '\x0f', 
+  '\x05', '\x00', '\xff', '\x0c', '\x07', '\x12', '\xff', '\x11', '\x01', '\x10', '\xff', '\x11', '\x0f', '\x12', '\xff', '\x0c', '\x04', 
+  '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\x1f', '\x20', '\x4f', '\x67', '\x50', '\xfd', '\x4f', 
+  '\x20', '\x1f', '\x05', '\x00', '\x7d', '\x00', '\x7d', '\x00'
+};
+static const uint16_t image_offsets5[17] =
+{
+  0, 53, 106, 158, 211, 270, 316, 350, 392, 432, 477, 538, 596, 651, 704, 718, 720
+};
diff --git a/pacman/image.h6 b/pacman/image.h6
new file mode 100644 (file)
index 0000000..4706b6f
--- /dev/null
@@ -0,0 +1,47 @@
+static const uint8_t image6[674] =
+{
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\xe0', '\x07', '\x10', '\xff', '\xe0', '\x05', '\x00', '\xff', 
+  '\xe0', '\x0b', '\x10', '\xff', '\xe0', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\xe0', '\x0b', 
+  '\x10', '\xff', '\xe0', '\x05', '\x00', '\xff', '\xe0', '\x07', '\x10', '\xff', '\xe0', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x07', '\x07', '\x08', '\xff', '\x07', '\x05', 
+  '\x00', '\xff', '\x07', '\x0b', '\x08', '\xff', '\x07', '\x05', '\x00', '\xfc', '\x07', '\x08', '\x08', '\x07', '\x05', '\x00', '\xff', 
+  '\x07', '\x0b', '\x08', '\xff', '\x07', '\x05', '\x00', '\xff', '\x07', '\x07', '\x08', '\xff', '\x07', '\x04', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x60', '\x07', '\x90', '\xff', 
+  '\x60', '\x05', '\x00', '\xfc', '\xe0', '\x10', '\x10', '\xe0', '\x05', '\x00', '\xff', '\x60', '\x06', '\x90', '\x05', '\x10', '\x06', 
+  '\x90', '\xff', '\x60', '\x05', '\x00', '\xfc', '\xe0', '\x10', '\x10', '\xe0', '\x05', '\x00', '\xff', '\x60', '\x07', '\x90', '\xff', 
+  '\x60', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\x7f', '\x0f', '\x80', 
+  '\x06', '\x00', '\xfa', '\xff', '\x00', '\x00', '\x3f', '\x40', '\x80', '\x0d', '\x00', '\xf8', '\x01', '\x02', '\xfc', '\x00', '\x00', 
+  '\xfc', '\x02', '\x01', '\x0d', '\x00', '\xfa', '\x80', '\x40', '\x3f', '\x00', '\x00', '\xff', '\x06', '\x00', '\x0f', '\x80', '\xfd', 
+  '\x7f', '\x00', '\xff', '\x05', '\x00', '\x06', '\x00', '\xff', '\x01', '\x0f', '\x02', '\xfd', '\xfc', '\x01', '\xfe', '\x04', '\x00', 
+  '\xfa', '\xff', '\x00', '\x00', '\xc0', '\x20', '\x10', '\x06', '\x09', '\xff', '\x06', '\x05', '\x00', '\xfc', '\x07', '\x08', '\x08', 
+  '\x07', '\x05', '\x00', '\xff', '\x06', '\x06', '\x09', '\xfa', '\x10', '\x20', '\xc0', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', 
+  '\xfe', '\x01', '\xfc', '\x0f', '\x02', '\xff', '\x01', '\x06', '\x00', '\x05', '\x00', '\x11', '\x40', '\xfd', '\x3f', '\x80', '\x7f', 
+  '\x04', '\x00', '\xfc', '\x7f', '\x80', '\x80', '\x7f', '\x05', '\x00', '\xfe', '\xf0', '\xf0', '\x05', '\x30', '\x05', '\x20', '\x05', 
+  '\x30', '\xfe', '\xf0', '\xf0', '\x05', '\x00', '\xfc', '\x7f', '\x80', '\x80', '\x7f', '\x04', '\x00', '\xfd', '\x7f', '\x80', '\x3f', 
+  '\x11', '\x40', '\x05', '\x00', '\x05', '\x00', '\x12', '\x81', '\x12', '\x00', '\xfe', '\xff', '\xff', '\x15', '\x00', '\xfe', '\xff', 
+  '\xff', '\x12', '\x00', '\x12', '\x81', '\x05', '\x00', '\x05', '\x00', '\x11', '\x02', '\xfd', '\xfc', '\x01', '\xfe', '\x04', '\x00', 
+  '\xfc', '\xfe', '\x01', '\x01', '\xfe', '\x05', '\x00', '\xfe', '\x0f', '\x0f', '\x15', '\x0c', '\xfe', '\x0f', '\x0f', '\x05', '\x00', 
+  '\xfc', '\xfe', '\x01', '\x01', '\xfe', '\x04', '\x00', '\xfd', '\xfe', '\x01', '\xfc', '\x11', '\x02', '\x05', '\x00', '\x06', '\x00', 
+  '\xff', '\x80', '\x0f', '\x40', '\xfd', '\x3f', '\x80', '\x7f', '\x04', '\x00', '\xfc', '\x7f', '\x80', '\x80', '\x7f', '\x05', '\x00', 
+  '\xff', '\x60', '\x07', '\x90', '\x03', '\x10', '\x07', '\x90', '\xff', '\x60', '\x05', '\x00', '\xfc', '\x7f', '\x80', '\x80', '\x7f', 
+  '\x04', '\x00', '\xfd', '\x7f', '\x80', '\x3f', '\x0f', '\x40', '\xff', '\x80', '\x06', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', 
+  '\xfe', '\x0f', '\x01', '\x1d', '\x00', '\xfa', '\x01', '\xfe', '\x00', '\x00', '\xfe', '\x01', '\x1d', '\x00', '\x0f', '\x01', '\xfd', 
+  '\xfe', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x06', '\x03', '\x09', 
+  '\xfb', '\x11', '\xe1', '\x01', '\x01', '\xfe', '\x05', '\x00', '\xff', '\x06', '\x0b', '\x09', '\xff', '\x06', '\x05', '\x00', '\xfc', 
+  '\x07', '\x08', '\x08', '\x07', '\x05', '\x00', '\xff', '\x06', '\x0b', '\x09', '\xff', '\x06', '\x05', '\x00', '\xfb', '\xfe', '\x01', 
+  '\x01', '\xe1', '\x11', '\x03', '\x09', '\xff', '\x06', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', 
+  '\xfd', '\xff', '\x00', '\x0f', '\x03', '\x90', '\xff', '\x60', '\x05', '\x00', '\xfc', '\x7f', '\x80', '\x80', '\x7f', '\x05', '\x00', 
+  '\xfc', '\xe0', '\x10', '\x10', '\xe0', '\x05', '\x00', '\xff', '\x60', '\x07', '\x90', '\x03', '\x10', '\x07', '\x90', '\xff', '\x60', 
+  '\x05', '\x00', '\xfc', '\xe0', '\x10', '\x10', '\xe0', '\x05', '\x00', '\xfc', '\x7f', '\x80', '\x80', '\x7f', '\x05', '\x00', '\xff', 
+  '\x60', '\x03', '\x90', '\xfd', '\x0f', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x17', '\x00', 
+  '\xfa', '\x80', '\x7f', '\x00', '\x00', '\x7f', '\x80', '\x0f', '\x00', '\xfa', '\x01', '\xfe', '\x00', '\x00', '\xfe', '\x01', '\x0f', 
+  '\x00', '\xfa', '\x80', '\x7f', '\x00', '\x00', '\x7f', '\x80', '\x17', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', 
+  '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x06', '\x0f', '\x09', '\x03', '\x08', '\x07', '\x09', '\xff', '\x06', 
+  '\x05', '\x00', '\xfc', '\x07', '\x08', '\x08', '\x07', '\x05', '\x00', '\xff', '\x06', '\x07', '\x09', '\x03', '\x08', '\x0f', '\x09', 
+  '\xff', '\x06', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\x0f', '\x10', '\x27', '\x67', 
+  '\x28', '\xfd', '\x27', '\x10', '\x0f', '\x05', '\x00', '\x7d', '\x00', '\x7d', '\x00'
+};
+static const uint16_t image_offsets6[17] =
+{
+  0, 53, 106, 162, 209, 264, 310, 330, 372, 420, 447, 508, 570, 611, 656, 670, 672
+};
diff --git a/pacman/image.h7 b/pacman/image.h7
new file mode 100644 (file)
index 0000000..affc2b6
--- /dev/null
@@ -0,0 +1,50 @@
+static const uint8_t image7[714] =
+{
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\xf0', '\x07', '\x08', '\xff', '\xf0', '\x05', '\x00', '\xff', 
+  '\xf0', '\x0b', '\x08', '\xff', '\xf0', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\xf0', '\x0b', 
+  '\x08', '\xff', '\xf0', '\x05', '\x00', '\xff', '\xf0', '\x07', '\x08', '\xff', '\xf0', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x03', '\x07', '\x04', '\xff', '\x03', '\x05', 
+  '\x00', '\xff', '\x03', '\x0b', '\x04', '\xff', '\x03', '\x05', '\x00', '\xfc', '\x03', '\x04', '\x04', '\x03', '\x05', '\x00', '\xff', 
+  '\x03', '\x0b', '\x04', '\xff', '\x03', '\x05', '\x00', '\xff', '\x03', '\x07', '\x04', '\xff', '\x03', '\x04', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', '\xff', '\x30', '\x07', '\x48', '\xff', 
+  '\x30', '\x05', '\x00', '\xfc', '\xf0', '\x08', '\x08', '\xf0', '\x05', '\x00', '\xff', '\x30', '\x06', '\x48', '\xff', '\x88', '\x03', 
+  '\x08', '\xff', '\x88', '\x06', '\x48', '\xff', '\x30', '\x05', '\x00', '\xfc', '\xf0', '\x08', '\x08', '\xf0', '\x05', '\x00', '\xff', 
+  '\x30', '\x07', '\x48', '\xff', '\x30', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\x7f', 
+  '\x80', '\x3f', '\x0f', '\x40', '\xff', '\x80', '\x05', '\x00', '\xfa', '\xff', '\x00', '\x00', '\x1f', '\x20', '\x40', '\x06', '\x80', 
+  '\x05', '\x00', '\xfa', '\x01', '\xfe', '\x00', '\x00', '\xfe', '\x01', '\x05', '\x00', '\x06', '\x80', '\xfa', '\x40', '\x20', '\x1f', 
+  '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x80', '\x0f', '\x40', '\xfd', '\x3f', '\x80', '\x7f', '\x05', '\x00', '\x07', '\x00', 
+  '\x0f', '\x01', '\xfd', '\xfe', '\x00', '\xff', '\x04', '\x00', '\xfa', '\xff', '\x00', '\x00', '\xe0', '\x10', '\x08', '\x06', '\x04', 
+  '\xff', '\x03', '\x05', '\x00', '\xfc', '\x03', '\x04', '\x04', '\x03', '\x05', '\x00', '\xff', '\x03', '\x06', '\x04', '\xfa', '\x08', 
+  '\x10', '\xe0', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xfe', '\x0f', '\x01', '\x07', '\x00', '\x05', '\x00', 
+  '\x11', '\xa0', '\xfd', '\x9f', '\x40', '\x3f', '\x04', '\x00', '\xfc', '\x3f', '\x40', '\x40', '\x3f', '\x05', '\x00', '\xfe', '\xf8', 
+  '\xf8', '\x05', '\x18', '\x05', '\x10', '\x05', '\x18', '\xfe', '\xf8', '\xf8', '\x05', '\x00', '\xfc', '\x3f', '\x40', '\x40', '\x3f', 
+  '\x04', '\x00', '\xfd', '\x3f', '\x40', '\x9f', '\x11', '\xa0', '\x05', '\x00', '\x05', '\x00', '\x12', '\x40', '\xff', '\x80', '\x06', 
+  '\x00', '\xfe', '\x80', '\x80', '\x06', '\x00', '\xfe', '\xff', '\xff', '\x15', '\x00', '\xfe', '\xff', '\xff', '\x06', '\x00', '\xfe', 
+  '\x80', '\x80', '\x06', '\x00', '\xff', '\x80', '\x12', '\x40', '\x05', '\x00', '\x05', '\x00', '\x11', '\x01', '\xfd', '\xfe', '\x00', 
+  '\xff', '\x04', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x05', '\x00', '\xfe', '\x07', '\x07', '\x15', '\x06', '\xfe', '\x07', 
+  '\x07', '\x05', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xfe', '\x11', '\x01', '\x05', 
+  '\x00', '\x05', '\x00', '\xfd', '\x80', '\x40', '\x20', '\x0e', '\xa0', '\xfd', '\x9f', '\x40', '\x3f', '\x04', '\x00', '\xfc', '\x3f', 
+  '\x40', '\x40', '\x3f', '\x05', '\x00', '\xff', '\x30', '\x07', '\x48', '\xff', '\x88', '\x01', '\x08', '\xff', '\x88', '\x07', '\x48', 
+  '\xff', '\x30', '\x05', '\x00', '\xfc', '\x3f', '\x40', '\x40', '\x3f', '\x04', '\x00', '\xfd', '\x3f', '\x40', '\x9f', '\x0e', '\xa0', 
+  '\xfd', '\x20', '\x40', '\x80', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x07', '\x80', '\x07', 
+  '\x00', '\x0b', '\x80', '\x06', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x06', '\x00', '\x0b', '\x80', '\x07', '\x00', '\x07', 
+  '\x80', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x04', '\x00', 
+  '\xff', '\x03', '\x03', '\x04', '\xfb', '\x08', '\xf0', '\x00', '\x00', '\xff', '\x05', '\x00', '\xff', '\x03', '\x0b', '\x04', '\xff', 
+  '\x03', '\x05', '\x00', '\xfc', '\x03', '\x04', '\x04', '\x03', '\x05', '\x00', '\xff', '\x03', '\x0b', '\x04', '\xff', '\x03', '\x05', 
+  '\x00', '\xfb', '\xff', '\x00', '\x00', '\xf0', '\x08', '\x03', '\x04', '\xff', '\x03', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', 
+  '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', '\x00', '\x87', '\x03', '\x48', '\xff', '\x30', '\x05', '\x00', '\xfc', '\x3f', '\x40', 
+  '\x40', '\x3f', '\x05', '\x00', '\xfc', '\xf0', '\x08', '\x08', '\xf0', '\x05', '\x00', '\xff', '\x30', '\x07', '\x48', '\xff', '\x88', 
+  '\x01', '\x08', '\xff', '\x88', '\x07', '\x48', '\xff', '\x30', '\x05', '\x00', '\xfc', '\xf0', '\x08', '\x08', '\xf0', '\x05', '\x00', 
+  '\xfc', '\x3f', '\x40', '\x40', '\x3f', '\x05', '\x00', '\xff', '\x30', '\x03', '\x48', '\xfd', '\x87', '\x00', '\xff', '\x05', '\x00', 
+  '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x0f', '\x80', '\xfa', '\x40', '\x3f', '\x00', '\x00', '\x3f', '\x40', 
+  '\x07', '\x80', '\x06', '\x00', '\xfc', '\xff', '\x00', '\x00', '\xff', '\x06', '\x00', '\x07', '\x80', '\xfa', '\x40', '\x3f', '\x00', 
+  '\x00', '\x3f', '\x40', '\x0f', '\x80', '\x05', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', '\x00', '\xfd', '\xff', 
+  '\x00', '\xff', '\x04', '\x00', '\xff', '\x03', '\x1f', '\x04', '\xff', '\x03', '\x05', '\x00', '\xfc', '\x03', '\x04', '\x04', '\x03', 
+  '\x05', '\x00', '\xff', '\x03', '\x1f', '\x04', '\xff', '\x03', '\x04', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x05', '\x00', '\x05', 
+  '\x00', '\xfd', '\x07', '\x08', '\x13', '\x67', '\x14', '\xfd', '\x13', '\x08', '\x07', '\x05', '\x00', '\x7d', '\x00', '\x7d', '\x00'
+  
+};
+static const uint16_t image_offsets7[17] =
+{
+  0, 53, 106, 166, 219, 270, 316, 350, 392, 448, 485, 546, 612, 659, 696, 710, 712
+};
diff --git a/pacman/intermission-background.h b/pacman/intermission-background.h
new file mode 100644 (file)
index 0000000..2e7ae58
--- /dev/null
@@ -0,0 +1,9 @@
+static const uint8_t background_intermission[94] =
+{
+  '\x00', '\x00', '\xfc', '\xfc', '\x02', '\xf1', '\x09', '\x6f', '\x05', '\xfc', '\x09', '\xf1', '\x02', '\xfc', '\x03', '\x00', '\xfd', 
+  '\xff', '\x00', '\xff', '\x71', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x03', '\x00', '\xfd', '\xff', '\x00', '\xff', '\x71', '\x00', 
+  '\xfd', '\xff', '\x00', '\xff', '\x00', '\x00', '\xfa', '\xa0', '\xa0', '\x90', '\x8f', '\x40', '\x3f', '\x71', '\x00', '\xfa', '\x3f', 
+  '\x40', '\x8f', '\x90', '\xa0', '\xa0', '\x7f', '\x00', '\x7b', '\x00', '\xfa', '\x05', '\x05', '\x09', '\xf1', '\x02', '\xfc', '\x71', 
+  '\x00', '\xfa', '\xfc', '\x02', '\xf1', '\x09', '\x05', '\x05', '\x00', '\x00', '\xfc', '\x3f', '\x40', '\x8f', '\x90', '\x6f', '\xa0', 
+  '\xfc', '\x90', '\x8f', '\x40', '\x3f', '\xfd', '\x00', '\x00', '\x00'
+};
diff --git a/pacman/main.c b/pacman/main.c
new file mode 100644 (file)
index 0000000..5f7a77b
--- /dev/null
@@ -0,0 +1,1192 @@
+/****************************************************************************
+ *   apps/.*./main.c
+ *
+ * LPC1224/SSD1306 implementation of the famous pacman game
+ *
+ * Copyright 2017 Nathael Pajani <nathael.pajani@ed3l.fr>
+ *
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *************************************************************************** */
+
+#define ALLOW_SCREENSHOT
+
+#include "core/pio.h"
+#include "core/system.h"
+#include "core/systick.h"
+#include "lib/string.h"
+#include "drivers/gpio.h"
+#include "drivers/ssp.h"
+#ifdef ALLOW_SCREENSHOT
+#include "lib/stdio.h"
+#include "drivers/serial.h"
+#endif
+
+#include "extdrv/status_led.h"
+#include "extdrv/ssd130x_oled_driver.h"
+#include "extdrv/ssd130x_oled_buffer.h"
+
+#include "data.h"
+
+#define MODULE_VERSION    0x01
+#define MODULE_NAME "Pacman"
+
+#define SELECTED_FREQ  FREQ_SEL_48MHz
+
+/***************************************************************************** */
+/* Pins configuration */
+/* pins blocks are passed to set_pins() for pins configuration.
+ * Unused pin blocks can be removed safely with the corresponding set_pins() call
+ * All pins blocks may be safelly merged in a single block for single set_pins() call..
+ */
+const struct pio_config common_pins[] = {
+#ifdef ALLOW_SCREENSHOT
+       /* UART 0 : Config / Debug / USB */
+       { LPC_UART0_RX_PIO_0_1,  LPC_IO_DIGITAL },
+       { LPC_UART0_TX_PIO_0_2,  LPC_IO_DIGITAL },
+#endif
+       /* SPI : Display */
+       { LPC_SSP0_SCLK_PIO_0_14, LPC_IO_DIGITAL },
+       { LPC_SSP0_MISO_PIO_0_16, LPC_IO_DIGITAL },
+       { LPC_SSP0_MOSI_PIO_0_17, LPC_IO_DIGITAL },
+       /* buttons */
+       { LPC_GPIO_0_12, LPC_IO_DIGITAL }, /* ISP / User button OK */
+
+       { LPC_GPIO_0_6, LPC_IO_DIGITAL }, /* User button B4 */
+       { LPC_GPIO_0_5, LPC_IO_DIGITAL }, /* User button B3 */
+       { LPC_GPIO_0_4, LPC_IO_DIGITAL }, /* User button B2 */
+       { LPC_GPIO_0_3, LPC_IO_DIGITAL }, /* User button B1 */
+       ARRAY_LAST_PIO,
+};
+
+const struct pio status_led_green = LPC_GPIO_0_27;
+const struct pio status_led_red = LPC_GPIO_0_28;
+
+/* Buttons */
+const struct pio button_up    = LPC_GPIO_0_3; // B1
+const struct pio button_down  = LPC_GPIO_0_6; // B4
+const struct pio button_left  = LPC_GPIO_0_4; // B2
+const struct pio button_right = LPC_GPIO_0_5; // B3
+const struct pio button_ok    = LPC_GPIO_0_12; // BOK
+
+/***************************************************************************** */
+/* Basic system init and configuration */
+
+void system_init()
+{
+       /* Stop the Watchdog */
+       startup_watchdog_disable(); /* Do it right now, before it gets a chance to break in */
+       system_set_default_power_state();
+       clock_config(SELECTED_FREQ);
+       set_pins(common_pins);
+       gpio_on();
+       status_led_config(&status_led_green, &status_led_red);
+       /* System tick timer MUST be configured and running in order to use the sleeping
+        * functions */
+       systick_timer_on(1); /* 1ms */
+       systick_start();
+}
+
+/****************************************************************************/
+/* Oled Display */
+#define DISPLAY_ADDR   0x78
+static uint8_t gddram[ 4 + GDDRAM_SIZE ];
+struct oled_display display = {
+       .bus_type = SSD130x_BUS_SPI,
+       .address = DISPLAY_ADDR,
+       .bus_num = SSP_BUS_0,
+       .charge_pump = SSD130x_INTERNAL_PUMP,
+       .video_mode = SSD130x_DISP_NORMAL,
+       .contrast = 128,
+       .scan_dir = SSD130x_SCAN_BOTTOM_TOP,
+       .read_dir = SSD130x_RIGHT_TO_LEFT,
+       .display_offset_dir = SSD130x_MOVE_TOP,
+       .display_offset = 4,
+       .gddram = gddram,
+       .gpio_cs = LPC_GPIO_1_2,
+       .gpio_dc = LPC_GPIO_1_1,
+       .gpio_rst = LPC_GPIO_1_3,
+
+};
+
+#ifdef ALLOW_SCREENSHOT
+static void data_rx(uint8_t __attribute((unused))c)
+{
+}
+
+volatile int take_screenshot = 0;
+static void set_screenshot(uint32_t __attribute__((unused))gpio)
+{
+  take_screenshot = 1;
+}
+
+static void send_screenshot(void)
+{
+  int y, x, xx;
+  uprintf(UART0, "P4\n128 64\n");
+  for (y = 0; y < 64; y++)
+    for (x = 0; x < 128; x += 8)
+    {
+      uint32_t pattern = 0;
+      for (xx = 0; xx < 8; xx++)
+      {
+        pattern <<= 1;
+        if ((gddram[4 + (y/8)*128 + x + xx] >> (y & 7)) & 1)
+        {
+          pattern |= 1;
+        }
+      }
+      uprintf(UART0, "%c", pattern);
+    }
+  uprintf(UART0, "\n");
+}
+#endif
+
+/****************************************************************************/
+
+enum GhostNames
+{
+  GN_BLINKY,
+  GN_PINKY,
+  GN_INKY,
+  GN_CLYDE,
+  GN_NB_GHOSTS
+};
+
+enum GhostModes
+{
+  GM_CORNERS,
+  GM_FRIGHTENED,
+  GM_CHASE,
+  GM_EATEN,
+  GM_WAITING,
+  GM_IN_PEN
+};
+
+static uint32_t current_pills[31];
+
+struct Vec2
+{
+  int x, y;
+};
+
+struct Ghost
+{
+  struct Vec2 position;  /* */
+  struct Vec2 direction; /* */
+  struct Vec2 offset;    /* */
+  struct Vec2 target;    /* */
+  enum GhostModes mode;  /* */
+  int stopped;
+};
+
+struct Ghost ghosts[4] = 
+{
+  {
+    { 16, 11 }, { 1, 0 }, { 0, 0 }, { 28, -2 }, GM_CORNERS, 0
+  },
+  {
+    { 13, 14 }, { 1, 0 }, { 0, 0 }, { 5, -2 }, GM_IN_PEN, 0
+
+  },
+  {
+    { 15, 14 }, { 1, 0 }, { 0, 0 }, { 5, 33 }, GM_IN_PEN, 0
+
+  },
+  {
+    { 17, 14 }, { 1, 0 }, { 0, 0 }, { 28, 33 }, GM_IN_PEN, 0
+  }
+};
+
+struct Pacman
+{
+  struct Vec2 position;
+  struct Vec2 direction;
+  struct Vec2 sub_step;
+  struct Vec2 next_dir;
+  int shape, anim;
+};
+
+struct Pacman pacman =
+{
+  { 15, 23 },
+  { 0, 0 },
+  { 0, 0 },
+  { 0, 0 },
+  F_PACMAN_LEFT_0, 1
+};
+
+static int screen_offset = 0;
+static int current_frame = 0;
+static uint8_t score[5];
+static uint8_t ghost_score = 0;
+
+static volatile uint8_t button_up_pressed = 0;
+static volatile uint8_t button_down_pressed = 0;
+static volatile uint8_t button_left_pressed = 0;
+static volatile uint8_t button_right_pressed = 0;
+
+static void handle_buttons(uint32_t gpio)
+{ // FIXME: ugly
+  if (gpio == button_up.pin)
+  {
+    if (gpio_read(button_up) == 0)
+      button_up_pressed = 1;
+    else
+      button_up_pressed = 0;
+  }
+  if (gpio == button_left.pin)
+  {
+    if (gpio_read(button_left) == 0)
+      button_left_pressed = 1;
+    else
+      button_left_pressed = 0;
+  }
+  if (gpio == button_down.pin)
+  {
+    if (gpio_read(button_down) == 0)
+      button_down_pressed = 1;
+    else
+      button_down_pressed = 0;
+  }
+  if (gpio == button_right.pin)
+  {
+    if (gpio_read(button_right) == 0)
+      button_right_pressed = 1;
+    else
+      button_right_pressed = 0;
+  }
+}
+
+/*==========================================================================*\
+ * my_rand                                                                  *
+\*==========================================================================*/
+static uint32_t my_rand()
+{ 
+  static uint32_t x = 123456789;
+  static uint32_t y = 234567891;
+  static uint32_t z = 345678912;
+  static uint32_t w = 456789123;
+  static uint32_t c = 0;
+  int t;
+
+  y ^= (y << 5);
+  y ^= (y >> 7);
+  y ^= (y << 22); 
+  t = z + w + c;
+  z = w;
+  c = t < 0;
+  w = t & 2147483647; 
+  x += 1411392427; 
+
+  return x + y + w; 
+}
+
+/*==========================================================================*\
+ * draw_glyph                                                               *
+\*==========================================================================*/
+static void draw_glyph(int x, int y, uint8_t glyph)
+{
+  int i;
+  for (i = 0; i < 8; i++)
+    gddram[4 + y * 128 + x + i] = font[glyph * 8 + i];
+}
+
+/*==========================================================================*\
+ * score_add_10000                                                          *
+\*==========================================================================*/
+static void score_add_10000(int digit)
+{
+  score[1] += digit;
+  if (score[1] >9)
+  {
+    score[1] -= 10;
+    score[0]++;
+  }
+}
+
+/*==========================================================================*\
+ * score_add_1000                                                           *
+\*==========================================================================*/
+static void score_add_1000(int digit)
+{
+  score[2] += digit;
+  if (score[2] > 9)
+  {
+    score[2] -= 10;
+    score_add_10000(1);
+  }
+}
+/*==========================================================================*\
+ * score_add_100                                                            *
+\*==========================================================================*/
+static void score_add_100(int digit)
+{
+  score[3] += digit;
+  if (score[3] > 9)
+  {
+    score[3] -= 10;
+    score_add_1000(1);
+  }
+}
+
+/*==========================================================================*\
+ * score_add_10                                                             *
+\*==========================================================================*/
+static void score_add_10(int digit)
+{
+  score[4] += digit;
+  if (score[4] > 9)
+  {
+    score[4] -= 10;
+    score_add_100(1);
+  }
+}
+
+/*==========================================================================*\
+ * draw_score                                                               *
+\*==========================================================================*/
+static void draw_score(void)
+{
+  // Note this should be called last, so this can hide a ghost in the tunnel
+  draw_glyph(0, 0, F_BLANK);
+  draw_glyph(0, 1, F_DIGIT_0 + score[0]);
+  draw_glyph(0, 2, F_DIGIT_0 + score[1]);
+  draw_glyph(0, 3, F_DIGIT_0 + score[2]);
+  draw_glyph(0, 4, F_DIGIT_0 + score[3]);
+  draw_glyph(0, 5, F_DIGIT_0 + score[4]);
+  draw_glyph(0, 6, F_DIGIT_0);
+  draw_glyph(0, 7, F_BLANK);
+
+  // lifes left
+  draw_glyph(120, 0, F_BLANK);
+  draw_glyph(120, 1, F_PACMAN_RIGHT_1);
+  draw_glyph(120, 2, F_PACMAN_RIGHT_1);
+  draw_glyph(120, 3, F_PACMAN_RIGHT_1);
+  // fruits
+  draw_glyph(120, 4, F_BLANK);
+  draw_glyph(120, 5, F_CHERRY);
+  draw_glyph(120, 6, F_BLANK);
+  draw_glyph(120, 7, F_BLANK);
+}
+
+/*==========================================================================*\
+ * draw_sprite8x8                                                           *
+\*==========================================================================*/
+static void draw_sprite8x8(int x, int y, const uint8_t *sprite)
+{
+  int i, offset = 4 + 128 * (y / 8) + x;
+
+  if (y >= 0 && y < 64)
+    for (i = 0; i < 8; i++)
+      gddram[offset + i] |= sprite[i] << (y & 7);
+  if (y >= -8 && y < 56)
+  {
+    offset += 128;
+    for (i = 0; i < 8; i++)
+      gddram[offset + i] |= sprite[i] >> (8 - (y & 7));
+  }
+}
+
+/*==========================================================================*\
+ * draw_sprite8x8_with_mask                                                 *
+\*==========================================================================*/
+static void draw_sprite8x8_with_mask(int x, int y,
+                                     const uint8_t *sprite,
+                                     const uint8_t *mask)
+{
+  int i, offset = 4 + 128 * (y / 8) + x;
+
+  if (y >= 0 && y < 64)
+    for (i = 0; i < 8; i++)
+    {
+      gddram[offset + i] &= ~(mask[i] << (y & 7));
+      gddram[offset + i] |= sprite[i] << (y & 7);
+    }
+  if (y >= -8 && y < 56)
+  {
+    offset += 128; // on the next line...
+    for (i = 0; i < 8; i++)
+    {
+      gddram[offset + i] &= ~(mask[i] >> (8 - (y % 8)));
+      gddram[offset + i] |= sprite[i] >> (8 - (y % 8));
+    }
+  }
+}
+
+/*==========================================================================*\
+ * draw_pills                                                               *
+\*==========================================================================*/
+static void draw_pills(void)
+{ // FIXME: rewrite this mess!
+  int x, y;
+  for (y = 1; y < 31; y++) {
+    uint32_t line = current_pills[y];
+    if (line) {
+      for (x = 0; x < 32; x++)
+      if (line >> x & 1) {
+        int yp = 4 * y - screen_offset;
+        if ((x == 3 || x == 28) && (y == 3 || y == 23)) {
+          if (current_frame & 8) {
+            if (yp == -3) {
+              gddram[4 + x * 4 + 1] |= 0x01;
+              gddram[4 + x * 4 + 2] |= 0x01;
+            } else if (yp == -2) {
+              gddram[4 + x * 4 + 0] |= 0x01;
+              gddram[4 + x * 4 + 1] |= 0x03;
+              gddram[4 + x * 4 + 2] |= 0x03;
+              gddram[4 + x * 4 + 3] |= 0x01;
+            } else if (yp == -1) {
+              gddram[4 + x * 4 + 0] |= 0x03;
+              gddram[4 + x * 4 + 1] |= 0x07;
+              gddram[4 + x * 4 + 2] |= 0x07;
+              gddram[4 + x * 4 + 3] |= 0x03;
+            }
+            else if (yp >= 0 && yp < 64) {
+              int offset = 4 + 128 * (yp >> 3) + x * 4;
+              switch (yp & 7) {
+                case 0: case 1: case 2: case 3: case 4:
+                  gddram[offset + 0] |= (0x06 << (yp & 7));
+                  gddram[offset + 1] |= (0x0F << (yp & 7));
+                  gddram[offset + 2] |= (0x0F << (yp & 7));
+                  gddram[offset + 3] |= (0x06 << (yp & 7));
+                  break;
+                case 5:
+                  gddram[offset + 0] |= 0xC0;
+                  gddram[offset + 1] |= 0xE0;
+                  gddram[offset + 2] |= 0xE0;
+                  gddram[offset + 3] |= 0xC0;
+                  if (yp < 56) {
+                    gddram[offset + 128 + 1] |= 0x01;
+                    gddram[offset + 128 + 2] |= 0x01;
+                  }
+                  break;
+                case 6:
+                  gddram[offset + 0] |= 0x80;
+                  gddram[offset + 1] |= 0xC0;
+                  gddram[offset + 2] |= 0xC0;
+                  gddram[offset + 3] |= 0x80;
+                  if (yp < 56) {
+                    gddram[offset + 128 + 0] |= 0x01;
+                    gddram[offset + 128 + 1] |= 0x03;
+                    gddram[offset + 128 + 2] |= 0x03;
+                    gddram[offset + 128 + 3] |= 0x01;
+                  }
+                  break;
+                case 7:
+                  gddram[offset + 1] |= 0x80;
+                  gddram[offset + 2] |= 0x80;
+                  if (yp < 56) {
+                    gddram[offset + 128 + 0] |= 0x03;
+                    gddram[offset + 128 + 1] |= 0x07;
+                    gddram[offset + 128 + 2] |= 0x07;
+                    gddram[offset + 128 + 3] |= 0x03;
+                  }
+                  break;
+              }
+            }
+          }
+        }
+        else {
+          if (yp == -1) {
+            gddram[4 + x * 4 + 1] |= 0x03;
+            gddram[4 + x * 4 + 2] |= 0x03;
+          } else if (yp == -2) {
+            gddram[4 + x * 4 + 1] |= 0x01;
+            gddram[4 + x * 4 + 2] |= 0x01;
+          }
+          else if (yp >= 0 && yp < 64) {
+            int offset = 4 + 128 * (yp / 8) + x * 4;
+            switch (yp & 7)
+            {
+              case 0: case 1: case 2: case 3: case 4: case 5:
+                gddram[offset + 1] |= (0x06 << (yp & 7));
+                gddram[offset + 2] |= (0x06 << (yp & 7));
+                break;
+              case 6:
+                gddram[offset + 1] |= 0x80;
+                gddram[offset + 2] |= 0x80;
+                if (yp < 56)
+                {
+                  gddram[offset + 128 + 1] |= 0x01;
+                  gddram[offset + 128 + 2] |= 0x01;
+                }
+                break;
+              case 7:
+                if (yp < 56) {
+                  gddram[offset + 128 + 1] |= 0x03;
+                  gddram[offset + 128 + 2] |= 0x03;
+                }
+                break;
+            }
+          }
+        }
+      }
+    }
+  }
+}
+
+/*==========================================================================*\
+ * move_ghosts                                                              *
+\*==========================================================================*/
+static void move_ghosts(void)
+{
+  enum Direction { LEFT, RIGHT, UP, DOWN };
+  int checkxdir[4] = { -1,1,0,0 };
+  int checkydir[4] = { 0,0,-1,1 };
+
+  int i;
+
+  for (i = 0; i < 4; i++)
+  {
+    if (ghosts[i].mode == GM_EATEN)
+    {
+      ghosts[i].offset.x = ghosts[i].offset.y = 0;
+      ghosts[i].position.x += ghosts[i].direction.x;
+      ghosts[i].position.y += ghosts[i].direction.y;
+    } else
+    {
+      if (ghosts[i].mode == GM_FRIGHTENED)
+      { // pause every 4 moves
+        if (ghosts[i].stopped == 4)
+        {
+          ghosts[i].stopped = 0;
+          continue;
+        } else ghosts[i].stopped++;
+      }
+      ghosts[i].offset.x += ghosts[i].direction.x;
+      ghosts[i].offset.y += ghosts[i].direction.y;
+    }
+
+    if (ghosts[i].offset.x >= 4 || ghosts[i].offset.x <= -4) {
+      ghosts[i].offset.x = 0;
+      ghosts[i].position.x += ghosts[i].direction.x;
+    }
+    if (ghosts[i].offset.y >= 4 || ghosts[i].offset.y <= -4) {
+      ghosts[i].offset.y = 0;
+      ghosts[i].position.y += ghosts[i].direction.y;
+    }
+
+    if (ghosts[i].offset.y == 0 && ghosts[i].offset.x == 0)
+    {
+      int u, a = 9999, b = -1;
+
+      for (u = 0; u < 4; u++)
+      {
+        int forbidden = walls_mask[ghosts[i].position.y+checkydir[u]] >> (ghosts[i].position.x+checkxdir[u]) & 1;
+        // U turns are forbidden by game rules
+        if (ghosts[i].direction.x == -checkxdir[u] &&
+            ghosts[i].direction.y == -checkydir[u])
+          forbidden = 1;
+        // Ghosts are not allowed reenter the pen (unless eaten)
+        if (u == 3 &&
+            (ghosts[i].position.x == 15 || ghosts[i].position.x == 16) &&
+            ghosts[i].position.y == 11 &&
+            ghosts[i].mode != GM_EATEN)
+          forbidden = 1;
+        // compute (squared) distance to target
+        int dx = ghosts[i].position.x + checkxdir[u];
+        dx = ghosts[i].target.x - dx;
+        int dy = ghosts[i].position.y + checkydir[u];
+        dy = ghosts[i].target.y - dy;
+        int distance = dx * dx + dy * dy;
+        // Store the minimal distance
+        if (!forbidden && distance <= a)
+        {
+          a = distance;
+          b = u;
+        }
+      }
+      ghosts[i].direction.x = checkxdir[b];
+      ghosts[i].direction.y = checkydir[b];
+    }
+    // Resurect!
+    if (ghosts[i].position.x == 15 && ghosts[i].position.y == 13)
+      ghosts[i].mode = GM_IN_PEN;
+    // out of pen
+    if (ghosts[i].mode == GM_IN_PEN && ghosts[i].position.y == 11)
+      ghosts[i].mode = GM_CORNERS;
+    // handle tunnel for ghosts
+    if (ghosts[i].position.x == 0 && ghosts[i].direction.x == -1)
+      ghosts[i].position.x = 31;
+    if (ghosts[i].position.x == 31 && ghosts[i].direction.x == 1)
+      ghosts[i].position.x = 0;
+  }
+}
+
+/*==========================================================================*\
+ * draw_ghosts                                                              *
+\*==========================================================================*/
+static void draw_ghosts(void)
+{
+  int i;
+  for (i = 0; i < 4; i++)
+  {
+    enum FontEntries ghost_sprite = F_DIGIT_0;
+    switch (ghosts[i].mode)
+    {
+      case GM_EATEN:
+        ghost_sprite = F_GHOST_EYES;
+        break;
+      case GM_FRIGHTENED:
+        ghost_sprite = F_GHOST_FRIGHTENED;
+        break;
+      case GM_CORNERS:
+      case GM_CHASE:
+      case GM_IN_PEN:
+        if (ghosts[i].direction.x == -1) ghost_sprite = F_GHOST_LEFT;
+        if (ghosts[i].direction.x == 1) ghost_sprite = F_GHOST_RIGHT;
+        if (ghosts[i].direction.y == -1) ghost_sprite = F_GHOST_UP;
+        if (ghosts[i].direction.y == 1) ghost_sprite = F_GHOST_DOWN;
+        break;
+      case GM_WAITING:
+        ghost_sprite = F_GHOST_STILL;
+        break;
+
+    }
+    draw_sprite8x8_with_mask(ghosts[i].position.x * 4 + ghosts[i].offset.x - 1,
+                             ghosts[i].position.y * 4 + ghosts[i].offset.y - 1 - screen_offset,
+                             &font[ghost_sprite * 8],
+                             &font[F_GHOST_MASK * 8]);
+  }
+}
+
+/*==========================================================================*\
+ * move_pacman                                                              *
+\*==========================================================================*/
+static void move_pacman(void)
+{
+  if (pacman.direction.x || pacman.direction.y)
+  {
+    // animation
+    if (current_frame & 1)
+      pacman.anim = (pacman.anim + 1) & 3;
+    if (pacman.direction.x == -1) pacman.shape = F_PACMAN_LEFT_0;
+    if (pacman.direction.x ==  1) pacman.shape = F_PACMAN_RIGHT_0;
+    if (pacman.direction.y == -1) pacman.shape = F_PACMAN_UP_0;
+    if (pacman.direction.y ==  1) pacman.shape = F_PACMAN_DOWN_0;
+    
+    // sub steps moves
+    pacman.sub_step.x += pacman.direction.x;
+    pacman.sub_step.y += pacman.direction.y;
+  }
+  if (pacman.sub_step.x >= 4 || pacman.sub_step.x <= -4)
+  {
+    pacman.sub_step.x = 0;
+    pacman.position.x += pacman.direction.x;
+  }
+  if (pacman.sub_step.y >= 4 || pacman.sub_step.y <= -4)
+  {
+    pacman.sub_step.y = 0;
+    pacman.position.y += pacman.direction.y;
+  }
+  // if in full tile
+  if (pacman.sub_step.x == 0 && pacman.sub_step.y == 0)
+  {
+    int x = pacman.position.x, y = pacman.position.y;
+    if (current_pills[y] >> x & 1) // hum, this should be 31-x (or not)
+    {
+      current_pills[y] -= 1 << x; // ditto
+      // remaining_dots--;
+      if ((x == 3 || x == 28) && (y == 3 || y == 23))
+      {
+        ghosts[GN_BLINKY].mode = GM_FRIGHTENED;
+        ghosts[GN_BLINKY].stopped = 0;
+        ghosts[GN_PINKY].mode = GM_FRIGHTENED;
+        ghosts[GN_PINKY].stopped = 0;
+        ghosts[GN_INKY].mode = GM_FRIGHTENED;
+        ghosts[GN_INKY].stopped = 0;
+        ghosts[GN_CLYDE].mode = GM_FRIGHTENED;
+        ghosts[GN_CLYDE].stopped = 0;
+        score_add_10(5); // energizers worth 50 points
+        ghost_score = 1;
+      }
+      else score_add_10(1); // normal pills are worth 10 points
+    }
+
+    // Where can we go next ?
+    x = pacman.position.x + pacman.next_dir.x;
+    y = pacman.position.y + pacman.next_dir.y;
+
+    if (!(walls_mask[y] >> x & 1))
+    {
+      pacman.direction.x = pacman.next_dir.x;
+      pacman.direction.y = pacman.next_dir.y;
+    }
+    x = pacman.position.x + pacman.direction.x;
+    y = pacman.position.y + pacman.direction.y;
+    if (walls_mask[y] >> x & 1)
+    {
+      pacman.direction.x = 0;
+      pacman.direction.y = 0;
+    }
+    // handle tunnel for pacman (ghosts are way slower in this)
+    if (pacman.position.x == 1 && pacman.direction.x == -1)
+      pacman.position.x = 30;
+    if (pacman.position.x == 30 && pacman.direction.x == 1)
+      pacman.position.x = 1;
+  }
+}
+
+/*==========================================================================*\
+ * draw_pacman                                                              *
+\*==========================================================================*/
+static void draw_pacman(void)
+{
+  draw_sprite8x8(pacman.position.x * 4 + pacman.sub_step.x - 2,
+                 pacman.position.y * 4 + pacman.sub_step.y - 2 - screen_offset,
+                 font + 8 * (pacman.shape + pacman.anim));
+}
+
+/*==========================================================================*\
+ * draw_walls                                                               *
+\*==========================================================================*/
+static void draw_walls(int screen_offset)
+{
+#include "image.h0"
+#include "image.h1"
+#include "image.h2"
+#include "image.h3"
+#include "image.h4"
+#include "image.h5"
+#include "image.h6"
+#include "image.h7"
+  const uint8_t *backgrounds[8] =
+  {
+    image0, image1, image2, image3, image4, image5, image6, image7
+  };
+  const uint16_t *offsets[8] =
+  {
+    image_offsets0, image_offsets1, image_offsets2, image_offsets3,
+    image_offsets4, image_offsets5, image_offsets6, image_offsets7
+  };
+  uncompress_image(backgrounds[screen_offset & 7] +
+                   offsets[screen_offset & 7][screen_offset >> 3],
+                   gddram + 4);
+}
+
+/*==========================================================================*\
+ * draw_sprite_16x16                                                        *
+\*==========================================================================*/
+static void draw_sprite_16x16(int x, int y, const uint8_t *sprite)
+{
+  int i, offset = 4 + 128 * y + x;
+  int start = 0;
+  int end = 16;
+  if (x < 0) start = -x;
+  if (x > 112) end = 128 - x;
+  for (i = start; i < end; i++)
+    gddram[offset + i] |= sprite[i];
+  for (i = start; i < end; i++)
+    gddram[offset + i + 128] |= sprite[i + 16];
+}
+
+/*==========================================================================*\
+ * draw_sprite_16x16_reverse                                                *
+\*==========================================================================*/
+static void draw_sprite_16x16_reverse(int x, int y, const uint8_t *sprite)
+{
+  int i, offset = 4 + 128 * y + x;
+  int start = 0;
+  int end = 16;
+  if (x < 0) start = -x;
+  if (x > 112) end = 128 - x;
+  for (i = start; i < end; i++)
+    gddram[offset + i] |= sprite[15 - i];
+  for (i = start; i < end; i++)
+    gddram[offset + i + 128] |= sprite[31 - i];
+}
+
+/*==========================================================================*\
+ * update_screen                                                            *
+\*==========================================================================*/
+static void update_screen(void)
+{
+#ifdef ALLOW_SCREENSHOT
+  if (take_screenshot)
+  {
+    send_screenshot();
+    //      take_screenshot = 0;
+  }
+#endif
+  ssd130x_display_full_screen(&display);
+}
+
+/*==========================================================================*\
+ * draw_sprite_16x16_with_mask                                              *
+\*==========================================================================*/
+static void draw_sprite_16x16_with_mask(int x, int y,
+                                        const uint8_t *sprite,
+                                        const uint8_t *mask)
+{
+  int i, offset = 4 + 128 * y + x;
+
+  for (i = 0; i < 16; i++)
+  {
+    gddram[offset + i] &= ~mask[i];
+    gddram[offset + i] |= sprite[i];
+  }
+  offset = 4 + 128 * (y + 1) + x;
+  for (i = 0; i < 16; i++)
+  {
+    gddram[offset + i] &= ~mask[16 + i];
+    gddram[offset + i] |= sprite[16 + i];
+  }
+}
+
+/*==========================================================================*\
+ * show_intermission2                                                       *
+\*==========================================================================*/
+static void show_intermission2(void)
+{
+  int frame = 0;
+  while (1)
+  {
+    ssd130x_buffer_set(gddram, 0xff);
+    int anim = (frame / 2) % 8;
+    switch (anim)
+    {
+      case 0: // 1
+        draw_sprite_16x16_with_mask(50, 4,
+                                    pacmania_se_01, pacmania_se_01_mask);
+        break;
+      case 1: case 7: // 2
+        draw_sprite_16x16_with_mask(50, 4,
+                                    pacmania_se_02, pacmania_se_02_mask);
+        break;
+      case 2: case 6: // 3
+        draw_sprite_16x16_with_mask(50, 4,
+                                    pacmania_se_03, pacmania_se_03_mask);
+        break;
+      case 3: case 4: // 4
+        draw_sprite_16x16_with_mask(50, 4,
+                                    pacmania_se_04, pacmania_se_04_mask);
+        break;
+      case 5:
+        draw_sprite_16x16_with_mask(50, 4,
+                                    pacmania_se_05, pacmania_se_05_mask);
+        break;
+    }
+    frame++;
+    //
+    update_screen();
+    //
+    if (button_right_pressed || button_left_pressed ||
+        button_up_pressed || button_down_pressed)
+      return;
+  }
+}
+
+/*==========================================================================*\
+ * show_intermission                                                        *
+\*==========================================================================*/
+static void show_intermission(void)
+{
+#include "intermission-background.h"
+  int frame = 0, stop = 0;
+  int pac_x = -10;
+  int ghost1 = pac_x - 26;
+  int ghost2 = ghost1 - 18;
+  int ghost3 = ghost2 - 18;
+  int ghost4 = ghost3 - 18;
+  int sequence = 0;
+  int ghost_eaten = 0;
+  while (1)
+  {
+    const uint8_t *ghost_sprite;
+    //const uint8_t *pacman_sprite;
+    uncompress_image(background_intermission, gddram + 4);
+
+    switch (sequence)
+    {
+      case 0: // pacman is chased by the ghost
+        ghost_sprite = frame & 2 ? big_ghost_0 : big_ghost_1;
+        switch ((frame / 2) & 3)
+        {
+          case 0: draw_sprite_16x16(pac_x, 4, big_pacman_0); break;
+          case 1: draw_sprite_16x16(pac_x, 4, big_pacman_1); break;
+          case 2: draw_sprite_16x16(pac_x, 4, big_pacman_2); break;
+          case 3: draw_sprite_16x16(pac_x, 4, big_pacman_1); break;
+        }
+        draw_sprite_16x16(ghost1, 4, ghost_sprite);
+        draw_sprite_16x16(ghost2, 4, ghost_sprite);
+        draw_sprite_16x16(ghost3, 4, ghost_sprite);
+        draw_sprite_16x16(ghost4, 4, ghost_sprite);
+        frame++;
+        if (frame & 15) pac_x++;
+        ghost1++;
+        ghost2 = ghost1 - 18;
+        ghost3 = ghost2 - 18;
+        ghost4 = ghost3 - 18;
+        if (pac_x == 256) {
+          sequence++;
+          frame = 0;
+          //pac_x = -10;
+          //ghost1 = pac_x - 26;
+        }
+        break;
+      case 1: // Pacman eats an energizer : screen is flashing
+        ssd130x_buffer_set(gddram, 0xFF);
+        frame++;
+        if (frame == 3) {
+          sequence++;
+          frame = 0;
+          ghost1 = 130;
+          ghost2 = ghost1 + 18;
+          ghost3 = ghost2 + 18;
+          ghost4 = ghost3 + 18;
+          pac_x = ghost4 + 80;
+        }
+        break;
+      case 2: // The ghost are going back left, pacman eating them
+        ghost_sprite = frame & 2 ? big_frightened_ghost_0 : big_frightened_ghost_1;
+        if (stop >= 0)
+        switch ((frame / 2) & 3)
+        {
+          case 0: draw_sprite_16x16_reverse(pac_x, 4, big_pacman_0); break;
+          case 1: draw_sprite_16x16_reverse(pac_x, 4, big_pacman_1); break;
+          case 2: draw_sprite_16x16_reverse(pac_x, 4, big_pacman_2); break;
+          case 3: draw_sprite_16x16_reverse(pac_x, 4, big_pacman_1); break;
+        }
+        draw_sprite_16x16(ghost1, 4, ghost_sprite);
+        draw_sprite_16x16(ghost2, 4, ghost_sprite);
+        draw_sprite_16x16(ghost3, 4, ghost_sprite);
+        draw_sprite_16x16(ghost4, 4, ghost_sprite);
+        if (stop >= 0)
+        {
+          frame++;
+          ghost1--;
+          ghost2--;
+          ghost3--;
+          ghost4--;
+          pac_x -= 2;
+        }
+        else
+        {
+          int i = 0;
+          switch (ghost_eaten)
+          {
+            case 1:
+              gddram[4 + 128 * 4 + pac_x + i++] = 0xf2;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x92;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x92;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x9e;
+              break;
+            case 2:
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x1e;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x10;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x10;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0xfe;
+              break;
+            case 3:
+              gddram[4 + 128 * 4 + pac_x + i++] = 0xfe;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x92;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x92;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0xfe;
+              break;
+            case 4:
+              gddram[4 + 128 * 4 + pac_x + i++] = 0xfe;
+              i++;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0xfe;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x92;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0x92;
+              gddram[4 + 128 * 4 + pac_x + i++] = 0xf2;
+              break;
+          }
+          i++;
+          gddram[4 + 128 * 4 + pac_x + i++] = 0xfe;
+          gddram[4 + 128 * 4 + pac_x + i++] = 0x82;
+          gddram[4 + 128 * 4 + pac_x + i++] = 0x82;
+          gddram[4 + 128 * 4 + pac_x + i++] = 0xfe;
+          i++;
+          gddram[4 + 128 * 4 + pac_x + i++] = 0xfe;
+          gddram[4 + 128 * 4 + pac_x + i++] = 0x82;
+          gddram[4 + 128 * 4 + pac_x + i++] = 0x82;
+          gddram[4 + 128 * 4 + pac_x + i++] = 0xfe;
+
+        }
+        stop ++;
+        if (pac_x - ghost4 < 6) { stop = -10; ghost4 = -100; ghost_eaten++; }
+        if (pac_x - ghost3 < 6) { stop = -10; ghost3 = -100; ghost_eaten++; }
+        if (pac_x - ghost2 < 6) { stop = -10; ghost2 = -100; ghost_eaten++; }
+        if (pac_x - ghost1 < 6) { stop = -10; ghost1 = -100; ghost_eaten++; }
+        if (pac_x < 0)
+        {
+          sequence = 0;
+          frame = 0; stop = 0;
+          pac_x = -64;
+          ghost1 = pac_x - 26;
+          ghost2 = ghost1 - 18;
+          ghost3 = ghost2 - 18;
+          ghost4 = ghost3 - 18;
+          ghost_eaten = 0;
+        }
+        break;
+    }
+    //
+    update_screen();
+    //
+    if (button_right_pressed || button_left_pressed ||
+        button_up_pressed || button_down_pressed)
+      return;
+  }
+}
+
+/****************************************************************************/
+int main(void)
+{
+       system_init();
+#ifdef ALLOW_SCREENSHOT
+       uart_on(UART0, 1152000, data_rx);
+#endif
+       ssp_master_on(SSP_BUS_0, LPC_SSP_FRAME_SPI, 8, 4*1000*1000);
+
+  set_gpio_callback(handle_buttons, &button_up, EDGES_BOTH);
+  set_gpio_callback(handle_buttons, &button_down, EDGES_BOTH);
+  set_gpio_callback(handle_buttons, &button_left, EDGES_BOTH);
+  set_gpio_callback(handle_buttons, &button_right, EDGES_BOTH);
+
+#ifdef ALLOW_SCREENSHOT
+  set_gpio_callback(set_screenshot, &button_ok, EDGE_FALLING);
+#endif
+
+       status_led(green_only);
+
+       /* Configure and start display */
+       ssd130x_display_on(&display);
+
+  show_intermission2();
+
+  memcpy(current_pills, all_pills, sizeof all_pills);
+
+       while (1) {
+    screen_offset = 4 * (pacman.position.y - 8) + pacman.sub_step.y;
+    if (screen_offset < 0) screen_offset = 0;
+    if (screen_offset > 64) screen_offset = 64;
+
+    draw_walls(screen_offset);
+    draw_pills();
+
+    if (button_up_pressed)
+    {
+      pacman.next_dir.x = 0;
+      pacman.next_dir.y = -1;
+    }
+    if (button_down_pressed)
+    {
+      pacman.next_dir.x = 0;
+      pacman.next_dir.y = 1;
+    }
+    if (button_left_pressed)
+    {
+      pacman.next_dir.x = -1;
+      pacman.next_dir.y = 0;
+    }
+    if (button_right_pressed)
+    {
+      pacman.next_dir.x = 1;
+      pacman.next_dir.y = 0;
+    }
+    move_ghosts();
+    draw_ghosts();
+    move_pacman();
+    draw_pacman();
+    draw_score();
+#ifdef ALLOW_SCREENSHOT
+    if (take_screenshot)
+    {
+      send_screenshot();
+//      take_screenshot = 0;
+    }
+#endif
+    ssd130x_display_full_screen(&display);
+//    msleep(100);
+
+    int i;
+    int px = pacman.position.x * 4 + pacman.sub_step.x;
+    int py = pacman.position.y * 4 + pacman.sub_step.y;
+    for (i = 0; i < 4; i++)
+    {
+      int gx = ghosts[i].position.x * 4 + ghosts[i].offset.y;
+      int gy = ghosts[i].position.y * 4 + ghosts[i].offset.y;
+      if (px <= gx + 2 && px >= gx - 2 &&
+          py <= gy + 2 && py >= gy - 2)
+      {
+        if (ghosts[i].mode == GM_FRIGHTENED)
+        {
+          int s;
+          for (s = 0; s < ghost_score; s++)
+            score_add_100(2);
+          ghost_score *= 2;
+          ghosts[i].mode = GM_EATEN;
+        }
+      }
+    }
+
+    for (i = 0; i < GN_NB_GHOSTS; i++)
+      switch (ghosts[i].mode)
+      {
+        case GM_EATEN:
+          ghosts[i].target.x = 15;
+          ghosts[i].target.y = 13;
+          break;
+        case GM_CORNERS: // FIXME! ugly
+          if (i == GN_BLINKY)
+          {
+            ghosts[0].target.x = 28; ghosts[0].target.y = -2;
+          }
+          else if (i == GN_PINKY)
+          {
+            ghosts[1].target.x = 5; ghosts[1].target.y = -2;
+          }
+          else if (i == GN_INKY)
+          {
+            ghosts[2].target.x = 0; ghosts[2].target.y = 31;
+          }
+          else
+          {
+            ghosts[3].target.x = 31; ghosts[3].target.y = 31;
+          }
+          break;
+        case GM_FRIGHTENED:
+          ghosts[i].target.x = my_rand() & 31;
+          ghosts[i].target.y = my_rand() & 31;
+          break;
+        case GM_CHASE:
+          break;
+        case GM_IN_PEN:
+          ghosts[i].target.x = 16;
+          ghosts[i].target.y = 11;
+          break;
+        case GM_WAITING:
+          break;
+      }
+    current_frame++;
+    
+    static unsigned tt; 
+    unsigned t = systick_get_tick_count();
+    static unsigned fps = 0;
+    ++fps;
+    if (t > tt) {
+//      uprintf(UART0, "%u ", fps);
+      fps = 0;
+      tt += 1000;
+    }
+       }
+       return 0;
+}
+
+
+
diff --git a/pacman/todo b/pacman/todo
new file mode 100644 (file)
index 0000000..0ba4cbc
--- /dev/null
@@ -0,0 +1,7 @@
+fruits (in game, and on the right)
+lives (on the right)
+
+levels
+4 ghost/strategy
+forbidden zones
+relative speeds