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
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
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
ok so i don't have a pin like the cart slot, thx you for your answer![]()
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
There are currently 1 users browsing this thread. (0 members and 1 guests)