December Adventure 2024

2024-12-03 - [53] 9:18

Folks in the Merveilles community have been doing "December Adventure" since 2023. I'm not part of that community, but I do appreciate it still and felt like joining in this time around, even if not "officially". The description for December Adventure can be found at the link below.

=> Oatmeal - December Adventure

The point of December Adventure is to code a little bit every day in December.

I'll update this particular page with each day's log, even if I don't update the date of this post. The content in the RSS feed should update properly throughout this month, even if it doesn't update the date of the post.

Day 1

About 7 months ago, I removed support for the git-http-backend cgi script on my git server. This removed HTTP and HTTPS support for fetching my git repositories. The post mentioning me removing that support can be found below.

=> Simplifying vigrey.com - Changing Git, Gopher, and Finger

Well, I added support for the "simple" HTTP transfer protocol to Aurgelmir, so now git fetch/pull/clone supports HTTP and HTTPS on for my git server. This was a long time coming and I'm glad I finally decided to add that support.

Day 2

I have learned today about using the http tag to set Content-Security-Policy value data, so I added that to the HTTP version of my site along with the HTTP error pages from my web server and to all HTTP pages in my Thrudgelmir server. I'm surprised I didn't know this before, because I already set the value for "onion-location" this way. This now means instead of receiving an HTTP header key and value for Content-Security-Policy, it'll be baked into the HTML pages themselves.

Considering my website and gemini capsule are fully navigatable and downloadable in a .zip file, this will add support for those Content-Security-Policy values on the local navigatable version of my site.

Day 3

Changed up some code for the web server I use to more closely match the redirect behavior my gemini capsule does. What I thought would be easy and quick ended up being a bit of a pain and resulted in quite a few commits. I could have done this the "correct" way, but my testing was making sure the web server code would compile, push the commit, pull the commit on my server, then finally test it in production. It's working now though!

Day 4

Worked on changing out the output of Syzygy, my Sun/Moon/Earth tracker. Wanting to add support for more coordinate systems, like Azimuth/Elevation/Range. This will probably take a few days and will break support for my topbar project, but will get me more useful information!

Day 5

I'm a bit heartbroken today... just learned that the gameboy assembly code I have been working on for the gameboy tarot deck is corrupted and unrecoverable. At least the gameboy tarot card designs are backed up in quite a few places. Started the project over again, having to remember how to start a gameboy project. Another good thing is that at least 2 mockup images still exist, so I can work off of that. Not sure though if this corruption will demotivate me or motivate me. I want to get this project done and out there, but dang that was a lot of time and mental energy that's gone now...

Day 6

I have an incredibly barebones gameboy rom built now. I also set up a dev log for the gameboy tarot card project. Hopefully I'll be motivated to get at least back to the point I was at before, and who knows, maybe I'll write cleaner, more efficient, and more maintainable gameboy assembly code! Also wrote a script to generate an RSS feed for the gameboy tarot card dev logs. Finally, set up some systems of backing up this gameboy project so I don't have to start over again in the future.

Day 7

The random number generator is implemented now in the gameboy ROM. Next up will probably be the deck shuffle functionality and the ability to convert 8-bit random numbers to arbitrary random numbers, which is needed for the deck shuffle functionality.

Day 8

I got the arbitrary random number generator working in the gameboy ROM that converts a stream of random bits into arbitrary numbers. The method I am using is shown at the journal post below.

=> Mathematically Transforming a Biased 6-Sided Dice Into an Unbiased 20-Sided Dice

Day 9

Spent more time than I wanted figuring out some flaw in my arbitrary random number generator for the gameboy ROM. After finally getting the BGB emulator working, I had access to a good debugger and figured out the issue almost immediately. With that figured out, the card shuffle mechanic works flawlessly!

mGBA does play WISDOM TREE mapper gameboy ROMs, but the emulator kept crashing on me while attempting to use the debugger. I also couldn't get debugging working with visualboyadvance-m, but that emulator doesn't like WISDOM TREE mapper ROMs anyways. Now that I have the BGB emulator playing nice, programming, testing, and debugging should be a lot easier.

I also found an error in the fool's journey NES ROM code for shuffling a deck. The ROM assumed there were 76 cards in the deck rather than 78, so fixed that. Because I'm better at programming in 6502 assembly for the NES than I am at programming in LR35902 assembly for the gameboy, I'm using the NES ROM to help verify that the gameboy ROM's code works as expected.

Day 10

