NES模拟器开发资料

[复制链接]
 楼主| gaoyang9992006 发表于 2023-1-23 15:27 | 显示全部楼层 |阅读模式
本帖最后由 gaoyang9992006 于 2023-1-24 19:40 编辑

NES文件格式说明文件https://www.nesdev.org/neshdr20.txt
  1. [iNES Header/Format Information File]
  2. [Version 2.0 Compiled on 1/31/98]
  3. [VmprHntrD - kennedy5@flash.net]


  4. NOTE: This document is on the iNES format is almost totally complete.  I still
  5. need to add some little tidbits as the iNES format is updated.  Please do not
  6. modify this document in any way without MY prior consent.  If you wish to add
  7. to this please talk to me through e-mail, or in the evenings on the IRC -
  8. EFnet, in the channel #emu.  [I'm an OP in there.] :P

  9. BE ADVISED: Any emails sent to me about ROM requests will be ignored and most
  10. likely forwarded to the SPA at piracy@spa.org.  You get one warning and this
  11. is it, sorry to be harsh but I have to.  ...Am I a nice guy or what?

  12. <"In"Famous Quotes:>
  13. "Power TENDS to corrupt; Absolute power corrupts absolutely." - I forget :)
  14. "Escape is impossible and obedience is imperative!" - Cmdr. Yurak from Voltron
  15. "I'm surrounded by fools and imbusiles!" - King Zarkon from Voltron

  16. <Personal thanks goes to:>
  17. * Zophar for help with some math and errors.
  18. * FanWen for the greater extension of the iNES Extended Header format and all
  19.   the associated work along with it.
  20. * Groups like Damaged Cybernetics, GitM, NPS, Vertigo 2099 and more that have
  21.   in one way or the other brought us the games this guide pertains to.
  22. * Anyone who has ever e-mailed and/or talked to me in IRC that assisted in the
  23.   fixes and upkeep of this guide.
  24. * And thanks to all the loyal readers that actually care about this document
  25.   and what I have to say here.


  26. [Table of Contents]___________________________________________________________

  27. Section 1 .... Known HEXidecimal Values of the First 8 Bytes of the NES Header
  28. Section 2 ................... The Seventh and Eighth Bytes' HEXidecimal Values
  29. Section 3 ........... Common iNES File Sizes & What They Are Made Of (PRG/CHR)
  30. Section 4 .................................. HEXidecimal Values of the PRG/CHR
  31. Section 5 ........................ Miscellaneous Information on the NES Format
  32. Section 6 ......... Let's Get Cracking on Prepping Your RAW/FFE/PasoFami Image
  33. Section 7 ......... Information (Recommended Tools for Converting iNES Images)
  34. Section 8 ...... UPDATES (The History of the iNES Header/Format Documentation)


  35. [Sect.1: - Known HEXidecimal Values of the First 8 Bytes of the NES Header]___

  36. ...Those FIRST (8) bytes of your NES, or to be a NES file...

  37. (Bytes 0->3 MUST BE What is stated below.)

  38. 0 = 4E (N)
  39. 1 = 45 (E)
  40. 2 = 53 (S)
  41. 3 = 1A (Character Break, necessary!)

  42. (Bytes 4->8-15 Can BE MODIFIED!)

  43. 4 = PRG (Hex number depends on size of PRG file)-/-- (See Sect. 4)
  44. 5 = CHR (Hex number depends on size of CHR file)/
  45. 6 = Mapper 0-15/ V or H Mirroring, Battery, 4 Screen VRAM, Trainer Switches
  46.     Also is used as the "Ones" place holder digit for the extended iNES Header
  47.     format. (See Sect. 2)
  48. 7 = Mappers 16-?, the extended iNES Header format "Tens" place holder digit.
  49.     Again (See Sect. 2 for details on how this is set up.)

  50. 8->15 = Not used at this tume but MUST BE ALL ZEROS or games will not work.

  51. NOTE: Now that there is a fully established Extened iNES Header Format set up
  52.       gracefully by FanWen and Marat Fayzullin ALWAYS leave in games that do
  53.       not use over mapper 15 blank in bytes 8->15 or games WILL NOT WORK!

  54. [Sect.2: - The Seventh and Eighth Bytes' HEXidecimal Values]__________________

  55. Byte 6 in a hexeditor will look something like this:

  56.         59 <---This is for CastleVania III: Dracula's Curse

  57. (The "5" is the mapper number, the "9" stands for Vertical Mirroring AND 4
  58. Screen VRAM ON!) -- See below for all the possible values!

  59. Byte 7 in a hexeditor will look a little different, something like this:

  60.         * 1->F/0<---Only the first part is used in coorilation with the first
  61.                     part of byte 6 above. *READ BELOW FOR EXAMPLE!*

  62. *Extended iNES Header Format Design*

  63. Basically in this extended design the 7th byte is used to implement mappers of
  64. 16 and higher.  It does this through a hexidecimal conversion of the actual
  65. mapper number.  In my example I'll use Mapper 69 with a vertical switch(1).

  66. Example: Mapper 69 = 4E in hexidecimal...

  67. Therefore in the new iNES Extended Header format this is how bytes 6 and 7
  68. would look in hex and work together.

  69. Example:
  70. Bytes=> 0       1       2       3       4       5       6       7
  71.         N       E       S       ^Z      PRG     CHR     MAP/SW  MAP/0(always)
  72.         4E      45      53      1A      10      20      E1      40

  73. * See above that the ONES DIGIT (E) is in the 6th byte, and the TENS DIGIT (4)
  74.   is the first half of the 7th byte.  But be advised that the second half of
  75.   the 7th byte in hex HAS TO ALWAYS BE 0 (zero)!

  76. *AND NOW FOR THE BAD NEWS FOR "YOU"*

  77. Considering iNES has always set the standard for "Mapper Compatibility" we are
  78. now faced with a new problem ...CONVERSION.  We must convert the current games
  79. we have to the new format which is very TIME CONSUMING because of the iNES
  80. Header Editors out there that insert extra garbage into the header.  Therefore
  81. let's get to FIXING YOUR GAMES for the new "Extended iNES Header Format":

  82. * First get out your hexeditor and move over to the eighth byte.  For example
  83.   lets use the NESimage tag of: "DiskDude!"
  84. * On the 7th byte it will be covered by the "D", to make your game a "clean"
  85.   image you must on the hexidecimal side put a double zero "00" through bytes
  86.   7-15, then save it.
  87. * Be very careful doing so, if you hit the first byte of the game, its DEAD if
  88.   you aren't paying attention and save it...you've been warned.
  89. * If you can find a program on the internet called "NESFIX.EXE" this will do
  90.   all the tasks above in a fraction of the time of doing it manually.  Ask
  91.   around a few people will be able to get it to you.


  92. [Below is the current possibilities for the all the supported mappers]

  93. NOTE: The format for this graph is taken from the iNES 0.7 doc to give you a
  94.       better example of what each mapper is and runs...  I would personally
  95.       like to thank Marat Fayzullin, Yang FanWen, Y0SHi, and anybody else I
  96.       left out that assisted in the adding of these new MAPPERS!


  97. Mapper #  Name                    Examples (Game Names, etc.)
  98. ______________________________________________________________________________

  99. 0         No Mapper               All 32kb ROM + 8kb VROM games like Super
  100.                                   Mario Bros, Balloon Fight, Slalom, etc.
  101. 1(fixed)  Nintendo MMC1 Chipset   1942, Bomberman II, Mega Man II, etc.
  102. 2         ROM (PRG) Switch        Konami games like CastleVania and Stinger.
  103. 3         VROM (CHR) Switch       Twin Bee, Q*Bert, and many japanese games.
  104. 4(fixed)  Nintendo MMC3 Chipset   Super Mario Bros 2 & 3, Silver Surfer, etc.
  105. 5(100%!)  Nintendo MMC5 Chipset   CastleVania III: Dracula's Curse
  106. 6         FFE F4XXX Games         F4XXX Games off the FFE CD-ROM
  107. 7         32kb ROM (PRG) Switch   Wizards & Warriors, Marble Madness, etc.
  108. 8         FFE F3XXX Games         F3XXX Games off the FFE CD-ROM
  109. 9         Nintendo MMC2 Chipset   Mike Tyson's Punch-Out!!, and Punch-Out!!
  110. 10        Nintendo MMC4 Chipset   Japanese Punch-Out!!, and japanese games.
  111. 11        Color Dreams Chipset    Crystal Mines, Tagin' Dragon, Babyboom, etc.
  112. 12        FFE F6XXX Games         F6XXX Games off the FFE CD-ROM
  113. 15        100-in-1 Cart Switch    100-in-1 Multicart Switch

  114. Below are all the Extened iNES Header Format Mappers which are now, or will be
  115. in the near future added into another emulator yet to be publicly released.
  116. * Read above in Section 2 on how to implement Mappers 16 and up in iNES.

  117. 16        Ban Dai Chipset         Japanese: Dragon Ball Z, Gaiden etc.
  118. 17        FFE F8XXX Games         F8XXX Games off the FFE CD-ROM
  119. 18        Jaleco SS8806 Chipset   Japanese: Jaleco's Sport Series
  120. 19        Namcot 106 Chipset      Japanese: Famista 90-92, Megami Teisen 1-2
  121. 20        Famicom Disk System     Reserved for the Disk System, DON'T USE IT!
  122. 21        Konami VRC4 2a Chipset  Japanese: Wai Wai World2, Goemon Gaiden 2
  123. 22        Konami VRC4 1b Chipset  Japanese: Twinbee 3, etc.
  124. 23        Konami VRC4 1a Chipset  Japanese: Wai Wai World, Kid Dracula, etc.
  125. 24        Konami VRC6 Chipset     Japanese: CastleVania 3j, MADAKAJ, etc.
  126. 25        Konami VRC4 Chipset     Japanese: Konami Baseball, Gradius 2, etc.
  127. 32        Irem G-101 Chipset      Japanese: Image Fighter 2, etc.
  128. 33        Taito TC0190/TC0350     Japanese: PonDoKoPon, Bubble Bobble 2j, etc.
  129. 34        32kb ROM (PRG) Switch   Japanese: Impossible Mission, Deadly Towers
  130. 65        Irem H3001 Chipset      Japanese: Mr. Love, Mr. Big Hammer, P-Man2
  131. 66        74161/32 Chipset        Japanese: Dragonball 1, BioWarrior DAN
  132. 67        Sunsoft Mapper 3        Japanese: Unknown
  133. 69        Sunsoft Mapper 4        Japanese: Afterburner 2
  134. 70        74161/32 Chipset        Japanese: Unknown variant
  135. 80        X-005 Chipset           Japanese: Demon Sword
  136. 81        C075 Chipset            Japanese: Unknown
  137. 82        X1-17 Chipset           Japanese: Unknown
  138. 83        Cony Mapper             Japanese: Garbo Dentsu
  139. 84        PasoFami Mapper!        Japanese: (.500 .MOD) Supported      


  140. [Below is the current possibilities for the second figure of the 7th byte.]

  141. This part of the byte is the place you setup the game to use, or not use
  142. Horizontal or Vertical mirroring, Battery Backup, 4 Screen VRAM, and a built
  143. in Trainer.  Below are the different combinations of all the listed options
  144. in HEXidecimal format.

  145. 0 = H (Horizontal Mirroring ONLY)
  146. 1 = V (Vertical Mirroring ONLY)
  147. 2 = H + Bat. (Horizontal Mirroring + Battery ON)
  148. 3 = V + Bat. (Vertical Mirroring + Battery ON)
  149. 4 = H + Train. (Horizontal Mirroring + Trainer ON)
  150. 5 = V + Train. (Vertical Mirroring + Trainer ON)
  151. 6 = H + Bat. + Train. (Horizontal Mirroring + Battery and Trainer ON)
  152. 7 = V + Bat. + Train. (Vertical Mirroring + Battery and Trainer ON)
  153. 8 = H + 4scr. (Horizontal Mirroring + 4 Screen VRAM ON)
  154. 9 = V + 4scr. (Vertical Mirroring + 4 Screen VRAM ON)
  155. A = H + Bat. + 4scr. (Horizontal Mirroring + Battery and 4 Screen VRAM ON)
  156. B = V + Bat. + 4scr. (Vertical Mirroring + Battery and 4 Screen VRAM ON)
  157. C = H + 4scr. + Train. (Horizontal Mirroring + 4 Screen VRAM and Trainer ON)
  158. D = V + 4scr. + Train. (Vertical Mirroring + 4 Screen VRAM and Trainer ON)
  159. E = H + Bat. + 4scr. + Train. (Horizontal Mirroring + Battery, 4 Screen VRAM,
  160.     and Trainer ON)
  161. F = V + Bat. + 4scr. + Train. (Vertical Mirroring + Battery, 4 Screen VRAM,
  162.     and Trainer ON)


  163. [Sect. 3: - Common iNES File Sizes & What They Are Made of (PRG/CHR)]_________

  164. These are the "known" formats TO ME for the iNES format NES Players!  Be
  165. advised that "ROM" and "VROM" were the names of the chips that the "PRG" and
  166. "CHR" data were stored on.  [ROM = PRG   VROM = CHR]

  167. [24K - 24576 bytes]
  168. (EX: Donkey Kong - 131Kbit ROM + 65Kbit VROM)

  169. PRG => 16384 bytes (1 x 16kb pages)
  170. CHR => 8192 bytes (1 x 8kb pages)


  171. [40K - 40960 bytes]
  172. (EX: Super Mario Bros. - 262Kbit ROM + 65Kbit VROM)

  173. PRG => 32768 bytes (2 x 16kb pages)
  174. CHR => 8192 bytes (1 x 8kb pages)


  175. [48K - 49152 bytes]
  176. (EX: Twin-Bee - 262Kbit ROM + 131Kbit VROM)

  177. PRG => 32768 bytes (2 x 16kb pages)
  178. CHR => 16384 bytes (2 x 8kb pages)


  179. [64K - 65536 bytes]
  180. (EX: Spy Hunter - 262Kbit ROM + 262Kbit VROM)

  181. PRG => 32768 bytes (2 x 16kb pages)
  182. CHR => 32768 bytes (4 x 8kb pages)


  183. [80K - 81936 bytes]
  184. (EX: Dragon Warrior - 512 Kbit ROM + 131Kbit VROM)

  185. PRG => 65532 bytes (4 x 16kb pages)
  186. CHR => 16384 bytes (2 x 8kb pages)


  187. [128K - 131088 bytes]
  188. (EX: Legend of Zelda - 1MBit ROM)

  189. PRG => 131088 bytes (8 x 16kb pages)
  190. CHR => (NONE - "imbedded")


  191. [132K - 139280 bytes]
  192. (EX: Stinger (Twin Bee 2 USA - 1MBit ROM + 65Kbit "imbedded" VROM)

  193. PRG => 131088 bytes (8 x 18kb pages)
  194. CHR => (8192 bytes ="imbedded")


  195. [160K - 163840 bytes]
  196. (EX: Mappy Land: 1MBit ROM + 262Kbit VROM)

  197. PRG => 131088 bytes (8 x 18kb pages)
  198. CHR => 32768 bytes (4 x 8kb pages)


  199. [192K - 196608 bytes]
  200. (EX: CastleVania II: Simon's Quest - 1MBit ROM + 512Kbit VROM)

  201. PRG => 131072 bytes (8 x 16kb pages)
  202. CHR => 65536 bytes (8 x 8kb pages)


  203. [192K - 196608 bytes]
  204. (EX: Wall Street Kid - 1MBit ROM + 512Kbit "imbedded" VROM)

  205. PRG => 131072 bytes (8 x 16kb pages)
  206. CHR => (65536 bytes - "imbedded")


  207. [224K - 229392 bytes]
  208. (EX: Mad Max - 1MBit ROM + 785Kbit VROM]

  209. PRG => 131072 bytes (8 x 16kb pages)
  210. CHR => 98304 bytes (12 x 8kb pages)


  211. [232K - 237584 bytes]
  212. (EX: Tetris 2 - 1MBit ROM + 851Kbit VROM)

  213. PRG => 131072 bytes (8 x 16kb pages)
  214. CHR => 106496 bytes (13 x 8kb pages)


  215. [240K = 245760 bytes]
  216. (EX: Legend of Zelda 2 - 1MBit ROM + 917Kbit VROM)

  217. PRG => 131072 bytes (8 x 16kb pages)
  218. CHR => 114688 bytes (14 x 8kb pages)


  219. [248K - 253468 bytes]
  220. (EX: Super Contra - 1Mbit ROM + 925Kbit VROM)

  221. PRG => 131072 bytes (8 x 16kb pages)
  222. CHR => 122880 bytes (15 x 8kb pages)


  223. [256K - 262144 bytes]
  224. (EX: Final Fantasy - 2MBit ROM)

  225. PRG => 262144 bytes (16 x 16kb pages)
  226. CHR => (NONE - "imbedded")


  227. [256K - 262144 bytes]
  228. (EX: Super Mario Bros. 2 - 1MBit ROM + 1MBbit VROM)

  229. PRG => 131072 bytes (8 x 16kb pages)
  230. CHR => 131072 bytes (16 x 8kb pages)


  231. [312K - 319488 bytes]
  232. (EX: Bo Jackson Baseball - 1MBit ROM + 1458Kbit VROM)

  233. PRG => 131072 bytes (8 x 16kb pages)
  234. CHR => 188416 bytes (23 x 8kb pages)


  235. [336K - 344064 bytes]
  236. (EX: Spiderman and the Sinister Six - 1MBit ROM + 2048Kbit VROM)

  237. PRG => 131072 bytes (8 x 16kb pages)
  238. CHR => 212992 bytes (26 x 8kb pages)


  239. [384K - 393216 bytes]
  240. (EX: Ikari Warriors 2 - 2MBit ROM + 1MBit "imbedded" VROM)

  241. PRG => 262144 bytes (16 x 16kb pages)
  242. CHR => (131072 bytes - "imbedded")


  243. [384K - 393216 bytes]
  244. (EX: Super Mario Bros. 3 - 2MBit ROM + 1MBit VROM)

  245. PRG => 262144 bytes (16 x 16kb pages)
  246. CHR => 131072 bytes (16 x 8kb pages)


  247. [384K - 393216 bytes]
  248. (EX: Gremlins 2: the New Batch = 1 MBit ROM + 2MBit VROM)

  249. PRG => 131072 bytes (8 x 16kb pages)
  250. CHR => 262144 bytes (32 x 8kb pages)


  251. [512K - 524288 bytes]
  252. (EX: CastleVania III: Dracula's Curse - 2MBit ROM + 2MBit VROM)

  253. PRG => 262144 bytes (16 x 16kb pages)
  254. CHR => 262144 bytes (32 x 8kb pages)


  255. [768K - 786432 bytes] - 1st and ONLY 6MBit NES GAME!
  256. (EX: Kirby's Adventure - 4MBit ROM + 2MBit VROM)

  257. PRG => 524288 bytes (32 x 16kb pages)
  258. CHR => 262144 bytes (32 x 8kb pages)


  259. [1024K - 1048576 bytes]
  260. (EX: Forget Name (Japanese) - 4MBit ROM + 4MBit VROM)

  261. PRG => 524288 bytes (32 x 16kb pages)
  262. CHR => 524288 bytes (64 x 8kb pages)


  263. [1024K - 1048576 bytes]
  264. (EX: 100-in-1 illegal cart - 8Mbit ROM)

  265. PRG => 1048576 bytes (64 x 16kb pages)
  266. CHR => (NONE - "imbedded")


  267. * NOTE: 8MBit (Megabit) is equal to 1 MB (Megabyte).  As far as I know from
  268.         reading NES technical data the 8MBit/1MB game is the largest game size
  269.         supported by the NES as of when it was discontinued in Summer 1994
  270.         with its final game Wario's Woods in the United States.


  271. [Sect. 4: - HEXidecimal Values of the PRG/CHR]________________________________

  272. [PRG - (Range 1 x 16kb pages -> 64 x 16kb pages)]
  273. -There is a BARE MINIMUM required for PRG which is 1 x 16kb pages!

  274. * NOTE: To figure out the exact size in bytes each of these pages are worth
  275.         just start at 1 x 16kb pages (aka: 16384 bytes) and just keep adding
  276.         16384 more for each "page" higher.

  277. (1 x 16kb pages)  = 01     (2 x 16kb pages)  = 02     (3 x 16kb pages)  = 03
  278. (4 x 16kb pages)  = 04     (5 x 16kb pages)  = 05     (6 x 16kb pages)  = 06
  279. (7 x 16kb pages)  = 07     (8 x 16kb pages)  = 08     (9 x 16kb pages)  = 09
  280. (10 x 16kb pages) = 0A     (11 x 16kb pages) = 0B     (12 x 16kb pages) = 0C
  281. (13 x 16kb pages) = 0D     (14 x 16kb pages) = 0E     (15 x 16kb pages) = 0F
  282. (16 x 16kb pages) = 10     (17 x 16kb pages) = 11     (18 x 16kb pages) = 12
  283. (19 x 16kb pages) = 13     (20 x 16kb pages) = 14     (21 x 16kb pages) = 15
  284. (22 x 16kb pages) = 16     (23 x 16kb pages) = 17     (24 x 16kb pages) = 18
  285. (25 x 16kb pages) = 19     (26 x 16kb pages) = 1A     (27 x 16kb pages) = 1B
  286. (28 x 16kb pages) = 1C     (29 x 16kb pages) = 1D     (30 x 16kb pages) = 1E
  287. (31 x 16kb pages) = 1F     (32 x 16kb pages) = 20     (33 x 16kb pages) = 21
  288. (34 x 16kb pages) = 22     (35 x 16kb pages) = 23     (36 x 16kb pages) = 24
  289. (37 x 16kb pages) = 25     (38 x 16kb pages) = 26     (39 x 16kb pages) = 27
  290. (40 x 16kb pages) = 28     (41 x 16kb pages) = 29     (42 x 16kb pages) = 2A
  291. (43 x 16kb pages) = 2B     (44 x 16kb pages) = 2C     (45 x 16kb pages) = 2D
  292. (46 x 16kb pages) = 2E     (47 x 16kb pages) = 2F     (48 x 16kb pages) = 30
  293. (49 x 16kb pages) = 31     (50 x 16kb pages) = 32     (51 x 16kb pages) = 33
  294. (52 x 16kb pages) = 34     (53 x 16kb pages) = 35     (54 x 16kb pages) = 36
  295. (55 x 16kb pages) = 37     (56 x 16kb pages) = 38     (57 x 16kb pages) = 39
  296. (58 x 16kb pages) = 3A     (59 x 16kb pages) = 3B     (60 x 16kb pages) = 3C
  297. (61 x 16kb pages) = 3D     (62 x 16kb pages) = 3E     (63 x 16kb pages) = 3F
  298. (64 x 16kb pages) = 40

  299. ** SPECIAL NOTICE ** There is now DUAL MMC1 Chipset handling avaliable which
  300. pushes the total PRG banking up to 32kb pages via 2 16kb pages PRG chips.

  301. This was quite a feat performed with the work of imid, EFX, star69, and Marat
  302. Fayzullin to get it to run, and because of this DRAGON WARRIOR III, and other
  303. "like" games now work!  This game for instance uses a 32kb banking mode
  304. between two MMC1 chips, and to make them work together they communicate with
  305. each other on the "4th" byte of the game image(not including the iNES header.)


  306. [CHR - (Range 1 x 8kb pages -> 64 x 8kb pages)]
  307. -There is NO MINIMUM required for CHR data because some games have the CHR
  308. data imbedded into the PRG info.

  309. * NOTE: To figure out the exact size in bytes each of these pages are worth
  310.         just start at 1 x 8kb pages (aka: 8192 bytes) and just keep adding
  311.         8192 bytes more for each "page" higher.

  312. (1 x 8kb pages)  = 01       (2 x 8kb pages)  = 02       (3 x 8kb pages)  = 03
  313. (4 x 8kb pages)  = 04       (5 x 8kb pages)  = 05       (6 x 8kb pages)  = 06
  314. (7 x 8kb pages)  = 07       (8 x 8kb pages)  = 08       (9 x 8kb pages)  = 09
  315. (10 x 8kb pages) = 0A       (11 x 8kb pages) = 0B       (12 x 8kb pages) = 0C
  316. (13 x 8kb pages) = 0D       (14 x 8kb pages) = 0E       (15 x 8kb pages) = 0F
  317. (16 x 8kb pages) = 10       (17 x 8kb pages) = 11       (18 x 8kb pages) = 12
  318. (19 x 8kb pages) = 13       (20 x 8kb pages) = 14       (21 x 8kb pages) = 15
  319. (22 x 8kb pages) = 16       (23 x 8kb pages) = 17       (24 x 8kb pages) = 18
  320. (25 x 8kb pages) = 19       (26 x 8kb pages) = 1A       (27 x 8kb pages) = 1B
  321. (28 x 8kb pages) = 1C       (29 x 8kb pages) = 1D       (30 x 8kb pages) = 1E
  322. (31 x 8kb pages) = 1F       (32 x 8kb pages) = 20       (33 x 8kb pages) = 21
  323. (34 x 8kb pages) = 22       (35 x 8kb pages) = 23       (36 x 8kb pages) = 24
  324. (37 x 8kb pages) = 25       (38 x 8kb pages) = 26       (39 x 8kb pages) = 27
  325. (40 x 8kb pages) = 28       (41 x 8kb pages) = 29       (42 x 8kb pages) = 2A
  326. (43 x 8kb pages) = 2B       (44 x 8kb pages) = 2C       (45 x 8kb pages) = 2D
  327. (46 x 8kb pages) = 2E       (47 x 8kb pages) = 2F       (48 x 8kb pages) = 30
  328. (49 x 8kb pages) = 31       (50 x 8kb pages) = 32       (51 x 8kb pages) = 33
  329. (52 x 8kb pages) = 34       (53 x 8kb pages) = 35       (54 x 8kb pages) = 36
  330. (55 x 8kb pages) = 37       (56 x 8kb pages) = 38       (57 x 8kb pages) = 39
  331. (58 x 8kb pages) = 3A       (59 x 8kb pages) = 3B       (60 x 8kb pages) = 3C
  332. (61 x 8kb pages) = 3D       (62 x 8kb pages) = 3E       (63 x 8kb pages) = 3F
  333. (64 x 8kb pages) = 40


  334. [Sect. 5: - Miscellaneous Information on the NES Format]______________________

  335. * The End of the CART.NES file ...the Title]
  336.   If you wish you can add a title to your NES ROM and below shows you how to
  337.   do that manually, and the size limits for that title.

  338.   1) First at the very end of the ROM you will eventually ADD 128 bytes to the
  339.      ROM.  But first, which is part of this 128 bytes, is the addition of the
  340.      NES Title.  Starting at the first added byte type in the name normally in
  341.      the character part of the hexeditor.

  342.   2) Next, to finish this is successfully, go over to the HEXidecimal part of
  343.      the HEXeditor and add in double zeros (00) until you have added in a
  344.      a TOTAL OF 128 BYTES (which includes the the Title you added yourself.)
  345.      (So subtract the total bytes of the title from 128 so you do it right.)

  346.   3) If you did it right you now have successfully added a title to your NES
  347.      ROM and it will show in the title bar in the ROM checkers like NESImage.


  348. [Sect. 6: - Let's Get Cracking on Prepping Your RAW/FFE/PasoFami Image]_______

  349. * "RAW" Image Conversion to iNES

  350.   1) For starters check and see if that RAW NES rom image you got is or is not
  351.      interleaved.  (See #3 if it's interleaved.)

  352.   2) Great!  It's not interleaved so what you need to do is to just add 16
  353.      bytes onto the beginning of this ROM image.  Then just add the standard
  354.      NES header to the ROM as stated in Section 1, and then toy around with
  355.      the mappers until you can or can't get the game to work or do something.

  356.   3) Crap, it's interleaved, don't worry it's fixable.  What you need to do is
  357.      to write or find a program that will UN-interleave your ROM.  This is the
  358.      process of seperating all the even and odd bytes.  The even bytes are the
  359.      ROM (or PRG) data, and the odd bytes are the VROM (or CHR) data if that
  360.      exists.

  361.   4) Next, in MS-DOS, re-join the PRG and CHR data in the proper order. (Which
  362.      is PRG data before CHR data.)  First take the split ROM and VROM files and
  363.      name them something like PARODIUS.PRG(ROM) and PARODIUS.CHR(VROM)...
  364.      (Parodius is a japanese side shooter game I'm using for this description.)

  365.   5) Now type: copy /B PARODIUS.PRG+PARODIUS.CHR PARODIUS.NES
  366.      (This is a BINARY copy mode in DOS which will glue the two files together
  367.      where the PRG ends and the CHR begins.)

  368.   6) Now do as it says in Step #2 and just add the 16byte header to the top of
  369.      the NES rom, and then add the NES header as stated in Section 1.


  370. * "FFE" Image Conversion to iNES

  371.   1) To start check and see if the rom is in a standard file format as shown
  372.      in Section 3.  If it isn't check to see if it is 512 bytes larger than
  373.      normal.  If so, this is most likely a FFE header.

  374.   2) To remove this get into your HEXidecimal editor and just have it delete
  375.      the first 512 bytes from your NES rom.

  376.   3) Then just add a 16byte header to the top of the NES rom, and then add the
  377.      NES header as stated in Section 1.


  378. NOTE: If this rom ends up being interleaved as well just follow the guidelines
  379.       set above in the RAW rom format section for UN-interleaving a ROM.

  380. BE ADVISED that Some NES roms maybe seem to be 512 or 1024 bytes larger than
  381. normal.  This is because it either has a trainer, or a combination of a
  382. trainer and a FFE header.  My best advice to you is that if its a trainer
  383. leave it, if its a FFE header remove it.  If the rom is 1024 bytes its a combo
  384. of both, just remove the first 512 bytes and you'll be ok.


  385. * "PasoFami (*.PRG/*.CHR -ONLY-)" Image Conversion

  386.   1) Start by deleting that annoying PRM file.  This file is used by the
  387.      PasoFami emulator just as the 16byte header that iNES uses.

  388.   2) Next is the easy part, a simple binary copy (again I'll use Parodius as
  389.      the example.)  Type: copy /B PARODIUS.PRG+PARODIUS.CHR PARODIUS.NES
  390.      (This is a BINARY copy mode in DOS which will glue the two files together
  391.      where the PRG ends and the CHR begins.)

  392.   3) Now do as it says in Step #2 in the RAW section and just add the 16byte
  393.      header to the top of the NES rom, and then add the NES header.

  394. NOTE: Some PasoFami images such as Super Mario Bros. 2 for example are in the
  395.       Famicom Disk System format (EX: SMB2J.DKA) and can't be converted.  When
  396.       they can be, I'll add that info here.


  397. [Sect. 7: - Information (Recommended Tools for Converting iNES Images)]_______

  398. * RECOMMENDED TOOLS FOR USE IN THE ABOVE SECTIONS:

  399. HEXeditor - (ie: Norton Diskedit or Bedit) -I use bedit, it's tiny with lots
  400. of commands, and very efficient.

  401. READCHAR.EXE - This tool shows you the PRG and CHR data in a RAW, FFE,
  402. PasoFami, and NES file.  With this you can determine the correct sizes of the
  403. yet to be determined PRG and CHR pages.  Also if you notice that things are
  404. out of order (in a PRG, CHR, PRG, etc) format this will show you that the game
  405. is most likely interleaved.

  406. UNLACE.EXE - This tool is something I had custom made for me.  What this does
  407. is uninterleaves NES roms from the RAW, FFE (removes the trainer by use of
  408. command), and iNES format.  What that means is that it splits up to rom and
  409. puts all the PRG data in one file called (ROM) and all the CHR data in a file
  410. called (VROM).  And as my manual says above you just got to binary copy them
  411. back into one file ROM+VROM = NES rom.  Then add the iNES header and you just
  412. tinker with it until it works, that's if its supported yet.

  413. Also to save time, I do recommend the use of DiskDude's NESimage from version
  414. 3.30+ because it can show you in its menu all the PRG and CHR sizes, as well
  415. as all the other options avaliable to you.  This is just for people that don't
  416. want to hexedit their rom and just want to get it working right away...
  417. impacient aren't you? :)

  418. NESFIX.EXE - If you do use a crummy editor like DiskDude's NES Image remember
  419. to clean out bytes 8->15 so games will work in Exteneded iNES Header format
  420. compatible emulators.  To do this find and use NESFIX, and just run it like
  421. so... NESFIX CART.NES and it will clean out the extra data.  Not only that
  422. this will save time in that it takes a fraction of the time to do it one by
  423. one manually.

  424. And finally I recommend you have a NES emulator that is as far along in
  425. development, or farther, than iNES, and a few smaller sized games to study
  426. with in conjunction with my text.


  427. [Sect. 8: - UPDATES (The History of the iNES Header/Format Documentation)]____

  428. * UPDATE INFORMATION:

  429. [2.0] - Wow v2.0! "SHOW ME THE MUSHROOM!" - Toad McGuire  ...More mappers! =)

  430. - In Sections 1-8 I reformatted some text and removed useless info.
  431. - In Section 1 added a snipit on what byte 7 does in conjunction with byte 6
  432.   and explained that 7 = Tens digit and 6 = ones digit for the 16+ mappers.
  433.   And fixed the chart so that 0 is the beginning digit, not 1.  Stupid error.
  434. - In Section 2 I added a notice about NESFIX so people can easily repair there
  435.   polluted headers so they will work in Extened iNES Header format players.
  436. - Added in Section 2 the all important further extension to the Extended iNES
  437.   Header format created by FanWen.  Mappers 66-70 80-84 are now added, and a
  438.   rename to the Konami VRC 2 1a and 1b to VRC 1b and 1a.
  439. - Reformatted the CHR and PRG cart size lists to fit into 1 screen in Section
  440.   2 as well.
  441. - And in Section 7 I added the recommended tool of NESFIX.EXE to remove that
  442.   nasty garbage out of iNES headers.
  443. - More BS errors in grammar and spelling fixed again.  Common occurance is it
  444.   not? >:)  Maybe I need to buy Hookt awn Fawniks and Lurn too Reed. =)
  445. - In this Section 8 it got to damned big so now I'm limiting the list to the
  446.   three most current revisions for now on.  (Like anyone really looks back to
  447.   read that stuff anyways, the important stuff is above.)

  448. [1.9] - *SMB Fanfare please..doo doo doo, dee doo, doo, doo ..iNES 0.7 is out!

  449. - Added to Section 1 notice of basically where the new Extended iNES format is
  450.   layed out and called from, and an "I TODL YOU SO NOTICE." >:]
  451. - Added to Section 2 a new MAPPER chart for all the new iNES mappers that are
  452.   in iNES v0.7.
  453. - Added to Section 2 the explanation and example of how the new iNES Extended
  454.   Header format works and is used.
  455. - Added to Section 2 new MAPPER chart notice that the MMC5 chipset is now
  456.   emulated 100%, I checked CastleVania III and it ran perfectly!  Also the
  457.   MAPPERs 1 and 4 work near 100% now, the bugs are fixed!
  458. - Added to Section 2 new MAPPER chart notice that the MMC1 and MMC3 chipset
  459.   emulation has been bugfixed, therefore more games run that didn't before.
  460. - Added to Section 2 Instructions on how to "clean" up games that won't work
  461.   in the new "Extended iNES v0.7 Format" because some people felt it smart to
  462.   litter the games with there name, etc. into the header, thanks jerkoffs.
  463. - Added to Section 3 for "Stinger aka: Twin Bee 2", yet another cart size.
  464. - Added to Section 3 a little more info to the cart sizes with imbedded CHR.
  465. - Added to Section 4 sketchy info on why Dragon Warrior III and other 32kb
  466.   banking mode games are now playable in iNES v0.7 format.
  467. - Changed out two quotes, added two more appropriate ones.
  468. - Fixed a few text errors again, sorry I usually type this late at night.

  469. [1.8] - A new attitude... Another addition/fix again!  Screw iNES NESticle me!

  470. - Added to Section 1 a warning about filling up the 8th through 16th byte in
  471.   an iNES compatible ROM set.
  472. - Added to Section 2 NEW Mapper info which is that Mapper 7 and the long
  473.   awaited Mapper 9(MMC2 chip for Punch-Out!! is now functional.
  474. - Added and rewrote Section 2's working mappers list for the latest players.
  475. - Added to Section 3 a few new cart sizes so look up Dragon Warrior, Tetris 2,
  476.   and Mad Max.
  477. - Fixed this list to no longer support iNES, now all compatibility for all the
  478.   latest players is dated. (IE: June 12, 1997)
  479. - A small personal thanks section at the top of the list.
  480. - Again I have fixed a few grammatical/spelling errors, yah I know not again.

  481. [End Of File]  -Enjoy!

工程项目参考下载地址
https://github.com/jay-kumogata/InfoNES  
https://github.com/Woody00h/InfoNES
InfoNES-master (1).zip (4.45 MB, 下载次数: 4)

https://blog.csdn.net/zerokkqq/article/details/52964249

https://www.cnblogs.com/chzarles/articles/15826933.html

NES_on_STM32-master.zip

10.26 MB, 下载次数: 4

个人签名:如果你觉得我的分享或者答复还可以,请给我点赞,谢谢。

2045

主题

16350

帖子

222

粉丝
个人签名:如果你觉得我的分享或者答复还可以,请给我点赞,谢谢。

2045

主题

16350

帖子

222

粉丝
快速回复 在线客服 返回列表 返回顶部