|
@@ -58,18 +58,28 @@ const struct conf_entry conf_entries[CONF_ENTRY_COUNT] = {
|
58
|
58
|
};
|
59
|
59
|
|
60
|
60
|
const struct debug_entry debug_entries[DEBUG_ENTRY_COUNT] = {
|
61
|
|
- { .name = "marker", .flag = DBG_MARKER, .max = 1 }, // 0
|
62
|
|
- { .name = "invuln", .flag = DBG_GOD_MODE, .max = 1 }, // 1
|
63
|
|
- { .name = "no-spawn", .flag = DBG_NO_OBJ, .max = 1 }, // 2
|
64
|
|
- { .name = "no-fuel", .flag = DBG_NO_FUEL, .max = 1 }, // 3
|
65
|
|
- { .name = "fastmove", .flag = DBG_FAST, .max = 1 }, // 4
|
66
|
|
- { .name = "music", .flag = DBG_NONE, .max = SND_COUNT }, // 5
|
67
|
|
- { .name = "sfx-test", .flag = DBG_NONE, .max = SFX_COUNT }, // 6
|
68
|
|
- { .name = "cl score", .flag = DBG_CLEAR_SCORE, .max = 1 }, // 7
|
69
|
|
- { .name = "0 scores", .flag = DBG_ZERO_SCORE, .max = 1 }, // 8
|
|
61
|
+ { .name = "marker", .flag = DBG_MARKER, .max = 1 }, // 0
|
|
62
|
+ { .name = "invuln", .flag = DBG_GOD_MODE, .max = 1 }, // 1
|
|
63
|
+ { .name = "no-spawn", .flag = DBG_NO_OBJ, .max = 1 }, // 2
|
|
64
|
+ { .name = "no-fuel", .flag = DBG_NO_FUEL, .max = 1 }, // 3
|
|
65
|
+ { .name = "fastmove", .flag = DBG_FAST, .max = 1 }, // 4
|
|
66
|
+ { .name = "s-frames", .flag = DBG_SHOW_FRAMES, .max = 1 }, // 5
|
|
67
|
+ { .name = "s-timer", .flag = DBG_SHOW_TIMER, .max = 1 }, // 6
|
|
68
|
+ { .name = "s-stack", .flag = DBG_SHOW_STACK, .max = 1 }, // 7
|
|
69
|
+
|
|
70
|
+ // keep at end
|
|
71
|
+ { .name = "music", .flag = DBG_NONE, .max = SND_COUNT }, // 8
|
|
72
|
+ { .name = "sfx-test", .flag = DBG_NONE, .max = SFX_COUNT }, // 9
|
|
73
|
+ { .name = "cl score", .flag = DBG_NONE, .max = 1 }, // 10
|
|
74
|
+ { .name = "0 scores", .flag = DBG_NONE, .max = 1 }, // 11
|
70
|
75
|
};
|
71
|
76
|
|
72
|
|
-static void list_scores(uint8_t is_black) NONBANKED {
|
|
77
|
+#define DEBUG_MENU_MUSIC_INDEX (DEBUG_ENTRY_COUNT - 4)
|
|
78
|
+#define DEBUG_MENU_SFX_INDEX (DEBUG_ENTRY_COUNT - 3)
|
|
79
|
+#define DEBUG_MENU_CLEAR_INDEX (DEBUG_ENTRY_COUNT - 2)
|
|
80
|
+#define DEBUG_MENU_ZERO_INDEX (DEBUG_ENTRY_COUNT - 1)
|
|
81
|
+
|
|
82
|
+static void list_scores(uint8_t is_black) {
|
73
|
83
|
for (uint8_t i = 0; i < SCORE_NUM; i++) {
|
74
|
84
|
struct scores score;
|
75
|
85
|
is_black ? score_lowest(i, &score) : score_highest(i, &score);
|
|
@@ -77,7 +87,7 @@ static void list_scores(uint8_t is_black) NONBANKED {
|
77
|
87
|
}
|
78
|
88
|
}
|
79
|
89
|
|
80
|
|
-static void highscore(uint8_t is_black) NONBANKED {
|
|
90
|
+static void highscore(uint8_t is_black) {
|
81
|
91
|
HIDE_WIN;
|
82
|
92
|
|
83
|
93
|
move_win(MINWNDPOSX, MINWNDPOSY);
|
|
@@ -118,7 +128,7 @@ static void highscore(uint8_t is_black) NONBANKED {
|
118
|
128
|
}
|
119
|
129
|
}
|
120
|
130
|
|
121
|
|
-static void about_screen(void) NONBANKED {
|
|
131
|
+static void about_screen(void) {
|
122
|
132
|
HIDE_WIN;
|
123
|
133
|
|
124
|
134
|
move_win(MINWNDPOSX, MINWNDPOSY);
|
|
@@ -144,7 +154,7 @@ static void about_screen(void) NONBANKED {
|
144
|
154
|
}
|
145
|
155
|
}
|
146
|
156
|
|
147
|
|
-static void conf_screen(void) NONBANKED {
|
|
157
|
+static void conf_screen(void) {
|
148
|
158
|
HIDE_WIN;
|
149
|
159
|
|
150
|
160
|
debug_menu_index = 0;
|
|
@@ -176,24 +186,20 @@ static void conf_screen(void) NONBANKED {
|
176
|
186
|
}
|
177
|
187
|
win_conf();
|
178
|
188
|
} else if (key_pressed(J_LEFT)) {
|
179
|
|
- START_ROM_BANK(BANK(main)) {
|
180
|
|
- if (*conf_entries[debug_menu_index].var > 0) {
|
181
|
|
- (*conf_entries[debug_menu_index].var)--;
|
182
|
|
- } else {
|
183
|
|
- *conf_entries[debug_menu_index].var = conf_entries[debug_menu_index].max;
|
184
|
|
- }
|
185
|
|
- conf_write_crc();
|
186
|
|
- } END_ROM_BANK
|
|
189
|
+ if (*conf_entries[debug_menu_index].var > 0) {
|
|
190
|
+ (*conf_entries[debug_menu_index].var)--;
|
|
191
|
+ } else {
|
|
192
|
+ *conf_entries[debug_menu_index].var = conf_entries[debug_menu_index].max;
|
|
193
|
+ }
|
|
194
|
+ conf_write_crc();
|
187
|
195
|
win_conf();
|
188
|
196
|
} else if (key_pressed(J_RIGHT)) {
|
189
|
|
- START_ROM_BANK(BANK(main)) {
|
190
|
|
- if (*conf_entries[debug_menu_index].var < conf_entries[debug_menu_index].max) {
|
191
|
|
- (*conf_entries[debug_menu_index].var)++;
|
192
|
|
- } else {
|
193
|
|
- *conf_entries[debug_menu_index].var = 0;
|
194
|
|
- }
|
195
|
|
- conf_write_crc();
|
196
|
|
- } END_ROM_BANK
|
|
197
|
+ if (*conf_entries[debug_menu_index].var < conf_entries[debug_menu_index].max) {
|
|
198
|
+ (*conf_entries[debug_menu_index].var)++;
|
|
199
|
+ } else {
|
|
200
|
+ *conf_entries[debug_menu_index].var = 0;
|
|
201
|
+ }
|
|
202
|
+ conf_write_crc();
|
197
|
203
|
win_conf();
|
198
|
204
|
} else if (key_pressed(J_A) || key_pressed(J_B) || key_pressed(J_START)) {
|
199
|
205
|
break;
|
|
@@ -205,7 +211,7 @@ static void conf_screen(void) NONBANKED {
|
205
|
211
|
debug_menu_index = 0;
|
206
|
212
|
}
|
207
|
213
|
|
208
|
|
-static void splash_win(void) NONBANKED {
|
|
214
|
+static void splash_win(void) {
|
209
|
215
|
HIDE_WIN;
|
210
|
216
|
|
211
|
217
|
if (conf_get()->debug_flags & DBG_MENU) {
|
|
@@ -309,7 +315,7 @@ static void splash_anim(uint8_t *hiwater) NONBANKED {
|
309
|
315
|
}
|
310
|
316
|
}
|
311
|
317
|
|
312
|
|
-static void splash(void) NONBANKED {
|
|
318
|
+void splash(void) BANKED {
|
313
|
319
|
snd_music_off();
|
314
|
320
|
snd_note_off();
|
315
|
321
|
|
|
@@ -368,20 +374,6 @@ static void splash(void) NONBANKED {
|
368
|
374
|
}
|
369
|
375
|
} else {
|
370
|
376
|
if (conf_get()->debug_flags & DBG_MENU) {
|
371
|
|
- // do it here so you quickly see the flag going to 1 and back to 0
|
372
|
|
- if (conf_get()->debug_flags & DBG_CLEAR_SCORE) {
|
373
|
|
- score_reset();
|
374
|
|
- conf_get()->debug_flags &= ~DBG_CLEAR_SCORE;
|
375
|
|
- conf_write_crc();
|
376
|
|
- splash_win();
|
377
|
|
- }
|
378
|
|
- if (conf_get()->debug_flags & DBG_ZERO_SCORE) {
|
379
|
|
- score_zero();
|
380
|
|
- conf_get()->debug_flags &= ~DBG_ZERO_SCORE;
|
381
|
|
- conf_write_crc();
|
382
|
|
- splash_win();
|
383
|
|
- }
|
384
|
|
-
|
385
|
377
|
uint8_t switch_special = 0;
|
386
|
378
|
|
387
|
379
|
if (key_pressed(J_UP)) {
|
|
@@ -405,49 +397,43 @@ static void splash(void) NONBANKED {
|
405
|
397
|
snd_note_off();
|
406
|
398
|
splash_win();
|
407
|
399
|
} else if (key_pressed(J_LEFT)) {
|
408
|
|
- START_ROM_BANK(BANK(main)) {
|
409
|
|
- if (debug_entries[debug_menu_index].flag != DBG_NONE) {
|
410
|
|
- conf_get()->debug_flags ^= debug_entries[debug_menu_index].flag;
|
411
|
|
- conf_write_crc();
|
|
400
|
+ if (debug_entries[debug_menu_index].flag != DBG_NONE) {
|
|
401
|
+ conf_get()->debug_flags ^= debug_entries[debug_menu_index].flag;
|
|
402
|
+ conf_write_crc();
|
|
403
|
+ } else {
|
|
404
|
+ if (debug_special_value > 0) {
|
|
405
|
+ debug_special_value--;
|
412
|
406
|
} else {
|
413
|
|
- if (debug_special_value > 0) {
|
414
|
|
- debug_special_value--;
|
415
|
|
- } else {
|
416
|
|
- debug_special_value = debug_entries[debug_menu_index].max;
|
417
|
|
- }
|
418
|
|
- switch_special = 1;
|
|
407
|
+ debug_special_value = debug_entries[debug_menu_index].max;
|
419
|
408
|
}
|
420
|
|
- } END_ROM_BANK
|
|
409
|
+ switch_special = 1;
|
|
410
|
+ }
|
421
|
411
|
splash_win();
|
422
|
412
|
} else if (key_pressed(J_RIGHT)) {
|
423
|
|
- START_ROM_BANK(BANK(main)) {
|
424
|
|
- if (debug_entries[debug_menu_index].flag != DBG_NONE) {
|
425
|
|
- conf_get()->debug_flags ^= debug_entries[debug_menu_index].flag;
|
426
|
|
- conf_write_crc();
|
|
413
|
+ if (debug_entries[debug_menu_index].flag != DBG_NONE) {
|
|
414
|
+ conf_get()->debug_flags ^= debug_entries[debug_menu_index].flag;
|
|
415
|
+ conf_write_crc();
|
|
416
|
+ } else {
|
|
417
|
+ if (debug_special_value < debug_entries[debug_menu_index].max) {
|
|
418
|
+ debug_special_value++;
|
427
|
419
|
} else {
|
428
|
|
- if (debug_special_value < debug_entries[debug_menu_index].max) {
|
429
|
|
- debug_special_value++;
|
430
|
|
- } else {
|
431
|
|
- debug_special_value = 0;
|
432
|
|
- }
|
433
|
|
- switch_special = 1;
|
|
420
|
+ debug_special_value = 0;
|
434
|
421
|
}
|
435
|
|
- } END_ROM_BANK
|
|
422
|
+ switch_special = 1;
|
|
423
|
+ }
|
436
|
424
|
splash_win();
|
437
|
425
|
} else if (key_pressed(J_A)) {
|
438
|
|
- START_ROM_BANK(BANK(main)) {
|
439
|
|
- if (debug_entries[debug_menu_index].flag != DBG_NONE) {
|
440
|
|
- conf_get()->debug_flags ^= debug_entries[debug_menu_index].flag;
|
441
|
|
- conf_write_crc();
|
|
426
|
+ if (debug_entries[debug_menu_index].flag != DBG_NONE) {
|
|
427
|
+ conf_get()->debug_flags ^= debug_entries[debug_menu_index].flag;
|
|
428
|
+ conf_write_crc();
|
|
429
|
+ } else {
|
|
430
|
+ if (debug_special_value < debug_entries[debug_menu_index].max) {
|
|
431
|
+ debug_special_value++;
|
442
|
432
|
} else {
|
443
|
|
- if (debug_special_value < debug_entries[debug_menu_index].max) {
|
444
|
|
- debug_special_value++;
|
445
|
|
- } else {
|
446
|
|
- debug_special_value = 0;
|
447
|
|
- }
|
448
|
|
- switch_special = 1;
|
|
433
|
+ debug_special_value = 0;
|
449
|
434
|
}
|
450
|
|
- } END_ROM_BANK
|
|
435
|
+ switch_special = 1;
|
|
436
|
+ }
|
451
|
437
|
splash_win();
|
452
|
438
|
} else if (key_pressed(J_B)) {
|
453
|
439
|
conf_get()->debug_flags &= ~DBG_MENU;
|
|
@@ -457,16 +443,29 @@ static void splash(void) NONBANKED {
|
457
|
443
|
snd_music(SND_MENU);
|
458
|
444
|
}
|
459
|
445
|
|
460
|
|
- if (switch_special && (debug_menu_index == 5)) {
|
|
446
|
+ if (switch_special && (debug_menu_index == DEBUG_MENU_MUSIC_INDEX)) {
|
461
|
447
|
snd_music_off();
|
462
|
448
|
if (debug_special_value > 0) {
|
463
|
449
|
snd_music(debug_special_value - 1);
|
464
|
450
|
}
|
465
|
451
|
snd_note_off();
|
466
|
|
- } else if ((switch_special || (!sample_running())) && (debug_menu_index == 6)) {
|
|
452
|
+ } else if ((switch_special || (!sample_running()))
|
|
453
|
+ && (debug_menu_index == DEBUG_MENU_SFX_INDEX)) {
|
467
|
454
|
if (debug_special_value > 0) {
|
468
|
455
|
sample_play(debug_special_value - 1);
|
469
|
456
|
}
|
|
457
|
+ } else if (switch_special && debug_special_value
|
|
458
|
+ && (debug_menu_index == DEBUG_MENU_CLEAR_INDEX)) {
|
|
459
|
+ debug_special_value = 0;
|
|
460
|
+ score_reset();
|
|
461
|
+ conf_write_crc();
|
|
462
|
+ splash_win();
|
|
463
|
+ } else if (switch_special && debug_special_value
|
|
464
|
+ && (debug_menu_index == DEBUG_MENU_ZERO_INDEX)) {
|
|
465
|
+ debug_special_value = 0;
|
|
466
|
+ score_zero();
|
|
467
|
+ conf_write_crc();
|
|
468
|
+ splash_win();
|
470
|
469
|
}
|
471
|
470
|
}
|
472
|
471
|
}
|
|
@@ -498,7 +497,7 @@ static void splash(void) NONBANKED {
|
498
|
497
|
}
|
499
|
498
|
}
|
500
|
499
|
|
501
|
|
-static uint16_t ask_name(int32_t score) NONBANKED {
|
|
500
|
+uint16_t ask_name(int32_t score) BANKED {
|
502
|
501
|
snd_music_off();
|
503
|
502
|
snd_note_off();
|
504
|
503
|
|