about summary refs log tree commit diff stats
path: root/103grapheme.subx
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-06-12 21:43:33 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-06-12 21:58:31 -0700
commitbda6982ba14e1e5c562d86260ad906d9fb29261b (patch)
treeeae02f7dbff05e1508c398c49f4ae225fd77d4b1 /103grapheme.subx
parent242b83ed46c0fa376535c7ef0458df1fe0e28ac0 (diff)
downloadmu-bda6982ba14e1e5c562d86260ad906d9fb29261b.tar.gz
fix a bounds check
This should have gotten cleaned up during commit e0f6dd5240 (Mar 23).
Diffstat (limited to '103grapheme.subx')
-rw-r--r--103grapheme.subx9
1 files changed, 5 insertions, 4 deletions
diff --git a/103grapheme.subx b/103grapheme.subx
index 269e3c02..8f1f9e61 100644
--- a/103grapheme.subx
+++ b/103grapheme.subx
@@ -24,13 +24,14 @@ draw-grapheme-on-real-screen:  # g: grapheme, x: int, y: int, color: int, backgr
     52/push-edx
     53/push-ebx
     56/push-esi
-    # var letter-bitmap/esi = font[g]
+    # esi = g
     8b/-> *(ebp+8) 6/r32/esi
+    # if (g >= 128) return  # characters beyond ASCII currently not supported
+    81 7/subop/compare %esi 0x80/imm32
+    7d/jump-if->= $draw-grapheme-on-real-screen:end/disp8
+    # var letter-bitmap/esi = font[g]
     c1 4/subop/shift-left %esi 4/imm8
     81 0/subop/add %esi Font/imm32
-    # if (letter-bitmap >= 0x9400) return  # characters beyond ASCII currently not supported
-    81 7/subop/compare %esi 0x9400/imm32
-    7d/jump-if->= $draw-grapheme-on-real-screen:end/disp8
     # var ycurr/edx: int = y*16
     8b/-> *(ebp+0x10) 2/r32/edx
     c1 4/subop/shift-left %edx 4/imm8
0'>160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290