Subversion Repositories Kolibri OS

Rev

Rev 2683 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2683 Rev 3485
1
;               by jj
1
;               by jj
2
;        (jacek jerzy malinowski)
2
;        (jacek jerzy malinowski)
3
;
3
;
4
;   contact: 4nic8@casiocalc.org
4
;   contact: 4nic8@casiocalc.org
5
;----------------------------------------
5
;----------------------------------------
6
 
6
 
7
include 'lang.inc'
7
include 'lang.inc'
8
include '../../../macros.inc'
8
include '../../../macros.inc'
9
include 'ascl.inc'
9
include 'ascl.inc'
10
include 'ascgl.inc'
10
include 'ascgl.inc'
11
include 'asjc.inc'
11
include 'asjc.inc'
12
 
12
 
13
X_SIZE equ 400
13
X_SIZE equ 400
14
Y_SIZE equ 300
14
Y_SIZE equ 300
15
 
15
 
16
MAX_LEVEL equ 5
16
MAX_LEVEL equ 5
17
 
17
 
18
BACK_CL equ 0x00EFEF ; background color
18
BACK_CL equ 0x00EFEF ; background color
19
 
19
 
20
;    THE MAIN PROGRAM:
20
;    THE MAIN PROGRAM:
21
use32
21
use32
22
 
22
 
23
               org    0x0
23
               org    0x0
24
 
24
 
25
               db     'MENUET01'              ; 8 byte id
25
               db     'MENUET01'              ; 8 byte id
26
               dd     0x01                    ; header version
26
               dd     0x01                    ; header version
27
               dd     START                   ; start of code
27
               dd     START                   ; start of code
28
               dd     I_END                   ; size of image
28
               dd     I_END                   ; size of image
29
               dd     0x200000                ; memory for app
29
               dd     0x200000                ; memory for app
30
               dd     0x7fff0                 ; esp
30
               dd     0x7fff0                 ; esp
31
               dd     0x0 , 0x0               ; I_Param , I_Icon
31
               dd     0x0 , 0x0               ; I_Param , I_Icon
32
 
32
 
33
START:                          ; start of execution
33
START:                          ; start of execution
34
 
34
 
35
    bmptoimg bmp_file,img_bmp   ; loading ... ;]
35
    bmptoimg bmp_file,img_bmp   ; loading ... ;]
36
    getimg img_bmp,0,0,10,10,img_ball
36
    getimg img_bmp,0,0,10,10,img_ball
37
    getimg img_bmp,20,0,20,10,img_bonus
37
    getimg img_bmp,20,0,20,10,img_bonus
38
    getimg img_bmp,0,10,40,20,img_brick1
38
    getimg img_bmp,0,10,40,20,img_brick1
39
    getimg img_bmp,0,30,40,20,img_brick2
39
    getimg img_bmp,0,30,40,20,img_brick2
40
    getimg img_bmp,0,50,40,20,img_brick3
40
    getimg img_bmp,0,50,40,20,img_brick3
41
    getimg img_bmp,0,70,40,20,img_brick4
41
    getimg img_bmp,0,70,40,20,img_brick4
42
 
42
 
43
    call draw_window
43
    call draw_window
44
 
44
 
45
still:
45
still:
46
    cmp  [is_rolled_up], 1
46
    cmp  [is_rolled_up], 1
47
    jne  @f
47
    jne  @f
48
    jmp  .no_game
48
    jmp  .no_game
49
  @@:
49
  @@:
50
 
50
 
51
    if_e dword [level],0,.no_intro
51
    if_e dword [level],0,.no_intro
52
       call intro
52
       call intro
53
       jmp .no_game
53
       jmp .no_game
54
    .no_intro:
54
    .no_intro:
55
 
55
 
56
    if_e dword [mode],2,.end_if1
56
    if_e dword [mode],2,.end_if1
57
       call level_info
57
       call level_info
58
       jmp .no_game
58
       jmp .no_game
59
    .end_if1:
59
    .end_if1:
60
 
60
 
61
    if_e dword [mode],4,.end_if2
61
    if_e dword [mode],4,.end_if2
62
       call game_over
62
       call game_over
63
       jmp .no_game
63
       jmp .no_game
64
    .end_if2:
64
    .end_if2:
65
 
65
 
66
    call fast_gfx ; <-- the main engine
66
    call fast_gfx ; <-- the main engine
67
    .no_game:
67
    .no_game:
68
 
68
 
69
    mov  eax,11
69
    mov  eax,11
70
    mcall
70
    mcall
71
 
71
 
72
    cmp  eax,1                  ; redraw request ?
72
    cmp  eax,1                  ; redraw request ?
73
    je   red
73
    je   red
74
    cmp  eax,2                  ; key in buffer ?
74
    cmp  eax,2                  ; key in buffer ?
75
    je   key
75
    je   key
76
    cmp  eax,3                  ; button in buffer ?
76
    cmp  eax,3                  ; button in buffer ?
77
    je   button
77
    je   button
78
 
78
 
79
    jmp  still
79
    jmp  still
80
 
80
 
81
  red:                          ; redraw
81
  red:                          ; redraw
82
    mov  [is_rolled_up], 0
82
    mov  [is_rolled_up], 0
83
    mcall 9,proc_info,-1
83
    mcall 9,proc_info,-1
84
    test [proc_info+process_information.wnd_state], 0x04
84
    test [proc_info+process_information.wnd_state], 0x04
85
    jz   @f
85
    jz   @f
86
    mov  [is_rolled_up], 1
86
    mov  [is_rolled_up], 1
87
  @@:
87
  @@:
88
    call draw_window
88
    call draw_window
89
    jmp  still
89
    jmp  still
90
 
90
 
91
  key:                          ; key
91
  key:                          ; key
92
    mov  eax,2                  ; just read it and ignore
92
    mov  eax,2                  ; just read it and ignore
93
    mcall
93
    mcall
94
    cmp  ah,key_Esc ; if Esc ?
94
    cmp  ah,key_Esc ; if Esc ?
95
    jne  .no_q
95
    jne  .no_q
96
      or eax,-1
96
      or eax,-1
97
      mcall
97
      mcall
98
    .no_q:
98
    .no_q:
99
 
99
 
100
    if_e dword [mode],4,.end_if6
100
    if_e dword [mode],4,.end_if6
101
       jmp still
101
       jmp still
102
    .end_if6:
102
    .end_if6:
103
 
103
 
104
    cmp  ah,key_Space
104
    cmp  ah,key_Space
105
    jne  .no_space
105
    jne  .no_space
106
      if_e dword [mode],2,.end_if1
106
      if_e dword [mode],2,.end_if1
107
         mov dword [mode],0
107
         mov dword [mode],0
108
         jmp .no_space
108
         jmp .no_space
109
      .end_if1:
109
      .end_if1:
110
      mov dword [mode],1
110
      mov dword [mode],1
111
      call fast_gfx
111
      call fast_gfx
112
    .no_space:
112
    .no_space:
113
    xor ebx,ebx
113
    xor ebx,ebx
114
    mov bl,ah
114
    mov bl,ah
115
    if_e ebx,key_F1,.no_f1
115
    if_e ebx,key_F1,.no_f1
116
      inc dword [del]
116
      inc dword [del]
117
    .no_f1:
117
    .no_f1:
118
    if_e ebx,key_F2,.no_f2
118
    if_e ebx,key_F2,.no_f2
119
      if_a dword [del],0,.end_if3
119
      if_a dword [del],0,.end_if3
120
         dec dword [del]
120
         dec dword [del]
121
      .end_if3:
121
      .end_if3:
122
    .no_f2:
122
    .no_f2:
123
 
123
 
124
 
124
 
125
    jmp  still
125
    jmp  still
126
 
126
 
127
  button:                       ; button
127
  button:                       ; button
128
    mov  eax,17                 ; get id
