fix clock on main menu regression and updates gpsp core

This commit is contained in:
Mauro Vietri 2024-05-18 11:20:01 -03:00
parent efe125e3e0
commit 50b3872ddb
2 changed files with 19 additions and 6 deletions

View file

@ -27,12 +27,12 @@ fceumm_REPO = https://github.com/libretro/libretro-fceumm
gambatte_REPO = https://github.com/libretro/gambatte-libretro gambatte_REPO = https://github.com/libretro/gambatte-libretro
gpsp_HASH = 1d1c719 # last known working save states gpsp_HASH = 8745bf3 # last known working save states
mednafen_supafaust_REPO = https://github.com/libretro/supafaust mednafen_supafaust_REPO = https://github.com/libretro/supafaust
pcsx_rearmed_MAKEFILE = Makefile.libretro pcsx_rearmed_MAKEFILE = Makefile.libretro
pcsx_rearmed_HASH = 672e715 # e2fb138 # last known working build pcsx_rearmed_HASH = 672e715 # last known working build
picodrive_REPO = https://github.com/irixxxx/picodrive picodrive_REPO = https://github.com/irixxxx/picodrive
picodrive_MAKEFILE = Makefile.libretro picodrive_MAKEFILE = Makefile.libretro

View file

@ -694,7 +694,7 @@ void GFX_blitRect(int asset, SDL_Surface* dst, SDL_Rect* dst_rect) {
SDL_FillRect(dst, &(SDL_Rect){x+r,y+h-r,w-d,r}, c); SDL_FillRect(dst, &(SDL_Rect){x+r,y+h-r,w-d,r}, c);
GFX_blitAsset(asset, &(SDL_Rect){r,r,r,r}, dst, &(SDL_Rect){x+w-r,y+h-r}); GFX_blitAsset(asset, &(SDL_Rect){r,r,r,r}, dst, &(SDL_Rect){x+w-r,y+h-r});
} }
void GFX_blitBattery(SDL_Surface* dst, SDL_Rect* dst_rect) { void GFX_blitClockAndBattery(SDL_Surface* dst, SDL_Rect* dst_rect) {
// LOG_info("dst: %p\n", dst); // LOG_info("dst: %p\n", dst);
if (!dst_rect) dst_rect = &(SDL_Rect){0,0,0,0}; if (!dst_rect) dst_rect = &(SDL_Rect){0,0,0,0};
@ -722,7 +722,20 @@ void GFX_blitBattery(SDL_Surface* dst, SDL_Rect* dst_rect) {
clip.y = 0; clip.y = 0;
GFX_blitAsset(percent<=20?ASSET_BATTERY_FILL_LOW:ASSET_BATTERY_FILL, &clip, dst, &(SDL_Rect){x+SCALE1(3)+clip.x,y+SCALE1(2)}); GFX_blitAsset(percent<=20?ASSET_BATTERY_FILL_LOW:ASSET_BATTERY_FILL, &clip, dst, &(SDL_Rect){x+SCALE1(3)+clip.x,y+SCALE1(2)});
} }
// Get the current time
time_t currentTime = time(NULL);
struct tm* timeinfo = localtime(&currentTime);
int hours = timeinfo->tm_hour;
int minutes = timeinfo->tm_min;
// Convert hours and minutes to strings
char timeStr[6];
snprintf(timeStr, sizeof(timeStr), "%02d:%02d", hours, minutes);
SDL_Surface* text = TTF_RenderUTF8_Blended(font.large, timeStr, COLOR_WHITE);
SDL_BlitSurface(text, NULL, dst, &(SDL_Rect){dst_rect->x - text->w - 20, dst_rect->y + (SCALE1(PILL_SIZE) - text->h) / 2});
SDL_FreeSurface(text);
} }
int GFX_getButtonWidth(char* hint, char* button) { int GFX_getButtonWidth(char* hint, char* button) {
int button_width = 0; int button_width = 0;
@ -889,7 +902,7 @@ int GFX_blitHardwareGroup(SDL_Surface* dst, int show_setting) {
ow, ow,
SCALE1(PILL_SIZE) SCALE1(PILL_SIZE)
}); });
GFX_blitBattery(dst, &(SDL_Rect){ox,oy}); GFX_blitClockAndBattery(dst, &(SDL_Rect){ox,oy});
} }
return ow; return ow;
@ -1348,7 +1361,7 @@ static void POW_initOverlay(void) {
SDL_SetAlpha(gfx.assets, 0,0); SDL_SetAlpha(gfx.assets, 0,0);
GFX_blitAsset(ASSET_BLACK_PILL, NULL, pow.overlay, NULL); GFX_blitAsset(ASSET_BLACK_PILL, NULL, pow.overlay, NULL);
SDL_SetAlpha(gfx.assets, SDL_SRCALPHA,0); SDL_SetAlpha(gfx.assets, SDL_SRCALPHA,0);
GFX_blitBattery(pow.overlay, NULL); GFX_blitClockAndBattery(pow.overlay, NULL);
// setup overlay // setup overlay
memset(&pow.oargs, 0, sizeof(struct owlfb_overlay_args)); memset(&pow.oargs, 0, sizeof(struct owlfb_overlay_args));