Skip to content

Commit

Permalink
Configure card read DMA setting for TWL titles in DSi mode
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Sep 4, 2024
1 parent c6841b3 commit e21a3cb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 34 deletions.
14 changes: 4 additions & 10 deletions romsel_aktheme/arm9/source/perGameSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ void perGameSettings (std::string filename) {
perGameOps++;
perGameOp[perGameOps] = 4; // VRAM Boost
}
if (bootstrapEnabled && romUnitCode[cursorPosOnScreen] < 3 && !blacklisted_cardReadDma) {
if (bootstrapEnabled && !blacklisted_cardReadDma) {
perGameOps++;
perGameOp[perGameOps] = 5; // Card Read DMA
}
Expand Down Expand Up @@ -788,9 +788,7 @@ void perGameSettings (std::string filename) {
break;
case 5:
printSmall(false, perGameOpXpos, perGameOpYpos, "Card Read DMA:", Alignment::left, highlighted);
if (dsiFeatures() && romUnitCode[cursorPosOnScreen] > 0 && (perGameSettings_dsiMode==-1 ? DEFAULT_DSI_MODE : perGameSettings_dsiMode > 0)) {
printSmall(false, 256-perGameOpXpos, perGameOpYpos, "Off", Alignment::right, highlighted);
} else if (perGameSettings_cardReadDMA == -1) {
if (perGameSettings_cardReadDMA == -1) {
printSmall(false, 256-perGameOpXpos, perGameOpYpos, "Default", Alignment::right, highlighted);
} else if (perGameSettings_cardReadDMA == 1) {
printSmall(false, 256-perGameOpXpos, perGameOpYpos, "On", Alignment::right, highlighted);
Expand Down Expand Up @@ -974,10 +972,8 @@ void perGameSettings (std::string filename) {
}
break;
case 5:
if (!dsiFeatures() || romUnitCode[cursorPosOnScreen] == 0 || (perGameSettings_dsiMode==-1 ? (DEFAULT_DSI_MODE == TWLSettings::EDSMode) : perGameSettings_dsiMode < 1)) {
perGameSettings_cardReadDMA--;
if (perGameSettings_cardReadDMA < -1) perGameSettings_cardReadDMA = 1;
}
perGameSettings_cardReadDMA--;
if (perGameSettings_cardReadDMA < -1) perGameSettings_cardReadDMA = 1;
break;
case 6:
perGameSettings_directBoot = !perGameSettings_directBoot;
Expand Down Expand Up @@ -1051,10 +1047,8 @@ void perGameSettings (std::string filename) {
}
break;
case 5:
if (!dsiFeatures() || romUnitCode[cursorPosOnScreen] == 0 || (perGameSettings_dsiMode==-1 ? (DEFAULT_DSI_MODE == TWLSettings::EDSMode) : perGameSettings_dsiMode < 1)) {
perGameSettings_cardReadDMA++;
if (perGameSettings_cardReadDMA > 1) perGameSettings_cardReadDMA = -1;
}
break;
case 6:
perGameSettings_directBoot = !perGameSettings_directBoot;
Expand Down
18 changes: 6 additions & 12 deletions romsel_dsimenutheme/arm9/source/perGameSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ void perGameSettings (std::string filename) {
perGameOps++;
perGameOp[perGameOps] = 4; // VRAM Boost
}
if (bootstrapEnabled && unitCode[CURPOS] < 3 && !blacklisted_cardReadDma) {
if (bootstrapEnabled && !blacklisted_cardReadDma) {
perGameOps++;
perGameOp[perGameOps] = 5; // Card Read DMA
}
Expand Down Expand Up @@ -884,9 +884,7 @@ void perGameSettings (std::string filename) {
break;
case 5:
printSmall(false, perGameOpStartXpos, perGameOpYpos, STR_CARD_READ_DMA + ":", startAlign, FontPalette::dialog);
if (dsiFeatures() && unitCode[CURPOS] > 0 && (perGameSettings_dsiMode==-1 ? DEFAULT_DSI_MODE : perGameSettings_dsiMode > 0)) {
printSmall(false, perGameOpEndXpos, perGameOpYpos, STR_OFF, endAlign, FontPalette::dialog);
} else if (perGameSettings_cardReadDMA == -1) {
if (perGameSettings_cardReadDMA == -1) {
printSmall(false, perGameOpEndXpos, perGameOpYpos, STR_DEFAULT, endAlign, FontPalette::dialog);
} else if (perGameSettings_cardReadDMA == 1) {
printSmall(false, perGameOpEndXpos, perGameOpYpos, STR_ON, endAlign, FontPalette::dialog);
Expand Down Expand Up @@ -1080,10 +1078,8 @@ void perGameSettings (std::string filename) {
}
break;
case 5:
if (!dsiFeatures() || unitCode[CURPOS] == 0 || (perGameSettings_dsiMode==-1 ? (DEFAULT_DSI_MODE == TWLSettings::EDSMode) : perGameSettings_dsiMode < 1)) {
perGameSettings_cardReadDMA--;
if (perGameSettings_cardReadDMA < -1) perGameSettings_cardReadDMA = 1;
}
perGameSettings_cardReadDMA--;
if (perGameSettings_cardReadDMA < -1) perGameSettings_cardReadDMA = 1;
break;
case 6:
perGameSettings_directBoot = !perGameSettings_directBoot;
Expand Down Expand Up @@ -1158,10 +1154,8 @@ void perGameSettings (std::string filename) {
}
break;
case 5:
if (!dsiFeatures() || unitCode[CURPOS] == 0 || (perGameSettings_dsiMode==-1 ? (DEFAULT_DSI_MODE == TWLSettings::EDSMode) : perGameSettings_dsiMode < 1)) {
perGameSettings_cardReadDMA++;
if (perGameSettings_cardReadDMA > 1) perGameSettings_cardReadDMA = -1;
}
perGameSettings_cardReadDMA++;
if (perGameSettings_cardReadDMA > 1) perGameSettings_cardReadDMA = -1;
break;
case 6:
perGameSettings_directBoot = !perGameSettings_directBoot;
Expand Down
18 changes: 6 additions & 12 deletions romsel_r4theme/arm9/source/perGameSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ void perGameSettings (std::string filename) {
perGameOps++;
perGameOp[perGameOps] = 4; // VRAM Boost
}
if (bootstrapEnabled && romUnitCode < 3 && !blacklisted_cardReadDma) {
if (bootstrapEnabled && !blacklisted_cardReadDma) {
perGameOps++;
perGameOp[perGameOps] = 5; // Card Read DMA
}
Expand Down Expand Up @@ -795,9 +795,7 @@ void perGameSettings (std::string filename) {
break;
case 5:
printSmall(false, perGameOpXpos, perGameOpYpos, "Card Read DMA:", Alignment::left, highlighted);
if (dsiFeatures() && romUnitCode > 0 && (perGameSettings_dsiMode==-1 ? DEFAULT_DSI_MODE : perGameSettings_dsiMode > 0)) {
printSmall(false, 256-perGameOpXpos, perGameOpYpos, "Off", Alignment::right, highlighted);
} else if (perGameSettings_cardReadDMA == -1) {
if (perGameSettings_cardReadDMA == -1) {
printSmall(false, 256-perGameOpXpos, perGameOpYpos, "Default", Alignment::right, highlighted);
} else if (perGameSettings_cardReadDMA == 1) {
printSmall(false, 256-perGameOpXpos, perGameOpYpos, "On", Alignment::right, highlighted);
Expand Down Expand Up @@ -981,10 +979,8 @@ void perGameSettings (std::string filename) {
}
break;
case 5:
if (!dsiFeatures() || romUnitCode == 0 || (perGameSettings_dsiMode==-1 ? (DEFAULT_DSI_MODE == TWLSettings::EDSMode) : perGameSettings_dsiMode < 1)) {
perGameSettings_cardReadDMA--;
if (perGameSettings_cardReadDMA < -1) perGameSettings_cardReadDMA = 1;
}
perGameSettings_cardReadDMA--;
if (perGameSettings_cardReadDMA < -1) perGameSettings_cardReadDMA = 1;
break;
case 6:
perGameSettings_directBoot = !perGameSettings_directBoot;
Expand Down Expand Up @@ -1058,10 +1054,8 @@ void perGameSettings (std::string filename) {
}
break;
case 5:
if (!dsiFeatures() || romUnitCode == 0 || (perGameSettings_dsiMode==-1 ? (DEFAULT_DSI_MODE == TWLSettings::EDSMode) : perGameSettings_dsiMode < 1)) {
perGameSettings_cardReadDMA++;
if (perGameSettings_cardReadDMA > 1) perGameSettings_cardReadDMA = -1;
}
perGameSettings_cardReadDMA++;
if (perGameSettings_cardReadDMA > 1) perGameSettings_cardReadDMA = -1;
break;
case 6:
perGameSettings_directBoot = !perGameSettings_directBoot;
Expand Down

0 comments on commit e21a3cb

Please sign in to comment.