More cleanups, integrating win.c and multilanguage support, initial UI API cleanup.

This commit is contained in:
waltje
2017-10-08 19:14:46 -04:00
parent 460d66a058
commit c902d553f1
18 changed files with 643 additions and 649 deletions

View File

@@ -8,7 +8,7 @@
#
# Modified Makefile for Win32 (MinGW32) environment.
#
# Version: @(#)Makefile.mingw 1.0.53 2017/10/06
# Version: @(#)Makefile.mingw 1.0.54 2017/10/07
#
# Authors: Miran Grca, <mgrca8@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com>
@@ -16,13 +16,13 @@
# Name of the executable.
ifndef PROG
PROG := 86Box
PROG := 86Box
endif
# Various compile-time options.
# -DROM_TRACE=0xc800 traces ROM access from segment C800
# -DIO_TRACE=0x66 traces I/O on port 0x66
STUFF :=
STUFF :=
# Add feature selections here.
# -DANSI_CFG forces the config file to ANSI encoding.
@@ -40,59 +40,59 @@ STUFF :=
# -DENABLE_NIC_LOG enables extra logging.
# -DENABLE_KEYBOARD_LOG enables extra logging.
ifndef EXTRAS
EXTRAS :=
EXTRAS :=
endif
# Defaults for several build options (possibly defined in a chained file.)
ifndef AUTODEP
AUTODEP := n
AUTODEP := n
endif
ifndef DEBUG
DEBUG := n
DEBUG := n
endif
ifndef OPTIM
OPTIM := n
OPTIM := n
endif
ifndef RELEASE
RELEASE := n
RELEASE := n
endif
ifndef USB
USB := n
USB := n
endif
ifndef DEV_BUILD
DEV_BUILD := n
DEV_BUILD := n
endif
ifndef DEV_BRANCH
DEV_BRANCH := n
DEV_BRANCH := n
endif
ifndef CIRRUS
CIRRUS := n
CIRRUS := n
endif
ifndef NCR_SCSI
NCR_SCSI := n
endif
ifndef NV_RIVA
NV_RIVA := n
NV_RIVA := n
endif
ifndef FLUIDSYNTH
FLUIDSYNTH := y
FLUIDSYNTH := y
endif
ifndef MUNT
MUNT := y
MUNT := y
endif
ifndef PAS16
PAS16 := n
PAS16 = n
endif
ifndef X64
X64 := n
X64 := n
endif
ifeq ($(DEV_BUILD), y)
DEV_BRANCH := y
CIRRUS := y
NCR_SCSI := y
NV_RIVA := y
PAS16 := y
DEV_BRANCH := y
CIRRUS := y
NCR_SCSI := y
NV_RIVA := y
PAS16 := y
endif
@@ -357,11 +357,11 @@ VIDOBJ := video.o \
WINOBJ := win.o \
win_ddraw.o win_ddraw_fs.o win_d3d.o win_d3d_fs.o \
win_language.o win_status.o $(OPENDIR) win_dynld.o \
win_video.o $(WSERIAL) win_keyboard.o win_mouse.o \
win_joystick.o win_midi.o win_cdrom.o win_cdrom_ioctl.o \
win_thread.o win_about.o win_stbar.o win_settings.o \
win_deviceconfig.o win_joystickconfig.o
win_dialog.o win_about.o win_status.o win_stbar.o \
win_settings.o $(OPENDIR) win_dynld.o win_video.o \
$(WSERIAL) win_keyboard.o win_mouse.o win_joystick.o \
win_midi.o win_cdrom.o win_cdrom_ioctl.o \
win_thread.o win_deviceconfig.o win_joystickconfig.o
OBJ := $(MAINOBJ) $(CPUOBJ) $(MCHOBJ) $(DEVOBJ) \
$(FDDOBJ) $(CDROMOBJ) $(HDDOBJ) \

View File

@@ -9,9 +9,10 @@
* Implementation of the CD-ROM drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)cdrom.c 1.0.11 2017/10/07
* Version: @(#)cdrom.c 1.0.12 2017/10/07
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2016,2017 Miran Grca.
*/
#include <stdio.h>
@@ -725,7 +726,6 @@ uint8_t cdrom_mode_sense_pages_saved[CDROM_NUM][0x40][0x40] =
{ GPMODE_CAPABILITIES_PAGE, 0x12, 0, 0, 1, 0, 0, 0, 0x02, 0xC2, 0, 2, 0, 0, 0x02, 0xC2, 0, 0, 0, 0 } }
};
#define ENABLE_CDROM_LOG 0
int cdrom_do_log = 0;
void cdrom_log(const char *format, ...)

View File

