Subversion Repositories Kolibri OS

Rev

Rev 7524 | Rev 7526 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7524 Rev 7525
Line 7... Line 7...
7
include '../../../proc32.inc'
7
include '../../../proc32.inc'
8
include '../../../KOSfuncs.inc'
8
include '../../../KOSfuncs.inc'
9
include '../../../load_img.inc'
9
include '../../../load_img.inc'
10
include '../../../develop/libraries/box_lib/load_lib.mac'
10
include '../../../develop/libraries/box_lib/load_lib.mac'
Line -... Line 11...
-
 
11
 
-
 
12
include 'lang.inc'
11
 
13
 
12
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
14
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
Line 13... Line 15...
13
hed db 'Life 03.11.18',0 ;¯®¤¯¨áì ®ª­ 
15
hed db 'Life 04.11.18',0 ;¯®¤¯¨áì ®ª­ 
14
 
16
 
Line -... Line 17...
-
 
17
run_file_70 FileInfoBlock
-
 
18
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
-
 
19
 
15
run_file_70 FileInfoBlock
20
ICONSIZE = 21
16
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
21
TBTNSIZE = ICONSIZE-2
Line 17... Line 22...
17
 
22
 
18
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
23
IMAGE_TOOLBAR_ICON_SIZE equ ICONSIZE*ICONSIZE*3
Line 49... Line 54...
49
Cor_y dd 0
54
Cor_y dd 0
50
tim dd 0 ;¢à¥¬ï (¯®ª®«¥­¨¥)
55
tim dd 0 ;¢à¥¬ï (¯®ª®«¥­¨¥)
51
b_sort dd 0 ;£à ­¨æ  ¤«ï á®àâ¨à®¢ ­­ëå ï祥ª
56
b_sort dd 0 ;£à ­¨æ  ¤«ï á®àâ¨à®¢ ­­ëå ï祥ª
52
osob dd 0 ;ç¨á«® ®á®¡¥©
57
osob dd 0 ;ç¨á«® ®á®¡¥©
53
zoom db 3 ;¬ áèâ ¡ ¯®«ï
58
zoom db 3 ;¬ áèâ ¡ ¯®«ï
-
 
59
 
-
 
60
if lang eq ru
54
txt_zoom db 'Œ áèâ ¡:',0
61
txt_zoom db '   Œ áèâ ¡:',0
55
txt_gen db '®ª®«¥­¨¥:',0
62
txt_gen db '  ®ª®«¥­¨¥:',0
56
txt_osob db 'Žá®¡¥©:',0
63
txt_osob db '    Žá®¡¥©:',0
-
 
64
else
-
 
65
txt_zoom db '      Zoom:',0
-
 
66
txt_gen db  'Generation:',0
-
 
67
txt_osob db 'Population:',0
-
 
68
end if
Line 57... Line 69...
57
 
69
 
58
;­ áâனª  ¬ áᨢ  á 梥⠬¨
70
;­ áâனª  ¬ áᨢ  á 梥⠬¨
59
; col_pole - 梥⠯®«ï
71
; col_pole - 梥⠯®«ï
60
; col_cell_n - 梥⠭®¢®© ï祩ª¨
72
; col_cell_n - 梥⠭®¢®© ï祩ª¨
Line 813... Line 825...
813
	mov [cell],eax
825
	mov [cell],eax
814
	stdcall mem.Alloc,MAX_CELL*4
826
	stdcall mem.Alloc,MAX_CELL*4
815
	mov [memCell],eax
827
	mov [memCell],eax
816
	stdcall mem.Alloc,(COL_MEM+1)*4
828
	stdcall mem.Alloc,(COL_MEM+1)*4
817
	mov [CellColors],eax
829
	mov [CellColors],eax
818
	include_image_file 'toolbar.png', image_data_toolbar
830
	include_image_file 'life3tb.png', image_data_toolbar
Line 819... Line 831...
819
 
831
 
820
	;­ áâனª  梥⮢ ï祥ª
832
	;­ áâனª  梥⮢ ï祥ª
821
	stdcall pole_init_colors, 0xffffd0,0xff0000,0x0000ff
833
	stdcall pole_init_colors, 0xffffd0,0xff0000,0x0000ff
822
	call pole_clear
834
	call pole_clear
Line 964... Line 976...
964
 
976
 
965
align 4
977
align 4
966
draw_window:
978
draw_window:
967
pushad
979
pushad
968
	mcall SF_REDRAW,SSF_BEGIN_DRAW
-
 
969
	mov edx,[sc.work]
-
 
970
	or  edx,0x33000000
