Skip to content

Inconsistent behavior when running melonDS DS core #23

@jonko0493

Description

@jonko0493

I'm currently part of a team making a homebrew DS game and we do some automated testing with libretro.py (fantastic work btw) and the melonDS DS core.

Part of the test involves navigating a menu that looks like this.

Image

Relevant menu selection code is as follows:

uint32_t repeat = keysDownRepeat(), down = keysDown();

if (down & KEY_UP || repeat & KEY_UP)
{
    moveSelection(-1);
    return true;
}
else if (down & KEY_DOWN || repeat & KEY_DOWN)
{
    moveSelection(1);
    return true;
}

on melonDS standalone, melonDS DS launched through retroarch, and on console, this results in the expected behavior: pressing the down or up button once moves the menu selection down or up one item. after holding it for ~29 ticks, the "repeat" kicks in and runs again every 15 ticks. Image below depicts logging I inserted to demonstrate this.

Image

When running the test in libretro.py, I'm doing the following:

# Enter debug menu, select first battle
yield JoypadState(select=True)
yield from repeat(0, 10)
yield JoypadState(down=True)
yield from repeat(0, 10)
yield JoypadState(a=True)

with the goal of selecting the second item from the menu. however, when doing JoypadState(down=True), the game registers a press and then a repeat a single tick later, resulting in the third menu item being selected rather than the second.

I've sent you the files for this on Discord. Thanks for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions