aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorsanni <[email protected]>2022-02-12 13:15:53 +0100
committersanni <[email protected]>2022-02-12 13:15:53 +0100
commit11b8493c9255fb1090e288ea9884574158f46d73 (patch)
treea093c15a6d91b8171175c38dbe539a4546739431
parent8d9d85c9010ba59cf55d82dca9e236758d88c090 (diff)
downloadcartreader-11b8493c9255fb1090e288ea9884574158f46d73.tar.gz
cartreader-11b8493c9255fb1090e288ea9884574158f46d73.zip
If name consists out of all japanese characters use cart id
-rw-r--r--Cart_Reader/N64.ino10
1 files changed, 9 insertions, 1 deletions
diff --git a/Cart_Reader/N64.ino b/Cart_Reader/N64.ino
index bd0da3d..9b3d226 100644
--- a/Cart_Reader/N64.ino
+++ b/Cart_Reader/N64.ino
@@ -2403,12 +2403,20 @@ void idCart() {
// Get name
byte myLength = 0;
for (unsigned int i = 0; i < 20; i++) {
- if (((char(sdBuffer[0x20 + i]) >= 48 && char(sdBuffer[0x20 + i]) <= 57) || (char(sdBuffer[0x20 + i]) >= 65 && char(sdBuffer[0x20 + i]) <= 122)) && myLength < 15) {
+ if (((char(sdBuffer[0x20 + i]) >= 48 && char(sdBuffer[0x20 + i]) <= 57) || (char(sdBuffer[0x20 + i]) >= 65 && char(sdBuffer[0x20 + i]) <= 90) || (char(sdBuffer[0x20 + i]) >= 97 && char(sdBuffer[0x20 + i]) <= 122)) && myLength < 15) {
romName[myLength] = char(sdBuffer[0x20 + i]);
myLength++;
}
}
+ // If name consists out of all japanese characters use cart id
+ if (myLength == 0) {
+ romName[0] = sdBuffer[0x3B];
+ romName[1] = sdBuffer[0x3C];
+ romName[2] = sdBuffer[0x3D];
+ romName[3] = sdBuffer[0x3E];
+ }
+
// Get CRC1
for (int i = 0; i < 4; i++) {
if (sdBuffer[0x10 + i] < 0x10) {