From 889af509fa9ff580766be2de92081b5ee6f1edf7 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 1 Jul 2024 19:30:26 +1000 Subject: [PATCH] Terminal: Fix not resetting state properly on mac/Linux --- src/Graphics_PS1.c | 13 ------------- src/Input.c | 2 +- src/Input.h | 2 +- src/Window_Terminal.c | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/Graphics_PS1.c b/src/Graphics_PS1.c index c8cfdb48a..2b00cae73 100644 --- a/src/Graphics_PS1.c +++ b/src/Graphics_PS1.c @@ -691,14 +691,9 @@ static void DrawColouredQuads3D(int verticesCount, int startVertex) { int p = (coords[0].z + coords[1].z + coords[2].z + coords[3].z) / 4; if (p < 0 || p >= OT_LENGTH) continue; - //int X = v[0].x, Y = v[0].y, Z = v[0].z; - //if (VERTEX_LOGGING) Platform_Log3("IN: %i, %i, %i", &X, &Y, &Z); - //X = poly->x1; Y = poly->y1, Z = coords[0].z; - poly->r0 = PackedCol_R(v->Col); poly->g0 = PackedCol_G(v->Col); poly->b0 = PackedCol_B(v->Col); - //if (VERTEX_LOGGING) Platform_Log4("OUT: %i, %i, %i (%i)", &X, &Y, &Z, &p); addPrim(&buffer->ot[p >> 2], poly); } @@ -748,21 +743,13 @@ static void DrawTexturedQuads3D(int verticesCount, int startVertex) { poly->u3 = (v[3].u >> uShift) + uOffset; poly->v3 = (v[3].v >> vShift) + vOffset; - //int P = curTex->height, page = poly->tpage & 0xFF, ll = curTex->yOffset; - //Platform_Log4("XYZ: %f3 x %i, %i, %i", &v[0].V, &P, &page, &ll); int p = (coords[0].z + coords[1].z + coords[2].z + coords[3].z) / 4; if (p < 0 || p >= OT_LENGTH) continue; - //int X = v[0].x, Y = v[0].y, Z = v[0].z; - //if (VERTEX_LOGGING) Platform_Log3("IN: %i, %i, %i", &X, &Y, &Z); - //X = poly->x1; Y = poly->y1, Z = coords[0].z; - poly->r0 = PackedCol_R(v->Col) >> 1; poly->g0 = PackedCol_G(v->Col) >> 1; poly->b0 = PackedCol_B(v->Col) >> 1; - //if (VERTEX_LOGGING) Platform_Log4("OUT: %i, %i, %i (%i)", &X, &Y, &Z, &p); - // TODO: 2D shouldn't use AddPrim, draws in the wrong way addPrim(&buffer->ot[p >> 2], poly); } } diff --git a/src/Input.c b/src/Input.c index ea25710ef..06e627a19 100644 --- a/src/Input.c +++ b/src/Input.c @@ -239,7 +239,7 @@ static const char* const storageNames[INPUT_COUNT] = { Pad_Names }; -const char* const Input_DisplayNames[INPUT_COUNT] = { +const char* Input_DisplayNames[INPUT_COUNT] = { "NONE", Key_Function_Names, "GRAVE", "MINUS", "PLUS", "LBRACKET", "RBRACKET", "SLASH", diff --git a/src/Input.h b/src/Input.h index a2d58116d..ed25e512f 100644 --- a/src/Input.h +++ b/src/Input.h @@ -67,7 +67,7 @@ enum InputButtons { }; #define Input_IsPadButton(btn) ((btn) >= CCPAD_1 && (btn) < INPUT_COUNT) -extern const char* const Input_DisplayNames[INPUT_COUNT]; +extern const char* Input_DisplayNames[INPUT_COUNT]; extern struct _InputState { /* Pressed state of each input button. Use Input_Set to change */ diff --git a/src/Window_Terminal.c b/src/Window_Terminal.c index 32c06ebd2..9460b0240 100644 --- a/src/Window_Terminal.c +++ b/src/Window_Terminal.c @@ -55,7 +55,7 @@ static int supportsTruecolor; #define ERASE_CMD(cmd) CSI cmd "J" #define DEC_PM_SET(cmd) CSI "?" cmd "h" -#define DEC_PM_RESET(cmd) CSI "?" cmd "1" +#define DEC_PM_RESET(cmd) CSI "?" cmd "l" #define OutputConst(str) OutputConsole(str, sizeof(str) - 1)