Skip to content

Commit

Permalink
Do not expose public macros with common names
Browse files Browse the repository at this point in the history
The prevents compatibility issues with other libraries, such as the one seen in devkitPro#530

Fixes devkitPro#530
  • Loading branch information
glebm committed Sep 11, 2023
1 parent a4634c0 commit ab5e32d
Show file tree
Hide file tree
Showing 36 changed files with 230 additions and 238 deletions.
2 changes: 1 addition & 1 deletion libctru/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,7 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED = PACKED
PREDEFINED = __attribute__((packed))

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
Expand Down
4 changes: 2 additions & 2 deletions libctru/include/3ds/allocator/vram.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

typedef enum vramAllocPos
{
VRAM_ALLOC_A = BIT(0),
VRAM_ALLOC_B = BIT(1),
VRAM_ALLOC_A = 1U << 0,
VRAM_ALLOC_B = 1U << 1,
VRAM_ALLOC_ANY = VRAM_ALLOC_A | VRAM_ALLOC_B,
} vramAllocPos;

Expand Down
8 changes: 4 additions & 4 deletions libctru/include/3ds/applets/miiselector.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ typedef struct
/// AppletEd options
enum
{
MIISELECTOR_CANCEL = BIT(0), ///< Show the cancel button
MIISELECTOR_GUESTS = BIT(1), ///< Make Guets Miis selectable
MIISELECTOR_TOP = BIT(2), ///< Show AppletEd on top screen
MIISELECTOR_GUESTSTART = BIT(3), ///< Start on guest page
MIISELECTOR_CANCEL = 1U << 0, ///< Show the cancel button
MIISELECTOR_GUESTS = 1U << 1, ///< Make Guets Miis selectable
MIISELECTOR_TOP = 1U << 2, ///< Show AppletEd on top screen
MIISELECTOR_GUESTSTART = 1U << 3, ///< Start on guest page
};

