@@ -183,7 +183,6 @@ def getInput(options):
183183
184184# Section: sdWritable
185185def writeProtectCheck ():
186- global fs
187186 prinfo ("Checking if SD card is writeable..." )
188187 if not is_writable ():
189188 prbad ("Error 02: Your SD card is write protected! If using a full size SD card, ensure that the lock switch is facing upwards." )
@@ -192,15 +191,6 @@ def writeProtectCheck():
192191 else :
193192 prgood ("SD card is writeable!" )
194193
195- # Section: SD card free space
196- # ensure 16MB free space
197- freeSpace = shutil .disk_usage (scriptroot ).free
198- if not freeSpace >= 16 * 1024 * 1024 :
199- prbad (f"Error 06: You need at least 16MB free space on your SD card, you have { (freeSpace / 1000000 ):.2f} bytes!" )
200- prbad ("Error 06: You need at least 16MB free space on your SD card!" )
201- prinfo ("Please free up some space and try again." )
202- exitOnEnter ()
203-
204194clearScreen ()
205195print (f"MSET9 { VERSION } SETUP by zoogie, Aven, DannyAAM and thepikachugamer" )
206196print ("What is your console model and version?" )
@@ -254,7 +244,7 @@ def writeProtectCheck():
254244triggerFilePath = ""
255245
256246def createHaxID1 ():
257- global fs , ID0 , hackedID1Path , realID1Path , realID1BackupTag
247+ global ID0 , hackedID1Path , realID1Path , realID1BackupTag
258248
259249 print ("\033 [0;33m=== DISCLAIMER ===\033 [0m" ) # 5;33m? The blinking is awesome but I also don't want to frighten users lol
260250 print ()
@@ -317,7 +307,7 @@ def createHaxID1():
317307miiPlazaExtdata = False
318308
319309def sanity ():
320- global fs , hackedID1Path , titleDatabasesGood , menuExtdataGood , miiExtdataGood , miiPlazaExtdata
310+ global hackedID1Path , titleDatabasesGood , menuExtdataGood , miiExtdataGood , miiPlazaExtdata
321311
322312 prinfo ("Checking databases..." )
323313 checkTitledb = softcheck (hackedID1Path + "/dbs/title.db" , 0x31E400 )
@@ -380,7 +370,7 @@ def sanityReport():
380370 print ()
381371
382372def injection (create = True ):
383- global fs , haxState , hackedID1Path , trigger
373+ global haxState , hackedID1Path , trigger
384374
385375 triggerFilePath = hackedID1Path + "/extdata/" + trigger
386376
@@ -392,6 +382,11 @@ def injection(create=True):
392382 os .remove (abs (triggerFilePath ))
393383 haxState = 4
394384 prgood ("Removed trigger file." )
385+ freeSpace = shutil .disk_usage (scriptroot ).free
386+ if freeSpace < 16 * 1024 * 1024 :
387+ prbad (f"Error 06: You need at least 16MB free space on your SD card, you have { (freeSpace / 1000000 ):.2f} bytes!" )
388+ prbad ("Error 06: You need at least 16MB free space on your SD card!" )
389+ prinfo ("Please free up some space and try again." )
395390 return
396391
397392 prinfo ("Injecting trigger file..." )
@@ -403,7 +398,7 @@ def injection(create=True):
403398 exitOnEnter ()
404399
405400def remove ():
406- global fs , ID0 , ID1 , hackedID1Path , realID1Path , realID1BackupTag , titleDatabasesGood
401+ global ID0 , ID1 , hackedID1Path , realID1Path , realID1BackupTag , titleDatabasesGood
407402
408403 prinfo ("Removing MSET9..." )
409404
@@ -425,7 +420,6 @@ def remove():
425420 prgood ("Successfully removed MSET9!" )
426421
427422def softcheck (keyfile , expectedSize = None , crc32 = None ):
428- global fs
429423 filename = keyfile .rsplit ("/" )[- 1 ]
430424
431425 if not os .path .exists (abs (keyfile )):
0 commit comments