forked from tzlion/frogtool
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from EricGoldsteinNz/v0.2.1
Added Features: Refresh drives button "ALL" systems rebuilding option GBA BIOS Fix Games List Displayed
- Loading branch information
Showing
5 changed files
with
169 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
import sys | ||
import shutil | ||
|
||
def GBABIOSFix(drive): | ||
if drive == "???": | ||
raise Exception_InvalidPath | ||
GBABIOSPath = f"{drive}/bios/gba_bios.bin" | ||
if not os.path.exists(GBABIOSPath): | ||
print(f"! Couldn't find game list file {GBABIOSPath}") | ||
print(" Check the provided path points to an SF2000 SD card!") | ||
raise Exception_InvalidPath | ||
try: | ||
GBAFolderPath = f"{drive}/GBA/mnt/sda1/bios/" | ||
ROMSFolderPath = f"{drive}/ROMS/mnt/sda1/bios/" | ||
os.makedirs(os.path.dirname(GBAFolderPath), exist_ok=True) | ||
os.makedirs(os.path.dirname(ROMSFolderPath), exist_ok=True) | ||
shutil.copyfile(GBABIOSPath, f"{GBAFolderPath}/gba_bios.bin") | ||
shutil.copyfile(GBABIOSPath, f"{ROMSFolderPath}/gba_bios.bin") | ||
except (OSError, IOError) as error: | ||
print("! Failed to copy GBA BIOS.") | ||
print(error) | ||
raise Exception_InvalidPath | ||
|
||
|
||
|
||
class Exception_InvalidPath(Exception): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters