Main > Software Forum
Controls Database (FE programmers inside, please)
SirPoonga:
There is a big downsdie to this, it'd take alot of time.
Someone would have to go through each game, find out what it's controls are, and enter them in a db.
Like with mvsc you'd have to put in what fierce punch is and such.
AND some people (like me) change their buttons so button 1 isn't always the same from one game to the next.
It's be cool, but difficult to do.
NOW, why might be better is if people could get pictures of instruction cards for games like their is marquees, flyers, and other artworks....
Howard_Casto:
--- Quote ---
I'm still trying to hash out the technical feasibility re: key mappings.
--- End quote ---
u_rebelscum:
--- Quote ---As for mame config... it's in some type of format other than text.... I haven't had much luck parsing it.
--- End quote ---
Those dang .cfg files! ;p
They are mostly a binary file. (Units in the file are 8 bit hex pairs, integer(16 bit) = 2 hex pairs, word(32 bit) = 4 hex pairs.)
First are 7 chars ("MAMECFG" to be exact), followed by the version of the config file in hexadecimal ("0x08" currently). After that comes all the driver's default input settings, followed by all the current input settings. Small stuff after that (Coins entered each coin slot, then sound settings).
Each input setting goes (in hex):
input_type {integer, or 2 pairs},
input_mask {word, or 4 pairs},
input_default value {word},
input_sequence {word, + x# integer(s)}.
type is the input type, such as joystick_left, button1, or spinner. (two hex pairs)
mask contains info like which player #, auto_center, and other stuff. (four hex pairs)
default value is used mostly by analog inputs, and is the "starting" value, or the value centered toward if the mask includes auto_center. (four hex pairs)
sequence starts with the length of the sequence (four hex pairs). The value can be from 0x00 to 0x10 (0-16), depending on how many inputs you have mapped to that input. That number of inputs, represented by two hex pairs, follows. For example, if you had joyButton 0, key "ctrl", and mousebutton 0, mapped to the same input, I think you would have a length of 14 hex pairs: starting with 0x05 {word} followed with: {integers} the 3 inputs separated by 2 "CODE_OR"s (or in pseudocode: input_sequence_length_5 {word}, joybutton0 {integer}, OR {integer}, "ctrl" key {integer}, OR {integer}, mousebutton0 {integer}).
The translation of the numbers to inputs is done in inptport.c, input.c, and [OS]/input.c. The biggest problems are that each input setting can very in length, and each .cfg files can vary which inputs are saved.
We are mostly interested in reading/editing the second set of input settings, as those are the settings used in the games.
Hope this helps anyone.
potatojin:
--- Quote ---
...lots of computer stuff...
--- End quote ---
Rebelscum, that was very helpful. I imagine all this stuff is available at mame.net, which is my next stop as soon as I have some time.
For whatever reason, I still think this might be a good idea. Let me summarize what I think I'm talking about and if everyone thinks it's a stupid idea, I'll think of something else or go cry:
- A database that contains all control information with friendly names for the functions of the inputs. This db can be dumped to xml and downloaded to users' machines.
- A "control layout" mini-application that lets users create a graphic template of their control layout.
- An application which batches the job of populating this template with the friendly names from the db for each game. This app will check against the .cfg files for each game so the button mappings are correct.
- A directory full of .png files that contain the finished product: one png file for each game, named by rom, that looks like the user's control panel layout, with descriptions of each buttons function.
That's it in a nutshell. Let's set aside feasibility for a moment (I think it would be a lot of work, but would be doable), and just everybody tell me what they think about this idea.
Thanks.
potatojin:
--- Quote ---There is a big downsdie to this, it'd take alot of time.
--- End quote ---
It would take a lot of time, but I'm thinking we could rely on a little internet magic to speed it up. I'm thinking of a web-based db that's fed by the community, like the IMDB, with a moderator or two checking to make sure the info is consistent.
This community seems full of people itching to volunteer for things, and it wouldn't take that long to go to the control db site, find out which games don't have descriptions yet, and spend 10 minutes filling out five of them.
Work-in-progress database dumps could be made available so the most popular games, which will probably be filled out first, can start working as soon as possible.
The moderator can deal with control replication, like sf2->msvc->sfa3, etc. through an admin interface to further speed things up.