Previous 199869 Revisions Next

r33426 Monday 17th November, 2014 at 22:03:54 UTC by Alex W. Jackson
Touching all the candy again: [Alex Jackson]

Fixed an annoying inconsistency between memory_share and memory_region:
the width() method of the former returned the width in bits (8, 16, 32 or 64)
while the width() method of the latter returned the width in bytes
(1, 2, 4 or 8). Now both classes have a bitwidth() method and a bytewidth()
method. Updated all callers to use whichever one was more appropriate.

Removed the implicit-cast-to-any-integer-pointer ability of memory_regions,
which was rather unsafe (if you weren't careful with your * operators and
casts it was easy to accidentally get a pointer to the memory_region object
itself instead of to the data, with no warning from the compiler... or at
least I kept doing it) Updated all devices and drivers that were accessing
regions that way to use a region_ptr_finder when possible, and otherwise to
call base() explicitly.
[src/emu]devfind.c digfx.c emupal.c memarray.c memory.c memory.h romload.c
[src/emu/bus/ti99_peb]tn_usbsm.c tn_usbsm.h
[src/emu/debug]debugcpu.c dvmemory.c
[src/emu/machine]at28c16.c eeprom.c er2055.c i2cmem.c nvram.c rp5h01.c timekpr.c tms6100.c tms6100.h x2212.c
[src/emu/sound]2608intf.c 2610intf.c 8950intf.c aica.c c140.c c140.h es8712.c es8712.h gaelco.c ics2115.c ics2115.h k007232.c k007232.h k053260.c k054539.c n63701x.c n63701x.h namco.c nile.c okim6376.c okim6376.h qsound.c qsound.h s14001a.c s14001a.h scsp.c segapcm.c segapcm.h sp0256.c sp0256.h tc8830f.c tms5110.c upd7759.c x1_010.c x1_010.h ymf271.c ymz280b.c ymz770.c zsg2.c zsg2.h
[src/emu/video]hd44780.c
[src/mame/drivers]cps3.c sigmab52.c
[src/mame/machine]decocass_tape.c
[src/mess/audio]alesis.c
[src/mess/drivers]alphasma.c apexc.c gamate.c gba.c geniusiq.c gp2x.c pc100.c pc88va.c sgi_ip2.c supracan.c svmu.c ti89.c ti99_4p.c tsispch.c x68k.c
[src/mess/includes]alesis.h gba.h ti89.h

