Skip to content

Commit

Permalink
Moved initial emusettings from GUI to FileHandling.
Browse files Browse the repository at this point in the history
Added more info to WonderWitch.md
  • Loading branch information
FluBBaOfWard committed Sep 18, 2024
1 parent 0520ef2 commit 7cd29b8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
13 changes: 13 additions & 0 deletions WonderWitch.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,22 @@ If you want to keep what you have uploaded to the WonderWitch make sure you use
Save NVRAM in the emulator.

* WonderWitch: Tools for interacting with a WonderWitch.
* Storage: Select storage, apps need to be located in ROM.
* Upload File: Used for uploading files to WonderWitch.
* Dir: Show contents of a directory, to select a file.
* Execute: Execute an app. (use the WW start screen instead).
* Delete: Delete a file.
* Defrag: Reclaim storage from deleted files.
* Download File: Download a file from WW to the DS.
* NewFS (Formatt): Wipe everything in the selected storage.
* XMODEM Transmit: Used for uploading files to WonderWitch.
* XMODEM Receive: Used for downloading files from WonderWitch.
* Reboot WW: Reboot the WonderWitch software.
* CD: Change directory.
* Interact: Set terminal to interactive mode.
* Stty: Set/Show interactive mode.
* Hello: Show info about WW software.
* Speed: Show communication speed.

## Credits

Expand Down
13 changes: 7 additions & 6 deletions source/FileHandling.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int initSettings() {
cfg.config = 0;
cfg.palette = 0;
cfg.gammaValue = 0x30;
cfg.emuSettings = AUTOPAUSE_EMULATION | AUTOLOAD_NVRAM;
cfg.emuSettings = AUTOPAUSE_EMULATION | AUTOLOAD_NVRAM | AUTOSLEEP_OFF | ENABLE_HEADPHONES;
cfg.sleepTime = 60*60*5;
cfg.controller = 0; // Don't swap A/B
cfg.birthYear[0] = 0x19;
Expand Down Expand Up @@ -133,22 +133,23 @@ bool updateSettingsFromWS() {

int loadSettings() {
FILE *file;
int result = 0;

if (findFolder(folderName)) {
return 1;
result = 1;
}
if ( (file = fopen(settingName, "r")) ) {
else if ( (file = fopen(settingName, "r")) ) {
fread(&cfg, 1, sizeof(ConfigData), file);
fclose(file);
if (!strstr(cfg.magic,"cfg")) {
infoOutput("Error in settings file.");
return 1;
result = 1;
}
}
else {
infoOutput("Couldn't open file:");
infoOutput(settingName);
return 1;
result = 1;
}

gBorderEnable = (cfg.config & 1) ^ 1;
Expand All @@ -166,7 +167,7 @@ int loadSettings() {
}

infoOutput("Settings loaded.");
return 0;
return result;
}

void saveSettings() {
Expand Down
5 changes: 0 additions & 5 deletions source/Gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

#define EMUVERSION "V0.6.6 2024-09-18"

#define ALLOW_SPEED_HACKS (1<<17)
#define ENABLE_HEADPHONES (1<<18)
#define ALLOW_REFRESH_CHG (1<<19)

void hacksInit(void);

static void gammaChange(void);
Expand Down Expand Up @@ -177,7 +173,6 @@ static const char *const langTxt[] = {"Japanese", "English"};


void setupGUI() {
emuSettings = AUTOPAUSE_EMULATION | AUTOLOAD_NVRAM | AUTOSLEEP_OFF | ENABLE_HEADPHONES;
keysSetRepeat(25, 4); // Delay, repeat.
menu1.itemCount = ARRSIZE(fileItems) - (enableExit?0:1);
openMenu();
Expand Down
4 changes: 4 additions & 0 deletions source/Gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
extern "C" {
#endif

#define ALLOW_SPEED_HACKS (1<<17)
#define ENABLE_HEADPHONES (1<<18)
#define ALLOW_REFRESH_CHG (1<<19)

extern u8 gContrastValue;
extern u8 gBorderEnable;

Expand Down

0 comments on commit 7cd29b8

Please sign in to comment.