Subversion Repositories Kolibri OS

Rev

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

Rev 1520 Rev 1522
1
;;===HEADER====================================================================================================================
1
;;===HEADER====================================================================================================================
2
 
2
 
3
use32
3
use32
4
    org 0x0
4
    org 0x0
5
    db  'MENUET01'
5
    db  'MENUET01'
6
    dd  0x1,start,i_end,d_end,stacktop,0x0,cur_dir_path
6
    dd  0x1,start,i_end,d_end,stacktop,0x0,cur_dir_path
7
 
7
 
8
;;---HEADER--------------------------------------------------------------------------------------------------------------------
8
;;---HEADER--------------------------------------------------------------------------------------------------------------------
9
 
9
 
10
include '../../../proc32.inc'
10
include '../../../proc32.inc'
11
include '../../../macros.inc'
11
include '../../../macros.inc'
12
include '../../../system/launch/trunk/mem.inc'
12
include '../../../system/launch/trunk/mem.inc'
13
include '../../../develop/libraries/libs-dev/.test/dll.inc'
13
include '../../../develop/libraries/libs-dev/.test/dll.inc'
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'
16
 
16
 
17
;;===Define_chapter============================================================================================================
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
-
 
32
 
18
 
33
SCORE_EAT                   equ     100
19
SCORE_EAT                   equ     100
34
 
20
 
35
LEFT                        equ     0
21
LEFT                        equ     0
36
DOWN                        equ     1
22
DOWN                        equ     1
37
UP                          equ     2
23
UP                          equ     2
38
RIGHT                       equ     3
24
RIGHT                       equ     3
39
 
25
 
40
;;---Define_chapter------------------------------------------------------------------------------------------------------------
26
;;---Define_chapter------------------------------------------------------------------------------------------------------------
41
 
27
 
42
start:
28
start:
43
 
29
 
44
stdcall dll.Load,@IMPORT
30
stdcall dll.Load,@IMPORT
45
    or   eax, eax
31
    or   eax, eax
46
    jnz  Exit
32
    jnz  Exit
47
    
33
    
48
align 4
34
align 4
49
 
35
 
50
    mov  eax, cur_dir_path
36
    mov  eax, cur_dir_path
51
  @@:
37
  @@:
52
    cmp  byte[eax], 0
38
    cmp  byte[eax], 0
53
     jz  @f
39
     jz  @f
54
    inc  eax
40
    inc  eax
55
     jmp @b
41
     jmp @b
56
  @@:
42
  @@:
57
    mov  dword[eax],    '.ini'
43
    mov  dword[eax],    '.ini'
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
63
    mov  [decorations], al
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
-
 
52
      invoke  ini.get_str, cur_dir_path, aPreferences, aTheme, aTheme_name, 31, aTheme_name
-
 
53
 
-
 
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
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
108
    mov  [edit1+0x18],  eax
99
    mov  [edit1+0x18],  eax
109
    mov  eax, [game_over_hiscore_color]
100
    mov  eax, [game_over_hiscore_color]
110
    mov  [edit1+0x1C],  eax
101
    mov  [edit1+0x1C],  eax
-
 
102
 
-
 
103
      call      Set_geometry
111
 
104
 
112
include 'first_menu.asm'            ; First menu body and functions
105
include 'first_menu.asm'            ; First menu body and functions
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
115
include 'game_over.asm'             ; Game_over body and functions
108
include 'game_over.asm'             ; Game_over body and functions
116
 
109
 
117
;;===Some_functions============================================================================================================
110
;;===Some_functions============================================================================================================
118
 
111
 
119
Exit:
112
Exit:
120
    ;;===Exit==============================================================================================================
113
    ;;===Exit==================================================================================================================
121
 
114
 
122
    or  eax,    -1
115
    or  eax,    -1
123
    int 0x40
116
    int 0x40
124
    
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
-
 
242
    mov  [bottom_bottom_strings],  eax
-
 
243
 
-
 
244
    sub  eax, 4
-
 
245
    mov  [edit1+0x08],  eax
-
 
246
 
-
 
247
    ret
-
 
248
 
125
    ;;---Exit--------------------------------------------------------------------------------------------------------------
249
    ;;---Set_geometry------------------------------------------------------------------------------------------------------
126
    
250
 
127
    
251
 
128
Draw_decorations:
252
Draw_decorations:
129
    ;;===Draw_decorations==================================================================================================
253
    ;;===Draw_decorations==================================================================================================
130
 
254
 
-
 
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
143
    cmp  [decorations], 7
268
    dec  al
144
     je  borders_dots
269
     jz  borders_dots
145
    cmp  [decorations], 8
270
    dec  al
146
     je  corners_dots
271
     jz  corners_dots
147
    cmp  [decorations], 9
272
    dec  al
148
     je  corners_inner
273
     jz  corners_inner
149
    cmp  [decorations], 10
274
    dec  al
150
     je  corners_outer
275
     jz  corners_outer
