From f5959ab4bfa6f2e542c9802d858f528d9f9ee7c3 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Sun, 12 Mar 2023 01:50:57 +0000 Subject: [PATCH] vdp1/normal_sprite_animated: improve for real hardware --- vdp1/normal_sprite_animated.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vdp1/normal_sprite_animated.cpp b/vdp1/normal_sprite_animated.cpp index d15abdf..dacee2c 100644 --- a/vdp1/normal_sprite_animated.cpp +++ b/vdp1/normal_sprite_animated.cpp @@ -83,8 +83,8 @@ constexpr uint32_t sprite_height = 100; constexpr uint32_t sprite_last_frame = 15; static uint32_t color_address, character_address; -static uint32_t sprite_frame_index; static uint32_t animation_timer; +static uint32_t sprite_frame_index; // __attribute__ ((interrupt_handler)) changes code generation behavior for this // function works. `rts` as generated in normal functions is replaced with @@ -94,8 +94,9 @@ void v_blank_in(void) { // clear V_BLANK_IN interrupt status scu.reg.IST &= ~(IST__V_BLANK_IN); + scu.reg.IMS = ~(IMS__V_BLANK_IN); - if (++animation_timer < 4) + if (++animation_timer < 6) return; else animation_timer = 0; @@ -117,6 +118,9 @@ void main() vdp2.reg.TVMD = ( TVMD__DISP | TVMD__LSMD__NON_INTERLACE | TVMD__VRESO__240 | TVMD__HRESO__NORMAL_320); + // disable all VDP2 backgrounds (e.g: the Sega bios logo) + vdp2.reg.BGON = 0; + // VDP2 User's Manual: // "When sprite data is in an RGB format, sprite register 0 is selected" // "When the value of a priority number is 0h, it is read as transparent"