Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 12... Line 12...
12
include 'lang.inc'
12
include 'lang.inc'
13
include 'pixengin.inc'
13
include 'pixengin.inc'
14
START:
14
START:
15
   mov eax,40
15
   mov eax,40
16
   mov ebx,111b
16
   mov ebx,111b
17
   int 0x40
17
   mcall
18
   call drawwin
18
   call drawwin
19
;main cycle(fps)
19
;main cycle(fps)
20
 fpst:
20
 fpst:
21
   call clock
21
   call clock
22
   mov eax,[time]
22
   mov eax,[time]
Line 80... Line 80...
80
   mov [phas],15
80
   mov [phas],15
81
   call PutSprite
81
   call PutSprite
82
   call putimage
82
   call putimage
83
   mov eax,5
83
   mov eax,5
84
   mov ebx,2
84
   mov ebx,2
85
   int 0x40
85
   mcall
86
   mov eax,[black]
86
   mov eax,[black]
87
   mov [phas],eax
87
   mov [phas],eax
88
   call PutSprite
88
   call PutSprite
89
   call putimage
89
   call putimage
90
   call print_pos
90
   call print_pos
Line 99... Line 99...
99
	 mov [old_frame_time],eax
99
	 mov [old_frame_time],eax
100
	 mov eax,13
100
	 mov eax,13
101
	 mov ebx,420*65536+30
101
	 mov ebx,420*65536+30
102
	 mov ecx,425*65536+15
102
	 mov ecx,425*65536+15
103
	 mov edx,0xffffff
103
	 mov edx,0xffffff
104
	 int 0x40
104
	 mcall
105
	 mov eax,47
105
	 mov eax,47
106
	 mov ebx,3*65536
106
	 mov ebx,3*65536
107
	 mov ecx,[frames]
107
	 mov ecx,[frames]
108
	 mov edx,425*65536+427
108
	 mov edx,425*65536+427
109
	 mov esi,0
109
	 mov esi,0
110
	 int 0x40
110
	 mcall
111
	 mov [frames],0
111
	 mov [frames],0
112
no_frames:
112
no_frames:
113
	 ;----------------------
113
	 ;----------------------
114
	 mov ebx,20
114
	 mov ebx,20
115
	 mov eax,[x]
115
	 mov eax,[x]
Line 125... Line 125...
125
	 xor ebx,ebx
125
	 xor ebx,ebx
126
	 mov bl,byte [phas]
126
	 mov bl,byte [phas]
127
	 mov [eax],bl;write number of shablon to the map-array
127
	 mov [eax],bl;write number of shablon to the map-array
128
	 ;-----------------------
128
	 ;-----------------------
129
	 ;mov eax,11
129
	 ;mov eax,11
130
	 ;int 0x40
130
	 ;mcall
131
	 mov eax,23
131
	 mov eax,23
132
	 mov ebx,2
132
	 mov ebx,2
133
	 int 0x40
133
	 mcall
134
	 cmp eax,2
134
	 cmp eax,2
135
	 jne animation
135
	 jne animation
136
	 mov eax,2
136
	 mov eax,2
137
	 int 0x40
137
	 mcall
138
	 shr eax,8
138
	 shr eax,8
139
	 cmp eax,32
139
	 cmp eax,32
140
	 jne key2
140
	 jne key2
141
	 add [phas],1
141
	 add [phas],1
142
	 cmp [phas],10
142
	 cmp [phas],10
Line 168... Line 168...
168
	  call load_level
168
	  call load_level
169
	 jmp animation
169
	 jmp animation
170
    key8:cmp eax,27
170
    key8:cmp eax,27
171
	 jne animation
171
	 jne animation
172
	 mov eax,-1
172
	 mov eax,-1
173
	 int 0x40
173
	 mcall
174
;-------------------------------------------
174
;-------------------------------------------
175
drawwin:
175
drawwin:
176
 mov eax,12
176
 mov eax,12
177
	mov ebx,1
177
	mov ebx,1
178
	int 0x40
178
	mcall
179
	;à¨á㥬 ®ª­® § ¤ ¢ ï ¢á¥ ­¥®¡å®¤¨¬ë¥ 梥â 
179
	;à¨á㥬 ®ª­® § ¤ ¢ ï ¢á¥ ­¥®¡å®¤¨¬ë¥ 梥â 
180
	mov eax,0
180
	mov eax,0
181
	mov ebx,50*65536+640
181
	mov ebx,50*65536+640
182
	mov ecx,50*65536+450
182
	mov ecx,50*65536+450
183
	mov edx,0x02AABBCC
