Skip to content

Commit

Permalink
coreinit: Add "SavedFrame" related functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Maschell authored and GaryOderNichts committed Jun 8, 2024
1 parent 382a3b2 commit 35aa8b7
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
106 changes: 106 additions & 0 deletions include/coreinit/savedframe.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#pragma once
#include <wut.h>

/**
* \defgroup coreinit_savedframe
* \ingroup coreinit
* @{
*/

#ifdef __cplusplus
extern "C" {
#endif

typedef enum OSSavedFrameType
{
OS_SAVED_FRAME_A = 0,
OS_SAVED_FRAME_B = 1,
} OSSavedFrameType;

typedef enum OSSavedFrameScreen
{
OS_SAVED_FRAME_SCREEN_TV = 2,
OS_SAVED_FRAME_SCREEN_DRC = 4,
} OSSavedFrameScreen;

uint32_t
__OSClearSavedFrame(OSSavedFrameType type,
OSSavedFrameScreen screen);

/**
* Gets the GX2Texture saved via \link __OSSetSavedFrame \endlink
* @param ptr_size must be <= 0x100
*/
void
__OSGetSavedFrame(OSSavedFrameScreen screen,
void *outPtr,
uint32_t ptr_size);

/**
* Gets the GX2Texture saved via \link __OSSetSavedFrame \endlink
* @param ptr_size must be <= 0x100
*/
void
__OSGetSavedFrameA(OSSavedFrameScreen screen,
void *outPtr,
uint32_t ptr_size);

/**
* Gets the GX2Texture saved via \link __OSSetSavedFrame \endlink
* @param ptr_size must be <= 0x100
*/
void
__OSGetSavedFrameB(OSSavedFrameScreen screen,
void *outPtr,
uint32_t ptr_size);

BOOL
__OSGetSavedFrameGammaA(OSSavedFrameScreen screen,
float *outGamma);

BOOL
__OSGetSavedFrameGammaB(OSSavedFrameScreen screen,
float *outGamma);

void *
__OSGetSavedFramePtr(OSSavedFrameType type,
OSSavedFrameScreen screen);

void *
__OSGetSavedFramePtrForRead(OSSavedFrameScreen screen);

void *
__OSGetSavedFramePtrForWrite(OSSavedFrameScreen screen);

uint32_t
__OSGetSavedFrames();

uint32_t
__OSGetSavedFramesA();

uint32_t
__OSGetSavedFramesB();

void
__OSResetSavedFrame(OSSavedFrameScreen screen);

/**
*
* @param data expected to be a GX2Texture
* @param size must be <= 0x100
* @return 0 on succes, -1 on error
*/
int
__OSSetSavedFrame(OSSavedFrameScreen screen,
void *data,
uint32_t size);

void
__OSSetSavedFrameGamma(float gamma,
OSSavedFrameScreen screen);

#ifdef __cplusplus
}
#endif

/** @} */
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <coreinit/messagequeue.h>
#include <coreinit/mutex.h>
#include <coreinit/rendezvous.h>
#include <coreinit/savedframe.h>
#include <coreinit/scheduler.h>
#include <coreinit/screen.h>
#include <coreinit/semaphore.h>
Expand Down

0 comments on commit 35aa8b7

Please sign in to comment.