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
vbam-libretro
Commits
f2b34962
Commit
f2b34962
authored
Jan 29, 2019
by
retro-wertz
Committed by
Rafael Kitover
Jan 29, 2019
Browse files
GB: Add missing battery save for MMM01 cart
parent
a0cec107
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/gb/GB.cpp
View file @
f2b34962
...
...
@@ -4342,6 +4342,7 @@ bool gbUpdateSizes()
switch
(
gbRomType
)
{
case
0x03
:
case
0x06
:
case
0x0d
:
case
0x0f
:
case
0x10
:
case
0x13
:
...
...
src/libretro/libretro.cpp
View file @
f2b34962
...
...
@@ -187,27 +187,6 @@ static void set_gbPalette(void)
extern
int
gbRomType
;
// gets type from header 0x147
extern
int
gbBattery
;
// enabled when gbRamSize != 0
static
bool
gb_hasbattery
(
void
)
{
switch
(
gbRomType
)
{
case
0x03
:
// MBC1
case
0xff
:
// MBC1
case
0x0d
:
// MM01
case
0x0f
:
case
0x10
:
// MBC3 + extended
case
0x13
:
case
0xfc
:
// MBC3
case
0x1b
:
case
0x1e
:
// MBC5
//incomplete, does not save gbTAMA5ram
case
0xfd
:
// TAMA5 + extended
case
0x06
:
// MBC2
case
0x22
:
// MBC7
return
true
;
}
return
false
;
}
static
bool
gb_hasrtc
(
void
)
{
switch
(
gbRomType
)
{
...
...
@@ -323,7 +302,7 @@ void* retro_get_memory_data(unsigned id)
else
if
(
type
==
IMAGE_GB
)
{
switch
(
id
)
{
case
RETRO_MEMORY_SAVE_RAM
:
if
(
gb
_hasb
attery
()
)
if
(
gb
B
attery
)
return
gbRam
;
return
NULL
;
case
RETRO_MEMORY_SYSTEM_RAM
:
...
...
@@ -355,7 +334,7 @@ size_t retro_get_memory_size(unsigned id)
else
if
(
type
==
IMAGE_GB
)
{
switch
(
id
)
{
case
RETRO_MEMORY_SAVE_RAM
:
if
(
gb
_hasb
attery
()
)
if
(
gb
B
attery
)
return
gbRamSize
;
return
0
;
case
RETRO_MEMORY_SYSTEM_RAM
:
...
...
@@ -928,7 +907,7 @@ static void gb_init(void)
crc16
-=
gbRom
[
0x14e
]
+
gbRom
[
0x14f
];
log
(
"Checksum : %04x (%04x)
\n
"
,
crc16
,
gbRom
[
0x14e
]
*
256
+
gbRom
[
0x14f
]);
if
(
gb
_hasb
attery
()
)
if
(
gb
B
attery
)
log
(
"Game supports battery save ram.
\n
"
);
if
(
gbRom
[
0x143
]
==
0xc0
)
log
(
"Game works on CGB only
\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