Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resource/CMakeResources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion source/ParallelPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
16 changes: 14 additions & 2 deletions source/frontends/sdl/imgui/sdldebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source/frontends/sdl/processfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const char *> &valid)
Expand Down
30 changes: 24 additions & 6 deletions source/frontends/sdl/sdlframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 3 additions & 7 deletions source/linux/duplicates/Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 2 additions & 0 deletions source/linux/paddle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "CPU.h"
#include "CopyProtectionDongles.h"

#include <cmath>

namespace
{
unsigned __int64 g_nJoyCntrResetCycle = 0; // Abs cycle that joystick counters were reset
Expand Down
Loading