From 835630cc7a5fdf8a214f83b3d7cb3a95ca3f85a7 Mon Sep 17 00:00:00 2001 From: Fabio D'Urso Date: Fri, 17 Jan 2025 15:43:18 +0100 Subject: ef9345: implement service row for the TS9347 variant (#13225) With this change, the minitel2 can correctly display its status row at the top of the screen. --- src/devices/video/ef9345.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/devices/video/ef9345.cpp b/src/devices/video/ef9345.cpp index f4780a7e790..16436fe72f4 100644 --- a/src/devices/video/ef9345.cpp +++ b/src/devices/video/ef9345.cpp @@ -378,7 +378,23 @@ void ef9345_device::zoom(uint8_t *pix, uint16_t n) uint16_t ef9345_device::indexblock(uint16_t x, uint16_t y) { uint16_t i = x, j; - j = (y == 0) ? ((m_tgs & 0x20) >> 5) : ((m_ror & 0x1f) + y - 1); + + if (m_variant == EF9345_MODE::TYPE_EF9345) + { + // On the EF9345 the service row is always displayed at the top, and + // it can be fetched from either Y=0 or Y=1. + j = (y == 0) ? ((m_tgs & 0x20) >> 5) : ((m_ror & 0x1f) + y - 1); + } + else + { + // On the TS9347 the service row is displayed either at the top or at + // the bottom, and it is always fetched from Y=0. + if (m_tgs & 1) + j = (y == 24) ? 0 : ((m_ror & 0x1f) + y); + else + j = (y == 0) ? 0 : ((m_ror & 0x1f) + y - 1); + } + j = (j > 31) ? (j - 24) : j; //right side of a double width character -- cgit v1.2.3