VOGONS


40 Column Text Mode Issues

Topic actions

  • This topic is locked. You cannot reply or edit posts.

Reply 440 of 457, by reenigne

User metadata
Rank Oldbie
Rank
Oldbie

I had a conversation with Trixter about this quite recently. Actually we were talking about sampled sound rather than palette effects, but the code is almost identical. We determined that (taking into account interrupt overhead) it is possible to output a byte to port 42h every 44 microseconds. A scanline takes about 64 microseconds so (assuming the timings for port 3d9h are the same as for 42h) you can change the palette on every scanline using about 69% of CPU time (and sacrificing the DX and SI registers to hold the port number and palette data pointer). Interrupt overhead is most of this time so you can do much better if you count cycles, but then the code will only work properly on a 4.77MHz machine.

Reply 441 of 457, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

In short, it would make for a nice static demo, but a very limited game at best. However, it doesn't sound like it would make much sense because a VGA card can output a greater number of colors on a monitor using a simple method which would probably be faster even at 4.77MHz.

Reply 442 of 457, by TeaRex

User metadata
Rank Member
Rank
Member
Great Hierophant wrote:

In short, it would make for a nice static demo, but a very limited game at best.

Not necessarily, given that people wrote several hundred games for the Atari 2600, where all graphics have to be produced with a scanline-by-scanline method. You always have the blanking interval to do game logic.

But in fact this discussion seems to be of fairly limited relevance today. The IBM-compatible PC landscape probably diversified too early, and the numbers weren't high enough compared to e.g. Atari or C64, for game programmers to justify going this extreme low-level road.

tearex

Reply 443 of 457, by robertmo

User metadata
Rank l33t++
Rank
l33t++

I have got two Ati cga cards with composite out. I can connect them to my sony trinitron pal TV that supports ntsc through composite in. I can also connect them to my leadtek winfast tv card.

I have noticed that rgb games have correct colours on both devices: tv and tv card.

640x200 games have wrong hue and I have to adjust them with my nvidia card's control pannel (it allows me to change whole 360 degres hue - settings from 0% to 100%. I have to set 35% for one card and 58% for the other card. With TV i cannot change hue cause its hue control does only very minimal adjustment.

320x200 games use either "rgb hue" for example "microsoft decathlon" or "640x200 hue" for example "gamma force".

My question is how hue was handled in the past? how does a monitor know whether it has to use "rgb hue" or "640x200 hue"?

Reply 444 of 457, by TeaRex

User metadata
Rank Member
Rank
Member
robertmo wrote:

My question is how hue was handled in the past? how does a monitor know whether it has to use "rgb hue" or "640x200 hue"?

IIRC: for 640x200 composite mode, it depends on some bit in some register of the CGA whether a composite monitor will display it in "composite mode" or in black-and-white

For 320x200 composite mode, it is simply a function of the monitor type - a rgb monitor will display it as rgb, a composite monitor as composite; there is no way for software to select one or the other. Only dual-function Composite/RGB monitors such as the Commodore 1084, with the right kind of cable (which probably would have to be manually soldered together), could display both; but you would still have to select the mode by toggling a hardware switch on the monitor.

For a modern TV set with SCART input (read: a European set), you could probably come up with a CGA-to-SCART cable which will switch the TV between RGB and composite input modes, again with a toggle switch and some external voltage source (battery, PC gameport, wall wart etc.) for the mode selection.

tearex

Reply 445 of 457, by robertmo

User metadata
Rank l33t++
Rank
l33t++
TeaRex wrote:

For 320x200 composite mode, it is simply a function of the monitor type - a rgb monitor will display it as rgb, a composite monitor as composite;

The problem is that both games: "microsoft decathlon" and "gamma force" are a composite mode games. But one of them uses "rgb hue" and the other "640x200 hue".

Reply 446 of 457, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Not sure of your use of the word "hue", as DOSBox has a way to change the hue in composite mode; however I think you're referring to differences in palette. It's a bit strange to think of mode 6 (monochrome) as having a palette, but you can change its foreground and background color. DOSBox's composite palette is designed to work with mode 6, foreground color 7 and 15 (white and intense white) on a black background, any other colors programmed into the palette registers on the CGA crtc could produce inaccurate composite colors.

Reply 447 of 457, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

Whoa guys, you have contributed a fair number of inaccuracies to this discussion, to whit:

320x200 games use either "rgb hue" for example "microsoft decathlon" or "640x200 hue" for example "gamma force".

No, both use 320x200 mode, the difference is the underlying colors they use.

My question is how hue was handled in the past? how does a monitor know whether it has to use "rgb hue" or "640x200 hue"?

The CGA card was generating the color based on the OSC signal coming from the ISA bus. On IBM PC/XT/AT machines, there was a hue control pot on the motherboard that tweaked the OSC signal going to the card. A real CGA card has no color controls of its own of any kind.

