Skip to content

Commit 107c45d

Browse files
committed
Add back VRAM boost
1 parent 7bdbe90 commit 107c45d

6 files changed

Lines changed: 18 additions & 0 deletions

File tree

arm9/source/conf_sd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ static int callback(const char *section, const char *key, const char *value, voi
139139
// Boost CPU
140140
conf->boostCpu = (bool)strtol(value, NULL, 0);
141141

142+
} else if (match(section, "NDS-BOOTSTRAP", key, "BOOST_VRAM")) {
143+
// Boost VRAM
144+
conf->boostVram = (bool)strtol(value, NULL, 0);
145+
142146
} else {
143147
// Unknown section/name
144148
//return 0; // Error

arm9/source/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ static int runNdsFile(configuration* conf) {
268268
fifoSendValue32(FIFO_USER_06, 1);
269269
}
270270

271+
// Boost VRAM
272+
if (conf->boostVram) {
273+
dbg_printf("VRAM boosted\n");
274+
}
275+
271276
fifoSendValue32(FIFO_USER_03, 1);
272277
fifoWaitValue32(FIFO_USER_05);
273278

arm9/source/nds_loader_arm9.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ void runNds(const void* loader, u32 loaderSize, u32 cluster, u32 saveCluster, co
236236
lc0->consoleModel = conf->consoleModel;
237237
lc0->loadingScreen = conf->loadingScreen;
238238
lc0->romread_LED = conf->romread_LED;
239+
lc0->boostVram = conf->boostVram;
239240
lc0->gameSoftReset = conf->gameSoftReset;
240241
lc0->asyncPrefetch = conf->asyncPrefetch;
241242
lc0->soundFix = conf->soundFix;

bootloader/source/arm7/load_crt0.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
.global consoleModel
4040
.global loadingScreen
4141
.global romread_LED
42+
.global boostVram
4243
.global gameSoftReset
4344
.global asyncPrefetch
4445
.global soundFix
@@ -86,6 +87,8 @@ loadingScreen:
8687
.word 0x00000000
8788
romread_LED:
8889
.word 0x00000000
90+
boostVram:
91+
.word 0x00000000
8992
gameSoftReset:
9093
.word 0x00000000
9194
asyncPrefetch:

bootloader/source/arm9/main.arm9.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ extern void arm9_clearCache(void);
4545

4646
tNDSHeader* ndsHeader = NULL;
4747
bool dsiModeConfirmed = false;
48+
extern u32 boostVram;
4849
volatile int arm9_stateFlag = ARM9_BOOT;
4950
volatile u32 arm9_BLANK_RAM = 0;
5051
volatile int arm9_screenMode = 0; // 0 = Regular, 1 = Pong, 2 = Tic-Tac-Toe
@@ -189,6 +190,9 @@ void arm9_main(void) {
189190
//);
190191

191192
REG_SCFG_EXT = 0x8300C000;
193+
if (boostVram) {
194+
REG_SCFG_EXT |= BIT(13); // Extended VRAM Access
195+
}
192196

193197
screenBrightness = 31;
194198
fadeType = true;

common/include/load_crt0.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ typedef struct loadCrt0 {
2424
u32 consoleModel;
2525
u32 loadingScreen;
2626
u32 romread_LED;
27+
u32 boostVram;
2728
u32 gameSoftReset;
2829
u32 asyncPrefetch;
2930
u32 soundFix;

0 commit comments

Comments
 (0)