diff options
author | 2017-05-28 11:11:19 +0200 | |
---|---|---|
committer | 2017-05-28 22:04:01 +0200 | |
commit | 53feb420a4d19327a86a4abbd4c7c83fa8152e0f (patch) | |
tree | 10102d5c18901dbb4f11e9ba2ae4bba77a1d5937 /src/devices/machine/tc009xlvc.cpp | |
parent | 8ad55eced85d9d31c21a416b044e435c74242756 (diff) |
drawgfx: Make the palette optional [O. Galibert]
device_gfx_interface does two things:
- go from a possibly weird rom layout to a one-byte-per-pixel tiled layout
- draw the tiles so created
The second part requires a palette, but the first doesn't. And
low-level emulations of individual graphic chips (konami tilemap or
sprite generators for instance) are not supposed to care about the
palette. They just output bits which are partly indexes into
palettes, and partly not, and in any case become pen ids only much
further in the rendering chain. But they need access to the decoding
step, because one-byte-per-pixel is real nice.. So now such a device,
which inherits from device_gfx_interface, can call
set_palette_disable(true) and no palette tag will be required.
Calling the draw functions will segfault though.
As a side effect, the gfx_element constructor now takes a palette
pointer instead of a reference, since it's now optional.
Diffstat (limited to 'src/devices/machine/tc009xlvc.cpp')
-rw-r--r-- | src/devices/machine/tc009xlvc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/devices/machine/tc009xlvc.cpp b/src/devices/machine/tc009xlvc.cpp index d85e1c6be35..b5022a342eb 100644 --- a/src/devices/machine/tc009xlvc.cpp +++ b/src/devices/machine/tc009xlvc.cpp @@ -278,7 +278,7 @@ void tc0091lvc_device::device_start() //printf("m_gfx_index %d\n", m_gfx_index); device_palette_interface &palette = m_gfxdecode->palette(); - m_gfxdecode->set_gfx(m_gfx_index, std::make_unique<gfx_element>(palette, char_layout, (uint8_t *)m_pcg_ram, 0, palette.entries() / 16, 0)); + m_gfxdecode->set_gfx(m_gfx_index, std::make_unique<gfx_element>(&palette, char_layout, (uint8_t *)m_pcg_ram, 0, palette.entries() / 16, 0)); } const address_space_config *tc0091lvc_device::memory_space_config(address_spacenum spacenum) const |