/**
Expand Down
30 changes: 15 additions & 15 deletions libctru/include/3ds/applets/swkbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,26 @@ typedef enum
/// Keyboard input filtering flags.
enum
{
SWKBD_FILTER_DIGITS = BIT(0), ///< Disallow the use of more than a certain number of digits (0 or more)
SWKBD_FILTER_AT = BIT(1), ///< Disallow the use of the @ sign.
SWKBD_FILTER_PERCENT = BIT(2), ///< Disallow the use of the % sign.
SWKBD_FILTER_BACKSLASH = BIT(3), ///< Disallow the use of the \ sign.
SWKBD_FILTER_PROFANITY = BIT(4), ///< Disallow profanity using Nintendo's profanity filter.
SWKBD_FILTER_CALLBACK = BIT(5), ///< Use a callback in order to check the input.
SWKBD_FILTER_DIGITS = 1U << 0, ///< Disallow the use of more than a certain number of digits (0 or more)
SWKBD_FILTER_AT = 1U << 1, ///< Disallow the use of the @ sign.
SWKBD_FILTER_PERCENT = 1U << 2, ///< Disallow the use of the % sign.
SWKBD_FILTER_BACKSLASH = 1U << 3, ///< Disallow the use of the \ sign.
SWKBD_FILTER_PROFANITY = 1U << 4, ///< Disallow profanity using Nintendo's profanity filter.
SWKBD_FILTER_CALLBACK = 1U << 5, ///< Use a callback in order to check the input.
};

/// Keyboard features.
enum
{
SWKBD_PARENTAL = BIT(0), ///< Parental PIN mode.
SWKBD_DARKEN_TOP_SCREEN = BIT(1), ///< Darken the top screen when the keyboard is shown.
SWKBD_PREDICTIVE_INPUT = BIT(2), ///< Enable predictive input (necessary for Kanji input in JPN systems).
SWKBD_MULTILINE = BIT(3), ///< Enable multiline input.
SWKBD_FIXED_WIDTH = BIT(4), ///< Enable fixed-width mode.
SWKBD_ALLOW_HOME = BIT(5), ///< Allow the usage of the HOME button.
SWKBD_ALLOW_RESET = BIT(6), ///< Allow the usage of a software-reset combination.
SWKBD_ALLOW_POWER = BIT(7), ///< Allow the usage of the POWER button.
SWKBD_DEFAULT_QWERTY = BIT(9), ///< Default to the QWERTY page when the keyboard is shown.
SWKBD_PARENTAL = 1U << 0, ///< Parental PIN mode.
SWKBD_DARKEN_TOP_SCREEN = 1U << 1, ///< Darken the top screen when the keyboard is shown.
SWKBD_PREDICTIVE_INPUT = 1U << 2, ///< Enable predictive input (necessary for Kanji input in JPN systems).
SWKBD_MULTILINE = 1U << 3, ///< Enable multiline input.
SWKBD_FIXED_WIDTH = 1U << 4, ///< Enable fixed-width mode.
SWKBD_ALLOW_HOME = 1U << 5, ///< Allow the usage of the HOME button.
SWKBD_ALLOW_RESET = 1U << 6, ///< Allow the usage of a software-reset combination.
SWKBD_ALLOW_POWER = 1U << 7, ///< Allow the usage of the POWER button.
SWKBD_DEFAULT_QWERTY = 1U << 9, ///< Default to the QWERTY page when the keyboard is shown.
};

/// Keyboard filter callback return values.
Expand Down
6 changes: 3 additions & 3 deletions libctru/include/3ds/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

/// System run-flags.
enum {
RUNFLAG_APTWORKAROUND = BIT(0), ///< Use APT workaround.
RUNFLAG_APTREINIT = BIT(1), ///< Reinitialize APT.
RUNFLAG_APTCHAINLOAD = BIT(2), ///< Chainload APT on return.
RUNFLAG_APTWORKAROUND = 1U << 0, ///< Use APT workaround.
RUNFLAG_APTREINIT = 1U << 1, ///< Reinitialize APT.
RUNFLAG_APTCHAINLOAD = 1U << 2, ///< Chainload APT on return.
};

/**
Expand Down
64 changes: 32 additions & 32 deletions libctru/include/3ds/exheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@
/// ARM9 descriptor flags
enum
{
ARM9DESC_MOUNT_NAND = BIT(0), ///< Mount "nand:/"
ARM9DESC_MOUNT_NANDRO_RW = BIT(1), ///< Mount nand:/ro/ as read-write
ARM9DESC_MOUNT_TWLN = BIT(2), ///< Mount "twln:/"
ARM9DESC_MOUNT_WNAND = BIT(3), ///< Mount "wnand:/"
ARM9DESC_MOUNT_CARDSPI = BIT(4), ///< Mount "cardspi:/"
ARM9DESC_USE_SDIF3 = BIT(5), ///< Use SDIF3
ARM9DESC_CREATE_SEED = BIT(6), ///< Create seed (movable.sed)
ARM9DESC_USE_CARD_SPI = BIT(7), ///< Use card SPI, required by multiple pxi:dev commands
ARM9DESC_SD_APPLICATION = BIT(8), ///< SD application (not checked)
ARM9DESC_MOUNT_SDMC_RW = BIT(9), ///< Mount "sdmc:/" as read-write
ARM9DESC_MOUNT_NAND = 1U << 0, ///< Mount "nand:/"
ARM9DESC_MOUNT_NANDRO_RW = 1U << 1, ///< Mount nand:/ro/ as read-write
ARM9DESC_MOUNT_TWLN = 1U << 2, ///< Mount "twln:/"
ARM9DESC_MOUNT_WNAND = 1U << 3, ///< Mount "wnand:/"
ARM9DESC_MOUNT_CARDSPI = 1U << 4, ///< Mount "cardspi:/"
ARM9DESC_USE_SDIF3 = 1U << 5, ///< Use SDIF3
ARM9DESC_CREATE_SEED = 1U << 6, ///< Create seed (movable.sed)
ARM9DESC_USE_CARD_SPI = 1U << 7, ///< Use card SPI, required by multiple pxi:dev commands
ARM9DESC_SD_APPLICATION = 1U << 8, ///< SD application (not checked)
ARM9DESC_MOUNT_SDMC_RW = 1U << 9, ///< Mount "sdmc:/" as read-write
};

/// Filesystem access flags
enum
{
FSACCESS_CATEGORY_SYSTEM_APPLICATION = BIT(0), ///< Category "system application"
FSACCESS_CATEGORY_HARDWARE_CHECK = BIT(1), ///< Category "hardware check"
FSACCESS_CATEGORY_FILESYSTEM_TOOL = BIT(2), ///< Category "filesystem tool"
FSACCESS_DEBUG = BIT(3), ///< Debug
FSACCESS_TWLCARD_BACKUP = BIT(4), ///< TWLCARD backup
FSACCESS_TWLNAND_DATA = BIT(5), ///< TWLNAND data
FSACCESS_BOSS = BIT(6), ///< BOSS (SpotPass)
FSACCESS_SDMC_RW = BIT(7), ///< SDMC (read-write)
FSACCESS_CORE = BIT(8), ///< Core
FSACCESS_NANDRO_RO = BIT(9), ///< nand:/ro/ (read-only)
FSACCESS_NANDRW = BIT(10), ///< nand:/rw/
FSACCESS_NANDRO_RW = BIT(11), ///< nand:/ro/ (read-write)
FSACCESS_CATEGORY_SYSTEM_SETTINGS = BIT(12), ///< Category "System Settings"
FSACCESS_CARDBOARD = BIT(13), ///< Cardboard (System Transfer)
FSACCESS_EXPORT_IMPORT_IVS = BIT(14), ///< Export/Import IVs (movable.sed)
FSACCESS_SDMC_WO = BIT(15), ///< SDMC (write-only)
FSACCESS_SWITCH_CLEANUP = BIT(16), ///< "Switch cleanup" (3.0+)
FSACCESS_SAVEDATA_MOVE = BIT(17), ///< Savedata move (5.0+)
FSACCESS_SHOP = BIT(18), ///< Shop (5.0+)
FSACCESS_SHELL = BIT(19), ///< Shop (5.0+)
FSACCESS_CATEGORY_HOME_MENU = BIT(20), ///< Category "Home Menu" (6.0+)
FSACCESS_SEEDDB = BIT(21), ///< Seed DB (9.6+)
FSACCESS_CATEGORY_SYSTEM_APPLICATION = 1U << 0, ///< Category "system application"
FSACCESS_CATEGORY_HARDWARE_CHECK = 1U << 1, ///< Category "hardware check"
FSACCESS_CATEGORY_FILESYSTEM_TOOL = 1U << 2, ///< Category "filesystem tool"
FSACCESS_DEBUG = 1U << 3, ///< Debug
FSACCESS_TWLCARD_BACKUP = 1U << 4, ///< TWLCARD backup
FSACCESS_TWLNAND_DATA = 1U << 5, ///< TWLNAND data
FSACCESS_BOSS = 1U << 6, ///< BOSS (SpotPass)
FSACCESS_SDMC_RW = 1U << 7, ///< SDMC (read-write)
FSACCESS_CORE = 1U << 8, ///< Core
FSACCESS_NANDRO_RO = 1U << 9, ///< nand:/ro/ (read-only)
FSACCESS_NANDRW = 1U << 10, ///< nand:/rw/
FSACCESS_NANDRO_RW = 1U << 11, ///< nand:/ro/ (read-write)
FSACCESS_CATEGORY_SYSTEM_SETTINGS = 1U << 12, ///< Category "System Settings"
FSACCESS_CARDBOARD = 1U << 13, ///< Cardboard (System Transfer)
FSACCESS_EXPORT_IMPORT_IVS = 1U << 14, ///< Export/Import IVs (movable.sed)
FSACCESS_SDMC_WO = 1U << 15, ///< SDMC (write-only)
FSACCESS_SWITCH_CLEANUP = 1U << 16, ///< "Switch cleanup" (3.0+)
FSACCESS_SAVEDATA_MOVE = 1U << 17, ///< Savedata move (5.0+)
FSACCESS_SHOP = 1U << 18, ///< Shop (5.0+)
FSACCESS_SHELL = 1U << 19, ///< Shop (5.0+)
FSACCESS_CATEGORY_HOME_MENU = 1U << 20, ///< Category "Home Menu" (6.0+)
FSACCESS_SEEDDB = 1U << 21, ///< Seed DB (9.6+)
};

/// The resource limit category of a title
Expand Down
6 changes: 3 additions & 3 deletions libctru/include/3ds/font.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ typedef struct
/// Flags for use with fontCalcGlyphPos.
enum
{
GLYPH_POS_CALC_VTXCOORD = BIT(0), ///< Calculates vertex coordinates in addition to texture coordinates.
GLYPH_POS_AT_BASELINE = BIT(1), ///< Position the glyph at the baseline instead of at the top-left corner.
GLYPH_POS_Y_POINTS_UP = BIT(2), ///< Indicates that the Y axis points up instead of down.
GLYPH_POS_CALC_VTXCOORD = 1U << 0, ///< Calculates vertex coordinates in addition to texture coordinates.
GLYPH_POS_AT_BASELINE = 1U << 1, ///< Position the glyph at the baseline instead of at the top-left corner.
GLYPH_POS_Y_POINTS_UP = 1U << 2, ///< Indicates that the Y axis points up instead of down.
};

///@}
Expand Down
2 changes: 1 addition & 1 deletion libctru/include/3ds/gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void gfxScreenSwapBuffers(gfxScreen_t scr, bool hasStereo);
* @param immediate This parameter no longer has any effect and is thus ignored.
* @deprecated This function has been superseded by \ref gfxScreenSwapBuffers, please use that instead.
*/
DEPRECATED void gfxConfigScreen(gfxScreen_t scr, bool immediate);
LIBCTRU_DEPRECATED void gfxConfigScreen(gfxScreen_t scr, bool immediate);

