Rev 1522 | Rev 1677 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1522 | Rev 1566 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;===HEADER==================================================================================================================== |
1 | ;;===HEADER==================================================================================================================== |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | use32 |
3 | use32 |
4 | org 0x0 |
4 | org 0x0 |
5 | db 'MENUET01' |
5 | db 'MENUET01' |
Line 6... | Line 6... | ||
6 | dd 0x1,start,i_end,d_end,stacktop,0x0,cur_dir_path |
6 | dd 0x01,start,i_end,d_end,stacktop,0x0,cur_dir_path |
Line 7... | Line 7... | ||
7 | 7 | ||
8 | ;;---HEADER-------------------------------------------------------------------------------------------------------------------- |
8 | ;;---HEADER-------------------------------------------------------------------------------------------------------------------- |
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 -... | Line 17... | ||
- | 17 | ;;===Define_chapter============================================================================================================ |
|
- | 18 | ||
- | 19 | GRID_WIDTH equ 28 |
|
- | 20 | GRID_HEIGHT equ 14 |
|
- | 21 | ||
17 | ;;===Define_chapter============================================================================================================ |
22 | MIN_SQUARE_SIDE_LENGTH equ 9 |
Line 18... | Line 23... | ||
18 | 23 | ||
19 | SCORE_EAT equ 100 |
24 | SCORE_EAT equ 100 |
20 | 25 | ||
21 | LEFT equ 0 |
26 | LEFT equ 0 |
Line -... | Line 27... | ||
- | 27 | DOWN equ 1 |
|
- | 28 | UP equ 2 |
|
- | 29 | RIGHT equ 3 |
|
- | 30 | ||
- | 31 | struct LEVEL |
|
- | 32 | field db GRID_WIDTH*GRID_HEIGHT dup (?) |
|
- | 33 | snake_dots db 6 dup (?) |
|
- | 34 | snake_direction dd ? |
|
- | 35 | snake_direction_next dd ? |
|
- | 36 | number_of_stones dd ? |
|
- | 37 | ends |
|
- | 38 | ||
- | 39 | CLASSIC_MODE equ 0 |
|
- | 40 | LEVELS_MODE equ 1 |
|
- | 41 | ||
- | 42 | CLASSIC_MODE_FIRST_LEVEL equ 0 |
|
- | 43 | LEVELS_MODE_FIRST_LEVEL equ 1 |
|
- | 44 | ||
- | 45 | EAT_TO_END_LEVEL equ 12 |
|
- | 46 | PAUSE_BETWEEN_LEVELS equ 250 |
|
- | 47 | PAUSE_WHILE_DRAWING_SPLASH equ 4 |
|
22 | DOWN equ 1 |
48 | |
Line 23... | Line 49... | ||
23 | UP equ 2 |
49 | CHAMPION_NAME_LENGTH equ 15 |
Line 24... | Line 50... | ||
24 | RIGHT equ 3 |
50 | LAST_LEVEL_NUMBER equ 12 |
Line 43... | Line 69... | ||
43 | mov dword[eax], '.ini' |
69 | mov dword[eax], '.ini' |
Line 44... | Line 70... | ||
44 | 70 | ||
45 | invoke ini.get_int, cur_dir_path, aPreferences, aSpeed, 80 |
71 | invoke ini.get_int, cur_dir_path, aPreferences, aSpeed, 80 |
46 | neg eax |
72 | neg eax |
47 | add [time_wait_limit], eax |
- | |
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 |
73 | add [time_wait_limit], eax |
Line 52... | Line 74... | ||
52 | invoke ini.get_str, cur_dir_path, aPreferences, aTheme, aTheme_name, 31, aTheme_name |
74 | invoke ini.get_str, cur_dir_path, aPreferences, aTheme, aTheme_name, 31, aTheme_name |
53 | 75 | ||
54 | invoke ini.get_int, cur_dir_path, aTheme_name, aDecorations, 2 |
76 | invoke ini.get_int, cur_dir_path, aTheme_name, aDecorations, 2 |
55 | mov [decorations], al |
77 | mov [decorations], eax |
56 | invoke ini.get_color, cur_dir_path, aTheme_name, aBackground_color, 0x000000 |
78 | invoke ini.get_color, cur_dir_path, aTheme_name, aBackground_color, 0x000000 |
57 | or [background_color], eax |
79 | or [background_color], eax |
58 | or [window_style], eax |
80 | or [window_style], eax |
59 | invoke ini.get_color, cur_dir_path, aTheme_name, aDecorations_color, 0x00aaaa00 |
81 | invoke ini.get_color, cur_dir_path, aTheme_name, aDecorations_color, 0xAAAA00 |
60 | or [decorations_color], eax |
82 | or [decorations_color], eax |
61 | invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_color, 0x1111ff |
83 | invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_color, 0x1111ff |
62 | or [snake_color], eax |
84 | or [snake_color], eax |
63 | invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_head_color, 0x1111ff |
85 | invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_head_color, 0x6B6Bff |
64 | or [snake_head_color], eax |
86 | or [snake_head_color], eax |
65 | invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_picture_color, 0x4488ff |
87 | invoke ini.get_color, cur_dir_path, aTheme_name, aSnake_picture_color, 0x4488ff |
66 | or [snake_picture_color], eax |
88 | or [snake_picture_color], eax |
67 | invoke ini.get_color, cur_dir_path, aTheme_name, aVersion_picture_color, 0x55ff55 |
89 | invoke ini.get_color, cur_dir_path, aTheme_name, aVersion_picture_color, 0x55ff55 |
68 | or [version_picture_color], eax |
90 | or [version_picture_color], eax |
69 | invoke ini.get_color, cur_dir_path, aTheme_name, aPause_picture_color, 0x11ff11 |
91 | invoke ini.get_color, cur_dir_path, aTheme_name, aPause_picture_color, 0x11ff11 |
70 | or [pause_picture_color], eax |
92 | or [pause_picture_color], eax |
- | 93 | invoke ini.get_color, cur_dir_path, aTheme_name, aGame_over_picture_color, 0xff1111 |
|
- | 94 | or [game_over_picture_color], eax |
|
71 | invoke ini.get_color, cur_dir_path, aTheme_name, aGame_over_picture_color, 0xff1111 |
95 | invoke ini.get_color, cur_dir_path, aTheme_name, aYou_win_picture_color, 0xffff11 |
72 | or [game_over_picture_color], eax |
96 | or [you_win_picture_color], eax |
73 | invoke ini.get_color, cur_dir_path, aTheme_name, aEat_color, 0xffff11 |
97 | invoke ini.get_color, cur_dir_path, aTheme_name, aEat_color, 0xffff11 |
74 | or [eat_color], eax |
98 | or [eat_color], eax |
75 | invoke ini.get_color, cur_dir_path, aTheme_name, aNavigation_strings_color, 0x80ff7777 |
99 | invoke ini.get_color, cur_dir_path, aTheme_name, aNavigation_strings_color, 0x80ff7777 |
76 | or [navigation_strings_color], eax |
100 | or [navigation_strings_color], eax |
77 | invoke ini.get_color, cur_dir_path, aTheme_name, aGame_over_strings_color, 0x80ff9900 |
101 | invoke ini.get_color, cur_dir_path, aTheme_name, aGame_over_strings_color, 0x80ff9900 |
78 | or [game_over_strings_color], eax |
102 | or [game_over_strings_color], eax |
- | 103 | invoke ini.get_color, cur_dir_path, aTheme_name, aScore_string_color, 0x80ffffff |
|
- | 104 | or [score_string_color], eax |
|
79 | invoke ini.get_color, cur_dir_path, aTheme_name, aScore_string_color, 0x80ffffff |
105 | invoke ini.get_color, cur_dir_path, aTheme_name, aLevel_string_color, 0xffffff |
80 | or [score_string_color], eax |
106 | or [level_string_color], eax |
81 | invoke ini.get_color, cur_dir_path, aTheme_name, aHiscore_string_color, 0x80ffffff |
107 | invoke ini.get_color, cur_dir_path, aTheme_name, aHiscore_string_color, 0x80ffffff |
82 | or [hiscore_string_color], eax |
108 | or [hiscore_string_color], eax |
83 | invoke ini.get_color, cur_dir_path, aTheme_name, aChampion_string_color, 0x80ffffff |
109 | invoke ini.get_color, cur_dir_path, aTheme_name, aChampion_string_color, 0x80ffffff |
84 | or [champion_string_color], eax |
110 | or [champion_string_color], eax |
85 | invoke ini.get_color, cur_dir_path, aTheme_name, aGame_over_hiscore_color, 0x80ffdd44 |
111 | invoke ini.get_color, cur_dir_path, aTheme_name, aGame_over_hiscore_color, 0x80ffdd44 |
86 | or [game_over_hiscore_color], eax |
112 | or [game_over_hiscore_color], eax |
- | 113 | invoke ini.get_color, cur_dir_path, aTheme_name, aScore_number_color, 0xffffff |
|
- | 114 | or [score_number_color], eax |
|
87 | invoke ini.get_color, cur_dir_path, aTheme_name, aScore_number_color, 0xffffff |
115 | invoke ini.get_color, cur_dir_path, aTheme_name, aLevel_number_color, 0xffffff |
88 | or [score_number_color], eax |
116 | or [level_number_color], eax |
89 | invoke ini.get_color, cur_dir_path, aTheme_name, aHiscore_number_color, 0x00ffffff |
117 | invoke ini.get_color, cur_dir_path, aTheme_name, aHiscore_number_color, 0x00ffffff |
90 | or [hiscore_number_color], eax |
118 | or [hiscore_number_color], eax |
91 | invoke ini.get_color, cur_dir_path, aTheme_name, aChampion_name_color, 0x80ffffff |
119 | invoke ini.get_color, cur_dir_path, aTheme_name, aChampion_name_color, 0x80ffffff |
92 | or [champion_name_color], eax |
120 | or [champion_name_color], eax |
- | 121 | invoke ini.get_color, cur_dir_path, aTheme_name, aEdit_box_selection_color, 0x00aa00 |
|
- | 122 | or [edit1.shift_color], eax |
|
- | 123 | invoke ini.get_color, cur_dir_path, aTheme_name, aButton_color, 0xDDDDDD |
|
- | 124 | or [button_color], eax |
|
- | 125 | invoke ini.get_color, cur_dir_path, aTheme_name, aButton_text_color, 0x000000 |
|
- | 126 | or [button_text_color], eax |
|
- | 127 | invoke ini.get_color, cur_dir_path, aTheme_name, aStone_color, 0x5f8700 |
|
- | 128 | or [stone_color], eax |
|
- | 129 | invoke ini.get_color, cur_dir_path, aTheme_name, aSplash_background_color, 0xAAAA00 |
|
- | 130 | or [splash_background_color], eax |
|
- | 131 | invoke ini.get_color, cur_dir_path, aTheme_name, aSplash_level_number_color, 0x000000 |
|
- | 132 | or [splash_level_number_color], eax |
|
- | 133 | invoke ini.get_color, cur_dir_path, aTheme_name, aSplash_level_string_color, 0x000000 |
|
- | 134 | or [splash_level_string_color], eax |
|
- | 135 | ||
- | 136 | invoke ini.get_int, cur_dir_path, aReserved, aSquare_side_length, 19 |
|
- | 137 | mov [square_side_length], eax |
|
- | 138 | invoke ini.get_str, cur_dir_path, aReserved, aChampion_name_classic, champion_name_classic, CHAMPION_NAME_LENGTH, champion_name_classic |
|
- | 139 | invoke ini.get_int, cur_dir_path, aReserved, aHiscore_classic, 777 |
|
- | 140 | or [hi_score_classic], eax |
|
- | 141 | invoke ini.get_str, cur_dir_path, aReserved, aChampion_name_levels, champion_name_levels, CHAMPION_NAME_LENGTH, champion_name_levels |
|
Line 93... | Line 142... | ||
93 | invoke ini.get_color, cur_dir_path, aTheme_name, aEdit_box_selection_color, 0x00aa00 |
142 | invoke ini.get_int, cur_dir_path, aReserved, aHiscore_levels, 777 |
94 | or [edit1+0x10], eax |
143 | or [hi_score_levels], eax |
95 | 144 | ||
96 | mov eax, [background_color] |
145 | mov eax, [background_color] |
97 | mov [edit1+0x0C], eax |
146 | mov [edit1.color], eax |
98 | mov [edit1+0x14], eax |
147 | mov [edit1.focus_border_color], eax |
- | 148 | mov [edit1.blur_border_color], eax |
|
- | 149 | mov eax, [game_over_hiscore_color] |
|
- | 150 | mov [edit1.text_color], eax |
|
Line 99... | Line 151... | ||
99 | mov [edit1+0x18], eax |
151 | |
Line 100... | Line 152... | ||
100 | mov eax, [game_over_hiscore_color] |
152 | mcall 37,4,cursor_data,2 ; load empty cursor (for "hiding" cursor while level_mode) |
101 | mov [edit1+0x1C], eax |
153 | mov [cursor_handle], eax |
102 | 154 | ||
103 | call Set_geometry |
155 | call Set_geometry |
Line 104... | Line 156... | ||
104 | 156 | ||
Line -... | Line 157... | ||
- | 157 | include 'first_menu.asm' ; First menu body and functions |
|
- | 158 | include 'level.asm' ; Level body and functions (game process) |
|
- | 159 | include 'pause.asm' ; Pause body and functions |
|
- | 160 | include 'game_over.asm' ; Game_over body and functions |
|
- | 161 | ||
- | 162 | ;;===Some_functions============================================================================================================ |
|
- | 163 | ||
- | 164 | ||
- | 165 | Save_do_smth_else_and_exit: |
|
- | 166 | ;;===Save_do_smth_else_and_exit============================================================================================ |
|
- | 167 | ||
- | 168 | mcall 37,6,[cursor_handle] ; delete cursor |
|
- | 169 | ||
- | 170 | invoke ini.set_int, cur_dir_path, aReserved, aSquare_side_length, [square_side_length] |
|
- | 171 | ||
- | 172 | mov edi, champion_name_classic |
|
- | 173 | xor al, al |
|
- | 174 | mov ecx, CHAMPION_NAME_LENGTH+1 |
|
- | 175 | cld |
|
- | 176 | repne scasb |
|
- | 177 | neg ecx |
|
- | 178 | add ecx, CHAMPION_NAME_LENGTH |
|
- | 179 | invoke ini.set_str, cur_dir_path, aReserved, aChampion_name_classic, champion_name_classic, ecx |
|
- | 180 | invoke ini.set_int, cur_dir_path, aReserved, aHiscore_classic, [hi_score_classic] |
|
- | 181 | ||
- | 182 | mov edi, champion_name_levels |
|
- | 183 | xor al, al |
|
- | 184 | mov ecx, CHAMPION_NAME_LENGTH+1 |
|
- | 185 | cld |
|
- | 186 | repne scasb |
|
- | 187 | neg ecx |
|
105 | include 'first_menu.asm' ; First menu body and functions |
188 | add ecx, CHAMPION_NAME_LENGTH |
106 | include 'level.asm' ; Level body and functions (game process) |
189 | invoke ini.set_str, cur_dir_path, aReserved, aChampion_name_levels, champion_name_levels, ecx |
Line 107... | Line 190... | ||
107 | include 'pause.asm' ; Pause body and functions |
190 | invoke ini.set_int, cur_dir_path, aReserved, aHiscore_levels, [hi_score_levels] |
108 | include 'game_over.asm' ; Game_over body and functions |
191 | |
Line 119... | Line 202... | ||
119 | 202 | ||
120 | 203 | ||
Line 121... | Line 204... | ||
121 | Set_geometry: |
204 | Set_geometry: |
122 | ;;===Set_geometry========================================================================================================== |
205 | ;;===Set_geometry========================================================================================================== |
123 | 206 | ||
Line 124... | Line 207... | ||
124 | mov eax, [space_between_squares] |
207 | mov eax, [square_side_length] |
125 | add eax, [square_side_length] |
208 | inc eax ; space between squares |
126 | mov [g_s], eax |
209 | mov [g_s], eax |
Line 138... | Line 221... | ||
138 | 221 | ||
139 | mov eax, [g_e] |
222 | mov eax, [g_e] |
140 | add eax, 25 |
223 | add eax, 25 |
Line 141... | Line -... | ||
141 | mov [gbym1], eax |
- | |
142 | - | ||
143 | mov eax, [g_w] |
- | |
144 | mul word[g_h] |
- | |
145 | mov [gw_mul_gh], eax |
224 | mov [gbym1], eax |
146 | 225 | ||
147 | mov edx, [g_w] |
226 | mov edx, GRID_WIDTH |
148 | mov eax, [g_s] |
227 | mov eax, [g_s] |
Line 149... | Line 228... | ||
149 | mul dx |
228 | mul dx |
150 | mov [gw_mul_gs], eax |
229 | mov [gw_mul_gs], eax |
151 | 230 | ||
152 | mov edx, [g_h] |
231 | mov edx, GRID_HEIGHT |
Line 153... | Line 232... | ||
153 | mov eax, [g_s] |
232 | mov eax, [g_s] |
Line 182... | Line 261... | ||
182 | add eax, [gbxm1] |
261 | add eax, [gbxm1] |
183 | add eax, [gbxm1] |
262 | add eax, [gbxm1] |
184 | add eax, 5*2 ; skin width |
263 | add eax, 5*2 ; skin width |
185 | mov [window_width], eax |
264 | mov [window_width], eax |
Line -... | Line 265... | ||
- | 265 | ||
186 | 266 | mcall 48,4 ; get skin header height |
|
187 | mov eax, [gh_mul_gs] |
267 | add eax, [gh_mul_gs] |
188 | add eax, [gbym1] |
268 | add eax, [gbym1] |
189 | add eax, [g_e] |
269 | add eax, [g_e] |
190 | add eax, 30 |
270 | add eax, 30 |
191 | add eax, 22+5 ; skin height |
271 | add eax, 5 ; skin height (bottom part) |
Line 192... | Line 272... | ||
192 | mov [window_height], eax |
272 | mov [window_height], eax |
193 | 273 | ||
194 | mcall 48, 5 |
274 | mcall 48, 5 |
195 | mov dx, ax |
275 | mov dx, ax |
196 | shr eax, 16 |
276 | shr eax, 16 |
197 | sub dx, ax |
277 | sub dx, ax |
198 | cmp dx, word[window_width] ; does window fit to work area width? |
278 | 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)' |
279 | jnl @f |
206 | ; newline |
280 | dec [square_side_length] |
Line 207... | Line 281... | ||
207 | jmp Set_geometry |
281 | jmp Set_geometry |
208 | @@: |
282 | @@: |
209 | 283 | ||
210 | mov cx, bx |
284 | mov cx, bx |
211 | shr ebx, 16 |
285 | shr ebx, 16 |
212 | sub cx, bx |
286 | 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 |
287 | cmp cx, word[window_height] ; does window fit to work area height? |
220 | ; dps 'Check you config file! (snake.ini)' |
288 | jnl @f |
Line 221... | Line 289... | ||
221 | ; newline |
289 | dec [square_side_length] |
222 | jmp Set_geometry |
290 | jmp Set_geometry |
Line 240... | Line 308... | ||
240 | mov [bottom_middle_strings], eax |
308 | mov [bottom_middle_strings], eax |
241 | add eax, 6 |
309 | add eax, 6 |
242 | mov [bottom_bottom_strings], eax |
310 | mov [bottom_bottom_strings], eax |
Line 243... | Line 311... | ||
243 | 311 | ||
244 | sub eax, 4 |
312 | sub eax, 4 |
- | 313 | mov [edit1.top], eax |
|
- | 314 | ||
- | 315 | ||
- | 316 | mov eax, [g_s] |
|
- | 317 | shl eax, 2 |
|
- | 318 | sub eax, 2 |
|
- | 319 | mov [button_width_short], eax |
|
- | 320 | mov eax, [g_s] |
|
- | 321 | shl eax, 3 |
|
- | 322 | add eax, [g_s] |
|
- | 323 | sub eax, 2 |
|
- | 324 | mov [button_width_long], eax |
|
- | 325 | mov eax, [g_s] |
|
- | 326 | sub eax, 2 |
|
- | 327 | mov [button_height], eax |
|
- | 328 | ||
- | 329 | mov bl, 0x10 |
|
- | 330 | mov cl, 0x08 |
|
- | 331 | ||
- | 332 | mov al, byte[g_s] |
|
- | 333 | mul bl |
|
- | 334 | mov bx, ax |
|
- | 335 | add bx, word[gbxm1] |
|
- | 336 | inc bx |
|
- | 337 | ||
- | 338 | mov al, byte[g_s] |
|
- | 339 | mul cl |
|
- | 340 | mov cx, ax |
|
- | 341 | add cx, word[gbym1] |
|
- | 342 | inc cx |
|
- | 343 | ||
- | 344 | mov [button_x_left], ebx |
|
- | 345 | mov [button_y_top], ecx |
|
- | 346 | ||
- | 347 | add ebx, [g_s] |
|
- | 348 | add ebx, [g_s] |
|
- | 349 | add ebx, [g_s] |
|
- | 350 | add ebx, [g_s] |
|
- | 351 | add ebx, [g_s] |
|
- | 352 | ||
- | 353 | mov [button_x_right], ebx |
|
- | 354 | ||
- | 355 | add ecx, [g_s] |
|
- | 356 | add ecx, [g_s] |
|
- | 357 | ||
- | 358 | mov [button_y_middle], ecx |
|
- | 359 | ||
- | 360 | add ecx, [g_s] |
|
- | 361 | add ecx, [g_s] |
|
- | 362 | ||
- | 363 | mov [button_y_bottom], ecx |
|
Line 245... | Line 364... | ||
245 | mov [edit1+0x08], eax |
364 | |
Line 246... | Line 365... | ||
246 | 365 | ||
Line -... | Line 366... | ||
- | 366 | ret |
|
- | 367 | ||
- | 368 | ;;---Set_geometry------------------------------------------------------------------------------------------------------ |
|
- | 369 | ||
- | 370 | ||
- | 371 | Increase_geometry: |
|
- | 372 | ;;===Increase_geometry================================================================================================= |
|
- | 373 | ||
- | 374 | inc [square_side_length] |
|
- | 375 | call Set_geometry |
|
- | 376 | mcall 67,[wp_x],[wp_y],[window_width],[window_height] |
|
- | 377 | ||
- | 378 | ret |
|
- | 379 | ||
- | 380 | ;;---Increase_geometry------------------------------------------------------------------------------------------------- |
|
- | 381 | ||
- | 382 | ||
- | 383 | Decrease_geometry: |
|
- | 384 | ;;===Decrease_geometry================================================================================================= |
|
- | 385 | ||
- | 386 | cmp [square_side_length], MIN_SQUARE_SIDE_LENGTH |
|
- | 387 | je @f |
|
- | 388 | dec [square_side_length] |
|
- | 389 | call Set_geometry |
|
- | 390 | mcall 67,[wp_x],[wp_y],[window_width],[window_height] |
|
- | 391 | ||
- | 392 | @@: |
|
247 | ret |
393 | ret |
248 | 394 | ||
Line 249... | Line 395... | ||
249 | ;;---Set_geometry------------------------------------------------------------------------------------------------------ |
395 | ;;---Decrease_geometry------------------------------------------------------------------------------------------------- |
250 | 396 | ||
251 | 397 | ||
252 | Draw_decorations: |
398 | Draw_decorations: |
253 | ;;===Draw_decorations================================================================================================== |
399 | ;;===Draw_decorations================================================================================================== |
254 | 400 | ||
Line 285... | Line 431... | ||
285 | mov ebx, [gbxm1_shl16_gbxm1] |
431 | mov ebx, [gbxm1_shl16_gbxm1] |
286 | ;mov ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP) |
432 | ;mov ecx, (GRID_BEGIN_Y-1)*65536+(GRID_BEGIN_Y-1+GRID_HEIGHT*GRID_STEP) |
287 | mov ecx, [gbym1_shl16_gbym1] |
433 | mov ecx, [gbym1_shl16_gbym1] |
288 | add ecx, [gh_mul_gs] |
434 | add ecx, [gh_mul_gs] |
289 | mov edx, [decorations_color] |
435 | mov edx, [decorations_color] |
290 | mov esi, [g_w] |
436 | mov esi, GRID_WIDTH |
291 | add esi, 1 |
437 | add esi, 1 |
Line 292... | Line 438... | ||
292 | 438 | ||
293 | @@: |
439 | @@: |
294 | mcall |
440 | mcall |
Line 298... | Line 444... | ||
298 | 444 | ||
299 | ;mov ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP) |
445 | ;mov ebx, (GRID_BEGIN_X-1)*65536+(GRID_BEGIN_X-1+GRID_WIDTH*GRID_STEP) |
300 | mov ebx, [gbxm1_shl16_gbxm1] |
446 | mov ebx, [gbxm1_shl16_gbxm1] |
301 | add ebx, [gw_mul_gs] |
447 | add ebx, [gw_mul_gs] |
302 | mov ecx, [gbym1_shl16_gbym1] |
448 | mov ecx, [gbym1_shl16_gbym1] |
303 | mov esi, [g_h] |
449 | mov esi, GRID_HEIGHT |
Line 304... | Line 450... | ||
304 | add esi, 1 |
450 | add esi, 1 |
305 | 451 | ||
306 | @@: |
452 | @@: |
Line 320... | Line 466... | ||
320 | sub ecx, [g_e] |
466 | sub ecx, [g_e] |
321 | shl ecx, 16 |
467 | shl ecx, 16 |
322 | add ecx, [gbym1_plus_gh_mul_gs] |
468 | add ecx, [gbym1_plus_gh_mul_gs] |
323 | add ecx, [g_e] |
469 | add ecx, [g_e] |
324 | mov edx, [decorations_color] |
470 | mov edx, [decorations_color] |
325 | mov esi, [g_w] |
471 | mov esi, GRID_WIDTH |
326 | add esi, 1 |
472 | add esi, 1 |
Line 327... | Line 473... | ||
327 | 473 | ||
328 | @@: |
474 | @@: |
329 | mcall |
475 | mcall |
Line 335... | Line 481... | ||
335 | sub ebx, [g_e] |
481 | sub ebx, [g_e] |
336 | shl ebx, 16 |
482 | shl ebx, 16 |
337 | add ebx, [gbxm1_plus_gw_mul_gs] |
483 | add ebx, [gbxm1_plus_gw_mul_gs] |
338 | add ebx, [g_e] |
484 | add ebx, [g_e] |
339 | mov ecx, [gbym1_shl16_gbym1] |
485 | mov ecx, [gbym1_shl16_gbym1] |
340 | mov esi, [g_h] |
486 | mov esi, GRID_HEIGHT |
341 | add esi, 1 |
487 | add esi, 1 |
Line 342... | Line 488... | ||
342 | 488 | ||
343 | @@: |
489 | @@: |
344 | mcall |
490 | mcall |
Line 594... | Line 740... | ||
594 | ;;===Draw_square======================================================================================================= |
740 | ;;===Draw_square======================================================================================================= |
595 | ;; bl - x_coord |
741 | ;; bl - x_coord |
596 | ;; bh - y_coord |
742 | ;; bh - y_coord |
597 | ;; edx - color |
743 | ;; edx - color |
Line -... | Line 744... | ||
- | 744 | ||
- | 745 | push eax ebx ecx edx |
|
598 | 746 | ||
Line 599... | Line 747... | ||
599 | mov cl, bh |
747 | mov cl, bh |
600 | 748 | ||
601 | mov al, byte[g_s] |
749 | mov al, byte[g_s] |
Line 616... | Line 764... | ||
616 | add ecx, [g_s] |
764 | add ecx, [g_s] |
617 | dec ecx |
765 | dec ecx |
Line 618... | Line 766... | ||
618 | 766 | ||
Line -... | Line 767... | ||
- | 767 | mcall 13 |
|
- | 768 | ||
619 | mcall 13 |
769 | pop edx ecx ebx eax |
Line 620... | Line 770... | ||
620 | 770 | ||
Line 621... | Line 771... | ||
621 | ret |
771 | ret |
622 | 772 | ||
Line 623... | Line 773... | ||
623 | ;;---Draw_square------------------------------------------------------------------------------------------------------- |
773 | ;;---Draw_square------------------------------------------------------------------------------------------------------- |
624 | 774 | ||
625 | 775 | ||
626 | Draw_menu_esc: |
776 | Draw_menu_esc: |
627 | ;;===Draw_menu_esc===================================================================================================== |
777 | ;;===Draw_menu_esc===================================================================================================== |
628 | 778 | ||
Line 629... | Line 779... | ||
629 | mov ebx, [window_width] |
779 | mov ebx, [window_width] |
Line 656... | Line 806... | ||
656 | Draw_score_number: |
806 | Draw_score_number: |
657 | ;;===Draw_score_number================================================================================================= |
807 | ;;===Draw_score_number================================================================================================= |
Line 658... | Line 808... | ||
658 | 808 | ||
659 | mov edx, [window_width] |
809 | mov edx, [window_width] |
660 | shr edx, 3 |
810 | shr edx, 3 |
661 | sub edx, 6 |
811 | sub edx, 5+1 |
662 | add edx, (string_hi_score-string_score)*6 |
812 | add edx, string_score.size*6 |
663 | shl edx, 16 |
813 | shl edx, 16 |
664 | add edx, dword[bottom_top_strings] |
814 | add edx, dword[bottom_top_strings] |
Line 665... | Line 815... | ||
665 | mcall 47,0x00070000,[score], ,[score_number_color],[background_color] |
815 | mcall 47,0x00070000,[score], ,[score_number_color],[background_color] |
Line 674... | Line 824... | ||
674 | 824 | ||
675 | mov ebx, [window_width] |
825 | mov ebx, [window_width] |
676 | shr ebx, 3 |
826 | shr ebx, 3 |
677 | neg ebx |
827 | neg ebx |
678 | add ebx, [window_width] |
828 | add ebx, [window_width] |
679 | sub ebx, (string_player-string_hi_score)*6+7*6+5 |
829 | sub ebx, string_hi_score.size*6+7*6+5 |
680 | shl ebx, 16 |
830 | shl ebx, 16 |
681 | add ebx, dword[bottom_top_strings] |
831 | add ebx, dword[bottom_top_strings] |
Line 682... | Line 832... | ||
682 | mcall 4, ,[hiscore_string_color],string_hi_score |
832 | mcall 4, ,[hiscore_string_color],string_hi_score |
Line 683... | Line 833... | ||
683 | 833 | ||
Line 684... | Line 834... | ||
684 | ret |
834 | ret |
685 | 835 | ||
Line 686... | Line 836... | ||
686 | ;;---Draw_hiscore_string----------------------------------------------------------------------------------------------- |
836 | ;;---Draw_hiscore_string----------------------------------------------------------------------------------------------- |
687 | 837 | ||
688 | 838 | ||
689 | Draw_hiscore_number: |
839 | Draw_hiscore_number: |
690 | ;;===Draw_hiscore_number=============================================================================================== |
840 | ;;===Draw_hiscore_number=================================================================================================== |
691 | 841 | ||
692 | mov edx, [window_width] |
842 | mov edx, [window_width] |
- | 843 | shr edx, 3 |
|
- | 844 | neg edx |
|
- | 845 | add edx, [window_width] |
|
- | 846 | sub edx, 7*6+6 |
|
- | 847 | shl edx, 16 |
|
- | 848 | add edx, dword[bottom_top_strings] |
|
- | 849 | ||
- | 850 | cmp [play_mode], CLASSIC_MODE |
|
- | 851 | jne @f |
|
693 | shr edx, 3 |
852 | mov ecx, [hi_score_classic] |
Line 694... | Line 853... | ||
694 | neg edx |
853 | jmp .done |
Line 695... | Line 854... | ||
695 | add edx, [window_width] |
854 | @@: |
Line 696... | Line 855... | ||
696 | sub edx, 7*6+6 |
855 | mov ecx, [hi_score_levels] |
697 | shl edx, 16 |
856 | |
Line 698... | Line 857... | ||
698 | add edx, dword[bottom_top_strings] |
857 | .done: |
699 | mcall 47,0x00070000,[hi_score], ,[hiscore_number_color] |
858 | mcall 47,0x00070000, , ,[hiscore_number_color] |
700 | 859 | ||
701 | ret |
860 | ret |
702 | 861 | ||
703 | ;;---Draw_hiscore_number----------------------------------------------------------------------------------------------- |
862 | ;;---Draw_hiscore_number--------------------------------------------------------------------------------------------------- |
704 | 863 | ||
705 | 864 | ||
Line 706... | Line 865... | ||
706 | Draw_champion_string: |
865 | Draw_champion_string: |
Line 725... | Line 884... | ||
725 | 884 | ||
726 | mov ebx, [window_width] |
885 | mov ebx, [window_width] |
727 | shr ebx, 3 |
886 | shr ebx, 3 |
728 | neg ebx |
887 | neg ebx |
729 | add ebx, [window_width] |
888 | add ebx, [window_width] |
730 | sub ebx, (press_to_start-champion_name)*6+7*6+6 |
889 | sub ebx, CHAMPION_NAME_LENGTH/2*6+7*6+6 ; there is no difference between length of champion names for other play_modes |
731 | add ebx, (press_to_start-champion_name)*6 |
890 | add ebx, CHAMPION_NAME_LENGTH/2*6 |
732 | shl ebx, 16 |
891 | shl ebx, 16 |
- | 892 | add ebx, dword[bottom_bottom_strings] |
|
- | 893 | ||
- | 894 | cmp [play_mode], CLASSIC_MODE |
|
- | 895 | jne @f |
|
- | 896 | mov edx, champion_name_classic |
|
- | 897 | jmp .done |
|
- | 898 | @@: |
|
- | 899 | mov edx, champion_name_levels |
|
- | 900 | ||
733 | add ebx, dword[bottom_bottom_strings] |
901 | .done: |
Line 734... | Line 902... | ||
734 | mcall 4, ,[champion_name_color],champion_name |
902 | mcall 4, ,[champion_name_color], |
Line 735... | Line 903... | ||
735 | 903 | ||
Line 781... | Line 949... | ||
781 | ;; al = x coord |
949 | ;; al = x coord |
782 | ;; ah = y coord |
950 | ;; ah = y coord |
783 | ;; cl = value to draw |
951 | ;; cl = value to draw |
784 | ;; |
952 | ;; |
Line -... | Line 953... | ||
- | 953 | ||
- | 954 | push eax ebx edx |
|
785 | 955 | ||
786 | and eax, 0x0000ffff |
956 | and eax, 0x0000ffff |
787 | xor bx, bx |
957 | xor bx, bx |
788 | mov bl, al |
958 | mov bl, al |
789 | shr ax, 8 |
959 | shr ax, 8 |
790 | mov dx, word[g_w] |
960 | mov dx, GRID_WIDTH |
791 | mul dx |
961 | mul dx |
792 | add ax, bx |
962 | add ax, bx |
793 | mov edi, field_map |
963 | mov edx, field_map |
794 | add edi, eax |
964 | add edx, eax |
- | 965 | mov [edx], cl |
|
- | 966 | ||
Line 795... | Line 967... | ||
795 | mov [edi], cl |
967 | pop edx ebx eax |
Line 796... | Line 968... | ||
796 | 968 | ||
Line 797... | Line 969... | ||
797 | ret |
969 | ret |
798 | 970 | ||
799 | ;;---Draw_on_map------------------------------------------------------------------------------------------------------- |
971 | ;;---Draw_on_map----------------------------------------------------------------------------------------------------------- |
800 | 972 | ||
801 | 973 | ||
802 | Get_from_map: |
974 | Get_from_map: |
803 | ;;===Get_from_map====================================================================================================== |
975 | ;;===Get_from_map========================================================================================================== |
Line 812... | Line 984... | ||
812 | 984 | ||
813 | and eax, 0x0000ffff |
985 | and eax, 0x0000ffff |
814 | xor bx, bx |
986 | xor bx, bx |
815 | mov bl, al |
987 | mov bl, al |
816 | shr ax, 8 |
988 | shr ax, 8 |
817 | mov dx, word[g_w] |
989 | mov dx, GRID_WIDTH |
818 | mul dx |
990 | mul dx |
819 | add ax, bx |
991 | add ax, bx |
820 | mov edi, field_map |
992 | mov edi, field_map |
821 | add edi, eax |
993 | add edi, eax |
Line 822... | Line 994... | ||
822 | mov bl, [edi] |
994 | mov bl, [edi] |
Line 823... | Line 995... | ||
823 | 995 | ||
Line 824... | Line 996... | ||
824 | pop eax |
996 | pop eax |
- | 997 | ||
- | 998 | ret |
|
- | 999 | ||
- | 1000 | ;;---Get_from_map----------------------------------------------------------------------------------------------------------- |
|
- | 1001 | ||
- | 1002 | ||
- | 1003 | Load_level: |
|
- | 1004 | ;;===Load_level============================================================================================================= |
|
- | 1005 | ;; in : |
|
- | 1006 | ;; cur_level_number = level number to load |
|
- | 1007 | ;; |
|
- | 1008 | ||
- | 1009 | mov eax, [cur_level_number] |
|
- | 1010 | mov edx, stage_00 |
|
- | 1011 | @@: |
|
- | 1012 | test al, al |
|
- | 1013 | jz @f |
|
- | 1014 | add edx, 410 |
|
- | 1015 | dec al |
|
- | 1016 | jmp @b |
|
- | 1017 | @@: |
|
- | 1018 | ||
- | 1019 | mov [cur_level], edx |
|
- | 1020 | ||
- | 1021 | mov esi, edx |
|
- | 1022 | add esi, LEVEL.field |
|
- | 1023 | mov edi, field_map |
|
- | 1024 | mov ecx, GRID_WIDTH*GRID_HEIGHT/4 |
|
- | 1025 | rep movsd |
|
- | 1026 | ||
- | 1027 | mov esi, edx |
|
- | 1028 | add esi, LEVEL.snake_dots |
|
- | 1029 | mov edi, snake_dots |
|
- | 1030 | mov ecx, 3 |
|
- | 1031 | rep movsw |
|
- | 1032 | ||
- | 1033 | mov esi, edx |
|
- | 1034 | add esi, LEVEL.snake_direction |
|
- | 1035 | mov eax, [esi] |
|
- | 1036 | mov [snake_direction], eax |
|
- | 1037 | ||
- | 1038 | mov esi, edx |
|
- | 1039 | add esi, LEVEL.snake_direction_next |
|
- | 1040 | mov eax, [esi] |
|
- | 1041 | mov [snake_direction_next], eax |
|
- | 1042 | ||
- | 1043 | mov esi, edx |
|
- | 1044 | add esi, LEVEL.number_of_stones |
|
- | 1045 | mov eax, [esi] |
|
- | 1046 | mov [number_of_free_dots], GRID_WIDTH*GRID_HEIGHT-3 |
|
- | 1047 | sub [number_of_free_dots], eax |
|
- | 1048 | ||
- | 1049 | mov ax, word[snake_dots] |
|
- | 1050 | mov cl, 1 |
|
- | 1051 | call Draw_on_map |
|
- | 1052 | mov ax, word[snake_dots+2] |
|
- | 1053 | mov cl, 1 |
|
- | 1054 | call Draw_on_map |
|
- | 1055 | mov ax, word[snake_dots+4] |
|
- | 1056 | mov cl, 1 |
|
- | 1057 | call Draw_on_map |
|
- | 1058 | ||
- | 1059 | mov [action], 0 |
|
- | 1060 | mov [snake_length_x2], 6 |
|
- | 1061 | ||
- | 1062 | ret |
|
- | 1063 | ||
- | 1064 | ;;---Load_level------------------------------------------------------------------------------------------------------------- |
|
- | 1065 | ||
- | 1066 | ||
- | 1067 | Draw_stones: |
|
- | 1068 | ;;===Draw_stones============================================================================================================ |
|
- | 1069 | ||
- | 1070 | mov ax, 0*0x100+GRID_WIDTH |
|
- | 1071 | mov cx, 0*0x100+GRID_HEIGHT |
|
- | 1072 | mov edx, [stone_color] |
|
- | 1073 | mov esi, [cur_level] |
|
Line -... | Line 1074... | ||
- | 1074 | add esi, LEVEL.field |
|
Line 825... | Line -... | ||
825 | - | ||
Line -... | Line 1075... | ||
- | 1075 | call Draw_picture |
|
- | 1076 | ||
Line -... | Line 1077... | ||
- | 1077 | ret |
|
- | 1078 | ||
- | 1079 | ;;---Draw_stones------------------------------------------------------------------------------------------------------------ |
|
- | 1080 | ||
- | 1081 | ||
- | 1082 | Hide_cursor: |
|
- | 1083 | ;;===Hide_cursor=========================================================================================================== |
|
- | 1084 | ||
- | 1085 | mcall 37,5,[cursor_handle] |
|
- | 1086 | ||
- | 1087 | ret |
|
- | 1088 | ||
- | 1089 | ;;---Show_cursor----------------------------------------------------------------------------------------------------------- |
|
- | 1090 | ||
- | 1091 | ||
- | 1092 | Show_cursor: |
|
- | 1093 | ;;===Hide_cursor=========================================================================================================== |
|
- | 1094 | ||
- | 1095 | mcall 37,5,0 |
|
- | 1096 | ||
826 | ret |
1097 | ret |
Line 827... | Line 1098... | ||
827 | 1098 | ||
828 | ;;---Get_from_map------------------------------------------------------------------------------------------------------ |
1099 | ;;---Show_cursor----------------------------------------------------------------------------------------------------------- |
829 | 1100 | ||
830 | 1101 | ||
831 | ;;---Some_functions-------------------------------------------------------------------------------------------------------- |
1102 | ;;---Some_functions------------------------------------------------------------------------------------------------------------- |
Line -... | Line 1103... | ||
- | 1103 | ||
- | 1104 | ||
- | 1105 | ;;===Variables================================================================================================================== |
|
Line 832... | Line 1106... | ||
832 | 1106 | ||
833 | 1107 | window_title db 'Snake',0 |
|
834 | ;;===Variables============================================================================================================= |
- | |
835 | - | ||
836 | window_title db 'Snake',0 |
- | |
837 | window_style dd 0x34000000 |
1108 | window_style dd 0x34000000 |
838 | time_before_waiting dd 0x0 |
- | |
839 | time_to_wait dd 0x0 |
- | |
840 | time_wait_limit dd 101 |
- | |
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 |
- | |
848 | - | ||
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,\ |
- | |
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,\ |
- | |
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,\ |
1109 | time_before_waiting dd 0x0 |
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,\ |
1110 | time_to_wait dd 0x0 |
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,\ |
1111 | time_wait_limit dd 101 |
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,\ |
1112 | |
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,\ |
1113 | play_mode dd 0x0 |
- | 1114 | ||
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,\ |
1115 | square_side_length dd 19 |
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,\ |
1116 | |
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,\ |
1117 | gbxm1 dd 30 |
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,\ |
1118 | gbym1 dd 30 |
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 |
1119 | |
864 | 1120 | szZ string_score ,'SCORE : ' |
|
865 | string_score db 'SCORE :',0 |
1121 | szZ string_hi_score ,'HI-SCORE : ' |
Line 866... | Line 1122... | ||
866 | string_hi_score db 'HI-SCORE :',0 |
1122 | ;szZ string_player ,'PLAYER :' |
867 | string_player db 'PLAYER :',0 |
1123 | szZ string_champion ,'CHAMPION : ' |
868 | string_champion db 'CHAMPION :',0 |
- | |
869 | string_level db 'LEVEL :',0 |
1124 | szZ string_level ,'LEVEL : ' |
870 | string_pause_space db 'PAUSE - ',0x27,'SPACE',0x27,0 |
1125 | ;szZ string_hi_level ,'HI-LEVEL :' |
871 | string_resume_space db 'RESUME - ',0x27,'SPACE',0x27,0 |
1126 | szZ string_pause_space ,'PAUSE - ',0x27,'SPACE',0x27 |
872 | string_menu_esc db 'MENU - ',0x27,'ESC',0x27,0 |
1127 | szZ string_resume_space ,'RESUME - ',0x27,'SPACE',0x27 |
873 | string_apply_name_enter db 'APPLY NAME - ',0x27,'ENTER',0x27,0 |
1128 | szZ string_menu_esc ,'MENU - ',0x27,'ESC',0x27 |
- | 1129 | szZ string_apply_name_enter ,'APPLY NAME - ',0x27,'ENTER',0x27 |
|
- | 1130 | szZ press_to_start ,'PRESS ',0x27,'ENTER',0x27,' TO START' |
|
874 | press_to_start db 'PRESS ',0x27,'SPACE',0x27,' OR ',0x27,'ENTER',0x27,' TO START',0 |
1131 | szZ press_esc_to_exit ,'PRESS ',0x27,'ESC',0x27,' TO EXIT' |
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 | 1132 | ;press_F2_to_options db 'PRESS ',0x27,'F2',0x27,' TO OPTIONS',0 |
|
878 | string_congratulations db ' Congratulations!!! New hi-score is :',0 |
1133 | |
879 | string_enter_your_name db 'You are the champion! Enter your name :',0 |
1134 | szZ string_congratulations ,' Congratulations!!! New hi-score is : ' |
880 | strings_end: |
1135 | szZ string_enter_your_name ,'You are the champion! Enter your name : ' |
881 | 1136 | ||
882 | snake_dots db 3,3, 4,3, 5,3, 865 dup (0) |
- | |
883 | snake_napravlenie db 3 |
1137 | szZ string_button_play ,'PLAY' |
884 | snake_napravlenie_next db 3 |
1138 | szZ string_button_exit ,'EXIT' |
885 | snake_length_x2 dd 6 |
1139 | szZ string_button_inc ,'+INC+' |
886 | 1140 | szZ string_button_dec ,'-dec-' |
|
- | 1141 | szZ string_button_pm_classic,'CLASSIC mode' |
|
Line 887... | Line 1142... | ||
887 | score dd 0 |
1142 | szZ string_button_pm_levels ,'LEVELS mode' |
888 | hi_score dd 777 |
1143 | |
889 | is_new_record db 0 |
1144 | is_new_record dd 0 |
890 | 1145 | ||
891 | action db 0 |
1146 | action dd 0 |
Line 928... | Line 1519... | ||
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,\ |
1519 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,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,\ |
1520 | 0,2,0,2,0,0,2,2,0,0,0,0,2,2,0,0,2,0,2,0,0,2,2,0,0,0,2,2,\ |
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,\ |
1521 | 0,2,2,2,0,0,2,0,0,0,0,0,2,0,0,0,2,2,2,0,0,2,0,0,0,0,0,2,\ |
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,\ |
1522 | 0,0,0,0,0,0,2,2,0,0,0,0,2,2,0,0,0,0,0,0,0,2,2,0,0,0,2,2,\ |
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,\ |
1523 | 0,0,0,0,0,0,0,0,2,2,2,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,\ |
1524 | 0,0,0,2,0,2,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,2,2,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,\ |
1525 | 2,2,0,2,2,2,0,0,0,0,0,0,0,2,2,0,2,0,2,0,0,2,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,\ |
1526 | 0,2,0,0,0,0,2,2,2,0,0,0,0,0,2,0,2,2,2,0,0,2,2,0,2,0,2,0,\ |
- | 1527 | 2,2,0,0,0,0,2,0,2,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,2,2,2,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,\ |
1528 | |
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,\ |
1529 | .snake_dots db 27,0, 26,0, 25,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,\ |
1530 | .snake_direction dd LEFT |
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,\ |
1531 | .snake_direction_next dd LEFT |
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,\ |
1532 | .number_of_stones dd 110 |
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 |
1533 | |
942 | 1534 | background_color dd 0x000000 |
|
943 | background_color dd 0x000000 |
1535 | decorations_color dd 0x00000000 |
944 | decorations_color dd 0x00000000 |
1536 | snake_color dd 0x000000 |
945 | snake_color dd 0x000000 |
1537 | snake_head_color dd 0x000000 |
- | 1538 | snake_picture_color dd 0x000000 |
|
- | 1539 | version_picture_color dd 0x000000 |
|
- | 1540 | pause_picture_color dd 0x000000 |
|
- | 1541 | game_over_picture_color dd 0x000000 |
|
- | 1542 | you_win_picture_color dd 0x000000 |
|
- | 1543 | eat_color dd 0x000000 |
|
- | 1544 | navigation_strings_color dd 0x80000000 |
|
- | 1545 | game_over_strings_color dd 0x80000000 |
|
- | 1546 | score_string_color dd 0x80000000 |
|
Line 946... | Line 1547... | ||
946 | snake_head_color dd 0x000000 |
1547 | hiscore_string_color dd 0x80000000 |
947 | snake_picture_color dd 0x000000 |
1548 | champion_string_color dd 0x80000000 |
Line 948... | Line 1549... | ||
948 | version_picture_color dd 0x000000 |
1549 | game_over_hiscore_color dd 0x80000000 |
Line 980... | Line 1581... | ||
980 | 1581 | ||
Line 981... | Line 1582... | ||
981 | bFirstDraw db 0 |
1582 | bFirstDraw db 0 |
982 | 1583 | ||
983 | aPreferences db 'Preferences',0 |
- | |
984 | aSpeed db 'Speed',0 |
- | |
985 | aSquare_side_length db 'Square_side_length',0 |
1584 | aPreferences db 'Preferences',0 |
Line 986... | Line 1585... | ||
986 | aSpace_between_squares db 'Space_between_squares',0 |
1585 | aSpeed db 'Speed',0 |
987 | aTheme db 'Theme',0 |
1586 | aTheme db 'Theme',0 |
988 | 1587 | ||
Line 994... | Line 1593... | ||
994 | aSnake_head_color db 'Snake_head_color',0 |
1593 | aSnake_head_color db 'Snake_head_color',0 |
995 | aSnake_picture_color db 'Snake_picture_color',0 |
1594 | aSnake_picture_color db 'Snake_picture_color',0 |
996 | aVersion_picture_color db 'Version_picture_color',0 |
1595 | aVersion_picture_color db 'Version_picture_color',0 |
997 | aPause_picture_color db 'Pause_picture_color',0 |
1596 | aPause_picture_color db 'Pause_picture_color',0 |
998 | aGame_over_picture_color db 'Game_over_picture_color',0 |
1597 | aGame_over_picture_color db 'Game_over_picture_color',0 |
- | 1598 | aYou_win_picture_color db 'You_win_picture_color',0 |
|
999 | aEat_color db 'Eat_color',0 |
1599 | aEat_color db 'Eat_color',0 |
1000 | aNavigation_strings_color db 'Navigation_string_color',0 |
1600 | aNavigation_strings_color db 'Navigation_string_color',0 |
1001 | aGame_over_strings_color db 'Game_over_string_color',0 |
1601 | aGame_over_strings_color db 'Game_over_string_color',0 |
1002 | aScore_string_color db 'Score_string_color',0 |
1602 | aScore_string_color db 'Score_string_color',0 |
1003 | aHiscore_string_color db 'Hiscore_string_color',0 |
1603 | aHiscore_string_color db 'Hiscore_string_color',0 |
Line 1005... | Line 1605... | ||
1005 | aGame_over_hiscore_color db 'Game_over_hiscore_color',0 |
1605 | aGame_over_hiscore_color db 'Game_over_hiscore_color',0 |
1006 | aScore_number_color db 'Score_number_color',0 |
1606 | aScore_number_color db 'Score_number_color',0 |
1007 | aHiscore_number_color db 'Hiscore_number_color',0 |
1607 | aHiscore_number_color db 'Hiscore_number_color',0 |
1008 | aChampion_name_color db 'Champion_name_color',0 |
1608 | aChampion_name_color db 'Champion_name_color',0 |
1009 | aEdit_box_selection_color db 'Edit_box_selection_color',0 |
1609 | aEdit_box_selection_color db 'Edit_box_selection_color',0 |
- | 1610 | aButton_color db 'Button_color',0 |
|
- | 1611 | aButton_text_color db 'Button_text_color',0 |
|
- | 1612 | aStone_color db 'Stone_color',0 |
|
- | 1613 | aSplash_background_color db 'Splash_background_color',0 |
|
- | 1614 | aSplash_level_string_color db 'Splash_level_string_color',0 |
|
- | 1615 | aSplash_level_number_color db 'Splash_level_number_color',0 |
|
- | 1616 | aLevel_string_color db 'Level_string_color',0 |
|
- | 1617 | aLevel_number_color db 'Level_number_color',0 |
|
Line 1010... | Line 1618... | ||
1010 | 1618 | ||
- | 1619 | aReserved db 'Reserved',0 |
|
- | 1620 | aSquare_side_length db 'Square_side_length',0 |
|
- | 1621 | aHiscore_classic db 'Hiscore_classic',0 |
|
1011 | aScore db 'Score',0 |
1622 | aChampion_name_classic db 'Champion_name_classic',0 |
1012 | aHiscore db 'Hiscore',0 |
1623 | aHiscore_levels db 'Hiscore_levels',0 |
Line 1013... | Line 1624... | ||
1013 | aChampion_name db 'Champion_name',0 |
1624 | aChampion_name_levels db 'Champion_name_levels',0 |
Line 1014... | Line 1625... | ||
1014 | 1625 | ||
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 |
1626 | 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 | 1627 | ||
1017 | hed db '',0 |
1628 | hed db '',0 |
1018 | ;;---Variables------------------------------------------------------------------------------------------------------------- |
1629 | ;;---Variables------------------------------------------------------------------------------------------------------------- |
1019 | i_end: |
1630 | i_end: |
Line -... | Line 1631... | ||
- | 1631 | hed_end: |
|
- | 1632 | rb 256 |
|
- | 1633 | mouse_dd rd 1 |
|
- | 1634 | ||
- | 1635 | cur_level rd 1 |
|
- | 1636 | cur_level_number rd 1 |
|
- | 1637 | hi_level rd 1 |
|
- | 1638 | ||
- | 1639 | score rd 1 |
|
- | 1640 | hi_score_classic rd 1 |
|
- | 1641 | hi_score_levels rd 1 |
|
- | 1642 | ||
- | 1643 | champion_name_classic rb CHAMPION_NAME_LENGTH |
|
- | 1644 | champion_name_levels rb CHAMPION_NAME_LENGTH |
|
- | 1645 | ||
- | 1646 | snake_dots rb GRID_WIDTH*GRID_HEIGHT*2+3 ; +3 bytes for faster dword copying |
|
1020 | hed_end: |
1647 | snake_direction rd 1 |
1021 | rb 256 |
1648 | snake_direction_next rd 1 |
Line 1022... | Line 1649... | ||
1022 | mouse_dd rd 1 |
1649 | snake_length_x2 rd 1 |
Line 1023... | Line -... | ||
1023 | - | ||
1024 | decorations rb 1 |
- | |
1025 | number_of_free_dots rw 1 |
1650 | |
- | 1651 | decorations rd 1 |
|
Line 1026... | Line 1652... | ||
1026 | 1652 | number_of_free_dots rd 1 |
|
1027 | eat rb 1 |
1653 | |
1028 | 1654 | eat rw 1 |
|
1029 | square_side_length rd 1 |
1655 | |
Line 1030... | Line -... | ||
1030 | space_between_squares rd 1 |
- | |
1031 | g_s rd 1 |
1656 | g_s rd 1 |
1032 | 1657 | g_e rd 1 |
|
1033 | window_width rd 1 |
1658 | |
1034 | window_height rd 1 |
1659 | window_width rd 1 |
1035 | wp_x rd 1 |
1660 | window_height rd 1 |
Line 1047... | Line 1672... | ||
1047 | bottom_top_strings rd 1 |
1672 | bottom_top_strings rd 1 |
1048 | bottom_middle_strings rd 1 |
1673 | bottom_middle_strings rd 1 |
1049 | bottom_bottom_strings rd 1 |
1674 | bottom_bottom_strings rd 1 |
1050 | top_strings rd 1 |
1675 | top_strings rd 1 |
Line -... | Line 1676... | ||
- | 1676 | ||
- | 1677 | button_x_left rd 1 |
|
- | 1678 | button_x_right rd 1 |
|
- | 1679 | button_y_top rd 1 |
|
- | 1680 | button_y_middle rd 1 |
|
- | 1681 | button_y_bottom rd 1 |
|
- | 1682 | button_width_short rd 1 |
|
- | 1683 | button_width_long rd 1 |
|
- | 1684 | button_height rd 1 |
|
- | 1685 | ||
1051 | 1686 | cursor_data rb 32*32*4 |
|
Line 1052... | Line 1687... | ||
1052 | champion_name rb 16 |
1687 | cursor_handle rd 1 |
1053 | 1688 | ||
Line -... | Line 1689... | ||
- | 1689 | cur_dir_path rb 4096 |
|
- | 1690 | @PARAMS rb 4096 |
|
1054 | cur_dir_path rb 4096 |
1691 | |
1055 | @PARAMS rb 4096 |
1692 | field_map rb GRID_WIDTH*GRID_HEIGHT*2 |
1056 | 1693 | ||
1057 | rb 4096 |
1694 | rb 4096 |