Jissen Mahjong controller: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(edit my hastily-mentioned findings from yesterday in more fluidly; add cat:controllers; link to wikipedia for explanation of katakana-labeled buttons)
Line 1: Line 1:
[[Category:Controllers]]
This is a 21-button controller used by the following Capcom games:
This is a 21-button controller used by the following Capcom games:
*''Ide Yousuke Meijin no Jissen Mahjong''
*''Ide Yousuke Meijin no Jissen Mahjong''
Line 10: Line 11:
|}
|}


The カン (kan), ポン (pon), チー (chii), リーチ (riichi) and ロン (ron) buttons appear to be Mahjong-related.<ref name="Mahjong">[http://www.appbank.net/2016/05/25/iphone-application/1208030.php Japanese website with mentions to カン, ポン and チー]</ref><ref name="wikipedia">[[wikipedia:Japanese Mahjong]]</ref>
The [[wikipedia:Japanese Mahjong#Kan|カン (kan)]], [[wikipedia:Japanese Mahjong#Pon|ポン (pon)]], [[wikipedia:Japanese Mahjong#Ch.C4.AB|チー (chii)]], [[wikipedia:Japanese Mahjong#R.C4.ABchi|リーチ (riichi)]] and [[wikipedia:Japanese Mahjong#Winning|ロン (ron)]] buttons are Mahjong-related.


== Hardware interface ==
== Hardware interface ==
Line 32: Line 33:
         +- Serial data
         +- Serial data


''Note:'' The following is my assumption on how the hardware works based on nocash's documentation and could be partially incorrect.<ref name="nocash">[http://problemkaputt.de/everynes.htm#controllerskeypads Jissen Mahjong controller specs]</ref>
Reading the buttons is very similar to the [[standard controller]], but one of three rows is selected for loading values ''into'' the shift register depending on the contents of the two Row selection pins while the Strobe bit is high.


After toggling the strobe bit from 1 to 0, the controller will return 8 bits worth of data (1 bit per read) based on the "row selection" bits.
After toggling the strobe bit from 1 to 0, the controller will return 8 bits worth of data (1 bit per read) based on the "row selection" bits.
  Row 0 returns no data (?).
  Row 3 returns: <empty>, ロン, リーチ, チー, ポン, カン, Start, Select
Row 2 returns: H, G, F, E, D, C, B, A
  Row 1 returns: <empty>, <empty>, N, M, L, K, J, I
  Row 1 returns: <empty>, <empty>, N, M, L, K, J, I
  Row 2 returns: H, G, F, E, D, C, B, A
  Row 0 returns the bitwise OR of rows 1 and 2.
Row 3 returns: <empty>, ロン, リーチ, チー, ポン, カン, Start, Select


Buttons return 0 when held down, 1 otherwise.
Like the standard controller, buttons return 1 when extant and held down, 0 otherwise.


The buttons are arranged as a 3x8 keyboard matrix similar to the Famicom keyboard. A variety of diodes, resistors, and an NPN BJT pull one of the rows low; the eight columns are then loaded into the same 4021 shift register as used on the standard controller. It tentatively looks selecting row 0 should effectively scan both rows 1 and 2 simultaneously (i.e. 0 if either button is pressed) <ref name="reverse">[http://www.asahi-net.or.jp/~za4m-tksm/hardoff/ideyousuke.htm (?whose?) reverse engineered schematic]</ref> <!-- http://archive.is/k6jkR in case that link ever goes away --> The Serial Input to the 4021 is tied to ground; all subsequent reads beyond the first eight should return 0V (logic 1 due to the 74368 inside the Famicom).
The buttons are arranged as a 3x8 keyboard matrix similar to the Famicom keyboard. A variety of diodes, resistors, and an NPN BJT pull one of the rows low; the eight columns are then loaded into the same 4021 shift register as used on the standard controller. <ref name="reverse">[http://www.asahi-net.or.jp/~za4m-tksm/hardoff/ideyousuke.htm (?whose?) reverse engineered schematic]</ref> <!-- http://archive.is/k6jkR in case that link ever goes away --> The Serial Input to the 4021 is tied to ground; all subsequent reads beyond the first eight should return 0V (logic 1 due to the 74368 inside the Famicom).


Notes:
Like the [[Family BASIC Keyboard]], there are no diodes to prevent [[wikipedia:Rollover (key)#Key jamming and ghosting|ghosting]], and pressing three buttons simultaneously could cause the incorrect detection of a 4th button press.
*The exact order of the first 5 buttons on row 3 is unconfirmed(?) (the order written here makes sense considering the button order used in rows 1 & 2).
*The output for <empty> bits or any reads beyond the first 8 bits is unconfirmed. (?)


== References ==
== References ==
<references />
<references />
* [http://problemkaputt.de/everynes.htm#controllerskeypads EveryNES§Jissen Mahjong controller specs]

Revision as of 17:33, 15 October 2017

This is a 21-button controller used by the following Capcom games:

  • Ide Yousuke Meijin no Jissen Mahjong
  • Ide Yousuke Meijin no Jissen Mahjong 2

Button layout

A B C D E F G H I J K L M
SEL ST カン ポン チー リーチ ロン

The カン (kan), ポン (pon), チー (chii), リーチ (riichi) and ロン (ron) buttons are Mahjong-related.

Hardware interface

Input ($4016 write)

7  bit  0
---- ----
xxxx xRRS
      |||
      ||+- Strobe
      |+-- Row selection (bit 0)
      +--- Row selection (bit 1)

Output ($4017 read)

7  bit  0
---- ----
xxxx xxDx
       |
       +- Serial data

Reading the buttons is very similar to the standard controller, but one of three rows is selected for loading values into the shift register depending on the contents of the two Row selection pins while the Strobe bit is high.

After toggling the strobe bit from 1 to 0, the controller will return 8 bits worth of data (1 bit per read) based on the "row selection" bits.

Row 3 returns: <empty>, ロン, リーチ, チー, ポン, カン, Start, Select
Row 2 returns: H, G, F, E, D, C, B, A
Row 1 returns: <empty>, <empty>, N, M, L, K, J, I
Row 0 returns the bitwise OR of rows 1 and 2.

Like the standard controller, buttons return 1 when extant and held down, 0 otherwise.

The buttons are arranged as a 3x8 keyboard matrix similar to the Famicom keyboard. A variety of diodes, resistors, and an NPN BJT pull one of the rows low; the eight columns are then loaded into the same 4021 shift register as used on the standard controller. [1] The Serial Input to the 4021 is tied to ground; all subsequent reads beyond the first eight should return 0V (logic 1 due to the 74368 inside the Famicom).

Like the Family BASIC Keyboard, there are no diodes to prevent ghosting, and pressing three buttons simultaneously could cause the incorrect detection of a 4th button press.

References