Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - INlib: A controller input library for SMS

Reply to topic
Author Message
  • Joined: 29 Mar 2015
  • Posts: 63
  • Location: Japan
Reply with quote
INlib: A controller input library for SMS
Post Posted: Fri Sep 16, 2022 5:14 am
I like supporting less common peripherals in my projects, such as Paddles, the Sports Pad and the Mega Mouse. Recently I decided it was time to stop copying code between projects and make a library that I could share:

https://github.com/raphnet/inlib

I almost always use devkitSMS, so naturally my library is usable in C, but I only use __naked __z88dk_fastcall functions implemented in inline assembly. I believe converting this for use in pure assembly would be easy.

I tested everything on real hardware, on both PAL and NTSC systems. I also tested on Mark III for the Sports Pad in Mark-III mode.

My most recently published project (SKBN v2) uses this library to support the Sports Pad and the Sega Mega Mouse.
https://www.raphnet.net/programmation/skbn/index_en.php
  View user's profile Send private message Visit poster's website
  • Joined: 06 Mar 2022
  • Posts: 596
  • Location: London, UK
Reply with quote
Post Posted: Fri Sep 16, 2022 8:14 am
Nice one @raphnet! That's some really neat code :)
Loving the support for different controllers, e.g. MD controller, nice touch.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Jan 2010
  • Posts: 414
Reply with quote
Post Posted: Fri Sep 16, 2022 9:34 am
Nice, @raphnet! 6btn MD support!
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Sep 16, 2022 12:41 pm
MD pads (6 and 3 button versions) were already supported by SMSlib (deactivated since nobody seemed to need that)... but this is a very nice library to support exotic peripherals with multiple different configurations so it's extremely useful :)

edit: also, this library supports MD pads in both ports whereas SMSlib support was limited to the first player only (and never bothered adding more because there was no demand...) so I guess it means I'll probably remove that support completely sooner or later and suggest to use INlib instead.

a wonderful addition would be to support the light gun(s), though nowadays these are somewhat less usable (due to the fact that they works only with CRTs) so I don't even know if it's worth bothering...
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2015
  • Posts: 63
  • Location: Japan
Reply with quote
Post Posted: Sun Sep 18, 2022 1:49 am
I should have a light gun soon for testing, I intend to add support for those soon. Even if the demand is probably very low, it should be be fun to add! I may even make a mini-game to demonstrate.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Sun Sep 18, 2022 8:57 am
How about Terebi Oekaki and drawing board support? :) they are somewhat supported by emulators but we might get homebrew versions if they are more widely used.

Also how about supporting the Mega Drive multi tap devices? I’ve always meant to do that to enable some sort of many-player game.
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2015
  • Posts: 63
  • Location: Japan
Reply with quote
Post Posted: Tue Sep 20, 2022 9:06 am
Today I added Light Phaser support. Tested in both ports on real hardware.

I'll try to add drawing board and/or Terebi Oekaki support soon. Multitaps too are possible, the protocol is very similar to the mouse so it should not be too difficult...
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3762
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Sep 20, 2022 10:29 am
raphnet wrote
Today I added Light Phaser support. Tested in both ports on real hardware.


I would love a good one player - two guns game! :D

I just need a CRT and an additional gun...
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Sep 20, 2022 12:04 pm
sverx wrote
I would love a good one player - two guns game! :D


This is how I most enjoy playing Gangster Town!
  View user's profile Send private message Visit poster's website
  • Joined: 12 Dec 2010
  • Posts: 77
  • Location: Sheffield, England
Reply with quote
Post Posted: Tue Sep 20, 2022 4:27 pm
sverx wrote
raphnet wrote
Today I added Light Phaser support. Tested in both ports on real hardware.


I would love a good one player - two guns game! :D

I just need a CRT and an additional gun...


Bock wrote
sverx wrote
I would love a good one player - two guns game! :D


This is how I most enjoy playing Gangster Town!


I have two Saturn Virtua Guns and play Virtua Cop 2 like that :)
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2015
  • Posts: 63
  • Location: Japan
Reply with quote
Post Posted: Tue Sep 27, 2022 2:49 am
Last week I added support for the Graphic Board. Of course only tested in Emulation.

Next I think I'll add Megadrive Multitap support.[/quote]
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!