Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  InfoNES controlls
« previous next »
  • Print
Pages: 1 2 [3]

Author Topic: InfoNES controlls  (Read 4372 times)

Offline CrashinTime

  • Member
  • *
  • Posts: 33
Re: InfoNES controlls
« Reply #30 on: December 13, 2019, 04:41:36 PM »
Ok so update on my setup

Code: [Select]
#elif CONFIG_KEYPAD == IPOD_4G_PAD

#define NES_BUTTON_UP           BUTTON_MENU
#define NES_BUTTON_DOWN         BUTTON_PLAY
#define NES_BUTTON_A            BUTTON_SELECT
#define NES_BUTTON_B            BUTTON_NONE
#define NES_BUTTON_START        (BUTTON_SELECT | BUTTON_PLAY)
#define NES_BUTTON_SELECT       (BUTTON_SELECT | BUTTON_LEFT)
#define NES_BUTTON_MENU         (BUTTON_SELECT | BUTTON_MENU)

Its not the cleanest thing in the world but it works, my questuion is what should B be, since it needs to not be direction specific so that it dosnt effect the users direction, and be quickly acessable while pressing a

asides that this setups done
Logged

Offline CrashinTime

  • Member
  • *
  • Posts: 33
Re: InfoNES controlls
« Reply #31 on: December 13, 2019, 06:26:08 PM »
I want to setup the Hold button to be the menu button so that B can be Top and middle buttons,

Hold already pauses button inputs would there be a way to have it force open menu?

I see a Menu() function whats the best way to call this on hold?
Logged

Offline CrashinTime

  • Member
  • *
  • Posts: 33
Re: InfoNES controlls
« Reply #32 on: December 14, 2019, 01:57:22 AM »
nvm got this setup and it works like a charm, if i can setup a sanza test or something like that to make sure those still work as they should i may try to push to the git what I have, hasn't bees updated in a while tho
Logged

Offline rockbox_dev123

  • Member
  • *
  • Posts: 74
Re: InfoNES controlls
« Reply #33 on: December 14, 2019, 12:09:02 PM »
https://xkcd.com/979/

Please post your code somewhere, even if its just as a .patch attached a forum post.

You may even lose your code and still be able to retrieve a copy this way.
Logged

Offline CrashinTime

  • Member
  • *
  • Posts: 33
Re: InfoNES controlls
« Reply #34 on: December 14, 2019, 12:55:57 PM »
Haha will do

atm i got a setup thats Ipod specific thats along the lines of

Code: [Select]
void poll_event(void)
{
    int bs;

    bs = rb->button_status();

#ifdef INFONES_SCROLLWHEEL
    bs |= read_scroll_wheel();
#endif

   
#if CONFIG_KEYPAD == IPOD_4G_PAD
if(bs & NES_BUTTON_UP)
        dwPad1 |= 1 << 4;
    else
        dwPad1 &= ~(1 << 4);
    if(bs & NES_BUTTON_DOWN)
        dwPad1 |= 1 << 5;
    else
        dwPad1 &= ~(1 << 5);
    if(bs & NES_BUTTON_LEFT)
        dwPad1 |= 1 << 6;
    else
        dwPad1 &= ~(1 << 6);
    if(bs & NES_BUTTON_RIGHT)
        dwPad1 |= 1 << 7;
    else
        dwPad1 &= ~(1 << 7);
    if(bs & NES_BUTTON_A)
        dwPad1 |= 1 << 0;
    else
        dwPad1 &= ~(1 << 0);
    if((bs & NES_BUTTON_B)==NES_BUTTON_B)
        dwPad1 |= 1 << 1;
    else
        dwPad1 &= ~(1 << 1);
    if((bs & NES_BUTTON_SELECT)==NES_BUTTON_SELECT)
        dwPad1 |= 1 << 2;
    else
        dwPad1 &= ~(1 << 2);
    if((bs & NES_BUTTON_START)==NES_BUTTON_START)
        dwPad1 |= 1 << 3;
    else
        dwPad1 &= ~(1 << 3);

    rb->yield();

    if(rb->button_hold())
menu();
#else

if(bs & NES_BUTTON_UP)
        dwPad1 |= 1 << 4;
    else
        dwPad1 &= ~(1 << 4);
    if(bs & NES_BUTTON_DOWN)
        dwPad1 |= 1 << 5;
    else
        dwPad1 &= ~(1 << 5);
    if(bs & NES_BUTTON_LEFT)
        dwPad1 |= 1 << 6;
    else
        dwPad1 &= ~(1 << 6);
    if(bs & NES_BUTTON_RIGHT)
        dwPad1 |= 1 << 7;
    else
        dwPad1 &= ~(1 << 7);
    if(bs & NES_BUTTON_A)
        dwPad1 |= 1 << 0;
    else
        dwPad1 &= ~(1 << 0);
    if(bs & NES_BUTTON_B)
        dwPad1 |= 1 << 1;
    else
        dwPad1 &= ~(1 << 1);
    if(bs & NES_BUTTON_SELECT)
        dwPad1 |= 1 << 2;
    else
        dwPad1 &= ~(1 << 2);
    if(bs & NES_BUTTON_START)
        dwPad1 |= 1 << 3;
    else
        dwPad1 &= ~(1 << 3);

    rb->yield();

    if(bs & NES_BUTTON_MENU)
        menu();
#endif

    //if((bs & NES_BUTTON_MENU)==NES_BUTTON_MENU)
    //    menu();

    return;
}

