Subversion Repositories ps2ware

Compare Revisions

Ignore whitespace Rev 26 → Rev 27

/trunk/ps2menu/ps2menu/fontset.c
New file
0,0 → 1,514
u16 fontset[] = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x180, 0x0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x3c0, 0x3c0, 0x3c0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x198, 0x198, 0x198, 0x330, 0xff8, 0x330,
0x660, 0x660, 0x1ff0, 0xcc0, 0xcc0, 0xcc0, 0x0, 0x0,
0x180, 0x180, 0x7e0, 0xdb0, 0xdb0, 0xd80, 0x780, 0x1e0,
0x1b0, 0x1b0, 0xdb0, 0xdb0, 0x7e0, 0x180, 0x180, 0x0,
0x0, 0x30, 0x3c30, 0x6660, 0x6660, 0x66c0, 0x3d80, 0x180,
0x378, 0x6cc, 0x6cc, 0xccc, 0x1878, 0x1800, 0x0, 0x0,
0x0, 0x780, 0xcc0, 0xcc0, 0xcc0, 0x780, 0x700, 0xdb0,
0x18f0, 0x1860, 0x1860, 0xcf0, 0x798, 0x0, 0x0, 0x0,
0x0, 0x0, 0x180, 0x180, 0x180, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0xc0, 0x180, 0x300, 0x300, 0x600, 0x600, 0x600,
0x600, 0x600, 0x600, 0x300, 0x300, 0x180, 0xc0, 0x0,
0x0, 0x600, 0x300, 0x180, 0x180, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0x180, 0x180, 0x300, 0x600, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x7e0,
0x180, 0x3c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0xc0, 0xc0, 0xc0, 0x7f8,
0xc0, 0xc0, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x300, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f8,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x60, 0x60, 0xc0, 0xc0, 0x180, 0x180,
0x300, 0x300, 0x600, 0x600, 0xc00, 0xc00, 0x0, 0x0,
0x0, 0x0, 0x1e0, 0x330, 0x618, 0x618, 0x618, 0x618,
0x618, 0x618, 0x618, 0x618, 0x330, 0x1e0, 0x0, 0x0,
0x0, 0x0, 0xc0, 0x3c0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x0, 0x0,
0x0, 0x0, 0x1e0, 0x330, 0x618, 0x618, 0x18, 0x30,
0x60, 0xc0, 0x180, 0x300, 0x600, 0x7f8, 0x0, 0x0,
0x0, 0x0, 0x1e0, 0x330, 0x618, 0x18, 0x30, 0x1e0,
0x30, 0x18, 0x18, 0x618, 0x330, 0x1e0, 0x0, 0x0,
0x0, 0x0, 0xe0, 0x1e0, 0x1e0, 0x360, 0x360, 0x660,
0x660, 0xc60, 0xff8, 0x60, 0x60, 0x60, 0x0, 0x0,
0x0, 0x0, 0x7f8, 0x600, 0x600, 0x600, 0x7e0, 0x730,
0x618, 0x18, 0x18, 0x618, 0x330, 0x1e0, 0x0, 0x0,
0x0, 0x0, 0x1e0, 0x330, 0x618, 0x600, 0x7e0, 0x730,
0x618, 0x618, 0x618, 0x618, 0x330, 0x1e0, 0x0, 0x0,
0x0, 0x0, 0x7f8, 0x18, 0x30, 0x60, 0x60, 0xc0,
0xc0, 0xc0, 0x180, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x1e0, 0x330, 0x618, 0x618, 0x330, 0x1e0,
0x330, 0x618, 0x618, 0x618, 0x330, 0x1e0, 0x0, 0x0,
0x0, 0x0, 0x1e0, 0x330, 0x618, 0x618, 0x618, 0x618,
0x338, 0x1f8, 0x18, 0x618, 0x330, 0x1e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x180, 0x180, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x180, 0x180, 0x300, 0x0, 0x0, 0x0, 0x0,
0x0, 0x30, 0x60, 0xc0, 0x180, 0x300, 0x600, 0xc00,
0x600, 0x300, 0x180, 0xc0, 0x60, 0x30, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f8, 0x0,
0x0, 0x7f8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0xc00, 0x600, 0x300, 0x180, 0xc0, 0x60, 0x30,
0x60, 0xc0, 0x180, 0x300, 0x600, 0xc00, 0x0, 0x0,
0x0, 0x0, 0x3e0, 0x630, 0x630, 0x30, 0x60, 0xc0,
0x180, 0x180, 0x0, 0x0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x3f0, 0x618, 0xc0c, 0x1bec, 0x1eec, 0x3cd8,
0x3cd8, 0x3db0, 0x37e0, 0x3000, 0x1838, 0xfe0, 0x0, 0x0,
0x0, 0x0, 0x180, 0x180, 0x3c0, 0x3c0, 0x660, 0x660,
0x660, 0xc30, 0xff0, 0xc30, 0x1818, 0x1818, 0x0, 0x0,
0x0, 0x0, 0x1fc0, 0x1860, 0x1860, 0x1860, 0x18c0, 0x1fc0,
0x1860, 0x1830, 0x1830, 0x1830, 0x1860, 0x1fc0, 0x0, 0x0,
0x0, 0x0, 0x3e0, 0x630, 0xc18, 0x1800, 0x1800, 0x1800,
0x1800, 0x1800, 0x1800, 0xc18, 0x630, 0x3e0, 0x0, 0x0,
0x0, 0x0, 0x1f80, 0x18c0, 0x1860, 0x1830, 0x1830, 0x1830,
0x1830, 0x1830, 0x1830, 0x1860, 0x18c0, 0x1f80, 0x0, 0x0,
0x0, 0x0, 0x1ff0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1fe0,
0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1ff0, 0x0, 0x0,
0x0, 0x0, 0xff8, 0xc00, 0xc00, 0xc00, 0xc00, 0xff0,
0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0x0, 0x0,
0x0, 0x0, 0x3e0, 0x630, 0xc18, 0x1818, 0x1800, 0x1800,
0x18f8, 0x1818, 0x1818, 0xc38, 0x678, 0x3d8, 0x0, 0x0,
0x0, 0x0, 0x1830, 0x1830, 0x1830, 0x1830, 0x1830, 0x1ff0,
0x1830, 0x1830, 0x1830, 0x1830, 0x1830, 0x1830, 0x0, 0x0,
0x0, 0x0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xcc0, 0xcc0, 0x780, 0x0, 0x0,
0x0, 0x0, 0x1830, 0x1860, 0x18c0, 0x1980, 0x1b00, 0x1e00,
0x1f00, 0x1980, 0x18c0, 0x1860, 0x1830, 0x1818, 0x0, 0x0,
0x0, 0x0, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xc00,
0xc00, 0xc00, 0xc00, 0xc00, 0xc00, 0xff8, 0x0, 0x0,
0x0, 0x0, 0x300c, 0x300c, 0x381c, 0x381c, 0x3c3c, 0x3c3c,
0x366c, 0x366c, 0x33cc, 0x33cc, 0x318c, 0x318c, 0x0, 0x0,
0x0, 0x0, 0x1818, 0x1c18, 0x1e18, 0x1e18, 0x1b18, 0x1998,
0x1998, 0x18d8, 0x1878, 0x1878, 0x1838, 0x1818, 0x0, 0x0,
0x0, 0x0, 0x3e0, 0x630, 0xc18, 0x180c, 0x180c, 0x180c,
0x180c, 0x180c, 0x180c, 0xc18, 0x630, 0x3e0, 0x0, 0x0,
0x0, 0x0, 0x1fc0, 0x1860, 0x1830, 0x1830, 0x1830, 0x1860,
0x1fc0, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x0, 0x0,
0x0, 0x0, 0x3e0, 0x630, 0xc18, 0x180c, 0x180c, 0x180c,
0x180c, 0x180c, 0x180c, 0xc78, 0x630, 0x3f8, 0xc, 0x0,
0x0, 0x0, 0x1fc0, 0x1860, 0x1830, 0x1830, 0x1830, 0x1860,
0x1fc0, 0x1860, 0x1830, 0x1830, 0x1830, 0x1830, 0x0, 0x0,
0x0, 0x0, 0x7c0, 0xc60, 0x1830, 0x1800, 0xc00, 0x780,
0xe0, 0x30, 0x30, 0x1830, 0xc60, 0x7c0, 0x0, 0x0,
0x0, 0x0, 0x1ff8, 0x180, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818,
0x1818, 0x1818, 0x1818, 0x1818, 0xc30, 0x7e0, 0x0, 0x0,
0x0, 0x0, 0x1818, 0x1818, 0xc30, 0xc30, 0xc30, 0x660,
0x660, 0x660, 0x3c0, 0x3c0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x6186, 0x6186, 0x6186, 0x33cc, 0x33cc, 0x33cc,
0x1e78, 0x1e78, 0x1e78, 0xc30, 0xc30, 0xc30, 0x0, 0x0,
0x0, 0x0, 0x1818, 0x1818, 0xc30, 0x660, 0x3c0, 0x180,
0x180, 0x3c0, 0x660, 0xc30, 0x1818, 0x1818, 0x0, 0x0,
0x0, 0x0, 0x1818, 0x1818, 0xc30, 0x660, 0x660, 0x3c0,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x1ff0, 0x30, 0x60, 0xc0, 0xc0, 0x180,
0x300, 0x600, 0x600, 0xc00, 0x1800, 0x1ff0, 0x0, 0x0,
0x0, 0x1e0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x1e0, 0x0,
0x0, 0x0, 0x318c, 0x318c, 0x318c, 0x33cc, 0x7ffe, 0x33cc,
0x1e78, 0x1e78, 0x1e78, 0xc30, 0xc30, 0xc30, 0x0, 0x0,
0x0, 0x3c0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x3c0, 0x0,
0x0, 0xc0, 0x1e0, 0x330, 0x618, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x7f8, 0x0, 0x0,
0x0, 0x600, 0x300, 0x180, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x7e0, 0xc30, 0x30,
0x3f0, 0x630, 0xc30, 0xc30, 0xc30, 0x7f8, 0x0, 0x0,
0x0, 0x0, 0xc00, 0xc00, 0xc00, 0xfc0, 0xe60, 0xc30,
0xc30, 0xc30, 0xc30, 0xc30, 0xe60, 0xfc0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0, 0x630, 0xc00,
0xc00, 0xc00, 0xc00, 0xc00, 0x630, 0x3e0, 0x0, 0x0,
0x0, 0x0, 0x30, 0x30, 0x30, 0x3f0, 0x670, 0xc30,
0xc30, 0xc30, 0xc30, 0xc30, 0x670, 0x3f0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x3c0, 0x660, 0xc30,
0xc30, 0xff0, 0xc00, 0xc00, 0x630, 0x3e0, 0x0, 0x0,
0x0, 0x0, 0xe0, 0x180, 0x180, 0x7e0, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x3f0, 0x670, 0xc30,
0xc30, 0xc30, 0xc30, 0x670, 0x3f0, 0x30, 0xc60, 0x7c0,
0x0, 0x0, 0xc00, 0xc00, 0xc00, 0xfe0, 0xe30, 0xc30,
0xc30, 0xc30, 0xc30, 0xc30, 0xc30, 0xc30, 0x0, 0x0,
0x0, 0x0, 0x180, 0x180, 0x0, 0x0, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0xc0, 0xc0, 0x0, 0x0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x380,
0x0, 0x0, 0x600, 0x600, 0x600, 0x630, 0x660, 0x6c0,
0x780, 0x780, 0x6c0, 0x660, 0x630, 0x618, 0x0, 0x0,
0x0, 0x0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x3f78, 0x39cc, 0x318c,
0x318c, 0x318c, 0x318c, 0x318c, 0x318c, 0x318c, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0xfe0, 0xe30, 0xc30,
0xc30, 0xc30, 0xc30, 0xc30, 0xc30, 0xc30, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x7c0, 0xc60, 0x1830,
0x1830, 0x1830, 0x1830, 0x1830, 0xc60, 0x7c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0xfc0, 0xe60, 0xc30,
0xc30, 0xc30, 0xc30, 0xc30, 0xe60, 0xfc0, 0xc00, 0xc00,
0x0, 0x0, 0x0, 0x0, 0x0, 0x3f0, 0x670, 0xc30,
0xc30, 0xc30, 0xc30, 0xc30, 0x670, 0x3f0, 0x30, 0x30,
0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0, 0x380, 0x300,
0x300, 0x300, 0x300, 0x300, 0x300, 0x300, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x7e0, 0xc30, 0xc30,
0x700, 0x1c0, 0x60, 0xc30, 0xc30, 0x7e0, 0x0, 0x0,
0x0, 0x0, 0x180, 0x180, 0x180, 0x7e0, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0xe0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0xc30, 0xc30, 0xc30,
0xc30, 0xc30, 0xc30, 0xc30, 0xc70, 0x7f0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x618, 0x618, 0x618,
0x330, 0x330, 0x1e0, 0x1e0, 0xc0, 0xc0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x1998, 0x1998, 0x1998,
0xff0, 0xff0, 0xff0, 0x660, 0x660, 0x660, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0xc30, 0xc30, 0x660,
0x3c0, 0x180, 0x3c0, 0x660, 0xc30, 0xc30, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x618, 0x618, 0x618,
0x330, 0x330, 0x1e0, 0x1e0, 0xc0, 0xc0, 0x180, 0x700,
0x0, 0x0, 0x0, 0x0, 0x0, 0xff0, 0x30, 0x60,
0xc0, 0x180, 0x300, 0x600, 0xc00, 0xff0, 0x0, 0x0,
0x0, 0x70, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x380,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x70, 0x0,
0x0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x0,
0x0, 0x380, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x70,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x380, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf8c,
0x18f8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x7f0, 0x630, 0x630, 0x630, 0x630,
0x630, 0x630, 0x630, 0x630, 0x630, 0x7f0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x3f0, 0x618, 0xc0c, 0xc00, 0x1ff0,
0xc00, 0x1ff0, 0xc00, 0xc0c, 0x618, 0x3f0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xf8, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0xc, 0xe, 0x2, 0x0,
0x0, 0x0, 0x0, 0x70, 0xc0, 0xc0, 0x3f0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x6c0, 0x380,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0xc, 0xe, 0x2, 0xc, 0xe, 0x2, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6318, 0x6318,
0x6318, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x400,
0x400, 0x400, 0x7ffe, 0x7ffe, 0x400, 0x400, 0x400, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x810,
0x810, 0x810, 0x7ffe, 0x7ffe, 0x810, 0x810, 0x810, 0x0,
0x0, 0x180, 0x3c0, 0x660, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xf0, 0x1f8, 0x108, 0x1f8, 0x20f0, 0x30f0, 0x19f8, 0xd08,
0x7f8, 0x3f0, 0x1f80, 0x3fc0, 0x2160, 0x3f30, 0x1e10, 0x0,
0x660, 0x3c0, 0x180, 0x7e0, 0xc30, 0x1818, 0x1800, 0xe00,
0x3c0, 0x70, 0x18, 0x1818, 0xc30, 0x7e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x440, 0x6c0, 0x380, 0x100, 0x0, 0x0,
0x0, 0x0, 0x0, 0xffe, 0x1980, 0x3180, 0x6180, 0x6180,
0x61fc, 0x6180, 0x6180, 0x3180, 0x1980, 0xffe, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xf8, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0x660, 0x3c0, 0x180, 0x1ff0, 0x30, 0x60, 0xc0, 0x180,
0x180, 0x300, 0x600, 0xc00, 0x1800, 0x1ff0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xf8, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xf8, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0x0, 0x0, 0xc0, 0x3c0, 0x3c0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x3c0, 0x3c0, 0x300, 0x0, 0x0, 0x0, 0x0,
0x0, 0xc0, 0x3c0, 0x3c0, 0xc0, 0x3c0, 0x3c0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x3c0, 0x3c0, 0x300, 0x3c0, 0x3c0, 0x300, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1c0, 0x3e0, 0x3e0, 0x3e0, 0x3e0, 0x1c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x0, 0x0, 0x3b0, 0x6e0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x7e00, 0x7e00, 0x7800, 0x1e00, 0x1e00, 0x7800, 0x7e00, 0x7e00,
0x4000, 0x4000, 0x7e00, 0x7e00, 0x4000, 0x4000, 0x0, 0x0,
0x0, 0x660, 0x3c0, 0x180, 0x0, 0x7e0, 0xc30, 0xc00,
0x700, 0x1c0, 0x60, 0x30, 0xc30, 0x7e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x100, 0x380, 0x6c0, 0x440, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x1e78, 0x33cc, 0x6186,
0x6186, 0x61fe, 0x6180, 0x6180, 0x33c6, 0x1e7c, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xf8, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0x0, 0x330, 0x1e0, 0xc0, 0x0, 0x7f0, 0x30, 0x60,
0xc0, 0xc0, 0x180, 0x300, 0x600, 0x7f0, 0x0, 0x0,
0x0, 0x3c0, 0x0, 0x1818, 0x1818, 0xc30, 0x660, 0x660,
0x3c0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x180, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x0, 0x0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x0, 0x3c0, 0x3c0, 0x3c0, 0x3c0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x1b0, 0x360, 0x360, 0x1ff0,
0x6c0, 0x6c0, 0x1ff0, 0xd80, 0xd80, 0x1b00, 0x0, 0x0,
0x0, 0x0, 0x180, 0x180, 0x7e0, 0xde0, 0xdb0, 0xd80,
0x780, 0x1e0, 0x1b0, 0xdb0, 0x7b0, 0x7e0, 0x180, 0x180,
0x0, 0x0, 0x0, 0x0, 0xe30, 0x1be0, 0x3360, 0x36c0,
0x1d80, 0x1b8, 0x36c, 0x6cc, 0x6d8, 0xc70, 0x0, 0x0,
0x0, 0x0, 0x0, 0x3c0, 0x660, 0x660, 0x6c0, 0x380,
0xf3c, 0x1998, 0x1998, 0x18f0, 0xc6c, 0x7f8, 0x0, 0x0,
0x0, 0x0, 0x0, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0xc0, 0x180, 0x300, 0x300, 0x600, 0x600,
0x600, 0x600, 0x600, 0x300, 0x300, 0x180, 0xc0, 0x0,
0x0, 0x0, 0x600, 0x300, 0x180, 0x180, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0x180, 0x180, 0x300, 0x600, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x180, 0x7e0,
0x3c0, 0x7e0, 0x180, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0xc0, 0xc0, 0xc0,
0x7f8, 0xc0, 0xc0, 0xc0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x180, 0x300,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x7f8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x60, 0x60, 0xc0, 0xc0, 0x180, 0x180,
0x180, 0x300, 0x300, 0x600, 0x600, 0x600, 0xc00, 0xc00,
0x0, 0x0, 0x0, 0x1c0, 0x360, 0x630, 0x630, 0x630,
0x630, 0x630, 0x630, 0x630, 0x360, 0x1c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xc0, 0x3c0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x3f0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1c0, 0x360, 0x630, 0x630, 0x60,
0xc0, 0x180, 0x300, 0x630, 0x660, 0x7e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1c0, 0x360, 0x630, 0x630, 0x60,
0x1c0, 0x60, 0x30, 0x630, 0x360, 0x1c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xe0, 0xe0, 0x1e0, 0x1e0, 0x360,
0x360, 0x660, 0x7f8, 0x60, 0x60, 0xf0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x7f0, 0x600, 0x600, 0x600, 0x7c0,
0x660, 0x30, 0x30, 0x630, 0x360, 0x1c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1c0, 0x360, 0x630, 0x630, 0x7c0,
0x760, 0x630, 0x630, 0x630, 0x360, 0x1c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x7f0, 0x630, 0xc30, 0x60, 0x60,
0xc0, 0xc0, 0x180, 0x180, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1c0, 0x360, 0x630, 0x630, 0x360,
0x1c0, 0x360, 0x630, 0x630, 0x360, 0x1c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1c0, 0x360, 0x630, 0x630, 0x630,
0x370, 0x1f0, 0x30, 0x630, 0x360, 0x1c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x0,
0x0, 0x0, 0x180, 0x180, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x0,
0x0, 0x0, 0x180, 0x180, 0x300, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x30, 0x60, 0xc0, 0x180, 0x300,
0x600, 0x300, 0x180, 0xc0, 0x60, 0x30, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f8,
0x0, 0x7f8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x600, 0x300, 0x180, 0xc0, 0x60,
0x30, 0x60, 0xc0, 0x180, 0x300, 0x600, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1e0, 0x330, 0x330, 0x30, 0x60,
0xc0, 0xc0, 0xc0, 0x0, 0xc0, 0xc0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x3f0, 0x618, 0xc0c, 0x19fc, 0x1b6c,
0x366c, 0x36cc, 0x36d8, 0x33f0, 0x3000, 0x1838, 0xfe0, 0x0,
0x0, 0x0, 0x0, 0x180, 0x180, 0x3c0, 0x3c0, 0x3c0,
0x660, 0x7e0, 0x660, 0xc30, 0xc30, 0x1e78, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1fc0, 0xc60, 0xc60, 0xc60, 0xc60,
0xfe0, 0xc30, 0xc30, 0xc30, 0xc30, 0x1fe0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x3f0, 0x630, 0xc18, 0xc00, 0xc00,
0xc00, 0xc00, 0xc00, 0xc18, 0x630, 0x3e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1fc0, 0xc60, 0xc30, 0xc30, 0xc30,
0xc30, 0xc30, 0xc30, 0xc30, 0xc60, 0x1fc0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1fe0, 0xc60, 0xc30, 0xc00, 0xcc0,
0xfc0, 0xcc0, 0xc00, 0xc30, 0xc60, 0x1fe0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xff0, 0x630, 0x618, 0x600, 0x660,
0x7e0, 0x660, 0x600, 0x600, 0x600, 0xf00, 0x0, 0x0,
0x0, 0x0, 0x0, 0x7f0, 0xc30, 0x1818, 0x1800, 0x1800,
0x18f8, 0x1830, 0x1830, 0x1830, 0xc70, 0x7f0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1e78, 0xc30, 0xc30, 0xc30, 0xc30,
0xff0, 0xc30, 0xc30, 0xc30, 0xc30, 0x1e78, 0x0, 0x0,
0x0, 0x0, 0x0, 0x3c0, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x3c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1e0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0x6c0, 0x380, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1ef0, 0xc60, 0xcc0, 0xd80, 0xf00,
0xf00, 0xd80, 0xcc0, 0xc60, 0xc30, 0x1e78, 0x0, 0x0,
0x0, 0x0, 0x0, 0xf00, 0x600, 0x600, 0x600, 0x600,
0x600, 0x600, 0x600, 0x618, 0x630, 0xff0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x381c, 0x1818, 0x1c38, 0x1c38, 0x1c38,
0x1e78, 0x1e78, 0x1bd8, 0x1bd8, 0x1998, 0x3dbc, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1c78, 0xc30, 0xe30, 0xf30, 0xf30,
0xdb0, 0xcf0, 0xcf0, 0xc70, 0xc30, 0x1e30, 0x0, 0x0,
0x0, 0x0, 0x0, 0x7c0, 0xc60, 0x1830, 0x1830, 0x1830,
0x1830, 0x1830, 0x1830, 0x1830, 0xc60, 0x7c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xfe0, 0x630, 0x630, 0x630, 0x630,
0x7e0, 0x600, 0x600, 0x600, 0x600, 0xf00, 0x0, 0x0,
0x0, 0x0, 0x0, 0x7c0, 0xc60, 0x1830, 0x1830, 0x1830,
0x1830, 0x1830, 0x1830, 0x1fb0, 0xce0, 0x7d8, 0x70, 0x0,
0x0, 0x0, 0x0, 0x1fc0, 0xc60, 0xc30, 0xc30, 0xc60,
0xfc0, 0xcc0, 0xc60, 0xc60, 0xc60, 0x1e78, 0x0, 0x0,
0x0, 0x0, 0x0, 0x7e0, 0xc60, 0xc30, 0xc00, 0x700,
0x1c0, 0x60, 0x30, 0xc30, 0x630, 0x7e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xff0, 0xdb0, 0x1998, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x3c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1e78, 0xc30, 0xc30, 0xc30, 0xc30,
0xc30, 0xc30, 0xc30, 0xc30, 0x660, 0x3c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1e78, 0xc30, 0xc30, 0x660, 0x660,
0x660, 0x3c0, 0x3c0, 0x3c0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x0, 0x3ffc, 0x1998, 0x1998, 0x1998, 0xff0,
0xff0, 0xff0, 0x7f0, 0x660, 0x660, 0x660, 0x0, 0x0,
0x0, 0x0, 0x0, 0xf78, 0x630, 0x360, 0x360, 0x1c0,
0x1c0, 0x1c0, 0x360, 0x360, 0x630, 0xf78, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1e78, 0xc30, 0x660, 0x660, 0x3c0,
0x3c0, 0x180, 0x180, 0x180, 0x180, 0x3c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xff0, 0xc60, 0x18c0, 0xc0, 0x180,
0x300, 0x600, 0x600, 0xc30, 0x1860, 0x1fe0, 0x0, 0x0,
0x0, 0x0, 0x1c0, 0x180, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x1c0, 0x0,
0x0, 0x0, 0x0, 0x1ffe, 0xccc, 0xccc, 0xccc, 0x1ffe,
0x7f8, 0x7f8, 0x3f0, 0x330, 0x330, 0x330, 0x0, 0x0,
0x0, 0x0, 0x380, 0x180, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x380, 0x0,
0x0, 0x0, 0x0, 0xc0, 0x1e0, 0x330, 0x618, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x7f8, 0x0, 0x0,
0x0, 0x0, 0x0, 0x300, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3c0,
0x660, 0x1e0, 0x360, 0x660, 0x6e0, 0x3f0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xe00, 0x600, 0x600, 0x600, 0x7c0,
0x660, 0x630, 0x630, 0x630, 0x660, 0x7c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0,
0x630, 0x600, 0x600, 0x600, 0x630, 0x3e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x70, 0x30, 0x30, 0x30, 0x1f0,
0x330, 0x630, 0x630, 0x630, 0x370, 0x1f8, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0,
0x630, 0x630, 0x7f0, 0x600, 0x630, 0x3e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xc0, 0x1e0, 0x180, 0x180, 0x3e0,
0x180, 0x180, 0x180, 0x180, 0x180, 0x3c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f0,
0x660, 0x660, 0x3c0, 0x600, 0x3e0, 0x630, 0x630, 0x3e0,
0x0, 0x0, 0x0, 0xe00, 0x600, 0x600, 0x600, 0x7c0,
0x760, 0x660, 0x660, 0x660, 0x660, 0xff0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x180, 0x180, 0x0, 0x0, 0x380,
0x180, 0x180, 0x180, 0x180, 0x180, 0x3c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0xc0, 0xc0, 0x0, 0x0, 0x1c0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x3c0, 0x180,
0x0, 0x0, 0x0, 0x700, 0x300, 0x300, 0x300, 0x3f0,
0x360, 0x3c0, 0x3e0, 0x360, 0x330, 0x7f8, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1c0, 0xc0, 0xc0, 0xc0, 0xc0,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x1e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1ff8,
0xecc, 0xccc, 0xccc, 0xccc, 0xccc, 0x1ffe, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7e0,
0x3b0, 0x330, 0x330, 0x330, 0x330, 0x7f8, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0,
0x630, 0x630, 0x630, 0x630, 0x630, 0x3e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7e0,
0x3b0, 0x318, 0x318, 0x318, 0x3b0, 0x3e0, 0x300, 0x780,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f8,
0x370, 0x630, 0x630, 0x630, 0x370, 0x1f0, 0x30, 0xf8,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7c0,
0x3e0, 0x300, 0x300, 0x300, 0x300, 0x780, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3e0,
0x660, 0x600, 0x3c0, 0x60, 0x660, 0x7c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x180, 0x180, 0x3e0,
0x180, 0x180, 0x180, 0x180, 0x180, 0xe0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xee0,
0x660, 0x660, 0x660, 0x660, 0x6e0, 0x3f0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff0,
0x660, 0x660, 0x3c0, 0x3c0, 0x180, 0x180, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3ffc,
0x1998, 0x1998, 0xff0, 0xff0, 0x660, 0x660, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f8,
0x330, 0x1e0, 0xc0, 0x1e0, 0x330, 0x7f8, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f8,
0x330, 0x330, 0x1e0, 0x1e0, 0xc0, 0xc0, 0x780, 0x700,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f0,
0x660, 0xc0, 0x180, 0x300, 0x630, 0x7e0, 0x0, 0x0,
0x0, 0x0, 0xc0, 0x180, 0x180, 0x180, 0x180, 0x180,
0x700, 0x180, 0x180, 0x180, 0x180, 0x180, 0xc0, 0x0,
0x0, 0x0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x0,
0x0, 0x0, 0x300, 0x180, 0x180, 0x180, 0x180, 0x180,
0xe0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x300, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xf98, 0x18f0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x7f0, 0x630, 0x630, 0x630, 0x630,
0x630, 0x630, 0x630, 0x630, 0x630, 0x7f0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x1f0, 0x330, 0x618, 0x600,
0xfe0, 0x600, 0xfe0, 0x618, 0x330, 0x1e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1f0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x30, 0x38, 0x8, 0x0,
0x0, 0x0, 0x0, 0x0, 0xc0, 0x1e0, 0x180, 0x180,
0x3e0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x780, 0x300,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x30, 0x38, 0x8, 0x30, 0x38, 0x8, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3198, 0x3198,
0x3198, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x800,
0x800, 0x800, 0x7ff8, 0x7ff8, 0x800, 0x800, 0x800, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x840,
0x840, 0x840, 0x7ff8, 0x7ff8, 0x840, 0x840, 0x840, 0x0,
0x0, 0x0, 0x0, 0x0, 0x180, 0x3c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0xe0, 0x1f0, 0x110, 0x1d0, 0x31f0, 0x3930,
0xd90, 0x1ff0, 0x3fe0, 0x27c0, 0x3170, 0x1f30, 0xe00, 0x0,
0x0, 0x0, 0x3c0, 0x180, 0x7e0, 0xc60, 0xc30, 0xc00,
0x780, 0xe0, 0x30, 0xc30, 0x630, 0x7e0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x440, 0x6c0, 0x380, 0x100, 0x0,
0x0, 0x0, 0x0, 0x0, 0xffc, 0x198c, 0x3186, 0x31b0,
0x31f0, 0x31b0, 0x3180, 0x3186, 0x198c, 0xffc, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1f0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x0, 0x0, 0x1e0, 0xc0, 0x7f8, 0x618, 0xc30, 0x60,
0xc0, 0x180, 0x300, 0x618, 0xc30, 0xff0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1f0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1f0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x0, 0x480, 0x780, 0x380, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x300, 0x3c0, 0x2c0, 0x0,
0x0, 0x480, 0x780, 0x380, 0x480, 0x780, 0x380, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x380, 0x3c0, 0x240, 0x300, 0x380, 0x280, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x180, 0x3c0, 0x3c0, 0x3c0, 0x180, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100,
0x0, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100,
0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x100,
0x0, 0x0, 0x0, 0x0, 0x760, 0xdc0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x8200, 0xfe00, 0xfe00, 0x7a00, 0x7a00, 0xfe00,
0xfe00, 0xe200, 0xe200, 0xfe00, 0xfe00, 0xe200, 0xe000, 0x0,
0x0, 0x0, 0x0, 0x0, 0x3c0, 0x180, 0x0, 0x3e0,
0x660, 0x600, 0x3c0, 0x60, 0x660, 0x7c0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x100, 0x380, 0x6c0, 0x440, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff0,
0x1998, 0x1998, 0x19f8, 0x1980, 0x1998, 0xff0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x1f0, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180, 0x180,
0x0, 0x0, 0x0, 0x0, 0x3c0, 0x180, 0x0, 0x7e0,
0xcc0, 0x180, 0x300, 0x300, 0x660, 0xfc0, 0x0, 0x0,
0x0, 0x0, 0x3c0, 0x0, 0x1e78, 0xc30, 0x660, 0x660,
0x3c0, 0x3c0, 0x180, 0x180, 0x180, 0x3c0, 0x0, 0x0,
};
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: ps2menu/ps2menu/images/ps2menu.PCX
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ps2menu/ps2menu/images/ps2menu.PCX
===================================================================
--- ps2menu/ps2menu/images/ps2menu.PCX (revision 0)
+++ ps2menu/ps2menu/images/ps2menu.PCX (revision 27)
/ps2menu/ps2menu/images/ps2menu.PCX
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: ps2menu/ps2menu/loader/loader.c
===================================================================
--- ps2menu/ps2menu/loader/loader.c (revision 26)
+++ ps2menu/ps2menu/loader/loader.c (revision 27)
@@ -16,6 +16,13 @@
#include "errno.h"
#include "libhdd.h"
+#define DEBUG
+#ifdef DEBUG
+#define dbgprintf(args...) scr_printf(args)
+#else
+#define dbgprintf(args...) do { } while(0)
+#endif
+
// ELF-loading stuff
#define ELF_MAGIC 0x464c457f
#define ELF_PT_LOAD 1
@@ -50,20 +57,10 @@
u32 align;
} elf_pheader_t;
-/* extern u8 *iomanX_irx;
-extern u8 *iomanX_irx_end;
-extern u8 *fileXio_irx;
-extern u8 *fileXio_irx_end;
-extern u8 *ps2dev9_irx;
-extern u8 *ps2dev9_irx_end;
-extern u8 *ps2atad_irx;
-extern u8 *ps2atad_irx_end;
-extern u8 *ps2hdd_irx;
-extern u8 *ps2hdd_irx_end;
-extern u8 *ps2fs_irx;
-extern u8 *ps2fs_irx_end; */
-extern u32 *_end;
+t_ExecData elfdata;
+extern u8 *fakehost_irx;
+extern int size_fakehost_irx;
int fileMode = FIO_S_IRUSR | FIO_S_IWUSR | FIO_S_IXUSR | FIO_S_IRGRP | FIO_S_IWGRP | FIO_S_IXGRP | FIO_S_IROTH | FIO_S_IWOTH | FIO_S_IXOTH;
char elfName[256];
@@ -70,25 +67,152 @@
char elfPath[256];
char HDDpath[256]="host:hddmenu.elf";
char partition[40];
-char iomanX_path[256];
-char fileXio_path[256];
-char ps2dev9_path[256];
-char ps2atad_path[256];
-char ps2hdd_path[256];
-char ps2fs_path[256];
const char *eeloadimg = "rom0:UDNL rom0:EELOADCNF";
char *imgcmd;
int elfhost=2,elfload=0;
-void LoadModules();
-void LoadAndRunMCElf(char *filename);
+static int pkoLoadElf(char *path);
+int userThreadID = 0;
+static char userThreadStack[16*1024] __attribute__((aligned(16)));
+
+#define MAX_ARGS 16
+#define MAX_ARGLEN 256
+
+struct argData
+{
+ int flag; // Contains thread id atm
+ int argc;
+ char *argv[MAX_ARGS];
+} __attribute__((packed)) userArgs;
+
+static int tLoadElf(char *filename)
+{
+ u8 *boot_elf = (u8 *)0x1800000;
+ elf_header_t *eh = (elf_header_t *)boot_elf;
+ elf_pheader_t *eph;
+
+ int fd, size, i, ret;
+
+ ret = fileXioMount("pfs0:", partition, FIO_MT_RDONLY);
+ if ((fd = fileXioOpen(filename, O_RDONLY, fileMode)) < 0)
+ {
+ dbgprintf("Failed in fileXioOpen %s\n",filename);
+ goto error;
+ }
+ dbgprintf("Opened file %s\n",filename);
+ size = fileXioLseek(fd, 0, SEEK_END);
+ dbgprintf("File size = %i\n",size);
+ if (!size)
+ {
+ dbgprintf("Failed in fileXioLseek\n");
+ fileXioClose(fd);
+ goto error;
+ }
+ fileXioLseek(fd, 0, SEEK_SET);
+ fileXioRead(fd, boot_elf, 52);
+ dbgprintf("Read elf header from file\n");
+ fileXioLseek(fd, (void *)eh->phoff, SEEK_SET);
+ eph = (elf_pheader_t *)(boot_elf + eh->phoff);
+ size=eh->phnum*eh->phentsize;
+ size=fileXioRead(fd, (void *)eph, size);
+ dbgprintf("Read %i bytes of program header(s) from file\n",size);
+ for (i = 0; i < eh->phnum; i++)
+ {
+ if (eph[i].type != ELF_PT_LOAD)
+ continue;
+
+ fileXioLseek(fd, eph[i].offset, SEEK_SET);
+ size=eph[i].filesz;
+ size=fileXioRead(fd, eph[i].vaddr, size);
+ dbgprintf("Read %i bytes to %x\n", size, eph[i].vaddr);
+ if (eph[i].memsz > eph[i].filesz)
+ memset(eph[i].vaddr + eph[i].filesz, 0,
+ eph[i].memsz - eph[i].filesz);
+ }
+
+ fileXioClose(fd);
+// fileXioUmount("pfs0:");
+/* Load the ELF into RAM. */
+
+ if (_lw((u32)&eh->ident) != ELF_MAGIC)
+ {
+ dbgprintf("Not a recognised ELF.\n");
+ goto error;
+ }
+
+// eph = (elf_pheader_t *)(boot_elf + eh->phoff);
+
+/* Scan through the ELF's program headers and copy them into RAM, then
+ zero out any non-loaded regions. */
+/* for (i = 0; i < eh->phnum; i++)
+ {
+ if (eph[i].type != ELF_PT_LOAD)
+ continue;
+
+ pdata = (void *)(boot_elf + eph[i].offset);
+ dbgprintf("vaddr=%x pdata=%x filesz=%x",eph[i].vaddr, pdata, eph[i].filesz);
+ memcpy(eph[i].vaddr, pdata, eph[i].filesz);
+
+ if (eph[i].memsz > eph[i].filesz)
+ memset(eph[i].vaddr + eph[i].filesz, 0,
+ eph[i].memsz - eph[i].filesz);
+ }*/
+ dbgprintf("entry=%x\n",eh->entry);
+ elfdata.epc=(int *)eh->entry;
+error:
+// while (1) ;
+
+ }
+
+////////////////////////////////////////////////////////////////////////
+// Load the actual elf, and create a thread for it
+// Return the thread id
+static int
+pkoLoadElf(char *path)
+{
+ ee_thread_t th_attr;
+ int ret=0;
+ int pid;
+
+ if(!strncmp(path, "host", 4)) ret = SifLoadElf(path, &elfdata);
+ else if(!strncmp(path, "mc0", 3)) ret = SifLoadElf(path, &elfdata);
+ else if(!strncmp(path, "pfs0", 4)) ret = tLoadElf(path);
+
+ FlushCache(0);
+ FlushCache(2);
+
+ dbgprintf("EE: LoadElf returned %d\n", ret);
+
+ dbgprintf("EE: Creating user thread (ent: %x, gp: %x, st: %x)\n",
+ elfdata.epc, elfdata.gp, elfdata.sp);
+
+ if (elfdata.epc == 0) {
+ dbgprintf("EE: Could not load file\n");
+ return -1;
+ }
+
+ th_attr.func = (void *)elfdata.epc;
+ th_attr.stack = userThreadStack;
+ th_attr.stack_size = sizeof(userThreadStack);
+ th_attr.gp_reg = (void *)elfdata.gp;
+ th_attr.initial_priority = 64;
+
+ pid = CreateThread(&th_attr);
+ if (pid < 0) {
+ dbgprintf("EE: Create user thread failed %d\n", pid);
+ return -1;
+ }
+ dbgprintf("EE: Created user thread: %d\n", pid);
+
+ return pid;
+}
+
void
wipeUserMem(void)
{
int i;
- // Whipe user mem
for (i = 0x100000; i < 0x2000000 ; i += 64) {
asm (
"\tsq $0, 0(%0) \n"
@@ -99,6 +223,14 @@
}
}
+void poweroffHandler(int i)
+{
+ dbgprintf("Trying to delete thread %i\n",i);
+ TerminateThread(i);
+ DeleteThread(i);
+ hddPowerOff();
+ }
+
char *strrchr(const char *sp, int i)
{
const char *last = NULL;
@@ -121,59 +253,28 @@
return (char *) last;
}
-static void
-setPathInfo(char *path)
-{
- char *ptr;
-
- strncpy(elfName, path, 255);
- strncpy(elfPath, path, 255);
- elfName[255] = '\0';
- elfPath[255] = '\0';
-
-
- ptr = strrchr(elfPath, '/');
- if (ptr == NULL) {
- ptr = strrchr(elfPath, '\\');
- if (ptr == NULL) {
- ptr = strrchr(elfPath, ':');
- if (ptr == NULL) {
- scr_printf("Did not find path (%s)!\n", path);
- SleepThread();
- }
- }
- }
-
- ptr++;
- *ptr = '\0';
-
- /* Paths to modules. */
- sprintf(iomanX_path, "%s%s", elfPath, "IOMANX.IRX");
- sprintf(ps2dev9_path, "%s%s", elfPath, "PS2DEV9.IRX");
- sprintf(fileXio_path, "%s%s", elfPath, "FILEXIO.IRX");
- sprintf(ps2atad_path, "%s%s", elfPath, "PS2ATAD.IRX");
- sprintf(ps2hdd_path, "%s%s", elfPath, "PS2HDD.IRX");
- sprintf(ps2fs_path, "%s%s", elfPath, "PS2FS.IRX");
- sprintf(HDDpath, "%s%s", elfPath, "HDDMENU.ELF");
- }
-
// *************************************************************************
// *** MAIN
// *************************************************************************
int main(int argc, char *argv[])
{
- char s[256];
+ char s[256],fakepart[128], *ptr;
+ int pid,ret;
// Initialise
SifInitRpc(0);
+ hddPreparePoweroff();
+ hddSetUserPoweroffCallback((void *)poweroffHandler,(void *)userThreadID);
init_scr();
- scr_printf("Welcome to PS2Menu v1.0\nPlease wait...loading.\n");
+ wipeUserMem();
+ scr_printf("Welcome to PS2Menu Loader v2.0\nPlease wait...loading.\n");
strcpy(s,argv[0]);
+ dbgprintf("argv[0] = %s\n",s);
if (argc==1)
{ // hopefully this is the first
- // time loader has run
- setPathInfo(s);
+ while(1);
+/* setPathInfo(s);
if(!strncmp(s, "host:", 5)) elfload=1; // assume loading from PS2LINK
else if(!strncmp(s, "mc0:", 4)) // loading from memory card
{
@@ -193,13 +294,14 @@
strcpy(elfName,s);
LoadModules();
+ LoadAndRunMCElf(HDDpath);*/
}
if (argc==2) // if call came from hddmenu.elf
{
strcpy(partition,argv[1]);
- printf("argv[1] = %s\n", partition);
+ dbgprintf("argv[1] = %s\n", partition);
- if(hddCheckPresent() < 0)
+/* if(hddCheckPresent() < 0)
{
scr_printf("Error: supported HDD not connected!\n");
while(1);
@@ -209,23 +311,53 @@
scr_printf("Error: HDD is not properly formatted!\n");
while(1);
}
- scr_printf("HDD is connected and formatted.\n");
+ scr_printf("HDD is connected and formatted.\n");*/
strcpy(HDDpath,s);
elfhost=1;
}
- scr_printf("HDDmenu module\n");
- LoadAndRunMCElf(HDDpath);
- return 0;
- SleepThread();
-error:
- return -1;
+ dbgprintf("Loading %s\n",HDDpath);
+ pid = pkoLoadElf(HDDpath);
+ dbgprintf("pkoLoadElf returned %i\n",pid);
+ if (pid < 0) {
+ scr_printf("Could not execute file %s\n", HDDpath);
+ return -1;
+ }
+ strcpy(fakepart,HDDpath);
+ ptr=strrchr(fakepart,'/');
+ if(ptr==NULL) strcpy(fakepart,"pfs0:");
+ else
+ {
+ ptr++;
+ *ptr='\0';
+ }
+ scr_printf("Loading fakehost.irx %i bytes\n", size_fakehost_irx);
+ scr_printf("%s\n", fakepart);
+ SifExecModuleBuffer(&fakehost_irx, size_fakehost_irx, strlen(fakepart), fakepart, &ret);
+
+ FlushCache(0);
+ FlushCache(2);
+
+ userThreadID = pid;
+
+ userArgs.argc=2;
+ userArgs.argv[0]=HDDpath;
+ userArgs.argv[1]=elfName;
+ userArgs.flag = (int)&userThreadID;
+
+ ret = StartThread(userThreadID, &userArgs);
+ if (ret < 0) {
+ scr_printf("EE: Start user thread failed %d\n", ret);
+ DeleteThread(userThreadID);
+ return -1;
+ }
+ SleepThread();
}
////////////////////////////////////////////////////////////////////////
// Wrapper to load module from disc/rom/mc
// Max irx size hardcoded to 300kb atm..
-static void
+/*static void
pkoLoadMcModule(char *path, int argc, char *argv)
{
void *iop_mem;
@@ -234,18 +366,18 @@
scr_printf("LoadMcModule %s\n", path);
iop_mem = SifAllocIopHeap(1024*300);
if (iop_mem == NULL) {
- scr_printf("allocIopHeap failed\n");
+ scr_printf("SifallocIopHeap failed\n");
SleepThread();
}
ret = SifLoadIopHeap(path, iop_mem);
if (ret < 0) {
- scr_printf("loadIopHeap %s ret %d\n", path, ret);
+ scr_printf("SifloadIopHeap %s ret %d\n", path, ret);
SleepThread();
}
else {
ret = SifLoadModuleBuffer(iop_mem, argc, argv);
if (ret < 0) {
- scr_printf("loadModuleBuffer %s ret %d\n", path, ret);
+ scr_printf("SifloadModuleBuffer %s ret %d\n", path, ret);
SleepThread();
}
}
@@ -268,44 +400,14 @@
void LoadModules()
{
-/* int ret,fd,size;
- int size_iomanX_irx;
- int size_fileXio_irx;
- int size_ps2dev9_irx;
- int size_ps2atad_irx;
- int size_ps2hdd_irx;
- int size_ps2fs_irx; */
-
static char hddarg[] = "-o" "\0" "4" "\0" "-n" "\0" "20";
- static char pfsarg[] = "-m" "\0" "4" "\0" "-o" "\0" "10" "\0" "-n" "\0" "40" /*"\0" "-debug"*/;
+ static char pfsarg[] = "-m" "\0" "4" "\0" "-o" "\0" "10" "\0" "-n" "\0" "40";
-/* size_iomanX_irx=&iomanX_irx_end-&iomanX_irx;
- size_fileXio_irx=&fileXio_irx_end-&fileXio_irx;
- size_ps2dev9_irx=&ps2dev9_irx_end-&ps2dev9_irx;
- size_ps2atad_irx=&ps2atad_irx_end-&ps2atad_irx;
- size_ps2hdd_irx=&ps2hdd_irx_end-&ps2hdd_irx;
- size_ps2fs_irx=&ps2fs_irx_end-&ps2fs_irx; */
-
if(elfload==2)
{
-/* scr_printf("Loading iomanX.irx %i bytes\n", size_iomanX_irx);
- SifExecModuleBuffer(&iomanX_irx, size_iomanX_irx, 0, NULL, &ret);
- scr_printf("Loading fileXio.irx %i bytes\n", size_fileXio_irx);
- SifExecModuleBuffer(&fileXio_irx, size_fileXio_irx, 0, NULL, &ret);
- scr_printf("Loading ps2dev9.irx %i bytes\n", size_ps2dev9_irx);
- SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, &ret);
- scr_printf("Loading ps2atad.irx %i bytes\n", size_ps2atad_irx);
- SifExecModuleBuffer(&ps2atad_irx, size_ps2atad_irx, 0, NULL, &ret);
- scr_printf("Loading ps2hdd.irx %i bytes\n", size_ps2hdd_irx);
- SifExecModuleBuffer(&ps2hdd_irx, size_ps2hdd_irx, sizeof(hddarg), hddarg, &ret);
- scr_printf("Loading ps2fs.irx %i bytes\n", size_ps2fs_irx);
- SifExecModuleBuffer(&ps2fs_irx, size_ps2fs_irx, sizeof(pfsarg), pfsarg, &ret); */
-
SifLoadModule("rom0:SIO2MAN", 0, NULL);
SifLoadModule("rom0:MCMAN", 0, NULL);
pkoLoadMcModule(iomanX_path, 0, NULL);
-// SifLoadModule(iomanX_path, 0, NULL);
-// pkoLoadMcModule("mc0:/BWLINUX/POWEROFF.IRX", 0, NULL);
pkoLoadMcModule(fileXio_path, 0, NULL);
pkoLoadMcModule(ps2dev9_path, 0, NULL);
pkoLoadMcModule(ps2atad_path, 0, NULL);
@@ -318,15 +420,6 @@
pkoSifLoadModule(ps2atad_path, 0, NULL);
pkoSifLoadModule(ps2hdd_path, sizeof(hddarg), hddarg);
pkoSifLoadModule(ps2fs_path, sizeof(pfsarg), pfsarg);
-
-/* scr_printf("Loading fileXio.irx %i bytes\n", size_fileXio_irx);
- SifExecModuleBuffer(&fileXio_irx, size_fileXio_irx, 0, NULL, &ret);
- scr_printf("Loading ps2atad.irx %i bytes\n", size_ps2atad_irx);
- SifExecModuleBuffer(&ps2atad_irx, size_ps2atad_irx, 0, NULL, &ret);
- scr_printf("Loading ps2hdd.irx %i bytes\n", size_ps2hdd_irx);
- SifExecModuleBuffer(&ps2hdd_irx, size_ps2hdd_irx, sizeof(hddarg), hddarg, &ret);
- scr_printf("Loading ps2fs.irx %i bytes\n", size_ps2fs_irx);
- SifExecModuleBuffer(&ps2fs_irx, size_ps2fs_irx, sizeof(pfsarg), pfsarg, &ret); */
}
}
@@ -340,7 +433,7 @@
int fd, size, i, ret;
char *argv[1];
- scr_printf("Start of LoadAndRunElf\nelfhost=%i\nfilename=%s\n",elfhost,filename);
+ dbgprintf("Start of LoadAndRunElf\nelfhost=%i\nfilename=%s\n",elfhost,filename);
if(elfhost==1)
{
@@ -385,7 +478,6 @@
if(fioRead(fd, boot_elf, size)<0) scr_printf("Error in Read.\n");
if(fioClose(fd)<0) scr_printf("Error in Close.\n");
}
-/* Load the ELF into RAM. */
if (_lw((u32)&eh->ident) != ELF_MAGIC)
{
goto error;
@@ -393,8 +485,6 @@
eph = (elf_pheader_t *)(boot_elf + eh->phoff);
-/* Scan through the ELF's program headers and copy them into RAM, then
- zero out any non-loaded regions. */
for (i = 0; i < eh->phnum; i++)
{
if (eph[i].type != ELF_PT_LOAD)
@@ -401,7 +491,6 @@
continue;
pdata = (void *)(boot_elf + eph[i].offset);
- scr_printf("%x %x %x\n",eph[i].vaddr,pdata,eph[i].filesz);
memcpy(eph[i].vaddr, pdata, eph[i].filesz);
if (eph[i].memsz > eph[i].filesz)
@@ -409,14 +498,9 @@
eph[i].memsz - eph[i].filesz);
}
-/* Let's go. */
scr_printf("Starting %s\n",elfName);
-// fioExit(); //*
- SifExitRpc(); //*
-// while(!SifIopSync());
-// SifResetIop(); //*
-// while(!SifIopSync());
+ SifExitRpc();
SifInitRpc(0);
SifExitRpc();
FlushCache(0);
@@ -428,4 +512,4 @@
error:
while (1) ;
- }
\ No newline at end of file
+ }*/
\ No newline at end of file
/trunk/ps2menu/ps2menu/loader/Makefile
9,7 → 9,7
-fshort-double -mlong64 -mhard-float -mno-abicalls -O2 -EL -Wall \
-c $(EE_INCS) $(EE_CFLAGS)
EE_ASFLAGS := -EL -G0 $(EE_ASFLAGS)
LOADADDR = 0xa0000
LOADADDR = 0x90000
STACKADDR = 0xb0000
ifeq ($(DEBUG),1)
LOADADDR = 0x1700000
20,13 → 20,16
 
