The `setVoltage()` function should be called even when `ENABLE_VSELECT` is disabled because `ENABLE_3V3FIX` also uses it. There is no resource cost to do this as when both options are disabled the compiler will optimize this function out. This just "future proofs" the code so if that function ever does more it doesn't need updated everywhere. This applies to `setup_FlashVoltage()` as well.
The changes to OSCR.cpp are just for code formatting and additional comments to clarify this.
Lots of changes/additions.
Added:
* Firmware Updater support: Supports the Firmware Updater app (release to follow soon). Enabled by default, can be disabled in the config.
* 3.3V Fix (3V3FIX): Enable if you have stability issues when using 3.3V, works best with VSELECT. Disabled by default, can be enabled in the config.
* `DynamicClockSerial`: Class that extends and modifies HardwareSerial to be compatible with a dynamically changing clock speed. Used through the `ClockedSerial` object/variable.
* `OSCR.cpp` & `OSCR.h`: New files for storing globals. Only contains these new additions for now. More code cleanup to come.
Changed:
* Moved configuration flags to `Config.h` and documented them better.
* Removed `vselect()` function. Now uses `setVoltage()` with the params `VOLTS_SET_3V3` and `VOLTS_SET_5V`.
Known Issues:
* Rarely the LCD backlight turns white when using 3V3FIX. Resetting fixes it. Doesn't affect functionality/usability; it's just weird.
Also, make print_FatalError(*) independent from print_Error(*).
Also, factorise common parts of print_Error(*).
Frees 2336 bytes of program space and 5 bytes of global ram space.
flashid (almost) always contains the hexadecimal representation of two
bytes, which then means it gets compares with strcmp, which in turn need
another string argument. Instead, make it an integer, removing the need to
call strcmp.
Add a separate string representation for printing purposes (maybe this can be
avoided by having the print function format it when needed ?).
The only apparent case where flashid is not an hexadecimal representation
of a pair of bytes is when N64 clears it to "CONF". Set flashid to zero
this case.
This saves about 500 bytes of program space and 200 bytes of ram.
- LoRom (P0) will write up to 8MB starting from file 0x0 to flashrom 0x0.
- HiRom (P0) will write up to 4MB starting from file 0x0 to flashrom 0x0.
- ExLoRom (P1) will write the first 4MB starting from file 0x0 to flashrom 0x400000. And then a second block up to 4MB from file 0x400000 to flashrom 0x0.
- ExHiRom (P1) will write the first 4MB starting from file 0x0 to flashrom 0x400000. And then a second block up to 4MB from file 0x400000 to flashrom 0x0.