Subversion Repositories Kolibri OS

Rev

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

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