Skip to content

Commit

Permalink
SFX bug
Browse files Browse the repository at this point in the history
  • Loading branch information
andwn committed Sep 15, 2020
1 parent 5479a7e commit 6e803bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions src/ai/endgame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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<<CSF);
e->hit_box.bottom += 8;
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6e803bd

Please sign in to comment.