1 # Primitives for screen control.
3 # We need to do this in machine code because Mu doesn't have global variables
4 # yet (for the start of video memory).
8 pixel-on-real-screen: # x: int, y: int, color: int
13 (pixel-on-screen-buffer *Video-memory-addr *(ebp+8) *(ebp+0xc) *(ebp+0x10) 0x400 0x300)
14 $pixel-on-real-screen:end:
20 # 'buffer' here is not a valid Mu type: a naked address without a length.
21 pixel-on-screen-buffer: # buffer: (addr byte), x: int, y: int, color: int, width: int, height: int
29 8b/-> *(ebp+0xc) 0/r32/eax # foo
30 3d/compare-eax-and 0/imm32
31 7c/jump-if-< $pixel-on-screen-buffer:end/disp8
32 3b/compare 0/r32/eax *(ebp+0x18)
33 7d/jump-if->= $pixel-on-screen-buffer:end/disp8
34 8b/-> *(ebp+0x10) 0/r32/eax
35 3d/compare-eax-and 0/imm32
36 7c/jump-if-< $pixel-on-screen-buffer:end/disp8
37 3b/compare 0/r32/eax *(ebp+0x1c)
38 7d/jump-if->= $pixel-on-screen-buffer:end/disp8
40 8b/-> *(ebp+0x10) 0/r32/eax
41 0f af/multiply-> *(ebp+0x18) 0/r32/eax
42 03/add-> *(ebp+0xc) 0/r32/eax
43 # eax += location of frame buffer
44 03/add-> *(ebp+8) 0/r32/eax
46 8b/-> *(ebp+0x14) 1/r32/ecx
47 88/byte<- *eax 1/r32/CL
48 $pixel-on-screen-buffer:end: