FlohOfWoe Profile Banner
Andre Weissflog Profile
Andre Weissflog

@FlohOfWoe

Followers
9K
Following
65K
Media
3K
Statuses
45K

Sokol Headers, Chips Emulators, Oryol, Nebula Device, Drakensang, C, C++, Zig, Python, WASM... @[email protected] https://t.co/kOX3LYuRzS

Joined April 2013
Don't wanna be here? Send us removal request.
@FlohOfWoe
Andre Weissflog
7 years
alright, pretty big update to the Tiny Emulators page: new KC85/2 family emulators, more subtypes for the existing emulators, more file loading support, more games (mostly KC85 stuff), and the emulator git branches merged back to master:. #WebAssembly
Tweet media one
Tweet media two
Tweet media three
Tweet media four
7
35
199
@FlohOfWoe
Andre Weissflog
1 year
. but it will live forever in software ;).
Tweet media one
@mike_acton
Mike Acton
1 year
The legendary Zilog Z80 CPU is being discontinued after nearly 50 years.
8
153
1K
@FlohOfWoe
Andre Weissflog
6 years
Alright! perfect6502 simulation hooked up to the chip visualization running though the visual6502 standard test program at one half-cycle per frame :D. Time to start with the UI :). (cc @pagetable )
12
225
1K
@FlohOfWoe
Andre Weissflog
3 years
@kettlecorn @natfriedman . or as the saying goes "Poor planning on your part does not necessitate an emergency on mine.". This should be the first thing hammered into the mind of newbies. There are very rare actual emergencies where staying late may be justified. Made-up deadlines are not an emergency.
0
20
629
@FlohOfWoe
Andre Weissflog
7 years
I finally finished that blog post of how I'm using handles instead of raw- or smart-pointers in my C and C++ code, probably not very exciting for veteran coders, but hopefully useful for everyone not yet aware of the "C++ smart-pointer trap" ;).
19
125
539
@FlohOfWoe
Andre Weissflog
6 months
Stuff like this is why I'm so excited about Zig :D (screenshot blatantly stolen from the spirv-backend channel on the Zig Discord).
Tweet media one
18
37
458
@FlohOfWoe
Andre Weissflog
6 years
I wrote a new blog post "Modern C for C++ Peeps":. Not the post about header-only libs I had in mind originally, that's still lying around half-finished. The post above was a lot easier to write in one sitting :).
26
131
398
@FlohOfWoe
Andre Weissflog
2 years
Box2D is moving from pointers to handles, and from C++ to C :).
14
36
401
@FlohOfWoe
Andre Weissflog
1 year
@DanielcHooper TBH, even machine code is a high level abstraction compared to what a CPU does internally (e.g. assembly code is a high level language which provides the illusion that instructions are processed in order).
5
12
366
@FlohOfWoe
Andre Weissflog
7 months
God I fucking hate AI. So much work wasted with bullshit features instead of actually improving VSCode.
Tweet media one
13
17
317
@FlohOfWoe
Andre Weissflog
2 years
If you think cmake sucks, wait until you need to work with Gradle, compared to that cmake is a marvel of engineering (just had to vent a bit sorry).
29
13
308
@FlohOfWoe
Andre Weissflog
4 months
Ok, this is pretty cool, Doom in Ghostty via Kitty Graphics Protocol as mixed Zig/C project (and it even has sound, can't record that on Mac though):.
12
24
308
@FlohOfWoe
Andre Weissflog
6 years
OMG looks like it's possible to render the Visual6502 data set with Dear ImGui at a smooth frame rate! And that's just a quick adhoc experiment without any optimizations. I think the next steps are inevitable :D. (cc @ocornut)
8
27
251
@FlohOfWoe
Andre Weissflog
5 years
a really nice and comprehensive rant of everything that's wrong with "modern UI design", with examples.
19
74
242
@FlohOfWoe
Andre Weissflog
7 years
new blog post, wherein I contemplate about a year of writing C code: .
13
93
245
@FlohOfWoe
Andre Weissflog
1 year
Btw @ocornut, not sure if it's a first, but here's Dear Imgui running in a VSCode tab :D
Tweet media one
5
15
244
@FlohOfWoe
Andre Weissflog
1 year
AI chat tools would be alot less creepy (and time-wasting) if they would give short and crisp answers instead of that overly talkative "American" conversation style. A simple: "No/yes, because: . ". would do. Give me a "German Engineer" conversation style option please.
18
13
225
@FlohOfWoe
Andre Weissflog
10 months
Should've listened ;).
@molecularmusing
Stefan Reinalter
11 months
Hey @CrowdStrike , if you think you need to inject yourself into other processes, could you please do this without crashing them?.This has happened to several of my customers, without them knowing what's going on. Fix this!. Signed,.Windows Developers
Tweet media one
2
22
210
@FlohOfWoe
Andre Weissflog
7 years
a bare bones C64 emu written in C99, compiled to #WebAssembly in under 64K (43 KB WASM + 15 KB JS, compressed download size), sokol_app.h + sokol_gfx.h + sokol_time.h + 8-bit chip headers:
Tweet media one
5
71
196
@FlohOfWoe
Andre Weissflog
2 years
Interesting: the included line count of <vector> in Clang is roughly "C++ version * 1kloc" (via clang -E -std=c++. ):. C++11: 12810.C++14: 13870.C++17: 16905.C++20: 23127. C++20 is clearly ahead of its time :D.
17
12
201
@FlohOfWoe
Andre Weissflog
5 years
Whoop whoop, Dear ImGui running on top of Chrome's current #WebGPU implementation via emscripten/WASM and sokol_app.h + sokol_gfx.h :D. A bit of code cleanup, then I should be able to put up a little sokol-samples-on-WebGPU preview page over the weekend :)
Tweet media one
5
15
198
@FlohOfWoe
Andre Weissflog
1 year
One of the many things that Rust and C++ have in common is that Rust peeps are just as quick to dismiss Zig as C++ peeps used to dismiss C. That sort of closed-mindedness never pays off in the long run 🙄.
25
15
192
@FlohOfWoe
Andre Weissflog
6 years
482 lines of (shader) code, no data, absolutely mindblowing. Most 3D APIs need more code to put a simple triangle on screen :D.
@iquilezles
inigo quilez
6 years
A procedural animated creature, raymarched SDF as usual in @Shadertoy. It's a first basic attempt to some character animation. Live-Stream with the Making-of and QA soon! In the meanwhile, source code:
2
27
192
@FlohOfWoe
Andre Weissflog
5 years
Very cool interactive Dear ImGui "manual":.
3
51
187
@FlohOfWoe
Andre Weissflog
8 years
nice, a Tomb Raider engine written in a ‘C-with-classes’ C++ style compiled via emscripten into 180 KByte asm.js:
1
90
180
@FlohOfWoe
Andre Weissflog
1 year
Now it's getting ridiculous.
26
15
183
@FlohOfWoe
Andre Weissflog
6 years
TL;DR: Never, ever expose a C++ API though a DLL, instead wrap your C++ API into a C API.
@CppLibHunt
C++ LibHunt
6 years
20 ABI (Application Binary Interface) breaking changes every C++ developer should know
8
30
176
@FlohOfWoe
Andre Weissflog
8 months
God-f*cking-dammit stop being such a f*cking security nazi macOS! >:(
Tweet media one
23
4
178
@FlohOfWoe
Andre Weissflog
5 years
Impressive "from scratch" game written in C (using the sokol headers for platform abstraction)!. Playable WASM link is in the README:.
4
42
173
@FlohOfWoe
Andre Weissflog
5 years
If you're a new programmer please don't fall for bullshit like this:. typing code into the machine is the least important aspect of programming (there *is* a bit of an argument for "staying in flow" though: not thinking about typing while doing it).
23
22
154
@FlohOfWoe
Andre Weissflog
6 years
Wow, with one can build simple installable Electron/WPA-style apps (with WebGL, WASM etc) in a single 27 KB(!) exe (on macOS), that's insane. Uses the system's browser engine instead of a Chromium+Node.js runtime.
Tweet media one
5
40
165
@FlohOfWoe
Andre Weissflog
8 years
animation system debugging. visualization is everything :)
6
32
166
@FlohOfWoe
Andre Weissflog
5 years
All 6502-based Tiny Emus now support stepping by single cycles in the CPU debugger, very useful for debugging the video system, interrupt timing etc. Not yet for Z80 systems because Z80 emu isn't cycle-stepped yet. Webpage also updated:
6
48
162
@FlohOfWoe
Andre Weissflog
7 months
@jakubtomsu_ That's why I always roll eyes when people want a 'simple string type' in programming languages. All you get from that splendid idea is code that *looks* simple on the surface but in reality just hides unspeakable horrors below.
6
6
168
@FlohOfWoe
Andre Weissflog
1 year
Friendship ended with iTerm2. Now wezterm is my new best friend. (seriously iTerm2. AI integration???).
17
13
152
@FlohOfWoe
Andre Weissflog
5 months
C64 emulator running in (ghostty) terminal via the Kitty graphics protocol :) Right after start it seems to run too slow, but there's a couple of options to make the pixel transfer more efficient (currently it's very naive code) (cc @mitchellh)
7
11
166
@FlohOfWoe
Andre Weissflog
4 years
It's 2021 and Windows takes several minutes to unzip a 60MB archive🙄
Tweet media one
25
8
147
@FlohOfWoe
Andre Weissflog
1 year
Amiga's Intuition UI library had an interesting twist on named and optional parameters in C (via varargs):
Tweet media one
12
11
153
@FlohOfWoe
Andre Weissflog
10 years
Classic Pixar texture library going free (updated with bump and normal maps):
0
103
147
@FlohOfWoe
Andre Weissflog
6 years
I figured that running the assembler on each keystroke probably burns 100x fewer cycles than that same keystroke cost so far traveling up to my code through all the OS layers, so ¯\_(ツ)_/¯
8
20
142
@FlohOfWoe
Andre Weissflog
3 years
"Blinkenlights is a command line debugger that focuses on visualizing how software changes memory.". \o/.Why is it always underfunded individuals who move computing forward, while big organizations mostly just flail around helplessly?.
4
19
141
@FlohOfWoe
Andre Weissflog
1 year
The Rust jihadists have planted a mole in the White House :D.
@m1guelpf
Miguel Piedrafita ✨
1 year
C is now illegal.
9
9
142
@FlohOfWoe
Andre Weissflog
4 years
Ooooh WASM debugging via DWARF works now in Chrome Canary (most notable improvement over source-map debugging is that symbol names and structs are properly resolved). Debug-stepping is pretty slow though, esp the view-panel redrawing takes forever.
Tweet media one
5
19
145
@FlohOfWoe
Andre Weissflog
1 year
Remember kids: in a C++ source file which includes stdlib headers, your own code is just a tiny little piece dangling off at the bottom. (what's up with modules btw, weren't those supposed to be the silver bullet?).
@wenzeljakob
Wenzel Jakob {deprecation notice}
1 year
What's going on with LLVM's libc++ project? I noticed yesterday that the header file containing std::vector<> expands to 2 to 2.4 megabytes of pre-processed header code! (of which >99% is overhead) This . .
10
10
146
@FlohOfWoe
Andre Weissflog
5 years
"immediate mode" async-await-style coding :D
Tweet media one
8
7
145
@FlohOfWoe
Andre Weissflog
5 years
I created a minimal standalone starter-project for Dear ImGui apps written in C for Windows, Linux and macOS (via cimgui and the sokol headers):. Yeah, cmake, I know. but Windows'n stuff. I tried to keep it as simple as possible though.
Tweet media one
14
20
143
@FlohOfWoe
Andre Weissflog
7 years
very cool: clang compiled to WebAssembly running in browser, compiling C++ programs to WebAssembly, and run the result in browser, a bit like @mattgodbolt's but without server: (discussion thread: .
1
65
144
@FlohOfWoe
Andre Weissflog
7 years
I must say the more I code in plain C the less I miss C++, C has this almost python-like simplicity and "smoothness" to it, and there is never this "which of the thousand C++ features is the right one for this situation" anxiety. .
8
24
137
@FlohOfWoe
Andre Weissflog
11 months
Wow nice, in today's Safari Technology Preview upate on Mac (Release 197), the sokol-gfx WebGPU samples suddenly started working (cc @SebAaltonen maybe also interesting to check your WebGPU renderer with this version).
Tweet media one
4
10
149
@FlohOfWoe
Andre Weissflog
7 months
Visual Studio is adding all that Copilot crap, but at the same time still can't figure out that a source file with a .c file extension probably isn't a C++ file. (to be clear that's unrelated to Copilot, but rather about priorities)
Tweet media one
7
7
139
@FlohOfWoe
Andre Weissflog
1 year
It's really quite bizarre how switching from Win10+MSVC to Linux with KDE and a GCC toolchain feels like a beefy hardware upgrade. On Windows+MSVC it's "geez I *really* need a new laptop", on Linux+KDE it's "nah, still fine".
19
5
140
@FlohOfWoe
Andre Weissflog
10 months
This is really cool (a WebGPU shadertoy using Dear ImGui as UI):.
4
25
145
@FlohOfWoe
Andre Weissflog
8 months
Not sure how I missed that brilliant @aras_p blog post. interesting points about over-abstracting and the "zero cost abstraction myth":.
7
30
141
@FlohOfWoe
Andre Weissflog
3 years
What's really nice about Zig is that the whole toolchain is in a 40-ish MB download archive which has exactly one executable (zig) in the root directory, and it "just works" after unpacking without running scripts or setting up env-variables. Just run. /path/to/zig build.
10
5
124
@FlohOfWoe
Andre Weissflog
6 years
Trace logger in "Visual6502 Remix" working now, each log item is the full chip state and the first 4 KB of memory, and it's possible to go back in time. The UI stuff for this is all so super-simple and pleasant with Dear ImGui :). WASM version here:
7
29
137
@FlohOfWoe
Andre Weissflog
9 months
Here's finally the Zig blog post I promised two weeks ago:. Had to get that out of my system though for being able to focus on sokol stuff again ;).
4
20
134
@FlohOfWoe
Andre Weissflog
5 years
Nice short article detailing the differences between C99 and C++20 designated initialization (also a nice example of how C++ takes a wonderfully simple, flexible and intuitive C feature and applies the "C++ treatment", essentially removing those three attributes ;).
@meetingcpp
Meeting C++
5 years
C++20 designated initializers.#cpp.#cplusplus.
6
20
130
@FlohOfWoe
Andre Weissflog
7 years
Without people who "pirated" the games I made in the 80's, and later digitized the cassette tapes and "illegally" put them on the internet I wouldn't be able to put them on a web page for everyone to play now. The games would be lost since my own tapes are no longer readable :/.
2
30
124
@FlohOfWoe
Andre Weissflog
1 year
An actually nuanced article about C, Rust and memory safety by a "security dude". Did somebody check if hell froze over yet? :).(haven't read the whole thing yet, will do now).
9
21
136
@FlohOfWoe
Andre Weissflog
1 year
@matiasgoldberg This got to be a joke right?
Tweet media one
3
4
130
@FlohOfWoe
Andre Weissflog
4 years
\o/. This is a C++ command line tool with fairly complex dependencies (SPIRV-Tools,glslang, SPIRVCross, . ) compiled with Zig as C++ toolchain and build system. WIP build.zig script (a straight port from cmake, and a bit adhoc cobbled together:
Tweet media one
6
13
128
@FlohOfWoe
Andre Weissflog
5 years
That's some next-level C99 shit right there :D
Tweet media one
11
13
126
@FlohOfWoe
Andre Weissflog
4 years
Good read, quite accurately reflects my own view of Rust and Zig, and also written in a refreshingly "non-extremist" style:.
7
17
121
@FlohOfWoe
Andre Weissflog
4 months
New attempt to run emulator in terminal via Kitty Graphics Protocol, this time in #Zig via libvaxis, works really well (in Ghostty or Kitty terminal at least). Repo:
3
11
132
@FlohOfWoe
Andre Weissflog
2 years
"zero-cost exception model" they said. .
6
4
117
@FlohOfWoe
Andre Weissflog
4 years
Zig is basically fixing decades old C/C++ tooling problems as a side quest :D. (Rust should take note, this is how you lure C/C++ coders into your camp). #ziglang.
5
16
118
@FlohOfWoe
Andre Weissflog
11 months
I guess this is a perfect example of "if all you have is a hammer, every problem looks like a nail":.
14
2
123
@FlohOfWoe
Andre Weissflog
4 years
Phew, slowly getting there with the sokol_app.h multiwindow stuff. Still a lot of work ahead so don't hold your breath ;). The Dear ImGui viewport mode is basically the "required feature reference".
6
8
121
@FlohOfWoe
Andre Weissflog
5 years
I started working on the WebGPU backend for sokol_gfx.h, not much to see yet, but I'll track the work in this PR if anyone is interesting in learning how I go about adding a new backend to sokol-gfx:. I almost feel a little bit excited :).
8
13
123
@FlohOfWoe
Andre Weissflog
5 years
First printed presentation of the binary number system, 350 years old (and not by Leibnitz, but a "Juan Caramuel y Lobkowitz"). If it weren't for the Latin, this could also be taken from an old computer manual :). (via @nyquist64).
Tweet media one
4
36
111
@FlohOfWoe
Andre Weissflog
5 years
well that Raspi4 desktop experience is shockingly delightful for a computer that costs as much as a video game. there's a few things I need to fix in my workflow because the @code C/C++ extension doesn't support ARM, so I need to use different plugins, but otherwise great!
Tweet media one
10
8
116
@FlohOfWoe
Andre Weissflog
2 years
So Baldur's Gate 3 apparently is completely DRM free even on Steam? This game really destroys all the "established" PC gaming business myths :). (if you're not aware yet, BG3 has an insane CCU which is still growing, despite being a hardcore single-player-focused RPG )
Tweet media one
4
9
106
@FlohOfWoe
Andre Weissflog
1 year
The sokol readme header just got a lot nicer thanks to @jakubtomsu_ :)
Tweet media one
6
3
113
@FlohOfWoe
Andre Weissflog
5 years
I started a new min-blog-series looking in detail at the different sokol_gfx.h backends (first: GL). A bit "dry" and more like a reference, but might be useful for getting an idea how expensive certain things are in sokol_gfx.h in the different backends:.
3
21
111
@FlohOfWoe
Andre Weissflog
2 years
I wrote a blog post how to make WASM debugging work for browser apps with Emscripten and VSCode starting from scratch with an empty project directory:.
4
19
115
@FlohOfWoe
Andre Weissflog
4 years
Ok, I've added some intro documentation to the code and consider Pacman.c "done" now (might do another run over the code comments though). It's not a complete replica of arcade Pacman, but "good enough". WASM version, link to C source is bottom-left:.
Tweet media one
5
20
110
@FlohOfWoe
Andre Weissflog
4 years
What a funny coincidence: Apparently GTA Online takes 2 minute to parses a 10 MByte JSON file :D.
4
29
104
@FlohOfWoe
Andre Weissflog
5 years
why is a Windows keyboard driver 380 MBytes.
26
11
99
@FlohOfWoe
Andre Weissflog
4 years
Interesting, I wasn't aware that @Blender is mostly written in C. Some C++ sources sprinkled inbetween, but all behind C-APIs. Might be a good study case of how to structure a big C project:.
5
8
106
@FlohOfWoe
Andre Weissflog
5 months
Rewrote the Dear ImGui settings persistency to use LocalStorage instead of IndexedDB. No more stutter on save, much less and simpler code, and the settings are inspectable in the browser devtools. win-win-win :).
Tweet media one
1
9
102
@FlohOfWoe
Andre Weissflog
6 years
I wonder what's worse for global warming, Javascript or Bitcoin mining ;).
3
17
94
@FlohOfWoe
Andre Weissflog
4 years
"Goto Considered Harmful" my ass :D
Tweet media one
12
7
94
@FlohOfWoe
Andre Weissflog
2 years
Sokol samples (well, most of them) running on WebGPU (still very wip though, and still in a branch), needs Chrome on macOS or Windows:. (a bit more info over on Mastodon:
Tweet media one
4
9
102
@FlohOfWoe
Andre Weissflog
2 years
sokol-gfx WebGPU backend has been merged => see the other side for details:.
Tweet media one
5
9
98
@FlohOfWoe
Andre Weissflog
5 years
itshappening.gif \o/.
9
20
102
@FlohOfWoe
Andre Weissflog
1 year
The fact that .at() even exists and is allowed to exist for so long (instead of fixing operator[]) is a pretty good indicator of how broken the C++ standardization process is :/.
@meetingcpp
Meeting C++
1 year
Tip of the Week #224: Avoid vector .at().#cpp.#cplusplus.
15
3
101
@FlohOfWoe
Andre Weissflog
2 years
Lol, unbelievable. Musk is turning Twitter into Soviet Union 2.0
Tweet media one
5
7
90
@FlohOfWoe
Andre Weissflog
5 years
. when your C++ coders would rather be Lisp coders. (I pity the poor sod who needs to debug this one day). Found on r/programming.
15
15
93
@FlohOfWoe
Andre Weissflog
8 years
new blog post about sokol_gfx.h (minimal dependency-free, header-only 3D-API wrapper in C):
5
26
86
@FlohOfWoe
Andre Weissflog
4 years
Every discussion about immediate mode UIs should start with:. - no, "immediate mode" does *not* mean that calling a "button" function immediately draws that button.- yes, immediate mode UIs can keep any amount state between frames.- yes, widgets can have stable identifiers. 😩.
12
6
92
@FlohOfWoe
Andre Weissflog
5 years
The same is true for moving from C++ to C, but in the entirely opposite direction than C++ to Rust ;). (essentially, realizing that data should be "dumb" and not "smart", and that a lot of data in an application can and should have "static lifetime").
@funcOfJoe
J☁e Duffy
5 years
OH:. "After writing 10KLOC of Rust, I've become a much better C++ programmer. And that's having written C++ for over 15 years.". Rust's lifetime model reshapes the way your brain fundamentally approaches data structures and algorithms. Rust boot camp for all!.
3
13
94
@FlohOfWoe
Andre Weissflog
4 years
This looks like a nice example of how to organize a non-trivial C project:.
7
7
93
@FlohOfWoe
Andre Weissflog
2 years
New blog post about the soon-to-be-released WebGPU backend in sokol_gfx.h:. (yeah I really need to blog more frequently again).
4
13
94
@FlohOfWoe
Andre Weissflog
6 years
this is awesome, goes step by step from a simple one-liner to interesting small 'physics doodles':.
0
26
90
@FlohOfWoe
Andre Weissflog
6 years
Looks like somebody wrote an honest-to-god 6502 + Apple I emulator in shadertoy (the real deal, not just a "fake" BASIC terminal like the previous "C64 in shadertoy"). The interesting parts of the CPU emulation seem to be in "Buffer A" and "Buffer C":.
3
29
90
@FlohOfWoe
Andre Weissflog
5 years
@tumult I've been thinking for a while that the key to a really "slick" computing experience is running old software on new computers. It didn't occur to me that running old software in an emulator on new hardware is still faster than running new software on new hardware ;).
4
4
84
@FlohOfWoe
Andre Weissflog
5 years
I just merged a new utility header "sokol_shape.h" for quickly creating simple shape geometries and plugging them into sokol_gfx.hl, along with a few new samples. Header is here: Samples with source code are here:.
Tweet media one
Tweet media two
Tweet media three
3
10
87
@FlohOfWoe
Andre Weissflog
5 years
Finally a rational explanation why UIs have regressed so much in recent years :D.
@vzverovich
https://mastodon.social/@vitaut
5 years
@blu51899890 @FlohOfWoe They ran an A/B test that showed an increase in site usage while people were desperately trying to figure out where their shit went.
4
20
80
@FlohOfWoe
Andre Weissflog
7 years
I just stumbled over an incredible series of blog posts of the inner workings of the Z80 CPU, most detailed I found so far, builds on the die analysis work by Ken Shirriff:
4
25
84
@FlohOfWoe
Andre Weissflog
5 years
Using WASM outside the browser has become delightfully simple, and the "runtime" is just a single self-contained 7 MB executable (the other handful of installed files are things like readme, license, changelog. ).
Tweet media one
4
12
92