I have VM86 working as well as a method for calling various VBE functions, which at the very least gives sane data for controller and mode info blocks. However, I'm having trouble properly plotting pixels. I set mode 0x112 (640x480x24 direct color, according to the mode info block), switch to bank 0 for window A (which is at 0xA0000), and set the first byte to 0xFF. I would expect this to make a single blue pixel at the top left corner of the screen, but instead, I get eight white pixels in a line from the top left corner of the screen. Nothing I do seems to be able to create color; at best, I can mostly fill the screen with white. What could the problem be?
I'm using QEMU, and I get the same problem with all other direct color modes that I can set (I haven't tried any of the packed pixel modes.)
VESA plotting pixel issue
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: VESA plotting pixel issue
The blocks are very slow, why don't you use the LBA? (if you are on a version of vesa 1.2 or better i think)
Re: VESA plotting pixel issue
LBA?Karlosoft wrote:The blocks are very slow, why don't you use the LBA? (if you are on a version of vesa 1.2 or better i think)
It's LFB, and that too on VESA 2.0 or higher.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: VESA plotting pixel issue
Now, onto the point
Hmm... the mode no. might be wrong. You should never rely on the standard mode numbers because they are no longer STANDARD. Rather, you have to query for the available video modes and then set the mode you want, if available.NickJohnson wrote:I have VM86 working as well as a method for calling various VBE functions, which at the very least gives sane data for controller and mode info blocks. However, I'm having trouble properly plotting pixels. I set mode 0x112 (640x480x24 direct color, according to the mode info block), switch to bank 0 for window A (which is at 0xA0000), and set the first byte to 0xFF. I would expect this to make a single blue pixel at the top left corner of the screen, but instead, I get eight white pixels in a line from the top left corner of the screen. Nothing I do seems to be able to create color; at best, I can mostly fill the screen with white. What could the problem be?
I'm using QEMU, and I get the same problem with all other direct color modes that I can set (I haven't tried any of the packed pixel modes.)
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
- Combuster
- 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:
Re: VESA plotting pixel issue
I noticed your screen behaves as 640x480x4, VGA mode 0x12 (the lower byte of 0x112) - have you tried dumping the register values before calling the INT?
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: VESA plotting pixel issue [SOLVED]
@Chandra: I am reading the mode numbers from the controller info block, not using standard ones. It just so happens that QEMU's video card's mode numbers match the obsolete standard numbers.
@Combuster: Yep, that was the problem. It turns out that I was casting the mode number to a uint8_t at one point, because I misread the spec as saying it was 8 bits wide instead of 9 bits. Everything works fine now.
@Combuster: Yep, that was the problem. It turns out that I was casting the mode number to a uint8_t at one point, because I misread the spec as saying it was 8 bits wide instead of 9 bits. Everything works fine now.
Re: VESA plotting pixel issue [SOLVED]
You're right. I missed that myself though I use QEMU and VESA everyday. It just happened, never mind.NickJohnson wrote: I am reading the mode numbers from the controller info block, not using standard ones. It just so happens that QEMU's video card's mode numbers match the obsolete standard numbers.
Good to hear you got that solved. Cheers.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: VESA plotting pixel issue
@Chandra Sorry it was 6 AM here when I wrote that post -.-. I think I was a bit tired because I misunderstood all the meaning of the original post. XD Please forgive me!
Re: VESA plotting pixel issue
That's OK. After all, we all are here to learn.Karlosoft wrote:@Chandra Sorry it was 6 AM here when I wrote that post -.-. I think I was a bit tired because I misunderstood all the meaning of the original post. XD Please forgive me!
Programming is not about using a language to solve a problem, it's about using logic to find a solution !