OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
core-types.h File Reference

Define core and feature IDs. More...

#include <stdint.h>

Go to the source code of this file.

Namespaces

namespace  OSCR
 Main program.

Enumerations

enum class  OSCR::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  OSCR::LanguageID : uint8_t { EN , JA }
 Language IDs.
enum class  OSCR::RegionID : uint8_t {
  OSCR::Global , OSCR::AF , OSCR::AN , OSCR::AS ,
  OSCR::EU , OSCR::NA , OSCR::OC , OSCR::SA
}
 Region IDs. More...
enum class  OSCR::FeatureID : uint8_t {
  OSCR::Updater , OSCR::Config , OSCR::ClockGen , OSCR::VSelect ,
  OSCR::RealTimeClock , OSCR::ClockGenCalibrated , OSCR::ClockGenCalibration , OSCR::OnBoardMega ,
  OSCR::StabilityFix , OSCR::PowerSaving
}
 Feature IDs. More...
enum class  OSCR::OutputInterfaceID : uint8_t { OSCR::Serial , OSCR::SerialANSI , OSCR::SSD1306 , OSCR::OS12864 }
 Output Interface IDs. More...
enum class  OSCR::InputInterfaceID : uint8_t {
  OSCR::Serial , OSCR::SerialANSI , OSCR::OneButton , OSCR::TwoButtons ,
  OSCR::RotaryButton
}
 Input Interface IDs. More...
enum class  OSCR::OptionID : uint8_t { LCDType , NeoPixelOrder , VoltageSpecifier , VoltageMonitorMethod }
 Option IDs. More...

Detailed Description

Define core and feature IDs.

Core (and feature) IDs should be defined in this file. Take care that the IDs defined in this file never change. The enums here do not check if the feature is enabled because the ID assignements MUST remain constant over builds and time. Even if a feature is removed, the definition for it must remain here.

If a feature or core no longer exists and you want to note it here, you could either add a comment after it or add __REMOVED to the end of the name. The latter has the advantage of making any code that still references it invalid.

These IDs are meant for both internal and external tools to assist with identifying and referring to enabled features by ID rather than using strings. This saves resources on our extremely resource constrained ATmega2560.

Remember: Enum names don't cost PROGMEM, the amount of resources used for an enum is equivilent to the size of the the enum's type, For instance, a variable using an enum with a type of uint16_t will use 1 byte of PROGMEM or SRAM to store that data. If you compare that to a string, i.e. "SNES" which uses at least 5 bytes of PROGMEM to store and you should be able to see why it matters.

While it is possible to combine all of this into a single file, the amount of macro abuse required to do it in a way that works within the Arduino IDE bordered on a war crime. This is something that will just have to wait until the move away from the Arduino IDE.

Note
While you should not change the IDs, you can change their names. So, you can rename them to switch to a better name or change the case. However, do NOT hijack an ID to refer to a different core or feature.
See also
Cores.cpp