func color_24_to_4_bits begin push edx mov dl,0 cmp al,85 ; blue jbe .p13green or dl,0x01 cmp al,170 jbe .p13green or dl,0x08 .p13green: shr eax,8 cmp al,85 ; green jbe .p13red or dl,0x02 cmp al,170 jbe .p13red or dl,0x08 .p13red: cmp ah,85 ; red jbe .p13cont or dl,0x04 cmp ah,170 jbe .p13cont or dl,0x08 .p13cont: mov eax,edx pop edx ret endf ;----------------------------------------------------------------------------- func vm_mike_draw_rect.04 ;/////////////////////////////////////////////////// ;----------------------------------------------------------------------------- ; eax - x start ; ebx - y start ; ecx - x end ; edx - y end ; edi - color ;----------------------------------------------------------------------------- ;- eax(ebx) [x start]*65536 + [x size] ;- ebx(ecx) [y start]*65536 + [y size] ;- ecx(edx) color 0x00RRGGBB ;----------------------------------------------------------------------------- begin pushad cli jif eax,e,ecx,.exit jif ebx,e,edx,.exit call get_cursor_rect push eax mov eax,edi call color_24_to_4_bits mov edi,eax pop eax mov ebp,[TASK_BASE] movsx esi,word[ebp-CURRENT_TASK+0] add eax,esi add ecx,esi movsx esi,word[ebp-CURRENT_TASK+4] add ebx,esi add edx,esi ; add eax,[ebp-CURRENT_TASK+0] ; add ebx,[ebp-CURRENT_TASK+4] ; add ecx,[ebp-CURRENT_TASK+0] ; add edx,[ebp-CURRENT_TASK+4] mov esi,[CURRENT_TASK] mov esi,[CLIP_RECTS+esi*4] mov ebp,[esi] or ebp,ebp jz .exit add esi,4 .nx: jif ecx,le,[rr.left],.skip jif eax,ge,[rr.right],.skip jif edx,le,[rr.top],.skip jif ebx,ge,[rr.bottom],.skip pushad jif eax,ge,[rr.left],@f mov eax,[rr.left] @@: jif ebx,ge,[rr.top],@f mov ebx,[rr.top] @@: jif ecx,l,[rr.right],@f mov ecx,[rr.right] @@: jif edx,l,[rr.bottom],@f mov edx,[rr.bottom] @@: call is_intersect_rc jc .put cmp byte[MOUSE_VISIBLE],0 je .put call [SF.draw_mouse_under] mov byte[MOUSE_VISIBLE],0 .put: sub edx,ebx push edx edi ebx eax mov edi,ebx shl edi,6 shl ebx,4 add edi,ebx shr eax,3 add edi,eax add edi,VGABasePtr pop eax ebx mov ebx,eax mov esi,ecx sub esi,eax mov dx,0x03CE ;edi = Offset in VMem ;esi = Length ;ebx = x ; dx = Graphix Controller mov cl,bl ; Get StartBit and ecx,07h mov eax,esi add eax,ecx cmp eax,8 ; Is x+Length