argo.cpp, cat.cpp: rgb32 screen conversion (nw)

This commit is contained in:
AJR 2018-06-13 09:49:21 -04:00
parent 1088a2e724
commit 3b172b3ebe
2 changed files with 21 additions and 27 deletions

View File

@ -46,7 +46,7 @@ public:
DECLARE_WRITE8_MEMBER(argo_videoram_w);
DECLARE_READ8_MEMBER(argo_io_r);
DECLARE_WRITE8_MEMBER(argo_io_w);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void init_argo();
void argo(machine_config &config);
@ -289,7 +289,7 @@ void argo_state::init_argo()
membank("boot")->configure_entries(0, 2, &RAM[0x0000], 0xf800);
}
uint32_t argo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
uint32_t argo_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint8_t y,ra,chr,gfx;
uint16_t sy=0,ma=0,x;
@ -301,7 +301,7 @@ uint32_t argo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
for (ra = 0; ra < 10; ra++)
{
uint16_t *p = &bitmap.pix16(sy++);
uint32_t *p = &bitmap.pix32(sy++);
for (x = 1; x < 81; x++) // align x to the cursor position numbers
{
@ -325,14 +325,14 @@ uint32_t argo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
gfx = 0xff;
/* Display a scanline of a character */
*p++ = BIT(gfx, 7);
*p++ = BIT(gfx, 6);
*p++ = BIT(gfx, 5);
*p++ = BIT(gfx, 4);
*p++ = BIT(gfx, 3);
*p++ = BIT(gfx, 2);
*p++ = BIT(gfx, 1);
*p++ = BIT(gfx, 0);
*p++ = BIT(gfx, 7) ? rgb_t::white() : rgb_t::black();
*p++ = BIT(gfx, 6) ? rgb_t::white() : rgb_t::black();
*p++ = BIT(gfx, 5) ? rgb_t::white() : rgb_t::black();
*p++ = BIT(gfx, 4) ? rgb_t::white() : rgb_t::black();
*p++ = BIT(gfx, 3) ? rgb_t::white() : rgb_t::black();
*p++ = BIT(gfx, 2) ? rgb_t::white() : rgb_t::black();
*p++ = BIT(gfx, 1) ? rgb_t::white() : rgb_t::black();
*p++ = BIT(gfx, 0) ? rgb_t::white() : rgb_t::black();
}
}
@ -360,9 +360,6 @@ MACHINE_CONFIG_START(argo_state::argo)
MCFG_SCREEN_UPDATE_DRIVER(argo_state, screen_update)
MCFG_SCREEN_SIZE(640, 250)
MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD_MONOCHROME("palette")
MACHINE_CONFIG_END
/* ROM definition */

View File

@ -292,7 +292,7 @@ public:
DECLARE_VIDEO_START(cat);
void init_cat();
uint32_t screen_update_cat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_cat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(cat_duart_irq_handler);
DECLARE_WRITE_LINE_MEMBER(cat_duart_txa);
@ -946,29 +946,29 @@ VIDEO_START_MEMBER(cat_state,cat)
{
}
uint32_t cat_state::screen_update_cat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
uint32_t cat_state::screen_update_cat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
uint16_t code;
int y, x, b;
const rgb_t on_color = m_video_invert ? rgb_t::black() : rgb_t::white();
const rgb_t off_color = m_video_invert ? rgb_t::white() : rgb_t::black();
int addr = 0;
if (m_video_enable == 1)
{
for (y = 0; y < 344; y++)
for (int y = 0; y < 344; y++)
{
int horpos = 0;
for (x = 0; x < 42; x++)
for (int x = 0; x < 42; x++)
{
code = m_p_cat_videoram[addr++];
for (b = 15; b >= 0; b--)
uint16_t code = m_p_cat_videoram[addr++];
for (int b = 15; b >= 0; b--)
{
bitmap.pix16(y, horpos++) = ((code >> b) & 0x01) ^ m_video_invert;
bitmap.pix32(y, horpos++) = BIT(code, b) ? on_color : off_color;
}
}
}
} else {
const rectangle black_area(0, 672 - 1, 0, 344 - 1);
bitmap.fill(0, black_area);
bitmap.fill(rgb_t::black(), black_area);
}
return 0;
}
@ -1071,9 +1071,6 @@ MACHINE_CONFIG_START(cat_state::cat)
MCFG_SCREEN_SIZE(672, 344)
MCFG_SCREEN_VISIBLE_AREA(0, 672-1, 0, 344-1)
MCFG_SCREEN_UPDATE_DRIVER(cat_state, screen_update_cat)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD_MONOCHROME("palette")
MCFG_VIDEO_START_OVERRIDE(cat_state,cat)