From d00174c680e945b22585c1eb6305df0f4f036587 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 7 Apr 2024 15:02:31 +1000 Subject: [PATCH] 3DS: Chat should be sent immediately after clicking Send, also display normal keyboard layout for 'number' input types since the 3DS numpad keyboard doesn't include a decimal point --- src/Graphics_3DS.c | 2 ++ src/Window_3DS.c | 5 ++++- third_party/citro3d.c | 4 +--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Graphics_3DS.c b/src/Graphics_3DS.c index f864cc292..3743f1baa 100644 --- a/src/Graphics_3DS.c +++ b/src/Graphics_3DS.c @@ -319,6 +319,8 @@ static bool CreateNativeTexture(C3D_Tex* tex, u32 width, u32 height) { } static void TryTransferToVRAM(C3D_Tex* tex) { + return; + // NOTE: the linearFree below results in broken texture. maybe no DMA? void* vram = vramAlloc(tex->size); if (!vram) return; diff --git a/src/Window_3DS.c b/src/Window_3DS.c index 92256cc6c..fc6849666 100644 --- a/src/Window_3DS.c +++ b/src/Window_3DS.c @@ -220,6 +220,8 @@ static void OnscreenTextChanged(const char* text) { String_AppendUtf8(&tmp, text, String_Length(text)); Event_RaiseString(&InputEvents.TextChanged, &tmp); + Input_SetPressed(CCKEY_ENTER); + Input_SetReleased(CCKEY_ENTER); } void Window_OpenKeyboard(struct OpenKeyboardArgs* args) { @@ -230,7 +232,8 @@ void Window_OpenKeyboard(struct OpenKeyboardArgs* args) { String_EncodeUtf8(input, args->text); int mode = args->type & 0xFF; - int type = (mode == KEYBOARD_TYPE_NUMBER || mode == KEYBOARD_TYPE_INTEGER) ? SWKBD_TYPE_NUMPAD : SWKBD_TYPE_WESTERN; + // Numpad mode doesn't display . symbol, so can't be used for KEYBOARD_TYPE_NUMBER unfortunately + int type = mode == KEYBOARD_TYPE_INTEGER ? SWKBD_TYPE_NUMPAD : SWKBD_TYPE_WESTERN; swkbdInit(&swkbd, type, 3, -1); swkbdSetInitialText(&swkbd, input); diff --git a/third_party/citro3d.c b/third_party/citro3d.c index 41d639501..96afe5e76 100644 --- a/third_party/citro3d.c +++ b/third_party/citro3d.c @@ -1299,9 +1299,7 @@ static void C3Di_TexEnvBind(int id, C3D_TexEnv* env) static void C3D_TexLoadImage(C3D_Tex* tex, const void* data, GPU_TEXFACE face, int level) { u32 size = 0; - void* out = C3D_TexGetImagePtr(tex, - tex->data, - level, &size); + void* out = C3D_TexGetImagePtr(tex, tex->data, level, &size); if (!addrIsVRAM(out)) memcpy(out, data, size);