-
 
971
	mov edi,hed
980
	mcall SF_REDRAW,SSF_BEGIN_DRAW
Line 972... Line 981...
972
	mcall SF_CREATE_WINDOW,(20 shl 16)+485,(20 shl 16)+415
981
	mcall SF_CREATE_WINDOW,(50 shl 16)+485,(50 shl 16)+415,0x73000000,0,hed
973
 
982
 
974
	mcall SF_THREAD_INFO,procinfo,-1
983
	mcall SF_THREAD_INFO,procinfo,-1
975
	mov eax,[procinfo.box.height]
984
	mov eax,[procinfo.box.height]
Line 993... Line 1002...
993
		stdcall [buf2d_resize], buf_0, ebx,eax,1
1002
		stdcall [buf2d_resize], buf_0, ebx,eax,1
994
		stdcall [buf2d_clear], buf_0, [buf_0.color]
1003
		stdcall [buf2d_clear], buf_0, [buf_0.color]
995
		call pole_paint
1004
		call pole_paint
996
	.end0:
1005
	.end0:
Line 997... Line 1006...
997
 
1006
	
998
	mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3, [sc.work_button]
-
 
999
 
1007
	mov edx,[sc.work]
1000
	mov ebx,(30 shl 16)+20
1008
	mov ebx, 0 shl 16
1001
	mov edx,4
1009
	add ebx, [buf_0.w]
Line 1002... Line 1010...
1002
	int 0x40
1010
	mcall SF_DRAW_RECT,,<0,35>
1003
 
-
 
1004
	mov ebx,(55 shl 16)+20
-
 
Line 1005... Line 1011...
1005
	mov edx,5
1011
 
1006
	int 0x40
1012
	mcall SF_DEFINE_BUTTON,(6 shl 16)+TBTNSIZE,(6 shl 16)+TBTNSIZE,4+0x40000000, [sc.work_button]
1007
 
1013
 
Line 1008... Line 1014...
1008
	mov ebx,(85 shl 16)+20
1014
	mov ebx,(36 shl 16)+TBTNSIZE
1009
	mov edx,6
1015
	mov edx,6+0x40000000
1010
	int 0x40
1016
	int 0x40
Line 1011... Line 1017...
1011
 
1017
 
1012
	mov ebx,(110 shl 16)+20
1018
	mov ebx,(61 shl 16)+TBTNSIZE
1013
	mov edx,7
1019
	mov edx,7+0x40000000
Line 1014... Line 1020...
1014
	int 0x40
1020
	int 0x40
1015
 
1021
 
1016
	mov ebx,(135 shl 16)+20
1022
	mov ebx,(86 shl 16)+TBTNSIZE
Line 1017... Line 1023...
1017
	mov edx,8
1023
	mov edx,8+0x40000000
1018
	int 0x40
1024
	int 0x40
1019
 
1025
 
Line 1020... Line 1026...
1020
	mov ebx,(165 shl 16)+20
1026
	mov ebx,(116 shl 16)+TBTNSIZE
1021
	mov edx,9
1027
	mov edx,9+0x40000000
1022
	int 0x40
1028
	int 0x40
Line 1023... Line 1029...
1023
 
1029
 
1024
	mov ebx,(190 shl 16)+20
1030
	mov ebx,(141 shl 16)+TBTNSIZE
1025
	mov edx,10
1031
	mov edx,10+0x40000000
Line 1026... Line 1032...
1026
	int 0x40
1032
	int 0x40
1027
 
1033
 
1028
	mov ebx,(220 shl 16)+20
1034
	mov ebx,(171 shl 16)+TBTNSIZE
Line 1029... Line 1035...
1029
	mov edx,11
1035
	mov edx,11+0x40000000
1030
	int 0x40
1036
	int 0x40
1031
 
1037
 
Line 1032... Line 1038...
1032
	mov ebx,(245 shl 16)+20
1038
	mov ebx,(196 shl 16)+TBTNSIZE
Line 1033... Line 1039...
1033
	mov edx,12
1039
	mov edx,12+0x40000000
1034
	int 0x40
1040
	int 0x40
1035
 
1041
 
1036
	mov ebx,(270 shl 16)+20
-
 
1037
	mov edx,13
1042
	mov ebx,(221 shl 16)+TBTNSIZE
1038
	int 0x40
1043
	mov edx,13+0x40000000
1039
 
1044
	int 0x40
1040
	mov ebx,(295 shl 16)+20
1045
 
1041
	mov edx,14
1046
	mov ebx,(246 shl 16)+TBTNSIZE
1042
	int 0x40
