Cleaned up bitmap API.

Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return
const-qualified references/pointers to pixesl, and added non-const
versions.  This makes bitmap more like standard library containers where
const protects the content as well as the dimensions.

Made the templated pixt accessor protected - having it public makes it
too easy to inadvertently get a pointer to the wrong location.

Removed the pix(8|16|32|64) accessors from the specific bitmaps.  You
could only use the "correct" one anyway, and having the "incorrect" ones
available prevented explicit instantiations of the class template
because the static assertions would fail.  You can still see the pixel
type in the bitmap class names, and you can't assign the result of
&pix(y, x) to the wrong kind of pointer without a cast.

Added fill member functions to the specific bitmap template, and added
a explicit instantiations.  This allows the bitmap size check to be
skipped on most bitmap fills, although the clipping check is still
there.  Also fixed a couple of places that were trying to fill an
indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with
zero to get the same net effect).  The explicit template instantiations
in the .cpp file mean the compiler can inline the function if necessary,
but don't need to generate a local out-of-line body if it chooses not
to.

Extended the size of the fill value parameter in the base bitmap class
to 64 bits so it works correctly for 64-bit bitmaps.

Fixed places where IE15 and VGM visualiser weren't accounting for row
bytes potentially being larger than width.

Fixed an off-by-one in an HP-DIO card where it was treating the Topcat
cursor right edge as exclusive.

Updated everything to work with the API changes, reduced the scope of
many variables, added more const, and replaced a few fill/copy loops
with stuff from <algorithm>.
This commit is contained in:
Vas Crabb 2020-09-27 14:00:42 +10:00
parent d294948a3b
commit a1d35e5abf
1070 changed files with 10082 additions and 12257 deletions

View File

@ -304,11 +304,10 @@ void a2bus_videx160_device::write_c800(uint16_t offset, uint8_t data)
MC6845_UPDATE_ROW( a2bus_videx160_device::crtc_update_row )
{
uint32_t *p = &bitmap.pix32(y);
uint32_t *p = &bitmap.pix(y);
uint16_t chr_base = ra;
int i;
for ( i = 0; i < x_count; i++ )
for ( int i = 0; i < x_count; i++ )
{
uint16_t offset = ( ma + i );
uint8_t chr = m_ram[ offset ];

View File

@ -347,7 +347,7 @@ void a2bus_videx80_device::write_c800(uint16_t offset, uint8_t data)
MC6845_UPDATE_ROW( a2bus_videx80_device::crtc_update_row )
{
uint32_t *p = &bitmap.pix32(y);
uint32_t *p = &bitmap.pix(y);
uint16_t chr_base = ra; //( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
for (int i = 0; i < x_count; i++)

View File

@ -93,7 +93,7 @@ void acorn_vdu40_device::device_reset()
MC6845_UPDATE_ROW(acorn_vdu40_device::crtc_update_row)
{
uint32_t *p = &bitmap.pix32(y);
uint32_t *p = &bitmap.pix(y);
m_trom->lose_w(1);
m_trom->lose_w(0);

View File

@ -172,7 +172,7 @@ void acorn_vdu80_device::device_reset()
MC6845_UPDATE_ROW(acorn_vdu80_device::crtc_update_row)
{
uint8_t invert = BIT(m_links->read(), 1);
uint32_t *p = &bitmap.pix32(y);
uint32_t *p = &bitmap.pix(y);
for (int column = 0; column < x_count; column++)
{

View File

@ -87,7 +87,7 @@ HD44780_PIXEL_UPDATE(bbc_lcd_device::lcd_pixel_update)
}
if (line < 4)
bitmap.pix16(line * (8 + 1) + y, pos * 6 + x) = state ? 1 : 2;
bitmap.pix(line * (8 + 1) + y, pos * 6 + x) = state ? 1 : 2;
}
}

View File

@ -85,12 +85,12 @@ const tiny_rom_entry *c64_xl80_device::device_rom_region() const
MC6845_UPDATE_ROW( c64_xl80_device::crtc_update_row )
{
const pen_t *pen = m_palette->pens();
pen_t const *const pen = m_palette->pens();
for (int column = 0; column < x_count; column++)
{
uint8_t code = m_ram[((ma + column) & 0x7ff)];
uint16_t addr = (code << 3) | (ra & 0x07);
uint8_t const code = m_ram[((ma + column) & 0x7ff)];
uint16_t const addr = (code << 3) | (ra & 0x07);
uint8_t data = m_char_rom->base()[addr & 0x7ff];
if (column == cursor_x)
@ -100,10 +100,10 @@ MC6845_UPDATE_ROW( c64_xl80_device::crtc_update_row )
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int color = BIT(data, 7) && de;
int const x = (column * 8) + bit;
int const color = BIT(data, 7) && de;
bitmap.pix32(vbp + y, hbp + x) = pen[color];
bitmap.pix(vbp + y, hbp + x) = pen[color];
data <<= 1;
}

View File

@ -575,9 +575,9 @@ WRITE_LINE_MEMBER( epson_lx810l_device::co0_w )
*/
if (m_real_cr_pos < m_bitmap.width()) {
for (int i = 0; i < 9; i++) {
unsigned int y = bitmap_line(i);
unsigned int const y = bitmap_line(i);
if ((m_printhead & (1<<(8-i))) != 0)
m_bitmap.pix32(y, m_real_cr_pos + CR_OFFSET) = 0x000000;
m_bitmap.pix(y, m_real_cr_pos + CR_OFFSET) = 0x000000;
}
}
}

View File

@ -51,11 +51,11 @@ void compis_uhrg_device::uhrg_map(address_map &map)
UPD7220_DISPLAY_PIXELS_MEMBER( compis_hrg_device::display_pixels )
{
uint16_t i,gfx = m_video_ram[(address & 0x7fff) >> 1];
const pen_t *pen = m_palette->pens();
uint16_t const gfx = m_video_ram[(address & 0x7fff) >> 1];
pen_t const *const pen = m_palette->pens();
for(i=0; i<16; i++)
bitmap.pix32(y, x + i) = pen[BIT(gfx, i)];
for(uint16_t i=0; i<16; i++)
bitmap.pix(y, x + i) = pen[BIT(gfx, i)];
}
@ -65,11 +65,11 @@ UPD7220_DISPLAY_PIXELS_MEMBER( compis_hrg_device::display_pixels )
UPD7220_DISPLAY_PIXELS_MEMBER( compis_uhrg_device::display_pixels )
{
uint16_t i,gfx = m_video_ram[(address & 0x1ffff) >> 1];
const pen_t *pen = m_palette->pens();
uint16_t const gfx = m_video_ram[(address & 0x1ffff) >> 1];
pen_t const *const pen = m_palette->pens();
for(i=0; i<16; i++)
bitmap.pix32(y, x + i) = pen[BIT(gfx, i)];
for(uint16_t i=0; i<16; i++)
bitmap.pix(y, x + i) = pen[BIT(gfx, i)];
}

View File

@ -104,8 +104,8 @@ MC6845_UPDATE_ROW( comx_clm_device::crtc_update_row )
{
for (int column = 0; column < x_count; column++)
{
uint8_t code = m_video_ram[((ma + column) & 0x7ff)];
uint16_t addr = (code << 3) | (ra & 0x07);
uint8_t const code = m_video_ram[((ma + column) & 0x7ff)];
uint16_t const addr = (code << 3) | (ra & 0x07);
uint8_t data = m_char_rom->base()[addr & 0x7ff];
if (BIT(ra, 3) && column == cursor_x)
@ -115,9 +115,9 @@ MC6845_UPDATE_ROW( comx_clm_device::crtc_update_row )
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int const x = (column * 8) + bit;
bitmap.pix32(vbp + y, hbp + x) = m_palette->pen(BIT(data, 7) && de);
bitmap.pix(vbp + y, hbp + x) = m_palette->pen(BIT(data, 7) && de);
data <<= 1;
}

View File

@ -179,35 +179,33 @@ MC6845_UPDATE_ROW( ecb_grip21_device::crtc_update_row )
{
for (int column = 0; column < x_count; column++)
{
uint16_t address = (m_page << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
uint8_t data = m_video_ram[address];
uint16_t const address = (m_page << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
uint8_t const data = m_video_ram[address];
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int color = (m_flash ? 0 : BIT(data, bit)) && de;
int const x = (column * 8) + bit;
int const color = (m_flash ? 0 : BIT(data, bit)) && de;
bitmap.pix32(vbp + y, hbp + x) = m_palette->pen(color);
bitmap.pix(vbp + y, hbp + x) = m_palette->pen(color);
}
}
}
/*
MC6845_UPDATE_ROW( ecb_grip21_device::grip5_update_row )
{
const rgb_t *palette = m_palette->palette()->entry_list_raw();
int column, bit;
for (column = 0; column < x_count; column++)
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
for (int column = 0; column < x_count; column++)
{
uint16_t address = (m_dpage << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
uint8_t data = m_video_ram[address];
uint16_t const address = (m_dpage << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07);
uint8_t const data = m_video_ram[address];
for (bit = 0; bit < 8; bit++)
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int color = m_flash ? 0 : BIT(data, bit);
int const x = (column * 8) + bit;
int const color = m_flash ? 0 : BIT(data, bit);
bitmap.pix32(y, x) = palette[color];
bitmap.pix(y, x) = palette[color];
}
}
}

View File

@ -185,14 +185,14 @@ MC6845_UPDATE_ROW( tk02_device::crtc_update_row )
if (i == cursor_x)
data ^= 0xff;
bitmap.pix32(y, i * 8 + 0) = pen[BIT(data, 7)];
bitmap.pix32(y, i * 8 + 1) = pen[BIT(data, 6)];
bitmap.pix32(y, i * 8 + 2) = pen[BIT(data, 5)];
bitmap.pix32(y, i * 8 + 3) = pen[BIT(data, 4)];
bitmap.pix32(y, i * 8 + 4) = pen[BIT(data, 3)];
bitmap.pix32(y, i * 8 + 5) = pen[BIT(data, 2)];
bitmap.pix32(y, i * 8 + 6) = pen[BIT(data, 1)];
bitmap.pix32(y, i * 8 + 7) = pen[BIT(data, 0)];
bitmap.pix(y, i * 8 + 0) = pen[BIT(data, 7)];
bitmap.pix(y, i * 8 + 1) = pen[BIT(data, 6)];
bitmap.pix(y, i * 8 + 2) = pen[BIT(data, 5)];
bitmap.pix(y, i * 8 + 3) = pen[BIT(data, 4)];
bitmap.pix(y, i * 8 + 4) = pen[BIT(data, 3)];
bitmap.pix(y, i * 8 + 5) = pen[BIT(data, 2)];
bitmap.pix(y, i * 8 + 6) = pen[BIT(data, 1)];
bitmap.pix(y, i * 8 + 7) = pen[BIT(data, 0)];
}
}

View File

@ -195,7 +195,7 @@ void electron_mode7_device::expbus_w(offs_t offset, uint8_t data)
MC6845_UPDATE_ROW(electron_mode7_device::crtc_update_row)
{
uint32_t* p = &bitmap.pix32(y);
uint32_t* p = &bitmap.pix(y);
m_trom->lose_w(1);
m_trom->lose_w(0);

View File

@ -1302,7 +1302,7 @@ uint32_t newport_base_device::screen_update(screen_device &device, bitmap_rgb32
/* loop over rows and copy to the destination */
for (int y = cliprect.min_y, sy = y_start; y <= cliprect.max_y && sy < y_end; y++, sy++)
{
uint32_t *dest = &bitmap.pix32(y, cliprect.min_x);
uint32_t *dest = &bitmap.pix(y, cliprect.min_x);
const uint32_t *src_rgbci = m_rb2->rgbci(y);
const uint32_t *src_cidaux = m_rb2->cidaux(y);

View File

@ -235,7 +235,7 @@ uint32_t dio16_98543_device::screen_update(screen_device &screen, bitmap_rgb32 &
}
for (int y = 0; y < m_v_pix; y++) {
uint32_t *scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_h_pix; x++) {
uint8_t tmp = m_vram[y * m_h_pix + x];

View File

@ -165,25 +165,22 @@ WRITE_LINE_MEMBER(dio16_98544_device::int_w)
uint32_t dio16_98544_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int startx, starty, endx, endy;
if (!m_topcat->has_changed())
return UPDATE_HAS_NOT_CHANGED;
for (int y = 0; y < m_v_pix; y++) {
uint32_t *scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_h_pix; x++) {
uint8_t tmp = m_vram[y * m_h_pix + x];
*scanline++ = tmp ? rgb_t(255,255,255) : rgb_t(0, 0, 0);
}
}
int startx, starty, endx, endy;
m_topcat->get_cursor_pos(startx, starty, endx, endy);
for (int y = starty; y <= endy; y++) {
uint32_t *scanline = &bitmap.pix32(y);
memset(scanline + startx, 0xff, (endx - startx) << 2);
std::fill_n(&bitmap.pix(y, startx), endx - startx + 1, rgb_t(255,255,255));
}
return 0;

View File

@ -218,7 +218,7 @@ uint32_t dio32_98550_device::screen_update(screen_device &screen, bitmap_rgb32 &
mask |= ce->plane_enabled();
for (int y = 0; y < m_v_pix; y++) {
uint32_t *scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_h_pix; x++) {
const int offset = y * m_fb_width +x;

View File

@ -178,7 +178,7 @@ void iq151_grafik_device::video_update(bitmap_ind16 &bitmap, const rectangle &cl
{
for (int ra = 0; ra < 8; ra++)
{
bitmap.pix16(y, x*8 + ra) |= BIT(m_videoram[(32*8 -1 - y)*64 + x], ra);
bitmap.pix(y, x*8 + ra) |= BIT(m_videoram[(32*8 -1 - y)*64 + x], ra);
}
}
}

View File

@ -162,7 +162,7 @@ void iq151_minigraf_device::plotter_update(uint8_t control)
// if pen is down draws a point
if (m_pen)
m_paper->pix16(((PAPER_HEIGHT-PAPER_MAX_Y)/2) + m_posy, ((PAPER_WIDTH-PAPER_MAX_X)/2) + m_posx) = 1;
m_paper->pix(((PAPER_HEIGHT-PAPER_MAX_Y)/2) + m_posy, ((PAPER_WIDTH-PAPER_MAX_X)/2) + m_posx) = 1;
m_control = control;
}

View File

@ -164,5 +164,5 @@ void iq151_ms151a_device::plotter_update(uint8_t offset, uint8_t data)
// if pen is down draws a point
if (m_pen)
m_paper->pix16(((PAPER_HEIGHT-PAPER_MAX_Y)/2) + m_posy, ((PAPER_WIDTH-PAPER_MAX_X)/2) + m_posx) = 1;
m_paper->pix(((PAPER_HEIGHT-PAPER_MAX_Y)/2) + m_posy, ((PAPER_WIDTH-PAPER_MAX_X)/2) + m_posx) = 1;
}

View File

@ -126,7 +126,7 @@ void iq151_video32_device::video_update(bitmap_ind16 &bitmap, const rectangle &c
{
for (int ra = 0; ra < 8; ra++)
{
uint16_t *p = &bitmap.pix16(sy++);
uint16_t *p = &bitmap.pix(sy++);
for (int x = ma; x < ma + 32; x++)
{

View File

@ -140,7 +140,7 @@ void iq151_video64_device::video_update(bitmap_ind16 &bitmap, const rectangle &c
{
for (int ra = 0; ra < 8; ra++)
{
uint16_t *p = &bitmap.pix16(sy++);
uint16_t *p = &bitmap.pix(sy++);
for (int x = ma; x < ma + 64; x++)
{

View File

@ -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");

View File

@ -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;
*p = palette[data >> 4]; p++;
*p = palette[data >> 4]; p++;
*p = palette[data & 0x0F]; p++;
*p = palette[data & 0x0F]; p++;
data = videoram[offset];
data = videoram[ offset + 1 ];
*p++ = palette[data >> 4];
*p++ = palette[data >> 4];
*p++ = palette[data & 0x0f];
*p++ = palette[data & 0x0f];
*p = palette[data >> 4]; p++;
*p = palette[data >> 4]; p++;
*p = palette[data & 0x0F]; p++;
*p = palette[data & 0x0F]; p++;
data = videoram[offset + 1];
*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;
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_4bpph_update_row",("\n"));
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 ];
uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((y & 1) << 13);
uint8_t data;
*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];
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];
*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++ = 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;
*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++;
data = videoram[offset];
data = videoram[ offset+1 ];
*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]];
*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++;
data = videoram[offset + 1];
*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 ];
uint16_t const offset = (((ma + i) << 1) & 0x1fff) | ((ra & 1) << 13);
uint8_t data;
*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];
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];
*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++ = 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;
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++;
*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++;
*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 ];
uint16_t const offset = (((ma + i) << 1 ) & 0x1fff) | ((ra & 3) << 13);
uint8_t data;
*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];
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];
*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++ = 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];
}
}

