diff options
author | Kartik Agaram <vc@akkartik.com> | 2021-02-07 15:50:16 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2021-02-07 15:50:16 -0800 |
commit | 8f34dfd1e09e9e33176bba8f05a2ec229cf3b56f (patch) | |
tree | 2a627da04cef70f856a712e9bd56d186c30aa8bc /baremetal/504test-screen.mu | |
parent | f626421bc4f526c48b789914a3a1e088a9250278 (diff) | |
download | mu-8f34dfd1e09e9e33176bba8f05a2ec229cf3b56f.tar.gz |
7693 - baremetal: pass background color everywhere
Diffstat (limited to 'baremetal/504test-screen.mu')
-rw-r--r-- | baremetal/504test-screen.mu | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/baremetal/504test-screen.mu b/baremetal/504test-screen.mu index 07efcc7f..a3d12957 100644 --- a/baremetal/504test-screen.mu +++ b/baremetal/504test-screen.mu @@ -35,23 +35,23 @@ fn check-screen-row-from screen-on-stack: (addr screen), x: int, y: int, expecte compare g, expected-grapheme { break-if-!= - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/cyan + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg break $check-screen-row-from:compare-graphemes } # otherwise print an error count-test-failure - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/cyan - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ": expected '", 3 - draw-grapheme-at-cursor 0/screen, expected-grapheme, 3/cyan + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ": expected '", 3/fg/cyan, 0/bg + draw-grapheme-at-cursor 0/screen, expected-grapheme, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "' at (", 3 - draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, x, 3 - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ", ", 3 - draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 3 - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ") but observed '", 3 - draw-grapheme-at-cursor 0/screen, g, 3/cyan + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "' at (", 3/fg/cyan, 0/bg + draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, x, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ", ", 3/fg/cyan, 0/bg + draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ") but observed '", 3/fg/cyan, 0/bg + draw-grapheme-at-cursor 0/screen, g, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "'", 3 + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "'", 3/fg/cyan, 0/bg } idx <- increment increment x @@ -102,46 +102,46 @@ fn check-screen-row-in-color-from screen-on-stack: (addr screen), fg: int, y: in compare g, expected-grapheme { break-if-!= - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/cyan + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg break $check-screen-row-in-color-from:compare-graphemes } # otherwise print an error count-test-failure - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/cyan - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ": expected '", 3 - draw-grapheme-at-cursor 0/screen, expected-grapheme, 3/cyan + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ": expected '", 3/fg/cyan, 0/bg + draw-grapheme-at-cursor 0/screen, expected-grapheme, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "' at (", 3 - draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, x, 3 - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ", ", 3 - draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 3 - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ") but observed '", 3 - draw-grapheme-at-cursor 0/screen, g, 3/cyan + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "' at (", 3/fg/cyan, 0/bg + draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, x, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ", ", 3/fg/cyan, 0/bg + draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ") but observed '", 3/fg/cyan, 0/bg + draw-grapheme-at-cursor 0/screen, g, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "'", 3 + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "'", 3/fg/cyan, 0/bg } $check-screen-row-in-color-from:compare-colors: { var color/eax: int <- screen-color-at-idx screen, idx compare fg, color { break-if-!= - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/cyan + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg break $check-screen-row-in-color-from:compare-colors } # otherwise print an error count-test-failure - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/cyan - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ": expected '", 3 - draw-grapheme-at-cursor 0/screen, expected-grapheme, 3/cyan + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ": expected '", 3/fg/cyan, 0/bg + draw-grapheme-at-cursor 0/screen, expected-grapheme, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "' at (", 3 - draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, x, 3 - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ", ", 3 - draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 3 - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ") in color ", 3 - draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, fg, 3 - draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " but observed color ", 3 - draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, color, 3 + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "' at (", 3/fg/cyan, 0/bg + draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, x, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ", ", 3/fg/cyan, 0/bg + draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ") in color ", 3/fg/cyan, 0/bg + draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, fg, 3/fg/cyan, 0/bg + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " but observed color ", 3/fg/cyan, 0/bg + draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, color, 3/fg/cyan, 0/bg } } idx <- increment @@ -155,7 +155,7 @@ fn test-draw-single-grapheme { var screen/esi: (addr screen) <- address screen-on-stack initialize-screen screen, 5, 4 var c/eax: grapheme <- copy 0x61/a - draw-grapheme screen, c, 0/x, 0/y, 1/color + draw-grapheme screen, c, 0/x, 0/y, 1/color, 0/bg check-screen-row screen, 0/row, "a", "F - test-draw-single-grapheme" # top-left corner of the screen } @@ -163,6 +163,6 @@ fn test-draw-multiple-graphemes { var screen-on-stack: screen var screen/esi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x10/rows, 4/cols - draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "Hello, 世界", 1/color + draw-text-wrapping-right-then-down-from-cursor-over-full-screen screen, "Hello, 世界", 1/fg, 0/bg check-screen-row screen, 0/screen, "Hello, 世界", "F - test-draw-multiple-graphemes" } |