{"id":963,"date":"2011-08-30T12:00:05","date_gmt":"2011-08-30T18:00:05","guid":{"rendered":"http:\/\/www.philhassey.com\/blog\/?p=963"},"modified":"2011-08-30T12:00:05","modified_gmt":"2011-08-30T18:00:05","slug":"from-0-to-icade-in-3-hours-16-minutes","status":"publish","type":"post","link":"https:\/\/www.philhassey.com\/blog\/2011\/08\/30\/from-0-to-icade-in-3-hours-16-minutes\/","title":{"rendered":"From 0 to iCade in 3 hours 16 minutes"},"content":{"rendered":"<p>Hey,<\/p>\n<p><strong>1. The Arrival and Assembly (30 min)<\/strong><\/p>\n<p>So my iCade arrived at 2:58pm today.  It took me 30 minutes to unbox the parts and put the whole thing together with a hex-screwdriver.  The completed item looks 110% win!!!  There are tons of detailed unboxing guides on the internet, so I&#8217;ll just give you a shot of mine:<\/p>\n<p><a href=\"https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2011\/08\/IMG_7852.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2011\/08\/IMG_7852-300x225.jpg\" alt=\"\" title=\"IMG_7852\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-964\" srcset=\"https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2011\/08\/IMG_7852-300x225.jpg 300w, https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2011\/08\/IMG_7852-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><Strong>2. Testing it out with GAMES (30 min)<\/strong><\/p>\n<p>I had to check it out with a real game, so I went to the <a href=\"http:\/\/toucharcade.com\/2011\/08\/18\/hey-new-icade-owners-heres-a-list-of-icade-supported-compatible-games\/\">definitive touchArcade post on the subject<\/a>.  I realized I already had several of those titles on my iPad, so I dove right in with <a href=\"http:\/\/toucharcade.com\/link\/http:\/\/itunes.apple.com\/us\/app\/velocispider\/id433011745?mt=8\">Velocispider<\/a> which was totally awesome on the iCade!!  I can only hope more devs add support!  30 minutes elapsed &#8220;fun time&#8221;.<\/p>\n<p><strong>3. Downloading the iCade SDK (1 min)<\/strong><\/p>\n<p>The &#8220;official&#8221; SDK is sort of useless, it&#8217;s just a manual telling us what we already knew.  The great bit is there is an Open Source SDK (MIT) that is <a href='https:\/\/github.com\/scarnie\/iCade-iOS'>ready to go!<\/a> I downloaded and unzipped that and began adding it into my project.  1 minute.<\/p>\n<p><strong>4. Being stupid (2 hours)<\/strong><\/p>\n<p>I then proceeded to brilliantly comment out the two lines of code that make the iCade code work.  And then spend 2 hours realizing it.  \/facepalm<\/p>\n<p><strong>5. The iCade Integration (15 min)<\/strong><\/p>\n<p>Once I fixed my error, the integration took approximately 15 minutes.  The bulk of the code was just a switch statement that converted the iCade SDK events to my own internal framework events.  I already had keyboard support, so it was no trouble at all.<\/p>\n<pre>\r\n- (void)setState:(BOOL)state forButton:(iCadeState)button {\r\n    int v = 0; unsigned char c;\r\n    switch(button) {\r\n        case iCadeButtonA: v=KEY_a; c='a'; break;\r\n        case iCadeButtonB: v=KEY_b; c='b'; break;\r\n        case iCadeButtonC: v=KEY_c; c='c'; break;\r\n        case iCadeButtonD: v=KEY_d; c='d'; break;\r\n        case iCadeButtonE: v=KEY_e; c='e'; break;\r\n        case iCadeButtonF: v=KEY_f; c='f'; break;\r\n        case iCadeButtonG: v=KEY_g; c='g'; break;\r\n        case iCadeButtonH: v=KEY_h; c='h'; break;\r\n        case iCadeJoystickUp: v=KEY_UP; c=0; break;\r\n        case iCadeJoystickRight: v=KEY_RIGHT; c=0; break;\r\n        case iCadeJoystickDown: v=KEY_DOWN; c=0; break;\r\n        case iCadeJoystickLeft: v=KEY_LEFT; c=0; break;\r\n    }\r\n    Event e;\r\n    e.v = v;\r\n    e.c = c;\r\n    e.type = state?EVT_KEYDOWN:EVT_KEYUP;\r\n    game_event(e);\r\n}\r\n<\/pre>\n<p>I also had to go ahead and add Universal (iPad) support to the game, this didn&#8217;t take too long as my framework has smarts for doing that pretty easily.<\/p>\n<p><Strong>6. In conclusion &#8230;<\/strong><\/p>\n<p>I&#8217;ve submitted my update to the App Store, so hopefully it&#8217;ll be in your hands within a week.<\/p>\n<p><a href=\"https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2011\/08\/IMG_7880.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2011\/08\/IMG_7880-e1314727093914-225x300.jpg\" alt=\"\" title=\"IMG_7880\" width=\"225\" height=\"300\" class=\"aligncenter size-medium wp-image-966\" srcset=\"https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2011\/08\/IMG_7880-e1314727093914-225x300.jpg 225w, https:\/\/www.philhassey.com\/blog\/wp-content\/uploads\/2011\/08\/IMG_7880-e1314727093914-768x1024.jpg 768w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n<p>In conclusion, <strong>integrating iCade into your iOS game only takes 15 minutes<\/strong>, unless you&#8217;re as stupid as I am.  I encourage all devs who have appropriate games to do this so that I can play more games on my iCade!!!  Go GO GO GO!<\/p>\n<p>-Phil<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, 1. The Arrival and Assembly (30 min) So my iCade arrived at 2:58pm today. It took me 30 minutes to unbox the parts and put the whole thing together with a hex-screwdriver. The completed item looks 110% win!!! There are tons of detailed unboxing guides on the internet, so I&#8217;ll just give you a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,66],"tags":[],"class_list":["post-963","post","type-post","status-publish","format-standard","hentry","category-development","category-iphone"],"_links":{"self":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/comments?post=963"}],"version-history":[{"count":3,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/963\/revisions"}],"predecessor-version":[{"id":968,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/963\/revisions\/968"}],"wp:attachment":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/media?parent=963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/categories?post=963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/tags?post=963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}