View File

@ -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 )
{

View File

@ -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];
}
}
}

View File

@ -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];

View File

@ -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

View File

@ -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 ) ];
uint8_t data;
*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)];
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];
*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++ = 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];
}
}

View File

@ -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]);
}
}

View File

@ -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++)
{

View File

@ -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)

View File

@ -154,27 +154,23 @@ void macpds_sedisplay_device::device_timer(emu_timer &timer, device_timer_id tid
uint32_t macpds_sedisplay_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
uint8_t const *const vram = m_vram.get();
vram = m_vram.get();
for (y = 0; y < 870; y++)
for (int y = 0; y < 870; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
pixels = vram[(y * (1024/8)) + (x^1)];
uint8_t const pixels = vram[(y * (1024/8)) + (x^1)];
*scanline++ = m_palette[((pixels>>7)&0x1)^1];
*scanline++ = m_palette[((pixels>>6)&0x1)^1];
*scanline++ = m_palette[((pixels>>5)&0x1)^1];
*scanline++ = m_palette[((pixels>>4)&0x1)^1];
*scanline++ = m_palette[((pixels>>3)&0x1)^1];
*scanline++ = m_palette[((pixels>>2)&0x1)^1];
*scanline++ = m_palette[((pixels>>1)&0x1)^1];
*scanline++ = m_palette[(pixels&1)^1];
*scanline++ = m_palette[BIT(~pixels, 7)];
*scanline++ = m_palette[BIT(~pixels, 6)];
*scanline++ = m_palette[BIT(~pixels, 5)];
*scanline++ = m_palette[BIT(~pixels, 4)];
*scanline++ = m_palette[BIT(~pixels, 3)];
*scanline++ = m_palette[BIT(~pixels, 2)];
*scanline++ = m_palette[BIT(~pixels, 1)];
*scanline++ = m_palette[BIT(~pixels, 0)];
}
}

View File

@ -417,7 +417,7 @@ MC6845_UPDATE_ROW(mtx_sdxcpm_device::crtc_update_row)
int color = BIT(data, 7) ? fg : bg;
bitmap.pix32(y, x) = pen[de ? color : 0];
bitmap.pix(y, x) = pen[de ? color : 0];
data <<= 1;
}

View File

@ -120,7 +120,7 @@ MC6845_UPDATE_ROW( nascom_avc_device::crtc_update_row )
}
// plot the pixel
bitmap.pix32(y, x) = m_palette->pen_color((b << 2) | (g << 1) | (r << 0));
bitmap.pix(y, x) = m_palette->pen_color((b << 2) | (g << 1) | (r << 0));
}
}

View File

@ -117,30 +117,26 @@ void nubus_laserview_device::device_reset()
uint32_t nubus_laserview_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels;
if (!m_vbl_disable)
{
raise_slot_irq();
}
for (y = 0; y < 600; y++)
for (int y = 0; y < 600; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 832/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 832/8; x++)
{
pixels = m_vram[(y * 104) + (BYTE4_XOR_BE(x)) + 0x20];
uint8_t const pixels = m_vram[(y * 104) + (BYTE4_XOR_BE(x)) + 0x20];
*scanline++ = m_palette[(pixels>>7)&1];
*scanline++ = m_palette[(pixels>>6)&1];
*scanline++ = m_palette[(pixels>>5)&1];
*scanline++ = m_palette[(pixels>>4)&1];
*scanline++ = m_palette[(pixels>>3)&1];
*scanline++ = m_palette[(pixels>>2)&1];
*scanline++ = m_palette[(pixels>>1)&1];
*scanline++ = m_palette[(pixels&1)];
*scanline++ = m_palette[BIT(pixels, 7)];
*scanline++ = m_palette[BIT(pixels, 6)];
*scanline++ = m_palette[BIT(pixels, 5)];
*scanline++ = m_palette[BIT(pixels, 4)];
*scanline++ = m_palette[BIT(pixels, 3)];
*scanline++ = m_palette[BIT(pixels, 2)];
*scanline++ = m_palette[BIT(pixels, 1)];
*scanline++ = m_palette[BIT(pixels, 0)];
}
}

View File

@ -12,6 +12,9 @@
#include "nubus_48gc.h"
#include "screen.h"
#include <algorithm>
#define VRAM_SIZE (0x200000) // 2 megs, maxed out
#define GC48_SCREEN_NAME "48gc_screen"
@ -152,10 +155,7 @@ void jmfb_device::device_timer(emu_timer &timer, device_timer_id tid, int param,
uint32_t jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline, *base;
int x, y;
uint8_t *vram8 = &m_vram[0];
uint8_t pixels;
uint8_t const *const vram8 = &m_vram[0xa00];
// first time? kick off the VBL timer
if (!m_screen)
@ -164,37 +164,35 @@ uint32_t jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
}
vram8 += 0xa00;
switch (m_mode)
{
case 0: // 1bpp
for (y = 0; y < m_yres; y++)
for (int y = 0; y < m_yres; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < m_xres/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_xres/8; x++)
{
pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>7)&1];
*scanline++ = m_palette[(pixels>>6)&1];
*scanline++ = m_palette[(pixels>>5)&1];
*scanline++ = m_palette[(pixels>>4)&1];
*scanline++ = m_palette[(pixels>>3)&1];
*scanline++ = m_palette[(pixels>>2)&1];
*scanline++ = m_palette[(pixels>>1)&1];
*scanline++ = m_palette[pixels&1];
*scanline++ = m_palette[BIT(pixels, 7)];
*scanline++ = m_palette[BIT(pixels, 6)];
*scanline++ = m_palette[BIT(pixels, 5)];
*scanline++ = m_palette[BIT(pixels, 4)];
*scanline++ = m_palette[BIT(pixels, 3)];
*scanline++ = m_palette[BIT(pixels, 2)];
*scanline++ = m_palette[BIT(pixels, 1)];
*scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2bpp
for (y = 0; y < m_yres; y++)
for (int y = 0; y < m_yres; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < m_xres/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_xres/4; x++)
{
pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>6)&0x3];
*scanline++ = m_palette[(pixels>>4)&0x3];
@ -205,13 +203,12 @@ uint32_t jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
break;
case 2: // 4 bpp
for (y = 0; y < m_yres; y++)
for (int y = 0; y < m_yres; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < m_xres/2; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_xres/2; x++)
{
pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>4)&0xf];
*scanline++ = m_palette[pixels&0xf];
@ -220,27 +217,22 @@ uint32_t jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
break;
case 3: // 8 bpp
for (y = 0; y < m_yres; y++)
for (int y = 0; y < m_yres; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < m_xres; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < m_xres; x++)
{
pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
break;
case 4: // 24 bpp
for (y = 0; y < m_yres; y++)
for (int y = 0; y < m_yres; y++)
{
scanline = &bitmap.pix32(y);
base = (uint32_t *)&m_vram[y * m_stride];
for (x = 0; x < m_xres; x++)
{
*scanline++ = *base++;
}
uint32_t const *base = (uint32_t *)&m_vram[y * m_stride];
std::copy_n(base, m_xres, &bitmap.pix(y));
}
break;
}

View File

@ -17,6 +17,9 @@
#include "nubus_cb264.h"
#include "screen.h"
#include <algorithm>
#define CB264_SCREEN_NAME "cb264_screen"
#define CB264_ROM_REGION "cb264_rom"
@ -122,10 +125,6 @@ void nubus_cb264_device::device_reset()
uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline, *base;
int x, y;
uint8_t pixels;
if (!m_cb264_vbl_disable)
{
raise_slot_irq();
@ -134,12 +133,12 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
switch (m_cb264_mode)
{
case 0: // 1 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0x80];
*scanline++ = m_palette[(pixels<<1)&0x80];
@ -154,12 +153,12 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
break;
case 1: // 2 bpp (3f/7f/bf/ff)
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/4; x++)
{
pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0xc0];
*scanline++ = m_palette[(pixels<<2)&0xc0];
@ -170,13 +169,12 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
break;
case 2: // 4 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/2; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/2; x++)
{
pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0xf0];
*scanline++ = m_palette[(pixels<<4)&0xf0];
@ -185,13 +183,12 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
break;
case 3: // 8 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640; x++)
{
pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
@ -200,16 +197,11 @@ uint32_t nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &
case 4: // 24 bpp
case 7: // ???
{
uint32_t *vram32 = (uint32_t *)&m_vram[0];
uint32_t const *const vram32 = (uint32_t *)&m_vram[0];
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
base = &vram32[y * 1024];
for (x = 0; x < 640; x++)
{
*scanline++ = *base++;
}
std::copy_n(&vram32[y * 1024], 640, &bitmap.pix(y));
}
}
break;

View File

@ -137,41 +137,37 @@ void nubus_m2hires_device::device_timer(emu_timer &timer, device_timer_id tid, i
uint32_t nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
vram = &m_vram[0x20];
uint8_t const *const vram = &m_vram[0x20];
switch (m_mode)
{
case 0: // 1 bpp?
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>7)&0x1)];
*scanline++ = m_palette[((pixels>>6)&0x1)];
*scanline++ = m_palette[((pixels>>5)&0x1)];
*scanline++ = m_palette[((pixels>>4)&0x1)];
*scanline++ = m_palette[((pixels>>3)&0x1)];
*scanline++ = m_palette[((pixels>>2)&0x1)];
*scanline++ = m_palette[((pixels>>1)&0x1)];
*scanline++ = m_palette[(pixels&1)];
*scanline++ = m_palette[BIT(pixels, 7)];
*scanline++ = m_palette[BIT(pixels, 6)];
*scanline++ = m_palette[BIT(pixels, 5)];
*scanline++ = m_palette[BIT(pixels, 4)];
*scanline++ = m_palette[BIT(pixels, 3)];
*scanline++ = m_palette[BIT(pixels, 2)];
*scanline++ = m_palette[BIT(pixels, 1)];
*scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/4; x++)
{
pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>6)&3)];
*scanline++ = m_palette[((pixels>>4)&3)];
@ -182,13 +178,13 @@ uint32_t nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 2: // 4 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
for (x = 0; x < 640/2; x++)
for (int x = 0; x < 640/2; x++)
{
pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels&0xf0)>>4)];
*scanline++ = m_palette[(pixels&0xf)];
@ -197,13 +193,13 @@ uint32_t nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 3: // 8 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
for (x = 0; x < 640; x++)
for (int x = 0; x < 640; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}

View File

@ -139,21 +139,17 @@ void nubus_m2video_device::device_timer(emu_timer &timer, device_timer_id tid, i
uint32_t nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
vram = &m_vram[0x20];
uint8_t const *const vram = &m_vram[0x20];
switch (m_mode)
{
case 0: // 1 bpp?
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0x80)];
*scanline++ = m_palette[((pixels<<1)&0x80)];
@ -168,12 +164,12 @@ uint32_t nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 1: // 2 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/4; x++)
{
pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xc0)];
*scanline++ = m_palette[((pixels<<2)&0xc0)];
@ -184,13 +180,12 @@ uint32_t nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 2: // 4 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/2; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/2; x++)
{
pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xf0)];
*scanline++ = m_palette[((pixels&0x0f)<<4)];
@ -199,13 +194,12 @@ uint32_t nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 3: // 8 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}

View File

@ -139,27 +139,23 @@ void nubus_radiustpd_device::device_timer(emu_timer &timer, device_timer_id tid,
uint32_t nubus_radiustpd_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
uint8_t const *const vram = &m_vram[0x200];
vram = &m_vram[0x200];
for (y = 0; y < 880; y++)
for (int y = 0; y < 880; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1152/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1152/8; x++)
{
pixels = vram[(y * (1152/8)) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * (1152/8)) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>7)&0x1)];
*scanline++ = m_palette[((pixels>>6)&0x1)];
*scanline++ = m_palette[((pixels>>5)&0x1)];
*scanline++ = m_palette[((pixels>>4)&0x1)];
*scanline++ = m_palette[((pixels>>3)&0x1)];
*scanline++ = m_palette[((pixels>>2)&0x1)];
*scanline++ = m_palette[((pixels>>1)&0x1)];
*scanline++ = m_palette[(pixels&1)];
*scanline++ = m_palette[BIT(pixels, 7)];
*scanline++ = m_palette[BIT(pixels, 6)];
*scanline++ = m_palette[BIT(pixels, 5)];
*scanline++ = m_palette[BIT(pixels, 4)];
*scanline++ = m_palette[BIT(pixels, 3)];
*scanline++ = m_palette[BIT(pixels, 2)];
*scanline++ = m_palette[BIT(pixels, 1)];
*scanline++ = m_palette[BIT(pixels, 0)];
}
}

View File

