diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..755c16c --- /dev/null +++ b/build.bat @@ -0,0 +1 @@ +clang++ src\main.cpp -o build\ayo.exe -Wall -Wextra -Wpedantic -std=c++11 -g -gcodeview -Wl,-pdb= -L C:\capybara\libclang\x86_64-w64-mingw32\bin -l c++ -l unwind -static --verbose diff --git a/src/debug.h b/src/debug.h new file mode 100644 index 0000000..f91232b --- /dev/null +++ b/src/debug.h @@ -0,0 +1,10 @@ +#pragma once + +#if defined (QT_DEBUG) || defined (DEBUG) || defined (_DEBUG) + +#define log_debugcpp(str) do { \ + std::cout << "[DEBUG]" << "(" << __FILE__ << ":" << __LINE__ << "): " << str << std::endl; \ + } while (0) +#else +#define log_debugcpp(str) +#endif diff --git a/src/global.h b/src/global.h new file mode 100644 index 0000000..96d177b --- /dev/null +++ b/src/global.h @@ -0,0 +1,15 @@ +#pragma once + +//TODO enum capullo +#define ENDPOINT_MASTER_VOLUME -1 +#define ENDPOINT_LEFT_CHANNEL_VOLUME 0 +#define ENDPOINT_RIGHT_CHANNEL_VOLUME 1 + +#define STRING_MUTE "Mute" +#define STRING_UNMUTE "Unmute" +//INIT BACK + + +class OverseerHandler; +extern OverseerHandler *osh; + diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..da263e1 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,23 @@ +#ifndef DEBUG +#define DEBUG +#endif + +#include +#include +#include "debug.h" + +//static inline +uint64_t rdtscp()// uint32_t & aux ) +{ + uint64_t raxlo,rdxho; + asm volatile ( "cpuid\n" \ + //"rdtscp\n" : "=a" (raxlo), "=d" (rdxho), "=c" (aux) : : ); + "rdtsc\n" : "=a" (raxlo), "=d" (rdxho)); + return (rdxho << 32) + raxlo; +} + +int main(int argc, char** argv){ + uint64_t test = rdtscp(); + log_debugcpp(test); + return 0; +}