Ian Patterson: please read

If you are having problems finding or using cheats for an Emulator (particularly MAME/MESS) or have found a trick that you wish to share this is the place to do it. But please read the Cheat FAQ first.
Post Reply
Bugfinder
Posts: 168
Joined: Tue Sep 25, 2001 1:00 am
Location: Rio de Janeiro, Brasil

Ian Patterson: please read

Post by Bugfinder »

For many releases there's been a problem in which you can't assign keys anymore in cheat.dat to cheats - for instance, if you assign the code for keypad 1 it turns into F2 and keypad 2 turns into F3. I tracked down the exact source update where this happened but can't have it fixed. This most likely have something to do with this:

(from 0.84u4 whatsnew.txt):
- Revamped most of the input and input port system. This means a number of
changes for those who do their own OSD layer. All input APIs are now
unified -- there is no notion of "keyboard" versus "joystick" anymore. The
following APIs are now obsolete:

osd_get_key_list
osd_is_key_pressed
osd_get_joy_list
osd_is_joy_pressed
osd_is_joystick_axis_code
osd_lightgun_read
osd_trak_read
osd_analogjoy_read
osd_customize_inputport_defaults

Instead there is a new set of simpler APIs:

osd_get_code_list
osd_get_code_value
osd_customize_inputport_list

The code list returned by osd_get_code_list should include entries for every
keyboard key, every joystick and mouse button, digital versions of joystick
analog axes (e.g., joystick X axis up), as well as entries for analog axes on
joysticks, mice, lightguns, etc. Essentially any input you wish to expose to
the user should be added to this list. Note that if you add items to this
list that don't map to the standard defaults, you must specify one of:
CODE_OTHER_DIGITAL, CODE_OTHER_ANALOG_ABSOLUTE, or CODE_OTHER_ANALOG_RELATIVE
to indicate what type of input you are providing.

osd_get_code_value is then later called to retrieve the value for a given
code. Digital inputs should return either 0 or 1. Absolute analog inputs
should return values between ANALOG_VALUE_MIN (-65536) and ANALOG_VALUE_MAX
(65536). Relative analog inputs should return values that approximately
scale to 512 units per pixel (e.g., an X axis moving left 4 pixels should
return -4*512 = -2048).

Finally, osd_customize_inputport_list replaces osd_customize_inputport_defaults
and allows you to add any OSD-specific UI input ports, as well as mess with
the default configuration. Note that at this time, the controller.ini file
support is currently disabled in the Windows build. [Aaron Giles]
Until 0.84u3 it all worked fine, the problem started at 0.84u4 . If you don't have these source updates I can send them to you.
Bugfinder
------------------------------------------
If there's a bug, I'm gonna find it!
User avatar
ianpatt
Posts: 336
Joined: Sat Sep 22, 2001 1:00 am
Location: San Francisco, CA

Post by ianpatt »

Yes, the input keycodes changed. Have been meaning to fix this, but at the same time I'd like to update the entire thing to the general MAME code conventions. That's primarily changing all the function names from IntermediateCapsStyle to spaces_as_underscores style, but there's also a bunch of other cleanup that should probably be done.

So don't worry, it will happen, but it may take a while. Assuming things at work go on schedule I should have dramatically more free time in three weeks.

In the meantime, the new codes are:

