From 2da9fd50a611b0b6c3a9fea54ad46a3377e5284c Mon Sep 17 00:00:00 2001 From: tim lindner Date: Wed, 16 May 2018 20:49:08 -0700 Subject: [PATCH] Coco3gimefixsam (#3577) * Fixed a incorrect handling of number of scan lines for VDG and SAM settings in the GIME for the CoCo3. * Added missing SAM state combo for lines_per_row = 2 * Fixed style requested by @startaq --- src/mame/video/gime.cpp | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/mame/video/gime.cpp b/src/mame/video/gime.cpp index 3c5afcbd0f7..96a88dd36b2 100644 --- a/src/mame/video/gime.cpp +++ b/src/mame/video/gime.cpp @@ -1254,16 +1254,9 @@ inline uint16_t gime_device::get_lines_per_row(void) uint16_t lines_per_row; if (m_legacy_video) { - switch(m_ff22_value & (MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0)) + switch(m_ff22_value & MODE_AG) { case 0: - case MODE_GM0: - case MODE_GM1: - case MODE_GM1|MODE_GM0: - case MODE_GM2: - case MODE_GM2|MODE_GM0: - case MODE_GM2|MODE_GM1: - case MODE_GM2|MODE_GM1|MODE_GM0: { // http://cocogamedev.mxf.yuku.com/topic/4299238#.VyC6ozArI-U static int ff9c_lines_per_row[16] = @@ -1278,20 +1271,21 @@ inline uint16_t gime_device::get_lines_per_row(void) } case MODE_AG: - case MODE_AG|MODE_GM0: - case MODE_AG|MODE_GM1: - lines_per_row = 3; - break; - - case MODE_AG|MODE_GM1|MODE_GM0: - case MODE_AG|MODE_GM2: - lines_per_row = 2; - break; - - case MODE_AG|MODE_GM2|MODE_GM0: - case MODE_AG|MODE_GM2|MODE_GM1: - case MODE_AG|MODE_GM2|MODE_GM1|MODE_GM0: - lines_per_row = 1; + switch (m_sam_state & (SAM_STATE_V0|SAM_STATE_V1|SAM_STATE_V2)) + { + case 0: + lines_per_row = 12; + break; + case SAM_STATE_V1: + lines_per_row = 3; + break; + case SAM_STATE_V2: + case SAM_STATE_V1|SAM_STATE_V0: + lines_per_row = 2; + break; + default: + lines_per_row = 1; + } break; default: