What on earth is wrong here?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

What on earth is wrong here?

Post 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.
Attachments
qemu.png
qemu.png (10.56 KiB) Viewed 1007 times
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post 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
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post 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!
User avatar
astrocrep
Member
Member
Posts: 127
Joined: Sat Apr 21, 2007 7:21 pm

Post 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
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

I haven't enabled bank switching AFAIK. It shouldn't be enabled...
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post 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...
com1
Member
Member
Posts: 105
Joined: Sat Apr 28, 2007 11:57 am
Location: TN

you didn't

Post 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
oh microsoft, microsoft, what souls you have dismayed
Post Reply