diff options
author | 2014-03-27 09:21:55 +0000 | |
---|---|---|
committer | 2014-03-27 09:21:55 +0000 | |
commit | ab3a90ca29dd65dedeb99a035b0316cc7b4daeda (patch) | |
tree | b208eef62a63108439352e114978f1ba873eee09 /src/emu/drawgfx.h | |
parent | 076399b3fd660cc4e629f40d36948f80fadaccbd (diff) |
gfx_elements now have a xor mask that is applied to each source bit offset when decoding. This can be used to deal with endianness when decoding gfx from RAM or from program ROMs, or to reverse the bit order sense when this is useful (e.g. pgm.c) [Alex Jackson]
(nw) This is test/checkpoint right now, final goal is to automatically determine the appropriate xor at startup when the gfxdecode info is processed (e.g. based on the width and endianness of the ROM region)
Diffstat (limited to 'src/emu/drawgfx.h')
-rw-r--r-- | src/emu/drawgfx.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h index 911805dff00..7f26906d42b 100644 --- a/src/emu/drawgfx.h +++ b/src/emu/drawgfx.h @@ -138,7 +138,7 @@ class gfx_element public: // construction/destruction gfx_element(); - gfx_element(palette_device *palette, const gfx_layout &gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base); + gfx_element(palette_device *palette, const gfx_layout &gl, const UINT8 *srcdata, UINT32 xormask, UINT32 total_colors, UINT32 color_base); gfx_element(palette_device *palette, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 total_colors, UINT32 color_base, UINT32 color_granularity); // getters @@ -160,6 +160,7 @@ public: void set_layout(const gfx_layout &gl, const UINT8 *srcdata); void set_raw_layout(const UINT8 *srcdata, UINT32 width, UINT32 height, UINT32 total, UINT32 linemod, UINT32 charmod); void set_source(const UINT8 *source) { m_srcdata = source; if (m_layout_is_raw) m_gfxdata = const_cast<UINT8 *>(source); memset(m_dirty, 1, elements()); } + void set_xormask(UINT32 xormask) { m_layout_xormask = xormask; } void set_palette(palette_device *palette) { m_palette = palette; } void set_colors(UINT32 colors) { m_total_colors = colors; } void set_colorbase(UINT16 colorbase) { m_color_base = colorbase; } @@ -282,6 +283,7 @@ private: bool m_layout_is_raw; // raw layout? UINT8 m_layout_planes; // bit planes in the layout + UINT32 m_layout_xormask; // xor mask applied to each bit offset UINT32 m_layout_charincrement; // per-character increment in source data dynamic_array<UINT32> m_layout_planeoffset;// plane offsets dynamic_array<UINT32> m_layout_xoffset; // X offsets |