removed need for legacy palette for pocketc (nw)

This commit is contained in:
Miodrag Milanovic 2014-03-12 11:09:54 +00:00
parent 8dc00459ab
commit f7c49a5019
7 changed files with 33 additions and 36 deletions

View File

@ -13,7 +13,6 @@
#include "includes/pc1350.h" #include "includes/pc1350.h"
#include "includes/pc1403.h" #include "includes/pc1403.h"
#include "machine/ram.h" #include "machine/ram.h"
#include "drivlgcy.h"
/* pc1430 no peek poke operations! */ /* pc1430 no peek poke operations! */
@ -708,7 +707,7 @@ static GFXDECODE_START( pc1251 )
GFXDECODE_ENTRY( "gfx1", 0x0000, pc1251_charlayout, 0, 8 ) GFXDECODE_ENTRY( "gfx1", 0x0000, pc1251_charlayout, 0, 8 )
GFXDECODE_END GFXDECODE_END
static MACHINE_CONFIG_FRAGMENT( pocketc ) static MACHINE_CONFIG_START( pocketc, pocketc_state)
MCFG_QUANTUM_TIME(attotime::from_hz(60)) MCFG_QUANTUM_TIME(attotime::from_hz(60))
MCFG_NVRAM_ADD_0FILL("cpu_nvram") MCFG_NVRAM_ADD_0FILL("cpu_nvram")
@ -730,13 +729,13 @@ static MACHINE_CONFIG_FRAGMENT( pocketc )
MCFG_GFXDECODE_ADD("gfxdecode", pc1401 ) MCFG_GFXDECODE_ADD("gfxdecode", pc1401 )
MCFG_PALETTE_ADD("palette", 8*2) MCFG_PALETTE_ADD("palette", 8*2)
MCFG_PALETTE_INDIRECT_ENTRIES(6) MCFG_PALETTE_INDIRECT_ENTRIES(6)
MCFG_PALETTE_INIT_LEGACY( pocketc ) MCFG_PALETTE_INIT_OWNER( pocketc_state, pocketc )
/* sound hardware */ /* sound hardware */
/*MCFG_SOUND_ADD("dac", DAC, pocketc_sound_interface)*/ /*MCFG_SOUND_ADD("dac", DAC, pocketc_sound_interface)*/
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pc1401, pc1401_state ) static MACHINE_CONFIG_DERIVED_CLASS( pc1401, pocketc, pc1401_state )
MCFG_CPU_ADD("maincpu", SC61860, 192000) /* 7.8336 MHz */ MCFG_CPU_ADD("maincpu", SC61860, 192000) /* 7.8336 MHz */
MCFG_CPU_PROGRAM_MAP(pc1401_mem) MCFG_CPU_PROGRAM_MAP(pc1401_mem)
MCFG_SC61860_READ_RESET_HANDLER(READLINE(pc1401_state,pc1401_reset)) MCFG_SC61860_READ_RESET_HANDLER(READLINE(pc1401_state,pc1401_reset))
@ -748,8 +747,6 @@ static MACHINE_CONFIG_START( pc1401, pc1401_state )
MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1401_state,pc1401_outb)) MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1401_state,pc1401_outb))
MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1401_state,pc1401_outc)) MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1401_state,pc1401_outc))
MCFG_FRAGMENT_ADD(pocketc)
MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(pc1401_state, screen_update_pc1401) MCFG_SCREEN_UPDATE_DRIVER(pc1401_state, screen_update_pc1401)
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -759,7 +756,7 @@ static MACHINE_CONFIG_DERIVED( pc1402, pc1401 )
MCFG_CPU_PROGRAM_MAP( pc1402_mem) MCFG_CPU_PROGRAM_MAP( pc1402_mem)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pc1250, pc1251_state ) static MACHINE_CONFIG_DERIVED_CLASS( pc1250, pocketc, pc1251_state )
MCFG_CPU_ADD("maincpu", SC61860, 192000) /* 7.8336 MHz */ MCFG_CPU_ADD("maincpu", SC61860, 192000) /* 7.8336 MHz */
MCFG_CPU_PROGRAM_MAP( pc1250_mem) MCFG_CPU_PROGRAM_MAP( pc1250_mem)
MCFG_SC61860_READ_RESET_HANDLER(NULL) MCFG_SC61860_READ_RESET_HANDLER(NULL)
@ -771,8 +768,6 @@ static MACHINE_CONFIG_START( pc1250, pc1251_state )
MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1251_state,pc1251_outb)) MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1251_state,pc1251_outb))
MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1251_state,pc1251_outc)) MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1251_state,pc1251_outc))
MCFG_FRAGMENT_ADD(pocketc)
/* video hardware */ /* video hardware */
MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_SIZE(608, 300) MCFG_SCREEN_SIZE(608, 300)
@ -803,7 +798,7 @@ static MACHINE_CONFIG_DERIVED( pc1261, pc1260 )
MCFG_CPU_PROGRAM_MAP( pc1261_mem) MCFG_CPU_PROGRAM_MAP( pc1261_mem)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pc1350, pc1350_state ) static MACHINE_CONFIG_DERIVED_CLASS( pc1350, pocketc, pc1350_state )
MCFG_CPU_ADD("maincpu", SC61860, 192000) /* 7.8336 MHz */ MCFG_CPU_ADD("maincpu", SC61860, 192000) /* 7.8336 MHz */
MCFG_CPU_PROGRAM_MAP( pc1350_mem) MCFG_CPU_PROGRAM_MAP( pc1350_mem)
MCFG_SC61860_READ_RESET_HANDLER(NULL) MCFG_SC61860_READ_RESET_HANDLER(NULL)
@ -815,8 +810,6 @@ static MACHINE_CONFIG_START( pc1350, pc1350_state )
MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1350_state,pc1350_outb)) MCFG_SC61860_WRITE_B_HANDLER(WRITE8(pc1350_state,pc1350_outb))
MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1350_state,pc1350_outc)) MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1350_state,pc1350_outc))
MCFG_FRAGMENT_ADD( pocketc )
/* /*
aim: show sharp with keyboard aim: show sharp with keyboard
resolution depends on the dots of the lcd resolution depends on the dots of the lcd
@ -833,7 +826,7 @@ static MACHINE_CONFIG_START( pc1350, pc1350_state )
MCFG_RAM_EXTRA_OPTIONS("12K,20K") MCFG_RAM_EXTRA_OPTIONS("12K,20K")
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pc1403, pc1403_state ) static MACHINE_CONFIG_DERIVED_CLASS( pc1403, pocketc, pc1403_state )
MCFG_CPU_ADD( "maincpu", SC61860, 256000 ) MCFG_CPU_ADD( "maincpu", SC61860, 256000 )
MCFG_CPU_PROGRAM_MAP( pc1403_mem) MCFG_CPU_PROGRAM_MAP( pc1403_mem)
MCFG_SC61860_READ_RESET_HANDLER(NULL) MCFG_SC61860_READ_RESET_HANDLER(NULL)
@ -845,8 +838,6 @@ static MACHINE_CONFIG_START( pc1403, pc1403_state )
MCFG_SC61860_WRITE_B_HANDLER(NULL) MCFG_SC61860_WRITE_B_HANDLER(NULL)
MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1403_state,pc1403_outc)) MCFG_SC61860_WRITE_C_HANDLER(WRITE8(pc1403_state,pc1403_outc))
MCFG_FRAGMENT_ADD( pocketc )
/* /*
aim: show sharp with keyboard aim: show sharp with keyboard
resolution depends on the dots of the lcd resolution depends on the dots of the lcd

View File

@ -9,13 +9,14 @@
#ifndef PC1251_H_ #ifndef PC1251_H_
#define PC1251_H_ #define PC1251_H_
#include "pocketc.h"
#include "cpu/sc61860/sc61860.h" #include "cpu/sc61860/sc61860.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#define PC1251_CONTRAST (ioport("DSW0")->read() & 0x07) #define PC1251_CONTRAST (ioport("DSW0")->read() & 0x07)
class pc1251_state : public driver_device class pc1251_state : public pocketc_state
{ {
public: public:
enum enum
@ -24,7 +25,7 @@ public:
}; };
pc1251_state(const machine_config &mconfig, device_type type, const char *tag) pc1251_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : pocketc_state(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"), m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { } m_palette(*this, "palette") { }

View File

@ -9,6 +9,7 @@
#ifndef PC1350_H_ #ifndef PC1350_H_
#define PC1350_H_ #define PC1350_H_
#include "pocketc.h"
#include "cpu/sc61860/sc61860.h" #include "cpu/sc61860/sc61860.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#include "machine/ram.h" #include "machine/ram.h"
@ -16,7 +17,7 @@
#define PC1350_CONTRAST (ioport("DSW0")->read() & 0x07) #define PC1350_CONTRAST (ioport("DSW0")->read() & 0x07)
class pc1350_state : public driver_device class pc1350_state : public pocketc_state
{ {
public: public:
enum enum
@ -25,7 +26,7 @@ public:
}; };
pc1350_state(const machine_config &mconfig, device_type type, const char *tag) pc1350_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : pocketc_state(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_ram(*this, RAM_TAG) { } m_ram(*this, RAM_TAG) { }

View File

@ -9,13 +9,14 @@
#ifndef PC1401_H_ #ifndef PC1401_H_
#define PC1401_H_ #define PC1401_H_
#include "pocketc.h"
#include "cpu/sc61860/sc61860.h" #include "cpu/sc61860/sc61860.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#define CONTRAST (ioport("DSW0")->read() & 0x07) #define CONTRAST (ioport("DSW0")->read() & 0x07)
class pc1401_state : public driver_device class pc1401_state : public pocketc_state
{ {
public: public:
enum enum
@ -24,7 +25,7 @@ public:
}; };
pc1401_state(const machine_config &mconfig, device_type type, const char *tag) pc1401_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : pocketc_state(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"), m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { } m_palette(*this, "palette") { }

View File

@ -9,13 +9,14 @@
#ifndef PC1403_H_ #ifndef PC1403_H_
#define PC1403_H_ #define PC1403_H_
#include "pocketc.h"
#include "cpu/sc61860/sc61860.h" #include "cpu/sc61860/sc61860.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#define CONTRAST (ioport("DSW0")->read() & 0x07) #define CONTRAST (ioport("DSW0")->read() & 0x07)
class pc1403_state : public driver_device class pc1403_state : public pocketc_state
{ {
public: public:
enum enum
@ -24,7 +25,7 @@ public:
}; };
pc1403_state(const machine_config &mconfig, device_type type, const char *tag) pc1403_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : pocketc_state(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"), m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { } m_palette(*this, "palette") { }

View File

@ -7,16 +7,18 @@
#ifndef POCKETC_H_ #ifndef POCKETC_H_
#define POCKETC_H_ #define POCKETC_H_
/*----------- defined in video/pocketc.c -----------*/
extern PALETTE_INIT( pocketc );
extern const unsigned short pocketc_colortable[8][2];
typedef const char *POCKETC_FIGURE[]; typedef const char *POCKETC_FIGURE[];
void pocketc_draw_special(bitmap_ind16 &bitmap,
int x, int y, const POCKETC_FIGURE fig, int color);
class pocketc_state : public driver_device
{
public:
pocketc_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { }
DECLARE_PALETTE_INIT(pocketc);
static const unsigned short pocketc_colortable[8][2];
void pocketc_draw_special(bitmap_ind16 &bitmap,int x, int y, const POCKETC_FIGURE fig, int color);
};
#endif /* POCKETC_H_ */ #endif /* POCKETC_H_ */

