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
snes9x2010
Commits
84f656b7
Commit
84f656b7
authored
Jun 04, 2021
by
Libretro-Admin
Browse files
Further cleanup FileLoader
parent
c032967d
Pipeline
#30240
passed with stages
in 24 minutes and 37 seconds
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
src/memmap.c
View file @
84f656b7
...
...
@@ -763,34 +763,20 @@ static uint32 FileLoader (uint8 *buffer, int32 maxsize)
/* ** Memory.ROMFilename */
uint8
*
ptr
;
STREAM
fp
;
uint64_t
size
=
0
;
int32
totalSize
=
0
;
Memory
.
HeaderCount
=
0
;
STREAM
fp
=
OPEN_STREAM
();
fp
=
OPEN_STREAM
()
;
Memory
.
HeaderCount
=
0
;
if
(
!
fp
)
return
(
0
);
ptr
=
buffer
;
size
=
READ_STREAM
(
ptr
,
(
uint64_t
)(
maxsize
+
0x200
-
(
ptr
-
buffer
)
),
fp
);
maxsize
+
0x200
),
fp
);
CLOSE_STREAM
(
fp
);
size
=
HeaderRemove
(
size
,
&
Memory
.
HeaderCount
,
ptr
);
totalSize
+=
size
;
ptr
+=
size
;
if
(
Memory
.
HeaderCount
==
0
)
S9xMessage
(
S9X_MSG_INFO
,
S9X_CATEGORY_ROM
,
"No ROM file header found."
);
else
if
(
Memory
.
HeaderCount
==
1
)
S9xMessage
(
S9X_MSG_INFO
,
S9X_CATEGORY_ROM
,
"Found ROM file header (and ignored it)."
);
else
S9xMessage
(
S9X_MSG_INFO
,
S9X_CATEGORY_ROM
,
"Found multiple ROM file headers (and ignored them)."
);
return
((
uint32
)
totalSize
);
return
HeaderRemove
(
size
,
&
Memory
.
HeaderCount
,
ptr
);
}
static
uint32
caCRC32
(
uint8
*
array
,
uint32
size
,
uint32
crc32
)
...
...
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