mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
Added some more friendly macros to help define custom palette formats (nw)
This commit is contained in:
parent
8a06918131
commit
10e08f136a
@ -111,6 +111,10 @@
|
||||
#define DECLARE_PALETTE_INIT(_Name) void PALETTE_INIT_NAME(_Name)(palette_device &palette)
|
||||
#define PALETTE_INIT_MEMBER(_Class, _Name) void _Class::PALETTE_INIT_NAME(_Name)(palette_device &palette)
|
||||
|
||||
#define PALETTE_DECODER_NAME(_Name) _Name##_decoder
|
||||
#define DECLARE_PALETTE_DECODER(_Name) static rgb_t PALETTE_DECODER_NAME(_Name)(UINT32 raw)
|
||||
#define PALETTE_DECODER_MEMBER(_Class, _Name) rgb_t _Class::PALETTE_DECODER_NAME(_Name)(UINT32 raw)
|
||||
|
||||
// standard 3-3-2 formats
|
||||
#define PALETTE_FORMAT_BBGGGRRR raw_to_rgb_converter(1, &raw_to_rgb_converter::standard_rgb_decoder<3,3,2, 0,3,6>)
|
||||
#define PALETTE_FORMAT_RRRGGGBB raw_to_rgb_converter(1, &raw_to_rgb_converter::standard_rgb_decoder<3,3,2, 5,2,0>)
|
||||
@ -180,8 +184,8 @@
|
||||
#define MCFG_PALETTE_FORMAT(_format) \
|
||||
palette_device::static_set_format(*device, PALETTE_FORMAT_##_format);
|
||||
|
||||
#define MCFG_PALETTE_FORMAT_CLASS(_bytes_per_entry, _class, _format) \
|
||||
palette_device::static_set_format(*device, raw_to_rgb_converter(_bytes_per_entry, &_class::_format##_decoder));
|
||||
#define MCFG_PALETTE_FORMAT_CLASS(_bytes_per_entry, _class, _method) \
|
||||
palette_device::static_set_format(*device, raw_to_rgb_converter(_bytes_per_entry, &_class::PALETTE_DECODER_NAME(_method)));
|
||||
|
||||
#define MCFG_PALETTE_MEMBITS(_width) \
|
||||
palette_device::static_set_membits(*device, _width);
|
||||
|
@ -349,7 +349,7 @@ public:
|
||||
void mfp_trigger_irq(int irq);
|
||||
void mfp_set_timer(int timer, unsigned char data);
|
||||
void mfp_recv_data(int data);
|
||||
static rgb_t GGGGGRRRRRBBBBBI_decoder(UINT32 raw);
|
||||
DECLARE_PALETTE_DECODER(GGGGGRRRRRBBBBBI);
|
||||
|
||||
protected:
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "machine/ram.h"
|
||||
|
||||
|
||||
rgb_t x68k_state::GGGGGRRRRRBBBBBI_decoder(UINT32 raw)
|
||||
PALETTE_DECODER_MEMBER(x68k_state, GGGGGRRRRRBBBBBI)
|
||||
{
|
||||
UINT8 i = raw & 1;
|
||||
UINT8 r = pal6bit(((raw >> 5) & 0x3e) | i);
|
||||
|
Loading…
Reference in New Issue
Block a user