Import blues from 235e98f2

This commit is contained in:
Gregory Montoir 2022-02-27 07:27:01 +08:00
parent e64c374752
commit a8950f5beb
7 changed files with 173 additions and 51 deletions

View File

@ -79,12 +79,12 @@ static void do_credits() {
g_sys.update_screen(g_res.vga, 1); g_sys.update_screen(g_res.vga, 1);
} }
static void update_screen_img(const uint8_t *src) { static void update_screen_img(const uint8_t *src, int present) {
const int size = GAME_SCREEN_W * GAME_SCREEN_H; const int size = GAME_SCREEN_W * GAME_SCREEN_H;
if (size < 64000) { if (size < 64000) {
return; return;
} else if (size == 64000) { } else if (size == 64000) {
g_sys.update_screen(src, 0); g_sys.update_screen(src, present);
} else { } else {
memset(g_res.vga, 0, size); memset(g_res.vga, 0, size);
const int y_offs = (GAME_SCREEN_H - 200) / 2; const int y_offs = (GAME_SCREEN_H - 200) / 2;
@ -92,7 +92,7 @@ static void update_screen_img(const uint8_t *src) {
for (int y = 0; y < 200; ++y) { for (int y = 0; y < 200; ++y) {
memcpy(g_res.vga + (y_offs + y) * GAME_SCREEN_W + x_offs, src + y * 320, 320); memcpy(g_res.vga + (y_offs + y) * GAME_SCREEN_W + x_offs, src + y * 320, 320);
} }
g_sys.update_screen(g_res.vga, 0); g_sys.update_screen(g_res.vga, present);
} }
} }
@ -100,7 +100,7 @@ static void do_titus_screen() {
uint8_t *data = load_file("TITUS.SQZ"); uint8_t *data = load_file("TITUS.SQZ");
if (data) { if (data) {
g_sys.set_screen_palette(data, 0, 256, 6); g_sys.set_screen_palette(data, 0, 256, 6);
update_screen_img(data + 768); update_screen_img(data + 768, 0);
g_sys.fade_in_palette(); g_sys.fade_in_palette();
wait_input(70); wait_input(70);
g_sys.fade_out_palette(); g_sys.fade_out_palette();
@ -108,13 +108,48 @@ static void do_titus_screen() {
} }
} }
static bool fade_palettes(const uint8_t *target, uint8_t *current) {
bool flag = false;
for (int i = 0; i < 768; ++i) {
int al = current[i];
const int bh = target[i] - al;
if (bh != 0) {
if (abs(bh) < 2) {
flag = true;
al = target[i];
} else {
if (target[i] < al) {
al -= 2;
} else {
al += 2;
}
}
current[i] = al;
}
}
return flag;
}
static void do_present_screen() { static void do_present_screen() {
uint8_t *data = load_file("PRESENT.SQZ"); uint8_t *data = load_file("PRESENT.SQZ");
if (data) { if (data) {
if (g_uncompressed_size == 65536 + 768) { /* demo version */
g_sys.set_screen_palette(data, 0, 256, 6); g_sys.set_screen_palette(data, 0, 256, 6);
update_screen_img(data + 768); update_screen_img(data + 768, 0);
g_sys.fade_in_palette(); g_sys.fade_in_palette();
wait_input(700); } else {
memmove(data + 768, data + 0x1030 * 16, 93 * 320);
g_sys.set_screen_palette(data, 0, 256, 6);
update_screen_img(data + 768, 0);
g_sys.fade_in_palette();
uint8_t palette[256 * 3];
memcpy(palette, data, 256 * 3);
while (fade_palettes(present_palette_data, palette) && !g_sys.input.quit) {
g_sys.set_screen_palette(palette, 0, 256, 6);
update_screen_img(data + 768, 1);
wait_input(10);
}
}
g_sys.fade_out_palette(); g_sys.fade_out_palette();
free(data); free(data);
} }
@ -131,7 +166,7 @@ static void do_demo_screen() {
if (data) { if (data) {
video_copy_img(data); video_copy_img(data);
g_sys.set_screen_palette(joystick_palette_data, 0, 16, 6); g_sys.set_screen_palette(joystick_palette_data, 0, 16, 6);
update_screen_img(g_res.background); update_screen_img(g_res.background, 0);
g_sys.fade_in_palette(); g_sys.fade_in_palette();
free(data); free(data);
wait_input(1000); wait_input(1000);
@ -142,7 +177,7 @@ static void do_castle_screen() {
uint8_t *data = load_file("CASTLE.SQZ"); uint8_t *data = load_file("CASTLE.SQZ");
if (data) { if (data) {
g_sys.set_screen_palette(data, 0, 256, 6); g_sys.set_screen_palette(data, 0, 256, 6);
update_screen_img(data + 768); update_screen_img(data + 768, 0);
g_sys.fade_in_palette(); g_sys.fade_in_palette();
free(data); free(data);
wait_input(1000); wait_input(1000);
@ -153,7 +188,7 @@ static void do_menu() {
uint8_t *data = load_file("MENU.SQZ"); uint8_t *data = load_file("MENU.SQZ");
if (data) { if (data) {
g_sys.set_screen_palette(data, 0, 256, 6); g_sys.set_screen_palette(data, 0, 256, 6);
update_screen_img(data + 768); update_screen_img(data + 768, 0);
g_sys.fade_in_palette(); g_sys.fade_in_palette();
free(data); free(data);
memset(g_vars.input.keystate, 0, sizeof(g_vars.input.keystate)); memset(g_vars.input.keystate, 0, sizeof(g_vars.input.keystate));
@ -193,7 +228,7 @@ void do_theend_screen() {
uint8_t *data = load_file("THEEND.SQZ"); uint8_t *data = load_file("THEEND.SQZ");
if (data) { if (data) {
g_sys.set_screen_palette(data, 0, 256, 6); g_sys.set_screen_palette(data, 0, 256, 6);
update_screen_img(data + 768); update_screen_img(data + 768, 0);
g_sys.fade_in_palette(); g_sys.fade_in_palette();
free(data); free(data);
wait_input(1000); wait_input(1000);
@ -278,9 +313,10 @@ static void game_run(const char *data_path) {
do_demo_screen(); do_demo_screen();
} }
do_menu(); do_menu();
if (g_sys.input.quit) if (g_sys.input.quit) {
break; break;
} }
}
uint8_t level_num; uint8_t level_num;
do { do {
level_num = g_vars.level_num; level_num = g_vars.level_num;

View File

@ -285,6 +285,8 @@ extern struct vars_t g_vars;
extern const uint8_t *palettes_tbl[16]; extern const uint8_t *palettes_tbl[16];
extern const uint8_t credits_palette_data[16 * 3]; extern const uint8_t credits_palette_data[16 * 3];
extern const uint8_t light_palette_data[16 * 3]; extern const uint8_t light_palette_data[16 * 3];
extern const uint8_t present_palette_data[256 * 3];
extern const uint8_t menu_palette_data[16 * 3];
extern const uint8_t spr_offs_tbl[922]; extern const uint8_t spr_offs_tbl[922];
extern const uint8_t spr_size_tbl[922]; extern const uint8_t spr_size_tbl[922];
extern const uint16_t score_tbl[17]; extern const uint16_t score_tbl[17];

View File

@ -671,12 +671,12 @@ static void level_init_object_hit_from_xy_pos(int16_t x_pos, int16_t y_pos) {
g_vars.current_hit_object = obj; g_vars.current_hit_object = obj;
} }
static void level_update_tile_type_2() { static void level_update_tile_type_2(bool tile_flag) {
if (g_vars.level_num == 14) { if (g_vars.level_num == 14) {
g_vars.player_death_flag = 0xFF; g_vars.player_death_flag = 0xFF;
return; return;
} }
if (g_options.cheats & CHEATS_NO_HIT) { if (tile_flag && (g_options.cheats & CHEATS_NO_HIT) != 0) {
return; return;
} }
level_player_die(); level_player_die();
@ -866,7 +866,7 @@ static void level_update_tile0(uint16_t offset) {
break; break;
case 6: case 6:
/* spikes */ /* spikes */
level_update_tile_type_2(); level_update_tile_type_2(1);
break; break;
default: default:
print_warning("Unhandled level_update_tile0 attr1 %d", attr1); print_warning("Unhandled level_update_tile0 attr1 %d", attr1);
@ -888,7 +888,7 @@ static void level_update_tile0(uint16_t offset) {
level_update_tile_attr2_type1(); level_update_tile_attr2_type1();
break; break;
case 2: case 2:
level_update_tile_type_2(); level_update_tile_type_2(1);
break; break;
default: default:
print_warning("Unhandled level_update_tile0 attr2 %d", al); print_warning("Unhandled level_update_tile0 attr2 %d", al);
@ -948,7 +948,7 @@ static void level_update_tile1(uint16_t offset) {
level_update_tile_type_1(offset); level_update_tile_type_1(offset);
break; break;
case 2: case 2:
level_update_tile_type_2(); level_update_tile_type_2(1);
break; break;
default: default:
print_warning("Unhandled level_update_tile1 type %d", type); print_warning("Unhandled level_update_tile1 type %d", type);
@ -962,7 +962,7 @@ static void level_update_tile2(uint16_t offset) {
if (type == 2 || type == 4) { if (type == 2 || type == 4) {
switch (type) { switch (type) {
case 2: case 2:
level_update_tile_type_2(); level_update_tile_type_2(1);
break; break;
default: default:
print_warning("Unhandled level_update_tile2 type %d", type); print_warning("Unhandled level_update_tile2 type %d", type);
@ -991,6 +991,8 @@ static void level_reset() {
g_vars.level_completed_flag = 0; g_vars.level_completed_flag = 0;
g_vars.light.palette_flag1 = 0; g_vars.light.palette_flag1 = 0;
g_vars.light.palette_flag2 = 0; g_vars.light.palette_flag2 = 0;
g_vars.player_flying_flag = 0;
g_vars.player_gravity_flag = 0;
g_vars.objects_tbl[1].data.p.special_anim_num = 0; g_vars.objects_tbl[1].data.p.special_anim_num = 0;
g_vars.tilemap.prev_x = _undefined; g_vars.tilemap.prev_x = _undefined;
@ -1422,7 +1424,7 @@ static void level_update_objects_axe() {
static int level_get_tile_monster_offset(uint8_t tile_num, struct object_t *obj) { static int level_get_tile_monster_offset(uint8_t tile_num, struct object_t *obj) {
const uint8_t attr = g_res.level.tile_attributes1[tile_num]; const uint8_t attr = g_res.level.tile_attributes3[tile_num];
if ((attr & 0x30) == 0) { if ((attr & 0x30) == 0) {
return attr; return attr;
} }
@ -1459,7 +1461,7 @@ static void level_update_monster_pos(struct object_t *obj, struct level_monster_
if (m->flags & 0x40) { if (m->flags & 0x40) {
monster_change_next_anim(obj); monster_change_next_anim(obj);
m->flags |= 0x80; m->flags |= 0x80;
obj->data.m.y_velocity &= ~15; obj->data.m.y_velocity = -16;
obj->x_pos += obj->data.m.x_velocity >> 2; obj->x_pos += obj->data.m.x_velocity >> 2;
return; return;
} }
@ -2185,17 +2187,9 @@ static void level_update_player_anim_1(uint8_t al) {
level_update_object_anim(p); level_update_object_anim(p);
} }
static void level_update_player_anim_2(uint8_t al) { static void level_update_player_anim_2_helper(uint8_t al) {
if (g_vars.player_anim_0x40_flag != 0) {
level_update_player_anim_3_6_7(g_vars.objects_tbl[1].data.p.current_anim_num);
return;
}
if (g_vars.player_nojump_counter != 0) {
level_update_player_anim_0(al);
return;
}
g_vars.level_force_x_scroll_flag = 0; g_vars.level_force_x_scroll_flag = 0;
uint8_t value = g_vars.player_anim2_counter; const uint8_t value = g_vars.player_anim2_counter;
++g_vars.player_anim2_counter; ++g_vars.player_anim2_counter;
if (value < 9) { if (value < 9) {
static const int8_t y_tbl[] = { -65, -51, -35, -20, -10, -5, -2, -1, 0 }; static const int8_t y_tbl[] = { -65, -51, -35, -20, -10, -5, -2, -1, 0 };
@ -2218,6 +2212,16 @@ static void level_update_player_anim_2(uint8_t al) {
level_update_screen_x_velocity(); level_update_screen_x_velocity();
} }
static void level_update_player_anim_2(uint8_t al) {
if (g_vars.player_anim_0x40_flag != 0) {
level_update_player_anim_3_6_7(g_vars.objects_tbl[1].data.p.current_anim_num);
} else if (g_vars.player_nojump_counter != 0) {
level_update_player_anim_0(al);
} else {
level_update_player_anim_2_helper(al);
}
}
static void level_update_player_club_power() { static void level_update_player_club_power() {
if (g_vars.player_club_powerup_duration <= 48) { if (g_vars.player_club_powerup_duration <= 48) {
g_vars.player_club_powerup_duration += 2; g_vars.player_club_powerup_duration += 2;
@ -2263,6 +2267,19 @@ static void level_update_player_anim_8(uint8_t al) {
level_update_object_anim(p); level_update_object_anim(p);
} }
static void level_update_player_anim_34(uint8_t al) {
if (g_vars.player_unk_counter1 < 24) {
level_update_player_anim_2_helper(al);
} else {
g_vars.player_gravity_flag = 1;
g_vars.player_flying_counter = 24;
g_vars.objects_tbl[1].y_pos -= 3;
g_vars.player_unk_counter1 = 0;
level_update_screen_x_velocity();
level_update_screen_x_velocity();
}
}
static void level_update_player_decor() { static void level_update_player_decor() {
const int y_pos = (g_vars.objects_tbl[1].y_pos >> 4) - 1; const int y_pos = (g_vars.objects_tbl[1].y_pos >> 4) - 1;
const int spr_num = g_vars.objects_tbl[1].spr_num & 0x1FFF; const int spr_num = g_vars.objects_tbl[1].spr_num & 0x1FFF;
@ -2276,15 +2293,15 @@ static void level_update_player_decor() {
const int x_pos = g_vars.objects_tbl[1].x_pos >> 4; const int x_pos = g_vars.objects_tbl[1].x_pos >> 4;
const int player_ypos_diff = abs((g_vars.objects_tbl[1].y_pos >> 4) - g_vars.tilemap.y); const int player_ypos_diff = abs((g_vars.objects_tbl[1].y_pos >> 4) - g_vars.tilemap.y);
if (player_ypos_diff > (TILEMAP_SCREEN_H / 16)) { if (player_ypos_diff > (TILEMAP_SCREEN_H / 16)) {
level_update_tile_type_2(); level_update_tile_type_2(0);
} else { } else {
const int player_xpos_diff = abs((g_vars.objects_tbl[1].x_pos >> 4) - g_vars.tilemap.x); const int player_xpos_diff = abs((g_vars.objects_tbl[1].x_pos >> 4) - g_vars.tilemap.x);
if (player_xpos_diff > (TILEMAP_SCREEN_W / 16)) { if (player_xpos_diff > (TILEMAP_SCREEN_W / 16)) {
level_update_tile_type_2(); level_update_tile_type_2(0);
} else if ((g_res.level.scrolling_mask & 4) != 0 && g_vars.objects_tbl[1].y_pos < (g_vars.tilemap.y << 4)) { } else if ((g_res.level.scrolling_mask & 4) != 0 && g_vars.objects_tbl[1].y_pos < (g_vars.tilemap.y << 4)) {
level_update_tile_type_2(); level_update_tile_type_2(0);
} else if (g_vars.objects_tbl[1].y_pos >= 0 && g_vars.objects_tbl[1].y_pos > ((g_vars.tilemap.h + 1) << 4)) { } else if (g_vars.objects_tbl[1].y_pos >= 0 && g_vars.objects_tbl[1].y_pos > ((g_vars.tilemap.h + 1) << 4)) {
level_update_tile_type_2(); level_update_tile_type_2(0);
} }
} }
g_vars.player_tile_flags = 0; g_vars.player_tile_flags = 0;
@ -2325,7 +2342,6 @@ static void level_update_player_flying() {
return; return;
} }
if (g_vars.player_gravity_flag != 0) { if (g_vars.player_gravity_flag != 0) {
g_vars.objects_tbl[1].spr_num &= 0x8000;
const int x_vel = abs(g_vars.objects_tbl[1].x_velocity); const int x_vel = abs(g_vars.objects_tbl[1].x_velocity);
int num = 48; int num = 48;
if (x_vel < 64) { if (x_vel < 64) {
@ -2337,7 +2353,7 @@ static void level_update_player_flying() {
if (g_vars.player_flying_anim_index < 3) { if (g_vars.player_flying_anim_index < 3) {
num = 51 - g_vars.player_flying_anim_index; num = 51 - g_vars.player_flying_anim_index;
} }
g_vars.objects_tbl[1].spr_num |= num; g_vars.objects_tbl[1].spr_num = (g_vars.objects_tbl[1].spr_num & 0x8000) | num;
} }
const uint8_t *p = &player_flying_anim_data[14]; const uint8_t *p = &player_flying_anim_data[14];
if ((g_vars.input.key_up | g_vars.input.key_down) == 0 && g_vars.player_flying_anim_index != 3) { if ((g_vars.input.key_up | g_vars.input.key_down) == 0 && g_vars.player_flying_anim_index != 3) {
@ -2365,8 +2381,8 @@ static void level_update_player_flying() {
++spr_num; ++spr_num;
} }
g_vars.objects_tbl[0].spr_num = spr_num; g_vars.objects_tbl[0].spr_num = spr_num;
g_vars.objects_tbl[0].x_pos += x_delta; g_vars.objects_tbl[0].x_pos = g_vars.objects_tbl[1].x_pos + x_delta;
g_vars.objects_tbl[0].y_pos += (int8_t)p[5]; g_vars.objects_tbl[0].y_pos = g_vars.objects_tbl[1].y_pos + (int8_t)p[5];
break; break;
} }
} }
@ -2453,8 +2469,8 @@ static void level_update_player() {
++g_vars.player_update_counter; ++g_vars.player_update_counter;
} }
if (g_vars.player_flying_flag != 0) { if (g_vars.player_flying_flag != 0) {
mask += 0x40; al += 0x20;
if ((g_vars.player_flying_flag &= 1) != 0) { if ((g_vars.player_gravity_flag &= 1) != 0) {
if (g_vars.input.key_up) { if (g_vars.input.key_up) {
if (g_vars.player_flying_anim_index == 6) { if (g_vars.player_flying_anim_index == 6) {
if (g_vars.objects_tbl[1].data.p.y_velocity > 16) { if (g_vars.objects_tbl[1].data.p.y_velocity > 16) {
@ -2491,7 +2507,7 @@ static void level_update_player() {
} }
} else { } else {
if (g_vars.objects_tbl[1].data.p.y_velocity > 160) { if (g_vars.objects_tbl[1].data.p.y_velocity > 160) {
g_vars.player_flying_flag = 1; g_vars.player_gravity_flag = 1;
} }
} }
} }
@ -2519,6 +2535,20 @@ static void level_update_player() {
case 8: case 8:
level_update_player_anim_8(al); level_update_player_anim_8(al);
break; break;
case 32:
case 35:
case 36:
case 37:
case 38:
case 39:
level_update_player_anim_5(al);
break;
case 33:
level_update_player_anim_1(al);
break;
case 34:
level_update_player_anim_34(al);
break;
default: default:
print_warning("Unhandled anim_lut %d mask %d", al, mask); print_warning("Unhandled anim_lut %d mask %d", al, mask);
break; break;

View File

@ -176,7 +176,7 @@ static void monster_func1_type3(struct object_t *obj) {
} else if (state == 1) { } else if (state == 1) {
monster_add_orb(m, 0, obj->y_pos - m->y_pos); monster_add_orb(m, 0, obj->y_pos - m->y_pos);
const uint16_t pos = ((obj->y_pos >> 4) << 8) | (obj->x_pos >> 4); const uint16_t pos = ((obj->y_pos >> 4) << 8) | (obj->x_pos >> 4);
const uint8_t tile_num = g_res.leveldat[pos]; const uint8_t tile_num = level_get_tile(pos);
if (g_res.level.tile_attributes1[tile_num] == 0) { if (g_res.level.tile_attributes1[tile_num] == 0) {
return; return;
} }
@ -184,8 +184,7 @@ static void monster_func1_type3(struct object_t *obj) {
obj->data.m.y_velocity = 0; obj->data.m.y_velocity = 0;
obj->data.m.state = 2; obj->data.m.state = 2;
m->flags |= 0x48; m->flags |= 0x48;
const int dx = (g_vars.objects_tbl[1].x_pos >= obj->x_pos) ? 48 : -48; obj->data.m.x_velocity = (g_vars.objects_tbl[1].x_pos >= obj->x_pos) ? 48 : -48;
obj->data.m.x_velocity = dx;
monster_change_next_anim(obj); monster_change_next_anim(obj);
} else if (state == 2) { } else if (state == 2) {
if (obj->x_pos < 0) { if (obj->x_pos < 0) {
@ -777,15 +776,15 @@ static bool monster_func2_type10(struct level_monster_t *m) {
uint16_t pos = (bh << 8) | bl; uint16_t pos = (bh << 8) | bl;
for (int i = 0; i < 10 && pos >= 0x300; ++i, pos -= 0x100) { for (int i = 0; i < 10 && pos >= 0x300; ++i, pos -= 0x100) {
if (pos < (g_vars.tilemap.h << 8)) { if (pos < (g_vars.tilemap.h << 8)) {
const uint8_t tile_num0 = g_res.leveldat[pos]; const uint8_t tile_num0 = level_get_tile(pos);
if (g_res.level.tile_attributes1[tile_num0] == 0) { if (g_res.level.tile_attributes1[tile_num0] == 0) {
continue; continue;
} }
const uint8_t tile_num1 = g_res.leveldat[pos - 0x100]; const uint8_t tile_num1 = level_get_tile(pos - 0x100);
if (g_res.level.tile_attributes1[tile_num1] != 0) { if (g_res.level.tile_attributes1[tile_num1] != 0) {
continue; continue;
} }
const uint8_t tile_num2 = g_res.leveldat[pos - 0x200]; const uint8_t tile_num2 = level_get_tile(pos - 0x200);
if (g_res.level.tile_attributes1[tile_num2] == 0) { if (g_res.level.tile_attributes1[tile_num2] == 0) {
obj->y_pos = (pos >> 8) << 4; obj->y_pos = (pos >> 8) << 4;
obj->spr_num = m->spr_num; obj->spr_num = m->spr_num;

View File

@ -83,6 +83,61 @@ const uint8_t light_palette_data[] = {
0x0C,0x12,0x00,0x00,0x00,0x00,0x15,0x18,0x00,0x0C,0x0C,0x00,0x0F,0x0F,0x06,0x12, 0x0C,0x12,0x00,0x00,0x00,0x00,0x15,0x18,0x00,0x0C,0x0C,0x00,0x0F,0x0F,0x06,0x12,
0x12,0x00,0x09,0x0C,0x00,0x0C,0x12,0x00,0x0F,0x18,0x00,0x12,0x1B,0x0F,0x15,0x1B 0x12,0x00,0x09,0x0C,0x00,0x0C,0x12,0x00,0x0F,0x18,0x00,0x12,0x1B,0x0F,0x15,0x1B
}; };
const uint8_t present_palette_data[] = {
0x00,0x00,0x00,0x38,0x3F,0x2E,0x36,0x3A,0x24,0x35,0x35,0x1B,0x30,0x2A,0x14,0x2B,
0x1F,0x0D,0x26,0x14,0x08,0x21,0x0A,0x03,0x1C,0x00,0x00,0x06,0x00,0x00,0x28,0x1C,
0x14,0x0E,0x0C,0x0E,0x06,0x0A,0x0A,0x3A,0x12,0x20,0x3A,0x12,0x20,0x3A,0x12,0x20,
0x28,0x00,0x08,0x3C,0x2C,0x10,0x34,0x20,0x00,0x38,0x30,0x28,0x3C,0x34,0x20,0x3C,
0x38,0x28,0x3C,0x3C,0x30,0x2C,0x24,0x24,0x0C,0x10,0x04,0x10,0x18,0x08,0x14,0x20,
0x0C,0x1C,0x28,0x1C,0x20,0x2C,0x20,0x24,0x34,0x24,0x2C,0x3C,0x2C,0x30,0x2C,0x28,
0x00,0x00,0x00,0x3C,0x3C,0x3C,0x38,0x28,0x20,0x28,0x18,0x10,0x20,0x10,0x08,0x14,
0x10,0x14,0x18,0x00,0x00,0x18,0x14,0x18,0x18,0x18,0x1C,0x20,0x20,0x1C,0x24,0x1C,
0x1C,0x28,0x20,0x18,0x18,0x24,0x18,0x14,0x0C,0x14,0x38,0x38,0x38,0x28,0x28,0x28,
0x14,0x0C,0x14,0x1C,0x0C,0x14,0x2E,0x24,0x1E,0x32,0x28,0x20,0x35,0x2E,0x25,0x35,
0x2E,0x25,0x38,0x34,0x2C,0x14,0x0C,0x14,0x14,0x12,0x08,0x10,0x12,0x0A,0x00,0x00,
0x00,0x38,0x34,0x2C,0x18,0x0C,0x10,0x14,0x10,0x14,0x14,0x10,0x14,0x14,0x0C,0x14,
0x14,0x0C,0x14,0x14,0x10,0x14,0x00,0x0A,0x14,0x0E,0x06,0x10,0x06,0x00,0x00,0x06,
0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x06,0x00,
0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,
0x06,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x06,
0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,
0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,
0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,
0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x1C,0x00,
0x00,0x1C,0x00,0x00,0x1C,0x00,0x00,0x21,0x0A,0x03,0x21,0x09,0x03,0x21,0x09,0x03,
0x21,0x09,0x03,0x21,0x09,0x03,0x21,0x09,0x03,0x21,0x09,0x03,0x21,0x09,0x03,0x21,
0x09,0x03,0x21,0x09,0x03,0x21,0x09,0x03,0x21,0x09,0x03,0x21,0x09,0x03,0x21,0x09,
0x03,0x21,0x09,0x03,0x21,0x09,0x03,0x21,0x09,0x03,0x21,0x09,0x03,0x21,0x09,0x03,
0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,
0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,
0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,
0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x26,0x14,0x08,0x2B,0x1F,0x0D,0x2B,
0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,
0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,
0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,
0x1E,0x0D,0x2B,0x1E,0x0D,0x2B,0x1E,0x0D,0x30,0x2A,0x14,0x30,0x29,0x14,0x30,0x29,
0x14,0x30,0x29,0x14,0x30,0x29,0x14,0x30,0x29,0x14,0x30,0x29,0x14,0x30,0x29,0x14,
0x30,0x29,0x14,0x30,0x29,0x14,0x30,0x29,0x14,0x30,0x29,0x14,0x30,0x29,0x14,0x30,
0x29,0x14,0x30,0x29,0x14,0x30,0x29,0x14,0x30,0x29,0x14,0x30,0x29,0x14,0x30,0x29,
0x14,0x30,0x29,0x14,0x35,0x35,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,
0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,
0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,
0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,0x35,0x34,0x1B,
0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,
0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,
0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,
0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x36,0x3A,0x24,0x38,0x3F,0x2E,0x38,
0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,
0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,
0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x38,
0x3F,0x2E,0x38,0x3F,0x2E,0x38,0x3F,0x2E,0x3A,0x12,0x22,0x3A,0x12,0x22,0x3A,0x12,
0x22,0x3A,0x12,0x22,0x3A,0x12,0x22,0x3A,0x12,0x22,0x3A,0x12,0x22,0x3F,0x3F,0x3F
};
const uint8_t menu_palette_data[] = {
0x08,0x10,0x1C,0x00,0x04,0x04,0x0C,0x14,0x20,0x10,0x18,0x20,0x38,0x30,0x08,0x38,
0x30,0x08,0x38,0x30,0x08,0x38,0x30,0x08,0x34,0x20,0x14,0x34,0x20,0x14,0x34,0x20,
0x14,0x34,0x20,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
const uint8_t spr_offs_tbl[] = { const uint8_t spr_offs_tbl[] = {
0x14,0x24,0x10,0x23,0x0C,0x24,0x10,0x24,0x10,0x25,0x10,0x25,0x0F,0x24,0x10,0x23, 0x14,0x24,0x10,0x23,0x0C,0x24,0x10,0x24,0x10,0x25,0x10,0x25,0x0F,0x24,0x10,0x23,
0x0F,0x23,0x0F,0x23,0x0C,0x23,0x10,0x26,0x14,0x1F,0x18,0x1F,0x10,0x1F,0x10,0x24, 0x0F,0x23,0x0F,0x23,0x0C,0x23,0x10,0x26,0x14,0x1F,0x18,0x1F,0x10,0x1F,0x10,0x24,

1
sys.h
View File

@ -18,7 +18,6 @@
struct input_t { struct input_t {
uint8_t direction; uint8_t direction;
bool quit; bool quit;
bool escape;
bool space; bool space;
bool digit1, digit2, digit3; bool digit1, digit2, digit3;
}; };

View File

@ -381,7 +381,9 @@ static void handle_keyevent(int keysym, bool keydown, struct input_t *input) {
input->space = keydown; input->space = keydown;
break; break;
case SDLK_ESCAPE: case SDLK_ESCAPE:
input->escape = keydown; if (keydown) {
g_sys.input.quit = true;
}
break; break;
case SDLK_1: case SDLK_1:
input->digit1 = keydown; input->digit1 = keydown;
@ -436,7 +438,6 @@ static void handle_controllerbutton(int button, bool pressed, struct input_t *in
input->space = pressed; input->space = pressed;
break; break;
case SDL_CONTROLLER_BUTTON_BACK: case SDL_CONTROLLER_BUTTON_BACK:
input->escape = pressed;
break; break;
case SDL_CONTROLLER_BUTTON_START: case SDL_CONTROLLER_BUTTON_START:
break; break;