Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Upgrading command.dat and other documents  (Read 11714 times)

0 Members and 1 Guest are viewing this topic.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Upgrading command.dat and other documents
« on: December 03, 2011, 11:51:38 pm »
I've been looking into this a lot over the past few months. 

When a lot of these documents like mameinfo, command.dat, controls.dat and ect were created, the goal was to either display them within mame, within a fe or on a secondary display.  All of these methods have various akwardnesses to overcome and were never quite effective.  To display it in mame you need wither a custom build or the compliance of the mame team and even then you have various technical limitations like lack of images ect....  If you display them in a fe or other viewer, it is difficult to display them while playing.  Dual monitor setups work well, but it's difficult to get all of your hardware ducks in a row and even then navigating the top screen while playing on the bottom is problematic without special software.

With smart phones, digital readers and tablets becoming more popular, it seems to me that a smarter setup would be to simply use your favorite smart phone or tablet to display data as you are playing.  The problem is that these documents just aren't setup for standard viewing and even if they were, they would be quite ugly as-is. 

I was looking at command.dat because it's the most archaic in terms of format to get ideas.  I think to "fix" some of these docs, the following changes would need to be made:

1.  Each game needs a seperate document, it's just easier to maintain individual entries and add to the docs that way.
2.  We need special flags for common icons (that's already done in command.dat)
3.  We also need special flags for page breaks and images. 
4.  We need optional flags for things like background images and ect..
5.  We need a converter that removes the flags and makes a "plain text" version that can be viewable on literally anything.

If we had that then it would be easy to take an entry and convert it to html, a series of images or a pdf, all of which could be read without a specialized viewer. 

Ideally, it would be better to actually store the entires in html, but it's quite hard to manually parse back into other formats. 


I would like any ideas in regards to this and I would also like to know if there is any interest. 

Thanks

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Upgrading command.dat and other documents
« Reply #1 on: December 04, 2011, 09:53:10 pm »
The quality of web browsers on smart phones, iPods, tablets, iPad's, etc. are all pretty good these days.

Take these two attached images as an example of data generated by CPWizard hosted on gamesdbase.com. One is using Controls.dat and the other Command.dat and they are being viewed on an iPod 4G.

You can of course have mobile formatted data for things like mameinfo which would probably make things easier to read but they still do a pretty good job of displaying a standard webpage or document.

GameEx has a feature to host a mini web server on an ip / port. This can be accessed by any device on your LAN by entering the address into a browser. From that you can control the FE, have game information like snaps and bezels show etc.

Not sure what you're driving at but this is all pretty much available now and it's mostly as easy as entering a url into your device.
« Last Edit: December 04, 2011, 10:03:26 pm by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #2 on: December 05, 2011, 01:00:36 am »
Well the webserver part is another thing all-together.  That part will be in the next version of mamehooker so that it's fe independant (which is VITAL).


I wasn't aware of this site, my guess is it's gameEx centric? 

My point was that these dats are still in the stone-age in terms of features. 

(controls.dat probably needs to be excluded from this discussion as it's a totally different animal).

There really aren't any versions of mame that support info dats anymore so why are we leaving them in such a restricted format?
Let's add support for images, backgrounds, page breaks and bookmarks.
The page you linked to is a perfect example of what I mean BUT... the url's aren't intuitive, meaning you have to actually look them up and the main page isn't very pretty or tablet/smart phone friendly. 

If we were to just host them on a webpage, for example, the url should be more like :

http://gamesdbase.com/commands/mk2.htm

not:

http://gamesdbase.com/Media/SYSTEM/Arcade/commands/Commands_Mortal_Kombat_II_-_1993_-_Midway_Games.htm

That way a third party webserver/app can blindly redirect a browser to a particular game without the need for a lookup table.  A locally stored and dynamically generated webpage would probably be even better.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #3 on: December 05, 2011, 02:02:00 am »
open the dam.dat   .dat
in notepad
edit away
save as .dat  .dat  >note it<
with that in-hand u
have built a .dat
it is self loading
CMD away capitan

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #4 on: December 05, 2011, 02:43:01 am »
open the dam.dat   .dat
in notepad
edit away
save as .dat  .dat  >note it<
with that in-hand u
have built a .dat
it is self loading
CMD away capitan

ed


Nice haiku, let me know when you can bother to actually reply ;)

You know who you are talking to right?

You can't "edit away" because dat file format doesn't support the things that I was talking about. 

If you are suggesting that I change them for my own personal use then that is silly.  I want us to change the format and then everybody conform to it.  That way everyone can benefit and I don't have to manage a custom version. 

Command.dat is particularly bad because it conforms to the old "info" format which never made any sense.  This isn't the fault of the command.dat authors at all, it used to be used in mame, but at this point even mame has moved on.

examples:

The only way to find an entry is to search for "$info=" in the dat which is perfectly acceptable, BUT the games title and particular info is put in comments BEFORE this flag, meaning you have to manually back-track to get it if you want to display this data.

Then you have the end of the entry flag, or lack there-of.  After the info flags you have sections, which are seperated by a "$cmd" and "$end" flag respectively, which again is perfectly fine, but there isn't a flag for the end of the game entry.  This means a parser has to look for the next "$info=" flag (if any, it could be the end of page) and dump all the data between the end of the last $cmd entry and the next info.

It's little things like this that make the data slightly harder to parse than it should be and these are the things I propose we deal with. 

And of course, adding some of the features I mentioned would also be nice. 

I'll see if I can find some examples of the sort of thing I was thinking of tomorrow so you can all get a better idea of what I had in mind.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #5 on: December 05, 2011, 01:29:56 pm »
ok
please do

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Upgrading command.dat and other documents
« Reply #6 on: December 05, 2011, 02:48:03 pm »
Wow, Never looked directly into command.dat before, but I see what you mean by odd format.

Personally, seems like that could/should be reformatted as XML. Then, HTML, or any other format would be one XSLT-run away.

I'm guessing that info can't go in mame.xml because that file is generated by mame?

Seems like it could be folded into/combined with the info in Controls.xml maybe.

Even better would seem to be keep a separate XML file for each ROM and place it in the ZIP file for the rom. Those zips don't appear to have any easily readable metadata included within them (or maybe this has changed, I'm still running mame 1.29).

I'd think it'd be great to have the ROM zip contain everything related to that rom, screencaps, etc...Hmm, then again, that'd make distributed screencaps, etc without the roms a tad trickier wouldn't it?

Ok, Maybe a separate folder, just as we have the cfg, rom, snap, titles, nvram, samples etc folders now....

Call it "metadata"
each rom gets it's own XML file in there.

Take the existing Command.dat and split it out once.



nullPointer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:January 23, 2021, 10:09:31 pm
Re: Upgrading command.dat and other documents
« Reply #7 on: December 05, 2011, 03:08:21 pm »
Hi Howard, I think this is a great idea.  First time poster, long time lurker.  I'm a big fan of your work and dedication to the hobby.  HK I know from over at GameEx and once again I'm a huge fan of his work on that project and elsewhere.

I have a couple of comments and questions on these points.  Feel free to correct anything if I'm talking out of my arse!   :dunno

1.  Each game needs a seperate document, it's just easier to maintain individual entries and add to the docs that way.
2.  We need special flags for common icons (that's already done in command.dat)
3.  We also need special flags for page breaks and images.  
4.  We need optional flags for things like background images and ect..
5.  We need a converter that removes the flags and makes a "plain text" version that can be viewable on literally anything.

These points are excellent.  I think the whole community would benefit alot from these implementations

If we had that then it would be easy to take an entry and convert it to html, a series of images or a pdf, all of which could be read without a specialized viewer.  

Ideally, it would be better to actually store the entries in html, but it's quite hard to manually parse back into other formats.

I would go so far as to say that xml would be the ideal format here.  I think in the end it would grant the most flexibility in terms of parsing to multiple formats as you describe.  The thing about html is that, it's really designed to be parsed by a web browser and really not much else.  It wouldn't be a huge stretch for an external application to parse the html (assuming the format was completely standardized), but it's also sort of like teaching your cat to bark (as you wisely point out).

Here are my thoughts (for whatever they're worth), assuming you're with me so far.  A single XSD (XML schema document) is created which defines the standardized format for every individual game document (which will be formatted xml).  So long as the developer has access to the one single standardized XSD document they know every possible element and/or complex type that can possibly exist for any game document.  The XSD is the document which defines the standardization to be applied to each individual XML document.  Using the XSD document you can even generate any of the individual game xml documents on the fly (assuming you have access to the raw data).

So we have the XML documents.  How are we supposed to parse these things into any old format we want?  From there developers wishing to utilize the game data can develop their own XSL (XML Schema) documents.  The XSL can be applied to the formatted XML to generate dynamic web pages, PDFs (via FO-FOP transformation), or whatever else they would like to.  For that matter, depending on the intended application the developer can forgo the XSL altogether and manually parse the xml if they wish to.  (But for the purposes of web pages I think the XSL is the way to go here).

I guess the thing I like about the XML idea is it's specifically designed to be parsed into a multitude of formats, and addresses each of the five criteria above in an efficient fashion.  I'd even go one step further with a 'perfect-world' scenario, as one example of an implementation of this.  A database is created containing all of the raw unformatted game data (images could be stored either as BLOBs or URL references).  This in itself would be a somewhat herculean task.  This database is distributed to users with server and web service components.  The database can be accessed via the web service which spits out the formatted XML as requested by the service call.  From there the user can either save an xml document locally (or just generate all the xml documents locally), or their browser parses the XML into whatever format they requested.  This model also allows the motivated user to set up their own externally facing web server accessible over the internet (probably has the added bonus of completely hosing their bandwidth too!).

I'm just knocking ideas around now, but that's my 2 cents (worth every penny right)!   :lol

Edit:  Looks like drventure beat me to the punch while I was typing up this wall of text.  But yeah, looks like that's two votes in favor of XML.
« Last Edit: December 05, 2011, 03:47:56 pm by nullPointer »

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #8 on: December 05, 2011, 03:44:50 pm »
maybe i am in the same boat as u nullPointer
but i just loaded up xml
to my delight java
sweet
please lead on

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #9 on: December 05, 2011, 04:17:15 pm »
I'm all for xml, but we've got to be careful.  Xml, while easy to parse is a rather bloated format.  A 500kb file could easily become a 50 mb file just by the conversion to xml, and that doesn't include the images and such we intend to add.

As for an example... well I couldn't find a good one, which imho is a good thing... that means that what I'm getting at doesn't yet exist and we wouldn't be wasting our time.  ;)

But to give you an idea, take a look at this instruction card:

http://fighters.com.br/kofbrasil/kof98-movelist2.jpg

Now obviously it's in the wrong layout format, we would want the entries to be long, with one character under another, not wide.

But this is what I was getting at.  The only difference between this very visual movelist and command.dat is a character portrait image and a background image.  And for simplier viewers that just want to display the text, or text with icons, they could simply ignore the image flags. 


Why not just make images?  Well I tried that.  I got one volunteer and he fell off the face of the earth.  ;)  Also there are advantages to having the moves in text format, mainly if a mistake is found the whole card doesn't have to be re-made.  Also we could convert all of command.dat instantly once we decide upon a format.  Sure it wouldn't have any new images or anything, but people can go back and add those in at their leisure.  Also there is the added benefit of removing aspect ratio worries.  Unless something is in re-sizeable text, it's quite hard to make a universal move list that you can view on any device. 

I like the idea of conglomorated packs as well.  The only probablem would be finding someone gullable... err I mean dedicated enough to maintain it. 


We might actually be able to salvage the "info" format with a bit of modification, but I would want everybody on board with this.  That would mean the command.dat guys, the mameui guys and the info/history guys. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #10 on: December 05, 2011, 04:53:39 pm »
Hmm maybe I should throw some thoughts out there so we can get the ball rolling:

