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 BdR » 2010-9-07 @ 21:47

Thanks VileRancour. I made another GWBASIC program that can display a .BMP file in color using the dithering technique. The .BMP files must have a 4bit palette (16 colors) and make use of the CGA composite colors. I converted some images to 160*200 .BMPs using Paint Shop Pro, so the actual image processing like scaling and anti-aliasing etc. is done in Paint Shop Pro; I'm not going to re-program all that (let alone in GW-BASIC). The image loading is pretty slow, oh well.. in dosbox you can speed it up by tapping CTRL-F12 a few times. See attachment for a zip with the BMPDITH.BAS and some .BMP example files.

I'm probably enjoying this CGA composite stuff a bit more than I should, but whatever (the GW-BASIC nostalgia is nice too btw :)). It's just that I'm surprised that CGA was capable of more than the 4 colors with a horrible default color palette (magenta, cyan, white and black). Back in the mid-to-late 1980s, I used to play pc games on an EGA-adapter and CGA had always seemed pretty useless to me. And until now I never understood why some games supported a monochrome dithering mode, because that usually made the game look even worse on my EGA monitor. So this composite color-burst stuff is a bit of a "aha" moment for me. :D
You do not have the required permissions to view the files attached to this post.
BdR
Newbie
 
Posts: 10
Joined: 2010-9-05 @ 15:15
Location: The Netherlands

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

Postby VileRancour » 2010-9-09 @ 10:52

Yeah my XT clone went from a monochrome monitor with CGA (actually a clone card that had an MDA-like text mode) to EGA... and besides my country uses PAL, so I had never actually seen Composite CGA in action until DOSbox came along really.

Does your GWBASIC program switch DOSbox into composite "mode" by itself? Because I'm having trouble with COMPCGA3.EXE for some reason - it doesn't appear to function at all in hi-res mode or cga's text mode as the screenshots indicate it should... at least Alt+P does nothing.
User avatar
VileRancour
Oldbie
 
Posts: 1127
Joined: 2003-5-14 @ 22:11
Location: B800:0000

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

Postby BdR » 2010-9-09 @ 19:52

My GWBASIC program doesn't switch into composite mode by itself. And COMPCGA3.EXE only works when you start DosBox with machine type CGA. There should be a line in the dosbox .config file with "machine=cga" or you can also just use this parameter:

dosbox -machine cga

