CGA Composite Mode under DOSBOX (Commited r3804)

Here you can discuss the development of patches

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-26 @ 23:13

Lookie at all the pretty colors.

Did a test of the pattern generation needed to do composite colours.



Kiyote!

[EDIT]

@Dosbox authors

Do you want the actual code I've got that does this?

REM SWITCH VIDEO OUTPUT TO COLOR GRAPHICS ADAPTOR
DEF SEG=0
A=PEEK(&H410)
POKE &H410,(A AND &HCF) OR &H20
REM SWITCH TO MONOCHROME ADAPTOR
DEF SEG=0
A=PEEK(&H410):POKE &H410,A OR &H30


I know what you're thinking. Why change to the monochrome adaptor, then exit the routine? I dunno. I put both in that order in my *.BAS file, just to see if it would tickle the registers used to trigger the composite CGA. I didn't fix it since it wasn't broken, once I found out this worked in that particular manner.

In DOSBOX Dos, I've been able to run CMPOSITE.EXE once, enter BASICA, exit BASICA, then re-enter BASICA, with the COLOR BURST flag still set in local emulated memory.

This means, I'm on the right track.

I don't have a good classic game that uses composite cga to test this with. Used to,.. years ago.



Kiyote!
You do not have the required permissions to view the files attached to this post.
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby eL_PuSHeR » 2009-5-27 @ 07:44

PNG format is better for screenshots captures.
User avatar
eL_PuSHeR
Moderator
 
Posts: 6315
Joined: 2003-6-20 @ 16:39

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-27 @ 08:12

I'm thinking about making a ""Jingle Disk, Xmas demo program in Tandy EX Basica that uses composite CGA for colors, and the 3voice audio chip for teh musics..

Ahhh.. just like the old days.



Kiyote!

P.S. Has this gotten any games to work? I am waiting to see if anyone is having any luck yet.

[EDIT]
Added a picture comparing composite emulation from Apple to CGA generic IBM compatible. Nifty huh?

NOTICE: If someone could create a TSR routine that would set these values at a certain keypress combination, it might be the key to trigger the composite COLOR BURST flag whenever we need it to.

I used to have code to make TSR's in Turbo Pascal, but I have to really dig ALOT to actually find that again. Plus, it might make using some games difficult because it would eat up conventional memory as well.

If someone could create a tiny compiled version of the idea, using the code I posted previously in this thread, that's a TSR, this might solve (all?) our problems. Just need something there to tickle the memory addresses there.

I will try to come up with it on my own.. providing the code I once had ever shows up again.
You do not have the required permissions to view the files attached to this post.
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-27 @ 12:58

MORE SUCCESS!!!

I googled code on making TSR's in TP, and on my 3rd version, it did actively change the mode from plain CGA to composite CGA in GWBASIC.

I dunno how well it's going to work for other things, but since GWbasic was being a bugger to me at first, I'm sure these new utilities will work much better.

COMPCGA3.EXE is stable, and seems to work best with the higher resolution COMPOSITE CGA, the 640x200x2.

COMPCGA4.EXE is buggy, cause I was adding more register port flag flipping using an XOR. This did however, take a monotone blue sierra xmas demo, and turn it into a half-window sized 4 color cga (not composite emulation) screen.



These install into memory and operate on ALT-P.

You can press ALT-P during the game any time to try to affect the composite emulation flag. ""Tickle the registers using COMPCGA3.exe, since it seems to work the best so far.



Kiyote!

P.S. There is no stupid 4 second wait delay on these programs advertising myself, just a simple text dump to the screen. If you > NUL in a *.BAT file, you won't even know I was there.
You do not have the required permissions to view the files attached to this post.
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-27 @ 14:00

Two more files.

For those of you adventurous enough to try it, I have two more versions of COMPCGA.

CompCGA5.exe and CompCGA6.exe

These will cycle through 4 bits of flags of CGA port register values. only 3 bits of flags in compcga5.

NOTICE: You have to LET GO OF ALT when you go to press ALT-P over and over.

These two get some very freaky modes.
You do not have the required permissions to view the files attached to this post.
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby ripsaw8080 » 2009-5-27 @ 16:26

Maybe I'm missing the point of what you're trying to accomplish. DOSBox's CGA emulation supports composite color artifacting with 640x200x2 (mode 6) and the color burst bit just fine. What is lacking is support for the artifacted color with 320x200x4 (modes 4 & 5), and I don't think anything you can do from within the emulation is going to make it work, as the support has yet to be coded into DOSBox.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3339
Joined: 2006-4-25 @ 23:24

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-27 @ 22:11

