Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Switch
RetroArch
RetroArch
Commits
2f85f85f
Commit
2f85f85f
authored
Aug 12, 2018
by
M4xw
🍗
Browse files
Core specific splashscreen
parent
45695e65
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/drivers/platform_switch.c
View file @
2f85f85f
...
@@ -390,6 +390,9 @@ end:
...
@@ -390,6 +390,9 @@ end:
return
ret
;
return
ret
;
}
}
// runloop_get_system_info isnt initialized that early..
extern
void
retro_get_system_info
(
struct
retro_system_info
*
info
);
static
void
frontend_switch_init
(
void
*
data
)
static
void
frontend_switch_init
(
void
*
data
)
{
{
(
void
)
data
;
(
void
)
data
;
...
@@ -412,95 +415,57 @@ static void frontend_switch_init(void *data)
...
@@ -412,95 +415,57 @@ static void frontend_switch_init(void *data)
#endif
#endif
#endif
#endif
rarch_system_info_t
*
sys_info
=
runloop_get_system_info
();
retro_get_system_info
(
sys_info
);
const
char
*
core_name
=
NULL
;
printf
(
"[Video]: Video initialized
\n
"
);
printf
(
"[Video]: Video initialized
\n
"
);
uint32_t
width
,
height
;
width
=
height
=
0
;
// Load splash
// Load splash
if
(
!
splashData
)
if
(
!
splashData
)
{
{
uint32_t
width
,
height
;
if
(
sys_info
)
width
=
height
=
0
;
// Meh, filesize got too big..
rpng_load_image_argb
(
"/retroarch/splash_01_720p.png"
,
&
splashData
,
&
width
,
&
height
);
if
(
splashData
)
{
{
argb_to_rgba8
(
splashData
,
height
,
width
)
;
core_name
=
sys_info
->
info
.
library_name
;
frontend_switch_showsplash
(
);
char
*
full_core_splash_path
=
(
char
*
)
malloc
(
PATH_MAX
);
}
snprintf
(
full_core_splash_path
,
PATH_MAX
,
"/retroarch/nxrgui/splash/%s.png"
,
core_name
);
#if 0
rpng_load_image_argb
((
const
char
*
)
full_core_splash_path
,
&
splashData
,
&
width
,
&
height
);
FILE *fsplash = fopen("romfs:/splash_01_720p.png", "r");
if
(
splashData
)
if (fsplash)
{
{
uint64_t fsize = 0
;
argb_to_rgba8
(
splashData
,
height
,
width
)
;
f
seek(fsplash, 0L, SEEK_END
);
f
rontend_switch_showsplash
(
);
fsize = ftell(fsplash);
}
rewind(fsplash);
else
{
splashData = malloc(fsize
);
rpng_load_image_argb
(
"/retroarch/nxrgui/splash/RetroNX.png"
,
&
splashData
,
&
width
,
&
height
);
if
(
splashData
)
if
(
splashData
)
{
{
// I am lazy
argb_to_rgba8
(
splashData
,
height
,
width
);
fread(splashData, fsize, 1, fsplash);
frontend_switch_showsplash
();
fclose(fsplash);
if (splashData)
{
rpng_t *rpng = NULL;
rpng_set_buf_ptr(rpng, splashData);
rpng_start(rpng);
while (rpng_iterate_image(rpng))
;
if (!rpng_is_valid(rpng))
{
// Invalid image
free(splashData);
splashData = NULL;
}
else
{
int retval;
uint32_t *tmpswap = NULL;
do
{
retval = rpng_process_image(rpng, &tmpswap, fsize, 1280, 720);
// Yield
svcSleepThread(3);
} while (retval == IMAGE_PROCESS_NEXT);
rpng_free(rpng);
if (tmpswap)
{
free(splashData);
splashData = tmpswap;
}
frontend_switch_showsplash();
}
}
}
else
{
// Uufff, no memory?
// What were you doing??
printf("??[Out of memory]??\n");
fclose(fsplash);
}
}
}
}
free
(
full_core_splash_path
);
}
}
else
else
{
{
// For future updates
rpng_load_image_argb
(
"/retroarch/nxrgui/splash/RetroNX.png"
,
&
splashData
,
&
width
,
&
height
);
frontend_switch_showsplash();
if
(
splashData
)
{
argb_to_rgba8
(
splashData
,
height
,
width
);
frontend_switch_showsplash
();
}
}
}
#endif
}
}
else
else
{
{
frontend_switch_showsplash
();
frontend_switch_showsplash
();
}
}
//}
}
}
static
int
frontend_switch_get_rating
(
void
)
static
int
frontend_switch_get_rating
(
void
)
...
...
Write
Preview
Supports
Markdown
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