Quantcast

Results 1 to 5 of 5

Thread: megadrive controller port enable?

  1. #1
    Road Rasher dadou's Avatar
    Join Date
    Mar 2010
    Age
    36
    Posts
    278
    Rep Power
    15

    Default megadrive controller port enable?

    hi, i would like to know if on the controller port of a megadrive we have a pin "controller_in" or something similiar to "cart_in" which give us if a cartridge is inserted or not

    thx you for your answer

  2. #2
    ESWAT Veteran Chilly Willy's Avatar
    Join Date
    Feb 2009
    Posts
    6,744
    Rep Power
    81

    Default

    You have to read the port in the "standard" way and look at the results to determine if a controller is inserted or not.

    Here's some code that will read 3 or 6 button pads, or return 0xF000 is no pad is found:

    Code:
    | get current pad value
    | entry: a0 = pad control port
    | exit:  d2 = pad value (0 0 0 1 M X Y Z S A C B R L D U) or (0 0 0 0 0 0 0 0 S A C B R L D U)
    get_pad:
            bsr.b   get_input       /* - 0 s a 0 0 d u - 1 c b r l d u */
            move.w  d0,d1
            andi.w  #0x0C00,d0
            bne.b   no_pad
            bsr.b   get_input       /* - 0 s a 0 0 d u - 1 c b r l d u */
            bsr.b   get_input       /* - 0 s a 0 0 0 0 - 1 c b m x y z */
            move.w  d0,d2
            bsr.b   get_input       /* - 0 s a 1 1 1 1 - 1 c b r l d u */
            andi.w  #0x0F00,d0      /* 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 */
            cmpi.w  #0x0F00,d0
            beq.b   common          /* six button pad */
            move.w  #0x010F,d2      /* three button pad */
    common:
            lsl.b   #4,d2           /* - 0 s a 0 0 0 0 m x y z 0 0 0 0 */
            lsl.w   #4,d2           /* 0 0 0 0 m x y z 0 0 0 0 0 0 0 0 */
            andi.w  #0x303F,d1      /* 0 0 s a 0 0 0 0 0 0 c b r l d u */
            move.b  d1,d2           /* 0 0 0 0 m x y z 0 0 c b r l d u */
            lsr.w   #6,d1           /* 0 0 0 0 0 0 0 0 s a 0 0 0 0 0 0 */
            or.w    d1,d2           /* 0 0 0 0 m x y z s a c b r l d u */
            eori.w  #0x1FFF,d2      /* 0 0 0 1 M X Y Z S A C B R L D U */
            rts
    
    no_pad:
            move.w  #0xF000,d2
            rts
    
    | read single phase from controller
    get_input:
            move.b  #0x00,(a0)
            nop
            nop
            move.b  (a0),d0
            move.b  #0x40,(a0)
            lsl.w   #8,d0
            move.b  (a0),d0
            rts

  3. #3
    Road Rasher dadou's Avatar
    Join Date
    Mar 2010
    Age
    36
    Posts
    278
    Rep Power
    15

    Default

    ok so i don't have a pin like the cart slot, thx you for your answer

  4. #4

    Join Date
    Jan 2011
    Posts
    1
    Rep Power
    0

    Default

    hi,
    First of all the Megadrive-controller has 9 pins, the Neo Geo Controller has 15 pins. The Megadrive-controller has some coding, it sends serial signals to the console. The Neo Geo has a 1:1 pinout, every button and every direction has it own pin on the controller port, so it's easy to build an own controller for the Neo Geo with standard-arcade-parts.

    But you can use the Megadrive-controller on the Atari 2600 and 7800, also on Atari ST, C64, Amiga and every other computer and console that uses the standard-9-pin-layout with only 1 button, also on the Mastersystem. But not on Neo Geo
    mary

  5. #5
    Wildside Expert fr@ser's Avatar
    Join Date
    Sep 2006
    Location
    NEWCASTLE -UK
    Age
    43
    Posts
    124
    Rep Power
    18

    Default

    Quote Originally Posted by mary123 View Post
    hi,
    First of all the Megadrive-controller has 9 pins, the Neo Geo Controller has 15 pins. The Megadrive-controller has some coding, it sends serial signals to the console. The Neo Geo has a 1:1 pinout, every button and every direction has it own pin on the controller port, so it's easy to build an own controller for the Neo Geo with standard-arcade-parts.

    But you can use the Megadrive-controller on the Atari 2600 and 7800, also on Atari ST, C64, Amiga and every other computer and console that uses the standard-9-pin-layout with only 1 button, also on the Mastersystem. But not on Neo Geo
    It should be easy enough to build a 3 button mega drive pad .All it needs is the 74157 mux IC ,a db9 (male type)and a few high value pullup resistors 10/20K ? The 6 button pad is a different matter though .
    Quote Originally Posted by Knuckle Duster-www.sega-16.com

    The PSP GO is the biggest video game fuck up of the past decade!

    'Why' would anybody want to pay $250 for "Digital Distribution Only" with no access to the established library of a 5 year old platform?

    It isn't backward compatible with it's own AV cables, power chargers, memory card standard, or UMD library. It only uses a proprietary USB cable for no explained reason. It doesn't even have 802.11g support, it's only 802.11b!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •