Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Metafalica on June 21, 2018, 04:53:06 pm

Title: What's the meaning of ending bytes in each PS1 mode2 sector?
Post by: Metafalica on June 21, 2018, 04:53:06 pm
I trying to make PSX CD image repacker for own needs. I need to make it to be free from third-party repackers.
This is the structure schema that I understand from the image.
(https://s8.hostingkartinok.com/uploads/images/2018/06/d2ac120d4bb4629168dea5cfb02af1e2.png)
Other repackers changes that ending bytes when something is repacked, so I need to do the same, but I don't even know what is that and what rules applies to it.

Some real data:
(https://s8.hostingkartinok.com/uploads/images/2018/06/79a010f241f6a2d58f5d0af541a129a2.png)
Most of time it looks like something compressed, but rarely is a lot of zeros and few non zero bytes.
Title: Re: What's the meaning of ending bytes in each PS1 mode2 sector?
Post by: theflyingzamboni on June 22, 2018, 10:43:48 am
Did you try looking up the answer first? It's described on Wikipedia (https://en.wikipedia.org/wiki/CD-ROM#CD-ROM_XA_extension). The header you're referring to is actually a combination of several different things, and the mess of code at the end is for error detection and correction.

Question though: Why do you need to be free from other ISO rebuilding programs? Do they not do something you need? Programming another one seems like a lot of effort for something that's already been done, unless you just want the experience.

This one was just released: https://www.romhacking.net/utilities/1404/ (https://www.romhacking.net/utilities/1404/) (says it handles both Form 1 and Form 2)
I've used this one, and it works fine: https://www.romhacking.net/utilities/848/ (https://www.romhacking.net/utilities/848/) (though it may not handle Mode 2/Form 2 sectors, I'm not sure)
Title: Re: What's the meaning of ending bytes in each PS1 mode2 sector?
Post by: STARWIN on June 22, 2018, 08:17:07 pm
if you put everything else in its place correctly and leave these spots empty, then this program http://www.romhacking.net/utilities/1264/ will fill them for you. there's source code in there if you really want to see how.
Title: Re: What's the meaning of ending bytes in each PS1 mode2 sector?
Post by: Metafalica on June 23, 2018, 03:42:19 pm
Thanks everyone for the answers. I already solved my issue by leaving these things untouched at rebuilding. CD-burning device corrects them anyway, while emulators ignores it. So I just forget about it.