Previous 15994 Revisions Next

r14958 Wednesday 18th April, 2012 at 06:22:38 UTC by Miodrag Milanović
Some DIRECT_UPDATE_HANDLER -> DIRECT_UPDATE_MEMBER (nw)
[src/mess/drivers]abc80x.c atm.c cosmicos.c elwro800.c gba.c mc1000.c mpf1.c mpz80.c
[src/mess/includes]abc80x.h cosmicos.h gba.h mc1000.h mpf1.h mpz80.h

src/mess/includes/gba.h
r14957r14958
221221   int m_bios_protected;
222222
223223   int m_flash_battery_load;
224   
225   DIRECT_UPDATE_MEMBER(gba_direct);
224226};
225227
226228/*----------- defined in video/gba.c -----------*/
src/mess/includes/mc1000.h
r14957r14958
5757   DECLARE_READ8_MEMBER( videoram_r );
5858   DECLARE_WRITE8_MEMBER( keylatch_w );
5959   DECLARE_READ8_MEMBER( keydata_r );
60   DIRECT_UPDATE_MEMBER(mc1000_direct_update_handler);
6061
6162   void bankswitch();
6263
src/mess/includes/mpf1.h
r14957r14958
4646   DECLARE_WRITE8_MEMBER( ppi_pc_w );
4747   DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
4848   DECLARE_INPUT_CHANGED_MEMBER( trigger_irq );
49   DECLARE_DIRECT_UPDATE_MEMBER(mpf1_direct_update_handler);
4950
5051   int m_break;
5152   int m_m1;
src/mess/includes/abc80x.h
r14957r14958
142142   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
143143
144144   void hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);
145   
146   DECLARE_DIRECT_UPDATE_MEMBER(abc800m_direct_update_handler);
145147};
146148
147149class abc800c_state : public abc800_state
r14957r14958
157159   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
158160
159161   void hr_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
162   
163   DECLARE_DIRECT_UPDATE_MEMBER(abc800c_direct_update_handler);
160164};
161165
162166// ======================> abc802_state
r14957r14958
184188   DECLARE_READ8_MEMBER( pling_r );
185189   DECLARE_WRITE_LINE_MEMBER( lrs_w );
186190   DECLARE_WRITE_LINE_MEMBER( mux80_40_w );
187   DECLARE_WRITE_LINE_MEMBER( vs_w );
191   DECLARE_WRITE_LINE_MEMBER( vs_w );   
192   DECLARE_DIRECT_UPDATE_MEMBER(abc802_direct_update_handler);
188193
189194   // cpu state
190195   int m_lrs;               // low RAM select
r14957r14958
241246   DECLARE_WRITE_LINE_MEMBER( keydtr_w );
242247   DECLARE_WRITE_LINE_MEMBER( hs_w );
243248   DECLARE_WRITE_LINE_MEMBER( vs_w );
249   DECLARE_DIRECT_UPDATE_MEMBER(abc806_direct_update_handler);
244250
245251   // memory state
246252   int m_keydtr;            // keyboard DTR
src/mess/includes/mpz80.h
r14957r14958
7171   DECLARE_WRITE8_MEMBER( terminal_w );
7272   DECLARE_WRITE_LINE_MEMBER( s100_pint_w );
7373   DECLARE_WRITE_LINE_MEMBER( s100_nmi_w );
74   DECLARE_DIRECT_UPDATE_MEMBER(mpz80_direct_update_handler);
7475
7576   // memory state
7677   UINT32 m_addr;
src/mess/includes/cosmicos.h
r14957r14958
9191   DECLARE_INPUT_CHANGED_MEMBER( clear_data );
9292   DECLARE_INPUT_CHANGED_MEMBER( memory_protect );
9393   DECLARE_INPUT_CHANGED_MEMBER( memory_disable );
94   DECLARE_DIRECT_UPDATE_MEMBER(cosmicos_direct_update_handler);
95   
9496   void set_cdp1802_mode(int mode);
9597   void clear_input_data();
9698   void set_ram_mode();
src/mess/drivers/mc1000.c
r14957r14958
482482
483483/* Driver Initialization */
484484
485DIRECT_UPDATE_HANDLER( mc1000_direct_update_handler )
485DIRECT_UPDATE_MEMBER(mc1000_state::mc1000_direct_update_handler)
486486{
487   mc1000_state *state = machine.driver_data<mc1000_state>();
488
489   if (state->m_rom0000)
487   if (m_rom0000)
490488   {
491489      if (address >= 0xc000)
492490      {
493         memory_set_bank(machine, "bank1", 0);
494         state->m_rom0000 = 0;
491         memory_set_bank(machine(), "bank1", 0);
492         m_rom0000 = 0;
495493      }
496494   }
497495
r14957r14958
500498
501499static DRIVER_INIT( mc1000 )
502500{
503   machine.device(Z80_TAG)->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(mc1000_direct_update_handler), &machine));
501   mc1000_state *state = machine.driver_data<mc1000_state>();
502
503   machine.device(Z80_TAG)->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(mc1000_state::mc1000_direct_update_handler), state));
504504}
505505
506506/* System Drivers */
src/mess/drivers/mpf1.c
r14957r14958
462462
463463/* System Drivers */
464464
465DIRECT_UPDATE_HANDLER( mpf1_direct_update_handler )
465DIRECT_UPDATE_MEMBER(mpf1_state::mpf1_direct_update_handler)
466466{
467   mpf1_state *state = machine.driver_data<mpf1_state>();
468
469   if (!state->m_break)
467   if (!m_break)
470468   {
471      state->m_m1++;
469      m_m1++;
472470
473      if (state->m_m1 == 5)
471      if (m_m1 == 5)
474472      {
475         state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
473         m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
476474      }
477475   }
478476
r14957r14958
483481{
484482   mpf1_state *state = machine.driver_data<mpf1_state>();
485483
486   state->m_maincpu->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(mpf1_direct_update_handler), &machine));
484   state->m_maincpu->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(mpf1_state::mpf1_direct_update_handler), state));
487485}
488486
489487COMP( 1979, mpf1,  0,    0, mpf1, mpf1,  mpf1, "Multitech", "Micro Professor 1", 0)
src/mess/drivers/abc80x.c
r14957r14958
14121412//  DRIVER_INIT( abc800c )
14131413//-------------------------------------------------
14141414
1415DIRECT_UPDATE_HANDLER( abc800c_direct_update_handler )
1415DIRECT_UPDATE_MEMBER(abc800c_state::abc800c_direct_update_handler)
14161416{
1417   abc800_state *state = machine.driver_data<abc800_state>();
1418
14191417   if (address >= 0x7c00 && address < 0x8000)
14201418   {
1421      direct.explicit_configure(0x7c00, 0x7fff, 0x3ff, machine.region(Z80_TAG)->base() + 0x7c00);
1419      direct.explicit_configure(0x7c00, 0x7fff, 0x3ff, machine().region(Z80_TAG)->base() + 0x7c00);
14221420
1423      if (!state->m_fetch_charram)
1421      if (!m_fetch_charram)
14241422      {
1425         state->m_fetch_charram = 1;
1426         state->bankswitch();
1423         m_fetch_charram = 1;
1424         bankswitch();
14271425      }
14281426
14291427      return ~0;
14301428   }
14311429
1432   if (state->m_fetch_charram)
1430   if (m_fetch_charram)
14331431   {
1434      state->m_fetch_charram = 0;
1435      state->bankswitch();
1432      m_fetch_charram = 0;
1433      bankswitch();
14361434   }
14371435
14381436   return address;
r14957r14958
14401438
14411439static DRIVER_INIT( abc800c )
14421440{
1441   abc800c_state *state = machine.driver_data<abc800c_state>();
14431442   address_space *program = machine.device<cpu_device>(Z80_TAG)->space(AS_PROGRAM);
1444   program->set_direct_update_handler(direct_update_delegate(FUNC(abc800c_direct_update_handler), &machine));
1443   program->set_direct_update_handler(direct_update_delegate(FUNC(abc800c_state::abc800c_direct_update_handler), state));
14451444}
14461445
14471446
r14957r14958
14491448//  DRIVER_INIT( abc800m )
14501449//-------------------------------------------------
14511450
1452DIRECT_UPDATE_HANDLER( abc800m_direct_update_handler )
1451DIRECT_UPDATE_MEMBER(abc800m_state::abc800m_direct_update_handler)
14531452{
1454   abc800_state *state = machine.driver_data<abc800_state>();
1455
14561453   if (address >= 0x7800 && address < 0x8000)
14571454   {
1458      direct.explicit_configure(0x7800, 0x7fff, 0x7ff, machine.region(Z80_TAG)->base() + 0x7800);
1455      direct.explicit_configure(0x7800, 0x7fff, 0x7ff, machine().region(Z80_TAG)->base() + 0x7800);
14591456
1460      if (!state->m_fetch_charram)
1457      if (!m_fetch_charram)
14611458      {
1462         state->m_fetch_charram = 1;
1463         state->bankswitch();
1459         m_fetch_charram = 1;
1460         bankswitch();
14641461      }
14651462
14661463      return ~0;
14671464   }
14681465
1469   if (state->m_fetch_charram)
1466   if (m_fetch_charram)
14701467   {
1471      state->m_fetch_charram = 0;
1472      state->bankswitch();
1468      m_fetch_charram = 0;
1469      bankswitch();
14731470   }
14741471
14751472   return address;
r14957r14958
14771474
14781475static DRIVER_INIT( abc800m )
14791476{
1477   abc800m_state *state = machine.driver_data<abc800m_state>();
14801478   address_space *program = machine.device<cpu_device>(Z80_TAG)->space(AS_PROGRAM);
1481   program->set_direct_update_handler(direct_update_delegate(FUNC(abc800m_direct_update_handler), &machine));
1479   program->set_direct_update_handler(direct_update_delegate(FUNC(abc800m_state::abc800m_direct_update_handler), state));
14821480}
14831481
14841482
r14957r14958
14861484//  DRIVER_INIT( abc802 )
14871485//-------------------------------------------------
14881486
1489DIRECT_UPDATE_HANDLER( abc802_direct_update_handler )
1487DIRECT_UPDATE_MEMBER(abc802_state::abc802_direct_update_handler)
14901488{
1491   abc802_state *state = machine.driver_data<abc802_state>();
1492
1493   if (state->m_lrs)
1489   if (m_lrs)
14941490   {
14951491      if (address >= 0x7800 && address < 0x8000)
14961492      {
1497         direct.explicit_configure(0x7800, 0x7fff, 0x7ff, machine.region(Z80_TAG)->base() + 0x7800);
1493         direct.explicit_configure(0x7800, 0x7fff, 0x7ff, machine().region(Z80_TAG)->base() + 0x7800);
14981494         return ~0;
14991495      }
15001496   }
r14957r14958
15041500
15051501static DRIVER_INIT( abc802 )
15061502{
1503   abc802_state *state = machine.driver_data<abc802_state>();
15071504   address_space *program = machine.device<cpu_device>(Z80_TAG)->space(AS_PROGRAM);
1508   program->set_direct_update_handler(direct_update_delegate(FUNC(abc802_direct_update_handler), &machine));
1505   program->set_direct_update_handler(direct_update_delegate(FUNC(abc802_state::abc802_direct_update_handler), state));
15091506}
15101507
15111508
r14957r14958
15131510//  DRIVER_INIT( abc806 )
15141511//-------------------------------------------------
15151512
1516DIRECT_UPDATE_HANDLER( abc806_direct_update_handler )
1517{
1518   abc806_state *state = machine.driver_data<abc806_state>();
1519
1513DIRECT_UPDATE_MEMBER(abc806_state::abc806_direct_update_handler)
1514{   
15201515   if (address >= 0x7800 && address < 0x8000)
15211516   {
1522      direct.explicit_configure(0x7800, 0x7fff, 0x7ff, machine.region(Z80_TAG)->base() + 0x7800);
1517      direct.explicit_configure(0x7800, 0x7fff, 0x7ff, machine().region(Z80_TAG)->base() + 0x7800);
15231518
1524      if (!state->m_fetch_charram)
1519      if (!m_fetch_charram)
15251520      {
1526         state->m_fetch_charram = 1;
1527         state->bankswitch();
1521         m_fetch_charram = 1;
1522         bankswitch();
15281523      }
15291524
15301525      return ~0;
15311526   }
15321527
1533   if (state->m_fetch_charram)
1528   if (m_fetch_charram)
15341529   {
1535      state->m_fetch_charram = 0;
1536      state->bankswitch();
1530      m_fetch_charram = 0;
1531      bankswitch();
15371532   }
15381533
15391534   return address;
r14957r14958
15411536
15421537static DRIVER_INIT( abc806 )
15431538{
1539   abc806_state *state = machine.driver_data<abc806_state>();
15441540   address_space *program = machine.device<cpu_device>(Z80_TAG)->space(AS_PROGRAM);
1545   program->set_direct_update_handler(direct_update_delegate(FUNC(abc806_direct_update_handler), &machine));
1541   program->set_direct_update_handler(direct_update_delegate(FUNC(abc806_state::abc806_direct_update_handler), state));
15461542}
15471543
15481544
src/mess/drivers/atm.c
r14957r14958
2828      : spectrum_state(mconfig, type, tag) { }
2929
3030   DECLARE_WRITE8_MEMBER(atm_port_7ffd_w);
31   DIRECT_UPDATE_MEMBER(atm_direct);
3132};
3233
3334
34DIRECT_UPDATE_HANDLER( atm_direct )
35DIRECT_UPDATE_MEMBER(atm_state::atm_direct)
3536{
36   spectrum_state *state = machine.driver_data<spectrum_state>();
37   device_t *beta = machine.device(BETA_DISK_TAG);
38   UINT16 pc = cpu_get_reg(machine.device("maincpu"), STATE_GENPCBASE);
37   device_t *beta = machine().device(BETA_DISK_TAG);
38   UINT16 pc = cpu_get_reg(machine().device("maincpu"), STATE_GENPCBASE);
3939
4040   if (beta->started() && betadisk_is_active(beta))
4141   {
4242      if (pc >= 0x4000)
4343      {
44         state->m_ROMSelection = ((state->m_port_7ffd_data>>4) & 0x01) ? 1 : 0;
44         m_ROMSelection = ((m_port_7ffd_data>>4) & 0x01) ? 1 : 0;
4545         betadisk_disable(beta);
46         memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x010000 + (state->m_ROMSelection<<14));
46         memory_set_bankptr(machine(), "bank1", machine().region("maincpu")->base() + 0x010000 + (m_ROMSelection<<14));
4747      }
4848   }
49   else if (((pc & 0xff00) == 0x3d00) && (state->m_ROMSelection==1))
49   else if (((pc & 0xff00) == 0x3d00) && (m_ROMSelection==1))
5050   {
51      state->m_ROMSelection = 3;
51      m_ROMSelection = 3;
5252      if (beta->started())
5353         betadisk_enable(beta);
5454
5555   }
5656   if(address<=0x3fff)
5757   {
58      if (state->m_ROMSelection == 3) {
59         direct.explicit_configure(0x0000, 0x3fff, 0x3fff, machine.region("maincpu")->base() + 0x018000);
60         memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x018000);
58      if (m_ROMSelection == 3) {
59         direct.explicit_configure(0x0000, 0x3fff, 0x3fff, machine().region("maincpu")->base() + 0x018000);
60         memory_set_bankptr(machine(), "bank1", machine().region("maincpu")->base() + 0x018000);
6161      } else {
62         direct.explicit_configure(0x0000, 0x3fff, 0x3fff, machine.region("maincpu")->base() + 0x010000 + (state->m_ROMSelection<<14));
63         memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x010000 + (state->m_ROMSelection<<14));
62         direct.explicit_configure(0x0000, 0x3fff, 0x3fff, machine().region("maincpu")->base() + 0x010000 + (m_ROMSelection<<14));
63         memory_set_bankptr(machine(), "bank1", machine().region("maincpu")->base() + 0x010000 + (m_ROMSelection<<14));
6464      }
6565      return ~0;
6666   }
r14957r14958
118118
119119static MACHINE_RESET( atm )
120120{
121   spectrum_state *state = machine.driver_data<spectrum_state>();
121   atm_state *state = machine.driver_data<atm_state>();
122122   UINT8 *messram = machine.device<ram_device>(RAM_TAG)->pointer();
123123   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
124124   device_t *beta = machine.device(BETA_DISK_TAG);
r14957r14958
130130      betadisk_enable(beta);
131131      betadisk_clear_status(beta);
132132   }
133   space->set_direct_update_handler(direct_update_delegate(FUNC(atm_direct), &machine));
133   space->set_direct_update_handler(direct_update_delegate(FUNC(atm_state::atm_direct), state));
134134
135135   memset(messram,0,128*1024);
136136
src/mess/drivers/elwro800.c
r14957r14958
4444   /* NR signal */
4545   UINT8 m_NR;
4646   UINT8 m_df_on_databus;
47   
48   DECLARE_DIRECT_UPDATE_MEMBER(elwro800_direct_handler);
4749};
4850
4951
r14957r14958
5456 * (note that in CP/J mode address 66 is used for FCB)
5557 *
5658 *************************************/
57DIRECT_UPDATE_HANDLER(elwro800_direct_handler)
59DIRECT_UPDATE_MEMBER(elwro800_state::elwro800_direct_handler)
5860{
59   elwro800_state *state = machine.driver_data<elwro800_state>();
60   if (state->m_ram_at_0000 && address == 0x66)
61   if (m_ram_at_0000 && address == 0x66)
6162   {
62      direct.explicit_configure(0x66, 0x66, 0, &state->m_df_on_databus);
63      direct.explicit_configure(0x66, 0x66, 0, &m_df_on_databus);
6364      return ~0;
6465   }
6566   return address;
r14957r14958
520521   // this is a reset of ls175 in mmu
521522   elwro800jr_mmu_w(machine, 0);
522523
523   machine.device("maincpu")->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(elwro800_direct_handler), &machine));
524   machine.device("maincpu")->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(elwro800_state::elwro800_direct_handler), state));
524525}
525526
526527static const cassette_interface elwro800jr_cassette_interface =
src/mess/drivers/mpz80.c
r14957r14958
828828//  DRIVER_INIT( mpz80 )
829829//-------------------------------------------------
830830
831DIRECT_UPDATE_HANDLER( mpz80_direct_update_handler )
831DIRECT_UPDATE_MEMBER(mpz80_state::mpz80_direct_update_handler)
832832{
833   mpz80_state *state = machine.driver_data<mpz80_state>();
834
835   if (state->m_trap && address >= state->m_trap_start && address <= state->m_trap_start + 0xf)
833   if (m_trap && address >= m_trap_start && address <= m_trap_start + 0xf)
836834   {
837      direct.explicit_configure(state->m_trap_start, state->m_trap_start + 0xf, 0xf, machine.region(Z80_TAG)->base() + ((state->m_trap_reset << 10) | 0x3f0));
835      direct.explicit_configure(m_trap_start, m_trap_start + 0xf, 0xf, machine().region(Z80_TAG)->base() + ((m_trap_reset << 10) | 0x3f0));
838836      return ~0;
839837   }
840838
r14957r14958
843841
844842static DRIVER_INIT( mpz80 )
845843{
844   mpz80_state *state = machine.driver_data<mpz80_state>();
846845   address_space *program = machine.device<cpu_device>(Z80_TAG)->space(AS_PROGRAM);
847   program->set_direct_update_handler(direct_update_delegate(FUNC(mpz80_direct_update_handler), &machine));
846   program->set_direct_update_handler(direct_update_delegate(FUNC(mpz80_state::mpz80_direct_update_handler), state));
848847}
849848
850849
src/mess/drivers/cosmicos.c
r14957r14958
610610
611611/* System Drivers */
612612
613DIRECT_UPDATE_HANDLER( cosmicos_direct_update_handler )
613DIRECT_UPDATE_MEMBER(cosmicos_state::cosmicos_direct_update_handler)
614614{
615   cosmicos_state *state = machine.driver_data<cosmicos_state>();
616
617   if (state->m_boot)
615   if (m_boot)
618616   {
619617      /* force A6 and A7 high */
620      direct.explicit_configure(0x0000, 0xffff, 0x3f3f, machine.region(CDP1802_TAG)->base() + 0xc0);
618      direct.explicit_configure(0x0000, 0xffff, 0x3f3f, machine().region(CDP1802_TAG)->base() + 0xc0);
621619      return ~0;
622620   }
623621
r14957r14958
626624
627625static DRIVER_INIT( cosmicos )
628626{
627   cosmicos_state *state = machine.driver_data<cosmicos_state>();
629628   address_space *program = machine.device(CDP1802_TAG)->memory().space(AS_PROGRAM);
630629
631   program->set_direct_update_handler(direct_update_delegate(FUNC(cosmicos_direct_update_handler), &machine));
630   program->set_direct_update_handler(direct_update_delegate(FUNC(cosmicos_state::cosmicos_direct_update_handler), state));
632631}
633632
634633/*    YEAR  NAME        PARENT  COMPAT  MACHINE     INPUT       INIT        COMPANY             FULLNAME    FLAGS */
src/mess/drivers/gba.c
r14957r14958
32153215
32163216/* this emulates the GBA's hardware protection: the BIOS returns only zeros when the PC is not in it,
32173217   and some games verify that as a protection check (notably Metroid Fusion) */
3218DIRECT_UPDATE_HANDLER( gba_direct )
3218DIRECT_UPDATE_MEMBER(gba_state::gba_direct)
32193219{
3220   gba_state *state = machine.driver_data<gba_state>();
32213220   if (address > 0x4000)
32223221   {
3223      state->m_bios_protected = 1;
3222      m_bios_protected = 1;
32243223   }
32253224   else
32263225   {
3227      state->m_bios_protected = 0;
3228      state->m_bios_last_address = address;
3226      m_bios_protected = 0;
3227      m_bios_last_address = address;
32293228   }
32303229   return address;
32313230}
32323231
32333232static DRIVER_INIT(gbadv)
32343233{
3235   machine.device("maincpu")->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(gba_direct), &machine));
3234   gba_state *state = machine.driver_data<gba_state>();
3235   machine.device("maincpu")->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(gba_state::gba_direct), state));
32363236}
32373237
32383238/*    YEAR  NAME PARENT COMPAT MACHINE INPUT   INIT   COMPANY     FULLNAME */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team