Skip to content

Commit

Permalink
Update 2.3
Browse files Browse the repository at this point in the history
Look at the changelogs file.
  • Loading branch information
vincent-coding committed Mar 22, 2021
1 parent d30f482 commit 3fcea08
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 129 deletions.
9 changes: 9 additions & 0 deletions CHANGELOGS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
UPDATE 2.3
22/03/2021

- Adding a CHANGELOGS file
- Addition of an update checking system
- Deactivation of the "Get Current Color" option due to a bug (crash)
- Added support for version 5.5.5
- Added support for version 5.5.3 for USA and JAP consoles.
- Added better support for the software icon for Windows (software crashed when the icon was not loaded.)
205 changes: 99 additions & 106 deletions DarkU.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# !usr/bin/env python
# -*- coding: utf-8 -*-

import sys, os, re, calendar, time
import sys, os, re, calendar, time, requests
from sys import platform

sys.dont_write_bytecode = True
Expand All @@ -21,7 +21,7 @@
sys.exit('The color.py file located in the assets folder is missing.')

try:
from PyQt5 import QtWidgets
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtWidgets import QMessageBox
except:
sys.exit(color.red + "The PyQt5 module is missing.")
Expand All @@ -42,24 +42,22 @@
except:
sys.exit(color.red + "The gui.py file in the assets folder is missing!")


# System Verification
if platform == "linux" or platform == "linux2" or platform == "darwin":
separator = "/"
elif platform == "win32":
separator = "\\"
else:
sys.exit(color.red + "Your system was not recognised.\nPlease contact me as soon as possible!")

sep = os.path.sep

# Variables
version = "2.2"
version = "2.3"
error = 0
filePath = os.getcwd() + separator + "assets" + separator + "config.darku"
filePath = os.getcwd() + sep + "assets" + sep + "config.darku"
title = "DarkU v" + version
ram_55X = 0x105DD0A8
ram_554 = 0x105DD2A8
lastVer = "5.5.4"


EUR_554 = 0x105DD2A8
EUR_55X = 0x105DD0A8
ALL_55X = 0x105DD0A4

TITLE_ID_EUR = 0x0005001010040200
TITLE_ID_USA = 0x0005001010040100
TITLE_ID_JAP = 0x0005001010040000


# Discord RPC
Expand Down Expand Up @@ -110,8 +108,21 @@ def __init__(self, parent = None):

self.ui.connectionButton.clicked.connect(self.connection)
self.ui.disconnectionButton.clicked.connect(self.disconnection)
self.ui.getCurrentColorButton.clicked.connect(self.getCurrentColor)
self.ui.regionComboBox.currentTextChanged.connect(self.regionChanged)
#self.ui.getCurrentColorButton.clicked.connect(self.getCurrentColor)
self.ui.applyButton.clicked.connect(self.applyColor)

try:
r = requests.get('https://raw.githubusercontent.com/vincent-coding/DarkU/2.X/lastVersion')
if r.status_code == 200:
lastVer = r.text.replace("\n", "")
if lastVer != version:
self.ui.newVersionLabel.setText("<html><head/><body><p><a href=\"https://github.com/vincent-coding/DarkU/releases/latest\"><span style=\" text-decoration: underline; color:#3498db;\">New update available (" + lastVer + ")</span></a></p></body></html>")
else:
self.ui.newVersionLabel.setText("")
except:
self.ui.newVersionLabel.setText("Cannot detect if an update has been released.")


def closeEvent(self, event):
if self.connected == True:
Expand Down Expand Up @@ -149,10 +160,7 @@ def connection(self):
self.ui.ipTextBox.setEnabled(False)
self.ui.connectionButton.setEnabled(False)
self.ui.disconnectionButton.setEnabled(True)
self.ui.versionComboBox.setEnabled(True)
self.ui.colorComboBox.setEnabled(True)
self.ui.applyButton.setEnabled(True)
self.ui.getCurrentColorButton.setEnabled(True)
self.ui.regionComboBox.setEnabled(True)
self.connected = True

QMessageBox.information(self, title, "The connection to " + wiiu_ip + " was a success!")
Expand All @@ -172,105 +180,90 @@ def disconnection(self):
self.ui.ipTextBox.setEnabled(True)
self.ui.connectionButton.setEnabled(True)
self.ui.disconnectionButton.setEnabled(False)
self.ui.regionComboBox.setEnabled(False)
self.ui.versionComboBox.setEnabled(False)
self.ui.colorComboBox.setEnabled(False)
self.ui.applyButton.setEnabled(False)
self.ui.getCurrentColorButton.setEnabled(False)
self.ui.regionComboBox.setCurrentIndex(0)
self.ui.versionComboBox.setCurrentIndex(0)
self.ui.colorComboBox.setCurrentIndex(0)
QMessageBox.information(self, title, "Disconnection of the console was successful!")
except:
QMessageBox.critical(self, title, "An error occurred when disconnecting the console!")

