Final fight CD freeze with no coredump in the end of stage 1

Issue #239 resolved
Former user created an issue

Original [issue 239](https://code.google.com/p/genplus-gx/issues/detail?id=239) created by tournier.julien on 2012-07-05T22:52:43.000Z:

The European and japanese version will stay at the "ROUND 1 CLEAR!" message instead of loading the next level. No core dump whatsoever, though.

Using euro 2.00 BIOS and euro iso Using japanese 1.00 BIOS and japanese iso under genplus-gx 1.7.0

I've attached a save state of the japanese version. The action will take place right after the boss is defeated.

Comments (15)

  1. Former user Account Deleted
    • changed status to open

    Comment # 1 originally posted by ekeeke31 on 2012-07-05T22:55:57.000Z:

    Thank you.

    I already figured this one as well, it is caused by the way CD track are "simulated", the game tried to seek a track that was out of bound and there was no check against this.

  2. Former user Account Deleted

    Comment # 3 originally posted by ekeeke31 on 2012-07-06T09:39:28.000Z:

    This one needs the real CD TOC infos and not generic simulated tracks.

    Maybe this could be provided as an extra TOC file to use when audio tracks are not there (and even when they will be there, as a validity check for cue file).

    Anyone has valid TOC infos for the 3 regions ? I got US and PAL version to pass the first level by adjusting the number of tracks and tracks length but the JP version still hangs, it seems like it has more tracks than the two others.

  3. Former user Account Deleted

    Comment # 5 originally posted by tournier.julien on 2012-07-06T10:38:02.000Z:

    I've another dump for the JP version. But this one didn't even make it to the title screen (black screen while loading). There are no .wav file with it. Just a .bin (hudge) and a .cue, but maybe the .cue might be interesting to compare.

    When you're talking about the CD TOC, are you refering to the .cue file ?

  4. Former user Account Deleted

    Comment # 6 originally posted by ekeeke31 on 2012-07-06T12:05:33.000Z:

    Might be a side effect of using bin format, the iso file i have works fine for japanese version. The data track length is currently using the full bin size (i don't handle cue info for bin files, i probably should, even when not supporting audio tracks) and then i simulate a fixed number of audio tracks of fixed length, which probably make the disc full length completely out of spec. Most games does not care about the data returned when reading TOC, they will simply assume the data i return is valid and use it when sending play/seek command but some others seem to want the real TOC to be returned.

    By TOC, i mean the exact number of tracks and their length, including pregap or postgap. This info is available when you dump your CD. Problem with cue files is that they sometime don't have the track length info (mostly those meant to be used with iso+external audio files)

  5. Former user Account Deleted

    Comment # 7 originally posted by superballena on 2012-07-06T15:40:41.000Z:

    That would explain why the Earthworm Jim rip I have in MP3 (European) does work, and the other one in BIN+CUE (American) does not.

  6. Former user Account Deleted

    Comment # 8 originally posted by tournier.julien on 2012-07-06T21:06:34.000Z:

    oops, sorry, my mistake : the game dump i use to play is a .iso + .cue, not a .bin the .iso is 24 563 712 bytes long here is the content of the .cue : CATALOG 4974365560133 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 01 of 29)[!].iso" BINARY TRACK 01 MODE1/2048 INDEX 01 00:00:00 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 02 of 29)[!].wav" WAVE TRACK 02 AUDIO PREGAP 00:02:00 INDEX 01 00:00:00 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 03 of 29)[!].wav" WAVE TRACK 03 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 04 of 29)[!].wav" WAVE TRACK 04 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 05 of 29)[!].wav" WAVE TRACK 05 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 06 of 29)[!].wav" WAVE TRACK 06 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 07 of 29)[!].wav" WAVE TRACK 07 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 08 of 29)[!].wav" WAVE TRACK 08 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 09 of 29)[!].wav" WAVE TRACK 09 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 10 of 29)[!].wav" WAVE TRACK 10 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 11 of 29)[!].wav" WAVE TRACK 11 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 12 of 29)[!].wav" WAVE TRACK 12 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 13 of 29)[!].wav" WAVE TRACK 13 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 14 of 29)[!].wav" WAVE TRACK 14 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 15 of 29)[!].wav" WAVE TRACK 15 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 16 of 29)[!].wav" WAVE TRACK 16 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 17 of 29)[!].wav" WAVE TRACK 17 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 18 of 29)[!].wav" WAVE TRACK 18 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 19 of 29)[!].wav" WAVE TRACK 19 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 20 of 29)[!].wav" WAVE TRACK 20 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 21 of 29)[!].wav" WAVE TRACK 21 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 22 of 29)[!].wav" WAVE TRACK 22 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 23 of 29)[!].wav" WAVE TRACK 23 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 24 of 29)[!].wav" WAVE TRACK 24 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 25 of 29)[!].wav" WAVE TRACK 25 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 26 of 29)[!].wav" WAVE TRACK 26 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 27 of 29)[!].wav" WAVE TRACK 27 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 28 of 29)[!].wav" WAVE TRACK 28 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74 FILE "Final Fight CD (1993)(Sega)(NTSC)(Jp)(en)(Track 29 of 29)[!].wav" WAVE TRACK 29 AUDIO INDEX 00 00:00:00 INDEX 01 00:01:74

    what is strange is that INDEX 00 and 01 have the same value for each track, where as all the .wav have a different length

  7. Former user Account Deleted

    Comment # 9 originally posted by tournier.julien on 2012-07-06T21:10:03.000Z:

    the other dump i have is a .bin + .cue + .sub but this dump don't even get to the title screen, so i can't use it the .bin is 463 800 288 byte long here is the content of the .cue :

    FILE "Final Fight CD (JAP) (DW0099).bin" BINARY TRACK 01 MODE1/2352 INDEX 01 00:00:00 TRACK 02 AUDIO INDEX 00 02:39:69 INDEX 01 02:41:69 TRACK 03 AUDIO INDEX 00 04:49:70 INDEX 01 04:51:70 TRACK 04 AUDIO INDEX 00 07:04:64 INDEX 01 07:06:64 TRACK 05 AUDIO INDEX 00 09:14:04 INDEX 01 09:16:04 TRACK 06 AUDIO INDEX 00 11:21:46 INDEX 01 11:23:46 TRACK 07 AUDIO INDEX 00 14:35:71 INDEX 01 14:37:71 TRACK 08 AUDIO INDEX 00 16:41:52 INDEX 01 16:43:52 TRACK 09 AUDIO INDEX 00 18:38:08 INDEX 01 18:40:08 TRACK 10 AUDIO INDEX 00 20:50:73 INDEX 01 20:52:73 TRACK 11 AUDIO INDEX 00 23:01:11 INDEX 01 23:03:11 TRACK 12 AUDIO INDEX 00 25:10:52 INDEX 01 25:12:52 TRACK 13 AUDIO INDEX 00 28:01:18 INDEX 01 28:03:18 TRACK 14 AUDIO INDEX 00 28:08:72 INDEX 01 28:10:72 TRACK 15 AUDIO INDEX 00 28:18:73 INDEX 01 28:20:73 TRACK 16 AUDIO INDEX 00 28:31:56 INDEX 01 28:33:56 TRACK 17 AUDIO INDEX 00 28:40:11 INDEX 01 28:42:11 TRACK 18 AUDIO INDEX 00 30:40:61 INDEX 01 30:42:61 TRACK 19 AUDIO INDEX 00 30:54:63 INDEX 01 30:56:63 TRACK 20 AUDIO INDEX 00 31:05:63 INDEX 01 31:07:63 TRACK 21 AUDIO INDEX 00 33:08:31 INDEX 01 33:10:31 TRACK 22 AUDIO INDEX 00 33:22:07 INDEX 01 33:24:07 TRACK 23 AUDIO INDEX 00 36:36:10 INDEX 01 36:38:10 TRACK 24 AUDIO INDEX 00 38:47:19 INDEX 01 38:49:19 TRACK 25 AUDIO INDEX 00 41:07:61 INDEX 01 41:09:61 TRACK 26 AUDIO INDEX 00 41:30:35 INDEX 01 41:32:35 TRACK 27 AUDIO INDEX 00 41:54:27 INDEX 01 41:56:27 TRACK 28 AUDIO INDEX 00 42:18:08 INDEX 01 42:20:08 TRACK 29 AUDIO INDEX 00 43:08:41 INDEX 01 43:10:41

  8. Former user Account Deleted

    Comment # 10 originally posted by tournier.julien on 2012-07-06T21:22:47.000Z:

    But as you said, .cue are not supported and for my second dump, time between INDEX 00 and INDEX 01 is always 00:02:00 (maybe this is not the length of the track, maybe this is the pre gap) nevertheless the length of this value is different from the one of my first dump perhaps all my dump are bad... leading to this freeze...

  9. Former user Account Deleted

    Comment # 11 originally posted by ekeeke31 on 2012-07-07T08:32:33.000Z:

    Thanks. Yes, INDEX00 is pregap, INDEX01 is where audio data actually starts.

    You can see that cue files for iso or bin dump are differents: in the first case, audio track start is not given (or more exactly is always 0 for index 00 since each tracks are separated files) and we must use file length (or coding infos in case of encoded audio files) to guess the tracks length and the absolute start index of each track within the disc. In the second case, there is only one file and the cue gives the start index of each track within that file, which represents full disc image.

    That's why using bin+cue is more accurate since we are sure about data track lengths and start indexes. Also note how pregap differs from the two cue files: sega cd disc spec requires at least 2s of silence (00's) between each tracks.

    Anyway, i'm pretty sure the issue with the bin file is that i am treating it as one big data track and then adding generic audio track in the TOC i return to the BIOS when it request infos, which lead to out of spec TOC. As i said, this game seems very sensitive to this TOC info and will lock if we don't emulate the exact CD layout.

  10. Former user Account Deleted

    Comment # 12 originally posted by ekeeke31 on 2012-07-07T16:38:40.000Z:

    Actually, Game Over and Level transition freeze are fixed by using a fixed length of 2 seconds per audio tracks. The game actually starts playing a specific track and waits for it to ends: since the default was actually 4:00:00 per track, you could indeed think it's frozen.

    The same actually happened with some other japanese game when I was debugging the last non-working game (see Issue19) so I made this now the default configuration until real audio tracks are supported, and use longer tracks only for games that need it (Snatcher, Lunar games).

  11. Former user Account Deleted

    Comment # 13 originally posted by tournier.julien on 2012-07-07T17:15:49.000Z:

    Great !!! thanks for the hard work.

  12. Former user Account Deleted

    Comment # 14 originally posted by ekeeke31 on 2012-07-09T21:00:02.000Z:

    issue \#230 has been merged into this issue.

  13. Log in to comment