(MESS) mos6566: Added VIC-IIe variants. (nw)

This commit is contained in:
Curt Coder 2012-09-07 14:43:37 +00:00
parent 1f77747f86
commit 0034b75f16
3 changed files with 100 additions and 21 deletions

View File

@ -123,9 +123,9 @@
#define FRAMECOLOR (m_reg[0x0f] & 0x07) #define FRAMECOLOR (m_reg[0x0f] & 0x07)
// VICE palette
static const rgb_t PALETTE[] = static const rgb_t PALETTE[] =
{ {
/* ripped from vice, a very excellent emulator */
MAKE_RGB(0x00, 0x00, 0x00), MAKE_RGB(0x00, 0x00, 0x00),
MAKE_RGB(0xff, 0xff, 0xff), MAKE_RGB(0xff, 0xff, 0xff),
MAKE_RGB(0xf0, 0x00, 0x00), MAKE_RGB(0xf0, 0x00, 0x00),

View File

@ -23,7 +23,6 @@
- cleanup - cleanup
- light pen - light pen
- remove RDY hack - remove RDY hack
- VIC IIe
- http://hitmen.c02.at/temp/palstuff/ - http://hitmen.c02.at/temp/palstuff/
*/ */
@ -91,17 +90,25 @@ enum
}; };
static const UINT8 PALETTE[] = // VICE palette
static const rgb_t PALETTE[] =
{ {
// black, white, red, cyan MAKE_RGB(0x00, 0x00, 0x00),
// purple, green, blue, yellow MAKE_RGB(0xfd, 0xfe, 0xfc),
// orange, brown, light red, dark gray, MAKE_RGB(0xbe, 0x1a, 0x24),
// medium gray, light green, light blue, light gray MAKE_RGB(0x30, 0xe6, 0xc6),
// taken from the vice emulator MAKE_RGB(0xb4, 0x1a, 0xe2),
0x00, 0x00, 0x00, 0xfd, 0xfe, 0xfc, 0xbe, 0x1a, 0x24, 0x30, 0xe6, 0xc6, MAKE_RGB(0x1f, 0xd2, 0x1e),
0xb4, 0x1a, 0xe2, 0x1f, 0xd2, 0x1e, 0x21, 0x1b, 0xae, 0xdf, 0xf6, 0x0a, MAKE_RGB(0x21, 0x1b, 0xae),
0xb8, 0x41, 0x04, 0x6a, 0x33, 0x04, 0xfe, 0x4a, 0x57, 0x42, 0x45, 0x40, MAKE_RGB(0xdf, 0xf6, 0x0a),
0x70, 0x74, 0x6f, 0x59, 0xfe, 0x59, 0x5f, 0x53, 0xfe, 0xa4, 0xa7, 0xa2 MAKE_RGB(0xb8, 0x41, 0x04),
MAKE_RGB(0x6a, 0x33, 0x04),
MAKE_RGB(0xfe, 0x4a, 0x57),
MAKE_RGB(0x42, 0x45, 0x40),
MAKE_RGB(0x70, 0x74, 0x6f),
MAKE_RGB(0x59, 0xfe, 0x59),
MAKE_RGB(0x5f, 0x53, 0xfe),
MAKE_RGB(0xa4, 0xa7, 0xa2)
}; };
@ -209,8 +216,10 @@ static const UINT8 PALETTE[] =
const device_type MOS6566 = &device_creator<mos6566_device>; const device_type MOS6566 = &device_creator<mos6566_device>;
const device_type MOS6567 = &device_creator<mos6567_device>; const device_type MOS6567 = &device_creator<mos6567_device>;
const device_type MOS8562 = &device_creator<mos8562_device>; const device_type MOS8562 = &device_creator<mos8562_device>;
const device_type MOS8564 = &device_creator<mos8564_device>;
const device_type MOS6569 = &device_creator<mos6569_device>; const device_type MOS6569 = &device_creator<mos6569_device>;
const device_type MOS8565 = &device_creator<mos8565_device>; const device_type MOS8565 = &device_creator<mos8565_device>;
const device_type MOS8566 = &device_creator<mos8566_device>;
// default address maps // default address maps
@ -560,6 +569,9 @@ mos6567_device::mos6567_device(const machine_config &mconfig, device_type type,
mos8562_device::mos8562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) mos8562_device::mos8562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
:mos6567_device(mconfig, MOS8562, "MOS8562", tag, owner, clock) { m_variant = TYPE_8562; } :mos6567_device(mconfig, MOS8562, "MOS8562", tag, owner, clock) { m_variant = TYPE_8562; }
mos8564_device::mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
:mos6567_device(mconfig, MOS8564, "MOS8564", tag, owner, clock) { m_variant = TYPE_8564; }
mos6569_device::mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) mos6569_device::mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
:mos6566_device(mconfig, MOS6566, "MOS6569", tag, owner, clock) { m_variant = TYPE_6569; } :mos6566_device(mconfig, MOS6566, "MOS6569", tag, owner, clock) { m_variant = TYPE_6569; }
@ -569,6 +581,9 @@ mos6569_device::mos6569_device(const machine_config &mconfig, device_type type,
mos8565_device::mos8565_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) mos8565_device::mos8565_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
:mos6569_device(mconfig, MOS8565, "MOS8565", tag, owner, clock) { m_variant = TYPE_8565; } :mos6569_device(mconfig, MOS8565, "MOS8565", tag, owner, clock) { m_variant = TYPE_8565; }
mos8566_device::mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
:mos6569_device(mconfig, MOS8566, "MOS8566", tag, owner, clock) { m_variant = TYPE_8566; }
//------------------------------------------------- //-------------------------------------------------
// device_config_complete - perform any // device_config_complete - perform any
@ -617,14 +632,9 @@ void mos6566_device::device_start()
m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height); m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
// initialize palette // initialize palette
int i; palette_set_colors(machine(), 0, PALETTE, ARRAY_LENGTH(PALETTE));
for (i = 0; i < 16; i++) for (int i = 0; i < 256; i++)
{
palette_set_color_rgb(machine(), i, PALETTE[i * 3], PALETTE[i * 3 + 1], PALETTE[i * 3 + 2]);
}
for (i = 0; i < 256; i++)
{ {
m_expandx[i] = 0; m_expandx[i] = 0;
if (i & 1) if (i & 1)
@ -645,7 +655,7 @@ void mos6566_device::device_start()
m_expandx[i] |= 0xc000; m_expandx[i] |= 0xc000;
} }
for (i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
{ {
m_expandx_multi[i] = 0; m_expandx_multi[i] = 0;
if (i & 1) if (i & 1)
@ -717,7 +727,7 @@ void mos6566_device::device_start()
save_item(NAME(m_mc_base)); save_item(NAME(m_mc_base));
save_item(NAME(m_mc)); save_item(NAME(m_mc));
for (i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
{ {
save_item(NAME(m_spr_data[i]), i); save_item(NAME(m_spr_data[i]), i);
save_item(NAME(m_spr_draw_data[i]), i); save_item(NAME(m_spr_draw_data[i]), i);
@ -2829,3 +2839,12 @@ UINT8 mos6566_device::bus_r()
{ {
return m_last_data; return m_last_data;
} }
READ_LINE_MEMBER( mos8564_device::k0_r ) { return VIC2E_K0_LEVEL; }
READ_LINE_MEMBER( mos8564_device::k1_r ) { return VIC2E_K1_LEVEL; }
READ_LINE_MEMBER( mos8564_device::k2_r ) { return VIC2E_K2_LEVEL; }
READ_LINE_MEMBER( mos8566_device::k0_r ) { return VIC2E_K0_LEVEL; }
READ_LINE_MEMBER( mos8566_device::k1_r ) { return VIC2E_K1_LEVEL; }
READ_LINE_MEMBER( mos8566_device::k2_r ) { return VIC2E_K2_LEVEL; }

View File

@ -127,6 +127,18 @@
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8562_device, screen_update) \ MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8562_device, screen_update) \
MCFG_PALETTE_LENGTH(16) MCFG_PALETTE_LENGTH(16)
#define MCFG_MOS8564_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
MCFG_DEVICE_ADD(_tag, MOS8564, _clock) \
MCFG_DEVICE_CONFIG(_config) \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
MCFG_SCREEN_REFRESH_RATE(VIC6567_VRETRACERATE) \
MCFG_SCREEN_SIZE(VIC6567_COLUMNS, VIC6567_LINES) \
MCFG_SCREEN_VISIBLE_AREA(0, VIC6567_VISIBLECOLUMNS - 1, 0, VIC6567_VISIBLELINES - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8562_device, screen_update) \
MCFG_PALETTE_LENGTH(16+16) // 16 for VIC, 16 for VDC
#define MCFG_MOS6569_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \ #define MCFG_MOS6569_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
MCFG_DEVICE_ADD(_tag, MOS6569, _clock) \ MCFG_DEVICE_ADD(_tag, MOS6569, _clock) \
MCFG_DEVICE_CONFIG(_config) \ MCFG_DEVICE_CONFIG(_config) \
@ -151,6 +163,18 @@
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8565_device, screen_update) \ MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8565_device, screen_update) \
MCFG_PALETTE_LENGTH(16) MCFG_PALETTE_LENGTH(16)
#define MCFG_MOS8566_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
MCFG_DEVICE_ADD(_tag, MOS8566, _clock) \
MCFG_DEVICE_CONFIG(_config) \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
MCFG_SCREEN_ADD(_screen_tag, RASTER) \
MCFG_SCREEN_REFRESH_RATE(VIC6569_VRETRACERATE) \
MCFG_SCREEN_SIZE(VIC6569_COLUMNS, VIC6569_LINES) \
MCFG_SCREEN_VISIBLE_AREA(0, VIC6569_VISIBLECOLUMNS - 1, 0, VIC6569_VISIBLELINES - 1) \
MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8565_device, screen_update) \
MCFG_PALETTE_LENGTH(16+16) // 16 for VIC, 16 for VDC
#define MOS6566_INTERFACE(_name) \ #define MOS6566_INTERFACE(_name) \
const mos6566_interface (_name) = const mos6566_interface (_name) =
@ -158,9 +182,15 @@
#define MOS6567_INTERFACE(_name) \ #define MOS6567_INTERFACE(_name) \
const mos6566_interface (_name) = const mos6566_interface (_name) =
#define MOS8564_INTERFACE(_name) \
const mos6566_interface (_name) =
#define MOS6569_INTERFACE(_name) \ #define MOS6569_INTERFACE(_name) \
const mos6566_interface (_name) = const mos6566_interface (_name) =
#define MOS8566_INTERFACE(_name) \
const mos6566_interface (_name) =
//************************************************************************** //**************************************************************************
@ -455,6 +485,20 @@ public:
}; };
// ======================> mos8564_device
class mos8564_device : public mos6567_device
{
public:
// construction/destruction
mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
DECLARE_READ_LINE_MEMBER( k0_r );
DECLARE_READ_LINE_MEMBER( k1_r );
DECLARE_READ_LINE_MEMBER( k2_r );
};
// ======================> mos6569_device // ======================> mos6569_device
class mos6569_device : public mos6566_device class mos6569_device : public mos6566_device
@ -479,12 +523,28 @@ public:
}; };
// ======================> mos8566_device
class mos8566_device : public mos6569_device
{
public:
// construction/destruction
mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
DECLARE_READ_LINE_MEMBER( k0_r );
DECLARE_READ_LINE_MEMBER( k1_r );
DECLARE_READ_LINE_MEMBER( k2_r );
};
// device type definitions // device type definitions
extern const device_type MOS6566; extern const device_type MOS6566;
extern const device_type MOS6567; extern const device_type MOS6567;
extern const device_type MOS8562; extern const device_type MOS8562;
extern const device_type MOS8564;
extern const device_type MOS6569; extern const device_type MOS6569;
extern const device_type MOS8565; extern const device_type MOS8565;
extern const device_type MOS8566;