Skip to content

Commit

Permalink
Add Evil Knievel
Browse files Browse the repository at this point in the history
  • Loading branch information
jmamma committed Dec 2, 2019
1 parent 2886728 commit 0722986
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
49 changes: 45 additions & 4 deletions avr/cores/megacommand/MCL/MCLGfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,47 @@ const unsigned char mcl_logo_bitmap[] PROGMEM = {
0x00, 0x1f, 0xf3, 0xff, 0xf3, 0xfe, 0x7e, 0x00, 0x00, 0x1f, 0xf3, 0xff,
0xf3, 0xfe, 0x7c, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0xf3, 0xfe, 0x78, 0x00,
0x00, 0x1f, 0xf3, 0xff, 0xf3, 0xfe, 0x70, 0x00};

// 'evilknievel', 45x32px
const unsigned char evilknievel_bitmap[] PROGMEM = {
0x00, 0x7f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7f, 0xff, 0xd5, 0xff, 0x00,
0x00, 0x6f, 0xe8, 0x2a, 0xff, 0x80, 0x00, 0x77, 0x80, 0x05, 0x7f, 0x80,
0x00, 0x62, 0x00, 0x02, 0xff, 0x80, 0x00, 0x70, 0x00, 0x05, 0x7f, 0x00,
0x00, 0x60, 0x00, 0x02, 0xbf, 0x00, 0x00, 0x20, 0x00, 0x01, 0x7f, 0x00,
0x00, 0x60, 0x00, 0x02, 0xff, 0x00, 0x00, 0x28, 0x00, 0x01, 0x7f, 0x00,
0x00, 0x3f, 0x87, 0xf2, 0xfe, 0x00, 0x00, 0x7f, 0xd7, 0xfd, 0x7e, 0x00,
0x00, 0x7f, 0xef, 0xfe, 0xfe, 0x00, 0x00, 0x7f, 0xc7, 0xff, 0xfc, 0x00,
0x00, 0x7f, 0xc7, 0xfe, 0xec, 0x00, 0x00, 0x3f, 0xc3, 0xfd, 0xd4, 0x00,
0x00, 0x1e, 0x80, 0xfa, 0xec, 0x00, 0x00, 0x15, 0x00, 0x05, 0x54, 0x00,
0x00, 0x1a, 0x80, 0x02, 0xa8, 0x00, 0x00, 0x1d, 0xc0, 0x05, 0x78, 0x00,
0x00, 0x0a, 0xe2, 0x0a, 0xfc, 0x00, 0x00, 0x1d, 0x00, 0x05, 0x5c, 0x00,
0x00, 0x0b, 0xc0, 0x0a, 0xbe, 0x00, 0x00, 0x3d, 0xc0, 0x15, 0x5f, 0x80,
0x07, 0xfe, 0xe8, 0x0a, 0xbf, 0xf0, 0x1f, 0xff, 0xd0, 0x17, 0x5f, 0xf8,
0x3f, 0xff, 0xe8, 0x0f, 0xbf, 0xf8, 0x3f, 0xff, 0x00, 0x1f, 0x7f, 0xf8,
0x7f, 0xff, 0x80, 0x3e, 0xbf, 0xf8, 0x7f, 0xff, 0xc0, 0x7d, 0x7f, 0xf8,
0xff, 0xff, 0xfa, 0xfa, 0xff, 0xf8, 0xff, 0xff, 0x7f, 0xf5, 0x7f, 0xf8};
// oled_display.drawBitmap(128-45, 0, evilknievel_bitmap, 45, 32);

#endif
void MCLGfx::draw_evil() {
#ifdef OLED_DISPLAY
auto oldfont = oled_display.getFont();
oled_display.setFont(&TomThumb);
for (int8_t x = -45; x < 128 - 45; x += 2) {
oled_display.fillScreen(WHITE);
oled_display.setCursor(x - 60, 10);
oled_display.setTextColor(BLACK, WHITE);
oled_display.println("THIS PIECE OF");
oled_display.setCursor(x - 60, 20);
oled_display.println("MACHINE IS O.K.");

oled_display.drawBitmap(x, 0, evilknievel_bitmap, 45, 32, BLACK);
oled_display.display();
}
delay(1800);
oled_display.setFont(oldfont);
#endif
}

void MCLGfx::splashscreen() {
#ifdef OLED_DISPLAY
Expand Down Expand Up @@ -70,9 +110,10 @@ void MCLGfx::splashscreen() {
delay(750);

for (uint8_t a = 0; a < 32; a++) {
oled_display.drawLine(35, a, BITMAP_MCL_LOGO_W + 35 + 30, a, BLACK);
oled_display.drawLine(35, 32 - a, BITMAP_MCL_LOGO_W + 35 + 30, 32 - a, BLACK);
oled_display.display();
oled_display.drawLine(35, a, BITMAP_MCL_LOGO_W + 35 + 30, a, BLACK);
oled_display.drawLine(35, 32 - a, BITMAP_MCL_LOGO_W + 35 + 30, 32 - a,
BLACK);
oled_display.display();
}

#else
Expand All @@ -82,7 +123,7 @@ void MCLGfx::splashscreen() {
char str2[17] = VERSION_STR;
str1[16] = '\0';
display_text(&str1[0], &str2[0]);
delay(200);
delay(400);
#endif
// while (rec_global == 0) {

Expand Down
2 changes: 1 addition & 1 deletion avr/cores/megacommand/MCL/MCLGfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

class MCLGfx {
public:
void draw_evil();
void splashscreen();
void init_oled();
void display_text(const char *str1, const char *str2);
void alert(const char *str1, const char *str2);

};

extern MCLGfx gfx;

#endif /* MCLGFX_H__ */
4 changes: 4 additions & 0 deletions avr/cores/megacommand/MCL/MCLSd.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "MCL.h"
#include "MCLSd.h"
#include "MCLGfx.h"
/*
Function for initialising the SD Card
*/
Expand Down Expand Up @@ -46,6 +47,9 @@ bool MCLSd::load_init() {
DEBUG_PRINTLN("Could not init cfg");
return false;
}
#ifdef OLED_DISPLAY
gfx.draw_evil();
#endif
proj.new_project();
return true;

Expand Down

0 comments on commit 0722986

Please sign in to comment.