Previous 199869 Revisions Next

r30815 Tuesday 3rd June, 2014 at 18:11:48 UTC by David Haywood
more notes / guesses (nw)
[src/mame/drivers]kenseim.c

trunk/src/mame/drivers/kenseim.c
r30814r30815
138138
139139   DECLARE_WRITE8_MEMBER(i8255_portc_w); // 20x LEDs
140140
141   // likely
142
143   DECLARE_READ8_MEMBER(i8255_portd_r); // mole input 1?
144   DECLARE_READ8_MEMBER(i8255_porte_r); // mole input 2?
145
141146   // uncertain
142
143//   DECLARE_READ8_MEMBER(portc_default_r) { logerror("%s read port C but no handler assigned\n", machine().describe_context()); return 0xff; }
147   DECLARE_WRITE8_MEMBER(portc_w);
148   DECLARE_WRITE8_MEMBER(portd_w);
144149   DECLARE_READ8_MEMBER(portc_r);
145//   DECLARE_READ8_MEMBER(portd_default_r) { logerror("%s read port D but no handler assigned\n", machine().describe_context()); return 0xff; }
146150   DECLARE_READ8_MEMBER(portd_r);
151   DECLARE_WRITE8_MEMBER(porte_w);
152
153   WRITE8_MEMBER(i8255_porta_w); // maybe molesa output? (6-bits?)
154   WRITE8_MEMBER(i8255_portb_w); // maybe molesb output? (6-bits?)
155   WRITE8_MEMBER(i8255_portf_w); // maybe strobe output?
156
147157   DECLARE_READ8_MEMBER(porte_default_r) { logerror("%s read port E but no handler assigned\n", machine().describe_context()); return 0xff; }
148158
149159   DECLARE_WRITE8_MEMBER(porta_default_w) { logerror("%s write %02x to port A but no handler assigned\n", machine().describe_context(), data); }
150160   DECLARE_WRITE8_MEMBER(portb_default_w) { logerror("%s write %02x to port B but no handler assigned\n", machine().describe_context(), data); }
151//   DECLARE_WRITE8_MEMBER(portc_default_w) { logerror("%s write %02x to port C but no handler assigned\n", machine().describe_context(), data); }
152   DECLARE_WRITE8_MEMBER(portc_w);
153//   DECLARE_WRITE8_MEMBER(portd_default_w) { logerror("%s write %02x to port D but no handler assigned\n", machine().describe_context(), data); }
154   DECLARE_WRITE8_MEMBER(portd_w);
155   DECLARE_WRITE8_MEMBER(porte_default_w) { logerror("%s write %02x to port E but no handler assigned\n", machine().describe_context(), data); }
156161
162
163
157164   DECLARE_READ8_MEMBER(i8255_porta_default_r) { logerror("%s i8255 read port A but no handler assigned\n", machine().describe_context()); return 0xff; }
158165   DECLARE_READ8_MEMBER(i8255_portb_default_r) { logerror("%s i8255 read port B but no handler assigned\n", machine().describe_context()); return 0xff; }
159166   DECLARE_READ8_MEMBER(i8255_portc_default_r) { logerror("%s i8255 read port C but no handler assigned\n", machine().describe_context()); return 0xff; }
160167
161   DECLARE_WRITE8_MEMBER(i8255_porta_default_w) { logerror("%s i8255 write %02x to port A but no handler assigned\n", machine().describe_context(), data); } // maybe molesa output? (6-bits?)
162   DECLARE_WRITE8_MEMBER(i8255_portb_default_w) { logerror("%s i8255 write %02x to port B but no handler assigned\n", machine().describe_context(), data); } // maybe molesb output? (6-bits?)
163168
164   DECLARE_READ8_MEMBER(i8255_portd_default_r) { logerror("%s i8255 read port D but no handler assigned\n", machine().describe_context()); return 0xff; }
165   DECLARE_READ8_MEMBER(i8255_porte_default_r) { logerror("%s i8255 read port E but no handler assigned\n", machine().describe_context()); return 0xff; }
166169   DECLARE_READ8_MEMBER(i8255_portf_default_r) { logerror("%s i8255 read port F but no handler assigned\n", machine().describe_context()); return 0xff; }
167170
168171   DECLARE_WRITE8_MEMBER(i8255_portd_default_w) { logerror("%s i8255 write %02x to port D but no handler assigned\n", machine().describe_context(), data); }
169172   DECLARE_WRITE8_MEMBER(i8255_porte_default_w) { logerror("%s i8255 write %02x to port E but no handler assigned\n", machine().describe_context(), data); }
170   DECLARE_WRITE8_MEMBER(i8255_portf_default_w) { logerror("%s i8255 write %02x to port F but no handler assigned\n", machine().describe_context(), data); }
171173
172174
173175   UINT32 m_led_serial_data;
r30814r30815
220222
221223}
222224
225// i8255 ports D and E tend to be used together in the code, and the input gets masked with 6 bits (0x3f)
226READ8_MEMBER(kenseim_state::i8255_portd_r)
227{
228   logerror("%s i8255 read port D (mole matrix / sensors input 1?)\n", machine().describe_context());
229   //return 0xff;
230   return rand();// 0x00;
231}
232
233READ8_MEMBER(kenseim_state::i8255_porte_r)
234{
235   logerror("%s i8255 read port E (mole matrix / sensors input 2?)\n", machine().describe_context());
236   //return 0xff;
237   return rand();// 0x00;
238}
239
240WRITE8_MEMBER(kenseim_state::i8255_porta_w) // maybe molesa output? (6-bits?)
241{
242   logerror("%s i8255 write %02x to port A (mole output 1?)\n", machine().describe_context(), data);
243}
244
245WRITE8_MEMBER(kenseim_state::i8255_portb_w) // maybe molesb output? (6-bits?)
246{
247   logerror("%s i8255 write %02x to port B (mole output 2?)\n", machine().describe_context(), data);
248}
249
250WRITE8_MEMBER(kenseim_state::i8255_portf_w)
251{
252   // typically written when the 'moles' output is, maybe the 2 strobes?
253   logerror("%s i8255 write %02x to port F (strobe?)\n", machine().describe_context(), data);
254}
255
256
223257WRITE8_MEMBER(kenseim_state::portc_w)
224258{
225259   logerror("%s write %02x to port C\n", machine().describe_context(), data);
r30814r30815
230264   logerror("%s write %02x to port D\n", machine().describe_context(), data);
231265}
232266
267WRITE8_MEMBER(kenseim_state::porte_w)
268{
269   // only access is at 0ABE, surrounded by port D reads / writes
270   logerror("%s write %02x to port E\n", machine().describe_context(), data);
271}
233272
234
235273READ8_MEMBER(kenseim_state::portd_r)
236274{
237275   // comms port maybe? checks for 0x10 (bit 4,a) to be clear in a tight loop (092B) then for bit 0x80 to be set in another tight loop  (0933) then at (0947) it checks that bits 0xe0 aren't set.
r30814r30815
282320
283321      data >>= 8;;
284322
285      logerror("%s cps1_kensei_w offs %04x, %02x (from 68k?)\n", machine().describe_context(), offset * 2, data);
323      logerror("%s cps1_kensei_w offs %04x (from 68k to DRIVE BOARD via CN2) (%02x) (%d ACK,  %d ST4,  %d ST3,  %d ST2) \n", machine().describe_context(), offset * 2, data, (data & 0x01), ((data & 0x02)>>1),((data & 0x04)>>2),((data & 0x08)>>3)   );
286324
287      if ((data != 0x02) && (data != 0x03) && (data != 0x04) && (data != 0x05) && (data != 0x83))
288         logerror("  ^^ (unknown?)\n");
325
326      if (data & 0xf0)
327         logerror("  ^^ (unknown? %02x)\n", data & 0xf0);
289328   }
290329   else
291330   {
r30814r30815
411450      togglecount++;
412451
413452
414
415453      int in = 0x00;
416      in |= 0x40; // don't want cps1 test mode (leftover)
454      in |= 0x40; // don't want cps1 test mode (leftover) (not connected)
417455     
456      in |= 0x04;// line D9
457
418458      if (togglecount == 3)
419459      {
420         in |= 0x10; // won't read commands otherwise?
460         in |= 0x10; // won't read commands otherwise? (REQ line)
421461         togglecount = 0;
422462      }   
423463     
424464     
425      //in |= 0x20;
465      //in |= 0x20; // LVm line
426466
427467      logerror("%s kensei_dsw_r offs %04x (comms?), (%04x) (returning %02x)\n", machine().describe_context(), offset *2, mem_mask, in);
428468
r30814r30815
438478   MCFG_CPU_ADD("gamecpu", TMPZ84C011, XTAL_16MHz/2) // tmpz84c011 - divider unknown
439479   MCFG_CPU_PROGRAM_MAP(kenseim_map)
440480   MCFG_CPU_IO_MAP(kenseim_io_map)
441   MCFG_TMPZ84C011_PORTA_WRITE_CALLBACK(WRITE8(kenseim_state, porta_default_w))
442   MCFG_TMPZ84C011_PORTB_WRITE_CALLBACK(WRITE8(kenseim_state, portb_default_w))
481   MCFG_TMPZ84C011_PORTA_WRITE_CALLBACK(WRITE8(kenseim_state, porta_default_w)) // unused?
482   MCFG_TMPZ84C011_PORTB_WRITE_CALLBACK(WRITE8(kenseim_state, portb_default_w)) // unused?
443483   MCFG_TMPZ84C011_PORTC_WRITE_CALLBACK(WRITE8(kenseim_state, portc_w))
444484   MCFG_TMPZ84C011_PORTD_WRITE_CALLBACK(WRITE8(kenseim_state, portd_w))
445   MCFG_TMPZ84C011_PORTE_WRITE_CALLBACK(WRITE8(kenseim_state, porte_default_w))   
485   MCFG_TMPZ84C011_PORTE_WRITE_CALLBACK(WRITE8(kenseim_state, porte_w))   
446486   MCFG_TMPZ84C011_PORTA_READ_CALLBACK(READ8(kenseim_state, porta_r))
447487   MCFG_TMPZ84C011_PORTB_READ_CALLBACK(READ8(kenseim_state, portb_r))
448488   MCFG_TMPZ84C011_PORTC_READ_CALLBACK(READ8(kenseim_state, portc_r))
449489   MCFG_TMPZ84C011_PORTD_READ_CALLBACK(READ8(kenseim_state, portd_r))
450   MCFG_TMPZ84C011_PORTE_READ_CALLBACK(READ8(kenseim_state, porte_default_r))
490   MCFG_TMPZ84C011_PORTE_READ_CALLBACK(READ8(kenseim_state, porte_default_r)) // unused?
451491   MCFG_CPU_CONFIG(daisy_chain_gamecpu)
452492
453493   MCFG_DEVICE_ADD("gamecpu_ctc", Z80CTC, XTAL_16MHz/2 ) // part of the tmpz84?
r30814r30815
458498   MCFG_I8255_IN_PORTA_CB(READ8(kenseim_state, i8255_porta_default_r))
459499   MCFG_I8255_IN_PORTB_CB(READ8(kenseim_state, i8255_portb_default_r))
460500   MCFG_I8255_IN_PORTC_CB(READ8(kenseim_state, i8255_portc_default_r))
461   MCFG_I8255_OUT_PORTA_CB(WRITE8(kenseim_state, i8255_porta_default_w))
462   MCFG_I8255_OUT_PORTB_CB(WRITE8(kenseim_state, i8255_portb_default_w))
501   MCFG_I8255_OUT_PORTA_CB(WRITE8(kenseim_state, i8255_porta_w))
502   MCFG_I8255_OUT_PORTB_CB(WRITE8(kenseim_state, i8255_portb_w))
463503   MCFG_I8255_OUT_PORTC_CB(WRITE8(kenseim_state, i8255_portc_w))
464504
465505   MCFG_DEVICE_ADD("i8255_2", I8255, 0) // MB89363B!
466   MCFG_I8255_IN_PORTA_CB(READ8(kenseim_state, i8255_portd_default_r))
467   MCFG_I8255_IN_PORTB_CB(READ8(kenseim_state, i8255_porte_default_r))
506   MCFG_I8255_IN_PORTA_CB(READ8(kenseim_state, i8255_portd_r))
507   MCFG_I8255_IN_PORTB_CB(READ8(kenseim_state, i8255_porte_r))
468508   MCFG_I8255_IN_PORTC_CB(READ8(kenseim_state, i8255_portf_default_r))
469509   MCFG_I8255_OUT_PORTA_CB(WRITE8(kenseim_state, i8255_portd_default_w))
470510   MCFG_I8255_OUT_PORTB_CB(WRITE8(kenseim_state, i8255_porte_default_w))
471   MCFG_I8255_OUT_PORTC_CB(WRITE8(kenseim_state, i8255_portf_default_w))
511   MCFG_I8255_OUT_PORTC_CB(WRITE8(kenseim_state, i8255_portf_w))
472512
473513
474514   MCFG_QUANTUM_PERFECT_CPU("maincpu")
475515MACHINE_CONFIG_END
476516
517/* how the DRIVE PCB connects to the inputs, see comments after each line
477518
519   PORT_START("IN0")
520   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) // n/c
521   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) // n/c
522   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) // D9
523   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c?
524   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // REQ
525   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) // LVm
526   PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) // n/c
527   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c?
528
529   PORT_START("IN1")
530   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) // D5
531   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) // D6
532   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) // D7
533   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) // D8
534   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // n/c
535   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // n/c
536   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // n/c
537   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c?
538   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) // D1
539   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) // D2
540   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) // D3
541   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) // D4
542   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // n/c
543   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // n/c
544   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // n/c
545   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c?
546*/
547
478548static INPUT_PORTS_START( kenseim )
479549   // the regular CPS1 input ports are used for comms with the extra board
480550   PORT_START("IN0")

Previous 199869 Revisions Next


© 1997-2024 The MAME Team