Subversion Repositories Kolibri OS

Rev

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

Rev 1520 Rev 1522
Line 14... Line 14...
14
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
14
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
15
;include '../../../system/board/trunk/debug.inc'
15
;include '../../../system/board/trunk/debug.inc'
Line 16... Line 16...
16
 
16
 
Line 17... Line -...
17
;;===Define_chapter============================================================================================================
-
 
18
 
-
 
19
WINDOW_WIDTH                equ     550
-
 
20
WINDOW_HEIGHT               equ     320
-
 
21
GRID_STEP                   equ     20
-
 
22
GRID_BEGIN_X                equ     31
-
 
23
GRID_BEGIN_Y                equ     31
-
 
24
GRID_WIDTH                  equ     24
-
 
25
GRID_HEIGHT                 equ     11
-
 
26
GRID_ENDS_WIDTH             equ     13
-
 
27
 
-
 
28
BOTTOM_TOP_STRINGS          equ     270
-
 
29
BOTTOM_MIDDLE_STRINGS       equ     276
-
 
30
BOTTOM_BOTTOM_STRINGS       equ     282
-
 
31
TOP_STRINGS                 equ     5
17
;;===Define_chapter============================================================================================================
Line 32... Line 18...
32
 
18
 
33
SCORE_EAT                   equ     100
19
SCORE_EAT                   equ     100
34
 
20
 
Line 57... Line 43...
57
    mov  dword[eax],    '.ini'
43
    mov  dword[eax],    '.ini'
Line 58... Line 44...
58
 
44
 
59
      invoke  ini.get_int, cur_dir_path, aPreferences, aSpeed, 80
45
      invoke  ini.get_int, cur_dir_path, aPreferences, aSpeed, 80
60
    neg  eax
46
    neg  eax
61
    add  [time_wait_limit],    eax
47
    add  [time_wait_limit],    eax
62
      invoke  ini.get_int, cur_dir_path, aPreferences, aDecorations, 2
48
      invoke  ini.get_int, cur_dir_path, aPreferences, aSquare_side_length, 19
-
 
49
    mov  [square_side_length],  eax
-
 
50
      invoke  ini.get_int, cur_dir_path, aPreferences, aSpace_between_squares, 1
-
 
51
    mov  [space_between_squares],   eax
Line -... Line 52...
-
 
52
      invoke  ini.get_str, cur_dir_path, aPreferences, aTheme, aTheme_name, 31, aTheme_name
-
 
53
 
63
    mov  [decorations], al
54
      invoke  ini.get_int, cur_dir_path, aTheme_name, aDecorations, 2
64
 
55
    mov  [decorations], al
65
      invoke  ini.get_color, cur_dir_path, aColors, aBackground_color, 0x000000
56
      invoke  ini.get_color, cur_dir_path, aTheme_name, aBackground_color, 0x000000
66
    or   [background_color],    eax
57
    or   [background_color],    eax
67
    or   [window_style],    eax
58
    or   [window_style],    eax
68
      invoke  ini.get_color, cur_dir_path, aColors, aDecorations_color, 0x00aaaa00
59
      invoke  ini.get_color, cur_dir_path, aTheme_name, aDecorations_color, 0x00aaaa00
69
    or   [decorations_color],  eax
60
    or   [decorations_color],  eax
70
      invoke  ini.get_color, cur_dir_path, aColors, aSnake_color, 0x1111ff
61
      invoke  ini.get_color, cur_dir_path, aTheme_name, aSnake_color, 0x1111ff
71
    or   [snake_color], eax
62
    or   [snake_color], eax
72
      invoke  ini.get_color, cur_dir_path, aColors, aSnake_head_color, 0x1111ff
63
      invoke  ini.get_color, cur_dir_path, aTheme_name, aSnake_head_color, 0x1111ff
73
    or   [snake_head_color], eax
64
    or   [snake_head_color], eax
74
      invoke  ini.get_color, cur_dir_path, aColors, aSnake_picture_color, 0x4488ff
65
      invoke  ini.get_color, cur_dir_path, aTheme_name, aSnake_picture_color, 0x4488ff
75
    or   [snake_picture_color], eax
66
    or   [snake_picture_color], eax
76
      invoke  ini.get_color, cur_dir_path, aColors, aVersion_picture_color, 0x55ff55
67
      invoke  ini.get_color, cur_dir_path, aTheme_name, aVersion_picture_color, 0x55ff55
77
    or   [version_picture_color],   eax
68
    or   [version_picture_color],   eax
78
      invoke  ini.get_color, cur_dir_path, aColors, aPause_picture_color, 0x11ff11
69
      invoke  ini.get_color, cur_dir_path, aTheme_name, aPause_picture_color, 0x11ff11
79
    or   [pause_picture_color], eax
70
    or   [pause_picture_color], eax
80
      invoke  ini.get_color, cur_dir_path, aColors, aGame_over_picture_color, 0xff1111
71
      invoke  ini.get_color, cur_dir_path, aTheme_name, aGame_over_picture_color, 0xff1111
81
    or   [game_over_picture_color], eax
72
    or   [game_over_picture_color], eax
82
      invoke  ini.get_color, cur_dir_path, aColors, aEat_color, 0xffff11
73
      invoke  ini.get_color, cur_dir_path, aTheme_name, aEat_color, 0xffff11
83
    or   [eat_color],   eax
74
    or   [eat_color],   eax
84
      invoke  ini.get_color, cur_dir_path, aColors, aNavigation_strings_color, 0x80ff7777
75
      invoke  ini.get_color, cur_dir_path, aTheme_name, aNavigation_strings_color, 0x80ff7777
85
    or   [navigation_strings_color], eax
76
    or   [navigation_strings_color], eax
86
      invoke  ini.get_color, cur_dir_path, aColors, aGame_over_strings_color, 0x80ff9900
77
      invoke  ini.get_color, cur_dir_path, aTheme_name, aGame_over_strings_color, 0x80ff9900
87
    or   [game_over_strings_color],  eax
78
    or   [game_over_strings_color],  eax
88
      invoke  ini.get_color, cur_dir_path, aColors, aScore_string_color, 0x80ffffff
79
      invoke  ini.get_color, cur_dir_path, aTheme_name, aScore_string_color, 0x80ffffff
89
    or   [score_string_color],   eax
80
    or   [score_string_color],   eax
90
      invoke  ini.get_color, cur_dir_path, aColors, aHiscore_string_color, 0x80ffffff
81
      invoke  ini.get_color, cur_dir_path, aTheme_name, aHiscore_string_color, 0x80ffffff
91
    or   [hiscore_string_color],   eax
82
    or   [hiscore_string_color],   eax
92
      invoke  ini.get_color, cur_dir_path, aColors, aChampion_string_color, 0x80ffffff
83
      invoke  ini.get_color, cur_dir_path, aTheme_name, aChampion_string_color, 0x80ffffff
