Version changed to 1.07;

Added Intel Advanced/ZP;
Added Commodore PC 60 III;
Fixed Force 4:3 option when overscan is not enabled;
Added option to scale (0.5x, 1x, 1.5x, 2x) the video output;
Added ability to disable ATAPI DMA for CD-ROM drives;
Applied all mainline PCem commits;
Store network card in config file as name rather than number;
Fixed NVR storing for IBM PS/2 Models 2121 and 2121+ISA.
This commit is contained in:
OBattler
2017-03-14 00:38:25 +01:00
parent 9d33905d85
commit a57aa0ffcc
16 changed files with 223 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright holders: Tenshi
see COPYING for more details
*/
#define emulator_version "1.10"
#define emulator_version "1.07"

View File

@@ -331,7 +331,7 @@ void cdrom_init(int id, int cdb_len_setting, int bus_type)
cdrom[id].cd_status = CD_STATUS_EMPTY;
cdrom[id].sense[0] = 0xf0;
cdrom[id].sense[7] = 10;
cdrom_drives[id].bus_mode = cdrom_drives[id].bus_type ? 2 : 3;
cdrom_drives[id].bus_mode = cdrom_drives[id].bus_type ? 2 : (cdrom_drives[id].atapi_dma ? 3 : 1);
cdrom_log("CD-ROM %i: Bus type %i, bus mode %i\n", id, cdrom_drives[id].bus_type, cdrom_drives[id].bus_mode);
if (!cdrom_drives[id].bus_type)
{

View File

@@ -139,6 +139,7 @@ typedef struct __attribute__((__packed__))
uint8_t scsi_device_lun;
uint8_t sound_on;
uint8_t atapi_dma;
} cdrom_drive_t;
extern cdrom_drive_t cdrom_drives[CDROM_NUM];

View File

@@ -425,7 +425,9 @@ enum
ROM_SUPER286TR, /*Hyundai Super-286TR / SCAT / Award BIOS*/
ROM_MEGAPCDX, /*386DX mdoel of the Mega PC - Note by Tohka: The documentation (that I have in German) clearly says such a model exists.*/
ROM_PX486, /*Phoenix 486 clone*/
ROM_ZAPPA, /*Intel Advanced/ZP / 430FX / AMI BIOS / National Semiconductors PC87306*/
ROM_CMDPC60,
ROM_MAX
};
@@ -639,3 +641,5 @@ extern int enable_external_fpu;
extern int invert_display;
uint32_t svga_color_transform(uint32_t color);
extern int scale;

View File

@@ -216,6 +216,9 @@ void *intel_flash_init(uint8_t type)
case ROM_MRTHOR:
strcpy(flash_path, "roms/mrthor/");
break;
case ROM_ZAPPA:
strcpy(flash_path, "roms/zappa/");
break;
default:
fatal("intel_flash_init on unsupported ROM set %i\n", romset);
}

View File

@@ -371,6 +371,19 @@ int loadbios()
fclose(f);
biosmask = 0x7fff;
return 1;
case ROM_CMDPC60:
f = romfopen("roms/cmdpc60/cbm-pc60c-bios-lo-v1.36-390473-07.bin", "rb");
ff = romfopen("roms/cmdpc60/cbm-pc60c-bios-hi-v1.36-390474-07.bin", "rb");
if (!f || !ff) break;
for (c = 0x0000; c < 0x20000; c += 2)
{
rom[c] = getc(f);
rom[c + 1] = getc(ff);
}
fclose(ff);
fclose(f);
biosmask = 0x1ffff;
return 1;
case ROM_DELL200:
f=romfopen("roms/dells200/dell0.bin","rb");
ff=romfopen("roms/dells200/dell1.bin","rb");
@@ -728,6 +741,7 @@ int loadbios()
case ROM_IBMPS2_M30_286:
f = romfopen("roms/ibmps2_m30_286/33f5381a.bin", "rb");
if (!f) break;
fread(rom, 0x20000, 1, f);
fclose(f);
biosmask = 0x1ffff;
@@ -889,6 +903,21 @@ int loadbios()
fclose(f);
biosmask = 0x1ffff;
return 1;
case ROM_ZAPPA:
f = romfopen("roms/zappa/1006BS0_.BIO", "rb");
if (!f) break;
fseek(f, 0x80, SEEK_SET);
fread(rom + 0x10000, 0x10000, 1, f);
fclose(f);
f = romfopen("roms/zappa/1006BS0_.BI1", "rb");
if (!f) break;
fseek(f, 0x80, SEEK_SET);
fread(rom, 0x10000, 1, f);
fclose(f);
biosmask = 0x1ffff;
//is486=1;
return 1;
}
printf("Failed to load ROM!\n");
if (f) fclose(f);