128
    mov  eax,17                 ; get id
129
    mcall
129
    mcall
130
 
130
 
131
    cmp  ah,1                   ; button id=1 ?
131
    cmp  ah,1                   ; button id=1 ?
132
    jne  noclose
132
    jne  noclose
133
 
133
 
134
    mov  eax,-1                 ; close this program
134
    mov  eax,-1                 ; close this program
135
    mcall
135
    mcall
136
  noclose:
136
  noclose:
137
 
137
 
138
    jmp  still
138
    jmp  still
139
 
139
 
140
;   *********************************************
140
;   *********************************************
141
;   ******* VIRTUAL SCREEN FUNCTIONS ************
141
;   ******* VIRTUAL SCREEN FUNCTIONS ************
142
;   *********************************************
142
;   *********************************************
143
 
143
 
144
show_screen:  ; flips the virtual screen to the window
144
show_screen:  ; flips the virtual screen to the window
145
    push_abc
145
    push_abc
146
 
146
 
147
    mov  eax,7
147
    mov  eax,7
148
    mov  ebx,screen
148
    mov  ebx,screen
149
    mov  ecx,X_SIZE*65536+Y_SIZE
149
    mov  ecx,X_SIZE*65536+Y_SIZE
150
    mov  edx,4*65536+20
150
    mov  edx,4*65536+20
151
    mcall
151
    mcall
152
 
152
 
153
    pop_abc
153
    pop_abc
154
ret
154
ret
155
 
155
 
156
put_bmp_screen: ; eax - y , ebx - x, esi - bmp
156
put_bmp_screen: ; eax - y , ebx - x, esi - bmp
157
    cmp ebx,X_SIZE-5
157
    cmp ebx,X_SIZE-5
158
    jb .ok1
158
    jb .ok1
159
      ret
159
      ret
160
    .ok1:
160
    .ok1:
161
    cmp eax,Y_SIZE-5
161
    cmp eax,Y_SIZE-5
162
    jb .ok2
162
    jb .ok2
163
      ret
163
      ret
164
    .ok2:
164
    .ok2:
165
 
165
 
166
    push_abc
166
    push_abc
167
    xor  ecx,ecx
167
    xor  ecx,ecx
168
    xor  edx,edx
168
    xor  edx,edx
169
    mov  edi,screen
169
    mov  edi,screen
170
    mov  ecx,3
170
    mov  ecx,3
171
    mul  ecx  ; xx = 3*y*X_SIZE+3*x
171
    mul  ecx  ; xx = 3*y*X_SIZE+3*x
172
    mov  ecx,X_SIZE
172
    mov  ecx,X_SIZE
173
    mul  ecx
173
    mul  ecx
174
    push eax ; #> 1
174
    push eax ; #> 1
175
    mov  eax,ebx
175
    mov  eax,ebx
176
    mov  ecx,3
176
    mov  ecx,3
177
    mul  ecx
177
    mul  ecx
178
    mov  ebx,eax
178
    mov  ebx,eax
179
    pop  edx ; #< 1
179
    pop  edx ; #< 1
180
    add  edx,ebx
180
    add  edx,ebx
181
    add  edi,edx ; sets the pointer to x,y of the screen
181
    add  edi,edx ; sets the pointer to x,y of the screen
182
 
182
 
183
    mov  cx,[si] ; loops 1
183
    mov  cx,[si] ; loops 1
184
    xor  ebx,ebx
184
    xor  ebx,ebx
185
    mov  ax,cx
185
    mov  ax,cx
186
    mov  dx,3
186
    mov  dx,3
187
    mul  dx
187
    mul  dx
188
    mov  bx,ax
188
    mov  bx,ax
189
 
189
 
190
    push ebx ;#>4
190
    push ebx ;#>4
191
 
191
 
192
    add  si,4
192
    add  si,4
193
    mov  ax,[si] ; loops 2
193
    mov  ax,[si] ; loops 2
194
    mov  cx,[si]
194
    mov  cx,[si]
195
    ;shr  ax,2
195
    ;shr  ax,2
196
    mov  dx,3   ; dx = ax *3
196
    mov  dx,3   ; dx = ax *3
197
    mul  dx
197
    mul  dx
198
    mov  bx,ax
198
    mov  bx,ax
199
    add  si,4
199
    add  si,4
200
 
200
 
201
 
201
 
202
    pop  ebx ;#<4
202
    pop  ebx ;#<4
203
    .l_y:
203
    .l_y:
204
       mov ax,cx
204
       mov ax,cx
205
       cld
205
       cld
206
       mov  cx,bx
206
       mov  cx,bx
207
       rep movs byte [edi],[esi]
207
       rep movs byte [edi],[esi]
208
       add edi,X_SIZE
208
       add edi,X_SIZE
209
       add edi,X_SIZE
209
       add edi,X_SIZE
210
       add edi,X_SIZE
210
       add edi,X_SIZE
211
       sub edi,ebx
211
       sub edi,ebx
212
       mov cx,ax
212
       mov cx,ax
213
    loop .l_y
213
    loop .l_y
214
 
214
 
215
    pop_abc
215
    pop_abc
216
ret
216
ret
217
 
217
 
218
rect_screen: ; eax - y , ebx - x, ecx - size x, edx - size y, si -color
218
rect_screen: ; eax - y , ebx - x, ecx - size x, edx - size y, si -color
219
    mov edi,ebx
219
    mov edi,ebx
220
    add ebx,ecx
220
    add ebx,ecx
221
    cmp ebx,X_SIZE
221
    cmp ebx,X_SIZE
222
    jb .ok1
222
    jb .ok1
223
      ret
223
      ret
224
    .ok1:
224
    .ok1:
225
    mov ebx,edi
225
    mov ebx,edi
226
 
226
 
227
    mov edi,eax
227
    mov edi,eax
228
    add eax,edx
228
    add eax,edx
229
    cmp eax,Y_SIZE
229
    cmp eax,Y_SIZE
230
    jb .ok2
230
    jb .ok2
231
      ret
231
      ret
232
    .ok2:
232
    .ok2:
233
    mov eax,edi
233
    mov eax,edi
234
    push_abc
234
    push_abc
235
    push ecx  ;#>2
235
    push ecx  ;#>2
236
    push edx  ;#>3
236
    push edx  ;#>3
237
 
237
 
238
    xor  ecx,ecx
238
    xor  ecx,ecx
239
    xor  edx,edx
239
    xor  edx,edx
240
    mov  edi,screen
240
    mov  edi,screen
241
    mov  ecx,3
241
    mov  ecx,3
242
    mul  ecx  ; xx = 3*y*X_SIZE+3*x
242
    mul  ecx  ; xx = 3*y*X_SIZE+3*x
243
    mov  ecx,X_SIZE
243
    mov  ecx,X_SIZE
244
    mul  ecx
244
    mul  ecx
245
    push eax ; #> 1
245
    push eax ; #> 1
246
    mov  eax,ebx
246
    mov  eax,ebx
247
    mov  ecx,3
247
    mov  ecx,3
248
    mul  ecx
248
    mul  ecx
249
    mov  ebx,eax
249
    mov  ebx,eax
250
    pop  edx ; #< 1
250
    pop  edx ; #< 1
251
    add  edx,ebx
251
    add  edx,ebx
252
 
252
 
253
    add  edi,edx ; sets the pointer to x,y of the screen
253
    add  edi,edx ; sets the pointer to x,y of the screen
254
 
254
 
255
    pop ecx ; #<3
255
    pop ecx ; #<3
256
    pop edx ; #<4
256
    pop edx ; #<4
257
    mov  eax,esi
257
    mov  eax,esi
258
    .l_y:
258
    .l_y:
259
       ;mov ax,cx
259
       ;mov ax,cx
260
       push  ecx
260
       push  ecx
261
       cld
261
       cld
262
       mov  ecx,edx
