From 3b790258e94af12727caa11532cf48af7a4ad75f Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Fri, 17 Oct 2014 06:17:06 +0000 Subject: [PATCH] more devfind: [Alex Jackson] Renamed rom_ptr_finder to region_ptr_finder after discussion with Aaron. First round of memory_region_finder to region_ptr_finder conversions. rf5c400: use a region_ptr_finder to find our sound ROM instead of looking up the region by hand in device_start(). Will probably start converting other sound devices to this pattern (other than the ones that use the memory system) if there are no problems or objections. --- src/emu/devfind.h | 29 +++++++++++++++-------------- src/emu/sound/rf5c400.c | 8 ++------ src/emu/sound/rf5c400.h | 3 +-- src/emu/video/hd61830.c | 4 ++-- src/emu/video/hd61830.h | 2 +- src/emu/video/saa5050.c | 3 +-- src/emu/video/saa5050.h | 2 +- src/mame/drivers/cobra.c | 4 ++-- src/mame/drivers/gticlub.c | 18 +++++++++--------- src/mame/drivers/hornet.c | 18 +++++++++--------- src/mame/drivers/mlanding.c | 6 +++--- src/mame/drivers/mquake.c | 4 ++-- src/mame/drivers/nightgal.c | 10 ++++------ src/mame/drivers/nwk-tr.c | 12 ++++++------ src/mame/drivers/r2dx_v33.c | 16 ++++++++-------- src/mame/drivers/sigmab52.c | 5 ++--- src/mame/drivers/ssfindo.c | 30 ++++++++++++++---------------- src/mame/drivers/taitowlf.c | 24 ++++++++++++------------ src/mame/drivers/twinkle.c | 18 ++++++------------ src/mame/includes/amiga.h | 2 -- src/mame/includes/megasys1.h | 2 +- src/mame/includes/twin16.h | 2 +- 22 files changed, 102 insertions(+), 120 deletions(-) diff --git a/src/emu/devfind.h b/src/emu/devfind.h index ce6bd92b988..04dac77560a 100644 --- a/src/emu/devfind.h +++ b/src/emu/devfind.h @@ -305,25 +305,26 @@ public: }; -// ======================> rom_ptr_finder +// ======================> region_ptr_finder -// ROM region pointer finder template +// memory region pointer finder template template -class rom_ptr_finder : public object_finder_base<_PointerType> +class region_ptr_finder : public object_finder_base<_PointerType> { public: // construction/destruction - rom_ptr_finder(device_t &base, const char *tag) + region_ptr_finder(device_t &base, const char *tag) : object_finder_base<_PointerType>(base, tag), m_length(0) { } // operators to make use transparent - _PointerType operator[](int index) const { return this->m_target[index]; } - _PointerType &operator[](int index) { return this->m_target[index]; } + _PointerType operator[](int index) const { assert(index < m_length); return this->m_target[index]; } + _PointerType &operator[](int index) { assert(index < m_length); return this->m_target[index]; } // getter for explicit fetching UINT32 length() const { return m_length; } - UINT32 mask() const { return m_length - 1; } + UINT32 bytes() const { return m_length * sizeof(_PointerType); } + UINT32 mask() const { return m_length - 1; } // only valid if length is known to be a power of 2 // finder virtual bool findit(bool isvalidation = false) @@ -338,20 +339,20 @@ protected: size_t m_length; }; -// optional ROM pointer finder +// optional region pointer finder template -class optional_rom_ptr : public rom_ptr_finder<_PointerType, false> +class optional_region_ptr : public region_ptr_finder<_PointerType, false> { public: - optional_rom_ptr(device_t &base, const char *tag = FINDER_DUMMY_TAG) : rom_ptr_finder<_PointerType, false>(base, tag) { } + optional_region_ptr(device_t &base, const char *tag = FINDER_DUMMY_TAG) : region_ptr_finder<_PointerType, false>(base, tag) { } }; -// required ROM pointer finder +// required region pointer finder template -class required_rom_ptr : public rom_ptr_finder<_PointerType, true> +class required_region_ptr : public region_ptr_finder<_PointerType, true> { public: - required_rom_ptr(device_t &base, const char *tag = FINDER_DUMMY_TAG) : rom_ptr_finder<_PointerType, true>(base, tag) { } + required_region_ptr(device_t &base, const char *tag = FINDER_DUMMY_TAG) : region_ptr_finder<_PointerType, true>(base, tag) { } }; @@ -374,7 +375,7 @@ public: // getter for explicit fetching UINT32 bytes() const { return m_bytes; } - UINT32 mask() const { return m_bytes - 1; } + UINT32 mask() const { return m_bytes - 1; } // FIXME: wrong when sizeof(_PointerType) != 1 // setter for setting the object void set_target(_PointerType *target, size_t bytes) { this->m_target = target; m_bytes = bytes; } diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c index 1a94be3fa0f..c6a66b42b04 100644 --- a/src/emu/sound/rf5c400.c +++ b/src/emu/sound/rf5c400.c @@ -66,8 +66,7 @@ const device_type RF5C400 = &device_creator; rf5c400_device::rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, RF5C400, "RF5C400", tag, owner, clock, "rf5c400", __FILE__), device_sound_interface(mconfig, *this), - m_rom(NULL), - m_rom_length(0), + m_rom(*this, DEVICE_SELF), m_stream(NULL) { memset(m_env_ar_table, 0, sizeof(double)*0x9f); @@ -198,7 +197,7 @@ void rf5c400_device::sound_stream_update(sound_stream &stream, stream_sample_t * *buf1++ += sample * pan_table[rvol]; pos += channel->step; - if ( (pos>>16) > m_rom_length || (pos>>16) > end) + if ( (pos>>16) > m_rom.length() || (pos>>16) > end) { pos -= loop<<16; pos &= U64(0xFFFFFF0000); @@ -230,9 +229,6 @@ void rf5c400_device::rf5c400_init_chip() { int i; - m_rom = *region(); - m_rom_length = region()->bytes() / 2; - // init volume table { double max=255.0; diff --git a/src/emu/sound/rf5c400.h b/src/emu/sound/rf5c400.h index 23ac6ec91af..643b171c6db 100644 --- a/src/emu/sound/rf5c400.h +++ b/src/emu/sound/rf5c400.h @@ -96,8 +96,7 @@ private: UINT8 decode80(UINT8 val); private: - INT16 *m_rom; - UINT32 m_rom_length; + required_region_ptr m_rom; sound_stream *m_stream; diff --git a/src/emu/video/hd61830.c b/src/emu/video/hd61830.c index 0bfa17a8f26..17d6875a18a 100644 --- a/src/emu/video/hd61830.c +++ b/src/emu/video/hd61830.c @@ -108,7 +108,7 @@ hd61830_device::hd61830_device(const machine_config &mconfig, const char *tag, d m_blink(0), m_cursor(0), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(hd61830)), - m_region_hd61830(*this, "hd61830") + m_char_rom(*this, "hd61830") { } @@ -449,7 +449,7 @@ void hd61830_device::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, addr = 160*7 + (md - 0xe0) * 11 + cl; } - data = m_region_hd61830->u8(addr); + data = m_char_rom[addr]; } int cursor = m_mcr & MODE_CURSOR; diff --git a/src/emu/video/hd61830.h b/src/emu/video/hd61830.h index 6a152fd3110..8cf14df1779 100644 --- a/src/emu/video/hd61830.h +++ b/src/emu/video/hd61830.h @@ -115,7 +115,7 @@ private: // address space configurations const address_space_config m_space_config; - required_memory_region m_region_hd61830; + required_region_ptr m_char_rom; }; diff --git a/src/emu/video/saa5050.c b/src/emu/video/saa5050.c index 421c637fa0a..9445e15282f 100644 --- a/src/emu/video/saa5050.c +++ b/src/emu/video/saa5050.c @@ -371,8 +371,7 @@ void saa5050_device::get_character_data(UINT8 data) if (m_double_height) ra >>= 1; if (m_double_height && m_double_height_bottom_row) ra += 5; - offs_t char_rom_addr = (data * 10) + ra; - m_char_data = m_char_rom->base()[char_rom_addr]; + m_char_data = m_char_rom[(data * 10) + ra]; } diff --git a/src/emu/video/saa5050.h b/src/emu/video/saa5050.h index bf0d460ed2f..2d322e7358f 100644 --- a/src/emu/video/saa5050.h +++ b/src/emu/video/saa5050.h @@ -125,7 +125,7 @@ private: void process_control_character(UINT8 data); void get_character_data(UINT8 data); - required_memory_region m_char_rom; + required_region_ptr m_char_rom; devcb_read8 m_read_d; diff --git a/src/mame/drivers/cobra.c b/src/mame/drivers/cobra.c index fa84e4a5686..406264ee872 100644 --- a/src/mame/drivers/cobra.c +++ b/src/mame/drivers/cobra.c @@ -3473,7 +3473,7 @@ ROM_START(bujutsu) ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) ROM_LOAD( "m48t58-70pc1.17l", 0x000000, 0x002000, NO_DUMP ) - ROM_REGION(0x1000000, "rfsnd", ROMREGION_ERASE00) + ROM_REGION16_LE(0x1000000, "rfsnd", ROMREGION_ERASE00) DISK_REGION( "ata:0:hdd:image" ) DISK_IMAGE_READONLY( "645c04", 0, SHA1(c0aabe69f6eb4e4cf748d606ae50674297af6a04) ) @@ -3492,7 +3492,7 @@ ROM_START(racjamdx) ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) ROM_LOAD( "m48t58-70pc1.17l", 0x000000, 0x002000, NO_DUMP ) - ROM_REGION(0x1000000, "rfsnd", ROMREGION_ERASE00) + ROM_REGION16_LE(0x1000000, "rfsnd", ROMREGION_ERASE00) DISK_REGION( "ata:0:hdd:image" ) DISK_IMAGE_READONLY( "676a04", 0, SHA1(8e89d3e5099e871b99fccba13adaa3cf8a6b71f0) ) diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c index ed4609fa99a..b7a801cec19 100644 --- a/src/mame/drivers/gticlub.c +++ b/src/mame/drivers/gticlub.c @@ -1155,7 +1155,7 @@ ROM_START( gticlub ) /* Euro version EAA - Reports: GTI CLUB(TM) System ver 1.00 ROM_REGION(0x80000, "audiocpu", 0) /* 68k program */ ROM_LOAD16_WORD_SWAP( "688a07.13k", 0x000000, 0x040000, CRC(f0805f06) SHA1(4b87e02b89e7ea812454498603767668e4619025) ) - ROM_REGION(0x800000, "rfsnd", 0) /* sound roms */ + ROM_REGION16_LE(0x800000, "rfsnd", 0) /* sound roms */ ROM_LOAD( "688a09.9s", 0x000000, 0x200000, CRC(fb582963) SHA1(ce8fe6a4d7ac7d7f4b6591f9150b1d351e636354) ) ROM_LOAD( "688a10.7s", 0x200000, 0x200000, CRC(b3ddc5f1) SHA1(a3f76c86e85eb17f20efb037c1ad64e9cb8566c8) ) ROM_LOAD( "688a11.5s", 0x400000, 0x200000, CRC(fc706183) SHA1(c8ce6de0588be1023ef48577bc88a4e5effdcd25) ) @@ -1185,7 +1185,7 @@ ROM_START( gticlubu ) /* USA version UAA - Reports: GTI CLUB(TM) System ver 1.02 ROM_REGION(0x80000, "audiocpu", 0) /* 68k program */ ROM_LOAD16_WORD_SWAP( "688a07.13k", 0x000000, 0x040000, CRC(f0805f06) SHA1(4b87e02b89e7ea812454498603767668e4619025) ) - ROM_REGION(0x800000, "rfsnd", 0) /* sound roms */ + ROM_REGION16_LE(0x800000, "rfsnd", 0) /* sound roms */ ROM_LOAD( "688a09.9s", 0x000000, 0x200000, CRC(fb582963) SHA1(ce8fe6a4d7ac7d7f4b6591f9150b1d351e636354) ) ROM_LOAD( "688a10.7s", 0x200000, 0x200000, CRC(b3ddc5f1) SHA1(a3f76c86e85eb17f20efb037c1ad64e9cb8566c8) ) ROM_LOAD( "688a11.5s", 0x400000, 0x200000, CRC(fc706183) SHA1(c8ce6de0588be1023ef48577bc88a4e5effdcd25) ) @@ -1215,7 +1215,7 @@ ROM_START( gticluba ) /* Asia version AAA - Reports: GTI CLUB(TM) System ver 1.0 ROM_REGION(0x80000, "audiocpu", 0) /* 68k program */ ROM_LOAD16_WORD_SWAP( "688a07.13k", 0x000000, 0x040000, CRC(f0805f06) SHA1(4b87e02b89e7ea812454498603767668e4619025) ) - ROM_REGION(0x800000, "rfsnd", 0) /* sound roms */ + ROM_REGION16_LE(0x800000, "rfsnd", 0) /* sound roms */ ROM_LOAD( "688a09.9s", 0x000000, 0x200000, CRC(fb582963) SHA1(ce8fe6a4d7ac7d7f4b6591f9150b1d351e636354) ) ROM_LOAD( "688a10.7s", 0x200000, 0x200000, CRC(b3ddc5f1) SHA1(a3f76c86e85eb17f20efb037c1ad64e9cb8566c8) ) ROM_LOAD( "688a11.5s", 0x400000, 0x200000, CRC(fc706183) SHA1(c8ce6de0588be1023ef48577bc88a4e5effdcd25) ) @@ -1245,7 +1245,7 @@ ROM_START( gticlubj ) /* Japan version JAA - Reports: GTI CLUB(TM) System ver 1. ROM_REGION(0x80000, "audiocpu", 0) /* 68k program */ ROM_LOAD16_WORD_SWAP( "688a07.13k", 0x000000, 0x040000, CRC(f0805f06) SHA1(4b87e02b89e7ea812454498603767668e4619025) ) - ROM_REGION(0x800000, "rfsnd", 0) /* sound roms */ + ROM_REGION16_LE(0x800000, "rfsnd", 0) /* sound roms */ ROM_LOAD( "688a09.9s", 0x000000, 0x200000, CRC(fb582963) SHA1(ce8fe6a4d7ac7d7f4b6591f9150b1d351e636354) ) ROM_LOAD( "688a10.7s", 0x200000, 0x200000, CRC(b3ddc5f1) SHA1(a3f76c86e85eb17f20efb037c1ad64e9cb8566c8) ) ROM_LOAD( "688a11.5s", 0x400000, 0x200000, CRC(fc706183) SHA1(c8ce6de0588be1023ef48577bc88a4e5effdcd25) ) @@ -1278,7 +1278,7 @@ ROM_START( thunderh ) /* Euro version EAA */ ROM_REGION(0x20000, "dsp", 0) /* 68k program for outboard sound? network? board */ ROM_LOAD16_WORD_SWAP( "680c22.20k", 0x000000, 0x020000, CRC(d93c0ee2) SHA1(4b58418cbb01b51e12d6e7c86b2c81cd35d86248) ) - ROM_REGION(0x800000, "rfsnd", 0) /* sound roms */ + ROM_REGION16_LE(0x800000, "rfsnd", 0) /* sound roms */ ROM_LOAD( "680a09.9s", 0x000000, 0x200000, CRC(71c2b049) SHA1(ce360172c8774b31edf16a80104c35b1caf26cd9) ) ROM_LOAD( "680a10.7s", 0x200000, 0x200000, CRC(19882bf3) SHA1(7287da58853c84cbadbfb42bed37f2b0032c4b4d) ) ROM_LOAD( "680a11.5s", 0x400000, 0x200000, CRC(0c74fe3f) SHA1(2e69f8d37552a74bbda65b134f747b4380ed33b0) ) @@ -1308,7 +1308,7 @@ ROM_START( thunderhu ) /* USA version UAA */ ROM_REGION(0x20000, "dsp", 0) /* 68k program for outboard sound? network? board */ ROM_LOAD16_WORD_SWAP( "680c22.20k", 0x000000, 0x020000, CRC(d93c0ee2) SHA1(4b58418cbb01b51e12d6e7c86b2c81cd35d86248) ) - ROM_REGION(0x800000, "rfsnd", 0) /* sound roms */ + ROM_REGION16_LE(0x800000, "rfsnd", 0) /* sound roms */ ROM_LOAD( "680a09.9s", 0x000000, 0x200000, CRC(71c2b049) SHA1(ce360172c8774b31edf16a80104c35b1caf26cd9) ) ROM_LOAD( "680a10.7s", 0x200000, 0x200000, CRC(19882bf3) SHA1(7287da58853c84cbadbfb42bed37f2b0032c4b4d) ) ROM_LOAD( "680a11.5s", 0x400000, 0x200000, CRC(0c74fe3f) SHA1(2e69f8d37552a74bbda65b134f747b4380ed33b0) ) @@ -1335,7 +1335,7 @@ ROM_START( slrasslt ) /* USA version UAA */ ROM_REGION(0x80000, "audiocpu", 0) /* 68k program */ ROM_LOAD16_WORD_SWAP( "792a07.10k", 0x000000, 0x080000, CRC(89a65ad1) SHA1(d814ef0b560c8e68da57ad5c6096e4fc05e9913e) ) - ROM_REGION(0x800000, "rfsnd", 0) /* sound roms */ + ROM_REGION16_LE(0x800000, "rfsnd", 0) /* sound roms */ ROM_LOAD( "792a09.9s", 0x000000, 0x200000, CRC(7d7ea427) SHA1(a9a311a7c17223cc87140fe2890e20a321464831) ) ROM_LOAD( "792a10.7s", 0x200000, 0x200000, CRC(e585e5d9) SHA1(ec44ad324a66eeea4c45933dda5a8a9a4398879d) ) ROM_LOAD( "792a11.5s", 0x400000, 0x200000, CRC(c9c3a04c) SHA1(f834659f67712c9fcd93b7407669d7f35517b790) ) @@ -1365,7 +1365,7 @@ ROM_START( hangplt ) /* Japan version JAB */ ROM_REGION(0x80000, "audiocpu", 0) /* 68k program */ ROM_LOAD16_WORD_SWAP( "685a07.13k", 0x000000, 0x080000, CRC(5b72fd80) SHA1(a150837fa0d66dc0c3832495a4c8ce4f9b92cd98) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* sound roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* sound roms */ ROM_LOAD( "685a09.9s", 0x000000, 0x400000, CRC(b8ae40aa) SHA1(eee27a8929e0e805f1045fd9638e661b36a1e3c7) ) ROM_LOAD( "685a10.7s", 0x400000, 0x400000, CRC(fef3dc36) SHA1(566c7469fc452b5965a31fa42291082ec8e48a24) ) @@ -1391,7 +1391,7 @@ ROM_START( hangpltu ) /* USA version UAA */ ROM_REGION(0x80000, "audiocpu", 0) /* 68k program */ ROM_LOAD16_WORD_SWAP( "685a07.13k", 0x000000, 0x080000, CRC(5b72fd80) SHA1(a150837fa0d66dc0c3832495a4c8ce4f9b92cd98) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* sound roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* sound roms */ ROM_LOAD( "685a09.9s", 0x000000, 0x400000, CRC(b8ae40aa) SHA1(eee27a8929e0e805f1045fd9638e661b36a1e3c7) ) ROM_LOAD( "685a10.7s", 0x400000, 0x400000, CRC(fef3dc36) SHA1(566c7469fc452b5965a31fa42291082ec8e48a24) ) diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c index aaaa934a381..0570010a1dc 100644 --- a/src/mame/drivers/hornet.c +++ b/src/mame/drivers/hornet.c @@ -1311,7 +1311,7 @@ ROM_START(sscope) ROM_LOAD32_WORD( "830a14.u32", 0x000000, 0x400000, CRC(335793e1) SHA1(d582b53c3853abd59bc728f619a30c27cfc9497c) ) ROM_LOAD32_WORD( "830a13.u24", 0x000002, 0x400000, CRC(d6e7877e) SHA1(b4d0e17ada7dd126ec564a20e7140775b4b3fdb7) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "830a09.16p", 0x000000, 0x400000, CRC(e4b9f305) SHA1(ce2c6f63bdc9374dde48d8359102b57e48b4fdeb) ) ROM_LOAD( "830a10.14p", 0x400000, 0x400000, CRC(8b8aaf7e) SHA1(49b694dc171c149056b87c15410a6bf37ff2987f) ) @@ -1334,7 +1334,7 @@ ROM_START(sscopec) ROM_LOAD32_WORD( "830a14.u32", 0x000000, 0x400000, CRC(335793e1) SHA1(d582b53c3853abd59bc728f619a30c27cfc9497c) ) ROM_LOAD32_WORD( "830a13.u24", 0x000002, 0x400000, CRC(d6e7877e) SHA1(b4d0e17ada7dd126ec564a20e7140775b4b3fdb7) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "830a09.16p", 0x000000, 0x400000, CRC(e4b9f305) SHA1(ce2c6f63bdc9374dde48d8359102b57e48b4fdeb) ) ROM_LOAD( "830a10.14p", 0x400000, 0x400000, CRC(8b8aaf7e) SHA1(49b694dc171c149056b87c15410a6bf37ff2987f) ) @@ -1356,7 +1356,7 @@ ROM_START(sscopeb) ROM_LOAD32_WORD( "830a14.u32", 0x000000, 0x400000, CRC(335793e1) SHA1(d582b53c3853abd59bc728f619a30c27cfc9497c) ) ROM_LOAD32_WORD( "830a13.u24", 0x000002, 0x400000, CRC(d6e7877e) SHA1(b4d0e17ada7dd126ec564a20e7140775b4b3fdb7) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "830a09.16p", 0x000000, 0x400000, CRC(e4b9f305) SHA1(ce2c6f63bdc9374dde48d8359102b57e48b4fdeb) ) ROM_LOAD( "830a10.14p", 0x400000, 0x400000, CRC(8b8aaf7e) SHA1(49b694dc171c149056b87c15410a6bf37ff2987f) ) @@ -1378,7 +1378,7 @@ ROM_START(sscopea) ROM_LOAD32_WORD( "830a14.u32", 0x000000, 0x400000, CRC(335793e1) SHA1(d582b53c3853abd59bc728f619a30c27cfc9497c) ) ROM_LOAD32_WORD( "830a13.u24", 0x000002, 0x400000, CRC(d6e7877e) SHA1(b4d0e17ada7dd126ec564a20e7140775b4b3fdb7) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "830a09.16p", 0x000000, 0x400000, CRC(e4b9f305) SHA1(ce2c6f63bdc9374dde48d8359102b57e48b4fdeb) ) ROM_LOAD( "830a10.14p", 0x400000, 0x400000, CRC(8b8aaf7e) SHA1(49b694dc171c149056b87c15410a6bf37ff2987f) ) @@ -1403,7 +1403,7 @@ ROM_START(sscope2) ROM_REGION(0x80000, "audiocpu", 0) /* 68K Program */ ROM_LOAD16_WORD_SWAP("931a08.bin", 0x000000, 0x80000, CRC(1597d604) SHA1(a1eab4d25907930b59ea558b484c3b6ddcb9303c) ) - ROM_REGION(0xc00000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0xc00000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "931a09.bin", 0x000000, 0x400000, CRC(694c354c) SHA1(42f54254a5959e1b341f2801f1ad032c4ed6f329) ) ROM_LOAD( "931a10.bin", 0x400000, 0x400000, CRC(78ceb519) SHA1(e61c0d21b6dc37a9293e72814474f5aee59115ad) ) ROM_LOAD( "931a11.bin", 0x800000, 0x400000, CRC(9c8362b2) SHA1(a8158c4db386e2bbd61dc9a600720f07a1eba294) ) @@ -1436,7 +1436,7 @@ ROM_START(gradius4) ROM_REGION(0x80000, "audiocpu", 0) /* 68K Program */ ROM_LOAD16_WORD_SWAP( "837a08.7s", 0x000000, 0x080000, CRC(c3a7ff56) SHA1(9d8d033277d560b58da151338d14b4758a9235ea) ) - ROM_REGION(0x800000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x800000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "837a09.16p", 0x000000, 0x400000, CRC(fb8f3dc2) SHA1(69e314ac06308c5a24309abc3d7b05af6c0302a8) ) ROM_LOAD( "837a10.14p", 0x400000, 0x400000, CRC(1419cad2) SHA1(a6369a5c29813fa51e8246d0c091736f32994f3d) ) @@ -1462,7 +1462,7 @@ ROM_START(nbapbp) ROM_REGION(0x80000, "audiocpu", 0) /* 68K Program */ ROM_LOAD16_WORD_SWAP( "778a08.7s", 0x000000, 0x080000, CRC(6259b4bf) SHA1(d0c38870495c9a07984b4b85e736d6477dd44832) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "778a09.16p", 0x000000, 0x400000, CRC(e8c6fd93) SHA1(dd378b67b3b7dd932e4b39fbf4321e706522247f) ) ROM_LOAD( "778a10.14p", 0x400000, 0x400000, CRC(c6a0857b) SHA1(976734ba56460fcc090619fbba043a3d888c4f4e) ) ROM_LOAD( "778a11.12p", 0x800000, 0x400000, CRC(40199382) SHA1(bee268adf9b6634a4f6bb39278ecd02f2bdcb1f4) ) @@ -1488,7 +1488,7 @@ ROM_START(terabrst) ROM_REGION(0x80000, "audiocpu", 0) /* 68K Program */ ROM_LOAD16_WORD_SWAP( "715a08.7s", 0x000000, 0x080000, CRC(3aa2f4a5) SHA1(bb43e5f5ef4ac51f228d4d825be66d3c720d51ea) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "715a09.16p", 0x000000, 0x400000, CRC(65845866) SHA1(d2a63d0deef1901e6fa21b55c5f96e1f781dceda) ) ROM_LOAD( "715a10.14p", 0x400000, 0x400000, CRC(294fe71b) SHA1(ac5fff5627df1cee4f1e1867377f208b34334899) ) @@ -1515,7 +1515,7 @@ ROM_START(terabrsta) ROM_REGION(0x80000, "audiocpu", 0) /* 68K Program */ ROM_LOAD16_WORD_SWAP( "715a08.7s", 0x000000, 0x080000, CRC(3aa2f4a5) SHA1(bb43e5f5ef4ac51f228d4d825be66d3c720d51ea) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "715a09.16p", 0x000000, 0x400000, CRC(65845866) SHA1(d2a63d0deef1901e6fa21b55c5f96e1f781dceda) ) ROM_LOAD( "715a10.14p", 0x400000, 0x400000, CRC(294fe71b) SHA1(ac5fff5627df1cee4f1e1867377f208b34334899) ) diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c index a8588b88665..3cc0121e512 100644 --- a/src/mame/drivers/mlanding.c +++ b/src/mame/drivers/mlanding.c @@ -101,8 +101,8 @@ public: required_device m_ctc; required_memory_bank m_dma_bank; - required_memory_region m_msm1_rom; - required_memory_region m_msm2_rom; + required_region_ptr m_msm1_rom; + required_region_ptr m_msm2_rom; required_shared_ptr m_g_ram; required_shared_ptr m_cha_ram; @@ -576,7 +576,7 @@ void mlanding_state::msm5205_update(int chip) if (m_msm_reset[chip]) return; - const UINT8 *rom = chip ? m_msm2_rom->base() : m_msm1_rom->base(); + const UINT8 *rom = chip ? m_msm2_rom : m_msm1_rom; UINT8 data = rom[m_msm_pos[chip]]; msm5205_device *msm = chip ? m_msm2 : m_msm1; diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c index b80a82844b5..de31155e924 100644 --- a/src/mame/drivers/mquake.c +++ b/src/mame/drivers/mquake.c @@ -58,7 +58,7 @@ public: private: required_device m_es5503; - required_memory_region m_es5503_rom; + required_region_ptr m_es5503_rom; }; @@ -72,7 +72,7 @@ private: READ8_MEMBER( mquake_state::es5503_sample_r ) { - return m_es5503_rom->base()[offset + (m_es5503->get_channel_strobe() * 0x10000)]; + return m_es5503_rom[offset + (m_es5503->get_channel_strobe() * 0x10000)]; } static ADDRESS_MAP_START( mquake_es5503_map, AS_0, 8, mquake_state ) diff --git a/src/mame/drivers/nightgal.c b/src/mame/drivers/nightgal.c index 4a4b98acc68..fb0296d046a 100644 --- a/src/mame/drivers/nightgal.c +++ b/src/mame/drivers/nightgal.c @@ -37,7 +37,7 @@ public: m_comms_ram(*this, "comms_ram"), m_maincpu(*this, "maincpu"), m_subcpu(*this, "sub"), - m_region_gfx1(*this, "gfx1"), + m_gfxrom(*this, "gfx1"), m_io_cr_clear(*this, "CR_CLEAR"), m_io_coins(*this, "COINS"), m_io_pl1_1(*this, "PL1_1"), @@ -108,7 +108,7 @@ public: UINT32 screen_update_nightgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: - required_memory_region m_region_gfx1; + required_region_ptr m_gfxrom; required_ioport m_io_cr_clear; required_ioport m_io_coins; required_ioport m_io_pl1_1; @@ -169,15 +169,13 @@ UINT32 nightgal_state::screen_update_nightgal(screen_device &screen, bitmap_ind1 UINT8 nightgal_state::nightgal_gfx_nibble( int niboffset ) { - UINT8 *blit_rom = m_region_gfx1->base(); - if (niboffset & 1) { - return (blit_rom[(niboffset >> 1) & 0x1ffff] & 0xf0) >> 4; + return (m_gfxrom[(niboffset >> 1) & 0x1ffff] & 0xf0) >> 4; } else { - return (blit_rom[(niboffset >> 1) & 0x1ffff] & 0x0f); + return (m_gfxrom[(niboffset >> 1) & 0x1ffff] & 0x0f); } } diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c index 1bd66eaeda1..633e02974df 100644 --- a/src/mame/drivers/nwk-tr.c +++ b/src/mame/drivers/nwk-tr.c @@ -829,7 +829,7 @@ ROM_START(racingj) ROM_REGION(0x80000, "audiocpu", 0) /* 68k program roms */ ROM_LOAD16_WORD_SWAP( "676gna08.7s", 0x000000, 0x080000, CRC(8973f6f2) SHA1(f5648a7e0205f7e979ccacbb52936809ce14a184) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "676a09.16p", 0x000000, 0x400000, CRC(f85c8dc6) SHA1(8b302c80be309b5cc68b75945fcd7b87a56a4c9b) ) ROM_LOAD( "676a10.14p", 0x400000, 0x400000, CRC(7b5b7828) SHA1(aec224d62e4b1e8fdb929d7947ce70d84ba676cf) ) @@ -853,7 +853,7 @@ ROM_START(racingj2j) ROM_REGION(0x80000, "audiocpu", 0) /* 68k program roms */ ROM_LOAD16_WORD_SWAP( "888a08.7s", 0x000000, 0x080000, CRC(55fbea65) SHA1(ad953f758181731efccadcabc4326e6634c359e8) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "888a09.16p", 0x000000, 0x400000, CRC(11e2fed2) SHA1(24b8a367b59fedb62c56f066342f2fa87b135fc5) ) ROM_LOAD( "888a10.14p", 0x400000, 0x400000, CRC(328ce610) SHA1(dbbc779a1890c53298c0db129d496df048929496) ) @@ -877,7 +877,7 @@ ROM_START(racingj2) ROM_REGION(0x80000, "audiocpu", 0) /* 68k program roms */ ROM_LOAD16_WORD_SWAP( "888a08.7s", 0x000000, 0x080000, CRC(55fbea65) SHA1(ad953f758181731efccadcabc4326e6634c359e8) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "888a09.16p", 0x000000, 0x400000, CRC(11e2fed2) SHA1(24b8a367b59fedb62c56f066342f2fa87b135fc5) ) ROM_LOAD( "888a10.14p", 0x400000, 0x400000, CRC(328ce610) SHA1(dbbc779a1890c53298c0db129d496df048929496) ) @@ -900,7 +900,7 @@ ROM_START(thrilld) ROM_REGION(0x80000, "audiocpu", 0) /* 68k program roms */ ROM_LOAD16_WORD_SWAP( "713a08.7s", 0x000000, 0x080000, CRC(6a72a825) SHA1(abeac99c5343efacabcb0cdff6d34f9f967024db) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "713a09.16p", 0x000000, 0x400000, CRC(058f250a) SHA1(63b8e60004ec49009633e86b4992c00083def9a8) ) ROM_LOAD( "713a10.14p", 0x400000, 0x400000, CRC(27f9833e) SHA1(1540f00d2571ecb81b914c553682b67fca94bbbd) ) @@ -923,7 +923,7 @@ ROM_START(thrilldb) ROM_REGION(0x80000, "audiocpu", 0) /* 68k program roms */ ROM_LOAD16_WORD_SWAP( "713a08.7s", 0x000000, 0x080000, CRC(6a72a825) SHA1(abeac99c5343efacabcb0cdff6d34f9f967024db) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "713a09.16p", 0x000000, 0x400000, CRC(058f250a) SHA1(63b8e60004ec49009633e86b4992c00083def9a8) ) ROM_LOAD( "713a10.14p", 0x400000, 0x400000, CRC(27f9833e) SHA1(1540f00d2571ecb81b914c553682b67fca94bbbd) ) @@ -946,7 +946,7 @@ ROM_START(thrilldae) ROM_REGION(0x80000, "audiocpu", 0) /* 68k program roms */ ROM_LOAD16_WORD_SWAP( "713a08.7s", 0x000000, 0x080000, CRC(6a72a825) SHA1(abeac99c5343efacabcb0cdff6d34f9f967024db) ) - ROM_REGION(0x1000000, "rfsnd", 0) /* PCM sample roms */ + ROM_REGION16_LE(0x1000000, "rfsnd", 0) /* PCM sample roms */ ROM_LOAD( "713a09.16p", 0x000000, 0x400000, CRC(058f250a) SHA1(63b8e60004ec49009633e86b4992c00083def9a8) ) ROM_LOAD( "713a10.14p", 0x400000, 0x400000, CRC(27f9833e) SHA1(1540f00d2571ecb81b914c553682b67fca94bbbd) ) diff --git a/src/mame/drivers/r2dx_v33.c b/src/mame/drivers/r2dx_v33.c index 81488c0e083..6c878d977f5 100644 --- a/src/mame/drivers/r2dx_v33.c +++ b/src/mame/drivers/r2dx_v33.c @@ -79,7 +79,7 @@ public: { } optional_device m_eeprom; - required_memory_region m_math; + required_region_ptr m_math; DECLARE_WRITE16_MEMBER(r2dx_angle_w); DECLARE_WRITE16_MEMBER(r2dx_dx_w); @@ -309,7 +309,7 @@ WRITE16_MEMBER(r2dx_v33_state::r2dx_dy_w) READ16_MEMBER(r2dx_v33_state::r2dx_angle_r) { - return m_math->base()[((r2dx_i_dy & 0xff) << 8) | (r2dx_i_dx & 0xff)]; + return m_math[((r2dx_i_dy & 0xff) << 8) | (r2dx_i_dx & 0xff)]; } READ16_MEMBER(r2dx_v33_state::r2dx_dist_r) @@ -320,13 +320,13 @@ READ16_MEMBER(r2dx_v33_state::r2dx_dist_r) READ16_MEMBER(r2dx_v33_state::r2dx_sin_r) { int off = 65536 + (r2dx_i_angle & 0xff)*4; - return (m_math->base()[off+0]) | (m_math->base()[off+1] << 8); + return (m_math[off+0]) | (m_math[off+1] << 8); } READ16_MEMBER(r2dx_v33_state::r2dx_cos_r) { int off = 65536 + (r2dx_i_angle & 0xff)*4; - return (m_math->base()[off+2]) | (m_math->base()[off+3] << 8); + return (m_math[off+2]) | (m_math[off+3] << 8); } WRITE16_MEMBER(r2dx_v33_state::r2dx_sdistl_w) @@ -976,7 +976,7 @@ ROM_START( r2dx_v33 ) ROM_REGION( 0x100000, "oki", 0 ) /* ADPCM samples */ ROM_LOAD( "pcm.099", 0x00000, 0x100000, CRC(97ca2907) SHA1(bfe8189300cf72089d0beaeab8b1a0a1a4f0a5b6) ) - ROM_REGION( 0x40000, "math", 0 ) /* SEI333 (AKA COPX-D3) data */ + ROM_REGION( 0x20000, "math", 0 ) /* SEI333 (AKA COPX-D3) data */ ROM_LOAD( "copx_d3.357", 0x00000, 0x20000, CRC(fa2cf3ad) SHA1(13eee40704d3333874b6e3da9ee7d969c6dc662a) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) @@ -1003,7 +1003,7 @@ ROM_START( r2dx_v33_r2 ) ROM_REGION( 0x100000, "oki", 0 ) /* ADPCM samples */ ROM_LOAD( "pcm.099", 0x00000, 0x100000, CRC(97ca2907) SHA1(bfe8189300cf72089d0beaeab8b1a0a1a4f0a5b6) ) - ROM_REGION( 0x40000, "math", 0 ) /* SEI333 (AKA COPX-D3) data */ + ROM_REGION( 0x20000, "math", 0 ) /* SEI333 (AKA COPX-D3) data */ ROM_LOAD( "copx_d3.357", 0x00000, 0x20000, CRC(fa2cf3ad) SHA1(13eee40704d3333874b6e3da9ee7d969c6dc662a) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) @@ -1018,7 +1018,7 @@ ROM_START( nzeroteam ) /* V33 SYSTEM TYPE_B hardware, uses SEI333 (AKA COPX-D3) ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) /* v33 main cpu */ - ROM_REGION( 0x40000, "math", 0 ) /* SEI333 (AKA COPX-D3) data */ + ROM_REGION( 0x20000, "math", 0 ) /* SEI333 (AKA COPX-D3) data */ ROM_LOAD( "copx-d3.bin", 0x00000, 0x20000, CRC(fa2cf3ad) SHA1(13eee40704d3333874b6e3da9ee7d969c6dc662a) ) /* Not from this set, but same data as Zero Team 2000 & Raiden II New */ ROM_REGION( 0x20000, "audiocpu", 0 ) /* 64k code for sound Z80 */ @@ -1050,7 +1050,7 @@ ROM_START( zerotm2k ) /* V33 SYSTEM TYPE_C VER2 hardware, uses SEI333 (AKA COPX- ROM_REGION( 0x400000, "maincpu", ROMREGION_ERASEFF ) /* v33 main cpu */ - ROM_REGION( 0x40000, "math", 0 ) /* SEI333 (AKA COPX-D3) data */ + ROM_REGION( 0x20000, "math", 0 ) /* SEI333 (AKA COPX-D3) data */ ROM_LOAD( "mx27c1000mc.u0366", 0x00000, 0x20000, CRC(fa2cf3ad) SHA1(13eee40704d3333874b6e3da9ee7d969c6dc662a) ) /* PCB silkscreened 333ROM */ ROM_REGION( 0x20000, "audiocpu", 0 ) /* 64k code for sound Z80 */ diff --git a/src/mame/drivers/sigmab52.c b/src/mame/drivers/sigmab52.c index 782b842e3bf..a28454adf33 100644 --- a/src/mame/drivers/sigmab52.c +++ b/src/mame/drivers/sigmab52.c @@ -172,7 +172,7 @@ public: required_device m_6840ptm_2; required_device m_palette; required_memory_bank m_bank1; - required_memory_region m_prom; + required_region_ptr m_prom; required_ioport m_in0; UINT64 m_coin_start_cycles; @@ -294,11 +294,10 @@ WRITE8_MEMBER(sigmab52_state::audiocpu_irq_ack_w) WRITE8_MEMBER(sigmab52_state::palette_bank_w) { int bank = data & 0x0f; - UINT8 *prom = (UINT8*)*m_prom; for (int i = 0; ientries(); i++) { - UINT8 d = prom[(bank << 4) | i]; + UINT8 d = m_prom[(bank << 4) | i]; m_palette->set_pen_color(i, pal3bit(d >> 5), pal3bit(d >> 2), pal2bit(d >> 0)); } } diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c index 831da7493b1..e2270a929ed 100644 --- a/src/mame/drivers/ssfindo.c +++ b/src/mame/drivers/ssfindo.c @@ -219,7 +219,7 @@ public: : driver_device(mconfig, type, tag), m_vram(*this, "vram"), m_maincpu(*this, "maincpu"), - m_region_user2(*this, "user2"), + m_flashrom(*this, "flash"), m_io_ps7500(*this, "PS7500"), m_palette(*this, "palette") { } @@ -256,7 +256,7 @@ public: TIMER_CALLBACK_MEMBER(PS7500_Timer1_callback); required_device m_maincpu; - required_memory_region m_region_user2; + required_region_ptr m_flashrom; required_ioport m_io_ps7500; required_device m_palette; @@ -499,8 +499,6 @@ WRITE32_MEMBER(ssfindo_state::PS7500_IO_w) READ32_MEMBER(ssfindo_state::io_r) { - UINT16 *FLASH = (UINT16 *)m_region_user2->base(); //16 bit - WORD access - int adr=m_flashAdr*0x200+(m_flashOffset); @@ -519,7 +517,7 @@ READ32_MEMBER(ssfindo_state::io_r) if(adr<0x400000*2) { m_flashOffset++; - return FLASH[adr]; + return m_flashrom[adr]; } return 0; } @@ -566,7 +564,7 @@ READ32_MEMBER(ssfindo_state::randomized_r) } static ADDRESS_MAP_START( ssfindo_map, AS_PROGRAM, 32, ssfindo_state ) - AM_RANGE(0x00000000, 0x000fffff) AM_ROM AM_REGION("user1", 0) + AM_RANGE(0x00000000, 0x000fffff) AM_ROM AM_RANGE(0x03200000, 0x032001ff) AM_READWRITE(PS7500_IO_r,PS7500_IO_w) AM_RANGE(0x03012e60, 0x03012e67) AM_NOP AM_RANGE(0x03012fe0, 0x03012fe3) AM_WRITE(debug_w) @@ -584,7 +582,7 @@ static ADDRESS_MAP_START( ssfindo_map, AS_PROGRAM, 32, ssfindo_state ) ADDRESS_MAP_END static ADDRESS_MAP_START( ppcar_map, AS_PROGRAM, 32, ssfindo_state ) - AM_RANGE(0x00000000, 0x000fffff) AM_ROM AM_REGION("user1", 0) + AM_RANGE(0x00000000, 0x000fffff) AM_ROM AM_RANGE(0x03200000, 0x032001ff) AM_READWRITE(PS7500_IO_r,PS7500_IO_w) AM_RANGE(0x03012b00, 0x03012bff) AM_READ(randomized_r) AM_WRITENOP AM_RANGE(0x03012e60, 0x03012e67) AM_WRITENOP @@ -610,7 +608,7 @@ WRITE32_MEMBER(ssfindo_state::tetfight_unk_w) } static ADDRESS_MAP_START( tetfight_map, AS_PROGRAM, 32, ssfindo_state ) - AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_REGION("user1", 0) + AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_RANGE(0x03200000, 0x032001ff) AM_READWRITE(PS7500_IO_r,PS7500_IO_w) AM_RANGE(0x03400000, 0x03400003) AM_WRITE(FIFO_w) AM_RANGE(0x03240000, 0x03240003) AM_READ_PORT("DSW") @@ -795,18 +793,18 @@ static MACHINE_CONFIG_DERIVED( tetfight, ssfindo ) MACHINE_CONFIG_END ROM_START( ssfindo ) - ROM_REGION(0x100000, "user1", 0 ) /* ARM 32 bit code */ + ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */ ROM_LOAD16_BYTE( "a.u28", 0x000000, 0x80000, CRC(c93edbd3) SHA1(9c703cfef49b59ccd5d68bab9bd59344bd18d67e) ) ROM_LOAD16_BYTE( "b.u29", 0x000001, 0x80000, CRC(39ecb9e4) SHA1(9ebd3962d8014b97c68c364729248ed22f9298a4) ) - ROM_REGION(0x1000000, "user2", 0 ) /* flash roms */ + ROM_REGION16_LE(0x1000000, "flash", 0 ) /* flash roms */ ROM_LOAD16_BYTE( "du5", 0x000000, 0x400000, CRC(b32bd453) SHA1(6d5694bfcc67102256f857932b83b38f62ca2010) ) ROM_LOAD16_BYTE( "du6", 0x000001, 0x400000, CRC(00559591) SHA1(543aefddc02f6a521d3bd5e6e3d8e42127ff9baa) ) ROM_LOAD16_BYTE( "du3", 0x800000, 0x400000, CRC(d1e8afb2) SHA1(598dfcbba14435a1d0571dcefe0ec62fec657fca) ) ROM_LOAD16_BYTE( "du2", 0x800001, 0x400000, CRC(56998515) SHA1(9b71a44f56a545ff0c1170775c839d21bd01f545) ) - ROM_REGION(0x80, "user3", 0 ) /* eeprom */ + ROM_REGION(0x80, "eeprom", 0 ) /* eeprom */ ROM_LOAD( "24c01a.u36", 0x00, 0x80, CRC(b4f4849b) SHA1(f8f17dc94b2a305048693cfb78d14be57310ce56) ) ROM_REGION(0x10000, "user4", 0 ) /* qdsp code */ @@ -821,11 +819,11 @@ ROM_START( ssfindo ) ROM_END ROM_START( ppcar ) - ROM_REGION(0x100000, "user1", 0 ) /* ARM 32 bit code */ + ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */ ROM_LOAD16_BYTE( "fk0.u24", 0x000000, 0x80000, CRC(1940a483) SHA1(9456361fd25bf037b53bd2d04764a33b299d96dd) ) ROM_LOAD16_BYTE( "fk1.u25", 0x000001, 0x80000, CRC(75ad8679) SHA1(392288e56350e3cc49aaca82edf26f2a9e346f21) ) - ROM_REGION(0x1000000, "user2", 0 ) /* flash roms */ + ROM_REGION16_LE(0x1000000, "flash", 0 ) /* flash roms */ ROM_LOAD16_BYTE( "du5", 0x000000, 0x400000, CRC(d4b7374a) SHA1(54c93a4235f495ba3794aea511b19db821a8acb1) ) ROM_LOAD16_BYTE( "du6", 0x000001, 0x400000, CRC(e95a3a62) SHA1(2b1c889d208a749e3d7e4c75588c9c1f979e88d9) ) @@ -843,13 +841,13 @@ ROM_START( ppcar ) ROM_END ROM_START( tetfight ) - ROM_REGION(0x200000, "user1", 0 ) /* ARM 32 bit code */ + ROM_REGION(0x200000, "maincpu", 0 ) /* ARM 32 bit code */ ROM_LOAD( "u42", 0x000000, 0x200000, CRC(9101c4d2) SHA1(39da953de734e687ebbf976c821bf1017830f36c) ) - ROM_REGION(0x1000000, "user2", ROMREGION_ERASEFF ) /* flash roms */ + ROM_REGION16_LE(0x1000000, "flash", ROMREGION_ERASEFF ) /* flash roms */ /* nothing? */ - ROM_REGION(0x100, "user3", 0 ) /* eeprom */ + ROM_REGION(0x100, "eeprom", 0 ) /* eeprom */ ROM_LOAD( "u1", 0x00, 0x100, CRC(dd207b40) SHA1(6689d9dfa980bdfbd4e4e6cef7973e22ebbfe22e) ) ROM_REGION(0x10000, "user4", 0 ) /* qdsp code */ diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c index ee9b2bd9635..8c2ae02b10e 100644 --- a/src/mame/drivers/taitowlf.c +++ b/src/mame/drivers/taitowlf.c @@ -39,8 +39,7 @@ class taitowlf_state : public pcat_base_state public: taitowlf_state(const machine_config &mconfig, device_type type, const char *tag) : pcat_base_state(mconfig, type, tag), - m_region_user1(*this, "user1"), - m_region_user5(*this, "user5"), + m_bootscreen_rom(*this, "bootscreen"), m_bank1(*this, "bank1"), m_palette(*this, "palette") { } @@ -48,8 +47,7 @@ public: UINT8 m_mxtc_config_reg[256]; UINT8 m_piix4_config_reg[4][256]; - required_memory_region m_region_user1; - required_memory_region m_region_user5; + required_region_ptr m_bootscreen_rom; required_memory_bank m_bank1; required_device m_palette; DECLARE_WRITE32_MEMBER(pnp_config_w); @@ -69,7 +67,6 @@ public: UINT32 taitowlf_state::screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; - const UINT8 *blit_ram = m_region_user5->base(); bitmap.fill(m_palette->black_pen(), cliprect); @@ -81,7 +78,7 @@ UINT32 taitowlf_state::screen_update_taitowlf(screen_device &screen, bitmap_rgb3 { UINT32 color; - color = (blit_ram[count] & 0xff); + color = (m_bootscreen_rom[count] & 0xff); if(cliprect.contains(x+0, y)) bitmap.pix32(y, x+0) = m_palette->pen(color); @@ -116,11 +113,11 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i { if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff { - state->m_bank1->set_base(state->m_bios_ram); + state->m_bank1->set_entry(1); } else // disable RAM access (reads go to BIOS ROM) { - state->m_bank1->set_base(state->m_region_user1->base() + 0x30000); + state->m_bank1->set_entry(0); } break; } @@ -284,7 +281,7 @@ static ADDRESS_MAP_START( taitowlf_map, AS_PROGRAM, 32, taitowlf_state ) AM_RANGE(0x000f0000, 0x000fffff) AM_WRITE(bios_ram_w) AM_RANGE(0x00100000, 0x01ffffff) AM_RAM // AM_RANGE(0xf8000000, 0xf83fffff) AM_ROM AM_REGION("user3", 0) - AM_RANGE(0xfffc0000, 0xffffffff) AM_ROM AM_REGION("user1", 0) /* System BIOS */ + AM_RANGE(0xfffc0000, 0xffffffff) AM_ROM AM_REGION("bios", 0) /* System BIOS */ ADDRESS_MAP_END static ADDRESS_MAP_START(taitowlf_io, AS_IO, 32, taitowlf_state ) @@ -347,7 +344,8 @@ void taitowlf_state::machine_start() void taitowlf_state::machine_reset() { - m_bank1->set_base(m_region_user1->base() + 0x30000); + // disable RAM access (reads go to BIOS ROM) + m_bank1->set_entry(0); } @@ -398,13 +396,15 @@ DRIVER_INIT_MEMBER(taitowlf_state,taitowlf) { m_bios_ram = auto_alloc_array(machine(), UINT32, 0x10000/4); + m_bank1->configure_entry(1, m_bios_ram); + m_bank1->configure_entry(0, memregion("bios")->base() + 0x30000); intel82439tx_init(); } /*****************************************************************************/ ROM_START(pf2012) - ROM_REGION32_LE(0x40000, "user1", 0) + ROM_REGION32_LE(0x40000, "bios", 0) ROM_LOAD("p5tx-la.bin", 0x00000, 0x40000, CRC(072e6d51) SHA1(70414349b37e478fc28ecbaba47ad1033ae583b7)) #if ENABLE_VGA @@ -438,7 +438,7 @@ ROM_START(pf2012) ROM_LOAD("e59-14.u14", 0x100000, 0x40000, CRC(d440887c) SHA1(d965871860d757bc9111e9adb2303a633c662d6b) ) ROM_LOAD("e59-15.u16", 0x140000, 0x40000, CRC(eae8e523) SHA1(8a054d3ded7248a7906c4f0bec755ddce53e2023) ) - ROM_REGION(0x20000, "user5", 0) // bootscreen + ROM_REGION(0x20000, "bootscreen", 0) // bootscreen ROM_LOAD("e58-04.u71", 0x000000, 0x20000, CRC(500e6113) SHA1(93226706517c02e336f96bdf9443785158e7becf) ) ROM_END diff --git a/src/mame/drivers/twinkle.c b/src/mame/drivers/twinkle.c index a0f7baaad5c..b6d3baec943 100644 --- a/src/mame/drivers/twinkle.c +++ b/src/mame/drivers/twinkle.c @@ -249,7 +249,7 @@ public: : driver_device(mconfig, type, tag), m_am53cf96(*this, "am53cf96"), m_ata(*this, "ata"), - m_rfsnd(*this, "rfsnd"), + m_waveram(*this, "rfsnd"), m_spu_ata_dma(0), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu") @@ -260,7 +260,7 @@ public: required_device m_am53cf96; required_device m_ata; - required_memory_region m_rfsnd; + required_region_ptr m_waveram; UINT16 m_spu_ctrl; // SPU board control register UINT8 m_spu_shared[0x400]; // SPU/PSX shared dual-ported RAM @@ -855,8 +855,6 @@ WRITE_LINE_MEMBER(twinkle_state::spu_ata_dmarq) if (m_spu_ata_dmarq) { - UINT16 *waveram = (UINT16 *)m_rfsnd->base(); - m_ata->write_dmack(ASSERT_LINE); while (m_spu_ata_dmarq) @@ -866,7 +864,7 @@ WRITE_LINE_MEMBER(twinkle_state::spu_ata_dmarq) //waveram[m_spu_ata_dma++] = (data >> 8) | (data << 8); // bp 4a0e ;bmiidx4 checksum // bp 4d62 ;bmiidx4 dma - waveram[m_spu_ata_dma++] = data; + m_waveram[m_spu_ata_dma++] = data; } m_ata->write_dmack(CLEAR_LINE); @@ -876,16 +874,12 @@ WRITE_LINE_MEMBER(twinkle_state::spu_ata_dmarq) READ16_MEMBER(twinkle_state::twinkle_waveram_r) { - UINT16 *waveram = (UINT16 *)m_rfsnd->base(); - - return waveram[offset]; + return m_waveram[offset]; } WRITE16_MEMBER(twinkle_state::twinkle_waveram_w) { - UINT16 *waveram = (UINT16 *)m_rfsnd->base(); - - COMBINE_DATA(&waveram[offset]); + COMBINE_DATA(&m_waveram[offset]); } READ16_MEMBER(twinkle_state::shared_68k_r) @@ -1155,7 +1149,7 @@ INPUT_PORTS_END ROM_REGION32_LE( 0x080000, "audiocpu", 0 )\ ROM_LOAD16_WORD_SWAP( "863a05.2x", 0x000000, 0x080000, CRC(6f42a09e) SHA1(cab5209f90f47b9ee6e721479913ad74e3ba84b1) )\ \ - ROM_REGION(0x1800000, "rfsnd", ROMREGION_ERASE00) + ROM_REGION16_LE(0x1800000, "rfsnd", ROMREGION_ERASE00) ROM_START( gq863 ) TWINKLE_BIOS diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h index 99d3bb08905..e8fb00f92eb 100644 --- a/src/mame/includes/amiga.h +++ b/src/mame/includes/amiga.h @@ -340,7 +340,6 @@ public: m_screen(*this, "screen"), m_palette(*this, "palette"), m_overlay(*this, "overlay"), - m_kickstart(*this, "kickstart"), m_input_device(*this, "input"), m_joy0dat_port(*this, "joy_0_dat"), m_joy1dat_port(*this, "joy_1_dat"), @@ -563,7 +562,6 @@ protected: optional_device m_palette; required_device m_overlay; - optional_memory_region m_kickstart; // i/o ports optional_ioport m_input_device; diff --git a/src/mame/includes/megasys1.h b/src/mame/includes/megasys1.h index 4c2fff538e0..85d8dfc19bf 100644 --- a/src/mame/includes/megasys1.h +++ b/src/mame/includes/megasys1.h @@ -47,7 +47,7 @@ public: optional_device m_audiocpu; optional_device m_oki1; optional_device m_oki2; - required_rom_ptr m_rom_maincpu; + required_region_ptr m_rom_maincpu; required_ioport m_io_system; required_ioport m_io_p1; required_ioport m_io_p2; diff --git a/src/mame/includes/twin16.h b/src/mame/includes/twin16.h index ea8be6cb77d..c682190bb86 100644 --- a/src/mame/includes/twin16.h +++ b/src/mame/includes/twin16.h @@ -37,7 +37,7 @@ public: required_shared_ptr_array m_videoram; optional_shared_ptr m_zipram; optional_shared_ptr m_sprite_gfx_ram; - required_rom_ptr m_gfxrom; + required_region_ptr m_gfxrom; UINT16 m_CPUA_register; UINT16 m_CPUB_register;