Skip to content

Commit

Permalink
Set sound frequency setting for nds-bootstrap-hb when using Direct
Browse files Browse the repository at this point in the history
…bootloader setting
  • Loading branch information
RocketRobz committed Sep 17, 2024
1 parent 6ddfb9c commit c06e5fe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion quickmenu/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,7 @@ int dsClassicMenu(void) {
perGameSettings_dsiMode == -1 ? isModernHomebrew[ms().secondaryDevice] : perGameSettings_dsiMode,
perGameSettings_boostCpu == -1 ? DEFAULT_BOOST_CPU : perGameSettings_boostCpu,
perGameSettings_boostVram == -1 ? DEFAULT_BOOST_VRAM : perGameSettings_boostVram,
ms().consoleModel, /* ndsPreloaded */ false);
ms().consoleModel, ms().soundFreq, /* ndsPreloaded */ false);
} else {
err = 1;
}
Expand Down
4 changes: 2 additions & 2 deletions romsel_dsimenutheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,7 @@ int dsiMenuTheme(void) {
perGameSettings_dsiMode == -1 ? isModernHomebrew[CURPOS] : perGameSettings_dsiMode,
perGameSettings_boostCpu == -1 ? DEFAULT_BOOST_CPU : perGameSettings_boostCpu,
perGameSettings_boostVram == -1 ? DEFAULT_BOOST_VRAM : perGameSettings_boostVram,
ms().consoleModel, false);
ms().consoleModel, ms().soundFreq, false);
} else {
err = 1;
}
Expand Down Expand Up @@ -2655,7 +2655,7 @@ int dsiMenuTheme(void) {
0,
boostCpu,
boostVram,
ms().consoleModel, false);
ms().consoleModel, ms().soundFreq, false);
} else {
err = 1;
}
Expand Down
4 changes: 2 additions & 2 deletions universal/include/common/nds_bootstrap_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
extern "C" {
#endif

int bootstrapHbRunNds (const void* loader, u32 loaderSize, u32 cluster, u32 ramDiskCluster, u32 ramDiskSize, u32 srParamsCluster, u32 patchOffsetCacheCluster, u32 cfgCluster, u32 cfgSize, int romToRamDisk, bool romIsCompressed, bool initDisc, bool dldiPatchNds, int argc, const char** argv, int language, int dsiMode, bool boostCpu, bool boostVram, int consoleModel, u32 srTid1, u32 srTid2, bool ndsPreloaded);
int bootstrapHbRunNds (const void* loader, u32 loaderSize, u32 cluster, u32 ramDiskCluster, u32 ramDiskSize, u32 srParamsCluster, u32 patchOffsetCacheCluster, u32 cfgCluster, u32 cfgSize, int romToRamDisk, bool romIsCompressed, bool initDisc, bool dldiPatchNds, int argc, const char** argv, int language, int dsiMode, bool boostCpu, bool boostVram, int consoleModel, bool soundFreq, u32 srTid1, u32 srTid2, bool ndsPreloaded);

int bootstrapHbRunNdsFile (const char* filename, const char* fatFilename, const char* ramDiskFilename, const char* cfgFilename, u32 ramDiskSize, const char* srParamsFilename, const char* patchOffsetCacheFilename, u32 cfgSize, int romToRamDisk, bool romIsCompressed, int argc, const char** argv, int language, int dsiMode, bool boostCpu, bool boostVram, int consoleModel, bool ndsPreloaded);
int bootstrapHbRunNdsFile (const char* filename, const char* fatFilename, const char* ramDiskFilename, const char* cfgFilename, u32 ramDiskSize, const char* srParamsFilename, const char* patchOffsetCacheFilename, u32 cfgSize, int romToRamDisk, bool romIsCompressed, int argc, const char** argv, int language, int dsiMode, bool boostCpu, bool boostVram, int consoleModel, bool soundFreq, bool ndsPreloaded);

void bootstrapHbRunPrep (int romToRamDisk);

Expand Down
10 changes: 6 additions & 4 deletions universal/source/nds_loader/nds_bootstrap_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
#define ROM_IS_COMPRESSED_OFFSET 64
#define PATCHCACHE_FILE_OFFSET 68
#define SOFTRESET_FILE_OFFSET 72
#define PRELOADED_OFFSET 76
#define SOUND_FREQ_OFFSET 76
#define PRELOADED_OFFSET 80


typedef signed int addr_t;
Expand All @@ -97,7 +98,7 @@ char* hbLoad_bin = (char*)0x02FC0000;
char* hbLoadInject_bin = (char*)0x02FD0000;
char* imgTemplateBuffer = (char*)0x02FB0000;

int bootstrapHbRunNds (const void* loader, u32 loaderSize, u32 cluster, u32 ramDiskCluster, u32 ramDiskSize, u32 srParamsCluster, u32 patchOffsetCacheCluster, u32 cfgCluster, u32 cfgSize, int romToRamDisk, bool romIsCompressed, bool initDisc, bool dldiPatchNds, int argc, const char** argv, int language, int dsiMode, bool boostCpu, bool boostVram, int consoleModel, u32 srTid1, u32 srTid2, bool ndsPreloaded)
int bootstrapHbRunNds (const void* loader, u32 loaderSize, u32 cluster, u32 ramDiskCluster, u32 ramDiskSize, u32 srParamsCluster, u32 patchOffsetCacheCluster, u32 cfgCluster, u32 cfgSize, int romToRamDisk, bool romIsCompressed, bool initDisc, bool dldiPatchNds, int argc, const char** argv, int language, int dsiMode, bool boostCpu, bool boostVram, int consoleModel, bool soundFreq, u32 srTid1, u32 srTid2, bool ndsPreloaded)
{
char* argStart;
u16* argData;
Expand Down Expand Up @@ -182,6 +183,7 @@ int bootstrapHbRunNds (const void* loader, u32 loaderSize, u32 cluster, u32 ramD
writeAddr ((data_t*) LCDC_BANK_D, PATCHCACHE_FILE_OFFSET, patchOffsetCacheCluster);
writeAddr ((data_t*) LCDC_BANK_D, SOFTRESET_FILE_OFFSET, srParamsCluster);
writeAddr ((data_t*) LCDC_BANK_D, PRELOADED_OFFSET, ndsPreloaded);
writeAddr ((data_t*) LCDC_BANK_D, SOUND_FREQ_OFFSET, soundFreq);


//nocashMessage("irqDisable(IRQ_ALL);");
Expand Down Expand Up @@ -215,7 +217,7 @@ int bootstrapHbRunNds (const void* loader, u32 loaderSize, u32 cluster, u32 ramD
return true;
}

int bootstrapHbRunNdsFile (const char* filename, const char* fatFilename, const char* ramDiskFilename, const char* cfgFilename, u32 ramDiskSize, const char* srParamsFilename, const char* patchOffsetCacheFilename, u32 cfgSize, int romToRamDisk, bool romIsCompressed, int argc, const char** argv, int language, int dsiMode, bool boostCpu, bool boostVram, int consoleModel, bool ndsPreloaded) {
int bootstrapHbRunNdsFile (const char* filename, const char* fatFilename, const char* ramDiskFilename, const char* cfgFilename, u32 ramDiskSize, const char* srParamsFilename, const char* patchOffsetCacheFilename, u32 cfgSize, int romToRamDisk, bool romIsCompressed, int argc, const char** argv, int language, int dsiMode, bool boostCpu, bool boostVram, int consoleModel, bool soundFreq, bool ndsPreloaded) {
if (!bootloaderFound) {
return 3;
}
Expand Down Expand Up @@ -300,7 +302,7 @@ int bootstrapHbRunNdsFile (const char* filename, const char* fatFilename, const

//installBootStub(havedsiSD);

return bootstrapHbRunNds (hbLoad_bin, 0x10000, st.st_ino, clusterRam, ramDiskSize, clusterSr, clusterPatchCache, clusterCfg, cfgSize, romToRamDisk, romIsCompressed, true, true, argc, argv, language, dsiMode, boostCpu, boostVram, consoleModel, srBackendId[0], srBackendId[1], ndsPreloaded);
return bootstrapHbRunNds (hbLoad_bin, 0x10000, st.st_ino, clusterRam, ramDiskSize, clusterSr, clusterPatchCache, clusterCfg, cfgSize, romToRamDisk, romIsCompressed, true, true, argc, argv, language, dsiMode, boostCpu, boostVram, consoleModel, soundFreq, srBackendId[0], srBackendId[1], ndsPreloaded);
}

void bootstrapHbRunPrep (int romToRamDisk) {
Expand Down

0 comments on commit c06e5fe

Please sign in to comment.