<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on markau.dev</title><link>https://markau.dev/posts/</link><description>Recent content in Posts on markau.dev</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>© 2025 Martin Kauppinen</copyright><lastBuildDate>Wed, 27 Aug 2025 15:31:42 +0200</lastBuildDate><atom:link href="https://markau.dev/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>X Marks the Macro</title><link>https://markau.dev/posts/x-marks-the-macro/</link><pubDate>Wed, 27 Aug 2025 15:31:42 +0200</pubDate><guid>https://markau.dev/posts/x-marks-the-macro/</guid><description>In this post I&amp;rsquo;d like to document a semi-obscure pattern that (ab)uses the C/C++ preprocessor to generate a bunch of code known as X-macros. Probably slightly more useful in C than C++ due to the latter being more featureful, having better ways of doing metaprogramming than using the preprocessor. So for this post I will stick to C.
Table of Contents The classic example Introducing the X Defining an enum Generating code Other example use cases Multiple arguments Macros as arguments Conclusion and further reading The classic example Imagine you have an enum representing different kinds of pet you might be allowed to own in your jurisdiction in legal_pets.</description></item><item><title>Roll Your Own GTest</title><link>https://markau.dev/posts/roll-your-own-gtest/</link><pubDate>Fri, 07 Feb 2025 22:22:37 +0100</pubDate><guid>https://markau.dev/posts/roll-your-own-gtest/</guid><description>Something I keep telling myself and others about when it comes to programming is &amp;ldquo;There is no such thing as magic&amp;rdquo;. By this I mean that anything you encounter in the world of programming can be understood. And you should try to make an effort to understand things that you currently don&amp;rsquo;t.
One such thing I&amp;rsquo;ve been thinking about is the GoogleTest framework for writing tests in C++. On the face of it, it&amp;rsquo;s pretty simple.</description></item><item><title>Integer Promotion was a Mistake</title><link>https://markau.dev/posts/integer-promotion-was-a-mistake/</link><pubDate>Wed, 18 Dec 2024 19:07:47 +0100</pubDate><guid>https://markau.dev/posts/integer-promotion-was-a-mistake/</guid><description>At work this week, I had to write a simple function (in C++) that was just supposed to pack eight uint8_ts into a single uint64_t. Extremely simple stuff, just a bunch of bit shifts and bitwise or-operations. But since this is C++-land, there&amp;rsquo;s footguns here too.
The function It looked a little something like this:
uint64_t packBytes(/*...*/) { auto packed = 0; packed |= byte0 &amp;lt;&amp;lt; 0; packed |= byte1 &amp;lt;&amp;lt; 8; packed |= byte2 &amp;lt;&amp;lt; 16; packed |= byte3 &amp;lt;&amp;lt; 24; packed |= byte4 &amp;lt;&amp;lt; 32; packed |= byte5 &amp;lt;&amp;lt; 40; packed |= byte6 &amp;lt;&amp;lt; 48; packed |= byte7 &amp;lt;&amp;lt; 56; return packed; } Looks pretty innocent, right?</description></item><item><title>Advent of Code 2024: Day 11</title><link>https://markau.dev/posts/aoc-2024-day-11/</link><pubDate>Wed, 11 Dec 2024 21:13:05 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-11/</guid><description>Code for solutions available on GitHub.
Plutonian Pebbles The out of memory saga.
Problem description The input is just a space-separated list of numbers:
0 1 10 99 999 They all represent stones in a row with said number each written on them. However, these stones are weird. Every time you blink, they change! But they remain in a line. They change according to one of three rules:
0s turn into 1s If a stone&amp;rsquo;s number has an even number of digits, it gets replaced by two stones.</description></item><item><title>Advent of Code 2024: Day 10</title><link>https://markau.dev/posts/aoc-2024-day-10/</link><pubDate>Tue, 10 Dec 2024 20:52:39 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-10/</guid><description>Code for solutions available on GitHub.
Hoof It Another grid day! This time the grid looks like this:
0123 1234 8765 9876 Each tile in the grid represents a height. We want to find paths that start at 0 and end at 9, but which only increment by 1 each step. Also, no diagonals.
Once again, I bust out the old Point struct. I also create a newtype around Vec&amp;lt;Vec&amp;lt;u8&amp;gt;&amp;gt; that I call Grid.</description></item><item><title>Advent of Code 2024: Day 09</title><link>https://markau.dev/posts/aoc-2024-day-09/</link><pubDate>Mon, 09 Dec 2024 20:17:01 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-09/</guid><description>Code for solutions available on GitHub.
Disk Fragmenter Time to fragment some files! We&amp;rsquo;re given a disk map, which is just a long string of digits kind of like this:
2333133121414131402 The digits alternate between representing files and free space, in a unit of blocks. So in the above example, the disk consists of a 2-block file, 3 blocks of free space, a 3-block file, 3 more blocks of free space, a 1-block file, etc.</description></item><item><title>Advent of Code 2024: Day 08</title><link>https://markau.dev/posts/aoc-2024-day-08/</link><pubDate>Sun, 08 Dec 2024 17:59:26 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-08/</guid><description>Code for solutions available on GitHub.
Resonant Collinearity Another grid puzzle today! We are given a grid of antennae, which transmit at a specific frequency (represented by a character). So in the following grid:
............ ........0... .....0...... .......0.... ....0....... ......A..... ............ ............ ........A... .........A.. ............ ............ There are 6 antennae operating on 2 frequencies: 0, and A. We need to find some nefarious devices places at specific antinodes based on the antenna frequencies.</description></item><item><title>Advent of Code 2024: Day 07</title><link>https://markau.dev/posts/aoc-2024-day-07/</link><pubDate>Sat, 07 Dec 2024 15:34:42 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-07/</guid><description>Code for solutions available on GitHub.
Bridge Repair What would an Advent of Code be without some dynamic programming at some point? For today&amp;rsquo;s input, we have a bunch of numbers like this:
190: 10 19 3267: 81 40 27 83: 17 5 156: 15 6 7290: 6 8 6 15 161011: 16 10 13 192: 17 8 14 21037: 9 7 18 13 292: 11 6 16 20 The first number in each line is the target.</description></item><item><title>Advent of Code 2024: Day 06</title><link>https://markau.dev/posts/aoc-2024-day-06/</link><pubDate>Fri, 06 Dec 2024 20:56:24 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-06/</guid><description>Code for solutions available on GitHub.
Guard Gallivant Ah, what would an Advent of Code be without a grid you have to walk through somehow. Today we have a grid of empty tiles (.) and obstacles (#), and the grid is patrolled by a guard (^). The guard is initially facing up and walks in a straight line. When they can&amp;rsquo;t walk forward due to an obstacle, they turn right and keep going.</description></item><item><title>Advent of Code 2024: Day 05</title><link>https://markau.dev/posts/aoc-2024-day-05/</link><pubDate>Thu, 05 Dec 2024 19:34:56 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-05/</guid><description>Code for solutions available on GitHub.
Print Queue Today&amp;rsquo;s puzzle is going to be a lesson in the power of implementing traits! But only in part 2. Part 1 I initially solved the more naïve way.
The lore involves a list of updates with page numbers and a set of page ordering rules, which each report must adhere to. The input is made up of two chunks and looks something like this:</description></item><item><title>Advent of Code 2024: Day 04</title><link>https://markau.dev/posts/aoc-2024-day-04/</link><pubDate>Wed, 04 Dec 2024 22:51:21 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-04/</guid><description>Code for solutions available on GitHub.
Ceres Search Ah, it&amp;rsquo;s time for the 2D array manipulation/searching task. And this time it&amp;rsquo;s a word search. We have to count the number of times the word &amp;ldquo;XMAS&amp;rdquo; appears in a grid like this:
MMMSXXMASM MSAMXMSMSA AMXSXMAAMM MSAMASMSMX XMASAMXAMM XXAMMXXAMA SMSMSASXSS SAXAMASAAA MAMMMXMMMM MXMXAXMASX The word can be horizontal, vertical, or diagonal. It can also be backwards or forwards. In the example above, &amp;ldquo;XMAS&amp;rdquo; occurs 18 times.</description></item><item><title>Advent of Code 2024: Day 03</title><link>https://markau.dev/posts/aoc-2024-day-03/</link><pubDate>Tue, 03 Dec 2024 22:14:50 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-03/</guid><description>Code for solutions available on GitHub.
Mull It Over Today we start getting into parsing instructions for some sort of virtual machine. The input looks something like this:
xmul(2,4)%&amp;amp;mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5)) and the task is to parse everything that looks like a multiplication instruction, execute the multiplication, and sum up all results. That is, parse and execute anything on the form mul(x,y), where x and y are 1-3 digit numbers. Anything not adhering to this format is not a valid instruction and should be ignored.</description></item><item><title>Advent of Code 2024: Day 02</title><link>https://markau.dev/posts/aoc-2024-day-02/</link><pubDate>Mon, 02 Dec 2024 20:26:33 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-02/</guid><description>Code for solutions available on GitHub.
Red-Nosed Reports The puzzle for today is pretty simple. The input is a list of sequences of numbers, like this:
7 6 4 2 1 1 2 7 8 9 9 7 6 2 1 1 3 2 4 5 8 6 4 4 1 1 3 6 7 9 The task for part 1 is to determine how many of these lines are safe.</description></item><item><title>Advent of Code 2024: Day 01</title><link>https://markau.dev/posts/aoc-2024-day-01/</link><pubDate>Sun, 01 Dec 2024 09:40:33 +0100</pubDate><guid>https://markau.dev/posts/aoc-2024-day-01/</guid><description>Another year, another Advent of Code. Same deal as last year. Code here. Diving straight into it.
Historian Hysteria The lore for this year is that we&amp;rsquo;re looking for the Chief Historian. Today we&amp;rsquo;re checking his office but he&amp;rsquo;s not there. What is there, though, is a bunch of notes about historically significant locations, each marked with an ID. The other historians split into two groups and each gathered a list of all these historical places and IDs.</description></item><item><title>Rust is a Scripting Language Now</title><link>https://markau.dev/posts/rust-is-a-scripting-language-now/</link><pubDate>Tue, 12 Mar 2024 20:36:38 +0100</pubDate><guid>https://markau.dev/posts/rust-is-a-scripting-language-now/</guid><description>I was talking with a friend, poking fun at a job ad that said they wanted experience in scripting languages such as bash, python, and golang.
After some more banter about compilied languages not being scripting languages, we realized that technically you could make golang seem like a scripting language. All you have to do is have a properly crafted shebang at the top of the file.
And of course I wanted to see if I could do something like that to make Rust seem like a scripting language.</description></item><item><title>Advent of Code 2023: Day 11</title><link>https://markau.dev/posts/aoc-2023-day-11/</link><pubDate>Mon, 11 Dec 2023 17:08:11 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-11/</guid><description>Code for solutions available on GitHub.
Still covid. Was slightly better a few hours ago, but getting worse from sitting at the computer. I probably shouldn&amp;rsquo;t be doing these puzzles. Or writing these posts.
Cosmic Expansion Thankfully, today was really simple. The input is a grid where some coordinates are marked. The twist is, every row and every column in the grid that does not have a mark, should actually be doubled.</description></item><item><title>Advent of Code 2023: Day 10</title><link>https://markau.dev/posts/aoc-2023-day-10/</link><pubDate>Mon, 11 Dec 2023 16:55:26 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-10/</guid><description>Code for solutions available on GitHub.
More covid-programming and -writing. Will be brief, especially because this day was pretty messy for me both in terms of health and code quality (They might be correlated).
Pipe Maze The input today represents a bunch of pipes or ground. Each pipe connects in exactly two of the cardinal directions, north, west, east, or south. No T-junctions here.
The first example given is a simple loop of pipes:</description></item><item><title>Advent of Code 2023: Day 09</title><link>https://markau.dev/posts/aoc-2023-day-09/</link><pubDate>Mon, 11 Dec 2023 16:46:44 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-09/</guid><description>Code for solutions available on GitHub.
Another post under the influence of covid. Like day 8, I&amp;rsquo;ll be brief.
Mirage Maintenance This is a pretty simple one. The input is a list of time sequences:
0 3 6 9 12 15 1 3 6 10 15 21 10 13 16 21 30 45 And our job is to predict the next number for each sequence and sum up the values of all predictions.</description></item><item><title>Advent of Code 2023: Day 08</title><link>https://markau.dev/posts/aoc-2023-day-08/</link><pubDate>Mon, 11 Dec 2023 16:15:42 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-08/</guid><description>Code for solutions available on GitHub.
The next couple of posts are delayed and will be shorter because I have managed to catch covid, and am not in the best state to be solving puzzles or writing many words. However, I will still summarize the solutions here, albeit with less detail both word-wise and code-wise.
Haunted Wasteland Today&amp;rsquo;s input consists of a list of a network of nodes, and their connections.</description></item><item><title>Advent of Code 2023: Day 07</title><link>https://markau.dev/posts/aoc-2023-day-07/</link><pubDate>Thu, 07 Dec 2023 17:30:41 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-07/</guid><description>Code for solutions available on GitHub.
Camel Cards Time to play some poker! Or, well, Camel Cards. In this game, you get a list of hands and the goal is to order these hands based on some criteria.
Each hand consists of 5 cards, labelled as a standard deck of cards: A,K,Q,J,T,9,8,7,6,5,4,3,2. The 10 card is labelled with a T. This makes parsing easier, as every card is represented by a single symbol.</description></item><item><title>Advent of Code 2023: Day 06</title><link>https://markau.dev/posts/aoc-2023-day-06/</link><pubDate>Wed, 06 Dec 2023 23:33:24 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-06/</guid><description>Code for solutions available on GitHub.
Wait For It This day was really easy. I actually initally solved it in about 15 minutes in the morning. At work. In Excel.
The input looks as follows:
Time: 7 15 30 Distance: 9 40 200 This represents 3 races of toy boats, where the time row is the total units of time the race lasts, and the distance row represents the record distance in the race.</description></item><item><title>Advent of Code 2023: Day 05</title><link>https://markau.dev/posts/aoc-2023-day-05/</link><pubDate>Wed, 06 Dec 2023 22:31:40 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-05/</guid><description>Code for solutions available on GitHub.
If You Give A Seed A Fertilizer Time for some gardening! Oh boy I spent some time optimizing part 2 of this one.
The input looks like this:
seeds: 79 14 55 13 seed-to-soil map: 50 98 2 52 50 48 soil-to-fertilizer map: 0 15 37 37 52 2 39 0 15 There&amp;rsquo;s 5 more x-to-y map: chunks, but I left them out for brevity.</description></item><item><title>Advent of Code 2023: Day 04</title><link>https://markau.dev/posts/aoc-2023-day-04/</link><pubDate>Wed, 06 Dec 2023 22:08:52 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-04/</guid><description>Code for solutions available on GitHub.
Scratchcards Time to play the lottery! This day, the input has the following shape:
Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53 Every line represents a scratchcard with an ID, a list of winning numbers, and the list of numbers the card has. A card has a score, calculated from the amount of numbers that match the winning numbers.</description></item><item><title>Advent of Code 2023: Day 03</title><link>https://markau.dev/posts/aoc-2023-day-03/</link><pubDate>Wed, 06 Dec 2023 21:32:08 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-03/</guid><description>Code for solutions available on GitHub.
Gear Ratios In this episode of Christmas coding, we&amp;rsquo;re tasked with finding some numbers in a grid. The lore is that the numbers are part identifiers or something like that. I don&amp;rsquo;t know, go read the lore yourself ;). I&amp;rsquo;m just chronicling the solving process.
The example grid is given as follows:
467..114.. ...*...... ..35..633. ......#... 617*...... .....+.58. ..592..... ......755. ...$.*.... .664.598.. Each number that is adjacent to a symbol that isn&amp;rsquo;t .</description></item><item><title>Advent of Code 2023: Day 02</title><link>https://markau.dev/posts/aoc-2023-day-02/</link><pubDate>Wed, 06 Dec 2023 20:59:30 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-02/</guid><description>Code for solutions available on GitHub.
This day will make use of the nom crate to parse the input into some data structures.
Cube Conundrum Today, the input is a list of games, where a game consists of an ID, and a set of rounds. Each rounds consists of pulling a number of red, green, and blue cubes out of a bag. Each line of the input has the following shape:</description></item><item><title>Advent of Code 2023: Day 01</title><link>https://markau.dev/posts/aoc-2023-day-01/</link><pubDate>Wed, 06 Dec 2023 19:53:18 +0100</pubDate><guid>https://markau.dev/posts/aoc-2023-day-01/</guid><description>Code for solutions available on GitHub.
I figured I would chronicle my solving of Advent of Code 2023. At least as far as I have time to solve it, and the energy to post about it. Posts may not appear on the day of the puzzle, and all puzzles may not be solved, but I&amp;rsquo;ll do my best. The puzzles can be found on the Advent of Code website. My solutions will be available on GitHub even if I don&amp;rsquo;t blog about them.</description></item><item><title>Linear Algebra with Const Generics</title><link>https://markau.dev/posts/linear-algebra-with-const-generics/</link><pubDate>Tue, 19 Sep 2023 15:46:26 +0200</pubDate><guid>https://markau.dev/posts/linear-algebra-with-const-generics/</guid><description>I was recently doing a project with some friends where we extracted the pixel data from RAW images. One step in extracting a picture from a RAW image is demosaicing, which boils down to doing some kind of convolution over the pixel intensities in the image with a convolution kernel defined by the color filter array. That&amp;rsquo;s when I had the idea to just tinker with creating a linear algebra/image processing library in Rust that utilizes const generics in order to encode some properties of matrices in the type system.</description></item><item><title>Take Care of Yourself</title><link>https://markau.dev/posts/take-care-of-yourself/</link><pubDate>Sun, 11 Jun 2023 19:29:10 +0200</pubDate><guid>https://markau.dev/posts/take-care-of-yourself/</guid><description>I recently had a 4-day weekend where I essentially did nothing but code. And even though I have a nice, supposedly ergonomic keyboard, bad static posture and extended sessions over several days will mess with your wrist and elbow. Remember to take breaks, shift your posture, and put the keyboard down every once in a while. No matter how interesting you find your current project.
I haven&amp;rsquo;t had any pain per se, but my right arm has been entirely unable to rest comfortably on the keyboard for the past few days.</description></item><item><title>Unboxing Moonlander</title><link>https://markau.dev/posts/unboxing-moonlander/</link><pubDate>Fri, 17 Feb 2023 17:18:20 +0100</pubDate><guid>https://markau.dev/posts/unboxing-moonlander/</guid><description>I recently bought a ZSA Moonlander, and it arrived today! Exactly two weeks after I ordered it, which is very speedily executed by ZSA. This post is essentially just a picture series of my unboxing of the keyboard. :)
Very urgent package
The package was labelled as &amp;ldquo;Extremely Urgent&amp;rdquo; on the outside. Given the 3-day shipping time from Taiwan to Sweden, it seems like this label actually did something. Also, since I brought a new thing into the house, the cat was naturally very curious.</description></item><item><title>CSS Overhaul</title><link>https://markau.dev/posts/css-overhaul/</link><pubDate>Thu, 09 Feb 2023 20:56:52 +0100</pubDate><guid>https://markau.dev/posts/css-overhaul/</guid><description>New year, new look! The risotto theme served me well, but I eventually got bored of it and decided to do a complete overhaul and write it all myself, from scratch. I feel like I have much more control this way to present the content exactly how I want. It was also an excuse to learn about dart and SASS.
I opted to make it a bit more spacious and legible.</description></item><item><title>Chesterton's Fence</title><link>https://markau.dev/posts/chestertons-fence/</link><pubDate>Mon, 30 Jan 2023 18:27:46 +0100</pubDate><guid>https://markau.dev/posts/chestertons-fence/</guid><description>A short post to tell a little cautionary tale about being too zealous with what you think should or shouldn&amp;rsquo;t exist in a code base.
At work today I ran into a small problem where I was doing some refactoring and to make a service talk to another service in a more efficient manner. The short of it is that my team&amp;rsquo;s service &amp;ndash; service-a &amp;ndash; tells another team&amp;rsquo;s service &amp;ndash; service-b to perform some action, and then service-b responds with an acknowledgement that the action was performed or rejected for some reason.</description></item><item><title>Assembly of the Mad</title><link>https://markau.dev/posts/assembly-of-the-mad/</link><pubDate>Tue, 29 Nov 2022 15:08:26 +0100</pubDate><guid>https://markau.dev/posts/assembly-of-the-mad/</guid><description>This past weekend, I participated in Glacier CTF, and had a lot of fun, though I did get stuck on a particular problem for far too long without managing to solve it. But I did have some fun attempting to do so! I suppose this post is both a cautionary tale to not get too hung up on what you think the way forward is (especially if you think the way forward is hand-writing x86 assembly), and a documentation of how to do syscalls manually in x86 assembly.</description></item><item><title>Time for Timers</title><link>https://markau.dev/posts/time-for-timers/</link><pubDate>Mon, 16 May 2022 21:25:56 +0200</pubDate><guid>https://markau.dev/posts/time-for-timers/</guid><description>Woops, seems like I forgot to write stuff here for three months. I can explain! Elden Ring came out and stole all my free time, and also I&amp;rsquo;m getting married soon so I have to plan my wedding!
Anyways, that&amp;rsquo;s not what we&amp;rsquo;re here for today. Game Boy emulation time!
I decided to take it a bit easy, coming back to this project after three months. So today we&amp;rsquo;ll implement something relatively simple: the timer.</description></item><item><title>We Interrupt This Program for... Interrupts!</title><link>https://markau.dev/posts/we-interrupt-this-program-for-interrupts/</link><pubDate>Tue, 22 Feb 2022 18:42:25 +0100</pubDate><guid>https://markau.dev/posts/we-interrupt-this-program-for-interrupts/</guid><description>Taking a break from all the opcodes, I wanted to turn my attention to interrupt handling. When certain hardware events happen on the Game Boy, the CPU should stop executing the current program and handle whatever event occurred. This is done with interrupts, which I have modelled into the CPU, but they&amp;rsquo;re not actually fully implemented yet, since I have not implemented the emulations of the hardware systems that generate the interrupts.</description></item><item><title>Reconfiguring Neovim</title><link>https://markau.dev/posts/reconfiguring-neovim/</link><pubDate>Sun, 20 Feb 2022 14:49:02 +0100</pubDate><guid>https://markau.dev/posts/reconfiguring-neovim/</guid><description>I was recently inspired by a friend to nuke my Neovim config and start over from scratch, doing things a bit more &amp;ldquo;properly&amp;rdquo; this time. But I didn&amp;rsquo;t want to entirely destroy my current config &amp;ndash; which I had not yet put under version control &amp;ndash; before I had the new one set up in a way I was sure worked and I was happier with than my current one. This post documents my approach for when I feel like doing the same thing again some time in the future.</description></item><item><title>Oversights and Redesigns</title><link>https://markau.dev/posts/oversights-and-redesigns/</link><pubDate>Tue, 15 Feb 2022 22:16:26 +0100</pubDate><guid>https://markau.dev/posts/oversights-and-redesigns/</guid><description>For the third installment of this series, I&amp;rsquo;m going to have to redesign the emulator a bit due to an oversight I made in the opcodes.
The oversight I was happily hacking along, implementing opcodes from the table when I noticed something about some of the instructions. I&amp;rsquo;ll use two instructions to show what I mean.
Here&amp;rsquo;s a nice and normal instruction from the table:
INC A # Instruction 1 4 # Size in bytes, and how many clock cycles it takes Z 0 H - # Affects flags Z and H, clears flag N, no effect on flag C And here&amp;rsquo;s one that confused me for a bit, and then made me realize I have to redo a couple of things:</description></item><item><title>Writing a Rusty Game Boy Emulator (Part 2)</title><link>https://markau.dev/posts/writing-a-rusty-game-boy-emulator-part-2/</link><pubDate>Thu, 10 Feb 2022 17:06:22 +0100</pubDate><guid>https://markau.dev/posts/writing-a-rusty-game-boy-emulator-part-2/</guid><description>Having implemented the simple opcodes, I have sat down and implemented a lot of instructions. Pure grunt work at this stage. I may have gone a bit macro-crazy.
Table of Contents Simple loading A memory of a memory Loading&amp;hellip; Loading&amp;hellip; Loading&amp;hellip; LD reg, d8 LD reg, (HL) / LD (HL), reg LD (HL+), reg LD (C), A / LD A, (C) LD HL, SP+r8 What was so hard about that? Logic and arithmetic Where are we today?</description></item><item><title>Writing a Rusty Game Boy Emulator (Part 1)</title><link>https://markau.dev/posts/writing-a-rusty-game-boy-emulator-part-1/</link><pubDate>Mon, 07 Feb 2022 20:25:38 +0100</pubDate><guid>https://markau.dev/posts/writing-a-rusty-game-boy-emulator-part-1/</guid><description>Sometimes I get the urge to write an emulator. This has happened several times in the past, but rarely have I actually finished any. I have made starts and attempts for the NES, the CHIP-8, the 6502 CPU in general, the 8086 to play Space Invaders. All of these I&amp;rsquo;ve eventually given up on. Not because I lack the ability, but simply because I eventually grew tired of them. Maybe if I write blog posts documenting my progress, I will get the push I need to make something somewhat usable.</description></item><item><title>Morse Unicode</title><link>https://markau.dev/posts/morse-unicode/</link><pubDate>Thu, 09 Dec 2021 00:00:00 +0000</pubDate><guid>https://markau.dev/posts/morse-unicode/</guid><description>I have had a delightfully terrible idea: What if you could transmit unicode characters as Morse code?
Exploratory phase I started out as most non-serious research starts out, by consulting my favorite search engines and online encyclopedias, to learn more about the basics of the subject at hand. Everyone knows about Morse code, but to implement my idea, I had to know1 Morse code.
Morse code is a variable width code, much like the UTF-8 encoding of the Unicode standard.</description></item><item><title>Thoughts on shells</title><link>https://markau.dev/posts/thoughts-on-shells/</link><pubDate>Tue, 30 Nov 2021 20:16:57 +0100</pubDate><guid>https://markau.dev/posts/thoughts-on-shells/</guid><description>I have been using fish as my shell for a while now and I am a bit conflicted on whether or not to continue using it. This post is essentially a ramble for me to organize my thoughts and perhaps make a decision eventually.
Table of Contents My early days There are other shells? POSIX-noncompliance? Ew. POSIX-noncompliance is good, actually. POSIX-noncompliance is bad, actually. Switching back to zsh? Conclusion My early days I started my shell journey with bash way back when I didn&amp;rsquo;t even know what a shell was, nor the distinction between the shell and the terminal (emulator).</description></item><item><title>Solving FRA-knäck 1</title><link>https://markau.dev/posts/fra-knack-1/</link><pubDate>Sat, 27 Nov 2021 00:00:00 +0000</pubDate><guid>https://markau.dev/posts/fra-knack-1/</guid><description>This year, the National Defence Radio Establishment in Sweden is issuing a cyber-security challenge every week of Advent. This post chronicles my solution to the first of these challenges, which was a 3-flag CTF. The challenge is available on their challenges website, which contains a link leading to a page which looks like this:
Don&amp;rsquo;t mind me, just trying stuff out
Supposedly it&amp;rsquo;s a mobile phone-friendly CTF, and there are three clues, one for each flag you can find.</description></item></channel></rss>