This devlog is probably going to be shorter than the other, simply because I haven’t done as much as I hoped
The main reason for this is that I got completely stuck on a bug, and wasted so much time trying to find it. I first noticed this bug when I got this error message (screenshot) in gameboy-doctor, with a mismatch with a load from memory not being the right value. This got me so stuck, because I didn’t know where to find when the memory was supposed to be written to, so I was basically blindly guessing what was wrong with any previous loads or register writes. Eventually, I caved and asked for help online, and I got my answer after asking on the EmuDev subreddit, where I found out it was an issue with my implementation of the LD (FF00+u8), A instructions, where I wrote LD_n16_n8((0xFF00 + address + 1), registers.a);
instead of the correct LD_n16_n8((0xFF00 + ReadMemory(address + 1)), registers.a);
so basically any writes to memory using that function were in the complete wrong location. Stupid mistake on my part, and I wasted way too much time on it.
I also did implement some basic instructions, like EI and RETI. EI simply enables the emi register, and RETI basically just does that, then calls RET to return from a subroutine.
In addition, I also restructured quite a lot of the code, as too much was piling up in the cpu.c file, and I also renamed quite a few functions to follow a Component_Function syntax, so it was easier to tell where they were located in the code
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.