pic4: memory requirements reduced

git-svn-id: svn://kolibrios.org@1092 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2009-05-30 13:15:32 +00:00
parent 5cb7a30105
commit ade8b1b629

View File

@ -7,8 +7,8 @@
dd 0x01 ; version dd 0x01 ; version
dd START ; program start dd START ; program start
dd I_END ; image size dd I_END ; image size
dd 0x80000 ; reguired amount of memory dd mem ; reguired amount of memory
dd 0x80000 ; stack pointer dd mem ; stack pointer
dd I_Param,0 dd I_Param,0
include 'lang.inc' include 'lang.inc'
@ -114,8 +114,8 @@ OnBoot:
mcall mcall
mov ebx,5 mov ebx,5
mov ecx,0x40000 ; <<< 0x40000 for blue, 0x40000+1 for red, mov ecx,image + 0 ; <<< +0 for blue, +1 for red,
; <<< 0x40000+2 for green background at boot ; <<< +2 for green background at boot
mov edx,0 mov edx,0
mov esi,256*3*256 mov esi,256*3*256
mcall mcall
@ -131,32 +131,6 @@ OnBoot:
mcall mcall
set_picture:
mov eax,image+99-3*16
mov ebx,0x40000+255*3+255*3*256
newpix:
mov ecx,[eax]
mov [ebx],cx
shr ecx,16
mov [ebx+2],cl
add eax,3
sub ebx,3
cmp ebx,0x40002
jge newpix
ret
load_texture:
call gentexture
call set_picture
ret
; set background ; set background
bg: bg:
@ -233,6 +207,7 @@ bg4:
; * the closest point in 'ptarray'. * ; * the closest point in 'ptarray'. *
; ********************************************* ; *********************************************
load_texture:
gentexture: gentexture:
xor ecx,ecx ; ycounter xor ecx,ecx ; ycounter
@ -278,7 +253,7 @@ gentexture:
idiv edi idiv edi
pop edi pop edi
mov [image+51+edi],eax mov [image+edi],eax
add edi,3 add edi,3
add ebx,1 ; bounce x loop add ebx,1 ; bounce x loop
@ -311,7 +286,7 @@ wrappit:
draw_image: draw_image:
mov eax,7 mov eax,7
mov ebx,0x40000 mov ebx,image
mov ecx,256*65536+255 mov ecx,256*65536+255
mov edx,14*65536+40;55 mov edx,14*65536+40;55
mcall mcall
@ -530,85 +505,85 @@ arrays dd ptarray,ptarray2,ptarray3,ptarray4,ptarray5,ptarray6
ptarray: ptarray:
dd 150,50 dd 105,205
dd 120,30 dd 135,225
dd 44,180 dd 211,75
dd 50,66 dd 205,189
dd 27,6 dd 228,249
dd 95,212 dd 160,43
dd 128,177 dd 127,78
dd 201,212 dd 54,43
dd 172,201 dd 83,54
dd 250,100 dd 5,155
dd 24,221 dd 231,34
dd 11,123 dd 244,132
dd 248,32 dd 7,223
dd 34,21 dd 221,224
dd 777 ; <- end of array dd 777 ; <- end of array
ptarray2: ptarray2:
dd 0,0,50,50,100,100,150,150,200,200,250,250 dd 255,255,205,205,155,155,105,105,55,55,5,5
dd 50,150,150,50,200,100,100,200 dd 205,105,105,205,55,155,155,55
dd 777 dd 777
ptarray3: ptarray3:
dd 55,150,150,55,200,105,105,200 dd 200,105,105,200,55,150,150,55
dd 30,30,220,220 dd 225,225,35,35
dd 777 dd 777
ptarray4: ptarray4:
dd 196,0,196,64,196,128,196,196 dd 59,255,59,191,59,127,59,59
dd 64,32,64,96,64,150,64,228 dd 191,223,191,159,191,105,191,27
dd 777 dd 777
ptarray5: ptarray5:
dd 196,0,196,64,196,128,196,196 dd 59,255,59,191,59,127,59,59
dd 64,0,64,64,64,128,64,196 dd 191,255,191,191,191,127,191,59
dd 777 dd 777
ptarray6: ptarray6:
dd 49,49,128,50,210,50 dd 206,206,127,205,45,205
dd 50,128,128,128,210,128 dd 205,127,127,127,45,127
dd 50,210,128,210,210,210 dd 205,45,127,45,45,45
dd 777 dd 777
ptarray7: ptarray7:
dd 0,0 dd 255,255
dd 196,196,64,64 dd 59,59,191,191
dd 128,0 dd 127,255
dd 0,128 dd 255,127
dd 64,64,196,64 dd 191,191,59,191
dd 196,196,64,196 dd 59,59,191,59
dd 128,128 dd 127,127
dd 777 dd 777
ptarray8: ptarray8:
dd 0, 128 dd 255, 127
dd 0, 128 dd 255, 127
dd 128, 0 dd 127, 255
dd 0, 128 dd 255, 127
dd 128, 0 dd 127, 255
dd 0, 128 dd 255, 127
dd 128, 0 dd 127, 255
dd 0, 128 dd 255, 127
dd 128, 0 dd 127, 255
dd 128, 128 dd 127, 127
dd 777 dd 777
ptarray9: ptarray9:
dd 0,248,64,128,128,64,196,48,160,160,94,224,240,96,5,5,777 dd 255,7,191,127,127,191,59,207,95,95,161,31,15,159,250,250,777
I_END: I_END:
@ -617,4 +592,8 @@ sc system_colors
I_Param: I_Param:
image: image:
rb 256*256*3 + 4
align 100h
rb 100h ; it is enough for stack in this program
mem: