Update NES.ino

This commit is contained in:
sanni 2022-10-04 15:48:11 +02:00
parent a9bf2b0cee
commit 20898cf3d3

View File

@ -227,6 +227,11 @@ void nesMenu() {
switch (answer) {
// Change Mapper
case 0:
romName[0] = 'C';
romName[1] = 'A';
romName[2] = 'R';
romName[3] = 'T';
romName[4] = '\0';
setMapper();
checkMapperSize();
setPRGSize();
@ -426,6 +431,27 @@ uint32_t uppow2(uint32_t n) {
return n;
}
void printPRG() {
display_Clear();
println_Msg(F("Printing PRG at 0x8000"));
char myBuffer[3];
for (word currLine = 0; currLine < 512; currLine += 16) {
for (byte currByte = 0; currByte < 16; currByte++) {
itoa (read_prg_byte(0x8000 + currLine + currByte), myBuffer, 16);
for (word i = 0; i < 2 - strlen(myBuffer); i++) {
print_Msg(F("0"));
}
// Now print the significant bits
print_Msg(myBuffer);
print_Msg(" ");
}
println_Msg("");
}
display_Update();
}
boolean getMapping() {
display_Clear();
println_Msg(F("Searching database"));
@ -463,6 +489,7 @@ boolean getMapping() {
romName[1] = 'A';
romName[2] = 'R';
romName[3] = 'T';
romName[4] = '\0';
return 0;
}
else {
@ -720,6 +747,7 @@ boolean getMapping() {
romName[1] = 'A';
romName[2] = 'R';
romName[3] = 'T';
romName[4] = '\0';
}
// Save Mapper
@ -742,10 +770,12 @@ boolean getMapping() {
println_Msg(F("Using manual selection"));
display_Update();
delay(1000);
printPRG();
romName[0] = 'C';
romName[1] = 'A';
romName[2] = 'R';
romName[3] = 'T';
romName[4] = '\0';
return 0;
}
}
@ -1006,6 +1036,7 @@ void selectMapping() {
romName[1] = 'A';
romName[2] = 'R';
romName[3] = 'T';
romName[4] = '\0';
}
// Save Mapper