Code: Select all

	KEYCODE_A,
	KEYCODE_B,
	KEYCODE_C,
	KEYCODE_D,
	KEYCODE_E,
	KEYCODE_F,
	KEYCODE_G,
	KEYCODE_H,
	KEYCODE_I,
	KEYCODE_J,
	KEYCODE_K,
	KEYCODE_L,
	KEYCODE_M,
	KEYCODE_N,
	KEYCODE_O,
	KEYCODE_P,
	KEYCODE_Q,
	KEYCODE_R,
	KEYCODE_S,
	KEYCODE_T,
	KEYCODE_U,
	KEYCODE_V,
	KEYCODE_W,
	KEYCODE_X,
	KEYCODE_Y,
	KEYCODE_Z,
	KEYCODE_0,
	KEYCODE_1,
	KEYCODE_2,
	KEYCODE_3,
	KEYCODE_4,
	KEYCODE_5,
	KEYCODE_6,
	KEYCODE_7,
	KEYCODE_8,
	KEYCODE_9,
	KEYCODE_F1,
	KEYCODE_F2,
	KEYCODE_F3,
	KEYCODE_F4,
	KEYCODE_F5,
	KEYCODE_F6,
	KEYCODE_F7,
	KEYCODE_F8,
	KEYCODE_F9,
	KEYCODE_F10,
	KEYCODE_F11,
	KEYCODE_F12,
	KEYCODE_F13,
	KEYCODE_F14,
	KEYCODE_F15,
	KEYCODE_ESC,
	KEYCODE_TILDE,
	KEYCODE_MINUS,
	KEYCODE_EQUALS,
	KEYCODE_BACKSPACE,
	KEYCODE_TAB,
	KEYCODE_OPENBRACE,
	KEYCODE_CLOSEBRACE,
	KEYCODE_ENTER,
	KEYCODE_COLON,
	KEYCODE_QUOTE,
	KEYCODE_BACKSLASH,
	KEYCODE_BACKSLASH2,
	KEYCODE_COMMA,
	KEYCODE_STOP,
	KEYCODE_SLASH,
	KEYCODE_SPACE,
	KEYCODE_INSERT,
	KEYCODE_DEL,
	KEYCODE_HOME,
	KEYCODE_END,
	KEYCODE_PGUP,
	KEYCODE_PGDN,
	KEYCODE_LEFT,
	KEYCODE_RIGHT,
	KEYCODE_UP,
	KEYCODE_DOWN,
	KEYCODE_0_PAD,
	KEYCODE_1_PAD,
	KEYCODE_2_PAD,
	KEYCODE_3_PAD,
	KEYCODE_4_PAD,
	KEYCODE_5_PAD,
	KEYCODE_6_PAD,
	KEYCODE_7_PAD,
	KEYCODE_8_PAD,
	KEYCODE_9_PAD,
	KEYCODE_SLASH_PAD,
	KEYCODE_ASTERISK,
	KEYCODE_MINUS_PAD,
	KEYCODE_PLUS_PAD,
	KEYCODE_DEL_PAD,
	KEYCODE_ENTER_PAD,
	KEYCODE_PRTSCR,
	KEYCODE_PAUSE,
	KEYCODE_LSHIFT,
	KEYCODE_RSHIFT,
	KEYCODE_LCONTROL,
	KEYCODE_RCONTROL,
	KEYCODE_LALT,
	KEYCODE_RALT,
	KEYCODE_SCRLOCK,
	KEYCODE_NUMLOCK,
	KEYCODE_CAPSLOCK,
	KEYCODE_LWIN,
	KEYCODE_RWIN,
	KEYCODE_MENU,
(with A = 0)

Thinking about it some more, there's no clean way to keep up with new keycodes short of just making a custom mapping which is IMO not worth it - the few people that use this (keeping in mind that it's only documented in the source code) can update codes pretty easily.

Will at the very least update the table in the code, though.
User avatar
ianpatt
Posts: 336
Joined: Sat Sep 22, 2001 1:00 am
Location: San Francisco, CA

Post by ianpatt »

The latest u update (99u3) included an overhaul of the MAME UI system. This means that the cheat engine doesn't work in this build.

I'll be fixing this tonight after work.
User avatar
ianpatt
Posts: 336
Joined: Sat Sep 22, 2001 1:00 am
Location: San Francisco, CA

Post by ianpatt »

The fixes are going to be somewhat involved. Aaron kludged in something for u4 to get it working again, but this is a very good chance to clean things up.

So it's working for now, but expect changes shortlyish.
Post Reply