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,[0x3010] movsx esi,word[ebp-0x3000+0] add eax,esi add ecx,esi movsx esi,word[ebp-0x3000+4] add ebx,esi add edx,esi ; add eax,[ebp-0x3000+0] ; add ebx,[ebp-0x3000+4] ; add ecx,[ebp-0x3000+0] ; add edx,[ebp-0x3000+4] mov esi,[0x00003000] 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 [mouse_invisible],0 jne .put call [SF.draw_mouse_under] mov [mouse_invisible],1 .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,0x000A0000 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