Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS keypad scanning doesn't behave like on HW #259

Closed
adriweb opened this issue Jun 10, 2018 · 5 comments
Closed

OS keypad scanning doesn't behave like on HW #259

adriweb opened this issue Jun 10, 2018 · 5 comments
Milestone

Comments

@adriweb
Copy link
Member

adriweb commented Jun 10, 2018

I just happened to try https://usercontent.irccloud-cdn.com/file/J3zZLVEQ/MANDRAGO.8xp .
And contrary to the real calc where everything is fine (just tested again to be sure), whenever a key is pressed in CEmu, it behaves as if the user was holding it.

By the way, it turns out that this also wasn't working in CEmu v1.0. So, it looks like this wasn't really much of a blocking issue in the past or we'd have gotten complaints earlier... I guess it can "not be" a blocking issue this time as well...

Note: the game source that deals with that is:

void startKeys()
{
    (*(uint8_t*)0xF50000) = 3; // continuous
}

void stopKeys()
{
    (*(uint8_t*)0xF50000) = 0;
}

uint8_t isKeyPressed(uint16_t key)
{
    uint8_t* addr = (uint8_t*)(0xF50000 + (uint8_t)(key >> 8));
    uint8_t mask = key & 0xFF;
    return ((*addr)&mask) ? 1 : 0;
}

And we have:

#define KEY_DOWN    0x1E01
#define KEY_LEFT    0x1E02
#define KEY_RIGHT   0x1E04
#define KEY_UP      0x1E08
@adriweb adriweb added this to the v1.x milestone Jun 10, 2018
@mateoconlechuga mateoconlechuga modified the milestones: v1.x, v1.1 Jun 22, 2018
@mateoconlechuga
Copy link
Member

Let's try to add this to 1.1 :)

@jacobly0
Copy link
Member

jacobly0 commented Jun 22, 2018

This is the program's fault because the os interrupt handler changes the scanning mode. On the other hand, not sure why exactly behavior differs from HW.

@adriweb adriweb changed the title Continuous keypad scanning mode is broken? Continuous keypad scanning doesn't behave like on HW Jun 29, 2018
@adriweb
Copy link
Member Author

adriweb commented Jun 29, 2018

issue title/content reworded, as it had incorrect assumptions.

@adriweb adriweb changed the title Continuous keypad scanning doesn't behave like on HW OS keypad scanning doesn't behave like on HW Jun 29, 2018
@jacobly0
Copy link
Member

BTW, here's a much simpler repro that never touches continuous mode: keywatch.zip (on to exit)

@mateoconlechuga
Copy link
Member

wut

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants