Added Extended msu option to gui (#95)
* Added Extended msu option to gui
This commit is contained in:
		
							parent
							
								
									b2e20be077
								
							
						
					
					
						commit
						c8343df81e
					
				
							
								
								
									
										5
									
								
								Gui.py
								
								
								
								
							
							
						
						
									
										5
									
								
								Gui.py
								
								
								
								
							| 
						 | 
				
			
			@ -88,6 +88,9 @@ def guiMain(args=None):
 | 
			
		|||
    balancingVar = IntVar()
 | 
			
		||||
    balancingVar.set(1) #set default
 | 
			
		||||
    balancingCheckbutton = Checkbutton(checkBoxFrame, text="Multiworld Progression Balancing", variable=balancingVar)
 | 
			
		||||
    extendedmsuVar = IntVar()
 | 
			
		||||
    extendedmsuVar.set(0) #set default
 | 
			
		||||
    extendedmsuCheckbutton = Checkbutton(checkBoxFrame, text="Extended MSU", variable=extendedmsuVar)
 | 
			
		||||
    createSpoilerCheckbutton.pack(expand=True, anchor=W)
 | 
			
		||||
    suppressRomCheckbutton.pack(expand=True, anchor=W)
 | 
			
		||||
    openpyramidCheckbutton.pack(expand=True, anchor=W)
 | 
			
		||||
| 
						 | 
				
			
			@ -102,6 +105,7 @@ def guiMain(args=None):
 | 
			
		|||
    hintsCheckbutton.pack(expand=True, anchor=W)
 | 
			
		||||
    customCheckbutton.pack(expand=True, anchor=W)
 | 
			
		||||
    balancingCheckbutton.pack(expand=True, anchor=W)
 | 
			
		||||
    extendedmsuCheckbutton.pack(expand=True, anchor=W)
 | 
			
		||||
 | 
			
		||||
    romOptionsFrame = LabelFrame(rightHalfFrame, text="Rom options")
 | 
			
		||||
    romOptionsFrame.columnconfigure(0, weight=1)
 | 
			
		||||
| 
						 | 
				
			
			@ -438,6 +442,7 @@ def guiMain(args=None):
 | 
			
		|||
        guiargs.item_functionality = itemfunctionVar.get()
 | 
			
		||||
        guiargs.timer = timerVar.get()
 | 
			
		||||
        guiargs.skip_progression_balancing = not balancingVar.get()
 | 
			
		||||
        guiargs.extendedmsu = extendedmsuVar.get()
 | 
			
		||||
        if guiargs.timer == "none":
 | 
			
		||||
            guiargs.timer = False
 | 
			
		||||
        guiargs.dungeon_counters = dungeonCounterVar.get()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										11
									
								
								Rom.py
								
								
								
								
							
							
						
						
									
										11
									
								
								Rom.py
								
								
								
								
							| 
						 | 
				
			
			@ -22,7 +22,8 @@ from EntranceShuffle import door_addresses
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
JAP10HASH = '03a63945398191337e896e5771f77173'
 | 
			
		||||
# RANDOMIZERBASEHASH = '1907d4caccffe60fc69940cfa11b2dab'
 | 
			
		||||
RANDOMIZERBASEHASH = '1347ce535618fa1a844d2d45cf0ca661'
 | 
			
		||||
EXTENDEDMSURANDOMIZERBASEHASH = 'f42949bde03ba5ea71c2d43a21f5d6bf'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class JsonRom(object):
 | 
			
		||||
| 
						 | 
				
			
			@ -121,10 +122,10 @@ class LocalRom(object):
 | 
			
		|||
                    self.write_bytes(int(baseaddress), values)
 | 
			
		||||
 | 
			
		||||
        # verify md5
 | 
			
		||||
        # patchedmd5 = hashlib.md5()
 | 
			
		||||
        # patchedmd5.update(self.buffer)
 | 
			
		||||
        # if RANDOMIZERBASEHASH != patchedmd5.hexdigest():
 | 
			
		||||
        #     raise RuntimeError('Provided Base Rom unsuitable for patching. Please provide a JAP(1.0) "Zelda no Densetsu - Kamigami no Triforce (Japan).sfc" rom to use as a base.')
 | 
			
		||||
        patchedmd5 = hashlib.md5()
 | 
			
		||||
        patchedmd5.update(self.buffer)
 | 
			
		||||
        if patchedmd5.hexdigest() not in [RANDOMIZERBASEHASH, EXTENDEDMSURANDOMIZERBASEHASH]:
 | 
			
		||||
            raise RuntimeError('Provided Base Rom unsuitable for patching. Please provide a JAP(1.0) "Zelda no Densetsu - Kamigami no Triforce (Japan).sfc" rom to use as a base.')
 | 
			
		||||
 | 
			
		||||
    def write_crc(self):
 | 
			
		||||
        crc = (sum(self.buffer[:0x7FDC] + self.buffer[0x7FE0:]) + 0x01FE) & 0xFFFF
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue