<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mike/sst/src/build/codegen.c, branch v0.18-BETA</title>
<subtitle>Source Speedrun Tools: practice tools and handy features for Source Engine games</subtitle>
<id>https://qdb.woz.blue/mike/sst/atom?h=v0.18-BETA</id>
<link rel='self' href='https://qdb.woz.blue/mike/sst/atom?h=v0.18-BETA'/>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/'/>
<updated>2025-04-06T15:41:13+00:00</updated>
<entry>
<title>Rewrite and redesign codegen and feature system</title>
<updated>2025-04-06T15:41:13+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2025-03-10T02:37:19+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=244fea664121acf12871ab5858a5fe95a2606b52'/>
<id>urn:sha1:244fea664121acf12871ab5858a5fe95a2606b52</id>
<content type='text'>
Also switch to somewhat proper C23 flags while we're at it.

This is a huge change. It took me forever, in between being really busy.
Sorry about that. But the good news is I'm now free to start integrating
the various patches that have accumulated since last release. Well, at
least in between still being really busy. Gotta manage expectations.

The main benefit of introducing GAMESPECIFIC() is that features
that don't apply to a particular game no longer show up *at all*, and
less time is wasted on init. It also enables a cool optimisation wherein
unnecessary REQUIRE_GAMEDATA() checks can elided at compile time
whenever the gamedata is known up-front to always exist in supported
games.

The DEF_FEAT_CVAR macro family meanwhile makes it easier to manage the
lifecycle of cvars/ccmds, with less manual registering, unhiding and
such.

Originally I was going to try and just hack these features into the
existing codegen abomination, but it just got too terrible. This rewrite
should make it easier to continue tweaking codegen behaviour in future.
It also has slightly better error messages.
</content>
</entry>
<entry>
<title>Revise syntax macros and add a ton of branch hints</title>
<updated>2024-08-23T19:37:37+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2024-08-03T22:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=83da606072ce272eb053d4e1497d77e647cfecae'/>
<id>urn:sha1:83da606072ce272eb053d4e1497d77e647cfecae</id>
<content type='text'>
My new programming style is branch hints. All non-confusing branches
must be hinted when I can be bothered. It's faster, sometimes, maybe.

Also, start trying to use more signed sizes in at least some of the
places where it makes sense. Unsigned sizes are surprisingly
error-prone!
</content>
</entry>
<entry>
<title>Get things at least compiling under Linux</title>
<updated>2023-08-26T23:46:09+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2023-08-20T15:20:03+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=a1998f2f7ce4153d670e2e5cb5018366517cc1ca'/>
<id>urn:sha1:a1998f2f7ce4153d670e2e5cb5018366517cc1ca</id>
<content type='text'>
Nothing really works yet, but at least test.h and fastspin are fixed and
some of the issues with RTTI and libdl and stuff are maybe kind of
sorted, subject to more testing later.

The main issue now seems to be the cvar interface not quite lining up
and crashing pretty much immediately. That'll probably take a lot more
debugging to figure out, which likely still won't be a priority for
quite a while.
</content>
</entry>
<entry>
<title>Make various preparations for upcoming features</title>
<updated>2023-08-02T20:02:31+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2023-07-29T13:32:06+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=9a0d8730fa977f666b5c12e4c5901e7d0391e245'/>
<id>urn:sha1:9a0d8730fa977f666b5c12e4c5901e7d0391e245</id>
<content type='text'>
A lot of this is random WIP from a while back, at least a month ago, and
is being committed now to get it out of the way so that other patches
can be brought in and integrated against it without causing headaches.

Also rolled into this commit is a way to distinguish plugin_unload from
exiting the game. This is required for another soon-to-be-integrated
feature to avoid crashing on exit, and could in theory also be used to
speed up unloading on exit in future. While we're at it, this also
avoids the need to linearly scan through the plugin list to do the
old branch unloading fix, because we can.

Rough summary of the other smaller stuff I can remember doing:
- Rework bitbuf a bit
- Add some cryptographic nonsense in ac.c (not final at all)
- Introduce the first couple of "chunklets" libraries as a sort-of
  subproject of this one
- Tidy up random small bits and bobs
- Add source for a small keypair generation tool
- Rework democustom to be very marginally more useful
</content>
</entry>
<entry>
<title>Tweak feature sorting and fix a chibicc bug</title>
<updated>2023-06-20T20:00:00+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2023-06-20T20:00:00+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=a86be4b76d96464e4bb9aa108d2c01198125084e'/>
<id>urn:sha1:a86be4b76d96464e4bb9aa108d2c01198125084e</id>
<content type='text'>
That sorting function was a bit wonky, so make it just a little bit
wonky instead. chibicc would produce confusing lex errors if given a
stray single quote somewhere, so make it give non-confusing errors.

Also get rid of canonicalize_newline() because it's unnecessary for SST
so long as Windows Git isn't left in its default misconfigured state.
</content>
</entry>
<entry>
<title>Refactor the RGBA colour struct into engineapi.h</title>
<updated>2023-05-04T22:49:27+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2023-05-02T18:16:22+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=5194eeb0e7bb5d2a2086c96ed04c2a47f9594d87'/>
<id>urn:sha1:5194eeb0e7bb5d2a2086c96ed04c2a47f9594d87</id>
<content type='text'>
In both the engine and SST it's used in more places than just console
printing, so it makes more sense to give it a more appropriate nanme and
location.
</content>
</entry>
<entry>
<title>Fix dumb oversight in codegen</title>
<updated>2022-09-20T22:47:11+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2022-09-20T22:47:11+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=f6fb10a7d3bfb59a729ee4b7a9368632ab52077a'/>
<id>urn:sha1:f6fb10a7d3bfb59a729ee4b7a9368632ab52077a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move towards C23, improve events and vcall macros</title>
<updated>2022-09-13T21:50:30+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2022-09-13T20:46:21+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=792463cb133f65645feb48743bbc03ef8eb96bdd'/>
<id>urn:sha1:792463cb133f65645feb48743bbc03ef8eb96bdd</id>
<content type='text'>
Another big one. Here's a list of things:

- Since the upcoming C23 standardises typeof(), use it as an extension
  for the time being in order to allow passing arbitrary types as
  macro/codegen parameters. It wouldn't have been a big leap to do this
  even without standardisation since it's apparently an easy extension
  to implement - and also, to be honest, this project is essentially glued
  to Clang anyway so who cares.

- Likewise, bool, true and false are becoming pre-defined, so
  pre-pre-define them now in order to get the benefit of not having to
  remember one header everywhere.

- Really ungodly/amazing vcall macro stuff now allows us to call C++
  virtual functions like regular C functions. It's pretty cool!

- Events can now take arbitrary parameters and come in two types:
  regular events and predicates.

All this makes the base code even uglier but makes the feature
implementation nicer. In other words, it places more of the cognitive
burden on myself and less on other people who might want to contribute.
This is a good tradeoff, because I'm a genius.
</content>
</entry>
<entry>
<title>Add magical feature codegen system, at long last</title>
<updated>2022-08-10T21:40:52+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2022-07-31T15:02:10+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=5e921bf59373d79d27c322ff86e8b5a37b151e45'/>
<id>urn:sha1:5e921bf59373d79d27c322ff86e8b5a37b151e45</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add event system</title>
<updated>2022-07-23T22:47:26+00:00</updated>
<author>
<name>Michael Smith</name>
<email>mikesmiffy128@gmail.com</email>
</author>
<published>2022-07-23T22:47:26+00:00</published>
<link rel='alternate' type='text/html' href='https://qdb.woz.blue/mike/sst/commit/?id=c8d7588251fd4fe63ac6afe2a90ca7066c786609'/>
<id>urn:sha1:c8d7588251fd4fe63ac6afe2a90ca7066c786609</id>
<content type='text'>
</content>
</entry>
</feed>
