Added ability to choose monochrome displays (green, amber, and gray) for CGA MDA, and Hercules graphics cards, based on VileRancour's DOSBox patch.
This commit is contained in:
@@ -12,6 +12,9 @@
|
|||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "vid_cga.h"
|
#include "vid_cga.h"
|
||||||
#include "dosbox/vid_cga_comp.h"
|
#include "dosbox/vid_cga_comp.h"
|
||||||
|
#ifndef __unix
|
||||||
|
#include "win-cgapal.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CGA_RGB 0
|
#define CGA_RGB 0
|
||||||
#define CGA_COMPOSITE 1
|
#define CGA_COMPOSITE 1
|
||||||
@@ -462,6 +465,11 @@ void *cga_standalone_init()
|
|||||||
|
|
||||||
overscan_x = overscan_y = 16;
|
overscan_x = overscan_y = 16;
|
||||||
|
|
||||||
|
#ifndef __unix
|
||||||
|
cga_palette = device_get_config_int("rgb_type");
|
||||||
|
rebuild_cgapal();
|
||||||
|
#endif
|
||||||
|
|
||||||
return cga;
|
return cga;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,6 +530,48 @@ static device_config_t cga_config[] =
|
|||||||
},
|
},
|
||||||
.default_int = COMPOSITE_OLD
|
.default_int = COMPOSITE_OLD
|
||||||
},
|
},
|
||||||
|
#ifndef __unix
|
||||||
|
{
|
||||||
|
.name = "rgb_type",
|
||||||
|
.description = "RGB type",
|
||||||
|
.type = CONFIG_SELECTION,
|
||||||
|
.selection =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.description = "Full 16-color",
|
||||||
|
.value = 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Green, 4-color",
|
||||||
|
.value = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Green, 16-color",
|
||||||
|
.value = 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Amber, 4-color",
|
||||||
|
.value = 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Amber, 16-color",
|
||||||
|
.value = 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Gray, 4-color",
|
||||||
|
.value = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Gray, 16-color",
|
||||||
|
.value = 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.default_int = 0
|
||||||
|
},
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
.name = "snow_enabled",
|
.name = "snow_enabled",
|
||||||
.description = "Snow emulation",
|
.description = "Snow emulation",
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "vid_hercules.h"
|
#include "vid_hercules.h"
|
||||||
|
#ifndef __unix
|
||||||
|
#include "win-cgapal.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct hercules_t
|
typedef struct hercules_t
|
||||||
{
|
{
|
||||||
@@ -342,6 +345,11 @@ void *hercules_init()
|
|||||||
|
|
||||||
overscan_x = overscan_y = 0;
|
overscan_x = overscan_y = 0;
|
||||||
|
|
||||||
|
#ifndef __unix
|
||||||
|
cga_palette = device_get_config_int("rgb_type");
|
||||||
|
rebuild_cgapal();
|
||||||
|
#endif
|
||||||
|
|
||||||
return hercules;
|
return hercules;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,6 +368,40 @@ void hercules_speed_changed(void *p)
|
|||||||
hercules_recalctimings(hercules);
|
hercules_recalctimings(hercules);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __unix
|
||||||
|
static device_config_t hercules_config[] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.name = "rgb_type",
|
||||||
|
.description = "Display type",
|
||||||
|
.type = CONFIG_SELECTION,
|
||||||
|
.selection =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.description = "Default 4-color",
|
||||||
|
.value = 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Green, 4-color",
|
||||||
|
.value = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Amber, 4-color",
|
||||||
|
.value = 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Gray, 4-color",
|
||||||
|
.value = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.default_int = 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
device_t hercules_device =
|
device_t hercules_device =
|
||||||
{
|
{
|
||||||
"Hercules",
|
"Hercules",
|
||||||
@@ -369,5 +411,10 @@ device_t hercules_device =
|
|||||||
NULL,
|
NULL,
|
||||||
hercules_speed_changed,
|
hercules_speed_changed,
|
||||||
NULL,
|
NULL,
|
||||||
|
#ifdef __unix
|
||||||
NULL
|
NULL
|
||||||
|
#else
|
||||||
|
NULL,
|
||||||
|
hercules_config
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "vid_mda.h"
|
#include "vid_mda.h"
|
||||||
|
#ifndef __unix
|
||||||
|
#include "win-cgapal.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct mda_t
|
typedef struct mda_t
|
||||||
{
|
{
|
||||||
@@ -298,6 +301,11 @@ void *mda_init()
|
|||||||
|
|
||||||
overscan_x = overscan_y = 0;
|
overscan_x = overscan_y = 0;
|
||||||
|
|
||||||
|
#ifndef __unix
|
||||||
|
cga_palette = device_get_config_int("rgb_type");
|
||||||
|
rebuild_cgapal();
|
||||||
|
#endif
|
||||||
|
|
||||||
return mda;
|
return mda;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,6 +324,40 @@ void mda_speed_changed(void *p)
|
|||||||
mda_recalctimings(mda);
|
mda_recalctimings(mda);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __unix
|
||||||
|
static mda_config_t hercules_config[] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.name = "rgb_type",
|
||||||
|
.description = "Display type",
|
||||||
|
.type = CONFIG_SELECTION,
|
||||||
|
.selection =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.description = "Default 4-color",
|
||||||
|
.value = 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Green, 4-color",
|
||||||
|
.value = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Amber, 4-color",
|
||||||
|
.value = 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Gray, 4-color",
|
||||||
|
.value = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.default_int = 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
device_t mda_device =
|
device_t mda_device =
|
||||||
{
|
{
|
||||||
"MDA",
|
"MDA",
|
||||||
@@ -325,5 +367,10 @@ device_t mda_device =
|
|||||||
NULL,
|
NULL,
|
||||||
mda_speed_changed,
|
mda_speed_changed,
|
||||||
NULL,
|
NULL,
|
||||||
|
#ifdef __unix
|
||||||
NULL
|
NULL
|
||||||
|
#else
|
||||||
|
NULL,
|
||||||
|
mda_config
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
10
src/video.c
10
src/video.c
@@ -16,6 +16,9 @@
|
|||||||
#include "rom.h"
|
#include "rom.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
#ifndef __unix
|
||||||
|
#include "win-cgapal.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "vid_ati18800.h"
|
#include "vid_ati18800.h"
|
||||||
#include "vid_ati28800.h"
|
#include "vid_ati28800.h"
|
||||||
@@ -49,6 +52,8 @@
|
|||||||
#include "vid_vga.h"
|
#include "vid_vga.h"
|
||||||
#include "vid_wy700.h"
|
#include "vid_wy700.h"
|
||||||
|
|
||||||
|
int cga_palette = 0;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char name[64];
|
char name[64];
|
||||||
@@ -255,6 +260,11 @@ void video_init()
|
|||||||
{
|
{
|
||||||
pclog("Video_init %i %i\n",romset,gfxcard);
|
pclog("Video_init %i %i\n",romset,gfxcard);
|
||||||
|
|
||||||
|
#ifndef __unix
|
||||||
|
cga_palette = 0;
|
||||||
|
cgapal_rebuild();
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (romset)
|
switch (romset)
|
||||||
{
|
{
|
||||||
case ROM_IBMPCJR:
|
case ROM_IBMPCJR:
|
||||||
|
|||||||
@@ -108,3 +108,5 @@ void ddraw_fs_take_screenshot(char *fn);
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int cga_palette;
|
||||||
|
|||||||
4
src/win-cgapal.h
Normal file
4
src/win-cgapal.h
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
extern PALETTE cgapal;
|
||||||
|
extern PALETTE cgapal_mono[6];
|
||||||
|
|
||||||
|
void cgapal_rebuild();
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "win-d3d-fs.h"
|
#include "win-d3d-fs.h"
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
|
#include "win-cgapal.h"
|
||||||
|
|
||||||
extern "C" void fatal(const char *format, ...);
|
extern "C" void fatal(const char *format, ...);
|
||||||
extern "C" void pclog(const char *format, ...);
|
extern "C" void pclog(const char *format, ...);
|
||||||
@@ -42,7 +43,7 @@ struct CUSTOMVERTEX
|
|||||||
FLOAT tu, tv;
|
FLOAT tu, tv;
|
||||||
};
|
};
|
||||||
|
|
||||||
static PALETTE cgapal=
|
PALETTE cgapal =
|
||||||
{
|
{
|
||||||
{0,0,0},{0,42,0},{42,0,0},{42,21,0},
|
{0,0,0},{0,42,0},{42,0,0},{42,21,0},
|
||||||
{0,0,0},{0,42,42},{42,0,42},{42,42,42},
|
{0,0,0},{0,42,42},{42,0,42},{42,42,42},
|
||||||
@@ -65,6 +66,34 @@ static PALETTE cgapal=
|
|||||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PALETTE cgapal_mono[6] =
|
||||||
|
{
|
||||||
|
{ // 0 - green, 4-color-optimized contrast
|
||||||
|
{0x00,0x00,0x00},{0x00,0x0d,0x03},{0x01,0x17,0x05},{0x01,0x1a,0x06},{0x02,0x28,0x09},{0x02,0x2c,0x0a},{0x03,0x39,0x0d},{0x03,0x3c,0x0e},
|
||||||
|
{0x00,0x07,0x01},{0x01,0x13,0x04},{0x01,0x1f,0x07},{0x01,0x23,0x08},{0x02,0x31,0x0b},{0x02,0x35,0x0c},{0x05,0x3f,0x11},{0x0d,0x3f,0x17},
|
||||||
|
},
|
||||||
|
{ // 1 - green, 16-color-optimized contrast
|
||||||
|
{0x00,0x00,0x00},{0x00,0x0d,0x03},{0x01,0x15,0x05},{0x01,0x17,0x05},{0x01,0x21,0x08},{0x01,0x24,0x08},{0x02,0x2e,0x0b},{0x02,0x31,0x0b},
|
||||||
|
{0x01,0x22,0x08},{0x02,0x28,0x09},{0x02,0x30,0x0b},{0x02,0x32,0x0c},{0x03,0x39,0x0d},{0x03,0x3b,0x0e},{0x09,0x3f,0x14},{0x0d,0x3f,0x17},
|
||||||
|
},
|
||||||
|
{ // 2 - amber, 4-color-optimized contrast
|
||||||
|
{0x00,0x00,0x00},{0x15,0x05,0x00},{0x20,0x0b,0x00},{0x24,0x0d,0x00},{0x33,0x18,0x00},{0x37,0x1b,0x00},{0x3f,0x26,0x01},{0x3f,0x2b,0x06},
|
||||||
|
{0x0b,0x02,0x00},{0x1b,0x08,0x00},{0x29,0x11,0x00},{0x2e,0x14,0x00},{0x3b,0x1e,0x00},{0x3e,0x21,0x00},{0x3f,0x32,0x0a},{0x3f,0x38,0x0d},
|
||||||
|
},
|
||||||
|
{ // 3 - amber, 16-color-optimized contrast
|
||||||
|
{0x00,0x00,0x00},{0x15,0x05,0x00},{0x1e,0x09,0x00},{0x21,0x0b,0x00},{0x2b,0x12,0x00},{0x2f,0x15,0x00},{0x38,0x1c,0x00},{0x3b,0x1e,0x00},
|
||||||
|
{0x2c,0x13,0x00},{0x32,0x17,0x00},{0x3a,0x1e,0x00},{0x3c,0x1f,0x00},{0x3f,0x27,0x01},{0x3f,0x2a,0x04},{0x3f,0x36,0x0c},{0x3f,0x38,0x0d},
|
||||||
|
},
|
||||||
|
{ // 4 - grey, 4-color-optimized contrast
|
||||||
|
{0x00,0x00,0x00},{0x0d,0x0d,0x0d},{0x15,0x15,0x15},{0x18,0x18,0x18},{0x24,0x24,0x24},{0x27,0x27,0x27},{0x33,0x33,0x33},{0x37,0x37,0x37},
|
||||||
|
{0x08,0x08,0x08},{0x10,0x10,0x10},{0x1c,0x1c,0x1c},{0x20,0x20,0x20},{0x2c,0x2c,0x2c},{0x2f,0x2f,0x2f},{0x3b,0x3b,0x3b},{0x3f,0x3f,0x3f},
|
||||||
|
},
|
||||||
|
{ // 5 - grey, 16-color-optimized contrast
|
||||||
|
{0x00,0x00,0x00},{0x0d,0x0d,0x0d},{0x12,0x12,0x12},{0x15,0x15,0x15},{0x1e,0x1e,0x1e},{0x20,0x20,0x20},{0x29,0x29,0x29},{0x2c,0x2c,0x2c},
|
||||||
|
{0x1f,0x1f,0x1f},{0x23,0x23,0x23},{0x2b,0x2b,0x2b},{0x2d,0x2d,0x2d},{0x34,0x34,0x34},{0x36,0x36,0x36},{0x3d,0x3d,0x3d},{0x3f,0x3f,0x3f},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
static uint32_t pal_lookup[256];
|
static uint32_t pal_lookup[256];
|
||||||
|
|
||||||
static CUSTOMVERTEX d3d_verts[] =
|
static CUSTOMVERTEX d3d_verts[] =
|
||||||
@@ -78,6 +107,17 @@ static CUSTOMVERTEX d3d_verts[] =
|
|||||||
{2048.0f, 2048.0f, 1.0f, 1.0f, 1.0f, 1.0f},
|
{2048.0f, 2048.0f, 1.0f, 1.0f, 1.0f, 1.0f},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void cgapal_rebuild()
|
||||||
|
{
|
||||||
|
for (c = 0; c < 256; c++)
|
||||||
|
pal_lookup[c] = makecol(cgapal[c].r << 2, cgapal[c].g << 2, cgapal[c].b << 2);
|
||||||
|
if (cga_palette > 1)
|
||||||
|
{
|
||||||
|
for (c = 0; c < 16; c++)
|
||||||
|
pal_lookup[c + 16] = makecol(cgapal_mono[cga_palette - 1][c].r, cgapal_mono[cga_palette - 1][c].g, cgapal_mono[cga_palette - 1][c].b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void d3d_fs_init(HWND h)
|
void d3d_fs_init(HWND h)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
@@ -87,8 +127,7 @@ void d3d_fs_init(HWND h)
|
|||||||
d3d_fs_w = GetSystemMetrics(SM_CXSCREEN);
|
d3d_fs_w = GetSystemMetrics(SM_CXSCREEN);
|
||||||
d3d_fs_h = GetSystemMetrics(SM_CYSCREEN);
|
d3d_fs_h = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
|
||||||
for (c = 0; c < 256; c++)
|
cgapal_rebuild();
|
||||||
pal_lookup[c] = makecol(cgapal[c].r << 2, cgapal[c].g << 2, cgapal[c].b << 2);
|
|
||||||
|
|
||||||
d3d_hwnd = h;
|
d3d_hwnd = h;
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "resources.h"
|
#include "resources.h"
|
||||||
#include "win-d3d.h"
|
#include "win-d3d.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
|
#include "win-cgapal.h"
|
||||||
|
|
||||||
extern "C" void fatal(const char *format, ...);
|
extern "C" void fatal(const char *format, ...);
|
||||||
extern "C" void pclog(const char *format, ...);
|
extern "C" void pclog(const char *format, ...);
|
||||||
@@ -35,29 +36,6 @@ struct CUSTOMVERTEX
|
|||||||
FLOAT tu, tv;
|
FLOAT tu, tv;
|
||||||
};
|
};
|
||||||
|
|
||||||
static PALETTE cgapal=
|
|
||||||
{
|
|
||||||
{0,0,0},{0,42,0},{42,0,0},{42,21,0},
|
|
||||||
{0,0,0},{0,42,42},{42,0,42},{42,42,42},
|
|
||||||
{0,0,0},{21,63,21},{63,21,21},{63,63,21},
|
|
||||||
{0,0,0},{21,63,63},{63,21,63},{63,63,63},
|
|
||||||
|
|
||||||
{0,0,0},{0,0,42},{0,42,0},{0,42,42},
|
|
||||||
{42,0,0},{42,0,42},{42,21,00},{42,42,42},
|
|
||||||
{21,21,21},{21,21,63},{21,63,21},{21,63,63},
|
|
||||||
{63,21,21},{63,21,63},{63,63,21},{63,63,63},
|
|
||||||
|
|
||||||
{0,0,0},{0,21,0},{0,0,42},{0,42,42},
|
|
||||||
{42,0,21},{21,10,21},{42,0,42},{42,0,63},
|
|
||||||
{21,21,21},{21,63,21},{42,21,42},{21,63,63},
|
|
||||||
{63,0,0},{42,42,0},{63,21,42},{41,41,41},
|
|
||||||
|
|
||||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
|
||||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
|
||||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
|
||||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
|
||||||
};
|
|
||||||
|
|
||||||
static uint32_t pal_lookup[256];
|
static uint32_t pal_lookup[256];
|
||||||
|
|
||||||
static CUSTOMVERTEX d3d_verts[] =
|
static CUSTOMVERTEX d3d_verts[] =
|
||||||
@@ -76,8 +54,7 @@ void d3d_init(HWND h)
|
|||||||
int c;
|
int c;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
for (c = 0; c < 256; c++)
|
cgapal_rebuild();
|
||||||
pal_lookup[c] = makecol(cgapal[c].r << 2, cgapal[c].g << 2, cgapal[c].b << 2);
|
|
||||||
|
|
||||||
d3d_hwnd = h;
|
d3d_hwnd = h;
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "win-ddraw-fs.h"
|
#include "win-ddraw-fs.h"
|
||||||
#include "win-ddraw-screenshot.h"
|
#include "win-ddraw-screenshot.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
|
#include "win-cgapal.h"
|
||||||
|
|
||||||
extern "C" void fatal(const char *format, ...);
|
extern "C" void fatal(const char *format, ...);
|
||||||
extern "C" void pclog(const char *format, ...);
|
extern "C" void pclog(const char *format, ...);
|
||||||
@@ -33,29 +34,6 @@ static DDSURFACEDESC2 ddsd;
|
|||||||
static HWND ddraw_hwnd;
|
static HWND ddraw_hwnd;
|
||||||
static int ddraw_w, ddraw_h;
|
static int ddraw_w, ddraw_h;
|
||||||
|
|
||||||
static PALETTE cgapal =
|
|
||||||
{
|
|
||||||
{0,0,0},{0,42,0},{42,0,0},{42,21,0},
|
|
||||||
{0,0,0},{0,42,42},{42,0,42},{42,42,42},
|
|
||||||
{0,0,0},{21,63,21},{63,21,21},{63,63,21},
|
|
||||||
{0,0,0},{21,63,63},{63,21,63},{63,63,63},
|
|
||||||
|
|
||||||
{0,0,0},{0,0,42},{0,42,0},{0,42,42},
|
|
||||||
{42,0,0},{42,0,42},{42,21,00},{42,42,42},
|
|
||||||
{21,21,21},{21,21,63},{21,63,21},{21,63,63},
|
|
||||||
{63,21,21},{63,21,63},{63,63,21},{63,63,63},
|
|
||||||
|
|
||||||
{0,0,0},{0,21,0},{0,0,42},{0,42,42},
|
|
||||||
{42,0,21},{21,10,21},{42,0,42},{42,0,63},
|
|
||||||
{21,21,21},{21,63,21},{42,21,42},{21,63,63},
|
|
||||||
{63,0,0},{42,42,0},{63,21,42},{41,41,41},
|
|
||||||
|
|
||||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
|
||||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
|
||||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
|
||||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
|
||||||
};
|
|
||||||
|
|
||||||
static uint32_t pal_lookup[256];
|
static uint32_t pal_lookup[256];
|
||||||
|
|
||||||
void ddraw_fs_init(HWND h)
|
void ddraw_fs_init(HWND h)
|
||||||
@@ -65,8 +43,7 @@ void ddraw_fs_init(HWND h)
|
|||||||
ddraw_w = GetSystemMetrics(SM_CXSCREEN);
|
ddraw_w = GetSystemMetrics(SM_CXSCREEN);
|
||||||
ddraw_h = GetSystemMetrics(SM_CYSCREEN);
|
ddraw_h = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
|
||||||
for (c = 0; c < 256; c++)
|
cgapal_rebuild();
|
||||||
pal_lookup[c] = makecol(cgapal[c].r << 2, cgapal[c].g << 2, cgapal[c].b << 2);
|
|
||||||
|
|
||||||
if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL)))
|
if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL)))
|
||||||
fatal("DirectDrawCreate failed\n");
|
fatal("DirectDrawCreate failed\n");
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "win-ddraw.h"
|
#include "win-ddraw.h"
|
||||||
#include "win-ddraw-screenshot.h"
|
#include "win-ddraw-screenshot.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
|
#include "win-cgapal.h"
|
||||||
|
|
||||||
extern "C" void fatal(const char *format, ...);
|
extern "C" void fatal(const char *format, ...);
|
||||||
extern "C" void pclog(const char *format, ...);
|
extern "C" void pclog(const char *format, ...);
|
||||||
@@ -33,37 +34,13 @@ static DDSURFACEDESC2 ddsd;
|
|||||||
|
|
||||||
static HWND ddraw_hwnd;
|
static HWND ddraw_hwnd;
|
||||||
|
|
||||||
static PALETTE cgapal=
|
|
||||||
{
|
|
||||||
{0,0,0},{0,42,0},{42,0,0},{42,21,0},
|
|
||||||
{0,0,0},{0,42,42},{42,0,42},{42,42,42},
|
|
||||||
{0,0,0},{21,63,21},{63,21,21},{63,63,21},
|
|
||||||
{0,0,0},{21,63,63},{63,21,63},{63,63,63},
|
|
||||||
|
|
||||||
{0,0,0},{0,0,42},{0,42,0},{0,42,42},
|
|
||||||
{42,0,0},{42,0,42},{42,21,00},{42,42,42},
|
|
||||||
{21,21,21},{21,21,63},{21,63,21},{21,63,63},
|
|
||||||
{63,21,21},{63,21,63},{63,63,21},{63,63,63},
|
|
||||||
|
|
||||||
{0,0,0},{0,21,0},{0,0,42},{0,42,42},
|
|
||||||
{42,0,21},{21,10,21},{42,0,42},{42,0,63},
|
|
||||||
{21,21,21},{21,63,21},{42,21,42},{21,63,63},
|
|
||||||
{63,0,0},{42,42,0},{63,21,42},{41,41,41},
|
|
||||||
|
|
||||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
|
||||||
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
|
|
||||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
|
||||||
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
|
|
||||||
};
|
|
||||||
|
|
||||||
static uint32_t pal_lookup[256];
|
static uint32_t pal_lookup[256];
|
||||||
|
|
||||||
void ddraw_init(HWND h)
|
void ddraw_init(HWND h)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
for (c = 0; c < 256; c++)
|
cgapal_rebuild();
|
||||||
pal_lookup[c] = makecol(cgapal[c].r << 2, cgapal[c].g << 2, cgapal[c].b << 2);
|
|
||||||
|
|
||||||
if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL)))
|
if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL)))
|
||||||
fatal("DirectDrawCreate failed\n");
|
fatal("DirectDrawCreate failed\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user