DebugComponent.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "EmulatorComponent.h"
  3. #include "GameState.h"
  4. #include "../Input/Keyboard/Keyboard.h"
  5. namespace TLAC::Components
  6. {
  7. class DebugComponent : public EmulatorComponent
  8. {
  9. public:
  10. DebugComponent();
  11. ~DebugComponent();
  12. virtual const char* GetDisplayName() override;
  13. virtual void Initialize(ComponentsManager*) override;
  14. virtual void Update() override;
  15. virtual void UpdateInput() override;
  16. private:
  17. const float aetSpeedUpFactor = 4.0f;
  18. bool dataTestMain = false;
  19. bool printDataTestMain = false;
  20. int selectionIndex = SUB_DATA_TEST_MISC;
  21. const struct { BYTE KeyCode; GameState State; } gameStateKeyMappings[5] =
  22. {
  23. { VK_F4, GS_ADVERTISE },
  24. { VK_F5, GS_GAME },
  25. { VK_F6, GS_DATA_TEST },
  26. { VK_F7, GS_TEST_MODE },
  27. { VK_F8, GS_APP_ERROR },
  28. };
  29. void InjectPatches();
  30. void SetConsoleForeground();
  31. void PrintDataTestMain();
  32. void InternalChangeGameState(GameState state);
  33. void UpdateDataTestMain();
  34. void InjectCode(void* address, const std::initializer_list<uint8_t> &data);
  35. };
  36. }