summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/tc009xlvc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/machine/tc009xlvc.c')
-rw-r--r--src/emu/machine/tc009xlvc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/emu/machine/tc009xlvc.c b/src/emu/machine/tc009xlvc.c
index c80c38b2f11..848557f99e6 100644
--- a/src/emu/machine/tc009xlvc.c
+++ b/src/emu/machine/tc009xlvc.c
@@ -46,7 +46,7 @@ WRITE8_MEMBER(tc0091lvc_device::tc0091lvc_paletteram_w)
g |= ((i & 2) >> 1);
r |= (i & 1);
- palette_set_color_rgb(machine(), offset / 2, pal5bit(r), pal5bit(g), pal5bit(b));
+ m_palette->set_pen_color(offset / 2, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
@@ -168,7 +168,8 @@ tc0091lvc_device::tc0091lvc_device(const machine_config &mconfig, const char *ta
: device_t(mconfig, TC0091LVC, "TC0091LVC", tag, owner, clock, "tc0091lvc", __FILE__),
device_memory_interface(mconfig, *this),
m_space_config("tc0091lvc", ENDIANNESS_LITTLE, 8,20, 0, NULL, *ADDRESS_MAP_NAME(tc0091lvc_map8)),
- m_gfxdecode(*this)
+ m_gfxdecode(*this),
+ m_palette(*this)
{
}
@@ -183,6 +184,16 @@ void tc0091lvc_device::static_set_gfxdecode_tag(device_t &device, const char *ta
}
+//-------------------------------------------------
+// static_set_palette_tag: Set the tag of the
+// palette device
+//-------------------------------------------------
+
+void tc0091lvc_device::static_set_palette_tag(device_t &device, const char *tag)
+{
+ downcast<tc0091lvc_device &>(device).m_palette.set_tag(tag);
+}
+
void tc0091lvc_device::device_config_complete()
{
@@ -289,7 +300,7 @@ void tc0091lvc_device::device_start()
//printf("m_gfx_index %d\n", m_gfx_index);
- m_gfxdecode->set_gfx(m_gfx_index, auto_alloc(machine(), gfx_element(machine(), char_layout, (UINT8 *)m_pcg_ram, machine().total_colors() / 16, 0)));
+ m_gfxdecode->set_gfx(m_gfx_index, auto_alloc(machine(), gfx_element(machine(), char_layout, (UINT8 *)m_pcg_ram, m_palette->entries() / 16, 0)));
}
void tc0091lvc_device::device_reset()
@@ -328,7 +339,7 @@ void tc0091lvc_device::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap
fy = !fy;
}
- gfx->prio_transpen(bitmap,cliprect,spr_offs,col,fx,fy,x,y,screen.priority(),(col & 0x08) ? 0xaa : 0x00,0);
+ gfx->prio_transpen(m_palette,bitmap,cliprect,spr_offs,col,fx,fy,x,y,screen.priority(),(col & 0x08) ? 0xaa : 0x00,0);
}
}
@@ -338,7 +349,7 @@ UINT32 tc0091lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
int x,y;
UINT8 global_flip;
- bitmap.fill(get_black_pen(screen.machine()), cliprect);
+ bitmap.fill(m_palette->black_pen(), cliprect);
if((m_vregs[4] & 0x20) == 0)
return 0;
@@ -359,7 +370,7 @@ UINT32 tc0091lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
res_y = (global_flip) ? 256-y : y;
if(screen.visible_area().contains(res_x, res_y))
- bitmap.pix16(res_y, res_x) = screen.machine().pens[m_bitmap_ram[count]];
+ bitmap.pix16(res_y, res_x) = m_palette->pen(m_bitmap_ram[count]);
count++;
}