/**
* @brief Updates the configuration of both screens.
Expand Down
4 changes: 2 additions & 2 deletions libctru/include/3ds/gpu/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
/// Creates a texture mode parameter from a @ref GPU_TEXTURE_MODE_PARAM
#define GPU_TEXTURE_MODE(v) (((v)&0x7)<<28)
/// Texture parameter indicating ETC1 texture.
#define GPU_TEXTURE_ETC1_PARAM BIT(5)
#define GPU_TEXTURE_ETC1_PARAM (1U << 5)
/// Texture parameter indicating shadow texture.
#define GPU_TEXTURE_SHADOW_PARAM BIT(20)
#define GPU_TEXTURE_SHADOW_PARAM (1U << 20)

/// Creates a combiner buffer write configuration.
#define GPU_TEV_BUFFER_WRITE_CONFIG(stage0, stage1, stage2, stage3) ((stage0) | ((stage1) << 1) | ((stage2) << 2) | ((stage3) << 3))
Expand Down
4 changes: 2 additions & 2 deletions libctru/include/3ds/gpu/gx.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ typedef enum
#define GX_TRANSFER_SCALING(x) ((x)<<24)

/// Updates gas additive blend results.
#define GX_CMDLIST_UPDATE_GAS_ACC BIT(0)
#define GX_CMDLIST_UPDATE_GAS_ACC (1U << 0)
/// Flushes the command list.
#define GX_CMDLIST_FLUSH BIT(1)
#define GX_CMDLIST_FLUSH (1U << 1)

/// GX command entry
typedef union
Expand Down
6 changes: 3 additions & 3 deletions libctru/include/3ds/ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/// IPC buffer access rights.
typedef enum
{
IPC_BUFFER_R = BIT(1), ///< Readable
IPC_BUFFER_W = BIT(2), ///< Writable
IPC_BUFFER_R = 1U << 1, ///< Readable
IPC_BUFFER_W = 1U << 2, ///< Writable
IPC_BUFFER_RW = IPC_BUFFER_R | IPC_BUFFER_W ///< Readable and Writable
} IPC_BufferRights;

Expand Down Expand Up @@ -70,7 +70,7 @@ static inline u32 IPC_Desc_CurProcessId(void)
return 0x20;
}

static inline DEPRECATED u32 IPC_Desc_CurProcessHandle(void)
static inline LIBCTRU_DEPRECATED u32 IPC_Desc_CurProcessHandle(void)
{
return IPC_Desc_CurProcessId();
}
Expand Down
2 changes: 1 addition & 1 deletion libctru/include/3ds/mii.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ typedef struct
} mole_details;

u16 author_name[10]; ///< Name of Mii's author (Encoded using UTF16)
} PACKED MiiData;
} __attribute__((packed)) MiiData;
4 changes: 2 additions & 2 deletions libctru/include/3ds/ndsp/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ enum
NDSP_FORMAT_ADPCM = NDSP_FORMAT_MONO_ADPCM, ///< (Alias) Buffer contains Mono ADPCM.

// Flags
NDSP_FRONT_BYPASS = BIT(4), ///< Front bypass.
NDSP_3D_SURROUND_PREPROCESSED = BIT(6), ///< (?) Unknown, under research
NDSP_FRONT_BYPASS = 1U << 4, ///< Front bypass.
NDSP_3D_SURROUND_PREPROCESSED = 1U << 6, ///< (?) Unknown, under research
};

/// Interpolation types.
Expand Down
2 changes: 1 addition & 1 deletion libctru/include/3ds/services/ac.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Result ACU_SetNetworkArea(acuConfig* config, u8 area);
/**
* @brief Sets the slot to use when connecting.
* @param config Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.
* @param type Allowed slots flag. BIT(0) for slot 1, BIT(1) for slot 2, BIT(2) for slot 3.
* @param type Allowed slots flag. (1U << 0) for slot 1, (1U << 1) for slot 2, (1U << 2) for slot 3.
*/
Result ACU_SetAllowApType(acuConfig* config, u8 type);

Expand Down
12 changes: 6 additions & 6 deletions libctru/include/3ds/services/am.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ typedef struct
/// Pending title status mask values.
enum
{
AM_STATUS_MASK_INSTALLING = BIT(0), ///< Titles currently installing.
AM_STATUS_MASK_AWAITING_FINALIZATION = BIT(1) ///< Titles awaiting finalization.
AM_STATUS_MASK_INSTALLING = 1U << 0, ///< Titles currently installing.
AM_STATUS_MASK_AWAITING_FINALIZATION = (1U << 1) ///< Titles awaiting finalization.
};

/// Pending title status values.
Expand All @@ -44,8 +44,8 @@ typedef struct
/// Pending title deletion flags.
enum
{
AM_DELETE_PENDING_NON_SYSTEM = BIT(0), ///< Non-system titles.
AM_DELETE_PENDING_SYSTEM = BIT(1) ///< System titles.
AM_DELETE_PENDING_NON_SYSTEM = 1U << 0, ///< Non-system titles.
AM_DELETE_PENDING_SYSTEM = (1U << 1) ///< System titles.
};

/// Information about the TWL NAND partition.
Expand All @@ -69,8 +69,8 @@ typedef struct {
/// Title ContentInfo flags.
typedef enum
{
AM_CONTENT_DOWNLOADED = BIT(0), ///< ?
AM_CONTENT_OWNED = BIT(1) ///< ?
AM_CONTENT_DOWNLOADED = 1U << 0, ///< ?
AM_CONTENT_OWNED = (1U << 1) ///< ?
} AM_ContentInfoFlags;

/// Initializes AM. This doesn't initialize with "am:app", see amAppInit().
Expand Down
4 changes: 2 additions & 2 deletions libctru/include/3ds/services/apt.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct PtmWakeEvents;
/// Create an APT_AppletAttr bitfield from its components.
static inline APT_AppletAttr aptMakeAppletAttr(APT_AppletPos pos, bool manualGpuRights, bool manualDspRights)
{
return (pos&7) | (manualGpuRights ? BIT(3) : 0) | (manualDspRights ? BIT(4) : 0);
return (pos&7) | (manualGpuRights ? (1U << 3) : 0) | (manualDspRights ? (1U << 4) : 0);
}

/// APT query reply.
Expand Down Expand Up @@ -176,7 +176,7 @@ bool aptShouldJumpToHome(void);
bool aptCheckHomePressRejected(void);

/// \deprecated Alias for \ref aptCheckHomePressRejected.
static inline DEPRECATED bool aptIsHomePressed(void)
static inline LIBCTRU_DEPRECATED bool aptIsHomePressed(void)
{
return aptCheckHomePressRejected();
}
Expand Down
14 changes: 7 additions & 7 deletions libctru/include/3ds/services/cam.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
/// Camera connection target ports.
enum {
PORT_NONE = 0x0, ///< No port.
PORT_CAM1 = BIT(0), ///< CAM1 port.
PORT_CAM2 = BIT(1), ///< CAM2 port.
PORT_CAM1 = 1U << 0, ///< CAM1 port.
PORT_CAM2 = 1U << 1, ///< CAM2 port.

// Port combinations.
PORT_BOTH = PORT_CAM1 | PORT_CAM2, ///< Both ports.
Expand All @@ -20,9 +20,9 @@ enum {
/// Camera combinations.
enum {
SELECT_NONE = 0x0, ///< No camera.
SELECT_OUT1 = BIT(0), ///< Outer camera 1.
SELECT_IN1 = BIT(1), ///< Inner camera 1.
SELECT_OUT2 = BIT(2), ///< Outer camera 2.
SELECT_OUT1 = 1U << 0, ///< Outer camera 1.
SELECT_IN1 = 1U << 1, ///< Inner camera 1.
SELECT_OUT2 = 1U << 2, ///< Outer camera 2.

// Camera combinations.
SELECT_IN1_OUT1 = SELECT_OUT1 | SELECT_IN1, ///< Outer camera 1 and inner camera 1.
Expand All @@ -34,8 +34,8 @@ enum {
/// Camera contexts.
typedef enum {
CONTEXT_NONE = 0x0, ///< No context.
CONTEXT_A = BIT(0), ///< Context A.
CONTEXT_B = BIT(1), ///< Context B.
CONTEXT_A = 1U << 0, ///< Context A.
CONTEXT_B = 1U << 1, ///< Context B.

// Context combinations.
CONTEXT_BOTH = CONTEXT_A | CONTEXT_B, ///< Both contexts.
Expand Down
10 changes: 5 additions & 5 deletions libctru/include/3ds/services/csnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,24 @@ enum
/// Sound flags.
enum
{
SOUND_LINEAR_INTERP = BIT(6), ///< Linear interpolation.
SOUND_LINEAR_INTERP = 1U << 6, ///< Linear interpolation.
SOUND_REPEAT = SOUND_LOOPMODE(CSND_LOOPMODE_NORMAL), ///< Repeat the sound.
SOUND_ONE_SHOT = SOUND_LOOPMODE(CSND_LOOPMODE_ONESHOT), ///< Play the sound once.
SOUND_FORMAT_8BIT = SOUND_FORMAT(CSND_ENCODING_PCM8), ///< PCM8
SOUND_FORMAT_16BIT = SOUND_FORMAT(CSND_ENCODING_PCM16), ///< PCM16
SOUND_FORMAT_ADPCM = SOUND_FORMAT(CSND_ENCODING_ADPCM), ///< ADPCM
SOUND_FORMAT_PSG = SOUND_FORMAT(CSND_ENCODING_PSG), ///< PSG
SOUND_ENABLE = BIT(14), ///< Enable sound.
SOUND_ENABLE = 1U << 14, ///< Enable sound.
};

/// Capture modes.
enum
{
CAPTURE_REPEAT = 0, ///< Repeat capture.
CAPTURE_ONE_SHOT = BIT(0), ///< Capture once.
CAPTURE_ONE_SHOT = 1U << 0, ///< Capture once.
CAPTURE_FORMAT_16BIT = 0, ///< PCM16
CAPTURE_FORMAT_8BIT = BIT(1), ///< PCM8
CAPTURE_ENABLE = BIT(15), ///< Enable capture.
CAPTURE_FORMAT_8BIT = 1U << 1, ///< PCM8
CAPTURE_ENABLE = 1U << 15, ///< Enable capture.
};

/// Duty cycles for a PSG channel.
Expand Down

0 comments on commit ab5e32d

Please sign in to comment.