mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
huc6260: Internalize palette (nw)
This commit is contained in:
parent
1d68137135
commit
66aece0d82
8 changed files with 19 additions and 25 deletions
|
@ -33,19 +33,17 @@ constexpr unsigned huc6260_device::PALETTE_SIZE;
|
|||
constexpr unsigned huc6260_device::WPF;
|
||||
constexpr unsigned huc6260_device::LPF;
|
||||
|
||||
PALETTE_INIT_MEMBER(huc6260_device, huc6260)
|
||||
void huc6260_device::palette_init()
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < 512; i++ )
|
||||
for (int i = 0; i < 512; i++)
|
||||
{
|
||||
int r = pal3bit( ( i >> 3 ) & 7 );
|
||||
int g = pal3bit( ( i >> 6 ) & 7 );
|
||||
int b = pal3bit( ( i ) & 7 );
|
||||
int y = ( ( 66 * r + 129 * g + 25 * b + 128 ) >> 8 ) + 16;
|
||||
|
||||
palette.set_pen_color( i, r, g, b );
|
||||
palette.set_pen_color( 512 + i, y, y, y );
|
||||
set_pen_color(i, r, g, b);
|
||||
set_pen_color(512 + i, y, y, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,6 +53,7 @@ DEFINE_DEVICE_TYPE(HUC6260, huc6260_device, "huc6260", "Hudson HuC6260 VCE")
|
|||
|
||||
huc6260_device::huc6260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, HUC6260, tag, owner, clock),
|
||||
device_palette_interface(mconfig, *this),
|
||||
device_video_interface(mconfig, *this),
|
||||
m_next_pixel_data_cb(*this),
|
||||
m_time_til_next_event_cb(*this),
|
||||
|
@ -271,6 +270,8 @@ void huc6260_device::device_start()
|
|||
assert( ! m_next_pixel_data_cb.isnull() );
|
||||
assert( ! m_time_til_next_event_cb.isnull() );
|
||||
|
||||
palette_init();
|
||||
|
||||
save_item(NAME(m_last_h));
|
||||
save_item(NAME(m_last_v));
|
||||
save_item(NAME(m_height));
|
||||
|
@ -298,12 +299,3 @@ void huc6260_device::device_reset()
|
|||
m_last_h = screen().hpos();
|
||||
m_timer->adjust( screen().time_until_pos( ( screen().vpos() + 1 ) % 263, 0 ) );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
MACHINE_CONFIG_START(huc6260_device::device_add_mconfig)
|
||||
MCFG_PALETTE_ADD("palette", huc6260_device::PALETTE_SIZE)
|
||||
MCFG_PALETTE_INIT_OWNER(huc6260_device, huc6260)
|
||||
MACHINE_CONFIG_END
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
|
||||
class huc6260_device : public device_t,
|
||||
public device_palette_interface,
|
||||
public device_video_interface
|
||||
{
|
||||
public:
|
||||
|
@ -56,9 +57,12 @@ protected:
|
|||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
virtual uint32_t palette_entries() const override { return PALETTE_SIZE; }
|
||||
|
||||
private:
|
||||
void palette_init();
|
||||
|
||||
int m_last_h;
|
||||
int m_last_v;
|
||||
int m_height;
|
||||
|
@ -86,8 +90,6 @@ private:
|
|||
|
||||
emu_timer *m_timer;
|
||||
std::unique_ptr<bitmap_ind16> m_bmp;
|
||||
|
||||
DECLARE_PALETTE_INIT(huc6260);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ MACHINE_CONFIG_START(battlera_state::battlera)
|
|||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(MAIN_CLOCK, huc6260_device::WPF, 64, 64 + 1024 + 64, huc6260_device::LPF, 18, 18 + 242)
|
||||
MCFG_SCREEN_UPDATE_DRIVER( battlera_state, screen_update )
|
||||
MCFG_SCREEN_PALETTE("huc6260:palette")
|
||||
MCFG_SCREEN_PALETTE("huc6260")
|
||||
|
||||
MCFG_DEVICE_ADD( "huc6260", HUC6260, MAIN_CLOCK )
|
||||
MCFG_HUC6260_NEXT_PIXEL_DATA_CB(READ16("huc6270", huc6270_device, next_pixel))
|
||||
|
|
|
@ -277,7 +277,7 @@ MACHINE_CONFIG_START(ggconnie_state::ggconnie)
|
|||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK/3, huc6260_device::WPF, 64, 64 + 1024 + 64, huc6260_device::LPF, 18, 18 + 242)
|
||||
MCFG_SCREEN_UPDATE_DRIVER( ggconnie_state, screen_update )
|
||||
MCFG_SCREEN_PALETTE("huc6260:palette")
|
||||
MCFG_SCREEN_PALETTE("huc6260")
|
||||
|
||||
MCFG_DEVICE_ADD("huc6260", HUC6260, PCE_MAIN_CLOCK/3)
|
||||
MCFG_HUC6260_NEXT_PIXEL_DATA_CB(READ16("huc6202", huc6202_device, next_pixel))
|
||||
|
|
|
@ -193,7 +193,7 @@ MACHINE_CONFIG_START(paranoia_state::paranoia)
|
|||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK, huc6260_device::WPF, 64, 64 + 1024 + 64, huc6260_device::LPF, 18, 18 + 242)
|
||||
MCFG_SCREEN_UPDATE_DRIVER( pce_common_state, screen_update )
|
||||
MCFG_SCREEN_PALETTE("huc6260:palette")
|
||||
MCFG_SCREEN_PALETTE("huc6260")
|
||||
|
||||
MCFG_DEVICE_ADD( "huc6260", HUC6260, PCE_MAIN_CLOCK )
|
||||
MCFG_HUC6260_NEXT_PIXEL_DATA_CB(READ16("huc6270", huc6270_device, next_pixel))
|
||||
|
|
|
@ -328,7 +328,7 @@ MACHINE_CONFIG_START(pce_state::pce_common)
|
|||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(MAIN_CLOCK, huc6260_device::WPF, 64, 64 + 1024 + 64, huc6260_device::LPF, 18, 18 + 242)
|
||||
MCFG_SCREEN_UPDATE_DRIVER( pce_state, screen_update )
|
||||
MCFG_SCREEN_PALETTE("huc6260:palette")
|
||||
MCFG_SCREEN_PALETTE("huc6260")
|
||||
|
||||
MCFG_DEVICE_ADD( "huc6260", HUC6260, MAIN_CLOCK )
|
||||
MCFG_HUC6260_NEXT_PIXEL_DATA_CB(READ16("huc6270", huc6270_device, next_pixel))
|
||||
|
@ -381,7 +381,7 @@ MACHINE_CONFIG_START(pce_state::sgx)
|
|||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(MAIN_CLOCK, huc6260_device::WPF, 64, 64 + 1024 + 64, huc6260_device::LPF, 18, 18 + 242)
|
||||
MCFG_SCREEN_UPDATE_DRIVER( pce_state, screen_update )
|
||||
MCFG_SCREEN_PALETTE("huc6260:palette")
|
||||
MCFG_SCREEN_PALETTE("huc6260")
|
||||
|
||||
MCFG_DEVICE_ADD( "huc6260", HUC6260, MAIN_CLOCK )
|
||||
MCFG_HUC6260_NEXT_PIXEL_DATA_CB(READ16("huc6202", huc6202_device, next_pixel))
|
||||
|
|
|
@ -406,7 +406,7 @@ MACHINE_CONFIG_START(tourvision_state::tourvision)
|
|||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK, huc6260_device::WPF, 64, 64 + 1024 + 64, huc6260_device::LPF, 18, 18 + 242)
|
||||
MCFG_SCREEN_UPDATE_DRIVER( pce_common_state, screen_update )
|
||||
MCFG_SCREEN_PALETTE("huc6260:palette")
|
||||
MCFG_SCREEN_PALETTE("huc6260")
|
||||
|
||||
MCFG_DEVICE_ADD( "huc6260", HUC6260, PCE_MAIN_CLOCK )
|
||||
MCFG_HUC6260_NEXT_PIXEL_DATA_CB(READ16("huc6270", huc6270_device, next_pixel))
|
||||
|
|
|
@ -320,7 +320,7 @@ MACHINE_CONFIG_START(uapce_state::uapce)
|
|||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK, huc6260_device::WPF, 64, 64 + 1024 + 64, huc6260_device::LPF, 18, 18 + 242)
|
||||
MCFG_SCREEN_UPDATE_DRIVER( pce_common_state, screen_update )
|
||||
MCFG_SCREEN_PALETTE("huc6260:palette")
|
||||
MCFG_SCREEN_PALETTE("huc6260")
|
||||
|
||||
MCFG_DEVICE_ADD( "huc6260", HUC6260, PCE_MAIN_CLOCK )
|
||||
MCFG_HUC6260_NEXT_PIXEL_DATA_CB(READ16("huc6270", huc6270_device, next_pixel))
|
||||
|
|
Loading…
Reference in a new issue