Skip to content

add other sceDisplay functions #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/display/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CPPFLAGS = -I$(top_srcdir)/src/base -I$(top_srcdir)/src/kernel
CFLAGS = @PSPSDK_CFLAGS@
CCASFLAGS = $(CFLAGS)

DISPLAY_OBJS = sceDisplay_0000.o sceDisplay_0001.o sceDisplay_0002.o sceDisplay_0003.o sceDisplay_0004.o sceDisplay_0005.o sceDisplay_0006.o sceDisplay_0007.o sceDisplay_0008.o sceDisplay_0009.o sceDisplay_0010.o sceDisplay_0011.o sceDisplay_0012.o sceDisplay_0013.o sceDisplay_0014.o sceDisplay_0015.o sceDisplay_0016.o sceDisplay_0017.o
DISPLAY_OBJS = sceDisplay_0000.o sceDisplay_0001.o sceDisplay_0002.o sceDisplay_0003.o sceDisplay_0004.o sceDisplay_0005.o sceDisplay_0006.o sceDisplay_0007.o sceDisplay_0008.o sceDisplay_0009.o sceDisplay_0010.o sceDisplay_0011.o sceDisplay_0012.o sceDisplay_0013.o sceDisplay_0014.o sceDisplay_0015.o sceDisplay_0016.o sceDisplay_0017.o sceDisplay_0018.o sceDisplay_0019.o sceDisplay_0020.o sceDisplay_0021.o sceDisplay_0022.o sceDisplay_0023.o

DISPLAYDRIVER_OBJS = sceDisplay_driver_0000.o sceDisplay_driver_0001.o sceDisplay_driver_0002.o sceDisplay_driver_0003.o sceDisplay_driver_0004.o sceDisplay_driver_0005.o sceDisplay_driver_0006.o sceDisplay_driver_0007.o sceDisplay_driver_0008.o sceDisplay_driver_0009.o sceDisplay_driver_0010.o sceDisplay_driver_0011.o sceDisplay_driver_0012.o sceDisplay_driver_0013.o sceDisplay_driver_0014.o sceDisplay_driver_0015.o sceDisplay_driver_0016.o sceDisplay_driver_0017.o sceDisplay_driver_0018.o sceDisplay_driver_0019.o sceDisplay_driver_0020.o sceDisplay_driver_0021.o sceDisplay_driver_0022.o sceDisplay_driver_0023.o sceDisplay_driver_0024.o sceDisplay_driver_0025.o sceDisplay_driver_0026.o

Expand Down
64 changes: 64 additions & 0 deletions src/display/pspdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,70 @@ int sceDisplayIsForeground(void);
*/
int sceDisplayIsVblank(void);

/**
* Get current display brightness
*
* @param level - Pointer to int to receive the current brightness level (0-100)
* @param unk1 - Pointer to int, receives unknown, it's 1 or 0
*
* @return 0 on success
*/
int sceDisplayGetBrightness(int *level, int *unk1);

/**
* Get resume mode
*
* @warning This function can crash your app or worst(unexpected forced turn off your PSP)
*
* @param resume_mode - Pointer to int to receive the current resume mode
*
* @return ???
*/
int sceDisplayGetResumeMode(int *resume_mode);

/**
* Get the time remaining until the next vertical blank
*
* @note start with sceDisplayWaitVblankStart() to take effect
*
* @return time remaining(in microsecond? or millisecond?)
*
* @return < 0 on error
*/
int sceDisplayGetVblankRest(void);

/**
* Test whether VSYNC is active
*/
int sceDisplayIsVsync(void);

/**
* Wait for vertical blank start after specified number of vertical periods
*
* @param vblank_count - Number of vertical periods before waiting for vertical blank start
*
* @return 0 on success
*/
int sceDisplayWaitVblankStartMulti(unsigned int vblank_count);

/**
* Wait for vertical blank start with callback after specified number of vertical periods
*
* @param vblank_count - Number of vertical periods before waiting for vertical blank start
*
* @return 0 on success
*/
int sceDisplayWaitVblankStartMultiCB(unsigned int vblank_count);

/**
* Adjust the accumulated HSYNC count
*
* @param hcount - Set accumulated HSYNC count
*
* @return 0 on success
*/
int sceDisplayAdjustAccumulatedHcount(int hcount);

#ifdef __cplusplus
}
#endif
Expand Down
20 changes: 19 additions & 1 deletion src/display/sceDisplay.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
IMPORT_FUNC "sceDisplay",0xB4F378FA,sceDisplayIsForeground
#endif
#ifdef F_sceDisplay_0009
IMPORT_FUNC "sceDisplay",0x31C4BAA8,sceDisplay_31C4BAA8
IMPORT_FUNC "sceDisplay",0x31C4BAA8,sceDisplayGetBrightness
#endif
#ifdef F_sceDisplay_0010
IMPORT_FUNC "sceDisplay",0x9C6EAAD7,sceDisplayGetVcount
Expand All @@ -56,3 +56,21 @@
#ifdef F_sceDisplay_0017
IMPORT_FUNC "sceDisplay",0x210EAB3A,sceDisplayGetAccumulatedHcount
#endif
#ifdef F_sceDisplay_0018
IMPORT_FUNC "sceDisplay",0xBF79F646,sceDisplayGetResumeMode
#endif
#ifdef F_sceDisplay_0019
IMPORT_FUNC "sceDisplay",0x69B53541,sceDisplayGetVblankRest
#endif
#ifdef F_sceDisplay_0020
IMPORT_FUNC "sceDisplay",0x210EAB3A,sceDisplayIsVsync
#endif
#ifdef F_sceDisplay_0021
IMPORT_FUNC "sceDisplay",0x21038913,sceDisplayWaitVblankStartMulti
#endif
#ifdef F_sceDisplay_0022
IMPORT_FUNC "sceDisplay",0x77ED8B3A,sceDisplayWaitVblankStartMultiCB
#endif
#ifdef F_sceDisplay_0023
IMPORT_FUNC "sceDisplay",0xA83EF139,sceDisplayAdjustAccumulatedHcount
#endif