amiga/agnus_copper.cpp: add vblank line mechanism for penalties

This commit is contained in:
angelosa 2025-01-26 20:49:29 +01:00
parent 3c0a92e485
commit c95c4f5345
7 changed files with 50 additions and 24 deletions

View File

@ -108,8 +108,9 @@ cd32: unsupported [Akiko] close tray after CD32 BIOS plays back music, will othe
<!-- Packaging Design: Epic Marketing -->
<publisher>APC &amp; TCP</publisher>
<notes><![CDATA[
Intro and main menu use [Denise] BPLCON3 SPRESx
Optional [Denise] SHRES mode in gameplay
Intro and main menu use [Lisa] BPLCON3 SPRESx
Optional [Lisa] SHRES mode in gameplay
Very easy to ball stuck in table 2 (verify, https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=124163#Post124163)
Editor and HD Install untested
]]></notes>
<!-- TODO: verify assign BrainDamage: "Brain Damage:" before install as Erratum note -->

View File

@ -8,6 +8,9 @@ license:CC0-1.0
The software listed here is not designed for use on systems without the AGA chipset and
will not function.
Note:
- Please use [Lisa] / [Alice] tag where issues are specifically for amiga/amigaaga.cpp
-->
<softwarelist name="amigaaga_flop" description="Commodore Amiga AGA disk images">
@ -2529,7 +2532,7 @@ Red screen when "Out to lunch is loading" displays, [FDC]
<year>1995</year>
<publisher>21st Century Entertainment</publisher>
<notes><![CDATA[
[Denise] Bitplane overlay is offset on title screen
[Lisa] Bitplane overlay is offset on title screen
Doesn't draw left bumper during gameplay [Copper]?
]]></notes>
<info name="usage" value="Requires AGA" />
@ -3638,7 +3641,7 @@ ATK test: C:0 H:U Bad
<year>1996</year>
<publisher>21st Century</publisher>
<notes><![CDATA[
Has no cursor on main menu
[Denise] has no cursor on main menu, should output with plane 0x10 (pfxpri 0x3f), amigaocs_flop:swiv related trick?
On gameplay unthrottle emulation causes idle vertical scroll to be slower
]]></notes>
<info name="usage" value="Requires AGA" />
@ -4990,8 +4993,8 @@ Pressing TAB key will switch to NTSC mode (?), which cuts off bottom of screen
<publisher>Edgar Vigdal</publisher>
<notes><![CDATA[
Guru Meditation when run stand-alone (fixed)
[Denise] bonus items don't collide in gameplay
Throws "file is missing" when installed to HDD
[Denise] bonus items and enemy to player bullets don't collide in gameplay, CLXCON even mask
TODO: Throws "file is missing" when installed to HDD
]]></notes>
<info name="usage" value="Requires AGA" />

View File

@ -233,10 +233,14 @@ void agnus_copper_device::copins_w(u16 data)
//**************************************************************************
// executed on scanline == 0
void agnus_copper_device::vblank_sync()
void agnus_copper_device::vblank_sync(bool state)
{
set_pc(0, true);
m_xpos_state = 0;
if (state)
{
set_pc(0, true);
m_xpos_state = 0;
}
m_vertical_blank = state;
}
// check current copper cycle at end of scanline
@ -343,7 +347,7 @@ int agnus_copper_device::execute_next(int xpos, int ypos, bool is_blitter_busy,
// - suprfrog & abreed (bottom playfield rows).
// - beast, biochall and cd32 bios wants this to be 0x5c
const bool horizontal_blank = xpos <= 0x5c;
const int move_offset = horizontal_blank ? 0 : std::max(num_planes - 4, 0);
const int move_offset = horizontal_blank || m_vertical_blank ? 0 : std::max(num_planes - 4, 0);
m_pending_offset = word0;
m_pending_data = word1;
@ -376,7 +380,7 @@ int agnus_copper_device::execute_next(int xpos, int ypos, bool is_blitter_busy,
if ((word1 & 1) == 0)
{
const bool horizontal_blank = xpos <= 0x5c;
const int wait_offset = horizontal_blank ? 0 : std::max(num_planes - 4, 0) + 1;
const int wait_offset = horizontal_blank || m_vertical_blank ? 0 : std::max(num_planes - 4, 0) + 1;
LOGINST(" WAIT %04x & %04x (currently %04x, num planes %d +%d)\n",
m_waitval,

View File

@ -32,7 +32,7 @@ public:
void copcon_w(u16 data);
// getters/setters
void vblank_sync();
void vblank_sync(bool state);
int execute_next(int xpos, int ypos, bool is_blitter_busy, int num_planes);
void suspend_offset(int xpos, int hblank_width);
int restore_offset();
@ -72,6 +72,7 @@ private:
u16 m_pending_offset;
u16 m_pending_data;
u16 m_xpos_state;
bool m_vertical_blank;
};

View File

@ -434,6 +434,9 @@ public:
void amiga_palette(palette_device &palette) const;
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
bool get_screen_standard();
int get_screen_vblank_line();
void update_screenmode();
TIMER_CALLBACK_MEMBER( scanline_callback );

View File

@ -493,7 +493,7 @@ void amiga_state::render_scanline(bitmap_rgb32 &bitmap, int scanline)
CUSTOM_REG(REG_VPOSR) ^= VPOSR_LOF;
// reset copper and ham color
m_copper->vblank_sync();
m_copper->vblank_sync(true);
m_ham_color = CUSTOM_REG(REG_COLOR00);
}
@ -526,6 +526,10 @@ void amiga_state::render_scanline(bitmap_rgb32 &bitmap, int scanline)
scanline /= 2;
// notify copper that we are not in vblank anymore
if (scanline == get_screen_vblank_line())
m_copper->vblank_sync(false);
m_last_scanline = scanline;
/* all sprites off at the start of the line */
@ -904,17 +908,24 @@ uint32_t amiga_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
return 0;
}
bool amiga_state::get_screen_standard()
{
// we support dynamic switching between PAL and NTSC, determine mode from register
if (m_agnus_id >= AGNUS_HR_PAL)
return CUSTOM_REG(REG_BEAMCON0) & 0x20;
// old agnus, agnus id determines PAL or NTSC
return !(m_agnus_id & 0x10);
}
int amiga_state::get_screen_vblank_line()
{
return get_screen_standard() ? amiga_state::VBLANK_PAL : amiga_state::VBLANK_NTSC;
}
void amiga_state::update_screenmode()
{
bool pal;
// first let's see if we're PAL or NTSC
if (m_agnus_id >= AGNUS_HR_PAL)
// we support dynamic switching between PAL and NTSC, determine mode from register
pal = CUSTOM_REG(REG_BEAMCON0) & 0x20;
else
// old agnus, agnus id determines PAL or NTSC
pal = !(m_agnus_id & 0x10);
bool pal = get_screen_standard();
// basic height & vblank length
int height = pal ? SCREEN_HEIGHT_PAL : SCREEN_HEIGHT_NTSC;

View File

@ -486,7 +486,7 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline)
if (CUSTOM_REG(REG_BPLCON0) & BPLCON0_LACE)
CUSTOM_REG(REG_VPOSR) ^= VPOSR_LOF;
m_copper->vblank_sync();
m_copper->vblank_sync(true);
m_ham_color = CUSTOM_REG(REG_COLOR00);
}
@ -519,6 +519,9 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline)
scanline /= 2;
if (scanline == get_screen_vblank_line())
m_copper->vblank_sync(false);
m_last_scanline = scanline;
/* all sprites off at the start of the line */
@ -608,7 +611,7 @@ void amiga_state::aga_render_scanline(bitmap_rgb32 &bitmap, int scanline)
x,
m_last_scanline & 0xff,
bool(BIT(CUSTOM_REG(REG_DMACON), 14)), // BBUSY
planes
bitplane_fmode ? 0 : planes
);
save_color0 = CUSTOM_REG(REG_COLOR00);
if (m_genlock_color != 0xffff)