Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - vgm/gd3 format & xml?

Reply to topic
Author Message
  • Joined: 13 Nov 2007
  • Posts: 93
  • Location: New York, NY, USA
Reply with quote
vgm/gd3 format & xml?
Post Posted: Fri Jul 10, 2009 5:45 am
what's the feasibility of making the gd3 of a vgm formatted in xml? currently the gd3 is a sequence of 11 strings (using 16-bit chars, each string terminated by an L'\0') and attempting to write a cross-platform solution to handling a vgm's gd3 is pissing me off to no end, mainly due to the difference in wchar implementations btwn OSes. even tho it'll probably be more work, i think it'll make gd3 more extensible and we'd be able to add per-system, per-game, and even per-song custom elements. also, this would be a possible base for a solution to cataloguing instrument presets that appear in songs for the eventual vgm-to-midi conversion i'm adding to vgmtool.

example song gd3-xml:

<?xml version="1.0" encoding="UTF-8"?>
<gd3>
  <system>
    <en>Sega Mega Drive / Genesis</en>
    <jp>セガメガドライブ</jp>
  </system>
  <game>
    <en>Zero Wing</en>
    <jp>ゼロウィング</jp>
  </game>
  <composer>
    <en>Tatsuya Uemura</en>
    <jp>上村達也</jp>
  </composer>
  <composer>
    <en>Toshiaki Tomizawa</en>
    <jp>富沢敏明</jp>
  </composer>
  <composer>
    <en>Masahiro Yuge</en>
    <jp>弓削雅稔</jp>
  </composer>
  <releasedate>1991/05/31</releasedate>
  <ripper>-DJSW-</ripper>
  <trackname>
    <en>Introduction (Part 1)</en>
  </trackname>
</gd3>


the above was just an example of a single-song gd3. there's likely improvements that can be made in places, but one of the plusses is the potential to use entities and such in text. if a proper doctype was created we could have rudimentary xml validation as well.

tell me what y'all think abt this.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14761
  • Location: London
Reply with quote
Post Posted: Fri Jul 10, 2009 10:00 am
I was thinking of doing that myself. The problem is a lack of an editor, and of course backwards compatibility. It might be good to instead use a standard format like Vorbis Comment and have standard field names, rather than the structure of XML. Vorbis Comment seems to be a concatenated set of Pascal-style strings in UTF-8.

in_vgm 2 is in active development, so now is a good time to make suggestions, especially if they make these damn tags less awful to parse. I could even perhaps allow editing in Winamp... which would give automagical mass tagging for free.
  View user's profile Send private message Visit poster's website
  • Joined: 13 Nov 2007
  • Posts: 93
  • Location: New York, NY, USA
Reply with quote
Post Posted: Sat Jul 11, 2009 6:00 am
since the gd3 would be xml, it theoretically could be a file separate from the vgm, therefore editable in any plain text editor (preferably one that supports utf-8 or utf-16).

in all seriousness, tho dude, the gd3 format as it is now is pissing me off cuz i can't come up w/a cross-platform solution to reading it and writing it for the vgmtool update. ATM the only way i can guarantee reading it as a string of 16-bit chars is to loop thru using "unsigned short" type, and even then it won't display in the console/terminal as a unicode string (i WANTED to use wchar.h and its functions, but wchar_t is 32 bits on non-windows :( ).

i'm so tempted to hold off on porting gd3 tagging & editing on the cross-platform vgmtool until AFTER i do everything else because of this :/ i'm seriously, you guys!
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14761
  • Location: London
Reply with quote
Post Posted: Sat Jul 11, 2009 8:57 am
16-bit "Unicode" is also known as UCS-2. Pass it through iconv to get your UCS-4.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!