Previous 199869 Revisions Next

r17817 Wednesday 12th September, 2012 at 07:35:02 UTC by Aaron Giles
Get rid of devtag_reset macro.
[src/emu]device.h
[src/mame/audio]atarijsa.c cyberbal.c exidy.c
[src/mame/drivers]atarisy2.c bfm_sc2.c djmain.c gauntlet.c mediagx.c megatech.c midvunit.c qdrmfgp.c rampart.c segas24.c taitogn.c taitotz.c viper.c zn.c
[src/mame/machine]amiga.c mcr.c megadriv.c playch10.c toaplan1.c
[src/mess/drivers]dectalk.c gizmondo.c hp49gp.c juicebox.c mini2440.c nc.c palmz22.c pes.c
[src/mess/machine]compis.c lisa.c

trunk/src/mame/audio/cyberbal.c
r17816r17817
6060   coin_counter_w(machine(), 1, (data >> 5) & 1);
6161   coin_counter_w(machine(), 0, (data >> 4) & 1);
6262   machine().device("dac")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
63   if (!(data & 0x01)) devtag_reset(machine(), "ymsnd");
63   if (!(data & 0x01)) machine().device("ymsnd")->reset();
6464}
6565
6666
trunk/src/mame/audio/atarijsa.c
r17816r17817
298298         }
299299
300300         /* reset the YM2151 if needed */
301         if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
301         if ((data&1) == 0) space->machine().device("ymsnd")->reset();
302302
303303         /* coin counters */
304304         coin_counter_w(space->machine(), 1, (data >> 5) & 1);
r17816r17817
419419            */
420420
421421         /* reset the YM2151 if needed */
422         if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
422         if ((data&1) == 0) space->machine().device("ymsnd")->reset();
423423
424424         /* update the bank */
425425         memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
r17816r17817
544544            */
545545
546546         /* reset the YM2151 if needed */
547         if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
547         if ((data&1) == 0) space->machine().device("ymsnd")->reset();
548548
549549         /* update the OKI bank */
550550         if (oki6295 != NULL)
r17816r17817
678678            */
679679
680680         /* reset the YM2151 if needed */
681         if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
681         if ((data&1) == 0) space->machine().device("ymsnd")->reset();
682682
683683         /* update the OKI bank */
684684         space->machine().root_device().membank("bank12")->set_entry((space->machine().root_device().membank("bank12")->entry() & 2) | ((data >> 1) & 1));
trunk/src/mame/audio/exidy.c
r17816r17817
874874   DEVICE_RESET_CALL(common_sh_reset);
875875
876876   /* PIA */
877   devtag_reset(device->machine(), "pia0");
878   devtag_reset(device->machine(), "pia1");
877   device->machine().device("pia0")->reset();
878   device->machine().device("pia1")->reset();
879879
880880   /* 6532 */
881881   state->m_riot->reset();
trunk/src/mame/machine/megadriv.c
r17816r17817
684684   /* Is the z80 RESET line pulled? */
685685   if ( genz80.z80_is_reset )
686686   {
687      devtag_reset( machine, "genesis_snd_z80" );
687      machine.device("genesis_snd_z80" )->reset();
688688      machine.device<cpu_device>( "genesis_snd_z80" )->suspend(SUSPEND_REASON_HALT, 1 );
689      devtag_reset( machine, "ymsnd" );
689      machine.device("ymsnd" )->reset();
690690   }
691691   else
692692   {
trunk/src/mame/machine/amiga.c
r17816r17817
266266   logerror("Executed RESET at PC=%06x\n", space->device().safe_pc());
267267
268268   /* Initialize the various chips */
269   devtag_reset(device->machine(), "cia_0");
270   devtag_reset(device->machine(), "cia_1");
269   device->machine().device("cia_0")->reset();
270   device->machine().device("cia_1")->reset();
271271   custom_reset(device->machine());
272272   autoconfig_reset(device->machine());
273273
trunk/src/mame/machine/playch10.c
r17816r17817
140140WRITE8_MEMBER(playch10_state::pc10_PPURES_w)
141141{
142142   if (data & 1)
143      devtag_reset(machine(), "ppu");
143      machine().device("ppu")->reset();
144144}
145145
146146READ8_MEMBER(playch10_state::pc10_detectclr_r)
trunk/src/mame/machine/toaplan1.c
r17816r17817
314314   if (ACCESSING_BITS_0_7 && (data == 0))
315315   {
316316      logerror("PC:%04x  Resetting Sound CPU and Sound chip (%08x)\n", space.device().safe_pcbase(), data);
317      devtag_reset(machine(), "ymsnd");
317      machine().device("ymsnd")->reset();
318318      device_t *audiocpu = machine().device("audiocpu");
319319      if (audiocpu != NULL && audiocpu->type() == Z80)
320320         audiocpu->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
trunk/src/mame/machine/mcr.c
r17816r17817
254254{
255255   logerror("ipu_watchdog_reset\n");
256256   machine.device("ipu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
257   devtag_reset(machine, "ipu_ctc");
258   devtag_reset(machine, "ipu_pio0");
259   devtag_reset(machine, "ipu_pio1");
260   devtag_reset(machine, "ipu_sio");
257   machine.device("ipu_ctc")->reset();
258   machine.device("ipu_pio0")->reset();
259   machine.device("ipu_pio1")->reset();
260   machine.device("ipu_sio")->reset();
261261}
262262
263263
trunk/src/mame/drivers/rampart.c
r17816r17817
117117   {
118118      atarigen_set_oki6295_vol(machine(), (data & 0x0020) ? 100 : 0);
119119      if (!(data & 0x0010))
120         devtag_reset(machine(), "oki");
120         machine().device("oki")->reset();
121121      atarigen_set_ym2413_vol(machine(), ((data >> 1) & 7) * 100 / 7);
122122      if (!(data & 0x0001))
123         devtag_reset(machine(), "ymsnd");
123         machine().device("ymsnd")->reset();
124124   }
125125}
126126
trunk/src/mame/drivers/mediagx.c
r17816r17817
10801080   state->m_dmadac[0] = machine.device<dmadac_sound_device>("dac1");
10811081   state->m_dmadac[1] = machine.device<dmadac_sound_device>("dac2");
10821082   dmadac_enable(&state->m_dmadac[0], 2, 1);
1083   devtag_reset(machine, "ide");
1083   machine.device("ide")->reset();
10841084}
10851085
10861086/*************************************************************
trunk/src/mame/drivers/zn.c
r17816r17817
15201520   machine.root_device().membank( "bank1" )->set_base( machine.root_device().memregion( "user2" )->base() ); /* fixed game rom */
15211521   zn_machine_init(machine);
15221522
1523   devtag_reset(machine, "ide");
1523   machine.device("ide")->reset();
15241524}
15251525
15261526static const ide_config ide_intf =
r17816r17817
21952195   if( ( !strcmp( machine.system().name, "jdredd" ) ) ||
21962196      ( !strcmp( machine.system().name, "jdreddb" ) ) )
21972197   {
2198      devtag_reset(machine, "ide");
2198      machine.device("ide")->reset();
21992199   }
22002200}
22012201
trunk/src/mame/drivers/gauntlet.c
r17816r17817
214214         atarigen_sound_reset(machine());
215215         if (m_sound_reset_val & 1)
216216         {
217            devtag_reset(machine(), "ymsnd");
218            devtag_reset(machine(), "tms");
217            machine().device("ymsnd")->reset();
218            machine().device("tms")->reset();
219219            tms5220_set_frequency(machine().device("tms"), ATARI_CLOCK_14MHz/2 / 11);
220220            atarigen_set_ym2151_vol(machine(), 0);
221221            atarigen_set_pokey_vol(machine(), 0);
r17816r17817
258258   switch (offset & 7)
259259   {
260260      case 0:   /* music reset, bit D7, low reset */
261         if (((data>>7)&1) == 0) devtag_reset(machine(), "ymsnd");
261         if (((data>>7)&1) == 0) machine().device("ymsnd")->reset();
262262         break;
263263
264264      case 1:   /* speech write, bit D7, active low */
trunk/src/mame/drivers/viper.c
r17816r17817
19541954
19551955static MACHINE_RESET(viper)
19561956{
1957   devtag_reset(machine, "ide");
1957   machine.device("ide")->reset();
19581958   mpc8240_epic_reset();
19591959
19601960   UINT8 *ide_features = ide_get_features(machine.device("ide"), 0);
trunk/src/mame/drivers/atarisy2.c
r17816r17817
710710
711711   /* a large number of signals are reset when this happens */
712712   atarigen_sound_io_reset(machine().device("soundcpu"));
713   devtag_reset(machine(), "ymsnd");
713   machine().device("ymsnd")->reset();
714714   if (m_has_tms5220)
715715   {
716      devtag_reset(machine(), "tms"); // technically what happens is the tms5220 gets a long stream of 0xFF written to it when sound_reset_state is 0 which halts the chip after a few frames, but this works just as well, even if it isn't exactly true to hardware... The hardware may not have worked either, the resistors to pull input to 0xFF are fighting against the ls263 gate holding the latched value to be sent to the chip.
716      machine().device("tms")->reset(); // technically what happens is the tms5220 gets a long stream of 0xFF written to it when sound_reset_state is 0 which halts the chip after a few frames, but this works just as well, even if it isn't exactly true to hardware... The hardware may not have worked either, the resistors to pull input to 0xFF are fighting against the ls263 gate holding the latched value to be sent to the chip.
717717   }
718718   mixer_w(space, 0, 0);
719719}
trunk/src/mame/drivers/megatech.c
r17816r17817
258258   machine.device("genesis_snd_z80")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
259259   //machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
260260   //machine.device("genesis_snd_z80")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
261   devtag_reset(machine, "ymsnd");
261   machine.device("ymsnd")->reset();
262262
263263   megadriv_stop_scanline_timer(machine);// stop the scanline timer for the genesis vdp... it can be restarted in video eof when needed
264264   segae_md_sms_stop_scanline_timer();// stop the scanline timer for the sms vdp
trunk/src/mame/drivers/taitotz.c
r17816r17817
24252425static MACHINE_RESET( taitotz )
24262426{
24272427   taitotz_state *state = machine.driver_data<taitotz_state>();
2428   devtag_reset(machine, "ide");
2428   machine.device("ide")->reset();
24292429
24302430   if (state->m_hdd_serial_number != NULL)
24312431   {
trunk/src/mame/drivers/djmain.c
r17816r17817
14231423   sndram_set_bank(machine);
14241424
14251425   /* reset the IDE controller */
1426   devtag_reset(machine, "ide");
1426   machine.device("ide")->reset();
14271427
14281428   /* reset LEDs */
14291429   set_led_status(machine, 0, 1);
trunk/src/mame/drivers/bfm_sc2.c
r17816r17817
372372
373373   e2ram_reset(machine);
374374
375   devtag_reset(machine, "ymsnd");
375   machine.device("ymsnd")->reset();
376376
377377  // reset stepper motors /////////////////////////////////////////////////
378378   {
trunk/src/mame/drivers/qdrmfgp.c
r17816r17817
658658
659659   /* reset the IDE controller */
660660   state->m_gp2_irq_control = 0;
661   devtag_reset(machine, "ide");
661   machine.device("ide")->reset();
662662}
663663
664664
trunk/src/mame/drivers/midvunit.c
r17816r17817
8383   state->m_timer[0] = machine.device<timer_device>("timer0");
8484   state->m_timer[1] = machine.device<timer_device>("timer1");
8585
86   devtag_reset(machine, "ide");
86   machine.device("ide")->reset();
8787}
8888
8989
trunk/src/mame/drivers/taitogn.c
r17816r17817
403403         // Check for card reset
404404         if (!(data & 0x40))
405405         {
406            devtag_reset(machine, ":card");
406            machine.device(":card")->reset();
407407            state->m_locked = 0x1ff;
408408            ide_set_gnet_readlock (machine.device(":card"), 1);
409409         }
r17816r17817
889889   state->m_locked = 0x1ff;
890890   install_handlers(machine, 0);
891891   state->m_control = 0;
892   devtag_reset(machine, ":card");
892   machine.device(":card")->reset();
893893   ide_set_gnet_readlock(machine.device(":card"), 1);
894894
895895   // halt sound CPU since it has no valid program at start
trunk/src/mame/drivers/segas24.c
r17816r17817
696696         machine().device("subcpu")->execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
697697   }
698698   if(changed & 4)
699      devtag_reset(machine(), "ymsnd");
699      machine().device("ymsnd")->reset();
700700   prev_resetcontrol = resetcontrol;
701701}
702702
trunk/src/emu/device.h
r17816r17817
5555// macro for specifying a clock derived from an owning device
5656#define DERIVED_CLOCK(num, den)      (0xff000000 | ((num) << 12) | ((den) << 0))
5757
58// shorthand for accessing devices by machine/type/tag
59#define devtag_reset(mach,tag)                        (mach).device(tag)->reset()
6058
6159
62
6360//**************************************************************************
6461//  DEVICE CONFIGURATION MACROS
6562//**************************************************************************
trunk/src/mess/machine/compis.c
r17816r17817
8282#ifdef UNUSED_FUNCTION
8383void compis_irq_set(UINT8 irq)
8484{
85   cputag_set_input_line_vector(machine, "maincpu", 0, irq);
86   machine.device("maincpu")->execute().set_input_line(0, HOLD_LINE);
85   machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, irq);
8786}
8887#endif
8988
trunk/src/mess/machine/lisa.c
r17816r17817
10871087   }
10881088
10891089   /* reset 68k to pick up proper vectors from MMU */
1090   devtag_reset(machine, "maincpu");
1090   machine.device("maincpu")->reset();
10911091}
10921092
10931093INTERRUPT_GEN( lisa_interrupt )
trunk/src/mess/drivers/dectalk.c
r17816r17817
331331   dectalk_x2212_recall(device->machine()); // nvram recall
332332   state->m_m68k_spcflags_latch = 1; // initial status is speech reset(d0) active and spc int(d6) disabled
333333   state->m_m68k_tlcflags_latch = 0; // initial status is tone detect int(d6) off, answer phone(d8) off, ring detect int(d14) off
334   devtag_reset(device->machine(), "duart68681"); // reset the DUART
334   device->machine().device("duart68681")->reset(); // reset the DUART
335335   // stuff that is INDIRECTLY affected by the RESET line
336336   dectalk_clear_all_fifos(device->machine()); // speech reset clears the fifos, though we have to do it explicitly here since we're not actually in the m68k_spcflags_w function.
337337   dectalk_semaphore_w(device->machine(), 0); // on the original state->m_dectalk pcb revision, this is a semaphore for the INPUT fifo, later dec hacked on a check for the 3 output fifo chips to see if they're in sync, and set both of these latches if true.
trunk/src/mess/drivers/mini2440.c
r17816r17817
177177static MACHINE_RESET( mini2440 )
178178{
179179   mini2440_state *state = machine.driver_data<mini2440_state>();
180   devtag_reset( machine, "maincpu");
180   machine.device("maincpu")->reset();
181181   memset( state->m_port, 0, sizeof( state->m_port));
182182}
183183
trunk/src/mess/drivers/pes.c
r17816r17817
218218
219219   m_port3_state = 0; // reset the openbus state of port 3
220220   //machine.device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE); // this causes debugger to fail badly if included
221   devtag_reset(machine(), "tms5220"); // reset the 5220
221   machine().device("tms5220")->reset(); // reset the 5220
222222}
223223
224224/******************************************************************************
trunk/src/mess/drivers/gizmondo.c
r17816r17817
145145
146146static MACHINE_RESET( gizmondo )
147147{
148   devtag_reset( machine, "maincpu");
148   machine.device("maincpu")->reset();
149149}
150150
151151/*******************************************************************************
trunk/src/mess/drivers/hp49gp.c
r17816r17817
246246static MACHINE_RESET( hp49gp )
247247{
248248//  hp49gp_state *hp49gp = machine.driver_data<hp49gp_state>();
249   devtag_reset( machine, "maincpu");
249   machine.device("maincpu")->reset();
250250}
251251
252252/***************************************************************************
trunk/src/mess/drivers/palmz22.c
r17816r17817
249249static MACHINE_RESET( palmz22 )
250250{
251251   palmz22_state *state = machine.driver_data<palmz22_state>();
252   devtag_reset( machine, "maincpu");
252   machine.device("maincpu")->reset();
253253   memset( state->m_port, 0, sizeof( state->m_port));
254254}
255255
trunk/src/mess/drivers/nc.c
r17816r17817
786786      /* changed uart from off to on */
787787      if ((data & (1<<3))==0)
788788      {
789         devtag_reset(machine(), "uart");
789         machine().device("uart")->reset();
790790      }
791791   }
792792
trunk/src/mess/drivers/juicebox.c
r17816r17817
255255
256256static MACHINE_RESET( juicebox )
257257{
258   devtag_reset( machine, "maincpu");
258   machine.device("maincpu")->reset();
259259   smc_reset( machine);
260260}
261261

Previous 199869 Revisions Next


© 1997-2024 The MAME Team