libctru/libctru/include/3ds/services/gsplcd.h
fincs 6ef91576ae
Overhaul gspgpu/gfx code, see details:
- GSPGPU changes:
  - gspInit now properly initializes the event queue, GSP shared memory
    and first-time initialization - previously this was done in gfxInit.
  - Removed gspInitEventHandler/gspExitEventHandler in line with above.
  - Added gspPresentBuffer for pushing a framebuffer to the internal
    GSP swap queue (previously this was an internal function in gfx.c).
  - Added defines for screen IDs and screen dimensions.
  - Removed sharedGspCmdBuf param from gspSubmitGxCommand (now uses
    the correct GSP shared memory address automatically).
  - Removed gxCmdBuf global variable (no longer needed as per above).
  - Removed GSPGPU_REBASE_REG (leftover from early 3DS homebrew).
- GFX changes:
  - Documentation overhaul and code cleanup.
  - Simplified implementation using the enhanced GSPGPU service wrapper.
  - Top left/right framebuffers now form a single allocation instead of
    being split into two separate allocations.
  - Fixed LCD configuration mode when framebuffers are on VRAM.
  - Removed the ability to forcefully swap the screens: gspPresentBuffer
    is now always used (i.e. GSP shared mem). The 'immediate' parameter
    of gfxConfigScreen now does nothing, and gfxSwapBuffers/Gpu now do
    the same thing.
  - Removed gfx{TopLeft,TopRight,Bottom}Framebuffers global variables
    (please use gfxGetFramebuffer instead as originally intended...)
2020-06-13 20:08:37 +02:00

72 lines
1.8 KiB
C

/**
* @file gsplcd.h
* @brief GSPLCD service.
*/
#pragma once
#include <3ds/types.h>
#include <3ds/services/gspgpu.h>
/// LCD screens.
enum
{
GSPLCD_SCREEN_TOP = BIT(GSP_SCREEN_TOP), ///< Top screen.
GSPLCD_SCREEN_BOTTOM = BIT(GSP_SCREEN_BOTTOM), ///< Bottom screen.
GSPLCD_SCREEN_BOTH = GSPLCD_SCREEN_TOP | GSPLCD_SCREEN_BOTTOM, ///< Both screens.
};
/// Initializes GSPLCD.
Result gspLcdInit(void);
/// Exits GSPLCD.
void gspLcdExit(void);
/// Powers on both backlights.
Result GSPLCD_PowerOnAllBacklights(void);
/// Powers off both backlights.
Result GSPLCD_PowerOffAllBacklights(void);
/**
* @brief Powers on the backlight.
* @param screen Screen to power on.
*/
Result GSPLCD_PowerOnBacklight(u32 screen);
/**
* @brief Powers off the backlight.
* @param screen Screen to power off.
*/
Result GSPLCD_PowerOffBacklight(u32 screen);
/**
* @brief Sets 3D_LEDSTATE to the input state value.
* @param disable False = 3D LED enable, true = 3D LED disable.
*/
Result GSPLCD_SetLedForceOff(bool disable);
/**
* @brief Gets the LCD screens' vendors. Stubbed on old 3ds.
* @param vendor Pointer to output the screen vendors to.
*/
Result GSPLCD_GetVendors(u8 *vendors);
/**
* @brief Gets the LCD screens' brightness. Stubbed on old 3ds.
* @param screen Screen to get the brightness value of.
* @param brightness Brightness value returned.
*/
Result GSPLCD_GetBrightness(u32 screen, u32 *brightness);
/**
* @brief Sets the LCD screens' brightness.
* @param screen Screen to set the brightness value of.
* @param brightness Brightness value set.
*/
Result GSPLCD_SetBrightness(u32 screen, u32 brightness);
/**
* @brief Sets the LCD screens' raw brightness.
* @param screen Screen to set the brightness value of.
* @param brightness Brightness value set.
*/
Result GSPLCD_SetBrightnessRaw(u32 screen, u32 brightness);