Previous 199869 Revisions Next

r32256 Sunday 21st September, 2014 at 16:25:33 UTC by Fabio Priuli
removed static config from avr8. nw.
[src/emu/cpu/avr8]avr8.c avr8.h
[src/mess/drivers]craft.c replicator.c sbc6510.c uzebox.c

trunk/src/emu/cpu/avr8/avr8.c
r32255r32256
635635      m_program_config("program", ENDIANNESS_LITTLE, 8, 22),
636636      m_data_config("data", ENDIANNESS_LITTLE, 8, 16, 0, internal_map),
637637      m_io_config("io", ENDIANNESS_LITTLE, 8, 4),
638      m_eeprom_tag(NULL),
638639      m_eeprom(NULL),
639   m_cpu_type(cpu_type),
640   m_lfuses(0x62),
641   m_hfuses(0x99),
642   m_efuses(0xFF),
643   m_lock_bits(0xFF),
640      m_cpu_type(cpu_type),
641      m_lfuses(0x62),
642      m_hfuses(0x99),
643      m_efuses(0xFF),
644      m_lock_bits(0xFF),
644645      m_pc(0),
645646      m_spi_active(false),
646647      m_spi_prescale(0),
r32255r32256
661662
662663
663664//-------------------------------------------------
664//  static_set_config - set the configuration
665//  structure
666//-------------------------------------------------
667
668void avr8_device::static_set_config(device_t &device, const avr8_config &config)
669{
670   avr8_device &avr8 = downcast<avr8_device &>(device);
671   static_cast<avr8_config &>(avr8) = config;
672}
673
674//-------------------------------------------------
675665//  static_set_low_fuses
676666//-------------------------------------------------
677667
r32255r32256
833823   // set our instruction counter
834824   m_icountptr = &m_icount;
835825
836   m_eeprom = machine().root_device().memregion(eeprom_region)->base();
826   m_eeprom = machine().root_device().memregion(m_eeprom_tag)->base();
837827}
838828
839829//-------------------------------------------------
trunk/src/emu/cpu/avr8/avr8.h
r32255r32256
4040#ifndef __AVR8_H__
4141#define __AVR8_H__
4242
43//**************************************************************************
44//  INTERFACE CONFIGURATION MACROS
45//**************************************************************************
4643
47#define MCFG_CPU_AVR8_CONFIG(_config) \
48   avr8_device::static_set_config(*device, _config);
49
5044//**************************************************************************
5145//  FUSE BITS CONFIGURATION MACROS
5246//**************************************************************************
r32255r32256
6458   ((avr8_device*) device)->set_lock_bits(byte);
6559
6660//**************************************************************************
67//  TYPE DEFINITIONS
61//  INTERFACE CONFIGURATION MACROS
6862//**************************************************************************
6963
70class avr8_device;
64#define MCFG_CPU_AVR8_EEPROM(_tag) \
65   avr8_device::set_eeprom_tag(*device, _tag);
7166
72// ======================> avr8_config
7367
74struct avr8_config
75{
76   const char *eeprom_region;
77};
68//**************************************************************************
69//  TYPE DEFINITIONS
70//**************************************************************************
7871
72class avr8_device;
7973
8074// ======================> avr8_device
8175
8276// Used by core CPU interface
83class avr8_device : public cpu_device,
84               public avr8_config
77class avr8_device : public cpu_device
8578{
8679public:
8780   // construction/destruction
8881   avr8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock, const device_type type, UINT32 address_mask);
8982
9083   // inline configuration helpers
91   static void static_set_config(device_t &device, const avr8_config &config);
84   static void set_eeprom_tag(device_t &device, const char *tag) { downcast<avr8_device &>(device).m_eeprom_tag = tag; }
9285
9386   // fuse configs
9487   void set_low_fuses(UINT8 byte);
r32255r32256
145138   const address_space_config m_program_config;
146139   const address_space_config m_data_config;
147140   const address_space_config m_io_config;
141   const char *m_eeprom_tag;
148142   UINT8 *m_eeprom;
149143
150144   // bootloader
trunk/src/mess/drivers/uzebox.c
r32255r32256
297297* Machine definition                                 *
298298\****************************************************/
299299
300const avr8_config atmega644_config =
301{
302   "eeprom"
303};
304
305300static MACHINE_CONFIG_START( uzebox, uzebox_state )
306301
307302   /* basic machine hardware */
308303   MCFG_CPU_ADD("maincpu", ATMEGA644, MASTER_CLOCK)
309   MCFG_CPU_AVR8_CONFIG(atmega644_config)
310304   MCFG_CPU_PROGRAM_MAP(uzebox_prg_map)
311305   MCFG_CPU_DATA_MAP(uzebox_data_map)
312306   MCFG_CPU_IO_MAP(uzebox_io_map)
307   MCFG_CPU_AVR8_EEPROM("eeprom")
313308
314309   /* video hardware */
315310   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/craft.c
r32255r32256
234234   m_last_cycles = 0;
235235}
236236
237const avr8_config atmega88_config =
238{
239   "eeprom"
240};
241
242237static MACHINE_CONFIG_START( craft, craft_state )
243238
244239   /* basic machine hardware */
245240   MCFG_CPU_ADD("maincpu", ATMEGA88, MASTER_CLOCK)
246   MCFG_CPU_AVR8_CONFIG(atmega88_config)
247241   MCFG_CPU_PROGRAM_MAP(craft_prg_map)
248242   MCFG_CPU_DATA_MAP(craft_data_map)
249243   MCFG_CPU_IO_MAP(craft_io_map)
244   MCFG_CPU_AVR8_EEPROM("eeprom")
250245
251246   /* video hardware */
252247   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/replicator.c
r32255r32256
604604   m_port_l = 0;
605605}
606606
607const avr8_config atmega1280_config =
608{
609   "eeprom"
610};
611
612607PALETTE_INIT_MEMBER(replicator_state, replicator)
613608{
614609//These colors were picked with the color picker in Inkscape, based on a photo of the LCD used in the Replicator 1 3d printer:
r32255r32256
634629static MACHINE_CONFIG_START( replicator, replicator_state )
635630
636631   MCFG_CPU_ADD("maincpu", ATMEGA1280, MASTER_CLOCK)
637   MCFG_CPU_AVR8_CONFIG(atmega1280_config)
638632   MCFG_CPU_PROGRAM_MAP(replicator_prg_map)
639633   MCFG_CPU_DATA_MAP(replicator_data_map)
640634   MCFG_CPU_IO_MAP(replicator_io_map)
641635
636   MCFG_CPU_AVR8_EEPROM("eeprom")
642637   MCFG_CPU_AVR8_LFUSE(0xFF)
643638   MCFG_CPU_AVR8_HFUSE(0xDA)
644639   MCFG_CPU_AVR8_EFUSE(0xF4)
trunk/src/mess/drivers/sbc6510.c
r32255r32256
260260   m_key_row = data;
261261}
262262
263const avr8_config atmega88_config =
264{
265   "eeprom"
266};
267
268263static const gfx_layout charset_8x16 =
269264{
270265   8, 9,
r32255r32256
289284
290285   MCFG_CPU_ADD("videocpu",ATMEGA88, XTAL_16MHz)
291286//  MCFG_DEVICE_DISABLE() // trips SLEEP opcode, needs to be emulated
292   MCFG_CPU_AVR8_CONFIG(atmega88_config)
293287   MCFG_CPU_PROGRAM_MAP(sbc6510_video_mem)
294288   MCFG_CPU_DATA_MAP(sbc6510_video_data)
295289   MCFG_CPU_IO_MAP(sbc6510_video_io)
290   MCFG_CPU_AVR8_EEPROM("eeprom")
296291
297292   MCFG_GFXDECODE_ADD("gfxdecode", TERMINAL_TAG":palette", sbc6510)
298293

Previous 199869 Revisions Next


© 1997-2024 The MAME Team