Started building tools to convert a PNG into graphics tile data for the gameboy ROM. I'm considering adding Game Boy Color (CGB) support for colored card tiles, but that will at least nearly double the size of the finished ROM when the source code is assembled.

I also may need to build a tool that relatively efficiently picks color palettes for a colored image to make sure the cards fit within the limitation of 8 palettes of 4 colors each for each 8x8 px tile. That means I need to make sure each 8x8 px tile uses no more than 4 colors each and no more than 8 palettes of 4 colors are needed to represent the entire picture. That's a problem for "later me" though. For now, I'll work on the initial gameboy color palettes a few cards at a time here and there.

Day 11

So it turns out I can get away with a few more than 4 colors per tile as long as I keep to a total of 8 palettes of 4 colors each and set sprites on top of background tiles. As such, I have been colorizing all of the gameboy tarot cards and wrote a script that tells me which tiles use more than 4 colors. I'll also need to write some code to determine how many color palettes are needed for each card.

At this moment, I colorized all of the Major Arcana cards, all of the Wands cards, all of the Cups cards, and all of the Aces. The remaining 26 cards should be relatively fast for me to colorize and I should have those done sometime tonight.

At some point, hopefully soon, I'll try to come up with a standardized set of colors so every card doesn't have slightly different versions of yellow or sky blue for instance. It would be nice to have the cards be relatively consistent.

Day 12

It's pretty cold in my office where I program, so I kept things pretty short. Last night after midnight, I finished up colorizing the gameboy tarot cards. This afternoon, I edited ham-test-practice-fcc to randomize the answer options for questions to prevent myself from memorizing "The answer to the question with this particular ID is C". That should help me feel a bit more confident in my information retention while studying for the Amateur Extra test.

Unrelated, but I cooked a tater tot hotdish today to warm the house up. Here's the recipe.

=> Tater Tot Hotdish Recipe

Day 13

Well, after determining palette requirements for the gameboy color versions of the cards, I realize too many colors are too close too each other. Because of that, I am dropping gameboy color support from the tarot card project. I don't consider all of that time colorizing the cards to be wasted though, as I found a few miscolorings in the gameboy versions of the cards. Ah well, time to continue the project.

Continued work on the PNG to gameboy tile data converter.

Day 14

Kind of a boring programming day. Yet more work on the PNG to gameboy tile data converter code. Spent more time salting a sidewalk and cooking a roast today than programming, but still programmed a little bit.

Day 15

Finally got the PNG to tile data converter code finished. Next up will likely be writing some gameboy assembly to load small card graphics into VRAM.

Day 16

Started work on getting the gameboy tiles for the backs of small cards and the tiles for flipping the cards into VRAM. Also changed some formatting on the gameboy assembly files for the sake of consistency and readability.

Day 17

These days sure are becoming a lot more blurred together due to a strange sleep schedule... The gameboy ROM is now able to display arbitrary small tarot cards vertically and horizontally along with having cards horizontally over vertical cards. I should hopefully have a dev log written in the next day or so and should have a screenshot included showing the graphical progress. The nice thing is the cards visible in the ROM are generated via the random number generator and are not static placeholder cards.

Day 18

I got sprites working on the gameboy ROM! It'll be just a little longer before I write the dev log. The ROM so far is able to draw cards onto the screen at specified tile locations along with drawing facedown cards that move to to the specified tile locations and do an animation of flipping over, but I don't have those 2 things tied together yet. In order to tie them together, I need to draw a card face up only after the flipping animation completes. Once those 2 things are tied together, then I'll start the next dev log post. I also updated rodor-logbook, the program I use to generate RSS feeds for my site, to use 12:00:00UTC (noon UTC) in order to follow the subscriptions companion spec for gemini. My apologies if that causes my posts to appear new.

Day 19

I am essentially rebuilding the graphics code for my gameboy rom now to allow 16 or possibly a little more unique small cards to be displayed on the screen at once. I also did some stack work on the rom to make functions safer and to prevent clobbering of registers. Because of this rebuilding of graphics code, it'll take me a little longer to get the dev log written, as I need to get back to where I was in the project with this rebuild.

To make the gameboy assembly code easier to read, I'm now using local and unnamed variables in subroutines, especially when loops are involved. Before, I would just write the subroutine label and add Loop to the end, which reminded me of how unruly java can get in terms of tome length names...

