diff --git a/resource/CMakeResources.cmake b/resource/CMakeResources.cmake index 920886b6f..41b64972e 100644 --- a/resource/CMakeResources.cmake +++ b/resource/CMakeResources.cmake @@ -43,7 +43,7 @@ function(add_resources out_var id) string(APPEND content_cpp_private "// ${in_f_bin}\n" "extern unsigned char ${symbol}[]\;\n" - "extern int ${symbol}_len\;\n" + "extern unsigned int ${symbol}_len\;\n" "\n") string(APPEND content_cpp_public " {${resource_id}, {${symbol}, ${symbol}_len}},\n") diff --git a/source/ParallelPrinter.cpp b/source/ParallelPrinter.cpp index b1c0eb906..f0418bfa3 100644 --- a/source/ParallelPrinter.cpp +++ b/source/ParallelPrinter.cpp @@ -77,13 +77,14 @@ void ParallelPrinterCard::ClosePrint(void) { fclose(m_file); m_file = NULL; +#ifdef _WIN32 std::string ExtendedFileName = "copy \""; ExtendedFileName.append (ParallelPrinterCard::GetFilename()); ExtendedFileName.append ("\" prn"); //if (g_bDumpToPrinter) ShellExecute(NULL, "print", Printer_GetFilename(), NULL, NULL, 0); //Print through Notepad if (m_bDumpToPrinter) system (ExtendedFileName.c_str ()); //Print through console. This is supposed to be the better way, because it shall print images (with older printers only). - +#endif } m_inactivity = 0; } diff --git a/source/frontends/sdl/imgui/sdldebugger.cpp b/source/frontends/sdl/imgui/sdldebugger.cpp index 4c911b0b4..fb128824e 100644 --- a/source/frontends/sdl/imgui/sdldebugger.cpp +++ b/source/frontends/sdl/imgui/sdldebugger.cpp @@ -52,7 +52,15 @@ namespace // the latter comes from https://fontstruct.com/fontstructions/show/1912741/debug6502 switch (ch) { - case 0x00 ... 0x1F: // mouse text -> U+00C0 + case 0x00: case 0x01: case 0x02: case 0x03: + case 0x04: case 0x05: case 0x06: case 0x07: + case 0x08: case 0x09: case 0x0A: case 0x0B: + case 0x0C: case 0x0D: case 0x0E: case 0x0F: + case 0x10: case 0x11: case 0x12: case 0x13: + case 0x14: case 0x15: case 0x16: case 0x17: + case 0x18: case 0x19: case 0x1A: case 0x1B: + case 0x1C: case 0x1D: case 0x1E: case 0x1F: + // mouse text -> U+00C0 *out = 0xC3; ++out; *out = 0x80 + (ch - 0x00); @@ -62,7 +70,11 @@ namespace ++out; *out = 0xBF; break; - case 0x80 ... 0x8F: // bookmarks, not currently used -> U+00F0 + case 0x80: case 0x81: case 0x82: case 0x83: + case 0x84: case 0x85: case 0x86: case 0x87: + case 0x88: case 0x89: case 0x8A: case 0x8B: + case 0x8C: case 0x8D: case 0x8E: case 0x8F: + // bookmarks, not currently used -> U+00F0 *out = 0xC3; ++out; *out = 0xB0 + (ch - 0x80); diff --git a/source/frontends/sdl/processfile.cpp b/source/frontends/sdl/processfile.cpp index e0536d8f4..c2fdebaac 100644 --- a/source/frontends/sdl/processfile.cpp +++ b/source/frontends/sdl/processfile.cpp @@ -21,7 +21,7 @@ namespace { return std::any_of( valid.begin(), valid.end(), [filename](const char *ext) - { return strlen(filename) > strlen(ext) && !strcasecmp(filename + strlen(filename) - strlen(ext), ext); }); + { return strlen(filename) > strlen(ext) && !_stricmp(filename + strlen(filename) - strlen(ext), ext); }); } bool checkExtension(sa2::SDLFrame *frame, const char *filename, const std::vector &valid) diff --git a/source/frontends/sdl/sdlframe.cpp b/source/frontends/sdl/sdlframe.cpp index b05d716e9..5b7add665 100644 --- a/source/frontends/sdl/sdlframe.cpp +++ b/source/frontends/sdl/sdlframe.cpp @@ -91,7 +91,12 @@ namespace ch = 0x09; break; } - case SDLK_a ... SDLK_z: + case SDLK_a: case SDLK_b: case SDLK_c: case SDLK_d: case SDLK_e: + case SDLK_f: case SDLK_g: case SDLK_h: case SDLK_i: case SDLK_j: + case SDLK_k: case SDLK_l: case SDLK_m: case SDLK_n: case SDLK_o: + case SDLK_p: case SDLK_q: case SDLK_r: case SDLK_s: case SDLK_t: + case SDLK_u: case SDLK_v: case SDLK_w: case SDLK_x: case SDLK_y: + case SDLK_z: { // same logic as AW // CAPS is forced when the emulator starts @@ -576,9 +581,23 @@ namespace sa2 const char key = text.text[0]; switch (key) { - case 0x20 ... 0x40: - case 0x5b ... 0x60: - case 0x7b ... 0x7e: + // 0x20 ... 0x40 + case 0x20: case 0x21: case 0x22: case 0x23: + case 0x24: case 0x25: case 0x26: case 0x27: + case 0x28: case 0x29: case 0x2A: case 0x2B: + case 0x2C: case 0x2D: case 0x2E: case 0x2F: + case 0x30: case 0x31: case 0x32: case 0x33: + case 0x34: case 0x35: case 0x36: case 0x37: + case 0x38: case 0x39: case 0x3A: case 0x3B: + case 0x3C: case 0x3D: case 0x3E: case 0x3F: + case 0x40: + + // 0x5B ... 0x60 + case 0x5B: case 0x5C: case 0x5D: case 0x5E: + case 0x5F: case 0x60: + + // 0x7B ... 0x7E + case 0x7B: case 0x7C: case 0x7D: case 0x7E: { // not the letters // this is very simple, but one cannot handle CRTL-key combination. @@ -655,8 +674,7 @@ namespace sa2 const int sh = video.GetFrameBufferBorderlessHeight(); // initialise with defaults - common2::Geometry actual = { - .width = sw * 2, .height = sh * 2, .x = SDL_WINDOWPOS_UNDEFINED, .y = SDL_WINDOWPOS_UNDEFINED}; + common2::Geometry actual = {sw * 2, sh * 2, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED}; // add registry information loadGeometryFromRegistry("sa2", actual); diff --git a/source/linux/duplicates/Keyboard.cpp b/source/linux/duplicates/Keyboard.cpp index 737a0e2b8..917f717b8 100644 --- a/source/linux/duplicates/Keyboard.cpp +++ b/source/linux/duplicates/Keyboard.cpp @@ -30,19 +30,15 @@ void addTextToBuffer(const char *text) { while (*text) { - switch (*text) - { - case '\n': + if (*text == '\n') { addKeyToBuffer(0x0d); - break; } - case 0x20 ... 0x7e: + else if (*text >= 0x20 && *text <= 0x7e) { addKeyToBuffer(*text); - break; - } } + // skip non ASCII characters ++text; } } diff --git a/source/linux/paddle.cpp b/source/linux/paddle.cpp index 8f88b60b6..879f9dff7 100644 --- a/source/linux/paddle.cpp +++ b/source/linux/paddle.cpp @@ -6,6 +6,8 @@ #include "CPU.h" #include "CopyProtectionDongles.h" +#include + namespace { unsigned __int64 g_nJoyCntrResetCycle = 0; // Abs cycle that joystick counters were reset