Skip to content
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

overlays: implement osk panels #7781

Merged
merged 4 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions rpcs3/Emu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ target_sources(rpcs3_emu PRIVATE
RSX/Overlays/overlay_list_view.cpp
RSX/Overlays/overlay_message_dialog.cpp
RSX/Overlays/overlay_osk.cpp
RSX/Overlays/overlay_osk_panel.cpp
RSX/Overlays/overlay_perf_metrics.cpp
RSX/Overlays/overlay_progress_bar.cpp
RSX/Overlays/overlay_save_dialog.cpp
Expand Down
10 changes: 6 additions & 4 deletions rpcs3/Emu/Cell/Modules/cellOskDialog.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/RSX/Overlays/overlay_osk.h"
#include "Input/pad_thread.h"
Expand Down Expand Up @@ -62,8 +63,7 @@ std::shared_ptr<OskDialogBase> _get_osk_dialog(bool create = false)

if (auto manager = g_fxo->get<rsx::overlays::display_manager>())
{
auto dlg = std::make_shared<rsx::overlays::osk_latin>();

std::shared_ptr<rsx::overlays::osk_dialog> dlg = std::make_shared<rsx::overlays::osk_dialog>();
osk->dlg = manager->add(dlg);
}
else
Expand Down Expand Up @@ -105,7 +105,9 @@ error_code cellOskDialogLoadAsync(u32 container, vm::ptr<CellOskDialogParam> dia

// Get the OSK options
u32 maxLength = (inputFieldInfo->limit_length >= CELL_OSKDIALOG_STRING_SIZE) ? 511 : u32{inputFieldInfo->limit_length};
u32 options = dialogParam->prohibitFlgs;
const u32 prohibitFlgs = dialogParam->prohibitFlgs;
const u32 allowOskPanelFlg = dialogParam->allowOskPanelFlg;
const u32 firstViewPanel = dialogParam->firstViewPanel;

// Get init text and prepare return value
osk->osk_input_result = CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK;
Expand Down Expand Up @@ -242,7 +244,7 @@ error_code cellOskDialogLoadAsync(u32 container, vm::ptr<CellOskDialogParam> dia

Emu.CallAfter([=, &result]()
{
osk->Create("On Screen Keyboard", message, osk->osk_text, maxLength, options);
osk->Create("On Screen Keyboard", message, osk->osk_text, maxLength, prohibitFlgs, allowOskPanelFlg, firstViewPanel);
result = true;
});

Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/Modules/cellOskDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ enum class OskDialogState
class OskDialogBase
{
public:
virtual void Create(const std::string& title, const std::u16string& message, char16_t* init_text, u32 charlimit, u32 options) = 0;
virtual void Create(const std::string& title, const std::u16string& message, char16_t* init_text, u32 charlimit, u32 prohibit_flags, u32 panel_flag, u32 first_view_panel) = 0;
virtual void Close(bool accepted) = 0;
virtual ~OskDialogBase();

Expand Down
5 changes: 5 additions & 0 deletions rpcs3/Emu/RSX/Overlays/overlay_fonts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ namespace rsx
{
return language_class::hangul;
}
case 0xFF: // Halfwidth and Fullwidth Forms
{
// Found in SCE-PS3-SR-R-JPN.TTF, so we'll use cjk_base for now
return language_class::cjk_base;
}
default:
{
if (codepage_id >= 0xAC && codepage_id <= 0xD7)
Expand Down