For 320x200 composite mode, it is simply a function of the monitor type - a rgb monitor will display it as rgb, a composite monitor as composite; there is no way for software to select one or the other. Only dual-function Composite/RGB monitors such as the Commodore 1084, with the right kind of cable (which probably would have to be manually soldered together), could display both; but you would still have to select the mode by toggling a hardware switch on the monitor.

For a modern TV set with SCART input (read: a European set), you could probably come up with a CGA-to-SCART cable which will switch the TV between RGB and composite input modes, again with a toggle switch and some external voltage source (battery, PC gameport, wall wart etc.) for the mode selection.

At least one variety of the Commodore 1084 had a 9-pin DE-9 port that could accept a digital or analog RGB signal. CGA sends out a digital signal. Since a SCART cable supports only analog RGB, you would need custom cable with a digital to analog conversion circuit. Software can select in 320x200 modes whether it displays in color or b&w on a composite monitor by selecting the 3rd palette/BIOS Mode 5.

It's a bit strange to think of mode 6 (monochrome) as having a palette, but you can change its foreground and background color. DOSBox's composite palette is designed to work with mode 6, foreground color 7 and 15 (white and intense white) on a black background, any other colors programmed into the palette registers on the CGA crtc could produce inaccurate composite colors.

CGA does not have palette registers, it has a color select register and palette select bit. Mode 6/640x200 has a palette of one color, selectable from 16 colors. If a color other than one of the whites is used, then it will produce whatever colors it produces. No game is known to use an off-white color. CGA cannot select the background color in this mode, it must be black.

Reply 448 of 457, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

I am pleased to report that the games I originally posted as not work correctly now work correctly. Icon, Icondemo and 7 Spirits of Ra now work correctly in the recent DOSBox CVSs with the machinetype="cga".

One issue remains in the CVS:
The title screen of 7 Spirits of Ra does not display properly. The in-game graphics display correctly, but the title screen no longer does.

Reply 449 of 457, by robertmo

User metadata
Rank l33t++
Rank
l33t++

I will try to explain in a better way.

I have connected my ati cga card with composite output to my tv card. hue is set in its default position 0% (in nvidia's control pannel).

When I run any cga rgb game (for example "digger")colours are displayed properly with hue 0%.

When I run any cga 640x200 composite game (for example "king's quest I") colours are wrong and i have to change hue to 58%.

When I run "microsoft decathlon" (320x200 composite game) colours are displayed properly with hue 0%.

When I run "gamma force" (320x200 composite game) colours are wrong and i have to change hue to 58%.

So some 320x200 composite games use one hue setting while other 320x200 composite games use other hue setting. With some games it is obvious which hue setting they use (sky should be blue, grass green). But with some games it may not be that obvious (if they don't have sky and grass or sth like that). So I wonder how hue setting was chosen in the past.

Reply 452 of 457, by jal

User metadata
Rank Oldbie
Rank
Oldbie
Great Hierophant wrote:

The title screen of 7 Spirits of Ra does not display properly. The in-game graphics display correctly, but the title screen no longer does.

Could you elaborate on what "not properly" means in this case?

JAL

Reply 454 of 457, by robertmo

User metadata
Rank l33t++
Rank
l33t++

The proper title screen (and the actual game blinking, icon is blinking too) can be seen with hal's Mega Build 5.

I have checked all my cga compatible cards and it is blinking there too (but they are still cga compatible 😉 ). Hierophant should check it with his original ibm cga card 😀

I wonder why the game works properly with machine=pcjr with both cvs and mb5.

I think XT board is not needed:
http://www.mobygames.com/game/dos/seven-spiri … meCoverId,1626/

BTW this box says it is for both rgb and composite monitors. So unless there is some way to switch between rgb and composite in this game this means RGB games are supposed to produce proper composite output.

Reply 455 of 457, by robertmo

User metadata
Rank l33t++
Rank
l33t++

I know what's wrong with my ATI cga cards. They just don't display the combined colors correctly. Black and while vertical lines are displayed as colors with different hue, so i can correct it by changing hue in most 640x200 games like King's Quest I for example.
But but for example "gamma force" has some colors original not combined and some are combined from black and white vertical lines. So part of the picture is with default hue, and the other part is with different hue - so not possible to correct it as if you correct one part the other part will be wrong.
I guess it is just a coincidence that 640x200 games can be made playable by me cause on real tv or even tv cards it is not possible to make such a huge hue correction.
Other games: like microsoft decathlon that use colorful vertical lines, or pitstop II that uses black and white lines of different thickness are not correctable by hue changing at all.
So I guess the cards were designed only to display rgb games with composite out.

Reply 456 of 457, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

Icon and 7 Spirits now work correctly in the latest CVS. The cracked versions out there will have blinking graphics with machine type CGA. This is normal and appears on a true IBM CGA card in an IBM PC. Use machine type PCjr. for a proper experience. These games, their uncracked versions are available, await a real crack.

My original issues all having been resolved, this thread can finally be closed.