151
    cmp  [decorations], 11
276
    dec  al
152
     je  corners_crosses
277
     jz  corners_crosses
153
    ret
278
    ret
154
 
279
 
155
 
280
 
156
  grid_lines:
281
  grid_lines:
157
 
282
 
158
    mov  eax, 38
283
    mov  eax, 38
159
    mov  ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1)
284
;mov  ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1)
-
 
285
    mov  ebx, [gbxm1_shl16_gbxm1]
160
    mov  ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)
286
;mov  ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)
-
 
287
    mov  ecx, [gbym1_shl16_gbym1]
-
 
288
    add  ecx, [gh_mul_gs]
161
    mov  edx, [decorations_color]
289
    mov  edx, [decorations_color]
-
 
290
    mov  esi, [g_w]
-
 
291
    add  esi, 1
162
 
292
 
163
  @@:
293
  @@:
164
      mcall
294
      mcall
165
    add  ebx, GRID_STEP*65536+GRID_STEP
295
    add  ebx, [gs_shl16_gs]
166
    cmp  ebx, (GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)
296
    dec  esi
167
     jng @b
297
     jnz @b
168
 
298
 
169
    mov  ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)
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]
170
    mov  ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1)
302
    mov  ecx, [gbym1_shl16_gbym1]
-
 
303
    mov  esi, [g_h]
-
 
304
    add  esi, 1
171
    
305
    
172
  @@:
306
  @@:
173
      mcall
307
      mcall
174
    add  ecx, GRID_STEP*65536+GRID_STEP
308
    add  ecx, [gs_shl16_gs]
175
    cmp  ecx, (GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)
309
    dec  esi
176
     jng @b
310
     jnz @b
177
 
311
 
178
    ret
312
    ret
179
 
313
 
180
 
314
 
181
  grid_lines_with_ends:
315
  grid_lines_with_ends:
182
 
316
 
183
    mov  eax, 38
317
    mov  eax, 38
184
    mov  ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1)
318
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
319
    mov  ecx, [gbym1]
-
 
320
    sub  ecx, [g_e]
-
 
321
    shl  ecx, 16
185
    mov  ecx, (GRID_BEGIN_Y-1-GRID_ENDS_WIDTH)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP+GRID_ENDS_WIDTH)
322
    add  ecx, [gbym1_plus_gh_mul_gs]
-
 
323
    add  ecx, [g_e]
186
    mov  edx, [decorations_color]
324
    mov  edx, [decorations_color]
-
 
325
    mov  esi, [g_w]
-
 
326
    add  esi, 1
187
 
327
 
188
  @@:
328
  @@:
189
      mcall
329
      mcall
190
    add  ebx, GRID_STEP*65536+GRID_STEP
330
    add  ebx, [gs_shl16_gs]
191
    cmp  ebx, (GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP)
331
    dec  esi
192
     jng @b
332
     jnz @b
-
 
333
 
-
 
334
    mov  ebx, [gbxm1]
-
 
335
    sub  ebx, [g_e]
193
 
336
    shl  ebx, 16
-
 
337
    add  ebx, [gbxm1_plus_gw_mul_gs]
194
    mov  ebx, (GRID_BEGIN_X-1-GRID_ENDS_WIDTH)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP+GRID_ENDS_WIDTH)
338
    add  ebx, [g_e]
-
 
339
    mov  ecx, [gbym1_shl16_gbym1]
-
 
340
    mov  esi, [g_h]
195
    mov  ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1)
341
    add  esi, 1
196
    
342
    
197
  @@:
343
  @@:
198
      mcall
344
      mcall
199
    add  ecx, GRID_STEP*65536+GRID_STEP
345
    add  ecx, [gs_shl16_gs]
200
    cmp  ecx, (GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP)
346
    dec  esi
201
     jng @b
347
     jnz @b
202
 
348
 
203
    ret
349
    ret
204
 
350
 
205
 
351
 
206
  grid_lines_with_corners:
352
  grid_lines_with_corners:
207
 
353
 
208
      call      grid_lines
354
      call      grid_lines
209
      call      corners_outer
355
      call      corners_outer
210
 
356
 
211
    ret
357
    ret
212
 
358
 
213
 
359
 
214
  grid_dots:
360
  grid_dots:
215
 
361
 
216
    mov  eax, 1
362
    mov  eax, 1
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]
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
229
    mov  ebx, GRID_BEGIN_X-1
375
    mov  ebx, [gbxm1]
230
     jmp @b
376
     jmp @b
231
 
377
 
232
  @@:
378
  @@:
233
    ret
379
    ret
234
 
380
 
235
 
381
 
236
  borders_lines:
382
  borders_lines:
-
 
383
 
-
 
384
    mov  eax, 38
-
 
385
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
386
    mov  ecx, [gbym1_shl16_gbym1]
237
 
387
    add  ecx, [gh_mul_gs]
-
 
388
    mov  edx, [decorations_color]
-
 
389
      mcall
-
 
390
 
-
 