MameInfo.dat

This is the original document to use the "info" format which I believe is a relic from the dos days.  A typical entry looks something like this:

============================================================
$info=romname
$mame  (why this flag was chosen is unknown... seems rather silly to me)

Version inclusion info

Bugs:

-list of bugs

Wip:

-list of wip entries

LEVELS  (number of levels, only occasionally included)

Reccomended Games:

-list of reccomened games  (not always included)

Romset info:
$end
============================================================

Here are my complaints with this doc.  First off, while it isn't shown in the example above, the mameinfo.dat has a 10 page blurb of comments regarding the revision history at the beginning of the doc.  That is all well and good, but parts of the comments aren't encapsulated in the info formats caption flag (a # and the beginning and end of the line)

Also all those different types of data and no section flags, meaning there's no way to skip down to the reccommended games or what have you. 

And what's the deal with the "$mame" flag?  Shouldn't it just be "$info=" and "$end" if you aren't going to have section breaks?

Many of the things I meantioned in command.dat aren't even implemented in mameinfo, meaning it's even more archaic in some respects.  At least it's easy to parse though as there is a definate end flag. 


History.dat:

This one has the same exact issues as mameinfo.dat but yet again, it deviates from the standardization.  The info flag has been modified to allow clones and that way it is done makes it rather difficult to parse.  You can put as many entries as you want in the "$info=" by seperating them with a comma

Like so:

$info=$info=99lstwar,99lstwara,


Notice the extra coma?  Well they've added a new flag that makes so little sense that it boggles my mind.  Every entry now has a link to klov!  They've shoe-horned it into a flag by simply putting a "$" in front of a standard html link like so:

$<a href="http://www.arcade-history.com/?n='99-the-last-war&page=detail&id=2&o=2" title="Edit this entry at Arcade-History.com">Edit this entry at Arcade-History.com</a>

Since the info format is NOT html and certainly can't be parsed by a html browser why in the world did they stick to the html format when adding a link???

Also the "$mame" flag has been replaced by a "$bio" flag.  No rhyme nor reason to it, it only makes the info format even less standardized. 


Ugh... I'm getting tired, I'll post the ins and outs of the command.dat in a second and my thoughts on how we need to standardize.

**edit**

Ok one left, command.dat

This one has more structure, but it deviates from the mameinfo format even more.

You've still got the $info=romname to start but now there are various sections for each entry, encapsulated by a $cmd and $end.  That is fine, but in the other two dats, the $end flag is used to signify the end of a document, meaning that command.dat doesn't have an end document flag.  Also as I've already mentioned, info that should probably be part of the document is in the form of a comment before the actual "$info" flag, meaning you have to grab it manually. 

On top of that, the icon implemention is a bit odd.  There really isn't a flag to signify that an icon is coming, you merely have to replace certain phrases with certain icons.  That is OK, but the phrases don't have a lot of standardization.  You have _A _B _C and _D to represent those buttons respectively but you've also got _a _b _c _d to represent button icons 1, 2, 3 and 4.  That means that icons have to be case sensitive.  This can (and has) only lead to confusion.  By the looks of the format, I think they just used a free character as need to represent a free icon.  Also they eventually ran out of slots and started using ^A (or what have you) to repserenst icons as well.  Then they needed even more slots and started adding another character, leaving icons with such bizarre representations as _Cr and ^Qu.  This sort of thing causes a ton of problems.  You need to know what you are looking for ahead of time for one, meaning anytime a new icon is added to command.dat the parser has to be updated.  Also because of the variable length, you can't easily do a "best guess" by replacing anything that starts with a _ or a ^.

Ok that's the three major ones, I'll post some possible solutions in the next post.
« Last Edit: December 05, 2011, 06:31:39 pm by Howard_Casto »

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #11 on: December 05, 2011, 05:00:49 pm »
this is rem in dos #comment#

>Here are my complaints with this doc.  First off, while it isn't shown in the example above, the mameinfo.dat has a 10 page blurb of comments regarding the revision history at the beginning of the doc.  That is all well and good, but parts of the comments aren't encapsulated in the info formats caption flag (a # and the beginning and end of the line)

<

the run cmd is $ where $ is defined as a run=do cmd

please let me go through your statment's slowley
and for your know i am not slamming u


ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Upgrading command.dat and other documents
« Reply #12 on: December 05, 2011, 05:38:53 pm »
Quote
the run cmd is $ where $ is defined as a run=do cmd

So, the mameinfo.dat file was originally some sort of dos BATCH file? That'd be weird.

Howard, i think you're on the right track.

But was commands.dat supposed to ONLY contain fighter command sequences?

I'm just wondering.

If the end result is to render "cards" like what you show, then XML with some XSLT and embedded graphics sure seems like the way to go. 500kb to 50meg? I don't see that as a particularly big deal. It'd be +nice+ to keep the graphics and the text segregated in some way to avoid having to look at all the graphics stuff. Maybe at the end of the file, or in a separate, referenced file?

as in
\Mame
    \ini
    \roms
    \metadata
          asteroids-metadata.xml
          asteroids-graphics.xml
          {romname}-metadata.xml
          {romname}-graphics.xml

or possibly
          {romname}-CardImage1.png
          {romname}-CardImage2.png
          {romname}-AnotherImage.png

or something like that.

one of my Engine18 addins supports additional snaps, videos etc, via a similar naming convention.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #13 on: December 05, 2011, 08:02:58 pm »
Ok look above, I updated the explainations to include command.dat.

ed:  Yeah I knew it was old dos stuff, some of that formatting is still used in C for certain things.  I just don't understand why one dat would use $bio and one would use $mame when back in the day mame couldn't tell the difference between the two.


drventure:  In terms of file size I agree, it's virtually irrelevant.  However, in terms of parsing, even with a dedicated xml parser it is a lot quicker to parse a 500kb file than a 50mb one.  listxml, for example is virtually impossible to parse in a timely fashion unless you only print out info for a specific game.  That is what I was getting at.... we have to be careful.

Ok now onto solutions.  First off understand that the actual name of the tags and such is irrelevant.  The stuff would obviously have to be written differently depending upon the file format we use.  I'm just talking about organizational stuff here. 

Ok I'll just post some flags with examples:

$info=sf2

$title=Street Fighter II:  The World Warrior
$author=The Author
$source=references and sources if applicable

$secstart=name for start of section... the name is optional and only used for navigation (think hash tags)
As much data as needed here a paragraph or what have you
$secend

$secstart=name for start of a different section
As much data as needed here a paragraph or what have you
$secend


$endinfo


That would be a typical entry.  Of course like I said, the flag names are just symantics, these could just as easily be html/xml brackets or what have you.

Special flags

$_abc:   This would replace the icon system in command dat.  The "$_" tells us that it's a icon, the three letters(or numbers) are an abbreviation of which one.  For example the icon for the B button would be $_BnB  for "Button B" a quarter circle forward would be $_QcF the "tap" icon would be $_TAP ect... all of which woudl be case INSENSITIVE.  That should make it fairly easy to replace icons... search for $_ and read three characters after. 

$img=Imgname.ext  Obviously this would be an image tag.  We would try to avoid full paths and a position flag might be necessary.  So that we don't have to deal with quotation marks maybe we could make a rule where image names can't contain spaces.

$bgimg=imgname.ext  Again just the background image.  I would reccommend that we make it possible to have a different bg image for each section.  Again we might need some additional flags, like if the image is repeating or stretched or what have you.

$bgcolor=r,g,b  The Background color, probably needs to stay the same for the whole entry.

$fontcolor=r,g,b  The color of the font, this could vary.

$fontsize=size  The font size.  We might have to do a arbituary size instead of a specific one, similar to how html does it (h1-h10) because on different devices you would want to scale accordingly.

I think the font type should NOT be an option.  Command.dat in particular works best with a mono-spaced font, so you can just throw the icon right in there and not have to worry about sizing around the text as each character has the same width.


I THINK that covers most of it and in terms of features that would be all we need, but now is the time to make suggestions. 

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #14 on: December 05, 2011, 08:49:15 pm »
i need to brush up on >parsing<

as far as command.dat because we wright it as a batch file.
u are on the right track to :define:,what is and what is not allowed

if u stay the course as i am seeing .:)
ppl will get the hang of editing there own .dat's and or making there own
it's a lost art as far as i can tell

but as i said i will need to brush up on parsing a tad

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #15 on: December 06, 2011, 01:28:58 am »
got it

winc++
crack the .dat down
yup to pick your command.dat

it is in
styilus studio 3

the full
atrabuites are there >< inculde >name<

>inculde< >pointer< pointer = file folder
ie c:\root\meame\>file to inculde<
is thie the handler u want?

is this about right ?

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Upgrading command.dat and other documents
« Reply #16 on: December 06, 2011, 04:32:51 am »
I agree xml is the best format even though it's padded as hell it's a great way to organize data and is easily extensible. Most langauages can parse it easily. Well MAME uses it even if its current output is ~50 MB.
« Last Edit: December 07, 2011, 09:27:52 am by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #17 on: December 07, 2011, 12:46:03 am »
I think if we split it out as an individual file for each game then we should be safe.  I'll see if maybe I can do a sample entry for each dat sometime later this week. 

I think the best way to keep things parsable is to keep the schema extremely light and to avoid the nesting hell nightmare that is used in other text formats like html, the doc format ect...


Example:

Let say you've got a bit of text and you want to make it half red with tags like so:

This text is red! Except this part, it's black.

Now in html you would be able to double nest it and it would work, like so (I know these are the wrong html flags, bare with me):

<fontcolor=255,0,0>This text is red! <fontcolor=0,0,0>Except this part, it's black.</fontcolor></fontcolor>

We need to avoid nightmares like this.  While it's easy for a parser to parse, it's difficult for the programmer to know what to do with the data.



I would suggest that properties be stand-alone flags and not encapsulations, like so:

<fontcolor>255,0,0</fontcolor> This text is red!  <fontcolor>0,0,0</fontcolor> Except this part, it's black.

How do you know where the colored text starts and ends?  Well it starts immediately after the end of the flag and doesn't end unless another flag is found.   
The same goes for things like background images. Once a background is defined, it remains the background until another background is specified.  This way you can render a section at a time, as you go instead of having to deal with it all at once.  Of course entries and their containing sections would be different, but again, nesting should probably be illegal for clarity's sake. This just makes the most sense to me as it would be straight forward to parse, but I'm open to input.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #18 on: December 07, 2011, 02:49:21 am »
Just a head's up, command.dat needs a once over even if we don't convert it.  

I was going to to use MK as an example because it's very short and in the comments I saw "taken from his memory"  and I thought "uh oh!"  Sure enough there were various errors, one of which involves using the wrong icon in various places.  That's why I'm saying we need to change the icon system, it's quite confusing as-is, especailly considering the icons don't have a corresponding description.  

Perhaps Icons need a alt-description like html does for images, like so:

<icon src=QcF>Quarter Circle Forward</icon>
« Last Edit: December 07, 2011, 02:51:54 am by Howard_Casto »

nullPointer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:January 23, 2021, 10:09:31 pm
Re: Upgrading command.dat and other documents
« Reply #19 on: December 07, 2011, 05:15:12 pm »
Example:

Let say you've got a bit of text and you want to make it half red with tags like so:

This text is red! Except this part, it's black.

Now in html you would be able to double nest it and it would work, like so (I know these are the wrong html flags, bare with me):

<fontcolor=255,0,0>This text is red! <fontcolor=0,0,0>Except this part, it's black.</fontcolor></fontcolor>

We need to avoid nightmares like this.  While it's easy for a parser to parse, it's difficult for the programmer to know what to do with the data.

I would suggest that properties be stand-alone flags and not encapsulations, like so:

<fontcolor>255,0,0</fontcolor> This text is red!  <fontcolor>0,0,0</fontcolor> Except this part, it's black.

How do you know where the colored text starts and ends?  Well it starts immediately after the end of the flag and doesn't end unless another flag is found.   
The same goes for things like background images. Once a background is defined, it remains the background until another background is specified.  This way you can render a section at a time, as you go instead of having to deal with it all at once.  Of course entries and their containing sections would be different, but again, nesting should probably be illegal for clarity's sake. This just makes the most sense to me as it would be straight forward to parse, but I'm open to input.

I like this plan, but I would even go so far as to suggest that the formatting elements are specified as attributes of the enclosing parent tag in the XML.  In this fashion we might end up with something that looks like this:

<arbitraryText fontColor='FF0000'>This text is red! </arbitraryText>
<arbitraryText fontColor='000000'>Except this part, it's black.</arbitraryText>

Or this:

<arbitraryScreenBlock backgroundImage='IMAGE_LOCATION'>

I like this plan, but there's something here that violates a certain purist aesthetic.  I'm not sure we can escape it, but ideally the game data itself should be divorced from how that data is rendered.  I would suggest that if possible the XML data exist independently of formatting styles.  Ideally the XML document for each game should contain the raw data pertaining to that game and not much else.  This helps to keep the size of the XML in check to some extent, but moreover it gives developers greater freedom to apply custom styles to the data if they wish.

Having said that it's probably not very practical, and in the case of controls.dat it's probably impossible not to include the formatting in the XMl to some extent.  I think this presents two options.

1.  Include all formatting styles within each individual XML document.  If developers wish to deviate they can create their own XSL Templates.

2. Include relative styling cues in each of the XML documents.  This would look something like this:   

<arbitraryScreenBlock backgroundImage='1'>
   <arbitraryText fontColor='1'>This text is red! </arbitraryText>
   <arbitraryText>Except this part, it's black.</arbitraryText>
</arbitraryScreenBlock >

The numeric font color attribute here could refer to the total number of font colors used in this particular document (same goes for the background image), and denotes where each flag exists in the original implementation.  There is a certain degree of nesting, but honestly I don't know that we can escape it entirely particularly for commands.dat where each game has an unknown number of moves (my opinion).

Benefits to this approach:
  • Generic data modeling grants greater flexibility in implementation
  • Presentation layer exists largely independent from the data structure
  • Development methodology is a bit more straightforward (i.e. first develop a robust XML structure that can accommodate all necessary data, then start worrying about formatting the data with stylesheets).
  • Any deviation from standard will exist in the stylesheet rather than in the data model (i.e. multiple developers can work on separate stylesheets, all confident that the XML structure will always be the same (as opposed to everyone working on separate XML documents inevitably tweaking elements here and there along the way)

Downsides to this approach
  • Each game already has a single XML document.  Now each game can also potentially have one (or more!) stylesheets
  • You would need a separate XSL for each intended format (one for HTML output, one for the PDF version, etc.)

It’s a bit more effort but I also think there are a couple of mitigating factors.  I’m relatively convinced that using a solid XML Schema (xsd), the individual xml documents can be generated on the fly provided there’s a solid data source to work with.  Although each game can potentially have one stylesheet, I think the first step in developing the xslt would be to develop a common default xslt.  From that point, one could branch out to all the other custom jobbies.

Sorry for the long winded response.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #20 on: December 07, 2011, 09:54:01 pm »
All good stuff!

There was a reason that I didn't encapsulate the text in the font color flag though.  From a programmer's standpoint (ie the guy who has to make a renderer)  it's just easier to switch stuff on and off as you go rather than to say "this stuff is this color"  In other words the renderer is reading along, it switches the font color to red when it see's the flag... continues to render text, now red... runs across another font color tag... switches back to black... now it's rendering text in black. 

But then again, when it comes time to use a converter to change it to xml or what have you, it would be nicer to have the text encapsulated, so I dunno.


The style sheets make a lot of sense to me, but then again we are bogging down things in terms of complexity.  Going buy others suggestions we would already have quite a bit of stuff for each game.....  maybe an example tree:

[Metadata](The main external data folder, holds all entries and such)

.....Default.xml/xsd (schema info or misc junk)
.....[Icons](Holds generic command.dat and other useful icons)
.....[Images](Holds any necessary images that would span multiple entries... larger than icons and therefore need sizing info)

.....[RomName](Holds all the metadata for a specific game)
..........Mameinfo.xml
..........Command.xml
..........History.xml
..........[Icons](Icons specific to the entry, optional)
..........[Images](Images, including background images specific to the entry, again optional)

So that's pretty bad as-is. 

I could see the actual data being used in three different types of viewers

1.  Full featured... supports font color, icons, backgrounds, images ,ect... could be in any format (xml html, pdf ect...)
2.  Light... supports icons and probably font and background color, but that's it. 
3.  Minimal...  supports diddly squat... useful for black and white e-readers which don't do well with graphics.  If the mameui guys don't buy in to our alterations stuff could be back-converted to "info" format as well.

For full featured, changing the font color via a style sheet might make the text and icons unreadable.  You obviously can't change the size of the images, it would totally ruin the text formatting and that's about all I can think of that one might want to alter.  As I stated before font size's would be realative so a style sheet or a simple adjustment of options when you go to convert the document should do the trick.  I didn't mention it before, but we wouldn't use absolute pixel sizes in any of the options, it would always be in percentage of the screen. 

For light we absolutely could alter things like coloring and various other format changes. 

For minimal everything is going to be raw text anyway.

There is merit to what you are saying though.

There are two ways I see of doing that though.  One is to have a header section in each xml document defining all the "macros" to be used in the doc and giving them a name.  Like so:

<header>
     <font size=1 color=0,0,0>Regular</font>
     <font size=2 color=125,125,125>Title</font>
</header>

Now you can use these flags to automatically set attributes to a section of text like so

<Title>Chun-li</Title>

<Regular>Here is some info about Chun-li in regular old paragraph text</Regular>

An external file could override the header and alter all of these various text sections easily.  There are drawbacks to this though, the main one being that we would need a rigid set of macros and people would have to stick to them.  If, for example someone created a new macro for their entry and someone tried to apply a generic style sheet to it, one that inverts the normal color scheme, any sections that used their new macro would probably be unreadable.

You could also set various options within the "section" dividers of a document, similar to how you do the <body> flag of html, but it would limit what we could do, most noetably you would be stuck with one font size and color for the whole section.  That would be ok, but then people would start exploiting section breaks to pepper in different colors to a single paragraph, making section breaks useless as a means of navigation.

I've finally got some time to breathe this season.  Maybe I can whip up a real simple viewer and example xml and we can all look at it and tear it apart.  ;)

Hmm... I think I still have a command.dat viewer's source around here.  I'm sure it's really great considering I probably haven't touched it since 2000.

nullPointer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:January 23, 2021, 10:09:31 pm
Re: Upgrading command.dat and other documents
« Reply #21 on: December 09, 2011, 02:09:15 pm »
I like your line of thinking here.  I totally get what you’re saying about using flags rather than tag attributes.  It makes a lot of sense.   I’ve never attempted to work with these documents in code so I definitely have a (naïve?) layman’s perspective as far as what direction makes the most sense here.

The more I started thinking about implementing individual style sheets for every game the more it seemed like a nightmare in the making.  I was also trying to reconcile in my mind how such a system could handle unspecified image dimensions, and I don’t think there’s a good solution there.  I think so long as developers have the option of applying custom stylesheets to the XML that’s probably good enough.

Following that line of thought to its logical conclusion one arrives at the same conclusion you point out.  If the layout defines ‘blocks’ to which custom styles can be applied, how granular should those blocks be?  If the blocks are too big the developer is locked into a limited range of options for formatting large chunks of data.  Hacks will inevitably start to appear.  If the blocks are too small, the file size grows by an unknown factor, not to mention that the developer’s job becomes much more complex when trying to apply formatting.

I’m just bouncing ideas but maybe there could be a happy medium here.  Working with your idea of a header section, maybe that section defines not the blocks to which formatting is applied, but rather the flags used to apply formatting.  This might also coincide nicely with your thoughts on using flags for formatting rather than encapsulation.

<header>
   <font size=1 color=0,0,0>Style_1</font>
   <font size=2 color=125,125,125>Style_2</font>
</header>

Now these flags could be applied as switches rather than distinct encapsulations

<Style_1/>
<Title>Chun-li</Title>

<Style_2/>
<Regular>Here is some info about Chun-li in regular old paragraph text</Regular>

I dunno maybe it’s exactly the same thing with the same set of issues.  There’s definitely still a question regarding the appropriate  granularity of the sections to format, but in this way the developer is a bit freer to bend the rules of style flags rather than bend rules as they apply to entire sections of the document.  This also separates 'formatting' blocks from 'navigational' blocks.  I’m not sure that I completely follow your example of a custom macro breaking the rules of formatting, but would a system such as this help to circumvent that possibility?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #22 on: December 09, 2011, 06:59:16 pm »
I think that you are assuming that by giving the macros generic names that it will solve our problems.  It won't.  If anything it will make things more confusing because authors will insist on using the wrong numbers for the wrong types of text.  If anything what you did was add two flags where only one is needed, thus adding bulk to our document.  ;)

How about this.  I've got to assume that specific styles are going to be made by the main author as they would take the time to actually make special background images and such and any style sheets applied would be of the generic variety, to make a uniform look or to change the formatting for a specific device.

So let's revisit the header section again.  Now we have two "constants" for the headers, title and default.  I've got to think that like any document in the history of everything you are only going to have two font styles 90% of the time, so as long as any supplemental header has those two we are good.   What we can do is default back to the "default" font settings if a flag is unregognized or a section of text doesn't have any formatting tags. 

Examples: 

Let's say we have a entry with a header like so:

<head>
     <font size=1 color=0,0,0>default</font>
     <font size=2 color=255,0,0>title</font>
     <font size=1 color=128,128,128>gray</font>

     <bg color=255,255,255 img=bg.png>default</bg>
     <bg color=0,0,0 img=title.png>title</bg>
     <bg color=255,255,255 img=char1.png>char1</bg>
</head>

Note the background flags, those are going to be needed as well (although they won't encapsulate the text, there will be one per section).


So lets say somone makes a generic style sheet for all the entries and applies it.  It has a header like so:

<head>
     <font size=1 color=255,255,255>default</font>
     <font size=2 color=0,255,0>title</font>
     
     <bg color=0,0,0 img=bg.png>default</bg>
     <bg color=0,0,0 img=title.png>title</bg>
</head>

Note that it doesn't have enough entries.  That is OK because when the renderer comes across the "gray" and "char1" flags it will default back to the default font and background settings respectively.  The original header will be completely ignored.  So this will work for generic formatting. 

But if someone wants to make a specific re-skin for a specific entry that would work as well.  They have the option of overriding any entry specific macros so it will work just fine. 

The thing that would be important with this method is to get everyone's understanding that the macros "default" and "title" are a requirement and they must be defined so that when any formatting is stripped away their contrasts with each other will make text viewable.  Also "default" needs to be used for the bulk of the text and "title" needs to be used for... well titles, and in the case of backgrounds, any time when the default background won't do but a character/section specific bg isn't necessary, like the title section, which might use a graphic instead of text.

Oh and about the about the bg macros... they won't work like the font ones.  I'm trying to be mindful of the html conversion and in html backgrounds are a option in a section, like in the "body" flag or in the "table" flag.  So instead of encapsulating text, they would either immediately follow the section entry or be included in it as an option, like so:

<section bg=default>
This section uses the default background!
</section>

I think that should cover most issues and allow us to apply different formattings to entries. 


In terms of the sections, think of them as chapters in a book not pages in a book.  Renderers are obviously going to have their own method of rudimentary page navigation and such, sections would just be used to, for example jump to the next fighter's movelist.  The length and complexity of a section would be up to the author.  That being said, we would try to keep it standardized.  Just to use command.dat as an example, I would like to think that we would have a section just for the title of the entry, because you might want to use a fancy graphic (like the game's marquee) and this first section would be made cosmetically nice so that the user would have something pretty to look at if they choose not to browse the game's docs.  Then you would have a legend section, to associate the icons with their meanings.  Next you would probably have a generic movelist section that lists the moves common to all characters and finally an individual section for each character. 



The only other issue I can think about is how to handle the backgrounds.  It seems simple enough, but it isn't.  Sections would be just that... sections of text.  Some could be long and some could be short.  So how do you display the background behind them? In my command.dat viewers I always made it to where you could only read one section of text at a time.  This method would make it easy.... a background image obviously becomes a full screen image this way.  If you want to display things all at once, however things get a little hairy.  You can resize the image to only fill that section of text, piece of cake, BUT whatever font the renderer uses is going to effect the output dramatically.  Even if it's a mono-spaced font, the font height might vary, meaning that the bg image could get distorted.  We could make an iron-clad rule that you can only use a specific font, but you've got to think that would be especially difficult to enforce on html conversions, where the device in question might not have said font. 

There is of course the option of raster fonts, but many low end devices would choke on so many images, so it wouldn't be very universal. 

That is why I'm leaning towards a rule about displaying one section at a time... it just eliminates a ton of headaches.  Even then we've got aspect ratios to deal with (UGH). 

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #23 on: December 09, 2011, 11:26:16 pm »
ok i am at the back of te bus

but i am following along

Examples: 

Let's say we have a entry with a header like so:

<head>
     <font size=1 color=0,0,0>default</font>
     <font size=2 color=255,0,0>title</font>
     <font size=1 color=128,128,128>gray</font>

     <bg color=255,255,255 img=bg.png>default</bg>
     <bg color=0,0,0 img=title.png>title</bg>
     <bg color=255,255,255 img=char1.png>char1</bg>
</head>

Note the background flags, those are going to be needed as well (although they won't encapsulate the text, there will be one per section).


So lets say somone makes a generic style sheet for all the entries and applies it.  It has a header like so:

<head>
     <font size=1 color=255,255,255>default</font>
     <font size=2 color=0,255,0>title</font>
     
     <bg color=0,0,0 img=bg.png>default</bg>
     <bg color=0,0,0 img=title.png>title</bg>
</head>

where
>< is command end start right ?

where </ is switch ? right ?

and > is end switch ?
 and command is placed in ><
correct?

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #24 on: December 10, 2011, 03:05:05 am »
ed:

The "<" followed by the flag name is the start of the flag....... ie the "<font" 

Anything after that but before the first ">" is the flag's settings.

Anything between > and < is either the name applied to the flag or the text that is going to be modified by the flag, depnding upon the usage.

The "</font>" is the end flag.... xml requires that any flag (or "node" as they call it) have an end flag that matches the beginning flag. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #25 on: December 10, 2011, 03:14:59 am »
crap!  I forgot about the xml schema..... I never make those things... I hate xml.  ;)

We are going to have to list all possible nodes, which means we probably shouldn't use arbituary names for the nodes themselves.

So the header would look more like this:

<head>
     <fontmacro size=1 color=0,0,0>default</font>
     <fontmacro size=2 color=255,0,0>title</font>
     <fontmacro size=1 color=128,128,128>gray</font>

     <bgmacro color=255,255,255 img=bg.png>default</bg>
     <bgmacro color=0,0,0 img=title.png>title</bg>
     <bgmacro color=255,255,255 img=char1.png>char1</bg>
</head>


The usage of backgound macros would be unaffected, we just changed the name for clarity's sake... but for font usage, it would look something like this



<font macro=title>Chun-li</font>

<font macro=default>Here is some info about Chun-li in regular old paragraph text</font>

Not a huge change, but xml is annoyingly all about symantecs.  Also note that the macro nodes themselves are called "fontmacro" but when you call one you use a "font" node instead and define the macro name as an option. 

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #26 on: December 10, 2011, 10:57:48 am »
thank-u very much
i just wanted to be sure i am on the same page as u :)

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #27 on: December 10, 2011, 09:53:51 pm »
Just an update... I've started on a VERY primative viewer.  We can agrue about the formatting all we want but until we can actually see a page rendered it'll be hard to figure out what needs tweaking.

It'll probably never make it to prime time... I'm make it for the sole purpose of figuring this stuff out.  Atm all it does it strip away the nodes and display A plain-texted version of an entry.  I'll add in the features as I go. 

In the meantime, I found an article that will help us with font selection. 

http://hivelogic.com/articles/top-10-programming-fonts/

All of these "programming fonts" are simply mono-spaced fonts, which is what we want.  It actually isn't going to be as bad as I thought.  It looks like all Mac products use Monaco, Consolas looks best in Windows and android phones have their own "Droid Sans Mono"  font.  These are all similarly sized so making an entry in one font isn't going to have that much of an effect if you switch to another. 

If nothing else we can make the droid sans mono font the default as it's free and availalable on everything (except maybe the ipad... I dunno if you can download fonts to that thing). 

(p.s.  the other fonts mentioned can be used, but they are all ugly)

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #28 on: December 10, 2011, 11:41:54 pm »
this right ?
>
Top 10 Programming Fonts
Sunday, 17 May 2009 • Permalink

Update: This post was written back in 2009, and much has changed since then. I’ve also written a few subsequent posts about alternative programming fonts, like this one about Anonymous Pro.

I’m a typeface geek, and when it comes to selecting a font I’ll stare at all day, I tend to be pretty picky. Recently, when I discovered that a friend was using a sub par typeface (too horrible to name here) for his Terminal and coding windows, my jaw dropped, my heart sank a little, and I knew it was due time for me to compose this article.

What follows is a round-up of the top 10 readily-available monospace fonts. Many of these fonts are bundled along with modern operating systems, but most are free for download on the web. A few, notably Consolas, are part of commercial software.

A note about anti-aliasing
In the past, we’ve had to decide between tiny monospace fonts or jagged edges. But today, modern operating systems do a great job of anti-aliasing, making monospace fonts look great at any size. It’s not 1990 anymore. Give your tired eyes a break and bump up that font size.

If you have any doubt that anti-aliased fonts are apropos for code, note that even the venerable BBEdit — which for years has shipped with un-aliased Monaco 9 set as the default — has made the jump. The app now ships with a specially licensed version of the Consolas font from Ascender, bumped up in size, and with anti-aliasing on by default. Panic includes a special anti-aliased font (Panic Sans, which is actually just a version of Deja Vu Sans Mono) with its popular Coda application<

if so there is no reason why we cannot  .cmd inside of itmy keyboard is just a wanky right now
give me a min to trash it
i will get back to u

ed

Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #29 on: December 13, 2011, 09:50:12 pm »
Another update... sorry I've been busy lately. 

I've implemented a sax parser in my viewer and I've gotten it to properly read all the tags and display a plain-text readout. 
I'll got ahead and implement font styles and image usage later this week. 

I think I've got the format pretty well hammered out, but there are a few annoyances to deal with. 

Stay tuned.

nullPointer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:January 23, 2021, 10:09:31 pm
Re: Upgrading command.dat and other documents
« Reply #30 on: December 14, 2011, 03:03:22 pm »
Awesome Howard!  Really looking forward to seeing how this all develops.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #31 on: December 16, 2011, 03:32:26 am »
My loss of sleep is everyone's gain.

I got the color rendering done tonight.  It was actually tricker than I thought. 

Next I'll tackle font sizing, which might be a little difficult.  I'm thinking of basing it on the html "h1-h10" standard simply because I don't know how the hell we would convert it to html otherwise, but I really hate that method.  Regardless, this part will have to be "locked down" as it will have to do with aligning backgrounds as well. 

Oh I also thought of a new property we are going to need... aspect.  If we want text to overlay on the backgrounds properly, we are going to have to specifiy the aspect that the document was intended to be viewed on.  I could do it "automagically" via the size of the backgrounds, but that seems iffy.  I think by default we are going to have to insist upon documents being created for 4:3 screens.  There is nothing stopping a person from modifying it to 16:9 or 16:10 via a style sheet.

Actually, just changing out the background elements should do it.  You could keep the actual file and text in 4:3 but add  16:9 BGs to fill in the borders.

Also we are going to need a "text width" property.  This is left over from the old command.dat and it will be useful for our purposes as well.  Basically in the old versions of mame the font size of the menus was dependant upon the resolution of the game and thus each command.dat entry had a different amount of maximum characters per line.  We will need it as well as we are going to omit font justification options.  So if you want to center something, you add spaces.  It also makes the document universally scaleable, to increase or decrease the overall text size, one would only have to modify the text width.

Anyway, once I get font sizing squared away I'll move on to implementing icons (ugh) and finally images and background images in general.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #32 on: December 16, 2011, 09:36:08 am »
I went ahead and added in rudimentary icon and background support because those are easy. 

I can use the code I made for icons to load images, but it will have to wait.  The rest of the features require sizing info, and I have to get that squared away first.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #33 on: December 19, 2011, 06:26:18 am »
Ok, I cleaned up the editor a bit more and did some research into font sizes with html, since it was my major concern. 

Luckily, the WWWC has finally removed the old "h1" - "h10" size options as of html 5.  This is a very good thing!  The new method (which is style sheet based) allows you to define size as a percentage of the base font's size.  This is great because it's exactly how I wanted to do things with the new xml format! 

So with that sorted I can go on to get font sizes implemented and go on to images.  You guys might get this test viewer and the proposed new format as a Xmas present! 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #34 on: December 19, 2011, 08:44:00 am »
Ok, font sizing has been implemented.

Images will use a very similar sizing method, so I can go ahead and add in image support next. 

At that point I should have the groundwork in place for a very simple viewer and I'll release it for you guys to play with. 

I'll also make a converter/backconverter for the current info formats, so we can have some docs to work with right off the bat.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #35 on: December 19, 2011, 11:38:47 am »
Images have been implemented. 


I still have some cleanup work to do, mainly implementing the various sizing styles for background and regular images, but it is working now at least.

Mind you this is a basic viewer, it doesn't support pngs or hardware acceleration, but it gets the job done.  Hopefully I can rebuild it with advanced features later on. 

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #36 on: December 19, 2011, 02:32:12 pm »
hi
would u do me a fav and please up-load the work ?
reason is i am running out of time for this >trial<
and would love to follow along a tad more

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #37 on: December 20, 2011, 04:46:08 am »
I'll see what I can do, but the program definately isn't ready to be released, at least not for a few more days. 

I can post a new example xml I'm using for testing, but in all honesty it's going to look like gibberish without some docs explaining what does what.


After I've gotten the format pretty well locked down, I'm going to have to write a set of "bibles" for both programmers and authors regarding how to create and parse the xml. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 10:25:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Upgrading command.dat and other documents
« Reply #38 on: December 20, 2011, 06:07:44 am »
Ok, I pulled some class modules out of mamehooker to gain png support.  That should cover most of the needed elements in terms of rendering. 

I need to properly document and implement the various background styles, and add a flag or two into the xml schema.  I'll be out today, but maybe I can fix that tonight.  If so then we should have a release tomorrow for you guys to play with. 

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: Upgrading command.dat and other documents
« Reply #39 on: December 20, 2011, 11:14:45 am »
thk-u very much
i look foward to c-ing your work

ed
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.