scratch
libgamearchive
Our great sponsors
scratch | libgamearchive | |
---|---|---|
51 | 1 | |
333 | 21 | |
- | - | |
9.0 | 10.0 | |
2 days ago | over 6 years ago | |
C | C++ | |
The Unlicense | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
scratch
- Windows XP dedicated image viewer?
-
What Happens Before the Main Function is Called ?
pbmview, an image viewer (windows subsystem).
-
A couple freestanding parsers in C99
For comparison (for those following along): https://github.com/skeeto/scratch/blob/master/parsers/qoi.c https://github.com/skeeto/scratch/blob/master/parsers/ini.c
- (POSIX) theory and practice of the useless use of cat
- [2023-05-19] Challenge #400 [Intermediate] Practical Numbers
-
Difference in accuracy when compiling in windows and linux
Another option I learned a couple years ago is embedding a UTF-8 manifest ([details])[https://github.com/skeeto/scratch/tree/master/libwinsane]. Also put the console in UTF-8 mode (SetConsoleOutputCP(CP_UTF8)), and you're done. Works on Windows 10 and later. This covers everything: argv is UTF-8 and fopen accepts UTF-8 paths. (This is exactly how CRTs should have worked all along.)
-
I made this small program in C :)
I was thinking more about this and I realized it's quite easy to do it in arbitrary precision, so here's my take: https://github.com/skeeto/scratch/blob/master/misc/bswap.c
-
Beside SDL, is there an easier way to just show a custom rectangle with text, cross-platform?
As was linked from my QOI article, here's my full decoder with comments: qoi.c. Each pixel decodes to a 32-bit integer, ABGR. That corresponds to SDL's SDL_PIXELFORMAT_ABGR8888. SDL_UpdateTexture copies that data into the texture's internal storage, and font is no longer needed. (In a real program I'd allocate it in a scratch arena, reset after initialization.)
-
GitHub - pmkenned/pmk_string: A simple string library in C
A recent, interesting experience with function+context allocation: For more than a decade, Windows accidentally exposed part of zlib in a public DLL, and (overly-)clever applications can exploit this as a "system zlib." Though it doesn't export the "end" functions, so cleanup seems impossible. However, custom allocation works, so doesn't matter. I plugged it into an arena.
- decompressing a .deflate file?
libgamearchive
-
What's the GLB file format?
A rewrite was also sorely needed, even without changing the language. One of the "mistakes" I made with the C++ architecture of libgamearchive for example, was to try to modify archive files in-place, as opposed to writing a new archive file out from scratch and then moving it over the top of the original file. While it can be significantly quicker editing in-place, it introduces a huge amount of complexity and to be honest, the amount of time spent debugging problems caused by this is just not worth it. The compression and encryption algorithms as well, they are streaming so work whether you write one byte at a time or one megabyte at a time (and will process terabytes of data without issue), but having them track what point they are up to across multiple calls like that adds a huge amount of complexity (just look at all the case statements in the Monster Bash RLE encoder so the function can resume at the correct point in subsequent calls). So regardless of language, it was due for a major refactor anyway as continuing with this amount of complexity was just not worth the headaches it brings. Especially on today's hardware, writing out a 40 MB .GRP file from scratch will take well under a second, so spending hours, sometimes days, debugging write-in-place problems just isn't worth the benefit.
What are some alternatives?
w64devkit - Portable C and C++ Development Kit for x64 (and x86) Windows
busybox-w32 - WIN32 native port of BusyBox.
studiojs - Web interface for editing DOS games
BUSY - BUSY is a lean, statically typed, cross-platform, easily bootstrappable build system for GCC, CLANG and MSVC inspired by Google GN
gameinfojs - High level interface to the functionality provided by the other game* libraries
PSCalendar - :calendar: A set of PowerShell commands for displaying calendars in the console.
stb - stb single-file public domain libraries for C/C++
cimgui - c-api for imgui (https://github.com/ocornut/imgui) Look at: https://github.com/cimgui for other widgets
gamearchivejs - Read and write archive files used by DOS games
gamecompjs - Apply and remove compression and encryption algorithms used by DOS games