The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
July 01, 2022, 06:10:29 am
Home Help Search Login Register
News: Paul & Fred have reached a settlement with Stardock!

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Windows Mobile port?
« previous next »
Pages: 1 ... 3 4 [5] 6 7 8 Print
Author Topic: Windows Mobile port?  (Read 53987 times)
NamelessPlayer
*Many bubbles*
***
Offline Offline

Posts: 104



View Profile
Re: Windows Mobile port?
« Reply #60 on: May 17, 2008, 02:21:38 am »

I also managed to get my hx4700 fixed up and running perfectly(just had to get the trackpad working again, as well as get a digitizer with perfect accuracy), and have installed WM6.1 on it.

I ran UQM, but I had the same problem as on my X50v-left and right acted as up and down, as if the switch to landscape mode only affected the screen and not the buttons.

Have you released any updates that may have fixed this issue in the meantime?
Logged
Islanti
Zebranky food
*
Offline Offline

Gender: Male
Posts: 8



View Profile
Re: Windows Mobile port?
« Reply #61 on: May 17, 2008, 03:40:49 am »

I'm very excited to see UQM ported to the Pocket PC (finally).  Unfortunately I can't get anything but the "enter" key to work in the game on my iPaq 210.  I have to soft-reset to exit every time.

I found a free key map utility.  It doesn't work with two of the special keys but very few applications do.  The keys that I can log show up as follows:

App:
Record: 0xc6
App1 (Calendar): 0xCC (keydown), 0xC1 (keyup)
App2 (Start): ??
App3 (OK): ??
App4 (Mail): 0xCD (keydown), 0xC4 (keyup)

D-Pad:
Up: 0x26
Down: 0x28
Left: 0x25
Right: 0x27
Enter: 0x0D

I'm happy to run any utility or debug versions you might have if you need more information.
Logged
ptx
Frungy champion
**
Offline Offline

Posts: 69


I love YaBB 1G - SP1!


View Profile
Re: Windows Mobile port?
« Reply #62 on: May 19, 2008, 08:03:28 pm »

D-Pad:
Up: 0x26
Down: 0x28
Left: 0x25
Right: 0x27
Enter: 0x0D

The Enter key seems to be a standard 0x0D, but d-pad keys .... not sure what to make of them.

This is from SDL_keysym.h:

    SDLK_DOLLAR     = 36,
    SDLK_AMPERSAND      = 38,
    SDLK_QUOTE      = 39,
    SDLK_LEFTPAREN      = 40,
    SDLK_RIGHTPAREN     = 41,
...
    SDLK_UP         = 273,
    SDLK_DOWN       = 274,
    SDLK_RIGHT      = 275,
    SDLK_LEFT       = 276,

There is no 0x25 (37 dec).

Do other SDL apps work on your PDA?
Logged
ptx
Frungy champion
**
Offline Offline

Posts: 69


I love YaBB 1G - SP1!


View Profile
Re: Windows Mobile port?
« Reply #63 on: May 19, 2008, 08:04:55 pm »

I ran UQM, but I had the same problem as on my X50v-left and right acted as up and down, as if the switch to landscape mode only affected the screen and not the buttons.

I suggest playing with the key settings file as a workaround.
Logged
Islanti
Zebranky food
*
Offline Offline

Gender: Male
Posts: 8



View Profile
Re: Windows Mobile port?
« Reply #64 on: May 20, 2008, 12:38:21 am »

D-Pad:
Up: 0x26
Down: 0x28
Left: 0x25
Right: 0x27
Enter: 0x0D

The Enter key seems to be a standard 0x0D, but d-pad keys .... not sure what to make of them.

This is from SDL_keysym.h:

    SDLK_DOLLAR     = 36,
    SDLK_AMPERSAND      = 38,
    SDLK_QUOTE      = 39,
    SDLK_LEFTPAREN      = 40,
    SDLK_RIGHTPAREN     = 41,
...
    SDLK_UP         = 273,
    SDLK_DOWN       = 274,
    SDLK_RIGHT      = 275,
    SDLK_LEFT       = 276,

