84 Followers
181 Following
1,034 Posts

Hi!

I'm interested in gamedev, operating systems, embedded systems, console emulators, electronics and graphics programming. I'm not particularly proficient in any of those, but hey, I'm learning.

I don't post regularly because I tend to work on stuff slowly. Sometimes I do post a lot, though.

...aaaaaaaaaaaaaaaaaaaaaaa
aaaaaAAAAAAAAAAAAAAAAAAAAAAHH
HHHHHHHHHHH...hi :)
Mwahahaha.
Everything back in order. Now I can compile the os with optimizations on. Yay!
Insert feet in mouth. I'm just a ginormous, bloody idiot. k_int_Init calls k_int_Lidt, which loads the IDT. And k_int_Lidt isn't saving ebx. Nor eax. No wonder things go to shit. It doesn't crash when not optimizing because values are reloaded from the stack all the time.
This is the code it gets generated from. ebx is holding the init_data pointer. The null pointer check before the k_int_Init call is there because I was suspecting the bootloader was screwing up.
This is where the issue happens. At 0xe517 a pointer stored in the stack by the bootloader gets read into ebx. Before the call at 0xe520 the value is correct. After it it's some nonsense that crashes the kernel further down the road. This is at -O3.
Hehehehehe
Some more progress. I'm still not entirely sure why some backgrounds are broken. I spent a couple of hours yesterday going over all the addressing/color palletes code, and it seems to be fine. I'm suspecting there's something wrong with the DMA or the HDMA, because the background data for Ceres station is filled with the same value for all tiles.
Uh... that doesn't seem right...
Decided to play with the snes emulator project a bit. Fixed a few obvious issues with obj drawing (I had an off by one bug when flipping an obj and was considering all objs to be 16x16 dot). Now it looks less wrong. I still have to figure out why the background looks like that. I'm suspecting it's because I'm not currently honoring background priorities.
A beeeg walking stick.