diff options
Diffstat (limited to 'src/devices/bus/isa')
-rw-r--r-- | src/devices/bus/isa/aga.cpp | 20 | ||||
-rw-r--r-- | src/devices/bus/isa/cga.cpp | 690 | ||||
-rw-r--r-- | src/devices/bus/isa/ega.cpp | 13 | ||||
-rw-r--r-- | src/devices/bus/isa/eis_hgb107x.cpp | 21 | ||||
-rw-r--r-- | src/devices/bus/isa/ex1280.cpp | 8 | ||||
-rw-r--r-- | src/devices/bus/isa/gus.cpp | 25 | ||||
-rw-r--r-- | src/devices/bus/isa/gus.h | 2 | ||||
-rw-r--r-- | src/devices/bus/isa/mach32.cpp | 17 | ||||
-rw-r--r-- | src/devices/bus/isa/mda.cpp | 280 | ||||
-rw-r--r-- | src/devices/bus/isa/num9rev.cpp | 4 | ||||
-rw-r--r-- | src/devices/bus/isa/pgc.cpp | 7 | ||||
-rw-r--r-- | src/devices/bus/isa/trident.cpp | 27 |
12 files changed, 547 insertions, 567 deletions
diff --git a/src/devices/bus/isa/aga.cpp b/src/devices/bus/isa/aga.cpp index 244fbc0bb66..81e6ba053fe 100644 --- a/src/devices/bus/isa/aga.cpp +++ b/src/devices/bus/isa/aga.cpp @@ -288,7 +288,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::mda_text_inten_update_row ) { rgb_t const *const palette = m_palette->palette()->entry_list_raw(); uint8_t const *const videoram = m_videoram.get(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); uint16_t const chr_base = (ra & 0x08) ? 0x800 | (ra & 0x07) : ra; if (y == 0) logerror("mda_text_inten_update_row\n"); @@ -345,7 +345,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::mda_text_blink_update_row ) { uint8_t const *const videoram = m_videoram.get(); rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); uint16_t const chr_base = (ra & 0x08) ? 0x800 | (ra & 0x07) : ra; if (y == 0) logerror("mda_text_blink_update_row\n"); @@ -402,7 +402,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_update_row ) { uint8_t const *const videoram = m_videoram.get(); rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); if (y == 0) logerror("cga_text_inten_update_row\n"); for (int i = 0; i < x_count; i++) { @@ -431,7 +431,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_alt_update_row ) { rgb_t const *const palette = m_palette->palette()->entry_list_raw(); uint8_t const *const videoram = m_videoram.get(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); if (y == 0) logerror("cga_text_inten_alt_update_row\n"); for (int i = 0; i < x_count; i++) { @@ -459,7 +459,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_update_row ) { rgb_t const *const palette = m_palette->palette()->entry_list_raw(); uint8_t const *const videoram = m_videoram.get(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); for (int i = 0; i < x_count; i++) { uint16_t const offset = ((ma + i) << 1) & 0x3fff; @@ -491,7 +491,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_alt_update_row ) { rgb_t const *const palette = m_palette->palette()->entry_list_raw(); uint8_t const *const videoram = m_videoram.get(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); if (y == 0) logerror("cga_text_blink_alt_update_row\n"); for (int i = 0; i < x_count; i++) { @@ -526,7 +526,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bppl_update_row ) { rgb_t const *const palette = m_palette->palette()->entry_list_raw(); uint8_t const *const videoram = m_videoram.get(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); if (y == 0) logerror("cga_gfx_4bppl_update_row\n"); for (int i = 0; i < x_count; i++) { @@ -551,7 +551,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bpph_update_row ) { uint8_t const *const videoram = m_videoram.get(); rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); if (y == 0) logerror("cga_gfx_4bpph_update_row\n"); for (int i = 0; i < x_count; i++) { @@ -584,7 +584,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_2bpp_update_row ) { uint8_t const *const videoram = m_videoram.get(); rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); //if (y == 0) logerror("cga_gfx_2bpp_update_row\n"); for (int i = 0; i < x_count; i++) { @@ -609,7 +609,7 @@ MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_1bpp_update_row ) { uint8_t const *const videoram = m_videoram.get(); rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); + uint32_t *p = &bitmap.pix(y); uint8_t const fg = m_cga_color_select & 0x0f; if (y == 0) logerror("cga_gfx_1bpp_update_row\n"); diff --git a/src/devices/bus/isa/cga.cpp b/src/devices/bus/isa/cga.cpp index ff30f3690ad..52a0407f065 100644 --- a/src/devices/bus/isa/cga.cpp +++ b/src/devices/bus/isa/cga.cpp @@ -469,47 +469,43 @@ isa8_cga_superimpose_device::isa8_cga_superimpose_device(const machine_config &m template<bool blink, bool si, bool comp, bool alt, int width> MC6845_UPDATE_ROW( isa8_cga_device::cga_text ) { - uint8_t *videoram = &m_vram[m_start_offset]; - uint32_t *p = &bitmap.pix32(y); - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - int i; + uint8_t const *const videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix(y); + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - if ( y == 0 ) CGA_LOG(1,"cga_text_8",("\n")); - for ( i = 0; i < x_count; i++ ) + if (y == 0) CGA_LOG(1,"cga_text_8",("\n")); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ma + i ) << 1 ) & 0x3fff; - uint8_t chr = videoram[ offset ]; - uint8_t attr = videoram[ offset +1 ]; - uint8_t data = m_chr_gen[ chr * width + ra ]; + uint16_t const offset = ((ma + i) << 1) & 0x3fff; + uint8_t const chr = videoram[offset]; + uint8_t const attr = videoram[offset +1]; + uint8_t data = m_chr_gen[chr * width + ra]; uint16_t fg, bg; - uint8_t xi; - if ( comp ) + if (comp) { - fg = 0x10 + ( attr & 0x0F ); - bg = alt ? 0 : ( 0x10 + ( ( attr >> 4 ) & 0x07 ) ); + fg = 0x10 + (attr & 0x0f); + bg = alt ? 0 : (0x10 + ((attr >> 4) & 0x07)); } else { fg = attr & 0x0F; - bg = alt ? 0 : ( ( attr >> 4 ) & ( blink ? 0x07 : 0x0f ) ); + bg = alt ? 0 : ((attr >> 4) & (blink ? 0x07 : 0x0f)); } - if ( ( i == cursor_x ) && ( m_framecnt & 0x08 ) ) - data = 0xFF; - else if ( blink && ( attr & 0x80 ) && ( m_framecnt & 0x10 ) ) + if ((i == cursor_x) && (m_framecnt & 0x08)) + data = 0xff; + else if (blink && (attr & 0x80) && (m_framecnt & 0x10)) { data = 0x00; - bg = ( attr >> 4 ) & 0x07; + bg = (attr >> 4) & 0x07; } - for(xi=0;xi<8;xi++) + for (int xi = 0; xi < 8; xi++) { - uint8_t pen_data, dot; - - dot = (data & (1 << (7-xi))); - pen_data = dot ? fg : bg; - if(!si || (pen_data || dot)) + uint8_t const dot = (data & (1 << (7 - xi))); + uint8_t const pen_data = dot ? fg : bg; + if (!si || (pen_data || dot)) *p = palette[pen_data]; p++; } @@ -521,28 +517,29 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_text ) MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bppl_update_row ) { - uint8_t *videoram = &m_vram[m_start_offset]; - uint32_t *p = &bitmap.pix32(y); - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - int i; + uint8_t const *const videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix(y); + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bppl_update_row",("\n")); - for ( i = 0; i < x_count; i++ ) + if (y == 0) CGA_LOG(1,"cga_gfx_4bppl_update_row",("\n")); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); - uint8_t data = videoram[ offset ]; + uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((y & 1) << 13); + uint8_t data; + + data = videoram[offset]; - *p = palette[data >> 4]; p++; - *p = palette[data >> 4]; p++; - *p = palette[data & 0x0F]; p++; - *p = palette[data & 0x0F]; p++; + *p++ = palette[data >> 4]; + *p++ = palette[data >> 4]; + *p++ = palette[data & 0x0f]; + *p++ = palette[data & 0x0f]; - data = videoram[ offset + 1 ]; + data = videoram[offset + 1]; - *p = palette[data >> 4]; p++; - *p = palette[data >> 4]; p++; - *p = palette[data & 0x0F]; p++; - *p = palette[data & 0x0F]; p++; + *p++ = palette[data >> 4]; + *p++ = palette[data >> 4]; + *p++ = palette[data & 0x0f]; + *p++ = palette[data & 0x0f]; } } @@ -580,37 +577,37 @@ static const uint8_t yc_lut[16][8] = MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bpph_update_row ) { - uint8_t *videoram = &m_vram[m_start_offset]; - uint32_t *p = &bitmap.pix32(y); - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - int i; - - if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bpph_update_row",("\n")); + uint8_t const *const videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix(y); + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - for ( i = 0; i < x_count; i++ ) + if (y == 0) CGA_LOG(1,"cga_gfx_4bpph_update_row",("\n")); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); - uint8_t data = videoram[ offset ]; - - *p = palette[data >> 4]; p++; - *p = palette[data >> 4]; p++; - *p = palette[data >> 4]; p++; - *p = palette[data >> 4]; p++; - *p = palette[data & 0x0F]; p++; - *p = palette[data & 0x0F]; p++; - *p = palette[data & 0x0F]; p++; - *p = palette[data & 0x0F]; p++; - - data = videoram[ offset + 1 ]; - - *p = palette[data >> 4]; p++; - *p = palette[data >> 4]; p++; - *p = palette[data >> 4]; p++; - *p = palette[data >> 4]; p++; - *p = palette[data & 0x0F]; p++; - *p = palette[data & 0x0F]; p++; - *p = palette[data & 0x0F]; p++; - *p = palette[data & 0x0F]; p++; + uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((y & 1) << 13); + uint8_t data; + + data = videoram[offset]; + + *p++ = palette[data >> 4]; + *p++ = palette[data >> 4]; + *p++ = palette[data >> 4]; + *p++ = palette[data >> 4]; + *p++ = palette[data & 0x0f]; + *p++ = palette[data & 0x0f]; + *p++ = palette[data & 0x0f]; + *p++ = palette[data & 0x0f]; + + data = videoram[offset + 1]; + + *p++ = palette[data >> 4]; + *p++ = palette[data >> 4]; + *p++ = palette[data >> 4]; + *p++ = palette[data >> 4]; + *p++ = palette[data & 0x0f]; + *p++ = palette[data & 0x0f]; + *p++ = palette[data & 0x0f]; + *p++ = palette[data & 0x0f]; } } @@ -623,28 +620,29 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_4bpph_update_row ) MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_2bpp_update_row ) { - uint8_t *videoram = &m_vram[m_start_offset]; - uint32_t *p = &bitmap.pix32(y); - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - int i; + uint8_t const *const videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix(y); + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); - if ( y == 0 ) CGA_LOG(1,"cga_gfx_2bpp_update_row",("\n")); - for ( i = 0; i < x_count; i++ ) + if (y == 0) CGA_LOG(1,"cga_gfx_2bpp_update_row",("\n")); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 ); - uint8_t data = videoram[ offset ]; + uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((ra & 1) << 13); + uint8_t data; + + data = videoram[offset]; - *p = palette[m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++; - *p = palette[m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++; - *p = palette[m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++; - *p = palette[m_palette_lut_2bpp[ data & 0x03 ]]; p++; + *p++ = palette[m_palette_lut_2bpp[(data >> 6) & 0x03]]; + *p++ = palette[m_palette_lut_2bpp[(data >> 4) & 0x03]]; + *p++ = palette[m_palette_lut_2bpp[(data >> 2) & 0x03]]; + *p++ = palette[m_palette_lut_2bpp[ data & 0x03]]; - data = videoram[ offset+1 ]; + data = videoram[offset + 1]; - *p = palette[m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++; - *p = palette[m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++; - *p = palette[m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++; - *p = palette[m_palette_lut_2bpp[ data & 0x03 ]]; p++; + *p++ = palette[m_palette_lut_2bpp[(data >> 6) & 0x03]]; + *p++ = palette[m_palette_lut_2bpp[(data >> 4) & 0x03]]; + *p++ = palette[m_palette_lut_2bpp[(data >> 2) & 0x03]]; + *p++ = palette[m_palette_lut_2bpp[ data & 0x03]]; } } @@ -658,37 +656,38 @@ MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_2bpp_update_row ) MC6845_UPDATE_ROW( isa8_cga_device::cga_gfx_1bpp_update_row ) { - uint8_t *videoram = &m_vram[m_start_offset]; - uint32_t *p = &bitmap.pix32(y); - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint8_t fg = m_color_select & 0x0F; - int i; + uint8_t const *const videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix(y); + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint8_t const fg = m_color_select & 0x0f; - if ( y == 0 ) CGA_LOG(1,"cga_gfx_1bpp_update_row",("\n")); - for ( i = 0; i < x_count; i++ ) + if (y == 0) CGA_LOG(1,"cga_gfx_1bpp_update_row",("\n")); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 ); - uint8_t data = videoram[ offset ]; - - *p = palette[( data & 0x80 ) ? fg : 0]; p++; - *p = palette[( data & 0x40 ) ? fg : 0]; p++; - *p = palette[( data & 0x20 ) ? fg : 0]; p++; - *p = palette[( data & 0x10 ) ? fg : 0]; p++; - *p = palette[( data & 0x08 ) ? fg : 0]; p++; - *p = palette[( data & 0x04 ) ? fg : 0]; p++; - *p = palette[( data & 0x02 ) ? fg : 0]; p++; - *p = palette[( data & 0x01 ) ? fg : 0]; p++; - - data = videoram[ offset + 1 ]; - - *p = palette[( data & 0x80 ) ? fg : 0]; p++; - *p = palette[( data & 0x40 ) ? fg : 0]; p++; - *p = palette[( data & 0x20 ) ? fg : 0]; p++; - *p = palette[( data & 0x10 ) ? fg : 0]; p++; - *p = palette[( data & 0x08 ) ? fg : 0]; p++; - *p = palette[( data & 0x04 ) ? fg : 0]; p++; - *p = palette[( data & 0x02 ) ? fg : 0]; p++; - *p = palette[( data & 0x01 ) ? fg : 0]; p++; + uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((ra & 1) << 13); + uint8_t data; + + data = videoram[offset]; + + *p++ = palette[(data & 0x80) ? fg : 0]; + *p++ = palette[(data & 0x40) ? fg : 0]; + *p++ = palette[(data & 0x20) ? fg : 0]; + *p++ = palette[(data & 0x10) ? fg : 0]; + *p++ = palette[(data & 0x08) ? fg : 0]; + *p++ = palette[(data & 0x04) ? fg : 0]; + *p++ = palette[(data & 0x02) ? fg : 0]; + *p++ = palette[(data & 0x01) ? fg : 0]; + + data = videoram[offset + 1]; + + *p++ = palette[(data & 0x80) ? fg : 0]; + *p++ = palette[(data & 0x40) ? fg : 0]; + *p++ = palette[(data & 0x20) ? fg : 0]; + *p++ = palette[(data & 0x10) ? fg : 0]; + *p++ = palette[(data & 0x08) ? fg : 0]; + *p++ = palette[(data & 0x04) ? fg : 0]; + *p++ = palette[(data & 0x02) ? fg : 0]; + *p++ = palette[(data & 0x01) ? fg : 0]; } } @@ -961,205 +960,200 @@ void isa8_cga_device::io_write(offs_t offset, uint8_t data) // proc = cga_pgfx_4bpp; // -//static inline void pgfx_plot_unit_4bpp(bitmap_ind16 &bitmap, -// int x, int y, int offs) -//{ -// int color, values[2]; -// int i; -// -// if (cga.plantronics & 0x40) -// { -// values[0] = videoram[offs | 0x4000]; -// values[1] = videoram[offs]; -// } -// else -// { -// values[0] = videoram[offs]; -// values[1] = videoram[offs | 0x4000]; -// } -// for (i=3; i>=0; i--) -// { -// color = ((values[0] & 0x3) << 1) | -// ((values[1] & 2) >> 1) | -// ((values[1] & 1) << 3); -// bitmap.pix16(y, x+i) = Machine->pens[color]; -// values[0]>>=2; -// values[1]>>=2; -// } -//} -// -// -// +#if 0 +static inline void pgfx_plot_unit_4bpp(bitmap_ind16 &bitmap, int x, int y, int offs) +{ + int values[2]; + + if (cga.plantronics & 0x40) + { + values[0] = videoram[offs | 0x4000]; + values[1] = videoram[offs]; + } + else + { + values[0] = videoram[offs]; + values[1] = videoram[offs | 0x4000]; + } + for (int i = 3; i >= 0; i--) + { + int const color = + ((values[0] & 0x3) << 1) | + ((values[1] & 2) >> 1) | + ((values[1] & 1) << 3); + bitmap.pix(y, x + i) = Machine->pens[color]; + values[0] >>= 2; + values[1] >>= 2; + } +} +#endif + + ///*************************************************************************** // Draw graphics mode with 640x200 pixels (default) with 2 bits/pixel. // Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000 // Second plane at CGA_base + 0x4000 / 0x6000 -//***************************************************************************/ -// -//static void cga_pgfx_4bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc) -//{ -// int i, sx, sy, sh; -// int offs = mscrtc6845_get_start(crtc)*2; -// int lines = mscrtc6845_get_char_lines(crtc); -// int height = mscrtc6845_get_char_height(crtc); -// int columns = mscrtc6845_get_char_columns(crtc)*2; -// -// for (sy=0; sy<lines; sy++,offs=(offs+columns)&0x1fff) -// { -// for (sh=0; sh<height; sh++, offs|=0x2000) -// { -// // char line 0 used as a12 line in graphic mode -// if (!(sh & 1)) -// { -// for (i=offs, sx=0; sx<columns; sx++, i=(i+1)&0x1fff) -// { -// pgfx_plot_unit_4bpp(bitmap, sx*4, sy*height+sh, i); -// } -// } -// else -// { -// for (i=offs|0x2000, sx=0; sx<columns; sx++, i=((i+1)&0x1fff)|0x2000) -// { -// pgfx_plot_unit_4bpp(bitmap, sx*4, sy*height+sh, i); -// } -// } -// } -// } -//} -// -// -// -//static inline void pgfx_plot_unit_2bpp(bitmap_ind16 &bitmap, -// int x, int y, const uint16_t *palette, int offs) -//{ -// int i; -// uint8_t bmap[2], values[2]; -// uint16_t *dest; -// -// if (cga.plantronics & 0x40) -// { -// values[0] = videoram[offs]; -// values[1] = videoram[offs | 0x4000]; -// } -// else -// { -// values[0] = videoram[offs | 0x4000]; -// values[1] = videoram[offs]; -// } -// bmap[0] = bmap[1] = 0; -// for (i=3; i>=0; i--) -// { -// bmap[0] = bmap[0] << 1; if (values[0] & 0x80) bmap[0] |= 1; -// bmap[0] = bmap[0] << 1; if (values[1] & 0x80) bmap[0] |= 1; -// bmap[1] = bmap[1] << 1; if (values[0] & 0x08) bmap[1] |= 1; -// bmap[1] = bmap[1] << 1; if (values[1] & 0x08) bmap[1] |= 1; -// values[0] = values[0] << 1; -// values[1] = values[1] << 1; -// } -// -// dest = &bitmap.pix16(y, x); -// *(dest++) = palette[(bmap[0] >> 6) & 0x03]; -// *(dest++) = palette[(bmap[0] >> 4) & 0x03]; -// *(dest++) = palette[(bmap[0] >> 2) & 0x03]; -// *(dest++) = palette[(bmap[0] >> 0) & 0x03]; -// *(dest++) = palette[(bmap[1] >> 6) & 0x03]; -// *(dest++) = palette[(bmap[1] >> 4) & 0x03]; -// *(dest++) = palette[(bmap[1] >> 2) & 0x03]; -// *(dest++) = palette[(bmap[1] >> 0) & 0x03]; -//} -// -// -// +//**************************************************************************** + +#if 0 +static void cga_pgfx_4bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc) +{ + int offs = mscrtc6845_get_start(crtc) * 2; + int const lines = mscrtc6845_get_char_lines(crtc); + int const height = mscrtc6845_get_char_height(crtc); + int columns = mscrtc6845_get_char_columns(crtc) * 2; + + for (int sy = 0; sy < lines; sy++, offs = (offs + columns) & 0x1fff) + { + for (int sh = 0; sh < height; sh++, offs |= 0x2000) + { + // char line 0 used as a12 line in graphic mode + if (!(sh & 1)) + { + for (int i = offs, sx = 0; sx < columns; sx++, i = (i + 1) & 0x1fff) + { + pgfx_plot_unit_4bpp(bitmap, sx * 4, sy * height + sh, i); + } + } + else + { + for (int i = offs | 0x2000, sx = 0; sx < columns; sx++, i = ((i + 1) & 0x1fff) | 0x2000) + { + pgfx_plot_unit_4bpp(bitmap, sx * 4, sy * height + sh, i); + } + } + } + } +} +#endif + + +#if 0 +static inline void pgfx_plot_unit_2bpp(bitmap_ind16 &bitmap, int x, int y, const uint16_t *palette, int offs) +{ + uint8_t values[2]; + if (cga.plantronics & 0x40) + { + values[0] = videoram[offs]; + values[1] = videoram[offs | 0x4000]; + } + else + { + values[0] = videoram[offs | 0x4000]; + values[1] = videoram[offs]; + } + uint8_t bmap[2] = { 0, 0 }; + for (int i = 3; i >= 0; i--) + { + bmap[0] = (bmap[0] << 1) | BIT(values[0], 7); + bmap[0] = (bmap[0] << 1) | BIT(values[1], 7); + bmap[1] = (bmap[1] << 1) | BIT(values[0], 3); + bmap[1] = (bmap[1] << 1) | BIT(values[1], 3); + values[0] <<= 1; + values[1] <<= 1; + } + + uint16_t *dest = &bitmap.pix(y, x); + *dest++ = palette[(bmap[0] >> 6) & 0x03]; + *dest++ = palette[(bmap[0] >> 4) & 0x03]; + *dest++ = palette[(bmap[0] >> 2) & 0x03]; + *dest++ = palette[(bmap[0] >> 0) & 0x03]; + *dest++ = palette[(bmap[1] >> 6) & 0x03]; + *dest++ = palette[(bmap[1] >> 4) & 0x03]; + *dest++ = palette[(bmap[1] >> 2) & 0x03]; + *dest++ = palette[(bmap[1] >> 0) & 0x03]; +} +#endif + + ///*************************************************************************** // Draw graphics mode with 320x200 pixels (default) with 2 bits/pixel. // Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000 // cga fetches 2 byte per mscrtc6845 access (not modeled here)! -//***************************************************************************/ -// -//static void cga_pgfx_2bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc) -//{ -// int i, sx, sy, sh; -// int offs = mscrtc6845_get_start(crtc)*2; -// int lines = mscrtc6845_get_char_lines(crtc); -// int height = mscrtc6845_get_char_height(crtc); -// int columns = mscrtc6845_get_char_columns(crtc)*2; -// int colorset = cga.color_select & 0x3F; -// const uint16_t *palette; -// -// /* Most chipsets use bit 2 of the mode control register to -// * access a third palette. But not consistently. */ -// pc_cga_check_palette(); -// switch(CGA_CHIPSET) -// { -// /* The IBM Professional Graphics Controller behaves like -// * the PC1512, btw. */ -// case CGA_CHIPSET_PC1512: -// if ((colorset < 32) && (cga.mode_control & 4)) colorset += 64; -// break; -// -// case CGA_CHIPSET_IBM: -// case CGA_CHIPSET_PC200: -// case CGA_CHIPSET_ATI: -// case CGA_CHIPSET_PARADISE: -// if (cga.mode_control & 4) colorset = (colorset & 0x1F) + 64; -// break; -// } -// -// -// /* The fact that our palette is located in cga_colortable is a vestigial -// * aspect from when we were doing that ugly trick where drawgfx() would -// * handle graphics drawing. Truthfully, we should probably be using -// * palette_set_color_rgb() here and not doing the palette lookup in the loop -// */ -// palette = &cga_colortable[256*2 + 16*2] + colorset * 4; -// -// for (sy=0; sy<lines; sy++,offs=(offs+columns)&0x1fff) { -// -// for (sh=0; sh<height; sh++) -// { -// if (!(sh&1)) { // char line 0 used as a12 line in graphic mode -// for (i=offs, sx=0; sx<columns; sx++, i=(i+1)&0x1fff) -// { -// pgfx_plot_unit_2bpp(bitmap, sx*8, sy*height+sh, palette, i); -// } -// } -// else -// { -// for (i=offs|0x2000, sx=0; sx<columns; sx++, i=((i+1)&0x1fff)|0x2000) -// { -// pgfx_plot_unit_2bpp(bitmap, sx*8, sy*height+sh, palette, i); -// } -// } -// } -// } -//} +//**************************************************************************** + +#if 0 +static void cga_pgfx_2bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc) +{ + int offs = mscrtc6845_get_start(crtc) * 2; + int const lines = mscrtc6845_get_char_lines(crtc); + int const height = mscrtc6845_get_char_height(crtc); + int const columns = mscrtc6845_get_char_columns(crtc) * 2; + + /* Most chipsets use bit 2 of the mode control register to access a third palette. But not consistently. */ + int colorset = cga.color_select & 0x3f; + pc_cga_check_palette(); + switch (CGA_CHIPSET) + { + /* The IBM Professional Graphics Controller behaves like the PC1512, btw. */ + case CGA_CHIPSET_PC1512: + if ((colorset < 32) && (cga.mode_control & 4)) colorset += 64; + break; + + case CGA_CHIPSET_IBM: + case CGA_CHIPSET_PC200: + case CGA_CHIPSET_ATI: + case CGA_CHIPSET_PARADISE: + if (cga.mode_control & 4) colorset = (colorset & 0x1f) + 64; + break; + } + + /* The fact that our palette is located in cga_colortable is a vestigial + * aspect from when we were doing that ugly trick where drawgfx() would + * handle graphics drawing. Truthfully, we should probably be using + * palette_set_color_rgb() here and not doing the palette lookup in the loop + */ + uint16_t const *const palette = &cga_colortable[256*2 + 16*2] + colorset * 4; + + for (int sy = 0; sy < lines; sy++, offs = (offs + columns) & 0x1fff) + { + + for (int sh = 0; sh < height; sh++) + { + if (!(sh & 1)) // char line 0 used as a12 line in graphic mode + { + for (int i = offs, sx = 0; sx < columns; sx++, i = (i + 1) & 0x1fff) + { + pgfx_plot_unit_2bpp(bitmap, sx * 8, sy * height + sh, palette, i); + } + } + else + { + for (int i = offs | 0x2000, sx = 0; sx < columns; sx++, i= ((i + 1) & 0x1fff) | 0x2000) + { + pgfx_plot_unit_2bpp(bitmap, sx * 8, sy * height + sh, palette, i); + } + } + } + } +} +#endif MC6845_UPDATE_ROW( isa8_cga_pc1512_device::pc1512_gfx_4bpp_update_row ) { - uint8_t *videoram = &m_vram[m_start_offset]; - uint32_t *p = &bitmap.pix32(y); - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint16_t offset_base = ra << 13; - int j; + uint8_t const *const videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix(y); + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint16_t const offset_base = ra << 13; - if ( y == 0 ) CGA_LOG(1,"pc1512_gfx_4bpp_update_row",("\n")); - for ( j = 0; j < x_count; j++ ) + if (y == 0) CGA_LOG(1,"pc1512_gfx_4bpp_update_row",("\n")); + for (int j = 0; j < x_count; j++) { - uint16_t offset = offset_base | ( ( ma + j ) & 0x1FFF ); - uint16_t i = ( m_color_select & 8 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[3] | offset ] << 3 : 0; - uint16_t r = ( m_color_select & 4 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[2] | offset ] << 2 : 0; - uint16_t g = ( m_color_select & 2 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[1] | offset ] << 1 : 0; - uint16_t b = ( m_color_select & 1 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[0] | offset ] : 0; - - *p = palette[( ( i & 0x400 ) | ( r & 0x200 ) | ( g & 0x100 ) | ( b & 0x80 ) ) >> 7]; p++; - *p = palette[( ( i & 0x200 ) | ( r & 0x100 ) | ( g & 0x080 ) | ( b & 0x40 ) ) >> 6]; p++; - *p = palette[( ( i & 0x100 ) | ( r & 0x080 ) | ( g & 0x040 ) | ( b & 0x20 ) ) >> 5]; p++; - *p = palette[( ( i & 0x080 ) | ( r & 0x040 ) | ( g & 0x020 ) | ( b & 0x10 ) ) >> 4]; p++; - *p = palette[( ( i & 0x040 ) | ( r & 0x020 ) | ( g & 0x010 ) | ( b & 0x08 ) ) >> 3]; p++; - *p = palette[( ( i & 0x020 ) | ( r & 0x010 ) | ( g & 0x008 ) | ( b & 0x04 ) ) >> 2]; p++; - *p = palette[( ( i & 0x010 ) | ( r & 0x008 ) | ( g & 0x004 ) | ( b & 0x02 ) ) >> 1]; p++; - *p = palette[ ( i & 0x008 ) | ( r & 0x004 ) | ( g & 0x002 ) | ( b & 0x01 ) ]; p++; + uint16_t const offset = offset_base | ((ma + j) & 0x1fff); + uint16_t const i = (m_color_select & 8) ? videoram[isa8_cga_pc1512_device::vram_offset[3] | offset] << 3 : 0; + uint16_t const r = (m_color_select & 4) ? videoram[isa8_cga_pc1512_device::vram_offset[2] | offset] << 2 : 0; + uint16_t const g = (m_color_select & 2) ? videoram[isa8_cga_pc1512_device::vram_offset[1] | offset] << 1 : 0; + uint16_t const b = (m_color_select & 1) ? videoram[isa8_cga_pc1512_device::vram_offset[0] | offset] : 0; + + *p++ = palette[((i & 0x400) | (r & 0x200) | (g & 0x100) | (b & 0x80) ) >> 7]; + *p++ = palette[((i & 0x200) | (r & 0x100) | (g & 0x080) | (b & 0x40) ) >> 6]; + *p++ = palette[((i & 0x100) | (r & 0x080) | (g & 0x040) | (b & 0x20) ) >> 5]; + *p++ = palette[((i & 0x080) | (r & 0x040) | (g & 0x020) | (b & 0x10) ) >> 4]; + *p++ = palette[((i & 0x040) | (r & 0x020) | (g & 0x010) | (b & 0x08) ) >> 3]; + *p++ = palette[((i & 0x020) | (r & 0x010) | (g & 0x008) | (b & 0x04) ) >> 2]; + *p++ = palette[((i & 0x010) | (r & 0x008) | (g & 0x004) | (b & 0x02) ) >> 1]; + *p++ = palette[ (i & 0x008) | (r & 0x004) | (g & 0x002) | (b & 0x01) ]; } } @@ -1500,31 +1494,38 @@ void isa8_wyse700_device::device_reset() uint32_t isa8_wyse700_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - if (m_control & 0x08) { - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint8_t fg = m_color_select & 0x0F; + if (m_control & 0x08) + { + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint8_t const fg = m_color_select & 0x0F; uint32_t addr = 0; - for (int y = 0; y < 800; y++) { - uint8_t *src = &m_vram[addr]; + for (int y = 0; y < 800; y++) + { + uint8_t const *src = &m_vram[addr]; - if (y & 1) { + if (y & 1) + { src += 0x10000; addr += 160; } - for (int x = 0; x < (1280 / 8); x++) { + for (int x = 0; x < (1280 / 8); x++) + { uint8_t val = src[x]; - for (int i = 0; i < 8; i++) { - bitmap.pix32(y,x*8+i) = (val & 0x80) ? palette[fg] : palette[0x00]; + for (int i = 0; i < 8; i++) + { + bitmap.pix(y, x * 8 + i) = (val & 0x80) ? palette[fg] : palette[0x00]; val <<= 1; } } } - } else { + return 0; + } + else + { return isa8_cga_device::screen_update(screen, bitmap, cliprect); } - return 0; } @@ -1837,7 +1838,7 @@ uint8_t isa8_cga_m24_device::io_read(offs_t offset) MC6845_UPDATE_ROW(isa8_cga_m24_device::crtc_update_row) { - if(m_mode2 & 1) + if (m_mode2 & 1) { m24_gfx_1bpp_m24_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp); return; @@ -1847,7 +1848,7 @@ MC6845_UPDATE_ROW(isa8_cga_m24_device::crtc_update_row) return; y = m_y; - if(m_y >= bitmap.height()) + if (m_y >= bitmap.height()) return; switch (m_update_row_type) @@ -1885,37 +1886,38 @@ MC6845_UPDATE_ROW(isa8_cga_m24_device::crtc_update_row) MC6845_UPDATE_ROW( isa8_cga_m24_device::m24_gfx_1bpp_m24_update_row ) { - uint8_t *videoram = &m_vram[m_start_offset]; - uint32_t *p = &bitmap.pix32(y); - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint8_t fg = m_color_select & 0x0F; - int i; + uint8_t const *const videoram = &m_vram[m_start_offset]; + uint32_t *p = &bitmap.pix(y); + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint8_t const fg = m_color_select & 0x0f; - if ( y == 0 ) CGA_LOG(1,"m24_gfx_1bpp_m24_update_row",("\n")); - for ( i = 0; i < x_count; i++ ) + if (y == 0) CGA_LOG(1,"m24_gfx_1bpp_m24_update_row",("\n")); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 3 ) << 13 ); - uint8_t data = videoram[ offset ]; - - *p = palette[( data & 0x80 ) ? fg : 0]; p++; - *p = palette[( data & 0x40 ) ? fg : 0]; p++; - *p = palette[( data & 0x20 ) ? fg : 0]; p++; - *p = palette[( data & 0x10 ) ? fg : 0]; p++; - *p = palette[( data & 0x08 ) ? fg : 0]; p++; - *p = palette[( data & 0x04 ) ? fg : 0]; p++; - *p = palette[( data & 0x02 ) ? fg : 0]; p++; - *p = palette[( data & 0x01 ) ? fg : 0]; p++; - - data = videoram[ offset + 1 ]; - - *p = palette[( data & 0x80 ) ? fg : 0]; p++; - *p = palette[( data & 0x40 ) ? fg : 0]; p++; - *p = palette[( data & 0x20 ) ? fg : 0]; p++; - *p = palette[( data & 0x10 ) ? fg : 0]; p++; - *p = palette[( data & 0x08 ) ? fg : 0]; p++; - *p = palette[( data & 0x04 ) ? fg : 0]; p++; - *p = palette[( data & 0x02 ) ? fg : 0]; p++; - *p = palette[( data & 0x01 ) ? fg : 0]; p++; + uint16_t const offset = (((ma + i) << 1 ) & 0x1fff) | ((ra & 3) << 13); + uint8_t data; + + data = videoram[offset]; + + *p++ = palette[(data & 0x80) ? fg : 0]; + *p++ = palette[(data & 0x40) ? fg : 0]; + *p++ = palette[(data & 0x20) ? fg : 0]; + *p++ = palette[(data & 0x10) ? fg : 0]; + *p++ = palette[(data & 0x08) ? fg : 0]; + *p++ = palette[(data & 0x04) ? fg : 0]; + *p++ = palette[(data & 0x02) ? fg : 0]; + *p++ = palette[(data & 0x01) ? fg : 0]; + + data = videoram[offset + 1]; + + *p++ = palette[(data & 0x80) ? fg : 0]; + *p++ = palette[(data & 0x40) ? fg : 0]; + *p++ = palette[(data & 0x20) ? fg : 0]; + *p++ = palette[(data & 0x10) ? fg : 0]; + *p++ = palette[(data & 0x08) ? fg : 0]; + *p++ = palette[(data & 0x04) ? fg : 0]; + *p++ = palette[(data & 0x02) ? fg : 0]; + *p++ = palette[(data & 0x01) ? fg : 0]; } } diff --git a/src/devices/bus/isa/ega.cpp b/src/devices/bus/isa/ega.cpp index e3d75e4070a..45d169f3dff 100644 --- a/src/devices/bus/isa/ega.cpp +++ b/src/devices/bus/isa/ega.cpp @@ -783,7 +783,7 @@ WRITE_LINE_MEMBER( isa8_ega_device::vblank_changed ) CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics ) { - uint16_t *p = &bitmap.pix16(y); + uint16_t *p = &bitmap.pix(y); LOG("%s: y = %d, x_count = %d, ma = %d, ra = %d\n", FUNCNAME, y, x_count, ma, ra ); @@ -844,12 +844,11 @@ CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics ) CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_text ) { - uint16_t *p = &bitmap.pix16(y); - int i; + uint16_t *p = &bitmap.pix(y); LOG("%s: y = %d, x_count = %d, ma = %d, ra = %d\n", FUNCNAME, y, x_count, ma, ra ); - for ( i = 0; i < x_count; i++ ) + for ( int i = 0; i < x_count; i++ ) { uint16_t offset = ma + i; uint8_t chr = m_plane[0][ offset ]; @@ -901,8 +900,6 @@ CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_text ) void isa8_ega_device::change_mode() { - int clock, pixels; - m_video_mode = 0; /* Check for graphics mode */ @@ -938,8 +935,8 @@ void isa8_ega_device::change_mode() } /* Check for changes to the crtc input clock and number of pixels per clock */ - clock = ( ( m_misc_output & 0x0c ) ? 16257000 : 14318181 ); - pixels = ( ( m_sequencer.data[0x01] & 0x01 ) ? 8 : 9 ); + int clock = ( ( m_misc_output & 0x0c ) ? 16257000 : 14318181 ); + int pixels = ( ( m_sequencer.data[0x01] & 0x01 ) ? 8 : 9 ); if ( m_sequencer.data[0x01] & 0x08 ) { diff --git a/src/devices/bus/isa/eis_hgb107x.cpp b/src/devices/bus/isa/eis_hgb107x.cpp index 32aeac02c3e..25b16a38fe3 100644 --- a/src/devices/bus/isa/eis_hgb107x.cpp +++ b/src/devices/bus/isa/eis_hgb107x.cpp @@ -420,10 +420,6 @@ inline int isa8_epc_mda_device::get_yres() MC6845_UPDATE_ROW(isa8_epc_mda_device::crtc_update_row) { - uint32_t *p = &bitmap.pix32(y); - uint16_t chr_base = ra; - int i; - // Get som debug data from a couple of rows now and then if ( y < (16 * 0 + 0x20) && (m_framecnt & 0xff) == 0 ) { @@ -436,7 +432,7 @@ MC6845_UPDATE_ROW(isa8_epc_mda_device::crtc_update_row) { for (int i = 0; i < get_xres(); i++) { - bitmap.pix32(y, i) = rgb_t::black(); + bitmap.pix(y, i) = rgb_t::black(); } } @@ -449,14 +445,17 @@ MC6845_UPDATE_ROW(isa8_epc_mda_device::crtc_update_row) // Text modes using one of two 9x16 fonts in character rom else { + uint32_t *p = &bitmap.pix(y); + uint16_t chr_base = ra; + // Adjust row pointer if in monochrome text mode as we insert two scanlines per row of characters (see below) if (m_vmode & VM_MONO) { - p = &bitmap.pix32((y / 14) * 16 + y % 14); + p = &bitmap.pix((y / 14) * 16 + y % 14); } // Loop over each character in a row - for ( i = 0; i < x_count; i++ ) + for ( int i = 0; i < x_count; i++ ) { uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; uint8_t chr = m_videoram[ offset ]; @@ -555,14 +554,14 @@ MC6845_UPDATE_ROW(isa8_epc_mda_device::crtc_update_row) { if (chr >= 0xb3 && chr <= 0xdf) // Handle the meta graphics characters { - bitmap.pix32(row + 1, j + i * 9) = (*m_pal)[( data & (0x80 >> j) ) || (j == 8 && (data & 0x01)) ? fg : bg]; - bitmap.pix32(row + 2, j + i * 9) = (*m_pal)[( data & (0x80 >> j) ) || (j == 8 && (data & 0x01)) ? fg : bg]; + bitmap.pix(row + 1, j + i * 9) = (*m_pal)[( data & (0x80 >> j) ) || (j == 8 && (data & 0x01)) ? fg : bg]; + bitmap.pix(row + 2, j + i * 9) = (*m_pal)[( data & (0x80 >> j) ) || (j == 8 && (data & 0x01)) ? fg : bg]; } else { // Handle underline - bitmap.pix32(row + 1, j + i * 9) =(*m_pal)[( attr & ATTR_FOREG ) == ATTR_ULINE ? fg : bg]; - bitmap.pix32(row + 2, j + i * 9) = (*m_pal)[bg]; + bitmap.pix(row + 1, j + i * 9) =(*m_pal)[( attr & ATTR_FOREG ) == ATTR_ULINE ? fg : bg]; + bitmap.pix(row + 2, j + i * 9) = (*m_pal)[bg]; } } } diff --git a/src/devices/bus/isa/ex1280.cpp b/src/devices/bus/isa/ex1280.cpp index 84c8bb8d269..2d9153616e9 100644 --- a/src/devices/bus/isa/ex1280.cpp +++ b/src/devices/bus/isa/ex1280.cpp @@ -144,15 +144,15 @@ void isa16_ex1280_device::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask TMS340X0_SCANLINE_RGB32_CB_MEMBER(isa16_ex1280_device::scanline_update) { - uint16_t *src = &m_vram[params->rowaddr << 8]; - uint32_t *dest = &bitmap.pix32(scanline); - const pen_t *pens = m_ramdac->pens(); + uint16_t const *const src = &m_vram[params->rowaddr << 8]; + uint32_t *const dest = &bitmap.pix(scanline); + pen_t const *const pens = m_ramdac->pens(); int coladdr = params->coladdr << 1; /* copy the non-blanked portions of this scanline */ for (int x = params->heblnk; x < params->hsblnk; x += 4) { - uint16_t pixels = src[coladdr++]; + uint16_t const pixels = src[coladdr++]; dest[x + 0] = pens[pixels & 0x0f]; dest[x + 1] = pens[(pixels >> 4) & 0x0f]; dest[x + 2] = pens[(pixels >> 8) & 0x0f]; diff --git a/src/devices/bus/isa/gus.cpp b/src/devices/bus/isa/gus.cpp index a1c3f39612e..237211047a2 100644 --- a/src/devices/bus/isa/gus.cpp +++ b/src/devices/bus/isa/gus.cpp @@ -243,29 +243,26 @@ void gf1_device::device_timer(emu_timer &timer, device_timer_id id, int param, v } } -void gf1_device::sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) +void gf1_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) { - int x,y; + int x; //uint32_t count; - stream_sample_t* outputl = outputs[0]; - stream_sample_t* outputr = outputs[1]; - memset( outputl, 0x00, samples * sizeof(*outputl) ); - memset( outputr, 0x00, samples * sizeof(*outputr) ); + auto &outputl = outputs[0]; + auto &outputr = outputs[1]; + + outputl.fill(0); + outputr.fill(0); for(x=0;x<32;x++) // for each voice { - stream_sample_t* left = outputl; - stream_sample_t* right = outputr; uint16_t vol = (m_volume_table[(m_voice[x].current_vol & 0xfff0) >> 4]); - for(y=samples-1; y>=0; y--) + for (int sampindex = 0; sampindex < outputl.samples(); sampindex++) { uint32_t current = m_voice[x].current_addr >> 9; // TODO: implement proper panning - (*left) += ((m_voice[x].sample) * (vol/8192.0)); - (*right) += ((m_voice[x].sample) * (vol/8192.0)); - left++; - right++; + outputl.add_int(sampindex, m_voice[x].sample * vol, 32768 * 8192); + outputr.add_int(sampindex, m_voice[x].sample * vol, 32768 * 8192); if((!(m_voice[x].voice_ctrl & 0x40)) && (m_voice[x].current_addr >= m_voice[x].end_addr) && !m_voice[x].rollover && !(m_voice[x].voice_ctrl & 0x01)) { if(m_voice[x].vol_ramp_ctrl & 0x04) @@ -403,7 +400,7 @@ void gf1_device::device_start() m_wave_ram.resize(1024*1024); memset(&m_wave_ram[0], 0, 1024*1024); - m_stream = stream_alloc_legacy(0,2,clock() / (14 * 16)); + m_stream = stream_alloc(0,2,clock() / (14 * 16)); // init timers m_timer1 = timer_alloc(ADLIB_TIMER1); diff --git a/src/devices/bus/isa/gus.h b/src/devices/bus/isa/gus.h index 3f637bee84d..be8dbbdbe2d 100644 --- a/src/devices/bus/isa/gus.h +++ b/src/devices/bus/isa/gus.h @@ -123,7 +123,7 @@ public: // optional information overrides virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; - 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; protected: // voice-specific registers diff --git a/src/devices/bus/isa/mach32.cpp b/src/devices/bus/isa/mach32.cpp index 602147aa060..e9f4ad8d197 100644 --- a/src/devices/bus/isa/mach32.cpp +++ b/src/devices/bus/isa/mach32.cpp @@ -180,11 +180,8 @@ uint32_t mach32_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma return 0; uint32_t src = (m_cursor_address & 0x000fffff) << 2; - uint32_t* dst; // destination pixel - uint8_t x,y,z; - uint32_t colour0; - uint32_t colour1; + uint32_t colour0, colour1; if(depth == 8) { colour0 = pen(m_cursor_colour0_b); @@ -197,18 +194,18 @@ uint32_t mach32_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma } // draw hardware pointer (64x64 max) - for(y=0;y<64;y++) + for(uint8_t y=0;y<64;y++) { - dst = &bitmap.pix32(m_cursor_vertical + y, m_cursor_horizontal); - for(x=0;x<64;x+=8) + uint32_t *dst = &bitmap.pix(m_cursor_vertical + y, m_cursor_horizontal); + for(uint8_t x=0;x<64;x+=8) { - uint16_t bits = (vga.memory[(src+0) % vga.svga_intf.vram_size] | ((vga.memory[(src+1) % vga.svga_intf.vram_size]) << 8)); + uint16_t const bits = (vga.memory[(src+0) % vga.svga_intf.vram_size] | ((vga.memory[(src+1) % vga.svga_intf.vram_size]) << 8)); - for(z=0;z<8;z++) + for(uint8_t z=0;z<8;z++) { if(((z + x) > (m_cursor_offset_horizontal-1)) && (y < (63 - m_cursor_offset_vertical))) { - uint8_t val = (bits >> (z*2)) & 0x03; + uint8_t const val = (bits >> (z*2)) & 0x03; switch(val) { case 0: // cursor colour 0 diff --git a/src/devices/bus/isa/mda.cpp b/src/devices/bus/isa/mda.cpp index cf4a6aa3803..ae61e78e116 100644 --- a/src/devices/bus/isa/mda.cpp +++ b/src/devices/bus/isa/mda.cpp @@ -225,27 +225,26 @@ void isa8_mda_device::device_reset() ***************************************************************************/ MC6845_UPDATE_ROW( isa8_mda_device::mda_text_inten_update_row ) { - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); - uint16_t chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; - int i; + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint32_t *p = &bitmap.pix(y); + uint16_t const chr_base = (ra & 0x08) ? 0x800 | (ra & 0x07) : ra; - if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); - for ( i = 0; i < x_count; i++ ) + if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; - uint8_t chr = m_videoram[ offset ]; - uint8_t attr = m_videoram[ offset + 1 ]; - uint8_t data = m_chr_gen[ chr_base + chr * 8 ]; - uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint16_t const offset = ((ma + i) << 1) & 0x0fff; + uint8_t const chr = m_videoram[offset]; + uint8_t const attr = m_videoram[offset + 1]; + uint8_t data = m_chr_gen[chr_base + chr * 8]; + uint8_t fg = (attr & 0x08) ? 3 : 2; uint8_t bg = 0; - if ( ( attr & ~0x88 ) == 0 ) + if ((attr & ~0x88) == 0) { data = 0x00; } - switch( attr ) + switch (attr) { case 0x70: bg = 2; @@ -255,36 +254,36 @@ MC6845_UPDATE_ROW( isa8_mda_device::mda_text_inten_update_row ) bg = 2; fg = 1; break; - case 0xF0: + case 0xf0: bg = 3; fg = 0; break; - case 0xF8: + case 0xf8: bg = 3; fg = 1; break; } - if ( ( i == cursor_x && ( m_framecnt & 0x08 ) ) || ( attr & 0x07 ) == 0x01 ) + if ((i == cursor_x && (m_framecnt & 0x08)) || (attr & 0x07) == 0x01) { - data = 0xFF; + data = 0xff; } - *p = palette[( data & 0x80 ) ? fg : bg]; p++; - *p = palette[( data & 0x40 ) ? fg : bg]; p++; - *p = palette[( data & 0x20 ) ? fg : bg]; p++; - *p = palette[( data & 0x10 ) ? fg : bg]; p++; - *p = palette[( data & 0x08 ) ? fg : bg]; p++; - *p = palette[( data & 0x04 ) ? fg : bg]; p++; - *p = palette[( data & 0x02 ) ? fg : bg]; p++; - *p = palette[( data & 0x01 ) ? fg : bg]; p++; - if ( ( chr & 0xE0 ) == 0xC0 ) + *p++ = palette[(data & 0x80) ? fg : bg]; + *p++ = palette[(data & 0x40) ? fg : bg]; + *p++ = palette[(data & 0x20) ? fg : bg]; + *p++ = palette[(data & 0x10) ? fg : bg]; + *p++ = palette[(data & 0x08) ? fg : bg]; + *p++ = palette[(data & 0x04) ? fg : bg]; + *p++ = palette[(data & 0x02) ? fg : bg]; + *p++ = palette[(data & 0x01) ? fg : bg]; + if ((chr & 0xe0) == 0xc0) { - *p = palette[( data & 0x01 ) ? fg : bg]; p++; + *p++ = palette[(data & 0x01) ? fg : bg]; } else { - *p = palette[bg]; p++; + *p++ = palette[bg]; } } } @@ -298,75 +297,74 @@ MC6845_UPDATE_ROW( isa8_mda_device::mda_text_inten_update_row ) MC6845_UPDATE_ROW( isa8_mda_device::mda_text_blink_update_row ) { - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); - uint16_t chr_base = ( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra; - int i; + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint32_t *p = &bitmap.pix(y); + uint16_t const chr_base = (ra & 0x08) ? 0x800 | (ra & 0x07) : ra; - if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); - for ( i = 0; i < x_count; i++ ) + if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; - uint8_t chr = m_videoram[ offset ]; - uint8_t attr = m_videoram[ offset + 1 ]; - uint8_t data = m_chr_gen[ chr_base + chr * 8 ]; - uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint16_t const offset = ((ma + i) << 1) & 0x0fff; + uint8_t const chr = m_videoram[offset]; + uint8_t const attr = m_videoram[offset + 1]; + uint8_t data = m_chr_gen[chr_base + chr * 8]; + uint8_t fg = (attr & 0x08) ? 3 : 2; uint8_t bg = 0; - if ( ( attr & ~0x88 ) == 0 ) + if ((attr & ~0x88) == 0) { data = 0x00; } - switch( attr ) + switch (attr) { case 0x70: - case 0xF0: + case 0xf0: bg = 2; fg = 0; break; case 0x78: - case 0xF8: + case 0xf8: bg = 2; fg = 1; break; } - if ( ( attr & 0x07 ) == 0x01 ) + if ((attr & 0x07) == 0x01) { - data = 0xFF; + data = 0xff; } - if ( i == cursor_x ) + if (i == cursor_x) { - if ( m_framecnt & 0x08 ) + if (m_framecnt & 0x08) { - data = 0xFF; + data = 0xff; } } else { - if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) ) + if ((attr & 0x80) && (m_framecnt & 0x10)) { data = 0x00; } } - *p = palette[( data & 0x80 ) ? fg : bg]; p++; - *p = palette[( data & 0x40 ) ? fg : bg]; p++; - *p = palette[( data & 0x20 ) ? fg : bg]; p++; - *p = palette[( data & 0x10 ) ? fg : bg]; p++; - *p = palette[( data & 0x08 ) ? fg : bg]; p++; - *p = palette[( data & 0x04 ) ? fg : bg]; p++; - *p = palette[( data & 0x02 ) ? fg : bg]; p++; - *p = palette[( data & 0x01 ) ? fg : bg]; p++; - if ( ( chr & 0xE0 ) == 0xC0 ) + *p++ = palette[(data & 0x80) ? fg : bg]; + *p++ = palette[(data & 0x40) ? fg : bg]; + *p++ = palette[(data & 0x20) ? fg : bg]; + *p++ = palette[(data & 0x10) ? fg : bg]; + *p++ = palette[(data & 0x08) ? fg : bg]; + *p++ = palette[(data & 0x04) ? fg : bg]; + *p++ = palette[(data & 0x02) ? fg : bg]; + *p++ = palette[(data & 0x01) ? fg : bg]; + if ((chr & 0xe0) == 0xc0) { - *p = palette[( data & 0x01 ) ? fg : bg]; p++; + *p++ = palette[(data & 0x01) ? fg : bg]; } else { - *p = palette[bg]; p++; + *p++ = palette[bg]; } } } @@ -631,34 +629,36 @@ void isa8_hercules_device::device_reset() MC6845_UPDATE_ROW( isa8_hercules_device::hercules_gfx_update_row ) { - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); - uint16_t gfx_base = ( ( m_mode_control & 0x80 ) ? 0x8000 : 0x0000 ) | ( ( ra & 0x03 ) << 13 ); - int i; - if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); - for ( i = 0; i < x_count; i++ ) + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint32_t *p = &bitmap.pix(y); + uint16_t const gfx_base = ((m_mode_control & 0x80) ? 0x8000 : 0x0000) | ((ra & 0x03) << 13); + + if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); + for (int i = 0; i < x_count; i++) { - uint8_t data = m_videoram[ gfx_base + ( ( ma + i ) << 1 ) ]; - - *p = palette[( data & 0x80 ) ? 2 : 0]; p++; - *p = palette[( data & 0x40 ) ? 2 : 0]; p++; - *p = palette[( data & 0x20 ) ? 2 : 0]; p++; - *p = palette[( data & 0x10 ) ? 2 : 0]; p++; - *p = palette[( data & 0x08 ) ? 2 : 0]; p++; - *p = palette[( data & 0x04 ) ? 2 : 0]; p++; - *p = palette[( data & 0x02 ) ? 2 : 0]; p++; - *p = palette[( data & 0x01 ) ? 2 : 0]; p++; - - data = m_videoram[ gfx_base + ( ( ma + i ) << 1 ) + 1 ]; - - *p = palette[( data & 0x80 ) ? 2 : 0]; p++; - *p = palette[( data & 0x40 ) ? 2 : 0]; p++; - *p = palette[( data & 0x20 ) ? 2 : 0]; p++; - *p = palette[( data & 0x10 ) ? 2 : 0]; p++; - *p = palette[( data & 0x08 ) ? 2 : 0]; p++; - *p = palette[( data & 0x04 ) ? 2 : 0]; p++; - *p = palette[( data & 0x02 ) ? 2 : 0]; p++; - *p = palette[( data & 0x01 ) ? 2 : 0]; p++; + uint8_t data; + + data = m_videoram[gfx_base + ((ma + i) << 1)]; + + *p++ = palette[(data & 0x80) ? 2 : 0]; + *p++ = palette[(data & 0x40) ? 2 : 0]; + *p++ = palette[(data & 0x20) ? 2 : 0]; + *p++ = palette[(data & 0x10) ? 2 : 0]; + *p++ = palette[(data & 0x08) ? 2 : 0]; + *p++ = palette[(data & 0x04) ? 2 : 0]; + *p++ = palette[(data & 0x02) ? 2 : 0]; + *p++ = palette[(data & 0x01) ? 2 : 0]; + + data = m_videoram[gfx_base + ((ma + i) << 1) + 1]; + + *p++ = palette[(data & 0x80) ? 2 : 0]; + *p++ = palette[(data & 0x40) ? 2 : 0]; + *p++ = palette[(data & 0x20) ? 2 : 0]; + *p++ = palette[(data & 0x10) ? 2 : 0]; + *p++ = palette[(data & 0x08) ? 2 : 0]; + *p++ = palette[(data & 0x04) ? 2 : 0]; + *p++ = palette[(data & 0x02) ? 2 : 0]; + *p++ = palette[(data & 0x01) ? 2 : 0]; } } @@ -816,27 +816,26 @@ void isa8_ec1840_0002_device::device_reset() MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_inten_update_row ) { - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); - uint16_t chr_base = ra; - int i; + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint32_t *p = &bitmap.pix(y); + uint16_t const chr_base = ra; - if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); - for ( i = 0; i < x_count; i++ ) + if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; - uint8_t chr = m_videoram[ offset ]; - uint8_t attr = m_videoram[ offset + 1 ]; - uint8_t data = m_chr_gen[ (chr_base + chr * 16) << 1 ]; - uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint16_t const offset = ((ma + i) << 1) & 0x0fff; + uint8_t const chr = m_videoram[offset]; + uint8_t const attr = m_videoram[offset + 1]; + uint8_t data = m_chr_gen[(chr_base + chr * 16) << 1]; + uint8_t fg = (attr & 0x08) ? 3 : 2; uint8_t bg = 0; - if ( ( attr & ~0x88 ) == 0 ) + if ((attr & ~0x88) == 0) { data = 0x00; } - switch( attr ) + switch (attr) { case 0x70: bg = 2; @@ -846,29 +845,29 @@ MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_inten_update_row ) bg = 2; fg = 1; break; - case 0xF0: + case 0xf0: bg = 3; fg = 0; break; - case 0xF8: + case 0xf8: bg = 3; fg = 1; break; } - if ( ( i == cursor_x && ( m_framecnt & 0x08 ) ) || ( attr & 0x07 ) == 0x01 ) + if ((i == cursor_x && (m_framecnt & 0x08)) || (attr & 0x07) == 0x01) { - data = 0xFF; + data = 0xff; } - *p = palette[( data & 0x80 ) ? fg : bg]; p++; - *p = palette[( data & 0x40 ) ? fg : bg]; p++; - *p = palette[( data & 0x20 ) ? fg : bg]; p++; - *p = palette[( data & 0x10 ) ? fg : bg]; p++; - *p = palette[( data & 0x08 ) ? fg : bg]; p++; - *p = palette[( data & 0x04 ) ? fg : bg]; p++; - *p = palette[( data & 0x02 ) ? fg : bg]; p++; - *p = palette[( data & 0x01 ) ? fg : bg]; p++; + *p++ = palette[(data & 0x80) ? fg : bg]; + *p++ = palette[(data & 0x40) ? fg : bg]; + *p++ = palette[(data & 0x20) ? fg : bg]; + *p++ = palette[(data & 0x10) ? fg : bg]; + *p++ = palette[(data & 0x08) ? fg : bg]; + *p++ = palette[(data & 0x04) ? fg : bg]; + *p++ = palette[(data & 0x02) ? fg : bg]; + *p++ = palette[(data & 0x01) ? fg : bg]; } } @@ -880,68 +879,67 @@ MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_inten_update_row ) MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_blink_update_row ) { - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint32_t *p = &bitmap.pix32(y); - uint16_t chr_base = ra; - int i; + rgb_t const *const palette = m_palette->palette()->entry_list_raw(); + uint32_t *p = &bitmap.pix(y); + uint16_t const chr_base = ra; - if ( y == 0 ) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); - for ( i = 0; i < x_count; i++ ) + if (y == 0) LOGROW("%11.6f: %-24s\n", machine().time().as_double(), FUNCNAME); + for (int i = 0; i < x_count; i++) { - uint16_t offset = ( ( ma + i ) << 1 ) & 0x0FFF; - uint8_t chr = m_videoram[ offset ]; - uint8_t attr = m_videoram[ offset + 1 ]; - uint8_t data = m_chr_gen[ (chr_base + chr * 16) << 1 ]; - uint8_t fg = ( attr & 0x08 ) ? 3 : 2; + uint16_t const offset = ((ma + i) << 1) & 0x0fff; + uint8_t const chr = m_videoram[offset]; + uint8_t const attr = m_videoram[offset + 1]; + uint8_t data = m_chr_gen[(chr_base + chr * 16) << 1]; + uint8_t fg = (attr & 0x08) ? 3 : 2; uint8_t bg = 0; - if ( ( attr & ~0x88 ) == 0 ) + if ((attr & ~0x88) == 0) { data = 0x00; } - switch( attr ) + switch (attr) { case 0x70: - case 0xF0: + case 0xf0: bg = 2; fg = 0; break; case 0x78: - case 0xF8: + case 0xf8: bg = 2; fg = 1; break; } - if ( ( attr & 0x07 ) == 0x01 ) + if ((attr & 0x07) == 0x01) { - data = 0xFF; + data = 0xff; } - if ( i == cursor_x ) + if (i == cursor_x) { - if ( m_framecnt & 0x08 ) + if (m_framecnt & 0x08) { - data = 0xFF; + data = 0xff; } } else { - if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) ) + if ((attr & 0x80) && (m_framecnt & 0x10)) { data = 0x00; } } - *p = palette[( data & 0x80 ) ? fg : bg]; p++; - *p = palette[( data & 0x40 ) ? fg : bg]; p++; - *p = palette[( data & 0x20 ) ? fg : bg]; p++; - *p = palette[( data & 0x10 ) ? fg : bg]; p++; - *p = palette[( data & 0x08 ) ? fg : bg]; p++; - *p = palette[( data & 0x04 ) ? fg : bg]; p++; - *p = palette[( data & 0x02 ) ? fg : bg]; p++; - *p = palette[( data & 0x01 ) ? fg : bg]; p++; + *p++ = palette[(data & 0x80) ? fg : bg]; + *p++ = palette[(data & 0x40) ? fg : bg]; + *p++ = palette[(data & 0x20) ? fg : bg]; + *p++ = palette[(data & 0x10) ? fg : bg]; + *p++ = palette[(data & 0x08) ? fg : bg]; + *p++ = palette[(data & 0x04) ? fg : bg]; + *p++ = palette[(data & 0x02) ? fg : bg]; + *p++ = palette[(data & 0x01) ? fg : bg]; } } diff --git a/src/devices/bus/isa/num9rev.cpp b/src/devices/bus/isa/num9rev.cpp index 07a35ee073c..632eb8b544b 100644 --- a/src/devices/bus/isa/num9rev.cpp +++ b/src/devices/bus/isa/num9rev.cpp @@ -36,7 +36,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( isa8_number_9_rev_device::hgdc_display_pixels ) color.set_r(pal->entry_color(m_ram[addr] | ((overlay & 0xf) << 8)).r()); color.set_g(pal->entry_color(m_ram[addr + 0x40000] | ((overlay & 0xf0) << 4)).g()); color.set_b(pal->entry_color(m_ram[addr + 0x80000] | (overlay & 0xf00)).b()); - bitmap.pix32(y, x + i) = color; + bitmap.pix(y, x + i) = color; } } else @@ -44,7 +44,7 @@ UPD7220_DISPLAY_PIXELS_MEMBER( isa8_number_9_rev_device::hgdc_display_pixels ) if(((address << 3) + 16) > (1024*1024)) return; for(int i = 0; i < 16; i++) - bitmap.pix32(y, x + i) = pal->entry_color(m_ram[(address << 4) + i]); + bitmap.pix(y, x + i) = pal->entry_color(m_ram[(address << 4) + i]); } } diff --git a/src/devices/bus/isa/pgc.cpp b/src/devices/bus/isa/pgc.cpp index 1366bc92dbc..f204333f9f2 100644 --- a/src/devices/bus/isa/pgc.cpp +++ b/src/devices/bus/isa/pgc.cpp @@ -401,14 +401,11 @@ uint8_t isa8_pgc_device::init_r() uint32_t isa8_pgc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint16_t *p; - uint8_t *v; - for (int y = 0; y < PGC_DISP_VERT; y++) { // XXX address translation happens in hardware - v = &m_vram[y * 1024]; - p = &bitmap.pix16(y + PGC_VERT_START, PGC_HORZ_START); + uint8_t const *v = &m_vram[y * 1024]; + uint16_t *p = &bitmap.pix(y + PGC_VERT_START, PGC_HORZ_START); for (int x = 0; x < PGC_DISP_HORZ; x++) { diff --git a/src/devices/bus/isa/trident.cpp b/src/devices/bus/isa/trident.cpp index 0d64df5ba27..5fc2d2d6d19 100644 --- a/src/devices/bus/isa/trident.cpp +++ b/src/devices/bus/isa/trident.cpp @@ -212,29 +212,22 @@ void trident_vga_device::device_reset() uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - uint8_t cur_mode; - svga_device::screen_update(screen,bitmap,cliprect); - cur_mode = pc_vga_choosevideomode(); + uint8_t const cur_mode = pc_vga_choosevideomode(); // draw hardware graphics cursor if(tri.cursor_ctrl & 0x80) // if cursor is enabled { - uint32_t src; - uint32_t* dst; - uint8_t val; - int x,y; - uint16_t cx = tri.cursor_x & 0x0fff; - uint16_t cy = tri.cursor_y & 0x0fff; - uint32_t bg_col; - uint32_t fg_col; - uint8_t cursor_size = (tri.cursor_ctrl & 0x01) ? 64 : 32; + uint16_t const cx = tri.cursor_x & 0x0fff; + uint16_t const cy = tri.cursor_y & 0x0fff; + uint8_t const cursor_size = (tri.cursor_ctrl & 0x01) ? 64 : 32; if(cur_mode == SCREEN_OFF || cur_mode == TEXT_MODE || cur_mode == MONO_MODE || cur_mode == CGA_MODE || cur_mode == EGA_MODE) return 0; // cursor only works in VGA or SVGA modes - src = tri.cursor_loc * 1024; // start address is in units of 1024 bytes + uint32_t src = tri.cursor_loc * 1024; // start address is in units of 1024 bytes + uint32_t bg_col, fg_col; if(cur_mode == RGB16_MODE) { bg_col = tri.cursor_bg; @@ -246,11 +239,11 @@ uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 & fg_col = pen(tri.cursor_fg & 0xff); } - for(y=0;y<cursor_size;y++) + for(int y=0;y<cursor_size;y++) { uint8_t bitcount = 31; - dst = &bitmap.pix32(cy + y, cx); - for(x=0;x<cursor_size;x++) + uint32_t *const dst = &bitmap.pix(cy + y, cx); + for(int x=0;x<cursor_size;x++) { uint32_t bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size] | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8) @@ -260,7 +253,7 @@ uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 & | ((vga.memory[(src+6) % vga.svga_intf.vram_size]) << 8) | ((vga.memory[(src+5) % vga.svga_intf.vram_size]) << 16) | ((vga.memory[(src+4) % vga.svga_intf.vram_size]) << 24)); - val = (BIT(bita << 1,bitcount+1) << 1 | BIT(bitb,bitcount)); + uint8_t const val = (BIT(bita << 1,bitcount+1) << 1 | BIT(bitb,bitcount)); if(tri.cursor_ctrl & 0x40) { // X11 mode switch(val) |