Previous 199869 Revisions Next

r18160 Wednesday 26th September, 2012 at 14:23:31 UTC by Miodrag Milanović
device_func to device callback change (no whatsnew)
[src/emu/cpu/tms0980]tms0980.c tms0980.h
[src/mess/drivers]stopthie.c

trunk/src/emu/cpu/tms0980/tms0980.h
r18159r18160
1515      UINT8   value;
1616      UINT16   output;
1717   }   o_pla[20];
18   read8_device_func   read_k;
19   write16_device_func   write_o;      /* tms1270 has 10 O-outputs */
20   write16_device_func   write_r;
18   devcb_read8      read_k;
19   devcb_write16   write_o;      /* tms1270 has 10 O-outputs */
20   devcb_write16   write_r;
2121};
2222
2323
trunk/src/emu/cpu/tms0980/tms0980.c
r18159r18160
269269   const tms0980_config   *config;
270270   address_space *program;
271271   address_space *data;
272   
273   devcb_resolved_read8 m_read_k;
274   devcb_resolved_write16 m_write_o;
275   devcb_resolved_write16 m_write_r;
272276};
273277
274278
r18159r18160
505509
506510   cpustate->program = &device->space( AS_PROGRAM );
507511   cpustate->data = &device->space( AS_PROGRAM );
512   
513   cpustate->m_read_k.resolve(cpustate->config->read_k, *device);
514   cpustate->m_write_o.resolve(cpustate->config->write_o, *device);
515   cpustate->m_write_r.resolve(cpustate->config->write_r, *device);
508516
517
509518   device->save_item( NAME(cpustate->prev_pc) );
510519   device->save_item( NAME(cpustate->prev_pa) );
511520   device->save_item( NAME(cpustate->pc) );
r18159r18160
764773   switch( cpustate->opcode & 0x1F8 )
765774   {
766775   case 0x008:
767      if ( cpustate->config->read_k )
776      if ( !cpustate->m_read_k.isnull() )
768777      {
769         cpustate->cki_bus = cpustate->config->read_k( device, *cpustate->program, 0, 0xff );
778         cpustate->cki_bus = cpustate->m_read_k( 0, 0xff );
770779      }
771780      else
772781      {
r18159r18160
928937            if ( cpustate->decode & F_SETR )
929938            {
930939               cpustate->r = cpustate->r | ( 1 << cpustate->y );
931               if ( cpustate->config->write_r )
940               if ( !cpustate->m_write_r.isnull() )
932941               {
933                  cpustate->config->write_r( device, *cpustate->program, 0, cpustate->r & cpustate->r_mask, 0xffff );
942                  cpustate->m_write_r( 0, cpustate->r & cpustate->r_mask, 0xffff );
934943               }
935944            }
936945            if ( cpustate->decode & F_RSTR )
937946            {
938947               cpustate->r = cpustate->r & ( ~( 1 << cpustate->y ) );
939               if ( cpustate->config->write_r )
948               if ( !cpustate->m_write_r.isnull() )
940949               {
941                  cpustate->config->write_r( device, *cpustate->program, 0, cpustate->r & cpustate->r_mask, 0xffff );
950                  cpustate->m_write_r( 0, cpustate->r & cpustate->r_mask, 0xffff );
942951               }
943952            }
944953            if ( cpustate->decode & F_TDO )
r18159r18160
955964                  }
956965               }
957966
958               if ( cpustate->config->write_o )
967               if ( !cpustate->m_write_o.isnull() )
959968               {
960                  cpustate->config->write_o( device, *cpustate->program, 0, cpustate->o & cpustate->o_mask, 0xffff );
969                  cpustate->m_write_o( 0, cpustate->o & cpustate->o_mask, 0xffff );
961970               }
962971            }
963972            if ( cpustate->decode & F_CLO )
964973            {
965974               cpustate->o = 0;
966               if ( cpustate->config->write_o )
975               if ( !cpustate->m_write_o.isnull() )
967976               {
968                  cpustate->config->write_o( device, *cpustate->program, 0, cpustate->o & cpustate->o_mask, 0xffff );
977                  cpustate->m_write_o( 0, cpustate->o & cpustate->o_mask, 0xffff );
969978               }
970979            }
971980            if ( cpustate->decode & F_LDX )
trunk/src/mess/drivers/stopthie.c
r18159r18160
1111   stopthie_state(const machine_config &mconfig, device_type type, const char *tag)
1212      : driver_device(mconfig, type, tag) { }
1313
14   DECLARE_READ8_MEMBER(stopthie_read_k);
15   DECLARE_WRITE16_MEMBER(stopthie_write_o);
16   DECLARE_WRITE16_MEMBER(stopthie_write_r);
1417};
1518
1619
r18159r18160
2124INPUT_PORTS_END
2225
2326
24static READ8_DEVICE_HANDLER( stopthie_read_k )
27READ8_MEMBER(stopthie_state::stopthie_read_k)
2528{
2629   UINT8 data = 0xFF;
2730
r18159r18160
3235}
3336
3437
35static WRITE16_DEVICE_HANDLER( stopthie_write_o )
38WRITE16_MEMBER(stopthie_state::stopthie_write_o)
3639{
3740   if (LOG)
3841      logerror( "stopthie_write_o: write %02x\n", data );
3942}
4043
4144
42static WRITE16_DEVICE_HANDLER( stopthie_write_r )
45WRITE16_MEMBER(stopthie_state::stopthie_write_r)
4346{
4447   if (LOG)
4548      logerror( "stopthie_write_r: write %04x\n", data );
r18159r18160
5659      { 0x0d, 0x0d }, { 0x0e, 0x0e }, { 0x0f, 0x0f }, { 0x10, 0x10 },
5760      { 0x11, 0x11 }, { 0x12, 0x12 }, { 0x13, 0x13 }, { 0x14, 0x14 }
5861   },
59   stopthie_read_k,
60   stopthie_write_o,
61   stopthie_write_r
62   DEVCB_DRIVER_MEMBER(stopthie_state, stopthie_read_k),
63   DEVCB_DRIVER_MEMBER16(stopthie_state, stopthie_write_o),
64   DEVCB_DRIVER_MEMBER16(stopthie_state, stopthie_write_r)
6265};
6366
6467

Previous 199869 Revisions Next


© 1997-2024 The MAME Team