93
    or   [champion_string_color],   eax
84
    or   [champion_string_color],   eax
94
      invoke  ini.get_color, cur_dir_path, aColors, aGame_over_hiscore_color, 0x80ffdd44
85
      invoke  ini.get_color, cur_dir_path, aTheme_name, aGame_over_hiscore_color, 0x80ffdd44
95
    or   [game_over_hiscore_color], eax
86
    or   [game_over_hiscore_color], eax
96
      invoke  ini.get_color, cur_dir_path, aColors, aScore_number_color, 0xffffff
87
      invoke  ini.get_color, cur_dir_path, aTheme_name, aScore_number_color, 0xffffff
97
    or   [score_number_color],   eax
88
    or   [score_number_color],   eax
98
      invoke  ini.get_color, cur_dir_path, aColors, aHiscore_number_color, 0x00ffffff
89
      invoke  ini.get_color, cur_dir_path, aTheme_name, aHiscore_number_color, 0x00ffffff
99
    or   [hiscore_number_color],   eax
90
    or   [hiscore_number_color],   eax
100
      invoke  ini.get_color, cur_dir_path, aColors, aChampion_name_color, 0x80ffffff
91
      invoke  ini.get_color, cur_dir_path, aTheme_name, aChampion_name_color, 0x80ffffff
101
    or   [champion_name_color],   eax
92
    or   [champion_name_color],   eax
Line 102... Line 93...
102
      invoke  ini.get_color, cur_dir_path, aColors, aEdit_box_selection_color, 0x00aa00
93
      invoke  ini.get_color, cur_dir_path, aTheme_name, aEdit_box_selection_color, 0x00aa00
103
    or   [edit1+0x10],  eax
94
    or   [edit1+0x10],  eax
104
 
95
 
105
    mov  eax, [background_color]
96
    mov  eax, [background_color]
106
    mov  [edit1+0x0C],  eax
97
    mov  [edit1+0x0C],  eax
107
    mov  [edit1+0x14],  eax
98
    mov  [edit1+0x14],  eax
Line -... Line 99...
-
 
99
    mov  [edit1+0x18],  eax
-
 
100
    mov  eax, [game_over_hiscore_color]
108
    mov  [edit1+0x18],  eax
101
    mov  [edit1+0x1C],  eax
109
    mov  eax, [game_over_hiscore_color]
102
 
110
    mov  [edit1+0x1C],  eax
103
      call      Set_geometry
111
 
104
 
Line 112... Line 105...
112
include 'first_menu.asm'            ; First menu body and functions
105
include 'first_menu.asm'            ; First menu body and functions
Line 113... Line 106...
113
include 'level.asm'                 ; Level body and functions (game process)
106
include 'level.asm'                 ; Level body and functions (game process)
114
include 'pause.asm'                 ; Pause body and functions
107
include 'pause.asm'                 ; Pause body and functions
Line 115... Line 108...
115
include 'game_over.asm'             ; Game_over body and functions
108
include 'game_over.asm'             ; Game_over body and functions
116
 
109
 
Line 117... Line 110...
117
;;===Some_functions============================================================================================================
110
;;===Some_functions============================================================================================================
-
 
111
 
-
 
112
Exit:
-
 
113
    ;;===Exit==================================================================================================================
-
 
114
 
-
 
115
    or  eax,    -1
-
 
116
    int 0x40
-
 
117
    
-
 
118
    ;;---Exit------------------------------------------------------------------------------------------------------------------
-
 
119
 
-
 
120
 
-
 
121
Set_geometry:
-
 
122
    ;;===Set_geometry==========================================================================================================
-
 
123
 
-
 
124
    mov  eax, [space_between_squares]
-
 
125
    add  eax, [square_side_length]
-
 
126
    mov  [g_s],   eax
-
 
127
 
-
 
128
    mov  eax, [g_s]
-
 
129
    shr  eax, 1
-
 
130
    mov  ebx, eax
-
 
131
    shr  ebx, 1
-
 
132
    add  eax, ebx
-
 
133
    mov  [g_e], eax
-
 
134
 
-
 
135
    mov  eax, [g_s]
-
 
136
    add  eax, [g_e]
-
 
137
    mov  [gbxm1],   eax
-
 
138
 
-
 
139
    mov  eax, [g_e]
-
 
140
    add  eax, 25
-
 
141
    mov  [gbym1],   eax
-
 
142
 
-
 
143
    mov  eax, [g_w]
-
 
144
    mul  word[g_h]
-
 
145
    mov  [gw_mul_gh],   eax
-
 
146
 
-
 
147
    mov  edx, [g_w]
-
 
148
    mov  eax, [g_s]
-
 
149
    mul  dx
-
 
150
    mov  [gw_mul_gs],   eax
-
 
151
 
-
 
152
    mov  edx, [g_h]
-
 
153
    mov  eax, [g_s]
-
 
154
    mul  dx
-
 
155
    mov  [gh_mul_gs],   eax
-
 
156
 
-
 
157
    mov  eax, [gbxm1]
-
 
158
    add  eax, [gw_mul_gs]
-
 
159
    mov  [gbxm1_plus_gw_mul_gs],    eax
-
 
160
 
-
 
161
    mov  eax, [gbym1]
-
 
162
    add  eax, [gh_mul_gs]
-
 
163
    mov  [gbym1_plus_gh_mul_gs],    eax
-
 
164
 
-
 
165
    mov  eax, [g_s]
-
 
166
    shl  eax, 16
-
 
167
    add  eax, [g_s]
-
 
168
    mov  [gs_shl16_gs], eax
-
 
169
 
-
 
170
    mov  eax, [gbxm1]
-
 
171
    shl  eax, 16
-
 
172
    add  eax, [gbxm1]
-
 
173
    mov  [gbxm1_shl16_gbxm1],   eax
-
 
174
 
-
 
175
    mov  eax, [gbym1]
-
 
176
    shl  eax, 16
-
 
177
    add  eax, [gbym1]
-
 
178
    mov  [gbym1_shl16_gbym1],   eax
-
 
179
 
-
 
180
 
-
 
181
    mov  eax, [gw_mul_gs]
-
 
182
    add  eax, [gbxm1]
-
 
183
    add  eax, [gbxm1]
-
 
184
    add  eax, 5*2                                   ; skin width
-
 
185
    mov  [window_width],    eax
-
 
186
 
-
 
187
    mov  eax, [gh_mul_gs]
-
 
188
    add  eax, [gbym1]
-
 
189
    add  eax, [g_e]
-
 
190
    add  eax, 30
-
 
191
    add  eax, 22+5                                  ; skin height
-
 
192
    mov  [window_height],   eax
-
 
193
 
-
 
194
      mcall     48, 5
-
 
195
    mov  dx,  ax
-
 
196
    shr  eax, 16
-
 
197
    sub  dx,  ax
-
 
