This commit is contained in:
Wengier 2022-06-30 13:29:38 -04:00
parent 29d83d8d74
commit da56cc290c
8 changed files with 91 additions and 42 deletions

View File

@ -103,6 +103,8 @@
the window below the minimum supported by the
DOS screen will not longer trigger segfaults or
assertion failures. Issue #3348. (joncampbell123).
- Fix IME not working on Windows when -langcp option
is used to load a language with codepage. (Wengier)
- Fixed INT 10h failing to fully clear Tandy video
memory when entering 16-color graphics modes.
(joncampbell123).

View File

@ -56,7 +56,7 @@ dosbox-x.app: src/dosbox-x contrib/macos/dosbox.icns src/tool/mach-o-matic
done; \
src/tool/mach-o-matic dosbox-x.app/Contents/MacOS/dosbox-x || exit 1; \
codesign --deep -s - dosbox-x.app/Contents/MacOS/dosbox-x || exit 1
cp -v contrib/macos/readme.txt README.txt
cp -v contrib/macos/readme.txt dosbox-x.app/README.txt
debug-dosbox-x-app:
(cd dosbox-x.app/Contents/MacOS && (DYLD_PRINT_LIBRARIES=1 ./dosbox-x -defaultconf -defaultdir . -silent -c 'echo hello' -c 'exit')) 2>mac-os-x-dylib-report.txt

View File

@ -10,7 +10,7 @@
<category>Emulation</category>
</categories>
<releases>
<release version="@PACKAGE_VERSION@" date="2022-6-27"/>
<release version="@PACKAGE_VERSION@" date="2022-6-30"/>
</releases>
<screenshots>
<screenshot type="default">

View File

@ -1,4 +1,4 @@
/*auto-generated*/
#define UPDATED_STR "Jun 27, 2022 11:17:06pm"
#define GIT_COMMIT_HASH "ea848fe"
#define UPDATED_STR "Jun 30, 2022 12:01:46pm"
#define GIT_COMMIT_HASH "29d83d8"
#define COPYRIGHT_END_YEAR "2022"

View File