There is no 0x25 (37 dec).

Do other SDL apps work on your PDA?
I am able to map all the buttons on my device using SCUMMVM 0.11.1.  That's the only other SDL app I have.  The default keys were probably messed up in Scumm too but SCUMMVM supports the stylus so it wasn't an issue I noticed.

SCUMMVM does display a "friendly name" for the various keys when you map them.  The names look similar to the SDL ones in the UQM starcon.key file.  Here's what I get for each key...

App:
Record: application 6
App1 (Calendar): application 1
App2 (Start): home
App3 (OK): volume up
App4 (Mail): application 4

The D-Pad is mapped as expected for left-hand landscape mode (i.e. the "up" key is mapped as "left").  Enter is "action".

I tried editing the starkey.map file to match the SCUMMVM names (App4, App1, VolumeUp, Home, etc.) but still no luck.
Logged
ptx
Frungy champion
**
Offline Offline

Posts: 69


I love YaBB 1G - SP1!


View Profile
Re: Windows Mobile port?
« Reply #65 on: May 20, 2008, 07:18:58 pm »

I am able to map all the buttons on my device using SCUMMVM 0.11.1.  That's the only other SDL app I have.  The default keys were probably messed up in Scumm too but SCUMMVM supports the stylus so it wasn't an issue I noticed.

Just to confirm:
* Once you start uqm, the ONLY key that works is ENTER.
* D-Pad/arrow keys don't work at all (You are not able to navigate the menu).
« Last Edit: May 20, 2008, 07:29:20 pm by ptx » Logged
Islanti
Zebranky food
*
Offline Offline

Gender: Male
Posts: 8



View Profile
Re: Windows Mobile port?
« Reply #66 on: May 20, 2008, 08:39:34 pm »

Using the stock configuration: the D-Pad does not navigate the menus.  Enter works to select "New Game" or cancel the credits.  None of the other buttons do anything.  Using an alternate configuration doesn't seem to affect anything.
Logged
ptx
Frungy champion
**
Offline Offline

Posts: 69


I love YaBB 1G - SP1!


View Profile
Re: Windows Mobile port?
« Reply #67 on: May 20, 2008, 10:49:44 pm »

Using the stock configuration: the D-Pad does not navigate the menus.  Enter works to select "New Game" or cancel the credits.  None of the other buttons do anything.  Using an alternate configuration doesn't seem to affect anything.

Let's find out what your D-Pad key codes are (as seen by SDL).

