From b0868613bb33d420d0df8779052d9e8713ac0d2b Mon Sep 17 00:00:00 2001 From: raven02 Date: Sat, 19 Jan 2013 21:05:05 +0800 Subject: [PATCH 1/3] Add DoState() to scePsmfPlayer . --- Core/Dialog/PSPDialog.cpp | 2 +- Core/HLE/scePsmf.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Core/Dialog/PSPDialog.cpp b/Core/Dialog/PSPDialog.cpp index 8871509e81..2d348b3370 100644 --- a/Core/Dialog/PSPDialog.cpp +++ b/Core/Dialog/PSPDialog.cpp @@ -43,7 +43,7 @@ PSPDialog::DialogStatus PSPDialog::GetStatus() void PSPDialog::StartDraw() { PPGeBegin(); - PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x90606060)); + PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x00606060)); } void PSPDialog::EndDraw() { diff --git a/Core/HLE/scePsmf.cpp b/Core/HLE/scePsmf.cpp index 937a8116b5..eb6dd8500d 100644 --- a/Core/HLE/scePsmf.cpp +++ b/Core/HLE/scePsmf.cpp @@ -141,6 +141,7 @@ public: class PsmfPlayer { public: PsmfPlayer(u32 data); + void DoState(PointerWrap &p); int videoCodec; int videoStreamNum; @@ -295,6 +296,23 @@ void Psmf::DoState(PointerWrap &p) { p.DoMarker("Psmf"); } +void PsmfPlayer::DoState(PointerWrap &p) { + p.Do(videoCodec); + p.Do(videoStreamNum); + p.Do(audioCodec); + p.Do(audioStreamNum); + p.Do(playMode); + p.Do(playSpeed); + + p.Do(displayBuffer); + p.Do(displayBufferSize); + p.Do(playbackThreadPriority); + p.Do(psmfMaxAheadTimestamp); + p.Do(psmfPlayerLastTimestamp); + + p.DoMarker("PsmfPlayer"); +} + static std::map psmfMap; static std::map psmfPlayerMap; // TODO: Should have a map. From 7961197dacdd564c501c5d8893fcf1ba58dff34f Mon Sep 17 00:00:00 2001 From: raven02 Date: Sat, 19 Jan 2013 22:14:19 +0800 Subject: [PATCH 2/3] Cosmetic fix PSPSaveDialog::DisplayConfirmationYesNo --- Core/Dialog/PSPDialog.cpp | 2 +- Core/Dialog/PSPSaveDialog.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Core/Dialog/PSPDialog.cpp b/Core/Dialog/PSPDialog.cpp index 2d348b3370..e58df90e65 100644 --- a/Core/Dialog/PSPDialog.cpp +++ b/Core/Dialog/PSPDialog.cpp @@ -43,7 +43,7 @@ PSPDialog::DialogStatus PSPDialog::GetStatus() void PSPDialog::StartDraw() { PPGeBegin(); - PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x00606060)); + PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x70606060)); } void PSPDialog::EndDraw() { diff --git a/Core/Dialog/PSPSaveDialog.cpp b/Core/Dialog/PSPSaveDialog.cpp index 302bc7767c..3393f82191 100644 --- a/Core/Dialog/PSPSaveDialog.cpp +++ b/Core/Dialog/PSPSaveDialog.cpp @@ -300,11 +300,11 @@ void PSPSaveDialog::DisplaySaveDataInfo2() void PSPSaveDialog::DisplayConfirmationYesNo(std::string text) { - PPGeDrawText(text.c_str(), 180, 100, PPGE_ALIGN_LEFT, 0.45f, 0xFFFFFFFF); - - PPGeDrawText("Yes", 230, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF)); - PPGeDrawText("No", 330, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF)); - + PPGeDrawRect(180, 105, 460, 106, CalcFadedColor(0xFFFFFFFF)); + PPGeDrawText(text.c_str(), 220, 110, PPGE_ALIGN_LEFT, 0.45f, 0xFFFFFFFF); + PPGeDrawText("Yes", 250, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF)); + PPGeDrawText("No", 350, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF)); + PPGeDrawRect(180, 160, 460, 161, CalcFadedColor(0xFFFFFFFF)); if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0) { yesnoChoice = 1; @@ -579,7 +579,8 @@ int PSPSaveDialog::Update() DisplaySaveIcon(); DisplaySaveDataInfo2(); - DisplayConfirmationYesNo("The data will be deleted.\nAre you sure you want to continue?"); + DisplayConfirmationYesNo(" This save data will be deleted.\nAre you sure you want to continue?"); + DisplayEnterBack(); if (IsButtonPressed(cancelButtonFlag)) From 79d9f25e922a6246bc7bba7df8ac93de0a83b883 Mon Sep 17 00:00:00 2001 From: raven02 Date: Sat, 19 Jan 2013 23:41:35 +0800 Subject: [PATCH 3/3] Display AM/PM and 12 hour format --- Core/Dialog/PSPSaveDialog.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Core/Dialog/PSPSaveDialog.cpp b/Core/Dialog/PSPSaveDialog.cpp index 3393f82191..ff3bb8e6bb 100644 --- a/Core/Dialog/PSPSaveDialog.cpp +++ b/Core/Dialog/PSPSaveDialog.cpp @@ -251,13 +251,21 @@ void PSPSaveDialog::DisplaySaveDataInfo1() char saveTitle[512]; char saveDetail[512]; + char am_pm[] = "AM"; + int hour = param.GetFileInfo(currentSelectedSave).modif_time.tm_hour ; + if( hour > 12 ) { + strcpy(am_pm, "PM"); + hour -= 12; + } + snprintf(title,512,"%s", param.GetFileInfo(currentSelectedSave).title); - snprintf(time,512,"%02d/%02d/%d %02d:%02d %lld KB" + snprintf(time,512,"%02d/%02d/%d %02d:%02d %s %lld KB" , param.GetFileInfo(currentSelectedSave).modif_time.tm_mday , param.GetFileInfo(currentSelectedSave).modif_time.tm_mon + 1 , param.GetFileInfo(currentSelectedSave).modif_time.tm_year + 1900 - , param.GetFileInfo(currentSelectedSave).modif_time.tm_hour + , hour , param.GetFileInfo(currentSelectedSave).modif_time.tm_min + , am_pm , param.GetFileInfo(currentSelectedSave).size / 1024 ); snprintf(saveTitle,512,"%s", param.GetFileInfo(currentSelectedSave).saveTitle); @@ -284,13 +292,21 @@ void PSPSaveDialog::DisplaySaveDataInfo2() else { char txt[1024]; - snprintf(txt,1024,"%s\n%02d/%02d/%d %02d:%02d\n%lld KB" + char am_pm[] = "AM"; + int hour = param.GetFileInfo(currentSelectedSave).modif_time.tm_hour ; + if( hour > 12 ) { + strcpy(am_pm, "PM"); + hour -= 12; + } + + snprintf(txt,1024,"%s\n%02d/%02d/%d %02d:%02d %s\n%lld KB" , param.GetFileInfo(currentSelectedSave).saveTitle , param.GetFileInfo(currentSelectedSave).modif_time.tm_mday , param.GetFileInfo(currentSelectedSave).modif_time.tm_mon + 1 , param.GetFileInfo(currentSelectedSave).modif_time.tm_year + 1900 - , param.GetFileInfo(currentSelectedSave).modif_time.tm_hour + , hour , param.GetFileInfo(currentSelectedSave).modif_time.tm_min + , am_pm , param.GetFileInfo(currentSelectedSave).size / 1024 ); std::string saveinfoTxt = txt;