198
    cmp  dx, word[window_width]                     ; does window fit to work area width?
-
 
199
     jnl @f
-
 
200
    dec  [square_side_length]
-
 
201
;    dps  'snake: Window does not fit to screen.'
-
 
202
;    newline
-
 
203
;    dps  'Square_side_length was decreased.'
-
 
204
;    newline
-
 
205
;    dps  'Check you config file! (snake.ini)'
-
 
206
;    newline
-
 
207
     jmp Set_geometry
-
 
208
  @@:
-
 
209
 
-
 
210
    mov  cx,  bx
-
 
211
    shr  ebx, 16
-
 
212
    sub  cx,  bx
-
 
213
    cmp  cx, word[window_height]                     ; does window fit to work area height?
-
 
214
     jnl @f
-
 
215
    dec  [square_side_length]
-
 
216
;    dps  'snake: Window does not fit to screen.'
-
 
217
;    newline
-
 
218
;    dps  'Square_side_length was decreased.'
-
 
219
;    newline
-
 
220
;    dps  'Check you config file! (snake.ini)'
-
 
221
;    newline
-
 
222
     jmp Set_geometry
-
 
223
  @@:
-
 
224
 
-
 
225
    sub  dx,  word[window_width]
-
 
226
    shr  dx,  1
-
 
227
    mov  word[wp_x],    dx
-
 
228
    sub  cx,  word[window_height]
-
 
229
    shr  cx,  1
-
 
230
    mov  dx,  cx
-
 
231
    shr  cx,  1
-
 
232
    add  cx,  dx
-
 
233
    mov  word[wp_y],    cx
-
 
234
 
-
 
235
    mov  [top_strings], 8
-
 
236
    mov  eax, [window_height]
-
 
237
    sub  eax, 50
-
 
238
    mov  [bottom_top_strings],  eax
-
 
239
    add  eax, 6
-
 
240
    mov  [bottom_middle_strings],  eax
-
 
241
    add  eax, 6
Line 118... Line 242...
118
 
242
    mov  [bottom_bottom_strings],  eax
119
Exit:
243
 
Line 120... Line 244...
120
    ;;===Exit==============================================================================================================
244
    sub  eax, 4
-
 
245
    mov  [edit1+0x08],  eax
121
 
246
 
122
    or  eax,    -1
247
    ret
123
    int 0x40
248
 
124
    
249
    ;;---Set_geometry------------------------------------------------------------------------------------------------------
125
    ;;---Exit--------------------------------------------------------------------------------------------------------------
250
 
126
    
251
 
127
    
252
Draw_decorations:
128
Draw_decorations:
253
    ;;===Draw_decorations==================================================================================================
129
    ;;===Draw_decorations==================================================================================================
254
 
130
 
255
    mov  al, [decorations]
131
    cmp  [decorations], 1
256
    dec  al
132
     je  grid_lines
257
     jz  grid_lines
133
    cmp  [decorations], 2
258
    dec  al
134
     je  grid_lines_with_ends
259
     jz  grid_lines_with_ends
135
    cmp  [decorations], 3
260
    dec  al
136
     je  grid_lines_with_corners
261
     jz  grid_lines_with_corners
137
    cmp  [decorations], 4
262
    dec  al
138
     je  grid_dots
263
     jz  grid_dots
139
    cmp  [decorations], 5
264
    dec  al
140
     je  borders_lines
265
     jz  borders_lines
141
    cmp  [decorations], 6
266
    dec  al
142
     je  borders_lines_with_ends
267
     jz  borders_lines_with_corners
Line 143... Line 268...
143
    cmp  [decorations], 7
268
    dec  al
Line 144... Line 269...
144
     je  borders_dots
269
     jz  borders_dots
145
    cmp  [decorations], 8
270
    dec  al
-
 
271
     jz  corners_dots
146
     je  corners_dots
272
    dec  al
-
 
273
     jz  corners_inner
-
 
274
    dec  al
147
    cmp  [decorations], 9
275
     jz  corners_outer
-
 
276
    dec  al
-
 
277
     jz  corners_crosses
Line 148... Line 278...
148
     je  corners_inner
278
    ret
149
    cmp  [decorations], 10
279
 
150
     je  corners_outer
280
 
151
    cmp  [decorations], 11
281
  grid_lines:
152
     je  corners_crosses
282
 
153
    ret
283
    mov  eax, 38
154
 
284
;mov  ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1)
-
 
285
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
286
;mov  ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)
155
 
287
    mov  ecx, [gbym1_shl16_gbym1]
-
 
288
    add  ecx, [gh_mul_gs]
-
 
289
    mov  edx, [decorations_color]
Line 156... Line 290...
156
  grid_lines:
290
    mov  esi, [g_w]
157
 
291
    add  esi, 1
158
    mov  eax, 38
292
 
159
    mov  ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1)
293
  @@:
160
    mov  ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)
294
      mcall
Line 161... Line 295...
161
    mov  edx, [decorations_color]
295
    add  ebx, [gs_shl16_gs]
Line 162... Line 296...
162
 
296
    dec  esi
Line 163... Line 297...
163
  @@:
297
     jnz @b
164
      mcall
298
 
-
 
299
;mov  ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)
-
 
300
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
301
    add  ebx, [gw_mul_gs]
165
    add  ebx, GRID_STEP*65536+GRID_STEP
302
    mov  ecx, [gbym1_shl16_gbym1]
-
 
303
    mov  esi, [g_h]
166
    cmp  ebx, (GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)
304
    add  esi, 1
-
 
305
    
-
 
306
  @@:
Line 167... Line 307...
167
     jng @b
307
      mcall
168
 
308
    add  ecx, [gs_shl16_gs]
169
    mov  ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)
309
    dec  esi
170
    mov  ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1)
310
     jnz @b
171
    
311
 
Line -... Line 312...
-
 
312
    ret
-
 
313
 
-
 
314
 
172
  @@:
315
  grid_lines_with_ends:
-
 
316
 
173
      mcall
317
    mov  eax, 38
-
 
318
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
319
    mov  ecx, [gbym1]
Line 174... Line 320...
174
    add  ecx, GRID_STEP*65536+GRID_STEP
320
    sub  ecx, [g_e]
175
    cmp  ecx, (GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)
321
    shl  ecx, 16
176
     jng @b
322
    add  ecx, [gbym1_plus_gh_mul_gs]
177
 
323
    add  ecx, [g_e]
178
    ret
324
    mov  edx, [decorations_color]
Line 179... Line 325...
179
 
325
    mov  esi, [g_w]
Line 180... Line 326...
180
 
326
    add  esi, 1
Line 212... Line 358...
212
 
358
 
Line 213... Line 359...
213
 
359
 
214
  grid_dots:
360
  grid_dots:
215
 
361
 
216
    mov  eax, 1
362
    mov  eax, 1
Line 217... Line 363...
217
    mov  ebx, GRID_BEGIN_X-1
