Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gdrom classifications dont belong in cdrom.h or cdrom.cpp
- Loading branch information
1 parent
e79599f
commit 38a7fd7
Showing
7 changed files
with
96 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
#include "chd.h" | ||
#include "chdcd.h" | ||
#include "corefile.h" | ||
#include "gdrom.h" | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// license:BSD-3-Clause | ||
/*************************************************************************** | ||
gdrom.cpp | ||
GDROM routines | ||
***************************************************************************/ | ||
|
||
|
||
#include "cdrom.h" | ||
#include "gdrom.h" | ||
|
||
|
||
/*--------------------------------------------------------------------------------------- | ||
gdrom_identify_pattern - Dreamcast has well-known standardised GDROM patterns | ||
----------------------------------------------------------------------------------------*/ | ||
|
||
/** | ||
* Dreamcast GDROM patterns are identified by track types and number of tracks | ||
* | ||
* Pattern I - (SD) DATA + AUDIO, (HD) DATA | ||
* Pattern II - (SD) DATA + AUDIO, (HD) DATA + ... + AUDIO | ||
* Pattern III - (SD) DATA + AUDIO, (HD) DATA + ... + DATA | ||
* | ||
* And a III variant when two HD DATA tracks are split by one or more AUDIO tracks. | ||
*/ | ||
|
||
enum gdrom_pattern gdrom_identify_pattern(const cdrom_toc *toc) | ||
{ | ||
if (toc->numtrks > 4 && toc->tracks[toc->numtrks-1].trktype == CD_TRACK_MODE1_RAW) | ||
{ | ||
if (toc->tracks[toc->numtrks-2].trktype == CD_TRACK_AUDIO) | ||
return GDROM_TYPE_III_SPLIT; | ||
else | ||
return GDROM_TYPE_III; | ||
} | ||
else if (toc->numtrks > 3) | ||
{ | ||
if (toc->tracks[toc->numtrks-1].trktype == CD_TRACK_AUDIO) | ||
return GDROM_TYPE_II; | ||
else | ||
return GDROM_TYPE_III; | ||
} | ||
else if (toc->numtrks == 3) | ||
{ | ||
return GDROM_TYPE_I; | ||
} | ||
|
||
return GDROM_TYPE_UNKNOWN; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// license:BSD-3-Clause | ||
/*************************************************************************** | ||
gdrom.h | ||
Definitions used in GDROM routines | ||
***************************************************************************/ | ||
|
||
#ifndef MAME_UTIL_GDROM_H | ||
#define MAME_UTIL_GDROM_H | ||
|
||
#pragma once | ||
|
||
/*************************************************************************** | ||
CONSTANTS | ||
***************************************************************************/ | ||
|
||
enum gdrom_area | ||
{ | ||
GDROM_SINGLE_DENSITY = 0, | ||
GDROM_HIGH_DENSITY | ||
}; | ||
|
||
enum gdrom_pattern | ||
{ | ||
GDROM_TYPE_UNKNOWN = 0, | ||
GDROM_TYPE_I, | ||
GDROM_TYPE_II, | ||
GDROM_TYPE_III, | ||
GDROM_TYPE_III_SPLIT | ||
}; | ||
|
||
/*************************************************************************** | ||
FUNCTION PROTOTYPES | ||
***************************************************************************/ | ||
|
||
/* GDROM utilities */ | ||
enum gdrom_pattern gdrom_identify_pattern(const cdrom_toc *toc); | ||
|
||
#endif // MAME_UTIL_GDROM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters