diff --git a/modules/__pycache__/arrow.cpython-310.pyc b/modules/__pycache__/arrow.cpython-310.pyc deleted file mode 100644 index e539ba2..0000000 Binary files a/modules/__pycache__/arrow.cpython-310.pyc and /dev/null differ diff --git a/modules/__pycache__/emulateur_display.cpython-310.pyc b/modules/__pycache__/emulateur_display.cpython-310.pyc deleted file mode 100644 index 49dbbf3..0000000 Binary files a/modules/__pycache__/emulateur_display.cpython-310.pyc and /dev/null differ diff --git a/start.py b/start.py index c82e953..d7f25c6 100755 --- a/start.py +++ b/start.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 global cpt +global EmuMod + FirstRun = 1 cpt = 0 import configparser @@ -19,9 +21,11 @@ import os #from arrow import * +#EmuMod : +# 0 : Emu select +# 1 : Rom select -EmuMod = 1 -RomMod = 0 +EmuMod = 0 #def EmuMod(): @@ -56,10 +60,10 @@ def BackgroundEmu(): LabelBgEmu.BgEmu = BgEmu Cnv.create_image( 0, 0, image = BgEmu, anchor = "nw") -def EnterEmu(): - EmuMod=0 - RomMod=1 +def EnterEmu(GetEmuMod): + global EmuMod global cpt + EmuMod=1 runMcpt = cpt + 1 if runMcpt > EmuCpt: runMcpt = 0 @@ -100,7 +104,7 @@ def ViewEmu(cL,xL,yL,cM,xM,yM,cR,xR,yR): Cnv.create_image(xR, yR, image=PNfR) print("Curent Emu : " + str(res[cM])) -def leftKey(): +def leftKey(GetEmuMod): global cpt cpt = cpt - 1 if cpt < 0: @@ -113,10 +117,11 @@ def leftKey(): Rcpt = 1 if Rcpt > EmuCpt: Rcpt = 0 + if GetEmuMod == 0: + print("DEBUG : " + str(EmuMod) + " Emu : " + str(cpt)) + ViewEmu(Lcpt,LeftSquareX, LeftSquareY,Mcpt,MiddleSquareX, MiddleSquareY,Rcpt,RightSquareX, RightSquareY) - ViewEmu(Lcpt,LeftSquareX, LeftSquareY,Mcpt,MiddleSquareX, MiddleSquareY,Rcpt,RightSquareX, RightSquareY) - -def rightKey(): +def rightKey(GetEmuMod): global cpt cpt = cpt + 1 if cpt > EmuCpt: @@ -131,11 +136,25 @@ def rightKey(): Rcpt = 0 - ViewEmu(Lcpt,LeftSquareX, LeftSquareY,Mcpt,MiddleSquareX, MiddleSquareY,Rcpt,RightSquareX, RightSquareY) + if GetEmuMod == 0: + print("DEBUG : " + str(EmuMod) + " Emu : " + str(cpt)) + ViewEmu(Lcpt,LeftSquareX, LeftSquareY,Mcpt,MiddleSquareX, MiddleSquareY,Rcpt,RightSquareX, RightSquareY) + +def Escape(GetEmuMod): + if GetEmuMod == 0: + print("Ciao !!") + arkadeus.quit() + if GetEmuMod == 1: + #Cnv.delete("all") + global EmuMod + global cpt + cpt = 0 + EmuMod = 0 + + BackgroundEmu() + ViewEmu(cpt,LeftSquareX, LeftSquareY,cpt+1,MiddleSquareX, MiddleSquareY,cpt+2,RightSquareX, RightSquareY) + -def Escape(event): - print("ESC key pressed") - arkadeus.quit() arkadeus= Tk() @@ -214,10 +233,10 @@ Cnv.pack(fill = "both", expand = True) BackgroundEmu() ViewEmu(cpt,LeftSquareX, LeftSquareY,cpt+1,MiddleSquareX, MiddleSquareY,cpt+2,RightSquareX, RightSquareY) -arkadeus.bind("", lambda event: leftKey()) -arkadeus.bind("", lambda event: rightKey()) -arkadeus.bind("", lambda event: EnterEmu()) -arkadeus.bind('',Escape) +arkadeus.bind("", lambda event: leftKey(EmuMod)) +arkadeus.bind("", lambda event: rightKey(EmuMod)) +arkadeus.bind("", lambda event: EnterEmu(EmuMod)) +arkadeus.bind('',lambda event : Escape(EmuMod)) arkadeus.mainloop()