183
	mov edx,0x02AABBCC
184
	mov esi,0x805080d0
184
	mov esi,0x805080d0
185
	mov edi,0x005080d0
185
	mov edi,0x005080d0
186
	int 0x40
186
	mcall
187
	;¯¨è¥¬ § £®«®¢®ª ®ª­ 
187
	;¯¨è¥¬ § £®«®¢®ª ®ª­ 
188
	mov eax,4
188
	mov eax,4
189
	mov ebx,5*65536+5
189
	mov ebx,5*65536+5
190
	mov ecx,0x10ddeeff
190
	mov ecx,0x10ddeeff
191
	mov edx,name
191
	mov edx,name
192
	mov esi,7
192
	mov esi,7
193
	int 0x40
193
	mcall
194
	;à¨á㥬 ª­®¯ªã § ªàëâ¨ï ®ª­ 
194
	;à¨á㥬 ª­®¯ªã § ªàëâ¨ï ®ª­ 
195
	mov eax,8
195
	mov eax,8
196
	mov ebx,(640-19)*65536+12
196
	mov ebx,(640-19)*65536+12
197
	mov ecx,5*65536+12
197
	mov ecx,5*65536+12
198
	mov edx,1
198
	mov edx,1
199
	mov esi,0x6688dd
199
	mov esi,0x6688dd
200
	int 0x40
200
	mcall
201
	ret
201
	ret
202
;----------------------------------------------------------
202
;----------------------------------------------------------
203
counter     dd 0
203
counter     dd 0
204
;----------------------------------------------------
204
;----------------------------------------------------
205
;draw sprite in video memory
205
;draw sprite in video memory
Line 228... Line 228...
228
      ret
228
      ret
229
;-------------------------------------------------------------------------
229
;-------------------------------------------------------------------------
230
;get time in 1/100 sec
230
;get time in 1/100 sec
231
clock:	mov eax,26
231
clock:	mov eax,26
232
	mov ebx,9
232
	mov ebx,9
233
	int 0x40
233
	mcall
234
	mov [time],eax
234
	mov [time],eax
235
	ret
235
	ret
236
;---------------------------------------------------------
236
;---------------------------------------------------------
237
putimage:
237
putimage:
238
	 mov eax,7
238
	 mov eax,7
239
	 mov ebx,0x3000
239
	 mov ebx,0x3000
240
	 mov ecx,640*65536+400
240
	 mov ecx,640*65536+400
241
	 mov edx,1*65536+20
241
	 mov edx,1*65536+20
242
	 int 0x40
242
	 mcall
243
	 ret
243
	 ret
244
;---------------------------------------------------------
244
;---------------------------------------------------------
245
print_pos:mov eax,13
245
print_pos:mov eax,13
246
	  mov ebx,490*65536+60
246
	  mov ebx,490*65536+60
247
	  mov ecx,425*65536+15
247
	  mov ecx,425*65536+15
248
	  mov edx,0xffffff
248
	  mov edx,0xffffff
249
	  int 0x40
249
	  mcall
250
	  mov eax,47
250
	  mov eax,47
251
	  mov ebx,3*65536
251
	  mov ebx,3*65536
252
	  mov ecx,[x]
252
	  mov ecx,[x]
253
	  mov edx,495*65536+430
253
	  mov edx,495*65536+430
254
	  mov esi,0
254
	  mov esi,0
255
	  int 0x40
255
	  mcall
256
	  mov eax,47
256
	  mov eax,47
257
	  mov ebx,3*65536
257
	  mov ebx,3*65536
258
	  mov ecx,[y]
258
	  mov ecx,[y]
259
	  mov edx,530*65536+430
259
	  mov edx,530*65536+430
260
	  mov esi,0
260
	  mov esi,0
261
	  int 0x40
261
	  mcall
262
	  ret
262
	  ret
263
;-----------------------------------------------------------
263
;-----------------------------------------------------------
264
;-------------------------load files------------------------
264
;-------------------------load files------------------------
265
;-----------------------------------------------------------
265
;-----------------------------------------------------------
266
loadfile:
266
loadfile:
267
	 ;ªã¤  § ¯¨á뢠âì ¯¥à¢ë© ¡«®ª
267
	 ;ªã¤  § ¯¨á뢠âì ¯¥à¢ë© ¡«®ª
268
	 mov [file_read+12],dword 0x3000+(640*400*3)+(16*20*20*3)
268
	 mov [file_read+12],dword 0x3000+(640*400*3)+(16*20*20*3)
269
	 ;§ £à㦠¥¬ ¯¥à¢ë© ¡«®ª ¤«ï ⮣® ç⮡ë 㧭 â à §¬¥à ä ©« 
269
	 ;§ £à㦠¥¬ ¯¥à¢ë© ¡«®ª ¤«ï ⮣® ç⮡ë 㧭 â à §¬¥à ä ©« 
270
	 mov eax,58
270
	 mov eax,58
271
	 mov ebx,file_read
271
	 mov ebx,file_read
272
	 int 0x40
272
	 mcall
273
	 ;¢ëç¨á«ï¥¬ ᪮«ìª® ¡«®ª®¢ ¯® 512 ¡ ©â ­ã¦­® ¨á¯®«ì§®¢ âì
273
	 ;¢ëç¨á«ï¥¬ ᪮«ìª® ¡«®ª®¢ ¯® 512 ¡ ©â ­ã¦­® ¨á¯®«ì§®¢ âì
274
	 ;¤«ï § £à㧪¨ ä ©« 
274
	 ;¤«ï § £à㧪¨ ä ©« 
275
	 mov ecx,ebx
275
	 mov ecx,ebx
276
	 shr ecx,9
276
	 shr ecx,9
277
	 add ecx,1
277
	 add ecx,1
Line 282... Line 282...
282
	 ;§ ­®á¨¬ ¢ áâàãªâãàã file_read ç¨á«® ¡«®ª®¢ ª®â®àë¥ ­ã¦­® § £à㧨âì
282
	 ;§ ­®á¨¬ ¢ áâàãªâãàã file_read ç¨á«® ¡«®ª®¢ ª®â®àë¥ ­ã¦­® § £à㧨âì
283
	 mov [file_read+8],ecx
283
	 mov [file_read+8],ecx
284
	 ;§ £à㦠¥¬ ¡«®ª
284
	 ;§ £à㦠¥¬ ¡«®ª
285
	 mov eax,58
285
	 mov eax,58
286
	 mov ebx,file_read
286
	 mov ebx,file_read
287
	 int 0x40
287
	 mcall
288
	 cmp eax,0
288
	 cmp eax,0
289
	 jne scock2
289
	 jne scock2
290
	 mov esi,0x3000+(640*400*3)+(16*20*20*3)
290
	 mov esi,0x3000+(640*400*3)+(16*20*20*3)
291
	 mov ecx,[esi+8]
291
	 mov ecx,[esi+8]
292
	 add esi,60
292
	 add esi,60
Line 334... Line 334...
334
	   mov eax,[SizeFile]
334
	   mov eax,[SizeFile]
335
	   mov [file_write+8],eax
335
	   mov [file_write+8],eax
336
	   mov [file_write+12],dword 0x3000+(640*400*3)+(16*20*20*3);+(0x1000)
336
	   mov [file_write+12],dword 0x3000+(640*400*3)+(16*20*20*3);+(0x1000)
337
	   mov eax,58
337
	   mov eax,58
338
	   mov ebx,file_write
338
	   mov ebx,file_write
339
	   int 0x40
339
	   mcall
340
	   cmp eax,0
340
	   cmp eax,0
341
	   jne scok
341
	   jne scok
342
	   xor esi,esi
342
	   xor esi,esi
343
	   mov eax,55
343
	   mov eax,55
344
	   mov ebx,eax
344
	   mov ebx,eax
345
	   mov esi,sound
345
	   mov esi,sound
346
	   int 0x40
346
	   mcall
347
       scok:
347
       scok:
348
	  ret
348
	  ret
349
;-----------------------------------------------------------------------------
349
;-----------------------------------------------------------------------------
350
;-----------------load level to memory----------------------------------------
350
;-----------------load level to memory----------------------------------------
351
;-----------------------------------------------------------------------------
351
;-----------------------------------------------------------------------------
Line 361... Line 361...
361
	   jmp copy_load
361
	   jmp copy_load
362
  end_load:
362
  end_load:
363
	   mov [file_read+12],dword 0x3000+(640*400*3)+(16*20*20*3)
363
	   mov [file_read+12],dword 0x3000+(640*400*3)+(16*20*20*3)
364
	   mov eax,58
364
	   mov eax,58
365
	   mov ebx,file_read
365
	   mov ebx,file_read
366
	   int 0x40
366
	   mcall
367
	   mov ecx,ebx
367
	   mov ecx,ebx
368
	   shr ebx,9
368
	   shr ebx,9
369
	   add ebx,1
369
	   add ebx,1
370
	   mov [file_read+8],ebx
370
	   mov [file_read+8],ebx
371
	   mov eax,58
371
	   mov eax,58
372
	   mov ebx,file_read
372
	   mov ebx,file_read
373
	   int 0x40
373
	   mcall
374
	   cmp eax,0
374
	   cmp eax,0
375
	   jne nosound
375
	   jne nosound
376
	   mov esi,0x3000+(640*400*3)+(16*20*20*3)
376
	   mov esi,0x3000+(640*400*3)+(16*20*20*3)
377
	   mov edi,0x3000+(640*400*3)+(16*20*20*3)+512;0x1000+0x1000
377
	   mov edi,0x3000+(640*400*3)+(16*20*20*3)+512;0x1000+0x1000
378
	   call unpakin
378
	   call unpakin
379
	   xor esi,esi
379
	   xor esi,esi
380
	   mov eax,55
380
	   mov eax,55
381
	   mov ebx,55
381
	   mov ebx,55
382
	   mov esi,sound
382
	   mov esi,sound
383
	   int 0x40
383
	   mcall
384
	   xor esi,esi
384
	   xor esi,esi
385
	   mov [x_l],0
385
	   mov [x_l],0
386
	   mov [y_l],0
386
	   mov [y_l],0
387
       c_y:
387
       c_y:
388
	   mov [x_l],0
388
	   mov [x_l],0
Line 432... Line 432...
432
	    call print_line
432
	    call print_line
433
	    mov eax,13
433
	    mov eax,13
434
	    mov ebx,25*65536+6
434
	    mov ebx,25*65536+6
435
	    mov ecx,433*65536+12
435
	    mov ecx,433*65536+12
436
	    mov edx,0xff6c58
436
	    mov edx,0xff6c58
437
	    int 0x40
437
	    mcall
438
      opros:mov eax,10
438
      opros:mov eax,10
439
	    int 0x40
439
	    mcall
440
	    cmp eax,2
440
	    cmp eax,2
441
	    jne opros
441
	    jne opros
442
	    mov eax,2
442
	    mov eax,2
443
	    int 0x40
443
	    mcall
444
	    shr eax,8
444
	    shr eax,8
445
	    cmp eax,13
445
	    cmp eax,13
446
	    je exit_cycle
446
	    je exit_cycle
447
	    cmp eax,8
447
	    cmp eax,8
448
	    je backspace
448
	    je backspace
Line 484... Line 484...
484
	     mov [string+ebx],byte 13
484
	     mov [string+ebx],byte 13
485
	     mov eax,13
485
	     mov eax,13
486
	     mov ebx,20*65536+(64*6)+5
486
	     mov ebx,20*65536+(64*6)+5
487
	     mov ecx,430*65536+15
487
	     mov ecx,430*65536+15
488
	     mov edx,0xffffff
488
	     mov edx,0xffffff
489
	     int 0x40
489
	     mcall
490
	    ret
490
	    ret
491
;---------------------------------------------------------------
491
;---------------------------------------------------------------
492
print_line:
492
print_line:
493
	     mov eax,13
493
	     mov eax,13
494
	     mov ebx,20*65536+(64*6)+5
494
	     mov ebx,20*65536+(64*6)+5
495
	     mov ecx,430*65536+15
495
	     mov ecx,430*65536+15
496
	     mov edx,0xffffff
496
	     mov edx,0xffffff
497
	     int 0x40
497
	     mcall
498
	     mov eax,4
498
	     mov eax,4
499
	     mov ebx,25*65536+435
499
	     mov ebx,25*65536+435
500
	     mov ecx,0x1
500
	     mov ecx,0x1
501
	     mov edx,string
501
	     mov edx,string
502
	     mov esi,64
502
	     mov esi,64
503
	     int 0x40
503
	     mcall
504
	     ret
504
	     ret
505
print_cursor:
505
print_cursor:
506
	     mov eax,13
506
	     mov eax,13
507
	     xor ebx,ebx
507
	     xor ebx,ebx
508
	     mov bl,[position]
508
	     mov bl,[position]
Line 510... Line 510...
510
	     add ebx,25+6
510
	     add ebx,25+6
511
	     shl ebx,16
511
	     shl ebx,16
512
	     add ebx,6
512
	     add ebx,6
513
	     mov ecx,433*65536+12
513
	     mov ecx,433*65536+12
514
	     mov edx,0xff6c58
514
	     mov edx,0xff6c58
515
	     int 0x40
515
	     mcall
516
	     ret
516
	     ret
517
;------------------------------------------------------------------------
517
;------------------------------------------------------------------------
518
string:
518
string:
519
       db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
519
       db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
520
       db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
520
       db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0