@ -140,7 +140,7 @@ extern bool VIDEO_BIOS_always_carry_14_high_font;
extern bool VIDEO_BIOS_always_carry_16_high_font;
extern bool VIDEO_BIOS_enable_CGA_8x8_second_half;
extern bool allow_more_than_640kb, del_flag;
extern bool sync_time, enableime;
extern bool sync_time, enableime, tonoime;
extern int freesizecap;
extern unsigned int page;
@ -948,6 +948,35 @@ void SetCyclesCount_mapper_shortcut(bool pressed) {
PIC_AddEvent(SetCyclesCount_mapper_shortcut_RunEvent, 0.0001f); //In case mapper deletes the key object that ran it
}
void SetIME() {
#if (defined(WIN32) && !defined(HX_DOS) || defined(LINUX) && C_X11) && !defined(C_SDL2) && defined(SDL_DOSBOX_X_SPECIAL)
if (enableime && !control->opt_silent) {
dos.im_enable_flag = true;
SDL_SetIMValues(SDL_IM_ENABLE, 1, NULL);
#if defined(WIN32)
SDL_EnableUNICODE(1);
#endif
} else if (!control->opt_silent) {
dos.im_enable_flag = false;
SDL_SetIMValues(SDL_IM_ENABLE, 0, NULL);
}
#elif (defined(WIN32) && !defined(HX_DOS) || defined(LINUX) && C_X11) && defined(C_SDL2)
if (enableime && !control->opt_silent) {
#if !defined(SDL_DOSBOX_X_IME)
LOG_MSG("Note: The linked SDL 2.x library is not compiled with enhanced IME functions.");
#endif
dos.im_enable_flag = true;
SDL_StartTextInput();
#if defined(LINUX)
SDL_SetHint(SDL_HINT_IME_INTERNAL_EDITING, "1");
#endif
} else if (!control->opt_silent) {
dos.im_enable_flag = false;
SDL_StopTextInput();
}
#endif
}
void DOSBOX_RealInit() {
DOSBoxMenu::item *item;
@ -1118,32 +1147,7 @@ void DOSBOX_RealInit() {
makeseacp951table();
}
dos.loaded_codepage = cp;
#if (defined(WIN32) && !defined(HX_DOS) || defined(LINUX) && C_X11) && !defined(C_SDL2) && defined(SDL_DOSBOX_X_SPECIAL)
if (enableime && !control->opt_silent) {
dos.im_enable_flag = true;
SDL_SetIMValues(SDL_IM_ENABLE, 1, NULL);
#if defined(WIN32)
SDL_EnableUNICODE(1);
#endif
} else if (!control->opt_silent) {
dos.im_enable_flag = false;
SDL_SetIMValues(SDL_IM_ENABLE, 0, NULL);
}
#elif (defined(WIN32) && !defined(HX_DOS) || defined(LINUX) && C_X11) && defined(C_SDL2)
if (enableime && !control->opt_silent) {
#if !defined(SDL_DOSBOX_X_IME)
LOG_MSG("Note: The linked SDL 2.x library is not compiled with enhanced IME functions.");
#endif
dos.im_enable_flag = true;
SDL_StartTextInput();
#if defined(LINUX)
SDL_SetHint(SDL_HINT_IME_INTERNAL_EDITING, "1");
#endif
} else if (!control->opt_silent) {
dos.im_enable_flag = false;
SDL_StopTextInput();
}
#endif
if (!tonoime) SetIME();
#if defined(USE_TTF)
if (IS_PC98_ARCH) ttf.cols = 80; // The number of columns on the screen is apparently fixed to 80 in PC-98 mode at this time
#endif

View File

@ -51,8 +51,6 @@ int transparency=0;
int selsrow = -1, selscol = -1;
int selerow = -1, selecol = -1;
int middleunlock = 1;
bool rtl = false;
bool selmark = false;
extern bool testerr;
extern bool blinking;
extern bool dpi_aware_enable;
@ -71,7 +69,8 @@ bool checkmenuwidth = false;
bool dos_kernel_disabled = true;
bool winrun=false, use_save_file=false;
bool maximize = false, tooutttf = false;
bool usesystemcursor = false, enableime = false;
bool tonoime = false, enableime = false;
bool usesystemcursor = false, rtl = false, selmark = false;
bool mountfro[26], mountiro[26];
bool OpenGL_using(void), Direct3D_using(void);
void DOSBox_SetSysMenu(void), GFX_OpenGLRedrawScreen(void), InitFontHandle(void), DOSV_FillScreen(void), SetWindowTransparency(int trans);
@ -8292,12 +8291,13 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
force_conversion = true;
int cp=dos.loaded_codepage;
if (InitCodePage() && isDBCSCP()) enableime = true;
else if (control->opt_langcp) tonoime = true;
force_conversion = false;
dos.loaded_codepage=cp;
}
}
#if defined(WIN32) && !defined(HX_DOS)
if (!enableime) ImmDisableIME((DWORD)(-1));
if (!enableime&&!tonoime) ImmDisableIME((DWORD)(-1));
#endif
}

View File

