@@ -301,17 +301,19 @@ class namcos21_state : public driver_device
301301 m_maincpu (*this , " maincpu" ),
302302 m_audiocpu (*this , " audiocpu" ),
303303 m_slave (*this , " slave" ),
304+ m_gpu (*this , " gpu" ),
304305 m_c65 (*this , " c65mcu" ),
305306 m_sci (*this , " sci" ),
306307 m_master_intc (*this , " master_intc" ),
307308 m_slave_intc (*this , " slave_intc" ),
309+ m_gpu_intc (*this , " gpu_intc" ),
310+ m_nvram (*this , " nvram" , 0x2000 , ENDIANNESS_BIG ),
308311 m_c140 (*this , " c140" ),
309312 m_palette (*this , " palette" ),
310313 m_screen (*this , " screen" ),
311314 m_audiobank (*this , " audiobank" ),
312315 m_c140_region (*this , " c140" ),
313316 m_dpram (*this , " dpram" ),
314- m_gpu_intc (*this , " gpu_intc" ),
315317 m_namcos21_3d (*this , " namcos21_3d" ),
316318 m_namcos21_dsp (*this , " namcos21dsp" )
317319 { }
@@ -327,17 +329,19 @@ class namcos21_state : public driver_device
327329 required_device<cpu_device> m_maincpu;
328330 required_device<cpu_device> m_audiocpu;
329331 required_device<cpu_device> m_slave;
332+ required_device<cpu_device> m_gpu;
330333 required_device<namcoc65_device> m_c65;
331334 required_device<namco_c139_device> m_sci;
332335 required_device<namco_c148_device> m_master_intc;
333336 required_device<namco_c148_device> m_slave_intc;
337+ required_device<namco_c148_device> m_gpu_intc;
338+ memory_share_creator<uint8_t > m_nvram;
334339 required_device<c140_device> m_c140;
335340 required_device<palette_device> m_palette;
336341 required_device<screen_device> m_screen;
337342 required_memory_bank m_audiobank;
338343 required_region_ptr<u16 > m_c140_region;
339344 required_shared_ptr<uint8_t > m_dpram;
340- required_device<namco_c148_device> m_gpu_intc;
341345 required_device<namcos21_3d_device> m_namcos21_3d;
342346 required_device<namcos21_dsp_device> m_namcos21_dsp;
343347
@@ -359,17 +363,15 @@ class namcos21_state : public driver_device
359363 void gpu_videoram_w (offs_t offset, uint16_t data, uint16_t mem_mask = ~0 );
360364 uint16_t gpu_videoram_r (offs_t offset);
361365
362- void eeprom_w (offs_t offset, uint8_t data);
363- uint8_t eeprom_r (offs_t offset);
366+ void nvram_w (offs_t offset, uint8_t data) { m_nvram[offset] = data; }
367+ uint8_t nvram_r (offs_t offset) { return m_nvram[offset]; }
364368
365369 void sound_bankselect_w (uint8_t data);
366370
367371 void sound_reset_w (uint8_t data);
368372 void system_reset_w (uint8_t data);
369373 void reset_all_subcpus (int state);
370374
371- std::unique_ptr<uint8_t []> m_eeprom;
372-
373375 TIMER_DEVICE_CALLBACK_MEMBER (screen_scanline);
374376
375377 uint32_t screen_update (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -537,7 +539,7 @@ void namcos21_state::master_map(address_map &map)
537539{
538540 map (0x000000 , 0x03ffff ).rom ();
539541 map (0x100000 , 0x10ffff ).ram (); // work RAM
540- map (0x180000 , 0x183fff ).rw (FUNC (namcos21_state::eeprom_r ), FUNC (namcos21_state::eeprom_w )).umask16 (0x00ff );
542+ map (0x180000 , 0x183fff ).rw (FUNC (namcos21_state::nvram_r ), FUNC (namcos21_state::nvram_w )).umask16 (0x00ff );
541543 map (0x1c0000 , 0x1fffff ).m (m_master_intc, FUNC (namco_c148_device::map));
542544
543545 // DSP Related
@@ -735,16 +737,6 @@ void namcos21_state::reset_all_subcpus(int state)
735737 m_c65->ext_reset (state);
736738}
737739
738- void namcos21_state::eeprom_w (offs_t offset, uint8_t data)
739- {
740- m_eeprom[offset] = data;
741- }
742-
743- uint8_t namcos21_state::eeprom_r (offs_t offset)
744- {
745- return m_eeprom[offset];
746- }
747-
748740void namcos21_state::machine_reset ()
749741{
750742 // Initialise the bank select in the sound CPU
@@ -760,9 +752,6 @@ void namcos21_state::machine_reset()
760752
761753void namcos21_state::machine_start ()
762754{
763- m_eeprom = std::make_unique<uint8_t []>(0x2000 );
764- subdevice<nvram_device>(" nvram" )->set_base (m_eeprom.get (), 0x2000 );
765-
766755 uint32_t max = memregion (" audiocpu" )->bytes () / 0x4000 ;
767756 for (int i = 0 ; i < 0x10 ; i++)
768757 m_audiobank->configure_entry (i, memregion (" audiocpu" )->base () + (i % max) * 0x4000 );
@@ -824,8 +813,8 @@ void namcos21_state::winrun(machine_config &config)
824813 NAMCOS21_DSP (config, m_namcos21_dsp, 0 );
825814 m_namcos21_dsp->set_renderer_tag (" namcos21_3d" );
826815
827- m68000_device & gpu ( M68000 (config, " gpu " , 49 .152_MHz_XTAL / 4 ) ); // graphics coprocessor
828- gpu. set_addrmap (AS_PROGRAM , &namcos21_state::gpu_map);
816+ M68000 (config, m_gpu , 49 .152_MHz_XTAL / 4 ); // graphics coprocessor
817+ m_gpu-> set_addrmap (AS_PROGRAM , &namcos21_state::gpu_map);
829818
830819 NAMCO_C148 (config, m_master_intc, 0 , m_maincpu, true );
831820 m_master_intc->link_c148_device (m_slave_intc);
@@ -835,7 +824,7 @@ void namcos21_state::winrun(machine_config &config)
835824 NAMCO_C148 (config, m_slave_intc, 0 , m_slave, false );
836825 m_slave_intc->link_c148_device (m_master_intc);
837826
838- NAMCO_C148 (config, m_gpu_intc, 0 , " gpu " , false );
827+ NAMCO_C148 (config, m_gpu_intc, 0 , m_gpu , false );
839828 NAMCO_C139 (config, m_sci, 0 );
840829
841830 config.set_maximum_quantum (attotime::from_hz (6000 )); // 100 CPU slices per frame
0 commit comments