Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 2... Line 2...
2
;*GAME TANKS CRETED BY ANDREW_PROGRAMMER AKA ANDREY IGNATYEV*
2
;*GAME TANKS CRETED BY ANDREW_PROGRAMMER AKA ANDREY IGNATYEV*
3
;*********************/8/2005********************************
3
;*********************/8/2005********************************
4
use32
4
use32
5
org 0x0
5
org 0x0
6
include 'lang.inc'
6
include 'lang.inc'
-
 
7
include '..\..\..\macros.inc'
7
  db  'MENUET01'
8
  db  'MENUET01'
8
  dd  0x1
9
  dd  0x1
9
  dd  START
10
  dd  START
10
  dd  I_END
11
  dd  I_END
11
  dd  0x4000+640*400*3+50*20*20*3+512+640+1+24*20*20*3+1
12
  dd  0x4000+640*400*3+50*20*20*3+512+640+1+24*20*20*3+1
Line 13... Line 14...
13
  dd  0x0
14
  dd  0x0
14
  dd  0x0
15
  dd  0x0
15
START:
16
START:
16
   mov eax,40
17
   mov eax,40
17
   mov ebx,111b
18
   mov ebx,111b
18
   int 0x40
19
   mcall
19
;----------------------------------------------------------
20
;----------------------------------------------------------
20
;---------load all sprites from arrays to memory-----------
21
;---------load all sprites from arrays to memory-----------
21
;----------------------------------------------------------
22
;----------------------------------------------------------
22
   and [number_sprite],0
23
   and [number_sprite],0
23
   xor eax,eax
24
   xor eax,eax
Line 174... Line 175...
174
   jne @11
175
   jne @11
175
   mov eax,7
176
   mov eax,7
176
   mov ebx,0x4000
177
   mov ebx,0x4000
177
   mov ecx,640*65536+400
178
   mov ecx,640*65536+400
178
   mov edx,0*65536+20
179
   mov edx,0*65536+20
179
   int 0x40
180
   mcall
180
   call menu
181
   call menu
181
;----------------------------
182
;----------------------------
182
new_level:
183
new_level:
183
   call drawwin
184
   call drawwin
184
   mov [SpriteInfo+72+8],dword 100  ;Xo
185
   mov [SpriteInfo+72+8],dword 100  ;Xo
Line 275... Line 276...
275
	 mov [time_frame_old],ebx
276
	 mov [time_frame_old],ebx
276
	 mov eax,7
277
	 mov eax,7
277
	 mov ebx,0x4000
278
	 mov ebx,0x4000
278
	 mov ecx,640*65536+400
279
	 mov ecx,640*65536+400
279
	 mov edx,0*65536+20
280
	 mov edx,0*65536+20
280
	 int 0x40
281
	 mcall
281
	 NoPutScreen:
282
	 NoPutScreen:
282
	 ;put fon
283
	 ;put fon
283
	 mov eax,23*4
284
	 mov eax,23*4
284
	 PutFonForSprites:
285
	 PutFonForSprites:
285
	 mov ebx,[SpriteInfo+9*eax+4]
286
	 mov ebx,[SpriteInfo+9*eax+4]
Line 335... Line 336...
335
	 ;-------------------------------------------------
336
	 ;-------------------------------------------------
336
	 ;----------------keys-----------------------------
337
	 ;----------------keys-----------------------------
337
	 ;-------------------------------------------------
338
	 ;-------------------------------------------------
338
	 mov eax,23
339
	 mov eax,23
339
	 mov ebx,3
340
	 mov ebx,3
340
	 int 0x40
341
	 mcall
341
	 cmp eax,1
342
	 cmp eax,1
342
	 jne keypressed
343
	 jne keypressed
343
	 call drawwin
344
	 call drawwin
344
	 jmp action
345
	 jmp action
345
	 keypressed:
346
	 keypressed:
346
	 cmp eax,2
347
	 cmp eax,2
347
	 jne action
348
	 jne action
348
	 and [_dx],0
349
	 and [_dx],0
349
	 and [_dy],0
350
	 and [_dy],0
350
	 mov eax,2
351
	 mov eax,2
351
	 int 0x40
352
	 mcall
352
	 shr eax,8
353
	 shr eax,8
353
	 ;---------
354
	 ;---------
354
	 cmp eax,32
355
	 cmp eax,32
355
	 jne key2
356
	 jne key2
356
	 cmp [strike_action],0
357
	 cmp [strike_action],0