262
       mov  ecx,edx
263
       .l_x:
263
       .l_x:
264
         ;rep movs byte [edi],[esi]
264
         ;rep movs byte [edi],[esi]
265
         mov  word [edi],ax
265
         mov  word [edi],ax
266
         push eax
266
         push eax
267
         shr  eax,16
267
         shr  eax,16
268
         mov  byte [edi+2],al
268
         mov  byte [edi+2],al
269
         add  edi,3
269
         add  edi,3
270
         pop  eax
270
         pop  eax
271
       loop .l_x
271
       loop .l_x
272
 
272
 
273
       add edi,X_SIZE
273
       add edi,X_SIZE
274
       add edi,X_SIZE
274
       add edi,X_SIZE
275
       add edi,X_SIZE
275
       add edi,X_SIZE
276
       sub edi,edx
276
       sub edi,edx
277
       sub edi,edx
277
       sub edi,edx
278
       sub edi,edx
278
       sub edi,edx
279
       ;mov cx,ax
279
       ;mov cx,ax
280
       pop  ecx
280
       pop  ecx
281
    loop .l_y
281
    loop .l_y
282
 
282
 
283
    pop_abc
283
    pop_abc
284
ret
284
ret
285
 
285
 
286
grad_rect_screen: ; eax - y , ebx - x, ecx - size x, edx - size y, si -color, d
286
grad_rect_screen: ; eax - y , ebx - x, ecx - size x, edx - size y, si -color, d
287
    push edi  ;#>0
287
    push edi  ;#>0
288
    mov edi,ebx
288
    mov edi,ebx
289
    add ebx,ecx
289
    add ebx,ecx
290
    cmp ebx,X_SIZE
290
    cmp ebx,X_SIZE
291
    jb .ok1
291
    jb .ok1
292
      pop edi ;#<0
292
      pop edi ;#<0
293
      ret
293
      ret
294
    .ok1:
294
    .ok1:
295
    mov ebx,edi
295
    mov ebx,edi
296
 
296
 
297
    mov edi,eax
297
    mov edi,eax
298
    add eax,edx
298
    add eax,edx
299
    cmp eax,Y_SIZE
299
    cmp eax,Y_SIZE
300
    jb .ok2
300
    jb .ok2
301
      pop edi ;#<0
301
      pop edi ;#<0
302
      ret
302
      ret
303
    .ok2:
303
    .ok2:
304
    mov eax,edi
304
    mov eax,edi
305
 
305
 
306
    pop edi ;#<0
306
    pop edi ;#<0
307
    push_abc
307
    push_abc
308
 
308
 
309
    push edi  ;#>5
309
    push edi  ;#>5
310
    push ecx  ;#>2
310
    push ecx  ;#>2
311
    push edx  ;#>3
311
    push edx  ;#>3
312
 
312
 
313
    xor  ecx,ecx
313
    xor  ecx,ecx
314
    xor  edx,edx
314
    xor  edx,edx
315
    mov  edi,screen
315
    mov  edi,screen
316
    mov  ecx,3
316
    mov  ecx,3
317
    mul  ecx  ; xx = 3*y*X_SIZE+3*x
317
    mul  ecx  ; xx = 3*y*X_SIZE+3*x
318
    mov  ecx,X_SIZE
318
    mov  ecx,X_SIZE
319
    mul  ecx
319
    mul  ecx
320
    push eax ; #> 1
320
    push eax ; #> 1
321
    mov  eax,ebx
321
    mov  eax,ebx
322
    mov  ecx,3
322
    mov  ecx,3
323
    mul  ecx
323
    mul  ecx
324
    mov  ebx,eax
324
    mov  ebx,eax
325
    pop  edx ; #< 1
325
    pop  edx ; #< 1
326
    add  edx,ebx
326
    add  edx,ebx
327
 
327
 
328
    add  edi,edx ; sets the pointer to x,y of the screen
328
    add  edi,edx ; sets the pointer to x,y of the screen
329
 
329
 
330
    pop ecx ; #<3
330
    pop ecx ; #<3
331
    pop edx ; #<2
331
    pop edx ; #<2
332
    mov  eax,esi
332
    mov  eax,esi
333
    pop esi ; #<5
333
    pop esi ; #<5
334
    .l_y:
334
    .l_y:
335
       ;mov ax,cx
335
       ;mov ax,cx
336
       push  ecx
336
       push  ecx
337
       cld
337
       cld
338
       mov  ecx,edx
338
       mov  ecx,edx
339
       .l_x:
339
       .l_x:
340
         ;rep movs byte [edi],[esi]
340
         ;rep movs byte [edi],[esi]
341
         mov  word [edi],ax
341
         mov  word [edi],ax
342
         push eax
342
         push eax
343
         shr  eax,16
343
         shr  eax,16
344
         mov  byte [edi+2],al
344
         mov  byte [edi+2],al
345
         add  edi,3
345
         add  edi,3
346
         pop  eax
346
         pop  eax
347
       loop .l_x
347
       loop .l_x
348
 
348
 
349
       add edi,X_SIZE
349
       add edi,X_SIZE
350
       add edi,X_SIZE
350
       add edi,X_SIZE
351
       add edi,X_SIZE
351
       add edi,X_SIZE
352
       sub edi,edx
352
       sub edi,edx
353
       sub edi,edx
353
       sub edi,edx
354
       sub edi,edx
354
       sub edi,edx
355
       add eax,esi
355
       add eax,esi
356
       ;mov cx,ax
356
       ;mov cx,ax
357
       pop  ecx
357
       pop  ecx
358
    loop .l_y
358
    loop .l_y
359
 
359
 
360
    pop_abc
360
    pop_abc
361
ret
361
ret
362
 
362
 
363
 
363
 
364
fill_screen: ; eax - screen color ( 0x00RRGGBB )
364
fill_screen: ; eax - screen color ( 0x00RRGGBB )
365
    push_abc
365
    push_abc
366
    mov  edi,screen
366
    mov  edi,screen
367
    cld
367
    cld
368
    mov  ecx,X_SIZE*Y_SIZE
368
    mov  ecx,X_SIZE*Y_SIZE
369
    .lab1:
369
    .lab1:
370
        mov  [edi],eax
370
        mov  [edi],eax
371
        add  edi,3
371
        add  edi,3
372
    loop .lab1
372
    loop .lab1
373
    pop_abc
373
    pop_abc
374
ret
374
ret
375
 
375
 
376
grad_fill_screen: ; eax - screen color ( 0x00RRGGBB ), ebx - mack
376
grad_fill_screen: ; eax - screen color ( 0x00RRGGBB ), ebx - mack
377
    push_abc
377
    push_abc
378
    mov  edi,screen
378
    mov  edi,screen
379
    cld
379
    cld
380
    mov  ecx,Y_SIZE
380
    mov  ecx,Y_SIZE
381
    mov  dl,0
381
    mov  dl,0
382
    .lab1:
382
    .lab1:
383
       push ecx
383
       push ecx
384
       mov ecx,X_SIZE
384
       mov ecx,X_SIZE
385
       .lab2:
385
       .lab2:
386
         mov  [edi],eax
386
         mov  [edi],eax
387
         add  edi,3
387
         add  edi,3
388
       loop .lab2
388
       loop .lab2
389
       mov dh,1  ; dl = 1 - dl
389
       mov dh,1  ; dl = 1 - dl
390
       sub dh,dl
390
       sub dh,dl
391
       mov dl,dh
391
       mov dl,dh
392
       cmp dl,0
392
       cmp dl,0
393
       jne .no_ch  ; if (dl==0)
393
       jne .no_ch  ; if (dl==0)
394
         add  eax,ebx ; change gradient
394
         add  eax,ebx ; change gradient
395
       .no_ch:
395
       .no_ch:
396
       pop ecx
396
       pop ecx
397
    loop .lab1