@ -144,21 +144,17 @@ void nubus_spec8s3_device::device_timer(emu_timer &timer, device_timer_id tid, i
uint32_t nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
vram = &m_vram[0x400];
uint8_t const *const vram = &m_vram[0x400];
switch (m_mode)
{
case 0: // 1 bpp
for (y = 0; y < 768; y++)
for (int y = 0; y < 768; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1024/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1024/8; x++)
{
pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0x80];
*scanline++ = m_palette[(pixels<<1)&0x80];
@ -173,12 +169,12 @@ uint32_t nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 1: // 2 bpp
for (y = 0; y < 768; y++)
for (int y = 0; y < 768; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1024/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1024/4; x++)
{
pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0xc0];
*scanline++ = m_palette[(pixels<<2)&0xc0];
@ -189,13 +185,12 @@ uint32_t nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 2: // 4 bpp
for (y = 0; y < 768; y++)
for (int y = 0; y < 768; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1024/2; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1024/2; x++)
{
pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels&0xf0];
*scanline++ = m_palette[(pixels<<4)&0xf0];
@ -204,13 +199,12 @@ uint32_t nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 3: // 8 bpp
for (y = 0; y < 768; y++)
for (int y = 0; y < 768; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1024; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1024; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}

View File

@ -157,22 +157,18 @@ void nubus_specpdq_device::device_timer(emu_timer &timer, device_timer_id tid, i
uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
// first time? kick off the VBL timer
vram = &m_vram[0x9000];
uint8_t const *const vram = &m_vram[0x9000];
switch (m_mode)
{
case 0: // 1 bpp
for (y = 0; y < 844; y++)
for (int y = 0; y < 844; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1152/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1152/8; x++)
{
pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette_val[(pixels&0x80)];
*scanline++ = m_palette_val[((pixels<<1)&0x80)];
@ -187,12 +183,12 @@ uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 1: // 2 bpp
for (y = 0; y < 844; y++)
for (int y = 0; y < 844; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1152/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1152/4; x++)
{
pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette_val[(pixels&0xc0)];
*scanline++ = m_palette_val[((pixels<<2)&0xc0)];
@ -203,13 +199,12 @@ uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 2: // 4 bpp
for (y = 0; y < 844; y++)
for (int y = 0; y < 844; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1152/2; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1152/2; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette_val[(pixels&0xf0)];
*scanline++ = m_palette_val[((pixels<<4)&0xf0)];
@ -218,13 +213,12 @@ uint32_t nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32
break;
case 3: // 8 bpp
for (y = 0; y < 844; y++)
for (int y = 0; y < 844; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1152; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1152; x++)
{
pixels = vram[(y * 1152) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1152) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette_val[pixels];
}
}

View File

@ -117,30 +117,26 @@ void nubus_vikbw_device::device_reset()
uint32_t nubus_vikbw_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels;
if (!m_vbl_disable)
{
raise_slot_irq();
}
for (y = 0; y < 768; y++)
for (int y = 0; y < 768; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 1024/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1024/8; x++)
{
pixels = m_vram[(y * 128) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = m_vram[(y * 128) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>7)&1];
*scanline++ = m_palette[(pixels>>6)&1];
*scanline++ = m_palette[(pixels>>5)&1];
*scanline++ = m_palette[(pixels>>4)&1];
*scanline++ = m_palette[(pixels>>3)&1];
*scanline++ = m_palette[(pixels>>2)&1];
*scanline++ = m_palette[(pixels>>1)&1];
*scanline++ = m_palette[(pixels&1)];
*scanline++ = m_palette[BIT(pixels, 7)];
*scanline++ = m_palette[BIT(pixels, 6)];
*scanline++ = m_palette[BIT(pixels, 5)];
*scanline++ = m_palette[BIT(pixels, 4)];
*scanline++ = m_palette[BIT(pixels, 3)];
*scanline++ = m_palette[BIT(pixels, 2)];
*scanline++ = m_palette[BIT(pixels, 1)];
*scanline++ = m_palette[BIT(pixels, 0)];
}
}

View File

@ -137,42 +137,38 @@ void nubus_wsportrait_device::device_timer(emu_timer &timer, device_timer_id tid
uint32_t nubus_wsportrait_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
// first time? kick off the VBL timer
vram = &m_vram[0x80];
uint8_t const *const vram = &m_vram[0x80];
switch (m_mode)
{
case 0: // 1 bpp?
for (y = 0; y < 870; y++)
for (int y = 0; y < 870; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>7)&0x1)];
*scanline++ = m_palette[((pixels>>6)&0x1)];
*scanline++ = m_palette[((pixels>>5)&0x1)];
*scanline++ = m_palette[((pixels>>4)&0x1)];
*scanline++ = m_palette[((pixels>>3)&0x1)];
*scanline++ = m_palette[((pixels>>2)&0x1)];
*scanline++ = m_palette[((pixels>>1)&0x1)];
*scanline++ = m_palette[(pixels&1)];
*scanline++ = m_palette[BIT(pixels, 7)];
*scanline++ = m_palette[BIT(pixels, 6)];
*scanline++ = m_palette[BIT(pixels, 5)];
*scanline++ = m_palette[BIT(pixels, 4)];
*scanline++ = m_palette[BIT(pixels, 3)];
*scanline++ = m_palette[BIT(pixels, 2)];
*scanline++ = m_palette[BIT(pixels, 1)];
*scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/4; x++)
{
pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>6)&3)];
*scanline++ = m_palette[((pixels>>4)&3)];
@ -183,13 +179,12 @@ uint32_t nubus_wsportrait_device::screen_update(screen_device &screen, bitmap_rg
break;
case 2: // 4 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/2; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/2; x++)
{
pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels&0xf0)>>4)];
*scanline++ = m_palette[(pixels&0xf)];

View File

@ -139,41 +139,37 @@ void nubus_xceed30hr_device::device_timer(emu_timer &timer, device_timer_id tid,
uint32_t nubus_xceed30hr_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
vram = &m_vram[1024];
uint8_t const *const vram = &m_vram[1024];
switch (m_mode)
{
case 0: // 1 bpp?
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>7)&1];
*scanline++ = m_palette[(pixels>>6)&1];
*scanline++ = m_palette[(pixels>>5)&1];
*scanline++ = m_palette[(pixels>>4)&1];
*scanline++ = m_palette[(pixels>>3)&1];
*scanline++ = m_palette[(pixels>>2)&1];
*scanline++ = m_palette[(pixels>>1)&1];
*scanline++ = m_palette[pixels&1];
*scanline++ = m_palette[BIT(pixels, 7)];
*scanline++ = m_palette[BIT(pixels, 6)];
*scanline++ = m_palette[BIT(pixels, 5)];
*scanline++ = m_palette[BIT(pixels, 4)];
*scanline++ = m_palette[BIT(pixels, 3)];
*scanline++ = m_palette[BIT(pixels, 2)];
*scanline++ = m_palette[BIT(pixels, 1)];
*scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/4; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>6)&3)];
*scanline++ = m_palette[((pixels>>4)&3)];
@ -184,13 +180,12 @@ uint32_t nubus_xceed30hr_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 2: // 4 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/2; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/2; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>4)];
*scanline++ = m_palette[(pixels&0xf)];
@ -199,13 +194,12 @@ uint32_t nubus_xceed30hr_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 3: // 8 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}

View File

@ -10,6 +10,9 @@
#include "pds30_cb264.h"
#include "screen.h"
#include <algorithm>
#define CB264SE30_SCREEN_NAME "cb264_screen"
#define CB264SE30_ROM_REGION "cb264_rom"
@ -133,21 +136,17 @@ void nubus_cb264se30_device::device_timer(emu_timer &timer, device_timer_id tid,
uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
vram = &m_vram[8*1024];
uint8_t const *const vram = &m_vram[8*1024];
switch (m_mode)
{
case 0: // 1 bpp?
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0x80)];
*scanline++ = m_palette[((pixels<<1)&0x80)];
@ -162,12 +161,12 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 1: // 2 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/4; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xc0)];
*scanline++ = m_palette[((pixels<<2)&0xc0)];
@ -178,13 +177,12 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 2: // 4 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/2; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/2; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xf0)];
*scanline++ = m_palette[((pixels&0x0f)<<4)];
@ -193,13 +191,12 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 3: // 8 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
@ -207,17 +204,11 @@ uint32_t nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb
case 4: // 24 bpp
{
uint32_t *vram32 = (uint32_t *)&m_vram[0];
uint32_t *base;
uint32_t const *const vram32 = (uint32_t *)&m_vram[0];
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
base = &vram32[y * 1024];
for (x = 0; x < 640; x++)
{
*scanline++ = *base++;
}
std::copy_n(&vram32[y * 1024], 640, &bitmap.pix(y));
}
}
break;

View File

@ -13,6 +13,9 @@
#include "pds30_mc30.h"
#include "screen.h"
#include <algorithm>
#define XCEEDMC30_SCREEN_NAME "x30hr_screen"
#define XCEEDMC30_ROM_REGION "x30hr_rom"
@ -135,41 +138,37 @@ void nubus_xceedmc30_device::device_timer(emu_timer &timer, device_timer_id tid,
uint32_t nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
vram = &m_vram[4*1024];
uint8_t const *const vram = &m_vram[4*1024];
switch (m_mode)
{
case 0: // 1 bpp?
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>7)&1];
*scanline++ = m_palette[(pixels>>6)&1];
*scanline++ = m_palette[(pixels>>5)&1];
*scanline++ = m_palette[(pixels>>4)&1];
*scanline++ = m_palette[(pixels>>3)&1];
*scanline++ = m_palette[(pixels>>2)&1];
*scanline++ = m_palette[(pixels>>1)&1];
*scanline++ = m_palette[pixels&1];
*scanline++ = m_palette[BIT(pixels, 7)];
*scanline++ = m_palette[BIT(pixels, 6)];
*scanline++ = m_palette[BIT(pixels, 5)];
*scanline++ = m_palette[BIT(pixels, 4)];
*scanline++ = m_palette[BIT(pixels, 3)];
*scanline++ = m_palette[BIT(pixels, 2)];
*scanline++ = m_palette[BIT(pixels, 1)];
*scanline++ = m_palette[BIT(pixels, 0)];
}
}
break;
case 1: // 2 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/4; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[((pixels>>6)&3)];
*scanline++ = m_palette[((pixels>>4)&3)];
@ -180,13 +179,13 @@ uint32_t nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 2: // 4 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
for (x = 0; x < 640/2; x++)
for (int x = 0; x < 640/2; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels>>4)];
*scanline++ = m_palette[(pixels&0xf)];
@ -195,13 +194,13 @@ uint32_t nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb
break;
case 3: // 8 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
for (x = 0; x < 640; x++)
for (int x = 0; x < 640; x++)
{
pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
@ -209,17 +208,11 @@ uint32_t nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb
case 4: // 24 bpp
{
uint32_t *vram32 = (uint32_t *)vram;
uint32_t *base;
uint32_t const *const vram32 = (uint32_t *)vram;
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
base = &vram32[y * 1024];
for (x = 0; x < 640; x++)
{
*scanline++ = *base++;
}
std::copy_n(&vram32[y * 1024], 640, &bitmap.pix(y));
}
}
break;

View File

@ -139,21 +139,17 @@ void nubus_procolor816_device::device_timer(emu_timer &timer, device_timer_id ti
uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
vram = &m_vram[4];
uint8_t const *const vram = &m_vram[4];
switch (m_mode)
{
case 0: // 1 bpp?
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/8; x++)
{
pixels = vram[(y * 640/8) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 640/8) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0x80)];
*scanline++ = m_palette[((pixels<<1)&0x80)];
@ -168,12 +164,12 @@ uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_r
break;
case 1: // 2 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/4; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/4; x++)
{
pixels = vram[(y * 640/4) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 640/4) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xc0)];
*scanline++ = m_palette[((pixels<<2)&0xc0)];
@ -184,13 +180,12 @@ uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_r
break;
case 2: // 4 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640/2; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640/2; x++)
{
pixels = vram[(y * 640/2) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 640/2) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0xf0)];
*scanline++ = m_palette[((pixels&0x0f)<<4)];
@ -199,13 +194,12 @@ uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_r
break;
case 3: // 8 bpp
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640; x++)
{
pixels = vram[(y * 640) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * 640) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[pixels];
}
}
@ -213,16 +207,15 @@ uint32_t nubus_procolor816_device::screen_update(screen_device &screen, bitmap_r
case 4: // 15 bpp
{
uint16_t *vram16 = (uint16_t *)&m_vram[0];
uint16_t pixels;
uint16_t const *const vram16 = (uint16_t *)&m_vram[0];
for (y = 0; y < 480; y++)
for (int y = 0; y < 480; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 640; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 640; x++)
{
pixels = vram16[(y * 640) + (x^1)];
*scanline++ = rgb_t(((pixels>>10) & 0x1f)<<3, ((pixels>>5) & 0x1f)<<3, (pixels & 0x1f)<<3);
uint16_t const pixels = vram16[(y * 640) + BYTE_XOR_BE(x)];
*scanline++ = rgb_t(pal5bit((pixels>>10) & 0x1f), pal5bit((pixels>>5) & 0x1f), pal5bit(pixels & 0x1f));
}
}
}

View File