You will recognise normal CGA mode right away at the startup by the blocky looking letters. :D btw I also remember my dad trying to connect a normal TV to our 286 and we tried out some games to see how they looked. Of course this was a PAL tv (i'm from the Netherlands) so it didn't work very well, and that's when my dad bought an EGA monitor.
BdR
Newbie
 
Posts: 10
Joined: 2010-9-05 @ 15:15
Location: The Netherlands

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

Postby ripsaw8080 » 2010-9-09 @ 21:14

FYI, you can easily toggle composite color with BASIC code:

Code: Select all
SCREEN 2: REM cga mode 6 (640x200x2)
OUT &H3D8,&H1A: REM enable color burst
OUT &H3D8,&H1E: REM disable color burst
User avatar
ripsaw8080
DOSBox Author
 
Posts: 3279
Joined: 2006-4-25 @ 23:24

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

Postby VileRancour » 2010-9-09 @ 22:13

Oh, of course I was trying with "machine=cga", it just didn't occur to me to mention the obvious :)
My silly mistake was something entirely different, it seems.... the first composite screenshots of gwbasic in this thread showed just white text, so I assumed that it was text mode (while it was in fact mode 6), since the characters look the same. So when compcga3 didn't work for me in text mode, I imagined there was a problem.
Don't remember in which time of day this occured, so it was probably either too much beer, or too little coffee
User avatar
VileRancour
Oldbie
 
Posts: 1127
Joined: 2003-5-14 @ 22:11
Location: B800:0000

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

Postby BdR » 2010-9-09 @ 23:24

@ripsaw8080: That's great, thanks for the code example. I've changed my BMPDITH to make use of this, so now you can press 'c' to switch color burst mode on and off. :happyhappy:
You do not have the required permissions to view the files attached to this post.
BdR
Newbie
 
Posts: 10
Joined: 2010-9-05 @ 15:15
Location: The Netherlands

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

Postby VileRancour » 2010-9-09 @ 23:46

Thanks BdR, this is quite fun

Check out DOOM and DOOM II in CGA composite mode :D title screens adapted with some tweaking, and viewed in DOSbox/BMPDITH with 4:3 aspect correction
You do not have the required permissions to view the files attached to this post.
User avatar
VileRancour
Oldbie
 
Posts: 1127
Joined: 2003-5-14 @ 22:11
Location: B800:0000

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

Postby Riyune » 2010-9-10 @ 03:26

Is there a way in Zdosbox 0.74 to select the alternative third palette in CGA (cyan, red, white)? I was wondering if a small TSR program could be written to add palette options to CGA games.
Jesus loves you, unless you have tatoos. Then you are going to hell.
Riyune
Newbie
 
Posts: 18
Joined: 2008-4-27 @ 03:30
Location: Earth

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

Postby wd » 2010-9-10 @ 06:17

Same way as on a real cga-capable PC.
wd
DOSBox Author
 
Posts: 10819
Joined: 2003-12-03 @ 21:23

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

Postby Riyune » 2010-9-12 @ 03:28

I dusted off my MS QuickBASIC Bible and see it is as simple as this:


OUT &H3D8, PEEK(&H465) OR 4

So I'll compile that as an .EXE and load just before running a CGA game, with DOSBOX graphics set of course to cga. I will see what happens.
Jesus loves you, unless you have tatoos. Then you are going to hell.
Riyune
Newbie
 
Posts: 18
Joined: 2008-4-27 @ 03:30
Location: Earth

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

Postby wd » 2010-9-12 @ 13:42

If you want to hack a different palette for some game, a pre-selection like
you're intending to do it may not work since registers are reset on mode switch.

Easiest would be changing the respective functions in the dosbox sources to
permanently override the 4-color palette to the one you want to try.
wd
DOSBox Author
 
Posts: 10819
Joined: 2003-12-03 @ 21:23

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

Postby Paul_Holmlund » 2010-9-12 @ 23:34

This thread still lives!!!

Awesome!

And those new images you're making look, to quote Peter Griffen.. "Frick'n Sweet!"

I'm working on am image editor that will export game graphics to composite CGA.

My aim is to recreate HiRes or DoubleHiRes Apple style games.

BTW, I'm Kiyote and Kiyotewolf and Kiyotelockewolf.. My accounts seem to get screwed up easily on this forum site for some reason.



~Kiyote!

I made that TSR in Turbo Pascal. If anyone wants any help with it, or anything remotely like it, let me know. I have line routines & plotting routines which draw with CGA composite colors properly adaptable to QBasic and GWbasic.
User avatar
Paul_Holmlund
Newbie
 
Posts: 9
Joined: 2010-9-12 @ 23:26

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

Postby Paul_Holmlund » 2010-9-12 @ 23:39

Ooh yeah..

I made a video filetype called *.CGA.

It is a string of SCREEN 2 images, converted from an animated GIF, converted from a video file.

I am going to put together the files and upload it so you guys can tinker with it.

<.< I meant to do it awhile ago, but got sidetracked.

The converter was made from an animated GIF viewer in QBasic.



~Kiyote!

I use it to watch short youtube videos in beautiful composite CGA.
User avatar
Paul_Holmlund
Newbie
 
Posts: 9
Joined: 2010-9-12 @ 23:26

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

Postby VileRancour » 2010-9-13 @ 16:40

wd wrote:If you want to hack a different palette for some game, a pre-selection like
you're intending to do it may not work since registers are reset on mode switch.

Easiest would be changing the respective functions in the dosbox sources to
permanently override the 4-color palette to the one you want to try.


Now you got me wondering how hard it would be to write a patch, which would add hotkeys to cycle each one of the 4 colors between all possible CGA color-values (0 to 15)... so you'd be able to customize the palette on the fly. I think one C64 emulator has/had something similar.

The hard part would probably be getting the custom palette to "lock" for its respective screen mode... since so many CGA games feature a lot of palette changes.
Last edited by VileRancour on 2010-9-13 @ 16:46, edited 1 time in total.
User avatar
VileRancour
Oldbie
 
Posts: 1127
Joined: 2003-5-14 @ 22:11
Location: B800:0000

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

Postby h-a-l-9000 » 2010-9-13 @ 16:45

On PCJr and Tandy you can do this with a TSR.
1+1=10
h-a-l-9000
DOSBox Author
 
Posts: 4179
Joined: 2005-2-23 @ 00:14

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

Postby VileRancour » 2010-9-13 @ 16:51

h-a-l-9000 wrote:On PCJr and Tandy you can do this with a TSR.


Interesting... as a matter of fact, I thought of this after seeing your recent PCJr/Tandy palette patch.
Does such a TSR already exist (and if so where)? And would it work by simply running it before any CGA game when machine=pcjr or tandy (I assume your patch would be required)?
User avatar
VileRancour
Oldbie
 
Posts: 1127
Joined: 2003-5-14 @ 22:11
Location: B800:0000

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

Postby h-a-l-9000 » 2010-9-13 @ 17:11

You'd have to hook INT10 and maybe the timer interrupt to catch even direct register writes.

I'm not sure to what extent it would work in SVN without the patch. I don't know if such a TSR already exists.
1+1=10
h-a-l-9000
DOSBox Author
 
Posts: 4179
Joined: 2005-2-23 @ 00:14

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

Postby BdR » 2010-9-13 @ 21:28

You don't have to make your own file format for CGA video, you can use the very old .GL file format. It supports 640*200*2 format too. This was an early animation format used by GRASP (GRaphical System for Presentation), it simply contained a script file and a number of .PIC files (PC-Paint format).

And then hack the GLVIEW.EXE so it turns to color burst, that would be totally oldschool :D
You do not have the required permissions to view the files attached to this post.
BdR
Newbie
 
Posts: 10
Joined: 2010-9-05 @ 15:15
Location: The Netherlands

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

Postby Paul_Holmlund » 2010-9-14 @ 02:53

I already made it.

I have converted video files already finished.



~Kiyote!
User avatar
Paul_Holmlund
Newbie
 
Posts: 9
Joined: 2010-9-12 @ 23:26

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

Postby Paul_Holmlund » 2010-9-15 @ 21:36

@Bdr

Do you have the original B/W line version of the tree frog, so I can directly port it back into GW-Basic (well, QBasic for me.. ) and have the original source image?

Pretty please?



~Kiyote!
User avatar
Paul_Holmlund
Newbie
 
Posts: 9
Joined: 2010-9-12 @ 23:26

PreviousNext

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 0 guests