From a03daa83f59fa22a0d5a7857767ba03e3d2909a5 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 10 Sep 2020 23:32:40 -0700 Subject: 6770 --- apps/browse/paginated-screen.mu | 210 ++++++++++++++++++++++++++-------------- 1 file changed, 140 insertions(+), 70 deletions(-) (limited to 'apps') diff --git a/apps/browse/paginated-screen.mu b/apps/browse/paginated-screen.mu index 215e1982..df002394 100644 --- a/apps/browse/paginated-screen.mu +++ b/apps/browse/paginated-screen.mu @@ -181,8 +181,10 @@ fn test-print-grapheme-on-paginated-screen { var pg/eax: (addr paginated-screen) <- address pg-on-stack initialize-fake-paginated-screen pg, 3, 0xa, 0xa, 0, 0 start-drawing pg - var c/ecx: grapheme <- copy 0x61 # 'a' - add-grapheme pg, c + { + var c/ecx: grapheme <- copy 0x61 # 'a' + add-grapheme pg, c + } var screen-ah/eax: (addr handle screen) <- get pg, screen var screen-addr/eax: (addr screen) <- lookup *screen-ah check-screen-row screen-addr, 1, "a", "F - test-print-grapheme-on-paginated-screen" @@ -194,14 +196,22 @@ fn test-print-single-page { initialize-fake-paginated-screen pg, 2, 4, 2, 0, 0 # 2 rows, 4 columns, 2 pages * 2 columns each start-drawing pg # pages at columns [1, 3), [3, 5] - var c/ecx: grapheme <- copy 0x61 # 'a' - add-grapheme pg, c - c <- copy 0x62 # 'b' - add-grapheme pg, c - c <- copy 0x63 # 'c' - add-grapheme pg, c - c <- copy 0x64 # 'd' - add-grapheme pg, c + { + var c/ecx: grapheme <- copy 0x61 # 'a' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x62 # 'b' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x63 # 'c' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x64 # 'd' + add-grapheme pg, c + } var screen-ah/eax: (addr handle screen) <- get pg, screen var screen-addr/eax: (addr screen) <- lookup *screen-ah check-screen-row screen-addr, 1, "ab ", "F - test-print-single-page/row1" @@ -214,16 +224,26 @@ fn test-print-single-page-narrower-than-page-width { var pg/eax: (addr paginated-screen) <- address pg-on-stack initialize-fake-paginated-screen pg, 2, 4, 5, 0, 0 # 2 rows, 4 columns, 5-column pages start-drawing pg - var c/ecx: grapheme <- copy 0x61 # 'a' - add-grapheme pg, c - c <- copy 0x62 # 'b' - add-grapheme pg, c - c <- copy 0x63 # 'c' - add-grapheme pg, c - c <- copy 0x64 # 'd' - add-grapheme pg, c - c <- copy 0x65 # 'e' - add-grapheme pg, c + { + var c/ecx: grapheme <- copy 0x61 # 'a' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x62 # 'b' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x63 # 'c' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x64 # 'd' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x65 # 'e' + add-grapheme pg, c + } var screen-ah/eax: (addr handle screen) <- get pg, screen var screen-addr/eax: (addr screen) <- lookup *screen-ah check-screen-row screen-addr, 1, "abcd", "F - test-print-single-page-narrower-than-page-width/row1" @@ -236,16 +256,26 @@ fn test-print-single-page-narrower-than-page-width-with-margin { var pg/eax: (addr paginated-screen) <- address pg-on-stack initialize-fake-paginated-screen pg, 2, 4, 5, 0, 1 # 2 rows, 4 columns, 5-column pages, left margin start-drawing pg - var c/ecx: grapheme <- copy 0x61 # 'a' - add-grapheme pg, c - c <- copy 0x62 # 'b' - add-grapheme pg, c - c <- copy 0x63 # 'c' - add-grapheme pg, c - c <- copy 0x64 # 'd' - add-grapheme pg, c - c <- copy 0x65 # 'e' - add-grapheme pg, c + { + var c/ecx: grapheme <- copy 0x61 # 'a' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x62 # 'b' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x63 # 'c' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x64 # 'd' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x65 # 'e' + add-grapheme pg, c + } var screen-ah/eax: (addr handle screen) <- get pg, screen var screen-addr/eax: (addr screen) <- lookup *screen-ah check-screen-row screen-addr, 1, " abc", "F - test-print-single-page-narrower-than-page-width-with-margin/row1" @@ -258,14 +288,22 @@ fn test-print-multiple-pages { var pg/eax: (addr paginated-screen) <- address pg-on-stack initialize-fake-paginated-screen pg, 2, 2, 1, 0, 0 # 2 rows, 2 columns, 2 pages * 1 column each start-drawing pg - var c/ecx: grapheme <- copy 0x61 # 'a' - add-grapheme pg, c - c <- copy 0x62 # 'b' - add-grapheme pg, c - c <- copy 0x63 # 'c' - add-grapheme pg, c - c <- copy 0x64 # 'd' - add-grapheme pg, c + { + var c/ecx: grapheme <- copy 0x61 # 'a' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x62 # 'b' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x63 # 'c' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x64 # 'd' + add-grapheme pg, c + } var screen-ah/eax: (addr handle screen) <- get pg, screen var screen-addr/eax: (addr screen) <- lookup *screen-ah check-screen-row screen-addr, 1, "ac", "F - test-print-multiple-pages/row1" @@ -278,22 +316,38 @@ fn test-print-multiple-pages-2 { var pg/eax: (addr paginated-screen) <- address pg-on-stack initialize-fake-paginated-screen pg, 2, 4, 2, 0, 0 # 2 rows, 4 columns, 2 pages * 2 columns each start-drawing pg - var c/ecx: grapheme <- copy 0x61 # 'a' - add-grapheme pg, c - c <- copy 0x62 # 'b' - add-grapheme pg, c - c <- copy 0x63 # 'c' - add-grapheme pg, c - c <- copy 0x64 # 'd' - add-grapheme pg, c - c <- copy 0x65 # 'e' - add-grapheme pg, c - c <- copy 0x66 # 'f' - add-grapheme pg, c - c <- copy 0x67 # 'g' - add-grapheme pg, c - c <- copy 0x68 # 'h' - add-grapheme pg, c + { + var c/ecx: grapheme <- copy 0x61 # 'a' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x62 # 'b' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x63 # 'c' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x64 # 'd' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x65 # 'e' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x66 # 'f' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x67 # 'g' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x68 # 'h' + add-grapheme pg, c + } var screen-ah/eax: (addr handle screen) <- get pg, screen var screen-addr/eax: (addr screen) <- lookup *screen-ah check-screen-row screen-addr, 1, "abef", "F - test-print-multiple-pages-2/row1" @@ -306,22 +360,38 @@ fn test-print-multiple-pages-with-margins { var pg/eax: (addr paginated-screen) <- address pg-on-stack initialize-fake-paginated-screen pg, 3, 6, 2, 1, 1 # 3 rows, 5 columns, 2 pages * 2 columns each start-drawing pg - var c/ecx: grapheme <- copy 0x61 # 'a' - add-grapheme pg, c - c <- copy 0x62 # 'b' - add-grapheme pg, c - c <- copy 0x63 # 'c' - add-grapheme pg, c - c <- copy 0x64 # 'd' - add-grapheme pg, c - c <- copy 0x65 # 'e' - add-grapheme pg, c - c <- copy 0x66 # 'f' - add-grapheme pg, c - c <- copy 0x67 # 'g' - add-grapheme pg, c - c <- copy 0x68 # 'h' - add-grapheme pg, c + { + var c/ecx: grapheme <- copy 0x61 # 'a' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x62 # 'b' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x63 # 'c' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x64 # 'd' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x65 # 'e' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x66 # 'f' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x67 # 'g' + add-grapheme pg, c + } + { + var c/ecx: grapheme <- copy 0x68 # 'h' + add-grapheme pg, c + } var screen-ah/eax: (addr handle screen) <- get pg, screen var screen-addr/eax: (addr screen) <- lookup *screen-ah check-screen-row screen-addr, 1, " ", "F - test-print-multiple-pages-with-margins/row1" -- cgit 1.4.1-2-gfad0