EE_LDFLAGS := $(EE_LDFLAGS) -L$(LIBHDD)/ee/lib -L$(PS2DRV)/ee/libfileXio \
-L$(PS2LIB)/ee/lib -T$(PS2LIB)/ee/startup/linkfile -nostartfiles
EE_BIN = ../../bin/PS2MENU.ELF
EE_OBJS = loader.o
EE_BIN = ../../bin/LOADER.ELF
EE_OBJS = loader.o fakehost.o
 
EE_LIBS = -lmc -lhdd -lfileXio
 
all: $(EE_BIN)
 
fakehost.s:
bin2s $(PS2DRV)/iop/fakehost/fakehost.irx fakehost.s fakehost_irx
 
clean:
rm -f *.elf *.o *.a
 
/trunk/ps2menu/ps2menu/ps2menu.c
New file
0,0 → 1,1565
/*
PS2Menu
Adam Metcalf 2003
Thomas Hawcroft 2003/4 - changes to make stable code
- added host file copy list - through elflist.txt
- dos command "dir *.elf /b /s >elflist.txt"
- added scrolling filelist and screen text clipping
- added partition/volume switching via PAD L1 button
- added create folder on pfs0: via PAD SQUARE button
- added on screen keyboard function
- added pfs0: directory changing via PAD CROSS button
- added delete file or empty folder via PAD CIRCLE button
- added a user confirmation option
- added drawline functions to tart-up display
- added PCX import and display functions
- changed display resolution to 512x512
 
based on mcbootmenu.c
and libhdd v1
*/
 
