2011-11-29 10:40:16 +01:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2010-06-25 18:47:51 +02:00
|
|
|
;; ;;
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
|
|
|
; // Alver 22.06.2008 // {
|
|
|
|
align 4
|
2011-07-23 17:27:18 +02:00
|
|
|
dtext_asciiz_esi: ; for skins title out
|
2010-06-25 18:47:51 +02:00
|
|
|
push eax
|
|
|
|
xor eax, eax
|
|
|
|
inc eax
|
|
|
|
jmp dtext.1
|
|
|
|
; } \\ Alver \\
|
|
|
|
|
|
|
|
align 4
|
2011-07-23 17:27:18 +02:00
|
|
|
dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
|
|
|
|
; ebx x & y
|
|
|
|
; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
|
|
|
|
; X = ABnnb:
|
|
|
|
; nn = font
|
|
|
|
; A = 0 <=> output esi characters; otherwise output ASCIIZ string
|
|
|
|
; B = 1 <=> fill background with color eax
|
|
|
|
; edx start of text
|
|
|
|
; edi 1 force
|
2010-06-25 18:47:51 +02:00
|
|
|
|
|
|
|
; // Alver 22.06.2008 // {
|
|
|
|
push eax
|
2011-07-23 17:27:18 +02:00
|
|
|
xor eax, eax
|
2010-06-25 18:47:51 +02:00
|
|
|
.1:
|
|
|
|
; } \\ Alver \\
|
2011-07-23 17:27:18 +02:00
|
|
|
pushad
|
|
|
|
call [_display.disable_mouse]
|
2010-06-25 18:47:51 +02:00
|
|
|
|
2011-07-23 17:27:18 +02:00
|
|
|
movsx eax, bx ; eax=y
|
|
|
|
sar ebx, 16 ; ebx=x
|
|
|
|
xchg eax, ebx ; eax=x, ebx=y
|
|
|
|
cmp esi, 255
|
|
|
|
jb .loop
|
|
|
|
mov esi, 255
|
2010-06-25 18:47:51 +02:00
|
|
|
.loop:
|
2011-07-23 17:27:18 +02:00
|
|
|
test ecx, ecx
|
|
|
|
js .test_asciiz
|
|
|
|
dec esi
|
|
|
|
js .end
|
|
|
|
jmp @f
|
2010-06-25 18:47:51 +02:00
|
|
|
.test_asciiz:
|
2011-07-23 17:27:18 +02:00
|
|
|
cmp byte [edx], 0
|
|
|
|
jz .end
|
2010-06-25 18:47:51 +02:00
|
|
|
; // Alver 22.06.2008 // {
|
2011-07-23 17:27:18 +02:00
|
|
|
cmp byte [esp+28], 1 ; was the entry point = dtext.1 ?
|
|
|
|
jne @f
|
|
|
|
dec esi
|
|
|
|
js .end
|
2010-06-25 18:47:51 +02:00
|
|
|
; } \\ Alver \\
|
|
|
|
@@:
|
2011-07-23 17:27:18 +02:00
|
|
|
inc edx
|
|
|
|
pushad ; esp -= 64 !
|
|
|
|
movzx edx, byte [edx-1]
|
|
|
|
test ecx, 0x10000000
|
|
|
|
jnz .font2
|
|
|
|
mov esi, 9
|
|
|
|
lea ebp, [FONT_I+8*edx+edx]
|
2010-06-25 18:47:51 +02:00
|
|
|
.symloop1:
|
2011-07-23 17:27:18 +02:00
|
|
|
mov dl, byte [ebp]
|
|
|
|
or dl, 1 shl 6
|
2010-06-25 18:47:51 +02:00
|
|
|
.pixloop1:
|
2011-07-23 17:27:18 +02:00
|
|
|
shr dl, 1
|
|
|
|
jz .pixloop1end
|
|
|
|
jnc .nopix
|
|
|
|
call [putpixel]
|
|
|
|
jmp .pixloop1cont
|
2010-06-25 18:47:51 +02:00
|
|
|
.nopix:
|
2011-07-23 17:27:18 +02:00
|
|
|
test ecx, 0x40000000
|
|
|
|
jz .pixloop1cont
|
|
|
|
push ecx
|
|
|
|
mov ecx, [esp+4+20h+20h] ; original eax?
|
|
|
|
call [putpixel]
|
|
|
|
pop ecx
|
2010-06-25 18:47:51 +02:00
|
|
|
.pixloop1cont:
|
2011-07-23 17:27:18 +02:00
|
|
|
inc eax
|
|
|
|
jmp .pixloop1
|
2010-06-25 18:47:51 +02:00
|
|
|
.pixloop1end:
|
2011-07-23 17:27:18 +02:00
|
|
|
sub eax, 6
|
|
|
|
inc ebx
|
|
|
|
inc ebp
|
|
|
|
dec esi
|
|
|
|
jnz .symloop1
|
|
|
|
popad
|
|
|
|
add eax, 6
|
|
|
|
jmp .loop
|
2010-06-25 18:47:51 +02:00
|
|
|
.font2:
|
2011-07-23 17:27:18 +02:00
|
|
|
add edx, edx
|
|
|
|
lea ebp, [FONT_II+4*edx+edx+1]
|
|
|
|
push 9
|
|
|
|
movzx esi, byte [ebp-1]
|
2010-06-25 18:47:51 +02:00
|
|
|
.symloop2:
|
2011-07-23 17:27:18 +02:00
|
|
|
mov dl, byte [ebp]
|
|
|
|
push esi
|
2010-06-25 18:47:51 +02:00
|
|
|
.pixloop2:
|
2011-07-23 17:27:18 +02:00
|
|
|
shr dl, 1
|
|
|
|
jnc .nopix2
|
|
|
|
call [putpixel]
|
|
|
|
jmp .pixloop2cont
|
2010-06-25 18:47:51 +02:00
|
|
|
.nopix2:
|
2011-07-23 17:27:18 +02:00
|
|
|
test ecx, 0x40000000
|
|
|
|
jz .pixloop2cont
|
|
|
|
push ecx
|
|
|
|
mov ecx, [esp+12+20h+20h]
|
|
|
|
call [putpixel]
|
|
|
|
pop ecx
|
2010-06-25 18:47:51 +02:00
|
|
|
.pixloop2cont:
|
2011-07-23 17:27:18 +02:00
|
|
|
inc eax
|
|
|
|
dec esi
|
|
|
|
jnz .pixloop2
|
|
|
|
pop esi
|
|
|
|
sub eax, esi
|
|
|
|
inc ebx
|
|
|
|
inc ebp
|
|
|
|
dec dword [esp]
|
|
|
|
jnz .symloop2
|
|
|
|
pop eax
|
|
|
|
add dword [esp+28], esi
|
|
|
|
popad
|
|
|
|
jmp .loop
|
2010-06-25 18:47:51 +02:00
|
|
|
.end:
|
2011-07-23 17:27:18 +02:00
|
|
|
popad
|
|
|
|
pop eax ; << // Alver 22.06.2008 // <<
|
|
|
|
ret
|
2011-11-26 02:25:06 +01:00
|
|
|
|
2011-11-29 10:40:16 +01:00
|
|
|
diff10 "old font code size",dtext,$
|
|
|
|
|
2011-11-26 02:25:06 +01:00
|
|
|
;=====================================================
|
|
|
|
; NEW FONTS
|
|
|
|
;_____________________________________________________
|
|
|
|
;
|
|
|
|
|
|
|
|
align 8
|
|
|
|
sdsh_data:
|
|
|
|
|
2011-11-29 10:40:16 +01:00
|
|
|
include 'fonts/sd_data.asm'
|
2011-11-26 02:25:06 +01:00
|
|
|
|
|
|
|
sdsh_code:
|
|
|
|
|
|
|
|
; eax = if (bit[31])
|
|
|
|
; then lower 31 bits points to the user-selected font
|
|
|
|
; else ax = number of preloaded system font
|
|
|
|
; ebx = x<<16 + y
|
|
|
|
; ecx = 0x00RRGGBB
|
|
|
|
; edx = if (bits[31:8] == 0)
|
|
|
|
; then dl = single char to write
|
|
|
|
; else edx= pointer to asciiz-string
|
|
|
|
|
2011-11-29 10:40:16 +01:00
|
|
|
draw_char:
|
|
|
|
; font test
|
|
|
|
; bl=y; bh=x
|
|
|
|
; dl=ascii
|
|
|
|
movzx eax, bh
|
|
|
|
movzx ebx, bl
|
|
|
|
movzx ecx, dl
|
|
|
|
xor edi, edi
|
|
|
|
mov ebp, edi
|
|
|
|
|
2011-11-26 02:25:06 +01:00
|
|
|
sdsh_draw_char:
|
|
|
|
; eax = left side X
|
|
|
|
; ebx = bottom Y
|
|
|
|
; edi = color 0x0RRGGBB
|
|
|
|
; ebp = font@
|
|
|
|
; ecx = ascii, zero-extended to 32bits
|
2011-11-29 10:40:16 +01:00
|
|
|
push ecx
|
|
|
|
push edx
|
|
|
|
push ebp
|
2011-11-26 02:25:06 +01:00
|
|
|
shl ebp, 4
|
|
|
|
add ebp, sdsh_data.info
|
|
|
|
call ch_checkscreen
|
|
|
|
jb .exit
|
|
|
|
call ch_checkwin
|
|
|
|
jc .exit
|
|
|
|
xor ch, ch
|
|
|
|
mov edx, [ebp + 4] ; chartable addr
|
|
|
|
mov cx, word[edx + ecx*2] ; tick info
|
|
|
|
mov edx, ecx
|
2011-11-28 02:09:32 +01:00
|
|
|
and ecx, 7 ; cl = number of ticks
|
2011-11-26 02:25:06 +01:00
|
|
|
jz .blank
|
|
|
|
shr edx, 4 ; offset in the chartable
|
|
|
|
add edx, [sdsh_data.chars] ; edx -> the char's ticklist
|
|
|
|
.next_tick:
|
|
|
|
call parse_tick
|
|
|
|
add edx, 4
|
|
|
|
dec cl
|
|
|
|
jnz .next_tick
|
|
|
|
.blank:
|
|
|
|
.exit:
|
2011-11-29 10:40:16 +01:00
|
|
|
pop ebp
|
|
|
|
pop edx
|
|
|
|
pop ecx
|
2011-11-26 02:25:06 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
parse_tick:
|
|
|
|
; eax = left side X
|
|
|
|
; ebx = bottom Y
|
|
|
|
; edx ->tickinfo
|
|
|
|
; edi = color 0x0RRGGBB
|
|
|
|
; ebp = font's header
|
2011-11-28 02:09:32 +01:00
|
|
|
pushad
|
2011-11-26 02:25:06 +01:00
|
|
|
xor ecx, ecx
|
|
|
|
mov dx, word[edx]
|
|
|
|
mov cl, dl
|
|
|
|
test dl, 0xE0 ; ticks #32..255
|
|
|
|
jz .lntick.short
|
|
|
|
cmp dl, 0xE0
|
|
|
|
jae .lntick.long
|
|
|
|
cmp dl, 0xC0
|
|
|
|
jae .cstick
|
|
|
|
.gptick:
|
2011-11-28 02:09:32 +01:00
|
|
|
push edx
|
|
|
|
mov cl, dh
|
|
|
|
shr cl, 3 ; orig.#
|
|
|
|
mov edx, [ebp+8] ; orig. table
|
|
|
|
mov ch, byte[edx+ecx] ; orig. coords
|
|
|
|
pop edx
|
|
|
|
mov cl, dh
|
2011-11-28 22:26:53 +01:00
|
|
|
and cl, 7 ; three rotation bits
|
|
|
|
and edx, 0xFF ; dl = gptick#
|
2011-11-28 02:09:32 +01:00
|
|
|
sub dl, 32
|
2011-11-28 22:26:53 +01:00
|
|
|
cmp dl, (sdsh_data.v5-sdsh_data.v1)
|
2011-11-28 02:09:32 +01:00
|
|
|
jae .gptick.2
|
|
|
|
.gptick.1:
|
|
|
|
mov esi, sdsh_data.tick_table
|
2011-11-28 22:26:53 +01:00
|
|
|
add esi, edx ; 1-byte tickgroups .v1-v4:
|
2011-11-28 02:09:32 +01:00
|
|
|
inc dh
|
2011-11-28 22:26:53 +01:00
|
|
|
sub dl, 2 ; .v1 : 2 ticks only (#32, 33)
|
|
|
|
jae @f
|
|
|
|
mov dl, dh
|
|
|
|
jmp .gptick.done
|
|
|
|
@@: inc dh
|
|
|
|
shr dl, 3 ; tickgroups .v2-v4 : 8 ticks each
|
|
|
|
add dl, dh
|
|
|
|
jmp .gptick.done
|
2011-11-28 02:09:32 +01:00
|
|
|
.gptick.2:
|
|
|
|
sub dl, (sdsh_data.v5-sdsh_data.v1)
|
2011-11-28 22:26:53 +01:00
|
|
|
cmp dl, (sdsh_data.v9-sdsh_data.v5)
|
2011-11-28 02:09:32 +01:00
|
|
|
jae .gptick.3
|
|
|
|
mov esi, sdsh_data.v5
|
2011-11-28 22:26:53 +01:00
|
|
|
lea esi, [esi+edx*2] ; 2-byte tickgroups .v5-v8: 8 ticks each
|
2011-11-28 02:09:32 +01:00
|
|
|
mov dh, 5
|
2011-11-28 22:26:53 +01:00
|
|
|
shr dl, 3
|
|
|
|
add dl, dh
|
|
|
|
jmp .gptick.done
|
2011-11-28 02:09:32 +01:00
|
|
|
.gptick.3:
|
|
|
|
sub dl, (sdsh_data.v9-sdsh_data.v5)
|
2011-11-28 22:26:53 +01:00
|
|
|
cmp dl, (sdsh_data.v13-sdsh_data.v9)
|
2011-11-28 02:09:32 +01:00
|
|
|
jae .gptick.4
|
|
|
|
mov esi, sdsh_data.v9
|
2011-11-29 10:40:16 +01:00
|
|
|
lea esi,[esi+edx*2]
|
|
|
|
add esi, edx ; 3-byte tickgroups .v9-12: 4 ticks each
|
2011-11-28 02:09:32 +01:00
|
|
|
mov dh, 9
|
2011-11-28 22:26:53 +01:00
|
|
|
shr dl, 2
|
|
|
|
add dl, dh
|
|
|
|
jmp .gptick.done
|
2011-11-28 02:09:32 +01:00
|
|
|
.gptick.4:
|
|
|
|
sub dl, (sdsh_data.v13-sdsh_data.v9)
|
2011-11-28 22:26:53 +01:00
|
|
|
cmp dl, 16
|
|
|
|
jae .exit
|
2011-11-28 02:09:32 +01:00
|
|
|
mov esi, sdsh_data.v13
|
2011-11-28 22:26:53 +01:00
|
|
|
lea esi,[esi+edx*4] ; 4-byte tickgroups .v13-16: 4 ticks each
|
2011-11-28 02:09:32 +01:00
|
|
|
mov dh, 13
|
2011-11-28 22:26:53 +01:00
|
|
|
shr dl, 2
|
|
|
|
add dl, dh
|
2011-11-28 02:09:32 +01:00
|
|
|
.gptick.done:
|
2011-11-28 22:26:53 +01:00
|
|
|
mov dh, ch ; dh = orig.XY; dl = numvert
|
|
|
|
jmp .draw ; cl = rotation
|
2011-11-26 02:25:06 +01:00
|
|
|
|
|
|
|
.cstick:
|
|
|
|
and cl, 4
|
2011-11-28 22:26:53 +01:00
|
|
|
shr cl, 2 ; only one rotational bit
|
2011-11-26 02:25:06 +01:00
|
|
|
and dl, 3
|
2011-11-28 22:26:53 +01:00
|
|
|
inc dl
|
2011-11-26 02:25:06 +01:00
|
|
|
dec dl
|
2011-11-28 22:26:53 +01:00
|
|
|
jz .cstick.0
|
2011-11-26 02:25:06 +01:00
|
|
|
dec dl
|
2011-11-28 22:26:53 +01:00
|
|
|
jnz @f
|
|
|
|
mov dl, 6
|
|
|
|
jz .cstick.1
|
|
|
|
@@: dec dl
|
|
|
|
jz .cstick.2
|
2011-11-26 02:25:06 +01:00
|
|
|
.cstick.3:
|
2011-11-28 22:26:53 +01:00
|
|
|
mov esi, sdsh_data.cs3 ; 12pix-ring
|
2011-11-26 02:25:06 +01:00
|
|
|
mov dl, 10
|
|
|
|
jmp .draw
|
|
|
|
.cstick.2:
|
|
|
|
mov dl, 7
|
|
|
|
.cstick.1:
|
2011-11-28 22:26:53 +01:00
|
|
|
mov esi, sdsh_data.cs2 ; the square
|
2011-11-26 02:25:06 +01:00
|
|
|
jmp .draw
|
2011-11-28 22:26:53 +01:00
|
|
|
.cstick.0:
|
|
|
|
mov esi, sdsh_data.cs0 ; 4pix-square
|
2011-11-26 02:25:06 +01:00
|
|
|
mov dl, 3
|
|
|
|
jmp .draw
|
|
|
|
|
|
|
|
.ritick:
|
|
|
|
test dl, 1
|
|
|
|
jnz .ritick.1
|
|
|
|
.ritick.0:
|
|
|
|
mov cl, dh ; y
|
|
|
|
and cl, 0x0F
|
2011-11-28 02:09:32 +01:00
|
|
|
sub ebx, ecx
|
2011-11-26 02:25:06 +01:00
|
|
|
mov cl, dh
|
|
|
|
shr cl, 4 ; x
|
2011-11-28 02:09:32 +01:00
|
|
|
add eax, ecx
|
2011-11-26 02:25:06 +01:00
|
|
|
call ch_putpixel
|
|
|
|
jmp .exit
|
|
|
|
.ritick.1:
|
|
|
|
mov esi, sdsh_data.ri1 ; 8pix-ring
|
|
|
|
mov dl, 4
|
2011-11-28 02:09:32 +01:00
|
|
|
xor cl, cl
|
2011-11-26 02:25:06 +01:00
|
|
|
jmp .draw
|
|
|
|
|
|
|
|
.lntick.short:
|
|
|
|
test dl, 0x06 ; ticks #0, 1 are reserved for
|
|
|
|
jz .ritick ; rotational invariants
|
|
|
|
and dl, 0x07 ; dl = line length
|
|
|
|
jmp .lntick.both
|
|
|
|
.lntick.long:
|
|
|
|
and dl, 0x07
|
|
|
|
add dl, 8
|
|
|
|
.lntick.both:
|
|
|
|
sub dl, 2 ; num_vertice = num_points - 2
|
|
|
|
and cl, 0x18 ; two rotation bits
|
|
|
|
shr cl, 3
|
|
|
|
mov esi, sdsh_data.blank
|
|
|
|
.draw:
|
2011-11-28 02:09:32 +01:00
|
|
|
; cl = rot; dl = numvert; dh = orig.xy
|
2011-11-26 02:25:06 +01:00
|
|
|
push ecx
|
|
|
|
mov cl, dh ; y
|
|
|
|
and cl, 0x0F
|
2011-11-28 02:09:32 +01:00
|
|
|
sub ebx, ecx
|
2011-11-26 02:25:06 +01:00
|
|
|
mov cl, dh
|
|
|
|
shr cl, 4 ; x
|
2011-11-28 02:09:32 +01:00
|
|
|
add eax, ecx
|
2011-11-26 02:25:06 +01:00
|
|
|
pop ecx
|
|
|
|
call draw_tick
|
2011-11-28 02:09:32 +01:00
|
|
|
.gptick.5:
|
2011-11-26 02:25:06 +01:00
|
|
|
.exit:
|
|
|
|
popad
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_tick:
|
|
|
|
; eax = x-origin
|
|
|
|
; ebx = y-origin
|
|
|
|
; edi = 0x0RRGGBB
|
|
|
|
; cl = direction (0..7)
|
2011-11-28 02:09:32 +01:00
|
|
|
; dl = number of vertices (dl)
|
|
|
|
; esi -> tick bitfield
|
2011-11-26 02:25:06 +01:00
|
|
|
|
|
|
|
pushad
|
2011-11-28 02:09:32 +01:00
|
|
|
inc dl ; -- that's to count down to 0
|
|
|
|
call ch_putpixel ; the point of origin
|
|
|
|
and ecx, 7
|
|
|
|
call [.moves + ecx*4] ; basic vector
|
|
|
|
call ch_putpixel
|
|
|
|
dec dl
|
|
|
|
jz .done ; 2pix lines only
|
|
|
|
mov esi, dword [esi] ; max 16 vertice bitfield limit
|
|
|
|
xchg esi, edx
|
2011-11-26 02:25:06 +01:00
|
|
|
.move_and_draw:
|
2011-11-28 02:09:32 +01:00
|
|
|
mov ch, dl
|
|
|
|
and ch, 3
|
|
|
|
jz .moved
|
2011-11-29 10:40:16 +01:00
|
|
|
btc ecx, 8
|
2011-11-28 02:09:32 +01:00
|
|
|
jz .2
|
|
|
|
.1:
|
|
|
|
dec cl ; right turns (1 and 3)
|
|
|
|
and cl, 7
|
2011-11-29 10:40:16 +01:00
|
|
|
@@: btc ecx, 9 ; straight angle (3) ?
|
2011-11-28 02:09:32 +01:00
|
|
|
jc .1
|
|
|
|
jmp .moved
|
|
|
|
.2:
|
|
|
|
inc cl ; left turn (2)
|
|
|
|
and cl, 7
|
2011-11-29 10:40:16 +01:00
|
|
|
btc ecx, 9 ; just to zero ah
|
2011-11-28 02:09:32 +01:00
|
|
|
.moved:
|
|
|
|
call [.moves + ecx*4] ; go new way
|
|
|
|
call ch_putpixel
|
|
|
|
shr edx, 2
|
|
|
|
dec esi
|
|
|
|
jnz .move_and_draw
|
2011-11-26 02:25:06 +01:00
|
|
|
.done:
|
|
|
|
popad
|
|
|
|
ret
|
|
|
|
|
|
|
|
.move000:
|
|
|
|
inc eax
|
|
|
|
ret
|
|
|
|
.move001:
|
|
|
|
inc eax
|
2011-11-28 02:09:32 +01:00
|
|
|
dec ebx
|
2011-11-26 02:25:06 +01:00
|
|
|
ret
|
|
|
|
.move010:
|
2011-11-28 02:09:32 +01:00
|
|
|
dec ebx
|
2011-11-26 02:25:06 +01:00
|
|
|
ret
|
|
|
|
.move011:
|
|
|
|
dec eax
|
2011-11-28 02:09:32 +01:00
|
|
|
dec ebx
|
2011-11-26 02:25:06 +01:00
|
|
|
ret
|
2011-11-28 02:09:32 +01:00
|
|
|
.move100:
|
2011-11-26 02:25:06 +01:00
|
|
|
dec eax
|
|
|
|
ret
|
2011-11-28 02:09:32 +01:00
|
|
|
.move101:
|
2011-11-26 02:25:06 +01:00
|
|
|
dec eax
|
2011-11-28 02:09:32 +01:00
|
|
|
inc ebx
|
2011-11-26 02:25:06 +01:00
|
|
|
ret
|
2011-11-28 02:09:32 +01:00
|
|
|
.move110:
|
|
|
|
inc ebx
|
2011-11-26 02:25:06 +01:00
|
|
|
ret
|
2011-11-28 02:09:32 +01:00
|
|
|
.move111:
|
2011-11-26 02:25:06 +01:00
|
|
|
inc eax
|
2011-11-28 02:09:32 +01:00
|
|
|
inc ebx
|
2011-11-26 02:25:06 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
align 4
|
|
|
|
.moves dd .move000, .move001, .move010, .move011, .move100, .move101, .move110, .move111
|
|
|
|
|
|
|
|
;)
|
|
|
|
|
|
|
|
align 4
|
|
|
|
ch_checkscreen:
|
|
|
|
cmp [Screen_Max_X], eax
|
|
|
|
jb .getout
|
|
|
|
cmp [Screen_Max_Y], ebx
|
|
|
|
.getout:
|
|
|
|
ret
|
|
|
|
|
|
|
|
align 4
|
|
|
|
ch_checkwin:
|
|
|
|
; eax = x coordinate
|
|
|
|
; ebx = y coordinate
|
|
|
|
; ebp -> font info
|
|
|
|
;!destroys ch, edx!
|
2011-11-29 10:40:16 +01:00
|
|
|
push eax
|
|
|
|
push ebx
|
2011-11-26 02:25:06 +01:00
|
|
|
mov ch, byte[CURRENT_TASK]
|
|
|
|
mov al, byte [ebp] ; char X-width
|
|
|
|
mov edx, [_display.width] ; screen X-size
|
|
|
|
imul edx, ebx
|
|
|
|
add edx, [_WinMapAddress]
|
|
|
|
add edx, eax
|
|
|
|
cmp ch, byte [edx]
|
|
|
|
jne .fail
|
2011-11-29 10:40:16 +01:00
|
|
|
movzx eax, byte [ebp]
|
2011-11-26 02:25:06 +01:00
|
|
|
cmp ch, byte [edx+eax]
|
|
|
|
jne .fail
|
2011-11-29 10:40:16 +01:00
|
|
|
movzx ebx, byte [ebp+1]
|
2011-11-26 02:25:06 +01:00
|
|
|
imul ebx, [_display.width]
|
|
|
|
cmp ch, byte [edx+ebx]
|
|
|
|
jne .fail
|
|
|
|
add edx, eax
|
|
|
|
cmp ch, byte [edx+ebx]
|
|
|
|
clc
|
|
|
|
je .done
|
|
|
|
.fail:
|
|
|
|
stc ; CF means the charbox is invisible
|
|
|
|
.done:
|
2011-11-29 10:40:16 +01:00
|
|
|
pop ebx
|
|
|
|
pop eax
|
2011-11-26 02:25:06 +01:00
|
|
|
ret
|
|
|
|
|
|
|
|
align 4
|
|
|
|
ch_putpixel:
|
|
|
|
; eax = x coordinate
|
|
|
|
; ebx = y coordinate
|
|
|
|
; edi = 0x0RRGGBB
|
|
|
|
push edx
|
|
|
|
mov edx, ebx
|
|
|
|
imul edx, [BytesPerScanLine]
|
|
|
|
lea edx, [edx+eax*4]
|
|
|
|
mov [LFB_BASE+edx], edi
|
2011-11-29 10:40:16 +01:00
|
|
|
pop edx
|
2011-11-26 02:25:06 +01:00
|
|
|
ret
|
|
|
|
;)
|
|
|
|
|
2011-11-29 10:40:16 +01:00
|
|
|
|
|
|
|
diff10 "new font code size",sdsh_code,$
|