about summary refs log tree commit diff stats
path: root/103grapheme.subx
diff options
context:
space:
mode:
Diffstat (limited to '103grapheme.subx')
-rw-r--r--103grapheme.subx39
1 files changed, 34 insertions, 5 deletions
diff --git a/103grapheme.subx b/103grapheme.subx
index ef7cf538..2ed65643 100644
--- a/103grapheme.subx
+++ b/103grapheme.subx
@@ -134,8 +134,6 @@ draw-narrow-grapheme-on-screen-buffer:  # buffer: (addr byte), letter-bitmap: (a
     55/push-ebp
     89/<- %ebp 4/r32/esp
     # . save registers
-    50/push-eax
-    51/push-ecx
     52/push-edx
     53/push-ebx
     56/push-esi
@@ -170,8 +168,6 @@ $draw-narrow-grapheme-on-screen-buffer:end:
     5e/pop-to-esi
     5b/pop-to-ebx
     5a/pop-to-edx
-    59/pop-to-ecx
-    58/pop-to-eax
     # . epilogue
     89/<- %esp 5/r32/ebp
     5d/pop-to-ebp
@@ -189,9 +185,42 @@ draw-wide-grapheme-on-screen-buffer:  # buffer: (addr byte), letter-bitmap: (add
     52/push-edx
     53/push-ebx
     56/push-esi
-    # HERE
+    57/push-edi
+    # esi = letter-bitmap
+    8b/-> *(ebp+0xc) 6/r32/esi
+    #
+    bb/copy-to-ebx 0/imm32
+    # var ycurr/edx: int = y*16
+    8b/-> *(ebp+0x14) 2/r32/edx
+    c1 4/subop/shift-left %edx 4/imm8
+    # var ymax/edi: int = ycurr + 16
+    8b/-> *(ebp+0x14) 7/r32/edi
+    c1 4/subop/shift-left %edi 4/imm8
+    81 0/subop/add %edi 0x10/imm32
+    {
+      # if (ycurr >= ymax) break
+      39/compare %edx 7/r32/edi
+      0f 8d/jump-if->= break/disp32
+      # var row-bitmap/ebx: byte = *letter-bitmap
+      8a/byte-> *(esi+1) 3/r32/BL
+      # ecx = x
+      8b/-> *(ebp+0x10) 1/r32/ecx
+      # first half-row
+      (draw-run-of-pixels-from-glyph *(ebp+8) %ebx %ecx %edx *(ebp+0x18) *(ebp+0x1c) *(ebp+0x20) *(ebp+0x24))
+      # second half-row
+      8a/byte-> *esi 3/r32/BL
+      49/increment-ecx
+      (draw-run-of-pixels-from-glyph *(ebp+8) %ebx %ecx %edx *(ebp+0x18) *(ebp+0x1c) *(ebp+0x20) *(ebp+0x24))
+      # ++y
+      42/increment-edx
+      # next bitmap row
+      81 0/subop/add %esi 2/imm32
+      #
+      e9/jump loop/disp32
+    }
 $draw-wide-grapheme-on-screen-buffer:end:
     # . restore registers
+    5f/pop-to-edi
     5e/pop-to-esi
     5b/pop-to-ebx
     5a/pop-to-edx
0 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 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365