From f44126f0a422f8f45f79fd9a76104ed16b58539b Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 8 Nov 2023 13:03:55 -0800 Subject: [PATCH] Remove tas controller --- src/pc/controller/controller_entry_point.c | 2 - src/pc/controller/controller_recorded_tas.c | 46 --------------------- src/pc/controller/controller_recorded_tas.h | 8 ---- 3 files changed, 56 deletions(-) delete mode 100644 src/pc/controller/controller_recorded_tas.c delete mode 100644 src/pc/controller/controller_recorded_tas.h diff --git a/src/pc/controller/controller_entry_point.c b/src/pc/controller/controller_entry_point.c index 27e0a4b7..08fb4d43 100644 --- a/src/pc/controller/controller_entry_point.c +++ b/src/pc/controller/controller_entry_point.c @@ -4,7 +4,6 @@ #include "../configfile.h" -#include "controller_recorded_tas.h" #include "controller_keyboard.h" #include "controller_sdl.h" @@ -21,7 +20,6 @@ int mouse_window_x; int mouse_window_y; static struct ControllerAPI *controller_implementations[] = { - &controller_recorded_tas, #if defined(CAPI_SDL2) || defined(CAPI_SDL1) &controller_sdl, #endif diff --git a/src/pc/controller/controller_recorded_tas.c b/src/pc/controller/controller_recorded_tas.c deleted file mode 100644 index 73b507dc..00000000 --- a/src/pc/controller/controller_recorded_tas.c +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include - -#include "controller_api.h" - -static FILE *fp; - -static void tas_init(void) { - fp = fopen("cont.m64", "rb"); - if (fp != NULL) { - uint8_t buf[0x400]; - fread(buf, 1, sizeof(buf), fp); - } -} - -static void tas_read(OSContPad *pad) { - if (fp != NULL) { - uint8_t bytes[4] = {0}; - fread(bytes, 1, 4, fp); - pad->button = (bytes[0] << 8) | bytes[1]; - pad->stick_x = bytes[2]; - pad->stick_y = bytes[3]; - } -} - -static void tas_shutdown(void) { - if (fp != NULL) { - fclose(fp); - fp = NULL; - } -} - -static u32 tas_rawkey(void) { - return VK_INVALID; -} - -struct ControllerAPI controller_recorded_tas = { - VK_INVALID, - tas_init, - tas_read, - tas_rawkey, - NULL, // no rumble_play - NULL, // no rumble_stop - NULL, // no rebinding - tas_shutdown -}; diff --git a/src/pc/controller/controller_recorded_tas.h b/src/pc/controller/controller_recorded_tas.h deleted file mode 100644 index 15ead4ba..00000000 --- a/src/pc/controller/controller_recorded_tas.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONTROLLER_RECORDED_TAS_H -#define CONTROLLER_RECORDED_TAS_H - -#include "controller_api.h" - -extern struct ControllerAPI controller_recorded_tas; - -#endif