Skip to content

Instantly share code, notes, and snippets.

View lethal-guitar's full-sized avatar

Nikolai Wuttke lethal-guitar

View GitHub Profile
@lethal-guitar
lethal-guitar / settings.md
Last active October 23, 2021 21:39
Reverse-engineered jumper settings for bit-design PCELC V1.3 EGA + ELD graphics card

TL;DR - how to set it up as regular EGA

Set jumpers as follows:

  • J4: Unset
  • J5: 2-3
  • J6: Unset
  • J7: 1-2
  • J8: 1-2 for EGA monitor, 2-3 for CGA/MDA monitor
@lethal-guitar
lethal-guitar / kill_mode.cpp
Created March 7, 2021 14:43
gptokeyb with kill mode
bool kill_mode = // ...
bool back_pressed = false;
bool start_pressed = false;
SDL_Event event;
bool running = true;
while (running) {
if (!SDL_WaitEvent(&event)) {
printf("SDL_WaitEvent() failed: %s\n", SDL_GetError());
return -1;
@lethal-guitar
lethal-guitar / Makefile
Last active January 10, 2021 19:15
Fullscreen text viewer
#
# Cross Platform Makefile
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
#
# You will need SDL2 (http://www.libsdl.org):
# Linux:
# apt-get install libsdl2-dev
# Mac OS X:
# brew install sdl2
# MSYS2:
@lethal-guitar
lethal-guitar / gist:b9b55313eba00085590c
Last active December 19, 2018 15:24
Truncate string with ellipsis in the middle (Qt)
#include <QString>
#include <cmath>
namespace {
const QString ELLIPSIS("...");
}
QString limitString(const QString& aString, int maxLength) {