First post, by zb10948
- Rank
- Member
Hello,
I have a situation with graphics on the system with integrated board that supports Plantronics modes. I'm unable to engage it from my own code, yet I have working examples of other software together with the source. I'm missing something, and I don't know why.
Using latest FreeGEM and sdpla.cga driver, which is available in source format as pla_drv.a86, I can see following is performed;
mov ah,0mov al,5 ;hi-res graphicsint screen...mov dx, 03DDhmov al, 20h ; 640x200 4-colour modeout dx, almov ax, 1 ; Switch to palette 1call setpal...setpal:...mov bl, almov bh, 1mov ah, 0Bhint screen
I've also contacted the author of the driver, 'hi-res graphics' comment was leftover from template code, and there is nothing special about this initialization sequence, it's per Plantronics documentation.
So I tried to replicate it in C :
union REGS reg;reg.h.ah = 0;reg.h.al = 5;int86(0x10, ®, ®);outp(0x03DD, 0x20);reg.h.ah = 0x0B;reg.h.bh = 1;reg.h.bl = 0;int86(0x10, ®, ®);
The following code puts video at 640x200 but BIOS still outputs 'fat letters' which is correct because it's in CGA mode 5...meaning the Plantronics register worked.
However if I try to write pixels to two planes like this
unsigned char far *plane1 = (unsigned char far *)MK_FP(0xB800,0x0000);unsigned char far *plane2 = (unsigned char far *)MK_FP(0xBC00,0x0000);unsigned char p1h = 0x55;unsigned char p2h = 0x33;for(i = 0; i < 80; i++) {memcpy(plane1 + i, &p1h, 1);memcpy(plane2 + i, &p2h, 1);}
There is no effect in second memcpy. Expected is one row filled with repeated colour combinations. I get on-off pattern, which is standard CGA 640x200 behaviour.
If I adapt this code to work at 320x200x16 I get same thing. Writing repeatedly FF AA 55 00 and E4 E4 E4 E4 to banks row 0 should give me a repeated 16 colour gradient. I get 4 colours there.
I'm attaching the source of the GEM driver that works correctly. I'm left without ideas and looking for tips.