roll back previous commit
These helpers don't actually help render to buffers with geometries different from video RAM.
This commit is contained in:
parent
b78bff9307
commit
242b83ed46
|
@ -6,19 +6,6 @@
|
||||||
== code
|
== code
|
||||||
|
|
||||||
pixel-on-real-screen: # x: int, y: int, color: int
|
pixel-on-real-screen: # x: int, y: int, color: int
|
||||||
# . prologue
|
|
||||||
55/push-ebp
|
|
||||||
89/<- %ebp 4/r32/esp
|
|
||||||
#
|
|
||||||
(pixel-on-screen-buffer *Video-memory-addr *(ebp+8) *(ebp+0xc) *(ebp+0x10))
|
|
||||||
$pixel-on-real-screen:end:
|
|
||||||
# . epilogue
|
|
||||||
89/<- %esp 5/r32/ebp
|
|
||||||
5d/pop-to-ebp
|
|
||||||
c3/return
|
|
||||||
|
|
||||||
# 'buffer' here is not a valid Mu type: a naked address without a length.
|
|
||||||
pixel-on-screen-buffer: # buffer: (addr byte), x: int, y: int, color: int
|
|
||||||
# . prologue
|
# . prologue
|
||||||
55/push-ebp
|
55/push-ebp
|
||||||
89/<- %ebp 4/r32/esp
|
89/<- %ebp 4/r32/esp
|
||||||
|
@ -26,26 +13,26 @@ pixel-on-screen-buffer: # buffer: (addr byte), x: int, y: int, color: int
|
||||||
50/push-eax
|
50/push-eax
|
||||||
51/push-ecx
|
51/push-ecx
|
||||||
# bounds checks
|
# bounds checks
|
||||||
|
8b/-> *(ebp+8) 0/r32/eax
|
||||||
|
3d/compare-eax-and 0/imm32
|
||||||
|
7c/jump-if-< $pixel-on-real-screen:end/disp8
|
||||||
|
3d/compare-eax-and 0x400/imm32/screen-width=1024
|
||||||
|
7d/jump-if->= $pixel-on-real-screen:end/disp8
|
||||||
8b/-> *(ebp+0xc) 0/r32/eax
|
8b/-> *(ebp+0xc) 0/r32/eax
|
||||||
3d/compare-eax-and 0/imm32
|
3d/compare-eax-and 0/imm32
|
||||||
7c/jump-if-< $pixel-on-screen-buffer:end/disp8
|
7c/jump-if-< $pixel-on-real-screen:end/disp8
|
||||||
3d/compare-eax-and 0x400/imm32/screen-width=1024
|
|
||||||
7d/jump-if->= $pixel-on-screen-buffer:end/disp8
|
|
||||||
8b/-> *(ebp+0x10) 0/r32/eax
|
|
||||||
3d/compare-eax-and 0/imm32
|
|
||||||
7c/jump-if-< $pixel-on-screen-buffer:end/disp8
|
|
||||||
3d/compare-eax-and 0x300/imm32/screen-height=768
|
3d/compare-eax-and 0x300/imm32/screen-height=768
|
||||||
7d/jump-if->= $pixel-on-screen-buffer:end/disp8
|
7d/jump-if->= $pixel-on-real-screen:end/disp8
|
||||||
# eax = y*1024 + x
|
# eax = y*1024 + x
|
||||||
8b/-> *(ebp+0x10) 0/r32/eax
|
8b/-> *(ebp+0xc) 0/r32/eax
|
||||||
c1/shift 4/subop/left %eax 0xa/imm8
|
c1/shift 4/subop/left %eax 0xa/imm8
|
||||||
03/add-> *(ebp+0xc) 0/r32/eax
|
|
||||||
# eax += location of frame buffer
|
|
||||||
03/add-> *(ebp+8) 0/r32/eax
|
03/add-> *(ebp+8) 0/r32/eax
|
||||||
|
# eax += location of frame buffer
|
||||||
|
03/add-> *Video-memory-addr 0/r32/eax
|
||||||
# *eax = color
|
# *eax = color
|
||||||
8b/-> *(ebp+0x14) 1/r32/ecx
|
8b/-> *(ebp+0x10) 1/r32/ecx
|
||||||
88/byte<- *eax 1/r32/CL
|
88/byte<- *eax 1/r32/CL
|
||||||
$pixel-on-screen-buffer:end:
|
$pixel-on-real-screen:end:
|
||||||
# . restore registers
|
# . restore registers
|
||||||
59/pop-to-ecx
|
59/pop-to-ecx
|
||||||
58/pop-to-eax
|
58/pop-to-eax
|
||||||
|
|
|
@ -15,19 +15,6 @@
|
||||||
# Doesn't update the cursor; where the cursor should go after printing the
|
# Doesn't update the cursor; where the cursor should go after printing the
|
||||||
# current grapheme is a higher-level concern.
|
# current grapheme is a higher-level concern.
|
||||||
draw-grapheme-on-real-screen: # g: grapheme, x: int, y: int, color: int, background-color: int
|
draw-grapheme-on-real-screen: # g: grapheme, x: int, y: int, color: int, background-color: int
|
||||||
# . prologue
|
|
||||||
55/push-ebp
|
|
||||||
89/<- %ebp 4/r32/esp
|
|
||||||
#
|
|
||||||
(draw-grapheme-on-screen-buffer *Video-memory-addr *(ebp+8) *(ebp+0xc) *(ebp+0x10) *(ebp+0x14) *(ebp+0x18))
|
|
||||||
$draw-grapheme-on-real-screen:end:
|
|
||||||
# . epilogue
|
|
||||||
89/<- %esp 5/r32/ebp
|
|
||||||
5d/pop-to-ebp
|
|
||||||
c3/return
|
|
||||||
|
|
||||||
# 'buffer' here is not a valid Mu type: a naked address without a length.
|
|
||||||
draw-grapheme-on-screen-buffer: # buffer: (addr byte), g: grapheme, x: int, y: int, color: int, background-color: int
|
|
||||||
# . prologue
|
# . prologue
|
||||||
55/push-ebp
|
55/push-ebp
|
||||||
89/<- %ebp 4/r32/esp
|
89/<- %ebp 4/r32/esp
|
||||||
|
@ -38,17 +25,17 @@ draw-grapheme-on-screen-buffer: # buffer: (addr byte), g: grapheme, x: int, y:
|
||||||
53/push-ebx
|
53/push-ebx
|
||||||
56/push-esi
|
56/push-esi
|
||||||
# var letter-bitmap/esi = font[g]
|
# var letter-bitmap/esi = font[g]
|
||||||
8b/-> *(ebp+0xc) 6/r32/esi
|
8b/-> *(ebp+8) 6/r32/esi
|
||||||
c1 4/subop/shift-left %esi 4/imm8
|
c1 4/subop/shift-left %esi 4/imm8
|
||||||
81 0/subop/add %esi Font/imm32
|
81 0/subop/add %esi Font/imm32
|
||||||
# if (letter-bitmap >= 0x9400) return # characters beyond ASCII currently not supported
|
# if (letter-bitmap >= 0x9400) return # characters beyond ASCII currently not supported
|
||||||
81 7/subop/compare %esi 0x9400/imm32
|
81 7/subop/compare %esi 0x9400/imm32
|
||||||
7d/jump-if->= $draw-grapheme-on-screen-buffer:end/disp8
|
7d/jump-if->= $draw-grapheme-on-real-screen:end/disp8
|
||||||
# var ycurr/edx: int = y*16
|
# var ycurr/edx: int = y*16
|
||||||
8b/-> *(ebp+0x14) 2/r32/edx
|
8b/-> *(ebp+0x10) 2/r32/edx
|
||||||
c1 4/subop/shift-left %edx 4/imm8
|
c1 4/subop/shift-left %edx 4/imm8
|
||||||
# var ymax/ebx: int = ycurr + 16
|
# var ymax/ebx: int = ycurr + 16
|
||||||
8b/-> *(ebp+0x14) 3/r32/ebx
|
8b/-> *(ebp+0x10) 3/r32/ebx
|
||||||
c1 4/subop/shift-left %ebx 4/imm8
|
c1 4/subop/shift-left %ebx 4/imm8
|
||||||
81 0/subop/add %ebx 0x10/imm32
|
81 0/subop/add %ebx 0x10/imm32
|
||||||
{
|
{
|
||||||
|
@ -56,11 +43,11 @@ draw-grapheme-on-screen-buffer: # buffer: (addr byte), g: grapheme, x: int, y:
|
||||||
39/compare %edx 3/r32/ebx
|
39/compare %edx 3/r32/ebx
|
||||||
7d/jump-if->= break/disp8
|
7d/jump-if->= break/disp8
|
||||||
# var xcurr/eax: int = x*8 + 7
|
# var xcurr/eax: int = x*8 + 7
|
||||||
8b/-> *(ebp+0x10) 0/r32/eax # font-width - 1
|
8b/-> *(ebp+0xc) 0/r32/eax # font-width - 1
|
||||||
c1 4/subop/shift-left %eax 3/imm8
|
c1 4/subop/shift-left %eax 3/imm8
|
||||||
05/add-to-eax 7/imm32
|
05/add-to-eax 7/imm32
|
||||||
# var xmin/ecx: int = x*8
|
# var xmin/ecx: int = x*8
|
||||||
8b/-> *(ebp+0x10) 1/r32/ecx
|
8b/-> *(ebp+0xc) 1/r32/ecx
|
||||||
c1 4/subop/shift-left %ecx 3/imm8
|
c1 4/subop/shift-left %ecx 3/imm8
|
||||||
# var row-bitmap/ebx: int = *letter-bitmap
|
# var row-bitmap/ebx: int = *letter-bitmap
|
||||||
53/push-ebx
|
53/push-ebx
|
||||||
|
@ -74,12 +61,12 @@ draw-grapheme-on-screen-buffer: # buffer: (addr byte), g: grapheme, x: int, y:
|
||||||
# if LSB, draw a pixel in the given color
|
# if LSB, draw a pixel in the given color
|
||||||
{
|
{
|
||||||
73/jump-if-not-CF break/disp8
|
73/jump-if-not-CF break/disp8
|
||||||
(pixel-on-screen-buffer *(ebp+8) %eax %edx *(ebp+0x18))
|
(pixel-on-real-screen %eax %edx *(ebp+0x14))
|
||||||
eb/jump $draw-grapheme-on-screen-buffer:continue/disp8
|
eb/jump $draw-grapheme-on-real-screen:continue/disp8
|
||||||
}
|
}
|
||||||
# otherwise use the background color
|
# otherwise use the background color
|
||||||
(pixel-on-screen-buffer *(ebp+8) %eax %edx *(ebp+0x1c))
|
(pixel-on-real-screen %eax %edx *(ebp+0x18))
|
||||||
$draw-grapheme-on-screen-buffer:continue:
|
$draw-grapheme-on-real-screen:continue:
|
||||||
# --x
|
# --x
|
||||||
48/decrement-eax
|
48/decrement-eax
|
||||||
#
|
#
|
||||||
|
@ -94,7 +81,7 @@ $draw-grapheme-on-screen-buffer:continue:
|
||||||
#
|
#
|
||||||
eb/jump loop/disp8
|
eb/jump loop/disp8
|
||||||
}
|
}
|
||||||
$draw-grapheme-on-screen-buffer:end:
|
$draw-grapheme-on-real-screen:end:
|
||||||
# . restore registers
|
# . restore registers
|
||||||
5e/pop-to-esi
|
5e/pop-to-esi
|
||||||
5b/pop-to-ebx
|
5b/pop-to-ebx
|
||||||
|
|
Loading…
Reference in New Issue