forked from KolibriOS/kolibrios
movback&plasma: calculate window height using 48.4; use sysfn 65 for 8bpp
git-svn-id: svn://kolibrios.org@2597 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
d34d5f098c
commit
03998632b5
@ -37,11 +37,8 @@ CODE
|
|||||||
add word [ver_counter],VC_DELTA
|
add word [ver_counter],VC_DELTA
|
||||||
add word [hor_counter],HC_DELTA
|
add word [hor_counter],HC_DELTA
|
||||||
call handle_animation
|
call handle_animation
|
||||||
mov eax,7
|
xor ebp,ebp
|
||||||
mov ebx,virtual_screen_32
|
mcall 65,virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,<0,0>,8,_palette
|
||||||
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
|
|
||||||
xor edx,edx
|
|
||||||
mcall
|
|
||||||
jmp .event_loop
|
jmp .event_loop
|
||||||
|
|
||||||
.paint_window:
|
.paint_window:
|
||||||
@ -50,21 +47,16 @@ CODE
|
|||||||
mov ebx,1
|
mov ebx,1
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
xor eax,eax
|
mcall 48,4 ; get skin height
|
||||||
mov ebx,(100 shl 16)+(WND_SIZE_X+9)
|
lea ecx,[eax + (100 shl 16) + WND_SIZE_Y+4]
|
||||||
mov ecx,(100 shl 16)+(WND_SIZE_Y+26)
|
|
||||||
mov edx,0x74000000
|
|
||||||
mov edi,title
|
mov edi,title
|
||||||
mcall
|
mcall 0,<100,WND_SIZE_X+9>,,0x74000000
|
||||||
|
|
||||||
test [proc_info.wnd_state], 0x04
|
test [proc_info.wnd_state], 0x04
|
||||||
jnz @f
|
jnz @f
|
||||||
|
|
||||||
mov eax,7
|
xor ebp,ebp
|
||||||
mov ebx,virtual_screen_32
|
mcall 65,virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,<0,0>,8,_palette
|
||||||
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
|
|
||||||
xor edx,edx
|
|
||||||
mcall
|
|
||||||
@@:
|
@@:
|
||||||
mov eax,12
|
mov eax,12
|
||||||
mov ebx,2
|
mov ebx,2
|
||||||
@ -82,7 +74,7 @@ init_palette:
|
|||||||
stosb
|
stosb
|
||||||
stosb
|
stosb
|
||||||
stosb
|
stosb
|
||||||
inc edi
|
stosb
|
||||||
inc ah
|
inc ah
|
||||||
loop .next_pal
|
loop .next_pal
|
||||||
ret
|
ret
|
||||||
@ -136,7 +128,7 @@ handle_animation:
|
|||||||
add ebx,ebx
|
add ebx,ebx
|
||||||
mov ax,[sinetable+ebx]
|
mov ax,[sinetable+ebx]
|
||||||
mov [esp+s_OFFX],ax
|
mov [esp+s_OFFX],ax
|
||||||
mov edi,virtual_screen_32
|
mov edi,virtual_screen_8
|
||||||
mov edx,WND_SIZE_Y-1
|
mov edx,WND_SIZE_Y-1
|
||||||
.a_ver:
|
.a_ver:
|
||||||
mov ecx,WND_SIZE_X-1
|
mov ecx,WND_SIZE_X-1
|
||||||
@ -148,12 +140,7 @@ handle_animation:
|
|||||||
mov ax,[esp+s_OFFX]
|
mov ax,[esp+s_OFFX]
|
||||||
add ax,cx
|
add ax,cx
|
||||||
and eax,255
|
and eax,255
|
||||||
lea esi,[background+ebx+eax]
|
mov al,[background+ebx+eax]
|
||||||
mov al,[esi]
|
|
||||||
and eax,0xff
|
|
||||||
mov eax,[_palette+eax*4]
|
|
||||||
stosw
|
|
||||||
shr eax,16
|
|
||||||
stosb
|
stosb
|
||||||
dec ecx
|
dec ecx
|
||||||
jge .a_hor
|
jge .a_hor
|
||||||
@ -174,8 +161,8 @@ UDATA
|
|||||||
|
|
||||||
_palette: rd 256
|
_palette: rd 256
|
||||||
|
|
||||||
virtual_screen_32:
|
virtual_screen_8:
|
||||||
rb WND_SIZE_X*WND_SIZE_Y*3
|
rb WND_SIZE_X*WND_SIZE_Y
|
||||||
|
|
||||||
background:
|
background:
|
||||||
rb 256*256
|
rb 256*256
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
blit_8_to_32:
|
|
||||||
mov esi,virtual_screen_8 ; ESI=src
|
|
||||||
mov edi,virtual_screen_32 ; EDI=dst
|
|
||||||
mov ecx,WND_SIZE_X*WND_SIZE_Y ; ECX=size
|
|
||||||
.blit_next:
|
|
||||||
xor eax,eax ; EAX=byte to blit
|
|
||||||
mov al,[esi]
|
|
||||||
shl eax,2
|
|
||||||
mov eax,[_palette+eax]
|
|
||||||
mov [edi],ax
|
|
||||||
shr eax,16
|
|
||||||
mov [edi+2],al
|
|
||||||
inc esi
|
|
||||||
add edi,3
|
|
||||||
loop .blit_next
|
|
||||||
ret
|
|
@ -8,16 +8,12 @@ WND_SIZE_Y = 200
|
|||||||
MEOS_APP_START
|
MEOS_APP_START
|
||||||
CODE
|
CODE
|
||||||
fninit
|
fninit
|
||||||
mov al,40
|
mcall 40,101b
|
||||||
mov bl,101b
|
|
||||||
mcall
|
|
||||||
call init_palette
|
call init_palette
|
||||||
call init_texture
|
call init_texture
|
||||||
jmp .paint_window
|
jmp .paint_window
|
||||||
.event_loop:
|
.event_loop:
|
||||||
mov al,23
|
mcall 23,1
|
||||||
mov ebx,1
|
|
||||||
mcall
|
|
||||||
test eax,eax
|
test eax,eax
|
||||||
je .draw_screen
|
je .draw_screen
|
||||||
dec eax
|
dec eax
|
||||||
@ -27,38 +23,23 @@ CODE
|
|||||||
mcall
|
mcall
|
||||||
|
|
||||||
.draw_screen:
|
.draw_screen:
|
||||||
call blit_8_to_32
|
xor ebp,ebp
|
||||||
mov al,7
|
mcall 65,virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,0,8,_palette
|
||||||
mov ebx,virtual_screen_32
|
|
||||||
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
|
|
||||||
xor edx,edx
|
|
||||||
mcall
|
|
||||||
call rotate_pal
|
call rotate_pal
|
||||||
jmp .event_loop
|
jmp .event_loop
|
||||||
|
|
||||||
.paint_window:
|
.paint_window:
|
||||||
mov al,12
|
mcall 12,1
|
||||||
push eax
|
|
||||||
xor ebx,ebx
|
|
||||||
inc ebx
|
|
||||||
mcall
|
|
||||||
|
|
||||||
xor eax,eax
|
mcall 48,4 ; get skin height
|
||||||
mov ebx,(110 shl 16)+(WND_SIZE_X+9)
|
lea ecx,[eax + (110 shl 16) + WND_SIZE_Y + 4]
|
||||||
mov ecx,(110 shl 16)+(WND_SIZE_Y+26)
|
|
||||||
mov edx,0x74000000
|
|
||||||
mov edi,title
|
mov edi,title
|
||||||
mcall
|
mcall 0,<110,WND_SIZE_X+9>,,0x74000000
|
||||||
|
|
||||||
mov al,7
|
xor ebp,ebp
|
||||||
mov ebx,virtual_screen_32
|
mcall 65,virtual_screen_8,<WND_SIZE_X,WND_SIZE_Y>,0,8,_palette
|
||||||
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
|
|
||||||
xor edx,edx
|
|
||||||
mcall
|
|
||||||
|
|
||||||
pop eax
|
mcall 12,2
|
||||||
and ebx,2 ; bit 1 is set
|
|
||||||
mcall
|
|
||||||
|
|
||||||
jmp .event_loop
|
jmp .event_loop
|
||||||
|
|
||||||
@ -73,7 +54,7 @@ init_palette:
|
|||||||
xor al,al
|
xor al,al
|
||||||
stosb
|
stosb
|
||||||
stosb
|
stosb
|
||||||
inc edi
|
stosb
|
||||||
loop .color1
|
loop .color1
|
||||||
mov ecx,64
|
mov ecx,64
|
||||||
push ecx
|
push ecx
|
||||||
@ -85,8 +66,8 @@ init_palette:
|
|||||||
stosb
|
stosb
|
||||||
xor al,al
|
xor al,al
|
||||||
stosb
|
stosb
|
||||||
|
stosb
|
||||||
inc ah
|
inc ah
|
||||||
inc edi
|
|
||||||
loop .color2
|
loop .color2
|
||||||
pop ecx
|
pop ecx
|
||||||
push ecx
|
push ecx
|
||||||
@ -97,8 +78,9 @@ init_palette:
|
|||||||
stosb
|
stosb
|
||||||
mov al,ah
|
mov al,ah
|
||||||
stosb
|
stosb
|
||||||
|
mov al,0
|
||||||
|
stosb
|
||||||
inc ah
|
inc ah
|
||||||
inc edi
|
|
||||||
loop .color3
|
loop .color3
|
||||||
pop ecx
|
pop ecx
|
||||||
mov eax,0x003f3f3f
|
mov eax,0x003f3f3f
|
||||||
@ -156,8 +138,6 @@ rotate_pal:
|
|||||||
mov [_palette+1020],ebx
|
mov [_palette+1020],ebx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
include "graph8.inc"
|
|
||||||
|
|
||||||
DATA
|
DATA
|
||||||
_multiplier dd 63.5
|
_multiplier dd 63.5
|
||||||
|
|
||||||
@ -172,7 +152,4 @@ UDATA
|
|||||||
virtual_screen_8:
|
virtual_screen_8:
|
||||||
rb WND_SIZE_X*WND_SIZE_Y
|
rb WND_SIZE_X*WND_SIZE_Y
|
||||||
|
|
||||||
virtual_screen_32:
|
|
||||||
rb WND_SIZE_X*WND_SIZE_Y*3
|
|
||||||
|
|
||||||
MEOS_APP_END
|
MEOS_APP_END
|
||||||
|
Loading…
Reference in New Issue
Block a user