Merge branch 'master' of https://github.com/86Box/86Box into feature/savquest
This commit is contained in:
@@ -532,7 +532,9 @@ load_general(void)
|
||||
}
|
||||
|
||||
sound_gain = config_get_int(cat, "sound_gain", 0);
|
||||
|
||||
kbd_req_capture = config_get_int(cat, "kbd_req_capture", 0);
|
||||
hide_status_bar = config_get_int(cat, "hide_status_bar", 0);
|
||||
|
||||
confirm_reset = config_get_int(cat, "confirm_reset", 1);
|
||||
confirm_exit = config_get_int(cat, "confirm_exit", 1);
|
||||
@@ -1977,6 +1979,7 @@ config_load(void)
|
||||
plat_langid = 0x0409;
|
||||
#endif
|
||||
kbd_req_capture = 0;
|
||||
hide_status_bar = 0;
|
||||
scale = 1;
|
||||
machine = machine_get_machine_from_internal_name("ibmpc");
|
||||
|
||||
@@ -2155,6 +2158,11 @@ save_general(void)
|
||||
else
|
||||
config_delete_var(cat, "kbd_req_capture");
|
||||
|
||||
if (hide_status_bar != 0)
|
||||
config_set_int(cat, "hide_status_bar", hide_status_bar);
|
||||
else
|
||||
config_delete_var(cat, "hide_status_bar");
|
||||
|
||||
if (confirm_reset != 1)
|
||||
config_set_int(cat, "confirm_reset", confirm_reset);
|
||||
else
|
||||
|
@@ -128,6 +128,8 @@ cart_image_load(int drive, char *fn)
|
||||
fclose(f);
|
||||
} else {
|
||||
base = drive ? 0xe0000 : 0xd0000;
|
||||
if (size == 32768)
|
||||
base += 0x8000;
|
||||
fseek(f, 0x00000000, SEEK_SET);
|
||||
carts[drive].buf = (uint8_t *) malloc(size);
|
||||
memset(carts[drive].buf, 0x00, size);
|
||||
|
@@ -80,7 +80,7 @@ extern int update_icons;
|
||||
extern int unscaled_size_x, /* current unscaled size X */
|
||||
unscaled_size_y; /* current unscaled size Y */
|
||||
|
||||
extern int kbd_req_capture;
|
||||
extern int kbd_req_capture, hide_status_bar;
|
||||
|
||||
/* System-related functions. */
|
||||
extern char *fix_exe_path(char *str);
|
||||
|
@@ -307,8 +307,7 @@
|
||||
#define IDM_ACTION_TRACE 40020
|
||||
#endif
|
||||
#define IDM_CONFIG 40020
|
||||
#define IDM_CONFIG_LOAD 40021
|
||||
#define IDM_CONFIG_SAVE 40022
|
||||
#define IDM_VID_HIDE_STATUS_BAR 40021
|
||||
#define IDM_UPDATE_ICONS 40030
|
||||
#define IDM_VID_RESIZE 40040
|
||||
#define IDM_VID_REMEMBER 40041
|
||||
|
@@ -811,8 +811,13 @@ vid_poll(void *priv)
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 3) + c + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 3) + c + 8] =
|
||||
cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
if (vid->sc == 8) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 3) + c + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 3) + c + 8] =
|
||||
cols[(fontdat[chr][7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
} else {
|
||||
buffer32->line[(vid->displine << 1)][(x << 3) + c + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 3) + c + 8] =
|
||||
cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (drawcursor) {
|
||||
@@ -844,9 +849,15 @@ vid_poll(void *priv)
|
||||
cols[0];
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] =
|
||||
cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
if (vid->sc == 8) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] =
|
||||
cols[(fontdat[chr][7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
} else {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] =
|
||||
cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (drawcursor) {
|
||||
|
@@ -604,7 +604,7 @@ nvr_reg_write(uint16_t reg, uint8_t val, void *priv)
|
||||
/*FALLTHROUGH*/
|
||||
|
||||
case 0x32:
|
||||
if ((local->cent == RTC_CENTURY_VIA) && local->wp_32)
|
||||
if ((reg == 0x32) && (local->cent == RTC_CENTURY_VIA) && local->wp_32)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
|
@@ -2243,9 +2243,6 @@ static const device_config_t sb_32_pnp_config[] =
|
||||
{
|
||||
"None", 0
|
||||
},
|
||||
{
|
||||
"512 KB", 512
|
||||
},
|
||||
{
|
||||
"2 MB", 2048
|
||||
},
|
||||
@@ -2462,21 +2459,18 @@ static const device_config_t sb_awe64_gold_config[] =
|
||||
{
|
||||
"onboard_ram", "Onboard RAM", CONFIG_SELECTION, "", 4096, "", { 0 },
|
||||
{
|
||||
{
|
||||
"None", 0
|
||||
},
|
||||
{
|
||||
"512 KB", 512
|
||||
},
|
||||
{
|
||||
"2 MB", 2048
|
||||
},
|
||||
{
|
||||
"4 MB", 4096
|
||||
},
|
||||
{
|
||||
"8 MB", 8192
|
||||
},
|
||||
{
|
||||
"12 MB", 12288
|
||||
},
|
||||
{
|
||||
"16 MB", 16384
|
||||
},
|
||||
{
|
||||
"28 MB", 28*1024
|
||||
},
|
||||
|
@@ -36,7 +36,7 @@
|
||||
typedef struct {
|
||||
mem_mapping_t mapping;
|
||||
|
||||
uint8_t crtc[32];
|
||||
uint8_t crtc[32], charbuffer[4096];
|
||||
int crtcreg;
|
||||
|
||||
uint8_t ctrl,
|
||||
@@ -63,6 +63,8 @@ typedef struct {
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
|
||||
int lp_ff;
|
||||
|
||||
int cols[256][2][2];
|
||||
|
||||
uint8_t *vram;
|
||||
@@ -123,34 +125,56 @@ hercules_out(uint16_t addr, uint8_t val, void *priv)
|
||||
dev->crtc[10] = 0xb;
|
||||
dev->crtc[11] = 0xc;
|
||||
}
|
||||
#if 0
|
||||
if (old ^ val)
|
||||
recalc_timings(dev);
|
||||
#else
|
||||
|
||||
if (old != val) {
|
||||
if ((dev->crtcreg < 0xe) || (dev->crtcreg > 0x10)) {
|
||||
fullchange = changeframecount;
|
||||
recalc_timings(dev);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 0x03b8:
|
||||
old = dev->ctrl;
|
||||
/* Prevent settings of bits if they are disabled in CTRL2. */
|
||||
if (!(dev->ctrl2 & 0x01) && (val & 0x02))
|
||||
val &= 0xfd;
|
||||
if (!(dev->ctrl2 & 0x02) && (val & 0x80))
|
||||
val &= 0x7f;
|
||||
dev->ctrl = val;
|
||||
|
||||
/* Prevent setting of bits if they are disabled in CTRL2. */
|
||||
if ((old & 0x02) && !(val & 0x02))
|
||||
dev->ctrl &= 0xfd;
|
||||
else if ((val & 0x02) && (dev->ctrl2 & 0x01))
|
||||
dev->ctrl |= 0x02;
|
||||
|
||||
if ((old & 0x80) && !(val & 0x80))
|
||||
dev->ctrl &= 0x7f;
|
||||
else if ((val & 0x80) && (dev->ctrl2 & 0x02))
|
||||
dev->ctrl |= 0x80;
|
||||
|
||||
dev->ctrl = (dev->ctrl & 0x82) | (val & 0x7d);
|
||||
|
||||
if (old ^ val)
|
||||
recalc_timings(dev);
|
||||
break;
|
||||
|
||||
case 0x03b9:
|
||||
case 0x03bb:
|
||||
dev->lp_ff = !(addr & 0x0002);
|
||||
break;
|
||||
|
||||
case 0x03bf:
|
||||
old = dev->ctrl2;
|
||||
dev->ctrl2 = val;
|
||||
/* According to the Programmer's guide to the Hercules graphics cars
|
||||
by David B. Doty from 1988, the CTRL2 modes (bits 1,0) are as follow:
|
||||
- 00: DIAG: Text mode only, only page 0 accessible;
|
||||
- 01: HALF: Graphics mode allowed, only page 0 accessible;
|
||||
- 11: FULL: Graphics mode allowed, both pages accessible. */
|
||||
if (val & 0x01)
|
||||
mem_mapping_set_exec(&dev->mapping, dev->vram);
|
||||
else
|
||||
mem_mapping_set_exec(&dev->mapping, NULL);
|
||||
if (val & 0x02)
|
||||
mem_mapping_set_addr(&dev->mapping, 0xb0000, 0x10000);
|
||||
else
|
||||
mem_mapping_set_addr(&dev->mapping, 0xb0000, 0x08000);
|
||||
if (old ^ val)
|
||||
recalc_timings(dev);
|
||||
break;
|
||||
@@ -180,19 +204,18 @@ hercules_in(uint16_t addr, void *priv)
|
||||
case 0x03b5:
|
||||
case 0x03b7:
|
||||
ret = dev->crtc[dev->crtcreg];
|
||||
if (dev->crtcreg == 12)
|
||||
ret = (dev->ma >> 8) & 0x3f;
|
||||
else
|
||||
ret = dev->ma & 0xff;
|
||||
break;
|
||||
|
||||
case 0x03ba:
|
||||
ret = 0x72; /* Hercules ident */
|
||||
#if 0
|
||||
if (dev->stat & 0x08)
|
||||
ret |= 0x88;
|
||||
#else
|
||||
ret = 0x70; /* Hercules ident */
|
||||
ret |= (dev->lp_ff ? 2 : 0);
|
||||
ret |= (dev->stat & 0x01);
|
||||
if (dev->stat & 0x08)
|
||||
ret |= 0x80;
|
||||
#endif
|
||||
if ((dev->stat & 0x09) == 0x01)
|
||||
ret |= (dev->stat & 0x01);
|
||||
if ((ret & 0x81) == 0x80)
|
||||
ret |= 0x08;
|
||||
break;
|
||||
@@ -222,9 +245,11 @@ hercules_write(uint32_t addr, uint8_t val, void *priv)
|
||||
hercules_t *dev = (hercules_t *)priv;
|
||||
|
||||
if (dev->ctrl2 & 0x01)
|
||||
dev->vram[addr & 0xffff] = val;
|
||||
addr &= 0xffff;
|
||||
else
|
||||
dev->vram[addr & 0x0fff] = val;
|
||||
addr &= 0x0fff;
|
||||
|
||||
dev->vram[addr] = val;
|
||||
|
||||
hercules_waitstates(dev);
|
||||
}
|
||||
@@ -234,13 +259,18 @@ static uint8_t
|
||||
hercules_read(uint32_t addr, void *priv)
|
||||
{
|
||||
hercules_t *dev = (hercules_t *)priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
if (dev->ctrl2 & 0x01)
|
||||
return(dev->vram[addr & 0xffff]);
|
||||
addr &= 0xffff;
|
||||
else
|
||||
return(dev->vram[addr & 0x0fff]);
|
||||
addr &= 0x0fff;
|
||||
|
||||
hercules_waitstates(dev);
|
||||
|
||||
ret = dev->vram[addr];
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -268,14 +298,14 @@ hercules_poll(void *priv)
|
||||
|
||||
if (dev->dispon) {
|
||||
if (dev->displine < dev->firstline) {
|
||||
dev->firstline = dev->displine;
|
||||
video_wait_for_buffer();
|
||||
dev->firstline = dev->displine;
|
||||
video_wait_for_buffer();
|
||||
}
|
||||
dev->lastline = dev->displine;
|
||||
|
||||
if ((dev->ctrl & 0x02) && (dev->ctrl2 & 0x01)) {
|
||||
if (dev->ctrl & 0x02) {
|
||||
ca = (dev->sc & 3) * 0x2000;
|
||||
if ((dev->ctrl & 0x80) && (dev->ctrl2 & 0x02))
|
||||
if (dev->ctrl & 0x80)
|
||||
ca += 0x8000;
|
||||
|
||||
for (x = 0; x < dev->crtc[1]; x++) {
|
||||
@@ -290,13 +320,12 @@ hercules_poll(void *priv)
|
||||
video_blend((x << 4) + c, dev->displine);
|
||||
}
|
||||
} else {
|
||||
pa = ((dev->ctrl & 0x80) && (dev->ctrl2 & 0x02)) ? 0x8000 : 0x0000;
|
||||
for (x = 0; x < dev->crtc[1]; x++) {
|
||||
if (dev->ctrl & 8) {
|
||||
/* Undocumented behavior: page 1 in text mode means characters are read
|
||||
from page 1 and attributes from page 0. */
|
||||
chr = dev->vram[((dev->ma << 1) & 0xfff) + pa];
|
||||
attr = dev->vram[((dev->ma << 1) + 1) & 0xfff];
|
||||
chr = dev->charbuffer[x << 1];
|
||||
attr = dev->charbuffer[(x << 1) + 1];
|
||||
} else
|
||||
chr = attr = 0;
|
||||
drawcursor = ((dev->ma == ca) && dev->con && dev->cursoron);
|
||||
@@ -314,7 +343,10 @@ hercules_poll(void *priv)
|
||||
else
|
||||
buffer32->line[dev->displine][(x * 9) + 8] = dev->cols[attr][blink][0];
|
||||
}
|
||||
dev->ma++;
|
||||
if (dev->ctrl2 & 0x01)
|
||||
dev->ma = (dev->ma + 1) & 0x3fff;
|
||||
else
|
||||
dev->ma = (dev->ma + 1) & 0x7ff;
|
||||
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 9; c++)
|
||||
@@ -333,6 +365,9 @@ hercules_poll(void *priv)
|
||||
} else {
|
||||
timer_advance_u64(&dev->timer, dev->dispontime);
|
||||
|
||||
if (dev->dispon)
|
||||
dev->stat &= ~1;
|
||||
|
||||
dev->linepos = 0;
|
||||
if (dev->vsynctime) {
|
||||
dev->vsynctime--;
|
||||
@@ -350,42 +385,51 @@ hercules_poll(void *priv)
|
||||
dev->sc++;
|
||||
dev->sc &= 31;
|
||||
dev->ma = dev->maback;
|
||||
|
||||
dev->vadj--;
|
||||
if (! dev->vadj) {
|
||||
dev->dispon = 1;
|
||||
dev->ma = dev->maback = (dev->crtc[13] | (dev->crtc[12] << 8)) & 0x3fff;
|
||||
dev->sc = 0;
|
||||
}
|
||||
} else if (dev->sc == dev->crtc[9] || ((dev->crtc[8] & 3) == 3 && dev->sc == (dev->crtc[9] >> 1))) {
|
||||
} else if (((dev->crtc[8] & 3) != 3 && dev->sc == dev->crtc[9]) || ((dev->crtc[8] & 3) == 3 && dev->sc == (dev->crtc[9] >> 1))) {
|
||||
dev->maback = dev->ma;
|
||||
dev->sc = 0;
|
||||
oldvc = dev->vc;
|
||||
dev->vc++;
|
||||
dev->vc &= 127;
|
||||
|
||||
if (dev->vc == dev->crtc[6])
|
||||
dev->dispon = 0;
|
||||
|
||||
if (oldvc == dev->crtc[4]) {
|
||||
dev->vc = 0;
|
||||
dev->vadj = dev->crtc[5];
|
||||
if (! dev->vadj)
|
||||
if (! dev->vadj) {
|
||||
dev->dispon = 1;
|
||||
if (! dev->vadj)
|
||||
dev->ma = dev->maback = (dev->crtc[13] | (dev->crtc[12] << 8)) & 0x3fff;
|
||||
if ((dev->crtc[10] & 0x60) == 0x20)
|
||||
dev->cursoron = 0;
|
||||
else
|
||||
dev->cursoron = dev->blink & 16;
|
||||
}
|
||||
switch (dev->crtc[10] & 0x60) {
|
||||
case 0x20:
|
||||
dev->cursoron = 0;
|
||||
break;
|
||||
case 0x60:
|
||||
dev->cursoron = dev->blink & 0x10;
|
||||
break;
|
||||
default:
|
||||
dev->cursoron = dev->blink & 0x08;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (dev->vc == dev->crtc[7]) {
|
||||
dev->dispon = 0;
|
||||
dev->displine = 0;
|
||||
dev->vsynctime = 16;//(crtcm[3]>>4)+1;
|
||||
if ((dev->crtc[8] & 3) == 3)
|
||||
dev->vsynctime = ((int32_t)dev->crtc[4] * ((dev->crtc[9] >> 1) + 1)) + dev->crtc[5] - dev->crtc[7] + 1;
|
||||
else
|
||||
dev->vsynctime = ((int32_t)dev->crtc[4] * (dev->crtc[9] + 1)) + dev->crtc[5] - dev->crtc[7] + 1;
|
||||
if (dev->crtc[7]) {
|
||||
// if ((dev->ctrl & 2) && (dev->ctrl2 & 1))
|
||||
if (dev->ctrl & 2)
|
||||
if (dev->ctrl & 0x02)
|
||||
x = dev->crtc[1] << 4;
|
||||
else
|
||||
x = dev->crtc[1] * 9;
|
||||
@@ -405,7 +449,8 @@ hercules_poll(void *priv)
|
||||
|
||||
video_blit_memtoscreen_8(0, dev->firstline, 0, ysize, xsize, ysize);
|
||||
frames++;
|
||||
if ((dev->ctrl & 2) && (dev->ctrl2 & 1)) {
|
||||
// if ((dev->ctrl & 2) && (dev->ctrl2 & 1)) {
|
||||
if (dev->ctrl & 0x02) {
|
||||
video_res_x = dev->crtc[1] * 16;
|
||||
video_res_y = dev->crtc[6] * 4;
|
||||
video_bpp = 1;
|
||||
@@ -425,12 +470,15 @@ hercules_poll(void *priv)
|
||||
dev->ma = dev->maback;
|
||||
}
|
||||
|
||||
if (dev->dispon)
|
||||
dev->stat &= ~1;
|
||||
|
||||
if ((dev->sc == (dev->crtc[10] & 31) ||
|
||||
((dev->crtc[8] & 3)==3 && dev->sc == ((dev->crtc[10] & 31) >> 1))))
|
||||
dev->con = 1;
|
||||
if (dev->dispon && !(dev->ctrl & 0x02)) {
|
||||
for (x = 0; x < (dev->crtc[1] << 1); x++) {
|
||||
pa = (dev->ctrl & 0x80) ? ((x & 1) ? 0x0000 : 0x8000) : 0x0000;
|
||||
dev->charbuffer[x] = dev->vram[(((dev->ma << 1) + x) & 0x3fff) + pa];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,9 +496,9 @@ hercules_init(const device_t *info)
|
||||
|
||||
timer_add(&dev->timer, hercules_poll, dev, 1);
|
||||
|
||||
mem_mapping_add(&dev->mapping, 0xb0000, 0x10000,
|
||||
mem_mapping_add(&dev->mapping, 0xb0000, 0x08000,
|
||||
hercules_read,NULL,NULL, hercules_write,NULL,NULL,
|
||||
dev->vram, MEM_MAPPING_EXTERNAL, dev);
|
||||
NULL /*dev->vram*/, MEM_MAPPING_EXTERNAL, dev);
|
||||
|
||||
io_sethandler(0x03b0, 16,
|
||||
hercules_in,NULL,NULL, hercules_out,NULL,NULL, dev);
|
||||
|
@@ -59,6 +59,8 @@ BEGIN
|
||||
END
|
||||
POPUP "&View"
|
||||
BEGIN
|
||||
MENUITEM "&Hide status bar", IDM_VID_HIDE_STATUS_BAR
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Resizeable window", IDM_VID_RESIZE
|
||||
MENUITEM "R&emember size && position", IDM_VID_REMEMBER
|
||||
MENUITEM SEPARATOR
|
||||
|
@@ -1075,7 +1075,10 @@ plat_setfullscreen(int on)
|
||||
GetClientRect(hwndMain, &rect);
|
||||
|
||||
temp_x = rect.right - rect.left + 1;
|
||||
temp_y = rect.bottom - rect.top + 1 - sbar_height;
|
||||
if (hide_status_bar)
|
||||
temp_y = rect.bottom - rect.top + 1;
|
||||
else
|
||||
temp_y = rect.bottom - rect.top + 1 - sbar_height;
|
||||
} else {
|
||||
if (dpi_scale) {
|
||||
temp_x = MulDiv((vid_resize & 2) ? fixed_size_x : unscaled_size_x, dpi, 96);
|
||||
@@ -1086,7 +1089,10 @@ plat_setfullscreen(int on)
|
||||
}
|
||||
|
||||
/* Main Window. */
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
}
|
||||
|
||||
/* Render window. */
|
||||
|
@@ -103,11 +103,11 @@ media_menu_set_name_cartridge(int drive)
|
||||
wchar_t name[512], fn[512];
|
||||
MENUITEMINFO mii = { 0 };
|
||||
|
||||
if (strlen(floppyfns[drive]) == 0) {
|
||||
if (strlen(cart_fns[drive]) == 0) {
|
||||
_swprintf(name, plat_get_string(IDS_2150),
|
||||
drive + 1, plat_get_string(IDS_2057));
|
||||
} else {
|
||||
mbstoc16s(fn, floppyfns[drive], sizeof_w(fn));
|
||||
mbstoc16s(fn, cart_fns[drive], sizeof_w(fn));
|
||||
_swprintf(name, plat_get_string(IDS_2150),
|
||||
drive + 1, fn);
|
||||
}
|
||||
@@ -608,7 +608,7 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDM_CARTRIDGE_IMAGE:
|
||||
ret = file_dlg_st(hwnd, IDS_2151, floppyfns[id], NULL, 0);
|
||||
ret = file_dlg_st(hwnd, IDS_2151, cart_fns[id], NULL, 0);
|
||||
if (! ret)
|
||||
cartridge_mount(id, openfilestring, wp);
|
||||
break;
|
||||
|
@@ -1070,6 +1070,7 @@ static BOOL CALLBACK
|
||||
win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int c = 0, d = 0;
|
||||
int e;
|
||||
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
@@ -1107,7 +1108,8 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
settings_enable_window(hdlg, IDC_COMBO_VIDEO, !(machines[temp_machine].flags & MACHINE_VIDEO_ONLY));
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(temp_gfxcard));
|
||||
e = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
||||
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(e));
|
||||
settings_enable_window(hdlg, IDC_CHECK_VOODOO, (machines[temp_machine].flags & MACHINE_BUS_PCI));
|
||||
settings_set_check(hdlg, IDC_CHECK_VOODOO, temp_voodoo);
|
||||
settings_enable_window(hdlg, IDC_BUTTON_VOODOO, (machines[temp_machine].flags & MACHINE_BUS_PCI) && temp_voodoo);
|
||||
@@ -2152,7 +2154,7 @@ win_settings_hard_disks_update_item(HWND hdlg, int i, int column)
|
||||
wsprintf(szText, plat_get_string(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
|
||||
break;
|
||||
case HDD_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id >> 4 & 15);
|
||||
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id & 15);
|
||||
break;
|
||||
}
|
||||
lvI.pszText = szText;
|
||||
@@ -2226,7 +2228,7 @@ win_settings_hard_disks_recalc_list(HWND hdlg)
|
||||
wsprintf(szText, plat_get_string(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
|
||||
break;
|
||||
case HDD_BUS_SCSI:
|
||||
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id >> 4 & 15);
|
||||
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id & 15);
|
||||
break;
|
||||
}
|
||||
lvI.pszText = szText;
|
||||
|
@@ -68,6 +68,7 @@ int rctrl_is_lalt = 0;
|
||||
int user_resize = 0;
|
||||
int fixed_size_x = 0, fixed_size_y = 0;
|
||||
int kbd_req_capture = 0;
|
||||
int hide_status_bar = 0;
|
||||
|
||||
extern char openfilestring[512];
|
||||
extern WCHAR wopenfilestring[512];
|
||||
@@ -257,12 +258,6 @@ video_set_filter_menu(HMENU menu)
|
||||
static void
|
||||
ResetAllMenus(void)
|
||||
{
|
||||
#ifndef DEV_BRANCH
|
||||
/* FIXME: until we fix these.. --FvK */
|
||||
EnableMenuItem(menuMain, IDM_CONFIG_LOAD, MF_DISABLED);
|
||||
EnableMenuItem(menuMain, IDM_CONFIG_SAVE, MF_DISABLED);
|
||||
#endif
|
||||
|
||||
CheckMenuItem(menuMain, IDM_ACTION_RCTRL_IS_LALT, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_ACTION_KBD_REQ_CAPTURE, MF_UNCHECKED);
|
||||
|
||||
@@ -292,6 +287,7 @@ ResetAllMenus(void)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
CheckMenuItem(menuMain, IDM_VID_HIDE_STATUS_BAR, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_FORCE43, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_OVERSCAN, MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_INVERT, MF_UNCHECKED);
|
||||
@@ -358,6 +354,7 @@ ResetAllMenus(void)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
CheckMenuItem(menuMain, IDM_VID_HIDE_STATUS_BAR, hide_status_bar ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_FORCE43, force_43?MF_CHECKED:MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_OVERSCAN, enable_overscan?MF_CHECKED:MF_UNCHECKED);
|
||||
CheckMenuItem(menuMain, IDM_VID_INVERT, invert_display ? MF_CHECKED : MF_UNCHECKED);
|
||||
@@ -705,6 +702,18 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
config_save();
|
||||
break;
|
||||
|
||||
case IDM_VID_HIDE_STATUS_BAR:
|
||||
hide_status_bar ^= 1;
|
||||
CheckMenuItem(hmenu, IDM_VID_HIDE_STATUS_BAR, hide_status_bar ? MF_CHECKED : MF_UNCHECKED);
|
||||
ShowWindow(hwndSBAR, hide_status_bar ? SW_HIDE : SW_SHOW);
|
||||
GetWindowRect(hwnd, &rect);
|
||||
if (hide_status_bar)
|
||||
MoveWindow(hwnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top - sbar_height, TRUE);
|
||||
else
|
||||
MoveWindow(hwnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top + sbar_height, TRUE);
|
||||
config_save();
|
||||
break;
|
||||
|
||||
case IDM_VID_RESIZE:
|
||||
vid_resize ^= 1;
|
||||
CheckMenuItem(hmenu, IDM_VID_RESIZE, (vid_resize & 1) ? MF_CHECKED : MF_UNCHECKED);
|
||||
@@ -723,7 +732,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
temp_y = unscaled_size_y;
|
||||
}
|
||||
|
||||
ResizeWindowByClientArea(hwnd, temp_x, temp_y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwnd, temp_x, temp_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwnd, temp_x, temp_y + sbar_height);
|
||||
|
||||
if (mouse_capture) {
|
||||
ClipCursor(&rect);
|
||||
@@ -1009,7 +1021,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
/* Main Window. */
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
|
||||
} else if (!user_resize)
|
||||
doresize = 1;
|
||||
break;
|
||||
@@ -1039,8 +1054,12 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (!(pos->flags & SWP_NOSIZE) || !user_resize) {
|
||||
plat_vidapi_enable(0);
|
||||
|
||||
MoveWindow(hwndSBAR, 0, rect.bottom - sbar_height, sbar_height, rect.right, TRUE);
|
||||
MoveWindow(hwndRender, 0, 0, rect.right, rect.bottom - sbar_height, TRUE);
|
||||
if (hide_status_bar)
|
||||
MoveWindow(hwndRender, 0, 0, rect.right, rect.bottom, TRUE);
|
||||
else {
|
||||
MoveWindow(hwndSBAR, 0, rect.bottom - sbar_height, sbar_height, rect.right, TRUE);
|
||||
MoveWindow(hwndRender, 0, 0, rect.right, rect.bottom - sbar_height, TRUE);
|
||||
}
|
||||
|
||||
GetClientRect(hwndRender, &rect);
|
||||
if (dpi_scale) {
|
||||
@@ -1423,6 +1442,8 @@ ui_init(int nCmdShow)
|
||||
/* Get the actual height of the status bar */
|
||||
GetWindowRect(hwndSBAR, &sbar_rect);
|
||||
sbar_height = sbar_rect.bottom - sbar_rect.top;
|
||||
if (hide_status_bar)
|
||||
ShowWindow(hwndSBAR, SW_HIDE);
|
||||
|
||||
/* Set up main window for resizing if configured. */
|
||||
if (vid_resize == 1)
|
||||
@@ -1445,7 +1466,10 @@ ui_init(int nCmdShow)
|
||||
scrnsz_x = fixed_size_x;
|
||||
scrnsz_y = fixed_size_y;
|
||||
}
|
||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
|
||||
}
|
||||
|
||||
/* Reset all menus to their defaults. */
|
||||
@@ -1689,7 +1713,10 @@ plat_resize(int x, int y)
|
||||
x = MulDiv(x, dpi, 96);
|
||||
y = MulDiv(y, dpi, 96);
|
||||
}
|
||||
ResizeWindowByClientArea(hwndMain, x, y + sbar_height);
|
||||
if (hide_status_bar)
|
||||
ResizeWindowByClientArea(hwndMain, x, y);
|
||||
else
|
||||
ResizeWindowByClientArea(hwndMain, x, y + sbar_height);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user