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
RACE
Commits
534d994f
Commit
534d994f
authored
Oct 04, 2020
by
Libretro-Admin
Browse files
Cleanups
parent
94eda9b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
flash.c
View file @
534d994f
...
@@ -147,27 +147,27 @@ unsigned char blockNumFromAddr(unsigned int addr)
...
@@ -147,27 +147,27 @@ unsigned char blockNumFromAddr(unsigned int addr)
unsigned
int
blockNumToAddr
(
unsigned
char
chip
,
unsigned
char
blockNum
)
unsigned
int
blockNumToAddr
(
unsigned
char
chip
,
unsigned
char
blockNum
)
{
{
unsigned
int
addr
;
unsigned
int
addr
;
if
(
blockNum
>=
bootBlockStartNum
)
if
(
blockNum
>=
bootBlockStartNum
)
{
{
addr
=
bootBlockStartNum
*
0x10000
;
addr
=
bootBlockStartNum
*
0x10000
;
unsigned
char
bootBlock
=
blockNum
-
bootBlockStartNum
;
unsigned
char
bootBlock
=
blockNum
-
bootBlockStartNum
;
if
(
bootBlock
>=
1
)
if
(
bootBlock
>=
1
)
addr
+=
0x8000
;
addr
+=
0x8000
;
if
(
bootBlock
>=
2
)
if
(
bootBlock
>=
2
)
addr
+=
0x2000
;
addr
+=
0x2000
;
if
(
bootBlock
>=
3
)
if
(
bootBlock
>=
3
)
addr
+=
0x2000
;
addr
+=
0x2000
;
}
}
else
else
addr
=
blockNum
*
0x10000
;
addr
=
blockNum
*
0x10000
;
if
(
chip
)
if
(
chip
)
addr
+=
0x200000
;
addr
+=
0x200000
;
return
addr
;
return
addr
;
}
}
unsigned
int
blockSize
(
unsigned
char
blockNum
)
unsigned
int
blockSize
(
unsigned
char
blockNum
)
...
@@ -301,12 +301,12 @@ void writeSaveGameFile(void)
...
@@ -301,12 +301,12 @@ void writeSaveGameFile(void)
}
}
bytes
=
fwrite
(
&
mainrom
[
blockNumToAddr
(
0
,
i
)],
1
,
blockSize
(
i
),
ngfFile
);
bytes
=
fwrite
(
&
mainrom
[
blockNumToAddr
(
0
,
i
)],
1
,
blockSize
(
i
),
ngfFile
);
if
(
bytes
!=
blockSize
(
i
))
if
(
bytes
!=
blockSize
(
i
))
{
{
fprintf
(
stderr
,
"writeSaveGameFile: wrote %d bytes, but exptected %d bytes
\n
"
,
bytes
,
blockSize
(
i
));
fprintf
(
stderr
,
"writeSaveGameFile: wrote %d bytes, but exptected %d bytes
\n
"
,
bytes
,
blockSize
(
i
));
fclose
(
ngfFile
);
fclose
(
ngfFile
);
return
;
return
;
}
}
}
}
}
}
...
@@ -328,12 +328,12 @@ void writeSaveGameFile(void)
...
@@ -328,12 +328,12 @@ void writeSaveGameFile(void)
}
}
bytes
=
fwrite
(
&
mainrom
[
blockNumToAddr
(
1
,
i
)],
1
,
blockSize
(
i
),
ngfFile
);
bytes
=
fwrite
(
&
mainrom
[
blockNumToAddr
(
1
,
i
)],
1
,
blockSize
(
i
),
ngfFile
);
if
(
bytes
!=
blockSize
(
i
))
if
(
bytes
!=
blockSize
(
i
))
{
{
fprintf
(
stderr
,
"writeSaveGameFile: wrote %d bytes, but exptected %d bytes
\n
"
,
bytes
,
blockSize
(
i
));
fprintf
(
stderr
,
"writeSaveGameFile: wrote %d bytes, but exptected %d bytes
\n
"
,
bytes
,
blockSize
(
i
));
fclose
(
ngfFile
);
fclose
(
ngfFile
);
return
;
return
;
}
}
}
}
}
}
}
}
...
...
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