Previous 199869 Revisions Next

r44361 Saturday 23rd January, 2016 at 16:30:14 UTC by Ryan Holtz
Yet more this==NULL fixes
[src/devices/sound]es5506.cpp namco.cpp namco.h scsp.cpp scsp.h tms5110.cpp tms5110.h
[src/mame/drivers]cps3.cpp jaguar.cpp segac2.cpp
[src/mame/includes]cps3.h jaguar.h
[src/mame/machine]amstrad.cpp
[src/mame/video]avgdvg.cpp

trunk/src/devices/sound/es5506.cpp
r252872r252873
195195   m_stream = machine().sound().stream_alloc(*this, 0, 2 * channels, clock() / (16*32));
196196
197197   /* initialize the regions */
198   m_region_base[0] = m_region0 ? (UINT16 *)machine().root_device().memregion(m_region0)->base() : nullptr;
199   m_region_base[1] = m_region1 ? (UINT16 *)machine().root_device().memregion(m_region1)->base() : nullptr;
200   m_region_base[2] = m_region2 ? (UINT16 *)machine().root_device().memregion(m_region2)->base() : nullptr;
201   m_region_base[3] = m_region3 ? (UINT16 *)machine().root_device().memregion(m_region3)->base() : nullptr;
198   m_region_base[0] = m_region_base[1] = m_region_base[2] = m_region_base[3] = nullptr;
199   if (m_region0)
200   {
201      memory_region *region0 = machine().root_device().memregion(m_region0);
202      if (region0 != nullptr)
203      {
204         m_region_base[0] = (UINT16 *)region0->base();
205      }
206   }
207   if (m_region1)
208   {
209      memory_region *region1 = machine().root_device().memregion(m_region1);
210      if (region1 != nullptr)
211      {
212         m_region_base[1] = (UINT16 *)region1->base();
213      }
214   }
215   if (m_region2)
216   {
217      memory_region *region2 = machine().root_device().memregion(m_region2);
218      if (region2 != nullptr)
219      {
220         m_region_base[2] = (UINT16 *)region2->base();
221      }
222   }
223   if (m_region3)
224   {
225      memory_region *region3 = machine().root_device().memregion(m_region3);
226      if (region3 != nullptr)
227      {
228         m_region_base[3] = (UINT16 *)region3->base();
229      }
230   }
202231
203232   /* initialize the rest of the structure */
204233   m_master_clock = clock();
trunk/src/devices/sound/namco.cpp
r252872r252873
3737
3838namco_audio_device::namco_audio_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)
3939   : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__),
40      device_sound_interface(mconfig, *this),
41      m_last_channel(nullptr),
42      m_soundregs(nullptr),
43      m_wavedata(nullptr),
44      m_wave_size(0),
45      m_sound_enable(0),
46      m_stream(nullptr),
47      m_namco_clock(0),
48      m_sample_rate(0),
49      m_f_fracbits(0),
50      m_voices(0),
51      m_stereo(0)
40   , device_sound_interface(mconfig, *this)
41   , m_wave_region(*this, tag)
42   , m_last_channel(nullptr)
43   , m_soundregs(nullptr)
44   , m_wavedata(nullptr)
45   , m_wave_size(0)
46   , m_sound_enable(0)
47   , m_stream(nullptr)
48   , m_namco_clock(0)
49   , m_sample_rate(0)
50   , m_f_fracbits(0)
51   , m_voices(0)
52   , m_stereo(0)
5253{
5354}
5455
r252872r252873
9596   logerror("Namco: freq fractional bits = %d: internal freq = %d, output freq = %d\n", m_f_fracbits, m_namco_clock, m_sample_rate);
9697
9798   /* build the waveform table */
98   build_decoded_waveform(region()->base());
99   build_decoded_waveform(m_wave_region != NULL ? m_wave_region->base() : NULL);
99100
100101   /* get stream channels */
101102   if (m_stereo)
r252872r252873
109110   /* register with the save state system */
110111   save_pointer(NAME(m_soundregs), 0x400);
111112
113<<<<<<< HEAD
112114   if (region() == nullptr)
115=======
116   if (m_wave_region == NULL)
117>>>>>>> Yet more this==NULL fixes
113118      save_pointer(NAME(m_wavedata), 0x400);
114119
115120   save_item(NAME(m_voices));
trunk/src/devices/sound/namco.h
r252872r252873
5353   void update_namco_waveform(int offset, UINT8 data);
5454   UINT32 namco_update_one(stream_sample_t *buffer, int length, const INT16 *wave, UINT32 counter, UINT32 freq);
5555
56   /* waveform region */
57   optional_memory_region m_wave_region;
58
5659   /* data about the sound system */
5760   sound_channel m_channel_list[MAX_VOICES];
5861   sound_channel *m_last_channel;
trunk/src/devices/sound/scsp.cpp
r252872r252873
149149      m_roffset(0),
150150      m_irq_cb(*this),
151151      m_main_irq_cb(*this),
152      m_ram_region(*this, tag),
152153      m_BUFPTR(0),
153154      m_SCSPRAM(nullptr),
154155      m_SCSPRAM_LENGTH(0),
r252872r252873
515516      m_Master=0;
516517   }
517518
518   m_SCSPRAM = region()->base();
519   if (m_SCSPRAM)
519   if (m_ram_region)
520520   {
521      m_SCSPRAM_LENGTH = region()->bytes();
522      m_DSP.SCSPRAM = (UINT16 *)m_SCSPRAM;
523      m_DSP.SCSPRAM_LENGTH = m_SCSPRAM_LENGTH/2;
524      m_SCSPRAM += m_roffset;
521      m_SCSPRAM = m_ram_region->base();
522      if (m_SCSPRAM)
523      {
524         m_SCSPRAM_LENGTH = m_ram_region->bytes();
525         m_DSP.SCSPRAM = (UINT16 *)m_SCSPRAM;
526         m_DSP.SCSPRAM_LENGTH = m_SCSPRAM_LENGTH/2;
527         m_SCSPRAM += m_roffset;
528      }
525529   }
526530
527531   m_timerA = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scsp_device::timerA_cb), this));
trunk/src/devices/sound/scsp.h
r252872r252873
104104   int m_roffset;                /* offset in the region */
105105   devcb_write8       m_irq_cb;  /* irq callback */
106106   devcb_write_line   m_main_irq_cb;
107   optional_memory_region m_ram_region;
107108
108109   union
109110   {
trunk/src/devices/sound/tms5110.cpp
r252872r252873
10491049
10501050void tms5110_device::device_start()
10511051{
1052   m_table = region()->base();
1052   m_table = NULL;
1053   if (m_table_region != NULL)
1054   {
1055      m_table = m_table_region->base();
1056   }
10531057
10541058   set_variant(TMS5110_IS_TMS5110A);
10551059
r252872r252873
15321536
15331537tms5110_device::tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
15341538   : device_t(mconfig, TMS5110, "TMS5110", tag, owner, clock, "tms5110", __FILE__),
1535      device_sound_interface(mconfig, *this),
1536      m_m0_cb(*this),
1537      m_m1_cb(*this),
1538      m_addr_cb(*this),
1539      m_data_cb(*this),
1540      m_romclk_cb(*this)
1539   , device_sound_interface(mconfig, *this)
1540   , m_table_region(*this, tag)
1541   , m_m0_cb(*this)
1542   , m_m1_cb(*this)
1543   , m_addr_cb(*this)
1544   , m_data_cb(*this)
1545   , m_romclk_cb(*this)
15411546{
15421547}
15431548
15441549tms5110_device::tms5110_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)
1545   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
1546      device_sound_interface(mconfig, *this),
1547      m_m0_cb(*this),
1548      m_m1_cb(*this),
1549      m_addr_cb(*this),
1550      m_data_cb(*this),
1551      m_romclk_cb(*this)
1550   : device_t(mconfig, type, name, tag, owner, clock, shortname, source)
1551   , device_sound_interface(mconfig, *this)
1552   , m_table_region(*this, tag)
1553   , m_m0_cb(*this)
1554   , m_m1_cb(*this)
1555   , m_addr_cb(*this)
1556   , m_data_cb(*this)
1557   , m_romclk_cb(*this)
15521558{
15531559}
15541560
trunk/src/devices/sound/tms5110.h
r252872r252873
9797   void parse_frame();
9898
9999   // internal state
100   /* table region */
101   optional_memory_region m_table_region;
102
100103   /* coefficient tables */
101104   int m_variant;                /* Variant of the 5110 - see tms5110.h */
102105
trunk/src/mame/drivers/cps3.cpp
r252872r252873
788788   m_altEncryption = altEncryption;
789789
790790   // cache pointers to regions
791   m_user4region = memregion("user4")->base();
792   m_user5region = memregion("user5")->base();
791   if (m_user4_region)
792   {
793      m_user4 = m_user4_region->base();
794   }
795   else
796   {
797      m_user4 = auto_alloc_array(machine(), UINT8, USER4REGION_LENGTH);
798   }
793799
794   if (!m_user4region) m_user4region = auto_alloc_array(machine(), UINT8, USER4REGION_LENGTH);
795   if (!m_user5region) m_user5region = auto_alloc_array(machine(), UINT8, USER5REGION_LENGTH);
796   m_cps3sound->set_base((INT8*)m_user5region);
800   if (m_user5_region)
801   {
802      m_user5 = m_user5_region->base();
803   }
804   else
805   {
806      m_user5 = auto_alloc_array(machine(), UINT8, USER5REGION_LENGTH);
807   }
797808
809   m_cps3sound->set_base((INT8*)m_user5);
810
798811   // set strict verify
799812   m_maincpu->sh2drc_set_options(SH2DRC_STRICT_VERIFY);
800813   m_maincpu->sh2drc_add_fastram(0x02000000, 0x0207ffff, 0, &m_mainram[0]);
r252872r252873
14681481
14691482   /* make a copy in the linear memory region we actually use for drawing etc.  having it stored in interleaved flash roms isnt' very useful */
14701483   {
1471      UINT32* romdata = (UINT32*)m_user5region;
1484      UINT32* romdata = (UINT32*)m_user5;
14721485      int real_offset = 0;
14731486      UINT32 newdata;
14741487
r252872r252873
15751588
15761589   /* copy data into regions to execute from */
15771590   {
1578      UINT32* romdata =  (UINT32*)m_user4region;
1591      UINT32* romdata =  (UINT32*)m_user4;
15791592      UINT32* romdata2 = (UINT32*)m_decrypted_gamerom;
15801593      int real_offset = 0;
15811594      UINT32 newdata;
r252872r252873
17991812         if (data & 0x0002)
18001813         {
18011814            int i;
1802            UINT16* src = (UINT16*)m_user5region;
1815            UINT16* src = (UINT16*)m_user5;
18031816         //  if(DEBUG_PRINTF) printf("CPS3 pal dma start %08x (real: %08x) dest %08x fade %08x other2 %08x (length %04x)\n", m_paldma_source, m_paldma_realsource, m_paldma_dest, m_paldma_fade, m_paldma_other2, m_paldma_length);
18041817
18051818            for (i=0;i<m_paldma_length;i++)
r252872r252873
18731886
18741887void cps3_state::cps3_do_char_dma( UINT32 real_source, UINT32 real_destination, UINT32 real_length )
18751888{
1876   UINT8* sourcedata = (UINT8*)m_user5region;
1889   UINT8* sourcedata = (UINT8*)m_user5;
18771890   int length_remaining;
18781891
18791892   m_last_normal_byte = 0;
r252872r252873
19561969
19571970void cps3_state::cps3_do_alt_char_dma( UINT32 src, UINT32 real_dest, UINT32 real_length )
19581971{
1959   UINT8* px = (UINT8*)m_user5region;
1972   UINT8* px = (UINT8*)m_user5;
19601973   UINT32 start = real_dest;
19611974   UINT32 ds = real_dest;
19621975
r252872r252873
22992312// make a copy in the regions we execute code / draw gfx from
23002313void cps3_state::copy_from_nvram()
23012314{
2302   UINT32* romdata = (UINT32*)m_user4region;
2315   UINT32* romdata = (UINT32*)m_user4;
23032316   UINT32* romdata2 = (UINT32*)m_decrypted_gamerom;
23042317   int i;
23052318   /* copy + decrypt program roms which have been loaded from flashroms/nvram */
r252872r252873
23362349      int flashnum = 0;
23372350      int countoffset = 0;
23382351
2339      romdata = (UINT32*)m_user5region;
2352      romdata = (UINT32*)m_user5;
23402353      for (thebase = 0;thebase < len/2; thebase+=0x200000)
23412354      {
23422355      //  printf("flashnums %d. %d\n",flashnum, flashnum+1);
trunk/src/mame/drivers/jaguar.cpp
r252872r252873
427427   }
428428
429429   /* configure banks for gfx/sound ROMs */
430   UINT8 *romboard = memregion("romboard")->base();
431   if (romboard != nullptr)
430   if (m_romboard_region != nullptr)
432431   {
432      UINT8 *romboard = m_romboard_region->base();
433
433434      /* graphics banks */
434435      if (m_is_r3000)
435436      {
r252872r252873
617618   }
618619
619620   /* adjust banking */
620   if (memregion("romboard")->base())
621   if (m_romboard_region != NULL)
621622   {
622623      membank("mainsndbank")->set_entry((data >> 1) & 7);
623624      membank("dspsndbank")->set_entry((data >> 1) & 7);
r252872r252873
776777   logerror("%08X:latch_w(%X)\n", space.device().safe_pcbase(), data);
777778
778779   /* adjust banking */
779   if (memregion("romboard")->base())
780   if (m_romboard_region != NULL)
780781   {
781782      if (m_is_r3000)
783      {
782784         membank("maingfxbank")->set_entry(data & 1);
785      }
783786      membank("gpugfxbank")->set_entry(data & 1);
784787   }
785788}
r252872r252873
19151918
19161919void jaguar_state::fix_endian( UINT32 addr, UINT32 size )
19171920{
1918   UINT8 j[4], *ram = memregion("maincpu")->base();
1921   UINT8 j[4];
1922   UINT8 *ram = memregion("maincpu")->base();
19191923   UINT32 i;
19201924   size += addr;
19211925   logerror("File Loaded to address range %X to %X\n",addr,size-1);
trunk/src/mame/drivers/segac2.cpp
r252872r252873
9898{
9999public:
100100   segac2_state(const machine_config &mconfig, device_type type, const char *tag)
101   : md_base_state(mconfig, type, tag),
102   m_paletteram(*this, "paletteram"),
103   m_upd7759(*this, "upd"),
104   m_screen(*this, "screen"),
105   m_palette(*this, "palette") { }
101      : md_base_state(mconfig, type, tag)
102      , m_paletteram(*this, "paletteram")
103      , m_upd_region(*this, "upd")
104      , m_upd7759(*this, "upd")
105      , m_screen(*this, "screen")
106      , m_palette(*this, "palette")
107   {
108   }
106109
107110   // for Print Club only
108111   int m_cam_data;
r252872r252873
110113   int m_segac2_enable_display;
111114
112115   required_shared_ptr<UINT16> m_paletteram;
116   optional_memory_region m_upd_region;
113117
114118   /* protection-related tracking */
115119   segac2_prot_delegate m_prot_func;     /* emulation of protection chip */
r252872r252873
244248
245249   /* determine how many sound banks */
246250   m_sound_banks = 0;
247   if (memregion("upd")->base())
248      m_sound_banks = memregion("upd")->bytes() / 0x20000;
251   if (m_upd_region != NULL)
252   {
253      m_sound_banks = m_upd_region->bytes() / 0x20000;
254   }
249255
250256   /* reset the protection */
251257   m_prot_write_buf = 0;
r252872r252873
934940
935941static INPUT_PORTS_START( wwmarine )
936942   PORT_INCLUDE( systemc_generic )
937   
943
938944   PORT_MODIFY("P1")
939945   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // Button 1
940946   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // Button 2
trunk/src/mame/includes/cps3.h
r252872r252873
1414class cps3_state : public driver_device
1515{
1616public:
17<<<<<<< HEAD
1718   cps3_state(const machine_config &mconfig, device_type type, const char *tag)
18      : driver_device(mconfig, type, tag),
19      m_maincpu(*this, "maincpu"),
20      m_gfxdecode(*this, "gfxdecode"),
21      m_palette(*this, "palette"),
22      m_cps3sound(*this, "cps3sound"),
23      m_mainram(*this, "mainram"),
24      m_spriteram(*this, "spriteram"),
25      m_colourram(*this, "colourram"),
26      m_tilemap20_regs_base(*this, "tmap20_regs"),
27      m_tilemap30_regs_base(*this, "tmap30_regs"),
28      m_tilemap40_regs_base(*this, "tmap40_regs"),
29      m_tilemap50_regs_base(*this, "tmap50_regs"),
30      m_fullscreenzoom(*this, "fullscreenzoom"),
31      m_0xc0000000_ram(*this, "0xc0000000_ram"),
32      m_decrypted_gamerom(*this, "decrypted_gamerom"),
33      m_0xc0000000_ram_decrypted(*this, "0xc0000000_ram_decrypted")
34   { }
19      : driver_device(mconfig, type, tag)
20      , m_maincpu(*this, "maincpu")
21      , m_gfxdecode(*this, "gfxdecode")
22      , m_palette(*this, "palette")
23      , m_cps3sound(*this, "cps3sound")
24      , m_mainram(*this, "mainram")
25      , m_spriteram(*this, "spriteram")
26      , m_colourram(*this, "colourram")
27      , m_tilemap20_regs_base(*this, "tmap20_regs")
28      , m_tilemap30_regs_base(*this, "tmap30_regs")
29      , m_tilemap40_regs_base(*this, "tmap40_regs")
30      , m_tilemap50_regs_base(*this, "tmap50_regs")
31      , m_fullscreenzoom(*this, "fullscreenzoom")
32      , m_0xc0000000_ram(*this, "0xc0000000_ram")
33      , m_decrypted_gamerom(*this, "decrypted_gamerom")
34      , m_0xc0000000_ram_decrypted(*this, "0xc0000000_ram_decrypted")
35      , m_user4_region(*this, "user4")
36      , m_user5_region(*this, "user5")
37   {
38   }
3539
3640   required_device<sh2_device> m_maincpu;
3741   required_device<gfxdecode_device> m_gfxdecode;
r252872r252873
5054   required_shared_ptr<UINT32> m_decrypted_gamerom;
5155   required_shared_ptr<UINT32> m_0xc0000000_ram_decrypted;
5256
57   optional_memory_region      m_user4_region;
58   optional_memory_region      m_user5_region;
59
5360   fujitsu_29f016a_device *m_simm[7][8];
5461   UINT32 m_cram_gfxflash_bank;
5562   std::unique_ptr<UINT32[]> m_char_ram;
r252872r252873
6168   std::unique_ptr<UINT32[]> m_mame_colours;
6269   bitmap_rgb32 m_renderbuffer_bitmap;
6370   rectangle m_renderbuffer_clip;
64   UINT8* m_user4region;
71   UINT8* m_user4;
6572   UINT32 m_key1;
6673   UINT32 m_key2;
6774   int m_altEncryption;
r252872r252873
8188   int m_last_normal_byte;
8289   unsigned short m_lastb;
8390   unsigned short m_lastb2;
84   UINT8* m_user5region;
91   UINT8* m_user5;
8592
8693   DECLARE_READ32_MEMBER(cps3_ssram_r);
8794   DECLARE_WRITE32_MEMBER(cps3_ssram_w);
trunk/src/mame/includes/jaguar.h
r252872r252873
4343         m_shared_ram(*this, "sharedram"),
4444         m_gpu_ram(*this, "gpuram"),
4545         m_gpu_clut(*this, "gpuclut"),
46         m_romboard_region(*this, "romboard"),
4647         m_is_r3000(false),
4748         m_is_cojag(false),
4849         m_hacks_enabled(false),
r252872r252873
8384   required_shared_ptr<UINT32> m_shared_ram;
8485   required_shared_ptr<UINT32> m_gpu_ram;
8586   required_shared_ptr<UINT32> m_gpu_clut;
87   optional_memory_region      m_romboard_region;
8688
8789   // configuration
8890   bool m_is_r3000;
trunk/src/mame/machine/amstrad.cpp
r252872r252873
11061106   amstrad_state *state = machine.driver_data<amstrad_state>();
11071107   cpc_expansion_slot_device* exp_port = state->m_exp;
11081108
1109   while(exp_port != nullptr)
1109   while (exp_port != nullptr)
11101110   {
11111111      device_t* temp;
11121112
r252872r252873
11171117
11181118      // if it's not what we're looking for, then check the expansion port on this expansion device. if it exists.
11191119      temp = dynamic_cast<device_t*>(exp_port->get_card_device());
1120      if(temp == nullptr)
1120      if (temp == nullptr)
1121      {
11211122         return nullptr; // no device attached
1123      }
1124
11221125      exp_port = temp->subdevice<cpc_expansion_slot_device>("exp");
1123      if(exp_port == nullptr)
1126      if (exp_port == nullptr)
1127      {
11241128         return nullptr;  // we're at the end of the chain
1129      }
11251130   }
11261131   return nullptr;
11271132}
r252872r252873
20002005   // expansion devices know the selected ROM by monitoring I/O writes to DFxx
20012006   // there are no signals related to which ROM is selected
20022007   cpc_expansion_slot_device* exp_port = m_exp;
2003   while(exp_port != nullptr)
2008   while (exp_port != nullptr)
20042009   {
20052010      device_cpc_expansion_card_interface* temp;
20062011      device_t* temp_dev;
20072012
20082013      temp = dynamic_cast<device_cpc_expansion_card_interface*>(exp_port->get_card_device());
20092014      temp_dev = dynamic_cast<device_t*>(exp_port->get_card_device());
2010      if(temp != nullptr)
2015      if (temp != nullptr)
20112016      {
20122017         temp->set_rom_bank(data);
2018         exp_port = temp_dev->subdevice<cpc_expansion_slot_device>("exp");
20132019      }
2014      exp_port = temp_dev->subdevice<cpc_expansion_slot_device>("exp");
2020      else
2021      {
2022         exp_port = NULL;
2023      }
20152024   }
20162025
20172026   amstrad_rethinkMemory();
r252872r252873
29062915void amstrad_state::enumerate_roms()
29072916{
29082917   UINT8 m_rom_count = 1;
2909   device_t* romexp;
2910   rom_image_device* romimage;
29112918   UINT8 *rom = m_region_maincpu->base();
2912   char str[20];
2913   int i;
2914   bool slot3 = false,slot7 = false;
29152919
2920   bool slot7 = false;
29162921   if (m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000)
29172922   {
29182923      UINT8 *crt = m_region_cart->base();
29192924      int bank_mask = (m_cart->get_rom_size() / 0x4000) - 1;
29202925
29212926      /* ROMs are stored on the inserted cartridge in the Plus/GX4000 */
2922      for(i=0; i<128; i++)  // fill ROM table
2927      for (int i = 0; i < 128; i++) // fill ROM table
2928      {
29232929         m_Amstrad_ROM_Table[i] = &crt[0x4000];
2924      for(i=128;i<160;i++)
2930      }
2931
2932      for(int i = 128; i < 160; i++)
2933      {
29252934         m_Amstrad_ROM_Table[i] = &crt[((i - 128) & bank_mask) * 0x4000];
2935      }
29262936      m_Amstrad_ROM_Table[7] = &crt[0xc000];
29272937      slot7 = true;
29282938   }
29292939   else
29302940   {
29312941      /* slot 0 is always BASIC, as is any unused slot */
2932      for(i=0; i<256; i++)
2942      for (int i = 0; i<256; i++)
2943      {
29332944         m_Amstrad_ROM_Table[i] = &rom[0x014000];
2945      }
2946
29342947      /* AMSDOS ROM -- TODO: exclude from 464 unless a DDI-1 device is connected */
29352948      m_Amstrad_ROM_Table[7] = &rom[0x018000];
29362949      slot7 = true;
29372950   }
29382951
29392952   /* MSX-DOS BIOS - Aleste MSX emulation */
2953   bool slot3 = false;
29402954   if(m_system_type == SYSTEM_ALESTE)
29412955   {
29422956      m_Amstrad_ROM_Table[3] = &rom[0x01c000];
r252872r252873
29552969      temp = dynamic_cast<device_t*>(exp_port->get_card_device());
29562970      if(temp != nullptr)
29572971      {
2958         if(temp->memregion("exp_rom")->base() != nullptr)
2972         memory_region *temp_region = temp->memregion("exp_rom");
2973         if(temp_region != nullptr && temp_region->base() != nullptr)
29592974         {
2960            int num = temp->memregion("exp_rom")->bytes() / 0x4000;
2961            for(i=0;i<num;i++)
2975            int num = temp_region->bytes() / 0x4000;
2976            for (int i = 0; i < num; i++)
29622977            {
2963               m_Amstrad_ROM_Table[m_rom_count] = temp->memregion("exp_rom")->base()+0x4000*i;
2978               m_Amstrad_ROM_Table[m_rom_count] = temp_region->base()+0x4000*i;
29642979               NEXT_ROM_SLOT
29652980            }
29662981         }
2982         exp_port = temp->subdevice<cpc_expansion_slot_device>("exp");
29672983      }
2968      exp_port = temp->subdevice<cpc_expansion_slot_device>("exp");
2984      else
2985      {
2986         exp_port = NULL;
2987      }
29692988   }
29702989
29712990
29722991   /* add ROMs from ROMbox expansion */
2973   romexp = get_expansion_device(machine(),"rom");
2992   device_t* romexp = get_expansion_device(machine(),"rom");
29742993   if(romexp)
29752994   {
2976      for(i=0;i<8;i++)
2995      for(int i = 0; i < 8; i++)
29772996      {
2978         sprintf(str,"rom%i",i+1);
2979         romimage = romexp->subdevice<rom_image_device>(str);
2980         if(romimage->base() != nullptr)
2997         char str[20];
2998         sprintf(str, "rom%i", i + 1);
2999         rom_image_device* romimage = romexp->subdevice<rom_image_device>(str);
3000         if(romimage != NULL && romimage->base() != nullptr)
29813001         {
29823002            m_Amstrad_ROM_Table[m_rom_count] = romimage->base();
29833003            NEXT_ROM_SLOT
29843004         }
29853005      }
29863006   }
2987
29883007}
29893008
29903009void amstrad_state::amstrad_common_init()
r252872r252873
31063125   std::string region_tag;
31073126   m_region_cart = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str());
31083127   if (!m_region_cart) // this should never happen, since we make carts mandatory!
3128   {
31093129      m_region_cart = memregion("maincpu");
3130   }
31103131}
31113132
31123133
trunk/src/mame/video/avgdvg.cpp
r252872r252873
13441344   avgdvg_vectorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("vectorram")->ptr());
13451345   avgdvg_vectorram_size = machine().root_device().memshare("vectorram")->bytes();
13461346
1347   avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr());
1347   memory_share *colorram = machine().root_device().memshare("colorram");
1348   if (colorram != NULL)
1349   {
1350      avgdvg_colorram = reinterpret_cast<UINT8 *>(colorram->ptr());
1351   }
13481352
13491353   xmin = visarea.min_x;
13501354   ymin = visarea.min_y;
r252872r252873
13801384   avgdvg_vectorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("vectorram")->ptr());
13811385   avgdvg_vectorram_size = machine().root_device().memshare("vectorram")->bytes();
13821386
1383   avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr());
1387   memory_share *colorram = machine().root_device().memshare("colorram");
1388   if (colorram != NULL)
1389   {
1390      avgdvg_colorram = reinterpret_cast<UINT8 *>(colorram->ptr());
1391   }
13841392
13851393   xmin = visarea.min_x;
13861394   ymin = visarea.min_y;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team