-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameboyRetroarchSaveTransfer.py
48 lines (39 loc) · 1.51 KB
/
GameboyRetroarchSaveTransfer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Not used anymore. Use the Bash specific GBRA shell command.
from io import TextIOWrapper
import tkinter as tk
from tkinter import filedialog
import os
import shutil
root = tk.Tk()
root.withdraw()
#TODO:
# txt file of file locations, such as RetroArch Save Locations, SD card drive save, etc.
# file dialog of configuring these files to the txt file
RASavs = "C:/RetroArch-Win64/saves"
GBSavs = "D:/EDGB/SAVE"
RABKSavs = "C:/Users/R T/Desktop/GBRABackups/Retroarch"
GBBKSavs = "C:/Users/R T/Desktop/GBRABackups/Gameboy"
print("Hello! Select An Option:")
print("[1] Retroarch to Gameboy")
print("[2] Gameboy to Retroarch")
print("[3] Revive Previous Save")
choice = input();
if(choice == "1"):
RABaseName = os.path.basename(filedialog.askopenfilename(title="Select Retroarch Save...",initialdir=RASavs))
RaSaveFilePath = RASavs + "/" + RABaseName
GBSaveFilePath = GBSavs + "/" + RABaseName
shutil.copy(GBSaveFilePath, GBBKSavs)
RaSvF = open(RaSaveFilePath,'rb')
GbSvF = open(GBSaveFilePath,'wb')
GbSvF.write(RaSvF.read())
if(choice == "2"):
GBBaseName = os.path.basename(filedialog.askopenfilename(title="Select Gameboy Save...",initialdir=GBSavs))
RaSaveFilePath = RASavs + "/" + GBBaseName
GBSaveFilePath = GBSavs + "/" + GBBaseName
shutil.copy(RaSaveFilePath, RABKSavs)
RaSvF = open(RaSaveFilePath,'wb')
GbSvF = open(GBSaveFilePath,'rb')
RaSvF.write(GbSvF.read())
RaSvF.close()
GbSvF.close()
print("Save Sucessful! :)")