Page 1 of 1

What on earth is wrong here?

Posted: Mon Jun 11, 2007 11:54 pm
by pcmattman
My GUI was working perfectly fine yesterday, and now it's self-destructed itself :D

I was implementing the optimizations Brendan suggested for my SetPixel function when everything started going wrong. Bochs no longer even opens my GUI, QEMU works but the display is messed up. I've been at this all day now but I just can't figure it out!

Any ideas?

Edit: those squares are my problem, there should be only 1 in the top left corner.

Posted: Tue Jun 12, 2007 1:36 am
by Combuster
How do you set the video mode (lowlevel vga or bios calls), how do you get width, pitch and height, and how do you use those properties exactly

Posted: Tue Jun 12, 2007 1:38 am
by pcmattman
First: BIOS calls in V8086 mode.

Second: I use the values I asked for, the mode switcher finds that mode, checks for a LFB and if one is found switches to that mode and puts the LFB into ECX.

I just don't understand why it's all of a sudden stopped working when it was working perfectly before!

Posted: Tue Jun 12, 2007 7:46 am
by astrocrep
It appears your memory mapping is wrong, or you not using the proper lfb mode...

I lookes like you memory is wrapping? You not bank switching are you?

-Rich

Posted: Tue Jun 12, 2007 10:31 pm
by pcmattman
I haven't enabled bank switching AFAIK. It shouldn't be enabled...

Posted: Wed Jun 13, 2007 2:55 am
by pcmattman
Ah, never mind.

Combuster and I solved the problem after a 30 minute debug session :D

Turns out I forgot to multiply the offset in SetPixel by 4 (32-bit, uint type...)!

In the process my VESA switcher also got a much-needed upgrade as it was not exactly working properly...

you didn't

Posted: Tue Jun 26, 2007 5:55 pm
by com1
Did you use any linked lists? I know loops can be tricky in linked lists, so be careful you didn't mess up any syntax