Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
beetle-saturn-libretro
Commits
5de4db03
Commit
5de4db03
authored
Aug 14, 2016
by
Libretro-Admin
Browse files
(CDROM) Update
parent
b894df52
Changes
2
Hide whitespace changes
Inline
Side-by-side
mednafen/cdrom/CDAccess_Image.cpp
View file @
5de4db03
...
...
@@ -356,6 +356,7 @@ bool CDAccess_Image::LoadSBI(const std::string& sbi_path)
memcpy
(
SubQReplaceMap
[
aba
].
data
(),
tmpq
,
12
);
}
log_cb
(
RETRO_LOG_INFO
,
"Loaded Q subchannel replacements for %zu sectors.
\n
"
,
SubQReplaceMap
.
size
());
return
true
;
}
...
...
@@ -501,7 +502,7 @@ bool CDAccess_Image::ImageOpen(const std::string& path, bool image_memcache)
}
if
(
TmpTrack
.
DIFormat
==
DI_FORMAT_AUDIO
)
TmpTrack
.
RawAudioMSBFirst
=
true
;
/
/
Silly cdrdao...
TmpTrack
.
RawAudioMSBFirst
=
true
;
/
*
Silly cdrdao...
*/
if
(
!
strcasecmp
(
args
[
1
].
c_str
(),
"RW"
))
{
...
...
@@ -820,7 +821,7 @@ bool CDAccess_Image::ImageOpen(const std::string& path, bool image_memcache)
else
if
(
cmdbuf
==
"CDTEXTFILE"
||
cmdbuf
==
"CATALOG"
||
cmdbuf
==
"ISRC"
||
cmdbuf
==
"TITLE"
||
cmdbuf
==
"PERFORMER"
||
cmdbuf
==
"SONGWRITER"
)
{
log_cb
(
RETRO_LOG_
INFO
,
"Unsupported CUE sheet directive:
\"
%s
\"
.
\n
"
,
cmdbuf
.
c_str
());
/* FIXME, generic logger passed by pointer to constructor */
log_cb
(
RETRO_LOG_
WARN
,
"Unsupported CUE sheet directive:
\"
%s
\"
.
\n
"
,
cmdbuf
.
c_str
());
/* FIXME, generic logger passed by pointer to constructor */
}
else
{
...
...
@@ -1308,12 +1309,13 @@ int32_t CDAccess_Image::MakeSubPQ(int32_t lba, uint8_t *SubPWBuf) const
if
(
!
SubQReplaceMap
.
empty
())
{
//printf("%d\n", lba);
auto
it
=
SubQReplaceMap
.
find
(
LBA_to_ABA
(
lba
));
std
::
map
<
uint32_t
,
stl_array
<
uint8_t
,
12
>
>::
const_iterator
it
=
SubQReplaceMap
.
find
(
LBA_to_ABA
(
lba
));
if
(
it
!=
SubQReplaceMap
.
end
())
{
//printf("Replace: %d\n", lba);
memcpy
(
buf
,
it
->
second
.
data
(),
12
);
memcpy
(
buf
,
(
void
*
)
it
->
second
.
data
(),
12
);
}
}
...
...
mednafen/cdrom/CDAccess_Image.h
View file @
5de4db03
...
...
@@ -2,7 +2,6 @@
#define __MDFN_CDACCESS_IMAGE_H
#include <map>
#include <array>
#include "CDUtility.h"
...
...
@@ -35,6 +34,23 @@ struct CDRFILE_TRACK_INFO
CDAFReader
*
AReader
;
};
template
<
typename
T
,
size_t
N
>
class
stl_array
{
T
m_data
[
N
];
public:
T
*
begin
()
{
return
m_data
;
}
T
*
end
()
{
return
m_data
+
N
;
}
T
&
operator
[](
size_t
i
)
{
return
m_data
[
i
];
}
size_t
size
()
{
return
N
;
}
bool
empty
()
{
return
N
==
0
;
}
T
*
data
()
{
return
m_data
;
}
const
T
*
begin
()
const
{
return
m_data
;
}
const
T
*
end
()
const
{
return
m_data
+
N
;
}
const
T
&
operator
[](
size_t
i
)
const
{
return
m_data
[
i
];
}
const
T
*
data
()
const
{
return
m_data
;
}
};
class
CDAccess_Image
:
public
CDAccess
{
public:
...
...
@@ -58,7 +74,7 @@ class CDAccess_Image : public CDAccess
CDRFILE_TRACK_INFO
Tracks
[
100
];
// Track #0(HMM?) through 99
TOC
toc
;
std
::
map
<
uint32_t
,
st
d
::
array
<
uint8_t
,
12
>>
SubQReplaceMap
;
std
::
map
<
uint32_t
,
st
l_
array
<
uint8_t
,
12
>
>
SubQReplaceMap
;
std
::
string
base_dir
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment