[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] XaAES doesn't deliver button events with evnt_multi()



Hi,

Next and hopefully last problem my AES/VDI game has with the Aranym
AFROS (MiNT, XaAES, fVDI) setup, is probably XaAES specific.

Unlike with normal TOS, evnt_multi() doesn't return any button
events (in Aranym AFROS default setup), just key events.


My suspicion is that it's triggered either due to:

* my program having no windows, or

* use of mouse events with very small timer value (zero),
  which triggers outwardly similar issue also in EmuTOS[1]


As Aranym AFROS image is a bit old, from 2008, I guess this might
have been fixed in XaAES by now.  Any ideas?


The event handling code looks like this, and typically
it gets called with ms having value 0:
-----------
/* check for button presses, returns after given time of ms
 * or earlier if there were other events
 */
static bool is_button(int ms)
{
        short evnt_m, dummy, pmstate, key;

        /* input:
         *  event flags, mbclicks, mbmask, mbstate, 5x region 1,
         *  5x region 2, event buffer, low & high timer value (ms).
         * output:
         *  mouse co-ordinate (x,y), mouse buttons, special key and
         *  normal key states, number of mouse clicks.
         */
        evnt_m = evnt_multi(MU_BUTTON|MU_KEYBD|MU_TIMER,
                            0x101, 0x3, 0x0,
                            0, 0, 0, 0, 0,
                            0, 0, 0, 0, 0,
                            NULL, ms, 0,
                            &dummy, &dummy, &pmstate, &dummy, &key, &dummy);

        /* ESC -> exit? */
        if ((evnt_m & MU_KEYBD) && (key & 0xff) == 27) {
                exiting = true;
                return true;
        }
        /* either of the buttons pressed? */
        if ((evnt_m & MU_BUTTON) && (pmstate & 3)) {
                return true;
        }
        return false;
}
-----------


	- Eero


[1] In EmuTOS case the bug seemed related to AES initializations,
    it could be worked around by interacting with dialogs before
    starting the game, then button events work OKish (compared to
    normal TOS there seems to be delay of frame or two before
    the button event is delivered though).