Line 419... Line 420...
419
	 mov [SpriteInfo+36+32],dword 5
420
	 mov [SpriteInfo+36+32],dword 5
420
	 jmp action
421
	 jmp action
421
    key6:cmp eax,27
422
    key6:cmp eax,27
422
	 jne action
423
	 jne action
423
	 mov eax,-1
424
	 mov eax,-1
424
	 int 0x40
425
	 mcall
425
action:
426
action:
426
	 mov [SpriteInfo+72+4],dword 1
427
	 mov [SpriteInfo+72+4],dword 1
427
	 mov [SpriteInfo+72+16],dword 5 ;usal speed of tank
428
	 mov [SpriteInfo+72+16],dword 5 ;usal speed of tank
428
	 mov esi,[SpriteInfo+8*9+8]   ;cordinat x of sprite
429
	 mov esi,[SpriteInfo+8*9+8]   ;cordinat x of sprite
429
	 mov edi,[SpriteInfo+8*9+12]  ;cordinat y of sprite
430
	 mov edi,[SpriteInfo+8*9+12]  ;cordinat y of sprite
Line 585... Line 586...
585
	 call you_won
586
	 call you_won
586
	 inc [number_level]
587
	 inc [number_level]
587
	 cmp [number_level],25
588
	 cmp [number_level],25
588
	 jne no_end_game
589
	 jne no_end_game
589
	 mov eax,-1
590
	 mov eax,-1
590
	 int 0x40
591
	 mcall
591
	 no_end_game:
592
	 no_end_game:
592
	 jmp new_level
593
	 jmp new_level
593
	 no_end_level:
594
	 no_end_level:
594
	 ;-------------------------------------------------
595
	 ;-------------------------------------------------
595
	 ;------------ logic of tanks----------------------
596
	 ;------------ logic of tanks----------------------
Line 891... Line 892...
891
	 ;-------------------------------------------------
892
	 ;-------------------------------------------------
892
	 mov eax,13
893
	 mov eax,13
893
	 mov ebx,180*65536+220
894
	 mov ebx,180*65536+220
894
	 mov ecx,425*65536+17
895
	 mov ecx,425*65536+17
895
	 mov edx,0xdfffff
896
	 mov edx,0xdfffff
896
	 int 0x40
897
	 mcall
897
	 mov eax,4
898
	 mov eax,4
898
	 mov ebx,190*65536+430
899
	 mov ebx,190*65536+430
899
	 mov ecx,0x1ded00;0
900
	 mov ecx,0x1ded00;0
900
	 mov edx,Level
901
	 mov edx,Level
901
	 mov esi,5
902
	 mov esi,5
902
	 int 0x40
903
	 mcall
903
	 mov eax,4
904
	 mov eax,4
904
	 mov ebx,260*65536+430
905
	 mov ebx,260*65536+430
905
	 mov ecx,0x3558ff
906
	 mov ecx,0x3558ff
906
	 mov edx,Lifes
907
	 mov edx,Lifes
907
	 mov esi,5
908
	 mov esi,5
908
	 int 0x40
909
	 mcall
909
	 mov eax,4
910
	 mov eax,4
910
	 mov ebx,330*65536+430
911
	 mov ebx,330*65536+430
911
	 mov ecx,0xf93500
912
	 mov ecx,0xf93500
912
	 mov edx,Score
913
	 mov edx,Score
913
	 mov esi,5
914
	 mov esi,5
914
	 int 0x40
915
	 mcall
915
	 mov eax,47
916
	 mov eax,47
916
	 mov ebx,3*65536
917
	 mov ebx,3*65536
917
	 mov ecx,[number_level]
918
	 mov ecx,[number_level]
918
	 inc ecx
919
	 inc ecx
919
	 mov edx,225*65536+430
920
	 mov edx,225*65536+430
920
	 mov esi,0x1ded00
921
	 mov esi,0x1ded00
921
	 int 0x40
922
	 mcall
922
	 mov eax,47
923
	 mov eax,47
923
	 mov ebx,3*65536
924
	 mov ebx,3*65536
924
	 xor ecx,ecx
925
	 xor ecx,ecx
925
	 mov cl,[LifesPlayer]
926
	 mov cl,[LifesPlayer]
926
	 shr ecx,2
927
	 shr ecx,2
927
	 mov edx,295*65536+430
928
	 mov edx,295*65536+430
928
	 mov esi,0x3558ff
929
	 mov esi,0x3558ff
929
	 int 0x40
930
	 mcall
930
	 mov eax,47
931
	 mov eax,47
931
	 mov ebx,3*65536
932
	 mov ebx,3*65536
932
	 xor ecx,ecx
933
	 xor ecx,ecx
933
	 mov cl,byte[score]
934
	 mov cl,byte[score]
934
	 mov edx,365*65536+430
935
	 mov edx,365*65536+430
935
	 mov esi,0xf93500
936
	 mov esi,0xf93500
936
	 int 0x40
937
	 mcall
937
	 jmp maincycle
938
	 jmp maincycle
938
;----------------------------------------------------------
939
;----------------------------------------------------------
939
;-----------------end of main cycle------------------------
940
;-----------------end of main cycle------------------------
940
;----------------------------------------------------------
941
;----------------------------------------------------------
941
;draw sprite in video memory
942
;draw sprite in video memory
Line 1032... Line 1033...
1032
       ret
1033
       ret
1033
;----------------------------------------------------------
1034
;----------------------------------------------------------
1034
;get time in 1/100 sec
1035
;get time in 1/100 sec
1035
clock:	mov eax,26
1036
clock:	mov eax,26
1036
	mov ebx,9
1037
	mov ebx,9
1037
	int 0x40
1038
	mcall
1038
	mov [time],eax
1039
	mov [time],eax
1039
	ret
1040
	ret
1040
;----------------------------------------------------------
1041
;----------------------------------------------------------
1041
;-----------------load level to memory---------------------
1042
;-----------------load level to memory---------------------
1042
;----------------------------------------------------------
1043
;----------------------------------------------------------
Line 1134... Line 1135...
1134
you_won:
1135
you_won:
1135
	 mov eax,13
1136
	 mov eax,13
1136
	 mov ebx,1*65536+640
1137
	 mov ebx,1*65536+640
1137
	 mov ecx,20*65536+400
1138
	 mov ecx,20*65536+400
1138
	 mov edx,0xc6e9
1139
	 mov edx,0xc6e9
1139
	 int 0x40
1140
	 mcall
1140
	 mov eax,4
1141
	 mov eax,4
1141
	 mov ebx,220*65536+190
1142
	 mov ebx,220*65536+190
1142
	 mov ecx,0xffffff
1143
	 mov ecx,0xffffff
1143
	 mov edx,won1
1144
	 mov edx,won1
1144
	 mov esi,29
1145
	 mov esi,29
1145
	 int 0x40
1146
	 mcall
1146
	 mov eax,4
1147
	 mov eax,4
1147
	 mov ebx,220*65536+200
1148
	 mov ebx,220*65536+200
1148
	 mov ecx,0xffffff
1149
	 mov ecx,0xffffff
1149
	 mov edx,won2
1150
	 mov edx,won2
1150
	 mov esi,29
1151
	 mov esi,29
1151
	 int 0x40
1152
	 mcall
1152
	 mov eax,4
1153
	 mov eax,4
1153
	 mov ebx,220*65536+210
1154
	 mov ebx,220*65536+210
1154
	 mov ecx,0xffffff
1155
	 mov ecx,0xffffff
1155
	 mov edx,won3
1156
	 mov edx,won3
1156
	 mov esi,29
1157
	 mov esi,29
1157
	 int 0x40
1158
	 mcall
1158
	 mov eax,5
1159
	 mov eax,5
1159
	 mov ebx,100
1160
	 mov ebx,100
1160
	 int 0x40
1161
	 mcall
1161
	 ret
1162
	 ret
1162
;----------------------------------------------------------
1163
;----------------------------------------------------------
1163
end_game:
1164
end_game:
1164
	mov eax,13
1165
	mov eax,13
1165
	mov ebx,0*65536+640
1166
	mov ebx,0*65536+640
1166
	mov ecx,20*65536+400
1167
	mov ecx,20*65536+400
1167
	mov edx,0
1168
	mov edx,0
1168
	int 0x40
1169
	mcall
1169
	mov eax,4
1170
	mov eax,4
1170
	mov ebx,280*65536+200
1171
	mov ebx,280*65536+200
1171
	mov ecx,0xffffff
1172
	mov ecx,0xffffff
1172
	mov edx,game_over
1173
	mov edx,game_over
1173
	mov esi,9
1174
	mov esi,9
1174
	int 0x40
1175
	mcall
1175
	mov eax,5
1176
	mov eax,5
1176
	mov ebx,150
1177
	mov ebx,150
1177
	int 0x40
1178
	mcall
1178
	ret
1179
	ret
1179
;----------------------------------------------------------
1180
;----------------------------------------------------------
1180
drawwin:
1181
drawwin:
1181
	mov eax,12
1182
	mov eax,12
1182
	mov ebx,1
1183
	mov ebx,1
1183
	int 0x40
1184
	mcall
1184
	;à¨á㥬 ®ª­® § ¤ ¢ ï ¢á¥ ­¥®¡å®¤¨¬ë¥ 梥â 
1185
	;à¨á㥬 ®ª­® § ¤ ¢ ï ¢á¥ ­¥®¡å®¤¨¬ë¥ 梥â 
1185
	mov eax,0
1186
	mov eax,0
1186
	mov ebx,50*65536+640
1187
	mov ebx,50*65536+640
1187
	mov ecx,50*65536+480
1188
	mov ecx,50*65536+480
1188
	mov edx,0x03AABBCC
1189
	mov edx,0x03AABBCC
1189
	mov esi,0x805080d0
1190
	mov esi,0x805080d0
1190
	mov edi,0x005080d0
1191
	mov edi,0x005080d0
1191
	int 0x40
1192
	mcall
1192
	;¯¨è¥¬ § £®«®¢®ª ®ª­ 
1193
	;¯¨è¥¬ § £®«®¢®ª ®ª­ 
1193
	mov eax,4
1194
	mov eax,4
1194
	mov ebx,5*65536+5
1195
	mov ebx,5*65536+5
1195
	mov ecx,0x10ffffff
1196
	mov ecx,0x10ffffff
1196
	mov edx,name
1197
	mov edx,name
1197
	mov esi,42
1198
	mov esi,42
1198
	int 0x40
1199
	mcall
1199
	ret
1200
	ret
1200
;----------------------------------------------------------
1201
;----------------------------------------------------------
1201
menu:
1202
menu:
1202
   cycle_menu:
1203
   cycle_menu:
1203
	mov eax,13
1204
	mov eax,13
1204
	mov ebx,235*65536+140
1205
	mov ebx,235*65536+140
1205
	mov ecx,230*65536+20
1206
	mov ecx,230*65536+20
1206
	mov edx,0xed16
1207
	mov edx,0xed16
1207
	int 0x40
1208
	mcall
1208
	mov eax,4
1209
	mov eax,4
1209
	mov ebx,255*65536+235
1210
	mov ebx,255*65536+235
1210
	mov ecx,0xff0200
1211
	mov ecx,0xff0200
1211
	mov edx,start_menu
1212
	mov edx,start_menu
1212
	mov esi,11
1213
	mov esi,11
1213
	int 0x40
1214
	mcall
1214
	mov eax,47
1215
	mov eax,47
1215
	mov ebx,3*65536
1216
	mov ebx,3*65536
1216
	mov ecx,[number_level]
1217
	mov ecx,[number_level]
1217
	mov edx,345*65536+235
1218
	mov edx,345*65536+235
1218
	mov esi,0xff0200
1219
	mov esi,0xff0200
1219
	int 0x40
1220
	mcall
1220
	still:
1221
	still:
1221
	mov eax,10
1222
	mov eax,10
1222
	int 0x40
1223
	mcall
1223
	cmp eax,2
1224
	cmp eax,2
1224
	jne still
1225
	jne still
1225
	mov eax,2
1226
	mov eax,2
1226
	int 0x40
1227
	mcall
1227
	shr eax,8
1228
	shr eax,8
1228
	cmp eax,32
1229
	cmp eax,32
1229
	je start_game
1230
	je start_game
1230
	cmp eax,176
1231
	cmp eax,176
1231
	jne no_left
1232
	jne no_left
Line 1240... Line 1241...
1240
	jmp cycle_menu
1241
	jmp cycle_menu
1241
	no_right:
1242
	no_right:
1242
	cmp eax,27
1243
	cmp eax,27
1243
	jne cycle_menu
1244
	jne cycle_menu
1244
	mov eax,-1
1245
	mov eax,-1
1245
	int 0x40
1246
	mcall
1246
	start_game:
1247
	start_game:
1247
	ret
1248
	ret
1248
;----------------------------------------------------------
1249
;----------------------------------------------------------
1249
;--------------unpak pix engin-----------------------------
1250
;--------------unpak pix engin-----------------------------
1250
;----------------------------------------------------------
1251
;----------------------------------------------------------