diff options
Diffstat (limited to 'src/mame/machine')
33 files changed, 233 insertions, 155 deletions
diff --git a/src/mame/machine/3do.cpp b/src/mame/machine/3do.cpp index 245f018fe8b..cf5af65cfe8 100644 --- a/src/mame/machine/3do.cpp +++ b/src/mame/machine/3do.cpp @@ -1046,8 +1046,8 @@ uint32_t _3do_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, for ( int y = 0; y < 120; y++ ) { - uint32_t *dest_p0 = &bitmap.pix32(22 + y * 2, 254 ); - uint32_t *dest_p1 = &bitmap.pix32(22 + y * 2 + 1, 254 ); + uint32_t *dest_p0 = &bitmap.pix(22 + y * 2, 254 ); + uint32_t *dest_p1 = &bitmap.pix(22 + y * 2 + 1, 254 ); for ( int x = 0; x < 320; x++ ) { diff --git a/src/mame/machine/3dom2.cpp b/src/mame/machine/3dom2.cpp index dee32da9369..7da659deefa 100644 --- a/src/mame/machine/3dom2.cpp +++ b/src/mame/machine/3dom2.cpp @@ -1336,9 +1336,9 @@ uint32_t m2_vdu_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma for (uint32_t ys = vdouble ? 2 : 1; ys > 0; --ys) { if (hdouble) - draw_scanline_double(&bitmap.pix32(v, 0), srclower, srcupper); + draw_scanline_double(&bitmap.pix(v, 0), srclower, srcupper); else - draw_scanline(&bitmap.pix32(v, 0), srclower, srcupper); + draw_scanline(&bitmap.pix(v, 0), srclower, srcupper); ++v; } @@ -1352,7 +1352,7 @@ uint32_t m2_vdu_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma // Blank this block of lines if DMA is disabled while (lines--) { - uint32_t *dst = &bitmap.pix32(v, cliprect.min_x); + uint32_t *dst = &bitmap.pix(v, cliprect.min_x); for (uint32_t x = cliprect.min_x; x <= cliprect.max_x; ++x) *dst++ = rgb_t::black(); diff --git a/src/mame/machine/aim65.cpp b/src/mame/machine/aim65.cpp index 5c7ce8c221d..cf7b14ba9e1 100644 --- a/src/mame/machine/aim65.cpp +++ b/src/mame/machine/aim65.cpp @@ -315,8 +315,6 @@ void aim65_state::z32_pa_w( u8 data ) // Display printer output uint32_t aim65_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint16_t data; - for (u8 y = 0; y<cliprect.max_y; y++) { u16 sy = m_printer_y*10 - cliprect.max_y + 10 + y; @@ -324,13 +322,14 @@ uint32_t aim65_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, sy += 0x280; for(u8 x = 0; x < 10; x++) { + uint16_t data; if (!BIT(sy, 0)) data = m_printerRAM[sy * 10 + x]; else data = m_printerRAM[sy * 10 + (9 - x)]; for (u8 b = 0; b < 10; b++) - bitmap.pix16(y, 120 - (b * 12) - ((x > 4) ? x+1 : x)) = BIT(data, b); + bitmap.pix(y, 120 - (b * 12) - ((x > 4) ? x+1 : x)) = BIT(data, b); } } diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp index 0fecabe04f1..13109d4da1f 100644 --- a/src/mame/machine/amstrad.cpp +++ b/src/mame/machine/amstrad.cpp @@ -799,7 +799,7 @@ void amstrad_state::amstrad_plus_update_video_sprites() else horiz = m_asic.h_start; - p = &m_gate_array.bitmap->pix16(m_gate_array.y, horiz ); + p = &m_gate_array.bitmap->pix(m_gate_array.y, horiz ); for ( i = 15 * 8; i >= 0; i -= 8 ) { uint8_t xmag = ( m_asic.ram[ 0x2000 + i + 4 ] >> 2 ) & 0x03; @@ -852,7 +852,7 @@ WRITE_LINE_MEMBER(amstrad_state::amstrad_hsync_changed) m_gate_array.line_ticks = 0; if ( m_gate_array.y >= 0 && m_gate_array.y < m_gate_array.bitmap->height() ) { - m_gate_array.draw_p = &m_gate_array.bitmap->pix16(m_gate_array.y); + m_gate_array.draw_p = &m_gate_array.bitmap->pix(m_gate_array.y); } else { @@ -895,7 +895,7 @@ WRITE_LINE_MEMBER(amstrad_state::amstrad_plus_hsync_changed) m_gate_array.line_ticks = 0; if ( m_gate_array.y >= 0 && m_gate_array.y < m_gate_array.bitmap->height() ) { - m_gate_array.draw_p = &m_gate_array.bitmap->pix16(m_gate_array.y); + m_gate_array.draw_p = &m_gate_array.bitmap->pix(m_gate_array.y); } else { diff --git a/src/mame/machine/apple3.cpp b/src/mame/machine/apple3.cpp index f5849d8ca85..a875d6dfc9e 100644 --- a/src/mame/machine/apple3.cpp +++ b/src/mame/machine/apple3.cpp @@ -680,7 +680,7 @@ uint8_t *apple3_state::apple3_get_indexed_addr(offs_t offset) if ((offset >= 0xFFD0) && (offset <= 0xFFEF)) result = apple3_bankaddr(~0, offset & 0x7FFF); else if (offset < 0x2000) - result = apple3_bankaddr(~0, offset - 0x2000); + result = apple3_bankaddr(~0, offset); else if (offset > 0x9FFF) result = apple3_bankaddr(~0, offset - 0x8000); else @@ -1367,24 +1367,24 @@ WRITE_LINE_MEMBER(apple3_state::a2bus_irq_w) { uint8_t irq_mask = m_a2bus->get_a2bus_irq_mask(); - m_via[0]->write_ca1(state); + m_via[0]->write_ca1(!state); if (irq_mask & (1<<4)) { - m_via[1]->write_pa4(ASSERT_LINE); + m_via[1]->write_pa4(CLEAR_LINE); } else { - m_via[1]->write_pa4(CLEAR_LINE); + m_via[1]->write_pa4(ASSERT_LINE); } if (irq_mask & (1<<3)) { - m_via[1]->write_pa5(ASSERT_LINE); + m_via[1]->write_pa5(CLEAR_LINE); } else { - m_via[1]->write_pa5(CLEAR_LINE); + m_via[1]->write_pa5(ASSERT_LINE); } } diff --git a/src/mame/machine/b2m.cpp b/src/mame/machine/b2m.cpp index 10c892e25db..fae7b699f9c 100644 --- a/src/mame/machine/b2m.cpp +++ b/src/mame/machine/b2m.cpp @@ -280,17 +280,14 @@ void b2m_state::machine_reset() uint32_t b2m_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t code1; - uint8_t code2; - uint8_t col; - int y, x, b; - uint8_t *ram = m_ram->pointer(); + u8 const *const ram = m_ram->pointer(); - for (x = 0; x < 48; x++) + for (int x = 0; x < 48; x++) { - for (y = 0; y < 256; y++) + for (int y = 0; y < 256; y++) { - u16 t = x*256 + ((y + m_video_scroll) & 0xff); + u16 const t = x*256 + ((y + m_video_scroll) & 0xff); + u8 code1, code2; if (m_video_page==0) { code1 = ram[0x11000 + t]; @@ -301,10 +298,10 @@ uint32_t b2m_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c code1 = ram[0x19000 + t]; code2 = ram[0x1d000 + t]; } - for (b = 7; b >= 0; b--) + for (int b = 7; b >= 0; b--) { - col = (BIT(code2, b)<<1) + BIT(code1, b); - bitmap.pix16(y, x*8+b) = col; + u8 const col = (BIT(code2, b)<<1) + BIT(code1, b); + bitmap.pix(y, x*8+b) = col; } } } diff --git a/src/mame/machine/bk.cpp b/src/mame/machine/bk.cpp index cd83484112f..d9c5a7c6907 100644 --- a/src/mame/machine/bk.cpp +++ b/src/mame/machine/bk.cpp @@ -151,15 +151,15 @@ void bk_state::floppy_data_w(uint16_t data) u32 bk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - u16 nOfs = (m_scroll - 728) % 256; + u16 const nOfs = (m_scroll - 728) % 256; for (u16 y = 0; y < 256; y++) { for (u16 x = 0; x < 32; x++) { - u16 code = m_vram[((y+nOfs) %256)*32 + x]; + u16 const code = m_vram[((y+nOfs) %256)*32 + x]; for (u8 b = 0; b < 16; b++) - bitmap.pix16(y, x*16 + b) = BIT(code, b); + bitmap.pix(y, x*16 + b) = BIT(code, b); } } return 0; diff --git a/src/mame/machine/cedar_magnet_plane.cpp b/src/mame/machine/cedar_magnet_plane.cpp index 094d25ddeab..9ecb7a7eea3 100644 --- a/src/mame/machine/cedar_magnet_plane.cpp +++ b/src/mame/machine/cedar_magnet_plane.cpp @@ -140,7 +140,7 @@ u32 cedar_magnet_plane_device::draw(screen_device &screen, bitmap_ind16 &bitmap, for (int y = 0; y < 256;y++) { - u16 *dst = &bitmap.pix16((y - m_scrolly) & 0xff); + u16 *const dst = &bitmap.pix((y - m_scrolly) & 0xff); for (int x = 0; x < 256;x++) { diff --git a/src/mame/machine/cedar_magnet_sprite.cpp b/src/mame/machine/cedar_magnet_sprite.cpp index 3be7bd8466f..0109d59efe0 100644 --- a/src/mame/machine/cedar_magnet_sprite.cpp +++ b/src/mame/machine/cedar_magnet_sprite.cpp @@ -309,7 +309,7 @@ u32 cedar_magnet_sprite_device::draw(screen_device &screen, bitmap_ind16 &bitmap for (int y = 0; y < 256; y++) { - uint16_t *dst = &bitmap.pix16((y) & 0xff); + uint16_t *const dst = &bitmap.pix((y) & 0xff); for (int x = 0; x < 256; x++) { diff --git a/src/mame/machine/concept.cpp b/src/mame/machine/concept.cpp index 83de6b7e48b..ff70dfd656d 100644 --- a/src/mame/machine/concept.cpp +++ b/src/mame/machine/concept.cpp @@ -66,7 +66,7 @@ uint32_t concept_state::screen_update(screen_device &screen, bitmap_ind16 &bitma /* resolution is 720*560 */ for (int y = 0; y < 560; y++) { - uint16_t *line = &bitmap.pix16(560-1-y); + uint16_t *const line = &bitmap.pix(560-1-y); for (int x = 0; x < 720; x++) line[720-1-x] = (m_videoram[(x+48+y*768)>>4] & (0x8000 >> ((x+48+y*768) & 0xf))) ? 1 : 0; } diff --git a/src/mame/machine/dragon.cpp b/src/mame/machine/dragon.cpp index 35f32ef1c31..3499c6553bd 100644 --- a/src/mame/machine/dragon.cpp +++ b/src/mame/machine/dragon.cpp @@ -222,7 +222,7 @@ MC6845_UPDATE_ROW(d64plus_state::crtc_update_row) for (int bit = 0; bit < 8; bit++) { int x = (column * 8) + bit; - bitmap.pix32(y, x) = m_palette->pen(BIT(data, 7) && de); + bitmap.pix(y, x) = m_palette->pen(BIT(data, 7) && de); data <<= 1; } } diff --git a/src/mame/machine/gamepock.cpp b/src/mame/machine/gamepock.cpp index 66de6c28dcb..6b188d2a312 100644 --- a/src/mame/machine/gamepock.cpp +++ b/src/mame/machine/gamepock.cpp @@ -154,14 +154,14 @@ uint32_t gamepock_state::screen_update_gamepock(screen_device &screen, bitmap_in { for ( int j = 0; j < 50; j++ ) { - bitmap.pix16(i * 8 + 0, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x01 ) ? 0 : 1; - bitmap.pix16(i * 8 + 1, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x02 ) ? 0 : 1; - bitmap.pix16(i * 8 + 2, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x04 ) ? 0 : 1; - bitmap.pix16(i * 8 + 3, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x08 ) ? 0 : 1; - bitmap.pix16(i * 8 + 4, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x10 ) ? 0 : 1; - bitmap.pix16(i * 8 + 5, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x20 ) ? 0 : 1; - bitmap.pix16(i * 8 + 6, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x40 ) ? 0 : 1; - bitmap.pix16(i * 8 + 7, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x80 ) ? 0 : 1; + bitmap.pix(i * 8 + 0, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x01 ) ? 0 : 1; + bitmap.pix(i * 8 + 1, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x02 ) ? 0 : 1; + bitmap.pix(i * 8 + 2, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x04 ) ? 0 : 1; + bitmap.pix(i * 8 + 3, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x08 ) ? 0 : 1; + bitmap.pix(i * 8 + 4, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x10 ) ? 0 : 1; + bitmap.pix(i * 8 + 5, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x20 ) ? 0 : 1; + bitmap.pix(i * 8 + 6, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x40 ) ? 0 : 1; + bitmap.pix(i * 8 + 7, 49 - j ) = ( m_hd44102ch[0].ram[ad+j] & 0x80 ) ? 0 : 1; } ad += 0x40; } @@ -172,14 +172,14 @@ uint32_t gamepock_state::screen_update_gamepock(screen_device &screen, bitmap_in { for ( int j = 0; j < 50; j++ ) { - bitmap.pix16(i * 8 + 0, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x01 ) ? 0 : 1; - bitmap.pix16(i * 8 + 1, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x02 ) ? 0 : 1; - bitmap.pix16(i * 8 + 2, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x04 ) ? 0 : 1; - bitmap.pix16(i * 8 + 3, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x08 ) ? 0 : 1; - bitmap.pix16(i * 8 + 4, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x10 ) ? 0 : 1; - bitmap.pix16(i * 8 + 5, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x20 ) ? 0 : 1; - bitmap.pix16(i * 8 + 6, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x40 ) ? 0 : 1; - bitmap.pix16(i * 8 + 7, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x80 ) ? 0 : 1; + bitmap.pix(i * 8 + 0, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x01 ) ? 0 : 1; + bitmap.pix(i * 8 + 1, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x02 ) ? 0 : 1; + bitmap.pix(i * 8 + 2, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x04 ) ? 0 : 1; + bitmap.pix(i * 8 + 3, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x08 ) ? 0 : 1; + bitmap.pix(i * 8 + 4, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x10 ) ? 0 : 1; + bitmap.pix(i * 8 + 5, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x20 ) ? 0 : 1; + bitmap.pix(i * 8 + 6, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x40 ) ? 0 : 1; + bitmap.pix(i * 8 + 7, j ) = ( m_hd44102ch[1].ram[ad+j] & 0x80 ) ? 0 : 1; } ad += 0x40; } @@ -190,25 +190,25 @@ uint32_t gamepock_state::screen_update_gamepock(screen_device &screen, bitmap_in { for ( int j = 0; j < 25; j++ ) { - bitmap.pix16(i * 8 + 0, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x01 ) ? 0 : 1; - bitmap.pix16(i * 8 + 1, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x02 ) ? 0 : 1; - bitmap.pix16(i * 8 + 2, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x04 ) ? 0 : 1; - bitmap.pix16(i * 8 + 3, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x08 ) ? 0 : 1; - bitmap.pix16(i * 8 + 4, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x10 ) ? 0 : 1; - bitmap.pix16(i * 8 + 5, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x20 ) ? 0 : 1; - bitmap.pix16(i * 8 + 6, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x40 ) ? 0 : 1; - bitmap.pix16(i * 8 + 7, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x80 ) ? 0 : 1; + bitmap.pix(i * 8 + 0, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x01 ) ? 0 : 1; + bitmap.pix(i * 8 + 1, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x02 ) ? 0 : 1; + bitmap.pix(i * 8 + 2, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x04 ) ? 0 : 1; + bitmap.pix(i * 8 + 3, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x08 ) ? 0 : 1; + bitmap.pix(i * 8 + 4, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x10 ) ? 0 : 1; + bitmap.pix(i * 8 + 5, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x20 ) ? 0 : 1; + bitmap.pix(i * 8 + 6, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x40 ) ? 0 : 1; + bitmap.pix(i * 8 + 7, 50 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x80 ) ? 0 : 1; } for ( int j = 25; j < 50; j++ ) { - bitmap.pix16(32 + i * 8 + 0, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x01 ) ? 0 : 1; - bitmap.pix16(32 + i * 8 + 1, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x02 ) ? 0 : 1; - bitmap.pix16(32 + i * 8 + 2, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x04 ) ? 0 : 1; - bitmap.pix16(32 + i * 8 + 3, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x08 ) ? 0 : 1; - bitmap.pix16(32 + i * 8 + 4, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x10 ) ? 0 : 1; - bitmap.pix16(32 + i * 8 + 5, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x20 ) ? 0 : 1; - bitmap.pix16(32 + i * 8 + 6, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x40 ) ? 0 : 1; - bitmap.pix16(32 + i * 8 + 7, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x80 ) ? 0 : 1; + bitmap.pix(32 + i * 8 + 0, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x01 ) ? 0 : 1; + bitmap.pix(32 + i * 8 + 1, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x02 ) ? 0 : 1; + bitmap.pix(32 + i * 8 + 2, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x04 ) ? 0 : 1; + bitmap.pix(32 + i * 8 + 3, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x08 ) ? 0 : 1; + bitmap.pix(32 + i * 8 + 4, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x10 ) ? 0 : 1; + bitmap.pix(32 + i * 8 + 5, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x20 ) ? 0 : 1; + bitmap.pix(32 + i * 8 + 6, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x40 ) ? 0 : 1; + bitmap.pix(32 + i * 8 + 7, 25 + j ) = ( m_hd44102ch[2].ram[ad+j] & 0x80 ) ? 0 : 1; } ad += 0x40; } diff --git a/src/mame/machine/imds2ioc.cpp b/src/mame/machine/imds2ioc.cpp index fc9c7a25dd9..1f8008b48b2 100644 --- a/src/mame/machine/imds2ioc.cpp +++ b/src/mame/machine/imds2ioc.cpp @@ -347,9 +347,8 @@ WRITE_LINE_MEMBER(imds2ioc_device::pio_lpt_select_w) I8275_DRAW_CHARACTER_MEMBER(imds2ioc_device::crtc_display_pixels) { - unsigned i; - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint8_t chargen_byte = m_chargen[ (linecount & 7) | ((unsigned)charcode << 3) ]; + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint8_t const chargen_byte = m_chargen[ (linecount & 7) | ((unsigned)charcode << 3) ]; uint16_t pixels; if (lten) { @@ -392,8 +391,8 @@ I8275_DRAW_CHARACTER_MEMBER(imds2ioc_device::crtc_display_pixels) pixels = ~pixels; } - for (i = 0; i < 14; i++) { - bitmap.pix32(y, x + i) = palette[ (pixels & (1U << (13 - i))) != 0 ]; + for (unsigned i = 0; i < 14; i++) { + bitmap.pix(y, x + i) = palette[ (pixels & (1U << (13 - i))) != 0 ]; } } diff --git a/src/mame/machine/inder_vid.cpp b/src/mame/machine/inder_vid.cpp index e5005ea52b3..ea501338fe2 100644 --- a/src/mame/machine/inder_vid.cpp +++ b/src/mame/machine/inder_vid.cpp @@ -36,17 +36,16 @@ void inder_vid_device::megaphx_tms_map(address_map &map) TMS340X0_SCANLINE_RGB32_CB_MEMBER(inder_vid_device::scanline) { - uint16_t *vram = &m_vram[(params->rowaddr << 8) & 0x3ff00]; - uint32_t *dest = &bitmap.pix32(scanline); + uint16_t const *const vram = &m_vram[(params->rowaddr << 8) & 0x3ff00]; + uint32_t *const dest = &bitmap.pix(scanline); const pen_t *paldata = m_palette->pens(); int coladdr = params->coladdr; - int x; if (m_bpp_mode == 8) { - for (x = params->heblnk; x < params->hsblnk; x += 2) + for (int x = params->heblnk; x < params->hsblnk; x += 2) { uint16_t pixels = vram[coladdr++ & 0xff]; dest[x + 0] = paldata[pixels & 0xff]; @@ -55,7 +54,7 @@ TMS340X0_SCANLINE_RGB32_CB_MEMBER(inder_vid_device::scanline) } else if (m_bpp_mode == 4) { - for (x = params->heblnk; x < params->hsblnk; x += 4) + for (int x = params->heblnk; x < params->hsblnk; x += 4) { uint16_t pixels = vram[coladdr++ & 0xff]; dest[x + 3] = paldata[((pixels & 0xf000) >> 12)]; diff --git a/src/mame/machine/lynx.cpp b/src/mame/machine/lynx.cpp index 0ea49c13a12..7da6ae8f077 100644 --- a/src/mame/machine/lynx.cpp +++ b/src/mame/machine/lynx.cpp @@ -1310,7 +1310,7 @@ void lynx_state::lynx_draw_line() if (m_mikey.data[0x92] & 0x02) { j -= 160 * 102 / 2 - 1; - uint32_t *const line = &m_bitmap_temp.pix32(102 - 1 - y); + uint32_t *const line = &m_bitmap_temp.pix(102 - 1 - y); for (int x = 160 - 2; x >= 0; j++, x -= 2) { uint8_t const byte = lynx_read_ram(j); @@ -1320,7 +1320,7 @@ void lynx_state::lynx_draw_line() } else { - uint32_t *const line = &m_bitmap_temp.pix32(y); + uint32_t *const line = &m_bitmap_temp.pix(y); for (int x = 0; x < 160; j++, x += 2) { uint8_t const byte = lynx_read_ram(j); diff --git a/src/mame/machine/m6502_swap_op_d5_d6.cpp b/src/mame/machine/m6502_swap_op_d5_d6.cpp index d3c661f8c2b..df832634684 100644 --- a/src/mame/machine/m6502_swap_op_d5_d6.cpp +++ b/src/mame/machine/m6502_swap_op_d5_d6.cpp @@ -4,10 +4,13 @@ m6502_swap_op_d5_d6.cpp - 6502 with instruction scrambling + 6502 / N2A03 with instruction scrambling Seen on die marked VH2009, used on polmega, silv35 - but also elsewhere + these are N2A03 derived CPUs used on VTxx systems + + VT1682 systems with this scrambling currently derive from M6502 type + but this might be incorrect ***************************************************************************/ @@ -15,6 +18,7 @@ #include "m6502_swap_op_d5_d6.h" DEFINE_DEVICE_TYPE(M6502_SWAP_OP_D5_D6, m6502_swap_op_d5_d6, "m6502_swap_op_d5_d6", "M6502 swapped D5/D6") +DEFINE_DEVICE_TYPE(N2A03_CORE_SWAP_OP_D5_D6, n2a03_core_swap_op_d5_d6, "n2a03_core_swap_op_d5_d6", "N2A03 core with swapped D5/D6") m6502_swap_op_d5_d6::m6502_swap_op_d5_d6(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : m6502_device(mconfig, M6502_SWAP_OP_D5_D6, tag, owner, clock) @@ -64,3 +68,57 @@ u8 m6502_swap_op_d5_d6::disassembler::decrypt8(u8 value, offs_t pc, bool opcode) { return opcode ? mintf->descramble(value) : value; } + + + + + +n2a03_core_swap_op_d5_d6::n2a03_core_swap_op_d5_d6(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + n2a03_core_device(mconfig, N2A03_CORE_SWAP_OP_D5_D6, tag, owner, clock) +{ +} + +void n2a03_core_swap_op_d5_d6::device_start() +{ + mintf = std::make_unique<mi_decrypt>(); + init(); +} + +void n2a03_core_swap_op_d5_d6::device_reset() +{ + n2a03_core_device::device_reset(); +} + +uint8_t n2a03_core_swap_op_d5_d6::mi_decrypt::descramble(uint8_t op) +{ + return bitswap<8>(op, 7, 5, 6, 4, 3, 2, 1, 0); +} + +uint8_t n2a03_core_swap_op_d5_d6::mi_decrypt::read_sync(uint16_t adr) +{ + uint8_t res = cprogram.read_byte(adr); + + res = descramble(res); + + return res; +} + +std::unique_ptr<util::disasm_interface> n2a03_core_swap_op_d5_d6::create_disassembler() +{ + return std::make_unique<disassembler>(downcast<mi_decrypt *>(mintf.get())); +} + +n2a03_core_swap_op_d5_d6::disassembler::disassembler(mi_decrypt *mi) : mintf(mi) +{ +} + +u32 n2a03_core_swap_op_d5_d6::disassembler::interface_flags() const +{ + return SPLIT_DECRYPTION; +} + +u8 n2a03_core_swap_op_d5_d6::disassembler::decrypt8(u8 value, offs_t pc, bool opcode) const +{ + return opcode ? mintf->descramble(value) : value; +} + diff --git a/src/mame/machine/m6502_swap_op_d5_d6.h b/src/mame/machine/m6502_swap_op_d5_d6.h index efcd4a69c17..aec61cf077f 100644 --- a/src/mame/machine/m6502_swap_op_d5_d6.h +++ b/src/mame/machine/m6502_swap_op_d5_d6.h @@ -4,7 +4,7 @@ m6502_swap_op_d5_d6.h - 6502 with instruction scrambling + 6502 / N2A03 with instruction scrambling ***************************************************************************/ @@ -13,8 +13,8 @@ #pragma once -#include "cpu/m6502/m6502.h" -#include "cpu/m6502/m6502d.h" +#include "cpu/m6502/n2a03.h" +#include "cpu/m6502/n2a03d.h" class m6502_swap_op_d5_d6 : public m6502_device { public: @@ -24,9 +24,6 @@ protected: class mi_decrypt : public mi_default { public: - bool m_scramble_en = false; - bool m_next_scramble = false; - virtual ~mi_decrypt() {} virtual uint8_t read_sync(uint16_t adr) override; @@ -48,6 +45,37 @@ protected: virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; }; +class n2a03_core_swap_op_d5_d6 : public n2a03_core_device { +public: + n2a03_core_swap_op_d5_d6(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + class mi_decrypt : public mi_default { + public: + + virtual ~mi_decrypt() {} + virtual uint8_t read_sync(uint16_t adr) override; + + uint8_t descramble(uint8_t op); + }; + + class disassembler : public n2a03_disassembler { + public: + mi_decrypt *mintf; + + disassembler(mi_decrypt *m); + virtual ~disassembler() = default; + virtual u32 interface_flags() const override; + virtual u8 decrypt8(u8 value, offs_t pc, bool opcode) const override; + }; + + virtual void device_reset() override; + virtual void device_start() override; + virtual std::unique_ptr<util::disasm_interface> create_disassembler() override; +}; + + DECLARE_DEVICE_TYPE(M6502_SWAP_OP_D5_D6, m6502_swap_op_d5_d6) +DECLARE_DEVICE_TYPE(N2A03_CORE_SWAP_OP_D5_D6, n2a03_core_swap_op_d5_d6) #endif // MAME_M6502_SWAP_OP_D5_D6_H diff --git a/src/mame/machine/mega32x.cpp b/src/mame/machine/mega32x.cpp index b8607d8506a..40af33a6965 100644 --- a/src/mame/machine/mega32x.cpp +++ b/src/mame/machine/mega32x.cpp @@ -935,13 +935,10 @@ void sega_32x_device::m68k_pwm_w(offs_t offset, uint16_t data) pwm_w(offset,data); } -void sega_32x_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) +void sega_32x_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) { - for (int s = 0; s < samples; s++) - { - outputs[0][s] = inputs[0][s]; - outputs[1][s] = inputs[1][s]; - } + outputs[0] = inputs[0]; + outputs[1] = inputs[1]; } /**********************************************************************************************/ @@ -1742,7 +1739,7 @@ void sega_32x_device::device_start() set_pen_color(i, pal5bit(r), pal5bit(g), pal5bit(b)); } - m_stream = stream_alloc_legacy(2, 2, 48000 * 4); + m_stream = stream_alloc(2, 2, 48000 * 4); m_32x_pwm_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sega_32x_device::handle_pwm_callback), this)); m_32x_dram0 = std::make_unique<uint16_t[]>(0x40000/2); diff --git a/src/mame/machine/mega32x.h b/src/mame/machine/mega32x.h index e56db24fdb3..51cdf07ad47 100644 --- a/src/mame/machine/mega32x.h +++ b/src/mame/machine/mega32x.h @@ -110,7 +110,7 @@ protected: virtual uint32_t palette_entries() const override { return 32*32*32/**2*/; } // device_sound_interface overrides - virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override; + virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override; void update_total_scanlines(bool mode3) { m_total_scanlines = mode3 ? (m_base_total_scanlines * 2) : m_base_total_scanlines; } // this gets set at each EOF diff --git a/src/mame/machine/megacd.cpp b/src/mame/machine/megacd.cpp index d0b53d9b595..0fefc92c4b6 100644 --- a/src/mame/machine/megacd.cpp +++ b/src/mame/machine/megacd.cpp @@ -1473,7 +1473,7 @@ inline uint8_t sega_segacd_device::read_pixel_from_stampmap(bitmap_ind16* srcbit if (x >= srcbitmap->width) return 0; if (y >= srcbitmap->height) return 0; - uint16_t* cacheptr = &srcbitmap->pix16(y, x); + uint16_t* cacheptr = &srcbitmap->pix(y, x); return cacheptr[0] & 0xf; */ diff --git a/src/mame/machine/megadriv.cpp b/src/mame/machine/megadriv.cpp index b9fb9ec504d..2a277d83789 100644 --- a/src/mame/machine/megadriv.cpp +++ b/src/mame/machine/megadriv.cpp @@ -764,11 +764,11 @@ uint32_t md_base_state::screen_update_megadriv(screen_device &screen, bitmap_rgb /* Copy our screen buffer here */ for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - uint32_t* desty = &bitmap.pix32(y, 0); - uint32_t* srcy; + uint32_t *const desty = &bitmap.pix(y, 0); + uint32_t const *srcy; if (!m_vdp->m_use_alt_timing) - srcy = &m_vdp->m_render_bitmap->pix32(y, 0); + srcy = &m_vdp->m_render_bitmap->pix(y, 0); else srcy = m_vdp->m_render_line.get(); diff --git a/src/mame/machine/model1io2.cpp b/src/mame/machine/model1io2.cpp index f47a5b3bda2..9ff771dbcc2 100644 --- a/src/mame/machine/model1io2.cpp +++ b/src/mame/machine/model1io2.cpp @@ -282,7 +282,7 @@ HD44780_PIXEL_UPDATE( model1io2_device::lcd_pixel_update ) return; if (line < 2 && pos < 20) - bitmap.pix16(1 + y + line*8 + line, 1 + pos*6 + x) = state ? 1 : 2; + bitmap.pix(1 + y + line*8 + line, 1 + pos*6 + x) = state ? 1 : 2; } diff --git a/src/mame/machine/nes_vt_soc.cpp b/src/mame/machine/nes_vt_soc.cpp index 1237c4e3584..f3ee35252ff 100644 --- a/src/mame/machine/nes_vt_soc.cpp +++ b/src/mame/machine/nes_vt_soc.cpp @@ -473,7 +473,7 @@ uint8_t nes_vt_soc_device::spr_r(offs_t offset) uint8_t nes_vt_soc_device::chr_r(offs_t offset) { - if (m_4242 & 0x1 || m_411d & 0x04) + if (m_4242 & 0x1 || m_411d & 0x04) // newer VT platforms only (not VT03/09), split out { return m_chrram[offset]; } @@ -489,11 +489,18 @@ uint8_t nes_vt_soc_device::chr_r(offs_t offset) void nes_vt_soc_device::chr_w(offs_t offset, uint8_t data) { - if (m_4242 & 0x1 || m_411d & 0x04) + if (m_4242 & 0x1 || m_411d & 0x04) // newer VT platforms only (not VT03/09), split out { logerror("vram write %04x %02x\n", offset, data); m_chrram[offset] = data; } + else + { + int realaddr = calculate_real_video_address(offset, 1, 0); + + address_space& spc = this->space(AS_PROGRAM); + return spc.write_byte(realaddr, data); + } } @@ -775,7 +782,7 @@ void nes_vt_soc_device::scrambled_8000_w(uint16_t offset, uint8_t data) offset &= 0x7fff; uint16_t addr = offset+0x8000; - if ((m_411d & 0x01) && (m_411d & 0x03)) + if ((m_411d & 0x01) && (m_411d & 0x03)) // this condition is nonsense, maybe should be ((m_411d & 0x03) == 0x03) check it! (newer VT only, not VT03/09, split) { //CNROM compat logerror("%s: vtxx_cnrom_8000_w real address: (%04x) translated address: (%04x) %02x\n", machine().describe_context(), addr, offset + 0x8000, data); @@ -787,13 +794,13 @@ void nes_vt_soc_device::scrambled_8000_w(uint16_t offset, uint8_t data) m_ppu->set_201x_reg(0x5, data * 8 + 7); } - else if (m_411d & 0x01) + else if (m_411d & 0x01) // (newer VT only, not VT03/09, split) { //MMC1 compat, TODO logerror("%s: vtxx_mmc1_8000_w real address: (%04x) translated address: (%04x) %02x\n", machine().describe_context(), addr, offset + 0x8000, data); } - else if (m_411d & 0x02) + else if (m_411d & 0x02) // (newer VT only, not VT03/09, split) { //UNROM compat logerror("%s: vtxx_unrom_8000_w real address: (%04x) translated address: (%04x) %02x\n", machine().describe_context(), addr, offset + 0x8000, data); @@ -802,7 +809,7 @@ void nes_vt_soc_device::scrambled_8000_w(uint16_t offset, uint8_t data) m_410x[0x8] = ((data & 0x0F) << 1) + 1; update_banks(); } - else + else // standard mode (VT03/09) { //logerror("%s: vtxx_mmc3_8000_w real address: (%04x) translated address: (%04x) %02x\n", machine().describe_context(), addr, offset+0x8000, data ); @@ -1214,7 +1221,7 @@ void nes_vt_soc_device::do_pal_timings_and_ppu_replacement(machine_config& confi void nes_vt_soc_device::device_add_mconfig(machine_config &config) { - M6502(config, m_maincpu, NTSC_APU_CLOCK); + N2A03_CORE(config, m_maincpu, NTSC_APU_CLOCK); // Butterfly Catch in vgpocket confirms N2A03 core type, not 6502 m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_soc_device::nes_vt_map); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -1235,11 +1242,7 @@ void nes_vt_soc_device::device_add_mconfig(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - /* this should actually be a custom *almost* doubled up APU, however requires more thought - than just using 2 APUs as registers in the 2nd one affect the PCM channel mode but the - DMA control still comes from the 1st, but in the new mode, sound always outputs via the - 2nd. Probably need to split the APU into interface and sound gen logic. */ - NES_APU(config, m_apu, NTSC_APU_CLOCK); + NES_APU_VT(config, m_apu, NTSC_APU_CLOCK); m_apu->irq().set(FUNC(nes_vt_soc_device::apu_irq)); m_apu->mem_read().set(FUNC(nes_vt_soc_device::apu_read_mem)); m_apu->add_route(ALL_OUTPUTS, "mono", 0.50); @@ -1260,7 +1263,7 @@ void nes_vt_soc_scramble_device::device_add_mconfig(machine_config& config) { nes_vt_soc_device::device_add_mconfig(config); - M6502_SWAP_OP_D5_D6(config.replace(), m_maincpu, NTSC_APU_CLOCK); + N2A03_CORE_SWAP_OP_D5_D6(config.replace(), m_maincpu, NTSC_APU_CLOCK); // Insect Chase in polmega confirms N2A03 core type, not 6502 m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_soc_scramble_device::nes_vt_map); } @@ -1461,7 +1464,7 @@ void nes_vt_soc_4kram_fp_device::device_add_mconfig(machine_config& config) { nes_vt_soc_device::device_add_mconfig(config); - M6502_VTSCR(config.replace(), m_maincpu, NTSC_APU_CLOCK); + M6502_VTSCR(config.replace(), m_maincpu, NTSC_APU_CLOCK); // are these later chips N2A03 core, or 6502 core derived? m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_soc_4kram_fp_device::nes_vt_fp_map); } diff --git a/src/mame/machine/nes_vt_soc.h b/src/mame/machine/nes_vt_soc.h index c6695ecf812..18efbcb993f 100644 --- a/src/mame/machine/nes_vt_soc.h +++ b/src/mame/machine/nes_vt_soc.h @@ -7,6 +7,7 @@ #pragma once #include "cpu/m6502/n2a03.h" +#include "sound/nes_apu_vt.h" #include "machine/m6502_vtscr.h" #include "machine/m6502_swap_op_d5_d6.h" #include "video/ppu2c0x_vt.h" @@ -67,7 +68,7 @@ protected: required_device<cpu_device> m_maincpu; required_device<screen_device> m_screen; required_device<ppu_vt03_device> m_ppu; - required_device<nesapu_device> m_apu; + required_device<nes_apu_vt_device> m_apu; void nes_vt_map(address_map& map); diff --git a/src/mame/machine/nl_tank.cpp b/src/mame/machine/nl_tank.cpp index 152d7fe01d3..3885aa7a0fd 100644 --- a/src/mame/machine/nl_tank.cpp +++ b/src/mame/machine/nl_tank.cpp @@ -230,14 +230,15 @@ NETLIST_START(tank) QBJT_EB(Q4, "2N3643") QBJT_EB(Q6, "2N3644") QBJT_EB(Q7, "2N3644") - QBJT_EB(Q27, "2N3643") - QBJT_EB(Q28, "2N3644") - QBJT_EB(Q29, "2N3643") - QBJT_EB(Q30, "2N3644") - QBJT_EB(Q31, "2N3643") - QBJT_EB(Q32, "2N3644") - QBJT_EB(Q33, "2N3643") - QBJT_EB(Q34, "2N3644") +// Currently not used +// QBJT_EB(Q27, "2N3643") +// QBJT_EB(Q28, "2N3644") +// QBJT_EB(Q29, "2N3643") +// QBJT_EB(Q30, "2N3644") +// QBJT_EB(Q31, "2N3643") +// QBJT_EB(Q32, "2N3644") +// QBJT_EB(Q33, "2N3643") +// QBJT_EB(Q34, "2N3644") TTL_7404_DIP(IC_H3) TTL_7400_DIP(IC_B6) diff --git a/src/mame/machine/osborne1.cpp b/src/mame/machine/osborne1.cpp index 932cabea96b..0b18cfe1193 100644 --- a/src/mame/machine/osborne1.cpp +++ b/src/mame/machine/osborne1.cpp @@ -382,7 +382,7 @@ inline void osborne1_state::draw_rows(uint16_t col, bitmap_ind16 &bitmap, const // Draw a line of the display u8 const ra(y % 10); - uint16_t *p(&bitmap.pix16(y)); + uint16_t *p(&bitmap.pix(y)); uint16_t const row(((m_scroll_y + (y / 10)) << 7) & 0x0F80); for (uint16_t x = 0; Width > x; ++x) @@ -539,7 +539,7 @@ MC6845_UPDATE_ROW(osborne1nv_state::crtc_update_row) { rgb_t const *const palette = m_palette->palette()->entry_list_raw(); uint16_t const base = (ma >> 1) & 0xF80; - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); for (u8 x = 0; x < x_count; ++x) { uint16_t const offset = base | ((ma + x) & 0x7F); diff --git a/src/mame/machine/partner.cpp b/src/mame/machine/partner.cpp index 69f9c201922..0bcc83d5f0a 100644 --- a/src/mame/machine/partner.cpp +++ b/src/mame/machine/partner.cpp @@ -343,9 +343,8 @@ void partner_state::mem_page_w(u8 data) I8275_DRAW_CHARACTER_MEMBER(partner_state::display_pixels) { - int i; - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - const u8 *charmap = m_chargen + 0x400 * (gpa * 2 + hlgt); + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + u8 const *const charmap = m_chargen + 0x400 * (gpa * 2 + hlgt); u8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; if (vsp) pixels = 0; @@ -356,8 +355,8 @@ I8275_DRAW_CHARACTER_MEMBER(partner_state::display_pixels) if (rvv) pixels ^= 0xff; - for(i=0;i<6;i++) - bitmap.pix32(y, x + i) = palette[(pixels >> (5-i)) & 1]; + for(int i=0;i<6;i++) + bitmap.pix(y, x + i) = palette[(pixels >> (5-i)) & 1]; } void partner_state::machine_reset() diff --git a/src/mame/machine/primo.cpp b/src/mame/machine/primo.cpp index 6c76a961e6d..ad4989257f8 100644 --- a/src/mame/machine/primo.cpp +++ b/src/mame/machine/primo.cpp @@ -340,7 +340,7 @@ u32 primo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, cons for (u8 y = 0; y < 192; y++) { - u16 *p = &bitmap.pix16(y); + u16 *p = &bitmap.pix(y); for (u16 x = 0; x < 32; x++) { u8 data = m_vram[ma+x]; diff --git a/src/mame/machine/radio86.cpp b/src/mame/machine/radio86.cpp index 14517a58409..577d141815e 100644 --- a/src/mame/machine/radio86.cpp +++ b/src/mame/machine/radio86.cpp @@ -217,7 +217,7 @@ I8275_DRAW_CHARACTER_MEMBER(radio86_state::display_pixels) pixels ^= 0xff; for (u8 i = 0; i < 6; i++) - bitmap.pix32(y, x + i) = palette[(pixels >> (5-i)) & 1 ? (hlgt ? 2 : 1) : 0]; + bitmap.pix(y, x + i) = palette[(pixels >> (5-i)) & 1 ? (hlgt ? 2 : 1) : 0]; } static constexpr rgb_t radio86_pens[3] = { diff --git a/src/mame/machine/sms.cpp b/src/mame/machine/sms.cpp index 62baaccc2b6..402d9b8a78b 100644 --- a/src/mame/machine/sms.cpp +++ b/src/mame/machine/sms.cpp @@ -1433,7 +1433,7 @@ void gamegear_state::screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rg if (sms_y2 >= vdp_bitmap.cliprect().min_y && sms_y2 <= vdp_bitmap.cliprect().max_y) { - uint32_t *vdp_buffer = &vdp_bitmap.pix32(sms_y2); + uint32_t *const vdp_buffer = &vdp_bitmap.pix(sms_y2); int sms_x = sms_min_x; int x_min_i = plot_min_x - plot_x_first_group; @@ -1496,7 +1496,7 @@ void gamegear_state::screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rg line3 = m_line_buffer.get() + ((sms_y + y_i + 1) & 0x03) * 160; line4 = m_line_buffer.get() + ((sms_y + y_i + 2) & 0x03) * 160; - uint32_t *p_bitmap = &bitmap.pix32(visarea.min_y + plot_y_group + y_i, visarea.min_x); + uint32_t *const p_bitmap = &bitmap.pix(visarea.min_y + plot_y_group + y_i, visarea.min_x); for (int plot_x = plot_min_x; plot_x <= plot_max_x; plot_x++) { @@ -1555,9 +1555,9 @@ uint32_t gamegear_state::screen_update_gamegear(screen_device &screen, bitmap_rg // (it would be better to generalize this in the core, to be used for all LCD systems) for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - uint32_t *linedst = &bitmap.pix32(y); - uint32_t *line0 = &source_bitmap->pix32(y); - uint32_t *line1 = &m_prev_bitmap.pix32(y); + uint32_t *const linedst = &bitmap.pix(y); + uint32_t const *const line0 = &source_bitmap->pix(y); + uint32_t const *const line1 = &m_prev_bitmap.pix(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { uint32_t color0 = line0[x]; @@ -1568,9 +1568,9 @@ uint32_t gamegear_state::screen_update_gamegear(screen_device &screen, bitmap_rg uint16_t r1 = (color1 >> 16) & 0x000000ff; uint16_t g1 = (color1 >> 8) & 0x000000ff; uint16_t b1 = (color1 >> 0) & 0x000000ff; - uint8_t r = (uint8_t)((r0 + r1) >> 1); - uint8_t g = (uint8_t)((g0 + g1) >> 1); - uint8_t b = (uint8_t)((b0 + b1) >> 1); + uint8_t r = uint8_t((r0 + r1) >> 1); + uint8_t g = uint8_t((g0 + g1) >> 1); + uint8_t b = uint8_t((b0 + b1) >> 1); linedst[x] = (r << 16) | (g << 8) | b; } } diff --git a/src/mame/machine/st0016.cpp b/src/mame/machine/st0016.cpp index 30ea3f738e6..f4cafda3f71 100644 --- a/src/mame/machine/st0016.cpp +++ b/src/mame/machine/st0016.cpp @@ -511,7 +511,7 @@ void st0016_cpu_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip if (!flipy) { drawypos = ypos + yloop; } else { drawypos = (ypos + 8 - 1) - yloop; } - destline = &bitmap.pix16(drawypos); + destline = &bitmap.pix(drawypos); for (xloop = 0; xloop<8; xloop++) { @@ -654,7 +654,7 @@ void st0016_cpu_device::draw_bgmap(bitmap_ind16 &bitmap, const rectangle &clipre if (!flipy) { drawypos = ypos + yloop; } else { drawypos = (ypos + 8 - 1) - yloop; } - destline = &bitmap.pix16(drawypos); + destline = &bitmap.pix(drawypos); for (xloop = 0; xloop<8; xloop++) { diff --git a/src/mame/machine/teleprinter.cpp b/src/mame/machine/teleprinter.cpp index 8ef1576a2c2..75b1654a7ef 100644 --- a/src/mame/machine/teleprinter.cpp +++ b/src/mame/machine/teleprinter.cpp @@ -187,20 +187,17 @@ void teleprinter_device::term_write(uint8_t data) ***************************************************************************/ uint32_t teleprinter_device::tp_update(screen_device &device, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - uint8_t code; - int y, c, x, b; - - for (y = 0; y < m_height; y++) + for (int y = 0; y < m_height; y++) { - for (c = 0; c < 8; c++) + for (int c = 0; c < 8; c++) { int horpos = 0; - for (x = 0; x < m_width; x++) + for (int x = 0; x < m_width; x++) { - code = teleprinter_font[(m_buffer[y*m_width + x] & 0x7f) *8 + c]; - for (b = 0; b < 8; b++) + uint8_t code = teleprinter_font[(m_buffer[y*m_width + x] & 0x7f) *8 + c]; + for (int b = 0; b < 8; b++) { - bitmap.pix32(y*8 + c, horpos++) = (code >> b) & 0x01 ? 0 : 0x00ffffff; + bitmap.pix(y*8 + c, horpos++) = (code >> b) & 0x01 ? 0 : 0x00ffffff; } } } diff --git a/src/mame/machine/zx.cpp b/src/mame/machine/zx.cpp index a42a9244108..df7318a34c2 100644 --- a/src/mame/machine/zx.cpp +++ b/src/mame/machine/zx.cpp @@ -70,19 +70,19 @@ void zx_state::drop_sync() xe = 0; } if(ys == ye) { - uint16_t *dest = &m_bitmap_render->pix16(ys, xs); + uint16_t *dest = &m_bitmap_render->pix(ys, xs); for(int x = xs; x < xe; x++) *dest++ = 1; } else { - uint16_t *dest = &m_bitmap_render->pix16(ys, xs); + uint16_t *dest = &m_bitmap_render->pix(ys, xs); for(int x = xs; x < 384; x++) *dest++ = 1; for(int y = ys+1; y < ye; y++) { - dest = &m_bitmap_render->pix16(y, 0); + dest = &m_bitmap_render->pix(y, 0); for(int x = 0; x<384; x++) *dest++ = 1; } - dest = &m_bitmap_render->pix16(ye, 0); + dest = &m_bitmap_render->pix(ye, 0); for(int x = 0; x < xe; x++) *dest++ = 1; } |