trunk/src/emu/bus/ti99_peb/tn_usbsm.c
r241937r241938
4141
4242#include "tn_usbsm.h"
4343
44#define BUFFER_TAG "ram"
4544#define STRATA_TAG "strata"
4645
4746enum
r241937r241938
5453
5554nouspikel_usb_smartmedia_device::nouspikel_usb_smartmedia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
5655: ti_expansion_card_device(mconfig, TI99_USBSM, "Nouspikel USB/Smartmedia card", tag, owner, clock, "ti99_usbsm", __FILE__),
56   m_smartmedia(*this, "smartmedia"),
5757   m_flash(*this, STRATA_TAG)
5858{
5959}
r241937r241938
273273
274274void nouspikel_usb_smartmedia_device::device_start()
275275{
276   m_ram = (UINT16*)(*memregion(BUFFER_TAG));
277   /* auto_alloc_array(device->machine(), UINT16, 0x100000/2); */
278   m_smartmedia = subdevice<smartmedia_image_device>("smartmedia");
276   m_ram.resize(0x80000/2);
279277}
280278
281279void nouspikel_usb_smartmedia_device::device_reset()
r241937r241938
304302   m_cru_base = ioport("CRUUSBSM")->read();
305303}
306304
307ROM_START( tn_usbsm )
308   ROM_REGION16_BE(0x80000, BUFFER_TAG, 0)  /* RAM buffer 512 KiB */
309   ROM_FILL(0x0000, 0x80000, 0x0000)
310ROM_END
311
312305INPUT_PORTS_START( tn_usbsm )
313306   PORT_START( "CRUUSBSM" )
314307   PORT_DIPNAME( 0x1f00, 0x1600, "USB/Smartmedia CRU base" )
r241937r241938
336329
337330MACHINE_CONFIG_FRAGMENT( tn_usbsm )
338331   MCFG_DEVICE_ADD("smartmedia", SMARTMEDIA, 0)
339   MCFG_STRATAFLASH_ADD( "strata" )
332   MCFG_STRATAFLASH_ADD(STRATA_TAG)
340333MACHINE_CONFIG_END
341334
342335machine_config_constructor nouspikel_usb_smartmedia_device::device_mconfig_additions() const
r241937r241938
344337   return MACHINE_CONFIG_NAME( tn_usbsm );
345338}
346339
347const rom_entry *nouspikel_usb_smartmedia_device::device_rom_region() const
348{
349   return ROM_NAME( tn_usbsm );
350}
351
352340ioport_constructor nouspikel_usb_smartmedia_device::device_input_ports() const
353341{
354342   return INPUT_PORTS_NAME(tn_usbsm);
trunk/src/emu/bus/ti99_peb/tn_usbsm.h
r241937r241938
3434protected:
3535   virtual void device_start(void);
3636   virtual void device_reset(void);
37   virtual const rom_entry *device_rom_region() const;
3837   virtual machine_config_constructor device_mconfig_additions() const;
3938   virtual ioport_constructor device_input_ports() const;
4039
4140private:
4241
43   smartmedia_image_device*    m_smartmedia;
44
4542   int         m_feeprom_page;
4643   int         m_sram_page;
4744   int         m_cru_register;
r241937r241938
5451
5552   UINT16      m_input_latch;
5653   UINT16      m_output_latch;
57   UINT16*    m_ram;
54   dynamic_array<UINT16> m_ram;
5855
59   // Link to the FEEPROM containing the DSR (driver)
56   required_device<smartmedia_image_device> m_smartmedia;
6057   required_device<strataflash_device> m_flash;
6158};
6259
trunk/src/emu/debug/debugcpu.c
r241937r241938
12711271      else if (address < region->bytes())
12721272      {
12731273         /* lowmask specified which address bits are within the databus width */
1274         UINT32 lowmask = region->width() - 1;
1274         UINT32 lowmask = region->bytewidth() - 1;
12751275         UINT8 *base = region->base() + (address & ~lowmask);
12761276
12771277         /* if we have a valid base, return the appropriate byte */
r241937r241938
14531453      else if (address < region->bytes())
14541454      {
14551455         /* lowmask specified which address bits are within the databus width */
1456         UINT32 lowmask = region->width() - 1;
1456         UINT32 lowmask = region->bytewidth() - 1;
14571457         UINT8 *base = region->base() + (address & ~lowmask);
14581458
14591459         /* if we have a valid base, set the appropriate byte */
trunk/src/emu/debug/dvmemory.c
r241937r241938
5959   : debug_view_source(name),
6060      m_space(NULL),
6161      m_memintf(NULL),
62      m_base(region),
62      m_base(region.base()),
6363      m_length(region.bytes()),
64      m_offsetxor(NATIVE_ENDIAN_VALUE_LE_BE(region.width() - 1, 0)),
64      m_offsetxor(NATIVE_ENDIAN_VALUE_LE_BE(region.bytewidth() - 1, 0)),
6565      m_endianness(region.endianness()),
66      m_prefsize(MIN(region.width(), 8))
66      m_prefsize(MIN(region.bytewidth(), 8))
6767{
6868}
6969
trunk/src/emu/devfind.c
r241937r241938
4848      return NULL;
4949
5050   // check the width and warn if not correct
51   if (region->width() != width)
51   if (region->bytewidth() != width)
5252   {
5353      if (required)
54         osd_printf_warning("Region '%s' found but is width %d, not %d as requested\n", m_tag, region->width()*8, width*8);
54         osd_printf_warning("Region '%s' found but is width %d, not %d as requested\n", m_tag, region->bitwidth(), width*8);
5555      return NULL;
5656   }
5757
r241937r241938
7373      return NULL;
7474
7575   // check the width and warn if not correct
76   if (width != 0 && share->width() != width)
76   if (width != 0 && share->bitwidth() != width)
7777   {
7878      if (required)
79         osd_printf_warning("Shared ptr '%s' found but is width %d, not %d as requested\n", m_tag, share->width(), width);
79         osd_printf_warning("Shared ptr '%s' found but is width %d, not %d as requested\n", m_tag, share->bitwidth(), width);
8080      return NULL;
8181   }
8282
trunk/src/emu/digfx.c
r241937r241938
149149            assert(share != NULL);
150150            region_length = 8 * share->bytes();
151151            region_base = reinterpret_cast<UINT8 *>(share->ptr());
152            region_width = share->width() / 8;
152            region_width = share->bytewidth();
153153            region_endianness = share->endianness();
154154         }
155155         else
r241937r241938
158158            assert(region != NULL);
159159            region_length = 8 * region->bytes();
160160            region_base = region->base();
161            region_width = region->width();
161            region_width = region->bytewidth();
162162            region_endianness = region->endianness();
163163         }
164164      }
trunk/src/emu/emupal.c
r241937r241938
428428      if (m_membits_supplied)
429429      {
430430         // forcing width only makes sense when narrower than the native bus width
431         assert_always(m_membits < share->width(), "Improper use of MCFG_PALETTE_MEMBITS");
431         assert_always(m_membits < share->bitwidth(), "Improper use of MCFG_PALETTE_MEMBITS");
432432         m_paletteram.set_membits(m_membits);
433433         if (share_ext != NULL)
434434            m_paletteram_ext.set_membits(m_membits);
trunk/src/emu/machine/at28c16.c
r241937r241938
125125         fatalerror( "at28c16 region '%s' wrong size (expected size = 0x%X)\n", tag(), AT28C16_DATA_BYTES );
126126      }
127127
128      if( m_region->width() != 1 )
128      if( m_region->bytewidth() != 1 )
129129      {
130130         fatalerror( "at28c16 region '%s' needs to be an 8-bit region\n", tag() );
131131      }
132132
133      UINT8 *default_data = m_region->base();
134
133135      for( offs_t offs = 0; offs < AT28C16_DATA_BYTES; offs++ )
134      {
135         m_addrspace[ 0 ]->write_byte( offs, m_region->u8( offs ) );
136      }
136         m_addrspace[ 0 ]->write_byte( offs, default_data[offs] );
137137   }
138138}
139139
trunk/src/emu/machine/eeprom.c
r241937r241938
293293   {
294294      if (m_region->bytes() != eeprom_bytes)
295295         fatalerror("eeprom region '%s' wrong size (expected size = 0x%X)\n", tag(), eeprom_bytes);
296      if (m_data_bits == 8 && m_region->width() != 1)
296      if (m_data_bits == 8 && m_region->bytewidth() != 1)
297297         fatalerror("eeprom region '%s' needs to be an 8-bit region\n", tag());
298      if (m_data_bits == 16 && (m_region->width() != 2 || m_region->endianness() != ENDIANNESS_BIG))
298      if (m_data_bits == 16 && (m_region->bytewidth() != 2 || m_region->endianness() != ENDIANNESS_BIG))
299299         fatalerror("eeprom region '%s' needs to be a 16-bit big-endian region\n", tag());
300300      osd_printf_verbose("Loading data from EEPROM region '%s'\n", tag());
301301
302      for (offs_t offs = 0; offs < eeprom_length; offs++)
303         if (m_data_bits == 8)
304            m_addrspace[0]->write_byte(offs, m_region->u8(offs));
305         else
306            m_addrspace[0]->write_word(offs * 2, m_region->u16(offs));
302      if (m_data_bits == 8)
303      {
304         UINT8 *default_data = m_region->base();
305         for (offs_t offs = 0; offs < eeprom_length; offs++)
306            m_addrspace[0]->write_byte(offs, default_data[offs]);
307      }
308      else
309      {
310         UINT16 *default_data = (UINT16 *)(m_region->base());
311         for (offs_t offs = 0; offs < eeprom_length; offs++)
312            m_addrspace[0]->write_word(offs * 2, default_data[offs]);
313      }
307314   }
308315}
309316
trunk/src/emu/machine/er2055.c
r241937r241938
8585   if (m_region != NULL)
8686   {
8787      if (m_region->bytes() != SIZE_DATA)
88         fatalerror("er2055 region '%s' wrong size (expected size = 0x100)\n", tag());
89      if (m_region->width() != 1)
88         fatalerror("er2055 region '%s' wrong size (expected size = 0x40)\n", tag());
89      if (m_region->bytewidth() != 1)
9090         fatalerror("er2055 region '%s' needs to be an 8-bit region\n", tag());
9191
92      UINT8 *default_data = m_region->base();
9293      for (int byte = 0; byte < SIZE_DATA; byte++)
93         m_addrspace[0]->write_byte(byte, m_region->u8(byte));
94         m_addrspace[0]->write_byte(byte, default_data[byte]);
9495   }
9596}
9697
trunk/src/emu/machine/i2cmem.c
r241937r241938
186186         fatalerror( "i2cmem region '%s' wrong size (expected size = 0x%X)\n", tag(), i2cmem_bytes );
187187      }
188188
189      if( m_region->width() != 1 )
189      if( m_region->bytewidth() != 1 )
190190      {
191191         fatalerror( "i2cmem region '%s' needs to be an 8-bit region\n", tag() );
192192      }
193193
194      UINT8 *default_data = m_region->base();
194195      for( offs_t offs = 0; offs < i2cmem_bytes; offs++ )
195      {
196         m_addrspace[ 0 ]->write_byte( offs, m_region->u8( offs ) );
197      }
196         m_addrspace[ 0 ]->write_byte( offs, default_data[offs] );
198197   }
199198}
200199
trunk/src/emu/machine/nvram.c
r241937r241938
8383   // region always wins
8484   if (m_region != NULL)
8585   {
86      memcpy(m_base, *m_region, m_length);
86      memcpy(m_base, m_region->base(), m_length);
8787      return;
8888   }
8989
trunk/src/emu/machine/rp5h01.c
r241937r241938
5151
5252void rp5h01_device::device_start()
5353{
54   m_data = *region();
54   m_data = region()->base();
5555   if (m_data == NULL)
5656      m_data = initial_data;
5757   else
trunk/src/emu/machine/timekpr.c
r241937r241938
228228   m_century = make_bcd( systime.local_time.year / 100 );
229229   m_data.resize( m_size );
230230
231   m_default_data = *region();
231   m_default_data = region()->base();
232232   if (m_default_data)
233233   {
234234      assert( region()->bytes() == m_size );
trunk/src/emu/machine/tms6100.c
r241937r241938
7777const device_type TMS6100 = &device_creator<tms6100_device>;
7878
7979tms6100_device::tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
80   : device_t(mconfig, type, name, tag, owner, clock, shortname, source)
80   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
81   m_rom(*this, DEVICE_SELF)
8182{
8283}
8384
8485tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
85   : device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock, "tms6100", __FILE__)
86   : device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock, "tms6100", __FILE__),
87   m_rom(*this, DEVICE_SELF)
8688{
8789}
8890
r241937r241938
109111
110112void tms6100_device::device_start()
111113{
112   m_rom = *region();
113
114114   // save device variables
115115   save_item(NAME(m_addr_bits));
116116   save_item(NAME(m_address));
trunk/src/emu/machine/tms6100.h
r241937r241938
2525   virtual void device_reset();
2626private:
2727   // internal state
28   required_region_ptr<UINT8> m_rom;
2829   UINT32 m_address;
2930   UINT32 m_address_latch;
3031   UINT8  m_loadptr;
r241937r241938
3536   UINT8  m_data;
3637   UINT8  m_state;
3738
38   const UINT8 *m_rom;
39
4039};
4140
4241extern const device_type TMS6100;
trunk/src/emu/machine/x2212.c
r241937r241938
128128   {
129129      if (m_region->bytes() != SIZE_DATA)
130130         fatalerror("x2212 region '%s' wrong size (expected size = 0x100)\n", tag());
131      if (m_region->width() != 1)
131      if (m_region->bytewidth() != 1)
132132         fatalerror("x2212 region '%s' needs to be an 8-bit region\n", tag());
133133
134      UINT8 *default_data = m_region->base();
134135      for (int byte = 0; byte < SIZE_DATA; byte++)
135         m_e2prom->write_byte(byte, m_region->u8(byte));
136         m_e2prom->write_byte(byte, default_data[byte]);
136137   }
137138}
138139
trunk/src/emu/memarray.c
r241937r241938
9696
9797void memory_array::set(const memory_share &share, int bpe)
9898{
99   set(share.ptr(), share.bytes(), share.width(), share.endianness(), bpe);
99   set(share.ptr(), share.bytes(), share.bitwidth(), share.endianness(), bpe);
100100}
101101
102102void memory_array::set(const memory_array &array)
trunk/src/emu/memory.c
r241937r241938
41314131      m_next(NULL),
41324132      m_name(name),
41334133      m_buffer(length),
4134      m_width(width),
4135      m_endianness(endian)
4134      m_endianness(endian),
4135      m_bitwidth(width * 8),
4136      m_bytewidth(width)
41364137{
41374138   assert(width == 1 || width == 2 || width == 4 || width == 8);
41384139}
trunk/src/emu/memory.h
r241937r241938
646646      : m_next(NULL),
647647         m_ptr(ptr),
648648         m_bytes(bytes),
649         m_width(width),
650         m_endianness(endianness) { }
649         m_endianness(endianness),
650         m_bitwidth(width),
651         m_bytewidth(width <= 8 ? 1 : width <= 16 ? 2 : width <= 32 ? 4 : 8)
652 { }
651653
652654   // getters
653655   memory_share *next() const { return m_next; }
654656   void *ptr() const { if (this == NULL) return NULL; return m_ptr; }
655657   size_t bytes() const { return m_bytes; }
656   UINT8 width() const { return m_width; }
657658   endianness_t endianness() const { return m_endianness; }
659   UINT8 bitwidth() const { return m_bitwidth; }
660   UINT8 bytewidth() const { return m_bytewidth; }
658661
659662   // setters
660663   void set_ptr(void *ptr) { m_ptr = ptr; }
r241937r241938
664667   memory_share *          m_next;                 // next share in the list
665668   void *                  m_ptr;                  // pointer to the memory backing the region
666669   size_t                  m_bytes;                // size of the shared region in bytes
667   UINT8                   m_width;                // width of the shared region
668670   endianness_t            m_endianness;           // endianness of the memory
671   UINT8                   m_bitwidth;             // width of the shared region in bits
672   UINT8                   m_bytewidth;            // width in bytes, rounded up to a power of 2
673
669674};
670675
671676
r241937r241938
694699
695700   // flag expansion
696701   endianness_t endianness() const { return m_endianness; }
697   UINT8 width() const { return m_width; }
702   UINT8 bitwidth() const { return m_bitwidth; }
703   UINT8 bytewidth() const { return m_bytewidth; }
698704
699705   // data access
700706   UINT8 &u8(offs_t offset = 0) { return m_buffer[offset]; }
r241937r241938
702708   UINT32 &u32(offs_t offset = 0) { return reinterpret_cast<UINT32 *>(base())[offset]; }
703709   UINT64 &u64(offs_t offset = 0) { return reinterpret_cast<UINT64 *>(base())[offset]; }
704710
705   // allow passing a region for any common pointer
706   operator void *() { return (this != NULL) ? reinterpret_cast<void *>(base()) : NULL; }
707   operator INT8 *() { return (this != NULL) ? reinterpret_cast<INT8 *>(base()) : NULL; }
708   operator UINT8 *() { return (this != NULL) ? reinterpret_cast<UINT8 *>(base()) : NULL; }
709   operator INT16 *() { return (this != NULL) ? reinterpret_cast<INT16 *>(base()) : NULL; }
710   operator UINT16 *() { return (this != NULL) ? reinterpret_cast<UINT16 *>(base()) : NULL; }
711   operator INT32 *() { return (this != NULL) ? reinterpret_cast<INT32 *>(base()) : NULL; }
712   operator UINT32 *() { return (this != NULL) ? reinterpret_cast<UINT32 *>(base()) : NULL; }
713   operator INT64 *() { return (this != NULL) ? reinterpret_cast<INT64 *>(base()) : NULL; }
714   operator UINT64 *() { return (this != NULL) ? reinterpret_cast<UINT64 *>(base()) : NULL; }
715
716711private:
717712   // internal data
718713   running_machine &       m_machine;
719714   memory_region *         m_next;
720715   astring                 m_name;
721716   dynamic_buffer          m_buffer;
722   UINT8                   m_width;
723717   endianness_t            m_endianness;
718   UINT8                   m_bitwidth;
719   UINT8                   m_bytewidth;
724720};
725721
726722
trunk/src/emu/romload.c
r241937r241938
536536   if (region == NULL)
537537      return;
538538
539   LOG(("+ datawidth=%d little=%d\n", region->width(), region->endianness() == ENDIANNESS_LITTLE));
539   LOG(("+ datawidth=%dbit endian=%s\n", region->bitwidth(),
540       region->endianness() == ENDIANNESS_LITTLE ? "little" : "big"));
540541
541542   /* if the region is inverted, do that now */
542543   if (invert)
r241937r241938
547548   }
548549
549550   /* swap the endianness if we need to */
550   if (region->width() > 1 && region->endianness() != ENDIANNESS_NATIVE)
551   if (region->bytewidth() > 1 && region->endianness() != ENDIANNESS_NATIVE)
551552   {
552553      LOG(("+ Byte swapping region\n"));
553      int datawidth = region->width();
554      int datawidth = region->bytewidth();
554555      for (i = 0, base = region->base(); i < region->bytes(); i += datawidth)
555556      {
556557         UINT8 temp[8];
trunk/src/emu/sound/2608intf.c
r241937r241938
142142   /* stream system initialize */
143143   m_stream = machine().sound().stream_alloc(*this,0,2,rate, stream_update_delegate(FUNC(ym2608_device::stream_generate),this));
144144   /* setup adpcm buffers */
145   pcmbufa  = *region();
145   pcmbufa  = region()->base();
146146   pcmsizea = region()->bytes();
147147
148148   /* initialize YM2608 */
trunk/src/emu/sound/2610intf.c
r241937r241938
154154   /* stream system initialize */
155155   m_stream = machine().sound().stream_alloc(*this,0,2,rate, stream_update_delegate(FUNC(ym2610_device::stream_generate),this));
156156   /* setup adpcm buffers */
157   pcmbufa  = *region();
157   pcmbufa  = region()->base();
158158   pcmsizea = region()->bytes();
159159   name.printf("%s.deltat", tag());
160160   pcmbufb  = (void *)(machine().root_device().memregion(name)->base());
trunk/src/emu/sound/8950intf.c
r241937r241938
149149   assert_always(m_chip != NULL, "Error creating Y8950 chip");
150150
151151   /* ADPCM ROM data */
152   y8950_set_delta_t_memory(m_chip, *region(), region()->bytes());
152   y8950_set_delta_t_memory(m_chip, region()->base(), region()->bytes());
153153
154154   m_stream = machine().sound().stream_alloc(*this,0,1,rate);
155155   /* port and keyboard handler */
trunk/src/emu/sound/aica.c
r241937r241938
413413
414414   // get AICA RAM
415415   {
416      m_AICARAM = *region();
416      m_AICARAM = region()->base();
417417      if (m_AICARAM)
418418      {
419419         m_AICARAM += m_roffset;
trunk/src/emu/sound/c140.c
r241937r241938
110110
111111   m_stream = stream_alloc(0, 2, m_sample_rate);
112112
113   m_pRom=*region();
113   m_pRom = (INT8 *)region()->base();
114114
115115   /* make decompress pcm table */     //2000.06.26 CAB
116116   {
r241937r241938
195195         sz=ed-st;
196196
197197         /* Retrieve base pointer to the sample data */
198         pSampleData=(signed char*)((FPTR)m_pRom + find_sample(st, v->bank, i));
198         pSampleData = m_pRom + find_sample(st, v->bank, i);
199199
200200         /* Fetch back previous data pointers */
201201         offset=v->ptoffset;
r241937r241938
409409
410410void c140_device::set_base(void *base)
411411{
412   m_pRom = base;
412   m_pRom = (INT8 *)base;
413413}
414414
415415
trunk/src/emu/sound/c140.h
r241937r241938
108108   INT16 *m_mixer_buffer_right;
109109
110110   int m_baserate;
111   void *m_pRom;
111   INT8 *m_pRom;
112112   UINT8 m_REG[0x200];
113113
114114   INT16 m_pcmtbl[8];        //2000.06.26 CAB
trunk/src/emu/sound/es8712.c
r241937r241938
4040es8712_device::es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4141   : device_t(mconfig, ES8712, "ES8712", tag, owner, clock, "es8712", __FILE__),
4242      device_sound_interface(mconfig, *this),
43      m_rom(*this, DEVICE_SELF),
4344      m_playing(0),
4445      m_base_offset(0),
4546      m_sample(0),
r241937r241938
5051      m_end(0),
5152      m_repeat(0),
5253      m_bank_offset(0),
53      m_region_base(NULL),
5454      m_stream(NULL)
5555{
5656}
r241937r241938
6969   m_repeat = 0;
7070
7171   m_bank_offset = 0;
72   m_region_base = *region();
7372
7473   /* generate the name and create the stream */
7574   m_stream = stream_alloc(0, 1, clock());
r241937r241938
155154   /* if this chip is active */
156155   if (m_playing)
157156   {
158      UINT8 *base = m_region_base + m_bank_offset + m_base_offset;
157      UINT8 *base = &m_rom[m_bank_offset + m_base_offset];
159158      int sample = m_sample;
160159      int signal = m_signal;
161160      int count = m_count;
trunk/src/emu/sound/es8712.h
r241937r241938
5151   void es8712_state_save_register();
5252
5353private:
54   required_region_ptr<UINT8> m_rom;
55
5456   UINT8 m_playing;          /* 1 if we're actively playing */
5557
5658   UINT32 m_base_offset;     /* pointer to the base memory location */
r241937r241938
6567   UINT8  m_repeat;          /* Repeat current sample when 1 */
6668
6769   INT32 m_bank_offset;
68   UINT8 *m_region_base;     /* pointer to the base of the region */
6970   sound_stream *m_stream;   /* which stream are we playing on? */
7071};
7172
trunk/src/emu/sound/gaelco.c
r241937r241938
240240{
241241   m_stream = stream_alloc(0, 2, 8000);
242242
243   m_snd_data = (UINT8 *)machine().root_device().memregion(m_data_tag)->base();
244   if (m_snd_data == NULL)
245      m_snd_data = *region();
243   m_snd_data = owner()->memregion(m_data_tag)->base();
246244
247245   /* init volume table */
248246   for (int vol = 0; vol < GAELCO_VOLUME_LEVELS; vol++){
trunk/src/emu/sound/ics2115.c
r241937r241938
2020ics2115_device::ics2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2121   : device_t(mconfig, ICS2115, "ICS2115", tag, owner, clock, "ics2115", __FILE__),
2222      device_sound_interface(mconfig, *this),
23      m_rom(*this, DEVICE_SELF),
2324      m_irq_cb(*this)
2425{
2526}
2627
2728void ics2115_device::device_start()
2829{
29   m_rom = *region();
3030   m_timer[0].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ics2115_device::timer_cb_0),this), this);
3131   m_timer[1].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ics2115_device::timer_cb_1),this), this);
3232   m_stream = machine().sound().stream_alloc(*this, 0, 2, 33075);
trunk/src/emu/sound/ics2115.h
r241937r241938
115115   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
116116
117117   // internal state
118   required_region_ptr<UINT8> m_rom;
118119   devcb_write_line m_irq_cb;
119120
120   UINT8 *m_rom;
121121   INT16 m_ulaw[256];
122122   UINT16 m_volume[4096];
123123   static const int volume_bits = 15;
trunk/src/emu/sound/k007232.c
r241937r241938
148148k007232_device::k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
149149   : device_t(mconfig, K007232, "K007232 PCM Controller", tag, owner, clock, "k007232", __FILE__),
150150      device_sound_interface(mconfig, *this),
151      m_rom(*this, DEVICE_SELF),
151152      m_port_write_handler(*this)
152153{
153154}
r241937r241938
159160void k007232_device::device_start()
160161{
161162   /* Set up the chips */
162   m_pcmbuf[0] = *region();
163   m_pcmbuf[1] = *region();
164163   m_pcmlimit  = region()->bytes();
165164
166165   m_port_write_handler.resolve();
r241937r241938
381380         addr = m_start[i] + ((m_addr[i]>>BASE_SHIFT)&0x000fffff);
382381         while (old_addr <= addr)
383382      {
384         if( (m_pcmbuf[i][old_addr] & 0x80) || old_addr >= m_pcmlimit )
383         if( (m_rom[old_addr] & 0x80) || old_addr >= m_pcmlimit )
385384         {
386385            /* end of sample */
387386
r241937r241938
413412
414413         m_addr[i] += m_step[i];
415414
416         out = (m_pcmbuf[i][addr] & 0x7f) - 0x40;
415         out = (m_rom[addr] & 0x7f) - 0x40;
417416
418417         outputs[0][j] += out * volA;
419418         outputs[1][j] += out * volB;
trunk/src/emu/sound/k007232.h
r241937r241938
4848
4949private:
5050   // internal state
51   required_region_ptr<UINT8> m_rom;
52
5153   UINT8           m_vol[KDAC_A_PCM_MAX][2]; /* volume for the left and right channel */
5254   UINT32          m_addr[KDAC_A_PCM_MAX];
5355   UINT32          m_start[KDAC_A_PCM_MAX];
r241937r241938
5658   int             m_play[KDAC_A_PCM_MAX];
5759
5860   UINT8           m_wreg[0x10]; /* write data */
59   UINT8 *         m_pcmbuf[2];  /* Channel A & B pointers */
6061
6162   UINT32          m_pcmlimit;
6263
trunk/src/emu/sound/k053260.c
r241937r241938
9292void k053260_device::device_start()
9393{
9494   memory_region *ROM = (m_rgnoverride) ? owner()->memregion(m_rgnoverride) : region();
95   m_rom = *ROM;
95   m_rom = ROM->base();
9696   m_rom_size = ROM->bytes();
9797
9898   m_stream = stream_alloc( 0, 2, clock() / CLOCKS_PER_SAMPLE );
trunk/src/emu/sound/k054539.c
r241937r241938
308308   cur_ptr = 0;
309309   memset(ram, 0, 0x4000);
310310
311   memory_region *reg = (m_rgnoverride != NULL) ? machine().root_device().memregion(m_rgnoverride) : region();
312   rom = *reg;
311   memory_region *reg = (m_rgnoverride != NULL) ? owner()->memregion(m_rgnoverride) : region();
312   rom = reg->base();
313313   rom_size = reg->bytes();
314314   rom_mask = 0xffffffffU;
315315   for(int i=0; i<32; i++)
trunk/src/emu/sound/n63701x.c
r241937r241938
3232namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3333   : device_t(mconfig, NAMCO_63701X, "Namco 63701X", tag, owner, clock, "namco_63701x", __FILE__),
3434      device_sound_interface(mconfig, *this),
35      m_stream(NULL),
36      m_rom(NULL)
35      m_rom(*this, DEVICE_SELF),
36      m_stream(NULL)
3737{
3838}
3939
r241937r241938
4444
4545void namco_63701x_device::device_start()
4646{
47   m_rom = *region();
4847   m_stream = stream_alloc(0, 2, clock()/1000);
4948}
5049
trunk/src/emu/sound/n63701x.h
r241937r241938
5656   DECLARE_WRITE8_MEMBER(namco_63701x_w);
5757
5858private:
59   required_region_ptr<UINT8> m_rom;
5960   voice_63701x m_voices[2];
6061   sound_stream *m_stream; /* channel assigned by the mixer */
61   UINT8 *m_rom;           /* pointer to sample ROM */
6262};
6363
6464extern const device_type NAMCO_63701X;
trunk/src/emu/sound/namco.c
r241937r241938
9393   logerror("Namco: freq fractional bits = %d: internal freq = %d, output freq = %d\n", m_f_fracbits, m_namco_clock, m_sample_rate);
9494
9595   /* build the waveform table */
96   build_decoded_waveform(*region());
96   build_decoded_waveform(region()->base());
9797
9898   /* get stream channels */
9999   if (m_stereo)
trunk/src/emu/sound/nile.c
r241937r241938
6666
6767void nile_device::device_start()
6868{
69   m_sound_ram = *region();
69   m_sound_ram = region()->base();
7070   m_stream = stream_alloc(0, 2, 44100);
7171}
7272
trunk/src/emu/sound/okim6376.c
r241937r241938
113113okim6376_device::okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
114114   : device_t(mconfig, OKIM6376, "OKI6376", tag, owner, clock, "okim6376", __FILE__),
115115      device_sound_interface(mconfig, *this),
116      m_region_base(*this, DEVICE_SELF),
116117      //m_command[OKIM6376_VOICES],
117118      m_latch(0),
118119      //m_stage[OKIM6376_VOICES],
119      m_region_base(0),
120120      m_stream(NULL),
121121      m_master_clock(0),
122122      m_divisor(0),
r241937r241938
156156   m_stage[0] = 0;
157157   m_stage[1] = 0;
158158   m_latch = 0;
159   m_region_base = *region();
160159   m_master_clock = clock();
161160   m_divisor = divisor_table[0];
162161   m_nar = 1;
trunk/src/emu/sound/okim6376.h
r241937r241938
4848
4949private:
5050   // internal state
51   required_region_ptr<UINT8> m_region_base;     /* pointer to the base of the region */
52
5153   #define OKIM6376_VOICES     2
5254   struct ADPCMVoice m_voice[OKIM6376_VOICES];
5355   INT32 m_command[OKIM6376_VOICES];
5456   INT32 m_latch;            /* Command data is held before transferring to either channel */
5557   UINT8 m_stage[OKIM6376_VOICES];/* If a sample is playing, flag that we have a command staged */
56   UINT8 *m_region_base;     /* pointer to the base of the region */
5758   sound_stream *m_stream;   /* which stream are we playing on? */
5859   UINT32 m_master_clock;    /* master clock frequency */
5960   UINT8 m_divisor;          /* can be 8,10,16, and is read out of ROM data */
trunk/src/emu/sound/qsound.c
r241937r241938
6868qsound_device::qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6969   : device_t(mconfig, QSOUND, "Q-Sound", tag, owner, clock, "qsound", __FILE__),
7070      device_sound_interface(mconfig, *this),
71      m_cpu(*this, "qsound"),
72      m_sample_rom(*this, DEVICE_SELF),
7173      m_data(0),
72      m_stream(NULL),
73      m_sample_rom_length(0),
74      m_sample_rom(NULL),
75      m_cpu(NULL)
74      m_stream(NULL)
7675{
7776}
7877
r241937r241938
105104
106105void qsound_device::device_start()
107106{
108   // find our CPU
109   m_cpu = subdevice<dsp16_device>("qsound");
110
111   m_sample_rom = (INT8*)*region();
112   m_sample_rom_length = region()->bytes();
113
114107   m_stream = stream_alloc(0, 2, clock() / 166); // /166 clock divider?
115108
116109   // create pan table
trunk/src/emu/sound/qsound.h
r241937r241938
6262      UINT32 step_ptr;    // current offset counter
6363   } m_channel[16];
6464
65   required_device<dsp16_device> m_cpu;
66   required_region_ptr<INT8> m_sample_rom;
67
6568   int m_pan_table[33];    // pan volume table
6669   UINT16 m_data;          // register latch data
6770   sound_stream *m_stream; // audio stream
68   UINT32 m_sample_rom_length;
69   INT8 *m_sample_rom;     // Q-Sound sample ROM
70   dsp16_device *m_cpu;
7171
72   inline INT8 read_sample(UINT32 offset) { return m_sample_rom[offset % m_sample_rom_length]; }
72   inline INT8 read_sample(UINT32 offset) { return m_sample_rom[offset & m_sample_rom.mask()]; }
7373   void write_data(UINT8 address, UINT16 data);
7474};
7575
trunk/src/emu/sound/s14001a.c
r241937r241938
577577s14001a_device::s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
578578   : device_t(mconfig, S14001A, "S14001A", tag, owner, clock, "s14001a", __FILE__),
579579      device_sound_interface(mconfig, *this),
580      m_SpeechRom(*this, DEVICE_SELF),
580581      m_stream(NULL),
581582      m_WordInput(0),
582583      m_LatchedWord(0),
r241937r241938
596597      m_OldDelta(0x02),
597598      m_DACOutput(SILENCE),
598599      m_audioout(0),
599      m_SpeechRom(NULL),
600600      m_VSU1000_amp(0)
601601{
602602}
r241937r241938
628628      m_filtervals[i] = SILENCE;
629629   }
630630
631   m_SpeechRom = *region();
632
633631   m_stream = machine().sound().stream_alloc(*this, 0, 1, clock() ? clock() : machine().sample_rate());
634632}
635633
trunk/src/emu/sound/s14001a.h
r241937r241938
3535
3636private:
3737   // internal state
38   required_region_ptr<UINT8> m_SpeechRom;
3839   sound_stream * m_stream;
3940
4041   UINT8 m_WordInput; // value on word input bus
r241937r241938
5556   UINT8 m_OldDelta; // 2-bit old delta value
5657   UINT8 m_DACOutput; // 4-bit DAC Accumulator/output
5758   UINT8 m_audioout; // filtered audio output
58   UINT8 *m_SpeechRom; // array to hold rom contents, mame will not need this, will use a pointer
5959   INT16 m_filtervals[8];
6060   UINT8 m_VSU1000_amp; // amplitude setting on VSU-1000 board
6161
trunk/src/emu/sound/scsp.c
r241937r241938
509509      m_Master=0;
510510   }
511511
512   m_SCSPRAM = *region();
512   m_SCSPRAM = region()->base();
513513   if (m_SCSPRAM)
514514   {
515515      m_SCSPRAM_LENGTH = region()->bytes();
trunk/src/emu/sound/segapcm.c
r241937r241938
1717segapcm_device::segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1818   : device_t(mconfig, SEGAPCM, "Sega PCM", tag, owner, clock, "segapcm", __FILE__),
1919      device_sound_interface(mconfig, *this),
20      m_rom(*this, DEVICE_SELF),
2021      m_ram(NULL),
21      m_rom(NULL),
2222      m_bank(0),
2323      m_bankshift(0),
2424      m_bankmask(0),
25      m_rgnmask(0),
2625      m_stream(NULL)
2726{
2827}
r241937r241938
3433
3534void segapcm_device::device_start()
3635{
37   int mask, rom_mask, len;
36   int mask, rom_mask;
3837
39   m_rom = *region();
4038   m_ram = auto_alloc_array(machine(), UINT8, 0x800);
4139
4240   memset(m_ram, 0xff, 0x800);
r241937r241938
4644   if (!mask)
4745      mask = BANK_MASK7 >> 16;
4846
49   len = region()->bytes();
50   m_rgnmask = len - 1;
47   for(rom_mask = 1; rom_mask < m_rom.length(); rom_mask *= 2);
5148
52   for(rom_mask = 1; rom_mask < len; rom_mask *= 2);
53
5449   rom_mask--;
5550
5651   m_bankmask = mask & (rom_mask >> m_bankshift);
r241937r241938
124119            }
125120
126121            /* fetch the sample */
127            v = rom[(addr >> 8) & m_rgnmask] - 0x80;
122            v = rom[(addr >> 8) & m_rom.mask()] - 0x80;
128123
129124            /* apply panning and advance */
130125            outputs[0][i] += v * regs[2];
trunk/src/emu/sound/segapcm.h
r241937r241938
5353   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
5454
5555private:
56   required_region_ptr<UINT8> m_rom;
5657   UINT8* m_ram;
5758   UINT8 m_low[16];
58   const UINT8* m_rom;
5959   int m_bank;
6060   int m_bankshift;
6161   int m_bankmask;
62   int m_rgnmask;
6362   sound_stream* m_stream;
6463};
6564
trunk/src/emu/sound/sp0256.c
r241937r241938
9696sp0256_device::sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
9797            : device_t(mconfig, SP0256, "SP0256", tag, owner, clock, "sp0256", __FILE__),
9898               device_sound_interface(mconfig, *this),
99               m_rom(*this, DEVICE_SELF),
99100               m_drq_cb(*this),
100101               m_sby_cb(*this)
101102{
r241937r241938
139140   /* -------------------------------------------------------------------- */
140141   /*  Setup the ROM.                                                      */
141142   /* -------------------------------------------------------------------- */
142   m_rom = *region();
143143   // the rom is not supposed to be reversed first; according to Joe Zbiciak.
144144   // see http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=72385#Post72385
145145   // TODO: because of this, check if the bitrev functions are even used anywhere else
trunk/src/emu/sound/sp0256.h
r241937r241938
9999private:
100100   UINT32 getb(int len);
101101   void micro();
102
102   required_region_ptr<UINT8> m_rom; /* 64K ROM.                                     */
103103   sound_stream  *m_stream;          /* MAME core sound stream                       */
104104   devcb_write_line m_drq_cb;       /* Data request callback                        */
105105   devcb_write_line m_sby_cb;       /* Standby callback                             */
r241937r241938
128128   UINT32         m_fifo_bitp;       /* FIFO bit-pointer (for partial decles).       */
129129   UINT16         m_fifo[64];        /* The 64-decle FIFO.                           */
130130
131   UINT8          *m_rom;            /* 64K ROM.                                     */
132
133131   emu_timer *m_lrq_timer;
134132};
135133
trunk/src/emu/sound/tc8830f.c
r241937r241938
4747   // create the stream
4848   m_stream = stream_alloc(0, 1, clock() / 0x10);
4949
50   m_mem_base = *region();
50   m_mem_base = region()->base();
5151   m_mem_mask = region()->bytes() - 1;
5252
5353   // register for savestates
trunk/src/emu/sound/tms5110.c
r241937r241938
822822
823823void tms5110_device::device_start()
824824{
825   m_table = *region();
825   m_table = region()->base();
826826
827827   set_variant(TMS5110_IS_5110A);
828828
r241937r241938
12031203   m_pdc_cb.resolve_safe();
12041204   m_ctl_cb.resolve_safe();
12051205
1206   m_rom = *region();
1206   m_rom = region()->base();
12071207   assert_always(m_rom != NULL, "Error creating TMSPROM chip: No rom region found");
1208   m_prom = machine().root_device().memregion(m_prom_region)->base();
1208   m_prom = owner()->memregion(m_prom_region)->base();
12091209   assert_always(m_prom != NULL, "Error creating TMSPROM chip: No prom region found");
12101210
12111211   m_romclk_timer = timer_alloc(0);
trunk/src/emu/sound/upd7759.c
r241937r241938
238238
239239   /* compute the ROM base or allocate a timer */
240240   m_romoffset = 0;
241   m_rom = m_rombase = *region();
241   m_rom = m_rombase = region()->base();
242242   if (m_rombase == NULL)
243243   {
244244      assert(type() == UPD7759); // other chips do not support slave mode
r241937r241938
313313
314314   /* compute the ROM base or allocate a timer */
315315   m_romoffset = 0;
316   m_rom = m_rombase = *region();
316   m_rom = m_rombase = region()->base();
317317   if (m_rombase == NULL)
318318   {
319319      m_rommask = 0;
trunk/src/emu/sound/x1_010.c
r241937r241938
8585x1_010_device::x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
8686   : device_t(mconfig, X1_010, "X1-010", tag, owner, clock, "x1_010", __FILE__),
8787      device_sound_interface(mconfig, *this),
88      m_region(*this, DEVICE_SELF),
8889      m_rate(0),
8990      m_adr(0),
9091      m_stream(NULL),
91      m_region(NULL),
9292      m_sound_enable(0),
9393      m_base_clock(0)
9494{
r241937r241938
106106{
107107   int i;
108108
109   m_region        = *region();
110109   m_base_clock    = clock();
111110   m_rate          = clock() / 1024;
112111
r241937r241938
193192   register INT8   *start, *end, data;
194193   register UINT8  *env;
195194   register UINT32 smp_offs, smp_step, env_offs, env_step, delta;
196   const UINT8 *snd1 = m_region;
197195
198196   // mixer buffer zero clear
199197   memset( outputs[0], 0, samples*sizeof(*outputs[0]) );
r241937r241938
207205         stream_sample_t *bufL = outputs[0];
208206         stream_sample_t *bufR = outputs[1];
209207         if( (reg->status&2) == 0 ) {                        // PCM sampling
210            start    = (INT8 *)(reg->start      *0x1000+snd1);
211            end      = (INT8 *)((0x100-reg->end)*0x1000+snd1);
208            start    = m_region + reg->start*0x1000;
209            end      = m_region + (0x100-reg->end)*0x1000;
212210            volL     = ((reg->volume>>4)&0xf)*VOL_BASE;
213211            volR     = ((reg->volume>>0)&0xf)*VOL_BASE;
214212            smp_offs = m_smp_offset[ch];
trunk/src/emu/sound/x1_010.h
r241937r241938
3333   // internal state
3434
3535   /* Variables only used here */
36   required_region_ptr<INT8> m_region;       // ROM
3637   int m_rate;                               // Output sampling rate (Hz)
3738   int m_adr;                                // address
3839   sound_stream *  m_stream;                 // Stream handle
39   const UINT8 *m_region;                    // region name
4040   int m_sound_enable;                       // sound output enable/disable
4141   UINT8   m_reg[0x2000];                // X1-010 Register & wave form area
4242   UINT8   m_HI_WORD_BUF[0x2000];            // X1-010 16bit access ram check avoidance work
trunk/src/emu/sound/ymf271.c
r241937r241938
17101710   m_timA = timer_alloc(0);
17111711   m_timB = timer_alloc(1);
17121712
1713   m_mem_base = *region();
1713   m_mem_base = region()->base();
17141714   m_mem_size = region()->bytes();
17151715   m_irq_handler.resolve();
17161716
trunk/src/emu/sound/ymz280b.c
r241937r241938
581581
582582   /* initialize the rest of the structure */
583583   m_master_clock = (double)clock() / 384.0;
584   m_mem_base = *region();
584   m_mem_base = region()->base();
585585   m_mem_size = region()->bytes();
586586   m_irq_handler.resolve();
587587
trunk/src/emu/sound/ymz770.c
r241937r241938
4949{
5050   // create the stream
5151   m_stream = machine().sound().stream_alloc(*this, 0, 2, 16000);
52   m_rom_base = *region();
52   m_rom_base = region()->base();
5353   m_rom_limit = region()->bytes() * 8;
5454
5555   for (int i = 0; i < 8; i++)
trunk/src/emu/sound/zsg2.c
r241937r241938
7171zsg2_device::zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
7272   : device_t(mconfig, ZSG2, "ZSG-2", tag, owner, clock, "zsg2", __FILE__),
7373      device_sound_interface(mconfig, *this),
74      m_mem_base(*this, DEVICE_SELF),
7475      m_read_address(0),
7576      m_ext_read_handler(*this)
7677{
r241937r241938
8990
9091   m_stream = stream_alloc(0, 2, clock() / 192);
9192
92   m_mem_base = *region();
93   m_mem_size = region()->bytes();
94   m_mem_blocks = m_mem_size / 4;
93   m_mem_blocks = m_mem_base.length();
9594
9695   m_mem_copy = auto_alloc_array_clear(machine(), UINT32, m_mem_blocks);
9796   m_full_samples = auto_alloc_array_clear(machine(), INT16, m_mem_blocks * 4 + 4); // +4 is for empty block
trunk/src/emu/sound/zsg2.h
r241937r241938
6565   };
6666
6767   zchan m_chan[48];
68   UINT32 m_read_address;
6968
70   UINT32 *m_mem_base;
69   required_region_ptr<UINT32> m_mem_base;
70   UINT32 m_read_address;
7171   UINT32 *m_mem_copy;
72   UINT32 m_mem_size;
7372   UINT32 m_mem_blocks;
7473   INT16 *m_full_samples;
7574
trunk/src/emu/video/hd44780.c
r241937r241938
8787void hd44780_device::device_start()
8888{
8989   if (region())
90      m_cgrom = (UINT8*)(*region());
90      m_cgrom = region()->base();
9191   else
92      m_cgrom = (UINT8*)(*memregion("cgrom"));
92      m_cgrom = memregion("cgrom")->base();
9393
9494   m_busy_timer = timer_alloc(TIMER_BUSY);
9595   m_blink_timer = timer_alloc(TIMER_BLINKING);
trunk/src/mame/drivers/cps3.c
r241937r241938
741741void cps3_state::cps3_decrypt_bios()
742742{
743743   int i;
744   UINT32 *coderegion = (UINT32*)memregion("user1")->base();
744   UINT32 *coderegion = (UINT32*)memregion("bios")->base();
745745
746   m_decrypted_bios = (UINT32*)memregion("user1")->base();
746   m_decrypted_bios = (UINT32*)memregion("bios")->base();
747747
748748   for (i=0;i<0x80000;i+=4)
749749   {
r241937r241938
13651365   /* BIOS ROM */
13661366   if (address < 0x80000)
13671367   {
1368      direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, *memregion("user1"));
1368      direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, m_decrypted_bios);
13691369      return ~0;
13701370   }
13711371   /* RAM */
r241937r241938
21832183
21842184/* there are more unknown writes, but you get the idea */
21852185static ADDRESS_MAP_START( cps3_map, AS_PROGRAM, 32, cps3_state )
2186   AM_RANGE(0x00000000, 0x0007ffff) AM_ROM AM_REGION("user1", 0) // Bios ROM
2186   AM_RANGE(0x00000000, 0x0007ffff) AM_ROM AM_REGION("bios", 0) // Bios ROM
21872187   AM_RANGE(0x02000000, 0x0207ffff) AM_RAM AM_SHARE("mainram") // Main RAM
21882188
21892189   AM_RANGE(0x03000000, 0x030003ff) AM_RAM // 'FRAM' (SFIII memory test mode ONLY)
r241937r241938
26422642/* CD sets - use CD BIOS roms */
26432643
26442644ROM_START( redearth )
2645   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2645   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
26462646   ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) )
26472647
26482648   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
26502650ROM_END
26512651
26522652ROM_START( redearthr1 )
2653   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2653   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
26542654   ROM_LOAD( "redearth_euro.29f400.u2", 0x000000, 0x080000, CRC(02e0f336) SHA1(acc37e830dfeb9674f5a0fb24f4cc23217ae4ff5) )
26552655
26562656   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
26582658ROM_END
26592659
26602660ROM_START( warzard )
2661   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2661   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
26622662   ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) )
26632663
26642664   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
26662666ROM_END
26672667
26682668ROM_START( warzardr1 )
2669   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2669   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
26702670   ROM_LOAD( "warzard_japan.29f400.u2", 0x000000, 0x080000, CRC(f8e2f0c6) SHA1(93d6a986f44c211fff014e55681eca4d2a2774d6) )
26712671
26722672   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
26752675
26762676
26772677ROM_START( sfiii )
2678   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2678   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
26792679   ROM_LOAD( "sfiii_euro.29f400.u2", 0x000000, 0x080000, CRC(27699ddc) SHA1(d8b525cd27e584560b129598df31fd2c5b2a682a) )
26802680
26812681   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
26832683ROM_END
26842684
26852685ROM_START( sfiiiu )
2686   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2686   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
26872687   ROM_LOAD( "sfiii_usa_region_b1.29f400.u2", 0x000000, 0x080000, CRC(fb172a8e) SHA1(48ebf59910f246835f7dc0c588da30f7a908072f) )
26882688
26892689   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
26912691ROM_END
26922692
26932693ROM_START( sfiiia )
2694   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2694   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
26952695   ROM_LOAD( "sfiii_asia_region_bd.29f400.u2", 0x000000, 0x080000,  CRC(cbd28de7) SHA1(9c15ecb73b9587d20850e62e8683930a45caa01b) )
26962696
26972697   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
26992699ROM_END
27002700
27012701ROM_START( sfiiij )
2702   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2702   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27032703   ROM_LOAD( "sfiii_japan.29f400.u2", 0x000000, 0x080000, CRC(74205250) SHA1(c3e83ace7121d32da729162662ec6b5285a31211) )
27042704
27052705   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27072707ROM_END
27082708
27092709ROM_START( sfiiih )
2710   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2710   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27112711   ROM_LOAD( "sfiii_hispanic.29f400.u2", 0x000000, 0x080000, CRC(d2b3cd48) SHA1(00ebb270c24a66515c97e35331de54ff5358000e) )
27122712
27132713   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27162716
27172717
27182718ROM_START( sfiii2 )
2719   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2719   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27202720   ROM_LOAD( "sfiii2_usa.29f400.u2", 0x000000, 0x080000, CRC(75dd72e0) SHA1(5a12d6ea6734df5de00ecee6f9ef470749d2f242) )
27212721
27222722   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27242724ROM_END
27252725
27262726ROM_START( sfiii2j )
2727   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2727   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27282728   ROM_LOAD( "sfiii2_japan.29f400.u2", 0x000000, 0x080000, CRC(faea0a3e) SHA1(a03cd63bcf52e4d57f7a598c8bc8e243694624ec) )
27292729
27302730   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27332733
27342734
27352735ROM_START( jojo )
2736   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2736   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27372737   ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
27382738
27392739   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27412741ROM_END
27422742
27432743ROM_START( jojor1 )
2744   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2744   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27452745   ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
27462746
27472747   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27492749ROM_END
27502750
27512751ROM_START( jojor2 )
2752   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2752   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27532753   ROM_LOAD( "jojo_usa.29f400.u2", 0x000000, 0x080000, CRC(8d40f7be) SHA1(2a4bd83db2f959c33b071e517941aa55a0f919c0) )
27542754
27552755   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27572757ROM_END
27582758
27592759ROM_START( jojoj )
2760   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2760   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27612761   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
27622762
27632763   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27652765ROM_END
27662766
27672767ROM_START( jojojr1 )
2768   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2768   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27692769   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
27702770
27712771   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27732773ROM_END
27742774
27752775ROM_START( jojojr2 )
2776   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2776   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27772777   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
27782778
27792779   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27822782
27832783
27842784ROM_START( sfiii3 )
2785   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2785   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27862786   ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) )
27872787
27882788   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27902790ROM_END
27912791
27922792ROM_START( sfiii3r1 )
2793   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2793   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
27942794   ROM_LOAD( "sfiii3_euro.29f400.u2", 0x000000, 0x080000, CRC(30bbf293) SHA1(f094c2eeaf4f6709060197aca371a4532346bf78) )
27952795
27962796   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
27982798ROM_END
27992799
28002800ROM_START( sfiii3u )
2801   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2801   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
28022802   ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
28032803
28042804   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
28062806ROM_END
28072807
28082808ROM_START( sfiii3ur1 )
2809   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2809   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
28102810   ROM_LOAD( "sfiii3_usa.29f400.u2", 0x000000, 0x080000, CRC(ecc545c1) SHA1(e39083820aae914fd8b80c9765129bedb745ceba) )
28112811
28122812   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
28152815
28162816
28172817ROM_START( jojoba )
2818   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2818   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
28192819   ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) )
28202820
28212821   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
28232823ROM_END
28242824
28252825ROM_START( jojobar1 )
2826   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2826   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
28272827   ROM_LOAD( "jojoba_japan.29f400.u2", 0x000000, 0x080000, CRC(3085478c) SHA1(055eab1fc42816f370a44b17fd7e87ffcb10e8b7) )
28282828
28292829   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
28372837/* NO CD sets - use NO CD BIOS roms - don't require the CD image to boot */
28382838
28392839ROM_START( sfiiin )
2840   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2840   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
28412841   ROM_LOAD( "sfiii_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(ca2b715f) SHA1(86319987f9af4afd272a2488e73de8382743cb37) ) // this is a different VERSION of the bios compared to all other sets, not just an alt region code
28422842
28432843   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
28912891
28922892
28932893ROM_START( sfiiina )
2894   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2894   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
28952895   ROM_LOAD( "sfiii_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(73e32463) SHA1(45d144e533e4b20cc5a744ca4f618e288430c601) ) // sldh
28962896
28972897   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
29442944ROM_END
29452945
29462946ROM_START( sfiii2n )
2947   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
2947   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
29482948   ROM_LOAD( "sfiii2_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(fd297c0d) SHA1(4323deda2789f104b53f32a663196ec16de73215) )
29492949
29502950   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
30183018ROM_END
30193019
30203020ROM_START( jojon )
3021   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3021   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
30223022   ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) )
30233023
30243024   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
30803080ROM_END
30813081
30823082ROM_START( jojonr1 )
3083   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3083   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
30843084   ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) )
30853085
30863086   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
31423142ROM_END
31433143
31443144ROM_START( jojonr2 )
3145   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3145   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
31463146   ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) )
31473147
31483148   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
32043204ROM_END
32053205
32063206ROM_START( sfiii3n )
3207   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3207   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
32083208   ROM_LOAD( "sfiii3_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(1edc6366) SHA1(60b4b9adeb030a33059d74fdf03873029e465b52) )
32093209
32103210   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
32953295ROM_END
32963296
32973297ROM_START( sfiii3nr1 )
3298   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3298   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
32993299   ROM_LOAD( "sfiii3_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(1edc6366) SHA1(60b4b9adeb030a33059d74fdf03873029e465b52) )
33003300
33013301   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
33863386ROM_END
33873387
33883388ROM_START( jojoban )
3389   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3389   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
33903390   ROM_LOAD( "jojoba_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(4dab19f5) SHA1(ba07190e7662937fc267f07285c51e99a45c061e) )
33913391
33923392   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
34603460ROM_END
34613461
34623462ROM_START( jojobanr1 )
3463   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3463   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
34643464   ROM_LOAD( "jojoba_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(4dab19f5) SHA1(ba07190e7662937fc267f07285c51e99a45c061e) )
34653465
34663466   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
35343534ROM_END
35353535
35363536ROM_START( jojobane )
3537   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3537   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
35383538   ROM_LOAD( "jojoba_euro_nocd.29f400.u2", 0x000000, 0x080000, CRC(1ee2d679) SHA1(9e129b454a376606b3f7e8aec64de425cf9c635c) )
35393539
35403540   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
36083608ROM_END
36093609
36103610ROM_START( jojobaner1 )
3611   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3611   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
36123612   ROM_LOAD( "jojoba_euro_nocd.29f400.u2", 0x000000, 0x080000, CRC(1ee2d679) SHA1(9e129b454a376606b3f7e8aec64de425cf9c635c) )
36133613
36143614   ROM_REGION( 0x200000, "simm1.0", 0 )
r241937r241938
36843684/* Bootlegs for use with modified security carts */
36853685
36863686ROM_START( cps3boot ) // for cart with standard SH2
3687   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3687   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
36883688   ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
36893689
36903690   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
36923692ROM_END
36933693
36943694ROM_START( cps3booto ) // for cart with standard SH2
3695   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3695   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
36963696   ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
36973697
36983698   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
37003700ROM_END
37013701
37023702ROM_START( cps3bs32 ) // for cart with standard SH2
3703   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3703   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
37043704   ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
37053705
37063706   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
37083708ROM_END
37093709
37103710ROM_START( cps3bs32a ) // for cart with standard SH2
3711   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3711   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
37123712   ROM_LOAD( "no-battery_bios_29f400_for_hd6417095_sh2.u2", 0x000000, 0x080000, CRC(cb9bd5b0) SHA1(ea7ecb3deb69f5307a62d8f0d7d8e68d49013d07))
37133713
37143714   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
37163716ROM_END
37173717
37183718ROM_START( cps3boota ) // for cart with dead custom SH2 (or 2nd Impact CPU which is the same as a dead one)
3719   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3719   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
37203720   ROM_LOAD( "no-battery_bios_29f400_for_dead_security_cart.u2", 0x000000, 0x080000, CRC(0fd56fb3) SHA1(5a8bffc07eb7da73cf4bca6718df72e471296bfd) )
37213721
37223722   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
37253725
37263726
37273727ROM_START( cps3bootoa ) // for cart with dead custom SH2 (or 2nd Impact CPU which is the same as a dead one)
3728   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
3728   ROM_REGION32_BE( 0x080000, "bios", 0 ) /* bios region */
37293729   ROM_LOAD( "no-battery_bios_29f400_for_dead_security_cart.u2", 0x000000, 0x080000, CRC(0fd56fb3) SHA1(5a8bffc07eb7da73cf4bca6718df72e471296bfd) )
37303730
37313731   DISK_REGION( "scsi:" SCSI_PORT_DEVICE1 ":cdrom" )
r241937r241938
37503750    OCEANIA 7
37513751    ASIA NCD 8
37523752
3753    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
3753    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "bios" )->base();
37543754    rom[0x1fed8/4]^=0x00000001; // clear region to 0 (invalid)
37553755    rom[0x1fed8/4]^=0x00000008; // region 8 - ASIA NO CD - doesn't actually skip the CD
37563756                                // test on startup, only during game, must be another flag
r241937r241938
37753775
37763776    // bios rom also lists korea, but game rom does not.
37773777
3778    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
3778    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "bios" )->base();
37793779    rom[0x1fec8/4]^=0x00000001; // region (clear region)
37803780    rom[0x1fec8/4]^=0x00000008; // region
37813781    rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
r241937r241938
37973797    OCEANIA 7
37983798    ASIA 8
37993799
3800    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
3800    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "bios" )->base();
38013801    rom[0x1fec8/4]^=0x00000001; // region (clear region)
38023802    rom[0x1fec8/4]^=0x00000008; // region
38033803    rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
r241937r241938
38213821
38223822    DEVELOPMENT VERSION add 0x70 mask!
38233823
3824    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
3824    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "bios" )->base();
38253825    rom[0x1fec8/4]^=0x00000001; // region hack (clear jpn)
38263826
38273827    rom[0x1fec8/4]^=0x00000004; // region
r241937r241938
38423842    BRAZIL 6
38433843    OCEANIA 7
38443844
3845    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
3845    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "bios" )->base();
38463846    rom[0x1fec8/4]^=0x00000004; // region (clear region)
38473847    rom[0x1fec8/4]^=0x00000001; // region
38483848    rom[0x1fecc/4]^=0x01000000; // nocd
r241937r241938
38643864
38653865    DEVELOPMENT VERSION add 0x70 mask!
38663866
3867    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "user1" )->base();
3867    UINT32 *rom =  (UINT32*)machine.root_device().memregion ( "bios" )->base();
38683868    rom[0x1fec8/4]^=0x00000001; // region (clear jpn)
38693869    rom[0x1fec8/4]^=0x00000002; // region
38703870    rom[0x1fec8/4]^=0x00000070; // DEV mode
trunk/src/mame/drivers/sigmab52.c
r241937r241938
546546
547547void sigmab52_state::machine_start()
548548{
549   UINT8 *rom = (UINT8*)*memregion("maincpu");
550   m_bank1->configure_entries(0, 2, rom, 0x4000);
549   m_bank1->configure_entries(0, 2, memregion("maincpu")->base(), 0x4000);
551550}
552551
553552void sigmab52_state::machine_reset()
trunk/src/mame/machine/decocass_tape.c
r241937r241938
9191   m_tape_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(decocass_tape_device::tape_clock_callback), this));
9292   if (region() == NULL)
9393      return;
94   UINT8 *regionbase = *region();
94   UINT8 *regionbase = region()->base();
9595
9696   /* scan for the first non-empty block in the image */
9797   for (offs = region()->bytes() - 1; offs >= 0; offs--)
r241937r241938
290290UINT8 decocass_tape_device::get_status_bits()
291291{
292292   UINT8 tape_bits = 0;
293   UINT8 *tape_data = region()->base();
293294
294295   /* bit 0x20 is the BOT/EOT signal, which is also set in the leader/trailer area */
295296   if (m_region == REGION_LEADER || m_region == REGION_BOT || m_region == REGION_EOT || m_region == REGION_TRAILER)
r241937r241938
320321
321322      /* data block bytes are data */
322323      else if (m_bytenum >= BYTE_DATA_0 && m_bytenum <= BYTE_DATA_255)
323         byteval = static_cast<UINT8 *>(*region())[blocknum * 256 + (m_bytenum - BYTE_DATA_0)];
324         byteval = tape_data[blocknum * 256 + (m_bytenum - BYTE_DATA_0)];
324325
325326      /* CRC MSB */
326327      else if (m_bytenum == BYTE_CRC16_MSB)
trunk/src/mess/audio/alesis.c
r241937r241938
3636
3737alesis_dm3ag_device::alesis_dm3ag_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3838   : device_t(mconfig, ALESIS_DM3AG, "Alesis DM3AG", tag, owner, clock, "alesis_dm3ag", __FILE__),
39      m_dac(*this, "dac")
39      m_dac(*this, "dac"),
40      m_samples(*this, DEVICE_SELF)
4041{
4142}
4243
r241937r241938
5556
5657void alesis_dm3ag_device::device_start()
5758{
58   m_samples = (INT8*)(*region());
5959   m_dac_update_timer = timer_alloc(TIMER_DAC_UPDATE);
6060}
6161
trunk/src/mess/drivers/alphasma.c
r241937r241938
1515#include "emu.h"
1616#include "cpu/mc68hc11/mc68hc11.h"
1717#include "machine/nvram.h"
18#include "machine/ram.h"
1819#include "video/hd44780.h"
1920#include "rendlay.h"
2021
r241937r241938
2728         m_lcdc0(*this, "ks0066_0"),
2829         m_lcdc1(*this, "ks0066_1"),
2930         m_nvram(*this, "nvram"),
31         m_ram(*this, RAM_TAG),
3032         m_rambank(*this, "rambank"),
3133         m_keyboard(*this, "COL"),
3234         m_battery_status(*this, "BATTERY")
r241937r241938
3638   required_device<hd44780_device> m_lcdc0;
3739   required_device<hd44780_device> m_lcdc1;
3840   required_device<nvram_device> m_nvram;
41   required_device<ram_device> m_ram;
3942   required_memory_bank m_rambank;
4043   required_ioport_array<16> m_keyboard;
4144   required_ioport m_battery_status;
r241937r241938
396399
397400void alphasmart_state::machine_start()
398401{
399   UINT8* ram = (UINT8*)(*memregion("mainram"));
402   UINT8* ram = m_ram->pointer();
400403
401404   m_rambank->configure_entries(0, 4, ram, 0x8000);
402405   m_nvram->set_base(ram, 0x8000*4);
r241937r241938
424427   MCFG_KS0066_F05_ADD("ks0066_1")
425428   MCFG_HD44780_LCD_SIZE(2, 40)
426429
430   MCFG_RAM_ADD(RAM_TAG)
431   MCFG_RAM_DEFAULT_SIZE("128K")
432
427433   /* video hardware */
428434   MCFG_SCREEN_ADD("screen", LCD)
429435   MCFG_SCREEN_REFRESH_RATE(50)
r241937r241938
449455ROM_START( asmapro )
450456   ROM_REGION( 0x8000, "maincpu", 0 )
451457   ROM_LOAD( "alphasmartpro212.rom",  0x0000, 0x8000, CRC(896ddf1c) SHA1(c3c6a421c9ced92db97431d04b4a3f09a39de716) )   // Checksum 8D24 on label
452
453   ROM_REGION( 0x20000, "mainram", ROMREGION_ERASE )
454458ROM_END
455459
456460ROM_START( asma2k )
r241937r241938
467471
468472   ROM_REGION( 0x8000, "spellcheck", 0 )
469473   ROM_LOAD( "spellcheck.bin",  0x0000, 0x8000, NO_DUMP )
470
471   ROM_REGION( 0x20000, "mainram", ROMREGION_ERASE )
472474ROM_END
473475
474476
trunk/src/mess/drivers/apexc.c
r241937r241938
117117   fread( machine().root_device().memregion("maincpu")->base(), 0x1000);
118118#ifdef LSB_FIRST
119119   {   /* fix endianness */
120      UINT32 *RAM;
121      int i;
120      UINT32 *RAM = (UINT32 *)(machine().root_device().memregion("maincpu")->base());
122121
123      RAM = (UINT32 *)(*machine().root_device().memregion("maincpu"));
124
125      for (i=0; i < 0x0400; i++)
122      for (int i=0; i < 0x0400; i++)
126123         RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]);
127124   }
128125#endif
r241937r241938
141138      fseek(0, SEEK_SET);
142139#ifdef LSB_FIRST
143140      {   /* fix endianness */
144         UINT32 *RAM;
145         int i;
141         UINT32 *RAM = (UINT32 *)(machine().root_device().memregion("maincpu")->base());
146142
147         RAM = (UINT32 *)(*machine().root_device().memregion("maincpu"));
148
149         for (i=0; i < /*0x2000*/0x0400; i++)
143         for (int i=0; i < /*0x2000*/0x0400; i++)
150144            RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]);
151145      }
152146#endif
trunk/src/mess/drivers/gamate.c
r241937r241938
109109
110110WRITE8_MEMBER( gamate_state::bios_w )
111111{
112   UINT8 *memory = *memregion("main_cpu"); //memory_region (REGION_CPU1);
112   UINT8 *memory = memregion("maincpu")->base(); //memory_region (REGION_CPU1);
113113
114114   unsigned short stack=m_maincpu->sp();//cpu_get_reg(M6502_S)|0x100;
115115   unsigned short address= memory[stack+1]|(memory[stack+2]<<8);
trunk/src/mess/drivers/gba.c
r241937r241938
18851885
18861886READ32_MEMBER(gba_state::gba_bios_r)
18871887{
1888   UINT32 *rom = (UINT32 *)(*m_region_maincpu);
1888   UINT32 *rom = m_region_maincpu;
18891889   if (m_bios_hack->read())
18901890   {
18911891      // partially patch out logo and checksum checks
trunk/src/mess/drivers/geniusiq.c
r241937r241938
256256      : driver_device(mconfig, type, tag),
257257      m_maincpu(*this, "maincpu"),
258258      m_cart(*this, "cartslot"),
259      m_rom(*this, "maincpu"),
259260      m_vram(*this, "vram"),
260261      m_mouse_gfx(*this, "mouse_gfx"),
261262      m_cart_state(IQ128_NO_CART)
r241937r241938
263264
264265   required_device<cpu_device> m_maincpu;
265266   required_device<generic_slot_device> m_cart;
267   required_region_ptr<UINT16> m_rom;
266268   required_shared_ptr<UINT16> m_vram;
267269   required_shared_ptr<UINT16> m_mouse_gfx;
268270
r241937r241938
420422
421423WRITE16_MEMBER(geniusiq_state::gfx_idx_w)
422424{
423   UINT16 *gfx = ((UINT16 *)(*memregion("maincpu"))) + ((m_gfx_base + (data & 0xff)*32)>>1);
425   UINT16 *gfx = m_rom + ((m_gfx_base + (data & 0xff)*32)>>1);
424426
425427   // first 16 bits are used to define the character size
426428   UINT8 gfx_heigh = (gfx[0]>>0) & 0xff;
trunk/src/mess/drivers/gp2x.c
r241937r241938
3131         m_ram(*this, "ram"){ }
3232
3333   required_device<cpu_device> m_maincpu;
34   required_memory_region m_maincpu_region;
34   required_region_ptr<UINT32> m_maincpu_region;
3535   DECLARE_READ32_MEMBER(gp2x_lcdc_r);
3636   DECLARE_WRITE32_MEMBER(gp2x_lcdc_w);
3737   DECLARE_READ32_MEMBER(nand_r);
r241937r241938
203203
204204READ32_MEMBER( gp2x_state::nand_r )
205205{
206   UINT32 *ROM = (UINT32 *)(*m_maincpu_region);
206   UINT32 *ROM = m_maincpu_region;
207207   UINT32 ret;
208208
209209   if (offset == 0)
trunk/src/mess/drivers/pc100.c
r241937r241938
6868public:
6969   pc100_state(const machine_config &mconfig, device_type type, const char *tag)
7070      : driver_device(mconfig, type, tag),
71      m_maincpu(*this, "maincpu"),
72      m_beeper(*this, "beeper"),
7173      m_rtc(*this, "rtc"),
74      m_palette(*this, "palette"),
7275      m_palram(*this, "palram"),
73      m_maincpu(*this, "maincpu"),
74      m_beeper(*this, "beeper"),
75      m_rtc_portc(0),
76      m_palette(*this, "palette")
76      m_kanji_rom(*this, "kanji"),
77      m_vram(*this, "vram"),
78      m_rtc_portc(0)
7779   {
7880   }
7981
82   required_device<cpu_device> m_maincpu;
83   required_device<beep_device> m_beeper;
8084   required_device<msm58321_device> m_rtc;
85   required_device<palette_device> m_palette;
8186   required_shared_ptr<UINT16> m_palram;
87   required_region_ptr<UINT16> m_kanji_rom;
88   required_region_ptr<UINT16> m_vram;
8289
8390   DECLARE_READ16_MEMBER(pc100_vram_r);
8491   DECLARE_WRITE16_MEMBER(pc100_vram_w);
r241937r241938
100107   DECLARE_WRITE8_MEMBER(rtc_porta_w);
101108   DECLARE_READ8_MEMBER(rtc_portc_r);
102109   DECLARE_WRITE8_MEMBER(rtc_portc_w);
103   UINT16 *m_kanji_rom;
104   UINT16 *m_vram;
105110   UINT16 m_kanji_addr;
106111   UINT8 m_timer_mode;
107112
r241937r241938
123128   TIMER_DEVICE_CALLBACK_MEMBER(pc100_100hz_irq);
124129   TIMER_DEVICE_CALLBACK_MEMBER(pc100_50hz_irq);
125130   TIMER_DEVICE_CALLBACK_MEMBER(pc100_10hz_irq);
126   required_device<cpu_device> m_maincpu;
127   required_device<beep_device> m_beeper;
128131
132
129133   WRITE_LINE_MEMBER(rtc_portc_0_w) { m_rtc_portc = (m_rtc_portc & ~(1 << 0)) | ((state & 1) << 0); }
130134   WRITE_LINE_MEMBER(rtc_portc_1_w) { m_rtc_portc = (m_rtc_portc & ~(1 << 1)) | ((state & 1) << 1); }
131135   WRITE_LINE_MEMBER(rtc_portc_2_w) { m_rtc_portc = (m_rtc_portc & ~(1 << 2)) | ((state & 1) << 2); }
132136   WRITE_LINE_MEMBER(rtc_portc_3_w) { m_rtc_portc = (m_rtc_portc & ~(1 << 3)) | ((state & 1) << 3); }
133137   UINT8 m_rtc_portc;
134   required_device<palette_device> m_palette;
135138};
136139
137140void pc100_state::video_start()
r241937r241938
410413
411414void pc100_state::machine_start()
412415{
413   m_kanji_rom = (UINT16 *)(*memregion("kanji"));
414   m_vram = (UINT16 *)(*memregion("vram"));
415416}
416417
417418void pc100_state::machine_reset()
r241937r241938
523524
524525/* ROM definition */
525526ROM_START( pc100 )
526   ROM_REGION( 0x8000, "ipl", ROMREGION_ERASEFF )
527   ROM_REGION16_LE( 0x8000, "ipl", ROMREGION_ERASEFF )
527528   ROM_LOAD( "ipl.rom", 0x0000, 0x8000, CRC(fd54a80e) SHA1(605a1b598e623ba2908a14a82454b9d32ea3c331))
528529
529   ROM_REGION( 0x20000, "kanji", ROMREGION_ERASEFF )
530   ROM_REGION16_LE( 0x20000, "kanji", ROMREGION_ERASEFF )
530531   ROM_LOAD( "kanji.rom", 0x0000, 0x20000, BAD_DUMP CRC(29298591) SHA1(d10174553ceea556fc53fc4e685d939524a4f64b))
531532
532   ROM_REGION( 0x20000*4, "vram", ROMREGION_ERASEFF )
533   ROM_REGION16_LE( 0x20000*4, "vram", ROMREGION_ERASEFF )
533534ROM_END
534535
535536/* Driver */
trunk/src/mess/drivers/pc88va.c
r241937r241938
193193
194194void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect)
195195{
196   UINT16 *tvram = (UINT16 *)(*memregion("tvram"));
196   UINT16 *tvram = (UINT16 *)(memregion("tvram")->base());
197197   int offs,i;
198198
199199   offs = m_tsp.spr_offset;
r241937r241938
569569         return 0xffff;
570570      case 1: // TVRAM
571571      {
572         UINT16 *tvram = (UINT16 *)(*memregion("tvram"));
572         UINT16 *tvram = (UINT16 *)(memregion("tvram")->base());
573573
574574         if(((offset*2) & 0x30000) == 0)
575575            return tvram[offset];
r241937r241938
578578      }
579579      case 4:
580580      {
581         UINT16 *gvram = (UINT16 *)(*memregion("gvram"));
581         UINT16 *gvram = (UINT16 *)(memregion("gvram")->base());
582582
583583         return gvram[offset];
584584      }
585585      case 8: // kanji ROM
586586      case 9:
587587      {
588         UINT16 *knj_ram = (UINT16 *)(*memregion("kanji"));
588         UINT16 *knj_ram = (UINT16 *)(memregion("kanji")->base());
589589         UINT32 knj_offset;
590590
591591         knj_offset = (offset + (((m_bank_reg & 0x100) >> 8)*0x20000));
r241937r241938
600600      case 0xc: // Dictionary ROM
601601      case 0xd:
602602      {
603         UINT16 *dic_rom = (UINT16 *)(*memregion("dictionary"));
603         UINT16 *dic_rom = (UINT16 *)(memregion("dictionary")->base());
604604         UINT32 dic_offset;
605605
606606         dic_offset = (offset + (((m_bank_reg & 0x100) >> 8)*0x20000));
r241937r241938
620620         break;
621621      case 1: // TVRAM
622622      {
623         UINT16 *tvram = (UINT16 *)(*memregion("tvram"));
623         UINT16 *tvram = (UINT16 *)(memregion("tvram")->base());
624624
625625         if(((offset*2) & 0x30000) == 0)
626626            COMBINE_DATA(&tvram[offset]);
r241937r241938
628628      break;
629629      case 4: // TVRAM
630630      {
631         UINT16 *gvram = (UINT16 *)(*memregion("gvram"));
631         UINT16 *gvram = (UINT16 *)(memregion("gvram")->base());
632632
633633         COMBINE_DATA(&gvram[offset]);
634634      }
r241937r241938
636636      case 8: // kanji ROM, backup RAM at 0xb0000 - 0xb3fff
637637      case 9:
638638      {
639         UINT16 *knj_ram = (UINT16 *)(*memregion("kanji"));
639         UINT16 *knj_ram = (UINT16 *)(memregion("kanji")->base());
640640         UINT32 knj_offset;
641641
642642         knj_offset = ((offset) + (((m_bank_reg & 0x100) >> 8)*0x20000));
r241937r241938
12131213
12141214READ8_MEMBER(pc88va_state::backupram_dsw_r)
12151215{
1216   UINT16 *knj_ram = (UINT16 *)(*memregion("kanji"));
1216   UINT16 *knj_ram = (UINT16 *)(memregion("kanji")->base());
12171217
12181218   if(offset == 0)
12191219      return knj_ram[(0x50000 + 0x1fc2) / 2] & 0xff;
trunk/src/mess/drivers/sgi_ip2.c
r241937r241938
374374static ADDRESS_MAP_START(sgi_ip2_map, AS_PROGRAM, 32, sgi_ip2_state )
375375   AM_RANGE(0x00000000, 0x00ffffff) AM_RAM AM_SHARE("mainram")
376376   AM_RANGE(0x02100000, 0x0210ffff) AM_RAM AM_SHARE("bss") // ??? I don't understand the need for this...
377   AM_RANGE(0x30000000, 0x30017fff) AM_ROM AM_REGION("user1", 0)
377   AM_RANGE(0x30000000, 0x30017fff) AM_ROM AM_REGION("maincpu", 0)
378378   AM_RANGE(0x30800000, 0x30800003) AM_READWRITE8(sgi_ip2_m_but_r,         sgi_ip2_m_but_w,        0xffffffff)
379379   AM_RANGE(0x31000000, 0x31000003) AM_READWRITE16(sgi_ip2_m_quad_r,       sgi_ip2_m_quad_w,       0xffffffff)
380380   AM_RANGE(0x31800000, 0x31800003) AM_READ16(sgi_ip2_swtch_r,                                     0xffffffff)
r241937r241938
491491
492492DRIVER_INIT_MEMBER(sgi_ip2_state,sgi_ip2)
493493{
494   UINT32 *src = (UINT32*)(*memregion("user1"));
494   UINT32 *src = (UINT32*)(memregion("maincpu")->base());
495495   UINT32 *dst = m_mainram;
496496   memcpy(dst, src, 8);
497497
r241937r241938
505505***************************************************************************/
506506
507507ROM_START( sgi_ip2 )
508   ROM_REGION32_BE(0x18000, "user1", 0)
508   ROM_REGION32_BE(0x18000, "maincpu", 0)
509509   ROM_LOAD( "sgi-ip2-u91.nolabel.od",    0x00000, 0x8000, CRC(32e1f6b5) SHA1(2bd928c3fe2e364b9a38189158e9bad0e5271a59) )
510510   ROM_LOAD( "sgi-ip2-u92.nolabel.od",    0x08000, 0x8000, CRC(13dbfdb3) SHA1(3361fb62f7a8c429653700bccfc3e937f7508182) )
511511   ROM_LOAD( "sgi-ip2-u93.ip2.2-008.od",  0x10000, 0x8000, CRC(bf967590) SHA1(1aac48e4f5531a25c5482f64de5cd3c7a9931f11) )
trunk/src/mess/drivers/supracan.c
r241937r241938
120120         m_maincpu(*this, "maincpu"),
121121         m_soundcpu(*this, "soundcpu"),
122122         m_cart(*this, "cartslot"),
123         m_vram(*this, "vram"),
123124         m_soundram(*this, "soundram"),
124125         m_gfxdecode(*this, "gfxdecode"),
125126         m_palette(*this, "palette")
r241937r241938
130131   required_device<cpu_device> m_maincpu;
131132   required_device<cpu_device> m_soundcpu;
132133   required_device<generic_slot_device> m_cart;
134
135   required_shared_ptr<UINT16> m_vram;
136   required_shared_ptr<UINT8> m_soundram;
137
133138   DECLARE_READ16_MEMBER(_68k_soundram_r);
134139   DECLARE_WRITE16_MEMBER(_68k_soundram_w);
135140   DECLARE_READ8_MEMBER(_6502_soundmem_r);
r241937r241938
143148   DECLARE_WRITE16_MEMBER(sound_w);
144149   DECLARE_READ16_MEMBER(video_r);
145150   DECLARE_WRITE16_MEMBER(video_w);
146   DECLARE_READ16_MEMBER(vram_r);
147151   DECLARE_WRITE16_MEMBER(vram_w);
148152   DECLARE_WRITE16_MEMBER(paletteram_w);
149153   acan_dma_regs_t m_acan_dma_regs;
150154   acan_sprdma_regs_t m_acan_sprdma_regs;
151155
152156   UINT16 m_m6502_reset;
153   required_shared_ptr<UINT8> m_soundram;
154157   UINT8 m_soundlatch;
155158   UINT8 m_soundcpu_irq_src;
156159   UINT8 m_sound_irq_enable_reg;
r241937r241938
161164   emu_timer *m_hbl_timer;
162165   emu_timer *m_line_on_timer;
163166   emu_timer *m_line_off_timer;
164   UINT16 *m_vram;
165   UINT16 *m_vram_swapped;
166   UINT8 *m_vram_addr_swapped;
167167
168   dynamic_buffer m_vram_addr_swapped;
169
168170   UINT16 *m_pram;
169171
170172   UINT16 m_sprite_count;
r241937r241938
428430{
429431   m_sprite_final_bitmap.allocate(1024, 1024, BITMAP_FORMAT_IND16);
430432
431   m_vram = (UINT16*)(*memregion("ram_gfx"));
432   m_vram_swapped = (UINT16*)(*memregion("ram_gfx2"));
433   m_vram_addr_swapped = (UINT8*)(*memregion("ram_gfx3")); // hack for 1bpp layer at startup
433   m_vram_addr_swapped.resize(0x20000); // hack for 1bpp layer at startup
434   m_gfxdecode->gfx(4)->set_source(m_vram_addr_swapped);
435   m_gfxdecode->gfx(4)->set_xormask(0);
434436
435437   m_tilemap_sizes[0][0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(supracan_state::get_supracan_tilemap0_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
436438   m_tilemap_sizes[0][1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(supracan_state::get_supracan_tilemap0_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);
r241937r241938
10951097   m_vram_addr_swapped[swapped_offset] = byte;
10961098}
10971099
1098
1099READ16_MEMBER( supracan_state::vram_r )
1100{
1101   return m_vram[offset];
1102}
1103
1104
11051100WRITE16_MEMBER( supracan_state::vram_w )
11061101{
11071102   COMBINE_DATA(&m_vram[offset]);
11081103
1109   // store a byteswapped vesrion for easier gfx-decode
1110   data = m_vram[offset];
1111   data = ((data & 0x00ff)<<8) | ((data & 0xff00)>>8);
1112   m_vram_swapped[offset] = data;
1113
11141104   // hack for 1bpp layer at startup
1115   write_swapped_byte(offset*2+1, (data & 0xff00)>>8);
1116   write_swapped_byte(offset*2, (data & 0x00ff));
1105   write_swapped_byte(offset*2, (data & 0xff00)>>8);
1106   write_swapped_byte(offset*2+1, (data & 0x00ff));
11171107
11181108   // mark tiles of each depth as dirty
11191109   m_gfxdecode->gfx(0)->mark_dirty((offset*2)/(64));
r241937r241938
11371127
11381128   AM_RANGE( 0xf00000, 0xf001ff ) AM_READWRITE(video_r, video_w)
11391129   AM_RANGE( 0xf00200, 0xf003ff ) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
1140   AM_RANGE( 0xf40000, 0xf5ffff ) AM_READWRITE(vram_r, vram_w)
1130   AM_RANGE( 0xf40000, 0xf5ffff ) AM_RAM_WRITE(vram_w) AM_SHARE("vram")
11411131   AM_RANGE( 0xfc0000, 0xfdffff ) AM_MIRROR(0x30000) AM_RAM /* System work ram */
11421132ADDRESS_MAP_END
11431133
r241937r241938
18631853
18641854
18651855static GFXDECODE_START( supracan )
1866   GFXDECODE_ENTRY( "ram_gfx2",  0, supracan_gfx8bpp,   0, 1 )
1867   GFXDECODE_ENTRY( "ram_gfx2",  0, supracan_gfx4bpp,   0, 0x10 )
1868   GFXDECODE_ENTRY( "ram_gfx2",  0, supracan_gfx2bpp,   0, 0x40 )
1869   GFXDECODE_ENTRY( "ram_gfx2",  0, supracan_gfx1bpp,   0, 0x80 )
1870   GFXDECODE_ENTRY( "ram_gfx3",  0, supracan_gfx1bpp_alt,   0, 0x80 )
1856   GFXDECODE_RAM( "vram",  0, supracan_gfx8bpp,   0, 1 )
1857   GFXDECODE_RAM( "vram",  0, supracan_gfx4bpp,   0, 0x10 )
1858   GFXDECODE_RAM( "vram",  0, supracan_gfx2bpp,   0, 0x40 )
1859   GFXDECODE_RAM( "vram",  0, supracan_gfx1bpp,   0, 0x80 )
1860   GFXDECODE_RAM( "vram",  0, supracan_gfx1bpp_alt,   0, 0x80 )
18711861GFXDECODE_END
18721862
18731863INTERRUPT_GEN_MEMBER(supracan_state::supracan_irq)
r241937r241938
19311921
19321922
19331923ROM_START( supracan )
1934   ROM_REGION( 0x20000, "ram_gfx", ROMREGION_ERASEFF )
1935   ROM_REGION( 0x20000, "ram_gfx2", ROMREGION_ERASEFF )
1936   ROM_REGION( 0x20000, "ram_gfx3", ROMREGION_ERASEFF )
19371924ROM_END
19381925
19391926
trunk/src/mess/drivers/svmu.c
r241937r241938
2929      : driver_device(mconfig, type, tag),
3030         m_maincpu(*this, "maincpu"),
3131         m_flash(*this, "flash"),
32         m_speaker(*this, "speaker")
32         m_speaker(*this, "speaker"),
33         m_bios(*this, "bios")
3334      { }
3435
3536   required_device<lc8670_cpu_device> m_maincpu;
3637   required_device<intelfsh8_device> m_flash;
3738   required_device<speaker_sound_device> m_speaker;
39   required_region_ptr<UINT8> m_bios;
3840
3941   DECLARE_PALETTE_INIT(svmu);
4042   virtual void machine_reset();
r241937r241938
4850   DECLARE_QUICKLOAD_LOAD_MEMBER( svmu );
4951
5052private:
51   UINT8 *     m_bios;
5253   UINT8       m_page;
5354};
5455
r241937r241938
145146
146147void svmu_state::machine_reset()
147148{
148   m_bios = (UINT8*)(*memregion("bios"));
149149   m_page = 0;
150150}
151151
trunk/src/mess/drivers/ti89.c
r241937r241938
426426
427427void ti68k_state::machine_start()
428428{
429   m_rom_base = (UINT16 *)(*memregion("flash"));
430429   int i;
431430
432431   m_flash_mem = !((m_rom_base[0x32] & 0x0f) != 0);
trunk/src/mess/drivers/ti99_4p.c
r241937r241938
5151#define TMS9901_TAG "tms9901"
5252#define SGCPU_TAG "sgcpu"
5353
54#define SAMSMEM_TAG "samsmem"
55#define PADMEM_TAG "padmem"
56
5754#define VERBOSE 1
5855#define LOG logerror
5956
r241937r241938
127124   UINT16  *m_rom6b;
128125
129126   // AMS RAM (1 Mib)
130   UINT16 *m_ram;
127   dynamic_array<UINT16> m_ram;
131128
132129   // Scratch pad ram (1 KiB)
133   UINT16 *m_scratchpad;
130   dynamic_array<UINT16> m_scratchpad;
134131
135132   // First joystick. 6 for TI-99/4A
136133   int     m_firstjoy;
r241937r241938
814811
815812void ti99_4p_state::machine_start()
816813{
817   m_ram = (UINT16*)(*memregion(SAMSMEM_TAG));
818   m_scratchpad = (UINT16*)(*memregion(PADMEM_TAG));
814   m_ram.resize(0x80000/2);
815   m_scratchpad.resize(0x400/2);
819816
820817   m_peribox->senila(CLEAR_LINE);
821818   m_peribox->senilb(CLEAR_LINE);
r241937r241938
824821
825822   m_ready_line = m_ready_line_dmux = ASSERT_LINE;
826823
827   UINT16 *rom = (UINT16*)(*memregion("maincpu"));
824   UINT16 *rom = (UINT16*)(memregion("maincpu")->base());
828825   m_rom0  = rom + 0x2000;
829826   m_dsr   = rom + 0x6000;
830827   m_rom6a = rom + 0x3000;
r241937r241938
915912   ROM_REGION16_BE(0x10000, "maincpu", 0)
916913   ROM_LOAD16_BYTE("sgcpu_hb.bin", 0x0000, 0x8000, CRC(aa100730) SHA1(35e585b2dcd3f2a0005bebb15ede6c5b8c787366) ) /* system ROMs */
917914   ROM_LOAD16_BYTE("sgcpu_lb.bin", 0x0001, 0x8000, CRC(2a5dc818) SHA1(dec141fe2eea0b930859cbe1ebd715ac29fa8ecb) ) /* system ROMs */
918   ROM_REGION16_BE(0x080000, SAMSMEM_TAG, 0)
919   ROM_FILL(0x000000, 0x080000, 0x0000)
920   ROM_REGION16_BE(0x0400, PADMEM_TAG, 0)
921   ROM_FILL(0x000000, 0x0400, 0x0000)
922915ROM_END
923916
924917/*    YEAR  NAME      PARENT   COMPAT   MACHINE      INPUT    INIT      COMPANY     FULLNAME */
trunk/src/mess/drivers/tsispch.c
r241937r241938
241241
242242DRIVER_INIT_MEMBER(tsispch_state,prose2k)
243243{
244   UINT8 *dspsrc = (UINT8 *)(*memregion("dspprgload"));
245   UINT32 *dspprg = (UINT32 *)(*memregion("dspprg"));
244   UINT8 *dspsrc = (UINT8 *)(memregion("dspprgload")->base());
245   UINT32 *dspprg = (UINT32 *)(memregion("dspprg")->base());
246246   fprintf(stderr,"driver init\n");
247247   // unpack 24 bit 7720 data into 32 bit space and shuffle it so it can run as 7725 code
248248   // data format as-is in dspsrc: (L = always 0, X = doesn't matter)
trunk/src/mess/drivers/x68k.c
r241937r241938
15411541{
15421542   address_space &space = m_maincpu->space(AS_PROGRAM);
15431543   /*  Install RAM handlers  */
1544   m_spriteram = (UINT16*)(*memregion("user1"));
1544   m_spriteram = (UINT16*)(memregion("user1")->base());
15451545   space.install_readwrite_bank(0x000000,m_ram->size()-1,0xffffffff,0,"bank1");
15461546   membank("bank1")->set_base(m_ram->pointer());
15471547
trunk/src/mess/includes/alesis.h
r241937r241938
4545private:
4646   static const device_timer_id TIMER_DAC_UPDATE = 1;
4747   required_device<dac_device> m_dac;
48   required_region_ptr<INT8> m_samples;
4849
4950   emu_timer * m_dac_update_timer;
50   INT8 *      m_samples;
5151   bool        m_output_active;
5252   int         m_count;
5353   int         m_shift;
trunk/src/mess/includes/gba.h
r241937r241938
268268   void draw_modes(int mode, int submode, int y, UINT32* line0, UINT32* line1, UINT32* line2, UINT32* line3, UINT32* lineOBJ, UINT32* lineOBJWin, UINT32* lineMix, int bpp);
269269
270270protected:
271   required_memory_region m_region_maincpu;
271   required_region_ptr<UINT32> m_region_maincpu;
272272   required_ioport m_io_inputs;
273273   required_ioport m_bios_hack;
274274};
trunk/src/mess/includes/ti89.h
r241937r241938
1818      : driver_device(mconfig, type, tag),
1919         m_maincpu(*this, "maincpu"),
2020         m_flash(*this, "flash"),
21         m_rom_base(*this, "flash"),
2122         m_io_bit0(*this, "BIT0"),
2223         m_io_bit1(*this, "BIT1"),
2324         m_io_bit2(*this, "BIT2"),
r241937r241938
3031
3132   required_device<cpu_device> m_maincpu;
3233   required_device<sharp_unk128mbit_device> m_flash;
34   required_region_ptr<UINT16> m_rom_base;
3335   required_ioport m_io_bit0;
3436   required_ioport m_io_bit1;
3537   required_ioport m_io_bit2;
r241937r241938
4749   bool m_flash_mem;
4850   UINT32 m_initial_pc;
4951
50   UINT16 *m_rom_base;
51
5252   // keyboard
5353   UINT16 m_kb_mask;
5454   UINT8 m_on_key;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team