@ -132,18 +132,14 @@ void nubus_lview_device::device_timer(emu_timer &timer, device_timer_id tid, int
uint32_t nubus_lview_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels, *vram;
uint8_t const *const vram = &m_vram[0x20];
vram = &m_vram[0x20];
for (y = 0; y < 600; y++)
for (int y = 0; y < 600; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 832/8; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 832/8; x++)
{
pixels = vram[(y * (832/8)) + (BYTE4_XOR_BE(x))];
uint8_t const pixels = vram[(y * (832/8)) + (BYTE4_XOR_BE(x))];
*scanline++ = m_palette[(pixels&0x80)];
*scanline++ = m_palette[((pixels<<1)&0x80)];

View File

@ -39,28 +39,26 @@ void dg640_device::device_start()
uint32_t dg640_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// attributes bit 0 = flash, bit 1 = lores. Also bit 7 of the character = reverse-video (text only).
uint8_t y,ra,chr,gfx,attr,inv,gfxbit;
uint16_t sy=0,ma=0,x;
bool flash;
uint16_t sy=0,ma=0;
m_framecnt++;
for (y = 0; y < 16; y++)
for (uint8_t y = 0; y < 16; y++)
{
for (ra = 0; ra < 16; ra++)
for (uint8_t ra = 0; ra < 16; ra++)
{
uint16_t *p = &bitmap.pix16(sy++);
uint16_t *p = &bitmap.pix(sy++);
for (x = ma; x < ma + 64; x++)
for (uint16_t x = ma; x < ma + 64; x++)
{
attr = m_p_attribram[x];
chr = m_p_videoram[x];
flash = BIT(m_framecnt, 4) & BIT(attr, 0);
uint8_t attr = m_p_attribram[x];
uint8_t chr = m_p_videoram[x];
bool flash = BIT(m_framecnt, 4) & BIT(attr, 0);
if (BIT(attr, 1)) // lores gfx - can flash
{
if (flash) chr = 0; // blank part of flashing
gfxbit = (ra & 0x0c)>>1;
uint8_t gfxbit = (ra & 0x0c) >> 1;
/* Display one line of a lores character (8 pixels) */
*p++ = BIT(chr, gfxbit);
*p++ = BIT(chr, gfxbit);
@ -74,11 +72,11 @@ uint32_t dg640_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
}
else
{
gfx = 0;
uint8_t gfx = 0;
if (!flash)
{
inv = BIT(chr, 7) ? 0xff : 0; // text with bit 7 high is reversed
uint8_t inv = BIT(chr, 7) ? 0xff : 0; // text with bit 7 high is reversed
chr &= 0x7f;
gfx = inv;

View File

@ -119,22 +119,22 @@ u32 poly_vti_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
u8 r = b/5;
if (l==0 && r==0)
bitmap.pix16(y*15+j, xpos+b ) = BIT(code,5) ? 0 : 1;
bitmap.pix(y*15+j, xpos+b ) = BIT(code,5) ? 0 : 1;
if (l==0 && r==1)
bitmap.pix16(y*15+j, xpos+b ) = BIT(code,2) ? 0 : 1;
bitmap.pix(y*15+j, xpos+b ) = BIT(code,2) ? 0 : 1;
if (l==1 && r==0)
bitmap.pix16(y*15+j, xpos+b ) = BIT(code,4) ? 0 : 1;
bitmap.pix(y*15+j, xpos+b ) = BIT(code,4) ? 0 : 1;
if (l==1 && r==1)
bitmap.pix16(y*15+j, xpos+b ) = BIT(code,1) ? 0 : 1;
bitmap.pix(y*15+j, xpos+b ) = BIT(code,1) ? 0 : 1;
if (l==2 && r==0)
bitmap.pix16(y*15+j, xpos+b ) = BIT(code,3) ? 0 : 1;
bitmap.pix(y*15+j, xpos+b ) = BIT(code,3) ? 0 : 1;
if (l==2 && r==1)
bitmap.pix16(y*15+j, xpos+b ) = BIT(code,0) ? 0 : 1;
bitmap.pix(y*15+j, xpos+b ) = BIT(code,0) ? 0 : 1;
}
}
}
@ -156,11 +156,11 @@ u32 poly_vti_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
}
for (int b = 0; b < 7; b++)
bitmap.pix16(y*15+j, xpos+b ) = (l >> (6-b)) & 1;
bitmap.pix(y*15+j, xpos+b ) = (l >> (6-b)) & 1;
bitmap.pix16(y*15+j, xpos+7 ) = 0;
bitmap.pix16(y*15+j, xpos+8 ) = 0;
bitmap.pix16(y*15+j, xpos+9 ) = 0;
bitmap.pix(y*15+j, xpos+7 ) = 0;
bitmap.pix(y*15+j, xpos+8 ) = 0;
bitmap.pix(y*15+j, xpos+9 ) = 0;
}
}
xpos += 10;

View File

@ -10,6 +10,9 @@
#include "bwtwo.h"
#include "screen.h"
#include <algorithm>
DEFINE_DEVICE_TYPE(SBUS_BWTWO, sbus_bwtwo_device, "bwtwo", "Sun bwtwo SBus Video")
void sbus_bwtwo_device::mem_map(address_map &map)
@ -72,14 +75,14 @@ void sbus_bwtwo_device::install_device()
uint32_t sbus_bwtwo_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint8_t *line = &m_vram[0];
uint8_t const *line = &m_vram[0];
for (int y = 0; y < 900; y++)
{
uint32_t *scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1152/8; x++)
{
memcpy(scanline, m_mono_lut[*line], sizeof(uint32_t) * 8);
std::copy_n(m_mono_lut[*line], 8, scanline);
line++;
scanline += 8;
}

View File

@ -171,12 +171,12 @@ void sbus_cgsix_device::device_reset()
uint32_t sbus_cgsix_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
const pen_t *pens = m_ramdac->pens();
uint8_t *vram = (uint8_t *)&m_vram[0];
pen_t const *const pens = m_ramdac->pens();
uint8_t const *const vram = (uint8_t *)&m_vram[0];
for (int16_t y = 0; y < 900; y++)
{
uint32_t *scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
const bool cursor_row_hit = (y >= m_cursor_y && y < (m_cursor_y + 32));
for (int16_t x = 0; x < 1152; x++)
{

View File

@ -67,12 +67,12 @@ void sbus_cgthree_device::install_device()
uint32_t sbus_cgthree_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
const pen_t *pens = m_ramdac->pens();
uint8_t *vram = (uint8_t *)&m_vram[0];
pen_t const *const pens = m_ramdac->pens();
uint8_t const *const vram = (uint8_t *)&m_vram[0];
for (int y = 0; y < 900; y++)
{
uint32_t *scanline = &bitmap.pix32(y);
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 1152; x++)
{
const uint8_t pixel = vram[y * 1152 + BYTE4_XOR_BE(x)];

View File

@ -94,7 +94,7 @@ void sv806_device::device_start()
MC6845_UPDATE_ROW( sv806_device::crtc_update_row )
{
const pen_t *pen = m_palette->pens();
pen_t const *const pen = m_palette->pens();
for (int i = 0; i < x_count; i++)
{
@ -103,14 +103,14 @@ MC6845_UPDATE_ROW( sv806_device::crtc_update_row )
if (i == cursor_x)
data = 0xff;
bitmap.pix32(y, i * 8 + 0) = pen[BIT(data, 7)];
bitmap.pix32(y, i * 8 + 1) = pen[BIT(data, 6)];
bitmap.pix32(y, i * 8 + 2) = pen[BIT(data, 5)];
bitmap.pix32(y, i * 8 + 3) = pen[BIT(data, 4)];
bitmap.pix32(y, i * 8 + 4) = pen[BIT(data, 3)];
bitmap.pix32(y, i * 8 + 5) = pen[BIT(data, 2)];
bitmap.pix32(y, i * 8 + 6) = pen[BIT(data, 1)];
bitmap.pix32(y, i * 8 + 7) = pen[BIT(data, 0)];
bitmap.pix(y, i * 8 + 0) = pen[BIT(data, 7)];
bitmap.pix(y, i * 8 + 1) = pen[BIT(data, 6)];
bitmap.pix(y, i * 8 + 2) = pen[BIT(data, 5)];
bitmap.pix(y, i * 8 + 3) = pen[BIT(data, 4)];
bitmap.pix(y, i * 8 + 4) = pen[BIT(data, 3)];
bitmap.pix(y, i * 8 + 5) = pen[BIT(data, 2)];
bitmap.pix(y, i * 8 + 6) = pen[BIT(data, 1)];
bitmap.pix(y, i * 8 + 7) = pen[BIT(data, 0)];
}
}

View File

@ -149,7 +149,7 @@ uint8_t tanbus_mpvdu_device::videoram_r(offs_t offset)
MC6845_UPDATE_ROW(tanbus_mpvdu_device::crtc_update_row)
{
uint32_t *p = &bitmap.pix32(y);
uint32_t *p = &bitmap.pix(y);
m_trom->lose_w(1);
m_trom->lose_w(0);
@ -165,11 +165,11 @@ MC6845_UPDATE_ROW(tanbus_mpvdu_device::crtc_update_row)
m_trom->tr6_w(1);
m_trom->tr6_w(0);
int col = m_trom->get_rgb() ^ ((column == cursor_x) ? 7 : 0);
int const col = m_trom->get_rgb() ^ ((column == cursor_x) ? 7 : 0);
int r = BIT(col, 0) * 0xff;
int g = BIT(col, 1) * 0xff;
int b = BIT(col, 2) * 0xff;
int const r = BIT(col, 0) * 0xff;
int const g = BIT(col, 1) * 0xff;
int const b = BIT(col, 2) * 0xff;
*p++ = rgb_t(r, g, b);
}

View File

@ -161,7 +161,7 @@ uint8_t tanbus_ravdu_device::videoram_r(offs_t offset)
MC6845_UPDATE_ROW(tanbus_ravdu_device::crtc_update_row)
{
uint32_t *p = &bitmap.pix32(y);
uint32_t *p = &bitmap.pix(y);
m_trom->lose_w(1);
m_trom->lose_w(0);
@ -178,11 +178,11 @@ MC6845_UPDATE_ROW(tanbus_ravdu_device::crtc_update_row)
m_trom->tr6_w(1);
m_trom->tr6_w(0);
int col = m_trom->get_rgb() ^ ((column == cursor_x) ? 7 : 0);
int const col = m_trom->get_rgb() ^ ((column == cursor_x) ? 7 : 0);
int r = BIT(col, 0) * 0xff;
int g = BIT(col, 1) * 0xff;
int b = BIT(col, 2) * 0xff;
int const r = BIT(col, 0) * 0xff;
int const g = BIT(col, 1) * 0xff;
int const b = BIT(col, 2) * 0xff;
*p++ = rgb_t(r, g, b);
}

View File

@ -323,16 +323,13 @@ void tanbus_tanhrgc_device::set_inhibit_lines(offs_t offset, int &inhram, int &i
uint32_t tanbus_tanhrg_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint16_t offset;
uint32_t *p;
for (int y = 0; y < 256; y++)
{
p = &bitmap.pix32(y);
uint32_t *p = &bitmap.pix(y);
for (int x = 0; x < 256; x++)
{
offset = (y * 32) + (x / 8);
uint16_t const offset = (y * 32) + (x / 8);
*p++ = m_palette->pen_color(BIT(m_videoram[offset], x & 7));
}
@ -344,21 +341,17 @@ uint32_t tanbus_tanhrg_device::screen_update(screen_device &screen, bitmap_rgb32
uint32_t tanbus_tanhrgc_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint8_t r, g, b;
uint16_t offset;
uint32_t *p;
for (int y = 0; y < 256; y++)
{
p = &bitmap.pix32(y);
uint32_t *p = &bitmap.pix(y);
for (int x = 0; x < 256; x++)
{
offset = (y * 32) + (x / 8);
uint16_t const offset = (y * 32) + (x / 8);
r = m_videoram[0x0000 | offset];
b = m_videoram[0x2000 | offset];
g = m_videoram[0x4000 | offset];
uint8_t const r = m_videoram[0x0000 | offset];
uint8_t const b = m_videoram[0x2000 | offset];
uint8_t const g = m_videoram[0x4000 | offset];
*p++ = m_palette->pen_color(BIT(b, x & 7) << 2 | BIT(g, x & 7) << 1 | BIT(r, x & 7));
}

View File

@ -241,18 +241,14 @@ WRITE_LINE_MEMBER(tanbus_tug8082_device::vdu_irq_w)
uint32_t tanbus_tug8082_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint32_t *scanline;
int x, y;
uint8_t pixels;
pen_t const *const pen = m_palette->pens();
const pen_t *pen = m_palette->pens();
for (y = 0; y < 256; y++)
for (int y = 0; y < 256; y++)
{
scanline = &bitmap.pix32(y);
for (x = 0; x < 64; x++)
uint32_t *scanline = &bitmap.pix(y);
for (int x = 0; x < 64; x++)
{
pixels = m_videoram[(y * 64) + x];
uint8_t const pixels = m_videoram[(y * 64) + x];
for (int i = 0; i < 8; ++i)
*scanline++ = pen[BIT(pixels, 7 - i)];

View File

@ -202,7 +202,7 @@ void video992_device::device_timer(emu_timer &timer, device_timer_id id, int par
}
int vpos = raw_vpos * m_vertical_size / screen().height();
uint32_t *p = &m_tmpbmp.pix32(vpos);
uint32_t *p = &m_tmpbmp.pix(vpos);
bool endofline = false;
int linelength = 0;

View File

@ -77,7 +77,7 @@ MC6845_UPDATE_ROW( vic20_video_pak_device::crtc_update_row )
int x = (column * 8) + bit;
int color = BIT(data, 7) && de;
bitmap.pix32(vbp + y, hbp + x) = pen[color];
bitmap.pix(vbp + y, hbp + x) = pen[color];
data <<= 1;
}

View File

@ -62,17 +62,17 @@ MC6845_UPDATE_ROW( wangpc_lvc_device::crtc_update_row )
{
for (int column = 0; column < x_count; column++)
{
offs_t addr = scroll_y + (m_scroll & 0x3f) + ((ma / 80) * 0x480) + (((ra & 0x0f) << 7) | (column & 0x7f));
offs_t const addr = scroll_y + (m_scroll & 0x3f) + ((ma / 80) * 0x480) + (((ra & 0x0f) << 7) | (column & 0x7f));
uint16_t data = m_video_ram[addr & 0x7fff];
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int const x = (column * 8) + bit;
int color = (BIT(data, 15) << 1) | BIT(data, 7);
if (column == cursor_x) color = 0x03;
bitmap.pix32(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black();
bitmap.pix(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black();
data <<= 1;
}
@ -89,12 +89,12 @@ MC6845_UPDATE_ROW( wangpc_lvc_device::crtc_update_row )
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int const x = (column * 8) + bit;
int color = (BIT(data, 31) << 3) | (BIT(data, 23) << 2) | (BIT(data, 15) << 1) | BIT(data, 7);
if (column == cursor_x) color = 0x03;
bitmap.pix32(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black();
bitmap.pix(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black();
data <<= 1;
}

View File

@ -73,15 +73,15 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row )
{
for (int sx = 0; sx < 50; sx++)
{
offs_t addr = (y * 50) + sx;
offs_t const addr = (y * 50) + sx;
uint16_t data = m_bitmap_ram[addr];
for (int bit = 0; bit < 16; bit++)
{
int x = (sx * 16) + bit;
int color = BIT(data, 15) && de;
int const x = (sx * 16) + bit;
int const color = BIT(data, 15) && de;
bitmap.pix32(vbp + y, hbp + x) = PALETTE_MVC[color];
bitmap.pix(vbp + y, hbp + x) = PALETTE_MVC[color];
data <<= 1;
}
@ -89,8 +89,8 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row )
for (int column = 0; column < x_count; column++)
{
uint16_t code = m_video_ram[((ma + column) & 0x7ff)];
uint8_t attr = code & 0xff;
uint16_t const code = m_video_ram[((ma + column) & 0x7ff)];
uint8_t const attr = code & 0xff;
uint8_t new_ra = ra + 1;
@ -103,7 +103,7 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row )
new_ra = ra;
}
offs_t addr = ((code >> 8) << 4) | (new_ra & 0x0f);
offs_t const addr = ((code >> 8) << 4) | (new_ra & 0x0f);
uint16_t data = m_char_ram[addr & 0xfff];
if ((column == cursor_x) || (!ra && ATTR_OVERSCORE) || ((ra == 9) && ATTR_UNDERSCORE))
@ -113,11 +113,13 @@ MC6845_UPDATE_ROW( wangpc_mvc_device::crtc_update_row )
for (int bit = 0; bit < 10; bit++)
{
int x = (column * 10) + bit;
int const x = (column * 10) + bit;
int color = ((BIT(data, 9) & ~ATTR_BLANK) ^ ATTR_REVERSE);
if ((color | bitmap.pix32(vbp + y, hbp + x)) & ATTR_BOLD) color = 2;
if (color) bitmap.pix32(vbp + y, hbp + x) = de ? PALETTE_MVC[color] : rgb_t::black();
if ((color | bitmap.pix(vbp + y, hbp + x)) & ATTR_BOLD)
color = 2;
if (color)
bitmap.pix(vbp + y, hbp + x) = de ? PALETTE_MVC[color] : rgb_t::black();
data <<= 1;
}

View File

@ -589,7 +589,7 @@ u32 e0c6s46_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
if (!m_pixel_update_cb.isnull())
m_pixel_update_cb(bitmap, cliprect, m_lcd_contrast, seg, com, pixel);
else if (cliprect.contains(seg, com))
bitmap.pix16(com, seg) = pixel;
bitmap.pix(com, seg) = pixel;
}
}
}

View File

@ -1178,7 +1178,7 @@ uint32_t tms340x0_device::tms340x0_ind16(screen_device &screen, bitmap_ind16 &bi
params.heblnk = params.hsblnk = cliprect.max_x + 1;
/* blank out the blank regions */
uint16_t *dest = &bitmap.pix16(cliprect.min_y);
uint16_t *dest = &bitmap.pix(cliprect.min_y);
for (x = cliprect.min_x; x < params.heblnk; x++)
dest[x] = blackpen;
for (x = params.hsblnk; x <= cliprect.max_x; x++)
@ -1209,7 +1209,7 @@ uint32_t tms340x0_device::tms340x0_rgb32(screen_device &screen, bitmap_rgb32 &bi
params.heblnk = params.hsblnk = cliprect.max_x + 1;
/* blank out the blank regions */
uint32_t *dest = &bitmap.pix32(cliprect.min_y);
uint32_t *dest = &bitmap.pix(cliprect.min_y);
for (x = cliprect.min_x; x < params.heblnk; x++)
dest[x] = blackpen;
for (x = params.hsblnk; x <= cliprect.max_x; x++)

View File

@ -284,7 +284,7 @@ void vt5x_cpu_device::draw_char_line()
if (xc > screen().visible_area().right() - 8)
return;
u32 *pix = &m_bitmap.pix32(m_current_line, xc);
u32 *pix = &m_bitmap.pix(m_current_line, xc);
if (m_video_process && m_cursor_ff && m_cursor_active)
std::fill_n(pix, 9, rgb_t::white());
else if (!m_video_process || m_cursor_ff)

View File

@ -492,9 +492,9 @@ void acorn_vidc10_device::draw(bitmap_rgb32 &bitmap, const rectangle &cliprect,
if (is_cursor == true && dot == 0)
continue;
dot += pen_base;
bitmap.pix32(dsty, dstx+xi) = this->pen(dot);
bitmap.pix(dsty, dstx+xi) = this->pen(dot);
if (m_crtc_interlace)
bitmap.pix32(dsty+1, dstx+xi) = this->pen(dot);
bitmap.pix(dsty+1, dstx+xi) = this->pen(dot);
}
}
}

View File

@ -348,7 +348,7 @@ u32 exorterm155_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
u16 sy = 0, ma = 0;
u8 disable_fac = m_disable_fac->read() == 0;
u8 display_fac = m_display_fac->read() == 0;
const rgb_t *palette = m_palette->palette()->entry_list_raw();
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
m_framecnt++;
@ -356,7 +356,7 @@ u32 exorterm155_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
{
for (u8 ra = 0; ra < 12; ra++)
{
u32 *p = &bitmap.pix32(sy++);
u32 *p = &bitmap.pix(sy++);
// FAC codes are cleared on horizontal sync.
u8 underline1 = 0;
u8 underline2 = 0;

View File

@ -637,7 +637,8 @@ void ie15_device::scanline_callback()
uint32_t ie15_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
update_leds();
memcpy(&bitmap.pix32(0), &m_tmpbmp[0], sizeof(uint32_t) * IE15_TOTAL_HORZ * IE15_TOTAL_VERT);
for (int y = 0; y < IE15_TOTAL_VERT; y++)
std::copy_n(&m_tmpbmp[y * IE15_TOTAL_HORZ], IE15_TOTAL_HORZ, &bitmap.pix(y));
return 0;
}

View File

@ -712,10 +712,10 @@ void laserdisc_device::init_video()
fillbitmap_yuy16(frame.m_bitmap, 40, 109, 240);
// make a copy of the bitmap that clips out the VBI and horizontal blanking areas
frame.m_visbitmap.wrap(&frame.m_bitmap.pix16(44, frame.m_bitmap.width() * 8 / 720),
frame.m_bitmap.width() - 2 * frame.m_bitmap.width() * 8 / 720,
frame.m_bitmap.height() - 44,
frame.m_bitmap.rowpixels());
frame.m_visbitmap.wrap(&frame.m_bitmap.pix(
44, frame.m_bitmap.width() * 8 / 720),
frame.m_bitmap.width() - 2 * frame.m_bitmap.width() * 8 / 720, frame.m_bitmap.height() - 44,
frame.m_bitmap.rowpixels());
frame.m_visbitmap.set_palette(m_videopalette);
}
@ -789,7 +789,7 @@ void laserdisc_device::fillbitmap_yuy16(bitmap_yuy16 &bitmap, uint8_t yval, uint
// write 32 bits of color (2 pixels at a time)
for (int y = 0; y < bitmap.height(); y++)
{
uint16_t *dest = &bitmap.pix16(y);
uint16_t *dest = &bitmap.pix(y);
for (int x = 0; x < bitmap.width() / 2; x++)
{
*dest++ = color0;
@ -918,7 +918,8 @@ void laserdisc_device::read_track_data()
frame->m_lastfield = m_curtrack * 2 + m_fieldnum;
// set the video target information
m_avhuff_config.video.wrap(&frame->m_bitmap.pix16(m_fieldnum), frame->m_bitmap.width(), frame->m_bitmap.height() / 2, frame->m_bitmap.rowpixels() * 2);
m_avhuff_video.wrap(&frame->m_bitmap.pix(m_fieldnum), frame->m_bitmap.width(), frame->m_bitmap.height() / 2, frame->m_bitmap.rowpixels() * 2);
m_avhuff_config.video = &m_avhuff_video;
// set the audio target information
if (m_audiobufin + m_audiomaxsamples <= m_audiobufsize)
@ -995,13 +996,13 @@ void laserdisc_device::process_track_data()
// remove the video if we had an error
if (m_readresult != CHDERR_NONE)
m_avhuff_config.video.reset();
m_avhuff_video.reset();
// count the field as read if we are successful
if (m_avhuff_config.video.valid())
if (m_avhuff_video.valid())
{
m_frame[m_videoindex].m_numfields++;
player_overlay(m_avhuff_config.video);
player_overlay(m_avhuff_video);
}
// pass the audio to the callback

View File

@ -277,28 +277,29 @@ private:
std::vector<uint8_t> m_vbidata; // pointer to precomputed VBI data
int m_width; // width of video
int m_height; // height of video
uint32_t m_fps_times_1million; // frame rate of video
uint32_t m_fps_times_1million; // frame rate of video
int m_samplerate; // audio samplerate
int m_readresult; // result of the most recent read
uint32_t m_chdtracks; // number of tracks in the CHD
avhuff_decompress_config m_avhuff_config; // decompression configuration
uint32_t m_chdtracks; // number of tracks in the CHD
bitmap_yuy16 m_avhuff_video; // decompresed frame buffer
avhuff_decoder::config m_avhuff_config; // decompression configuration
// async operations
osd_work_queue * m_work_queue; // work queue
uint32_t m_queued_hunknum; // queued hunk
uint32_t m_queued_hunknum; // queued hunk
// core states
uint8_t m_audiosquelch; // audio squelch state: bit 0 = audio 1, bit 1 = audio 2
uint8_t m_videosquelch; // video squelch state: bit 0 = on/off
uint8_t m_fieldnum; // field number (0 or 1)
int32_t m_curtrack; // current track at this end of this vsync
uint32_t m_maxtrack; // maximum track number
uint8_t m_audiosquelch; // audio squelch state: bit 0 = audio 1, bit 1 = audio 2
uint8_t m_videosquelch; // video squelch state: bit 0 = on/off
uint8_t m_fieldnum; // field number (0 or 1)
int32_t m_curtrack; // current track at this end of this vsync
uint32_t m_maxtrack; // maximum track number
attoseconds_t m_attospertrack; // attoseconds per track, or 0 if not moving
attotime m_sliderupdate; // time of last slider update
// video data
frame_data m_frame[3]; // circular list of frames
uint8_t m_videoindex; // index of the current video buffer
uint8_t m_videoindex; // index of the current video buffer
bitmap_yuy16 m_emptyframe; // blank frame
// audio data

View File

@ -784,12 +784,12 @@ void pioneer_pr8210_device::overlay_draw_group(bitmap_yuy16 &bitmap, const uint8
void pioneer_pr8210_device::overlay_erase(bitmap_yuy16 &bitmap, float xstart, float xend)
{
uint32_t xmin = (uint32_t)(xstart * 256.0f * float(bitmap.width()));
uint32_t xmax = (uint32_t)(xend * 256.0f * float(bitmap.width()));
uint32_t xmin = uint32_t(xstart * 256.0f * float(bitmap.width()));
uint32_t xmax = uint32_t(xend * 256.0f * float(bitmap.width()));
for (uint32_t y = OVERLAY_Y; y < (OVERLAY_Y + (OVERLAY_Y_PIXELS + 2) * OVERLAY_PIXEL_HEIGHT); y++)
{
uint16_t *dest = &bitmap.pix16(y, xmin >> 8);
uint16_t *dest = &bitmap.pix(y, xmin >> 8);
uint16_t ymax = *dest >> 8;
uint16_t ymin = ymax * 3 / 8;
uint16_t yres = ymin + ((ymax - ymin) * (xmin & 0xff)) / 256;
@ -819,8 +819,8 @@ void pioneer_pr8210_device::overlay_erase(bitmap_yuy16 &bitmap, float xstart, fl
void pioneer_pr8210_device::overlay_draw_char(bitmap_yuy16 &bitmap, uint8_t ch, float xstart)
{
uint32_t xminbase = (uint32_t)(xstart * 256.0f * float(bitmap.width()));
uint32_t xsize = (uint32_t)(OVERLAY_PIXEL_WIDTH * 256.0f * float(bitmap.width()));
uint32_t xminbase = uint32_t(xstart * 256.0f * float(bitmap.width()));
uint32_t xsize = uint32_t(OVERLAY_PIXEL_WIDTH * 256.0f * float(bitmap.width()));
// iterate over pixels
const uint8_t *chdataptr = &text_bitmap[ch & 0x3f][0];
@ -835,7 +835,7 @@ void pioneer_pr8210_device::overlay_draw_char(bitmap_yuy16 &bitmap, uint8_t ch,
uint32_t xmax = xmin + xsize;
for (uint32_t yy = 0; yy < OVERLAY_PIXEL_HEIGHT; yy++)
{
uint16_t *dest = &bitmap.pix16(OVERLAY_Y + (y + 1) * OVERLAY_PIXEL_HEIGHT + yy, xmin >> 8);
uint16_t *dest = &bitmap.pix(OVERLAY_Y + (y + 1) * OVERLAY_PIXEL_HEIGHT + yy, xmin >> 8);
uint16_t ymax = 0xff;
uint16_t ymin = *dest >> 8;
uint16_t yres = ymin + ((ymax - ymin) * (~xmin & 0xff)) / 256;

View File

@ -3044,20 +3044,17 @@ uint16_t mc68328_device::internal_read(offs_t offset, uint16_t mem_mask)
uint32_t mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint32_t vram_addr = m_regs.lssa & 0x00fffffe;
uint16_t word;
uint16_t *line;
int y, x, b;
if (m_regs.lckcon & LCKCON_LCDC_EN)
{
for (y = 0; y < 160; y++)
for (int y = 0; y < 160; y++)
{
line = &bitmap.pix16(y);
uint16_t *const line = &bitmap.pix(y);
for (x = 0; x < 160; x += 16, vram_addr += 2)
for (int x = 0; x < 160; x += 16, vram_addr += 2)
{
word = space(AS_PROGRAM).read_word(vram_addr);
for (b = 0; b < 16; b++)
uint16_t const word = space(AS_PROGRAM).read_word(vram_addr);
for (int b = 0; b < 16; b++)
{
line[x + b] = (word >> (15 - b)) & 0x0001;
}
@ -3066,11 +3063,11 @@ uint32_t mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
}
else
{
for (y = 0; y < 160; y++)
for (int y = 0; y < 160; y++)
{
line = &bitmap.pix16(y);
uint16_t *const line = &bitmap.pix(y);
for (x = 0; x < 160; x++)
for (int x = 0; x < 160; x++)
{
line[x] = 0;
}

View File

@ -1583,7 +1583,7 @@ uint32_t pxa255_periphs_device::screen_update(screen_device &screen, bitmap_rgb3
{
for (int y = 0; y <= (m_lcd_regs.lccr2 & PXA255_LCCR2_LPP); y++)
{
uint32_t *dst = &bitmap.pix32(y);
uint32_t *dst = &bitmap.pix(y);
for (int x = 0; x <= (m_lcd_regs.lccr1 & PXA255_LCCR1_PPL); x++)
{
*dst++ = m_lcd_palette[m_lcd_framebuffer[y * ((m_lcd_regs.lccr1 & PXA255_LCCR1_PPL) + 1) + x]];

View File

@ -247,7 +247,7 @@ void s2636_device::render_next_line()
// pre-clear the line for convenience
rectangle const &vis_area = screen().visible_area();
uint16_t *const row = &m_bitmap.pix16(m_screen_line);
uint16_t *const row = &m_bitmap.pix(m_screen_line);
m_bitmap.plot_box(0, m_screen_line, m_bitmap.width(), 1, 0);
if ((vis_area.min_y > m_screen_line) || (vis_area.max_y < m_screen_line))

View File

@ -434,7 +434,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tpal()
uint32_t color = s3c24xx_get_color_tpal();
for (int y = m_lcd.vpos_min; y <= m_lcd.vpos_max; y++)
{
uint32_t *scanline = &bitmap.pix32(y, m_lcd.hpos_min);
uint32_t *scanline = &bitmap.pix(y, m_lcd.hpos_min);
for (int x = m_lcd.hpos_min; x <= m_lcd.hpos_max; x++)
{
*scanline++ = color;
@ -445,7 +445,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tpal()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -467,7 +467,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -476,7 +476,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_01()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -490,7 +490,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -499,7 +499,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_02()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -513,7 +513,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -522,7 +522,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_04()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -536,7 +536,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -545,7 +545,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_08()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 16; i++)
{
*scanline++ = s3c24xx_get_color_stn_12(s3c24xx_lcd_dma_read_bits(12));
@ -555,7 +555,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -563,7 +563,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_p()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -577,7 +577,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -586,7 +586,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_stn_12_u() // not tested
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -600,7 +600,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -609,7 +609,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_01()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -623,7 +623,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -632,7 +632,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_02()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -646,7 +646,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -655,7 +655,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_04()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -669,7 +669,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -678,7 +678,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_08()
void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_16()
{
bitmap_rgb32 &bitmap = *m_lcd.bitmap[0];
uint32_t *scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
uint32_t *scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
for (int i = 0; i < 4; i++)
{
uint32_t data = s3c24xx_lcd_dma_read();
@ -692,7 +692,7 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_render_tft_16()
m_lcd.vpos++;
if (m_lcd.vpos > m_lcd.vpos_max) m_lcd.vpos = m_lcd.vpos_min;
m_lcd.hpos = m_lcd.hpos_min;
scanline = &bitmap.pix32(m_lcd.vpos, m_lcd.hpos);
scanline = &bitmap.pix(m_lcd.vpos, m_lcd.hpos);
}
}
}
@ -751,9 +751,9 @@ void S3C24_CLASS_NAME::bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bit
{
for (int y = 0; y < bitmap_dst.height(); y++)
{
uint32_t *line0 = &bitmap_src_1.pix32(y);
uint32_t *line1 = &bitmap_src_2.pix32(y);
uint32_t *line2 = &bitmap_dst.pix32(y);
uint32_t const *const line0 = &bitmap_src_1.pix(y);
uint32_t const *const line1 = &bitmap_src_2.pix(y);
uint32_t *const line2 = &bitmap_dst.pix(y);
for (int x = 0; x < bitmap_dst.width(); x++)
{
uint32_t color0 = line0[x];
@ -764,9 +764,9 @@ void S3C24_CLASS_NAME::bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bit
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);
line2[x] = (r << 16) | (g << 8) | b;
}
}

View File

@ -17,6 +17,8 @@
#include "coreutil.h"
#include <algorithm>
#define S3C44B0_INTCON (0x00 / 4) // Interrupt Control
#define S3C44B0_INTPND (0x04 / 4) // Interrupt Request Status
@ -696,8 +698,8 @@ uint32_t s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitma
{
for (int y = 0; y < screen.height(); y++)
{
uint32_t *scanline = &bitmap.pix32(y);
uint8_t *vram = m_lcd.bitmap.get() + y * (m_lcd.hpos_max - m_lcd.hpos_min + 1);
uint32_t *scanline = &bitmap.pix(y);
uint8_t const *vram = m_lcd.bitmap.get() + y * (m_lcd.hpos_max - m_lcd.hpos_min + 1);
for (int x = 0; x < screen.width(); x++)
{
*scanline++ = rgb_t(vram[0], vram[1], vram[2]);
@ -710,8 +712,7 @@ uint32_t s3c44b0_device::video_update(screen_device &screen, bitmap_rgb32 &bitma
{
for (int y = 0; y < screen.height(); y++)
{
uint32_t *scanline = &bitmap.pix32(y);
memset(scanline, 0, screen.width() * 4);
std::fill_n(&bitmap.pix(y), screen.width(), 0);
}
}
return 0;

View File

@ -4,6 +4,9 @@
#include "emu.h"
#include "spg110_video.h"
#include <algorithm>
DEFINE_DEVICE_TYPE(SPG110_VIDEO, spg110_video_device, "spg110_video", "SPG110 System-on-a-Chip (Video)")
spg110_video_device::spg110_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
@ -649,9 +652,9 @@ uint32_t spg110_video_device::screen_update(screen_device &screen, bitmap_rgb32
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
uint32_t *dest = &bitmap.pix32(y, cliprect.min_x);
uint32_t *src = &m_screenbuf[cliprect.min_x + 320 * y];
memcpy(dest, src, sizeof(uint32_t) * ((cliprect.max_x - cliprect.min_x) + 1));
uint32_t *dest = &bitmap.pix(y, cliprect.min_x);
const uint32_t *src = &m_screenbuf[cliprect.min_x + 320 * y];
std::copy_n(src, cliprect.width(), dest);
}
return 0;

View File

@ -354,9 +354,9 @@ inline void spg290_ppu_device::argb1555(bitmap_rgb32 &bitmap, const rectangle &c
{
rgb_t color = rgb_t(pal5bit(argb >> 10), pal5bit(argb >> 5), pal5bit(argb >> 0));
if (blend)
color = blend_colors(bitmap.pix32(posy, posx), color, blend);
color = blend_colors(bitmap.pix(posy, posx), color, blend);
bitmap.pix32(posy, posx) = color;
bitmap.pix(posy, posx) = color;
}
}
@ -366,9 +366,9 @@ inline void spg290_ppu_device::rgb565(bitmap_rgb32 &bitmap, const rectangle &cli
{
rgb_t color = rgb_t(pal5bit(rgb >> 11), pal6bit(rgb >> 5), pal5bit(rgb >> 0));
if (blend)
color = blend_colors(bitmap.pix32(posy, posx), color, blend);
color = blend_colors(bitmap.pix(posy, posx), color, blend);
bitmap.pix32(posy, posx) = color;
bitmap.pix(posy, posx) = color;
}
}

View File

@ -831,7 +831,7 @@ void spg_renderer_device::update_palette_lookup()
void spg_renderer_device::apply_saturation_and_fade(bitmap_rgb32& bitmap, const rectangle& cliprect, int scanline)
{
uint32_t* src = &bitmap.pix32(scanline, cliprect.min_x);
uint32_t* src = &bitmap.pix(scanline, cliprect.min_x);
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{

View File

@ -319,7 +319,7 @@ MC6845_UPDATE_ROW(swtpc8212_device::update_row)
else
font_color = rgb_t(0x00, 0xd0, 0x00);
}
bitmap.pix32(y, x++) = font_color;
bitmap.pix(y, x++) = font_color;
data <<= 1;
}

View File

@ -347,7 +347,7 @@ u32 tc0090lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
const int res_x = (global_flip()) ? 320 - x : x;
bitmap.pix16(y, x) = palette().pen(m_bitmap_ram[count + (res_x & 0x1ff)]);
bitmap.pix(y, x) = palette().pen(m_bitmap_ram[count + (res_x & 0x1ff)]);
}
}
}
@ -398,7 +398,7 @@ u32 tc0091lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
const int res_x = (global_flip()) ? 320 - x : x;
bitmap.pix16(y, x) = palette().pen(m_bitmap_ram[count + (res_x & 0x1ff)]);
bitmap.pix(y, x) = palette().pen(m_bitmap_ram[count + (res_x & 0x1ff)]);
}
}
}

View File

@ -276,7 +276,7 @@ uint32_t generic_terminal_device::update(screen_device &device, bitmap_rgb32 &bi
{
for (uint8_t ra = 0; ra < 10; ra++)
{
uint32_t *p = &bitmap.pix32(sy++);
uint32_t *p = &bitmap.pix(sy++);
for (uint16_t x = ma; x < ma + m_width; x++)
{

View File

@ -375,7 +375,7 @@ void cdp1864_device::dma_w(uint8_t data)
color = (gdata << 2) | (bdata << 1) | rdata;
}
m_bitmap.pix32(y, sx + x) = m_palette[color];
m_bitmap.pix(y, sx + x) = m_palette[color];
data <<= 1;
}

View File

@ -574,29 +574,28 @@ void cdp1869_device::sound_stream_update(sound_stream &stream, std::vector<read_
void cdp1869_device::draw_line(bitmap_rgb32 &bitmap, const rectangle &rect, int x, int y, uint8_t data, int color)
{
int i;
pen_t fg = m_palette->pen(color);
pen_t const fg = m_palette->pen(color);
data <<= 2;
for (i = 0; i < CH_WIDTH; i++)
for (int i = 0; i < CH_WIDTH; i++)
{
if (data & 0x80)
{
bitmap.pix32(y, x) = fg;
bitmap.pix(y, x) = fg;
if (!m_fresvert)
{
bitmap.pix32(y + 1, x) = fg;
bitmap.pix(y + 1, x) = fg;
}
if (!m_freshorz)
{
bitmap.pix32(y, x + 1) = fg;
bitmap.pix(y, x + 1) = fg;
if (!m_fresvert)
{
bitmap.pix32(y + 1, x + 1) = fg;
bitmap.pix(y + 1, x + 1) = fg;
}
}
}

View File

@ -173,20 +173,18 @@ inline uint8_t mos6560_device::read_colorram(offs_t offset)
void mos6560_device::draw_character( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color )
{
int y, code;
for (y = ybegin; y <= yend; y++)
for (int y = ybegin; y <= yend; y++)
{
code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
int code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
m_bitmap.pix32(y + yoff, xoff + 0) = PALETTE_MOS[color[code >> 7]];
m_bitmap.pix32(y + yoff, xoff + 1) = PALETTE_MOS[color[(code >> 6) & 1]];
m_bitmap.pix32(y + yoff, xoff + 2) = PALETTE_MOS[color[(code >> 5) & 1]];
m_bitmap.pix32(y + yoff, xoff + 3) = PALETTE_MOS[color[(code >> 4) & 1]];
m_bitmap.pix32(y + yoff, xoff + 4) = PALETTE_MOS[color[(code >> 3) & 1]];
m_bitmap.pix32(y + yoff, xoff + 5) = PALETTE_MOS[color[(code >> 2) & 1]];
m_bitmap.pix32(y + yoff, xoff + 6) = PALETTE_MOS[color[(code >> 1) & 1]];
m_bitmap.pix32(y + yoff, xoff + 7) = PALETTE_MOS[color[code & 1]];
m_bitmap.pix(y + yoff, xoff + 0) = PALETTE_MOS[color[BIT(code, 7)]];
m_bitmap.pix(y + yoff, xoff + 1) = PALETTE_MOS[color[BIT(code, 6)]];
m_bitmap.pix(y + yoff, xoff + 2) = PALETTE_MOS[color[BIT(code, 5)]];
m_bitmap.pix(y + yoff, xoff + 3) = PALETTE_MOS[color[BIT(code, 4)]];
m_bitmap.pix(y + yoff, xoff + 4) = PALETTE_MOS[color[BIT(code, 3)]];
m_bitmap.pix(y + yoff, xoff + 5) = PALETTE_MOS[color[BIT(code, 2)]];
m_bitmap.pix(y + yoff, xoff + 6) = PALETTE_MOS[color[BIT(code, 1)]];
m_bitmap.pix(y + yoff, xoff + 7) = PALETTE_MOS[color[BIT(code, 0)]];
}
}
@ -197,20 +195,18 @@ void mos6560_device::draw_character( int ybegin, int yend, int ch, int yoff, int
void mos6560_device::draw_character_multi( int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color )
{
int y, code;
for (y = ybegin; y <= yend; y++)
for (int y = ybegin; y <= yend; y++)
{
code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
int code = read_videoram((m_chargenaddr + ch * m_charheight + y) & 0x3fff);
m_bitmap.pix32(y + yoff, xoff + 0) =
m_bitmap.pix32(y + yoff, xoff + 1) = PALETTE_MOS[color[code >> 6]];
m_bitmap.pix32(y + yoff, xoff + 2) =
m_bitmap.pix32(y + yoff, xoff + 3) = PALETTE_MOS[color[(code >> 4) & 3]];
m_bitmap.pix32(y + yoff, xoff + 4) =
m_bitmap.pix32(y + yoff, xoff + 5) = PALETTE_MOS[color[(code >> 2) & 3]];
m_bitmap.pix32(y + yoff, xoff + 6) =
m_bitmap.pix32(y + yoff, xoff + 7) = PALETTE_MOS[color[code & 3]];
m_bitmap.pix(y + yoff, xoff + 0) = m_bitmap.pix(y + yoff, xoff + 1) =
PALETTE_MOS[color[code >> 6]];
m_bitmap.pix(y + yoff, xoff + 2) = m_bitmap.pix(y + yoff, xoff + 3) =
PALETTE_MOS[color[(code >> 4) & 3]];
m_bitmap.pix(y + yoff, xoff + 4) = m_bitmap.pix(y + yoff, xoff + 5) =
PALETTE_MOS[color[(code >> 2) & 3]];
m_bitmap.pix(y + yoff, xoff + 6) = m_bitmap.pix(y + yoff, xoff + 7) =
PALETTE_MOS[color[code & 3]];
}
}
@ -221,9 +217,7 @@ void mos6560_device::draw_character_multi( int ybegin, int yend, int ch, int yof
void mos6560_device::drawlines( int first, int last )
{
int line, vline;
int offs, yoff, xoff, ybegin, yend, i, j;
int attr, ch;
int line;
m_lastline = last;
if (first >= last)
@ -231,12 +225,13 @@ void mos6560_device::drawlines( int first, int last )
for (line = first; (line < m_ypos) && (line < last); line++)
{
for (j = 0; j < m_total_xsize; j++)
m_bitmap.pix32(line, j) = PALETTE_MOS[m_framecolor];
for (int j = 0; j < m_total_xsize; j++)
m_bitmap.pix(line, j) = PALETTE_MOS[m_framecolor];
}
for (vline = line - m_ypos; (line < last) && (line < m_ypos + m_ysize);)
for (int vline = line - m_ypos; (line < last) && (line < m_ypos + m_ysize);)
{
int offs, yoff, xoff, ybegin, yend;
if (m_matrix8x16)
{
offs = (vline >> 4) * m_chars_x;
@ -254,16 +249,16 @@ void mos6560_device::drawlines( int first, int last )
if (m_xpos > 0)
{
for (i = ybegin; i <= yend; i++)
for (j = 0; j < m_xpos; j++)
m_bitmap.pix32(yoff + i, j) = PALETTE_MOS[m_framecolor];
for (int i = ybegin; i <= yend; i++)
for (int j = 0; j < m_xpos; j++)
m_bitmap.pix(yoff + i, j) = PALETTE_MOS[m_framecolor];
}
for (xoff = m_xpos; (xoff < m_xpos + m_xsize) && (xoff < m_total_xsize); xoff += 8, offs++)
{
ch = read_videoram((m_videoaddr + offs) & 0x3fff);
int ch = read_videoram((m_videoaddr + offs) & 0x3fff);
attr = (read_colorram((m_videoaddr + offs) & 0x3fff)) & 0xf;
int attr = (read_colorram((m_videoaddr + offs) & 0x3fff)) & 0xf;
if (m_variant == TYPE_ATTACK_UFO)
{
@ -301,9 +296,9 @@ void mos6560_device::drawlines( int first, int last )
if (xoff < m_total_xsize)
{
for (i = ybegin; i <= yend; i++)
for (j = xoff; j < m_total_xsize; j++)
m_bitmap.pix32(yoff + i, j) = PALETTE_MOS[m_framecolor];
for (int i = ybegin; i <= yend; i++)
for (int j = xoff; j < m_total_xsize; j++)
m_bitmap.pix(yoff + i, j) = PALETTE_MOS[m_framecolor];
}
if (m_matrix8x16)
@ -319,8 +314,8 @@ void mos6560_device::drawlines( int first, int last )
}
for (; line < last; line++)
for (j = 0; j < m_total_xsize; j++)
m_bitmap.pix32(line, j) = PALETTE_MOS[m_framecolor];
for (int j = 0; j < m_total_xsize; j++)
m_bitmap.pix(line, j) = PALETTE_MOS[m_framecolor];
}

View File

@ -513,106 +513,93 @@ void mos7360_device::sound_stream_update(sound_stream &stream, std::vector<read_
void mos7360_device::draw_character(int ybegin, int yend, int ch, int yoff, int xoff, uint16_t *color)
{
int y, code;
for (y = ybegin; y <= yend; y++)
for (int y = ybegin; y <= yend; y++)
{
int code;
if (INROM)
code = read_rom(m_chargenaddr + ch * 8 + y);
else
code = read_ram(m_chargenaddr + ch * 8 + y);
m_bitmap.pix32(y + yoff, 0 + xoff) = PALETTE_MOS[color[code >> 7]];
m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[color[(code >> 6) & 1]];
m_bitmap.pix32(y + yoff, 2 + xoff) = PALETTE_MOS[color[(code >> 5) & 1]];
m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[color[(code >> 4) & 1]];
m_bitmap.pix32(y + yoff, 4 + xoff) = PALETTE_MOS[color[(code >> 3) & 1]];
m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[color[(code >> 2) & 1]];
m_bitmap.pix32(y + yoff, 6 + xoff) = PALETTE_MOS[color[(code >> 1) & 1]];
m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[color[code & 1]];
m_bitmap.pix(y + yoff, 0 + xoff) = PALETTE_MOS[color[BIT(code, 7)]];
m_bitmap.pix(y + yoff, 1 + xoff) = PALETTE_MOS[color[BIT(code, 6)]];
m_bitmap.pix(y + yoff, 2 + xoff) = PALETTE_MOS[color[BIT(code, 5)]];
m_bitmap.pix(y + yoff, 3 + xoff) = PALETTE_MOS[color[BIT(code, 4)]];
m_bitmap.pix(y + yoff, 4 + xoff) = PALETTE_MOS[color[BIT(code, 3)]];
m_bitmap.pix(y + yoff, 5 + xoff) = PALETTE_MOS[color[BIT(code, 2)]];
m_bitmap.pix(y + yoff, 6 + xoff) = PALETTE_MOS[color[BIT(code, 1)]];
m_bitmap.pix(y + yoff, 7 + xoff) = PALETTE_MOS[color[BIT(code, 0)]];
}
}
void mos7360_device::draw_character_multi(int ybegin, int yend, int ch, int yoff, int xoff)
{
int y, code;
for (y = ybegin; y <= yend; y++)
for (int y = ybegin; y <= yend; y++)
{
int code;
if (INROM)
code = read_rom(m_chargenaddr + ch * 8 + y);
else
code = read_ram(m_chargenaddr + ch * 8 + y);
m_bitmap.pix32(y + yoff, 0 + xoff) =
m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[m_multi[code >> 6]];
m_bitmap.pix32(y + yoff, 2 + xoff) =
m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[m_multi[(code >> 4) & 3]];
m_bitmap.pix32(y + yoff, 4 + xoff) =
m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[m_multi[(code >> 2) & 3]];
m_bitmap.pix32(y + yoff, 6 + xoff) =
m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[m_multi[code & 3]];
m_bitmap.pix(y + yoff, 0 + xoff) = m_bitmap.pix(y + yoff, 1 + xoff) =
PALETTE_MOS[m_multi[code >> 6]];
m_bitmap.pix(y + yoff, 2 + xoff) = m_bitmap.pix(y + yoff, 3 + xoff) =
PALETTE_MOS[m_multi[(code >> 4) & 3]];
m_bitmap.pix(y + yoff, 4 + xoff) = m_bitmap.pix(y + yoff, 5 + xoff) =
PALETTE_MOS[m_multi[(code >> 2) & 3]];
m_bitmap.pix(y + yoff, 6 + xoff) = m_bitmap.pix(y + yoff, 7 + xoff) =
PALETTE_MOS[m_multi[code & 3]];
}
}
void mos7360_device::draw_bitmap(int ybegin, int yend, int ch, int yoff, int xoff)
{
int y, code;
for (y = ybegin; y <= yend; y++)
for (int y = ybegin; y <= yend; y++)
{
code = read_ram(m_bitmapaddr + ch * 8 + y);
int code = read_ram(m_bitmapaddr + ch * 8 + y);
m_bitmap.pix32(y + yoff, 0 + xoff) = PALETTE_MOS[m_c16_bitmap[code >> 7]];
m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 6) & 1]];
m_bitmap.pix32(y + yoff, 2 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 5) & 1]];
m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 4) & 1]];
m_bitmap.pix32(y + yoff, 4 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 3) & 1]];
m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 2) & 1]];
m_bitmap.pix32(y + yoff, 6 + xoff) = PALETTE_MOS[m_c16_bitmap[(code >> 1) & 1]];
m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[m_c16_bitmap[code & 1]];
m_bitmap.pix(y + yoff, 0 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 7)]];
m_bitmap.pix(y + yoff, 1 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 6)]];
m_bitmap.pix(y + yoff, 2 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 5)]];
m_bitmap.pix(y + yoff, 3 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 4)]];
m_bitmap.pix(y + yoff, 4 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 3)]];
m_bitmap.pix(y + yoff, 5 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 2)]];
m_bitmap.pix(y + yoff, 6 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 1)]];
m_bitmap.pix(y + yoff, 7 + xoff) = PALETTE_MOS[m_c16_bitmap[BIT(code, 0)]];
}
}
void mos7360_device::draw_bitmap_multi(int ybegin, int yend, int ch, int yoff, int xoff)
{
int y, code;
for (y = ybegin; y <= yend; y++)
for (int y = ybegin; y <= yend; y++)
{
code = read_ram(m_bitmapaddr + ch * 8 + y);
int code = read_ram(m_bitmapaddr + ch * 8 + y);
m_bitmap.pix32(y + yoff, 0 + xoff) =
m_bitmap.pix32(y + yoff, 1 + xoff) = PALETTE_MOS[m_bitmapmulti[code >> 6]];
m_bitmap.pix32(y + yoff, 2 + xoff) =
m_bitmap.pix32(y + yoff, 3 + xoff) = PALETTE_MOS[m_bitmapmulti[(code >> 4) & 3]];
m_bitmap.pix32(y + yoff, 4 + xoff) =
m_bitmap.pix32(y + yoff, 5 + xoff) = PALETTE_MOS[m_bitmapmulti[(code >> 2) & 3]];
m_bitmap.pix32(y + yoff, 6 + xoff) =
m_bitmap.pix32(y + yoff, 7 + xoff) = PALETTE_MOS[m_bitmapmulti[code & 3]];
m_bitmap.pix(y + yoff, 0 + xoff) = m_bitmap.pix(y + yoff, 1 + xoff) =
PALETTE_MOS[m_bitmapmulti[code >> 6]];
m_bitmap.pix(y + yoff, 2 + xoff) = m_bitmap.pix(y + yoff, 3 + xoff) =
PALETTE_MOS[m_bitmapmulti[(code >> 4) & 3]];
m_bitmap.pix(y + yoff, 4 + xoff) = m_bitmap.pix(y + yoff, 5 + xoff) =
PALETTE_MOS[m_bitmapmulti[(code >> 2) & 3]];
m_bitmap.pix(y + yoff, 6 + xoff) = m_bitmap.pix(y + yoff, 7 + xoff) =
PALETTE_MOS[m_bitmapmulti[code & 3]];
}
}
void mos7360_device::draw_cursor(int ybegin, int yend, int yoff, int xoff, int color)
{
int y;
for (y = ybegin; y <= yend; y++)
for (int y = ybegin; y <= yend; y++)
{
for (int x = 0; x < 8; x++)
{
m_bitmap.pix32(y + yoff, x + xoff) = PALETTE_MOS[color];
m_bitmap.pix(y + yoff, x + xoff) = PALETTE_MOS[color];
}
}
}
void mos7360_device::drawlines(int first, int last)
{
int line, vline, end;
int attr, ch, c1, c2, ecm;
int offs, yoff, xoff, ybegin, yend, xbegin, xend;
int i;
m_lastline = last;
/* top part of display not rastered */
@ -625,34 +612,44 @@ void mos7360_device::drawlines(int first, int last)
if (!SCREENON)
{
for (line = first; (line < last) && (line < m_bitmap.height()); line++)
for (int line = first; (line < last) && (line < m_bitmap.height()); line++)
{
for (int x = 0; x < m_bitmap.width(); x++)
{
m_bitmap.pix32(line, x) = PALETTE_MOS[FRAMECOLOR];
m_bitmap.pix(line, x) = PALETTE_MOS[FRAMECOLOR];
}
}
return;
}
int xbegin, xend;
if (COLUMNS40)
xbegin = XPOS, xend = xbegin + 320;
{
xbegin = XPOS;
xend = xbegin + 320;
}
else
xbegin = XPOS + 7, xend = xbegin + 304;
{
xbegin = XPOS + 7;
xend = xbegin + 304;
}
int end;
if (last < m_y_begin)
end = last;
else
end = m_y_begin + YPOS;
int line;
for (line = first; line < end; line++)
{
for (line = first; line < end; line++)
for (int x = 0; x < m_bitmap.width(); x++)
{
for (int x = 0; x < m_bitmap.width(); x++)
{
m_bitmap.pix32(line, x) = PALETTE_MOS[FRAMECOLOR];
}
m_bitmap.pix(line, x) = PALETTE_MOS[FRAMECOLOR];
}
}
int vline;
if (LINES25)
vline = line - m_y_begin - YPOS;
else
@ -663,23 +660,23 @@ void mos7360_device::drawlines(int first, int last)
else
end = m_y_end + YPOS;
for (; line < end; vline = (vline + 8) & ~7, line = line + 1 + yend - ybegin)
for (int ybegin, yend; line < end; vline = (vline + 8) & ~7, line = line + 1 + yend - ybegin)
{
offs = (vline >> 3) * 40;
int offs = (vline >> 3) * 40;
ybegin = vline & 7;
yoff = line - ybegin;
int yoff = line - ybegin;
yend = (yoff + 7 < end) ? 7 : (end - yoff - 1);
/* rendering 39 characters */
/* left and right borders are overwritten later */
for (xoff = m_x_begin + XPOS; xoff < m_x_end + XPOS; xoff += 8, offs++)
for (int xoff = m_x_begin + XPOS; xoff < m_x_end + XPOS; xoff += 8, offs++)
{
if (HIRESON)
{
ch = read_ram((m_videoaddr | 0x400) + offs);
attr = read_ram(m_videoaddr + offs);
c1 = ((ch >> 4) & 0xf) | (attr << 4);
c2 = (ch & 0xf) | (attr & 0x70);
int ch = read_ram((m_videoaddr | 0x400) + offs);
int attr = read_ram(m_videoaddr + offs);
int c1 = ((ch >> 4) & 0xf) | (attr << 4);
int c2 = (ch & 0xf) | (attr & 0x70);
m_bitmapmulti[1] = m_c16_bitmap[1] = c1 & 0x7f;
m_bitmapmulti[2] = m_c16_bitmap[0] = c2 & 0x7f;
if (MULTICOLORON)
@ -693,13 +690,13 @@ void mos7360_device::drawlines(int first, int last)
}
else
{
ch = read_ram((m_videoaddr | 0x400) + offs);
attr = read_ram(m_videoaddr + offs);
int ch = read_ram((m_videoaddr | 0x400) + offs);
int attr = read_ram(m_videoaddr + offs);
// levente harsfalvi's docu says cursor off in ecm and multicolor
if (ECMON)
{
// hardware reverse off
ecm = ch >> 6;
int ecm = ch >> 6;
m_ecmcolor[0] = m_colors[ecm];
m_ecmcolor[1] = attr & 0x7f;
draw_character(ybegin, yend, ch & ~0xc0, yoff, xoff, m_ecmcolor);
@ -741,16 +738,16 @@ void mos7360_device::drawlines(int first, int last)
}
}
for (i = ybegin; i <= yend; i++)
for (int i = ybegin; i <= yend; i++)
{
for (int x = 0; x < xbegin; x++)
{
m_bitmap.pix32(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
m_bitmap.pix(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
}
for (int x = xend; x < m_bitmap.width(); x++)
{
m_bitmap.pix32(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
m_bitmap.pix(yoff + i, x) = PALETTE_MOS[FRAMECOLOR];
}
}
}
@ -764,7 +761,7 @@ void mos7360_device::drawlines(int first, int last)
{
for (int x = 0; x < m_bitmap.width(); x++)
{
m_bitmap.pix32(line, x) = PALETTE_MOS[FRAMECOLOR];
m_bitmap.pix(line, x) = PALETTE_MOS[FRAMECOLOR];
}
}
}

View File

@ -158,7 +158,7 @@ void vgmviz_device::apply_fft()
void vgmviz_device::apply_waterfall()
{
int total_bars = FFT_LENGTH / 2;
const int total_bars = FFT_LENGTH / 2;
WDL_FFT_COMPLEX* bins[2] = { (WDL_FFT_COMPLEX*)m_fft_buf[0], (WDL_FFT_COMPLEX*)m_fft_buf[1] };
for (int bar = 0; bar < std::min<int>(total_bars, SCREEN_HEIGHT); bar++)
{
@ -555,7 +555,7 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
m_clear_pending = false;
}
const pen_t *pal = m_palette->pens();
pen_t const *const pal = m_palette->pens();
int width = SCREEN_WIDTH;
switch (SpecMode)
@ -563,31 +563,26 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
case SPEC_VIZ_PILLAR:
for (int y = 2; y < SCREEN_HEIGHT; y++)
{
uint32_t *src = &m_bitmap.pix32(y);
uint32_t *dst = &bitmap.pix32(y - 2);
uint32_t const *const src = &m_bitmap.pix(y);
uint32_t *const dst = &bitmap.pix(y - 2);
for (int x = SCREEN_WIDTH - 1; x >= 1; x--)
{
dst[x] = src[x - 1];
}
}
width = (int)(SCREEN_WIDTH * 0.75f);
width = int(SCREEN_WIDTH * 0.75f);
break;
case SPEC_VIZ_TOP:
for (int y = 1; y < SCREEN_HEIGHT; y++)
{
uint32_t *src = &m_bitmap.pix32(y);
uint32_t *dst = &bitmap.pix32(y - 1);
for (int x = 0; x < SCREEN_WIDTH; x++)
{
dst[x] = src[x];
}
std::copy_n(&m_bitmap.pix(y), SCREEN_WIDTH, &bitmap.pix(y - 1));
}
break;
default:
break;
}
int total_bars = FFT_LENGTH / 2;
const int total_bars = FFT_LENGTH / 2;
WDL_FFT_COMPLEX *bins[2] = { (WDL_FFT_COMPLEX *)m_fft_buf[0], (WDL_FFT_COMPLEX *)m_fft_buf[1] };
for (int bar = 2; bar < total_bars && bar < width; bar += BarSize)
@ -614,8 +609,8 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
}
for (int y = 0; y < SCREEN_HEIGHT; y++)
{
int bar_y = SCREEN_HEIGHT - y;
uint32_t *line = &bitmap.pix32(y);
const int bar_y = SCREEN_HEIGHT - y;
uint32_t *const line = &bitmap.pix(y);
for (int x = 0; x < BarSize; x++)
{
line[(bar - 2) + x] = bar_y <= level ? pal[256 + pal_index] : pal[black_index];
@ -631,8 +626,8 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
for (int y = 0; y < SCREEN_HEIGHT; y++)
{
int bar_y = SCREEN_HEIGHT - y;
uint32_t *line = &bitmap.pix32(y);
const int bar_y = SCREEN_HEIGHT - y;
uint32_t *const line = &bitmap.pix(y);
line[0] = 0;
if (bar_y > level)
{
@ -643,9 +638,9 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
{
if (bar_y < (level - 1))
{
const uint8_t r = (uint8_t)(((entry >> 16) & 0xff) * 0.75f);
const uint8_t g = (uint8_t)(((entry >> 8) & 0xff) * 0.75f);
const uint8_t b = (uint8_t)(((entry >> 0) & 0xff) * 0.75f);
const uint8_t r = uint8_t(((entry >> 16) & 0xff) * 0.75f);
const uint8_t g = uint8_t(((entry >> 8) & 0xff) * 0.75f);
const uint8_t b = uint8_t(((entry >> 0) & 0xff) * 0.75f);
line[(bar - 2) + x] = 0xff000000 | (r << 16) | (g << 8) | b;
}
else
@ -653,9 +648,9 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
line[(bar - 2) + x] = pal[256 + pal_index];
}
}
const uint8_t r = (uint8_t)(((entry >> 16) & 0xff) * 0.5f);
const uint8_t g = (uint8_t)(((entry >> 8) & 0xff) * 0.5f);
const uint8_t b = (uint8_t)(((entry >> 0) & 0xff) * 0.5f);
const uint8_t r = uint8_t(((entry >> 16) & 0xff) * 0.5f);
const uint8_t g = uint8_t(((entry >> 8) & 0xff) * 0.5f);
const uint8_t b = uint8_t(((entry >> 0) & 0xff) * 0.5f);
line[(bar - 2) + (BarSize - 1)] = 0xff000000 | (r << 16) | (g << 8) | b;
if (bar_y < level)
{
@ -664,10 +659,11 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
}
for (int x = 0; x < SCREEN_WIDTH; x++)
{
bitmap.pix32(SCREEN_HEIGHT - 1, x) = 0;
bitmap.pix32(SCREEN_HEIGHT - 2, x) = 0;
bitmap.pix(SCREEN_HEIGHT - 1, x) = 0;
bitmap.pix(SCREEN_HEIGHT - 2, x) = 0;
}
memcpy(&m_bitmap.pix32(0), &bitmap.pix32(0), sizeof(uint32_t) * SCREEN_WIDTH * SCREEN_HEIGHT);
for (int y = 0; y < SCREEN_HEIGHT; y++)
std::copy_n(&bitmap.pix(y), SCREEN_WIDTH, &m_bitmap.pix(y));
break;
case SPEC_VIZ_TOP:
level = int(raw_level * 63.0f);
@ -678,10 +674,11 @@ template <int BarSize, int SpecMode> void vgmviz_device::draw_spectrogram(bitmap
for (int x = 0; x < BarSize; x++)
{
bitmap.pix32(SCREEN_HEIGHT - 1, (bar - 2) + x) = level > 0 ? pal[256 + pal_index] : pal[black_index];
bitmap.pix(SCREEN_HEIGHT - 1, (bar - 2) + x) = level > 0 ? pal[256 + pal_index] : pal[black_index];
}
memcpy(&m_bitmap.pix32(0), &bitmap.pix32(0), sizeof(uint32_t) * SCREEN_WIDTH * SCREEN_HEIGHT);
for (int y = 0; y < SCREEN_HEIGHT; y++)
std::copy_n(&bitmap.pix(y), SCREEN_WIDTH, &m_bitmap.pix(y));
break;
}
}
@ -700,7 +697,7 @@ void vgmviz_device::draw_waterfall(bitmap_rgb32 &bitmap)
const int v0_index = (int)v0h;
const int v1_index = (int)v1h;
const float interp = v0h - (float)v0_index;
uint32_t* line = &bitmap.pix32(y);
uint32_t* line = &bitmap.pix(y);
for (int x = 0; x < SCREEN_WIDTH; x++)
{
if (m_waterfall_length < SCREEN_WIDTH)
@ -736,8 +733,8 @@ void vgmviz_device::draw_waveform(bitmap_rgb32 &bitmap)
for (int x = 0; x < SCREEN_WIDTH; x++)
{
bitmap.pix32(CHANNEL_CENTER, x) = MED_GRAY;
bitmap.pix32(CHANNEL_HEIGHT + 1 + CHANNEL_CENTER, x) = MED_GRAY;
bitmap.pix(CHANNEL_CENTER, x) = MED_GRAY;
bitmap.pix(CHANNEL_HEIGHT + 1 + CHANNEL_CENTER, x) = MED_GRAY;
const float raw_l = m_audio_buf[1 - m_audio_fill_index][0][((int)m_history_length + 1 + x) % FFT_LENGTH];
const int sample_l = (int)((raw_l - 0.5f) * (CHANNEL_HEIGHT - 1));
@ -746,7 +743,7 @@ void vgmviz_device::draw_waveform(bitmap_rgb32 &bitmap)
int y = endy_l - sample_l;
do
{
bitmap.pix32(y, x) = LEFT_COLOR;
bitmap.pix(y, x) = LEFT_COLOR;
y += dy_l;
} while(y != endy_l);
@ -757,11 +754,11 @@ void vgmviz_device::draw_waveform(bitmap_rgb32 &bitmap)
y = endy_r - sample_r;
do
{
bitmap.pix32(y, x) = RIGHT_COLOR;
bitmap.pix(y, x) = RIGHT_COLOR;
y += dy_r;
} while(y != endy_r);
bitmap.pix32(CHANNEL_HEIGHT, x) = WHITE;
bitmap.pix32(CHANNEL_HEIGHT + 1, x) = WHITE;
bitmap.pix(CHANNEL_HEIGHT, x) = WHITE;
bitmap.pix(CHANNEL_HEIGHT + 1, x) = WHITE;
}
}

View File

@ -1723,8 +1723,8 @@ void sega315_5124_device::draw_scanline(int pixel_offset_x, int pixel_plot_y, in
void sega315_5124_device::blit_scanline(int *line_buffer, int *priority_selected, int pixel_offset_x, int pixel_plot_y, int line)
{
u32 *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x);
u8 *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x);
u32 *const p_bitmap = &m_tmpbitmap.pix(pixel_plot_y + line, pixel_offset_x);
u8 *const p_y1 = &m_y1_bitmap.pix(pixel_plot_y + line, pixel_offset_x);
int x = 0;
if (m_vdp_mode == 4 && BIT(m_reg[0x00], 5))
@ -1755,8 +1755,8 @@ void sega315_5377_device::blit_scanline(int *line_buffer, int *priority_selected
}
else
{
u32 *p_bitmap = &m_tmpbitmap.pix32(pixel_plot_y + line, pixel_offset_x);
u8 *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x);
u32 *const p_bitmap = &m_tmpbitmap.pix(pixel_plot_y + line, pixel_offset_x);
u8 *const p_y1 = &m_y1_bitmap.pix(pixel_plot_y + line, pixel_offset_x);
int x = 0;
/* border on left side of the GG active screen */

View File

@ -2108,7 +2108,7 @@ void sega315_5313_device::render_videobuffer_to_screenbuffer(int scanline)
if (scanline >= m_render_bitmap->height()) // safety, shouldn't happen now we allocate a fixed amount tho
return;
lineptr = &m_render_bitmap->pix32(scanline);
lineptr = &m_render_bitmap->pix(scanline);
}
else
lineptr = m_render_line.get();

View File

@ -248,12 +248,11 @@ void cdp1861_device::dma_w(uint8_t data)
{
int sx = screen().hpos() + 4;
int y = screen().vpos();
int x;
for (x = 0; x < 8; x++)
for (int x = 0; x < 8; x++)
{
pen_t color = BIT(data, 7) ? rgb_t::white() : rgb_t::black();
m_bitmap.pix32(y, sx + x) = color;
m_bitmap.pix(y, sx + x) = color;
data <<= 1;
}
}

View File

@ -131,7 +131,6 @@ void cdp1862_device::dma_w(uint8_t data)
int rd = 1, bd = 1, gd = 1;
int sx = screen().hpos() + 4;
int y = screen().vpos();
int x;
if (!m_con)
{
@ -140,7 +139,7 @@ void cdp1862_device::dma_w(uint8_t data)
gd = m_read_gd();
}
for (x = 0; x < 8; x++)
for (int x = 0; x < 8; x++)
{
int color = CDP1862_BACKGROUND_COLOR_SEQUENCE[m_bgcolor] + 8;
@ -149,7 +148,7 @@ void cdp1862_device::dma_w(uint8_t data)
color = (gd << 2) | (bd << 1) | rd;
}
m_bitmap.pix32(y, sx + x) = m_palette[color];
m_bitmap.pix(y, sx + x) = m_palette[color];
data <<= 1;
}

View File

@ -213,8 +213,6 @@ void cesblit_device::do_blit()
// Draw
bitmap_ind16 &bitmap = m_bitmap[layer][buffer];
int x,y;
uint16_t pen;
switch (mode & 0x20)
{
@ -227,17 +225,17 @@ void cesblit_device::do_blit()
uint8_t dst_pen = (m_color >> 8) & 0xff;
uint8_t src_pen = (m_color >> 0) & 0xff;
for (y = y0; y != y1; y += dy)
for (int y = y0; y != y1; y += dy)
{
for (x = x0; x != x1; x += dx)
for (int x = x0; x != x1; x += dx)
{
pen = m_space->read_byte(addr);
uint16_t pen = m_space->read_byte(addr);
if (pen == src_pen)
pen = dst_pen;
if (pen != 0xff)
bitmap.pix16((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen + color;
bitmap.pix((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen + color;
++addr;
}
@ -247,14 +245,14 @@ void cesblit_device::do_blit()
{
// copy from ROM as is
for (y = y0; y != y1; y += dy)
for (int y = y0; y != y1; y += dy)
{
for (x = x0; x != x1; x += dx)
for (int x = x0; x != x1; x += dx)
{
pen = m_space->read_byte(addr);
uint16_t pen = m_space->read_byte(addr);
if (pen != 0xff)
bitmap.pix16((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen + color;
bitmap.pix((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen + color;
++addr;
}
@ -263,16 +261,18 @@ void cesblit_device::do_blit()
break;
case 0x20: // solid fill
pen = ((m_addr_hi >> 8) & 0xff) + color;
if ((pen & 0xff) == 0xff)
pen = 0xff;
for (y = y0; y != y1; y += dy)
{
for (x = x0; x != x1; x += dx)
uint16_t pen = ((m_addr_hi >> 8) & 0xff) + color;
if ((pen & 0xff) == 0xff)
pen = 0xff;
for (int y = y0; y != y1; y += dy)
{
bitmap.pix16((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen;
for (int x = x0; x != x1; x += dx)
{
bitmap.pix((sy + y) & 0x1ff, (sx + x) & 0x1ff) = pen;
}
}
}
break;

View File

@ -134,7 +134,6 @@ void cirrus_gd5428_device::device_reset()
uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int x,y,bit;
uint32_t ptr = (vga.svga_intf.vram_size - 0x4000); // cursor patterns are stored in the last 16kB of VRAM
svga_device::screen_update(screen, bitmap, cliprect);
@ -145,11 +144,11 @@ uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32
if(m_cursor_attr & 0x04) // 64x64
{
ptr += ((m_cursor_addr & 0x3c) * 256);
for(y=0;y<64;y++)
for(int y=0;y<64;y++)
{
for(x=0;x<64;x+=8)
for(int x=0;x<64;x+=8)
{
for(bit=0;bit<8;bit++)
for(int bit=0;bit<8;bit++)
{
uint8_t pixel1 = vga.memory[ptr % vga.svga_intf.vram_size] >> (7-bit);
uint8_t pixel2 = vga.memory[(ptr+512) % vga.svga_intf.vram_size] >> (7-bit);
@ -159,13 +158,13 @@ uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32
case 0: // transparent - do nothing
break;
case 1: // background
bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[0].red << 16) | (m_ext_palette[0].green << 8) | (m_ext_palette[0].blue);
bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[0].red << 16) | (m_ext_palette[0].green << 8) | (m_ext_palette[0].blue);
break;
case 2: // XOR
bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = ~bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit);
bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = ~bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit);
break;
case 3: // foreground
bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[15].red << 16) | (m_ext_palette[15].green << 8) | (m_ext_palette[15].blue);
bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[15].red << 16) | (m_ext_palette[15].green << 8) | (m_ext_palette[15].blue);
break;
}
}
@ -175,11 +174,11 @@ uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32
else
{
ptr += ((m_cursor_addr & 0x3f) * 256);
for(y=0;y<32;y++)
for(int y=0;y<32;y++)
{
for(x=0;x<32;x+=8)
for(int x=0;x<32;x+=8)
{
for(bit=0;bit<8;bit++)
for(int bit=0;bit<8;bit++)
{
uint8_t pixel1 = vga.memory[ptr % vga.svga_intf.vram_size] >> (7-bit);
uint8_t pixel2 = vga.memory[(ptr+128) % vga.svga_intf.vram_size] >> (7-bit);
@ -189,13 +188,13 @@ uint32_t cirrus_gd5428_device::screen_update(screen_device &screen, bitmap_rgb32
case 0: // transparent - do nothing
break;
case 1: // background
bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[0].red << 18) | (m_ext_palette[0].green << 10) | (m_ext_palette[0].blue << 2);
bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[0].red << 18) | (m_ext_palette[0].green << 10) | (m_ext_palette[0].blue << 2);
break;
case 2: // XOR
bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = ~bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit);
bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = ~bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit);
break;
case 3: // foreground
bitmap.pix32(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[15].red << 18) | (m_ext_palette[15].green << 10) | (m_ext_palette[15].blue << 2);
bitmap.pix(m_cursor_y+y,m_cursor_x+x+bit) = (m_ext_palette[15].red << 18) | (m_ext_palette[15].green << 10) | (m_ext_palette[15].blue << 2);
break;
}
}

View File

@ -357,7 +357,7 @@ void ef9340_1_device::ef9340_scanline(int vpos)
{
// Service row is disabled
for (int i = 0; i < 40 * 8; i++)
m_tmp_bitmap.pix16(m_offset_y + vpos, m_offset_x + i) = 8;
m_tmp_bitmap.pix(m_offset_y + vpos, m_offset_x + i) = 8;
return;
}
}
@ -466,7 +466,7 @@ void ef9340_1_device::ef9340_scanline(int vpos)
for (int i = 0; i < 8; i++)
{
uint16_t d = blank ? 0 : (char_data & 1) ? fg : bg;
m_tmp_bitmap.pix16(m_offset_y + vpos, m_offset_x + x*8 + i) = d | 8;
m_tmp_bitmap.pix(m_offset_y + vpos, m_offset_x + x*8 + i) = d | 8;
char_data >>= 1;
}
@ -480,7 +480,7 @@ void ef9340_1_device::ef9340_scanline(int vpos)
else
{
for (int i = 0; i < 40 * 8; i++)
m_tmp_bitmap.pix16(m_offset_y + vpos, m_offset_x + i) = 0;
m_tmp_bitmap.pix(m_offset_y + vpos, m_offset_x + i) = 0;
}
// determine next h parity
@ -499,7 +499,7 @@ uint32_t ef9340_1_device::screen_update(screen_device &screen, bitmap_ind16 &bit
// note: palette d3 is transparency (datasheet calls it "I"), this handler masks it off
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
bitmap.pix16(y, x) = m_tmp_bitmap.pix16(y, x) & 7;
bitmap.pix(y, x) = m_tmp_bitmap.pix(y, x) & 7;
return 0;
}

View File

@ -225,7 +225,7 @@ void ef9345_device::draw_char_40(uint8_t *c, uint16_t x, uint16_t y)
for(int i = 0; i < scan_ysize; i++)
for(int j = 0; j < scan_xsize; j++)
m_screen_out.pix32(y * 10 + i, x * 8 + j) = palette[c[8 * i + j] & 0x07];
m_screen_out.pix(y * 10 + i, x * 8 + j) = palette[c[8 * i + j] & 0x07];
}
// draw a char in 80 char line mode
@ -237,7 +237,7 @@ void ef9345_device::draw_char_80(uint8_t *c, uint16_t x, uint16_t y)
for(int i = 0; i < scan_ysize; i++)
for(int j = 0; j < scan_xsize; j++)
m_screen_out.pix32(y * 10 + i, x * 6 + j) = palette[c[6 * i + j] & 0x07];
m_screen_out.pix(y * 10 + i, x * 6 + j) = palette[c[6 * i + j] & 0x07];
}

View File

@ -178,30 +178,27 @@ void ef9364_device::draw_border(uint16_t line)
uint32_t ef9364_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int x,y,r;
unsigned char c;
for( r = 0 ; r < NB_OF_ROWS ; r++ )
for( int r = 0 ; r < NB_OF_ROWS ; r++ )
{
for( y = 0 ; y < 8 ; y++ )
for( int y = 0 ; y < 8 ; y++ )
{
for( x = 0 ; x < NB_OF_COLUMNS * 8 ; x++ )
for( int x = 0 ; x < NB_OF_COLUMNS * 8 ; x++ )
{
if( ( ( x >> 3 ) != x_curs_pos ) || ( r != y_curs_pos ) || !cursor_state)
{
c = m_textram->read_byte( ( r * NB_OF_COLUMNS ) + ( x>>3 ) );
unsigned char c = m_textram->read_byte( ( r * NB_OF_COLUMNS ) + ( x>>3 ) );
if( m_charset[((c&0x7F)<<3) + y] & (0x80>>(x&7)) )
m_screen_out.pix32((r*12)+y, x) = palette[1];
m_screen_out.pix((r*12)+y, x) = palette[1];
else
m_screen_out.pix32((r*12)+y, x) = palette[0];
m_screen_out.pix((r*12)+y, x) = palette[0];
}
else
{
if(y != 7)
m_screen_out.pix32((r*12)+y, x) = palette[0];
m_screen_out.pix((r*12)+y, x) = palette[0];
else
m_screen_out.pix32((r*12)+y, x) = palette[1];
m_screen_out.pix((r*12)+y, x) = palette[1];
}
}
}

View File

@ -1156,18 +1156,15 @@ void ef9365_device::ef9365_exec(uint8_t cmd)
uint32_t ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int i,j,ptr,p;
unsigned char color_index;
for(j=0;j<bitplane_yres;j++)
for(int j=0;j<bitplane_yres;j++)
{
for(i=0;i<bitplane_xres;i++)
for(int i=0;i<bitplane_xres;i++)
{
color_index = 0x00;
unsigned char color_index = 0x00;
ptr = ( bitplane_xres * j ) + i;
int ptr = ( bitplane_xres * j ) + i;
for( p = 0; p < nb_of_bitplanes; p++)
for(int p = 0; p < nb_of_bitplanes; p++)
{
if( m_videoram->read_byte( (BITPLANE_MAX_SIZE*p) + (ptr>>3)) & (0x80>>(ptr&7)))
{
@ -1175,7 +1172,7 @@ uint32_t ef9365_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
}
}
m_screen_out.pix32(j, i) = m_palette->pen( color_index );
m_screen_out.pix(j, i) = m_palette->pen( color_index );
}
}

View File

@ -671,7 +671,7 @@ void cgb_ppu_device::device_reset()
inline void dmg_ppu_device::plot_pixel(int x, int y, uint16_t color)
{
m_bitmap.pix16(y, x) = color;
m_bitmap.pix(y, x) = color;
}

View File

@ -267,7 +267,7 @@ inline void gba_lcd_device::update_mask(uint8_t* mask, int y)
void gba_lcd_device::draw_scanline(int y)
{
uint16_t *scanline = &m_bitmap.pix16(y);
uint16_t *const scanline = &m_bitmap.pix(y);
if (is_set(dispcnt::forced_blank))
{

Some files were not shown because too many files have changed in this diff Show More