trunk/src/mess/machine/sns_upd.c
r22025 | r22026 | |
76 | 76 | |
77 | 77 | void sns_rom20_necdsp_device::device_start() |
78 | 78 | { |
| 79 | m_dsp_prg = auto_alloc_array(machine(), UINT32, 0x2000/4); |
| 80 | m_dsp_data = auto_alloc_array(machine(), UINT16, 0x800/2); |
79 | 81 | } |
80 | 82 | |
81 | 83 | void sns_rom21_necdsp_device::device_start() |
82 | 84 | { |
| 85 | m_dsp_prg = auto_alloc_array(machine(), UINT32, 0x2000/4); |
| 86 | m_dsp_data = auto_alloc_array(machine(), UINT16, 0x800/2); |
83 | 87 | } |
84 | 88 | |
85 | 89 | void sns_rom_setadsp_device::device_start() |
86 | 90 | { |
| 91 | m_dsp_prg = auto_alloc_array(machine(), UINT32, 0x10000/4); |
| 92 | m_dsp_data = auto_alloc_array(machine(), UINT16, 0x1000/2); |
87 | 93 | } |
88 | 94 | |
89 | | |
90 | 95 | /*------------------------------------------------- |
91 | 96 | mapper specific handlers |
92 | 97 | -------------------------------------------------*/ |
r22025 | r22026 | |
348 | 353 | } |
349 | 354 | |
350 | 355 | |
| 356 | // To make faster DSP access to its internal rom, let's install read banks and map m_bios there with correct byte order |
351 | 357 | |
| 358 | void 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 | } |
352 | 370 | |
| 371 | void 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 | |
| 384 | void 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 | |
353 | 400 | // Legacy versions including DSP dump roms, in order to support faulty dumps missing DSP data... |
354 | 401 | |
355 | 402 | const device_type SNS_LOROM_NECDSP1_LEG = &device_creator<sns_rom20_necdsp1_legacy_device>; |
trunk/src/mess/machine/sns_upd.h
r22025 | r22026 | |
19 | 19 | virtual void device_start(); |
20 | 20 | virtual void device_config_complete() { m_shortname = "sns_rom_necdsp"; } |
21 | 21 | virtual machine_config_constructor device_mconfig_additions() const; |
| 22 | virtual void speedup_addon_bios_access(); |
22 | 23 | |
23 | 24 | required_device<upd7725_device> m_upd7725; |
24 | 25 | |
r22025 | r22026 | |
28 | 29 | |
29 | 30 | virtual DECLARE_READ32_MEMBER(necdsp_prg_r); |
30 | 31 | virtual DECLARE_READ16_MEMBER(necdsp_data_r); |
| 32 | |
| 33 | UINT32 *m_dsp_prg; |
| 34 | UINT16 *m_dsp_data; |
31 | 35 | }; |
32 | 36 | |
33 | 37 | // ======================> sns_rom21_necdsp_device |
r22025 | r22026 | |
43 | 47 | virtual void device_start(); |
44 | 48 | virtual void device_config_complete() { m_shortname = "sns_rom21_necdsp"; } |
45 | 49 | virtual machine_config_constructor device_mconfig_additions() const; |
| 50 | virtual void speedup_addon_bios_access(); |
46 | 51 | |
47 | 52 | required_device<upd7725_device> m_upd7725; |
48 | 53 | |
r22025 | r22026 | |
52 | 57 | |
53 | 58 | virtual DECLARE_READ32_MEMBER(necdsp_prg_r); |
54 | 59 | virtual DECLARE_READ16_MEMBER(necdsp_data_r); |
| 60 | |
| 61 | UINT32 *m_dsp_prg; |
| 62 | UINT16 *m_dsp_data; |
55 | 63 | }; |
56 | 64 | |
57 | 65 | // ======================> sns_rom_setadsp_device |
r22025 | r22026 | |
65 | 73 | // device-level overrides |
66 | 74 | virtual void device_start(); |
67 | 75 | virtual void device_config_complete() { m_shortname = "sns_rom_setadsp"; } |
| 76 | virtual void speedup_addon_bios_access(); |
68 | 77 | |
69 | 78 | required_device<upd96050_device> m_upd96050; |
70 | 79 | |
r22025 | r22026 | |
74 | 83 | |
75 | 84 | virtual DECLARE_READ32_MEMBER(setadsp_prg_r); |
76 | 85 | virtual DECLARE_READ16_MEMBER(setadsp_data_r); |
| 86 | |
| 87 | UINT32 *m_dsp_prg; |
| 88 | UINT16 *m_dsp_data; |
77 | 89 | }; |
78 | 90 | |
79 | 91 | // ======================> sns_rom_seta10dsp_device |