[UPADTE] - Geometry Roms
This commit is contained in:
parent
f0349289cb
commit
316561a5da
90
start.py
90
start.py
@ -51,12 +51,17 @@ def IsImgExist(AbsPathFile,TypeMedia):
|
||||
return "./media/noemu.png"
|
||||
case "bg":
|
||||
return "./media/nobg.png"
|
||||
case "wheel":
|
||||
return "./media/nowheel.png"
|
||||
case "snap":
|
||||
return "./media/nopsnap.png"
|
||||
case "wheelemu":
|
||||
return "./media/nowheelemu.png"
|
||||
case "doc":
|
||||
return "./media/nodoc.txt"
|
||||
else:
|
||||
return AbsPathFile
|
||||
|
||||
|
||||
|
||||
|
||||
def BackgroundEmu():
|
||||
|
||||
BackgroundEmu = Media["background"]
|
||||
@ -72,19 +77,21 @@ def EnterEmu(GetEmuMod):
|
||||
runMcpt = cpt + 1
|
||||
if runMcpt > EmuCpt:
|
||||
runMcpt = 0
|
||||
print("Emu : " + str(res[runMcpt]))
|
||||
print("Emu : " + str(EmuRes[runMcpt]))
|
||||
#Cnv.delete("all")
|
||||
BackgroundRom(str(res[runMcpt]))
|
||||
BackgroundRom(str(EmuRes[runMcpt]))
|
||||
GenRomListPerGame(str(EmuRes[runMcpt]))
|
||||
|
||||
|
||||
#def ParseEmu():
|
||||
|
||||
|
||||
def ViewEmu(cL,xL,yL,cM,xM,yM,cR,xR,yR):
|
||||
NfL="./data/emu/media/" + res[cL] + ".png"
|
||||
NfL="./data/emu/media/" + EmuRes[cL] + ".png"
|
||||
NfL = IsImgExist(NfL,"emu")
|
||||
NfM="./data/emu/media/" + res[cM] + ".png"
|
||||
NfM="./data/emu/media/" + EmuRes[cM] + ".png"
|
||||
NfM = IsImgExist(NfM,"emu")
|
||||
NfR="./data/emu/media/" + res[cR] + ".png"
|
||||
NfR="./data/emu/media/" + EmuRes[cR] + ".png"
|
||||
NfR = IsImgExist(NfR,"emu")
|
||||
|
||||
|
||||
@ -114,7 +121,7 @@ def ViewEmu(cL,xL,yL,cM,xM,yM,cR,xR,yR):
|
||||
Cnv.create_image(xL, yL, image=TkNfL)
|
||||
Cnv.create_image(xM, yM, image=TkNfM)
|
||||
Cnv.create_image(xR, yR, image=TkNfR)
|
||||
print("Curent Emu : " + str(res[cM]))
|
||||
print("Curent Emu : " + str(EmuRes[cM]))
|
||||
|
||||
def leftKey(GetEmuMod):
|
||||
if GetEmuMod == 0:
|
||||
@ -163,12 +170,32 @@ def Escape(GetEmuMod):
|
||||
ViewEmu(0,EmuLeftSquareX, EmuLeftSquareY,1,EmuMiddleSquareX, EmuMiddleSquareY,2,EmuRightSquareX, EmuRightSquareY)
|
||||
|
||||
|
||||
def GenRomListPerGame(Emu):
|
||||
global RomRes
|
||||
RomRes.clear()
|
||||
dir_rom_path = r'./data/roms/'+Emu+'/roms/'
|
||||
|
||||
for RomFile in os.listdir(dir_rom_path):
|
||||
if os.path.isfile(os.path.join(dir_rom_path, RomFile)):
|
||||
RomFileName=os.path.splitext(RomFile)[0]
|
||||
RomRes.append(RomFileName)
|
||||
print("DEBUG : " + RomFileName)
|
||||
|
||||
cntrom = Counter(RomRes)
|
||||
global RomCpt
|
||||
RomCpt=len(cntrom) - 1
|
||||
print("Nmbre de roms : " + str(RomCpt))
|
||||
print ("ListROms : " + str(RomRes))
|
||||
print ("TEST 1942 : " + str(RomRes[0]) )
|
||||
|
||||
|
||||
arkadeus= Tk()
|
||||
|
||||
global res
|
||||
res = []
|
||||
global EmuRes
|
||||
global RomRes
|
||||
|
||||
EmuRes = []
|
||||
RomRes = []
|
||||
|
||||
dir_path = r'./data/emu/bin/'
|
||||
|
||||
@ -177,10 +204,10 @@ EmuMod = 0
|
||||
for path in os.listdir(dir_path):
|
||||
if os.path.isfile(os.path.join(dir_path, path)):
|
||||
FileName=os.path.splitext(path)[0]
|
||||
res.append(FileName)
|
||||
EmuRes.append(FileName)
|
||||
print("DEBUG : " + FileName)
|
||||
|
||||
cnt = Counter(res)
|
||||
cnt = Counter(EmuRes)
|
||||
global EmuCpt
|
||||
EmuCpt=len(cnt) - 1
|
||||
print(" Nmbre emulateur : " + str(EmuCpt))
|
||||
@ -219,7 +246,7 @@ print("res : " + str(Xsize) + ":" + str(Ysize) )
|
||||
|
||||
|
||||
|
||||
################ Carto Emu Mode ##################
|
||||
################ Carto Emu Mode ####################
|
||||
EmuMiddleSquareX=(Xsize/2)
|
||||
EmuMiddleSquareY=(Ysize/2)
|
||||
|
||||
@ -229,18 +256,37 @@ EmuLeftSquareY=(Ysize/3)
|
||||
EmuRightSquareX=(Xsize*2/3)
|
||||
EmuRightSquareY=(Ysize/3)
|
||||
|
||||
################ Carto Rom Mode ####################
|
||||
|
||||
################ Carto Rom Mode ##################
|
||||
RomIndice = 32
|
||||
|
||||
RomIndiceX = Xsize / 32
|
||||
RomIndiceY = Ysize / 32
|
||||
|
||||
RomUpSquareX=RomIndiceX
|
||||
RomUpSquareY=RomIndiceY
|
||||
RomUpSquareSizeX=15*RomIndiceX
|
||||
RomUpSquareSizeY=5*RomIndiceY
|
||||
|
||||
RomMiddleSquareX=RomIndiceX
|
||||
RomMiddleSquareY=RomIndiceY*6
|
||||
RomMiddleSquareSizeX=15*RomIndiceX
|
||||
RomMiddleSquareSizeY=5*RomIndiceY
|
||||
|
||||
RomBottomSquareX=RomIndiceX
|
||||
RomBottomSquareY=RomIndiceY*12
|
||||
RomBottomSquareSizeX=15*RomIndiceX
|
||||
RomBottomSquareSizeY=5*RomIndiceY
|
||||
|
||||
RomLeftSquareX=RomIndiceX*16
|
||||
RomLeftSquareY=RomIndiceY
|
||||
RomLeftSquareSizeX=15*RomIndiceX
|
||||
RomLeftSquareSizeY=18*RomIndiceY
|
||||
|
||||
####################################################
|
||||
|
||||
|
||||
RomMiddleSquareX=(Xsize/2)
|
||||
RomMiddleSquareY=(Ysize/2)
|
||||
|
||||
RomLeftSquareX=(Xsize/3)
|
||||
RomLeftSquareY=(Ysize/3)
|
||||
|
||||
RomRightSquareX=(Xsize*2/3)
|
||||
RomRightSquareY=(Ysize/3)
|
||||
|
||||
|
||||
Cnv = Canvas( arkadeus, width = Ysize , height = Xsize)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user