From ea176d43d1035bc4fa20f3a3b266e243251fada2 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Tue, 28 Aug 2012 20:56:43 +0000 Subject: [PATCH] Added horizontal/vertical char size, making the NSS logo to look better --- src/emu/video/m50458.c | 70 +++++++++++++++++++++++++++++++++++++++--- src/emu/video/m50458.h | 3 ++ 2 files changed, 68 insertions(+), 5 deletions(-) diff --git a/src/emu/video/m50458.c b/src/emu/video/m50458.c index 15e32266945..6568ef2d82c 100644 --- a/src/emu/video/m50458.c +++ b/src/emu/video/m50458.c @@ -29,7 +29,7 @@ const device_type M50458 = &device_creator; static ADDRESS_MAP_START( m50458_vram, AS_0, 16, m50458_device ) AM_RANGE(0x0000, 0x023f) AM_RAM // vram AM_RANGE(0x0240, 0x0241) AM_WRITE(vreg_120_w) -// AM_RANGE(0x0242, 0x0243) AM_WRITE(vreg_121_w) + AM_RANGE(0x0242, 0x0243) AM_WRITE(vreg_121_w) AM_RANGE(0x0244, 0x0245) AM_WRITE(vreg_122_w) AM_RANGE(0x0246, 0x0247) AM_WRITE(vreg_123_w) AM_RANGE(0x024c, 0x024d) AM_WRITE(vreg_126_w) @@ -47,9 +47,30 @@ WRITE16_MEMBER( m50458_device::vreg_120_w) // printf("%04x\n",data); } +WRITE16_MEMBER( m50458_device::vreg_121_w) +{ + /* Horizontal char size for line 0 */ + m_hsz1 = (data & 0xc0) >> 6; + + /* Horizontal char size for line 1 - 10 */ + m_hsz2 = (data & 0x300) >> 8; + + /* Horizontal char size for line 11 */ + m_hsz3 = (data & 0xc00) >> 10; +} + + WRITE16_MEMBER( m50458_device::vreg_122_w) { -// printf("%04x\n",data); + /* Vertical char size for line 0 */ + m_vsz1 = (data & 0xc0) >> 6; + + /* Vertical char size for line 1 - 10 */ + m_vsz2 = (data & 0x300) >> 8; + + /* Vertical char size for line 11 */ + m_vsz3 = (data & 0xc00) >> 10; + } WRITE16_MEMBER( m50458_device::vreg_123_w) @@ -314,7 +335,8 @@ UINT32 m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, UINT8 pix; UINT8 color = (tile & 0x700) >> 8; UINT16 offset = ((tile & 0x7f)*36+yi*2); - int res_y; + int res_y,res_x; + UINT8 xh,yh; /* TODO: blinking, bit 7 (RTC test in NSS) */ @@ -332,6 +354,7 @@ UINT32 m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, pix |= 1; res_y = y*18+yi; + res_x = x*12+(xi-4); if(y != 0 && y != 11) { @@ -352,13 +375,50 @@ UINT32 m50458_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, } else //if(pix & 1) { - /* TODO: shadow parameter */ + /* TODO: is there a parameter for the border parameter? */ r = 0x00; g = 0x00; b = 0x00; } - bitmap.pix32(res_y,x*12+(xi-4)) = r << 16 | g << 8 | b; + /* TODO: clean this up (also needs better testing) */ + if(y_base == 0) + { + res_x *= (m_hsz1 + 1); + res_y *= (m_vsz1 + 1); + + if(res_y > 215 || res_x > 288) + continue; + + for(yh=0;yh 215 || res_x > 288) + continue; + + for(yh=0;yh 215 || res_x > 288) + continue; + + for(yh=0;yh