View File

@ -18,7 +18,7 @@ static const UINT8 pocketc_palette[] =
0, 0, 0 0, 0, 0
}; };
const unsigned short pocketc_colortable[8][2] = { const unsigned short pocketc_state::pocketc_colortable[8][2] = {
{ 5, 4 }, { 5, 4 },
{ 5, 0 }, { 5, 0 },
{ 5, 2 }, { 5, 2 },
@ -29,7 +29,7 @@ const unsigned short pocketc_colortable[8][2] = {
{ 3, 5 } { 3, 5 }
}; };
PALETTE_INIT( pocketc ) PALETTE_INIT_MEMBER(pocketc_state, pocketc)
{ {
UINT8 i=0, r, b, g, color_count = 6; UINT8 i=0, r, b, g, color_count = 6;
@ -48,7 +48,7 @@ PALETTE_INIT( pocketc )
/* Draw an indicator (DEG, SHIFT, etc) */ /* Draw an indicator (DEG, SHIFT, etc) */
void pocketc_draw_special(bitmap_ind16 &bitmap, int x, int y, const POCKETC_FIGURE fig, int color) void pocketc_state::pocketc_draw_special(bitmap_ind16 &bitmap, int x, int y, const POCKETC_FIGURE fig, int color)
{ {
int i,j; int i,j;
for (i=0; fig[i]; i++, y++) for (i=0; fig[i]; i++, y++)