1 /***************************************************************************
2 * Nintendo GameCube/Wii disc-header classifier *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef NINTENDO_DISC_HEADER_H_INCLUDED
11 #define NINTENDO_DISC_HEADER_H_INCLUDED
17 NINTENDO_DISC_HEADER_UNKNOWN = 0,
18 NINTENDO_DISC_HEADER_GAMECUBE,
19 NINTENDO_DISC_HEADER_WII
20 } nintendo_disc_header_type;
23 * Classify an unscrambled Nintendo optical-disc header.
25 * Wii discs carry big-endian magic 0x5d1c9ea3 at byte 0x18.
26 * GameCube discs carry big-endian magic 0xc2339f3d at byte 0x1c.
27 * Wii is checked first, matching the console-side discrimination order.
29 nintendo_disc_header_type nintendo_disc_header_detect(
30 const uint8_t *sector,
34 const char *nintendo_disc_header_type_name(
35 nintendo_disc_header_type type