I was really excited to find out that bootgod released an XML-based version of his cartridge database. It might be a wast of time, but I started messing around with a simple application that uses bootgod's database to rename my rom images.
My first step is to figure out what elements and attributes are in the database. Since each game is unique, not all elements are used; however, usage of elements seem to be consistent. So I started writing down all the elements/attributes I could find in the form of a Document Type Definition.
Now I'm not an expert in the field of NES programming or it's architecture, so I have a few questions. I've included an example of DTD I've written so far. Although I've omitted the Attribute-List Declarations to better emphasize my questions.
My first step is to figure out what elements and attributes are in the database. Since each game is unique, not all elements are used; however, usage of elements seem to be consistent. So I started writing down all the elements/attributes I could find in the form of a Document Type Definition.
Now I'm not an expert in the field of NES programming or it's architecture, so I have a few questions. I've included an example of DTD I've written so far. Although I've omitted the Attribute-List Declarations to better emphasize my questions.
- 1) Does my example have every possible element, and are they in the correct logical order?
2) Is there any instance where the child element 'peripherals' occurs more than once?
3) Is there any instance where the child element 'cartridge' occurs more than once?
4) Same question as the last two, only this time with the child elements 'device', 'wram', 'vram', 'cic', and 'pad'.
Code:
<!DOCTYPE database [
<!ELEMENT database (game+)>
<!ELEMENT game (peripherals?, cartridge+)>
<!ELEMENT peripherals (device+)>
<!ELEMENT device EMPTY>
<!ELEMENT cartridge (board)>
<!ELEMENT board (prg+, chr*, wram?, vram?, chip*, cic?, pad?)>
<!ELEMENT prg EMPTY>
<!ELEMENT chr EMPTY>
<!ELEMENT wram EMPTY>
<!ELEMENT vram EMPTY>
<!ELEMENT chip EMPTY>
<!ELEMENT cic EMPTY>
<!ELEMENT pad EMPTY>
]>
<database>
<game>
<peripherals>
<device />
</peripherals>
<cartridge>
<board>
<prg />
<chr />
<wram />
<vram />
<chip />
<cic />
<pad />
</board>
</cartridge>
</game>
</database>
<!ELEMENT database (game+)>
<!ELEMENT game (peripherals?, cartridge+)>
<!ELEMENT peripherals (device+)>
<!ELEMENT device EMPTY>
<!ELEMENT cartridge (board)>
<!ELEMENT board (prg+, chr*, wram?, vram?, chip*, cic?, pad?)>
<!ELEMENT prg EMPTY>
<!ELEMENT chr EMPTY>
<!ELEMENT wram EMPTY>
<!ELEMENT vram EMPTY>
<!ELEMENT chip EMPTY>
<!ELEMENT cic EMPTY>
<!ELEMENT pad EMPTY>
]>
<database>
<game>
<peripherals>
<device />
</peripherals>
<cartridge>
<board>
<prg />
<chr />
<wram />
<vram />
<chip />
<cic />
<pad />
</board>
</cartridge>
</game>
</database>