| 1 | #pragma once |
| 2 | |
| 3 | #include <stdint.h> |
| 4 | |
| 5 | enum |
| 6 | { |
| 7 | PAL_BACKGRD = 0, |
| 8 | PAL_BORDER = 1, |
| 9 | PAL_GENBKG = 2, |
| 10 | PAL_GENBKG2 = 3, |
| 11 | PAL_QADSCP = 4, |
| 12 | PAL_PATCURSOR = 5, |
| 13 | PAL_GENTXT = 6, |
| 14 | PAL_PATTXT = 7 |
| 15 | }; |
| 16 | |
| 17 | #define RGB24_COLORKEY 0xFF000000 |
| 18 | |
| 19 | #define R12(x) ((x >> 8) & 15) |
| 20 | #define G12(x) ((x >> 4) & 15) |
| 21 | #define B12(x) ((x >> 0) & 15) |
| 22 | |
| 23 | #define R24(x) ((x >> 16) & 255) |
| 24 | #define G24(x) ((x >> 8) & 255) |
| 25 | #define B24(x) ((x >> 0) & 255) |
| 26 | |
| 27 | #define R12_to_R24(x) (R12(x) * 17) |
| 28 | #define G12_to_G24(x) (G12(x) * 17) |
| 29 | #define B12_to_B24(x) (B12(x) * 17) |
| 30 | |
| 31 | #define R24_to_R12(x) (R24(x) >> 4) |
| 32 | #define G24_to_G12(x) (G24(x) >> 4) |
| 33 | #define B24_to_B12(x) (B24(x) >> 4) |
| 34 | |
| 35 | #define RGB12_to_RGB24(x) ((R12_to_R24(x) << 16) | (G12_to_G24(x) << 8) | (B12_to_B24(x))) |
| 36 | #define RGB24_to_RGB12(x) ((R24_to_R12(x) << 8) | (G24_to_G12(x) << 4) | (B24_to_B12(x))) |
| 37 | |
| 38 | #define RGB12(r, g, b) (((r) << 8) | ((g) << 4) | (b)) |
| 39 | #define RGB24(r, g, b) (((r) << 16) | ((g) << 8) | (b)) |
| 40 | |
| 41 | extern uint16_t palette[8]; |
| 42 | extern uint16_t vuColors[48]; |
| 43 | extern uint16_t analyzerColors[36]; |
| 44 | extern uint32_t spectrumAnalyzerBMP[36]; |
| 45 | extern uint32_t vuMeterBMP[480]; |
| 46 | extern uint32_t patternCursorBMP[154]; |
| 47 | |
| 48 | void fillCancel1Colors(void); |
| 49 | void cancel1Color(void); |
| 50 | void setUndo1Color(uint8_t paletteIndex); |
| 51 | void undo1Color(void); |
| 52 | |
| 53 | void fillCancel2Colors(void); |
| 54 | void cancel2Color(void); |
| 55 | void setUndo2Color(uint8_t colorIndex); |
| 56 | void undo2Color(void); |
| 57 | |
| 58 | void setDefaultPalette(void); |
| 59 | void setDefaultVuColors(void); |
| 60 | void setDefaultAnalyzerColors(void); |
| 61 | void updatePatternCursorBMP(void); |
| 62 | void updateSpectrumAnalyzerBMP(void); |
| 63 | void updateVuMeterBMP(void); |
| 64 | |
| 65 | uint16_t colorPicker(uint16_t inputColor); |
| 66 | |
| 67 | void updateBMPs(void); |