Previous 199869 Revisions Next

r17545 Tuesday 28th August, 2012 at 20:56:43 UTC by Angelo Salese
Added horizontal/vertical char size, making the NSS logo to look better
[src/emu/video]m50458.c m50458.h

trunk/src/emu/video/m50458.c
r17544r17545
2929static ADDRESS_MAP_START( m50458_vram, AS_0, 16, m50458_device )
3030   AM_RANGE(0x0000, 0x023f) AM_RAM // vram
3131   AM_RANGE(0x0240, 0x0241) AM_WRITE(vreg_120_w)
32//   AM_RANGE(0x0242, 0x0243) AM_WRITE(vreg_121_w)
32   AM_RANGE(0x0242, 0x0243) AM_WRITE(vreg_121_w)
3333   AM_RANGE(0x0244, 0x0245) AM_WRITE(vreg_122_w)
3434   AM_RANGE(0x0246, 0x0247) AM_WRITE(vreg_123_w)
3535   AM_RANGE(0x024c, 0x024d) AM_WRITE(vreg_126_w)
r17544r17545
4747//   printf("%04x\n",data);
4848}
4949
50WRITE16_MEMBER( m50458_device::vreg_121_w)
51{
52   /* Horizontal char size for line 0 */
53   m_hsz1 = (data & 0xc0) >> 6;
54
55   /* Horizontal char size for line 1 - 10 */
56   m_hsz2 = (data & 0x300) >> 8;
57
58   /* Horizontal char size for line 11 */
59   m_hsz3 = (data & 0xc00) >> 10;
60}
61
62
5063WRITE16_MEMBER( m50458_device::vreg_122_w)
5164{
52//   printf("%04x\n",data);
65   /* Vertical char size for line 0 */
66   m_vsz1 = (data & 0xc0) >> 6;
67
68   /* Vertical char size for line 1 - 10 */
69   m_vsz2 = (data & 0x300) >> 8;
70
71   /* Vertical char size for line 11 */
72   m_vsz3 = (data & 0xc00) >> 10;
73
5374}
5475
5576WRITE16_MEMBER( m50458_device::vreg_123_w)
r17544r17545
314335               UINT8 pix;
315336               UINT8 color = (tile & 0x700) >> 8;
316337               UINT16 offset = ((tile & 0x7f)*36+yi*2);
317               int res_y;
338               int res_y,res_x;
339               UINT8 xh,yh;
318340
319341               /* TODO: blinking, bit 7 (RTC test in NSS) */
320342
r17544r17545
332354                  pix |= 1;
333355
334356               res_y = y*18+yi;
357               res_x = x*12+(xi-4);
335358
336359               if(y != 0 && y != 11)
337360               {
r17544r17545
352375                  }
353376                  else //if(pix & 1)
354377                  {
355                     /* TODO: shadow parameter */
378                     /* TODO: is there a parameter for the border parameter? */
356379                     r = 0x00;
357380                     g = 0x00;
358381                     b = 0x00;
359382                  }
360383
361                  bitmap.pix32(res_y,x*12+(xi-4)) = r << 16 | g << 8 | b;
384                  /* TODO: clean this up (also needs better testing) */
385                  if(y_base == 0)
386                  {
387                     res_x *= (m_hsz1 + 1);
388                     res_y *= (m_vsz1 + 1);
389
390                     if(res_y > 215 || res_x > 288)
391                        continue;
392
393                     for(yh=0;yh<m_vsz1+1;yh++)
394                        for(xh=0;xh<m_hsz1+1;xh++)
395                           bitmap.pix32(res_y+yh,res_x+xh) = r << 16 | g << 8 | b;
396                  }
397                  else if(y_base == 11)
398                  {
399                     res_x *= (m_hsz3 + 1);
400                     res_y += ((m_vsz2 * (y-1)) * 18) + 9 * m_vsz2;
401                     res_y *= (m_vsz3 + 1);
402
403                     if(res_y > 215 || res_x > 288)
404                        continue;
405
406                     for(yh=0;yh<m_vsz3+1;yh++)
407                        for(xh=0;xh<m_hsz3+1;xh++)
408                           bitmap.pix32(res_y+yh,res_x+xh) = r << 16 | g << 8 | b;
409                  }
410                  else
411                  {
412                     res_x *= (m_hsz2 + 1);
413                     res_y *= (m_vsz2 + 1);
414
415                     if(res_y > 215 || res_x > 288)
416                        continue;
417
418                     for(yh=0;yh<m_vsz2+1;yh++)
419                        for(xh=0;xh<m_hsz2+1;xh++)
420                           bitmap.pix32(res_y+yh,res_x+xh) = r << 16 | g << 8 | b;
421                  }
362422               }
363423            }
364424         }
trunk/src/emu/video/m50458.h
r17544r17545
4343   WRITE_LINE_MEMBER( set_cs_line );
4444   WRITE_LINE_MEMBER( set_clock_line );
4545   DECLARE_WRITE16_MEMBER(vreg_120_w);
46   DECLARE_WRITE16_MEMBER(vreg_121_w);
4647   DECLARE_WRITE16_MEMBER(vreg_122_w);
4748   DECLARE_WRITE16_MEMBER(vreg_123_w);
4849   DECLARE_WRITE16_MEMBER(vreg_126_w);
r17544r17545
7071   UINT8 m_phase;
7172   UINT8 m_scrf,m_scrr;
7273   UINT8 m_space;
74   UINT8 m_hsz1,m_hsz2,m_hsz3;
75   UINT8 m_vsz1,m_vsz2,m_vsz3;
7376
7477   m50458_state_t m_osd_state;
7578

Previous 199869 Revisions Next


© 1997-2024 The MAME Team