Weekly Dev Update 4
Templating Blog Post / Completed Templating/Golang/Postgres Work Project / GameBoy Color Development
Templating Blog Post
As I struggled with a work project that required some midly complex Golang templating, I came up against the reality that I simply wasn’t going to be able to get a fix to my issue without either abusing ChatGPT, or learning it thoroughly myself. Of course the first is the quick and easy option, however, it leaves that come impossible to maintain, and not to mention, I am left no better of a developer. So I hit the books, read half a dozen articles on the topic, twice over in some cases, then spent hours sifting through Go’s documentation in the text/template package. It was a great experience. I feel every time I decide to roll up my sleeves and write and blog post on a topic, I become painfully competent on the topic. This is only the second major roadblock I have found to justify this level of throroughness, but as I thought, I am walking away feeling very confident. After going through this with the http/net package in Golang, I still have a scary-good memory on the precise documentation, even though I’ve only programmed through it a couple times on my own. There’s a very big difference between feeling like I can absolutely solve a problem with time, and another version where I have, beyond a memorized understanding, but a comprehensive knowledge on the subject, enough that I could write it out on a whiteboard. It is a fantastic feeling, to the point where I am looking more and more for an excuse to start studying something in a way where I can start writing a blog post on it. Right now, I think I may consider an advanced tutorial on templating, since I didn’t get to go too deeply into the Template type and its fields, or the context type within the Template type.
Completed Templating Work Project
As I finished that blog post, I naturally solved my own issues by actually understanding the subject. All of the important functionality is complete, although now the test writing phase, and filling the database begins, which, the former is very exciting since I haven’t done much logging as of yet. I may even find this as another source of inspiration for a blog post, to find a style of logging that I like. If it needs said, I was overjoyed at the prospect of a greenfield project at work where I get to use the ‘dream stack’, Go/HTMX/Templ/PostgreSQL. I got to pave the way on this, and every line of code is mine. Not that any of that is terribly important, but I haven’t made a production level project with this much traffic, and gone through all the architecting on my own. It felt nice to be given so much responsibility, and I feel like it has been coming together really well so far, but I can’t count the chickens until it’s deployed with passing tests.
GameBoy Color Development
This week, most of my time at home was consumed with attempting to ‘mod’ the PokeGold repo by Pret. It is an excuse for me to play with some Assembly, but I didn’t even make it that far. I ran into an undocumented place for confusion. In Pret’s repo, since the GameBoy Color sprites only allowed for 4 colors/sprite, a script runs to check the colors of your png, if you have too many colors, error, if you have too few, things get funky. The script also goes through your image and auto-detects the four colors and slaps them on variables. In simple terms, it was very easy for colors to get wonky, and for your new sprite to have its colors swapped with the default colors for that pokemon. So even though I swapped out the front-facing image for Pidgey with a white/black/green/red sprite, my sprites colors were being converted into Pidgey’s default colors, pink/brown/white/black. On top of that, Aseprite, the software I was using to create the sprites, had black as the ’transparent’ color. So when the PokeGold script ran, white and black where being swapped as well. It took me diving into the source code, talking with the community, and trying to swap out more images, on more pokemon, that finally fit all the puzzle peices together to allow me to successfully swap out an image as I intended with the correct colors.
The next step I would like to attempt is diving into the intro script, changing some dialogue, then changing the options for your starter. Since everything is declared in assembly, I suspect you can’t just swap out the variable for Totodile for Ho-Oh and call it a day. You need to change the preview sprite, change Prof Elm’s dialogue, and change the value of the pokemon, maybe much more, since other scripts are checking for what pokemon you chose, and changing their dialogue based on that.
I am also doing a LOT of reading on GameBoy Development, what it was like back in the day, system limitations, and how that changed the way they programmed and designed solutions. I really want to consider getting my Pokemon-Gold rom uploaded onto a black cartidge, and me be able to play it on my own GameBoy Color.
Understanding that I am an addict for this stuff, you have to understand, I am simply doing this because I love it. This project excites me so much because I have no clue how Assembly works. I have never not had a big beautiful garbage collector to keep me in line. I am hoping to learn a lot about what low level code is, what a garbage collector does, how it works, and add my understanding into what I know about CS, and change the way I code for the better, and if languages like C, Zig, and Rust become more appealing and approachable along the way, no harm done.