391
    mov  ebx, [gbxm1_plus_gw_mul_gs]
238
      mcall     38,(GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1),17*65536+263,[decorations_color]
392
    shl  ebx, 16
-
 
393
    add  ebx, [gbxm1_plus_gw_mul_gs]
-
 
394
      mcall
-
 
395
 
-
 
396
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
397
    add  ebx, [gw_mul_gs]
-
 
398
    mov  ecx, [gbym1_shl16_gbym1]
-
 
399
      mcall
239
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1), ,
400
 
-
 
401
    mov  ecx, [gbym1_plus_gh_mul_gs]
240
      mcall       ,17*65536+523,(GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1)
402
    shl  ecx, 16
-
 
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
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
 
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]
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
270
    add  ebx, GRID_STEP
433
    add  ebx, [g_s]
271
    cmp  ebx, GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP
434
    cmp  ebx, [gbxm1_plus_gw_mul_gs]
272
     jng @b
435
     jng @b
273
 
436
 
274
    mov  ebx, GRID_BEGIN_X-1
437
    mov  ebx, [gbxm1]
275
    mov  ecx, GRID_BEGIN_Y-1
438
    mov  ecx, [gbym1]
276
  @@:
439
  @@:
277
      mcall
440
      mcall
278
    add  ecx, GRID_STEP
441
    add  ecx, [g_s]
279
    cmp  ecx, GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP
442
    cmp  ecx, [gbym1_plus_gh_mul_gs]
280
     jng @b
443
     jng @b
281
 
444
 
282
    mov  ebx, GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP
445
    mov  ebx, [gbxm1_plus_gw_mul_gs]
283
    mov  ecx, GRID_BEGIN_Y-1
446
    mov  ecx, [gbym1]
284
  @@:
447
  @@:
285
      mcall
448
      mcall
286
    add  ecx, GRID_STEP
449
    add  ecx, [g_s]
287
    cmp  ecx, GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP
450
    cmp  ecx, [gbym1_plus_gh_mul_gs]
288
     jng @b
451
     jng @b
289
 
452
 
290
    ret
453
    ret
291
 
454
 
292
 
455
 
293
  corners_dots:
456
  corners_dots:
-
 
457
 
-
 
458
    mov  eax, 13
-
 
459
    mov  ebx, [gbxm1]
-
 
460
    dec  ebx
-
 
461
    shl  ebx, 16
-
 
462
    add  ebx, 2
-
 
463
    mov  ecx, [gbym1]
-
 
464
    dec  ecx
-
 
465
    shl  ecx, 16
294
 
466
    add  ecx, 2
-
 
467
    mov  edx, [decorations_color]
-
 
468
      mcall
295
      mcall     13,(GRID_BEGIN_X-2)*65536+2,(GRID_BEGIN_Y-2)*65536+2,[decorations_color]
469
 
-
 
470
    mov  ebx, [gbxm1_plus_gw_mul_gs]
-
 
471
    shl  ebx, 16
-
 
472
    add  ebx, 2
-
 
473
      mcall
-
 
474
 
-
 
475
    mov  ebx, [gbxm1]
-
 
476
    dec  ebx
-
 
477
    shl  ebx, 16
296
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+2,(GRID_BEGIN_Y-2)*65536+2,
478
    add  ebx, 2
-
 
479
    mov  ecx, [gbym1_plus_gh_mul_gs]
-
 
480
    shl  ecx, 16
-
 
481
    add  ecx, 2
-
 
482
      mcall
297
      mcall     13,(GRID_BEGIN_X-2)*65536+2,(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+2,
483
 
-
 
484
    mov  ebx, [gbxm1_plus_gw_mul_gs]
-
 
485
    shl  ebx, 16
-
 
486
    add  ebx, 2
298
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+2,(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+2,
487
      mcall
299
 
488
 
300
    ret
489
    ret
301
 
490
 
302
 
491
 
303
  corners_inner:
492
  corners_inner:
-
 
493
 
-
 
494
    mov  eax, 38
-
 
495
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
496
    add  ebx, [g_e]
304
 
497
    mov  ecx, [gbym1_shl16_gbym1]
-
 
498
    mov  edx, [decorations_color]
-
 
499
      mcall
305
      mcall     38,(GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1+GRID_ENDS_WIDTH),(GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1),[decorations_color]
500
 
-
 
501
    mov  ecx, [gbym1_plus_gh_mul_gs]
-
 
502
    shl  ecx, 16
-
 
503
    add  ecx, [gbym1_plus_gh_mul_gs]
-
 
504
      mcall
306
      mcall       ,(GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1+GRID_ENDS_WIDTH),(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1),
505
 
-
 
506
    mov  ebx, [gbxm1_plus_gw_mul_gs]
-
 
507
    sub  ebx, [g_e]
307
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-GRID_ENDS_WIDTH-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1),(GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1),
508
    shl  ebx, 16
-
 
509
    add  ebx, [gbxm1_plus_gw_mul_gs]
-
 
510
      mcall
-
 
511
 
-
 
512
    mov  ecx, [gbym1_shl16_gbym1]
-
 
513
      mcall
-
 
514
 
-
 
515
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
516
    mov  ecx, [gbym1_shl16_gbym1]
-
 
517
    add  ecx, [g_e]
-
 
518
      mcall
308
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-GRID_ENDS_WIDTH-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1),(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1),
519
 
-
 
520
    mov  ebx, [gbxm1_plus_gw_mul_gs]
309
      mcall       ,(GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1),(GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1+GRID_ENDS_WIDTH),
521
    shl  ebx, 16
-
 
522
    add  ebx, [gbxm1_plus_gw_mul_gs]
-
 
523
      mcall
310
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1),(GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1+GRID_ENDS_WIDTH),
524
 
-
 
525
    mov  ecx, [gbym1_plus_gh_mul_gs]
-
 
526
    sub  ecx, [g_e]
311
      mcall       ,(GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1),(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-GRID_ENDS_WIDTH-1)*65536+(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1),
527
    shl  ecx, 16
-
 
528
    add  ecx, [gbym1_plus_gh_mul_gs]
-
 
529
      mcall
-
 
530
 
-
 
531
    mov  ebx, [gbxm1_shl16_gbxm1]
312
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1),(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-GRID_ENDS_WIDTH-1)*65536+(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1),
532
      mcall
313
 
533
 
314
    ret
534
    ret
315
 
535
 
316
 
536
 
317
  corners_outer:
537
  corners_outer:
-
 
538
 
-
 
539
    mov  eax, 38
-
 
540
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
541
    sub  ebx, [g_e]
318
 
542
    mov  ecx, [gbym1_shl16_gbym1]
-
 
543
    mov  edx, [decorations_color]
-
 
544
      mcall
319
      mcall     38,(GRID_BEGIN_X-1-GRID_ENDS_WIDTH)*65536+(GRID_BEGIN_X-1),(GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1),[decorations_color]
545
 
-
 
546
    mov  ecx, [gbym1_plus_gh_mul_gs]
-
 
547
    shl  ecx, 16
-
 
548
    add  ecx, [gbym1_plus_gh_mul_gs]
-
 
549
      mcall
320
      mcall       ,(GRID_BEGIN_X-1-GRID_ENDS_WIDTH)*65536+(GRID_BEGIN_X-1),(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1),
550
 
-
 
551
    mov  ebx, [gbxm1_plus_gw_mul_gs]
321
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1+GRID_ENDS_WIDTH),(GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1),
552
    shl  ebx, 16
-
 
553
    add  ebx, [gbxm1_plus_gw_mul_gs]
-
 
554
    add  ebx, [g_e]
-
 
555
      mcall
-
 
556
 
-
 
557
    mov  ecx, [gbym1_shl16_gbym1]
-
 
558
      mcall
-
 
559
 
-
 
560
    mov  ebx, [gbxm1_shl16_gbxm1]
-
 
561
    mov  ecx, [gbym1_shl16_gbym1]
-
 
562
    sub  ecx, [g_e]
-
 
563
      mcall
322
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1+GRID_ENDS_WIDTH),(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1),
564
 
-
 
565
    mov  ebx, [gbxm1_plus_gw_mul_gs]
323
      mcall       ,(GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1),(GRID_BEGIN_Y-1-GRID_ENDS_WIDTH)*65536+(GRID_BEGIN_Y-1),
566
    shl  ebx, 16
-
 
567
    add  ebx, [gbxm1_plus_gw_mul_gs]
-
 
568
      mcall
324
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1),(GRID_BEGIN_Y-1-GRID_ENDS_WIDTH)*65536+(GRID_BEGIN_Y-1),
569
 
-
 
570
    mov  ecx, [gbym1_plus_gh_mul_gs]
325
      mcall       ,(GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1),(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1+GRID_ENDS_WIDTH),
571
    shl  ecx, 16
-
 
572
    add  ecx, [gbym1_plus_gh_mul_gs]
-
 
573
    add  ecx, [g_e]
-
 
574
      mcall
-
 
575
 
-
 
576
    mov  ebx, [gbxm1_shl16_gbxm1]
326
      mcall       ,(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1)*65536+(GRID_BEGIN_X+GRID_WIDTH*GRID_STEP-1),(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1)*65536+(GRID_BEGIN_Y+GRID_HEIGHT*GRID_STEP-1+GRID_ENDS_WIDTH),
577
      mcall
327
 
578
 
328
    ret
579
    ret
329
 
580
 
330
 
581
 
331
  corners_crosses:
582
  corners_crosses:
332
 
583
 
333
      call      corners_inner
584
      call      corners_inner
334
      call      corners_outer
585
      call      corners_outer
335
 
586
 
336
    ret
587
    ret
337
 
588
 
338
 
589
 
339
    ;;---Draw_decorations--------------------------------------------------------------------------------------------------
