display_driver: Set brightness to 0 before disabling screen

This commit is contained in:
Joel16 2021-12-10 14:23:06 -05:00
parent 48995f634f
commit f8c11b07e7

View File

@ -2,22 +2,30 @@
#include <pspdisplay_kernel.h>
#include <pspsysmem_kernel.h>
PSP_MODULE_INFO("display_driver", PSP_MODULE_KERNEL, 1, 4);
PSP_MODULE_INFO("display_driver", PSP_MODULE_KERNEL, 1, 5);
PSP_NO_CREATE_MAIN_THREAD();
int sceDisplayEnable(void);
int sceDisplayDisable(void);
int sceDisplayEnable371(void);
int sceDisplayDisable371(void);
void sceDisplaySetBrightness371(int level, int unk1);
void sceDisplayGetBrightness371(int *level, int *unk1);
static int old_brightness_level = 0;
int pspDisplayEnable(void) {
u32 k1 = pspSdkSetK1(0);
int ret = 0;
if (sceKernelDevkitVersion() < 0x03070110)
if (sceKernelDevkitVersion() < 0x03070110) {
sceDisplaySetBrightness(old_brightness_level, 0);
ret = sceDisplayEnable();
else
}
else {
sceDisplaySetBrightness371(old_brightness_level, 0);
ret = sceDisplayEnable371();
}
pspSdkSetK1(k1);
return ret;
@ -27,16 +35,22 @@ int pspDisplayDisable(void) {
u32 k1 = pspSdkSetK1(0);
int ret = 0;
if (sceKernelDevkitVersion() < 0x03070110)
if (sceKernelDevkitVersion() < 0x03070110) {
sceDisplaySetBrightness(0, 0);
ret = sceDisplayDisable();
else
}
else {
sceDisplaySetBrightness371(0, 0);
ret = sceDisplayDisable371();
}
pspSdkSetK1(k1);
return ret;
}
int module_start(SceSize args, void *argp) {
int unk = 0;
sceDisplayGetBrightness(&old_brightness_level, &unk);
return 0;
}