1. Download http://rs217.rapidshare.com/files/116366571/keytest.zip
2. Extract keytest.exe and place it into your uqm directory on your Pocket PC
3. Run keytest.exe and press the following keys, in the following order (don't press anything else):

D-PAD LEFT
D-PAD UP
D-PAD RIGHT
D-PAD DOWN
D-PAD RETURN

After you press RETURN, the app should exit out and you will end up with keytest_out.txt file.
Please provide the contents of that file.
Logged
Islanti
Zebranky food
*
Offline Offline

Gender: Male
Posts: 8



View Profile
Re: Windows Mobile port?
« Reply #68 on: May 21, 2008, 12:17:23 am »

I ran it several times (deleting the log between each attempt) and the results are consistent:

pressed: 106
pressed: 44
pressed: 103
pressed: 0
pressed: 0
pressed: 13

I don't know why down is showing up as "0".

I ran this against the other buttons individually just for fun (0 and 13 are always the last two values recorded, which I assume is the "Enter" action)
Record: 328
Calendar: 0,0
Start: (null)
OK: 312,0
Mail: 0,105
« Last Edit: May 21, 2008, 12:24:03 am by Islanti » Logged
ptx
Frungy champion
**
Offline Offline

Posts: 69


I love YaBB 1G - SP1!


View Profile
Re: Windows Mobile port?
« Reply #69 on: May 21, 2008, 04:25:11 pm »

pressed: 106
pressed: 44
pressed: 103
pressed: 0
pressed: 0
pressed: 13

I don't know what to make of this. You mentioned earlier some kind of "free key map utility" ... What is that?

Also you mentioned these values:
D-Pad:
Up: 0x26
Down: 0x28
Left: 0x25
Right: 0x27
Enter: 0x0D

Where are you seeing them?
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Windows Mobile port?
« Reply #70 on: May 21, 2008, 05:16:02 pm »

There are various levels of keyboard codes involved.
1. The hardware produces codes.
2. These codes may or may not be translated by some software driver into another series of key codes.
3. SDL takes these codes and produces yet another set of codes, which can be found in SDL_keysym.h, which should be hardware-independent this time.
4. UQM takes the hardware-independant codes from SDL to control the game. UQM has its own table of strings to describe the associated keys.

For your keys to work in UQM, SDL must recognise your platform's key codes, and UQM must recognise the key codes that SDL generates.
If SDL doesn't recognise a key code which it receives, it will produce 0 as its own code, and UQM won't be able to do anything with that.

It looks like that that keytest program shows the code that SDL produces. The codes 106, 44, 103, 0, 0, and 13 do not seem to be the right values, so it looks like SDL does not do the translation right in the first place.

However, four of these keys do generate non-zero codes, and even though they are the wrong ones, these keys can be used without having to modify SDL. You can't use the in-game key config, as you can't get to the in-game key config with these key settings, but by editing the key config file manually, you can get these keys to work in UQM.
UQM will see your left key as "j", up as ",", right as "g", enter as "Return", ok as "RightSuper", and mail as "i". You should use these strings literally in your key config. You'll be missing the down key, but you should be able to play the game without it.

This is merely a workaround though, and the real fix is to patch SDL.

Edit: Oh, and the 0x2something codes look like the low(er) level codes. If someone is going to fix SDL to work with your PDA, he/she will need these codes.
« Last Edit: May 21, 2008, 05:18:10 pm by meep-eep » Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Islanti
Zebranky food
*
Offline Offline

Gender: Male
Posts: 8



View Profile
Re: Windows Mobile port?
« Reply #71 on: May 21, 2008, 06:26:31 pm »

I don't know what to make of this. You mentioned earlier some kind of "free key map utility" ... What is that?

Also you mentioned these values:
D-Pad:
Up: 0x26
Down: 0x28
Left: 0x25
Right: 0x27
Enter: 0x0D

Where are you seeing them?
Here is the webpage with the "ButtonFinder" application (link).  It's grabbing the raw key codes as I understood it.

However, four of these keys do generate non-zero codes, and even though they are the wrong ones, these keys can be used without having to modify SDL. You can't use the in-game key config, as you can't get to the in-game key config with these key settings, but by editing the key config file manually, you can get these keys to work in UQM.
UQM will see your left key as "j", up as ",", right as "g", enter as "Return", ok as "RightSuper", and mail as "i". You should use these strings literally in your key config. You'll be missing the down key, but you should be able to play the game without it.
Thanks for this!  I was able to get enough things mapped to control the menu.  A few of your suggested keys don't work, though.  Could this be something to do with key down vs. key up codes? 

Anyway, using the key configuration utility from the Setup menu I was able to confirm the following...

Up: ","
Down: Unknown
Left: "j"
Right: "g"
Enter: "Return"
Record: App6
Calendar: Unknown
Start: (keypress isn't even detected!)
OK: Unknown
Mail: Unknown

I noticed one additional quirk.  Most keys register the key press immediately, but OK doesn't.  Releasing OK is unknown, but holding it down...
OK (held): "k"
It doesn't seem to actually work in practice, though.  Perhaps UQM is seeing the key down code first and ignoring the held code.

The thing I don't understand is why SCUMMVM (which is also using SDL) works fine with my device.
Logged
ptx
Frungy champion
**
Offline Offline

Posts: 69


I love YaBB 1G - SP1!


View Profile
Re: Windows Mobile port?
« Reply #72 on: May 21, 2008, 06:58:04 pm »

This is merely a workaround though, and the real fix is to patch SDL.

Edit: Oh, and the 0x2something codes look like the low(er) level codes. If someone is going to fix SDL to work with your PDA, he/she will need these codes.

That's the thing though - patch SDL to do what? I can't imagine that HP 210 would have non-standard d-pad codes. There's something strange going on here. The uqm wince files from the wiki page has been confirmed to work with at least ability to navigate the main menu, on several PDA's. People reported being able to get into melee at least, and to get into melee dpad is required.

Plus, it looks like the low-level codes are already the correct ones.

The following is in the winuser.h:
#define VK_LEFT           0x25
#define VK_UP             0x26
#define VK_RIGHT          0x27
#define VK_DOWN           0x28

The following is in SDL's video/windib/SDL_dibevents.c:
...
void DIB_InitOSKeymap(_THIS)
{
...
    VK_keymap[VK_UP] = SDLK_UP;
    VK_keymap[VK_DOWN] = SDLK_DOWN;
    VK_keymap[VK_RIGHT] = SDLK_RIGHT;
    VK_keymap[VK_LEFT] = SDLK_LEFT;
...
}

...

#define EXTKEYPAD(keypad) ((scancode & 0x100)?(mvke):(keypad))

...

static int SDL_MapVirtualKey(int scancode, int vkey)
{
#ifndef _WIN32_WCE
    int mvke  = MapVirtualKeyEx(scancode & 0xFF, 1, hLayoutUS);
#else
    int mvke  = MapVirtualKey(scancode & 0xFF, 1);
#endif
...
   switch(mvke) {
        /* Distinguish between keypad and extended keys */
        case VK_DOWN:   return EXTKEYPAD(VK_NUMPAD2);
        case VK_LEFT:   return EXTKEYPAD(VK_NUMPAD4);
        case VK_RIGHT:  return EXTKEYPAD(VK_NUMPAD6);
        case VK_UP:     return EXTKEYPAD(VK_NUMPAD8);
    }
    return mvke?mvke:vkey;
}

And finally, the following is in ./include/SDL_keysym.h:
...
    SDLK_UP         = 273,
    SDLK_DOWN       = 274,
    SDLK_RIGHT      = 275,
    SDLK_LEFT       = 276,
...

Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Windows Mobile port?
« Reply #73 on: May 21, 2008, 07:08:04 pm »

Thanks for this!  I was able to get enough things mapped to control the menu.  A few of your suggested keys don't work, though.
I'll tell you how I got those strings. The codes which SDL generates (which you saw in that keytest program) have symbolic names, which can be found in SDL_keysym.h. For instance, 106 is SDLK_j. Then in the UQM source code, in src/sc2code/libs/input/sdl/keynames.c, you can find the strings that UQM associates with these symbolic names. For SDLK_j that is unsurprisingly "j".

Quote
Could this be something to do with key down vs. key up codes?
That sounds like a good explanation. If the device only produces a code on key release, then the best SDL could do in this case (which it probably isn't doing) is generate a key event for both key-up and key-down when this code is produced. Such a key would not be usable where you need to keep the button down, like as a fire button. But it might do as an escape button.

Quote
The thing I don't understand is why SCUMMVM (which is also using SDL) works fine with my device.
Maybe they're supplying a patched version of SDL? Or maybe they are using a newer version of SDL which has fixes for your device.
« Last Edit: May 21, 2008, 07:09:40 pm by meep-eep » Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
ptx
Frungy champion
**
Offline Offline

Posts: 69


I love YaBB 1G - SP1!


View Profile
Re: Windows Mobile port?
« Reply #74 on: May 21, 2008, 07:13:58 pm »

Maybe they're supplying a patched version of SDL? Or maybe they are using a newer version of SDL which has fixes for your device.
One thing to try would be copying over keytest.exe to a location with SCUMMVM's sdl.dll and running it there (although might not work if the SDL version they used is not 1.2.12)....

Does it say somewhere in the release notes of SCUMMVM what version of SDL they are using?
Logged
Pages: 1 ... 3 4 [5] 6 7 8 Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!