diff options
Diffstat (limited to 'utils/nwztools/database/README')
-rw-r--r-- | utils/nwztools/database/README | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/utils/nwztools/database/README b/utils/nwztools/database/README new file mode 100644 index 0000000000..62d5ca66e8 --- /dev/null +++ b/utils/nwztools/database/README | |||
@@ -0,0 +1,62 @@ | |||
1 | This file explains how the database was created an how to update it. | ||
2 | |||
3 | Model list | ||
4 | ========== | ||
5 | |||
6 | The model list (models.txt) was extract from Sony's mptapp on target. This is | ||
7 | most probably the only reliable way of getting model IDs. It cannot be done | ||
8 | automatically but it is easy to locate the list using a tool like IDA. It is | ||
9 | basically a long list of the following structure: | ||
10 | struct model_info_t | ||
11 | { | ||
12 | const char *name; | ||
13 | uin32_t mid; | ||
14 | }; | ||
15 | Once identified, it is easy to copy it to a file and grep/sed/awk it to produce | ||
16 | the textual list. It depends on which tool you use. I decided to keep this list | ||
17 | because it is an easy format to produce and parse. For consistency, I decided | ||
18 | to use upper case for the model name and lower case for mid. Keep this when | ||
19 | you modify the list to keep the diff minimal. | ||
20 | |||
21 | IMPORTANT NOTE: some players have more than one model ID (ie same name) !! | ||
22 | |||
23 | FORMAT (models.txt): list of pairs <mid>,<name> where <name> is upper case | ||
24 | human name of the player and <mid> is the lower-case hex value of the model ID. | ||
25 | |||
26 | Series list | ||
27 | =========== | ||
28 | |||
29 | The original series list was semi-automatically generated. Unfortunately, Sony | ||
30 | does not use a 100% regular naming scheme. It is thus simpler to modify it by | ||
31 | hand for newer models. To keep consistency, the generator script will make sure | ||
32 | that the series list only refers to device in the model list and that no device | ||
33 | in the model list is not refered to. | ||
34 | |||
35 | FORMAT (series.txt): list of <codename>,<name>,<mid1>,<mid2>,... where <codename> | ||
36 | is the (Rockbox-only) codename of the series (that should match what other tools | ||
37 | use, like upgtools), always in lower case; where <name> is the humand name of the | ||
38 | series, and <midX> is the list of models in the series (given by model IDs because | ||
39 | name are not uniques). | ||
40 | |||
41 | Advise on tooling | ||
42 | ================= | ||
43 | |||
44 | The format of the file was carefully chosen to be easy to use and produce. It | ||
45 | avoids uses spaces are separators because it breaks easily. The "," separator | ||
46 | is a good match in this case and shouldn't pose a problem. In most tools, changing | ||
47 | the separator is easy. For example with awk, you can use the | ||
48 | -F "," | ||
49 | option, or define in the preamble with | ||
50 | BEGIN { FS = ","; } | ||
51 | . Other tools have similar constructs. | ||
52 | |||
53 | NVPs | ||
54 | ==== | ||
55 | |||
56 | See nvps/README | ||
57 | |||
58 | gen_db.py | ||
59 | ========= | ||
60 | |||
61 | This script generates the database (nwz_db.{c,h}) from the various textual files. | ||
62 | The output must NOT be touched by hand. | ||