MyRiivolution.xsd 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. This XSD was made with the information written in
  4. https://aerialx.github.io/rvlution.net/wiki/Patch_Format/
  5. I... won't support params or ocarina/search patches for now
  6. as I have not seen anyone using that in SMG modding
  7. -->
  8. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  9. <!-- wiidisc element -->
  10. <xs:element name="wiidisc">
  11. <xs:complexType>
  12. <!-- wiidisc childs -->
  13. <xs:sequence>
  14. <!-- id element -->
  15. <xs:element name="id" minOccurs="0">
  16. <xs:complexType>
  17. <!-- id childs -->
  18. <xs:sequence>
  19. <!-- region element -->
  20. <xs:element name="region" minOccurs="0" maxOccurs="unbounded">
  21. <xs:complexType>
  22. <!-- region attribs -->
  23. <xs:attribute name="type" use="required">
  24. <xs:simpleType>
  25. <xs:restriction base="xs:string">
  26. <!-- 1 uppercase letter to identify the region -->
  27. <xs:pattern value="[A-Z]"/>
  28. <xs:maxLength value="1"/>
  29. </xs:restriction>
  30. </xs:simpleType>
  31. </xs:attribute>
  32. </xs:complexType>
  33. </xs:element>
  34. </xs:sequence>
  35. <!-- id attribs -->
  36. <xs:attribute name="game" use="optional">
  37. <xs:simpleType>
  38. <xs:restriction base="xs:string">
  39. <!-- 3/4 letter uppercase code of the Wii game id -->
  40. <xs:pattern value="([0-9A-Z]){3,4}"/>
  41. </xs:restriction>
  42. </xs:simpleType>
  43. </xs:attribute>
  44. <xs:attribute name="developer" use="optional">
  45. <xs:simpleType>
  46. <xs:restriction base="xs:string">
  47. <!-- 2 letter uppercase code of the Wii game developer id -->
  48. <xs:pattern value="([0-9A-Z]){2}"/>
  49. </xs:restriction>
  50. </xs:simpleType>
  51. </xs:attribute>
  52. <xs:attribute name="disc" type="pos_int" use="optional"/>
  53. <xs:attribute name="version" type="pos_int" use="optional"/>
  54. </xs:complexType>
  55. </xs:element>
  56. <!-- options element -->
  57. <xs:element name="options" minOccurs="1">
  58. <xs:complexType>
  59. <!-- options childs -->
  60. <xs:sequence>
  61. <!-- section element -->
  62. <xs:element name="section" minOccurs="1" maxOccurs="unbounded">
  63. <xs:complexType>
  64. <!-- section childs -->
  65. <xs:sequence>
  66. <!-- option element -->
  67. <xs:element name="option" minOccurs="1" maxOccurs="unbounded">
  68. <xs:complexType>
  69. <!-- option childs -->
  70. <xs:sequence>
  71. <!-- choice element -->
  72. <xs:element name="choice" minOccurs="1" maxOccurs="unbounded">
  73. <xs:complexType>
  74. <!-- choice childs -->
  75. <xs:sequence>
  76. <!-- patch element -->
  77. <xs:element name="patch" minOccurs="1" maxOccurs="unbounded">
  78. <xs:complexType>
  79. <!-- patch attribs -->
  80. <xs:attribute name="id" type="xs:string" use="required"/>
  81. </xs:complexType>
  82. </xs:element>
  83. </xs:sequence>
  84. <!-- choice attribs -->
  85. <xs:attribute name="name" type="xs:string" use="required"/>
  86. </xs:complexType>
  87. </xs:element>
  88. </xs:sequence>
  89. <!-- option attribs -->
  90. <xs:attribute name="id" type="xs:string" use="optional"/>
  91. <xs:attribute name="name" type="xs:string" use="required"/>
  92. <xs:attribute name="default" use="optional">
  93. <xs:simpleType>
  94. <!-- 0 or 1 (I think) -->
  95. <xs:restriction base="pos_int">
  96. <xs:maxInclusive value="1"/>
  97. </xs:restriction>
  98. </xs:simpleType>
  99. </xs:attribute>
  100. </xs:complexType>
  101. </xs:element>
  102. </xs:sequence>
  103. <!-- section attribs -->
  104. <xs:attribute name="name" type="xs:string" use="required"/>
  105. </xs:complexType>
  106. </xs:element>
  107. </xs:sequence>
  108. </xs:complexType>
  109. </xs:element>
  110. <!-- patch element -->
  111. <xs:element name="patch" minOccurs="1" maxOccurs="unbounded">
  112. <xs:complexType>
  113. <!-- patch childs -->
  114. <xs:choice minOccurs="0" maxOccurs="unbounded">
  115. <!-- file element -->
  116. <xs:element name="file" minOccurs="0" maxOccurs="unbounded">
  117. <xs:complexType>
  118. <!-- file attribs -->
  119. <xs:attribute name="disc" type="xs:string" use="required"/>
  120. <xs:attribute name="external" type="xs:string" use="required"/>
  121. <xs:attribute name="resize" type="xs:boolean" use="optional"/>
  122. <xs:attribute name="create" type="xs:boolean" use="optional"/>
  123. <xs:attribute name="offset" type="hex_dec_int" use="optional"/>
  124. <xs:attribute name="length" type="hex_dec_int" use="optional"/>
  125. </xs:complexType>
  126. </xs:element>
  127. <!-- folder element -->
  128. <xs:element name="folder" minOccurs="0" maxOccurs="unbounded">
  129. <xs:complexType>
  130. <!-- folder attribs -->
  131. <xs:attribute name="disc" type="xs:string" use="optional"/>
  132. <xs:attribute name="external" type="xs:string" use="required"/>
  133. <xs:attribute name="resize" type="xs:boolean" use="optional"/>
  134. <xs:attribute name="create" type="xs:boolean" use="optional"/>
  135. <xs:attribute name="recursive" type="xs:boolean" use="optional"/>
  136. <xs:attribute name="length" type="hex_dec_int" use="optional"/>
  137. </xs:complexType>
  138. </xs:element>
  139. <!-- savegame element -->
  140. <xs:element name="savegame" minOccurs="0" maxOccurs="unbounded">
  141. <xs:complexType>
  142. <!-- savegame attribs -->
  143. <xs:attribute name="external" type="xs:string" use="required"/>
  144. <xs:attribute name="clone" type="xs:boolean" use="optional"/>
  145. </xs:complexType>
  146. </xs:element>
  147. <!-- memory element -->
  148. <xs:element name="memory" minOccurs="0" maxOccurs="unbounded">
  149. <xs:complexType>
  150. <!-- memory attribs -->
  151. <xs:attribute name="offset" type="hex_dec_int" use="required"/>
  152. <!-- honestly it is dumb that I cannot have a choice-like thing for attributes -->
  153. <xs:attribute name="value" type="hex_str" use="optional"/>
  154. <xs:attribute name="valuefile" type="xs:string" use="optional"/>
  155. <xs:attribute name="original" type="hex_str" use="optional"/>
  156. </xs:complexType>
  157. </xs:element>
  158. </xs:choice>
  159. <!-- patch attribs -->
  160. <xs:attribute name="id" type="xs:string" use="required"/>
  161. <xs:attribute name="root" type="xs:string" use="optional"/>
  162. </xs:complexType>
  163. </xs:element>
  164. </xs:sequence>
  165. <!-- wiidisc attributes -->
  166. <xs:attribute name="version" use="required">
  167. <xs:simpleType>
  168. <xs:restriction base="hex_dec_int">
  169. <!-- Riivolution v1 only accepts version="1" XMLs -->
  170. <xs:enumeration value="1"/>
  171. </xs:restriction>
  172. </xs:simpleType>
  173. </xs:attribute>
  174. <xs:attribute name="root" type="xs:string" use="optional"/>
  175. </xs:complexType>
  176. </xs:element>
  177. <!-- custom data types -->
  178. <!-- hex/dec integer -->
  179. <xs:simpleType name="hex_dec_int">
  180. <xs:restriction base="xs:string">
  181. <!-- match this lol -->
  182. <xs:pattern value="0x[0-9a-fA-F]+|[0-9]+"/>
  183. </xs:restriction>
  184. </xs:simpleType>
  185. <!-- positive integer -->
  186. <xs:simpleType name="pos_int">
  187. <xs:restriction base="xs:integer">
  188. <!-- major or equal to 0 -->
  189. <xs:minInclusive value="0"/>
  190. </xs:restriction>
  191. </xs:simpleType>
  192. <!-- hex string -->
  193. <xs:simpleType name="hex_str">
  194. <xs:restriction base="xs:string">
  195. <!-- match this lol -->
  196. <xs:pattern value="(0x)?([0-9a-fA-F]{2})+"/>
  197. </xs:restriction>
  198. </xs:simpleType>
  199. </xs:schema>