@ -34,11 +34,11 @@
#include <string>
using namespace std;
extern bool dos_kernel_disabled, force_conversion, showdbcs, dbcs_sbcs;
extern bool dos_kernel_disabled, force_conversion, showdbcs, dbcs_sbcs, enableime, tonoime;
int msgcodepage = 0, FileDirExistUTF8(std::string &localname, const char *name);
bool morelen = false, inmsg = false, loadlang = false, systemmessagebox(char const * aTitle, char const * aMessage, char const * aDialogType, char const * aIconType, int aDefaultButton);
bool isSupportedCP(int newCP), CodePageHostToGuestUTF8(char *d/*CROSS_LEN*/,const char *s/*CROSS_LEN*/), CodePageGuestToHostUTF8(char *d/*CROSS_LEN*/,const char *s/*CROSS_LEN*/);
void InitFontHandle(void), ShutFontHandle(void), menu_update_dynamic(void), menu_update_autocycle(void), update_bindbutton_text(void), set_eventbutton_text(const char *eventname, const char *buttonname), JFONT_Init();
void InitFontHandle(void), ShutFontHandle(void), SetIME(void), menu_update_dynamic(void), menu_update_autocycle(void), update_bindbutton_text(void), set_eventbutton_text(const char *eventname, const char *buttonname), JFONT_Init();
std::string langname = "", langnote = "", GetDOSBoxXPath(bool withexe=false);
#define LINE_IN_MAXLEN 2048
@ -421,8 +421,21 @@ void MSG_Init() {
if (strlen(countrystr)>10) countrystr[0] = 0;
sprintf(cstr, "%s,%d", countrystr, msgcodepage);
SetVal("config", "country", cstr);
const char *imestr = section->Get_string("ime");
if (tonoime && !strcasecmp(imestr, "auto") && (msgcodepage == 932 || msgcodepage == 936 || msgcodepage == 949 || msgcodepage == 950 || msgcodepage == 951)) {
tonoime = false;
enableime = true;
SetIME();
}
}
}
if (tonoime) {
tonoime = enableime = false;
#if defined(WIN32) && !defined(HX_DOS)
ImmDisableIME((DWORD)(-1));
#endif
SetIME();
}
}
else {
Prop_path* pathprop = section->Get_path("language");

View File

@ -26,6 +26,7 @@ bool informd3d = false;
#if (HAVE_D3D9_H) && defined(WIN32)
int FileDirExistCP(const char *name);
std::string GetDOSBoxXPath(bool withexe=false);
extern Bitu currentWindowWidth, currentWindowHeight;
#include "direct3d.h"
@ -63,16 +64,45 @@ std::string shader_translate_directory(const std::string& path) {
DOSBox-X's variation is to NOT prefix shaders\ to it if it looks like a
full path, with or without a drive letter. */
if (path.length() >= 2 && isalpha(path[0]) && path[1] == ':') /* drive letter ex. C:, D:, etc. */
return path;
if (path.length() >= 1 && path.find('\\') != std::string::npos) /* perhaps a path with "\" */
return path;
if (FileDirExistCP(path.c_str())==1)
return path;
if (FileDirExistCP((path+".fx").c_str())==1)
return path+".fx";
if (FileDirExistCP(("shaders\\"+path+".fx").c_str())==1)
return "shaders\\"+path+".fx";
std::string confpath, respath, exepath=GetDOSBoxXPath();
Cross::GetPlatformConfigDir(confpath), Cross::GetPlatformResDir(respath);
if (exepath.size()) {
if (FileDirExistCP((exepath+path).c_str())==1)
return exepath+path;
if (FileDirExistCP((exepath+path+".fx").c_str())==1)
return exepath+path+".fx";
if (FileDirExistCP((exepath+"shaders\\"+path).c_str())==1)
return exepath+"shaders\\"+path;
if (FileDirExistCP((exepath+"shaders\\"+path+".fx").c_str())==1)
return exepath+"shaders\\"+path+".fx";
}
if (confpath.size()) {
if (FileDirExistCP((confpath+path).c_str())==1)
return confpath+path;
if (FileDirExistCP((confpath+path+".fx").c_str())==1)
return confpath+path+".fx";
if (FileDirExistCP((confpath+"shaders\\"+path).c_str())==1)
return confpath+"shaders\\"+path;
if (FileDirExistCP((confpath+"shaders\\"+path+".fx").c_str())==1)
return confpath+"shaders\\"+path+".fx";
}
if (respath.size()) {
if (FileDirExistCP((respath+path).c_str())==1)
return respath+path;
if (FileDirExistCP((respath+path+".fx").c_str())==1)
return respath+path+".fx";
if (FileDirExistCP((respath+"shaders\\"+path).c_str())==1)
return respath+"shaders\\"+path;
if (FileDirExistCP((respath+"shaders\\"+path+".fx").c_str())==1)
return respath+"shaders\\"+path+".fx";
}
return std::string("shaders\\") + path;
}
@ -1049,7 +1079,7 @@ HRESULT CDirect3D::LoadPixelShader(void)
}
#if LOG_D3D
LOG_MSG("D3D:Loading pixel shader from %s", pshader);
LOG_MSG("D3D:Loading pixel shader from %s", pshader.c_str());
#endif
psEffect->setinputDim((float)dwWidth, (float)dwHeight);