Previous 199869 Revisions Next

r41790 Thursday 19th November, 2015 at 12:45:40 UTC by Ryan Holtz
Yet more this==NULL fixes
[/branches/code_cleanup/src/devices/sound]es5506.cpp namco.cpp namco.h scsp.cpp scsp.h tms5110.cpp tms5110.h
[/branches/code_cleanup/src/emu]device.cpp
[/branches/code_cleanup/src/mame/drivers]cps3.cpp jaguar.cpp segac2.cpp
[/branches/code_cleanup/src/mame/includes]cps3.h jaguar.h
[/branches/code_cleanup/src/mame/machine]amstrad.cpp
[/branches/code_cleanup/src/mame/video]avgdvg.cpp

branches/code_cleanup/src/devices/sound/es5506.cpp
r250301r250302
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() : NULL;
199   m_region_base[1] = m_region1 ? (UINT16 *)machine().root_device().memregion(m_region1)->base() : NULL;
200   m_region_base[2] = m_region2 ? (UINT16 *)machine().root_device().memregion(m_region2)->base() : NULL;
201   m_region_base[3] = m_region3 ? (UINT16 *)machine().root_device().memregion(m_region3)->base() : NULL;
198   m_region_base[0] = m_region_base[1] = m_region_base[2] = m_region_base[3] = NULL;
199   if (m_region0)
200   {
201      memory_region *region0 = machine().root_device().memregion(m_region0);
202      if (region0 != NULL)
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 != NULL)
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 != NULL)
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 != NULL)
227      {
228         m_region_base[3] = (UINT16 *)region3->base();
229      }
230   }
202231
203232   /* initialize the rest of the structure */
204233   m_master_clock = clock();
branches/code_cleanup/src/devices/sound/namco.cpp
r250301r250302
3636const device_type NAMCO_CUS30 = &device_creator<namco_cus30_device>;
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)
39   : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__),
40      device_sound_interface(mconfig, *this),
41      m_last_channel(NULL),
42      m_soundregs(NULL),
43      m_wavedata(NULL),
44      m_wave_size(0),
45      m_sound_enable(0),
46      m_stream(NULL),
47      m_namco_clock(0),
48      m_sample_rate(0),
49      m_f_fracbits(0),
50      m_voices(0),
51      m_stereo(0)
39   : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__)
40   , device_sound_interface(mconfig, *this)
41   , m_wave_region(*this, tag)
42   , m_last_channel(NULL)
43   , m_soundregs(NULL)
44   , m_wavedata(NULL)
45   , m_wave_size(0)
46   , m_sound_enable(0)
47   , m_stream(NULL)
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
r250301r250302
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)
r250301r250302
109110   /* register with the save state system */
110111   save_pointer(NAME(m_soundregs), 0x400);
111112
112   if (region() == NULL)
113   if (m_wave_region == NULL)
113114      save_pointer(NAME(m_wavedata), 0x400);
114115
115116   save_item(NAME(m_voices));
branches/code_cleanup/src/devices/sound/namco.h
r250301r250302
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;
branches/code_cleanup/src/devices/sound/scsp.cpp
r250301r250302
148148      m_roffset(0),
149149      m_irq_cb(*this),
150150      m_main_irq_cb(*this),
151      m_ram_region(*this, tag),
151152      m_BUFPTR(0),
152153      m_SCSPRAM(NULL),
153154      m_SCSPRAM_LENGTH(0),
r250301r250302
514515      m_Master=0;
515516   }
516517
517   m_SCSPRAM = region()->base();
518   if (m_SCSPRAM)
518   if (m_ram_region)
519519   {
520      m_SCSPRAM_LENGTH = region()->bytes();
521      m_DSP.SCSPRAM = (UINT16 *)m_SCSPRAM;
522      m_DSP.SCSPRAM_LENGTH = m_SCSPRAM_LENGTH/2;
523      m_SCSPRAM += m_roffset;
520      m_SCSPRAM = m_ram_region->base();
521      if (m_SCSPRAM)
522      {
523         m_SCSPRAM_LENGTH = m_ram_region->bytes();
524         m_DSP.SCSPRAM = (UINT16 *)m_SCSPRAM;
525         m_DSP.SCSPRAM_LENGTH = m_SCSPRAM_LENGTH/2;
526         m_SCSPRAM += m_roffset;
527      }
524528   }
525529
526530   m_timerA = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(scsp_device::timerA_cb), this));
branches/code_cleanup/src/devices/sound/scsp.h
r250301r250302
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   {
branches/code_cleanup/src/devices/sound/tms5110.cpp
r250301r250302
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
r250301r250302
15311535const device_type TMS5110 = &device_creator<tms5110_device>;
15321536
15331537tms5110_device::tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
1534   : 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)
1538   : device_t(mconfig, TMS5110, "TMS5110", tag, owner, clock, "tms5110", __FILE__)
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
branches/code_cleanup/src/devices/sound/tms5110.h
r250301r250302
101101   void parse_frame();
102102
103103   // internal state
104   /* table region */
105   optional_memory_region m_table_region;
106
104107   /* coefficient tables */
105108   int m_variant;                /* Variant of the 5110 - see tms5110.h */
106109
branches/code_cleanup/src/emu/device.cpp
r250301r250302
108108
109109memory_bank *device_t::membank(const char *_tag) const
110110{
111   // safety first
112   if (this == NULL)
113      return NULL;
114
111115   // build a fully-qualified name and look it up
112116   return machine().memory().bank(subtag(_tag).c_str());
113117}
branches/code_cleanup/src/mame/drivers/cps3.cpp
r250301r250302
794794   m_altEncryption = altEncryption;
795795
796796   // cache pointers to regions
797   m_user4region = memregion("user4")->base();
798   m_user5region = memregion("user5")->base();
797   if (m_user4_region)
798   {
799      m_user4 = m_user4_region->base();
800   }
801   else
802   {
803      m_user4 = auto_alloc_array(machine(), UINT8, USER4REGION_LENGTH);
804   }
799805
800   if (!m_user4region) m_user4region = auto_alloc_array(machine(), UINT8, USER4REGION_LENGTH);
801   if (!m_user5region) m_user5region = auto_alloc_array(machine(), UINT8, USER5REGION_LENGTH);
802   m_cps3sound->set_base((INT8*)m_user5region);
806   if (m_user5_region)
807   {
808      m_user5 = m_user5_region->base();
809   }
810   else
811   {
812      m_user5 = auto_alloc_array(machine(), UINT8, USER5REGION_LENGTH);
813   }
803814
815   m_cps3sound->set_base((INT8*)m_user5);
816
804817   // set strict verify
805818   m_maincpu->sh2drc_set_options(SH2DRC_STRICT_VERIFY);
806819   m_maincpu->sh2drc_add_fastram(0x02000000, 0x0207ffff, 0, &m_mainram[0]);
r250301r250302
14741487
14751488   /* make a copy in the linear memory region we actually use for drawing etc.  having it stored in interleaved flash roms isnt' very useful */
14761489   {
1477      UINT32* romdata = (UINT32*)m_user5region;
1490      UINT32* romdata = (UINT32*)m_user5;
14781491      int real_offset = 0;
14791492      UINT32 newdata;
14801493
r250301r250302
15811594
15821595   /* copy data into regions to execute from */
15831596   {
1584      UINT32* romdata =  (UINT32*)m_user4region;
1597      UINT32* romdata =  (UINT32*)m_user4;
15851598      UINT32* romdata2 = (UINT32*)m_decrypted_gamerom;
15861599      int real_offset = 0;
15871600      UINT32 newdata;
r250301r250302
18051818         if (data & 0x0002)
18061819         {
18071820            int i;
1808            UINT16* src = (UINT16*)m_user5region;
1821            UINT16* src = (UINT16*)m_user5;
18091822         //  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);
18101823
18111824            for (i=0;i<m_paldma_length;i++)
r250301r250302
18791892
18801893void cps3_state::cps3_do_char_dma( UINT32 real_source, UINT32 real_destination, UINT32 real_length )
18811894{
1882   UINT8* sourcedata = (UINT8*)m_user5region;
1895   UINT8* sourcedata = (UINT8*)m_user5;
18831896   int length_remaining;
18841897
18851898   m_last_normal_byte = 0;
r250301r250302
19621975
19631976void cps3_state::cps3_do_alt_char_dma( UINT32 src, UINT32 real_dest, UINT32 real_length )
19641977{
1965   UINT8* px = (UINT8*)m_user5region;
1978   UINT8* px = (UINT8*)m_user5;
19661979   UINT32 start = real_dest;
19671980   UINT32 ds = real_dest;
19681981
r250301r250302
23052318// make a copy in the regions we execute code / draw gfx from
23062319void cps3_state::copy_from_nvram()
23072320{
2308   UINT32* romdata = (UINT32*)m_user4region;
2321   UINT32* romdata = (UINT32*)m_user4;
23092322   UINT32* romdata2 = (UINT32*)m_decrypted_gamerom;
23102323   int i;
23112324   /* copy + decrypt program roms which have been loaded from flashroms/nvram */
r250301r250302
23422355      int flashnum = 0;
23432356      int countoffset = 0;
23442357
2345      romdata = (UINT32*)m_user5region;
2358      romdata = (UINT32*)m_user5;
23462359      for (thebase = 0;thebase < len/2; thebase+=0x200000)
23472360      {
23482361      //  printf("flashnums %d. %d\n",flashnum, flashnum+1);
branches/code_cleanup/src/mame/drivers/jaguar.cpp
r250301r250302
427427   }
428428
429429   /* configure banks for gfx/sound ROMs */
430   UINT8 *romboard = memregion("romboard")->base();
431   if (romboard != NULL)
430   if (m_romboard_region != NULL)
432431   {
432      UINT8 *romboard = m_romboard_region->base();
433
433434      /* graphics banks */
434435      if (m_is_r3000)
435436      {
r250301r250302
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);
r250301r250302
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}
r250301r250302
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);
branches/code_cleanup/src/mame/drivers/segac2.cpp
r250301r250302
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;
r250301r250302
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 */
r250301r250302
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;
branches/code_cleanup/src/mame/includes/cps3.h
r250301r250302
1515{
1616public:
1717   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")
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      , m_user4_region(*this, "user4")
35      , m_user5_region(*this, "user5")
3436   { }
3537
3638   required_device<sh2_device> m_maincpu;
r250301r250302
5052   required_shared_ptr<UINT32> m_decrypted_gamerom;
5153   required_shared_ptr<UINT32> m_0xc0000000_ram_decrypted;
5254
55   optional_memory_region      m_user4_region;
56   optional_memory_region      m_user5_region;
57
5358   fujitsu_29f016a_device *m_simm[7][8];
5459   UINT32 m_cram_gfxflash_bank;
5560   UINT32* m_nops;
r250301r250302
6267   UINT32* m_mame_colours;
6368   bitmap_rgb32 m_renderbuffer_bitmap;
6469   rectangle m_renderbuffer_clip;
65   UINT8* m_user4region;
70   UINT8* m_user4;
6671   UINT32 m_key1;
6772   UINT32 m_key2;
6873   int m_altEncryption;
r250301r250302
8287   int m_last_normal_byte;
8388   unsigned short m_lastb;
8489   unsigned short m_lastb2;
85   UINT8* m_user5region;
90   UINT8* m_user5;
8691
8792   DECLARE_READ32_MEMBER(cps3_ssram_r);
8893   DECLARE_WRITE32_MEMBER(cps3_ssram_w);
branches/code_cleanup/src/mame/includes/jaguar.h
r250301r250302
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),
r250301r250302
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;
branches/code_cleanup/src/mame/machine/amstrad.cpp
r250301r250302
10871087   amstrad_state *state = machine.driver_data<amstrad_state>();
10881088   cpc_expansion_slot_device* exp_port = state->m_exp;
10891089
1090   while(exp_port != NULL)
1090   while (exp_port != NULL)
10911091   {
10921092      device_t* temp;
10931093
r250301r250302
10981098
10991099      // if it's not what we're looking for, then check the expansion port on this expansion device. if it exists.
11001100      temp = dynamic_cast<device_t*>(exp_port->get_card_device());
1101      if(temp == NULL)
1101      if (temp == NULL)
1102      {
11021103         return NULL; // no device attached
1104      }
1105
11031106      exp_port = temp->subdevice<cpc_expansion_slot_device>("exp");
1104      if(exp_port == NULL)
1107      if (exp_port == NULL)
1108      {
11051109         return NULL;  // we're at the end of the chain
1110      }
11061111   }
11071112   return NULL;
11081113}
r250301r250302
19751980   // expansion devices know the selected ROM by monitoring I/O writes to DFxx
19761981   // there are no signals related to which ROM is selected
19771982   cpc_expansion_slot_device* exp_port = m_exp;
1978   while(exp_port != NULL)
1983   while (exp_port != NULL)
19791984   {
19801985      device_cpc_expansion_card_interface* temp;
19811986      device_t* temp_dev;
19821987
19831988      temp = dynamic_cast<device_cpc_expansion_card_interface*>(exp_port->get_card_device());
19841989      temp_dev = dynamic_cast<device_t*>(exp_port->get_card_device());
1985      if(temp != NULL)
1990      if (temp != NULL)
19861991      {
19871992         temp->set_rom_bank(data);
1993         exp_port = temp_dev->subdevice<cpc_expansion_slot_device>("exp");
19881994      }
1989      exp_port = temp_dev->subdevice<cpc_expansion_slot_device>("exp");
1995      else
1996      {
1997         exp_port = NULL;
1998      }
19901999   }
19912000
19922001   amstrad_rethinkMemory();
r250301r250302
28772886void amstrad_state::enumerate_roms()
28782887{
28792888   UINT8 m_rom_count = 1;
2880   device_t* romexp;
2881   rom_image_device* romimage;
28822889   UINT8 *rom = m_region_maincpu->base();
2883   char str[20];
2884   int i;
2885   bool slot3 = false,slot7 = false;
28862890
2891   bool slot7 = false;
28872892   if (m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000)
28882893   {
28892894      UINT8 *crt = m_region_cart->base();
28902895      int bank_mask = (m_cart->get_rom_size() / 0x4000) - 1;
28912896
28922897      /* ROMs are stored on the inserted cartridge in the Plus/GX4000 */
2893      for(i=0; i<128; i++)  // fill ROM table
2898      for (int i = 0; i < 128; i++) // fill ROM table
2899      {
28942900         m_Amstrad_ROM_Table[i] = &crt[0x4000];
2895      for(i=128;i<160;i++)
2901      }
2902
2903      for(int i = 128; i < 160; i++)
2904      {
28962905         m_Amstrad_ROM_Table[i] = &crt[((i - 128) & bank_mask) * 0x4000];
2906      }
28972907      m_Amstrad_ROM_Table[7] = &crt[0xc000];
28982908      slot7 = true;
28992909   }
29002910   else
29012911   {
29022912      /* slot 0 is always BASIC, as is any unused slot */
2903      for(i=0; i<256; i++)
2913      for (int i = 0; i<256; i++)
2914      {
29042915         m_Amstrad_ROM_Table[i] = &rom[0x014000];
2916      }
2917
29052918      /* AMSDOS ROM -- TODO: exclude from 464 unless a DDI-1 device is connected */
29062919      m_Amstrad_ROM_Table[7] = &rom[0x018000];
29072920      slot7 = true;
29082921   }
29092922
29102923   /* MSX-DOS BIOS - Aleste MSX emulation */
2924   bool slot3 = false;
29112925   if(m_system_type == SYSTEM_ALESTE)
29122926   {
29132927      m_Amstrad_ROM_Table[3] = &rom[0x01c000];
r250301r250302
29262940      temp = dynamic_cast<device_t*>(exp_port->get_card_device());
29272941      if(temp != NULL)
29282942      {
2929         if(temp->memregion("exp_rom")->base() != NULL)
2943         memory_region *temp_region = temp->memregion("exp_rom");
2944         if(temp_region != NULL && temp_region->base() != NULL)
29302945         {
2931            int num = temp->memregion("exp_rom")->bytes() / 0x4000;
2932            for(i=0;i<num;i++)
2946            int num = temp_region->bytes() / 0x4000;
2947            for (int i = 0; i < num; i++)
29332948            {
2934               m_Amstrad_ROM_Table[m_rom_count] = temp->memregion("exp_rom")->base()+0x4000*i;
2949               m_Amstrad_ROM_Table[m_rom_count] = temp_region->base()+0x4000*i;
29352950               NEXT_ROM_SLOT
29362951            }
29372952         }
2953         exp_port = temp->subdevice<cpc_expansion_slot_device>("exp");
29382954      }
2939      exp_port = temp->subdevice<cpc_expansion_slot_device>("exp");
2955      else
2956      {
2957         exp_port = NULL;
2958      }
29402959   }
29412960
29422961
29432962   /* add ROMs from ROMbox expansion */
2944   romexp = get_expansion_device(machine(),"rom");
2963   device_t* romexp = get_expansion_device(machine(),"rom");
29452964   if(romexp)
29462965   {
2947      for(i=0;i<8;i++)
2966      for(int i = 0; i < 8; i++)
29482967      {
2949         sprintf(str,"rom%i",i+1);
2950         romimage = romexp->subdevice<rom_image_device>(str);
2951         if(romimage->base() != NULL)
2968         char str[20];
2969         sprintf(str, "rom%i", i + 1);
2970         rom_image_device* romimage = romexp->subdevice<rom_image_device>(str);
2971         if(romimage != NULL && romimage->base() != NULL)
29522972         {
29532973            m_Amstrad_ROM_Table[m_rom_count] = romimage->base();
29542974            NEXT_ROM_SLOT
29552975         }
29562976      }
29572977   }
2958
29592978}
29602979
29612980void amstrad_state::amstrad_common_init()
r250301r250302
30773096   std::string region_tag;
30783097   m_region_cart = memregion(region_tag.assign(m_cart->tag()).append(GENERIC_ROM_REGION_TAG).c_str());
30793098   if (!m_region_cart) // this should never happen, since we make carts mandatory!
3099   {
30803100      m_region_cart = memregion("maincpu");
3101   }
30813102}
30823103
30833104
branches/code_cleanup/src/mame/video/avgdvg.cpp
r250301r250302
13431343   avgdvg_vectorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("vectorram")->ptr());
13441344   avgdvg_vectorram_size = machine().root_device().memshare("vectorram")->bytes();
13451345
1346   avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr());
1346   memory_share *colorram = machine().root_device().memshare("colorram");
1347   if (colorram != NULL)
1348   {
1349      avgdvg_colorram = reinterpret_cast<UINT8 *>(colorram->ptr());
1350   }
13471351
13481352   xmin = visarea.min_x;
13491353   ymin = visarea.min_y;
r250301r250302
13791383   avgdvg_vectorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("vectorram")->ptr());
13801384   avgdvg_vectorram_size = machine().root_device().memshare("vectorram")->bytes();
13811385
1382   avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr());
1386   memory_share *colorram = machine().root_device().memshare("colorram");
1387   if (colorram != NULL)
1388   {
1389      avgdvg_colorram = reinterpret_cast<UINT8 *>(colorram->ptr());
1390   }
13831391
13841392   xmin = visarea.min_x;
13851393   ymin = visarea.min_y;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team