590
    ;;---Draw_decorations--------------------------------------------------------------------------------------------------
340
 
591
 
341
 
592
 
342
Draw_square:
593
Draw_square:
343
    ;;===Draw_square=======================================================================================================
594
    ;;===Draw_square=======================================================================================================
344
    ;; bl   -   x_coord
595
    ;; bl   -   x_coord
345
    ;; bh   -   y_coord
596
    ;; bh   -   y_coord
346
    ;; edx  -   color
597
    ;; edx  -   color
347
 
598
 
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
352
    mov  bx,  ax
603
    mov  bx,  ax
-
 
604
    add  bx,  word[gbxm1]
353
    add  bx,  31
605
    inc  bx
354
    shl  ebx, 16
606
    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]
358
    mul  cl
611
    mul  cl
-
 
612
    mov  cx,  ax
359
    mov  cx,  ax
613
    add  cx,  word[gbym1]
360
    add  cx,  31
614
    inc  cx
-
 
615
    shl  ecx, 16
361
    shl  ecx, 16
616
    add  ecx, [g_s]
362
    add  ecx, 19
617
    dec  ecx
363
        
618
        
364
      mcall     13
619
      mcall     13
365
 
620
 
366
    ret
621
    ret
367
 
622
 
368
    ;;---Draw_square-------------------------------------------------------------------------------------------------------
623
    ;;---Draw_square-------------------------------------------------------------------------------------------------------
369
    
624
    
370
    
625
    
371
Draw_menu_esc:
626
Draw_menu_esc:
372
    ;;===Draw_menu_esc=====================================================================================================
627
    ;;===Draw_menu_esc=====================================================================================================
-
 
628
 
-
 
629
    mov  ebx, [window_width]
-
 
630
    shr  ebx, 1
-
 
631
    sub  ebx, (string_apply_name_enter-string_menu_esc-1)*3+6
-
 
632
    shl  ebx, 16
373
 
633
    add  ebx, dword[top_strings]
374
      mcall     4,234*65536+TOP_STRINGS,[navigation_strings_color],string_menu_esc
634
      mcall     4, ,[navigation_strings_color],string_menu_esc
375
    
635
    
376
    ret
636
    ret
377
    
637
    
378
    ;;---Draw_menu_esc-----------------------------------------------------------------------------------------------------
638
    ;;---Draw_menu_esc-----------------------------------------------------------------------------------------------------
379
 
639
 
380
 
640
 
381
Draw_score_string:
641
Draw_score_string:
382
    ;;===Draw_score_string=================================================================================================
642
    ;;===Draw_score_string=================================================================================================
-
 
643
 
-
 
644
    mov  ebx, [window_width]
-
 
645
    shr  ebx, 3
-
 
646
    sub  ebx, 5
-
 
647
    shl  ebx, 16
383
    
648
    add  ebx, dword[bottom_top_strings]
384
      mcall     4,56*65536+BOTTOM_TOP_STRINGS,[score_string_color],string_score
649
      mcall     4, ,[score_string_color],string_score
385
      
650
      
386
    ret
651
    ret
387
    
652
    
388
    ;;---Draw_score_string-------------------------------------------------------------------------------------------------
653
    ;;---Draw_score_string-------------------------------------------------------------------------------------------------
389
    
654
    
390
    
655
    
391
Draw_score_number:
656
Draw_score_number:
392
    ;;===Draw_score_number================================================================================================= 
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
393
    
664
    add  edx, dword[bottom_top_strings]
394
      mcall     47,0x00070000,[score],104*65536+BOTTOM_TOP_STRINGS,[score_number_color],[background_color]
665
      mcall     47,0x00070000,[score], ,[score_number_color],[background_color]
395
        
666
        
396
    ret
667
    ret
397
        
668
        
398
    ;;---Draw_score_number-------------------------------------------------------------------------------------------------
669
    ;;---Draw_score_number-------------------------------------------------------------------------------------------------
399
 
670
 
400
 
671
 
401
Draw_hiscore_string:
672
Draw_hiscore_string:
402
    ;;===Draw_hiscore_string===============================================================================================
673
    ;;===Draw_hiscore_string===============================================================================================
-
 
674
 
-
 
675
    mov  ebx, [window_width]
-
 
676
    shr  ebx, 3
-
 
677
    neg  ebx
-
 
678
    add  ebx, [window_width]
-
 
679
    sub  ebx, (string_player-string_hi_score)*6+7*6+5
-
 
680
    shl  ebx, 16
403
 
681
    add  ebx, dword[bottom_top_strings]
404
      mcall     4,376*65536+BOTTOM_TOP_STRINGS,[hiscore_string_color],string_hi_score
682
      mcall     4, ,[hiscore_string_color],string_hi_score
405
    
683
    
406
    ret
684
    ret
407
    
685
    
408
    ;;---Draw_hiscore_string-----------------------------------------------------------------------------------------------
686
    ;;---Draw_hiscore_string-----------------------------------------------------------------------------------------------
