Wow taking a break really does help with looking at things from a new perspective. I don’t know if its the experience from my new job or taking a step back but I feel like I am starting to notice some patterns in the CD Library that just click or make sense. This is just a basic one but for example, cdlib_push_asset_load_new and cdlib_setup_asset_load, I understood what they did but at a surface level as in I could describe what theyre doing and how they work but not really the why.

I’ll be using main as an example but this applies to any caller of the above two functions. In the main loop when we return from a game loop the next set of assets need to be loaded. At a high level based on some global variables main knows what entry in the gameAssetPtrTable points to the set of assets it needs to load so it will tell setup_asset_load this is the table I want to use and here is where in the table the pointer for my group of assets is. Easy enough but setup_asset_load only loads one asset even though there are many assets in a group so now main has to call push_asset_load_new. The neat thing about this function is that it takes no parameters, this is because setup_asset_load also setup the cd library state so that this function knows which is the next asset to load. Well now the caller doesnt need to track which assets have been loaded and how many are left. They just call this function in a loop until it returns a specific value telling the caller that its done! Now why not just do this whole thing inside setup_asset_load instead and just go ahead and load all the assets? In main’s case we implement a busy wait loop that holds execution until all the assets are loaded so why split this off. Well now you have the option of doing a busy wait or asynchronous execution. Maybe a caller wants to load assets but not sit there waisting cpu cycles, this gives callers the flexibility to do other work along side asset loading.

Been working through adding more functions to the documentation, and I know I’ve been very inconsistent with names, tone, not just that but some of the behavior descriptions can be word salad or basic statements, especially for those I wrote early on that I haven’t updated. Once I have the function documentation for all CD Library functions minus the minigame side I’ll do a pass over them all to standardize naming and clean up prose. I also need to begin the data section of the documentation for the CD library, I’ve been holding off on these as my understanding of the data and data structures keeps changing for many of them but for the most part we are pretty set in stone for right now.

One thing I also want to clean up is the devlog. It needs more structure both in layout and schedule. Its currently very disorganized and rambly as well as sporadic in release which makes it useless for me so whats the point, but hey you learn as you go. But I am getting into the flow of things and figuring out exactly what I want from this site so currently there is a big todo list. For the next while there wont be really any new discoveries I will talk about, its really catching up with all the documentation before moving to a new system. There are still a few gaps in the CD Library for example with seeking, adpcm, the library state and 2 members of the asset pointer table but those are at the interface with the other systems in the game engine so looking at the library wont help anymore. I’ve also decided after all to take a look at the sound engine, ive been really wanting to figure out how the music is sequenced and spu programmed, not just that but its the next easiest system in my opinion.