#include "tamtypes.h"
#include "kernel.h"
#include "sifrpc.h"
#include "loadfile.h"
#include "fileio.h"
#include "iopcontrol.h"
#include "hw.h"
#include "hardware.h"
#include "font5200.c"
#include "fontset.c"
#include "stdarg.h"
#include "string.h"
#include "malloc.h"
#include "libpad.h"
#include "libmc.h"
#include "iopheap.h"
#include "sys/fcntl.h"
#include "sys/stat.h"
#include "sys/ioctl.h"
#include "fileXio_rpc.h"
#include "errno.h"
#include "libhdd.h"
 
static char padBuf[256] __attribute__((aligned(64)));
 
#define DEBUG
#ifdef DEBUG
#define dbgprintf(args...) printf(args)
#else
#define dbgprintf(args...) do { } while(0)
#endif
 
// ELF-loading stuff
#define ELF_MAGIC 0x464c457f
#define ELF_PT_LOAD 1
 
typedef struct
{
u8 ident[16];
u16 type;
u16 machine;
u32 version;
u32 entry;
u32 phoff;
u32 shoff;
u32 flags;
u16 ehsize;
u16 phentsize;
u16 phnum;
u16 shentsize;
u16 shnum;
u16 shstrndx;
} elf_header_t;
 
typedef struct
{
u32 type;
u32 offset;
void *vaddr;
u32 paddr;
u32 filesz;
u32 memsz;
u32 flags;
u32 align;
} elf_pheader_t;
 
extern u8 *iomanx_irx;
extern int size_iomanx_irx;
extern u8 *filexio_irx;
extern int size_filexio_irx;
extern u8 *ps2dev9_irx;
extern int size_ps2dev9_irx;
extern u8 *ps2atad_irx;
extern int size_ps2atad_irx;
extern u8 *ps2hdd_irx;
extern int size_ps2hdd_irx;
extern u8 *ps2fs_irx;
extern int size_ps2fs_irx;
extern u8 *poweroff_irx;
extern int size_poweroff_irx;
extern u8 *iuntar_irx;
extern int size_iuntar_irx;
extern u8 *loader_elf;
extern int size_loader_elf;
extern u8 *ps2menu_pcx;
extern int size_ps2menu_pcx;
//extern u8 *mainlogo_pcx;
//extern int size_mainlogo_pcx;
 
extern void *_end;
 
#define TYPE_MC
//#define TYPE_XMC
#define ROM_PADMAN
//#define DOWEFORMAT //
// Only remove '//' if we really don't
// mind wiping incompatible filesystem
 
//#define WIDTH 366
//#define HEIGHT 256
#define WIDTH 512
#define HEIGHT 512
#define FRAMERATE 4
#define STATUS_Y 432
#define MAX_PARTITIONS 10
 