397
    loop .lab1
398
    pop_abc
398
    pop_abc
399
ret
399
ret
400
 
400
 
401
 
401
 
402
bmp_fill_screen: ; esi - pointer to a backgroung bmp
402
bmp_fill_screen: ; esi - pointer to a backgroung bmp
403
    push_abc
403
    push_abc
404
    mov  edi,screen
404
    mov  edi,screen
405
    cld
405
    cld
406
    mov  ecx,X_SIZE*Y_SIZE
406
    mov  ecx,X_SIZE*Y_SIZE
407
      rep movs dword  [edi],[esi]
407
      rep movs dword  [edi],[esi]
408
    pop_abc
408
    pop_abc
409
ret
409
ret
410
 
410
 
411
;___________________
411
;___________________
412
intro:  ; INTRO    ;
412
intro:  ; INTRO    ;
413
    cmp  [is_rolled_up], 1
413
    cmp  [is_rolled_up], 1
414
    jne  @f
414
    jne  @f
415
    ret
415
    ret
416
  @@:
416
  @@:
417
    label 146,200,'ARCANOID II  v0.30',0x100000FF
417
    label 146,200,'ARCANOID II  v0.30',0x100000FF
418
    label 120,220,'by jj (jacek jerzy malinowski)',0x050505
418
    label 120,220,'by jj (jacek jerzy malinowski)',0x050505
-
 
419
    if lang eq it
-
 
420
        label 100,240,'Premi spazio per iniziare una nuova partita',0x10FF0800
-
 
421
    else
419
    label 100,240,'press SPACE to start a new game',0x10FF0800
422
        label 100,240,'press SPACE to start a new game',0x10FF0800
-
 
423
    end if
420
    label 15,240,'F1 + delay',0xFFA8FF
424
    label 15,240,'F1 + delay',0xFFA8FF
421
    label 15,260,'F2 + delay',0xFFA8FF
425
    label 15,260,'F2 + delay',0xFFA8FF
422
    delay 10
426
    delay 10
423
ret
427
ret
424
 
428
 
425
;___________________
429
;___________________
426
level_info:
430
level_info:
427
    cmp  [is_rolled_up], 1
431
    cmp  [is_rolled_up], 1
428
    jne  @f
432
    jne  @f
429
    ret
433
    ret
430
  @@:
434
  @@:
-
 
435
    if lang eq it
-
 
436
        label 170,230,'L I V E L LO',0x100000FF
-
 
437
    else
431
    label 170,230,'L E V E L',0x100000FF
438
        label 170,230,'L E V E L',0x100000FF
-
 
439
    end if
-
 
440
 
-
 
441
 
432
    outcount [level],195,250,0x100000FF,2*65536
442
    outcount [level],195,250,0x100000FF,2*65536
-
 
443
    if lang eq it
-
 
444
        label 100,270,'Premi spazio per iniziare il livello',0x10FF0800
-
 
445
    else
433
    label 100,270,'press SPACE to start the level',0x10FF0800
446
        label 100,270,'press SPACE to start the level',0x10FF0800
-
 
447
    end if
434
    delay 10
448
    delay 10
435
ret
449
ret
436
 
450
 
437
;_________________________
451
;_________________________
438
game_over:  ; GAME OVER  ;
452
game_over:  ; GAME OVER  ;
439
    mov  eax,0x00FF00
453
    mov  eax,0x00FF00
440
    mov  ebx,0xFF01
454
    mov  ebx,0xFF01
441
    .g_ok:
455
    .g_ok:
442
    call grad_fill_screen
456
    call grad_fill_screen
443
    call show_screen  ; flips the screen
457
    call show_screen  ; flips the screen
444
    label 120,150,'G  A  M  E    O  V  E  R',0x10050505
458
    label 120,150,'G  A  M  E    O  V  E  R',0x10050505
-
 
459
    if lang eq it
-
 
460
        label 140,200,'Grazie per aver giocato',0x0FFF800
-
 
461
    else
445
    label 140,200,'Thanks for playing',0x0FFF800
462
        label 140,200,'Thanks for playing',0x0FFF800
-
 
463
    end if
446
    delay 20
464
    delay 20
447
ret
465
ret
448
 
466
 
449
 
467
 
450
;-----------------------------;
468
;-----------------------------;
451
; THE MAIN THE GAME'S ENGINE ;
469
; THE MAIN THE GAME'S ENGINE ;
452
;-----------------------------;
470
;-----------------------------;
453
fast_gfx:
471
fast_gfx:
454
    ; the background gradient
472
    ; the background gradient
455
    if_e  dword [level],0,.no_0
473
    if_e  dword [level],0,.no_0
456
      mov  eax,0xFF
474
      mov  eax,0xFF
457
      mov  ebx,0xFEFF
475
      mov  ebx,0xFEFF
458
      jmp .g_ok
476
      jmp .g_ok
459
    .no_0:
477
    .no_0:
460
    if_e  dword [level],1,.no_1
478
    if_e  dword [level],1,.no_1
461
      mov  eax,BACK_CL
479
      mov  eax,BACK_CL
462
      mov  ebx,0xFFFF
480
      mov  ebx,0xFFFF
463
      jmp .g_ok
481
      jmp .g_ok
464
    .no_1:
482
    .no_1:
465
    if_e  dword [level],2,.no_2
483
    if_e  dword [level],2,.no_2
466
      mov  eax,0xFF0000
484
      mov  eax,0xFF0000
467
      mov  ebx,0xFF00FF
485
      mov  ebx,0xFF00FF
468
      jmp .g_ok
486
      jmp .g_ok
469
    .no_2:
487
    .no_2:
470
 
488
 
471
    mov  eax,BACK_CL
489
    mov  eax,BACK_CL
472
    mov  ebx,0xFFFF
490
    mov  ebx,0xFFFF
473
    .g_ok:
491
    .g_ok:
474
    call grad_fill_screen
492
    call grad_fill_screen
475
 
493
 
476
    mov  eax,37  ; get mouse position
494
    mov  eax,37  ; get mouse position
477
    mov  ebx,1
495
    mov  ebx,1
478
    mcall
496
    mcall
479
    shr  eax,16
497
    shr  eax,16
480
    mov  [x],eax
498
    mov  [x],eax
481
    add  eax,[s_x]
499
    add  eax,[s_x]
482
    cmp  eax,X_SIZE  ; controls if the pad is in the screen
500
    cmp  eax,X_SIZE  ; controls if the pad is in the screen
483
    jb   .ok
501
    jb   .ok
484
      cmp eax,0x7FFF ; if < 0
502
      cmp eax,0x7FFF ; if < 0
485
      jb  .upper
503
      jb  .upper
486
        mov [x],0
504
        mov [x],0
487
        jmp .ok
505
        jmp .ok
488
      .upper:        ; if > X_SIZE - pad size
506
      .upper:        ; if > X_SIZE - pad size
489
      mov dword [x],X_SIZE-1
507
      mov dword [x],X_SIZE-1
490
      mov eax,[s_x]
508
      mov eax,[s_x]
491
      sub dword [x],eax
509
      sub dword [x],eax
492
    .ok:
510
    .ok:
493
    mov  ebx,[x]
511
    mov  ebx,[x]
494
    mov  eax,[y]
512
    mov  eax,[y]
495
    mov  ecx,[s_x]
513
    mov  ecx,[s_x]
496
    mov  edx,15
514
    mov  edx,15
497
    mov  esi,0xFF0000
515
    mov  esi,0xFF0000
498
    mov  edi,0xF0000F
516
    mov  edi,0xF0000F
499
    call grad_rect_screen
517
    call grad_rect_screen
500
 
518
 
501
    call draw_level
519
    call draw_level
502
 
520
 
503
    cmp dword [mode],1
521
    cmp dword [mode],1
504
    jne .no_go ; is the game started ?
522
    jne .no_go ; is the game started ?
505
      mov eax,[v_x]
523
      mov eax,[v_x]
506
      add dword [b_x],eax
524
      add dword [b_x],eax
507
      mov eax,[v_y]
525
      mov eax,[v_y]
508
      add dword [b_y],eax
526
      add dword [b_y],eax
509
      jmp .go
527
      jmp .go
510
    .no_go:
528
    .no_go:
511
      mov eax,[x] ; b_x = x + x_s/2
529
      mov eax,[x] ; b_x = x + x_s/2
512
      mov ebx,[s_x]
530
      mov ebx,[s_x]
513
      shr ebx,1
531
      shr ebx,1
514
      add eax,ebx
532
      add eax,ebx
515
      mov dword [b_x],eax
533
      mov dword [b_x],eax
516
      mov eax,[y] ; b_y = y - 10
534
      mov eax,[y] ; b_y = y - 10
517
      sub eax,10
535
      sub eax,10
518
      mov dword [b_y],eax
536
      mov dword [b_y],eax
519
 
537
 
520
      mov dword [v_x],1
538
      mov dword [v_x],1
521
      mov dword [v_y],-1
539
      mov dword [v_y],-1
522
    .go:
540
    .go:
523
    ;TEST WHERE IS THE BALL:
541
    ;TEST WHERE IS THE BALL:
524
    cmp dword [b_x],0x7FFFFFFF
542
    cmp dword [b_x],0x7FFFFFFF
525
    jb .b_ok2 ; if out of the screen (left)
543
    jb .b_ok2 ; if out of the screen (left)
526
      mov dword [b_x],0
544
      mov dword [b_x],0
527
      mov eax,0
545
      mov eax,0
528
      sub eax,[v_x]
546
      sub eax,[v_x]
529
      mov [v_x],eax
547
      mov [v_x],eax
530
    .b_ok2:
548
    .b_ok2:
531
    cmp dword [b_x],X_SIZE-10
549
    cmp dword [b_x],X_SIZE-10
532
    jb .b_ok1 ; if out of the screen (right)
550
    jb .b_ok1 ; if out of the screen (right)
533
      mov dword [b_x],X_SIZE-11
551
      mov dword [b_x],X_SIZE-11
534
      mov eax,0
552
      mov eax,0
535
      sub eax,[v_x]
553
      sub eax,[v_x]
536
      mov [v_x],eax
554
      mov [v_x],eax
537
    .b_ok1:
555
    .b_ok1:
538
    cmp dword [b_y],0x7FFFFFFF
556
    cmp dword [b_y],0x7FFFFFFF
539
    jb .b_ok3 ; if out of the screen (up)
557
    jb .b_ok3 ; if out of the screen (up)
540
      mov dword [b_y],0
558
      mov dword [b_y],0
541
      mov eax,0
559
      mov eax,0
542
      sub eax,[v_y]
560
      sub eax,[v_y]
543
      mov [v_y],eax
561
      mov [v_y],eax
544
    .b_ok3:
562
    .b_ok3:
545
    cmp dword [b_y],Y_SIZE-10
563
    cmp dword [b_y],Y_SIZE-10
546
    jb .b_ok4 ; if out of the screen (down)
564
    jb .b_ok4 ; if out of the screen (down)
547
      mov dword [mode],0
565
      mov dword [mode],0
548
      if_e dword [lives],0,.end_if5
566
      if_e dword [lives],0,.end_if5
549
         mov dword [mode],4 ; GAME OVER
567
         mov dword [mode],4 ; GAME OVER
550
         jmp still
568
         jmp still
551
      .end_if5:
569
      .end_if5:
552
         dec dword [lives]
570
         dec dword [lives]
553
      .end_else4:
571
      .end_else4:
554
      call draw_window
572
      call draw_window
555
    .b_ok4:
573
    .b_ok4:
556
 
574
 
557
    imgtoimg img_ball,dword [b_x],dword [b_y],screen_img
575
    imgtoimg img_ball,dword [b_x],dword [b_y],screen_img
558
 
576
 
559
    call show_screen  ; flips the screen
577
    call show_screen  ; flips the screen
560
    delay dword [del]
578
    delay dword [del]
561
 
579
 
562
    call do_tests ; does all needed tests
580
    call do_tests ; does all needed tests
563
ret
581
ret
564
;----------------------;
582
;----------------------;
565
; BALL & BRICKS EVENTS ;
583
; BALL & BRICKS EVENTS ;
566
;----------------------;
584
;----------------------;
567
MAX_SPEED equ 3
585
MAX_SPEED equ 3
568
do_tests:
586
do_tests:
569
    ; BALL <-> PAD
587
    ; BALL <-> PAD
570
    mov eax,[b_x]
588
    mov eax,[b_x]
571
    add eax,10
589
    add eax,10
572
    cmp eax,[x] ; if (b_x+10)>[pad x]
590
    cmp eax,[x] ; if (b_x+10)>[pad x]
573
    jb .skip        ; &&
591
    jb .skip        ; &&
574
    mov eax,[b_x]
592
    mov eax,[b_x]
575
    mov ebx,[s_x]
593
    mov ebx,[s_x]
576
    add ebx,[x]
594
    add ebx,[x]
577
    cmp eax,ebx ; if b_x < x + s_x
595
    cmp eax,ebx ; if b_x < x + s_x
578
    ja .skip     ; &&
596
    ja .skip     ; &&
579
    mov eax,[b_y]
597
    mov eax,[b_y]
580
    add eax,10
598
    add eax,10
581
    cmp eax,[y] ; if (b_y+10) > y
599
    cmp eax,[y] ; if (b_y+10) > y
582
    jb .skip
600
    jb .skip
583
    sub eax,15
601
    sub eax,15
584
    cmp eax,[y] ; if b_y < y+15
602
    cmp eax,[y] ; if b_y < y+15
585
    ja .skip
603
    ja .skip
586
      cmp dword [v_y],0x7FFFFF ; if v_y > 0
604
      cmp dword [v_y],0x7FFFFF ; if v_y > 0
587
      ja .skip
605
      ja .skip
588
      cmp dword [v_y],MAX_SPEED; speedup:
606
      cmp dword [v_y],MAX_SPEED; speedup:
589
      ja .skip_s
607
      ja .skip_s
590
        inc dword [speed_t]
608
        inc dword [speed_t]
591
        cmp dword [speed_t],5
609
        cmp dword [speed_t],5
592
        jb .skip_s
610
        jb .skip_s
593
        inc dword [v_y]
611
        inc dword [v_y]
594
        mov dword [speed_t],0
612
        mov dword [speed_t],0
595
      .skip_s:
613
      .skip_s:
596
      inc dword [speed_t]
614
      inc dword [speed_t]
597
      mov eax,0
615
      mov eax,0
598
      sub eax,[v_y]
616
      sub eax,[v_y]
599
      mov [v_y],eax
617
      mov [v_y],eax
600
      ;counting v_x:--------
618
      ;counting v_x:--------
601
      mov eax,[b_x]
619
      mov eax,[b_x]
602
      sub eax,[x]
620
      sub eax,[x]
603
      sub eax,5
621
      sub eax,5
604
      mov ecx,eax
622
      mov ecx,eax
605
      if_a eax,100,.end_if3
623
      if_a eax,100,.end_if3
606
        mov eax,0
624
        mov eax,0
607
        sub eax,[v_x]
625
        sub eax,[v_x]
608
        mov [v_x],eax
626
        mov [v_x],eax
609
        jmp .skip
627
        jmp .skip
610
      .end_if3:
628
      .end_if3:
611
      if_a eax,20,.end_if2
629
      if_a eax,20,.end_if2
612
        sub eax,20
630
        sub eax,20
613
        shr eax,2
631
        shr eax,2
614
        mov [v_x],eax
632
        mov [v_x],eax
615
        jmp .skip
633
        jmp .skip
616
      .end_if2:
634
      .end_if2:
617
        mov ebx,20
635
        mov ebx,20
618
        sub ebx,ecx
636
        sub ebx,ecx
619
        shr ebx,2
637
        shr ebx,2
620
        mov dword [v_x],0
638
        mov dword [v_x],0
621
        sub dword [v_x],ebx
639
        sub dword [v_x],ebx
622
    .skip:
640
    .skip:
623
 
641
 
624
    ; BALL <-> BRICK
642
    ; BALL <-> BRICK
625
    mov dword [coliz],0
643
    mov dword [coliz],0
626
    call colision
644
    call colision
627
    if_e dword [coliz],1,.end_if6
645
    if_e dword [coliz],1,.end_if6
628
       ;abs dword [v_y]
646
       ;abs dword [v_y]
629
       ;abs dword [v_x]
647
       ;abs dword [v_x]
630
       ret
648
       ret
631
    .end_if6:
649
    .end_if6:
632
    add dword [b_x],10
650
    add dword [b_x],10
633
    call colision
651
    call colision
634
    sub dword [b_x],10
652
    sub dword [b_x],10
635
    if_e dword [coliz],1,.end_if7
653
    if_e dword [coliz],1,.end_if7
636
       ;abs dword [v_y]
654
       ;abs dword [v_y]
637
       ;abs dword [v_x]
655
       ;abs dword [v_x]
638
       ch_sign dword [v_x]
656
       ch_sign dword [v_x]
639
       ret
657
       ret
640
    .end_if7:
658
    .end_if7:
641
    add dword [b_y],10
659
    add dword [b_y],10
642
    call colision
660
    call colision
643
    sub dword [b_y],10
661
    sub dword [b_y],10
644
    if_e dword [coliz],1,.end_if8
662
    if_e dword [coliz],1,.end_if8
645
       ;abs dword [v_y]
663
       ;abs dword [v_y]
646
       ;abs dword [v_x]
664
       ;abs dword [v_x]
647
       ;ch_sign dword [v_y]
665
       ;ch_sign dword [v_y]
648
       ret
666
       ret
649
    .end_if8:
667
    .end_if8:
650
    add dword [b_x],10
668
    add dword [b_x],10
651
    add dword [b_y],10
669
    add dword [b_y],10
652
    call colision
670
    call colision
653
    sub dword [b_x],10
671
    sub dword [b_x],10
654
    sub dword [b_y],10
672
    sub dword [b_y],10
655
    if_e dword [coliz],1,.end_if9
673
    if_e dword [coliz],1,.end_if9
656
       ;abs dword [v_y]
674
       ;abs dword [v_y]
657
       ;abs dword [v_x]
675
       ;abs dword [v_x]
658
       ;ch_sign dword [v_x]
676
       ;ch_sign dword [v_x]
659
       ;ch_sign dword [v_y]
677
       ;ch_sign dword [v_y]
660
 
678
 
661
       ret
679
       ret
662
    .end_if9:
680
    .end_if9:
663
 
681
 
664
 
682
 
665
ret
683
ret
666
 
684
 
667
colision:
685
colision:
668
 
686
 
669
    mov  esi,levels
687
    mov  esi,levels
670
    mov  eax,[level] ; eax = levels*100
688
    mov  eax,[level] ; eax = levels*100
671
    mov  bx,100
689
    mov  bx,100
672
    mul  bx
690
    mul  bx
673
    add  esi,eax
691
    add  esi,eax
674
    ;--------------
692
    ;--------------
675
    xor  edx,edx
693
    xor  edx,edx
676
    mov  eax,[b_x]
694
    mov  eax,[b_x]
677
    mov  ebx,40
695
    mov  ebx,40
678
    div  ebx
696
    div  ebx
679
    mov  ecx,eax
697
    mov  ecx,eax
680
    push edx ;#>1
698
    push edx ;#>1
681
 
699
 
682
    xor edx,edx
700
    xor edx,edx
683
    mov  eax,[b_y]
701
    mov  eax,[b_y]
684
    mov  ebx,20
702
    mov  ebx,20
685
    div  ebx
703
    div  ebx
686
    push edx ;#>2
704
    push edx ;#>2
687
    cmp  eax,9 ; out of the bricks board
705
    cmp  eax,9 ; out of the bricks board
688
    ja .ok2
706
    ja .ok2
689
    mov  ebx,10
707
    mov  ebx,10
690
    mul  ebx
708
    mul  ebx
691
    add  eax,ecx
709
    add  eax,ecx
692
    add  esi,eax
710
    add  esi,eax
693
 
711
 
694
    cmp byte [esi],0 ; 0 - no brick
712
    cmp byte [esi],0 ; 0 - no brick
695
    je .ok2
713
    je .ok2
696
      if_ne byte [esi],4,.end_if1
714
      if_ne byte [esi],4,.end_if1
697
        dec byte [esi]
715
        dec byte [esi]
698
      .end_if1:
716
      .end_if1:
699
      mov dword [coliz],1
717
      mov dword [coliz],1
700
      pop ebx ;#<2
718
      pop ebx ;#<2
701
      pop eax ;#<1
719
      pop eax ;#<1
702
      cmp ecx,8 ; x < 5 || x >35 - x inv
720
      cmp ecx,8 ; x < 5 || x >35 - x inv
703
      jb  .inv
721
      jb  .inv
704
      cmp ecx,33
722
      cmp ecx,33
705
      ja  .inv
723
      ja  .inv
706
      jmp .no_inv
724
      jmp .no_inv
707
      .inv:
725
      .inv:
708
        mov eax,0
726
        mov eax,0
709
        sub eax,[v_x]
727
        sub eax,[v_x]
710
        mov [v_x],eax
728
        mov [v_x],eax
711
        ;jmp .no_ok
729
        ;jmp .no_ok
712
      .no_inv:
730
      .no_inv:
713
      cmp ebx,6 ; if y < 5 || y>15 - y inv
731
      cmp ebx,6 ; if y < 5 || y>15 - y inv
714
      jb .inv_y
732
      jb .inv_y
715
      cmp ebx,14
733
      cmp ebx,14
716
      ja .inv_y
734
      ja .inv_y
717
      jmp .no_ok
735
      jmp .no_ok
718
        .inv_y:
736
        .inv_y:
719
        mov eax,0
737
        mov eax,0
720
        sub eax,[v_y]
738
        sub eax,[v_y]
721
        mov [v_y],eax
739
        mov [v_y],eax
722
      .no_ok:
740
      .no_ok:
723
      jmp .ok
741
      jmp .ok
724
    .ok2:
742
    .ok2:
725
      pop eax ;#<1
743
      pop eax ;#<1
726
      pop eax ;#<2
744
      pop eax ;#<2
727
    .ok:
745
    .ok:
728
 
746
 
729
 
747
 
730
ret
748
ret
731
 
749
 
732
;-----------------------------------;
750
;-----------------------------------;
733
; DRAWS CURRENT LEVEL ON THE SCREEN ;
751
; DRAWS CURRENT LEVEL ON THE SCREEN ;
734
;-----------------------------------;
752
;-----------------------------------;
735
draw_level:
753
draw_level:
736
    mov  esi,levels
754
    mov  esi,levels
737
    mov  eax,[level] ; eax = levels*100
755
    mov  eax,[level] ; eax = levels*100
738
    mov  bx,100
756
    mov  bx,100
739
    mul  bx
757
    mul  bx
740
    add  esi,eax
758
    add  esi,eax
741
    mov  ecx,10
759
    mov  ecx,10
742
    mov  eax,0
760
    mov  eax,0
743
    mov dword [l_end],1
761
    mov dword [l_end],1
744
    .l_y:
762
    .l_y:
745
      push ecx ;#>1
763
      push ecx ;#>1
746
      mov ebx,0
764
      mov ebx,0
747
      mov ecx,10
765
      mov ecx,10
748
      .l_x:
766
      .l_x:
749
        cmp byte [esi],1 ; if 1 ?
767
        cmp byte [esi],1 ; if 1 ?
750
        push esi;#>2
768
        push esi;#>2
751
        jne .no_1
769
        jne .no_1
752
          mov  esi,img_brick1
770
          mov  esi,img_brick1
753
          call put_bmp_screen
771
          call put_bmp_screen
754
          mov dword [l_end],0
772
          mov dword [l_end],0
755
        .no_1:
773
        .no_1:
756
        cmp byte [esi],2 ; if 2 ?
774
        cmp byte [esi],2 ; if 2 ?
757
        jne .no_2
775
        jne .no_2
758
          mov  esi,img_brick2
776
          mov  esi,img_brick2
759
          call put_bmp_screen
777
          call put_bmp_screen
760
          mov dword [l_end],0
778
          mov dword [l_end],0
761
        .no_2:
779
        .no_2:
762
        cmp byte [esi],3 ; if 3 ?
780
        cmp byte [esi],3 ; if 3 ?
763
        jne .no_3
781
        jne .no_3
764
          mov  esi,img_brick3
782
          mov  esi,img_brick3
765
          call put_bmp_screen
783
          call put_bmp_screen
766
          mov dword [l_end],0
784
          mov dword [l_end],0
767
        .no_3:
785
        .no_3:
768
        cmp byte [esi],4 ; if 4 ?
786
        cmp byte [esi],4 ; if 4 ?
769
        jne .no_4
787
        jne .no_4
770
          mov  esi,img_brick4
788
          mov  esi,img_brick4
771
          call put_bmp_screen
789
          call put_bmp_screen
772
        .no_4:
790
        .no_4:
773
 
791
 
774
        add ebx,40
792
        add ebx,40
775
        pop esi ;#<2
793
        pop esi ;#<2
776
        inc esi
794
        inc esi
777
      loop .l_x
795
      loop .l_x
778
      add eax,20 ;#<1
796
      add eax,20 ;#<1
779
      pop  ecx
797
      pop  ecx
780
    loop .l_y
798
    loop .l_y
781
;----------------
799
;----------------
782
; NEXT LEVEL
800
; NEXT LEVEL
783
    if_e dword [l_end],1,.end_if ; all bricks are taken
801
    if_e dword [l_end],1,.end_if ; all bricks are taken
784
    if_e dword [mode],1,.end_if
802
    if_e dword [mode],1,.end_if
785
        add dword [level],1
803
        add dword [level],1
786
        if_a dword [level],MAX_LEVEL,.end_if2
804
        if_a dword [level],MAX_LEVEL,.end_if2
787
           mov dword [mode],4 ; game over
805
           mov dword [mode],4 ; game over
788
           jmp still
806
           jmp still
789
        .end_if2:
807
        .end_if2:
790
        call fast_gfx
808
        call fast_gfx
791
        mov dword [mode],2
809
        mov dword [mode],2
792
    .end_if:
810
    .end_if:
793
ret
811
ret
794
 
812
 
795
;   *********************************************
813
;   *********************************************
796
;   *******  WINDOW DEFINITIONS AND DRAW ********
814
;   *******  WINDOW DEFINITIONS AND DRAW ********
797
;   *********************************************
815
;   *********************************************
798
 
816
 
799
 
817
 
800
draw_window:
818
draw_window:
801
 
819
 
802
    mcall 12,1
820
    mcall 12,1
803
    mcall 0,<100,X_SIZE+8>,<100,Y_SIZE+21>,0x14ffffff, , VERSION
821
    mcall 0,<100,X_SIZE+8>,<100,Y_SIZE+21>,0x14ffffff, , VERSION
-
 
822
 
-
 
823
    if lang eq it
804
 
824
        label 200,8,'VITE:',0x10ffffff
805
	
825
    else
-
 
826
        label 200,8,'LIVES:',0x10ffffff
-
 
827
    end if
806
	label 200,8,'LIVES:',0x10ffffff
828
 
807
    outcount dword [lives],250,8,0x10ffffff,65536
829
    outcount dword [lives],250,8,0x10ffffff,65536
808
 
830
 
809
    cmp [is_rolled_up], 1
831
    cmp [is_rolled_up], 1
810
    je  @f
832
    je  @f
811
    call fast_gfx
833
    call fast_gfx
812
  @@:
834
  @@:
813
 
835
 
814
    mcall 12,2
836
    mcall 12,2
815
 
837
 
816
    ret
838
    ret
817
 
839
 
818
;-----------;####################
840
;-----------;####################
819
; DATA AREA ;####################
841
; DATA AREA ;####################
820
;-----------;####################
842
;-----------;####################
821
 
843
 
822
VERSION db 'ARCANOID II', 0
844
VERSION db 'ARCANOID II', 0
823
 
845
 
824
is_rolled_up dd 0
846
is_rolled_up dd 0
825
 
847
 
826
 lives dd 5
848
 lives dd 5
827
 mode dd 0
849
 mode dd 0
828
 l_end dd 0 ; if 1 the level is over
850
 l_end dd 0 ; if 1 the level is over
829
; PAD x:
851
; PAD x:
830
 x   dd 20
852
 x   dd 20
831
 y   dd Y_SIZE-20
853
 y   dd Y_SIZE-20
832
; PAD length:
854
; PAD length:
833
 s_x dd 40
855
 s_x dd 40
834
 
856
 
835
; the ball stuff ;-)
857
; the ball stuff ;-)
836
 b_x dd 100
858
 b_x dd 100
837
 b_y dd 250
859
 b_y dd 250
838
 v_y dd 0
860
 v_y dd 0
839
 v_x dd 3
861
 v_x dd 3
840
 
862
 
841
 speed_t dd 0 ; 1/10 times speedup
863
 speed_t dd 0 ; 1/10 times speedup
842
 del dd 1 ; delay
864
 del dd 1 ; delay
843
 
865
 
844
 coliz dd 0 ; if 1 then colizion with a brick
866
 coliz dd 0 ; if 1 then colizion with a brick
845
 
867
 
846
; LEVELS:
868
; LEVELS:
847
level dd 0
869
level dd 0
848
levels:
870
levels:
849
;LEVEL 0:
871
;LEVEL 0:
850
db 0,0,0,0,0,0,0,0,0,0
872
db 0,0,0,0,0,0,0,0,0,0
851
db 0,4,0,0,4,4,0,0,0,4
873
db 0,4,0,0,4,4,0,0,0,4
852
db 4,0,4,0,4,0,4,0,4,0
874
db 4,0,4,0,4,0,4,0,4,0
853
db 4,0,4,0,4,0,4,0,4,0
875
db 4,0,4,0,4,0,4,0,4,0
854
db 4,4,4,0,4,4,0,0,4,0
876
db 4,4,4,0,4,4,0,0,4,0
855
db 4,0,4,0,4,0,4,0,4,0
877
db 4,0,4,0,4,0,4,0,4,0
856
db 4,0,4,0,4,0,4,0,0,4
878
db 4,0,4,0,4,0,4,0,0,4
857
db 0,0,0,0,0,0,0,0,0,0
879
db 0,0,0,0,0,0,0,0,0,0
858
db 0,0,0,0,0,0,0,0,0,0
880
db 0,0,0,0,0,0,0,0,0,0
859
db 0,0,0,0,0,0,0,0,0,0
881
db 0,0,0,0,0,0,0,0,0,0
860
 
882
 
