Modifcation size Roms
This commit is contained in:
parent
316561a5da
commit
94bf7170b5
124
start.py
124
start.py
@ -30,9 +30,33 @@ import os
|
||||
|
||||
#def EmuMod():
|
||||
|
||||
|
||||
|
||||
def ViewRom(EmuName):
|
||||
|
||||
WheelEmu="./data/roms/"+str(EmuName)+"/media/wheel/" + str(EmuName) + "_wheel.png"
|
||||
NfL = IsImgExist(NfL,"emu")
|
||||
|
||||
OpenNfL=Image.open(NfL)
|
||||
PhotoNfL=OpenNfL.resize((Square,Square))
|
||||
TkNfL=ImageTk.PhotoImage(PhotoNfL)
|
||||
LabelPNfL=Label(arkadeus, image=TkNfL)
|
||||
LabelPNfL.TkNfL = TkNfL
|
||||
|
||||
Cnv.pack(fill = "both", expand = True)
|
||||
# for IdCanvas in Cnv.find_all():
|
||||
# if IdCanvas != 1:
|
||||
# Cnv.delete(IdCanvas)
|
||||
|
||||
Cnv.create_image(xL, yL, image=TkNfL)
|
||||
print("Curent Emu : " + str(EmuRes[cM]))
|
||||
|
||||
|
||||
|
||||
def BackgroundRom(Emu):
|
||||
|
||||
|
||||
|
||||
EmuBgFile = "./data/emu/media/" + str(Emu) +"_bg.png"
|
||||
EmuBgFile = IsImgExist(EmuBgFile,"bg")
|
||||
|
||||
@ -83,9 +107,6 @@ def EnterEmu(GetEmuMod):
|
||||
GenRomListPerGame(str(EmuRes[runMcpt]))
|
||||
|
||||
|
||||
#def ParseEmu():
|
||||
|
||||
|
||||
def ViewEmu(cL,xL,yL,cM,xM,yM,cR,xR,yR):
|
||||
NfL="./data/emu/media/" + EmuRes[cL] + ".png"
|
||||
NfL = IsImgExist(NfL,"emu")
|
||||
@ -139,6 +160,9 @@ def leftKey(GetEmuMod):
|
||||
Rcpt = 0
|
||||
print("DEBUG : " + str(EmuMod) + " Emu : " + str(cpt))
|
||||
ViewEmu(Lcpt,EmuLeftSquareX, EmuLeftSquareY,Mcpt,EmuMiddleSquareX, EmuMiddleSquareY,Rcpt,EmuRightSquareX, EmuRightSquareY)
|
||||
if GetEmuMod == 1:
|
||||
print ("get in ")
|
||||
ViewRom(EmuRes[Mcpt])
|
||||
|
||||
def rightKey(GetEmuMod):
|
||||
|
||||
@ -164,16 +188,40 @@ def Escape(GetEmuMod):
|
||||
arkadeus.quit()
|
||||
if GetEmuMod == 1:
|
||||
global EmuMod
|
||||
global cpt
|
||||
EmuMod = 0
|
||||
cpt = 0
|
||||
|
||||
|
||||
BackgroundEmu()
|
||||
ViewEmu(0,EmuLeftSquareX, EmuLeftSquareY,1,EmuMiddleSquareX, EmuMiddleSquareY,2,EmuRightSquareX, EmuRightSquareY)
|
||||
|
||||
|
||||
|
||||
def GenEmuList():
|
||||
global EmuRes
|
||||
dir_path = r'./data/emu/bin/'
|
||||
for path in os.listdir(dir_path):
|
||||
if os.path.isfile(os.path.join(dir_path, path)):
|
||||
FileName=os.path.splitext(path)[0]
|
||||
EmuRes.append(FileName)
|
||||
print("DEBUG : " + FileName)
|
||||
|
||||
cnt = Counter(EmuRes)
|
||||
global EmuCpt
|
||||
EmuCpt=len(cnt) - 1
|
||||
print(" Nmbre emulateur : " + str(EmuCpt))
|
||||
|
||||
|
||||
def GenRomListPerGame(Emu):
|
||||
global RomRes
|
||||
RomRes.clear()
|
||||
dir_rom_path = r'./data/roms/'+Emu+'/roms/'
|
||||
DirRomPath='./data/roms/'+Emu+'/roms'
|
||||
dir_rom_path = r''+DirRomPath
|
||||
|
||||
isDirRom = os.path.isdir(DirRomPath)
|
||||
print ("Dir : " + DirRomPath + " : status:" + str(isDirRom))
|
||||
if isDirRom == True:
|
||||
|
||||
for RomFile in os.listdir(dir_rom_path):
|
||||
if os.path.isfile(os.path.join(dir_rom_path, RomFile)):
|
||||
@ -197,20 +245,11 @@ global RomRes
|
||||
EmuRes = []
|
||||
RomRes = []
|
||||
|
||||
dir_path = r'./data/emu/bin/'
|
||||
|
||||
EmuMod = 0
|
||||
# Iterate directory
|
||||
for path in os.listdir(dir_path):
|
||||
if os.path.isfile(os.path.join(dir_path, path)):
|
||||
FileName=os.path.splitext(path)[0]
|
||||
EmuRes.append(FileName)
|
||||
print("DEBUG : " + FileName)
|
||||
|
||||
cnt = Counter(EmuRes)
|
||||
global EmuCpt
|
||||
EmuCpt=len(cnt) - 1
|
||||
print(" Nmbre emulateur : " + str(EmuCpt))
|
||||
GenEmuList()
|
||||
|
||||
|
||||
|
||||
config_obj = configparser.ConfigParser()
|
||||
@ -258,30 +297,57 @@ EmuRightSquareY=(Ysize/3)
|
||||
|
||||
################ Carto Rom Mode ####################
|
||||
|
||||
RomIndice = 32
|
||||
RomIndice = 40
|
||||
|
||||
RomIndiceX = Xsize / 32
|
||||
RomIndiceY = Ysize / 32
|
||||
#RomIndiceX = round(Xsize / RomIndice)
|
||||
#RomIndiceY = round(Ysize / RomIndice)
|
||||
|
||||
RomIndiceX = RomIndice
|
||||
RomIndiceY = RomIndice
|
||||
|
||||
RomUpSquareX=RomIndiceX
|
||||
RomUpSquareY=RomIndiceY
|
||||
RomUpSquareSizeX=15*RomIndiceX
|
||||
RomUpSquareSizeY=5*RomIndiceY
|
||||
#RomUpSquareSizeX=round((Xsize/2)-(RomIndiceX/2)-RomIndiceX)
|
||||
#RomUpSquareSizeY=round((Ysize/3)-(RomIndiceY*4))
|
||||
|
||||
RomUpSquareSizeX=((Xsize-(RomIndiceX*3))/2)
|
||||
RomUpSquareSizeY=(Ysize-(RomIndiceY))
|
||||
|
||||
RomMiddleSquareX=RomIndiceX
|
||||
RomMiddleSquareY=RomIndiceY*6
|
||||
RomMiddleSquareSizeX=15*RomIndiceX
|
||||
RomMiddleSquareSizeY=5*RomIndiceY
|
||||
RomMiddleSquareY=(RomIndiceY*2) + RomUpSquareSizeY
|
||||
RomMiddleSquareSizeX=RomUpSquareSizeX
|
||||
RomMiddleSquareSizeY=RomUpSquareSizeY
|
||||
|
||||
RomBottomSquareX=RomIndiceX
|
||||
RomBottomSquareY=RomIndiceY*12
|
||||
RomBottomSquareSizeX=15*RomIndiceX
|
||||
RomBottomSquareSizeY=5*RomIndiceY
|
||||
RomBottomSquareY=(RomIndiceY*3) + (RomUpSquareSizeY*2)
|
||||
RomBottomSquareSizeX=RomUpSquareSizeX
|
||||
RomBottomSquareSizeY=RomUpSquareSizeY
|
||||
|
||||
RomLeftSquareX=RomIndiceX*16
|
||||
RomLeftSquareX=(RomIndiceX*2) + RomUpSquareSizeX
|
||||
RomLeftSquareY=RomIndiceY
|
||||
RomLeftSquareSizeX=15*RomIndiceX
|
||||
RomLeftSquareSizeY=18*RomIndiceY
|
||||
RomLeftSquareSizeX=RomUpSquareSizeX - RomIndiceX
|
||||
RomLeftSquareSizeY=(RomIndiceY*2) + (RomUpSquareSizeY*3)
|
||||
|
||||
print("RomIndice :" + str(RomIndice))
|
||||
print("RomIndiceX :" + str(RomIndiceX))
|
||||
print("RomIndiceY :" + str(RomIndiceY))
|
||||
print("RomUpSquareX :" + str(RomUpSquareX))
|
||||
print("RomUpSquareY :" + str(RomUpSquareY))
|
||||
print("RomUpSquareSizeX :" + str(RomUpSquareSizeX))
|
||||
print("RomUpSquareSizeY :" + str(RomUpSquareSizeY))
|
||||
print("RomMiddleSquareX :" + str(RomMiddleSquareX))
|
||||
print("RomMiddleSquareY :" + str(RomMiddleSquareY))
|
||||
print("RomMiddleSquareSizeX :" + str(RomMiddleSquareSizeX))
|
||||
print("RomMiddleSquareSizeY :" + str(RomMiddleSquareSizeY))
|
||||
print("RomBottomSquareX :" + str(RomBottomSquareX))
|
||||
print("RomBottomSquareY :" + str(RomBottomSquareY))
|
||||
print("RomBottomSquareSizeX :" + str(RomBottomSquareSizeX))
|
||||
print("RomBottomSquareSizeY :" + str(RomBottomSquareSizeY))
|
||||
print("RomLeftSquareX :" + str(RomLeftSquareX))
|
||||
print("RomLeftSquareY :" + str(RomLeftSquareY))
|
||||
print("RomLeftSquareSizeX :" + str(RomLeftSquareSizeX))
|
||||
print("RomLeftSquareSizeY :" + str(RomLeftSquareSizeY))
|
||||
|
||||
|
||||
####################################################
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user