![]() |
OSCR
Open Source Cartridge Reader
|
Main program. More...
Namespaces | |
| namespace | Clock |
| MCU clock speed methods. | |
| namespace | Cores |
| Cores for supported systems | |
| namespace | Menus |
| Menu options for internal features. | |
| namespace | Power |
| Power/voltage methods. | |
| namespace | Strings |
| String constants. | |
| namespace | UI |
| User interface methods. | |
| namespace | Util |
| Utility methods. | |
Classes | |
| struct | BrowserFile |
| Data struct for the file browser. More... | |
| struct | CoreDefinition |
| Metadata for OSCR system cores and main menu options. More... | |
Typedefs | |
| typedef void(* | ConfigCallback) () |
Enumerations | |
| enum class | HW : uint8_t { Custom , V1 , V2 , V3 , V4 , V5 } |
| enum class | ModuleResult : uint8_t { Success , Error , NotEnabled , Unknown } |
| enum class | ClockSpeed : bool { k16MHz , k8MHz , Full , Half } |
| enum class | Voltage : uint8_t { k5V , k3V3 , Unknown , k5V0 , k3V , Default } |
| enum class | SleepState : uint8_t { Awake , Drowsy , Sleep , DeepSleep } |
| enum class | DataDirection : uint8_t { Unknown , In , Out } |
| enum class | CoreID : uint8_t { NONE , GBX , NES , SNES , N64 , MD , SMS , PCE , WS , NGP , INTV , COLV , VBOY , WSV , PCW , A2600 , ODY2 , ARC , FAIRCHILD , SUPRACAN , MSX , POKE , LOOPY , C64 , A5200 , A7800 , JAGUAR , LYNX , VECTREX , ATARI8 , BALLY , LJ , LJPRO , PV1000 , VIC20 , LEAP , RCA , TI99 , PYUUTA , TRS80 , VSMILE , FLASH8 , CPS3 , SELFTEST } |
| Core IDs. More... | |
| enum class | LanguageID : uint8_t { EN , JA } |
| Language IDs. | |
| enum class | RegionID : uint8_t { Global , AF , AN , AS , EU , NA , OC , SA } |
| Region IDs. More... | |
| enum class | FeatureID : uint8_t { Updater , Config , ClockGen , VSelect , RealTimeClock , ClockGenCalibrated , ClockGenCalibration , OnBoardMega , StabilityFix , PowerSaving } |
| Feature IDs. More... | |
| enum class | OutputInterfaceID : uint8_t { Serial , SerialANSI , SSD1306 , OS12864 } |
| Output Interface IDs. More... | |
| enum class | InputInterfaceID : uint8_t { Serial , SerialANSI , OneButton , TwoButtons , RotaryButton } |
| Input Interface IDs. More... | |
| enum class | OptionID : uint8_t { LCDType , NeoPixelOrder , VoltageSpecifier , VoltageMonitorMethod } |
| Option IDs. More... | |
Functions | |
| void | crdbBrowser (__FlashStringHelper const *title, OSCR::Databases::Basic::CRDatabase *crdbTarget) |
| void | crdbBrowser (__FlashStringHelper const *title, OSCR::Databases::Basic::CRMapperDatabase *crdbTarget) |
| void | crdbBrowser (__FlashStringHelper const *title, OSCR::Databases::Standard::CRDatabase *crdbTarget) |
| void | crdbBrowser (__FlashStringHelper const *title, OSCR::Databases::Extended::CRDatabase *crdbTarget) |
| void | crdbBrowser (__FlashStringHelper const *title, OSCR::Databases::NES *crdbTarget) |
| void | crdbBrowser (__FlashStringHelper const *title, OSCR::Databases::SNES *crdbTarget) |
| void | crdbBrowser (__FlashStringHelper const *title, OSCR::Databases::TI99 *crdbTarget) |
| void | selectFile (__FlashStringHelper const *title, oflag_t oflag) |
| void | selectFile (__FlashStringHelper const *title, OSCR::Storage::File &file, oflag_t oflag, bool useShared=true) |
| void | selectFile (__FlashStringHelper const *title, OSCR::Storage::File &file, oflag_t oflag, char *nameBuff, size_t nameSize, char *pathBuff=nullptr, size_t pathSize=0) |
| void | selectFile (__FlashStringHelper const *title, __FlashStringHelper const *path, OSCR::Storage::File &file, oflag_t oflag, bool useShared=true) |
| void | selectFile (__FlashStringHelper const *title, __FlashStringHelper const *path, OSCR::Storage::File &file, oflag_t oflag, char *nameBuff, size_t nameSize, char *pathBuff=nullptr, size_t pathSize=0) |
| void | log (char const *const message) |
| void | log (__FlashStringHelper const *const message) |
| void | logLine (void) |
| void | logLine (char const *const message) |
| void | logLine (__FlashStringHelper const *const message) |
| void | logLabel (char const *const label, char const *const message) |
| void | logLabel (__FlashStringHelper const *const label, char const *const message) |
| void | logLabel (__FlashStringHelper const *const label, __FlashStringHelper const *const message) |
| void | tick () |
| void | idle () |
| void | busy () |
| bool | wakeEvent () |
| void | aboutMenu () |
| void | resetArduino () |
| void | resetMenu () |
Variables | |
| constexpr HW const | kHardwareVersion = ((5 == 0) ? HW:: Custom : HW:: V5 ) |
| constexpr bool const | kAdvancedConfiguration = false |
| constexpr OutputInterfaceID const | kHardwareOutput |
| constexpr InputInterfaceID const | kHardwareInput |
| constexpr uint16_t const | kFirmwareFeatures |
| constexpr LanguageID const | kFirmwareLanguage = |
| constexpr RegionID const | kFirmwareRegion |
| constexpr char const PROGMEM | LogFile [] = "/.oscr/logs/" |
Main program.
|
strong |
|
strong |
Core IDs.
Every core should have a unique ID assigned to it, even if it's not listed on the main menu. These IDs are primarily used by the oscr.tools updater to identify which cores are enabled.
If you just want to change the order of the cores on the menu screen, look at Cores.cpp.
|
strong |
Enumeration of data directions
|
strong |
Feature IDs.
Every feature should have a unique ID assigned to it. These IDs are primarily used by the oscr.tools updater to identify which features are enabled.
| Enumerator | |
|---|---|
| Updater | Support updating via the OSCR.Tools Firmware Updater. |
| Config | Allow the use of config.txt. |
| ClockGen | Clock Generator. |
| VSelect | Automatic Voltage Select (VSELECT) via TPS211x. |
| RealTimeClock | RTC Support. |
| ClockGenCalibrated | Support for calibrating the clock generator. |
| ClockGenCalibration | Load clock generator calibration data. |
| OnBoardMega | Enable on-board ATmega2560 options. |
| StabilityFix | Fix for ATmega2560s with stability issues at 3.3V. |
| PowerSaving | Power Saving. |
|
strong |
Input Interface IDs.
Every input interface needs a unique ID assigned to it. These IDs are primarily used by the oscr.tools updater to identify which interfaces are enabled.
| Enumerator | |
|---|---|
| Serial | ASCII Serial. |
| SerialANSI | ANSI Serial. |
| OneButton | 1-button interface (HW1-2) |
| TwoButtons | 2-button interface (HW3) |
| RotaryButton | Rotary-button interface (HW4-5) |
|
strong |
|
strong |
Option IDs.
Every major option should have a unique ID assigned to it. These IDs are primarily used by the oscr.tools updater to identify which options are toggled.
|
strong |
Output Interface IDs.
Every output interface needs a unique ID assigned to it. These IDs are primarily used by the oscr.tools updater to identify which interfaces are enabled.
| Enumerator | |
|---|---|
| Serial | ASCII Serial. |
| SerialANSI | ANSI Serial. |
| SSD1306 | OLED. |
| OS12864 | LCD (a.k.a. MKS/BTT MINI12864, ST7567, etc) |
|
strong |
|
strong |
Enumeration of sleep states
|
strong |
|
extern |
|
extern |
It's important that the idle() method does not get optimized away because it might be the only method called in loop and if it's optimized away then the while loop itself would be too.
This is not an else because if other methods are added it can either be removed or checks for them need added as well.
Note: This needs to check for other methods that may be valid, even if they aren't enabled, such as Power::idle(), due to the fact they get optimized away if they aren't enbled.
|
extern |
Just in case this doesn't work, we print a message to inform the user we intend to reset.
|
extern |
It's important that the tick() method does not get optimized away because tick() might be the only method called inside of a while loop and if it is optimized away then the loop may also be optimized away.
This is not an else because if other methods are added it can either be removed or checks for them need added as well.
Note: This needs to check for other methods that may be valid, even if they aren't enabled, such as Updater::check(), due to the fact they get optimized away if they aren't enbled.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |