iCade Support?

Previous topic - Next topic

mrplant

I have just taken delivery of the iCade arcade cabinet for the iPad.
http://www.ionaudio.com/products/details/icade

The way this bluetooth keyboard maps the keys is detailed in this document:

http://www.ionaudio.com/downloads/iCade_Dev_Resource_v1.3.pdf

There is an SDK available and a sample Objective-C program here:

https://github.com/scarnie/iCade-iOS

I can compile and get it working ok but I lack the knowledge to interface this to GLBasic - that would be awesome.. But I think with the way the example talks to the view controller/Bluetooth keyboard
there might be some problems in doing that..

just wondering if anyone out there has any views on if this would be possible?

Maybe in the future GLBasic could add support directly?

I think going forward, the iCade and the new Atari stick (http://toucharcade.com/2011/09/07/more-details-on-the-atari-arcade-joystick-peripheral-for-ipad/) are going to sell quite nicely and games that support them will do well!

steve

Kitty Hello

might be worth a try. Someone should write a wrapper that writes the last key pressed with bluetooth into a variable that I can output with inkey$.

spacefractal

INKEY$ would been stupid to use with iCade, because you need to checkout multiple keys, where inkey$ dont support (and also its dont support when keys is released too). Course its should output with KEY(). Also its could been some PLATFORMINFO$() to tell if a such a keyboard is installed and used.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Kitty Hello

right. But I need some code to get the key up/down events before I can implement that.
Buing an iCade is not really cheap.

MrTAToad

It sounds like you would need to modify the SDL key handling routine itself...

Kitty Hello

No SDL used for iOS. I'll talk to Trucidare on this later.

mrplant

Jeff Minter has added support to all his games - see him play here: http://www.youtube.com/watch?v=1P5bsQN5G6I

re. replies - Key() and PLATFORMINFO$ seem the way to go...

The example program in the link I gave earlier shows a joystick on screen that shows when you press the buttons etc.
It seems to be using a second view controller on top of your main one that passes events back but someone much more cleverer than me will probably find a way...

Kitty Hello

I like the iCade. I will add support for it. I'll put it into GETJOYX(1), GETJOYBUTTON(1). What do you think?
I also think about enabling bluetooth keyboards, so you can use INKEY$ with them.
I saw the code and it's pretty easy to do.

ampos

Quote from: Kitty Hello on 2011-Sep-15
I like the iCade. I will add support for it. I'll put it into GETJOYX(1), GETJOYBUTTON(1). What do you think?
I also think about enabling bluetooth keyboards, so you can use INKEY$ with them.
I saw the code and it's pretty easy to do.

Yes, it is the correct way to do it  :nana:
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

spacefractal

bluetooth keyboard, its the correct way to do.

Not sure about iCade, which depend how its use the input. Ifs its s simple keyboard (etc a keyboard encoder but with few keys used) with send keys to the iPad, there is no other to do that with KEY(), elsewise JOYX(1) is the best of course.... and of course some PLATFORMINFO$ to detect it.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Kitty Hello

I found no legal way to detect a connected external keyboard so far :(

mrplant

#11
No legal way to detect bluetooth keyboard?

I know the SDK doesn't allow it at present I don't think.. I have seen people ask this question on the StackOverflow forums etc.

I have an external bluetooth keyboard here and tried it with some icade enabled games but no joy..

Surely though iCade support is possible maybe mapping to Key() or something - how is the example Icade program passing the codes back legally?

I know there are a few games approved in the app store - Atari Arcade for one..

I know Jeff Minter has just added support to his games over at LLamasoft - maybe he could shed some light...

So just to clarify - How is the example program doing it and surely it would be approved ok for app store use?

Apples own take on it is its ok but they don't like game authors mentioning iCade support in their games - in the game menu It has to say select alternative input method or something to get approved.

That is why the iCade's main manufacturers site is maintaining a list of icade enabled games.

I know of at least 10 games in the app store at the moment that support the icade and its going to get better!!

GLBasic support for this would be great if possible!!

In short - my limited technical take on it is that its not possible to read the bluetooth keyboard with the official SDK but it is possible to read the iCade key values ok using the Official SDK and example program - correct?

Update: I have just tweeted the big man.... Maybe he has some example code he could share? or some advice? I know he's a busy ox though..... ;-)

ampos

I have a bluetooth keyboard I can attach to my iPhone, if you want me to make some testings...
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

stinky ox

Basically I modified scarnie's iCade reader view from his demo on github:

https://github.com/scarnie/iCade-iOS

I basically made the insertText method maintain a single bitmap of all the switch states in a single longword.  Whenever the state changes this is updated and passed out to the delegate, which makes it available to the games, which just read it as an int in an info structure.

This makes it easy to support the iCade completely transparently = you just do your normal controls, and additionally check the bitmap for any switch closures.  If there's no iCade the bitmap will be empty and you do nothing.  If there are bits there just act accordingly.


mrplant

Many thanks Jeff - I know you are a busy man - look forward to your new game any day now! Goat Up!