Previous 199869 Revisions Next

r22512 Tuesday 23rd April, 2013 at 18:00:33 UTC by hap
reimplemented mlanding analog controls, but it's still about as bad as it was before
[src/mame/drivers]mlanding.c

trunk/src/mame/drivers/mlanding.c
r22511r22512
44
55driver by Tomasz Slanina, Phil Bennett & Angelo Salese, based on early work by David Haywood
66
7Dual 68k + 2xZ80 + tms DSP
7Dual 68k + 2xZ80 + TMS32025 DSP
8YM2151, msm5205
9TC0140SYT, other Taito ICs unknown
810no other hardware info..
911
1012TODO:
13- Analog controls are very stiff;
1114- Palette banking;
1215- Comms between the five CPUs;
13- Gameplay looks stiff;
16- What is the unknown ROM ml_b0936 for?;
17- Emulate 'mecha drive' (motors);
1418- Needs a custom artwork for the cloche status;
1519- clean-ups!
1620
r22511r22512
339343      m_mechacpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
340344}
341345
346
342347READ16_MEMBER(mlanding_state::ml_analog1_lsb_r)
343348{
344   return ioport("STICKX")->read() & 0xff;
349   return ioport("STICK1")->read() & 0xff;
345350}
346351
347352READ16_MEMBER(mlanding_state::ml_analog2_lsb_r)
348353{
349   return ioport("STICKY")->read() & 0xff;
354   return ioport("STICK2")->read() & 0xff;
350355}
351356
352357READ16_MEMBER(mlanding_state::ml_analog3_lsb_r)
353358{
354   return (ioport("STICKZ")->read() & 0xff);
359   return ioport("STICK3")->read() & 0xff;
355360}
356361
357/*
358    PORT_START("IN3")
359    PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) //high bits of counter 3
360    PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_TOGGLE
361    PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Slot Down") PORT_TOGGLE
362    PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Slot Up") PORT_TOGGLE
363    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
364    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
365    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
366
367    PORT_START("IN4")
368    PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) //high bits of counter 2
369    PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_TOGGLE
370    PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_TOGGLE
371    PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_TOGGLE
372    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
373    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
374    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
375*/
376
377362/* high bits of analog inputs + "limiters"/ADC converters. */
378363READ16_MEMBER(mlanding_state::ml_analog1_msb_r)
379364{
380   return ((ioport("STICKY")->read() & 0xf00)>>8) | (ioport("IN2")->read() & 0xf0);
365   // d0-d3: counter 1 high bits
366   // d4: handle left
367   // d5: slot down
368   // d6: slot up
369   // d7: ?
370   UINT8 throttle = ioport("STICK1")->read();
371   UINT16 x = ioport("STICK2")->read();
372   
373   UINT8 res = 0xf0;
374
375   if (throttle & 0x80)
376      res ^= 0x2f;
377   else if (throttle > 0)
378      res ^= 0x40;
379   
380   if (!(x & 0x800) && x > 0)
381      res ^= 0x10;
382   
383   return res;
381384}
382385
383386READ16_MEMBER(mlanding_state::ml_analog2_msb_r)
384387{
385   UINT8 res;
386   UINT16 y_adc,x_adc;
387
388   y_adc = ioport("STICKY")->read();
389   x_adc = ioport("STICKZ")->read();
390
391   res = 0;
392
393   if(x_adc == 0 || (!(x_adc & 0x800)))
394      res = 0x20;
395
396   if(y_adc == 0)
397      res|= 0x50;
398   else if(y_adc & 0x800)
399      res|= 0x10;
400   else
401      res|= 0x40;
402
403//  popmessage("%04x %04x",x_adc,y_adc);
404
405   return ((ioport("STICKZ")->read() & 0xf00)>>8) | res;
388   // d0-d3: counter 2 high bits
389   // d4-d7: ?
390   return (ioport("STICK2")->read() >> 8 & 0x0f) | 0xf0;
406391}
407392
408393READ16_MEMBER(mlanding_state::ml_analog3_msb_r)
409394{
410   UINT8 z_adc,res;
411   UINT16 x_adc;
395   // d0-d3: counter 3 high bits
396   // d4: handle up
397   // d5: handle right
398   // d6: handle down
399   // d7: ?
400   UINT16 x = ioport("STICK2")->read();
401   UINT16 y = ioport("STICK3")->read();
402   
403   UINT8 res = (y >> 8 & 0x0f) | 0xf0;
412404
413   z_adc = ioport("STICKX")->read();
414   x_adc = ioport("STICKZ")->read();
405   if (y & 0x800)
406      res ^= 0x40;
407   else if (y > 0)
408      res ^= 0x10;
409   
410   if (x & 0x800)
411      res ^= 0x20;
412   
413   return res;
414}
415415
416   res = 0;
417416
418   if(z_adc == 0)
419      res = 0x60;
420   else if(z_adc & 0x80)
421      res = 0x20;
422   else
423      res = 0x40;
424417
425   if(x_adc & 0x800 || x_adc == 0)
426      res|= 0x10;
427418
428   return ((ioport("STICKX")->read() & 0xf00)>>8) | res;
429}
430
431
432419READ16_MEMBER(mlanding_state::ml_power_ram_r)
433420{
434421   return m_power_ram[offset * 2] << 8 | m_power_ram[offset * 2 + 1];
r22511r22512
463450   AM_RANGE(0x290000, 0x290001) AM_READ_PORT("IN1")
464451   AM_RANGE(0x290002, 0x290003) AM_READ_PORT("IN0")
465452
466   AM_RANGE(0x240004, 0x240005) AM_NOP //watchdog ??
453   AM_RANGE(0x240004, 0x240005) AM_READNOP // watchdog?
467454   AM_RANGE(0x240006, 0x240007) AM_READ(io1_r) // vblank ?
468455   AM_RANGE(0x2a0000, 0x2a0001) AM_WRITE(ml_output_w)
469456
470   /*  */
471   AM_RANGE(0x2b0000, 0x2b0001) AM_READ(ml_analog1_lsb_r)      //-40 .. 40 analog controls ?
472   AM_RANGE(0x2b0004, 0x2b0005) AM_READ(ml_analog2_lsb_r)      //-40 .. 40 analog controls ?
473   AM_RANGE(0x2b0006, 0x2b0007) AM_READ(ml_analog1_msb_r) // tested in service mode, dips?
474   AM_RANGE(0x2c0000, 0x2c0001) AM_READ(ml_analog3_lsb_r)      //-60 .. 60 analog controls ?
475   AM_RANGE(0x2c0002, 0x2c0003) AM_READ(ml_analog2_msb_r)
476   AM_RANGE(0x2b0002, 0x2b0003) AM_READ(ml_analog3_msb_r)      // IN2/IN3 could be switched
457   AM_RANGE(0x2b0000, 0x2b0001) AM_READ(ml_analog1_lsb_r)
458   AM_RANGE(0x2b0002, 0x2b0003) AM_READ(ml_analog1_msb_r)
459   AM_RANGE(0x2b0004, 0x2b0005) AM_READ(ml_analog2_lsb_r)
460   AM_RANGE(0x2b0006, 0x2b0007) AM_READ(ml_analog2_msb_r)
461
462   AM_RANGE(0x2c0000, 0x2c0001) AM_READ(ml_analog3_lsb_r)
463   AM_RANGE(0x2c0002, 0x2c0003) AM_READ(ml_analog3_msb_r)
477464ADDRESS_MAP_END
478465
479466
r22511r22512
671658   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
672659   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
673660
674   PORT_START("IN2")
675   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) //high bits of counter 1
676   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
677   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
678   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
679   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
680   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
681   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
682   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
683   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
684   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
685   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
686   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
687   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
661   PORT_START("STICK1")    /* Stick 1 (3) */
662   PORT_BIT( 0x00ff, 0x0000, IPT_AD_STICK_Z ) PORT_MINMAX(0x0080,0x007f) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x10) PORT_PLAYER(1) PORT_REVERSE
688663
689   PORT_START("IN3")
690   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) //high bits of counter 3
691   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_TOGGLE
692   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Slot Down") PORT_TOGGLE
693   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Slot Up") PORT_TOGGLE
694   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
695   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
696   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
664   PORT_START("STICK2")    /* Stick 2 (4) */
665   PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0x0800,0x07ff) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x80) PORT_PLAYER(1)
697666
698   PORT_START("IN4")
699   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) //high bits of counter 2
700   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_TOGGLE
701   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_TOGGLE
702   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_TOGGLE
703   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
704   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
705   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
706
707   PORT_START("STICKX")    /* Stick 1 (3) */
708   PORT_BIT( 0x00ff, 0x0000, IPT_AD_STICK_Z ) PORT_MINMAX(0x0080,0x007f) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_REVERSE
709
710   PORT_START("STICKY")    /* Stick 2 (4) */
711   PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0x0800,0x07ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1)
712
713   PORT_START("STICKZ")    /* Stick 3 (5) */
714   PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0x0800,0x07ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1)
667   PORT_START("STICK3")    /* Stick 3 (5) */
668   PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0x0800,0x07ff) PORT_SENSITIVITY(100) PORT_KEYDELTA(0x80) PORT_PLAYER(1)
715669INPUT_PORTS_END
716670
717671static const msm5205_interface msm5205_config =

Previous 199869 Revisions Next


© 1997-2024 The MAME Team