mirror of
https://github.com/sanni/cartreader.git
synced 2024-11-27 15:04:15 +01:00
Display full ROM title for GB and GBA
This commit is contained in:
parent
2de810782a
commit
eed3324a56
@ -787,11 +787,17 @@ void getCartInfo_GB() {
|
|||||||
|
|
||||||
// Get name
|
// Get name
|
||||||
byte myLength = 0;
|
byte myLength = 0;
|
||||||
|
byte x = 0;
|
||||||
for (int addr = 0x0134; addr <= 0x13C; addr++) {
|
if (sdBuffer[0x143] == 0x80 || sdBuffer[0x143] == 0xC0) {
|
||||||
if (((char(sdBuffer[addr]) >= 48 && char(sdBuffer[addr]) <= 57) || (char(sdBuffer[addr]) >= 65 && char(sdBuffer[addr]) <= 122)) && myLength < 15) {
|
x++;
|
||||||
|
}
|
||||||
|
for (int addr = 0x0134; addr <= 0x0143-x; addr++) {
|
||||||
|
if (isprint(sdBuffer[addr]) && sdBuffer[addr] != '<' && sdBuffer[addr] != '>' && sdBuffer[addr] != ':' && sdBuffer[addr] != '"' && sdBuffer[addr] != '/' && sdBuffer[addr] != '\\' && sdBuffer[addr] != '|' && sdBuffer[addr] != '?' && sdBuffer[addr] != '*') {
|
||||||
romName[myLength] = char(sdBuffer[addr]);
|
romName[myLength] = char(sdBuffer[addr]);
|
||||||
myLength++;
|
myLength++;
|
||||||
|
} else if (char(sdBuffer[addr]) != 0) {
|
||||||
|
romName[myLength] = 0x5F;
|
||||||
|
myLength++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -895,9 +895,12 @@ void getCartInfo_GBA() {
|
|||||||
byte myLength = 0;
|
byte myLength = 0;
|
||||||
for (int addr = 0xA0; addr <= 0xAB; addr++) {
|
for (int addr = 0xA0; addr <= 0xAB; addr++) {
|
||||||
myByte = sdBuffer[addr];
|
myByte = sdBuffer[addr];
|
||||||
if (((char(myByte) >= 48 && char(myByte) <= 57) || (char(myByte) >= 65 && char(myByte) <= 122)) && myLength < 15) {
|
if (isprint(myByte) && myByte != '<' && myByte != '>' && myByte != ':' && myByte != '"' && myByte != '/' && myByte != '\\' && myByte != '|' && myByte != '?' && myByte != '*') {
|
||||||
romName[myLength] = char(myByte);
|
romName[myLength] = char(myByte);
|
||||||
myLength++;
|
myLength++;
|
||||||
|
} else if (char(sdBuffer[addr]) != 0) {
|
||||||
|
romName[myLength] = 0x5F;
|
||||||
|
myLength++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user