Description

ECCRegen is a tool for regenerating the EDC and ECC fields of CD-ROM sectors. It is designed to work only on Playstation CD-ROMs which use a format called mode 2 form 1 (but from version 1.4 it diels also with mode 2 form 2 and mode 1). In a mode 2 form 1 CD-ROM there is one data track and eventually some sound tracks. All the datas stored in the CD-ROM are packed in sectors 2352 bytes long:

Sector diagram

This is the dump of a sector, colors are the same as the diagram above:

00000000h: 00 FF FF FF FF FF FF FF FF FF FF 00 00 02 29 02 ; .          ...).
00000010h: 00 00 08 00 00 00 08 00 00 00 00 00 04 4A 00 08 ; .............J..
00000020h: 02 00 10 36 03 00 10 36 12 00 22 92 06 00 23 86 ; ...6...6.."..#
00000030h: 02 00 40 14 21 01 62 28 01 01 62 28 02 00 40 14 ; ..@.!.b(..b(..@.
00000040h: 00 00 00 00 24 00 10 36 02 80 02 3C CC AD 42 8C ; ....$..6..21 10 80 00 21 10 00 00 10 00 A3 97 16 00 A2 A7 ; !..!.......
00000800h: 3F 00 62 30 06 00 40 14 80 30 08 00 14 00 A2 97 ; ?.b0..@.0....
00000810h: 00 00 00 00 3F 00 42 30 15 91 96 8E 7C D6 F6 CB ; ....?.B0.|-
00000820h: 3C 5E 05 E1 1A DD 2D 34 33 DC F7 9F 61 0B E2 16 ; <^..-43_a..
00000830h: 87 BA 5C 44 2E 7E 88 2C 8A D3 72 76 C6 58 C6 41 ; \D.~,rvXA
[...]
00000910h: 8C 0D 11 FF 42 AE 09 D1 FB 6B D9 81 89 BE F3 B8 ; .. B.йk+륾
00000920h: 6E 4F 04 97 0A 73 5A 4F 26 76 B9 05 1E 4F 35 ED ; nO..sZO&v..O5

With EDC (Error Detecting Code) we can discover reading errors in the DATA field and with ECC (Error Correcting Code) we can rebuild corrected datas.

If you buy a Playstation PAL game you can't play it on your NTSC TV (well, actually you can, but it isn't a good looking) so you have to patch it, in order to see it correctly on NTSC systems. To do this you can use generic PAL/NTSC patcher. This tools first scan the image file of the CD-ROM looking for particular sequences of codes that set the video mode and then change them. After that you can burn your CD-ROM and play it on a NTSC TV (or on a PAL one if the game was NTSC). One of the most famous generic PAL/NTSC patcher is Pal4U 2000 and you can know more and download it at this site: www.pal4u2000.com.

Unfortunately there are a very few CD writers that during the burning process correct the DATA filed of every patched sector instead of regenerate EDC and ECC. The firmaware of CD writer detect a modified sector by reading EDC and then rebuild it using the ECC code.
One of such a CD writer is TEAC CD-R55S: with it you can't burn patched Playstation CD-ROM. If you know about other CD writers that don't regenerate EDC/ECC during the burn process please write me.

Finally I have decoded subheader field. It is a collage from various sources and, since I haven't found a complete description of the subject on the net I publish it here. I hope you will find it usefull.

Mode 2 Subheader structure:

Subheader field