ClusterM / duplifds

Open source Famicom Disk System copier
GNU General Public License v3.0
19 stars 1 forks source link

Error: Wrong Block CRC #3

Open jrz1333 opened 11 months ago

jrz1333 commented 11 months ago

So I stumbled across an issue with Yume Kojo: Doki Doki Panic. When creating a backup, all appears to be normal for a backup. Except when verifying the CRC. DupliFDS says "Success :)" but the FDSKey says Error: Wrong Block CRC for both sides of the disk. Using the disk on its own, there are no issues with loading the game. Loading the game from the FDSKey or an Everdrive N8 Pro Yields garbage data on the screen, showing a messed up Character Palette. What I thought was odd was, on Side B when DupliFDS was copying the tracks, it ended up stating that it copied 42/40 tracks.

I have tested two other disks: Famicom Tantei Club Part 1 and Castlevania 2: Simons Quest, both backed up just fine without error as well as no issues with play back. I am using a Sharp Famicom Twin, with the patch cable from J-T Studios. I wonder if there is something that could potentially be a part of Doki Doki Panic, such as a form of encryption.

I have the backed up copy that I can provide if it may prove to be helpful.

Model: Sharp Twin Famicom AN-500B DupliFDS ver 1.1-Nov 8 2023 Interim build FDSKey ver. 1.3

ClusterM commented 11 months ago

Hi! Please try non-interim version. Interim is very experimental now.

jrz1333 commented 11 months ago

Testing with the non-interim version this morning, DupliFDS will read and write 9/16 tracks. Upon trying to read any tracks after that, I only get ERR:CRC MISMATCH and cannot proceed further with Doki Doki Panic. Famicom Tantei Club and Castlevania 2 both back up fine with the non-interim version.

ClusterM commented 11 months ago

Weird. I'll test app on this game.

flinn078 commented 10 months ago

I have the same problem, I used to have a doki doki panic disk, but it is damaged. Now I have a new disk and try to write over the game, but this gives an error.

flinn078 commented 10 months ago

Its also the crc-mismatch error btw

jrz1333 commented 10 months ago

@flinn078 what did you use to attempt to back up your game? Did you use a Twin Famicom as well or was it the stand alone disk system and RAM adapter?

flinn078 commented 10 months ago

@jrz1333 i used the Disk system and ram adapter on the hvc-001 1983 edition of the Famicom

jrz1333 commented 10 months ago

Thank you, I wanted to see if it was isolated to one model or all models. That eliminates having to get a different model for testing and (for the most part) eliminates hardware as the failure.

jrz1333 commented 10 months ago

So I did some testing (albeit might not be useful testing), ended up finding a repo of FDS images that had Doki Doki Panic in it. I did an image to image copy via DuplifDS, everything copies as normal and even plays as it should.

When looking up Doki Doki Panic, it seems there is a DRM built in to keep it from being copied correctly. Which would explain why Side A doesn't completely copy and Side B over copies. The question is, how can this DRM be defeated or at least be satisfied in the case of a back up? How was it done previously? In the case of the interim build, the game copies completely (still over copies 44/42 files from Side B) and does play, albeit the palette is all screwed up.

Unfortunately I don't know 6502 assembly, otherwise I'd be able to provide more information. I can at least provide examples of Copy Protection for Doki Doki Panic.

Source: https://tcrf.net/Yume_Koujou:_Doki_Doki_Panic/en Source: https://forums.nesdev.org/viewtopic.php?t=18777

flinn078 commented 10 months ago

@jrz1333 I have tested with a few copies of my FDS games that also have anti-pirecy, these can be copied as usual, could it be that the Doki Doki ROM is damaged?

jrz1333 commented 10 months ago

@flinn078 What games did you copy that had anti-piracy on them and how were you able to determine if the games had anti-piracy measures in place?

flinn078 commented 10 months ago

I tested it with Deep Dungeon Yushi no Monsho and it worked :) I saw a video on YouTube in which famicom games with anti-pirecy were tested to see if this was really the case. I also saw that the anti-piracy of doki doki panic is on disc side b and on disc side a it already gave the error.

https://www.youtube.com/watch?v=oXx88tLBFO0&ab_channel=ponyponyex

flinn078 commented 10 months ago

@jrz1333 > So I did some testing (albeit might not be useful testing), ended up finding a repo of FDS images that had Doki Doki Panic in it. I did an image to image copy via DuplifDS, everything copies as normal and even plays as it should.

It may be a bit of an unpleasant question, but where do you have this repo because if it works then I can possibly make the disk work again via here since I already have the game but the data is damaged then it is not illegal

flinn078 commented 10 months ago

I just tested it and with donkey kong and vs exitebike it also gives this error

flinn078 commented 10 months ago

I tested it with the automatic interim version and donkey kong works but doki doki panic gives the error bad memory block 3

flinn078 commented 10 months ago

17057543717185250838808209622624

ClusterM commented 10 months ago

I have no time to fix everything now :( Too many work. I'll try to check everything soon.

jrz1333 commented 10 months ago

@ClusterM sorry for flooding your inbox with notifications… I figured you were busy, just wanted to see if there was anything I could do to maybe help as far as providing as much testing as possible. 😬

@flinn078 im so sorry, I got busy for a little bit. I did end up finding that link again. It’s on Archive.org, I did test Yume Kojo myself from this specific group with no issue. The game even read and wrote as it should to a new “disk”.

Link: https://ia802806.us.archive.org/view_archive.php?archive=/26/items/FamicomDiskSystem201808/ROMS.zip

Let me know if it doesn’t work for you.

flinn078 commented 10 months ago

@jrz1333 so i tested it and its not working :(. When i copy it to a virtual disk on the fdskey it works but when i coppy it to a physical disk it wont work and i tested it with multiple disks

jrz1333 commented 10 months ago

@flinn078 have you done the write mod to your FDS Drive?

flinn078 commented 10 months ago

@jrz1333 no but other games work just fine when i wrote them with my fdskey

flinn078 commented 7 months ago

@jrz1333 I have a big problem, my sister wanted to play with my famicom disk system, which was allowed as long as she was careful. she played ice hockey and when she was done she put this game on my old CRT😬 now the game no longer works and I hadn't made a backup yet. I thought I might be able to use a backup from the internet, but all ice hockey ROMs give a CRC error when writing on the disk . Its noy the fds drive because it can write other games. Does anyone have a backup of ice hockey that I can use? because I have the game myself it is not illegal so it is possible. I hope I can find a backup here because this is my last hope😬 17121657520036128082711787664463 17121657750318031554700604309879

flinn078 commented 7 months ago

@ClusterM @jrz1333 So i did some testing and i came to the conclusion that every time the screen goes black in DupliFDS It will give in the end the "wrong block crc error". what actualy weird is is that when writing to a virtual diskm (New virtual disk on fdskey) it doesnt give the wrong block crc error and it will boot up. i tested it with multiple discs and came to the conclusion that with the interiem version its somtimes says "succes" but when booting it gives an error and with the normal version after the screen goes black it gives also the wrong block crc error. however the problem isn't in DupliFDS but most likely the roms becouse it doesnt work with other disk copieers as well. now the question is, how is it posible that running a fds rom on a emulator,fdskey or fdsstick works but writing it to a Diskcard doesnt work. and the next question is how where gonna fix these ''broken'' roms.

I hope this will help you with your project ClusterM :)

PS: sorry for my bad english haha im dyslectic :)

jrz1333 commented 7 months ago

Alright, so I did some more testing on my own. I got in a bulk order of FDS games as well as an HVC-022 Famicom Disk System and the RAM adapter HVC-023. The FDS was bad and needed to be rebuilt with a new belt as well as it had other issues. But all have been fixed to my knowledge. I have also noted that this drive has power board number 4, which does have the copy protection circuit. I have since done the mod from Famicom World to bypass that. That will be relevant later in this comment.

What I have found with this system is a few things: first, the drive motor (realistically the whole drive) is touchy. Meaning I was getting a lot of Err. 21, Err. 22 and Err. 27. The two things that I read that fixed this issue was resetting the spindle in the center per Famicom World and FamicomDiskSystem.com, as well as setting the drive motor potentiometer (you should NOT have to do this, but this drive needed just a bit of adjustment where as my Twin FC didn’t need it).

New test environment: Twin Famicom, RAM adapter in cart slot, HVC-022. Using DupliFDS 1.1, the interim build update for February seems to kind of force CRC checks to succeed, although the FDSKey erases the bad/forced CRC checked data.

Disks tested: Golf(FMC-GLF), Famicom Tantei Club Part 2 Disk 1(FMC-TC3), Lutter(ATH-LTD) and Tobidase Daisuksen(SQF-TDS). Golf and FTC both copied fine, no issues. Lutter gave a little bit of trouble on side B with a “CRC mismatch” error once, but retrying allowed it to copy and not have a bad CRC.

Tobidase Daisakusen on the other hand, had issues. In the bulk shipment of FDS games, I received two copies of this game. The one I tried copied side A just fine, side B however would get to block 13 of 18 and just give a “CRC mismatch “ error. Would not budge. The second copy, no problem. To rule out things, I also tested the Twin Famicom on its own and tried copy there, same outcome. I also tried to adjust the drive motor when receiving this error, same outcome.

I did, however, decide to write the side B data from the good disk onto the side B of the bad disk. The thought was if there was a bad sector on the disk, it would not write the data back to the disk. But the data wrote back to the disk without issue, cleared the CRC as well. Even decided to read back the whole disk just to confirm data was written and was accurate on the disk that was bad, did not error out once. So it seems that there may be a case of corrupted data on these disks, whether it’s just age, bad write from save data, magnetism exposure, just things that are bad for floppy disks. This is merely an assumption though. I have yet to find a disk that is bad per-se in the sense of mold or damaged disks.

With that being said, I didn’t have a way to be able to force the data from the bad disk to be written so we could compare the info within a hex-editor with the good disk. I also don’t see any place where I can see the file structure of the disk itself, so I don’t know if the data pertains to some form of save data, copywrite protection (unlikely), or if it was just a corrupted block. I have been doing some thinking, and maybe this is more of a general, low priority but would come in handy feature request, but if there was a way to import the tools from Disk Hacker to see diagnostic data on the drive itself and/or hex data of the rom itself (in a dumped format, if the file can’t be backed up properly) or at least some way to see the particular area of the rom where it’s failing the CRC check in hex.

If this is helpful to you at all, then I’m glad to be of help and to provide at least some test data. If it’s not, disregard and seemingly this could be closed as this is more just, testing anyways. This is still a very useful tool and appreciate all the effort and time you’ve put into this. At the very least, I can preserve the games I have that DupliFDS plays nicely with.

flinn078 commented 7 months ago

Nice work, but why are the roms working on the fdskey but not on a physical disk?

jrz1333 commented 6 months ago

@flinn078 The only thing I can think of is it's a form of DRM that gets written to the disk when a "save" or some form of data is written like a high score. I was able to re-write my Yume Kojo Doki Doki Panic disk no problem with a known good ROM from Archive. I lost the save data (wasn't mine to begin with so I wasn't worried about losing it), but the disk still acts as normal, as well as reads and writes back as normal.

What I can suggest is taking a look at the disk itself and seeing if there's any issues with the disk itself such as any damage to the mylar disk (pitting, scratches, mold). Otherwise, search out a known good ROM and re-write your disk with the standard release (Version 1.1), not the interim. The interim release seems to skip any CRC checks while reading the data and only checks at the end as far as I can tell. If you are having troubles re-writing your disks and your disk is in good physical condition, you may need to perform the write protect mod shown in the link. https://famicomworld.com/workshop/tech/fds-power-board-modifications/

There are different versions to the disk system, so there are different modifications necessary.

At this point, this issue can be closed. All testing has been done and can confirm that the issue I was having was data related. Have not been able to fully determine specifically what data, but it's not DupliFDS related, it was game related.

jrz1333 commented 6 months ago

@flinn078 Additionally, with your error 27 you were getting, you may have to adjust the drive motor screw. I will say, it's very sensitive so the smallest adjustment will make a big difference. There's no set procedure on how to set the drive motor, so you'll have to make small adjustments and re-test.

flinn078 commented 4 months ago

@jrz1333 i changed the writer speed and its still giving the error, it can write games but when the DupliFDS says the screen is black it gives an error. its weird because i can write something some games on it like buble boble but when i try a game like doki doki panic from archive.org it gives me an error in duplifds