@@ -8,12 +8,13 @@
*
* Configuration file handler.
*
* Version: @(#)config.c 1.0.13 2017/10/05
* Version: @(#)config.c 1.0.14 2017/10/07
*
* Authors: Sarah Walker,
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Overdoze,
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
@@ -55,7 +56,6 @@
#include "sound/sound.h"
#include "video/video.h"
#include "win/win.h"
#include "win/win_language.h"
typedef struct _list_ {

View File

@@ -8,10 +8,11 @@
*
* Common code to handle all sorts of hard disk images.
*
* Version: @(#)hdd.c 1.0.3 2017/10/05
* Version: @(#)hdd.c 1.0.3 2017/10/07
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
*/
@@ -24,7 +25,6 @@
#include "../device.h"
#include "../machine/machine.h"
#include "../win/win.h"
#include "../win/win_language.h"
#include "hdd.h"

View File

@@ -8,11 +8,12 @@
*
* Emulation core dispatcher.
*
* Version: @(#)pc.c 1.0.17 2017/10/04
* Version: @(#)pc.c 1.0.18 2017/10/08
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
@@ -39,13 +40,7 @@
#include "disk/hdc.h"
#include "disk/hdc_ide.h"
#include "floppy/floppy.h"
#include "floppy/floppy_86f.h"
#include "floppy/floppy_fdi.h"
#include "floppy/floppy_imd.h"
#include "floppy/floppy_img.h"
#include "floppy/floppy_td0.h"
#include "floppy/fdc.h"
#include "floppy/fdd.h"
#include "game/gameport.h"
#include "keyboard.h"
#include "keyboard_at.h"
@@ -69,7 +64,6 @@
#include "win/plat_mouse.h"
#include "win/plat_ui.h"
#include "win/win.h"
#include "win/win_language.h"
#include "scsi/scsi.h"
#include "serial.h"
#include "sound/sound.h"
@@ -545,6 +539,7 @@ pc_reset_hard_init(void)
fdc_init();
fdc_update_is_nsc(0);
floppy_reset();
#ifndef WALTJE
/* This is needed to initialize the serial timer. */
serial_init();
@@ -773,8 +768,8 @@ pc_run(void)
_swprintf(s, L"%s v%s - %i%% - %s - %s - %s",
EMU_NAME_W, EMU_VERSION_W,
fps, wmachine, wcpu,
(!mousecapture) ? plat_get_string_from_id(IDS_2077)
: ((mouse_get_type(mouse_type) & MOUSE_TYPE_3BUTTON) ? plat_get_string_from_id(IDS_2078) : plat_get_string_from_id(IDS_2079)));
(!mousecapture) ? plat_get_string(IDS_2077)
: ((mouse_get_type(mouse_type) & MOUSE_TYPE_3BUTTON) ? plat_get_string(IDS_2078) : plat_get_string(IDS_2079)));
set_window_title(s);
win_title_update = 0;

View File

@@ -1,33 +1,34 @@
#ifndef __unix
extern void plat_msgbox_error(int i);
extern wchar_t *plat_get_string_from_id(int i);
extern wchar_t *plat_get_string(int i);
#ifndef IDS_2077
#define IDS_2077 2077
#endif
//#ifndef IDS_2077
//#define IDS_2077 2077
//#endif
#ifndef IDS_2078
#define IDS_2078 2078
#endif
//#ifndef IDS_2078
//#define IDS_2078 2078
//#endif
#ifndef IDS_2079
#define IDS_2079 2079
#endif
//#ifndef IDS_2079
//#define IDS_2079 2079
//#endif
#ifndef IDS_2139
#define IDS_2139 2139
# define IDS_2139 2139 /* network/network.c */
#endif
#ifndef IDS_2171
#define IDS_2171 2171
#endif
//#ifndef IDS_2171
//#define IDS_2171 2171
//#endif
#ifndef IDS_2219
#define IDS_2219 2219
#endif
//#ifndef IDS_2219
//#define IDS_2219 2219
//#endif
#endif
extern void plat_msgbox_fatal(char *string);
extern void get_executable_name(wchar_t *s, int size);
extern void set_window_title(wchar_t *s);
extern void startblit(void);

View File

@@ -10,11 +10,12 @@
*
* NOTE: FIXME: Strings 2176 and 2193 are same.
*
* Version: @(#)resource.h 1.0.10 2017/10/05
* Version: @(#)resource.h 1.0.11 2017/10/07
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempem, <decwiz@yahoo.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/

View File

@@ -8,7 +8,7 @@
*
* The Emulator's Windows core.
*
* Version: @(#)win.c 1.0.16 2017/10/06
* Version: @(#)win.c 1.0.17 2017/10/08
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -27,6 +27,7 @@
#include <fcntl.h>
#include <io.h>
#include <process.h>
#include <shlobj.h>
#undef BITMAP
#include <stdio.h>
#include <stdint.h>
@@ -63,16 +64,21 @@
#include "win_cgapal.h"
#include "win_ddraw.h"
#include "win_d3d.h"
#include "win_language.h"
#ifndef MAPVK_VK_TO_VSC
#define MAPVK_VK_TO_VSC 0
# define MAPVK_VK_TO_VSC 0
#endif
#define TIMER_1SEC 1
typedef struct {
WCHAR str[512];
} rc_str_t;
extern int updatestatus;
@@ -84,6 +90,19 @@ HANDLE slirpMutex;
HINSTANCE hinstance;
HICON hIcon[512];
RECT oldclip;
LCID dwLanguage;
uint32_t dwLangID,
dwSubLangID;
rc_str_t *lpRCstr2048;
rc_str_t *lpRCstr3072;
rc_str_t *lpRCstr4096;
rc_str_t *lpRCstr4352;
rc_str_t *lpRCstr4608;
rc_str_t *lpRCstr5120;
rc_str_t *lpRCstr5376;
rc_str_t *lpRCstr5632;
rc_str_t *lpRCstr6144;
int pause = 0;
int scale = 0;
@@ -97,6 +116,8 @@ int drawits = 0;
int quited = 0;
int mousecapture = 0;
uint64_t main_time;
char openfilestring[260];
WCHAR wopenfilestring[260];
static RAWINPUTDEVICE device;
@@ -905,6 +926,50 @@ SubWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
}
static void
LoadCommonStrings(void)
{
int i;
lpRCstr2048 = (rc_str_t *)malloc(STRINGS_NUM_2048*sizeof(rc_str_t));
lpRCstr3072 = (rc_str_t *)malloc(STRINGS_NUM_3072*sizeof(rc_str_t));
lpRCstr4096 = (rc_str_t *)malloc(STRINGS_NUM_4096*sizeof(rc_str_t));
lpRCstr4352 = (rc_str_t *)malloc(STRINGS_NUM_4352*sizeof(rc_str_t));
lpRCstr4608 = (rc_str_t *)malloc(STRINGS_NUM_4608*sizeof(rc_str_t));
lpRCstr5120 = (rc_str_t *)malloc(STRINGS_NUM_5120*sizeof(rc_str_t));
lpRCstr5376 = (rc_str_t *)malloc(STRINGS_NUM_5376*sizeof(rc_str_t));
lpRCstr5632 = (rc_str_t *)malloc(STRINGS_NUM_5632*sizeof(rc_str_t));
lpRCstr6144 = (rc_str_t *)malloc(STRINGS_NUM_6144*sizeof(rc_str_t));
for (i=0; i<STRINGS_NUM_2048; i++)
LoadString(hinstance, 2048+i, lpRCstr2048[i].str, 512);
for (i=0; i<STRINGS_NUM_3072; i++)
LoadString(hinstance, 3072+i, lpRCstr3072[i].str, 512);
for (i=0; i<STRINGS_NUM_4096; i++)
LoadString(hinstance, 4096+i, lpRCstr4096[i].str, 512);
for (i=0; i<STRINGS_NUM_4352; i++)
LoadString(hinstance, 4352+i, lpRCstr4352[i].str, 512);
for (i=0; i<STRINGS_NUM_4608; i++)
LoadString(hinstance, 4608+i, lpRCstr4608[i].str, 512);
for (i=0; i<STRINGS_NUM_5120; i++)
LoadString(hinstance, 5120+i, lpRCstr5120[i].str, 512);
for (i=0; i<STRINGS_NUM_5376; i++)
LoadString(hinstance, 5376+i, lpRCstr5376[i].str, 512);
for (i=0; i<STRINGS_NUM_5632; i++)
LoadString(hinstance, 5632+i, lpRCstr5632[i].str, 512);
for (i=0; i<STRINGS_NUM_6144; i++)
LoadString(hinstance, 6144+i, lpRCstr6144[i].str, 512);
}
#ifdef USE_CONSOLE
/* Create a console if we don't already have one. */
static void
@@ -1050,7 +1115,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil)
hinstance = hInst;
/* Load common strings from the resource file. */
win_language_load_common_strings();
LoadCommonStrings();
/* Create our main window's class and register it. */
wincl.hInstance = hInst;
@@ -1119,8 +1184,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil)
haccel = LoadAccelerators(hInst, ACCEL_NAME);
if (haccel == NULL) {
MessageBox(hwndMain,
win_language_get_string_from_id(IDS_2053),
win_language_get_string_from_id(IDS_2050),
win_get_string(IDS_2053),
win_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
return(3);
}
@@ -1133,8 +1198,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil)
device.hwndTarget = hwnd;
if (! RegisterRawInputDevices(&device, 1, sizeof(device))) {
MessageBox(hwndMain,
win_language_get_string_from_id(IDS_2054),
win_language_get_string_from_id(IDS_2050),
win_get_string(IDS_2054),
win_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
return(4);
}
@@ -1159,8 +1224,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil)
vid_api ^= 1;
if (! vid_apis[0][vid_api].init(hwndRender)) {
MessageBox(hwnd,
win_language_get_string_from_id(IDS_2095),
win_language_get_string_from_id(IDS_2050),
win_get_string(IDS_2095),
win_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
return(5);
}
@@ -1189,8 +1254,8 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil)
if (! pc_init_modules()) {
/* Dang, no ROMs found at all! */
MessageBox(hwnd,
win_language_get_string_from_id(IDS_2056),
win_language_get_string_from_id(IDS_2050),
win_get_string(IDS_2056),
win_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
return(6);
}
@@ -1198,6 +1263,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil)
/* Fire up the machine. */
pc_reset_hard();
/* Make sure the status bar is up-to-date. */
StatusBarUpdatePanes();
/*
@@ -1322,6 +1388,82 @@ delay_ms(uint32_t count)
}
/* We should have the language ID as a parameter. */
void
win_set_language(void)
{
SetThreadLocale(dwLanguage);
}
/* Update the global language used. This needs a parameter.. */
void
win_language_update(void)
{
win_set_language();
#if 0
MenuUpdate();
#endif
LoadCommonStrings();
}
void
win_language_check(void)
{
LCID dwLanguageNew = MAKELCID(dwLangID, dwSubLangID);
if (dwLanguageNew != dwLanguage) {
dwLanguage = dwLanguageNew;
win_language_update();
}
}
LPTSTR
win_get_string(int i)
{
LPTSTR str;
if ((i >= 2048) && (i <= 3071)) {
str = lpRCstr2048[i-2048].str;
} else if ((i >= 3072) && (i <= 4095)) {
str = lpRCstr3072[i-3072].str;
} else if ((i >= 4096) && (i <= 4351)) {
str = lpRCstr4096[i-4096].str;
} else if ((i >= 4352) && (i <= 4607)) {
str = lpRCstr4352[i-4352].str;
} else if ((i >= 4608) && (i <= 5119)) {
str = lpRCstr4608[i-4608].str;
} else if ((i >= 5120) && (i <= 5375)) {
str = lpRCstr5120[i-5120].str;
} else if ((i >= 5376) && (i <= 5631)) {
str = lpRCstr5376[i-5376].str;
} else if ((i >= 5632) && (i <= 6143)) {
str = lpRCstr5632[i-5632].str;
} else {
str = lpRCstr6144[i-6144].str;
}
return(str);
}
LPTSTR
win_get_string_from_string(char *str)
{
return(win_get_string(atoi(str)));
}
wchar_t *
plat_get_string(int i)
{
return((wchar_t *)win_get_string(i));
}
void
startblit(void)
{
@@ -1428,11 +1570,11 @@ updatewindowsize(int x, int y)
}
//void
//uws_natural(void)
//{
//updatewindowsize(unscaled_size_x, efwinsizey);
//}
void
uws_natural(void)
{
updatewindowsize(unscaled_size_x, efwinsizey);
}
void

View File

@@ -12,12 +12,15 @@
* Windows-specific header files needed, to keep them
* out of the main code.
*
* Version: @(#)win.h 1.0.3 2017/10/06
* Version: @(#)win.h 1.0.4 2017/10/07
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
*/
#ifndef BOX_WIN_H
# define BOX_WIN_H
@@ -57,6 +60,7 @@ extern HWND hwndMain;
extern HICON hIcon[512];
extern int status_is_open;
extern int mousecapture;
extern LCID dwLanguage;
extern char openfilestring[260];
extern WCHAR wopenfilestring[260];
@@ -68,7 +72,23 @@ extern int pause;
extern "C" {
#endif
extern HICON LoadIconEx(PCTSTR pszIconName);
extern BOOL DirectoryExists(LPCTSTR szPath);
extern void leave_fullscreen(void);
extern void get_executable_name(wchar_t *s, int size);
extern void set_window_title(wchar_t *s);
extern void win_language_set(void);
extern void win_language_update(void);
extern void win_language_check(void);
extern LPTSTR win_get_string(int i);
extern LPTSTR win_get_string_from_string(char *str);
extern void startblit(void);
extern void endblit(void);
#ifdef EMU_DEVICE_H
extern void deviceconfig_open(HWND hwnd, device_t *device);
@@ -78,12 +98,6 @@ extern void joystickconfig_open(HWND hwnd, int joy_nr, int type);
extern int getfile(HWND hwnd, char *f, char *fn);
extern int getsfile(HWND hwnd, char *f, char *fn);
extern void get_executable_name(wchar_t *s, int size);
extern void set_window_title(wchar_t *s);
extern void startblit(void);
extern void endblit(void);
extern void win_settings_open(HWND hwnd);
extern void hard_disk_add_open(HWND hwnd, int is_existing);
@@ -95,18 +109,17 @@ extern void process_raw_input(LPARAM lParam, int infocus);
extern void cdrom_init_host_drives(void);
extern void cdrom_close(uint8_t id);
extern HICON LoadIconEx(PCTSTR pszIconName);
extern BOOL DirectoryExists(LPCTSTR szPath);
/* About dialog definitions. */
/* Functions in win_about.c: */
extern void AboutDialogCreate(HWND hwnd);
/* Status Window definitions. */
/* Functions in win_status.c: */
extern HWND hwndStatus;
extern void StatusWindowCreate(HWND hwnd);
/* Status Bar definitions. */
/* Functions in win_stbar.c: */
#define SB_ICON_WIDTH 24
#define SB_FLOPPY 0x00
#define SB_CDROM 0x10
@@ -128,6 +141,27 @@ extern void StatusBarEnableMenuItem(int tag, int id, int val);
extern void StatusBarSetTextW(wchar_t *wstr);
extern void StatusBarSetText(char *str);
/* Functions in win_dialog.c: */
extern int msgbox_reset(HWND hwndParent);
extern int msgbox_reset_yn(HWND hwndParent);
extern int msgbox_question(HWND hwndParent, int i);
extern void msgbox_info(HWND hwndParent, int i);
extern void msgbox_info_wstr(HWND hwndParent, WCHAR *wstr);
extern void msgbox_error(HWND hwndParent, int i);
extern void msgbox_error_wstr(HWND hwndParent, WCHAR *wstr);
extern void msgbox_fatal(HWND hwndParent, char *string);
extern void msgbox_critical(HWND hwndParent, int i);
extern int file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save);
extern int file_dlg(HWND hwnd, WCHAR *f, char *fn, int save);
extern int file_dlg_mb(HWND hwnd, char *f, char *fn, int save);
extern int file_dlg_w_st(HWND hwnd, int i, WCHAR *fn, int save);
extern int file_dlg_st(HWND hwnd, int i, char *fn, int save);
extern wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title);
#ifdef __cplusplus
}
#endif

View File

@@ -8,7 +8,7 @@
*
* Handle the About dialog.
*
* Version: @(#)win_about.c 1.0.1 2017/10/06
* Version: @(#)win_about.c 1.0.1 2017/10/07
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -31,12 +31,6 @@
#include "../86box.h"
#include "../ibm.h"
#include "win.h"
#include "win_language.h"
#ifndef MAPVK_VK_TO_VSC
#define MAPVK_VK_TO_VSC 0
#endif
static BOOL CALLBACK

View File

@@ -8,7 +8,7 @@
*
* Handle the platform-side of CDROM drives.
*
* Version: @(#)win_cdrom.c 1.0.1 2017/10/06
* Version: @(#)win_cdrom.c 1.0.2 2017/10/07
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -37,7 +37,6 @@
#include "plat_ui.h"
#include "win.h"
#include "win_cdrom_ioctl.h"
#include "win_language.h"
uint8_t host_cdrom_drive_available[26];

View File

@@ -11,7 +11,6 @@
#include "win_ddraw.h"
#include "win_cgapal.h"
#include "win.h"
#include "win_language.h"
extern "C" void fatal(const char *format, ...);
@@ -107,7 +106,7 @@ SaveBitmap(wchar_t *szFilename, HBITMAP hBitmap)
if ((fp = _wfopen(szFilename, L"wb")) == NULL) {
_swprintf(szMessage,
win_language_get_string_from_id(IDS_2088), szFilename);
win_get_string(IDS_2088), szFilename);
msgbox_error_wstr(hwndMain, szMessage);
break;
}

View File

@@ -8,10 +8,11 @@
*
* Windows device configuration dialog implementation.
*
* Version: @(#)win_deviceconfig.c 1.0.4 2017/10/05
* Version: @(#)win_deviceconfig.c 1.0.4 2017/10/07
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
@@ -25,7 +26,6 @@
#include "plat_midi.h"
#define NO_UNICODE /*FIXME: not Unicode? */
#include "win.h"
#include "win_language.h"
#include <windowsx.h>

260
src/win/win_dialog.c Normal file
View File

@@ -0,0 +1,260 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Several dialogs for the application.
*
* Version: @(#)win_dialog.c 1.0.1 2017/10/07
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
*/
#define UNICODE
#define BITMAP WINDOWS_BITMAP
#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
#undef BITMAP
#include <commdlg.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../ibm.h"
#include "../device.h"
#include "plat_ui.h"
#include "win.h"
WCHAR path[MAX_PATH];
static int CALLBACK
BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
if (uMsg == BFFM_INITIALIZED)
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
return(0);
}
wchar_t *
BrowseFolder(wchar_t *saved_path, wchar_t *title)
{
BROWSEINFO bi = { 0 };
LPITEMIDLIST pidl;
IMalloc *imalloc;
bi.lpszTitle = title;
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;
bi.lpfn = BrowseCallbackProc;
bi.lParam = (LPARAM) saved_path;
pidl = SHBrowseForFolder(&bi);
if (pidl != 0) {
/* Get the name of the folder and put it in path. */
SHGetPathFromIDList(pidl, path);
/* Free memory used. */
imalloc = 0;
if (SUCCEEDED(SHGetMalloc(&imalloc))) {
imalloc->lpVtbl->Free(imalloc, pidl);
imalloc->lpVtbl->Release(imalloc);
}
return(path);
}
return(L"");
}
int
msgbox_reset(HWND hwnd)
{
return(MessageBox(hwnd, win_get_string(IDS_2051),
win_get_string(IDS_STRINGS),
MB_YESNOCANCEL | MB_ICONQUESTION));
}
int
msgbox_reset_yn(HWND hwnd)
{
return(MessageBox(hwnd, win_get_string(IDS_2051),
win_get_string(IDS_STRINGS),
MB_YESNO | MB_ICONQUESTION));
}
int
msgbox_question(HWND hwnd, int i)
{
return(MessageBox(hwnd, win_get_string(i),
win_get_string(IDS_STRINGS),
MB_YESNO | MB_ICONQUESTION));
}
void
msgbox_info(HWND hwnd, int i)
{
MessageBox(hwnd, win_get_string(i), win_get_string(IDS_STRINGS),
MB_OK | MB_ICONINFORMATION);
}
void
msgbox_info_wstr(HWND hwnd, WCHAR *wstr)
{
MessageBox(hwnd, wstr, win_get_string(IDS_STRINGS),
MB_OK | MB_ICONINFORMATION);
}
void
msgbox_error(HWND hwnd, int i)
{
MessageBox(hwnd, win_get_string(i), win_get_string(IDS_2049),
MB_OK | MB_ICONWARNING);
}
void
plat_msgbox_error(int i)
{
msgbox_error(hwndMain, i);
}
void
msgbox_error_wstr(HWND hwnd, WCHAR *wstr)
{
MessageBox(hwnd, wstr, win_get_string(IDS_2049), MB_OK | MB_ICONWARNING);
}
void
msgbox_critical(HWND hwnd, int i)
{
MessageBox(hwnd, win_get_string(i), win_get_string(IDS_2050),
MB_OK | MB_ICONERROR);
}
void
msgbox_fatal(HWND hwnd, char *string)
{
LPTSTR temp;
temp = (LPTSTR)malloc(512);
mbstowcs(temp, string, strlen(string)+1);
MessageBox(hwnd, temp, win_get_string(IDS_2050), MB_OK | MB_ICONERROR);
free(temp);
}
void
plat_msgbox_fatal(char *string)
{
msgbox_fatal(hwndMain, string);
}
int
file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save)
{
OPENFILENAME ofn;
BOOL r;
DWORD err;
/* Initialize OPENFILENAME */
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = wopenfilestring;
/*
* Set lpstrFile[0] to '\0' so that GetOpenFileName does
* not use the contents of szFile to initialize itself.
*/
memcpy(ofn.lpstrFile, fn, (wcslen(fn) << 1) + 2);
ofn.nMaxFile = 259;
ofn.lpstrFilter = f;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST;
if (! save)
ofn.Flags |= OFN_FILEMUSTEXIST;
/* Display the Open dialog box. */
if (save) {
// pclog("GetSaveFileName - lpstrFile = %s\n", ofn.lpstrFile);
r = GetSaveFileName(&ofn);
} else {
// pclog("GetOpenFileName - lpstrFile = %s\n", ofn.lpstrFile);
r = GetOpenFileName(&ofn);
}
if (r) {
wcstombs(openfilestring, wopenfilestring, sizeof(openfilestring));
// pclog("File dialog return true\n");
return(0);
}
pclog("File dialog return false\n");
err = CommDlgExtendedError();
pclog("CommDlgExtendedError return %04X\n", err);
return(1);
}
int
file_dlg(HWND hwnd, WCHAR *f, char *fn, int save)
{
WCHAR ufn[512];
mbstowcs(ufn, fn, strlen(fn) + 1);
return(file_dlg_w(hwnd, f, ufn, save));
}
int
file_dlg_mb(HWND hwnd, char *f, char *fn, int save)
{
WCHAR uf[512], ufn[512];
mbstowcs(uf, f, strlen(fn) + 1);
mbstowcs(ufn, fn, strlen(fn) + 1);
return(file_dlg_w(hwnd, uf, ufn, save));
}
int
file_dlg_w_st(HWND hwnd, int id, WCHAR *fn, int save)
{
return(file_dlg_w(hwnd, win_get_string(id), fn, save));
}
int
file_dlg_st(HWND hwnd, int id, char *fn, int save)
{
return(file_dlg(hwnd, win_get_string(id), fn, save));
}

View File

@@ -1,376 +0,0 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Windows localization core.
*
* Version: @(#)win_language.c 1.0.3 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
*/
#define UNICODE
#define BITMAP WINDOWS_BITMAP
#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
#undef BITMAP
#include <commdlg.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include "../ibm.h"
#include "../device.h"
#include "plat_ui.h"
#include "win.h"
#include "win_language.h"
LCID dwLanguage;
uint32_t dwLangID, dwSubLangID;
typedef struct
{
WCHAR lpString[512];
} resource_string_t;
resource_string_t *lpResourceString2048;
resource_string_t *lpResourceString3072;
resource_string_t *lpResourceString4096;
resource_string_t *lpResourceString4352;
resource_string_t *lpResourceString4608;
resource_string_t *lpResourceString5120;
resource_string_t *lpResourceString5376;
resource_string_t *lpResourceString5632;
resource_string_t *lpResourceString6144;
char openfilestring[260];
WCHAR wopenfilestring[260];
void win_language_set()
{
SetThreadLocale(dwLanguage);
}
void win_language_load_common_strings()
{
int i = 0;
lpResourceString2048 = (resource_string_t *) malloc(STRINGS_NUM_2048 * sizeof(resource_string_t));
lpResourceString3072 = (resource_string_t *) malloc(STRINGS_NUM_3072 * sizeof(resource_string_t));
lpResourceString4096 = (resource_string_t *) malloc(STRINGS_NUM_4096 * sizeof(resource_string_t));
lpResourceString4352 = (resource_string_t *) malloc(STRINGS_NUM_4352 * sizeof(resource_string_t));
lpResourceString4608 = (resource_string_t *) malloc(STRINGS_NUM_4608 * sizeof(resource_string_t));
lpResourceString5120 = (resource_string_t *) malloc(STRINGS_NUM_5120 * sizeof(resource_string_t));
lpResourceString5376 = (resource_string_t *) malloc(STRINGS_NUM_5376 * sizeof(resource_string_t));
lpResourceString5632 = (resource_string_t *) malloc(STRINGS_NUM_5632 * sizeof(resource_string_t));
lpResourceString6144 = (resource_string_t *) malloc(STRINGS_NUM_6144 * sizeof(resource_string_t));
for (i = 0; i < STRINGS_NUM_2048; i++)
{
LoadString(hinstance, 2048 + i, lpResourceString2048[i].lpString, 512);
}
for (i = 0; i < STRINGS_NUM_3072; i++)
{
LoadString(hinstance, 3072 + i, lpResourceString3072[i].lpString, 512);
}
for (i = 0; i < STRINGS_NUM_4096; i++)
{
LoadString(hinstance, 4096 + i, lpResourceString4096[i].lpString, 512);
}
for (i = 0; i < STRINGS_NUM_4352; i++)
{
LoadString(hinstance, 4352 + i, lpResourceString4352[i].lpString, 512);
}
for (i = 0; i < STRINGS_NUM_4608; i++)
{
LoadString(hinstance, 4608 + i, lpResourceString4608[i].lpString, 512);
}
for (i = 0; i < STRINGS_NUM_5120; i++)
{
LoadString(hinstance, 5120 + i, lpResourceString5120[i].lpString, 512);
}
for (i = 0; i < STRINGS_NUM_5376; i++)
{
LoadString(hinstance, 5376 + i, lpResourceString5376[i].lpString, 512);
}
for (i = 0; i < STRINGS_NUM_5632; i++)
{
LoadString(hinstance, 5632 + i, lpResourceString5632[i].lpString, 512);
}
for (i = 0; i < STRINGS_NUM_6144; i++)
{
LoadString(hinstance, 6144 + i, lpResourceString6144[i].lpString, 512);
}
}
LPTSTR win_language_get_settings_category(int i)
{
return lpResourceString2048[17 + i].lpString;
}
void win_language_update()
{
win_language_set();
#if 0
win_menu_update();
#endif
win_language_load_common_strings();
}
void win_language_check()
{
LCID dwLanguageNew = MAKELCID(dwLangID, dwSubLangID);
if (dwLanguageNew != dwLanguage)
{
dwLanguage = dwLanguageNew;
win_language_update();
}
}
LPTSTR win_language_get_string_from_id(int i)
{
if ((i >= 2048) && (i <= 3071))
{
return lpResourceString2048[i - 2048].lpString;
}
else if ((i >= 3072) && (i <= 4095))
{
return lpResourceString3072[i - 3072].lpString;
}
else if ((i >= 4096) && (i <= 4351))
{
return lpResourceString4096[i - 4096].lpString;
}
else if ((i >= 4352) && (i <= 4607))
{
return lpResourceString4352[i - 4352].lpString;
}
else if ((i >= 4608) && (i <= 5119))
{
return lpResourceString4608[i - 4608].lpString;
}
else if ((i >= 5120) && (i <= 5375))
{
return lpResourceString5120[i - 5120].lpString;
}
else if ((i >= 5376) && (i <= 5631))
{
return lpResourceString5376[i - 5376].lpString;
}
else if ((i >= 5632) && (i <= 6143))
{
return lpResourceString5632[i - 5632].lpString;
}
else
{
return lpResourceString6144[i - 6144].lpString;
}
}
wchar_t *plat_get_string_from_id(int i)
{
return (wchar_t *) win_language_get_string_from_id(i);
}
LPTSTR win_language_get_string_from_string(char *str)
{
return win_language_get_string_from_id(atoi(str));
}
int msgbox_reset(HWND hwndParent)
{
return MessageBox(hwndParent, lpResourceString2048[3].lpString, lpResourceString2048[0].lpString, MB_YESNOCANCEL | MB_ICONQUESTION);
}
int msgbox_reset_yn(HWND hwndParent)
{
return MessageBox(hwndParent, lpResourceString2048[3].lpString, lpResourceString2048[0].lpString, MB_YESNO | MB_ICONQUESTION);
}
int msgbox_question(HWND hwndParent, int i)
{
return MessageBox(hwndParent, win_language_get_string_from_id(i), lpResourceString2048[0].lpString, MB_YESNO | MB_ICONQUESTION);
}
void msgbox_info(HWND hwndParent, int i)
{
MessageBox(hwndParent, win_language_get_string_from_id(i), lpResourceString2048[0].lpString, MB_OK | MB_ICONINFORMATION);
}
void msgbox_info_wstr(HWND hwndParent, WCHAR *wstr)
{
MessageBox(hwndParent, wstr, lpResourceString2048[0].lpString, MB_OK | MB_ICONINFORMATION);
}
void msgbox_error(HWND hwndParent, int i)
{
MessageBox(hwndParent, win_language_get_string_from_id(i), lpResourceString2048[1].lpString, MB_OK | MB_ICONWARNING);
}
void plat_msgbox_error(int i)
{
msgbox_error(hwndMain, i);
}
void msgbox_error_wstr(HWND hwndParent, WCHAR *wstr)
{
MessageBox(hwndParent, wstr, lpResourceString2048[1].lpString, MB_OK | MB_ICONWARNING);
}
void msgbox_critical(HWND hwndParent, int i)
{
MessageBox(hwndParent, win_language_get_string_from_id(i), lpResourceString2048[2].lpString, MB_OK | MB_ICONERROR);
}
void msgbox_fatal(HWND hwndParent, char *string)
{
LPTSTR lptsTemp;
lptsTemp = (LPTSTR) malloc(512);
mbstowcs(lptsTemp, string, strlen(string) + 1);
MessageBox(hwndParent, lptsTemp, lpResourceString2048[2].lpString, MB_OK | MB_ICONERROR);
free(lptsTemp);
}
void plat_msgbox_fatal(char *string)
{
msgbox_fatal(hwndMain, string);
}
int file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save)
{
OPENFILENAME ofn; /* common dialog box structure */
BOOL r;
DWORD err;
/* Initialize OPENFILENAME */
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = wopenfilestring;
/*
Set lpstrFile[0] to '\0' so that GetOpenFileName does not
use the contents of szFile to initialize itself.
*/
memcpy(ofn.lpstrFile, fn, (wcslen(fn) << 1) + 2);
ofn.nMaxFile = 259;
ofn.lpstrFilter = f;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST;
if (!save)
{
ofn.Flags |= OFN_FILEMUSTEXIST;
}
/* Display the Open dialog box. */
if (save)
{
pclog("GetSaveFileName - lpstrFile = %s\n", ofn.lpstrFile);
r = GetSaveFileName(&ofn);
}
else
{
pclog("GetOpenFileName - lpstrFile = %s\n", ofn.lpstrFile);
r = GetOpenFileName(&ofn);
}
if (r)
{
wcstombs(openfilestring, wopenfilestring, sizeof(openfilestring));
pclog("File dialog return true\n");
return 0;
}
pclog("File dialog return false\n");
err = CommDlgExtendedError();
pclog("CommDlgExtendedError return %04X\n", err);
return 1;
}
int file_dlg(HWND hwnd, WCHAR *f, char *fn, int save)
{
WCHAR ufn[512];
mbstowcs(ufn, fn, strlen(fn) + 1);
return file_dlg_w(hwnd, f, ufn, save);
}
int file_dlg_mb(HWND hwnd, char *f, char *fn, int save)
{
WCHAR uf[512];
WCHAR ufn[512];
mbstowcs(uf, f, strlen(fn) + 1);
mbstowcs(ufn, fn, strlen(fn) + 1);
return file_dlg_w(hwnd, uf, ufn, save);
}
int file_dlg_w_st(HWND hwnd, int i, WCHAR *fn, int save)
{
return file_dlg_w(hwnd, win_language_get_string_from_id(i), fn, save);
}
int file_dlg_st(HWND hwnd, int i, char *fn, int save)
{
return file_dlg(hwnd, win_language_get_string_from_id(i), fn, save);
}
static int CALLBACK BrowseCallbackProc(HWND hwnd,UINT uMsg, LPARAM lParam, LPARAM lpData)
{
if(uMsg == BFFM_INITIALIZED)
{
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
}
return 0;
}
WCHAR path[MAX_PATH];
wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title)
{
BROWSEINFO bi = { 0 };
bi.lpszTitle = title;
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;
bi.lpfn = BrowseCallbackProc;
bi.lParam = (LPARAM) saved_path;
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
if (pidl != 0)
{
/* Get the name of the folder and put it in path. */
SHGetPathFromIDList(pidl, path);
/* Free memory used. */
IMalloc *imalloc = 0;
if (SUCCEEDED(SHGetMalloc(&imalloc)))
{
imalloc->lpVtbl->Free(imalloc, pidl);
imalloc->lpVtbl->Release(imalloc);
}
return path;
}
return L"";
}

View File

@@ -1,54 +0,0 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Windows localization core.
*
* Version: @(#)win_language.h 1.0.0 2017/05/30
*
* Author: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
*/
#ifdef __cplusplus
extern "C" {
#endif
LCID dwLanguage;
int msgbox_reset(HWND hwndParent);
int msgbox_reset_yn(HWND hwndParent);
int msgbox_question(HWND hwndParent, int i);
void msgbox_info(HWND hwndParent, int i);
void msgbox_info_wstr(HWND hwndParent, WCHAR *wstr);
void msgbox_error(HWND hwndParent, int i);
void msgbox_error_wstr(HWND hwndParent, WCHAR *wstr);
void msgbox_fatal(HWND hwndParent, char *string);
void msgbox_critical(HWND hwndParent, int i);
int file_dlg_w(HWND hwnd, WCHAR *f, WCHAR *fn, int save);
int file_dlg(HWND hwnd, WCHAR *f, char *fn, int save);
int file_dlg_mb(HWND hwnd, char *f, char *fn, int save);
int file_dlg_w_st(HWND hwnd, int i, WCHAR *fn, int save);
int file_dlg_st(HWND hwnd, int i, char *fn, int save);
void win_language_load_common_strings();
LPTSTR win_language_get_settings_category(int i);
void win_language_update();
void win_language_check();
LPTSTR win_language_get_string_from_id(int i);
LPTSTR win_language_get_string_from_string(char *str);
wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title);
#ifdef __cplusplus
}
#endif

View File

@@ -8,9 +8,10 @@
*
* Windows 86Box Settings dialog handler.
*
* Version: @(#)win_settings.c 1.0.18 2017/10/05
* Version: @(#)win_settings.c 1.0.18 2017/10/07
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2016,2017 Miran Grca.
*/
#define UNICODE
@@ -51,7 +52,6 @@
#include "../video/vid_voodoo.h"
#include "plat_midi.h"
#include "win.h"
#include "win_language.h"
/* Machine category */
@@ -522,13 +522,13 @@ static void win_settings_machine_recalc_machine(HWND hdlg)
{
SendMessage(h, UDM_SETPOS, 0, temp_mem_size);
h = GetDlgItem(hdlg, IDC_TEXT_MB);
SendMessage(h, WM_SETTEXT, 0, (LPARAM) win_language_get_string_from_id(IDS_2094));
SendMessage(h, WM_SETTEXT, 0, (LPARAM) win_get_string(IDS_2094));
}
else
{
SendMessage(h, UDM_SETPOS, 0, temp_mem_size / 1024);
h = GetDlgItem(hdlg, IDC_TEXT_MB);
SendMessage(h, WM_SETTEXT, 0, (LPARAM) win_language_get_string_from_id(IDS_2087));
SendMessage(h, WM_SETTEXT, 0, (LPARAM) win_get_string(IDS_2087));
}
free(lptsTemp);
@@ -572,11 +572,11 @@ static BOOL CALLBACK win_settings_machine_proc(HWND hdlg, UINT message, WPARAM w
SendMessage(h, CB_SETCURSEL, machinetolist[temp_machine], 0);
h = GetDlgItem(hdlg, IDC_COMBO_WS);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2131));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_get_string(IDS_2131));
for (c = 0; c < 8; c++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(2132), c);
wsprintf(lptsTemp, win_get_string(2132), c);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
@@ -745,12 +745,12 @@ static BOOL CALLBACK win_settings_video_proc(HWND hdlg, UINT message, WPARAM wPa
recalc_vid_list(hdlg);
h = GetDlgItem(hdlg, IDC_COMBO_VIDEO_SPEED);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2133));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2134));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2135));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2136));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2137));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2138));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_2133));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_2134));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_2135));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_2136));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_2137));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_2138));
SendMessage(h, CB_SETCURSEL, temp_video_speed, 0);
h=GetDlgItem(hdlg, IDC_CHECK_VOODOO);
@@ -895,7 +895,7 @@ static BOOL CALLBACK win_settings_input_proc(HWND hdlg, UINT message, WPARAM wPa
{
str_id = IDS_3072 + c;
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(str_id));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(str_id));
settings_list_to_mouse[d] = c;
d++;
@@ -908,7 +908,7 @@ static BOOL CALLBACK win_settings_input_proc(HWND hdlg, UINT message, WPARAM wPa
c = 0;
while (joystick_get_name(c))
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(2144 + c));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(2144 + c));
c++;
}
EnableWindow(h, TRUE);
@@ -1061,7 +1061,7 @@ static BOOL CALLBACK win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wPa
{
if (c == 0)
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2152));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_get_string(IDS_2152));
}
else
{
@@ -1108,7 +1108,7 @@ static BOOL CALLBACK win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wPa
{
if (c == 0)
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2152));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_get_string(IDS_2152));
}
else
{
@@ -1293,7 +1293,7 @@ static BOOL CALLBACK win_settings_ports_proc(HWND hdlg, UINT message, WPARAM wPa
if (c == 0)
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2152));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_get_string(IDS_2152));
}
else
{
@@ -1504,7 +1504,7 @@ static BOOL CALLBACK win_settings_peripherals_proc(HWND hdlg, UINT message, WPAR
{
if (c == 0)
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2152));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_get_string(IDS_2152));
}
else
{
@@ -1533,11 +1533,11 @@ static BOOL CALLBACK win_settings_peripherals_proc(HWND hdlg, UINT message, WPAR
recalc_hdc_list(hdlg, temp_machine, 0);
h=GetDlgItem(hdlg, IDC_COMBO_IDE_TER);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_5376));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_5376));
for (c = 0; c < 11; c++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(IDS_2155), valid_ide_irqs[c]);
wsprintf(lptsTemp, win_get_string(IDS_2155), valid_ide_irqs[c]);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
@@ -1551,11 +1551,11 @@ static BOOL CALLBACK win_settings_peripherals_proc(HWND hdlg, UINT message, WPAR
}
h=GetDlgItem(hdlg, IDC_COMBO_IDE_QUA);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_5376));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_5376));
for (c = 0; c < 11; c++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(IDS_2155), valid_ide_irqs[c]);
wsprintf(lptsTemp, win_get_string(IDS_2155), valid_ide_irqs[c]);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
@@ -1751,7 +1751,7 @@ static BOOL CALLBACK win_settings_network_proc(HWND hdlg, UINT message, WPARAM w
{
if (c == 0)
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(2152));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_get_string(2152));
}
else
{
@@ -1929,34 +1929,34 @@ static void add_locations(HWND hdlg)
h = GetDlgItem(hdlg, IDC_COMBO_HD_BUS);
for (i = 0; i < 7; i++)
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_4352 + i));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_4352 + i));
}
h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL);
for (i = 0; i < 8; i++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(IDS_4097), i >> 1, i & 1);
wsprintf(lptsTemp, win_get_string(IDS_4097), i >> 1, i & 1);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
h = GetDlgItem(hdlg, IDC_COMBO_HD_ID);
for (i = 0; i < 16; i++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(IDS_4098), i);
wsprintf(lptsTemp, win_get_string(IDS_4098), i);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
h = GetDlgItem(hdlg, IDC_COMBO_HD_LUN);
for (i = 0; i < 8; i++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(IDS_4098), i);
wsprintf(lptsTemp, win_get_string(IDS_4098), i);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL_IDE);
for (i = 0; i < 8; i++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(IDS_4097), i >> 1, i & 1);
wsprintf(lptsTemp, win_get_string(IDS_4097), i >> 1, i & 1);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
@@ -2198,25 +2198,25 @@ static void win_settings_hard_disks_update_item(HWND hwndList, int i, int column
switch(temp_hdd[i].bus)
{
case HDD_BUS_MFM:
wsprintf(szText, win_language_get_string_from_id(IDS_4608), temp_hdd[i].mfm_channel >> 1, temp_hdd[i].mfm_channel & 1);
wsprintf(szText, win_get_string(IDS_4608), temp_hdd[i].mfm_channel >> 1, temp_hdd[i].mfm_channel & 1);
break;
case HDD_BUS_XTIDE:
wsprintf(szText, win_language_get_string_from_id(IDS_4609), temp_hdd[i].xtide_channel >> 1, temp_hdd[i].xtide_channel & 1);
wsprintf(szText, win_get_string(IDS_4609), temp_hdd[i].xtide_channel >> 1, temp_hdd[i].xtide_channel & 1);
break;
case HDD_BUS_ESDI:
wsprintf(szText, win_language_get_string_from_id(IDS_4610), temp_hdd[i].esdi_channel >> 1, temp_hdd[i].esdi_channel & 1);
wsprintf(szText, win_get_string(IDS_4610), temp_hdd[i].esdi_channel >> 1, temp_hdd[i].esdi_channel & 1);
break;
case HDD_BUS_IDE_PIO_ONLY:
wsprintf(szText, win_language_get_string_from_id(IDS_4611), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
wsprintf(szText, win_get_string(IDS_4611), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
break;
case HDD_BUS_IDE_PIO_AND_DMA:
wsprintf(szText, win_language_get_string_from_id(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
wsprintf(szText, win_get_string(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
break;
case HDD_BUS_SCSI:
wsprintf(szText, win_language_get_string_from_id(IDS_4613), temp_hdd[i].scsi_id, temp_hdd[i].scsi_lun);
wsprintf(szText, win_get_string(IDS_4613), temp_hdd[i].scsi_id, temp_hdd[i].scsi_lun);
break;
case HDD_BUS_SCSI_REMOVABLE:
wsprintf(szText, win_language_get_string_from_id(IDS_4614), temp_hdd[i].scsi_id, temp_hdd[i].scsi_lun);
wsprintf(szText, win_get_string(IDS_4614), temp_hdd[i].scsi_id, temp_hdd[i].scsi_lun);
break;
}
lvI.pszText = szText;
@@ -2229,25 +2229,25 @@ static void win_settings_hard_disks_update_item(HWND hwndList, int i, int column
}
else if (column == 2)
{
wsprintf(szText, win_language_get_string_from_id(IDS_4098), temp_hdd[i].tracks);
wsprintf(szText, win_get_string(IDS_4098), temp_hdd[i].tracks);
lvI.pszText = szText;
lvI.iImage = 0;
}
else if (column == 3)
{
wsprintf(szText, win_language_get_string_from_id(IDS_4098), temp_hdd[i].hpc);
wsprintf(szText, win_get_string(IDS_4098), temp_hdd[i].hpc);
lvI.pszText = szText;
lvI.iImage = 0;
}
else if (column == 4)
{
wsprintf(szText, win_language_get_string_from_id(IDS_4098), temp_hdd[i].spt);
wsprintf(szText, win_get_string(IDS_4098), temp_hdd[i].spt);
lvI.pszText = szText;
lvI.iImage = 0;
}
else if (column == 5)
{
wsprintf(szText, win_language_get_string_from_id(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11);
wsprintf(szText, win_get_string(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11);
lvI.pszText = szText;
lvI.iImage = 0;
}
@@ -2282,25 +2282,25 @@ static BOOL win_settings_hard_disks_recalc_list(HWND hwndList)
switch(temp_hdd[i].bus)
{
case HDD_BUS_MFM:
wsprintf(szText, win_language_get_string_from_id(IDS_4608), temp_hdd[i].mfm_channel >> 1, temp_hdd[i].mfm_channel & 1);
wsprintf(szText, win_get_string(IDS_4608), temp_hdd[i].mfm_channel >> 1, temp_hdd[i].mfm_channel & 1);
break;
case HDD_BUS_XTIDE:
wsprintf(szText, win_language_get_string_from_id(IDS_4609), temp_hdd[i].xtide_channel >> 1, temp_hdd[i].xtide_channel & 1);
wsprintf(szText, win_get_string(IDS_4609), temp_hdd[i].xtide_channel >> 1, temp_hdd[i].xtide_channel & 1);
break;
case HDD_BUS_ESDI:
wsprintf(szText, win_language_get_string_from_id(IDS_4610), temp_hdd[i].esdi_channel >> 1, temp_hdd[i].esdi_channel & 1);
wsprintf(szText, win_get_string(IDS_4610), temp_hdd[i].esdi_channel >> 1, temp_hdd[i].esdi_channel & 1);
break;
case HDD_BUS_IDE_PIO_ONLY:
wsprintf(szText, win_language_get_string_from_id(IDS_4611), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
wsprintf(szText, win_get_string(IDS_4611), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
break;
case HDD_BUS_IDE_PIO_AND_DMA:
wsprintf(szText, win_language_get_string_from_id(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
wsprintf(szText, win_get_string(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
break;
case HDD_BUS_SCSI:
wsprintf(szText, win_language_get_string_from_id(IDS_4613), temp_hdd[i].scsi_id, temp_hdd[i].scsi_lun);
wsprintf(szText, win_get_string(IDS_4613), temp_hdd[i].scsi_id, temp_hdd[i].scsi_lun);
break;
case HDD_BUS_SCSI_REMOVABLE:
wsprintf(szText, win_language_get_string_from_id(IDS_4614), temp_hdd[i].scsi_id, temp_hdd[i].scsi_lun);
wsprintf(szText, win_get_string(IDS_4614), temp_hdd[i].scsi_id, temp_hdd[i].scsi_lun);
break;
}
lvI.pszText = szText;
@@ -2323,7 +2323,7 @@ static BOOL win_settings_hard_disks_recalc_list(HWND hwndList)
}
lvI.iSubItem = 2;
wsprintf(szText, win_language_get_string_from_id(IDS_4098), temp_hdd[i].tracks);
wsprintf(szText, win_get_string(IDS_4098), temp_hdd[i].tracks);
lvI.pszText = szText;
lvI.iItem = j;
lvI.iImage = 0;
@@ -2334,7 +2334,7 @@ static BOOL win_settings_hard_disks_recalc_list(HWND hwndList)
}
lvI.iSubItem = 3;
wsprintf(szText, win_language_get_string_from_id(IDS_4098), temp_hdd[i].hpc);
wsprintf(szText, win_get_string(IDS_4098), temp_hdd[i].hpc);
lvI.pszText = szText;
lvI.iItem = j;
lvI.iImage = 0;
@@ -2345,7 +2345,7 @@ static BOOL win_settings_hard_disks_recalc_list(HWND hwndList)
}
lvI.iSubItem = 4;
wsprintf(szText, win_language_get_string_from_id(IDS_4098), temp_hdd[i].spt);
wsprintf(szText, win_get_string(IDS_4098), temp_hdd[i].spt);
lvI.pszText = szText;
lvI.iItem = j;
lvI.iImage = 0;
@@ -2356,7 +2356,7 @@ static BOOL win_settings_hard_disks_recalc_list(HWND hwndList)
}
lvI.iSubItem = 5;
wsprintf(szText, win_language_get_string_from_id(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11);
wsprintf(szText, win_get_string(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11);
lvI.pszText = szText;
lvI.iItem = j;
lvI.iImage = 0;
@@ -2392,7 +2392,7 @@ static BOOL win_settings_hard_disks_init_columns(HWND hwndList)
for (iCol = 0; iCol < C_COLUMNS_HARD_DISKS; iCol++)
{
lvc.iSubItem = iCol;
lvc.pszText = win_language_get_string_from_id(2082 + iCol);
lvc.pszText = win_get_string(2082 + iCol);
switch(iCol)
{
@@ -2455,7 +2455,7 @@ static void set_edit_box_contents(HWND hdlg, int id, uint64_t val)
WCHAR szText[256];
h = GetDlgItem(hdlg, id);
wsprintf(szText, win_language_get_string_from_id(IDS_2156), val);
wsprintf(szText, win_get_string(IDS_2156), val);
SendMessage(h, WM_SETTEXT, (WPARAM) wcslen(szText), (LPARAM) szText);
}
@@ -2489,15 +2489,15 @@ static int hdconf_initialize_hdt_combo(HWND hdlg)
{
temp_size = hdd_table[i][0] * hdd_table[i][1] * hdd_table[i][2];
size_mb = temp_size >> 11;
wsprintf(szText, win_language_get_string_from_id(IDS_2157), size_mb, hdd_table[i][0], hdd_table[i][1], hdd_table[i][2]);
wsprintf(szText, win_get_string(IDS_2157), size_mb, hdd_table[i][0], hdd_table[i][1], hdd_table[i][2]);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) szText);
if ((tracks == hdd_table[i][0]) && (hpc == hdd_table[i][1]) && (spt == hdd_table[i][2]))
{
selection = i;
}
}
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_4100));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_4101));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_4100));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_4101));
SendMessage(h, CB_SETCURSEL, selection, 0);
return selection;
}
@@ -2555,7 +2555,7 @@ static BOOL CALLBACK win_settings_hard_disks_add_proc(HWND hdlg, UINT message, W
hdd_ptr = &(temp_hdd[next_free_id]);
}
SetWindowText(hdlg, win_language_get_string_from_id((existing & 1) ? IDS_4103 : IDS_4102));
SetWindowText(hdlg, win_get_string((existing & 1) ? IDS_4103 : IDS_4102));
no_update = 1;
spt = (existing & 1) ? 0 : 17;
@@ -2809,7 +2809,7 @@ hd_add_ok_common:
return TRUE;
case IDC_CFILE:
if (!file_dlg_w(hdlg, win_language_get_string_from_id(IDS_4106), L"", !(existing & 1)))
if (!file_dlg_w(hdlg, win_get_string(IDS_4106), L"", !(existing & 1)))
{
if (!(existing & 1))
{
@@ -3545,7 +3545,7 @@ static BOOL win_settings_floppy_drives_recalc_list(HWND hwndList)
}
else
{
lvI.pszText = win_language_get_string_from_id(IDS_5376);
lvI.pszText = win_get_string(IDS_5376);
}
lvI.iItem = i;
lvI.iImage = temp_fdd_types[i];
@@ -3554,7 +3554,7 @@ static BOOL win_settings_floppy_drives_recalc_list(HWND hwndList)
return FALSE;
lvI.iSubItem = 1;
lvI.pszText = win_language_get_string_from_id(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061);
lvI.pszText = win_get_string(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061);
lvI.iItem = i;
lvI.iImage = 0;
@@ -3564,7 +3564,7 @@ static BOOL win_settings_floppy_drives_recalc_list(HWND hwndList)
}
lvI.iSubItem = 2;
lvI.pszText = win_language_get_string_from_id(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061);
lvI.pszText = win_get_string(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061);
lvI.iItem = i;
lvI.iImage = 0;
@@ -3595,21 +3595,21 @@ static BOOL win_settings_cdrom_drives_recalc_list(HWND hwndList)
{
case CDROM_BUS_DISABLED:
default:
lvI.pszText = win_language_get_string_from_id(fsid);
lvI.pszText = win_get_string(fsid);
lvI.iImage = 0;
break;
case CDROM_BUS_ATAPI_PIO_ONLY:
wsprintf(szText, win_language_get_string_from_id(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1);
wsprintf(szText, win_get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1);
lvI.pszText = szText;
lvI.iImage = 1;
break;
case CDROM_BUS_ATAPI_PIO_AND_DMA:
wsprintf(szText, win_language_get_string_from_id(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1);
wsprintf(szText, win_get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1);
lvI.pszText = szText;
lvI.iImage = 1;
break;
case CDROM_BUS_SCSI:
wsprintf(szText, win_language_get_string_from_id(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun);
wsprintf(szText, win_get_string(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun);
lvI.pszText = szText;
lvI.iImage = 1;
break;
@@ -3631,7 +3631,7 @@ static BOOL win_settings_floppy_drives_init_columns(HWND hwndList)
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.iSubItem = 0;
lvc.pszText = win_language_get_string_from_id(IDS_2143);
lvc.pszText = win_get_string(IDS_2143);
lvc.cx = 292;
lvc.fmt = LVCFMT_LEFT;
@@ -3642,7 +3642,7 @@ static BOOL win_settings_floppy_drives_init_columns(HWND hwndList)
}
lvc.iSubItem = 1;
lvc.pszText = win_language_get_string_from_id(IDS_2059);
lvc.pszText = win_get_string(IDS_2059);
lvc.cx = 50;
lvc.fmt = LVCFMT_LEFT;
@@ -3653,7 +3653,7 @@ static BOOL win_settings_floppy_drives_init_columns(HWND hwndList)
}
lvc.iSubItem = 2;
lvc.pszText = win_language_get_string_from_id(IDS_2170);
lvc.pszText = win_get_string(IDS_2170);
lvc.cx = 75;
lvc.fmt = LVCFMT_LEFT;
@@ -3672,7 +3672,7 @@ static BOOL win_settings_cdrom_drives_init_columns(HWND hwndList)
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.iSubItem = 0;
lvc.pszText = win_language_get_string_from_id(2082);
lvc.pszText = win_get_string(IDS_2082);
lvc.cx = 392;
lvc.fmt = LVCFMT_LEFT;
@@ -3743,7 +3743,7 @@ static void win_settings_floppy_drives_update_item(HWND hwndList, int i)
}
else
{
lvI.pszText = win_language_get_string_from_id(IDS_5376);
lvI.pszText = win_get_string(IDS_5376);
}
lvI.iImage = temp_fdd_types[i];
@@ -3753,7 +3753,7 @@ static void win_settings_floppy_drives_update_item(HWND hwndList, int i)
}
lvI.iSubItem = 1;
lvI.pszText = win_language_get_string_from_id(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061);
lvI.pszText = win_get_string(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061);
lvI.iItem = i;
lvI.iImage = 0;
@@ -3763,7 +3763,7 @@ static void win_settings_floppy_drives_update_item(HWND hwndList, int i)
}
lvI.iSubItem = 2;
lvI.pszText = win_language_get_string_from_id(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061);
lvI.pszText = win_get_string(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061);
lvI.iItem = i;
lvI.iImage = 0;
@@ -3791,21 +3791,21 @@ static void win_settings_cdrom_drives_update_item(HWND hwndList, int i)
{
case CDROM_BUS_DISABLED:
default:
lvI.pszText = win_language_get_string_from_id(fsid);
lvI.pszText = win_get_string(fsid);
lvI.iImage = 0;
break;
case CDROM_BUS_ATAPI_PIO_ONLY:
wsprintf(szText, win_language_get_string_from_id(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1);
wsprintf(szText, win_get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1);
lvI.pszText = szText;
lvI.iImage = 1;
break;
case CDROM_BUS_ATAPI_PIO_AND_DMA:
wsprintf(szText, win_language_get_string_from_id(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1);
wsprintf(szText, win_get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1);
lvI.pszText = szText;
lvI.iImage = 1;
break;
case CDROM_BUS_SCSI:
wsprintf(szText, win_language_get_string_from_id(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun);
wsprintf(szText, win_get_string(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun);
lvI.pszText = szText;
lvI.iImage = 1;
break;
@@ -3830,28 +3830,28 @@ static void cdrom_add_locations(HWND hdlg)
{
if ((i == CDROM_BUS_DISABLED) || (i >= CDROM_BUS_ATAPI_PIO_ONLY))
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(combo_id_to_string_id(i)));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(combo_id_to_string_id(i)));
}
}
h = GetDlgItem(hdlg, IDC_COMBO_CD_ID);
for (i = 0; i < 16; i++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(IDS_4098), i);
wsprintf(lptsTemp, win_get_string(IDS_4098), i);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
h = GetDlgItem(hdlg, IDC_COMBO_CD_LUN);
for (i = 0; i < 8; i++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(IDS_4098), i);
wsprintf(lptsTemp, win_get_string(IDS_4098), i);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE);
for (i = 0; i < 8; i++)
{
wsprintf(lptsTemp, win_language_get_string_from_id(IDS_4097), i >> 1, i & 1);
wsprintf(lptsTemp, win_get_string(IDS_4097), i >> 1, i & 1);
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp);
}
@@ -3945,7 +3945,7 @@ static BOOL CALLBACK win_settings_removable_devices_proc(HWND hdlg, UINT message
{
if (i == 0)
{
SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_5376));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)win_get_string(IDS_5376));
}
else
{
@@ -4296,7 +4296,7 @@ static BOOL win_settings_main_insert_categories(HWND hwndList)
for (i = 0; i < 9; i++)
{
lvI.pszText = win_language_get_settings_category(i);
lvI.pszText = win_get_string(IDS_2065+i);
lvI.iItem = i;
lvI.iImage = i;

View File

@@ -8,7 +8,7 @@
*
* Implement the application's Status Bar.
*
* Version: @(#)win_stbar.c 1.0.2 2017/10/06
* Version: @(#)win_stbar.c 1.0.2 2017/10/07
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -49,7 +49,6 @@
#include "plat_ui.h"
#include "win.h"
#include "win_cdrom_ioctl.h"
#include "win_language.h"
HWND hwndSBAR;
@@ -133,15 +132,15 @@ static void
StatusBarCreateFloppySubmenu(HMENU m, int id)
{
AppendMenu(m, MF_STRING, IDM_FLOPPY_IMAGE_NEW | id,
win_language_get_string_from_id(IDS_2161));
win_get_string(IDS_2161));
AppendMenu(m, MF_SEPARATOR, 0, 0);
AppendMenu(m, MF_STRING, IDM_FLOPPY_IMAGE_EXISTING | id,
win_language_get_string_from_id(IDS_2162));
win_get_string(IDS_2162));
AppendMenu(m, MF_STRING, IDM_FLOPPY_IMAGE_EXISTING_WP | id,
win_language_get_string_from_id(IDS_2163));
win_get_string(IDS_2163));
AppendMenu(m, MF_SEPARATOR, 0, 0);
AppendMenu(m, MF_STRING, IDM_FLOPPY_EJECT | id,
win_language_get_string_from_id(IDS_2164));
win_get_string(IDS_2164));
}
@@ -152,15 +151,15 @@ StatusBarCreateCdromSubmenu(HMENU m, int id)
int i;
AppendMenu(m, MF_STRING, IDM_CDROM_MUTE | id,
win_language_get_string_from_id(IDS_2165));
win_get_string(IDS_2165));
AppendMenu(m, MF_SEPARATOR, 0, 0);
AppendMenu(m, MF_STRING, IDM_CDROM_EMPTY | id,
win_language_get_string_from_id(IDS_2166));
win_get_string(IDS_2166));
AppendMenu(m, MF_STRING, IDM_CDROM_RELOAD | id,
win_language_get_string_from_id(IDS_2167));
win_get_string(IDS_2167));
AppendMenu(m, MF_SEPARATOR, 0, 0);
AppendMenu(m, MF_STRING, IDM_CDROM_IMAGE | id,
win_language_get_string_from_id(IDS_2168));
win_get_string(IDS_2168));
if (host_cdrom_drive_available_num == 0) {
if ((cdrom_drives[id].host_drive >= 'A') &&
@@ -207,17 +206,17 @@ static void
StatusBarCreateRemovableDiskSubmenu(HMENU m, int id)
{
AppendMenu(m, MF_STRING, IDM_RDISK_EJECT | id,
win_language_get_string_from_id(IDS_2166));
win_get_string(IDS_2166));
AppendMenu(m, MF_STRING, IDM_RDISK_RELOAD | id,
win_language_get_string_from_id(IDS_2167));
win_get_string(IDS_2167));
AppendMenu(m, MF_SEPARATOR, 0, 0);
AppendMenu(m, MF_STRING, IDM_RDISK_SEND_CHANGE | id,
win_language_get_string_from_id(IDS_2142));
win_get_string(IDS_2142));
AppendMenu(m, MF_SEPARATOR, 0, 0);
AppendMenu(m, MF_STRING, IDM_RDISK_IMAGE | id,
win_language_get_string_from_id(IDS_2168));
win_get_string(IDS_2168));
AppendMenu(m, MF_STRING, IDM_RDISK_IMAGE_WP | id,
win_language_get_string_from_id(IDS_2169));
win_get_string(IDS_2169));
}
@@ -307,10 +306,10 @@ StatusBarCreateFloppyTip(int part)
mbstowcs(wtext, fdd_getname(fdd_get_type(drive)),
strlen(fdd_getname(fdd_get_type(drive))) + 1);
if (wcslen(floppyfns[drive]) == 0) {
_swprintf(tempTip, win_language_get_string_from_id(IDS_2158),
drive+1, wtext, win_language_get_string_from_id(IDS_2057));
_swprintf(tempTip, win_get_string(IDS_2158),
drive+1, wtext, win_get_string(IDS_2057));
} else {
_swprintf(tempTip, win_language_get_string_from_id(IDS_2158),
_swprintf(tempTip, win_get_string(IDS_2158),
drive+1, wtext, floppyfns[drive]);
}
@@ -332,24 +331,24 @@ StatusBarCreateCdromTip(int part)
int bus = cdrom_drives[drive].bus_type;
id = IDS_4352 + (bus - 1);
szText = (WCHAR *)win_language_get_string_from_id(id);
szText = (WCHAR *)win_get_string(id);
if (cdrom_drives[drive].host_drive == 200) {
if (wcslen(cdrom_image[drive].image_path) == 0) {
_swprintf(tempTip, win_language_get_string_from_id(IDS_5120), drive + 1, szText, win_language_get_string_from_id(IDS_2057));
_swprintf(tempTip, win_get_string(IDS_5120), drive + 1, szText, win_get_string(IDS_2057));
} else {
_swprintf(tempTip, win_language_get_string_from_id(IDS_5120), drive + 1, szText, cdrom_image[drive].image_path);
_swprintf(tempTip, win_get_string(IDS_5120), drive + 1, szText, cdrom_image[drive].image_path);
}
} else if ((cdrom_drives[drive].host_drive >= 'A') && (cdrom_drives[drive].host_drive <= 'Z')) {
_swprintf(wtext, win_language_get_string_from_id(IDS_2058), cdrom_drives[drive].host_drive & ~0x20);
_swprintf(tempTip, win_language_get_string_from_id(IDS_5120), drive + 1, szText, wtext);
_swprintf(wtext, win_get_string(IDS_2058), cdrom_drives[drive].host_drive & ~0x20);
_swprintf(tempTip, win_get_string(IDS_5120), drive + 1, szText, wtext);
} else {
_swprintf(tempTip, win_language_get_string_from_id(IDS_5120), drive + 1, szText, win_language_get_string_from_id(IDS_2057));
_swprintf(tempTip, win_get_string(IDS_5120), drive + 1, szText, win_get_string(IDS_2057));
}
if (sbTips[part] != NULL)
free(sbTips[part]);
sbTips[part] = (WCHAR *) malloc((wcslen(tempTip) << 1) + 2);
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
wcscpy(sbTips[part], tempTip);
}
@@ -361,14 +360,14 @@ StatusBarCreateRemovableDiskTip(int part)
int drive = sb_part_meanings[part] & 0x1f;
if (wcslen(hdd[drive].fn) == 0) {
_swprintf(tempTip, win_language_get_string_from_id(IDS_4115), drive, win_language_get_string_from_id(IDS_2057));
_swprintf(tempTip, win_get_string(IDS_4115), drive, win_get_string(IDS_2057));
} else {
_swprintf(tempTip, win_language_get_string_from_id(IDS_4115), drive, hdd[drive].fn);
_swprintf(tempTip, win_get_string(IDS_4115), drive, hdd[drive].fn);
}
if (sbTips[part] != NULL)
free(sbTips[part]);
sbTips[part] = (WCHAR *) malloc((wcslen(tempTip) << 1) + 2);
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
wcscpy(sbTips[part], tempTip);
}
@@ -382,12 +381,12 @@ StatusBarCreateDiskTip(int part)
int bus = sb_part_meanings[part] & 0xf;
id = IDS_4352 + (bus - 1);
szText = (WCHAR *)win_language_get_string_from_id(id);
szText = (WCHAR *)win_get_string(id);
_swprintf(tempTip, win_language_get_string_from_id(IDS_4096), szText);
_swprintf(tempTip, win_get_string(IDS_4096), szText);
if (sbTips[part] != NULL)
free(sbTips[part]);
sbTips[part] = (WCHAR *) malloc((wcslen(tempTip) << 1) + 2);
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
wcscpy(sbTips[part], tempTip);
}
@@ -397,11 +396,11 @@ StatusBarCreateNetworkTip(int part)
{
WCHAR tempTip[512];
_swprintf(tempTip, win_language_get_string_from_id(IDS_2069));
_swprintf(tempTip, win_get_string(IDS_2069));
if (sbTips[part] != NULL)
free(sbTips[part]);
sbTips[part] = (WCHAR *) malloc((wcslen(tempTip) << 1) + 2);
sbTips[part] = (WCHAR *)malloc((wcslen(tempTip) << 1) + 2);
wcscpy(sbTips[part], tempTip);
}