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
snes9x
Commits
668f8bec
Commit
668f8bec
authored
Jan 28, 2012
by
OV2
Browse files
Add bsx loading to libsnes
parent
0a7c84e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
bsx.cpp
View file @
668f8bec
...
...
@@ -1023,11 +1023,19 @@ static bool8 BSX_LoadBIOS (void)
return
(
r
);
}
static
bool8
is_BSX_BIOS
(
const
uint8
*
data
,
uint32
size
)
{
if
(
size
==
BIOS_SIZE
&&
strncmp
((
char
*
)
(
data
+
0x7FC0
),
"Satellaview BS-X "
,
21
)
==
0
)
return
(
TRUE
);
else
return
(
FALSE
);
}
void
S9xInitBSX
(
void
)
{
Settings
.
BS
=
FALSE
;
if
(
!
memcmp
(
&
Memory
.
ROM
[
0x7FC0
],
"Satellaview BS-X "
,
21
))
if
(
is_BSX_BIOS
(
Memory
.
ROM
,
Memory
.
CalculatedSize
))
{
// BS-X itself
...
...
@@ -1074,7 +1082,7 @@ void S9xInitBSX (void)
BSX
.
bootup
=
Settings
.
BSXBootup
;
if
(
!
BSX_LoadBIOS
())
if
(
!
BSX_LoadBIOS
()
&&
!
is_BSX_BIOS
(
BIOSROM
,
BIOS_SIZE
)
)
{
BSX
.
bootup
=
FALSE
;
memset
(
BIOSROM
,
0
,
BIOS_SIZE
);
...
...
libsnes/libsnes.cpp
View file @
668f8bec
...
...
@@ -170,11 +170,14 @@ bool snes_load_cartridge_bsx_slotted(
}
bool
snes_load_cartridge_bsx
(
const
char
*
,
const
uint8_t
*
,
unsigned
,
const
char
*
,
const
uint8_t
*
,
unsigned
const
char
*
rom_xml
,
const
uint8_t
*
rom_data
,
unsigned
rom_size
,
const
char
*
bsx_xml
,
const
uint8_t
*
bsx_data
,
unsigned
bsx_size
)
{
return
false
;
if
(
bsx_data
==
NULL
)
return
snes_load_cartridge_normal
(
rom_xml
,
rom_data
,
rom_size
);
memcpy
(
Memory
.
BIOSROM
,
rom_data
,
rom_size
);
return
snes_load_cartridge_normal
(
bsx_xml
,
bsx_data
,
bsx_size
);
}
bool
snes_load_cartridge_sufami_turbo
(
...
...
@@ -668,20 +671,19 @@ bool8 S9xContinueUpdate(int width, int height)
return
S9xDeinitUpdate
(
width
,
height
);
}
// Dummy functions that should probably be implemented correctly later.
void
S9xParsePortConfig
(
ConfigFile
&
,
int
)
{}
void
S9xSyncSpeed
()
{}
//void S9xPollPointer(int, short*, short*) {}
const
char
*
S9xStringInput
(
const
char
*
in
)
{
return
in
;
}
const
char
*
S9xGetFilename
(
const
char
*
in
,
s9x_getdirtype
)
{
return
in
;
}
const
char
*
S9xGetDirectory
(
s9x_getdirtype
)
{
return
NULL
;
}
const
char
*
S9xGetDirectory
(
s9x_getdirtype
)
{
return
""
;
}
void
S9xInitInputDevices
()
{}
const
char
*
S9xChooseFilename
(
unsigned
char
)
{
return
NULL
;
}
const
char
*
S9xChooseFilename
(
unsigned
char
)
{
return
""
;
}
void
S9xHandlePortCommand
(
s9xcommand_t
,
short
,
short
)
{}
bool
S9xPollButton
(
unsigned
int
,
bool
*
)
{
return
false
;
}
void
S9xToggleSoundChannel
(
int
)
{}
const
char
*
S9xGetFilenameInc
(
const
char
*
in
,
s9x_getdirtype
)
{
return
NULL
;
}
const
char
*
S9xGetFilenameInc
(
const
char
*
in
,
s9x_getdirtype
)
{
return
""
;
}
const
char
*
S9xBasename
(
const
char
*
in
)
{
return
in
;
}
bool8
S9xInitUpdate
()
{
return
TRUE
;
}
void
S9xExtraUsage
()
{}
...
...
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