{"id":1158,"date":"2018-09-19T22:31:34","date_gmt":"2018-09-19T21:31:34","guid":{"rendered":"http:\/\/blog.blockos.org\/?p=1158"},"modified":"2018-09-20T08:15:00","modified_gmt":"2018-09-20T07:15:00","slug":"fred-astaires-doppelganger","status":"publish","type":"post","link":"https:\/\/blog.blockos.org\/?p=1158","title":{"rendered":"Fred Astaire&#8217;s Doppelg\u00e4nger"},"content":{"rendered":"\n<p>Oh crap&#8230; This blog is getting dusty. Anyway, let&#8217;s get started!<\/p>\n\n\n\n<p>I compared the Street Fighter 2 Champion Edition joypad routine with the one from\u00a0<a href=\"http:\/\/blockos.github.io\/HuDK\/doc\/files\/include\/joypad-s.html\">HuDK<\/a>. One of the most interesting thing is that SF2 performs an extra joyport read after reading the 5 joypad states in order to check if a Multitap (PI-PD003) is there. If the returned value is <strong>$F0<\/strong>, we have a Multitap.<\/p>\n\n\n\n<p>Is there a way to detect how many joypads are plugged? What about the other <a href=\"http:\/\/www6.airnet.ne.jp\/wataru\/pce\/pce_tap.htm\">multitaps<\/a>?\u00a0<\/p>\n\n\n\n<p>Hopefully a Twin Tap and a Twin Commander magically landed on my desk for some time (thanks <a href=\"https:\/\/twitter.com\/_Adoru_\">Adoru<\/a>).<\/p>\n\n\n\n<p>Let&#8217;s start with the Twin Tap. It&#8217;s a 2 ports multitap. Unfortunately there&#8217;s no way to detect available joypads or a 2 ports multitap.<\/p>\n\n\n\n<p>Anyway! This multitap has some interesting\u00a0peculiarity. If you check the you&#8217;ll see that there&#8217;s not 2 but 3 ports and a 3 positions selector switch. Why is there a third connector and a selector switch? I&#8217;m afraid we&#8217;ll never know.<\/p>\n\n\n\n<p>The selector switch changes the joypads order. This means that the joypads plugged in the Twin Tap will appeared at a different position in the joypad read routine. Here&#8217;s a table with the switch positions and the joypad &#8220;positions&#8221;.<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-3 wp-block-columns has-2-columns\">\n<div class=\"is-layout-flow wp-block-column\">\n<figure class=\"wp-block-image\"><a href=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/twin_tap_select-1.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"235\" height=\"324\" src=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/twin_tap_select-1.jpg\" alt=\"\" class=\"wp-image-1168\" srcset=\"https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/twin_tap_select-1.jpg 235w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/twin_tap_select-1-218x300.jpg 218w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/twin_tap_select-1-109x150.jpg 109w\" sizes=\"(max-width: 235px) 100vw, 235px\" \/><\/a><\/figure>\n<\/div>\n\n\n\n<div class=\"is-layout-flow wp-block-column\">\n<table class=\"wp-block-table aligncenter\"><tbody><tr><td>Switch position<\/td><td>1<\/td><td>2<\/td><td>3<\/td><\/tr><tr><td>Joypad #0<\/td><td>A<\/td><td>C<\/td><td>C<\/td><\/tr><tr><td>Joypad #1<\/td><td>B<\/td><td>C<\/td><td>C<\/td><\/tr><tr><td>Joypad #2<\/td><td>C<\/td><td>A<\/td><td>C<\/td><\/tr><tr><td>Joypad #3<\/td><td>C<\/td><td>B<\/td><td>C<\/td><\/tr><tr><td>Joypad #4<\/td><td>C<\/td><td>C<\/td><td>A<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p><\/p>\n<\/div>\n<\/div>\n\n\n\n<p>As the <strong>C<\/strong> port is hidden (unless you are a sneaky hacker), the joyport value will always be <strong>$FF<\/strong>\u00a0(no buttons pressed).<\/p>\n\n\n\n<p><strong>Conclusion:<\/strong> At the time of writing this post, only the Multitap (PI-PD003) can be detected and we can&#8217;t detect if a joypad is plugged. I don&#8217;t have much hope for the Joy Tap 3, the Battle Tap or the X-HE2, but who knows&#8230;<\/p>\n\n\n\n<ul class=\"is-layout-flex wp-block-gallery-4 wp-block-gallery columns-3 is-cropped\"><li class=\"blocks-gallery-item\"><figure><a href=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190858.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"576\" height=\"324\" src=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190858.jpg\" alt=\"\" data-id=\"1160\" data-link=\"http:\/\/blog.blockos.org\/?attachment_id=1160\" class=\"wp-image-1160\" srcset=\"https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190858.jpg 576w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190858-300x169.jpg 300w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190858-250x141.jpg 250w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190858-150x84.jpg 150w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190910.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"576\" height=\"324\" src=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190910.jpg\" alt=\"\" data-id=\"1164\" data-link=\"http:\/\/blog.blockos.org\/?attachment_id=1164\" class=\"wp-image-1164\" srcset=\"https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190910.jpg 576w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190910-300x169.jpg 300w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190910-250x141.jpg 250w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190910-150x84.jpg 150w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191121.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"576\" height=\"324\" src=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191121.jpg\" alt=\"\" data-id=\"1163\" data-link=\"http:\/\/blog.blockos.org\/?attachment_id=1163\" class=\"wp-image-1163\" srcset=\"https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191121.jpg 576w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191121-300x169.jpg 300w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191121-250x141.jpg 250w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191121-150x84.jpg 150w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191358.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"576\" height=\"324\" src=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191358.jpg\" alt=\"\" data-id=\"1165\" data-link=\"http:\/\/blog.blockos.org\/?attachment_id=1165\" class=\"wp-image-1165\" srcset=\"https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191358.jpg 576w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191358-300x169.jpg 300w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191358-250x141.jpg 250w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_191358-150x84.jpg 150w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195139.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"576\" height=\"324\" src=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195139.jpg\" alt=\"\" data-id=\"1161\" data-link=\"http:\/\/blog.blockos.org\/?attachment_id=1161\" class=\"wp-image-1161\" srcset=\"https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195139.jpg 576w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195139-300x169.jpg 300w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195139-250x141.jpg 250w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195139-150x84.jpg 150w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195120.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"576\" height=\"324\" src=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195120.jpg\" alt=\"\" data-id=\"1166\" data-link=\"http:\/\/blog.blockos.org\/?attachment_id=1166\" class=\"wp-image-1166\" srcset=\"https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195120.jpg 576w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195120-300x169.jpg 300w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195120-250x141.jpg 250w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195120-150x84.jpg 150w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195534.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"576\" height=\"324\" src=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195534.jpg\" alt=\"\" data-id=\"1162\" data-link=\"http:\/\/blog.blockos.org\/?attachment_id=1162\" class=\"wp-image-1162\" srcset=\"https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195534.jpg 576w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195534-300x169.jpg 300w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195534-250x141.jpg 250w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_195534-150x84.jpg 150w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/a><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><a href=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190836.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"576\" height=\"324\" src=\"http:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190836.jpg\" alt=\"\" data-id=\"1159\" data-link=\"http:\/\/blog.blockos.org\/?attachment_id=1159\" class=\"wp-image-1159\" srcset=\"https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190836.jpg 576w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190836-300x169.jpg 300w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190836-250x141.jpg 250w, https:\/\/blog.blockos.org\/wp-content\/uploads\/2018\/09\/P_20180916_190836-150x84.jpg 150w\" sizes=\"(max-width: 576px) 100vw, 576px\" \/><\/a><\/figure><\/li><\/ul>\n\n\n\n<p>Higher resolution images can be found <a href=\"http:\/\/blockos.org\/releases\/pcengine\/hardware\/TwinTap\/\">here<\/a>.\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oh crap&#8230; This blog is getting dusty. Anyway, let&#8217;s get started! I compared the Street Fighter 2 Champion Edition joypad routine with the one from\u00a0HuDK. One of the most interesting thing is that SF2 performs an extra joyport read after reading the 5 joypad states in order to check if\u2026 <a class=\"continue-reading-link\" href=\"https:\/\/blog.blockos.org\/?p=1158\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[24,30],"_links":{"self":[{"href":"https:\/\/blog.blockos.org\/index.php?rest_route=\/wp\/v2\/posts\/1158"}],"collection":[{"href":"https:\/\/blog.blockos.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.blockos.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.blockos.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.blockos.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1158"}],"version-history":[{"count":7,"href":"https:\/\/blog.blockos.org\/index.php?rest_route=\/wp\/v2\/posts\/1158\/revisions"}],"predecessor-version":[{"id":1176,"href":"https:\/\/blog.blockos.org\/index.php?rest_route=\/wp\/v2\/posts\/1158\/revisions\/1176"}],"wp:attachment":[{"href":"https:\/\/blog.blockos.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.blockos.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.blockos.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}