View File

@@ -159,9 +159,10 @@ MODEL models[] =
{"Compaq Deskpro 386", ROM_DESKPRO_386, "dekspro386", { "Intel", cpus_i386DX, "AMD", cpus_Am386DX, "Cyrix", cpus_486DLC, "", NULL, "", NULL}, 0, MODEL_AT, 1, 15, 1, deskpro386_init, NULL},
{"DTK 386SX clone", ROM_DTK386, "dtk386", { "Intel", cpus_i386SX, "AMD", cpus_Am386SX, "Cyrix", cpus_486SLC, "", NULL, "", NULL}, 0, MODEL_AT, 1, 16, 1, at_neat_init, NULL},
{"Amstrad MegaPC", ROM_MEGAPC, "megapc", { "Intel", cpus_i386SX, "AMD", cpus_Am386SX, "Cyrix", cpus_486SLC, "", NULL, "", NULL}, 1, MODEL_AT | MODEL_PS2, 1, 16, 1, at_wd76c10_init, NULL},
{"AMI 386SX clone", ROM_AMI386SX, "ami386", { "Intel", cpus_i386SX, "AMD", cpus_Am386SX, "Cyrix", cpus_486SLC, "", NULL, "", NULL}, 0, MODEL_AT, 1, 256, 1, at_headland_init, NULL},
{"Commodore PC 60 III", ROM_CMDPC60, "cmdpc60", { "Intel", cpus_i386DX, "AMD", cpus_Am386DX, "Cyrix", cpus_486DLC, "", NULL, "", NULL}, 0, MODEL_AT, 1, 16, 1, at_init, NULL},
/* The MegaPC manual says 386DX model of the Amstrad PC70386 exists, but Sarah Walker just *had* to remove 386DX CPU's from some boards. */
{"Amstrad MegaPC 386DX", ROM_MEGAPCDX, "megapcdx", { "Intel", cpus_i386DX, "AMD", cpus_Am386DX, "Cyrix", cpus_486DLC, "", NULL, "", NULL}, 1, MODEL_AT | MODEL_PS2, 1, 16, 1, at_wd76c10_init, NULL},
{"AMI 386SX clone", ROM_AMI386SX, "ami386", { "Intel", cpus_i386SX, "AMD", cpus_Am386SX, "Cyrix", cpus_486SLC, "", NULL, "", NULL}, 0, MODEL_AT, 1, 256, 1, at_headland_init, NULL},
{"MR 386DX clone", ROM_MR386DX_OPTI495, "mr386dx", { "Intel", cpus_i386DX, "AMD", cpus_Am386DX, "Cyrix", cpus_486DLC, "", NULL, "", NULL}, 0, MODEL_AT, 1, 256, 1, at_opti495_init, NULL},
{"AMI 386DX clone", ROM_AMI386DX_OPTI495, "ami386dx", { "Intel", cpus_i386DX, "AMD", cpus_Am386DX, "Cyrix", cpus_486DLC, "", NULL, "", NULL}, 0, MODEL_AT, 1, 256, 1, at_opti495_init, NULL},
{"AMI 486 clone", ROM_AMI486, "ami486", { "Intel", cpus_i486, "AMD", cpus_Am486, "Cyrix", cpus_Cx486, "", NULL, "", NULL}, 0, MODEL_AT, 1, 256, 1, at_ali1429_init, NULL},
@@ -173,6 +174,7 @@ MODEL models[] =
{"Micro Star 586MC1", ROM_586MC1, "586mc1", { "Intel", cpus_Pentium5V50, "", NULL, "", NULL, "", NULL, "", NULL}, 0, MODEL_AT, 1, 128, 1, at_586mc1_init, NULL},
{"Intel Premiere/PCI II", ROM_PLATO, "plato", { "Intel", cpus_PentiumS5, "IDT", cpus_WinChip, "AMD", cpus_K5, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_PS2, 1, 128, 1, at_plato_init, NULL},
{"Intel Advanced/EV", ROM_ENDEAVOR, "endeavor", { "Intel", cpus_PentiumS5, "IDT", cpus_WinChip, "AMD", cpus_K5, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_PS2, 1, 128, 1, at_endeavor_init, NULL},
{"Intel Advanced/ZP", ROM_ZAPPA, "zappa", { "Intel", cpus_PentiumS5, "IDT", cpus_WinChip, "AMD", cpus_K5, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_PS2, 1, 128, 1, at_endeavor_init, NULL},
{"PC Partner MB500N", ROM_MB500N, "mb500n", { "Intel", cpus_PentiumS5, "IDT", cpus_WinChip, "AMD", cpus_K5, "", NULL, "", NULL}, 0, MODEL_AT | MODEL_PS2, 1, 128, 1, at_mb500n_init, NULL},
{"Intel Advanced/ATX", ROM_THOR, "thor", { "Intel", cpus_Pentium, "IDT", cpus_WinChip, "Cyrix", cpus_6x86, "AMD", cpus_K56, "", NULL}, 0, MODEL_AT | MODEL_PS2, 1, 256, 1, at_endeavor_init, NULL},
{"MR Intel Advanced/ATX", ROM_MRTHOR, "mrthor", { "Intel", cpus_Pentium, "IDT", cpus_WinChip, "Cyrix", cpus_6x86, "AMD", cpus_K56, "", NULL}, 0, MODEL_AT | MODEL_PS2, 1, 256, 1, at_endeavor_init, NULL},

View File

@@ -21,15 +21,16 @@ static int network_card_last = 0;
typedef struct
{
char name[32];
char name[64];
char internal_name[32];
device_t *device;
} NETWORK_CARD;
static NETWORK_CARD network_cards[] =
{
{"None", NULL},
{"Novell NE2000", &ne2000_device},
{"Realtek RTL8029AS", &rtl8029as_device},
{"None", "none", NULL},
{"Novell NE2000", "ne2k", &ne2000_device},
{"Realtek RTL8029AS", "ne2kpci", &rtl8029as_device},
{"", NULL}
};
@@ -58,6 +59,25 @@ int network_card_has_config(int card)
return network_cards[card].device->config ? 1 : 0;
}
char *network_card_get_internal_name(int card)
{
return network_cards[card].internal_name;
}
int network_card_get_from_internal_name(char *s)
{
int c = 0;
while (strlen(network_cards[c].internal_name))
{
if (!strcmp(network_cards[c].internal_name, s))
return c;
c++;
}
return 0;
}
void network_card_init()
{
if (network_cards[network_card_current].device)

View File

@@ -12,6 +12,8 @@ int network_card_available(int card);
char *network_card_getname(int card);
struct device_t *network_card_getdevice(int card);
int network_card_has_config(int card);
char *network_card_get_internal_name(int card);
int network_card_get_from_internal_name(char *s);
void network_card_init();
void initpcap();

View File

@@ -206,10 +206,10 @@ void loadnvr()
case ROM_PC2086: f = romfopen(nvr_concat("pc2086.nvr"), "rb"); break;
case ROM_PC3086: f = romfopen(nvr_concat("pc3086.nvr"), "rb"); break;
case ROM_IBMAT: f = romfopen(nvr_concat("at.nvr"), "rb"); break;
case ROM_IBMPS1_2011: f = romfopen(nvr_concat("ibmps1_2011.nvr"), "rb"); /*nvrmask = 127; */break;
case ROM_IBMPS1_2121: f = romfopen(nvr_concat("ibmps1_2121.nvr"), "rb"); nvrmask = 127; break;
case ROM_IBMPS1_2121_ISA: f = romfopen(nvr_concat("ibmps1_2121_isa.nvr"), "rb"); nvrmask = 127; break;
case ROM_IBMPS2_M30_286: f = romfopen(nvr_concat("ibmps2_m30_286.nvr"), "rb"); /*nvrmask = 127; */break;
case ROM_IBMPS1_2011: f = romfopen(nvr_concat("ibmps1_2011.nvr"), "rb"); break;
case ROM_IBMPS1_2121: f = romfopen(nvr_concat("ibmps1_2121.nvr"), "rb"); break;
case ROM_IBMPS1_2121_ISA: f = romfopen(nvr_concat("ibmps1_2121_isa.nvr"), "rb"); break;
case ROM_IBMPS2_M30_286: f = romfopen(nvr_concat("ibmps2_m30_286.nvr"), "rb"); break;
case ROM_CMDPC30: f = romfopen(nvr_concat("cmdpc30.nvr"), "rb"); nvrmask = 127; break;
case ROM_AMI286: f = romfopen(nvr_concat("ami286.nvr"), "rb"); nvrmask = 127; break;
case ROM_AWARD286: f = romfopen(nvr_concat("award286.nvr"), "rb"); nvrmask = 127; break;
@@ -253,6 +253,8 @@ void loadnvr()
#endif
case ROM_THOR: f = romfopen(nvr_concat("thor.nvr"), "rb"); nvrmask = 127; break;
case ROM_MRTHOR: f = romfopen(nvr_concat("mrthor.nvr"), "rb"); nvrmask = 127; break;
case ROM_ZAPPA: f = romfopen(nvr_concat("zappa.nvr"), "rb"); nvrmask = 127; break;
case ROM_CMDPC60: f = romfopen(nvr_concat("cmdpc60.nvr"), "rb"); nvrmask = 127; break;
default: return;
}
if (!f)
@@ -337,6 +339,8 @@ void savenvr()
#endif
case ROM_THOR: f = romfopen(nvr_concat("thor.nvr"), "wb"); break;
case ROM_MRTHOR: f = romfopen(nvr_concat("mrthor.nvr"), "wb"); break;
case ROM_ZAPPA: f = romfopen(nvr_concat("zappa.nvr"), "wb"); break;
case ROM_CMDPC60: f = romfopen(nvr_concat("cmdpc60.nvr"), "wb"); break;
default: return;
}
fwrite(nvrram,128,1,f);

View File

@@ -743,7 +743,11 @@ void loadconfig(char *fn)
ethif = config_get_int(NULL, "netinterface", 1);
if (ethif >= inum)
inum = ethif + 1;
network_card_current = config_get_int(NULL, "netcard", NE2000);
p = (char *)config_get_string(NULL, "netcard", "");
if (p)
network_card_current = network_card_get_from_internal_name(p);
else
network_card_current = 0;
p = (char *)config_get_string(NULL, "model", "");
if (p)
@@ -767,8 +771,12 @@ void loadconfig(char *fn)
else
gfxcard = 0;
video_speed = config_get_int(NULL, "video_speed", 3);
sound_card_current = config_get_int(NULL, "sndcard", SB2);
p = (char *)config_get_string(NULL, "sndcard", "");
if (p)
sound_card_current = sound_card_get_from_internal_name(p);
else
sound_card_current = 0;
// d86f_unregister(0);
// d86f_unregister(1);
@@ -801,6 +809,7 @@ void loadconfig(char *fn)
cdrom_drives[0].enabled = config_get_int(NULL, "cdrom_1_enabled", 0);
cdrom_drives[0].sound_on = config_get_int(NULL, "cdrom_1_sound_on", 1);
cdrom_drives[0].bus_type = config_get_int(NULL, "cdrom_1_bus_type", 0);
cdrom_drives[0].atapi_dma = config_get_int(NULL, "cdrom_1_atapi_dma", 1);
cdrom_drives[0].ide_channel = config_get_int(NULL, "cdrom_1_ide_channel", 2);
cdrom_drives[0].scsi_device_id = config_get_int(NULL, "cdrom_1_scsi_device_id", 2);
cdrom_drives[0].scsi_device_lun = config_get_int(NULL, "cdrom_1_scsi_device_lun", 0);
@@ -814,6 +823,7 @@ void loadconfig(char *fn)
cdrom_drives[1].enabled = config_get_int(NULL, "cdrom_2_enabled", 0);
cdrom_drives[1].sound_on = config_get_int(NULL, "cdrom_2_sound_on", 1);
cdrom_drives[1].bus_type = config_get_int(NULL, "cdrom_2_bus_type", 0);
cdrom_drives[1].atapi_dma = config_get_int(NULL, "cdrom_2_atapi_dma", 1);
cdrom_drives[1].ide_channel = config_get_int(NULL, "cdrom_2_ide_channel", 3);
cdrom_drives[1].scsi_device_id = config_get_int(NULL, "cdrom_2_scsi_device_id", 3);
cdrom_drives[1].scsi_device_lun = config_get_int(NULL, "cdrom_2_scsi_device_lun", 0);
@@ -827,6 +837,7 @@ void loadconfig(char *fn)
cdrom_drives[2].enabled = config_get_int(NULL, "cdrom_3_enabled", 0);
cdrom_drives[2].sound_on = config_get_int(NULL, "cdrom_3_sound_on", 1);
cdrom_drives[2].bus_type = config_get_int(NULL, "cdrom_3_bus_type", 0);
cdrom_drives[2].atapi_dma = config_get_int(NULL, "cdrom_3_atapi_dma", 1);
cdrom_drives[2].ide_channel = config_get_int(NULL, "cdrom_3_ide_channel", 4);
cdrom_drives[2].scsi_device_id = config_get_int(NULL, "cdrom_3_scsi_device_id", 4);
cdrom_drives[2].scsi_device_lun = config_get_int(NULL, "cdrom_3_scsi_device_lun", 0);
@@ -840,6 +851,7 @@ void loadconfig(char *fn)
cdrom_drives[3].enabled = config_get_int(NULL, "cdrom_4_enabled", 0);
cdrom_drives[3].sound_on = config_get_int(NULL, "cdrom_4_sound_on", 1);
cdrom_drives[3].bus_type = config_get_int(NULL, "cdrom_4_bus_type", 0);
cdrom_drives[3].atapi_dma = config_get_int(NULL, "cdrom_4_atapi_dma", 1);
cdrom_drives[3].ide_channel = config_get_int(NULL, "cdrom_4_ide_channel", 5);
cdrom_drives[3].scsi_device_id = config_get_int(NULL, "cdrom_4_scsi_device_id", 5);
cdrom_drives[3].scsi_device_lun = config_get_int(NULL, "cdrom_4_scsi_device_lun", 0);
@@ -913,6 +925,7 @@ void loadconfig(char *fn)
fdd_set_type(3, config_get_int(NULL, "drive_4_type", 1));
force_43 = config_get_int(NULL, "force_43", 0);
scale = config_get_int(NULL, "scale", 1);
enable_overscan = config_get_int(NULL, "enable_overscan", 0);
enable_flash = config_get_int(NULL, "enable_flash", 1);
@@ -992,7 +1005,7 @@ void saveconfig()
config_set_int(NULL, "buslogic", buslogic_enabled);
config_set_int(NULL, "netinterface", ethif);
config_set_int(NULL, "netcard", network_card_current);
config_set_string(NULL, "netcard", network_card_get_internal_name(network_card_current));
config_set_string(NULL, "model", model_get_internal_name());
config_set_int(NULL, "cpu_manufacturer", cpu_manufacturer);
@@ -1002,7 +1015,7 @@ void saveconfig()
config_set_string(NULL, "gfxcard", video_get_internal_name(video_old_to_new(gfxcard)));
config_set_int(NULL, "video_speed", video_speed);
config_set_int(NULL, "sndcard", sound_card_current);
config_set_string(NULL, "sndcard", sound_card_get_internal_name(sound_card_current));
config_set_int(NULL, "cpu_speed", cpuspeed);
config_set_int(NULL, "has_fpu", hasfpu);
config_set_string(NULL, "disc_a", discfns[0]);
@@ -1019,6 +1032,7 @@ void saveconfig()
config_set_int(NULL, "cdrom_1_enabled", cdrom_drives[0].enabled);
config_set_int(NULL, "cdrom_1_sound_on", cdrom_drives[0].sound_on);
config_set_int(NULL, "cdrom_1_bus_type", cdrom_drives[0].bus_type);
config_set_int(NULL, "cdrom_1_atapi_dma", cdrom_drives[0].atapi_dma);
config_set_int(NULL, "cdrom_1_ide_channel", cdrom_drives[0].ide_channel);
config_set_int(NULL, "cdrom_1_scsi_device_id", cdrom_drives[0].scsi_device_id);
config_set_int(NULL, "cdrom_1_scsi_device_lun", cdrom_drives[0].scsi_device_lun);
@@ -1030,6 +1044,7 @@ void saveconfig()
config_set_int(NULL, "cdrom_2_sound_on", cdrom_drives[1].sound_on);
config_set_int(NULL, "cdrom_2_bus_type", cdrom_drives[1].bus_type);
config_set_int(NULL, "cdrom_2_ide_channel", cdrom_drives[1].ide_channel);
config_set_int(NULL, "cdrom_2_atapi_dma", cdrom_drives[1].atapi_dma);
config_set_int(NULL, "cdrom_2_scsi_device_id", cdrom_drives[1].scsi_device_id);
config_set_int(NULL, "cdrom_2_scsi_device_lun", cdrom_drives[1].scsi_device_lun);
@@ -1039,6 +1054,7 @@ void saveconfig()
config_set_int(NULL, "cdrom_3_enabled", cdrom_drives[2].enabled);
config_set_int(NULL, "cdrom_3_sound_on", cdrom_drives[2].sound_on);
config_set_int(NULL, "cdrom_3_bus_type", cdrom_drives[2].bus_type);
config_set_int(NULL, "cdrom_3_atapi_dma", cdrom_drives[2].atapi_dma);
config_set_int(NULL, "cdrom_3_ide_channel", cdrom_drives[2].ide_channel);
config_set_int(NULL, "cdrom_3_scsi_device_id", cdrom_drives[2].scsi_device_id);
config_set_int(NULL, "cdrom_3_scsi_device_lun", cdrom_drives[2].scsi_device_lun);
@@ -1049,6 +1065,7 @@ void saveconfig()
config_set_int(NULL, "cdrom_4_enabled", cdrom_drives[3].enabled);
config_set_int(NULL, "cdrom_4_sound_on", cdrom_drives[3].sound_on);
config_set_int(NULL, "cdrom_4_bus_type", cdrom_drives[3].bus_type);
config_set_int(NULL, "cdrom_4_atapi_dma", cdrom_drives[3].atapi_dma);
config_set_int(NULL, "cdrom_4_ide_channel", cdrom_drives[3].ide_channel);
config_set_int(NULL, "cdrom_4_scsi_device_id", cdrom_drives[3].scsi_device_id);
config_set_int(NULL, "cdrom_4_scsi_device_lun", cdrom_drives[3].scsi_device_lun);
@@ -1104,6 +1121,7 @@ void saveconfig()
config_set_int(NULL, "drive_4_type", fdd_get_type(3));
config_set_int(NULL, "force_43", force_43);
config_set_int(NULL, "scale", scale);
config_set_int(NULL, "enable_overscan", enable_overscan);
config_set_int(NULL, "enable_flash", enable_flash);

View File

@@ -41,6 +41,7 @@ BEGIN
MENUITEM "S&ound enabled", IDM_CDROM_1_SOUND_ON
MENUITEM SEPARATOR
MENUITEM "&SCSI", IDM_CDROM_1_SCSI
MENUITEM "Atapi &DMA enabled", IDM_CDROM_1_DMA
MENUITEM SEPARATOR
MENUITEM "E&mpty",IDM_CDROM_1_EMPTY
MENUITEM "&Reload previous disc",IDM_CDROM_1_RELOAD
@@ -95,6 +96,7 @@ BEGIN
MENUITEM "S&ound enabled", IDM_CDROM_2_SOUND_ON
MENUITEM SEPARATOR
MENUITEM "&SCSI", IDM_CDROM_2_SCSI
MENUITEM "Atapi &DMA enabled", IDM_CDROM_2_DMA
MENUITEM SEPARATOR
MENUITEM "E&mpty",IDM_CDROM_2_EMPTY
MENUITEM "&Reload previous disc",IDM_CDROM_2_RELOAD
@@ -149,6 +151,7 @@ BEGIN
MENUITEM "S&ound enabled", IDM_CDROM_3_SOUND_ON
MENUITEM SEPARATOR
MENUITEM "&SCSI", IDM_CDROM_3_SCSI
MENUITEM "Atapi &DMA enabled", IDM_CDROM_3_DMA
MENUITEM SEPARATOR
MENUITEM "E&mpty",IDM_CDROM_3_EMPTY
MENUITEM "&Reload previous disc",IDM_CDROM_3_RELOAD
@@ -203,6 +206,8 @@ BEGIN
MENUITEM "S&ound enabled", IDM_CDROM_4_SOUND_ON
MENUITEM SEPARATOR
MENUITEM "&SCSI", IDM_CDROM_4_SCSI
MENUITEM "Atapi &DMA enabled", IDM_CDROM_4_DMA
MENUITEM SEPARATOR
MENUITEM "E&mpty",IDM_CDROM_4_EMPTY
MENUITEM "&Reload previous disc",IDM_CDROM_4_RELOAD
MENUITEM SEPARATOR
@@ -290,10 +295,18 @@ BEGIN
MENUITEM "&Resizeable window",IDM_VID_RESIZE
MENUITEM "R&emember size && position",IDM_VID_REMEMBER
MENUITEM SEPARATOR
MENUITEM "D&isc activity flash", IDM_VID_FLASH
MENUITEM SEPARATOR
MENUITEM "&DirectDraw", IDM_VID_DDRAW
MENUITEM "Direct&3D 9", IDM_VID_D3D
MENUITEM SEPARATOR
MENUITEM "D&isc activity flash", IDM_VID_FLASH
POPUP "&Window scale factor"
BEGIN
MENUITEM "&0.5x", IDM_VID_SCALE_1X
MENUITEM "&1x", IDM_VID_SCALE_2X
MENUITEM "1.&5x", IDM_VID_SCALE_3X
MENUITEM "&2x", IDM_VID_SCALE_4X
END
MENUITEM SEPARATOR
MENUITEM "&Fullscreen", IDM_VID_FULLSCREEN
POPUP "Fullscreen &stretch mode"

View File

@@ -21,6 +21,10 @@
#define IDM_VID_REMEMBER 40051
#define IDM_VID_DDRAW 40060
#define IDM_VID_D3D 40061
#define IDM_VID_SCALE_1X 40064
#define IDM_VID_SCALE_2X 40065
#define IDM_VID_SCALE_3X 40066
#define IDM_VID_SCALE_4X 40067
#define IDM_VID_FULLSCREEN 40070
#define IDM_VID_FS_FULL 40071
#define IDM_VID_FS_43 40072
@@ -44,6 +48,7 @@
#define IDM_CDROM_1_ENABLED 40300
#define IDM_CDROM_1_SOUND_ON 40400
#define IDM_CDROM_1_SCSI 40500
#define IDM_CDROM_1_DMA 40501
#define IDM_CDROM_1_C 40600
#define IDM_CDROM_1_D 40601
#define IDM_CDROM_1_E 40602
@@ -82,6 +87,7 @@
#define IDM_CDROM_2_ENABLED 41300
#define IDM_CDROM_2_SOUND_ON 41400
#define IDM_CDROM_2_SCSI 41500
#define IDM_CDROM_2_DMA 41501
#define IDM_CDROM_2_C 41600
#define IDM_CDROM_2_D 41601
#define IDM_CDROM_2_E 41602
@@ -120,6 +126,7 @@
#define IDM_CDROM_3_ENABLED 42300
#define IDM_CDROM_3_SOUND_ON 42400
#define IDM_CDROM_3_SCSI 42500
#define IDM_CDROM_3_DMA 42501
#define IDM_CDROM_3_C 42600
#define IDM_CDROM_3_D 42601
#define IDM_CDROM_3_E 42602
@@ -158,6 +165,7 @@
#define IDM_CDROM_4_ENABLED 43300
#define IDM_CDROM_4_SOUND_ON 43400
#define IDM_CDROM_4_SCSI 43500
#define IDM_CDROM_4_DMA 43501
#define IDM_CDROM_4_C 43600
#define IDM_CDROM_4_D 43601
#define IDM_CDROM_4_E 43602

View File

@@ -27,25 +27,26 @@ static int sound_card_last = 0;
typedef struct
{
char name[32];
char name[64];
char internal_name[24];
device_t *device;
} SOUND_CARD;
static SOUND_CARD sound_cards[] =
{
{"None", NULL},
{"Adlib", &adlib_device},
{"Sound Blaster 1.0", &sb_1_device},
{"Sound Blaster 1.5", &sb_15_device},
{"Sound Blaster 2.0", &sb_2_device},
{"Sound Blaster Pro v1", &sb_pro_v1_device},
{"Sound Blaster Pro v2", &sb_pro_v2_device},
{"Sound Blaster 16", &sb_16_device},
{"Sound Blaster AWE32", &sb_awe32_device},
{"Adlib Gold", &adgold_device},
{"Windows Sound System", &wss_device},
{"Pro Audio Spectrum 16", &pas16_device},
{"", NULL}
{"None", "none", NULL},
{"Adlib", "adlib", &adlib_device},
{"Sound Blaster 1.0", "sb", &sb_1_device},
{"Sound Blaster 1.5", "sb1.5", &sb_15_device},
{"Sound Blaster 2.0", "sb2.0", &sb_2_device},
{"Sound Blaster Pro v1", "sbprov1", &sb_pro_v1_device},
{"Sound Blaster Pro v2", "sbprov2", &sb_pro_v2_device},
{"Sound Blaster 16", "sb16", &sb_16_device},
{"Sound Blaster AWE32", "sbawe32", &sb_awe32_device},
{"Adlib Gold", "adlibgold", &adgold_device},
{"Windows Sound System", "wss", &wss_device},
{"Pro Audio Spectrum 16", "pas16", &pas16_device},
{"", "", NULL}
};
int sound_card_available(int card)
@@ -73,6 +74,25 @@ int sound_card_has_config(int card)
return sound_cards[card].device->config ? 1 : 0;
}
char *sound_card_get_internal_name(int card)
{
return sound_cards[card].internal_name;
}
int sound_card_get_from_internal_name(char *s)
{
int c = 0;
while (strlen(sound_cards[c].internal_name))
{
if (!strcmp(sound_cards[c].internal_name, s))
return c;
c++;
}
return 0;
}
void sound_card_init()
{
if (sound_cards[sound_card_current].device)

View File

@@ -8,6 +8,8 @@ int sound_card_available(int card);
char *sound_card_getname(int card);
struct device_t *sound_card_getdevice(int card);
int sound_card_has_config(int card);
char *sound_card_get_internal_name(int card);
int sound_card_get_from_internal_name(char *s);
void sound_card_init();
void sound_set_cd_volume(unsigned int vol_l, unsigned int vol_r);

View File

@@ -114,6 +114,11 @@ static int win_doresize = 0;
static int leave_fullscreen_flag = 0;
static int unscaled_size_x = 0;
static int unscaled_size_y = 0;
int scale = 0;
void updatewindowsize(int x, int y)
{
RECT r;
@@ -130,7 +135,7 @@ void updatewindowsize(int x, int y)
temp_overscan_x = temp_overscan_y = 0;
}
winsizex=x; efwinsizey=y;
unscaled_size_x=x; efwinsizey=y;
if (force_43)
{
@@ -138,30 +143,50 @@ void updatewindowsize(int x, int y)
if (temp_overscan_y == 16)
{
/* CGA */
winsizey = ((int) (((double) (x - temp_overscan_x) / 4.0) * 3.0)) + temp_overscan_y;
unscaled_size_y = ((int) (((double) (x - temp_overscan_x) / 4.0) * 3.0)) + temp_overscan_y;
}
else if (temp_overscan_y < 16)
{
/* MDA/Hercules */
winsizey = efwinsizey;
unscaled_size_y = ((int) (((double) (x) / 4.0) * 3.0));
}
else
{
if (enable_overscan)
{
/* EGA/(S)VGA with overscan */
winsizey = ((int) (((double) (x - temp_overscan_x) / 4.0) * 3.0)) + temp_overscan_y;
unscaled_size_y = ((int) (((double) (x - temp_overscan_x) / 4.0) * 3.0)) + temp_overscan_y;
}
else
{
/* EGA/(S)VGA without overscan */
winsizey = efwinsizey;
unscaled_size_y = ((int) (((double) (x) / 4.0) * 3.0));
}
}
}
else
{
winsizey = efwinsizey;
unscaled_size_y = efwinsizey;
}
switch(scale)
{
case 0:
winsizex = unscaled_size_x >> 1;
winsizey = unscaled_size_y >> 1;
break;
case 1:
winsizex = unscaled_size_x;
winsizey = unscaled_size_y;
break;
case 2:
winsizex = (unscaled_size_x * 3) >> 1;
winsizey = (unscaled_size_y * 3) >> 1;
break;
case 3:
winsizex = unscaled_size_x << 1;
winsizey = unscaled_size_y << 1;
break;
}
win_doresize = 1;
@@ -169,7 +194,7 @@ void updatewindowsize(int x, int y)
void uws_natural()
{
updatewindowsize(winsizex, efwinsizey);
updatewindowsize(unscaled_size_x, efwinsizey);
}
void releasemouse()
@@ -681,6 +706,9 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
if (cdrom_drives[e].bus_type)
CheckMenuItem(menu, IDM_CDROM_1_SCSI + (e * 1000), MF_CHECKED);
if (cdrom_drives[e].atapi_dma)
CheckMenuItem(menu, IDM_CDROM_1_DMA + (e * 1000), MF_CHECKED);
if (!find_in_array(valid_ide_channels, cdrom_drives[e].ide_channel, 8, IDM_CDROM_1_C + (e * 1000)))
{
fatal("CD-ROM %i: Invalid IDE channel\n", e);
@@ -767,7 +795,8 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
CheckMenuItem(menu, IDM_VID_FS_FULL + video_fullscreen_scale, MF_CHECKED);
CheckMenuItem(menu, IDM_VID_REMEMBER, window_remember ? MF_CHECKED : MF_UNCHECKED);
// set_display_switch_mode(SWITCH_BACKGROUND);
CheckMenuItem(menu, IDM_VID_SCALE_1X + scale, MF_CHECKED);
// pclog("Preparing ROM sets...\n");
d=romset;
for (c=0;c<ROM_MAX;c++)
@@ -1411,6 +1440,16 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
saveconfig();
break;
case IDM_VID_SCALE_1X:
case IDM_VID_SCALE_2X:
case IDM_VID_SCALE_3X:
case IDM_VID_SCALE_4X:
CheckMenuItem(hmenu, IDM_VID_SCALE_1X + scale, MF_UNCHECKED);
scale = LOWORD(wParam) - IDM_VID_SCALE_1X;
CheckMenuItem(hmenu, IDM_VID_SCALE_1X + scale, MF_CHECKED);
saveconfig();
break;
case IDM_USE_NUKEDOPL:
if (MessageBox(NULL,"This will reset 86Box!\nOkay to continue?","86Box",MB_OKCANCEL) != IDOK)
{
@@ -1566,6 +1605,24 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
pause = 0;
break;
case IDM_CDROM_1_DMA:
case IDM_CDROM_2_DMA:
case IDM_CDROM_3_DMA:
case IDM_CDROM_4_DMA:
cdrom_id = convert_cdrom_id(LOWORD(wParam) - IDM_CDROM_1_DMA);
if (MessageBox(NULL,"This will reset 86Box!\nOkay to continue?","86Box",MB_OKCANCEL) != IDOK)
{
break;
}
pause = 1;
Sleep(100);
cdrom_drives[cdrom_id].atapi_dma ^= 1;
CheckMenuItem(hmenu, IDM_CDROM_1_DMA + (cdrom_id * 1000), cdrom_drives[cdrom_id].atapi_dma ? MF_CHECKED : MF_UNCHECKED);
saveconfig();
resetpchard();
pause = 0;
break;
case IDM_CDROM_1_C ... IDM_CDROM_1_H:
case IDM_CDROM_2_C ... IDM_CDROM_2_H:
case IDM_CDROM_3_C ... IDM_CDROM_3_H: