trunk/src/emu/video/m50458.c
r17544 | r17545 | |
29 | 29 | static ADDRESS_MAP_START( m50458_vram, AS_0, 16, m50458_device ) |
30 | 30 | AM_RANGE(0x0000, 0x023f) AM_RAM // vram |
31 | 31 | 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) |
33 | 33 | AM_RANGE(0x0244, 0x0245) AM_WRITE(vreg_122_w) |
34 | 34 | AM_RANGE(0x0246, 0x0247) AM_WRITE(vreg_123_w) |
35 | 35 | AM_RANGE(0x024c, 0x024d) AM_WRITE(vreg_126_w) |
r17544 | r17545 | |
47 | 47 | // printf("%04x\n",data); |
48 | 48 | } |
49 | 49 | |
| 50 | WRITE16_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 | |
50 | 63 | WRITE16_MEMBER( m50458_device::vreg_122_w) |
51 | 64 | { |
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 | |
53 | 74 | } |
54 | 75 | |
55 | 76 | WRITE16_MEMBER( m50458_device::vreg_123_w) |
r17544 | r17545 | |
314 | 335 | UINT8 pix; |
315 | 336 | UINT8 color = (tile & 0x700) >> 8; |
316 | 337 | UINT16 offset = ((tile & 0x7f)*36+yi*2); |
317 | | int res_y; |
| 338 | int res_y,res_x; |
| 339 | UINT8 xh,yh; |
318 | 340 | |
319 | 341 | /* TODO: blinking, bit 7 (RTC test in NSS) */ |
320 | 342 | |
r17544 | r17545 | |
332 | 354 | pix |= 1; |
333 | 355 | |
334 | 356 | res_y = y*18+yi; |
| 357 | res_x = x*12+(xi-4); |
335 | 358 | |
336 | 359 | if(y != 0 && y != 11) |
337 | 360 | { |
r17544 | r17545 | |
352 | 375 | } |
353 | 376 | else //if(pix & 1) |
354 | 377 | { |
355 | | /* TODO: shadow parameter */ |
| 378 | /* TODO: is there a parameter for the border parameter? */ |
356 | 379 | r = 0x00; |
357 | 380 | g = 0x00; |
358 | 381 | b = 0x00; |
359 | 382 | } |
360 | 383 | |
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 | } |
362 | 422 | } |
363 | 423 | } |
364 | 424 | } |
trunk/src/emu/video/m50458.h
r17544 | r17545 | |
43 | 43 | WRITE_LINE_MEMBER( set_cs_line ); |
44 | 44 | WRITE_LINE_MEMBER( set_clock_line ); |
45 | 45 | DECLARE_WRITE16_MEMBER(vreg_120_w); |
| 46 | DECLARE_WRITE16_MEMBER(vreg_121_w); |
46 | 47 | DECLARE_WRITE16_MEMBER(vreg_122_w); |
47 | 48 | DECLARE_WRITE16_MEMBER(vreg_123_w); |
48 | 49 | DECLARE_WRITE16_MEMBER(vreg_126_w); |
r17544 | r17545 | |
70 | 71 | UINT8 m_phase; |
71 | 72 | UINT8 m_scrf,m_scrr; |
72 | 73 | UINT8 m_space; |
| 74 | UINT8 m_hsz1,m_hsz2,m_hsz3; |
| 75 | UINT8 m_vsz1,m_vsz2,m_vsz3; |
73 | 76 | |
74 | 77 | m50458_state_t m_osd_state; |
75 | 78 | |