363
    mov  ebx, [gbxm1]
218
    mov  ecx, GRID_BEGIN_Y-1
364
    mov  ecx, [gbym1]
219
    mov  edx, [decorations_color]
365
    mov  edx, [decorations_color]
220
 
366
 
221
  @@:
367
  @@:
222
      mcall
368
      mcall
223
    add  ebx, GRID_STEP
369
    add  ebx, [g_s]
224
    cmp  ebx, GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1
370
    cmp  ebx, [gbxm1_plus_gw_mul_gs]
225
     jng @b
371
     jng @b
226
    add  ecx, GRID_STEP
372
    add  ecx, [g_s]
Line 227... Line 373...
227
    cmp  ecx, GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1
373
    cmp  ecx, [gbym1_plus_gh_mul_gs]
228
     jg  @f
374
     jg  @f
Line 229... Line 375...
229
    mov  ebx, GRID_BEGIN_X-1
375
    mov  ebx, [gbxm1]
Line -... Line 376...
-
 
376
     jmp @b
-
 
377
 
-
 
378
  @@:
-
 
379
    ret
230
     jmp @b
380
 
-
 
381
 
-
 
382
  borders_lines:
-
 
383
 
-
 
384
    mov  eax, 38
231
 
385
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
386
    mov  ecx, [gbym1_shl16_gbym1]
-
 
387
    add  ecx, [gh_mul_gs]
-
 
388
    mov  edx, [decorations_color]
-
 
389
      mcall
-
 
390
 
-
 
391
    mov  ebx, [gbxm1_plus_gw_mul_gs]
-
 
392
    shl  ebx, 16
232
  @@:
393
    add  ebx, [gbxm1_plus_gw_mul_gs]
-
 
394
      mcall
233
    ret
395
 
-
 
396
    mov  ebx, [gbxm1_shl16_gbxm1]
Line 234... Line 397...
234
 
397
    add  ebx, [gw_mul_gs]
Line 235... Line 398...
235
 
398
    mov  ecx, [gbym1_shl16_gbym1]
Line 236... Line 399...
236
  borders_lines:
399
      mcall
237
 
400
 
Line 238... Line 401...
238
      mcall     38,(GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1),17*65536+263,[decorations_color]
401
    mov  ecx, [gbym1_plus_gh_mul_gs]
Line 239... Line 402...
239
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1), ,
402
    shl  ecx, 16
Line 240... Line 403...
240
      mcall       ,17*65536+523,(GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1)
403
    add  ecx, [gbym1_plus_gh_mul_gs]
241
      mcall       ,17*65536+523,(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)
404
      mcall
242
 
405
 
243
    ret
406
    ret
244
 
407
 
245
 
408
 
246
  borders_lines_with_ends:
409
  borders_lines_with_corners:
247
 
410
 
248
      call      borders_lines
411
      call      borders_lines
Line 249... Line 412...
249
      call      corners_outer
412
      call      corners_outer
250
 
413
 
251
    ret
414
    ret
252
 
415
 
253
 
416
 
254
  borders_dots:
417
  borders_dots:
255
 
418
 
Line 256... Line 419...
256
    mov  eax, 1
419
    mov  eax, 1
257
    mov  ebx, GRID_BEGIN_X-1
420
    mov  ebx, [gbxm1]
258
    mov  ecx, GRID_BEGIN_Y-1
421
    mov  ecx, [gbym1]
259
    mov  edx, [decorations_color]
422
    mov  edx, [decorations_color]
260
  @@:
423
  @@:
261
      mcall
424
      mcall
262
    add  ebx, GRID_STEP
425
    add  ebx, [g_s]
Line 263... Line 426...
263
    cmp  ebx, GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP
426
    cmp  ebx, [gbxm1_plus_gw_mul_gs]
264
     jng @b
427
     jng @b
265
 
428
 
266
    mov  ebx, GRID_BEGIN_X-1
429
    mov  ebx, [gbxm1]
267
    mov  ecx, GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP
430
    mov  ecx, [gbym1_plus_gh_mul_gs]
268
  @@:
431
  @@:
269
      mcall
432
      mcall
Line 270... Line 433...
270
    add  ebx, GRID_STEP
433
    add  ebx, [g_s]
Line 271... Line 434...
271
    cmp  ebx, GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP
434
    cmp  ebx, [gbxm1_plus_gw_mul_gs]
Line -... Line 435...
-
 
435
     jng @b
-
 
436
 
-
 
437
    mov  ebx, [gbxm1]
-
 
438
    mov  ecx, [gbym1]
-
 
439
  @@:
-
 
440
      mcall
-
 
441
    add  ecx, [g_s]
-
 
442
    cmp  ecx, [gbym1_plus_gh_mul_gs]
-
 
443
     jng @b
272
     jng @b
444
 
-
 
445
    mov  ebx, [gbxm1_plus_gw_mul_gs]
-
 
446
    mov  ecx, [gbym1]
273
 
447
  @@:
-
 
448
      mcall
-
 
449
    add  ecx, [g_s]
-
 
450
    cmp  ecx, [gbym1_plus_gh_mul_gs]
-
 
451
     jng @b
-
 
452
 
-
 
453
    ret
-
 
454
 
-
 
455
 
274
    mov  ebx, GRID_BEGIN_X-1
456
  corners_dots:
-
 
457
 
-
 
458
    mov  eax, 13
-
 
459
    mov  ebx, [gbxm1]
-
 
460
    dec  ebx
275
    mov  ecx, GRID_BEGIN_Y-1
461
    shl  ebx, 16
-
 
462
    add  ebx, 2
-
 
463
    mov  ecx, [gbym1]
-
 
464
    dec  ecx
Line 276... Line 465...
276
  @@:
465
    shl  ecx, 16
Line 277... Line 466...
277
      mcall
466
    add  ecx, 2
Line -... Line 467...
-
 
467
    mov  edx, [decorations_color]
-
 
468
      mcall
-
 
469
 
-
 
470
    mov  ebx, [gbxm1_plus_gw_mul_gs]
278
    add  ecx, GRID_STEP
471
    shl  ebx, 16
-
 
472
    add  ebx, 2
-
 
473
      mcall
279
    cmp  ecx, GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP
474
 
-
 
475
    mov  ebx, [gbxm1]
-
 
476
    dec  ebx
-
 
477
    shl  ebx, 16
-
 
478
    add  ebx, 2
280
     jng @b
479
    mov  ecx, [gbym1_plus_gh_mul_gs]
-
 
480
    shl  ecx, 16
-
 
481
    add  ecx, 2
281
 
482
      mcall
-
 
483
 
-
 
484
    mov  ebx, [gbxm1_plus_gw_mul_gs]
-
 
485
    shl  ebx, 16
-
 
486
    add  ebx, 2
-
 
487
      mcall
-
 
488
 
-
 
489
    ret
-
 
490
 
-
 
491
 
-
 
492
  corners_inner:
282
    mov  ebx, GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP
493
 
-
 
494
    mov  eax, 38
283
    mov  ecx, GRID_BEGIN_Y-1
495
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
496
    add  ebx, [g_e]
-
 
497
    mov  ecx, [gbym1_shl16_gbym1]
284
  @@:
498
    mov  edx, [decorations_color]
-
 
499
      mcall
-
 
500
 
285
      mcall
501
    mov  ecx, [gbym1_plus_gh_mul_gs]
-
 
502
    shl  ecx, 16
-
 
503
    add  ecx, [gbym1_plus_gh_mul_gs]
-
 
504
      mcall
-
 
505
 
Line 286... Line 506...
286
    add  ecx, GRID_STEP
506
    mov  ebx, [gbxm1_plus_gw_mul_gs]
Line 287... Line 507...
287
    cmp  ecx, GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP
507
    sub  ebx, [g_e]
Line -... Line 508...
-
 
508
    shl  ebx, 16
-
 
509
    add  ebx, [gbxm1_plus_gw_mul_gs]
-
 
510
      mcall
-
 
511
 
288
     jng @b
512
    mov  ecx, [gbym1_shl16_gbym1]
-
 
513
      mcall
-
 
514
 
289
 
515
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
516
    mov  ecx, [gbym1_shl16_gbym1]
-
 
517
    add  ecx, [g_e]
-
 
518
      mcall
-
 
519
 
290
    ret
520
    mov  ebx, [gbxm1_plus_gw_mul_gs]
-
 
521
    shl  ebx, 16
291
 
522
    add  ebx, [gbxm1_plus_gw_mul_gs]
-
 
523
      mcall
-
 
524
 
-
 
525
    mov  ecx, [gbym1_plus_gh_mul_gs]
-
 
526
    sub  ecx, [g_e]
-
 
527
    shl  ecx, 16
-
 
528
    add  ecx, [gbym1_plus_gh_mul_gs]
-
 
529
      mcall
-
 
530
 
-
 
531
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
532
      mcall
-
 
533
 
292
 
534
    ret
-
 
535
 
293
  corners_dots:
536
 
-
 
537
  corners_outer:
-
 
538
 
294
 
539
    mov  eax, 38
-
 
540
    mov  ebx, [gbxm1_shl16_gbxm1]
295
      mcall     13,(GRID_BEGIN_X-2)*65536+2,(GRID_BEGIN_Y-2)*65536+2,[decorations_color]
541
    sub  ebx, [g_e]
-
 
542
    mov  ecx, [gbym1_shl16_gbym1]
-
 
543
    mov  edx, [decorations_color]
-
 
544
      mcall
-
 
545
 
-
 
546
    mov  ecx, [gbym1_plus_gh_mul_gs]
Line 296... Line 547...
296
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+2,(GRID_BEGIN_Y-2)*65536+2,
547
    shl  ecx, 16
Line 297... Line 548...
297
      mcall     13,(GRID_BEGIN_X-2)*65536+2,(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+2,
548
    add  ecx, [gbym1_plus_gh_mul_gs]
Line 345... Line 596...
345
    ;; bh   -   y_coord
596
    ;; bh   -   y_coord
346
    ;; edx  -   color
597
    ;; edx  -   color
Line 347... Line 598...
347
 
598
 
Line 348... Line 599...
348
    mov  cl,  bh
599
    mov  cl,  bh
349
 
600
 
350
    mov  al,  20
601
    mov  al,  byte[g_s]
351
    mul  bl
602
    mul  bl
-
 
603
    mov  bx,  ax
352
    mov  bx,  ax
604
    add  bx,  word[gbxm1]
353
    add  bx,  31
605
    inc  bx
-
 
606
    shl  ebx, 16
Line 354... Line 607...
354
    shl  ebx, 16
607
    add  ebx, [g_s]
355
    add  ebx, 19
608
    dec  ebx
356
 
609
 
357
    mov  al,  20
610
    mov  al,  byte[g_s]
-
 
611
    mul  cl
358
    mul  cl
612
    mov  cx,  ax
359
    mov  cx,  ax
613
    add  cx,  word[gbym1]
-
 
614
    inc  cx
Line 360... Line 615...
360
    add  cx,  31
615
    shl  ecx, 16
Line 361... Line 616...
361
    shl  ecx, 16
616
    add  ecx, [g_s]
Line 369... Line 624...
369
    
624
    
370
    
625
    
Line -... Line 626...
-
 
626
Draw_menu_esc:
-
 
627
    ;;===Draw_menu_esc=====================================================================================================
-
 
628
 
-
 
629
    mov  ebx, [window_width]
-
 
630
    shr  ebx, 1
371
Draw_menu_esc:
631
    sub  ebx, (string_apply_name_enter-string_menu_esc-1)*3+6
Line 372... Line 632...
372
    ;;===Draw_menu_esc=====================================================================================================
632
    shl  ebx, 16
Line 373... Line 633...
373
 
633
    add  ebx, dword[top_strings]
Line 374... Line 634...
374
      mcall     4,234*65536+TOP_STRINGS,[navigation_strings_color],string_menu_esc
634
      mcall     4, ,[navigation_strings_color],string_menu_esc
375
    
635
    
Line -... Line 636...
-
 
636
    ret
-
 
637
    
-
 
638
    ;;---Draw_menu_esc-----------------------------------------------------------------------------------------------------
-
 
639
 
-
 
640
 
376
    ret
641
Draw_score_string:
Line 377... Line 642...
377
    
642
    ;;===Draw_score_string=================================================================================================
Line 378... Line 643...
378
    ;;---Draw_menu_esc-----------------------------------------------------------------------------------------------------
643
 
Line 379... Line 644...
379
 
644
    mov  ebx, [window_width]
380
 
645
    shr  ebx, 3
Line -... Line 646...
-
 
646
    sub  ebx, 5
-
 
647
    shl  ebx, 16
-
 
648
    add  ebx, dword[bottom_top_strings]
-
 
649
      mcall     4, ,[score_string_color],string_score
-
 
650
      
-
 
651
    ret
381
Draw_score_string:
652
    
Line 382... Line 653...
382
    ;;===Draw_score_string=================================================================================================
653
    ;;---Draw_score_string-------------------------------------------------------------------------------------------------
Line 383... Line 654...
383
    
654
    
Line 384... Line 655...
384
      mcall     4,56*65536+BOTTOM_TOP_STRINGS,[score_string_color],string_score
655
    
385
      
656
Draw_score_number:
Line -... Line 657...
-
 
657
    ;;===Draw_score_number================================================================================================= 
-
 
658
 
-
 
659
    mov  edx, [window_width]
-
 
660
    shr  edx, 3
-
 
661
    sub  edx, 6
-
 
662
    add  edx, (string_hi_score-string_score)*6
-
 
663
    shl  edx, 16
386
    ret
664
    add  edx, dword[bottom_top_strings]
Line 387... Line 665...
387
    
665
      mcall     47,0x00070000,[score], ,[score_number_color],[background_color]
Line 388... Line 666...
388
    ;;---Draw_score_string-------------------------------------------------------------------------------------------------
666
        
Line 389... Line 667...
389
    
667
    ret
390
    
668
        
Line -... Line 669...
-
 
669
    ;;---Draw_score_number-------------------------------------------------------------------------------------------------
-
 
670
 
-
 
671
 
-
 
672
Draw_hiscore_string:
-
 
673
    ;;===Draw_hiscore_string===============================================================================================
-
 
674
 
-
 
675
    mov  ebx, [window_width]
391
Draw_score_number:
676
    shr  ebx, 3
Line 392... Line 677...
392
    ;;===Draw_score_number================================================================================================= 
677
    neg  ebx
Line 393... Line 678...
393
    
678
    add  ebx, [window_width]
Line 394... Line 679...
394
      mcall     47,0x00070000,[score],104*65536+BOTTOM_TOP_STRINGS,[score_number_color],[background_color]
679
    sub  ebx, (string_player-string_hi_score)*6+7*6+5
395
        
680
    shl  ebx, 16
Line -... Line 681...
-
 
681
    add  ebx, dword[bottom_top_strings]
-
 
682
      mcall     4, ,[hiscore_string_color],string_hi_score
-
 
683
    
-
 
684
    ret
-
 
685
    
-
 
686
    ;;---Draw_hiscore_string-----------------------------------------------------------------------------------------------
-
 
687
 
396
    ret
688
    
Line 397... Line 689...
397
        
689
Draw_hiscore_number:
Line 398... Line 690...
398
    ;;---Draw_score_number-------------------------------------------------------------------------------------------------
690
    ;;===Draw_hiscore_number===============================================================================================
Line 399... Line 691...
399
 
691
 
400
 
692
    mov  edx, [window_width]
Line -... Line 693...
-
 
693
    shr  edx, 3
-
 
694
    neg  edx
-
 
695
    add  edx, [window_width]
-
 
696
    sub  edx, 7*6+6
-
 
697
    shl  edx, 16
-
 
698
    add  edx, dword[bottom_top_strings]
-
 
699
      mcall     47,0x00070000,[hi_score], ,[hiscore_number_color]
-
 
700
    
401
Draw_hiscore_string:
701
    ret
Line 402... Line 702...
402
    ;;===Draw_hiscore_string===============================================================================================
702
    
Line 403... Line 703...
403
 
703
    ;;---Draw_hiscore_number-----------------------------------------------------------------------------------------------
Line 404... Line 704...
404
      mcall     4,376*65536+BOTTOM_TOP_STRINGS,[hiscore_string_color],string_hi_score
704
    
405
    
705
    
406
    ret
706
Draw_champion_string:
407
    
707
    ;;===Draw_champion_string==============================================================================================
408
    ;;---Draw_hiscore_string-----------------------------------------------------------------------------------------------
708
 
409
 
-
 
410
    
709
    mov  ebx, [window_width]
-
 
710
    shr  ebx, 3
411
Draw_hiscore_number:
711
    neg  ebx
Line -... Line 712...
-
 
712
    add  ebx, [window_width]
-
 
713
    sub  ebx, (string_level-string_champion)*6+7*6+5
-
 
714
    shl  ebx, 16
-
 
715
    add  ebx, dword[bottom_bottom_strings]
412
    ;;===Draw_hiscore_number===============================================================================================
716
      mcall     4, ,[champion_string_color],string_champion
413
 
717
 
Line 414... Line 718...
414
      mcall     47,0x00070000,[hi_score],442*65536+BOTTOM_TOP_STRINGS,[hiscore_number_color]
718
    ret
415
    
719
 
416
    ret
720
    ;;---Draw_champion_string----------------------------------------------------------------------------------------------
417
    
721
 
418
    ;;---Draw_hiscore_number-----------------------------------------------------------------------------------------------
722
 
419
    
723
Draw_champion_name:
Line 420... Line 724...
420
    
724
    ;;===Draw_champion_name================================================================================================
421
Draw_champion_string:
725
 
422
    ;;===Draw_champion_string==============================================================================================
726
    mov  ebx, [window_width]
423
 
727
    shr  ebx, 3
424
      mcall     4,376*65536+BOTTOM_BOTTOM_STRINGS,[champion_string_color],string_champion
728
    neg  ebx
Line 425... Line -...
425
 
-
 
426
    ret
-
 
427
 
-
 
428
    ;;---Draw_champion_string----------------------------------------------------------------------------------------------
-
 
429
 
-
 
430
 
729
    add  ebx, [window_width]
-
 
730
    sub  ebx, (press_to_start-champion_name)*6+7*6+6
431
Draw_champion_name:
731
    add  ebx, (press_to_start-champion_name)*6
432
    ;;===Draw_champion_name================================================================================================
732
    shl  ebx, 16
Line 433... Line 733...
433
 
733
    add  ebx, dword[bottom_bottom_strings]
Line 434... Line 734...
434
      mcall     4,442*65536+BOTTOM_BOTTOM_STRINGS,[champion_name_color],champion_name
734
      mcall     4, ,[champion_name_color],champion_name
Line 485... Line 785...
485
 
785
 
486
    and  eax, 0x0000ffff
786
    and  eax, 0x0000ffff
487
    xor  bx,  bx
787
    xor  bx,  bx
488
    mov  bl,  al
788
    mov  bl,  al
489
    shr  ax,  8
789
    shr  ax,  8
490
    mov  dx,  24
790
    mov  dx,  word[g_w]
491
    mul  dx
791
    mul  dx
492
    add  ax,  bx
792
    add  ax,  bx
493
    mov  edi, field_map
793
    mov  edi, field_map
494
    add  edi, eax
794
    add  edi, eax
Line 503... Line 803...
503
    ;;===Get_from_map======================================================================================================
803
    ;;===Get_from_map======================================================================================================
504
    ;;  in  :
804
    ;;  in  :
505
    ;;           al =   x coord
805
    ;;           al =   x coord
506
    ;;           ah =   y coord
806
    ;;           ah =   y coord
507
    ;;  out :
807
    ;;  out :
508
    ;;           al =   value on map
808
    ;;           bl =   value on map
509
    ;;
809
    ;;
Line 510... Line 810...
510
 
810
 
Line 511... Line 811...
511
    push eax
811
    push eax
512
    
812
    
513
    and  eax, 0x0000ffff
813
    and  eax, 0x0000ffff
514
    xor  bx,  bx
814
    xor  bx,  bx
515
    mov  bl,  al
815
    mov  bl,  al
516
    shr  ax,  8
816
    shr  ax,  8
517
    mov  dx,  24
817
    mov  dx,  word[g_w]
518
    mul  dx
818
    mul  dx
519
    add  ax,  bx
819
    add  ax,  bx
520
    mov  edi, field_map
820
    mov  edi, field_map
Line 536... Line 836...
536
window_title                db      'Snake',0
836
window_title                db      'Snake',0
537
window_style                dd      0x34000000
837
window_style                dd      0x34000000
538
time_before_waiting         dd      0x0
838
time_before_waiting         dd      0x0
539
time_to_wait                dd      0x0
839
time_to_wait                dd      0x0
540
time_wait_limit             dd      101
840
time_wait_limit             dd      101
541
decorations                 db      0x0
-
 
542
number_of_free_dots         dw      0x0
-
 
Line -... Line 841...
-
 
841
 
-
 
842
 
-
 
843
gbxm1                       dd      30
-
 
844
gbym1                       dd      30
-
 
845
g_w                         dd      29
-
 
846
g_h                         dd      15
-
 
847
g_e                         dd      13
543
 
848
 
544
field_map                   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,\
849
field_map                   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,\
545
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
850
                                    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,\
546
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
851
                                    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,\
-
 
852
                                    0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
-
 
853
                                    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,\
-
 
854
                                    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,\
-
 
855
                                    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,\
547
                                    0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
856
                                    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,\
548
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
857
                                    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,\
549
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
858
                                    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,\
550
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
859
                                    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,\
551
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
860
                                    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,\
552
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
861
                                    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,\
553
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
862
                                    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,\
Line 554... Line 863...
554
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
863
                                    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
555
 
864
 
556
string_score                db      'SCORE :',0
865
string_score                db      'SCORE :',0
557
string_hi_score             db      'HI-SCORE :',0
866
string_hi_score             db      'HI-SCORE :',0
558
string_player               db      'PLAYER :',0
867
string_player               db      'PLAYER :',0
559
string_champion             db      'CHAMPION :',0
868
string_champion             db      'CHAMPION :',0
560
string_level                db      'LEVEL :',0
869
string_level                db      'LEVEL :',0
561
string_pause_space          db      'PAUSE - ',0x27,'SPACE',0x27,0
870
string_pause_space          db      'PAUSE - ',0x27,'SPACE',0x27,0
562
string_resume_space         db      'RESUME - ',0x27,'SPACE',0x27,0
871
string_resume_space         db      'RESUME - ',0x27,'SPACE',0x27,0
563
string_menu_esc             db      'MENU - ',0x27,'ESC',0x27,0
-
 
564
string_apply_name_enter     db      'APPLY NAME - ',0x27,'ENTER',0x27,0
-
 
565
 
-
 
566
champion_name               db      'dunkaist',0x20,0x20,0x20,0x20,0x20,0x20,0x20,0
872
string_menu_esc             db      'MENU - ',0x27,'ESC',0x27,0
567
 
873
string_apply_name_enter     db      'APPLY NAME - ',0x27,'ENTER',0x27,0
568
press_to_start              db      '...PRESS ',0x27,'SPACE',0x27,' OR ',0x27,'ENTER',0x27,' TO START...',0
874
press_to_start              db      'PRESS ',0x27,'SPACE',0x27,' OR ',0x27,'ENTER',0x27,' TO START',0
Line -... Line 875...
-
 
875
press_esc_to_exit           db      'PRESS ',0x27,'ESC',0x27,' TO EXIT',0
-
 
876
;press_F2_to_options         db      'PRESS ',0x27,'F2',0x27,' TO OPTIONS',0
-
 
877
 
-
 
878
string_congratulations      db      '   Congratulations!!! New hi-score is :',0
569
press_esc_to_exit           db      'PRESS ',0x27,'ESC',0x27,' TO EXIT',0
879
string_enter_your_name      db      'You are the champion! Enter your name :',0
570
;press_F2_to_options         db      'PRESS ',0x27,'F2',0x27,' TO OPTIONS',0
880
strings_end:
571
 
881
 
572
snake_dots                  db      3,3, 4,3, 5,3,  522  dup (0)     ; 264 dots
882
snake_dots                  db      3,3, 4,3, 5,3,  865    dup (0)
Line 573... Line -...
573
snake_napravlenie           db      3
-
 
574
snake_napravlenie_next      db      3
-
 
575
snake_length_x2             dd      6
883
snake_napravlenie           db      3
576
 
884
snake_napravlenie_next      db      3
577
eat                         db      0,0
885
snake_length_x2             dd      6
Line 578... Line 886...
578
 
886
 
Line 579... Line 887...
579
score                       dd      0
887
score                       dd      0
580
hi_score                    dd      777
-
 
581
is_new_record               db      0
-
 
582
 
888
hi_score                    dd      777
583
action                      db      0
889
is_new_record               db      0
584
 
890
 
585
string_congratulations      db      'Congratulations!!! You are the champion!! New hi-score is :',0
891
action                      db      0
586
string_enter_your_name      db      'Enter your name, please :',0
892
 
587
 
893
picture_first_menu_snake    db      1,1,1,1,1,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,0,1,0,0,1,1,1,1,1,\
588
picture_first_menu_snake    db      1,1,1,1,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,1,1,1,1,\
894
                                    1,0,0,0,0,0,1,1,0,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,\
589
                                    1,0,0,0,0,1,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,0,1,\
895
                                    1,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,\
590
                                    1,1,1,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,1,\
896
                                    1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,0,0,0,0,1,1,1,1,0,\
591
                                    0,0,0,1,0,1,0,1,1,0,1,1,1,1,0,1,0,1,0,0,1,0,0,0,\
897
                                    0,0,0,0,1,0,1,0,0,1,1,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,\
-
 
898
                                    1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,1,1,0,1,1,1,1,1
592
                                    1,1,1,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,1,1,1
899
 
593
 
900
picture_first_menu_version  db      1,1,1,1,0,0,0,1,1,1,1,\
594
picture_first_menu_version  db      0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,\
901
                                    1,0,0,1,0,0,0,0,0,0,1,\
595
                                    0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,\
902
                                    1,0,0,1,0,0,0,0,1,1,1,\
596
                                    0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,\
903
                                    1,0,0,1,0,0,0,0,0,0,1,\
597
                                    0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0
904
                                    1,1,1,1,0,1,0,1,1,1,1
598
 
905
 
599
picture_pause               db      1,1,1,0,0,0,1,1,0,0,1,0,0,1,0,1,1,1,1,0,1,1,1,1,\
906
picture_pause               db      0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
600
                                    1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,\
907
                                    0,0,1,0,0,0,1,0,0,1,1,0,0,1,0,0,1,0,1,1,1,1,0,1,1,1,1,0,0,\
601
                                    1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,\
908
                                    0,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,\
-
 
909
                                    0,0,1,1,1,1,0,0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,1,1,1,0,0,0,\
602
                                    1,1,1,0,0,1,1,1,1,0,1,0,0,1,0,1,1,1,1,0,1,1,1,0,\
910
                                    0,0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,1,0,0,0,0,1,0,1,0,0,0,0,0,\
603
                                    1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,0,0,\
911
                                    0,0,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,1,1,1,1,0,1,1,1,1,0,0
604
                                    1,0,0,0,0,1,0,0,1,0,0,1,1,0,0,1,1,1,1,0,1,1,1,1
912
 
-
 
913
picture_game_over           db      0,0,1,1,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,\
605
 
914
                                    0,1,0,0,1,0,0,1,1,1,0,0,1,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,\
606
picture_game_over           db      0,0,1,1,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,1,1,1,1,0,\
915
                                    1,0,0,0,0,0,1,0,0,0,1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,\
607
                                    0,1,0,0,1,0,0,1,0,1,0,0,1,1,0,1,1,0,1,0,0,0,0,0,\
916
                                    1,0,0,1,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,\
608
                                    1,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0,\
917
                                    1,0,0,0,1,0,1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,\
609
                                    1,0,0,1,0,0,1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,0,0,0,\
918
                                    0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,\
610
                                    0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,1,1,1,0,\
919
                                    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,\
611
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
920
                                    0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
612
                                    0,0,1,1,1,0,0,1,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,0,\
921
                                    0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,1,1,0,1,1,1,1,0,0,\
613
                                    0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,\
922
                                    0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,\
614
                                    0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,1,1,0,0,1,0,0,0,1,\
923
                                    0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,1,0,0,1,0,0,0,1,0,\
615
                                    0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,0,1,1,1,1,0,\
924
                                    0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,1,1,1,0,0,\
-
 
925
                                    0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,1,0,1,0,0,0,1,0
-
 
926
 
-
 
927
start_map                   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,\
-
 
928
                                    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,\
616
                                    0,0,1,1,1,0,0,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,1
929
                                    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,\
617
 
930
                                    0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
618
start_map                   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,\
931
                                    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,\
619
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
932
                                    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,\
620
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
933
                                    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,\
621
                                    0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
934
                                    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,\
622
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
935
                                    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,\
Line 623... Line 936...
623
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
936
                                    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,\
624
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
937
                                    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,\
625
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
938
                                    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,\
626
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
939
                                    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,\
Line 665... Line 978...
665
    edit_box.key    ,   'edit_box_key'      ,\
978
    edit_box.key    ,   'edit_box_key'      ,\
666
    edit_box.mouse  ,   'edit_box_mouse'
979
    edit_box.mouse  ,   'edit_box_mouse'
Line 667... Line 980...
667
 
980
 
Line 668... Line -...
668
bFirstDraw  db  0
-
 
669
 
-
 
670
aScore                      db      'Score',0
-
 
671
aHiscore                    db      'Hiscore',0
-
 
672
aChampion_name              db      'Champion_name',0
981
bFirstDraw  db  0
673
 
982
 
-
 
983
aPreferences                db      'Preferences',0
-
 
984
aSpeed                      db      'Speed',0
674
aPreferences                db      'Preferences',0
985
aSquare_side_length         db      'Square_side_length',0
Line -... Line 986...
-
 
986
aSpace_between_squares      db      'Space_between_squares',0
675
aSpeed                      db      'Speed',0
987
aTheme                      db      'Theme',0
676
aDecorations                db      'Decorations',0
988
 
677
 
989
aTheme_name                 db      32  dup (0)
678
aColors                     db      'Colors',0
990
aDecorations                db      'Decorations',0
679
aBackground_color           db      'Background_color',0
991
aBackground_color           db      'Background_color',0
680
aDecorations_color          db      'Decorations_color',0
992
aDecorations_color          db      'Decorations_color',0
Line 694... Line 1006...
694
aScore_number_color         db      'Score_number_color',0
1006
aScore_number_color         db      'Score_number_color',0
695
aHiscore_number_color       db      'Hiscore_number_color',0
1007
aHiscore_number_color       db      'Hiscore_number_color',0
696
aChampion_name_color        db      'Champion_name_color',0
1008
aChampion_name_color        db      'Champion_name_color',0
697
aEdit_box_selection_color   db      'Edit_box_selection_color',0
1009
aEdit_box_selection_color   db      'Edit_box_selection_color',0
Line -... Line 1010...
-
 
1010
 
-
 
1011
aScore                      db      'Score',0
-
 
1012
aHiscore                    db      'Hiscore',0
-
 
1013
aChampion_name              db      'Champion_name',0
698
 
1014
 
Line 699... Line 1015...
699
edit1 edit_box 100,397,278,0x000000,0x000000,0x000000,0x000000,0x80000000,15,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1
1015
edit1 edit_box 65,397,0x0,0x000000,0x000000,0x000000,0x000000,0x80000000,15,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1
-
 
1016
 
-
 
1017
hed                         db      '',0
700
 
1018
;;---Variables-------------------------------------------------------------------------------------------------------------
701
hed                         db      '',0
1019
i_end:
702
hed_end:
-
 
703
rb  256
1020
hed_end:
Line -... Line 1021...
-
 
1021
rb  256
-
 
1022
mouse_dd                    rd      1
-
 
1023
 
-
 
1024
decorations                 rb      1
-
 
1025
number_of_free_dots         rw      1
-
 
1026
 
-
 
1027
eat                         rb      1
-
 
1028
 
704
 
1029
square_side_length          rd      1
-
 
1030
space_between_squares       rd      1
-
 
1031
g_s                         rd      1
-
 
1032
 
-
 
1033
window_width                rd      1
-
 
1034
window_height               rd      1
-
 
1035
wp_x                        rd      1
-
 
1036
wp_y                        rd      1
-
 
1037
 
-
 
1038
gw_mul_gh                   rd      1
-
 
1039
gw_mul_gs                   rd      1
-
 
1040
gh_mul_gs                   rd      1
-
 
1041
gbxm1_plus_gw_mul_gs        rd      1
-
 
1042
gbym1_plus_gh_mul_gs        rd      1
-
 
1043
gs_shl16_gs                 rd      1
-
 
1044
gbxm1_shl16_gbxm1           rd      1
-
 
1045
gbym1_shl16_gbym1           rd      1
-
 
1046
 
-
 
1047
bottom_top_strings          rd      1
-
 
1048
bottom_middle_strings       rd      1
-
 
1049
bottom_bottom_strings       rd      1
-
 
1050
top_strings                 rd      1
705
mouse_dd                    rd      1
1051
 
706
 
1052
champion_name               rb      16
707
i_end:
-
 
Line 708... Line 1053...
708
cur_dir_path                rb      4096
1053
 
709
@PARAMS                     rb      4096
1054
cur_dir_path                rb      4096
710
;;---Variables-------------------------------------------------------------------------------------------------------------
1055
@PARAMS                     rb      4096
711
 
1056