From a553491adb07a01d0f22e6d530ed919f03cdef78 Mon Sep 17 00:00:00 2001 From: jordism Date: Thu, 23 Dec 2021 00:14:53 +0100 Subject: [PATCH] fix(realpacman) right sounds and game over map fix --- fx/effects.asm | 1 + globals.c | 3 +-- int.c | 14 ++++++++++++++ int.h | 1 + logic.c | 15 +++++---------- msnampac.c | 9 ++++----- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/fx/effects.asm b/fx/effects.asm index 37837bb..86ffc75 100644 --- a/fx/effects.asm +++ b/fx/effects.asm @@ -679,6 +679,7 @@ PUBLIC fxComeFruta PUBLIC fxComeFantasma PUBLIC fxOjosACasa PUBLIC fxMuerte +; es una música que se pone cuando llevas mucho tiempo en el nivel y no acabas de comer todas las bolas PUBLIC fxTinTin PUBLIC fxSirena1 PUBLIC fxSirena2 diff --git a/globals.c b/globals.c index f6dce3a..8565e08 100644 --- a/globals.c +++ b/globals.c @@ -90,7 +90,6 @@ uint8_t map3[25][32] = { }; uint8_t * currentmap; -// todo puntero al mapa actual, posiciones diferentes para el mapa // 15 @@ -118,7 +117,7 @@ uint8_t row; uint8_t col; uint8_t current; uint16_t points = 0; -uint8_t remaining_points = MAP1_TOTAL_POINTS; +uint8_t remaining_points; uint8_t frame = 0; diff --git a/int.c b/int.c index 478e00d..bcdce6a 100644 --- a/int.c +++ b/int.c @@ -168,6 +168,20 @@ __asm __endasm; } +void sonido3InsertCoin() { +__asm + extern fxInsert_coin + extern Load_Fx + extern enable_bank_6 + extern restore_bank_0 + ;ld a, 6 + call enable_bank_6 + ld a, 3 + ld hl, fxInsert_coin + call Load_Fx + call restore_bank_0 +__endasm; +} void sonido13ComeGhost() { __asm diff --git a/int.h b/int.h index fbbd616..9df6eba 100644 --- a/int.h +++ b/int.h @@ -39,5 +39,6 @@ extern void stopCanal3(); extern void stopCanal2(); extern void incSiren(); extern void resetSiren(); +extern inline void sonido3InsertCoin(); #endif diff --git a/logic.c b/logic.c index 480d940..bd911eb 100644 --- a/logic.c +++ b/logic.c @@ -580,8 +580,8 @@ void move_ghosts() { void next_level() { - // todo sound for next leevel resetSiren(); + sonido3InsertCoin(); ++level; // helps determining scatter mode changes and some others slowticker = 0; @@ -593,18 +593,13 @@ void next_level() { if(map_num == 1) { remaining_points = MAP1_TOTAL_POINTS; + currentmap = &map[0][0]; } else if(map_num == 2){ + // se pone este al morir remaining_points = MAP2_TOTAL_POINTS; - } else if(map_num == 3){ - remaining_points = MAP3_TOTAL_POINTS; - } - - - if(map_num == 1) { - currentmap = &map[0][0]; - } else if(map_num == 2) { currentmap = &map2[0][0]; - } else { + } else if(map_num == 3) { + remaining_points = MAP3_TOTAL_POINTS; currentmap = &map3[0][0]; } diff --git a/msnampac.c b/msnampac.c index 64db38b..0d43217 100644 --- a/msnampac.c +++ b/msnampac.c @@ -55,11 +55,14 @@ void all_lives_lost() { zx_border(INK_BLACK); sp1_Invalidate(&full_screen); + currentmap = &map[0][0]; lives = 5; points = 0; level = 0; map_num = 1; repaint_lives = 1; + reached_level = 0; + resetSiren(); @@ -104,11 +107,9 @@ void all_lives_lost() { } srand(tick); - + remaining_points = MAP1_TOTAL_POINTS; nampac_go_home(); - reset_map(); - set_ghosts_default_coords(); all_ghosts_go_home(); start_ay(); @@ -120,7 +121,6 @@ void all_lives_lost() { hide_billboard(); sonido2Sirena(); pick = 1; - reached_level = 0; slowticker = 0; } @@ -133,7 +133,6 @@ int main() pacman.alt = add_dead_prota_sprite(); pacman.offset = 1; pacman.currentoffset = 1; - currentmap = &map[0][0]; points_sp = add_points_sprite(); billboard = add_billboard_sprite();