Hi,
I hooked the neogeo cd emulation in lr-fbalpha yesterday, and now i'm trying to get cue with a MODE1/2352 track to load (they don't in standalone either, which is sad since popular dumps like those from redump use this format), an example cue would be like this :
FILE "Last Resort (Japan) (En,Ja) (Track 01).bin" BINARY
TRACK 01 MODE1/2352
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 02).bin" BINARY
TRACK 02 AUDIO
FLAGS DCP
INDEX 00 00:00:00
INDEX 01 00:03:00
FILE "Last Resort (Japan) (En,Ja) (Track 03).bin" BINARY
TRACK 03 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 04).bin" BINARY
TRACK 04 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 05).bin" BINARY
TRACK 05 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 06).bin" BINARY
TRACK 06 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 07).bin" BINARY
TRACK 07 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 08).bin" BINARY
TRACK 08 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 09).bin" BINARY
TRACK 09 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 10).bin" BINARY
TRACK 10 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 11).bin" BINARY
TRACK 11 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 12).bin" BINARY
TRACK 12 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 13).bin" BINARY
TRACK 13 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 14).bin" BINARY
TRACK 14 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 15).bin" BINARY
TRACK 15 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 16).bin" BINARY
TRACK 16 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 17).bin" BINARY
TRACK 17 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 18).bin" BINARY
TRACK 18 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 19).bin" BINARY
TRACK 19 AUDIO
FLAGS DCP
INDEX 01 00:00:00
FILE "Last Resort (Japan) (En,Ja) (Track 20).bin" BINARY
TRACK 20 AUDIO
FLAGS DCP
INDEX 01 00:00:00
From what i understand in
https://github.com/mamedev/mame/blob/master/src/lib/util/cdrom.cpp, they are tracks with a sector size of 2336 bytes and an offset of 16 bytes, so i tried to do the following in fba's code :
struct isowavTRACK_DATA {
char Control;
int Mode;
char TrackNumber;
char Address[4];
TCHAR* Filename;
};
static int isowavGetTrackSizes()
{
// determine the lenght of the .iso / .mp3 files to complete the TOC
FILE* h;
for (int i = isowavTOC->FirstTrack - 1; i < isowavTOC->LastTrack; i++) {
const char* address;
if (isowavTOC->TrackData[i].Control & 4) {
// data track
h = _tfopen(isowavTOC->TrackData[i].Filename, _T("rb"));
if (h == NULL) return 1;
if (isowavTOC->TrackData[i].Mode == 2352) {
fseek(h, 16, SEEK_END);
address = isowavLBAToMSF((ftell(h) + 2335) / 2336 + isowavMSFToLBA(isowavTOC->TrackData[i].Address));
} else {
fseek(h, 0, SEEK_END);
address = isowavLBAToMSF((ftell(h) + 2047) / 2048 + isowavMSFToLBA(isowavTOC->TrackData[i].Address));
}
if(h) fclose(h);
} else {
// audio track
h = _tfopen(isowavTOC->TrackData[i].Filename, _T("rb"));
if (h == NULL)return 1;
fseek(h, 0, SEEK_END);
address = isowavLBAToMSF(((ftell(h) + 2047) / 2048) + isowavMSFToLBA(isowavTOC->TrackData[i].Address));
if(h) fclose(h);
}
isowavTOC->TrackData[i + 1].Address[0] += 0; // always 0 [?]
isowavTOC->TrackData[i + 1].Address[1] += address[1]; // M
isowavTOC->TrackData[i + 1].Address[2] += address[2]; // S
isowavTOC->TrackData[i + 1].Address[3] += address[3]; // F
}
return 0;
}
static int isowavParseCueFile()
{
[...]
// type of track
if ((t = LabelCheck(s, _T("MODE1/2048"))) != 0) {
isowavTOC->TrackData[track - 1].Control = 4;
isowavTOC->TrackData[track - 1].Mode = 2048;
continue;
}
if ((t = LabelCheck(s, _T("MODE1/2352"))) != 0) {
isowavTOC->TrackData[track - 1].Control = 4;
isowavTOC->TrackData[track - 1].Mode = 2352;
continue;
}
if ((t = LabelCheck(s, _T("AUDIO"))) != 0) {
isowavTOC->TrackData[track - 1].Control = 0;
continue;
}
[...]
}
Of course it doesn't work, any idea what i'm doing wrong ?
Best regards
.