I also made some mockups of different tarot spreads, all of which use no more than 16 cards. I just need to determine whether a card is horizontal or vertical. It should be pretty easy to go to the beginning of the spread data by setting a "spread index" and bitshifting it left 4 times, then get the next 16 bytes to determine if each of the 16 cards are vertical or horizontal. Even if the spreads don't use 16 cards, there's no harm in drawing 16 cards into the timle map anyways.

Day 20

More sprite handling work for the gameboy ROM today. I also wrote the 4th dev log. A pretty slow and chill day, honestly. Still, progress is happening.

Day 21

Again, more gameboy rom development. Fixed a bug in some random number generation code. Also got vertical small cards displaying and flipping properly.

Wrote a journal post today that gave some git stats, which required me to write a shell script and some python to parse the output of the shell script. The script let me know how many days I committed code in 2024, how many commits I did in 2024, and how many lines were added and removed in 2024.

Day 22

I started a tool assisted speedrun (TAS) of Rugrats: Adventures in Game Land. Decided to use today as a sort of refresh day. Wrote some python code to calculate timings on vines in that game.

Day 23

Worked some more on the Rugrats TAS. Also got horizontal cards drawing nicely in the gameboy tarot rom, even when drawing the card over a vertical card.

Day 24

More gameboy ROM dev! Added text tiles along with cursor tiles. When cards are flipped on the screen, the name now appears at the bottom of the screen in the Window layer. For testing purposes, the cursor will appear over the card that has just been flipped along with a sprite showing a tiny horizontal or vertical card with a magnifying glass, signifying to the player that they can see the card description of the card with the cursor over it. I'm almost at the point where I can make the ROM more difficult by adding in the full sized tarot card designs and bank switching.

Day 25

I got the start of controller input working on the gameboy ROM. Once a tarot spread is fully laid out and the cursor appears, I can move the cursor to the next or previous card of a spread, along with go to the next or previous spread with A or B.

Day 26

More controller input handling for the gameboy ROM! Now while a tarot spread is being laid out, START can be pressed to instantly have all of the cards laid out instead of having to wait for all of the animation to happen. I also set the directional buttons to navigate laid out cards more intuitively now. For instance, if "Up" is pressed, the cursor will move to a card that is above the slected card, as will "Right" move to a card to the right, "Left" to left, and "Down" to below. Initially, I had Up/Right move to the next card in the spread sequentially in the order of the cards being laid out and Down/Left to the previous card.

Day 27

For a few days now, there was a bug in the gameboy ROM which caused some sprites to flash on the screen for a frame on at least one emulator rather than being invisible due to being offscreen. I fixed that issue finally today. Otherwise today is a kind of lazy day in terms of programming. I'm going to use the next few hours to read Godel, Escher, Bach and get back to programming either tonight or tomorrow sometime.

Day 28

A mostly uneventful day. Added support for the cursor in the gameboy ROM to be horizontal instead of vertical. Also added a "MixLFSR" subroutine in order to impact the random number generator more with timing data, meaning deck shuffles will be influenced by which frame the shuffle starts along with how many CPU cycles have occurred before the shuffle.

Day 29

Specifically decided not to program today. Enjoyed a day without programming.

Day 30

Started some bank switching code for the gameboy ROM that follows the Wisdom Tree mapper.

Day 31

Last day of the December Adventure! Today's coding has been more bank switching code for the gameboy ROM. I also wrote some code to test for the Wisdom Tree mapper, as I think I might also make this a valid MBC1 mapper ROM so it'll run on more emulators. That said, the cartridge type won't work on some consoles like the RetroN 5 likely without custom firmware for handling the Wisdom Tree mapper (Update a little after midnight UTC: I think I should be able to make the cartridge of this gameboy ROM work on consoles that accepts MBC1 cartridges, like the RetroN 5!)

I don't know how long this ROM will take to "finish", but I'm quite happy with what I managed to do this month out of nowhere! It's a little funny to me that I expected modifications to my sun/moon/earth tracker "syzygy" to be the big project for the month and instead I got sidetracked by another project entirely because the project data was corrupted.

Contact/Reply

If you would like to reply to this post, feel free to send me an email or misfin message.

=> Email: vi@vigrey.com | Misfin: vi@vigrey.com

Proxy Information
Original URL
gemini://vigrey.com/journal/december-adventure-2024.gmi
Status Code
Success (20)
Meta
text/gemini; charset=UTF-8
Capsule Response Time
1384.250832 milliseconds
Gemini-to-HTML Time
2.85432 milliseconds

This content has been proxied by September (ba2dc).