Monday, December 11, 2017

Deleting the useful.

Remember that post was I was all like Tony Stark and dumping things in the trash. Well, it's pretty humbling when you have to go into the bin and dig things back out. Early on when I was organizing everything, I decided to delete things I knew I wouldn't need. (Note to self: comment blocks are there for a reason). I removed things like the register structs for calling interrupts, and the GIF helper functions. I am using Allegro's built in PNG support, so that wasn't needed. However, I also ditched some of the interrupt control variables and original code for functions I was planning on replacing. My new 1Ch thread needed those variables to keep it from spinlocking forever. There is a debug flag that is passed to the game via an argument. When debug is turned on the 1Ch interrupt, (on in my case the thread) is turned off. I've hard coded the thread off for now as the loop has a few unresolved functions I have yet to implement and don't want to dummy out. I'm getting to the point where when I implement a low level Nermal function, the code I'm dropping in from the original source is just working.

Also when I dummy out a function, I'm now making extra sure that the original is in a comment block underneath. That way I'm not going to the original archive to figure out what it's supped to do.

Upshot: The buttons on the main screen (Called 101) flash when you click them and attempt to run the appropriate function. I'll be implementing the quit routine tomorrow, and will be attaching that to the actual "close" button on the window. After that., I'll get the Help (F1) and  Info screens.

Still nothing glamorous as screenshots go. The code back end isn't very sexy I do have the following little graph though.

Nermal library Functions -- Green is implemented : Red is still unresolved
I have more than half of Nermal implemented. The 1Ch interrupt replacement was the big hurdle. Now it's a matter of  dropping in code until I hit another unresolved extern, implement and carry on.

I wonder if another programmer would of just ran down the Nermal and functions one by one and just implement them. I was contemplating doing that myself, but with no real API, I'm not sure how the output is handled by the game until I see it. I tell you what though, when I do figure it out, lots of those random variable names start making sense. In fact, it allows me to reuse many of them too.

I've been reading up on "Anti-patterns" as of late. I'll think I'll chat about those tomorrow.

No comments:

Post a Comment