Metal Gear 2 MSX emulation speed?

Page 4/6
1 | 2 | 3 | | 5 | 6

By Muyfa666

Resident (36)

Muyfa666's picture

16-06-2020, 08:28

No bindings seem to work whatsoever and it's pretty much impossible to gather anything useful from the manual. :-(

Why does it have to this complicated? I'm not a novice, but everything about MSX just seem very difficult to do.

By Parn

Hero (610)

Parn's picture

16-06-2020, 14:33

Since you're not a novice, please bear with me if you know all this already, but I have no way of knowing how much of the specifics you know.

It's a bit complicated in part because PC is more complicated than MSX. You see, traditionally MSX only used two-button controllers, so in many games, like MGS2, anything outside the basic control of a game must be done in the keyboard. If you don't mind doing it in the MSX way, you can just plug a previously connected game controller on the MSX by using the plug console command. I'm not sure why neither Catapult nor the menu have the option to use a simple joystick already baked in, but there it is. The actual console command is this:

plug joyporta joystick1

This way only two joystick buttons will work on the emulated MSX, but that is the normal behaviour anyway. It may be annoying to find out which joystick buttons correspond to button 1 and 2, but once you do it's smooth sailing from there (or it should be). However, you might want to bind some keyboard keys to the joystick so you can make better use of the joystick's features. This may get a bit hairy since it's sometimes hard to figure out which button number correspond to each actual joystick button. If you are using Windows, in the Game Controllers there's a testing feature that may help you with that.

So suppose you want to bind the Start button, which for the sake of this reference we will consider as button number 7, to the F1 key, used in most Konami games as the pause button, you'd do this in the console:

bind "joy1 button7 down" "keymatrixdown 6 0x20"
bind "joy1 button7 up" "keymatrixup 6 0x20"

If you wanted instead to bind it to the STOP key, used in most other companies games, for example, you'd use this:

bind "joy1 button7 down" "keymatrixdown 7 0x10"
bind "joy1 button7 up" "keymatrixup 7 0x10"

If all that sounds a bit mysterious, I'd agree with you. If you want to bind some specific MSX key to another PC key or joystick button you must do some tedious work. How do I find out the keyboard matrix codes? You can use the reference here (there's also a buch of other useful technical stuff here too):

Grauw's MSX Assembly Page - Key Matrices

In the "Key Matrix Layouts" section you can see how it goes. I wish there were an easier way, but since MSX keyboards can be different from one another, I'm not sure if that's possible. See those numbers after the keymatrixup and keymatrixdown keywords? The first is the keyboard matrix row where the key you want to bind is. The second is the number associated to the bit being scanned. So the F1 key requires the row 6 and bit 5. 6 is already there, and for bit 5 the second number is 0x20. The actual numbers, from bit 0 to bit 7, are, in order, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40 and 0x80. This comes from converting from binary to hexadecimal.

So you see, it is a bit complicated because it's actually complicated, and OpenMSX wants to give all this power to you, so you can delve into the minutiae of hardware configuration. But if you want something easy to grab and go, it's not as friendly. Maybe in the future they can improve this in the emulator, or someone creates an external tool that can configure game controllers more easily.

By Muyfa666

Resident (36)

Muyfa666's picture

16-06-2020, 14:46

Complicated or not - kudos to all of you for being willing to help a fellow enthusiast! :-)

I'll give this a go when I get home. Thanks alot!

By Manuel

Ascended (17083)

Manuel's picture

16-06-2020, 19:46

I did warn you that it's a little tricky...

By Muyfa666

Resident (36)

Muyfa666's picture

16-06-2020, 20:09

Ok, so I tested this for a bit, and it mostly works fine.

I have a 8Bitdo controller (on a Mac), set to D-input and I have figured out which buttons are which number and all buttons work fine.

What I have not yet found out is if it's at all possible to map the analog sticks (not super important) and I also have not figured out how to bind the direction cross. That's the last big thing missing. Is it possible?

By Muyfa666

Resident (36)

Muyfa666's picture

16-06-2020, 20:55

Little by little... ;-)

bind "joy1 hat0 up" "keymatrixdown 8 0x20" makes the dead up work, but it's like it's pressed all the time.

If I do bind "joy1 hat0 up" "keymatrixdown 8 0x20" and bind "joy1 hat0 up" "keymatrixup 8 0x20" nothing happens at all.

By Parn

Hero (610)

Parn's picture

16-06-2020, 21:45

Well, I honestly had never before used a game controller with an MSX emulator, so I decided to try it now. I'm currently using Windows 10 and OpenMSX 0.15.0. I connected a PS4 controller. My situation:

  • The MSX sees the left stick as its only digital stick. So far so good.
  • The directional cross does nothing, just like the right stick. Hm.
  • Square, Circle, L1, L2, L3 and Share all map to button 1.
  • Cross, Triangle, R1, R2, R3, Options and Touchpad all map to button 2.
  • Home maps to button 1 but it also opens up Steam. Tongue

So apparently all odd-numbered buttons (according to the Game Controllers control panel) map to button 1 and all even-numbered buttons map to button 2. This is probably by design. I haven't tried rebinding joystick buttons yet, but I hope it works. I have no idea if there's any way to change the way the analog joystick and the directional cross work, though.

Final EDIT: I previously wrote a bunch of stuff that was incorrect. I also can't figure out binding for the d-cross.

By Parn

Hero (610)

Parn's picture

16-06-2020, 21:55

I won't edit my previous posting anymore, but I now think it's not possible to map the d-cross on OpenMSX, because there seems no way to map the release event for hat0. So you can only map what happens when you press the d-cross, not what happens when you release it.

By Muyfa666

Resident (36)

Muyfa666's picture

16-06-2020, 23:24

Yes, this seem to be the case unfortunatly. Too bad as I otherwise had it running close to perfect.

By Manuel

Ascended (17083)

Manuel's picture

17-06-2020, 00:38

My Rumblepad has a mode button with which I can switch D-pad vs analog stick. Useful if you prefer D-pad.

Anyway, what if you bind other values of the hat event to the 'release' thing? It's even more complex... but perhaps it is good enough.
So, the up, down, left and right (and all the combinations) you bind to the keypress and center you bind to keyrelease of all 4 keys (use a wider mask).

Like this:

bind "joy1 hat0 up" {keymatrixdown 8 0x20}
bind "joy1 hat0 down" {keymatrixdown 8 0x40}
bind "joy1 hat0 right" {keymatrixdown 8 0x80}
bind "joy1 hat0 left" {keymatrixdown 8 0x10}
bind "joy1 hat0 center" {keymatrixup 8 0xF0}

but you probably also need to release some keys to make it working well. so if right is pressed, also release the left key.
Like:

bind "joy1 hat0 right" {keymatrixdown 8 0x80; keymatrixup 8 0x10}

and so on.

Page 4/6
1 | 2 | 3 | | 5 | 6