this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

conditional

alice 06837484 08b6eb1f

+71 -7
+8
src/api/luaapi.c
··· 1611 1611 return 0; 1612 1612 } 1613 1613 1614 + #ifdef TIC80_FFT_UNSUPPORTED 1615 + lua_pushnumber(lua, 0.0); 1616 + #else 1614 1617 // Return raw VQT data (normalized but unsmoothed) 1615 1618 lua_pushnumber(lua, vqtData[bin] / vqtPeakSmoothValue); 1619 + #endif 1616 1620 return 1; 1617 1621 } 1618 1622 ··· 1635 1639 return 0; 1636 1640 } 1637 1641 1642 + #ifdef TIC80_FFT_UNSUPPORTED 1643 + lua_pushnumber(lua, 0.0); 1644 + #else 1638 1645 // Return smoothed VQT data (smoothed + normalized) 1639 1646 // This gives more stable values 1640 1647 lua_pushnumber(lua, vqtNormalizedData[bin]); 1648 + #endif 1641 1649 return 1; 1642 1650 } 1643 1651
+4
src/core/core.c
··· 20 20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 21 // SOFTWARE. 22 22 23 + #ifndef TIC80_FFT_UNSUPPORTED 23 24 #include "fftdata.h" 24 25 #include "../ext/fft.h" 25 26 #include "vqtdata.h" 26 27 #include "../ext/vqt.h" 28 + #endif 27 29 28 30 #include "api.h" 29 31 #include "core.h" ··· 441 443 442 444 core->data = data; 443 445 446 + #ifndef TIC80_FFT_UNSUPPORTED 444 447 if (fftEnabled) 445 448 { 446 449 FFT_GetFFT(fftData); ··· 454 457 VQT_ProcessAudio(); 455 458 } 456 459 } 460 + #endif 457 461 if (!core->state.initialized) 458 462 { 459 463 const char* code = tic->cart.code.data;
+17 -1
src/ext/vqt.c
··· 2 2 #include "vqt_kernel.h" 3 3 #include "../vqtdata.h" 4 4 #include "../fftdata.h" 5 + 6 + #ifndef TIC80_FFT_UNSUPPORTED 7 + 5 8 #include "fft.h" 6 9 #include "kiss_fftr.h" 10 + 11 + #define _USE_MATH_DEFINES 7 12 #include <math.h> 13 + 8 14 #include <string.h> 9 15 #include <stdbool.h> 10 16 #include <stdio.h> ··· 410 416 411 417 // Clean up kernels 412 418 VQT_Cleanup(); 413 - } 419 + } 420 + 421 + #else // TIC80_FFT_UNSUPPORTED 422 + 423 + // Stub implementations when FFT is unsupported 424 + bool VQT_Open(void) { return true; } 425 + void VQT_ProcessAudio(void) {} 426 + void VQT_Close(void) {} 427 + void VQT_ApplyKernels(const float* fftReal, const float* fftImag) {} 428 + 429 + #endif // TIC80_FFT_UNSUPPORTED
+15 -5
src/ext/vqt_kernel.c
··· 1 1 #include "vqt_kernel.h" 2 2 #include "../vqtdata.h" 3 + 4 + #ifndef TIC80_FFT_UNSUPPORTED 5 + 6 + #define _USE_MATH_DEFINES 3 7 #include <math.h> 8 + 4 9 #include <stdlib.h> 5 10 #include <string.h> 6 11 #include "../ext/kiss_fftr.h" 7 - 8 - #ifndef M_PI 9 - #define M_PI 3.14159265358979323846 10 - #endif 11 12 12 13 // Generate logarithmically spaced center frequencies for musical notes 13 14 void VQT_GenerateCenterFrequencies(float* frequencies, int numBins, float minFreq, float maxFreq) ··· 293 294 free(fftCfg); 294 295 free(centerFreqs); 295 296 return success; 296 - } 297 + } 298 + 299 + #else // TIC80_FFT_UNSUPPORTED 300 + 301 + // Stub implementations when FFT is unsupported 302 + void VQT_GenerateCenterFrequencies(float* frequencies, int numBins, float minFreq, float maxFreq) {} 303 + float VQT_CalculateQ(int binsPerOctave) { return 0.0f; } 304 + bool VQT_GenerateKernels(VqtKernel* kernels, const VqtKernelConfig* config) { return false; } 305 + 306 + #endif // TIC80_FFT_UNSUPPORTED
+7
src/studio/studio.c
··· 21 21 // SOFTWARE. 22 22 23 23 #include "studio.h" 24 + #include "tic80_config.h" 24 25 25 26 #if defined(BUILD_EDITORS) 26 27 ··· 39 40 #define MSF_GIF_IMPL 40 41 #include "msf_gif.h" 41 42 43 + #ifndef TIC80_FFT_UNSUPPORTED 42 44 #include "../fftdata.h" 43 45 #include "ext/fft.h" 46 + #endif 44 47 45 48 #endif 46 49 ··· 1582 1585 { 1583 1586 #if defined(BUILD_EDITORS) 1584 1587 1588 + #ifndef TIC80_FFT_UNSUPPORTED 1585 1589 if (studio->config->data.fft) { 1586 1590 // initialize FFT data structures 1587 1591 fPeakMinValue = 0.01f; ··· 1593 1597 memset(fftNormalizedData, 0, sizeof(fftNormalizedData[0]) * FFT_SIZE); 1594 1598 memset(fftNormalizedMaxData, 0, sizeof(fftNormalizedMaxData[0]) * FFT_SIZE); 1595 1599 } 1600 + #endif 1596 1601 1597 1602 if(studio->console->args.keepcmd 1598 1603 && studio->console->commands.count ··· 2876 2881 = studio->bytebattle.battle.time 2877 2882 = args.battletime * 60 * 1000; 2878 2883 2884 + #ifndef TIC80_FFT_UNSUPPORTED 2879 2885 if (args.fftlist) 2880 2886 { 2881 2887 FFT_EnumerateDevices(); 2882 2888 exit(0); 2883 2889 } 2890 + #endif 2884 2891 studio->config->data.fft = args.fft; 2885 2892 studio->config->data.fftcaptureplaybackdevices = args.fftcaptureplaybackdevices; 2886 2893 studio->config->data.fftdevice = args.fftdevice;
+20 -1
src/vqtdata.c
··· 1 1 #include "vqtdata.h" 2 + 3 + #ifndef TIC80_FFT_UNSUPPORTED 4 + 2 5 #include <string.h> 3 6 #include <stdlib.h> 4 7 #include <math.h> ··· 56 59 } 57 60 vqtKernels[i].length = 0; 58 61 } 59 - } 62 + } 63 + 64 + #else // TIC80_FFT_UNSUPPORTED 65 + 66 + // When FFT is unsupported, provide empty implementations 67 + float vqtData[VQT_BINS] = {0}; 68 + float vqtSmoothingData[VQT_BINS] = {0}; 69 + float vqtNormalizedData[VQT_BINS] = {0}; 70 + float vqtPeakValue = 1.0f; 71 + float vqtPeakSmoothValue = 1.0f; 72 + bool vqtEnabled = false; 73 + VqtKernel vqtKernels[VQT_BINS] = {{0}}; 74 + 75 + void VQT_Init(void) {} 76 + void VQT_Cleanup(void) {} 77 + 78 + #endif // TIC80_FFT_UNSUPPORTED