| 1 | // for finding memory leaks in debug mode with Visual Studiocxx . . $ `<file>/src/pt2_visuals.c`/ |
| 2 | #if defined _DEBUG && defined _MSC_VER |
| 3 | #include <crtdbg.h> |
| 4 | #endif |
| 5 | |
| 6 | #include <stdio.h> |
| 7 | #include <stdint.h> |
| 8 | #include <stdbool.h> |
| 9 | #include <string.h> |
| 10 | #include <math.h> // modf() |
| 11 | #ifdef _WIN32 |
| 12 | #define WIN32_MEAN_AND_LEAN |
| 13 | #include <windows.h> |
| 14 | #include <SDL2/SDL_syswm.h> |
| 15 | #endif |
| 16 | #include <stdint.h> |
| 17 | #include <stdbool.h> |
| 18 | #ifndef _WIN32 |
| 19 | #include <unistd.h> // usleep() |
| 20 | #endif |
| 21 | #include <ctype.h> // tolower() |
| 22 | #include "pt2_helpers.h"cxx . . $ `<file>/src/pt2_helpers.h`/ |
| 23 | #include "pt2_textout.h"cxx . . $ `<file>/src/pt2_textout.h`/ |
| 24 | #include "pt2_tables.h"cxx . . $ `<file>/src/pt2_tables.h`/ |
| 25 | #include "pt2_pattern_viewer.h"cxx . . $ `<file>/src/pt2_pattern_viewer.h`/ |
| 26 | #include "pt2_sampler.h"cxx . . $ `<file>/src/pt2_sampler.h`/ |
| 27 | #include "pt2_diskop.h"cxx . . $ `<file>/src/pt2_diskop.h`/ |
| 28 | #include "pt2_visuals.h"cxx . . $ `<file>/src/pt2_visuals.h`/ |
| 29 | #include "pt2_scopes.h"cxx . . $ `<file>/src/pt2_scopes.h`/ |
| 30 | #include "pt2_edit.h"cxx . . $ `<file>/src/pt2_edit.h`/ |
| 31 | #include "pt2_config.h"cxx . . $ `<file>/src/pt2_config.h`/ |
| 32 | #include "pt2_bmp.h"cxx . . $ `<file>/src/pt2_bmp.h`/ |
| 33 | #include "pt2_sampling.h"cxx . . $ `<file>/src/pt2_sampling.h`/ |
| 34 | #include "pt2_chordmaker.h"cxx . . $ `<file>/src/pt2_chordmaker.h`/ |
| 35 | #include "pt2_mod2wav.h"cxx . . $ `<file>/src/pt2_mod2wav.h`/ |
| 36 | #include "pt2_audio.h"cxx . . $ `<file>/src/pt2_audio.h`/ |
| 37 | #include "pt2_posed.h"cxx . . $ `<file>/src/pt2_posed.h`/ |
| 38 | #include "pt2_textedit.h"cxx . . $ `<file>/src/pt2_textedit.h`/ |
| 39 | |
| 40 | typedef struct sprite_tcxx . . $ sprite_t# |
| 41 | { |
| 42 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! visiblecxx . . $ sprite_t#visible.; |
| 43 | int8_tcxx . . $ int8_t# pixelTypecxx . . $ sprite_t#pixelType.; |
| 44 | int16_tcxx . . $ int16_t# newXcxx . . $ sprite_t#newX., newYcxx . . $ sprite_t#newY., xcxx . . $ sprite_t#x., ycxx . . $ sprite_t#y., wcxx . . $ sprite_t#w., hcxx . . $ sprite_t#h.; |
| 45 | uint32_tcxx . . $ uint32_t# colorKeycxx . . $ sprite_t#colorKey., *refreshBuffercxx . . $ sprite_t#refreshBuffer.; |
| 46 | const void *datacxx . . $ sprite_t#data.; |
| 47 | } sprite_tcxx . . $ sprite_t#; |
| 48 | |
| 49 | // for debug box |
| 50 | #define FPS_SCAN_FRAMEScxx . . $ `src/pt2_visuals.c:50:9`! 60 |
| 51 | static char fpsTextBufcxx . . $ fpsTextBuf.[1024]; |
| 52 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! avgFramesReadycxx . . $ avgFramesReady.; |
| 53 | static uint32_tcxx . . $ uint32_t# videoFrameCountercxx . . $ videoFrameCounter.; |
| 54 | static uint64_tcxx . . $ uint64_t# frameStartTimecxx . . $ frameStartTime., runningFrameDurationcxx . . $ runningFrameDuration.; |
| 55 | static double dFrameDurationDivcxx . . $ dFrameDurationDiv., dAvgFPScxx . . $ dAvgFPS.; |
| 56 | // ------------------ |
| 57 | |
| 58 | static int32_tcxx . . $ int32_t# oldCurrModecxx . . $ oldCurrMode. = -1; |
| 59 | static uint32_tcxx . . $ uint32_t# vuMetersBgcxx . . $ vuMetersBg.[4 * (10 * 48)]; |
| 60 | |
| 61 | sprite_tcxx . . $ sprite_t# spritescxx . . $ sprites.[SPRITE_NUMcxx . . $ SPRITE_NUM.]; // globalized |
| 62 | |
| 63 | static const uint16_tcxx . . $ uint16_t# cursorPosTablecxx . . $ cursorPosTable.[24] = |
| 64 | { |
| 65 | 30, 54, 62, 70, 78, 86, |
| 66 | 102, 126, 134, 142, 150, 158, |
| 67 | 174, 198, 206, 214, 222, 230, |
| 68 | 246, 270, 278, 286, 294, 302 |
| 69 | }; |
| 70 | |
| 71 | void updateSongInfo1cxx . . $ updateSongInfo1(49f6e7a06ebc5aa8).(void); |
| 72 | void updateSongInfo2cxx . . $ updateSongInfo2(49f6e7a06ebc5aa8).(void); |
| 73 | void updateSamplercxx . . $ updateSampler(49f6e7a06ebc5aa8).(void); |
| 74 | void updatePatternDatacxx . . $ updatePatternData(49f6e7a06ebc5aa8).(void); |
| 75 | |
| 76 | void blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, int32_tcxx . . $ int32_t# w, int32_tcxx . . $ int32_t# h, const uint32_tcxx . . $ uint32_t# *src) |
| 77 | { |
| 78 | const uint32_tcxx . . $ uint32_t# *srcPtr = src; |
| 79 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(y * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + x]; |
| 80 | |
| 81 | for (int32_tcxx . . $ int32_t# yy = 0; yy < h; yy++) |
| 82 | { |
| 83 | memcpycxx . . $ memcpy(cc817cb175f282d).(dstPtr, srcPtr, w * sizeof (int32_tcxx . . $ int32_t#)); |
| 84 | |
| 85 | srcPtr += w; |
| 86 | dstPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | void putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, const uint32_tcxx . . $ uint32_t# pixelColor) |
| 91 | { |
| 92 | videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(y * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + x] = pixelColor; |
| 93 | } |
| 94 | |
| 95 | void hLinecxx . . $ hLine(78a5fb7015678ec5).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, int32_tcxx . . $ int32_t# w, const uint32_tcxx . . $ uint32_t# pixelColor) |
| 96 | { |
| 97 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(y * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + x]; |
| 98 | for (int32_tcxx . . $ int32_t# xx = 0; xx < w; xx++) |
| 99 | dstPtr[xx] = pixelColor; |
| 100 | } |
| 101 | |
| 102 | void vLinecxx . . $ vLine(78a5fb7015678ec5).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, int32_tcxx . . $ int32_t# h, const uint32_tcxx . . $ uint32_t# pixelColor) |
| 103 | { |
| 104 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(y * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + x]; |
| 105 | for (int32_tcxx . . $ int32_t# yy = 0; yy < h; yy++) |
| 106 | { |
| 107 | *dstPtr = pixelColor; |
| 108 | dstPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | void drawFramework1cxx . . $ drawFramework1(748afa4755bc9595).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, int32_tcxx . . $ int32_t# w, int32_tcxx . . $ int32_t# h) |
| 113 | { |
| 114 | hLinecxx . . $ hLine(78a5fb7015678ec5).(x, y, w-1, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BORDERcxx . . $ PAL_BORDER.]); |
| 115 | vLinecxx . . $ vLine(78a5fb7015678ec5).(x, y+1, h-2, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BORDERcxx . . $ PAL_BORDER.]); |
| 116 | hLinecxx . . $ hLine(78a5fb7015678ec5).(x+1, y+h-1, w-1, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 117 | vLinecxx . . $ vLine(78a5fb7015678ec5).(x+w-1, y+1, h-2, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 118 | |
| 119 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(x, y+h-1, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 120 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(x+w-1, y, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 121 | |
| 122 | fillRectcxx . . $ fillRect(6fb2c7d311165c4f).(x+1, y+1, w-2, h-2, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 123 | } |
| 124 | |
| 125 | void drawFramework2cxx . . $ drawFramework2(748afa4755bc9595).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, int32_tcxx . . $ int32_t# w, int32_tcxx . . $ int32_t# h) |
| 126 | { |
| 127 | hLinecxx . . $ hLine(78a5fb7015678ec5).(x, y, w-1, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 128 | vLinecxx . . $ vLine(78a5fb7015678ec5).(x, y+1, h-2, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 129 | hLinecxx . . $ hLine(78a5fb7015678ec5).(x+1, y+h-1, w-1, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BORDERcxx . . $ PAL_BORDER.]); |
| 130 | vLinecxx . . $ vLine(78a5fb7015678ec5).(x+w-1, y+1, h-2, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BORDERcxx . . $ PAL_BORDER.]); |
| 131 | |
| 132 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(x, y+h-1, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 133 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(x+w-1, y, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 134 | |
| 135 | fillRectcxx . . $ fillRect(6fb2c7d311165c4f).(x+1, y+1, w-2, h-2, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 136 | } |
| 137 | |
| 138 | void drawFramework3cxx . . $ drawFramework3(748afa4755bc9595).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, int32_tcxx . . $ int32_t# w, int32_tcxx . . $ int32_t# h) |
| 139 | { |
| 140 | fillRectcxx . . $ fillRect(6fb2c7d311165c4f).(x, y, w, h, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 141 | |
| 142 | vLinecxx . . $ vLine(78a5fb7015678ec5).(x, y, h-1, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BORDERcxx . . $ PAL_BORDER.]); |
| 143 | vLinecxx . . $ vLine(78a5fb7015678ec5).(x+1, y, h-2, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BORDERcxx . . $ PAL_BORDER.]); |
| 144 | hLinecxx . . $ hLine(78a5fb7015678ec5).(x+2, y, w-3, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BORDERcxx . . $ PAL_BORDER.]); |
| 145 | hLinecxx . . $ hLine(78a5fb7015678ec5).(x+2, y+1, w-4, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BORDERcxx . . $ PAL_BORDER.]); |
| 146 | hLinecxx . . $ hLine(78a5fb7015678ec5).(x+1, y+h-1, w-1, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 147 | hLinecxx . . $ hLine(78a5fb7015678ec5).(x+2, y+h-2, w-2, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 148 | vLinecxx . . $ vLine(78a5fb7015678ec5).(x+w-2, y+2, h-4, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 149 | vLinecxx . . $ vLine(78a5fb7015678ec5).(x+w-1, y+1, h-3, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 150 | } |
| 151 | |
| 152 | void fillRectcxx . . $ fillRect(6fb2c7d311165c4f).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, int32_tcxx . . $ int32_t# w, int32_tcxx . . $ int32_t# h, const uint32_tcxx . . $ uint32_t# pixelColor) |
| 153 | { |
| 154 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(y * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + x]; |
| 155 | |
| 156 | for (int32_tcxx . . $ int32_t# yy = 0; yy < h; yy++) |
| 157 | { |
| 158 | for (int32_tcxx . . $ int32_t# xx = 0; xx < w; xx++) |
| 159 | dstPtr[xx] = pixelColor; |
| 160 | |
| 161 | dstPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | void drawButton1cxx . . $ drawButton1(8c3222651be003c9).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, int32_tcxx . . $ int32_t# w, int32_tcxx . . $ int32_t# h, const char *text) |
| 166 | { |
| 167 | const int32_tcxx . . $ int32_t# textW = (int32_tcxx . . $ int32_t#)strlencxx . . $ strlen(751346f8406fd082).(text) * (FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`! - 1); |
| 168 | |
| 169 | drawFramework1cxx . . $ drawFramework1(748afa4755bc9595).(x, y, w, h); |
| 170 | |
| 171 | int32_tcxx . . $ int32_t# textX = x + ((w - textW) / 2); |
| 172 | int32_tcxx . . $ int32_t# textY = y + ((h - FONT_CHAR_Hcxx . . $ `src/pt2_header.h:71:9`!) / 2); |
| 173 | |
| 174 | // kludge |
| 175 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(text, ARROW_UP_STRcxx . . $ `src/pt2_textout.h:13:9`!) || !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(text, ARROW_DOWN_STRcxx . . $ `src/pt2_textout.h:14:9`!)) |
| 176 | { |
| 177 | textX--; |
| 178 | textY--; |
| 179 | } |
| 180 | |
| 181 | textOut2cxx . . $ textOut2(be85f8883e7b25d0).(textX, textY, text); |
| 182 | } |
| 183 | |
| 184 | void drawButton2cxx . . $ drawButton2(8c3222651be003c9).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y, int32_tcxx . . $ int32_t# w, int32_tcxx . . $ int32_t# h, const char *text) |
| 185 | { |
| 186 | const int32_tcxx . . $ int32_t# textW = (int32_tcxx . . $ int32_t#)strlencxx . . $ strlen(751346f8406fd082).(text) * (FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`! - 1); |
| 187 | |
| 188 | drawFramework2cxx . . $ drawFramework2(748afa4755bc9595).(x, y, w, h); |
| 189 | |
| 190 | int32_tcxx . . $ int32_t# textX = x + ((w - textW) / 2); |
| 191 | int32_tcxx . . $ int32_t# textY = y + ((h - FONT_CHAR_Hcxx . . $ `src/pt2_header.h:71:9`!) / 2); |
| 192 | |
| 193 | // kludge |
| 194 | if (!strcmpcxx . . $ strcmp(5ae29d726ae57f88).(text, ARROW_UP_STRcxx . . $ `src/pt2_textout.h:13:9`!) || !strcmpcxx . . $ strcmp(5ae29d726ae57f88).(text, ARROW_DOWN_STRcxx . . $ `src/pt2_textout.h:14:9`!)) |
| 195 | { |
| 196 | textX--; |
| 197 | textY--; |
| 198 | } |
| 199 | |
| 200 | textOut2cxx . . $ textOut2(be85f8883e7b25d0).(textX, textY, text); |
| 201 | } |
| 202 | |
| 203 | void drawUpButtoncxx . . $ drawUpButton(3e454b8ccf442868).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y) |
| 204 | { |
| 205 | drawFramework1cxx . . $ drawFramework1(748afa4755bc9595).(x, y, 11, 11); |
| 206 | textOut2cxx . . $ textOut2(be85f8883e7b25d0).(x+1, y+2, ARROW_UP_STRcxx . . $ `src/pt2_textout.h:13:9`!); |
| 207 | } |
| 208 | |
| 209 | void drawDownButtoncxx . . $ drawDownButton(3e454b8ccf442868).(int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y) |
| 210 | { |
| 211 | drawFramework1cxx . . $ drawFramework1(748afa4755bc9595).(x, y, 11, 11); |
| 212 | textOut2cxx . . $ textOut2(be85f8883e7b25d0).(x+1, y+2, ARROW_DOWN_STRcxx . . $ `src/pt2_textout.h:14:9`!); |
| 213 | } |
| 214 | |
| 215 | void statusAllRightcxx . . $ statusAllRight(49f6e7a06ebc5aa8).(void) |
| 216 | { |
| 217 | setStatusMessagecxx . . $ setStatusMessage(90ef5b561fbcb8de).("ALL RIGHT", DO_CARRYcxx . . $ DO_CARRY.); |
| 218 | } |
| 219 | |
| 220 | void statusOutOfMemorycxx . . $ statusOutOfMemory(49f6e7a06ebc5aa8).(void) |
| 221 | { |
| 222 | displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("OUT OF MEMORY !!!"); |
| 223 | } |
| 224 | |
| 225 | void statusSampleIsEmptycxx . . $ statusSampleIsEmpty(49f6e7a06ebc5aa8).(void) |
| 226 | { |
| 227 | displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("SAMPLE IS EMPTY"); |
| 228 | } |
| 229 | |
| 230 | void changeStatusTextcxx . . $ changeStatusText(85c52e162fed56f9).(const char *text) |
| 231 | { |
| 232 | fillRectcxx . . $ fillRect(6fb2c7d311165c4f).(88, 127, 17*FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!, FONT_CHAR_Hcxx . . $ `src/pt2_header.h:71:9`!, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 233 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(88, 127, text, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 234 | } |
| 235 | |
| 236 | void statusNotSampleZerocxx . . $ statusNotSampleZero(49f6e7a06ebc5aa8).(void) |
| 237 | { |
| 238 | /* This rather confusing error message actually means that |
| 239 | ** you can't load a sample to sample slot #0 (which isn't a |
| 240 | ** real sample slot). |
| 241 | */ |
| 242 | displayErrorMsgcxx . . $ displayErrorMsg(85c52e162fed56f9).("NOT SAMPLE 0 !"); |
| 243 | } |
| 244 | |
| 245 | void renderFrame2cxx . . $ renderFrame2(49f6e7a06ebc5aa8).(void) // use this in askBox() |
| 246 | { |
| 247 | updateMod2WavDialogcxx . . $ updateMod2WavDialog(49f6e7a06ebc5aa8).(); // must be first to avoid flickering issues |
| 248 | |
| 249 | updateSongInfo1cxx . . $ updateSongInfo1(49f6e7a06ebc5aa8).(); // top left side of screen, when "disk op"/"pos ed" is hidden |
| 250 | updateSongInfo2cxx . . $ updateSongInfo2(49f6e7a06ebc5aa8).(); // two middle rows of screen, always visible |
| 251 | updatePatternDatacxx . . $ updatePatternData(49f6e7a06ebc5aa8).(); |
| 252 | updateSamplercxx . . $ updateSampler(49f6e7a06ebc5aa8).(); |
| 253 | handleLastGUIObjectDowncxx . . $ handleLastGUIObjectDown(49f6e7a06ebc5aa8).(); |
| 254 | drawSamplerLinecxx . . $ drawSamplerLine(49f6e7a06ebc5aa8).(); |
| 255 | writeSampleMonitorWaveformcxx . . $ writeSampleMonitorWaveform(49f6e7a06ebc5aa8).(); |
| 256 | } |
| 257 | |
| 258 | void renderFramecxx . . $ renderFrame(49f6e7a06ebc5aa8).(void) |
| 259 | { |
| 260 | renderFrame2cxx . . $ renderFrame2(49f6e7a06ebc5aa8).(); |
| 261 | |
| 262 | updateEditOpcxx . . $ updateEditOp(49f6e7a06ebc5aa8).(); |
| 263 | updateDiskOpcxx . . $ updateDiskOp(49f6e7a06ebc5aa8).(); |
| 264 | updatePosEdcxx . . $ updatePosEd(49f6e7a06ebc5aa8).(); |
| 265 | updateVisualizercxx . . $ updateVisualizer(49f6e7a06ebc5aa8).(); |
| 266 | |
| 267 | // show [EDITING] in window title if in edit mode |
| 268 | if (oldCurrModecxx . . $ oldCurrMode. != editorcxx . . $ editor..currModecxx . . $ editor_t#currMode.) |
| 269 | { |
| 270 | oldCurrModecxx . . $ oldCurrMode. = editorcxx . . $ editor..currModecxx . . $ editor_t#currMode.; |
| 271 | if (songcxx . . $ song. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 272 | updateWindowTitlecxx . . $ updateWindowTitle(b45ddcbc8423892c).(songcxx . . $ song.->modifiedcxx . . $ module_t#modified.); |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | void resetAllScreenscxx . . $ resetAllScreens(49f6e7a06ebc5aa8).(void) // prepare GUI for "really quit?" dialog |
| 277 | { |
| 278 | editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 279 | editorcxx . . $ editor..swapChannelFlagcxx . . $ editor_t#swapChannelFlag. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 280 | |
| 281 | uicxx . . $ ui..changingChordNotecxx . . $ ui_t#changingChordNote. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 282 | uicxx . . $ ui..changingSmpResamplecxx . . $ ui_t#changingSmpResample. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 283 | uicxx . . $ ui..changingSamplingNotecxx . . $ ui_t#changingSamplingNote. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 284 | uicxx . . $ ui..changingDrumPadNotecxx . . $ ui_t#changingDrumPadNote. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 285 | |
| 286 | uicxx . . $ ui..disableVisualizercxx . . $ ui_t#disableVisualizer. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 287 | |
| 288 | if (uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 289 | { |
| 290 | if (uicxx . . $ ui..samplingBoxShowncxx . . $ ui_t#samplingBoxShown.) |
| 291 | { |
| 292 | uicxx . . $ ui..samplingBoxShowncxx . . $ ui_t#samplingBoxShown. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 293 | removeSamplingBoxcxx . . $ removeSamplingBox(49f6e7a06ebc5aa8).(); |
| 294 | } |
| 295 | |
| 296 | uicxx . . $ ui..samplerVolBoxShowncxx . . $ ui_t#samplerVolBoxShown. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 297 | uicxx . . $ ui..samplerFiltersBoxShowncxx . . $ ui_t#samplerFiltersBoxShown. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 298 | displaySamplecxx . . $ displaySample(49f6e7a06ebc5aa8).(); // removes volume/filter box |
| 299 | } |
| 300 | |
| 301 | if (uicxx . . $ ui..editTextFlagcxx . . $ ui_t#editTextFlag.) |
| 302 | leaveTextEditModecxx . . $ leaveTextEditMode(b45ddcbc8423892c).(EDIT_TEXT_NO_UPDATEcxx . . $ EDIT_TEXT_NO_UPDATE.); |
| 303 | } |
| 304 | |
| 305 | static void fillFromVuMetersBgBuffercxx . . $ fillFromVuMetersBgBuffer(49f6e7a06ebc5aa8).(void) |
| 306 | { |
| 307 | if (uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown. || editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing. || editorcxx . . $ editor..pat2SmpOngoingcxx . . $ editor_t#pat2SmpOngoing.) |
| 308 | return; |
| 309 | |
| 310 | const uint32_tcxx . . $ uint32_t# *srcPtr = vuMetersBgcxx . . $ vuMetersBg.; |
| 311 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(187 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 55]; |
| 312 | |
| 313 | for (uint32_tcxx . . $ uint32_t# i = 0; i < PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!; i++) |
| 314 | { |
| 315 | for (uint32_tcxx . . $ uint32_t# y = 0; y < 48; y++) |
| 316 | { |
| 317 | for (uint32_tcxx . . $ uint32_t# x = 0; x < 10; x++) |
| 318 | dstPtr[x] = srcPtr[x]; |
| 319 | |
| 320 | srcPtr += 10; |
| 321 | dstPtr -= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 322 | } |
| 323 | |
| 324 | dstPtr += (SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! * 48) + 72; |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | void fillToVuMetersBgBuffercxx . . $ fillToVuMetersBgBuffer(49f6e7a06ebc5aa8).(void) |
| 329 | { |
| 330 | if (uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown. || editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing. || editorcxx . . $ editor..pat2SmpOngoingcxx . . $ editor_t#pat2SmpOngoing.) |
| 331 | return; |
| 332 | |
| 333 | const uint32_tcxx . . $ uint32_t# *srcPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(187 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 55]; |
| 334 | uint32_tcxx . . $ uint32_t# *dstPtr = vuMetersBgcxx . . $ vuMetersBg.; |
| 335 | |
| 336 | for (uint32_tcxx . . $ uint32_t# i = 0; i < PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!; i++) |
| 337 | { |
| 338 | for (uint32_tcxx . . $ uint32_t# y = 0; y < 48; y++) |
| 339 | { |
| 340 | for (uint32_tcxx . . $ uint32_t# x = 0; x < 10; x++) |
| 341 | dstPtr[x] = srcPtr[x]; |
| 342 | |
| 343 | srcPtr -= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 344 | dstPtr += 10; |
| 345 | } |
| 346 | |
| 347 | srcPtr += (SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! * 48) + 72; |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | void renderVuMeterscxx . . $ renderVuMeters(49f6e7a06ebc5aa8).(void) |
| 352 | { |
| 353 | if (uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown. || editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing. || editorcxx . . $ editor..pat2SmpOngoingcxx . . $ editor_t#pat2SmpOngoing.) |
| 354 | return; |
| 355 | |
| 356 | fillToVuMetersBgBuffercxx . . $ fillToVuMetersBgBuffer(49f6e7a06ebc5aa8).(); |
| 357 | |
| 358 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(187 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 55]; |
| 359 | for (uint32_tcxx . . $ uint32_t# i = 0; i < PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!; i++) |
| 360 | { |
| 361 | uint32_tcxx . . $ uint32_t# h; |
| 362 | if (configcxx . . $ config..realVuMeterscxx . . $ config_t#realVuMeters.) |
| 363 | h = editorcxx . . $ editor..realVuMeterVolumescxx . . $ editor_t#realVuMeterVolumes.[i]; |
| 364 | else |
| 365 | h = editorcxx . . $ editor..vuMeterVolumescxx . . $ editor_t#vuMeterVolumes.[i]; |
| 366 | |
| 367 | if (h > 48) |
| 368 | h = 48; |
| 369 | |
| 370 | const uint32_tcxx . . $ uint32_t# *srcPtr = vuMeterBMPcxx . . $ vuMeterBMP.; |
| 371 | for (uint32_tcxx . . $ uint32_t# y = 0; y < h; y++) |
| 372 | { |
| 373 | for (uint32_tcxx . . $ uint32_t# x = 0; x < 10; x++) |
| 374 | dstPtr[x] = srcPtr[x]; |
| 375 | |
| 376 | srcPtr += 10; |
| 377 | dstPtr -= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 378 | } |
| 379 | |
| 380 | dstPtr += (SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! * h) + 72; |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | void updateSongInfo1cxx . . $ updateSongInfo1(49f6e7a06ebc5aa8).(void) // left side of screen, when Disk Op. is hidden |
| 385 | { |
| 386 | if (uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown.) |
| 387 | return; |
| 388 | |
| 389 | moduleSample_tcxx . . $ moduleSample_t# *currSample = &songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.]; |
| 390 | |
| 391 | if (uicxx . . $ ui..updateSongPoscxx . . $ ui_t#updateSongPos.) |
| 392 | { |
| 393 | uicxx . . $ ui..updateSongPoscxx . . $ ui_t#updateSongPos. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 394 | printThreeDecimalsBgcxx . . $ printThreeDecimalsBg(a9b0a938867453dc).(72, 3, *editorcxx . . $ editor..currPosDispcxx . . $ editor_t#currPosDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 395 | } |
| 396 | |
| 397 | if (uicxx . . $ ui..updateSongPatterncxx . . $ ui_t#updateSongPattern.) |
| 398 | { |
| 399 | uicxx . . $ ui..updateSongPatterncxx . . $ ui_t#updateSongPattern. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 400 | printTwoDecimalsBgcxx . . $ printTwoDecimalsBg(a9b0a938867453dc).(80, 14, *editorcxx . . $ editor..currPatternDispcxx . . $ editor_t#currPatternDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 401 | } |
| 402 | |
| 403 | if (uicxx . . $ ui..updateSongLengthcxx . . $ ui_t#updateSongLength.) |
| 404 | { |
| 405 | uicxx . . $ ui..updateSongLengthcxx . . $ ui_t#updateSongLength. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 406 | if (!editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing.) |
| 407 | printThreeDecimalsBgcxx . . $ printThreeDecimalsBg(a9b0a938867453dc).(72, 25, *editorcxx . . $ editor..currLengthDispcxx . . $ editor_t#currLengthDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 408 | } |
| 409 | |
| 410 | if (uicxx . . $ ui..updateCurrSampleFineTunecxx . . $ ui_t#updateCurrSampleFineTune.) |
| 411 | { |
| 412 | uicxx . . $ ui..updateCurrSampleFineTunecxx . . $ ui_t#updateCurrSampleFineTune. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 413 | |
| 414 | if (!editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing.) |
| 415 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(80, 36, ftuneStrTabcxx . . $ ftuneStrTab.[currSample->fineTunecxx . . $ moduleSample_t#fineTune. & 0xF], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 416 | } |
| 417 | |
| 418 | if (uicxx . . $ ui..updateCurrSampleNumcxx . . $ ui_t#updateCurrSampleNum.) |
| 419 | { |
| 420 | uicxx . . $ ui..updateCurrSampleNumcxx . . $ ui_t#updateCurrSampleNum. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 421 | if (!editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing.) |
| 422 | { |
| 423 | printTwoHexBgcxx . . $ printTwoHexBg(a9b0a938867453dc).(80, 47, |
| 424 | editorcxx . . $ editor..sampleZerocxx . . $ editor_t#sampleZero. ? 0 : ((*editorcxx . . $ editor..currSampleDispcxx . . $ editor_t#currSampleDisp.) + 1), videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | if (uicxx . . $ ui..updateCurrSampleVolumecxx . . $ ui_t#updateCurrSampleVolume.) |
| 429 | { |
| 430 | uicxx . . $ ui..updateCurrSampleVolumecxx . . $ ui_t#updateCurrSampleVolume. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 431 | if (!editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing.) |
| 432 | printTwoHexBgcxx . . $ printTwoHexBg(a9b0a938867453dc).(80, 58, *currSample->volumeDispcxx . . $ moduleSample_t#volumeDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 433 | } |
| 434 | |
| 435 | if (uicxx . . $ ui..updateCurrSampleLengthcxx . . $ ui_t#updateCurrSampleLength.) |
| 436 | { |
| 437 | uicxx . . $ ui..updateCurrSampleLengthcxx . . $ ui_t#updateCurrSampleLength. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 438 | if (!editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing.) |
| 439 | { |
| 440 | if (configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. == 0xFFFE) |
| 441 | printFourHexBgcxx . . $ printFourHexBg(a9b0a938867453dc).(64, 69, *currSample->lengthDispcxx . . $ moduleSample_t#lengthDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 442 | else |
| 443 | printFiveHexBgcxx . . $ printFiveHexBg(a9b0a938867453dc).(56, 69, *currSample->lengthDispcxx . . $ moduleSample_t#lengthDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | if (uicxx . . $ ui..updateCurrSampleRepeatcxx . . $ ui_t#updateCurrSampleRepeat.) |
| 448 | { |
| 449 | uicxx . . $ ui..updateCurrSampleRepeatcxx . . $ ui_t#updateCurrSampleRepeat. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 450 | if (configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. == 0xFFFE) |
| 451 | printFourHexBgcxx . . $ printFourHexBg(a9b0a938867453dc).(64, 80, *currSample->loopStartDispcxx . . $ moduleSample_t#loopStartDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 452 | else |
| 453 | printFiveHexBgcxx . . $ printFiveHexBg(a9b0a938867453dc).(56, 80, *currSample->loopStartDispcxx . . $ moduleSample_t#loopStartDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 454 | } |
| 455 | |
| 456 | if (uicxx . . $ ui..updateCurrSampleReplencxx . . $ ui_t#updateCurrSampleReplen.) |
| 457 | { |
| 458 | uicxx . . $ ui..updateCurrSampleReplencxx . . $ ui_t#updateCurrSampleReplen. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 459 | if (configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. == 0xFFFE) |
| 460 | printFourHexBgcxx . . $ printFourHexBg(a9b0a938867453dc).(64, 91, *currSample->loopLengthDispcxx . . $ moduleSample_t#loopLengthDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 461 | else |
| 462 | printFiveHexBgcxx . . $ printFiveHexBg(a9b0a938867453dc).(56, 91, *currSample->loopLengthDispcxx . . $ moduleSample_t#loopLengthDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | void updateSongInfo2cxx . . $ updateSongInfo2(49f6e7a06ebc5aa8).(void) // two middle rows of screen, always present |
| 467 | { |
| 468 | if (uicxx . . $ ui..updateStatusTextcxx . . $ ui_t#updateStatusText.) |
| 469 | { |
| 470 | uicxx . . $ ui..updateStatusTextcxx . . $ ui_t#updateStatusText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 471 | |
| 472 | // clear background |
| 473 | fillRectcxx . . $ fillRect(6fb2c7d311165c4f).(88, 127, 17*FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!, FONT_CHAR_Hcxx . . $ `src/pt2_header.h:71:9`!, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 474 | |
| 475 | // render status text |
| 476 | if (!editorcxx . . $ editor..errorMsgActivecxx . . $ editor_t#errorMsgActive. && editorcxx . . $ editor..blockMarkFlagcxx . . $ editor_t#blockMarkFlag. && !uicxx . . $ ui..askBoxShowncxx . . $ ui_t#askBoxShown. && !editorcxx . . $ editor..swapChannelFlagcxx . . $ editor_t#swapChannelFlag.) |
| 477 | { |
| 478 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(88, 127, "MARK BLOCK", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 479 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(192, 127, '-', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 480 | |
| 481 | editorcxx . . $ editor..blockToPoscxx . . $ editor_t#blockToPos. = songcxx . . $ song.->currRowcxx . . $ module_t#currRow.; |
| 482 | if (editorcxx . . $ editor..blockFromPoscxx . . $ editor_t#blockFromPos. >= editorcxx . . $ editor..blockToPoscxx . . $ editor_t#blockToPos.) |
| 483 | { |
| 484 | printTwoDecimalscxx . . $ printTwoDecimals(eda338842932bf2b).(176, 127, editorcxx . . $ editor..blockToPoscxx . . $ editor_t#blockToPos., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 485 | printTwoDecimalscxx . . $ printTwoDecimals(eda338842932bf2b).(200, 127, editorcxx . . $ editor..blockFromPoscxx . . $ editor_t#blockFromPos., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 486 | } |
| 487 | else |
| 488 | { |
| 489 | printTwoDecimalscxx . . $ printTwoDecimals(eda338842932bf2b).(176, 127, editorcxx . . $ editor..blockFromPoscxx . . $ editor_t#blockFromPos., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 490 | printTwoDecimalscxx . . $ printTwoDecimals(eda338842932bf2b).(200, 127, editorcxx . . $ editor..blockToPoscxx . . $ editor_t#blockToPos., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 491 | } |
| 492 | } |
| 493 | else |
| 494 | { |
| 495 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(88, 127, uicxx . . $ ui..statusMessagecxx . . $ ui_t#statusMessage., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 496 | } |
| 497 | } |
| 498 | |
| 499 | if (uicxx . . $ ui..updateSongBPMcxx . . $ ui_t#updateSongBPM.) |
| 500 | { |
| 501 | uicxx . . $ ui..updateSongBPMcxx . . $ ui_t#updateSongBPM. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 502 | if (!uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 503 | printThreeDecimalsBgcxx . . $ printThreeDecimalsBg(a9b0a938867453dc).(32, 123, songcxx . . $ song.->currBPMcxx . . $ module_t#currBPM., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 504 | } |
| 505 | |
| 506 | if (uicxx . . $ ui..updateCurrPattTextcxx . . $ ui_t#updateCurrPattText.) |
| 507 | { |
| 508 | uicxx . . $ ui..updateCurrPattTextcxx . . $ ui_t#updateCurrPattText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 509 | if (!uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 510 | printTwoDecimalsBgcxx . . $ printTwoDecimalsBg(a9b0a938867453dc).(8, 127, *editorcxx . . $ editor..currEditPatternDispcxx . . $ editor_t#currEditPatternDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 511 | } |
| 512 | |
| 513 | if (uicxx . . $ ui..updateTrackerFlagscxx . . $ ui_t#updateTrackerFlags.) |
| 514 | { |
| 515 | uicxx . . $ ui..updateTrackerFlagscxx . . $ ui_t#updateTrackerFlags. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 516 | |
| 517 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(1, 113, ' ', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 518 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(8, 113, ' ', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 519 | |
| 520 | if (editorcxx . . $ editor..autoInsFlagcxx . . $ editor_t#autoInsFlag.) |
| 521 | { |
| 522 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(0, 113, 'I', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 523 | |
| 524 | // in Amiga PT, "auto insert" 9 means 0 |
| 525 | if (editorcxx . . $ editor..autoInsSlotcxx . . $ editor_t#autoInsSlot. == 9) |
| 526 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(8, 113, '0', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 527 | else |
| 528 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(8, 113, '1' + editorcxx . . $ editor..autoInsSlotcxx . . $ editor_t#autoInsSlot., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 529 | } |
| 530 | |
| 531 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(1, 102, ' ', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 532 | if (editorcxx . . $ editor..metroFlagcxx . . $ editor_t#metroFlag.) |
| 533 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(0, 102, 'M', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 534 | |
| 535 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(16, 102, ' ', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 536 | if (editorcxx . . $ editor..multiFlagcxx . . $ editor_t#multiFlag.) |
| 537 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(16, 102, 'M', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 538 | |
| 539 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(24, 102, '0' + editorcxx . . $ editor..editMoveAddcxx . . $ editor_t#editMoveAdd., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 540 | |
| 541 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(311, 128, ' ', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 542 | if (editorcxx . . $ editor..pNoteFlagcxx . . $ editor_t#pNoteFlag. == 1) |
| 543 | { |
| 544 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(314, 129, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 545 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(315, 129, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 546 | } |
| 547 | else if (editorcxx . . $ editor..pNoteFlagcxx . . $ editor_t#pNoteFlag. == 2) |
| 548 | { |
| 549 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(314, 128, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 550 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(315, 128, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 551 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(314, 130, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 552 | putPixelcxx . . $ putPixel(f59d17f8b9f2d3e1).(315, 130, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | // playback timer |
| 557 | |
| 558 | uint32_tcxx . . $ uint32_t# seconds = editorcxx . . $ editor..playbackSecondscxx . . $ editor_t#playbackSeconds.; |
| 559 | if (seconds <= 5999) // below 100 minutes (99:59 is max for the UI) |
| 560 | { |
| 561 | const uint32_tcxx . . $ uint32_t# MI_TimeM = seconds / 60; |
| 562 | const uint32_tcxx . . $ uint32_t# MI_TimeS = seconds - (MI_TimeM * 60); |
| 563 | |
| 564 | // xx:xx |
| 565 | printTwoDecimalsBgcxx . . $ printTwoDecimalsBg(a9b0a938867453dc).(272, 102, MI_TimeM, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 566 | printTwoDecimalsBgcxx . . $ printTwoDecimalsBg(a9b0a938867453dc).(296, 102, MI_TimeS, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 567 | } |
| 568 | else |
| 569 | { |
| 570 | // 99:59 |
| 571 | printTwoDecimalsBgcxx . . $ printTwoDecimalsBg(a9b0a938867453dc).(272, 102, 99, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 572 | printTwoDecimalsBgcxx . . $ printTwoDecimalsBg(a9b0a938867453dc).(296, 102, 59, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 573 | } |
| 574 | |
| 575 | if (uicxx . . $ ui..updateSongNamecxx . . $ ui_t#updateSongName.) |
| 576 | { |
| 577 | uicxx . . $ ui..updateSongNamecxx . . $ ui_t#updateSongName. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 578 | for (int32_tcxx . . $ int32_t# x = 0; x < 20; x++) |
| 579 | { |
| 580 | char tempChar = songcxx . . $ song.->headercxx . . $ module_t#header..namecxx . . $ moduleHeader_t#name.[x]; |
| 581 | if (tempChar == '\0') |
| 582 | tempChar = '_'; |
| 583 | |
| 584 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(104 + (x * FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!), 102, tempChar, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | if (uicxx . . $ ui..updateCurrSampleNamecxx . . $ ui_t#updateCurrSampleName.) |
| 589 | { |
| 590 | uicxx . . $ ui..updateCurrSampleNamecxx . . $ ui_t#updateCurrSampleName. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 591 | moduleSample_tcxx . . $ moduleSample_t# *currSample = &songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.]; |
| 592 | |
| 593 | for (int32_tcxx . . $ int32_t# x = 0; x < 22; x++) |
| 594 | { |
| 595 | char tempChar = currSample->textcxx . . $ moduleSample_t#text.[x]; |
| 596 | if (tempChar == '\0') |
| 597 | tempChar = '_'; |
| 598 | |
| 599 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(104 + (x * FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!), 113, tempChar, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | if (uicxx . . $ ui..updateSongSizecxx . . $ ui_t#updateSongSize.) |
| 604 | { |
| 605 | uicxx . . $ ui..updateSongSizecxx . . $ ui_t#updateSongSize. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 606 | |
| 607 | // clear background |
| 608 | fillRectcxx . . $ fillRect(6fb2c7d311165c4f).(264, 123, 6*FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!, FONT_CHAR_Hcxx . . $ `src/pt2_header.h:71:9`!, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 609 | |
| 610 | // calculate module length |
| 611 | |
| 612 | uint32_tcxx . . $ uint32_t# totalSampleDataSize = 0; |
| 613 | for (int32_tcxx . . $ int32_t# i = 0; i < MOD_SAMPLEScxx . . $ `src/pt2_header.h:74:9`!; i++) |
| 614 | totalSampleDataSize += songcxx . . $ song.->samplescxx . . $ module_t#samples.[i].lengthcxx . . $ moduleSample_t#length.; |
| 615 | |
| 616 | uint32_tcxx . . $ uint32_t# totalPatterns = 0; |
| 617 | for (int32_tcxx . . $ int32_t# i = 0; i < 128; i++) |
| 618 | { |
| 619 | if (songcxx . . $ song.->headercxx . . $ module_t#header..patternTablecxx . . $ moduleHeader_t#patternTable.[i] > totalPatterns) |
| 620 | totalPatterns = songcxx . . $ song.->headercxx . . $ module_t#header..patternTablecxx . . $ moduleHeader_t#patternTable.[i]; |
| 621 | } |
| 622 | |
| 623 | uint32_tcxx . . $ uint32_t# moduleSize = 2108 + (totalPatterns * 1024) + totalSampleDataSize; |
| 624 | if (moduleSize > 999999) |
| 625 | { |
| 626 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(304, 123, 'K', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 627 | printFourDecimalscxx . . $ printFourDecimals(eda338842932bf2b).(272, 123, moduleSize / 1000, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 628 | } |
| 629 | else |
| 630 | { |
| 631 | printSixDecimalscxx . . $ printSixDecimals(eda338842932bf2b).(264, 123, moduleSize, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | if (uicxx . . $ ui..updateSongTimingcxx . . $ ui_t#updateSongTiming.) |
| 636 | { |
| 637 | uicxx . . $ ui..updateSongTimingcxx . . $ ui_t#updateSongTiming. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 638 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(288, 130, (editorcxx . . $ editor..timingModecxx . . $ editor_t#timingMode. == TEMPO_MODE_CIAcxx . . $ TEMPO_MODE_CIA.) ? "CIA" : "VBL", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 639 | } |
| 640 | } |
| 641 | |
| 642 | void updateCursorPoscxx . . $ updateCursorPos(49f6e7a06ebc5aa8).(void) |
| 643 | { |
| 644 | if (!uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 645 | setSpritePoscxx . . $ setSpritePos(b1146eedae1e1d0b).(SPRITE_PATTERN_CURSORcxx . . $ SPRITE_PATTERN_CURSOR., cursorPosTablecxx . . $ cursorPosTable.[cursorcxx . . $ cursor..poscxx . . $ cursor_t#pos.], 188); |
| 646 | } |
| 647 | |
| 648 | void updateSamplercxx . . $ updateSampler(49f6e7a06ebc5aa8).(void) |
| 649 | { |
| 650 | if (!uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown. || uicxx . . $ ui..samplingBoxShowncxx . . $ ui_t#samplingBoxShown.) |
| 651 | return; |
| 652 | |
| 653 | ASSERTcxx . . $ `src/pt2_header.h:25:9`!(editor.currSample >= 0 && editor.currSample <= 30); |
| 654 | moduleSample_tcxx . . $ moduleSample_t# *s = &songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.]; |
| 655 | |
| 656 | // update 9xx offset |
| 657 | if (mousecxx . . $ mouse..ycxx . . $ mouse_t#y. >= 138 && mousecxx . . $ mouse..ycxx . . $ mouse_t#y. <= 201 && mousecxx . . $ mouse..xcxx . . $ mouse_t#x. >= 3 && mousecxx . . $ mouse..xcxx . . $ mouse_t#x. <= 316) |
| 658 | { |
| 659 | if (!uicxx . . $ ui..samplerVolBoxShowncxx . . $ ui_t#samplerVolBoxShown. && !uicxx . . $ ui..samplerFiltersBoxShowncxx . . $ ui_t#samplerFiltersBoxShown. && s->lengthcxx . . $ moduleSample_t#length. > 0) |
| 660 | { |
| 661 | int32_tcxx . . $ int32_t# tmpSampleOffset = 0x900 + (scr2SmpPoscxx . . $ scr2SmpPos(7864480464b09eea).(mousecxx . . $ mouse..xcxx . . $ mouse_t#x.-3) >> 8); |
| 662 | if (tmpSampleOffset != uicxx . . $ ui..lastSampleOffsetcxx . . $ ui_t#lastSampleOffset.) |
| 663 | { |
| 664 | uicxx . . $ ui..lastSampleOffsetcxx . . $ ui_t#lastSampleOffset. = (uint16_tcxx . . $ uint16_t#)tmpSampleOffset; |
| 665 | uicxx . . $ ui..update9xxPoscxx . . $ ui_t#update9xxPos. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 666 | } |
| 667 | } |
| 668 | } |
| 669 | |
| 670 | // display 9xx offset |
| 671 | if (uicxx . . $ ui..update9xxPoscxx . . $ ui_t#update9xxPos.) |
| 672 | { |
| 673 | uicxx . . $ ui..update9xxPoscxx . . $ ui_t#update9xxPos. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 674 | if (uicxx . . $ ui..lastSampleOffsetcxx . . $ ui_t#lastSampleOffset. <= 0x900 || uicxx . . $ ui..lastSampleOffsetcxx . . $ ui_t#lastSampleOffset. > 0x9FF) |
| 675 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(288, 247, "---", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 676 | else |
| 677 | printThreeHexBgcxx . . $ printThreeHexBg(a9b0a938867453dc).(288, 247, uicxx . . $ ui..lastSampleOffsetcxx . . $ ui_t#lastSampleOffset., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 678 | } |
| 679 | |
| 680 | if (uicxx . . $ ui..updateResampleNotecxx . . $ ui_t#updateResampleNote.) |
| 681 | { |
| 682 | uicxx . . $ ui..updateResampleNotecxx . . $ ui_t#updateResampleNote. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 683 | |
| 684 | // show resample note |
| 685 | if (uicxx . . $ ui..changingSmpResamplecxx . . $ ui_t#changingSmpResample.) |
| 686 | { |
| 687 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(288, 236, "---", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 688 | } |
| 689 | else |
| 690 | { |
| 691 | ASSERTcxx . . $ `src/pt2_header.h:25:9`!(editor.resampleNote < 36); |
| 692 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(288, 236, |
| 693 | configcxx . . $ config..accidentalcxx . . $ config_t#accidental. ? noteNames2cxx . . $ noteNames2.[2+editorcxx . . $ editor..resampleNotecxx . . $ editor_t#resampleNote.] : noteNames1cxx . . $ noteNames1.[2+editorcxx . . $ editor..resampleNotecxx . . $ editor_t#resampleNote.], |
| 694 | videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 695 | } |
| 696 | } |
| 697 | |
| 698 | if (uicxx . . $ ui..samplerVolBoxShowncxx . . $ ui_t#samplerVolBoxShown.) |
| 699 | { |
| 700 | if (uicxx . . $ ui..updateVolFromTextcxx . . $ ui_t#updateVolFromText.) |
| 701 | { |
| 702 | uicxx . . $ ui..updateVolFromTextcxx . . $ ui_t#updateVolFromText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 703 | printThreeDecimalsBgcxx . . $ printThreeDecimalsBg(a9b0a938867453dc).(176, 157, *editorcxx . . $ editor..vol1Dispcxx . . $ editor_t#vol1Disp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 704 | } |
| 705 | |
| 706 | if (uicxx . . $ ui..updateVolToTextcxx . . $ ui_t#updateVolToText.) |
| 707 | { |
| 708 | uicxx . . $ ui..updateVolToTextcxx . . $ ui_t#updateVolToText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 709 | printThreeDecimalsBgcxx . . $ printThreeDecimalsBg(a9b0a938867453dc).(176, 168, *editorcxx . . $ editor..vol2Dispcxx . . $ editor_t#vol2Disp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 710 | } |
| 711 | } |
| 712 | else if (uicxx . . $ ui..samplerFiltersBoxShowncxx . . $ ui_t#samplerFiltersBoxShown.) |
| 713 | { |
| 714 | if (uicxx . . $ ui..updateLPTextcxx . . $ ui_t#updateLPText.) |
| 715 | { |
| 716 | uicxx . . $ ui..updateLPTextcxx . . $ ui_t#updateLPText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 717 | printFourDecimalsBgcxx . . $ printFourDecimalsBg(a9b0a938867453dc).(168, 157, *editorcxx . . $ editor..lpCutOffDispcxx . . $ editor_t#lpCutOffDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 718 | } |
| 719 | |
| 720 | if (uicxx . . $ ui..updateHPTextcxx . . $ ui_t#updateHPText.) |
| 721 | { |
| 722 | uicxx . . $ ui..updateHPTextcxx . . $ ui_t#updateHPText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 723 | printFourDecimalsBgcxx . . $ printFourDecimalsBg(a9b0a938867453dc).(168, 168, *editorcxx . . $ editor..hpCutOffDispcxx . . $ editor_t#hpCutOffDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 724 | } |
| 725 | |
| 726 | if (uicxx . . $ ui..updateNormFlagcxx . . $ ui_t#updateNormFlag.) |
| 727 | { |
| 728 | uicxx . . $ ui..updateNormFlagcxx . . $ ui_t#updateNormFlag. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 729 | |
| 730 | if (editorcxx . . $ editor..normalizeFiltersFlagcxx . . $ editor_t#normalizeFiltersFlag.) |
| 731 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(208, 179, "YES", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 732 | else |
| 733 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(208, 179, "NO ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 734 | } |
| 735 | } |
| 736 | } |
| 737 | |
| 738 | void showVolFromSlidercxx . . $ showVolFromSlider(49f6e7a06ebc5aa8).(void) |
| 739 | { |
| 740 | uint32_tcxx . . $ uint32_t# sliderStart = ((editorcxx . . $ editor..vol1cxx . . $ editor_t#vol1. * 3) + 5) / 10; |
| 741 | uint32_tcxx . . $ uint32_t# sliderEnd = sliderStart + 4; |
| 742 | uint32_tcxx . . $ uint32_t# pixel = videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_QADSCPcxx . . $ PAL_QADSCP.]; |
| 743 | uint32_tcxx . . $ uint32_t# bgPixel = videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BACKGRDcxx . . $ PAL_BACKGRD.]; |
| 744 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(158 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 105]; |
| 745 | |
| 746 | for (uint32_tcxx . . $ uint32_t# y = 0; y < 3; y++) |
| 747 | { |
| 748 | for (uint32_tcxx . . $ uint32_t# x = 0; x < 65; x++) |
| 749 | { |
| 750 | if (x >= sliderStart && x <= sliderEnd) |
| 751 | dstPtr[x] = pixel; |
| 752 | else |
| 753 | dstPtr[x] = bgPixel; |
| 754 | } |
| 755 | |
| 756 | dstPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | void showVolToSlidercxx . . $ showVolToSlider(49f6e7a06ebc5aa8).(void) |
| 761 | { |
| 762 | uint32_tcxx . . $ uint32_t# sliderStart = ((editorcxx . . $ editor..vol2cxx . . $ editor_t#vol2. * 3) + 5) / 10; |
| 763 | uint32_tcxx . . $ uint32_t# sliderEnd = sliderStart + 4; |
| 764 | uint32_tcxx . . $ uint32_t# pixel = videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_QADSCPcxx . . $ PAL_QADSCP.]; |
| 765 | uint32_tcxx . . $ uint32_t# bgPixel = videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_BACKGRDcxx . . $ PAL_BACKGRD.]; |
| 766 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(169 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 105]; |
| 767 | |
| 768 | for (uint32_tcxx . . $ uint32_t# y = 0; y < 3; y++) |
| 769 | { |
| 770 | for (uint32_tcxx . . $ uint32_t# x = 0; x < 65; x++) |
| 771 | { |
| 772 | if (x >= sliderStart && x <= sliderEnd) |
| 773 | dstPtr[x] = pixel; |
| 774 | else |
| 775 | dstPtr[x] = bgPixel; |
| 776 | } |
| 777 | |
| 778 | dstPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 779 | } |
| 780 | } |
| 781 | |
| 782 | void renderSamplerVolBoxcxx . . $ renderSamplerVolBox(49f6e7a06ebc5aa8).(void) |
| 783 | { |
| 784 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(72, 154, 136, 33, samplerVolumeBMPcxx . . $ samplerVolumeBMP.); |
| 785 | |
| 786 | uicxx . . $ ui..updateVolFromTextcxx . . $ ui_t#updateVolFromText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 787 | uicxx . . $ ui..updateVolToTextcxx . . $ ui_t#updateVolToText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 788 | showVolFromSlidercxx . . $ showVolFromSlider(49f6e7a06ebc5aa8).(); |
| 789 | showVolToSlidercxx . . $ showVolToSlider(49f6e7a06ebc5aa8).(); |
| 790 | |
| 791 | // hide loop sprites |
| 792 | hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(SPRITE_LOOP_PIN_LEFTcxx . . $ SPRITE_LOOP_PIN_LEFT.); |
| 793 | hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(SPRITE_LOOP_PIN_RIGHTcxx . . $ SPRITE_LOOP_PIN_RIGHT.); |
| 794 | } |
| 795 | |
| 796 | void removeSamplerVolBoxcxx . . $ removeSamplerVolBox(49f6e7a06ebc5aa8).(void) |
| 797 | { |
| 798 | displaySamplecxx . . $ displaySample(49f6e7a06ebc5aa8).(); |
| 799 | } |
| 800 | |
| 801 | void renderSamplerFiltersBoxcxx . . $ renderSamplerFiltersBox(49f6e7a06ebc5aa8).(void) |
| 802 | { |
| 803 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(65, 154, 186, 33, samplerFiltersBMPcxx . . $ samplerFiltersBMP.); |
| 804 | |
| 805 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(200, 157, "HZ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 806 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(200, 168, "HZ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 807 | |
| 808 | uicxx . . $ ui..updateLPTextcxx . . $ ui_t#updateLPText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 809 | uicxx . . $ ui..updateHPTextcxx . . $ ui_t#updateHPText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 810 | uicxx . . $ ui..updateNormFlagcxx . . $ ui_t#updateNormFlag. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 811 | |
| 812 | // hide loop sprites |
| 813 | hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(SPRITE_LOOP_PIN_LEFTcxx . . $ SPRITE_LOOP_PIN_LEFT.); |
| 814 | hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(SPRITE_LOOP_PIN_RIGHTcxx . . $ SPRITE_LOOP_PIN_RIGHT.); |
| 815 | } |
| 816 | |
| 817 | void removeSamplerFiltersBoxcxx . . $ removeSamplerFiltersBox(49f6e7a06ebc5aa8).(void) |
| 818 | { |
| 819 | displaySamplecxx . . $ displaySample(49f6e7a06ebc5aa8).(); |
| 820 | } |
| 821 | |
| 822 | void renderMuteButtonscxx . . $ renderMuteButtons(49f6e7a06ebc5aa8).(void) |
| 823 | { |
| 824 | if (uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown. || uicxx . . $ ui..posEdScreenShowncxx . . $ ui_t#posEdScreenShown.) |
| 825 | return; |
| 826 | |
| 827 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(3 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 310]; |
| 828 | for (uint32_tcxx . . $ uint32_t# i = 0; i < PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!; i++) |
| 829 | { |
| 830 | const uint32_tcxx . . $ uint32_t# *srcPtr; |
| 831 | uint32_tcxx . . $ uint32_t# srcPitch; |
| 832 | |
| 833 | if (editorcxx . . $ editor..mutedcxx . . $ editor_t#muted.[i]) |
| 834 | { |
| 835 | srcPtr = &muteButtonsBMPcxx . . $ muteButtonsBMP.[i * (6 * 7)]; |
| 836 | srcPitch = 7; |
| 837 | } |
| 838 | else |
| 839 | { |
| 840 | srcPtr = &trackerFrameBMPcxx . . $ trackerFrameBMP.[((3 + (i * 11)) * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 310]; |
| 841 | srcPitch = SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 842 | } |
| 843 | |
| 844 | for (uint32_tcxx . . $ uint32_t# y = 0; y < 6; y++) |
| 845 | { |
| 846 | for (uint32_tcxx . . $ uint32_t# x = 0; x < 7; x++) |
| 847 | dstPtr[x] = srcPtr[x]; |
| 848 | |
| 849 | srcPtr += srcPitch; |
| 850 | dstPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 851 | } |
| 852 | |
| 853 | dstPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! * 5; |
| 854 | } |
| 855 | } |
| 856 | |
| 857 | void updateCurrSamplecxx . . $ updateCurrSample(49f6e7a06ebc5aa8).(void) |
| 858 | { |
| 859 | uicxx . . $ ui..updateCurrSampleNamecxx . . $ ui_t#updateCurrSampleName. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 860 | uicxx . . $ ui..updateSongSizecxx . . $ ui_t#updateSongSize. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 861 | |
| 862 | if (!uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown.) |
| 863 | { |
| 864 | uicxx . . $ ui..updateCurrSampleFineTunecxx . . $ ui_t#updateCurrSampleFineTune. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 865 | uicxx . . $ ui..updateCurrSampleNumcxx . . $ ui_t#updateCurrSampleNum. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 866 | uicxx . . $ ui..updateCurrSampleVolumecxx . . $ ui_t#updateCurrSampleVolume. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 867 | uicxx . . $ ui..updateCurrSampleLengthcxx . . $ ui_t#updateCurrSampleLength. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 868 | uicxx . . $ ui..updateCurrSampleRepeatcxx . . $ ui_t#updateCurrSampleRepeat. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 869 | uicxx . . $ ui..updateCurrSampleReplencxx . . $ ui_t#updateCurrSampleReplen. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 870 | } |
| 871 | |
| 872 | if (uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 873 | redrawSamplecxx . . $ redrawSample(49f6e7a06ebc5aa8).(); |
| 874 | |
| 875 | updateSamplePoscxx . . $ updateSamplePos(49f6e7a06ebc5aa8).(); |
| 876 | recalcChordLengthcxx . . $ recalcChordLength(49f6e7a06ebc5aa8).(); |
| 877 | |
| 878 | samplercxx . . $ sampler..tmpLoopStartcxx . . $ sampler_t#tmpLoopStart. = 0; |
| 879 | samplercxx . . $ sampler..tmpLoopLengthcxx . . $ sampler_t#tmpLoopLength. = 0; |
| 880 | } |
| 881 | |
| 882 | void updatePatternDatacxx . . $ updatePatternData(49f6e7a06ebc5aa8).(void) |
| 883 | { |
| 884 | if (uicxx . . $ ui..updatePatternDatacxx . . $ ui_t#updatePatternData.) |
| 885 | { |
| 886 | uicxx . . $ ui..updatePatternDatacxx . . $ ui_t#updatePatternData. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 887 | if (!uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 888 | redrawPatterncxx . . $ redrawPattern(49f6e7a06ebc5aa8).(); |
| 889 | } |
| 890 | } |
| 891 | |
| 892 | static void sendMouseButtonUpEventcxx . . $ sendMouseButtonUpEvent(ac50b47256ae7414).(uint8_tcxx . . $ uint8_t# button) |
| 893 | { |
| 894 | SDL_Eventcxx . . $ SDL_Event# event; |
| 895 | |
| 896 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(&event, 0, sizeof (event)); |
| 897 | |
| 898 | event.typecxx . . $ SDL_Event#type. = SDL_MOUSEBUTTONUPcxx . . $ SDL_MOUSEBUTTONUP.; |
| 899 | event.buttoncxx . . $ SDL_Event#button..buttoncxx . . $ SDL_MouseButtonEvent#button. = button; |
| 900 | |
| 901 | SDL_PushEventcxx . . $ SDL_PushEvent(c228975526fb3e93).(&event); |
| 902 | } |
| 903 | |
| 904 | void handleLastGUIObjectDowncxx . . $ handleLastGUIObjectDown(49f6e7a06ebc5aa8).(void) |
| 905 | { |
| 906 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! testMouseButtonRelease = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 907 | |
| 908 | if (uicxx . . $ ui..sampleMarkingPoscxx . . $ ui_t#sampleMarkingPos. >= 0) |
| 909 | { |
| 910 | samplerSamplePressedcxx . . $ samplerSamplePressed(b45ddcbc8423892c).(MOUSE_BUTTON_HELDcxx . . $ MOUSE_BUTTON_HELD.); |
| 911 | testMouseButtonRelease = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 912 | } |
| 913 | |
| 914 | if (uicxx . . $ ui..forceSampleDragcxx . . $ ui_t#forceSampleDrag.) |
| 915 | { |
| 916 | samplerBarPressedcxx . . $ samplerBarPressed(b45ddcbc8423892c).(MOUSE_BUTTON_HELDcxx . . $ MOUSE_BUTTON_HELD.); |
| 917 | testMouseButtonRelease = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 918 | } |
| 919 | |
| 920 | if (uicxx . . $ ui..forceSampleEditcxx . . $ ui_t#forceSampleEdit.) |
| 921 | { |
| 922 | samplerEditSamplecxx . . $ samplerEditSample(b45ddcbc8423892c).(MOUSE_BUTTON_HELDcxx . . $ MOUSE_BUTTON_HELD.); |
| 923 | testMouseButtonRelease = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 924 | } |
| 925 | |
| 926 | if (uicxx . . $ ui..forceVolDragcxx . . $ ui_t#forceVolDrag.) |
| 927 | { |
| 928 | volBoxBarPressedcxx . . $ volBoxBarPressed(b45ddcbc8423892c).(MOUSE_BUTTON_HELDcxx . . $ MOUSE_BUTTON_HELD.); |
| 929 | testMouseButtonRelease = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 930 | } |
| 931 | |
| 932 | /* Hack to send "mouse button up" events if we released the mouse button(s) |
| 933 | ** outside of the window... |
| 934 | */ |
| 935 | if (testMouseButtonRelease) |
| 936 | { |
| 937 | if (mousecxx . . $ mouse..xcxx . . $ mouse_t#x. < 0 || mousecxx . . $ mouse..xcxx . . $ mouse_t#x. >= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! || mousecxx . . $ mouse..ycxx . . $ mouse_t#y. < 0 || mousecxx . . $ mouse..ycxx . . $ mouse_t#y. >= SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!) |
| 938 | { |
| 939 | if (mousecxx . . $ mouse..leftButtonPressedcxx . . $ mouse_t#leftButtonPressed. && !(mousecxx . . $ mouse..buttonStatecxx . . $ mouse_t#buttonState. & SDL_BUTTON_LMASKcxx . . $ `<external>/13849749812924280863/SDL_mouse.h:450:9`!)) |
| 940 | sendMouseButtonUpEventcxx . . $ sendMouseButtonUpEvent(ac50b47256ae7414).(SDL_BUTTON_LEFTcxx . . $ `<external>/13849749812924280863/SDL_mouse.h:445:9`!); |
| 941 | |
| 942 | if (mousecxx . . $ mouse..rightButtonPressedcxx . . $ mouse_t#rightButtonPressed. && !(mousecxx . . $ mouse..buttonStatecxx . . $ mouse_t#buttonState. & SDL_BUTTON_RMASKcxx . . $ `<external>/13849749812924280863/SDL_mouse.h:452:9`!)) |
| 943 | sendMouseButtonUpEventcxx . . $ sendMouseButtonUpEvent(ac50b47256ae7414).(SDL_BUTTON_RIGHTcxx . . $ `<external>/13849749812924280863/SDL_mouse.h:447:9`!); |
| 944 | } |
| 945 | } |
| 946 | } |
| 947 | |
| 948 | void updateVisualizercxx . . $ updateVisualizer(49f6e7a06ebc5aa8).(void) |
| 949 | { |
| 950 | if (uicxx . . $ ui..disableVisualizercxx . . $ ui_t#disableVisualizer. || uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown. || |
| 951 | uicxx . . $ ui..posEdScreenShowncxx . . $ ui_t#posEdScreenShown. || uicxx . . $ ui..editOpScreenShowncxx . . $ ui_t#editOpScreenShown. || |
| 952 | uicxx . . $ ui..aboutScreenShowncxx . . $ ui_t#aboutScreenShown. || uicxx . . $ ui..askBoxShowncxx . . $ ui_t#askBoxShown. || |
| 953 | editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing. || uicxx . . $ ui..samplingBoxShowncxx . . $ ui_t#samplingBoxShown.) |
| 954 | { |
| 955 | return; |
| 956 | } |
| 957 | |
| 958 | if (uicxx . . $ ui..visualizerModecxx . . $ ui_t#visualizerMode. == VISUAL_SPECTRUMcxx . . $ VISUAL_SPECTRUM.) |
| 959 | { |
| 960 | // spectrum analyzer |
| 961 | |
| 962 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(59 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 129]; |
| 963 | for (uint32_tcxx . . $ uint32_t# i = 0; i < SPECTRUM_BAR_NUMcxx . . $ `src/pt2_header.h:79:9`!; i++) |
| 964 | { |
| 965 | const uint32_tcxx . . $ uint32_t# *srcPtr = analyzerColorsRGB24cxx . . $ analyzerColorsRGB24.; |
| 966 | uint32_tcxx . . $ uint32_t# pixel = videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]; |
| 967 | |
| 968 | int32_tcxx . . $ int32_t# tmpVol = editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[i]; |
| 969 | if (tmpVol > SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!) |
| 970 | tmpVol = SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!; |
| 971 | |
| 972 | for (int32_tcxx . . $ int32_t# y = SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!-1; y >= 0; y--) |
| 973 | { |
| 974 | if (y < tmpVol) |
| 975 | pixel = srcPtr[y]; |
| 976 | |
| 977 | for (uint32_tcxx . . $ uint32_t# x = 0; x < SPECTRUM_BAR_WIDTHcxx . . $ `src/pt2_header.h:81:9`!; x++) |
| 978 | dstPtr[x] = pixel; |
| 979 | |
| 980 | dstPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 981 | } |
| 982 | |
| 983 | dstPtr -= (SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! * SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!) - (SPECTRUM_BAR_WIDTHcxx . . $ `src/pt2_header.h:81:9`! + 2); |
| 984 | } |
| 985 | } |
| 986 | else |
| 987 | { |
| 988 | drawScopescxx . . $ drawScopes(49f6e7a06ebc5aa8).(); |
| 989 | } |
| 990 | } |
| 991 | |
| 992 | void renderQuadrascopeBgcxx . . $ renderQuadrascopeBg(49f6e7a06ebc5aa8).(void) |
| 993 | { |
| 994 | const uint32_tcxx . . $ uint32_t# *srcPtr = &trackerFrameBMPcxx . . $ trackerFrameBMP.[(44 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 120]; |
| 995 | uint32_tcxx . . $ uint32_t# *dstPtr = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(44 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + 120]; |
| 996 | |
| 997 | for (uint32_tcxx . . $ uint32_t# y = 0; y < 55; y++) |
| 998 | { |
| 999 | memcpycxx . . $ memcpy(cc817cb175f282d).(dstPtr, srcPtr, 200 * sizeof (int32_tcxx . . $ int32_t#)); |
| 1000 | |
| 1001 | srcPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 1002 | dstPtr += SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 | void renderSpectrumAnalyzerBgcxx . . $ renderSpectrumAnalyzerBg(49f6e7a06ebc5aa8).(void) |
| 1007 | { |
| 1008 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(120, 44, 200, 55, spectrumVisualsBMPcxx . . $ spectrumVisualsBMP.); |
| 1009 | } |
| 1010 | |
| 1011 | void renderAboutScreencxx . . $ renderAboutScreen(49f6e7a06ebc5aa8).(void) |
| 1012 | { |
| 1013 | char verString[16]; |
| 1014 | |
| 1015 | if (!uicxx . . $ ui..aboutScreenShowncxx . . $ ui_t#aboutScreenShown. || uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown. || uicxx . . $ ui..posEdScreenShowncxx . . $ ui_t#posEdScreenShown. || uicxx . . $ ui..editOpScreenShowncxx . . $ ui_t#editOpScreenShown.) |
| 1016 | return; |
| 1017 | |
| 1018 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(120, 44, 200, 55, aboutScreenBMPcxx . . $ aboutScreenBMP.); |
| 1019 | |
| 1020 | // draw version string |
| 1021 | |
| 1022 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(verString, "v%s", PROG_VER_STRcxx . . $ `src/pt2_header.h:19:9`!); |
| 1023 | uint32_tcxx . . $ uint32_t# verStringX = 260 + (((63 - ((uint32_tcxx . . $ uint32_t#)strlencxx . . $ strlen(751346f8406fd082).(verString) * (FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`! - 1))) + 1) / 2); |
| 1024 | textOutTightcxx . . $ textOutTight(ecc378a7b29cfb5a).(verStringX, 67, verString, videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKG2cxx . . $ PAL_GENBKG2.]); |
| 1025 | } |
| 1026 | |
| 1027 | void renderEditOpModecxx . . $ renderEditOpMode(49f6e7a06ebc5aa8).(void) |
| 1028 | { |
| 1029 | const uint32_tcxx . . $ uint32_t# *srcPtr; |
| 1030 | |
| 1031 | // select what character box to render |
| 1032 | switch (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen.) |
| 1033 | { |
| 1034 | default: |
| 1035 | case 0: |
| 1036 | srcPtr = &editOpModeCharsBMPcxx . . $ editOpModeCharsBMP.[editorcxx . . $ editor..sampleAllFlagcxx . . $ editor_t#sampleAllFlag. ? EDOP_MODE_BMP_A_OFScxx . . $ `src/pt2_bmp.h:6:9`! : EDOP_MODE_BMP_S_OFScxx . . $ `src/pt2_bmp.h:12:9`!]; |
| 1037 | break; |
| 1038 | |
| 1039 | case 1: |
| 1040 | { |
| 1041 | if (editorcxx . . $ editor..trackPattFlagcxx . . $ editor_t#trackPattFlag. == 0) |
| 1042 | srcPtr = &editOpModeCharsBMPcxx . . $ editOpModeCharsBMP.[EDOP_MODE_BMP_T_OFScxx . . $ `src/pt2_bmp.h:13:9`!]; |
| 1043 | else if (editorcxx . . $ editor..trackPattFlagcxx . . $ editor_t#trackPattFlag. == 1) |
| 1044 | srcPtr = &editOpModeCharsBMPcxx . . $ editOpModeCharsBMP.[EDOP_MODE_BMP_P_OFScxx . . $ `src/pt2_bmp.h:11:9`!]; |
| 1045 | else |
| 1046 | srcPtr = &editOpModeCharsBMPcxx . . $ editOpModeCharsBMP.[EDOP_MODE_BMP_S_OFScxx . . $ `src/pt2_bmp.h:12:9`!]; |
| 1047 | } |
| 1048 | break; |
| 1049 | |
| 1050 | case 2: |
| 1051 | srcPtr = &editOpModeCharsBMPcxx . . $ editOpModeCharsBMP.[editorcxx . . $ editor..halveSampleFlagcxx . . $ editor_t#halveSampleFlag. ? EDOP_MODE_BMP_H_OFScxx . . $ `src/pt2_bmp.h:8:9`! : EDOP_MODE_BMP_C_OFScxx . . $ `src/pt2_bmp.h:7:9`!]; |
| 1052 | break; |
| 1053 | |
| 1054 | case 3: |
| 1055 | srcPtr = (editorcxx . . $ editor..newOldFlagcxx . . $ editor_t#newOldFlag. == 0) ? &editOpModeCharsBMPcxx . . $ editOpModeCharsBMP.[EDOP_MODE_BMP_N_OFScxx . . $ `src/pt2_bmp.h:9:9`!] : &editOpModeCharsBMPcxx . . $ editOpModeCharsBMP.[EDOP_MODE_BMP_O_OFScxx . . $ `src/pt2_bmp.h:10:9`!]; |
| 1056 | break; |
| 1057 | } |
| 1058 | |
| 1059 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(310, 47, 7, 6, srcPtr); |
| 1060 | } |
| 1061 | |
| 1062 | void renderEditOpScreencxx . . $ renderEditOpScreen(49f6e7a06ebc5aa8).(void) |
| 1063 | { |
| 1064 | const uint32_tcxx . . $ uint32_t# *srcPtr; |
| 1065 | |
| 1066 | // select which graphics to render |
| 1067 | switch (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen.) |
| 1068 | { |
| 1069 | default: |
| 1070 | case 0: srcPtr = editOpScreen1BMPcxx . . $ editOpScreen1BMP.; break; |
| 1071 | case 1: srcPtr = editOpScreen2BMPcxx . . $ editOpScreen2BMP.; break; |
| 1072 | case 2: srcPtr = editOpScreen3BMPcxx . . $ editOpScreen3BMP.; break; |
| 1073 | case 3: srcPtr = editOpScreen4BMPcxx . . $ editOpScreen4BMP.; break; |
| 1074 | } |
| 1075 | |
| 1076 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(120, 44, 200, 55, srcPtr); |
| 1077 | |
| 1078 | // fix graphics in 128K sample mode |
| 1079 | if (configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. != 65534) |
| 1080 | { |
| 1081 | if (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 2) |
| 1082 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(213, 55, 32, 11, fix128KPosBMPcxx . . $ fix128KPosBMP.); |
| 1083 | else if (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 3) |
| 1084 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(120, 88, 48, 11, fix128KChordBMPcxx . . $ fix128KChordBMP.); |
| 1085 | } |
| 1086 | |
| 1087 | renderEditOpModecxx . . $ renderEditOpMode(49f6e7a06ebc5aa8).(); |
| 1088 | |
| 1089 | // render text and content |
| 1090 | if (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 0) |
| 1091 | { |
| 1092 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(128, 47, " TRACK PATTERN ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1093 | } |
| 1094 | else if (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 1) |
| 1095 | { |
| 1096 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(128, 47, " RECORD SAMPLES ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1097 | |
| 1098 | uicxx . . $ ui..updateRecordTextcxx . . $ ui_t#updateRecordText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1099 | uicxx . . $ ui..updateQuantizeTextcxx . . $ ui_t#updateQuantizeText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1100 | uicxx . . $ ui..updateMetro1Textcxx . . $ ui_t#updateMetro1Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1101 | uicxx . . $ ui..updateMetro2Textcxx . . $ ui_t#updateMetro2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1102 | uicxx . . $ ui..updateFromTextcxx . . $ ui_t#updateFromText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1103 | uicxx . . $ ui..updateKeysTextcxx . . $ ui_t#updateKeysText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1104 | uicxx . . $ ui..updateToTextcxx . . $ ui_t#updateToText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1105 | } |
| 1106 | else if (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 2) |
| 1107 | { |
| 1108 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(128, 47, " SAMPLE EDITOR ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1109 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(272, 91, '%', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); // for Volume text |
| 1110 | |
| 1111 | uicxx . . $ ui..updatePosTextcxx . . $ ui_t#updatePosText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1112 | uicxx . . $ ui..updateModTextcxx . . $ ui_t#updateModText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1113 | uicxx . . $ ui..updateVolTextcxx . . $ ui_t#updateVolText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1114 | } |
| 1115 | else if (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 3) |
| 1116 | { |
| 1117 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(128, 47, " SAMPLE CHORD EDITOR ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1118 | |
| 1119 | uicxx . . $ ui..updateChordLengthTextcxx . . $ ui_t#updateChordLengthText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1120 | uicxx . . $ ui..updateChordNote1Textcxx . . $ ui_t#updateChordNote1Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1121 | uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1122 | uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1123 | uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1124 | } |
| 1125 | } |
| 1126 | |
| 1127 | void updateEditOpcxx . . $ updateEditOp(49f6e7a06ebc5aa8).(void) |
| 1128 | { |
| 1129 | if (!uicxx . . $ ui..editOpScreenShowncxx . . $ ui_t#editOpScreenShown. || uicxx . . $ ui..posEdScreenShowncxx . . $ ui_t#posEdScreenShown. || uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown.) |
| 1130 | return; |
| 1131 | |
| 1132 | if (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 1) |
| 1133 | { |
| 1134 | if (uicxx . . $ ui..updateRecordTextcxx . . $ ui_t#updateRecordText.) |
| 1135 | { |
| 1136 | uicxx . . $ ui..updateRecordTextcxx . . $ ui_t#updateRecordText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1137 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(176, 58, (editorcxx . . $ editor..recordModecxx . . $ editor_t#recordMode. == RECORD_PATTcxx . . $ RECORD_PATT.) ? "PATT" : "SONG", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1138 | } |
| 1139 | |
| 1140 | if (uicxx . . $ ui..updateQuantizeTextcxx . . $ ui_t#updateQuantizeText.) |
| 1141 | { |
| 1142 | uicxx . . $ ui..updateQuantizeTextcxx . . $ ui_t#updateQuantizeText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1143 | printTwoDecimalsBgcxx . . $ printTwoDecimalsBg(a9b0a938867453dc).(192, 69, *editorcxx . . $ editor..quantizeValueDispcxx . . $ editor_t#quantizeValueDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1144 | } |
| 1145 | |
| 1146 | if (uicxx . . $ ui..updateMetro1Textcxx . . $ ui_t#updateMetro1Text.) |
| 1147 | { |
| 1148 | uicxx . . $ ui..updateMetro1Textcxx . . $ ui_t#updateMetro1Text. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1149 | printTwoDecimalsBgcxx . . $ printTwoDecimalsBg(a9b0a938867453dc).(168, 80, *editorcxx . . $ editor..metroSpeedDispcxx . . $ editor_t#metroSpeedDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1150 | } |
| 1151 | |
| 1152 | if (uicxx . . $ ui..updateMetro2Textcxx . . $ ui_t#updateMetro2Text.) |
| 1153 | { |
| 1154 | uicxx . . $ ui..updateMetro2Textcxx . . $ ui_t#updateMetro2Text. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1155 | printTwoDecimalsBgcxx . . $ printTwoDecimalsBg(a9b0a938867453dc).(192, 80, *editorcxx . . $ editor..metroChannelDispcxx . . $ editor_t#metroChannelDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1156 | } |
| 1157 | |
| 1158 | if (uicxx . . $ ui..updateFromTextcxx . . $ ui_t#updateFromText.) |
| 1159 | { |
| 1160 | uicxx . . $ ui..updateFromTextcxx . . $ ui_t#updateFromText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1161 | printTwoHexBgcxx . . $ printTwoHexBg(a9b0a938867453dc).(264, 80, *editorcxx . . $ editor..sampleFromDispcxx . . $ editor_t#sampleFromDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1162 | } |
| 1163 | |
| 1164 | if (uicxx . . $ ui..updateKeysTextcxx . . $ ui_t#updateKeysText.) |
| 1165 | { |
| 1166 | uicxx . . $ ui..updateKeysTextcxx . . $ ui_t#updateKeysText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1167 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(160, 91, editorcxx . . $ editor..multiFlagcxx . . $ editor_t#multiFlag. ? "MULTI " : "SINGLE", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1168 | } |
| 1169 | |
| 1170 | if (uicxx . . $ ui..updateToTextcxx . . $ ui_t#updateToText.) |
| 1171 | { |
| 1172 | uicxx . . $ ui..updateToTextcxx . . $ ui_t#updateToText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1173 | printTwoHexBgcxx . . $ printTwoHexBg(a9b0a938867453dc).(264, 91, *editorcxx . . $ editor..sampleToDispcxx . . $ editor_t#sampleToDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1174 | } |
| 1175 | } |
| 1176 | else if (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 2) |
| 1177 | { |
| 1178 | if (uicxx . . $ ui..updateMixTextcxx . . $ ui_t#updateMixText.) |
| 1179 | { |
| 1180 | uicxx . . $ ui..updateMixTextcxx . . $ ui_t#updateMixText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1181 | if (editorcxx . . $ editor..mixFlagcxx . . $ editor_t#mixFlag.) |
| 1182 | { |
| 1183 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(128, 47, editorcxx . . $ editor..mixTextcxx . . $ editor_t#mixText., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1184 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(248, 47, " ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1185 | } |
| 1186 | else |
| 1187 | { |
| 1188 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(128, 47, " SAMPLE EDITOR ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1189 | } |
| 1190 | } |
| 1191 | |
| 1192 | if (uicxx . . $ ui..updatePosTextcxx . . $ ui_t#updatePosText.) |
| 1193 | { |
| 1194 | uicxx . . $ ui..updatePosTextcxx . . $ ui_t#updatePosText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1195 | if (configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. == 0xFFFE) |
| 1196 | printFourHexBgcxx . . $ printFourHexBg(a9b0a938867453dc).(248, 58, *editorcxx . . $ editor..samplePosDispcxx . . $ editor_t#samplePosDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1197 | else |
| 1198 | printFiveHexBgcxx . . $ printFiveHexBg(a9b0a938867453dc).(240, 58, *editorcxx . . $ editor..samplePosDispcxx . . $ editor_t#samplePosDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1199 | } |
| 1200 | |
| 1201 | if (uicxx . . $ ui..updateModTextcxx . . $ ui_t#updateModText.) |
| 1202 | { |
| 1203 | uicxx . . $ ui..updateModTextcxx . . $ ui_t#updateModText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1204 | printThreeDecimalsBgcxx . . $ printThreeDecimalsBg(a9b0a938867453dc).(256, 69, |
| 1205 | (editorcxx . . $ editor..modulateSpeedcxx . . $ editor_t#modulateSpeed. < 0) ? (0 - editorcxx . . $ editor..modulateSpeedcxx . . $ editor_t#modulateSpeed.) : editorcxx . . $ editor..modulateSpeedcxx . . $ editor_t#modulateSpeed., |
| 1206 | videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1207 | |
| 1208 | if (editorcxx . . $ editor..modulateSpeedcxx . . $ editor_t#modulateSpeed. < 0) |
| 1209 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(248, 69, '-', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1210 | else |
| 1211 | charOutBgcxx . . $ charOutBg(585309c1ae331a9b).(248, 69, ' ', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1212 | } |
| 1213 | |
| 1214 | if (uicxx . . $ ui..updateVolTextcxx . . $ ui_t#updateVolText.) |
| 1215 | { |
| 1216 | uicxx . . $ ui..updateVolTextcxx . . $ ui_t#updateVolText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1217 | printThreeDecimalsBgcxx . . $ printThreeDecimalsBg(a9b0a938867453dc).(248, 91, *editorcxx . . $ editor..sampleVolDispcxx . . $ editor_t#sampleVolDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1218 | } |
| 1219 | } |
| 1220 | else if (uicxx . . $ ui..editOpScreencxx . . $ ui_t#editOpScreen. == 3) |
| 1221 | { |
| 1222 | if (uicxx . . $ ui..updateChordLengthTextcxx . . $ ui_t#updateChordLengthText.) |
| 1223 | { |
| 1224 | uicxx . . $ ui..updateChordLengthTextcxx . . $ ui_t#updateChordLengthText. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1225 | |
| 1226 | // clear background |
| 1227 | if (configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. != 65534) |
| 1228 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(160, 91, " ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1229 | else |
| 1230 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(168, 91, " ", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1231 | |
| 1232 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(198, 91, ':', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1233 | |
| 1234 | if (songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.].loopLengthcxx . . $ moduleSample_t#loopLength. > 2 || songcxx . . $ song.->samplescxx . . $ module_t#samples.[editorcxx . . $ editor..currSamplecxx . . $ editor_t#currSample.].loopStartcxx . . $ moduleSample_t#loopStart. >= 2) |
| 1235 | { |
| 1236 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(168, 91, "LOOP", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1237 | } |
| 1238 | else |
| 1239 | { |
| 1240 | if (configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. == 0xFFFE) |
| 1241 | printFourHexcxx . . $ printFourHex(eda338842932bf2b).(168, 91, *editorcxx . . $ editor..chordLengthDispcxx . . $ editor_t#chordLengthDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); // chord max length |
| 1242 | else |
| 1243 | printFiveHexcxx . . $ printFiveHex(eda338842932bf2b).(160, 91, *editorcxx . . $ editor..chordLengthDispcxx . . $ editor_t#chordLengthDisp., videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); // chord max length |
| 1244 | |
| 1245 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(198, 91, (editorcxx . . $ editor..chordLengthMincxx . . $ editor_t#chordLengthMin.) ? '.' : ':', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); // min/max flag |
| 1246 | } |
| 1247 | } |
| 1248 | |
| 1249 | if (uicxx . . $ ui..updateChordNote1Textcxx . . $ ui_t#updateChordNote1Text.) |
| 1250 | { |
| 1251 | uicxx . . $ ui..updateChordNote1Textcxx . . $ ui_t#updateChordNote1Text. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1252 | if (editorcxx . . $ editor..note1cxx . . $ editor_t#note1. > 35) |
| 1253 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(256, 58, "---", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1254 | else |
| 1255 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(256, 58, configcxx . . $ config..accidentalcxx . . $ config_t#accidental. ? noteNames2cxx . . $ noteNames2.[2+editorcxx . . $ editor..note1cxx . . $ editor_t#note1.] : noteNames1cxx . . $ noteNames1.[2+editorcxx . . $ editor..note1cxx . . $ editor_t#note1.], |
| 1256 | videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1257 | } |
| 1258 | |
| 1259 | if (uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text.) |
| 1260 | { |
| 1261 | uicxx . . $ ui..updateChordNote2Textcxx . . $ ui_t#updateChordNote2Text. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1262 | if (editorcxx . . $ editor..note2cxx . . $ editor_t#note2. > 35) |
| 1263 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(256, 69, "---", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1264 | else |
| 1265 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(256, 69, configcxx . . $ config..accidentalcxx . . $ config_t#accidental. ? noteNames2cxx . . $ noteNames2.[2+editorcxx . . $ editor..note2cxx . . $ editor_t#note2.] : noteNames1cxx . . $ noteNames1.[2+editorcxx . . $ editor..note2cxx . . $ editor_t#note2.], |
| 1266 | videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1267 | } |
| 1268 | |
| 1269 | if (uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text.) |
| 1270 | { |
| 1271 | uicxx . . $ ui..updateChordNote3Textcxx . . $ ui_t#updateChordNote3Text. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1272 | if (editorcxx . . $ editor..note3cxx . . $ editor_t#note3. > 35) |
| 1273 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(256, 80, "---", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1274 | else |
| 1275 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(256, 80, configcxx . . $ config..accidentalcxx . . $ config_t#accidental. ? noteNames2cxx . . $ noteNames2.[2+editorcxx . . $ editor..note3cxx . . $ editor_t#note3.] : noteNames1cxx . . $ noteNames1.[2+editorcxx . . $ editor..note3cxx . . $ editor_t#note3.], |
| 1276 | videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1277 | } |
| 1278 | |
| 1279 | if (uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text.) |
| 1280 | { |
| 1281 | uicxx . . $ ui..updateChordNote4Textcxx . . $ ui_t#updateChordNote4Text. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1282 | if (editorcxx . . $ editor..note4cxx . . $ editor_t#note4. > 35) |
| 1283 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(256, 91, "---", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1284 | else |
| 1285 | textOutBgcxx . . $ textOutBg(14940e7ead0326d3).(256, 91, configcxx . . $ config..accidentalcxx . . $ config_t#accidental. ? noteNames2cxx . . $ noteNames2.[2+editorcxx . . $ editor..note4cxx . . $ editor_t#note4.] : noteNames1cxx . . $ noteNames1.[2+editorcxx . . $ editor..note4cxx . . $ editor_t#note4.], |
| 1286 | videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.], videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENBKGcxx . . $ PAL_GENBKG.]); |
| 1287 | } |
| 1288 | } |
| 1289 | } |
| 1290 | |
| 1291 | void displayMainScreencxx . . $ displayMainScreen(49f6e7a06ebc5aa8).(void) |
| 1292 | { |
| 1293 | editorcxx . . $ editor..blockMarkFlagcxx . . $ editor_t#blockMarkFlag. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1294 | |
| 1295 | uicxx . . $ ui..updateSongNamecxx . . $ ui_t#updateSongName. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1296 | uicxx . . $ ui..updateSongSizecxx . . $ ui_t#updateSongSize. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1297 | uicxx . . $ ui..updateSongTimingcxx . . $ ui_t#updateSongTiming. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1298 | uicxx . . $ ui..updateTrackerFlagscxx . . $ ui_t#updateTrackerFlags. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1299 | uicxx . . $ ui..updateStatusTextcxx . . $ ui_t#updateStatusText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1300 | |
| 1301 | uicxx . . $ ui..updateCurrSampleNamecxx . . $ ui_t#updateCurrSampleName. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1302 | |
| 1303 | if (!uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown.) |
| 1304 | { |
| 1305 | uicxx . . $ ui..updateCurrSampleFineTunecxx . . $ ui_t#updateCurrSampleFineTune. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1306 | uicxx . . $ ui..updateCurrSampleNumcxx . . $ ui_t#updateCurrSampleNum. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1307 | uicxx . . $ ui..updateCurrSampleVolumecxx . . $ ui_t#updateCurrSampleVolume. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1308 | uicxx . . $ ui..updateCurrSampleLengthcxx . . $ ui_t#updateCurrSampleLength. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1309 | uicxx . . $ ui..updateCurrSampleRepeatcxx . . $ ui_t#updateCurrSampleRepeat. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1310 | uicxx . . $ ui..updateCurrSampleReplencxx . . $ ui_t#updateCurrSampleReplen. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1311 | } |
| 1312 | |
| 1313 | if (uicxx . . $ ui..samplerScreenShowncxx . . $ ui_t#samplerScreenShown.) |
| 1314 | { |
| 1315 | if (!uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown.) |
| 1316 | { |
| 1317 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(0, 0, 320, 121, trackerFrameBMPcxx . . $ trackerFrameBMP.); |
| 1318 | |
| 1319 | if (configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. != 65534) |
| 1320 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(1, 65, 62, 34, fix128KTrackerBMPcxx . . $ fix128KTrackerBMP.); // fix for 128kB support mode |
| 1321 | } |
| 1322 | } |
| 1323 | else |
| 1324 | { |
| 1325 | if (!uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown.) |
| 1326 | { |
| 1327 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(0, 0, 320, 255, trackerFrameBMPcxx . . $ trackerFrameBMP.); |
| 1328 | |
| 1329 | if (configcxx . . $ config..maxSampleLengthcxx . . $ config_t#maxSampleLength. != 65534) |
| 1330 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(1, 65, 62, 34, fix128KTrackerBMPcxx . . $ fix128KTrackerBMP.); // fix for 128kB support mode |
| 1331 | } |
| 1332 | else |
| 1333 | { |
| 1334 | blit32cxx . . $ blit32(5f3dcb304cf8bfc1).(0, 121, 320, 134, &trackerFrameBMPcxx . . $ trackerFrameBMP.[121 * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!]); |
| 1335 | } |
| 1336 | |
| 1337 | uicxx . . $ ui..updateSongBPMcxx . . $ ui_t#updateSongBPM. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1338 | uicxx . . $ ui..updateCurrPattTextcxx . . $ ui_t#updateCurrPattText. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1339 | uicxx . . $ ui..updatePatternDatacxx . . $ ui_t#updatePatternData. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1340 | } |
| 1341 | |
| 1342 | if (uicxx . . $ ui..diskOpScreenShowncxx . . $ ui_t#diskOpScreenShown.) |
| 1343 | { |
| 1344 | renderDiskOpScreencxx . . $ renderDiskOpScreen(49f6e7a06ebc5aa8).(); |
| 1345 | } |
| 1346 | else |
| 1347 | { |
| 1348 | uicxx . . $ ui..updateSongPoscxx . . $ ui_t#updateSongPos. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1349 | uicxx . . $ ui..updateSongPatterncxx . . $ ui_t#updateSongPattern. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1350 | uicxx . . $ ui..updateSongLengthcxx . . $ ui_t#updateSongLength. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1351 | |
| 1352 | // draw zeroes that will never change (to the left of numbers) |
| 1353 | |
| 1354 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(64, 3, '0', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1355 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(64, 14, "00", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1356 | |
| 1357 | if (!editorcxx . . $ editor..mod2WavOngoingcxx . . $ editor_t#mod2WavOngoing.) |
| 1358 | { |
| 1359 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(64, 25, '0', videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1360 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(64, 47, "00", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1361 | textOutcxx . . $ textOut(ecc378a7b29cfb5a).(64, 58, "00", videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_GENTXTcxx . . $ PAL_GENTXT.]); |
| 1362 | } |
| 1363 | |
| 1364 | if (uicxx . . $ ui..posEdScreenShowncxx . . $ ui_t#posEdScreenShown.) |
| 1365 | { |
| 1366 | renderPosEdScreencxx . . $ renderPosEdScreen(49f6e7a06ebc5aa8).(); |
| 1367 | uicxx . . $ ui..updatePosEdcxx . . $ ui_t#updatePosEd. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1368 | } |
| 1369 | else |
| 1370 | { |
| 1371 | if (uicxx . . $ ui..editOpScreenShowncxx . . $ ui_t#editOpScreenShown.) |
| 1372 | { |
| 1373 | renderEditOpScreencxx . . $ renderEditOpScreen(49f6e7a06ebc5aa8).(); |
| 1374 | } |
| 1375 | else |
| 1376 | { |
| 1377 | if (uicxx . . $ ui..aboutScreenShowncxx . . $ ui_t#aboutScreenShown.) |
| 1378 | { |
| 1379 | renderAboutScreencxx . . $ renderAboutScreen(49f6e7a06ebc5aa8).(); |
| 1380 | } |
| 1381 | else |
| 1382 | { |
| 1383 | if (uicxx . . $ ui..visualizerModecxx . . $ ui_t#visualizerMode. == VISUAL_QUADRASCOPEcxx . . $ VISUAL_QUADRASCOPE.) renderQuadrascopeBgcxx . . $ renderQuadrascopeBg(49f6e7a06ebc5aa8).(); |
| 1384 | else if (uicxx . . $ ui..visualizerModecxx . . $ ui_t#visualizerMode. == VISUAL_SPECTRUMcxx . . $ VISUAL_SPECTRUM.) renderSpectrumAnalyzerBgcxx . . $ renderSpectrumAnalyzerBg(49f6e7a06ebc5aa8).(); |
| 1385 | } |
| 1386 | } |
| 1387 | |
| 1388 | renderMuteButtonscxx . . $ renderMuteButtons(49f6e7a06ebc5aa8).(); |
| 1389 | } |
| 1390 | } |
| 1391 | } |
| 1392 | |
| 1393 | void videoClosecxx . . $ videoClose(49f6e7a06ebc5aa8).(void) |
| 1394 | { |
| 1395 | if (videocxx . . $ video..texturecxx . . $ video_t#texture. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) SDL_DestroyTexturecxx . . $ SDL_DestroyTexture(95a4f98c9f663ab8).(videocxx . . $ video..texturecxx . . $ video_t#texture.); |
| 1396 | if (videocxx . . $ video..renderercxx . . $ video_t#renderer. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) SDL_DestroyRenderercxx . . $ SDL_DestroyRenderer(8a04ec9ed224ca6d).(videocxx . . $ video..renderercxx . . $ video_t#renderer.); |
| 1397 | if (videocxx . . $ video..windowcxx . . $ video_t#window. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) SDL_DestroyWindowcxx . . $ SDL_DestroyWindow(8c8d6c3b662f39a2).(videocxx . . $ video..windowcxx . . $ video_t#window.); |
| 1398 | if (videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) freecxx . . $ free(5d22bdacc48458e8).(videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.); |
| 1399 | } |
| 1400 | |
| 1401 | void setupSpritescxx . . $ setupSprites(49f6e7a06ebc5aa8).(void) |
| 1402 | { |
| 1403 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(spritescxx . . $ sprites., 0, sizeof (spritescxx . . $ sprites.)); |
| 1404 | |
| 1405 | spritescxx . . $ sprites.[SPRITE_MOUSE_POINTERcxx . . $ SPRITE_MOUSE_POINTER.].datacxx . . $ sprite_t#data. = mousePointerBMPcxx . . $ mousePointerBMP.; |
| 1406 | spritescxx . . $ sprites.[SPRITE_MOUSE_POINTERcxx . . $ SPRITE_MOUSE_POINTER.].pixelTypecxx . . $ sprite_t#pixelType. = SPRITE_TYPE_PALETTEcxx . . $ SPRITE_TYPE_PALETTE.; |
| 1407 | spritescxx . . $ sprites.[SPRITE_MOUSE_POINTERcxx . . $ SPRITE_MOUSE_POINTER.].colorKeycxx . . $ sprite_t#colorKey. = PAL_COLORKEYcxx . . $ PAL_COLORKEY.; |
| 1408 | spritescxx . . $ sprites.[SPRITE_MOUSE_POINTERcxx . . $ SPRITE_MOUSE_POINTER.].wcxx . . $ sprite_t#w. = 16; |
| 1409 | spritescxx . . $ sprites.[SPRITE_MOUSE_POINTERcxx . . $ SPRITE_MOUSE_POINTER.].hcxx . . $ sprite_t#h. = 16; |
| 1410 | hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(SPRITE_MOUSE_POINTERcxx . . $ SPRITE_MOUSE_POINTER.); |
| 1411 | |
| 1412 | spritescxx . . $ sprites.[SPRITE_PATTERN_CURSORcxx . . $ SPRITE_PATTERN_CURSOR.].datacxx . . $ sprite_t#data. = patternCursorBMPcxx . . $ patternCursorBMP.; |
| 1413 | spritescxx . . $ sprites.[SPRITE_PATTERN_CURSORcxx . . $ SPRITE_PATTERN_CURSOR.].pixelTypecxx . . $ sprite_t#pixelType. = SPRITE_TYPE_RGBcxx . . $ SPRITE_TYPE_RGB.; |
| 1414 | spritescxx . . $ sprites.[SPRITE_PATTERN_CURSORcxx . . $ SPRITE_PATTERN_CURSOR.].colorKeycxx . . $ sprite_t#colorKey. = videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_COLORKEYcxx . . $ PAL_COLORKEY.]; |
| 1415 | spritescxx . . $ sprites.[SPRITE_PATTERN_CURSORcxx . . $ SPRITE_PATTERN_CURSOR.].wcxx . . $ sprite_t#w. = 11; |
| 1416 | spritescxx . . $ sprites.[SPRITE_PATTERN_CURSORcxx . . $ SPRITE_PATTERN_CURSOR.].hcxx . . $ sprite_t#h. = 14; |
| 1417 | hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(SPRITE_PATTERN_CURSORcxx . . $ SPRITE_PATTERN_CURSOR.); |
| 1418 | |
| 1419 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_LEFTcxx . . $ SPRITE_LOOP_PIN_LEFT.].datacxx . . $ sprite_t#data. = loopPinsBMPcxx . . $ loopPinsBMP.; |
| 1420 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_LEFTcxx . . $ SPRITE_LOOP_PIN_LEFT.].pixelTypecxx . . $ sprite_t#pixelType. = SPRITE_TYPE_RGBcxx . . $ SPRITE_TYPE_RGB.; |
| 1421 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_LEFTcxx . . $ SPRITE_LOOP_PIN_LEFT.].colorKeycxx . . $ sprite_t#colorKey. = videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_COLORKEYcxx . . $ PAL_COLORKEY.]; |
| 1422 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_LEFTcxx . . $ SPRITE_LOOP_PIN_LEFT.].wcxx . . $ sprite_t#w. = 4; |
| 1423 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_LEFTcxx . . $ SPRITE_LOOP_PIN_LEFT.].hcxx . . $ sprite_t#h. = 64; |
| 1424 | hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(SPRITE_LOOP_PIN_LEFTcxx . . $ SPRITE_LOOP_PIN_LEFT.); |
| 1425 | |
| 1426 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_RIGHTcxx . . $ SPRITE_LOOP_PIN_RIGHT.].datacxx . . $ sprite_t#data. = &loopPinsBMPcxx . . $ loopPinsBMP.[4 * 64]; |
| 1427 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_RIGHTcxx . . $ SPRITE_LOOP_PIN_RIGHT.].pixelTypecxx . . $ sprite_t#pixelType. = SPRITE_TYPE_RGBcxx . . $ SPRITE_TYPE_RGB.; |
| 1428 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_RIGHTcxx . . $ SPRITE_LOOP_PIN_RIGHT.].colorKeycxx . . $ sprite_t#colorKey. = videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_COLORKEYcxx . . $ PAL_COLORKEY.]; |
| 1429 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_RIGHTcxx . . $ SPRITE_LOOP_PIN_RIGHT.].wcxx . . $ sprite_t#w. = 4; |
| 1430 | spritescxx . . $ sprites.[SPRITE_LOOP_PIN_RIGHTcxx . . $ SPRITE_LOOP_PIN_RIGHT.].hcxx . . $ sprite_t#h. = 64; |
| 1431 | hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(SPRITE_LOOP_PIN_RIGHTcxx . . $ SPRITE_LOOP_PIN_RIGHT.); |
| 1432 | |
| 1433 | spritescxx . . $ sprites.[SPRITE_SAMPLING_POS_LINEcxx . . $ SPRITE_SAMPLING_POS_LINE.].datacxx . . $ sprite_t#data. = samplingPosBMPcxx . . $ samplingPosBMP.; |
| 1434 | spritescxx . . $ sprites.[SPRITE_SAMPLING_POS_LINEcxx . . $ SPRITE_SAMPLING_POS_LINE.].pixelTypecxx . . $ sprite_t#pixelType. = SPRITE_TYPE_RGBcxx . . $ SPRITE_TYPE_RGB.; |
| 1435 | spritescxx . . $ sprites.[SPRITE_SAMPLING_POS_LINEcxx . . $ SPRITE_SAMPLING_POS_LINE.].colorKeycxx . . $ sprite_t#colorKey. = videocxx . . $ video..palettecxx . . $ video_t#palette.[PAL_COLORKEYcxx . . $ PAL_COLORKEY.]; |
| 1436 | spritescxx . . $ sprites.[SPRITE_SAMPLING_POS_LINEcxx . . $ SPRITE_SAMPLING_POS_LINE.].wcxx . . $ sprite_t#w. = 1; |
| 1437 | spritescxx . . $ sprites.[SPRITE_SAMPLING_POS_LINEcxx . . $ SPRITE_SAMPLING_POS_LINE.].hcxx . . $ sprite_t#h. = 64; |
| 1438 | hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(SPRITE_SAMPLING_POS_LINEcxx . . $ SPRITE_SAMPLING_POS_LINE.); |
| 1439 | |
| 1440 | // setup refresh buffer (used to clear sprites after each frame) |
| 1441 | for (uint32_tcxx . . $ uint32_t# i = 0; i < SPRITE_NUMcxx . . $ SPRITE_NUM.; i++) |
| 1442 | spritescxx . . $ sprites.[i].refreshBuffercxx . . $ sprite_t#refreshBuffer. = (uint32_tcxx . . $ uint32_t# *)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).((spritescxx . . $ sprites.[i].wcxx . . $ sprite_t#w. * spritescxx . . $ sprites.[i].hcxx . . $ sprite_t#h.) * sizeof (int32_tcxx . . $ int32_t#)); |
| 1443 | } |
| 1444 | |
| 1445 | void freeSpritescxx . . $ freeSprites(49f6e7a06ebc5aa8).(void) |
| 1446 | { |
| 1447 | for (int32_tcxx . . $ int32_t# i = 0; i < SPRITE_NUMcxx . . $ SPRITE_NUM.; i++) |
| 1448 | freecxx . . $ free(5d22bdacc48458e8).(spritescxx . . $ sprites.[i].refreshBuffercxx . . $ sprite_t#refreshBuffer.); |
| 1449 | } |
| 1450 | |
| 1451 | void setSpritePoscxx . . $ setSpritePos(b1146eedae1e1d0b).(int32_tcxx . . $ int32_t# sprite, int32_tcxx . . $ int32_t# x, int32_tcxx . . $ int32_t# y) |
| 1452 | { |
| 1453 | spritescxx . . $ sprites.[sprite].newXcxx . . $ sprite_t#newX. = (int16_tcxx . . $ int16_t#)x; |
| 1454 | spritescxx . . $ sprites.[sprite].newYcxx . . $ sprite_t#newY. = (int16_tcxx . . $ int16_t#)y; |
| 1455 | } |
| 1456 | |
| 1457 | void hideSpritecxx . . $ hideSprite(d4f767463ce0a6b3).(int32_tcxx . . $ int32_t# sprite) |
| 1458 | { |
| 1459 | spritescxx . . $ sprites.[sprite].newXcxx . . $ sprite_t#newX. = SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!; |
| 1460 | } |
| 1461 | |
| 1462 | void eraseSpritescxx . . $ eraseSprites(49f6e7a06ebc5aa8).(void) |
| 1463 | { |
| 1464 | for (int32_tcxx . . $ int32_t# i = SPRITE_NUMcxx . . $ SPRITE_NUM.-1; i >= 0; i--) // erasing must be done in reverse order |
| 1465 | { |
| 1466 | sprite_tcxx . . $ sprite_t# *s = &spritescxx . . $ sprites.[i]; |
| 1467 | if (s->xcxx . . $ sprite_t#x. >= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! || s->ycxx . . $ sprite_t#y. >= SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!) // sprite is hidden, don't draw nor fill clear buffer |
| 1468 | continue; |
| 1469 | |
| 1470 | ASSERTcxx . . $ `src/pt2_header.h:25:9`!(s->refreshBuffer != NULL); |
| 1471 | |
| 1472 | int32_tcxx . . $ int32_t# sw = s->wcxx . . $ sprite_t#w.; |
| 1473 | int32_tcxx . . $ int32_t# sh = s->hcxx . . $ sprite_t#h.; |
| 1474 | int32_tcxx . . $ int32_t# sx = s->xcxx . . $ sprite_t#x.; |
| 1475 | int32_tcxx . . $ int32_t# sy = s->ycxx . . $ sprite_t#y.; |
| 1476 | |
| 1477 | // if x is negative, adjust variables |
| 1478 | if (sx < 0) |
| 1479 | { |
| 1480 | sw += sx; // subtraction |
| 1481 | sx = 0; |
| 1482 | } |
| 1483 | |
| 1484 | // if y is negative, adjust variables |
| 1485 | if (sy < 0) |
| 1486 | { |
| 1487 | sh += sy; // subtraction |
| 1488 | sy = 0; |
| 1489 | } |
| 1490 | |
| 1491 | uint32_tcxx . . $ uint32_t# *dst32 = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(sy * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + sx]; |
| 1492 | const uint32_tcxx . . $ uint32_t# *src32 = s->refreshBuffercxx . . $ sprite_t#refreshBuffer.; |
| 1493 | |
| 1494 | // handle x/y clipping |
| 1495 | if (sx+sw >= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) sw = SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! - sx; |
| 1496 | if (sy+sh >= SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!) sh = SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`! - sy; |
| 1497 | |
| 1498 | int32_tcxx . . $ int32_t# srcPitch = s->wcxx . . $ sprite_t#w. - sw; |
| 1499 | int32_tcxx . . $ int32_t# dstPitch = SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! - sw; |
| 1500 | |
| 1501 | for (int32_tcxx . . $ int32_t# y = 0; y < sh; y++) |
| 1502 | { |
| 1503 | for (int32_tcxx . . $ int32_t# x = 0; x < sw; x++) |
| 1504 | *dst32++ = *src32++; |
| 1505 | |
| 1506 | src32 += srcPitch; |
| 1507 | dst32 += dstPitch; |
| 1508 | } |
| 1509 | } |
| 1510 | |
| 1511 | fillFromVuMetersBgBuffercxx . . $ fillFromVuMetersBgBuffer(49f6e7a06ebc5aa8).(); // let's put it here even though it's not sprite-based |
| 1512 | } |
| 1513 | |
| 1514 | void renderSpritescxx . . $ renderSprites(49f6e7a06ebc5aa8).(void) |
| 1515 | { |
| 1516 | renderVuMeterscxx . . $ renderVuMeters(49f6e7a06ebc5aa8).(); // let's put it here even though it's not sprite-based |
| 1517 | |
| 1518 | for (int32_tcxx . . $ int32_t# i = 0; i < SPRITE_NUMcxx . . $ SPRITE_NUM.; i++) |
| 1519 | { |
| 1520 | sprite_tcxx . . $ sprite_t# *s = &spritescxx . . $ sprites.[i]; |
| 1521 | |
| 1522 | // set new sprite position |
| 1523 | s->xcxx . . $ sprite_t#x. = s->newXcxx . . $ sprite_t#newX.; |
| 1524 | s->ycxx . . $ sprite_t#y. = s->newYcxx . . $ sprite_t#newY.; |
| 1525 | |
| 1526 | if (s->xcxx . . $ sprite_t#x. >= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! || s->ycxx . . $ sprite_t#y. >= SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!) // sprite is hidden, don't draw nor fill clear buffer |
| 1527 | continue; |
| 1528 | |
| 1529 | ASSERTcxx . . $ `src/pt2_header.h:25:9`!(s->data != NULL && s->refreshBuffer != NULL); |
| 1530 | |
| 1531 | int32_tcxx . . $ int32_t# sw = s->wcxx . . $ sprite_t#w.; |
| 1532 | int32_tcxx . . $ int32_t# sh = s->hcxx . . $ sprite_t#h.; |
| 1533 | int32_tcxx . . $ int32_t# sx = s->xcxx . . $ sprite_t#x.; |
| 1534 | int32_tcxx . . $ int32_t# sy = s->ycxx . . $ sprite_t#y.; |
| 1535 | int32_tcxx . . $ int32_t# srcPtrBias = 0; |
| 1536 | |
| 1537 | // if x is negative, adjust variables |
| 1538 | if (sx < 0) |
| 1539 | { |
| 1540 | sw += sx; // subtraction |
| 1541 | srcPtrBias += -sx; |
| 1542 | sx = 0; |
| 1543 | } |
| 1544 | |
| 1545 | // if y is negative, adjust variables |
| 1546 | if (sy < 0) |
| 1547 | { |
| 1548 | sh += sy; // subtraction |
| 1549 | srcPtrBias += (-sy * s->wcxx . . $ sprite_t#w.); |
| 1550 | sy = 0; |
| 1551 | } |
| 1552 | |
| 1553 | uint32_tcxx . . $ uint32_t# *dst32 = &videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer.[(sy * SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) + sx]; |
| 1554 | uint32_tcxx . . $ uint32_t# *clr32 = s->refreshBuffercxx . . $ sprite_t#refreshBuffer.; |
| 1555 | |
| 1556 | // handle x/y clipping |
| 1557 | if (sx+sw >= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!) sw = SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! - sx; |
| 1558 | if (sy+sh >= SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!) sh = SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`! - sy; |
| 1559 | |
| 1560 | int32_tcxx . . $ int32_t# srcPitch = s->wcxx . . $ sprite_t#w. - sw; |
| 1561 | int32_tcxx . . $ int32_t# dstPitch = SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! - sw; |
| 1562 | |
| 1563 | uint32_tcxx . . $ uint32_t# colorKey = spritescxx . . $ sprites.[i].colorKeycxx . . $ sprite_t#colorKey.; |
| 1564 | if (spritescxx . . $ sprites.[i].pixelTypecxx . . $ sprite_t#pixelType. == SPRITE_TYPE_RGBcxx . . $ SPRITE_TYPE_RGB.) |
| 1565 | { |
| 1566 | // 24-bit RGB sprite |
| 1567 | const uint32_tcxx . . $ uint32_t# *src32 = ((uint32_tcxx . . $ uint32_t# *)spritescxx . . $ sprites.[i].datacxx . . $ sprite_t#data.) + srcPtrBias; |
| 1568 | for (int32_tcxx . . $ int32_t# y = 0; y < sh; y++) |
| 1569 | { |
| 1570 | for (int32_tcxx . . $ int32_t# x = 0; x < sw; x++) |
| 1571 | { |
| 1572 | *clr32++ = *dst32; // fill clear buffer |
| 1573 | if (*src32 != colorKey) |
| 1574 | *dst32 = *src32; |
| 1575 | |
| 1576 | dst32++; |
| 1577 | src32++; |
| 1578 | } |
| 1579 | |
| 1580 | clr32 += srcPitch; |
| 1581 | src32 += srcPitch; |
| 1582 | dst32 += dstPitch; |
| 1583 | } |
| 1584 | } |
| 1585 | else |
| 1586 | { |
| 1587 | // 8-bit paletted sprite |
| 1588 | const uint8_tcxx . . $ uint8_t# *src8 = ((uint8_tcxx . . $ uint8_t# *)spritescxx . . $ sprites.[i].datacxx . . $ sprite_t#data.) + srcPtrBias; |
| 1589 | for (int32_tcxx . . $ int32_t# y = 0; y < sh; y++) |
| 1590 | { |
| 1591 | for (int32_tcxx . . $ int32_t# x = 0; x < sw; x++) |
| 1592 | { |
| 1593 | *clr32++ = *dst32; // fill clear buffer |
| 1594 | if (*src8 != colorKey) |
| 1595 | { |
| 1596 | ASSERTcxx . . $ `src/pt2_header.h:25:9`!(*src8 < PALETTE_NUM); |
| 1597 | *dst32 = videocxx . . $ video..palettecxx . . $ video_t#palette.[*src8]; |
| 1598 | } |
| 1599 | |
| 1600 | dst32++; |
| 1601 | src8++; |
| 1602 | } |
| 1603 | |
| 1604 | clr32 += srcPitch; |
| 1605 | src8 += srcPitch; |
| 1606 | dst32 += dstPitch; |
| 1607 | } |
| 1608 | } |
| 1609 | } |
| 1610 | } |
| 1611 | |
| 1612 | void resetFPSCountercxx . . $ resetFPSCounter(49f6e7a06ebc5aa8).(void) |
| 1613 | { |
| 1614 | videoFrameCountercxx . . $ videoFrameCounter. = 0; |
| 1615 | fpsTextBufcxx . . $ fpsTextBuf.[0] = '\0'; |
| 1616 | runningFrameDurationcxx . . $ runningFrameDuration. = 0; |
| 1617 | avgFramesReadycxx . . $ avgFramesReady. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1618 | } |
| 1619 | |
| 1620 | void beginFPSCountercxx . . $ beginFPSCounter(49f6e7a06ebc5aa8).(void) |
| 1621 | { |
| 1622 | if (videocxx . . $ video..debugcxx . . $ video_t#debug.) |
| 1623 | frameStartTimecxx . . $ frameStartTime. = SDL_GetPerformanceCountercxx . . $ SDL_GetPerformanceCounter(f708dce9a8856c70).(); |
| 1624 | } |
| 1625 | |
| 1626 | void endFPSCountercxx . . $ endFPSCounter(49f6e7a06ebc5aa8).(void) |
| 1627 | { |
| 1628 | if (videocxx . . $ video..debugcxx . . $ video_t#debug. && frameStartTimecxx . . $ frameStartTime. > 0) |
| 1629 | runningFrameDurationcxx . . $ runningFrameDuration. += SDL_GetPerformanceCountercxx . . $ SDL_GetPerformanceCounter(f708dce9a8856c70).() - frameStartTimecxx . . $ frameStartTime.; |
| 1630 | } |
| 1631 | |
| 1632 | static void drawDebugBoxcxx . . $ drawDebugBox(49f6e7a06ebc5aa8).(void) |
| 1633 | { |
| 1634 | SDL_versioncxx . . $ SDL_version# SDLVer; |
| 1635 | |
| 1636 | SDL_GetVersioncxx . . $ SDL_GetVersion(a793649bddeabf85).(&SDLVer); |
| 1637 | |
| 1638 | if (++videoFrameCountercxx . . $ videoFrameCounter. >= FPS_SCAN_FRAMEScxx . . $ `src/pt2_visuals.c:50:9`!) |
| 1639 | { |
| 1640 | dAvgFPScxx . . $ dAvgFPS. = dFrameDurationDivcxx . . $ dFrameDurationDiv. / (double)runningFrameDurationcxx . . $ runningFrameDuration.; |
| 1641 | if (dAvgFPScxx . . $ dAvgFPS. < 0.0 || dAvgFPScxx . . $ dAvgFPS. > 99999999.9999) |
| 1642 | dAvgFPScxx . . $ dAvgFPS. = 99999999.9999; // prevent number from overflowing text box |
| 1643 | |
| 1644 | runningFrameDurationcxx . . $ runningFrameDuration. = 0; |
| 1645 | videoFrameCountercxx . . $ videoFrameCounter. = 0; |
| 1646 | avgFramesReadycxx . . $ avgFramesReady. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1647 | } |
| 1648 | |
| 1649 | drawFramework3cxx . . $ drawFramework3(748afa4755bc9595).(4, 4, SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!-8, 81); |
| 1650 | |
| 1651 | // if enough frame data isn't collected yet, show a message |
| 1652 | if (!avgFramesReadycxx . . $ avgFramesReady.) |
| 1653 | { |
| 1654 | const char text[] = "Gathering frame information..."; |
| 1655 | const uint16_tcxx . . $ uint16_t# textW = (sizeof (text)-1) * (FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!-1); |
| 1656 | textOut2cxx . . $ textOut2(be85f8883e7b25d0).(4+(SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!-textW)/2, 4+(81/2) - (FONT_CHAR_Hcxx . . $ `src/pt2_header.h:71:9`!/2), text); |
| 1657 | return; |
| 1658 | } |
| 1659 | |
| 1660 | double dRefreshRate = videocxx . . $ video..dMonitorRefreshRatecxx . . $ video_t#dMonitorRefreshRate.; |
| 1661 | if (dRefreshRate < 0.0 || dRefreshRate > 9999.9) |
| 1662 | dRefreshRate = 9999.9; // prevent number from overflowing text box |
| 1663 | |
| 1664 | sprintfcxx . . $ sprintf(26c8642d26409d6d).(fpsTextBufcxx . . $ fpsTextBuf., |
| 1665 | "SDL version: %u.%u.%u\n" \ |
| 1666 | "Frames per second: %.3f\n" \ |
| 1667 | "Monitor refresh: %.1fHz (vsync: %s)\n" \ |
| 1668 | "HPC frequency (timer): %.4fMHz\n" \ |
| 1669 | "Render size: %dx%d (offset %d,%d)\n" \ |
| 1670 | "Disp. size: %dx%d (window: %dx%d)\n" \ |
| 1671 | "Render scaling: x=%.4f, y=%.4f\n" \ |
| 1672 | "Mouse muls: x=%.4f, y=%.4f\n" \ |
| 1673 | "Relative mouse coords: %d,%d\n" \ |
| 1674 | "Absolute mouse coords: %d,%d\n" \ |
| 1675 | "Press CTRL+SHIFT+F to close this box.\n", |
| 1676 | SDLVer.majorcxx . . $ SDL_version#major., SDLVer.minorcxx . . $ SDL_version#minor., SDLVer.patchcxx . . $ SDL_version#patch., |
| 1677 | dAvgFPScxx . . $ dAvgFPS., |
| 1678 | dRefreshRate, |
| 1679 | videocxx . . $ video..vsync60HzPresentcxx . . $ video_t#vsync60HzPresent. ? "yes" : "no", |
| 1680 | hpcFreqcxx . . $ hpcFreq..freq64cxx . . $ $anonymous_type_f41cb469dd1dca50_0#freq64. / (1000.0 * 1000.0), |
| 1681 | videocxx . . $ video..renderWcxx . . $ video_t#renderW., videocxx . . $ video..renderHcxx . . $ video_t#renderH., videocxx . . $ video..renderXcxx . . $ video_t#renderX., videocxx . . $ video..renderYcxx . . $ video_t#renderY., |
| 1682 | videocxx . . $ video..displayWcxx . . $ video_t#displayW., videocxx . . $ video..displayHcxx . . $ video_t#displayH., videocxx . . $ video..windowWcxx . . $ video_t#windowW., videocxx . . $ video..windowHcxx . . $ video_t#windowH., |
| 1683 | (double)videocxx . . $ video..renderWcxx . . $ video_t#renderW. / SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!, (double)videocxx . . $ video..renderHcxx . . $ video_t#renderH. / SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!, |
| 1684 | videocxx . . $ video..dMouseXMulcxx . . $ video_t#dMouseXMul., videocxx . . $ video..dMouseYMulcxx . . $ video_t#dMouseYMul., |
| 1685 | mousecxx . . $ mouse..xcxx . . $ mouse_t#x., mousecxx . . $ mouse..ycxx . . $ mouse_t#y., |
| 1686 | mousecxx . . $ mouse..absXcxx . . $ mouse_t#absX., mousecxx . . $ mouse..absYcxx . . $ mouse_t#absY.); |
| 1687 | |
| 1688 | // draw text |
| 1689 | |
| 1690 | uint16_tcxx . . $ uint16_t# xPos = 4+2; |
| 1691 | uint16_tcxx . . $ uint16_t# yPos = 4+3; |
| 1692 | |
| 1693 | char *textPtr = fpsTextBufcxx . . $ fpsTextBuf.; |
| 1694 | while (*textPtr != '\0') |
| 1695 | { |
| 1696 | const char ch = *textPtr++; |
| 1697 | if (ch == '\n') |
| 1698 | { |
| 1699 | yPos += FONT_CHAR_Hcxx . . $ `src/pt2_header.h:71:9`!+2; |
| 1700 | xPos = 4+2; |
| 1701 | continue; |
| 1702 | } |
| 1703 | |
| 1704 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(xPos, yPos, ch, 0x00000000); |
| 1705 | xPos += FONT_CHAR_Wcxx . . $ `src/pt2_header.h:70:9`!-1; |
| 1706 | } |
| 1707 | |
| 1708 | // draw framerate tester symbol |
| 1709 | |
| 1710 | const uint16_tcxx . . $ uint16_t# symbolEnd = 122; |
| 1711 | |
| 1712 | // ping-pong movement |
| 1713 | uint16_tcxx . . $ uint16_t# x = editorcxx . . $ editor..framesPassedcxx . . $ editor_t#framesPassed. % (symbolEnd * 2); |
| 1714 | if (x >= symbolEnd) |
| 1715 | x = (symbolEnd * 2) - x; |
| 1716 | |
| 1717 | charOutcxx . . $ charOut(e6c1e39bfc2b37).(179+4+x, 4+10, '*', 0x00000000); |
| 1718 | } |
| 1719 | |
| 1720 | void flipFramecxx . . $ flipFrame(49f6e7a06ebc5aa8).(void) |
| 1721 | { |
| 1722 | const uint32_tcxx . . $ uint32_t# windowFlags = SDL_GetWindowFlagscxx . . $ SDL_GetWindowFlags(9beabbd21f19984b).(videocxx . . $ video..windowcxx . . $ video_t#window.); |
| 1723 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! minimized = (windowFlags & SDL_WINDOW_MINIMIZEDcxx . . $ SDL_WINDOW_MINIMIZED.) ? truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`! : falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1724 | |
| 1725 | renderSpritescxx . . $ renderSprites(49f6e7a06ebc5aa8).(); |
| 1726 | |
| 1727 | if (videocxx . . $ video..debugcxx . . $ video_t#debug.) |
| 1728 | drawDebugBoxcxx . . $ drawDebugBox(49f6e7a06ebc5aa8).(); |
| 1729 | |
| 1730 | SDL_UpdateTexturecxx . . $ SDL_UpdateTexture(7b51089f4b446d6e).(videocxx . . $ video..texturecxx . . $ video_t#texture., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer., SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! * sizeof (int32_tcxx . . $ int32_t#)); |
| 1731 | |
| 1732 | // SDL 2.0.14 bug on Windows (?): This function consumes ever-increasing memory if the program is minimized |
| 1733 | if (!minimized) |
| 1734 | SDL_RenderClearcxx . . $ SDL_RenderClear(d6c53d51f81071d4).(videocxx . . $ video..renderercxx . . $ video_t#renderer.); |
| 1735 | |
| 1736 | if (videocxx . . $ video..useCustomRenderRectcxx . . $ video_t#useCustomRenderRect.) |
| 1737 | SDL_RenderCopycxx . . $ SDL_RenderCopy(64b845cb112b06b3).(videocxx . . $ video..renderercxx . . $ video_t#renderer., videocxx . . $ video..texturecxx . . $ video_t#texture., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, &videocxx . . $ video..renderRectcxx . . $ video_t#renderRect.); |
| 1738 | else |
| 1739 | SDL_RenderCopycxx . . $ SDL_RenderCopy(64b845cb112b06b3).(videocxx . . $ video..renderercxx . . $ video_t#renderer., videocxx . . $ video..texturecxx . . $ video_t#texture., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 1740 | |
| 1741 | SDL_RenderPresentcxx . . $ SDL_RenderPresent(8a04ec9ed224ca6d).(videocxx . . $ video..renderercxx . . $ video_t#renderer.); |
| 1742 | |
| 1743 | eraseSpritescxx . . $ eraseSprites(49f6e7a06ebc5aa8).(); |
| 1744 | |
| 1745 | if (!videocxx . . $ video..vsync60HzPresentcxx . . $ video_t#vsync60HzPresent.) |
| 1746 | { |
| 1747 | // we have no VSync, do crude thread sleeping to sync to ~60Hz |
| 1748 | hpc_Waitcxx . . $ hpc_Wait(efacbc4df292ea9a).(&videocxx . . $ video..vblankHpccxx . . $ video_t#vblankHpc.); |
| 1749 | } |
| 1750 | else |
| 1751 | { |
| 1752 | /* We have VSync, but it can unexpectedly get inactive in certain scenarios. |
| 1753 | ** We have to force thread sleeping (to ~60Hz) if so. |
| 1754 | */ |
| 1755 | #ifdef __APPLE__ |
| 1756 | // macOS: VSync gets disabled if the window is 100% covered by another window. Let's add a (crude) fix: |
| 1757 | if (minimized || !(windowFlags & SDL_WINDOW_INPUT_FOCUS)) |
| 1758 | hpc_Wait(&video.vblankHpc); |
| 1759 | #elif __unix__cxx . . $ `<built-in>:399:9`! |
| 1760 | // *NIX: VSync gets disabled in fullscreen mode (at least on some distros/systems). Let's add a fix: |
| 1761 | if (minimized || videocxx . . $ video..fullscreencxx . . $ video_t#fullscreen.) |
| 1762 | hpc_Waitcxx . . $ hpc_Wait(efacbc4df292ea9a).(&videocxx . . $ video..vblankHpccxx . . $ video_t#vblankHpc.); |
| 1763 | #else |
| 1764 | if (minimized) |
| 1765 | hpc_Wait(&video.vblankHpc); |
| 1766 | #endif |
| 1767 | } |
| 1768 | |
| 1769 | editorcxx . . $ editor..framesPassedcxx . . $ editor_t#framesPassed.++; |
| 1770 | |
| 1771 | /* Reset audio/video sync timestamp every half an hour to prevent |
| 1772 | ** possible sync drifting after hours of playing a song without |
| 1773 | ** a single song stop (resets timestamp) in-between. |
| 1774 | */ |
| 1775 | if (editorcxx . . $ editor..framesPassedcxx . . $ editor_t#framesPassed. >= VBLANK_HZcxx . . $ `src/pt2_header.h:58:9`!*60*30) |
| 1776 | audiocxx . . $ audio..resetSyncTickTimeFlagcxx . . $ audio_t#resetSyncTickTimeFlag. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1777 | } |
| 1778 | |
| 1779 | void updateSpectrumAnalyzercxx . . $ updateSpectrumAnalyzer(2b0f6589498b1c50).(uint8_tcxx . . $ uint8_t# vol, uint16_tcxx . . $ uint16_t# period) |
| 1780 | { |
| 1781 | if (uicxx . . $ ui..visualizerModecxx . . $ ui_t#visualizerMode. != VISUAL_SPECTRUMcxx . . $ VISUAL_SPECTRUM. || vol == 0) |
| 1782 | return; |
| 1783 | |
| 1784 | /* This routine is buggy in real PT. Behavior for periods outside of 108..907 is undefined. |
| 1785 | ** Behavior for sane input outside of 113..856 (B-3 finetune > 0 and C-1 finetune < 0) |
| 1786 | ** seems to be defined, and we simulate this. |
| 1787 | */ |
| 1788 | if (period < 108 || period > 907) |
| 1789 | return; // we don't really know what to do here |
| 1790 | |
| 1791 | // C-1 with finetune < 0 is ignored (confirmed behavior) |
| 1792 | if (period > 856) |
| 1793 | return; |
| 1794 | |
| 1795 | // B-3 with finetune > 0 behaves like finetune 0 (confirmed behavior) |
| 1796 | if (period < 113) |
| 1797 | period = 113; |
| 1798 | |
| 1799 | // just in case |
| 1800 | if (vol > 64) |
| 1801 | vol = 64; |
| 1802 | |
| 1803 | const uint8_tcxx . . $ uint8_t# vol24 = (vol * 24) >> 6; // 0..64 -> 0..24 |
| 1804 | |
| 1805 | // convert period from log (113..856) to linear (0..22) |
| 1806 | period = (856 - 113) - (period - 113); // 0..743 (inverted) |
| 1807 | const uint32_tcxx . . $ uint32_t# index = (period * period) / 25093; // 0..22 (25093 = round[743^2 / 22]) |
| 1808 | |
| 1809 | // increment bar |
| 1810 | editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[index] += vol24; |
| 1811 | if (editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[index] > SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!) |
| 1812 | editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[index] = SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!; |
| 1813 | |
| 1814 | // increment left and right neighbor bars with half the volume |
| 1815 | |
| 1816 | if (index > 0) |
| 1817 | { |
| 1818 | editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[index-1] += vol24 / 2; |
| 1819 | if (editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[index-1] > SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!) |
| 1820 | editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[index-1] = SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!; |
| 1821 | } |
| 1822 | |
| 1823 | if (index < SPECTRUM_BAR_NUMcxx . . $ `src/pt2_header.h:79:9`!-1) |
| 1824 | { |
| 1825 | editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[index+1] += vol24 / 2; |
| 1826 | if (editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[index+1] > SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!) |
| 1827 | editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[index+1] = SPECTRUM_BAR_HEIGHTcxx . . $ `src/pt2_header.h:80:9`!; |
| 1828 | } |
| 1829 | } |
| 1830 | |
| 1831 | void sinkVisualizerBarscxx . . $ sinkVisualizerBars(49f6e7a06ebc5aa8).(void) // sinks visualizer bars |
| 1832 | { |
| 1833 | // sink VU-meters |
| 1834 | for (int32_tcxx . . $ int32_t# i = 0; i < PAULA_VOICEScxx . . $ `src/pt2_paula.h:13:9`!; i++) |
| 1835 | { |
| 1836 | if (editorcxx . . $ editor..vuMeterVolumescxx . . $ editor_t#vuMeterVolumes.[i] > 0) |
| 1837 | editorcxx . . $ editor..vuMeterVolumescxx . . $ editor_t#vuMeterVolumes.[i]--; |
| 1838 | } |
| 1839 | |
| 1840 | // sink "spectrum analyzer" bars |
| 1841 | for (int32_tcxx . . $ int32_t# i = 0; i < SPECTRUM_BAR_NUMcxx . . $ `src/pt2_header.h:79:9`!; i++) |
| 1842 | { |
| 1843 | if (editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[i] > 0) |
| 1844 | editorcxx . . $ editor..spectrumVolumescxx . . $ editor_t#spectrumVolumes.[i]--; |
| 1845 | } |
| 1846 | } |
| 1847 | |
| 1848 | void updateRenderSizeVarscxx . . $ updateRenderSizeVars(49f6e7a06ebc5aa8).(void) |
| 1849 | { |
| 1850 | SDL_DisplayModecxx . . $ SDL_DisplayMode# dm; |
| 1851 | |
| 1852 | int32_tcxx . . $ int32_t# di = SDL_GetWindowDisplayIndexcxx . . $ SDL_GetWindowDisplayIndex(71e995ed7857f42c).(videocxx . . $ video..windowcxx . . $ video_t#window.); |
| 1853 | if (di < 0) |
| 1854 | di = 0; // return display index 0 (default) on error |
| 1855 | |
| 1856 | SDL_GetDesktopDisplayModecxx . . $ SDL_GetDesktopDisplayMode(c98af550b5d771cf).(di, &dm); |
| 1857 | videocxx . . $ video..displayWcxx . . $ video_t#displayW. = dm.wcxx . . $ SDL_DisplayMode#w.; |
| 1858 | videocxx . . $ video..displayHcxx . . $ video_t#displayH. = dm.hcxx . . $ SDL_DisplayMode#h.; |
| 1859 | |
| 1860 | SDL_GetWindowSizecxx . . $ SDL_GetWindowSize(9db8dd3ac7233d99).(videocxx . . $ video..windowcxx . . $ video_t#window., &videocxx . . $ video..windowWcxx . . $ video_t#windowW., &videocxx . . $ video..windowHcxx . . $ video_t#windowH.); |
| 1861 | videocxx . . $ video..renderXcxx . . $ video_t#renderX. = 0; |
| 1862 | videocxx . . $ video..renderYcxx . . $ video_t#renderY. = 0; |
| 1863 | |
| 1864 | videocxx . . $ video..useCustomRenderRectcxx . . $ video_t#useCustomRenderRect. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1865 | |
| 1866 | if (videocxx . . $ video..fullscreencxx . . $ video_t#fullscreen.) |
| 1867 | { |
| 1868 | if (configcxx . . $ config..fullScreenStretchcxx . . $ config_t#fullScreenStretch.) |
| 1869 | { |
| 1870 | // "streched out" windowed fullscreen |
| 1871 | |
| 1872 | videocxx . . $ video..renderWcxx . . $ video_t#renderW. = videocxx . . $ video..windowWcxx . . $ video_t#windowW.; |
| 1873 | videocxx . . $ video..renderHcxx . . $ video_t#renderH. = videocxx . . $ video..windowHcxx . . $ video_t#windowH.; |
| 1874 | } |
| 1875 | else |
| 1876 | { |
| 1877 | // centered windowed fullscreen, with pixel-perfect integer upscaling |
| 1878 | |
| 1879 | const int32_tcxx . . $ int32_t# maxUpscaleFactor = MINcxx . . $ `src/pt2_helpers.h:34:9`!(video.windowW / SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!, video.windowH / SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!); |
| 1880 | videocxx . . $ video..renderWcxx . . $ video_t#renderW. = SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! * maxUpscaleFactor; |
| 1881 | videocxx . . $ video..renderHcxx . . $ video_t#renderH. = SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`! * maxUpscaleFactor; |
| 1882 | videocxx . . $ video..renderXcxx . . $ video_t#renderX. = (videocxx . . $ video..windowWcxx . . $ video_t#windowW. - videocxx . . $ video..renderWcxx . . $ video_t#renderW.) / 2; |
| 1883 | videocxx . . $ video..renderYcxx . . $ video_t#renderY. = (videocxx . . $ video..windowHcxx . . $ video_t#windowH. - videocxx . . $ video..renderHcxx . . $ video_t#renderH.) / 2; |
| 1884 | |
| 1885 | // get hi-DPI upscale factors (returns 1.0 if no hi-DPI upscaling) |
| 1886 | int32_tcxx . . $ int32_t# widthInPixels, heightInPixels; |
| 1887 | SDL_GL_GetDrawableSizecxx . . $ SDL_GL_GetDrawableSize(9db8dd3ac7233d99).(videocxx . . $ video..windowcxx . . $ video_t#window., &widthInPixels, &heightInPixels); |
| 1888 | double dHiDPIScaleX = (double)widthInPixels / videocxx . . $ video..windowWcxx . . $ video_t#windowW.; |
| 1889 | double dHiDPIScaleY = (double)heightInPixels / videocxx . . $ video..windowHcxx . . $ video_t#windowH.; |
| 1890 | |
| 1891 | videocxx . . $ video..renderRectcxx . . $ video_t#renderRect..xcxx . . $ SDL_Rect#x. = (int32_tcxx . . $ int32_t#)floorcxx . . $ floor(447c67c6676f75c3).(videocxx . . $ video..renderXcxx . . $ video_t#renderX. * dHiDPIScaleX); |
| 1892 | videocxx . . $ video..renderRectcxx . . $ video_t#renderRect..ycxx . . $ SDL_Rect#y. = (int32_tcxx . . $ int32_t#)floorcxx . . $ floor(447c67c6676f75c3).(videocxx . . $ video..renderYcxx . . $ video_t#renderY. * dHiDPIScaleY); |
| 1893 | videocxx . . $ video..renderRectcxx . . $ video_t#renderRect..wcxx . . $ SDL_Rect#w. = (int32_tcxx . . $ int32_t#)floorcxx . . $ floor(447c67c6676f75c3).(videocxx . . $ video..renderWcxx . . $ video_t#renderW. * dHiDPIScaleX); |
| 1894 | videocxx . . $ video..renderRectcxx . . $ video_t#renderRect..hcxx . . $ SDL_Rect#h. = (int32_tcxx . . $ int32_t#)floorcxx . . $ floor(447c67c6676f75c3).(videocxx . . $ video..renderHcxx . . $ video_t#renderH. * dHiDPIScaleY); |
| 1895 | videocxx . . $ video..useCustomRenderRectcxx . . $ video_t#useCustomRenderRect. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; // use the destination coordinates above in SDL_RenderCopy() |
| 1896 | } |
| 1897 | } |
| 1898 | else |
| 1899 | { |
| 1900 | // windowed mode |
| 1901 | |
| 1902 | SDL_GetWindowSizecxx . . $ SDL_GetWindowSize(9db8dd3ac7233d99).(videocxx . . $ video..windowcxx . . $ video_t#window., &videocxx . . $ video..renderWcxx . . $ video_t#renderW., &videocxx . . $ video..renderHcxx . . $ video_t#renderH.); |
| 1903 | } |
| 1904 | |
| 1905 | // "hardware mouse" calculations |
| 1906 | videocxx . . $ video..mouseCursorUpscaleFactorcxx . . $ video_t#mouseCursorUpscaleFactor. = MINcxx . . $ `src/pt2_helpers.h:34:9`!(video.renderW / SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!, video.renderH / SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!); |
| 1907 | createMouseCursorscxx . . $ createMouseCursors(c9857a73d68e59ba).(); |
| 1908 | } |
| 1909 | |
| 1910 | void toggleFullscreencxx . . $ toggleFullscreen(49f6e7a06ebc5aa8).(void) |
| 1911 | { |
| 1912 | videocxx . . $ video..fullscreencxx . . $ video_t#fullscreen. ^= 1; |
| 1913 | if (videocxx . . $ video..fullscreencxx . . $ video_t#fullscreen.) |
| 1914 | SDL_SetWindowFullscreencxx . . $ SDL_SetWindowFullscreen(aa8a99d7247a1caa).(videocxx . . $ video..windowcxx . . $ video_t#window., SDL_WINDOW_FULLSCREEN_DESKTOPcxx . . $ SDL_WINDOW_FULLSCREEN_DESKTOP.); |
| 1915 | else |
| 1916 | SDL_SetWindowFullscreencxx . . $ SDL_SetWindowFullscreen(aa8a99d7247a1caa).(videocxx . . $ video..windowcxx . . $ video_t#window., 0); |
| 1917 | |
| 1918 | SDL_Delaycxx . . $ SDL_Delay(cb2f890c2fdad230).(15); // fixes possible issues |
| 1919 | |
| 1920 | updateRenderSizeVarscxx . . $ updateRenderSizeVars(49f6e7a06ebc5aa8).(); |
| 1921 | updateMouseScalingcxx . . $ updateMouseScaling(49f6e7a06ebc5aa8).(); |
| 1922 | |
| 1923 | if (videocxx . . $ video..fullscreencxx . . $ video_t#fullscreen.) |
| 1924 | { |
| 1925 | mousecxx . . $ mouse..setPosXcxx . . $ mouse_t#setPosX. = videocxx . . $ video..displayWcxx . . $ video_t#displayW. / 2; |
| 1926 | mousecxx . . $ mouse..setPosYcxx . . $ mouse_t#setPosY. = videocxx . . $ video..displayHcxx . . $ video_t#displayH. / 2; |
| 1927 | } |
| 1928 | else |
| 1929 | { |
| 1930 | mousecxx . . $ mouse..setPosXcxx . . $ mouse_t#setPosX. = videocxx . . $ video..renderWcxx . . $ video_t#renderW. / 2; |
| 1931 | mousecxx . . $ mouse..setPosYcxx . . $ mouse_t#setPosY. = videocxx . . $ video..renderHcxx . . $ video_t#renderH. / 2; |
| 1932 | } |
| 1933 | |
| 1934 | mousecxx . . $ mouse..setPosFlagcxx . . $ mouse_t#setPosFlag. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1935 | } |
| 1936 | |
| 1937 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! setupVideocxx . . $ setupVideo(c9857a73d68e59ba).(void) |
| 1938 | { |
| 1939 | if (configcxx . . $ config..autoFitVideoScalecxx . . $ config_t#autoFitVideoScale.) |
| 1940 | { |
| 1941 | int8_tcxx . . $ int8_t# i; |
| 1942 | SDL_DisplayModecxx . . $ SDL_DisplayMode# dm; |
| 1943 | |
| 1944 | int32_tcxx . . $ int32_t# di = SDL_GetWindowDisplayIndexcxx . . $ SDL_GetWindowDisplayIndex(71e995ed7857f42c).(videocxx . . $ video..windowcxx . . $ video_t#window.); |
| 1945 | if (di < 0) |
| 1946 | di = 0; // return display index 0 (default) on error |
| 1947 | |
| 1948 | // find out which upscaling factor is the biggest to fit on screen |
| 1949 | if (SDL_GetDesktopDisplayModecxx . . $ SDL_GetDesktopDisplayMode(c98af550b5d771cf).(di, &dm) == 0) |
| 1950 | { |
| 1951 | for (i = MAX_UPSCALE_FACTORcxx . . $ `src/pt2_visuals.h:8:9`!; i >= 1; i--) |
| 1952 | { |
| 1953 | // height test is slightly taller because of window title, window borders and taskbar/menu/dock |
| 1954 | if (dm.wcxx . . $ SDL_DisplayMode#w. >= SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!*i && dm.hcxx . . $ SDL_DisplayMode#h. >= (SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!+64)*i) |
| 1955 | { |
| 1956 | configcxx . . $ config..videoScaleFactorcxx . . $ config_t#videoScaleFactor. = i; |
| 1957 | break; |
| 1958 | } |
| 1959 | } |
| 1960 | |
| 1961 | if (i == 0) |
| 1962 | configcxx . . $ config..videoScaleFactorcxx . . $ config_t#videoScaleFactor. = 1; // 1x is not going to fit, but use 1x anyways... |
| 1963 | } |
| 1964 | else |
| 1965 | { |
| 1966 | // couldn't get screen resolution, set to 1x |
| 1967 | configcxx . . $ config..videoScaleFactorcxx . . $ config_t#videoScaleFactor. = 1; |
| 1968 | } |
| 1969 | } |
| 1970 | |
| 1971 | int32_tcxx . . $ int32_t# screenW = SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! * configcxx . . $ config..videoScaleFactorcxx . . $ config_t#videoScaleFactor.; |
| 1972 | int32_tcxx . . $ int32_t# screenH = SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`! * configcxx . . $ config..videoScaleFactorcxx . . $ config_t#videoScaleFactor.; |
| 1973 | |
| 1974 | uint32_tcxx . . $ uint32_t# rendererFlags = 0; |
| 1975 | |
| 1976 | SDL_DisplayModecxx . . $ SDL_DisplayMode# dm; |
| 1977 | |
| 1978 | int32_tcxx . . $ int32_t# di = SDL_GetWindowDisplayIndexcxx . . $ SDL_GetWindowDisplayIndex(71e995ed7857f42c).(videocxx . . $ video..windowcxx . . $ video_t#window.); |
| 1979 | if (di < 0) |
| 1980 | di = 0; // return display index 0 (default) on error |
| 1981 | |
| 1982 | SDL_GetDesktopDisplayModecxx . . $ SDL_GetDesktopDisplayMode(c98af550b5d771cf).(di, &dm); |
| 1983 | videocxx . . $ video..dMonitorRefreshRatecxx . . $ video_t#dMonitorRefreshRate. = (double)dm.refresh_ratecxx . . $ SDL_DisplayMode#refresh_rate.; |
| 1984 | |
| 1985 | videocxx . . $ video..vsync60HzPresentcxx . . $ video_t#vsync60HzPresent. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 1986 | if (!configcxx . . $ config..vsyncOffcxx . . $ config_t#vsyncOff.) |
| 1987 | { |
| 1988 | if (dm.refresh_ratecxx . . $ SDL_DisplayMode#refresh_rate. >= 59 && dm.refresh_ratecxx . . $ SDL_DisplayMode#refresh_rate. <= 61) |
| 1989 | { |
| 1990 | videocxx . . $ video..vsync60HzPresentcxx . . $ video_t#vsync60HzPresent. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 1991 | rendererFlags |= SDL_RENDERER_PRESENTVSYNCcxx . . $ SDL_RENDERER_PRESENTVSYNC.; |
| 1992 | } |
| 1993 | } |
| 1994 | |
| 1995 | uint32_tcxx . . $ uint32_t# windowFlags = SDL_WINDOW_HIDDENcxx . . $ SDL_WINDOW_HIDDEN. | SDL_WINDOW_ALLOW_HIGHDPIcxx . . $ SDL_WINDOW_ALLOW_HIGHDPI.; |
| 1996 | |
| 1997 | #ifndef SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITORcxx . . $ `<external>/10713713676398969957/SDL_hints.h:2493:9`! |
| 1998 | /* older SDL2 versions don't define this, don't fail the build for it */ |
| 1999 | #define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" |
| 2000 | #endif |
| 2001 | SDL_SetHintcxx . . $ SDL_SetHint(f203032a27c3eb90).(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITORcxx . . $ `<external>/10713713676398969957/SDL_hints.h:2493:9`!, "0"); |
| 2002 | |
| 2003 | videocxx . . $ video..windowcxx . . $ video_t#window. = SDL_CreateWindowcxx . . $ SDL_CreateWindow(2360bbcd09caf609).("", SDL_WINDOWPOS_CENTEREDcxx . . $ `<external>/14887343297790812595/SDL_video.h:147:9`!, |
| 2004 | SDL_WINDOWPOS_CENTEREDcxx . . $ `<external>/14887343297790812595/SDL_video.h:147:9`!, screenW, screenH, windowFlags); |
| 2005 | |
| 2006 | if (videocxx . . $ video..windowcxx . . $ video_t#window. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 2007 | { |
| 2008 | showErrorMsgBoxcxx . . $ showErrorMsgBox(326aeb464d16410c).("Couldn't create SDL window:\n%s", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 2009 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 2010 | } |
| 2011 | |
| 2012 | videocxx . . $ video..renderercxx . . $ video_t#renderer. = SDL_CreateRenderercxx . . $ SDL_CreateRenderer(3b1a735a7ee9eed5).(videocxx . . $ video..windowcxx . . $ video_t#window., -1, rendererFlags); |
| 2013 | if (videocxx . . $ video..renderercxx . . $ video_t#renderer. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 2014 | { |
| 2015 | if (videocxx . . $ video..vsync60HzPresentcxx . . $ video_t#vsync60HzPresent.) // try again without vsync flag |
| 2016 | { |
| 2017 | videocxx . . $ video..vsync60HzPresentcxx . . $ video_t#vsync60HzPresent. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 2018 | rendererFlags &= ~SDL_RENDERER_PRESENTVSYNCcxx . . $ SDL_RENDERER_PRESENTVSYNC.; |
| 2019 | videocxx . . $ video..renderercxx . . $ video_t#renderer. = SDL_CreateRenderercxx . . $ SDL_CreateRenderer(3b1a735a7ee9eed5).(videocxx . . $ video..windowcxx . . $ video_t#window., -1, rendererFlags); |
| 2020 | } |
| 2021 | |
| 2022 | if (videocxx . . $ video..renderercxx . . $ video_t#renderer. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 2023 | { |
| 2024 | showErrorMsgBoxcxx . . $ showErrorMsgBox(326aeb464d16410c).("Couldn't create SDL renderer:\n%s\n\n" \ |
| 2025 | "Is your GPU (+ driver) too old?", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 2026 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 2027 | } |
| 2028 | } |
| 2029 | |
| 2030 | SDL_SetRenderDrawBlendModecxx . . $ SDL_SetRenderDrawBlendMode(d6266a2a2fc6d527).(videocxx . . $ video..renderercxx . . $ video_t#renderer., SDL_BLENDMODE_NONEcxx . . $ SDL_BLENDMODE_NONE.); |
| 2031 | |
| 2032 | if (configcxx . . $ config..pixelFiltercxx . . $ config_t#pixelFilter. == PIXELFILTER_LINEARcxx . . $ PIXELFILTER_LINEAR.) |
| 2033 | SDL_SetHintcxx . . $ SDL_SetHint(f203032a27c3eb90).("SDL_RENDER_SCALE_QUALITY", "linear"); |
| 2034 | else if (configcxx . . $ config..pixelFiltercxx . . $ config_t#pixelFilter. == PIXELFILTER_BESTcxx . . $ PIXELFILTER_BEST.) |
| 2035 | SDL_SetHintcxx . . $ SDL_SetHint(f203032a27c3eb90).("SDL_RENDER_SCALE_QUALITY", "best"); |
| 2036 | else |
| 2037 | SDL_SetHintcxx . . $ SDL_SetHint(f203032a27c3eb90).("SDL_RENDER_SCALE_QUALITY", "nearest"); |
| 2038 | |
| 2039 | videocxx . . $ video..texturecxx . . $ video_t#texture. = SDL_CreateTexturecxx . . $ SDL_CreateTexture(5c677e94b60cfdf3).(videocxx . . $ video..renderercxx . . $ video_t#renderer., SDL_PIXELFORMAT_ARGB8888cxx . . $ SDL_PIXELFORMAT_ARGB8888., SDL_TEXTUREACCESS_STREAMINGcxx . . $ SDL_TEXTUREACCESS_STREAMING., SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!, SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!); |
| 2040 | if (videocxx . . $ video..texturecxx . . $ video_t#texture. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 2041 | { |
| 2042 | showErrorMsgBoxcxx . . $ showErrorMsgBox(326aeb464d16410c).("Couldn't create %dx%d GPU texture:\n%s\n\n" \ |
| 2043 | "Is your GPU (+ driver) too old?", SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`!, SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`!, SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 2044 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 2045 | } |
| 2046 | |
| 2047 | SDL_SetTextureBlendModecxx . . $ SDL_SetTextureBlendMode(616c2aee5045da4c).(videocxx . . $ video..texturecxx . . $ video_t#texture., SDL_BLENDMODE_NONEcxx . . $ SDL_BLENDMODE_NONE.); |
| 2048 | |
| 2049 | // frame buffer used by SDL (for texture) |
| 2050 | videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer. = (uint32_tcxx . . $ uint32_t# *)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(SCREEN_Wcxx . . $ `src/pt2_header.h:41:9`! * SCREEN_Hcxx . . $ `src/pt2_header.h:42:9`! * sizeof (int32_tcxx . . $ int32_t#)); |
| 2051 | if (videocxx . . $ video..frameBuffercxx . . $ video_t#frameBuffer. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 2052 | { |
| 2053 | showErrorMsgBoxcxx . . $ showErrorMsgBox(326aeb464d16410c).("Out of memory!"); |
| 2054 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 2055 | } |
| 2056 | |
| 2057 | updateRenderSizeVarscxx . . $ updateRenderSizeVars(49f6e7a06ebc5aa8).(); |
| 2058 | updateMouseScalingcxx . . $ updateMouseScaling(49f6e7a06ebc5aa8).(); |
| 2059 | |
| 2060 | if (configcxx . . $ config..hwMousecxx . . $ config_t#hwMouse.) |
| 2061 | SDL_ShowCursorcxx . . $ SDL_ShowCursor(7864480464b09eea).(SDL_TRUEcxx . . $ SDL_TRUE.); |
| 2062 | else |
| 2063 | SDL_ShowCursorcxx . . $ SDL_ShowCursor(7864480464b09eea).(SDL_FALSEcxx . . $ SDL_FALSE.); |
| 2064 | |
| 2065 | SDL_SetRenderDrawColorcxx . . $ SDL_SetRenderDrawColor(5e8a934d568bc2e).(videocxx . . $ video..renderercxx . . $ video_t#renderer., 0, 0, 0, SDL_ALPHA_OPAQUEcxx . . $ `<external>/13773327968391986473/SDL_pixels.h:46:9`!); |
| 2066 | |
| 2067 | dFrameDurationDivcxx . . $ dFrameDurationDiv. = (1000.0 * FPS_SCAN_FRAMEScxx . . $ `src/pt2_visuals.c:50:9`!) / hpcFreqcxx . . $ hpcFreq..dFreqMulMscxx . . $ $anonymous_type_f41cb469dd1dca50_0#dFreqMulMs.; |
| 2068 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 2069 | } |