| 1 | #pragma once |
| 2 | |
| 3 | #include <stdint.h> |
| 4 | #include <stdbool.h> |
| 5 | #include "pt2_header.h" |
| 6 | #include "pt2_hpc.h" |
| 7 | |
| 8 | #define MAX_UPSCALE_FACTOR 16 // 5120x4080 - ought to be good enough for many years to come |
| 9 | |
| 10 | enum |
| 11 | { |
| 12 | SPRITE_PATTERN_CURSOR = 0, |
| 13 | SPRITE_LOOP_PIN_LEFT = 1, |
| 14 | SPRITE_LOOP_PIN_RIGHT = 2, |
| 15 | SPRITE_SAMPLING_POS_LINE = 3, |
| 16 | SPRITE_MOUSE_POINTER = 4, // above all other sprites |
| 17 | |
| 18 | SPRITE_NUM, |
| 19 | |
| 20 | SPRITE_TYPE_PALETTE = 0, |
| 21 | SPRITE_TYPE_RGB = 1 |
| 22 | }; |
| 23 | |
| 24 | void resetFPSCounter(void); |
| 25 | void beginFPSCounter(void); |
| 26 | void endFPSCounter(void); |
| 27 | |
| 28 | void blit32(int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t *src); |
| 29 | void putPixel(int32_t x, int32_t y, const uint32_t pixelColor); |
| 30 | void hLine(int32_t x, int32_t y, int32_t w, const uint32_t pixelColor); |
| 31 | void vLine(int32_t x, int32_t y, int32_t h, const uint32_t pixelColor); |
| 32 | void drawFramework1(int32_t x, int32_t y, int32_t w, int32_t h); |
| 33 | void drawFramework2(int32_t x, int32_t y, int32_t w, int32_t h); |
| 34 | void drawFramework3(int32_t x, int32_t y, int32_t w, int32_t h); |
| 35 | void fillRect(int32_t x, int32_t y, int32_t w, int32_t h, const uint32_t pixelColor); |
| 36 | void drawButton1(int32_t x, int32_t y, int32_t w, int32_t h, const char *text); |
| 37 | void drawButton2(int32_t x, int32_t y, int32_t w, int32_t h, const char *text); |
| 38 | void drawUpButton(int32_t x, int32_t y); |
| 39 | void drawDownButton(int32_t x, int32_t y); |
| 40 | |
| 41 | void statusAllRight(void); |
| 42 | void statusOutOfMemory(void); |
| 43 | void statusSampleIsEmpty(void); |
| 44 | void statusNotSampleZero(void); |
| 45 | void changeStatusText(const char *text); |
| 46 | void resetAllScreens(void); |
| 47 | |
| 48 | bool setupVideo(void); |
| 49 | void renderFrame2(void); |
| 50 | void renderFrame(void); |
| 51 | void flipFrame(void); |
| 52 | void updateSpectrumAnalyzer(uint8_t vol, uint16_t period); |
| 53 | void sinkVisualizerBars(void); |
| 54 | void updatePosEd(void); |
| 55 | void updateVisualizer(void); |
| 56 | void updateEditOp(void); |
| 57 | void toggleFullscreen(void); |
| 58 | void videoClose(void); |
| 59 | void displayMainScreen(void); |
| 60 | void renderMuteButtons(void); |
| 61 | void renderAboutScreen(void); |
| 62 | void renderQuadrascopeBg(void); |
| 63 | void renderSpectrumAnalyzerBg(void); |
| 64 | void renderEditOpMode(void); |
| 65 | void renderEditOpScreen(void); |
| 66 | void renderSamplerVolBox(void); |
| 67 | void renderSamplerFiltersBox(void); |
| 68 | void removeSamplerVolBox(void); |
| 69 | void removeSamplerFiltersBox(void); |
| 70 | void fillToVuMetersBgBuffer(void); |
| 71 | void showVolFromSlider(void); |
| 72 | void showVolToSlider(void); |
| 73 | void updateCurrSample(void); |
| 74 | void eraseSprites(void); |
| 75 | void renderSprites(void); |
| 76 | void handleLastGUIObjectDown(void); |
| 77 | void invertRange(void); |
| 78 | void updateCursorPos(void); |
| 79 | void renderVuMeters(void); |
| 80 | void setupSprites(void); |
| 81 | void freeSprites(void); |
| 82 | void setSpritePos(int32_t sprite, int32_t x, int32_t y); |
| 83 | void hideSprite(int32_t sprite); |