[Patch] CGA monochrome & selectable mono display
[Patch] CGA monochrome & selectable mono display
This patch will support CGA monochrome mode (only RGB)
and you can select monochrome display to Green, Amber, and Gray(paper-white) when CGA/HGC/MDA.
This patch is ported from 86Box, thanks Battler.
Known issues
- This tested and compiled only Windows, I don't know about Linux version.
who can test and patch this feature with Linux?
and you can select monochrome display to Green, Amber, and Gray(paper-white) when CGA/HGC/MDA.
This patch is ported from 86Box, thanks Battler.
Known issues
- This tested and compiled only Windows, I don't know about Linux version.
who can test and patch this feature with Linux?
Re: [Patch] CGA monochrome & selectable mono display
Sample... Various display type with Hercules
Re: [Patch] CGA monochrome & selectable mono display
That's really cool! It's a feature I've been missing :)
Unfortunately it did not work out of the box with Allegro, probably something with the code in allegro_blit_memtoscreen_8. I tried it with my SDL2-port in Linux and it works just fine after I added the modifications in win-d3d-fs.cc and removed all the #ifndefs.
Unfortunately it did not work out of the box with Allegro, probably something with the code in allegro_blit_memtoscreen_8. I tried it with my SDL2-port in Linux and it works just fine after I added the modifications in win-d3d-fs.cc and removed all the #ifndefs.
Re: [Patch] CGA monochrome & selectable mono display
I hope it would be committed soon! Thanks basic2004 and Battler
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: [Patch] CGA monochrome & selectable mono display
I wouldn't spend time on anything to do with the 8-bit blitting code, it's going away soon.
Re: [Patch] CGA monochrome & selectable mono display
I knew Sarah doesn't commit this yet, I guess this was worked only Windows.
but I save here this patch, added change contrast checkbox.
if you want this feature, use it.
Click 'Settings -> Video -> Change contrast for monochrome display' after this patch,
this will switch palette optimized for CGA graphics.
but I save here this patch, added change contrast checkbox.
if you want this feature, use it.
Click 'Settings -> Video -> Change contrast for monochrome display' after this patch,
this will switch palette optimized for CGA graphics.
Re: [Patch] CGA monochrome & selectable mono display
I expect SDL2 version! and solve this patch working on Linux.bit wrote:That's really cool! It's a feature I've been missing
Unfortunately it did not work out of the box with Allegro, probably something with the code in allegro_blit_memtoscreen_8. I tried it with my SDL2-port in Linux and it works just fine after I added the modifications in win-d3d-fs.cc and removed all the #ifndefs.
Re: [Patch] CGA monochrome & selectable mono display
Well, I guess eventually this could be modified to be done on a per-card level, though that would introduce code duplication.SarahWalker wrote:I wouldn't spend time on anything to do with the 8-bit blitting code, it's going away soon.
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: [Patch] CGA monochrome & selectable mono display
8-bit blitting code is now dead as of revs 733/734, so this will have to be re-written I'm afraid.
Re: [Patch] CGA monochrome & selectable mono display
Are you sure you did this right? In your commit, I see you made the code directly put palette indexes into the 32-bit color buffer which I'm not sure is right.
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: [Patch] CGA monochrome & selectable mono display
That's resolved here :
I like that you have so little faith in me that you assumed I didn't test this at all...
Code: Select all
if (cga->composite)
{
for (c = 0; c < x; c++)
buffer32->line[cga->displine][c] = ((uint32_t *)buffer32->line[cga->displine])[c] & 0xf;
Composite_Process(cga->cgamode, 0, x >> 2, buffer32->line[cga->displine]);
}
else
{
for (c = 0; c < x; c++)
((uint32_t *)buffer32->line[cga->displine])[c] = cgapal[((uint32_t *)buffer32->line[cga->displine])[c] & 0xf];
}
Re: [Patch] CGA monochrome & selectable mono display
I making this patch(working and testing now...) after rev733/734, CGA works, MDA works too.
CGA can change contrast now.
but MDA/HGC didn't. only changed contrast when checked this and boot,
Contrast changing option isn't need for MDA/HGC.
And HGC graphic modes are buggy in rev733/734 this shows only white(0x0f) when this should drawn gray(0x07) color too.
This drawn gray correctly until rev732.
Looks like here
CGA can change contrast now.
but MDA/HGC didn't. only changed contrast when checked this and boot,
Contrast changing option isn't need for MDA/HGC.
And HGC graphic modes are buggy in rev733/734 this shows only white(0x0f) when this should drawn gray(0x07) color too.
This drawn gray correctly until rev732.
Looks like here
Re: [Patch] CGA monochrome & selectable mono display
I patched and tested with rev734, this will work in WIndows but I don't know about Linux.
'Change contrast for monochrome monitor' works only CGA.
Let's try it if you like classic monochrome screen.
Known issue : HGC graphic mode (640x400 and so on) didn't applied color, looks white. but this problem was rev733/734's problem maybe.
'Change contrast for monochrome monitor' works only CGA.
Let's try it if you like classic monochrome screen.
Known issue : HGC graphic mode (640x400 and so on) didn't applied color, looks white. but this problem was rev733/734's problem maybe.
-
- Posts: 183
- Joined: Wed 18 Mar, 2015 5:27 am
Re: [Patch] CGA monochrome & selectable mono display
Wow, this is fantastic to see! Great work, basic2004. I've been looking forward to something like this for years! Hopefully it won't be too difficult to squash the HGC-related bugs that appear to have been introduced by revs 733/734.
I see this was ported from 86Box. Battler, can you say anything about where it came from before that? Did you write it from scratch? I know that VileRancour wrote something like this for some of the extended versions of DOSBox. Is this adapted from his work, by any chance?
I see this was ported from 86Box. Battler, can you say anything about where it came from before that? Did you write it from scratch? I know that VileRancour wrote something like this for some of the extended versions of DOSBox. Is this adapted from his work, by any chance?
Re: [Patch] CGA monochrome & selectable mono display
- ecksemess: I took the table of colors from VileRancour's DOSBox patch, but the code to make it work on 86Box was mine (I just added these as options to the existing palettized renderer code).
-
- Posts: 183
- Joined: Wed 18 Mar, 2015 5:27 am
Re: [Patch] CGA monochrome & selectable mono display
Sounds good. He did a fair amount of research on those colors and they're probably about as good as we're ever going to get without going much more in-depth on emulating different individual monitors etc. Well done!
Re: [Patch] CGA monochrome & selectable mono display
Added this patch in SDL2 + wxWidgets.
Tested both. SDL2 and Windows version. Here is a patch. Please do these after patch, before compile.
1. Please encode pc.xrc with wxrc
If you didn't encode, this will not apply correctly.
2. Edit wx-resources.cpp after encoding
to
Tested both. SDL2 and Windows version. Here is a patch. Please do these after patch, before compile.
1. Please encode pc.xrc with wxrc
Code: Select all
wxrc pc.xrc -v -c -o wx-resources.cpp
2. Edit wx-resources.cpp after encoding
Code: Select all
XRC_ADD_FILE(wxT("XRC_resource/wx-resources.cpp$._pc.xrc"), xml_res_file_7, xml_res_size_7, wxT("text/xml"));
wxXmlResource::Get()->Load(wxT("memory:XRC_resource/wx-resources.cpp$._pc.xrc"));
Code: Select all
XRC_ADD_FILE(wxT("XRC_resource/wx-resources.cpp$pc.xrc"), xml_res_file_7, xml_res_size_7, wxT("text/xml"));
wxXmlResource::Get()->Load(wxT("memory:XRC_resource/wx-resources.cpp$pc.xrc"));
- SarahWalker
- Site Admin
- Posts: 2054
- Joined: Thu 24 Apr, 2014 4:18 pm
Re: [Patch] CGA monochrome & selectable mono display
Committed at rev 751. I did rework the user interface a bit - everything's configured through the device config now.
Re: [Patch] CGA monochrome & selectable mono display
Thanks for commit, and thanks to bit and you!
Re: [Patch] CGA monochrome & selectable mono display
Thanks to you too! This was an old request by many now fulfilledbasic2004 wrote:Thanks for commit, and thanks to bit and you!
-
- Posts: 183
- Joined: Wed 18 Mar, 2015 5:27 am
Re: [Patch] CGA monochrome & selectable mono display
Yeah, this is pitch-perfect. Thanks to all involved! It would also be really cool to be able to add support for monochrome EGA and VGA monitors, though I'm not sure how much work would be involved in getting that working, realistically speaking. Does anyone know?
Re: [Patch] CGA monochrome & selectable mono display
I'm not sure I understand why would you like to emulate an EGA or VGA monitor... what difference would it make?
-
- Posts: 183
- Joined: Wed 18 Mar, 2015 5:27 am
Re: [Patch] CGA monochrome & selectable mono display
The difference between a monochrome EGA or VGA monitor and a color RGB one should be fairly self-explanatory, no?
Seriously, monochrome EGA and VGA monitors weren't very common, but they were a thing. I just thought it'd be fun to extend the monochrome CGA support to cover them.
Seriously, monochrome EGA and VGA monitors weren't very common, but they were a thing. I just thought it'd be fun to extend the monochrome CGA support to cover them.
Re: [Patch] CGA monochrome & selectable mono display
Now that you mention, I did saw a monochrome VGA monitor. Well, not sure if it qualifies as a monochrome as it has many shades of gray, but yeah, I know what you mean. I'd would a great add!ecksemmess wrote:The difference between a monochrome EGA or VGA monitor and a color RGB one should be fairly self-explanatory, no?
Seriously, monochrome EGA and VGA monitors weren't very common, but they were a thing. I just thought it'd be fun to extend the monochrome CGA support to cover them.
Re: [Patch] CGA monochrome & selectable mono display
Sorry,for interuption,but can someone please explain me how to get to the screen called "PCem Machine" on post Thu 01 Jun, 2017 12:17 pm ?
Re: [Patch] CGA monochrome & selectable mono display
- gremilkar: You need to compile PCem with the SDL2/WxWidgets UI for that.
- ppgrainbow
- Posts: 479
- Joined: Thu 04 Sep, 2014 7:03 am
- Contact:
Re: [Patch] CGA monochrome & selectable mono display
basic2004, have you though of applying the patch to add support for EGA and VGA monochrome displays yet? It would be awesome to add support!
Re: [Patch] CGA monochrome & selectable mono display
That's interesting but I don't know about monochrome EGA.ppgrainbow wrote:basic2004, have you though of applying the patch to add support for EGA and VGA monochrome displays yet? It would be awesome to add support!
I want to know EGA 16 colors on real monochrome monitor
and 64 palettes on real monochrome monitor too.
and I didn't heard about monochrome VGA.
Is this simply grayscale version of real VGA screen?
Re: [Patch] CGA monochrome & selectable mono display
There's tons of monochrome VGA/SVGA laptops and yes it would be just that, their period ending right around the mid-Pentium era (in US at least)
Last edited by leilei on Sat 17 Jun, 2017 8:17 am, edited 1 time in total.
- ppgrainbow
- Posts: 479
- Joined: Thu 04 Sep, 2014 7:03 am
- Contact:
Re: [Patch] CGA monochrome & selectable mono display
Monochrome VGA is simply a grayscale version of a real VGA screen. Here's a example: http://www.computernerdkev.heliohost.or ... 0035,s.jpgbasic2004 wrote:That's interesting but I don't know about monochrome EGA.ppgrainbow wrote:basic2004, have you though of applying the patch to add support for EGA and VGA monochrome displays yet? It would be awesome to add support!
I want to know EGA 16 colors on real monochrome monitor
and 64 palettes on real monochrome monitor too.
and I didn't heard about monochrome VGA.
Is this simply grayscale version of real VGA screen?
Monochrome EGA displays can have up to 16 grayscale shades (16 colours out of 64 palette colours). Monochrome VGA displays can have up to 64 grayscale shades (as opposed to 256 colours out of 262,144 palette colours). For monochrome super VGA displays, you can truly have up to 256 grays (as opposed to having 16-bit or 24-bit colours). Here's a example of what a monochrome super VGA monitor looks like: https://www.recycledgoods.com/miracle-m ... or-15-pin/
Here's a article regarding the Monochrome Experience - CGA, EGA and VGA: http://nerdlypleasures.blogspot.com/201 ... a-and.html