Playing with it endlessly, I found out that you are indeed correct.

What I thought I was seeing as the 320x200x4 in composite mode, SCREEN 1 of Tandy BASICA, was actually a glitch that had the same look.

When I went from 640x200x2 composite to 320x200x4, it made some artifacts on the screen in the upper left corner. I thought it was actually in that mode.



Kiyote!

I have a picture of the glitch that I misinterpreted.
You do not have the required permissions to view the files attached to this post.
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-28 @ 06:51

Now I'm going to spend endless amounts of time testing CGA games and demos with SIMCGA and other CGA emulation utilities to see if I can make some magic happen.

If you could get Hercules video with composite on, and simulate CGA in composite, (which theortically is not possible..), you'd get something..

I'm pretty proud of COMPCGA3.EXE. It does 99% of what I want it to.



Kiyote!
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-28 @ 08:03

A tiny sliver more of success.



I fudged (borked? kludged?) up a mixture of my COMPCGA3, SETMONO, SIMCGA, and stuff like that, and got this.

It shows this screen, on it's own accord, so it's not a bug.

Is this more of what you're talking about with CGA 320x200x4 composite mode?



Kiyote!

[EDIT]

<Sark> You're very persistant TRON!

BTW, after that lovely picture of weird 320x200xNTSC, the game locks up.

I think what someone needs to do is build up a CGA emulation TSR similar to the SIMCGA, that will draw the 320x200 in 640x200 so it can color artifact itself.

I think I might've finally hit the glass ceiling on possibilities with this little exercise.

I dunno what I did right to get the image that is shown there, but it did involve running multiple CGA/Herc/etc stuffs concurrently to try to overlap some of the emulation and stuff into something more like we want, as a *.BAT file. The screen went blank alot when I was testing SIMCGA, so I stuffed the commands into the *.BAT file so I could test without having to type blind.
You do not have the required permissions to view the files attached to this post.
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby ripsaw8080 » 2009-5-28 @ 13:45

Using a TSR that requires a key press can be problematic, since some games take over the keyboard and don't let underlying programs (such as DOS) see the key presses. I figured it might be worthwhile to try a more automatic approach, and was able to get some nice results, although it's imperfect.

The attached TSR and assembly code is very quick-and-dirty, and basically monitors INT 10 watching for video modes 4 or 5 to be set, and then sets video mode 6 instead, afterwards flipping the color burst bit. It only works with the CGA machine type, of course. Quite a few games work with this, and display artifacted colors; although I couldn't say if the colors are correct. I've also attached some example screenshots. However, some games don't work; for example Alley Cat, which only displays a black screen. Still, it is somewhat surprising that it works as well as it does.
You do not have the required permissions to view the files attached to this post.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3339
Joined: 2006-4-25 @ 23:24

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby Great Hierophant » 2009-5-28 @ 14:36

These attempts are neat as proof of concept, but I think we can all agree that a new machine type must be added to DOSBox, or that the TSR must be able to turn on composite rendering based on the status of the color burst bit.
User avatar
Great Hierophant
Oldbie
 
Posts: 1831
Joined: 2003-4-27 @ 08:20

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby Qbix » 2009-5-28 @ 14:46

s/must be added /could be added/

Thank you.
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 9763
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby HunterZ » 2009-5-28 @ 14:52

could -> should :p
You're perfect, yes it's true...but without me, you're only you.
User avatar
HunterZ
l33t++
 
Posts: 5777
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby wd » 2009-5-28 @ 15:01

should -> may (but can live without)
wd
DOSBox Author
 
Posts: 10819
Joined: 2003-12-03 @ 21:23

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby ripsaw8080 » 2009-5-28 @ 15:34

Some games check the video mode after they set it, so it's also necessary to report back the intended mode or they might think the mode change failed. Also, setting the background/border color was causing Alley Cat and some others to display a black screen, so I trap that now as well. The attached TSR has enhanced checking for the little issues, and now Alley Cat and Fooblitzky (the game this thread originally referenced) work with it. Alley Cat is showing some areas that are not artifacted, but it's kind of a dirty hack to begin with; can't expect much.

@Hierophant: This is just tinkering with a workaround. It is somewhat effective, but imperfect, and clearly no stand-in for real support... but hard to say if/when that will happen.
You do not have the required permissions to view the files attached to this post.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3339
Joined: 2006-4-25 @ 23:24

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-28 @ 16:45

@ripsaw8080

