static void frontend_xenon_init(void *data) { (void)data; xenos_init(VIDEO_MODE_AUTO); console_init(); xenon_make_it_faster(XENON_SPEED_FULL); usb_init(); usb_do_poll(); xenon_ata_init(); #if 0 dvd_init(); #endif }
int main() { #ifdef LIBXENON usb_init(); usb_do_poll(); xenon_ata_init(); dvd_init(); xenon_smc_start_bootanim(); #endif cApp.Run(); while (1) { } return 0; }
void HardwareManager::InitializeXbox() { // Will only be instantiated once for the lifetime of the application static int initialized = 0; // Don't do anything if we've already initialized if(initialized == 1) return; // Make sure all CPU cores are at full speed xenon_make_it_faster(XENON_SPEED_FULL); // Initialize USB and scan for devices usb_init(); usb_do_poll(); // Initialize HDD's xenon_ata_init(); // Initialize DVD dvd_init(); // Make sure this only happens once initialized = 1; }
int main(void) { const char *s = NULL; char path[256]; int handle; struct controller_data_s pad; int pos = 0, ppos = -1; xenos_init(VIDEO_MODE_AUTO); console_init(); xenon_make_it_faster(XENON_SPEED_FULL); usb_init(); usb_do_poll(); xenon_ata_init(); dvd_init(); handle = -1; handle = bdev_enum(handle, &s); if (handle < 0) return 0; strcpy(path, s); strcat(path, ":/"); load_dir(path); for (;;) { usb_do_poll(); get_controller_data(&pad, 0); if (pad.s1_y > STICK_THRESHOLD || pad.up) pos--; if (pad.s1_y < -STICK_THRESHOLD || pad.down) pos++; if (entrycount && (pos < 0 || pos >= entrycount)) { pos = ppos; continue; } if (pad.logo) return 0; if (pad.a) { if (entries[pos].d_type & DT_DIR) { append_dir_to_path(path,entries[pos].d_name); load_dir(path); ppos = -1; pos = 0; } else { char fn[256]; strcpy(fn, path); strcat(fn, entries[pos].d_name); printf("%s\n", fn); start_ssnes(fn); } } if (pad.select) { append_dir_to_path(path, ".."); load_dir(path); ppos = -1; pos = 0; } if (pad.b) { do { handle = bdev_enum(handle, &s); } while (handle < 0); strcpy(path, s); strcat(path, ":/"); load_dir(path); ppos = -1; pos = 0; } if (ppos == pos) continue; memset(&pad, 0, sizeof(pad)); console_set_colors(BG_COL, FG_COL); console_clrscr(); printf("A: select, B: change disk, Back: parent dir, Logo: reload Xell\n\n%s\n\n", path); int start = MAX(0, pos - MAX_DISPLAYED_ENTRIES / 2); int count = MIN(MAX_DISPLAYED_ENTRIES, entrycount - start); for (int i = start; i < start + count; i++) { struct dirent *de = &entries[i]; if (i == pos) console_set_colors(FG_COL, BG_COL); else console_set_colors(BG_COL, FG_COL); if (de->d_type & DT_DIR) console_putch('['); s = de->d_name; while (*s) console_putch(*s++); if (de->d_type & DT_DIR) console_putch(']'); console_putch('\r'); console_putch('\n'); } ppos = pos; do { usb_do_poll(); get_controller_data(&pad, 0); } while (pad.a || pad.b || pad.select || pad.s1_y > STICK_THRESHOLD || pad.s1_y < -STICK_THRESHOLD); } return 0; }