From a7c8b702da12eac1e2f6e1d13cab2acb6f216cbd Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 9 Oct 2021 21:08:17 +0300 Subject: [PATCH] Some games like to race with the SGB border fade --- Core/sgb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Core/sgb.c b/Core/sgb.c index 40fbd7a2..ee925a8d 100644 --- a/Core/sgb.c +++ b/Core/sgb.c @@ -648,7 +648,7 @@ void GB_sgb_render(GB_gameboy_t *gb) } } if (gb->sgb->transfer_dest == TRANSFER_BORDER_DATA) { - gb->sgb->border_animation = 64; + gb->sgb->border_animation = 80; } } } @@ -729,7 +729,10 @@ void GB_sgb_render(GB_gameboy_t *gb) } uint32_t border_colors[16 * 4]; - if (gb->sgb->border_animation == 0 || gb->sgb->intro_animation < GB_SGB_INTRO_ANIMATION_LENGTH) { + if (gb->sgb->border_animation == 0 || gb->sgb->border_animation > 64 || gb->sgb->intro_animation < GB_SGB_INTRO_ANIMATION_LENGTH) { + if (gb->sgb->border_animation != 0) { + gb->sgb->border_animation--; + } for (unsigned i = 0; i < 16 * 4; i++) { border_colors[i] = convert_rgb15(gb, LE16(gb->sgb->border.palette[i])); }