Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git cube/swiss/source/swiss.c cube/swiss/source/swiss.c
- index 5d9be84..bfce8b4 100644
- --- cube/swiss/source/swiss.c
- +++ cube/swiss/source/swiss.c
- @@ -1371,17 +1371,25 @@ int info_game()
- }
- }
- // Look for a cheats file based on the GameID
- + // If game is not on SD Gecko, search for codes on the SD Gecko in slot B
- if(PAD_ButtonsHeld(0) & PAD_BUTTON_Y) {
- char trimmedGameId[8];
- memset(trimmedGameId, 0, 8);
- memcpy(trimmedGameId, (char*)&GCMDisk, 6);
- file_handle *cheatsFile = memalign(32,sizeof(file_handle));
- - memcpy(cheatsFile, deviceHandler_initial, sizeof(file_handle));
- - sprintf(cheatsFile->name, "%s/cheats/%s.txt", deviceHandler_initial->name, trimmedGameId);
- + if (curDevice != SD_CARD) {
- + memcpy(cheatsFile, &initial_SD1, sizeof(file_handle));
- + deviceHandler_FAT_init(cheatsFile);
- + sprintf(cheatsFile->name, "%s/cheats/%s.txt", (&initial_SD1)->name, trimmedGameId);
- + }
- + else {
- + memcpy(cheatsFile, deviceHandler_initial, sizeof(file_handle));
- + sprintf(cheatsFile->name, "%s/cheats/%s.txt", deviceHandler_initial->name, trimmedGameId);
- + }
- print_gecko("Looking for cheats file @ %s\r\n", cheatsFile->name);
- cheatsFile->size = -1;
- - if(deviceHandler_readFile(cheatsFile, &trimmedGameId, 8) != 8) {
- + if(deviceHandler_FAT_readFile(cheatsFile, &trimmedGameId, 8) != 8) {
- while(PAD_ButtonsHeld(0) & PAD_BUTTON_Y);
- DrawFrameStart();
- DrawMessageBox(D_INFO,"No cheats file found.\nPress A to continue.");
- @@ -1393,12 +1401,15 @@ int info_game()
- print_gecko("Cheats file found with size %i\r\n", cheatsFile->size);
- char *cheats_buffer = memalign(32, cheatsFile->size);
- if(cheats_buffer) {
- - deviceHandler_seekFile(cheatsFile, 0, DEVICE_HANDLER_SEEK_SET);
- - deviceHandler_readFile(cheatsFile, cheats_buffer, cheatsFile->size);
- + deviceHandler_FAT_seekFile(cheatsFile, 0, DEVICE_HANDLER_SEEK_SET);
- + deviceHandler_FAT_readFile(cheatsFile, cheats_buffer, cheatsFile->size);
- parseCheats(cheats_buffer);
- free(cheats_buffer);
- DrawCheatsSelector(getRelativeName(allFiles[curSelection].name));
- }
- + if (curDevice != SD_CARD) {
- + deviceHandler_FAT_deinit(cheatsFile);
- + }
- }
- while(PAD_ButtonsHeld(0) & PAD_BUTTON_A){ VIDEO_WaitVSync (); }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement