VOGONS


First post, by taiken7

User metadata
Rank Member
Rank
Member

Just a short note to see if anyone else is making progress,
So far I've implemented the registers, but have yet to
gain access to the VGA memory space from the HGC space.

The graphics are chained like "mode-X" but with only 1bpp

Please let me know if the colour "bands" looks correct.
Also if anyone knows where I can tweak INT-11 to report
a HGC instead of VGA (or HGC specific software),
please list them!

A "screenshot" of work in progress:

Reply 1 of 10, by eL_PuSHeR

User metadata
Rank l33t++
Rank
l33t++

Interesting. Very interesting indeed. HGC graphics and specially text were WAY MUCH better than crappy CGA imho. Why the greenish tinge though?

Reply 2 of 10, by taiken7

User metadata
Rank Member
Rank
Member

Was there a correct colour scheme?
Call it nostalgia, but my days lack monochrome "green"
(easy enough to program any other mono scheme, such as amber or grey)
Mixing 4 colours looks quite impressive too.

Resolution - 720X350 pixels and a beautiful 9x14 font set.
(I think VGA default textmode is 640x400 with 8x16 fonts)

(Still working on fonts..)

Reply 3 of 10, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Default vga is 720x400 with 9x16 fonts.

Current CVS already has some support for hercules graphics mode though and you can further help detection of it with setting the machine variable in the config file

Reply 4 of 10, by taiken7

User metadata
Rank Member
Rank
Member

Thanks Harekiet,

Have the second graphics page up, not able to CVS so here is the
change you need to make to vga_misc.cpp:

-/* Hack around like it looks we are in 0xb000 segment */
- vga.gfx.miscellaneous=(vga.gfx.miscellaneous & ~0x0c)|0x0a;

+/* Hack so it it looks like we are in 0xb000 or 0xb800 segment */
+ if (val>>7) vga.gfx.miscellaneous=(vga.gfx.miscellaneous)|0x0c;
+ else vga.gfx.miscellaneous=(vga.gfx.miscellaneous & ~0x0c)|0x0a;

Now you can run any other hercules apps that dont make use of bios calls
(still finishing those).

Reply 5 of 10, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Did it slightly different now so you don't have the black lines over the screen. Always thought the hercules had only 2 8kb pages in the 0xb000-0xb7fff range. I should read the documentation better 😜

Reply 6 of 10, by eL_PuSHeR

User metadata
Rank l33t++
Rank
l33t++

Yes that banding looks terrible and why both example images has colour. Shouldn't they be b/w only (1bpp)?. 😀

Reply 7 of 10, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

i think you are free to choose your own pallete (at least if you're coding it)

Water flows down the stream
How to ask questions the smart way!

Reply 8 of 10, by taiken7

User metadata
Rank Member
Rank
Member

Thanks Harekiet, that re-write looks much better than my efforts.
AND pictures look much better without the scan lines!

Now there still seems to be one last bug,
(looses visiblity (ie wrong page) shortly after your screenshot);
I'll try comparing sources, I think the 'hercules mask' is sticking ...

**Edit:
vga_misc.cpp: Line 225

}
}
if (vga.herc.enable_bits & 0x2) {
mask|=0x80;
-- VGA_SetupHandlers();

}
vga.herc.mode_control=(vga.herc.mode_control & ~mask) | (val&mask);
++ VGA_SetupHandlers();
break;

Reply 9 of 10, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hehe yeh it sets up the new handlers before updating the value, i'll give it another write and lose the mask thingie a bit.

--edit

Hope it works correctly now 😀

Reply 10 of 10, by taiken7

User metadata
Rank Member
Rank
Member

Bit of a challenge this one provided, hopefully its now stable:
This code Fixes INT10-function 3 (Video Scroller support):

add the following to INT10_CHAR.CPP
(Somewhere just below the #includes ..)

static INLINE void CGA2_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) {
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
PhysPt dest=base+((CurMode->twidth*rnew)*(cheight/2)+cleft);
PhysPt src=base+((CurMode->twidth*rold)*(cheight/2)+cleft);
Bitu copy=(cright-cleft);
Bitu nextline=CurMode->twidth;
for (Bitu i=0;i<cheight;i++) {
MEM_BlockCopy(dest,src,copy);
MEM_BlockCopy(dest+8*1024,src+8*1024,copy);
dest+=nextline;src+=nextline;
}
}

static INLINE void CGA2_FillRow(Bit8u cleft,Bit8u cright,Bit8u row,PhysPt base,Bit8u attr) {
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
PhysPt dest=base+((CurMode->twidth*row)*(cheight/2)+cleft);
Bitu copy=(cright-cleft);
Bitu nextline=CurMode->twidth;
attr=(attr & 0x3) | ((attr & 0x3) << 2) | ((attr & 0x3) << 4) | ((attr & 0x3) << 6);
for (Bitu i=0;i<cheight;i++) {
for (Bitu x=0;x<copy;x++) {
mem_writeb(dest+x,attr);
mem_writeb(dest+8*1024+x,attr);
}
dest+=nextline;
}
}

............ Then replace the following ...........

case M_TEXT16:
TEXT_CopyRow(cul,clr,start,start+nlines,base);break;
--// case M_CGA2:
++ case M_CGA2:
++ CGA2_CopyRow(cul,clr,start,start+nlines,base);break;
case M_CGA4:

... AND ...

case M_TEXT16:
TEXT_FillRow(cul,clr,start,base,attr);break;
--// case M_CGA2:
++ case M_CGA2:
CGA2_FillRow(cul,clr,start,base,attr);break;
case M_CGA4:
CGA4_FillRow(cul,clr,start,base,attr);break;

Now you can play King's Valley (CGA/Tandy)!
King's Valley