Devices can now be marked as not working, and disabled in release builds.
Video card menu now build dynamically from list.
This commit is contained in:
parent
7416a24e99
commit
657aa19dd1
39 changed files with 183 additions and 133 deletions
12
src/device.c
12
src/device.c
|
|
@ -42,6 +42,18 @@ void device_close_all()
|
|||
}
|
||||
}
|
||||
|
||||
int device_available(device_t *d)
|
||||
{
|
||||
#ifdef RELEASE_BUILD
|
||||
if (d->flags & DEVICE_NOT_WORKING)
|
||||
return 0;
|
||||
#endif
|
||||
if (d->available)
|
||||
return d->available();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void device_speed_changed()
|
||||
{
|
||||
int c;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
typedef struct device_t
|
||||
{
|
||||
char name[50];
|
||||
uint32_t flags;
|
||||
void *(*init)();
|
||||
void (*close)(void *p);
|
||||
int (*available)();
|
||||
|
|
@ -12,6 +13,12 @@ typedef struct device_t
|
|||
void device_init();
|
||||
void device_add(device_t *d);
|
||||
void device_close_all();
|
||||
int device_available(device_t *d);
|
||||
void device_speed_changed();
|
||||
void device_force_redraw();
|
||||
char *device_add_status_info(char *s, int max_len);
|
||||
|
||||
enum
|
||||
{
|
||||
DEVICE_NOT_WORKING = 1 /*Device does not currently work correctly and will be disabled in a release build*/
|
||||
};
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ BEGIN
|
|||
DEFPUSHBUTTON "OK",IDOK,17,216,50,14, WS_TABSTOP
|
||||
PUSHBUTTON "Cancel",IDCANCEL,71,216,50,14, WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO1,62,16,107,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO2,62,36,107,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBOVID,62,36,107,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBOCPUM,62,56,107,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO3,62,76,107,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBOCHC,62,96,107,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#define IDM_CDROM_DISABLED 40200
|
||||
|
||||
#define IDC_COMBO1 1000
|
||||
#define IDC_COMBO2 1001
|
||||
#define IDC_COMBOVID 1001
|
||||
#define IDC_COMBO3 1002
|
||||
#define IDC_COMBO4 1003
|
||||
#define IDC_COMBO5 1004
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ void sis496_close(void *p)
|
|||
device_t sis496_device =
|
||||
{
|
||||
"SiS 496/497",
|
||||
0,
|
||||
sis496_init,
|
||||
sis496_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -46,10 +46,8 @@ static SOUND_CARD sound_cards[] =
|
|||
int sound_card_available(int card)
|
||||
{
|
||||
if (sound_cards[card].device)
|
||||
{
|
||||
if (sound_cards[card].device->available)
|
||||
return sound_cards[card].device->available();
|
||||
}
|
||||
return device_available(sound_cards[card].device);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ void adlib_close(void *p)
|
|||
device_t adlib_device =
|
||||
{
|
||||
"AdLib",
|
||||
0,
|
||||
adlib_init,
|
||||
adlib_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -591,6 +591,7 @@ void adgold_close(void *p)
|
|||
device_t adgold_device =
|
||||
{
|
||||
"AdLib Gold",
|
||||
0,
|
||||
adgold_init,
|
||||
adgold_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ void cms_close(void *p)
|
|||
device_t cms_device =
|
||||
{
|
||||
"Creative Music System / Game Blaster",
|
||||
0,
|
||||
cms_init,
|
||||
cms_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -1103,6 +1103,7 @@ void gus_speed_changed(void *p)
|
|||
device_t gus_device =
|
||||
{
|
||||
"Gravis UltraSound",
|
||||
0,
|
||||
gus_init,
|
||||
gus_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -747,6 +747,7 @@ void pas16_close(void *p)
|
|||
device_t pas16_device =
|
||||
{
|
||||
"Pro Audio Spectrum 16",
|
||||
DEVICE_NOT_WORKING,
|
||||
pas16_init,
|
||||
pas16_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -432,6 +432,7 @@ void sb_speed_changed(void *p)
|
|||
device_t sb_1_device =
|
||||
{
|
||||
"Sound Blaster v1.0",
|
||||
0,
|
||||
sb_1_init,
|
||||
sb_close,
|
||||
NULL,
|
||||
|
|
@ -442,6 +443,7 @@ device_t sb_1_device =
|
|||
device_t sb_15_device =
|
||||
{
|
||||
"Sound Blaster v1.5",
|
||||
0,
|
||||
sb_15_init,
|
||||
sb_close,
|
||||
NULL,
|
||||
|
|
@ -452,6 +454,7 @@ device_t sb_15_device =
|
|||
device_t sb_2_device =
|
||||
{
|
||||
"Sound Blaster v2.0",
|
||||
0,
|
||||
sb_2_init,
|
||||
sb_close,
|
||||
NULL,
|
||||
|
|
@ -462,6 +465,7 @@ device_t sb_2_device =
|
|||
device_t sb_pro_v1_device =
|
||||
{
|
||||
"Sound Blaster Pro v1",
|
||||
0,
|
||||
sb_pro_v1_init,
|
||||
sb_close,
|
||||
NULL,
|
||||
|
|
@ -472,6 +476,7 @@ device_t sb_pro_v1_device =
|
|||
device_t sb_pro_v2_device =
|
||||
{
|
||||
"Sound Blaster Pro v2",
|
||||
0,
|
||||
sb_pro_v2_init,
|
||||
sb_close,
|
||||
NULL,
|
||||
|
|
@ -482,6 +487,7 @@ device_t sb_pro_v2_device =
|
|||
device_t sb_16_device =
|
||||
{
|
||||
"Sound Blaster 16",
|
||||
0,
|
||||
sb_16_init,
|
||||
sb_close,
|
||||
NULL,
|
||||
|
|
@ -492,6 +498,7 @@ device_t sb_16_device =
|
|||
device_t sb_awe32_device =
|
||||
{
|
||||
"Sound Blaster AWE32",
|
||||
0,
|
||||
sb_awe32_init,
|
||||
sb_close,
|
||||
sb_awe32_available,
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ void sn76489_close(void *p)
|
|||
device_t sn76489_device =
|
||||
{
|
||||
"TI SN74689 PSG",
|
||||
0,
|
||||
sn76489_init,
|
||||
sn76489_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ void wss_close(void *p)
|
|||
device_t wss_device =
|
||||
{
|
||||
"Windows Sound System",
|
||||
0,
|
||||
wss_init,
|
||||
wss_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ int ati18800_add_status_info(char *s, int max_len, void *p)
|
|||
device_t ati18800_device =
|
||||
{
|
||||
"ATI-18800",
|
||||
0,
|
||||
ati18800_init,
|
||||
ati18800_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ int ati28800_add_status_info(char *s, int max_len, void *p)
|
|||
device_t ati28800_device =
|
||||
{
|
||||
"ATI-28800",
|
||||
0,
|
||||
ati28800_init,
|
||||
ati28800_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -2095,6 +2095,7 @@ int mach64_add_status_info(char *s, int max_len, void *p)
|
|||
device_t mach64gx_device =
|
||||
{
|
||||
"ATI Mach64GX",
|
||||
0,
|
||||
mach64gx_init,
|
||||
mach64_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -520,6 +520,7 @@ void cga_speed_changed(void *p)
|
|||
device_t cga_device =
|
||||
{
|
||||
"CGA",
|
||||
0,
|
||||
cga_standalone_init,
|
||||
cga_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -869,6 +869,7 @@ int gd5429_add_status_info(char *s, int max_len, void *p)
|
|||
device_t gd5429_device =
|
||||
{
|
||||
"Cirrus Logic GD5429",
|
||||
DEVICE_NOT_WORKING,
|
||||
gd5429_init,
|
||||
gd5429_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -837,6 +837,7 @@ void ega_speed_changed(void *p)
|
|||
device_t ega_device =
|
||||
{
|
||||
"EGA",
|
||||
0,
|
||||
ega_standalone_init,
|
||||
ega_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ int et4000_add_status_info(char *s, int max_len, void *p)
|
|||
device_t et4000_device =
|
||||
{
|
||||
"Tseng Labs ET4000AX",
|
||||
0,
|
||||
et4000_init,
|
||||
et4000_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -1000,6 +1000,7 @@ int et4000w32p_add_status_info(char *s, int max_len, void *p)
|
|||
device_t et4000w32p_device =
|
||||
{
|
||||
"Tseng Labs ET4000/w32p",
|
||||
0,
|
||||
et4000w32p_init,
|
||||
et4000w32p_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -354,6 +354,7 @@ void hercules_speed_changed(void *p)
|
|||
device_t hercules_device =
|
||||
{
|
||||
"Hercules",
|
||||
0,
|
||||
hercules_init,
|
||||
hercules_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -311,6 +311,7 @@ void mda_speed_changed(void *p)
|
|||
device_t mda_device =
|
||||
{
|
||||
"MDA",
|
||||
0,
|
||||
mda_init,
|
||||
mda_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -482,6 +482,7 @@ void m24_speed_changed(void *p)
|
|||
device_t m24_device =
|
||||
{
|
||||
"Olivetti M24 (video)",
|
||||
0,
|
||||
m24_init,
|
||||
m24_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ int oti067_add_status_info(char *s, int max_len, void *p)
|
|||
device_t oti067_device =
|
||||
{
|
||||
"Oak OTI-067",
|
||||
0,
|
||||
oti067_init,
|
||||
oti067_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@ int paradise_add_status_info(char *s, int max_len, void *p)
|
|||
device_t paradise_pvga1a_device =
|
||||
{
|
||||
"Paradise PVGA1A",
|
||||
0,
|
||||
paradise_pvga1a_init,
|
||||
paradise_close,
|
||||
NULL,
|
||||
|
|
@ -355,6 +356,7 @@ device_t paradise_pvga1a_device =
|
|||
device_t paradise_wd90c11_device =
|
||||
{
|
||||
"Paradise WD90C11",
|
||||
0,
|
||||
paradise_wd90c11_init,
|
||||
paradise_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -481,6 +481,7 @@ static void pc1512_speed_changed(void *p)
|
|||
device_t pc1512_device =
|
||||
{
|
||||
"Amstrad PC1512 (video)",
|
||||
0,
|
||||
pc1512_init,
|
||||
pc1512_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ void pc1640_speed_changed(void *p)
|
|||
device_t pc1640_device =
|
||||
{
|
||||
"Amstrad PC1640 (video)",
|
||||
0,
|
||||
pc1640_init,
|
||||
pc1640_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ void pc200_speed_changed(void *p)
|
|||
device_t pc200_device =
|
||||
{
|
||||
"Amstrad PC200 (video)",
|
||||
0,
|
||||
pc200_init,
|
||||
pc200_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -1689,6 +1689,7 @@ int s3_add_status_info(char *s, int max_len, void *p)
|
|||
device_t s3_bahamas64_device =
|
||||
{
|
||||
"Paradise Bahamas 64 (S3 Vision864)",
|
||||
0,
|
||||
s3_bahamas64_init,
|
||||
s3_close,
|
||||
NULL,
|
||||
|
|
@ -1700,6 +1701,7 @@ device_t s3_bahamas64_device =
|
|||
device_t s3_9fx_device =
|
||||
{
|
||||
"Number 9 9FX (S3 Trio64)",
|
||||
0,
|
||||
s3_9fx_init,
|
||||
s3_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -517,6 +517,7 @@ int s3_virge_add_status_info(char *s, int max_len, void *p)
|
|||
device_t s3_virge_device =
|
||||
{
|
||||
"Diamond Stealth 3D 2000 (S3 VIRGE)",
|
||||
DEVICE_NOT_WORKING,
|
||||
s3_virge_init,
|
||||
s3_virge_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -691,6 +691,7 @@ void tandy_speed_changed(void *p)
|
|||
device_t tandy_device =
|
||||
{
|
||||
"Tandy 1000 (video)",
|
||||
0,
|
||||
tandy_init,
|
||||
tandy_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -1124,6 +1124,7 @@ int tgui_add_status_info(char *s, int max_len, void *p)
|
|||
device_t tgui9440_device =
|
||||
{
|
||||
"Trident TGUI 9440",
|
||||
0,
|
||||
tgui9440_init,
|
||||
tgui_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -284,6 +284,7 @@ int tvga_add_status_info(char *s, int max_len, void *p)
|
|||
device_t tvga8900d_device =
|
||||
{
|
||||
"Trident TVGA 8900D",
|
||||
0,
|
||||
tvga8900d_init,
|
||||
tvga_close,
|
||||
NULL,
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ int vga_add_status_info(char *s, int max_len, void *p)
|
|||
device_t vga_device =
|
||||
{
|
||||
"VGA",
|
||||
DEVICE_NOT_WORKING,
|
||||
vga_init,
|
||||
vga_close,
|
||||
NULL,
|
||||
|
|
|
|||
176
src/video.c
176
src/video.c
|
|
@ -33,6 +33,81 @@
|
|||
#include "vid_tvga.h"
|
||||
#include "vid_vga.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[64];
|
||||
device_t *device;
|
||||
int legacy_id;
|
||||
} VIDEO_CARD;
|
||||
|
||||
static VIDEO_CARD video_cards[] =
|
||||
{
|
||||
{"CGA", &cga_device, GFX_CGA},
|
||||
{"MDA", &mda_device, GFX_MDA},
|
||||
{"Hercules", &hercules_device, GFX_HERCULES},
|
||||
{"EGA", &ega_device, GFX_EGA},
|
||||
{"Trident TVGA8900D", &tvga8900d_device, GFX_TVGA},
|
||||
{"Tseng ET4000AX", &et4000_device, GFX_ET4000},
|
||||
{"Diamond Stealth 32 (Tseng ET4000/w32p)", &et4000w32p_device, GFX_ET4000W32},
|
||||
{"Paradise Bahamas 64 (S3 Vision864)", &s3_bahamas64_device, GFX_BAHAMAS64},
|
||||
{"Number Nine 9FX (S3 Trio64)", &s3_9fx_device, GFX_N9_9FX},
|
||||
{"Diamond Stealth 3D 2000 (S3 ViRGE)", &s3_virge_device, GFX_VIRGE},
|
||||
{"Trident TGUI9440", &tgui9440_device, GFX_TGUI9440},
|
||||
{"VGA", &vga_device, GFX_VGA},
|
||||
{"ATI VGA Edge-16 (ATI-18800)", &ati18800_device, GFX_VGAEDGE16},
|
||||
{"ATI VGA Charger", &ati28800_device, GFX_VGACHARGER},
|
||||
{"OAK OTI-067", &oti067_device, GFX_OTI067},
|
||||
{"ATI Graphics Pro Turbo (Mach64 GX)", &mach64gx_device, GFX_MACH64GX},
|
||||
{"Cirrus Logic CL-GD5429", &gd5429_device, GFX_CL_GD5429},
|
||||
{"", NULL, 0}
|
||||
};
|
||||
|
||||
int video_card_available(int card)
|
||||
{
|
||||
if (video_cards[card].device)
|
||||
return device_available(video_cards[card].device);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *video_card_getname(int card)
|
||||
{
|
||||
return video_cards[card].name;
|
||||
}
|
||||
|
||||
int video_card_getid(char *s)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (video_cards[c].device)
|
||||
{
|
||||
if (!strcmp(video_cards[c].name, s))
|
||||
return c;
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int video_old_to_new(int card)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (video_cards[c].device)
|
||||
{
|
||||
if (video_cards[c].legacy_id == card)
|
||||
return c;
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int video_new_to_old(int card)
|
||||
{
|
||||
return video_cards[card].legacy_id;
|
||||
}
|
||||
|
||||
uint32_t *video_15to32, *video_16to32;
|
||||
|
||||
int egareads=0,egawrites=0;
|
||||
|
|
@ -159,82 +234,7 @@ void video_init()
|
|||
device_add(&oti067_device);
|
||||
return;
|
||||
}
|
||||
switch (gfxcard)
|
||||
{
|
||||
case GFX_MDA:
|
||||
device_add(&mda_device);
|
||||
break;
|
||||
|
||||
case GFX_HERCULES:
|
||||
device_add(&hercules_device);
|
||||
break;
|
||||
|
||||
case GFX_CGA:
|
||||
device_add(&cga_device);
|
||||
break;
|
||||
|
||||
case GFX_EGA:
|
||||
device_add(&ega_device);
|
||||
break;
|
||||
|
||||
case GFX_TVGA:
|
||||
device_add(&tvga8900d_device);
|
||||
break;
|
||||
|
||||
case GFX_ET4000:
|
||||
device_add(&et4000_device);
|
||||
break;
|
||||
|
||||
case GFX_ET4000W32:
|
||||
device_add(&et4000w32p_device);
|
||||
break;
|
||||
|
||||
case GFX_BAHAMAS64:
|
||||
device_add(&s3_bahamas64_device);
|
||||
break;
|
||||
|
||||
case GFX_N9_9FX:
|
||||
device_add(&s3_9fx_device);
|
||||
break;
|
||||
|
||||
case GFX_STEALTH64:
|
||||
break;
|
||||
|
||||
case GFX_VIRGE:
|
||||
device_add(&s3_virge_device);
|
||||
break;
|
||||
|
||||
case GFX_TGUI9440:
|
||||
device_add(&tgui9440_device);
|
||||
break;
|
||||
|
||||
case GFX_VGA:
|
||||
device_add(&vga_device);
|
||||
break;
|
||||
|
||||
case GFX_VGAEDGE16:
|
||||
device_add(&ati18800_device);
|
||||
break;
|
||||
|
||||
case GFX_VGACHARGER:
|
||||
device_add(&ati18800_device);
|
||||
break;
|
||||
|
||||
case GFX_OTI067:
|
||||
device_add(&oti067_device);
|
||||
return;
|
||||
|
||||
case GFX_MACH64GX:
|
||||
device_add(&mach64gx_device);
|
||||
return;
|
||||
|
||||
case GFX_CL_GD5429:
|
||||
device_add(&gd5429_device);
|
||||
return;
|
||||
|
||||
default:
|
||||
fatal("Bad gfx card %i\n",gfxcard);
|
||||
}
|
||||
device_add(video_cards[video_old_to_new(gfxcard)].device);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -245,29 +245,7 @@ uint8_t fontdatm[256][16];
|
|||
|
||||
int xsize=1,ysize=1;
|
||||
|
||||
|
||||
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},
|
||||
};*/
|
||||
PALETTE cgapal;
|
||||
|
||||
void loadfont(char *s, int format)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
int video_card_available(int card);
|
||||
char *video_card_getname(int card);
|
||||
int video_card_getid(char *s);
|
||||
int video_old_to_new(int card);
|
||||
int video_new_to_old(int card);
|
||||
|
||||
extern int egareads,egawrites;
|
||||
|
||||
extern int fullchange;
|
||||
|
|
|
|||
66
src/win.c
66
src/win.c
|
|
@ -560,7 +560,6 @@ int getsfile(HWND hwnd, char *f, char *fn)
|
|||
|
||||
extern int is486;
|
||||
int romstolist[26], listtomodel[26], romstomodel[26], modeltolist[26];
|
||||
int vidtolist[20],listtovid[20];
|
||||
static int settings_sound_to_list[20], settings_list_to_sound[20];
|
||||
|
||||
int mem_list_to_size[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,32,48,64,256};
|
||||
|
|
@ -578,6 +577,7 @@ int mem_size_to_list[]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,15,15,15
|
|||
|
||||
BOOL CALLBACK configdlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
char temp_str[256];
|
||||
HWND h;
|
||||
int c, d;
|
||||
int rom,gfx,mem,fpu;
|
||||
|
|
@ -606,29 +606,27 @@ BOOL CALLBACK configdlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPara
|
|||
c++;
|
||||
}
|
||||
SendMessage(h, CB_SETCURSEL, modeltolist[model], 0);
|
||||
|
||||
h=GetDlgItem(hdlg,IDC_COMBO2);
|
||||
memset(vidtolist, 0, sizeof(vidtolist));
|
||||
c=4;
|
||||
SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"CGA"); vidtolist[GFX_CGA]=0; listtovid[0]=0;
|
||||
SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"MDA"); vidtolist[GFX_MDA]=1; listtovid[1]=1;
|
||||
SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"Hercules"); vidtolist[GFX_HERCULES]=2; listtovid[2]=2;
|
||||
SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"EGA"); vidtolist[GFX_EGA]=3; listtovid[3]=3;
|
||||
if (gfx_present[GFX_TVGA]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"Trident 8900D"); vidtolist[GFX_TVGA]=c; listtovid[c]=GFX_TVGA; c++; }
|
||||
if (gfx_present[GFX_ET4000]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"Tseng ET4000AX"); vidtolist[GFX_ET4000]=c; listtovid[c]=GFX_ET4000; c++; }
|
||||
if (gfx_present[GFX_ET4000W32]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"Diamond Stealth 32"); vidtolist[GFX_ET4000W32]=c; listtovid[c]=GFX_ET4000W32; c++; }
|
||||
if (gfx_present[GFX_BAHAMAS64]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"Paradise Bahamas 64"); vidtolist[GFX_BAHAMAS64]=c; listtovid[c]=GFX_BAHAMAS64; c++; }
|
||||
if (gfx_present[GFX_N9_9FX]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"Number Nine 9FX"); vidtolist[GFX_N9_9FX]=c; listtovid[c]=GFX_N9_9FX; c++; }
|
||||
if (gfx_present[GFX_VIRGE]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"S3 VIRGE"); vidtolist[GFX_VIRGE]=c; listtovid[c]=GFX_VIRGE; c++; }
|
||||
if (gfx_present[GFX_TGUI9440]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"Trident TGUI9440"); vidtolist[GFX_TGUI9440]=c; listtovid[c]=GFX_TGUI9440; c++; }
|
||||
if (gfx_present[GFX_VGA]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"VGA"); vidtolist[GFX_VGA]=c; listtovid[c]=GFX_VGA; c++; }
|
||||
if (gfx_present[GFX_VGAEDGE16]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"ATI VGA Edge-16"); vidtolist[GFX_VGAEDGE16]=c; listtovid[c]=GFX_VGAEDGE16; c++; }
|
||||
if (gfx_present[GFX_VGACHARGER]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"ATI VGA Charger"); vidtolist[GFX_VGACHARGER]=c; listtovid[c]=GFX_VGACHARGER; c++; }
|
||||
if (gfx_present[GFX_OTI067]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"Oak OTI-067"); vidtolist[GFX_OTI067]=c; listtovid[c]=GFX_OTI067; c++; }
|
||||
if (gfx_present[GFX_MACH64GX]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"ATI Graphics Pro Turbo"); vidtolist[GFX_MACH64GX]=c; listtovid[c]=GFX_MACH64GX; c++; }
|
||||
if (gfx_present[GFX_CL_GD5429]) { SendMessage(h,CB_ADDSTRING,0,(LPARAM)(LPCSTR)"Cirrus Logic CL-GD5429"); vidtolist[GFX_CL_GD5429]=c; listtovid[c]=GFX_CL_GD5429; c++; }
|
||||
SendMessage(h,CB_SETCURSEL,vidtolist[gfxcard],0);
|
||||
if (models[model].fixed_gfxcard) EnableWindow(h,FALSE);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_COMBOVID);
|
||||
c = d = 0;
|
||||
while (1)
|
||||
{
|
||||
char *s = video_card_getname(c);
|
||||
|
||||
if (!s[0])
|
||||
break;
|
||||
|
||||
if (video_card_available(c))
|
||||
{
|
||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)s);
|
||||
if (video_new_to_old(c) == gfxcard)
|
||||
SendMessage(h, CB_SETCURSEL, d, 0);
|
||||
|
||||
d++;
|
||||
}
|
||||
|
||||
c++;
|
||||
}
|
||||
|
||||
h=GetDlgItem(hdlg,IDC_COMBOCPUM);
|
||||
c = 0;
|
||||
|
|
@ -736,8 +734,9 @@ BOOL CALLBACK configdlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPara
|
|||
h=GetDlgItem(hdlg,IDC_COMBO1);
|
||||
temp_model = listtomodel[SendMessage(h,CB_GETCURSEL,0,0)];
|
||||
|
||||
h=GetDlgItem(hdlg,IDC_COMBO2);
|
||||
gfx=listtovid[SendMessage(h,CB_GETCURSEL,0,0)];
|
||||
h = GetDlgItem(hdlg, IDC_COMBOVID);
|
||||
SendMessage(h, CB_GETLBTEXT, SendMessage(h,CB_GETCURSEL,0,0), (LPARAM)temp_str);
|
||||
gfx = video_new_to_old(video_card_getid(temp_str));
|
||||
|
||||
h=GetDlgItem(hdlg,IDC_COMBOMEM);
|
||||
mem=mem_list_to_size[SendMessage(h,CB_GETCURSEL,0,0)];
|
||||
|
|
@ -818,11 +817,22 @@ BOOL CALLBACK configdlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPara
|
|||
temp_model = listtomodel[SendMessage(h,CB_GETCURSEL,0,0)];
|
||||
|
||||
/*Enable/disable gfxcard list*/
|
||||
h = GetDlgItem(hdlg, IDC_COMBO2);
|
||||
h = GetDlgItem(hdlg, IDC_COMBOVID);
|
||||
if (!models[temp_model].fixed_gfxcard)
|
||||
{
|
||||
char *s = video_card_getname(video_old_to_new(gfxcard));
|
||||
|
||||
EnableWindow(h, TRUE);
|
||||
SendMessage(h, CB_SETCURSEL, gfxcard, 0);
|
||||
|
||||
c = 0;
|
||||
while (1)
|
||||
{
|
||||
SendMessage(h, CB_GETLBTEXT, c, (LPARAM)temp_str);
|
||||
if (!strcmp(temp_str, s))
|
||||
break;
|
||||
c++;
|
||||
}
|
||||
SendMessage(h, CB_SETCURSEL, c, 0);
|
||||
}
|
||||
else
|
||||
EnableWindow(h, FALSE);
|
||||
|
|
|
|||
Loading…
Reference in a new issue