unsigned char *Img; // pntr to blit buffer
int g_nWhichBuffer = 0;
int show_logo = 0;
int paletteindex = 0;
char sStatus[256];
char foldername[26]="\0";
 
iox_dirent_t dirbuf __attribute__((aligned(16)));
char HDDfiles[128][256];
unsigned int HDDstats[128];
int fileMode = FIO_S_IRUSR | FIO_S_IWUSR | FIO_S_IXUSR | FIO_S_IRGRP | FIO_S_IWGRP | FIO_S_IXGRP | FIO_S_IROTH | FIO_S_IWOTH | FIO_S_IXOTH;
char HDDpath[256];
t_hddFilesystem parties[MAX_PARTITIONS] __attribute__((aligned(64)));
 
void drawChar(char c, int x, int y, unsigned int colour);
void printXY(char *s, int x, int y, unsigned int colour);
void drawHorizontal(int x, int y, int length, unsigned int colour);
void drawVertical(int x, int y, int length, unsigned int colour);
int do_select_menu(void);
int showDir(char *dir);
int dowereformat();
void ReadHDDFiles();
void LoadModules();
void LoadAndRunMCElf(char *filename);
void MenuKeyboard(char *s);
 
#define ARRAY_ENTRIES 64
int num_hdd_files,elfhost=1,party=0,nparty;
unsigned char romver[16];
int topfil=0, elfload=0;
 
int checkELFheader(char *filename)
{
u8 *boot_elf = (u8 *)0x1800000;
elf_header_t *eh = (elf_header_t *)boot_elf;
elf_pheader_t *eph;
 
int fd, size, i, ret;
char fullpath[256];
 
ret = fileXioMount("pfs0:", parties[party].filename, FIO_MT_RDONLY);
strcpy(fullpath,HDDpath);
strcat(fullpath,filename);
if ((fd = fileXioOpen(fullpath, O_RDONLY, fileMode)) < 0)
{
dbgprintf("Failed in fileXioOpen %s\n",fullpath);
goto error;
}
dbgprintf("Opened file %s\n",fullpath);
size = fileXioLseek(fd, 0, SEEK_END);
dbgprintf("File size = %i\n",size);
if (!size)
{
dbgprintf("Failed in fileXioLseek\n");
fileXioClose(fd);
goto error;
}
fileXioLseek(fd, 0, SEEK_SET);
fileXioRead(fd, boot_elf, 52);
dbgprintf("Read elf header from file\n");
fileXioClose(fd);
fileXioUmount("pfs0:");
 
if (_lw((u32)&eh->ident) != ELF_MAGIC)
{
dbgprintf("Not a recognised ELF.\n");
goto error;
}
return 1;
error:
return -1;
}
 
void clrEmuScreen(unsigned char colour)
{
unsigned char *pp;
unsigned int numbytes;
 
pp = pScreen;
numbytes = g_nScreen_X * g_nScreen_Y;
while(numbytes--) *pp++ = colour;
}
 
// draw a char using the system font
void drawChar(char c, int x, int y, unsigned int colour)
{
unsigned int i, j;
unsigned char cc;
unsigned char *pp;
unsigned char *pc;
 
// set character pointer
pc = &font5200[(c-32)*8];
 
// set screen pointer
pp = pScreen + x + (g_nScreen_X * y);
for(i=0; i<8; i++) {
cc = *pc++;
for(j=0; j<8; j++) {
if(cc & 0x80) *pp = colour;
cc = cc << 1;
pp++;
}
pp += (g_nScreen_X - 8);
}
}
 
void drawBIGChar(char c, int x, int y, unsigned int font, unsigned int colour)
{
unsigned int i, j;
u16 cc;
unsigned char *pp;
u16 *pc;
 
if(font>1) font=1;
// set character pointer
pc = &fontset[((c-32)*16)+(font*2048)];
 
// set screen pointer
pp = pScreen + x + (g_nScreen_X * y);
for(i=0; i<16; i++) {
cc = *pc++;
// cc = cc<<8;
// cc = cc + *pc++;
for(j=0; j<16; j++) {
if(cc & 0x8000) *pp = colour;
cc = cc << 1;
pp++;
}
pp += (g_nScreen_X - 16);
}
}
 
 
void drawHorizontal(int x, int y, int length, unsigned int colour)
{
unsigned char *pp;
unsigned int i;
 
pp = pScreen + x + (g_nScreen_X * y);
for(i=0; i<length; i++)
{
*pp = colour;
pp++;
}
}
 
void drawVertical(int x, int y, int length, unsigned int colour)
{
unsigned char *pp;
unsigned int i;
 
pp = pScreen + x + (g_nScreen_X * y);
for(i=0; i<length; i++)
{
*pp = colour;
pp += (g_nScreen_X);
}
}
 
// draw a string of characters
void printXY(char *s, int x, int y, unsigned int colour)
{
while(*s) {
drawChar(*s++, x, y, colour);
x += 8;
if(x>=502)
{
x=0;
y=y+8;
}
}
}
 
// draw a string of characters
void printBIGXY(char *s, int x, int y, unsigned int font, unsigned int colour)
{
while(*s) {
drawBIGChar(*s++, x, y, font, colour);
x += 12;
if(x>=502)
{
x=0;
y=y+16;
}
}
}
 
void PutImage(void)
{
// U8 *pScr;
// U8 *pLine;
// int x, y;
 
UpdateScreen(); // uploads+and renders new screen.
// (palette is also updated every frame for effects)
while (TestVRstart() < FRAMERATE); // wait for FRD number of vblanks
ClearVRcount();
g_nWhichBuffer ^= 1;
SetupScreen( g_nWhichBuffer ); // FLIP!!!
}
 
void drawPCX(u8 *pcxfile, int pcxlength, int xpos, int ypos)
{
typedef struct
{
unsigned char manufacturer;
unsigned char version;
unsigned char encoding;
unsigned char bitsperpel;
unsigned short xmin;
unsigned short ymin;
unsigned short xmax;
unsigned short ymax;
unsigned short hrez;
unsigned short vrez;
unsigned char colormap[48];
unsigned char reserved;
unsigned char nplanes;
unsigned short bytesperline;
unsigned short paletteinfo;
unsigned char padding[58];
} pcxHead;
 
pcxHead *pcxHeader;
unsigned char *pp;
unsigned char *colors;
int palette,color,num;
int xsize,ysize,row,col,imagelength;
 
pcxHeader=pcxfile;
xsize=(pcxHeader->xmax-pcxHeader->xmin)+1;
ysize=(pcxHeader->ymax-pcxHeader->ymin)+1;
imagelength=pcxlength-(128+769);
colors=(unsigned char *)pcxfile+128;
color=0;
for(row=0;row<ysize;row++)
{
pp = pScreen + xpos + (g_nScreen_X * (ypos+row));
for(col=0;col<xsize;col++)
{
if(colors[color] >= 192)
{
num=colors[color] - 192;
color++;
col--;
for(num=num;num>0;num--)
{
*pp=(colors[color]+pcxHeader->reserved);
pp++;
col++;
}
color++;
}
else
{
*pp=(colors[color]+pcxHeader->reserved);
pp++;
color++;
}
}
}
}
 
