ucon64_defines.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. /*
  2. ucon64_defines.h - definitions for uCON64
  3. Copyright (c) 2002 - 2005 NoisyB
  4. Copyright (c) 2002 - 2005 dbjh
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. #ifndef UCON64_DEFINES_H
  18. #define UCON64_DEFINES_H
  19. // Please make sure that NO definition except FALSE has 0 as value!
  20. #if (!defined TRUE || !defined FALSE)
  21. #define FALSE 0
  22. #define TRUE (!FALSE)
  23. #endif
  24. #if (!defined MIN || !defined MAX)
  25. #define MIN(a,b) ((a) < (b) ? (a) : (b))
  26. #define MAX(a,b) ((a) > (b) ? (a) : (b))
  27. #endif
  28. #ifndef LIB_VERSION
  29. #define LIB_VERSION(ver, rel, seq) (((ver) << 16) | ((rel) << 8) | (seq))
  30. #endif
  31. #define NULL_TO_EMPTY(str) ((str) ? (str) : (""))
  32. //#define RANDOM(min, max) ((rand () % (max - min)) + min)
  33. #define OFFSET(a, offset) ((((unsigned char *) &(a)) + (offset))[0])
  34. #define UCON64_UNKNOWN (-1)
  35. #define UCON64_UNKNOWN_S "Unknown"
  36. #define NULL_TO_UNKNOWN_S(str) ((str) ? (str) : (UCON64_UNKNOWN_S))
  37. #define UCON64_VERSION_S "2.0.2"
  38. /* program version counter */
  39. //#define UCON64_VERSION 202
  40. /* version of config file layout */
  41. #define UCON64_CONFIG_VERSION 208
  42. #define MBIT 131072
  43. #define TOMBIT(x) ((int)(x) / MBIT)
  44. #define TOMBIT_F(x) ((float)(x) / MBIT)
  45. #define MAXROMSIZE (512 * MBIT)
  46. #ifndef MAXBUFSIZE
  47. #define MAXBUFSIZE 32768
  48. #endif // MAXBUFSIZE
  49. // maximum number of arguments uCON64 takes from the cmdline
  50. #define UCON64_MAX_ARGS 512
  51. #define UCON64_OPTION 1000
  52. #define UCON64_CONSOLE 0
  53. // options (consoles)
  54. enum
  55. {
  56. UCON64_3DO = UCON64_CONSOLE + 1,
  57. UCON64_ATA,
  58. UCON64_CD32,
  59. UCON64_CDI,
  60. UCON64_COLECO,
  61. UCON64_DC,
  62. UCON64_GB,
  63. UCON64_GBA,
  64. UCON64_GC,
  65. UCON64_GEN,
  66. UCON64_GP32,
  67. UCON64_INTELLI,
  68. UCON64_JAG,
  69. UCON64_LYNX,
  70. UCON64_ARCADE,
  71. UCON64_N64,
  72. UCON64_NDS,
  73. UCON64_NES,
  74. UCON64_NG,
  75. UCON64_NGP,
  76. UCON64_PCE,
  77. UCON64_PS2,
  78. UCON64_PSX,
  79. UCON64_S16,
  80. UCON64_SAT,
  81. UCON64_SMS,
  82. // don't mix the following with UCON64_GG (Game Genie), used only for --mgdgg
  83. UCON64_GAMEGEAR,
  84. UCON64_SNES,
  85. UCON64_SWAN,
  86. UCON64_VBOY,
  87. UCON64_VEC,
  88. UCON64_XBOX
  89. };
  90. // option strings (consoles)
  91. #define UCON64_3DO_S "3do"
  92. #define UCON64_ATA_S "ata"
  93. #define UCON64_CD32_S "cd32"
  94. #define UCON64_CDI_S "cdi"
  95. #define UCON64_COLECO_S "coleco"
  96. #define UCON64_DC_S "dc"
  97. #define UCON64_GB_S "gb"
  98. #define UCON64_GBA_S "gba"
  99. #define UCON64_GC_S "gc"
  100. #define UCON64_GEN_S "gen"
  101. #define UCON64_GP32_S "gp32"
  102. #define UCON64_INTELLI_S "intelli"
  103. #define UCON64_JAG_S "jag"
  104. #define UCON64_LYNX_S "lynx"
  105. #define UCON64_ARCADE_S "arcade"
  106. #define UCON64_N64_S "n64"
  107. #define UCON64_NDS_S "nds"
  108. #define UCON64_NES_S "nes"
  109. #define UCON64_NG_S "ng"
  110. #define UCON64_NGP_S "ngp"
  111. #define UCON64_PCE_S "pce"
  112. #define UCON64_PS2_S "ps2"
  113. #define UCON64_PSX_S "psx"
  114. #define UCON64_S16_S "s16"
  115. #define UCON64_SAT_S "sat"
  116. #define UCON64_SMS_S "sms"
  117. #define UCON64_GAMEGEAR_S "gg"
  118. #define UCON64_SNES_S "snes"
  119. #define UCON64_SWAN_S "swan"
  120. #define UCON64_VBOY_S "vboy"
  121. #define UCON64_VEC_S "vec"
  122. #define UCON64_XBOX_S "xbox"
  123. // the other options
  124. enum
  125. {
  126. UCON64_1991 = UCON64_OPTION + 1,
  127. UCON64_A,
  128. UCON64_B,
  129. UCON64_B0,
  130. UCON64_B1,
  131. UCON64_BAT,
  132. UCON64_BIN,
  133. UCON64_BIOS,
  134. UCON64_BOT,
  135. UCON64_BS,
  136. UCON64_C,
  137. UCON64_CHK,
  138. UCON64_CODE,
  139. UCON64_COL,
  140. UCON64_CRC,
  141. UCON64_CRCHD,
  142. UCON64_CRP,
  143. UCON64_CS,
  144. UCON64_CTRL,
  145. UCON64_CTRL2,
  146. UCON64_CMNT,
  147. UCON64_DB,
  148. UCON64_DBS,
  149. UCON64_DBUH,
  150. UCON64_DBV,
  151. UCON64_DFIND,
  152. UCON64_DFINDR,
  153. UCON64_DINT,
  154. UCON64_DMIRR,
  155. UCON64_DNSRT,
  156. UCON64_DUAL,
  157. UCON64_DUMPINFO,
  158. UCON64_E,
  159. UCON64_EROM,
  160. UCON64_F,
  161. UCON64_FDS,
  162. UCON64_FDSL,
  163. UCON64_FFE,
  164. UCON64_FIG,
  165. UCON64_FIGS,
  166. UCON64_FILE,
  167. UCON64_FIND,
  168. UCON64_FINDI,
  169. UCON64_FINDR,
  170. UCON64_FRONTEND,
  171. UCON64_GBX,
  172. UCON64_GD3,
  173. UCON64_GD3S,
  174. UCON64_GG,
  175. UCON64_GGD,
  176. UCON64_GGE,
  177. UCON64_HD,
  178. UCON64_HDN,
  179. UCON64_HELP,
  180. UCON64_HEX,
  181. UCON64_HFIND,
  182. UCON64_HFINDR,
  183. UCON64_HI,
  184. UCON64_I,
  185. UCON64_ID,
  186. UCON64_IDNUM,
  187. UCON64_IDPPF,
  188. UCON64_INES,
  189. UCON64_INESHD,
  190. UCON64_INS,
  191. UCON64_INSN,
  192. UCON64_INT,
  193. UCON64_INT2,
  194. UCON64_ISPAD,
  195. UCON64_J,
  196. UCON64_K,
  197. UCON64_L,
  198. UCON64_LNX,
  199. UCON64_LOGO,
  200. UCON64_LS,
  201. UCON64_LSD,
  202. UCON64_LSRAM,
  203. UCON64_LSV,
  204. UCON64_LYX,
  205. UCON64_MAPR,
  206. UCON64_MD5,
  207. UCON64_MGD,
  208. UCON64_MGDGG,
  209. UCON64_MGH,
  210. UCON64_MIRR,
  211. UCON64_MKA,
  212. UCON64_MKDAT,
  213. UCON64_MKI,
  214. UCON64_MKIP,
  215. UCON64_MKPPF,
  216. UCON64_MKSRM,
  217. UCON64_MSG,
  218. UCON64_MULTI,
  219. // UCON64_MVS,
  220. UCON64_N,
  221. UCON64_N2,
  222. UCON64_N2GB,
  223. UCON64_NA,
  224. UCON64_NBAK,
  225. UCON64_NBAT,
  226. UCON64_NBS,
  227. UCON64_NCOL,
  228. UCON64_NHD,
  229. UCON64_NHI,
  230. UCON64_NINT,
  231. UCON64_NPPF,
  232. UCON64_NROT,
  233. UCON64_NS,
  234. UCON64_NSWP,
  235. UCON64_NTSC,
  236. UCON64_NVRAM,
  237. UCON64_O,
  238. UCON64_P,
  239. UCON64_PAD,
  240. UCON64_PADHD,
  241. UCON64_PADN,
  242. UCON64_PAL,
  243. UCON64_PARSE,
  244. UCON64_PASOFAMI,
  245. UCON64_PATCH,
  246. UCON64_PATTERN,
  247. UCON64_POKE,
  248. UCON64_PORT,
  249. UCON64_PPF,
  250. UCON64_PRINT,
  251. UCON64_Q,
  252. UCON64_QQ, // already reserved ;-)
  253. UCON64_R83,
  254. UCON64_RDAT,
  255. UCON64_R,
  256. UCON64_REGION,
  257. UCON64_RJOLIET,
  258. UCON64_RROM,
  259. UCON64_RL,
  260. UCON64_ROM,
  261. UCON64_ROTL,
  262. UCON64_ROTR,
  263. UCON64_RU,
  264. UCON64_S,
  265. UCON64_SAM,
  266. UCON64_SC,
  267. UCON64_SCAN,
  268. UCON64_SCR,
  269. UCON64_SGB,
  270. UCON64_SHA1,
  271. UCON64_SMC,
  272. UCON64_SMD,
  273. UCON64_SMDS,
  274. UCON64_SRAM,
  275. UCON64_SSC,
  276. UCON64_SSIZE,
  277. UCON64_STP,
  278. UCON64_STPN,
  279. UCON64_STRIP,
  280. UCON64_SWAP,
  281. UCON64_SWAP2,
  282. UCON64_SWC,
  283. UCON64_SWCS,
  284. UCON64_SWP,
  285. UCON64_TEST,
  286. UCON64_UFO,
  287. UCON64_UFOS,
  288. UCON64_UNIF,
  289. UCON64_UNSCR,
  290. UCON64_USMS,
  291. UCON64_V,
  292. UCON64_V64,
  293. UCON64_VER,
  294. UCON64_VMS,
  295. UCON64_VRAM,
  296. UCON64_XCD64,
  297. UCON64_XCD64B,
  298. UCON64_XCD64C,
  299. UCON64_XCD64E,
  300. UCON64_XCD64F,
  301. UCON64_XCD64M,
  302. UCON64_XCD64P,
  303. UCON64_XCD64S,
  304. UCON64_XCMC,
  305. UCON64_XCMCM,
  306. UCON64_XCMCT,
  307. UCON64_XDEX,
  308. UCON64_XDJR,
  309. UCON64_XF2A,
  310. UCON64_XF2AB,
  311. UCON64_XF2AC,
  312. UCON64_XF2AMULTI,
  313. UCON64_XF2AS,
  314. UCON64_XFAL,
  315. UCON64_XFALB,
  316. UCON64_XFALC,
  317. UCON64_XFALMULTI,
  318. UCON64_XFALS,
  319. UCON64_XFALM, // actually only necessary for the Windows
  320. UCON64_XFIG, // ports, but might be useful for others too
  321. UCON64_XFIGS,
  322. UCON64_XFIGC,
  323. UCON64_XGBX,
  324. UCON64_XGBXB,
  325. UCON64_XGBXS,
  326. UCON64_XGBXM,
  327. UCON64_XGD3,
  328. UCON64_XGD3R,
  329. UCON64_XGD3S,
  330. UCON64_XGD6,
  331. UCON64_XGD6R,
  332. UCON64_XGD6S,
  333. UCON64_XGG,
  334. UCON64_XGGB,
  335. UCON64_XGGS,
  336. UCON64_XLIT,
  337. UCON64_XMCCL,
  338. UCON64_XMCD,
  339. UCON64_XMD,
  340. UCON64_XMDB,
  341. UCON64_XMDS,
  342. UCON64_XMSG,
  343. UCON64_XPCE,
  344. UCON64_XPL,
  345. UCON64_XPLI,
  346. UCON64_XPLM,
  347. UCON64_XQD16,
  348. UCON64_XRESET,
  349. UCON64_XSF,
  350. UCON64_XSFS,
  351. UCON64_XSMC,
  352. UCON64_XSMCR,
  353. UCON64_XSMD,
  354. UCON64_XSMDS,
  355. UCON64_XSWC,
  356. UCON64_XSWC2,
  357. UCON64_XSWC_IO,
  358. UCON64_XSWCR,
  359. UCON64_XSWCS,
  360. UCON64_XSWCC,
  361. UCON64_XV64,
  362. UCON64_Z64,
  363. // UCON64_FORCE63,
  364. UCON64_GUI,
  365. // Keep these (libdiscmage) options separate
  366. UCON64_DISC = UCON64_OPTION + 250,
  367. UCON64_MKCUE,
  368. UCON64_MKSHEET,
  369. UCON64_MKTOC,
  370. UCON64_RIP,
  371. UCON64_BIN2ISO,
  372. UCON64_ISOFIX,
  373. UCON64_XCDRW,
  374. UCON64_CDMAGE
  375. };
  376. /*
  377. uCON64 workflow flags
  378. WF_PROBE probe for console type
  379. WF_INIT init ROM info (ucon64_init()) necessary
  380. w/o this flag WF_NFO will be ignored
  381. WF_NFO show info output before processing rom
  382. WF_NO_ROM for this option no ROM is required
  383. WF_NO_CRC32 no CRC32 calculation necessary for this option; this
  384. overrides even WF_INIT and WF_NFO
  385. WF_STOP a "stop" option:
  386. - -multi (and -xfalmulti) takes more than one file as
  387. argument, but should be executed only once.
  388. - stop after sending one ROM to a copier ("multizip")
  389. - stop after applying a patch so that the patch file won't
  390. be interpreted as ROM
  391. WF_PAR this option requires a parallel port
  392. WF_USB this option requires a USB port
  393. WF_SERIAL this option requires a serial port
  394. WF_NO_SPLIT this option does not work with split ROMs
  395. WF_DEFAULT same as WF_INIT | WF_PROBE | WF_NFO
  396. */
  397. #define WF_PROBE (1)
  398. #define WF_INIT (1 << 1)
  399. #define WF_NFO (1 << 2)
  400. #define WF_STOP (1 << 3)
  401. #define WF_NO_ROM (1 << 5)
  402. //#define WF_PAR (1 << 6)
  403. //#define WF_USB (1 << 7)
  404. //#define WF_SERIAL (1 << 8)
  405. #define WF_NO_CRC32 (1 << 9)
  406. #define WF_NO_SPLIT (1 << 10)
  407. #define WF_SWITCH (1 << 11)
  408. #define WF_NO_ARCHIVE (1 << 12)
  409. #define WF_DEFAULT (WF_PROBE | WF_INIT | WF_NFO)
  410. #endif // UCON64_DEFINES_H