409
 
687
 
410
    
688
    
411
Draw_hiscore_number:
689
Draw_hiscore_number:
412
    ;;===Draw_hiscore_number===============================================================================================
690
    ;;===Draw_hiscore_number===============================================================================================
-
 
691
 
-
 
692
    mov  edx, [window_width]
-
 
693
    shr  edx, 3
-
 
694
    neg  edx
-
 
695
    add  edx, [window_width]
-
 
696
    sub  edx, 7*6+6
-
 
697
    shl  edx, 16
413
 
698
    add  edx, dword[bottom_top_strings]
414
      mcall     47,0x00070000,[hi_score],442*65536+BOTTOM_TOP_STRINGS,[hiscore_number_color]
699
      mcall     47,0x00070000,[hi_score], ,[hiscore_number_color]
415
    
700
    
416
    ret
701
    ret
417
    
702
    
418
    ;;---Draw_hiscore_number-----------------------------------------------------------------------------------------------
703
    ;;---Draw_hiscore_number-----------------------------------------------------------------------------------------------
419
    
704
    
420
    
705
    
421
Draw_champion_string:
706
Draw_champion_string:
422
    ;;===Draw_champion_string==============================================================================================
707
    ;;===Draw_champion_string==============================================================================================
-
 
708
 
-
 
709
    mov  ebx, [window_width]
-
 
710
    shr  ebx, 3
-
 
711
    neg  ebx
-
 
712
    add  ebx, [window_width]
-
 
713
    sub  ebx, (string_level-string_champion)*6+7*6+5
-
 
714
    shl  ebx, 16
423
 
715
    add  ebx, dword[bottom_bottom_strings]
424
      mcall     4,376*65536+BOTTOM_BOTTOM_STRINGS,[champion_string_color],string_champion
716
      mcall     4, ,[champion_string_color],string_champion
425
 
717
 
426
    ret
718
    ret
427
 
719
 
428
    ;;---Draw_champion_string----------------------------------------------------------------------------------------------
720
    ;;---Draw_champion_string----------------------------------------------------------------------------------------------
429
 
721
 
430
 
722
 
431
Draw_champion_name:
723
Draw_champion_name:
432
    ;;===Draw_champion_name================================================================================================
724
    ;;===Draw_champion_name================================================================================================
-
 
725
 
-
 
726
    mov  ebx, [window_width]
-
 
727
    shr  ebx, 3
-
 
728
    neg  ebx
-
 
729
    add  ebx, [window_width]
-
 
730
    sub  ebx, (press_to_start-champion_name)*6+7*6+6
-
 
731
    add  ebx, (press_to_start-champion_name)*6
-
 
732
    shl  ebx, 16
433
 
733
    add  ebx, dword[bottom_bottom_strings]
434
      mcall     4,442*65536+BOTTOM_BOTTOM_STRINGS,[champion_name_color],champion_name
734
      mcall     4, ,[champion_name_color],champion_name
435
 
735
 
436
    ret
736
    ret
437
 
737
 
438
    ;;---Draw_champion_name------------------------------------------------------------------------------------------------
738
    ;;---Draw_champion_name------------------------------------------------------------------------------------------------
439
 
739
 
440
 
740
 
441
Draw_picture:
741
Draw_picture:
442
    ;;===Draw_picture======================================================================================================
742
    ;;===Draw_picture======================================================================================================
443
    ;;  in  :
743
    ;;  in  :
444
    ;;           al =   picture height (in squares)
744
    ;;           ax =   number of left square *0x100+ picture width (in squares)
445
    ;;           bh =   number of top square
745
    ;;           cx =   number of top square *0x100+ picture height (in squares)
446
    ;;          ecx =   pointer to picture data
-
 
447
    ;;          edx =   picture color
746
    ;;          edx =   picture color
-
 
747
    ;;          esi =   pointer to picture data
448
    ;;
748
    ;;
-
 
749
 
-
 
750
    add  al,  ah
-
 
751
    add  cl,  ch
-
 
752
    mov  bh,  ch
449
 
753
 
450
  .draw:
754
  .draw:
451
    xor  bl,  bl
755
    mov  bl,  ah
452
    
756
    
453
  .loop:
757
  .loop:
454
    cmp  byte[ecx], 0
758
    cmp  byte[esi], 0
455
     jz  @f
759
     jz  @f
456
    push eax ebx ecx
760
    push eax ebx ecx esi
457
      call      Draw_square
761
      call      Draw_square
458
    pop  ecx ebx eax
762
    pop  esi ecx ebx eax
459
    
763
    
460
  @@:
764
  @@:
461
    inc  ecx
765
    inc  esi
462
    inc  bl
-
 
463
    cmp  bl,  GRID_WIDTH
-
 
464
     jne .loop
-
 
465
    
-
 
466
    dec  al
-
 
467
    test al,  al
766
    inc  bl
-
 
767
    cmp  bl,  al
468
     jnz @f
