Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Commit

Permalink
Bouncing graphic now has a background.
Browse files Browse the repository at this point in the history
Bump version.
  • Loading branch information
thejpster committed Oct 13, 2018
1 parent f2e416b commit 4f89257
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "monotron"
version = "0.5.0"
version = "0.6.0"
authors = ["Jorge Aparicio <[email protected]>", "Jonathan 'theJPster' Pallant <[email protected]>"]
description = "A simple 1980's home computer style application for the Tiva-C Launchpad."
keywords = ["arm", "cortex-m", "template", "video", "menu"]
Expand All @@ -18,7 +18,7 @@ bench = false
lto = true
debug = true
codegen-units = 1
opt-level = "z"
opt-level = "s"

[dependencies.tm4c123x-hal]
version = "0.5.0"
Expand All @@ -31,8 +31,8 @@ version = "0.2.1"
# path = "../menu"

[dependencies.vga-framebuffer]
# version = "0.7.0"
git = "https://github.com/thejpster/vga-framebuffer-rs"
version = "0.7.2"
# git = "https://github.com/thejpster/vga-framebuffer-rs"
# path = "../vga-framebuffer-rs"
features = ["const_fn"]

Expand Down
22 changes: 14 additions & 8 deletions src/demos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::fb::{self, BaseConsole};
static FERRIS_TELETEXT_DATA: [u8; 1000] = *include_bytes!("ferris.dat");
static WEATHER_TELETEXT_DATA: [u8; 1000] = *include_bytes!("weather.dat");

pub(crate) const DEMO_MENU: ui::Menu = ui::Menu {
pub(crate) static DEMO_MENU: ui::Menu = ui::Menu {
label: "demo",
items: &[
&TEST_ALPHABET,
Expand All @@ -18,25 +18,25 @@ pub(crate) const DEMO_MENU: ui::Menu = ui::Menu {
exit: Some(|_menu, ctx| writeln!(ctx, "Thanks for trying some demos!").unwrap()),
};

const TEST_ALPHABET: ui::Item = ui::Item {
static TEST_ALPHABET: ui::Item = ui::Item {
item_type: menu::ItemType::Callback(test_alphabet),
command: "alphabet",
help: Some("Scrolls some test text output."),
};

const TEST_TELETEXT: ui::Item = ui::Item {
static TEST_TELETEXT: ui::Item = ui::Item {
item_type: menu::ItemType::Callback(test_teletext),
command: "teletext",
help: Some("Scrolls some test text output in the teletext font."),
};

const TEST_ANIMATION: ui::Item = ui::Item {
static TEST_ANIMATION: ui::Item = ui::Item {
item_type: menu::ItemType::Callback(test_animation),
command: "animate",
help: Some("Bounces argument around."),
};

const TEST_ART: ui::Item = ui::Item {
static TEST_ART: ui::Item = ui::Item {
item_type: menu::ItemType::Callback(test_art),
command: "art",
help: Some("Show some art."),
Expand Down Expand Up @@ -327,8 +327,14 @@ fn paint(context: &mut Context) {
fn bitmap_test(context: &mut Context) {
let mode2_buffer = unsafe { &mut super::APPLICATION_RAM[0..384 * 288 / 8] };

unsafe {
FRAMEBUFFER.clear();
// Set up a checkerboard background
let bg_chars = ['r', 'g', 'b', 'c', 'm', 'y', 'w'];
let mut bg_wheel = bg_chars.iter().cycle();
// Set all squares to black on white
write!(context, "\u{001B}K\u{001B}w\u{001B}Z");
// Paint a checkerboard with background colours
for _ in 0..((48*36)-1) {
write!(context, "\u{001B}{} ", bg_wheel.next().unwrap()).unwrap();
}

for (src, dest) in rust_logo::RUST_LOGO_DATA
Expand Down Expand Up @@ -381,7 +387,7 @@ fn bitmap_test(context: &mut Context) {
}

fn flame_demo(context: &mut Context) {
write!(context, "\u{001b}Z\u{001b}W\u{001b}k╔══════════════════════════════════════════════╗").unwrap();
write!(context, "\u{001b}W\u{001b}k\u{001b}Z╔══════════════════════════════════════════════╗").unwrap();
write!(context, "║\u{001b}R█████\u{001b}K \u{001b}R\u{001b}y█████\u{001b}K\u{001b}k \u{001b}Y██ █\u{001b}K \u{001b}G█████\u{001b}K \u{001b}G\u{001b}y█\u{001b}k█\u{001b}y█\u{001b}k██\u{001b}K \u{001b}B████\u{001b}K \u{001b}B█████\u{001b}K \u{001b}M██ █\u{001b}W║").unwrap();
write!(context, "║\u{001b}R▓\u{001b}K \u{001b}R▓\u{001b}K \u{001b}R▓\u{001b}K \u{001b}R\u{001b}y▓\u{001b}K\u{001b}k \u{001b}R\u{001b}y▓\u{001b}K\u{001b}k \u{001b}Y▓\u{001b}K \u{001b}Y▓ ▓\u{001b}K \u{001b}G▓\u{001b}K \u{001b}G▓\u{001b}K \u{001b}G \u{001b}K \u{001b}G\u{001b}y▓\u{001b}K\u{001b}k \u{001b}G \u{001b}K \u{001b}B\u{001b}g▓\u{001b}K\u{001b}k \u{001b}B\u{001b}g▓\u{001b}K\u{001b}k \u{001b}B▓\u{001b}K \u{001b}B▓\u{001b}K \u{001b}M▓\u{001b}K \u{001b}M▓ ▓\u{001b}W║").unwrap();
write!(context, "║\u{001b}R▒\u{001b}K \u{001b}R▒\u{001b}K \u{001b}R▒\u{001b}K \u{001b}R\u{001b}y▒\u{001b}K\u{001b}k \u{001b}R\u{001b}y▒\u{001b}K\u{001b}k \u{001b}Y▒\u{001b}K \u{001b}Y▒▒\u{001b}K \u{001b}G▒\u{001b}K \u{001b}G▒\u{001b}K \u{001b}G \u{001b}K \u{001b}G\u{001b}y▒\u{001b}K\u{001b}k \u{001b}G \u{001b}K \u{001b}B\u{001b}g▒\u{001b}K\u{001b}k \u{001b}B\u{001b}g▒\u{001b}k \u{001b}K \u{001b}B▒\u{001b}K \u{001b}B▒\u{001b}K \u{001b}M▒\u{001b}K \u{001b}M ▒▒\u{001b}W║").unwrap();
Expand Down

0 comments on commit 4f89257

Please sign in to comment.