Previous 199869 Revisions Next

r18106 Monday 24th September, 2012 at 06:18:05 UTC by Fabio Priuli
(MESS) nes: fixed regression in the famicom keyboard, introduced at some point in mid-2011. [Fabio Priuli]
[src/mess/machine]nes.c

trunk/src/mess/machine/nes.c
r18105r18106
332332   int cfg = ioport("CTRLSEL")->read();
333333   int ret;
334334
335   if ((cfg & 0x000f) >= 0x07)   // for now we treat the FC keyboard separately from other inputs!
335   if ((cfg & 0x000f) >= 0x08)   // for now we treat the FC keyboard separately from other inputs!
336336   {
337337      // here we should have the tape input
338338      ret = 0;
r18105r18106
384384static UINT8 nes_read_fc_keyboard_line( running_machine &machine, UINT8 scan, UINT8 mode )
385385{
386386   static const char *const fc_keyport_names[] = { "FCKEY0", "FCKEY1", "FCKEY2", "FCKEY3", "FCKEY4", "FCKEY5", "FCKEY6", "FCKEY7", "FCKEY8" };
387   return ((machine.root_device().ioport(fc_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1;
387   nes_state *state = machine.driver_data<nes_state>();
388   return ((state->ioport(fc_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1;
388389}
389390
390391static UINT8 nes_read_subor_keyboard_line( running_machine &machine, UINT8 scan, UINT8 mode )
391392{
392393   static const char *const sub_keyport_names[] = { "SUBKEY0", "SUBKEY1", "SUBKEY2", "SUBKEY3", "SUBKEY4",
393394      "SUBKEY5", "SUBKEY6", "SUBKEY7", "SUBKEY8", "SUBKEY9", "SUBKEY10", "SUBKEY11", "SUBKEY12" };
394   return ((machine.root_device().ioport(sub_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1;
395   nes_state *state = machine.driver_data<nes_state>();
396   return ((state->ioport(sub_keyport_names[scan])->read() >> (mode * 4)) & 0x0f) << 1;
395397}
396398
397399READ8_MEMBER(nes_state::nes_IN1_r)
r18105r18106
399401   int cfg = ioport("CTRLSEL")->read();
400402   int ret;
401403
402   if ((cfg & 0x000f) == 0x07)   // for now we treat the FC keyboard separately from other inputs!
404   if ((cfg & 0x000f) == 0x08)   // for now we treat the FC keyboard separately from other inputs!
403405   {
404406      if (m_fck_scan < 9)
405407         ret = ~nes_read_fc_keyboard_line(machine(), m_fck_scan, m_fck_mode) & 0x1e;
406408      else
407409         ret = 0x1e;
408410   }
409   else if ((cfg & 0x000f) == 0x08)   // for now we treat the Subor keyboard separately from other inputs!
411   else if ((cfg & 0x000f) == 0x09)   // for now we treat the Subor keyboard separately from other inputs!
410412   {
411413      if (m_fck_scan < 12)
412414         ret = ~nes_read_subor_keyboard_line(machine(), m_fck_scan, m_fck_mode) & 0x1e;
r18105r18106
554556   /* Check if lightgun has been chosen as input: if so, enable crosshair */
555557   machine().scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
556558
557   if ((cfg & 0x000f) >= 0x07)   // for now we treat the FC keyboard separately from other inputs!
559   if ((cfg & 0x000f) >= 0x08)   // for now we treat the FC keyboard separately from other inputs!
558560   {
559561      // here we should also have the tape output
560562

Previous 199869 Revisions Next


© 1997-2024 The MAME Team