Which checks for the ipod and uses the menu/Controll binds specific setup for it, I'll try to upload to github lated but I've never done this so it may take me a bit of googling
Logged

Offline CrashinTime

  • Member
  • *
  • Posts: 33
Re: InfoNES controlls
« Reply #35 on: December 14, 2019, 01:22:06 PM »
Yeah i have no idea what im doing when trying to push this, any guide would be much appreciated!
Logged

Offline rockbox_dev123

  • Member
  • *
  • Posts: 74
Re: InfoNES controlls
« Reply #36 on: December 14, 2019, 05:55:07 PM »
Quote
Git Access

People who contribute substantial and well implemented improvements to Rockbox often get Git access, allowing them to change Rockbox without having to submit patches. Git access is granted by mutual agreement of the existing Rockbox developers that a new developer is a capable and well integrated into the community.

https://www.rockbox.org/wiki/ContributingToRockbox
Logged

Offline CrashinTime

  • Member
  • *
  • Posts: 33
Re: InfoNES controlls
« Reply #37 on: December 14, 2019, 05:56:21 PM »
So does this mean i would need to get a dev to add it for me?
I tried to upload it to a github: https://github.com/KidoHyde/InfoNES-IPod-port
Logged

Offline CrashinTime

  • Member
  • *
  • Posts: 33
Re: InfoNES controlls
« Reply #38 on: December 14, 2019, 06:12:43 PM »
I see i can edit the files on http://gerrit.rockbox.org/r/#/c/946/
I edited the files i edited and im not sure how i submit it for review, what should i press now, Publish edit gives me an error
Logged

Offline CrashinTime

  • Member
  • *
  • Posts: 33
Re: InfoNES controlls
« Reply #39 on: December 17, 2019, 06:48:39 PM »
Would it be possible to set a bind to use either X button combo or Y button combo somthing like
#define NES_BUTTON_B            (BUTTON_LEFT | BUTTON_MENU) | (BUTTON_RIGHT | BUTTON_MENU)
Logged

Offline rockbox_dev123

  • Member
  • *
  • Posts: 74
Re: InfoNES controlls
« Reply #40 on: April 01, 2020, 04:12:49 PM »
Quote from: bobba_mosfet on December 08, 2019, 07:21:16 AM
What might actually be awesome would be if you could map the buttons on the FM radio adapter separately. Then you could use that as a mini gamepad and make the hold button on that A and Play B or something.

I went ahead and ordered a cheap FM tuner for my ipod6g off of eBay.

I started playing with the keymaps for rockdoom (./apps/plugins/doom/i_video.c):
Code: [Select]
#if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
    (CONFIG_KEYPAD == IPOD_1G2G_PAD)
#define DOOMBUTTON_SCROLLWHEEL
#define DOOMBUTTON_SCROLLWHEEL_CC     BUTTON_SCROLL_BACK
#define DOOMBUTTON_SCROLLWHEEL_CW    BUTTON_SCROLL_FWD
#define DOOMBUTTON_UP        (BUTTON_MENU | BUTTON_RC_VOL_UP)
#define DOOMBUTTON_WEAPON     BUTTON_RC_PLAY
#define DOOMBUTTON_LEFT      (BUTTON_LEFT | BUTTON_RC_LEFT)
#define DOOMBUTTON_RIGHT     (BUTTON_RIGHT | BUTTON_RC_RIGHT)
#define DOOMBUTTON_SHOOT      BUTTON_SELECT
#define DOOMBUTTON_ENTER      BUTTON_RC_PLAY
#define DOOMBUTTON_OPEN       BUTTON_RC_PLAY

Keys left, right and play are addressable on the remote - this is really cool and its like having a Wii Nunchuk Controller for the iPod.

The only thing I haven't been able to get working is Up/Down (BUTTON_RC_VOL_UP/BUTTON_RC_VOL_DOWN).

I suspect that this is because of something that needs to be changed inside of ./apps/keymaps/keymap-ipod.c

I only really did this for a laugh and I had some spare time to play around with this today.

Though if anyone does have any ideas on how to address those extra buttons please do reply :)
Logged

  • Print
Pages: 1 2 [3]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  InfoNES controlls
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.028 seconds with 18 queries.