861
;LEVEL 1:
883
;LEVEL 1:
862
db 1,1,1,1,1,1,1,1,1,1
884
db 1,1,1,1,1,1,1,1,1,1
863
db 0,3,0,0,3,3,0,0,0,3
885
db 0,3,0,0,3,3,0,0,0,3
864
db 3,0,3,0,3,0,3,0,3,0
886
db 3,0,3,0,3,0,3,0,3,0
865
db 3,0,3,0,3,0,3,0,3,0
887
db 3,0,3,0,3,0,3,0,3,0
866
db 3,3,3,0,3,3,0,0,3,0
888
db 3,3,3,0,3,3,0,0,3,0
867
db 3,0,3,0,3,0,3,0,3,0
889
db 3,0,3,0,3,0,3,0,3,0
868
db 3,0,3,0,3,0,3,0,0,3
890
db 3,0,3,0,3,0,3,0,0,3
869
db 2,2,2,2,2,2,2,2,2,2
891
db 2,2,2,2,2,2,2,2,2,2
870
db 1,1,1,1,1,1,1,1,1,1
892
db 1,1,1,1,1,1,1,1,1,1
871
db 1,1,1,1,1,1,1,1,1,1
893
db 1,1,1,1,1,1,1,1,1,1
872
;LEVEL 2:
894
;LEVEL 2:
873
db 3,3,3,3,0,0,3,3,3,3
895
db 3,3,3,3,0,0,3,3,3,3
874
db 3,1,1,1,0,0,1,1,1,3
896
db 3,1,1,1,0,0,1,1,1,3
875
db 3,1,2,1,3,3,1,2,1,3
897
db 3,1,2,1,3,3,1,2,1,3
876
db 0,1,0,1,3,3,1,0,1,0
898
db 0,1,0,1,3,3,1,0,1,0
877
db 2,1,2,1,1,1,1,2,1,2
899
db 2,1,2,1,1,1,1,2,1,2
878
db 0,1,0,1,2,2,1,0,1,0
900
db 0,1,0,1,2,2,1,0,1,0
879
db 2,1,2,1,1,1,1,2,1,2
901
db 2,1,2,1,1,1,1,2,1,2
880
db 0,1,0,1,1,1,1,0,1,0
902
db 0,1,0,1,1,1,1,0,1,0
881
db 0,0,0,1,0,0,1,0,0,0
903
db 0,0,0,1,0,0,1,0,0,0
882
db 0,0,0,1,0,0,1,0,0,0
904
db 0,0,0,1,0,0,1,0,0,0
883
;LEVEL 3:
905
;LEVEL 3:
884
db 1,2,3,1,2,3,1,3,2,1
906
db 1,2,3,1,2,3,1,3,2,1
885
db 2,3,1,2,3,1,3,3,1,2
907
db 2,3,1,2,3,1,3,3,1,2
886
db 3,1,2,3,1,2,3,1,2,3
908
db 3,1,2,3,1,2,3,1,2,3
887
db 1,2,3,1,2,3,1,3,2,1
909
db 1,2,3,1,2,3,1,3,2,1
888
db 2,3,1,2,3,1,3,3,1,2
910
db 2,3,1,2,3,1,3,3,1,2
889
db 3,1,2,3,1,2,3,1,2,3
911
db 3,1,2,3,1,2,3,1,2,3
890
db 1,2,1,2,1,2,1,2,1,2
912
db 1,2,1,2,1,2,1,2,1,2
891
db 1,0,1,0,1,0,1,0,1,0
913
db 1,0,1,0,1,0,1,0,1,0
892
db 0,0,3,0,0,0,0,3,0,0
914
db 0,0,3,0,0,0,0,3,0,0
893
db 0,0,3,0,0,0,0,3,0,0
915
db 0,0,3,0,0,0,0,3,0,0
894
;LEVEL 4:
916
;LEVEL 4:
895
db 0,0,0,1,1,1,1,0,0,0
917
db 0,0,0,1,1,1,1,0,0,0
896
db 0,0,1,2,2,2,2,1,0,0
918
db 0,0,1,2,2,2,2,1,0,0
897
db 1,1,1,2,2,2,2,1,1,1
919
db 1,1,1,2,2,2,2,1,1,1
898
db 1,0,1,0,2,2,0,1,0,1
920
db 1,0,1,0,2,2,0,1,0,1
899
db 0,1,1,2,2,2,2,1,1,0
921
db 0,1,1,2,2,2,2,1,1,0
900
db 0,0,1,2,2,2,2,1,0,0
922
db 0,0,1,2,2,2,2,1,0,0
901
db 0,0,1,2,2,2,2,1,0,0
923
db 0,0,1,2,2,2,2,1,0,0
902
db 0,0,1,2,3,3,2,1,0,0
924
db 0,0,1,2,3,3,2,1,0,0
903
db 0,0,1,2,2,2,2,1,0,0
925
db 0,0,1,2,2,2,2,1,0,0
904
db 0,0,0,1,1,1,1,0,0,0
926
db 0,0,0,1,1,1,1,0,0,0
905
;LEVEL 5:
927
;LEVEL 5:
906
db 1,1,1,1,1,1,1,1,1,1
928
db 1,1,1,1,1,1,1,1,1,1
907
db 1,2,0,0,3,2,0,0,2,1
929
db 1,2,0,0,3,2,0,0,2,1
908
db 1,2,0,0,2,3,0,0,2,1
930
db 1,2,0,0,2,3,0,0,2,1
909
db 2,2,0,0,3,2,0,0,2,2
931
db 2,2,0,0,3,2,0,0,2,2
910
db 0,0,0,0,2,3,0,0,0,0
932
db 0,0,0,0,2,3,0,0,0,0
911
db 0,0,0,1,1,1,1,0,0,0
933
db 0,0,0,1,1,1,1,0,0,0
912
db 0,0,1,1,0,0,1,1,0,0
934
db 0,0,1,1,0,0,1,1,0,0
913
db 0,0,1,1,0,0,1,1,0,0
935
db 0,0,1,1,0,0,1,1,0,0
914
db 2,1,2,1,2,1,2,1,2,1
936
db 2,1,2,1,2,1,2,1,2,1
915
db 1,2,1,2,1,2,1,2,1,2
937
db 1,2,1,2,1,2,1,2,1,2
916
 
938
 
917
 
939
 
918
; BITMAPs and IMAGEs
940
; BITMAPs and IMAGEs
919
bmp_file:
941
bmp_file:
920
    file 'arcanii.bmp'
942
    file 'arcanii.bmp'
921
 
943
 
922
img_bmp:
944
img_bmp:
923
    rb 40*90*3+8
945
    rb 40*90*3+8
924
img_brick1:
946
img_brick1:
925
    rb 40*20*3+8
947
    rb 40*20*3+8
926
img_brick2:
948
img_brick2:
927
    rb 40*20*3+8
949
    rb 40*20*3+8
928
img_brick3:
950
img_brick3:
929
    rb 40*20*3+8
951
    rb 40*20*3+8
930
img_brick4:
952
img_brick4:
931
    rb 40*20*3+8
953
    rb 40*20*3+8
932
img_ball:
954
img_ball:
933
    rb 10*10*3+8
955
    rb 10*10*3+8
934
img_bonus:
956
img_bonus:
935
    rb 20*10*3+8
957
    rb 20*10*3+8
936
 
958
 
937
 
959
 
938
screen_img:
960
screen_img:
939
    dd X_SIZE
961
    dd X_SIZE
940
    dd Y_SIZE
962
    dd Y_SIZE
941
screen:
963
screen:
942
    rb X_SIZE*Y_SIZE*3
964
    rb X_SIZE*Y_SIZE*3
943
proc_info:
965
proc_info:
944
    rb 1024
966
    rb 1024
945
I_END:
967
I_END:
946
>
-
 
947
>
968
>
948
>
969
>
949
>
970
>
950
>
971
>
951
>
972
>
952
>
973
>
953
>
974
>
954
>
975
>
955
>
976
>
956
>
977
>
957
>
978
>
958
>
979
>
959
>
980
>
960
>
981
>
-
 
982
>