From 6e803bdd26fa5c09ab1921127f5e8dee78abb894 Mon Sep 17 00:00:00 2001 From: Andrew DeRosier Date: Tue, 15 Sep 2020 00:47:49 -0400 Subject: [PATCH] SFX bug --- src/ai/endgame.c | 13 ++++--------- src/audio.c | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/ai/endgame.c b/src/ai/endgame.c index 681fc7fc..1672800f 100644 --- a/src/ai/endgame.c +++ b/src/ai/endgame.c @@ -447,7 +447,7 @@ static const struct { { OBJ_CURLY, 1, 0, RIGHT, FALSE, }, { OBJ_MISERY_STAND, 0, 2, LEFT, FALSE, }, { OBJ_MALCO_BROKEN, 7, 6, LEFT, TRUE, }, - { OBJ_HERMIT_GUNSMITH, 2, 1, LEFT, TRUE, }, + { OBJ_HERMIT_GUNSMITH, 2, 1, LEFT, FALSE, }, }; void onspawn_the_cast(Entity *e) { @@ -478,10 +478,7 @@ void onspawn_the_cast(Entity *e) { } } - //e->sprite = cast_data[e->id].sprite; - //e->frame = cast_data[e->id].fallframe; e->dir = cast_data[e->id].dir; - if(cast_data[e->id].tall) { e->y -= (4<hit_box.bottom += 8; @@ -493,14 +490,12 @@ void onspawn_the_cast(Entity *e) { // sword->linkedEntity = e; //sword->carry.flip = TRUE; //} - - // Balrog goes behind Curly - //if (e->sprite == SPR_BALROG_CAST) { - // e->PushBehind(lowestEntity); - //} } void ai_the_cast(Entity *e) { + if(e->id == 9) e->sprite[1].x = e->sprite[0].x - 8; // Balrog is separated for some reason + if(e->id == 10) moveMeToFront = TRUE; // Curly over balrog + if(!e->state) { e->dir = cast_data[e->id].dir; if(e->y_speed < SPEED_12(0x5C0)) e->y_speed += SPEED_8(0x40); diff --git a/src/audio.c b/src/audio.c index 60401650..f73e3611 100644 --- a/src/audio.c +++ b/src/audio.c @@ -20,8 +20,8 @@ void sound_init() { disable_ints; z80_request(); for(uint8_t i = 1; i < SOUND_COUNT; i++) { - xgm_pcm_set(0x40 + i, sound_info[i].sound, - (uint16_t)(sound_info[i].end-sound_info[i].sound)); + uint16_t len = sound_info[i].end-sound_info[i].sound; + xgm_pcm_set(0x40 + i, sound_info[i].sound, len > 256 ? len : 256); } z80_release(); enable_ints;