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-pce-libretro
Commits
9cac6293
Commit
9cac6293
authored
Apr 08, 2021
by
Libretro-Admin
Browse files
Get rid of error_on_eos
parent
3c97af3b
Pipeline
#19571
passed with stages
in 4 minutes and 59 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mednafen/FileStream.cpp
View file @
9cac6293
...
...
@@ -39,7 +39,7 @@ FileStream::~FileStream()
}
}
uint64_t
FileStream
::
read
(
void
*
data
,
uint64_t
count
,
bool
error_on_eos
)
uint64_t
FileStream
::
read
(
void
*
data
,
uint64_t
count
)
{
if
(
!
fp
)
return
0
;
...
...
mednafen/FileStream.h
View file @
9cac6293
...
...
@@ -30,7 +30,7 @@ class FileStream : public Stream
FileStream
(
const
char
*
path
,
const
int
mode
);
virtual
~
FileStream
();
virtual
uint64_t
read
(
void
*
data
,
uint64_t
count
,
bool
error_on_eos
=
true
);
virtual
uint64_t
read
(
void
*
data
,
uint64_t
count
);
virtual
void
write
(
const
void
*
data
,
uint64_t
count
);
virtual
void
seek
(
int64_t
offset
,
int
whence
);
virtual
int64_t
tell
(
void
);
...
...
mednafen/MemoryStream.cpp
View file @
9cac6293
...
...
@@ -111,22 +111,18 @@ INLINE void MemoryStream::grow_if_necessary(uint64 new_required_size)
}
}
uint64
MemoryStream
::
read
(
void
*
data
,
uint64
count
,
bool
error_on_eos
)
uint64
MemoryStream
::
read
(
void
*
data
,
uint64
count
)
{
if
(
count
>
data_buffer_size
)
{
count
=
data_buffer_size
;
}
if
(
count
>
data_buffer_size
)
count
=
data_buffer_size
;
if
((
uint64
)
position
>
(
data_buffer_size
-
count
))
{
count
=
data_buffer_size
-
position
;
}
if
((
uint64
)
position
>
(
data_buffer_size
-
count
))
count
=
data_buffer_size
-
position
;
memmove
(
data
,
&
data_buffer
[
position
],
count
);
position
+=
count
;
memmove
(
data
,
&
data_buffer
[
position
],
count
);
position
+=
count
;
return
count
;
return
count
;
}
void
MemoryStream
::
write
(
const
void
*
data
,
uint64
count
)
...
...
mednafen/MemoryStream.h
View file @
9cac6293
...
...
@@ -42,7 +42,7 @@ class MemoryStream : public Stream
virtual
uint8
*
map
(
void
);
virtual
void
unmap
(
void
);
virtual
uint64
read
(
void
*
data
,
uint64
count
,
bool
error_on_eos
=
true
);
virtual
uint64
read
(
void
*
data
,
uint64
count
);
virtual
void
write
(
const
void
*
data
,
uint64
count
);
virtual
void
seek
(
int64
offset
,
int
whence
);
virtual
int64
tell
(
void
);
...
...
mednafen/Stream.cpp
View file @
9cac6293
...
...
@@ -36,7 +36,7 @@ int Stream::get_line(std::string &str)
str
.
clear
();
// or str.resize(0)??
while
(
read
(
&
c
,
sizeof
(
c
)
,
false
)
>
0
)
while
(
read
(
&
c
,
sizeof
(
c
))
>
0
)
{
if
(
c
==
'\r'
||
c
==
'\n'
||
c
==
0
)
return
(
c
);
...
...
mednafen/Stream.h
View file @
9cac6293
...
...
@@ -21,7 +21,7 @@ class Stream
Stream
();
virtual
~
Stream
();
virtual
uint64
read
(
void
*
data
,
uint64
count
,
bool
error_on_eos
=
true
)
=
0
;
virtual
uint64
read
(
void
*
data
,
uint64
count
)
=
0
;
virtual
void
write
(
const
void
*
data
,
uint64
count
)
=
0
;
virtual
void
seek
(
int64
offset
,
int
whence
)
=
0
;
...
...
mednafen/cdrom/CDAFReader_Vorbis.cpp
View file @
9cac6293
...
...
@@ -48,7 +48,7 @@ static size_t iov_read_func(void *ptr, size_t size, size_t nmemb, void *user_dat
if
(
!
size
)
return
(
0
);
return
fw
->
read
(
ptr
,
size
*
nmemb
,
false
)
/
size
;
return
fw
->
read
(
ptr
,
size
*
nmemb
)
/
size
;
}
static
int
iov_seek_func
(
void
*
user_data
,
int64_t
offset
,
int
whence
)
...
...
mednafen/cdrom/CDAccess_Image.cpp
View file @
9cac6293
...
...
@@ -328,7 +328,7 @@ bool CDAccess_Image::LoadSBI(const std::string& sbi_path)
return
false
;
}
while
(
sbis
.
read
(
ed
,
sizeof
(
ed
)
,
false
)
==
sizeof
(
ed
))
while
(
sbis
.
read
(
ed
,
sizeof
(
ed
))
==
sizeof
(
ed
))
{
if
(
!
BCD_is_valid
(
ed
[
0
])
||
!
BCD_is_valid
(
ed
[
1
])
||
!
BCD_is_valid
(
ed
[
2
]))
{
...
...
@@ -410,7 +410,7 @@ bool CDAccess_Image::ImageOpen(const std::string& path, bool image_memcache)
{
uint8_t
bom_tmp
[
3
];
if
(
fp
.
read
(
bom_tmp
,
3
,
false
)
==
3
&&
bom_tmp
[
0
]
==
0xEF
&&
bom_tmp
[
1
]
==
0xBB
&&
bom_tmp
[
2
]
==
0xBF
)
if
(
fp
.
read
(
bom_tmp
,
3
)
==
3
&&
bom_tmp
[
0
]
==
0xEF
&&
bom_tmp
[
1
]
==
0xBB
&&
bom_tmp
[
2
]
==
0xBF
)
{
// Print an annoying error message, but don't actually error out.
log_cb
(
RETRO_LOG_WARN
,
"UTF-8 BOM detected at start of CUE sheet.
\n
"
);
...
...
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