about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-18 15:49:20 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-18 15:49:20 -0700
commitd7d384a72bdadfb3d704914b89318f8f7907d7fe (patch)
tree0c89548fd17602afae29e698de5564387d2f2137 /apps
parente170b35d8b37901903318851803e3cab5e09cde0 (diff)
downloadmu-d7d384a72bdadfb3d704914b89318f8f7907d7fe.tar.gz
7055
Diffstat (limited to 'apps')
-rw-r--r--apps/texture.mu12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/texture.mu b/apps/texture.mu
index bd76c49a..4e73b9f2 100644
--- a/apps/texture.mu
+++ b/apps/texture.mu
@@ -16,7 +16,7 @@ fn main -> exit-status/ebx: int {
   print-string 0, " "
   print-int32-decimal 0, height
   print-string 0, "\n"
-  print-string 0, "65535\n"  # color depth
+  print-string 0, "255\n"  # color depth
   var row/ecx: int <- copy 0
   {
     compare row, height
@@ -27,16 +27,20 @@ fn main -> exit-status/ebx: int {
       break-if->=
       # r
       var tmp/eax: int <- copy col
-      tmp <- multiply col
+      tmp <- multiply row
+      tmp <- and 0xff
       print-int32-decimal 0, tmp
       print-string 0, " "
       # g
       tmp <- copy row
-      tmp <- multiply row
+      tmp <- multiply col
+      tmp <- and col
       print-int32-decimal 0, tmp
       print-string 0, " "
       # b
-      tmp <- copy 0
+      tmp <- copy row
+      tmp <- multiply col
+      tmp <- and row
       print-int32-decimal 0, tmp
       print-string 0, "\n"
       col <- increment