def getCurrentColor(self):
wiiu_version = self.ui.versionComboBox.currentIndex()
if wiiu_version == 0:
return QMessageBox.critical(self, title, "Please choose a version!")
if wiiu_version == 1:
return QMessageBox.critical(self, title, "This option is only available for WiiUs with the latest available version (" + lastVer + ").")
if wiiu_version == 2:
value = self.gecko.readmem(ram_554, 4).hex()
if value.lower() == "3f800000":
return self.ui.colorComboBox.setCurrentIndex(1)
if value.lower() == "40000000":
return self.ui.colorComboBox.setCurrentIndex(2)
if value.lower() == "3e800000":
return self.ui.colorComboBox.setCurrentIndex(3)
if value.lower() == "3d800000":
return self.ui.colorComboBox.setCurrentIndex(4)
if value.lower() == "3c800000":
return self.ui.colorComboBox.setCurrentIndex(5)
if value.lower() == "3b800000":
return self.ui.colorComboBox.setCurrentIndex(6)
if value.lower() == "00000000":
return self.ui.colorComboBox.setCurrentIndex(7)
QMessageBox.critical(self, title, "No colour was determined.")

def applyColor(self):
wiiu_version = self.ui.versionComboBox.currentIndex()
color_index = self.ui.colorComboBox.currentIndex()
if wiiu_version == 0:
def regionChanged(self):
regionComboBox = self.ui.regionComboBox.currentIndex()
if regionComboBox == 0:
self.ui.versionComboBox.setEnabled(False)
self.ui.colorComboBox.setEnabled(False)
self.ui.applyButton.setEnabled(False)
self.ui.getCurrentColorButton.setEnabled(False)
#QMessageBox.critical(self, title, "Please select a region!")
elif regionComboBox == 1 or regionComboBox == 2:
if regionComboBox == 1:
self.region = "EUR"
elif regionComboBox == 2:
self.region = "JAP-USA"
else:
return QMessageBox.critical(self, title, "An error has occurred!")
self.ui.versionComboBox.setEnabled(True)
self.ui.colorComboBox.setEnabled(True)
self.ui.applyButton.setEnabled(True)
#self.ui.getCurrentColorButton.setEnabled(True)
self.ui.getCurrentColorButton.setEnabled(False)

def applyColor(self):
if self.ui.regionComboBox.currentIndex() == 0:
return QMessageBox.critical(self, title, "An unknown error has occurred!")
elif self.ui.versionComboBox.currentIndex() == 0:
return QMessageBox.critical(self, title, "Please choose a version!")
if wiiu_version == 1:
if color_index == 0:
return QMessageBox.critical(self, title, "Please choose a color!")
QMessageBox.warning(self, title, "You are on an older version of the WiiU, the values do not always work.\n\nIf this does not work, please update your console version to the latest available version (" + lastVer + ").")
try:
if color_index == 1:
self.gecko.pokemem(ram_55X, 0x3f800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 2:
self.gecko.pokemem(ram_55X, 0x40000000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 3:
self.gecko.pokemem(ram_55X, 0x3E800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 4:
self.gecko.pokemem(ram_55X, 0x3D800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 5:
self.gecko.pokemem(ram_55X, 0x3C800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 6:
self.gecko.pokemem(ram_55X, 0x3B800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 7:
self.gecko.pokemem(ram_55X, 0x00000000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
QMessageBox.critical(self, title, "An error occurred when determining the chosen colour.")
except:
QMessageBox.critical(self, title, "An error occurred when sending the request.")
if wiiu_version == 2:
if color_index == 0:
return QMessageBox.critical(self, title, "Please choose a color!")
try:
if color_index == 1:
self.gecko.pokemem(ram_554, 0x3f800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 2:
self.gecko.pokemem(ram_554, 0x40000000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 3:
self.gecko.pokemem(ram_554, 0x3E800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 4:
self.gecko.pokemem(ram_554, 0x3D800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 5:
self.gecko.pokemem(ram_554, 0x3C800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 6:
self.gecko.pokemem(ram_554, 0x3B800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 7:
self.gecko.pokemem(ram_554, 0x00000000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
QMessageBox.critical(self, title, "An error occurred when determining the chosen colour.")
except:
QMessageBox.critical(self, title, "An error occurred when sending the request.")
elif self.ui.colorComboBox.currentIndex() == 0:
return QMessageBox.critical(self, title, "Please choose a colour!")

if self.ui.regionComboBox.currentIndex() == 1:
if self.ui.versionComboBox.currentIndex() == 1:
usedRAM = EUR_55X
elif self.ui.versionComboBox.currentIndex() == 2:
usedRAM = EUR_554
else:
return QMessageBox.critical(self, title, "An unknown error has occurred!")
elif self.ui.regionComboBox.currentIndex() == 2:
usedRAM = ALL_55X

color_index = self.ui.colorComboBox.currentIndex()
if color_index == 1:
self.gecko.pokemem(usedRAM, 0x3f800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 2:
self.gecko.pokemem(usedRAM, 0x40000000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 3:
self.gecko.pokemem(usedRAM, 0x3E800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 4:
self.gecko.pokemem(usedRAM, 0x3D800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 5:
self.gecko.pokemem(usedRAM, 0x3C800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 6:
self.gecko.pokemem(ram_55X, 0x3B800000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())
if color_index == 7:
self.gecko.pokemem(usedRAM, 0x00000000)
return QMessageBox.information(self, title, "The colour has been changed to: " + self.ui.colorComboBox.currentText())



if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
window = MyWindow()
window.setWindowTitle("DarkU v" + version)
try:
scriptDir = os.path.dirname(os.path.realpath(__file__))
window.setWindowIcon(QtGui.QIcon(scriptDir + os.path.sep + 'assets' + os.path.sep + 'icons.png'))
except:
pass
window.show()
sys.exit(app.exec_())
Loading

0 comments on commit 3fcea08

Please sign in to comment.