768
     jne .loop
469
    ret
769
    
470
  @@:
770
    inc  bh
471
    inc  bh
771
    cmp  bh,  cl
472
     jmp .draw
772
     jne .draw
473
    
773
    ret
474
 
774
 
475
    ;;---Draw_picture------------------------------------------------------------------------------------------------------
775
    ;;---Draw_picture------------------------------------------------------------------------------------------------------
476
 
776
 
477
 
777
 
478
Draw_on_map:
778
Draw_on_map:
479
    ;;===Draw_on_map=======================================================================================================
779
    ;;===Draw_on_map=======================================================================================================
480
    ;;  in  :
780
    ;;  in  :
481
    ;;           al =   x coord
781
    ;;           al =   x coord
482
    ;;           ah =   y coord
782
    ;;           ah =   y coord
483
    ;;           cl =   value to draw
783
    ;;           cl =   value to draw
484
    ;;
784
    ;;
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
495
    mov  [edi], cl
795
    mov  [edi], cl
496
 
796
 
497
    ret
797
    ret
498
 
798
 
499
    ;;---Draw_on_map-------------------------------------------------------------------------------------------------------
799
    ;;---Draw_on_map-------------------------------------------------------------------------------------------------------
500
 
800
 
501
 
801
 
502
Get_from_map:
802
Get_from_map:
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
    ;;
510
 
810
 
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
521
    add  edi, eax
821
    add  edi, eax
522
    mov  bl,  [edi]
822
    mov  bl,  [edi]
523
 
823
 
524
    pop  eax
824
    pop  eax
525
 
825
 
526
    ret
826
    ret
527
 
827
 
528
    ;;---Get_from_map------------------------------------------------------------------------------------------------------
828
    ;;---Get_from_map------------------------------------------------------------------------------------------------------
529
 
829
 
530
 
830
 
531
;;---Some_functions--------------------------------------------------------------------------------------------------------
831
;;---Some_functions--------------------------------------------------------------------------------------------------------
532
 
832
 
533
 
833
 
534
;;===Variables=============================================================================================================
834
;;===Variables=============================================================================================================
535
 
835
 
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
-
 
-
 
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,\
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
872
string_menu_esc             db      'MENU - ',0x27,'ESC',0x27,0
564
string_apply_name_enter     db      'APPLY NAME - ',0x27,'ENTER',0x27,0
873
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
-
 
567
 
-
 
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
569
press_esc_to_exit           db      'PRESS ',0x27,'ESC',0x27,' TO EXIT',0
875
press_esc_to_exit           db      'PRESS ',0x27,'ESC',0x27,' TO EXIT',0
570
;press_F2_to_options         db      'PRESS ',0x27,'F2',0x27,' TO OPTIONS',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
-
 
879
string_enter_your_name      db      'You are the champion! Enter your name :',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)
573
snake_napravlenie           db      3
883
snake_napravlenie           db      3
574
snake_napravlenie_next      db      3
884
snake_napravlenie_next      db      3
575
snake_length_x2             dd      6
885
snake_length_x2             dd      6
576
 
-
 
577
eat                         db      0,0
-
 
578
 
886
 
579
score                       dd      0
887
score                       dd      0
580
hi_score                    dd      777
888
hi_score                    dd      777
581
is_new_record               db      0
889
is_new_record               db      0
582
 
890
 
583
action                      db      0
891
action                      db      0
584
 
892
 
585
string_congratulations      db      'Congratulations!!! You are the champion!! New hi-score is :',0
-
 
586
string_enter_your_name      db      'Enter your name, please :',0
-
 
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,\
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
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
593
 
899
 
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,\
900
picture_first_menu_version  db      1,1,1,1,0,0,0,1,1,1,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,\
901
                                    1,0,0,1,0,0,0,0,0,0,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,\
902
                                    1,0,0,1,0,0,0,0,1,1,1,\
-
 
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,\
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,\
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,\
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,\
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,\
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
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
605
 
912
 
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,\
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,\
-
 
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,\
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,\
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,\
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,\
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,\
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,\
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,\
-
 
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,\
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
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
617
 
926
 
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,\
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,\
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,\
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,\
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,\
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,\
-
 
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,\
-
 
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,\
-
 
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,\
-
 
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,\
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,\
627
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
940
                                    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,\
628
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
941
                                    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
629
 
942
 
630
background_color            dd      0x000000
943
background_color            dd      0x000000
631
decorations_color           dd      0x00000000
944
decorations_color           dd      0x00000000
632
snake_color                 dd      0x000000
945
snake_color                 dd      0x000000
633
snake_head_color            dd      0x000000
946
snake_head_color            dd      0x000000
634
snake_picture_color         dd      0x000000
947
snake_picture_color         dd      0x000000
635
version_picture_color       dd      0x000000
948
version_picture_color       dd      0x000000
636
pause_picture_color         dd      0x000000
949
pause_picture_color         dd      0x000000
637
game_over_picture_color     dd      0x000000
950
game_over_picture_color     dd      0x000000
638
eat_color                   dd      0x000000
951
eat_color                   dd      0x000000
639
navigation_strings_color    dd      0x80000000
952
navigation_strings_color    dd      0x80000000
640
game_over_strings_color     dd      0x80000000
953
game_over_strings_color     dd      0x80000000
641
score_string_color          dd      0x80000000
954
score_string_color          dd      0x80000000
642
hiscore_string_color        dd      0x80000000
955
hiscore_string_color        dd      0x80000000
643
champion_string_color       dd      0x80000000
956
champion_string_color       dd      0x80000000
644
game_over_hiscore_color     dd      0x80000000
957
game_over_hiscore_color     dd      0x80000000
645
score_number_color          dd      0x40000000
958
score_number_color          dd      0x40000000
646
hiscore_number_color        dd      0x00000000
959
hiscore_number_color        dd      0x00000000
647
champion_name_color         dd      0x80000000
960
champion_name_color         dd      0x80000000
648
 
961
 
649
align 4
962
align 4
650
@IMPORT:
963
@IMPORT:
651
 
964
 
652
library \
965
library \
653
        libini      ,   'libini.obj'        ,\
966
        libini      ,   'libini.obj'        ,\
654
        box_lib     ,   'box_lib.obj'
967
        box_lib     ,   'box_lib.obj'
655
 
968
 
656
import  libini,\
969
import  libini,\
657
    ini.get_str     ,   'ini_get_str'       ,\
970
    ini.get_str     ,   'ini_get_str'       ,\
658
    ini.get_int     ,   'ini_get_int'       ,\
971
    ini.get_int     ,   'ini_get_int'       ,\
659
    ini.set_str     ,   'ini_set_str'       ,\
972
    ini.set_str     ,   'ini_set_str'       ,\
660
    ini.set_int     ,   'ini_set_int'       ,\
973
    ini.set_int     ,   'ini_set_int'       ,\
661
    ini.get_color   ,   'ini_get_color'
974
    ini.get_color   ,   'ini_get_color'
662
 
975
 
663
import  box_lib,\
976
import  box_lib,\
664
    edit_box.draw   ,   'edit_box'          ,\
977
    edit_box.draw   ,   'edit_box'          ,\
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'
667
 
980
 
668
bFirstDraw  db  0
981
bFirstDraw  db  0
669
 
-
 
670
aScore                      db      'Score',0
-
 
671
aHiscore                    db      'Hiscore',0
-
 
672
aChampion_name              db      'Champion_name',0
-
 
673
 
982
 
674
aPreferences                db      'Preferences',0
983
aPreferences                db      'Preferences',0
-
 
984
aSpeed                      db      'Speed',0
-
 
985
aSquare_side_length         db      'Square_side_length',0
675
aSpeed                      db      'Speed',0
986
aSpace_between_squares      db      'Space_between_squares',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
681
aSnake_color                db      'Snake_color',0
993
aSnake_color                db      'Snake_color',0
682
aSnake_head_color           db      'Snake_head_color',0
994
aSnake_head_color           db      'Snake_head_color',0
683
aSnake_picture_color        db      'Snake_picture_color',0
995
aSnake_picture_color        db      'Snake_picture_color',0
684
aVersion_picture_color      db      'Version_picture_color',0
996
aVersion_picture_color      db      'Version_picture_color',0
685
aPause_picture_color        db      'Pause_picture_color',0
997
aPause_picture_color        db      'Pause_picture_color',0
686
aGame_over_picture_color    db      'Game_over_picture_color',0
998
aGame_over_picture_color    db      'Game_over_picture_color',0
687
aEat_color                  db      'Eat_color',0
999
aEat_color                  db      'Eat_color',0
688
aNavigation_strings_color   db      'Navigation_string_color',0
1000
aNavigation_strings_color   db      'Navigation_string_color',0
689
aGame_over_strings_color    db      'Game_over_string_color',0
1001
aGame_over_strings_color    db      'Game_over_string_color',0
690
aScore_string_color         db      'Score_string_color',0
1002
aScore_string_color         db      'Score_string_color',0
691
aHiscore_string_color       db      'Hiscore_string_color',0
1003
aHiscore_string_color       db      'Hiscore_string_color',0
692
aChampion_string_color      db      'Champion_string_color',0
1004
aChampion_string_color      db      'Champion_string_color',0
693
aGame_over_hiscore_color    db      'Game_over_hiscore_color',0
1005
aGame_over_hiscore_color    db      'Game_over_hiscore_color',0
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
-
 
1010
 
-
 
1011
aScore                      db      'Score',0
-
 
1012
aHiscore                    db      'Hiscore',0
-
 
1013
aChampion_name              db      'Champion_name',0
698
 
1014
 
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:
-
 
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:
-
 
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
 
712
rb 4096
1057
rb 4096
713
stacktop:
1058
stacktop:
714
d_end:
1059
d_end: