diff options
Diffstat (limited to 'src/devices/bus/wangpc/mvc.cpp')
-rw-r--r-- | src/devices/bus/wangpc/mvc.cpp | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/devices/bus/wangpc/mvc.cpp b/src/devices/bus/wangpc/mvc.cpp index af78d16cc29..65985890f82 100644 --- a/src/devices/bus/wangpc/mvc.cpp +++ b/src/devices/bus/wangpc/mvc.cpp @@ -73,15 +73,15 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row ) { for (int sx = 0; sx < 50; sx++) { - offs_t addr = (y * 50) + sx; + offs_t const addr = (y * 50) + sx; uint16_t data = m_bitmap_ram[addr]; for (int bit = 0; bit < 16; bit++) { - int x = (sx * 16) + bit; - int color = BIT(data, 15) && de; + int const x = (sx * 16) + bit; + int const color = BIT(data, 15) && de; - bitmap.pix32(vbp + y, hbp + x) = PALETTE_MVC[color]; + bitmap.pix(vbp + y, hbp + x) = PALETTE_MVC[color]; data <<= 1; } @@ -89,8 +89,8 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row ) for (int column = 0; column < x_count; column++) { - uint16_t code = m_video_ram[((ma + column) & 0x7ff)]; - uint8_t attr = code & 0xff; + uint16_t const code = m_video_ram[((ma + column) & 0x7ff)]; + uint8_t const attr = code & 0xff; uint8_t new_ra = ra + 1; @@ -103,7 +103,7 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row ) new_ra = ra; } - offs_t addr = ((code >> 8) << 4) | (new_ra & 0x0f); + offs_t const addr = ((code >> 8) << 4) | (new_ra & 0x0f); uint16_t data = m_char_ram[addr & 0xfff]; if ((column == cursor_x) || (!ra && ATTR_OVERSCORE) || ((ra == 9) && ATTR_UNDERSCORE)) @@ -113,18 +113,20 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row ) for (int bit = 0; bit < 10; bit++) { - int x = (column * 10) + bit; + int const x = (column * 10) + bit; int color = ((BIT(data, 9) & ~ATTR_BLANK) ^ ATTR_REVERSE); - if ((color | bitmap.pix32(vbp + y, hbp + x)) & ATTR_BOLD) color = 2; - if (color) bitmap.pix32(vbp + y, hbp + x) = de ? PALETTE_MVC[color] : rgb_t::black(); + if ((color | bitmap.pix(vbp + y, hbp + x)) & ATTR_BOLD) + color = 2; + if (color) + bitmap.pix(vbp + y, hbp + x) = de ? PALETTE_MVC[color] : rgb_t::black(); data <<= 1; } } } -WRITE_LINE_MEMBER( wangpc_mvc_device::vsync_w ) +void wangpc_mvc_device::vsync_w(int state) { if (OPTION_VSYNC && state) { @@ -149,7 +151,7 @@ void wangpc_mvc_device::device_add_mconfig(machine_config &config) m_crtc->set_screen(SCREEN_TAG); m_crtc->set_show_border_area(true); m_crtc->set_char_width(10); - m_crtc->set_update_row_callback(FUNC(wangpc_mvc_device::crtc_update_row), this); + m_crtc->set_update_row_callback(FUNC(wangpc_mvc_device::crtc_update_row)); m_crtc->out_vsync_callback().set(FUNC(wangpc_mvc_device::vsync_w)); } @@ -184,9 +186,9 @@ wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char * device_t(mconfig, WANGPC_MVC, tag, owner, clock), device_wangpcbus_card_interface(mconfig, *this), m_crtc(*this, MC6845_TAG), - m_video_ram(*this, "video_ram"), - m_char_ram(*this, "char_ram"), - m_bitmap_ram(*this, "bitmap_ram"), + m_video_ram(*this, "video_ram", VIDEO_RAM_SIZE*2, ENDIANNESS_LITTLE), + m_char_ram(*this, "char_ram", CHAR_RAM_SIZE*2, ENDIANNESS_LITTLE), + m_bitmap_ram(*this, "bitmap_ram", BITMAP_RAM_SIZE*2, ENDIANNESS_LITTLE), m_option(0), m_irq(CLEAR_LINE) { @@ -199,11 +201,6 @@ wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char * void wangpc_mvc_device::device_start() { - // allocate memory - m_video_ram.allocate(VIDEO_RAM_SIZE); - m_char_ram.allocate(CHAR_RAM_SIZE); - m_bitmap_ram.allocate(BITMAP_RAM_SIZE); - // state saving save_item(NAME(m_option)); save_item(NAME(m_irq)); |