Skip to content

Commit d87142d

Browse files
committed
Updated video colours from common 0.10.0.
I found out the constants I'd defined didn't match the VGA standard. So I updated common with revised constants, and changed the palette in Pico BIOS to match.
1 parent 3efd927 commit d87142d

File tree

6 files changed

+67
-62
lines changed

6 files changed

+67
-62
lines changed

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Unreleased Changes ([Source](https://github.com/neotron-compute/neotron-pico-bios/tree/develop) | [Changes](https://github.com/neotron-compute/neotron-pico-bios/compare/v0.5.1...develop))
44

5-
* Update to neotron-common-bios 0.9.0
5+
* Updated to neotron-common-bios 0.10.0, and changed the VGA palette to match
66
* Use published neotron-bmc-protocol and neotron-bmc-commands crates
77
* Clarify how BMC speaker works
88
* Add ANSI art boot-up logo
@@ -11,6 +11,8 @@
1111
* Update to OS 0.4.0
1212
* Re-arrange BIOS memory and stack for Core 1
1313
* Re-wrote the video render system to be more robust
14+
* Added a cursor
15+
* Added ANSI decoding support (for basic colours)
1416

1517
## v0.5.1 ([Source](https://github.com/neotron-compute/neotron-pico-bios/tree/v0.5.1) | [Release](https://github.com/neotron-compute/neotron-pico-bios/release/tag/v0.5.1))
1618

@@ -31,15 +33,15 @@
3133
* Implement new kind of Mutex
3234
* Updated to OS 0.3.2
3335
* Supports initialising SD Cards and reporting card size
34-
36+
3537
## v0.4.1 ([Source](https://github.com/neotron-compute/neotron-pico-bios/tree/v0.4.1) | [Release](https://github.com/neotron-compute/neotron-pico-bios/release/tag/v0.4.1))
3638

3739
* Wait for interrupts from the BMC before reading PS/2 key codes
38-
* Requires Neotron Pico BMC v0.5.0
40+
* Requires Neotron Pico BMC v0.5.0
3941
* Debug LEDs change every time you get an interrupt from the IO controller
4042
* Doubled the speed of the RP2040's QSPI flash interface
4143
* Documentation updates to make programming your RP2040 easier
42-
44+
4345
## v0.4.0 ([Source](https://github.com/neotron-compute/neotron-pico-bios/tree/v0.4.0) | [Release](https://github.com/neotron-compute/neotron-pico-bios/release/tag/v0.4.0))
4446

4547
* Updated dependencies

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rp-pico = { version = "0.7", default-features = false, features = [
1919
# Cortex-M run-time (or start-up) code
2020
cortex-m-rt = "0.7"
2121
# The BIOS to OS API
22-
neotron-common-bios = "0.9.0"
22+
neotron-common-bios = "0.10"
2323
# For the RP2040 bootloader
2424
rp2040-boot2 = "0.3.0"
2525
# For hardware abstraction traits
@@ -60,7 +60,7 @@ embedded-sdmmc = { version = "0.5", default-features = false, features = [
6060
] }
6161

6262
[build-dependencies]
63-
neotron-common-bios = "0.9.0"
63+
neotron-common-bios = "0.10"
6464
vte = "0.11"
6565

6666
[[bin]]

build.rs

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct NeotronOutput {
7979

8080
impl NeotronOutput {
8181
const DEFAULT_ATTR: Attr = Attr::new(
82-
TextForegroundColour::GREY,
82+
TextForegroundColour::LIGHT_GRAY,
8383
TextBackgroundColour::BLACK,
8484
false,
8585
);
@@ -127,24 +127,24 @@ impl vte::Perform for NeotronOutput {
127127
self.attr.set_bg(TextBackgroundColour::BLACK);
128128
}
129129
41 => {
130-
self.attr.set_bg(TextBackgroundColour::DARK_RED);
130+
self.attr.set_bg(TextBackgroundColour::RED);
131131
}
132132
42 => {
133-
self.attr.set_bg(TextBackgroundColour::DARK_GREEN);
133+
self.attr.set_bg(TextBackgroundColour::GREEN);
134134
}
135135
43 => {
136-
self.attr.set_bg(TextBackgroundColour::YELLOW);
136+
self.attr.set_bg(TextBackgroundColour::BROWN);
137137
}
138138
44 => {
139139
self.attr.set_bg(TextBackgroundColour::BLUE);
140140
}
141141
45 => {
142-
self.attr.set_bg(TextBackgroundColour::DARK_MAGENTA);
142+
self.attr.set_bg(TextBackgroundColour::MAGENTA);
143143
}
144144
46 => {
145-
self.attr.set_bg(TextBackgroundColour::DARK_CYAN);
145+
self.attr.set_bg(TextBackgroundColour::CYAN);
146146
}
147-
49 => {
147+
47 | 49 => {
148148
// Default
149149
self.attr.set_bg(TextBackgroundColour::BLACK);
150150
}
@@ -153,10 +153,10 @@ impl vte::Perform for NeotronOutput {
153153
self.attr.set_fg(TextForegroundColour::BLACK);
154154
}
155155
31 => {
156-
self.attr.set_fg(TextForegroundColour::DARK_RED);
156+
self.attr.set_fg(TextForegroundColour::RED);
157157
}
158158
32 => {
159-
self.attr.set_fg(TextForegroundColour::DARK_GREEN);
159+
self.attr.set_fg(TextForegroundColour::GREEN);
160160
}
161161
33 => {
162162
self.attr.set_fg(TextForegroundColour::YELLOW);
@@ -165,13 +165,13 @@ impl vte::Perform for NeotronOutput {
165165
self.attr.set_fg(TextForegroundColour::BLUE);
166166
}
167167
35 => {
168-
self.attr.set_fg(TextForegroundColour::DARK_MAGENTA);
168+
self.attr.set_fg(TextForegroundColour::MAGENTA);
169169
}
170170
36 => {
171-
self.attr.set_fg(TextForegroundColour::DARK_CYAN);
171+
self.attr.set_fg(TextForegroundColour::CYAN);
172172
}
173-
37 => {
174-
self.attr.set_fg(TextForegroundColour::GREY);
173+
37 | 39 => {
174+
self.attr.set_fg(TextForegroundColour::LIGHT_GRAY);
175175
}
176176
0 => {
177177
self.attr = Self::DEFAULT_ATTR;
@@ -184,25 +184,28 @@ impl vte::Perform for NeotronOutput {
184184
}
185185
if self.bright {
186186
match self.attr.fg() {
187-
TextForegroundColour::DARK_RED => {
188-
self.attr.set_fg(TextForegroundColour::BRIGHT_RED);
187+
TextForegroundColour::BLACK => {
188+
self.attr.set_fg(TextForegroundColour::DARK_GRAY);
189189
}
190-
TextForegroundColour::DARK_GREEN => {
191-
self.attr.set_fg(TextForegroundColour::BRIGHT_GREEN);
190+
TextForegroundColour::RED => {
191+
self.attr.set_fg(TextForegroundColour::LIGHT_RED);
192192
}
193-
TextForegroundColour::YELLOW => {
194-
self.attr.set_fg(TextForegroundColour::BRIGHT_YELLOW);
193+
TextForegroundColour::GREEN => {
194+
self.attr.set_fg(TextForegroundColour::LIGHT_GREEN);
195+
}
196+
TextForegroundColour::BROWN => {
197+
self.attr.set_fg(TextForegroundColour::YELLOW);
195198
}
196199
TextForegroundColour::BLUE => {
197-
self.attr.set_fg(TextForegroundColour::BRIGHT_BLUE);
200+
self.attr.set_fg(TextForegroundColour::LIGHT_BLUE);
198201
}
199-
TextForegroundColour::DARK_MAGENTA => {
200-
self.attr.set_fg(TextForegroundColour::BRIGHT_MAGENTA);
202+
TextForegroundColour::MAGENTA => {
203+
self.attr.set_fg(TextForegroundColour::PINK);
201204
}
202-
TextForegroundColour::DARK_CYAN => {
203-
self.attr.set_fg(TextForegroundColour::BRIGHT_CYAN);
205+
TextForegroundColour::CYAN => {
206+
self.attr.set_fg(TextForegroundColour::LIGHT_CYAN);
204207
}
205-
TextForegroundColour::GREY => {
208+
TextForegroundColour::LIGHT_GRAY => {
206209
self.attr.set_fg(TextForegroundColour::WHITE);
207210
}
208211
_ => {

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ fn sign_on() {
13361336

13371337
// Draw the BIOS version
13381338
tc.change_attr(Attr::new(
1339-
TextForegroundColour::BRIGHT_YELLOW,
1339+
TextForegroundColour::YELLOW,
13401340
TextBackgroundColour::BLACK,
13411341
false,
13421342
));
@@ -1353,7 +1353,7 @@ fn sign_on() {
13531353
tc.move_to(13, 6);
13541354
tc.change_attr(Attr::new(
13551355
TextForegroundColour::WHITE,
1356-
TextBackgroundColour::DARK_RED,
1356+
TextBackgroundColour::RED,
13571357
false,
13581358
));
13591359
let bmc_ver = {
@@ -2205,7 +2205,7 @@ unsafe fn HardFault(frame: &cortex_m_rt::ExceptionFrame) -> ! {
22052205
tc.move_to(0, 0);
22062206
tc.change_attr(Attr::new(
22072207
TextForegroundColour::WHITE,
2208-
TextBackgroundColour::DARK_RED,
2208+
TextBackgroundColour::RED,
22092209
false,
22102210
));
22112211
let _ = writeln!(&tc, "+------------------------------+");

src/vga/mod.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -627,34 +627,34 @@ pub static VIDEO_MODE: AtomicModeWrapper = AtomicModeWrapper::new(crate::common:
627627
pub static VIDEO_PALETTE: [AtomicU16; 256] = [
628628
// Index 000: 0x000 (Black)
629629
AtomicU16::new(RGBColour::from_12bit(0x0, 0x0, 0x0).0),
630-
// Index 001: 0x800 (Dark Red)
631-
AtomicU16::new(RGBColour::from_12bit(0x8, 0x0, 0x0).0),
632-
// Index 002: 0x080 (Dark Green)
633-
AtomicU16::new(RGBColour::from_12bit(0x0, 0x8, 0x0).0),
634-
// Index 003: 0x880 (Orange)
635-
AtomicU16::new(RGBColour::from_12bit(0x8, 0x8, 0x0).0),
636-
// Index 004: 0x008 (Blue)
637-
AtomicU16::new(RGBColour::from_12bit(0x0, 0x0, 0x8).0),
638-
// Index 005: 0x808 (Dark Magenta)
639-
AtomicU16::new(RGBColour::from_12bit(0x8, 0x0, 0x8).0),
640-
// Index 006: 0x088 (Dark Cyan)
641-
AtomicU16::new(RGBColour::from_12bit(0x0, 0x8, 0x8).0),
642-
// Index 007: 0xcc0 (Yellow)
643-
AtomicU16::new(RGBColour::from_12bit(0xc, 0xc, 0x0).0),
644-
// Index 008: 0x888 (Grey)
645-
AtomicU16::new(RGBColour::from_12bit(0x8, 0x8, 0x8).0),
646-
// Index 009: 0xf00 (Bright Red)
647-
AtomicU16::new(RGBColour::from_12bit(0xf, 0x0, 0x0).0),
648-
// Index 010: 0x0f0 (Bright Green)
649-
AtomicU16::new(RGBColour::from_12bit(0x0, 0xf, 0x0).0),
650-
// Index 011: 0xff0 (Bright Yellow)
651-
AtomicU16::new(RGBColour::from_12bit(0xf, 0xf, 0x0).0),
652-
// Index 012: 0x00f (Bright Blue)
630+
// Index 001: 0x00a (Blue)
631+
AtomicU16::new(RGBColour::from_12bit(0x0, 0x0, 0xa).0),
632+
// Index 002: 0x0a0 (Green)
633+
AtomicU16::new(RGBColour::from_12bit(0x0, 0xa, 0x0).0),
634+
// Index 003: 0x0aa (Cyan)
635+
AtomicU16::new(RGBColour::from_12bit(0x0, 0xa, 0xa).0),
636+
// Index 004: 0xa00 (Red)
637+
AtomicU16::new(RGBColour::from_12bit(0xa, 0x0, 0x0).0),
638+
// Index 005: 0xa0a (Magenta)
639+
AtomicU16::new(RGBColour::from_12bit(0xa, 0x0, 0xa).0),
640+
// Index 006: 0xaa0 (Brown)
641+
AtomicU16::new(RGBColour::from_12bit(0xa, 0xa, 0x0).0),
642+
// Index 007: 0xaaa (Light Gray)
643+
AtomicU16::new(RGBColour::from_12bit(0xa, 0xa, 0xa).0),
644+
// Index 008: 0x666 (Dark Gray)
645+
AtomicU16::new(RGBColour::from_12bit(0x6, 0x6, 0x6).0),
646+
// Index 009: 0x00f (Light Blue)
653647
AtomicU16::new(RGBColour::from_12bit(0x0, 0x0, 0xf).0),
654-
// Index 013: 0xf0f (Bright Magenta)
655-
AtomicU16::new(RGBColour::from_12bit(0xf, 0x0, 0xf).0),
656-
// Index 014: 0x0ff (Bright Cyan)
648+
// Index 010: 0x0f0 (Light Green)
649+
AtomicU16::new(RGBColour::from_12bit(0x0, 0xf, 0x0).0),
650+
// Index 011: 0x0ff (Light Cyan)
657651
AtomicU16::new(RGBColour::from_12bit(0x0, 0xf, 0xf).0),
652+
// Index 012: 0xf00 (Light Red)
653+
AtomicU16::new(RGBColour::from_12bit(0xf, 0x0, 0x0).0),
654+
// Index 013: 0xf0f (Pink)
655+
AtomicU16::new(RGBColour::from_12bit(0xf, 0x0, 0xf).0),
656+
// Index 014: 0xff0 (Yellow)
657+
AtomicU16::new(RGBColour::from_12bit(0xf, 0xf, 0x0).0),
658658
// Index 015: 0xfff (White)
659659
AtomicU16::new(RGBColour::from_12bit(0xf, 0xf, 0xf).0),
660660
// Index 016: 0x003

0 commit comments

Comments
 (0)