summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/model3.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2017-05-28 11:11:19 +0200
committer Olivier Galibert <galibert@pobox.com>2017-05-28 22:04:01 +0200
commit53feb420a4d19327a86a4abbd4c7c83fa8152e0f (patch)
tree10102d5c18901dbb4f11e9ba2ae4bba77a1d5937 /src/mame/video/model3.cpp
parent8ad55eced85d9d31c21a416b044e435c74242756 (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/mame/video/model3.cpp')
-rw-r--r--src/mame/video/model3.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mame/video/model3.cpp b/src/mame/video/model3.cpp
index a6e74fa823a..99e0f378512 100644
--- a/src/mame/video/model3.cpp
+++ b/src/mame/video/model3.cpp
@@ -207,10 +207,10 @@ void model3_state::video_start()
m_layer8[3] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(model3_state::tile_info_layer3_8bit), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
// 4-bit tiles
- m_gfxdecode->set_gfx(0, std::make_unique<gfx_element>(*m_palette, char4_layout, (uint8_t*)m_m3_char_ram.get(), 0, m_palette->entries() / 16, 0));
+ m_gfxdecode->set_gfx(0, std::make_unique<gfx_element>(m_palette, char4_layout, (uint8_t*)m_m3_char_ram.get(), 0, m_palette->entries() / 16, 0));
// 8-bit tiles
- m_gfxdecode->set_gfx(1, std::make_unique<gfx_element>(*m_palette, char8_layout, (uint8_t*)m_m3_char_ram.get(), 0, m_palette->entries() / 256, 0));
+ m_gfxdecode->set_gfx(1, std::make_unique<gfx_element>(m_palette, char8_layout, (uint8_t*)m_m3_char_ram.get(), 0, m_palette->entries() / 256, 0));
init_matrix_stack();
}