-
Notifications
You must be signed in to change notification settings - Fork 9
/
demon.c
89 lines (81 loc) · 11 KB
/
demon.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* ========================================
FileName: demon.c
Date: 15:40 05.September.2022
Author: Marcos Ivan Chow Castro @mctechnology17
Email: [email protected]
GitHub: https://github.com/mctechnology17
Brief: QMK oled animations demon
===========================================
Utilities for QMK oled animations
Copyright (c) Marek Piechut
MIT License
╔═╦═╦═╗
╔════╗ ║║║║║╔╝
║╔╗╔╗║ ║║║║║╚╗
╚╝║║╚╝ ║╠═╩╩═╝
║╠═╦═╣╚╦═╦╦═╦╗╔═╦═╦╦╗
║║╩╣═╣║║║║║╬║╚╣╬║╬║║║
╚╩═╩═╩╩╩╩═╩═╩═╩═╬╗╠╗║
╚═╩═╝
Copyright 2022 Marcos Ivan Chow Castro @mctechnology17
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/>.
*/
// NOTE: temporary fix
// #pragma once
//
// #define ANIM_SCROLL true
// #define ANIM_FRAME_WIDTH 32
// #define ANIM_SIZE 144
// NOTE: temporary fix
#include "quantum.h"
#include "print.h"
#include "oled_driver.h"
#include <stdio.h>
#include "demon.h"
#include "animation-utils.h"
// NOTE: comented because it is not working
// #include "animation-utils.c"
// NOTE: static delete because it is not working
void oled_render_anim(void) {
// 'big_demon_idle_anim_f0', 32x36px
static const char demon_idle_anim_f0[] PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xb0, 0xf0, 0xfa, 0xfe, 0xfe, 0xfc, 0xfc, 0xff, 0xff, 0xfe, 0xe7, 0xe6, 0xff, 0xfe, 0xe7, 0xfc, 0xf8, 0xf8, 0xfc, 0xc4, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x83, 0x87, 0x07, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff,
0xf3, 0xff, 0xfb, 0xff, 0xf3, 0xff, 0xfb, 0x8f, 0x07, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0x63, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x0f, 0x0f, 0x0f, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0f, 0x0f, 0x0f, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// 'big_demon_idle_anim_f1', 32x36px
static const char demon_idle_anim_f1[] PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x00, 0xc0, 0x20, 0x80, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xec, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xf3, 0xf3, 0xff, 0xff, 0xf3, 0xfe, 0xfe, 0xfe, 0xfe, 0x34, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x01, 0x01, 0x8f, 0x07, 0xff, 0x8f, 0xdf, 0xfe, 0xff,
0xfc, 0xff, 0xfe, 0xdf, 0x8c, 0xdf, 0x86, 0x03, 0x01, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xcd, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xf9, 0xff, 0xfb, 0xff, 0xfb, 0xff, 0xf9, 0xff, 0xfb, 0xfe, 0x67, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0f, 0x0f, 0x0f, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0f, 0x0f, 0x0f, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// 'big_demon_idle_anim_f2', 32x36px
static const char demon_idle_anim_f2[] PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0xc0, 0x80, 0xc0, 0xa0, 0x80, 0x80, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x72, 0x3b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0x39, 0xf9, 0xbf, 0xff, 0x39, 0xff, 0xbf, 0x7f, 0x1b, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x01, 0xdf, 0x87, 0x9f, 0xcf, 0xff,
0xff, 0xcf, 0x87, 0xcf, 0x07, 0xaf, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x9b, 0xfe, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xf3, 0xff, 0xf7, 0xff, 0xf7, 0xff, 0xf3, 0xfe, 0xf6, 0xfc, 0xcf, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// 'big_demon_idle_anim_f3', 32x36px
static const char demon_idle_anim_f3[] PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xfc, 0xfe, 0xf8, 0x1f, 0x18, 0xfc, 0xf8, 0x1e, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xe1, 0xff, 0xfe, 0xfc, 0xff, 0xff, 0xfe, 0xfe, 0xff, 0xff, 0xff,
0xfc, 0xfc, 0xff, 0xff, 0xfc, 0xff, 0xfc, 0xfe, 0xff, 0xf0, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x64, 0xfd, 0xfb, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xfd, 0xe7, 0xf9, 0xef, 0xfd, 0xef, 0xf9, 0xe7, 0xfd, 0xef, 0xff, 0xf3, 0xe0, 0x60, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x03, 0x01, 0x00, 0x00, 0x00};
// 'big_demon_run_anim_f0', 32x36px
static const char demon_run_anim_f0[] PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, 0xb0, 0xf0, 0xfa, 0xfe, 0xfe, 0xfc, 0xfc, 0xff, 0xff, 0xfe, 0xe7, 0xe6, 0xff, 0xfe, 0xe7, 0xfc, 0xf8, 0xf8, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xe3, 0xe7, 0xc7, 0xef, 0xff, 0xff, 0xff, 0x7f, 0xfb, 0x3f,
0xf3, 0x7f, 0xfb, 0x7f, 0xf3, 0x3f, 0xfb, 0x6f, 0xc7, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x63, 0x31, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// 'big_demon_run_anim_f1', 32x36px
static const char demon_run_anim_f1[] PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, 0xf0, 0xc0, 0xf0, 0xc8, 0xe0, 0xc0, 0xe0, 0x90, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0xc6, 0x77, 0x7f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0x3c, 0xfc, 0xbf, 0xff, 0x3c, 0xff, 0xbf, 0xff, 0x7f, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x48, 0x68, 0xf8, 0xf0, 0xfd, 0xf8, 0xfd, 0xff, 0xdf, 0xff, 0xcf,
0xff, 0xdf, 0xff, 0xdf, 0xff, 0xcd, 0xfb, 0xd8, 0xf0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xfc, 0xff, 0xff, 0x7f, 0x3f, 0x3f, 0x3f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x3f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// 'big_demon_run_anim_f2', 32x36px
static const char demon_run_anim_f2[] PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x60, 0xe8, 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xf8, 0xf0, 0x38, 0x34, 0xf0, 0xf0, 0x30, 0xe8, 0xf0, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x0f, 0xff, 0x3f, 0xff, 0x7f, 0xff, 0xf7, 0xff, 0xe7, 0xff, 0xf7, 0xff, 0xe7, 0xff, 0xf7, 0x1f, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0xc0, 0x80, 0xf5, 0xc0, 0xff, 0xc0, 0xe1, 0xe3, 0xf7,
0xff, 0xf7, 0xe3, 0xe1, 0xf3, 0xc0, 0xf9, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xc6, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0xfd, 0xff, 0xfc, 0xff, 0xfd, 0xff, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// 'big_demon_run_anim_f3', 32x36px
static const char demon_run_anim_f3[] PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x80, 0x00, 0x00, 0xb0, 0xe0, 0xc0, 0x80, 0x80, 0xfc, 0xfe, 0xf8, 0x1f, 0x18, 0xfc, 0xf8, 0x1e, 0xf0, 0x00, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x33, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff,
0x7c, 0xfc, 0x7f, 0xff, 0x7c, 0xff, 0x7f, 0xff, 0xff, 0x7e, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1b, 0xfe, 0xfe, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xf3, 0xfe, 0xf7, 0xff, 0xf7, 0xfe, 0xf3, 0xff, 0xf7, 0xfc, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00};
static const char* FAST_TYPE_FRAMES[] = {
demon_run_anim_f0,
demon_run_anim_f1,
demon_run_anim_f2,
demon_run_anim_f3,
};
static const char* SLOW_TYPE_FRAMES[] = {demon_idle_anim_f0, demon_idle_anim_f1, demon_idle_anim_f2, demon_idle_anim_f3};
oled_render_anim_frame(FAST_TYPE_FRAMES, SLOW_TYPE_FRAMES, 4);
}