Previous 199869 Revisions Next

r17696 Friday 7th September, 2012 at 14:43:37 UTC by Curt Coder
(MESS) mos6566: Added VIC-IIe variants. (nw)
[src/emu/sound]mos6560.c
[src/mess/video]mos6566.c mos6566.h

trunk/src/emu/sound/mos6560.c
r17695r17696
123123#define FRAMECOLOR (m_reg[0x0f] & 0x07)
124124
125125
126// VICE palette
126127static const rgb_t PALETTE[] =
127128{
128/* ripped from vice, a very excellent emulator */
129129   MAKE_RGB(0x00, 0x00, 0x00),
130130   MAKE_RGB(0xff, 0xff, 0xff),
131131   MAKE_RGB(0xf0, 0x00, 0x00),
trunk/src/mess/video/mos6566.c
r17695r17696
2323    - cleanup
2424    - light pen
2525    - remove RDY hack
26    - VIC IIe
2726    - http://hitmen.c02.at/temp/palstuff/
2827
2928*/
r17695r17696
9190};
9291
9392
94static const UINT8 PALETTE[] =
93// VICE palette
94static const rgb_t PALETTE[] =
9595{
96// black, white, red, cyan
97// purple, green, blue, yellow
98// orange, brown, light red, dark gray,
99// medium gray, light green, light blue, light gray
100// taken from the vice emulator
101   0x00, 0x00, 0x00,  0xfd, 0xfe, 0xfc,  0xbe, 0x1a, 0x24,  0x30, 0xe6, 0xc6,
102   0xb4, 0x1a, 0xe2,  0x1f, 0xd2, 0x1e,  0x21, 0x1b, 0xae,  0xdf, 0xf6, 0x0a,
103   0xb8, 0x41, 0x04,  0x6a, 0x33, 0x04,  0xfe, 0x4a, 0x57,  0x42, 0x45, 0x40,
104   0x70, 0x74, 0x6f,  0x59, 0xfe, 0x59,  0x5f, 0x53, 0xfe,  0xa4, 0xa7, 0xa2
96   MAKE_RGB(0x00, 0x00, 0x00),
97   MAKE_RGB(0xfd, 0xfe, 0xfc),
98   MAKE_RGB(0xbe, 0x1a, 0x24),
99   MAKE_RGB(0x30, 0xe6, 0xc6),
100   MAKE_RGB(0xb4, 0x1a, 0xe2),
101   MAKE_RGB(0x1f, 0xd2, 0x1e),
102   MAKE_RGB(0x21, 0x1b, 0xae),
103   MAKE_RGB(0xdf, 0xf6, 0x0a),
104   MAKE_RGB(0xb8, 0x41, 0x04),
105   MAKE_RGB(0x6a, 0x33, 0x04),
106   MAKE_RGB(0xfe, 0x4a, 0x57),
107   MAKE_RGB(0x42, 0x45, 0x40),
108   MAKE_RGB(0x70, 0x74, 0x6f),
109   MAKE_RGB(0x59, 0xfe, 0x59),
110   MAKE_RGB(0x5f, 0x53, 0xfe),
111   MAKE_RGB(0xa4, 0xa7, 0xa2)
105112};
106113
107114
r17695r17696
209216const device_type MOS6566 = &device_creator<mos6566_device>;
210217const device_type MOS6567 = &device_creator<mos6567_device>;
211218const device_type MOS8562 = &device_creator<mos8562_device>;
219const device_type MOS8564 = &device_creator<mos8564_device>;
212220const device_type MOS6569 = &device_creator<mos6569_device>;
213221const device_type MOS8565 = &device_creator<mos8565_device>;
222const device_type MOS8566 = &device_creator<mos8566_device>;
214223
215224
216225// default address maps
r17695r17696
560569mos8562_device::mos8562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
561570   :mos6567_device(mconfig, MOS8562, "MOS8562", tag, owner, clock) { m_variant = TYPE_8562; }
562571
572mos8564_device::mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
573   :mos6567_device(mconfig, MOS8564, "MOS8564", tag, owner, clock) { m_variant = TYPE_8564; }
574
563575mos6569_device::mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
564576   :mos6566_device(mconfig, MOS6566, "MOS6569", tag, owner, clock) { m_variant = TYPE_6569; }
565577
r17695r17696
569581mos8565_device::mos8565_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
570582   :mos6569_device(mconfig, MOS8565, "MOS8565", tag, owner, clock) { m_variant = TYPE_8565; }
571583
584mos8566_device::mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
585   :mos6569_device(mconfig, MOS8566, "MOS8566", tag, owner, clock) { m_variant = TYPE_8566; }
572586
587
573588//-------------------------------------------------
574589//  device_config_complete - perform any
575590//  operations now that the configuration is
r17695r17696
617632   m_bitmap = auto_bitmap_ind16_alloc(machine(), width, height);
618633
619634   // initialize palette
620   int i;
635   palette_set_colors(machine(), 0, PALETTE, ARRAY_LENGTH(PALETTE));
621636
622   for (i = 0; i < 16; i++)
637   for (int i = 0; i < 256; i++)
623638   {
624      palette_set_color_rgb(machine(), i, PALETTE[i * 3], PALETTE[i * 3 + 1], PALETTE[i * 3 + 2]);
625   }
626
627   for (i = 0; i < 256; i++)
628   {
629639      m_expandx[i] = 0;
630640      if (i & 1)
631641         m_expandx[i] |= 3;
r17695r17696
645655         m_expandx[i] |= 0xc000;
646656   }
647657
648   for (i = 0; i < 256; i++)
658   for (int i = 0; i < 256; i++)
649659   {
650660      m_expandx_multi[i] = 0;
651661      if (i & 1)
r17695r17696
717727   save_item(NAME(m_mc_base));
718728   save_item(NAME(m_mc));
719729
720   for (i = 0; i < 8; i++)
730   for (int i = 0; i < 8; i++)
721731   {
722732      save_item(NAME(m_spr_data[i]), i);
723733      save_item(NAME(m_spr_draw_data[i]), i);
r17695r17696
28292839{
28302840   return m_last_data;
28312841}
2842
2843
2844READ_LINE_MEMBER( mos8564_device::k0_r ) { return VIC2E_K0_LEVEL; }
2845READ_LINE_MEMBER( mos8564_device::k1_r ) { return VIC2E_K1_LEVEL; }
2846READ_LINE_MEMBER( mos8564_device::k2_r ) { return VIC2E_K2_LEVEL; }
2847
2848READ_LINE_MEMBER( mos8566_device::k0_r ) { return VIC2E_K0_LEVEL; }
2849READ_LINE_MEMBER( mos8566_device::k1_r ) { return VIC2E_K1_LEVEL; }
2850READ_LINE_MEMBER( mos8566_device::k2_r ) { return VIC2E_K2_LEVEL; }
trunk/src/mess/video/mos6566.h
r17695r17696
127127   MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8562_device, screen_update) \
128128   MCFG_PALETTE_LENGTH(16)
129129
130#define MCFG_MOS8564_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
131   MCFG_DEVICE_ADD(_tag, MOS8564, _clock) \
132   MCFG_DEVICE_CONFIG(_config) \
133   MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
134   MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
135   MCFG_SCREEN_ADD(_screen_tag, RASTER) \
136   MCFG_SCREEN_REFRESH_RATE(VIC6567_VRETRACERATE) \
137   MCFG_SCREEN_SIZE(VIC6567_COLUMNS, VIC6567_LINES) \
138   MCFG_SCREEN_VISIBLE_AREA(0, VIC6567_VISIBLECOLUMNS - 1, 0, VIC6567_VISIBLELINES - 1) \
139   MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8562_device, screen_update) \
140   MCFG_PALETTE_LENGTH(16+16) // 16 for VIC, 16 for VDC
141
130142#define MCFG_MOS6569_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
131143   MCFG_DEVICE_ADD(_tag, MOS6569, _clock) \
132144   MCFG_DEVICE_CONFIG(_config) \
r17695r17696
151163   MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8565_device, screen_update) \
152164   MCFG_PALETTE_LENGTH(16)
153165
166#define MCFG_MOS8566_ADD(_tag, _screen_tag, _clock, _config, _videoram_map, _colorram_map) \
167   MCFG_DEVICE_ADD(_tag, MOS8566, _clock) \
168   MCFG_DEVICE_CONFIG(_config) \
169   MCFG_DEVICE_ADDRESS_MAP(AS_0, _videoram_map) \
170   MCFG_DEVICE_ADDRESS_MAP(AS_1, _colorram_map) \
171   MCFG_SCREEN_ADD(_screen_tag, RASTER) \
172   MCFG_SCREEN_REFRESH_RATE(VIC6569_VRETRACERATE) \
173   MCFG_SCREEN_SIZE(VIC6569_COLUMNS, VIC6569_LINES) \
174   MCFG_SCREEN_VISIBLE_AREA(0, VIC6569_VISIBLECOLUMNS - 1, 0, VIC6569_VISIBLELINES - 1) \
175   MCFG_SCREEN_UPDATE_DEVICE(_tag, mos8565_device, screen_update) \
176   MCFG_PALETTE_LENGTH(16+16) // 16 for VIC, 16 for VDC
154177
178
155179#define MOS6566_INTERFACE(_name) \
156180   const mos6566_interface (_name) =
157181
158182#define MOS6567_INTERFACE(_name) \
159183   const mos6566_interface (_name) =
160184
185#define MOS8564_INTERFACE(_name) \
186   const mos6566_interface (_name) =
187
161188#define MOS6569_INTERFACE(_name) \
162189   const mos6566_interface (_name) =
163190
191#define MOS8566_INTERFACE(_name) \
192   const mos6566_interface (_name) =
164193
165194
195
166196//**************************************************************************
167197//  MACROS / CONSTANTS
168198//**************************************************************************
r17695r17696
455485};
456486
457487
488// ======================> mos8564_device
489
490class mos8564_device :  public mos6567_device
491{
492public:
493    // construction/destruction
494    mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
495
496    DECLARE_READ_LINE_MEMBER( k0_r );
497    DECLARE_READ_LINE_MEMBER( k1_r );
498    DECLARE_READ_LINE_MEMBER( k2_r );
499};
500
501
458502// ======================> mos6569_device
459503
460504class mos6569_device :  public mos6566_device
r17695r17696
479523};
480524
481525
526// ======================> mos8566_device
527
528class mos8566_device :  public mos6569_device
529{
530public:
531    // construction/destruction
532    mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
533
534    DECLARE_READ_LINE_MEMBER( k0_r );
535    DECLARE_READ_LINE_MEMBER( k1_r );
536    DECLARE_READ_LINE_MEMBER( k2_r );
537};
538
539
482540// device type definitions
483541extern const device_type MOS6566;
484542extern const device_type MOS6567;
485543extern const device_type MOS8562;
544extern const device_type MOS8564;
486545extern const device_type MOS6569;
487546extern const device_type MOS8565;
547extern const device_type MOS8566;
488548
489549
490550

Previous 199869 Revisions Next


© 1997-2024 The MAME Team