void readPCXheader(u8 *pcxfile, int pcxlength)
{
typedef struct
{
unsigned char manufacturer;
unsigned char version;
unsigned char encoding;
unsigned char bitsperpel;
unsigned short xmin;
unsigned short ymin;
unsigned short xmax;
unsigned short ymax;
unsigned short hrez;
unsigned short vrez;
unsigned char colormap[48];
unsigned char reserved;
unsigned char nplanes;
unsigned short bytesperline;
unsigned short paletteinfo;
unsigned char padding[58];
} pcxHead;
 
pcxHead *pcxHeader;
unsigned char *colors;
int palette,color,num;
 
pcxHeader=pcxfile;
/* printf("pcxfile =%x\n",pcxfile);
if(pcxHeader->manufacturer==10) printf("ZSoft .PCX\n");
else printf("Unknown manufacturer = %i!",pcxHeader->manufacturer);
printf("Version ");
switch(pcxHeader->version)
{
case 0:
printf("2.5\n");
break;
case 2:
printf("2.8 w/palette information\n");
break;
case 3:
printf("2.8 w/o palette information\n");
break;
case 5:
printf("3.0\n");
break;
default:
printf("unknown!\n");
}
if(pcxHeader->encoding==1) printf(".PCX run length encoding\n");
printf("Bits per pixel = %i\n",pcxHeader->bitsperpel);
printf("Xmin = %i , Ymin = %i\n", pcxHeader->xmin, pcxHeader->ymin);
printf("Xmax = %i , Ymax = %i\n", pcxHeader->xmax, pcxHeader->ymax);
printf("Horizontal Resolution of creating device = %i\n", pcxHeader->hrez);
printf("Vertical Resolution of creating device = %i\n", pcxHeader->vrez);
printf("Number of color planes = %i\n", pcxHeader->nplanes);
printf("Bytes per line = %i\n", pcxHeader->bytesperline);
switch(pcxHeader->paletteinfo)
{
case 1:
printf("Color/BW ");
break;
case 2:
printf("Grayscale ");
break;
default:
printf("Unknown ");
}
printf("palette interpretation\n");*/
if(pcxHeader->nplanes==1) // check for 256 color palette
{
palette=pcxlength-769;
colors=(unsigned char *)pcxfile+(pcxlength-769);
 
if(colors[0]==12)
{
// printf("Found palette preceder value %i\n",colors[0]);
num=paletteindex;
pcxHeader->reserved=paletteindex;
for(color=1;color<(256*3);color=color+3)
{
// printf("R%x:G%x:B%x:",colors[color],colors[color+1],colors[color+2]);
if(((colors[color] + colors[color+1]) + colors[color+2])==0) color=(256*3);
else
{
SetPaletteEntry(((colors[color+2]<<16)+(colors[color+1]<<8))+(colors[color]), num);
}
num++;
}
num--;
// printf("Found %i colors in palette\n",(num-paletteindex));
paletteindex=num;
}
// else printf("Are we looking in the right place? %i\n",colors[0]);
}
}
 
void GetROMVersion(void)
{
int fd = fioOpen("rom0:ROMVER", O_RDONLY);
fioRead(fd, romver, sizeof romver);
fioClose(fd);
romver[15] = 0;
}
 
int dowereformat()
{
int ret;
 
#ifdef DOWEFORMAT
printf("This will erase all data on the HDD!!!\n");
if (hddFormat() < 0)
{
printf("ERROR: could not format HDD!\n");
return -1;
}
else
{
printf("HDD is connected and formatted.\n");
}
#endif
ret = hddMakeFilesystem(4096, "PS2MENU", FS_GROUP_COMMON);
if (ret < 0)
{
printf("ERROR: failed to create PS2MENU filesystem: %d\n", ret);
return -1;
}
else
{
printf("Created PS2MENU filesystem with size: %dMB.\n",ret);
}
 
return 1;
}
 
void ReadHDDFiles()
{
int rv,fd=0;
char filesname[256];
 
rv = fileXioMount("pfs0:", parties[party].filename, FIO_MT_RDONLY);
if(rv < 0)
{
printf("ERROR: failed to mount filesystem: %d\n", rv);
}
if(rv == 0)
{
fd = fileXioDopen(HDDpath);
num_hdd_files=0;
while((rv=fileXioDread(fd, &dirbuf)))
{
strcpy(filesname, (char *)&dirbuf.name);
sprintf (HDDfiles[num_hdd_files],"%s",filesname);
HDDstats[num_hdd_files]=dirbuf.stat.mode;
if ((HDDstats[num_hdd_files] & FIO_S_IFDIR) || (HDDstats[num_hdd_files] & FIO_S_IFREG)) num_hdd_files++;
}
}
fileXioDclose(fd);
fileXioUmount("pfs0:");
}
 
char *strrchr(const char *sp, int i)
{
const char *last = NULL;
char c = i;
 
while (*sp)
{
if (*sp == c)
{
last = sp;
}
sp++;
}
 
if (*sp == c)
{
last = sp;
}
 
return (char *) last;
}
 
void PrintHDDFiles(int highlighted)
{
int i,texcol,nchars,maxrows,maxchars;
char s[256];
char textfit[(WIDTH/12)-2];
char *ptr;
 
texcol=1;
maxrows=20;
maxchars=(WIDTH/12)-3;
textfit[maxchars+1]='\0';
for(i=0; i<num_hdd_files && i < maxrows; i++)
{
ptr = strrchr(HDDfiles[i+topfil], '/');
if (ptr == NULL)
{
ptr = strrchr(HDDfiles[i+topfil], '\\');
if (ptr == NULL)
{
ptr = strrchr(HDDfiles[i+topfil], ':');
}
}
 
if(ptr == NULL)
{
if ((HDDstats[i+topfil])&FIO_S_IFDIR)
{
strncpy(s, HDDfiles[i+topfil], maxchars-6);
strcat(s, " (dir)");
}
if ((HDDstats[i+topfil])&FIO_S_IFREG)
{
strncpy(s, HDDfiles[i+topfil], maxchars);
}
}
else
{
ptr++;
if ((HDDstats[i+topfil])&FIO_S_IFDIR)
{
strncpy(s, ptr, maxchars-6);
strcat(s, " (dir)");
}
if ((HDDstats[i+topfil])&FIO_S_IFREG)
{
strncpy(s, ptr, maxchars);
}
}
if(highlighted == i+topfil) texcol=2; //s[0] = '*';
printBIGXY(s, 16, i*16 + 40, 0, texcol);
// else printXY(s, 16, i*8 + 40, texcol);
texcol=1;
}
}
 
void ReadHostDir(void)
{
int fd,rv,elflist_size,pathlen;
char* elflist_buffer;
char botcap;
 
num_hdd_files=0;
fd=fioOpen("host:elflist.txt", O_RDONLY);
if(fd<=0)
{
printf("elflist.txt not found on host.\n");
}
else
{
elflist_size=fioLseek(fd,0,SEEK_END);
fioLseek(fd,0,SEEK_SET);
elflist_buffer = malloc(elflist_size);
fioRead(fd, elflist_buffer, elflist_size);
fioClose(fd);
free(elflist_buffer);
for(pathlen=0;pathlen<257;pathlen++)
{
HDDfiles[num_hdd_files][pathlen]=(0x00);
}
pathlen=5;
strcpy(HDDfiles[num_hdd_files],"host:");
for(rv=0;rv<elflist_size;rv++)
{
botcap=(elflist_buffer[rv]);
if(botcap==(0x0d))
{
rv=rv++;
HDDstats[num_hdd_files]=FIO_S_IFREG;
num_hdd_files++;
for(pathlen=0;pathlen<257;pathlen++)
{
HDDfiles[num_hdd_files][pathlen]=(0x00);
}
if(rv<elflist_size)
{
pathlen=5;
strcpy(HDDfiles[num_hdd_files],"host:");
}
}
else
{
// if((botcap==0x5c)) botcap='/';
// if((botcap==0x3a))
// {
// pathlen--;
// pathlen--;
// rv++;
// }
HDDfiles[num_hdd_files][pathlen]=botcap; // else
pathlen++;
}
}
}
}
 
int tomcopy(char *sourcefile)
{
int ret;
int boot_fd;
size_t boot_size;
char *boot_buffer, *ptr, *argv[2];
char empty='\0',destination[256],filetype[32];
static char iuntar[512];
 
ptr = strrchr(sourcefile, '/');
if (ptr == NULL)
{
ptr = strrchr(sourcefile, '\\');
if (ptr == NULL)
{
ptr = strrchr(sourcefile, ':');
}
}
ptr++;
 
strcpy(destination,"pfs0:");
strcpy(destination,HDDpath);
strcat(destination,ptr);
ptr = strrchr(sourcefile, '.');
if (ptr != NULL)
{
ptr++;
strcpy(filetype,ptr);
if((!strncmp(filetype,"tgz",3))||(!strncmp(filetype,"tar",3))||(!strncmp(filetype,"gz",2)))
{
argv[1]=sourcefile;
argv[2]=parties[party].filename;
printf("Loading %s %s\n", argv[1],argv[2]);
sprintf(iuntar,"%s%c%s", argv[1], empty, argv[2]);
SifExecModuleBuffer(&iuntar_irx, size_iuntar_irx, strlen(argv[1])+strlen(argv[2])+1, iuntar, &ret);
return ret;
}
}
 
fileXioMount("pfs0:", parties[party].filename, FIO_MT_RDWR);
boot_fd = fioOpen(sourcefile, O_RDONLY);
if(boot_fd <= 0)
{
printf("Open %s Failed\n",sourcefile);
return boot_fd;
}
else
{
boot_size = fioLseek(boot_fd,0,SEEK_END);
fioLseek(boot_fd,0,SEEK_SET);
boot_buffer = malloc(boot_size);
if ((boot_buffer)==NULL)
{
// boot_fd2 = fileXioOpen(destination, O_WRONLY | O_TRUNC | O_CREAT, fileMode);
// if(boot_fd2 < 0)
// {
// printf("Open %s Failed\n",destination);
// }
// else
// {
// while(boot_size>=128)
// {
// boot_size=boot_size-128;
// fioRead(boot_fd, &sStatus, 128);
// printf("%i%s\n", boot_size, sStatus);
// fileXioWrite(boot_fd2,&sStatus,128);
// }
// if(boot_size>0)
// {
// fioRead(boot_fd,&sStatus,boot_size);
// fileXioWrite(boot_fd2,&sStatus,boot_size);
// }
// fileXioClose(boot_fd2);
// } The above 'chunk copy' was removed because it appeared not to work
fioClose(boot_fd);
return -1; // a file too big for memory cannot be copied
}
fioRead(boot_fd, boot_buffer, boot_size);
fioClose(boot_fd);
free(boot_buffer);
}
boot_fd = fileXioOpen(destination, O_WRONLY | O_TRUNC | O_CREAT, fileMode);
ret = boot_fd;
if(boot_fd < 0)
{
printf("Open %s Failed\n",destination);
}
else
{
ret = fileXioWrite(boot_fd,boot_buffer,boot_size);
fileXioClose(boot_fd);
}
fileXioUmount("pfs0:");
return ret;
}
 
void ReDraw(int highlighted)
{
int cols,numc;
char txt[2];
char fullpath[262];
 
txt[1]='\0';
numc=1;
clrEmuScreen(0);
/* for(cols=0;cols<(WIDTH>>4);cols++)
{
txt[0]=(numc+'0');
if(numc==0)
{
printBIGXY(txt, cols*8, 320, 1, 2);
printBIGXY(txt, 0, (cols*16), 0, 2);
}
else
{
printBIGXY(txt, cols*8, 320, 1, 1);
printBIGXY(txt, 0, (cols*16), 0, 1);
}
numc++;
if(numc==10) numc=0;
}*/
drawPCX(&ps2menu_pcx,size_ps2menu_pcx, 264, 0);
printXY("Adam & Tom's HDD Boot/Copy Menu", 4, 0, 1);
printXY("Working volume:", 4, 16, 1);
printXY(parties[party].filename, 128, 16, 2);
if(elfhost==1) printXY("Select an ELF to run:", 4, 24, 1);
if(elfhost==2) printXY("Select an ELF to copy:", 4, 24, 1);
drawHorizontal(8, 36, 496, 1); //x+-3, y+-2
drawHorizontal(12, 38, 488, 1);
drawVertical(8, 36, 332, 1);
drawVertical(12, 38, 328, 1);
drawVertical(502, 36, 332, 1);
drawVertical(498, 38, 328, 1);
drawHorizontal(8, 368, 496, 1);
drawHorizontal(11, 366, 489, 1);
PrintHDDFiles(highlighted);
if(elfhost==1)
{
strcpy(fullpath, HDDpath);
strcat(fullpath, HDDfiles[highlighted]);
}
else strcpy(fullpath, HDDfiles[highlighted]);
printXY(fullpath, 4, 374, 2);
// printXY(sStatus, 4, STATUS_Y, 2);
PutImage();
}
 
int ConfirmYN(char *s)
{
int enterkey = 0, keycol=0, ret, i;
struct padButtonStatus buttons;
u32 paddata;
u32 old_pad = 0;
u32 new_pad;
 
enterkey=0;
while(!enterkey)
{
for (i=79;i<112;i++)
{
drawHorizontal(138, i, 73, 0);
}
drawHorizontal(138, 87, 73, 1);
drawVertical(138, 87, 25, 1);
drawHorizontal(138, 112, 73, 1);
drawVertical(211, 87, 25, 1);
printXY(s, 146, 79, 2);
printXY("YES NO", 146, 95, 1);
if(keycol==0)
{
printXY("NO", 186, 95, 2);
}
else
{
printXY("YES", 146, 95, 2);
}
PutImage();
ret = padRead(0, 0, &buttons); // port, slot, buttons
if (ret != 0)
{
paddata = 0xffff ^ ((buttons.btns[0] << 8) | buttons.btns[1]);
new_pad = paddata & ~old_pad;
old_pad = paddata;
 
// Directions
if(new_pad & PAD_LEFT)
{
if(keycol==0) keycol=1;
else keycol=0;
}
if(new_pad & PAD_RIGHT)
{
if(keycol==0) keycol=1;
else keycol=0;
}
if(new_pad & PAD_CROSS)
{
enterkey=1;
}
if(new_pad & PAD_TRIANGLE)
{
keycol=0;
enterkey=1;
}
}
}
return keycol;
}
void MenuKeyboard(char *s)
{
int i,ret,keyrow=0,keycol=0,nameptr=0;
int enterkey = 0;
struct padButtonStatus buttons;
u32 paddata;
u32 old_pad = 0;
u32 new_pad;
char keysrow1[130]="0 1 2 3 4 5 6 7 8 9 ( ) .\0A B C D E F G H I J K L M\0N O P Q R S T U V W X Y Z\0a b c d e f g h i j k l m\0n o p q r s t u v w x y z\0";
char funcrow[19]="SPACE DEL ENTER";
 
enterkey=0;
nameptr=0;
foldername[nameptr]='\0';
while(!enterkey)
{
for(i=63;i<128;i++)
{
drawHorizontal(82, i, 202, 0);
}
printXY(s, 83, 63, 2);
printXY(&keysrow1[0], 83, 80, 1);
printXY(&keysrow1[26], 83, 88, 1);
printXY(&keysrow1[52], 83, 96, 1);
printXY(&keysrow1[78], 83, 104, 1);
printXY(&keysrow1[104], 83, 112, 1);
printXY(funcrow, 107, 120, 1);
drawHorizontal(82,71,202,2);
drawHorizontal(82,79,202,2);
drawHorizontal(82,128,202,2);
drawVertical(82,71,128-71,2);
drawVertical(82+202,71,128-71,2);
if (keyrow<5)
{
drawChar(keysrow1[(keyrow*26)+(keycol*2)],83+(keycol*16), 80+(keyrow*8), 2);
}
else
{
if(keycol==0) printXY("SPACE", 107, 120, 2);
if(keycol==1) printXY("DEL", 170, 120, 2);
if(keycol==2) printXY("ENTER", 218, 120, 2);
}
printXY((char *)&foldername, 83, 71, 1);
PutImage();
ret = padRead(0, 0, &buttons); // port, slot, buttons
if (ret != 0)
{
paddata = 0xffff ^ ((buttons.btns[0] << 8) | buttons.btns[1]);
new_pad = paddata & ~old_pad;
old_pad = paddata;
 
// Directions
if(new_pad & PAD_LEFT)
{
keycol--;
if(keyrow<5)
{
if (keycol<0) keycol=12;
}
else if (keycol<0) keycol=2;
}
if(new_pad & PAD_DOWN)
{
keyrow++;
if(keyrow>=5)
{
keyrow=5;
keycol=0;
}
}
if(new_pad & PAD_RIGHT)
{
keycol++;
if(keyrow<5)
{
if (keycol>12) keycol=0;
}
else if (keycol>2) keycol=0;
}
if(new_pad & PAD_UP)
{
keyrow--;
if(keyrow<0) keyrow=0;
}
if(new_pad & PAD_CROSS)
{
if(keyrow<5)
{
if(nameptr<25)
{
foldername[nameptr]=keysrow1[(keyrow*26)+(keycol*2)];
nameptr++;
foldername[nameptr]='\0';
}
}
else
{
if(keycol==0 && nameptr<25)
{
foldername[nameptr]=' ';
nameptr++;
foldername[nameptr]='\0';
}
if(keycol==1 && nameptr>0)
{
nameptr--;
foldername[nameptr]='\0';
}
if(keycol==2)
{
enterkey=1;
}
}
}
if(new_pad & PAD_TRIANGLE)
{
foldername[0]='\0';
enterkey=1;
}
}
}
}
 
void jprintf(char *s)
{
#ifdef DEBUG
printf("%s\n", s);
#endif
// printXY(s, 4, 216, 2);
// ReDraw(0);
}
 
char *SelectELF(void)
{
int ret, i;
int selected = 0;
int highlighted = 0;
struct padButtonStatus buttons;
u32 paddata;
u32 old_pad = 0;
u32 new_pad;
int changed=1;
char botcap,botcap2;
 
strcpy(HDDpath,"pfs0:/\0");
while(!selected)
{
ret = padRead(0, 0, &buttons); // port, slot, buttons
if (ret != 0)
{
paddata = 0xffff ^ ((buttons.btns[0] << 8) | buttons.btns[1]);
new_pad = paddata & ~old_pad;
old_pad = paddata;
 
// Directions
if(new_pad & PAD_LEFT)
{
elfhost--;
if (elfhost<1) elfhost=2;
highlighted=0;
topfil=0;
changed=1;
}
if(new_pad & PAD_DOWN)
{
if((highlighted-topfil > 18) & (highlighted < num_hdd_files-1))
{
topfil++;
highlighted++;
}
else
{
if(highlighted < num_hdd_files-1) highlighted++;
}
}
if(new_pad & PAD_RIGHT)
{
elfhost++;
if (elfhost>2) elfhost=1;
highlighted=0;
topfil=0;
changed=1;
}
if(new_pad & PAD_UP)
{
if((topfil==highlighted) && (0 < highlighted))
{
topfil--;
highlighted--;
}
else if(0 < highlighted) highlighted--;
}
// Buttons
if(new_pad & PAD_L1)
{
party++;
if(party>nparty) party=0;
highlighted=0;
topfil=0;
changed=1;
elfhost=1;
strcpy(HDDpath,"pfs0:/\0");
}
if((new_pad & PAD_CIRCLE) && elfhost==1)
{
if(ConfirmYN("Delete?"))
{
if(HDDstats[highlighted]&FIO_S_IFDIR)
{
fileXioMount("pfs0:", parties[party].filename, FIO_MT_RDWR);
strcpy(sStatus,HDDpath);
strcat(sStatus,HDDfiles[highlighted]);
fileXioRmdir(sStatus);
fileXioUmount("pfs0:");
changed=1;
highlighted=0;
topfil=0;
}
else
{
fileXioMount("pfs0:", parties[party].filename, FIO_MT_RDWR);
strcpy(sStatus,HDDpath);
strcat(sStatus,HDDfiles[highlighted]);
fileXioRemove(sStatus);
fileXioUmount("pfs0:");
changed=1;
highlighted=0;
topfil=0;
}
}
else
{
highlighted=0;
topfil=0;
changed=1;
}
}
if((new_pad & PAD_SQUARE) && elfhost==1)
{
MenuKeyboard("Create folder, enter name");
if(strlen(foldername)>0)
{
fileXioMount("pfs0:", parties[party].filename, FIO_MT_RDWR);
fileXioChdir(HDDpath);
strcat(HDDpath,foldername);
fileXioMkdir(HDDpath, fileMode);
fileXioUmount("pfs0:");
strcat(HDDpath, "/\0");
}
changed=1;
highlighted=0;
topfil=0;
}
else if((new_pad & PAD_START) || (new_pad & PAD_CROSS))
{
if(elfhost==1)
{
if(HDDstats[highlighted]&FIO_S_IFDIR)
{
botcap=HDDfiles[highlighted][0];
botcap2=HDDfiles[highlighted][1];
if((botcap=='.')&(botcap2=='.'))
{
i=0;
while(botcap!='\0')
{
botcap=HDDpath[i];
i++;
}
i--;
i--;
while((i>6)&(botcap!='/'))
{
i--;
botcap=HDDpath[i];
if(botcap=='/')
{
HDDpath[i+1]='\0';
}
if(i==6) HDDpath[i]='\0';
}
changed=1;
highlighted=0;
topfil=0;
}
else
{
if(botcap=='.')
{
}
else
{
strcat(HDDpath, HDDfiles[highlighted]);
strcat(HDDpath, "/\0");
changed=1;
highlighted=0;
topfil=0;
}
}
}
else
{
if(checkELFheader(HDDfiles[highlighted])==1)
{
sprintf(sStatus, "- %s -", HDDfiles[highlighted]);
selected = 1;
}
}
}
else
{
tomcopy(HDDfiles[highlighted]);
}
}
}
if (changed)
{
if (elfhost==1) ReadHDDFiles();
if (elfhost==2) ReadHostDir();
changed=0;
}
ReDraw(highlighted);
}
 
return HDDfiles[highlighted];
}
 
/*
* waitPadReady()
*/
int waitPadReady(int port, int slot)
{
int state;
int lastState;
char stateString[16];
 
state = padGetState(port, slot);
lastState = -1;
while((state != PAD_STATE_STABLE) && (state != PAD_STATE_FINDCTP1))
{
if (state != lastState) {
padStateInt2String(state, stateString);
}
lastState = state;
state=padGetState(port, slot);
}
// Were the pad ever 'out of sync'?
if (lastState != -1)
{
jprintf("Pad OK!\n");
}
}
 
 
/*
* initializePad()
*/
int initializePad(int port, int slot)
{
 
int modes;
int i;
char s[128];
 
waitPadReady(port, slot);
 
// How many different modes can this device operate in?
// i.e. get # entrys in the modetable
modes = padInfoMode(port, slot, PAD_MODETABLE, -1);
sprintf(s, "The device has %d modes", modes);
jprintf(s);
 
if (modes > 0)
{
for (i = 0; i < modes; i++)
{
sprintf(s, "uses mode %d ", padInfoMode(port, slot, PAD_MODETABLE, i));
jprintf(s);
}
}
 
sprintf(s, "It is currently using mode %d",
padInfoMode(port, slot, PAD_MODECURID, 0));
jprintf(s);
 
// If modes == 0, this is not a Dual shock controller
// (it has no actuator engines)
if (modes == 0)
{
return 1;
}
 
return 1;
}
 
void poweroffHandler(int i)
{
hddPowerOff();
}
 
// *************************************************************************
// *** MAIN
// *************************************************************************
int main(int argc, char *argv[])
{
int i=0,ret,elfsubdir=0;
char *pc;
char s[256];
 
 
// Initialise
// SifInitRpc(0);
strcpy(s,argv[0]);
if(!strncmp(s, "host:", 5)) elfload=1; // assume loading from PS2LINK
else if(!strncmp(s, "mc0:", 4)) elfload=2; // loading from memory card
init_scr();
scr_printf("Welcome to PS2MENU v2.0\nPlease wait...\n");
hddPreparePoweroff();
hddSetUserPoweroffCallback((void *)poweroffHandler,(void *)i);
LoadModules();
 
// Initialise platform stuff
// detect system, and reset GS into that mode
if(pal_ntsc() == 3)
{
initGraph(3);
}
else
{
initGraph(2);
}
 
g_nWhichBuffer = 0;
SetupScreen( g_nWhichBuffer ); // set up MY screen!!!
 
*GS_PMODE = 0x0066;
 
*GS_BGCOLOR = 0x00FF00; // GREEN
 
install_VRstart_handler();
 
*GS_BGCOLOR = 0x5A5A5A; // GREY
 
// readPCXheader(&mainlogo_pcx,size_mainlogo_pcx);
// drawPCX(&mainlogo_pcx,size_mainlogo_pcx, 0, 0);
// PutImage();
 
// set palette
for(i=0; i<16; i++)
{
SetPaletteEntry(0x005A5A5A, 0);
SetPaletteEntry(0x00000000, 1);
SetPaletteEntry(0x00FFFFFF, 2);
// SetPaletteEntry(0x00000000, 3);
}
paletteindex=3;
readPCXheader(&ps2menu_pcx,size_ps2menu_pcx);
// *** Required BEFORE calling ReadMCDir etc
GetROMVersion();
//#ifdef DEBUG
printf("Rom version: %s\n", romver);
//#endif
 
strcpy(sStatus, "Ready.\0");
if(hddCheckPresent() < 0)
{
printf("Error: supported HDD not connected!\n");
}
if(hddCheckFormatted() < 0)
{
printf("Error: HDD is not properly formatted!\n");
if(dowereformat()<0)
{
while(1);
}
}
i=hddGetFilesystemList(parties, MAX_PARTITIONS);
nparty=i-1;
party=-1;
for(i=nparty;i>0;i--)
{
printf("Found %s\n",parties[i].name);
if(!strncmp(parties[i].name, "PS2MENU", 7)) party=i;
}
if(party<0)
{
printf("PS2MENU partition not found!\nAttempting to create\n");
if(dowereformat()<0)
{
printf("Error: Partition could not be created!\n");
}
else
{
i=hddGetFilesystemList(parties, MAX_PARTITIONS);
nparty=i-1;
}
party=nparty;
}
strcpy(s,argv[0]);
i=0;
while(s[i]!='\0')
{
if(s[i]==0x5c) elfsubdir++;
i++;
}
ReDraw(0);
// get the pad going
padInit(0);
if((ret = padPortOpen(0, 0, padBuf)) == 0)
{
printf("padOpenPort failed");
SleepThread();
}
 
if(!initializePad(0, 0))
{
printf("pad initalization failed!");
SleepThread();
}
 
ret=padGetState(0, 0);
while((ret != PAD_STATE_STABLE) && (ret != PAD_STATE_FINDCTP1))
{
if(ret==PAD_STATE_DISCONN)
{
jprintf("Pad is disconnected");
}
ret=padGetState(0, 0);
}
 
printf("Starting SelectELF()...\n");
 
// main ELF select loop
pc = SelectELF();
 
// build correct path to ELF
padPortClose(0,0);
if(elfhost==2)
{
strcpy(s, "host:");
for(i=0;i<(elfsubdir-1);i++) strcat(s,"..\\");
}
if(elfhost==1) strcpy(s, HDDpath);
strcat(s, pc);
dbgprintf("Executing %s ...", s);
ReDraw(0);
 
LoadAndRunMCElf(s);
}
 
