forked from MiSTer-devel/Main_MiSTer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame_docs.cpp
More file actions
47 lines (39 loc) · 1.09 KB
/
game_docs.cpp
File metadata and controls
47 lines (39 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
#include <string.h>
#include "game_docs.h"
#include "file_io.h"
#include "user_io.h"
#include "support.h"
static char manual_path[1024] = {};
void game_docs_init(const char *rom_path, uint32_t romcrc)
{
manual_path[0] = 0;
char manuals_dir[1024];
snprintf(manuals_dir, sizeof(manuals_dir), "%s", user_io_get_core_name2());
findDocsDir(manuals_dir, sizeof(manuals_dir));
strcat(manuals_dir, "/Manuals");
const char *pcecd_dir = NULL;
char pcecd_manuals_dir[1024];
if (pcecd_using_cd())
{
snprintf(pcecd_manuals_dir, sizeof(pcecd_manuals_dir), "%sCD", user_io_get_core_name2());
findDocsDir(pcecd_manuals_dir, sizeof(pcecd_manuals_dir));
strcat(pcecd_manuals_dir, "/Manuals");
pcecd_dir = pcecd_manuals_dir;
}
if (findGameAsset(manual_path, sizeof(manual_path), rom_path, romcrc, ".pdf", manuals_dir, pcecd_dir, NULL))
{
printf("Using manual file: %s\n", manual_path);
} else {
manual_path[0] = 0;
printf("No manual file found.\n");
}
}
int game_docs_manual_available()
{
return manual_path[0] != 0;
}
const char *game_docs_get_manual()
{
return manual_path;
}