Quoted ~ "Still, it is somewhat surprising that it works as well as it does."

Are you referring to my TSR or to DOSBOX emulation? or something else?

@everyone else

Also, what was done to the code to upgrade the TSR? I noticed that in a post there's an upgraded TSR program.

All those screenshots are fresh and proof that our attempts are working?

Did someone get the 320x200xNTSC working?

I'm a bit vague on how much progress we have. Are we winnng?



Kiyote!

BTW.. the TSR code had a ton of unnecessary hooks in it. It was a "build a TSR for dummies" bit of code I stumbled on. I just slapped together to get it to work for me.

CGACOMP3 sets those 1040 memory locations as well as setting one of the CGA port registers, bit 1, to zero. That's what I did thar.

I like all the teamwork on this issue.
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-29 @ 00:37

I just tried that KONG game using your new TSR.

AWESOME!!!!!!!!

Very clean neat and tidy code as well.

This TSR I think is going to be a new standard monkey wrench for some of us hard core old schoolers.

"Are we winning"

Golly gee whiz.. I think so..



Kiyote!

P.S. I'm going to be converting an animated GIF player in QBasic from 320x200x256 to 160x200xNTSC for fun. Anyone interested? Should be done converting it in a day or two. I'll have a compiled version available to download it anyone likes that idea.



[EDIT] I renamed your new awesome monkeywrench TSR, ""CGAVOGON.COM in honor of the forum & thread that produced it.

[EDIT2] Added screen shots of Loom (tm) autodemo.
You do not have the required permissions to view the files attached to this post.
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby ripsaw8080 » 2009-5-29 @ 03:34

One thing a TSR can't do is monitor port writes, so games that write to port 0x3d8 are a problem. I had to hack Boulder Dash II to stop it from messing up the color burst so I could capture a composite screenshot. The BD2 title screen is a good example of patterns that are specifically intended to produce artifact colors on composite monitors. Although the colors are probably off from what they should be, it still demonstrates the effect pretty well.
You do not have the required permissions to view the files attached to this post.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3339
Joined: 2006-4-25 @ 23:24

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby KiyoteLockeWolf » 2009-5-29 @ 04:43

Wow. You can really tell it WAS meant to work in CGA/NTSC.

I love all these awesome awesome screenshots!

Having lived through that time when your Apple monitor could go from hi-res bitmap with the color burst disabled on the monitor (that monitor was SO SO SO AWESOME TO PLAY SMB3 WITH AN NES ON.. OMG.. colors just popped out at you like nuts!) you tend to cling to the older way of doing things.

I have a VGA-to-TV box. I'm going to be using that soon to play some classic games in CGA/NTSC on a real TV again.

I wonder what other games look really cool in CGA/NTSC, whether they take advantage of it or not. I like being able to say, "ON! NOW SIT.. STAY.. GOOD CGA.."

I also, have a really good computer parts/junk store. They have 5-1/4" drives, (going to get one soon!!!), and a box usually full of all kinds of cool stuff. One good find I oughta pick up is a VGA card with a MDA port on it. The original code I posted would is aimed at some type of (older) setup like that, with multiple monitors on one computer.

I also took a drafting class that had SVGA with a MDA monitor right beside it. You watched your fancy CAD, and placed your option menus on the monochrome display while you did fancy math drawing type stuff.



I would love to get my hands on a REAL original OEM CGA card, and of course a computer with a case wide enough to fit it. I found one of the pictures. Unless it was the developers card, it was HUGE! I think I did see a commercial smallish CGA card which was a decent size though.



Kiyote!
If it ain't borked, fix it 7 times.. Reinvent the wheel every day. Compile 8085/8086 code daily. Drink lots of instant coffee. Look both ways before cooking a turkey.
User avatar
KiyoteLockeWolf
Newbie
 
Posts: 23
Joined: 2008-4-06 @ 16:08

Re: How do you switch to CGA Composite Mode? (Fooblitzky)

Postby TeaRex » 2009-5-29 @ 05:19

Guys, I'm not planning on stopping your enthusiasm, but there was a reason those games didn't use mode 6 in the first place.

Mode 6 + burst bit is pure artifact colors; in mode 4/5, the artifact colors will combine with the color-circuitry colors in a specific way. Basically you have those luminance stripes and the chrominance "stripe" signals from the CGA's composite encoder adding up. The result will not be completely representable with a mode 6 algorithm, no matter how smart your TSR will be.
tearex
TeaRex
Member
 
Posts: 398
Joined: 2005-2-06 @ 07:39

PreviousNext

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest