...
 
Commits (2)
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "bitmaps/neko/include.h"
#include "bitmasks/neko/include.h"
#include "bitmaps/sakura/include.h"
#include "bitmasks/sakura/include.h"
Adafruit_SSD1306 oled(128, 64, &Wire);
......@@ -75,8 +76,7 @@ typedef struct {
} chara_t;
static const chara_t characters[] = { //putting this in progmem breaks everything atm
{"neko", 13, 6,
{
{ "neko", 13, 6, {
{mati2_bits, mati2_mask_bits},
{jare2_bits, jare2_mask_bits},
{kaki1_bits, kaki1_mask_bits},
......@@ -101,15 +101,62 @@ static const chara_t characters[] = { //putting this in progmem breaks everythin
{dwleft2_bits, dwleft2_mask_bits},
{dwright1_bits, dwright1_mask_bits},
{dwright2_bits, dwright2_mask_bits},
{utogi1_bits, utogi1_mask_bits},
/*{utogi1_bits, utogi1_mask_bits},
{utogi2_bits, utogi2_mask_bits},
{dtogi1_bits, dtogi1_mask_bits},
{dtogi2_bits, dtogi2_mask_bits},
{ltogi1_bits, ltogi1_mask_bits},
{ltogi2_bits, ltogi2_mask_bits},
{ltogi2_bits, ltogi2_mask_bits},*/
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{rtogi1_bits, rtogi1_mask_bits},
{rtogi2_bits, rtogi2_mask_bits},
}
},
{ "sakura", 13, 6, {
{mati2_sakura_bits, mati2_sakura_mask_bits},
{jare2_sakura_bits, jare2_sakura_mask_bits},
{kaki1_sakura_bits, kaki1_sakura_mask_bits},
{kaki2_sakura_bits, kaki2_sakura_mask_bits},
{mati3_sakura_bits, mati3_sakura_mask_bits},
{sleep1_sakura_bits, sleep1_sakura_mask_bits},
{sleep2_sakura_bits, sleep2_sakura_mask_bits},
{awake_sakura_bits, awake_sakura_mask_bits},
{up1_sakura_bits, up1_sakura_mask_bits},
{up2_sakura_bits, up2_sakura_mask_bits},
{down1_sakura_bits, down1_sakura_mask_bits},
{down2_sakura_bits, down2_sakura_mask_bits},
{left1_sakura_bits, left1_sakura_mask_bits},
{left2_sakura_bits, left2_sakura_mask_bits},
{right1_sakura_bits, right1_sakura_mask_bits},
{right2_sakura_bits, right2_sakura_mask_bits},
{upleft1_sakura_bits, upleft1_sakura_mask_bits},
{upleft2_sakura_bits, upleft2_sakura_mask_bits},
{upright1_sakura_bits, upright1_sakura_mask_bits},
{upright2_sakura_bits, upright2_sakura_mask_bits},
{dwleft1_sakura_bits, dwleft1_sakura_mask_bits},
{dwleft2_sakura_bits, dwleft2_sakura_mask_bits},
{dwright1_sakura_bits, dwright1_sakura_mask_bits},
{dwright2_sakura_bits, dwright2_sakura_mask_bits},
/*{utogi1_sakura_bits, utogi1_sakura_mask_bits},
{utogi2_sakura_bits, utogi2_sakura_mask_bits},
{dtogi1_sakura_bits, dtogi1_sakura_mask_bits},
{dtogi2_sakura_bits, dtogi2_sakura_mask_bits},
{ltogi1_sakura_bits, ltogi1_sakura_mask_bits},
{ltogi2_sakura_bits, ltogi2_sakura_mask_bits},*/
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{NULL, NULL},
{rtogi1_sakura_bits, rtogi1_sakura_mask_bits},
{rtogi2_sakura_bits, rtogi2_sakura_mask_bits},
}
}
};
......@@ -142,8 +189,6 @@ void draw_xbm(int16_t x, int16_t y, uint8_t w, uint8_t h, const uint8_t *xbm, co
}
void setup() {
Serial.begin(115200);
while (!Serial);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3c);
draw_bg();
oled.display();
......@@ -180,9 +225,9 @@ void run_frame() {
}
break;
case STATE_INTROANIM_3:
chara_x -= characters[chara].speed;
chara_pic = left1 + (chara_seq++%2);
draw_chara();
chara_x -= characters[chara].speed;
if (chara_x < 63-16) {
chara_x = 63-16;
chara_y = (64-32)+3;
......