summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2021-04-24 16:14:03 -0400
committer arbee <rb6502@users.noreply.github.com>2021-04-24 16:14:03 -0400
commite7d317c44a48d7e5d41d30e93eeb973fc71f35d6 (patch)
tree5407892ad7c70099547f48df02ad7f8c7b6ca9e6
parent92213dbdab3063c0dbb976365504af8aa8982ca0 (diff)
apple2gs: fix $C02E vertical counter readback, corrects hang in ShowMe NDA. [R. Belmont]
-rw-r--r--src/mame/drivers/apple2gs.cpp27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp
index 43c1846c8d5..ab228134e4e 100644
--- a/src/mame/drivers/apple2gs.cpp
+++ b/src/mame/drivers/apple2gs.cpp
@@ -2180,31 +2180,12 @@ void apple2gs_state::do_io(int offset)
}
}
-// apple2gs_get_vpos - return the correct vertical counter value for the current scanline,
-// keeping borders in mind.
-
+// apple2gs_get_vpos - return the correct vertical counter value for the current scanline.
int apple2gs_state::get_vpos()
{
- int result, scan;
- static const u8 top_border_vert[BORDER_TOP] =
- {
- 0xfa, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfb,
- 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe, 0xff,
-
- };
-
- scan = m_screen->vpos();
-
- if (scan < BORDER_TOP)
- {
- result = top_border_vert[scan];
- }
- else
- {
- result = scan - BORDER_TOP + 0x100 + 1;
- }
-
- return result;
+ // as per IIgs Tech Note #39, this is simply scanline + 250 on NTSC (262 lines),
+ // or scanline + 200 on PAL (312 lines)
+ return ((m_screen->vpos() + BORDER_TOP) % 262) + 250;
}
void apple2gs_state::process_clock()