about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--baremetal/103grapheme.subx24
-rw-r--r--baremetal/mu-init.subx4
2 files changed, 19 insertions, 9 deletions
diff --git a/baremetal/103grapheme.subx b/baremetal/103grapheme.subx
index 5b160bfe..97a44315 100644
--- a/baremetal/103grapheme.subx
+++ b/baremetal/103grapheme.subx
@@ -96,8 +96,8 @@ cursor-position-on-real-screen:  # -> _/eax: int, _/ecx: int
     55/push-ebp
     89/<- %ebp 4/r32/esp
     # TODO: support fake screen; we currently assume 'screen' is always 0 (real)
-    8b/-> *Default-next-x 0/r32/eax
-    8b/-> *Default-next-y 1/r32/ecx
+    8b/-> *Real-screen-cursor-x 0/r32/eax
+    8b/-> *Real-screen-cursor-y 1/r32/ecx
 $cursor-position-on-real-screen:end:
     # . epilogue
     89/<- %esp 5/r32/ebp
@@ -110,11 +110,13 @@ set-cursor-position-on-real-screen:  # x: int, y: int
     89/<- %ebp 4/r32/esp
     # . save registers
     50/push-eax
+    #
+    (draw-grapheme-on-real-screen 0x20 *(ebp+8) *(ebp+0xc) 0 7)
     # TODO: support fake screen; we currently assume 'screen' is always 0 (real)
     8b/-> *(ebp+8) 0/r32/eax
-    89/<- *Default-next-x 0/r32/eax
+    89/<- *Real-screen-cursor-x 0/r32/eax
     8b/-> *(ebp+0xc) 0/r32/eax
-    89/<- *Default-next-y 0/r32/eax
+    89/<- *Real-screen-cursor-y 0/r32/eax
 $set-cursor-position-on-real-screen:end:
     # . restore registers
     58/pop-to-eax
@@ -125,8 +127,16 @@ $set-cursor-position-on-real-screen:end:
 
 == data
 
-Default-next-x:
+# The cursor is where certain Mu functions (usually of the form
+# 'draw*cursor*') print to by default. It becomes visible on
+# set-cursor-position, but further drawing might overwrite it.
+# We don't bother displaying the cursor when drawing text. It's up to
+# applications to display the cursor before waiting for a key, and to ensure
+# its location appropriately suggests the effect keystrokes will have.
+#
+# There's no low-level support for blinking, etc. We aren't using any
+# hardware-supported text mode here.
+Real-screen-cursor-x:
   0/imm32
-
-Default-next-y:
+Real-screen-cursor-y:
   0/imm32
diff --git a/baremetal/mu-init.subx b/baremetal/mu-init.subx
index 0ed4f085..26b83451 100644
--- a/baremetal/mu-init.subx
+++ b/baremetal/mu-init.subx
@@ -16,8 +16,8 @@ bd/copy-to-ebp 0/imm32
   3d/compare-eax-and 0/imm32
   75/jump-if-!= break/disp8
   (clear-real-screen)
-  c7 0/subop/copy *Default-next-x 0/imm32
-  c7 0/subop/copy *Default-next-y 0/imm32
+  c7 0/subop/copy *Real-screen-cursor-x 0/imm32
+  c7 0/subop/copy *Real-screen-cursor-y 0/imm32
   (main)
 }
 
bb8c0cdf771d34c839cb6591d892b8e62de'>9e751bb8 ^
4a39d12d ^
c842d90b ^





e5c11a51 ^






















c842d90b ^


e5c11a51 ^
c842d90b ^
6c52e24e ^
204dae92 ^


9e751bb8 ^



204dae92 ^




6c52e24e ^
204dae92 ^




9e751bb8 ^



204dae92 ^




9e751bb8 ^




204dae92 ^
201458e3 ^
204dae92 ^



6c52e24e ^




204dae92 ^
9e751bb8 ^







204dae92 ^


bd58d18a ^
6c52e24e ^
bd58d18a ^










6c52e24e ^

bd58d18a ^



c842d90b ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140