PALETTE_INIT modernizations

This commit is contained in:
Oliver Stöneberg 2013-08-05 12:58:39 +00:00
parent 2c8c6ce711
commit bd681be20a
11 changed files with 32 additions and 44 deletions

View File

@ -103,7 +103,6 @@ the Neogeo Pocket.
#include "sound/dac.h"
#include "video/k1ge.h"
#include "rendlay.h"
#include "drivlgcy.h"
enum flash_state
{
@ -844,7 +843,6 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( ngp, ngp_common )
MCFG_PALETTE_LENGTH( 8 )
MCFG_PALETTE_INIT( k1ge )
MCFG_K1GE_ADD( "k1ge", XTAL_6_144MHz, "screen", WRITELINE( ngp_state, ngp_vblank_pin_w ), WRITELINE( ngp_state, ngp_hblank_pin_w ) )
@ -864,7 +862,6 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( ngpc, ngp_common )
MCFG_PALETTE_LENGTH( 4096 )
MCFG_PALETTE_INIT( k2ge )
MCFG_K2GE_ADD( "k1ge", XTAL_6_144MHz, "screen", WRITELINE( ngp_state, ngp_vblank_pin_w ), WRITELINE( ngp_state, ngp_hblank_pin_w ) )

View File

@ -75,7 +75,6 @@ TODO :
#include "machine/990_hd.h"
#include "machine/990_tap.h"
#include "video/911_vdt.h"
#include "drivlgcy.h"
class ti990_10_state : public driver_device
@ -234,7 +233,6 @@ static MACHINE_CONFIG_START( ti990_10, ti990_10_state )
MCFG_GFXDECODE(vdt911)
MCFG_PALETTE_LENGTH(8)
MCFG_PALETTE_INIT(vdt911)
MCFG_VDT911_VIDEO_ADD("vdt911", vdt911_intf)
/* 911 VDT has a beep tone generator */

View File

@ -47,8 +47,6 @@ TODO:
#include "imagedev/flopdrv.h"
#include "machine/990_dk.h"
#include "drivlgcy.h"
class ti990_4_state : public driver_device
{
@ -272,10 +270,8 @@ static MACHINE_CONFIG_START( ti990_4, ti990_4_state )
#endif
#if VIDEO_911
MCFG_PALETTE_INIT(vdt911)
MCFG_VDT911_VIDEO_ADD("vdt911", vdt911_intf)
#else
MCFG_PALETTE_INIT(asr733)
MCFG_ASR733_VIDEO_ADD("asr733", asr733_intf)
#endif

View File

@ -74,6 +74,8 @@ public:
/* floppy state */
int m_fdc_index;
DECLARE_WRITE_LINE_MEMBER(osi470_index_callback);
DECLARE_PALETTE_INIT(osi630);
required_device<cpu_device> m_maincpu;
required_device<cassette_image_device> m_cassette;

View File

@ -93,10 +93,10 @@ GFXDECODE_START( asr733 )
GFXDECODE_ENTRY( asr733_chr_region, 0, fontlayout, 0, 1 )
GFXDECODE_END
PALETTE_INIT( asr733 )
void asr733_device::palette_init()
{
palette_set_color(machine,0,RGB_WHITE); /* white */
palette_set_color(machine,1,RGB_BLACK); /* black */
palette_set_color(machine(),0,RGB_WHITE); /* white */
palette_set_color(machine(),1,RGB_BLACK); /* black */
}
/*

View File

@ -16,8 +16,6 @@ struct asr733_init_params_t
GFXDECODE_EXTERN( asr733 );
PALETTE_INIT( asr733 );
void asr733_init(running_machine &machine);
class asr733_device : public device_t
{
@ -32,6 +30,7 @@ protected:
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void palette_init();
private:
// internal state
void *m_token;

View File

@ -131,20 +131,20 @@ static TIMER_CALLBACK(beep_callback);
/*
Initialize vdt911 palette
*/
PALETTE_INIT( vdt911 )
void vdt911_device::palette_init()
{
UINT8 i, r, g, b;
machine.colortable = colortable_alloc(machine, 3);
machine().colortable = colortable_alloc(machine(), 3);
for ( i = 0; i < 3; i++ )
{
r = vdt911_colors[i*3]; g = vdt911_colors[i*3+1]; b = vdt911_colors[i*3+2];
colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
colortable_palette_set_color(machine().colortable, i, MAKE_RGB(r, g, b));
}
for(i=0;i<8;i++)
colortable_entry_set_value(machine.colortable, i, vdt911_palette[i]);
colortable_entry_set_value(machine().colortable, i, vdt911_palette[i]);
}
/*

View File

@ -40,8 +40,6 @@ struct vdt911_init_params_t
void (*int_callback)(running_machine &machine, int state);
};
PALETTE_INIT( vdt911 );
void vdt911_init(running_machine &machine);
class vdt911_device : public device_t
{
@ -55,6 +53,7 @@ protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void palette_init();
private:
// internal state
void *m_token;

View File

@ -11,7 +11,7 @@ used in the Neogeo pocket color.
#include "k1ge.h"
PALETTE_INIT( k1ge )
void k1ge_device::palette_init()
{
int i;
@ -19,12 +19,12 @@ PALETTE_INIT( k1ge )
{
int j = ( i << 5 ) | ( i << 2 ) | ( i >> 1 );
palette_set_color_rgb( machine, 7-i, j, j, j );
palette_set_color_rgb( machine(), 7-i, j, j, j );
}
}
PALETTE_INIT( k2ge )
void k2ge_device::palette_init()
{
int r,g,b;
@ -34,7 +34,7 @@ PALETTE_INIT( k2ge )
{
for ( r = 0; r < 16; r++ )
{
palette_set_color_rgb( machine, ( b << 8 ) | ( g << 4 ) | r, ( r << 4 ) | r, ( g << 4 ) | g, ( b << 4 ) | b );
palette_set_color_rgb( machine(), ( b << 8 ) | ( g << 4 ) | r, ( r << 4 ) | r, ( g << 4 ) | g, ( b << 4 ) | b );
}
}
}

View File

@ -27,7 +27,7 @@ public:
DECLARE_WRITE8_MEMBER( reg_write );
DECLARE_READ8_MEMBER( vram_read );
DECLARE_WRITE8_MEMBER( vram_write );
void update( bitmap_ind16 &bitmap, const rectangle &cliprect );
// Static methods
@ -38,7 +38,8 @@ public:
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual void device_reset();
virtual void palette_init();
devcb2_write_line m_vblank_pin_w;
devcb2_write_line m_hblank_pin_w;
@ -65,6 +66,8 @@ public:
k2ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
virtual void palette_init();
virtual void draw(int line);
void draw_scroll_plane( UINT16 *p, UINT16 base, int line, int scroll_x, int scroll_y, UINT16 pal_base );
@ -74,11 +77,6 @@ protected:
};
PALETTE_INIT( k1ge );
PALETTE_INIT( k2ge );
extern const device_type K1GE;
extern const device_type K2GE;

View File

@ -1,23 +1,22 @@
#include "includes/osi.h"
#include "drivlgcy.h"
/* Palette Initialization */
static PALETTE_INIT( osi630 )
PALETTE_INIT_MEMBER(sb2m600_state, osi630)
{
/* black and white */
palette_set_color_rgb(machine, 0, 0x00, 0x00, 0x00); // black
palette_set_color_rgb(machine, 1, 0xff, 0xff, 0xff); // white
palette_set_color_rgb(machine(), 0, 0x00, 0x00, 0x00); // black
palette_set_color_rgb(machine(), 1, 0xff, 0xff, 0xff); // white
/* color enabled */
palette_set_color_rgb(machine, 2, 0xff, 0xff, 0x00); // yellow
palette_set_color_rgb(machine, 3, 0xff, 0x00, 0x00); // red
palette_set_color_rgb(machine, 4, 0x00, 0xff, 0x00); // green
palette_set_color_rgb(machine, 5, 0x00, 0x80, 0x00); // olive green
palette_set_color_rgb(machine, 6, 0x00, 0x00, 0xff); // blue
palette_set_color_rgb(machine, 7, 0xff, 0x00, 0xff); // purple
palette_set_color_rgb(machine, 8, 0x00, 0x00, 0x80); // sky blue
palette_set_color_rgb(machine, 9, 0x00, 0x00, 0x00); // black
palette_set_color_rgb(machine(), 2, 0xff, 0xff, 0x00); // yellow
palette_set_color_rgb(machine(), 3, 0xff, 0x00, 0x00); // red
palette_set_color_rgb(machine(), 4, 0x00, 0xff, 0x00); // green
palette_set_color_rgb(machine(), 5, 0x00, 0x80, 0x00); // olive green
palette_set_color_rgb(machine(), 6, 0x00, 0x00, 0xff); // blue
palette_set_color_rgb(machine(), 7, 0xff, 0x00, 0xff); // purple
palette_set_color_rgb(machine(), 8, 0x00, 0x00, 0x80); // sky blue
palette_set_color_rgb(machine(), 9, 0x00, 0x00, 0x00); // black
}
/* Video Start */
@ -174,5 +173,5 @@ MACHINE_CONFIG_FRAGMENT( osi630_video )
MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*16-1)
MCFG_PALETTE_LENGTH(8+2)
MCFG_PALETTE_INIT(osi630)
MCFG_PALETTE_INIT_OVERRIDE(sb2m600_state, osi630)
MACHINE_CONFIG_END