void LoadModules()
{
int ret;
static char hddarg[] = "-o" "\0" "4" "\0" "-n" "\0" "20";
static char pfsarg[] = "-m" "\0" "4" "\0" "-o" "\0" "10" "\0" "-n" "\0" "40" /*"\0" "-debug"*/;
 
if(elfload==2)
{
scr_printf("Loading SIOMAN\n");
SifLoadModule("rom0:SIO2MAN", 0, NULL);
scr_printf("Loading PADMAN\n");
#ifdef ROM_PADMAN
ret = SifLoadModule("rom0:PADMAN", 0, NULL);
#else
ret = SifLoadModule("rom0:XPADMAN", 0, NULL);
#endif
if (ret < 0)
{
printf("Failed to load PAD module");
SleepThread();
}
scr_printf("Loading poweroff.irx %i bytes\n", size_poweroff_irx);
SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret);
scr_printf("Loading iomanx.irx %i bytes\n", size_iomanx_irx);
SifExecModuleBuffer(&iomanx_irx, size_iomanx_irx, 0, NULL, &ret);
scr_printf("Loading filexio.irx %i bytes\n", size_filexio_irx);
SifExecModuleBuffer(&filexio_irx, size_filexio_irx, 0, NULL, &ret);
scr_printf("Loading ps2dev9.irx %i bytes\n", size_ps2dev9_irx);
SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, &ret);
scr_printf("Loading ps2atad.irx %i bytes\n", size_ps2atad_irx);
SifExecModuleBuffer(&ps2atad_irx, size_ps2atad_irx, 0, NULL, &ret);
scr_printf("Loading ps2hdd.irx %i bytes\n", size_ps2hdd_irx);
SifExecModuleBuffer(&ps2hdd_irx, size_ps2hdd_irx, sizeof(hddarg), hddarg, &ret);
scr_printf("Loading ps2fs.irx %i bytes\n", size_ps2fs_irx);
SifExecModuleBuffer(&ps2fs_irx, size_ps2fs_irx, sizeof(pfsarg), pfsarg, &ret);
}
else
{
#ifdef ROM_PADMAN
ret = SifLoadModule("rom0:PADMAN", 0, NULL);
#else
ret = SifLoadModule("rom0:XPADMAN", 0, NULL);
#endif
if (ret < 0)
{
printf("Failed to load PAD module");
SleepThread();
}
scr_printf("Loading poweroff.irx %i bytes\n", size_poweroff_irx);
SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret);
scr_printf("Loading filexio.irx %i bytes\n", size_filexio_irx);
SifExecModuleBuffer(&filexio_irx, size_filexio_irx, 0, NULL, &ret);
scr_printf("Loading ps2atad.irx %i bytes\n", size_ps2atad_irx);
SifExecModuleBuffer(&ps2atad_irx, size_ps2atad_irx, 0, NULL, &ret);
scr_printf("Loading ps2hdd.irx %i bytes\n", size_ps2hdd_irx);
SifExecModuleBuffer(&ps2hdd_irx, size_ps2hdd_irx, sizeof(hddarg), hddarg, &ret);
scr_printf("Loading ps2fs.irx %i bytes\n", size_ps2fs_irx);
SifExecModuleBuffer(&ps2fs_irx, size_ps2fs_irx, sizeof(pfsarg), pfsarg, &ret);
}
}
 
void LoadAndRunMCElf(char *filename)
{
u8 *boot_elf = (u8 *)&loader_elf;
elf_header_t *eh = (elf_header_t *)boot_elf;
elf_pheader_t *eph;
void *pdata;
int i;
char *argv[1];
 
/* Load the ELF into RAM. */
if (_lw((u32)&eh->ident) != ELF_MAGIC)
{
*GS_BGCOLOR = 0x0000FF; // BLUE
goto error;
}
 
eph = (elf_pheader_t *)(boot_elf + eh->phoff);
 
/* Scan through the ELF's program headers and copy them into RAM, then
zero out any non-loaded regions. */
for (i = 0; i < eh->phnum; i++)
{
if (eph[i].type != ELF_PT_LOAD)
continue;
 
pdata = (void *)(boot_elf + eph[i].offset);
memcpy(eph[i].vaddr, pdata, eph[i].filesz);
 
if (eph[i].memsz > eph[i].filesz)
memset(eph[i].vaddr + eph[i].filesz, 0,
eph[i].memsz - eph[i].filesz);
}
 
/* Let's go. */
// fioExit();
// SifResetIop();
 
// SifExitRpc();
SifInitRpc(0);
SifExitRpc();
FlushCache(0);
FlushCache(2);
 
argv[0] = filename;
argv[1] = party[parties].filename;
 
ExecPS2((void *)eh->entry, 0, 2, argv);
 
return;
error:
while (1) ;
 
}
 
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: ps2menu/ps2menu/Makefile
===================================================================
--- ps2menu/ps2menu/Makefile (revision 26)
+++ ps2menu/ps2menu/Makefile (revision 27)
@@ -9,22 +9,50 @@
-fshort-double -mlong64 -mhard-float -mno-abicalls -O2 -EL -Wall \
-c $(EE_INCS) $(EE_CFLAGS)
EE_ASFLAGS := -EL -G0 $(EE_ASFLAGS)
-ifeq ($(DEBUG),1)
-LOADADDR = 0xd00000
-STACKADDR = 0xde0000
-LDPARAMS := -Wl,--defsym -Wl,_stack_size=0x8000 -Wl,--defsym -Wl,_stack=$(STACKADDR)
-EE_LDFLAGS += -Wl,-Ttext -Wl,$(LOADADDR) $(LDPARAMS)
-endif
EE_LDFLAGS := $(EE_LDFLAGS) -L$(LIBHDD)/ee/lib -L$(PS2DRV)/ee/libfileXio \
-L$(PS2LIB)/ee/lib -T$(PS2LIB)/ee/startup/linkfile -nostartfiles
-EE_BIN = ../bin/HDDMENU.ELF
-EE_OBJS = hddmenu.o hw.o hardware.o
+EE_BIN = ../bin/PS2MENU.ELF
+EE_OBJS = ps2menu.o hw.o hardware.o iomanx.o filexio.o ps2atad.o ps2dev9.o \
+ ps2hdd.o ps2fs.o loader.o poweroff.o iuntar.o ps2menupcx.o
EE_LIBS = -lmc -lpad -lhdd -lfileXio
all: $(EE_BIN)
+iomanx.s:
+ bin2s $(PS2DRV)/iop/iomanX/iomanx.irx iomanx.s iomanx_irx
+
+filexio.s:
+ bin2s $(PS2DRV)/iop/fileXio/filexio.irx filexio.s filexio_irx
+
+ps2atad.s:
+ bin2s $(PS2DRV)/iop/ps2atad/ps2atad.irx ps2atad.s ps2atad_irx
+
+ps2dev9.s:
+ bin2s $(PS2DRV)/iop/ps2dev9/ps2dev9.irx ps2dev9.s ps2dev9_irx
+
+ps2fs.s:
+ bin2s $(LIBHDD)/iop/modules/ps2fs.irx ps2fs.s ps2fs_irx
+
+ps2hdd.s:
+ bin2s $(LIBHDD)/iop/modules/ps2hdd.irx ps2hdd.s ps2hdd_irx
+
+poweroff.s:
+ bin2s $(LIBHDD)/iop/poweroff/poweroff.irx poweroff.s poweroff_irx
+
+iuntar.s:
+ bin2s $(PS2DRV)/iop/iuntar/iuntar.irx iuntar.s iuntar_irx
+
+loader.s:
+ bin2s ../bin/loader.elf loader.s loader_elf
+
+ps2menupcx.s:
+ bin2s images/ps2menu.pcx ps2menupcx.s ps2menu_pcx
+
+#mainlogo.s:
+# bin2s images/mainlogo.pcx mainlogo.s mainlogo_pcx
+
clean:
rm -f *.elf *.o *.a
/trunk/ps2menu/ps2menu/hardware.c
26,12 → 26,19
//
// Emulated screen size
//
int g_nScreen_X = 366; // These can go UP TO 512x512
int g_nScreen_Y = 256;
// int g_nScreen_X = 366; // These can go UP TO 512x512
// int g_nScreen_Y = 256;
int g_nScreen_X = 512; // These can go UP TO 512x512
int g_nScreen_Y = 512;
 
int g_nFiltered = 0; // set to 1 to bi-linear filter the screen
 
int g_nDisplayWidth = 366;
int g_nDisplayHeight= 256;
// int g_nDisplayWidth = 366;
// int g_nDisplayHeight= 256;
int g_nDisplayWidth = 512;
int g_nDisplayHeight= 512;
// int g_nXoffset = (4096-366)/2;
// int g_nYoffset = (4096-256)/2;
 
int g_nClearScreen = 0; // set to 1 to clear screen after FLIP
U32 g_nClearColour = 0x00000000; // clear screen colour
420,7 → 427,7
// Notes: Test GS functions.
//
//********************************************************
void RenderQuad2( void )
/*void RenderQuad2( void )
{
 
U128 *pBuff = (U128*) &DMABuffer[0];
476,7 → 483,7
dma02_send((void *)&pBuff[0], 9, 0x101); // send Quad to GIF
Dma02Wait(); // wait for DMA transfer to finish
 
}
}*/
 
 
 
494,7 → 501,7
// Notes: Test GS functions.
//
//********************************************************
void RenderQuad( int xx )
/*void RenderQuad( int xx )
{
 
U128 *pBuff = (U128*) &DMABuffer[0];
550,7 → 557,7
dma02_send((void *)&pBuff[0], 9, 0x101); // send Quad to GIF
Dma02Wait(); // wait for DMA transfer to finish
 
}
}*/
 
 
 
775,7 → 782,7
// Out: None
//
//********************************************************
void UploadImage24( U32 *src, U32 Xsize, U32 Ysize, U32 VAdd )
/*void UploadImage24( U32 *src, U32 Xsize, U32 Ysize, U32 VAdd )
{
U128 pBuff[32 + 320 * 256] __attribute__((aligned(16)));
U32 dTextureQuadWordCount;
835,7 → 842,7
dma02_send((void *)&pBuff[0], 6+dTextureQuadWordCount ,0x101); //
Dma02Wait(); // wait for DMA transfer to finish
 
}
}*/
 
 
 
874,101 → 881,5
//********************************************************
void SetPaletteEntry( U32 ARGB, U32 index )
{
//int i;
//i = index & 0xe7;
//i |= (index&8)<<1;
//i |= (index&16)>>1;
// JH
/*
int lobits = index & 0x1f;
int hiofs = index & 0xe0;
int loofs;
 
if(lobits >= 8 && lobits < 16) loofs = lobits + 8;
else if(lobits >= 16 && lobits < 24) loofs = lobits - 8;
else loofs = lobits;
pPalette32[hiofs + loofs] = ARGB;
*/
pPalette32[palmap[index]] = ARGB;
}
 
/*
// ********************************************************
//
// Name: Load
// Function: Load a file into RAM
//
// Author: Bigboy
//
// In: pszName = filename to load
// pBuffer = Destination buffer to load INTO
// Out: size of loaded data, or -1 for error
//
// Examples:- "host:\\homer_simpson.pcm"
// "cdrom:\\homer_simpson.pcm;1"
//
// ********************************************************
int Load( char* pszName, PU8 pBuffer )
{
int handle;
char c[512];
 
//sprintf(&c[0],FILESYS"\\%s"FILESYS_E,pszName);
#ifndef MASTER
//printf("PATH=%s\n", &c[0]);
#endif
 
//handle = fio_open( &c[0], 0 );
handle = fio_open( pszName, 0 );
if( handle>=0)
{
int size;
size = fio_lseek( handle, 0, 2 );
fio_lseek( handle, 0, 0 );
fio_read( handle, pBuffer, size );
fio_close( handle );
return size;
}
 
#ifdef DEBUG
printf("Can't open file!!!\n" );
#endif
return -1;
}
*/
 
/*
 
// ********************************************************
//
// Name: LoadSoundModules
// Function: Load and init the sound module
// Author: Sjeep
//
// In: none
// Out: none
//
// notes: Seems to disable NAPLINK reset.
//
// ********************************************************
void LoadSoundModules( void )
{
int ret;
 
jprintf("Loading module: LIBSD");
ret = sif_load_module("rom0:LIBSD", 0, NULL);
if (ret < 0) {
jprintf("Failed to load module: LIBSD");
k_SleepThread();
}
 
jprintf("Loading module: SJPCM.IRX");
ret = sif_load_module(FILESYS"SJPCM.IRX", 0, NULL);
if (ret < 0) {
jprintf("Failed to load module: SJPCM.IRX");
k_SleepThread();
}
 
}
 
*/
/trunk/ps2menu/Makefile
1,6 → 1,6
all:
$(MAKE) -C ps2menu/loader
$(MAKE) -C ps2menu
$(MAKE) -C ps2menu/loader
 
clean:
$(MAKE) -C bin clean