PCECD: Fix end LBA when playing second-last track on disc (by track) (#415)

This commit is contained in:
David Shadoff
2021-06-26 02:16:14 -04:00
committed by GitHub
parent 77e9cb4eaa
commit 9c1e4ac3bd

View File

@@ -687,8 +687,11 @@ void pcecdd_t::CommandExec() {
{
int track = U8(comm[2]);
// Note that track (imput from PCE) starts numbering at 1
// but toc.tracks starts numbering at 0
//
if (!track) track = 1;
new_lba = (track >= toc.last) ? this->toc.end : (this->toc.tracks[track - 1].start);
new_lba = ((track-1) >= toc.last) ? this->toc.end : (this->toc.tracks[track - 1].start);
}
break;
}