1047
	mov edx,14+0x40000000
Line 1043... Line 1048...
1043
 
1048
	int 0x40
1044
	mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16,(32 shl 16)+7
1049
 
1045
 
1050
	mcall SF_PUT_IMAGE,[image_data_toolbar],(ICONSIZE shl 16)+ICONSIZE,(5 shl 16)+5
1046
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1051
 
1047
	mov edx,(87 shl 16)+7 ;run once
1052
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1048
	int 0x40
1053
	mov edx,(35 shl 16)+5 ;run once
Line 1049... Line 1054...
1049
 
1054
	int 0x40
1050
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1055
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1051
	mov edx,(112 shl 16)+7 ;run auto
1056
	mov edx,(60 shl 16)+5 ;run auto
1052
	int 0x40
1057
	int 0x40	
1053
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1058
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1054
	mov edx,(137 shl 16)+7 ;stop
1059
	mov edx,(85 shl 16)+5 ;stop
1055
	int 0x40
1060
	int 0x40
1056
 
1061
 
1057
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1062
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1058
	mov edx,(167 shl 16)+7 ;-
1063
	mov edx,(115 shl 16)+5 ;-
1059
	int 0x40
1064
	int 0x40
1060
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1065
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
Line 1061... Line 1066...
1061
	mov edx,(192 shl 16)+7 ;+
1066
	mov edx,(140 shl 16)+5 ;+
1062
	int 0x40
-
 
1063
 
1067
	int 0x40
1064
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1068
 
1065
	mov edx,(222 shl 16)+7 ;move up
1069
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1066
	int 0x40
1070
	mov edx,(170 shl 16)+5 ;move up
1067
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1071
	int 0x40
Line 1068... Line -...
1068
	mov edx,(247 shl 16)+7 ;move doun
-
 
1069
	int 0x40
-
 
1070
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1072
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1071
	mov edx,(272 shl 16)+7 ;move left
1073
	mov edx,(195 shl 16)+5 ;move doun
1072
	int 0x40
1074
	int 0x40
1073
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1075
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
1074
	mov edx,(297 shl 16)+7 ;move up
1076
	mov edx,(220 shl 16)+5 ;move left
1075
	int 0x40
1077
	int 0x40
1076
 
1078
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
Line 1096... Line 1098...
1096
	int 0x40
1098
	int 0x40
1097
	add bx,9
1099
	add bx,9
1098
	mov edx,txt_osob
1100
	mov edx,txt_osob
1099
	int 0x40
1101
	int 0x40
Line -... Line 1102...
-
 
1102
	
-
 
1103
	call draw_pok
-
 
1104
 
-
 
1105
	stdcall [buf2d_draw], buf_0
-
 
1106
 
-
 
1107
	mcall SF_REDRAW,SSF_END_DRAW
-
 
1108
popad
-
 
1109
	ret
-
 
1110
 
-
 
1111
align 4
1100
 
1112
draw_pok:
1101
	mov eax,SF_DRAW_NUMBER
1113
	mov eax,SF_DRAW_NUMBER
1102
	movzx ecx,byte[zoom]
1114
	movzx ecx,byte[zoom]
1103
	mov ebx,(2 shl 16)
1115
	mov ebx,(2 shl 16)
1104
	mov edx,(325+6*9)*65536+5
1116
	mov edx,(295+8*9)*65536+5
1105
	mov esi,[sc.work_button_text]
1117
	mov esi,[sc.work_text]
1106
	or  esi,(1 shl 30)
1118
	or  esi,(1 shl 30)
1107
	mov edi,[sc.work_button]
1119
	mov edi,[sc.work]
1108
	int 0x40 ;¬ áèâ ¡
1120
	int 0x40 ;¬ áèâ ¡
1109
	mov ebx,(5 shl 16)
1121
	mov ebx,(5 shl 16)
1110
	mov ecx,[tim]
1122
	mov ecx,[tim]
1111
	add edx,(6*2)*65536+9
1123
	add edx,9
1112
	int 0x40 ;¢à¥¬ï
1124
	int 0x40 ;¢à¥¬ï
1113
	mov ebx,(5 shl 16)
1125
	mov ebx,(5 shl 16)
1114
	mov ecx,[osob]
1126
	mov ecx,[osob]
1115
	add edx,(6*0)*65536+9
1127
	add edx,9
1116
	int 0x40 ;¯®¯ã«ïæ¨ï
1128
	int 0x40 ;¯®¯ã«ïæ¨ï
Line 1117... Line 1129...
1117
	ret
1129
	ret
1118
 
1130