From: kub Date: Wed, 6 Oct 2021 17:45:01 +0000 (+0200) Subject: sms vdp, support 224/240 line mode X-Git-Tag: v2.00~477 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b3e9d92e3a7ef974414d951e89148da9451c4c7;p=picodrive.git sms vdp, support 224/240 line mode --- diff --git a/pico/mode4.c b/pico/mode4.c index 7f457c10..756e26a4 100644 --- a/pico/mode4.c +++ b/pico/mode4.c @@ -232,14 +232,18 @@ static void DrawDisplayM4(int scanline) // Find the line in the name table line = pv->reg[9] + scanline; // vscroll + scanline - line &= 0xff; // Find name table: nametab = PicoMem.vram; - if ((Pico.video.reg[0] & 6) == 6 && (Pico.video.reg[1] & 0x18)) + if ((pv->reg[0] & 6) == 6 && (pv->reg[1] & 0x18)) { + line &= 0xff; nametab += ((pv->reg[2] & 0x0c) << (10-1)) + (0x700 >> 1); - else + } else { + while (line >= 224) line -= 224; nametab += (pv->reg[2] & 0x0e) << (10-1); + // old SMS only, masks line:7 with reg[2]:0 for address calculation + //if ((pv->reg[2] & 0x01) == 0) line &= 0x7f; + } nametab += (line>>3) << (6-1); dx = pv->reg[8]; // hscroll diff --git a/pico/sms.c b/pico/sms.c index 5e4b8766..4901e089 100644 --- a/pico/sms.c +++ b/pico/sms.c @@ -380,8 +380,8 @@ void PicoFrameMS(void) z80_nmi(); Pico.ms.nmi_state = nmi; - if ((Pico.video.reg[0] & 6) == 6 && (Pico.video.reg[1] & 0x18)) - lines_vis = (Pico.video.reg[1] & 0x08) ? 240 : 224; + if ((pv->reg[0] & 6) == 6 && (pv->reg[1] & 0x18)) + lines_vis = (pv->reg[1] & 0x08) ? 240 : 224; PicoFrameStartMode4(); hint = pv->reg[0x0a];