Previous 199869 Revisions Next

r22026 Friday 22nd March, 2013 at 13:04:02 UTC by Fabio Priuli
(MESS) speeding up slot implementation of the DSP add-on chips too. nw.
[src/mess/machine]sns_slot.c sns_slot.h sns_upd.c sns_upd.h

trunk/src/mess/machine/sns_slot.c
r22025r22026
671671      if (software_entry() == NULL)
672672         setup_addon_from_fullpath();
673673
674      // in carts with an add-on CPU having internal dump, this speeds up access to the internal rom
675      // by installing read_bank in address space and mapping m_bios there
676      m_cart->speedup_addon_bios_access();
677
678
674679      setup_nvram();
675680
676681      if (m_cart->get_nvram_size() || m_cart->get_rtc_ram_size())
trunk/src/mess/machine/sns_slot.h
r22025r22026
115115   virtual DECLARE_WRITE8_MEMBER(write_ram) { UINT32 mask = m_nvram_size - 1; m_nvram[offset & mask] = data; return; } // NVRAM access
116116   virtual DECLARE_READ8_MEMBER(chip_read) { return 0xff; }
117117   virtual DECLARE_WRITE8_MEMBER(chip_write) {}
118   virtual void speedup_addon_bios_access() {};
118119
119120   void rom_alloc(running_machine &machine, UINT32 size);
120121   void nvram_alloc(running_machine &machine, UINT32 size);
trunk/src/mess/machine/sns_upd.c
r22025r22026
7676
7777void sns_rom20_necdsp_device::device_start()
7878{
79   m_dsp_prg = auto_alloc_array(machine(), UINT32, 0x2000/4);
80   m_dsp_data = auto_alloc_array(machine(), UINT16, 0x800/2);
7981}
8082
8183void sns_rom21_necdsp_device::device_start()
8284{
85   m_dsp_prg = auto_alloc_array(machine(), UINT32, 0x2000/4);
86   m_dsp_data = auto_alloc_array(machine(), UINT16, 0x800/2);
8387}
8488
8589void sns_rom_setadsp_device::device_start()
8690{
91   m_dsp_prg = auto_alloc_array(machine(), UINT32, 0x10000/4);
92   m_dsp_data = auto_alloc_array(machine(), UINT16, 0x1000/2);
8793}
8894
89
9095/*-------------------------------------------------
9196 mapper specific handlers
9297 -------------------------------------------------*/
r22025r22026
348353}
349354
350355
356// To make faster DSP access to its internal rom, let's install read banks and map m_bios there with correct byte order
351357
358void sns_rom20_necdsp_device::speedup_addon_bios_access()
359{
360   m_upd7725->space(AS_PROGRAM).install_read_bank(0x0000, 0x07ff, "dsp_prg");
361   m_upd7725->space(AS_DATA).install_read_bank(0x0000, 0x03ff, "dsp_data");
362   membank("dsp_prg")->set_base(m_dsp_prg);
363   membank("dsp_data")->set_base(m_dsp_data);
364   // copy data in the correct format
365   for (int x = 0; x < 0x800; x++)
366      m_dsp_prg[x] = (m_bios[x * 4] << 24) | (m_bios[x * 4 + 1] << 16) | (m_bios[x * 4 + 2] << 8) | 0x00;
367   for (int x = 0; x < 0x400; x++)
368      m_dsp_data[x] = (m_bios[0x2000 + x * 2] << 8) | m_bios[0x2000 + x * 2 + 1];
369}
352370
371void sns_rom21_necdsp_device::speedup_addon_bios_access()
372{
373   m_upd7725->space(AS_PROGRAM).install_read_bank(0x0000, 0x07ff, "dsp_prg");
374   m_upd7725->space(AS_DATA).install_read_bank(0x0000, 0x03ff, "dsp_data");
375   membank("dsp_prg")->set_base(m_dsp_prg);
376   membank("dsp_data")->set_base(m_dsp_data);
377   // copy data in the correct format
378   for (int x = 0; x < 0x800; x++)
379      m_dsp_prg[x] = (m_bios[x * 4] << 24) | (m_bios[x * 4 + 1] << 16) | (m_bios[x * 4 + 2] << 8) | 0x00;
380   for (int x = 0; x < 0x400; x++)
381      m_dsp_data[x] = (m_bios[0x2000 + x * 2] << 8) | m_bios[0x2000 + x * 2 + 1];
382}
383
384void sns_rom_setadsp_device::speedup_addon_bios_access()
385{
386   m_upd96050->space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "dsp_prg");
387   m_upd96050->space(AS_DATA).install_read_bank(0x0000, 0x07ff, "dsp_data");
388   membank("dsp_prg")->set_base(m_dsp_prg);
389   membank("dsp_data")->set_base(m_dsp_data);
390   // copy data in the correct format
391   for (int x = 0; x < 0x3fff; x++)
392      m_dsp_prg[x] = (m_bios[x * 4] << 24) | (m_bios[x * 4 + 1] << 16) | (m_bios[x * 4 + 2] << 8) | 0x00;
393   for (int x = 0; x < 0x07ff; x++)
394      m_dsp_data[x] = (m_bios[0x10000 + x * 2] << 8) | m_bios[0x10000 + x * 2 + 1];
395}
396
397
398
399
353400// Legacy versions including DSP dump roms, in order to support faulty dumps missing DSP data...
354401
355402const device_type SNS_LOROM_NECDSP1_LEG = &device_creator<sns_rom20_necdsp1_legacy_device>;
trunk/src/mess/machine/sns_upd.h
r22025r22026
1919   virtual void device_start();
2020   virtual void device_config_complete() { m_shortname = "sns_rom_necdsp"; }
2121   virtual machine_config_constructor device_mconfig_additions() const;
22   virtual void speedup_addon_bios_access();
2223
2324   required_device<upd7725_device> m_upd7725;
2425
r22025r22026
2829
2930   virtual DECLARE_READ32_MEMBER(necdsp_prg_r);
3031   virtual DECLARE_READ16_MEMBER(necdsp_data_r);
32   
33   UINT32 *m_dsp_prg;
34   UINT16 *m_dsp_data;
3135};
3236
3337// ======================> sns_rom21_necdsp_device
r22025r22026
4347   virtual void device_start();
4448   virtual void device_config_complete() { m_shortname = "sns_rom21_necdsp"; }
4549   virtual machine_config_constructor device_mconfig_additions() const;
50   virtual void speedup_addon_bios_access();
4651
4752   required_device<upd7725_device> m_upd7725;
4853
r22025r22026
5257
5358   virtual DECLARE_READ32_MEMBER(necdsp_prg_r);
5459   virtual DECLARE_READ16_MEMBER(necdsp_data_r);
60
61   UINT32 *m_dsp_prg;
62   UINT16 *m_dsp_data;
5563};
5664
5765// ======================> sns_rom_setadsp_device
r22025r22026
6573   // device-level overrides
6674   virtual void device_start();
6775   virtual void device_config_complete() { m_shortname = "sns_rom_setadsp"; }
76   virtual void speedup_addon_bios_access();
6877
6978   required_device<upd96050_device> m_upd96050;
7079
r22025r22026
7483
7584   virtual DECLARE_READ32_MEMBER(setadsp_prg_r);
7685   virtual DECLARE_READ16_MEMBER(setadsp_data_r);
86   
87   UINT32 *m_dsp_prg;
88   UINT16 *m_dsp_data;
7789};
7890
7991// ======================> sns_rom_seta10dsp_device

Previous 199869 Revisions Next


© 1997-2024 The MAME Team